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

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

[nongnu] elpa/gnu-indent 582676d3e1 04/17: Recommend setting gnu-indent-


From: ELPA Syncer
Subject: [nongnu] elpa/gnu-indent 582676d3e1 04/17: Recommend setting gnu-indent-options in local vars
Date: Sun, 27 Nov 2022 16:00:24 -0500 (EST)

branch: elpa/gnu-indent
commit 582676d3e19834ae433a0e4986cbec9f4dd24ad6
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>

    Recommend setting gnu-indent-options in local vars
---
 README.org    | 5 +++--
 gnu-indent.el | 8 +++++---
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/README.org b/README.org
index ea6869b429..94447a5d1b 100644
--- a/README.org
+++ b/README.org
@@ -19,5 +19,6 @@ GNU Indent supports C, C++ is also partially supported.
 
 - ~gnu-indent-program~ :: Name of GNU Indent program (default ~"indent"~).
 - ~gnu-indent-options~ :: Arguments to pass to GNU Indent (default ~nil~).
-  See GNU Indent manual (=C-h i m Indent RET= on Emacs, ~info indent~ on
-  shell) for available options.
+  You'd probably want to set it as a file local variable.  See GNU Indent
+  manual (=C-h i m Indent RET= on Emacs, ~info indent~ on shell) for
+  available options.
diff --git a/gnu-indent.el b/gnu-indent.el
index a359564dd6..277ee77444 100644
--- a/gnu-indent.el
+++ b/gnu-indent.el
@@ -60,7 +60,7 @@
   :group 'gnu-indent)
 
 ;;;###autoload
-(defun gnu-indent-region (beg end &optional interactive-p)
+(defun gnu-indent-region (beg end)
   "Indent current region with GNU Indent.
 
 When called non-interactively, indent text between BEG and END."
@@ -68,7 +68,8 @@ When called non-interactively, indent text between BEG and 
END."
                    (list (region-beginning) (region-end) t)
                  (list (point) (point) t)))
   (unless (eq beg end)
-    (when interactive-p (message "Indenting..."))
+    (when (called-interactively-p 'interactive)
+      (message "Indenting..."))
     (let ((buffer (get-buffer-create "*gnu-indent*"))
           (temp-file (make-temp-file "gnu-indent-")))
       (with-current-buffer buffer
@@ -93,7 +94,8 @@ When called non-interactively, indent text between BEG and 
END."
                 (insert-file-contents temp-file nil nil nil
                                       t))))
         (delete-file temp-file)))
-    (when interactive-p (message "Indenting...done"))))
+    (when (called-interactively-p 'interactive)
+      (message "Indenting...done"))))
 
 ;;;###autoload
 (defun gnu-indent-buffer ()



reply via email to

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