all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Changing load-suffixes
@ 2006-02-14  0:41 Richard M. Stallman
  2006-02-14  1:13 ` Luc Teirlinck
  2006-02-19  5:21 ` Chong Yidong
  0 siblings, 2 replies; 5+ messages in thread
From: Richard M. Stallman @ 2006-02-14  0:41 UTC (permalink / raw)


We decided to change how load-suffixes would work,
but it looks like that change has not been installed.
Who was going to do that?

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

* Re: Changing load-suffixes
  2006-02-14  0:41 Changing load-suffixes Richard M. Stallman
@ 2006-02-14  1:13 ` Luc Teirlinck
  2006-02-19  5:21 ` Chong Yidong
  1 sibling, 0 replies; 5+ messages in thread
From: Luc Teirlinck @ 2006-02-14  1:13 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman wrote:

   We decided to change how load-suffixes would work,
   but it looks like that change has not been installed.
   Who was going to do that?

I proposed patches which fixed the reported bug.  But you decided that
it would be better to fix the bug in a different way, by making more
involved changes.  I have not yet had the time to implement that.

Sincerely,

Luc.

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

* Re: Changing load-suffixes
  2006-02-14  0:41 Changing load-suffixes Richard M. Stallman
  2006-02-14  1:13 ` Luc Teirlinck
@ 2006-02-19  5:21 ` Chong Yidong
  2006-02-19 15:59   ` Luc Teirlinck
  1 sibling, 1 reply; 5+ messages in thread
From: Chong Yidong @ 2006-02-19  5:21 UTC (permalink / raw)
  Cc: emacs-devel

"Richard M. Stallman" <rms@gnu.org> writes:

> We decided to change how load-suffixes would work,
> but it looks like that change has not been installed.

Since this issue seems to have gotten stalled, I looked into it.  How
about the following patch?

*** emacs/src/lread.c.~1.349.~	2006-02-18 18:19:03.000000000 -0500
--- emacs/src/lread.c	2006-02-19 00:13:13.000000000 -0500
***************
*** 99,104 ****
--- 99,105 ----
  
  /* Search path and suffixes for files to be loaded. */
  Lisp_Object Vload_path, Vload_suffixes, default_suffixes;
+ Lisp_Object Vload_file_rep_suffixes;
  
  /* File name of user's init file.  */
  Lisp_Object Vuser_init_file;
***************
*** 727,732 ****
--- 728,734 ----
    if (SCHARS (file) > 0)
      {
        int size = SBYTES (file);
+       Lisp_Object tail, stail, reps, rep, suffixes, all_suffixes;
        Lisp_Object tmp[2];
  
        found = Qnil;
***************
*** 747,759 ****
  	    must_suffix = Qnil;
  	}
  
!       fd = openp (Vload_path, file,
! 		  (!NILP (nosuffix) ? Qnil
! 		   : !NILP (must_suffix) ? Vload_suffixes
! 		   : Fappend (2, (tmp[0] = Vload_suffixes,
! 				  tmp[1] = default_suffixes,
! 				  tmp))),
! 		  &found, Qnil);
        UNGCPRO;
      }
  
--- 749,779 ----
  	    must_suffix = Qnil;
  	}
  
!       all_suffixes = suffixes = (!NILP (nosuffix) ? default_suffixes
! 				 : !NILP (must_suffix) ? Vload_suffixes
! 				 : Fappend (2, (tmp[0] = Vload_suffixes,
! 						tmp[1] = default_suffixes,
! 						tmp)));
! 
!       for (tail = Vload_file_rep_suffixes; CONSP (tail); tail = XCDR (tail))
! 	{
! 	  rep = XCAR (tail);
! 
! 	  if (!GC_STRINGP (rep))
! 	    continue;
! 
! 	  reps = Fcopy_sequence (suffixes);
! 	  for (stail = reps; CONSP (stail); stail = XCDR (stail))
! 	    if (GC_STRINGP (XCAR (stail)))
! 	      XSETCAR (stail, Fconcat (2, (tmp[0] = XCAR (stail),
! 					   tmp[1] = rep, tmp)));
! 
! 	  all_suffixes = Fappend (2, (tmp[0] = all_suffixes,
! 				      tmp[1] = reps, tmp));
! 	}
! 
!       fd = openp (Vload_path, file, all_suffixes, &found, Qnil);
! 
        UNGCPRO;
      }
  
***************
*** 3909,3914 ****
--- 3929,3944 ----
    default_suffixes = Fcons (build_string (""), Qnil);
    staticpro (&default_suffixes);
  
+   DEFVAR_LISP ("load-file-rep-suffixes", &Vload_file_rep_suffixes,
+ 	       doc: /* List of additional suffixes to try for files to load.
+ These suffixes stand for different ways of representing the same file.
+ 
+ For example, if `load-suffixes' is '(\".elc\" \".el\") and
+ `load-file-rep-suffixes' is '(\"gz\"), then (load \"foo\") will look
+ for \"foo.elc\", \"foo.el\", \"foo\", \"foo.elc.gz\", \"foo.el.gz\",
+ and \"foo.gz\", in that order. */);
+   Vload_file_rep_suffixes = Qnil;
+ 
    DEFVAR_BOOL ("load-in-progress", &load_in_progress,
  	       doc: /* Non-nil iff inside of `load'.  */);
  
*** emacs/lisp/jka-cmpr-hook.el.~1.9.~	2006-02-06 23:43:16.000000000 -0500
--- emacs/lisp/jka-cmpr-hook.el	2006-02-18 23:46:23.000000000 -0500
***************
*** 216,229 ****
  	(append auto-mode-alist jka-compr-mode-alist-additions))
  
    ;; Make sure that (load "foo") will find /bla/foo.el.gz.
!   (setq load-suffixes
! 	(apply 'append
! 	       (append (mapcar (lambda (suffix)
!                                (cons suffix
!                                      (mapcar (lambda (ext) (concat suffix ext))
!                                              jka-compr-load-suffixes)))
!                              load-suffixes)
!                        (list jka-compr-load-suffixes)))))
  
  
  (defun jka-compr-installed-p ()
--- 216,223 ----
  	(append auto-mode-alist jka-compr-mode-alist-additions))
  
    ;; Make sure that (load "foo") will find /bla/foo.el.gz.
!   (setq load-file-rep-suffixes
! 	(append jka-compr-load-suffixes load-file-rep-suffixes)))
  
  
  (defun jka-compr-installed-p ()
*** emacs/lisp/jka-compr.el.~1.89.~	2006-02-06 23:43:16.000000000 -0500
--- emacs/lisp/jka-compr.el	2006-02-18 23:47:57.000000000 -0500
***************
*** 703,712 ****
    ;; Remove the suffixes that were added by jka-compr.
    (let ((suffixes nil)
  	(re (jka-compr-build-file-regexp)))
!     (dolist (suffix load-suffixes)
        (unless (string-match re suffix)
  	(push suffix suffixes)))
!     (setq load-suffixes (nreverse suffixes))))
  
  (provide 'jka-compr)
  
--- 703,712 ----
    ;; Remove the suffixes that were added by jka-compr.
    (let ((suffixes nil)
  	(re (jka-compr-build-file-regexp)))
!     (dolist (suffix load-file-rep-suffixes)
        (unless (string-match re suffix)
  	(push suffix suffixes)))
!     (setq load-file-rep-suffixes (nreverse suffixes))))
  
  (provide 'jka-compr)

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

* Re: Changing load-suffixes
  2006-02-19  5:21 ` Chong Yidong
@ 2006-02-19 15:59   ` Luc Teirlinck
  2006-02-19 16:33     ` Chong Yidong
  0 siblings, 1 reply; 5+ messages in thread
From: Luc Teirlinck @ 2006-02-19 15:59 UTC (permalink / raw)
  Cc: rms, emacs-devel

Chong Yidong wrote:

   Since this issue seems to have gotten stalled, I looked into it.  How
   about the following patch?

I did not check any details, but this can not possibly work.  You only
try to make `load' compute load-suffixes on the fly.  This makes all
the many other functions that use `load-suffixes' malfunction.  That is
why I needed 11 patches and a new primitive function `get-load-suffixes'.

Anyway, my recently submitted patches fix this and several related problems.

Sincerely,

Luc.

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

* Re: Changing load-suffixes
  2006-02-19 15:59   ` Luc Teirlinck
@ 2006-02-19 16:33     ` Chong Yidong
  0 siblings, 0 replies; 5+ messages in thread
From: Chong Yidong @ 2006-02-19 16:33 UTC (permalink / raw)
  Cc: rms, emacs-devel

Luc Teirlinck <teirllm@dms.auburn.edu> writes:

> Chong Yidong wrote:
>
>    Since this issue seems to have gotten stalled, I looked into it.  How
>    about the following patch?
>
> I did not check any details, but this can not possibly work.  You only
> try to make `load' compute load-suffixes on the fly.  This makes all
> the many other functions that use `load-suffixes' malfunction.  That is
> why I needed 11 patches and a new primitive function `get-load-suffixes'.
>
> Anyway, my recently submitted patches fix this and several related problems.

I don't subscribe to emacs-pretest-bug, so I didn't see your patch
till it hit the web archives.  Since you have patch that "can possibly
work", that's fine.

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

end of thread, other threads:[~2006-02-19 16:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-14  0:41 Changing load-suffixes Richard M. Stallman
2006-02-14  1:13 ` Luc Teirlinck
2006-02-19  5:21 ` Chong Yidong
2006-02-19 15:59   ` Luc Teirlinck
2006-02-19 16:33     ` Chong Yidong

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.