unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#7516: [PATCH] lisp/startup.el (normal-top-level-add-subdirs-to-load-path) Exclude more VCS dirs
@ 2010-11-29 14:04 Jari Aalto
  2010-11-29 18:11 ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Jari Aalto @ 2010-11-29 14:04 UTC (permalink / raw)
  To: 7516

[-- Attachment #1: Type: text/plain, Size: 823 bytes --]

Package: emacs
Version: 23.2+1-5.1
Severity: wishlist
Tags: patch

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

        * startup.el: (normal-top-level-add-subdirs-to-load-path): Exclude
        more VCS directories: .svn, .hg, .bzr, .git and .mtn (monotone).

-- System Information
Debian Release: squeeze/sid
  APT Prefers testing
  APT policy: (990, testing) (500, unstable) (1, experimental)
Architecture: amd64
Kernel: Linux picasso 2.6.32-5-amd64 #1 SMP Fri Sep 17 21:50:19 UTC 2010 x86_64 GNU/Linux
Locale: LANG=en_DK.UTF-8

-- Versions of packages `emacs depends on'.
Depends:
emacs23         23.2+1-5.1      GNU Emacs is the extensible self-documenting 
emacs23-lucid   23.2+1-5.1      GNU Emacs is the extensible self-documenting 
emacs23-nox     23.2+1-5.1      GNU Emacs is the extensible self-documenting 


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-startup.el-normal-top-level-add-subdirs-to-load-path.patch --]
[-- Type: text/x-diff, Size: 1245 bytes --]

From ebdacca7a561c40777a087ef4a16f2752895edab Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aalto@cante.net>
Date: Mon, 29 Nov 2010 15:52:58 +0200
Subject: [PATCH] * startup.el: (normal-top-level-add-subdirs-to-load-path): Exclude
 more VCS directories: .svn, .hg, .bzr, .git and .mtn (monotone).
Organization: Private
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit


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

diff --git a/lisp/startup.el b/lisp/startup.el
index da0264d..67f5ebc 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -419,7 +419,8 @@ 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"))
+	    (unless (member file '("." ".." "RCS" "CVS" "rcs" "cvs"
+				   ".svn" ".hg" ".bzr" ".git" .mtn"))
 	      (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


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

* bug#7516: [PATCH] lisp/startup.el (normal-top-level-add-subdirs-to-load-path) Exclude more VCS dirs
  2010-11-29 14:04 bug#7516: [PATCH] lisp/startup.el (normal-top-level-add-subdirs-to-load-path) Exclude more VCS dirs Jari Aalto
@ 2010-11-29 18:11 ` Stefan Monnier
  2010-11-29 22:33   ` Jari Aalto
  2010-11-29 22:34   ` Glenn Morris
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Monnier @ 2010-11-29 18:11 UTC (permalink / raw)
  To: Jari Aalto; +Cc: 7516

>         * 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?


        Stefan





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

* bug#7516: [PATCH] lisp/startup.el (normal-top-level-add-subdirs-to-load-path) Exclude more VCS dirs
  2010-11-29 18:11 ` Stefan Monnier
@ 2010-11-29 22:33   ` Jari Aalto
  2010-11-29 22:34   ` Glenn Morris
  1 sibling, 0 replies; 6+ messages in thread
From: Jari Aalto @ 2010-11-29 22:33 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 7516

[-- Attachment #1: Type: text/plain, Size: 502 bytes --]

2010-11-29 20:11 Stefan Monnier <monnier@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@cante.net>

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



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-startup.el-normal-top-level-add-subdirs-to-load-path.patch --]
[-- Type: text/x-diff, Size: 1214 bytes --]

From 77eb2b69e60378fbfd8e1d70630ec136638381cd Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aalto@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@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


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

* bug#7516: [PATCH] lisp/startup.el (normal-top-level-add-subdirs-to-load-path) Exclude more VCS dirs
  2010-11-29 18:11 ` Stefan Monnier
  2010-11-29 22:33   ` Jari Aalto
@ 2010-11-29 22:34   ` Glenn Morris
  2010-12-02 12:38     ` jari
  1 sibling, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2010-11-29 22:34 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 7516, Jari Aalto

Stefan Monnier wrote:

> Wouldn't it make more sense to skip anything that starts with a dot?

The very next line does:

(string-match "\\`[[:alnum:]]" file)

so this change seems unnecessary (the function is documented to behave
in this way). Empirically, .svn etc directories are already skipped,
so I don't see any point to this patch.





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

* bug#7516: [PATCH] lisp/startup.el (normal-top-level-add-subdirs-to-load-path) Exclude more VCS dirs
  2010-11-29 22:34   ` Glenn Morris
@ 2010-12-02 12:38     ` jari
  2010-12-03 18:58       ` Glenn Morris
  0 siblings, 1 reply; 6+ messages in thread
From: jari @ 2010-12-02 12:38 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 7516, Stefan Monnier

On 2010-11-29 17:34, Glenn Morris wrote:
| Stefan Monnier wrote:
| 
| > Wouldn't it make more sense to skip anything that starts with a dot?
| 
| The very next line does:
| 
| (string-match "\\`[[:alnum:]]" file)

Wouldn't the first two tests be redundant then in previous line:

      (unless (member file '("." ".." "RCS" "CVS" "rcs" "cvs"))
      	      	      	     ========
Jari





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

* bug#7516: [PATCH] lisp/startup.el (normal-top-level-add-subdirs-to-load-path) Exclude more VCS dirs
  2010-12-02 12:38     ` jari
@ 2010-12-03 18:58       ` Glenn Morris
  0 siblings, 0 replies; 6+ messages in thread
From: Glenn Morris @ 2010-12-03 18:58 UTC (permalink / raw)
  To: 7516-done

jari wrote:

> Wouldn't the first two tests be redundant then in previous line:
>
>       (unless (member file '("." ".." "RCS" "CVS" "rcs" "cvs"))
>       	      	      	     ========

Why not test it and see?

Anyway, it's hardly a bug but I simplified it anyway.





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

end of thread, other threads:[~2010-12-03 18:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-29 14:04 bug#7516: [PATCH] lisp/startup.el (normal-top-level-add-subdirs-to-load-path) Exclude more VCS dirs Jari Aalto
2010-11-29 18:11 ` Stefan Monnier
2010-11-29 22:33   ` Jari Aalto
2010-11-29 22:34   ` Glenn Morris
2010-12-02 12:38     ` jari
2010-12-03 18:58       ` Glenn Morris

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).