From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.devel Subject: Re: master dbe3e41: Don't try to eval local variables in Gnus article Date: Tue, 20 Jun 2017 10:39:18 +0900 Organization: Emacsen advocacy group Message-ID: References: <20170619021043.362.89296@vcs0.savannah.gnu.org> <20170619021044.B8B5820DE6@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1497922778 13284 195.159.176.226 (20 Jun 2017 01:39:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 20 Jun 2017 01:39:38 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (i686-pc-cygwin) Cc: emacs-devel@gnu.org To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 20 03:39:34 2017 Return-path: Envelope-to: ged-emacs-devel@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 1dN88h-0003Ax-Ow for ged-emacs-devel@m.gmane.org; Tue, 20 Jun 2017 03:39:31 +0200 Original-Received: from localhost ([::1]:45133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dN88m-0000cC-VW for ged-emacs-devel@m.gmane.org; Mon, 19 Jun 2017 21:39:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dN88d-0000aU-4H for emacs-devel@gnu.org; Mon, 19 Jun 2017 21:39:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dN88a-00073R-2j for emacs-devel@gnu.org; Mon, 19 Jun 2017 21:39:27 -0400 Original-Received: from mail-hampton.hostforweb.net ([205.234.186.191]:38667 helo=hampton.hostforweb.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dN88Z-000735-Tn; Mon, 19 Jun 2017 21:39:23 -0400 Original-Received: from s70.gtokyofl21.vectant.ne.jp ([202.215.75.70]:60000 helo=localhost) by hampton.hostforweb.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) (envelope-from ) id 1dN88W-000rwF-2A; Mon, 19 Jun 2017 20:39:21 -0500 X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( Cancel-Lock: sha1:gruXRtNU89WwoAo6cPYbPgi0C1Y= X-OutGoing-Spam-Status: No, score=-1.5 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hampton.hostforweb.net X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Get-Message-Sender-Via: hampton.hostforweb.net: authenticated_id: yamaoka/from_h X-Authenticated-Sender: hampton.hostforweb.net: yamaoka@jpl.org X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (barebone) [generic] [fuzzy] X-Received-From: 205.234.186.191 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:215812 Archived-At: --=-=-= On Tue, 20 Jun 2017 08:40:38 +0900, Katsumi Yamaoka wrote: > , but I haven't investigated why binding enable-local-variables > to nil is not effective thoroughly. I'll do it. What tries to eval local variables is `run-mode-hooks', that runs in the buffer containing the CONTRIBUTING.md contents. ,---- a Lisp backtrace | hack-local-variables-confirm(((eval message "Coucou"))\ | ((eval message "Coucou")) nil nil) | hack-local-variables-filter(((eval message "Coucou")) nil) | hack-local-variables(no-mode) | run-mode-hooks() | fundamental-mode() | set-buffer-major-mode(#) | set-auto-mode() | mm-display-inline-fontify((#\ | ("text/plain" (charset . "iso-8859-1"))\ | quoted-printable nil\ | ("inline" (filename . "CONTRIBUTING.md"))\ | nil nil nil)) `---- Why binding `enable-local-variables' to nil is not effective is that `fundamental-mode' runs `kill-all-local-variables': (defun fundamental-mode () "Major mode not specialized for anything in particular. Other major modes are defined by comparison with this one." (interactive) (kill-all-local-variables) (run-mode-hooks)) It kills `enable-local-variables' which `mm-display-inline-fontify' makes buffer-local. So the right solution would be to bind it globally: --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- mm-view.el~ 2017-06-19 02:09:32.424422200 +0000 +++ mm-view.el 2017-06-20 01:37:22.963901000 +0000 @@ -477,3 +477,4 @@ (let ((font-lock-verbose nil) - (font-lock-support-mode nil)) + (font-lock-support-mode nil) + (enable-local-variables nil)) ;; Disable support modes, e.g., jit-lock, lazy-lock, etc. @@ -482,3 +483,2 @@ (setq buffer-file-name (mm-handle-filename handle)) - (set (make-local-variable 'enable-local-variables) nil) (with-demoted-errors @@ -490,4 +490,3 @@ (delq (rassq 'doc-view-mode-maybe auto-mode-alist) - (copy-sequence auto-mode-alist))) - (local-enable-local-variables nil)) + (copy-sequence auto-mode-alist)))) (set-auto-mode))) --=-=-=--