summaryrefslogtreecommitdiff
path: root/lisp/help.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1997-10-16 18:32:06 +0000
committerKarl Heuer <kwzh@gnu.org>1997-10-16 18:32:06 +0000
commit51e2e6a76d5f0992d97fe93d7b4bbb7ac144acde (patch)
tree748a2fff7bb9d7bdba62cf2aa4904e95ec7e3416 /lisp/help.el
parent3104a11c0a49152239fd3cbf620f248de394dc27 (diff)
downloademacs-51e2e6a76d5f0992d97fe93d7b4bbb7ac144acde.tar.gz
(function-called-at-point): Always use Emacs Lisp syntax tab.
Reject any "function call" with whitespace after the open-paren.
Diffstat (limited to 'lisp/help.el')
-rw-r--r--lisp/help.el37
1 files changed, 21 insertions, 16 deletions
diff --git a/lisp/help.el b/lisp/help.el
index 8ea8c405c19..03fe4363434 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -472,21 +472,26 @@ C-w Display information on absence of warranty for GNU Emacs."
;; If that gives no function, return a function whose name is around point.
;; If that doesn't give a function, return nil.
(defun function-called-at-point ()
- (or (condition-case ()
- (save-excursion
- (save-restriction
- (narrow-to-region (max (point-min) (- (point) 1000)) (point-max))
- (backward-up-list 1)
- (forward-char 1)
- (let (obj)
- (setq obj (read (current-buffer)))
- (and (symbolp obj) (fboundp obj) obj))))
- (error nil))
- (condition-case ()
- (let ((stab (syntax-table)))
- (unwind-protect
+ (let ((stab (syntax-table)))
+ (set-syntax-table emacs-lisp-mode-syntax-table)
+ (unwind-protect
+ (or (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.
+ (backward-up-list 1)
+ (forward-char 1)
+ ;; If there is space here, this is probably something
+ ;; other than a real Lisp function call, so ignore it.
+ (if (looking-at "[ \t]")
+ (error "Probably not a Lisp function call"))
+ (let (obj)
+ (setq obj (read (current-buffer)))
+ (and (symbolp obj) (fboundp obj) obj))))
+ (error nil))
+ (condition-case ()
(save-excursion
- (set-syntax-table emacs-lisp-mode-syntax-table)
(or (not (zerop (skip-syntax-backward "_w")))
(eq (char-syntax (following-char)) ?w)
(eq (char-syntax (following-char)) ?_)
@@ -494,8 +499,8 @@ C-w Display information on absence of warranty for GNU Emacs."
(skip-chars-forward "'")
(let ((obj (read (current-buffer))))
(and (symbolp obj) (fboundp obj) obj)))
- (set-syntax-table stab)))
- (error nil))))
+ (error nil)))
+ (set-syntax-table stab))))
(defun describe-function-find-file (function)
(let ((files load-history)