From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Adjust point to move it off zero-width characters
Date: Sun, 07 Aug 2011 12:13:10 -0400 [thread overview]
Message-ID: <jwvfwldnr32.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83bow2wq9b.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 06 Aug 2011 17:47:44 +0300")
> Is the patch below a good idea? If so, is it okay to install it on
> the trunk? It will allow us to set the glyphless-char-display of LRM,
> RLM, and the other directional control characters to zero-width and
> thus make them invisible without having the cursor get "stuck" on
> them and without using invisible or intangible text properties.
Looks OK to me, tho I have a question:
> + if (check_glyphless)
> + {
> + Lisp_Object glyphless_method;
> +
> + check_glyphless = 0;
> + if (PT >= BEGV && PT < ZV)
> + {
> + glyphless_method =
> + glyphless_char_display_method (FETCH_CHAR (PT_BYTE),
> + XFRAME (selected_frame));
Please merge the declaration into the initialization.
> + if (EQ (glyphless_method, Qzero_width))
> + {
> + SET_PT (PT > BEGV && PT < last_pt ? PT - 1 : PT + 1);
> + check_glyphless = 1;
> + check_composition = check_display = check_invisible = 1;
> + }
This means that point is placed either after the LRM or before the char
preceding the LRM, depending only on the direction of the movement of
the last command. I.e. the LRM gets "fused" with the preceding char.
Is there a reason to fuse it with the preceding char rather than fusing
it with the next char?
Stefan
next prev parent reply other threads:[~2011-08-07 16:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-06 14:47 Adjust point to move it off zero-width characters Eli Zaretskii
2011-08-07 16:13 ` Stefan Monnier [this message]
2011-08-07 16:39 ` Eli Zaretskii
2011-08-07 16:46 ` Eli Zaretskii
2011-08-07 17:10 ` Eli Zaretskii
2011-08-08 0:50 ` Stefan Monnier
2011-08-08 3:02 ` Eli Zaretskii
2011-08-08 4:12 ` Stefan Monnier
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=jwvfwldnr32.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=eliz@gnu.org \
--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.