branch: externals/matlab-mode
commit 89b585e6d935fd36176791caa66d4dad0405407b
Author: John Ciolfi <[email protected]>
Commit: John Ciolfi <[email protected]>
fix emacs 30 warnings
---
matlab-ccount.el | 20 +++++++++++++-------
matlab-shell.el | 6 +++---
matlab.el | 23 ++++++++++-------------
3 files changed, 26 insertions(+), 23 deletions(-)
diff --git a/matlab-ccount.el b/matlab-ccount.el
index 50fe24de15..100809366f 100644
--- a/matlab-ccount.el
+++ b/matlab-ccount.el
@@ -23,19 +23,25 @@
;; code characters are in your script.
;; https://www.mathworks.com/matlabcentral/contests.html
;;
+;; To use:
+;; (require 'matlab-ccount)
+;;
+;; M-x matlab-character-count-minor-mode
+;;
;; Based on contest rules, comments, newlines, and spaces at EOL don't
;; count toward character counts.
;;; Code:
-(easy-mmode-define-minor-mode matlab-character-count-minor-mode
- "Toggle character count minor-mode.
+
+(define-minor-mode matlab-character-count-minor-mode
+ "Toggle character count minor-mode.
When active, this mode shows the # of characters in this buffer.
MATLAB Character counter ignores comments and indentation spaces."
- :init-value nil
- :lighter (:eval (format " %d"
(matlab-count-characters)))
- :keymap nil ; empty mode-map
- nil ; empty body
- )
+ :init-value nil
+ :lighter (:eval (format " %d" (matlab-count-characters)))
+ :keymap nil ; empty mode-map
+ nil ; empty body
+ )
;;; Character Counting
;;
diff --git a/matlab-shell.el b/matlab-shell.el
index df5ab7262e..6e8d7f5624 100644
--- a/matlab-shell.el
+++ b/matlab-shell.el
@@ -68,7 +68,7 @@
"*Command line parameters run with `matlab-shell-command'.
Command switches are a list of strings. Each entry is one switch."
:group 'matlab-shell
- :type '(list :tag "Switch: "))
+ :type '(choice (repeat :tag "Switches, one per entry" string)))
(defface matlab-shell-error-face
(list
@@ -94,14 +94,14 @@ Command switches are a list of strings. Each entry is one
switch."
A %s is replaced with the MATLAB version release number, such as R12.
This file is read to initialize the comint input ring."
:group 'matlab-shell
- :type 'filename)
+ :type 'file)
(defcustom matlab-shell-history-ignore "^%\\|%%$\\|emacs.set"
"Regular expression matching items from history to ignore.
This expression should ignore comments (between sessions) and any command
that ends in 2 or more %%, added to automatic commands."
:group 'matlab-shell
- :type 'filename)
+ :type 'regexp)
(defcustom matlab-shell-autostart-netshell nil
"Use the netshell side-channel for communicating with MATLAB."
diff --git a/matlab.el b/matlab.el
index 7fba495d7c..36eec569c3 100644
--- a/matlab.el
+++ b/matlab.el
@@ -466,11 +466,10 @@ Each function gets no arguments, and returns nothing.
They can move
point, but it will be restored for them."
:group 'matlab
:type '(repeat (choice :tag "Function: "
- '(matlab-mode-vf-functionname
- matlab-mode-vf-classname
- matlab-mode-vf-add-ends
- matlab-mode-vf-quiesce-buffer
- ))))
+ (matlab-mode-vf-functionname
+ matlab-mode-vf-classname
+ matlab-mode-vf-add-ends
+ matlab-mode-vf-quiesce-buffer))))
(defcustom matlab-block-verify-max-buffer-size 50000
"*Largest buffer size allowed for block verification during save."
@@ -1779,24 +1778,22 @@ NOPROGRESS, if t, does not display indenting progress."
(let ((pr (when (and (not (minibufferp)) (not noprogress))
(make-progress-reporter "MATLAB Indenting region..." (point)
end)))
(lvl2 nil)
- (lvl1 nil)
- )
+ (lvl1 nil))
(while (< (point) end)
(unless (and (bolp) (eolp))
;; This is where we indent each line
(setq lvl1 (matlab-compute-line-context 1)
lvl2 (matlab-compute-line-context 2 lvl1)) ;; lvl2))
- (when (matlab--indent-line lvl2)
- ;; If the indent changed something, refresh this
- ;; context obj.
- ;;(matlab-refresh-line-context-lvl2 lvl2)
- ))
+ ;; TODO investigate return value of (matlab--indent-line lvl2).
Should we have:
+ ;; (when (matlab--indent-line lvl2)
+ ;; ;; If the indent changed something, refresh this context obj.
+ ;; (matlab-refresh-line-context-lvl2 lvl2))
+ (matlab--indent-line lvl2))
(forward-line 1)
(and pr (progress-reporter-update pr (point))))
(and pr (progress-reporter-done pr))
(move-marker end nil))))
-
(defun matlab-indent-line ()
"Indent a line in `matlab-mode'."
(interactive)