[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 0c482642cc 32/48: Simplify implementation of sty
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 0c482642cc 32/48: Simplify implementation of style/currvita.el |
Date: |
Fri, 18 Nov 2022 14:27:44 -0500 (EST) |
branch: externals/auctex
commit 0c482642ccb46af364fa14765abc3049635c21b8
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Simplify implementation of style/currvita.el
* style/currvita.el ("currvita"): Use `LaTeX-env-item-args' in the
hook and subsequently delete `LaTeX-currvita-env-with-label'.
Add fontification support for \cvplace macro.
---
style/currvita.el | 51 +++++++++++++++------------------------------------
1 file changed, 15 insertions(+), 36 deletions(-)
diff --git a/style/currvita.el b/style/currvita.el
index f1f27a369b..2f290344dd 100644
--- a/style/currvita.el
+++ b/style/currvita.el
@@ -1,6 +1,6 @@
;;; currvita.el --- AUCTeX style for `currvita.sty' (v0.9i) -*-
lexical-binding: t; -*-
-;; Copyright (C) 2015--2021 Free Software Foundation, Inc.
+;; Copyright (C) 2015--2022 Free Software Foundation, Inc.
;; Author: Arash Esbati <arash@gnu.org>
;; Maintainer: auctex-devel@gnu.org
@@ -31,49 +31,22 @@
;;; Code:
+;; Silence the compiler:
+(declare-function font-latex-add-keywords
+ "font-latex"
+ (keywords class))
+
(require 'tex)
(require 'latex)
-;; This is a modified version of `LaTeX-env-item'.
-(defun LaTeX-currvita-env-with-label (env)
- "Insert ENV, a mandatory label and the first item."
- (LaTeX-insert-environment
- env
- (let ((heading (TeX-read-string "Heading of list: ")))
- (format "{%s}" heading)))
- (if (TeX-active-mark)
- (progn
- (LaTeX-find-matching-begin)
- (end-of-line 1))
- (end-of-line 0))
- (delete-char 1)
- (when (looking-at (concat "^[ \t]+$\\|"
- "^[ \t]*" TeX-comment-start-regexp "+[ \t]*$"))
- (delete-region (point) (line-end-position)))
- (delete-horizontal-space)
- ;; Deactivate the mark here in order to prevent `TeX-parse-macro'
- ;; from swapping point and mark and the \item ending up right after
- ;; \begin{...}.
- (deactivate-mark)
- (LaTeX-insert-item)
- ;; The inserted \item may have outdented the first line to the
- ;; right. Fill it, if appropriate.
- (when (and auto-fill-function
- (not (looking-at "$"))
- (not (assoc env LaTeX-indent-environment-list))
- (> (- (line-end-position) (line-beginning-position))
- (current-fill-column)))
- (LaTeX-fill-paragraph nil)))
-
-
(TeX-add-style-hook
"currvita"
(lambda ()
;; env's defined by currvita.sty
(LaTeX-add-environments
- '("cv" "Heading of CV")
- '("cvlist" LaTeX-currvita-env-with-label))
+ '("cv" "Heading of CV")
+ '("cvlist" LaTeX-env-item-args "Heading of list"))
;; Add "cvlist" to the list of environments which have an optional
;; argument for each item
@@ -88,7 +61,13 @@
"cvbibname")
;; Add new lengths defined by currvita.sty
- (LaTeX-add-lengths "cvlabelwidth" "cvlabelskip" "cvlabelsep"))
+ (LaTeX-add-lengths "cvlabelwidth" "cvlabelskip" "cvlabelsep")
+
+ ;; Fontification
+ (when (and (featurep 'font-latex)
+ (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '(("cvplace" "{"))
+ 'function)))
TeX-dialect)
(defvar LaTeX-currvita-package-options
- [elpa] externals/auctex 52a7f4050f 27/48: ; * doc/auctex.texi (Adding Environments): Adjust indentation., (continued)
- [elpa] externals/auctex 52a7f4050f 27/48: ; * doc/auctex.texi (Adding Environments): Adjust indentation., Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 42150568f1 06/48: Allow user to insert "$" (bug#57626), Tassilo Horn, 2022/11/18
- [elpa] externals/auctex cdf57fba58 11/48: * latex.el (TeX-arg-conditional): Declare 'indent'., Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 4eaed332ba 26/48: Add new hooks for inserting environments with arguments, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex d7e6fa0d41 05/48: Cleanup `TeX-insert-dollar', Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 21e624026a 28/48: Improve support for TikZ, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex e53bb19a90 37/48: ; Recognize large arguments with many lines, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 9b365b7419 18/48: Simplify implementation of style/textpos.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 1f6e9e7e58 10/48: Update style/XCharter.el to package version 1.24, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 05cd0440c5 02/48: Use `TeX-arg-completing-read-multiple', Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 0c482642cc 32/48: Simplify implementation of style/currvita.el,
Tassilo Horn <=
- [elpa] externals/auctex 615e12f650 42/48: Simplify implementation of style/tcolorbox.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex b9548da54a 38/48: Simplify implementation of style/tcolorboxlib-theorems.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 8e3137f641 15/48: Simplify implementation of style/titlesec.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 20cabef81f 20/48: ; Delete unnecessary `TeX-arg-string', Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 49987f08dd 19/48: Provide completion candidates for `TeX-arg-length', Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 52738d11b2 39/48: Remove entry in `LaTeX-completion-function-map-alist-keyval', Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 8f70cd5211 14/48: Simplify implementation of style/ulem.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex d5ff42e0bd 34/48: Simplify implementation of style/enumitem.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex ff5a83f345 17/48: Simplify implementation of style/thm-restate.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 0ee39626e4 01/48: Use `TeX-arg-completing-read', Tassilo Horn, 2022/11/18