From 0097720d41e0c99856518c2c131922e716ec9f74 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 20 Sep 2010 13:13:52 +0200 Subject: [PATCH] * lisp/help-fns.el (describe-variable): Add original value, if applicable. --- lisp/ChangeLog | 4 ++++ lisp/help-fns.el | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7310e8d3dc8..a43c267c932 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2010-09-20 Stefan Monnier + + * help-fns.el (describe-variable): Add original value, if applicable. + 2010-09-20 Juanma Barranquero * subr.el (y-or-n-p): Remove leftover code from 2010-09-17T13:30:30Z!monnier@iro.umontreal.ca. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 4456a494099..9739762637a 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -645,7 +645,20 @@ it is displayed along with the global value." ;; inappropriate e.g C-h v features ;; (help-xref-on-pp from (point)) (if (< (point) (+ from 20)) - (delete-region (1- from) from))))) + (delete-region (1- from) from)) + (let* ((sv (get variable 'standard-value)) + (origval (and (consp sv) + (condition-case nil + (eval (car sv)) + (error :help-eval-error))))) + (when (and (consp sv) + (not (equal origval val)) + (not (equal origval :help-eval-error))) + (princ "\nOriginal value was \n") + (setq from (point)) + (pp origval) + (if (< (point) (+ from 20)) + (delete-region (1- from) from))))))) (terpri) (when locus -- 2.39.2