summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/net/eww.el21
2 files changed, 15 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 50df1cd3253..287352cdb0d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * net/eww.el (eww-bookmark-prepare): Display URLs in first by
+ displaying shortened titles first (bug#16398).
+
2014-12-07 Tom Willemse <tom@ryuslash.org> (tiny change)
* progmodes/python.el: Recognize docstrings.
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index e88afb50326..c1ba4294905 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1440,19 +1440,18 @@ Differences in #targets are ignored."
(user-error "No bookmarks are defined"))
(set-buffer (get-buffer-create "*eww bookmarks*"))
(eww-bookmark-mode)
- (let ((format "%-40s %s")
- (inhibit-read-only t)
- start url)
+ (let* ((width (/ (window-width) 2))
+ (format (format "%%-%ds %%s" width))
+ (inhibit-read-only t)
+ start title)
(erase-buffer)
- (setq header-line-format (concat " " (format format "URL" "Title")))
+ (setq header-line-format (concat " " (format format "Title" "URL")))
(dolist (bookmark eww-bookmarks)
- (setq start (point))
- (setq url (plist-get bookmark :url))
- (when (> (length url) 40)
- (setq url (substring url 0 40)))
- (insert (format format url
- (plist-get bookmark :title))
- "\n")
+ (setq start (point)
+ title (plist-get bookmark :title))
+ (when (> (length title) width)
+ (setq title (substring title 0 width)))
+ (insert (format format title (plist-get bookmark :url)) "\n")
(put-text-property start (1+ start) 'eww-bookmark bookmark))
(goto-char (point-min))))