From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: =?gb2312?B?obBleGVjLXBhdGihsQ==?= alone or =?gb2312?B?obBQ?= =?gb2312?B?QVRIobE=?= alone is unable to call up SumatraPDF Date: Mon, 18 Dec 2017 18:16:53 +0200 Message-ID: <83shc8ovt6.fsf@gnu.org> References: <201712181804461706831@csair.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1513613838 17389 195.159.176.226 (18 Dec 2017 16:17:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 18 Dec 2017 16:17:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 18 17:17:14 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eQy6L-0004Ev-KG for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Dec 2017 17:17:13 +0100 Original-Received: from localhost ([::1]:52861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQy8J-0000vX-TV for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Dec 2017 11:19:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQy5y-0007ot-Ft for help-gnu-emacs@gnu.org; Mon, 18 Dec 2017 11:16:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQy5t-0005p7-Gt for help-gnu-emacs@gnu.org; Mon, 18 Dec 2017 11:16:50 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39558) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQy5t-0005p1-E5 for help-gnu-emacs@gnu.org; Mon, 18 Dec 2017 11:16:45 -0500 Original-Received: from [176.228.60.248] (port=1309 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eQy5s-0002Ik-TE for help-gnu-emacs@gnu.org; Mon, 18 Dec 2017 11:16:45 -0500 In-reply-to: <201712181804461706831@csair.com> (liyanlin@csair.com) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:115385 Archived-At: > Date: Mon, 18 Dec 2017 18:04:47 +0800 > From: "liyanlin@csair.com" > > I construct a latex editing environment by "windows7 + Emacs25.3 + auctex + Miktex+SumatraPDF". The package auctex is installed by ELPA of Emacs. As I don't want the content of environment variable "Path" of my windows7 operating system changed, I put the following codes in "init.el": > ;; Put the path of SumatraPDF.exe in the Emacs variable "exec-path": > (setq exec-path (append '("E:/tex/SumatraPDF") exec-path)) > ;; Put the path of Miktex in the Emacs variable "PATH": > (setenv "PATH" (concat "E:/tex/miktex/miktex/bin" ";" (getenv "PATH"))) > ;; define tex complier > (setq-default TeX-engine 'xetex) > (setq TeX-command-default "XeLaTeX") > ;; define PDF viewer > (setq TeX-PDF-mode t) > (setq TeX-view-program-selection '((output-pdf "SumatraPDF"))) > > After this, my tex documents can be complied successfully when clicking the button "Run LaTex" on the Emacs tool bar, but SumatraPDF does not work when clicking the button "Run Viewer". > Then I move the the path of SumatraPDF.exe from "exec-path" to "PATH", SumatraPDF.exe does not work eigher. I have to put the path of SumatraPDF.exe both in "PATH" and in "exec-path". SumatraPDF.exe does work this time. > So why is that "exec-path" alone or "PATH" alone is unable to call up SumatraPDF? My advice: do NOT tweak your PATH by tricks from inside Emacs. Instead, change the PATH outside of Emacs (and restart Emacs if it already runs when you make the PATH changes). This way you guarantee that all the Emacs features that use PATH, exec-path, and whatnot are in sync with your system and your shell, and the above problems will never happen.