emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C-h v fails when a symbol has variable documentation yet is unbound


From: Alan Mackenzie
Subject: C-h v fails when a symbol has variable documentation yet is unbound
Date: Wed, 9 Nov 2005 11:24:46 +0000 (GMT)

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  <address@hidden>

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]