[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex b7b498baad 40/76: Simplify implementation of sty
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex b7b498baad 40/76: Simplify implementation of style/graphicx.el |
Date: |
Fri, 13 Jan 2023 14:31:03 -0500 (EST) |
branch: externals/auctex
commit b7b498baad045685c7fcec0bce61f7290b86d09b
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Simplify implementation of style/graphicx.el
* style/graphicx.el (LaTeX-graphicx-key-val-options): New
function.
(LaTeX-arg-graphicx-includegraphics-key-val): Remove since not
needed anymore.
("graphicx"): Use `TeX-arg-key-val' with the new function in the
hook.
---
style/graphicx.el | 69 ++++++++++++++++++++++---------------------------------
1 file changed, 27 insertions(+), 42 deletions(-)
diff --git a/style/graphicx.el b/style/graphicx.el
index 36e8dada8c..bc0dd8fcca 100644
--- a/style/graphicx.el
+++ b/style/graphicx.el
@@ -66,6 +66,25 @@
("alt"))
"Key=value options for graphicx macros.")
+(defun LaTeX-graphicx-key-val-options ()
+ "Return an updated list of key=vals from graphicx package.
+If `TeX-engine' is set to symbol `default' (while
+`TeX-PDF-from-DVI' is set to nil) or `luatex' and `TeX-PDF-mode'
+is non-nil, add the keys \"page\" and \"pagebox\" to list of
+key=vals."
+ (if (and (or (and (eq TeX-engine 'default)
+ (not (TeX-PDF-from-DVI)))
+ (eq TeX-engine 'luatex)
+ ;; dvipdfmx can handle page and
+ ;; pagebox options.
+ (string= (TeX-PDF-from-DVI) "Dvipdfmx"))
+ TeX-PDF-mode)
+ (append '(("page")
+ ("pagebox" ("mediabox" "cropbox" "bleedbox"
+ "trimbox" "artbox")))
+ LaTeX-graphicx-key-val-options)
+ LaTeX-graphicx-key-val-options))
+
(defvar LaTeX-includegraphics-dvips-extensions
'("eps" "mps" "EPS")
"List of extensions for image files supported by \"dvips\".")
@@ -82,42 +101,6 @@
"BMP" "PICT" "PSD" "MAC" "TGA" "GIF" "TIF" "TIFF")
"List of extensions for image files supported by \"xetex\".")
-(defun LaTeX-arg-graphicx-includegraphics-key-val (optional)
- "Insert key-val for optional argument of \\includegraphics macro.
-If OPTIONAL is non-nil, insert argument in square brackets.
-Temporarily remove \"space\" from `crm-local-completion-map' and
-`minibuffer-local-completion-map' in order to be able to insert
-spaces conveniently.
-
-If `TeX-engine' is set to symbol `default' (while
-`TeX-PDF-from-DVI' is set to nil) or `luatex' and `TeX-PDF-mode'
-is non-nil, add the keys \"page\" and \"pagebox\" to list of
-key-val's."
- (let ((crm-local-completion-map
- (remove (assoc 32 crm-local-completion-map)
- crm-local-completion-map))
- (minibuffer-local-completion-map
- (remove (assoc 32 minibuffer-local-completion-map)
- minibuffer-local-completion-map)))
- (TeX-argument-insert
- (TeX-read-key-val optional
- (if (and (or (and (eq TeX-engine 'default)
- (not (TeX-PDF-from-DVI)))
- (eq TeX-engine 'luatex)
- ;; dvipdfmx can handle page and
- ;; pagebox options.
- (string= (TeX-PDF-from-DVI) "Dvipdfmx"))
- TeX-PDF-mode)
- (append '(("page")
- ("pagebox" ("mediabox"
- "cropbox"
- "bleedbox"
- "trimbox"
- "artbox")))
- LaTeX-graphicx-key-val-options)
- LaTeX-graphicx-key-val-options))
- optional)))
-
(defun LaTeX-includegraphics-extensions-list ()
"Return appropriate extensions for input files to \\includegraphics.
Return value is a list of regexps."
@@ -272,20 +255,22 @@ subdirectories and inserts the relative file name. See
"Argument")
'("rotatebox" (TeX-arg-conditional (member "graphics" (TeX-style-list))
- ()
- ([ TeX-arg-key-val (("x") ("y")
("origin") ("units")) ]))
+ ()
+ ([TeX-arg-key-val (("x") ("y") ("origin") ("units"))]))
"Angle" "Argument")
'("scalebox" "Horizontal scale" [ "Vertical scale" ] "Argument")
'("includegraphics" (TeX-arg-conditional (member "graphics"
(TeX-style-list))
- (["llx,lly"] ["urx,ury"])
- ([
LaTeX-arg-graphicx-includegraphics-key-val ]))
+ (["llx,lly"] ["urx,ury"])
+ ([TeX-arg-key-val (LaTeX-graphicx-key-val-options)
+ nil nil ?\s]))
LaTeX-arg-includegraphics)
'("includegraphics*" (TeX-arg-conditional (member "graphics"
(TeX-style-list))
- (["llx,lly"] ["urx,ury"])
- ([
LaTeX-arg-graphicx-includegraphics-key-val ]))
+ (["llx,lly"] ["urx,ury"])
+ ([TeX-arg-key-val (LaTeX-graphicx-key-val-options)
+ nil nil ?\s]))
LaTeX-arg-includegraphics)
'("graphicspath" t)
- [elpa] externals/auctex 5484b57bc4 31/76: Don't rely on the value of `LaTeX-current-environment', (continued)
- [elpa] externals/auctex 5484b57bc4 31/76: Don't rely on the value of `LaTeX-current-environment', Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 22336f15bd 52/76: Simplify implementation of style/mathtools.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 54c82bd093 67/76: New style file physics.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex e772b93525 53/76: * style/mdframed.el ("mdframed"): Replace `TeX-arg-eval'., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 01f84ce9f5 73/76: Simplify implementation of style/minted.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 358b4d0785 76/76: Merge remote-tracking branch 'origin/master' into externals/auctex, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 2664170ecc 37/76: Update style/fvextra.el to package version 1.5, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 5f129b5dca 58/76: Support starred variant name, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex e97fb94f4e 62/76: Pacify compiler warning, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex bf66b302a4 61/76: Improve the previous commit slightly, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex b7b498baad 40/76: Simplify implementation of style/graphicx.el,
Tassilo Horn <=
- [elpa] externals/auctex 7f9e7ec8a1 05/76: * style/array.el ("array"): Replace `TeX-arg-eval' with a closure., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 1a72c0f884 32/76: Simplify implementation of style/floatrow.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex ac7ad4fff4 36/76: Simplify implementation of style/footmisc.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 33bb54bb9e 38/76: Simplify implementation of style/geometry.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex dc6e8c44c9 72/76: Turn `y-or-n-p' into `always' for in-buffer completion, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex e4ceb88bb7 14/76: Bind a value to `LaTeX-current-environment' locally, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 4b9dafad86 29/76: Simplify implementation of style/fancyvrb.el, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 982b20571c 48/76: * style/ltxdoc.el ("ltxdoc"): Replace `TeX-arg-eval'., Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 46c1a5a592 63/76: Add filename as a prefix to catchfilebetweentags counter, Tassilo Horn, 2023/01/13
- [elpa] externals/auctex 2d0fdebac0 69/76: Preserve braces after @TeX and similar macros., Tassilo Horn, 2023/01/13