unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#32266: Cannot add directory names ending in .el with normal-top-level-add-subdirs-to-load-path
@ 2018-07-25  7:12 Håkon Hægland
  2018-08-30 14:38 ` Robert Pluim
  0 siblings, 1 reply; 3+ messages in thread
From: Håkon Hægland @ 2018-07-25  7:12 UTC (permalink / raw)
  To: 32266

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

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

[-- Attachment #2: Type: text/html, Size: 3759 bytes --]

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

* bug#32266: Cannot add directory names ending in .el with normal-top-level-add-subdirs-to-load-path
  2018-07-25  7:12 bug#32266: Cannot add directory names ending in .el with normal-top-level-add-subdirs-to-load-path Håkon Hægland
@ 2018-08-30 14:38 ` Robert Pluim
  2020-08-26 12:50   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Pluim @ 2018-08-30 14:38 UTC (permalink / raw)
  To: Håkon Hægland; +Cc: 32266

Håkon Hægland <hakon.hagland@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))





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

* bug#32266: Cannot add directory names ending in .el with normal-top-level-add-subdirs-to-load-path
  2018-08-30 14:38 ` Robert Pluim
@ 2020-08-26 12:50   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-26 12:50 UTC (permalink / raw)
  To: Håkon Hægland, 32266

Robert Pluim <rpluim@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





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

end of thread, other threads:[~2020-08-26 12:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-25  7:12 bug#32266: Cannot add directory names ending in .el with normal-top-level-add-subdirs-to-load-path Håkon Hægland
2018-08-30 14:38 ` Robert Pluim
2020-08-26 12:50   ` Lars Ingebrigtsen

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