[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/d-mode ed0de34 222/346: Refactor "this" (constructor) hand
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/d-mode ed0de34 222/346: Refactor "this" (constructor) handling |
Date: |
Sun, 29 Aug 2021 11:00:35 -0400 (EDT) |
branch: elpa/d-mode
commit ed0de346481292001b828618887d7ae19491a5b4
Author: Vladimir Panteleev <git@thecybershadow.net>
Commit: Vladimir Panteleev <git@thecybershadow.net>
Refactor "this" (constructor) handling
Fold behavior from the advice into our c-forward-type implementation.
---
d-mode.el | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index 859f737..e189998 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -7,7 +7,7 @@
;; Maintainer: Russel Winder <russel@winder.org.uk>
;; Vladimir Panteleev <vladimir@thecybershadow.net>
;; Created: March 2007
-;; Version: 201909091501
+;; Version: 201909091517
;; Keywords: D programming language emacs cc-mode
;; Package-Requires: ((emacs "25.1"))
@@ -874,13 +874,6 @@ Each list item should be a regexp matching a single
identifier."
(forward-char 4)
t))
-(defun d-special-case-c-forward-type (orig-fun &rest args)
- ;; checkdoc-params: (orig-fun args)
- "Advice function for fixing cc-mode handling of D constructors."
- (if (not (looking-at (c-make-keywords-re t '("this"))))
- (apply orig-fun args)
- nil))
-
(defun d-around--c-forward-decl-or-cast-1 (orig-fun &rest args)
;; checkdoc-params: (orig-fun args)
"Advice function for fixing cc-mode handling of D constructors."
@@ -902,15 +895,10 @@ Each list item should be a regexp matching a single
identifier."
(t
(add-function :around (symbol-function 'c-forward-name)
#'d-special-case-c-forward-name)
- (add-function :around (symbol-function 'c-forward-type)
- #'d-special-case-c-forward-type)
(unwind-protect
(apply orig-fun args)
(remove-function (symbol-function 'c-forward-name)
- #'d-special-case-c-forward-name)
- (remove-function (symbol-function 'c-forward-type)
- #'d-special-case-c-forward-type)
- ))))
+ #'d-special-case-c-forward-name)))))
(advice-add 'c-forward-decl-or-cast-1 :around
#'d-around--c-forward-decl-or-cast-1)
@@ -1212,6 +1200,11 @@ Key bindings:
(setq saw-storage-class t))
(cond
+ ;; D: "this" is not a type, even though it appears at the
+ ;; beginning of a "function" (constructor) declaration.
+ ((looking-at (c-make-keywords-re t '("this")))
+ nil)
+
;; D: Storage class substituting the type (e.g. auto)
((and
saw-storage-class
- [nongnu] elpa/d-mode 5fdba4e 202/346: Add pragma keyword, (continued)
- [nongnu] elpa/d-mode 5fdba4e 202/346: Add pragma keyword, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 51b1af1 203/346: Fix K&R region detection and body-less function declarations, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode b5fb492 204/346: Fix fontification of manifest (enum) constants, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode e52434e 218/346: d-mode-test.el: Save actual result to file in case of mismatch, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 609816b 219/346: tests: Move d-forward-type tests to new test file, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 4d9f9ce 211/346: Drop support for Emacs 24, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode f2b4aec 205/346: Fix fontification of "a in b" expressions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode f69e94e 207/346: Change test suite enumeration and activation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode b0a59de 214/346: Fix mis-parsing of concatenating two variables, ELPA Syncer, 2021/08/29
- [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 <=
- [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, 2021/08/29
- [nongnu] elpa/d-mode ee38763 083/346: Use the new advising mechanism on new emacs versions., ELPA Syncer, 2021/08/29