emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/csharp-mode 1939c4e 073/459: Extract compilation-mode r


From: ELPA Syncer
Subject: [elpa] externals/csharp-mode 1939c4e 073/459: Extract compilation-mode regexps into constants.
Date: Sun, 22 Aug 2021 13:58:59 -0400 (EDT)

branch: externals/csharp-mode
commit 1939c4ebc414295179d8e8a981b93bc6554f9cd3
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Jostein Kjønigsen <jostein@kjonigsen.net>

    Extract compilation-mode regexps into constants.
    
    This allows us to reuse them in unit-tests.
---
 csharp-mode.el | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/csharp-mode.el b/csharp-mode.el
index 116c8b5..d42aacf 100644
--- a/csharp-mode.el
+++ b/csharp-mode.el
@@ -4145,15 +4145,24 @@ The return value is meaningless, and is ignored by 
cc-mode.
   ;; http://stackoverflow.com/a/18049590/429091
   (expand-file-name (match-string 1) (file-name-directory (match-string 4))))
 
+(defconst csharp-compilation-re-build-error
+  (concat
+   "^[[:blank:]]*"
+   "\\([^(\r\n]+\\)(\\([0-9]+\\)\\(?:,\\([0-9]+\\)\\)?): "
+   "error [[:alnum:]]+: .+ \\[\\([^]\r\n]+\\)\\]$"))
+
+(defconst csharp-compilation-re-build-warning
+  (concat
+   "^[[:blank:]]*"
+   "\\([^(\r\n]+\\)(\\([0-9]+\\)\\(?:,\\([0-9]+\\)\\)?): "
+   "warning [[:alnum:]]+: .+ \\[\\([^]\r\n]+\\)\\]$"))
+
 (eval-after-load 'compile
   (lambda ()
     (dolist
         (regexp
          `((msbuild-error
-            ,(concat
-              "^[[:blank:]]*"
-              "\\([^(\r\n]+\\)(\\([0-9]+\\)\\(?:,\\([0-9]+\\)\\)?): "
-              "error [[:alnum:]]+: .+ \\[\\([^]\r\n]+\\)\\]$")
+            csharp-compilation-re-build-error
             csharp--compilation-error-file-resolve
             2
             3
@@ -4162,10 +4171,7 @@ The return value is meaningless, and is ignored by 
cc-mode.
             (1 compilation-error-face)
             (4 compilation-error-face))
            (msbuild-warning
-            ,(concat
-              "^[[:blank:]]*"
-              "\\([^(\r\n]+\\)(\\([0-9]+\\)\\(?:,\\([0-9]+\\)\\)?): "
-              "warning [[:alnum:]]+: .+ \\[\\([^]\r\n]+\\)\\]$")
+            csharp-compilation-re-build-warning
             csharp--compilation-error-file-resolve
             2
             3



reply via email to

[Prev in Thread] Current Thread [Next in Thread]