GNU bug report logs - #7516
[PATCH] lisp/startup.el (normal-top-level-add-subdirs-to-load-path) Exclude more VCS dirs

Previous Next

Package: emacs;

Reported by: Jari Aalto <jari.aalto <at> cante.net>

Date: Mon, 29 Nov 2010 14:00:04 UTC

Severity: wishlist

Tags: notabug

Found in version 23.2+1-5.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jari Aalto <jari.aalto <at> cante.net>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 7516 <at> debbugs.gnu.org
Subject: bug#7516: [PATCH] lisp/startup.el (normal-top-level-add-subdirs-to-load-path) Exclude more VCS dirs
Date: Tue, 30 Nov 2010 00:33:51 +0200
[Message part 1 (text/plain, inline)]
2010-11-29 20:11 Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
>>         * startup.el: (normal-top-level-add-subdirs-to-load-path): Exclude
>>         more VCS directories: .svn, .hg, .bzr, .git and .mtn (monotone).
>
> Wouldn't it make more sense to skip anything that starts with a dot?

Sure. See below.

Jari

2010-11-29  Jari Aalto  <jari.aalto <at> cante.net>

        * startup.el (normal-top-level-add-subdirs-to-load-path): Change
        `member' to `string-match' file test.  Skip all dot-files.


[0001-startup.el-normal-top-level-add-subdirs-to-load-path.patch (text/x-diff, inline)]
From 77eb2b69e60378fbfd8e1d70630ec136638381cd Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aalto <at> cante.net>
Date: Mon, 29 Nov 2010 15:52:58 +0200
Subject: [PATCH] startup.el: (normal-top-level-add-subdirs-to-load-path): Skip all dot files.
Organization: Private
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit


Signed-off-by: Jari Aalto <jari.aalto <at> cante.net>
---
 lisp/startup.el |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lisp/startup.el b/lisp/startup.el
index da0264d..5b9b62b 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -419,7 +419,9 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
 	  (push attrs normal-top-level-add-subdirs-inode-list)
 	  (dolist (file contents)
 	    ;; The lower-case variants of RCS and CVS are for DOS/Windows.
-	    (unless (member file '("." ".." "RCS" "CVS" "rcs" "cvs"))
+	    ;; Skip all dot-files.
+	    (unless (let ((case-fold-search t))
+		      (string-match "^\\(RCS\\|CVS\\|\\..*\\)$" file))
 	      (when (and (string-match "\\`[[:alnum:]]" file)
 			 ;; Avoid doing a `stat' when it isn't necessary
 			 ;; because that can cause trouble when an NFS server
-- 
1.7.2.3


This bug report was last modified 14 years and 174 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.