emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* pdf files with openwith only, and only this.
@ 2019-07-04 10:41 Joseph Vidal-Rosset
  2019-07-04 11:00 ` Colin Baxter
  0 siblings, 1 reply; 10+ messages in thread
From: Joseph Vidal-Rosset @ 2019-07-04 10:41 UTC (permalink / raw)
  To: Liste-emacs-orgmode@gnu.org

Hi the list,

I do not want to use pdf-tools to view pdf in emacs, I want only to
use an external program (evince) to view pdf files. Unfortunately,
links to pdf do not work with openwith and my emacs open on a pdf. I
cannot delete pdft-tools that is a dependency of org-ref that I am
using. A solution for my setup would be welcome.

Best wishes,

Jo.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pdf files with openwith only, and only this.
  2019-07-04 10:41 pdf files with openwith only, and only this Joseph Vidal-Rosset
@ 2019-07-04 11:00 ` Colin Baxter
  2019-07-04 11:23   ` Joseph Vidal-Rosset
  0 siblings, 1 reply; 10+ messages in thread
From: Colin Baxter @ 2019-07-04 11:00 UTC (permalink / raw)
  To: Joseph Vidal-Rosset; +Cc: Liste-emacs-orgmode@gnu.org

Dear Joseph,
>>>>> Joseph Vidal-Rosset <joseph.vidal.rosset@gmail.com> writes:

    > Hi the list, I do not want to use pdf-tools to view pdf in emacs,
    > I want only to use an external program (evince) to view pdf
    > files. Unfortunately, links to pdf do not work with openwith and
    > my emacs open on a pdf. I cannot delete pdft-tools that is a
    > dependency of org-ref that I am using. A solution for my setup
    > would be welcome.

Try this:

(add-hook 'org-mode-hook
           '(lambda ()
            (delete '("\\.pdf\\'" . default) org-file-apps)
            (add-to-list 'org-file-apps '("\\.pdf\\'" . "evince %s"))))

Best wishes,
 
Colin Baxter
www.Colin-Baxter.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pdf files with openwith only, and only this.
  2019-07-04 11:00 ` Colin Baxter
@ 2019-07-04 11:23   ` Joseph Vidal-Rosset
  2019-07-04 11:38     ` Colin Baxter
  2019-07-04 11:44     ` John Kitchin
  0 siblings, 2 replies; 10+ messages in thread
From: Joseph Vidal-Rosset @ 2019-07-04 11:23 UTC (permalink / raw)
  To: Colin Baxter; +Cc: Liste-emacs-orgmode@gnu.org

Dear Colin (cc. John),

Many thanks ! Unfortunately, I have always the same result. Here is the message:

Viewing with pdf-view-mode
pdf-info-encrypted-p: pdf-info-epdfinfo-program is not executable

is org-ref the culprit? I cc. to John Kitchin.

Best wishes,

Jo.

Le jeu. 4 juil. 2019 à 13:00, Colin Baxter <m43cap@yandex.com> a écrit :
>
> Dear Joseph,
> >>>>> Joseph Vidal-Rosset <joseph.vidal.rosset@gmail.com> writes:
>
>     > Hi the list, I do not want to use pdf-tools to view pdf in emacs,
>     > I want only to use an external program (evince) to view pdf
>     > files. Unfortunately, links to pdf do not work with openwith and
>     > my emacs open on a pdf. I cannot delete pdft-tools that is a
>     > dependency of org-ref that I am using. A solution for my setup
>     > would be welcome.
>
> Try this:
>
> (add-hook 'org-mode-hook
>            '(lambda ()
>             (delete '("\\.pdf\\'" . default) org-file-apps)
>             (add-to-list 'org-file-apps '("\\.pdf\\'" . "evince %s"))))
>
> Best wishes,
>
> Colin Baxter
> www.Colin-Baxter.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pdf files with openwith only, and only this.
  2019-07-04 11:23   ` Joseph Vidal-Rosset
@ 2019-07-04 11:38     ` Colin Baxter
  2019-07-04 11:44     ` John Kitchin
  1 sibling, 0 replies; 10+ messages in thread
From: Colin Baxter @ 2019-07-04 11:38 UTC (permalink / raw)
  To: Joseph Vidal-Rosset; +Cc: Liste-emacs-orgmode@gnu.org

>>>>> Joseph Vidal-Rosset <joseph.vidal.rosset@gmail.com> writes:

    > Dear Colin (cc. John), Many thanks ! Unfortunately, I have always
    > the same result. Here is the message:

    > Viewing with pdf-view-mode pdf-info-encrypted-p:
    > pdf-info-epdfinfo-program is not executable

    > is org-ref the culprit? I cc. to John Kitchin.

That is odd. I slightly modified my code for your situation of using
evince. I actually use xpdf and

 (add-hook 'org-mode-hook
           '(lambda ()
            (delete '("\\.pdf\\'" . default) org-file-apps)
            (add-to-list 'org-file-apps '("\\.pdf\\'" . "xpdf %s"))))

works for me. I assumed just changing xpdf to evince would be
sufficient.

Something more subtle may be happening.

Best wishes,


Colin Baxter
www.Colin-Baxter.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pdf files with openwith only, and only this.
  2019-07-04 11:23   ` Joseph Vidal-Rosset
  2019-07-04 11:38     ` Colin Baxter
@ 2019-07-04 11:44     ` John Kitchin
  2019-07-04 12:48       ` Colin Baxter
  2019-07-04 13:25       ` Joseph Vidal-Rosset
  1 sibling, 2 replies; 10+ messages in thread
From: John Kitchin @ 2019-07-04 11:44 UTC (permalink / raw)
  To: Joseph Vidal-Rosset; +Cc: Colin Baxter, Liste-emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 2096 bytes --]

I don't think org-ref is responsible, except that it installs pdf-tools.
When I click on a link like
[[./2019-07-04.pdf]] it opens in acrobat for me.

I don't have anything fancy
org-file-apps is a variable defined in `org.el'.
Its value is
((auto-mode . emacs) ("\\.mm\\'" . default) ("\\.x?html?\\'" . default)
 ("\\.pdf\\'" . default))

which I guess means on osx that it gets opened with "open".

It looks like you can do this

#+BEGIN_SRC emacs-lisp
(setf (cdr (assoc "\\.pdf\\'" org-file-apps)) "evince %s")
#+END_SRC

to make it open in evince.


John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Thu, Jul 4, 2019 at 7:24 AM Joseph Vidal-Rosset <
joseph.vidal.rosset@gmail.com> wrote:

> Dear Colin (cc. John),
>
> Many thanks ! Unfortunately, I have always the same result. Here is the
> message:
>
> Viewing with pdf-view-mode
> pdf-info-encrypted-p: pdf-info-epdfinfo-program is not executable
>
> is org-ref the culprit? I cc. to John Kitchin.
>
> Best wishes,
>
> Jo.
>
> Le jeu. 4 juil. 2019 à 13:00, Colin Baxter <m43cap@yandex.com> a écrit :
> >
> > Dear Joseph,
> > >>>>> Joseph Vidal-Rosset <joseph.vidal.rosset@gmail.com> writes:
> >
> >     > Hi the list, I do not want to use pdf-tools to view pdf in emacs,
> >     > I want only to use an external program (evince) to view pdf
> >     > files. Unfortunately, links to pdf do not work with openwith and
> >     > my emacs open on a pdf. I cannot delete pdft-tools that is a
> >     > dependency of org-ref that I am using. A solution for my setup
> >     > would be welcome.
> >
> > Try this:
> >
> > (add-hook 'org-mode-hook
> >            '(lambda ()
> >             (delete '("\\.pdf\\'" . default) org-file-apps)
> >             (add-to-list 'org-file-apps '("\\.pdf\\'" . "evince %s"))))
> >
> > Best wishes,
> >
> > Colin Baxter
> > www.Colin-Baxter.com
>
>

[-- Attachment #2: Type: text/html, Size: 3361 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pdf files with openwith only, and only this.
  2019-07-04 11:44     ` John Kitchin
@ 2019-07-04 12:48       ` Colin Baxter
  2019-07-04 13:25       ` Joseph Vidal-Rosset
  1 sibling, 0 replies; 10+ messages in thread
From: Colin Baxter @ 2019-07-04 12:48 UTC (permalink / raw)
  To: John Kitchin; +Cc: Liste-emacs-orgmode@gnu.org, Joseph Vidal-Rosset

>>>>> John Kitchin <jkitchin@andrew.cmu.edu> writes:

    > I don't think org-ref is responsible, except that it installs
    > pdf-tools.  When I click on a link like [[./2019-07-04.pdf]] it
    > opens in acrobat for me.

    > I don't have anything fancy org-file-apps is a variable defined in
    > `org.el'.  Its value is ((auto-mode . emacs) ("\\.mm\\'"
    > . default) ("\\.x?html?\\'" . default) ("\\.pdf\\'" . default))

    > which I guess means on osx that it gets opened with "open".

    > It looks like you can do this

    > (setf (cdr (assoc "\\.pdf\\'" org-file-apps)) "evince %s")

Yes, that works for me too.

Best wishes,

Colin Baxter
www.Colin-Baxter.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pdf files with openwith only, and only this.
  2019-07-04 11:44     ` John Kitchin
  2019-07-04 12:48       ` Colin Baxter
@ 2019-07-04 13:25       ` Joseph Vidal-Rosset
  2019-07-04 18:05         ` John Kitchin
  2019-07-04 23:15         ` Tim Cross
  1 sibling, 2 replies; 10+ messages in thread
From: Joseph Vidal-Rosset @ 2019-07-04 13:25 UTC (permalink / raw)
  To: John Kitchin; +Cc: Colin Baxter, Liste-emacs-orgmode@gnu.org

Le   jeu.   07/04/19   juil.   2019    à   07:44:08   ,   John   Kitchin
<jkitchin@andrew.cmu.edu> a envoyé ce message:
> I don't think org-ref is responsible, except that it installs pdf-tools. When I click on a link like 
> [[./2019-07-04.pdf]] it opens in acrobat for me.
>
> I don't have anything fancy
> org-file-apps is a variable defined in `org.el'.
> Its value is
> ((auto-mode . emacs) ("\\.mm\\'" . default) ("\\.x?html?\\'" . default)
>  ("\\.pdf\\'" . default))
>
> which I guess means on osx that it gets opened with "open".
>
> It looks like you can do this
>
> #+BEGIN_SRC emacs-lisp
> (setf (cdr (assoc "\\.pdf\\'" org-file-apps)) "evince %s")
> #+END_SRC
>
> to make it open in evince.

Dear John,

Thanks for  your reply. In  fact my problem is  only at the  moment with
pdf links  in gnus, not  in usual org files.  (Maybe I should  switch for
mu4e, but I  hesitate and I would be  happy to find a tutorial  to do it
with gmail.)

I    have    solved    temporarily    the   problem    with    eimp    :
https://emacs.stackexchange.com/questions/2433/shrink-zoom-scale-images-in-image-mode

and the pdf in emacs are now more easily readable for me. 

Best wishes, and again, to Colin and to you, many thanks. 

-- 
Jo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pdf files with openwith only, and only this.
  2019-07-04 13:25       ` Joseph Vidal-Rosset
@ 2019-07-04 18:05         ` John Kitchin
  2019-07-04 23:15         ` Tim Cross
  1 sibling, 0 replies; 10+ messages in thread
From: John Kitchin @ 2019-07-04 18:05 UTC (permalink / raw)
  To: Joseph Vidal-Rosset; +Cc: Colin Baxter, Liste-emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1844 bytes --]

you might also try this:
https://emacs.stackexchange.com/questions/3105/how-to-use-an-external-program-as-the-default-way-to-open-pdfs-from-emacs/3106

John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Thu, Jul 4, 2019 at 9:26 AM Joseph Vidal-Rosset <
joseph.vidal.rosset@gmail.com> wrote:

> Le   jeu.   07/04/19   juil.   2019    à   07:44:08   ,   John   Kitchin
> <jkitchin@andrew.cmu.edu> a envoyé ce message:
> > I don't think org-ref is responsible, except that it installs pdf-tools.
> When I click on a link like
> > [[./2019-07-04.pdf]] it opens in acrobat for me.
> >
> > I don't have anything fancy
> > org-file-apps is a variable defined in `org.el'.
> > Its value is
> > ((auto-mode . emacs) ("\\.mm\\'" . default) ("\\.x?html?\\'" . default)
> >  ("\\.pdf\\'" . default))
> >
> > which I guess means on osx that it gets opened with "open".
> >
> > It looks like you can do this
> >
> > #+BEGIN_SRC emacs-lisp
> > (setf (cdr (assoc "\\.pdf\\'" org-file-apps)) "evince %s")
> > #+END_SRC
> >
> > to make it open in evince.
>
> Dear John,
>
> Thanks for  your reply. In  fact my problem is  only at the  moment with
> pdf links  in gnus, not  in usual org files.  (Maybe I should  switch for
> mu4e, but I  hesitate and I would be  happy to find a tutorial  to do it
> with gmail.)
>
> I    have    solved    temporarily    the   problem    with    eimp    :
>
> https://emacs.stackexchange.com/questions/2433/shrink-zoom-scale-images-in-image-mode
>
> and the pdf in emacs are now more easily readable for me.
>
> Best wishes, and again, to Colin and to you, many thanks.
>
> --
> Jo
>

[-- Attachment #2: Type: text/html, Size: 3007 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pdf files with openwith only, and only this.
  2019-07-04 13:25       ` Joseph Vidal-Rosset
  2019-07-04 18:05         ` John Kitchin
@ 2019-07-04 23:15         ` Tim Cross
  2019-07-05  9:41           ` Joseph Vidal-Rosset
  1 sibling, 1 reply; 10+ messages in thread
From: Tim Cross @ 2019-07-04 23:15 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Colin Baxter, John Kitchin


Joseph Vidal-Rosset <joseph.vidal.rosset@gmail.com> writes:

> Le   jeu.   07/04/19   juil.   2019    à   07:44:08   ,   John   Kitchin
> <jkitchin@andrew.cmu.edu> a envoyé ce message:
>> I don't think org-ref is responsible, except that it installs pdf-tools. When I click on a link like 
>> [[./2019-07-04.pdf]] it opens in acrobat for me.
>>
>> I don't have anything fancy
>> org-file-apps is a variable defined in `org.el'.
>> Its value is
>> ((auto-mode . emacs) ("\\.mm\\'" . default) ("\\.x?html?\\'" . default)
>>  ("\\.pdf\\'" . default))
>>
>> which I guess means on osx that it gets opened with "open".
>>
>> It looks like you can do this
>>
>> #+BEGIN_SRC emacs-lisp
>> (setf (cdr (assoc "\\.pdf\\'" org-file-apps)) "evince %s")
>> #+END_SRC
>>
>> to make it open in evince.
>
> Dear John,
>
> Thanks for  your reply. In  fact my problem is  only at the  moment with
> pdf links  in gnus, not  in usual org files.  (Maybe I should  switch for
> mu4e, but I  hesitate and I would be  happy to find a tutorial  to do it
> with gmail.)
>
> I    have    solved    temporarily    the   problem    with    eimp    :
> https://emacs.stackexchange.com/questions/2433/shrink-zoom-scale-images-in-image-mode
>
> and the pdf in emacs are now more easily readable for me. 
>
> Best wishes, and again, to Colin and to you, many thanks. 

My guess is the problem is with doc-view mode and possibly guns setup. I
had a similar issue some years back, but cannot quite remember how I
resolved it. My problem was that I had elisp I wrote which would use
external viewers for various document types (e.g. word doc, pdf, etc),
but when I tried to use it, Emacs would jump in the middle and use
docView mode to display it inside emacs itself.

From memroy, the basic fix was to turn off doc-view-mode (posibly check
out the customization group). With respect to gnus (and other mailers),
most of them include some sort of variable which sets which mime types
can be displayed internally. If you don't want to completely disable
doc-view-mode, you should be able to change this setting to say that
PDFs are tro be displayed externally using whatever program is
associated with that mime type.

hth

Tim

-- 
Tim Cross

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: pdf files with openwith only, and only this.
  2019-07-04 23:15         ` Tim Cross
@ 2019-07-05  9:41           ` Joseph Vidal-Rosset
  0 siblings, 0 replies; 10+ messages in thread
From: Joseph Vidal-Rosset @ 2019-07-05  9:41 UTC (permalink / raw)
  To: Tim Cross, Colin Baxter, John Kitchin; +Cc: Liste-emacs-orgmode@gnu.org

Dear Tim, John and Colin,

You are right Tim, for Gnus, the solution to my problem was here :

https://www.emacswiki.org/emacs/MimeTypesWithGnus

and here:

https://lists.gnu.org/archive/html/info-gnus-english/2016-04/msg00002.html

But I just realize that Gnus gives the choice to open "internally", or
"externally"... :S

Best wishes and many thanks for your very kind help,

Jo.

Le ven. 5 juil. 2019 à 01:16, Tim Cross <theophilusx@gmail.com> a écrit :
>
>
> Joseph Vidal-Rosset <joseph.vidal.rosset@gmail.com> writes:
>
> > Le   jeu.   07/04/19   juil.   2019    à   07:44:08   ,   John   Kitchin
> > <jkitchin@andrew.cmu.edu> a envoyé ce message:
> >> I don't think org-ref is responsible, except that it installs pdf-tools. When I click on a link like
> >> [[./2019-07-04.pdf]] it opens in acrobat for me.
> >>
> >> I don't have anything fancy
> >> org-file-apps is a variable defined in `org.el'.
> >> Its value is
> >> ((auto-mode . emacs) ("\\.mm\\'" . default) ("\\.x?html?\\'" . default)
> >>  ("\\.pdf\\'" . default))
> >>
> >> which I guess means on osx that it gets opened with "open".
> >>
> >> It looks like you can do this
> >>
> >> #+BEGIN_SRC emacs-lisp
> >> (setf (cdr (assoc "\\.pdf\\'" org-file-apps)) "evince %s")
> >> #+END_SRC
> >>
> >> to make it open in evince.
> >
> > Dear John,
> >
> > Thanks for  your reply. In  fact my problem is  only at the  moment with
> > pdf links  in gnus, not  in usual org files.  (Maybe I should  switch for
> > mu4e, but I  hesitate and I would be  happy to find a tutorial  to do it
> > with gmail.)
> >
> > I    have    solved    temporarily    the   problem    with    eimp    :
> > https://emacs.stackexchange.com/questions/2433/shrink-zoom-scale-images-in-image-mode
> >
> > and the pdf in emacs are now more easily readable for me.
> >
> > Best wishes, and again, to Colin and to you, many thanks.
>
> My guess is the problem is with doc-view mode and possibly guns setup. I
> had a similar issue some years back, but cannot quite remember how I
> resolved it. My problem was that I had elisp I wrote which would use
> external viewers for various document types (e.g. word doc, pdf, etc),
> but when I tried to use it, Emacs would jump in the middle and use
> docView mode to display it inside emacs itself.
>
> From memroy, the basic fix was to turn off doc-view-mode (posibly check
> out the customization group). With respect to gnus (and other mailers),
> most of them include some sort of variable which sets which mime types
> can be displayed internally. If you don't want to completely disable
> doc-view-mode, you should be able to change this setting to say that
> PDFs are tro be displayed externally using whatever program is
> associated with that mime type.
>
> hth
>
> Tim
>
> --
> Tim Cross
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-07-05  9:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-04 10:41 pdf files with openwith only, and only this Joseph Vidal-Rosset
2019-07-04 11:00 ` Colin Baxter
2019-07-04 11:23   ` Joseph Vidal-Rosset
2019-07-04 11:38     ` Colin Baxter
2019-07-04 11:44     ` John Kitchin
2019-07-04 12:48       ` Colin Baxter
2019-07-04 13:25       ` Joseph Vidal-Rosset
2019-07-04 18:05         ` John Kitchin
2019-07-04 23:15         ` Tim Cross
2019-07-05  9:41           ` Joseph Vidal-Rosset

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).