X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=elpher.git;a=blobdiff_plain;f=elpher.el;h=a108518ee409f369aab362f9ed3ffa170871c2f9;hp=0888870b9553bd77417b483f7f7bb4e61fdff3fb;hb=48342f4df45b76756677c47e5205f6a4acdd370f;hpb=643f0bc0617e043190bbcd55579f39902bb1cd91 diff --git a/elpher.el b/elpher.el index 0888870..a108518 100644 --- a/elpher.el +++ b/elpher.el @@ -92,13 +92,13 @@ (lambda (s) (let ((_xterm-color-render nil)) (xterm-color-filter s))) - 'ansi-color-filter-apply) + #'ansi-color-filter-apply) "A function to filter out ANSI escape sequences.") (defalias 'elpher-color-apply (if (fboundp 'xterm-color-filter) - 'xterm-color-filter - 'ansi-color-apply) + #'xterm-color-filter + #'ansi-color-apply) "A function to apply ANSI escape sequences.") ;;; Global constants @@ -138,12 +138,15 @@ ;; (eval-when-compile - (defvar bookmark-make-record-function) + (declare-function ansi-color-filter-apply "ansi-color") + (declare-function ansi-color-apply "ansi-color") (declare-function bookmark-store "bookmark") (declare-function org-link-store-props "ol") (declare-function org-link-set-parameters "ol") - (defvar thing-at-point-uri-schemes) - (defvar mu4e~view-beginning-of-url-regexp)) + (defvar ansi-color-context) + (defvar bookmark-make-record-function) + (defvar mu4e~view-beginning-of-url-regexp) + (defvar thing-at-point-uri-schemes)) ;;; Customization group @@ -389,11 +392,6 @@ requiring gopher-over-TLS." "Create an ADDRESS object corresponding to the given special address symbol TYPE." type) -(defun elpher-make-start-page () - "Create the start page." - (elpher-make-page "Elpher Start Page" - (elpher-make-special-address 'start))) - (defun elpher-address-to-url (address) "Get string representation of ADDRESS, or nil if ADDRESS is special." (if (elpher-address-special-p address) @@ -493,6 +491,11 @@ If no address is defined, returns 0. (This is for compatibility with the URL li "Create a page with DISPLAY-STRING and ADDRESS." (list display-string address)) +(defun elpher-make-start-page () + "Create the start page." + (elpher-make-page "Elpher Start Page" + (elpher-make-special-address 'start))) + (defun elpher-page-display-string (page) "Retrieve the display string corresponding to PAGE." (elt page 0)) @@ -600,7 +603,8 @@ previously-visited pages,unless NO-HISTORY is non-nil." (unless (eq major-mode 'elpher-mode) ;; avoid resetting buffer-local variables (elpher-mode)) - (let ((inhibit-read-only t)) + (let ((inhibit-read-only t) + (ansi-color-context nil)) ;; clean ansi interpreter state (setq-local network-security-level (default-value 'network-security-level)) (erase-buffer) @@ -1457,7 +1461,6 @@ treatment that a separate function is warranted." (insert (propertize display-string 'face 'elpher-unknown))) (insert "\n")))) -;; buffer-local (defvar elpher--gemini-page-headings nil "List of headings on the page.")