I would like to turn on "shift-select-mode" so that it works correctly
with org-mode (setting org-support-shift-select). Unfortunately,
something very strange happens when I turn it on: shift-selection
actually stops working.
To reproduce:
- launch Aquamacs 3 (I haven't tried in earlier versions) with no
configuration files
- try shift-selecting some text: it works
- open an org-mode file, try selecting some text: it does not work (yet
org-support-shift-select is t)
- turn on shift-select-mode, and go back a plain buffer (not org mode):
doing "shift-right" only selects one character, and keeps moving the
mark.
I tried doing a "cua-mode nil" first, but it does not work.
How can I get "shift-select-mode" to work?
Thanks,
Alan
_______________________________________________
Aquamacs-devel mailing list
Aquamac...@aquamacs.org
http://lists.aquamacs.org/mailman/listinfo.cgi/aquamacs-devel
org-mode overrides the key bindings for shift-select. Annoys me as well on occasion.
- D
--
http://aquamacs.org -- Aquamacs: Emacs on Mac OS X
http://aquamacs.org/donate -- Could we help you? Return the favor and support the Aquamacs Project!
> On Jan 26, 2012, at 5:27 AM, Alan Schmitt wrote:
>>
>> I would like to turn on "shift-select-mode" so that it works
>> correctly with org-mode (setting org-support-shift-select).
>> Unfortunately, something very strange happens when I turn it on:
>> shift-selection actually stops working.
>
> org-mode overrides the key bindings for shift-select. Annoys me as
> well on occasion.
It seems that the solution they propose would work for me, if
shift-select-mode was not broken.
Do you confirm that turning shift-select-mode on in Aquamacs 3 does not
work in any mode (I tried it without preferences in the scratch buffer)?
Setting that variable to t does not do anything useful, but what are you hoping to achieve with it that Aquamacs doesn't already do?
I want to make org-support-shift-select work. The way I interpreted its
documentation was that I needed to have shift-select-mode on for it to
work. But maybe I'm mistaken and this is a bug on the org side of
things.
I think they have a separate mailing list for org-mode, but, alternatively, emacs-devel might be able to help, since org-mode is included with Emacs now.
I'd test it with Emacs 24 separately so you can be sure it's not an Aquamacs-specific setting.
- D
As I'm already subscribed to the org-mode list, I'll ask there. I'll
report on what the cause of the problem may be.
I just tried in Emacs 24, and org-support-shift-select works as
expected.
Thanks,
OK, since this doesn't work in Aquamacs 3.x, and unless it's due to very recent changes in the Emacs code base, then there's something particular about Aquamacs' settings that provoke this bug. I have no idea at this time what they are.
If you can identify those settings and reproduce with Emacs 24, you'd stand a good chance of getting the bug fixed in Emacs 24/org-mode, if that is where it is.
Looking at the code, what it's finally doing is this:
(let ((this-command-keys-shift-translated t))
(call-interactively cmd))
where "cmd" is 'forward-char in the case of shift-right.
Would there be any reason why this would not have the desired behavior
(i.e., starting or extending a region) in Aquamacs?
So, what I'm seeing right now is that enabling both shift-select-mode AND cua-mode won't work. They both seem to do the same thing and get in each other's way.
Same for org-mode: enabling both cua-mode and the org-specific mode that supports shift selection won't work, but just enabling the latter on its own, will.
Does that help?
- David
> Same for org-mode: enabling both cua-mode and the org-specific mode
> that supports shift selection won't work, but just enabling the latter
> on its own, will.
>
> Does that help?
Yes definitely. I had tried:
(cua-mode nil)
as suggested in
http://www.emacswiki.org/emacs/AquamacsEmacsCompatibilitySettings
but it does not work. The correct way to disable cua seems to be
(cua-mode 0)
as explained in http://www.emacswiki.org/emacs/CustomizeAquamacs
Just adding this to my Preferences.el solved the issue.
Thanks for helping me debug this,
You're quite welcome, although disabling CUA-Mode will disturb a number of probably desirable behaviors.
Given that you now know what the problem is, you should be able to reproduce it on Emacs 24, and report the bug to the org people!
> You're quite welcome, although disabling CUA-Mode will disturb a
> number of probably desirable behaviors.
Which ones? Unless I forgot some, here is what CUA does:
- C x and so one -> I prefer to use the command key
- shift-select -> in Emacs 23 and above
- visual rectangular selection -> I use evil (vi key bindings)
- global mark -> it's the only one I will miss.
> Given that you now know what the problem is, you should be able to
> reproduce it on Emacs 24, and report the bug to the org people!
I think they are already aware of org's incompatibility with CUA, as
they provide the "org-replace-disputed-keys" preference
(http://www.gnu.org/software/emacs/manual/html_node/org/Conflicts.html)
(I have also seen the "org-CUA-compatible" preference at
http://www.emacswiki.org/emacs/OrgMode). There is also an org-cua
compatibility at http://www.emacswiki.org/emacs/org-cua-dwim.el.
I prefer disabling CUA-mode because I find the default key bindings much
more convenient. I might try the org-cua compatibility layer if I miss
the global mark too much.