diff options
| -rw-r--r-- | lisp/help.el | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lisp/help.el b/lisp/help.el index 051c56e65ba..2aef6283042 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -507,8 +507,9 @@ C-p Display information about the GNU project. | |||
| 507 | C-w Display information on absence of warranty for GNU Emacs." | 507 | C-w Display information on absence of warranty for GNU Emacs." |
| 508 | help-map) | 508 | help-map) |
| 509 | 509 | ||
| 510 | ;; Return a function which is called by the list containing point. | 510 | ;; Return a function whose name is around point. |
| 511 | ;; If that gives no function, return a function whose name is around point. | 511 | ;; If that gives no function, return a function which is called by the |
| 512 | ;; list containing point. | ||
| 512 | ;; If that doesn't give a function, return nil. | 513 | ;; If that doesn't give a function, return nil. |
| 513 | (defun function-called-at-point () | 514 | (defun function-called-at-point () |
| 514 | (let ((stab (syntax-table))) | 515 | (let ((stab (syntax-table))) |
| @@ -516,6 +517,16 @@ C-w Display information on absence of warranty for GNU Emacs." | |||
| 516 | (unwind-protect | 517 | (unwind-protect |
| 517 | (or (condition-case () | 518 | (or (condition-case () |
| 518 | (save-excursion | 519 | (save-excursion |
| 520 | (or (not (zerop (skip-syntax-backward "_w"))) | ||
| 521 | (eq (char-syntax (following-char)) ?w) | ||
| 522 | (eq (char-syntax (following-char)) ?_) | ||
| 523 | (forward-sexp -1)) | ||
| 524 | (skip-chars-forward "'") | ||
| 525 | (let ((obj (read (current-buffer)))) | ||
| 526 | (and (symbolp obj) (fboundp obj) obj))) | ||
| 527 | (error nil)) | ||
| 528 | (condition-case () | ||
| 529 | (save-excursion | ||
| 519 | (save-restriction | 530 | (save-restriction |
| 520 | (narrow-to-region (max (point-min) (- (point) 1000)) (point-max)) | 531 | (narrow-to-region (max (point-min) (- (point) 1000)) (point-max)) |
| 521 | ;; Move up to surrounding paren, then after the open. | 532 | ;; Move up to surrounding paren, then after the open. |
| @@ -528,16 +539,6 @@ C-w Display information on absence of warranty for GNU Emacs." | |||
| 528 | (let (obj) | 539 | (let (obj) |
| 529 | (setq obj (read (current-buffer))) | 540 | (setq obj (read (current-buffer))) |
| 530 | (and (symbolp obj) (fboundp obj) obj)))) | 541 | (and (symbolp obj) (fboundp obj) obj)))) |
| 531 | (error nil)) | ||
| 532 | (condition-case () | ||
| 533 | (save-excursion | ||
| 534 | (or (not (zerop (skip-syntax-backward "_w"))) | ||
| 535 | (eq (char-syntax (following-char)) ?w) | ||
| 536 | (eq (char-syntax (following-char)) ?_) | ||
| 537 | (forward-sexp -1)) | ||
| 538 | (skip-chars-forward "'") | ||
| 539 | (let ((obj (read (current-buffer)))) | ||
| 540 | (and (symbolp obj) (fboundp obj) obj))) | ||
| 541 | (error nil))) | 542 | (error nil))) |
| 542 | (set-syntax-table stab)))) | 543 | (set-syntax-table stab)))) |
| 543 | 544 | ||