comparison lisp/cus-edit.el @ 18085:3da4eaba1fe8

(custom-variable-prompt): Handle variable-at-point returning 0.
author Richard M. Stallman <rms@gnu.org>
date Sun, 01 Jun 1997 05:58:36 +0000
parents 0e2aa3b58e16
children dbae3eb8b351
comparison
equal deleted inserted replaced
18084:6f264bb70b49 18085:3da4eaba1fe8
360 Return a list suitable for use in `interactive'." 360 Return a list suitable for use in `interactive'."
361 (let ((v (variable-at-point)) 361 (let ((v (variable-at-point))
362 (enable-recursive-minibuffers t) 362 (enable-recursive-minibuffers t)
363 val) 363 val)
364 (setq val (completing-read 364 (setq val (completing-read
365 (if v 365 (if (symbolp v)
366 (format "Customize variable: (default %s) " v) 366 (format "Customize variable: (default %s) " v)
367 "Customize variable: ") 367 "Customize variable: ")
368 obarray (lambda (symbol) 368 obarray (lambda (symbol)
369 (and (boundp symbol) 369 (and (boundp symbol)
370 (or (get symbol 'custom-type) 370 (or (get symbol 'custom-type)
371 (user-variable-p symbol)))))) 371 (user-variable-p symbol))))))
372 (list (if (equal val "") 372 (list (if (equal val "")
373 v (intern val))))) 373 (if (symbolp v) v nil)
374 (intern val)))))
374 375
375 (defun custom-menu-filter (menu widget) 376 (defun custom-menu-filter (menu widget)
376 "Convert MENU to the form used by `widget-choose'. 377 "Convert MENU to the form used by `widget-choose'.
377 MENU should be in the same format as `custom-variable-menu'. 378 MENU should be in the same format as `custom-variable-menu'.
378 WIDGET is the widget to apply the filter entries of MENU on." 379 WIDGET is the widget to apply the filter entries of MENU on."