[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Texmacs-dev] Re: Patch #5494: Make selection behavior more standard
Re: [Texmacs-dev] Re: Patch #5494: Make selection behavior more standard conformant
Sun, 24 Dec 2006 13:10:24 +0100
Thunderbird 22.214.171.124 (X11/20061115)
Lionel Elie Mamane schrieb:
> On Tue, Dec 12, 2006 at 06:37:16PM +0100, Norbert Nemec wrote:
>> 1) make an active selection "volatile", i.e.: the selected text gets
>> unselected as soon as the cursor is moved. (unless you are in Emacs
>> selection mode that is initated by C-space)
>> This is default behavior of both Windows and XEmacs. For plain Emacs
>> there is no comparison, since the only selection mode is the C-space
>> selection, where this does not apply.
> FSF emacs does permit selection with the mouse, so the comparison does
OK, true - I see what you mean. Actually, the emacs-behavior is yet a
bit different: after mouse-selection, the visual mark of the selection
is volatile (i.e., it disappears at the first key press) however, the
start of the selection remains active, so moving the mouse and lateron
pressing CTRL-W cuts the whole region from the start of the
mouse-selected region to the current cursor position.
> I don't see how the comparison is relevant for discussing what
> TeXmacs does, however.
TeXmacs offers two modes of "look-and-feel": Windows and Emacs.
Therefore, I think, TeXmacs behavior should be oriented on these
standards. Of course, we have the freedom to deviate from these
standards whereever there is a good reason, but every deviation should
be argued well.
Concerning selection handling, TeXmacs had a non-standard behavior that
-- to my opinion -- was worse than either of the two standards. My
personal preference is Windows standard (which is also standard for
several Linux editors that I use in alternation with TeXmacs), so I
first tried to follow this standard. Beyond this, I checked Emacs and
XEmacs which both have somewhat different selection handling.
With my changes, I did not yet manage to follow any of the standards
completely, but I believe that the new behavior is nearer to each of
them than the old TeXmacs behavior. Finally, I believe it is better than
old TeXmacs behavior as well, as I argued before.
>> I hope this satisfies everybody?
> It is probably what will make TeXmacs the easiest to use to the
> masses; it is behaviour I personally would dislike, but don't let that
> stop you.
OK, then I guess it is impossible to match everybody's personal taste.
Still, I think the policy to follow well-established standards makes
sense and I would hope that this per se is in everybody's interest.
>> Apart from being standard behavior, this also has the advantage that
>> there can never be any active selection except at the location of
>> the cursor. How often did it happen to you that you forgot an active
>> selection and accidentally deleted that instead of the character at
>> the cursor position?
> Far too often; I do indeed think that this was one of the major UI
> flaws in TeXmacs. However, I would have solved it by having the
> backspace / delete keys delete before / after the cursor position, and
> not the selection.
> IMHO TeXmacs's problem is that it uses an inconsistent mix between the
> Emacs selection/copy/paste behaviour and the MS Windows / Gnome / KDE
> one; both models are internally consistent and TeXmacs could use
> either of them. But mixing the two in an inconsistent way leads to UI
> disasters such as the "I forgot there was an active selection and
> press delete/backspace and the selection gets cut" you describe.
I fully agree with you on that. Actually, whatever I changed was a pure
fix of the symptoms, the internal conceptual confusion is still there,
but I think the whole thing looks more consistent at the surface now.
>> 2) A tiny change to the behavior of Backspace/Delete with an active
>> selection. Instead of doing a CUT operation (for which you should use
>> C-X), the selection is now simply DELETED keeping the clipboard content
>> untouched. Again, this is standard behavior for Windows. Emacs/XEmacs
>> behave differently,
> Indeed, there it deletes the character near the cursor, not the
>> Index: TeXmacs/progs/generic/generic-edit.scm
>> --- texmacs.orig/TeXmacs/progs/generic/generic-edit.scm 2006-12-12
>> 17:50:25.000000000 +0100
>> +++ texmacs/TeXmacs/progs/generic/generic-edit.scm 2006-12-12
>> 17:51:11.000000000 +0100
>> @@ -41,7 +41,8 @@
>> (tm-define (kbd-remove forward?) (remove-text forward?))
>> (tm-define (kbd-remove forward?)
>> (:mode with-active-selection?)
>> - (clipboard-cut "primary"))
>> + (clipboard-cut "nowhere")
>> + (clipboard-clear "nowhere"))
>> (tm-define (kbd-tab)
>> (if (not (complete-try?))
> Wouldn't something like that have the same effect and be simpler?
> --- texmacs.orig/TeXmacs/progs/generic/generic-edit.scm 2006-12-12
> 17:50:25.000000000 +0100
> +++ texmacs/TeXmacs/progs/generic/generic-edit.scm 2006-12-12
> 17:51:11.000000000 +0100
> @@ -NN,N +NN,N @@
> (tm-define (kbd-remove forward?) (remove-text forward?))
> (tm-define (kbd-remove forward?)
> (:mode with-active-selection?)
> - (clipboard-cut "primary"))
> + (delete-tree (selection-tree)))
> (tm-define (kbd-tab)
> (if (not (complete-try?))
Of course! Thanks for the hint. When I wrote that fix, I didn't know