emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* remapping C-c ' to another key
@ 2014-07-29 14:50 Alan Schmitt
  2014-07-29 17:23 ` Thorsten Jolitz
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Schmitt @ 2014-07-29 14:50 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 487 bytes --]

Hello,

I'm trying to remap ~C-c '~ to ~<menu> '~ and I'm having some
trouble. More specifically, I'm able to initiate the editing part using
a global binding to `org-edit-special', but I don't know how to bind the
same key to `org-edit-src-exit' when I'm editing a source block. As
I suspect I will also need to change the binding for other special edit
buffers, I'm wondering if there is a way to do it all at once.

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

[-- Attachment #2: Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: remapping C-c ' to another key
  2014-07-29 14:50 remapping C-c ' to another key Alan Schmitt
@ 2014-07-29 17:23 ` Thorsten Jolitz
  2014-07-30  9:24   ` Alan Schmitt
  0 siblings, 1 reply; 4+ messages in thread
From: Thorsten Jolitz @ 2014-07-29 17:23 UTC (permalink / raw)
  To: emacs-orgmode

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> Hello,
>
> I'm trying to remap ~C-c '~ to ~<menu> '~ and I'm having some
> trouble. More specifically, I'm able to initiate the editing part using
> a global binding to `org-edit-special', but I don't know how to bind the
> same key to `org-edit-src-exit' when I'm editing a source block. As
> I suspect I will also need to change the binding for other special edit
> buffers, I'm wondering if there is a way to do it all at once.

you are in org-mode when you call `org-edit-special', thus you could do

,----
| (org-defkey org-mode-map "KEY" `org-edit-special)
`----


then you are in some major-mode with minor-mode 'org-src-mode' active,
thus

,----
| (org-defkey org-src-mode-map "KEY" `org-edit-src-exit)
`----

should work (completely untested though ...)

-- 
cheers,
Thorsten

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: remapping C-c ' to another key
  2014-07-29 17:23 ` Thorsten Jolitz
@ 2014-07-30  9:24   ` Alan Schmitt
  2014-07-30  9:46     ` Thorsten Jolitz
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Schmitt @ 2014-07-30  9:24 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1104 bytes --]

On 2014-07-29 19:23, Thorsten Jolitz <tjolitz@gmail.com> writes:

> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> Hello,
>>
>> I'm trying to remap ~C-c '~ to ~<menu> '~ and I'm having some
>> trouble. More specifically, I'm able to initiate the editing part using
>> a global binding to `org-edit-special', but I don't know how to bind the
>> same key to `org-edit-src-exit' when I'm editing a source block. As
>> I suspect I will also need to change the binding for other special edit
>> buffers, I'm wondering if there is a way to do it all at once.
>
> you are in org-mode when you call `org-edit-special', thus you could do
>
> ,----
> | (org-defkey org-mode-map "KEY" `org-edit-special)
> `----
>
>
> then you are in some major-mode with minor-mode 'org-src-mode' active,
> thus
>
> ,----
> | (org-defkey org-src-mode-map "KEY" `org-edit-src-exit)
> `----
>
> should work (completely untested though ...)

It works great, thanks a lot.

A followup question: why use ` and not ' before the function name?

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

[-- Attachment #2: Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: remapping C-c ' to another key
  2014-07-30  9:24   ` Alan Schmitt
@ 2014-07-30  9:46     ` Thorsten Jolitz
  0 siblings, 0 replies; 4+ messages in thread
From: Thorsten Jolitz @ 2014-07-30  9:46 UTC (permalink / raw)
  To: emacs-orgmode

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

Hi Alan, 

> On 2014-07-29 19:23, Thorsten Jolitz <tjolitz@gmail.com> writes:
>
>> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>>
>>> Hello,
>>>
>>> I'm trying to remap ~C-c '~ to ~<menu> '~ and I'm having some
>>> trouble. More specifically, I'm able to initiate the editing part using
>>> a global binding to `org-edit-special', but I don't know how to bind the
>>> same key to `org-edit-src-exit' when I'm editing a source block. As
>>> I suspect I will also need to change the binding for other special edit
>>> buffers, I'm wondering if there is a way to do it all at once.
>>
>> you are in org-mode when you call `org-edit-special', thus you could do
>>
>> ,----
>> | (org-defkey org-mode-map "KEY" `org-edit-special)
>> `----
>>
>>
>> then you are in some major-mode with minor-mode 'org-src-mode' active,
>> thus
>>
>> ,----
>> | (org-defkey org-src-mode-map "KEY" `org-edit-src-exit)
>> `----
>>
>> should work (completely untested though ...)
>
> It works great, thanks a lot.
>
> A followup question: why use ` and not ' before the function name?

Should be a normal quote ', this is just a typo!
Although it does not hurt in this case, but anyway ...

-- 
cheers,
Thorsten

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-30  9:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-29 14:50 remapping C-c ' to another key Alan Schmitt
2014-07-29 17:23 ` Thorsten Jolitz
2014-07-30  9:24   ` Alan Schmitt
2014-07-30  9:46     ` Thorsten Jolitz

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).