esv.el: add esv-close-existing-buffers custom
This commit is contained in:
parent
3638d0f22a
commit
789b0c73b2
1 changed files with 8 additions and 2 deletions
10
esv.el
10
esv.el
|
@ -39,6 +39,10 @@
|
|||
:prefix "esv-"
|
||||
:group 'applications)
|
||||
|
||||
(defcustom esv-close-existing-buffers nil
|
||||
"Whether to close an existing `esv' buffer if one already exists."
|
||||
:type 'boolean
|
||||
:group 'esv)
|
||||
(defcustom esv-columns 72
|
||||
"Length of each line output by `esv'."
|
||||
:type 'natnum
|
||||
|
@ -78,8 +82,10 @@ esv can be acquired at <https://sr.ht/~jeremy/esv>."
|
|||
(list (format "-l%d" esv-columns)))))
|
||||
(catch 'buffer-exists
|
||||
(when (get-buffer buffer)
|
||||
(message "Buffer `%s' already exists" buffer)
|
||||
(throw 'buffer-exists nil))
|
||||
(unless esv-close-existing-buffers
|
||||
(message "Buffer `%s' already exists" buffer)
|
||||
(throw 'buffer-exists nil))
|
||||
(kill-buffer buffer))
|
||||
(apply #'call-process esv-program nil buffer t
|
||||
(append arg-list (list book) (list verses)))
|
||||
(display-buffer buffer)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue