|
@@ -318,6 +318,7 @@ RET at beg-of-buf -> Append to file as level 2 headline
|
|
|
(append (list (nth 1 x) (car x)) (cddr x))
|
|
|
(append (list (car x) "") (cdr x))))
|
|
|
(delq nil pre-selected-templates2)))
|
|
|
+ msg
|
|
|
(char (or use-char
|
|
|
(cond
|
|
|
((= (length templates) 1)
|
|
@@ -328,22 +329,32 @@ RET at beg-of-buf -> Append to file as level 2 headline
|
|
|
(string-to-char org-force-remember-template-char)
|
|
|
org-force-remember-template-char))
|
|
|
(t
|
|
|
- (message "Select template: %s"
|
|
|
- (mapconcat
|
|
|
- (lambda (x)
|
|
|
- (cond
|
|
|
- ((not (string-match "\\S-" (nth 1 x)))
|
|
|
- (format "[%c]" (car x)))
|
|
|
- ((equal (downcase (car x))
|
|
|
- (downcase (aref (nth 1 x) 0)))
|
|
|
- (format "[%c]%s" (car x)
|
|
|
- (substring (nth 1 x) 1)))
|
|
|
- (t (format "[%c]%s" (car x) (nth 1 x)))))
|
|
|
- templates " "))
|
|
|
- (let ((inhibit-quit t) (char0 (read-char-exclusive)))
|
|
|
+ (setq msg (format
|
|
|
+ "Select template: %s"
|
|
|
+ (mapconcat
|
|
|
+ (lambda (x)
|
|
|
+ (cond
|
|
|
+ ((not (string-match "\\S-" (nth 1 x)))
|
|
|
+ (format "[%c]" (car x)))
|
|
|
+ ((equal (downcase (car x))
|
|
|
+ (downcase (aref (nth 1 x) 0)))
|
|
|
+ (format "[%c]%s" (car x)
|
|
|
+ (substring (nth 1 x) 1)))
|
|
|
+ (t (format "[%c]%s" (car x) (nth 1 x)))))
|
|
|
+ templates " ")))
|
|
|
+ (let ((inhibit-quit t) char0)
|
|
|
+ (while (not char0)
|
|
|
+ (message msg)
|
|
|
+ (setq char0 (read-char-exclusive))
|
|
|
+ (when (and (not (assoc char0 templates))
|
|
|
+ (not (equal char0 ?\C-g)))
|
|
|
+ (message "No suche template \"%c\"" char0)
|
|
|
+ (ding) (sit-for 1)
|
|
|
+ (setq char0 nil)))
|
|
|
(when (equal char0 ?\C-g)
|
|
|
(jump-to-register remember-register)
|
|
|
- (kill-buffer remember-buffer))
|
|
|
+ (kill-buffer remember-buffer)
|
|
|
+ (error "Abort"))
|
|
|
char0))))))
|
|
|
(cddr (assoc char templates)))))
|
|
|
|