aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/cc-defs.el
diff options
context:
space:
mode:
authorAlan Mackenzie <[email protected]>2009-02-05 21:21:07 +0000
committerAlan Mackenzie <[email protected]>2009-02-05 21:21:07 +0000
commit150948efecda7774a748fd64cd3b993584d399ab (patch)
treed277c0717bf53e04716e36fffa446dea3810a68b /lisp/progmodes/cc-defs.el
parentccf4d7c6600cb60f00e306890c8a41214f92f3cb (diff)
(c-emacs-features): Check the working of beginning/end-of-defun-function
more rigorously before setting argumentative-bod-function.
Diffstat (limited to 'lisp/progmodes/cc-defs.el')
-rw-r--r--lisp/progmodes/cc-defs.el28
1 files changed, 20 insertions, 8 deletions
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index f360cc3355..01b11cfe8e 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -1443,15 +1443,27 @@ non-nil, a caret is prepended to invert the set."
'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