Re: [O] keybindings again...

2017-06-30 Thread Emanuel Berg
Jean-Christophe Helary wrote:

> Thank you for the pointer. Although I don't
> think I ever used a teletypewriter in my life
> :) Maybe sometimes in the 21st century we'll
> have to think about a change in
> terminology...

In computers, but also in just any brand of
engineering (and other areas as well), there
are tons of cases when terminology is either
outdated or just plain wrong. When there is
a correct term, as in "chainwheel" or
"sprocket" as opposed to "cog" (which is
incorrect, as it isn't a cod), it is good to
know about the correct terms and use them
whenever, but it is equally necessary to know
about the incorrect term. You will find
respectable books when they refer to a sprocket
as a "cog" without blinking! And know what,
that book is healthy for you to
read nonetheless!

So in most cases it is better to use the
correct term in parallel and if the technically
incorrect one dies, good, if it survives, so
be it.

Another example: There were once a newsreader
called GNUS. When a new newsreader came, and
they thought of calling it "ding" as in "ding
is not GNUS". Clever, but it didn't take.
So now it is Gnus who isn't GNUS. But it is -
only better :)

As for the ttys they are also called "the
console" or "the Linux virtual terminals" (the
Linux VTs). All those are designations are fine
and at least "tty" and "console" are also part
of technology by now: e.g., I just mentioned
the file /etc/console-setup/remap.inc in
another post; as for "tty", do

$ ls /dev/ | grep tty

> I use the compact manual [...]

Bigger always better :)

-- 
underground experts united
http://user.it.uu.se/~embe8573




Re: [O] keybindings again...

2017-06-30 Thread Michael Ax

Also $ xmodmap  .. if you should see an empty row in the output,
and a whole bunch of things clustered on the last line, then ..

write an ~/.Xmodmap to free up caps-lock and to have it act as the 
Hyper_L key.
two more lines move that modifier into the free row and you get an easy 
to hit

 on activation via $ xmodmap ~/.Xmodmap

With a US keyboard you might need to create that file, otherwise just add:

clear Lock
keycode 66 = Hyper_L
remove mod4 = Hyper_L
add mod3 = Hyper_L

I never worked out how to do this in the terminal as emacs is unusable 
in the
terminal on my debians (since i can remember; i use zile there 
instead).  one

could maybe make Hyper work outside X via /etc/console-setup/ [remap.inc]

p.s. C-x h  is your friend. you can not bind H-S-n, but you can bind H-N 
(for example)

$ xev  also shows the limits of what you can and can't bind.

iac, Caps-lock Enter is refreshingly easy to hit.   hope this helps!

Sure! Improvements to documentation are always welcome.


Ok, I'll put that on my todo list now that I have solved that shortcut issue... 
:)

Jean-Christophe




Re: [O] keybindings again...

2017-06-30 Thread Jean-Christophe Helary

> On Jun 30, 2017, at 17:14, Nicolas Goaziou  wrote:

>> So, I have a few suggestions to improve that part of the documentation:
>> 1) add a list of preset keys in the manual
>> 2) add a line about speed keys in the compact guide
>> 
>> That's something I could do if the idea is accepted.
> 
> Sure! Improvements to documentation are always welcome.

Ok, I'll put that on my todo list now that I have solved that shortcut issue... 
:)

Jean-Christophe 


Re: [O] keybindings again...

2017-06-30 Thread Nicolas Goaziou
Jean-Christophe Helary  writes:

> The alternative to M-S-RET is C-c C-x M = C-c C-x S-m
>
> Why set an alternative like this when ESC RET S- does exactly 
> the same thing and is way shorter/more practical ?

"practical" is in the eye of the beholder. 

For example, I can type "C-c C-x M" without moving my hands out of the
home row. Both ESC and right arrow require me to quit that position.
I prefer the first one without an hesitation.

> After looking at the "big" manual, I found about speed keys which seem
> to be a much more pragmatic approach to sorting that gui/tty key issue
> in org-mode. But except for a small paragraph and a few items in the
> tty section I could not find any reference to them, and nothing at all
> in the compact manual.
>
> So, I have a few suggestions to improve that part of the documentation:
> 1) add a list of preset keys in the manual
> 2) add a line about speed keys in the compact guide
>
> That's something I could do if the idea is accepted.

Sure! Improvements to documentation are always welcome.

Thank you.

Regards,



Re: [O] keybindings again...

2017-06-30 Thread Jean-Christophe Helary

> On Jun 30, 2017, at 14:27, Nicolas Goaziou  wrote:
> 
>> It would be nice if the org manual mentioned that too, and give
>> alternative keybindings for use in the terminal because that's
>> extremely confusing.
> 
> It does: (info "(org) TTY keys").

The alternative to M-S-RET is C-c C-x M = C-c C-x S-m

Why set an alternative like this when ESC RET S- does exactly the 
same thing and is way shorter/more practical ?

> See also `org-replace-disputed-keys'.

After looking at the "big" manual, I found about speed keys which seem to be a 
much more pragmatic approach to sorting that gui/tty key issue in org-mode. But 
except for a small paragraph and a few items in the tty section I could not 
find any reference to them, and nothing at all in the compact manual.

So, I have a few suggestions to improve that part of the documentation:
1) add a list of preset keys in the manual
2) add a line about speed keys in the compact guide

That's something I could do if the idea is accepted.

Jean-Christophe 

ps: section C3 of the manual has this line about Sacha Chua: "Sacha Chua 
suggested copying some linking code from Planner, and helped make Org pupular 
through her blog." It should be "popular" not "pupular".


Re: [O] keybindings again...

2017-06-30 Thread Jean-Christophe Helary
Eli and Yuri,

Thank you *so much* for the thorough explanations. Now I know.
After having finally understood how git was working I was going back to my list 
of things to do for/with emacs and got frustrated by that shortcut that kept 
not working...

Jean-Christophe 

> On Jun 30, 2017, at 15:17, Eli Zaretskii  wrote:
> 
>> From: Jean-Christophe Helary 
>> Do you mean that Shift is not recognized as a modified key by the terminal ?
> 
> No, that's not it.



Re: [O] keybindings again...

2017-06-30 Thread Jean-Christophe Helary

> On Jun 30, 2017, at 14:27, Nicolas Goaziou  wrote:

>> It would be nice if the org manual mentioned that too, and give
>> alternative keybindings for use in the terminal because that's
>> extremely confusing.
> 
> It does: (info "(org) TTY keys").

Thank you for the pointer. Although I don't think I ever used a teletypewriter 
in my life :) Maybe sometimes in the 21st century we'll have to think about a 
change in terminology...

I use the compact manual as a reference for my uses and I find it extremely 
useful for beginners. Would it be possible to insert a few line on that subject 
in there too? Something like "People who use org-mode in a tty terminal should 
refer to section 15.9 of the manual for alternative key bindings."

> See also `org-replace-disputed-keys'.

Thank you.

Jean-Christophe


Re: [O] keybindings again...

2017-06-30 Thread Yuri Khan
On Fri, Jun 30, 2017 at 12:10 PM, Jean-Christophe Helary
 wrote:

>> I'm trying to assign M-S-RET to org-insert-todo-heading because for some 
>> reason it is not assigned by default: every time I hit ESC S-RET I get ESC 
>> RET only.
>>
>> It's the limitation of the terminal.
>
> Do you mean that Shift is not recognized as a modified key by the terminal ?

A brief recap of terminal limitations, from a guy who has never used a
real hardware terminal.

The protocol by which a terminal passes keystrokes to an application
is that of an ASCII character stream, with only minor extensions
(these days it’s a UTF-8-encoded character stream). It predates the
notion of keyboard as an interactive input device.

In that protocol, there are 32 control characters with codes 0 through
31 (decimal). They are associated with Ctrl+@, Ctrl+A, …, Ctrl+Z,
Ctrl+[, Ctrl+\, Ctrl+], Ctrl+^ and Ctrl+_, and terminals pass these
character codes when these key combinations are pressed, with or
without Shift. Also, there is the control character 127, sometimes
written as Ctrl+?.

Additionally, the most frequent of these control characters have been
given single keys. These are RET = Ctrl+M, TAB = Ctrl+I, ESC = Ctrl+[,
sometimes BS = Ctrl+H, and sometimes DEL = Ctrl+?.

It follows that many terminals emit identical character codes for C-m,
C-M, RET and S-RET; C-i, C-I, TAB and S-TAB; C-[, C-{, ESC and S-ESC;
and C-?, DEL and S-DEL; the application running on the other side
cannot distinguish them.


GUI systems, on the other hand, were developed after keyboards had
been available for many years. Thus, most of they do allow
applications to distinguish any keys with any modifiers.

Some GUI terminal emulators have taken advantage of their GUI nature,
and started passing distinct escape sequences for some key
combinations. For example, Xterm emits ESC [ Z when I press Shift+Tab.

Some GUI terminal emulators also let the user customize which
character sequences they send on which keys.



Re: [O] keybindings again...

2017-06-30 Thread Eli Zaretskii
> From: Jean-Christophe Helary 
> Date: Fri, 30 Jun 2017 14:10:50 +0900
> 
> Do you mean that Shift is not recognized as a modified key by the terminal ?

No, that's not it.  The problem is that on a TTY, the way Emacs reads
keyboard input returns only characters, it doesn't return function
keys.  So Shift-a returns 'A', because the keyboard driver generates
an upper-case A when you type that.  But there's no up-cased RET
character, so you get just RET.

Keys like F1 work on a TTY by emitting a sequence of characters,
usually starting with ESC, and Emacs binds that sequence in special
keymaps in a way that produces the symbol F1.  But Shift-RET doesn't
produce any such sequence, so there's nothing Emacs can do in that
case.



Re: [O] keybindings again...

2017-06-29 Thread Kaushal Modi
On Fri, Jun 30, 2017 at 1:12 AM Jean-Christophe Helary <
jean.christophe.hel...@gmail.com> wrote:

>
> Do you mean that Shift is not recognized as a modified key by the terminal
> ?
>

That's my understanding. Also, I rarely use emacs with -nw (as I would
otherwise miss PNG and PDF support), so I am not an expert on this subject.
But based on some reading, it has to do with the type of terminal emulator
you are using. This[1] might help.


> > If you do C-h c Esc+Shift+Return, Emacs will detect only Esc+Return. So
> you will see M-RET in the echo area.
> >
> > You probably just need to use some other binding.
>
> It would be nice if the org manual mentioned that too, and give
> alternative keybindings for use in the terminal because that's extremely
> confusing.
>

I cannot comment on that as this probably has to do with the terminal
emulator and not emacs. In any case, it might be better to submit an emacs
bug report (M-x report-emacs-bug) requesting this mention in the manual.

This node already mentions something on this topic:

(elisp) Other Char Bits

but just not using the "Ctrl + Shift + .." example.


[1]: https://emacs.stackexchange.com/a/13957/115
-- 

Kaushal Modi


Re: [O] keybindings again...

2017-06-29 Thread Nicolas Goaziou
Hello,

Jean-Christophe Helary  writes:

> It would be nice if the org manual mentioned that too, and give
> alternative keybindings for use in the terminal because that's
> extremely confusing.

It does: (info "(org) TTY keys").

See also `org-replace-disputed-keys'.

Regards,

-- 
Nicolas Goaziou



Re: [O] keybindings again...

2017-06-29 Thread Jean-Christophe Helary

> On Jun 30, 2017, at 11:51, Kaushal Modi  wrote:
> 
> On Thu, Jun 29, 2017 at 10:43 PM Jean-Christophe Helary 
> > 
> wrote:
> I'm using emacs built from master, emacs -nw, after moving .emacs.el and 
> .emacs.d away, on OSX 10.12.
> 
> 
> I'm trying to assign M-S-RET to org-insert-todo-heading because for some 
> reason it is not assigned by default: every time I hit ESC S-RET I get ESC 
> RET only.
> 
> It's the limitation of the terminal.

Do you mean that Shift is not recognized as a modified key by the terminal ?

> If you do C-h c Esc+Shift+Return, Emacs will detect only Esc+Return. So you 
> will see M-RET in the echo area.
> 
> You probably just need to use some other binding.

It would be nice if the org manual mentioned that too, and give alternative 
keybindings for use in the terminal because that's extremely confusing.

Jean-Christophe Helary 

Re: [O] keybindings again...

2017-06-29 Thread Kaushal Modi
On Thu, Jun 29, 2017 at 10:43 PM Jean-Christophe Helary <
jean.christophe.hel...@gmail.com> wrote:

> I'm using emacs built from master, emacs -nw, after moving .emacs.el and
> .emacs.d away, on OSX 10.12.
>
>
> I'm trying to assign M-S-RET to org-insert-todo-heading because for some
> reason it is not assigned by default: every time I hit ESC S-RET I get ESC
> RET only.
>

It's the limitation of the terminal.

If you do C-h c Esc+Shift+Return, Emacs will detect only Esc+Return. So you
will see M-RET in the echo area.

You probably just need to use some other binding.
-- 

Kaushal Modi


[O] keybindings again...

2017-06-29 Thread Jean-Christophe Helary
I'm using emacs built from master, emacs -nw, after moving .emacs.el and 
.emacs.d away, on OSX 10.12.


I'm trying to assign M-S-RET to org-insert-todo-heading because for some reason 
it is not assigned by default: every time I hit ESC S-RET I get ESC RET only.

So, I tried things from
http://ergoemacs.org/emacs/keystroke_rep.html

First, this works fine:
(global-set-key (kbd "M-b") 'org-insert-todo-heading)

But this doesn't:
(global-set-key (kbd "M-") 'org-insert-todo-heading)

What I get here is the old M-return = org-insert-heading.

What is the problem here ?

Jean-Christophe