(defalias 'elpher-color-filter-apply
(if (fboundp 'xterm-color-filter)
(lambda (s)
- (let ((xterm-color-render nil))
- (xterm-color-filter s)))
+ (let ((xterm-color-render nil))
+ (xterm-color-filter s)))
'ansi-color-filter-apply)
"A function to filter out ANSI escape sequences.")
(defalias 'elpher-color-apply
"Set the address corresponding to PAGE to NEW-ADDRESS."
(setcar (cdr page) new-address))
-(defvar elpher-current-page nil) ; buffer local
-(defvar elpher-history nil) ; buffer local
+(defvar elpher-current-page nil) ; buffer local
+(defvar elpher-history nil) ; buffer local
(defun elpher-visit-page (page &optional renderer no-history)
"Visit PAGE using its own renderer or RENDERER, if non-nil.
(when (> new-hkbytes-received hkbytes-received)
(setq hkbytes-received new-hkbytes-received)
(elpher-buffer-message
- (concat "("
- (number-to-string (/ hkbytes-received 10.0))
- " MB read)")
- 1)))
+ (concat "("
+ (number-to-string (/ hkbytes-received 10.0))
+ " MB read)")
+ 1)))
(setq response-string-parts
(cons string response-string-parts))))
(set-process-sentinel proc
(while (re-search-forward elpher-url-regex nil t)
(let ((page (elpher-make-page (substring-no-properties (match-string 0))
(elpher-address-from-url (match-string 0)))))
- (make-text-button (match-beginning 0)
- (match-end 0)
- 'elpher-page page
- 'action #'elpher-click-link
- 'follow-link t
- 'help-echo #'elpher--page-button-help
- 'face 'button)))
+ (make-text-button (match-beginning 0)
+ (match-end 0)
+ 'elpher-page page
+ 'action #'elpher-click-link
+ 'follow-link t
+ 'help-echo #'elpher--page-button-help
+ 'face 'button)))
(buffer-string)))
(defconst elpher-ansi-regex "\x1b\\[[^m]*m"
(defun elpher-get-gopher-query-page (renderer)
"Getter for gopher addresses requiring input.
The response is rendered using the rendering function RENDERER."
- (let* ((address (elpher-page-address elpher-current-page))
- (content (elpher-get-cached-content address))
- (aborted t))
+ (let* ((address (elpher-page-address elpher-current-page))
+ (content (elpher-get-cached-content address))
+ (aborted t))
(if (and content (funcall renderer nil))
(elpher-with-clean-buffer
(insert content)
(condition-case the-error
(if (and content (funcall renderer nil))
(elpher-with-clean-buffer
- (insert content)
- (elpher-restore-pos))
+ (insert content)
+ (elpher-restore-pos))
(elpher-with-clean-buffer
(insert "LOADING GEMINI... (use 'u' to cancel)\n"))
(setq elpher-gemini-redirect-chain nil)
(2 'elpher-gemini-heading2)
(3 'elpher-gemini-heading3)
(_ 'default)))
- (fill-column (if (display-graphic-p)
- (/ (* fill-column
- (font-get (font-spec :name (face-font 'default)) :size))
- (font-get (font-spec :name (face-font face)) :size)) fill-column)))
+ (fill-column (if (display-graphic-p)
+ (/ (* fill-column
+ (font-get (font-spec :name (face-font 'default)) :size))
+ (font-get (font-spec :name (face-font face)) :size)) fill-column)))
(setq elpher--gemini-page-headings (cons (cons header (point))
elpher--gemini-page-headings))
(unless (display-graphic-p)
(define-key map (kbd "F") 'elpher-forget-current-certificate)
(define-key map (kbd "v") 'elpher-visit-gemini-numbered-link)
(when (fboundp 'evil-define-key*)
- (evil-define-key* 'motion map
- (kbd "TAB") 'elpher-next-link
- (kbd "C-") 'elpher-follow-current-link
- (kbd "C-t") 'elpher-back
- (kbd "u") 'elpher-back
- (kbd "-") 'elpher-back
- (kbd "^") 'elpher-back
- (kbd "U") 'elpher-back-to-start
- [mouse-3] 'elpher-back
- (kbd "o") 'elpher-go
- (kbd "O") 'elpher-go-current
- (kbd "r") 'elpher-redraw
- (kbd "R") 'elpher-reload
- (kbd "T") 'elpher-toggle-tls
- (kbd ".") 'elpher-view-raw
- (kbd "d") 'elpher-download
- (kbd "D") 'elpher-download-current
- (kbd "J") 'elpher-jump
- (kbd "i") 'elpher-info-link
- (kbd "I") 'elpher-info-current
- (kbd "c") 'elpher-copy-link-url
- (kbd "C") 'elpher-copy-current-url
- (kbd "a") 'elpher-bookmark-link
- (kbd "A") 'elpher-bookmark-current
- (kbd "x") 'elpher-unbookmark-link
- (kbd "X") 'elpher-unbookmark-current
- (kbd "B") 'elpher-bookmarks
- (kbd "S") 'elpher-set-gopher-coding-system
- (kbd "F") 'elpher-forget-current-certificate
- (kbd "v") 'elpher-visit-gemini-numbered-link))
+ (evil-define-key*
+ 'motion map
+ (kbd "TAB") 'elpher-next-link
+ (kbd "C-") 'elpher-follow-current-link
+ (kbd "C-t") 'elpher-back
+ (kbd "u") 'elpher-back
+ (kbd "-") 'elpher-back
+ (kbd "^") 'elpher-back
+ (kbd "U") 'elpher-back-to-start
+ [mouse-3] 'elpher-back
+ (kbd "o") 'elpher-go
+ (kbd "O") 'elpher-go-current
+ (kbd "r") 'elpher-redraw
+ (kbd "R") 'elpher-reload
+ (kbd "T") 'elpher-toggle-tls
+ (kbd ".") 'elpher-view-raw
+ (kbd "d") 'elpher-download
+ (kbd "D") 'elpher-download-current
+ (kbd "J") 'elpher-jump
+ (kbd "i") 'elpher-info-link
+ (kbd "I") 'elpher-info-current
+ (kbd "c") 'elpher-copy-link-url
+ (kbd "C") 'elpher-copy-current-url
+ (kbd "a") 'elpher-bookmark-link
+ (kbd "A") 'elpher-bookmark-current
+ (kbd "x") 'elpher-unbookmark-link
+ (kbd "X") 'elpher-unbookmark-current
+ (kbd "B") 'elpher-bookmarks
+ (kbd "S") 'elpher-set-gopher-coding-system
+ (kbd "F") 'elpher-forget-current-certificate
+ (kbd "v") 'elpher-visit-gemini-numbered-link))
map)
"Keymap for gopher client.")
to create a new session. Returns the buffer selected (or created)."
(interactive "P")
(let* ((name (default-value 'elpher-buffer-name))
- (buf (cond ((numberp arg)
- (get-buffer-create (format "%s<%d>" name arg)))
- (arg
- (generate-new-buffer name))
- (t
- (get-buffer-create name)))))
+ (buf (cond ((numberp arg)
+ (get-buffer-create (format "%s<%d>" name arg)))
+ (arg
+ (generate-new-buffer name))
+ (t
+ (get-buffer-create name)))))
(pop-to-buffer-same-window buf)
(unless (buffer-modified-p)
(elpher-mode)
- (let ((start-page (elpher-make-page "Elpher Start Page"
- (elpher-make-special-address 'start))))
- (elpher-visit-page start-page))
+ (let ((start-page (elpher-make-page
+ "Elpher Start Page"
+ (elpher-make-special-address 'start))))
+ (elpher-visit-page start-page))
"Started Elpher."))); Otherwise (elpher) evaluates to start page string.
;;; elpher.el ends here