Mercurial > emacs
comparison lisp/progmodes/cc-langs.el @ 77081:e8bd3e011b64
Changes to make `narrow-to-defun' and `mark-defun' work properly in CC
Mode:
cc-defs.el (c-beginning-of-defun-1):
cc-cmds.el (c-beginning-of-defun, c-end-of-defun): bind
beginning/end-of-defun-function to nil around calls to
beginning/end-of-defun.
cc-langs.el (beginning-of-defun-function, end-of-defun-function): new
c-lang-setvar's.
cc-awk.el (c-awk-beginning-of-defun): Add "(or arg (setq arg 1))" to
enable non-interactive call.
author | Alan Mackenzie <acm@muc.de> |
---|---|
date | Mon, 09 Apr 2007 10:51:29 +0000 |
parents | e3694f1cb928 |
children | c1ec1c8a8d2e 4ef881a120fe |
comparison
equal
deleted
inserted
replaced
77080:32c1980a1285 | 77081:e8bd3e011b64 |
---|---|
219 ;; can be t to choose all groups, a list of group type symbols | 219 ;; can be t to choose all groups, a list of group type symbols |
220 ;; (such as 'prefix) to accept, or a function which will be called | 220 ;; (such as 'prefix) to accept, or a function which will be called |
221 ;; with the group symbol for each group and should return non-nil | 221 ;; with the group symbol for each group and should return non-nil |
222 ;; if that group is to be included. | 222 ;; if that group is to be included. |
223 ;; | 223 ;; |
224 ;; OP-FILTER filters the individual operators in each group. It | |
225 ;; can be t to choose all operators, a regexp to test against each | |
226 ;; operator, or a function which will be called for each operator | |
227 ;; and should return non-nil for those to include. | |
228 ;; | |
229 ;; If XLATE is given, it's a function which is called for each | 224 ;; If XLATE is given, it's a function which is called for each |
230 ;; matching operator and its return value is collected instead. | 225 ;; matching operator and its return value is collected instead. |
231 ;; If it returns a list, the elements are spliced directly into | 226 ;; If it returns a list, the elements are spliced directly into |
232 ;; the final result, which is returned as a list with duplicates | 227 ;; the final result, which is returned as a list with duplicates |
233 ;; removed using `equal'. | 228 ;; removed using `equal'. |
1374 awk 'c-awk-vsemi-status-unknown-p) | 1369 awk 'c-awk-vsemi-status-unknown-p) |
1375 (c-lang-defvar c-vsemi-status-unknown-p-fn | 1370 (c-lang-defvar c-vsemi-status-unknown-p-fn |
1376 (c-lang-const c-vsemi-status-unknown-p-fn)) | 1371 (c-lang-const c-vsemi-status-unknown-p-fn)) |
1377 | 1372 |
1378 | 1373 |
1374 ;;; Defun functions | |
1375 | |
1376 ;; The Emacs variables beginning-of-defun-function and | |
1377 ;; end-of-defun-function will be set so that commands like | |
1378 ;; `mark-defun' and `narrow-to-defun' work right. The key sequences | |
1379 ;; C-M-a and C-M-e are, however, bound directly to the CC Mode | |
1380 ;; functions, allowing optimisation for large n. | |
1381 (c-lang-defconst beginning-of-defun-function | |
1382 "Function to which beginning-of-defun-function will be set." | |
1383 t 'c-beginning-of-defun | |
1384 awk 'c-awk-beginning-of-defun) | |
1385 (c-lang-setvar beginning-of-defun-function | |
1386 (c-lang-const beginning-of-defun-function)) | |
1387 | |
1388 (c-lang-defconst end-of-defun-function | |
1389 "Function to which end-of-defun-function will be set." | |
1390 t 'c-end-of-defun | |
1391 awk 'c-awk-end-of-defun) | |
1392 (c-lang-setvar end-of-defun-function (c-lang-const end-of-defun-function)) | |
1393 | |
1379 ;;; In-comment text handling. | 1394 ;;; In-comment text handling. |
1380 | 1395 |
1381 (c-lang-defconst c-paragraph-start | 1396 (c-lang-defconst c-paragraph-start |
1382 "Regexp to append to `paragraph-start'." | 1397 "Regexp to append to `paragraph-start'." |
1383 t "$" | 1398 t "$" |