# HG changeset patch # User Richard M. Stallman # Date 915049732 0 # Node ID 5ab992b6ca595e433c0e560a4093c5c6ff409f98 # Parent 7a6b8dd13afb5f274fdeb83f25107fddd2bce969 (function-called-at-point): First look for function at point. diff -r 7a6b8dd13afb -r 5ab992b6ca59 lisp/help.el --- a/lisp/help.el Wed Dec 30 19:02:31 1998 +0000 +++ b/lisp/help.el Wed Dec 30 20:28:52 1998 +0000 @@ -507,8 +507,9 @@ C-w Display information on absence of warranty for GNU Emacs." help-map) -;; Return a function which is called by the list containing point. -;; If that gives no function, return a function whose name is around point. +;; Return a function whose name is around point. +;; If that gives no function, return a function which is called by the +;; list containing point. ;; If that doesn't give a function, return nil. (defun function-called-at-point () (let ((stab (syntax-table))) @@ -516,6 +517,16 @@ (unwind-protect (or (condition-case () (save-excursion + (or (not (zerop (skip-syntax-backward "_w"))) + (eq (char-syntax (following-char)) ?w) + (eq (char-syntax (following-char)) ?_) + (forward-sexp -1)) + (skip-chars-forward "'") + (let ((obj (read (current-buffer)))) + (and (symbolp obj) (fboundp obj) obj))) + (error nil)) + (condition-case () + (save-excursion (save-restriction (narrow-to-region (max (point-min) (- (point) 1000)) (point-max)) ;; Move up to surrounding paren, then after the open. @@ -528,16 +539,6 @@ (let (obj) (setq obj (read (current-buffer))) (and (symbolp obj) (fboundp obj) obj)))) - (error nil)) - (condition-case () - (save-excursion - (or (not (zerop (skip-syntax-backward "_w"))) - (eq (char-syntax (following-char)) ?w) - (eq (char-syntax (following-char)) ?_) - (forward-sexp -1)) - (skip-chars-forward "'") - (let ((obj (read (current-buffer)))) - (and (symbolp obj) (fboundp obj) obj))) (error nil))) (set-syntax-table stab))))