comparison lisp/help.el @ 5594:cc8ea7ed4286

Mention when compiled functions are built-in, help.el. 2011-11-09 Aidan Kehoe <kehoea@parhasard.net> * help.el (describe-function-1): When printing compiled functions, mention whether they're built-in.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 09 Nov 2011 12:51:10 +0000
parents ac37a5f7e5be
children a81a739181dc
comparison
equal deleted inserted replaced
5593:4218b56833b3 5594:cc8ea7ed4286
1393 (if (eq 'macro (car-safe def)) 1393 (if (eq 'macro (car-safe def))
1394 (setq fndef (cdr def) 1394 (setq fndef (cdr def)
1395 macrop t) 1395 macrop t)
1396 (setq fndef def)) 1396 (setq fndef def))
1397 (if aliases (princ aliases)) 1397 (if aliases (princ aliases))
1398 (let ((int #'(lambda (string an-p macro-p) 1398 (labels
1399 (princ (format 1399 ((int (string an-p macro-p)
1400 (gettext (concat 1400 (princ (format
1401 (cond ((commandp def) 1401 (gettext (concat
1402 "an interactive ") 1402 (cond ((commandp def)
1403 (an-p "an ") 1403 "an interactive ")
1404 (t "a ")) 1404 (an-p "an ")
1405 "%s" 1405 (t "a "))
1406 (cond 1406 "%s"
1407 ((eq 'neither macro-p) 1407 (cond
1408 "") 1408 ((eq 'neither macro-p)
1409 (macro-p " macro") 1409 "")
1410 (t " function")))) 1410 (macro-p " macro")
1411 string))))) 1411 (t " function"))))
1412 string))))
1413 (declare (inline int))
1412 (cond ((or (stringp def) (vectorp def)) 1414 (cond ((or (stringp def) (vectorp def))
1413 (princ "a keyboard macro.") 1415 (princ "a keyboard macro.")
1414 (setq kbd-macro-p t)) 1416 (setq kbd-macro-p t))
1415 ((special-operator-p fndef) 1417 ((special-operator-p fndef)
1416 (funcall int "built-in special operator" nil 'neither)) 1418 (int "built-in special operator" nil 'neither))
1417 ((subrp fndef) 1419 ((subrp fndef)
1418 (funcall int "built-in" nil macrop)) 1420 (int "built-in" nil macrop))
1419 ((compiled-function-p fndef) 1421 ((compiled-function-p fndef)
1420 (funcall int "compiled Lisp" nil macrop)) 1422 (int (concat (if (built-in-symbol-file function 'defun)
1423 "built-in "
1424 "") "compiled Lisp") nil macrop))
1421 ((eq (car-safe fndef) 'lambda) 1425 ((eq (car-safe fndef) 'lambda)
1422 (funcall int "Lisp" nil macrop)) 1426 (int "Lisp" nil macrop))
1423 ((eq (car-safe def) 'autoload) 1427 ((eq (car-safe def) 'autoload)
1424 (funcall int "autoloaded Lisp" t (elt def 4))) 1428 (int "autoloaded Lisp" t (elt def 4)))
1425 ((and (symbolp def) (not (fboundp def))) 1429 ((and (symbolp def) (not (fboundp def)))
1426 (princ "a symbol with a void (unbound) function definition.")) 1430 (princ "a symbol with a void (unbound) function definition."))
1427 (t 1431 (t
1428 nil))) 1432 nil)))
1429 (princ "\n") 1433 (princ "\n")