[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/d-mode b413942 198/346: Tighten K&R region detection
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/d-mode b413942 198/346: Tighten K&R region detection |
Date: |
Sun, 29 Aug 2021 11:00:30 -0400 (EDT) |
branch: elpa/d-mode
commit b4139423f89c76f728262defc4cd1cee145a1d1d
Author: Vladimir Panteleev <git@thecybershadow.net>
Commit: Vladimir Panteleev <git@thecybershadow.net>
Tighten K&R region detection
Don't return a positive when inside the runtime arg list of templated
function.
---
d-mode.el | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index 2afd78d..8d5370c 100644
--- a/d-mode.el
+++ b/d-mode.el
@@ -983,10 +983,12 @@ Key bindings:
(save-excursion
;; If we're in a macro, our search range is restricted to it. Narrow to
;; the searchable range.
- (let* (before-lparen
+ (let* ((start (point))
+ before-lparen
after-rparen
(pp-count-out 20) ; Max number of paren/brace constructs before
; we give up.
+ knr-start
c-last-identifier-range)
(catch 'knr
@@ -1027,13 +1029,21 @@ Key bindings:
(eq (c-backward-token-2) 0)
(eq (d--on-func-identifier) (point)))))
+ ;; Check that we're outside of the template arg list
(D-specific).
+ (progn
+ (setq knr-start
+ (progn (goto-char after-rparen)
+ (c-forward-syntactic-ws)
+ (when (eq (char-after) ?\()
+ (c-go-list-forward)
+ (c-forward-syntactic-ws))
+ (point)))
+ (<= knr-start start))
+
;; (... original c-in-knr-argdecl logic omitted here ...)
t)
;; ...Yes. We've identified the function's argument list.
- (throw 'knr
- (progn (goto-char after-rparen)
- (c-forward-syntactic-ws)
- (point)))
+ (throw 'knr knr-start)
;; ...No. The current parens aren't the function's arg list.
(goto-char before-lparen))
- [nongnu] elpa/d-mode a731ae6 157/346: Fix imenu for functions with parameter types containing parens, (continued)
- [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
- [nongnu] elpa/d-mode f61e72c 173/346: Drop support for Emacs < 24.3, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 09745ba 175/346: Merge pull request #87 from CyberShadow/emacs-24-plus, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode cfd1d08 180/346: Use rx-to-string instead of rx-form to support Emacs master (#97), ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode af6dbfa 183/346: Generalize StorageClass/VisibilityAttribute parsing in imenu, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 2964263 184/346: Fix imenu with alias templates, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 71e8bda 196/346: Improve constructor handling and fix constructor contract indentation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 28810ef 194/346: Add test for function contracts, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 1bce6c4 191/346: Somewhat improve fontification of module names, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode b413942 198/346: Tighten K&R region detection,
ELPA Syncer <=
- [nongnu] elpa/d-mode 07cb4d0 199/346: Add d-lineup-arglists, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode d3ceb14 200/346: Make d--imenu-rx-def-start a compile-time constant, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 0b6a089 217/346: .travis.yml: Try using a emacs-travis.mk which does not use FTP, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 653661e 220/346: Fix parsing qualified types, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode f07f365 201/346: Fix fontification of constructor parameters, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode fd8e70a 209/346: Partially implement D type modifiers (const/immutable/etc.), ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 8647147 208/346: Fix tests' minimum Emacs versions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 9ad04a1 213/346: Fix parsing/fontification of some expressions with periods, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 5146f2d 215/346: Clear some cc-mode constants, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 3f669a1 231/346: Replace regex-based imenu implementation with cc-mode-based, ELPA Syncer, 2021/08/29