"Specifies the number of seconds to wait for a network connection to time out."
:type '(integer))
+
;;; Model
;;
""
(substring (url-filename address) 2)))
-;; Page
-
;; Cache
"Set the cursor position cache for ADDRESS to POS."
(puthash address pos elpher-pos-cache))
+
;; Page
-(defun elpher-make-page (address display-string)
- (list address display-string))
+(defun elpher-make-page (display-string address)
+ (list display-string address))
-(defun elpher-page-address (page)
+(defun elpher-page-display-string (page)
(elt page 0))
-(defun elpher-page-display-string (page)
+(defun elpher-page-address (page)
(elt page 1))
-
(defvar elpher-current-page nil)
(defvar elpher-history nil)
unless NO-HISTORY is non-nil."
(elpher-save-pos)
(elpher-process-cleanup)
- (unless no-history
- (push page elpher-history))
+ (unless (or no-history
+ (equal (elpher-page-address elpher-current-page)
+ (elpher-page-address page)))
+ (push elpher-current-page elpher-history))
(setq elpher-current-page page)
(let* ((address (elpher-page-address page))
(type (elpher-address-type address))
(defun elpher-visit-previous-page ()
"Visit the previous page in the history."
(let ((previous-page (pop elpher-history)))
- (when previous-page
- (elpher-visit-page previous-page nil t))))
+ (if previous-page
+ (elpher-visit-page previous-page nil t)
+ (error "No previous page."))))
(defun elpher-reload-current-page ()
"Reload the current page, discarding any existing cached content."
(defun elpher-redraw ()
"Redraw current page."
(interactive)
- (if elpher-current-page
- (elpher-visit-page elpher-current-page)
- (message "No current site.")))
+ (elpher-visit-page elpher-current-page))
(defun elpher-reload ()
"Reload current page."
(interactive)
- (if elpher-current-page
- (elpher-reload-current-page)
- (message "No current site.")))
+ (elpher-reload-current-page))
(defun elpher-toggle-tls ()
"Toggle TLS encryption mode for gopher."
(defun elpher-view-raw ()
"View raw server response for current page."
(interactive)
- (if elpher-current-page
- (if (elpher-address-special-p (elpher-page-address elpher-current-page))
- (error "This page was not generated by a server")
- (elpher-visit-page elpher-current-page
- #'elpher-render-raw))
- (message "No current site.")))
+ (if (elpher-address-special-p (elpher-page-address elpher-current-page))
+ (error "This page was not generated by a server")
+ (elpher-visit-page elpher-current-page
+ #'elpher-render-raw)))
(defun elpher-back ()
"Go to previous site."
(interactive)
- (if elpher-history
- (error "No previous site")
- (elpher-visit-previous-page)))
+ (elpher-visit-previous-page))
(defun elpher-download ()
"Download the link at point."