HTML export: Force links that end in .jpg or .png to be exported as a tags

2024-07-17 Thread Rodrigo Morales
Consider the following Org document: #+HEADER: :tangle /tmp/a.org #+BEGIN_SRC org ,#+TITLE: My document ,#+DATE: 2024-07-17 This is a link that ends in html: foo https://example.org/a.html bar This is a link that ends in txt: foo https://example.org/a.txt bar This is a link that ends in jpg:

Re: Elisp function to get the upcoming event with the closest scheduled date

2024-01-02 Thread Rodrigo Morales
Rodrigo Morales writes: I managed to show the entry with the nearest upcoming scheduled date in the tab bar with the following utilities (see code block below). Here's an screenshot: https://upload.wikimedia.org/wikipedia/commons/f/f3/Show_information_of_Org_Agenda_in_tab-bar.png Here are some

Elisp function to get the upcoming event with the closest scheduled date

2023-12-31 Thread Rodrigo Morales
I just learned that it is possible to add functions to tab-bar-format, which is the variable that controls the information that is shown in the tab-bar. I want to write a function that gets the upcoming event with the closest scheduled date so that it is shown in the tab-bar. I want to know if

Re: Feature request: IDs for everything

2023-10-20 Thread Rodrigo Morales
Currently, headlines can have an ID (see minimal working example below): #+BEGIN_SRC org * My headline 1 * My headline 2 :PROPERTIES: :ID: e8745be0-906d-4e02-b427-d298f5751f6c :END: #+END_SRC Blocks can't have IDs, but you could use a UUID as the for blocks (see minimal working example below).

Re: [BUG] org-get-outline-path misbehave in some scenarios when org-element-use-cache is t Inbox

2023-08-30 Thread Rodrigo Morales
t-property :end (org-element-context) #+end_src Results of evaluation in v9.6.7 (unexpected behavior) #+RESULTS: #+begin_example 12 18 #+end_example Results of evaluation in latest development main (expected behavior) #+RESULTS: #+begin_example 12 14 #+end_example On Tue, 15 Aug 2023 at 19:03, Ro

Re: [BUG][org-map-entries] Using (widen) in FUNC when SCOPE is equal to 'tree iterates through headlines outside the tree

2023-08-29 Thread Rodrigo Morales
I cannot reproduce on the latest main either. Next time, before reporting a bug, I'll make sure that it hasn't been fixed on the latest main. Thanks for reviewing it. On Tue, 29 Aug 2023 at 08:20, Ihor Radchenko wrote: > > Rodrigo Morales writes: > > > (with-temp-buffer

[BUG][org-map-entries] Using (widen) in FUNC when SCOPE is equal to 'tree iterates through headlines outside the tree

2023-08-28 Thread Rodrigo Morales
The following result is expected behavior. We iterate through all headlines starting at headline =* 1=. #+HEADER: :results value #+HEADER: :results verbatim #+begin_src elisp (with-temp-buffer (org-mode) (insert "* 1 ,** 1.1 ,** 1.2 ,** 1.3 ,* 2 ,** 2.1 ,** 2.2 ,** 2.3 ") (goto-char

[BUG] org-get-outline-path misbehave in some scenarios when org-element-use-cache is t Inbox

2023-08-15 Thread Rodrigo Morales
I've noticed that =org-get-outline-path= report incorrect information when =org-element-use-cache= is =t=. This mail shows some experiments that demonstrates this bug. * Experiment 1 In this experiment, we define a =func= which contains the sexps that we want to run when =org-element-use-cache=

Bug: org-map-entries calls file-exists-p when SCOPE is nil [9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/)]

2021-10-01 Thread Rodrigo Morales
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.

[Q] Is there a convention for the formatting of messages in this mailing list?

2021-09-24 Thread Rodrigo Morales
Let's suppose I want to create a thread in the mailing list that contains different sections, code blocks and some quotes. I used to use Org Mode for the format in my messages, but I just read a discussion where someone mentioned that getting the Org Mode and Org Babel syntax in the mailing list

Bug: org-element-map doesn't consider all links in the current buffer [9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/)]

2021-09-24 Thread Rodrigo Morales
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.

Functions for inserting name of code blocks

2021-08-20 Thread Rodrigo Morales
This thread asks for feedback on functions that I've created. These 2 functions have to do with inserting, at point, the name of a code block which exists in the current buffer or in the library of babel. You can find the functions below. #+begin_src elisp (defun

[SOLVED] Re: Function for retrieving the link of an Org Mode buffer

2021-08-15 Thread Rodrigo Morales
On Sat, 14 Aug 2021 at 07:48, John Kitchin wrote: > I would probably do it like this: > Thanks for the help! I just found this question at Emacs SE: https://emacs.stackexchange.com/questions/38276 which asks this exact question. I'm mentioning it just in case someone has this question again.

[Q] How to get all the properties of the current subtree?

2021-08-15 Thread Rodrigo Morales
* Epilogue Consider the following Org Mode file #+CAPTION: The main.org file #+BEGIN_SRC org ,* The first heading :PROPERTIES: :FOO: foo-value :END: ,** The first subheading :PROPERTIES: :BAR: bar-value :END: #+END_SRC I know that I can use the function =org-entry-properties= to get some

Function for retrieving the link of an Org Mode buffer

2021-08-13 Thread Rodrigo Morales
I've written the following function for retrieving the links from a given Org Mode buffer. #+BEGIN_SRC elisp (defun my/org-collect-links-in-buffer (buffer) "Collect all the links in the current buffer. If the link has a description, then it is also collected. Returns a list of PLISTS of the

[Q] How to programmatically get the description of a link?

2021-08-13 Thread Rodrigo Morales
* The question Let's say I have the following link #+BEGIN_SRC org This is a sentence [[foo][bar]]. This is another sentence. #+END_SRC How to programmatically get the description of the link (i.e. =bar=)? * Additional information I've tried using =org-element-context=. The following sexp

Custom function for killing the thing at point

2021-08-13 Thread Rodrigo Morales
I just created this function for copying the thing under the cursor (it works for some #+BEGIN blocks and links). I think it would be useful for others, so I'm creating this post for getting feedback on the Elisp code and sharing it to those interested. #+BEGIN_SRC elisp (defun

Re: [PATCH] ob-core: tangle check library of babel after current buffer

2021-07-17 Thread Rodrigo Morales
Tom Gillespie writes: > Pinging on this to see if anyone can test it so that it can be merged. > Tom I agree with this patch. Just to make clear the default behavior and the behavior that would exist with this patch. The current behavior 1. You have a code block C1 in a buffer B1. 2. You

Re: [PATCH] Show drawers in text entries in Org Agenda

2021-07-14 Thread Rodrigo Morales
Rodrigo Morales writes: > I've created the following patch which adds a defcustom that would allow > the user to decide whether drawers must be hidden or shown in text > entries. Hope this helps. It is worth mentioning that another reason for considering this patch is the fact that =o

[bug] Setting org-id-link-to-org-use-id to t creates IDs properties when tangling

2021-07-10 Thread Rodrigo Morales
* The issue When setting org-id-link-to-org-use-id to t, an :ID: property is created for each headline that contain at least one code block that is tangled. * Reproducing this issue 1. Start emacs -Q 2. Open a "*.org" file at a location where you have write permissions (this is because,

[PATCH] Show drawers in text entries in Org Agenda

2021-07-06 Thread Rodrigo Morales
Rodrigo Morales writes: > > For this reason, I am wondering whether there is a way to make > =org-agenda-entry-text-mode= to show the drawers without much > tinkering. > After inspecting the source code of Org Mode, I managed to do what I was searching by deleting th

[Q] Show drawers in Org Agenda search buffer with org-agenda-entry-text-mode

2021-07-05 Thread Rodrigo Morales
* The context I constantly perform searches in the Agenda, and sometimes I search for properties (which is currently supported by the search feature). For example, some of my headlines have :URL: property, so I can list all the headlines which contain a :URL: property that contain the string

Re: [PATCH] Add support for prologue and epilogue in SQL code blocks

2021-07-03 Thread Rodrigo Morales
izada de este mensaje está estrictamente prohibida y sancionada por ley. >From ed083bed92dcac258c9253cd34485c6cfe91eb6c Mon Sep 17 00:00:00 2001 From: Rodrigo Morales Date: Sat, 3 Jul 2021 01:53:44 -0500 Subject: [PATCH] lisp/ob-sql.el: Add support for :prologue and :epilogue --- lis

[PATCH] Add support for prologue and epilogue in SQL code blocks

2021-07-03 Thread Rodrigo Morales
ersona que se lo envió y elimínelo. Cualquier retención o uso total o parcial no autorizada de este mensaje está estrictamente prohibida y sancionada por ley. >From ed083bed92dcac258c9253cd34485c6cfe91eb6c Mon Sep 17 00:00:00 2001 From: Rodrigo Morales Date: Sat, 3 Jul 2021 01:53:44 -0500 Su

C-c C-e functions reported as if they weren't on any key

2021-06-29 Thread Rodrigo Morales
* The context I usually use the org-publish feature to publish specific HTML files. For this reason, I use the function org-publish-current-file. * The problem I didn't know that =org-publish-current-file= was mapped to =C-c C-e P p= because =C-h w org-publish-current-file= showed the

Virtually prefix headlines according to content

2021-06-29 Thread Rodrigo Morales
me way to accomplish this would be to look at the implementation of that mode and try to understand how that is accomplished. Any help is appreciated, Rodrigo Morales.

How to compute timespan in Agenda view?

2021-06-29 Thread Rodrigo Morales
Let's say I move my cursor in the agenda view. Is there any built-in function for getting the timespan between the current date and the date at point? If there is no built-in function for accomplishing this. Could you point to some functions or variables that might help me to craft my own

Re: Latex highlighting for org-mode

2021-06-24 Thread Rodrigo Morales
There are two ways with which you can get LaTeX syntax highlighting when editing LaTeX in org-mode buffers. * No. 1: LaTeX code blocks You can have LaTeX code blocks within your document with the following header arguments and thus have syntax highlighting and make the content of those code

Re: Latex preview for whole buffer with on-off keybinding

2021-06-24 Thread Rodrigo Morales
Accomplishing this is explained in the docstring of org-latex-preview: > org-latex-preview is an interactive compiled Lisp function in > ‘org.el’. > > (org-latex-preview ARG) > > ... > > With a ‘C-u’ prefix argument ARG, clear images for all fragments > in the current section. > > With a ‘C-u

Re: appearance of list as results from evaluating code blocks

2021-06-23 Thread Rodrigo Morales
Johannes Brauer writes: Johannes Brauer writes: > thanks, that works While that works, you might be interested in ":results verbatim" instead of ":results raw" since when using "verbatim" the results are replaced when re-evaluating the code block. See minimal working example below. After

Re: appearance of list as results from evaluating code blocks

2021-06-23 Thread Rodrigo Morales
Johannes Brauer writes: Johannes Brauer writes: > thanks, that works While that works, you might be interested in ":results verbatim" instead of ":results raw" since when using "verbatim" the results are replaced when re-evaluating the code block. See minimal working example below. After

[feature request] Make org-refile include the source and target when refiling

2021-04-17 Thread Rodrigo Morales
* Context The current behavior of refiling an entry using =org-refile= when =org-log-refile= is set to =t= and =org-log-into-drawer= is set to =t= is #+begin_src org ,* Refiled heading ,* Target #+end_src #+begin_src org ,* Target ,** Refiled heading :LOGBOOK: - Refiled on [2021-04-17 Sat

Repository of Org files with important dates?

2021-04-15 Thread Rodrigo Morales
Hello everyone, Do any of you know whether there is a repository that contain Org files whose main purpose is to list important dates of a given context (specific countries, areas such as technology, biology, mathematics, computer science, etc.)? I'm asking this because I would like to have

org-babel-tangle throws an error when :tangle is not set

2021-03-27 Thread Rodrigo Morales
work (e.g. =org-babel-tangle=) could help other users to find this root cause so that they don't spend the time I spent looking for the issue. -- Greetings, Rodrigo Morales. IRC: rdrg109 (freenode)

[bug] :prologue and :epilogue header arguments don't work in latex code blocks

2021-03-13 Thread Rodrigo Morales
main() { std::cout << "This is a C++ code block"; return 0; } #+end_example * Additional information In 2020, the user Tim Landscheidt created a [[https://orgmode.org/list/ca+g3_pnrdhx0ejzw8uo7dgz+ju1b7ar_etch5mmviepkgwq...@mail.gmail.com/T/#t][thread]] in the Org Mode mailing li

Org mode links: Open a PDF file at a given page and highlight a given string

2021-03-02 Thread Rodrigo Morales
test the link presented in this message, you can download the following PDF (564K). It was the smallest PDF in gnu.org I was able to find. #+begin_src bash :dir ~/Downloads :results silent wget 'https://www.gnu.org/software/grub/manual/grub/grub.pdf' #+end_src -- Greetings, Rodrigo Morales. IRC: rdrg109 (freenode)

Re: [feature request] The :pre header argument

2021-02-19 Thread Rodrigo Morales
I've provided more relevant information on this feature request [[ https://codeberg.org/rdrg109/gists/src/branch/main/feature-request-pre-header-argument.org][here]]. Please consider reading that instead of the first message on this thread. On Fri, 19 Feb 2021 at 08:33, Rodrigo Morales wrote

Re: [feature request] The :pre header argument

2021-02-19 Thread Rodrigo Morales
You can read this message with proper formatting here ( https://codeberg.org/rdrg109/gists/src/branch/main/the-pre-header-argument.org ). On Thu, 18 Feb 2021 at 16:52, Rodrigo Morales wrote: > > This message contains my thoughts on a feature request which I think > would be useful:

[feature request] The :pre header argument

2021-02-18 Thread Rodrigo Morales
ble than the first one. * it would add importance to the =:post= header argument The =:post= header argument can be used in Org Mode 9.3 to execute a given code block after the code block at point is executed; having a header argument that does the opposite of the =:post= header argument would give relevance to the =:post= header argument. -- Greetings, Rodrigo Morales. IRC: rdrg109 (freenode)

Re: How do you name your code blocks?

2021-02-17 Thread Rodrigo Morales
= header argument. Perhaps, having a =:pre= header argument, just as the =:post= header argument exist, would help expressing depdency between code blocks in a clearer way. I consider the =:var= header argument a hacky way to associate two code blocks. -- Rodrigo Morales.

Re: How do you name your code blocks?

2021-02-16 Thread Rodrigo Morales
fizz buzz buzz buzz buzz foo bar bar EOF ,#+end_src #+end_src As we can see above, both =dash= code blocks are given the name =create-file= because both of them create a file but the ID of the heading is used a the prefix in order to avoid a name conflict. Let me know your thoughts on this workaroun

Re: How do you name your code blocks?

2021-02-16 Thread Rodrigo Morales
fizz buzz buzz buzz buzz foo bar bar EOF ,#+end_src #+end_src -- Rodrigo Morales. IRC: rdrg109 (freenode)

Re: How to associate a code block to another one so that it is executed beforehand?

2021-02-15 Thread Rodrigo Morales
t bar first bar second EOF ,#+end_src ,#+RESULTS: ,#+begin_example 0 bar first 1 bar second ,#+end_example #+end_src Note that, in this scenario, when using the =:post= header argument it is only necessary to name the Python code block instead of naming all the code blocks that are meant to be processed by the

How to associate a code block to another one so that it is executed beforehand?

2021-02-15 Thread Rodrigo Morales
c #+RESULTS: #+begin_example foo bar #+end_example -- Rodrigo Morales. IRC: rdrg109 (freenode)

How do you name your code blocks?

2021-02-15 Thread Rodrigo Morales
=, which is ambiguous, you would use =generate-table-grocery-shopping-2020-may=. Another example: instead of using =create-venv= you would use =create-venv-for-personal-blog-in-home=. 2. If not, how do you name your code blocks to avoid name conflicts? -- Greetings, Rodrigo Morales. IRC

How to set the name of a source code block programatically?

2021-02-15 Thread Rodrigo Morales
ts output #+NAME: ls #+HEADER: :noweb yes #+begin_src dash ls #+end_src #+HEADER: :results output #+HEADER: :noweb yes #+NAME: ls #+begin_src dash ls #+end_src -- Greetings, Rodrigo Morales. IRC: rdrg109 (freenode)

Re: How to get the content of a code block by its name?

2021-02-12 Thread Rodrigo Morales
#+HEADER: :epilogue (org-babel-get-block-as-string "test-echo") #+begin_src bash echo a #+end_src #+RESULTS: #+begin_example printf-foo printf-bar a echo-foo echo-bar #+end_example -- Greetings, Rodrigo Morales. IRC: rdrg109 (freenode)

How to get the content of a code block by its name?

2021-02-11 Thread Rodrigo Morales
information I'm asking this because I would like to have a function which would help me insert a code block in the =:prologue= header argument of another code block. #+begin_src bash :prologue (get-code-block-as-string "five-numbers") echo a #+end_src -- Greetings, Rodrigo Morales. IR

How to call a code block by its name in the :prologue header argument?

2021-02-11 Thread Rodrigo Morales
g/archive/html/emacs-orgmode/2020-08/msg00116.html [4] https://lists.gnu.org/archive/html/emacs-orgmode/2020-08/msg00118.html -- Greetings, Rodrigo Morales. IRC: rdrg109 (freenode)

bug? Newline inserted when referencing a block result with ":cache yes" in a "noweb" reference

2021-02-05 Thread Rodrigo Morales
newline not to be inserted when referencing the result of a code block which had =:cache= set to =yes= -- Greetings, Rodrigo Morales.

Re: [PATCH] ox-md.el export code blocks using grave accents

2021-01-31 Thread Rodrigo Morales
Please, omit this duplicated thread. It has already been discussed. This thread was created due to an error of mine. On Thu, 28 Jan 2021 at 22:51, Rodrigo Morales wrote: > > Sorry for not attaching the files. Here they are. > > > -- > Greetings, > Rodrigo Morales. >

[PATCH] ox-md.el export code blocks using grave accents

2021-01-30 Thread Rodrigo Morales
tring "\\'" "```" content))) (defun org-md-export-block (export-block contents info) "Transcode a EXPORT-BLOCK element from Org to Markdown. #+end_example -- Greetings, Rodrigo Morales.

Re: [PATCH] ox-md.el export code blocks using grave accents

2021-01-30 Thread Rodrigo Morales
content)) + +(replace-regexp-in-string "\\'" "```" content))) (defun org-md-export-block (export-block contents info) "Transcode a EXPORT-BLOCK element from Org to Markdown. -- Greetings, Rodrigo Morales.

Re: [PATCH] ox-md.el export code blocks using grave accents.

2021-01-30 Thread Rodrigo Morales
uot;ox-gfm", which I suppose solve some of my needs (I will check it out later). Next time I will make sure to read the relevant part in the Info manual and search some related keywords in the mailing list archive. -- Greetings, Rodrigo Morales.

Re: [bug] Exporting results in "Wrong type argument" when "+CALL" is used

2021-01-30 Thread Rodrigo Morales
-- Greetings, Rodrigo Morales.

Re: How to avoid generating the Table of Contents when exporting to markdown?

2021-01-30 Thread Rodrigo Morales
Thanks for the help :) After searching the information you mentioned in the Info manual of Org Mode, I found information on the variable =org-export-with-toc= and have included the following in my configuration. #+begin_src elisp (setq org-export-with-toc nil) #+end_src -- Greetings, Rodrigo

[bug] Exporting results in "Wrong type argument" when "+CALL" is used

2021-01-30 Thread Rodrigo Morales
or might occur. I'm currently using GNU Emacs 27.1 -- Greetings, Rodrigo Morales.

How to avoid generating the Table of Contents when exporting to markdown?

2021-01-30 Thread Rodrigo Morales
enough to require it. For this reason, I don't want the Table of Contents to be included when exporting. -- Greetings, Rodrigo Morales.

[PATCH] ox-md.el export code blocks using grave accents.

2021-01-30 Thread Rodrigo Morales
st-get (car (cdr example-block)) :language)) + (markdown-language + (cdr (assoc org-language org-md-lang-export))) ; + (content + (org-remove-indentation + (org-export-format-code-default example-block info + +(if markdown-language + (setq language markdown-language) + (setq language org-language)) + +(setq content (replace-regexp-in-string + "\\`" (concat "```" language "\n") + content)) + +(replace-regexp-in-string "\\'" "```" content))) (defun org-md-export-block (export-block contents info) "Transcode a EXPORT-BLOCK element from Org to Markdown. -- Greetings, Rodrigo Morales.