unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Moving handlers out of desktop.el
@ 2004-04-06 11:47 Lars Hansen
  2004-04-08  9:43 ` Juri Linkov
  2004-04-13 11:48 ` Juri Linkov
  0 siblings, 2 replies; 14+ messages in thread
From: Lars Hansen @ 2004-04-06 11:47 UTC (permalink / raw)


For a long time it has annoyed me that desktop.el has pieces of code 
that really ought not be there. I am talking about the functions
   `desktop-buffer-dired'
   `desktop-buffer-rmail'
   `desktop-buffer-mh'
   `desktop-buffer-info'
that holds code specific to dired, rmail, mh and info respectively, and 
therefore ought to be in those modules. Not only does it IMHO look 
messy, it also makes it more likely that one of these modules are 
changed but desktop.el forgotten.

The reason that the functions above are in desktop.el is, I guess, the 
following: When the desktop module restores a buffer, i calls the 
functions in `desktop-buffer-handlers' until one returns a buffer. By 
default desktop-buffer-handlers holds the four functions above together 
with a more general function `desktop-buffer-file'. If the functions 
above were moved to the respective modules, these would have to be 
loaded prior to desktop, and that's not good.

The functions in `desktop-buffer-misc-functions' also belong in their 
respective modules (dired and info), but I think they can be moved 
without problems since they are called at desktop save.

How about this change:
1. Move the functions above to their respective modules and give each an 
autoload cookie.
    Also move the two in `desktop-buffer-misc-functions'.
2. Add in desktop.el a new variable `desktop-buffer-mode-handlers' with 
a default value like
    (('dired-mode . 'desktop-buffer-dired)
     ('rmail-mode . 'desktop-buffer-rmail)
     ('mh-folder-mode 'desktop-buffer-mh)
     ('Info-mode . 'desktop-buffer-info))
3. Replace in `desktop-buffer-handlers' the four functions above with a 
function `desktop-buffer-special-mode' looking in the alist above for a 
handler.

What do you think about this?

Lars

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

end of thread, other threads:[~2004-04-21 21:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-06 11:47 Moving handlers out of desktop.el Lars Hansen
2004-04-08  9:43 ` Juri Linkov
2004-04-10 21:31   ` Lars Hansen
2004-04-10 22:32     ` Juri Linkov
2004-04-11  8:04       ` Lars Hansen
2004-04-11  8:16         ` Lars Hansen
2004-04-13 11:48 ` Juri Linkov
2004-04-13 12:51   ` Stefan Monnier
2004-04-13 13:01   ` Lars Hansen
2004-04-13 15:12     ` Juri Linkov
2004-04-13 20:46       ` Juri Linkov
2004-04-21 21:28         ` Lars Hansen
2004-04-13 13:05   ` David Kastrup
2004-04-13 15:15     ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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