all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Akib Azmain Turja via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "Gerd Möllmann" <gerd.moellmann@gmail.com>
Cc: 57607@debbugs.gnu.org
Subject: bug#57607: Feature request: Use the character cell on bottom-right corner of a terminal
Date: Tue, 06 Sep 2022 16:07:42 +0600	[thread overview]
Message-ID: <87ilm04xzl.fsf@disroot.org> (raw)
In-Reply-To: <m2zgfdexpq.fsf@Mini.fritz.box> ("Gerd Möllmann"'s message of "Tue, 06 Sep 2022 10:03:29 +0200")

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

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> Akib Azmain Turja <akib@disroot.org> writes:
>
>> Forwarding to bug-gnu-emacs list.
>>
>> Akib Azmain Turja <akib@disroot.org> writes:
>>
>>> Emacs never writes to the bottom-right corner of a terminal, because the
>>> terminal might open a new line at bottom of screen.  But terminals
>>> having any of 'ich', 'ich1' and 'smir' capabilities can write to the
>>> bottom-right corner of the terminal.  Almost all terminals have at least
>>> one of the aforementioned capabilities.  Why doesn't Emacs make use of
>>> that?
>
> I don't know.  And I don't know if that would work, it would require
> investigation.

There must be a way reliably way to do so, because ncurses can write to
the last character cell on terminal on linux console and xterm-like
terminal emulators.

>
> Emacs already writes to the bottom-right corner in case neither "am" nor
> "xn" are defined for the terminal in question.  vt100 and xterm, for
> instance, have "am" defined here, so Emacs doesn't write to the
> bottom-right corner.

I repeat: vt100 and xterm-like terminal having any of 'ich', 'ich1',
'il' and 'il1' or both 'smir' and 'rmir' can write to the last character
cell reliably without scrolling.

Here is what Emacs can do IMHO:

Glyph matrix (or whatever):

+------------------------+
|foo                     |
|bar                     |
|baz                     |
| --- *scratch* ---------|
|A very looooong message.|
+------------------------+

* Case: Any of 'ich', 'ich1', or both 'smir' and 'rmir' defined.

  *Note*: Won't work on displays with only a single column.

  Write to all character cells except the last two:

  +------------------------+
  |foo                     |
  |bar                     |
  |baz                     |
  | --- *scratch* ---------|
  |A very looooong messag  | <-- cursor
  +------------------------+
                         ^
                         |
                       cursor

  * Case: 'ich1' defined.

    Write the glyph to be placed on the last character cell.

    +------------------------+
    |foo                     |
    |bar                     |
    |baz                     |
    | --- *scratch* ---------|
    |A very looooong messag. | <-- cursor
    +------------------------+
                            ^
                            |
                          cursor

    Move to the character cell on the left side (cub1):

    +------------------------+
    |foo                     |
    |bar                     |
    |baz                     |
    | --- *scratch* ---------|
    |A very looooong messag. | <-- cursor
    +------------------------+
                           ^
                           |
                         cursor

    Invoke (or write or whatever) 'ich1':

    +------------------------+
    |foo                     |
    |bar                     |
    |baz                     |
    | --- *scratch* ---------|
    |A very looooong messag .| <-- cursor
    +------------------------+
                           ^
                           |
                         cursor

    Write the glyph to be placed on the character cell before the last
    character cell:

    +------------------------+
    |foo                     |
    |bar                     |
    |baz                     |
    | --- *scratch* ---------|
    |A very looooong message.| <-- cursor
    +------------------------+
                            ^
                            |
                          cursor

  * Case: 'ich' defined.

  Same as the 'ich1' case, but invoke 'ich' with parameter '1' instead
  of 'ich1'.

  * Case: 'smir' and 'rmir' defined.

    Write the glyph to be placed on the last character cell.

    +------------------------+
    |foo                     |
    |bar                     |
    |baz                     |
    | --- *scratch* ---------|
    |A very looooong messag. | <-- cursor
    +------------------------+
                            ^
                            |
                          cursor

    Move to the character cell on the left side (cub1):

    +------------------------+
    |foo                     |
    |bar                     |
    |baz                     |
    | --- *scratch* ---------|
    |A very looooong messag. | <-- cursor
    +------------------------+
                           ^
                           |
                         cursor

    Invoke 'smir'.

    Write the glyph to be placed on the character cell before the last
    character cell:

    +------------------------+
    |foo                     |
    |bar                     |
    |baz                     |
    | --- *scratch* ---------|
    |A very looooong message.| <-- cursor
    +------------------------+
                            ^
                            |
                          cursor

    Invoke 'rmir'.

* Case: 'il' or 'il1' defined.

  *Note*: Won't work on displays with only a single line.

  Write to all lines except the last two:

  +------------------------+
  |foo                     |
  |bar                     |
  |baz                     |
  |                        | <-- cursor
  |                        |
  +------------------------+
   ^
   |
  cursor

  Write the glyphs to be placed on the last line.

  +------------------------+
  |foo                     |
  |bar                     |
  |baz                     |
  |A very looooong message.|
  |                        | <-- cursor
  +------------------------+
   ^
   |
  cursor

  Move to the character cell above (cuu1):

  +------------------------+
  |foo                     |
  |bar                     |
  |baz                     |
  |A very looooong message.| <-- cursor
  |                        |
  +------------------------+
   ^
   |
  cursor

  * Case: 'il1' defined.

    Invoke 'il1'.

  * Case: 'il' defined.

    Invoke 'il1' with parameter '1'.

  +------------------------+
  |foo                     |
  |bar                     |
  |baz                     |
  |                        | <-- cursor
  |A very looooong message.|
  +------------------------+
   ^
   |
  cursor

  Insert the glyphs to be placed on the line before the last line:

  +------------------------+
  |foo                     |
  |bar                     |
  |baz                     |
  | --- *scratch* ---------|
  |A very looooong message.| <-- cursor
  +------------------------+
   ^
   |
  cursor

-- 
Akib Azmain Turja

Find me on Mastodon at @akib@hostux.social.

This message is signed by me with my GnuPG key.  Its fingerprint is:

    7001 8CE5 819F 17A3 BBA6  66AF E74F 0EFA 922A E7F5

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2022-09-06 10:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-03 17:39 Why Emacs doesn't touch the bottom-right corner of terminal Akib Azmain Turja
2022-09-06  6:59 ` bug#57607: Feature request: Use the character cell on bottom-right corner of a terminal Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-06  8:03   ` Gerd Möllmann
2022-09-06 10:07     ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-09-06 12:00       ` Gerd Möllmann
2022-09-06 15:10         ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-07  4:58           ` Gerd Möllmann
2022-09-07 12:46             ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-07 12:58               ` Gerd Möllmann
2022-09-07 15:39             ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-07 17:26             ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-08  5:49               ` Gerd Möllmann
2022-09-08 11:28                 ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-08 12:35                   ` Gerd Möllmann
2022-09-08 14:47                     ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-11  9:00                       ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-11 10:08                         ` Gerd Möllmann
2022-09-11 10:39                           ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-03  8:31                   ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-03 19:41                     ` Eli Zaretskii
2022-10-04  7:22                       ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-04  8:07                         ` Eli Zaretskii
2022-10-04 12:00                           ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-04 12:54                             ` Eli Zaretskii
2022-10-07 13:10                               ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-07 19:30                                 ` Eli Zaretskii
2022-10-04 13:05                             ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=87ilm04xzl.fsf@disroot.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=57607@debbugs.gnu.org \
    --cc=akib@disroot.org \
    --cc=gerd.moellmann@gmail.com \
    /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.