[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 9b365b7419 18/48: Simplify implementation of style/textpos.el, (continued)
- [elpa] externals/auctex 9b365b7419 18/48: Simplify implementation of style/textpos.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex c6c7c3f024 22/48: ; Use #' to quote function, 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 1f6e9e7e58 10/48: Update style/XCharter.el to package version 1.24, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 748449959c 21/48: New option `TeX-refuse-unmatched-dollar', 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 ce15e3fd87 24/48: Extend Japanese TeX support, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 20cabef81f 20/48: ; Delete unnecessary `TeX-arg-string', Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 21e624026a 28/48: Improve support for TikZ, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 316550f0bf 29/48: Fix `ConTeXt-add-environments', Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 0c482642cc 32/48: Simplify implementation of style/currvita.el,
Tassilo Horn <=
- [elpa] externals/auctex c525dd42dd 35/48: Simplify implementation of style/tcolorboxlib-raster.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex a7a7209a08 33/48: Extend the argument list of some functions, 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 50c0fb3d31 46/48: * style/afterpage.el ("afterpage"): Fontify the only macro., Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 93430d7ab0 48/48: Merge remote-tracking branch 'origin/master' into externals/auctex, 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 7642155b73 03/48: Don't let-bind `inhibit-point-motion-hooks' to t, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex a617944b4b 08/48: Fix style/xspace.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex 5949388ca2 12/48: Simplify argument queries in style/wrapfig.el, Tassilo Horn, 2022/11/18
- [elpa] externals/auctex e83a4b87b3 25/48: Use the correct function to retrieve the key=vals, Tassilo Horn, 2022/11/18