emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/auctex 87e8cb0369 05/39: Simplify implementation of sty


From: Tassilo Horn
Subject: [elpa] externals/auctex 87e8cb0369 05/39: Simplify implementation of style/pythontex.el
Date: Thu, 20 Jul 2023 04:21:48 -0400 (EDT)

branch: externals/auctex
commit 87e8cb03696e6dfac20d79677a07f818f5ef96e4
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>

    Simplify implementation of style/pythontex.el
    
    * style/pythontex.el (LaTeX-env-pythontex): Delete function and
    move the functionality into the hook.
---
 style/pythontex.el | 24 ++++--------------------
 1 file changed, 4 insertions(+), 20 deletions(-)

diff --git a/style/pythontex.el b/style/pythontex.el
index 610a6341ec..8c1399f0de 100644
--- a/style/pythontex.el
+++ b/style/pythontex.el
@@ -1,6 +1,6 @@
 ;;; pythontex.el --- AUCTeX style for `pythontex.sty' (v0.16)  -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2018--2022 Free Software Foundation, Inc.
+;; Copyright (C) 2018--2023 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -113,24 +113,6 @@ Update the variable `LaTeX-pythontex-language-list' if 
still nil."
   '("py" "sympy" "pylab" "rb" "ruby" "jl" "julia" "octave")
   "List of language families provided by pythontex package.")
 
-(defun LaTeX-env-pythontex (environment)
-  "Insert ENVIRONMENT provided by pythontex package."
-  (let ((session (TeX-read-string
-                  (TeX-argument-prompt t nil "Session")))
-        (fvkeyval (TeX-read-key-val t (LaTeX-fancyvrb-key-val-options))))
-    (LaTeX-insert-environment environment
-                              (concat
-                               (when (and session (not (string= session "")))
-                                 (concat LaTeX-optop session LaTeX-optcl))
-                               ;; We need an extra pair of brackets
-                               ;; when no session is given but
-                               ;; key=vals are available
-                               (when (and session (string= session "")
-                                          fvkeyval (not (string= fvkeyval "")))
-                                 (concat LaTeX-optop LaTeX-optcl))
-                               (when (and fvkeyval (not (string= fvkeyval "")))
-                                 (concat LaTeX-optop fvkeyval LaTeX-optcl))))))
-
 ;; Setup for \saveprintpythontex & \savestdoutpythontex &
 ;; \savestderrpythontex
 (TeX-auto-add-type "pythontex-savecontent" "LaTeX")
@@ -248,7 +230,9 @@ a list of strings."
                     verb-macs))
      (apply #'LaTeX-add-environments
             (mapcar (lambda (env)
-                      (list env #'LaTeX-env-pythontex))
+                      (list env #'LaTeX-env-args
+                            [ "Session" ]
+                            [TeX-arg-key-val 
(LaTeX-fancyvrb-key-val-options)]))
                     verb-envs))
      ;; Filling:
      (dolist (mac verb-macs)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]