[PATCH] ob-java: Allow import to end with asterisk
Hey, I found this case: #+BEGIN_SRC java import static java.lang.System.*; out.println("Hejsan"); #+END_SRC And it seems to me that the import regex dont see the asterisk. I attached a possible patch. Stay safe! >From a9c37a8a56fd1f91f4a2789b0d7d983fec9a2c1f Mon Sep 17 00:00:00 2001 From: John Herrlin Date: Tue, 26 Jan 2021 08:19:19 +0100 Subject: [PATCH] ob-java: Allow import to end with asterisk * lisp/ob-java.el (org-babel-java--imports-re): Allow import to end with asterisk. TINYCHANGE --- lisp/ob-java.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ob-java.el b/lisp/ob-java.el index 07ff8e9ab..b205eacd6 100644 --- a/lisp/ob-java.el +++ b/lisp/ob-java.el @@ -88,7 +88,7 @@ like javac -verbose." "Regexp for the package statement.") (defconst org-babel-java--imports-re (rx line-start (0+ space) "import" (opt (1+ space) "static") - (1+ space) (group (1+ (in alnum ?_ ?.))) ; capture the fully qualified class name + (1+ space) (group (1+ (in alnum ?_ ?. ?*))) ; capture the fully qualified class name (0+ space) ?\; line-end) "Regexp for import statements.") (defconst org-babel-java--class-re (rx line-start (0+ space) (opt (seq "public" (1+ space))) -- 2.30.0
Inconsistent numbering of verse, example, source blocks
Hello, I'm working on an exporter for ConTeXt and I'm trying to handle references to paragraph elements in a consistent way. However, there seems to be some inconsistencies in how such elements are numbered in the existing exporters. Here's a MWE: == #+TITLE: Numbering Collision #+NAME: NamedVerse1 #+CAPTION: Named Verse 1 #+BEGIN_VERSE Mauris ac felis vel velit tristique imperdiet. #+END_VERSE Here's a link to verse [[NamedVerse1]] #+NAME: UnnamedVerse1 #+BEGIN_VERSE Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus. #+END_VERSE Here's a link to [[UnnamedVerse1]] #+NAME: NamedVerse2 #+CAPTION: Named Verse 2 #+BEGIN_VERSE Aliquam posuere. #+END_VERSE Here's a link to verse [[NamedVerse2]] #+NAME: UnnamedVerse2 #+BEGIN_VERSE Donec neque quam, dignissim in, mollis nec, sagittis eu, wisi. #+END_VERSE Here's a link to [[UnnamedVerse2]] #+NAME: NamedEx1 #+CAPTION: Named Example 1 #+BEGIN_EXAMPLE Mauris ac felis vel velit tristique imperdiet. #+END_EXAMPLE Here's a link to Example [[NamedEx1]] #+NAME: UnnamedEx1 #+BEGIN_EXAMPLE Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus. #+END_EXAMPLE Here's a link to [[UnnamedEx1]] #+NAME: NamedEx2 #+CAPTION: Named Example 2 #+BEGIN_EXAMPLE Aliquam posuere. #+END_EXAMPLE Here's a link to Example [[NamedEx2]] #+NAME: UnnamedEx2 #+BEGIN_EXAMPLE Donec neque quam, dignissim in, mollis nec, sagittis eu, wisi. #+END_EXAMPLE Here's a link to [[UnnamedEx2]] #+NAME: NamedSrc1 #+CAPTION: Named Source 1 #+BEGIN_SRC Mauris ac felis vel velit tristique imperdiet. #+END_SRC Here's a link to Source [[NamedSrc1]] #+NAME: UnnamedSrc1 #+BEGIN_SRC Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus. #+END_SRC Here's a link to [[UnnamedSrc1]] #+NAME: NamedSrc2 #+CAPTION: Named Source 2 #+BEGIN_SRC Aliquam posuere. #+END_SRC Here's a link to Source [[NamedSrc2]] #+NAME: UnnamedSrc2 #+BEGIN_SRC Donec neque quam, dignissim in, mollis nec, sagittis eu, wisi. #+END_SRC Here's a link to [[UnnamedSrc2]] == I'm not sure what the "Canonical" numbering ought to be but what I see is as follows: For the HTML exporter: Here’s a link to verse 1 Here’s a link to 2 Here’s a link to verse 2 Here’s a link to 3 Here’s a link to Example 1 Here’s a link to 2 Here’s a link to Example 2 Here’s a link to 3 Here’s a link to Source 1 Here’s a link to 2 Here’s a link to Source 2 Here’s a link to 3 For the LaTeX exporter: (no links to verses or examples) Here's a link to Source 1 Here's a link to ?? Here's a link to Source 2 Here's a link to ?? For the markdown and, plain text exporters: Here’s a link to verse 1 Here’s a link to 2 Here’s a link to verse 3 Here’s a link to 4 Here’s a link to Example 1 Here’s a link to 2 Here’s a link to Example 3 Here’s a link to 4 Here’s a link to Source 1 Here’s a link to 2 Here’s a link to Source 3 Here’s a link to 4 So, my question is twofold: 1. Is this a bug? 2. What is the most desired numbering for these elements in the future? Thanks, Jason
Re: [Tip] Export a bibliography to HTML with bibLaTeX and make4ht
Hi Juan, On Mon, 25 Jan 2021 at 14:46, Juan Manuel Macías wrote: By the way... I have written some code to export the citations using make4ht. It's just a proof of concept, and not too elegant I'm afraid. But I wanted to explore a bit more the use of make4ht in this context. Nice! I also think make4ht has potential for this purpose. tex4ht/make4ht is usually a somewhat delicate tool for a general LaTeX document (powerful, but complex), but the typical output of citation and bibliography is text with emphasis/bold etc, and perhaps a list, if we interpret the bibliography environment strictly. This is much simpler (again, typically) than an arbitrary document, to the point I believe it could be streamlined reliably for this subset of the document. The idea is to write the citations in Org as mere bibLaTeX commands, but between !!- ... -!! (a provisional regexp, for convenience, and to see if it works). It can be tested in this Org file, which includes the code (you have to give a value to the variables `bib' and `preamble'): https://gitlab.com/-/snippets/2066135 I understand using the regexp to separate the problems, provisionally, as you said. If it evolves, you might wish to go with the current state of things in the wip-cite branch or, I reiterate the suggestion, look at latex-preview, which allows you to specify the commands of interest, if I recall correctly. I hope you find your way trough the approach. If you do, please let me know. Or, if you wish to discuss a particular issue, feel free to write me directly. Best regards, Gustavo.
Free up C-c SPC/org-table-blank-field?
Hi all, The C-c SPC keybinding is pretty prime property (it's also, according to Emacs conventions, meant to be reserved for the user, though I know that's already out the window with Org), and it's currently bound to `org-table-blank-field', which is useless unless you... happen to be in a table. I don't use tables often (or blank fields when I do), which means this binding is effectively just removed. What do people think about making it a no-op when not on a table (letting it fall through to the global map), or putting it in a keymap text property on tables, or otherwise not hogging the binding? Thanks, Eric
Re: [Tip] Export a bibliography to HTML with bibLaTeX and make4ht
Hi Gustavo, Gustavo Barros writes: > I'd also would love to see that. ;-) > > And I do think Org is, by far, the best placed tool to fill this > place. But I also think citations and bibliography are a big > bottleneck in that regard. Of course, there is a long ongoing effort > in that area, in the `wip-cite' branch, and the related `org-citeproc' > package. I'm still in the hope this will get merged in future not too > distant, as it would change things in that regard. Not in the sense > of "magically solving all of these problems", but in providing a > convened base upon which people can than invest their time and effort, > and try to figure each case out, with time. I totally agree. By the way... I have written some code to export the citations using make4ht. It's just a proof of concept, and not too elegant I'm afraid. But I wanted to explore a bit more the use of make4ht in this context. The idea is to write the citations in Org as mere bibLaTeX commands, but between !!- ... -!! (a provisional regexp, for convenience, and to see if it works). It can be tested in this Org file, which includes the code (you have to give a value to the variables `bib' and `preamble'): https://gitlab.com/-/snippets/2066135 Best regards, Juan Manuel
Re: org-refile and ivy
Eric S Fraga writes: > On Friday, 22 Jan 2021 at 14:37, Gustavo Barros wrote: >> I use org-refile with ivy, so I might share. If I recall correctly, >> the only thing that does not play well between the two is >> `org-outline-path-complete-in-steps`. My basic setup is the >> following: > > Spot on! Changing the setting of that variable to nil allows refiling > to work properly. Many thanks! > > Why it doesn't work with that variable set to t is, of course, another > question but not one that is urgent (for me) now. Although the docstring of this variable also suggests that going in steps might not be best thing with completion packages like ido etc., but it doesn’t say that refiling wont work. So, I guess this is a bug.
Re: org-refile and ivy
On Friday, 22 Jan 2021 at 14:37, Gustavo Barros wrote: > I use org-refile with ivy, so I might share. If I recall correctly, > the only thing that does not play well between the two is > `org-outline-path-complete-in-steps`. My basic setup is the > following: Spot on! Changing the setting of that variable to nil allows refiling to work properly. Many thanks! Why it doesn't work with that variable set to t is, of course, another question but not one that is urgent (for me) now. Thanks again, eric -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4.4-179-g5b5c42
Re: org-refile and ivy
Hi Eric, Eric S Fraga writes: > Dear all org mode list readers, > > I have been trying to get to grips with org-refile. For some reason, > the completion mechanism (I use ivy generally but I have no idea what > org-refile actually tries to do/use) only shows me the current file name > if I have org-refile-targets set to nil. It doesn't show any top level > headlines to choose from which is what I would expect from the > documentation. Hitting RET to select the completion target given (file > name only) refiles to the end of the file which is not what I want. > > This is with org updated fairly recently but not quite up to > date. However, I've had this problem for a long time and don't use > org-refile as a result. > > Any suggestions welcome. > > Thank you, > eric Refiling works for me. I have (setq org-refile-targets '(("gtd.org" :regexp . "Task") ("someday.org" :level . 1) ("projects.org" :regexp . "Tasks") (nil :tag . "refile") (org-agenda-files :regexp . "Tasks") (org-agenda-files :regexp . "Appointments") (nil :maxlevel . 3))) I use IDO, but at some point tried out ivy. I seem to remember having some issues with it (I still have commented out ivy stuff in my init.org). Unfortunately I can't remember whether the problems were related to refiling :-/ Cheers, Loris -- This signature is currently under construction.