all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Behavior of editable-field widget
@ 2019-10-27 23:22 Yuan Fu
  2019-10-28  2:19 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Yuan Fu @ 2019-10-27 23:22 UTC (permalink / raw)
  To: Emacs developers

AFAIK The editable widget let you insert anywhere in the field. In a
GUI, cursor (point) sticks to the beginning of the field or the end of
the existing text like

      +---------------------------------------------+
      ||                                            |
      +---------------------------------------------+

and

      +---------------------------------------------+
      |SOME TEXT|                                   |
      +---------------------------------------------+

Where the “|” represents the cursor.

I think this behavior is not hard to implement with some text
properties. Is there any reason behind the current behavior?


P.S. In GUI’s one normally click on the editable field to
activate/select it before he/she can edit anything. Could we
mimic that behavior in widgets? I.e., click/hit enter before
one can edit the field.

Yuan



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

* Re: Behavior of editable-field widget
  2019-10-27 23:22 Behavior of editable-field widget Yuan Fu
@ 2019-10-28  2:19 ` Stefan Monnier
  2019-10-29 18:45   ` Yuan Fu
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2019-10-28  2:19 UTC (permalink / raw)
  To: Yuan Fu; +Cc: Emacs developers

> I think this behavior is not hard to implement with some text
> properties.

You're probably right.

> Is there any reason behind the current behavior?

My guess is that it's simply because it was written at a time where the
`display` text-property didn't exist yet, and nobody bothered to update
it to take advantage of it.


        Stefan




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

* Re: Behavior of editable-field widget
  2019-10-28  2:19 ` Stefan Monnier
@ 2019-10-29 18:45   ` Yuan Fu
  0 siblings, 0 replies; 3+ messages in thread
From: Yuan Fu @ 2019-10-29 18:45 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs developers

In fact, this cursor-fixing feature probably should be bundled together
with “hit enter to activate editable field in order to edit”. Because
otherwise the editable field could trap the point unexpectedly. Since
people move around Emacs by moving the point, confusions like “why I
can’t move the point?” can be very annoying. (It’s not a problem in GUI
because the cursor is never trapped.)

Yuan



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

end of thread, other threads:[~2019-10-29 18:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-27 23:22 Behavior of editable-field widget Yuan Fu
2019-10-28  2:19 ` Stefan Monnier
2019-10-29 18:45   ` Yuan Fu

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.