unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: Glenn Morris <rgm@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: master dbe3e41: Don't try to eval local variables in Gnus article
Date: Tue, 20 Jun 2017 10:39:18 +0900	[thread overview]
Message-ID: <b4mtw3bbfp5.fsf@jpl.org> (raw)
In-Reply-To: b4mk2477dhl.fsf@jpl.org

[-- Attachment #1: Type: text/plain, Size: 1279 bytes --]

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(#<buffer  *temp*>)
| set-auto-mode()
| mm-display-inline-fontify((#<buffer  *mm*-519429>\
| 	("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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 719 bytes --]

--- 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)))

  reply	other threads:[~2017-06-20  1:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170619021043.362.89296@vcs0.savannah.gnu.org>
     [not found] ` <20170619021044.B8B5820DE6@vcs0.savannah.gnu.org>
2017-06-19 20:15   ` master dbe3e41: Don't try to eval local variables in Gnus article Glenn Morris
2017-06-19 23:40     ` Katsumi Yamaoka
2017-06-20  1:39       ` Katsumi Yamaoka [this message]
2017-06-20  2:18         ` Glenn Morris

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4mtw3bbfp5.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=emacs-devel@gnu.org \
    --cc=rgm@gnu.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).