diff options
author | Yuchen Pei <id@ypei.org> | 2024-12-31 10:04:11 +1100 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2024-12-31 10:04:11 +1100 |
commit | 82cf9a13134204b87b7fe01d1cebdf5771d7cebb (patch) | |
tree | 2bda461dbfcdb9656e9d43bc36090f5a82b0901c /emacs/.emacs.d/lisp/my/my-nov.el | |
parent | 0584de27f0fc5039e0198732385e0fdcbe41d924 (diff) |
[emacs] various changes
* emacs/.emacs.d/init/ycp-basic.el: forgot to read
my-copy-file-targets from local config
* emacs/.emacs.d/init/ycp-markup.el: Key in nov mode to copy file to devices
* emacs/.emacs.d/init/ycp-org.el: Back to use browse-url for http /
https org links
* emacs/.emacs.d/init/ycp-pdf.el: forgot to read my-pdf-dptrp1-ip from
local config
* emacs/.emacs.d/init/ycp-web.el: add a handler for mariadb kb links
* emacs/.emacs.d/lisp/my/my-emms.el: mp4 can be audio
* emacs/.emacs.d/lisp/my/my-mariadb.el: a predicate for browse-url to
determine mariadb kb links
* emacs/.emacs.d/lisp/my/my-nov.el: add a command to copy current epub
to a device
* emacs/.emacs.d/lisp/my/my-org.el: ensure leading and trailing
empty lines are deleted in org-edit-special; factor out copy file to
device with staging to my-utils, fix my-org-edit-special-after
argument numbers for one more time (it is 0 with src and 1 with example)
* emacs/.emacs.d/lisp/my/my-utils.el: mp4 could be audio; a function
to copy files to device with staging, factored from my-org
Diffstat (limited to 'emacs/.emacs.d/lisp/my/my-nov.el')
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-nov.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-nov.el b/emacs/.emacs.d/lisp/my/my-nov.el index 863d09a..4e2f60a 100644 --- a/emacs/.emacs.d/lisp/my/my-nov.el +++ b/emacs/.emacs.d/lisp/my/my-nov.el @@ -52,5 +52,17 @@ chapter title." (nov-next-document) (follow-scroll-up arg))) +(defun my-nov-copy-buffer-file-with-staging () + (interactive) + (unless (derived-mode-p 'nov-mode) (error "Not in nov mode")) + (pcase-let* ((name + (completing-read (format "Copy %s to: " nov-file-name) + my-copy-file-targets + nil t)) + (`(,dest ,staging) (alist-get name my-copy-file-targets + nil nil #'equal))) + (my-copy-file-with-staging + nov-file-name dest staging))) + (provide 'my-nov) ;;; my-nov.el ends here |