emacs-devel
[Top][All Lists]
Advanced

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

Re: doc-view compilation warnings


From: Stefan Monnier
Subject: Re: doc-view compilation warnings
Date: Tue, 23 Oct 2007 17:53:46 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

>>>> > +(push '("\\.[eE]?[pP][sS]\\'" . doc-view-mode-maybe) auto-mode-alist)
>>>> > +(push '("\\.[Dd][Vv][Ii]\\'"  . doc-view-mode-maybe) auto-mode-alist)
>>>> > +(push '("\\.[Pp][Dd][Ff]\\'"  . doc-view-mode-maybe) auto-mode-alist)
>>>> 
>>>> In general loading a file should not have side effects like this. 
>>>> IMHO, it is not idea to do things this way...
>> 
>>> So what would you suggest?  A function `doc-view-initialize' that
>>> does this?
>> 
>> You could put it directly into files.el.

> That would load doc-view unconditionally when a user opens a pdf/ps/dvi
> file.  That's ok with me, but others might think different.

> But someone should decide: Is loading doc-view when opening ps/pdf/dvi
> files ok?

It doesn't look like a problem to me, as long as it doesn't show PS files
using doc-view by default.

Note that it may be simpler to setup auto-mode-alist to map *.ps to ps-mode
and dvi and pdf files to doc-view-mode and then change ps-mode to activate
doc-view-minor-mode explicitly and unconditionally.  That will save you from
defining doc-view-mode-maybe.

I'd also be very happy to get rid of the doc-view-clean-auto-mode-alist
monstrosity by just saying "if you're not using doc-view-minor-mode, then
toggling off doc-view puts you in fundamental-mode", or if you want to be
fancier, then save the previous major-mode when entering doc-view-mode (when
possible) and reuse that value when exiting it (like picture-mode does).


        Stefan




reply via email to

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