Highlight after setting mark

19 views
Skip to first unread message

Markus Löckelt

unread,
Oct 10, 2020, 10:21:19 AM10/10/20
to Emacs+ plugin discussion
First, also a big thank you from me, I really love to be able to use Emacs keybindings in Eclipse, and the built-in version does not really cover it.

I have but one issue - when I set the mark and then move the cursor, the text in-between is not highlighted, as it would be in Emacs. It is apparently still selected (e.g., Ctrl-w cuts it out), but not visibly marked. On the other hand, if I mark some text by holding Shift and moving the cursor, it is highlighted as I expect it. I have searched the plugin configuration and also this discussion, but found neither a corresponding configuration item nor a mention of this issue, so am I maybe overlooking something? Are these different "kinds" of selections?

Markus Löckelt

unread,
Oct 12, 2020, 2:52:33 PM10/12/20
to Emacs+ plugin discussion
I try to cut&paste the kind reply from Andreas Paepcke, who had problems with the reply mechanism, in case the answer interests anyone:

--> snip <------------------
[first attempt tried to deliver to the google group, which failed]

---------- Forwarded message ---------
From: Andreas Paepcke <email-deleted>
Date: Sat, Oct 10, 2020 at 8:52 AM
Subject: Re: [Emacs+ Discussion: 455] Highlight after setting mark
To: <email-deleted>


Hi Markus, I may be off, but I had the same problem. I still
have half of it, but quite livable. My problem was that I had set-mark
bound to a 'bad' function. Mark's command functions all end with '_command'.
Here from a private conversation with Mark:

you said that set mark was bound to cmd-space [set-mark].  Since the default binding is Ctrl+space, and you have attempted to re-bind it, it is possible that you have chosen the incorrect command.  (The ancient eclipse "Emacs" bindings have a set-mark command that, at the time I was first developing my plugin, was completely broken, but partially works these days; of course it doesn't support the full panoply of behavior we have come to know and love.) 

  If you look at your bindings preferences you can see that the incorrect command is labeled "set-mark" and the Emacs+ version is labeled "set-mark-command."  You can also export the csv of the keybindings and you will see in there:

     Set Mark, org.eclipse.ui.edit.text.set.mark
     Set Mark Command, com.mulgasoft.emacsplus.setMark

I may have had a similar issue with my cursor move bindings.
After correcting all, I now have the following behavior, which is
fine for me:

- Set mark, then cnt-p: highlights as expected
- Set mark, then cnt-n: does not highlight. But, if
       I then swap point and cursor: cnt-x cnt-x, then
       the region highlights.

Maybe this helps.

Andreas

Markus Löckelt

unread,
Oct 12, 2020, 2:55:50 PM10/12/20
to Emacs+ plugin discussion
...the re-post seems to have worked. Thank you, Andreas! I tried your advice and it worked... strangely, even the cnt-n case works for me 80% of the time (although not always). No idea why - but as you said, I can also live with it!

Cheers,
Markus.

Mark Feber

unread,
Oct 12, 2020, 6:52:47 PM10/12/20
to emac...@googlegroups.com
A simpler way to check the bindings is Ctrl-H K.  The result for Ctrl-Space should be:

Ctrl+Space runs set-mark-command
Id -com.mulgasoft.emacsplus.setMark
 Key Bindings
    CTRL+SPACE [org.eclipse.ui.textEditorScope]
 Description
    Set the mark at cursor position and push onto mark ring

Is your binding for Ctrl-N also the correct emacsplus command?

--
--
You received this message because you are subscribed to the Google
Groups "Emacs+ Eclipse Discussion" group.
To post to this group, send email to emac...@googlegroups.com
To unsubscribe from this group, send email to
emacsplus+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/emacsplus?hl=en?hl=en
 
Support Emacs+ by marking it as a 'favorite' at the Eclipse Marketplace: http://marketplace.eclipse.org/content/emacs.

---
You received this message because you are subscribed to the Google Groups "Emacs+ plugin discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emacsplus+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emacsplus/a6583d6d-3642-408f-a9b1-28c1ae189ff7n%40googlegroups.com.

Markus Löckelt

unread,
Oct 15, 2020, 3:08:56 PM10/15/20
to Emacs+ plugin discussion
Ah, yes, Ctrl-h k works faster than looking in the preferences menu...

> Is your binding for Ctrl-N also the correct emacsplus command?

I think so:

Ctrl+N runs next-line
    Id -com.mulgasoft.emacsplus.nextLine
 Key Bindings
    ARROW_DOWN [org.eclipse.ui.textEditorScope]
    CTRL+N [org.eclipse.ui.textEditorScope]
    SHIFT+ARROW_DOWN [org.eclipse.ui.textEditorScope]
    CTRL+SHIFT+N [org.eclipse.ui.textEditorScope]
 Description
    Move point down one line

However, as I wrote above Ctrl-Shift-N also does something additional not described here, namely mark text (which is fine with me).
It also does not only go down during "normal" editing, but, e.g., when a Content Assist window is open, it moves the selection highlight downward.

Summary: It works just as I want it ;-)

Thanks again for your work and kind response,
Markus.

Mark Feber

unread,
Oct 16, 2020, 2:22:17 PM10/16/20
to emac...@googlegroups.com
A few points:

CTRL+SHIFT+N invokes next-line with Shift Selection by design (consult any reputable emacs manual for details).

Emacs+ bindings only apply (primarily) in text editor windows, although it bleeds over into a few others (e.g. the console window).  Eclipse, unlike true emacs, has many different types of windows, many not based off of text editing.

Reply all
Reply to author
Forward
0 new messages