Skip to content

Commit da61a96

Browse files
committed
Switch to lexical-binding
1 parent 11e1741 commit da61a96

File tree

6 files changed

+31
-36
lines changed

6 files changed

+31
-36
lines changed

gnuplot-context.el

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; gnuplot-context.el -- context-sensitive help and completion for gnuplot
1+
;;; gnuplot-context.el -- context-sensitive help and completion for gnuplot -*- lexical-binding: t -*-
22

33
;; Copyright (C) 2012-2013 Jon Oddie <[email protected]>
44

@@ -1721,9 +1721,9 @@ name; otherwise continues tokenizing up to the token at point. FIXME."
17211721
;; them. For normal use, they compile to no-ops.
17221722
(eval-when-compile
17231723
(when (not (featurep 'gnuplot-debug-context))
1724-
(defmacro with-gnuplot-trace-buffer (&rest args) "No-op." '(progn nil))
1725-
(defmacro gnuplot-trace (&rest args) "No-op." '(progn nil))
1726-
(defmacro gnuplot-debug (&rest args) "No-op." '(progn nil))))
1724+
(defmacro with-gnuplot-trace-buffer (&rest _) "No-op." '(progn nil))
1725+
(defmacro gnuplot-trace (&rest _) "No-op." '(progn nil))
1726+
(defmacro gnuplot-debug (&rest _) "No-op." '(progn nil))))
17271727

17281728

17291729

@@ -1984,7 +1984,7 @@ there."
19841984
(defun gnuplot-scan-stack (stack tokens)
19851985
"Scan STACK for the most recently pushed eldoc and info strings."
19861986
(gnuplot-trace "\t* scanning stack *\n")
1987-
(gnuplot-debug (gnuplot-backtrace))
1987+
(gnuplot-debug (gnuplot-backtrace stack))
19881988
(gnuplot-debug (gnuplot-dump-captures))
19891989

19901990
(catch 'no-scan

gnuplot-debug-context.el

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
;;
2-
;; debugging utilities for the gnuplot-mode context matcher
3-
;;
1+
;; debugging utilities for the gnuplot-mode context matcher -*- lexical-binding: t -*-
42

53
(require 'gnuplot-test-context) ; for gnuplot-simplify-tokens
64

@@ -56,7 +54,7 @@
5654
(defmacro gnuplot-trace (&rest args)
5755
`(with-gnuplot-trace-buffer (insert (format ,@args))))
5856

59-
(defun gnuplot-backtrace ()
57+
(defun gnuplot-backtrace (stack)
6058
(if stack
6159
(with-gnuplot-trace-buffer
6260
(insert "\n-- * backtrace: * --\n")

gnuplot-gui.el

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;;; gnuplot-gui.el -- GUI interface to setting options in gnuplot-mode
1+
;;;; gnuplot-gui.el -- GUI interface to setting options in gnuplot-mode -*- lexical-binding: t -*-
22

33
;; Copyright (C) 1998-2000 Bruce Ravel
44

@@ -935,7 +935,6 @@ Note that \"cntrparam\" is not currently supported."
935935
"Argument popup will no longer appear after insertions.")))
936936

937937

938-
(defun gnuplot-gui-y-n (foo))
939938
(defalias 'gnuplot-gui-y-n 'y-or-n-p)
940939

941940
(defun gnuplot-gui-correct-command (word set term begin)
@@ -1316,7 +1315,7 @@ SAVE-FRAME is non-nil when the widgets are being reset."
13161315
:button-face 'gnuplot-gui-button-face
13171316
:help-echo "Push this button to set options"
13181317
:notify
1319-
(lambda (widget &rest ignore)
1318+
(lambda (widget &rest _ignore)
13201319
(kill-buffer (get-buffer-create "*Gnuplot GUI*"))
13211320
(delete-frame)
13221321
(select-frame gnuplot-current-frame)
@@ -1356,7 +1355,7 @@ SAVE-FRAME is non-nil when the widgets are being reset."
13561355
:button-face 'gnuplot-gui-button-face
13571356
:doc item
13581357
:notify
1359-
(lambda (widget &rest ignore)
1358+
(lambda (widget &rest _ignore)
13601359
(let ((word (widget-get widget :doc)))
13611360
(gnuplot-gui-set-alist word gnuplot-gui-current-string)
13621361
(gnuplot-gui-prompt-for-frame word t))))
@@ -1366,7 +1365,7 @@ SAVE-FRAME is non-nil when the widgets are being reset."
13661365
:button-face 'gnuplot-gui-button-face
13671366
:doc item
13681367
:notify
1369-
(lambda (widget &rest ignore)
1368+
(lambda (widget &rest _ignore)
13701369
(let* ((word (widget-get widget :doc))
13711370
(alist (cdr (assoc word gnuplot-gui-all-types))))
13721371
(while alist
@@ -1379,7 +1378,7 @@ SAVE-FRAME is non-nil when the widgets are being reset."
13791378
(widget-create 'push-button :value "Cancel"
13801379
:help-echo "Quit setting options and dismiss frame"
13811380
:button-face 'gnuplot-gui-button-face
1382-
:notify (lambda (widget &rest ignore)
1381+
:notify (lambda (_widget &rest _ignore)
13831382
(kill-buffer (get-buffer-create "*Gnuplot GUI*"))
13841383
(setq gnuplot-gui-alist nil
13851384
gnuplot-gui-current-string nil)
@@ -1429,7 +1428,7 @@ menu. STARRED is true if this a 'list* widget."
14291428
:button-prefix "[" :button-suffix "]"
14301429
:help-echo (format "Mouse-2 to view the %S menu" (downcase item))
14311430
:notify
1432-
(lambda (widget &rest ignore)
1431+
(lambda (widget &rest _ignore)
14331432
(let ((lab (if (widget-get widget :doc)
14341433
(concat (downcase (widget-get widget :tag)) " ")
14351434
"" )))
@@ -1454,7 +1453,7 @@ the numerical argument."
14541453
(widget-create 'editable-field
14551454
:size 2 :tag item :value default :doc prefix
14561455
:help-echo (format "Insert new value of %S here" help-label)
1457-
:notify (lambda (widget &rest ignore)
1456+
:notify (lambda (widget &rest _ignore)
14581457
(let ((val (widget-value widget))
14591458
(pre (concat (widget-get widget :doc) " ")))
14601459
(setcdr (assoc (widget-get widget :tag)
@@ -1490,7 +1489,7 @@ prefix for the string. STARRED is t if quotes are not to be used."
14901489
'editable-field
14911490
:size width :tag item :doc prefix :value default
14921491
:help-echo (format "Insert new value of %S here" help-label)
1493-
:notify (lambda (widget &rest ignore)
1492+
:notify (lambda (widget &rest _ignore)
14941493
(let ((val (widget-value widget))
14951494
(q gnuplot-quote-character)
14961495
(p (widget-get widget :doc)) )
@@ -1524,7 +1523,7 @@ prefix for the string."
15241523
(widget-create 'editable-field
15251524
:size (/ (frame-width) 3) :tag item :value default
15261525
:help-echo (format "Insert new format string here")
1527-
:notify (lambda (widget &rest ignore)
1526+
:notify (lambda (widget &rest _ignore)
15281527
(let ((val (widget-value widget)))
15291528
(setcdr (assoc (widget-get widget :tag)
15301529
gnuplot-gui-alist)
@@ -1578,7 +1577,7 @@ the default value for the argument. TAG is non-nil if ITEM rather than
15781577
:doc item :help-echo "Insert a filename here"
15791578
:complete 'gnuplot-gui-file-completion
15801579
:notify
1581-
(lambda (widget &rest ignore)
1580+
(lambda (widget &rest _ignore)
15821581
(setcdr (assoc (widget-get widget :doc) gnuplot-gui-alist)
15831582
(format "%s%s%s" gnuplot-quote-character
15841583
(widget-value widget)
@@ -1588,7 +1587,7 @@ the default value for the argument. TAG is non-nil if ITEM rather than
15881587
'push-button :value "Browse"
15891588
:doc item :help-echo "Browse directories for a filename."
15901589
:parent widg
1591-
:notify (lambda (widget &rest ignore)
1590+
:notify (lambda (widget &rest _ignore)
15921591
(let ((fname (file-relative-name (read-file-name "File: ")
15931592
default-directory))
15941593
(q gnuplot-quote-character))
@@ -1614,7 +1613,7 @@ the default value for the argument."
16141613
:format "%{%t%}:\n%v\t %i\n"
16151614
:entry-format "\t %i %d %v\n"
16161615
:button-face 'gnuplot-gui-labels-face
1617-
:notify (lambda (widget &rest ignore)
1616+
:notify (lambda (widget &rest _ignore)
16181617
(setcdr (assoc (upcase (widget-get widget :tag))
16191618
gnuplot-gui-alist)
16201619
(widget-value widget)))))
@@ -1631,7 +1630,7 @@ is non-nil if this is a 'range widget."
16311630
:size 4 :tag item :value (car default)
16321631
:help-echo (format "Insert the first value of the %S here"
16331632
(downcase item))
1634-
:notify (lambda (widget &rest ignore)
1633+
:notify (lambda (widget &rest _ignore)
16351634
(setcar (cdr (assoc (widget-get widget :tag)
16361635
gnuplot-gui-alist))
16371636
(format "%s" (widget-value widget)))))
@@ -1640,7 +1639,7 @@ is non-nil if this is a 'range widget."
16401639
:size 4 :tag item :value (cdr default)
16411640
:help-echo (format "Insert the second value of the %S here"
16421641
(downcase item))
1643-
:notify (lambda (widget &rest ignore)
1642+
:notify (lambda (widget &rest _ignore)
16441643
(setcdr (cdr (assoc (widget-get widget :tag)
16451644
gnuplot-gui-alist))
16461645
(format "%s" (widget-value widget)))))

gnuplot-test-context.el

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
;;
2-
;; automated tests for gnuplot-mode context matching
3-
;;
1+
;; automated tests for gnuplot-mode context matching -*- lexical-binding: t -*-
42

53
(require 'gnuplot-context)
64

gnuplot-tests.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; Tests for gnuplot-mode.
1+
;;; Tests for gnuplot-mode. -*- lexical-binding: t -*-
22

33
;;; Currently these attempt to cover the correct identification of
44
;;; string and comment syntax.

gnuplot.el

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; gnuplot.el --- Major-mode and interactive frontend for gnuplot
1+
;;; gnuplot.el --- Major-mode and interactive frontend for gnuplot -*- lexical-binding: t -*-
22

33
;; Copyright (C) 1998, 2011 Phil Type and Bruce Ravel, 1999-2012 Bruce Ravel
44

@@ -335,7 +335,7 @@ suggestions."
335335
:group 'gnuplot
336336
:type 'boolean
337337
:initialize 'custom-set-default
338-
:set (lambda (sym value)
338+
:set (lambda (_sym value)
339339
(dolist (buffer (buffer-list))
340340
(with-current-buffer buffer
341341
(when (derived-mode-p 'gnuplot-mode 'gnuplot-comint-mode)
@@ -358,7 +358,7 @@ symbol `complete' in gnuplot-mode buffers."
358358
:group 'gnuplot
359359
:type 'boolean)
360360

361-
(defun gnuplot-set-display-mode (variable value &rest args)
361+
(defun gnuplot-set-display-mode (variable value &rest _args)
362362
"Customize :set function for `gnuplot-inline-image-mode'.
363363
Set VARIABLE to VALUE. ARGS is optional args."
364364
(if (and (eq variable 'gnuplot-inline-image-mode)
@@ -1345,7 +1345,7 @@ this function is attached to `gnuplot-after-plot-hook'"
13451345
(if (> gnuplot-buffer-max-size 0)
13461346
(with-current-buffer gnuplot-buffer
13471347
(let ((gnuplot-lines (count-lines (point-min) (point-max))))
1348-
(dotimes (tmp (- gnuplot-lines gnuplot-buffer-max-size))
1348+
(dotimes (_n (- gnuplot-lines gnuplot-buffer-max-size))
13491349
(goto-char (point-min))
13501350
(delete-region (line-beginning-position) (1+ (line-end-position))))
13511351
(goto-char (point-max))))))
@@ -1457,7 +1457,7 @@ buffer."
14571457
(regexp-opt '("gnuplot> " "multiplot> "))
14581458
"Regexp for recognizing the GNUPLOT prompt.")
14591459

1460-
(defun gnuplot-protect-prompt-fn (string)
1460+
(defun gnuplot-protect-prompt-fn (_string)
14611461
"Prevent the Gnuplot prompt from being deleted or overwritten.
14621462
STRING is the text as originally inserted in the comint buffer."
14631463
(save-excursion
@@ -1580,7 +1580,7 @@ gnuplot process buffer will be displayed in a window."
15801580

15811581
(defvar gnuplot-inhibit-filter nil)
15821582

1583-
(defun gnuplot-insert-inline-image-output (string)
1583+
(defun gnuplot-insert-inline-image-output (_string)
15841584
"Insert Gnuplot graphical output STRING in the gnuplot-comint buffer.
15851585
15861586
Called via `comint-preoutput-filter-functions' hook when
@@ -1778,7 +1778,7 @@ ARG is optional arg."
17781778
(if (not arg) (setq arg 1))
17791779
(if (> arg 0)
17801780
(catch 'bob ; go to beginning of ARGth prev. defun
1781-
(dotimes (n arg)
1781+
(dotimes (_n arg)
17821782
(when (= (point)
17831783
(gnuplot-point-at-beginning-of-continuation))
17841784
(forward-line -1)
@@ -1790,7 +1790,7 @@ ARG is optional arg."
17901790
t)
17911791

17921792
(catch 'eob ; find beginning of (-ARG)th following defun
1793-
(dotimes (n (- arg))
1793+
(dotimes (_n (- arg))
17941794
(gnuplot-end-of-continuation)
17951795
(forward-line)
17961796
(if (eobp) (throw 'eob t))

0 commit comments

Comments
 (0)