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

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

[nongnu] elpa/d-mode 075c3e7 075/346: Fix indentation of 'else verbose'


From: ELPA Syncer
Subject: [nongnu] elpa/d-mode 075c3e7 075/346: Fix indentation of 'else verbose' and 'else debug' statements.
Date: Sun, 29 Aug 2021 11:00:06 -0400 (EDT)

branch: elpa/d-mode
commit 075c3e7b8da8bfffe1bbe00cf705494755959fd1
Author: Dmitri Makarov <dmakarov@alumni.stanford.edu>
Commit: Dmitri Makarov <dmakarov@alumni.stanford.edu>

    Fix indentation of 'else verbose' and 'else debug' statements.
    
    This is a partial fix to the indentation issue #39. It extends the
    advice :around mechanism used for 'static if' statments on 'else
    verbose' and 'else debug' statements by cheating 'looking-at' into
    accepting 'version' and 'debug' words where 'if' word is expected.
---
 d-mode.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/d-mode.el b/d-mode.el
index 0480d16..ac613d8 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -458,11 +458,12 @@ operators."
 ;;;Workaround for special case of 'else static if' not being handled properly
 (defun d-special-case-looking-at (oldfun &rest args)
   (let ((rxp (car args)))
-    (if (and (stringp rxp)
-           (string= rxp "if\\>[^_]"))
-      (or (apply oldfun '("static\\>[^_]"))
-          (apply oldfun args))
-    (apply oldfun args))))
+    (if (and (stringp rxp) (string= rxp "if\\>[^_]"))
+        (or (apply oldfun '("static\\>[^_]"))
+            (apply oldfun '("version\\>[^_]"))
+            (apply oldfun '("debug\\>[^_]"))
+            (apply oldfun args))
+      (apply oldfun args))))
 
 (defadvice c-add-stmt-syntax (around my-c-add-stmt-syntax-wrapper activate)
   (if (not (string= major-mode "d-mode"))



reply via email to

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