]> git.eshelyaron.com Git - emacs.git/commitdiff
cc-mode.el (c-mode-base-map): Don't bind C-M-[ae] to the CC Mode specific
authorAlan Mackenzie <acm@muc.de>
Fri, 27 Jun 2008 21:12:46 +0000 (21:12 +0000)
committerAlan Mackenzie <acm@muc.de>
Fri, 27 Jun 2008 21:12:46 +0000 (21:12 +0000)
functions; this is no longer needed, since {beginning,end}-of-defun now
pass ARG to ...-of-defun-function.

cc-defs.el (c-emacs-features): new feature 'argumentative-bod-function.

----------------------------------------------------------------------
cc-defs.el cc-mode.el CVS:
----------------------------------------------------------------------

lisp/progmodes/cc-defs.el
lisp/progmodes/cc-mode.el

index dcdcdaec72852605e48a17cf02135040bb69b83c..d1a1a75f3034e4316190a558e5adcd7d26fbd402 100644 (file)
@@ -1440,6 +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.
+    (let ((beginning-of-defun-function
+          (lambda (&optional arg)
+            (not (eq arg nil)))))
+      (if (beginning-of-defun 1)
+         (setq list (cons 'argumentative-bod-function list))))
+
     (let ((buf (generate-new-buffer " test"))
          parse-sexp-lookup-properties
          parse-sexp-ignore-comments
@@ -1539,6 +1547,9 @@ might be present:
 
 '8-bit              8 bit syntax entry flags (XEmacs style).
 '1-bit              1 bit syntax entry flags (Emacs style).
+'argumentative-bod-function         beginning-of-defun passes ARG through
+                    to a non-null beginning-of-defun-function.  It is assumed
+                   the end-of-defun does the same thing.
 'syntax-properties  It works to override the syntax for specific characters
                    in the buffer with the 'syntax-table property.  It's
                    always set - CC Mode no longer works in emacsen without
index 9076491db344e5bee40c9dedbfd953a134578599..747b35be00aa6c5e837b909a5f15e65a1dcfc729 100644 (file)
@@ -285,8 +285,9 @@ control).  See \"cc-mode.el\" for more info."
 
   ;; RMS says don't make these the default.
   ;; (April 2006): RMS has now approved these commands as defaults.
-  (define-key c-mode-base-map "\e\C-a"    'c-beginning-of-defun)
-  (define-key c-mode-base-map "\e\C-e"    'c-end-of-defun)
+  (unless (memq 'argumentative-bod-function c-emacs-features)
+    (define-key c-mode-base-map "\e\C-a"    'c-beginning-of-defun)
+    (define-key c-mode-base-map "\e\C-e"    'c-end-of-defun))
 
   (define-key c-mode-base-map "\C-c\C-n"  'c-forward-conditional)
   (define-key c-mode-base-map "\C-c\C-p"  'c-backward-conditional)