Re: Flyspell causes severe slowdown when manipulating footnotes

2022-12-12 Thread arozbiz
Happy to. What is the best way to temporarily downgrade to 9.5.5? I install
Emacs through this  Arch AUR
package, which installs the latest version of Org automatically.

Best,
Alan

On Mon, Dec 12, 2022 at 3:32 AM Ihor Radchenko  wrote:

> aroz...@gmail.com writes:
>
> > Thanks. It definitely helps, but it's still quite slow. What's made the
> > biggest difference is is advising the relevant functions to turn flyspell
> > off beforehand and then turn it back on.
>
> Sure, but it is not going to help others.
>
> Could you try to produce the profile using Org 9.5.5 and Org 9.6?
> I am wondering if there is anything in Org 9.6 that is slowed compared
> to Org 9.5.5.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Re: Flyspell causes severe slowdown when manipulating footnotes

2022-12-11 Thread arozbiz
Thanks. It definitely helps, but it's still quite slow. What's made the
biggest difference is is advising the relevant functions to turn flyspell
off beforehand and then turn it back on.

```
(defun azr/org-footnote-disable-flyspell (orig-fun  args)
  (flyspell-mode -1)
  (apply orig-fun args)
  (flyspell-mode))

(advice-add 'org-footnote-new :around #'azr/org-footnote-disable-flyspell)
(advice-add 'org-footnote-delete :around
#'azr/org-footnote-disable-flyspell)
```

Best,
Alan

On Sat, Dec 10, 2022 at 4:24 AM Ihor Radchenko  wrote:

> aroz...@gmail.com writes:
>
> > Thanks Ihor for the response. Unfortunately, setting
> > org-element--cache-self-verify to nil didn't work. Profile report
> attached.
>
> Thanks!
> I just pushed a slight optimization to the footnote sorting code.
> Can you try again using the latest main?
>
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=169333e1c
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Can org-attach attach a single file to multiple headlines?

2022-12-10 Thread arozbiz
Using org-attach, is it possible to attach a single file to multiple
headlines, so that each headline shares the same attachment folder (rather
than having each headline have its own attachment folder with its own
version of the file)?

Thanks,
Alan


Re: Flyspell causes severe slowdown when manipulating footnotes

2022-12-08 Thread arozbiz
Thanks Ihor for the response. Unfortunately, setting
org-element--cache-self-verify to nil didn't work. Profile report attached.

On Wed, Dec 7, 2022 at 7:23 AM Ihor Radchenko  wrote:

> aroz...@gmail.com writes:
>
> > I just upgraded to Org 9.6 and I've noticed that having flyspell-mode
> > turned on causes very large slowdowns when adding or deleting footnotes
> in
> > an org file with lots of footnotes (e.g., more than 200, which is common
> > for the academic articles that I use org for). Any ideas for what might
> be
> > causing this?
>
> Most likely cache updates.
> Could you please (1) Set org-element--cache-self-verify to nil and see
> if things get back to normal; (2) If things are still slow after setting
> the variable, please run M-x profiler-start ... M-x profiler-report and
> share the data. See https://orgmode.org/list/87ee2nlslt.fsf@localhost.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>

[profiler-profile "28.1" cpu #s(hash-table size 217 test equal rehash-size 1.5 
rehash-threshold 0.8125 data ([nil nil nil nil nil nil nil nil nil nil nil nil 
nil nil nil nil] 37 [if "#" funcall let wc-count 
let* wc-mode-update setq progn if when "#" apply 
timer-event-handler nil nil] 131 ["#" funcall let 
wc-count let* wc-mode-update setq progn if when "#" apply 
timer-event-handler nil nil nil] 3 ["#" nil nil 
nil nil nil nil nil nil nil nil nil nil nil nil nil] 3 [file-truename 
file-truename file-truename file-truename org-roam-descendant-of-p 
org-roam-file-p org-roam-buffer-p if let azr/tab-bar-tab-name-current 
tab-bar-tabs tab-bar--current-tab-index doom-modeline-segment--workspace-name 
eval redisplay_internal\ \(C\ function\) nil] 3 [file-truename file-truename 
org-roam-descendant-of-p org-roam-file-p org-roam-buffer-p if let 
azr/tab-bar-tab-name-current tab-bar-tabs tab-bar--current-tab-find 
tab-bar--current-tab doom-modeline-segment--workspace-name eval 
redisplay_internal\ \(C\ function\) nil nil] 4 [file-relative-name 
org-roam-file-p org-roam-buffer-p if let azr/tab-bar-tab-name-current 
tab-bar-tabs tab-bar--current-tab-index doom-modeline-segment--workspace-name 
eval redisplay_internal\ \(C\ function\) nil nil nil nil nil] 3 
[doom-modeline-format--main eval redisplay_internal\ \(C\ function\) nil nil 
nil nil nil nil nil nil nil nil nil nil nil] 5 [org-roam-descendant-of-p 
org-roam-file-p org-roam-buffer-p if let azr/tab-bar-tab-name-current 
tab-bar--current-tab-make tab-bar--current-tab 
doom-modeline-segment--workspace-name eval redisplay_internal\ \(C\ function\) 
nil nil nil nil nil] 3 [org-roam-file-p org-roam-buffer-p if let 
azr/tab-bar-tab-name-current tab-bar--current-tab-make tab-bar--current-tab 
doom-modeline-segment--workspace-name eval redisplay_internal\ \(C\ function\) 
nil nil nil nil nil nil] 3 [org-roam-descendant-of-p org-roam-file-p 
org-roam-buffer-p if let azr/tab-bar-tab-name-current tab-bar-tabs 
tab-bar--current-tab-index doom-modeline-segment--workspace-name eval 
redisplay_internal\ \(C\ function\) nil nil nil nil nil] 3 
[org-roam-descendant-of-p org-roam-file-p org-roam-buffer-p if let 
azr/tab-bar-tab-name-current tab-bar-tabs tab-bar--current-tab-find 
tab-bar--current-tab doom-modeline-segment--workspace-name eval 
redisplay_internal\ \(C\ function\) nil nil nil nil] 3 ["#" org-element--parse-to org-element-at-point 
org-element-context org-footnote-action funcall-interactively command-execute 
nil nil nil nil nil nil nil nil nil] 4 [org-element-entity-parser 
org-element--object-lex org-element-context org-footnote-all-labels 
org-footnote-new org-footnote-action funcall-interactively command-execute nil 
nil nil nil nil nil nil nil] 4 [org-element-context org-footnote-all-labels 
org-footnote-new org-footnote-action funcall-interactively command-execute nil 
nil nil nil nil nil nil nil nil nil] 54 [org-footnote-new org-footnote-action 
funcall-interactively command-execute nil nil nil nil nil nil nil nil nil nil 
nil nil] 3 [rx--every rx--translate-or rx--translate-form rx--translate 
rx--translate-seq rx--translate-form rx--translate rx-to-string 
org-element--parse-generic-emphasis org-element-italic-parser 
org-element--object-lex org-element-context org-footnote-all-labels 
org-footnote-new org-footnote-action funcall-interactively] 3 
[org-element-at-point org-element-context org-footnote-all-labels 
org-footnote-new org-footnote-action funcall-interactively command-execute nil 
nil nil nil nil nil nil nil nil] 6 [org-element-footnote-reference-parser 
org-element--object-lex org-element-context org-footnote-all-labels 
org-footnote-new org-footnote-action funcall-interactively command-execute nil 
nil nil nil nil nil nil nil] 3 [font-lock-extend-jit-lock-region-after-change 
jit-lock-after-change org-footnote-new org-footnote-action 

Flyspell causes severe slowdown when manipulating footnotes

2022-12-05 Thread arozbiz
I just upgraded to Org 9.6 and I've noticed that having flyspell-mode
turned on causes very large slowdowns when adding or deleting footnotes in
an org file with lots of footnotes (e.g., more than 200, which is common
for the academic articles that I use org for). Any ideas for what might be
causing this?

Alan


Remove file to original state after org-capture-kill?

2021-04-14 Thread arozbiz
I have an org-capture template that looks like this:

'(("j" "Journal"
  entry (file+headline find-file-function "Journal")
  "* %?")

(I create separate Org files for each day, which the find-file-function
returns the path for.)

If I call org-capture "j" on a file that doesn't have a "Journal" headline,
it will create one for me (the desired behavior). But if I abort the
org-capture the "Journal" headline will not be deleted. Is there a way to
change this? I.e., I would like, after I call org-capture-kill, for the
file to return to the state it was before I called org-capture.

Thanks,
Alan


Re: How to combine two org files that each have footnotes?

2021-02-13 Thread arozbiz
Brilliant. Thank you both!

-Alan


How to combine two org files that each have footnotes?

2021-02-11 Thread arozbiz
Most of my writing is academic and involves lots of footnotes. Sometimes it
is useful to be able to combine two separate files, each of which have
footnotes. How do I do so in a way that automatically renumbers the
footnotes in the file that comes second?

More specifically, I have file1.org and file2.org, and each of them have
three footnotes ([fn:1], [fn:2], and [fn:3]). I want to create file3.org,
which simply merges file1.org and file2.org, with the contents of file2.org
coming after the contents of file1.org. The problem is that the footnote
calls ([fn:#]) in the file2 section will end up pointing the file1
footnotes. What I really want is to automatically renumber all the
footnotes [fn:1]...[fn:6], but I don't know how to do this, given that org
permits multiple footnote calls to the same footnote.

Thanks,
Alan


How to open ID links in a new window?

2021-01-23 Thread arozbiz
I would like to open ID links [[id:...]] in a new window. I can make file
links [[file:...]] open in a new window by running (add-to-list
'org-link-frame-setup '(file . find-file-other-window)), but this doesn't
seem to affect the behavior of ID links.

Thanks,
Alan


Re: How can I keep Org-id links from breaking when moving files?

2021-01-20 Thread arozbiz
This is helpful clarification, thank you. But does that mean that, if I
change the directory where some files with UUIDs are located, there's no
way to programmatically make sure that Org can find those IDs again (since
there's no way to simply add a folder, rather than a list of files, to
=org-id-locations= or  =org-id-files=?

Thanks,
Alan

On Wed, Jan 20, 2021 at 5:42 AM doltes  wrote:

>
> Yeah, I also found that confusing. Basically, because both mean the
> same.
>
> I think that a better description for those variables would be
>
> + =org-id-locations=: List obtained from `org-id-locations-file'. This
> list maps each ID to the file in which the definition occurs. It
> contains lists of the form (FILE ID).
>
> + =org-id-files=: List of files which contain ID definitions.
>


Re: Why are (UU)IDs limited to the headline level?

2021-01-19 Thread arozbiz
That was my thought as well.

On Mon, Jan 18, 2021 at 8:02 PM Ihor Radchenko  wrote:

> "Dr. Arne Babenhauserheide"  writes:
>
> > You can use <> to make it possible to link to any
> > place in a document.
>
> It does not work globally though. One cannot just put
> [[id:some-anchor-name]] link in other file.
>
> Best,
> Ihor
>
>


How can I keep Org-id links from breaking when moving files?

2021-01-18 Thread arozbiz
This question is in the context of using Org-id UUIDs for linking between
files. If I understand correctly, Org-id knows where to look for UUIDs
(generated by org-id-get-create) by looking at the org-id-locations
variable. But what if I move an .org file that I've generated a UUID into
another folder? I know I can run org-id-update-id-locations, and there's an
org-id-extra-files variable, but is there a way to list all the folders on
the system where Org-id should look for UUIDs?

Thanks,
Alan


Why are (UU)IDs limited to the headline level?

2021-01-17 Thread arozbiz
I'm just getting into Emacs/Org-Mode. It's clearly an amazing system and
the linking via UUID is very useful. My question is: why is linking by UUID
(and, more generally, the creation of properties drawers) limited to
headlines, and not to sub-elements like list elements or paragraphs?
Doesn't all the necessary structural information exist to assign UUIDs to
everything?

The reason I'm asking is that getting into Org-Roam, the linking for which
relies on Org UUIDs for headlines. If UUIDs were available for all elements
of an Org file, that will allow for more granular linking behavior.

Thanks,
Alan