Re: Bug: "before first headline" error when adding clock out note [9.4.6 (9.4.6-dist @ /home/wenlong/org-9.4.6/lisp/)]

2021-06-27 Thread Dave D
Thank you so much for the quick fix.

On 28/06/2021, Nicolas Goaziou  wrote:
> Hello,
>
> Dave D  writes:
>
>> It seems the error is caused by function
>> org-clock-remove-empty-clock-drawer called by org-clock-out-hook
>>
>> I have removed that function from the hook for now as a workaround.
>
> I pushed a fix in master.
>
> Thank you.
>
> Regards,
> --
> Nicolas Goaziou
>



Re: Export Org mode files to (gag, barf) MS Office?

2021-06-27 Thread Brandon Taylor
Actually, I've decided to go with your earlier recommendation of using WSL now 
that it supports GUI apps like Emacs. Doing the export act gives me a very 
elegant (albeit somewhat crowded) ODT file, like this -- 
https://www.dropbox.com/s/16dhity67rtdwyp/belvoire.odt?dl=0 
(https://link.getmailspring.com/link/fd55da87-8b2d-4d8a-a92f-fa98bafdb...@getmailspring.com/0?redirect=https%3A%2F%2Fwww.dropbox.com%2Fs%2F16dhity67rtdwyp%2Fbelvoire.odt%3Fdl%3D0=ZW1hY3Mtb3JnbW9kZUBnbnUub3Jn)

Sent from Mailspring 
(https://link.getmailspring.com/link/fd55da87-8b2d-4d8a-a92f-fa98bafdb...@getmailspring.com/1?redirect=https%3A%2F%2Fgetmailspring.com%2F=ZW1hY3Mtb3JnbW9kZUBnbnUub3Jn),
 the best free email app for work
On Jun 27 2021, at 5:38 pm, Tim Cross  wrote:
>
> That error would tend to indicate there is a problem with the way the
> file uri is being encoded. This could either be a bug or it could be due
> to an error in your configuration or possibly the original org file your
> trying to encode. Unfortunately, in that backtrace output, I cannot see
> the full uri. I would start by looking at the full uri and seeing if you
> can spot what is wrong with the encoding and identify where that uri is
> coming from (i.e. your config, a link in the org file your trying to
> export etc).
>
> Here is what I would do -
> - Create a minimal basic org file which generates the error when you try
> to export to odt
>
> - Post that minimal org file, together with details on your Emacs
> version, org-mode version to the list. You might be lucky and someone
> else on Windows will be able to use your test org file to see if they
> get the same error when exporting to odt. Maybe someone not on windows
> can also try exporting it to verify it is not a platform independent
> bug. See M-x org-submit-bug-report for a straight-forward way to
> generate the email.
>
> - Try running emacs -Q and then adding a minimal config to get org odt
> export to work and verify you still get the error. This may help
> identify bad local config, bad org installation/update or issue with org
> version you have.
>
> The objective here is to provide all the information necessary for
> someone else to try and reproduce your issue. This will help in
> determining whether you have a real org or emacs bug, a local
> setup/config error or a problem in your org file.
>
> BTW it probably would be worth running org-lint on the org file your
> trying to export, just to verify it has good org syntax etc.
>
> Brandon Taylor  writes:
> > Here's the generated backtrace after doing M-x toggle-debug-on-error and 
> > then trying to do export on Windows.
> >
> > Debugger entered--Lisp error: (rng-uri-error "Bad escapes in URI 
> > ‘file:///c:/Program%20Files/Ema...")
> > signal(rng-uri-error ("Bad escapes in URI 
> > ‘file:///c:/Program%20Files/Ema..."))
> > rng-uri-error("Bad escapes in URI `%s'" 
> > "file:///c:/Program%20Files/Emacs/x86_64/share/emac...")
> > rng-uri-file-name-1("file:///c:/Program%20Files/Emacs/x86_64/share/emac..." 
> > nil)
> > rng-uri-file-name("file:///c:/Program%20Files/Emacs/x86_64/share/emac...")
> > rng-locate-schema-file()
> > rng-auto-set-schema(t)
> > rng-validate-mode(1)
> > rng-nxml-mode-init()
> > xml-mode()
> > set-auto-mode-0(xml-mode nil)
> > set-auto-mode()
> > normal-mode(t)
> > after-find-file(nil nil)
> > find-file-noselect-1(# 
> > "c:/Users/donni/AppData/Local/Temp/odt-s6F4yN/style..." t nil
> > "c:/Users/donni/AppData/Local/Temp/odt-s6F4yN/style..." (6755399441121385 
> > 3391104951))
> > find-file-noselect("c:/Users/donni/AppData/Local/Temp/odt-s6F4yN/style..." 
> > t)
> > org-odt-template(#("\n\n > (headline ... ...)) 304 509 (:parent (paragraph ... ...)) 704 714 (:parent
> > (headline ... ...)) 815 987 (:parent (paragraph ... ...)) 995 1044 (:parent 
> > (paragraph ... ...)) 1052 1083 (:parent (paragraph ... ...)) 1278 1289 
> > (:parent
> > (headline ... ...)) 1390 1489 (:parent (paragraph ... ...)) ...) 
> > (:export-options nil :back-end #s(org-export-backend :name odt :parent nil 
> > :transcoders
> > (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 
> > ... ... ... ... ... ... ... ... ...) :options (... ... ... ... ... ... ... 
> > ... ... ... ... ... ... ... ... ... ...) :filters (...) :blocks nil
> > :menu (111 "Export to ODT" ...)) :translate-alist ((bold . org-odt-bold) 
> > (center-block . org-odt-center-block) (clock . org-odt-clock) (code .
> > org-odt-code) (drawer . org-odt-drawer) (dynamic-block . 
> > org-odt-dynamic-block) (entity . org-odt-entity) (example-block . 
> > org-odt-example-block)
> > (export-block . org-odt-export-block) (export-snippet . 
> > org-odt-export-snippet) (fixed-width . org-odt-fixed-width) 
> > (footnote-definition .
> > org-odt-footnote-definition) (footnote-reference . 
> > org-odt-footnote-reference) (headline . org-odt-headline) (horizontal-rule 
> > . org-odt-horizontal-rule)
> > (inline-src-block . org-odt-inline-src-block) (inlinetask . 
> > 

Re: org-agenda no longer clocks out then in

2021-06-27 Thread Dave D
this commit
https://code.orgmode.org/bzg/org-mode/commit/8e3e2f667f0b28b85845204b708c3f0aebc9152b
probably fixes the issue. Could you perhaps give it a test?



Re: Export Org mode files to (gag, barf) MS Office?

2021-06-27 Thread Tim Cross


That error would tend to indicate there is a problem with the way the
file uri is being encoded. This could either be a bug or it could be due
to an error in your configuration or possibly the original org file your
trying to encode. Unfortunately, in that backtrace output, I cannot see
the full uri. I would start by looking at the full uri and seeing if you
can spot what is wrong with the encoding and identify where that uri is
coming from (i.e. your config, a link in the org file your trying to
export etc). 

Here is what I would do -

- Create a minimal basic org file which generates the error when you try
to export to odt

- Post that minimal org file, together with details on your Emacs
version, org-mode version to the list. You might be lucky and someone
else on Windows will be able to use your test org file to see if they
get the same error when exporting to odt. Maybe someone not on windows
can also try exporting it to verify it is not a platform independent
bug. See M-x org-submit-bug-report for a straight-forward way to
generate the email.

- Try running emacs -Q and then adding a minimal config to get org odt
export to work and verify you still get the error. This may help
identify bad local config, bad org installation/update or issue with org
version you have.

The objective here is to provide all the information necessary for
someone else to try and reproduce your issue. This will help in
determining whether you have a real org or emacs bug, a local
setup/config error or a problem in your org file.

BTW it probably would be worth running org-lint on the org file your
trying to export, just to verify it has good org syntax etc.

Brandon Taylor  writes:

> Here's the generated backtrace after doing M-x toggle-debug-on-error and then 
> trying to do export on Windows.
>
> Debugger entered--Lisp error: (rng-uri-error "Bad escapes in URI 
> ‘file:///c:/Program%20Files/Ema...")
>   signal(rng-uri-error ("Bad escapes in URI 
> ‘file:///c:/Program%20Files/Ema..."))
>   rng-uri-error("Bad escapes in URI `%s'" 
> "file:///c:/Program%20Files/Emacs/x86_64/share/emac...")
>   rng-uri-file-name-1("file:///c:/Program%20Files/Emacs/x86_64/share/emac..." 
> nil)
>   rng-uri-file-name("file:///c:/Program%20Files/Emacs/x86_64/share/emac...")
>   rng-locate-schema-file()
>   rng-auto-set-schema(t)
>   rng-validate-mode(1)
>   rng-nxml-mode-init()
>   xml-mode()
>   set-auto-mode-0(xml-mode nil)
>   set-auto-mode()
>   normal-mode(t)
>   after-find-file(nil nil)
>   find-file-noselect-1(# 
> "c:/Users/donni/AppData/Local/Temp/odt-s6F4yN/style..." t nil
> "c:/Users/donni/AppData/Local/Temp/odt-s6F4yN/style..." (6755399441121385 
> 3391104951))
>   find-file-noselect("c:/Users/donni/AppData/Local/Temp/odt-s6F4yN/style..." 
> t)
>   org-odt-template(#("\n\n (headline ... ...)) 304 509 (:parent (paragraph ... ...)) 704 714 (:parent
> (headline ... ...)) 815 987 (:parent (paragraph ... ...)) 995 1044 (:parent 
> (paragraph ... ...)) 1052 1083 (:parent (paragraph ... ...)) 1278 1289 
> (:parent
> (headline ... ...)) 1390 1489 (:parent (paragraph ... ...)) ...) 
> (:export-options nil :back-end #s(org-export-backend :name odt :parent nil 
> :transcoders
> (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... 
> ... ... ... ... ... ... ... ...) :options (... ... ... ... ... ... ... ... 
> ... ... ... ... ... ... ... ... ...) :filters (...) :blocks nil
> :menu (111 "Export to ODT" ...)) :translate-alist ((bold . org-odt-bold) 
> (center-block . org-odt-center-block) (clock . org-odt-clock) (code .
> org-odt-code) (drawer . org-odt-drawer) (dynamic-block . 
> org-odt-dynamic-block) (entity . org-odt-entity) (example-block . 
> org-odt-example-block)
> (export-block . org-odt-export-block) (export-snippet . 
> org-odt-export-snippet) (fixed-width . org-odt-fixed-width) 
> (footnote-definition .
> org-odt-footnote-definition) (footnote-reference . 
> org-odt-footnote-reference) (headline . org-odt-headline) (horizontal-rule . 
> org-odt-horizontal-rule)
> (inline-src-block . org-odt-inline-src-block) (inlinetask . 
> org-odt-inlinetask) (italic . org-odt-italic) (item . org-odt-item) (keyword 
> . org-odt-keyword)
> (latex-environment . org-odt-latex-environment) (latex-fragment . 
> org-odt-latex-fragment) (line-break . org-odt-line-break) (link . 
> org-odt-link)
> (node-property . org-odt-node-property) (paragraph . org-odt-paragraph) ...) 
> :exported-data # :input-buffer
> "belvoire.org" :input-file "c:/Users/donni/OneDrive/Do..." :odt-styles-file 
> nil :description nil :keywords nil :subtitle nil :odt-content-template-file 
> nil
> :odt-display-outline-level 2 :odt-fontify-srcblocks t ...))
>   org-export-as(odt nil nil nil nil)
>   org-odt-export-to-odt(nil nil nil nil)
>   org-export-dispatch(nil)
>   funcall-interactively(org-export-dispatch nil)
>   call-interactively(org-export-dispatch nil nil)
>   command-execute(org-export-dispatch)
>
> Sent from Mailspring, the best free email app 

Re: Export Org mode files to (gag, barf) MS Office?

2021-06-27 Thread Brandon Taylor
Here's the generated backtrace after doing M-x toggle-debug-on-error and then 
trying to do export on Windows.

Debugger entered--Lisp error: (rng-uri-error "Bad escapes in URI 
‘file:///c:/Program%20Files/Ema...")
signal(rng-uri-error ("Bad escapes in URI ‘file:///c:/Program%20Files/Ema..."))
rng-uri-error("Bad escapes in URI `%s'" 
"file:///c:/Program%20Files/Emacs/x86_64/share/emac...")
rng-uri-file-name-1("file:///c:/Program%20Files/Emacs/x86_64/share/emac..." nil)
rng-uri-file-name("file:///c:/Program%20Files/Emacs/x86_64/share/emac...")
rng-locate-schema-file()
rng-auto-set-schema(t)
rng-validate-mode(1)
rng-nxml-mode-init()
xml-mode()
set-auto-mode-0(xml-mode nil)
set-auto-mode()
normal-mode(t)
after-find-file(nil nil)
find-file-noselect-1(# 
"c:/Users/donni/AppData/Local/Temp/odt-s6F4yN/style..." t nil 
"c:/Users/donni/AppData/Local/Temp/odt-s6F4yN/style..." (6755399441121385 
3391104951))
find-file-noselect("c:/Users/donni/AppData/Local/Temp/odt-s6F4yN/style..." t)
org-odt-template(#("\n\n :input-buffer "belvoire.org" :input-file 
"c:/Users/donni/OneDrive/Do..." :odt-styles-file nil :description nil :keywords 
nil :subtitle nil :odt-content-template-file nil :odt-display-outline-level 2 
:odt-fontify-srcblocks t ...))
org-export-as(odt nil nil nil nil)
org-odt-export-to-odt(nil nil nil nil)
org-export-dispatch(nil)
funcall-interactively(org-export-dispatch nil)
call-interactively(org-export-dispatch nil nil)
command-execute(org-export-dispatch)

Sent from Mailspring 
(https://link.getmailspring.com/link/2d4dfaca-a01a-4f4c-9162-46e73035b...@getmailspring.com/0?redirect=https%3A%2F%2Fgetmailspring.com%2F=ZW1hY3Mtb3JnbW9kZUBnbnUub3Jn),
 the best free email app for work
On Jun 26 2021, at 11:05 pm, Tim Cross  wrote:
>
> Brandon Taylor  writes:
> > Okay. Well, I've gone ahead and installed LibreOffice, which took care of 
> > the "missing 'soffice'" problem, but like a frustrating game of Whac-A-Mole,
> > another problem popped up. Now I'm left high and dry as to what might have 
> > happened, because after adding the location of soffice.exe in my
> > Windows PATH environment variable, I get the following output:
> >
> > Executing soffice --headless --convert-to odt --outdir 
> > "c:/Users/donni/OneDrive/Documents/" 
> > "c:/Users/donni/OneDrive/Documents/belvoire.odt"
> >
> > Export to c:/Users/donni/OneDrive/Documents/belvoire.odt failed
> >
> > with absolutely no rhyme or reason as to what went wrong.
> >
>
> You can try turning on debug on error with
> M-x toggle-debug-on-error
> which might give you a backtrace that will provide more details.
> I would also try executing the command
> soffice --headless --convert-to odt --outdir 
> "c:/Users/donni/OneDrive/Documents/" 
> "c:/Users/donni/OneDrive/Documents/belvoire.odt"
> at a command prompt and see if you get any additonal information. I've
> not done odt exports of org files, but that command line looks odd to me
> - it looks like it is trying to convert an odt file to odt?
>
> I suspect you will have a hard time getting all this to work on Windows.
> It is possible, but as Windows is not a 'preferred' platform, you have a
> significant amount of configuration/customisation to do to get it
> working.
>
> I never use Windows, so cannot provide much help of any real substance.
> I do wonder if it might be easier if you use WSL?
>
> --
> Tim Cross
>



Re: Libre vs Open Office [was: Export Org mode files to (gag, barf) MS Office?]

2021-06-27 Thread Marcin Borkowski


On 2021-06-26, at 22:12, to...@tuxteam.de wrote:

> On Sat, Jun 26, 2021 at 09:49:02PM +0200, Marcin Borkowski wrote:
>> 
>> On 2021-06-26, at 21:18, to...@tuxteam.de wrote:
>> 
>> > On Sat, Jun 26, 2021 at 04:27:19PM +, Brandon Taylor wrote:
>> >> I’ve seen that LibreOffice can read and write to those formats, whereas 
>> >> OpenOffice can only read them. Or has OpenOffice overcome that particular 
>> >> barrier?
>> >
>> > I think OpenOffice is practically dead. All interesting development
>> > happens in LibreOffice, at least for the last ten years. Heck, it
>> > was practically dead 2015.
>> >
>> > It is a long, sad story. Currently I wouldn't even bet on OpenOffice
>> > not having unpatched critical security bugs.
>> 
>> Out of curiosity: why sad? I've been using OpenOffice many years ago
>> (StarOffice earlier), now I'm using LibreOffice.  Wasn't that basically
>> a rename?
>
> The sad part, in a few words, is that OpenOffice still kept the "brand
> recognition", but is basically unmaintained at this point.
>
> Many users (especially in Windows land, the Linus ones seem to know) are
> still lured by the brand to download and use unmaintained software.
>
> It is as if Oracle, by donating OpenOffice to the Apache Software Foundation,
> wanted to sabotage free office software. But why?

Sad indeed.  Didn't know that.  I just noticed at some point that LO was
what I should use from now on to deal with those pesky (doc|xls)x? files
and that was it.  I also installed it on my daughter's Windoze laptop
etc.  I just thought there is no more OO...

Thanks,
mbork


>
> Cheers
>
> [1] https://pctechmag.com/2011/06/oracle-and-openoffice-the-final-insult/
>
>  - t


-- 
Marcin Borkowski
http://mbork.pl



Re: [PATCH] ob-R output file with graphics parameter

2021-06-27 Thread Jack Kamm
Hi all,

> I obviously missing something. The above works for me without the
> patch. Unfortunately, I can't trace back the thread in order to
> understand the context.

I think this is a followup from this mail:

https://orgmode.org/list/87zgxc42qg@gmail.com/

wherein Jeremie states:

> The current patch have been tested for remote connections as well and
> AFAIK, nothing breaks.
> 
> But I'm afraid that the graphical output is broken and has long been
> even before the path. The test for graphical output is compromised and
> does not do the right test. I will suggest new ones.

So I think it's to do with graphical outputs in remote R sessions.

However, I tested Jeremie's example on latest org master and it also
worked fine for me, also on remote sessions.

Jeremie, could you clarify the issue this fixes?

> +(defun org-babel-output-link-path:R (params)
> +  "format org-link to file from PARAMS"
> +  
> +  (format "[[file:%s]]" (concat (cdr (assq :dir params))
> + "/"
> +(cdr (assq :file params)

Rather than concat, I think it is better to use expand-file-name, and
also call file-name-as-directory on the directory component.

Stylistically, I don't think there should be a blank line between the
docstring and the code. The docstring should also start with a capital
letter and end with a period.

> +(setq out-file-path  (concat
> +  (replace-regexp-in-string "/ssh:.*?:" "" (cdr 
> (assq :dir params)))
> + "/"
> +  out-file))

Use org-babel-process-file-name instead of replace-regexp-in-string to
get the local path of the file.

> - Remove second the need for a second file parameter

This would indeed be nice.

The requirement for a second file parameter was added in Org 9.3 to
support the use case in this thread:

https://orgmode.org/list/3ac2f42a-8ff2-1464-fa36-451e2ef0e...@pressure.to/

But this syntax is annoyingly verbose for ob-R users, and also broke
lots of ob-R examples prior to Org 9.3.

A simple fix might be to have the "graphics" flag implicitly add the
"file" flag as well. But we would need to first check that this doesn't
break other use cases.

> Subject: [PATCH 1/4] ob-R.el: Remove redundant argument to function

I think it would be better to squash these changes into a single commit.



Re: Export Org mode files to (gag, barf) MS Office?

2021-06-27 Thread Samuel Banya
The reason why someone would want to do this is that most corporate 
environments literally force you to use products like the MS Office Suite.

I can only see that as a benefit to be able to export to whatever you want.

is it perfect?

Probably not, but at least the option exists.

I feel that the people who like to gravitate towards the FOSS side of things 
though should probably move their careers to only being able to utilize FOSS 
type stuff anyway.

Ex: Use Pandoc as a crutch for now, and slowly move towards jobs where you no 
longer need MS Office Suite, etc.

On Sun, Jun 27, 2021, at 4:13 PM, emanuel.charpent...@gmail.com wrote:
> I know we’re not supposed to really even TALK about proprietary software in 
> FOSS communities like this one, but I can’t help but wonder if someone might 
> consider making (an) Emacs plugin(s) that allow(s) a user to export Org mode 
> files to Microsoft Office file formats such as .docx, .xlsx and the like? Or 
> is/are there already (a) plugin(s) in the MELPA that can do this?
> 
> FWIW, someone calling himself "kawabata" on github has written this 
> pandoc-based exporter,  which does an 
> okay job for some documents.
> 
> The fly in the ointment is that this person seems to have dropped off the 
> 'Net : his code hasn't been maintained for three years and 35 issues are 
> currently open. Maintaining it might be an "interesting" project...
> 
> Getting "good" results in ODT seems easier. You have to pay attention to some 
> details (e. g. the "right" value to set the symbol used to export code 
> fragments, etc...), but at least, LibreOffice supports vector graphics... The 
> most important point may be to create a "good" template document for your 
> needs.
> 
> I have been able to create documents exporting citations, Sagemath-generated 
> LaTeX  math, figures, tables, listings and cross-references to these elements 
> to ODT, LaTeX/PDF and HTML with not much hassle (though the ability to create 
> a list of figures is sorely lacking...) using the built-in ODT exporter and 
> org-ref  or 
> citeproc-org.  As already 
> mentioned, LibreOffice can easily convert from ODT to DOCX (with often 
> results superior to Word's interpretation of ODT...).
> 
> I have great expectations on the upcoming citation/bibliography system 
> discussed here a short while ago.
> 
> HTH,
> 
> --
> Emmanuel Charpentier
> 


Export Org mode files to (gag, barf) MS Office?

2021-06-27 Thread emanuel . charpentier
I know we’re not supposed to really even TALK about proprietary
software in FOSS communities like this one, but I can’t help but wonder
if someone might consider making (an) Emacs plugin(s) that allow(s) a
user to export Org mode files to Microsoft Office file formats such as
.docx, .xlsx and the like? Or is/are there already (a) plugin(s) in the
MELPA that can do this?

FWIW, someone calling himself "kawabata" on github has written this
pandoc-based exporter, which does an okay job for some documents.

The fly in the ointment is that this person seems to have dropped off
the 'Net : his code hasn't been maintained for three years and 35
issues are currently open. Maintaining it might be an "interesting"
project...

Getting "good" results in ODT seems easier. You have to pay attention
to some details (e. g. the "right" value to set the symbol used to
export code fragments, etc...), but at least, LibreOffice supports
vector graphics... The most important point may be to create a "good"
template document for your needs.

I have been able to create documents exporting citations, Sagemath-
generated LaTeX  math, figures, tables, listings and cross-references
to these elements to ODT, LaTeX/PDF and HTML with not much hassle
(though the ability to create a list of figures is sorely lacking...)
using the built-in ODT exporter and org-ref or citeproc-org. As already
mentioned, LibreOffice can easily convert from ODT to DOCX (with often
results superior to Word's interpretation of ODT...).

I have great expectations on the upcoming citation/bibliography system
discussed here a short while ago.

HTH,

--
Emmanuel Charpentier


Re: Bug: "before first headline" error when adding clock out note [9.4.6 (9.4.6-dist @ /home/wenlong/org-9.4.6/lisp/)]

2021-06-27 Thread Nicolas Goaziou
Hello,

Dave D  writes:

> It seems the error is caused by function
> org-clock-remove-empty-clock-drawer called by org-clock-out-hook
>
> I have removed that function from the hook for now as a workaround.

I pushed a fix in master.

Thank you.

Regards,
-- 
Nicolas Goaziou



Re: [PATCH] source blocks mangled when edited

2021-06-27 Thread Nicolas Goaziou
Hello,

Sébastien Miquel  writes:

> Subject: [PATCH] org-src.el: Use `replace-buffer-contents' only for emacs >=
>  27
>
> * lisp/org-src.el: Use `replace-buffer-contents' only for emacs >= 27.
>
> It was introduced in emacs 26.1, but earlier versions made no
> guarantees of correctness.

I tweaked the commit message and applied your patch. Thank you.

Regards,
-- 
Nicolas Goaziou



Re: Bug: Duplicate logbook entry for repeated tasks [9.4.6 (9.4.6-gab9f2a @ /home/gustavo/.emacs.d/elpa/org-9.4.6/)]

2021-06-27 Thread Gustavo Barros



On Sun, 27 Jun 2021 at 03:31, Bhavin Gandhi  
wrote:



You are right, I actually did a bisect last week and found that change
has introduced this behavior. I should have posted that immediately, 
it

would have saved some of your time.


No problem.  Thanks for confirming you reached the same conclusion.

Best,
Gustavo.



FYI Speedup of publish command in master

2021-06-27 Thread Gustav Wikström
Hi,

In a similar vein as the speedups of scanning for IDs that was made a while 
back, there now is a speedup for org publish as well. Soon to be pushed to 
code.orgmode.org (we're still using that, aren't we?) with commit aa0fa8c75.

The speedup is seen when scanning through files to decide if an existing cache 
can be used or not.

A note on the topic, fwiw. Loading an Org mode file using find-file is very 
slow. So when there is a reason for looking through the content of Org mode 
files, or any file for that matter, and there is no reason for triggering 
hooks, consider instead inserting the content of the file in a delay-mode-hooks 
macro within a temporary buffer (using the with-temp-buffer macro).

Example:
*Instead of*:
(find-file path-to-file)
;; do stuff
(...)
;; clean up state
(kill-buffer ...)

*Consider*:
(with-temp-buffer
  (delay-mode-hooks
(insert-file-contents path-to-file)
;; do stuff
(...)))

Best
Gustav


Re: Bug: Duplicate logbook entry for repeated tasks [9.4.6 (9.4.6-gab9f2a @ /home/gustavo/.emacs.d/elpa/org-9.4.6/)]

2021-06-27 Thread Bhavin Gandhi
On Sat, 26 Jun 2021 at 00:13, Jeff Kowalski wrote:
> While I don't have a fix for the root issue, I did have a chance to
> create
> a lint for LOGBOOK duplicates, as you suggested.

Thank you Jeff, I had no clue how to write something like that :)

On Sun, 27 Jun 2021 at 07:58, Gustavo Barros wrote:
>
> I did some digging and, as far as I can tell, the commit which
> introduces the bug is "c670379ad Fix `org-agenda-todo' undo behavior
> when logging (not adding note)".
>
> I tested the ECM initially reported, and I don't find the behavior in
> commit `b2be3dd0e', but I do find it in `59edcc27c', and what happened
> in `master' between the two is `c670379ad'.

You are right, I actually did a bisect last week and found that change
has introduced this behavior. I should have posted that immediately, it
would have saved some of your time. I'm trying to wrap my head around
the `org-todo' code as well as the change from `c670379ad'.

Till now I found that the function `org-add-log-setup' is getting
called twice. Why that's happening, I'm not sure yet. I think running
edebug will help here, I'm going to try that.

-- 
Bhavin Gandhi (bhavin192) | https://geeksocket.in