* bug#17822: bs-show with mulitbyte characters doesn't work well
@ 2014-06-20 17:25 Shigeru Fukaya
2014-06-20 19:16 ` Stefan Monnier
0 siblings, 1 reply; 4+ messages in thread
From: Shigeru Fukaya @ 2014-06-20 17:25 UTC (permalink / raw)
To: 17822
`bs-show' displays buffer information on incorrect column position.
It is because `bs-show' calculates column using `length' for multibyte
strings.
Just changing `length' to `string-width' in `bs-show-in-buffer' and
`bs--insert-one-entry' will solve the problem.
Regards,
Shigeru
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#17822: bs-show with mulitbyte characters doesn't work well
2014-06-20 17:25 bug#17822: bs-show with mulitbyte characters doesn't work well Shigeru Fukaya
@ 2014-06-20 19:16 ` Stefan Monnier
2014-06-21 3:35 ` Shigeru Fukaya
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2014-06-20 19:16 UTC (permalink / raw)
To: Shigeru Fukaya; +Cc: 17822
> `bs-show' displays buffer information on incorrect column position.
> It is because `bs-show' calculates column using `length' for multibyte
> strings.
> Just changing `length' to `string-width' in `bs-show-in-buffer' and
> `bs--insert-one-entry' will solve the problem.
Indeed (tho this is not a "multibyte" problem, but a problem with
double-width chars).
Can you provide a patch?
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#17822: bs-show with mulitbyte characters doesn't work well
2014-06-20 19:16 ` Stefan Monnier
@ 2014-06-21 3:35 ` Shigeru Fukaya
2018-09-19 23:02 ` Noam Postavsky
0 siblings, 1 reply; 4+ messages in thread
From: Shigeru Fukaya @ 2014-06-21 3:35 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 17822
[-- Attachment #1: Type: text/plain, Size: 438 bytes --]
>> `bs-show' displays buffer information on incorrect column position.
>> It is because `bs-show' calculates column using `length' for multibyte
>> strings.
>
>> Just changing `length' to `string-width' in `bs-show-in-buffer' and
>> `bs--insert-one-entry' will solve the problem.
>
>Indeed (tho this is not a "multibyte" problem, but a problem with
>double-width chars).
Oh, I'll remember the term.
>Can you provide a patch?
OK
Shigeru
[-- Attachment #2: bs.diff --]
[-- Type: application/octet-stream, Size: 777 bytes --]
--- orig/bs.el 2014-03-21 14:34:40.000000000 +0900
+++ ./bs.el 2014-06-21 12:26:39.114537800 +0900
@@ -1128,7 +1128,7 @@ and move point to current buffer."
(bs-mode)
(let* ((inhibit-read-only t)
(map-fun (lambda (entry)
- (length (buffer-name entry))))
+ (string-width (buffer-name entry))))
(max-length-of-names (apply 'max
(cons 0 (mapcar map-fun list))))
(name-entry-length (min bs-maximal-buffer-name-column
@@ -1340,7 +1340,7 @@ normally *buffer-selection*."
apply-args)
(nth 3 column) ; align
(- min to-much)))
- (len (length new-string)))
+ (len (string-width new-string)))
(setq string (concat string new-string))
(when (> len min)
(setq to-much (- len min))))))
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#17822: bs-show with mulitbyte characters doesn't work well
2014-06-21 3:35 ` Shigeru Fukaya
@ 2018-09-19 23:02 ` Noam Postavsky
0 siblings, 0 replies; 4+ messages in thread
From: Noam Postavsky @ 2018-09-19 23:02 UTC (permalink / raw)
To: Shigeru Fukaya; +Cc: Stefan Monnier, 17822
tags 17822 fixed
close 17822 26.2
quit
Shigeru Fukaya <shigeru.fukaya@gmail.com> writes:
>>Can you provide a patch?
> OK
>
> Shigeru
>
> --- orig/bs.el 2014-03-21 14:34:40.000000000 +0900
> +++ ./bs.el 2014-06-21 12:26:39.114537800 +0900
Pushed to emacs-26.
[1: 98544ea3ea]: 2018-09-19 18:48:07 -0400
Fix bs-show with wide characters (Bug#17822)
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=98544ea3ea1638228db48c5ff993caded470d9c1
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-09-19 23:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-20 17:25 bug#17822: bs-show with mulitbyte characters doesn't work well Shigeru Fukaya
2014-06-20 19:16 ` Stefan Monnier
2014-06-21 3:35 ` Shigeru Fukaya
2018-09-19 23:02 ` Noam Postavsky
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).