diff options
author | jao <jao@gnu.org> | 2024-11-12 18:58:14 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2024-11-12 18:58:14 +0000 |
commit | 418212e4eb963813c078cf290cddfe7e3defd7ed (patch) | |
tree | 3c265c395b0afe67f88f5e18a34f368a88f970d6 /lib/net | |
parent | 8ddc2d688cd37693320e46aa3d35d72f06e5bab3 (diff) | |
download | elibs-418212e4eb963813c078cf290cddfe7e3defd7ed.tar.gz elibs-418212e4eb963813c078cf290cddfe7e3defd7ed.tar.bz2 |
Revert "{if,when}-let deprecation in emacs 31"main
This reverts commit 4308710de811e3b4e2fb47f9024439df03e96b90.
Diffstat (limited to 'lib/net')
-rw-r--r-- | lib/net/jao-eww-session.el | 8 | ||||
-rw-r--r-- | lib/net/jao-notmuch-gnus.el | 16 | ||||
-rw-r--r-- | lib/net/jao-notmuch.el | 16 | ||||
-rw-r--r-- | lib/net/jao-proton-utils.el | 2 |
4 files changed, 21 insertions, 21 deletions
diff --git a/lib/net/jao-eww-session.el b/lib/net/jao-eww-session.el index 3c60cf8..4ac5447 100644 --- a/lib/net/jao-eww-session.el +++ b/lib/net/jao-eww-session.el @@ -97,7 +97,7 @@ the session is already displayed in a eww tab, jao-eww-session can: (jao-eww-session-eww-buffers (current-buffer)))) (defun jao-eww--current-url () - (when-let* ((url (eww-current-url))) (url-encode-url url))) + (when-let (url (eww-current-url)) (url-encode-url url))) (defun jao-eww-session--current-urls (&optional skip-current) (let ((urls) @@ -107,7 +107,7 @@ the session is already displayed in a eww tab, jao-eww-session can: (dolist (b (jao-eww-session-eww-buffers (when skip-current cb)) (list pos (reverse urls))) (set-buffer b) - (when-let* ((url (jao-eww--current-url))) + (when-let (url (jao-eww--current-url)) (when (eq b cb) (setq pos count)) (setq count (1+ count)) (push (cons url (jao-eww-buffer-title)) urls))))) @@ -133,7 +133,7 @@ the session is already displayed in a eww tab, jao-eww-session can: (seq-filter (lambda (b) (with-current-buffer b - (when-let* ((url (jao-eww--current-url))) + (when-let (url (jao-eww--current-url)) (when (member url urls) (when (y-or-n-p "Already open session, abort? ") (switch-to-buffer b) @@ -218,7 +218,7 @@ the session is already displayed in a eww tab, jao-eww-session can: (defun jao-eww-session-load () "Load last stored session into eww." (interactive) - (when-let* ((s (jao-eww-session-load-aux))) + (when-let ((s (jao-eww-session-load-aux))) (let* ((urls (jao-eww-session-urls s)) (offset (jao-eww-session-offset s)) (buffers (unless (equal jao-eww-session-duplicate-tabs 'always) diff --git a/lib/net/jao-notmuch-gnus.el b/lib/net/jao-notmuch-gnus.el index 1a03613..f5cc3b2 100644 --- a/lib/net/jao-notmuch-gnus.el +++ b/lib/net/jao-notmuch-gnus.el @@ -62,7 +62,7 @@ (defun jao-notmuch-gnus-show-tags () "Display in the echo area the tags of the current message." (interactive) - (when-let* ((id (jao-notmuch-gnus-message-id))) + (when-let (id (jao-notmuch-gnus-message-id)) (message "%s" (string-join (jao-notmuch-gnus-message-tags id) " ")))) (defun jao-notmuch-gnus-toggle-tags (tags &optional id current) @@ -77,7 +77,7 @@ (defun jao-notmuch-gnus-tag-mark () "Remove the new tag for an article when it's marked as seen by Gnus." - (when-let* ((id (jao-notmuch-gnus-message-id t))) + (when-let (id (jao-notmuch-gnus-message-id t)) (jao-notmuch-gnus-tag-message id '("-new") t))) (add-hook 'gnus-mark-article-hook #'jao-notmuch-gnus-tag-mark) @@ -191,12 +191,12 @@ Example: (org-gnus-follow-link group id))) (defun jao-notmuch-gnus-org-store () - (when-let* ((d (or (when (derived-mode-p 'notmuch-show-mode 'notmuch-tree-mode) - (cons (notmuch-show-get-message-id) - (notmuch-show-get-subject))) - (when (derived-mode-p 'gnus-summary-mode 'gnus-article-mode) - (cons (jao-notmuch-gnus-message-id) - (gnus-summary-article-subject)))))) + (when-let (d (or (when (derived-mode-p 'notmuch-show-mode 'notmuch-tree-mode) + (cons (notmuch-show-get-message-id) + (notmuch-show-get-subject))) + (when (derived-mode-p 'gnus-summary-mode 'gnus-article-mode) + (cons (jao-notmuch-gnus-message-id) + (gnus-summary-article-subject))))) (org-link-store-props :type "mail" :link (concat "mail:" (car d)) :description (concat "Mail: " (cdr d))))) diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el index 2dc4b70..aef9757 100644 --- a/lib/net/jao-notmuch.el +++ b/lib/net/jao-notmuch.el @@ -69,7 +69,7 @@ (user-error "No tree view for this buffer"))) (defun jao-notmuch-tree--looking-at-message () - (when-let* ((id (plist-get (notmuch-tree-get-message-properties) :id))) + (when-let (id (plist-get (notmuch-tree-get-message-properties) :id)) (equal (concat "*notmuch-id:" id "*") (buffer-name (window-buffer notmuch-tree-message-window))))) @@ -105,7 +105,7 @@ (goto-char (point-min)) (let ((pos (point))) (while (setq pos (next-single-property-change pos 'w3m-href-anchor)) - (when-let* ((url (get-text-property pos 'w3m-href-anchor))) + (when-let ((url (get-text-property pos 'w3m-href-anchor))) (when (stringp url) (cl-pushnew url res :test #'string=)))) (seq-uniq res #'string=)))) @@ -117,7 +117,7 @@ (defun jao-notmuch-browse-urls (&optional external) (interactive "P") - (if-let* ((urls (jao-notmuch-message-urls))) + (if-let ((urls (jao-notmuch-message-urls))) (funcall (if external browse-url-secondary-browser-function #'browse-url) (completing-read "Browse URL: " urls)) (message "No URLs in this message"))) @@ -131,22 +131,22 @@ (interactive) (when (get-text-property (point) 'w3m-href-anchor) (goto-char (next-single-property-change (point) 'w3m-href-anchor))) - (if-let* ((pos (next-single-property-change (point) 'w3m-href-anchor))) + (if-let (pos (next-single-property-change (point) 'w3m-href-anchor)) (goto-char pos) (or (forward-button 1 nil t t) (ffap-next-guess)))) (defun jao-notmuch-show-previous-button () (interactive) - (if-let* ((pos (previous-single-property-change (point) 'w3m-href-anchor))) + (if-let (pos (previous-single-property-change (point) 'w3m-href-anchor)) (goto-char (previous-single-property-change pos 'w3m-href-anchor)) (or (backward-button 1 nil t t) (ffap-next-guess t)))) (defun jao-notmuch-show-ret () (interactive) - (when-let* ((url (or (get-text-property (point) 'w3m-href-anchor) - (thing-at-point-url-at-point)))) + (when-let (url (or (get-text-property (point) 'w3m-href-anchor) + (thing-at-point-url-at-point))) (browse-url url))) @@ -215,7 +215,7 @@ ;;; header line with thread message counts (defun jao-notmuch--looking-at-new-p (&optional p) - (when-let* ((ts (if p (plist-get p :tags) (notmuch-show-get-tags)))) + (when-let (ts (if p (plist-get p :tags) (notmuch-show-get-tags))) (or (member "unread" ts) (member "new" ts)))) (defsubst jao-notmuch-tree--first-p (&optional msg) diff --git a/lib/net/jao-proton-utils.el b/lib/net/jao-proton-utils.el index 0c9ccd7..62b97b3 100644 --- a/lib/net/jao-proton-utils.el +++ b/lib/net/jao-proton-utils.el @@ -86,7 +86,7 @@ (jao-proton-vpn--do "s")) (defun proton-vpn--get-status () - (or (when-let* ((b (get-buffer jao-proton-vpn--buffer))) + (or (when-let ((b (get-buffer jao-proton-vpn--buffer))) (with-current-buffer b (goto-char (point-min)) (if (re-search-forward "^Status: *\\(.+\\)$" nil t) |