[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/d-mode 8076559 081/346: Replace obsolete defadvice by the
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/d-mode 8076559 081/346: Replace obsolete defadvice by the new advice-add. |
Date: |
Sun, 29 Aug 2021 11:00:07 -0400 (EDT) |
branch: elpa/d-mode
commit 807655921d38fbd32701a0ede4a06affba7de62b
Author: Dmitri Makarov <dmakarov@alumni.stanford.edu>
Commit: Dmitri Makarov <dmakarov@alumni.stanford.edu>
Replace obsolete defadvice by the new advice-add.
Also make recognition of 'static if' more precise.
---
d-mode.el | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index f40949d..551abcd 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -460,24 +460,28 @@ 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)
+;;; Workaround for special case of 'else static if' not being handled properly
+(defun d-special-case-looking-at (orig-fun &rest args)
(let ((rxp (car args)))
(if (and (stringp rxp) (string= rxp "if\\>[^_]"))
- (or (apply oldfun '("static\\>[^_]"))
- (apply oldfun '("version\\>[^_]"))
- (apply oldfun '("debug\\>[^_]"))
- (apply oldfun args))
- (apply oldfun args))))
+ (or (apply orig-fun '("static\\>\\s-+if\\>[^_]"))
+ (apply orig-fun '("version\\>[^_]"))
+ (apply orig-fun '("debug\\>[^_]"))
+ (apply orig-fun args))
+ (apply orig-fun args))))
-(defadvice c-add-stmt-syntax (around my-c-add-stmt-syntax-wrapper activate)
+(defun d-around--c-add-stmt-syntax (orig-fun &rest args)
(if (not (string= major-mode "d-mode"))
- ad-do-it
+ (apply orig-fun args)
(progn
- (add-function :around (symbol-function 'looking-at)
#'d-special-case-looking-at)
+ (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)))))
+ (apply orig-fun args)
+ (remove-function (symbol-function 'looking-at)
+ #'d-special-case-looking-at)))))
+
+(advice-add 'c-add-stmt-syntax :around #'d-around--c-add-stmt-syntax)
;;----------------------------------------------------------------------------
;;;###autoload (add-to-list 'auto-mode-alist '("\\.d[i]?\\'" . d-mode))
- [nongnu] elpa/d-mode 445c696 210/346: Implement a more complete description for D type syntax, (continued)
- [nongnu] elpa/d-mode 445c696 210/346: Implement a more complete description for D type syntax, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode ed0de34 222/346: Refactor "this" (constructor) handling, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode aaa704a 216/346: Fix coverage issues in d-forward-type, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 572d707 221/346: Improve comprehension of constness and storage classes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 64afe5f 206/346: .travis.yml: Test against more Emacs versions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 02733b0 223/346: Remove some redundant progns, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode c9febb3 299/346: d-mode-test: Always ignore .res files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 2d4bc7d 318/346: Update comments, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 46a57f4 310/346: Fontify the special words inside version/debug/extern/pragma/__traits/scope, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 805eeba 078/346: Add links to build and coverage status to README., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 8076559 081/346: Replace obsolete defadvice by the new advice-add.,
ELPA Syncer <=
- [nongnu] elpa/d-mode ee38763 083/346: Use the new advising mechanism on new emacs versions., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 5c06e99 087/346: add d-exceptions compilation error regexp, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 5501b77 096/346: Prepare for a formal release., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 89339fa 100/346: Fix typo in comment, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 14e2e3b 105/346: Fix exponential fontification time of backslashes in WYSIWYG-literals, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 438cf53 109/346: fixed missing keyword "idouble", ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode f6bf2b7 141/346: tests: Split test into individual ert tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 23d7a1a 148/346: tests: Fix testing compilation-mode buffers with Emacs 26, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode a731ae6 157/346: Fix imenu for functions with parameter types containing parens, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode ab1057f 159/346: Fix imenu for functions with tail qualifiers on their own line, ELPA Syncer, 2021/08/29