update packages

This commit is contained in:
2021-01-08 19:32:30 +01:00
parent ce8f24d28a
commit f5649dceab
467 changed files with 26642 additions and 22487 deletions

View File

@@ -230,31 +230,20 @@
;;; Code:
;; Library dependencies
(eval-when-compile
(require 'cl)
;; Prevent compiler warnings about undefined functions
(require 'gnuplot))
;; We need ElDoc support
(require 'cl-lib)
(require 'gnuplot)
(require 'eldoc)
;; 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)))))
(require 'info)
(require 'info-look)
;;;; The tokenizer.
(defstruct gnuplot-token
start ; Buffer start position
(cl-defstruct gnuplot-token
start ; Buffer start position
end ; Buffer end position
id ; Text
type) ; a symbol: name, number, string, operator, separator
type) ; a symbol: name, number, string, operator, separator
(defvar gnuplot-operator-regexp
(eval-when-compile
@@ -447,7 +436,7 @@ name; otherwise continues tokenizing up to the token at point. FIXME."
;; Symbols match token types or calls to other patterns
((symbolp pat)
(case pat
(cl-case pat
((any) `((any)))
((name number string separator) `((token-type ,pat)))
(t `((call ,pat)))))
@@ -460,11 +449,11 @@ name; otherwise continues tokenizing up to the token at point. FIXME."
;; Other forms combine simpler patterns
(t
(let ((type (car pat)))
(case type
(cl-case type
;; (sequence...): concatenate patterns, with optional eldoc
;; and info strings
((sequence)
(destructuring-bind
(cl-destructuring-bind
(subpats eldoc info)
(gnuplot-filter-arg-list (cdr pat))
(let ((eldoc-push '()) (eldoc-pop '())
@@ -498,7 +487,7 @@ name; otherwise continues tokenizing up to the token at point. FIXME."
(t ; two patterns
(let* ((pat1 (cadr pat))
(pat2 (caddr pat))
(pat2 (cl-caddr pat))
(pat1-c (gnuplot-compile-pattern pat1))
(pat2-c (gnuplot-compile-pattern pat2))
(pat1-l (length pat1-c))
@@ -536,13 +525,13 @@ name; otherwise continues tokenizing up to the token at point. FIXME."
;; Syntactic sugar for delimited lists
((delimited-list)
(let* ((item (cadr pat))
(sep (caddr pat)))
(sep (cl-caddr pat)))
(gnuplot-compile-pattern
`(sequence ,item (many (sequence ,sep ,item))))))
;; keywords
((kw)
(destructuring-bind (regex name)
(cl-destructuring-bind (regex name)
(gnuplot-keyword-helper (cdr pat))
`((keyword ,regex ,name))))
@@ -579,7 +568,7 @@ name; otherwise continues tokenizing up to the token at point. FIXME."
(eldoc nil) (info nil))
(dolist (item args)
(let ((type (car-safe item)))
(case type
(cl-case type
((:eldoc) (setq eldoc (cadr item)))
((:no-info) (setq info :no-info)) ; inhibit stack scanning
((:info) (setq info (cadr item)))
@@ -641,7 +630,7 @@ name; otherwise continues tokenizing up to the token at point. FIXME."
(let ((name (car chunk))
(code (cdr chunk)))
(setf (aref object-code i) `(label ,name))
(incf i)
(cl-incf i)
(puthash name i name->offset)
(while code
(setf (aref object-code i) (car code)
@@ -654,7 +643,7 @@ name; otherwise continues tokenizing up to the token at point. FIXME."
(let ((pattern-name nil))
(dotimes (i (length object-code))
(let ((inst (aref object-code i)))
(case (car inst)
(cl-case (car inst)
((label)
(setq pattern-name (cadr inst)))
@@ -1800,15 +1789,15 @@ there."
(when start-symbol ; HACK FIXME
(let ((look-for `(label ,start-symbol)))
(while (not (equal (aref instructions pc) look-for))
(incf pc))
(incf pc)))
(cl-incf pc))
(cl-incf pc)))
(setq gnuplot-completions nil
gnuplot-eldoc nil
gnuplot-info-at-point nil
gnuplot-captures nil)
(flet ((advance
(cl-flet ((advance
()
(pop tokens)
(if (and (null tokens) (not completing-p))
@@ -1823,11 +1812,11 @@ there."
(end-of-tokens (null tokens)))
(gnuplot-trace "%s\t%s\t%s\n" pc inst (and token (gnuplot-token-id token)))
(case opcode
(cl-case opcode
;; (literal LITERAL NO-COMPLETE)
((literal)
(let ((expect (cadr inst))
(no-complete (caddr inst)))
(no-complete (cl-caddr inst)))
(cond (end-of-tokens
(unless no-complete
(gnuplot-trace "\tpushing \"%s\" to completions\n" expect)
@@ -1852,7 +1841,7 @@ there."
;; regexp-matches REGEXP, use NAME for completions
((keyword)
(let ((regexp (cadr inst))
(name (caddr inst)))
(name (cl-caddr inst)))
(cond (end-of-tokens
(gnuplot-trace "\tpushing \"%s\" to completions\n" name)
(push name gnuplot-completions)
@@ -1929,7 +1918,7 @@ there."
;; onto the stack
((push)
(let* ((type (cadr inst))
(value (caddr inst)))
(value (cl-caddr inst)))
(push `(,type ,value ,tokens) stack)))
;; (pop TYPE): pop something off the stack
@@ -1953,7 +1942,7 @@ there."
(record (assoc name gnuplot-captures)))
(if (not record)
(error "Gnuplot-match-tokens: no open capture group named %s" name)
(setf (caddr record) tokens)
(setf (cl-caddr record) tokens)
(gnuplot-debug (gnuplot-dump-captures)))))
;; (check-progress): make sure not stuck in an infinite loop
@@ -1981,7 +1970,7 @@ there."
(when (and end-of-tokens (not completing-p))
(gnuplot-scan-stack stack tokens))
(destructuring-bind
(cl-destructuring-bind
(bt-stack bt-tokens bt-pc bt-captures bt-progress)
(pop backtrack)
(setq stack bt-stack
@@ -2003,10 +1992,10 @@ there."
(not (and gnuplot-info-at-point gnuplot-eldoc)))
(let* ((item (car stack))
(type (car item))
(position (caddr item))) ; must progress by at least one token
(position (cl-caddr item))) ; must progress by at least one token
(if (and (memq type '(info eldoc no-scan))
(not (eq position tokens)))
(case type
(cl-case type
((no-scan)
(throw 'no-scan nil))
@@ -2041,7 +2030,7 @@ there."
(let ((record (assoc name gnuplot-captures)))
(if (not record) nil
(let ((begin (cadr record))
(end (caddr record))
(end (cl-caddr record))
(accum '()))
(while (and begin (not (eq begin end)))
(push (pop begin) accum))
@@ -2061,9 +2050,7 @@ there."
;; Completions
(defun gnuplot-completions ()
(gnuplot-parse-at-point t)
(if (featurep 'xemacs) ; Need an alist
(mapcar (lambda (s) (cons s nil)) gnuplot-completions)
gnuplot-completions))
gnuplot-completions)
(defun gnuplot-context-completion-at-point ()
"Return completions of keyword preceding point, using context."

View File

@@ -29,16 +29,8 @@
;; arguments appropriate the the item that was near point. The goal
;; is to provide point-and-click functionality to gnuplot-mode.
;;
;; gnuplot-gui is designed for gnuplot 3.7, but since much of 3.7 is
;; backward compatible to 3.5, it will work well for that version
;; also.
;;
;; gnuplot-gui.el was developed using Emacs 19.34 and is known to work
;; on Emacs 20.x and XEmacs 20.x. I do not know what is the earliest
;; version for which it will work, but I make no guarantees for
;; versions before 19.34. Note that this makes heavy use of the
;; widget package, so this will not work on Emacs 19.34 unless you
;; install the widget package separately.
;; gnuplot-gui.el was developed using GNU Emacs 25 and should be
;; compatible with GNU Emacs 24.3 and above.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
@@ -72,9 +64,8 @@
(require 'widget)
(require 'wid-edit))
(error nil)))
(require 'cl)
(require 'cl-lib)
(eval-when-compile ; suppress some compiler warnings
(defvar gnuplot-xemacs-p nil)
(defvar gnuplot-quote-character nil)
(defvar gnuplot-info-display nil)
(defvar gnuplot-mode-map nil))
@@ -115,17 +106,7 @@ This would be done after menu insertion of Gnuplot commands."
(defvar gnuplot-gui-frame nil
"Frame used to hold the buffer for setting options.")
(defcustom gnuplot-gui-frame-plist
'(height 18 width 65 border-width 0
user-position t top 150 left 150
internal-border-width 0 unsplittable t
default-toolbar-visible-p nil has-modeline-p nil
menubar-visible-p nil)
"Frame plist for the input run-time display frame in XEmacs."
:type '(repeat (group :inline t
(symbol :tag "Property")
(sexp :tag "Value")))
:group 'gnuplot-gui)
(defcustom gnuplot-gui-frame-parameters
'((height . 18)
(width . 65)
@@ -885,13 +866,10 @@ currently supported."
(gnuplot-gui-set-options-and-insert))))
(defun gnuplot-gui-get-frame-param (param)
(if gnuplot-xemacs-p
(plist-get gnuplot-gui-frame-plist param)
(cdr (assoc param gnuplot-gui-frame-parameters))))
(cdr (assoc param gnuplot-gui-frame-parameters)))
(defun gnuplot-gui-set-frame-param (param value)
(if gnuplot-xemacs-p
(plist-put gnuplot-gui-frame-plist param value)
(setcdr (assoc param gnuplot-gui-frame-parameters) value)))
(setcdr (assoc param gnuplot-gui-frame-parameters) value))
(defun gnuplot-gui-set-options-and-insert ()
"Insert arguments using a GUI interface.
@@ -952,7 +930,7 @@ Note that \"cntrparam\" is not currently supported."
(old-top (gnuplot-gui-get-frame-param 'top)))
(when (or
(and (equal gnuplot-gui-plot-splot-fit-style 'complete)
(member* word '("plot" "splot" "fit")
(cl-member word '("plot" "splot" "fit")
:test 'string=))
(equal word "test"))
(gnuplot-gui-set-frame-param 'height 32)
@@ -960,7 +938,7 @@ Note that \"cntrparam\" is not currently supported."
(gnuplot-gui-prompt-for-frame word)
(when (or
(and (equal gnuplot-gui-plot-splot-fit-style 'complete)
(member* word '("plot" "splot" "fit")
(cl-member word '("plot" "splot" "fit")
:test 'string=))
(equal word "test"))
(gnuplot-gui-set-frame-param 'height old-height)
@@ -984,9 +962,7 @@ Note that \"cntrparam\" is not currently supported."
(defun gnuplot-gui-y-n (foo))
(if gnuplot-xemacs-p
(defalias 'gnuplot-gui-y-n 'y-or-n-p-maybe-dialog-box)
(defalias 'gnuplot-gui-y-n 'y-or-n-p))
(defalias 'gnuplot-gui-y-n 'y-or-n-p)
(defun gnuplot-gui-correct-command (word set term begin)
"Check syntax of set command and terminal specifications.
@@ -1031,8 +1007,8 @@ argument, for example an axis label or a font name. It also replaces
bounding single quotes with double quotes, since double quotes are
used in `gnuplot-gui-all-types'."
(let (fixed-list quote quoted) ; remove blanks
(setq list (remove* "\\s-+" list :test 'string-match)
list (remove* "" list :test 'string=))
(setq list (cl-remove "\\s-+" list :test 'string-match)
list (cl-remove "" list :test 'string=))
(while list ; concatinate parts of quoted string
(if (not (string-match "^\\([\]\[()'\"]\\)" (car list)))
(setq fixed-list (append fixed-list (list (car list))))
@@ -1083,14 +1059,14 @@ arguments."
(while temp-list
(cond
;; ---------------------------- list
((member* symbol '(list list*) :test 'equal)
((cl-member symbol '(list list*) :test 'equal)
(let* ((case-fold-search nil)
(match-cons (member* (concat "^" (car temp-list))
(match-cons (cl-member (concat "^" (car temp-list))
values :test 'string-match)))
(if (and (car match-cons) ; " " may be first elem. of list
(not (string= " " (car match-cons))))
(setq this-cons (cons tag (car match-cons))
arg-list (remove* (car temp-list) arg-list
arg-list (cl-remove (car temp-list) arg-list
:test 'string= :count 1)
temp-list nil)
(setq temp-list (cdr temp-list)))))
@@ -1111,16 +1087,16 @@ arguments."
(cond ((and (string= prefix (car temp-list))
(string-match "^[-0-9.]+$" (cadr temp-list)))
(setq this-cons (cons tag (cadr temp-list))
arg-list (remove* (car temp-list) arg-list
arg-list (cl-remove (car temp-list) arg-list
:test 'string= :count 1)
arg-list (remove* (cadr temp-list) arg-list
arg-list (cl-remove (cadr temp-list) arg-list
:test 'string= :count 1)
temp-list nil))
;; --------------------- number without prefix
((and (not prefix)
(string-match "^[-0-9.]+$" (car temp-list)))
(setq this-cons (cons tag (car temp-list))
arg-list (remove* (car temp-list) arg-list
arg-list (cl-remove (car temp-list) arg-list
:test 'string= :count 1)
temp-list nil))
(t
@@ -1130,8 +1106,8 @@ arguments."
(if (and (string= prefix (car temp-list))
(string-match "^[-0-9.]+$" (cadr temp-list)))
(let ((this-car (cadr temp-list))
(this-cdr (if (string-match "^[-0-9.]+$" (caddr temp-list))
(caddr temp-list) "")))
(this-cdr (if (string-match "^[-0-9.]+$" (cl-caddr temp-list))
(cl-caddr temp-list) "")))
(setq this-cons (cons tag (cons this-car this-cdr))
temp-list nil))
(setq temp-list (cdr temp-list))))
@@ -1146,7 +1122,7 @@ arguments."
(setq this-cons
(cons tag (cons (match-string 1 (car temp-list))
(match-string 2 (car temp-list))))
arg-list (remove* (car temp-list) arg-list
arg-list (cl-remove (car temp-list) arg-list
:test 'string= :count 1)
temp-list nil)
(setq temp-list (cdr temp-list)) ))
@@ -1157,7 +1133,7 @@ arguments."
")") ; closing paren
(car temp-list))
(let* ((list (split-string (car temp-list) "[ \t(),]+"))
(list (remove* "" list :test 'string=))
(list (cl-remove "" list :test 'string=))
(return ()))
(while list
(if (string-match "['\"]\\([^'\"]*\\)['\"]" (car list))
@@ -1168,18 +1144,18 @@ arguments."
(setq return (append return (list "" (car list)))))
(setq list (cdr list)) )
(setq this-cons (cons tag return)
arg-list (remove* (car temp-list) arg-list
arg-list (cl-remove (car temp-list) arg-list
:test 'string= :count 1)
temp-list nil))
(setq temp-list (cdr temp-list))) )
;; ---------------------------- string, file, format
((member* symbol '(string file format) :test 'equal)
((cl-member symbol '(string file format) :test 'equal)
(if (string-match (concat "['\"]" ; opening quote
"\\([^'\"]*\\)" ; string
"['\"]") ; closing quote
(car temp-list))
(setq this-cons (cons tag (match-string 0 (car temp-list)))
arg-list (remove* (car temp-list) arg-list
arg-list (cl-remove (car temp-list) arg-list
:test 'string= :count 1)
temp-list nil)
(setq temp-list (cdr temp-list)) ))
@@ -1187,9 +1163,9 @@ arguments."
((equal symbol 'string*)
(if (string= prefix (car temp-list))
(setq this-cons (cons tag (cadr temp-list))
arg-list (remove* (car temp-list) arg-list
arg-list (cl-remove (car temp-list) arg-list
:test 'string= :count 1)
arg-list (remove* (cadr temp-list) arg-list
arg-list (cl-remove (cadr temp-list) arg-list
:test 'string= :count 1)
temp-list nil)
(setq temp-list (cdr temp-list)) ) )
@@ -1281,25 +1257,15 @@ SAVE-FRAME is non-nil when the widgets are being reset."
gnuplot-current-buffer (current-buffer)
gnuplot-current-buffer-point (point-marker))
(unless (and gnuplot-gui-frame (frame-live-p gnuplot-gui-frame))
(setq gnuplot-gui-frame (if gnuplot-xemacs-p
(make-frame gnuplot-gui-frame-plist)
(make-frame gnuplot-gui-frame-parameters))))
(setq gnuplot-gui-frame (make-frame gnuplot-gui-frame-parameters)))
(select-frame gnuplot-gui-frame)
;;(set-frame-position gnuplot-gui-frame 150 150) ;; so herky-jerky
(if gnuplot-xemacs-p
(set-mouse-position (selected-window) 0 0)
(set-mouse-position gnuplot-gui-frame 0 0)))
(set-mouse-position gnuplot-gui-frame 0 0))
(kill-buffer (get-buffer-create "*Gnuplot GUI*"))
(switch-to-buffer (get-buffer-create "*Gnuplot GUI*"))
(kill-all-local-variables)
(if gnuplot-xemacs-p
(progn
(set (make-local-variable 'frame-title-format)
"Set Gnuplot Options")
(set (make-local-variable 'frame-icon-title-format)
"Set Gnuplot Options"))
(modify-frame-parameters (selected-frame)
'((title . "Set Gnuplot Options"))) )
(modify-frame-parameters (selected-frame)
'((title . "Set Gnuplot Options")))
(widget-insert "\nSet options for \"" item "\" ")
(let (tag help val)
(cond ((string-match "^[xyz]2?tics" item)
@@ -1331,19 +1297,19 @@ SAVE-FRAME is non-nil when the widgets are being reset."
(widget-insert "\t") ; insert the appropriate widget
(cond
;;------------------------------ list, list* ------------
((member* (eval wtype) '(list list*) :test 'equal)
((cl-member (eval wtype) '(list list*) :test 'equal)
(let ((starred (if (equal (eval wtype) 'list*) t nil)))
(gnuplot-gui-menu-choice tag default list starred)))
;;------------------------------ number, tag, fontsize --
((member* (eval wtype) '(number tag fontsize) :test 'equal)
((cl-member (eval wtype) '(number tag fontsize) :test 'equal)
(gnuplot-gui-number tag default prefix))
;;------------------------------ position ---------------
;;------------------------------ range, pair ------------
((member* (eval wtype) '(range pair) :test 'equal)
((cl-member (eval wtype) '(range pair) :test 'equal)
(let ((is-range (equal (eval wtype) 'range)))
(gnuplot-gui-range tag default prefix is-range)))
;;------------------------------ string, string* --------
((member* (eval wtype) '(string string*) :test 'equal)
((cl-member (eval wtype) '(string string*) :test 'equal)
(let ((starred (if (equal (eval wtype) 'string) nil t)))
(gnuplot-gui-string tag default prefix starred)))
;;------------------------------ format -----------------
@@ -1466,8 +1432,7 @@ SAVE-FRAME is non-nil when the widgets are being reset."
(:bold t :foreground "tan"))
(t
(:italic t)))
"Face used for push-buttons.
Only used in Emacs. XEmacs displays push-buttons with a pixmap."
"Face used for push-buttons."
:group 'gnuplot-faces)
(defface gnuplot-gui-labels-face '((((class color) (background light))
(:bold t :foreground "darkslateblue"))

View File

@@ -1,13 +1,13 @@
(define-package "gnuplot" "20200322.53" "Major-mode and interactive frontend for gnuplot"
'((emacs "24.1"))
:commit "f0001c30010b2899e36d7d89046322467e923088" :keywords
'("data" "gnuplot" "plotting")
:authors
(define-package "gnuplot" "20210104.1052" "Major-mode and interactive frontend for gnuplot"
'((emacs "24.3"))
:commit "116cad8e09024223f97e81b0a4503cef20de9bf5" :authors
'(("Jon Oddie")
("Bruce Ravel")
("Phil Type"))
:maintainer
'("Bruce Ravel" . "bruceravel1@gmail.com")
:keywords
'("data" "gnuplot" "plotting")
:url "https://github.com/emacsorphanage/gnuplot")
;; Local Variables:
;; no-byte-compile: t

File diff suppressed because it is too large Load Diff