GNU bug report logs - #20340
11.88; Evince reverse search opens buffer in all frames

Previous Next

Package: auctex;

Reported by: Iñaki García Etxebarria <garetxe <at> gmail.com>

Date: Wed, 15 Apr 2015 21:30:03 UTC

Severity: normal

Found in version 11.88

Done: Tassilo Horn <tsdh <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Tassilo Horn <tsdh <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#20340: closed (11.88; Evince reverse search opens buffer in
 all frames)
Date: Fri, 17 Apr 2015 18:55:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 17 Apr 2015 20:54:45 +0200
with message-id <87383y60wa.fsf <at> gnu.org>
and subject line Re: bug#20340: 11.88; Evince reverse search opens buffer in all frames
has caused the debbugs.gnu.org bug report #20340,
regarding 11.88; Evince reverse search opens buffer in all frames
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
20340: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20340
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Iñaki García Etxebarria <garetxe <at> gmail.com>
To: bug-auctex <at> gnu.org
Subject: 11.88; Evince reverse search opens buffer in all frames
Date: Wed, 15 Apr 2015 23:20:20 +0200
Hello,

I am often editing various TeX files at the same time, and try to use
evince reverse search from evince, with "Ctrl+Click", in order to
make a change to a specific file. Currently
TeX-source-correlate-sync-source uses "find-file" in order to load the
file. This is very frustrating, since it makes *all* emacs windows switch
to that buffer, including those in which you are editing unrelated
documents.

Observed behavior: All emacs windows editing TeX files jump to the
source position for the file associated to the pdf in evince.

Expected behavior: Only the window in which you are editing the relevant file
reacts.

I have replaced TeX-source-correlate-sync-source by the following code
in my local instalation, and it is working well. It only reacts to the
DBus signal if the current buffer contains the file in the signal (see
the (if (string= ...)) part).

(defun TeX-source-correlate-sync-source (file linecol &rest ignored)
  "Show TeX FILE with point at LINECOL.
This function is called when emacs receives a SyncSource signal
emitted from the Evince document viewer.  IGNORED absorbs an
unused id field accompanying the DBUS signal sent by Evince-3.0.0
or newer."
  ;; FILE may be given as relative path to the TeX-master root document or as
  ;; absolute file:// URL.  In the former case, the tex file has to be already
  ;; opened.
  (let ((buf (let ((f (condition-case nil
			  (progn
			    (require 'url-parse)
			    (require 'url-util)
			    (url-unhex-string (aref (url-generic-parse-url file) 6)))
			;; For Emacs 21 compatibility, which doesn't have the
			;; url package.
			(file-error (replace-regexp-in-string "^file://" "" file)))))
	       (if (string= f (buffer-file-name))
		   (current-buffer)
		 nil)))
	(line (car linecol))
	(col (cadr linecol)))
    (when (not (null buf))
      (switch-to-buffer buf)
      (push-mark (point) 'nomsg)
      (goto-char (point-min))
      (forward-line (1- line))
      (unless (= col -1)
	(move-to-column col))
      (raise-frame))))

------------------------------------------------------------------------

Emacs  : GNU Emacs 24.4.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.14.5)
 of 2014-11-19 on buildvm-03.phx2.fedoraproject.org
Package: 11.88

current state:
==============
(setq
 AUCTeX-date "2014-10-29"
 window-system 'x
 LaTeX-version "2e"
 TeX-style-path '("/var/auctex" "/usr/share/emacs/site-lisp/auctex/style"
                  "/home/inaki/.emacs.d/auctex/auto"
                  "/home/inaki/.emacs.d/auctex/style" "auto" "style")
 TeX-auto-save nil
 TeX-parse-self nil
 TeX-master t
 TeX-command-list '(("TeX"
                     "%(PDF)%(tex) %(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"
                     "%(PDF)amstex %(extraopts) %`%S%(PDFout)%(mode)%' %t"
                     TeX-run-TeX nil (ams-tex-mode) :help "Run AMSTeX")
                    ("ConTeXt"
                     "texexec --once --texutil %(extraopts) %(execopts)%t"
                     TeX-run-TeX nil (context-mode) :help "Run ConTeXt once")
                    ("ConTeXt Full" "texexec %(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-command t t :help
                     "Generate PostScript file")
                    ("Index" "makeindex %s" TeX-run-command nil t :help
                     "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")
                    )
 )

Thanks,
Iñaki



[Message part 3 (message/rfc822, inline)]
From: Tassilo Horn <tsdh <at> gnu.org>
To: Iñaki García Etxebarria <garetxe <at> gmail.com>
Cc: 20340-done <at> debbugs.gnu.org
Subject: Re: bug#20340: 11.88; Evince reverse search opens buffer in all frames
Date: Fri, 17 Apr 2015 20:54:45 +0200
Iñaki García Etxebarria <garetxe <at> gmail.com> writes:

Hi Iñaki,

>> Wow, quite complex.  But I think this is the value you want:
>> 
>>   (setq display-buffer-alist
>>         '((".*" . (display-buffer-reuse-window . ((reusable-frames . visible))))))
>> 
>> Tested only briefly, though.
> This seems to work perfectly, thank you very much!

Great to hear, and you're welcome!

Bye,
Tassilo


This bug report was last modified 10 years and 95 days ago.

Previous Next


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