cedet-matlab.el, matlab-cgen.el, matlab-compat.el,

matlab-complete.el, matlab-maint.el, matlab-netshell.el,
matlab-publish.el, matlab-topic.el, semantic-matlab.el,
semanticdb-matlab.el, srecode-matlab.el:
Fix varous issues in doc strings and messages identified by `checkdoc'
command.
This commit is contained in:
Eric Ludlam 2019-12-12 22:36:55 -05:00
parent f23a926bb2
commit fb19b6bcc1
11 changed files with 55 additions and 43 deletions

View File

@ -54,7 +54,7 @@
(add-to-list 'srecode-map-load-path tmpdir) (add-to-list 'srecode-map-load-path tmpdir)
(if (fboundp 'srecode-map-update-map) (if (fboundp 'srecode-map-update-map)
(srecode-map-update-map t) (srecode-map-update-map t)
(error "srecode-map-update-map not found")) (error "Function srecode-map-update-map not found"))
)) ))

View File

@ -20,7 +20,7 @@
;;; Commentary: ;;; Commentary:
;; ;;
;; This library supports tempo templates, and other misc functions designed ;; This library supports tempo templates, and other misc functions designed
;; to create code in an emacs buffer. ;; to create code in an Emacs buffer.
(require 'matlab) (require 'matlab)
(require 'tempo) (require 'tempo)
@ -34,7 +34,7 @@
;; ;;
;;;###autoload (autoload 'matlab-insert-map-fcn "matlab-cgen" "Keymap for C-c C-c in matlab-mode" t 'keymap) ;;;###autoload (autoload 'matlab-insert-map-fcn "matlab-cgen" "Keymap for C-c C-c in matlab-mode" t 'keymap)
(defvar matlab-insert-map (defvar matlab-insert-map
(let ((km (make-sparse-keymap))) (let ((km (make-sparse-keymap)))
(define-key km "c" 'matlab-insert-next-case) (define-key km "c" 'matlab-insert-next-case)
(define-key km "e" 'matlab-insert-end-block) (define-key km "e" 'matlab-insert-end-block)
@ -52,7 +52,7 @@
"Keymap used for inserting simple texts based on context.") "Keymap used for inserting simple texts based on context.")
(defvar matlab-insert-map-fcn nil (defvar matlab-insert-map-fcn nil
"Keymap for C-c C-c in matlab-mode") "Keymap for C-c C-c in matlab-mode.")
(fset 'matlab-insert-map-fcn (setq matlab-insert-map-fcn matlab-insert-map)) (fset 'matlab-insert-map-fcn (setq matlab-insert-map-fcn matlab-insert-map))

View File

@ -150,7 +150,7 @@ REGEXP defaults to \"[ \\t\\n\\r]+\"."
;; Finding executables ;; Finding executables
(defun matlab-find-executable-directory (program) (defun matlab-find-executable-directory (program)
"find the executable PROGRAM on the exec path, following any links. "Find the executable PROGRAM on the exec path, following any links.
Return the base directory it is in." Return the base directory it is in."
(let ((dir nil)) (let ((dir nil))
@ -169,7 +169,8 @@ Return the base directory it is in."
;; Completion Tools ;; Completion Tools
(defun matlab-display-completion-list (completions common-substring) (defun matlab-display-completion-list (completions common-substring)
;; In emacs 24.4 the common-substring is no longer needed "Method for displaying COMPLETIONS with a COMMON-SUBSTRING."
;; In emacs 24.4 the common-substring is no longer needed.
(let ((args (if (or (< emacs-major-version 24) (let ((args (if (or (< emacs-major-version 24)
(and (= emacs-major-version 24) (< emacs-minor-version 4))) (and (= emacs-major-version 24) (< emacs-minor-version 4)))
(list completions common-substring) (list completions common-substring)

View File

@ -27,7 +27,7 @@
;; * look for local files that might be functions. ;; * look for local files that might be functions.
;; ;;
;; Moved to separate library, as some modern tools do a better job ;; Moved to separate library, as some modern tools do a better job
;; and this can be loaded optionally. ;; and this can be loaded optionally.
;;; Code: ;;; Code:
(require 'matlab) (require 'matlab)

View File

@ -29,7 +29,7 @@
;;; Minor Mode Definition ;;; Minor Mode Definition
;; ;;
(defvar matlab-maint-mode-map (defvar matlab-maint-mode-map
(let ((km (make-sparse-keymap))) (let ((km (make-sparse-keymap)))
(define-key km [f8] 'matlab-maint-run-tests) (define-key km [f8] 'matlab-maint-run-tests)
(define-key km [f9] 'matlab-maint-compile-matlab-emacs) (define-key km [f9] 'matlab-maint-compile-matlab-emacs)
@ -78,7 +78,7 @@
(defun matlab-maint-run-tests (arg) (defun matlab-maint-run-tests (arg)
"Run the tests for matlab mode. "Run the tests for matlab mode.
With universal arg, ask for the code to be run with output tracking turned on." With universal ARG, ask for the code to be run with output tracking turned on."
(interactive "P") (interactive "P")
(save-excursion (save-excursion
(matlab-maint-set-buffer-to "tests/Makefile") (matlab-maint-set-buffer-to "tests/Makefile")

View File

@ -34,7 +34,7 @@
"Port used for the Emacs server listening for MATLAB connections.") "Port used for the Emacs server listening for MATLAB connections.")
(defvar matlab-netshell-server-name "*MATLAB netshell*" (defvar matlab-netshell-server-name "*MATLAB netshell*"
"Name used for the Netshell server") "Name used for the Netshell server.")
(defvar matlab-netshell-clients nil (defvar matlab-netshell-clients nil
"List of clients created from the MATLAB netshell server.") "List of clients created from the MATLAB netshell server.")
@ -79,7 +79,8 @@
(make-variable-buffer-local 'matlab-netshell-acc) (make-variable-buffer-local 'matlab-netshell-acc)
(defun matlab-netshell-filter (proc string) (defun matlab-netshell-filter (proc string)
"Filter used for MATLAB Netshell processes." "Filter used for MATLAB Netshell processes.
PROC is the TCP connection that produced STRING."
;; Accumulate from the process ;; Accumulate from the process
(setq matlab-netshell-acc (concat matlab-netshell-acc string)) (setq matlab-netshell-acc (concat matlab-netshell-acc string))
;; Wait for a NULL command terminator. ;; Wait for a NULL command terminator.
@ -149,7 +150,8 @@ response from some Emacs based request."
(defun matlab-netshell-sentinel (proc msg) (defun matlab-netshell-sentinel (proc msg)
"Sentinel used for MATLAB Netshell processes. "Sentinel used for MATLAB Netshell processes.
Identify when a connection is lost, and close down services." Identify when a connection is lost, and close down services.
PROC is the TCP stream which generated MSG."
(cond ((string-match "^open from " msg) (cond ((string-match "^open from " msg)
;; New connection - set it up. ;; New connection - set it up.
(setq matlab-netshell-clients (cons proc matlab-netshell-clients)) (setq matlab-netshell-clients (cons proc matlab-netshell-clients))
@ -165,27 +167,27 @@ Identify when a connection is lost, and close down services."
(message "Unhandled event.")))) (message "Unhandled event."))))
(defun matlab-netshell-send(cmd data) (defun matlab-netshell-send(cmd data)
"Send a command to MATLAB shell connection with DATA." "Send a command CMD to MATLAB shell connection with DATA."
(let ((C (car matlab-netshell-clients))) (let ((C (car matlab-netshell-clients)))
(if C (if C
(process-send-string C (concat cmd "\n" data "\0")) (process-send-string C (concat cmd "\n" data "\0"))
(error "No MATLAB network connection to send to.")))) (error "No MATLAB network connection to send to"))))
(defun matlab-netshell-eval (mcode) (defun matlab-netshell-eval (mcode)
"Send MSG to the active MATLAB shell connection to eval." "Send MCODE to the active MATLAB shell connection to eval."
(interactive "sMCode: ") (interactive "sMCode: ")
(let ((C (car matlab-netshell-clients))) (let ((C (car matlab-netshell-clients)))
(if C (if C
(process-send-string C (concat "eval\n" mcode "\0")) (process-send-string C (concat "eval\n" mcode "\0"))
(error "No MATLAB network connection to send to.")))) (error "No MATLAB network connection to send to"))))
(defun matlab-netshell-evalc (mcode) (defun matlab-netshell-evalc (mcode)
"Send MSG to the active MATLAB shell connection to eval." "Send MCODE to the active MATLAB shell connection to eval."
(interactive "sMCode: ") (interactive "sMCode: ")
(let ((C (car matlab-netshell-clients))) (let ((C (car matlab-netshell-clients)))
(if C (if C
(process-send-string C (concat "evalc\n" mcode "\0")) (process-send-string C (concat "evalc\n" mcode "\0"))
(error "No MATLAB network connection to send to.")))) (error "No MATLAB network connection to send to"))))
(defun matlab-netshell-ack () (defun matlab-netshell-ack ()
"Send an ACK to MATLAB to see if it can respond." "Send an ACK to MATLAB to see if it can respond."

View File

@ -42,8 +42,7 @@
;; Functions ;; Functions
(defun matlab-select-publish-form (ch) (defun matlab-select-publish-form (ch)
"This function allows to publish the m file, either as in LaTeX or in "This function allows to publish the m file, either as in LaTeX or in HTML format."
HTML format."
(interactive "c1: LaTeX, 2: HTML ") (interactive "c1: LaTeX, 2: HTML ")
(setq ch (downcase ch)) (setq ch (downcase ch))
(call-interactively (cond ((eql ch ?1) #'matlab-publish-file-latex) (call-interactively (cond ((eql ch ?1) #'matlab-publish-file-latex)
@ -53,7 +52,7 @@ HTML format."
(defun matlab-publish-file-latex () (defun matlab-publish-file-latex ()
"Publish a matlab file in the LaTeX format." "Publish a matlab file in the LaTeX format."
(interactive) (interactive)
(let ((pub (file-name-nondirectory (buffer-file-name)))) (let ((pub (file-name-nondirectory (buffer-file-name))))
(matlab-shell-run-command (format "publish('%s','latex')" pub))) (matlab-shell-run-command (format "publish('%s','latex')" pub)))
(if matlab-show-matlab-shell (if matlab-show-matlab-shell
(matlab-show-matlab-shell-buffer))) (matlab-show-matlab-shell-buffer)))
@ -61,8 +60,8 @@ HTML format."
(defun matlab-publish-file-html () (defun matlab-publish-file-html ()
"Publish a matlab file in the html format."
(interactive) (interactive)
"Publish a matlab file in the html format."
(let ((pub (file-name-nondirectory (buffer-file-name)))) (let ((pub (file-name-nondirectory (buffer-file-name))))
(matlab-shell-run-command (format "publish('%s','html')" pub))) (matlab-shell-run-command (format "publish('%s','html')" pub)))
(if matlab-show-matlab-shell (if matlab-show-matlab-shell
@ -71,8 +70,9 @@ HTML format."
(defun matlab-select-environment (ch) (defun matlab-select-environment (ch)
"This functions inserts structured text, which results for example "Inserts structured text.
in LaTeX mode in title, sections, description, boldified text, unnumbered equations and bullet list." This results in LaTeX mode in title, sections, description, boldified text,
unnumbered equations and bullet list."
(interactive "c1: title, 2: section, 3:descrip, 4:boldify, 5:equation, 6:list ") (interactive "c1: title, 2: section, 3:descrip, 4:boldify, 5:equation, 6:list ")
(setq ch (downcase ch)) (setq ch (downcase ch))
(call-interactively (cond ((eql ch ?1) #'matlab-insert-title) (call-interactively (cond ((eql ch ?1) #'matlab-insert-title)
@ -108,8 +108,7 @@ in LaTeX mode in title, sections, description, boldified text, unnumbered equat
(defun matlab-boldify () (defun matlab-boldify ()
"Insert either \%\%\\n \% \*BOLD TEXT\*\\n or, when mark is active, "Insert either \%\%\\n \% \*BOLD TEXT\*\\n or, when mark is active, surrounds region by * *."
surrounds region by * *."
(interactive) (interactive)
(if (or (and (boundp 'zmacs-region-active-p) zmacs-region-active-p) (if (or (and (boundp 'zmacs-region-active-p) zmacs-region-active-p)
(and (boundp 'transient-mark-mode) transient-mark-mode mark-active)) (and (boundp 'transient-mark-mode) transient-mark-mode mark-active))
@ -141,7 +140,7 @@ surrounds region by * *."
(defun matlab-insert-preformated-text () (defun matlab-insert-preformated-text ()
(interactive) (interactive)
(insert "%%\n") (insert "%%\n")
(insert "%\n") (insert "%\n")
(insert "% PREFORMATTED\n") (insert "% PREFORMATTED\n")
(insert "% TEXT\n") (insert "% TEXT\n")
(insert "% \n") (insert "% \n")
@ -292,3 +291,7 @@ surrounds region by * *."
;; ;;
;;}}} ;;}}}
(provide 'matlab-publish)
;;; matlab-publish.el ends here

View File

@ -95,7 +95,7 @@
;; Need this to fix wierd problem in define-derived-mode ;; Need this to fix wierd problem in define-derived-mode
(defvar matlab-shell-help-mode-syntax-table (make-syntax-table) (defvar matlab-shell-help-mode-syntax-table (make-syntax-table)
"Syntax table used in matlab-shell-help-mode.") "Syntax table used in `matlab-shell-help-mode'.")
;;;###autoload ;;;###autoload
(define-derived-mode matlab-shell-help-mode (define-derived-mode matlab-shell-help-mode

View File

@ -52,8 +52,8 @@
;; that need them. Take care of users who don't have cedet/semantic enabled by default. ;; that need them. Take care of users who don't have cedet/semantic enabled by default.
(defun matlab-semantic-get-local-functions-for-script (&optional buffer) (defun matlab-semantic-get-local-functions-for-script (&optional buffer)
"Return the list of functions (as semantic tags) for BuFFER. "Return the list of functions (as semantic tags) for BUFFER.
If semantic-mode is not enabled, do something hacky to make it work." If `semantic-mode' is not enabled, do something hacky to make it work."
(save-excursion (save-excursion
(when buffer (set-buffer buffer)) (when buffer (set-buffer buffer))
@ -72,7 +72,7 @@ If semantic-mode is not enabled, do something hacky to make it work."
tags))) tags)))
(defun matlab-semantic-tag-text (tag buffer) (defun matlab-semantic-tag-text (tag buffer)
"Return the text string for TAG." "Return the text string for TAG in BUFFER."
(with-current-buffer buffer (with-current-buffer buffer
(buffer-substring-no-properties (semantic-tag-start tag) (buffer-substring-no-properties (semantic-tag-start tag)
(semantic-tag-end tag)))) (semantic-tag-end tag))))
@ -122,7 +122,7 @@ Looks @ first declaration to determine if it is a class or function."
;; CLASS Defintions ;; CLASS Defintions
(defvar semantic-matlab-match-classdef-re (defvar semantic-matlab-match-classdef-re
"^\\s-*classdef\\b\\s-*\\(?:([^\n)]+)\\)?\\s-*\\<\\(?2:\\w+\\)\\>" "^\\s-*classdef\\b\\s-*\\(?:([^\n)]+)\\)?\\s-*\\<\\(?2:\\w+\\)\\>"
"Expression to match a class definition start") "Expression to match a class definition start.")
(defun semantic-matlab-class-tags (&optional buffer) (defun semantic-matlab-class-tags (&optional buffer)
"Find the MATLAB class tag, and all methods (functions) in BUFFER. "Find the MATLAB class tag, and all methods (functions) in BUFFER.
@ -196,7 +196,7 @@ Return argument is:
"Regular expression for matching the start of a properties block.") "Regular expression for matching the start of a properties block.")
(defun semantic-matlab-methods-update-tags (rawtags start end) (defun semantic-matlab-methods-update-tags (rawtags start end)
"Create a tags list out of properties found between START and END." "Create a tags list out of RAWTAGS and properties found between START and END."
(save-excursion (save-excursion
(goto-char start) (goto-char start)
(let ((taglist nil) (let ((taglist nil)
@ -460,7 +460,7 @@ Each tag returned is a semantic FUNCTION tag. See
(define-mode-local-override semantic-tag-components-with-overlays (define-mode-local-override semantic-tag-components-with-overlays
matlab-mode (tag) matlab-mode (tag)
"Return the list of subfunctions, or class members in TAG." "Return the list of subfunctions, or class members in TAG."
(or (or
(semantic-tag-get-attribute tag :members) (semantic-tag-get-attribute tag :members)
(semantic-tag-get-attribute tag :subfunctions))) (semantic-tag-get-attribute tag :subfunctions)))
@ -473,7 +473,7 @@ Each tag returned is a semantic FUNCTION tag. See
(car (semantic--tag-expand tag)))) (car (semantic--tag-expand tag))))
(defun semantic-matlab-parse-class (&optional limit) (defun semantic-matlab-parse-class (&optional limit)
"Pase the class from the current MATLAB buffer." "Parse the class from the current MATLAB buffer up to LIMIT."
(semantic-matlab-sort-raw-class-tags (semantic-matlab-class-tags))) (semantic-matlab-sort-raw-class-tags (semantic-matlab-class-tags)))
(defun semantic-matlab-sort-raw-class-tags (tag-list) (defun semantic-matlab-sort-raw-class-tags (tag-list)
@ -502,7 +502,7 @@ Each tag returned is a semantic FUNCTION tag. See
newlist)) newlist))
(defun semantic-matlab-parse-functions (&optional limit) (defun semantic-matlab-parse-functions (&optional limit)
"Parse all functions from the current MATLAB buffer." "Parse all functions from the current MATLAB buffer up to LIMIT."
(car (car
(semantic-matlab-sort-raw-function-tags (semantic-matlab-function-tags) (semantic-matlab-sort-raw-function-tags (semantic-matlab-function-tags)
(or limit (point-max))) (or limit (point-max)))
@ -615,7 +615,7 @@ where NAME is unique."
(string= left (match-string 1 right))) (string= left (match-string 1 right)))
(setq right (match-string 1 right))) (setq right (match-string 1 right)))
;; otherwise reduce right-hand side to first symbol ;; otherwise reduce right-hand side to first symbol
(t (t
(string-match "[[({ ]*\\([A-Za-z_0-9]*\\)" right) (string-match "[[({ ]*\\([A-Za-z_0-9]*\\)" right)
(setq right (match-string 1 right)))) (setq right (match-string 1 right))))
(cond (cond
@ -735,7 +735,9 @@ cannot derive an argument list for them."
(semantic-format-tag-prototype-default tag parent color)))) (semantic-format-tag-prototype-default tag parent color))))
(defun semantic-idle-summary-format-matlab-mode (tag &optional parent color) (defun semantic-idle-summary-format-matlab-mode (tag &optional parent color)
"Describe TAG and display corresponding MATLAB 'lookfor' doc-string." "Describe TAG and display corresponding MATLAB 'lookfor' doc-string.
Optional PARENT and COLOR specify additional details for the tag.
See `semantic-format-tag-prototype-matlab-mode' for details."
(let* ((proto (semantic-format-tag-prototype-matlab-mode tag nil color)) (let* ((proto (semantic-format-tag-prototype-matlab-mode tag nil color))
(doc (semantic-tag-docstring tag))) (doc (semantic-tag-docstring tag)))
(concat proto " (" doc ")"))) (concat proto " (" doc ")")))

View File

@ -22,6 +22,10 @@
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA. ;; Boston, MA 02110-1301, USA.
;;; Commentary:
;;
;; Support for Semantic Databases for MATLAB buffers.
;; For generic function searching. ;; For generic function searching.
(require 'eieio) (require 'eieio)
(require 'eieio-opt) (require 'eieio-opt)
@ -86,7 +90,7 @@ the omniscience database.")
;;; Filename based methods ;;; Filename based methods
;; ;;
(cl-defmethod semanticdb-get-database-tables ((obj semanticdb-project-database-matlab)) (cl-defmethod semanticdb-get-database-tables ((obj semanticdb-project-database-matlab))
"For a MATLAB database, there are no explicit tables. "For a MATLAB database OBJ, there are no explicit tables.
Create one of our special tables that can act as an intermediary." Create one of our special tables that can act as an intermediary."
;; NOTE: This method overrides an accessor for the `tables' slot in ;; NOTE: This method overrides an accessor for the `tables' slot in
;; a database. You can either construct your own (like tmp here ;; a database. You can either construct your own (like tmp here
@ -149,7 +153,7 @@ database (if available.)"
) )
(if (fboundp 'semanticdb-find-translate-path-default) (if (fboundp 'semanticdb-find-translate-path-default)
(semanticdb-find-translate-path-default path brutish) (semanticdb-find-translate-path-default path brutish)
(error "semanticdb-find-translate-path-default doesn't exist") (error "Variable semanticdb-find-translate-path-default doesn't exist")
)))) ))))
;; Don't add anything if BRUTISH is on (it will be added in that fcn) ;; Don't add anything if BRUTISH is on (it will be added in that fcn)
;; or if we aren't supposed to search the system. ;; or if we aren't supposed to search the system.

View File

@ -1,6 +1,6 @@
;;; srecode-matlab.el --- Extra SRecode support for MATLAB ;;; srecode-matlab.el --- Extra SRecode support for MATLAB
;; ;;
;; Copyright (C) 2014 Eric Ludlam ;; Copyright (C) 2014, 2019 Eric Ludlam
;; ;;
;; Author: Eric Ludlam <zappo@gnu.org> ;; Author: Eric Ludlam <zappo@gnu.org>
;; X-RCS: $Id$ ;; X-RCS: $Id$
@ -46,8 +46,8 @@ PACKAGE - The package this file is in, or empty if none.
FILE_CLASS - Show section if filename should be a class. FILE_CLASS - Show section if filename should be a class.
FILE_FUNCTION - Show setion if filename is a function. FILE_FUNCTION - Show setion if filename is a function.
On class prediction - when filling in an empty file, if the filename and directory it is in On class prediction - when filling in an empty file, if the filename and
match, for example @foo/foo.m then foo should be a classdef." directory it is in match, for example @foo/foo.m then foo should be a classdef."
(when (not (eq major-mode 'matlab-mode)) (when (not (eq major-mode 'matlab-mode))
(error "Wrong mode for :matlab argument")) (error "Wrong mode for :matlab argument"))
(let* ((fsym (file-name-sans-extension (file-name-nondirectory (buffer-file-name)))) (let* ((fsym (file-name-sans-extension (file-name-nondirectory (buffer-file-name))))