unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* some subdirs.el won't be loaded
@ 2005-05-24 13:14 Kenichi Handa
  2005-05-24 14:51 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Kenichi Handa @ 2005-05-24 13:14 UTC (permalink / raw)


I found that some subdirs.el won't be loaded.  It seems that
the reason is this change.

2004-08-20  Stefan Monnier  <monnier@iro.umontreal.ca>

	* startup.el (normal-top-level-add-subdirs-to-load-path):
	Avoid unnecessarily checking system-type.
	(normal-top-level): Set TERM to "dumb".  Simplify.
                                                 ^^^^^^^^

normal-top-level-add-to-load-path appends directories to
load-path destructively, but because of above change,
subdirs.el in those newly added directories are not loaded.

The diff of the above change is attached.

---
Kenichi Handa
handa@m17n.org


***************
*** 357,388 ****
      ;; of that dir into load-path,
      ;; Look for a leim-list.el file too.  Loading it will register
      ;; available input methods.
!     (let ((tail load-path)
! 	  new)
!       (while tail
! 	(push (car tail) new)
! 	(condition-case nil
! 	    (let ((default-directory (car tail)))
! 	      (load (expand-file-name "subdirs.el" (car tail)) t t t)))
! 	(condition-case nil
! 	    (let ((default-directory (car tail)))
! 	      (load (expand-file-name "leim-list.el" (car tail)) t t t)))
! 	(setq tail (cdr tail))))
!     (if (not (eq system-type 'vax-vms))
! 	(progn
! 	  ;; If the PWD environment variable isn't accurate, delete it.
! 	  (let ((pwd (getenv "PWD")))
! 	    (and (stringp pwd)
! 		 ;; Use FOO/., so that if FOO is a symlink, file-attributes
! 		 ;; describes the directory linked to, not FOO itself.
! 		 (or (equal (file-attributes
! 			     (concat (file-name-as-directory pwd) "."))
! 			    (file-attributes
! 			     (concat (file-name-as-directory default-directory)
! 				     ".")))
! 		     (setq process-environment
! 			   (delete (concat "PWD=" pwd)
! 				   process-environment)))))))
      (setq default-directory (abbreviate-file-name default-directory))
      (let ((menubar-bindings-done nil))
        (unwind-protect
--- 359,383 ----
      ;; of that dir into load-path,
      ;; Look for a leim-list.el file too.  Loading it will register
      ;; available input methods.
!     (dolist (dir load-path)
!       (let ((default-directory dir))
! 	(load (expand-file-name "subdirs.el") t t t))
!       (let ((default-directory dir))
! 	(load (expand-file-name "leim-list.el") t t t)))
!     (unless (eq system-type 'vax-vms)
!       ;; If the PWD environment variable isn't accurate, delete it.
!       (let ((pwd (getenv "PWD")))
! 	(and (stringp pwd)
! 	     ;; Use FOO/., so that if FOO is a symlink, file-attributes
! 	     ;; describes the directory linked to, not FOO itself.
! 	     (or (equal (file-attributes
! 			 (concat (file-name-as-directory pwd) "."))
! 			(file-attributes
! 			 (concat (file-name-as-directory default-directory)
! 				 ".")))
! 		 (setq process-environment
! 		       (delete (concat "PWD=" pwd)
! 			       process-environment))))))
      (setq default-directory (abbreviate-file-name default-directory))
      (let ((menubar-bindings-done nil))
        (unwind-protect

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

* Re: some subdirs.el won't be loaded
  2005-05-24 13:14 some subdirs.el won't be loaded Kenichi Handa
@ 2005-05-24 14:51 ` Stefan Monnier
  2005-05-25  0:49   ` Kenichi Handa
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2005-05-24 14:51 UTC (permalink / raw)
  Cc: emacs-devel

> I found that some subdirs.el won't be loaded.  It seems that
> the reason is this change.

> 2004-08-20  Stefan Monnier  <monnier@iro.umontreal.ca>

> 	* startup.el (normal-top-level-add-subdirs-to-load-path):
> 	Avoid unnecessarily checking system-type.
> 	(normal-top-level): Set TERM to "dumb".  Simplify.
>                                                  ^^^^^^^^

> normal-top-level-add-to-load-path appends directories to
> load-path destructively, but because of above change,
> subdirs.el in those newly added directories are not loaded.

Aaaahhh indeed.
Would the patch below fix things?


        Stefan


--- startup.el	19 mai 2005 11:05:48 -0400	1.357
+++ startup.el	24 mai 2005 10:51:21 -0400	
@@ -368,11 +368,17 @@
     ;; of that dir into load-path,
     ;; Look for a leim-list.el file too.  Loading it will register
     ;; available input methods.
-    (dolist (dir load-path)
+    (let ((tail load-path) dir)
+      (while tail
+        (setq dir (car tail))
       (let ((default-directory dir))
 	(load (expand-file-name "subdirs.el") t t t))
       (let ((default-directory dir))
-	(load (expand-file-name "leim-list.el") t t t)))
+          (load (expand-file-name "leim-list.el") t t t))
+        ;; We don't use a dolist loop and we put this "setq-cdr" command at
+        ;; the end, because the subdirs.el files may add elements to the end
+        ;; of load-path and we want to take it into account.
+        (setq tail (cdr tail))))
     (unless (eq system-type 'vax-vms)
       ;; If the PWD environment variable isn't accurate, delete it.
       (let ((pwd (getenv "PWD")))

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

* Re: some subdirs.el won't be loaded
  2005-05-24 14:51 ` Stefan Monnier
@ 2005-05-25  0:49   ` Kenichi Handa
  0 siblings, 0 replies; 3+ messages in thread
From: Kenichi Handa @ 2005-05-25  0:49 UTC (permalink / raw)
  Cc: emacs-devel

In article <jwv64x8adhb.fsf-monnier+emacs@gnu.org>, Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>  normal-top-level-add-to-load-path appends directories to
>>  load-path destructively, but because of above change,
>>  subdirs.el in those newly added directories are not loaded.

> Aaaahhh indeed.
> Would the patch below fix things?

Yes.  Thank you!

---
Kenichi Handa
handa@m17n.org

> --- startup.el	19 mai 2005 11:05:48 -0400	1.357
> +++ startup.el	24 mai 2005 10:51:21 -0400	
> @@ -368,11 +368,17 @@
>      ;; of that dir into load-path,
>      ;; Look for a leim-list.el file too.  Loading it will register
>      ;; available input methods.
> -    (dolist (dir load-path)
> +    (let ((tail load-path) dir)
> +      (while tail
> +        (setq dir (car tail))
>        (let ((default-directory dir))
>  	(load (expand-file-name "subdirs.el") t t t))
>        (let ((default-directory dir))
> -	(load (expand-file-name "leim-list.el") t t t)))
> +          (load (expand-file-name "leim-list.el") t t t))
> +        ;; We don't use a dolist loop and we put this "setq-cdr" command at
> +        ;; the end, because the subdirs.el files may add elements to the end
> +        ;; of load-path and we want to take it into account.
> +        (setq tail (cdr tail))))
>      (unless (eq system-type 'vax-vms)
>        ;; If the PWD environment variable isn't accurate, delete it.
>        (let ((pwd (getenv "PWD")))


> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel

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

end of thread, other threads:[~2005-05-25  0:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-24 13:14 some subdirs.el won't be loaded Kenichi Handa
2005-05-24 14:51 ` Stefan Monnier
2005-05-25  0:49   ` Kenichi Handa

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