Re: idea for capture anywhere in x
with the org capture firefox extension broken, i recalled this old thread, thinking it might be a fix, and i think i understand the issue. so i thought i would summarize here in this one post. i think i was not clear in this thread in a few places. apologies for that. 1. [current need, urgent] i want to select text with mouse in firefox, then have plain text and url save to an org entry. this would then replace the need for the firefox org-capture extension. it seems like emacsclient calling org-capture can grab the selected /text/. [presumably in a capture template via a % format or via lisp that calls gui-get-selection or something like that.] a cli command like this sounds good. but saving the /url/ seems not possible in a cli command because it will not have access to firefox's current url. otoh, if there is such a thing as "a cli command that will ask firefox for its current url" then it is possible. if such a solution is possible then i can make it controllable completely by mouse [i often cannot use keyboard] merely by adding the cli command [such as an emacsclient call] to my fluxbox menu. that would be a complete solution. 2. in this thread i thought it would also be great to select text with mouse /in any running application in x/, then have selection be saved to an org entry. this might be possible with the above possible solution, minus the url issue. i can maybe work around the /firefox/ url issue by manually selecting the url in the url bar after selecting text. cli command creates second entry in org; i clean up manually in emacs later. kind of dumb but maybe will work. does this sound like a sensible thing to try to do to work around the fact that the org capture extension is broken? i like the idea that it will maybe be robust to firefox changes and doesn't require me to yet again try to figure out org-protocol. [i never got org protocol to work in firefox. which is why i liked the org capture extension.]
[PATCH] #+begin_example lang used in manual and worg (was: [DISCUSSION] Refactoring fontification system)
Max Nikulin writes: > Side note: I can not say that #+begin_example with language is widely > used, but one case may be found in org-manual.org and a dozen in worg. Which should probably be fixed. LANG parameter is ignored on export anyway. See the attached patches for WORG and emacs-manual. Best, Ihor >From 1f5419fb4c249d6e53940ff16e27e16da55c5dbc Mon Sep 17 00:00:00 2001 Message-Id: <1f5419fb4c249d6e53940ff16e27e16da55c5dbc.1654826607.git.yanta...@gmail.com> From: Ihor Radchenko Date: Fri, 10 Jun 2022 10:02:51 +0800 Subject: [PATCH] org-manual: Fix example block with unsupported language name parameter * doc/org-manual.org (Breaking Down Tasks into Subtasks): Remove unsupported LANG parameter from #+begin_example LANG. --- doc/org-manual.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index 32a45f884..51aa4d77e 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -4488,7 +4488,7 @@ ** Breaking Down Tasks into Subtasks include the word =recursive= into the value of the =COOKIE_DATA= property. -#+begin_example org +#+begin_example ,* Parent capturing statistics [2/20] :PROPERTIES: :COOKIE_DATA: todo recursive -- 2.35.1 >From 4a43d570b5424dadfda74996bddc4982aadafe37 Mon Sep 17 00:00:00 2001 Message-Id: <4a43d570b5424dadfda74996bddc4982aadafe37.1654826554.git.yanta...@gmail.com> From: Ihor Radchenko Date: Fri, 10 Jun 2022 10:01:10 +0800 Subject: [PATCH] Fix example blocks with unsupported language name parameter * org-contrib/babel/languages/ob-doc-shell.org (Requirements and Setup): * org-hacks.org (Reschedule agenda items to today with a single command): * org-tutorials/org-jekyll.org (Creating an org File to be Published with Jekyll): (Showing Blog Posts on the Front Page): (Creating Archive Pages): (Inserting Image): (Using Text Markup in Front Matte): Remove LANG in #+begin_example LANG. --- org-contrib/babel/languages/ob-doc-shell.org | 2 +- org-hacks.org| 2 +- org-tutorials/org-jekyll.org | 16 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/org-contrib/babel/languages/ob-doc-shell.org b/org-contrib/babel/languages/ob-doc-shell.org index 730f63d7..e7d728b3 100644 --- a/org-contrib/babel/languages/ob-doc-shell.org +++ b/org-contrib/babel/languages/ob-doc-shell.org @@ -179,7 +179,7 @@ * Requirements and Setup 2. The Org Babel language facility must be set to load shell functionality[fn:5]: -#+begin_example emacs-lisp +#+begin_example ;; active Babel languages (org-babel-do-load-languages 'org-babel-load-languages diff --git a/org-hacks.org b/org-hacks.org index 968e511d..d446de9b 100644 --- a/org-hacks.org +++ b/org-hacks.org @@ -2196,7 +2196,7 @@ *** Reschedule agenda items to today with a single command #+index: Agenda!Reschedule This was suggested by Carsten in reply to David Abrahams: -#+begin_example emacs-lisp +#+begin_example (defun org-agenda-reschedule-to-today () (interactive) (flet ((org-read-date ( rest) (current-time))) diff --git a/org-tutorials/org-jekyll.org b/org-tutorials/org-jekyll.org index 4da2d5ad..a0c57991 100644 --- a/org-tutorials/org-jekyll.org +++ b/org-tutorials/org-jekyll.org @@ -172,7 +172,7 @@ * Creating an org File to be Published with Jekyll Below is a short extract from one of my org files showing my setup: -#+BEGIN_EXAMPLE org +#+BEGIN_EXAMPLE #+STARTUP: showall indent #+STARTUP: hidestars #+BEGIN_EXPORT html @@ -254,7 +254,7 @@ ** Showing Blog Posts on the Front Page Most blogs show the latest posts on their front page. The example below shows the title and an excerpt for the five latest posts: -#+BEGIN_EXAMPLE html +#+BEGIN_EXAMPLE {% for post in site.posts limit: 5 %} @@ -274,7 +274,7 @@ ** Creating Archive Pages available. You can create a simple list of all blog posts using the following markup: -#+begin_example html +#+begin_example {% for post in site.posts %} @@ -295,7 +295,7 @@ * Inserting Image You will probably want to insert some images into your blog posts. I use the following method: -#+BEGIN_EXAMPLE html +#+BEGIN_EXAMPLE @@ -304,7 +304,7 @@ * Inserting Image Note that the class attribute refers to the class used to style the image tag in your css. My css contains: -#+BEGIN_EXAMPLE css +#+BEGIN_EXAMPLE img { margin: 15px; border: 1px solid blue; @@ -323,7 +323,7 @@ * Inserting Image In your =.org= file use the following html to embed the picture: -#+BEGIN_EXAMPLE html +#+BEGIN_EXAMPLE @@ -333,7 +333,7 @@ * Inserting Image Now you need to add some information to your style sheet: -#+BEGIN_EXAMPLE css +#+BEGIN_EXAMPLE div.photofloatr { float: right; border: thin silver solid; @@ -362,7 +362,7 @@ * Using Text Markup in Front Matte I use this to format my page excerpts, which I include in my org files Front Matter markup. So in my sites index.html I have:
Re: org-capture firefox extension broken [silently]
thank you for the link and suggestion. it says it works for a version of ff one more than my current one. anybody know how to: 1] get a slightly older version from the firefox addons site that might work with my version of firefox? 2] download it as a file, /inspect it/, and then install it from the file [the addon site says "This add-on is not actively monitored for security by Mozilla. Make sure you trust it before installing."? On 6/9/22, Richard Kim wrote: > Samuel Wales writes: > >> idk if there are other org capture extensions. i am aware of spookfox >> and eagerly look forward to its maturing, at which point i will try >> it. but idk if that can do simple, id-less org capture. > > I too noticed that org-capture stopped working months ago. > Fortunately I had setup https://github.com/kuanyui/copy-as-org-mode > which works great. It is superset of org-capture in that I can > cut and paste regions of text and it does good job of translating > HTML into org. > > > -- The Kafka Pandemic A blog about science, health, human rights, and misopathy: https://thekafkapandemic.blogspot.com
export to odt, but #text# should be coloured
Hi a short hack of the sort (interactive) (while (re-search-forward "#\\([^#]*\\)#" nil t) (replace-match "\\1"))) Allows me to export text like this #important# to HTML where the resulted text is colored in red. Now, how can I achieve something like this for the odt export? Reards Uwe Brauer -- I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the ban of Russia from SWIFT. I support the EU membership of the Ukraine.
Re: org-capture firefox extension broken [silently]
Samuel Wales writes: > idk if there are other org capture extensions. i am aware of spookfox > and eagerly look forward to its maturing, at which point i will try > it. but idk if that can do simple, id-less org capture. I too noticed that org-capture stopped working months ago. Fortunately I had setup https://github.com/kuanyui/copy-as-org-mode which works great. It is superset of org-capture in that I can cut and paste regions of text and it does good job of translating HTML into org.
Re: re-scanning bibliography for org-cite
BTW, just to give some context of why we didn't implement it by default earlier; there are two reasons: 1. it seems vast differences in the size of user bib files, and those with very large ones would be annoyed if it re-generated the completions on every change. 2. citar also covers notes and related files, which get complicated, and subject to further user variety; and the UI needs to keep this in sync with the bib data I think we understand the problem better now, however. On Thu, Jun 9, 2022 at 12:00 PM Fraga, Eric wrote: > > On Thursday, 9 Jun 2022 at 10:34, Bruce D'Arcus wrote: > > It should take another few days of development and testing before I'm > > ready to merge it, but it pretty much works now, and any help with > > code review and/or testing would be much appreciated. > > Okay, let me know. It's easy enough for me to replace 'basic with > 'citar again! > > -- > : Eric S Fraga, with org release_9.5.4-521-g1105da in Emacs 29.0.50
Re: [DISCUSSION] Refactoring fontification system
On 08/06/2022 11:23, Tom Gillespie wrote: As for lang parameter support in example blocks, would you mind creating a separate feature request thread? Extending export blocks export will require changing in parser syntax and thus should be discussed carefully in a separate thread. I would strongly caution against allowing an optional #+begin_example lang syntax. It will lead to extreme confusion, even when users know to use org-lint. The reason for this is that example blocks do not have (and frankly should not have) full org-babel support. Babel is already complex enough as is without having to explain to a user that yes they can noweb an example block into a src block, but that they cannot noweb a source block into an example block. My expectation is that treating #+begin_example almost as #+begin_src will simplify code. E.g. `org-latex-src-block' has a fallback to plain \begin{verbatim} if language is unknown or is not specified, so it may handle examples as well. The difference is that for #+begin_example evaluation and noweb are disabled, either it is hardcoded (my preference) or default values for :noweb and :eval header argument are adjusted. On 09/06/2022 12:37, Pedro Andres Aranda Gutierrez wrote: OK, just to add to the discussion. The original intent of my message was to give _me_ control over what I want to colour, not delegating that to the fontifying engine in Emacs. I need limited and controlled colouring for text-books and lab manuals where colouring elements of a listing goes against the publishing standards. I only need custom colouring to "emulate" terminal output, not for the code as such. And I could do that with the #+ATTR: if supported. Fontification and an attribute to specify an option for environment are independent features. My point is that if example and src blocks reused the same code than it would be enough to implement :options attribute (similar to #+begin_quote) once and both types of blocks would be more flexible. If #+begin_example becomes more dumb, unsure if it is reasonable to allow to generate "\begin{verbatim}[commandchars=\\\{\}]" for example block but not for source blocks. Side note: I can not say that #+begin_example with language is widely used, but one case may be found in org-manual.org and a dozen in worg.
Re: re-scanning bibliography for org-cite
On Thursday, 9 Jun 2022 at 10:34, Bruce D'Arcus wrote: > It should take another few days of development and testing before I'm > ready to merge it, but it pretty much works now, and any help with > code review and/or testing would be much appreciated. Okay, let me know. It's easy enough for me to replace 'basic with 'citar again! -- : Eric S Fraga, with org release_9.5.4-521-g1105da in Emacs 29.0.50
Re: re-scanning bibliography for org-cite
On Thu, Jun 9, 2022 at 10:19 AM Fraga, Eric wrote: > > On Thursday, 26 May 2022 at 18:24, Ihor Radchenko wrote: > > The relevant function is org-cite-basic--parse-bibliography. > > To finally follow up on this, the problem is not with org-cite but > appears to be due to my use of citar. Citar seems to cache the keys > somewhere/somehow and this cache is not updated when the bibliography > file changes. Yes; not currently by default, but can be configured. https://github.com/emacs-citar/citar#refreshing-the-library-display But more importantly I'm currently working on a major change in the caching and completion architecture of citar, where I've actually borrowed ideas and code from oc-basic, so it should work the same WRT to cache updating, without need for any configuration. https://github.com/emacs-citar/citar/pull/628 It should take another few days of development and testing before I'm ready to merge it, but it pretty much works now, and any help with code review and/or testing would be much appreciated. Bruce
Re: when does :cache not cache?
On Thursday, 9 Jun 2022 at 21:35, Ihor Radchenko wrote: > Did you have a chance to test the patch? No. Sorry. Got busy with other things and had temporarily (well, permanently) solved the problem (for me) by adding :eval no-export to all of my gnuplot blocks. -- : Eric S Fraga, with org release_9.5.4-521-g1105da in Emacs 29.0.50
Re: [PATCH] Re: [BUG] Manual says +2h works for date entry, but it doesn't
Ihor Radchenko writes: > I can confirm that +2h syntax is not supported. > > The attached patch makes hours work in the time prompt. Applied onto main via 57d64cf78. Best, Ihor
[PATCH v2] Bug: Indenting empty description list item leaves point at beginning of line [9.4.4]
Bodertz writes: > Apologies, I wasn't aware you were asking for feedback. > > The issue I described no longer occurs. > > However, there is still a minor issue with the proposed fix. > > After creating a new empty description list item by pressing {M-RET} > after a description list item, the item created is the following: > Thanks for letting me know and sorry for the late reply. This patch has been sunk in the depths of the todo list. I have updated the patch to address your concern. See the attached. Best, Ihor >From 86f4e9b1bec488a420b28b91e3813a2cd74d586f Mon Sep 17 00:00:00 2001 Message-Id: <86f4e9b1bec488a420b28b91e3813a2cd74d586f.1654781017.git.yanta...@gmail.com> From: Ihor Radchenko Date: Sat, 2 Oct 2021 18:32:34 +0800 Subject: [PATCH] org-list: Do not move point and change space when promoting/demoting items * lisp/org-list.el (org-list-struct-apply-struct): Make sure the origin marker is not moved to bol when promoting/demoting item in special case: - item - :: Do not remove the trailing space after point as well. (org-insert-item): Do not expect point to remain at bol after writing list struct. * testing/lisp/test-org-list.el (test-org-list/indent-item): Add test Fixes https://orgmode.org/list/87o88hlkvv@gmail.com --- lisp/org-list.el | 15 ++- testing/lisp/test-org-list.el | 16 +++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/lisp/org-list.el b/lisp/org-list.el index 515763036..97d856fc9 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -1940,7 +1940,19 @@ (defun org-list-struct-apply-struct (struct old-struct) (looking-at org-list-full-item-re) ;; a. Replace bullet (unless (equal old-bul new-bul) - (replace-match new-bul nil nil nil 1)) +(let ((keep-space "")) + (save-excursion +;; If origin is inside the bullet, preserve the +;; spaces after origin. +(when (<= (match-beginning 1) origin (match-end 1)) + (org-with-point-at origin +(save-match-data + (when (looking-at "[ \t]+") +(setq keep-space (match-string 0)) +(replace-match "" nil nil nil 1) +(goto-char (match-end 1)) +(insert-before-markers new-bul) +(insert keep-space ;; b. Replace checkbox. (cond ((equal (match-string 3) new-box)) @@ -2286,6 +2298,7 @@ (defun org-insert-item ( checkbox) (setq struct (org-list-insert-item pos struct prevs checkbox desc)) (org-list-write-struct struct (org-list-parents-alist struct)) (when checkbox (org-update-checkbox-count-maybe)) + (beginning-of-line) (looking-at org-list-full-item-re) (goto-char (if (and (match-beginning 4) (save-match-data diff --git a/testing/lisp/test-org-list.el b/testing/lisp/test-org-list.el index bc8faa672..d3e6fc176 100644 --- a/testing/lisp/test-org-list.el +++ b/testing/lisp/test-org-list.el @@ -298,7 +298,21 @@ (ert-deftest test-org-list/indent-item () (push-mark (point) t t) (goto-char (point-max)) (let (org-list-demote-modify-bullet) (org-indent-item)) - (buffer-string) + (buffer-string + ;; When point is right after empty item, do not move point. + (should + (= 13 + (org-test-with-temp-text " +- item +- ::" +(org-indent-item) +(point + ;; Preserve space after point upon promoting level. + (org-test-with-temp-text " +- item +- ::" +(org-indent-item) +(should (looking-at-p " \t" (ert-deftest test-org-list/indent-item-tree () "Test `org-indent-item-tree' specifications." -- 2.35.1
Re: when does :cache not cache?
Hi Eric, Eric S Fraga writes: > I will try your patch later this week (busy with end of term teaching > aspects at the moment). Did you have a chance to test the patch? Best, Ihor
Re: re-scanning bibliography for org-cite
On Thursday, 26 May 2022 at 18:24, Ihor Radchenko wrote: > The relevant function is org-cite-basic--parse-bibliography. To finally follow up on this, the problem is not with org-cite but appears to be due to my use of citar. Citar seems to cache the keys somewhere/somehow and this cache is not updated when the bibliography file changes. If I set org-cite-insert-processor to 'basic, everything is fine. Sorry for the noise. -- : Eric S Fraga, with org release_9.5.4-521-g1105da in Emacs 29.0.50
Re: Include LaTeX source and compiled result
On Thursday, 9 Jun 2022 at 09:58, Denis Maier wrote: > Anything else? I've found those files, but I was wondering whether Emacs > could give me some more useful debug infos? (Especially since compiling > the temporary files works...) Nothing else I know about. It's one of the weak points in the whole babel ecosystem... If the underlying system writes to stderr, this does get sent back to the user, but most src blocks fail silently when they fail which is very frustrating. -- : Eric S Fraga, with org release_9.5.4-521-g1105da in Emacs 29.0.50
Re: Org-attach for a directory
Cletip Cletip writes: > Thank you for your answer. You're welcome. > Your answer seems perfect to answer my question: I modify a function > of org-mode, and it allows me to attach folders and files to a > heading. > Unfortunately, it doesn't work (probably because of my version of > org-mode I guess) > > I have the following error: > make-directory: The file exists: > /home/user/sharedDirectoryPrivate/notes/braindump/.data/11e080/1b-7896-4f20-a24a-b9f45337e940 I don't know all the details of your problem. But if it gives you an error saying The file exists, I would say that the cause is that the directory you want to copy already exists in your attach folder. Could it be that in your case? Note that the 'copy-directory' function does not overwrite copied directories. > Just to make sure I understood correctly: you can, with the "copy" > method and the simple modification of the "org-attach-attach" > function, attach a folder to a heading of org mode? > If so, this is exactly what I am looking for, and this would be a > great help. Exactly. I wrote a new version of org-attach-attach, modified that part, as I told you, and added it via advice-add (with :override keyword) so that it overrides the old function. > To clarify my second question, I would like to have a folder system > with org-mode, and therefore only use org-attach to arrange my > documents, exactly like you. > Could you describe your workflow in more detail? Your use of tags for > example, do you put dates, etc. Now I have less time than I would like to go into the details, but perhaps some reflections that I shared here may be useful to you: https://list.orgmode.org/875yms7wys@posteo.net/ The strong point of my approach is to think of Org nodes and not the classic directory/file scheme. But for that to work well you must rely on a system that ensures a semantic search through the nodes. For me the answer is org-ql (and if you're a helm user, you have helm-org-ql too). Basically it's turning all your Org documents into a human-readable database, where searches can be narrowed down by tags, status, content, etc. Another important point is that this scheme works wonderfully well with org-capture. Best regards, Juan Manuel
[PATCH] Re: Org-attach for a directory
Cletip Cletip writes: > Thank you for your answer. > Unfortunately, I would like to copy the entire directory. > To clarify my second question, I would like to have a folder system with > org-mode, and therefore only use org-attach to store my documents Note that it makes much more sense to use 'mv method when you actually use attachments as your filesystem. There is no need to keep trailing garbage files. 'mv methods works for directories. As for the 'cp method, it does not work for directories on current main. The fix is attached. Best, Ihor >From 6d879aeca5d1c52a824df998704298d9ee4a4a0a Mon Sep 17 00:00:00 2001 Message-Id: <6d879aeca5d1c52a824df998704298d9ee4a4a0a.1654767374.git.yanta...@gmail.com> From: Ihor Radchenko Date: Thu, 9 Jun 2022 17:33:49 +0800 Subject: [PATCH] org-attach-attach: Allow attaching directories using 'cp method * lisp/org-attach.el (org-attach-attach): Use `copy-directory' when FILE is a directory. Remove trailing slash before processing. --- lisp/org-attach.el | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/org-attach.el b/lisp/org-attach.el index 5ee2b84b2..00919bef8 100644 --- a/lisp/org-attach.el +++ b/lisp/org-attach.el @@ -517,12 +517,17 @@ (defun org-attach-attach (file visit-dir method) current-prefix-arg nil)) (setq method (or method org-attach-method)) + (when (file-directory-p file) +(setq file (directory-file-name file))) (let ((basename (file-name-nondirectory file))) (let* ((attach-dir (org-attach-dir 'get-create)) (attach-file (expand-file-name basename attach-dir))) (cond ((eq method 'mv) (rename-file file attach-file)) - ((eq method 'cp) (copy-file file attach-file)) + ((eq method 'cp) +(if (file-directory-p file) +(copy-directory file attach-file nil nil t) + (copy-file file attach-file))) ((eq method 'ln) (add-name-to-file file attach-file)) ((eq method 'lns) (make-symbolic-link file attach-file)) ((eq method 'url) (url-copy-file file attach-file))) -- 2.35.1
Re: [PATCH] Fix shadowed radio targets
Rudolf Adamkovič writes: > If one defines two radio targets, say <<>> and > <<>>, the first one does not work if defined first. Please, > see the attached patch. I have the copyright papers signed. Thanks! Applied onto main via d9963c58d changing (sort targets ...) to (setq targets (sort targets ...)). The original patch did not pass the supplied test. Best, Ihor
Re: [PATCH] Re: [BUG] folding error during capture
Ihor Radchenko writes: > The fix is attached. > > I do not push the fix just yet. If anyone think that enabling org-mode > during template expansion is undesired, please let me know. Applied onto main via 0e7033e0c. Not on bugfix as it is not a critical issue. Best, Ihor
Re: Include LaTeX source and compiled result
Am 09.06.2022 um 09:47 schrieb Fraga, Eric: On Wednesday, 8 Jun 2022 at 21:01, Denis Maier wrote: :exports code works. But the problem with the other options is that the compilation fails. But I cannot tell why. It just tells me "Code block produced no output". This is not surprising as the LaTeX src blocks are expected to be LaTeX body only, not preamble etc. I.e. in your case, just the line that says "This is a test". You may wish to look at org-format-latex-header, org-babel-latex-preamble, org-babel-latex-end-env, ... Exactly, I've found that out by looking at the file in temp. Testing with body only failed as well! I can however manually compile the temporary file. Anyway: This means you cannot switch to using complete files? I was hoping for something like :fragment nil or :complete-doc t How can you diagnose such an issue? You can sometimes find the org babel files created in /tmp. Anything else? I've found those files, but I was wondering whether Emacs could give me some more useful debug infos? (Especially since compiling the temporary files works...) Denis
Re: Include LaTeX source and compiled result
On Wednesday, 8 Jun 2022 at 21:01, Denis Maier wrote: > :exports code works. But the problem with the other options is that the > compilation fails. But I cannot tell why. It just tells me "Code block > produced no output". This is not surprising as the LaTeX src blocks are expected to be LaTeX body only, not preamble etc. I.e. in your case, just the line that says "This is a test". You may wish to look at org-format-latex-header, org-babel-latex-preamble, org-babel-latex-end-env, ... > How can you diagnose such an issue? You can sometimes find the org babel files created in /tmp. -- : Eric S Fraga, with org release_9.5.4-521-g1105da in Emacs 29.0.50