aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/help.el
diff options
context:
space:
mode:
authorStefan Monnier2008-06-06 20:02:42 +0000
committerStefan Monnier2008-06-06 20:02:42 +0000
commit2e6750c8f8f1bc4af059574da7cea898321dc914 (patch)
tree8e65f6f26f204d9fcbc05712ae701adf2ace58e4 /lisp/help.el
parentbb9ba46f2178db819f4be76c8e2d9a4a3061011b (diff)
downloademacs-2e6750c8f8f1bc4af059574da7cea898321dc914.tar.gz
emacs-2e6750c8f8f1bc4af059574da7cea898321dc914.zip
* help.el (function-called-at-point):
* help-fns.el (variable-at-point): Use emacs-lisp-mode-syntax-table even when calling find-tag-default.
Diffstat (limited to 'lisp/help.el')
-rw-r--r--lisp/help.el68
1 files changed, 34 insertions, 34 deletions
diff --git a/lisp/help.el b/lisp/help.el
index 5ed67566c93..44e3f707af1 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -254,40 +254,40 @@ C-w Information on absence of warranty for GNU Emacs."
254(defun function-called-at-point () 254(defun function-called-at-point ()
255 "Return a function around point or else called by the list containing point. 255 "Return a function around point or else called by the list containing point.
256If that doesn't give a function, return nil." 256If that doesn't give a function, return nil."
257 (or (with-syntax-table emacs-lisp-mode-syntax-table 257 (with-syntax-table emacs-lisp-mode-syntax-table
258 (or (condition-case () 258 (or (condition-case ()
259 (save-excursion 259 (save-excursion
260 (or (not (zerop (skip-syntax-backward "_w"))) 260 (or (not (zerop (skip-syntax-backward "_w")))
261 (eq (char-syntax (following-char)) ?w) 261 (eq (char-syntax (following-char)) ?w)
262 (eq (char-syntax (following-char)) ?_) 262 (eq (char-syntax (following-char)) ?_)
263 (forward-sexp -1)) 263 (forward-sexp -1))
264 (skip-chars-forward "'") 264 (skip-chars-forward "'")
265 (let ((obj (read (current-buffer)))) 265 (let ((obj (read (current-buffer))))
266 (and (symbolp obj) (fboundp obj) obj))) 266 (and (symbolp obj) (fboundp obj) obj)))
267 (error nil)) 267 (error nil))
268 (condition-case () 268 (condition-case ()
269 (save-excursion 269 (save-excursion
270 (save-restriction 270 (save-restriction
271 (narrow-to-region (max (point-min) 271 (narrow-to-region (max (point-min)
272 (- (point) 1000)) (point-max)) 272 (- (point) 1000)) (point-max))
273 ;; Move up to surrounding paren, then after the open. 273 ;; Move up to surrounding paren, then after the open.
274 (backward-up-list 1) 274 (backward-up-list 1)
275 (forward-char 1) 275 (forward-char 1)
276 ;; If there is space here, this is probably something 276 ;; If there is space here, this is probably something
277 ;; other than a real Lisp function call, so ignore it. 277 ;; other than a real Lisp function call, so ignore it.
278 (if (looking-at "[ \t]") 278 (if (looking-at "[ \t]")
279 (error "Probably not a Lisp function call")) 279 (error "Probably not a Lisp function call"))
280 (let ((obj (read (current-buffer)))) 280 (let ((obj (read (current-buffer))))
281 (and (symbolp obj) (fboundp obj) obj)))) 281 (and (symbolp obj) (fboundp obj) obj))))
282 (error nil)))) 282 (error nil))
283 (let* ((str (find-tag-default)) 283 (let* ((str (find-tag-default))
284 (sym (if str (intern-soft str)))) 284 (sym (if str (intern-soft str))))
285 (if (and sym (fboundp sym)) 285 (if (and sym (fboundp sym))
286 sym 286 sym
287 (save-match-data 287 (save-match-data
288 (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str)) 288 (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str))
289 (setq sym (intern-soft (match-string 1 str))) 289 (setq sym (intern-soft (match-string 1 str)))
290 (and (fboundp sym) sym))))))) 290 (and (fboundp sym) sym))))))))
291 291
292 292
293;;; `User' help functions 293;;; `User' help functions