Replaced eval-with-clean-buffer debug declaration.
[elpher.git] / elpher.el
index 7577489..76aa992 100644 (file)
--- a/elpher.el
+++ b/elpher.el
@@ -587,6 +587,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
@@ -1757,7 +1758,7 @@ This is rendered using `elpher-get-visited-pages-page' via `elpher-type-map'."
 
 (defun elpher-display-history-links (pages title)
   "Show all PAGES in an Elpher buffer with a given TITLE."
-  (let* ((title-line (concat "---- " title " ----"))
+  (let* ((title-line (concat " ---- " title " ----"))
          (footer-line (make-string (length title-line) ?-)))
     (elpher-with-clean-buffer
      (insert title-line "\n\n")
@@ -1768,7 +1769,7 @@ This is rendered using `elpher-get-visited-pages-page' via `elpher-type-map'."
                   (address (elpher-page-address page)))
                (elpher-insert-index-record display-string address))))
        (insert "No history items found.\n"))
-     (insert "\n" footer-line "\n"
+     (insert "\n " footer-line "\n"
              "Select an entry or press 'u' to return to the previous page.")
      (elpher-restore-pos))))
 
@@ -1863,14 +1864,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 ")