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
This commit is contained in:
Wenjamin Petrenko 2018-08-14 11:44:18 +03:00 committed by Noam Postavsky
parent 624e7dc778
commit 9a613d3ed0

View file

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