0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 22:07:49 +00:00

org-tempo: Tiny refactoring

* lisp/org-tempo.el (org-tempo--include-file): Tiny refactoring.
This commit is contained in:
Nicolas Goaziou 2017-12-10 17:11:24 +01:00
parent 3efb000739
commit a34431f6ea

View file

@ -126,12 +126,13 @@ Goes through `org-structure-template-alist' and
(defun org-tempo--include-file ()
"Ask for file name and take care of quit"
(let* ((inhibit-quit t))
(let ((inhibit-quit t))
(unless (with-local-quit
(prog1 t
(insert
(format "#+include: \"%s\" " (file-relative-name
(read-file-name "Include file: "))))))
(format "#+include: %S "
(file-relative-name
(read-file-name "Include file: "))))))
(insert "<I")
(setq quit-flag nil))))
@ -156,9 +157,8 @@ Goes through `org-structure-template-alist' and
'tempo-complete-tag)
;; Enable Org Tempo in all open Org buffers.
(mapc (lambda (buf) (with-current-buffer buf
(when (eq major-mode 'org-mode) (org-tempo-setup))))
(buffer-list))
(dolist (b (org-buffer-list))
(with-current-buffer b (org-tempo-setup)))
(eval-after-load 'org
'(org-tempo-add-templates))