all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* keybindings for c-i and tab
@ 2006-11-16 13:31 Tyler
  2006-11-16 13:54 ` Juanma Barranquero
       [not found] ` <mailman.713.1163685325.2155.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Tyler @ 2006-11-16 13:31 UTC (permalink / raw)


Hi,

I'm working in Auctex mode, and I want to bind tex-font italics to C-i. 
I couldn't figure out the set-key code directly, but I did manage to get 
a macro to work:

(fset 'italicizer
    "\C-c\C-f\C-i")
(global-set-key "\C-i" 'italicizer)

However, I've discovered that C-i and tab are mystically linked. So my 
macro works for C-i, which I want, but also for tab, which I don't. Is 
there some way to tell emacs not to equate C-i and tab?

Thanks!

Tyler

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

* Re: keybindings for c-i and tab
  2006-11-16 13:31 keybindings for c-i and tab Tyler
@ 2006-11-16 13:54 ` Juanma Barranquero
       [not found] ` <mailman.713.1163685325.2155.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Juanma Barranquero @ 2006-11-16 13:54 UTC (permalink / raw)
  Cc: help-gnu-emacs

On 11/16/06, Tyler <tyler.smith@mail.mcgill.ca> wrote:

> However, I've discovered that C-i and tab are mystically linked. So my
> macro works for C-i, which I want, but also for tab, which I don't.

Nothing mystic:

 (lookup-key function-key-map [tab])  =>  [9]

> Is there some way to tell emacs not to equate C-i and tab?

You can

  (define-key function-key-map [tab] nil)

But then, many functions bound to C-I (like completion, or automatic
indentation) won't work with the tab key. You'll have to type C-I. Not
very pretty.

                    /L/e/k/t/u

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

* Re: keybindings for c-i and tab
       [not found] ` <mailman.713.1163685325.2155.help-gnu-emacs@gnu.org>
@ 2006-11-16 14:03   ` Tyler
  2006-11-16 14:49     ` Perry Smith
  2006-11-16 15:13     ` Juanma Barranquero
  0 siblings, 2 replies; 5+ messages in thread
From: Tyler @ 2006-11-16 14:03 UTC (permalink / raw)


Juanma Barranquero wrote:
> You can
> 
>  (define-key function-key-map [tab] nil)
> 
> But then, many functions bound to C-I (like completion, or automatic
> indentation) won't work with the tab key. You'll have to type C-I. Not
> very pretty.
> 
That's not good. I use tab for completion and auto-fill, or at least I 
did until I discovered it conflicted with my intended use of C-i. So am 
I correct in assuming that I can't bind anything to C-i without also 
binding it to tab, unless I elect to turn off tab entirely with your 
solution?

Thanks for the quick response,

Tyler

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

* Re: keybindings for c-i and tab
  2006-11-16 14:03   ` Tyler
@ 2006-11-16 14:49     ` Perry Smith
  2006-11-16 15:13     ` Juanma Barranquero
  1 sibling, 0 replies; 5+ messages in thread
From: Perry Smith @ 2006-11-16 14:49 UTC (permalink / raw)
  Cc: help-gnu-emacs


[-- Attachment #1.1: Type: text/plain, Size: 1448 bytes --]

On Nov 16, 2006, at 2:03 PM, Tyler wrote:

> Juanma Barranquero wrote:
>> You can
>>  (define-key function-key-map [tab] nil)
>> But then, many functions bound to C-I (like completion, or automatic
>> indentation) won't work with the tab key. You'll have to type C-I.  
>> Not
>> very pretty.
> That's not good. I use tab for completion and auto-fill, or at  
> least I did until I discovered it conflicted with my intended use  
> of C-i. So am I correct in assuming that I can't bind anything to C- 
> i without also binding it to tab, unless I elect to turn off tab  
> entirely with your solution?

Your first note said "mystically linked" -- they produce the same  
ascii code.  Control-I is "tab".

Now, on X11 and probably other window based emacs implementation,  
there is a tab key that you can put into a keymap (as the previous  
note shows).

So, it might be that you can do a special dance and get the two to be  
bound separately.  But I think it will become a maintenance problem.

I would try saving the current binding of tab.  Set your new binding  
for control-I.  And then restore the original binding of tab.  I'm  
assuming the default binding of tab is somehow an indirection to the  
binding of control-i but I don't know the details.

I'm not sure this helps...

Perry Smith
Ease Software, Inc.
pedz@easesoftware.com
http://www.easesoftware.com

Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems




[-- Attachment #1.2: Type: text/html, Size: 5705 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

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

* Re: keybindings for c-i and tab
  2006-11-16 14:03   ` Tyler
  2006-11-16 14:49     ` Perry Smith
@ 2006-11-16 15:13     ` Juanma Barranquero
  1 sibling, 0 replies; 5+ messages in thread
From: Juanma Barranquero @ 2006-11-16 15:13 UTC (permalink / raw)
  Cc: help-gnu-emacs

On 11/16/06, Tyler <tyler.smith@mail.mcgill.ca> wrote:

> So am
> I correct in assuming that I can't bind anything to C-i without also
> binding it to tab, unless I elect to turn off tab entirely with your
> solution?

I think this could work:

 (add-hook 'AUCTEX-MODE-HOOK
           #'(lambda ()
               (local-set-key [tab] (local-key-binding [9]))
               (local-set-key [9] 'YOUR-FUNCTION)))

where AUCTEX-MODE-HOOK is the hook for Auctex mode (assuming it has
one), and YOUR-FUNCTION is the function you want to bind to C-I but
not to tab.

                    /L/e/k/t/u

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

end of thread, other threads:[~2006-11-16 15:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-16 13:31 keybindings for c-i and tab Tyler
2006-11-16 13:54 ` Juanma Barranquero
     [not found] ` <mailman.713.1163685325.2155.help-gnu-emacs@gnu.org>
2006-11-16 14:03   ` Tyler
2006-11-16 14:49     ` Perry Smith
2006-11-16 15:13     ` Juanma Barranquero

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.