all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Wenjamin Petrenko <wenjamin.petrenko@yandex.com>
To: 23294@debbugs.gnu.org
Subject: bug#23294:
Date: Tue, 14 Aug 2018 13:05:25 +0300	[thread overview]
Message-ID: <13011331534241125@iva4-f774db2b5297.qloud-c.yandex.net> (raw)
In-Reply-To: <CANHUxH2sr9=Ymnu8isretzrWeGMcXR6fOTvAUF19TvUs3Bvpvw@mail.gmail.com>

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

A patch with a fix is attached.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-bug-23294.patch --]
[-- Type: text/x-diff; name="0001-Fix-bug-23294.patch", Size: 1062 bytes --]

From c520ac992e683abb8625bb92bfa3ac75209bc0fb Mon Sep 17 00:00:00 2001
From: Wenjamin Petrenko <wenjamin.petrenko@yandex.ru>
Date: Tue, 14 Aug 2018 11:44:18 +0300
Subject: [PATCH] Fix bug#23294

* lisp/files-x.el (modify-file-local-variable-prop-line): Handle
whitespace when checking if there's a ';' before the variable name.
---
 lisp/files-x.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/files-x.el b/lisp/files-x.el
index 2a52792222..f0dfa97d40 100644
--- a/lisp/files-x.el
+++ b/lisp/files-x.el
@@ -377,7 +377,9 @@ from the -*- line ignoring the input argument VALUE."
 	   ((eq variable 'mode) (goto-char beg))
 	   ((null replaced-pos) (goto-char end))
 	   (replaced-pos (goto-char replaced-pos)))
-	  (if (and (not (eq (char-before) ?\;))
+	  (if (and (save-excursion
+		     (skip-chars-backward " \t")
+		     (not (eq (char-before) ?\;)))
 		   (not (equal (point) (marker-position beg)))
 		   ;; When existing `-*- -*-' is empty, beg > end.
 		   (not (> (marker-position beg) (marker-position end))))
-- 
2.14.1


  parent reply	other threads:[~2018-08-14 10:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15  1:52 bug#23294: 25.0.92; modify-file-local-variable-prop-line adds extra "; " Mohammed Sadik P. K.
2016-04-15  7:55 ` Alexis
2018-06-05 23:51   ` Noam Postavsky
2018-08-14 10:05 ` Wenjamin Petrenko [this message]
2018-08-16  0:02   ` Noam Postavsky
2018-08-16 10:54     ` Wenjamin Petrenko
2018-08-25  1:59       ` Noam Postavsky

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

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

  git send-email \
    --in-reply-to=13011331534241125@iva4-f774db2b5297.qloud-c.yandex.net \
    --to=wenjamin.petrenko@yandex.com \
    --cc=23294@debbugs.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.