unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* view-mode dismissed when changing major mode
@ 2007-04-26 14:55 Holger Sparr
  2007-04-27 14:31 ` Johan Bockgård
  0 siblings, 1 reply; 3+ messages in thread
From: Holger Sparr @ 2007-04-26 14:55 UTC (permalink / raw)
  To: help-gnu-emacs


Hi,

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?

I am currently using:

GNU Emacs 22.0.93.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)


Holger

-- 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: view-mode dismissed when changing major mode
  2007-04-26 14:55 view-mode dismissed when changing major mode Holger Sparr
@ 2007-04-27 14:31 ` Johan Bockgård
  2007-05-02 12:27   ` Holger Sparr
  0 siblings, 1 reply; 3+ messages in thread
From: Johan Bockgård @ 2007-04-27 14:31 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: view-mode dismissed when changing major mode
  2007-04-27 14:31 ` Johan Bockgård
@ 2007-05-02 12:27   ` Holger Sparr
  0 siblings, 0 replies; 3+ messages in thread
From: Holger Sparr @ 2007-05-02 12:27 UTC (permalink / raw)
  To: help-gnu-emacs

Johan schrieb am 27.04.2007:

> 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)
>       [...]


Then I'd suggest a function 'View-fontify-buffer-according-to' and make
it available in the view-mode-map.  

This function should ask for a major mode for fontification, apply the
fontification and enable the view-mode afterwards.

This would make it handy to view files which do not match a regular
expression in auto-mode-alist.


Holger

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-02 12:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-26 14:55 view-mode dismissed when changing major mode Holger Sparr
2007-04-27 14:31 ` Johan Bockgård
2007-05-02 12:27   ` Holger Sparr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).