Refactor buffer update logic into separate function
This commit is contained in:
parent
5164517e09
commit
9f50620214
1 changed files with 4 additions and 1 deletions
|
@ -72,12 +72,15 @@
|
||||||
"Open the taskwarrior buffer. If one already exists, bring it to
|
"Open the taskwarrior buffer. If one already exists, bring it to
|
||||||
the front and focus it. Otherwise, create one and load the data."
|
the front and focus it. Otherwise, create one and load the data."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(taskwarrior-update-buffer))
|
||||||
|
|
||||||
|
(defun taskwarrior-update-buffer ()
|
||||||
(let* ((buf (get-buffer-create "taskwarrior")))
|
(let* ((buf (get-buffer-create "taskwarrior")))
|
||||||
(progn
|
(progn
|
||||||
(switch-to-buffer buf)
|
(switch-to-buffer buf)
|
||||||
(setq font-lock-defaults '(taskwarrior-highlight-regexps))
|
(setq font-lock-defaults '(taskwarrior-highlight-regexps))
|
||||||
(toggle-read-only)
|
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
|
(toggle-read-only)
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(taskwarrior-write-entries)
|
(taskwarrior-write-entries)
|
||||||
(taskwarrior-mode)
|
(taskwarrior-mode)
|
||||||
|
|
Loading…
Reference in a new issue