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

2021-03-02 Thread Rodrigo Morales
I want to be able to + create a Org link to specific pages of a PDF. I've managed to accomplish this by setting the following value. #+begin_src emacs-lisp :results silent (setq org-file-apps '(("\\.pdf::\\([0-9]+\\)\\'" . "zathura -P %1 %s"))) #+end_src The following links open the PD

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

2021-09-27 Thread Max Nikulin
On 03/03/2021 05:36, Kyle Meyer wrote: Rodrigo Morales writes: [...] + create a Org link to specific pages of a PDF and highlight a given string. #+begin_src emacs-lisp :results silent (setq org-file-apps '(("\\.pdf::\\([0-9]+\\)::\\([^:]+\\)\\'" . "zathura -P %1 -f %2 %s"))) #+end_s

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

2022-09-03 Thread Max Nikulin
On 03/03/2021 03:07, Rodrigo Morales wrote: #+begin_src emacs-lisp :results silent (setq org-file-apps '(("\\.pdf::\\([0-9]+\\)::\\([^:]+\\)\\'" . "zathura -P %1 -f %2 %s"))) #+end_src I am going to respond to a message from another thread containing discussion of a patch, but I suppos

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

2022-09-20 Thread Ihor Radchenko
Max Nikulin writes: > Currently I believe that instead of injecting up to 6 entries into > `org-file-apps' for various combinations of page, anchor, and search > pattern, it is better to add single record with function handler. Notice > that the approach presented above is not affected by the

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

2022-09-20 Thread Max Nikulin
On 20/09/2022 18:54, Ihor Radchenko wrote: Max Nikulin writes: Currently I believe that instead of injecting up to 6 entries into `org-file-apps' for various combinations of page, anchor, and search pattern, it is better to add single record with function handler. Notice that the approach prese

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

2022-09-21 Thread Ihor Radchenko
Max Nikulin writes: >> I think that it is a very good idea for Org core to support search terms >> in file links that are handled by Free Software. > > Maybe I misunderstand something, but your stress on Free Software here > surprised me. I did not mention explicitly any proprietary application

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

2022-09-21 Thread Ihor Radchenko
Max Nikulin writes: >> I think that it is a very good idea for Org core to support search terms >> in file links that are handled by Free Software. > > Maybe I misunderstand something, but your stress on Free Software here > surprised me. I did not mention explicitly any proprietary application

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

2022-10-03 Thread Ihor Radchenko
Rodrigo Morales writes: > Debugger entered--Lisp error: (wrong-type-argument stringp nil) I can no longer reproduce on the latest main. Closing the bug report. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at <

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

2021-03-02 Thread Kyle Meyer
Rodrigo Morales writes: [...] > + create a Org link to specific pages of a PDF and highlight a given > string. > > #+begin_src emacs-lisp :results silent > (setq org-file-apps > '(("\\.pdf::\\([0-9]+\\)::\\([^:]+\\)\\'" . "zathura -P %1 -f %2 %s"))) > #+end_src > > The following link must

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

2021-03-02 Thread Juan Manuel Macías
Hi Rodrigo, Rodrigo Morales writes: > I want to be able to > > + create a Org link to specific pages of a PDF. I've managed to > accomplish this by setting the following value. > [ ... ] > + create a Org link to specific pages of a PDF and highlight a given > string. A possible alternative,

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

2021-03-03 Thread Maxim Nikulin
On 03/03/2021 05:36, Kyle Meyer wrote: Rodrigo Morales writes: [...] + create a Org link to specific pages of a PDF and highlight a given string. #+begin_src emacs-lisp :results silent (setq org-file-apps '(("\\.pdf::\\([0-9]+\\)::\\([^:]+\\)\\'" . "zathura -P %1 -f %2 %s"))) #+end_s

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

2021-03-03 Thread Maxim Nikulin
On 03/03/2021 09:31, Juan Manuel Macías wrote: (start-process-shell-command "zathura" nil (concat "zathura " clean-path " -P "

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

2021-03-03 Thread Juan Manuel Macías
Hi Maxim Thanks for your advice, which I appreciate very much. Maxim Nikulin writes: > On 03/03/2021 09:31, Juan Manuel Macías wrote: >> (start-process-shell-command "zathura" nil (concat "zathura " >>clean-path >>

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

2021-03-05 Thread Maxim Nikulin
On 03/03/2021 23:11, Juan Manuel Macías wrote: Maxim Nikulin writes: Please, do not forget to pass stings coming from user input through shell-quote-argument. So, maybe it would look better like this (`start-process' instead of `start-process-shell-command')?: My intention was just to warn

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

2023-01-25 Thread AW
Am Mittwoch, 21. September 2022, 10:18:41 CET schrieb Ihor Radchenko: > Max Nikulin writes: > >> I think that it is a very good idea for Org core to support search terms > >> in file links that are handled by Free Software. > > > > Maybe I misunderstand something, but your stress on Free Software

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

2023-01-25 Thread Ihor Radchenko
AW writes: >> I understand your idea. What I am suggesting is to implement support for >> a subset of popular viewers (the Libre ones) and add it to Org core. >> Support for non-Libre viewers could be added ad third-party packages >> based on the Org core implementation. >> > > Has this been don

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

2023-01-25 Thread Max Nikulin
On 25/01/2023 18:46, AW wrote: Has this been done? I'm struggeling (again), how to link to a certain page of a PDF, being opened in okular. ./link/xyz.pdf::123 does not open the pdf at p. 123 It is still at the stage of proof of concept. Currently you need to adjust your init.el, see Max Ni

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

2023-01-25 Thread Jean Louis
* AW [2023-01-25 14:48]: > Has this been done? I'm struggeling (again), how to link to a certain page of > a PDF, being opened in okular. > > ./link/xyz.pdf::123 does not open the pdf at p. 123 Simply do elisp: links with the below function: [[elisp:(rcd-okular "/home/user/my-file" 2 "small p