From: Wenjamin Petrenko Date: Tue, 14 Aug 2018 08:44:18 +0000 (+0300) Subject: Prevent `modify-file-local-variable-prop-line' from adding extra ';' X-Git-Tag: emacs-26.1.90~193 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9a613d3ed0331f9fd2528520a96d977ebba57d7d;p=emacs.git Prevent `modify-file-local-variable-prop-line' from adding extra ';' * lisp/files-x.el (modify-file-local-variable-prop-line): Handle whitespace when checking if there's already a ';' before the variable (Bug#23294). Copyright-paperwork-exempt: yes --- diff --git a/lisp/files-x.el b/lisp/files-x.el index 2a52792222d..92532e85f4f 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))))