Commit 9a613d3e authored by Wenjamin Petrenko's avatar Wenjamin Petrenko Committed by Noam Postavsky

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
parent 624e7dc7
...@@ -377,7 +377,9 @@ from the -*- line ignoring the input argument VALUE." ...@@ -377,7 +377,9 @@ from the -*- line ignoring the input argument VALUE."
((eq variable 'mode) (goto-char beg)) ((eq variable 'mode) (goto-char beg))
((null replaced-pos) (goto-char end)) ((null replaced-pos) (goto-char end))
(replaced-pos (goto-char replaced-pos))) (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))) (not (equal (point) (marker-position beg)))
;; When existing `-*- -*-' is empty, beg > end. ;; When existing `-*- -*-' is empty, beg > end.
(not (> (marker-position beg) (marker-position end)))) (not (> (marker-position beg) (marker-position end))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment