bug-gnu-emacs
[Top][All Lists]
Advanced

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

startup.el(normal-top-level-add-subdirs-to-load-path): include mtime in


From: Evgeny Roubinchtein
Subject: startup.el(normal-top-level-add-subdirs-to-load-path): include mtime in normal-top-level-add-subdirs-inode-list?
Date: Thu, 15 Dec 2005 18:10:13 -0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.51 (berkeley-unix)

I appologize if something like this has already been suggested (and
rejected), but was any thought given to including last modification
time in the normal-top-level-add-subdirs-inode-list in the function
normal-top-level-add-subdirs-to-load-path defined in startup.el?

The idea is that I would like to be able to add some directories to
$PREFIX/share/emacs/site-lisp (for example), load
$PREFIX/share/emacs/site-lisp/subdirs.el, and have the site-lisp
directory re-walked, so the directories I've just added get found.

Right now, to accomplish this, I'd have to first do something like:

(setq normal-top-level-add-subdirs-inode-list
      (remove (nthcdr 10 (file-attributes "$PREFIX/share/emacs/site-lisp"))
              normal-top-level-add-subdirs-inode-list))

(not a _huge_ deal, but I had to look at startup.el to learn about the
existance of normal-top-level-add-subdirs-inode-list, and it seems
that adding mtime in would make it so things "just work").

One drawback I can see to my patch (below) is that _old_ entries
wouldn't get removed, so normal-top-level-add-subdirs-inode-list would
slowly grow for as long as Emacs is running.

Any comments appreciated.

*** /tmp/ediff28227jgS  Thu Dec 15 11:13:50 2005
--- /tmp/ediff28227wqY  Thu Dec 15 11:13:50 2005
***************
*** 14,25 ****
             (contents (directory-files this-dir))
             (default-directory this-dir)
             (canonicalized (if (fboundp 'untranslated-canonical-name)
!                               (untranslated-canonical-name this-dir))))
        ;; The Windows version doesn't report meaningful inode
        ;; numbers, so use the canonicalized absolute file name of the
        ;; directory instead.
!       (setq attrs (or canonicalized
!                       (nthcdr 10 (file-attributes this-dir))))
        (unless (member attrs normal-top-level-add-subdirs-inode-list)
          (push attrs normal-top-level-add-subdirs-inode-list)
          (dolist (file contents)
--- 14,27 ----
             (contents (directory-files this-dir))
             (default-directory this-dir)
             (canonicalized (if (fboundp 'untranslated-canonical-name)
!                               (untranslated-canonical-name this-dir)))
!            (all-attributes-for-this-dir (file-attributes this-dir)))
        ;; The Windows version doesn't report meaningful inode
        ;; numbers, so use the canonicalized absolute file name of the
        ;; directory instead.
!       (setq attrs (cons (or canonicalized
!                             (nthcdr 10 all-attributes-for-this-dir))
!                         (nth 5 all-attributes-for-this-dir)))
        (unless (member attrs normal-top-level-add-subdirs-inode-list)
          (push attrs normal-top-level-add-subdirs-inode-list)
          (dolist (file contents)

--
Evgeny




reply via email to

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