]> git.eshelyaron.com Git - emacs.git/commitdiff
(c-emacs-features): Check beginning-of-defun-raw instead of
authorChong Yidong <cyd@stupidchicken.com>
Mon, 11 Aug 2008 21:38:04 +0000 (21:38 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Mon, 11 Aug 2008 21:38:04 +0000 (21:38 +0000)
beginning-of-defun, and avoid moving point during the test.

lisp/progmodes/cc-defs.el

index d1a1a75f3034e4316190a558e5adcd7d26fbd402..92ff4562b85d41782efe78538588817f6c75a6e9 100644 (file)
@@ -1440,13 +1440,14 @@ non-nil, a caret is prepended to invert the set."
                         '1-bit)
                       list)))
 
-    ;; In Emacs >= 23, beginning-of-defun will passes its parameter to
-    ;; beginning-of-defun-function.  Assume end-of-defun does the same.
+    ;; In Emacs >= 23, beginning-of-defun-raw passes its argument to
+    ;; beginning-of-defun-function.  Assume end-of-defun does likewise.
     (let ((beginning-of-defun-function
           (lambda (&optional arg)
             (not (eq arg nil)))))
-      (if (beginning-of-defun 1)
-         (setq list (cons 'argumentative-bod-function list))))
+      (save-excursion
+       (if (beginning-of-defun-raw 1)
+           (setq list (cons 'argumentative-bod-function list)))))
 
     (let ((buf (generate-new-buffer " test"))
          parse-sexp-lookup-properties