[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 04b9a6d1f9 56/77: Improve shortvrb.sty support
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 04b9a6d1f9 56/77: Improve shortvrb.sty support |
Date: |
Fri, 26 Aug 2022 16:06:37 -0400 (EDT) |
branch: externals/auctex
commit 04b9a6d1f9c7337e1f500721c9ad32029f3fb4c8
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>
Improve shortvrb.sty support
* latex.el (LaTeX-verbatim-p): Consult syntax parse instead of
font-latex face.
(LaTeX-common-initialization): Delete FIXME comment which is now
obsolete.
* style/shortvrb.el ("shortvrb"): Install new syntax table which
assigns "string quotes" syntax to chars in `LaTeX-shortvrb-chars'.
Change syntax of those chars in `font-lock-syntax-table' from "generic
string delimiters" to "string quotes" so that they won't interfere
with each other.
---
latex.el | 9 ++++-----
style/shortvrb.el | 11 ++++++++++-
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/latex.el b/latex.el
index ac4b0c548e..e8b8140952 100644
--- a/latex.el
+++ b/latex.el
@@ -3713,8 +3713,9 @@ non-parenthetical delimiters, like \\verb+foo+, are
recognized."
"Return non-nil if position POS is in a verbatim-like construct."
(when pos (goto-char pos))
(save-match-data
- (or (when (fboundp 'font-latex-faces-present-p)
- (font-latex-faces-present-p 'font-latex-verbatim-face))
+ (or (progn
+ (syntax-propertize (point))
+ (nth 3 (syntax-ppss)))
(member (LaTeX-current-verbatim-macro)
(LaTeX-verbatim-macros-with-delims))
(member (TeX-current-macro) (LaTeX-verbatim-macros-with-braces))
@@ -7353,9 +7354,7 @@ function would return non-nil and `(match-string 1)'
would return
(set (make-local-variable 'fill-paragraph-function) #'LaTeX-fill-paragraph)
(set (make-local-variable 'adaptive-fill-mode) nil)
;; Cater for \verb|...| (and similar) contructs which should not be
- ;; broken. (FIXME: Make it work with shortvrb.sty (also loaded by
- ;; doc.sty) where |...| is allowed. Arbitrary delimiters may be
- ;; chosen with \MakeShortVerb{<char>}.)
+ ;; broken.
(add-to-list (make-local-variable 'fill-nobreak-predicate)
#'LaTeX-verbatim-p t)
diff --git a/style/shortvrb.el b/style/shortvrb.el
index a8b4cd1701..e6de06080c 100644
--- a/style/shortvrb.el
+++ b/style/shortvrb.el
@@ -69,12 +69,21 @@
(cons str str)))
LaTeX-shortvrb-chars)))
+ ;; Syntax
+ ;; N.B. This doesn't handle backslash just before the closing
+ ;; delimiter like |xyz\| correctly. We hope we can live with that.
+ (when LaTeX-shortvrb-chars
+ (let ((st (make-syntax-table (syntax-table))))
+ (dolist (c LaTeX-shortvrb-chars)
+ (modify-syntax-entry c "\"" st))
+ (set-syntax-table st)))
+
;; Fontification
(when (and LaTeX-shortvrb-chars
(featurep 'font-latex)
(eq TeX-install-font-lock 'font-latex-setup))
(font-latex-add-to-syntax-alist
- (mapcar (lambda (char) (cons char "|"))
+ (mapcar (lambda (char) (cons char "\""))
LaTeX-shortvrb-chars))
(font-latex-add-keywords '(("MakeShortVerb" "*{")
- [elpa] externals/auctex 054b38887b 42/77: Fix (void-variable compilation-in-progress) error, (continued)
- [elpa] externals/auctex 054b38887b 42/77: Fix (void-variable compilation-in-progress) error, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex b24dcb4feb 40/77: Track changes in LaTeX kernel 2022-06-01, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 4163bb5c42 66/77: Fix `autoconf` warnings, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex ead30464d8 64/77: * style/listings.el (TeX-add-style-hook): Update fontification., Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 7d7e563862 34/77: * doc/changes.texi: Add NEWS item for the previous commit., Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 6e25d11aa6 44/77: Add comment, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 4a3d7a2dc2 60/77: Suppress indentation of verbatim env's in docTeX-mode, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex ce4bb7c1b6 58/77: ; * style/doc.el: Delete spurious `declare-function'., Tassilo Horn, 2022/08/26
- [elpa] externals/auctex d1d1bd819d 47/77: Control the opening and closing braces during insertion, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 23f4040c9d 57/77: Add new test, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 04b9a6d1f9 56/77: Improve shortvrb.sty support,
Tassilo Horn <=
- [elpa] externals/auctex 33a01b6928 59/77: Extend test for filling, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex cb0a1e6be1 72/77: Improve function calls to retrieve key=vals in style hooks, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex e194656ce2 28/77: Let RefTeX recognize labels in user defined environments, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 64a8e189a3 19/77: Remove compatibility code, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 6fe2f21e96 31/77: ; Fix warnings about single quotes in docstrings, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 019bcc9cc3 48/77: ; * style/proc.el: Fix a typo., Tassilo Horn, 2022/08/26
- [elpa] externals/auctex d44f83de8b 37/77: Add three new styles, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex a416201f4a 05/77: Delete usage of @key in index entries, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex dc101dee44 09/77: ; Delete style/multibib.el checked in by accident, Tassilo Horn, 2022/08/26
- [elpa] externals/auctex 34fd998400 21/77: ; * bib-cite.el (): Silence byte compiler, Tassilo Horn, 2022/08/26