[Top][All Lists]

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

Re: Moving handlers out of desktop.el

From: David Kastrup
Subject: Re: Moving handlers out of desktop.el
Date: 13 Apr 2004 15:05:48 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Juri Linkov <address@hidden> writes:

> Lars Hansen <address@hidden> writes:
> > 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'.
> I think moving the desktop functions AS IS to respective packages is
> not good, because these packages shouldn't depend on the desktop package.
> Making general functions (with an autoload cookie) from them would be
> good.  Such functions could have general arguments and be useful
> for other purposes as well.  Otherwise, if such generalization is not
> possible, the current desktop implementation is good enough.

Except that it is not maintainable.  This thread started with a
complaint about that.

> > 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.
> This could be done independently from the first item.

But it does not make sense without putting the handlers where they
belong.  And where the byte compiler will warn if they are using bad
variables and so on.  And where they'll be autoloaded along with the
respective mode only when they are needed.

I find the original proposal much better.

David Kastrup, Kriemhildstr. 15, 44793 Bochum

reply via email to

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