Re: Supress title on html export

2022-12-02 Thread Nick Dokos
Galaxy Being  writes:

> BTW, this would seem to suggest org-mode has some built-in "master
> CSS". Or, how does org-mode know about the class/ID .title? In my
> case, I use my own CSS that I put in the header, and yes, it has a
> .title. Still, how does bare-bones default html export know about
> .title?
>

Do

   C-h v org-html-style-default

Also do

   C-h i g(org)RET m CSS

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [BUG] Clipboard text pasted in two windows with a cloned buffer [9.6-pre ( @ /home/chomwitt/.config/emacs/elpa/org-9.6pre0.20221110.85807/)]

2022-11-30 Thread Nick Dokos
Alexandros Prekates  writes:

> On Mon, 28 Nov 2022 10:28:41 +
> Alexandros Prekates  wrote:
>
> I come across another case :
>
>
> WINDOW A --  WINDOW B -
> * FOO1   * FOO1
> ** goo2  ** goo2
> ** zoo2  ** zoo2
> bla
> [[   <--- starting a link
> bla
>
>
> WINDOW A --  WINDOW B -
> * FOO1   * FOO1
> ** goo2  ** goo2
> ** zoo2  ** zoo2...http://foo 
> bla
> [[http://foo  <--- pasting a url
> bla
>

I can confirm the behavior on GNU Emacs 29.0.50 (build 1,
x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.17.4) of
2022-02-02

Although it is confusing and unfortunate, it is "just" a display
error: if you switch to B and press TAB, the URL is in the right
place, and pressing TAB again folds the heading correctly, producing
what you expect.

I suspect that it's not just an Org problem: it is probably caused
when you paste into the middle of text that is invisible in the cloned
buffer. I have not tried it out however.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: How ro delete DONE attemps

2022-10-25 Thread Nick Dokos
Renato Pontefice  writes:

> Hi,
> I’m wondering how can I delete, on my .org file, the line that have:
> - an old Timestamp (i.e. if I set a thing to be done today (<2022-10-24 Mon 
> 17:26>)
> - a TODO item (always with a past date) <2022-10-24 Mon 17:26>
>
> That to have a more clean .org file.
>
> Is it possible?
> How can I obtain it?
>

It's just text: you can use ordinary Emacs commands to modify the
file, e.g. C-k will kill a line, or you can use C-d to delete
characters or M-d to delete words.

-- 
Nick




Re: org-encode-time bug

2022-07-25 Thread Nick Dokos
Ihor Radchenko  writes:

> Morgan Smith  writes:
>
>> I'm using emacs from commit f258f67 (quite recent) and org from commit
>> 39005dc (quite recent).
>>
>> I'm using native compilation and PGTK.
>
>> Debugger entered--Lisp error: (invalid-function org-encode-time)
>>   org-encode-time((0 0 0 21 7 2022 4 t -14400))
>>   org-matcher-time("<2022-07-21 Thu 00:00>")
>>   org-clock-get-table-data(...)
>>   org-dblock-write:clocktable(...)
>>   org-update-dblock()
>>   org-ctrl-c-ctrl-c(nil)
>>   funcall-interactively(org-ctrl-c-ctrl-c nil)
>>   command-execute(org-ctrl-c-ctrl-c)
>
> org-encode-time is defined in org-macs.el in the latest Org, but _not_
> in built-in Org. What you are seeing is most likely caused by "mixed"
> installation of Org when part of Org is loaded from built-in Org
> distribution coming from Emacs.
>
>> I was able to reproduce this with 'emacs -Q'
>>
>> When trying to update a clocktable I get the following backtrace (with a
>> little bit removed).
>
> Could you please detail on what you did to load the latest org with
> Emacs -Q? Using purely emacs -Q cannot trigger the error simply because
> org-encode-time is absent in the built-in Org.
>

In my case, it was caused by an update, followed by `make autoloads',
followed by 'org-reload'. That last part is not guaranteed to work,
particularly on the cutting edge, so restarting emacs is sometimes
necessary - as it was in this case. No problems afterwards.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: The fate of ob-asymptote.el

2022-07-20 Thread Nick Dokos
Jarmo Hurri  writes:

> ...
>
> I would like ob-asymptote.el to be brought back. If there is something I
> can do to help, I will be glad to do so.
>
All you have to do is volunteer to maintain it. Let Bastien know: he will
assign you the maintenance of the file and all the asymptote users will owe
you a debt of gratitude.

See https://orgmode.org/worg/org-contribute.html, the bullet with the title
"Maintain an Org file".

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [PATCH] org-lint: Fix invocation with C-u prefix argument

2022-06-08 Thread Nick Dokos

On 6/8/22 09:30, Ihor Radchenko wrote:

Nick Dokos  writes:


LGTM! Is there any reason you did not push the patch upstream yourself?


ISTR I used to have push access to the repo, but in some repo move I
think I've lost it and I've never arranged to get it back. At least, I
*think* that was the case - but perhaps given my general state of
discombobulation, you don't want me to be committing things to the
repo in any case :-) Better to have some eyes on patches first...

Ok. AFAIK, after we moved the repo to savannah, you may need to create
an account at https://savannah.gnu.org/ and request access from Bastien.

Note that you don't have to commit without having extra pairs of eyes
on the patches. You can post the patch here, get comments, and then
apply the patch yourself if everything is ok. (Yes, I am lazy to apply
patches from others if I don't have to).

Applied onto main via 9fd5349d0.
I did not apply onto bugfix because Bastien asked not to apply
non-critical fixed until Emacs 28.2 is out.

Best,
Ihor


Thank you! I will try to get commit rights again before posting another 
patch. I appreciate your patience and help (and the enormous 
contribution you have made to Org mode too!)


--

Nick





Re: [PATCH] org-lint: Fix invocation with C-u prefix argument

2022-06-06 Thread Nick Dokos
Ihor Radchenko  writes:

> Nick Dokos  writes:
>
>> `C-u M-x org-lint' was failing to run any checkers, no matter what
>> category was chosen, because the calculation of the list of checkers
>> always returned `nil'.
>
> LGTM! Is there any reason you did not push the patch upstream yourself?
>

ISTR I used to have push access to the repo, but in some repo move I
think I've lost it and I've never arranged to get it back. At least, I
*think* that was the case - but perhaps given my general state of
discombobulation, you don't want me to be committing things to the
repo in any case :-) Better to have some eyes on patches first...

-- 
Nick




[PATCH] org-lint: Fix invocation with C-u prefix argument

2022-06-01 Thread Nick Dokos
`C-u M-x org-lint' was failing to run any checkers, no matter what
category was chosen, because the calculation of the list of checkers
always returned `nil'.

>From b55162adf1250980ad0f42423832aa1aa1045d30 Mon Sep 17 00:00:00 2001
From: Nick Dokos 
Date: Wed, 1 Jun 2022 12:28:23 -0400
Subject: [PATCH] org-lint: Fix invocation with C-u prefix argument

* lisp/org-lint.el (org-lint): Fix the order of the arguments in
the `assoc-string' call when calculating the list of checkers to
invoke.

`C-u M-x org-lint' was failing to run any checkers, no matter what
category of checkers was chosen, because the calculation of the list
of checkers always returned `nil'.
---
 lisp/org-lint.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-lint.el b/lisp/org-lint.el
index cce6fddbd..62a245330 100644
--- a/lisp/org-lint.el
+++ b/lisp/org-lint.el
@@ -321,7 +321,7 @@ ARG can also be a list of checker names, as symbols, to run."
 		nil t)))
 	  (cl-remove-if-not
 	   (lambda (c)
-		 (assoc-string (org-lint-checker-categories c) category))
+		 (assoc-string category (org-lint-checker-categories c)))
 	   org-lint--checkers)))
 	   (`(16)
 	(list
-- 
2.34.1


-- 
Nick


Re: how to export an org file, to 2 different locations (in to different formats)

2022-05-31 Thread Nick Dokos
Uwe Brauer  writes:

> Hi
>
> Currently I use 
> #+EXPORT_FILE_NAME: /home/oub/Desktop/some-stuff.html
>
> To export my org file in html format to that location.
>
> But I would also like to export it as a latex file to a different
> location, without modifying the above line, or to be more precise to add
> a different location, like
>
> 1. if export to latex use that folder
>
> 2. If export to html use this folder
>
> Anybody know about such a functionality?
>

org-publish?

You should be able to write a simple publishing config file to do that.

> Thanks and regards
>
> Uwe Brauer 

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Change of behavior of org-meta-return in 9.6/DoomEmacs?

2022-05-18 Thread Nick Dokos
Guillaume MULLER  writes:

> Hi,
>
> I noticed that hitting Meta-Return in org in Doom does not behave as
> in Vanilla Emacs. If I have (with <> being the cursor):
>
> * outline 1
> ** outline 2
>   + no<>te1
>   + note2
>
> In Vanilla Emacs, hitting M-Ret (i.e. calling org-meta-return) resulted in:
>
> * outline 1
> ** outline 2
>   + no
>   + <>te1
>   + note2
>
> In Doom Emacs, it results in:
> * outline 1
> ** outline 2
>   + note1
>   + note2
> ** <>
>

Compare the values of the variable `org-M-RET-may-split-line' in the
two cases: are they the same?

-- 
Nick





Re: [BUG] - Statistics cookie is part of the org heading title

2022-05-04 Thread Nick Dokos
Fabian  writes:

> Hi everybody,
>
> I would like to report his behaviour as a bug:

A crucial piece of information is missing here: this concerns the
behavior of the function `org-heading-components'.

> 
> Example:
>
> * Some Heading Title [0/1]  ;; cursor in this line when executing
> ** TODO Some Todo Item
>
> -> result is "Some Heading Title [0/1]"
>
> -> desired result would be "Some Heading Title"
> 
>
> I don't see any reason why the statistics cookie should be part of
> the title: it should be a separate component.
>
> The Topic has beend posted on Stack here:
> https://emacs.stackexchange.com/questions/71592/extract-org-heading-title-without-task-count-e-g-0-0?noredirect=1#comment115659_71592
>
> Best Regards, 
>
> Fabian
>
>

-- 
Nick

"There are only two hard problems in computer science: cache invalidation, 
naming things, and off-by-one errors." -Martin Fowler




Re: Org as a workspace (an impromptu reflection)

2022-05-02 Thread Nick Dokos
Juan Manuel Macías  writes:

> With Org something curious has happened. I've gotten used to working
> around nodes (regardless of what documents those nodes are in), rather
> than around folders or files. Little by little, a kind of virtual world
> of ideas, objects, etc., all intertwined with each other, is being
> built.

>From my vantage point (of ignorance about it :-) ), this sounds like
org-roam to me: https://www.orgroam.com/

-- 
Nick

"There are only two hard problems in computer science: cache invalidation, 
naming things, and off-by-one errors." -Martin Fowler




Re: [BUG] org-mode #+SETUPFILE not working with properties [9.5.2 (release_9.5.2-378-g98588e @ /home/eros/src/org-mode/lisp/)]

2022-05-02 Thread Nick Dokos
Ihor Radchenko  writes:

> Eros Zaupa  writes:
>
>> I would like to move the properties drawer to a separate file and import it
>> into the main one. To do so I'm using the `#SETUPFILE` property suggested
>> [here][1], but this doesn't seem to work.
>
> Confirmed.
> Though I am not 100% sure.
>
> Org is indeed ignoring top-level property drawer when parsing
> #+SETUPFILE.
>
> Dear All,
> I think that parsing top-level property drawer is simply an omission
> from the time we introduced top-level property drawers into syntax.
>
> We may either implement this support or leave things as is and document
> the current behaviour.
>
> I would be in favour of implementing top-level drawer support in
> SETUPFILE, but there might be alternative opinions. WDYT?

FWIW, I agree that it is a bug and it should be fixed.

-- 
Nick

"There are only two hard problems in computer science: cache invalidation, 
naming things, and off-by-one errors." -Martin Fowler




Re: Name the different types of links in an org file

2022-04-27 Thread Nick Dokos
c.bu...@posteo.jp writes:

> Hello,
>
> I just want to find the correct terms of the different types of links
> an org file can have. This is not only about orgmode but orgroam
> (version 1 and 2) also.
>
> 1. Hyperlinks
> Example: [[https://foo.bar][Link description]]
> This links can also point to files on the local filesystem etc
>

See the following chapter in the manual:

   (info "(org)Hyperlinks")

and in particular, the sections on "Inernal" and "External" links, but
note that the hyperlink system is extensible - you define your own
link types and behavior:

   (info "(org)Adding Hyperlink Types")
   
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




[PATCH] Add missing `provide' in ob-octave test

2022-04-26 Thread Nick Dokos
`make test' has been failing for me with this error:

,
| Error: error ("Loading file
| /home/nick/src/emacs/org/org-mode/testing/lisp/test-ob-octave.el
| failed to provide feature ‘test-ob-octave’")
`

The attached patch provides a fix.

>From dc1ab2a24bfc5a02845c380c60f0c1a7452e639a Mon Sep 17 00:00:00 2001
From: Nick Dokos 
Date: Tue, 15 Mar 2022 12:33:52 -0400
Subject: [PATCH] test-ob-octave: Add missing `provide'

---
 testing/lisp/test-ob-octave.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testing/lisp/test-ob-octave.el b/testing/lisp/test-ob-octave.el
index 7e20add99..6113b40f3 100644
--- a/testing/lisp/test-ob-octave.el
+++ b/testing/lisp/test-ob-octave.el
@@ -63,3 +63,5 @@
   (org-test-at-id "cc2d82bb-2ac0-45be-a0c8-d1463b86a3ba"
 (org-babel-next-src-block 5)
 (should (equal nil (org-babel-execute-src-block)
+
+(provide 'test-ob-octave)
-- 
2.34.1


-- 
Nick

"There are only two hard problems in computer science: cache invalidation, 
naming things, and off-by-one errors." -Martin Fowler


Re: [PATCH] Fix examples of clock tables in the manual

2022-04-26 Thread Nick Dokos
Ihor Radchenko  writes:

> Nick Dokos  writes:
>
>> The syntax is:
>>
>>     #+BEGIN: clocktable ...
>>     #+END:
>>
>> There is no `clocktable' after `#+END:'.
>
> Thanks for the patch! Could you please follow the commit summary
> conventions described in
> https://orgmode.org/worg/org-contribute.html#commit-messages?
>

Yes, I'm very rusty.

> Note that you may need to add TINYCHANGE cookie as you appear to not
> have the copyright assignment with FSF.
>

I'm in there (under "Nicholas Dokos").

> Also, your current patch does not apply onto main:
>
>>> Applying: Fix examples of clock tables in the manual
>>> error: corrupt patch at line 10
>

Mailer mangled it - let me try attaching.

Hope this is better. Thanks!

> Best,
> Ihor

>From 2d32589cb1d1db330067197f91635db7d6bce7ec Mon Sep 17 00:00:00 2001
From: Nick Dokos 
Date: Tue, 26 Apr 2022 16:22:03 -0400
Subject: [PATCH] doc/org-manual.org: Fix clocktable dynamic block examples

---
 doc/org-manual.org | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index af54dc4e8..6768ca98d 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -6665,7 +6665,7 @@ into the buffer by ~org-clock-report~:
 #+cindex: @samp{BEGIN clocktable}
 #+begin_example
 ,#+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
-,#+END: clocktable
+,#+END:
 #+end_example
 
 #+vindex: org-clocktable-defaults
@@ -6849,7 +6849,7 @@ day, you could write:
 
 #+begin_example
 ,#+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t
-,#+END: clocktable
+,#+END:
 #+end_example
 
 #+texinfo: @noindent
@@ -6858,7 +6858,7 @@ To use a specific time range you could write[fn:80]
 #+begin_example
 ,#+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
 :tend "<2006-08-10 Thu 12:00>"
-,#+END: clocktable
+,#+END:
 #+end_example
 
 #+texinfo: @noindent
@@ -6866,7 +6866,7 @@ A range starting a week ago and ending right now could be written as
 
 #+begin_example
 ,#+BEGIN: clocktable :tstart "<-1w>" :tend ""
-,#+END: clocktable
+,#+END:
 #+end_example
 
 #+texinfo: @noindent
@@ -6874,7 +6874,7 @@ A summary of the current subtree with % times would be
 
 #+begin_example
 ,#+BEGIN: clocktable :scope subtree :link t :formula %
-,#+END: clocktable
+,#+END:
 #+end_example
 
 #+texinfo: @noindent
@@ -6883,7 +6883,7 @@ last week would be
 
 #+begin_example
 ,#+BEGIN: clocktable :scope agenda :block lastweek :compact t
-,#+END: clocktable
+,#+END:
 #+end_example
 
 *** Resolving idle time and continuous clocking
-- 
2.34.1


>
>

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler


[PATCH] Fix examples of clock tables in the manual

2022-04-26 Thread Nick Dokos

The syntax is:

   #+BEGIN: clocktable ...
   #+END:

There is no `clocktable' after `#+END:'.
---
 doc/org-manual.org | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index af54dc4e87f9..6768ca98dd7f 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -6665,7 +6665,7 @@ into the buffer by ~org-clock-report~:
 #+cindex: @samp{BEGIN clocktable}
 #+begin_example
 ,#+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
-,#+END: clocktable
+,#+END:
 #+end_example

 #+vindex: org-clocktable-defaults
@@ -6849,7 +6849,7 @@ day, you could write:

 #+begin_example
 ,#+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t
-,#+END: clocktable
+,#+END:
 #+end_example

 #+texinfo: @noindent
@@ -6858,7 +6858,7 @@ To use a specific time range you could write[fn:80]
 #+begin_example
 ,#+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
 :tend "<2006-08-10 Thu 12:00>"
-,#+END: clocktable
+,#+END:
 #+end_example

 #+texinfo: @noindent
@@ -6866,7 +6866,7 @@ A range starting a week ago and ending right now 
could be written as


 #+begin_example
 ,#+BEGIN: clocktable :tstart "<-1w>" :tend ""
-,#+END: clocktable
+,#+END:
 #+end_example

 #+texinfo: @noindent
@@ -6874,7 +6874,7 @@ A summary of the current subtree with % times would be

 #+begin_example
 ,#+BEGIN: clocktable :scope subtree :link t :formula %
-,#+END: clocktable
+,#+END:
 #+end_example

 #+texinfo: @noindent
@@ -6883,7 +6883,7 @@ last week would be

 #+begin_example
 ,#+BEGIN: clocktable :scope agenda :block lastweek :compact t
-,#+END: clocktable
+,#+END:
 #+end_example

 *** Resolving idle time and continuous clocking
--
2.34.1




Re: [BUG] Dynamic blocks not recognized by org-element

2022-04-26 Thread Nick Dokos

On 4/26/22 03:14, Ihor Radchenko wrote:


It is to be expected.
Dynamic block syntax is the following (see manual):

#+BEGIN: dynamic_block_name [args]
...
#+END:

You should not put dynamic block name after #+END:


Thanks! I cut-and-pasted out of the documentation, so it is a doc bug instead:

   (info "(org)The clock table")

I'll send in a patch if nobody beats me to it.

--
Nick




[BUG] Dynamic blocks not recognized by org-element

2022-04-26 Thread Nick Dokos
Starting with `emacs -Q', I create a simple file with the following 
contents:


--8<---cut here---start->8---
* Clocktable

#+BEGIN: clocktable :maxlevel 3 :emphasize nil :scope file
#+END: clocktable
--8<---cut here---end--->8---

I position the cursor on the #+BEGIN line and evaluate
`(org-element-at-point)'. I expected to get a dynamic-block, but I get a
paragraph:

(paragraph
 (:begin 15 :end 74 :contents-begin 15 :contents-end 74 :post-blank 0 
:post-affiliated 15 :mode planning :granularity element :parent

 (section
  (:begin 15 :end 92 :contents-begin 15 :contents-end 92 
:robust-begin 15 :robust-end 90 :post-blank 0 :post-affiliated 15 :mode 
section :granularity element :parent

  (headline
   (:raw-value "Clocktable" :begin 1 :end 92 :pre-blank 
1 :contents-begin 15 :contents-end 92 :robust-begin 17 :robust-end 90 
:level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil 
:post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil 
:post-affiliated 1 :title "Clocktable"))


Looks like a bug to me.


Emacs  : GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 
3.24.31, cairo version 1.17.4) of 2022-02-12
Package: Org mode version 9.5.3 (release_9.5.3-452-g407104 @ 
/home/nick/src/emacs/org/org-mode/lisp/)

--
Nick





Re: Bug: Order of drawers is important [9.1.9 (release_9.1.9-65-g5e4542 @ /usr/share/emacs/26.3/lisp/org/)]

2022-04-18 Thread Nick Dokos
Olaf Dietsche  writes:

> thank you for the link to the org-repair-property-drawers function.
> This seems much more useful than the non-working "repair" of
> org-set-property.
>

In addition, I expect (but have not tested) that `M-x org-lint` might
be helpful here and in similar situations.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




[BUG] Test failure: testing/lisp/test-ob-octave.el is missing a `provide'

2022-03-15 Thread Nick Dokos
That stopped the `make test' cold with a backtrace. Bug fix attached.

>From 0d7f1b77dfa5cf3f755ea5d3b08943ec696f8bbf Mon Sep 17 00:00:00 2001
From: Nick Dokos 
Date: Tue, 15 Mar 2022 12:33:52 -0400
Subject: [PATCH] test-ob-octave: Add missing `provide'

---
 testing/lisp/test-ob-octave.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testing/lisp/test-ob-octave.el b/testing/lisp/test-ob-octave.el
index 7e20add99..6113b40f3 100644
--- a/testing/lisp/test-ob-octave.el
+++ b/testing/lisp/test-ob-octave.el
@@ -63,3 +63,5 @@
   (org-test-at-id "cc2d82bb-2ac0-45be-a0c8-d1463b86a3ba"
 (org-babel-next-src-block 5)
 (should (equal nil (org-babel-execute-src-block)
+
+(provide 'test-ob-octave)
-- 
2.34.1


-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler


Re: Export (to `LaTeX`) `~⟨code snippet⟩~` into `\lstinline+⟨code snippet⟩+` (just as does `src_⟨language⟩{⟨code snippet⟩}`)

2022-03-11 Thread Nick Dokos
Hi Denis,

Denis Bitouzé  writes:

> Hi,
>
> here is a feature request about the LaTeX export (another one: the
> previous mine, https://list.orgmode.org/87zgmda67z@example.com/,
> sadly didn't get any answer).
>
> With `(setq org-latex-listings t)`, `src_⟨language⟩{⟨code snippet⟩}` is
> exported from `org-mode` to `LaTeX` into
> `\lstinline[language=⟨language⟩]~⟨code snippet⟩~` (here, `~` could be
> almost any token): so far, so good.
>
> But one could expect to get the same export with the usual `org-mode`
> syntax for code snippets: `~⟨code snippet⟩~` (this supposes the ⟨language⟩
> to be declared globally), as in the following example:
>
> #+OPTIONS:   toc:nil title:nil
>
> #+LaTeX_HEADER: \usepackage{xcolor}
> #+LaTeX_HEADER: \usepackage{listings}
> #+LaTeX_HEADER: 
> \lstset{language=[auto]lisp,basicstyle=\ttfamily,keywordstyle=\color{red}}
>
> #+PROPERTY: header-args :padline no :exports both :noweb yes :eval always
>
> src_lisp{defun} is fun!
>
> ~defun~ is fun!
>
>
> For this, it is possible to redefine the `org-latex-code` function:
>
> ;; Inspired by https://emacs.stackexchange.com/q/70720/5267
> (defun org-latex-code (code _contents info)
>   "Transcode a CODE object from Org to LaTeX.
> CONTENTS is nil.  INFO is a plist used as a communication
> channel."
>   (format "\\lstinline+%s+"
>   (org-element-property :value code)))
>
> but, IMHO, this should be the default.
>
> WDYT?

I have no opinion on whether it should be the default or not, but I
wanted to point out a possibility that might have not occurred to you:
it is possible to define what's called a "derived" exporter, an
exporter that shares most of its code with the exporter that it is
derived from and only overrides one or two functions where you need a
change.

See the doc string of the function `org-export-define-derived-backend'
for some details.  There are also many examples where this feature is
used (a simple one is in the doc string itself), but there are
examples in the Org mode code itself, e.g the beamer exporter
(ox-beamer.el) is derived from the LaTex one (ox-latex.el), as is the
koma-letter exporter (ox-koma-letter.el), and the markdown exporter
(ox-md.el) is derived from the HTML exporter in ox-html.el.

Deriving a new back end from the LaTeX exporter and redefining one or
two functions (like `org-latex-code' above) is IMO the best way
forward. You get an exporter that works as you want and the defaults
are left as-is (developers are wary about changing defaults: that
brings out a lot of complaints of the "it was working fine yesterday
but you broke it" variety). And you can publish your derived mode on
e.g Gitlab/Github/whatever and make it available in MELPA for others
to try out.

HTH.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Cannot link to files with no extension

2022-03-10 Thread Nick Dokos
Nick Dokos  writes:

> Check also the value of the system-specific variable
> `org-file-apps-{gnus,windowsnt,macos}' - whichever is applcible to your
> case.

That should be `org-file-apps-{gnu,windowsnt,macos}'.
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Cannot link to files with no extension

2022-03-10 Thread Nick Dokos
Colin Baxter  writes:


> 6. In a.org enter [[file:./z][This is file z]] and save.
>
> 7. Click on the link.
>
> 8. Message "Running less in /path/to/z ... done", but link does not
>open.
>

This sounds like your `org-file-apps' is funny. What is its value?
Check also the value of the system-specific variable
`org-file-apps-{gnus,windowsnt,macos}' - whichever is applcible to your
case.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: ox-publish: Some starting problems

2022-03-10 Thread Nick Dokos
[Answers to some of the questions inline]

c.bu...@posteo.jp writes:

> 1.  Is this mailing list the right place to discuss ox-publish
> related topics? The ox-publish.el only contains two e-mail
> addresses?
>
Yes.

> 2.  Because ox-publish is skipping "unmodified files" I deleted all
> HTML files between the publish-runs just to be sure that there are
> no side effects. But now when my output directory is totally empty
> ox-publish still keeps saying that it is skipping the unmodified
> files. So nothing is generated anymore. How can I handle that? Maybe
> resetting the "unmodified" flag somewhere? Or shouldn't ox-publish
> not only check for modifications but if there is something earlier
> generated content exist?
>
Org mode records the time when a file was published and compares it to
the last modification time to decide whether to publish or not. It
does not have a dependency mechanism like `make' to figure things
out. As you found out, you can force it by calling it with a `t'
argument for the `force' parameter. You can do this interactively with
`C-u M-x org-publish'. See the "Triggering Publication" section of the
manual:

  (info "(org)Triggering Publication")

That section also points you to the variable
`org-publish-use-timestamps-flag': if you set that to `nil', no
timestamp checking is done.

The timestamps are kept in the directory named by the variable
`org-publish-timestamp-directory' whose default value is
"~/.org-timestamps/".

> 4.  ox-publish ignores newlines. Two short lines in the org-file
> becomes one line in the HTML content.
>

That is how HTML export (and publishing) works: the browser does its
own layout of HTML content and you have no say in that (except for
`verbatim' things that are pre-formatted).

> 5.  I am not totally new to Emacs but quit fresh. So I have two
> questions about how to handle the documentation and help
> informations here.  a) I tried to "descrbie" the mode
> "ox-publish". But Emacs only offers me an "describe-mode" which
> describe all currently existing nodes. There is nothing like
> "describe-mode MODENAME". How can I handle that?

There is no such mode: `ox-publish' is (part of) the name of the file
that contains the code that is used for publishing - in particular
it contains the code of the function `org-publish'. You can get
the doc string of the function with `C-h f org-publish'.

> b) I another thread I was pointed to
> https://orgmode.org/manual/Publishing-options.html . There is no
> description about the options they are only listed. This does not
> help me. Maybe there are some useful options that could solve some
> of my problems. But without description I am not able to decide or
> know.
>

Read the first paragraph of that section carefully:

,
| The property list can be used to set many export options for the HTML
| and LaTeX exporters.  In most cases, these properties correspond to
| user variables in Org.  The table below lists these properties along
| with the variable they belong to.  See the documentation string for
| the respective variable for details.
`

So to find out e.g. what the option ‘:archived-trees’ does, you have
to ask for the doc string of the variable ‘org-export-with-archived-trees’.
You can do that with `C-h v org-export-with-archived-trees' or more easily
by putting the cursor on the name and typing `C-h v RET`.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




[PATCH] Fix typo in org-todo-list doc string

2022-03-07 Thread Nick Dokos

Tiny typo fix attached.
From 524e7d8610f42908202a9cbde727ad06c36ae706 Mon Sep 17 00:00:00 2001
From: Nick Dokos 
Date: Mon, 7 Mar 2022 13:11:50 -0500
Subject: [PATCH] Fix typo in doc string

* lisp/org-agenda.el (org-todo-list): Fix typo in doc string.
---
 lisp/org-agenda.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 9bc44a56eb01..356a74da64fe 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4875,7 +4875,7 @@ Press `\\[org-agenda-manipulate-query-add]', \
 
 ;;;###autoload
 (defun org-todo-list ( arg)
-  "Show all (not done) TODO entries from all agenda file in a single list.
+  "Show all (not done) TODO entries from all agenda files in a single list.
 The prefix arg can be used to select a specific TODO keyword and limit
 the list to these.  When using `\\[universal-argument]', you will be prompted
 for a keyword.  A numeric prefix directly selects the Nth keyword in
-- 
2.34.1



Re: Lisp error: (void-function org-element-keyword-parser)

2021-10-25 Thread Nick Dokos
Eric S Fraga  writes:

> On Thursday, 21 Oct 2021 at 20:54, William Denton wrote:
>> With my usual set up, I can get things working except that any Org files
>> initially loaded up aren't recognized as Org, but if I run =M-x org-mode= it 
>> all
>> kicks in.  
>
> For the record, I have had this or something very similar for a very
> long time (years) now.  All my org-agenda-files which get loaded during
> my initialization, when I set up the appointment handling, are in org
> mode but none of the in-file settings have been applied.  I brought this
> up on the list a long time ago and was told that this was the expected
> behaviour.
>
> Are you sure they are not recognised as org files or is it that your
> specific settings are ignored?

Hi Eric,

I'm pretty sure that that should *NOT* be the case: setting the mode
on the file consists of calling `org-mode'; that calls
`org-set-regexps-and-options' which loops over all the in-buffer
options and sets them.

When you do `C-c C-c' on an in-buffer option after the initialization,
that calls `org-mode-restart' which calls `org-mode' which calls
`org-set-regexps-and-options'.

So the only time an in-buffer setting would not be recognized is
after you've added it to the buffer and before you've restarted Org mode
on it (or closed and reopened which does pretty much the same thing).
If you have unrecognized settings when you open a file and the file is
already in Org mode, that needs to be investigated: it's very much
*un*expected AFAICT.

I haven't gone back to find the previous discussion, but if you can find
it, you might want to resurrect it.

-- 
Nick

"There are only two hard problems in computer science: cache invalidation, 
naming things, and off-by-one errors." -Martin Fowler




Re: Inequalities in math blocks

2021-10-11 Thread Nick Dokos
Rudolf Adamkovič  writes:

> Max Nikulin  writes:
>
>> Though I am a bit surprised that Org did not replace characters to
>>   and  during export. Perhaps, it is possible to define a
>> filter. 
>
> That makes sense, and thank you for the explanation. Ignoring the dead
> link in the Org manual, I wonder how this bug can even exist in Org
> after 15+ years of development. Some people, including the author of
> TeX himself, write TeX without unnecessary whitespace. Strange! Either
> way, rearranging bullet points should never break math without any
> visual sign inside of Emacs. Thus, this represents a bug in Org. R+

No, it does not. Org mode just passes LaTeX directly to MathJax
without changing anything. If you want to blame somebody, you can
blame HTML for choosing < and > as its delimiters: see

   http://docs.mathjax.org/en/latest/input/tex/html.html#html-special-characters

-- 
Nick




Re: 9.5: coping with loss of ditaa.jar

2021-10-11 Thread Nick Dokos
Tim Cross  writes:

> Another alternative which I just found is the ditaa version on github,
> which has SVG support. See https://github.com/stathissideris/ditaa. If
> you click on the 'release' link on the right, there is the most recent
> release, which includes a link to a standalone ditaa.jar file.
>
> I've not tried this version, but suspect it will work fine (assuming
> they use semantic versioning, which indicates the API has not
> changed). 
>
>
>

Perfect! Thank you for pointing that out.

I downloaded that, installed java-11-openjdk from the Fedora repos and
tried the standard example:

--8<---cut here---start->8---
#+begin_src ditaa :file example.svg :results file drawer
++   +---++---+
|| --+ ditaa +--> |   |
|  Text  |   +---+|diagram|
|Document|   |!magic!||   |
| {d}|   |   ||   |
+---++   +---++---+
: ^
|   Lots of work  |
+-+
#+end_src

#+RESULTS:
:results:
[[file:example.svg]]
:end:
--8<---cut here---end--->8---

It worked perfectly on Fedora 34.

Thanks!
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Switching to new Git repositories

2021-09-23 Thread Nick Dokos
FWIW, I get

$ git remote -v
upstreamhttps://git.savannah.gnu.org/git/emacs/org-mode.git (fetch)
upstreamhttps://git.savannah.gnu.org/git/emacs/org-mode.git (push)

$ git tag | wc -l
386

Maybe do

$ git remote update
$ git rebase

and try again?

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: org-table-toggle-column-width turn on for either all tables

2021-09-10 Thread Nick Dokos
Uwe Brauer  writes:

> Hi
>
> I find 
>
> (org-table-toggle-column-width  ARG)
>
> Very very useful, but in the current org version I have to toggle this
> for each and every table. 
>
> So I was wondering, when opening an org file 
>
> 1. Would it be possible to have all tables in an org-file have their
>column toggled.

You mean shrunk? If so, there is a #+STARTUP option for that:

#+STARTUP: shrink

>
> 2. Or with a special variable for single tables, just some of them?
>
I don't know of any such variable.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [PATCH] Fix match/maxlevel conflict in colview dynblock

2021-08-31 Thread Nick Dokos
Timothy  writes:

> Hi Nick,
>
> Thanks for reporting this issue here, and providing a patch. Unfortunately the
> “main maintainers” seem to be rather busy as of late, leaving you hanging for
> quite a while. I’ve had a look at the issue and your patch, and it the issue
> seems clear, and your patch small and straightforward enough that I feel
> confident pushing it should be fine :) it’s now on master with a small tweak 
> to
> the commit message.
>
> Thanks for your efforts.
>

Hi Timothy,

Thanks and no worries! And thanks for working through the backlog!

--
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Org table: emphasizing calculated cell

2021-08-27 Thread Nick Dokos
Jarmo Hurri  writes:

> Greetings Norwid.
>
> Norwid Behrnd  writes:
>
>> try extending the format of the table formula with asterisks, i.e.
>>
>> ```
>> | quantity |  value |
>> |--+|
>> | A|  1 |
>> | B|  3 |
>> |--+|
>> | *C*  | *0.33* |
>>
>> #+TBLFM:  @4$2=@-2/@-1; *%.2f*
>> ```
>>
>> Subsequently, issue the call ```C-c *``` for an update while the
>> cursor is within the table.  This approach works well enough for me
>> (equally for emphasis with enclosing forward slashes, or underscores)
>> in Emacs' native display (backed by elpa-org 9.4.0) as well as for a
>> subsequent export into .html and display (e.g., in Firefox), or .tex.
>
> Excellent, this is a working solution for the basic case. Much
> appreciated!
>
> This solution seems to change the contents of a cell, not only its
> formatting. So the following, where I try to increase the value of "C"
> by one, leads to an error:
>
> ```
> | quantity | value  |
> |--+|
> | A| 1  |
> | B| 3  |
> |--+|
> | *C*  | *0.33* |
> | D| #ERROR |
>
> #+TBLFM: @4$2=@-2/@-1; *%.2f*::@5$2=@-1+1
> ```
>
> I wonder if there is a way around this effect?
>

The error here is that `*0.33*' is no longer a string that can be converted to 
a number,
so the calculator barfs.

TUrn on formula debugging with `C-c {' and try evaluating it.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: ob-lilypond.el doesn't generate midi files

2021-08-27 Thread Nick Dokos
Michael Maurer  writes:

> On Thu, 26 Aug 2021 at 21:54, Nick Dokos  wrote:

>>
>> Michael Maurer  writes:
>>
>> > On Thu, 26 Aug 2021 at 15:03, Jonathan Gregory  wrote:
>> >>
>> >> Hi
>> >>
>> >> On 26 Aug 2021, Michael Maurer wrote:
>> >>
>> >> > I've installed lilypond and customized ob-lilypond to use the
>> >> > appropriate helper programs, but although it generates & shows
>> >> > pdfs just fine, generating a midi file it does not. I execute
>> >> > tangle on the codeblock, and all I get is "No midi file
>> >> > generated so can't play!". org-version 9.4.6 emacs 27.2 Win 10
>> >>
>> >> Can you also send a MWE of the code you're using to generate the
>> >> score?
>> >>
>> >
>> > I used a test file I copied over from Frescobaldi
>> >
>> > #+begin_src lilypond :file test.pdf
>> > \version "2.18.2"
>> > \score {
>> > \drums {
>> >   \time 2/4
>> >   sn16 sn8 sn16 sn8 sn8:32 ~
>> >   sn8 sn8 sn4:32 ~
>> >   sn4 sn8 sn16 sn16
>> >   sn4 r4
>> > }
>> >   \layout { }
>> >   \midi { }
>> > }
>> > #+end_src
>> >
>> > In Frescobaldi this gets me both midi-output and pdf. In Emacs with
>> > org it does say "Midi output to test.midi", but then there's that "no
>> > midi file generated" message.
>> >
>>
>> What happens if you save the contents of the source block into a file
>> and run lilypond on the file from the command line?
>>
>
> Both pdf and midi files get generated. Btw, ob-lilypond does generate
> the midi file as well, it just doesn't want to play it/recognize it.
> Maybe it's related to what helper app I've configured to open it? (but
> why that doesn't make sense, it's vlc btw).
>
>

Oh, I thought that it did not generate a midi file at all. So you are
saying that the midi file *is* produced and you *can* play it from the
command line with vlc, correct?

If that's the case, check the value of the variable
`org-babel-lilypond-midi-command' and see what happens when you invoke
that command on the midi file. In my case, the command is `xdg-open'
(I'm using Gnome on Fedora 33) and it opens Banshee to play it which
fails because of missing codecs. I installed the missing codecs and
`xdg-open foo.midi' sends the file to Banshee which can play it fine.

Also check if `org-babel-lilypond-arrange-mode' is t or nil: behavior
is very different depending on that.

Final thought: `xdg-open' starts whatever app it is supposed to run
in the background and returns immediately. That may cause problems with
babel. I still don't get anything when processing the file in babel.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: ob-lilypond.el doesn't generate midi files

2021-08-26 Thread Nick Dokos
Michael Maurer  writes:

> On Thu, 26 Aug 2021 at 15:03, Jonathan Gregory  wrote:
>>
>> Hi
>>
>> On 26 Aug 2021, Michael Maurer wrote:
>>
>> > I've installed lilypond and customized ob-lilypond to use the
>> > appropriate helper programs, but although it generates & shows
>> > pdfs just fine, generating a midi file it does not. I execute
>> > tangle on the codeblock, and all I get is "No midi file
>> > generated so can't play!". org-version 9.4.6 emacs 27.2 Win 10
>>
>> Can you also send a MWE of the code you're using to generate the
>> score?
>>
>
> I used a test file I copied over from Frescobaldi
>
> #+begin_src lilypond :file test.pdf
> \version "2.18.2"
> \score {
> \drums {
>   \time 2/4
>   sn16 sn8 sn16 sn8 sn8:32 ~
>   sn8 sn8 sn4:32 ~
>   sn4 sn8 sn16 sn16
>   sn4 r4
> }
>   \layout { }
>   \midi { }
> }
> #+end_src
>
> In Frescobaldi this gets me both midi-output and pdf. In Emacs with
> org it does say "Midi output to test.midi", but then there's that "no
> midi file generated" message.
>

What happens if you save the contents of the source block into a file
and run lilypond on the file from the command line?

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: I can't find "org-latex-toc-command"

2021-08-25 Thread Nick Dokos
Ypo  writes:

> Hi. I was trying to add a break-line after the TOC. I've search for
> some help, and I found this: (setq org-latex-toc-command
> "\\tableofcontents \\clearpage"). But, it seems
> org-latex-toc-command doesn't exist anymore? I can't find it, but
> since I am quite newbie, I am not sure if it's there or not.
>

It's there AFAICT: it's a variable defined in `ox-latex.el'.
Maybe you looked for it as a function with `C-h f ...' rather
than `C-h v ...'? Or maybe `ox-latex' is not loaded for some
unfathomable reason?

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Repeating task not repeating

2021-08-18 Thread Nick Dokos
Do `M-x org-lint` on your agenda files. It may not solve this problem, but
it's always worth trying first, since it's so easy - and it may find other
problems that you are unaware of.
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Bug: refreshing agenda moves all lines up [9.4.6 (9.4.6-12-gdcc3a8-elpa @ /Users/pu/.emacs.d/elpa/org-20210802/)]

2021-08-10 Thread Nick Dokos
p...@disroot.org writes:

> Hello everybody,
>
> my first bug report so I hope this is useful.
>
> Since the last org-mode update, whenever I press "r" to refresh my customised 
> agenda view (org-agenda-redo),
> the whole buffer moves up by 1 line, which hasn't been the case until now.
>

This was probably a bad interaction with `visual-line-mode', although
what exactly that means is not clear to me: see


https://emacs.stackexchange.com/questions/67999/refresh-org-agenda-org-agenda-redo-scrolls-buffer-by-1-line

for some more details.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Bug: org-clock-report tag matching seems to be broken [9.1.9 (release_9.1.9-65-g5e4542 @ c:/Users/user/emacs-26.3-x86_64/share/emacs/26.3/lisp/org/)]

2021-08-10 Thread Nick Dokos
"Lewalder, Sebastian" via "General discussions about Org-mode." 
 writes:

> I recently updated my packages and after the update the clock tables are
>
> not working anymore. I reran an report from june and here too the
>
> matching didn't work anymore.
>
> #+BEGIN: clocktable :scope file :maxlevel 4 :match "traj"

IIUC, the problem is the presence of both `maxlevel' and `match' specifiers:
the code does not handle that case correctly.

You might want to try a patch that I submitted some time ago to fix that:

https://orgmode.org/list/87h7h0w5nz@alphaville.usersys.redhat.com/

I believe this is the second time that this problem has been reported
to the mailing list since then (plus there was a question about the
same problem on Emacs SE), so if you can review it and/or try it out,
that might help to get it reviewed and merged.

If anybody else is willing to review it as well, I'd appreciate it.

Thanks!
--
Nick

>
> #+CAPTION: Clock summary at [2021-08-06 Fr 08:48]
>
> | Headline  | Time   |  |  |  |
>
> |---++--+--+--|
>
> | *Total time*  | *2:33* |  |  |  |
>
> |---++--+--+--|
>
> | 2021  | 2:33   |  |  |  |
>
> | \_  2021-06 Juni  || 2:33 |  |  |
>
> | \_2021-06-01 Dienstag ||  | 2:33 |  |
>
> | \_  Trajectory calc   ||  |  | 0:41 |
>
> | \_  Concept work  ||  |  | 1:52 |
>
> #+END:
>
> * 2021
>
> ** 2021-06 Juni
>
> *** 2021-06-01 Dienstag
>
>  Trajectory calc   :traj:
>
>  :LOGBOOK:
>
>  CLOCK: [2021-06-01 Di 11:40]--[2021-06-01 Di 12:21] =>  0:41
>
>  :END:
>
>  Concept work  
> :concept:
>
>  :LOGBOOK:
>
>  CLOCK: [2021-06-01 Di 13:10]--[2021-06-01 Di 13:24] =>  0:14
>
>  CLOCK: [2021-06-01 Di 12:21]--[2021-06-01 Di 12:41] =>  0:20
>
>  CLOCK: [2021-06-01 Di 10:22]--[2021-06-01 Di 11:40] =>  1:18
>
>  :END:
>
> Emacs  : GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
>
> of 2019-08-29
>
> Package: Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ 
> c:/Users/user/emacs-26.3-x86_64/share/emacs/26.3/lisp/org/)
>
> current state:
>
> ==
>
> (setq
>
> org-src-mode-hook '(org-src-babel-configure-edit-buffer 
> org-src-mode-configure-edit-buffer)
>
> org-after-todo-state-change-hook '(org-clock-out-if-current)
>
> org-metadown-hook '(org-babel-pop-to-session-maybe)
>
> org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
>
> org-agenda-files '("~/org")
>
> org-modules '(org-habit)
>
> org-mode-hook '(er/add-org-mode-expansions
>
>  #[0 "\300\301\302\303\304$\207"
>
>[add-hook change-major-mode-hook org-show-block-all append 
> local] 5]
>
>  #[0 "\300\301\302\303\304$\207"
>
>[add-hook change-major-mode-hook org-babel-show-result-all 
> append local] 5]
>
>  org-babel-result-hide-spec org-babel-hide-all-hashes
>
>  #[nil "\300\301!\207" [run-hooks prelude-org-mode-hook] 2])
>
> org-archive-hook '(org-attach-archive-delete-maybe)
>
> org-confirm-elisp-link-function 'yes-or-no-p
>
> org-agenda-before-write-hook '(org-agenda-add-entry-text)
>
> org-metaup-hook '(org-babel-load-in-session-maybe)
>
> org-babel-pre-tangle-hook '(save-buffer)
>
> org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
> org-babel-header-arg-expand)
>
> org-log-done 'time
>
> org-habit-show-habits-only-for-today nil
>
> org-occur-hook '(org-first-headline-recenter)
>
> org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
> org-cycle-show-empty-lines
>
>   org-optimize-window-after-visibility-change)
>
> org-speed-command-hook '(org-speed-command-activate 
> org-babel-speed-command-activate)
>
> org-confirm-shell-link-function 'yes-or-no-p
>
> org-link-parameters '(("id" :follow org-id-open) ("file+sys") ("file+emacs") 
> ("doi" :follow org--open-doi-link)
>
>("elisp" :follow org--open-elisp-link) ("file" 
> :complete org-file-complete-link)
>
>("ftp" :follow (lambda (path) (browse-url (concat 
> "ftp:" path
>
>("help" :follow org--open-help-link)
>
>("http" :follow (lambda (path) (browse-url (concat 
> "http:" path
>
>("https" :follow (lambda (path) (browse-url (concat 
> "https:" path
>
>("mailto" :follow (lambda (path) (browse-url (concat 
> "mailto:; path
>
>("news" :follow (lambda (path) (browse-url (concat 
> "news:; path
>
>("shell" :follow org--open-shell-link))
>
> )
>

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, 

Re: Bug: :match filter fails on columnview dblock when :maxlevel present [9.4.6 (9.4.6-gab9f2a @ /Users/pabfr/.emacs.d/elpa/org-9.4.6/)]

2021-07-27 Thread Nick Dokos
I have submitted a patch to allow both match and maxlevel to be specified:

https://orgmode.org/list/87h7h0w5nz@alphaville.usersys.redhat.com/

but it has not been reviewed, tested or merged yet. Maybe you can test it
and report? That should help move it forward.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: a repeater doesn't increment

2021-07-27 Thread Nick Dokos
Jude DaShiell  writes:

> What I'm trying to do is more complex than that.
> * Reorder pills
> ** TODO order hctz, lisinipril, metformin, provacol, claritin, Co-q10,
>Deadline: <8-2-2021 +4w>
> ** TODO order Colase
>Deadline: <10-13-2021 +14w>
> ** TODO order Turmerick
>Deadline: <8-30-2021 +8w>
>
> On Thu, 22 Jul 2021, Nick Dokos wrote:
>
>> Jude DaShiell  writes:
>>
>> > Does enough material exist on werg tutorials that document how to get a
>> > repeater operational?  That or maybe I don't understand repeaters.  Had
>> > the repeater I tried to use worked correctly it would have advanced the
>> > original date by 4 weeks when that date got copied down to another cell.
>> > I selected the whole line including both verticals and perhaps this works
>> > when only a time stamp is copied.
>> >
>> >> I am likely doing this wrong but will describe what has been done.
>> >> I put an agenda time stamp into a field in test.org and add +4w to the end
>> >> of the time stamp inside the >.
>> >> I get on the left of the field column on the vertical character and type
>> >> control-space to set mark.
>> >> I move to the end of the field on the > sign and type space and another
>> >> vertical to close the column entry for that field.
>> >> Next I do control-c+x+v and am told strings are copied to the kill ring.
>> >> Next I move down one line and type control-y to yank those strings out of
>> >> the kill buffer and paste them on that line.
>> >> When this is done, I expected the time stamp to increment by 4 weeks.
>> >> What happened was the same information got copied down and it didn't
>> >> increment.
>> >> What am I doing wrong?
>> >>

I still don't understand: in your most recent response (at the top of this 
thread)
you are talking about headlines with DEADLINE added (which seems the right 
approach
to me: is there a problem with it?) But in your original mail, as well as in 
the followup, you are
taling about "field columns" and "vertical characters" and "cop[ying] down to 
another cell",
which seems to imply that you have an Org mode table somewhere.

Maybe you can elaborate a bit?
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: a repeater doesn't increment

2021-07-22 Thread Nick Dokos
Jude DaShiell  writes:

> Does enough material exist on werg tutorials that document how to get a
> repeater operational?  That or maybe I don't understand repeaters.  Had
> the repeater I tried to use worked correctly it would have advanced the
> original date by 4 weeks when that date got copied down to another cell.
> I selected the whole line including both verticals and perhaps this works
> when only a time stamp is copied.
>

I may be misunderstanding, but are you trying to fill a column in a table
with dates that are four weeks apart? If so, repeaters have nothing to do
with it (AFAIK). You need `org-table-copy-increment' to be set to 28.

--8<---cut here---start->8---

| date | foo |
|--+-|
| <2021-07-22 Thu> | |
| <2021-08-19 Thu> | |
| <2021-09-16 Thu> | |
| <2021-10-14 Thu> | |
| <2021-11-11 Thu> | |
| <2021-12-09 Thu> | |


* Code

#+begin_src elisp
(setq-local org-table-copy-increment 28)

#+end_src

#+RESULTS:
: 28

--8<---cut here---end--->8---

Then keep pressing `S-RET' to get the next date.


>
> On Tue, 20 Jul 2021, Jude DaShiell wrote:
>
>> I am likely doing this wrong but will describe what has been done.
>> I put an agenda time stamp into a field in test.org and add +4w to the end
>> of the time stamp inside the >.
>> I get on the left of the field column on the vertical character and type
>> control-space to set mark.
>> I move to the end of the field on the > sign and type space and another
>> vertical to close the column entry for that field.
>> Next I do control-c+x+v and am told strings are copied to the kill ring.
>> Next I move down one line and type control-y to yank those strings out of
>> the kill buffer and paste them on that line.
>> When this is done, I expected the time stamp to increment by 4 weeks.
>> What happened was the same information got copied down and it didn't
>> increment.
>> What am I doing wrong?
>>
>>
>>
>
>

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: what would cause failure in template for org capture?

2021-07-21 Thread Nick Dokos
Eric S Fraga  writes:

> Hello all,
>
> I am getting this error message:
>
> org-capture: Capture abort: Unknown template placeholder: "%^G"
>
> when attempting to capture a task using this template:
>
> #+begin_src emacs-lisp
>   (add-to-list 'org-capture-templates
>'("t"
>  "todo"
>  entry (file+headline "~/s/notes/todo.org" "refile")
>  "* %^{Task}   %^G\n%i%?\n%U\n"))
> #+end_src
>
> The error happens after having entered the information for the Task in
> the template so next would be the tags.
>
> This was working until recently.  Both Emacs and org are up to date
> relative to their git repositories.  The only change done recently in my
> configuration is a move from ivy to selectrum for completion.

FWIW, it's working for me. There was a change on July 8 having to do
with tags completion (using completing-read-multiple), but I'm running
with that change and I don't see a problem. OTOH, I'm not using
selectrum (or ivy for that matter), so the change may be interacting
badly with it.

I would probably edebug `org-capture-fille-template` and check that the
code around l.1733 in `org-capture.el' behaves as expected.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: convert subtree or nested list to table

2021-07-20 Thread Nick Dokos
Matt Price  writes:

> Christian et al,
>
> I seem to have broken something while fiddling around and I can't quite make 
> out what.  Would someone be willing to check for me whether this does or does 
> not produce the desired full table? Right now I am again getting a truncated 
> result and I'm not
> fully sure what I might be oding wrong.  Here is what I have:
>
> #+NAME: rubric-one
> - Grade
>   a. A
>   b. B
>   c. C
>   d. D
>   e. F
> - Style
>   a. Excellent
>   b. Good
>   c. Adequate
>   d. Lousy
>   e. Failing
>
These seem to have zero-width spaces and maybe that breaks the structure. To 
make sure that the structure is recognized properly,
maybe try a very simple code block:


--8<---cut here---start->8---
#+begin_src elisp :var data=rubric-one :results drawer
data
#+end_src

#+RESULTS:
:results:
((Grade (ordered (A) (B) (C) (D) (F))) (Style (ordered (Excellent) (Good) 
(Adequate) (Lousy) (Failing
:end:
--8<---cut here---end--->8---

If that does not work, then something is fishy with `rubric-one', so start 
there.

--
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [PATCH] ob-core: tangle check library of babel after current buffer

2021-07-17 Thread Nick Dokos
Tom Gillespie  writes:

> Pinging on this to see if anyone can test it so that it can be merged.
> Tom
>
> On Wed, Jun 16, 2021 at 4:29 PM Tom Gillespie  wrote:
>>
>> Hi,
>>This is a patch that fixes tangling behavior when a block has been
>> ingested into the library of babel and then modified. Best!
>> Tom
>
>

I have not tested it but I reviewed the code and it looks good to me.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




[PATCH] Fix match/maxlevel conflict in colview dynblock

2021-07-11 Thread Nick Dokos

Specifying both `maxlevel' and `match' in a columnview dynamic block
was broken: the `match' argument is ignored in that case. See the link
below for a (not so minimal) ECM.

Reported-by: Pablo A Perez-Fernandez
Link: 
https://emacs.stackexchange.com/questions/66658/filter-columnview-dblock-on-properties-or-tags

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler

>From 8bcff482e59c24758f87b9b5cdef3bc123dc12f8 Mon Sep 17 00:00:00 2001
From: Nick Dokos 
Date: Sun, 11 Jul 2021 22:30:22 -0400
Subject: [PATCH] Fix match/maxlevel conflict in colview dynblock

* lisp/org-coplview.el (org-columns--capture-view): Combine the match
and maxlevel arguments properly to construct the MATCH argument of
`org-map-entries'.

Specifying both `maxlevel' and `match' in a columnview dynamic block
does not work: the `match' argument is ignored in that case. See the
link below for a (not so minimal) ECM.

Reported-by: Pablo A Perez-Fernandez
Link: https://emacs.stackexchange.com/questions/66658/filter-columnview-dblock-on-properties-or-tags
---
 lisp/org-colview.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 2e1c29a99..7144308ff 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -1398,8 +1398,9 @@ other rows.  Each row is a list of fields, as strings, or
   (org-get-tags
 	 (push (cons (org-reduced-level (org-current-level)) (nreverse row))
 		   table)
- (or (and maxlevel (format "LEVEL<=%d" maxlevel))
-	 (and match match))
+ (if match
+ (concat match (and maxlevel (format "+LEVEL<=%d" maxlevel)))
+   (and maxlevel (format "LEVEL<=%d" maxlevel)))
  (and local 'tree)
  'archive 'comment)
 (org-columns-quit)
-- 
2.31.1



Re: breakpoint in debugging org-table formulas

2021-07-08 Thread Nick Dokos
Uwe Brauer  writes:

> Hi 
>
> I just started to use the formula debugger
> (org-table-toggle-formula-debugger) which is quite nice.
>
> However for large tables with a lot of rows it would be more
> convenient to use breakpoints and not start just in the first row.
>
> I can't find any reference for that. 
>
> It is not implemented?
>
I've often wished for the same, but I don't think it's implemented.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: how to document/comment a complex org table formula

2021-07-08 Thread Nick Dokos
Uwe Brauer  writes:

 "GdaO" == General discussions about Org-mode  writes:
>
>> Limbic answer : 
>>   - create an emacs-lisp function doing what you want
>>   - comment /ad libitum/
>>   - call this function in your spreadsheet.
>
> I hoped such a function already existed and somebody would point it out
> to me (I searched the package-list-package list but nothing came up)
>

IIUC, the function would replace the formula, so it's really the
formula in a different guise, similar to what Eric F. was talking
about: implementing the formula as a source block. Both of them put
the code in some other place, where there is space to add comments.
IOW, it's not a general-purpose function. But I may be misconstruing
what Emmanuel was suggesting.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: table: problem with nan and if

2021-06-22 Thread Nick Dokos
Uwe Brauer  writes:

>> Uwe Brauer  writes:
>
>
>> I'm not very familiar with calc, but am wondering if the issue is the
>> 'nan'. In many languages, a nan is a 'polluting' variable i.e. once you
>> have a nan as a form anywhere in your calculation, the result will
>> always be a nan. Many languages actually have a special function to test
>> for a nan because it isn't actually a 'value'. Don't know if this is the
>> case with calc. 
>
> Yeah, when I googled, I found complains about nan using in calc but I
> did not really found an working alternative.
>
>> Perhaps an alternative strategy might help. Could you address what is
>> generating the nan and change that so that it generates something else,
>> possibly even a blank string and avoid the nan altogether? 
>
> I tried nil and other expressions but non really worked, so maybe a calc
> guru could clarify?
>

Could you write the formulas in lisp instead? You might be able to control
things more easily:

  (info "(org) Formula syntax for Lisp")

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [BUG] org babel fails with matlab+python kernel on MacOS-10.15 [9.4.6 (release_9.4.6-541-g52b097 @ /Users/oub/emacs/site-lisp/packages/org/)]

2021-06-14 Thread Nick Dokos
Uwe Brauer  writes:

>
>>> |   ob-ipython--dump-error("Traceback (most recent call last):\n  File 
>>> \"/Users/...")
>
>
>
>> This line seems to be the critical one in the error output. If you can
>> expand out the full error message, it may elucidate what the problem is.
>
> This message drives my crazy since the most important information is
> just not shown.
>

IIUC, clicking on the three dots should expand the message to its full
glory. You'll probably need to cut-n-past it to another buffer and
replace "\n" with "real" newlines to make it readable.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: LaTeX fragment preview weirdness

2021-06-02 Thread Nick Dokos
Scott Randby  writes:

> First, I'm using Emacs 27.2 and Org 9.4.6.
>
> I have the following code in an Org file:
>
> #+latex_header: 
> \hypersetup{pdfauthor={Author},pdftitle={Title},pdfsubject={Subject},pdfkeywords={keyword},pdfproducer={Emacs
>  Org},pdfcreator={pdflatex}}
> #+latex_header: \hypersetup{colorlinks=true,urlcolor=blue,linkcolor=black}
>
> The above lines are in a section at the end of my document.
>
> When I do C-c C-x C-l in a section (or with a fragment at point), the 
> following appears above every  fragment that is previewed:
>
> pdfauthor=Author,pdftitle=Title,pdfsubject=Subject,pdfkeywords=keyword,pdfproducer=Emacs
>  Org,pdfcreator=pdflatex colorlinks=true,urlcolor=blue,linkcolor=black
>
> Here is a sample section from my Org file:
>
> --BEGIN--
>
> * Distance Formula
>
> Let $d$ be the distance between $(x_{1}, y_{1})$ and $(x_{2}, y_{2})$.
> \[
> d=\sqrt{\left(x_{1}-x_{2}\right)^{2}+\left(y_{1}-y_{2}\right)^{2}}
> \]
>
> --END--
>
>

You probably want #+LATEX_HEADER_EXTRA, not #+LATEX_HEADER. Do

   (info "(org) Latex header and sectioning")

where it says:

#+BEGIN_QUOTE
   The LaTeX export back-end appends values from ‘LATEX_HEADER’ and
‘LATEX_HEADER_EXTRA’ keywords to the LaTeX header.  The docstring for
‘org-latex-classes’ explains in more detail.  Also note that LaTeX
export back-end does not append ‘LATEX_HEADER_EXTRA’ to the header when
previewing LaTeX snippets (see *note Previewing LaTeX fragments::).
#+END_QUOTE

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: suggestion to change default org-latex-pdf-process to latexmk

2021-06-01 Thread Nick Dokos
"Bruce D'Arcus"  writes:

> While testing org-cite a few weeks ago, I noticed by default bibtex
> won't run with natbib export, or biblatex with biblatex export.
>
> Since org has not had native citations, this is not surprising.
>
> But with org-cite coming soon, this will change.
>
> At the time I suggested changing default to use latexmk, which will
> handle both bibtex and biblatex runs.
>
> https://lists.gnu.org/archive/html/emacs-orgmode/2021-05/msg00486.html
>
> So what do LaTeX users think about changing the default for
> "org-latex-pdf-process" to "latexmk"?
>
> Is there any reason not to do this?
>

The only reason I can think of is that it might not be available by
default, so it will be one more thing for a noob to install before Org mode
starts "working".

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Manual on web site is not the latest version

2021-05-17 Thread Nick Dokos
William Denton  writes:

> On 28 April 2021, Bastien wrote:
>
>> Do you still see differences between the doc/org-manual.org and the
>> one published on https://orgmode.org/manual/ ?
>>
>> If so, please point at one or two differences.  Thanks!
>
> Here's a late follow-up.  Thanks for checking.
>
> On the web at https://orgmode.org/manual/Languages.html#Languages
>
> "Code blocks in the following languages are supported."
>
> "Additional documentation for some languages is at 
> https://orgmode.org/worg/org-contrib/babel/languages.html.;
>
> In org-manual.org, both sentence are different:
>
> $ grep -A2 "Code blocks" doc/org-manual.org
> Code blocks in dozens of languages are supported.  See Worg for
> [[https://orgmode.org/worg/org-contrib/babel/languages/index.html][language
> specific documentation]].
>
>
> Bill
>
> --
> William Denton
> https://www.miskatonic.org/
> Librarian, artist and licensed private investigator.
>
>

The online manual is for 9.4 (the released version). What you see in 
org-manual.org
is for 9.5 (which AFAIK has not been released yet).

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: The fate of ditaa.jar (9.4.5.)

2021-05-10 Thread Nick Dokos
Jarmo Hurri  writes:

> Greetings.
>
> I pulled the latest master and noticed that contrib has been moved into
> a separate repository. I also cloned this contrib repository, but can
> not find the file
>
> scripts/ditaa.jar
>
> in the repo. In fact, there is no directory scripts in the repo.
>
> The documentation in the latest master states that
>
> Stathis Sideris wrote the ‘ditaa.jar’ ASCII to PNG converter that is now
> packaged into the org-contrib repository.
>
> How should I proceed? Should I build this separately
>
> https://github.com/stathissideris/ditaa

You don't need to build it: it's available in the release area

https://github.com/stathissideris/ditaa/releases

>
> or will it still be included into contrib?

In general, I think it's a better idea to point to the canonical sources
and document how to integrate it into Org mode, than bundle things like
that, but I have no idea how things are going to go. I'm sure there will
be some problems that will need fixing one way or another.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: publishing does not work anymore

2021-05-06 Thread Nick Dokos
Giuseppe Lipari  writes:


> (setq org-publish-project-alist
>    '(("fil-web"
>       :base-directory "./"
>       :base-extension "org"
>       :publishing-directory "./"
>       :preparation-function update-all-dblocks-before-exporting
>       :publishing-function org-html-publish-to-html
>       :html-extension "php"
>       :body-only t
>       :html-postamble: t
>       :html-postamble-format : ""

This last one seems wrong: the extra space before the colon should probably not 
be there.
And I'm not sure whethe the colon after the last two properties should be there 
at all.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Programmatically set TODO labels per file?

2021-04-29 Thread Nick Dokos
Arthur Miller  writes:

> I have a simple question, but I wasn't able to find answer on the web,
> so finally I'll try my luck here.
>

> I know I can setq org-todo-keywords with a list '((sequence "TODO"
> DONE")), as an example. But what variable is used for per-file keywords?
> Once that are set with #+TODO: ... line?
>
> I guess when org mode parses a file when starting up the mode, it has to
> parse that line into some var, where do I find it?
>

It is parsed into a buffer-local variable by the name of
`org-todo-keywords-1'. Do `C-h v org-todo-keywords' and `C-h v
org-todo-keywords-1' for all the details.

BTW, when the interwebs fail you (or even before that), use the source :-)

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: splot and #+PLOT keyword

2021-04-28 Thread Nick Dokos
Eric S Fraga  writes:

> Hello,
>
> a question/problem regarding the #+plot: keyword.
>
> I am trying to plot out some data where the table looks like this:
>
> #+begin_src org
>   ,#+plot: ind:(6 7) deps:(1) with:"linespoints pt 7" set:"logscale xy" 
> type:3d
>   | 1 |   81 |  5 |  0 |   2.27 | 0.9729848950975623 |   
> 0.019370016994566613 | 0.0 |
>   | 2 |  179 | 12 |  2 |   3.68 |0.42919355355596267 |  
> 0.098179980500945 | 0.0 |
>   | 3 |  192 |  6 |  4 |   3.73 |   0.022272788298562045 | 
> 107.57399021086516 | 0.0 |
>   | 4 |  207 |  7 |  8 |   3.78 |  5.793210638997738 |  
> 0.0012069891001225872 | 0.0 |
>   | 5 |  194 | 10 | 12 |   3.83 |0.06356594000544429 |
> 0.04724965431965522 | 0.0 |
>   | 6 |  216 |  8 | 14 |   3.89 |0.06342050747033937 |  
> 0.0030380306687021346 | 0.0 |
>   | 7 |  193 |  7 | 18 |   3.94 | 0.0021538841210584 |
> 0.05771587421360767 | 0.0 |
>   | 8 |  193 |  7 | 19 |   3.99 |  0.0010739216097561438 |
> 0.10625133051680691 | 0.0 |
>   | 9 |  182 |  6 | 19 |   4.04 |  0.0014893478573963876 |
> 0.03593357278451856 | 0.0 |
>   |10 |  192 |  6 | 21 |   4.10 |   0.013251328328567616 |  
> 0.0006605631984014402 | 0.0 |
> #+end_src
>
>
> I have tried a variety of directives for the #+PLOT: keyword but none
> give me what I want.  I would like to plot column 1 (dependent variable)
> versus columns 6 and 7 (independent variables) in 3d.  (don't ask ;-))
>
> I have also tried:
>
>#+plot: ind:6 deps:(7 1) ...
>
> but in all cases I seem to be getting somewhat random data plotted,
> possibly columns 2 versus 3 and 4, which makes no sense except that
> maybe the "|" table column separator is being retained in the data file
> created.  Is there any way to stop the data file from being deleted
> after plotting?  I can inspect the *gnuplot* buffer but cannot see the
> actual data.
>
> 2d plots work just fine, by the way.
>
> thank you,
> eric

Have you tried looking at the produced gnuplot script? It goes in a temp file
so it's a bit of a pain, but that's my fallback method when I'm really confused 
:-)

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Bug: org-columns--compute-spec tries to set CLOCKSUM property [9.4.4 (release_9.4.4-231-gf46925 @ /home/nick/elisp/org-mode/lisp/)]

2021-04-09 Thread Nick Dokos
Nicolas Goaziou  writes:

>>   | ITEM  | CLOCKSUM |
>>   |---+--|
>>   | Goal 3| 2:11 |
>>   |---+--|
>>   | Task 1| 2:11 |
>>   |---+--|
>>   | Subtask 1 | 1:00 |
>>   #+END
>> --8<---cut here---end--->8---
>
> Why do you say the entries are wrong?
>

Temporary (I hope...) brain damage.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Bug: Display Inline Images from Subdirectory [9.4.4 (9.4.4-33-g5450d6-elpaplus @ /home/ded/.emacs.d/elpa/org-plus-contrib-20210322/)]

2021-04-06 Thread Nick Dokos
"Daniel E. Doherty"  writes:

> I have a hook function (cribbed from Emacs Stack Exchange) to re-display 
> inline images in the current subtree after execution of a source block 
> if the header argument contains, ':results graphics'.  As its last 
> action, it calls:
>
> (org-display-inline-images nil nil beg end)
>
> where beg and end have been set to the bounds of the current subtree.
>
> This works perfectly if the image file is in the current directory.  For
> example, here is a block that displays as expected:
>
> #+begin_SRC dot :file lehman.svg :cmdline -Kdot -Tsvg :results graphics
>   digraph lehman {
> Thomas [shape=circle];
> TideWater [shape = box, label="Tide Water\nSecurities\n(Issuer)"];
> Lehman [shape = box];
> Thomas -> TideWater [label="Director"];
> Lehman -> TideWater [label="Shareholder"];
> Thomas -> Lehman [label="Partner"];
>   }
> #+end_SRC
>
>
> However, if I add a :dir header, it ceases to work:
>
> #+begin_SRC dot :dir dot :file lehman.svg :cmdline -Kdot -Tsvg :results 
>  graphics
>   digraph lehman {
> Thomas [shape=circle];
> TideWater [shape = box, label="Tide Water\nSecurities\n(Issuer)"];
> Lehman [shape = box];
> Thomas -> TideWater [label="Director"];
> Lehman -> TideWater [label="Shareholder"];
> Thomas -> Lehman [label="Partner"];
>   }
> #+end_SRC
>
>
> #+RESULTS:
> [[file:dot/lehman.svg]]
>
> I have run edebug on the function, and the only difference I can detect
> is the location of the image file in a subdirectory called 'dot'.
>
> Here is my hook function, just for the record:
>
> #+begin_SRC emacs-lisp
>   (setq org-startup-with-inline-images t)
>   (require 'subr-x)
>   (defun ded:org-babel-display-subtree ()
> "Redisplay inline images in subtree if cursor in source block with 
> :result graphics."
>
> (when (org-in-src-block-p)
>   (let (beg end)
> (save-excursion
>   (org-mark-subtree)
>   (setq beg (point))
>   (setq end (mark)))
> (when-let ((info (org-babel-get-src-block-info t))
>(params (org-babel-process-params (nth 2 info)))
>(result-params (cdr (assq :result-params params)))
>((member "graphics" result-params)))
>   (org-display-inline-images nil nil beg end)
>
>   (add-hook 'org-babel-after-execute-hook 
>   #'ded:org-babel-display-subtree)
> #+end_SRC
>

FWIW, this works fine for me: Org mode version 9.4.4 (release_9.4.4-231-gf46925 
@ /home/nick/elisp/org-mode/lisp/)

The only things I had to do was 1) to make the above into a tree by
adding a headline (otherwise, I guess org-mark-subtree would complain:
Not in a subtree) and 2) create the dot subdirectory.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: "#+STARTUP: hideblocks" has no effect?

2021-04-06 Thread Nick Dokos
autofrettage  writes:


> I recently read about the #+STARTUP parameter "hideblocks", but it
> doesn't seem to have any effect in my set-up. All the blocks kept
> laughing straight in my face. :-(
>
> Any ideas about what could have gone wrong?
>
> I use Org Mode 9.4.5 with Emacs 26.3, and I also tried closing the
> file and Emacs before I tried.
>
>
> p.s. Setting org-hide-block-startup with local variables is a
> solution, but not as nice as doing it with #+STARTUP, I'd say.


It interacts with org-startup-folded (whose default was changed
recently to 'showeverything'): you need to set the latter to something
other than 'showeverything' in order for hideblocks to be effective.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Bug: org-columns--compute-spec tries to set CLOCKSUM property [9.4.4 (release_9.4.4-231-gf46925 @ /home/nick/elisp/org-mode/lisp/)]

2021-04-05 Thread Nick Dokos
The following MWE illustrates:

--8<---cut here---start->8---
#+COLUMNS: %25ITEM %6CLOCKSUM{:}

* Goal 3
  :PROPERTIES:
  :ID: goal_3
  :END:

  #+BEGIN: columnview :hlines 4 :id goal_3 :maxlevel 3

  #+END

** TODO Task 1
   :LOGBOOK:
   CLOCK: [2020-01-26 18:05]--[2020-01-26 Mon 19:16] =>  1:11
   :END:

   Task body

*** TODO Subtask 1
 :LOGBOOK:
 CLOCK: [2020-01-28 Tue 15:45]--[2020-01-28 Tue 16:45] =>  1:00
 :END:
 
--8<---cut here---end--->8---

Starting with `emacs -Q foo.org', place the cursor on the `#+BEGIN:
columnview' line and type `C-c C-c`. That produces a table (although
the entries are wrong):

--8<---cut here---start->8---
  #+BEGIN: columnview :hlines 4 :id goal_3 :maxlevel 3
  | ITEM  | CLOCKSUM |
  |---+--|
  | Goal 3| 2:11 |
  |---+--|
  | Task 1| 2:11 |
  |---+--|
  | Subtask 1 | 1:00 |
  #+END
--8<---cut here---end--->8---

But then doing it again fails with the following (elided) backtrace:

--8<---cut here---start->8---
Debugger entered--Lisp error: (error "The CLOCKSUM property cannot be set with 
‘org-entr...")
  signal(error ("The CLOCKSUM property cannot be set with ‘org-entr..."))
  error("The %s property cannot be set with `org-entry-put'" "CLOCKSUM")
  ...
  org-entry-put(147 "CLOCKSUM" "1:00")
  (progn (org-entry-put (point) property new-value))
  (if (and update value (not (equal value new-value))) (progn (org-entry-put 
(point) property new-value)))
  (let ((new-value (org-trim summary))) (if (and update value (not (equal value 
new-value))) (progn (org-entry-put (point) property new-value
  ...
  org-columns--compute-spec(("CLOCKSUM" "CLOCKSUM" 6 ":" nil) t)
  ...
  org-columns-compute-all()
  ...
  org-columns(nil nil)
  org-columns--capture-view(3 nil nil nil nil 35)
  ...
  org-dblock-write:columnview((:name "columnview" :hlines 4 :id goal_3 
:maxlevel 3 :indentation-column 2 :content #("\n" 0 1 (org-category "foo500" 
wrap-prefix #("  " 0 2 (face org-indent)) line-prefix #("  " 0 2 (face 
org-indent)) fontified t
  ...
  org-update-dblock()
  (save-excursion (goto-char (org-element-property :post-affiliated context)) 
(org-update-dblock))
  ...
  org-ctrl-c-ctrl-c(nil)
--8<---cut here---end--->8---

Part of the problem seems to be that `org-get-entry' manufactures
CLOCKSUM properties out of the CLOCK entries above, but
`org-put-entry' knows that that's a special property and refuses to
put it. But I think the major fail is in `org-columns--compute-spec'
which takes the property at face value and just passes it along. I
believe it needs to do whatever accumulation it is supposed to do and
set a text property to store the value in the headline, but that's
guessing on my part.

I saw this on Emacs SE (the above example is a simplified version of
the example in the post):


https://emacs.stackexchange.com/questions/55164/org-columns-error-the-clocksum-property-cannot-be-set-with-org-entry-put

and it has apparently been reported once before:

https://lists.gnu.org/archive/html/emacs-orgmode/2012-02/msg00309.html


Emacs : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 2.24.33, cairo version 1.16.0) of 2021-02-17
 
Package: Org mode version 9.4.4 (release_9.4.4-231-gf46925)
-- 
Nick




Re: How to get shell source blocks to read my profile?

2021-03-16 Thread Nick Dokos
George Mauer  writes:

> I understand why you say that maxim but testing that this worked was the 
> first thing I did
> and it does work. I was surprised as well. I haven't debugged all the way 
> into the eval
> functions to see why this works but my guess is that the authors were pretty 
> smart about
> figuring out which executable to invoke.
>

Starting with `emacs -q' I evaluate

(setq shell-file-name "bash -i")

in the *scratch* buffer and then do `M-x shell'. I get

apply: Searching for program: No such file or directory, bash -i


If I do

(setq shell-file-name "/bin/bash -i")

I get

emacs: /bin/bash -i: No such file or directory

Process shell exited abnormally with code 127

The trouble is that `shell-file-name' may be used much more widely than you 
expect.

> As for the problem I'm trying to solve, there isn't one exactly. This is more 
> me hacking on
> something I don't fully understand because it regularly trips me up.
>
> I do still wonder what would be the disadvantage of just configuring it to do 
> --login by
> default and doing all configuration in profile scripts. It would be 
> unconventional yes, but
> it would also make dynamic scoping of environment variable effectively opt-in 
> via
> --noprofile rather than opt-out (which imo is how it should be). I would 
> assume that uses
> extra resources or risks improperly handling crashed processes, but I can't 
> find anything to
> that effect in the docs
>
> On Tue, Mar 16, 2021, 07:32 Maxim Nikulin  wrote:
>
> On 16/03/2021 00:49, George Mauer wrote:
> >    shell-file-name: "/bin/zsh -i"
>
> I am afraid, you should be prepared to face some problem accidentally.
> The value of this variable is used to execute the specified file
> ("zsh -i" in the "/bin" directory, I do not think, you have such file),
> not as a part of shell command. shell-file-name in namely file name to
> be executed with shell-command-switch as first argument (separate
> arguments, not merged into a string) to run shell commands (next 
> argument).
>
> Environment variables could be set on OS level, inside emacs
> https://www.gnu.org/software/emacs/manual/html_node/emacs/Environment.html
> , etc. It is hard to suggest something since you have not described the
> problem you are trying to solve. Tim in details explained why you
> attempt to solve it did not work, but the problem (or the goal) is still
> unknown.
>

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Problems while trying to load feature

2021-03-16 Thread Nick Dokos
"Charles R (Charlie) Martin"  writes:

> This is a problem I’ve noticed as well. Now, I am a programmer — my
> code or it’s descendants is still in the distribution — I do update
> org mode regularly, and I get messages when I start up Emacs about
> Org mode files that can’t be loaded. I wouldn’t be surprised if the
> cause is this renaming. But honestly I stopped having time to hack
> emacs 30 years ago. Wouldn’t it be desirable if changes that aren’t
> backward-compatible included some kind of assistance for users? 
>

You probably don't want to hear this, but you will have to figure out
what those messages are telling you and fix the problems. At best,
they might be innocuous: your init file might be trying to load things
that don't exist any more. At worst, you may be running a mixed
installation: you might be loading things from various versions of Org
mode that might coexist on your system(s) (depending on how exactly
you install Org mode: if you use the version that is bundled with
emacs *only* you should not have any problems; but if you install a
more recent one from ELPA or from git, you should be careful). If you
encounter problems after the initial load, you might have a mixed
installation. See https://orgmode.org/worg/org-faq.html#mixed-install for more
details on how to check. Mixed installations are an unending source of
problems and need to be taken care of.

I install new versions of emacs and Org mode fairly frequently (every
couple of months) at which point I restart emacs to see whether any
such problems crop up. If there are, I fix them right then and there,
until I can get a clean restart. If it's not obvious, I take a look
through the etc/ORG-NEWS file, which you should have locally, but in a
pinch you can look for it online:

https://code.orgmode.org/bzg/org-mode/src/master/etc/ORG-NEWS

In particular, this is the best place for assistance with backward
incompatibilities that you mentioned above. Assuming you know which
release you came from and which release you are going to, look through
the sections describing them and all intermediate releases, to see
what backward incompatibilites were introduced and what suggested
solutions there are. As a last resort, you can always ask here. In
general, I find that fixing these problems asap is better for my
sanity.

Cleaning up your init file to get rid of the (now) useless loads is
also a good idea (even though they are innocuous): init files tend to
accumulate junk (mine has been doing that for 30 years), so getting
rid of old cruft is, for me, another essential activity to maintain a
semblance of sanity.

My $0.02, YMMV, etc.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Problems while trying to load feature

2021-03-15 Thread Nick Dokos
The renaming was e.g org-bbdb to ol-bbdb, *NOT* to ol-org-bbdb.

Similarly for all the rest: you won't find any of them in any installation.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: org to beamer structure not working

2021-03-15 Thread Nick Dokos
Luca Ferrari  writes:

> On Mon, Mar 8, 2021 at 4:29 PM Eric S Fraga  wrote:
>>
>> How are you actually exporting?  Are you choosing a beamer export option
>> as it looks like article LaTeX output.  Your settings look fine
>> otherwise.
>
> Shame on me! I was exporting it as latex-pdf file (C-c C-e l p)
> instead of beamer (C-c C-e l P).
>

You are not the first (nor are you going to be the last) to do that - I speak 
from experience ;-)

> Sorry for the noise.
>
> Luca
>
>

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Bug: linking to <> requests tags table [9.4.4 ( @ /home/arne/.guix-profile/share/emacs/site-lisp/)]

2021-02-17 Thread Nick Dokos
"Dr. Arne Babenhauserheide"  writes:

>
> Following the manual at Hyperlinks Node: Internal Links
>
>  1. one item
>  2. <>another item
>  Here we refer to item [[target]].
>
> And then using C-c C-o on [[target]] I get the prompt in the minibuffer
> “Visit tags table (default TAGS)” instead of jumping to <>.
>

Does it happen with `emacs -q`? If not, your init file is at fault.
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Where has the manual on one html page gone?

2021-02-15 Thread Nick Dokos
Christine Köhn  writes:

> Hi,
>
> I always used the manual online as one html page but it does not seem to
> be available since (?) the website revamp. I prefer the manual as one
> page for many reasons. Is it still available online?
>

I've always used the one-page per section version on the web (although
I tend to use Info much more often), primarily because I thought that
downloading the whole manual to just look at a section or two or five
would be inefficient - in fact, I've wondered why the single-page
versions of various manuals (particularly the larger ones: emacs and
elisp) are made available. So it is idle curiosity on my part, but
what are the the reasons for your preference?

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Get =#+RESULTS= without re-evaluating source code block?

2021-02-02 Thread Nick Dokos
John Kitchin  writes:

> I discovered that it matters a lot which block you cache. You have to
> cache the long running block. I had put cache on the block with noweb
> expansion, and then the long running block still runs every time. That
> was a surprise to me, since nothing was changing in that block, so I
> thought it would just use the cached result.
>

Just to elaborate a bit: Org mode checks whether to reevaluate a cached block
by checksumming it and seeing if the sum is different from before. That's why
you have to mark the actual block for caching, not its callers.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [Bug] org-version returns empty string when called uninteractively [9.4]

2021-01-26 Thread Nick Dokos
Jean-Léon HENRY  writes:

> Hi,
>
> I just upgraded org to 9.4.4 and org-version is returning an empty string 
> when called
> unineractively. More precisely
>
> I started emacs with : emacs -Q -l minimal-org.el
> Contents of minimal-org.el :
>
> ;
> ;;; Minimal setup to load latest `org-mode'.
>
> ;; Activate debugging.
> (setq debug-on-error t
>   debug-on-signal nil
>   debug-on-quit nil)
>
> ;; Add latest Org mode to load path.
> (add-to-list 'load-path (expand-file-name 
> "/home/me/.emacs.d/elpa/org-9.4.4/"))
> 
>
> Then did :
> M-x org-version
>
> Result :
> "Org mode version  ( @ /home/me/.emacs.d/elpa/org-9.4.4/)"
>
> But when evaluated non-interactively :
> (org-version)
>
> Results :
> ""
>
> In my regular set-up, this breaks version checks used in other packages : 
> (version<
> (org-version) "9.0") for example is called. This gives you the following 
> backtrace :
> Debugger entered--Lisp error: (error "Invalid version syntax: ‘’ (must start 
> with a number)
> ")
>   signal(error ("Invalid version syntax: ‘’ (must start with a number)"))
>   error("Invalid version syntax: `%s' (must start with a number)" "")
>   version-to-list("")
>   version<("" "9.0")
> [...]
>
> Thanks for your help
>

It does not do that for me:

   (org-version)
   "9.4.4"

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Inserting LaTex expressions using a filter fails

2021-01-05 Thread Nick Dokos
Mart van de Wege  writes:

> I'm trying to replace U+00BD in an org buffer with \sfrac{1}{2} during
> export to LaTex, and obviously I'm doing something wrong, or I don't
> understand the documentation.
>
> I use the following code to set up the filter:
>
> #+BIND: org-export-filter-item-functions (latex-replace-half)
> #+BEGIN_SRC emacs-lisp :exports results :results none
>
>   (defun latex-replace-half (text backend info)
> (when (org-export-derived-backend-p backend 'latex)
>   (replace-regexp-in-string  "½" "\\sfrac{1}{2}" text)))
> #+END_SRC
>

Try

(replace-regexp-in-string  "½" "sfrac{1}{2}" text)))


> Down the line in the document there is this example line:
>
>- 1½ eetl. gehakte peterselie, ½ eetl. azijn, 4 eetl. olie
>
> Or this one:
>
>Laat de gewassen en gebroken vermicelli met de foelie ½ uur in de
>
> But neither of them get replaced. I tried plain-text, item, and
> final-output filters.
>

"item" will only deal with the first one: an item in a list. You'll need
to use "final-output" probably.

> What am I missing?
>
> Mart

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Bug: org-element does not recognize table.el tables [9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)]

2021-01-04 Thread Nick Dokos
Nicolas Goaziou  writes:

> Hello,
>
> Nick Dokos  writes:
>
> [...]
>
>> Evaluating `(org-element-at-point)' returns `(paragraph ...)' all along
>> the top line and `(table ( :type org ))' when the cursor is at
>> the beginning of the `a b c' line.
>
> Fixed. Thank you.
>

Thank you!

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Bug: org-element does not recognize table.el tables [9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)]

2020-12-22 Thread Nick Dokos
Bastien  writes:

> Hi Nick,
>
> Nick Dokos  writes:
>
>> Consider an Org mode file with a table.el table (which I made by
>> first constructing an Org mode table and then usind `C-c ~' to
>> convert it):
>
> Would it be so bad if org-mode decides to stop supporting table.el tables? 
>
> I don't see the benefit of supporting both Org tables and tables.el tables,
> and it calls for confusion.
>
> What do you and everyone else think?

I don't use table.el tables. The only reason I submitted the bug
report was because I was trying to investigate this Emacs SE question:

   
https://emacs.stackexchange.com/questions/62335/org-mode-export-table-to-latex-with-word-wrap

In the process, I discovered that the LaTeX file was broken and traced
it back to org-element. Note that the manual says:

"Org mode recognizes such tables and exports them properly."

See

   (info "(org) Cooperation") 

So there are three roads ahead as I see it:

- Fix the bug in org-element and make sure that table.el tables are
  exported properly.

- Do not fix the bug. Instead, tear out table.el support from Org mode
  code and fix the manual to say so.

- Do not fix the bug (and do nothing else).

I presume the third choice is distasteful to everybody, but that's
going to be the default choice unless somebody volunteers to do either
of the other two.

Either of the first two choices requires work. From my POV, it does
not matter which of the two is done: if somebody volunteers to do
either, I am not going to object (and I suspect, almost nobody else
will either: if the second course is chosen, there may be some table.el
users who would object to losing it, but if so, they should volunteer
to fix the bug).

My 0.02 kopek.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Bug: org-element does not recognize table.el tables [9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)]

2020-12-21 Thread Nick Dokos
Hi Bastien,

Bastien  writes:

> Would it be so bad if org-mode decides to stop supporting table.el tables? 
>

I don't use table.el tables so it's easy for me to say "Get rid of them" - but
there may be objections :-)

> I don't see the benefit of supporting both Org tables and tables.el tables,
> and it calls for confusion.
>
> What do you and everyone else think?

They do exist in a sort of twilight zone: not many people use them
AFAICT, but there is ostensible support and the manual says "Org mode
recognizes such tables and exports them properly", but the bug I sent
shows that that's not correct.

So: fix this bug now that it's been pointed out? Close it as "Will not
fix" with some guidance on what the user is supposed to do ("don't use
table.el tables" is probably the best advice)? Or decide to jettison
table.el support altogether? The first and the last involve real work,
the middle one not, but it's not particularly tasty.

Somebody else will have to make the decision: I'm fine with either of
the exreme ways, not so much with the middle option, but since I'm not
going to do the work, I am in no position to insist.

BTW, I ran into this while looking into this Emacs SE question:

https://emacs.stackexchange.com/questions/62335/org-mode-export-table-to-latex-with-word-wrap

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Selecting a date to show on the agenda with time grids

2020-12-21 Thread Nick Dokos
Christopher Dimech  writes:

> Dear Compeers,
>
> I able to run the command
>
> (org-agenda-list nil (org-read-date))
>
> to select the date and get the week for the agenda.
>
> But I would like the grid marks for the selected date to show up
> together with the list of appointments in the time slots.
>

No idea what you mean, but does `v d' on that day do what you want?
AFAIK, the grid is shown in the weekly/monthly agenda only for the
current date.  But as I said I don't really know what you mean, so I
may be misunderstanding you.  If so, please elaborate.

> Would be very grateful if somebody can help me further with this.
>
> Regards
> Christopher
>
>
>
>

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Bug: org-element does not recognize table.el tables [9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)]

2020-12-17 Thread Nick Dokos


Consider an Org mode file with a table.el table (which I made by
first constructing an Org mode table and then usind `C-c ~' to convert it):


--8<---cut here---start->8---
* table.el table


  ++++
  |  a |  b |  c |
  ++++
  |  1 |  2 |  3 |
  ++++
  |  4 |  5 |  6 |
  ++++
  |  7 |  8 |  9 |
  ++++
  | 10 | 11 | 12 |
  ++++
--8<---cut here---end--->8---

Trying to export to LaTeX produces pretty mangled output.

It turns out that when in
 `org-latex-table', (org-element-property :type table) returns `org', so
 it thinks it's an Org mode table and calls `org-latex--org-table' to
 process it, producing output like this:

--8<---cut here---start->8---
\sout{}\sout{}
\begin{center}
\begin{tabular}{lll}
a & b & c\\
\end{tabular}
\end{center}
\sout{}\sout{}
\begin{center}
\begin{tabular}{rrr}
1 & 2 & 3\\
\end{tabular}
\end{center}
\sout{}\sout{}

...

\begin{center}
\begin{tabular}{rrr}
10 & 11 & 12\\
\end{tabular}
\end{center}
\sout{}\sout{}
--8<---cut here---end--->8---


Evaluating `(org-element-at-point)' returns `(paragraph ...)' all along
the top line and `(table ( :type org ))' when the cursor is at
the beginning of the `a b c' line.


Emacs  : GNU Emacs 28.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.13, 
cairo version 1.16.0)
 of 2020-10-30
Package: Org mode version 9.4 (release_9.4-53-g23f941 @ 
/home/nick/elisp/org-mode/lisp/)

-- 
Nick





Re: [PATCH] Fix ODT output for scheduled items.

2020-11-28 Thread Nick Dokos
Same patch but fixes the typo in the Changelog:

>From 7dc4877469c5bed7580ff80e9534480e16972b93 Mon Sep 17 00:00:00 2001
From: Nick Dokos 
Date: Sat, 28 Nov 2020 10:01:02 -0500
Subject: [PATCH] org-odt-planning: Fix scheduled item output

* lisp/ox-odt.el (org-odt-planning): Use org-scheduled-string, not
  org-deadline-string, for scheduled items.

See <https://emacs.stackexchange.com/questions/61985/org-export-to-odt-incorrectly-use-deadline-for-scheduled> for an ECM.
---
 lisp/ox-odt.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index 4619f9fcd..ef07acfed 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -2946,7 +2946,7 @@ channel."
 	 (when scheduled
 	   (concat
 		(format "%s"
-			"OrgScheduledKeyword" org-deadline-string)
+			"OrgScheduledKeyword" org-scheduled-string)
 		(org-odt-timestamp scheduled contents info)))
 
 
-- 
2.25.4


-- 
Nick




[PATCH] Fix ODT output for scheduled items.

2020-11-28 Thread Nick Dokos
The ODT exporter uses the org-deadline-string for scheduled items. This
apparently predates the introduction of the "new" exporter in 2013 -
time flies...

It was reported on Emacs SE:

 
https://emacs.stackexchange.com/questions/61985/org-export-to-odt-incorrectly-use-deadline-for-scheduled

Patch attached.

>From 429d3eb816d0673326969f50b478f4d622147432 Mon Sep 17 00:00:00 2001
From: Nick Dokos 
Date: Sat, 28 Nov 2020 10:01:02 -0500
Subject: [PATCH] org-odt-planning: Fix scheduled item output

* lis/ox-odt.el (org-odt-planning): Use org-scheduled-string, not
  org-deadline-string, for scheduled items.

See <https://emacs.stackexchange.com/questions/61985/org-export-to-odt-incorrectly-use-deadline-for-scheduled> for an ECM.
---
 lisp/ox-odt.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index 4619f9fcd..ef07acfed 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -2946,7 +2946,7 @@ channel."
 	 (when scheduled
 	   (concat
 		(format "%s"
-			"OrgScheduledKeyword" org-deadline-string)
+			"OrgScheduledKeyword" org-scheduled-string)
 		(org-odt-timestamp scheduled contents info)))
 
 
-- 
2.25.4


-- 
Nick




Re: add linked files to agenda files

2020-11-16 Thread Nick Dokos
Alan Schmitt  writes:

> Hello,
>
> I'm experimenting with a setup where each project is its own org file,
> and where I have a master file linking to active projects. How can I
> configure org to add every linked file of that master file to the
> org-agenda-files?
>

You'll probably have to write a custom function to do that, but it
depends on how exactly your master file is set-up, so providing some
details on that would help.

Just guessing at this point, I would imagine you'd want something like
this:

--8<---cut here---start->8---
(defun path-from-link (link)
   (org-element-property :path link))

(setq org-agenda-files (with-current-buffer
 (find-file-noselect "master.org")
 (org-element-map (org-element-parse-buffer)
  '(link)
  #'path-from-link)))
--8<---cut here---end--->8---

but the details might make a difference.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: New website - back to the old unicorn!

2020-10-26 Thread Nick Dokos
Sounds good to me.

And thanks for all the work to update the site!
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: New website - back to the old unicorn!

2020-10-26 Thread Nick Dokos
One thing that I have done in the past (and I'm probably not the onlye
one) on the Emacs SE is refer people to the mailing list through the
old link: https://orgmode.ord/community.html which does not exist any
more, so we have a whole lot of broken links on Emacs SE at the moment:
can something be done to restore the functionality of those links?

Thanks!
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: recursive checkbox counting

2020-10-02 Thread Nick Dokos
Alan Schmitt  writes:

> On 2020-10-01 14:24, torys.ander...@gmail.com (Tory S. Anderson) writes:
>
>> The way I've made this work is with the following property:
>>
>>:COOKIE_DATA: ALL
>>
>> But I suppose I haven't tried if that's fully recursive.
>
> Thank you for the suggestion. I gave it a try, and unfortunately it does
> not work.
>

Not sure whether this will work (or whether it will help in your case):

   
https://emacs.stackexchange.com/questions/60710/is-there-any-way-of-getting-overview-statistics-for-all-checkboxes-in-a-given-or/60747#60747

There are some links to other questions on Emacs SE that might (or
might not) be helpful.

> Best,
>
> Alan
>

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Bug: Infinite loop caused by org-agenda-property-list [9.4 (9.4-elpa @ /home/dsmasterson/.emacs.d/elpa/org-9.4/)]

2020-09-25 Thread Nick Dokos
David Masterson  writes:

> Nick Dokos  writes:
>
>> From what I can gather, this does not have much to do with Org mode
>> proper, which has no org-agenda-property-list at all. I presume that
>> you have
>>
>> https://github.com/Malabarba/org-agenda-property/blob/master/org-agenda-property.el
>>
>> installed, which does provide such a variable, but all that one can
>> say atm is that that library has a bug *or* is incompatible with
>> (current?) Org mode.  In either case, I think you should report it as
>> an issue to the above site.  Once they have figured out what is wrong,
>> then maybe an RFE against Org mode *might* be indicated.
>
> Ah!  That makes sense.  I'll look into it.
>

You might be able to work around the problem by having org-agenda-property put 
the
property on the same line:

   (setq org-agenda-property-position 'same-line)

and adjusting the position on the line with

   (setq org-agenda-property-column 100)

if necessary.

If the infinite loop goes away in that case, then you have some confirmation of 
your
theory about two-line agenda entries.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: org-tempo question

2020-09-24 Thread Nick Dokos
I can't say anything about indentation (I encounter problems that I
have not reported because of lack of time to investigate combined with
laziness - but I suspect they are, partly at least, of my own making).

But when I do `8---
#+NAME: third
#+begin_src org

- an item
  - subitem

  ,#+begin_example

  ,#+end_example

#+end_src

#+begin_example

#+end_example


--8<---cut here---end--->8---

The commas are important: are you not getting them?

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: The Website Revamp: The final stretch

2020-09-24 Thread Nick Dokos


"collapsable" should be "collapsible".

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: The Website Revamp: The final stretch

2020-09-24 Thread Nick Dokos
Nix on variant C from me.

Slight lean towards B, but I personally would be happy with either A or B.

Thanks!
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Bug: Infinite loop caused by org-agenda-property-list [9.4 (9.4-elpa @ /home/dsmasterson/.emacs.d/elpa/org-9.4/)]

2020-09-23 Thread Nick Dokos
>From what I can gather, this does not have much to do with Org mode
proper, which has no org-agenda-property-list at all. I presume that
you have

https://github.com/Malabarba/org-agenda-property/blob/master/org-agenda-property.el

installed, which does provide such a variable, but all that one can
say atm is that that library has a bug *or* is incompatible with
(current?) Org mode.  In either case, I think you should report it as
an issue to the above site.  Once they have figured out what is wrong,
then maybe an RFE against Org mode *might* be indicated.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: org-tables with monetary amounts

2020-09-23 Thread Nick Dokos
For fixed precision, you can either use an explicit format as Russell Adams 
points out,
or you can modify (globally or per file) the variable org-calc-default-modes. 
That's a
complicated variable and you only need to change one part of it for this:

(plist-put org-calc-default-modes 'calc-float-format '(fix 2))

See e.g. https://emacs.stackexchange.com/a/59181/14825 for some discussion.
-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Infinite recursion ?

2020-09-22 Thread Nick Dokos
Nick Dokos  writes:

> What's the error message? Did you try setting `debug-on-eror'? Does that give
> a more useful backtrace?

Backtrace: no variable named `debug-on-eror' - maybe you made an eror :-)

Sigh - should be `debug-on-error'.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Infinite recursion ?

2020-09-22 Thread Nick Dokos
David Masterson  writes:

> Haven't figured this out yet, but I seem to be hitting an "infinite
> recursion" bug that eventually dies when it runs out of memory.
>
> The scenario (so far) is trying to change an Org tag in the agenda
> (':'). The command gives me the tags that I then edit and save whereupon
> it sits in an infinite recursion until it hits a limit in Emacs. If I
> quit, the files seem to have been updated, but the Agenda isn't.  I'm
> still trying to figure out how to debug this.  Setting debug-on-quit was
> not consistent and didn't seem to have a large list of function calls
> (ie. the recursion).  Any ideas?
>
> This is Emacs 26.3 with Orgmode 9.4.  I'm also using Org-Super-Agenda
> from Melpa (20200310.1337).
>
> Side question that might be related: org-agenda started positioning
> itself at the end of the agenda rather than the beginning after building
> the agenda.  I don't think I changed something for this.  What could
> cause this?

What's the error message? Did you try setting `debug-on-eror'? Does that give
a more useful backtrace?

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: creating png images in emails with org-mode

2020-09-18 Thread Nick Dokos
Eric S Fraga  writes:

> On Thursday, 17 Sep 2020 at 00:57, Nick Dokos wrote:
>> Apparently, recent versions of ImageMagick (version 7 seems to be one)
>> on (perhaps) some distros ship with a
>> /etc/ImageMagick-/policy.xml file that imposes restrictions
>> on what can be done. Here's an SE question with some information:
>
> Thank you.  Interesting.
>
> For the OP, it might be worth noting that the solution on the
> StackExchange page you linked to refers to the generation of PDF files
> from the LaTeX snippet; I would imagine that the fix noted will need to
> be adjusted for PNG files but cannot verify as I'm still on ImageMagick
> version 6 and don't have these issues.

Actually, it refers to the generation of PNG files from PDF files using
`convert' (I think). The `imagemagick' process of LaTeX preview uses
`pdflatex'to go from TeX to PDF and `convert' to go from PDF to PNG.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: creating png images in emails with org-mode

2020-09-16 Thread Nick Dokos
Joseph Vidal-Rosset  writes:

> Hello,
>
> One more time, my setup to create png image via LaTeX in email in org-mode is 
> broken.
>
> I get this error message:
>
> Creating LaTeX preview...
> org-compile-file: File "/tmp/orgtex2wp50c.png" wasn’t produced.  Please 
> adjust ‘imagemagick’ part of ‘org-preview-latex-process-alist’.
>
> Your help is welcome, because I do not understand what I have to do, how I 
> have to "adjust" imagemagick.
>
> Best wishes,
>
> Jo.
>

Apparently, recent versions of ImageMagick (version 7 seems to be one)
on (perhaps) some distros ship with a
/etc/ImageMagick-/policy.xml file that imposes restrictions
on what can be done. Here's an SE question with some information:


https://emacs.stackexchange.com/questions/31408/error-message-when-previewing-latex-snippet-in-org-file

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: basic org questions

2020-09-16 Thread Nick Dokos
Emanuel Berg via "General discussions about Org-mode."  
writes:

> Matt Huszagh wrote:
>
>> Were you referring to the tables being centered
>> after export (I see from another part of this chain
>> that that's what you were referring to in the 3rd
>> question) when you wanted them left-aligned?
>> If that is the case, it would really help if you
>> specify that in your original question.
>> Appearance in an org-mode buffer and appearance in
>> the PDF, HTML, etc. after export are very different
>> things with very different configuration.
>
> Yes, after export to PDF, they are centered. they =
> the whole table items.

(setq org-latex-tables-centered nil)

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




#+ATTR_HTML examples uses old syntax

2020-09-12 Thread Nick Dokos
The attached patch fixes an example in the "Tables in HTML export"
section of the manual that uses the old `border="3"' syntax instead
of `:border 3' etc.

>From 52be0b5b1fe492b3ff44e6ccd6dbfaed1eb88537 Mon Sep 17 00:00:00 2001
From: Nick Dokos 
Date: Sat, 12 Sep 2020 17:47:29 -0400
Subject: [PATCH] Fix syntax of #+ATTR_HTML

The example in the "Tables in HTML export" section of the manual
uses the old syntax: `border="2"' etc.

Change it to use `:border 2' etc.
---
 doc/org-manual.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 46498bd22..be60d99f6 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -12817,7 +12817,7 @@ following lines before the table in the Org file:
 #+cindex: @samp{ATTR_HTML}, keyword
 #+begin_example
 ,#+CAPTION: This is a table with lines around and between cells
-,#+ATTR_HTML: border="2" rules="all" frame="border"
+,#+ATTR_HTML: :border 2 :rules all :frame border
 #+end_example
 
 The HTML export back-end preserves column groupings in Org tables (see
-- 
2.25.4


-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler


Re: latex fragments compilation error when exporting to html

2020-08-31 Thread Nick Dokos
Jeremie Juste  writes:

> Hello 
>
> When I export test.org to html, the latex fragment fail to compile. 
> The reason is a star get added to the tabular environment. {tabular*}
> (see tmpfile.tex). 
>
> I don't know why the function insists in using the tabular* environment.
>
> From this point I would have two questions:
>
> How can I remove the star from the tabular environment ?
> How can I can I find the culprit?
> - I was hoping to provide a patch by finding the culprit but I got lost.
>   - I tried to debug-on-entry org-format-latex.
>   
>
> Best regards,
> Jeremie
>
>> test.org 
>
> #+OPTIONS:   H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t 
> tex:imagemagick title:nil author:nil date:nil
> #+LATEX_HEADER: \usepackage{booktabs}
>
>  \begin{tabular}{lll}
>  \toprule
>   1 & 2 & 3 \\
>   5 & 6 & 8 \\
>  \bottomrule
>  \end{tabular}
>   
>> tmpfile.tex
>
> ...
>
> {\color{fg}
> \begin{tabular*}{lll}
> \toprule
>  1 & 2 & 3 \\
>  5 & 6 & 8 \\
> \hline
> \end{tabular*}
> %
> }
>
>

I cannot reproduce it with Org mode version 9.3.7 (release_9.3.7-705-gea9463 @ 
/home/nick/src/emacs/org/org-mode/lisp/).
What version are you using?

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: convert a org table to plain text

2020-08-26 Thread Nick Dokos
Uwe Brauer  writes:

>> Uwe Brauer  writes:
>
>> Does this:
>
>> 
>> https://stackoverflow.com/questions/17717483/howto-convert-org-mode-table-to-original-tabbed-format/17726489#17726489
>
>
> Yes, very much so. It would be great to have that code included in
> orgmode. Did anybody try to contact the author?
>

You mean orgtbl-to-tsv and related? All of that *is* part of Org mode. All you 
have to do is write a code block calling it
to convert.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: convert a org table to plain text

2020-08-25 Thread Nick Dokos
Uwe Brauer  writes:

> Hi 
>
> What is the inverse function to 
> org-table-convert-region?
>
> I am unable to find anything in the documentation or google.
>
> Regards
>
> We Brauer 
>
>
>

Does this:


https://stackoverflow.com/questions/17717483/howto-convert-org-mode-table-to-original-tabbed-format/17726489#17726489

help?

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [BUG] babel runs bash instead of zsh when sessions are used

2020-08-24 Thread Nick Dokos
Kyle Meyer  writes:

> Rudi C writes:
>
>> #+BEGIN_SRC zsh :session z1
>> echo $HOME $0
>> #+END_SRC
>>
>> #+RESULTS:
>> : /Users/evar /bin/bash
>
> What version of Org are you using?
>
> I tried with both the latest release (9.3.7) and the current master
> branch (220f2b0d9), using default configuration aside from
>
> (org-babel-do-load-languages
>  'org-babel-load-languages
>  '((shell . t)))
>
> I see "/usr/bin/zsh" in both cases.
>
>

I was able to reproduce it (with ksh, rather than zsh) on Org mode version 
9.3.7 (release_9.3.7-705-gea9463 @ /home/nick/elisp/org-mode/lisp/).

--8<---cut here---start->8---
#+BEGIN_SRC ksh :session z1
echo $HOME $0 $(which $0)
#+END_SRC

#+RESULTS:
: /home/nick /bin/bash /bin/bash

#+BEGIN_SRC ksh
echo $HOME $0 $(which $0)
#+END_SRC

#+RESULTS:
: /home/nick ksh /usr/bin/ksh

--8<---cut here---end--->8---

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: configure separator in org-table-insert-hline

2020-08-24 Thread Nick Dokos
Vladimir Alexiev  writes:

> How can I use radio tables for that?
>

By writing a translation function, similar to 
orgtbl-to-{csv,latex,html,texinfon,unicode,orgtbl}.
See

  (info "(org) Tables in Arbitrary Syntax")

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Bug: :results raw replace header args for a code block don't replace [9.3.7 (9.3.7-18-g093b47-elpaplus @ /Users/skoshelev/.emacs.d/elpa/26.2/develop/org-plus-contrib-20200810/)]

2020-08-21 Thread Nick Dokos
TEC  writes:

> Julius Dittmar  writes:  
>> as far as I know this is no bug. Reason: How could org tell where
>> the old results end? There's no end marker. Thus instead of removing
>> everything that follows, it refrains from removing anything. 
>
> This is my understanding. It's also why I tend to use
>
> :results raw drawer
>

You mean `:results drawer'? There is no reason to include `raw'.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Bug: inserting capture template [9.3.7 (release_9.3.7-705-gea9463 @ /home/nick/elisp/org-mode/lisp/)]

2020-08-04 Thread Nick Dokos

This was reported in 
https://emacs.stackexchange.com/questions/59928/org-capture-at-point-as-sibling-of-heading

I was able to reproduce it starting from emacs -q with the following ECM:

   emacs -q -l min.el foo.org

where min.el  looks like this (adjust load-path to taste):
--8<---cut here---start->8---

(add-to-list 'load-path "~/src/org-mode/org-mode/lisp")

(require 'org-loaddefs)

(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))

(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-ca" 'org-agenda)


(setq org-capture-templates
  '(("a" "Appointment or call" entry (file+headline "~/todo.org" "Tasks")
 "* APPT %?\n %u")))
--8<---cut here---end--->8---

and foo.org looks like this (| is the position of the cursor):


--8<---cut here---start->8---
* foo

** one

*** two

 three
|
 four
--8<---cut here---end--->8---

In current Org mode, doing `C-0 M-x org-capture RET a' (where "a"
gets me an APPT template - see below), I get:
--8<---cut here---start->8---
* foo
** one

*** two

 three
* APPT 
  [2020-08-04 Tue 12:58]
 four
--8<---cut here---end--->8---

with the template at top level.

In 9.2, the same operation inserted a template as a sibling of the headline:

--8<---cut here---start->8---
* foo
** one
   
*** two

 three
 APPT 
 [2020-08-04 Tue 12:58]
 four
--8<---cut here---end--->8---

The current behavior looks like a bug to me, so I bisected it to the following 
commit:

--8<---cut here---start->8---
0201d1c0cc367fea0e561ba113f02f263b0ed501 is the first bad commit
commit 0201d1c0cc367fea0e561ba113f02f263b0ed501
Author: Nicolas Goaziou 
Date:   Sat Jul 6 15:59:12 2019 +0200

Fix inserting capture templates at point

* lisp/org-capture.el (org-capture):
(org-capture-set-target-location):
(org-capture-place-entry):
(org-capture-place-item):
(org-capture-place-table-line): Fix inserting capture templates at
point.  Insert a new internal property for capture
template: :insert-here.
(org-capture-insert-template-here): Remove function.

* testing/lisp/test-org-capture.el (test-org-caputre/entry):
(test-org-capture/item):
(test-org-capture/table-line): Add tests.

Reported-by: Dominic Surano 


 etc/ORG-NEWS |   4 +-
 lisp/org-capture.el  | 126 +++
 testing/lisp/test-org-capture.el |  58 +-
 3 files changed, 104 insertions(+), 84 deletions(-)
--8<---cut here---end--->8---

HTH


---

Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32, 
cairo version 1.16.0)
 of 2020-06-15
Package: Org mode version 9.3.7 (release_9.3.7-705-gea9463 @ 
/home/nick/elisp/org-mode/lisp/)

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




  1   2   3   4   5   6   7   8   9   10   >