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

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

[elpa] 287/352: Make "syntax" and "case-fold" effective with action-prog


From: Stefan Monnier
Subject: [elpa] 287/352: Make "syntax" and "case-fold" effective with action-program and -parser
Date: Mon, 07 Jul 2014 14:05:02 +0000

monnier pushed a commit to branch master
in repository elpa.

commit bbe7c2e205cc3e5ae2ec8fa2d318b25173a40e65
Author: Teemu Likonen <address@hidden>
Date:   Sun Jul 3 17:33:22 2011 +0300

    Make "syntax" and "case-fold" effective with action-program and -parser
---
 wcheck-mode.el |   55 +++++++++++++++++++++++++++++--------------------------
 1 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/wcheck-mode.el b/wcheck-mode.el
index 56cf63f..fb8e8bd 100644
--- a/wcheck-mode.el
+++ b/wcheck-mode.el
@@ -1690,35 +1690,38 @@ function `wcheck-marked-text-at' function."
       (language (aref marked-text 4))
       ((program action-program)
        (args action-args)
-       (parser action-parser))
-
-    (cond ((not (wcheck-action-program-configured-p language))
-           (signal 'wcheck-action-program-error language))
-
-          ((and (stringp program)
-                (not parser))
-           (signal 'wcheck-parser-function-not-configured-error language))
-
-          ((stringp program)
-           (with-temp-buffer
-             (insert (aref marked-text 0))
-             (apply #'call-process-region (point-min) (point-max)
-                    program t t nil args)
-             (goto-char (point-min))
+       (parser action-parser)
+       (case-fold-search case-fold)
+       syntax)
+
+    (with-syntax-table (eval syntax)
+      (cond ((not (wcheck-action-program-configured-p language))
+             (signal 'wcheck-action-program-error language))
+
+            ((and (stringp program)
+                  (not parser))
+             (signal 'wcheck-parser-function-not-configured-error language))
+
+            ((stringp program)
+             (with-temp-buffer
+               (insert (aref marked-text 0))
+               (apply #'call-process-region (point-min) (point-max)
+                      program t t nil args)
+               (goto-char (point-min))
+               (wcheck-clean-actions
+                (save-match-data
+                  (condition-case nil (funcall parser marked-text)
+                    (error (signal 'wcheck-funcall-error
+                                   (concat "Action parser function "
+                                           "signaled an error"))))))))
+
+            ((functionp program)
              (wcheck-clean-actions
               (save-match-data
-                (condition-case nil (funcall parser marked-text)
+                (condition-case nil (funcall program marked-text)
                   (error (signal 'wcheck-funcall-error
-                                 (concat "Action parser function "
-                                         "signaled an error"))))))))
-
-          ((functionp program)
-           (wcheck-clean-actions
-            (save-match-data
-              (condition-case nil (funcall program marked-text)
-                (error (signal 'wcheck-funcall-error
-                               (concat "Action function signaled "
-                                       "an error"))))))))))
+                                 (concat "Action function signaled "
+                                         "an error")))))))))))
 
 
 (defun wcheck-clean-actions (actions)



reply via email to

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