all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* C-= ?
@ 2015-07-18 18:32 Sharon Kimble
  2015-07-18 19:28 ` Emanuel Berg
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Sharon Kimble @ 2015-07-18 18:32 UTC (permalink / raw)
  To: help-gnu-emacs

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

What is the macro/code or whatever that shows the tree of a file, i.e.
an outline of the file showing all its section headings, chapter
headings, etc in a separate buffer above your working buffer, and is
called by "C-=". I did use it very successfully, but I overwrote its key
sequence but now want to re-associate it and use it again. Can you help
please?

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
Debian 8.0, fluxbox 1.3.7, emacs 24.5.50.2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

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

* Re: C-= ?
  2015-07-18 18:32 C-= ? Sharon Kimble
@ 2015-07-18 19:28 ` Emanuel Berg
  2015-07-18 19:33 ` Dmitry Gutov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Emanuel Berg @ 2015-07-18 19:28 UTC (permalink / raw)
  To: help-gnu-emacs

Sharon Kimble <boudiccas@skimble.plus.com> writes:

> What is the macro/code or whatever that shows the
> tree of a file, i.e. an outline of the file showing
> all its section headings, chapter headings, etc in
> a separate buffer above your working buffer, and is
> called by "C-=". I did use it very successfully, but
> I overwrote its key sequence but now want to
> re-associate it and use it again. Can you
> help please?

Remove that config from the init file and
restart Emacs.

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




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

* Re: C-= ?
  2015-07-18 18:32 C-= ? Sharon Kimble
  2015-07-18 19:28 ` Emanuel Berg
@ 2015-07-18 19:33 ` Dmitry Gutov
  2015-07-19  1:26 ` Ian Zimmerman
  2015-07-19  3:37 ` Vaidheeswaran C
  3 siblings, 0 replies; 9+ messages in thread
From: Dmitry Gutov @ 2015-07-18 19:33 UTC (permalink / raw)
  To: Sharon Kimble, help-gnu-emacs

On 07/18/2015 09:32 PM, Sharon Kimble wrote:
> What is the macro/code or whatever that shows the tree of a file, i.e.
> an outline of the file showing all its section headings, chapter
> headings, etc in a separate buffer above your working buffer, and is
> called by "C-=".

There's no binding on `C-=' by default. You probably mean a command from 
a third-party package, line helm-imenu.

Or `M-x speedbar', maybe?



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

* Re: C-= ?
  2015-07-18 18:32 C-= ? Sharon Kimble
  2015-07-18 19:28 ` Emanuel Berg
  2015-07-18 19:33 ` Dmitry Gutov
@ 2015-07-19  1:26 ` Ian Zimmerman
  2015-07-19  8:10   ` Emanuel Berg
  2015-07-19  3:37 ` Vaidheeswaran C
  3 siblings, 1 reply; 9+ messages in thread
From: Ian Zimmerman @ 2015-07-19  1:26 UTC (permalink / raw)
  To: help-gnu-emacs

On 2015-07-18 19:32 +0100, Sharon Kimble wrote:

> called by "C-=".

Hi Sharon, as others already explained there's no command bound to that
combination in vanilla emacs, so you must investigate what other code
you use that could possibly do that.

I'll just add that there's a good reason emacs doesn't use this "key":
there's no ASCII code Control-=, so such a binding will not work in
emacs running on a text terminal, including an emulated terminal like
xterm.  It can only work in a true GUI emacs session where emacs knows
about every physical key press and release.

For this reason I try to avoid similar bindings in my own code.  Even
though I always use GUI emacs for normal code editing work, there are
special situations when it is not practical.  For example I am typing
this message in an emacs running on my email server, over a normal ssh
terminal connection.  It works great, it even looks exactly like my GUI
emacs thanks to my choice of faces, but pressing Control-= just enters a
= character :-P

-- 
Please *no* private copies of mailing list or newsgroup messages.
Rule 420: All persons more than eight miles high to leave the court.




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

* Re: C-= ?
  2015-07-18 18:32 C-= ? Sharon Kimble
                   ` (2 preceding siblings ...)
  2015-07-19  1:26 ` Ian Zimmerman
@ 2015-07-19  3:37 ` Vaidheeswaran C
  3 siblings, 0 replies; 9+ messages in thread
From: Vaidheeswaran C @ 2015-07-19  3:37 UTC (permalink / raw)
  To: help-gnu-emacs

On Sunday 19 July 2015 12:02 AM, Sharon Kimble wrote:
> What is the macro/code or whatever that shows the tree of a file, i.e.
> an outline of the file showing all its section headings, chapter
> headings, etc in a separate buffer above your working buffer, and is
> called by "C-=". I did use it very successfully, but I overwrote its key
> sequence but now want to re-associate it and use it again. Can you help
> please?
> 
> Thanks
> Sharon.
> 

You are looking for

    M-x org-goto

----------------------------------------------------------------

C-c C-j runs the command org-goto (found in org-mode-map), which is an
interactive compiled Lisp function in ‘org.el’.

It is bound to C-c C-j, <menu-bar> <Org> <Navigate Headings> <Jump>.

(org-goto &optional ALTERNATIVE-INTERFACE)

Look up a different location in the current file, keeping current
visibility.

When you want look-up or go to a different location in a
document, the fastest way is often to fold the entire buffer and
then dive into the tree.  This method has the disadvantage, that
the previous location will be folded, which may not be what you
want.

This command works around this by showing a copy of the current
buffer in an indirect buffer, in overview mode.  You can dive
into the tree in that copy, use org-occur and incremental search
to find a location.  When pressing RET or ‘Q’, the command
returns to the original buffer in which the visibility is still
unchanged.  After RET it will also jump to the location selected
in the indirect buffer and expose the headline hierarchy above.

With a prefix argument, use the alternative interface: e.g. if
‘org-goto-interface’ is 'outline use 'outline-path-completion.





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

* Re: C-= ?
  2015-07-19  1:26 ` Ian Zimmerman
@ 2015-07-19  8:10   ` Emanuel Berg
  2015-07-19  9:15     ` Yuri Khan
  0 siblings, 1 reply; 9+ messages in thread
From: Emanuel Berg @ 2015-07-19  8:10 UTC (permalink / raw)
  To: help-gnu-emacs

Ian Zimmerman <itz@buug.org> writes:

> I'll just add that there's a good reason emacs
> doesn't use this "key": there's no ASCII code
> Control-=, so such a binding will not work in emacs
> running on a text terminal, including an emulated
> terminal like xterm. It can only work in a true GUI
> emacs session where emacs knows about every physical
> key press and release.

It is possible to get C-= up and running in a couple
of minutes in the ttys, which are as far from "true
GUI" anyone will ever want to wander.

I have described this process a couple of times, so
I'll see if I can find a reference. If not, see if you
can deduct it from examining these to files - one
a config file for the tty, and one an Emacs init file.
As ever, that is all you need.

    http://user.it.uu.se/~embe8573/conf/remap.inc
    http://user.it.uu.se/~embe8573/conf/emacs-init/console-keys.el

... Yes, here it is, with some modification to clarify
the process. Originally written 2014-01-23. Seems like
ages ago ...

This file: http://user.it.uu.se/~embe8573/tty-emacs-keys.txt

The Linux console: special shortcuts in Emacs
---------------------------------------------

How to get special shortcuts (e.g., C-0) to work in
a tty Emacs instance. This is the Linux console/VT/tty
solution that works on Debian, and probably on many
other distros as well with minor or
none modifications.

In the file

    /etc/console-setup/remap.inc

put

    control keycode 11 = U+0110

11 is the keycode for the key '0', and you learn that
from showkey(1).

                         -*-

Note: If you use tmux on top of the VT, you might get
this error with showkey:

    Couldn't get a file descriptor referring to the console

If so, do either

    $ sudo showkey                # every time

or

    $ chmod u+s /usr/bin/showkey  # once

If showkey is somewhere else than /usr/bin/showkey, do

    $ type showkey

in bash or zsh to find out where.

                         -*-

Let's return to the line

    control keycode 11 = U+0110

This syntax reads: assign the shortcut C-0 (in Emacs
notation; remember showkey has told us '0 = 11') so
that when pressed, insert the char which has Unicode
U+0110. (That char turns out a diamond in the ttys, so
it must be something fancy that we will never need for
anything else.)

The Unicode (the particular code, i.e. U+0110) is
arbitrary in the sense it doesn't matter what it is as
long as the char isn't in use already. Make it exotic.
When you have found one exotic char, it is easy to
find more just by adding or subtracting one for each
shortcut you add. It is the hexadecimal system.

OK, now save the remap.inc file and use this zsh
function (or a bash equivalent, or just type the
command) to see that it works:

    lkeys () {
      loadkeys -q -c -s /etc/console-setup/remap.inc
    }

Again, do the '+s' thing if you don't want to do sudo
each time. After invoking lkeys, hit C-0 when in the
shell. Now the diamond should appear! (The options to
loadkeys(1) are not relevant to this tutorial, but
I use it for other purposes as well. The man page
tells more, as always.)

Next, in an Emacs init file (.emacs, or if you want to
put such things somewhere else, and then `load-file'
from the main init file), anyway in such a file, put:

    (define-key input-decode-map [?\u0110] [C-0])

Now, hit `C-0' and it should say:

    <C-0> is undefined

which means you can bind it to whatever:

    (global-set-key [C-0] 'switch-buffer)

One last hint: Because you want to load the modified
keymap each time when starting the system, but without
having to input the sudo password, one way to do that
(at least on Debian) is to put:

    loadkeys /etc/console-setup/remap.inc > /dev/null

in

    /etc/rc.local

Tutorial by: Emanuel Berg (embe8573@student.uu.se)
Last modified: July 19, 2015
More cool stuff: http://user.it.uu.se/~embe8573

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




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

* Re: C-= ?
  2015-07-19  8:10   ` Emanuel Berg
@ 2015-07-19  9:15     ` Yuri Khan
  2015-07-19 23:14       ` Emanuel Berg
       [not found]       ` <mailman.7163.1437348015.904.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 9+ messages in thread
From: Yuri Khan @ 2015-07-19  9:15 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

On Sun, Jul 19, 2015 at 2:10 PM, Emanuel Berg <embe8573@student.uu.se> wrote:

>     control keycode 11 = U+0110
>
> This syntax reads: assign the shortcut C-0 (in Emacs
> notation; remember showkey has told us '0 = 11') so
> that when pressed, insert the char which has Unicode
> U+0110. (That char turns out a diamond in the ttys, so
> it must be something fancy that we will never need for
> anything else.)
>
> The Unicode (the particular code, i.e. U+0110) is
> arbitrary in the sense it doesn't matter what it is as
> long as the char isn't in use already. Make it exotic.
> When you have found one exotic char, it is easy to
> find more just by adding or subtracting one for each
> shortcut you add. It is the hexadecimal system.

If you are going to recommend people to hijack arbitrary Unicode
characters for extended keycodes, at least tell them to pick codes
from the Private Use Area (U+E000 up to and including U+F8FF). It’s
the Unicode equivalent of RFC 1918 IP addresses — guaranteed to never
have an official meaning.

You personally might not have any use for the Latin capital letter D
with stroke. But when someone from Vietnam comes around and complains
“My Đ key suddenly stopped working and instead of inserting the letter
as it’s supposed to, it throws me into a different buffer”…


Better yet, design a complete, unambiguous, international-friendly and
backward-compatible keycode system and lobby for its support
out-of-the-box in the Linux tty and Xterm.



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

* Re: C-= ?
  2015-07-19  9:15     ` Yuri Khan
@ 2015-07-19 23:14       ` Emanuel Berg
       [not found]       ` <mailman.7163.1437348015.904.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Emanuel Berg @ 2015-07-19 23:14 UTC (permalink / raw)
  To: help-gnu-emacs

Yuri Khan <yuri.v.khan@gmail.com> writes:

> If you are going to recommend people to hijack
> arbitrary Unicode characters for extended keycodes,
> at least tell them to pick codes from the
> Private Use Area (U+E000 up to and including
> U+F8FF). It is the Unicode equivalent of RFC 1918 IP
> addresses — guaranteed to never have an
> official meaning.

Ha ha, "hijack arbitrary Unicode characters" -
oh, Yuri, you old flatterer!

No, I think I'll do even better, I'll simply include
that whole paragraph in the tutorial, if you
don't mind!

> Better yet, design a complete, unambiguous,
> international-friendly and backward-compatible
> keycode system and lobby for its support
> out-of-the-box in the Linux tty and Xterm.

You forget that I am not in favor of
"international-friendly" stuff in the
computer-computer world, where it should be 512 chars
max and Anglo-American only.

Otherwise I would have done it instantly :)

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




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

* Re: C-= ?
       [not found]       ` <mailman.7163.1437348015.904.help-gnu-emacs@gnu.org>
@ 2015-07-20  2:47         ` Rusi
  0 siblings, 0 replies; 9+ messages in thread
From: Rusi @ 2015-07-20  2:47 UTC (permalink / raw)
  To: help-gnu-emacs

On Monday, July 20, 2015 at 4:50:18 AM UTC+5:30, Emanuel Berg wrote:
> in the computer-computer world, where it should be 512 chars
> max and Anglo-American only.

A 9-bit byte?!?!

Yeah when we were students we studied the CDC-cyber and such which had 60 bit
words...
Didnt expect to find a user of those venerable machines in 2015 on USENET 😉
(Spelt as <wink> for those restricted to vintage equipment)


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

end of thread, other threads:[~2015-07-20  2:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-18 18:32 C-= ? Sharon Kimble
2015-07-18 19:28 ` Emanuel Berg
2015-07-18 19:33 ` Dmitry Gutov
2015-07-19  1:26 ` Ian Zimmerman
2015-07-19  8:10   ` Emanuel Berg
2015-07-19  9:15     ` Yuri Khan
2015-07-19 23:14       ` Emanuel Berg
     [not found]       ` <mailman.7163.1437348015.904.help-gnu-emacs@gnu.org>
2015-07-20  2:47         ` Rusi
2015-07-19  3:37 ` Vaidheeswaran C

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.