branch: master commit eca0fadbc3462aebc48f8a672243a2776e148d8a Author: Ikumi Keita <ik...@ikumi.que.jp> Commit: Ikumi Keita <ik...@ikumi.que.jp>
; Trivial cleanups * tex.el (TeX-search-unescaped): Quote function names by #'. (TeX-parse-all-errors): Remove comment which no longer applies since tex-buf.el was merged into tex.el. (TeX-insert-braces): Signal error in read-only buffer when called interactively. * context.el (TeX-ConTeXt-sentinel, ConTeXt-find-matching-start) (ConTeXt-dialect, ConTeXt-mode-common-initialization) * plain-tex.el (plain-TeX-dialect) * tex-info.el (Texinfo-mark-environment) (Texinfo-nodename-de-escape, Texinfo-nodename-escape) (Texinfo-reftex-section-info, TeX-texinfo-mode): Fix word spacings in comments and doc strings. * latex.el (LaTeX-error-description-list): Delete trailing space in explanatory sentences. (LaTeX-fill-paragraph): Signal error in read-only buffer when called interactively. --- context.el | 20 ++++++++++---------- latex.el | 8 ++++---- plain-tex.el | 2 +- tex-info.el | 10 +++++----- tex.el | 11 +++-------- 5 files changed, 23 insertions(+), 28 deletions(-) diff --git a/context.el b/context.el index c278e460..c8a99b94 100644 --- a/context.el +++ b/context.el @@ -598,7 +598,7 @@ for a label to be inserted after the sectioning command." (cond ((TeX-TeX-sentinel-check process name)) ((save-excursion ;; in a full ConTeXt run there will multiple texutil - ;; outputs. Just looking for "another run needed" would + ;; outputs. Just looking for "another run needed" would ;; find the first occurence (goto-char (point-max)) (re-search-backward "TeXUtil " nil t) @@ -906,9 +906,9 @@ set to the point where this function starts. Point will be at (ConTeXt--env-parse-args args)) -;; with the following we can call a function on an environment. Say +;; with the following we can call a function on an environment. Say ;; you have metapost stuff within your TeX file, go to the environment -;; and run ConTeXt-work-on-environment (suggested Key: C-c !). AUCTeX +;; and run ConTeXt-work-on-environment (suggested Key: C-c !). AUCTeX ;; sees that you are inside e.g. \startMPpage....\stopMPpage and ;; looks in ConTeXt-environment-helper for a function to be called. @@ -953,7 +953,7 @@ An entry looks like: (\"environment\" . function)") (context-mode) (widen)) -;; find smarter name. Suggestions welcome +;; find smarter name. Suggestions welcome (defun ConTeXt-work-on-environment () "Takes current environment and does something on it (todo: documentation)." (interactive) @@ -1049,10 +1049,10 @@ If INNER is non-nil, go to the point just past the \\start... macro." (setq level (1- level)))))) ;; now we have to look if we want to start behind the \start... macro (when inner - ;; \startfoo can have 0 or more {} and [] pairs. I assume that - ;; skipping all those parens will be smart enough. It fails when + ;; \startfoo can have 0 or more {} and [] pairs. I assume that + ;; skipping all those parens will be smart enough. It fails when ;; the first part in the \start-\stop-environment is { or [, like - ;; in \startquotation {\em important} \stopquotation. There is + ;; in \startquotation {\em important} \stopquotation. There is ;; yet another pitfall: \startsetups SomeSetup foo bar ;; \stopsetups will use SomeSetup as the argument and the ;; environment @@ -1262,7 +1262,7 @@ An optional fourth (or sixth) element means always replace if t." (match-string 1) (buffer-substring-no-properties (point) (line-end-position))))) -;; This imenu also includes commented out chapters. Perhaps a feature +;; This imenu also includes commented out chapters. Perhaps a feature ;; for LaTeX, not sure we want or need that for ConTeXt. (defun ConTeXt-imenu-create-index-function () @@ -1799,7 +1799,7 @@ Use `ConTeXt-Mark-version' to choose the command." (defconst ConTeXt-dialect :context "Default dialect for use with function `TeX-add-style-hook' for argument DIALECT-EXPR when the hook is to be run only on ConTeXt -file, or any mode derived thereof. See variable +file, or any mode derived thereof. See variable `TeX-style-hook-dialect'." ) (defcustom ConTeXt-clean-intermediate-suffixes @@ -1851,7 +1851,7 @@ that is, you do _not_ have to cater for this yourself by adding \\\\\\=' or $." (setq ConTeXt-indent-item-re (concat "\\\\\\(" (mapconcat #'identity ConTeXt-item-list "\\|") "\\)\\>")) ;; What's the deepest level at we can collapse a document? - ;; set only if user has not set it. Need to be set before menu is created. + ;; set only if user has not set it. Need to be set before menu is created. ;; level 2 is "section" (or ConTeXt-largest-level (setq ConTeXt-largest-level 2)) diff --git a/latex.el b/latex.el index 354bb2f3..cea33b1a 100644 --- a/latex.el +++ b/latex.el @@ -5053,7 +5053,7 @@ code comment. If LaTeX syntax is taken into consideration during filling depends on the value of `LaTeX-syntactic-comments'." - (interactive "P") + (interactive "*P") (if (save-excursion (beginning-of-line) (looking-at (concat TeX-comment-start-regexp "*[ \t]*$"))) @@ -6918,7 +6918,7 @@ by too many \\thanks commands.") ("Environment [^ ]* undefined." . "LaTeX has encountered a \\begin command for a nonexistent environment. -You probably misspelled the environment name. ") +You probably misspelled the environment name.") ("Float(s) lost." . "You put a figure or table environment or a \\marginpar command inside a @@ -7253,7 +7253,7 @@ on this line than it should.") ("Overfull \\\\vbox .*" . "Because it couldn't find a good place for a page break, TeX put more -on the page than it should. ") +on the page than it should.") ("Underfull \\\\hbox .*" . "Check your output for extra vertical space. If you find some, it was @@ -7264,7 +7264,7 @@ by inserting a \\linebreak command.") ("Underfull \\\\vbox .*" . "TeX could not find a good place to break the page, so it produced a -page without enough text on it. ") +page without enough text on it.") ;; New list items should be placed here ;; diff --git a/plain-tex.el b/plain-tex.el index 4f06a026..0800b2f3 100644 --- a/plain-tex.el +++ b/plain-tex.el @@ -105,7 +105,7 @@ Install tool bar if `plain-TeX-enable-toolbar' and (defconst plain-TeX-dialect :plain-tex "Default dialect for use with function `TeX-add-style-hook' for argument DIALECT-EXPR when the hook is to be run only on -plain-TeX file, or any mode derived thereof. See variable +plain-TeX file, or any mode derived thereof. See variable `TeX-style-hook-dialect'." ) (defcustom plain-TeX-mode-hook nil diff --git a/tex-info.el b/tex-info.el index 2ee3d7ac..dd0ff433 100644 --- a/tex-info.el +++ b/tex-info.el @@ -164,7 +164,7 @@ there are unbalanced begin-end pairs in comments and verbatim environments." ;; TODO: ;; This is identical to the LaTeX counterpart but for the find begin/end - ;; functions. So some day the implemenation should be factorized. + ;; functions. So some day the implemenation should be factorized. (interactive "p") (setq count (if count (abs count) 1)) (let ((cur (point)) beg end) @@ -290,7 +290,7 @@ beginning of keyword `@node' or `@bye'." (defun Texinfo-nodename-de-escape (node-name) "In NODE-NAME, convert `@comma{}' commands to the corresponding `,' -character. Return the resulting string." +character. Return the resulting string." (let ((pos 0) (map '(("comma" . ",")))) (while (and (< pos (length node-name)) @@ -304,7 +304,7 @@ character. Return the resulting string." (defun Texinfo-nodename-escape (node-name) "Convert in NODE-NAME the `,' characters to `@comma{}' -commands. Return the resulting string." +commands. Return the resulting string." (let* ((pos 0) (map '(("," . "comma"))) (re (regexp-opt (mapcar #'car map))) ) @@ -466,7 +466,7 @@ is assumed by default." (literal (buffer-substring-no-properties (1- (match-beginning 3)) (min (point-max) (+ (match-end 0) (length text1) 1)))) - ;; Literal can be too short since text1 too short. No big problem. + ;; Literal can be too short since text1 too short. No big problem. (text (reftex-nicify-text text1))) ;; Add section number and indentation @@ -728,7 +728,7 @@ value of `Texinfo-mode-hook'." '("bye") '("c" (TeX-arg-literal " ") (TeX-arg-free "Comment")) '("caption" "Caption" - ;; TODO: caption is meaningful only inside float env. Maybe some checking + ;; TODO: caption is meaningful only inside float env. Maybe some checking ;; and warning would be good. ) '("center" (TeX-arg-literal " ") (TeX-arg-free "Line of text")) diff --git a/tex.el b/tex.el index 7cfcd14a..2dfb7a76 100644 --- a/tex.el +++ b/tex.el @@ -701,11 +701,6 @@ sure \"%p\" is the first entry." TeX-expand-list TeX-expand-list-builtin)) -;; This variable used to be defined in tex-buf.el. It is used in -;; `TeX-mode-specific-command-menu-entries' in this file. It is now -;; (June 2021) moved into this file to avoid `void-variable' errors -;; with the "Command" menu if tex-buf.el is not loaded yet for reasons -;; mentioned above. (defcustom TeX-parse-all-errors t "Whether to automatically collect all warning and errors after running TeX. @@ -5722,8 +5717,8 @@ throwing an error. A pattern is escaped, if it is preceded by an odd number of escape characters." (let ((search-fun (if (eq direction 'backward) - (if regexp-flag 're-search-backward 'search-backward) - (if regexp-flag 're-search-forward 'search-forward)))) + (if regexp-flag #'re-search-backward #'search-backward) + (if regexp-flag #'re-search-forward #'search-forward)))) (catch 'found (while (funcall search-fun pattern bound noerror) (when (not (TeX-escaped-p (match-beginning 0))) @@ -6286,7 +6281,7 @@ between. If there is an active region, ARG will be ignored, braces will be inserted around the region, and point will be left after the closing brace." - (interactive "P") + (interactive "*P") (if (TeX-active-mark) (progn (if (< (point) (mark))