emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adjust point to move it off zero-width characters


From: Stefan Monnier
Subject: Re: Adjust point to move it off zero-width characters
Date: Sun, 07 Aug 2011 12:13:10 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]