auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] "No connection to bus" message in Cygwin Emacs


From: Sebastien Vauban
Subject: Re: [AUCTeX] "No connection to bus" message in Cygwin Emacs
Date: Wed, 10 Jun 2015 16:36:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (cygwin)

Hi Tassilo,

Tassilo Horn <address@hidden> writes:
> Sebastien Vauban <address@hidden> writes:
>>> Possibly there has been an earlier error which already broke the
>>> initialization of `TeX-latex-mode' in that buffer.
>>
>> Yes, the initialization seems broken because, when opening a .tex
>> file, the mode stays in "Fundamental", hence the warning when I still
>> tried to execute `C-c C-c' the first time.
>
> Ok, I see.
>
>>> Yes, indeed.  There's a predicate `TeX-evince-dbus-p' which should
>>> never error and test if DBUS is available on the system and
>>> supported by Emacs, and if the relevant Evince DBUS interfaces are
>>> available.
>>>
>>> In case you can reproduce the issue, you could edebug that function
>>> to see where the error occurs.
>>
>> I've edebug'ed the function `TeX-evince-dbus-p' from tex.el.
>>
>> The `and' returns `nil' on the 3rd line:
>>
>>        (dbus-ignore-errors (dbus-get-unique-name :session))
>>
>> See http://screencast.com/t/2QHtttjSm.
>
> Ok, so DBus should not be used on your system.  But AUCTeX never
> accesses the DBus without being protected by (when (TeX-evince-dbus-p)
> ...) except for in `TeX-evince-sync-view' which is only used as View
> command in case the viewer is Evince and DBus is available.  In any
> case, it shouldn't have to do anything with errors at initialization.
>
>> What's not clear to me at this instant is that `C-h f
>> TeX-evince-dbus-p' doesn't return me a link to the file where the
>> function is defined, as you can see on
>> http://screencast.com/t/7HSPqoXIJm.
>
> That's indeed strange.  Is than only with this function, also with
> other AUCTeX functions,

Trying functions at random: `C-h f tex-region-header RET' returns

  ┌────
  │ tex-region-header is a compiled Lisp function in `tex-mode.el'.
  │ 
  │ (tex-region-header FILE &optional BEG)
  │ 
  │ If there is a TeX header in the current buffer, write it to FILE.
  │ Return point at the end of the region so written, or zero.  If
  │ the optional buffer position BEG is specified, then the region
  │ written out starts at BEG, if this lies before the start of the header.
  │ 
  │ If the first line matches `tex-first-line-header-regexp', it is
  │ also written out.  The variables `tex-start-of-header' and
  │ `tex-end-of-header' are used to locate the header.  Note that the
  │ start of the header is required to be within the first 100 lines.
  └────

but... `tex-mode.el' is found in `/usr/share/emacs/24.5/lisp/textmodes'!
So, there is well an installation problem?

Well, maybe, I should have tested `TeX-*' functions, right?

Let's do it.  `C-h f TeX-kill-job RET' (chosen at random) returns:

  ┌────
  │ TeX-kill-job is an interactive autoloaded Lisp function in `tex-buf.el'.
  │ 
  │ [Arg list not available until function definition is loaded.]
  │ 
  │ Not documented.
  └────

which is well found in `/cygdrive/d/Users/fni/.emacs.d/elpa/auctex-11.88.6'.

If the above is good, it shows that there is a link for some (most?)
AUCTeX functions.

> or also with functions of other packages?  At least in the last case
> I'd guess it's a general emacs problem (on cygwin).

The function `TeX-evince-dbus-p' is the first one I've seen without
a link.  For sure, it's not a general Cygwin Emacs problem.

It could well be an AUCTeX problem in my Cygwin Emacs.

>> Installation problem?  I'm using the ELPA version!
>
> I've also checked with 11.88.6 from ELPA and Emacs 24.5, and there the
> link is there.

Note -- I'm using the ~/.emacs.d/elpa for both Emacs versions.

>> `C-h v AUCTeX-version' returns "11.88.6"...
>>
>> And `M-x locate-library RET tex-site' returns "Library is file
>> ~/.emacs.d/elpa/auctex-11.88.6/tex-site.elc".
>>
>> So, it seems well installed, nope?
>
> Yes, that's what's expected.  Locating the libraries tex and latex
> also suggests tex.el and latex.el in that directory, right?  (There
> has been a problem with some special distribution of Emacs which did
> some setup in default.el and thereby overwrote user and package.el
> settings.  There, the result was that tex-site.el from AUCTeX ELPA
> eventually triggered loading of a bundled, system-wide AUCTeX install
> so effectively you couldn't upgrade your AUCTeX version.)

Let's test it.

- `M-x locate-library tex RET' returns:
  Library is file ~/.emacs.d/elpa/auctex-11.88.6/tex.elc

- `M-x locate-library latex RET' returns:
  Library is file ~/.emacs.d/elpa/auctex-11.88.6/latex.elc

So far, so good?

>> PS- I don't have `evince' installed on my Windows.  I'm using
>> SumatraPDF to view the PDF files.  I don't know about evince, but
>> that one refreshes automatically the PDF after each compilation.
>
> Yes, evince does that, too.  And forward and backward search with
> evince as a viewer are implemented using DBus communication if
> possible in AUCTeX.

I could go the Evince route in the future.  But, right now, I'm happy
with SumatraPDF which opens very fast (unlike Acrobat Reader).

> Now I see where the error probably comes from.  When dbus.el gets
> loaded, it'll call `dbus--init-bus' defined in dbusbind.c, and that
> can possibly throw a "No connection to bus" error.  However, when
> I test with cygwin's emacs 24.4.1 and auctex 11.88.6, I get no such
> error and the source link in the help buffer is also there.
>
> Anyway, you could try the following things:
>
>   1. Wrap a (let ((dbus-debug nil)) ...) around the (and ...) in
>     `TeX-evince-dbus-p'.
>   2. If that doesn't help, also wrap the (require 'dbus nil :no-error)
>      form in a (dbus-ignore-errors ...).
>
> Then do `M-x byte-recompile-directory' for
> ~/.emacs.d/elpa/auctex-11.88.6/ and restart emacs.  Do you still get
> the error then?

I tried to implement #1, removed the `tex.elc' file (to be really sure),
`C-M-x'ed the function, and directly tried to revert the `.tex' buffer
to see if the mode changed from Fundamental to something else.

Without restarting Emacs, the above worked (well, almost).  I now have
a buffer in "LaTeX/P" mode, much better.

Though, when pressing `C-c C-c', I now have:

  ┌────
  │ Running `LaTeX' on `haie-ecm' with ``pdflatex  -file-line-error   
-interaction=nonstopmode "\input" haie-ecm.tex''
  │ This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014/W32TeX) 
(preloaded format=pdflatex)
  │  restricted \write18 enabled.
  │ entering extended mode
  │ LaTeX2e <2014/05/01>
  │ Babel <3.9l> and hyphenation patterns for 79 languages loaded.
  │ ! I can't find file `haie-ecm.tex'.
  │ <*> \input haie-ecm.tex
  │                        
  │ (Press Enter to retry, or Control-Z to exit)
  │ Please type another input file name
  │ ! Emergency stop.
  │ <*> \input haie-ecm.tex
  │                        
  │ !  ==> Fatal error occurred, no output PDF file produced!
  │ Transcript written on texput.log.
  │ 
  │ TeX Output exited abnormally with code 1 at Wed Jun 10 16:32:24
  └────

If I now run `which pdflatex' in a Shell buffer inside Cygwin Emacs,
I get:

    /cygdrive/c/texlive/2014/bin/win32/pdflatex

Problem using my TeX Live PDFLaTeX from Cygwin Emacs?

Best regards,
  Seb

-- 
Sebastien Vauban



reply via email to

[Prev in Thread] Current Thread [Next in Thread]