GNU bug report logs - #32266
Cannot add directory names ending in .el with normal-top-level-add-subdirs-to-load-path

Previous Next

Package: emacs;

Reported by: Håkon Hægland <hakon.hagland <at> gmail.com>

Date: Wed, 25 Jul 2018 07:13:02 UTC

Severity: normal

Tags: fixed

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32266 in the body.
You can then email your comments to 32266 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#32266; Package emacs. (Wed, 25 Jul 2018 07:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Håkon Hægland <hakon.hagland <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 25 Jul 2018 07:13:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Håkon Hægland <hakon.hagland <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Cannot add directory names ending in .el with
 normal-top-level-add-subdirs-to-load-path
Date: Wed, 25 Jul 2018 09:12:08 +0200
[Message part 1 (text/plain, inline)]
I am trying to use the package "f" which has prerequisites the packages
"s" and  "dash". I wanted to load "f.el" with "use-package", so I downloaded
the four packages with git into a custom folder:

~/.emacs.d/installed-from-github/

I recognized that after cloning with git the folder names of the first
three packages became dash.el, s.el, and f.el. Note that each folder
name contains a dot. But according to the documentation of
normal-top-level-add-subdirs-to-load-path it should work for
these type of directory names. Also refer to the source of
normal-top-level-add-subdirs-to-load-path at

http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/startup.el#n445

However, when I try to run emacs with the
following init file:

(setq debug-on-error t)
(let ((default-directory  "~/.emacs.d/installed-from-github/"))
  (normal-top-level-add-subdirs-to-load-path))
(message "%S" load-path)
(require 'use-package)
(use-package dash
  :demand)
(use-package s
  :demand)
(use-package f
  :demand)

I get the following error:

Error (use-package): Cannot load dash

and when I inspect the *Messages* buffer I can see that load-path does
not contain any of "/home/hakon/.emacs.d/installed-from-github/dash.el",
"/home/hakon/.emacs.d/installed-from-github/s.el", or
"/home/hakon/.emacs.d/installed-from-github/f.el".

Also, when I look at line #474 of the source

http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/startup.el#n474

I see the following predicate for including a directory:

(not (string-match "\\.elc?\\'" file))

I wonder if this can be a bug? At least I think it should be documented in
the
doc string of the function that it will not include directories ending
with .el or .elc and the reason why.

-------------------------

In GNU Emacs 25.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2018-04-28 built on hakon-Vostro-5568
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Ubuntu 18.04 LTS

Configured using:
 'configure CFLAGS=-no-pie --with-xft --prefix=/opt/emacs-25.3'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LC_MONETARY: nb_NO.UTF-8
  value of $LC_NUMERIC: nb_NO.UTF-8
  value of $LC_TIME: nb_NO.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

----------------------

Best regards
Håkon Hægland
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32266; Package emacs. (Thu, 30 Aug 2018 14:40:02 GMT) Full text and rfc822 format available.

Message #8 received at 32266 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Håkon Hægland <hakon.hagland <at> gmail.com>
Cc: 32266 <at> debbugs.gnu.org
Subject: Re: bug#32266: Cannot add directory names ending in .el with
 normal-top-level-add-subdirs-to-load-path
Date: Thu, 30 Aug 2018 16:38:54 +0200
Håkon Hægland <hakon.hagland <at> gmail.com> writes:

> Also, when I look at line #474 of the source
>
> http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/startup.el#n474
>
> I see the following predicate for including a directory:
>
> (not (string-match "\\.elc?\\'" file))

The comment just above says

		 ;; Avoid doing a `stat' when it isn't necessary because
		 ;; that can cause trouble when an NFS server is down.

which has been there for a long time. If an NFS server *is* down, then
that will manifest itself with other files anyway, so I donʼt see why
weʼd need special handling here. I propose:

diff --git i/lisp/startup.el w/lisp/startup.el
index 4eb71abaac..ace4176ac5 100644
--- i/lisp/startup.el
+++ w/lisp/startup.el
@@ -469,9 +469,6 @@ normal-top-level-add-subdirs-to-load-path
 	    (and (string-match "\\`[[:alnum:]]" file)
 		 ;; The lower-case variants of RCS and CVS are for DOS/Windows.
 		 (not (member file '("RCS" "CVS" "rcs" "cvs")))
-		 ;; Avoid doing a `stat' when it isn't necessary because
-		 ;; that can cause trouble when an NFS server is down.
-		 (not (string-match "\\.elc?\\'" file))
 		 (file-directory-p file)
 		 (let ((expanded (expand-file-name file)))
 		   (or (file-exists-p (expand-file-name ".nosearch" expanded))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32266; Package emacs. (Wed, 26 Aug 2020 12:51:02 GMT) Full text and rfc822 format available.

Message #11 received at 32266 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Håkon Hægland <hakon.hagland <at> gmail.com>,
 32266 <at> debbugs.gnu.org
Subject: Re: bug#32266: Cannot add directory names ending in .el with
 normal-top-level-add-subdirs-to-load-path
Date: Wed, 26 Aug 2020 14:50:13 +0200
Robert Pluim <rpluim <at> gmail.com> writes:

> The comment just above says
>
> 		 ;; Avoid doing a `stat' when it isn't necessary because
> 		 ;; that can cause trouble when an NFS server is down.
>
> which has been there for a long time. If an NFS server *is* down, then
> that will manifest itself with other files anyway, so I don't see why
> we'd need special handling here. I propose:

Yeah, that's just odd.  And having directories called .el isn't that
strange, anyway, so I've applied your patch to Emacs 28:

> -		 ;; Avoid doing a `stat' when it isn't necessary because
> -		 ;; that can cause trouble when an NFS server is down.
> -		 (not (string-match "\\.elc?\\'" file))

I did a "make" and "make bootstrap" and I can't see any adverse effects.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 26 Aug 2020 12:51:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 32266 <at> debbugs.gnu.org and Håkon Hægland <hakon.hagland <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 26 Aug 2020 12:51:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 24 Sep 2020 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 213 days ago.

Previous Next


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