emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/gnome-c-style 87beebf24a: align: gnome-c-align-arglist


From: ELPA Syncer
Subject: [elpa] externals/gnome-c-style 87beebf24a: align: gnome-c-align-arglist file local variable
Date: Sun, 24 Sep 2023 21:58:11 -0400 (EDT)

branch: externals/gnome-c-style
commit 87beebf24a999a253ac6ec5d14d223619a624c2b
Author: Daiki Ueno <ueno@gnu.org>
Commit: Daiki Ueno <ueno@gnu.org>

    align: gnome-c-align-arglist file local variable
    
    Some GNOME projects do not align function parameters, while they do
    for function declarations.  This adds support for it, through a new
    file local variable gnome-c-align-arglist.
---
 gnome-c-align.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gnome-c-align.el b/gnome-c-align.el
index 734800a266..770d78db36 100644
--- a/gnome-c-align.el
+++ b/gnome-c-align.el
@@ -30,6 +30,13 @@
                 (const :tag "No wrap"))
   :group 'gnome-c-style)
 
+(defcustom gnome-c-align-arglist t
+  "Align function parameters when reformatting function
+declarations with \\[gnome-c-align-decls-region]."
+  :type 'boolean
+  :group 'gnome-c-style)
+(put 'gnome-c-align-arglist 'safe-local-variable t)
+
 (defvar gnome-c-align-identifier-start-column nil)
 (make-variable-buffer-local 'gnome-c-align-identifier-start-column)
 
@@ -213,7 +220,8 @@
            (let ((column (if (bobp) 0 start-column)))
              (when (not (bobp))
                (gnome-c-align--indent-to-column start-column))
-             (when (gnome-c-align--argument-identifier-start argument)
+             (when (and gnome-c-align-arglist
+                        (gnome-c-align--argument-identifier-start argument))
                (setq column (+ column identifier-start-column))
                (goto-char (gnome-c-align--argument-identifier-start argument))
                (gnome-c-align--indent-to-column column)))))))))



reply via email to

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