auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] [SCM] GNU AUCTeX branch, master, updated. 7414b46c182074b


From: Mosè Giordano
Subject: [AUCTeX-diffs] [SCM] GNU AUCTeX branch, master, updated. 7414b46c182074b5499331dca8606cd635d10e92
Date: Sat, 19 Oct 2013 15:13:23 +0000

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  7414b46c182074b5499331dca8606cd635d10e92 (commit)
      from  8a557b0c00a08fba4d2cc5ab5a6c869d8d09405e (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 7414b46c182074b5499331dca8606cd635d10e92
Author: Mosè Giordano <address@hidden>
Date:   Sat Oct 19 17:11:28 2013 +0200

    Add completion for ProvidesPackage, ProvidesClass, and ProvidesFile.
    
    * latex.el (TeX-arg-file-name): New function.
    (TeX-arg-file-name-sans-extension): Ditto.
    (TeX-arg-version): Ditto.
    (LaTeX-common-initialization): Add completion for
    `ProvidesPackage', `ProvidesClass', and `ProvidesFile'.
    
    * doc/auctex.texi (Adding Macros): Document `TeX-arg-version',
    `TeX-arg-file-name', and `TeX-arg-file-name-sans-extension'.

diff --git a/ChangeLog b/ChangeLog
index 422f7ee..570fafe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2013-10-19  Mosè Giordano  <address@hidden>
+
+       * latex.el (TeX-arg-file-name): New function.
+       (TeX-arg-file-name-sans-extension): Ditto.
+       (TeX-arg-version): Ditto.
+       (LaTeX-common-initialization): Add completion for
+       `ProvidesPackage', `ProvidesClass', and `ProvidesFile'.
+
+       * doc/auctex.texi (Adding Macros): Document `TeX-arg-version',
+       `TeX-arg-file-name', and `TeX-arg-file-name-sans-extension'.
+
 2013-10-14  Tassilo Horn  <address@hidden>
 
        * doc/changes.texi: Mention the enhanced tabular indentation.
diff --git a/doc/auctex.texi b/doc/auctex.texi
index b664602..f3b6b41 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -4188,6 +4188,10 @@ Prompt for a @TeX{} macro with completion.
 @item TeX-arg-date
 Prompt for a date, defaulting to the current date.
 
address@hidden TeX-arg-version
+Prompt for the version of a file, using as initial input the current
+date.
+
 @item TeX-arg-environment
 Prompt for a @LaTeX{} environment with completion.
 
@@ -4206,6 +4210,14 @@ Prompt for a @LaTeX{} savebox completing with known 
saveboxes.
 Prompt for a filename in the current directory, and use it without the
 extension.
 
address@hidden TeX-arg-file-name
+Prompt for a filename and use as initial input the name of the file
+being visited in the current buffer, with extension.
+
address@hidden TeX-arg-file-name-sans-extension
+Prompt for a filename and use as initial input the name of the file
+being visited in the current buffer, without extension.
+
 @item TeX-arg-input-file
 @vindex TeX-arg-input-file-search
 Prompt for the name of an input file in @TeX{}'s search path, and use it
diff --git a/latex.el b/latex.el
index 2d28859..98d15a0 100644
--- a/latex.el
+++ b/latex.el
@@ -1708,6 +1708,29 @@ string."
                                       "" "" nil)
                       optional))
 
+(defun TeX-arg-file-name (optional &optional prompt)
+  "Prompt for a file name.
+Initial input is the name of the file being visited in the
+current buffer, with extension.  If OPTIONAL is non-nil, insert
+it as an optional argument.  Use PROMPT as the prompt string."
+  (TeX-argument-insert
+   (TeX-read-string
+    (TeX-argument-prompt optional prompt "Name")
+    (file-name-nondirectory buffer-file-name))
+   optional))
+
+(defun TeX-arg-file-name-sans-extension (optional &optional prompt)
+  "Prompt for a file name.
+Initial input is the name of the file being visited in the
+current buffer, without extension.  If OPTIONAL is non-nil,
+insert it as an optional argument.  Use PROMPT as the prompt
+string."
+  (TeX-argument-insert
+   (TeX-read-string
+    (TeX-argument-prompt optional prompt "Name")
+    (file-name-sans-extension (file-name-nondirectory buffer-file-name)))
+   optional))
+
 (defun TeX-arg-define-label (optional &optional prompt)
   "Prompt for a label completing with known labels.
 If OPTIONAL is non-nil, insert the resulting value as an optional
@@ -2085,6 +2108,16 @@ string."
                      nil nil default)
      optional)))
 
+(defun TeX-arg-version (optional &optional prompt)
+  "Prompt for the version of a file.
+Use as initial input the current date.  If OPTIONAL is non-nil,
+insert the resulting value as an optional argument, otherwise as
+a mandatory one.  Use PROMPT as the prompt string."
+  (TeX-argument-insert
+   (TeX-read-string (TeX-argument-prompt optional prompt "Version")
+                   (format-time-string "%Y/%m/%d" (current-time)))
+   optional))
+
 (defun TeX-arg-pagestyle (optional &optional prompt definition)
   "Prompt for a LaTeX pagestyle with completion.
 If OPTIONAL is non-nil, insert the resulting value as an optional
@@ -5897,7 +5930,15 @@ i.e. you do _not_ have to cater for this yourself by 
adding \\\\' or $."
        [ "Number of arguments" ] [ "Default value for first argument" ] t)
      '("usepackage" LaTeX-arg-usepackage)
      '("RequirePackage" LaTeX-arg-usepackage)
-     '("ProvidesPackage" "Name" [ "Version" ])
+     '("ProvidesPackage" (TeX-arg-file-name-sans-extension "Package name")
+       [ TeX-arg-conditional (y-or-n-p "Insert version? ")
+                            ([ TeX-arg-version ]) nil])
+     '("ProvidesClass" (TeX-arg-file-name-sans-extension "Class name")
+       [ TeX-arg-conditional (y-or-n-p "Insert version? ")
+                            ([ TeX-arg-version ]) nil])
+     '("ProvidesFile" (TeX-arg-file-name "File name")
+       [ TeX-arg-conditional (y-or-n-p "Insert version? ")
+                            ([ TeX-arg-version ]) nil ])
      '("documentclass" TeX-arg-document)))
 
   (TeX-add-style-hook "latex2e"

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

Summary of changes:
 ChangeLog       |   11 +++++++++++
 doc/auctex.texi |   12 ++++++++++++
 latex.el        |   43 ++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 65 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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