[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/d-mode 385cda4 177/346: Fix extant checkdoc, byte-compilat
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/d-mode 385cda4 177/346: Fix extant checkdoc, byte-compilation and fontification warnings |
Date: |
Sun, 29 Aug 2021 11:00:25 -0400 (EDT) |
branch: elpa/d-mode
commit 385cda4afad79000b4cb7704861faf34009b0fc2
Author: Vladimir Panteleev <git@thecybershadow.net>
Commit: Vladimir Panteleev <git@thecybershadow.net>
Fix extant checkdoc, byte-compilation and fontification warnings
---
d-mode.el | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/d-mode.el b/d-mode.el
index 6b89c49..5bf94db 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: 201804041719
+;; Version: 201810111924
;; Keywords: D programming language emacs cc-mode
;; Package-Requires: ((emacs "24.3"))
@@ -118,7 +118,7 @@
;; D has pointers
(c-lang-defconst c-type-decl-prefix-key
d (concat "\\("
- "[*\(]"
+ "[*(]"
"\\|"
(c-lang-const c-type-decl-prefix-key)
"\\)"
@@ -236,7 +236,7 @@ The expression is added to `compilation-error-regexp-alist'
and
(add-to-list 'compilation-error-regexp-alist-alist
'(d-exceptions
- "^[a-zA-z0-9\.]*?@\\(.*?\\)(\\([0-9]+\\)):"
+ "^[a-zA-z0-9.]*?@\\(.*?\\)(\\([0-9]+\\)):"
1 2 nil 2))
(add-to-list 'compilation-error-regexp-alist 'd-exceptions)
@@ -382,7 +382,9 @@ The expression is added to `compilation-error-regexp-alist'
and
(defcustom d-font-lock-extra-types nil
"*List of extra types (aside from the type keywords) to recognize in D mode.
- Each list item should be a regexp matching a single identifier."
+
+Each list item should be a regexp matching a single identifier."
+ :type '(repeat regexp)
:group 'd-mode)
(defconst d-font-lock-keywords-1 (c-lang-const c-matchers-1 d)
@@ -398,10 +400,13 @@ The expression is added to
`compilation-error-regexp-alist' and
"Default expressions to highlight in D mode.")
(defun d-font-lock-keywords-2 ()
+ "Function to get fast normal highlighting for D mode."
(c-compose-keywords-list d-font-lock-keywords-2))
(defun d-font-lock-keywords-3 ()
+ "Function to get accurate normal highlighting for D mode."
(c-compose-keywords-list d-font-lock-keywords-3))
(defun d-font-lock-keywords ()
+ "Function to get default expressions to highlight in D mode."
(c-compose-keywords-list d-font-lock-keywords))
(defvar d-mode-syntax-table nil
@@ -540,6 +545,7 @@ The expression is added to `compilation-error-regexp-alist'
and
))
(defun d-imenu-method-index-function ()
+ "Find D function declarations for imenu."
(and
(let ((pt))
(setq pt (re-search-backward d-imenu-method-name-pattern nil t))
@@ -689,6 +695,8 @@ The expression is added to `compilation-error-regexp-alist'
and
;;----------------------------------------------------------------------------
;;; Workaround for special case of 'else static if' not being handled properly
(defun d-special-case-looking-at (orig-fun &rest args)
+ ;; checkdoc-params: (orig-fun args)
+ "Advice function for fixing cc-mode indentation in certain D constructs."
(let ((rxp (car args)))
(if (and (stringp rxp) (string= rxp "if\\>[^_]"))
(or (apply orig-fun '("static\\>\\s-+if\\>[^_]"))
@@ -698,6 +706,8 @@ The expression is added to `compilation-error-regexp-alist'
and
(apply orig-fun args))))
(defun d-around--c-add-stmt-syntax (orig-fun &rest args)
+ ;; checkdoc-params: (orig-fun args)
+ "Advice function for fixing cc-mode indentation in certain D constructs."
(if (not (string= major-mode "d-mode"))
(apply orig-fun args)
(progn
@@ -792,6 +802,7 @@ Key bindings:
(defconst d-var-decl-pattern "^[ \t]*\\(?:[_a-zA-Z0-9]+[
\t\n]+\\)*\\([_a-zA-Z0-9.!]+\\)\\(?:\\[[^]]*\\]\\|\\*\\)?[
\t\n]+\\([_a-zA-Z0-9]+\\)[ \t\n]*[;=]")
(defconst d-fun-decl-pattern "^[ \t]*\\(?:[_a-zA-Z0-9]+[
\t\n]+\\)*\\([_a-zA-Z0-9.!]+\\)\\(?:\\[[^]]*\\]\\|\\*\\)?[
\t\n]+\\([_a-zA-Z0-9]+\\)[ \t\n]*(")
(defmacro d-try-match-decl (regex)
+ "Helper macro." ;; checkdoc-params: regex
`(let ((pt))
(setq pt (re-search-forward ,regex limit t))
(while (let ((type (match-string 1)))
@@ -801,10 +812,13 @@ Key bindings:
(setq pt (re-search-forward ,regex limit t)))
pt))
(defun d-match-var-decl (limit)
+ "Helper function." ;; checkdoc-params: limit
(d-try-match-decl d-var-decl-pattern))
(defun d-match-fun-decl (limit)
+ "Helper function." ;; checkdoc-params: limit
(d-try-match-decl d-fun-decl-pattern))
(defun d-match-auto (limit)
+ "Helper function." ;; checkdoc-params: limit
(c-syntactic-re-search-forward "\\<\\(auto\\|const\\|immutable\\)\\>" limit
t))
(font-lock-add-keywords
@@ -832,9 +846,10 @@ Key bindings:
(add-to-list 'c-offsets-alist '(statement-cont . d-lineup-cascaded-calls)))
(defun d-lineup-cascaded-calls (langelem)
- "This is a modified `c-lineup-cascaded-calls' function for the
-D programming language which accounts for optional parenthesis
-and compile-time parameters in function calls."
+ "D version of `c-lineup-cascaded-calls'.
+
+This version accounts for optional parenthesis and compile-time
+parameters in function calls." ;; checkdoc-params: langelem
(if (and (eq (c-langelem-sym langelem) 'arglist-cont-nonempty)
(not (eq (c-langelem-2nd-pos c-syntactic-element)
- [nongnu] elpa/d-mode 1ec5880 188/346: Fix another bug related to `-delimited strings, (continued)
- [nongnu] elpa/d-mode 1ec5880 188/346: Fix another bug related to `-delimited strings, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 781a94d 068/346: Add doc-comment style that recognizes doxygen and D doc-comments., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 2ef7c5c 077/346: Add d-mode testing infrastructure., ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode e35790c 137/346: tests: Disable #39 test for Emacs <24.4 too, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 4f67ef2 143/346: Add self as maintainer, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 2de6f73 145/346: Fix indentation on Emacs 26, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 1407db2 163/346: Add enums to imenu, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode ace2970 164/346: Fix imenu for functions with parameters defaulting to function calls, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 8d0ed04 172/346: README: Use syntax highlighting in code blocks, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 026fceb 176/346: Update auto-mode-alist when run from init file (fixes #88) (#89), ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 385cda4 177/346: Fix extant checkdoc, byte-compilation and fontification warnings,
ELPA Syncer <=
- [nongnu] elpa/d-mode 86a86dd 110/346: Merge pull request #68 from sdilts/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode facf01a 187/346: Fix imenu with inout types, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 951ca5c 212/346: Remove code incompatible with older Emacs versions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 4dce323 229/346: README.md: Add note about compatibility, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode b1d752a 233/346: Fix buffer modification when invoking imenu, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 441761c 237/346: Delete old keyword lists for imenu, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode f7ac740 235/346: Fix imenu classification of some variables, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 29940d7 226/346: Makefile: Add some utility commands, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode d14a001 239/346: Fix imenu false positive for static imports, ELPA Syncer, 2021/08/29
- [nongnu] elpa/d-mode 8606775 240/346: Fix imenu jump position for new-style aliases, ELPA Syncer, 2021/08/29