unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Evgeny Roubinchtein <zhenya@freeshell.org>
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	[thread overview]
Message-ID: <8664pp23ne.fsf@evgeny.isilon.com> (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

             reply	other threads:[~2005-12-16  2:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-16  2:10 Evgeny Roubinchtein [this message]
2005-12-20 16:33 ` startup.el(normal-top-level-add-subdirs-to-load-path): include mtime in normal-top-level-add-subdirs-inode-list? Richard M. Stallman

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8664pp23ne.fsf@evgeny.isilon.com \
    --to=zhenya@freeshell.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 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).