aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Steingold2017-08-21 09:48:14 -0400
committerSam Steingold2017-08-21 09:48:14 -0400
commitde3a3ed034467ff2529c8262600e8a249969fd14 (patch)
tree1713de5812a299462c4398f8e52dc16fd4a9bc9d
parent807b67faa403a2c2f65666c28f74ea1989451ad1 (diff)
downloademacs-de3a3ed034467ff2529c8262600e8a249969fd14.tar.gz
emacs-de3a3ed034467ff2529c8262600e8a249969fd14.zip
allow nil init in flymake-allowed-file-name-masks to disable flymake
(flymake-allowed-file-name-masks): Update doc and :type. (flymake-get-file-name-mode-and-masks): Handle nil init.
-rw-r--r--lisp/progmodes/flymake-proc.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el
index 30555559e60..af16e522c3a 100644
--- a/lisp/progmodes/flymake-proc.el
+++ b/lisp/progmodes/flymake-proc.el
@@ -85,16 +85,18 @@
85 ) 85 )
86 "Files syntax checking is allowed for. 86 "Files syntax checking is allowed for.
87This is an alist with elements of the form: 87This is an alist with elements of the form:
88 REGEXP INIT [CLEANUP [NAME]] 88 REGEXP [INIT [CLEANUP [NAME]]]
89REGEXP is a regular expression that matches a file name. 89REGEXP is a regular expression that matches a file name.
90INIT is the init function to use. 90INIT is the init function to use, missing means disable `flymake-mode'.
91CLEANUP is the cleanup function to use, default `flymake-simple-cleanup'. 91CLEANUP is the cleanup function to use, default `flymake-simple-cleanup'.
92NAME is the file name function to use, default `flymake-get-real-file-name'." 92NAME is the file name function to use, default `flymake-get-real-file-name'."
93 :group 'flymake 93 :group 'flymake
94 :type '(alist :key-type (regexp :tag "File regexp") 94 :type '(alist :key-type (regexp :tag "File regexp")
95 :value-type 95 :value-type
96 (list :tag "Handler functions" 96 (list :tag "Handler functions"
97 (function :tag "Init function") 97 (choice :tag "Init function"
98 (const :tag "disable" nil)
99 function)
98 (choice :tag "Cleanup function" 100 (choice :tag "Cleanup function"
99 (const :tag "flymake-simple-cleanup" nil) 101 (const :tag "flymake-simple-cleanup" nil)
100 function) 102 function)
@@ -114,9 +116,10 @@ NAME is the file name function to use, default `flymake-get-real-file-name'."
114 (let ((fnm flymake-allowed-file-name-masks) 116 (let ((fnm flymake-allowed-file-name-masks)
115 (mode-and-masks nil)) 117 (mode-and-masks nil))
116 (while (and (not mode-and-masks) fnm) 118 (while (and (not mode-and-masks) fnm)
117 (if (string-match (car (car fnm)) file-name) 119 (let ((item (pop fnm)))
118 (setq mode-and-masks (cdr (car fnm)))) 120 (when (string-match (car item) file-name)
119 (setq fnm (cdr fnm))) 121 (setq mode-and-masks item)))) ; (cdr item) may be nil
122 (setq mode-and-masks (cdr mode-and-masks))
120 (flymake-log 3 "file %s, init=%s" file-name (car mode-and-masks)) 123 (flymake-log 3 "file %s, init=%s" file-name (car mode-and-masks))
121 mode-and-masks)) 124 mode-and-masks))
122 125