all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 3452@emacsbugs.donarmstrong.com, cyd@stupidchicken.com
Subject: bug#3452: 23.0.94; display
Date: Mon, 08 Jun 2009 20:57:06 +0900	[thread overview]
Message-ID: <E1MDdTO-00031x-Np@etlken> (raw)
In-Reply-To: <E1MDaTK-0001yD-LX@fencepost.gnu.org> (message from Eli Zaretskii on Mon, 08 Jun 2009 04:44:50 -0400)

In article <E1MDaTK-0001yD-LX@fencepost.gnu.org>, Eli Zaretskii <eliz@gnu.org> writes:

> > From: Kenichi Handa <handa@m17n.org>
> > CC: 3452@emacsbugs.donarmstrong.com, cyd@stupidchicken.com
> > Date: Mon, 08 Jun 2009 17:10:27 +0900
> > 
> > Not for U+202D, but such combining characters as U+0300 are
> > treated correctly by xterm (not by gnome-terminal).
> > 
> > > > To conclude, I think there's not that much we can do for
> > > > this situation.  I think the current behaviour of
> > > > gnome-terminal (displaying standalone U+202D as a space of
> > > > width 1) is a bug.
> > 
> > > If other terminals behave correctly, I would agree.  But if not,
> > > perhaps we need to work around this, if possible.  For example, we
> > > could have an entry in display tables for these characters.
> > 
> > It seems xterm, gnome-terminal, GNU/Linux console, and
> > mlterm treat U+202D as spacing character, but, Konsole
> > (KDE's terminal) and kterm treats it as non-spacing
> > character.

> Wasn't gnome-terminal the one that started this bug report?

I don't know exactly.  RMS's bug report just says "a 37-line
Linux terminal".

> And you even tell above that gnome-terminal does NOT treat
> U+202D correctly.  So which terminals do?

> If xterm, the Linux console and mlterm do work, then maybe your
> suggestion to do nothing is good enough.

??? I wrote "Konsole and kterm" treats U+202D as non-spacing
character.  I think that is the correct way, and the others
(gnome-terminal, xterm, and Linux console) are wrong.

> Btw, what do you think about my idea to add a display table entry for
> these characters?

A display table is used both for terminal and window system,
but, on a window system, some font may have special glyphs
for those characters.  If we setup a display table for
U+202D, Emacs can't display U+202D by such a glyph on window
system.

So, if we implement some work-around for such terminal as
gnome-terminal, I think it is better to modify
compose-gstring-for-terminal so that it replaces U+202D
(actually all zero-width characters of Unicode category Cf)
with a single SPACE instead of prepending a SPACE.  Please
try the attached patch.

---
Kenichi Handa
handa@m17n.org

--- composite.el.~1.46.~	2009-04-20 10:11:33.000000000 +0900
+++ composite.el	2009-06-08 20:45:50.000000000 +0900
@@ -681,7 +681,14 @@
 	      (lglyph-set-from-to glyph i i)
 	      (setq i (1+ i))))
 	(if (= (lglyph-width glyph) 0)
-	    (progn
+	    (if (eq (get-char-code-property (lglyph-char glyph)
+					    'general-category)
+		    'Cf)
+		(progn
+		  ;; Compose by replacing with a space.
+		  (lglyph-set-char glyph 32)
+		  (lglyph-set-width glyph 1)
+		  (setq i (1+ i)))
 	      ;; Compose by prepending a space.
 	      (setq gstring (lgstring-insert-glyph gstring i
 						   (lglyph-copy glyph))





  reply	other threads:[~2009-06-08 11:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-07  3:47 bug#3452: 23.0.94; display Chong Yidong
2009-06-07  9:16 ` Eli Zaretskii
2009-06-07 13:56   ` Chong Yidong
2009-06-07 14:30     ` Eli Zaretskii
2009-06-07 20:41   ` Chong Yidong
2009-06-07 22:53     ` Eli Zaretskii
2009-06-08  1:51 ` Kenichi Handa
2009-06-08  4:48   ` Eli Zaretskii
2009-06-08  8:10     ` Kenichi Handa
2009-06-08  8:44       ` Eli Zaretskii
2009-06-08 11:57         ` Kenichi Handa [this message]
2009-06-08 14:47           ` Chong Yidong
2009-06-09 18:00           ` Chong Yidong
2009-06-10  0:35             ` Kenichi Handa
  -- strict thread matches above, loose matches on Subject: below --
2009-06-06  2:48 Chong Yidong
2009-06-03  2:53 Richard Stallman

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=E1MDdTO-00031x-Np@etlken \
    --to=handa@m17n.org \
    --cc=3452@emacsbugs.donarmstrong.com \
    --cc=cyd@stupidchicken.com \
    --cc=eliz@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.