]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/gnome-c-style/gnome-c-align.el
Merge commit 'd827bb511203a64da3ae5cc6910b87b7c99d233b'
[gnu-emacs-elpa] / packages / gnome-c-style / gnome-c-align.el
index 64b8178c774848f4eca597b7dbf606d563482527..734800a266db81be77e679da43849a1bc887efbd 100644 (file)
@@ -4,21 +4,20 @@
 ;; Author: Daiki Ueno <ueno@gnu.org>
 ;; Keywords: GNOME, C, coding style
 
-;; This file is not part of GNU Emacs.
+;; This file is part of GNU Emacs.
 
-;; This program is free software: you can redistribute it and/or
-;; modify it under the terms of the GNU General Public License as
-;; published by the Free Software Foundation, either version 3 of the
-;; License, or (at your option) any later version.
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
-;; This program is distributed in the hope that it will be useful, but
-;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-;; General Public License for more details.
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with this program.  If not, see
-;; <http://www.gnu.org/licenses/>.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Code:
 
@@ -494,7 +493,19 @@ This sets `gnome-c-align-identifier-start-column',
 
 ;;;###autoload
 (defun gnome-c-align-decls-region (beg end)
-  "Reformat function declarations in the region between BEG and END."
+  "Reformat function declarations in the region between BEG and END.
+
+The `gnome-c-align-identifier-start-column',
+`gnome-c-align-arglist-start-column', and
+`gnome-c-align-arglist-identifier-start-column' variables
+control the widths.
+
+To set those variables, use \\[gnome-c-align-set-column],
+\\[gnome-c-align-guess-columns], or
+\\[gnome-c-align-guess-optimal-columns].
+
+If they are not set, this function internally calls
+\\[gnome-c-align-guess-optimal-columns] before formatting."
   (interactive "r")
   (save-excursion
     (let (decls)
@@ -514,8 +525,8 @@ This sets `gnome-c-align-identifier-start-column',
              (setq gnome-c-align-arglist-identifier-start-column
                    (cdr (assq 'arglist-identifier-start-column columns))))))
        (setq decls (gnome-c-align--scan-decls beg end))
-       (mapc #'gnome-c-align--normalize-decl decls)
        (dolist (decl decls)
+         (gnome-c-align--normalize-decl decl)
          (goto-char (gnome-c-align--decl-identifier-start decl))
          (gnome-c-align--indent-to-column
           gnome-c-align-identifier-start-column)