[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] [elpa] externals/auctex 8990190 16/34: Improve style/algo
From: |
Tassilo Horn |
Subject: |
[AUCTeX-diffs] [elpa] externals/auctex 8990190 16/34: Improve style/algorithm.el |
Date: |
Sun, 6 Jun 2021 11:40:03 -0400 (EDT) |
branch: externals/auctex
commit 89901901576b1534b5c9d6979ff1648f908bb6b6
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Improve style/algorithm.el
* style/algorithm.el (LaTeX-algorithm-package-options): Add
missing options.
(LaTeX-env-algorithm): Insert a newline only when a label is
really added. Remove unnecessary comments.
("algorithm"): Move `TeX-dialect' to be the third argument of the
hook.
---
style/algorithm.el | 31 ++++++++++++++-----------------
1 file changed, 14 insertions(+), 17 deletions(-)
diff --git a/style/algorithm.el b/style/algorithm.el
index c493c82..e18e19d 100644
--- a/style/algorithm.el
+++ b/style/algorithm.el
@@ -32,10 +32,12 @@
(require 'latex)
(defvar LaTeX-algorithm-package-options
- '("section")
+ '(;; Appearance options:
+ "plain" "ruled" "boxed"
+ ;; Numbering convention:
+ "part" "chapter" "section" "subsection" "subsubsection" "nothing")
"Package options for the algorithm package.")
-
(defun LaTeX-env-algorithm (environment)
"Insert a algorithm-like ENVIRONMENT with caption and label."
(let* ((pos (completing-read (TeX-argument-prompt t nil "Position")
@@ -54,30 +56,25 @@
(when (and short-caption (not (string= short-caption "")))
(insert LaTeX-optop short-caption LaTeX-optcl))
(insert TeX-grop caption)
- ;; ask for a label and insert it
- ; (LaTeX-label environment
'environment)
- ;; the longtable `\caption' is equivalent to a
- ;; `\multicolumn', so it needs a `\\' at the
- ;; end of the line. Prior to that, add } to
- ;; close `\caption{'
- (insert TeX-grcl "")
+ ;; Add } to close `\caption{'
+ (insert TeX-grcl)
;; fill the caption
(LaTeX-fill-paragraph)
;; Insert a new line and indent
(LaTeX-newline)
- (LaTeX-label environment 'environment)
- (LaTeX-newline)
- (indent-according-to-mode))))
-
+ (indent-according-to-mode)
+ ;; Finally add a \label:
+ (when (LaTeX-label environment 'environment)
+ (LaTeX-newline)
+ (indent-according-to-mode)))))
(TeX-add-style-hook
"algorithm"
(lambda ()
(LaTeX-add-environments
- '("algorithm" LaTeX-env-algorithm ))
+ '("algorithm" LaTeX-env-algorithm))
(TeX-add-symbols
- '("listofalgorithms" 0))
- TeX-dialect))
-
+ '("listofalgorithms" 0)))
+ TeX-dialect)
;;; algorithm.el ends here
- [AUCTeX-diffs] [elpa] externals/auctex 95c3acf 06/34: Ensure rawness of data to compute MD5, (continued)
- [AUCTeX-diffs] [elpa] externals/auctex 95c3acf 06/34: Ensure rawness of data to compute MD5, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 6050e27 12/34: Add new variable `TeX-normal-mode-reset-list', Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex b852059 10/34: ; Improve previous commit, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 2959334 11/34: ; Improve previous commit again, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex a8e1a5d 18/34: Update documentation, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex a6121fb 13/34: Fix fontification when $ is unclosed in buffer, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 1ded6fc 24/34: Fix markups in documents, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex afab0e0 17/34: Indent region (bug#48518), Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 70907dd 09/34: Skip inline math $ inside comments (bug#48365), Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 3c8e583 08/34: Introduce new variable `LaTeX-global-package-files', Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 8990190 16/34: Improve style/algorithm.el,
Tassilo Horn <=
- [AUCTeX-diffs] [elpa] externals/auctex b5f34a9 23/34: Followup my commit on May 6, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex bff3d85 01/34: ; Delete unnecessary escaping of characters, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 7ff3323 03/34: Add support for (Brazilian) Portuguese, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 2a4cbbb 21/34: Improve `TeX-electric-macro' in Texinfo mode, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex dfd6585 33/34: Merge remote-tracking branch 'origin/master' into externals/auctex, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 605cfc2 14/34: Add new test, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex bb1bb25 27/34: Remove backspace as paragraph separator, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 93d66d1 31/34: Adapt for Texinfo mode, Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex 154fc6e 28/34: Only re-fill \item contents if auto-fill-mode is active (bug#48760), Tassilo Horn, 2021/06/06
- [AUCTeX-diffs] [elpa] externals/auctex cd63c11 32/34: Use own error description for LaTeX mode only, Tassilo Horn, 2021/06/06