all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* S-tab translated to C-y on a mac?
@ 2010-10-17 13:01 Daniel Pittman
  2010-10-17 16:50 ` hazlup
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Pittman @ 2010-10-17 13:01 UTC (permalink / raw)
  To: help-gnu-emacs

G'day.

I have recently needed to run Emacs 23.2 on a MacOS-X host, and have hit a
behaviour that I don't quite understand.  Specifically, Shift-Tab is
translated into Control-y, resulting in a "yank" operation.

Poking around I see a few bits and pieces relating to this, mostly seeming to
sit in the realm of VT100 translation and the like.

Since a quick search couldn't turn up, for me, an easy answer or an
understanding of the multiple layers of translation here (and given it is more
or less time for bed) I am asking your help:

Where should I go looking to most quickly cut through this morass and
understand what is translating my respectable C-tab into an unwelcome C-y?

Regards,
        Daniel
-- 
✣ Daniel Pittman            ✉ daniel@rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons




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

* Re: S-tab translated to C-y on a mac?
  2010-10-17 13:01 S-tab translated to C-y on a mac? Daniel Pittman
@ 2010-10-17 16:50 ` hazlup
  2010-10-18  0:28   ` Daniel Pittman
  0 siblings, 1 reply; 8+ messages in thread
From: hazlup @ 2010-10-17 16:50 UTC (permalink / raw)
  To: Help-gnu-emacs


Are you running emacs from the command line, possibly with -nw. or from the
application launcher?

I've used "installed" emacs on Macs just fine, including recently in a shell
(ssh connection from my laptop).  I suspect something mac-simple is in the
way.  



Daniel Pittman wrote:
> 
> G'day.
> 
> I have recently needed to run Emacs 23.2 on a MacOS-X host, and have hit a
> behaviour that I don't quite understand.  Specifically, Shift-Tab is
> translated into Control-y, resulting in a "yank" operation.
> 
> Poking around I see a few bits and pieces relating to this, mostly seeming
> to
> sit in the realm of VT100 translation and the like.
> 
> Since a quick search couldn't turn up, for me, an easy answer or an
> understanding of the multiple layers of translation here (and given it is
> more
> or less time for bed) I am asking your help:
> 
> Where should I go looking to most quickly cut through this morass and
> understand what is translating my respectable C-tab into an unwelcome C-y?
> 
> Regards,
>         Daniel
> -- 
> ✣ Daniel Pittman            ✉ daniel@rimspace.net            ☎ +61 401 155
> 707
>                ♽ made with 100 percent post-consumer electrons
> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/S-tab-translated-to-C-y-on-a-mac--tp29983353p29984533.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




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

* Re: S-tab translated to C-y on a mac?
  2010-10-17 16:50 ` hazlup
@ 2010-10-18  0:28   ` Daniel Pittman
  2010-10-18  8:38     ` Andrea Crotti
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Pittman @ 2010-10-18  0:28 UTC (permalink / raw)
  To: help-gnu-emacs

hazlup <robjsargent@gmail.com> writes:

> Are you running emacs from the command line, possibly with -nw. or from the
> application launcher?

Sorry, I should have clarified: I am running Emacs 23 from Emacs.app as build
through the sources with '--with-ns', so it is a Cocoa application.

> I've used "installed" emacs on Macs just fine, including recently in a shell
> (ssh connection from my laptop).  I suspect something mac-simple is in the
> way.

This is all (relatively) native GUI stuff. :)

     Daniel
-- 
✣ Daniel Pittman            ✉ daniel@rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons




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

* Re: S-tab translated to C-y on a mac?
  2010-10-18  0:28   ` Daniel Pittman
@ 2010-10-18  8:38     ` Andrea Crotti
  2010-10-18 12:32       ` Daniel Pittman
       [not found]       ` <mailman.1.1287405267.17078.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 8+ messages in thread
From: Andrea Crotti @ 2010-10-18  8:38 UTC (permalink / raw)
  To: help-gnu-emacs

Daniel Pittman <daniel@rimspace.net> writes:
> This is all (relatively) native GUI stuff. :)
>
>      Daniel


+1, I always had the same issue, but I didn't recognize the problem
before since I almost always use the mac version...




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

* Re: S-tab translated to C-y on a mac?
  2010-10-18  8:38     ` Andrea Crotti
@ 2010-10-18 12:32       ` Daniel Pittman
  2010-10-18 12:52         ` Andrea Crotti
       [not found]       ` <mailman.1.1287405267.17078.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel Pittman @ 2010-10-18 12:32 UTC (permalink / raw)
  To: help-gnu-emacs

Andrea Crotti <andrea.crotti.0@gmail.com> writes:
> Daniel Pittman <daniel@rimspace.net> writes:

[... I reported that Cocoa GUI MacOS-X 23 translates S-tab into C-y
     automatically, and wondered how to avoid that ... ]

>> This is all (relatively) native GUI stuff. :)
>
> +1, I always had the same issue, but I didn't recognize the problem
> before since I almost always use the mac version...

So, since I am not the only person who cares: I went looking, and found two
things:

First, the translation is stored in a *copy* of `ns-alternatives-map',
accessible only between the `local-function-key-map' and its parent, injected
there during frame setup.

This will remove the initial translation:

  (define-key (keymap-parent local-function-key-map) [S-tab] nil)

I don't see why that keymap is cloned, but whatever.


Second, if I just add this my binding actually works:

  (global-set-key [S-tab] #'tab-to-tab-stop)

...so, my problem is solved. :)

        Daniel
-- 
✣ Daniel Pittman            ✉ daniel@rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons




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

* Re: S-tab translated to C-y on a mac?
  2010-10-18 12:32       ` Daniel Pittman
@ 2010-10-18 12:52         ` Andrea Crotti
  2010-10-18 13:22           ` Daniel Pittman
  0 siblings, 1 reply; 8+ messages in thread
From: Andrea Crotti @ 2010-10-18 12:52 UTC (permalink / raw)
  To: help-gnu-emacs

Daniel Pittman <daniel@rimspace.net> writes:
> So, since I am not the only person who cares: I went looking, and found two
> things:
>
> First, the translation is stored in a *copy* of `ns-alternatives-map',
> accessible only between the `local-function-key-map' and its parent, injected
> there during frame setup.
>
> This will remove the initial translation:
>
>   (define-key (keymap-parent local-function-key-map) [S-tab] nil)
>
> I don't see why that keymap is cloned, but whatever.
>
>
> Second, if I just add this my binding actually works:
>
>   (global-set-key [S-tab] #'tab-to-tab-stop)
>
> ...so, my problem is solved. :)
>
>         Daniel

Works like a charm, thanks a lot!
Maybe should we write it on the devel list since I guess is a bug?




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

* Re: S-tab translated to C-y on a mac?
  2010-10-18 12:52         ` Andrea Crotti
@ 2010-10-18 13:22           ` Daniel Pittman
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Pittman @ 2010-10-18 13:22 UTC (permalink / raw)
  To: help-gnu-emacs

Andrea Crotti <andrea.crotti.0@gmail.com> writes:
> Daniel Pittman <daniel@rimspace.net> writes:
>
>> So, since I am not the only person who cares: I went looking, and found two
>> things:
>>
>> First, the translation is stored in a *copy* of `ns-alternatives-map',
>> accessible only between the `local-function-key-map' and its parent, injected
>> there during frame setup.
>>
>> This will remove the initial translation:
>>
>>   (define-key (keymap-parent local-function-key-map) [S-tab] nil)
>>
>> I don't see why that keymap is cloned, but whatever.
>>
>>
>> Second, if I just add this my binding actually works:
>>
>>   (global-set-key [S-tab] #'tab-to-tab-stop)
>>
>> ...so, my problem is solved. :)
>
> Works like a charm, thanks a lot!
> Maybe should we write it on the devel list since I guess is a bug?

Actually, it looks to be working as unexpected, but designed: since I can bind
the keystroke in a regular keymap, this is all good.

The only oddity is that S-tab translates to C-y, which presumably has some
NeXTStep related history I don't know.  The remapping stuff is working as
designed, even if that is confusing.

...but feel free to point them at this discussion if you think it justifies a
bug report where I don't.  I am happy to answer questions from the developers
and all. :)

        Daniel
-- 
✣ Daniel Pittman            ✉ daniel@rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons




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

* Re: S-tab translated to C-y on a mac?
       [not found]       ` <mailman.1.1287405267.17078.help-gnu-emacs@gnu.org>
@ 2010-10-18 13:33         ` Stefan Monnier
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2010-10-18 13:33 UTC (permalink / raw)
  To: help-gnu-emacs

[ No idea why S-tab is mapped to C-y, but indeed the Emacs-23 code just
  does that.  Emacs-24 changed it to backtab, which makes more sense to
  my X11-oriented mind. ]

> First, the translation is stored in a *copy* of `ns-alternatives-map',
[...]
> I don't see why that keymap is cloned, but whatever.

Because Emacs keymap don't support multiple inheritance.

> Second, if I just add this my binding actually works:
>   (global-set-key [S-tab] #'tab-to-tab-stop)
> ...so, my problem is solved. :)

FWIW, S-tab is expected to be a "poor man's backtab", i.e. for those
cases where you don't have a backtab key (sadly the most common
situation).  So a "natural" binding would be to be
"reserve-tab-to-tab-stop" that goes to the previous rather than the next
tab stop.


        Stefan


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

end of thread, other threads:[~2010-10-18 13:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-17 13:01 S-tab translated to C-y on a mac? Daniel Pittman
2010-10-17 16:50 ` hazlup
2010-10-18  0:28   ` Daniel Pittman
2010-10-18  8:38     ` Andrea Crotti
2010-10-18 12:32       ` Daniel Pittman
2010-10-18 12:52         ` Andrea Crotti
2010-10-18 13:22           ` Daniel Pittman
     [not found]       ` <mailman.1.1287405267.17078.help-gnu-emacs@gnu.org>
2010-10-18 13:33         ` Stefan Monnier

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.