aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2018-11-08 00:27:58 +0200
committerJuri Linkov2018-11-08 00:27:58 +0200
commitfdbe4035ac7305c2f70274d2133c310c3480e23a (patch)
tree9a4ad0868de6ddc1281d14294663f645cba11156
parent4254caa2d3bc2ebec6513fccce6a3d6303b068ef (diff)
downloademacs-fdbe4035ac7305c2f70274d2133c310c3480e23a.tar.gz
emacs-fdbe4035ac7305c2f70274d2133c310c3480e23a.zip
* lisp/files-x.el (modify-dir-local-variable): Use assoc-delete-all
instead of assq-delete-all for cases when mode is a subdirectory name. (dir-locals-to-string): Call pp-to-string and string-trim-right on values. (Bug#32817)
-rw-r--r--lisp/files-x.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/files-x.el b/lisp/files-x.el
index 9af399c87ba..5d87a4ed0c1 100644
--- a/lisp/files-x.el
+++ b/lisp/files-x.el
@@ -30,6 +30,8 @@
30 30
31;;; Code: 31;;; Code:
32 32
33(eval-when-compile (require 'subr-x)) ; for string-trim-right
34
33 35
34;;; Commands to add/delete file-local/directory-local variables. 36;;; Commands to add/delete file-local/directory-local variables.
35 37
@@ -484,7 +486,7 @@ from the MODE alist ignoring the input argument VALUE."
484 (if (memq variable '(mode eval)) 486 (if (memq variable '(mode eval))
485 (cdr mode-assoc) 487 (cdr mode-assoc)
486 (assq-delete-all variable (cdr mode-assoc)))))) 488 (assq-delete-all variable (cdr mode-assoc))))))
487 (assq-delete-all mode variables))) 489 (assoc-delete-all mode variables)))
488 (setq variables 490 (setq variables
489 (cons `(,mode . ((,variable . ,value))) 491 (cons `(,mode . ((,variable . ,value)))
490 variables)))) 492 variables))))
@@ -513,9 +515,11 @@ from the MODE alist ignoring the input argument VALUE."
513 (car mode-variables) 515 (car mode-variables)
514 (format "(%s)" (mapconcat 516 (format "(%s)" (mapconcat
515 (lambda (variable-value) 517 (lambda (variable-value)
516 (format "(%S . %S)" 518 (format "(%S . %s)"
517 (car variable-value) 519 (car variable-value)
518 (cdr variable-value))) 520 (string-trim-right
521 (pp-to-string
522 (cdr variable-value)))))
519 (cdr mode-variables) "\n")))) 523 (cdr mode-variables) "\n"))))
520 variables "\n"))) 524 variables "\n")))
521 525