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)
;;; Code:
+(eval-when-compile (require 'subr-x)) ; for string-trim-right
+
\f
;;; Commands to add/delete file-local/directory-local variables.
(if (memq variable '(mode eval))
(cdr mode-assoc)
(assq-delete-all variable (cdr mode-assoc))))))
- (assq-delete-all mode variables)))
+ (assoc-delete-all mode variables)))
(setq variables
(cons `(,mode . ((,variable . ,value)))
variables))))
(car mode-variables)
(format "(%s)" (mapconcat
(lambda (variable-value)
- (format "(%S . %S)"
+ (format "(%S . %s)"
(car variable-value)
- (cdr variable-value)))
+ (string-trim-right
+ (pp-to-string
+ (cdr variable-value)))))
(cdr mode-variables) "\n"))))
variables "\n")))