From b2a862b56835a63245e4872a82e4da455f2523dc Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Tue, 21 Jan 2025 09:44:48 +1100 Subject: [emacs] small fixes to emms and fediorg/exitter emms: reset score delta to 1 if last command is not emms-playlist-mode-play-smart fediorg: show thumbnails only when they are legit image files --- emacs/.emacs.d/init/ycp-complete.el | 9 ++++++++- emacs/.emacs.d/lisp/exitter | 2 +- emacs/.emacs.d/lisp/my/fediorg.el | 7 ++++--- emacs/.emacs.d/lisp/my/my-emms.el | 3 ++- 4 files changed, 15 insertions(+), 6 deletions(-) (limited to 'emacs') diff --git a/emacs/.emacs.d/init/ycp-complete.el b/emacs/.emacs.d/init/ycp-complete.el index d123989..2caca0a 100644 --- a/emacs/.emacs.d/init/ycp-complete.el +++ b/emacs/.emacs.d/init/ycp-complete.el @@ -308,7 +308,14 @@ (:name qutebrowser :command my-browse-url-qutebrowser) (:name download-and-open :command my-fetch-url))) (setq hmm-external-handlers - '((:name mpv + '((:name feh + :external-command "feh %U" + :display-name "feh image viewer" + :description "Open url with feh" + :schemes + ("ftp" "http" "https" "mms" "rtmp" "rtsp" "sftp" "smb" "srt") + :handling :url) + (:name mpv :external-command "mpv %U" :display-name "mpv player" :description "Play url with mpv" diff --git a/emacs/.emacs.d/lisp/exitter b/emacs/.emacs.d/lisp/exitter index 9af8216..3655175 160000 --- a/emacs/.emacs.d/lisp/exitter +++ b/emacs/.emacs.d/lisp/exitter @@ -1 +1 @@ -Subproject commit 9af8216d544169f5385b32c73c8cd29c5cef9d2b +Subproject commit 36551754f548954d83af723d227dc7d14fd57d60 diff --git a/emacs/.emacs.d/lisp/my/fediorg.el b/emacs/.emacs.d/lisp/my/fediorg.el index 123545b..e2f21b8 100644 --- a/emacs/.emacs.d/lisp/my/fediorg.el +++ b/emacs/.emacs.d/lisp/my/fediorg.el @@ -215,8 +215,8 @@ Including ancestors and descendants, if any." (with-temp-buffer (insert (fediorg-make-org-link .url .type)) - (if .description - (insert ": " .description)) + (when .description + (insert ": " .description)) (when .preview_url (let ((thumb-file-name (file-name-concat @@ -226,7 +226,8 @@ Including ancestors and descendants, if any." (ignore-error 'file-already-exists (url-copy-file .preview_url thumb-file-name)) (insert "\n") - (insert-image (create-image thumb-file-name)) + (when-let ((image (create-image thumb-file-name))) + (insert-image image)) )) (buffer-string)))) attachments diff --git a/emacs/.emacs.d/lisp/my/my-emms.el b/emacs/.emacs.d/lisp/my/my-emms.el index 6e8cf2a..e6fb0e2 100644 --- a/emacs/.emacs.d/lisp/my/my-emms.el +++ b/emacs/.emacs.d/lisp/my/my-emms.el @@ -508,7 +508,8 @@ character." If the last command is `emms-playlist-mode-play-smart', then set `my-emms-score-delta' to 2." - (when (eq last-command 'emms-playlist-mode-play-smart) + (if (not (eq last-command 'emms-playlist-mode-play-smart)) + (setq my-emms-score-delta 1) (setq my-emms-score-delta 2) (setq last-command nil)) ) -- cgit v1.2.3