diff options
| author | Alan Mackenzie | 2019-05-21 11:47:14 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2019-05-21 11:47:14 +0000 |
| commit | 5856512911488e40609be5685e64f9fb8cd395ad (patch) | |
| tree | d9ccffb3abf1427140e6847e551d98e6e56eaf29 | |
| parent | 5950160584b944c4cf9bb99c1804bf3b11fccc29 (diff) | |
| download | emacs-5856512911488e40609be5685e64f9fb8cd395ad.tar.gz emacs-5856512911488e40609be5685e64f9fb8cd395ad.zip | |
C Mode: Fix indentation of DEFUN's function's argument list.
Formally, when DEFUNs still used knr argument lists, these were indented by
the syntactic context knr-argdecl-intro (5 columns). Since this is no longer
the case, we now just use c-basic-offset (2 columns in "gnu" style).
* lisp/progmodes/cc-align.el (c-indent-gnu-DEFUN-intro-cont): Modernize the
indentation. Amend the doc string accordingly.
| -rw-r--r-- | lisp/progmodes/cc-align.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/progmodes/cc-align.el b/lisp/progmodes/cc-align.el index 009f58ea586..74548f643a7 100644 --- a/lisp/progmodes/cc-align.el +++ b/lisp/progmodes/cc-align.el | |||
| @@ -90,26 +90,26 @@ Works with: topmost-intro-cont." | |||
| 90 | 90 | ||
| 91 | (defun c-lineup-gnu-DEFUN-intro-cont (langelem) | 91 | (defun c-lineup-gnu-DEFUN-intro-cont (langelem) |
| 92 | "Line up the continuation lines of a DEFUN macro in the Emacs C source. | 92 | "Line up the continuation lines of a DEFUN macro in the Emacs C source. |
| 93 | These lines are indented as though they were `knr-argdecl-intro' lines. | 93 | These lines are indented `c-basic-offset' columns, usually from column 0. |
| 94 | Return nil when we're not in such a construct. | 94 | Return nil when we're not in such a construct. |
| 95 | 95 | ||
| 96 | This function is for historical compatibility with how previous CC Modes (5.28 | 96 | This function was formally for use in DEFUNs, which used to have knr |
| 97 | and earlier) indented such lines. | 97 | argument lists. Now (2019-05) it just indents the argument list of the |
| 98 | DEFUN's function, which would otherwise go to column 0. | ||
| 98 | 99 | ||
| 99 | Here is an example: | 100 | Here is an example: |
| 100 | 101 | ||
| 101 | DEFUN (\"forward-char\", Fforward_char, Sforward_char, 0, 1, \"p\", | 102 | DEFUN (\"forward-char\", Fforward_char, Sforward_char, 0, 1, \"p\", |
| 102 | doc: /* Move point right N characters (left if N is negative). | 103 | doc: /* Move point right N characters (left if N is negative). |
| 103 | On reaching end of buffer, stop and signal error. */) | 104 | On reaching end of buffer, stop and signal error. */) |
| 104 | (n) <- c-lineup-gnu-DEFUN-into-cont | 105 | (Lisp_Object n) <- c-lineup-gnu-DEFUN-into-cont |
| 105 | Lisp_Object n; <- c-lineup-gnu-DEFUN-into-cont | ||
| 106 | 106 | ||
| 107 | Works with: topmost-intro-cont." | 107 | Works with: topmost-intro-cont." |
| 108 | (save-excursion | 108 | (save-excursion |
| 109 | (let (case-fold-search) | 109 | (let (case-fold-search) |
| 110 | (goto-char (c-langelem-pos langelem)) | 110 | (goto-char (c-langelem-pos langelem)) |
| 111 | (if (looking-at "\\<DEFUN\\>") | 111 | (if (looking-at "\\<DEFUN\\>") |
| 112 | (c-calc-offset '(knr-argdecl-intro)))))) | 112 | c-basic-offset)))) |
| 113 | 113 | ||
| 114 | (defun c-block-in-arglist-dwim (arglist-start) | 114 | (defun c-block-in-arglist-dwim (arglist-start) |
| 115 | ;; This function implements the DWIM to avoid far indentation of | 115 | ;; This function implements the DWIM to avoid far indentation of |