all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* is that value the original value or did I change it?
@ 2002-04-05  7:36 Dan Jacobson
  2002-04-05 15:38 ` Stefan Monnier
  2002-04-05 17:43 ` Kevin Rodgers
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Jacobson @ 2002-04-05  7:36 UTC (permalink / raw)


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.
-- 
http://jidanni.org/ Taiwan(04)25854780

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: is that value the original value or did I change it?
  2002-04-05  7:36 is that value the original value or did I change it? Dan Jacobson
@ 2002-04-05 15:38 ` Stefan Monnier
  2002-04-05 17:43 ` Kevin Rodgers
  1 sibling, 0 replies; 4+ messages 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] 4+ messages in thread

* Re: is that value the original value or did I change it?
  2002-04-05  7:36 is that value the original value or did I change it? Dan Jacobson
  2002-04-05 15:38 ` Stefan Monnier
@ 2002-04-05 17:43 ` Kevin Rodgers
  2002-04-06 10:26   ` Dan Jacobson
  1 sibling, 1 reply; 4+ messages in thread
From: Kevin Rodgers @ 2002-04-05 17:43 UTC (permalink / raw)


Dan Jacobson wrote:
> 
> 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?

Not really, IMO.

> That way one
> wouldn't have to poke around to see if it was one's .emacs that gave
> it the current value...

M-! emacs -q --no-site-file --eval '(describe-variable (quote bla-bla-bla))'

> I'm talking about some default value checker,
> not just asking the author to note the default value in the
> documentation.

-- 
Kevin Rodgers <kevinr@ihs.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: is that value the original value or did I change it?
  2002-04-05 17:43 ` Kevin Rodgers
@ 2002-04-06 10:26   ` Dan Jacobson
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Jacobson @ 2002-04-06 10:26 UTC (permalink / raw)


>>>>> "K" == Kevin Rodgers <kevinr@ihs.com> writes:

>> OK, but wouldn't it be neat for it to tell what its original or
>> default value was, along with its current value?

K> Not really, IMO.

>> That way one
>> wouldn't have to poke around to see if it was one's .emacs that gave
>> it the current value...

hmmm, grep xyz .emacs ... OK, never mind.
-- 
http://jidanni.org/ Taiwan(04)25854780

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-04-06 10:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-05  7:36 is that value the original value or did I change it? Dan Jacobson
2002-04-05 15:38 ` Stefan Monnier
2002-04-05 17:43 ` Kevin Rodgers
2002-04-06 10:26   ` Dan Jacobson

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.