unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* C-h v fails when a symbol has variable documentation yet is unbound
@ 2005-11-09 11:24 Alan Mackenzie
  2005-11-09 14:05 ` Stefan Monnier
  2005-11-10  2:09 ` Richard M. Stallman
  0 siblings, 2 replies; 4+ messages in thread
From: Alan Mackenzie @ 2005-11-09 11:24 UTC (permalink / raw)


When a symbol has variable documentation yet is unbound, "C-h v"'s
interactive specification prevents a user from displaying this
documentation.  This is not nice.

The variable I am thinking of is c-syntactic-context.  Normally, this
variable is unbound (indeed, MUST be unbound), but it gets dynamically
bound when calling auto-newline brace "action functions", auto-newline
semicolon/comma "criteria functions", "line-up" functions and
c-special-indent-hook-functions.  A user writing such a function should
be able to get c-syntactic-context's doc-string with C-h v.

The following patch fixes this.

 
2005-11-09  Alan Mackenzie  <acm@muc.de>

	* help-fns.el (describe-variable): Make C-h v work when a variable
	has variable documentation yet is unbound.


Index: help-fns.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/help-fns.el,v
retrieving revision 1.79
diff -c -r1.79 help-fns.el
*** help-fns.el	31 Oct 2005 17:06:00 -0000	1.79
--- help-fns.el	9 Nov 2005 11:18:25 -0000
***************
*** 496,502 ****
  				    (format
  				     "Describe variable (default %s): " v)
  				  "Describe variable: ")
! 				obarray 'boundp t nil nil
  				(if (symbolp v) (symbol-name v))))
       (list (if (equal val "")
  	       v (intern val)))))
--- 496,506 ----
  				    (format
  				     "Describe variable (default %s): " v)
  				  "Describe variable: ")
! 				obarray
! 				'(lambda (vv)
! 				   (or (boundp vv)
! 				       (get vv 'variable-documentation)))
! 				t nil nil
  				(if (symbolp v) (symbol-name v))))
       (list (if (equal val "")
  	       v (intern val)))))



-- 
Alan Mackenzie (Munich, Germany)

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

end of thread, other threads:[~2005-11-10  8:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-09 11:24 C-h v fails when a symbol has variable documentation yet is unbound Alan Mackenzie
2005-11-09 14:05 ` Stefan Monnier
2005-11-10  2:09 ` Richard M. Stallman
2005-11-10  8:25   ` Alan Mackenzie

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).