X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=elpher.git;a=blobdiff_plain;f=elpher.el;h=3e71cae9d031f52666af7488d8d25c3322ed42d4;hp=f94b33f22c3b42cf6d3540da8a20ce60a2752872;hb=b3364328aec2d3164ce30ff65a0ddce3e698a281;hpb=e3fca3512d458c4a78ef9b3d87b66e952f2b5f94 diff --git a/elpher.el b/elpher.el index f94b33f..3e71cae 100644 --- a/elpher.el +++ b/elpher.el @@ -399,6 +399,11 @@ 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) @@ -1492,7 +1497,12 @@ width defined by `elpher-gemini-max-fill-width'." (propertize text-line 'face 'elpher-gemini-quoted)) (t text-line)) text-line)) - (adaptive-fill-mode t)) + (adaptive-fill-mode t) + ;; fill-prefix is important for adaptive-fill-mode: without + ;; it, multi-line list items are not indented correct + (fill-prefix (if (match-string 2 text-line) + (replace-regexp-in-string "[>\*]" " " (match-string 0 text-line)) + nil))) (insert (elpher-process-text-for-display processed-text-line)) (newline))) @@ -1930,7 +1940,8 @@ When run interactively HOST-OR-URL is read from the minibuffer." (address (elpher-address-from-url cleaned-host-or-url)) (page (elpher-make-page cleaned-host-or-url address))) (switch-to-buffer elpher-buffer-name) - (elpher-visit-page page) + (elpher-with-clean-buffer + (elpher-visit-page page)) nil)) (defun elpher-go-current () @@ -1990,9 +2001,7 @@ When run interactively HOST-OR-URL is read from the minibuffer." (interactive) (setq-local elpher-current-page nil) (setq-local elpher-history nil) - (let ((start-page (elpher-make-page "Elpher Start Page" - (elpher-make-special-address 'start)))) - (elpher-visit-page start-page))) + (elpher-visit-page (elpher-make-start-page))) (defun elpher-download () "Download the link at point." @@ -2288,10 +2297,7 @@ to create a new session. Returns the buffer selected (or created)." (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)) + (elpher-visit-page (elpher-make-start-page)) "Started Elpher."))); Otherwise (elpher) evaluates to start page string. ;;; elpher.el ends here