aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2020-09-13 18:51:44 +0200
committerLars Ingebrigtsen2020-09-13 18:51:51 +0200
commitf9aa499afa2f65952b5ec7905bf836f6a2ccbfd4 (patch)
tree0b091e0a5f3f68ad02c1f72799cdb70763502ccf
parent2c62e9b20dcf615a283e8fce2b7b74981b15ae67 (diff)
downloademacs-f9aa499afa2f65952b5ec7905bf836f6a2ccbfd4.tar.gz
emacs-f9aa499afa2f65952b5ec7905bf836f6a2ccbfd4.zip
Further fixups of the variable-pitch eww header line change
* lisp/net/eww.el (eww-update-header-line-format): Protect against :url not being set.
-rw-r--r--lisp/net/eww.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 69dc2d47d67..2717dfbe79d 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -730,8 +730,7 @@ Currently this means either text/html or application/xhtml+xml."
730 (setq header-line-format 730 (setq header-line-format
731 (and eww-header-line-format 731 (and eww-header-line-format
732 (let ((peer (plist-get eww-data :peer)) 732 (let ((peer (plist-get eww-data :peer))
733 (url (propertize (plist-get eww-data :url) 733 (url (plist-get eww-data :url))
734 'face 'variable-pitch))
735 (title (propertize 734 (title (propertize
736 (if (zerop (length (plist-get eww-data :title))) 735 (if (zerop (length (plist-get eww-data :title)))
737 "[untitled]" 736 "[untitled]"
@@ -747,10 +746,13 @@ Currently this means either text/html or application/xhtml+xml."
747 ;; Limit the length of the title so that the host name 746 ;; Limit the length of the title so that the host name
748 ;; of the URL is always visible. 747 ;; of the URL is always visible.
749 (when url 748 (when url
749 (setq url (propertize url 'face 'variable-pitch))
750 (let* ((parsed (url-generic-parse-url url)) 750 (let* ((parsed (url-generic-parse-url url))
751 (host-length (shr-string-pixel-width 751 (host-length (shr-string-pixel-width
752 (format "%s://%s" (url-type parsed) 752 (propertize
753 (url-host parsed)))) 753 (format "%s://%s" (url-type parsed)
754 (url-host parsed))
755 'face 'variable-pitch)))
754 (width (window-width nil t))) 756 (width (window-width nil t)))
755 (cond 757 (cond
756 ;; The host bit is wider than the window, so nix 758 ;; The host bit is wider than the window, so nix