emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to re-bind C-,?
@ 2014-09-26 17:07 Grant Rettke
  2014-09-26 17:17 ` Jorge A. Alfaro-Murillo
  2014-09-27 12:30 ` Teika Kazura
  0 siblings, 2 replies; 8+ messages in thread
From: Grant Rettke @ 2014-09-26 17:07 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

Good afternoon,

╭────
│ (print emacs-version)
│ (print org-version)
╰────

╭────
│ "24.3.1"
│
│ "8.2.7c"
╰────

My goal was to set a new keybinding for two keys like this:

╭────
│ (local-set-key (kbd "C-,") (lambda () (interactive) (insert " \\larr ")))
│ (local-set-key (kbd "C-.") (lambda () (interactive) (insert " \\rarr ")))
╰────

The second works fine. The first does not; it stays bound to
`org-cycle-agenda-files' instead. Trying to remove it first and the bind
it I did:

╭────
│ (local-unset-key (kbd "C-,"))
│ (local-set-key (kbd "C-,") (lambda () (interactive) (insert " \\larr ")))
╰────

With no effect. That got me wondering if the binding occurred to
`org-cycle-agenda-files' /after/ mine. I don't think it that is possible
or likely because I do not customize agenda at all either via the UI or
Lisp.

Not sure if I am facing a Lisp thing or where to start.

What do you folks think I ought to do here?

Kind regards,


-- 
Grant Rettke
gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson

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

* Re: How to re-bind C-,?
  2014-09-26 17:07 How to re-bind C-,? Grant Rettke
@ 2014-09-26 17:17 ` Jorge A. Alfaro-Murillo
  2014-09-26 20:06   ` Grant Rettke
  2014-09-27 12:30 ` Teika Kazura
  1 sibling, 1 reply; 8+ messages in thread
From: Jorge A. Alfaro-Murillo @ 2014-09-26 17:17 UTC (permalink / raw)
  To: emacs-orgmode

Grant Rettke writes: 

> My goal was to set a new keybinding for two keys like this: 
> 
> ╭──── │ (local-set-key (kbd "C-,") (lambda () (interactive) 
> (insert " \\larr "))) │ (local-set-key (kbd "C-.") (lambda () 
> (interactive) (insert " \\rarr "))) ╰──── 
> 
> The second works fine. The first does not; it stays bound to 
> `org-cycle-agenda-files' instead.

For me `org-cycle-agenda-files' is bound to C-', not C-, maybe you 
have something that sets C-' to C-, globally? 

Best,
-- 
Jorge.

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

* Re: How to re-bind C-,?
  2014-09-26 17:17 ` Jorge A. Alfaro-Murillo
@ 2014-09-26 20:06   ` Grant Rettke
  2014-09-26 20:25     ` Jorge A. Alfaro-Murillo
  0 siblings, 1 reply; 8+ messages in thread
From: Grant Rettke @ 2014-09-26 20:06 UTC (permalink / raw)
  To: Jorge A. Alfaro-Murillo; +Cc: emacs-orgmode@gnu.org

On Fri, Sep 26, 2014 at 12:17 PM, Jorge A. Alfaro-Murillo
<jorge.alfaro-murillo@yale.edu> wrote:
> Grant Rettke writes:

> For me `org-cycle-agenda-files' is bound to C-', not C-, maybe you have
> something that sets C-' to C-, globally?

Definitely, here in my .emacs.el:

╭────
│ (global-set-key (kbd "C-;") 'vc-next-action)
│ (global-set-key (kbd "C-'") 'er/expand-region)
╰────

I /thought/ that was *OK*. Later in the `org-mode-hook' function I call:

╭────
│ (local-set-key (kbd "C-,") (lambda () (interactive) (insert " \\larr ")))
│ (local-set-key (kbd "C-.") (lambda () (interactive) (insert " \\rarr ")))
╰────

The help documentation for `org-cycle-agenda-files' says:

      C-, runs the command org-cycle-agenda-files, which is an
      interactive autoloaded compiled Lisp function in `org.el'.

      It is bound to C-', C-,, <menu-bar> <Org> <File List for
      Agenda> <Cycle through agenda files>.

What I am stumped on is:
• What did I do wrong?
• How do I fix it?

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

* Re: How to re-bind C-,?
  2014-09-26 20:06   ` Grant Rettke
@ 2014-09-26 20:25     ` Jorge A. Alfaro-Murillo
  2014-09-26 21:03       ` Jorge A. Alfaro-Murillo
  0 siblings, 1 reply; 8+ messages in thread
From: Jorge A. Alfaro-Murillo @ 2014-09-26 20:25 UTC (permalink / raw)
  To: emacs-orgmode

Grant Rettke writes: 

> On Fri, Sep 26, 2014 at 12:17 PM, Jorge A. Alfaro-Murillo 
> <jorge.alfaro-murillo@yale.edu> wrote: 
>> For me `org-cycle-agenda-files' is bound to C-', not C-, maybe 
>> you have something that sets C-' to C-, globally? 
> 
> Definitely, here in my .emacs.el: 
> 
> ╭──── │ (global-set-key (kbd "C-;") 'vc-next-action) │ 
> (global-set-key (kbd "C-'") 'er/expand-region) ╰──── 

That is very strange. It is that the line in your .emacs for C-'? 
Outside of org files, does C-, work as expected, or does it expand 
the region?
-- 
Jorge.

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

* Re: How to re-bind C-,?
  2014-09-26 20:25     ` Jorge A. Alfaro-Murillo
@ 2014-09-26 21:03       ` Jorge A. Alfaro-Murillo
  2014-09-27  1:39         ` Grant Rettke
  0 siblings, 1 reply; 8+ messages in thread
From: Jorge A. Alfaro-Murillo @ 2014-09-26 21:03 UTC (permalink / raw)
  To: emacs-orgmode

Jorge A. Alfaro-Murillo writes: 

> Grant Rettke writes:  
> 
>> On Fri, Sep 26, 2014 at 12:17 PM, Jorge A. Alfaro-Murillo 
>> <jorge.alfaro-murillo@yale.edu> wrote:  
>>> For me `org-cycle-agenda-files' is bound to C-', not C-, maybe 
>>> you have something that sets C-' to C-, globally?  
>> 
>> Definitely, here in my .emacs.el:  
>> 
>> ╭──── │ (global-set-key (kbd "C-;") 'vc-next-action) │ 
>> (global-set-key (kbd "C-'") 'er/expand-region) ╰────  
> 
> That is very strange. It is that the line in your .emacs for 
> C-'?  Outside of org files, does C-, work as expected, or does 
> it expand the region? 

I mean the only line in your .emacs for C-'

-- 
Jorge.

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

* Re: How to re-bind C-,?
  2014-09-26 21:03       ` Jorge A. Alfaro-Murillo
@ 2014-09-27  1:39         ` Grant Rettke
  0 siblings, 0 replies; 8+ messages in thread
From: Grant Rettke @ 2014-09-27  1:39 UTC (permalink / raw)
  To: Jorge A. Alfaro-Murillo; +Cc: emacs-orgmode@gnu.org

Yes it is the only time it is globally bound.

On Fri, Sep 26, 2014 at 4:03 PM, Jorge A. Alfaro-Murillo
<jorge.alfaro-murillo@yale.edu> wrote:
> Jorge A. Alfaro-Murillo writes:
>>
>> Grant Rettke writes:
>>>
>>> On Fri, Sep 26, 2014 at 12:17 PM, Jorge A. Alfaro-Murillo
>>> <jorge.alfaro-murillo@yale.edu> wrote:
>>>>
>>>> For me `org-cycle-agenda-files' is bound to C-', not C-, maybe you have
>>>> something that sets C-' to C-, globally?
>>>
>>>
>>> Definitely, here in my .emacs.el:
>>> ╭──── │ (global-set-key (kbd "C-;") 'vc-next-action) │ (global-set-key
>>> (kbd "C-'") 'er/expand-region) ╰────
>>
>>
>> That is very strange. It is that the line in your .emacs for C-'?  Outside
>> of org files, does C-, work as expected, or does it expand the region?
>
>
> I mean the only line in your .emacs for C-'
>
> --
> Jorge.
>
>



-- 
Grant Rettke
gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson

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

* Re: How to re-bind C-,?
  2014-09-26 17:07 How to re-bind C-,? Grant Rettke
  2014-09-26 17:17 ` Jorge A. Alfaro-Murillo
@ 2014-09-27 12:30 ` Teika Kazura
  2014-09-27 14:11   ` Grant Rettke
  1 sibling, 1 reply; 8+ messages in thread
From: Teika Kazura @ 2014-09-27 12:30 UTC (permalink / raw)
  To: gcr; +Cc: emacs-orgmode

How about this?
(define-key org-mode-map [(control ?,)] 'your-lambda-expression)

Teika (Teika kazura)

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

* Re: How to re-bind C-,?
  2014-09-27 12:30 ` Teika Kazura
@ 2014-09-27 14:11   ` Grant Rettke
  0 siblings, 0 replies; 8+ messages in thread
From: Grant Rettke @ 2014-09-27 14:11 UTC (permalink / raw)
  To: Teika Kazura; +Cc: emacs-orgmode@gnu.org

That works as expected.

Thank very much Jorge and Teika.

Bit of a mystery why that local-set-key didn't work; and I'm OK with
it remaining so :).

On Sat, Sep 27, 2014 at 7:30 AM, Teika Kazura <teika@gmx.com> wrote:
> How about this?
> (define-key org-mode-map [(control ?,)] 'your-lambda-expression)
>
> Teika (Teika kazura)



-- 
Grant Rettke
gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson

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

end of thread, other threads:[~2014-09-27 14:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-26 17:07 How to re-bind C-,? Grant Rettke
2014-09-26 17:17 ` Jorge A. Alfaro-Murillo
2014-09-26 20:06   ` Grant Rettke
2014-09-26 20:25     ` Jorge A. Alfaro-Murillo
2014-09-26 21:03       ` Jorge A. Alfaro-Murillo
2014-09-27  1:39         ` Grant Rettke
2014-09-27 12:30 ` Teika Kazura
2014-09-27 14:11   ` Grant Rettke

Code repositories for project(s) associated with this public 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).