[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: /srv/bzr/emacs/trunk r100059: (bug-reference-url-format): Mark as `s
From: |
Sam Steingold |
Subject: |
Re: /srv/bzr/emacs/trunk r100059: (bug-reference-url-format): Mark as `safe-local-variable' if the value |
Date: |
Tue, 27 Apr 2010 19:10:59 -0400 |
On 4/27/10, Chong Yidong <address@hidden> wrote:
> Sam Steingold <address@hidden> writes:
>
> > this means that I cannot really set bug-reference-url-format in the
> > "Local Variables:"
> > section together with "mode: bug-reference" if I also set
> > enable-local-variables to :safe.
> >
>
> > For your reference, I set bug-reference-url-format to
> > clisp-bug-reference-url-format:
> >
> > (defun clisp-bug-reference-url-format ()
> > (concat "http://sourceforge.net/tracker/index.php?func=detail&aid="
> > (match-string-no-properties 2)
> > "&group_id=1355&atid="
> > (let ((kind (match-string-no-properties 1)))
> > (cond ((string-match "[Bb]ug" kind) "101355")
> > ((string-match "[Pp]atch" kind) "301355")
> > ((string-match "RFE" kind) "351355")
> > (t (error "unknown bug kind [%s]" kind))))))
>
>
> Where do you define clisp-bug-reference-url-format? In your init file?
no, it is a part of the clisp distribution (and cvs tree)
> If so, you could probably add
>
> (put 'bug-reference-url-format 'safe-local-variable
> (lambda (s) (or (stringp s)
> (eq s 'clisp-bug-reference-url-format))))
>
> at the same place.
>
brilliant!
actually, I think the right way is
(put 'bug-reference-url-format 'safe-local-variable
(let ((f (get 'bug-reference-url-format 'safe-local-variable)))
(lambda (s) (or (funcall f s) (eq s 'clisp-bug-reference-url-format)))))
so that if others do that too, I will not override them.
in fact, maybe the above should be a standard function
(add-safe-value variable symbol)
--
Sam Steingold <http://sds.podval.org>