]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/help-fns.el (describe-variable): Add original value, if applicable.
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 20 Sep 2010 11:13:52 +0000 (13:13 +0200)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 20 Sep 2010 11:13:52 +0000 (13:13 +0200)
lisp/ChangeLog
lisp/help-fns.el

index 7310e8d3dc89d7cc6f46ffc53a91e65ea47a4635..a43c267c9321bea495469ad14c70aa8e1dedd80f 100644 (file)
@@ -1,3 +1,7 @@
+2010-09-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * help-fns.el (describe-variable): Add original value, if applicable.
+
 2010-09-20  Juanma Barranquero  <lekktu@gmail.com>
 
        * subr.el (y-or-n-p): Remove leftover code from 2010-09-17T13:30:30Z!monnier@iro.umontreal.ca.
index 4456a494099050870cebfe9f14769e44d325f5c2..9739762637a248c2b3d3c232b0a2811a09f798e3 100644 (file)
@@ -645,7 +645,20 @@ it is displayed along with the global value."
                  ;; inappropriate e.g C-h v <RET> features <RET>
                  ;; (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