[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/d-mode 27fbe66 065/346: Workaround for special case of 'el
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/d-mode 27fbe66 065/346: Workaround for special case of 'else static if'. |
Date: |
Sun, 29 Aug 2021 11:00:05 -0400 (EDT) |
branch: elpa/d-mode
commit 27fbe66f6de27f8337fe40d6a19f039c589cd1fc
Author: Lukasz Wrzosek <wrzoski@gmail.com>
Commit: Lukasz Wrzosek <wrzoski@gmail.com>
Workaround for special case of 'else static if'.
---
d-mode.el | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/d-mode.el b/d-mode.el
index fc838ed..49edee9 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -420,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 600c70b 108/346: Merge pull request #65 from CyberShadow/pull-20160329-054927, (continued)
- [nongnu] elpa/d-mode 600c70b 108/346: Merge pull request #65 from CyberShadow/pull-20160329-054927, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 3e73378 112/346: Update the badges/shields in the README., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode a99d127 054/346: Fix keywords list construction to include doc-comment keywords., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode f487a71 058/346: Add the function to support alignment of multi-line fluent API using expressions., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 05cd7b9 038/346: Fix classes with inherit lists, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 27e7c62 041/346: Merge pull request #14 from finalpatch/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 011d0cf 043/346: Merge pull request #17 from nordlow/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode a612105 052/346: Add (require 'cl) as per Issue #23., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 72c1bbd 056/346: Update the README., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode f400055 062/346: Some tidying up of comments, no change of code., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 27fbe66 065/346: Workaround for special case of 'else static if'.,
ELPA Syncer <=
- [nongnu] elpa/d-mode 85a0900 067/346: Update the URL to the D main website., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode c108583 072/346: (require 'compile), ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 5c5a2b1 071/346: Merge pull request #37 from dmakarov/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode e2a1289 074/346: Remove duplicate keywords., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 075c3e7 075/346: Fix indentation of 'else verbose' and 'else debug' statements., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode a081749 079/346: Fix clean target., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 4f2994b 082/346: Add more code to the I0039 test., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode f184116 084/346: Borrow from cc-mode regression testsuit harness functions., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 322250a 088/346: Merge pull request #46 from dmakarov/testing, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode ed4ae58 086/346: Add MELPA badge., ELPA Syncer, 2021/08/29