all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: face vs. mouse-face text property
Date: Sun, 22 Jan 2012 23:21:05 +0100	[thread overview]
Message-ID: <87bopv8jla.fsf@web.de> (raw)
In-Reply-To: <83vco52wph.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 21 Jan 2012 12:09:46 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

> But let's take this particular example: How would you like the newline
> to be displayed for the user to understand there's a selectable
> newline there?  If we replace the "\n" with a "_", the *Completions*
> display is like this:
>
>   Possible completions are:
>   _                  aaaa
>   bbbb               cccc
>
> What would you say the display should look like with \n instead of _,
> and which part(s) of the corresponding screen line would need to be
> highlighted when the mouse hovers over the newline?  Most importantly,
> given the display you want to see, how would the user understand she
> is suggested a selectable newline?

If _ is replaced by a newline character, your example would look like
that, I guess:

   Possible completions are:
   
   aaaa
   bbbb               cccc

since AFAIK the newline character breaks the visual line.  So, the whole
first line should be highlighted.

The 'mouse-face property should appear exactly on the same space where a
'highlight property would be shown.  Actually, this is already the case,
but: the highlighting gets only "activated" when the mouse pointer is
over a printable character.  With other words: there is a discrepancy
between what gets highlighted, and where the mouse pointer must be to
get the highlighting shown.  Currently, if there is a newline character,
the highlighting is shown until the end of the line.  But if I move the
mouse pointer there, the highlighting disappears, although I never left
the area of the highlighting.  Besides, in the `completing-read'
example, you can also _select_ the newline candidate when you click near
the end of the line.  So, currently, the space where the highlighting is
"activated" also doesn't correspond to the space where the candidate can
be selected.

> Well, I asked for those _situations_ leading to these lists of
> candidates to be described.  TIA.

- All commands that prompt for a piece of text to insert may show
  candidates including newlines, even empty lines.  For example a
  command that prompts for an entry of the kill ring to insert, showing
  the available pieces of text as completion candidates (or clickable
  text).  Many people use something like that.

- dired.  Some people like filenames including newlines.  I don't, but I
  want that dired works for files with any name.  filenames appear in
  *Completions* if you do C or R or something like that in dired.

- In Icicles, there are many situations where candidates including
  newlines can appear, be it showing history items for
  `repeat-complex-command', or `icicle-search'.

> Also, are completion candidates the only situations where these
> problems arise?  The original issue you raised was much more general,
> AFAIU.

  It's not forbidden to mouse-face arbitrary multi-line text.  E.g. in
  *ielm* or *shell*, if you move the mouse over a previous input, it is
  mouse-faced.  There, input is allowed to be multiline.

> Btw, in Emacs 23, you couldn't even select such a newline, neither
> with a mouse click nor with a RET: you'd get "\naaaa" instead of a
> lone "\n".  In Emacs 24, at least you can select the newline alone.

Good, that's an improvement.


Thanks,

Michael.



  reply	other threads:[~2012-01-22 22:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18 21:34 face vs. mouse-face text property Michael Heerdegen
2012-01-19  7:20 ` Chong Yidong
2012-01-19 12:19 ` Eli Zaretskii
2012-01-20 20:18   ` Michael Heerdegen
2012-01-21 10:09     ` Eli Zaretskii
2012-01-22 22:21       ` Michael Heerdegen [this message]
2012-01-23  6:48         ` Eli Zaretskii
2012-01-23 14:27           ` Stefan Monnier
2012-01-23 14:43             ` Lennart Borgman
2012-01-23 15:34               ` Stefan Monnier
2012-01-23 15:40                 ` Lennart Borgman
2012-01-23 18:47                   ` chad
2012-01-23 20:44                     ` Eli Zaretskii
2012-01-23 21:09                       ` chad
2012-01-24  3:48                         ` Eli Zaretskii
2012-01-24  5:55                           ` Eli Zaretskii
2012-01-24  7:04                             ` chad
2012-01-24  9:11                               ` Eli Zaretskii
2012-01-24 11:14                                 ` chad
2012-01-24 15:01                     ` Stefan Monnier
2012-01-24 16:49                     ` 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=87bopv8jla.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --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.