unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* zero-width line continuation glyph
@ 2018-09-11 11:58 Robert Pluim
  2018-09-11 12:24 ` Eli Zaretskii
  2018-09-11 12:37 ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Robert Pluim @ 2018-09-11 11:58 UTC (permalink / raw)
  To: emacs-devel

Hi,

Iʼm trying to get the line continuation character to not be shown for
lines that are exactly as long as the window width. In a GUI frame,
with the fringe turned off, I can do:

(let ((disptab (or buffer-display-table
                   (setq buffer-display-table (make-display-table)))))
    (set-display-table-slot disptab 'wrap (gethash "ZERO WIDTH SPACE" (ucs-names))))

which causes the '\' to not be shown, but the next character does not
get displayed in its place, ie

0123456789
xxxxxxxxxx\
x

gets transformed to

0123456789
xxxxxxxxxx
x

In emacs -nw, the behaviour is different:

0123456789
xxxxxxxxxx\
x

gets transformed to

0123456789
xxxxxxxxxxx

which is what I want, but then any characters I add to the end of that line are not
displayed at all.

Thanks

Robert



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

* Re: zero-width line continuation glyph
  2018-09-11 11:58 zero-width line continuation glyph Robert Pluim
@ 2018-09-11 12:24 ` Eli Zaretskii
  2018-09-11 12:52   ` Robert Pluim
  2018-09-11 12:37 ` Eli Zaretskii
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2018-09-11 12:24 UTC (permalink / raw)
  To: Robert Pluim; +Cc: emacs-devel

> From: Robert Pluim <rpluim@gmail.com>
> Date: Tue, 11 Sep 2018 13:58:55 +0200
> 
> Iʼm trying to get the line continuation character to not be shown for
> lines that are exactly as long as the window width. In a GUI frame,
> with the fringe turned off, I can do:
> 
> (let ((disptab (or buffer-display-table
>                    (setq buffer-display-table (make-display-table)))))
>     (set-display-table-slot disptab 'wrap (gethash "ZERO WIDTH SPACE" (ucs-names))))
> 
> which causes the '\' to not be shown, but the next character does not
> get displayed in its place, ie

ZERO WIDTH SPACE by default is displayed as a 1-pixel thin space, so I
think you will have to tweak glyphless-char-display-control to display
that character as nothing, to get what you want.  Otherwise, the 1
pixel less space left on the line is not enough for Emacs to display
another character.

> In emacs -nw, the behaviour is different:
> 
> 0123456789
> xxxxxxxxxx\
> x
> 
> gets transformed to
> 
> 0123456789
> xxxxxxxxxxx
> 
> which is what I want, but then any characters I add to the end of that line are not
> displayed at all.

Since TTYs cannot display thin characters, the above sounds like a bug
to me.  But again, without tweaking glyphless-char-display-control,
what you want cannot happen (if at all).



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

* Re: zero-width line continuation glyph
  2018-09-11 11:58 zero-width line continuation glyph Robert Pluim
  2018-09-11 12:24 ` Eli Zaretskii
@ 2018-09-11 12:37 ` Eli Zaretskii
  2018-09-11 12:51   ` Robert Pluim
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2018-09-11 12:37 UTC (permalink / raw)
  To: Robert Pluim; +Cc: emacs-devel

> From: Robert Pluim <rpluim@gmail.com>
> Date: Tue, 11 Sep 2018 13:58:55 +0200
> 
> Iʼm trying to get the line continuation character to not be shown for
> lines that are exactly as long as the window width. In a GUI frame,
> with the fringe turned off, I can do:
> 
> (let ((disptab (or buffer-display-table
>                    (setq buffer-display-table (make-display-table)))))
>     (set-display-table-slot disptab 'wrap (gethash "ZERO WIDTH SPACE" (ucs-names))))
> 
> which causes the '\' to not be shown, but the next character does not
> get displayed in its place, ie

Actually, I'm not sure this will work at all, because Emacs needs a
place to put the cursor at EOL.  So it cannot put a character there,
because without a fringe, there's no place to display the cursor.

I think you will have a much better approximation of what you want if
you keep the fringe, but make it 1-pixel wide.



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

* Re: zero-width line continuation glyph
  2018-09-11 12:37 ` Eli Zaretskii
@ 2018-09-11 12:51   ` Robert Pluim
  2018-09-11 13:08     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Pluim @ 2018-09-11 12:51 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Robert Pluim <rpluim@gmail.com>
>> Date: Tue, 11 Sep 2018 13:58:55 +0200
>> 
>> Iʼm trying to get the line continuation character to not be shown for
>> lines that are exactly as long as the window width. In a GUI frame,
>> with the fringe turned off, I can do:
>> 
>> (let ((disptab (or buffer-display-table
>>                    (setq buffer-display-table (make-display-table)))))
>>     (set-display-table-slot disptab 'wrap (gethash "ZERO WIDTH SPACE" (ucs-names))))
>> 
>> which causes the '\' to not be shown, but the next character does not
>> get displayed in its place, ie
>
> Actually, I'm not sure this will work at all, because Emacs needs a
> place to put the cursor at EOL.  So it cannot put a character there,
> because without a fringe, there's no place to display the cursor.

Youʼre right: customizing glyphless-char-display-control to
zero-width for 'format-control' makes no difference.

> I think you will have a much better approximation of what you want if
> you keep the fringe, but make it 1-pixel wide.

Unfortunately emacs -nw has no fringes.

Robert



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

* Re: zero-width line continuation glyph
  2018-09-11 12:24 ` Eli Zaretskii
@ 2018-09-11 12:52   ` Robert Pluim
  0 siblings, 0 replies; 7+ messages in thread
From: Robert Pluim @ 2018-09-11 12:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> In emacs -nw, the behaviour is different:
>> 
>> 0123456789
>> xxxxxxxxxx\
>> x
>> 
>> gets transformed to
>> 
>> 0123456789
>> xxxxxxxxxxx
>> 
>> which is what I want, but then any characters I add to the end of that line are not
>> displayed at all.
>
> Since TTYs cannot display thin characters, the above sounds like a bug
> to me.  But again, without tweaking glyphless-char-display-control,
> what you want cannot happen (if at all).

Even with glyphless-char-display-control tweaked for 'format-control',
I get the same behaviour.

Robert



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

* Re: zero-width line continuation glyph
  2018-09-11 12:51   ` Robert Pluim
@ 2018-09-11 13:08     ` Eli Zaretskii
  2018-09-11 13:12       ` Robert Pluim
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2018-09-11 13:08 UTC (permalink / raw)
  To: Robert Pluim; +Cc: emacs-devel

> From: Robert Pluim <rpluim@gmail.com>
> Cc: emacs-devel@gnu.org
> Date: Tue, 11 Sep 2018 14:51:32 +0200
> 
> > I think you will have a much better approximation of what you want if
> > you keep the fringe, but make it 1-pixel wide.
> 
> Unfortunately emacs -nw has no fringes.

Is -nw so important that it must be part of the solution?  It should
be easier to make the window slightly wider, no?

More radical solutions will need changes on the C level, I think.



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

* Re: zero-width line continuation glyph
  2018-09-11 13:08     ` Eli Zaretskii
@ 2018-09-11 13:12       ` Robert Pluim
  0 siblings, 0 replies; 7+ messages in thread
From: Robert Pluim @ 2018-09-11 13:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Robert Pluim <rpluim@gmail.com>
>> Cc: emacs-devel@gnu.org
>> Date: Tue, 11 Sep 2018 14:51:32 +0200
>> 
>> > I think you will have a much better approximation of what you want if
>> > you keep the fringe, but make it 1-pixel wide.
>> 
>> Unfortunately emacs -nw has no fringes.
>
> Is -nw so important that it must be part of the solution?  It should
> be easier to make the window slightly wider, no?
>

It would be nice if the same mechanism worked for both, but itʼs not
mandatory.

> More radical solutions will need changes on the C level, I think.

Itʼs not a big problem, I was just intrigued by the
possibilities. Getting d-s-m sorted out is more important :-)

Thanks

Robert



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

end of thread, other threads:[~2018-09-11 13:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-11 11:58 zero-width line continuation glyph Robert Pluim
2018-09-11 12:24 ` Eli Zaretskii
2018-09-11 12:52   ` Robert Pluim
2018-09-11 12:37 ` Eli Zaretskii
2018-09-11 12:51   ` Robert Pluim
2018-09-11 13:08     ` Eli Zaretskii
2018-09-11 13:12       ` Robert Pluim

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).