emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-tempo and <q TAB with babel headers
@ 2020-06-29 20:15 Samuel Wales
  2020-06-29 20:22 ` tomas
  2020-06-29 23:37 ` Kyle Meyer
  0 siblings, 2 replies; 8+ messages in thread
From: Samuel Wales @ 2020-06-29 20:15 UTC (permalink / raw)
  To: Mario Frasca; +Cc: emacs-orgmode

i used to do

  <q TAB

to get a quote block.

an upgrade to maint brought the org-tempo thing, which i know was a
long discussion whose resolution i completely forgot about.

i'm ok with either old or new.  i will fix keybindings.

i just want it working again with or without a new keybinding, without
a lot of changing things on my part.

i tried what is intended to now be on c-c ,.  this brought up a warning:

  Please update the entries of `org-structure-template-alist'.

it tells me to update a bunch of entries includign this one:

("b" "#+begin_src sh :results verbatim output\n?#+end_src" "")

but it is not clear what to do to update it.  the extra header stuff
is not documented anywhere i looked, including the warning, the
docstring it referred to, the manual, and the org-tempo commentary.

my goal is the least effort toward a solution.

is tehre a solution without updating the alist?  if not, what works
for this entry?

thanks!


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

* Re: org-tempo and <q TAB with babel headers
  2020-06-29 20:15 org-tempo and <q TAB with babel headers Samuel Wales
@ 2020-06-29 20:22 ` tomas
  2020-06-29 21:40   ` Samuel Wales
  2020-06-29 23:37 ` Kyle Meyer
  1 sibling, 1 reply; 8+ messages in thread
From: tomas @ 2020-06-29 20:22 UTC (permalink / raw)
  To: emacs-orgmode

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

On Mon, Jun 29, 2020 at 01:15:04PM -0700, Samuel Wales wrote:
> i used to do
> 
>   <q TAB
> 
> to get a quote block.
> 
> an upgrade to maint brought the org-tempo thing, which i know was a
> long discussion whose resolution i completely forgot about.
> 
> i'm ok with either old or new.  i will fix keybindings.

[...]

It's a while ago, but AFAIR I just had to enable/add tempo to the
(customizable) variable `org-modules'.

Try M-x customize org-modules

Cheers
-- tomás

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: org-tempo and <q TAB with babel headers
  2020-06-29 20:22 ` tomas
@ 2020-06-29 21:40   ` Samuel Wales
  2020-06-29 21:41     ` Samuel Wales
  0 siblings, 1 reply; 8+ messages in thread
From: Samuel Wales @ 2020-06-29 21:40 UTC (permalink / raw)
  To: tomas; +Cc: emacs-orgmode

my understanding is that adding to org-modules and requiring are
functionally equivalent, at least in my use case.

for me, the problem is that expanding, whether via the familiar < q
TAB or the new function, would bring up the warning which was not
obviously fixable.

-- 
The Kafka Pandemic

What is misopathy?
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html


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

* Re: org-tempo and <q TAB with babel headers
  2020-06-29 21:40   ` Samuel Wales
@ 2020-06-29 21:41     ` Samuel Wales
  0 siblings, 0 replies; 8+ messages in thread
From: Samuel Wales @ 2020-06-29 21:41 UTC (permalink / raw)
  To: tomas; +Cc: emacs-orgmode

On 6/29/20, Samuel Wales <samologist@gmail.com> wrote:
> TAB or the new function, would bring up the warning which was not
> obviously fixable.

is not*

-- 
The Kafka Pandemic

What is misopathy?
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html


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

* Re: org-tempo and <q TAB with babel headers
  2020-06-29 20:15 org-tempo and <q TAB with babel headers Samuel Wales
  2020-06-29 20:22 ` tomas
@ 2020-06-29 23:37 ` Kyle Meyer
  2020-06-29 23:52   ` Samuel Wales
  1 sibling, 1 reply; 8+ messages in thread
From: Kyle Meyer @ 2020-06-29 23:37 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

Samuel Wales writes:

[...]
> i tried what is intended to now be on c-c ,.  this brought up a warning:
>
>   Please update the entries of `org-structure-template-alist'.
>
> it tells me to update a bunch of entries includign this one:
>
> ("b" "#+begin_src sh :results verbatim output\n?#+end_src" "")
>
> but it is not clear what to do to update it.  the extra header stuff
> is not documented anywhere i looked, including the warning, the
> docstring it referred to, the manual, and the org-tempo commentary.

Here's the example given in that warning:

    In Org 9.2 the format was changed from something like
    
        ("s" "#+BEGIN_SRC ?\\n#+END_SRC")
    
    to something like
    
        ("s" . "src")
    
    Please refer to the documentation of `org-structure-template-alist'.
    
So the entry you show

    ("b" "#+begin_src sh :results verbatim output\n?#+end_src" "")

would map to this (untested):

    ("b" . "src sh :results verbatim output")


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

* Re: org-tempo and <q TAB with babel headers
  2020-06-29 23:37 ` Kyle Meyer
@ 2020-06-29 23:52   ` Samuel Wales
  2020-06-30  0:06     ` Kyle Meyer
  0 siblings, 1 reply; 8+ messages in thread
From: Samuel Wales @ 2020-06-29 23:52 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: emacs-orgmode

On 6/29/20, Kyle Meyer <kyle@kyleam.com> wrote:
> would map to this (untested):
>
>     ("b" . "src sh :results verbatim output")

thanks.  i tried that too.  it gave an error so i assumed it was
invalid syntax.  should i report it as a bug?


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

* Re: org-tempo and <q TAB with babel headers
  2020-06-29 23:52   ` Samuel Wales
@ 2020-06-30  0:06     ` Kyle Meyer
  2020-06-30  0:40       ` Samuel Wales
  0 siblings, 1 reply; 8+ messages in thread
From: Kyle Meyer @ 2020-06-30  0:06 UTC (permalink / raw)
  To: Samuel Wales; +Cc: emacs-orgmode

Samuel Wales writes:

> On 6/29/20, Kyle Meyer <kyle@kyleam.com> wrote:
>> would map to this (untested):
>>
>>     ("b" . "src sh :results verbatim output")
>
> thanks.  i tried that too.  it gave an error so i assumed it was
> invalid syntax.  should i report it as a bug?

Yes, please provide a minimal configuration, the steps to trigger, and
the error you see.  With maint (currently 3ed035ce3) checked out, I just
tried

    (require 'org-tempo)
    (add-to-list 'org-structure-template-alist
                 '("b" . "src sh :results verbatim output"))

with no other configuration.  Both <b followed by tab and "C-c C-, b"
inserted the block without an error.


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

* Re: org-tempo and <q TAB with babel headers
  2020-06-30  0:06     ` Kyle Meyer
@ 2020-06-30  0:40       ` Samuel Wales
  0 siblings, 0 replies; 8+ messages in thread
From: Samuel Wales @ 2020-06-30  0:40 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: emacs-orgmode

thank you.

it does work, if you get rid of your entire alist first.  that is, it
doesn't just seem to look up the car and expand it, but rather seems
to require the whole list to be what it wants.

so you cannot fix one at a time.  i tried to fix one at a time because
i wasn't sure which mechanism i would use and what syntax each
mechanism required.

the < mechanism being the same syntax in org but a different syntax in
the alist threw me off ever so slightly.  seems to be backward
compatible for the expansion, but not for the alist.

i didn't think to null the alist until much later when i found out
from you that the syntax i had tried was supposed to work after all.


i also got a capture bug.  the offending item was this one: (push
'("n" "#+name: ?" "") org-structure-template-alist).  therefore the
old syntax.

so no need to fix the bug i guess, but for curiosity here is the bt.

the strange thing is the capture template doesn't expand anything so
idk why it errors just because the expansion mechanism used the old
syntax.  this one might throw others off, dunno.

Debugger entered--Lisp error: (error "Capture abort: Wrong type
argument: stringp, (\"#+name: ?\" \"\")")
  signal(error ("Capture abort: Wrong type argument: stringp,
(\"#+name: ?\" \"\")"))
  error("Capture abort: %s" "Wrong type argument: stringp, (\"#+name:
?\" \"\")")
  org-capture(nil "n")
  #[0 "\300\301\302\"\207" [org-capture nil "n"] 3 nil nil]()
  funcall-interactively(#[0 "\300\301\302\"\207" [org-capture nil "n"]
3 nil nil])
  call-interactively(#[0 "\300\301\302\"\207" [org-capture nil "n"] 3
nil nil] nil nil)
  command-execute(#[0 "\300\301\302\"\207" [org-capture nil "n"] 3 nil nil])

so, user error, plus some anomaly.

however, if any ignorami like me exist out there, it might be worth
documenting int he warning screen that you should null the alist.


On 6/29/20, Kyle Meyer <kyle@kyleam.com> wrote:
> Samuel Wales writes:
>
>> On 6/29/20, Kyle Meyer <kyle@kyleam.com> wrote:
>>> would map to this (untested):
>>>
>>>     ("b" . "src sh :results verbatim output")
>>
>> thanks.  i tried that too.  it gave an error so i assumed it was
>> invalid syntax.  should i report it as a bug?
>
> Yes, please provide a minimal configuration, the steps to trigger, and
> the error you see.  With maint (currently 3ed035ce3) checked out, I just
> tried
>
>     (require 'org-tempo)
>     (add-to-list 'org-structure-template-alist
>                  '("b" . "src sh :results verbatim output"))
>
> with no other configuration.  Both <b followed by tab and "C-c C-, b"
> inserted the block without an error.
>


-- 
The Kafka Pandemic

What is misopathy?
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html


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

end of thread, other threads:[~2020-06-30  0:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29 20:15 org-tempo and <q TAB with babel headers Samuel Wales
2020-06-29 20:22 ` tomas
2020-06-29 21:40   ` Samuel Wales
2020-06-29 21:41     ` Samuel Wales
2020-06-29 23:37 ` Kyle Meyer
2020-06-29 23:52   ` Samuel Wales
2020-06-30  0:06     ` Kyle Meyer
2020-06-30  0:40       ` Samuel Wales

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