branch: elpa/d-mode
commit 075c3e7b8da8bfffe1bbe00cf705494755959fd1
Author: Dmitri Makarov <[email protected]>
Commit: Dmitri Makarov <[email protected]>
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"))