summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2010-10-09 17:43:43 +0200
committerStefan Monnier <monnier@iro.umontreal.ca>2010-10-09 17:43:43 +0200
commit4c5281974ff17b5b1dcd87e6091e4952d868306d (patch)
tree9a2fb41c26a36a737861510629e7a36c4837237e /lisp/emacs-lisp
parent4897601e9ff2a43737300e9c95e398dbf7a46662 (diff)
downloademacs-4c5281974ff17b5b1dcd87e6091e4952d868306d.tar.gz
emacs-4c5281974ff17b5b1dcd87e6091e4952d868306d.tar.bz2
emacs-4c5281974ff17b5b1dcd87e6091e4952d868306d.zip
* lisp/emacs-lisp/lisp.el (lisp-completion-at-point):
Use emacs-lisp-mode-syntax-table for the whole function.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/lisp.el54
1 files changed, 27 insertions, 27 deletions
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index 54fa4d615cd..5703f1ee190 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -632,37 +632,37 @@ considered."
(defun lisp-completion-at-point (&optional predicate)
"Function used for `completion-at-point-functions' in `emacs-lisp-mode'."
;; FIXME: the `end' could be after point?
- (let* ((end (point))
- (beg (with-syntax-table emacs-lisp-mode-syntax-table
- (save-excursion
+ (with-syntax-table emacs-lisp-mode-syntax-table
+ (let* ((end (point))
+ (beg (save-excursion
(backward-sexp 1)
(while (= (char-syntax (following-char)) ?\')
(forward-char 1))
- (point))))
- (predicate
- (or predicate
- (save-excursion
- (goto-char beg)
- (if (not (eq (char-before) ?\())
- (lambda (sym) ;why not just nil ? -sm
- (or (boundp sym) (fboundp sym)
- (symbol-plist sym)))
- ;; Looks like a funcall position. Let's double check.
- (if (condition-case nil
- (progn (up-list -2) (forward-char 1)
- (eq (char-after) ?\())
- (error nil))
- ;; If the first element of the parent list is an open
- ;; parenthesis we are probably not in a funcall position.
- ;; Maybe a `let' varlist or something.
- nil
- ;; Else, we assume that a function name is expected.
- 'fboundp))))))
- (list beg end obarray
- :predicate predicate
- :annotate-function
+ (point)))
+ (predicate
+ (or predicate
+ (save-excursion
+ (goto-char beg)
+ (if (not (eq (char-before) ?\())
+ (lambda (sym) ;why not just nil ? -sm
+ (or (boundp sym) (fboundp sym)
+ (symbol-plist sym)))
+ ;; Looks like a funcall position. Let's double check.
+ (if (condition-case nil
+ (progn (up-list -2) (forward-char 1)
+ (eq (char-after) ?\())
+ (error nil))
+ ;; If the first element of the parent list is an open
+ ;; paren we are probably not in a funcall position.
+ ;; Maybe a `let' varlist or something.
+ nil
+ ;; Else, we assume that a function name is expected.
+ 'fboundp))))))
+ (list beg end obarray
+ :predicate predicate
+ :annotate-function
(unless (eq predicate 'fboundp)
- (lambda (str) (if (fboundp (intern-soft str)) " <f>"))))))
+ (lambda (str) (if (fboundp (intern-soft str)) " <f>")))))))
;; arch-tag: aa7fa8a4-2e6f-4e9b-9cd9-fef06340e67e
;;; lisp.el ends here