emacs-devel
[Top][All Lists]
Advanced

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

Re: status of dir-vars or dir-locals inclusion in emacs?


From: Vagn Johansen
Subject: Re: status of dir-vars or dir-locals inclusion in emacs?
Date: Sun, 02 Sep 2007 13:56:31 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (windows-nt)

Tom Tromey <address@hidden> writes:

>>>>>> "rms" == Richard Stallman <address@hidden> writes:
>
> [project.el]
> rms> It looks ready to install, as far as I can see, aside from some
> rms> minor points.  Do you disagree?
>
> I do agree.  I've made the changes you suggested, and I've finally
> updated the documentation and NEWS.  Patch appended.  Let me know what
> you think; I can revise (perhaps slowly :-) if needed.


You still have a "FIXME" in a comment in
project-filter-risky-variables.

One problem is that not-safe variables are just ignored. When I first
tried project.el I could not understand why it did not work. I had to
debug to discover that lisp-indent-offset was not safe.

The obvious solution is to make it use the same UI as the existing
local variables functionality. See hack-local-variables-confirm in
files.el.


> +
> +(defun project-filter-risky-variables (alist)
> +  "Filter risky variables from the project settings ALIST.
> +This knows the expected structure of a project settings alist.
> +Actually this filters unsafe variables."
> +  (dolist (elt alist)
> +    (let ((sub-alist (cdr elt)))
> +      (if (stringp (car sub-alist))
> +       ;; A string element maps to a secondary alist.
> +       (setcdr sub-alist
> +               (project-filter-risky-variables (cdr sub-alist)))
> +     ;; Remove unsafe variables by setting their cars to nil.
> +     ;; FIXME: or look only at risky-local-variable-p?
> +     (dolist (sub-elt sub-alist)
> +       (unless (safe-local-variable-p (car sub-elt) (cdr sub-elt))
> +         (setcar sub-elt nil)))
> +     ;; Now remove all the deleted risky variables.
> +     (setcdr elt (assq-delete-all nil sub-alist)))))
> +  alist)
> +


-- 
Vagn Johansen





reply via email to

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