all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* patch: broken docstrings for functions from .elc.gz's
@ 2003-03-30 14:24 Ivan Zakharyaschev
  0 siblings, 0 replies; only message in thread
From: Ivan Zakharyaschev @ 2003-03-30 14:24 UTC (permalink / raw)


[-- Attachment #1: Type: TEXT/PLAIN, Size: 1137 bytes --]

	Hello!

A bug in Emacs 21.2 (and 21.3) has been reported by Sergey
Vlasov (a patch that aims to fix it is attached):

having life.elc compressed:

/usr/share/emacs/21.3/lisp/play/life.elc.gz

sometimes results in a broken docstring for `life'. More
precisely:

After Emacs startup:

C-h f life RET (the doc for the autoloaded function is fine)

M-: (load "/usr/share/emacs/21.3/lisp/play/life.elc.gz") RET
C-h f life RET (the full doc is fine)

M-: (load "/usr/share/emacs/21.3/lisp/play/life") RET
C-h f life RET (the doc is broken)

Debugging shows that `jka-compr-load' is called in the first
case, but it isn't called in the second one. Modifying a test in
src/lread.c fixes this bad behaviour.

Usually libraries are loaded in a way similar to the second case,
so usually the docstrings get broken.


As I can see from the CVS, the issue is still there in the main
Emacs development branch. The patch is for 21.3. (There is a
description of it inside.)


Regards,
-- 
Ivan Zakharyaschev
ALT Linux Team member
I'm a Sisyphus developer: it's core is GNU/Linux
http://www.altlinux.ru, http://www.altlinux.com

JID: imz at altlinux.org

[-- Attachment #2: for 21.3; should be done for MAIN, too --]
[-- Type: TEXT/PLAIN, Size: 1343 bytes --]

At this place, We can find a real file with suffixed filename (`fn')
that needs to be handled in a special way (e.g. a compressed 
one: "/a.elc.gz") while `filename' holds the requested 
filename without the suffix ("/a").

In this case, the file shouldn't be opened and the function (openp())
should not return the fd. It should return -2, and the calling 
function (load()) should call the corresponding handler in order
to load it.

It used to check whether there is a special handler by passing `filename'.
Such a test used not to give the expected result, since the handler
is applicable to the real (suffixed) found filename `fn'.

Loading libraries stored as compressed .elc-files used to be broken 
because of this: the corresponding load-handler (`jka-compr-load') 
used not be called, and the docstrings for the loaded functions
got corrupted when displayed.

Ivan Zakharyaschev <imz@altlinux.org>

--- emacs-21.3/src/lread.c.handleLoad	2003-03-30 13:22:31 +0400
+++ emacs-21.3/src/lread.c	2003-03-30 13:24:02 +0400
@@ -1012,7 +1012,7 @@
 	  if (absolute)
 	    handler = Qnil;
 	  else
-	    handler = Ffind_file_name_handler (filename, Qfile_exists_p);
+	    handler = Ffind_file_name_handler (build_string (fn), Qfile_exists_p);
 	  if (! NILP (handler) && ! exec_only)
 	    {
 	      int exists;

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-03-30 14:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-30 14:24 patch: broken docstrings for functions from .elc.gz's Ivan Zakharyaschev

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.