From: plugd Date: Wed, 4 Aug 2021 09:14:52 +0000 (+0200) Subject: Bug fix: elpher-go was erroring out when elpher wasn't already open. X-Git-Tag: v3.2.2~1 X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=elpher.git;a=commitdiff_plain;h=ddad56dc4f9ac2d6710302a9b2bf0cc086bae66c Bug fix: elpher-go was erroring out when elpher wasn't already open. --- diff --git a/elpher.el b/elpher.el index fbdc953..cfaa2d4 100644 --- a/elpher.el +++ b/elpher.el @@ -225,7 +225,7 @@ Otherwise, \\[elpher-show-bookmarks] will visit a special elpher bookmark page within which all of the standard elpher keybindings are active." :type '(boolean)) -(defcustom elpher-start-page "about:welcome" +(defcustom elpher-start-page-url "about:welcome" "Specify the page displayed initially by elpher. The default welcome screen is \"about:welcome\", while the bookmarks list is \"about:bookmarks\". You can also specify local files via \"file:\". @@ -482,9 +482,9 @@ If no address is defined, returns 0. (This is for compatibility with the URL li (list display-string address)) (defun elpher-make-start-page () - "Create the welcome page." + "Create the start page." (elpher-make-page "Start Page" - (elpher-address-from-url elpher-start-page))) + (elpher-address-from-url elpher-start-page-url))) (defun elpher-page-display-string (page) "Retrieve the display string corresponding to PAGE." @@ -582,7 +582,7 @@ previously-visited pages,unless NO-HISTORY is non-nil." (defun elpher-update-header () "If `elpher-use-header' is true, display current page info in window header." - (if elpher-use-header + (if (and elpher-use-header elpher-current-page) (let* ((display-string (elpher-page-display-string elpher-current-page)) (sanitized-display-string (replace-regexp-in-string "%" "%%" display-string)) (address (elpher-page-address elpher-current-page)) diff --git a/elpher.texi b/elpher.texi index 564e390..a799134 100644 --- a/elpher.texi +++ b/elpher.texi @@ -745,7 +745,7 @@ elpher starts, and when @key{U} is pressed. By default this is set to @samp{about:welcome}, but any URL can be substituted. For example, you might want to create a text/gemini file named @samp{~/.emacs/start-page.gmi} containing useful links and set the value -of @code{elpher-start-page} to @samp{file:~/.emacs/start-page.gmi} to have +of @code{elpher-start-page-url} to @samp{file:~/.emacs/start-page.gmi} to have these links displayed at startup. Alternatively, you might prefer to set the value to @samp{about:bookmarks} so that the bookmarks page is used as the start page instead. @@ -783,7 +783,7 @@ for details. @subsection Customizable start pages -The new customization variable @code{elpher-start-page} contains the URL +The new customization variable @code{elpher-start-page-url} contains the URL of the document to be loaded as elpher's ``start page''. By default this is set to @samp{about:welcome}, but any elpher-accessible URL is valid. @pxref{Customization} for suggestions.