X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=elpher.git;a=blobdiff_plain;f=elpher.el;h=391bc8b54ad7e9515f3b86f9e289a2e51d234699;hp=1c4293760451a07e6e2636fa8aaffd8f7393063d;hb=2cdf02e99dbd2d7f765c08ad2f8477b4ea07d5f7;hpb=297f223afe310a0acbe395c79c4c13b1257b0d0c diff --git a/elpher.el b/elpher.el index 1c42937..391bc8b 100644 --- a/elpher.el +++ b/elpher.el @@ -5,6 +5,7 @@ ;; Copyright (C) 2021 Christopher Brannon ;; Copyright (C) 2021 Omar Polo ;; Copyright (C) 2021 Noodles! +;; Copyright (C) 2021 Abhiseck Paira ;; Copyright (C) 2020-2021 Alex Schroeder ;; Copyright (C) 2020 Zhiwei Chen ;; Copyright (C) 2020 condy0919 @@ -19,7 +20,7 @@ ;; Author: Tim Vaughan ;; Created: 11 April 2019 -;; Version: 3.0.0 +;; Version: 3.1.0 ;; Keywords: comm gopher ;; Homepage: https://thelambdalab.xyz/elpher ;; Package-Requires: ((emacs "27.1")) @@ -84,7 +85,7 @@ ;;; Global constants ;; -(defconst elpher-version "3.0.0" +(defconst elpher-version "3.1.0" "Current version of elpher.") (defconst elpher-margin-width 6 @@ -587,6 +588,7 @@ previously-visited pages,unless NO-HISTORY is non-nil." (defmacro elpher-with-clean-buffer (&rest args) "Evaluate ARGS with a clean *elpher* buffer as current." + (declare (debug (body))) ;; Allow edebug to step through body `(with-current-buffer elpher-buffer-name (unless (eq major-mode 'elpher-mode) ;; avoid resetting buffer-local variables @@ -1863,14 +1865,14 @@ To bookmark the link at point use \\[elpher-bookmark-link]." (elpher-with-clean-buffer (insert " ---- Elpher Bookmarks ---- \n\n") (bookmark-maybe-load-default-file) - (let ((bookmarks (bookmark-maybe-sort-alist))) - (if bookmarks - (dolist (bookmark bookmarks) - (let* ((name (car bookmark)) - (url (alist-get 'location (cdr bookmark))) - (address (elpher-address-from-url url))) - (elpher-insert-index-record name address))) - (insert "No bookmarked pages found.\n"))) + (dolist (bookmark (bookmark-maybe-sort-alist)) + (when (eq #'elpher-bookmark-jump (alist-get 'handler (cdr bookmark))) + (let* ((name (car bookmark)) + (url (alist-get 'location (cdr bookmark))) + (address (elpher-address-from-url url))) + (elpher-insert-index-record name address)))) + (when (<= (line-number-at-pos) 3) + (insert "No bookmarked pages found.\n")) (insert "\n --------------------------\n\n" "Select an entry or press 'u' to return to the previous page.\n\n" "Bookmarks can be renamed or deleted via the ") @@ -2016,6 +2018,12 @@ supports the old protocol elpher, where the link is self-contained." (setq mu4e~view-beginning-of-url-regexp "\\(?:https?\\|gopher\\|finger\\|gemini\\)://\\|mailto:") +;;; eww: + +;; Let elpher handle gemini, gopher links in eww buffer. +(setq eww-use-browse-url + "\\`mailto:\\|\\(\\`gemini\\|\\`gopher\\|\\`finger\\)://") + ;;; Interactive procedures ;;