unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31588: 26.1; format counts some Unicode characters as two
@ 2018-05-25  0:36 James P. Ascher
  2018-05-25  0:50 ` Noam Postavsky
  0 siblings, 1 reply; 4+ messages in thread
From: James P. Ascher @ 2018-05-25  0:36 UTC (permalink / raw)
  To: 31588

I've exhausted my ability to debug this one, having ended up in the
C source code, which is a bit beyond me.  I reproduced it with 'emacs
-Q' the following way:

1: Write a dozen x's, i.e. "xxxxxxxxxxxx" on *scratch*.
2: Move pointer to the middle of the line somewhere.
3: M-S-: and call (insert (format "%-2s" '➖))

What I expected:

xxxxx➖ xxxxxxxx

What results:

xxxxxx➖xxxxxxx


In comparison, (insert (format "%-2s" 'z)) gives:

xxxxxxz xxxxxx


And, (insert (format "%-3s" '➖z)) gives:

xxxxxx➖zxxxxxx


The same problem occurs on my setup with ❌ (CROSS MARK).

However, these Unicode items characters work as I expect: ▶ (BLACK
RIGHT-POINTING TRIANGLE), ✚ (HEAVY GREEK CROSS), ▷ (WHITE RIGHT-POINTING
TRIANGLE), and ◼ (BLACK MEDIUM SQUARE).

As far as I can tell, something is off about the styled_format and how
it counts characters- I suspect something about counting
multibyte characters, but it's a little beyond me.

I observed this bug while trying to fix a bug comes from the headers
display of the mu4e package where the overlays that show a deleted flag
are one character too narrow, which displays it incorrectly.


I'm happy to give more info or try other things.  Thanks for all your
hard work on Emacs and I hope this is helpful!

Respectfully submitted,
-James

***The below is NOT my Emacs -Q session, but I left it in case it's
   useful***


In GNU Emacs 26.1 (build 1, x86_64-apple-darwin17.5.0, NS appkit-1561.40 Version 10.13.4 (Build 17E202))
 of 2018-05-17 built on Grumpys-MacBook.local
Windowing system distributor 'Apple', version 10.3.1561
Recent messages:
find-function-C-source: The C source file editfns.c is not available
Note: file is write protected
Mark saved where search started
Quit
nil
Quit
Entering debugger...
Back to top level
Entering debugger...
Back to top level
nil [3 times]
Configured using:
 'configure --disable-dependency-tracking --disable-silent-rules
 --enable-locallisppath=/usr/local/share/emacs/site-lisp
 --infodir=/usr/local/Cellar/emacs/26.1-rc1/share/info/emacs
 --prefix=/usr/local/Cellar/emacs/26.1-rc1 --without-x --with-xml2
 --without-dbus --with-gnutls --with-imagemagick --with-rsvg
 --without-pop --with-ns --disable-ns-self-contained'

Configured features:
JPEG RSVG IMAGEMAGICK NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS
NS THREADS LCMS2

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: C/*l

Minor modes in effect:
  shell-dirtrack-mode: t
  helm-mode: t
  helm-descbinds-mode: t
  async-bytecomp-package-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  beacon-mode: t
  global-diff-hl-mode: t
  diff-hl-mode: t
  diff-auto-refine-mode: t
  global-anzu-mode: t
  anzu-mode: t
  volatile-highlights-mode: t
  save-place-mode: t
  savehist-mode: t
  show-smartparens-global-mode: t
  show-smartparens-mode: t
  global-auto-revert-mode: t
  on-screen-global-mode: t
  global-company-mode: t
  delete-selection-mode: t
  auto-insert-mode: t
  cl-old-struct-compat-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  global-visual-line-mode: t
  visual-line-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Load-path shadows:
/Users/james/.emacs.d/elpa/org-20171225/ob-stan hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-stan
/Users/james/.emacs.d/elpa/org-20171225/ob-exp hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-exp
/Users/james/.emacs.d/elpa/org-20171225/ob-J hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-J
/Users/james/.emacs.d/elpa/org-20171225/org-eshell hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-eshell
/Users/james/.emacs.d/elpa/org-20171225/ob-emacs-lisp hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-emacs-lisp
/Users/james/.emacs.d/elpa/org-20171225/org-gnus hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-gnus
/Users/james/.emacs.d/elpa/org-20171225/ob-css hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-css
/Users/james/.emacs.d/elpa/org-20171225/ob-lob hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-lob
/Users/james/.emacs.d/elpa/org-20171225/ob-forth hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-forth
/Users/james/.emacs.d/elpa/org-20171225/org-macs hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-macs
/Users/james/.emacs.d/elpa/org-20171225/ob hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob
/Users/james/.emacs.d/elpa/org-20171225/org-version hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-version
/Users/james/.emacs.d/elpa/org-20171225/ob-scheme hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-scheme
/Users/james/.emacs.d/elpa/org-20171225/ox hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ox
/Users/james/.emacs.d/elpa/org-20171225/ob-abc hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-abc
/Users/james/.emacs.d/elpa/org-20171225/ob-C hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-C
/Users/james/.emacs.d/elpa/org-20171225/org-capture hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-capture
/Users/james/.emacs.d/elpa/org-20171225/ob-ref hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-ref
/Users/james/.emacs.d/elpa/org-20171225/ob-clojure hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-clojure
/Users/james/.emacs.d/elpa/org-20171225/org-mouse hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-mouse
/Users/james/.emacs.d/elpa/org-20171225/ob-ledger hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-ledger
/Users/james/.emacs.d/elpa/org-20171225/org-ctags hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-ctags
/Users/james/.emacs.d/elpa/org-20171225/org-entities hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-entities
/Users/james/.emacs.d/elpa/org-20171225/org-archive hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-archive
/Users/james/.emacs.d/elpa/org-20171225/ob-screen hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-screen
/Users/james/.emacs.d/elpa/org-20171225/ob-haskell hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-haskell
/Users/james/.emacs.d/elpa/org-20171225/ob-asymptote hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-asymptote
/Users/james/.emacs.d/elpa/org-20171225/org-mhe hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-mhe
/Users/james/.emacs.d/elpa/org-20171225/org-table hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-table
/Users/james/.emacs.d/elpa/org-20171225/ob-keys hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-keys
/Users/james/.emacs.d/elpa/org-20171225/ox-org hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ox-org
/Users/james/.emacs.d/elpa/org-20171225/org-plot hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-plot
/Users/james/.emacs.d/elpa/org-20171225/ob-awk hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-awk
/Users/james/.emacs.d/elpa/org-20171225/ob-groovy hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-groovy
/Users/james/.emacs.d/elpa/org-20171225/ob-octave hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-octave
/Users/james/.emacs.d/elpa/org-20171225/org-faces hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-faces
/Users/james/.emacs.d/elpa/org-20171225/org-colview hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-colview
/Users/james/.emacs.d/elpa/org-20171225/ob-R hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-R
/Users/james/.emacs.d/elpa/org-20171225/org-timer hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-timer
/Users/james/.emacs.d/elpa/org-20171225/ob-ebnf hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-ebnf
/Users/james/.emacs.d/elpa/org-20171225/org-mobile hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-mobile
/Users/james/.emacs.d/elpa/org-20171225/ob-fortran hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-fortran
/Users/james/.emacs.d/elpa/org-20171225/ob-shell hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-shell
/Users/james/.emacs.d/elpa/org-20171225/ob-perl hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-perl
/Users/james/.emacs.d/elpa/org-20171225/ob-sqlite hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-sqlite
/Users/james/.emacs.d/elpa/org-20171225/ob-sed hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-sed
/Users/james/.emacs.d/elpa/org-20171225/org-list hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-list
/Users/james/.emacs.d/elpa/org-20171225/ob-ruby hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-ruby
/Users/james/.emacs.d/elpa/org-20171225/ob-eval hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-eval
/Users/james/.emacs.d/elpa/org-20171225/org-habit hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-habit
/Users/james/.emacs.d/elpa/org-20171225/org-clock hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-clock
/Users/james/.emacs.d/elpa/org-20171225/ox-html hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ox-html
/Users/james/.emacs.d/elpa/org-20171225/org-src hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-src
/Users/james/.emacs.d/elpa/org-20171225/ob-lisp hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-lisp
/Users/james/.emacs.d/elpa/org-20171225/ob-ditaa hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-ditaa
/Users/james/.emacs.d/elpa/org-20171225/org-pcomplete hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-pcomplete
/Users/james/.emacs.d/elpa/org-20171225/org-lint hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-lint
/Users/james/.emacs.d/elpa/org-20171225/org-rmail hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-rmail
/Users/james/.emacs.d/elpa/org-20171225/ox-latex hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ox-latex
/Users/james/.emacs.d/elpa/org-20171225/ob-sass hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-sass
/Users/james/.emacs.d/elpa/org-20171225/ob-io hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-io
/Users/james/.emacs.d/elpa/org-20171225/ob-tangle hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-tangle
/Users/james/.emacs.d/elpa/org-20171225/ob-calc hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-calc
/Users/james/.emacs.d/elpa/org-20171225/ob-java hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-java
/Users/james/.emacs.d/elpa/org-20171225/ox-icalendar hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ox-icalendar
/Users/james/.emacs.d/elpa/org-20171225/org-eww hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-eww
/Users/james/.emacs.d/elpa/org-20171225/ox-md hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ox-md
/Users/james/.emacs.d/elpa/org-20171225/ox-beamer hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ox-beamer
/Users/james/.emacs.d/elpa/org-20171225/org-element hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-element
/Users/james/.emacs.d/elpa/org-20171225/org-protocol hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-protocol
/Users/james/.emacs.d/elpa/org-20171225/ob-mscgen hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-mscgen
/Users/james/.emacs.d/elpa/org-20171225/ob-gnuplot hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-gnuplot
/Users/james/.emacs.d/elpa/org-20171225/ob-latex hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-latex
/Users/james/.emacs.d/elpa/org-20171225/org-id hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-id
/Users/james/.emacs.d/elpa/org-20171225/ob-vala hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-vala
/Users/james/.emacs.d/elpa/org-20171225/ox-man hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ox-man
/Users/james/.emacs.d/elpa/org-20171225/org-feed hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-feed
/Users/james/.emacs.d/elpa/org-20171225/ob-lua hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-lua
/Users/james/.emacs.d/elpa/org-20171225/ob-table hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-table
/Users/james/.emacs.d/elpa/org-20171225/ob-ocaml hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-ocaml
/Users/james/.emacs.d/elpa/org-20171225/ob-coq hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-coq
/Users/james/.emacs.d/elpa/org-20171225/ob-picolisp hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-picolisp
/Users/james/.emacs.d/elpa/org-20171225/org-indent hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-indent
/Users/james/.emacs.d/elpa/org-20171225/ob-lilypond hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-lilypond
/Users/james/.emacs.d/elpa/org-20171225/ob-matlab hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-matlab
/Users/james/.emacs.d/elpa/org-20171225/org-datetree hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-datetree
/Users/james/.emacs.d/elpa/org-20171225/ob-python hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-python
/Users/james/.emacs.d/elpa/org-20171225/org-bbdb hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-bbdb
/Users/james/.emacs.d/elpa/org-20171225/ob-makefile hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-makefile
/Users/james/.emacs.d/elpa/org-20171225/org-duration hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-duration
/Users/james/.emacs.d/elpa/org-20171225/org-agenda hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-agenda
/Users/james/.emacs.d/elpa/org-20171225/ob-dot hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-dot
/Users/james/.emacs.d/elpa/org-20171225/ob-js hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-js
/Users/james/.emacs.d/elpa/org-20171225/ox-publish hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ox-publish
/Users/james/.emacs.d/elpa/org-20171225/org-inlinetask hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-inlinetask
/Users/james/.emacs.d/elpa/org-20171225/ob-org hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-org
/Users/james/.emacs.d/elpa/org-20171225/ob-core hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-core
/Users/james/.emacs.d/elpa/org-20171225/org-compat hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-compat
/Users/james/.emacs.d/elpa/org-20171225/org-docview hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-docview
/Users/james/.emacs.d/elpa/org-20171225/ox-odt hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ox-odt
/Users/james/.emacs.d/elpa/org-20171225/ob-plantuml hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-plantuml
/Users/james/.emacs.d/elpa/org-20171225/ox-ascii hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ox-ascii
/Users/james/.emacs.d/elpa/org-20171225/org-loaddefs hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-loaddefs
/Users/james/.emacs.d/elpa/org-20171225/org-w3m hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-w3m
/Users/james/.emacs.d/elpa/org-20171225/org-bibtex hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-bibtex
/Users/james/.emacs.d/elpa/org-20171225/org-info hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-info
/Users/james/.emacs.d/elpa/org-20171225/ob-hledger hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-hledger
/Users/james/.emacs.d/elpa/org-20171225/ob-maxima hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-maxima
/Users/james/.emacs.d/elpa/org-20171225/org hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org
/Users/james/.emacs.d/elpa/org-20171225/org-macro hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-macro
/Users/james/.emacs.d/elpa/org-20171225/ob-sql hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-sql
/Users/james/.emacs.d/elpa/org-20171225/org-attach hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-attach
/Users/james/.emacs.d/elpa/org-20171225/ob-processing hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-processing
/Users/james/.emacs.d/elpa/org-20171225/ox-texinfo hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ox-texinfo
/Users/james/.emacs.d/elpa/org-20171225/org-irc hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-irc
/Users/james/.emacs.d/elpa/org-20171225/org-crypt hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-crypt
/Users/james/.emacs.d/elpa/org-20171225/org-footnote hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-footnote
/Users/james/.emacs.d/elpa/org-20171225/org-install hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/org-install
/Users/james/.emacs.d/elpa/org-20171225/ob-comint hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-comint
/Users/james/.emacs.d/elpa/org-20171225/ob-shen hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/org/ob-shen
/Users/james/.emacs.d/elpa/seq-20151121.1017/seq hides /usr/local/Cellar/emacs/26.1-rc1/share/emacs/26.1/lisp/emacs-lisp/seq

Features:
(shadow company-oddmuse company-keywords company-etags company-gtags
company-dabbrev-code company-dabbrev company-files company-capf
company-cmake company-xcode company-clang company-semantic company-eclim
company-template company-bbdb face-remap bbdb-mu4e emacsbug helm-command
cl-print debug cc-mode-expansions cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs image-file tramp
tramp-compat tramp-loaddefs trampver shell parse-time eieio-opt help-fns
radix-tree winner helm-elisp helm-eval edebug helm-info misearch
multi-isearch goto-addr disp-table fill-column-indicator view
jpsa-config smartparens-markdown markdown-mode iso-transl helm-mode
helm-files helm-buffers helm-tags helm-locate helm-grep helm-regexp
helm-types helm-descbinds helm-mu bbdb-mua bbdb-com crm bbdb bbdb-site
org-mu4e mu4e desktop frameset mu4e-speedbar speedbar sb-image ezimage
dframe mu4e-main mu4e-view mu4e-headers mu4e-compose mu4e-context
mu4e-draft mu4e-actions rfc2368 smtpmail sendmail mu4e-mark mu4e-message
html2text mu4e-proc mu4e-utils doc-view mu4e-lists mu4e-vars mu4e-meta
darkroom org-ref org-ref-helm-bibtex org-ref-helm helm-utils helm-bibtex
bibtex-completion biblio biblio-download biblio-dissemin biblio-hal
biblio-dblp biblio-crossref biblio-arxiv timezone biblio-doi biblio-core
let-alist url-queue ido helm-net browse-url helm-help helm helm-source
helm-multi-match helm-lib helm-config helm-easymenu async-bytecomp async
org-ref-core reftex-cite reftex reftex-loaddefs reftex-vars parsebib
org-ref-glossary org-ref-bibtex org-ref-citeproc message rfc822 mml
mml-sec epa derived epg mm-decode mm-bodies mm-encode mailabbrev
gmm-utils mailheader key-chord doi-utils org-ref-utils org-ref-pdf
pdf-tools pdf-view bookmark pp jka-compr pdf-cache pdf-info pdf-util
image-mode url-http tls gnutls url-auth mail-parse rfc2231 url-gw nsm
rmc puny org-bibtex bibtex htmlize f s doremi-cmd cus-theme cus-edit
doremi smart-mode-line rich-minority cl-extra yasnippet elec-pair
rainbow-mode color move-text flow-fill beacon diff-hl smartrep vc-dir
ewoc vc vc-dispatcher diff-mode midnight anzu artbollocks-mode typo
flyspell ispell diminish volatile-highlights saveplace savehist
smartparens-config smartparens-text smartparens-org smartparens-haskell
smartparens help-mode autorevert filenotify paradox paradox-menu
paradox-commit-list hydra lv paradox-execute paradox-github paradox-core
spinner subr-x server expand-region text-mode-expansions
the-org-mode-expansions er-basic-expansions expand-region-core
expand-region-custom wc-mode twittering-mode emms-librefm-stream xml
emms-librefm-scrobbler emms-playlist-limit emms-volume
emms-volume-amixer emms-i18n emms-history emms-score emms-stream-info
emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon
emms-browser sort emms-playlist-sort emms-last-played emms-player-xine
emms-player-mpd tq emms-playing-time emms-lyrics emms-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
mailcap emms-streams emms-show-all emms-tag-editor emms-mark
emms-mode-line emms-cache emms-info-opusinfo emms-info-ogginfo
emms-info-mp3info emms-info later-do emms-playlist-mode emms-player-vlc
emms-player-mpv emms-player-mplayer emms-player-simple
emms-source-playlist emms-source-file locate dired dired-loaddefs
emms-setup emms emms-compat ox-pandoc ht dash ox-org ox-odt rng-loc
rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns
nxml-enc xmltok nxml-util ox-latex ox-icalendar ox-html table ox-ascii
ox-publish ox org-mobile org-agenda org-element avl-tree generator org
advice org-macro org-footnote org-pcomplete pcomplete org-list org-faces
org-entities org-version ob-emacs-lisp ob-dot ob ob-tangle org-src
ob-ref ob-lob ob-table ob-keys ob-exp ob-comint ob-core ob-eval
org-compat org-macs org-loaddefs format-spec find-func cal-menu calendar
cal-loaddefs haskell-interactive-mode haskell-presentation-mode
haskell-process haskell-session url-util json map haskell-compile
haskell-mode haskell-cabal haskell-utils haskell-font-lock
haskell-indentation haskell-string haskell-sort-imports haskell-lexeme
haskell-align-imports haskell-compat haskell-complete-module
haskell-ghc-support noutline outline easy-mmode etags xref project
dabbrev haskell-customize rnc-mode imenu flymake-proc flymake compile
comint ansi-color ring warnings thingatpt brew-site-lisp ibuf-ext
ibuffer ibuffer-loaddefs on-screen hexrgb gnus nnheader gnus-util rmail
rmail-loaddefs rfc2047 rfc2045 ietf-drums time-date mail-utils mm-util
mail-prsvr wid-edit hl-line company pcase delsel autoinsert cus-start
cus-load finder-inf tex-site gh-common marshal eieio-compat edmacro
kmacro kotl-autoloads rx cl info package easymenu epg-config
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote kqueue cocoa ns lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 726503 287766)
 (symbols 48 60406 16)
 (miscs 40 1370 5657)
 (strings 32 182852 46734)
 (string-bytes 1 6300425)
 (vectors 16 90528)
 (vector-slots 8 1357542 342774)
 (floats 8 578 1489)
 (intervals 56 2034 1087)
 (buffers 992 28))





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#31588: 26.1; format counts some Unicode characters as two
  2018-05-25  0:36 bug#31588: 26.1; format counts some Unicode characters as two James P. Ascher
@ 2018-05-25  0:50 ` Noam Postavsky
  2018-05-25  6:37   ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Noam Postavsky @ 2018-05-25  0:50 UTC (permalink / raw)
  To: James P. Ascher; +Cc: 31588

[-- Attachment #1: Type: text/plain, Size: 954 bytes --]

"James P. Ascher" <jpa4q@virginia.edu> writes:

> 3: M-S-: and call (insert (format "%-2s" '➖))
>
> What I expected:
>
> xxxxx➖ xxxxxxxx
>
> What results:
>
> xxxxxx➖xxxxxxx
>
>
> In comparison, (insert (format "%-2s" 'z)) gives:
>
> xxxxxxz xxxxxx

> The same problem occurs on my setup with ❌ (CROSS MARK).
>
> However, these Unicode items characters work as I expect: ▶ (BLACK
> RIGHT-POINTING TRIANGLE), ✚ (HEAVY GREEK CROSS), ▷ (WHITE RIGHT-POINTING
> TRIANGLE), and ◼ (BLACK MEDIUM SQUARE).
>
> As far as I can tell, something is off about the styled_format and how
> it counts characters- I suspect something about counting
> multibyte characters, but it's a little beyond me.

I think it's intended, ➖ and ❌ are wide characters:

    (mapcar #'char-width '(?➖ ?❌ ?▶ ?✚ ?▷ ?◼))
    ;=> (2 2 1 1 1 1)

Although in my current font the width seems to be more like 1.8 or
something.


[-- Attachment #2: screenshot of the characters --]
[-- Type: image/png, Size: 3321 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#31588: 26.1; format counts some Unicode characters as two
  2018-05-25  0:50 ` Noam Postavsky
@ 2018-05-25  6:37   ` Eli Zaretskii
  2018-06-03 16:29     ` Noam Postavsky
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2018-05-25  6:37 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 31588, jpa4q

> From: Noam Postavsky <npostavs@gmail.com>
> Date: Thu, 24 May 2018 20:50:45 -0400
> Cc: 31588@debbugs.gnu.org
> 
> > As far as I can tell, something is off about the styled_format and how
> > it counts characters- I suspect something about counting
> > multibyte characters, but it's a little beyond me.
> 
> I think it's intended, ➖ and ❌ are wide characters:
> 
>     (mapcar #'char-width '(?➖ ?❌ ?▶ ?✚ ?▷ ?◼))
>     ;=> (2 2 1 1 1 1)

Yes, that's the reason.

> Although in my current font the width seems to be more like 1.8 or
> something.

Unfortunately, the actual width depends on the font, and what's more,
sometimes varies significantly between different fonts.  Maybe we
should have a variant of char-width that actually looks at the font
(of course, such a variant will need a window or frame as one of its
arguments).

But with the current state of our support for wide characters, this is
not a bug.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#31588: 26.1; format counts some Unicode characters as two
  2018-05-25  6:37   ` Eli Zaretskii
@ 2018-06-03 16:29     ` Noam Postavsky
  0 siblings, 0 replies; 4+ messages in thread
From: Noam Postavsky @ 2018-06-03 16:29 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 31588, jpa4q

close 31588
quit

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Noam Postavsky <npostavs@gmail.com>
>> Date: Thu, 24 May 2018 20:50:45 -0400
>> Cc: 31588@debbugs.gnu.org
>> 
>> > As far as I can tell, something is off about the styled_format and how
>> > it counts characters- I suspect something about counting
>> > multibyte characters, but it's a little beyond me.
>> 
>> I think it's intended, ➖ and ❌ are wide characters:
>> 
>>     (mapcar #'char-width '(?➖ ?❌ ?▶ ?✚ ?▷ ?◼))
>>     ;=> (2 2 1 1 1 1)
>
> Yes, that's the reason.
>
>> Although in my current font the width seems to be more like 1.8 or
>> something.
>
> Unfortunately, the actual width depends on the font, and what's more,
> sometimes varies significantly between different fonts.  Maybe we
> should have a variant of char-width that actually looks at the font
> (of course, such a variant will need a window or frame as one of its
> arguments).

Well, I don't know if format could do anything useful with a non-integer
width anyway.

> But with the current state of our support for wide characters, this is
> not a bug.

Okay, I'm closing this report.






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-06-03 16:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-25  0:36 bug#31588: 26.1; format counts some Unicode characters as two James P. Ascher
2018-05-25  0:50 ` Noam Postavsky
2018-05-25  6:37   ` Eli Zaretskii
2018-06-03 16:29     ` 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).