Add missing bits

This commit is contained in:
Bram Schoenmakers 2024-01-03 19:45:22 +01:00
parent b0419a4e77
commit 4c495efa3a
Signed by: bram
GPG key ID: 0CCD19DFDC63258F
2 changed files with 30 additions and 0 deletions

View file

@ -730,6 +730,19 @@ Based on an answer at the [[https://emacs.stackexchange.com/a/77480/34645][Emacs
* Create note with Denote from a URL :emacs:
#+begin_src elisp :tangle gists/denote-create-note-url.el
(defconst my/termux-p (getenv "ANDROID_ROOT"))
(defun my/clipboard-get ()
"Return the text on the system clipboard.
This function treats Termux systems differently, the clipboard is only
accessible through the termux-clipboard-get commandline interface,
part of the the termux-api package."
(if my/termux-p
(shell-command-to-string "termux-clipboard-get")
(current-kill 0)))
(defun my/get-url-title (url)
"Attempt to retrieve the title string from the given URL.
@ -803,6 +816,8 @@ Based on an answer at the [[https://emacs.stackexchange.com/a/77480/34645][Emacs
(denote-subdirectory-prompt))
(org-set-property "URL" url))
;;; Elfeed integration
(defun my/elfeed/entry-url ()
"Return the URL of the current elfeed entry."
(when-let ((entry (or elfeed-show-entry

View file

@ -1,3 +1,16 @@
(defconst my/termux-p (getenv "ANDROID_ROOT"))
(defun my/clipboard-get ()
"Return the text on the system clipboard.
This function treats Termux systems differently, the clipboard is only
accessible through the termux-clipboard-get commandline interface,
part of the the termux-api package."
(if my/termux-p
(shell-command-to-string "termux-clipboard-get")
(current-kill 0)))
(defun my/get-url-title (url)
"Attempt to retrieve the title string from the given URL.
@ -71,6 +84,8 @@ looking at the <title> tags."
(denote-subdirectory-prompt))
(org-set-property "URL" url))
;;; Elfeed integration
(defun my/elfeed/entry-url ()
"Return the URL of the current elfeed entry."
(when-let ((entry (or elfeed-show-entry