[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/mpv 9dedf3b7c1 34/50: Monkey-patch org-timer-item instead
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/mpv 9dedf3b7c1 34/50: Monkey-patch org-timer-item instead of reimplementing |
Date: |
Tue, 28 Dec 2021 00:58:43 -0500 (EST) |
branch: elpa/mpv
commit 9dedf3b7c1bfd778284df7f394207ce0447ea7aa
Author: Johann Klähn <johann@jklaehn.de>
Commit: Johann Klähn <johann@jklaehn.de>
Monkey-patch org-timer-item instead of reimplementing
---
mpv.el | 25 ++++++-------------------
1 file changed, 6 insertions(+), 19 deletions(-)
diff --git a/mpv.el b/mpv.el
index dede05358e..d2fc082b7d 100644
--- a/mpv.el
+++ b/mpv.el
@@ -237,25 +237,12 @@ When called with a non-nil ARG, insert a timer list item
like `org-timer-item'."
"Insert a description-type item with the playback position TIME-STRING.
See `org-timer-item' which this is based on."
- (let ((itemp (org-in-item-p)) (pos (point)))
- (cond
- ;; In a timer list, insert with `org-list-insert-item',
- ;; then fix the list.
- ((and itemp (goto-char itemp) (org-at-item-timer-p))
- (let* ((struct (org-list-struct))
- (prevs (org-list-prevs-alist struct))
- (s (concat time-string " :: ")))
- (setq struct (org-list-insert-item pos struct prevs nil s))
- (org-list-write-struct struct (org-list-parents-alist struct))
- (looking-at org-list-full-item-re)
- (goto-char (match-end 0))))
- ;; In a list of another type, don't break anything: throw an error.
- (itemp (goto-char pos) (user-error "This is not a timer list"))
- ;; Else, start a new list.
- (t
- (beginning-of-line)
- (org-indent-line)
- (insert (concat "- " time-string " :: "))))))
+ (cl-letf (((symbol-function 'org-timer)
+ (lambda (&optional _restart no-insert)
+ (funcall
+ (if no-insert #'identity #'insert)
+ (concat time-string " ")))))
+ (org-timer-item)))
;;;###autoload
(defun mpv-seek-to-position-at-point ()
- [nongnu] elpa/mpv 899559ae77 04/50: some fixes, (continued)
- [nongnu] elpa/mpv 899559ae77 04/50: some fixes, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv ee505feff0 16/50: add .gitignore, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 0a02225f4e 30/50: autoload all interactive functions, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 27b98410e5 45/50: Fix decreasing volume or speed by multiple steps, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 8da5b19f3d 07/50: cleanup, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 91b094c966 02/50: initial import, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv f0da905fd3 06/50: implement pausing and inserting playback position, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 6338f0d6b5 12/50: rename to mpv.el, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv e3fad297cd 18/50: add README.md, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv c6b3fa013c 36/50: Add mpv-run-command function to synchronously run commands, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 9dedf3b7c1 34/50: Monkey-patch org-timer-item instead of reimplementing,
ELPA Syncer <=
- [nongnu] elpa/mpv 174cd4b68b 31/50: call expand-file-name on files passed to mpv-play, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 3849da1e45 01/50: root commit, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 33ca8987ed 03/50: work around spurious event messages, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 6fe510798a 26/50: fix mpv-speed-set, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv fcdca618df 29/50: add badge for MELPA stable, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv d7bb3a7082 40/50: Add sleep and timeout to mpv-kill and mpv-play, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv bc89524528 15/50: use timer formatting from org-timer.el, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv b026ae5bb6 46/50: Merge pull request #19 from c1-g/volume, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 1e666079b8 05/50: skip junk at beginning of buffer, ELPA Syncer, 2021/12/28
- [nongnu] elpa/mpv 8c0933630b 08/50: add seek-to-position-at-point, ELPA Syncer, 2021/12/28