Discussion:
[Jabref-users] C-x keybinding conflict
Haines Brown
2011-06-29 13:13:22 UTC
Permalink
Most of my work is done with emacs, for which C-x C-s is bound to
Save. So when I turn to JabRef, I frequently try to save an entry I
have laboriously created with that command and, of course, thereby
delete the work, sometimes without even realizing it. Do others have
the same problem?

I'd like to block the C-x keybinding in jabref and replace it with,
say, C-d (I don't know if this is bound to something else) or even
C-S-x or C-A-x if necessary. Any way to do this? I imagine that
because the C-x is not often used an awkward substitute would not be
much of an annoyance.

Haines Brown
EBo
2011-06-29 14:02:19 UTC
Permalink
That has happened to me more than once. That is why I always open up
the .bib file in an emacs window, edit it, and save. If I blow stuff
away I can then recover in emacs by resaving. This is a fragile
workaround. This is one of the primary reasons I basically use jabref
for little more than generating keys and searching my bib file(s). I
would love to short circuit this problem somehow. If you come up with a
solution we would have to discuss hot to make sure it is not overwritten
with an update (maybe in an rc/init file?).

Thanks Haines for bringing this up,

EBo --
Post by Haines Brown
Most of my work is done with emacs, for which C-x C-s is bound to
Save. So when I turn to JabRef, I frequently try to save an entry I
have laboriously created with that command and, of course, thereby
delete the work, sometimes without even realizing it. Do others have
the same problem?
I'd like to block the C-x keybinding in jabref and replace it with,
say, C-d (I don't know if this is bound to something else) or even
C-S-x or C-A-x if necessary. Any way to do this? I imagine that
because the C-x is not often used an awkward substitute would not be
much of an annoyance.
Haines Brown
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously
valuable.
Why? It contains a definitive record of application performance,
security
threats, fraudulent activity, and more. Splunk takes this data and
makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Jabref-users mailing list
https://lists.sourceforge.net/lists/listinfo/jabref-users
Morten Omholt Alver
2011-06-29 17:51:24 UTC
Permalink
Hi,

I can't give you an immediate workaround for this, because the
Copy-Cut-Paste shortcuts are predefined by the Swing framework.

In general, you can customize key bindings in JabRef, although it's a
"hidden" feature. There is even an interface for it, but due to
problems such as with built-in key bindings it has never been exposed.
But you can easily redefine a key binding by adding an entry for it in
your preferences.

I assume you are working on Linux - in that case, open
~/.java/.userPrefs/net/sf/jabref/prefs.xml in a text editor (when
JabRef is not running). Key bindings are defined in a pair of keys,
which probably are not already present:

<entry key="bindNames" value="Cut;Replace string"/>
<entry key="bindings" value="ctrl D;ctrl X"/>

Each of these keys should contain a list separated by semicolons.
bindNames lists the names of the key bindings to redefine, and
bindings lists the keystrokes, so in my setting I'm trying to set
"Cut" to ctrl-D and "Replace string" to ctrl-X. This doesn't quite
work - you'll find that ctrl-D now does indeed perform the cut action,
but ctrl-X still does because JabRef doesn't actively remove those
built-in shortcuts. I don't remember exactly, but I think I've tried
unsuccessfully to change this.

If you are interested in customizing other key bindings, you'll need
to look up the list in the file
src/java/net/sf/jabref/JabRefPreferences.java in the JabRef source
code tree. It contains a list of lines like this:

defKeyBinds.put("Open file", "F4");

where the first string inside the parentheses is the name of a key binding.
--
Morten
 That has happened to me more than once.  That is why I always open up
 the .bib file in an emacs window, edit it, and save.  If I blow stuff
 away I can then recover in emacs by resaving.  This is a fragile
 workaround.  This is one of the primary reasons I basically use jabref
 for little more than generating keys and searching my bib file(s).  I
 would love to short circuit this problem somehow.  If you come up with a
 solution we would have to discuss hot to make sure it is not overwritten
 with an update (maybe in an rc/init file?).
  Thanks Haines for bringing this up,
  EBo --
Post by Haines Brown
Most of my work is done with emacs, for which C-x C-s is bound to
Save. So when I turn to JabRef, I frequently try to save an entry I
have laboriously created with that command and, of course, thereby
delete the work, sometimes without even realizing it. Do others have
the same problem?
I'd like to block the C-x keybinding in jabref and replace it with,
say, C-d (I don't know if this is bound to something else) or even
C-S-x or C-A-x if necessary. Any way to do this? I imagine that
because the C-x is not often used an awkward substitute would not be
much of an annoyance.
Haines Brown
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously
valuable.
Why? It contains a definitive record of application performance,
security
threats, fraudulent activity, and more. Splunk takes this data and
makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Jabref-users mailing list
https://lists.sourceforge.net/lists/listinfo/jabref-users
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Jabref-users mailing list
https://lists.sourceforge.net/lists/listinfo/jabref-users
Haines Brown
2011-06-30 10:31:52 UTC
Permalink
Post by Morten Omholt Alver
Hi,
I can't give you an immediate workaround for this, because the
Copy-Cut-Paste shortcuts are predefined by the Swing framework.
In general, you can customize key bindings in JabRef, although it's a
"hidden" feature. There is even an interface for it, but due to
problems such as with built-in key bindings it has never been exposed.
I assume you are working on Linux - in that case, open
~/.java/.userPrefs/net/sf/jabref/prefs.xml in a text editor (when
JabRef is not running). Key bindings are defined in a pair of keys,
<entry key="bindNames" value="Cut;Replace string"/>
<entry key="bindings" value="ctrl D;ctrl X"/>
This doesn't quite work - you'll find that ctrl-D now does indeed
perform the cut action, but ctrl-X still does because JabRef doesn't
actively remove those built-in shortcuts. I don't remember exactly,
but I think I've tried unsuccessfully to change this.
Thank you, Morton, for the useful reply. But in the end are you not
saying that the C-x keybinding cannot be disabled because JabRef has
no way to block shortcuts built into Swing? In any case, the conflict
seems to be between emacs and Swing, not emacs and JabRef.

Haines Brown

Continue reading on narkive:
Search results for '[Jabref-users] C-x keybinding conflict' (Questions and Answers)
4
replies
Lvl 50 pvp tips in SWTOR?
started 2012-04-16 20:18:27 UTC
video & online games
Loading...