Make the eww header work again even if the title is nil
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 13 Sep 2020 15:06:35 +0000 (17:06 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 13 Sep 2020 15:06:35 +0000 (17:06 +0200)
* lisp/net/eww.el (eww-update-header-line-format): Don't bug out
if the title isn't set at all.

lisp/net/eww.el

index 5fd449019362222b992d4306af42f611d7023e8e..69dc2d47d6719ea4583503b47312d6456b288f57 100644 (file)
@@ -729,14 +729,15 @@ Currently this means either text/html or application/xhtml+xml."
 (defun eww-update-header-line-format ()
   (setq header-line-format
        (and eww-header-line-format
-            (let ((title (propertize (plist-get eww-data :title)
-                                      'face 'variable-pitch))
-                  (peer (plist-get eww-data :peer))
+            (let ((peer (plist-get eww-data :peer))
                    (url (propertize (plist-get eww-data :url)
-                                    'face 'variable-pitch)))
-              (when (zerop (length title))
-                (setq title (propertize  "[untitled]" 'face 'variable-pitch)))
-              ;; This connection has is https.
+                                    'face 'variable-pitch))
+                   (title (propertize
+                           (if (zerop (length (plist-get eww-data :title)))
+                              "[untitled]"
+                             (plist-get eww-data :title))
+                           'face 'variable-pitch)))
+              ;; This connection is https.
               (when peer
                  (add-face-text-property 0 (length title)
                                         (if (plist-get peer :warnings)