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

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

[elpa] externals/phps-mode c9f6fdb 82/96: Mode-line status now signals p


From: Christian Johansson
Subject: [elpa] externals/phps-mode c9f6fdb 82/96: Mode-line status now signals parser errors
Date: Fri, 29 Oct 2021 11:15:01 -0400 (EDT)

branch: externals/phps-mode
commit c9f6fdb818980b7700256e65d6f34624ca59bbf5
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>

    Mode-line status now signals parser errors
---
 phps-mode-lex-analyzer.el | 55 ++++++++++++++++++++++-------------------------
 1 file changed, 26 insertions(+), 29 deletions(-)

diff --git a/phps-mode-lex-analyzer.el b/phps-mode-lex-analyzer.el
index 4de830c..8a688d7 100644
--- a/phps-mode-lex-analyzer.el
+++ b/phps-mode-lex-analyzer.el
@@ -454,18 +454,28 @@
              (setq phps-mode-lex-analyzer--parse-trail parse-trail)
              (setq phps-mode-lex-analyzer--parse-error parse-error)
 
-             ;; Display parser error (if any)
+             ;; Signal parser error (if any)
              (when phps-mode-lex-analyzer--parse-error
-               (setq phps-mode-serial--status 'error)
+
+               ;; Paint error
                (phps-mode-lex-analyzer--set-region-syntax-color
                 (nth 4 phps-mode-lex-analyzer--parse-error)
                 (point-max)
                 (list 'font-lock-face 'font-lock-warning-face))
+
+               ;; Display error
                (display-warning
                 'phps-mode
                 (nth 1 phps-mode-lex-analyzer--parse-error)
                 :warning
-                "*PHPs Parser Errors*"))))))
+                "*PHPs Parser Errors*")
+
+               ;; Signal that causes updated mode-line status
+               (signal
+                'phps-parser-error
+                (list
+                 (nth 1 phps-mode-lex-analyzer--parse-error)
+                 (nth 4 phps-mode-lex-analyzer--parse-error))))))))
 
      (lambda(result)
        (when (get-buffer buffer-name)
@@ -474,7 +484,6 @@
                  (error-message (nth 1 result))
                  (error-start (nth 2 result))
                  (error-end (nth 3 result)))
-
              (phps-mode-lex-analyzer--reset-local-variables)
 
              (when error-message
@@ -497,17 +506,6 @@
                   :warning
                   "*PHPs Lexer Errors*"))
 
-                ((equal error-type 'phps-parser-error)
-                 (phps-mode-lex-analyzer--set-region-syntax-color
-                  (nth 5 result)
-                  (point-max)
-                  (list 'font-lock-face 'font-lock-warning-face))
-                 (display-warning
-                  'phps-mode
-                  (nth 2 result)
-                  :warning
-                  "*PHPs Parser Errors*"))
-
                 (t
                  (display-warning
                   error-type
@@ -622,18 +620,28 @@
              (setq phps-mode-lex-analyzer--parse-trail parse-trail)
              (setq phps-mode-lex-analyzer--parse-error parse-error)
 
-             ;; Display parser error (if any)
+             ;; Signal parser error (if any)
              (when phps-mode-lex-analyzer--parse-error
-               (setq phps-mode-serial--status 'error)
+
+               ;; Paint error
                (phps-mode-lex-analyzer--set-region-syntax-color
                 (nth 4 phps-mode-lex-analyzer--parse-error)
                 (point-max)
                 (list 'font-lock-face 'font-lock-warning-face))
+
+               ;; Display error
                (display-warning
                 'phps-mode
                 (nth 1 phps-mode-lex-analyzer--parse-error)
                 :warning
-                "*PHPs Parser Errors*"))))))
+                "*PHPs Parser Errors*")
+
+               ;; Signal that causes updated mode-line status
+               (signal
+                'phps-parser-error
+                (list
+                 (nth 1 phps-mode-lex-analyzer--parse-error)
+                 (nth 4 phps-mode-lex-analyzer--parse-error))))))))
 
      (lambda(result)
        (when (get-buffer buffer-name)
@@ -665,17 +673,6 @@
                   :warning
                   "*PHPs Lexer Errors*"))
 
-                ((equal error-type 'phps-parser-error)
-                 (phps-mode-lex-analyzer--set-region-syntax-color
-                  (nth 5 result)
-                  (point-max)
-                  (list 'font-lock-face 'font-lock-warning-face))
-                 (display-warning
-                  'phps-mode
-                  (nth 2 result)
-                  :warning
-                  "*PHPs Parser Errors*"))
-
                 (t
                  (display-warning
                   error-type



reply via email to

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