From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#5303: 23.1.91; Cannot load .emacs-history from savehist.el Date: Thu, 21 Jan 2010 20:24:30 +0200 Message-ID: <83636v71up.fsf@gnu.org> References: <8F73D1539CE042B8A9B48F767127C43B@us.oracle.com> <87hbqhqhgv.fsf@gmx.de> <430DA333844949CEAE2FA2FF694DDDA3@us.oracle.com> <83bpgo7i8f.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1264099286 10031 80.91.229.12 (21 Jan 2010 18:41:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Jan 2010 18:41:26 +0000 (UTC) Cc: cyd@stupidchicken.com, michael.albinus@gmx.de, Richard Stallman To: 5303@debbugs.gnu.org, Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 21 19:41:17 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NY1y1-0003o0-D9 for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Jan 2010 19:41:17 +0100 Original-Received: from localhost ([127.0.0.1]:37192 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NY1y0-0007E2-SE for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Jan 2010 13:41:16 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NY1wR-0006cz-DH for bug-gnu-emacs@gnu.org; Thu, 21 Jan 2010 13:39:39 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NY1wM-0006av-7k for bug-gnu-emacs@gnu.org; Thu, 21 Jan 2010 13:39:38 -0500 Original-Received: from [199.232.76.173] (port=43042 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NY1wL-0006al-S3 for bug-gnu-emacs@gnu.org; Thu, 21 Jan 2010 13:39:33 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51998) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NY1wL-0002ET-Dc for bug-gnu-emacs@gnu.org; Thu, 21 Jan 2010 13:39:33 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NY1jF-0004zp-VU; Thu, 21 Jan 2010 13:26:01 -0500 X-Loop: bug-gnu-emacs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Jan 2010 18:26:01 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5303 X-Emacs-PR-Package: emacs,w32 X-Emacs-PR-Keywords: Original-Received: via spool by 5303-submit@debbugs.gnu.org id=B5303.126409832519186 (code B ref 5303); Thu, 21 Jan 2010 18:26:01 +0000 Original-Received: (at 5303) by debbugs.gnu.org; 21 Jan 2010 18:25:25 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NY1ie-0004zP-72 for submit@debbugs.gnu.org; Thu, 21 Jan 2010 13:25:24 -0500 Original-Received: from mtaout21.012.net.il ([80.179.55.169]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NY1ic-0004zJ-6A for 5303@debbugs.gnu.org; Thu, 21 Jan 2010 13:25:23 -0500 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0KWM0000005WNY00@a-mtaout21.012.net.il> for 5303@debbugs.gnu.org; Thu, 21 Jan 2010 20:24:26 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.228.141.118]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KWM00MI30GOCD60@a-mtaout21.012.net.il>; Thu, 21 Jan 2010 20:24:26 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list X-Spam-Score: -1.4 (-) Resent-Date: Thu, 21 Jan 2010 13:26:01 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:34601 Archived-At: > From: Lennart Borgman > Date: Thu, 21 Jan 2010 02:02:49 +0100 > Cc: Michael Albinus , drew.adams@oracle.com, cyd@stupidchicken.com, > 5303@debbugs.gnu.org > > On Wed, Jan 20, 2010 at 7:18 PM, Eli Zaretskii wrote: > > > > It doesn't happen for me with stock Emacs 23.1, so it _is_ a > > regression. > > A quick check with my old binaries shows that 2009-08-04 works but > 2009-09-15 fails. > > Some change in that period added tramp-completion-file-name-handler to > file-name-handler-alist. > Removing it from there makes (load "c:/emacs-history") succeed again. > > Note however that tramp-completion-file-name-handler run the real handler. > So it looks more like it is the presence of the pattern > > ("\\`\\([a-zA-Z]:\\)?/[^/]*\\'" . tramp-completion-file-name-handler) > > in file-name-handler-alist that causes the problem. Which probably > means that the problem is in `load' as Eli has suggested. To fix the problem (which I also believe is in `load' or maybe between `load' and `openp'), I need to better understand some of the code in `load'. Would someone who knows please help me answer the following questions regarding the fragment below? Stefan? Yidong? Richard? anyone? The questions are: . Why do we test for ".elc" OR non-zero return value from safe_to_load_p? What is the purpose of handling files without the .elc extension as byte-compiled? . Was safe_to_load_p intended to return non-zero value for invalid file descriptors such as -2? if (!bcmp (SDATA (found) + SBYTES (found) - 4, ".elc", 4) || (version = safe_to_load_p (fd)) > 0) /* Load .elc files directly, but not when they are remote and have no handler! */ { if (fd != -2) { struct stat s1, s2; int result; GCPRO3 (file, found, hist_file_name); if (version < 0 && ! (version = safe_to_load_p (fd))) { safe_p = 0; if (!load_dangerous_libraries) { if (fd >= 0) emacs_close (fd); error ("File `%s' was not compiled in Emacs", SDATA (found)); } else if (!NILP (nomessage) && !force_load_messages) message_with_string ("File `%s' not compiled in Emacs", found, 1); } compiled = 1; efound = ENCODE_FILE (found); #ifdef DOS_NT fmode = "rb"; #endif /* DOS_NT */ stat ((char *)SDATA (efound), &s1); SSET (efound, SBYTES (efound) - 1, 0); result = stat ((char *)SDATA (efound), &s2); SSET (efound, SBYTES (efound) - 1, 'c'); if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime) { /* Make the progress messages mention that source is newer. */ newer = 1; /* If we won't print another message, mention this anyway. */ if (!NILP (nomessage) && !force_load_messages) { Lisp_Object msg_file; msg_file = Fsubstring (found, make_number (0), make_number (-1)); message_with_string ("Source file `%s' newer than byte-compiled file", msg_file, 1); } } UNGCPRO; } } else { /* We are loading a source file (*.el). */ if (!NILP (Vload_source_file_function)) { Lisp_Object val; if (fd >= 0) emacs_close (fd); val = call4 (Vload_source_file_function, found, hist_file_name, NILP (noerror) ? Qnil : Qt, (NILP (nomessage) || force_load_messages) ? Qnil : Qt); return unbind_to (count, val); } }