Re: Subject: [BUG] error when visit bibtex file link [9.5 (9.5-gd4e192 @ c:/Users/scott/.emacs.d/straight/build/org/)]
Scott Otterson writes: > When I type C-c o on a bibtex file link like this: > > [[file:energy.bib::Dubitzky07datMinGenBook][Dubitzky et al. 2007: > Fundamentals]] > > I get the error message shown below: > > === *Warnings* > > Warning (emacs): org-element--cache: Cache corruption detected in > energy.bib. Resetting. > The error was: (error "rx ‘repeat’ range error") I cannot reproduce. It looks like something is calling org-element-at-point inside bibtex buffer. Do you have any adviced Org functions? Also, if you update to latest main, the warning should provide more information for debugging. Best, Ihor
Re: Storing database credentials outside an org file
Aloha Mike, Mike Gauland writes: On 1/11/21 4:33 pm, Tim Cross wrote: Mike Gauland writes: I often use an org file to record database queries, using sql source blocks. I've been putting the database credentials in the file using header-args:sql properties, but I'd prefer to have the credentials saved in a separate file for security reasons. Any ideas on how I could make this work? It probably wouldn't be too hard to use the authinfo.gpg facility via the auth-source library which is included in Emacs. In fact, I think sql-mode might already have support for this built in. Thanks for the suggestion. I didn't see it on worg, but in ob-sql.el I found support for ":dbconnection". I can set up an entry in sql-connection-alist, and give the name of the entry to the sql block via :dbconnection. Now, my password is safely out of the .org file. As a bonus, it is easier to maintain across different org files. The Worg entry should be fixed now. Thanks for the report. All the best, Tom -- Thomas S. Dye https://tsdye.online/tsdye
Re: test-org-cite/main-affixes failure
Kyle Meyer writes: > Hmm, after ob-vala.el was removed from the repo, I believe I saw a > similar failure and needed to remove "vala" from the BTEST_OB_LANGUAGES > value in local.mk. Ah that was it! Oddly, my grep-fu couldn't catch it. Ah well. Thanks.
Re: test-org-cite/main-affixes failure
Nicolas Goaziou writes: > Kyle Meyer writes: [...] >> Does the current version of the test (no space) pass on your end? > > No idea. I haven't been able to run any test during the past week, at > least (due to a silly error about missing ob-vala). Hmm, after ob-vala.el was removed from the repo, I believe I saw a similar failure and needed to remove "vala" from the BTEST_OB_LANGUAGES value in local.mk. > Anyway, you're certainly right about the fix. You can push it. Okay, thanks for the confirmation. Pushed.
Re: test-org-cite/main-affixes failure
Hello, Kyle Meyer writes: > Hi Nicolas, > > test-org-cite/main-affixes, added in ad4028286 (oc: Refactor affixes > extraction, 2021-11-03), is failing on my end: > [...] > Adding a space to the expected SUFFIX (as in the diff below) makes the > test pass for me and looks to be consistent with some of the other cases > in that test. > > Does the current version of the test (no space) pass on your end? No idea. I haven't been able to run any test during the past week, at least (due to a silly error about missing ob-vala). I wrote these tests blind, secretly hoping I would not introduce a mistake like the one you're reporting. Anyway, you're certainly right about the fix. You can push it. Thank you. Regards, -- Nicolas Goaziou
test-org-cite/main-affixes failure
Hi Nicolas, test-org-cite/main-affixes, added in ad4028286 (oc: Refactor affixes extraction, 2021-11-03), is failing on my end: $ BTEST_RE=main-affixes make test-dirty [...] Test test-org-cite/main-affixes condition: (ert-test-failed ((should (equal '... (org-test-with-temp-text "[cite:@key1 post1;@key2 post2; global post]" ...))) :form (equal (nil "global post") (nil #(" global post" 0 12 ...))) :value nil :explanation (list-elt 1 (arrays-of-different-length 11 12 "global post" #(" global post" 0 12 ...) first-mismatch-at 0 FAILED 1/1 test-org-cite/main-affixes (0.009342 sec) [...] Adding a space to the expected SUFFIX (as in the diff below) makes the test pass for me and looks to be consistent with some of the other cases in that test. Does the current version of the test (no space) pass on your end? diff --git a/testing/lisp/test-oc.el b/testing/lisp/test-oc.el index c700780fe..896870303 100644 --- a/testing/lisp/test-oc.el +++ b/testing/lisp/test-oc.el @@ -286,7 +286,7 @@ (ert-deftest test-org-cite/main-affixes () (org-test-with-temp-text "[cite:global pre;pre1 @key1;pre2 @key2]" (org-cite-main-affixes (org-element-context) (should - (equal '(nil . ("global post")) + (equal '(nil . (" global post")) (org-test-with-temp-text "[cite:@key1 post1;@key2 post2; global post]" (org-cite-main-affixes (org-element-context))
Re: typescript from org src buffer -- tide, lsp
Tim and Samuel, thanks. :dir is a thought; and, links may yield treasures. cheers, Greg
Re: Introducing Org-transclusion
>>> "NO" == Noboru Ota writes: > Ihor Radchenko writes: >> org-transclusion uses with-silent-modifications >> macro, which prevents org-element-cache from working properly. I >> recommend dropping with-silent-modifications or at least using >> combine-after-change-calls. > Thank you for this information; I had no idea. Let me look into it. Ok, then I don't need to run the check I did run the check with the official org release and did *not* run into any problem, so I presume it what Ihor says, the recent dev version. Uwe smime.p7s Description: S/MIME cryptographic signature
Re: typescript from org src buffer -- tide, lsp
Cool topic, but I haven't done it myself either as most explanations are pretty big-brained in the sense that its a little hard for a beginner to figure out sometimes. However, the power of literate programming is super cool, so here's a few links I found that you can go through that might help you out: https://www.reddit.com/r/emacs/comments/a3rlvk/orgmode_literate_programming_and_emacs/ https://emacs-lsp.github.io/lsp-mode/manual-language-docs/lsp-org/ https://blog.thomasheartman.com/posts/configuring-emacs-with-org-mode-and-literate-programming http://cachestocaches.com/2018/6/org-literate-programming/ Hope it helps, Sam On Sat, Nov 6, 2021, at 6:33 AM, Tim Cross wrote: > > Greg Minshall writes: > > > 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. > > > > I've not tried to do this, but a complete shot in the dark > > according to the org manual, you can set a :dir value in the source > block header which will specify the working directory to be used i.e. > the directory where the code will be evaluated. Perhaps setting that to > the directory where the other block has tangled the output would work? > > See the Environment of a code block node under the working with source > code node in the org manual for details. > >
Re: Introducing Org-transclusion
Ihor Radchenko writes: > org-transclusion uses with-silent-modifications > macro, which prevents org-element-cache from working properly. I > recommend dropping with-silent-modifications or at least using > combine-after-change-calls. Thank you for this information; I had no idea. Let me look into it. Noboru
Re: Introducing Org-transclusion
Noboru Ota writes: > I cannot follow the exchange there but you might be able to and give me > advice. Isn't it realted to a development branch or some working commit > of Org? > > I use the 9.5 release from ELPA, which I believe is what people call a > stable version? The problem is on development version. It is related to latest changes to org-element-cache (previously, cache would fail terribly instead of showing the warning). Org must keep track of changes in buffer to maintain element cache. org-transclusion uses with-silent-modifications macro, which prevents org-element-cache from working properly. I recommend dropping with-silent-modifications or at least using combine-after-change-calls. Best, Ihor
Re: Introducing Org-transclusion
> I cannot reproduce the problem (I have never seen this warming myself) > and I have a feeling that it is the same issue as being discussed in > this recent thread in this mailing list (?) Ok thanks for your feedback, I will repeat what I did using emacs -Q (in which case the default org version is used) 1. Loading your package and repeat the steps 2. That doing the same but loading the org version based on git master from last week I then might send a bug report. > https://list.orgmode.org/m2bl36sfrw@gmail.com/ Thanks for pointing this out to me. I will keep you and others updated. Uwe smime.p7s Description: S/MIME cryptographic signature
Re: [patch] ox-latex.el: add `:options' LaTeX attribute to tables
Hello, Juan Manuel Macías writes: > Attached here the updated patch. Applied. Thank you. I added two spaces between sentences in org-manual.org. Regards, -- Nicolas Goaziou
Re: Bug: org-store-link uses CUSTOM_ID instead of target point [9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/)]
On 06/05/2021 19:41, Bastien wrote: Fr Ml writes: I have a problem with the function org-store-link it doesn't work as described in the documentation: https://orgmode.org/manual/Handling-Links.html "For Org files, if there is a '<>' at point, the link points to the target." Fixed in maint, thanks a lot for reporting this and Ihor for confirming the bug. Bastien, unfortunately your fix caused duplication of stored links like "file:~/org/file.org::#custom_id" when point is outside of <>. Earlier #CUSTOM_ID link was stored in addition to "file:~/org/file.org::*Heading" search link. My suggestion is to revert your patch and to just reset custom-id variable when <> link is stored. Another effect or your patch, that I consider unintentional, is storing [[file:~/org/file.org::#custom_id][file:~/org/file.org::#custom_id]] instead of [[file:~/org/file.org::#custom_id][Heading]]. I prefer "original" behavior. Third patch is intended to avoid links inserted as [[target][file:~/org/file.org::target]] in the case of same file. I suppose, just [[target]] is better. Current variant looks unbalanced and misleading. Of course, you are free to skip last patch. I am confused by `org-insert-link' behavior. It inserts links like [[file:~/org/file.org::#custom_id][file:~/org/file.org::#custom_id]] without user prompt for description but [[file:~/org/file.org::#custom_id][Heading]] requires to confirm "Heading" description explicitly. I would expect that "raw" link is subject to ask user for more friendly option. >From 28f1d331888ebd22d60343bb06d3b307aff9fc93 Mon Sep 17 00:00:00 2001 From: Max Nikulin Date: Fri, 5 Nov 2021 19:03:59 +0700 Subject: [PATCH 1/3] Revert "lisp/ol.el: Fix bug when storing links" This reverts commit b4b35fc92d6ea8eb2ac061b8ccf026e9b4ebfe33. Avoid duplication of CUSTOM_ID links. --- lisp/ol.el | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/lisp/ol.el b/lisp/ol.el index aa1849715..6fe50ed60 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -1613,8 +1613,9 @@ non-nil." ((and (buffer-file-name (buffer-base-buffer)) (derived-mode-p 'org-mode)) (org-with-limited-levels - (cond - ;; Store a link using the target at point. + (setq custom-id (org-entry-get nil "CUSTOM_ID")) + (cond + ;; Store a link using the target at point ((org-in-regexp "[^<]<<\\([^<>]+\\)>>[^>]" 1) (setq cpltxt (concat "file:" @@ -1622,15 +1623,6 @@ non-nil." (buffer-file-name (buffer-base-buffer))) "::" (match-string 1)) link cpltxt)) - ;; Store a link using the CUSTOM_ID property. - ((setq custom-id (org-entry-get nil "CUSTOM_ID")) - (setq cpltxt - (concat "file:" - (abbreviate-file-name - (buffer-file-name (buffer-base-buffer))) - "::#" custom-id) - link cpltxt)) - ;; Store a link using (and perhaps creating) the ID property. ((and (featurep 'org-id) (or (eq org-id-link-to-org-use-id t) (and interactive? @@ -1639,13 +1631,14 @@ non-nil." 'create-if-interactive-and-no-custom-id) (not custom-id (and org-id-link-to-org-use-id (org-entry-get nil "ID" + ;; Store a link using the ID at point (setq link (condition-case nil (prog1 (org-id-store-link) (setq desc (or (plist-get org-store-link-plist :description) ""))) (error - ;; Probably before first headline, link only to file. + ;; Probably before first headline, link only to file (concat "file:" (abbreviate-file-name (buffer-file-name (buffer-base-buffer -- 2.25.1 >From 1fb5a5e071141e47d551202eeca5776185ca8461 Mon Sep 17 00:00:00 2001 From: Max Nikulin Date: Fri, 5 Nov 2021 19:49:23 +0700 Subject: [PATCH 2/3] ol.el: Skip #CUSTOM_ID when <> link is stored * list/ol.el (org-store-link): Suppress storing of "file:file.org::#custom_id" link when point is <>. CUSTOM_ID link is stored as additional option, so new chunk of code introduced by b4b35fc92 is not necessary. It prevented adding of "file:file.org::*Heading" link and caused duplication of "file:file.org::#custom_id" link. Reported-by: Fr Ml Link: https://orgmode.org/list/aadb23f3-c0fe-19aa-be79-50e51d16c...@t-online.de/ --- lisp/ol.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/ol.el b/lisp/ol.el index 6fe50ed60..5e1f1f2d2 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -1622,7 +1622,9 @@ non-nil." (abbreviate-file-name (buffer-file-name (buffer-base-buffer))) "::" (match-string 1)) - link cpltxt)) + link cpltxt + ;; Do not append #CUSTOM_ID link below. + custom-id nil)) ((and (featurep 'org-id) (or (eq org-id-link-to-org-use-id t) (and interactive? -- 2.25.1 >From f307c7059744b28b26f5c3b8dd4a0f563b22e586 Mon Sep 17 00:00:00 2001 From: Max Nikulin Date: Sat, 6 Nov 2021 18:23:25 +0700 Subject: [PATCH 3/3] ol.el: Avoid links like
Re: [BUG] Elisp error when exporting citation [9.5 (release_9.5-104-g2b1fc6 @ /home/quintus/.emacs.d/org-mode/lisp/)]
Am Samstag, dem 06. November 2021 schrieb András Simonyi: > I've pushed a change to citeproc-el which should solve that problem -- > thanks for reporting it. Thank you again! It works now properly. -quintus -- Dipl.-Jur. M. Gülker | https://mg.guelker.eu | PGP: Siehe Webseite Passau, Deutschland | kont...@guelker.eu| O<
Re: Introducing Org-transclusion
Tim Cross writes: > thank you for making such a valuable contribution. I think your package > will be a valuable addition and it is great you have gone that extra > distance to sign the FSF copyright paperwork and are willing to do the > work to add it into ELPA. > > I'm not 100% certain, but I think there is some information in the ELPA > git repository on how to setup and contribute a package to ELPA. Further > guidance can also be gained by asking on the emacs-devel mail list. Thank you for your kind words and encouragement. This page on EmacsWiki had a good instruction (https://www.emacswiki.org/emacs/ELPA). I have just created my account on GNU Savannah and sent a request in the emacs-devel mail list for inclusion to emacs gropu for ELPA contribution. I am hoping to hear from them soon. Thanks again. Noboru
Re: transclusion, tangling, flycheck/flymake, etc.
Ihor Radchenko writes: > 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. This part of the discussion is beyond me; apologies for not being able to engage in a useful way. I don't consider myself a programmer so the use of Org-transclusion to achieve some elements of IDE (integrated development environment, I assume) experience is something I cannot fully address. As an attempt to clarify my original intent, this use from Greg is what I had in mind: "source files would live in the file system, and be transcluded into the .org file". This lets the technical writer (for example) "break the source code into small chunks for purposes of documentation." I have had a comment from a user that that's exactly this person is doing. So the direction is *from* the source file *to* an org file. What Ihor seems to be suggesting is the other direction: *from* an org file *to* a (temporary) source file. I do not think the latter is possible with the current state of Org-transclusion. Noboru
Re: Introducing Org-transclusion
Ihor Radchenko writes: > I noticed that you are using overlays in text-clone. It may potentially > cause slowdown in large Org buffers. Of course, it does not mean that > org-transclusion should not be accepted. Just something that may be > optimised. Karl Voit (GitHub user name, novoid) gave me a comment in a similar vein regarding potential performance issues as follows: > As far as I understood: when you do have many overlays in deeply nested > headings that are collapsed and you scroll over the lines with the collapsed > headings, Emacs needs to handle those overlays and therefore is not able to > perform a simple line change without issues. Source: https://github.com/nobiot/org-transclusion/issues/42#issuecomment-739570395 I personally have never come across such performance issue. Are you aware of some good test file or something to let other people reproduce it? For now, I am inclined to keeping the use of overlays as is. It's partially because of my psychological inertia and partially because text-clone makes uses of overlay's properties: - "Evaporate" property to take care of when to finish text-clone - Yanking does not copy overlay properties to avoid accidental cloning If performance issues become more prevalent and it's something I can address within my skill set, I will be happy to review the use of overlays, of course.
Re: typescript from org src buffer -- tide, lsp
Greg Minshall writes: > 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. > I've not tried to do this, but a complete shot in the dark according to the org manual, you can set a :dir value in the source block header which will specify the working directory to be used i.e. the directory where the code will be evaluated. Perhaps setting that to the directory where the other block has tangled the output would work? See the Environment of a code block node under the working with source code node in the org manual for details.
Re: Introducing Org-transclusion
Noboru Ota writes: > Timothy writes: >> Hi Tim, >> > >>> I feel it is functionality which will be used by a subset of users >>> or by others only occasionally. > > Tim, thank you for your feedback. > Timothy, thank you for forwarding Tim's feedback into the loop. > > I think this assessment is fair and reflects the current usage from the > feedback I get. > >>> WRT making this part of org-mode core, I’m not in favour. This is no >>> reflection on the package, which I think is a great addition to the org >>> ecosystem. My preference would be for this package to be an add-on >>> package in either ELPA or non-GNU ELPA. > > I will take this as the guidance and pursue ELPA as my first option. I > have just signed and returned the FSF copyright assignment form. > > Now I will need to go and learn how to add a package to ELPA. > > Thank you. > Noboru Noboru, thank you for making such a valuable contribution. I think your package will be a valuable addition and it is great you have gone that extra distance to sign the FSF copyright paperwork and are willing to do the work to add it into ELPA. I'm not 100% certain, but I think there is some information in the ELPA git repository on how to setup and contribute a package to ELPA. Further guidance can also be gained by asking on the emacs-devel mail list.
Re: Introducing Org-transclusion
Timothy writes: > Hi Tim, > >> I feel it is functionality which will be used by a subset of users >> or by others only occasionally. Tim, thank you for your feedback. Timothy, thank you for forwarding Tim's feedback into the loop. I think this assessment is fair and reflects the current usage from the feedback I get. >> WRT making this part of org-mode core, I’m not in favour. This is no >> reflection on the package, which I think is a great addition to the org >> ecosystem. My preference would be for this package to be an add-on >> package in either ELPA or non-GNU ELPA. I will take this as the guidance and pursue ELPA as my first option. I have just signed and returned the FSF copyright assignment form. Now I will need to go and learn how to add a package to ELPA. Thank you. Noboru
org-tag-persistent-alist AND per-file dynamic tags
Greetings to all, Reading the manual about setting glopal/per-file tags [1], I wonder if it is possible to use org-tag-persistent-alist AND per-file dynamic tags. When using org-set-tags-command, I’d like to select from a list comprising both: 1. the list of predefined tags in org-tag-persistent-alist 2. the list of all the tags that are already in use in the current buffer (some of which might not be in the persistent alist). I don’t want to use the #+TAGS keyword at file-level, just the list of tags already attached to some headline in the buffer. The manual says: > If you have globally defined your preferred set of tags using the > variable org-tag-alist, but would like to use a dynamic tag list in > a specific file, add an empty ‘TAGS’ keyword to that file And then it says: > If you have a preferred set of tags that you would like to use in every > file, in addition to those defined on a per-file basis by ‘TAGS’ > keyword, then you may specify a list of tags with the variable > org-tag-persistent-alist. I tried to combine both behaviors by putting an empty ’TAGS’ keyword at the top of my file. But this still only gives me the tags in org-tag-persistent-alist. What would be the best way to add to it for completion the tags already used in the buffer? Regards, Victor Footnotes: [1] https://orgmode.org/manual/Setting-Tags.html
Re: [BUG] Elisp error when exporting citation [9.5 (release_9.5-104-g2b1fc6 @ /home/quintus/.emacs.d/org-mode/lisp/)]
Dear All, On Thu, 4 Nov 2021 at 20:26, M. ‘quintus’ Gülker wrote: > The improper formatting on LaTeX export I mentioned in the other e-mail[1] > however is still persisting, > both with the @ and without it. I've pushed a change to citeproc-el which should solve that problem -- thanks for reporting it. best wishes, András