[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/rec-mode 299b496 44/98: rec-mode: support for generatin
From: |
Stefan Monnier |
Subject: |
[elpa] externals/rec-mode 299b496 44/98: rec-mode: support for generating time-stamps in date fields. |
Date: |
Thu, 12 Nov 2020 13:18:37 -0500 (EST) |
branch: externals/rec-mode
commit 299b496ca666ee99713734d22b70097b2bf574f3
Author: Jose E. Marchesi <jemarch@gnu.org>
Commit: Antoine Kalmbach <ane@iki.fi>
rec-mode: support for generating time-stamps in date fields.
---
etc/rec-mode.el | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/etc/rec-mode.el b/etc/rec-mode.el
index 78e37a8..ef60c36 100644
--- a/etc/rec-mode.el
+++ b/etc/rec-mode.el
@@ -82,6 +82,9 @@ hidden by default in navigation mode.")
(defconst rec-keyword-mandatory (concat rec-keyword-prefix "mandatory")
"Mandatory keyword.")
+(defconst rec-time-stamp-format "%Y-%m-%d %a %H:%M"
+ "Format for `format-time-string' which is used for time stamps.")
+
(defvar rec-comment-re "^#.*"
"regexp denoting a comment line")
@@ -1569,6 +1572,18 @@ will be used for fields of any type."
`(lambda () (interactive)
(use-local-map (quote ,old-map))
(calendar-exit)))
+ (define-key map "n"
+ `(lambda () (interactive)
+ (use-local-map (quote ,old-map))
+ (calendar-exit)
+ (set-buffer rec-prev-buffer)
+ (let ((buffer-read-only nil))
+ (rec-delete-field)
+ (save-excursion
+ (rec-insert-field (list 'field
+ 0
+ rec-field-name
+ (format-time-string
rec-time-stamp-format)))))))
(define-key map (kbd "RET")
`(lambda () (interactive)
(let* ((date (calendar-cursor-to-date))
@@ -1583,7 +1598,8 @@ will be used for fields of any type."
0
rec-field-name
(format-time-string "%Y-%m-%d"
time))))))))
- (use-local-map map)))
+ (use-local-map map)
+ (message "[RET]: Select date [n]: Now, time-stamp [q]: Exit")))
(t
(setq edit-buf (get-buffer-create "Rec Edit"))
(set-buffer edit-buf)
- [elpa] externals/rec-mode 20c3d6f 51/98: Do not kill the preceding empty line., (continued)
- [elpa] externals/rec-mode 20c3d6f 51/98: Do not kill the preceding empty line., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode f106531 62/98: rec-mode: do the right thing when the selected window is the only window in the frame., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 8d404d8 56/98: rec-mode: fixed to allow comments in records., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 113747c 71/98: maint: syntax-check fixes., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 0ea7b18 80/98: rec-mode: quote the shell argument with the file name when invoking recfix., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode c302e6e 79/98: Copyright years updated to 2015., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 98b98ad 81/98: Quote the file name argument before to pass it to recfix in a shell., Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 3ac3482 83/98: ob-rec.el: switch to lexical-binding, Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 5fa6020 92/98: Font lock fixes and many small checkdoc fixes, Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode d0e8456 98/98: Improve regexp that matched on empty strings, Stefan Monnier, 2020/11/12
- [elpa] externals/rec-mode 299b496 44/98: rec-mode: support for generating time-stamps in date fields.,
Stefan Monnier <=