emacs-devel
[Top][All Lists]
Advanced

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

Re: find-file-hook as illustration of Custom problems


From: Richard Stallman
Subject: Re: find-file-hook as illustration of Custom problems
Date: Sat, 05 Feb 2005 12:38:33 -0500

    The problem is that vc-hooks.el contains:

    (add-hook 'find-file-hook 'vc-find-file-hook)

    and autorevert.el contains:

    (add-hook 'find-file-hook
                (lambda ()
                    (set (make-local-variable 'auto-revert-tail-pos)
                          (save-restriction (widen) (1- (point-max))))))

Such code is legitimate, and it would be absurd to call it broken.
The hook in vc-hooks.el could be replaced with  explicit code
inside after-find-file, and that might be an improvement.
But we can't do that for other uses of the hook.  This is what
the hook is meant for.

For the case of hooks, we could imagine changing cus-edit.el so that
edits made using Custom only affect elements that were installed using
Custom.  Any other elements could be invisible and untouchable; or
they might be displayed in a separate way as "program-added hooks" and
untouchable through the usual Custom features.  In effect, this means
treating a single list as if it were the combination of too list
values, one to be edited through Custom and one to be updated
by programs.

I don't know how hard this would be.




reply via email to

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