File tree 1 file changed +10
-7
lines changed
1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 109
109
(set-window-configuration ledger-check--original-window-configuration)
110
110
(kill-buffer (get-buffer ledger-check-buffer-name)))
111
111
112
- (defun ledger-check-buffer ()
112
+ (defun ledger-check-buffer (&optional interactive )
113
113
" Check the current buffer for errors.
114
114
115
115
Runs ledger with --explicit and --strict report errors and assist
116
116
with fixing them.
117
117
118
118
The output buffer will be in `ledger-check-mode' , which defines
119
- commands for navigating the buffer to the errors found, etc."
120
- (interactive
121
- (progn
122
- (when (and (buffer-modified-p )
123
- (y-or-n-p " Buffer modified, save it? " ))
124
- (save-buffer ))))
119
+ commands for navigating the buffer to the errors found, etc.
120
+
121
+ When INTERACTIVE is non-nil (i.e., when called interactively),
122
+ prompt to save if the current buffer is modified."
123
+ (interactive " p" )
124
+ (when (and interactive
125
+ (buffer-modified-p )
126
+ (y-or-n-p " Buffer modified, save it? " ))
127
+ (save-buffer ))
125
128
(let ((_buf (find-file-noselect (ledger-master-file)))
126
129
(cbuf (get-buffer ledger-check-buffer-name))
127
130
(wcfg (current-window-configuration )))
You can’t perform that action at this time.
0 commit comments