aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2017-03-02 02:08:08 -0500
committerStefan Monnier2017-03-02 02:08:32 -0500
commit2c18969c810f338d73beda592ee5af7103132e97 (patch)
tree234d78e2407da79e01b7297240864436d7e300e0
parent41f91d367ac2ecac253057ff38589e8393cbeffd (diff)
downloademacs-2c18969c810f338d73beda592ee5af7103132e97.tar.gz
emacs-2c18969c810f338d73beda592ee5af7103132e97.zip
* lisp/help-fns.el (describe-variable): Use cl-print for the value
Use `pp-buffer' rather than `pp' so as to avoid calling prin1 twice.
-rw-r--r--lisp/help-fns.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 21f76e100a7..69a6113eda1 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -391,12 +391,12 @@ suitable file is found, return nil."
391 ;; If lots of ordinary text characters run this command, 391 ;; If lots of ordinary text characters run this command,
392 ;; don't mention them one by one. 392 ;; don't mention them one by one.
393 (if (< (length non-modified-keys) 10) 393 (if (< (length non-modified-keys) 10)
394 (princ (mapconcat 'key-description keys ", ")) 394 (princ (mapconcat #'key-description keys ", "))
395 (dolist (key non-modified-keys) 395 (dolist (key non-modified-keys)
396 (setq keys (delq key keys))) 396 (setq keys (delq key keys)))
397 (if keys 397 (if keys
398 (progn 398 (progn
399 (princ (mapconcat 'key-description keys ", ")) 399 (princ (mapconcat #'key-description keys ", "))
400 (princ ", and many ordinary text characters")) 400 (princ ", and many ordinary text characters"))
401 (princ "many ordinary text characters")))) 401 (princ "many ordinary text characters"))))
402 (when (or remapped keys non-modified-keys) 402 (when (or remapped keys non-modified-keys)
@@ -842,15 +842,22 @@ it is displayed along with the global value."
842 (let ((line-beg (line-beginning-position)) 842 (let ((line-beg (line-beginning-position))
843 (print-rep 843 (print-rep
844 (let ((rep 844 (let ((rep
845 (let ((print-quoted t)) 845 (let ((print-quoted t)
846 (prin1-to-string val)))) 846 (print-circle t))
847 (cl-prin1-to-string val))))
847 (if (and (symbolp val) (not (booleanp val))) 848 (if (and (symbolp val) (not (booleanp val)))
848 (format-message "`%s'" rep) 849 (format-message "`%s'" rep)
849 rep)))) 850 rep))))
850 (if (< (+ (length print-rep) (point) (- line-beg)) 68) 851 (if (< (+ (length print-rep) (point) (- line-beg)) 68)
851 (insert " " print-rep) 852 (insert " " print-rep)
852 (terpri) 853 (terpri)
853 (pp val) 854 (let ((buf (current-buffer)))
855 (with-temp-buffer
856 (insert print-rep)
857 (pp-buffer)
858 (let ((pp-buffer (current-buffer)))
859 (with-current-buffer buf
860 (insert-buffer-substring pp-buffer)))))
854 ;; Remove trailing newline. 861 ;; Remove trailing newline.
855 (and (= (char-before) ?\n) (delete-char -1))) 862 (and (= (char-before) ?\n) (delete-char -1)))
856 (let* ((sv (get variable 'standard-value)) 863 (let* ((sv (get variable 'standard-value))