emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to represent Emacs keystrokes in Org?
@ 2014-11-24 15:53 Marcin Borkowski
  2014-11-24 18:38 ` Rasmus
  0 siblings, 1 reply; 8+ messages in thread
From: Marcin Borkowski @ 2014-11-24 15:53 UTC (permalink / raw)
  To: Org-Mode mailing list

Hello,

I'm writing (in Org) a text on Emacs usage.  How to
correctly/canonically represent keystrokes, like "C-x RET f"?
Currently, I use =C-x RET f=; are there any alternatives?

TIA,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

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

* Re: How to represent Emacs keystrokes in Org?
  2014-11-24 15:53 How to represent Emacs keystrokes in Org? Marcin Borkowski
@ 2014-11-24 18:38 ` Rasmus
  2014-11-29 21:53   ` Marcin Borkowski
  0 siblings, 1 reply; 8+ messages in thread
From: Rasmus @ 2014-11-24 18:38 UTC (permalink / raw)
  To: emacs-orgmode

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> Hello,
>
> I'm writing (in Org) a text on Emacs usage.  How to
> correctly/canonically represent keystrokes, like "C-x RET f"?
> Currently, I use =C-x RET f=; are there any alternatives?

That's what I'd do.  Or ~C-x RET f~.  You could also use a macro, if you
want it to me be more semantic (I hope I use this word correctly).

Cheers,
Rasmus

-- 
⠠⠵

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

* Re: How to represent Emacs keystrokes in Org?
  2014-11-24 18:38 ` Rasmus
@ 2014-11-29 21:53   ` Marcin Borkowski
  2014-11-29 21:58     ` Marcin Borkowski
  2014-11-30  0:50     ` Rasmus
  0 siblings, 2 replies; 8+ messages in thread
From: Marcin Borkowski @ 2014-11-29 21:53 UTC (permalink / raw)
  To: emacs-orgmode


On 2014-11-24, at 19:38, Rasmus wrote:

> Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
>
>> Hello,
>>
>> I'm writing (in Org) a text on Emacs usage.  How to
>> correctly/canonically represent keystrokes, like "C-x RET f"?
>> Currently, I use =C-x RET f=; are there any alternatives?
>
> That's what I'd do.  Or ~C-x RET f~.  You could also use a macro, if you
> want it to me be more semantic (I hope I use this word correctly).

Houston, we've got a problem.  What about =M-,=?  Somehow it seems not
to be interpreted in the right way: it does not get fontified correctly,
nor does export in the right way.  What can I do about it?  I found
about org-emphasis-regexp-components, is it the only way?  Also, how do
I reload Org without restarting Emacs?  (I am an Emacs geek and I try to
beat my record of emacs-uptime, you know. ;-) )

> Cheers,
> Rasmus

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

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

* Re: How to represent Emacs keystrokes in Org?
  2014-11-29 21:53   ` Marcin Borkowski
@ 2014-11-29 21:58     ` Marcin Borkowski
  2015-03-19 21:48       ` Marcin Borkowski
  2014-11-30  0:50     ` Rasmus
  1 sibling, 1 reply; 8+ messages in thread
From: Marcin Borkowski @ 2014-11-29 21:58 UTC (permalink / raw)
  To: emacs-orgmode


On 2014-11-29, at 22:53, Marcin Borkowski wrote:

> On 2014-11-24, at 19:38, Rasmus wrote:
>
>> Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
>>
>>> Hello,
>>>
>>> I'm writing (in Org) a text on Emacs usage.  How to
>>> correctly/canonically represent keystrokes, like "C-x RET f"?
>>> Currently, I use =C-x RET f=; are there any alternatives?
>>
>> That's what I'd do.  Or ~C-x RET f~.  You could also use a macro, if you
>> want it to me be more semantic (I hope I use this word correctly).
>
> Houston, we've got a problem.  What about =M-,=?  Somehow it seems not
> to be interpreted in the right way: it does not get fontified correctly,
> nor does export in the right way.  What can I do about it?  I found
> about org-emphasis-regexp-components, is it the only way?  Also, how do
> I reload Org without restarting Emacs?  (I am an Emacs geek and I try to
> beat my record of emacs-uptime, you know. ;-) )

Wow, I got an idea, and it worked.  Here's an excerpt from `C-u C-x ='
at my solution;-):

             position: 11859 of 16051 (74%), column: 253
            character: ‍ (displayed as ‍) (codepoint 8205, #o20015, #x200d)
    preferred charset: unicode (Unicode (ISO10646))
code point in charset: 0x200D
               syntax: . 	which means: punctuation
             to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME"
          buffer code: #xE2 #x80 #x8D
            file code: #xE2 #x80 #x8D (encoded by coding system utf-8-unix)
              display: by this font (glyph code)
    xft:-unknown-Phetsarath OT-normal-normal-normal-*-17-*-*-*-*-0-iso10646-1 (#x120)

Character code properties: customize what to show
  name: ZERO WIDTH JOINER

A bit ugly trick, but works.  What are the opinions?

Regards,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

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

* Re: How to represent Emacs keystrokes in Org?
  2014-11-29 21:53   ` Marcin Borkowski
  2014-11-29 21:58     ` Marcin Borkowski
@ 2014-11-30  0:50     ` Rasmus
  1 sibling, 0 replies; 8+ messages in thread
From: Rasmus @ 2014-11-30  0:50 UTC (permalink / raw)
  To: emacs-orgmode

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> On 2014-11-24, at 19:38, Rasmus wrote:
>
>> Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
>>
>>> Hello,
>>>
>>> I'm writing (in Org) a text on Emacs usage.  How to
>>> correctly/canonically represent keystrokes, like "C-x RET f"?
>>> Currently, I use =C-x RET f=; are there any alternatives?
>>
>> That's what I'd do.  Or ~C-x RET f~.  You could also use a macro, if you
>> want it to me be more semantic (I hope I use this word correctly).
>
> Houston, we've got a problem.  What about =M-,=?

Might be a bug.  Note, =M-.=? works.

> I found about org-emphasis-regexp-components, is it the only way?

I wouldn't mess with it.  You should define macros for extra stuff.

>Also, how do
> I reload Org without restarting Emacs?  (I am an Emacs geek and I try to
> beat my record of emacs-uptime, you know. ;-) )

M-x org-reload if new version, or M-x org-mode-restart.

—Rasmus

-- 
However beautiful the theory, you should occasionally look at the evidence

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

* Re: How to represent Emacs keystrokes in Org?
  2014-11-29 21:58     ` Marcin Borkowski
@ 2015-03-19 21:48       ` Marcin Borkowski
  2015-03-20  9:04         ` Sebastien Vauban
  2015-03-20  9:17         ` Randomcoder
  0 siblings, 2 replies; 8+ messages in thread
From: Marcin Borkowski @ 2015-03-19 21:48 UTC (permalink / raw)
  To: emacs-orgmode

Hi there,

it seems that reviving old threads is my new hobby;-).

On 2014-11-29, at 22:58, Marcin Borkowski <mbork@wmi.amu.edu.pl> wrote:

> On 2014-11-29, at 22:53, Marcin Borkowski wrote:
>
>> On 2014-11-24, at 19:38, Rasmus wrote:
>>
>>> Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
>>>
>>>> Hello,
>>>>
>>>> I'm writing (in Org) a text on Emacs usage.  How to
>>>> correctly/canonically represent keystrokes, like "C-x RET f"?
>>>> Currently, I use =C-x RET f=; are there any alternatives?
>>>
>>> That's what I'd do.  Or ~C-x RET f~.  You could also use a macro, if you
>>> want it to me be more semantic (I hope I use this word correctly).

This might seem a good idea, but how do I do it?  (See below for
a concrete problem statement.)

>> Houston, we've got a problem.  What about =M-,=?  Somehow it seems not
>> to be interpreted in the right way: it does not get fontified correctly,
>> nor does export in the right way.  What can I do about it?  I found
>> about org-emphasis-regexp-components, is it the only way?  Also, how do
>> I reload Org without restarting Emacs?  (I am an Emacs geek and I try to
>> beat my record of emacs-uptime, you know. ;-) )
>
> Wow, I got an idea, and it worked.  Here's an excerpt from `C-u C-x ='
> at my solution;-):
>
>              position: 11859 of 16051 (74%), column: 253
>             character: ‍ (displayed as ‍) (codepoint 8205, #o20015, #x200d)
>     preferred charset: unicode (Unicode (ISO10646))
> code point in charset: 0x200D
>                syntax: . 	which means: punctuation
>              to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME"
>           buffer code: #xE2 #x80 #x8D
>             file code: #xE2 #x80 #x8D (encoded by coding system utf-8-unix)
>               display: by this font (glyph code)
>     xft:-unknown-Phetsarath OT-normal-normal-normal-*-17-*-*-*-*-0-iso10646-1 (#x120)
>
> Character code properties: customize what to show
>   name: ZERO WIDTH JOINER
>
> A bit ugly trick, but works.  What are the opinions?

After a while I have to say that my opinion is strongly negative: this
breaks LaTeX export.  (LaTeX doesn’t like some unicode characters, it
turns out.)  Also, this was really an ugly hack...

So, here is my problem: how to represent a key like M-, or
e.g. a sequence \, (important in regexps) as “code” or “verbatim stuff”
in org-mode?  Neither =\,= nor ~\,~ work, of course.  Also, I’d like
this to be backend-agnostic, so \texttt{M-,} doesn’t really work.

What is the rationale behind forbidding the comma as the “border”
character in org-emphasis-regexp-components?  Should I change this
variable in my setup or is there a more general way to convince Org that
I really want verbatim/code snippets like =\,=?

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

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

* Re: How to represent Emacs keystrokes in Org?
  2015-03-19 21:48       ` Marcin Borkowski
@ 2015-03-20  9:04         ` Sebastien Vauban
  2015-03-20  9:17         ` Randomcoder
  1 sibling, 0 replies; 8+ messages in thread
From: Sebastien Vauban @ 2015-03-20  9:04 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Marcin Borkowski wrote:
> Hi there,
>
> it seems that reviving old threads is my new hobby;-).
>
> On 2014-11-29, at 22:58, Marcin Borkowski <mbork-12VZH/wba7B4rM3dGMyr8Q@public.gmane.org> wrote:
>
>> On 2014-11-29, at 22:53, Marcin Borkowski wrote:
>>
>>> On 2014-11-24, at 19:38, Rasmus wrote:
>>>
>>>> Marcin Borkowski <mbork-12VZH/wba7B4rM3dGMyr8Q@public.gmane.org> writes:
>>>>
>>>>> Hello,
>>>>>
>>>>> I'm writing (in Org) a text on Emacs usage.  How to
>>>>> correctly/canonically represent keystrokes, like "C-x RET f"?
>>>>> Currently, I use =C-x RET f=; are there any alternatives?
>>>>
>>>> That's what I'd do.  Or ~C-x RET f~.  You could also use a macro, if you
>>>> want it to me be more semantic (I hope I use this word correctly).
>
> This might seem a good idea, but how do I do it?  (See below for
> a concrete problem statement.)
>
>>> Houston, we've got a problem.  What about =M-,=?  Somehow it seems not
>>> to be interpreted in the right way: it does not get fontified correctly,
>>> nor does export in the right way.  What can I do about it?  I found
>>> about org-emphasis-regexp-components, is it the only way?  Also, how do
>>> I reload Org without restarting Emacs?  (I am an Emacs geek and I try to
>>> beat my record of emacs-uptime, you know. ;-) )
>>
>> Wow, I got an idea, and it worked.  Here's an excerpt from `C-u C-x ='
>> at my solution;-):
>>
>>              position: 11859 of 16051 (74%), column: 253
>>             character: ‍ (displayed as ‍) (codepoint 8205, #o20015, #x200d)
>>     preferred charset: unicode (Unicode (ISO10646))
>> code point in charset: 0x200D
>>                syntax: . 	which means: punctuation
>>              to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME"
>>           buffer code: #xE2 #x80 #x8D
>>             file code: #xE2 #x80 #x8D (encoded by coding system utf-8-unix)
>>               display: by this font (glyph code)
>>     xft:-unknown-Phetsarath OT-normal-normal-normal-*-17-*-*-*-*-0-iso10646-1 (#x120)
>>
>> Character code properties: customize what to show
>>   name: ZERO WIDTH JOINER
>>
>> A bit ugly trick, but works.  What are the opinions?
>
> After a while I have to say that my opinion is strongly negative: this
> breaks LaTeX export.  (LaTeX doesn’t like some unicode characters, it
> turns out.)  Also, this was really an ugly hack...
>
> So, here is my problem: how to represent a key like M-, or
> e.g. a sequence \, (important in regexps) as “code” or “verbatim stuff”
> in org-mode?  Neither =\,= nor ~\,~ work, of course.  Also, I’d like
> this to be backend-agnostic, so \texttt{M-,} doesn’t really work.

I'm thinking at something like this (partially untested):

--8<---------------cut here---------------start------------->8---
#+LATEX_HEADER: \usepackage{menukeys}
#+LATEX_HEADER: \let\ORIkeys\keys
#+LATEX_HEADER: \renewcommand{\keys}[1]{\ORIkeys{\texttt{#1}}}
#+LATEX_HEADER: \newcommand{\repeatedkeys}[1]{\keys{\textcolor{gray}{#1}}}

#+MACRO: kbd \keys{$1}
--8<---------------cut here---------------end--------------->8---

Of course, the macro would have to be improved to work at least (in my
case) in both HTML and LaTeX, by using the @@latex:...@@ construct.

> What is the rationale behind forbidding the comma as the “border”
> character in org-emphasis-regexp-components?  Should I change this
> variable in my setup or is there a more general way to convince Org that
> I really want verbatim/code snippets like =\,=?

I share your point about a better `org-emphasis-regexp-components' by
default, which would work in 99.9% of the cases.

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: How to represent Emacs keystrokes in Org?
  2015-03-19 21:48       ` Marcin Borkowski
  2015-03-20  9:04         ` Sebastien Vauban
@ 2015-03-20  9:17         ` Randomcoder
  1 sibling, 0 replies; 8+ messages in thread
From: Randomcoder @ 2015-03-20  9:17 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: emacs-orgmode

Hi Marcin,

I'm going to reference a hangout of Sacha Chua and Xah Lee
where they talked about this https://www.youtube.com/watch?v=rKPKWqvTImA

( you can download it with livestreamer like so
    livestreamer -o xlsc.mp4 https://www.youtube.com/watch?v=rKPKWqvTImA 360p )

At 26:53 Xah Lee starts explaining about how his
setup related to rendering keystrokes in emacs.

At 27:13 he mentions this function => xhm-htmlize-keyboard-shortcut-notation
Apparently this is used to render the keystrokes.

On Thu, Mar 19, 2015 at 10:48:30PM +0100, Marcin Borkowski wrote:
> Hi there,
> 
> it seems that reviving old threads is my new hobby;-).
> 
> On 2014-11-29, at 22:58, Marcin Borkowski <mbork@wmi.amu.edu.pl> wrote:
> 
> > On 2014-11-29, at 22:53, Marcin Borkowski wrote:
> >
> >> On 2014-11-24, at 19:38, Rasmus wrote:
> >>
> >>> Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
> >>>
> >>>> Hello,
> >>>>
> >>>> I'm writing (in Org) a text on Emacs usage.  How to
> >>>> correctly/canonically represent keystrokes, like "C-x RET f"?
> >>>> Currently, I use =C-x RET f=; are there any alternatives?
> >>>
> >>> That's what I'd do.  Or ~C-x RET f~.  You could also use a macro, if you
> >>> want it to me be more semantic (I hope I use this word correctly).
> 
> This might seem a good idea, but how do I do it?  (See below for
> a concrete problem statement.)
> 
> >> Houston, we've got a problem.  What about =M-,=?  Somehow it seems not
> >> to be interpreted in the right way: it does not get fontified correctly,
> >> nor does export in the right way.  What can I do about it?  I found
> >> about org-emphasis-regexp-components, is it the only way?  Also, how do
> >> I reload Org without restarting Emacs?  (I am an Emacs geek and I try to
> >> beat my record of emacs-uptime, you know. ;-) )
> >
> > Wow, I got an idea, and it worked.  Here's an excerpt from `C-u C-x ='
> > at my solution;-):
> >
> >              position: 11859 of 16051 (74%), column: 253
> >             character: ‍ (displayed as ‍) (codepoint 8205, #o20015, #x200d)
> >     preferred charset: unicode (Unicode (ISO10646))
> > code point in charset: 0x200D
> >                syntax: . 	which means: punctuation
> >              to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME"
> >           buffer code: #xE2 #x80 #x8D
> >             file code: #xE2 #x80 #x8D (encoded by coding system utf-8-unix)
> >               display: by this font (glyph code)
> >     xft:-unknown-Phetsarath OT-normal-normal-normal-*-17-*-*-*-*-0-iso10646-1 (#x120)
> >
> > Character code properties: customize what to show
> >   name: ZERO WIDTH JOINER
> >
> > A bit ugly trick, but works.  What are the opinions?
> 
> After a while I have to say that my opinion is strongly negative: this
> breaks LaTeX export.  (LaTeX doesn’t like some unicode characters, it
> turns out.)  Also, this was really an ugly hack...
> 
> So, here is my problem: how to represent a key like M-, or
> e.g. a sequence \, (important in regexps) as “code” or “verbatim stuff”
> in org-mode?  Neither =\,= nor ~\,~ work, of course.  Also, I’d like
> this to be backend-agnostic, so \texttt{M-,} doesn’t really work.
> 
> What is the rationale behind forbidding the comma as the “border”
> character in org-emphasis-regexp-components?  Should I change this
> variable in my setup or is there a more general way to convince Org that
> I really want verbatim/code snippets like =\,=?
> 
> Best,
> 
> -- 
> Marcin Borkowski
> http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
> Faculty of Mathematics and Computer Science
> Adam Mickiewicz University
> 

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

end of thread, other threads:[~2015-03-20  9:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-24 15:53 How to represent Emacs keystrokes in Org? Marcin Borkowski
2014-11-24 18:38 ` Rasmus
2014-11-29 21:53   ` Marcin Borkowski
2014-11-29 21:58     ` Marcin Borkowski
2015-03-19 21:48       ` Marcin Borkowski
2015-03-20  9:04         ` Sebastien Vauban
2015-03-20  9:17         ` Randomcoder
2014-11-30  0:50     ` Rasmus

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).