auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 8d2e9dbd27f0d153066cc


From: Arash Esbati
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 8d2e9dbd27f0d153066cc837ce083b12b7e141c8
Date: Sun, 4 Mar 2018 12:01:07 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  8d2e9dbd27f0d153066cc837ce083b12b7e141c8 (commit)
      from  688fae25c7edd7f9d4e019739622f3c48f0a05ac (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8d2e9dbd27f0d153066cc837ce083b12b7e141c8
Author: Arash Esbati <address@hidden>
Date:   Sun Mar 4 17:59:20 2018 +0100

    Add new function `TeX-arg-verb-delim-or-brace'
    
    * latex.el (TeX-arg-verb-delim-or-brace): New function for \verb
    like macros which take their argument either in delimiters or in
    braces.
    
    * doc/auctex.texi (Adding Macros): Document
    `TeX-arg-verb-delim-or-brace'.
    
    * style/listings.el ("listings"): Use
    `TeX-arg-verb-delim-or-brace' for \lstinline which also takes an
    optional argument.
    
    * style/minted.el (LaTeX-minted-auto-cleanup, "minted"): Use
    `TeX-arg-verb-delim-or-brace' for \mintinline and new macros
    defined with \newmintinline.
    
    * style/url.el ("url"): Use `TeX-arg-verb-delim-or-brace' for \url
    and \path.
    Remove "{" from fontification or \url and \path.

diff --git a/doc/auctex.texi b/doc/auctex.texi
index 39451c7..e861a75 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -5215,7 +5215,6 @@ defined labels.
 Prompt for a @LaTeX{} length completing with known lengths.  Add length
 to list of defined lengths.
 
-
 @item TeX-arg-define-macro
 Prompt for a @TeX{} macro with completion.  Add macro to list of defined
 macros.
@@ -5276,6 +5275,11 @@ Prompt for a @LaTeX{} pagestyle with completion.
 @item TeX-arg-verb
 Prompt for delimiter and text.
 
address@hidden TeX-arg-verb-delim-or-brace
+Prompt for delimiter and text.  This function is similar to
address@hidden, but is intended for macros which take their
+argument enclosed in delimiters or in braces.
+
 @item TeX-arg-pair
 Insert a pair of numbers, use arguments for prompt. The numbers are
 surrounded by parentheses and separated with a comma.
diff --git a/latex.el b/latex.el
index d30c256..9df3d52 100644
--- a/latex.el
+++ b/latex.el
@@ -1,6 +1,6 @@
 ;;; latex.el --- Support for LaTeX documents.
 
-;; Copyright (C) 1991, 1993-2017 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1993-2018 Free Software Foundation, Inc.
 
 ;; Maintainer: address@hidden
 ;; Keywords: tex
@@ -2618,6 +2618,38 @@ argument, otherwise as a mandatory one.  IGNORE is 
ignored."
       (insert del (read-from-minibuffer "Text: ") del))
     (setq LaTeX-default-verb-delimiter del)))
 
+(defun TeX-arg-verb-delim-or-brace (optional &optional prompt)
+  "Prompt for delimiter and text.
+If OPTIONAL, indicate optional argument in minibuffer.  PROMPT is
+a string replacing the default one when asking the user for text.
+This function is intended for \\verb like macros which take their
+argument in delimiters like \"\| \|\" or braces \"\{ \}\"."
+  (let ((del (read-quoted-char
+             (concat "Delimiter (default "
+                     (char-to-string LaTeX-default-verb-delimiter) "): "))))
+    (when (<= del ?\ )
+      (setq del LaTeX-default-verb-delimiter))
+    (if (TeX-active-mark)
+       (progn
+         (insert del)
+         (goto-char (mark))
+         ;; If the delimiter was an opening brace, close it with a
+         ;; brace, otherwise use the delimiter again
+         (insert (if (= del ?\{)
+                     ?\}
+                   del)))
+      ;; Same thing again
+      (insert del (read-from-minibuffer
+                  (TeX-argument-prompt optional prompt "Text"))
+             (if (= del ?\{)
+                 ?\}
+               del)))
+    ;; Do not set `LaTeX-default-verb-delimiter' if the user input was
+    ;; an opening brace.  This would give funny results for the next
+    ;; "C-c C-m \verb RET"
+    (unless (= del ?\{)
+      (setq LaTeX-default-verb-delimiter del))))
+
 (defun TeX-arg-pair (optional first second)
   "Insert a pair of number, prompted by FIRST and SECOND.
 
diff --git a/style/listings.el b/style/listings.el
index 52adba3..44c7e6e 100644
--- a/style/listings.el
+++ b/style/listings.el
@@ -1,6 +1,6 @@
 ;;; listings.el --- AUCTeX style for `listings.sty'
 
-;; Copyright (C) 2004, 2005, 2009, 2013-2017 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2009, 2013-2018 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <address@hidden>
 ;; Maintainer: address@hidden
@@ -369,7 +369,8 @@ with user-defined values via the \"lstdefinestyle\" macro."
           (LaTeX-listings-update-style-key)
           (format "%s" name))))
       (TeX-arg-key-val LaTeX-listings-key-val-options-local))
-    '("lstinline" TeX-arg-verb)
+    '("lstinline" [TeX-arg-key-val LaTeX-listings-key-val-options-local]
+      TeX-arg-verb-delim-or-brace)
     '("lstinputlisting" [TeX-arg-key-val LaTeX-listings-key-val-options-local]
       TeX-arg-file)
     "lstlistoflistings"
diff --git a/style/minted.el b/style/minted.el
index 4e4ccd2..3340efc 100644
--- a/style/minted.el
+++ b/style/minted.el
@@ -1,6 +1,6 @@
 ;;; minted.el --- AUCTeX style for `minted.sty' (v2.5)
 
-;; Copyright (C) 2014-2017 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2018 Free Software Foundation, Inc.
 
 ;; Author: Tassilo Horn <address@hidden>
 ;; Maintainer: address@hidden
@@ -286,7 +286,7 @@ are loaded."
                  (concat (cadr name-lang) "inline"))))
       (add-to-list 'TeX-auto-symbol
                   `(,lang [ TeX-arg-key-val LaTeX-minted-key-val-options-local 
]
-                         TeX-arg-verb))
+                         TeX-arg-verb-delim-or-brace))
       (add-to-list 'LaTeX-verbatim-macros-with-delims-local lang)
       (add-to-list 'LaTeX-verbatim-macros-with-braces-local lang)
       (when (and (fboundp 'font-latex-add-keywords)
@@ -368,7 +368,7 @@ a list of strings."
       LaTeX-arg-minted-language TeX-arg-verb)
     '("mintinline"
       [ TeX-arg-key-val LaTeX-minted-key-val-options-local ]
-      LaTeX-arg-minted-language TeX-arg-verb)
+      LaTeX-arg-minted-language TeX-arg-verb-delim-or-brace)
     '("newminted" ["Environment Name"] LaTeX-arg-minted-language
       (TeX-arg-key-val LaTeX-minted-key-val-options-local))
     '("newmint" ["Macro Name"] LaTeX-arg-minted-language
diff --git a/style/url.el b/style/url.el
index 9c36a07..0f4bb25 100644
--- a/style/url.el
+++ b/style/url.el
@@ -1,6 +1,6 @@
 ;;; url.el --- AUCTeX style for `url.sty'
 
-;; Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2018 Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <address@hidden>
 ;; Maintainer: address@hidden
@@ -46,8 +46,8 @@
     "UrlOrds"
     "UrlRight"
     "UrlSpecials"
-    "path"
-    "url"
+    '("path" (TeX-arg-verb-delim-or-brace "Path"))
+    '("url" (TeX-arg-verb-delim-or-brace "Url"))
     "urldef"
     '("urlstyle" TeX-arg-urlstyle))
 
@@ -60,7 +60,7 @@
    (when (and (fboundp 'font-latex-add-keywords)
              (fboundp 'font-latex-update-font-lock)
              (eq TeX-install-font-lock 'font-latex-setup))
-     (font-latex-add-keywords '(("path" "{") ("url" "{")) 'reference)
+     (font-latex-add-keywords '(("path" "") ("url" "")) 'reference)
      (font-latex-add-keywords '(("Url" "")
                                ("UrlBigBreakPenalty" "")
                                ("UrlBigBreaks" "")

-----------------------------------------------------------------------

Summary of changes:
 doc/auctex.texi   |  6 +++++-
 latex.el          | 34 +++++++++++++++++++++++++++++++++-
 style/listings.el |  5 +++--
 style/minted.el   |  6 +++---
 style/url.el      |  8 ++++----
 5 files changed, 48 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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