Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-11-03 Thread Aaron Jensen
On Wed, Nov 3, 2021 at 7:43 AM Ihor Radchenko  wrote:
>
> Aaron Jensen  writes:
>
> > Here is a backtrace. The package it mentions is my own:
> > https://github.com/aaronjensen/emacs-orgonomic and
> > https://github.com/Somelauw/evil-org-mode is mentioned too.
>
> The mentions are ok. Backtrace should mention every command that
> actually changes the buffer.
>
> > Unregistered buffer modifications detected. Resetting.
> > ...
> >  Backtrace:
> > "  backtrace-to-string(nil)
> >   org-element--cache-sync(#)
> >   apply(org-element--cache-sync #)
> >   timer-event-handler([t 0 0 59 nil org-element--cache-sync
>
> > Backtrace:
> >   org-element-cache diagnostics(20211101-journal): Nothing to remove.
> > No elements in cache after 361. Terminating.
>
> It looks like cache complete the synchronisation successfully, but some
> command bypasses modification detection. Unfortunately, I cannot catch
> the problematic command from backtrace. It acts "stealthily" for cache.
> Is there a specific kind of edit sequence that you did right before the
> warning appeared?
>
> Best,
> Ihor

I don't recall, but I'll view-lossage next time it happens.



Re: org-diary

2021-11-03 Thread Eric S Fraga
Glad I could be of assistance!  
-- 
: Eric S Fraga via Emacs 28.0.60, Org release_9.5-192-gd4e192
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Re: [BUG] after update to 9.5, starting org mode results in cache error messages [9.5 (9.5-gd4e192 @ c:/Users/scott/.emacs.d/straight/build/org/)]

2021-11-03 Thread Ihor Radchenko
Greg Coladonato  writes:

> I uninstalled undo-fu and re-ran the profiler. It takes even longer to save
> org files now. Here's the profiler report now, does it look like helm-M-x
> is
> now the bottleneck?

The profiler does not show anything about saving buffer. I suspect that
you had profiler running for a long time - the statistics appears to be
from a long session, so that saving buffer is insignificant compared to
some command you use frequently (helm search in org buffer?).

To make sure that you are getting profiler statistics just from saving
buffer, you can first run M-x profiler-stop. Only after making sure that
old profiler is not running, you can M-x profiler-start 
M-x profiler-report.

Note that you can try to look for the bottleneck yourself: profiler
report buffer works similar to Org buffer - you can hit  to unfold
the call-tree and reveal more about slow commands.

Best,
Ihor



Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-11-03 Thread Ihor Radchenko
Aaron Jensen  writes:

> Here is a backtrace. The package it mentions is my own:
> https://github.com/aaronjensen/emacs-orgonomic and
> https://github.com/Somelauw/evil-org-mode is mentioned too.

The mentions are ok. Backtrace should mention every command that
actually changes the buffer.

> Unregistered buffer modifications detected. Resetting.
> ...
>  Backtrace:
> "  backtrace-to-string(nil)
>   org-element--cache-sync(#)
>   apply(org-element--cache-sync #)
>   timer-event-handler([t 0 0 59 nil org-element--cache-sync

> Backtrace:
>   org-element-cache diagnostics(20211101-journal): Nothing to remove.
> No elements in cache after 361. Terminating.

It looks like cache complete the synchronisation successfully, but some
command bypasses modification detection. Unfortunately, I cannot catch
the problematic command from backtrace. It acts "stealthily" for cache.
Is there a specific kind of edit sequence that you did right before the
warning appeared?

Best,
Ihor



Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-11-03 Thread Ihor Radchenko
Aaron Jensen  writes:

> Here is another that just happened:
> https://gist.github.com/aaronjensen/5294a64f243a306b58062113b9306bab
>
> It's scrubbed of all string data, hopefully not over-scrubbed for you.

Thanks! It was really helpful. The problem was org-roam calling
org-element-parse-buffer frequently. org-element-parse-buffer had a bug
causing element cache corruption. Sometimes, :parent property of cached
elements was set to uncached elements - something cache code does not
expect. Fixed on main now.

Best,
Ihor



Re: transclusion, tangling, flycheck/flymake, etc.

2021-11-03 Thread Ihor Radchenko
Greg Minshall  writes:

> my thought about flycheck, flymake, whatever, is that (optionally) a
> silent, background, =tangle= and/or =<> expansion= would take
> place to produce a "full source file buffer"[*], then the narrowed
> version of that (corresponding to the part where =C-c '= was issued)
> buffer is presented for the user's editing convenience.

You are right. That's what I had in mind. Though noweb <>-style
references may need to be transcluded without expanding - they may be
computationally expensive.

> your thought here, iiuc, is that source files would live in the file
> system, and be transcluded into the .org file.  i can see the utility of
> that.  but, i would miss =<>= and also the ability to break the
> source code into small chunks for purposes of documentation.

No. I did not imply that source files will be transcluded into the .org
file. Currently, .org file is the source of the code (unless you use
org-babel-detangle). I was thinking that C-c ' will trigger generating a
temporary prog-mode buffer (according to .org file!). It is not a good
idea to associate the temporary buffer with actual file because tangling
may involve expanding noweb references. Noweb sometimes require long
computations or even access to remote servers. I think that it's better
to trigger tangle process manually by default.

Best,
Ihor



Re: transclusion, tangling, flycheck/flymake, etc.

2021-11-03 Thread Greg Minshall
Ihor,

thanks for the clarification.

maybe, in that ideal world, <> might expand, optionally.

another point: watching Noboru's "most recent" (9?) video, i see another
feature of his transclusion: a way to say, "this is *exactly* like a
source block -- with language, :results, :tangle, :var, etc.,
... except, the actual code is in some other file: when i hit =C-c C-c=
here, please set up (based on language), include that source, execute
it".

that also might be interesting.  if i were to think of that, i'd say the
verb might *not* be =#+transclude=, but, rather, something source
specific (=#+src_ref=?).  but, it might allow a =:transclude yes=
property.

cheers, Greg



Re: [PATCH] c-csl : accept relative CSL filenames

2021-11-03 Thread Nicolas Goaziou
Hello,

Emmanuel Charpentier  writes:

> This (minuscule) patch allows to pass a relative (to the buffer's
> default directory) file name to denote the CSL style file.

Thank you. However, I'm not sure to understand the purpose of the patch.

> Rationale : this allows the use of "one-of" styles for "one-of"
> projects without overloading a defailt CSL style directory (which may
> or may not exist on a given system : think JabRef users...). Also
> useful for hacked CSL files specific to a given project.

If we expand every relative file name from `default-directory', what
happens to `org-cite-csl-styles-dir'? Your patch makes this variable
useless, doesn't it?

What about using a local `org-cite-csl-styles-dir' instead, using
file-local variables?

> +((and (pred (lambda (x)
> +   (let ((fn (expand-file-name x default-directory)))
> + (if (file-exists-p fn) fn nil file) file)

This pattern returns the relative file name, not the expanded one. It
may not be what you want.


Regards,
-- 
Nicolas Goaziou



how to get verbatim text with line breaks

2021-11-03 Thread Christopher W. Ryan
I have this in an org file

0,Mon [start_plus_0] at 03:00 PM
30,Mon [start_plus_0] at 03:30 PM
60,Mon [start_plus_0] at 04:00 PM
90,Mon [start_plus_0] at 04:30 PM
120,Mon [start_plus_0] at 05:00 PM

I want to export to ASCII text and have it look exactly like that, 5 lines.

Doing nothing, I get 3 lines

0,Mon [start_plus_0] at 03:00 PM 30,Mon [start_plus_0] at 03:30 PM
60,Mon [start_plus_0] at 04:00 PM 90,Mon [start_plus_0] at 04:30 PM
120,Mon [start_plus_0] at 05:00 PM


Trying various source and example blocks gets me partway there:


#+BEGIN_EXAMPLE
0,Mon [start_plus_0] at 03:00 PM
30,Mon [start_plus_0] at 03:30 PM
60,Mon [start_plus_0] at 04:00 PM
90,Mon [start_plus_0] at 04:30 PM
120,Mon [start_plus_0] at 05:00 PM
#+END_EXAMPLE

produces

,
| 0,Mon [start_plus_0] at 03:00 PM
| 30,Mon [start_plus_0] at 03:30 PM
| 60,Mon [start_plus_0] at 04:00 PM
| 90,Mon [start_plus_0] at 04:30 PM
| 120,Mon [start_plus_0] at 05:00 PM

5 lines, but I don't want the leading pipe characters, the comma, or the
4 hyphens


#+BEGIN_VERSE
0,Mon [start_plus_0] at 03:00 PM
30,Mon [start_plus_0] at 03:30 PM
60,Mon [start_plus_0] at 04:00 PM
90,Mon [start_plus_0] at 04:30 PM
120,Mon [start_plus_0] at 05:00 PM
#+END_VERSE

yields

  0,Mon [start_plus_0] at 03:00 PM
  30,Mon [start_plus_0] at 03:30 PM
  60,Mon [start_plus_0] at 04:00 PM
  90,Mon [start_plus_0] at 04:30 PM
  120,Mon [start_plus_0] at 05:00 PM

5 lines, but with undesired indentation


Nor does #+BEGIN_VERBATIM  or #+BEGIN_SRC text   give me what I am
looking for.

Grateful for suggestions.

Thanks

--Chris Ryan




org-store-link question

2021-11-03 Thread John Kitchin
In a basically vanilla emacs, if I have a target like <> with my
point on it, and I run org-store-link (via C-c l), and then somewhere else
do org-isnert-link (via C-c C-l) I get a link like

[[file:~/s/f.org::test]]

If I define a link now like this:

#+BEGIN_SRC emacs-lisp
(org-link-set-parameters "jump"
:store (lambda ()
 (org-link-store-props
  :type "jump"
  :link (format "jump:%s::%s"
(buffer-file-name)
(line-number-at-pos)
#+END_SRC

and do that again, all I can insert with C-c C-l is something like:

[[jump:~/s/f.org::9]]

and the file link is not an option anymore. Should the file link still be
there?

John

---
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


Re: [BUG] Org V 9.5 error when ~/.cache doesn't exist

2021-11-03 Thread Max Nikulin

On 02/11/2021 17:55, Ihor Radchenko wrote:

Max Nikulin writes:


Ihor, your fix affects linux as well. .cache directory may be missed in
fresh accounts. E.g. I just have created a new test container (my old
one has emacs-25):


After second thought, I am not sure anymore if using XDG is a good idea.
Emacs itself only recently started supporting XDG and the support is
somewhat limited. Similar to the described case with non-existing .cache
directory, Emacs ignores non-existing .config/emacs folder for init.el.
Emacs never creates .config directory.

...

4. Same as 3, but create $XDG_CACHE_DIR if possible. It is similar to
other XDG-complient software (at least, that's what I saw in
qutebrowser code).


I like the idea to put temporary automatically created files to a 
dedicated directory. Backups are easier when hand-written config files 
are separated from stuff that can be recreated on demand. Since enough 
applications follow XDG conventions, I suppose, XDG_CACHE_HOME=~/.cache 
is a reasonable variant consistent with user expectations. Emacs 
directory may be a fallback when XDG_CACHE_HOME can not be created. I am 
against using ~/.cache only if it already exists. It may result in stale 
cache in the emacs directory populated before another application 
created ~/.cache, so user would have 2 directories with cache files.


I agree that xdg.el lacks some useful features. Even parts of emacs such 
as startup.el and files.el do not use this package. Similar libraries 
for other programming languages offer wider support of OSes and create 
directories on demand, e.g. https://github.com/adrg/xdg for Go.


Maybe org-macs.el is a better place for code dealing initialization of 
cache directory.



P.S. `org-open-file' may benefit from using of xdg.el. MIME handlers 
obtained from .desktop files should be more consistent with expectations 
of users of desktop environments.





Re: [patch] ox-latex.el: add `:options' LaTeX attribute to tables

2021-11-03 Thread Juan Manuel Macías
Hi Nicolas,

Nicolas Goaziou writes:

> Thank you.
>
> Could you also document it in the manual?

Of course, tomorrow I will upload an updated version of the patch with
the documentation in the manual. Should I also add an entry in ORG-NEWS,
in "Version 9.6" node?

Best regards,

Juan Manuel 



Re: [PATCH] oc-basic: support biblatex date field

2021-11-03 Thread Nicolas Goaziou
Hello,

"Bruce D'Arcus"  writes:

> Can you please fix that, if the patchis otherwise fine?

OK.

> The biblatex manual (section 2.3.8 Date and Time Specifications), says
> the following:
>
> "Date fields such as the default data model dates date, origdate,
> eventdate, and urldate adhere to iso8601-2 Extended Format
> specification level 1."
>
> This is an extension to standard 8601 dates, previously known as EDTF
> (extended date-time format).
>
> So for the vast majority of cases, yes; the value would be standard 8601 
> dates.
>
> The exceptions should be very rare open-ended ranged dates; from table 3.
>
> ../1997
> /1997
>
> I do not, however, have a good knowledge of what people do in the
> wild. It just seems like such a critical data field should be
> supported.

I pushed a change along these lines in bugfix branch. Please let me know
if it works for you.

Thank you.

Regards,
-- 
Nicolas Goaziou



Re: [BUG] Elisp error when exporting citation [9.5 (release_9.5-104-g2b1fc6 @ /home/quintus/.emacs.d/org-mode/lisp/)]

2021-11-03 Thread Nicolas Goaziou
Hello,

Marvin Gülker  writes:

> trying to export the following org-document results in an Elisp error:
>
> #+TITLE: Test
> #+AUTHOR: Testauthor
>
> #+LANGUAGE: de
> #+bibliography: /tmp/mwe/mwe.bib
>
> #+cite_export: csl /tmp/mwe/juristische-schulung.csl
> 
> Test [cite:raubenheimer1996dongle p. 76; /Dreier/, in: @ds2018urhg § 69d 
> Rn. 10]

[...]

> This is mwe.bib:
>
> @Article{raubenheimer1996dongle,
> author   = {Andreas Raubenheimer},
> title= {Beseitigung/Umgehung eines technischen Programmschutzes 
> nach UrhG und UWG},
> journaltitle = {Computer und Recht},
> shortjournal = {CR},
> year  = {1996},
> pages = {69-79},
> langid= {german}}
> 
> @commentary{ds2018urhg,
> title = "Urheberrechtsgesetz",
> shorttitle = "UrhG",
> editor = "Thomas Dreier and Gernot Schulze",
> edition = "6",
> year = "2018",
> publisher = "C.H. Beck",
> location = "München"
> }
>
> juristische-schulung.csl is 
> https://github.com/citation-style-language/styles/raw/e22b8a566bad9b4c7f52720f60dd875057a5d210/juristische-schulung.csl
>
> I use Org mode version 9.5 (release_9.5-104-g2b1fc6 @ 
> /home/quintus/.emacs.d/org-mode/lisp/).
> Citeproc.el is at 34e66583d95a8d80fb5b9f2960f3382ca0e6d3ab.
>
> The following error is produced when exporting to HTML (C-c C-e h o):
>
> Debugger entered--Lisp error: (wrong-type-argument plistp (prefix . 
> #("Dreier, in:" 3 9 (:parent (italic (:begin 179 :end 187 
> :contents-begin 180 :contents-end 186 :post-blank 0 :parent 
> (citation-reference (:key "ds2018urhg" :begin 178 :end 217 :post-blank 0 
> :prefix ... :suffix ... :parent ...))) #("Dreier" 0 6 (:parent #7 13 18 
> (:parent (citation-reference (:key "ds2018urhg" :begin 178 :end 217 
> :post-blank 0 :prefix (#(" " 0 1 ...) (italic ... ...) #(", in: " 0 6 ...)) 
> :suffix (#(" § 69d Rn. 10" 0 13 ...)) :parent (citation (:style nil :begin 
> 143 :post-blank 0 :end 218 :prefix ... :contents-begin 178 :contents-end 217 
> :parent ...) #7)))

Indeed. There was an issue with global affixes in oc-csl.el. I think
I fixed it. Unfortunately, your ECM still does not work, because the
process encounters an error later on:

--8<---cut here---start->8---
Debugger entered--Lisp error: (wrong-type-argument sequencep splice)
  citeproc-rt--cquote-pstns-1(splice 66)
  citeproc-rt--cquote-pstns-1((nil #("raubenheimer1996dongle p. 76  
\\emph{Dreier}, in: " 0 29 (:parent (citation (:style nil :begin 145 
:post-blank 0 :end 221 :prefix (#("raubenheimer1996dongle p. 76 " 0 29 ...)) 
:contents-begin 181 :contents-end 220 :parent (footnote-reference (:label nil 
:type inline :contents-begin 145 :contents-end 221 :post-blank 0 :parent ...) 
#6)) (citation-reference (:key "ds2018urhg" :begin 181 :end 220 :post-blank 0 
:prefix (... ... ...) :suffix (...) :parent #6 36 42 (:parent (italic 
(:begin 182 :end 190 :contents-begin 183 :contents-end 189 :post-blank 0 
:parent (citation-reference (:key "ds2018urhg" :begin 181 :end 220 :post-blank 
0 :prefix ... :suffix ... :parent ...))) #("Dreier" 0 6 (:parent #6 43 48 
(:parent (citation-reference (:key "ds2018urhg" :begin 181 :end 220 :post-blank 
0 :prefix (#(" " 0 1 ...) (italic ... ...) #(", in: " 0 6 ...)) :suffix (#(" § 
69d Rn. 10" 0 13 ...)) :parent (citation (:style nil :begin 145 :post-blank 0 
:end 221 :prefix ... :contents-begin 181 :contents-end 220 :parent ...) #6) 
(nil (nil (nil (((font-style . "italic")) ((... ...) (... ...) "/" (... 
...) ", ") splice splice) 1)
  citeproc-rt--cquote-pstns((nil #("raubenheimer1996dongle p. 76  
\\emph{Dreier}, in: " 0 29 (:parent (citation (:style nil :begin 145 
:post-blank 0 :end 221 :prefix (#("raubenheimer1996dongle p. 76 " 0 29 ...)) 
:contents-begin 181 :contents-end 220 :parent (footnote-reference (:label nil 
:type inline :contents-begin 145 :contents-end 221 :post-blank 0 :parent ...) 
#6)) (citation-reference (:key "ds2018urhg" :begin 181 :end 220 :post-blank 0 
:prefix (... ... ...) :suffix (...) :parent #6 36 42 (:parent (italic 
(:begin 182 :end 190 :contents-begin 183 :contents-end 189 :post-blank 0 
:parent (citation-reference (:key "ds2018urhg" :begin 181 :end 220 :post-blank 
0 :prefix ... :suffix ... :parent ...))) #("Dreier" 0 6 (:parent #6 43 48 
(:parent (citation-reference (:key "ds2018urhg" :begin 181 :end 220 :post-blank 
0 :prefix (#(" " 0 1 ...) (italic ... ...) #(", in: " 0 6 ...)) :suffix (#(" § 
69d Rn. 10" 0 13 ...)) :parent (citation (:style nil :begin 145 :post-blank 0 
:end 221 :prefix ... :contents-begin 181 :contents-end 220 :parent ...) #6) 
(nil (nil (nil (((font-style . "italic")) ((... ...) (... ...) "/" (... 
...) ", ") splice splice))
  citeproc-rt-punct-in-quote((nil #("raubenheimer1996dongle p. 76  
\\emph{Dreier}, in: " 0 29 (:parent (citation (:style nil :begin 145 
:post-blank 0 :end 221 :prefix 

Re: re-scanning bibliography for org-cite

2021-11-03 Thread Bruce D'Arcus
On Wed, Nov 3, 2021 at 12:21 PM Nicolas Goaziou  wrote:

> oc-basic relies on a cache. The cache key contains a hash of the
> contents of the bib file. So whenever the bib file is modified, the
> cache is invalidated, and oc-basic parses again the file.

Of course; clever!

Bruce



Re: Inconsistent usage of "overview"

2021-11-03 Thread Carlos Pita
I believe my confusion was due to the fact that the docstring of
org-startup-folded is not particularly precise regarding to its
possible values. On the one hand it seems to be a toggle, but its
initial value is nevertheless showeverything and not t. On the other
hand it states that "This can also be configured on a per-file basis
by adding one of the following lines anywhere in your buffer..." but
it's not clear whether these values may also be assigned directly to
the variable. If you do that, then inconsistencies appear: when they
are options in a buffer, showall and nofold are both mapped to nil,
fold and overview are both mapped to t; but when they are directly set
this mapping obviously doesn't take place. Following a suggestion I'd
read elsewhere, I set org-startup-folded to fold (and, later, to
overview), and this is not really calling org-overview but instead
ends up in a catch-all clause that hides drawers. By the same token I
could have set org-startup-folded to foobar.

The point still stands that showall and contents fold drawers but
overview (aka fold) doesn't fold drawers, which seems extremely odd to
me.

Best regards,
Carlos



Re: [PATCH] org.el (org-display-inline-image--width): Small fix

2021-11-03 Thread Nicolas Goaziou
Hello,

Sébastien Miquel  writes:

> Subject: [PATCH] org.el (org-display-inline-image--width): Small fix

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

Regards,
-- 
Nicolas Goaziou



Re: re-scanning bibliography for org-cite

2021-11-03 Thread Nicolas Goaziou
Hello,

"Bruce D'Arcus"  writes:

> On Thu, Oct 21, 2021 at 10:12 AM Eric S Fraga  wrote:
>>
>> Dear all,
>>
>> simple question: how can I get org-cite to rescan my bibliography (.bib)
>> file when it changes?  When I'm writing a paper, as I'm doing now, I add
>> entries to my bibliography as I write but org-cite is not aware of any
>> new entries.
>
> Do you mean for org-cite-insert?
>
> Which insert processor?
>
> If it's bibtex-actions, you have to configure the filenotify support
> mentioned on the README.
>
> I'm not sure how the oc-basic one handles this.

oc-basic relies on a cache. The cache key contains a hash of the
contents of the bib file. So whenever the bib file is modified, the
cache is invalidated, and oc-basic parses again the file.

IOW, rescanning happens automatically in oc-basic.

Regards,
-- 
Nicolas Goaziou



Re: [patch] ox-latex.el: add `:options' LaTeX attribute to tables

2021-11-03 Thread Nicolas Goaziou
Hello,

Juan Manuel Macías  writes:

> The `:options' attr. allows adding an optional argument with various
> table options (between brackets in LaTeX export), since certain tabular
> environments, such as `longtblr' of the `tabularray' LaTeX package,
> provides this structure (see:
> https://list.orgmode.org/CALtzAB1yM+uG_xHghCxTLRX5mgbzNvT5+PO=duabb28ncsv...@mail.gmail.com/#r)
>
> Example:
>
> #+ATTR_LATEX: :environment longtblr
> #+ATTR_LATEX: :align colspec = {XXX}, width = 0.85\linewidth
> #+ATTR_LATEX: :options remark{Note} = {Lorem ipsum dolor sit amet}
>
> ==> \begin{longtblr}[remark{Note} = {Lorem ipsum dolor sit amet}]{colspec = 
> {XXX}, width = 0.85\linewidth}

Thank you.

Could you also document it in the manual?

Regards,
-- 
Nicolas Goaziou



Re: More on design of org-contacts.el - Re: [UPDATED PATCH] Re: add new link type "contact:" for org-contacts.el

2021-11-03 Thread Bastien
Hi,

stardiviner  writes:

> I would like to be the maintainer of org-contacts.el. (I might
> already replied this message? Sorry if duplicated.)

You are already org-contacts.org's maintainer:

https://git.sr.ht/~bzg/org-contrib/tree/master/item/lisp/org-contacts.el#L6

> I have separated and put org-contacts on
> GitHub https://github.com/stardiviner/org-contacts.el.

I've added this as the new homepage for org-contacts.el and listed
org-contacts.el in the library to remove from next versions of
org-contrib.

> And I'm in the progress to put it on NonGNU ELPA or MELPA.

Great, thank you very much!

-- 
 Bastien



Re: [patch] ox-latex.el: add `:options' LaTeX attribute to tables

2021-11-03 Thread Nicolas Goaziou
Juan Manuel Macías  writes:

> Of course, tomorrow I will upload an updated version of the patch with
> the documentation in the manual. Should I also add an entry in ORG-NEWS,
> in "Version 9.6" node?

Good idea. Thanks.

Regards,



[BUG] org-element-at-point returns wrong element

2021-11-03 Thread Sébastien Miquel

Hi,

With point at the bol of the empty line after the keyword and before
the heading at the end of this mail, =org-element-at-point= returns
the headline element. It used to (a month ago, before all the caching)
return the keyword.

This breaks =org-element-context= which errors out when called from
the same point.

Regards,

#+LATEX_CLASS: my-class

* Head1

* Head2

--
Sébastien Miquel




Re: how to get verbatim text with line breaks

2021-11-03 Thread Marco Wahl
"Christopher W. Ryan"  writes:

> I have this in an org file
>
> 0,Mon [start_plus_0] at 03:00 PM
> 30,Mon [start_plus_0] at 03:30 PM
> 60,Mon [start_plus_0] at 04:00 PM
> 90,Mon [start_plus_0] at 04:30 PM
> 120,Mon [start_plus_0] at 05:00 PM
>
> I want to export to ASCII text and have it look exactly like that, 5 lines.
>
> Doing nothing, I get 3 lines
>
> 0,Mon [start_plus_0] at 03:00 PM 30,Mon [start_plus_0] at 03:30 PM
> 60,Mon [start_plus_0] at 04:00 PM 90,Mon [start_plus_0] at 04:30 PM
> 120,Mon [start_plus_0] at 05:00 PM

(info "(org) Paragraphs")

Paragraphs are separated by at least one empty line.  If you need to
enforce a line break within a paragraph, use ‘\\’ at the end of a line.


HTH,
-- 
Marco



Re: add automatically a counter to a header/TODO???

2021-11-03 Thread Samuel Wales
idk if this is useful, but i was thinking of doing something similar,
except, automatically for the purpose of recording progress.

as in, the number of times i did something to the task.  in tags not
properties, thus on the header.  like :n_2:

i tried keywords for progress instead, but that is coarse [cannot
"reward" tiny progress] and requires decision making -- is this
started or progressed?  that can be too much cognitive overhead for
me.  should i really be deciding if it has progressed?

also design decisions --- should i sort up or down by progress kw?
up makes more progressed more visible, but usually one puts more
progressed downward [e.g. doneish is toward bottom].  and
too ugly if they are unsorted, with mixed keywords.

so i thought, what if i could just have, say, started, and then, to
increment the counter, i change the keyword to itself, started.

i don't have the capacity to implement this, and i'm not sure it's
what i want, but maybe the change to itself idea is useful.


On 11/3/21, Uwe Brauer  wrote:
 "ESF" == Eric S Fraga  writes:
>
>> On Monday,  1 Nov 2021 at 20:53, Uwe Brauer wrote:
>>> (format "%s" (- 1 (string-to-number
>
>> Shouldn't this be the other way around, i.e.
>> (- (string-to-number ...) 1)
>> ?
>
> Oops you are right, thanks
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html



Re: [BUG] Unregistered buffer modifications detected [9.5 (9.5-g49e2f6 @ /Users/myuser/.emacs.d/straight/29/straight/build/org/)]

2021-11-03 Thread Aaron Jensen
On Wed, Nov 3, 2021 at 10:30 AM Aaron Jensen  wrote:
>
> On Wed, Nov 3, 2021 at 7:43 AM Ihor Radchenko  wrote:
> >
> > Aaron Jensen  writes:
> >
> > > Here is a backtrace. The package it mentions is my own:
> > > https://github.com/aaronjensen/emacs-orgonomic and
> > > https://github.com/Somelauw/evil-org-mode is mentioned too.
> >
> > The mentions are ok. Backtrace should mention every command that
> > actually changes the buffer.
> >
> > > Unregistered buffer modifications detected. Resetting.
> > > ...
> > >  Backtrace:
> > > "  backtrace-to-string(nil)
> > >   org-element--cache-sync(#)
> > >   apply(org-element--cache-sync #)
> > >   timer-event-handler([t 0 0 59 nil org-element--cache-sync
> >
> > > Backtrace:
> > >   org-element-cache diagnostics(20211101-journal): Nothing to remove.
> > > No elements in cache after 361. Terminating.
> >
> > It looks like cache complete the synchronisation successfully, but some
> > command bypasses modification detection. Unfortunately, I cannot catch
> > the problematic command from backtrace. It acts "stealthily" for cache.
> > Is there a specific kind of edit sequence that you did right before the
> > warning appeared?
> >
> > Best,
> > Ihor
>
> I don't recall, but I'll view-lossage next time it happens.

I got a warning when I did an org-agenda-todo to mark something as done.

https://gist.github.com/aaronjensen/163913c0937376c9699eaa71eaa0959a

No idea if it's related, but after a refile I save all org buffers eventually

(defvar aj/org-save-all-timer nil)
(defun aj/org-save-all-org-buffers-eventually ( _)
  (when aj/org-save-all-timer
(cancel-timer aj/org-save-all-timer))
  (setq aj/org-save-all-timer
(run-with-idle-timer 2 nil 'org-save-all-org-buffers)))

(use-feature org
  :config
  (advice-add 'org-refile :after 'aj/org-save-all-org-buffers-eventually)
  (advice-add 'org-schedule :after 'aj/org-save-all-org-buffers-eventually)
  (add-hook 'org-trigger-hook 'aj/org-save-all-org-buffers-eventually))

(use-feature org-agenda
  :config
  (advice-add 'org-agenda-quit :before 'aj/org-save-all-org-buffers-eventually)
  (advice-add 'org-agenda-todo :after 'aj/org-save-all-org-buffers-eventually)
  (advice-add 'org-agenda-deadline :after
'aj/org-save-all-org-buffers-eventually)
  (advice-add 'org-agenda-schedule :after
'aj/org-save-all-org-buffers-eventually)
  (advice-add 'org-agenda-refile :after
'aj/org-save-all-org-buffers-eventually))



typescript from org src buffer -- tide, lsp

2021-11-03 Thread Greg Minshall
hi.

i'm wondering if anyone programming in typescript might have run into,
and solved, this "problem", of tangling into a subdirectory, and tide
[1] not being able to resolve "relative" imports.

i have a file in path /a/b/foo.org.  it includes various source blocks,
and they do things like `:tangle c/d/bar.ts`.  another source block,
tangled into in c/d/fubar.ts, say, does something like:

import Bar from "./bar"


when i open an Org Src edit buffer from fubar.ts's source block, with
tide mode [1] enabled, i get a complaint

Cannot find module './bar' or its corresponding type declarations. [2307]

tide (or, really, iiuc, tsserver) appears to be, reasonably, looking for
/a/b/bar.ts, and not finding it.  but, i haven't been able to figure out
how to talk tide into looking elsewhere.

i've done things like add "rootDirs" to `tsconfig.json`, to no avail.  i
haven't been able to get lsp-mode [2] to work for this scenario, either.

anyway, in case anyone has done exactly that, i'm asking.

cheers, Greg

[1] tide: https://github.com/ananthakumaran/tide
[2] lsp:  https://github.com/emacs-lsp/lsp-mode/


ps -- scrounging around trying to deal with this, i stumbled on

https://github.com/justbur/emacs-which-key

which i find a treat.



[QUESTION] How to generate org-agenda view for clocked tasks and logs etc which are sorted by timestamps?

2021-11-03 Thread stardiviner
How to use elisp code to generate an org-agenda view for clocked tasks and
logs etc which are sorted by timestamps? I want to view my daily done tasks
and attach them as part of diary (maybe use org source block elisp code to
generate output?)

So how to setup `org-agenda-custom-commands` to archive this purpose?

Thanks for your help in advance. Regards.


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


Re: org-diary

2021-11-03 Thread Eric S Fraga
On Wednesday,  3 Nov 2021 at 06:43, Colin Baxter  wrote:
> I have this
>
> #+begin_src elisp
> &%%(org-diary :deadline* :timestamp :scheduled*)
> #+end_src

I cannot help you directly but I do note that my equivalent entry in my
Emacs diary file is subtly different:

%%(org-diary :scheduled :timestamp) ~/s/notes/diary.org

No &, no *s, and a file name at the end.  Having said this, I must admit
that I cannot find any documentation on the format of this line in the
info manual.  Maybe it's hiding...

-- 
: Eric S Fraga via Emacs 28.0.60, Org release_9.5-192-gd4e192
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Re: org-diary

2021-11-03 Thread Colin Baxter 
> Eric S Fraga  writes:

> On Wednesday,  3 Nov 2021 at 06:43, Colin Baxter  wrote:
>> I have this
>> 
>> #+begin_src elisp &%%(org-diary :deadline* :timestamp
>> :scheduled*) #+end_src

> I cannot help you directly but I do note that my equivalent entry
> in my Emacs diary file is subtly different:

> %%(org-diary :scheduled :timestamp) ~/s/notes/diary.org

> No &, no *s, and a file name at the end.  Having said this, I must
> admit that I cannot find any documentation on the format of this
> line in the info manual.  Maybe it's hiding...

Thanks Eric. You have reminded me about the file name. I don't have a
file name at the end because I want all my 5 agenda files searched.
However, by entering each file in turn I can now identify the particular
agenda file that's causing the warning. I don't see anything immediately
wrong with it, but it contains multiple schedules with + and - days. I
suspect the problems lies somewhere there.

Thanks again - a great post that jogged my memory.

Best wishes, Colin.



org-diary

2021-11-03 Thread Colin Baxter 
Hello,

I have this

#+begin_src elisp
&%%(org-diary :deadline* :timestamp :scheduled*)
#+end_src

at line 9 in my main diary file ~/.emacs.d/diary/main. It worked well up
until recently (a week or so, I think). Now I get the following warning:

--8<---cut here---start->8---
Error (diary): Bad diary sexp at line 9 in ~/.emacs.d/diary/main:
(org-diary :deadline* :timestamp :scheduled*)
Error: (search-failed 
"\\]+[0-9]\\{1,2\\}:[0-9]\\{2\\}[0-9+:hdwmy/   .-]*\\)>")
--8<---cut here---end--->8---

There seems no obvious error in either the agenda or calendar displays
so I'd be grateful for suggestions as to where to look for the cause of
the warning.

Best wishes,

Colin Baxter.




Re: add automatically a counter to a header/TODO???

2021-11-03 Thread Uwe Brauer
>>> "ESF" == Eric S Fraga  writes:

> On Monday,  1 Nov 2021 at 20:53, Uwe Brauer wrote:
>> (format "%s" (- 1 (string-to-number

> Shouldn't this be the other way around, i.e.
> (- (string-to-number ...) 1)
> ?

Oops you are right, thanks


smime.p7s
Description: S/MIME cryptographic signature


transclusion, tangling, flycheck/flymake, etc.

2021-11-03 Thread Greg Minshall
Ihor,

(Noboru Ota -- i do find transclusion very interesting.)

> 2. A much faster tangle system. If we can directly transclude and sync
>contents of source blocks with actual programming language buffer,
>C-c ' can trivially support flycheck-mode and provide a more
>IDE-like experience while still benefiting from literate
>programming style.

in general, i would like to keep bits of my code in a single .org file,
maybe broken into separate source blocks, with preceding/succeeding
commentary.  then, pulled together in a tangle by a =:tangle= property
(within a subtree) and/or =<>= references.

my thought about flycheck, flymake, whatever, is that (optionally) a
silent, background, =tangle= and/or =<> expansion= would take
place to produce a "full source file buffer"[*], then the narrowed
version of that (corresponding to the part where =C-c '= was issued)
buffer is presented for the user's editing convenience.

your thought here, iiuc, is that source files would live in the file
system, and be transcluded into the .org file.  i can see the utility of
that.  but, i would miss =<>= and also the ability to break the
source code into small chunks for purposes of documentation.

obviously, the two approaches are not mutually exclusive.  but, partly
to make sure i understand your suggestion, i thought i'd mention it.

cheers, Greg

[*] in my scenario, i would find it convenient for the buffer the user
edits to have a file name, with the tangled file's extension; i have a
'package-in-waiting' which has to do some head standing to figure out
the appropriate language [parser] to send to a program =prettier=.

https://git.sr.ht/~minshall/prettied-diff