emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp/progmodes cc-defs.el


From: Alan Mackenzie
Subject: [Emacs-diffs] emacs/lisp/progmodes cc-defs.el
Date: Thu, 05 Feb 2009 21:21:08 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Alan Mackenzie <acmacm> 09/02/05 21:21:08

Modified files:
        lisp/progmodes : cc-defs.el 

Log message:
        (c-emacs-features): Check the working of beginning/end-of-defun-function
        more rigorously before setting argumentative-bod-function.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/progmodes/cc-defs.el?cvsroot=emacs&r1=1.67&r2=1.68

Patches:
Index: cc-defs.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/cc-defs.el,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -b -r1.67 -r1.68
--- cc-defs.el  11 Jan 2009 00:37:06 -0000      1.67
+++ cc-defs.el  5 Feb 2009 21:21:07 -0000       1.68
@@ -1443,15 +1443,27 @@
                         '1-bit)
                       list)))
 
-    ;; 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
+    ;; Check whether beginning/end-of-defun call
+    ;; beginning/end-of-defun-function nicely, passing through the
+    ;; argument and respecting the return code.
+    (let (mark-ring
+         (bod-param 'foo) (eod-param 'foo)
+         (beginning-of-defun-function
           (lambda (&optional arg)
-            (not (eq arg nil))))
-         mark-ring)
-      (save-excursion
-       (if (beginning-of-defun-raw 1)
-           (setq list (cons 'argumentative-bod-function list)))))
+            (or (eq bod-param 'foo) (setq bod-param 'bar))
+            (and (eq bod-param 'foo)
+                 (setq bod-param arg)
+                 (eq arg 3))))
+         (end-of-defun-function
+          (lambda (&optional arg)
+            (and (eq eod-param 'foo)
+                 (setq eod-param arg)
+                 (eq arg 3)))))
+      (if (save-excursion (and (beginning-of-defun 3) (= bod-param 3)
+                              (not (beginning-of-defun))
+                              (end-of-defun 3) (= eod-param 3)
+                              (not (end-of-defun))))
+         (setq list (cons 'argumentative-bod-function list))))
 
     (let ((buf (generate-new-buffer " test"))
          parse-sexp-lookup-properties




reply via email to

[Prev in Thread] Current Thread [Next in Thread]