-(defun elpher-remove-bookmark (bookmark)
- "Remove BOOKMARK from the saved list of bookmarks."
- (elpher-save-bookmarks
- (seq-filter (lambda (this-bookmark)
- (not (equal bookmark this-bookmark)))
- (elpher-load-bookmarks))))
-
-(defun elpher-display-bookmarks ()
- "Display saved bookmark list."
- (interactive)
- (elpher-with-clean-buffer
- (insert
- "Use 'u' to return to the previous page.\n\n"
- "---- Bookmark list ----\n\n")
- (let ((bookmarks (elpher-load-bookmarks)))
- (if bookmarks
- (dolist (bookmark (elpher-load-bookmarks))
- (let ((type (elpher-bookmark-type bookmark))
- (display-string (elpher-bookmark-display-string bookmark))
- (address (elpher-bookmark-address bookmark)))
- (elpher-insert-index-record-helper type display-string
- (elpher-address-selector address)
- (elpher-address-host address)
- (elpher-address-port address))))
- (insert "No bookmarks found.\n")))
- (insert "\n-----------------------")
- (goto-char (point-min))
- (elpher-next-link)))
-
-(defun elpher-bookmark-link ()
- "Bookmark the link at point."
- (interactive)
- (let ((button (button-at (point))))
- (if button
- (let ((node (button-get button 'elpher-node))
- (type (button-get button 'elpher-node-type))
- (label (button-label button)))
- (if node
- (progn
- (elpher-add-bookmark
- (elpher-make-bookmark type
- label
- (elpher-node-address node)))
- (message "Bookmarked \"%s\"" label))
- (error "Can only bookmark gopher links, not general URLs")))
- (error "No link selected"))))
-
-(defun elpher-unbookmark-link ()
- "Remove bookmark for the link at point."
- (interactive)
- (let ((button (button-at (point))))
- (if button
- (let ((node (button-get button 'elpher-node))
- (type (button-get button 'elpher-node-type)))
- (if node
- (elpher-remove-bookmark
- (elpher-make-bookmark type
- (button-label button)
- (elpher-node-address node)))
- (error "Can only bookmark gopher links, not general URLs")))
- (error "No link selected"))))