From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Colin Walters Newsgroups: gmane.emacs.devel Subject: recursive load case in openp Date: 07 Apr 2002 22:55:42 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <1018234542.17903.36.camel@space-ghost> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-SlxFr8rulDw+VbjU/5gK" X-Trace: main.gmane.org 1018239747 17476 127.0.0.1 (8 Apr 2002 04:22:27 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 8 Apr 2002 04:22:27 +0000 (UTC) Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16uQfj-0004Xl-00 for ; Mon, 08 Apr 2002 06:22:27 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16uQtv-0000e4-00 for ; Mon, 08 Apr 2002 06:37:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16uPlL-0006n5-00; Sun, 07 Apr 2002 23:24:11 -0400 Original-Received: from monk.debian.net ([216.185.54.61] helo=monk.verbum.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16uPOD-0005pR-00 for ; Sun, 07 Apr 2002 23:00:17 -0400 Original-Received: from space-ghost.verbum.private (freedom.cis.ohio-state.edu [164.107.60.183]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client CN "space-ghost.verbum.org", Issuer "monk.verbum.org" (verified OK)) by monk.verbum.org (Postfix (Debian/GNU)) with ESMTP id 23EEB740009E for ; Sun, 7 Apr 2002 23:00:06 -0400 (EDT) Original-Received: by space-ghost.verbum.private (Postfix (Debian/GNU), from userid 1000) id 3A43F80694C; Sun, 7 Apr 2002 22:55:43 -0400 (EDT) Original-To: emacs-devel@gnu.org X-Mailer: Evolution/1.0 (Preview Release) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.8 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:2459 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2459 --=-SlxFr8rulDw+VbjU/5gK Content-Type: text/plain Content-Transfer-Encoding: 7bit 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 * 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? --=-SlxFr8rulDw+VbjU/5gK Content-Disposition: attachment; filename=emacs.patch Content-Transfer-Encoding: quoted-printable Content-Type: text/x-patch; charset=UTF-8 Index: bytecode.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 =3D Vstandard_output; break; Index: coding.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 @@ =20 =20 void -temp_output_buffer_setup (bufname) +temp_output_buffer_setup (bufname, hooks) char *bufname; + int hooks; { int count =3D specpdl_ptr - specpdl; register struct buffer *old =3D current_buffer; @@ -599,7 +600,8 @@ Ferase_buffer (); XSETBUFFER (buf, current_buffer); =20 - Frun_hooks (1, &Qtemp_buffer_setup_hook); + if (hooks) + Frun_hooks (1, &Qtemp_buffer_setup_hook); =20 unbind_to (count, Qnil); =20 @@ -618,7 +620,7 @@ =20 GCPRO1 (args); record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); - temp_output_buffer_setup (bufname); + temp_output_buffer_setup (bufname, 1); buf =3D Vstandard_output; UNGCPRO; =20 @@ -663,7 +665,7 @@ GCPRO1(args); name =3D Feval (Fcar (args)); CHECK_STRING (name); - temp_output_buffer_setup (XSTRING (name)->data); + temp_output_buffer_setup (XSTRING (name)->data, 1); buf =3D Vstandard_output; UNGCPRO; =20 --=-SlxFr8rulDw+VbjU/5gK--