emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] allow function values for `enable-local-eval'


From: Kim F. Storm
Subject: Re: [PATCH] allow function values for `enable-local-eval'
Date: 29 Jun 2002 02:55:23 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Karl Fogel <address@hidden> writes:

> Richard Stallman <address@hidden> writes:
> > That is a general basis for a solution, but it has no specific
> > knowledge; it requires that to be provided by the user.  I'm not
> > necessarily rejecting it, but it would be more helpful to do something
> > that embody specific knowledge, and does the right thing (for some
> > cases) without requiring user customization.
> 
> Yeah, we could provide such functionality if we can think of it, but I
> think it's still necessary to offer the general solution.

I agree with Karl that allowing the user to fully customize this would
be very useful.  I'm working on a project where the files belonging to
one of the modules have a rather complicated -- but harmless -- eval:
which I would really like to be able to allow without confirmation
whenever I open one of those files (which I do fairly often).

And as Karl says, emacs cannot possibly treat this as "standard
knowledge".

For this, user customization is a good thing!

But maybe it would be better to have a more hook-like approach
such as having a special hook like
        enable-local-eval-functions
which are run until success (i.e. any of the functions may return 
true to allow a specific eval to be executed), and if all of them
returns false, the default method is used according to enable-local-eval
(i.e. ignore or ask user for confirmation).

Something like

        (if (or (run-hook-with-args-until-success
                 'enable-local-eval-functions val)
                (eq enable-local-eval t)
                (and enable-local-eval
                     (y-or-n-p ...)))
            (eval ...))

-- 
Kim F. Storm <address@hidden> http://www.cua.dk




reply via email to

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