Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gnuplot-mode on Windows #33

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,14 @@
Gnuplot-mode is already on http://melpa.milkbox.net, but it would
be good to get it into the other repositories too.

2. Using gnuplot-mode on windows is problematic. John Handy says:
2. Using gnuplot-mode on windows might be problematic.

The latest version has been reported to work on Windows 10 and
W32 Emacs if you use =cmdproxy.exe= as your =shell-file-name=
(the default) and point =gnuplot-program= to =gnuplot.exe= (not
=wgnuplot.exe=).

Nevertheless, John Handy says:

You probably get nagged quite a bit about this. Some have been running into
issues with gnuplot-mode and Windows and I'm wondering if you have any
Expand Down
12 changes: 10 additions & 2 deletions gnuplot.el
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,8 @@ The values are
(const :tag "Separate window" window)
(const :tag "This window" nil)))

(defcustom gnuplot-echo-command-line-flag (not gnuplot-ntemacs-p)
(defcustom gnuplot-echo-command-line-flag (and (not gnuplot-ntemacs-p)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested, but this and should be or ...?

(not (eq window-system 'w32)))
"*This sets the fall-back value of `comint-process-echos'.
If `gnuplot-mode' cannot figure out what version number of gnuplot
this is, then the value of this variable will be used for
Expand Down Expand Up @@ -2278,7 +2279,14 @@ buffer."
(unless (and gnuplot-process (eq (process-status gnuplot-process) 'run)
gnuplot-buffer (buffer-live-p gnuplot-buffer))
(message "Starting gnuplot plotting program...")
(setq gnuplot-buffer (make-comint gnuplot-process-name gnuplot-program)
(setq gnuplot-buffer
(if (and (eq window-system 'w32)
(string= "cmdproxy.exe"
(file-name-nondirectory shell-file-name)))
(make-comint gnuplot-process-name shell-file-name
nil
"/C" (expand-file-name gnuplot-program))
(make-comint gnuplot-process-name gnuplot-program))
gnuplot-process (get-buffer-process gnuplot-buffer))
(gnuplot-set-process-query-on-exit-flag gnuplot-process nil)
(with-current-buffer gnuplot-buffer
Expand Down