emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] * lisp/net/eww.el (eww-bookmark-prepare): Use truncate-string-to


From: Mark Oteiza
Subject: [PATCH] * lisp/net/eww.el (eww-bookmark-prepare): Use truncate-string-to-width.
Date: Sat, 10 Oct 2015 22:43:44 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

`substring' does not account for full width characters.
---

I messed up my last commit message, sorry!

 lisp/net/eww.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index d44890f..a46e2c4 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1493,7 +1493,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))))
-- 
2.6.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]