]> code.delx.au - gnu-emacs/commitdiff
* lisp/net/eww.el (eww-bookmark-prepare): Use truncate-string-to-width.
authorMark Oteiza <mvoteiza@udel.edu>
Sun, 11 Oct 2015 02:43:44 +0000 (22:43 -0400)
committerMark Oteiza <mvoteiza@udel.edu>
Mon, 26 Oct 2015 16:15:50 +0000 (12:15 -0400)
`substring' does not account for full width characters.

lisp/net/eww.el

index 6a315496fe074b8a38441d3dffad70a311888282..5748e88bbca9d7d2a500bcd7877e230231b549e0 100644 (file)
@@ -1501,7 +1501,7 @@ If CHARSET is nil then use UTF-8."
       (setq start (point)
            title (plist-get bookmark :title))
       (when (> (length title) width)
-       (setq title (substring title 0 width)))
+       (setq title (truncate-string-to-width title width)))
       (insert (format format title (plist-get bookmark :url)) "\n")
       (put-text-property start (1+ start) 'eww-bookmark bookmark))
     (goto-char (point-min))))