help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: view-mode dismissed when changing major mode


From: Johan Bockgård
Subject: Re: view-mode dismissed when changing major mode
Date: Fri, 27 Apr 2007 16:31:21 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.93 (gnu/linux)

Holger Sparr <sparr+usenet@mfk.tu-dresden.de> writes:

> When opening a file with view-file and then switching to a different
> major mode to get some fontification the view-mode is dismmissed.
>
> Is this intended behavior?

Yes.

    (defun view-mode-enable ()
      "Turn on View mode."
      ;; Always leave view mode before changing major mode.
      ;; This is to guarantee that the buffer-read-only variable is restored.
      (add-hook 'change-major-mode-hook 'view-mode-disable nil t)
      [...]

-- 
Johan Bockgård


reply via email to

[Prev in Thread] Current Thread [Next in Thread]