GNU bug report logs - #28905
11.90.2.2017-07-25; TeX-documentation-texdoc blocks

Previous Next

Package: auctex;

Reported by: fran.burstall <at> gmail.com

Date: Thu, 19 Oct 2017 21:40:02 UTC

Severity: normal

Tags: fixed

Found in version 11.90.2.2017

Done: Ikumi Keita <ikumi <at> ikumi.que.jp>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28905 in the body.
You can then email your comments to 28905 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-auctex <at> gnu.org:
bug#28905; Package auctex. (Thu, 19 Oct 2017 21:40:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to fran.burstall <at> gmail.com:
New bug report received and forwarded. Copy sent to bug-auctex <at> gnu.org. (Thu, 19 Oct 2017 21:40:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Fran Burstall (Gmail)" <fran.burstall <at> gmail.com>
To: bug-auctex <at> gnu.org
Subject: 11.90.2.2017-07-25; TeX-documentation-texdoc blocks
Date: Thu, 19 Oct 2017 22:38:53 +0100
[Message part 1 (text/plain, inline)]
Greetings!

I do

M-x TeX-documentation-texdoc

and supply the argument amsmath when prompted.  An evince
window fires with the documentation but emacs is blocked
until I exit evince.

If I try the same thing with tex-doc, evince fires but emacs
remains usable.

Experiment suggests that the former uses
shell-command-to-string and this blocks while the latter
uses call-process to fire texdoc and this does not block
(or, at least, exits once texdoc has handed off to evince).

Thanks for the wonderful package!

---Fran



Emacs  : GNU Emacs 24.4.1 (i586-pc-linux-gnu, GTK+ Version 3.14.5)
 of 2017-09-12 on x86-csail-01, modified by Debian
Package: 11.90.2.2017-07-25

current state:
==============
(setq
 AUCTeX-date "2017-07-25"
 window-system 'x
 LaTeX-version "2e"
 TeX-style-path '("~/.emacs.d/auctex"
"/home/fran/.emacs.d/elpa/auctex-11.91.0/style"
  "/home/fran/.emacs.d/auctex/auto" "/home/fran/.emacs.d/auctex/style"
"auto" "style")
 TeX-auto-save t
 TeX-parse-self t
 TeX-master t
 TeX-command-list '(("TeX" "%(PDF)%(tex) %(file-line-error) %(extraopts)
%`%S%(PDFout)%(mode)%' %t" TeX-run-TeX
     nil (plain-tex-mode ams-tex-mode texinfo-mode) :help "Run plain TeX")
    ("LaTeX" "%`%l%(mode)%' %t" TeX-run-TeX nil (latex-mode doctex-mode)
:help "Run LaTeX")
    ("Makeinfo" "makeinfo %(extraopts) %t" TeX-run-compile nil
(texinfo-mode) :help
     "Run Makeinfo with Info output")
    ("Makeinfo HTML" "makeinfo %(extraopts) --html %t" TeX-run-compile nil
(texinfo-mode) :help
     "Run Makeinfo with HTML output")
    ("AmSTeX" "amstex %(PDFout) %(extraopts) %`%S%(mode)%' %t" TeX-run-TeX
nil (ams-tex-mode)
     :help "Run AMSTeX")
    ("ConTeXt" "%(cntxcom) --once --texutil %(extraopts) %(execopts)%t"
TeX-run-TeX nil
     (context-mode) :help "Run ConTeXt once")
    ("ConTeXt Full" "%(cntxcom) %(extraopts) %(execopts)%t" TeX-run-TeX nil
(context-mode) :help
     "Run ConTeXt until completion")
    ("BibTeX" "bibtex %s" TeX-run-BibTeX nil t :help "Run BibTeX")
    ("Biber" "biber %s" TeX-run-Biber nil t :help "Run Biber")
    ("View" "%V" TeX-run-discard-or-function t t :help "Run Viewer")
    ("Print" "%p" TeX-run-command t t :help "Print the file")
    ("Queue" "%q" TeX-run-background nil t :help "View the printer queue"
:visible
     TeX-queue-command)
    ("File" "%(o?)dvips %d -o %f " TeX-run-dvips t t :help "Generate
PostScript file")
    ("Dvips" "%(o?)dvips %d -o %f " TeX-run-dvips nil t :help "Convert DVI
file to PostScript")
    ("Dvipdfmx" "dvipdfmx %d" TeX-run-dvipdfmx nil t :help
     "Convert DVI file to PDF with dvipdfmx")
    ("Ps2pdf" "ps2pdf %f" TeX-run-ps2pdf nil t :help "Convert PostScript
file to PDF")
    ("Glossaries" "makeglossaries %s" TeX-run-command nil t :help
     "Run makeglossaries to create glossary file")
    ("Index" "makeindex %s" TeX-run-index nil t :help "Run makeindex to
create index file")
    ("upMendex" "upmendex %s" TeX-run-index t t :help "Run upmendex to
create index file")
    ("Xindy" "texindy %s" TeX-run-command nil t :help "Run xindy to create
index file")
    ("Check" "lacheck %s" TeX-run-compile nil (latex-mode) :help
     "Check LaTeX file for correctness")
    ("ChkTeX" "chktex -v6 %s" TeX-run-compile nil (latex-mode) :help
     "Check LaTeX file for common mistakes")
    ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil t :help
     "Spell-check the document")
    ("Clean" "TeX-clean" TeX-run-function nil t :help "Delete generated
intermediate files")
    ("Clean All" "(TeX-clean t)" TeX-run-function nil t :help
     "Delete generated intermediate and output files")
    ("Other" "" TeX-run-command t t :help "Run an arbitrary command"))
 )
[Message part 2 (text/html, inline)]

Information forwarded to bug-auctex <at> gnu.org:
bug#28905; Package auctex. (Thu, 19 Oct 2017 22:41:02 GMT) Full text and rfc822 format available.

Message #8 received at 28905 <at> debbugs.gnu.org (full text, mbox):

From: Mosè Giordano <mose <at> gnu.org>
To: fran.burstall <at> gmail.com
Cc: 28905 <at> debbugs.gnu.org
Subject: Re: bug#28905: 11.90.2.2017-07-25; TeX-documentation-texdoc blocks
Date: Fri, 20 Oct 2017 00:39:48 +0200
Hi Fran,

2017-10-19 23:38 GMT+02:00 Fran Burstall (Gmail) <fran.burstall <at> gmail.com>:
> Greetings!
>
> I do
>
> M-x TeX-documentation-texdoc
>
> and supply the argument amsmath when prompted.  An evince
> window fires with the documentation but emacs is blocked
> until I exit evince.
>
> If I try the same thing with tex-doc, evince fires but emacs
> remains usable.
>
> Experiment suggests that the former uses
> shell-command-to-string and this blocks while the latter

That's true, but I can't reproduce your issue.  What happens if you run

    texdoc amsmath

in your terminal?  For me the viewer is opened in the background, so
the shell is free and the prompt readily appears, without waiting for
the viewer to be closed.  Isn't this the case for you?

> uses call-process to fire texdoc and this does not block
> (or, at least, exits once texdoc has handed off to evince).
>
> Thanks for the wonderful package!

You're welcome!

Bye,
Mosè




Information forwarded to bug-auctex <at> gnu.org:
bug#28905; Package auctex. (Fri, 20 Oct 2017 02:12:01 GMT) Full text and rfc822 format available.

Message #11 received at 28905 <at> debbugs.gnu.org (full text, mbox):

From: Mosè Giordano <mose <at> gnu.org>
To: Fran Burstall <fran.burstall <at> gmail.com>, 28905 <at> debbugs.gnu.org
Subject: Re: bug#28905: 11.90.2.2017-07-25; TeX-documentation-texdoc blocks
Date: Fri, 20 Oct 2017 04:10:33 +0200
Dear Fran,

please, when you reply to mailing lists use the "Reply all" button, so
that the message will be delivered to all readers, not just me, and
recorded in the bug tracker.

2017-10-20 1:10 GMT+02:00 Fran Burstall (Gmail) <fran.burstall <at> gmail.com>:
> Hi Mosè,
>
> Yes, I get the same behaviour as you in the terminal: the prompt reappears
> almost at once and evince fires.
>
> However, in the scratch buffer of my emacs, evaluating
>
> (shell-command-to-string "texdoc --view amsmath")
>
> blocks emacs (I even get an OS rotating busy timer for a pointer until the
> evince window is closed) while evaluating
>
> (call-process "texdoc" nil 0 nil "--view" "amsmath")
>
> gives me a non-blocked emacs while the evince window is open.
>
> Any ideas?

Not really.  Anyone else has a clue of what may be going on here?

Bye,
Mosè




Information forwarded to bug-auctex <at> gnu.org:
bug#28905; Package auctex. (Sun, 22 Oct 2017 13:14:01 GMT) Full text and rfc822 format available.

Message #14 received at 28905 <at> debbugs.gnu.org (full text, mbox):

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Mosè Giordano <mose <at> gnu.org>
Cc: 28905 <at> debbugs.gnu.org, fran.burstall <at> gmail.com
Subject: Re: bug#28905: 11.90.2.2017-07-25; TeX-documentation-texdoc blocks
Date: Sun, 22 Oct 2017 22:13:17 +0900
Hi Fran and Mosè,

>>>>> Mosè Giordano <mose <at> gnu.org> writes:
> Hi Fran,
> 2017-10-19 23:38 GMT+02:00 Fran Burstall (Gmail) <fran.burstall <at> gmail.com>:
>> Greetings!
>> 
>> I do
>> 
>> M-x TeX-documentation-texdoc
>> 
>> and supply the argument amsmath when prompted.  An evince
>> window fires with the documentation but emacs is blocked
>> until I exit evince.
>> 
>> If I try the same thing with tex-doc, evince fires but emacs
>> remains usable.
>> 
>> Experiment suggests that the former uses
>> shell-command-to-string and this blocks while the latter

> That's true, but I can't reproduce your issue.

Fran's problem reproduces on my machine.  The output of
TeX-sumit-bug-report is at the tail of this message.

>  What happens if you run

>     texdoc amsmath

> in your terminal?  For me the viewer is opened in the background, so
> the shell is free and the prompt readily appears, without waiting for
> the viewer to be closed.  Isn't this the case for you?

My result is the same as Fran's, too.  On my kterm (xterm variant
capable of dealing with Japanese texts), the viewer is opened in the
background, the shell is free and the prompt readily appears, without
waiting for the viewer to be closed.

It doesn't help to change the part
(concat "texdoc --view " pkg)
in `TeX-documentation-texdoc' to
(concat "exec texdoc --view " pkg " &")
for my case.  It seems that emacs grabs something of the subprocess of
the shell and does not release it until all(?) of subprocess terminate.

Regards,
Ikumi Keita

Emacs  : GNU Emacs 25.3.1 (x86_64-unknown-freebsd11.1, GTK+ Version 3.22.15)
 of 2017-09-13
Package: 11.91

current state:
==============
(setq
 AUCTeX-date "2017-07-24"
 window-system 'x
 LaTeX-version "2e"
 TeX-style-path '("/usr/local/var/auctex"
		  "/usr/local/share/emacs/site-lisp/auctex/style"
		  "/home/keita/.emacs.d/auctex/auto"
		  "/home/keita/.emacs.d/auctex/style" "auto" "style")
 TeX-auto-save nil
 TeX-parse-self t
 TeX-master t
 TeX-command-list '(("jTeX" "%(PDF)jtex %`%S%(PDFout)%(mode)%' %t" TeX-run-TeX
		     nil (plain-tex-mode) :help "Run NTT jTeX")
		    ("jLaTeX" "%(PDF)jlatex %`%S%(PDFout)%(mode)%' %t"
		     TeX-run-TeX nil (latex-mode) :help "Run NTT jLaTeX")
		    ("pTeX" "%(PDF)ptex %(kanjiopt)%`%S%(PDFout)%(mode)%' %t"
		     TeX-run-TeX nil (plain-tex-mode) :help "Run ASCII pTeX")
		    ("pLaTeX"
		     "%(PDF)platex %(kanjiopt)%`%S%(PDFout)%(mode)%' %t"
		     TeX-run-TeX nil (latex-mode) :help "Run ASCII pLaTeX")
		    ("Mendex" "mendex %(mendexkopt)%s" TeX-run-command nil t
		     :help "Create index file with mendex")
		    ("jBibTeX" "jbibtex %s" TeX-run-BibTeX nil t :help
		     "Run jBibTeX")
		    ("pBibTeX" "pbibtex %(kanjiopt)%s" TeX-run-BibTeX nil t
		     :help "Run pBibTeX")
		    ("-" "" ignore nil t)
		    ("TeX"
		     "%(PDF)%(tex) %(file-line-error) %(extraopts) %`%S%(PDFout)%(mode)%' %t"
		     TeX-run-TeX nil
		     (plain-tex-mode ams-tex-mode texinfo-mode) :help
		     "Run plain TeX")
		    ("LaTeX" "%`%l%(mode)%' %t" TeX-run-TeX nil
		     (latex-mode doctex-mode) :help "Run LaTeX")
		    ("Makeinfo" "makeinfo %(extraopts) %t" TeX-run-compile nil
		     (texinfo-mode) :help "Run Makeinfo with Info output")
		    ("Makeinfo HTML" "makeinfo %(extraopts) --html %t"
		     TeX-run-compile nil (texinfo-mode) :help
		     "Run Makeinfo with HTML output")
		    ("AmSTeX" "amstex %(PDFout) %(extraopts) %`%S%(mode)%' %t"
		     TeX-run-TeX nil (ams-tex-mode) :help "Run AMSTeX")
		    ("ConTeXt"
		     "%(cntxcom) --once --texutil %(extraopts) %(execopts)%t"
		     TeX-run-TeX nil (context-mode) :help "Run ConTeXt once")
		    ("ConTeXt Full" "%(cntxcom) %(extraopts) %(execopts)%t"
		     TeX-run-TeX nil (context-mode) :help
		     "Run ConTeXt until completion")
		    ("BibTeX" "%(bibtex) %s" TeX-run-BibTeX nil t :help
		     "Run BibTeX")
		    ("Biber" "biber %s" TeX-run-Biber nil t :help "Run Biber")
		    ("View" "%V" TeX-run-discard-or-function t t :help
		     "Run Viewer")
		    ("Print" "%p" TeX-run-command t t :help "Print the file")
		    ("Queue" "%q" TeX-run-background nil t :help
		     "View the printer queue" :visible TeX-queue-command)
		    ("File" "%(o?)dvips %d -o %f " TeX-run-dvips t t :help
		     "Generate PostScript file")
		    ("Dvips" "%(o?)dvips %d -o %f " TeX-run-dvips nil t :help
		     "Convert DVI file to PostScript")
		    ("Dvipdfmx" "dvipdfmx %d" TeX-run-dvipdfmx nil t :help
		     "Convert DVI file to PDF with dvipdfmx")
		    ("Ps2pdf" "ps2pdf %f" TeX-run-ps2pdf nil t :help
		     "Convert PostScript file to PDF")
		    ("Glossaries" "makeglossaries %s" TeX-run-command nil t
		     :help "Run makeglossaries to create glossary file")
		    ("Index" "%(makeindex) %s" TeX-run-index nil t :help
		     "Run makeindex to create index file")
		    ("upMendex" "upmendex %s" TeX-run-index t t :help
		     "Run upmendex to create index file")
		    ("Xindy" "texindy %s" TeX-run-command nil t :help
		     "Run xindy to create index file")
		    ("Check" "lacheck %s" TeX-run-compile nil (latex-mode)
		     :help "Check LaTeX file for correctness")
		    ("ChkTeX" "chktex -v6 %s" TeX-run-compile nil (latex-mode)
		     :help "Check LaTeX file for common mistakes")
		    ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil
		     t :help "Spell-check the document")
		    ("Clean" "TeX-clean" TeX-run-function nil t :help
		     "Delete generated intermediate files")
		    ("Clean All" "(TeX-clean t)" TeX-run-function nil t :help
		     "Delete generated intermediate and output files")
		    ("Other" "" TeX-run-command t t :help
		     "Run an arbitrary command")
		    )
 )




Information forwarded to bug-auctex <at> gnu.org:
bug#28905; Package auctex. (Sun, 22 Oct 2017 17:27:01 GMT) Full text and rfc822 format available.

Message #17 received at 28905 <at> debbugs.gnu.org (full text, mbox):

From: Mosè Giordano <mose <at> gnu.org>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: 28905 <at> debbugs.gnu.org, Fran Burstall <fran.burstall <at> gmail.com>
Subject: Re: bug#28905: 11.90.2.2017-07-25; TeX-documentation-texdoc blocks
Date: Sun, 22 Oct 2017 19:25:35 +0200
Hi Keita,

2017-10-22 15:13 GMT+02:00 Ikumi Keita <ikumi <at> ikumi.que.jp>:
> Hi Fran and Mosè,
>
>>>>>> Mosè Giordano <mose <at> gnu.org> writes:
>> Hi Fran,
>> 2017-10-19 23:38 GMT+02:00 Fran Burstall (Gmail) <fran.burstall <at> gmail.com>:
>>> Greetings!
>>>
>>> I do
>>>
>>> M-x TeX-documentation-texdoc
>>>
>>> and supply the argument amsmath when prompted.  An evince
>>> window fires with the documentation but emacs is blocked
>>> until I exit evince.
>>>
>>> If I try the same thing with tex-doc, evince fires but emacs
>>> remains usable.
>>>
>>> Experiment suggests that the former uses
>>> shell-command-to-string and this blocks while the latter
>
>> That's true, but I can't reproduce your issue.
>
> Fran's problem reproduces on my machine.  The output of
> TeX-sumit-bug-report is at the tail of this message.
>
>>  What happens if you run
>
>>     texdoc amsmath
>
>> in your terminal?  For me the viewer is opened in the background, so
>> the shell is free and the prompt readily appears, without waiting for
>> the viewer to be closed.  Isn't this the case for you?
>
> My result is the same as Fran's, too.  On my kterm (xterm variant
> capable of dealing with Japanese texts), the viewer is opened in the
> background, the shell is free and the prompt readily appears, without
> waiting for the viewer to be closed.
>
> It doesn't help to change the part
> (concat "texdoc --view " pkg)
> in `TeX-documentation-texdoc' to
> (concat "exec texdoc --view " pkg " &")
> for my case.  It seems that emacs grabs something of the subprocess of
> the shell and does not release it until all(?) of subprocess terminate.

Thanks for sharing your experience.  The problem with texdoc program
is that it doesn't use return status in a meaningful way.  There is no
way to know if it was able to find a documentation for the requested
package besides reading the output.  Try this:

    $ texdoc foobar
    Sorry, no documentation found for foobar.
    If you are unsure about the name, try searching CTAN's TeX catalogue at
    http://ctan.org/search.html#byDescription.
    $ echo $?
    0

Fran, as a workaround you can bind `TeX-doc' to C-c ? with

    (with-eval-after-load "tex"
      (define-key TeX-mode-map (kbd "C-c ?") 'TeX-doc))

even if I'd like to find a solution to keep `TeX-documentation-texdoc' working.

Bye,
Mosè




Information forwarded to bug-auctex <at> gnu.org:
bug#28905; Package auctex. (Sun, 22 Oct 2017 18:46:02 GMT) Full text and rfc822 format available.

Message #20 received at 28905 <at> debbugs.gnu.org (full text, mbox):

From: "Fran Burstall (Gmail)" <fran.burstall <at> gmail.com>
To: Mosè Giordano <mose <at> gnu.org>
Cc: Ikumi Keita <ikumi <at> ikumi.que.jp>, 28905 <at> debbugs.gnu.org
Subject: Re: bug#28905: 11.90.2.2017-07-25; TeX-documentation-texdoc blocks
Date: Sun, 22 Oct 2017 19:45:36 +0100
[Message part 1 (text/plain, inline)]
Thanks, Moisè, for looking into this and thank you Keita for verifying the
issue.

I shall use tex-doc for the time being.

---Fran


On 22 October 2017 at 18:25, Mosè Giordano <mose <at> gnu.org> wrote:

> Hi Keita,
>
> 2017-10-22 15:13 GMT+02:00 Ikumi Keita <ikumi <at> ikumi.que.jp>:
> > Hi Fran and Mosè,
> >
> >>>>>> Mosè Giordano <mose <at> gnu.org> writes:
> >> Hi Fran,
> >> 2017-10-19 23:38 GMT+02:00 Fran Burstall (Gmail) <
> fran.burstall <at> gmail.com>:
> >>> Greetings!
> >>>
> >>> I do
> >>>
> >>> M-x TeX-documentation-texdoc
> >>>
> >>> and supply the argument amsmath when prompted.  An evince
> >>> window fires with the documentation but emacs is blocked
> >>> until I exit evince.
> >>>
> >>> If I try the same thing with tex-doc, evince fires but emacs
> >>> remains usable.
> >>>
> >>> Experiment suggests that the former uses
> >>> shell-command-to-string and this blocks while the latter
> >
> >> That's true, but I can't reproduce your issue.
> >
> > Fran's problem reproduces on my machine.  The output of
> > TeX-sumit-bug-report is at the tail of this message.
> >
> >>  What happens if you run
> >
> >>     texdoc amsmath
> >
> >> in your terminal?  For me the viewer is opened in the background, so
> >> the shell is free and the prompt readily appears, without waiting for
> >> the viewer to be closed.  Isn't this the case for you?
> >
> > My result is the same as Fran's, too.  On my kterm (xterm variant
> > capable of dealing with Japanese texts), the viewer is opened in the
> > background, the shell is free and the prompt readily appears, without
> > waiting for the viewer to be closed.
> >
> > It doesn't help to change the part
> > (concat "texdoc --view " pkg)
> > in `TeX-documentation-texdoc' to
> > (concat "exec texdoc --view " pkg " &")
> > for my case.  It seems that emacs grabs something of the subprocess of
> > the shell and does not release it until all(?) of subprocess terminate.
>
> Thanks for sharing your experience.  The problem with texdoc program
> is that it doesn't use return status in a meaningful way.  There is no
> way to know if it was able to find a documentation for the requested
> package besides reading the output.  Try this:
>
>     $ texdoc foobar
>     Sorry, no documentation found for foobar.
>     If you are unsure about the name, try searching CTAN's TeX catalogue at
>     http://ctan.org/search.html#byDescription.
>     $ echo $?
>     0
>
> Fran, as a workaround you can bind `TeX-doc' to C-c ? with
>
>     (with-eval-after-load "tex"
>       (define-key TeX-mode-map (kbd "C-c ?") 'TeX-doc))
>
> even if I'd like to find a solution to keep `TeX-documentation-texdoc'
> working.
>
> Bye,
> Mosè
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-auctex <at> gnu.org:
bug#28905; Package auctex. (Sat, 03 Nov 2018 18:03:02 GMT) Full text and rfc822 format available.

Message #23 received at 28905 <at> debbugs.gnu.org (full text, mbox):

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: fran.burstall <at> gmail.com
Cc: 28905 <at> debbugs.gnu.org, Mosè Giordano <mose <at> gnu.org>
Subject: Re: bug#28905: 11.90.2.2017-07-25; TeX-documentation-texdoc blocks
Date: Sun, 04 Nov 2018 03:02:26 +0900
Hi Fran, Mosè and all, I'm responding to one year old thread.

>>>>> "Fran Burstall (Gmail)" <fran.burstall <at> gmail.com> writes:
> Thanks, Moisè, for looking into this and thank you Keita for verifying the
> issue.

> I shall use tex-doc for the time being.

After struggling with this problem again, it seems that I managed to
find out a solution.  The patch listed below resolves the problem on my
environment.  Could you please try it?

If it fixes the problem without harming other's environments, I'll
install this in the git repository.

Regards,
Ikumi Keita

diff --git a/tex.el b/tex.el
index 9995af3f..2d3942f3 100644
--- a/tex.el
+++ b/tex.el
@@ -6350,7 +6350,27 @@ the number of the file to view, anything else to skip: ") list)))
 	;; Called without prefix argument: just run "texdoc --view <pkg>" and
 	;; show the output, so that the user is warned in case it doesn't find
 	;; the documentation or "texdoc" is not available.
-	(message (shell-command-to-string (concat "texdoc --view " pkg)))))))
+	(message
+	 ;; The folowing code to the end of `defun' used to be just
+	 ;; (shell-command-to-string (concat "texdoc --view " pkg))
+	 ;; , but in some cases it blocks emacs until the user quits
+	 ;; the viewer (bug#28905).
+	 (with-output-to-string
+	   (let* (;; Use pipe rather than pty because the latter
+		  ;; causes atril (evince variant viewer) to exit
+		  ;; before showing anything.
+		  (process-connection-type nil)
+		  (process (start-process-shell-command
+			    "Doc view" standard-output
+			    (concat "texdoc --view " pkg))))
+	     ;; Suppress the message "Process Doc view finished".
+	     (set-process-sentinel process #'ignore)
+	     ;; Kill temp buffer without query.  This is necessary if
+	     ;; the underneath shell can't find the texdoc binary, at
+	     ;; least for some environment.
+	     (set-process-query-on-exit-flag process nil)
+	     ;; Don't discard shell output.
+	     (accept-process-output process))))))))
 
 (defun TeX-goto-info-page ()
   "Read documentation for AUCTeX in the info system."





Information forwarded to bug-auctex <at> gnu.org:
bug#28905; Package auctex. (Sat, 03 Nov 2018 21:18:01 GMT) Full text and rfc822 format available.

Message #26 received at 28905 <at> debbugs.gnu.org (full text, mbox):

From: "Fran Burstall (Gmail)" <fran.burstall <at> gmail.com>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: 28905 <at> debbugs.gnu.org, Mosè Giordano <mose <at> gnu.org>
Subject: Re: bug#28905: 11.90.2.2017-07-25; TeX-documentation-texdoc blocks
Date: Sat, 3 Nov 2018 21:17:39 +0000
[Message part 1 (text/plain, inline)]
Hi Ikumi,

It works for me.  Pass "amsmath" to the patched TeX-documentation-texdoc
and it fires evince on the documentation without blocking emacs; fire it on
"foobar" and I get a sensible message about not finding any documentation.

---Fran


On Sat, 3 Nov 2018 at 18:02, Ikumi Keita <ikumi <at> ikumi.que.jp> wrote:

> Hi Fran, Mosè and all, I'm responding to one year old thread.
>
> >>>>> "Fran Burstall (Gmail)" <fran.burstall <at> gmail.com> writes:
> > Thanks, Moisè, for looking into this and thank you Keita for verifying
> the
> > issue.
>
> > I shall use tex-doc for the time being.
>
> After struggling with this problem again, it seems that I managed to
> find out a solution.  The patch listed below resolves the problem on my
> environment.  Could you please try it?
>
> If it fixes the problem without harming other's environments, I'll
> install this in the git repository.
>
> Regards,
> Ikumi Keita
>
> diff --git a/tex.el b/tex.el
> index 9995af3f..2d3942f3 100644
> --- a/tex.el
> +++ b/tex.el
> @@ -6350,7 +6350,27 @@ the number of the file to view, anything else to
> skip: ") list)))
>         ;; Called without prefix argument: just run "texdoc --view <pkg>"
> and
>         ;; show the output, so that the user is warned in case it doesn't
> find
>         ;; the documentation or "texdoc" is not available.
> -       (message (shell-command-to-string (concat "texdoc --view "
> pkg)))))))
> +       (message
> +        ;; The folowing code to the end of `defun' used to be just
> +        ;; (shell-command-to-string (concat "texdoc --view " pkg))
> +        ;; , but in some cases it blocks emacs until the user quits
> +        ;; the viewer (bug#28905).
> +        (with-output-to-string
> +          (let* (;; Use pipe rather than pty because the latter
> +                 ;; causes atril (evince variant viewer) to exit
> +                 ;; before showing anything.
> +                 (process-connection-type nil)
> +                 (process (start-process-shell-command
> +                           "Doc view" standard-output
> +                           (concat "texdoc --view " pkg))))
> +            ;; Suppress the message "Process Doc view finished".
> +            (set-process-sentinel process #'ignore)
> +            ;; Kill temp buffer without query.  This is necessary if
> +            ;; the underneath shell can't find the texdoc binary, at
> +            ;; least for some environment.
> +            (set-process-query-on-exit-flag process nil)
> +            ;; Don't discard shell output.
> +            (accept-process-output process))))))))
>
>  (defun TeX-goto-info-page ()
>    "Read documentation for AUCTeX in the info system."
>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-auctex <at> gnu.org:
bug#28905; Package auctex. (Sun, 04 Nov 2018 09:49:01 GMT) Full text and rfc822 format available.

Message #29 received at 28905 <at> debbugs.gnu.org (full text, mbox):

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: fran.burstall <at> gmail.com
Cc: 28905 <at> debbugs.gnu.org, Mosè Giordano <mose <at> gnu.org>
Subject: Re: bug#28905: 11.90.2.2017-07-25; TeX-documentation-texdoc blocks
Date: Sun, 04 Nov 2018 18:48:39 +0900
Hi Fran and all,

>>>>> "Fran Burstall (Gmail)" <fran.burstall <at> gmail.com> writes:
> Hi Ikumi,
> It works for me.  Pass "amsmath" to the patched TeX-documentation-texdoc
> and it fires evince on the documentation without blocking emacs; fire it on
> "foobar" and I get a sensible message about not finding any documentation.

Thanks for confirmation.  It works just as expectedly.  How about you,
Mosè?

Best,
Ikumi Keita




Information forwarded to bug-auctex <at> gnu.org:
bug#28905; Package auctex. (Sun, 04 Nov 2018 16:13:02 GMT) Full text and rfc822 format available.

Message #32 received at 28905 <at> debbugs.gnu.org (full text, mbox):

From: Mosè Giordano <mose <at> gnu.org>
To: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: 28905 <at> debbugs.gnu.org, Fran Burstall <fran.burstall <at> gmail.com>
Subject: Re: bug#28905: 11.90.2.2017-07-25; TeX-documentation-texdoc blocks
Date: Sun, 4 Nov 2018 17:11:46 +0100
Hi Keita,

On Sun, Nov 4, 2018 at 10:48 AM Ikumi Keita <ikumi <at> ikumi.que.jp> wrote:
>
> Hi Fran and all,
>
> >>>>> "Fran Burstall (Gmail)" <fran.burstall <at> gmail.com> writes:
> > Hi Ikumi,
> > It works for me.  Pass "amsmath" to the patched TeX-documentation-texdoc
> > and it fires evince on the documentation without blocking emacs; fire it on
> > "foobar" and I get a sensible message about not finding any documentation.
>
> Thanks for confirmation.  It works just as expectedly.  How about you,
> Mosè?

I didn't try the patch, just read it.  The idea should be to launch an
asynchronous process and show its output, correct?  That should be the
way to go.  Only one comment: is it necessary to use
`start-process-shell-command'?  Wouldn't `start-process' be
sufficient?

Bye,
Mosè




Information forwarded to bug-auctex <at> gnu.org:
bug#28905; Package auctex. (Sun, 04 Nov 2018 18:34:01 GMT) Full text and rfc822 format available.

Message #35 received at 28905 <at> debbugs.gnu.org (full text, mbox):

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Mosè Giordano <mose <at> gnu.org>
Cc: 28905 <at> debbugs.gnu.org, Fran Burstall <fran.burstall <at> gmail.com>
Subject: Re: bug#28905: 11.90.2.2017-07-25; TeX-documentation-texdoc blocks
Date: Mon, 05 Nov 2018 03:33:38 +0900
Hi Mosè,

>>>>> Mosè Giordano <mose <at> gnu.org> writes:

> I didn't try the patch, just read it.  The idea should be to launch an
> asynchronous process and show its output, correct?

Yes.

> Only one comment: is it necessary to use
> `start-process-shell-command'?  Wouldn't `start-process' be
> sufficient?

Yes, mostly.  The two would make little difference.  I followed the
previous code which used `shell-command-to-string'.  (Actually, other
parts of this function pay attention whether to use underlying shell or
not, as the comments between the code tell:
		  ;; Note: `shell-command-to-string' uses shell, only
		  ;; `call-process' looks at `exec-path', thus only here makes
		  ;; sense to use `executable-find' to test whether texdoc is
		  ;; available.
and
	;; Called without prefix argument: just run "texdoc --view <pkg>" and
	;; show the output, so that the user is warned in case it doesn't find
	;; the documentation or "texdoc" is not available.
)

As far as I can see, the difference between `start-process' and
`start-process-shell-command' would be noticeable only when:
(1) texdoc is not available on the user's machine.  In that case,
`start-process' would end in lisp error while
`start-process-shell-command' would continue to run and show the error
message "texdoc: No such file or directory" which the shell outputs.
(2) the values of `exec-path' and PATH of the invoked shell differ.  If
one of them contains texdoc and other doesn't, calling texdoc might
success or not, accordingly.

Best,
Ikumi Keita




Information forwarded to bug-auctex <at> gnu.org:
bug#28905; Package auctex. (Fri, 09 Nov 2018 07:28:01 GMT) Full text and rfc822 format available.

Message #38 received at 28905 <at> debbugs.gnu.org (full text, mbox):

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
Cc: 28905 <at> debbugs.gnu.org, Fran Burstall <fran.burstall <at> gmail.com>,
 Mosè Giordano <mose <at> gnu.org>
Subject: Re: bug#28905: 11.90.2.2017-07-25; TeX-documentation-texdoc blocks
Date: Fri, 09 Nov 2018 16:27:21 +0900
Hi Fran, Mosè and all,

>>>>> Ikumi Keita <ikumi <at> ikumi.que.jp> writes:
> Hi ,
>>>>> Mosè Giordano <mose <at> gnu.org> writes:

>> I didn't try the patch, just read it.  The idea should be to launch an
>> asynchronous process and show its output, correct?

> Yes.

>> Only one comment: is it necessary to use
>> `start-process-shell-command'?  Wouldn't `start-process' be
>> sufficient?

> Yes, mostly.  The two would make little difference.

I committed the proposed change.  This is tested only with evince and
atril (a evince variant), so it might be incompatible with other
viewers.  If it blocks other viewes at `C-c ?', please report it.  Then
I'll revert the commit.

Regards,
Ikumi Keita




Added tag(s) fixed. Request was from Ikumi Keita <ikumi <at> ikumi.que.jp> to control <at> debbugs.gnu.org. (Fri, 09 Nov 2018 07:37:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 28905 <at> debbugs.gnu.org and fran.burstall <at> gmail.com Request was from Ikumi Keita <ikumi <at> ikumi.que.jp> to control <at> debbugs.gnu.org. (Fri, 09 Nov 2018 07:37:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 07 Dec 2018 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 114 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.