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

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

[elpa] externals/phps-mode e57f1e1 075/405: Skipping indentation if it's


From: Stefan Monnier
Subject: [elpa] externals/phps-mode e57f1e1 075/405: Skipping indentation if it's already correct
Date: Sat, 13 Jul 2019 09:59:46 -0400 (EDT)

branch: externals/phps-mode
commit e57f1e187798282689be503638e77f15ad3b7fcc
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>

    Skipping indentation if it's already correct
---
 phps-functions.el | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/phps-functions.el b/phps-functions.el
index 4020428..03f2d8c 100644
--- a/phps-functions.el
+++ b/phps-functions.el
@@ -118,15 +118,16 @@
               (setq indent-adjust 1))
 
             (let ((indent-sum (+ (* indent-level tab-width) indent-adjust)))
-              ;; (message "Indenting to %s" indent-sum)
-              ;; (message "inside scripting, start: %s, end: %s, indenting to 
column %s " start end indent-level)
-              (indent-line-to indent-sum)
-              (let ((line-start (line-beginning-position)))
-                (when (or (not phps-mode/buffer-changes--start)
-                          (< line-start phps-mode/buffer-changes--start))
-                  ;; (message "Setting changes start from %s to %s" 
phps-mode/buffer-changes--start start)
-                  (setq phps-mode/buffer-changes--start line-start))
-                (phps-mode/run-incremental-lex)))))))))
+              (when (not (equal indent-sum (current-indentation)))
+                ;; (message "Indenting to %s current column %s" indent-sum 
(current-indentation))
+                ;; (message "inside scripting, start: %s, end: %s, indenting 
to column %s " start end indent-level)
+                (indent-line-to indent-sum)
+                (let ((line-start (line-beginning-position)))
+                  (when (or (not phps-mode/buffer-changes--start)
+                            (< line-start phps-mode/buffer-changes--start))
+                    ;; (message "Setting changes start from %s to %s" 
phps-mode/buffer-changes--start start)
+                    (setq phps-mode/buffer-changes--start line-start))
+                  (phps-mode/run-incremental-lex))))))))))
 
 ;; TODO Implement this?
 (defun phps-mode/indent-region ()



reply via email to

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