all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: “exec-path” alone or “PATH” alone is unable to call up SumatraPDF
Date: Mon, 18 Dec 2017 18:16:53 +0200	[thread overview]
Message-ID: <83shc8ovt6.fsf@gnu.org> (raw)
In-Reply-To: <201712181804461706831@csair.com> (liyanlin@csair.com)

> Date: Mon, 18 Dec 2017 18:04:47 +0800
> From: "liyanlin@csair.com" <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.



      parent reply	other threads:[~2017-12-18 16:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18 10:04 “exec-path” alone or “PATH” alone is unable to call up SumatraPDF liyanlin
2017-12-18 15:11 ` Óscar Fuentes
2017-12-18 16:16 ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83shc8ovt6.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.