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-"
|
:prefix "esv-"
|
||||||
:group 'applications)
|
: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
|
(defcustom esv-columns 72
|
||||||
"Length of each line output by `esv'."
|
"Length of each line output by `esv'."
|
||||||
:type 'natnum
|
:type 'natnum
|
||||||
|
@ -78,8 +82,10 @@ esv can be acquired at <https://sr.ht/~jeremy/esv>."
|
||||||
(list (format "-l%d" esv-columns)))))
|
(list (format "-l%d" esv-columns)))))
|
||||||
(catch 'buffer-exists
|
(catch 'buffer-exists
|
||||||
(when (get-buffer buffer)
|
(when (get-buffer buffer)
|
||||||
(message "Buffer `%s' already exists" buffer)
|
(unless esv-close-existing-buffers
|
||||||
(throw 'buffer-exists nil))
|
(message "Buffer `%s' already exists" buffer)
|
||||||
|
(throw 'buffer-exists nil))
|
||||||
|
(kill-buffer buffer))
|
||||||
(apply #'call-process esv-program nil buffer t
|
(apply #'call-process esv-program nil buffer t
|
||||||
(append arg-list (list book) (list verses)))
|
(append arg-list (list book) (list verses)))
|
||||||
(display-buffer buffer)
|
(display-buffer buffer)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue