emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 5856512: C Mode: Fix indentation of DEFUN's functio


From: Alan Mackenzie
Subject: [Emacs-diffs] master 5856512: C Mode: Fix indentation of DEFUN's function's argument list.
Date: Tue, 21 May 2019 07:49:31 -0400 (EDT)

branch: master
commit 5856512911488e40609be5685e64f9fb8cd395ad
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>

    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.
---
 lisp/progmodes/cc-align.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lisp/progmodes/cc-align.el b/lisp/progmodes/cc-align.el
index 009f58e..74548f6 100644
--- a/lisp/progmodes/cc-align.el
+++ b/lisp/progmodes/cc-align.el
@@ -90,26 +90,26 @@ Works with: topmost-intro-cont."
 
 (defun c-lineup-gnu-DEFUN-intro-cont (langelem)
   "Line up the continuation lines of a DEFUN macro in the Emacs C source.
-These lines are indented as though they were `knr-argdecl-intro' lines.
+These lines are indented `c-basic-offset' columns, usually from column 0.
 Return nil when we're not in such a construct.
 
-This function is for historical compatibility with how previous CC Modes (5.28
-and earlier) indented such lines.
+This function was formally for use in DEFUNs, which used to have knr
+argument lists.  Now (2019-05) it just indents the argument list of the
+DEFUN's function, which would otherwise go to column 0.
 
 Here is an example:
 
 DEFUN (\"forward-char\", Fforward_char, Sforward_char, 0, 1, \"p\",
        doc: /* Move point right N characters (left if N is negative).
 On reaching end of buffer, stop and signal error.  */)
-     (n)                      <- c-lineup-gnu-DEFUN-into-cont
-     Lisp_Object n;           <- c-lineup-gnu-DEFUN-into-cont
+  (Lisp_Object n)             <- c-lineup-gnu-DEFUN-into-cont
 
 Works with: topmost-intro-cont."
   (save-excursion
     (let (case-fold-search)
       (goto-char (c-langelem-pos langelem))
       (if (looking-at "\\<DEFUN\\>")
-         (c-calc-offset '(knr-argdecl-intro))))))
+         c-basic-offset))))
 
 (defun c-block-in-arglist-dwim (arglist-start)
   ;; This function implements the DWIM to avoid far indentation of



reply via email to

[Prev in Thread] Current Thread [Next in Thread]