[PATCH v2] org-contrib/babel/languages/ob-doc-plantuml.org: ASCII output
Document the new functionality of ob-plantuml to insert ASCII diagrams directly in the buffer. --- .../babel/languages/ob-doc-plantuml.org | 57 +++ 1 file changed, 46 insertions(+), 11 deletions(-) diff --git a/org-contrib/babel/languages/ob-doc-plantuml.org b/org-contrib/babel/languages/ob-doc-plantuml.org index ec347de4..4ae3ca31 100644 --- a/org-contrib/babel/languages/ob-doc-plantuml.org +++ b/org-contrib/babel/languages/ob-doc-plantuml.org @@ -49,18 +49,23 @@ Diagram images can be generated in PNG, SVG, and LaTeX formats. =PlantUML= is integrated with [[https://plantuml.com/running][a wide variety of software applications]]. Babel is a [[https://plantuml.com/emacs][standard way to use PlantUML in Emacs]]. * Requirements and Setup -=PlantUML= requires a working [[https://www.java.com/en/download/][Java]] installation and access to the -=plantuml.jar= component. A working [[https://graphviz.org/][GraphViz]] installation is required -for many diagrams. +=PlantUML= blocks can be executed in one of two ways, requiring either + +- a working [[https://www.java.com/en/download/][Java]] installation and access to the =plantuml.jar= component or +- the =plantuml= executable available from your distribution's package manager + +A working [[https://graphviz.org/][GraphViz]] installation is required for many diagrams. Emacs has [[https://github.com/skuro/plantuml-mode][plantuml-mode]], a major mode for editing PlantUML sources. There are detailed [[https://github.com/skuro/plantuml-mode#installation][installation instructions]], as well as instructions -for [[https://github.com/skuro/plantuml-mode#integration-with-org-mode][integration with Org]]. +for [[https://github.com/skuro/plantuml-mode#integration-with-org-mode][integration with Org]]. While [[https://melpa.org/#/plantuml-mode][plantuml-mode]] does allow use of a +remote server to render the diagram, please note that =ob-plantuml= does +not currently support this functionality. You will likely want to set the variables =plantuml-jar-path= and =org-plantuml-jar-path= with the path to your local installation of -=PlantUML=. Alternatively, set the variable -=plantuml-default-exec-mode= to access =PlantUML= non-locally. +=PlantUML=. Alternatively, set the variable =plantuml-default-exec-mode= +to =executable= to use your local =plantuml= executable. Activate evaluation of =PlantUML= source code blocks by adding =plantuml= to =org-babel-load-languages=. @@ -77,15 +82,22 @@ Activate evaluation of =PlantUML= source code blocks by adding ** Header Arguments =PlantUML= code blocks default to =:results file= and =:exports results=. -=PlantUML= has these language-specific header arguments and one requirement: - - file :: =PlantUML= code blocks require that an output file be specified +If you wish to export the =PlantUML= code block to a file, you must +specify a =:file= header argument. Alternatively, if you set =:results= +to a value other than =file=, such as =:results verbatim=, then the ASCII +=PlantUML= output will be inserted into the buffer below the code block. + +=PlantUML= has these language-specific header arguments: - cmdline :: specify [[https://plantuml.com/command-line][command line arguments]] for =PlantUML= - java :: arguments for the =java= runtimes (JRE) ** Sessions =PlantUML= does not support sessions. ** Result Types -A =PlantUML= code block returns a link to the file it generates. - +When the =:file= header argument has been specified, =PlantUML= code +blocks return a link to the generated file. Alternatively, if +=:results= is set to a value other than =file=, then the generated ASCII +diagram will be inserted into the buffer. + * Examples of Use :PROPERTIES: :header-args:plantuml: :eval no-export @@ -119,7 +131,7 @@ b -> c ,#+end_src #+end_example -HTML output of the =PlantUML= code block: +PNG output of the =PlantUML= code block: #+begin_src plantuml :file images/theme-uml.png :exports both !theme spacelab a -> b @@ -130,3 +142,26 @@ b -> c #+RESULTS: [[file:images/theme-uml.png]] +Here is an example of ASCII output inserted directly into the buffer. + +The =PlantUML= code block in the Org buffer: +#+begin_example +,#+begin_src plantuml :results verbatim +Bob -> Alice : Hello World! +,#+end_src +#+end_example + +ASCII output of the =PlantUML= code block: +#+begin_src plantuml :results verbatim +Bob -> Alice : Hello World! +#+end_src + +#+RESULTS: +: ,---. ,-. +: |Bob| |Alice| +: `-+-' `--+--' +:| Hello World! | +:|-->| +: ,-+-. ,--+--. +: |Bob| |Alice| +: `---' `-' -- 2.37.0
Re: [PATCH] org-contrib/babel/languages/ob-doc-plantuml.org: ASCII output
You're right! Thank you for catching my mistake. I'll send another patch. Joseph Ihor Radchenko writes: > Joseph Turner writes: > >> Document the new functionality of ob-plantuml to insert ASCII diagrams >> directly in the buffer. > > Thanks! > >> -=PlantUML= requires a working >> [[https://www.java.com/en/download/][Java]] installation and access >> to the >> -=plantuml.jar= component. A working [[https://graphviz.org/][GraphViz]] >> installation is required >> -for many diagrams. >> +=PlantUML= blocks can be executed in one of three ways, requiring either >> + >> +- a working [[https://www.java.com/en/download/][Java]] >> installation and access to the =plantuml.jar= component or >> +- the =plantuml= executable available from your distribution's package >> manager or >> +- a connection to a remote >> [[https://github.com/plantuml/plantuml-server][PlantUML server]] > > I do not think that ob-plantuml.el supports server connections. We may > need to clarify that server part and plantuml-* variables have nothing > to do with ob-plantuml per se. > > Otherwise, the patch looks good.
Re: Bug: Table does not align if there is non-breaking space [9.4.3 (9.4.3-elpa @ /home/data1/protected/.emacs.d/elpa/org-20201216/)]
Jean Louis writes: >> Could you please detail what you mean by does not align well? >> Your table looks fine on my side. > > See attached frameshot. > > I can see that it aligns well in `emacs -Q'. However no matter what > theme I tried in running Emacs I could not get it to align. Do you > know by what does that alignment depends? Then I could maybe remove > that dependency. It looks like you have some kind of minor mode that changes the display of non-breaking space. You may consider using https://github.com/Malabarba/elisp-bug-hunter to hunt down the cause. >> I do not know how to set the cell alignment individually without >> changing the whole column. > > Is there a way to insert total in the next table for the previous table? > > Then I could do something like this: > > > | Date | Description | Amount | > |+-+| > | 2022-08-14 | Something | 10 | > | 2022-08-14 | Someting| 20 | > |+-+| > > |--+---+---| > | <10> | | <6> | > | | TOTAL | X | > |--+---+---| > > Then I could do some formula to place total from first table in the second > table where is XXX? See [[info:org#References][org#References]], Remote references -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92
Re: Bug: Table does not align if there is non-breaking space [9.4.3 (9.4.3-elpa @ /home/data1/protected/.emacs.d/elpa/org-20201216/)]
* Ihor Radchenko [2022-08-13 14:47]: > Jean Louis writes: > > > > > > > | Date | Description | Expense | > > |+-+-| > > | 2022-08-12 | Buying store, PRN 2230001079059 | -5 | > > | 2022-08-12 | Mobile money agent | -2000 | > > | 2022-08-13 | | | > > |+-+-| > > || TOTAL | | > > > > I would actually like "TOTAL" to be right aligned, but instead I have > > tried inserting some non-breaking space before the word, and then > > table does not align well with it. My font is fixed width, so it > > should align correctly. > > Could you please detail what you mean by does not align well? > Your table looks fine on my side. See attached frameshot. I can see that it aligns well in `emacs -Q'. However no matter what theme I tried in running Emacs I could not get it to align. Do you know by what does that alignment depends? Then I could maybe remove that dependency. > I do not know how to set the cell alignment individually without > changing the whole column. Is there a way to insert total in the next table for the previous table? Then I could do something like this: | Date | Description | Amount | |+-+| | 2022-08-14 | Something | 10 | | 2022-08-14 | Someting| 20 | |+-+| |--+---+---| | <10> | | <6> | | | TOTAL | X | |--+---+---| Then I could do some formula to place total from first table in the second table where is XXX? -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/
[DONE] Re: [BUG] Latest org-fold-core API (overlays compatible code) caused error in package "consult-org-heading"
Ihor Radchenko writes: > "Christopher M. Miles" writes: > >> Here I attached the backtrace after I toggle-debug-on-error: >> >> Debugger entered--Lisp error: (wrong-type-argument listp #> to 77 in org-fold-core-test.org>) >> car(#) >> (let ((--mpom (car region))) (save-excursion (if (markerp --mpom) (progn >> (set-buffer >> (marker-buffer --mpom (save-excursion (save-restriction (widen) >> (goto-char (or --mpom >> (point))) (while (< (point) (cdr region)) (funcall >> org-fold-core-isearch-open-function (car >> region)) (goto-char (org-fold-core-next-visibility-change (point) (cdr >> region) >> 'ignore-hidden))) >> org-fold-core--isearch-show(#> org-fold-core-test.org>) >> consult--invisible-open-permanently() > > Thanks for reporting! > Fixed on main via 6cd7c6fb1. > https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=6cd7c6fb1cf6363f1057086760bed9875cdd97c7 Confirmed error fixed. Thanks for quick fixing. -- [ stardiviner ] I try to make every word tell the meaning that I want to express without misunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 signature.asc Description: PGP signature
Re: [PATCH v3] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)]
Max Nikulin writes: >> I do not think that it is a good idea. We currently promise to use the >> first function in the list to generate the IDs. Other functions are >> mostly a fallback to catch the existing attach dirs created in the past >> using different ID scheme. > > My idea is to add an extra check that filters out nil values. I do not > mind to signal a user error if first entry from > `org-attach-id-to-path-function-list' returns nil and paths returned by > other function do not exist. This would be possible, in addition to the patch above. Or do you mean the default ts/uuid format functions to return nil to short IDs as well? >> I guess that one option could be demanding a non-nil return value when >> generating a new attach dir (without TRY-ALL argument) and wrapping >> things into (ignore-errors ...) otherwise. > > I am against `ignore-errors' because it makes harder bug hunting using > debug on errors. Agreed. > I would prefer to force users to justify strategy for non-standard IDs > as early as possible. The goal is to avoid manual actions to change > directory structure when users have hundreds of folders. My experience > that users may easily face performance issues with ~1000 files per > directory. The reason is either lack of optimization for such case in > particular application or a bug introduced in a new version. I am not sure if we can solve this kind of issue reliably. The only idea is enforcing [1-9][0-9]\{5\} for ts IDs. And we cannot do much about IDs prefixed with the same constant string. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92
Re: how to beamer export overlay figure?
"Fraga, Eric" writes: >> Otherwise, looks good. > > Can you apply it please? Applied onto main via 3303a54d7 upcasing the beginning of comment and adding "." at the end. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=3303a54d74805cdd2b6eda37285f259949f7ba2e -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92
Re: [PATCH] ob-tangle.el: fix ‘:comments noweb’ double linking
Max Nikulin writes: >>> It looks like (string-prefix-p "file:" bare) but without the complex >>> regexp. I see, such code was used before. By the way, why it is "bare", >>> not e.g. "target"? >> >> match-end is used later in the code. Thus, string-match is justified. > > The matched string is always "file:", so there is no actual point in > `string-match'. It does not really matter however. > > (let ((params '((:tangle . "/home/user/file.el"))) >(type "file:") >(target "file:///dev/null")) >(if (and target > org-babel-tangle-use-relative-file-links > (string-prefix-p type target)) >(concat type > (file-relative-name > (substring target (length type)) > (file-name-directory (alist-get :tangle params > target)) > > In the code existed before and moved by the committed patch I do not > like that "then" branch of the `if' form uses side effect of evaluation > of the condition. Sounds reasonable. Could you make a patch? -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92
Re: [BUG] Latest org-fold-core API (overlays compatible code) caused error in package "consult-org-heading"
"Christopher M. Miles" writes: > Here I attached the backtrace after I toggle-debug-on-error: > > Debugger entered--Lisp error: (wrong-type-argument listp # 77 in org-fold-core-test.org>) > car(#) > (let ((--mpom (car region))) (save-excursion (if (markerp --mpom) (progn > (set-buffer (marker-buffer --mpom (save-excursion (save-restriction > (widen) (goto-char (or --mpom (point))) (while (< (point) (cdr region)) > (funcall org-fold-core-isearch-open-function (car region)) (goto-char > (org-fold-core-next-visibility-change (point) (cdr region) > 'ignore-hidden))) > org-fold-core--isearch-show(# org-fold-core-test.org>) > consult--invisible-open-permanently() Thanks for reporting! Fixed on main via 6cd7c6fb1. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=6cd7c6fb1cf6363f1057086760bed9875cdd97c7 -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92
Re: [BUG] Latest org-fold-core API (overlays compatible code) caused error in package "consult-org-heading"
"Christopher M. Miles" writes: > [[PGP Signed Part:Undecided]] > > I have this option settings: > > #+begin_src emacs-lisp > (setq org-element-use-cache nil) > (setq org-fold-core-style 'overlays) > (setq org-fold-catch-invisible-edits nil) > > (use-package consult > :ensure t > :bind (([remap org-goto] . consult-org-heading)) ; [C-c C-j] > :config (require 'consult-org)) > #+end_src > > > And here is the testing Org document: > > #+begin_src org > ,#+TITLE: test > > ,* headline main > > ,** Screenshots > > ,** folded? > > ,** new headline > > #+end_src > > Here I attached the backtrace after I toggle-debug-on-error: > > [6. application/emacs-lisp; org-fold-core-backtrace.elisp]... I forget to mention, currently I'm on commit "6ad65f333293". -- [ stardiviner ] I try to make every word tell the meaning that I want to express without misunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 signature.asc Description: PGP signature
[BUG] Latest org-fold-core API (overlays compatible code) caused error in package "consult-org-heading"
I have this option settings: #+begin_src emacs-lisp (setq org-element-use-cache nil) (setq org-fold-core-style 'overlays) (setq org-fold-catch-invisible-edits nil) (use-package consult :ensure t :bind (([remap org-goto] . consult-org-heading)) ; [C-c C-j] :config (require 'consult-org)) #+end_src And here is the testing Org document: #+begin_src org ,#+TITLE: test ,* headline main ,** Screenshots ,** folded? ,** new headline #+end_src Here I attached the backtrace after I toggle-debug-on-error: org-fold-core-backtrace.elisp Description: application/emacs-lisp -- [ stardiviner ] I try to make every word tell the meaning that I want to express without misunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 signature.asc Description: PGP signature
Re: [PATCH v3] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)]
On 13/08/2022 12:29, Ihor Radchenko wrote: Max Nikulin writes: I believe that interaction between `org-attach-dir-from-id' and members of `org-attach-id-to-path-function-list' could be improved. If a too short ID is passed to `org-attach-id-uuid-folder-format', `org-attach-id-ts-folder-format', or a user-defined function, they may return nil and `org-attach-dir-from-id' should try next element from the list. If nothing succeeds then a user error should be signaled demanding to implement a strategy to properly deal with peculiar IDs. I do not think that it is a good idea. We currently promise to use the first function in the list to generate the IDs. Other functions are mostly a fallback to catch the existing attach dirs created in the past using different ID scheme. My idea is to add an extra check that filters out nil values. I do not mind to signal a user error if first entry from `org-attach-id-to-path-function-list' returns nil and paths returned by other function do not exist. I guess that one option could be demanding a non-nil return value when generating a new attach dir (without TRY-ALL argument) and wrapping things into (ignore-errors ...) otherwise. I am against `ignore-errors' because it makes harder bug hunting using debug on errors. I would prefer to force users to justify strategy for non-standard IDs as early as possible. The goal is to avoid manual actions to change directory structure when users have hundreds of folders. My experience that users may easily face performance issues with ~1000 files per directory. The reason is either lack of optimization for such case in particular application or a bug introduced in a new version.
Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)]
On 12/08/2022 23:08, Janek F wrote: I use org-roam which creates links between org-files using the ID, and I would like to be able to manually add such links to common pages even if autocompletion doesn't work smoothly. Unfortunately I have not tried org-roam yet. My suggestion is to add CUSTOM_ID property in addition to ID. I admit that CUSTOM_ID may be inconvenient if a heading is moved from one file to another. Are there more problems with CUSTOM_ID links? Considering the other messages, let's not get lost in details, the default function does not need to consider all edge cases. It simply should not error out on ids in a different format. Janek, what is your expectation concerning directory structure for attachments in the case of customized ID values? You have not provided details concerning your configuration, but perhaps your issue may be solved by customizing `org-attach-id-to-path-function-list': keep `org-attach-id-uuid-folder-format' and drop `org-attach-id-ts-folder-format'. It should help unless you have single character IDs. I do not think Org behavior is ideal in your case. On the other hand the code was written with assumption that either UUID or timestamp-based IDs are used. It is violated by handcrafted IDs. I do not know the full story, but I guess, `org-attach-id-ts-folder-format' is present in default configuration for backward compatibility reasons. org-attach-id-ts-folder-format: Args out of range: "ftt", 0, 6 is an obscure error. However Org needs some hint from user how to handle such case.
Re: Maintaining oc-csl
Yes please; and thanks for volunteering! On Sat, Aug 13, 2022, 8:47 AM András Simonyi wrote: > Dear All, > > I'd like to volunteer to maintain oc-csl.el, which currently doesn't > have an official maintainer as far as I can tell. As the author and > maintainer of citeproc-el and the author of oc-csl's precursor, > citeproc-org, I think I'm reasonably well positioned to handle issues > and make improvements. > > thanks for your consideration & best wishes, > András > >
Re: Toggling select-enable-clipboard & select-enable-primary prevents org-copy-visible to work
Ihor Radchenko writes: > This is not normal, and I can reproduce the issue. > However, it does not look like Org is doing anything wrong. We call > kill-new with the correct value containing only visible part of the > buffer. > > I suggest you to file a bug report to Emacs itself using M-x report-emacs-bug > In the report, you can cite this email. After the relevant fix on Emacs side, we can solve the issue on Org side as long as Emacs 29 is being used. Fixed on main via edf46425b. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=edf46425bb0f78ca5f571de2761e94ad7caf7aab -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92
Re: [RFC PATCH] oc-csl: Add support for title, locators and bibentry styles
On Sat, Aug 13, 2022 at 8:30 AM András Simonyi wrote: > > Dear All, > > On Tue, 9 Aug 2022 at 17:38, Rudolf Adamkovič wrote: > > > THANK YOU for working on this! I have tried the "locators" style, and > > it works great. At last, we can write in the APA style with no hacks! > > thanks for your kind words, I'm glad that you find the additions useful. > > > P.S. Not a fan of using "ti" for the title. I would go for "T" for > > "Title", or "p" for "publication", or "s" for "subject", or something > > like that. > > interesting, it didn't occur to me that we could use capital letters > as well, certainly an alternative to consider. I'm not a fan; I think it would open a can-of-worms vis-a-vis the latex processors and commands. > Another solution could be to make the whole mapping customizable as > it's done, I think, in the case of the biblatex export processor. I actually think the case for this is weakest with the oc-csl processor. Here, there is no style -> command mapping; it's just direct. So effectively the style names and shortcuts are just aesthetic. And changing them means the citations are then tied to the export processor, and the specific user. Bruce
Re: [PERFORMANCE] Why some org code is so deep invoked?
Ihor Radchenko writes: > "Christopher M. Miles" writes: > >> After applying this patch, seems deep level has improved. > > Thanks for testing! > Applied onto main via 6ad65f333. > https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=6ad65f3332937dee81b1a7dc56a6dca7bd4865ae > Thanks for quick fixing. >> I attched the profiler report in attachments. > > May I know if you have a nil value of org-element-use-cache? Yes, it's `nil'. I will change it to `t' to test for a few days. Because I got stacktrace raised up many times before, so I disabled it. If I got more problem, I will report here. Thanks for asking. -- [ stardiviner ] I try to make every word tell the meaning that I want to express without misunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 signature.asc Description: PGP signature
[DONE] Re: [SOMEDAY] Re: [BUG] inline src_lang code is not fontified on headline
Confirmed problem fixed. "Christopher M. Miles" writes: > [[PGP Signed Part:Undecided]] > > Ihor Radchenko writes: > >> "Christopher M. Miles" writes: >> >>> The src_lang code fontification is normal in content, but not correctly >>> fontified on headline. >>> >>> There is a screenshot in attachment. >> >> Thanks for reporting! >> Note that a major rewrite of Org fontification is WIP. >> See https://orgmode.org/list/87ee7c9quk.fsf@localhost >> >> AFAIU, your example should work correctly with the new fontification. >> You can check yourself using the WIP feature/org-font-lock-element >> branch from https://github.com/yantar92/org >> >> Best, >> Ihor > > Thanks for answer, I checked out the feature/org-font-lock-element > branch on GitHub repo, and wait for it be fixed. -- [ stardiviner ] I try to make every word tell the meaning that I want to express without misunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 signature.asc Description: PGP signature
Re: org-cite-insert + fido-mode
András Simonyi writes: That works! Thank you. > Could you try Alt-j? > > best wishes, > András > > On Sat, 13 Aug 2022 at 03:22, Tyler Grinn wrote: >> >> "Bruce D'Arcus" writes: >> >> > You need to use whatever keybinding exits. >> >> I've tried every key in the mode map. >>
Re: Maintaining oc-csl
András Simonyi writes: > Dear All, > > I'd like to volunteer to maintain oc-csl.el, which currently doesn't > have an official maintainer as far as I can tell. As the author and > maintainer of citeproc-el and the author of oc-csl's precursor, > citeproc-org, I think I'm reasonably well positioned to handle issues > and make improvements. Apart from being excellent news, this is one of the best understatements I've read. :-) Yours, Christian
Maintaining oc-csl
Dear All, I'd like to volunteer to maintain oc-csl.el, which currently doesn't have an official maintainer as far as I can tell. As the author and maintainer of citeproc-el and the author of oc-csl's precursor, citeproc-org, I think I'm reasonably well positioned to handle issues and make improvements. thanks for your consideration & best wishes, András
Re: [RFC PATCH] oc-csl: Add support for title, locators and bibentry styles
Dear All, On Tue, 9 Aug 2022 at 17:38, Rudolf Adamkovič wrote: > THANK YOU for working on this! I have tried the "locators" style, and > it works great. At last, we can write in the APA style with no hacks! thanks for your kind words, I'm glad that you find the additions useful. > P.S. Not a fan of using "ti" for the title. I would go for "T" for > "Title", or "p" for "publication", or "s" for "subject", or something > like that. interesting, it didn't occur to me that we could use capital letters as well, certainly an alternative to consider. Another solution could be to make the whole mapping customizable as it's done, I think, in the case of the biblatex export processor. best wishes, András
Re: Bug: Table does not align if there is non-breaking space [9.4.3 (9.4.3-elpa @ /home/data1/protected/.emacs.d/elpa/org-20201216/)]
Jean Louis writes: > > > | Date | Description | Expense | > |+-+-| > | 2022-08-12 | Buying store, PRN 2230001079059 | -5 | > | 2022-08-12 | Mobile money agent | -2000 | > | 2022-08-13 | | | > |+-+-| > || TOTAL | | > > I would actually like "TOTAL" to be right aligned, but instead I have > tried inserting some non-breaking space before the word, and then > table does not align well with it. My font is fixed width, so it > should align correctly. Could you please detail what you mean by does not align well? Your table looks fine on my side. You may also take a look at space entities "\_ " (each extra space is +0.5em) I do not know how to set the cell alignment individually without changing the whole column. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92
Re: how to beamer export overlay figure?
Hi Ihor, On Saturday, 13 Aug 2022 at 17:16, Ihor Radchenko wrote: > I guess the message is only for testing here. Indeed. I did send a subsequent patch without the message line. Attached here again just in case. > Otherwise, looks good. Can you apply it please? Thank you, eric -- : Eric S Fraga, with org release_9.5.4-720-g4db67d in Emacs 29.0.50 From e11a09b2d69db6f7da55914276751daa8e34395b Mon Sep 17 00:00:00 2001 From: Eric S Fraga Date: Fri, 12 Aug 2022 15:50:17 +0100 Subject: [PATCH] lisp/ox-beamer: Enable use of overlays for images * ox-beamer.el (org-beamer-link): If an overlay beamer attributed has been provided, use it for images. --- lisp/ox-beamer.el | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el index e6232d8d2..cb35850b9 100644 --- a/lisp/ox-beamer.el +++ b/lisp/ox-beamer.el @@ -734,13 +734,22 @@ used as a communication channel." (or (org-export-custom-protocol-maybe link contents 'beamer info) ;; Fall-back to LaTeX export. However, prefer "\hyperlink" over ;; "\hyperref" since the former handles overlay specifications. - (let ((latex-link (org-export-with-backend 'latex link contents info))) - (if (string-match "\\`hyperref\\[\\(.*?\\)\\]" latex-link) - (replace-match - (format "hyperlink%s{\\1}" - (or (org-beamer--element-has-overlay-p link) "")) - nil nil latex-link) - latex-link + (let* ((latex-link (org-export-with-backend 'latex link contents info)) + (parent (org-export-get-parent-element link)) + (attr (org-export-read-attribute :attr_beamer parent)) + (overlay (plist-get attr :overlay))) +(cond ((string-match "\\`hyperref\\[\\(.*?\\)\\]" latex-link) + (replace-match +(format "hyperlink%s{\\1}" +(or (org-beamer--element-has-overlay-p link) "")) +nil nil latex-link)) + ((string-match "include\\(graphics\\|svg\\)\\([[{]?\\)" latex-link) + ;; check for overlay specification and insert if present + (replace-match +(format "include\\1%s\\2" +(if overlay overlay "")) +nil nil latex-link)) + (t latex-link) Plain List -- 2.30.2
Re: [Patch] Show org file title in org-clock clocktable
Duy Nguyen writes: > Not sure how you normally go about updates to submitted patches. For this > time, I just updated the patch by amending the commit of the previous patch > I sent. Please let me know another approach is preferable going forward. This is ok. Ideally, you can also assign reroll count (version) to the patch and add something like [PATCH v2] to the subject. But this is optional. > From 45882f233d961aadbcbc88ee28ba3aac8599296a Mon Sep 17 00:00:00 2001 > From: Duy Nguyen > Date: Fri, 12 Aug 2022 18:40:10 +0200 > Subject: [PATCH] lisp/org-clock.el: Show file title in org-clock clocktable Thanks for the update! I have some more comments. > diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS > index 00fe101dc..e9585617e 100644 > --- a/etc/ORG-NEWS > +++ b/etc/ORG-NEWS > @@ -270,6 +270,19 @@ example, > > prints a sub-bibliography containing the book entries with =ai= among > their keywords. > +*** New =:filetitle= option for clock table > + > +The =:filetitle= option for clock tables can be set to =t= to show org > +file title (set by =#+title:=) in the ~File~ column instead of the > +file name. For example: We usually use ~code~ for Elisp symbols and code. So, =t= -> ~t~ and ~File~ -> "File". See doc/Documentation_Standards.org > +#+begin_src org > +#+BEGIN: clocktable :scope agenda :maxlevel 2 :block thisweek :filetitle t > +#+end_src Please, escape #+BEGIN with comma: ,#+BEGIN. (this is done automatically if you use C-c ' to edit the src block) > +;;;###autoload > +(defun org-clock-get-file-title (file-name) > + "Get the file title from FILE-NAME as a string. Returns short > +FILE-NAME if title is not found." > + (with-current-buffer (find-file-noselect file-name) > +(let ((title (org-collect-keywords '("title" > + (if (null title) > + (file-name-nondirectory file-name) > +(nth 1 (assoc "TITLE" title)) By convention, we consider a document title to be concatenation of all the values of #+TITLE keyword inside buffer. That is #+TITLE: This is #+TITLE: a title #+TITLE: written in multiple #+TITLE: lines See org-macro--find-keyword-value and org-macro--collect-macros. You may even make use of the fact that (assoc "title" org-macro-templates) should give you the document title without any extra analysis. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92
Re: [Patch] Show org file title in org-clock clocktable
> > Please use the built-in org-collect-keywords instead. > Thanks for the pointer, I changed the function in the attached patch. This is a user-facing change and should be documented in etc/ORG-NEWS file. Updated both the etc/ORG-NEWS and the doc/org-manual.org files. Not sure how you normally go about updates to submitted patches. For this time, I just updated the patch by amending the commit of the previous patch I sent. Please let me know another approach is preferable going forward. Thanks, Duy 0001-lisp-org-clock.el-Show-file-title-in-org-clock-clock.patch Description: Binary data
Bug: Table does not align if there is non-breaking space [9.4.3 (9.4.3-elpa @ /home/data1/protected/.emacs.d/elpa/org-20201216/)]
Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See https://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org mailing list. | Date | Description | Expense | |+-+-| | 2022-08-12 | Buying store, PRN 2230001079059 | -5 | | 2022-08-12 | Mobile money agent | -2000 | | 2022-08-13 | | | |+-+-| || TOTAL | | I would actually like "TOTAL" to be right aligned, but instead I have tried inserting some non-breaking space before the word, and then table does not align well with it. My font is fixed width, so it should align correctly. Emacs : GNU Emacs 29.0.50 (build 3, x86_64-pc-linux-gnu, X toolkit, cairo version 1.17.6, Xaw3d scroll bars) of 2022-08-10 Package: Org mode version 9.4.3 (9.4.3-elpa @ /home/data1/protected/.emacs.d/elpa/org-20201216/) current state: == (setq org-link-elisp-confirm-function nil org-directory "~/Documents/Org" org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn ENTRY)"] org-log-done 'time org-link-abbrev-alist '(("gpatent" . "https://www.google.com/patents/US%s;) ("xau2usd" . "https://duckduckgo.com/?q=%s+xau+to+usd=currency;) ("geo" . "geo:%s") ("hyperscope" . hyperscope)) org-export-before-parsing-hook '(org-attach-expand-links) org-html-doctype "html5" org-default-notes-file "~/.notes.org" org-archive-hook '(org-attach-archive-delete-maybe) org-file-apps '((auto-mode . emacs) ("\\.mm\\'" . default) ("\\.x?html?\\'" . default) ("\\.pdf\\'" . "evince %s")) org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function org-export-with-tasks 'todo org-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS WIDTH)"] org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-modules '(ol-bbdb ol-bibtex ol-docview ol-eww org-id ol-info) org-link-from-user-regexp "\\" org-mode-hook '((lambda nil (setq org-adapt-indentation 'heading-data)) (lambda nil (electric-indent-mode 0)) #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-show-all append local] 5] #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes) org-babel-load-languages '((emacs-lisp . t) (plantuml . t) (ditaa . t) (sql . t) (shell . t) (scheme . t) (perl . t) (lisp . t) (dot . t)) outline-minor-mode-hook '((lambda nil (make-local-variable 'smart-outline-cut) (setq smart-outline-cut nil))) outline-mode-hook '((lambda nil (make-local-variable 'smart-outline-cut) (setq smart-outline-cut nil)) outline-highlight-keywords) org-agenda-span 'month org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"] org-latex-format-headline-function 'org-latex-format-headline-default-function org-confirm-shell-link-function 'yes-or-no-p org-adapt-indentation 'heading-data org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"] outline-isearch-open-invisible-function 'outline-isearch-open-invisible org-plantuml-jar-path "/home/data1/protected/lib/java/plantuml.jar" org-odt-format-headline-function 'org-odt-format-headline-default-function org-protocol-protocol-alist '(("Hyperscope Store Hyperlink" :protocol "store-link" :function hyperscope-org-protocol-store-link) ("Hyperscope Capture From Hyperlink" :protocol "capture" :function hyperscope-org-protocol-capture-link :kill-client t) ) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-latex-packages-alist '(("margins=2cm" "geometry" nil)) org-babel-tangle-lang-exts '(("lisp" . "lisp") ("perl" . "pl") ("emacs-lisp" . "el") ("elisp" . "el")) org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-clock-out-hook '(org-clock-remove-empty-clock-drawer) org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate) org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"] org-export-backends '(org md odt latex html ascii) org-confirm-babel-evaluate nil org-latex-format-inlinetask-function
Re: how to beamer export overlay figure?
"Fraga, Eric" writes: > + ((string-match "includegraphics\\([[{]?\\)" latex-link) > + ;; check for overlay specification and insert if present > + (message "matched") I guess the message is only for testing here. Otherwise, looks good. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92
Re: [PERFORMANCE] Why some org code is so deep invoked?
"Christopher M. Miles" writes: > After applying this patch, seems deep level has improved. Thanks for testing! Applied onto main via 6ad65f333. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=6ad65f3332937dee81b1a7dc56a6dca7bd4865ae > I attched the profiler report in attachments. May I know if you have a nil value of org-element-use-cache? -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92
Re: [PATCH] ob-tangle.el: fix ‘:comments noweb’ double linking
On 13/08/2022 13:42, Ihor Radchenko wrote: Max Nikulin writes: + (bare (and (string-match org-link-bracket-re l) +(match-string 1 l +(when bare + (if (and org-babel-tangle-use-relative-file-links + (string-match org-link-types-re bare) + (string= (match-string 1 bare) "file")) It looks like (string-prefix-p "file:" bare) but without the complex regexp. I see, such code was used before. By the way, why it is "bare", not e.g. "target"? match-end is used later in the code. Thus, string-match is justified. The matched string is always "file:", so there is no actual point in `string-match'. It does not really matter however. (let ((params '((:tangle . "/home/user/file.el"))) (type "file:") (target "file:///dev/null")) (if (and target org-babel-tangle-use-relative-file-links (string-prefix-p type target)) (concat type (file-relative-name (substring target (length type)) (file-name-directory (alist-get :tangle params target)) In the code existed before and moved by the committed patch I do not like that "then" branch of the `if' form uses side effect of evaluation of the condition.
Re: [Patch] Show org file title in org-clock clocktable
Duy Nguyen writes: > Please find attached a patch to allow users to show the org file titles > (i.e. the value of #+title) instead of the file name in the org-clock > clocktable. Thanks for the contribution! > I created this patch as I am using a combination of org-roam and org-agenda > to manage my tasks, where each project has its own org-roam file (and > therefore, a #+title). For my work I also need to generate weekly time > reports, with my todos spread over different org(-roam) files. I think the > clocktable looks nicer with the org file title than the name generated by > org-roam, which also has some other irrelevant information (for the > clocktable) in it such as date and time created. I believe this feature > could be useful for other users as well who have their tasks spread over > multiple org-roam files like me. The feature can easily be used by adding > ":filetitle t" as an option in the clocktable. Sounds reasonable. > Please note that the org-clock-get-file-prop function is heavily inspired > by vulpea-buffer-prop-get from the vulpea package - I just copied it over > and made some adjustments to make it work for the envisioned use case. Please use the built-in org-collect-keywords instead. > Allow user to show org file title instead of file name in the > clocktable. If the file does not have a title defined, the file name > will be shown in the clocktable. This is a user-facing change and should be documented in etc/ORG-NEWS file. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92
Re: [PERFORMANCE] Why some org code is so deep invoked?
"Christopher M. Miles" writes: > 668 28%- > org-agenda-prepare-buffers > ... > 523 22% - > org--tag-add-to-alist I have a suspicion where the bottleneck is. Can you try the attached patch? >From 1f5cdbd05c7012962ba3f12671805d77f52d836e Mon Sep 17 00:00:00 2001 Message-Id: <1f5cdbd05c7012962ba3f12671805d77f52d836e.1660373309.git.yanta...@gmail.com> From: Ihor Radchenko Date: Sat, 13 Aug 2022 14:45:01 +0800 Subject: [PATCH] org-agenda-prepare-buffers: Avoid quadratic behavior when merging tags * lisp/org.el (org-agenda-prepare-buffers): Use the shortest list as the first argument in `org--tag-add-to-alist'. `org--tag-add-to-alist' is looping over the first argument. When we use the accumulated tags as the first argument, each buffer tag will need to be looped over N_buffers/2 times on average, creating quadratic complexity. Avoid this. Reported in https://orgmode.org/list/62f66552.050a0220.ed346.ac05smtpin_added_bro...@mx.google.com --- lisp/org.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 4eef56f45..b21bdf291 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -15196,8 +15196,8 @@ (defun org-agenda-prepare-buffers (files) (append org-todo-keyword-alist-for-agenda org-todo-key-alist)) (setq org-tag-alist-for-agenda (org--tag-add-to-alist - org-tag-alist-for-agenda - org-current-tag-alist)) + org-current-tag-alist + org-tag-alist-for-agenda)) ;; Merge current file's tag groups into global ;; `org-tag-groups-alist-for-agenda'. (when org-group-tags -- 2.35.1 -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92
Re: [PATCH] ob-tangle.el: fix ‘:comments noweb’ double linking
Max Nikulin writes: >> + (bare (and (string-match org-link-bracket-re l) >> +(match-string 1 l >> +(when bare >> + (if (and org-babel-tangle-use-relative-file-links >> + (string-match org-link-types-re bare) >> + (string= (match-string 1 bare) "file")) > > It looks like (string-prefix-p "file:" bare) but without the complex > regexp. I see, such code was used before. By the way, why it is "bare", > not e.g. "target"? match-end is used later in the code. Thus, string-match is justified. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92
Re: [PATCH] ob-tangle.el: fix ‘:comments noweb’ double linking
Hraban Luyat writes: >>> @Ihor: I have rebased the patch and attached it. Applied onto main via 8a781d35d. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=8a781d35dc68f20fa2a5546c98ba3d9b77ee3cda Thanks again for your contribution! -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92
Re: Suspected bug: '#+STARTUP: indent' messes up inlinetasks' tag alignment
alain.coch...@unistra.fr writes: > Then, to observe the problem, I can for example compare > > (1) visiting the file pb.org containing: > >#+STARTUP: noindent >* headline 1 :htag: >*** inelinetask :itag: >*** END >* headline 2 :htag: > > and doing C-u C-c C-q, to > > (2) the same, but with 'indent' instead of 'noindent'. > > For me, all 3 tags end up perfectly aligned in the case (1), while > ':itag:' is shifted to the right in case (2). Thanks for reporting! Can you try the attached patch? >From 66260f723b64e20598766f14982f13c98fe40ee8 Mon Sep 17 00:00:00 2001 Message-Id: <66260f723b64e20598766f14982f13c98fe40ee8.1660372414.git.yanta...@gmail.com> From: Ihor Radchenko Date: Sat, 13 Aug 2022 14:28:55 +0800 Subject: [PATCH] org-align-tags: Fix tag alignment in inlinetasks * lisp/org.el (org-align-tags): Re-use 'line-prefix text property when `org-indent-mode' is enabled. The old version partially copy-pasted the org-indent code and missed the new changes in inlinetask alignment. The new approach should be robust against future org-indent changes. Fixes https://orgmode.org/list/25334.19025.107017.390...@gargle.gargle.howl --- lisp/org.el | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 4eef56f45..2f528aaa4 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11519,8 +11519,12 @@ (defun org-align-tags ( all) (let ((get-indent-column (lambda () (let ((offset (if (bound-and-true-p org-indent-mode) - (* (1- org-indent-indentation-per-level) -(1- (org-current-level))) + (save-excursion + (org-back-to-heading-or-point-min) + (length +(get-text-property + (line-end-position) + 'line-prefix))) 0))) (+ org-tags-column (if (> org-tags-column 0) (- offset) offset)) -- 2.35.1 -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92