comparison lisp/help.el @ 90068:eac554634bfa

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-79 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-735 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-747 Update from CVS
author Miles Bader <miles@gnu.org>
date Sat, 25 Dec 2004 02:00:25 +0000
parents e24e2e78deda 52e86589c83a
children 72cf6261961e
comparison
equal deleted inserted replaced
90067:b481c5870e10 90068:eac554634bfa
265 (error "Probably not a Lisp function call")) 265 (error "Probably not a Lisp function call"))
266 (let ((obj (read (current-buffer)))) 266 (let ((obj (read (current-buffer))))
267 (and (symbolp obj) (fboundp obj) obj)))) 267 (and (symbolp obj) (fboundp obj) obj))))
268 (error nil)))) 268 (error nil))))
269 (let* ((str (find-tag-default)) 269 (let* ((str (find-tag-default))
270 (obj (if str (intern str)))) 270 (sym (if str (intern-soft str))))
271 (and (symbolp obj) (fboundp obj) obj)))) 271 (if (and sym (fboundp sym))
272 sym
273 (save-match-data
274 (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str))
275 (setq sym (intern-soft (match-string 1 str)))
276 (and (fboundp sym) sym)))))))
272 277
273 278
274 ;;; `User' help functions 279 ;;; `User' help functions
275 280
276 (defun describe-distribution () 281 (defun describe-distribution ()
607 (princ " runs the command ") 612 (princ " runs the command ")
608 (prin1 defn) 613 (prin1 defn)
609 (princ "\n which is ") 614 (princ "\n which is ")
610 (describe-function-1 defn) 615 (describe-function-1 defn)
611 (when up-event 616 (when up-event
612 (let ((defn (or (string-key-binding up-event) (key-binding up-event)))) 617 (let ((ev (aref up-event 0))
618 (descr (key-description up-event))
619 (hdr "\n\n-------------- up event ---------------\n\n")
620 defn
621 mouse-1-tricky mouse-1-remapped)
622 (when (and (consp ev)
623 (eq (car ev) 'mouse-1)
624 (windowp window)
625 mouse-1-click-follows-link
626 (not (eq mouse-1-click-follows-link 'double))
627 (with-current-buffer (window-buffer window)
628 (mouse-on-link-p (posn-point (event-start ev)))))
629 (setq mouse-1-tricky (integerp mouse-1-click-follows-link)
630 mouse-1-remapped (or (not mouse-1-tricky)
631 (> mouse-1-click-follows-link 0)))
632 (if mouse-1-remapped
633 (setcar ev 'mouse-2)))
634 (setq defn (or (string-key-binding up-event) (key-binding up-event)))
613 (unless (or (null defn) (integerp defn) (equal defn 'undefined)) 635 (unless (or (null defn) (integerp defn) (equal defn 'undefined))
614 (princ "\n\n-------------- up event ---------------\n\n") 636 (princ (if mouse-1-tricky
615 (princ (key-description up-event)) 637 "\n\n----------------- up-event (short click) ----------------\n\n"
638 hdr))
639 (setq hdr nil)
640 (princ descr)
616 (if (windowp window) 641 (if (windowp window)
617 (princ " at that spot")) 642 (princ " at that spot"))
643 (if mouse-1-remapped
644 (princ " is remapped to <mouse-2>\n which" ))
618 (princ " runs the command ") 645 (princ " runs the command ")
619 (prin1 defn) 646 (prin1 defn)
620 (princ "\n which is ") 647 (princ "\n which is ")
621 (describe-function-1 defn)))) 648 (describe-function-1 defn))
622 (print-help-return-message))))))) 649 (when mouse-1-tricky
650 (setcar ev
651 (if (> mouse-1-click-follows-link 0) 'mouse-1 'mouse-2))
652 (setq defn (or (string-key-binding up-event) (key-binding up-event)))
653 (unless (or (null defn) (integerp defn) (equal defn 'undefined))
654 (princ (or hdr
655 "\n\n----------------- up-event (long click) ----------------\n\n"))
656 (princ "Pressing ")
657 (princ descr)
658 (if (windowp window)
659 (princ " at that spot"))
660 (princ (format " for longer than %d milli-seconds\n"
661 (abs mouse-1-click-follows-link)))
662 (if (not mouse-1-remapped)
663 (princ " remaps it to <mouse-2> which" ))
664 (princ " runs the command ")
665 (prin1 defn)
666 (princ "\n which is ")
667 (describe-function-1 defn))))
668 (print-help-return-message))))))))
623 669
624 670
625 (defun describe-mode (&optional buffer) 671 (defun describe-mode (&optional buffer)
626 "Display documentation of current major mode and minor modes. 672 "Display documentation of current major mode and minor modes.
627 A brief summary of the minor modes comes first, followed by the 673 A brief summary of the minor modes comes first, followed by the
690 "no indicator"))) 736 "no indicator")))
691 (princ (documentation mode-function))) 737 (princ (documentation mode-function)))
692 (princ " ") 738 (princ " ")
693 (insert-button pretty-minor-mode 739 (insert-button pretty-minor-mode
694 'action (car help-button-cache) 740 'action (car help-button-cache)
741 'follow-link t
695 'help-echo "mouse-2, RET: show full information") 742 'help-echo "mouse-2, RET: show full information")
696 (princ (format " minor mode (%s):\n" 743 (princ (format " minor mode (%s):\n"
697 (if indicator 744 (if indicator
698 (format "indicator%s" indicator) 745 (format "indicator%s" indicator)
699 "no indicator")))))) 746 "no indicator"))))))