all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mark Oteiza <mvoteiza@udel.edu>
To: emacs-devel@gnu.org
Subject: [PATCH] * lisp/net/eww.el (eww-bookmark-prepare): Use truncate-string-to-width.
Date: Sat, 10 Oct 2015 22:43:44 -0400	[thread overview]
Message-ID: <87bnc6jfa7.fsf@udel.edu> (raw)


`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	other threads:[~2015-10-11  2:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bnc6jfa7.fsf@udel.edu \
    --to=mvoteiza@udel.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.