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

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

[elpa] externals/auctex 1ec0278 65/78: Different approach to support Con


From: Tassilo Horn
Subject: [elpa] externals/auctex 1ec0278 65/78: Different approach to support ConTeXt Mark IV.
Date: Mon, 19 Oct 2015 09:11:13 +0000

branch: externals/auctex
commit 1ec0278e620542285df51086a3de9cd7792e5142
Author: Mosè Giordano <address@hidden>
Commit: Mosè Giordano <address@hidden>

    Different approach to support ConTeXt Mark IV.
    
    * context.el (ConTeXt-Mark-version): New customizable and
    safe-local variable.
    (ConTeXt-expand-command): New function.
    (ConTeXt-expand-options): Use `ConTeXt-Mark-version'.
    
    * tex.el (TeX-command-list): Use %(cntxcom) expander in all
    ConTeXt programs.  Remove MkIV entry.
    (TeX-expand-list): Add %(cntxcom).
---
 ChangeLog  |   11 +++++++++++
 context.el |   55 +++++++++++++++++++++++++++++++++++++++++--------------
 tex.el     |    7 +++----
 3 files changed, 55 insertions(+), 18 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5eb3ef7..0f9b067 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2015-10-04  Mos� Giordano  <address@hidden>
+
+       * context.el (ConTeXt-Mark-version): New customizable and
+       safe-local variable.
+       (ConTeXt-expand-command): New function.
+       (ConTeXt-expand-options): Use `ConTeXt-Mark-version'.
+
+       * tex.el (TeX-command-list): Use %(cntxcom) expander in all
+       ConTeXt programs.  Remove MkIV entry.
+       (TeX-expand-list): Add %(cntxcom).
+
 2015-10-04  Tassilo Horn  <address@hidden>
 
        * font-latex.el (font-latex-math-environments): Add math
diff --git a/context.el b/context.el
index 30b670e..0aa7311 100644
--- a/context.el
+++ b/context.el
@@ -1,6 +1,6 @@
 ;;; context.el --- Support for ConTeXt documents.
 
-;; Copyright (C) 2003-2006, 2008, 2010, 2012, 2014
+;; Copyright (C) 2003-2006, 2008, 2010, 2012, 2014, 2015
 ;;   Free Software Foundation, Inc.
 
 ;; Maintainer: Berend de Boer <address@hidden>
@@ -1576,24 +1576,51 @@ else.  There might be text before point."
 
 ;;; Option expander
 
+(defcustom ConTeXt-Mark-version "II"
+  "ConTeXt Mark version used for running ConTeXt."
+  :type "string"
+  :group 'TeX-command)
+(make-variable-buffer-local 'ConTeXt-Mark-version)
+(put 'ConTeXt-Mark-version 'safe-local-variable 'stringp)
+
 (defvar ConTeXt-texexec-option-nonstop "--nonstop "
   "Command line option for texexec to use nonstopmode.")
 
+(defun ConTeXt-expand-command ()
+  "Expand ConTeXt command.
+Use `ConTeXt-Mark-version' to choose the command."
+  (cond
+   ((string= ConTeXt-Mark-version "IV")
+    "context")
+   ;; In any other case fall back on Mark II.
+   (t
+    "texexec")))
+
 (defun ConTeXt-expand-options ()
   "Expand options for context command."
-  (concat
-   (let ((engine (eval (nth 4 (assq TeX-engine (TeX-engine-alist))))))
-     (when engine
-       (format "--engine=%s " engine)))
-   (unless (eq ConTeXt-current-interface "en")
-     (format "--interface=%s " ConTeXt-current-interface))
-   (when TeX-source-correlate-mode
-     (format "--passon=\"%s\" "
-            (if (eq (TeX-source-correlate-method-active) 'synctex)
-                TeX-synctex-tex-flags
-              TeX-source-specials-tex-flags)))
-   (unless TeX-interactive-mode
-     ConTeXt-texexec-option-nonstop)))
+  (cond
+   ;; Mark IV
+   ((string= ConTeXt-Mark-version "IV")
+    (concat
+     (if TeX-source-correlate-mode
+        "--synctex=1 ")
+     (unless TeX-interactive-mode
+       ConTeXt-texexec-option-nonstop)))
+   ;; In any other case fall back on Mark II.
+   (t
+    (concat
+     (let ((engine (eval (nth 4 (assq TeX-engine (TeX-engine-alist))))))
+       (when engine
+        (format "--engine=%s " engine)))
+     (unless (eq ConTeXt-current-interface "en")
+       (format "--interface=%s " ConTeXt-current-interface))
+     (when TeX-source-correlate-mode
+       (format "--passon=\"%s\" "
+              (if (eq (TeX-source-correlate-method-active) 'synctex)
+                  TeX-synctex-tex-flags
+                TeX-source-specials-tex-flags)))
+     (unless TeX-interactive-mode
+       ConTeXt-texexec-option-nonstop)))))
 
 ;;; Mode
 
diff --git a/tex.el b/tex.el
index 0072e31..d057cef 100644
--- a/tex.el
+++ b/tex.el
@@ -136,13 +136,11 @@ If nil, none is specified."
      TeX-run-TeX nil (ams-tex-mode) :help "Run AMSTeX")
     ;; support for ConTeXt  --pg
     ;; first version of ConTeXt to support nonstopmode: 2003.2.10
-    ("ConTeXt" "texexec --once --texutil %(extraopts) %(execopts)%t"
+    ("ConTeXt" "%(cntxcom) --once --texutil %(extraopts) %(execopts)%t"
      TeX-run-TeX nil (context-mode) :help "Run ConTeXt once")
-    ("ConTeXt Full" "texexec %(extraopts) %(execopts)%t"
+    ("ConTeXt Full" "%(cntxcom) %(extraopts) %(execopts)%t"
      TeX-run-TeX nil
      (context-mode) :help "Run ConTeXt until completion")
-    ("MkIV" "context %(extraopts) %S %t" TeX-run-TeX nil
-     (context-mode) :help "Run ConTeXt until completion")
     ("BibTeX" "bibtex %s" TeX-run-BibTeX nil t :help "Run BibTeX")
     ("Biber" "biber %s" TeX-run-Biber nil t :help "Run Biber")
     ,(if (or window-system (getenv "DISPLAY"))
@@ -482,6 +480,7 @@ string."
     ("%(o?)" (lambda () (if (eq TeX-engine 'omega) "o" "")))
     ("%(tex)" (lambda () (eval (nth 2 (assq TeX-engine (TeX-engine-alist))))))
     ("%(latex)" (lambda () (eval (nth 3 (assq TeX-engine 
(TeX-engine-alist))))))
+    ("%(cntxcom)" ConTeXt-expand-command)
     ("%(execopts)" ConTeXt-expand-options)
     ("%(extraopts)" (lambda () TeX-command-extra-options))
     ("%S" TeX-source-correlate-expand-options)



reply via email to

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