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.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.