changeset 108029:e61497621f0d

(lisp-completion-at-point): Try and handle errors.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 21 Apr 2010 13:53:03 -0400
parents 3d3f9bad5460
children c964c5fcf1f2
files lisp/ChangeLog lisp/emacs-lisp/lisp.el
diffstat 2 files changed, 18 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Apr 21 18:42:39 2010 +0200
+++ b/lisp/ChangeLog	Wed Apr 21 13:53:03 2010 -0400
@@ -1,3 +1,7 @@
+2010-04-21  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp/lisp.el (lisp-completion-at-point): Try and handle errors.
+
 2010-04-21  Jan Djärv  <jan.h.d@swipnet.se>
 
 	* vc-dir.el (vc-dir-tool-bar-map): Add :label on some tool bar items.
--- a/lisp/emacs-lisp/lisp.el	Wed Apr 21 18:42:39 2010 +0200
+++ b/lisp/emacs-lisp/lisp.el	Wed Apr 21 13:53:03 2010 -0400
@@ -633,10 +633,12 @@
   ;; FIXME: the `end' could be after point?
   (let* ((pos (point))
          (beg (with-syntax-table emacs-lisp-mode-syntax-table
-                (save-excursion
-                  (backward-sexp 1)
-                  (skip-syntax-forward "'")
-                  (point))))
+                (condition-case nil
+                    (save-excursion
+                      (backward-sexp 1)
+                      (skip-syntax-forward "'")
+                      (point))
+                  (scan-error pos))))
          (predicate
           (or predicate
               (save-excursion
@@ -658,12 +660,14 @@
                     'fboundp)))))
          (end
           (unless (or (eq beg (point-max))
-                      (member (char-syntax (char-after beg)) '(?\( ?\))))
-            (save-excursion
-              (goto-char beg)
-              (forward-sexp 1)
-              (when (>= (point) pos)
-                (point))))))
+                      (member (char-syntax (char-after beg)) '(?\" ?\( ?\))))
+            (condition-case nil
+                (save-excursion
+                  (goto-char beg)
+                  (forward-sexp 1)
+                  (when (>= (point) pos)
+                    (point)))
+                  (scan-error pos)))))
     (when end
       (list beg end obarray
             :predicate predicate