From: Liu Hui <liuhui1610@gmail.com>
To: Mark Oteiza <mvoteiza@udel.edu>
Cc: 24972@debbugs.gnu.org
Subject: bug#24972: 26.0.50; Multibyte characters are misaligned in ibuffer
Date: Tue, 22 Nov 2016 14:54:06 +0800 [thread overview]
Message-ID: <6741c150-d985-26a3-5872-cd25e3b5ce02@gmail.com> (raw)
In-Reply-To: <20161122051216.GA14073@holos.localdomain>
在 2016年11月22日 13:12, Mark Oteiza 写道:
> On 22/11/16 at 11:51am, Liu Hui wrote:
>> Thank you, but the trailing "..." is missing for long buffer names, no
>> matter whether they contain multibyte characters. For example,
>> "01234567890123456789" becomes "012345678901234567". The normal result
>> should be "012345678901234...".
>
> Would you try the following?
>
> diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
> index faadb67..c550b7d 100644
> --- a/lisp/ibuffer.el
> +++ b/lisp/ibuffer.el
> @@ -1559,16 +1559,17 @@ ibuffer-compile-make-eliding-form
> `(concat ,ellipsis
> (substring ,strvar
> (string-width ibuffer-eliding-string)))
> - `(truncate-string-to-width
> - ,strvar strlen nil nil
> - ,ellipsis))
> + `(concat
> + (truncate-string-to-width
> + ,strvar (- strlen (string-width ,ellipsis)) nil ?.)
> + ,ellipsis))
> ,strvar)
> strvar)))
>
> (defun ibuffer-compile-make-substring-form (strvar maxvar from-end-p)
> (if from-end-p
> - `(truncate-string-to-width str (string-width str) (- strlen ,maxvar))
> - `(truncate-string-to-width ,strvar ,maxvar)))
> + `(truncate-string-to-width str (string-width str) (- strlen ,maxvar) nil ?\s)
> + `(truncate-string-to-width ,strvar ,maxvar nil ?\s)))
>
> (defun ibuffer-compile-make-format-form (strvar widthform alignment)
> (let* ((left `(make-string tmp2 ?\s))
>
It works very well. Thank you.
next prev parent reply other threads:[~2016-11-22 6:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-20 12:32 bug#24972: 26.0.50; Multibyte characters are misaligned in ibuffer Liu Hui
2016-11-20 18:58 ` Mark Oteiza
2016-11-21 6:00 ` Liu Hui
2016-11-21 9:35 ` Mark Oteiza
2016-11-22 3:51 ` Liu Hui
2016-11-22 5:12 ` Mark Oteiza
2016-11-22 6:54 ` Liu Hui [this message]
2016-11-22 7:49 ` Mark Oteiza
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=6741c150-d985-26a3-5872-cd25e3b5ce02@gmail.com \
--to=liuhui1610@gmail.com \
--cc=24972@debbugs.gnu.org \
--cc=mvoteiza@udel.edu \
/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.