[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 0692e51 23/30: ; Silence the compiler
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 0692e51 23/30: ; Silence the compiler |
Date: |
Fri, 25 Sep 2020 11:00:15 -0400 (EDT) |
branch: externals/auctex
commit 0692e5139a1f3a2b7d341332cc02d481faa4dab2
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
; Silence the compiler
* latex.el: defvar the variables `outline-heading-alist',
`TeX-auto-file' and `LaTeX-section-list-changed'.
(LaTeX-section-heading, LaTeX-section-title, LaTeX-section-toc)
(LaTeX-section-section, LaTeX-section-label): Use
`with-no-warnings' in order to silence the compiler for
dynamically scoped variables `title', `name', `level' and `toc'.
---
latex.el | 76 ++++++++++++++++++++++++++++++++++------------------------------
1 file changed, 41 insertions(+), 35 deletions(-)
diff --git a/latex.el b/latex.el
index a092a01..2e9e848 100644
--- a/latex.el
+++ b/latex.el
@@ -45,6 +45,11 @@
(declare-function turn-off-filladapt-mode "ext:filladapt"
nil)
+;; Silence the compiler for variables:
+(defvar outline-heading-alist)
+(defvar TeX-auto-file)
+(defvar LaTeX-section-list-changed)
+
;;; Syntax
(defvar LaTeX-optop "["
@@ -121,12 +126,8 @@ This depends on `LaTeX-insert-into-comments'."
;;; Sections
-;; Declare dynamically scoped vars.
-(defvar title)
-(defvar name)
-(defvar level)
+;; Declare dynamically scoped var.
(defvar done-mark)
-(defvar toc)
(defun LaTeX-section (arg)
"Insert a template for a LaTeX section.
@@ -449,32 +450,35 @@ no label is inserted."
"Hook to prompt for LaTeX section name.
Insert this hook into `LaTeX-section-hook' to allow the user to change
the name of the sectioning command inserted with `\\[LaTeX-section]'."
- (let ((string (completing-read
- (concat "Level (default " name "): ")
- LaTeX-section-list
- nil nil nil nil name)))
- ;; Update name
- (if (not (zerop (length string)))
- (setq name string))
- ;; Update level
- (setq level (LaTeX-section-level name))))
+ (with-no-warnings
+ (let ((string (completing-read
+ (concat "Level (default " name "): ")
+ LaTeX-section-list
+ nil nil nil nil name)))
+ ;; Update name
+ (if (not (zerop (length string)))
+ (setq name string))
+ ;; Update level
+ (setq level (LaTeX-section-level name)))))
(defun LaTeX-section-title ()
"Hook to prompt for LaTeX section title.
Insert this hook into `LaTeX-section-hook' to allow the user to change
the title of the section inserted with `\\[LaTeX-section]."
- (setq title (TeX-read-string "Title: " title))
- (let ((region (and (TeX-active-mark)
- (cons (region-beginning) (region-end)))))
- (when region (delete-region (car region) (cdr region)))))
+ (with-no-warnings
+ (setq title (TeX-read-string "Title: " title))
+ (let ((region (and (TeX-active-mark)
+ (cons (region-beginning) (region-end)))))
+ (when region (delete-region (car region) (cdr region))))))
(defun LaTeX-section-toc ()
"Hook to prompt for the LaTeX section entry in the table of content .
Insert this hook into `LaTeX-section-hook' to allow the user to insert
a different entry for the section in the table of content."
- (setq toc (TeX-read-string "Toc Entry: "))
- (if (zerop (length toc))
- (setq toc nil)))
+ (with-no-warnings
+ (setq toc (TeX-read-string "Toc Entry: "))
+ (if (zerop (length toc))
+ (setq toc nil))))
(defun LaTeX-section-section ()
"Hook to insert LaTeX section command into the file.
@@ -491,18 +495,19 @@ assume that the section is already inserted."
"begin")
(line-beginning-position 0) t))
(LaTeX-newline))
- (insert TeX-esc name)
- (cond ((null toc))
- ((zerop (length toc))
- (insert LaTeX-optop)
- (set-marker done-mark (point))
- (insert LaTeX-optcl))
- (t
- (insert LaTeX-optop toc LaTeX-optcl)))
- (insert TeX-grop)
- (if (zerop (length title))
- (set-marker done-mark (point)))
- (insert title TeX-grcl)
+ (with-no-warnings
+ (insert TeX-esc name)
+ (cond ((null toc))
+ ((zerop (length toc))
+ (insert LaTeX-optop)
+ (set-marker done-mark (point))
+ (insert LaTeX-optcl))
+ (t
+ (insert LaTeX-optop toc LaTeX-optcl)))
+ (insert TeX-grop)
+ (if (zerop (length title))
+ (set-marker done-mark (point)))
+ (insert title TeX-grcl))
(LaTeX-newline)
;; If RefTeX is available, tell it that we've just made a new section
(and (fboundp 'reftex-notice-new-section)
@@ -514,8 +519,9 @@ Insert this hook into `LaTeX-section-hook' to prompt for a
label to be
inserted after the sectioning command.
The behaviour of this hook is controlled by variable `LaTeX-section-label'."
- (and (LaTeX-label name 'section)
- (LaTeX-newline)))
+ (with-no-warnings
+ (and (LaTeX-label name 'section)
+ (LaTeX-newline))))
;;; Environments
- [elpa] externals/auctex 840973c 08/30: ; Silence the compiler, (continued)
- [elpa] externals/auctex 840973c 08/30: ; Silence the compiler, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 243961c 06/30: ; Silence the compiler, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex e293844 07/30: ; Silence the compiler, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 55e8842 15/30: Treat \choice like \item, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 971bece 14/30: Update style/csquotes.el to package version 5.2j, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex a17fee2 16/30: ; Silence the compiler, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 59b7942 17/30: ; Silence the compiler, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 07b79fc 24/30: ; Silence the compiler, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 087b030 28/30: Simplify mode line for emacs 27, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex b06ca0a 25/30: Fix document, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 0692e51 23/30: ; Silence the compiler,
Tassilo Horn <=
- [elpa] externals/auctex 601e6a3 01/30: Get rid of gabage in generated texi file, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 4d58d7d 09/30: Don't extend font lock region too eagerly (bug#42267), Tassilo Horn, 2020/09/25
- [elpa] externals/auctex d7cba92 21/30: Prepare for pdf output for PSTricks documents, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex a27850f 10/30: Fix previous commit and add new test, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 67ecb0b 18/30: ; Silence the compiler, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 255e768 11/30: Cater for case where fontification match goes over limit, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 92aa02b 29/30: Merge remote-tracking branch 'origin/master' into externals/auctex, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex be4a912 26/30: ; Silence the compiler, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex 3ef28a5 20/30: Add an extra check for tex-buf.el in some style hooks, Tassilo Horn, 2020/09/25
- [elpa] externals/auctex f04a508 22/30: Restore all math environments in texmathp.el, Tassilo Horn, 2020/09/25