* help.el (function-called-at-point):
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 6 Jun 2008 20:02:42 +0000 (20:02 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 6 Jun 2008 20:02:42 +0000 (20:02 +0000)
* help-fns.el (variable-at-point): Use emacs-lisp-mode-syntax-table
even when calling find-tag-default.

lisp/ChangeLog
lisp/help-fns.el
lisp/help.el

index 6ca7bff..f4b0748 100644 (file)
@@ -1,3 +1,9 @@
+2008-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * help.el (function-called-at-point):
+       * help-fns.el (variable-at-point): Use emacs-lisp-mode-syntax-table
+       even when calling find-tag-default.
+
 2008-06-06  Daniel Colascione  <danc@merrillpress.com>
 
        * nxml/nxml-mode.el (nxml-syntax-highlight-flag)
index 1d1130f..f2e9b1e 100644 (file)
@@ -443,8 +443,8 @@ face (according to `face-differs-from-default-p')."
   "Return the bound variable symbol found at or before point.
 Return 0 if there is no such symbol.
 If ANY-SYMBOL is non-nil, don't insist the symbol be bound."
-  (or (condition-case ()
-         (with-syntax-table emacs-lisp-mode-syntax-table
+  (with-syntax-table emacs-lisp-mode-syntax-table
+    (or (condition-case ()
            (save-excursion
              (or (not (zerop (skip-syntax-backward "_w")))
                  (eq (char-syntax (following-char)) ?w)
@@ -452,17 +452,17 @@ If ANY-SYMBOL is non-nil, don't insist the symbol be bound."
                  (forward-sexp -1))
              (skip-chars-forward "'")
              (let ((obj (read (current-buffer))))
-               (and (symbolp obj) (boundp obj) obj))))
-       (error nil))
-      (let* ((str (find-tag-default))
-            (sym (if str (intern-soft str))))
-       (if (and sym (or any-symbol (boundp sym)))
-           sym
-         (save-match-data
-           (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str))
-             (setq sym (intern-soft (match-string 1 str)))
-             (and (or any-symbol (boundp sym)) sym)))))
-      0))
+               (and (symbolp obj) (boundp obj) obj)))
+          (error nil))
+        (let* ((str (find-tag-default))
+               (sym (if str (intern-soft str))))
+          (if (and sym (or any-symbol (boundp sym)))
+              sym
+            (save-match-data
+              (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str))
+                (setq sym (intern-soft (match-string 1 str)))
+                (and (or any-symbol (boundp sym)) sym)))))
+        0)))
 
 (defun describe-variable-custom-version-info (variable)
   (let ((custom-version (get variable 'custom-version))
index 5ed6756..44e3f70 100644 (file)
@@ -254,40 +254,40 @@ C-w         Information on absence of warranty for GNU Emacs."
 (defun function-called-at-point ()
   "Return a function around point or else called by the list containing point.
 If that doesn't give a function, return nil."
-  (or (with-syntax-table emacs-lisp-mode-syntax-table
-       (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.
-                   (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 (read (current-buffer))))
-                     (and (symbolp obj) (fboundp obj) obj))))
-             (error nil))))
-      (let* ((str (find-tag-default))
-            (sym (if str (intern-soft str))))
-       (if (and sym (fboundp sym))
-           sym
-         (save-match-data
-           (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str))
-             (setq sym (intern-soft (match-string 1 str)))
-             (and (fboundp sym) sym)))))))
+  (with-syntax-table emacs-lisp-mode-syntax-table
+    (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.
+                (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 (read (current-buffer))))
+                  (and (symbolp obj) (fboundp obj) obj))))
+          (error nil))
+        (let* ((str (find-tag-default))
+               (sym (if str (intern-soft str))))
+          (if (and sym (fboundp sym))
+              sym
+            (save-match-data
+              (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str))
+                (setq sym (intern-soft (match-string 1 str)))
+                (and (fboundp sym) sym))))))))
 
 \f
 ;;; `User' help functions