File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 128
128
:type '(alist :key-type function
129
129
:value-type symbol)
130
130
:group 'php-format )
131
+
132
+ (defcustom php-format-disable-async-format-buffer-has-modified t
133
+ " When non-NIL, disable asynchronous formatting if the buffer has modified (not saved)."
134
+ :tag " PHP Format Disable Async Format Buffer Has Modified"
135
+ :type 'boolean
136
+ :group 'php-format )
131
137
132
138
; ; Internal functions
133
139
(defsubst php-format--register-timer (sec command-args )
182
188
" Asynchronously execute PHP format with COMMAND-ARGS in DIR."
183
189
(setq php-format--idle-timer nil )
184
190
(let ((default-directory dir))
185
- (apply #'call-process-shell-command (car command-args) nil nil nil
186
- (append (cdr command-args) (list " &" )))))
191
+ (when (not (and php-format-disable-async-format-buffer-has-modified
192
+ (buffer-modified-p )))
193
+ (apply #'call-process-shell-command (car command-args) nil nil nil
194
+ (append (cdr command-args) (list " &" ))))))
187
195
188
196
; ; Public functions and minor mode
189
197
You can’t perform that action at this time.
0 commit comments