aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWenjamin Petrenko2018-08-14 11:44:18 +0300
committerNoam Postavsky2018-08-24 21:54:16 -0400
commit9a613d3ed0331f9fd2528520a96d977ebba57d7d (patch)
treea9018051473aa286e231357e2b89a00ed86eecfc
parent624e7dc77865e0a9359dd7f7b0e861743d091313 (diff)
downloademacs-9a613d3ed0331f9fd2528520a96d977ebba57d7d.tar.gz
emacs-9a613d3ed0331f9fd2528520a96d977ebba57d7d.zip
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
-rw-r--r--lisp/files-x.el4
1 files changed, 3 insertions, 1 deletions
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."
377 ((eq variable 'mode) (goto-char beg)) 377 ((eq variable 'mode) (goto-char beg))
378 ((null replaced-pos) (goto-char end)) 378 ((null replaced-pos) (goto-char end))
379 (replaced-pos (goto-char replaced-pos))) 379 (replaced-pos (goto-char replaced-pos)))
380 (if (and (not (eq (char-before) ?\;)) 380 (if (and (save-excursion
381 (skip-chars-backward " \t")
382 (not (eq (char-before) ?\;)))
381 (not (equal (point) (marker-position beg))) 383 (not (equal (point) (marker-position beg)))
382 ;; When existing `-*- -*-' is empty, beg > end. 384 ;; When existing `-*- -*-' is empty, beg > end.
383 (not (> (marker-position beg) (marker-position end)))) 385 (not (> (marker-position beg) (marker-position end))))