diff options
| author | Alan Mackenzie | 2009-02-05 21:21:07 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2009-02-05 21:21:07 +0000 |
| commit | 150948efecda7774a748fd64cd3b993584d399ab (patch) | |
| tree | d277c0717bf53e04716e36fffa446dea3810a68b /lisp | |
| parent | ccf4d7c6600cb60f00e306890c8a41214f92f3cb (diff) | |
| download | emacs-150948efecda7774a748fd64cd3b993584d399ab.tar.gz emacs-150948efecda7774a748fd64cd3b993584d399ab.zip | |
(c-emacs-features): Check the working of beginning/end-of-defun-function
more rigorously before setting argumentative-bod-function.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/progmodes/cc-defs.el | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index f360cc33559..01b11cfe8e2 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." | |||
| 1443 | '1-bit) | 1443 | '1-bit) |
| 1444 | list))) | 1444 | list))) |
| 1445 | 1445 | ||
| 1446 | ;; In Emacs >= 23, beginning-of-defun-raw passes its argument to | 1446 | ;; Check whether beginning/end-of-defun call |
| 1447 | ;; beginning-of-defun-function. Assume end-of-defun does likewise. | 1447 | ;; beginning/end-of-defun-function nicely, passing through the |
| 1448 | (let ((beginning-of-defun-function | 1448 | ;; argument and respecting the return code. |
| 1449 | (let (mark-ring | ||
| 1450 | (bod-param 'foo) (eod-param 'foo) | ||
| 1451 | (beginning-of-defun-function | ||
| 1449 | (lambda (&optional arg) | 1452 | (lambda (&optional arg) |
| 1450 | (not (eq arg nil)))) | 1453 | (or (eq bod-param 'foo) (setq bod-param 'bar)) |
| 1451 | mark-ring) | 1454 | (and (eq bod-param 'foo) |
| 1452 | (save-excursion | 1455 | (setq bod-param arg) |
| 1453 | (if (beginning-of-defun-raw 1) | 1456 | (eq arg 3)))) |
| 1454 | (setq list (cons 'argumentative-bod-function list))))) | 1457 | (end-of-defun-function |
| 1458 | (lambda (&optional arg) | ||
| 1459 | (and (eq eod-param 'foo) | ||
| 1460 | (setq eod-param arg) | ||
| 1461 | (eq arg 3))))) | ||
| 1462 | (if (save-excursion (and (beginning-of-defun 3) (= bod-param 3) | ||
| 1463 | (not (beginning-of-defun)) | ||
| 1464 | (end-of-defun 3) (= eod-param 3) | ||
| 1465 | (not (end-of-defun)))) | ||
| 1466 | (setq list (cons 'argumentative-bod-function list)))) | ||
| 1455 | 1467 | ||
| 1456 | (let ((buf (generate-new-buffer " test")) | 1468 | (let ((buf (generate-new-buffer " test")) |
| 1457 | parse-sexp-lookup-properties | 1469 | parse-sexp-lookup-properties |