3939; ; https://github.com/illusori/emacs-flymake.
4040(when (or (boundp 'flymake-run-in-place )
4141 (fboundp 'flymake-phpcs-load ))
42- (defcustom drupal/flymake-phpcs-run-in-place t
42+ (defcustom drupal/flymake-phpcs-run-in-place 'auto
4343 " If nil, flymake will run on copies in `temporary-file-directory' rather
4444than the same directory as the original file.
4545
4646Drupal Coder Sniffer has some sniffs that will only work if run in place.
4747
48- Defaults to `t' . Set to `default' to use whatever
48+ Defaults to t . Set to `default' to use whatever
4949`flymake-run-in-place' is set to.
5050
5151When editing a remote file via Tramp, this flag also has the side-effect of
@@ -55,6 +55,7 @@ file (and thus on the remote machine), or in the same place as
5555 :type `(choice
5656 (const :tag " Yes" t )
5757 (const :tag " No" nil )
58+ (const :tag " Auto" auto)
5859 (const :tag " Default" default ))
5960 :link '(url-link :tag " Drupal Coder Sniffer" " https://drupal.org/project/coder" )
6061 :group 'drupal ))
@@ -77,7 +78,10 @@ file (and thus on the remote machine), or in the same place as
7778 (if drupal/flymake-phpcs-run-in-place
7879 (set (make-local-variable 'flymake-phpcs-location ) 'inplace )
7980 (set (make-local-variable 'flymake-phpcs-location ) 'tempdir )))
80- (set (make-local-variable 'flymake-run-in-place ) drupal/flymake-phpcs-run-in-place))
81+ (if (and (eq drupal/flymake-phpcs-run-in-place 'auto )
82+ (string-match " \\ .info\\ '" (or buffer-file-name (buffer-name ))))
83+ (set (make-local-variable 'flymake-run-in-place ) t )
84+ (set (make-local-variable 'flymake-run-in-place ) nil )))
8185
8286 ; ; Flymake-phpcs will also highlight trailing whitespace as an
8387 ; ; error so no need to highlight it twice.
@@ -156,7 +160,8 @@ copy."
156160 (match-string-no-properties 0 )
157161 (file-name-extension file-name t )))
158162 (base-name (file-name-nondirectory (replace-regexp-in-string (concat (regexp-quote extension) " \\ '" ) " " file-name)))
159- (temp-name (file-truename (make-temp-file (concat base-name " ._" prefix) nil extension))))
163+ (temp-dir (file-truename (make-temp-file base-name t nil )))
164+ (temp-name (file-truename (concat temp-dir " /" file-name))))
160165 (flymake-log 3 " create-temp-intemp: file=%s temp=%s" file-name temp-name)
161166 temp-name))
162167
0 commit comments