diff -Nru gnuplot-mode-0.7.0/debian/changelog gnuplot-mode-0.7.0-2014-12-31/debian/changelog --- gnuplot-mode-0.7.0/debian/changelog 2014-05-06 20:10:54.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/debian/changelog 2019-02-02 20:12:04.000000000 +0000 @@ -1,3 +1,19 @@ +gnuplot-mode (1:0.7.0-2014-12-31-1) unstable; urgency=medium + + [ Dima Kogan ] + * New upstream release + - Git import from upstream's fixes in 2014 from + * Package uses dh-elpa: main package renamed to elpa-gnuplot-mode + * This is now maintained by the pkg-emacsen-addons team (Closes: #897292) + * Updated debhelper compliance to version 10 + * Updated policy compliance to version 4.3.0 + * I support DEB_BUILD_OPTIONS=nodoc + + [ Ondřej Nový ] + * d/copyright: Use https protocol in Format field + + -- Dima Kogan Sat, 02 Feb 2019 12:12:04 -0800 + gnuplot-mode (1:0.7.0-1) unstable; urgency=low * New upstream release (Closes: #688358) @@ -31,7 +47,7 @@ * Fix links to gnuplot info, thanks to Kevin Ryde (closes: 602557) -> 901_gnuplot.el.info-look.diff * Try to apply the suggestion of Kevin Ryde to get rid of the need for - gnuplot-setup-info-look (closes: 602561) + gnuplot-setup-info-look (closes: 602561) -> 902_automatic_info_look.diff (and it seems I even got it right !) @@ -72,8 +88,8 @@ gnuplot-mode (1:0.6.0-3) unstable; urgency=low - * New maintainer (closes: 503549). Many thanks to Ryuichi Arafune for - maintaining gnuplot-mode before and Agustin Martin Domingo and + * New maintainer (closes: 503549). Many thanks to Ryuichi Arafune for + maintaining gnuplot-mode before and Agustin Martin Domingo and Romain Francoise for their NMUs * Using a git repository for tracking * Added a Homepage field diff -Nru gnuplot-mode-0.7.0/debian/compat gnuplot-mode-0.7.0-2014-12-31/debian/compat --- gnuplot-mode-0.7.0/debian/compat 2014-05-06 20:10:54.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/debian/compat 2019-02-02 08:22:08.000000000 +0000 @@ -1 +1 @@ -7 +10 diff -Nru gnuplot-mode-0.7.0/debian/control gnuplot-mode-0.7.0-2014-12-31/debian/control --- gnuplot-mode-0.7.0/debian/control 2014-05-06 20:10:54.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/debian/control 2019-02-02 20:03:05.000000000 +0000 @@ -1,19 +1,21 @@ Source: gnuplot-mode -Section: math +Section: lisp Priority: optional -Maintainer: Vincent Fourmond -Uploaders: Dima Kogan -Build-Depends: debhelper (>= 7.0.50~), texlive-latex-base, texlive-latex-recommended -Standards-Version: 3.9.5 -Vcs-Git: git://anonscm.debian.org/collab-maint/gnuplot-mode.git -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/gnuplot-mode.git +Maintainer: Debian Emacs addons team +Uploaders: Dima Kogan +Build-Depends: debhelper (>= 10), dh-elpa (>= 0.0.17), texlive-latex-base, texlive-latex-recommended +Standards-Version: 4.3.0 +Vcs-Git: https://salsa.debian.org/debian/gnuplot-mode.git +Vcs-Browser: https://salsa.debian.org/debian/gnuplot-mode Homepage: http://xafs.org/BruceRavel/GnuplotMode -Package: gnuplot-mode +Package: elpa-gnuplot-mode Architecture: all -Depends: emacs24 | emacsen, gnuplot-qt | gnuplot-x11 | gnuplot, ${misc:Depends} -Conflicts: emacsen-common (<< 2.0.0) -Suggests: gnuplot-doc +Depends: ${misc:Depends}, ${elpa:Depends}, gnuplot-qt | gnuplot-x11 | gnuplot +Recommends: emacs (>= 46.0), gnuplot-doc +Enhances: emacs, emacs24, emacs25 +Breaks: gnuplot-mode (<< 1:0.7.0-2014-12-31-1) +Provides: gnuplot-mode Description: Gnuplot mode for Emacs Gnuplot is a major mode for Emacs flavours with the following features: - Functions for plotting lines, regions, entire scripts, or entire files @@ -25,3 +27,10 @@ - Interaction with Gnuplot using comint - Pull-down menus plus a toolbar - Distributed with a quick reference sheet in postscript. + +Package: gnuplot-mode +Architecture: all +Depends: ${misc:Depends}, elpa-gnuplot-mode +Description: Transition Package, gnuplot-mode to elpa-gnuplot-mode + The gnuplot-mode emacs addon has been elpafied. This dummy package + helps ease transition from gnuplot-mode to elpa-gnuplot-mode. diff -Nru gnuplot-mode-0.7.0/debian/copyright gnuplot-mode-0.7.0-2014-12-31/debian/copyright --- gnuplot-mode-0.7.0/debian/copyright 2014-05-06 20:10:54.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/debian/copyright 2019-02-02 07:38:13.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: gnuplot-mode Upstream-Contact: Bruce Ravel Source: https://github.com/bruceravel/gnuplot-mode diff -Nru gnuplot-mode-0.7.0/debian/docs gnuplot-mode-0.7.0-2014-12-31/debian/docs --- gnuplot-mode-0.7.0/debian/docs 2014-05-06 20:10:54.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/debian/docs 2019-02-02 19:34:31.000000000 +0000 @@ -1,2 +1,4 @@ README.org gpelcard.pdf +dot.el +dotemacs.el diff -Nru gnuplot-mode-0.7.0/debian/emacsen-compat gnuplot-mode-0.7.0-2014-12-31/debian/emacsen-compat --- gnuplot-mode-0.7.0/debian/emacsen-compat 2014-05-06 20:10:54.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/debian/emacsen-compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -0 diff -Nru gnuplot-mode-0.7.0/debian/emacsen-install gnuplot-mode-0.7.0-2014-12-31/debian/emacsen-install --- gnuplot-mode-0.7.0/debian/emacsen-install 2014-05-06 20:10:54.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/debian/emacsen-install 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -#! /bin/sh -e -# /usr/lib/emacsen-common/packages/install/gnuplot-mode - -# Written by Jim Van Zandt , borrowing heavily -# from the install scripts for gettext by Santiago Vila -# and octave by Dirk Eddelbuettel . - -FLAVOR=$1 -PACKAGE=gnuplot-mode - -if [ ${FLAVOR} = emacs ]; then exit 0; fi - -echo install/${PACKAGE}: Handling install for emacsen flavor ${FLAVOR} - -SITEFLAG="-no-site-file" # Do not load site files when byte-compiling -FLAGS="${SITEFLAG} -q -batch -l path.el -f batch-byte-compile" - -ELDIR=/usr/share/emacs/site-lisp/${PACKAGE} -ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} - -install -m 0755 -d ${ELCDIR} - -cd ${ELDIR} -FILES=`echo *.el` - -cd ${ELCDIR} -for i in $FILES; do - ln -sf ${ELDIR}/$i . -done - -cat << EOF > path.el - (setq load-path (cons "." load-path) byte-compile-warnings nil) - (require 'font-lock) - (defun hilit-repaint-command (foo)) -EOF -${FLAVOR} ${FLAGS} ${FILES} -rm -f path.el - -exit 0 diff -Nru gnuplot-mode-0.7.0/debian/emacsen-remove gnuplot-mode-0.7.0-2014-12-31/debian/emacsen-remove --- gnuplot-mode-0.7.0/debian/emacsen-remove 2014-05-06 20:10:54.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/debian/emacsen-remove 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#!/bin/sh -e -# /usr/lib/emacsen-common/packages/remove/gnuplot-mode - -FLAVOR=$1 -PACKAGE=gnuplot-mode - -if [ ${FLAVOR} != emacs ]; then -# if test -x /usr/sbin/install-info-altdir; then - echo remove/${PACKAGE}: removing Info links for ${FLAVOR} -# install-info-altdir --quiet --remove --dirname=${FLAVOR} /usr/info/gnuplot-mode.info.gz -# fi - - echo remove/${PACKAGE}: purging byte-compiled files for ${FLAVOR} - rm -rf /usr/share/${FLAVOR}/site-lisp/${PACKAGE} -fi diff -Nru gnuplot-mode-0.7.0/debian/emacsen-startup gnuplot-mode-0.7.0-2014-12-31/debian/emacsen-startup --- gnuplot-mode-0.7.0/debian/emacsen-startup 2014-05-06 20:10:54.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/debian/emacsen-startup 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -;; -*-emacs-lisp-*- -;; -;; Emacs startup file for the Debian GNU/Linux gnuplot-mode package -;; -;; Originally contributed by Nils Naumann -;; Modified by Dirk Eddelbuettel -;; Adapted for dh-make by Jim Van Zandt - -;; The gnuplot-mode package follows the Debian/GNU Linux 'emacsen' policy and -;; byte-compiles its elisp files for each 'emacs flavor' (emacs19, -;; xemacs19, emacs20, xemacs20...). The compiled code is then -;; installed in a subdirectory of the respective site-lisp directory. - -(if (not (file-exists-p "/usr/share/emacs/site-lisp/gnuplot-mode")) - (message "Package gnuplot-mode removed but not purged. Skipping setup") - - ;; We have to add this to the load-path: - (debian-pkg-add-load-path-item - (concat "/usr/share/" - (symbol-name debian-emacs-flavor) - "/site-lisp/gnuplot-mode")) - - ;; these lines enable the use of gnuplot mode - (autoload 'gnuplot-mode "gnuplot" "gnuplot major mode" t) - (autoload 'gnuplot-make-buffer "gnuplot" "open a buffer in gnuplot mode" t) - - ;; this line automatically causes all files with the .gp extension to - ;; be loaded into gnuplot mode - (setq auto-mode-alist (append '(("\\.gp\\'" . gnuplot-mode) - ("\\.gnuplot\\'" . gnuplot-mode) - ) auto-mode-alist)) - - ;; This line binds the function-9 key so that it opens a buffer into - ;; gnuplot mode - ;; (global-set-key [(f9)] 'gnuplot-make-buffer) - ) diff -Nru gnuplot-mode-0.7.0/debian/gnuplot-mode.elpa gnuplot-mode-0.7.0-2014-12-31/debian/gnuplot-mode.elpa --- gnuplot-mode-0.7.0/debian/gnuplot-mode.elpa 1970-01-01 00:00:00.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/debian/gnuplot-mode.elpa 2019-02-02 08:28:59.000000000 +0000 @@ -0,0 +1 @@ +*.el diff -Nru gnuplot-mode-0.7.0/debian/gnuplot-mode.maintscript gnuplot-mode-0.7.0-2014-12-31/debian/gnuplot-mode.maintscript --- gnuplot-mode-0.7.0/debian/gnuplot-mode.maintscript 1970-01-01 00:00:00.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/debian/gnuplot-mode.maintscript 2019-02-02 08:27:44.000000000 +0000 @@ -0,0 +1 @@ +rm_conffile /etc/emacs/site-start.d/50gnuplot-mode.el diff -Nru gnuplot-mode-0.7.0/debian/rules gnuplot-mode-0.7.0-2014-12-31/debian/rules --- gnuplot-mode-0.7.0/debian/rules 2014-05-06 20:10:54.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/debian/rules 2019-02-02 20:00:30.000000000 +0000 @@ -1,9 +1,9 @@ #!/usr/bin/make -f %: - dh $@ + dh $@ --with-elpa override_dh_auto_build: - make -f Makefile.dst gpelcard.pdf + $(if $(filter nodoc,$(DEB_BUILD_OPTIONS)),true,make -f Makefile.dst gpelcard.pdf) override_dh_auto_clean: make -f Makefile.dst clean diff -Nru gnuplot-mode-0.7.0/.gitignore gnuplot-mode-0.7.0-2014-12-31/.gitignore --- gnuplot-mode-0.7.0/.gitignore 2014-03-18 02:50:43.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -*.elc -*.log -*.aux -*.pdf -*.dvi -*~ -/#*# -*/#*# -/hacks.el -.#* -/Makefile -/config.cache -/config.status -/info-look.el -/autom4te.cache/* -/configure.scan -/gpelcard.ps -gnuplot-mode-*.tar.gz diff -Nru gnuplot-mode-0.7.0/gnuplot-context.el gnuplot-mode-0.7.0-2014-12-31/gnuplot-context.el --- gnuplot-mode-0.7.0/gnuplot-context.el 2014-03-18 02:50:43.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/gnuplot-context.el 2019-02-02 07:16:50.000000000 +0000 @@ -248,7 +248,6 @@ ;; Library dependencies (eval-when-compile (require 'cl) - (require 'advice) ;; Prevent compiler warnings about undefined functions (require 'gnuplot)) @@ -256,147 +255,11 @@ ;; We need ElDoc support (require 'eldoc) -;; Load external ElDoc strings if we can find them. -(defvar gnuplot-eldoc-hash nil - "ElDoc strings for gnuplot-mode. - -These have to be compiled from the Gnuplot source tree using -`doc2texi.el'.") - - -;;;; Compatibility for Emacs version < 23 +;; Compatibility for Emacs version < 23 (eval-when-compile (when (not (fboundp 'string-match-p)) (defmacro string-match-p (&rest args) - `(save-match-data (string-match ,@args)))) - - (when (not (fboundp 'buffer-local-value)) - (defmacro buffer-local-value (variable buffer) - `(with-current-buffer ,buffer ,variable)))) - - -;;;; Interface to turning the mode on and off -(defun gnuplot-context-sensitive-mode (&optional enable called-interactively-p) - "Turn gnuplot-mode context-sensitive completion and help on and off. - -When context-sensitive mode is enabled, gnuplot-mode tries to -provide more useful completions and help suggestions for built-in -keywords and functions by parsing each command as you type. It -attempts to take into account Gnuplot's many abbreviated -keywords. For example, with point at the end of a line reading -\"plot 'datafile' w \", typing \\[completion-at-point] will pop -up a list of plotting styles. - -\\[completion-at-point] will complete the keyword at point based -on its context in the command. To make keyword completion work on -pressing TAB, set `tab-always-indent' to `complete', or customize -`gnuplot-tab-completion' to make this automatic in gnuplot-mode -buffers. - -\\[gnuplot-info-at-point] will try to find the most relevant -Gnuplot info node for the construction at point, prompting for a -node name if nothing is found. - -In addition, \\[gnuplot-help-function] will pop up a brief -summary of the syntax at point in the minibuffer. To have one-line -syntax summaries appear in the echo area as you type, toggle -`eldoc-mode' or customize `gnuplot-eldoc-mode'. - -Note: help strings for eldoc-mode and \\[gnuplot-help-function] -need to be provided in an Emacs-readable form by the Gnuplot -distribution. See gnuplot-context.el for details. - -Works like a minor mode: with a prefix argument, turn -context-sensitive mode on if positive, otherwise turn it -off. With no argument, toggle context-sensitive mode." - (interactive (list (if current-prefix-arg - (prefix-numeric-value current-prefix-arg)) - t)) - (setq gnuplot-context-sensitive-mode - (if (null enable) (not gnuplot-context-sensitive-mode) - (> (prefix-numeric-value enable) 0))) - - (if gnuplot-context-sensitive-mode - ;; Turn on - (progn - (when called-interactively-p - (message "Gnuplot context-sensitive help & completion enabled.")) - (gnuplot--run-after-load 'gnuplot--turn-on-context-sensitive-mode)) - - ;; Turn off - (when called-interactively-p - (message "Gnuplot context-sensitive help & completion disabled.")) - (gnuplot--run-after-load 'gnuplot--turn-off-context-sensitive-mode))) - -(eval-when-compile - (defmacro gnuplot-foreach-buffer (&rest forms) - (declare (indent 0)) - `(dolist (buf (buffer-list)) - (when (memq (buffer-local-value 'major-mode buf) - '(gnuplot-mode gnuplot-comint-mode)) - (with-current-buffer buf - ,@forms))))) - -(defun gnuplot--turn-on-context-sensitive-mode () - (ad-enable-advice 'gnuplot-completion-at-point - 'around 'gnuplot-context) - (ad-activate 'gnuplot-completion-at-point) - - (dolist (keymap (list gnuplot-mode-map gnuplot-comint-mode-map)) - (define-key keymap (kbd "C-c M-h") 'gnuplot-help-function) - (define-key keymap (kbd "C-c C-/") 'gnuplot-help-function) - (define-key keymap (kbd "C-c C-d") 'gnuplot-info-at-point)) - (define-key gnuplot-comint-mode-map (kbd "TAB") 'comint-dynamic-complete) - - (add-hook 'gnuplot-mode-hook 'gnuplot-setup-eldoc) - (add-hook 'gnuplot-comint-mode-hook 'gnuplot-setup-eldoc) - (gnuplot-foreach-buffer (gnuplot-setup-eldoc))) - -(defun gnuplot--turn-off-context-sensitive-mode () - (dolist (keymap (list gnuplot-mode-map gnuplot-comint-mode-map)) - (define-key keymap (kbd "C-c M-h") 'undefined) - (define-key keymap (kbd "C-c C-/") 'undefined) - (define-key keymap (kbd "C-c C-d") 'gnuplot-info-lookup-symbol)) - (ad-disable-advice 'gnuplot-completion-at-point - 'around 'gnuplot-context) - (ad-activate 'gnuplot-completion-at-point) - - (remove-hook 'gnuplot-mode-hook 'gnuplot-setup-eldoc) - (remove-hook 'gnuplot-comint-mode-hook 'gnuplot-setup-eldoc) - (gnuplot-foreach-buffer - (setq eldoc-documentation-function nil) - (eldoc-mode 0))) - -;; Has to be defined here. Grumble. -(defadvice gnuplot-completion-at-point (around gnuplot-context disable) - ;; This around-advice gets activated/deactivated when turning - ;; context-sensitivity on and off - (setq ad-return-value (gnuplot-context-completion-at-point))) - -(defun gnuplot-setup-eldoc () - (set (make-local-variable 'eldoc-documentation-function) - 'gnuplot-eldoc-function) - - ;; Check for ElDoc after doing completion - (eldoc-add-command 'completion-at-point) - (eldoc-add-command 'comint-dynamic-complete) - - (when gnuplot-eldoc-mode - (unless gnuplot-eldoc-hash - (condition-case nil - (load-library "gnuplot-eldoc") - (error - (message "gnuplot-eldoc.el not found. Install it from the Gnuplot distribution.") - (setq gnuplot-eldoc-hash nil - gnuplot-eldoc-mode nil)))) - - (if gnuplot-eldoc-hash - (eldoc-mode 1) - (eldoc-mode 0))) - - (when gnuplot-tab-completion - (set (make-local-variable 'tab-always-indent) 'complete))) - + `(save-match-data (string-match ,@args))))) ;;;; The tokenizer. @@ -582,7 +445,7 @@ ;; -(eval-when-compile +(eval-and-compile ;; Compile a single pattern into a list of instructions. Leaves ;; calls to other rules as symbolic instructions (call SYMBOL) and ;; jumps, commits etc. as relative offsets; these are resolved into diff -Nru gnuplot-mode-0.7.0/gnuplot.el gnuplot-mode-0.7.0-2014-12-31/gnuplot.el --- gnuplot-mode-0.7.0/gnuplot.el 2014-03-18 02:50:43.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/gnuplot.el 2019-02-02 07:16:50.000000000 +0000 @@ -346,13 +346,7 @@ (require 'easymenu) (eval-when-compile (require 'cl)) -;; Keep gnuplot-context separate from main gnuplot library, for people -;; who don't want to load the whole thing. Load it automatically on -;; choosing the menu item. -(autoload 'gnuplot-context-sensitive-mode "gnuplot-context" - "Toggle gnuplot context-sensitive completion and help mode." - t) - +(declare-function 'eldoc-add-command "eldoc") ;;; --- variable definitions + eval-and-compile clauses @@ -368,22 +362,7 @@ (require 'info-look) (error nil))) -;; Misc. compatibility hacks -(if (featurep 'xemacs) - ;; XEmacs - (progn - (defun gnuplot-set-minor-mode (variable value) - ":set function for minor mode variables." - (funcall variable (if value 1 0))) - - ;; Inline image mode only works on GNU Emacs for now. Sorry. - (defun gnuplot-display-images-p () nil)) - - ;; GNU Emacs - (defalias 'gnuplot-set-minor-mode 'custom-set-minor-mode) - (defalias 'gnuplot-display-images-p 'display-images-p)) - -;; Hack for Emacs < 22 +;; Workaround missing `completion-at-point' in (X)Emacs < 22 (if (not (fboundp 'completion-at-point)) (defun gnuplot-xemacs-completion-at-point () "Perform completion on keyword preceding point. @@ -396,45 +375,33 @@ '(gnuplot-comint-complete))) (comint-dynamic-complete)))) -;; Work around window-full-height-p -(if (not (fboundp 'window-full-height-p)) - ;; The below is taken from GNU Emacs window.el - (defun gnuplot-window-full-height-p (&optional window) +;; Work around missing `window-full-height-p' +(if (fboundp 'window-full-height-p) + (defalias 'gnuplot-window-full-height-p 'window-full-height-p) + ;; The below is taken from window.el in GNU Emacs + (defun gnuplot-window-full-height-p (&optional window) (unless window (setq window (selected-window))) (= (window-height window) - (window-height (frame-root-window (window-frame window))))) - (defalias 'gnuplot-window-full-height-p 'window-full-height-p)) + (window-height (frame-root-window (window-frame window)))))) + +;; Workaround obsolete `process-kill-without-query' +(if (fboundp 'set-process-query-on-exit-flag) + (defalias 'gnuplot-set-process-query-on-exit-flag 'set-process-query-on-exit-flag) + (defalias 'gnuplot-set-process-query-on-exit-flag 'process-kill-without-query)) + +;; Workaround for missing syntax-ppss in XEmacs +(if (fboundp 'syntax-ppss) + (defalias 'gnuplot-syntax-ppss 'syntax-ppss) + (defun gnuplot-syntax-ppss (&optional pos) + (save-excursion + (unless pos (setq pos (point))) + (let ((begin + (save-excursion + (goto-char pos) + (gnuplot-point-at-beginning-of-continuation)))) + (parse-partial-sexp begin pos))))) -;; Workaround for differing eval-after-load behavior -(defun gnuplot--run-after-load (fun) - (if (featurep 'gnuplot) - (funcall fun) - (add-hook 'gnuplot-load-hook fun))) - -;; Workaround missing with-silent-modifications: taken from subr.el in -;; GNU Emacs 24 -(eval-when-compile - (if (not (fboundp 'with-silent-modifications)) - (defmacro gnuplot-with-silent-modifications (&rest body) - "Execute BODY, pretending it does not modify the buffer." - (declare (debug t) (indent 0)) - (let ((modified (make-symbol "modified"))) - `(let* ((,modified (buffer-modified-p)) - (buffer-undo-list t) - (inhibit-read-only t) - (inhibit-modification-hooks t) - deactivate-mark - ;; Avoid setting and removing file locks and checking - ;; buffer's uptodate-ness w.r.t the underlying file. - buffer-file-name - buffer-file-truename) - (unwind-protect - (progn - ,@body) - (unless ,modified - (restore-buffer-modified-p nil)))))) - (defalias 'gnuplot-with-silent-modifications 'with-silent-modifications))) ;;;; (defconst gnuplot-xemacs-p (string-match "XEmacs" (emacs-version))) @@ -663,7 +630,6 @@ ;; (const :tag "3.8 or newer" "3.8") ;; (const :tag "3.7 or older" "3.7"))) - (defvar gnuplot-info-frame nil) (defvar gnuplot-info-nodes '()) @@ -688,36 +654,24 @@ '(radio (const :tag "Parse info file when gnuplot-mode starts" immediately) (const :tag "Parse info file the first time it is needed" deferred))) -(defun gnuplot-set-context-mode (variable value) - "Turn context-sensitive mode on or off through Customize. - -Unlike the built-in custom-set-minor-mode, this avoids loading -gnuplot-context if it is not being enabled." - (if (featurep 'gnuplot-context) - ;; Already loaded, OK to enable or disable - (gnuplot-context-sensitive-mode (if value 1 0)) - ;; Not loaded; autoload gnuplot-context only if enabling - (if value - ;; Prevent recursive (require 'gnuplot) loop when running - ;; interpreted - (gnuplot--run-after-load - #'(lambda () - (gnuplot-context-sensitive-mode 1))) - (setq gnuplot-context-sensitive-mode nil)))) - -(defcustom gnuplot-context-sensitive-mode t - "Non-nil if contextual completion and help for gnuplot are enabled. - -With context-sensitive mode on, gnuplot-mode's tab completion and -info file lookup try to parse the current command line to find -the most useful completions or info pages. - -Don't set this variable from Lisp code; instead, use Customize or -call the `gnuplot-context-sensitive-mode' function, which behaves -like a minor mode." +(defun gnuplot-set-context-sensitive-completion (_variable value) + "Customize :set function for `gnuplot-use-context-sensitive-completion'." + (dolist (buffer (buffer-list)) + (with-current-buffer buffer + (when (derived-mode-p 'gnuplot-mode 'gnuplot-comint-mode) + (gnuplot-context-sensitive-mode + (if value 1 0)))))) + +(defcustom gnuplot-use-context-sensitive-completion t + "Non-nil if `gnuplot-context-sensitive-mode' should be enabled by default. + +In context-sensitive mode, gnuplot-mode parses the current +command line to provide smarter completion and documentation +suggestions." :group 'gnuplot :type 'boolean - :set 'gnuplot-set-context-mode + :initialize 'custom-set-default + :set 'gnuplot-set-context-sensitive-completion :link '(emacs-commentary-link "gnuplot-context")) (defcustom gnuplot-eldoc-mode nil @@ -735,6 +689,53 @@ :group 'gnuplot :type 'boolean) +(defun gnuplot-set-display-mode (variable value &rest args) + "Customize :set function for `gnuplot-inline-image-mode'." + (if (and (eq variable 'gnuplot-inline-image-mode) + value + (not (gnuplot-display-images-p))) + (progn + (message "Displaying images is not supported.") + (set variable nil)) + (set variable value)) + (gnuplot-setup-comint-for-image-mode)) + +(defcustom gnuplot-inline-image-mode nil + "Whether to display Gnuplot output in Emacs. + +Possible values are nil, `inline' and `dedicated'. + +When this is `nil', Gnuplot output is handled outside of Emacs in +the normal way. Otherwise, Emacs attempts to capture Gnuplot's +output and display it in a buffer. Output is inserted inline in +the Gnuplot interaction buffer it this is `inline', in a +separate dedicated buffer if it is `dedicated'. + +Use Customize to set this variable, or the commands +`gnuplot-external-display-mode', `gnuplot-inline-display-mode', +and `gnuplot-dedicated-display-mode'." + :group 'gnuplot + :type '(radio + (const :tag "No" nil) + (const :tag "In Comint buffer" inline) + (const :tag "In dedicated buffer" dedicated)) + :initialize 'custom-initialize-default + :set 'gnuplot-set-display-mode) + +(defcustom gnuplot-image-format "png" + "Image format to use for displaying images within Emacs. + +This will be sent directly to Gnuplot as a command of the form +\"set terminal \". Common values are \"png\" and +\"svg\". + +This only has an effect when `gnuplot-inline-image-mode' is +non-nil." + :group 'gnuplot + :type 'string + :initialize 'custom-initialize-default + :set 'gnuplot-set-display-mode) + (defgroup gnuplot-faces nil "Text faces used by gnuplot-mode." :prefix "gnuplot-" @@ -788,8 +789,30 @@ map)) (defvar gnuplot-mode-menu nil) + +(defvar gnuplot-display-options-menu + (flet ((make-image-setter (type) + `[,(concat (upcase type) " images") + (lambda () (interactive) (gnuplot-set-image-format ,type)) + :style toggle + :selected (eq gnuplot-image-format ,type)])) + `("Display plot output" + ["Externally" gnuplot-external-display-mode + :style toggle + :selected (null gnuplot-inline-image-mode)] + ["In Comint buffer" gnuplot-inline-display-mode + :active (gnuplot-display-images-p) + :style toggle + :selected (eq gnuplot-inline-image-mode 'comint)] + ["In dedicated buffer" gnuplot-dedicated-display-mode + :style toggle + :selected (eq gnuplot-inline-image-mode 'dedicated)] + "---" + ,@(mapcar #'make-image-setter (list "png" "jpeg" "svg")) + ["Other image type..." gnuplot-set-image-format]))) + (defvar gnuplot-menu - '("Gnuplot" + `("Gnuplot" ["Send line to gnuplot" gnuplot-send-line-to-gnuplot t] ["Send line & move forward" gnuplot-send-line-and-forward (not (eobp))] ["Send region to gnuplot" gnuplot-send-region-to-gnuplot @@ -797,15 +820,12 @@ ["Send buffer to gnuplot" gnuplot-send-buffer-to-gnuplot t] ["Send file to gnuplot" gnuplot-send-file-to-gnuplot t] "---" - ["Inline plot display" gnuplot-inline-image-mode - :active (gnuplot-display-images-p) - :style toggle - :selected gnuplot-inline-image-mode] + ,gnuplot-display-options-menu ["Contextual completion and help" gnuplot-context-sensitive-mode :style toggle - :selected (gnuplot-context-mode-p)] + :selected gnuplot-context-sensitive-mode] ["Echo area help (eldoc-mode)" eldoc-mode - :active (gnuplot-context-mode-p) + :active gnuplot-context-sensitive-mode :style toggle :selected eldoc-mode] "---" @@ -815,10 +835,10 @@ ["Keyword help" gnuplot-info-lookup-symbol (or gnuplot-keywords gnuplot-keywords-pending)] ["Quick help for thing at point" gnuplot-help-function - (gnuplot-context-mode-p)] + gnuplot-context-sensitive-mode] ["Info documentation on thing at point" gnuplot-info-at-point - (gnuplot-context-mode-p)] + gnuplot-context-sensitive-mode] ["Show gnuplot process buffer" gnuplot-show-gnuplot-buffer t] ["Set arguments at point" gnuplot-gui-set-options-and-insert (fboundp 'gnuplot-gui-set-options-and-insert)] @@ -834,10 +854,6 @@ ) "Menu for `gnuplot-mode'.") -;; Disable or enable menu items that depend on gnuplot-context being -;; loaded and enabled -(defsubst gnuplot-context-mode-p () - (and (boundp 'gnuplot-context-sensitive-mode) gnuplot-context-sensitive-mode)) ;;; --- insertions variables and menus @@ -1664,19 +1680,21 @@ (modify-syntax-entry ?_ "w" table ) - ;; In GNU Emacs we scan for strings and comments ourselves in - ;; `gnuplot-scan-after-change'. I can't get this to work in xemacs, - ;; so there we'll make ", ', and # delimiters as normal, and use the - ;; built-in parser - (if (featurep 'xemacs) + ;; In GNU Emacs >=24 we can use `syntax-propertize-function' to + ;; accurately scan for strings and comments (see + ;; `gnuplot-syntax-propertize'). If there's no + ;; `syntax-propertize', fall back to using the built-in parser and + ;; making ", ', and # string or comment delimiters as normal. + (if (not (boundp 'syntax-propertize-function)) (progn (modify-syntax-entry ?\' "\"" table) (modify-syntax-entry ?# "<" table) (modify-syntax-entry ?\n ">" table) (modify-syntax-entry ?\\ "\\" table)) - ;; GNU Emacs: Make ", ', and # punctuation, so the built-in parser - ;; doesn't interfere with them + ;; When syntax-propertize is available, ", ', and # should be + ;; punctuation so that the built-in parser doesn't interfere + ;; with the syntax-propertize search. (modify-syntax-entry ?\" "." table) (modify-syntax-entry ?\' "." table) (modify-syntax-entry ?` "." table) @@ -1808,123 +1826,78 @@ (put 'gnuplot-mode 'font-lock-defaults gnuplot-font-lock-defaults))) -;; Gnuplot's shell-like strings and comments don't quite agree with -;; Emacs' built-in sexp parser: +;; Some corner cases in Gnuplot's comment and string syntax are +;; difficult to handle accurately using Emacs's built-in syntax tables +;; and parser: ;; ;; - strings can continue over several lines, but only by using a ;; backslash to escape the newline ;; -;; - double quoted strings can contain escaped quotes \" and escaped -;; backslashes \\, while single quotes can escape the quote by -;; doubling '' and backslash is not special (except at eol) +;; - double-quoted strings can contain escaped quotes, \", and escaped +;; backslashes, \\; but in single-quoted strings the quote is +;; escaped by doubling it, '', and backslash is only special at +;; end-of-line ;; -;; - strings can end at newline without needing a closing delimiter +;; - either type of string can end at newline without needing a +;; - closing delimiter ;; ;; - comments continue over continuation lines -;; -;; Trying to write a regexp to match these rules is horrible, so we -;; use this matching function instead (in GNU Emacs - I can't figure out -;; how to do this in XEmacs.) -(defun gnuplot-scan-after-change (begin end &optional unused) - "Scan a gnuplot script buffer for strings and comments. - -This is called once on the whole buffer when gnuplot-mode is turned on, -and installed as a hook in `after-change-functions'." - (save-excursion - (setq end (progn - (goto-char end) - (gnuplot-point-at-end-of-continuation)) - begin (progn - (goto-char begin) - (gnuplot-beginning-of-continuation) - (point))) - - (gnuplot-with-silent-modifications - (remove-text-properties begin (min (1+ end) (point-max)) - '(syntax-table nil))) - - (while (gnuplot-scan-next-string-or-comment end)))) - -(defun gnuplot-scan-next-string-or-comment (limit) - "Put appropriate syntax-table text properties on the next comment or string. - -Scans forward from point as far as LIMIT (which should be at the -end of a line). Leaves point at the end of the comment or string, -or at LIMIT if nothing was found. Returns t if a comment or -string was found, otherwise nil." - (let ((begin (search-forward-regexp "[#'\"]" limit 'go-to-limit))) - (if (not begin) - nil - (gnuplot-with-silent-modifications - (let* ((begin (1- begin)) - (end nil) - (opener (match-string 0)) - (limit (point-at-eol)) - (end-at-eob-p nil) - (re - (cond ((string= opener "#") nil) - ((string= opener "'") "''?") - ((string= opener "\"") "\\\\\"\\|\\\\\\\\\\|\"")))) - (while (not end) - (if (and (not (eobp)) (bolp) (eolp)) ; Empty continuation line: - (setq end (point)) ; end at newline - (if re - (setq end (search-forward-regexp re limit 'go-to-limit)) - (end-of-line)) ; Comments end only at end-of-line - - (if end - (when (and re - (let ((m (match-string 0))) - (or (string= m "\\\"") - (string= m "\\\\") - (string= m "''")))) - (setq end nil)) ; Skip over escapes and look again - - ;; We got to EOL without finding an ending delimiter - (if (eobp) - (setq end (point) - end-at-eob-p t) ; string/comment ends at EOB - ;; Otherwise see if the line is continued with a backslash - (if (save-excursion (backward-char) (looking-at "\\\\")) - (progn ; yes, check out next line - (beginning-of-line 2) - (setq limit (point-at-eol))) - (setq end (1+ (point-at-eol)))))))) ; no, string ends at EOL - - ;; Set the syntax properties - (let ((begin-marker (copy-marker begin)) - (begin-quote-marker (copy-marker (1+ begin))) - (end-quote-marker (copy-marker (1- end))) - (end-marker (copy-marker end))) - - (let ((syntax (if (string= opener "#") - '(syntax-table (14)) ; 'comment fence' - '(syntax-table (15))))) ; 'string fence' - (add-text-properties begin-marker begin-quote-marker syntax) - (unless end-at-eob-p - (add-text-properties end-quote-marker end-marker syntax))) - - ;; Mark multiline constructs for font-lock - (add-text-properties begin-marker end-marker '(font-lock-multiline t))))) - - ;; We found something - t))) - +;; +;; The following syntax-propertize rules should accurately mark string +;; and comment boundaries using the "generic string fence" and +;; "generic comment fence" syntax properties. When syntax-propertize +;; is unavailable (on Emacs versions <24), we fall back to using the +;; normal syntax-table parser, which is accurate enough for most +;; normal cases. (See the definition of `gnuplot-mode-syntax-table'.) +(defalias 'gnuplot-syntax-propertize + (when (fboundp 'syntax-propertize-rules) + (syntax-propertize-rules + ;; Double quoted strings + ((rx + (group "\"") + (* (or (seq "\\" anything) + (not (any "\"" "\n")))) + (group (or "\"" "\n" buffer-end))) + (1 "|") (2 "|")) + + ;; Single quoted strings + ((rx + (group "'") + (* (or (seq "\\" "\n") + "''" + (not (any "'" "\n")))) + (group (or "'" "\n" buffer-end))) + (1 "|") (2 "|")) + + ;; Comments + ((rx + (group "#") + (* (or (seq "\\" "\n") + any)) + (or (group "\n") buffer-end)) + (1 "!") (2 "!"))))) + +(defun gnuplot-syntax-propertize-extend-region (start end) + "Expand the region to syntax-propertize for strings and comments. + +Ensures that the region being searched begins and ends outside of +any lines continued with a backslash. + +This function is added to +`syntax-propertize-extend-region-functions' in gnuplot-mode +buffers." + (let ((continuation-start + (min start + (gnuplot-point-at-beginning-of-continuation start))) + (continuation-end + (max end + (gnuplot-point-at-end-of-continuation end)))) + (if (and (= continuation-start start) + (= continuation-end end)) + nil + (cons continuation-start continuation-end)))) ;; Parsing utilities to tell if we are inside a string or comment - -;; XEmacs doesn't have syntax-ppss -(if (featurep 'xemacs) - (defun gnuplot-syntax-ppss (&optional pos) - (save-excursion - (unless pos (setq pos (point))) - (let ((begin - (save-excursion - (goto-char pos) - (gnuplot-point-at-beginning-of-continuation)))) - (parse-partial-sexp begin pos)))) - (defalias 'gnuplot-syntax-ppss 'syntax-ppss)) - (defun gnuplot-in-string (&optional where) "Returns non-nil if the text at WHERE is within a string. @@ -2194,20 +2167,59 @@ ;;; --- functions controlling the gnuplot process -;; Define gnuplot-comint-mode, the mode for the gnuplot process -;; buffer, by deriving from comint-mode +;; Menu for the comint-mode buffer +(defvar gnuplot-comint-menu + `("Gnuplot" + ["Plot most recent gnuplot buffer" gnuplot-plot-from-comint + (buffer-live-p gnuplot-comint-recent-buffer)] + ["Save and plot most recent gnuplot buffer" gnuplot-save-and-plot-from-comint + (buffer-live-p gnuplot-comint-recent-buffer)] + "---" + ,gnuplot-display-options-menu + ["Contextual completion and help" gnuplot-context-sensitive-mode + :style toggle + :selected gnuplot-context-sensitive-mode] + ["Echo area help (eldoc-mode)" eldoc-mode + :active gnuplot-context-sensitive-mode + :style toggle + :selected eldoc-mode] + "---" + ["Insert filename at point" gnuplot-insert-filename t] + ["Negate set option" gnuplot-negate-option t] + ["Keyword help" gnuplot-info-lookup-symbol + (or gnuplot-keywords gnuplot-keywords-pending)] + ["Quick help for thing at point" gnuplot-help-function + gnuplot-context-sensitive-mode] + ["Info documentation on thing at point" + gnuplot-info-at-point + gnuplot-context-sensitive-mode] + ["Switch to recent gnuplot script buffer" gnuplot-pop-to-recent-buffer + (buffer-live-p gnuplot-comint-recent-buffer)] + "---" + ["Customize gnuplot" gnuplot-customize t] + ["Submit bug report" gnuplot-bug-report t] + ["Show gnuplot-mode version" gnuplot-show-version t] + ["Show gnuplot version" gnuplot-show-gnuplot-version t] + "---" + ["Kill gnuplot" gnuplot-kill-gnuplot-buffer t] + )) + +;; Major mode `gnuplot-comint-mode' for the interaction buffer (define-derived-mode gnuplot-comint-mode comint-mode "Gnuplot interaction" "Major mode for interacting with a gnuplot process in a buffer. This sets font-lock and keyword completion in the comint/gnuplot buffer." + (set-syntax-table gnuplot-mode-syntax-table) + (if gnuplot-xemacs-p ; deal with font-lock (if (fboundp 'turn-on-font-lock) (turn-on-font-lock)) (progn (setq font-lock-defaults gnuplot-font-lock-defaults) (set (make-local-variable 'parse-sexp-lookup-properties) t) - (add-hook 'after-change-functions 'gnuplot-scan-after-change nil t))) + (set (make-local-variable 'syntax-propertize-function) + #'gnuplot-syntax-propertize))) ;; XEmacs needs the call to make-local-hook (when (and (featurep 'xemacs) @@ -2222,7 +2234,12 @@ 'gnuplot-protect-prompt-fn nil t) - (add-hook 'comint-dynamic-complete-functions 'gnuplot-comint-complete) + ;; Set up completion, using completion-at-point in recent Emacs, + ;; comint-dynamic-complete in older Emacs + (if (and (>= emacs-major-version 24) + (>= emacs-minor-version 1)) + (add-hook 'completion-at-point-functions #'gnuplot-completion-at-point nil t) + (add-hook 'comint-dynamic-complete-functions 'gnuplot-comint-complete nil t)) ;; Set up menu (see below) (easy-menu-define @@ -2234,8 +2251,13 @@ (define-key gnuplot-comint-mode-map "\M-\C-p" 'gnuplot-plot-from-comint) (define-key gnuplot-comint-mode-map "\M-\C-f" 'gnuplot-save-and-plot-from-comint) (define-key gnuplot-comint-mode-map "\C-d" 'gnuplot-delchar-or-maybe-eof) -(define-key gnuplot-comint-mode-map "\M-\r" 'comint-dynamic-complete) -(define-key gnuplot-comint-mode-map "\M-\t" 'comint-dynamic-complete) +(let ((completion-function + (if (and (>= emacs-major-version 24) + (>= emacs-minor-version 1)) + 'completion-at-point + 'comint-dynamic-complete))) + (define-key gnuplot-comint-mode-map "\M-\r" completion-function) + (define-key gnuplot-comint-mode-map "\M-\t" completion-function)) (define-key gnuplot-comint-mode-map "\C-c\C-d" 'gnuplot-info-lookup-symbol) (define-key gnuplot-comint-mode-map "\C-c\C-w" 'gnuplot-show-version) (define-key gnuplot-comint-mode-map "\C-c\C-i" 'gnuplot-insert-filename) @@ -2249,61 +2271,23 @@ ;; Menu for gnuplot-comint-mode (defvar gnuplot-comint-mode-menu nil "Menu for `gnuplot-comint-mode'.") -(defvar gnuplot-comint-menu - '("Gnuplot" - ["Plot most recent gnuplot buffer" gnuplot-plot-from-comint - (buffer-live-p gnuplot-comint-recent-buffer)] - ["Save and plot most recent gnuplot buffer" gnuplot-save-and-plot-from-comint - (buffer-live-p gnuplot-comint-recent-buffer)] - "---" - ["Inline plot display" gnuplot-inline-image-mode - :active (gnuplot-display-images-p) - :style toggle - :selected gnuplot-inline-image-mode] - ["Contextual completion and help" gnuplot-context-sensitive-mode - :style toggle - :selected (gnuplot-context-mode-p)] - ["Echo area help (eldoc-mode)" eldoc-mode - :active (gnuplot-context-mode-p) - :style toggle - :selected eldoc-mode] - "---" - ["Insert filename at point" gnuplot-insert-filename t] - ["Negate set option" gnuplot-negate-option t] - ["Keyword help" gnuplot-info-lookup-symbol - (or gnuplot-keywords gnuplot-keywords-pending)] - ["Quick help for thing at point" gnuplot-help-function - (gnuplot-context-mode-p)] - ["Info documentation on thing at point" - gnuplot-info-at-point - (gnuplot-context-mode-p)] - ["Switch to recent gnuplot script buffer" gnuplot-pop-to-recent-buffer - (buffer-live-p gnuplot-comint-recent-buffer)] - "---" - ["Customize gnuplot" gnuplot-customize t] - ["Submit bug report" gnuplot-bug-report t] - ["Show gnuplot-mode version" gnuplot-show-version t] - ["Show gnuplot version" gnuplot-show-gnuplot-version t] - "---" - ["Kill gnuplot" gnuplot-kill-gnuplot-buffer t] - )) ;; Switch to the gnuplot program buffer (defun gnuplot-make-gnuplot-buffer () "Switch to the gnuplot program buffer or create one if none exists." - (or (and gnuplot-process (get-process gnuplot-process) - gnuplot-buffer (buffer-name gnuplot-buffer)) - (progn - (message "Starting gnuplot plotting program...") - (setq gnuplot-buffer (make-comint gnuplot-process-name gnuplot-program) - gnuplot-process (get-process gnuplot-process-name)) - (process-kill-without-query gnuplot-process nil) - (with-current-buffer gnuplot-buffer - (gnuplot-comint-mode) - (when gnuplot-inline-image-mode - (sleep-for gnuplot-delay) - (gnuplot-inline-image-mode 1)) - (message "Starting gnuplot plotting program...Done"))))) + (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) + gnuplot-process (get-buffer-process gnuplot-buffer)) + (gnuplot-set-process-query-on-exit-flag gnuplot-process nil) + (with-current-buffer gnuplot-buffer + (gnuplot-comint-mode) + (when gnuplot-inline-image-mode + (sleep-for gnuplot-delay) + (gnuplot-setup-comint-for-image-mode))) + (message "Starting gnuplot plotting program...Done"))) + (defun gnuplot-fetch-version-number () "Determine the installed version of the gnuplot program. @@ -2435,42 +2419,45 @@ (switch-to-buffer gnuplot-buffer)))) -;;; --- Support for displaying plot images inline in process buffer, -;;; using `set terminal png' +;;; Support for displaying plotted images within Emacs + +(defvar gnuplot-inline-image-filename nil + "Name of the current Gnuplot output file.") -(defun gnuplot-inline-image-mode (&optional enable called-interactively-p) - "Turn inline display of Gnuplot output in the comint buffer on or off. +(defvar gnuplot-image-buffer-name "*gnuplot output*") -This works by having Gnuplot save its output to temporary .png -files using \"set terminal png\" and \"set output\" commands, -which are sent invisibly to the running Gnuplot process between -user commands. - -Works like a minor mode: with argument, turn inline image display -on if ENABLE is positive, otherwise turn it off and restores the -previous Gnuplot terminal setting. With no argument, toggle -inline image display." - (interactive (list (if current-prefix-arg - (prefix-numeric-value current-prefix-arg)) - t)) - (setq gnuplot-inline-image-mode - (if (null enable) (not gnuplot-inline-image-mode) - (> (prefix-numeric-value enable) 0))) - - (let (message) - (if gnuplot-inline-image-mode - (if (gnuplot-display-images-p) - (setq message "Plot output will be displayed in gnuplot buffer.") - (setq gnuplot-inline-image-mode nil - message "Displaying images is not supported.")) - (setq message "Plot output will be displayed on external terminal.")) - (when called-interactively-p (message message))) +(defun gnuplot-display-images-p () + ;; Inline images require GNU Emacs. + (and (not (featurep 'xemacs)) + (fboundp 'display-images-p) + (display-images-p))) - (when (and gnuplot-buffer (buffer-name gnuplot-buffer)) +(defun gnuplot-external-display-mode () + (interactive) + (gnuplot-set-display-mode 'gnuplot-inline-image-mode nil)) + +(defun gnuplot-inline-display-mode () + (interactive) + (gnuplot-set-display-mode 'gnuplot-inline-image-mode 'inline)) + +(defun gnuplot-dedicated-display-mode () + (interactive) + (gnuplot-set-display-mode 'gnuplot-inline-image-mode 'dedicated)) + +(defun gnuplot-set-image-format (format) + (interactive "sGnuplot image format: ") + (gnuplot-set-display-mode 'gnuplot-image-format format) + (unless gnuplot-inline-image-mode + (message "Setting will take effect when plots are displayed in Emacs"))) + +(defun gnuplot-setup-comint-for-image-mode () + (when (and gnuplot-buffer (buffer-live-p gnuplot-buffer) + (get-buffer-process gnuplot-buffer)) (with-current-buffer gnuplot-buffer (if gnuplot-inline-image-mode (progn - (gnuplot-send-hiding-output "set terminal png\n") + (gnuplot-send-hiding-output + (format "set terminal %s\n" gnuplot-image-format)) (gnuplot-inline-image-set-output) (add-hook 'comint-output-filter-functions 'gnuplot-insert-inline-image-output nil t)) @@ -2478,26 +2465,14 @@ (remove-hook 'comint-output-filter-functions 'gnuplot-insert-inline-image-output t))))) -;; Has to be defined below the function, due to how -;; custom-set-minor-mode works. Or is there a better way?? -(defcustom gnuplot-inline-image-mode nil - "Whether to enable inline display of Gnuplot output in the process buffer. -Don't set this variable directly from Lisp code; instead, use -Customize or call the `gnuplot-inline-image-mode' function, which -behaves like a minor-mode function." - :group 'gnuplot - :type 'boolean - :set 'gnuplot-set-minor-mode) - -(defvar gnuplot-inline-image-filename nil - "Name of the current Gnuplot PNG output file.") - (defun gnuplot-inline-image-set-output () "Set Gnuplot's output file to `gnuplot-inline-image-filename'." (let ((tmp (make-temp-file "gnuplot"))) (setq gnuplot-inline-image-filename tmp) (gnuplot-send-hiding-output (format "set output '%s'\n" tmp)))) - + +(defvar gnuplot-inhibit-filter nil) + (defun gnuplot-insert-inline-image-output (string) "Insert Gnuplot graphical output in the gnuplot-comint buffer. @@ -2507,18 +2482,35 @@ nonzero size, inserts it as an inline image, stores a new temporary filename in `gnuplot-inline-image-filename', and updates Gnuplot with the appropriate 'set output' command." - (save-excursion - (goto-char (point-max)) - (beginning-of-line) - (when (looking-at gnuplot-prompt-regexp) - (let* ((filename gnuplot-inline-image-filename) - (size (nth 7 (file-attributes filename)))) - (if (and size (> size 0)) - (let ((image (create-image filename))) - (beginning-of-line) - (insert-image image) - (insert "\n") - (gnuplot-inline-image-set-output))))))) + (unless gnuplot-inhibit-filter ; Prevent recursively entering this filter + (let ((gnuplot-inhibit-filter t)) ; (causing an infinite loop) + (save-excursion + (goto-char (point-max)) + (beginning-of-line) + (when (looking-at gnuplot-prompt-regexp) + (let* ((filename gnuplot-inline-image-filename) + (size (nth 7 (file-attributes filename)))) + (when (and size (> size 0)) + (gnuplot-send-hiding-output "set output\n") ; Flush output file + (sit-for 0.1) ; Hack: wait for Gnuplot IO to finish + (ecase gnuplot-inline-image-mode + (nil nil) + (inline + (ignore-errors + (let ((image (create-image filename))) + (beginning-of-line) + (insert-image image) + (insert "\n") + (gnuplot-inline-image-set-output)))) + (dedicated + (with-current-buffer + (get-buffer-create gnuplot-image-buffer-name) + (let ((inhibit-read-only t)) + (erase-buffer) + (insert-file-contents filename) + (ignore-errors (normal-mode)) + (display-buffer (current-buffer)) + (gnuplot-inline-image-set-output)))))))))))) ;;; Send commands to GNUPLOT silently & without generating an extra prompt (defvar gnuplot-hidden-output-buffer " *gnuplot output*") @@ -2530,7 +2522,7 @@ 'gnuplot-discard-output nil t)) (with-current-buffer (get-buffer-create gnuplot-hidden-output-buffer) (erase-buffer)) - (comint-send-string gnuplot-process string)) + (comint-send-string (get-buffer-process gnuplot-buffer) string)) (defun gnuplot-discard-output (string) ;; Temporary preoutput filter for hiding Gnuplot output & prompt. @@ -2653,19 +2645,21 @@ ;; Save-excursion wrappers for the above to return point at beginning ;; or end of continuation -(defun gnuplot-point-at-beginning-of-continuation () +(defun gnuplot-point-at-beginning-of-continuation (&optional pos) "Return value of point at beginning of the continued block containing point. If there are no continuation lines, returns point-at-bol." (save-excursion + (when pos (goto-char pos)) (gnuplot-beginning-of-continuation) (point))) -(defun gnuplot-point-at-end-of-continuation () +(defun gnuplot-point-at-end-of-continuation (&optional pos) "Return value of point at the end of the continued block containing point. If there are no continuation lines, returns point-at-eol." (save-excursion + (when pos (goto-char pos)) (gnuplot-end-of-continuation) (point))) @@ -2882,7 +2876,112 @@ (delete "nil" store) store )) + +;;;; Completion at point and Eldoc. + +;; There are two alternative completion-at-point mechanisms: the old +;; one using info-look and the new one (enabled by default) which +;; parses the command line to provide smarter completions. + +;; `gnuplot-completion-at-point-function' defines which one is +;; used. `gnuplot-context-sensitive-mode' toggles between the two. + +(defvar gnuplot-completion-at-point-function #'gnuplot-completion-at-point-info-look + "Function to call to perform completion in Gnuplot buffers.") + (defun gnuplot-completion-at-point () + (funcall gnuplot-completion-at-point-function)) + +(defvar gnuplot-eldoc-hash nil + "ElDoc strings for gnuplot-mode. + +These have to be compiled from the Gnuplot source tree using +`doc2texi.el'.") + +;; Enable and disable context-sensitive completion +(define-minor-mode gnuplot-context-sensitive-mode + "Use context-sensitive completion and help in gnuplot-mode. + +When context-sensitive mode is enabled, gnuplot-mode tries to +provide more useful completions and help suggestions for built-in +keywords and functions by parsing each command as you type. It +attempts to take into account Gnuplot's many abbreviated +keywords. For example, with point at the end of a line reading +\"plot 'datafile' w \", typing \\[completion-at-point] will pop +up a list of plotting styles. + +Key bindings: + +\\[completion-at-point] will complete the keyword at point based +on its context in the command. To make keyword completion work on +pressing TAB, set `tab-always-indent' to `complete', or customize +`gnuplot-tab-completion' to make this automatic in gnuplot-mode +buffers. + +\\[gnuplot-info-at-point] will try to find the most relevant +Gnuplot info node for the construction at point, prompting for a +node name if nothing is found. + +\\[gnuplot-help-function] will pop up a brief summary of the +syntax at point in the minibuffer. To have one-line syntax +summaries appear in the echo area as you type, toggle +`eldoc-mode' or customize `gnuplot-eldoc-mode'. + +To choose whether to use this mode by default in Gnuplot buffers, +customize the variable +`gnuplot-use-context-sensitive-completion'. + +Note: help strings for eldoc-mode and \\[gnuplot-help-function] +need to be provided in an Emacs-readable form by the Gnuplot +distribution. See gnuplot-context.el for details." + :keymap + `((,(kbd "C-c C-/") . gnuplot-help-function) + (,(kbd "C-c C-d") . gnuplot-info-at-point)) + (unless (derived-mode-p 'gnuplot-mode 'gnuplot-comint-mode) + (message "Gnuplot context-sensitive mode works only in Gnuplot-mode buffers") + (setq gnuplot-context-sensitive-mode nil)) + (if gnuplot-context-sensitive-mode + ;; Turn on + (progn + (load-library "gnuplot-context") + (load-library "eldoc") + (setq gnuplot-completion-at-point-function #'gnuplot-context-completion-at-point) + + ;; Setup Eldoc + (set (make-local-variable 'eldoc-documentation-function) + 'gnuplot-eldoc-function) + (eldoc-add-command 'completion-at-point) ; Check for eldoc after completion + (when (fboundp 'comint-dynamic-complete) + (eldoc-add-command 'comint-dynamic-complete)) + + ;; Try to load Eldoc strings + (when gnuplot-eldoc-mode + (unless gnuplot-eldoc-hash + (condition-case nil + (load-library "gnuplot-eldoc") + (error + (message "gnuplot-eldoc.el not found. Install it from the Gnuplot distribution.") + (setq gnuplot-eldoc-hash nil + gnuplot-eldoc-mode nil)))) + + (if gnuplot-eldoc-hash + (eldoc-mode 1) + (eldoc-mode 0))) + + ;; Set up tab-to-complete + (when gnuplot-tab-completion + (set (make-local-variable 'tab-always-indent) 'complete)) + + (message "Gnuplot context-sensitive help & completion enabled.")) + + ;; Turn off + (setq gnuplot-completion-at-point-function #'gnuplot-completion-at-point-info-look) + (setq eldoc-documentation-function nil) + (eldoc-mode 0) + (message "Gnuplot context-sensitive help & completion disabled."))) + +;; Older completion method using info-look +(defun gnuplot-completion-at-point-info-look () "Return completions of keyword preceding point. Uses the cache of keywords generated by info-lookup. See @@ -2906,9 +3005,7 @@ (defun gnuplot-comint-complete () "Complete the keyword preceding point in the gnuplot comint buffer. -Uses the cache of keywords generated by info-lookup and -`comint-dynamic-simple-complete' to handle the actual -completion." +This is only used in Emacs versions before 24.1." (let ((completions (gnuplot-completion-at-point))) (if completions (let* ((beg (nth 0 completions)) @@ -2920,6 +3017,7 @@ candidates)) nil))) + (defun gnuplot-info-lookup-symbol (symbol &optional mode) "Wrapper for `info-lookup-symbol'. Takes SYMBOL and MODE as arguments exactly as @@ -3181,13 +3279,17 @@ (when (fboundp 'turn-on-font-lock) (turn-on-font-lock)) (progn - (gnuplot-scan-after-change (point-min) (point-max)) - (add-hook 'after-change-functions 'gnuplot-scan-after-change nil t) + ;; Add syntax-propertizing functions to search for strings and comments + (set (make-local-variable 'syntax-propertize-function) + #'gnuplot-syntax-propertize) + (add-hook 'syntax-propertize-extend-region-functions + #'gnuplot-syntax-propertize-extend-region nil t) + + ;; Set up font-lock (setq font-lock-defaults gnuplot-font-lock-defaults) (set (make-local-variable 'font-lock-multiline) t) (set (make-local-variable 'parse-sexp-lookup-properties) t))) - (if (fboundp 'widget-create) ; gnuplot-gui (condition-case () (require 'gnuplot-gui) @@ -3217,6 +3319,13 @@ (switch-to-buffer gnuplot-gnuplot-buffer) (gnuplot-mode)) +;;;###autoload +(defun run-gnuplot () + "Run an inferior Gnuplot process." + (interactive) + (gnuplot-make-gnuplot-buffer) + (pop-to-buffer gnuplot-buffer)) + (defun gnuplot-show-version () "Show version number in echo area" (interactive) diff -Nru gnuplot-mode-0.7.0/gnuplot-test-context.el gnuplot-mode-0.7.0-2014-12-31/gnuplot-test-context.el --- gnuplot-mode-0.7.0/gnuplot-test-context.el 2014-03-18 02:50:43.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/gnuplot-test-context.el 2019-02-02 07:16:50.000000000 +0000 @@ -3,11 +3,16 @@ ;; (require 'gnuplot-context) + (require 'ert) (eval-when-compile + (require 'cl) (if (not (fboundp 'ert-deftest)) - (defalias 'ert-deftest 'deftest))) + (defalias 'ert-deftest 'deftest)) + + (if (not (fboundp 'line-number-at-pos)) + (defalias 'line-number-at-pos 'line-number))) (defun gnuplot-run-tests () (interactive) @@ -19,17 +24,11 @@ (with-temp-buffer (gnuplot-mode) (insert string) + (when (fboundp 'syntax-propertize) + (syntax-propertize (point-max))) (goto-char (point-max)) (gnuplot-tokenize))) -(defmacro with-gnuplot-tokens-from-string (binding &rest body) - (declare (indent 1)) - `(with-temp-buffer - (gnuplot-mode) - (insert ,(cadr binding)) - (let ((,(car binding) (gnuplot-tokenize))) - ,@body))) - (defun gnuplot-simplify-tokens (tokens) (mapcar (lambda (token) @@ -331,11 +330,6 @@ ("cntrparam levels 10") ("cntrparam levels incremental 100,50"))) -;;; parse all the demos -(ert-deftest gnuplot-test-all-demos () - (should (> (gnuplot-test-parse-all-demos) - .83))) - ;; @@ -347,14 +341,21 @@ ;; ;; Set this to wherever the gnuplot demos are -(defvar gnuplot-demo-dir "~/dev/gnuplot/demo/") +(defvar gnuplot-demo-dir (getenv "GNUPLOT_DEMO_DIR")) (defvar gnuplot-test-result-buffer "*gnuplot parse test results*") (defvar gnuplot-test-count 0) (defvar gnuplot-test-success-count 0) -(if (not (fboundp 'line-number-at-pos)) - (defalias 'line-number-at-pos 'line-number)) +(ert-deftest gnuplot-test-all-demos () + (let ((demo-dir-exists (and (stringp gnuplot-demo-dir) + (file-directory-p gnuplot-demo-dir)))) + (unless demo-dir-exists + (message "Directory `%s' not found, skipping test" gnuplot-demo-dir) + (message "(Set the environment variable GNUPLOT_DEMO_DIR to run it.)")) + (skip-unless demo-dir-exists) + (should (> (gnuplot-test-parse-all-demos) + .83)))) (defun gnuplot-test-parse-all-demos () (interactive) diff -Nru gnuplot-mode-0.7.0/gnuplot-tests.el gnuplot-mode-0.7.0-2014-12-31/gnuplot-tests.el --- gnuplot-mode-0.7.0/gnuplot-tests.el 1970-01-01 00:00:00.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/gnuplot-tests.el 2019-02-02 07:16:50.000000000 +0000 @@ -0,0 +1,253 @@ +;;; Tests for gnuplot-mode. + +;;; Currently these attempt to cover the correct identification of +;;; string and comment syntax. + +(require 'gnuplot) +(require 'ert) +(eval-when-compile (require 'cl)) + +;; Hide an annoying interactive message during batch testing +(when (require 'nadvice nil t) + (advice-add + 'message + :around + (lambda (orig-message format-string &rest args) + (unless (string= format-string + "gnuplot-mode %s (gnuplot %s) -- report bugs with %S") + (apply orig-message format-string args))))) + +(eval-and-compile + (defvar gnuplot-string-test-contexts + '("%s" + "print %s" + "print %s, 2+3" + "print %s, 'another string'" + "print %s, \"another string\"" + "print 'another string', %s" + "\"double-quoted string\" %s" + "\"double-quoted string\"%s" + "%s \"double-quoted string\"" + "%s\"double-quoted string\"" + "'single-quoted string' %s" + "%s 'single-quoted string'" + "'single-quoted string' %s 'single-quoted string'"))) + +(defun gnuplot-test-string-in-context (string context) + "Test syntax-propertizing of STRING in CONTEXT in gnuplot-mode. + +STRING contains text representing a Gnuplot string literal. +CONTEXT is a context is a context to place the literal within, +represented by a format-string with a single %s placeholder. + +Returns non-nil if STRING is correctly recognised as a single +string by `scan-sexps'." + (destructuring-bind (prologue epilogue) + (split-string context "%s") + (with-temp-buffer + (gnuplot-mode) + (let (start end) + (save-excursion + (insert prologue) + (setq start (point)) + (insert string) + (setq end (point)) + (insert epilogue)) + (when (fboundp 'syntax-propertize) + (syntax-propertize (point-max))) + (string= (buffer-substring start (scan-sexps start 1)) + string))))) + +(defmacro gnuplot-test-string (name string) + "Define an `ert' test to check syntax recognition of STRING in gnuplot-mode. + +The test checks that STRING is correctly recognised as a single +string-literal in multiple different contexts, as determined by +`gnuplot-string-test-contexts'." + (declare (indent 1)) + `(ert-deftest ,name () + ,string + ,@(loop for context in gnuplot-string-test-contexts + collect + `(should (gnuplot-test-string-in-context ,string ,context))))) + + +;;;; Tests for double-quoted strings +(gnuplot-test-string gnuplot-double-quoted-string + "\"double-quoted string\"") + +(gnuplot-test-string gnuplot-double-quoted-with-single-quotes + "\"double-quoted 'with single quotes' embedded\"") + +(gnuplot-test-string gnuplot-double-quoted-with-single-quotes-2 + "\"'single quotes inside double quotes'\"") + +(gnuplot-test-string gnuplot-double-quoted-escapes + "\"double-quoted \\\\ string \\\" with embedded \\\" escapes\"") + +(gnuplot-test-string gnuplot-double-quoted-escapes-2 + "\"escaped quote before closing quote \\\"\"") + +(gnuplot-test-string gnuplot-double-quoted-escapes-3 + "\"escaped backslash before closing quote \\\\\"") + +(gnuplot-test-string gnuplot-double-quoted-escapes-4 + "\"\\\" escaped quote after opening quote\"") + +(gnuplot-test-string gnuplot-double-quoted-escapes-5 + "\"\\\\ escaped backslash after opening quote\"") + +(gnuplot-test-string gnuplot-double-quoted-escapes-6 + "\"\\\\\\\" escaped backslashes + escaped quotes (1) \\\\\\\"\"") + +(gnuplot-test-string gnuplot-double-quoted-empty + "\"\"") + +(gnuplot-test-string gnuplot-double-quoted-string-containing-escaped-quotes + "\"\\\"\\\"\"") + +(gnuplot-test-string gnuplot-newline-terminated-double-quoted-string + "\"newline-terminated +") + +(gnuplot-test-string gnuplot-double-quoted-with-embedded-newlines + "\"string \\ + with embedded \\ +newlines\"") + +(gnuplot-test-string gnuplot-newline-terminated-double-quoted-string-with-newline + ;; with newlines + "\"newline-terminated string \\ + with newlines +") + + +;;;; Tests for single-quoted strings +(gnuplot-test-string gnuplot-single-quoted-strings + "'single-quoted string'") + +(gnuplot-test-string gnuplot-single-quoted-empty + "''") + +(gnuplot-test-string gnuplot-single-quoted-with-double-quotes + "'a single-quoted string \"containing a double-quoted string\"'") + +(gnuplot-test-string gnuplot-single-quoted-quotes + "'embedded '' quote '' characters'") + +(gnuplot-test-string gnuplot-single-quoted-quotes-2 + "'embedded '' quote '' characters'''") + +(gnuplot-test-string gnuplot-single-quoted-quotes-3 + "' '''") + +(gnuplot-test-string gnuplot-single-quoted-backslashes + "'embedded \\ backslashes \\'") + +(gnuplot-test-string gnuplot-single-quoted-backslashes-2 + "'multiple \\ embedded \\\\ backslashes \\\\\\'") + +(gnuplot-test-string gnuplot-single-quoted-trailing-backslash + "'trailing backslash\\'") + +(gnuplot-test-string gnuplot-single-quoted-newline-terminated + "'newline terminated\n") + +(gnuplot-test-string gnuplot-single-quoted-newline-terminated-quotes + "'embedded '' escapes \\ ending at newline ''\n") + +(gnuplot-test-string gnuplot-single-quoted-embedded-newlines + "'string \\\n with embedded \\\nnewlines'") + +(gnuplot-test-string gnuplot-single-quoted-embedded-newlines-backslashes + "'string \\\\\n with \\\\\\\n multiple \\\\\\\\\n backslashes'") + +(gnuplot-test-string gnuplot-single-quoted-newline-terminated-embedded-newline + "'newline-terminated string \\\n with newlines\n") + + +;;;; Comment syntax +(eval-and-compile + (defvar gnuplot-comment-test-contexts + '("%s" + "\n%s" + "\n\n%s\n\n" + "print 'single-quoted string' %s" + "print \"double-quoted string\" %s" + "print 'single-quoted string # with hash mark' %s" + "print \"double-quoted string # with hash mark\" %s" + "plot sin(x), cos(x) %s" + "plot sin(x) +%s +plot cos(x)" + "# one-line comment +%s" + "# multi-line \\ +comment +%s") + "List of contexts in which to test syntax recognition of comments.")) + +(defun gnuplot-test-comment-in-context (comment context) + "Non-nil if COMMENT is correctly recognised within CONTEXT in gnuplot-mode." + (destructuring-bind (prologue epilogue) + (split-string context "%s") + (with-temp-buffer + (gnuplot-mode) + (let (start end) + (save-excursion + (insert prologue) + (setq start (point)) + (insert comment) + (setq end (point)) + (insert epilogue)) + (when (fboundp 'syntax-propertize) + (syntax-propertize (point-max))) + (goto-char (1+ start)) + (flet ((in-comment-p (position) + (nth 4 (syntax-ppss position)))) + (and + (not (in-comment-p start)) + (loop for position from (1+ start) upto end + always (in-comment-p position)) + (or (= end (point-max)) + (not (in-comment-p (1+ end)))))))))) + +(defmacro gnuplot-test-comment (name comment) + "Define an `ert' test to check syntax recognition of COMMENT in gnuplot-mode. + +The test checks that STRING is correctly recognised as a single +string-literal in multiple different contexts, as determined by +`gnuplot-string-test-contexts'." + (declare (indent 1)) + `(ert-deftest ,name () + ,comment + ,@(loop for context in gnuplot-comment-test-contexts + collect + `(should (gnuplot-test-comment-in-context ,comment ,context))))) + +(gnuplot-test-comment gnuplot-comment-simple + "# a simple one-line comment") + +(gnuplot-test-comment gnuplot-comment-multiline + "# a comment\ +continued \ +over multiple lines") + +(gnuplot-test-comment gnuplot-comment-with-hashes + "# a comment # with more # hash # characters #") + +(gnuplot-test-comment gnuplot-comment-multiline-with-hashes + "# a comment \ +# continued # over \ +mutliple # lines #") + +(gnuplot-test-comment gnuplot-comment-with-single-quotes + "# a comment 'containing a single-quoted string'") + +(gnuplot-test-comment gnuplot-comment-with-single-quotes + "# a comment \"containing a double-quoted string\"") + +(gnuplot-test-comment gnuplot-comment-multiline-with-quotes + "# a continued \ +'comment' \ +\"containing strings\"") diff -Nru gnuplot-mode-0.7.0/Makefile.am gnuplot-mode-0.7.0-2014-12-31/Makefile.am --- gnuplot-mode-0.7.0/Makefile.am 2014-03-18 02:50:43.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/Makefile.am 2019-02-02 07:16:50.000000000 +0000 @@ -31,4 +31,10 @@ pdf: gpelcard.pdf ps: gpelcard.ps +test: gnuplot.elc gnuplot-context.elc gnuplot-tests.elc gnuplot-test-context.elc + emacs --batch -L . \ + --load=gnuplot-tests \ + --load=gnuplot-test-context \ + --eval='(ert-run-tests-batch "^gnuplot-")' + SUFFIXES = .el .elc .pdf .ps .tex diff -Nru gnuplot-mode-0.7.0/Makefile.dst gnuplot-mode-0.7.0-2014-12-31/Makefile.dst --- gnuplot-mode-0.7.0/Makefile.dst 2014-03-18 02:50:43.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/Makefile.dst 2019-02-02 07:16:50.000000000 +0000 @@ -1,7 +1,7 @@ # -*- mode: makefile -*- ## Set this variable to "xemacs" if you use XEmacs -EMACS = emacs +EMACS ?= emacs ## You will probably not need to change anything below this line @@ -17,14 +17,14 @@ all: gnuplot.elc gnuplot-gui.elc gnuplot-context.elc gpelcard.pdf gpelcard.ps -gnuplot.elc: gnuplot.el - $(BYTE) gnuplot.el +%.elc: %.el + $(BYTE) "$<" -gnuplot-gui.elc: gnuplot-gui.el - $(BYTE) gnuplot-gui.el - -gnuplot-context.elc: gnuplot-context.el - $(BYTE) gnuplot-context.el +test: gnuplot.elc gnuplot-context.elc gnuplot-tests.elc gnuplot-test-context.elc + $(EMACS) --batch -L . \ + --load=gnuplot-tests \ + --load=gnuplot-test-context \ + --eval='(ert-run-tests-batch "^gnuplot-")' gpelcard.ps: gpelcard.dvi dvips -o gpelcard.ps gpelcard.dvi diff -Nru gnuplot-mode-0.7.0/Makefile.in gnuplot-mode-0.7.0-2014-12-31/Makefile.in --- gnuplot-mode-0.7.0/Makefile.in 2014-03-18 02:50:43.000000000 +0000 +++ gnuplot-mode-0.7.0-2014-12-31/Makefile.in 2019-02-02 07:16:50.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.13.1 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2012 Free Software Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -15,23 +15,51 @@ @SET_MAKE@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -51,7 +79,7 @@ subdir = . DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ - $(dist_lisp_LISP) COPYING INSTALL install-sh missing + $(dist_lisp_LISP) COPYING install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -277,12 +305,12 @@ .el.elc: if test "$(EMACS)" != "no"; then \ - am__subdir_includes=''; \ + am__dir=. am__subdir_includes=''; \ case $@ in */*) \ am__dir=`echo '$@' | sed 's,/[^/]*$$,,'`; \ am__subdir_includes="-L $$am__dir -L $(srcdir)/$$am__dir"; \ esac; \ - test -d $$am__dir || $(MKDIR_P) $$am__dir || exit 1; \ + test -d "$$am__dir" || $(MKDIR_P) "$$am__dir" || exit 1; \ $(EMACS) --batch \ $(AM_ELCFLAGS) $(ELCFLAGS) \ $$am__subdir_includes -L $(builddir) -L $(srcdir) \ @@ -436,10 +464,16 @@ $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -481,9 +515,10 @@ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -683,6 +718,12 @@ pdf: gpelcard.pdf ps: gpelcard.ps +test: gnuplot.elc gnuplot-context.elc gnuplot-tests.elc gnuplot-test-context.elc + emacs --batch -L . \ + --load=gnuplot-tests \ + --load=gnuplot-test-context \ + --eval='(ert-run-tests-batch "^gnuplot-")' + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: