[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/d-mode dea775a 066/346: Merge pull request #35 from wrzosk
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/d-mode dea775a 066/346: Merge pull request #35 from wrzoski/master |
Date: |
Sun, 29 Aug 2021 11:00:05 -0400 (EDT) |
branch: elpa/d-mode
commit dea775a4aebe40668e7f323e46754ca98a702440
Merge: 53efec4 27fbe66
Author: Russel Winder <russel@winder.org.uk>
Commit: Russel Winder <russel@winder.org.uk>
Merge pull request #35 from wrzoski/master
Small fixes for else and else static if indentation
---
d-mode.el | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index 31e9326..49edee9 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -240,8 +240,7 @@ operators."
(c-lang-defconst c-block-stmt-2-kwds
;; Statement keywords followed by a paren sexp and then by a substatement.
d '("for" "if" "switch" "while" "catch" "synchronized" "scope"
- "foreach" "foreach_reverse" "with" "unittest"
- "else static if" "else"))
+ "foreach" "foreach_reverse" "with" "unittest"))
(c-lang-defconst c-simple-stmt-kwds
;; Statement keywords followed by an expression or nothing.
@@ -421,6 +420,25 @@ operators."
(nil d-imenu-method-index-function 2)))
;;----------------------------------------------------------------------------
+;;;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))))
+
+(defadvice c-add-stmt-syntax (around my-c-add-stmt-syntax-wrapper activate)
+ (if (not (string= major-mode "d-mode"))
+ ad-do-it
+ (progn
+ (add-function :around (symbol-function 'looking-at)
#'d-special-case-looking-at)
+ (unwind-protect
+ ad-do-it
+ (remove-function (symbol-function 'looking-at)
#'d-special-case-looking-at)))))
+
+;;----------------------------------------------------------------------------
;;;###autoload (add-to-list 'auto-mode-alist '("\\.d[i]?\\'" . d-mode))
;; Custom variables
- [nongnu] elpa/d-mode e5d21be 121/346: README: Update shield images and links to use official project repository, (continued)
- [nongnu] elpa/d-mode e5d21be 121/346: README: Update shield images and links to use official project repository, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 576dd29 123/346: tests: Actually test compilation-mode error list correctness, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 7817dbc 122/346: d-mode-test: Announce mismatched values of inline tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 8ccad32 136/346: Simplify cascaded call indentation setup, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 0b8ed61 152/346: Fix highlighting of const variable declarations, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 593e3f5 155/346: Fix extern(C) functions omitted from imenu, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 93a62b3 158/346: Fix imenu for functions returning types containing parens, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode a4f0b2d 161/346: Fix imenu for functions prefixed with a version/else, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 8771a86 162/346: Convert d-imenu-generic-expression to rx, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 908d55b 170/346: fix #49 - Occasional incorrect fontification of string literals due, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode dea775a 066/346: Merge pull request #35 from wrzoski/master,
ELPA Syncer <=
- [nongnu] elpa/d-mode 01997e0 070/346: Add LDC compiler message pattern to be recognized in compilation mode., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 38ddb5a 076/346: Merge pull request #41 from dmakarov/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 2b0b84f 073/346: Merge pull request #38 from TOGoS/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode c4d8ba8 099/346: Fix omission of final/abstract classes in imenu, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 9729d5f 103/346: Merge pull request #62 from CyberShadow/pull-20160328-152551, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 2d014ef 106/346: Add .cask to .gitignore., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 830a070 095/346: Merge pull request #51 from dmakarov/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode b682601 118/346: Document cl compilation warning, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode efc92aa 120/346: tests: Add test for GitHub pull request #72, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 7c3bcdc 124/346: tests: Split test for #72 to its own file, ELPA Syncer, 2021/08/29