From: Colin Walters <walters@debian.org>
Subject: recursive load case in openp
Date: 07 Apr 2002 22:55:42 -0400 [thread overview]
Message-ID: <1018234542.17903.36.camel@space-ghost> (raw)
[-- Attachment #1: Type: text/plain, Size: 1031 bytes --]
Hi,
I found a bug (or rather my init files did) in the current CVS. It
appears to have been introduced by the following change:
2002-03-29 Eli Zaretskii <eliz@is.elta.co.il>
* lread.c (openp, Fload): Encode the file name before passing it
to `stat', `access', and `emacs_open'.
(openp): GCPRO the encoded file name. Don't recompute Lisp
strings unnecessarily.
The problem is reproducible on my system by starting emacs like:
emacs -q --no-site-file --eval '(set-language-environment "utf-8")'
What seems to be happening is that openp eventually calls
encode_coding_string, which eventually calls temp_output_buffer_setup,
which then runs the hook variable `temp-buffer-setup-hook', whose value
defaults to the single symbol `help-mode-setup'. Therefore, since
help-mode is autoloaded, emacs will attempt to load it, and enter Fload,
and therefore reenter openp, try to load help-mode again...
The following patch fixes the problem on my system; Does anyone have any
objections to fixing the problem in this way?
[-- Attachment #2: emacs.patch --]
[-- Type: text/x-patch, Size: 3202 bytes --]
Index: bytecode.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/bytecode.c,v
retrieving revision 1.68
diff -u -r1.68 bytecode.c
--- bytecode.c 20 Mar 2002 07:44:54 -0000 1.68
+++ bytecode.c 8 Apr 2002 02:54:42 -0000
@@ -896,7 +896,7 @@
case Btemp_output_buffer_setup:
BEFORE_POTENTIAL_GC ();
CHECK_STRING (TOP);
- temp_output_buffer_setup (XSTRING (TOP)->data);
+ temp_output_buffer_setup (XSTRING (TOP)->data, 1);
AFTER_POTENTIAL_GC ();
TOP = Vstandard_output;
break;
Index: coding.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/coding.c,v
retrieving revision 1.240
diff -u -r1.240 coding.c
--- coding.c 11 Mar 2002 19:21:09 -0000 1.240
+++ coding.c 8 Apr 2002 02:54:43 -0000
@@ -5801,7 +5801,7 @@
record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
record_unwind_protect (code_convert_region_unwind, Qnil);
GCPRO1 (str);
- temp_output_buffer_setup (" *code-converting-work*");
+ temp_output_buffer_setup (" *code-converting-work*", 0);
set_buffer_internal (XBUFFER (Vstandard_output));
/* We must insert the contents of STR as is without
unibyte<->multibyte conversion. For that, we adjust the
Index: lisp.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/lisp.h,v
retrieving revision 1.415
diff -u -r1.415 lisp.h
--- lisp.h 21 Mar 2002 12:17:51 -0000 1.415
+++ lisp.h 8 Apr 2002 02:54:43 -0000
@@ -2424,7 +2424,7 @@
EXFUN (Ferror_message_string, 1);
extern Lisp_Object Vstandard_output, Qstandard_output;
extern Lisp_Object Qexternal_debugging_output;
-extern void temp_output_buffer_setup P_ ((char *));
+extern void temp_output_buffer_setup P_ ((char *, int));
extern int print_level, print_escape_newlines;
extern Lisp_Object Qprint_escape_newlines;
extern void write_string P_ ((char *, int));
Index: print.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/print.c,v
retrieving revision 1.174
diff -u -r1.174 print.c
--- print.c 16 Mar 2002 06:53:35 -0000 1.174
+++ print.c 8 Apr 2002 02:54:44 -0000
@@ -577,8 +577,9 @@
void
-temp_output_buffer_setup (bufname)
+temp_output_buffer_setup (bufname, hooks)
char *bufname;
+ int hooks;
{
int count = specpdl_ptr - specpdl;
register struct buffer *old = current_buffer;
@@ -599,7 +600,8 @@
Ferase_buffer ();
XSETBUFFER (buf, current_buffer);
- Frun_hooks (1, &Qtemp_buffer_setup_hook);
+ if (hooks)
+ Frun_hooks (1, &Qtemp_buffer_setup_hook);
unbind_to (count, Qnil);
@@ -618,7 +620,7 @@
GCPRO1 (args);
record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
- temp_output_buffer_setup (bufname);
+ temp_output_buffer_setup (bufname, 1);
buf = Vstandard_output;
UNGCPRO;
@@ -663,7 +665,7 @@
GCPRO1(args);
name = Feval (Fcar (args));
CHECK_STRING (name);
- temp_output_buffer_setup (XSTRING (name)->data);
+ temp_output_buffer_setup (XSTRING (name)->data, 1);
buf = Vstandard_output;
UNGCPRO;
next reply other threads:[~2002-04-08 2:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-08 2:55 Colin Walters [this message]
2002-04-08 6:50 ` recursive load case in openp Eli Zaretskii
2002-04-09 12:07 ` Richard Stallman
-- strict thread matches above, loose matches on Subject: below --
2002-04-09 12:34 Kenichi Handa
2002-04-10 20:17 ` Richard Stallman
2002-04-10 23:43 Kenichi Handa
2002-04-11 13:01 ` Stefan Monnier
2002-04-12 3:13 ` Richard Stallman
2002-04-12 4:03 ` Stefan Monnier
2002-04-12 9:35 ` Kim F. Storm
2002-04-12 3:12 ` Richard Stallman
2002-04-12 6:48 Kenichi Handa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1018234542.17903.36.camel@space-ghost \
--to=walters@debian.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.