* Re: is that value the original value or did I change it?
[not found] <m2vgb6lhpm.fsf@jidanni.org>
@ 2002-04-05 15:38 ` Stefan Monnier
0 siblings, 0 replies; only message in thread
From: Stefan Monnier @ 2002-04-05 15:38 UTC (permalink / raw)
Cc: jidanni
>>>>> "Dan" == Dan Jacobson <jidanni@deadspam.com> writes:
> here's the typical C-h v output,
> bla-bla-bla value is t
> Documentation:
> *If non-nil, offer to bla-bla-bla...
> OK, but wouldn't it be neat for it to tell what its original or
> default value was, along with its current value? That way one
> wouldn't have to poke around to see if it was one's .emacs that gave
> it the current value... I'm talking about some default value checker,
> not just asking the author to note the default value in the
> documentation.
For customized variables, this information is already available in
the `standard-value' symbol property, so we could do something like the
patch below (Dan, the patch is against the CVS version of the code, which
has changed since Emacs-21.2).
The only problem I see is that I find this `default value' often
uninteresting (typically for variables whose default is "obviously"
nil), but maybe it's just because I'm not a novice any more ;-)
Stefan
Index: help-fns.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/help-fns.el,v
retrieving revision 1.8
diff -u -u -b -r1.8 help-fns.el
--- help-fns.el 1 Apr 2002 12:31:51 -0000 1.8
+++ help-fns.el 5 Apr 2002 15:32:44 -0000
@@ -359,9 +364,14 @@
(pp val)
(help-xref-on-pp from (point))
(if (< (point) (+ from 20))
- (save-excursion
- (goto-char from)
- (delete-char -1)))))))
+ (delete-region (1- from) from))
+ (let ((sv (get variable 'standard-value)))
+ (when (and (consp sv) (not (equal val sv)))
+ (princ "\nOriginal value was \n")
+ (setq from (point))
+ (pp (car sv))
+ (if (< (point) (+ from 20))
+ (delete-region (1- from) from))))))))
(terpri)
(when (local-variable-p variable)
(princ (format "Local in buffer %s; " (buffer-name)))
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-04-05 15:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <m2vgb6lhpm.fsf@jidanni.org>
2002-04-05 15:38 ` is that value the original value or did I change it? Stefan Monnier
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).