From: Vagn Johansen <gonz808@hotmail.com>
To: emacs-devel@gnu.org
Subject: Re: project variable patch #2
Date: Mon, 10 Sep 2007 20:07:16 +0200 [thread overview]
Message-ID: <uir6is8bv.fsf@hotmail.com> (raw)
In-Reply-To: m38x7f4efp.fsf@fleche.redhat.com
Tom Tromey <tromey@redhat.com> writes:
> Here's the next revision of patch that used to be "project.el".
> +(defun project-find-settings-file (file)
> + (while (and (not (string= dir "/"))
> + (not result))
> + (cond
> + ((setq result (assoc dir project-directory-alist))
> + ;; Nothing else.
> + nil)
> + ((file-exists-p (concat dir ".dir-settings.el"))
> + (setq result (concat dir ".dir-settings.el")))
> + (t
> + (setq dir (file-name-directory (directory-file-name dir))))))
> + result))
This can cause infinite loops on windows because the dir variable will
end up as c:/ and the setq dir at the bottom will set it to c:/ again.
> +(defun project-filter-risky-variables (alist)
> + (setcdr sub-alist
> + (project-filter-risky-variables (cdr sub-alist)))
> + ;; Remove unsafe variables by setting their cars to nil.
> + (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)
> +
This can silently ignore settings. Take a look at
hack-local-variables-confirm in files.el to see how this is handled
for Local Variables.
--
Vagn Johansen
prev parent reply other threads:[~2007-09-10 18:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-09 23:16 project variable patch #2 Tom Tromey
2007-09-10 1:13 ` Richard Stallman
2007-09-10 2:52 ` Stefan Monnier
2007-09-10 18:07 ` Vagn Johansen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=uir6is8bv.fsf@hotmail.com \
--to=gonz808@hotmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.