This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 99443 - support emacs set-mark-command (C-Space, C-@)
Summary: support emacs set-mark-command (C-Space, C-@)
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Key bindings (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 38 votes (vote)
Assignee: Svata Dedic
Depends on:
Reported: 2007-03-29 19:45 UTC by enebo
Modified: 2015-12-19 00:19 UTC (History)
2 users (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description enebo 2007-03-29 19:45:27 UTC
In emacs there is a way via a keybinding to support the start of a region so
then when you hit the equivalent of commands like cut or copy it uses the result
of set-mark-command to delineate the start of the region.  Of the JRuby core
committers 3 of 4 of us use Emacs daily and all three of us use
set-mark-command.  I think this is a common keybinding in the emacs world.  

Actually set-mark-command pushes each set mark into a kill ring (so you can
cycle through set marks -- marks in emacs can also be used for jumping), but NB
is not emacs and I personally just use the simple form described above.

I am willing to help create a patch for this if someone holds my hand a little.
 Not having this makes my eyes misty each time I start Netbeans...
Comment 1 Vitezslav Stejskal 2007-03-30 03:21:44 UTC
This would need adding new set-mark-command action and updating the existing
cut/copy actions to look for the mark and use it if there is one. Is the marked
position shown in the text somehow?
Comment 2 enebo 2007-03-30 18:55:03 UTC
Some emacs do highlight from last set mark, but most do not from my memory
(MacOS Emacs is what I have been using the most lately and it does).  I guess
its behavior is very similiar to left clicking and dragging a region. 
Personally, I do not think it matters much one way or the other.  Eclipses
equivalent of set-mark does not highlight and when I used Eclipse I never missed
the lack of highlighting.

Now that I think about it, this action could be quite useful for the macro
support in Netbeans.  set-mark (non-interactive version of set-mark-command) is
used extensively in Emacs to create powerful editing features in Emacs Lisp.  I
suspect a set-mark action in emacs could be combined with lets say a search
action to create all sorts of interesting region marking macros.
Comment 3 pohl 2007-12-07 21:56:50 UTC
set-mark-command is, indeed an essential part of the macro system in emacs.
It makes a large class of complex, repetitive editing tasks very easy.  I just went
looking for it in Netbeans, and was disappointed to find that it isn't there yet.

As for how it looks, I suggest that it look no different than left-click-drag
selection looks.  The "mark" would merely be either the beginning or end
of the selected region (depending on which direction the cursor moved after
the mark was set).

Comment 4 nriley 2007-12-15 23:01:52 UTC
Yeah, I think NetBeans should behave similarly to Emacs with transient-mark-mode enabled; there's really no benefit in making the selection invisible.
Comment 5 _ sandipchitale 2008-05-21 23:53:24 UTC
Along with this I would like to have exchange mark and dot. I want to use it so that I can grow (fine tune) the
selection on either end using the shift-select mechanism.
Comment 6 archontophoenix 2009-03-04 09:39:51 UTC
As a new user of Netbeans but a long-time user of full-featured text editors, this does seem  to melike *the* missing
piece of the Netbeans experience -- it's virtually impossible to define macros of any sophistication without some kind
of mark in text you're editing.

Maybe I don't need Netbeans after all.
Comment 7 digash 2010-01-13 08:25:00 UTC
Every year I start up Netbeans and try this out and go back to the Eclipse, which now has a really good Emacs pluggin.
Comment 8 yas99en 2015-12-19 00:19:27 UTC
Hi, I created an emacs keybindgs plugin for NetBeans. It supports set-mark feature.
It is available on NetBeans Plugin Portal. see