unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* startup.el(normal-top-level-add-subdirs-to-load-path): include mtime in normal-top-level-add-subdirs-inode-list?
@ 2005-12-16  2:10 Evgeny Roubinchtein
  2005-12-20 16:33 ` Richard M. Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Evgeny Roubinchtein @ 2005-12-16  2:10 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-12-20 16:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-16  2:10 startup.el(normal-top-level-add-subdirs-to-load-path): include mtime in normal-top-level-add-subdirs-inode-list? Evgeny Roubinchtein
2005-12-20 16:33 ` Richard M. Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).