diff options
| author | Juri Linkov | 2004-09-02 16:37:01 +0000 |
|---|---|---|
| committer | Juri Linkov | 2004-09-02 16:37:01 +0000 |
| commit | 542e904c45959b990146846094519e799e7a5711 (patch) | |
| tree | 96fc3e1c742093abaa7e584570c7d2a92c319b26 | |
| parent | fc11ddc8d7b8eb0013a8573fcecf6e0e934348e5 (diff) | |
| download | emacs-542e904c45959b990146846094519e799e7a5711.tar.gz emacs-542e904c45959b990146846094519e799e7a5711.zip | |
(function-called-at-point): Try `find-tag-default' when other methods failed.
| -rw-r--r-- | lisp/help.el | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/lisp/help.el b/lisp/help.el index 52a772779a5..bf0df4358a7 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -237,32 +237,35 @@ C-w Display information on absence of warranty for GNU Emacs." | |||
| 237 | (defun function-called-at-point () | 237 | (defun function-called-at-point () |
| 238 | "Return a function around point or else called by the list containing point. | 238 | "Return a function around point or else called by the list containing point. |
| 239 | If that doesn't give a function, return nil." | 239 | If that doesn't give a function, return nil." |
| 240 | (with-syntax-table emacs-lisp-mode-syntax-table | 240 | (or (with-syntax-table emacs-lisp-mode-syntax-table |
| 241 | (or (condition-case () | 241 | (or (condition-case () |
| 242 | (save-excursion | 242 | (save-excursion |
| 243 | (or (not (zerop (skip-syntax-backward "_w"))) | 243 | (or (not (zerop (skip-syntax-backward "_w"))) |
| 244 | (eq (char-syntax (following-char)) ?w) | 244 | (eq (char-syntax (following-char)) ?w) |
| 245 | (eq (char-syntax (following-char)) ?_) | 245 | (eq (char-syntax (following-char)) ?_) |
| 246 | (forward-sexp -1)) | 246 | (forward-sexp -1)) |
| 247 | (skip-chars-forward "'") | 247 | (skip-chars-forward "'") |
| 248 | (let ((obj (read (current-buffer)))) | 248 | (let ((obj (read (current-buffer)))) |
| 249 | (and (symbolp obj) (fboundp obj) obj))) | 249 | (and (symbolp obj) (fboundp obj) obj))) |
| 250 | (error nil)) | 250 | (error nil)) |
| 251 | (condition-case () | 251 | (condition-case () |
| 252 | (save-excursion | 252 | (save-excursion |
| 253 | (save-restriction | 253 | (save-restriction |
| 254 | (narrow-to-region (max (point-min) | 254 | (narrow-to-region (max (point-min) |
| 255 | (- (point) 1000)) (point-max)) | 255 | (- (point) 1000)) (point-max)) |
| 256 | ;; Move up to surrounding paren, then after the open. | 256 | ;; Move up to surrounding paren, then after the open. |
| 257 | (backward-up-list 1) | 257 | (backward-up-list 1) |
| 258 | (forward-char 1) | 258 | (forward-char 1) |
| 259 | ;; If there is space here, this is probably something | 259 | ;; If there is space here, this is probably something |
| 260 | ;; other than a real Lisp function call, so ignore it. | 260 | ;; other than a real Lisp function call, so ignore it. |
| 261 | (if (looking-at "[ \t]") | 261 | (if (looking-at "[ \t]") |
| 262 | (error "Probably not a Lisp function call")) | 262 | (error "Probably not a Lisp function call")) |
| 263 | (let ((obj (read (current-buffer)))) | 263 | (let ((obj (read (current-buffer)))) |
| 264 | (and (symbolp obj) (fboundp obj) obj)))) | 264 | (and (symbolp obj) (fboundp obj) obj)))) |
| 265 | (error nil))))) | 265 | (error nil)))) |
| 266 | (let* ((str (find-tag-default)) | ||
| 267 | (obj (if str (read str)))) | ||
| 268 | (and (symbolp obj) (fboundp obj) obj)))) | ||
| 266 | 269 | ||
| 267 | 270 | ||
| 268 | ;;; `User' help functions | 271 | ;;; `User' help functions |