[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
describe-function bad def value ("nil") when not near a function name
From: |
Drew Adams |
Subject: |
describe-function bad def value ("nil") when not near a function name |
Date: |
Tue, 24 Jan 2006 16:00:52 -0800 |
emacs -q
go to the empty *scratch* buffer, and do `C-h f', then do M-n at the
prompt. The default value you see is "nil". The default value should be
nil, not "nil".
Here's the code:
(defun describe-function (function)
"Display the full documentation of FUNCTION (a symbol)."
(interactive
(let ((fn (function-called-at-point))
(enable-recursive-minibuffers t)
val)
(setq val (completing-read
(if fn
(format "Describe function (default %s): " fn)
"Describe function: ")
obarray 'fboundp t nil nil (symbol-name fn)))
...
In this case, fn is nil, so (symbol-name fn) is "nil" - a bad default
value. Just use (and fn (symbol-name fn)).
In GNU Emacs 22.0.50.1 (i386-mingw-nt5.1.2600)
of 2005-06-26 on NONIQPC
X server distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc
(3.3) --cflags -I../../jpeg-6b-3/include -I../../libpng-1.2.8/include -I../.
./tiff-3.6.1-2/include -I../../xpm-nox-4.2.0/include -I../../zlib-1.2.2/incl
ude'
- describe-function bad def value ("nil") when not near a function name,
Drew Adams <=