From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: phillip.lord@russet.org.uk (Phillip Lord) Newsgroups: gmane.emacs.bugs Subject: bug#25360: File mode specification errors during building Date: Tue, 17 Jan 2017 22:04:22 +0000 Message-ID: <87k29t4a3d.fsf@russet.org.uk> References: <8760lndxlz.fsf@russet.org.uk> <83bmvfdk2r.fsf@gnu.org> <8737gqsqqr.fsf@russet.org.uk> <83ziiyda4y.fsf@gnu.org> <87inpj1288.fsf@russet.org.uk> <834m13caay.fsf@gnu.org> <87k29ylk8h.fsf@russet.org.uk> <87mvest1vz.fsf@russet.org.uk> <87h94zyj5s.fsf@users.sourceforge.net> <1760ldfurw.fsf@fencepost.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1484690732 19506 195.159.176.226 (17 Jan 2017 22:05:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 17 Jan 2017 22:05:32 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: npostavs@users.sourceforge.net, 25360@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 17 23:05:28 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTbsO-0003Ue-33 for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Jan 2017 23:05:12 +0100 Original-Received: from localhost ([::1]:37932 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTbsS-0006r3-SJ for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Jan 2017 17:05:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTbsH-0006lm-7t for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2017 17:05:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTbsE-0006vd-1I for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2017 17:05:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35940) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cTbsD-0006vX-Uc for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2017 17:05:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cTbsD-0002zG-N0 for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2017 17:05:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: phillip.lord@russet.org.uk (Phillip Lord) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Jan 2017 22:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25360 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25360-submit@debbugs.gnu.org id=B25360.148469067311446 (code B ref 25360); Tue, 17 Jan 2017 22:05:01 +0000 Original-Received: (at 25360) by debbugs.gnu.org; 17 Jan 2017 22:04:33 +0000 Original-Received: from localhost ([127.0.0.1]:34139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTbrl-0002yY-5j for submit@debbugs.gnu.org; Tue, 17 Jan 2017 17:04:33 -0500 Original-Received: from mailgw.mycpanelcloud.co.uk ([185.116.214.213]:18239) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTbri-0002yJ-ED for 25360@debbugs.gnu.org; Tue, 17 Jan 2017 17:04:30 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mailgw.mycpanelcloud.co.uk (Postfix) with ESMTP id 1BA39C4446 for <25360@debbugs.gnu.org>; Tue, 17 Jan 2017 22:04:02 +0000 (GMT) X-Virus-Scanned: by SpamTitan at mycpanelcloud.co.uk Original-Received: from mailgw.mycpanelcloud.co.uk (localhost [127.0.0.1]) by mailgw.mycpanelcloud.co.uk (Postfix) with ESMTP id B0B79C4E13 for <25360@debbugs.gnu.org>; Tue, 17 Jan 2017 22:04:00 +0000 (GMT) Original-Received: from cloud103.planethippo.com (cloud103.planethippo.com [31.216.48.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailgw.mycpanelcloud.co.uk (Postfix) with ESMTPS id A2386C4CD4 for <25360@debbugs.gnu.org>; Tue, 17 Jan 2017 22:04:00 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=russet.org.uk; s=default; h=Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=R4THeiop/iX1SpPcT3pmKFzHlwuAihANwOxxVU1fbW0=; b=aT9P92VCfIo04i48vP9s2kH67 2mIbXGu2Gv67hsX7b9NDu8z5nJEjcB8zEHj+XjTrmsLHBaaHN5QojIevXTvzw4GTShXbimdOEnDRn seM3nu0HilOBTqREwgkLaRtEpBIday4oKESR/1eSRLcBPS3LPOTHfAYoFmAegtYRko4btLKecuKE6 Vr6e+PSyxxWJ/Tmor60g5wEkyh0TeZIJVajoyRRAkdBT09kp2SgUr9q9OHTdYHhrytyW0SRNvRMhv hbZJXB5rySLItsBXAGL2cQcXdQHTWr5QzG3UJmNagGtk9hnVF/MficyQWg3gYxKbU8zC5Ww3i+KgA 159yhw9ig==; Original-Received: from cpc6-benw10-2-0-cust167.gate.cable.virginm.net ([92.238.179.168]:52078 helo=russet.org.uk) by cloud103.planethippo.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87) (envelope-from ) id 1cTbra-000zAa-Mo; Tue, 17 Jan 2017 22:04:23 +0000 In-Reply-To: <1760ldfurw.fsf@fencepost.gnu.org> (Glenn Morris's message of "Tue, 17 Jan 2017 12:42:11 -0500") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud103.planethippo.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - russet.org.uk X-Get-Message-Sender-Via: cloud103.planethippo.com: authenticated_id: phillip.lord@russet.org.uk X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@russet.org.uk X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:128186 Archived-At: --=-=-= Content-Type: text/plain Glenn Morris writes: > npostavs@users.sourceforge.net wrote: > >> Using insert-file-contents instead of file-file-noselect seems to fix it >> for me: > > That sounds like a good change anyway. (I forget, does this respect > "coding:"? Does this even matter in this case?) I think, no, it doesn't respect coding, but that it doesn't matter. > > (But it still seems like a potential problem to me if functions that used to > be available early in the build no longer are.) It shouldn't be, if they are not being called. Anyway, the cause of the error in this case is this line in files.el. (assoc-default nil magic-fallback-mode-alist (lambda (re _dummy) (if (functionp re) (funcall re) (looking-at re))))))) This is called when loading cangjie-table.b5 with 'image-type-auto-detected-p as the first parameter. Normally, the condition returns "t", but in this case it will return f, then the looking-at form fails with the error given. I don't understand which this process does not happen during the build which generates ldefs-boot-auto.el. The bigger problem is that the bootstrap-emacs executable has different functionality compiled in, even when it does not require it to perform the task of bootstrapping. This might invalidate my approach, but I am not sure yet. The follow patch addresses, the problem at hand, though. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-file-mode-errors-in-bootstrap.patch >From bed019eb18fbafffd397eaac7962e30428fe1e04 Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Mon, 16 Jan 2017 23:09:06 +0000 Subject: [PATCH] Fix file-mode errors in bootstrap. * lisp/files.el (set-auto-mode): Do not call `looking-at' on a symbol. * lisp/international/titdic-cnv.el (miscdic-convert): Use `insert-file-contents' rather than `find-file-noselect'. --- lisp/files.el | 28 ++++++++++++++++++++++------ lisp/international/titdic-cnv.el | 8 ++++---- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index b57e35b..e7b15a8 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2911,9 +2911,18 @@ set-auto-mode (+ (point-min) magic-mode-regexp-match-limit))) (assoc-default nil magic-mode-alist (lambda (re _dummy) - (if (functionp re) - (funcall re) - (looking-at re))))))) + (cond + ;; Bug#25360 We might have a + ;; symbol which is not a + ;; function during bootstrap. + ((and + (symbolp re) + (functionp re)) + (funcall re)) + ((stringp re) + (looking-at re))) + (t (error "Problem with `magic-mode-alist'.")) + ))))) (set-auto-mode-0 done keep-mode-if-same))) ;; Next compare the filename against the entries in auto-mode-alist. (unless done @@ -2966,9 +2975,16 @@ set-auto-mode (+ (point-min) magic-mode-regexp-match-limit))) (assoc-default nil magic-fallback-mode-alist (lambda (re _dummy) - (if (functionp re) - (funcall re) - (looking-at re))))))) + ;; Bug#25360 We might have a + ;; symbol which is not a + ;; function during bootstrap. + (cond + ((functionp re) + (funcall re)) + ((stringp re) + (looking-at re)) + (t (error "Problem with `magic-fallback-mode-alist'.")) + )))))) (set-auto-mode-0 done keep-mode-if-same))) (unless done (set-buffer-major-mode (current-buffer))))) diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el index 6f65d49..6986b3f 100644 --- a/lisp/international/titdic-cnv.el +++ b/lisp/international/titdic-cnv.el @@ -1168,10 +1168,10 @@ miscdic-convert "Chinese-GB")) "\" \"" title "\" t\n") (let* ((coding-system-for-read - (coding-system-change-eol-conversion coding 'unix)) - (dicbuf (find-file-noselect filename))) - (funcall converter dicbuf name title) - (kill-buffer dicbuf)) + (coding-system-change-eol-conversion coding 'unix))) + (with-temp-buffer + (insert-file-contents filename) + (funcall converter (current-buffer) name title))) (insert ";; Local Variables:\n" ";; version-control: never\n" ";; no-update-autoloads: t\n" -- 2.9.3 --=-=-=--