[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 185/299: Add completion for ProvidesPackage, ProvidesClass, and P
From: |
Stefan Monnier |
Subject: |
[elpa] 185/299: Add completion for ProvidesPackage, ProvidesClass, and ProvidesFile. |
Date: |
Sun, 02 Nov 2014 03:11:19 +0000 |
monnier pushed a commit to branch externals/auctex
in repository elpa.
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'.
---
ChangeLog | 11 +++++++++++
doc/auctex.texi | 12 ++++++++++++
latex.el | 43 ++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 65 insertions(+), 1 deletions(-)
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"
- [elpa] 177/299: Add new customizable variable TeX-insert-braces-alist., (continued)
- [elpa] 177/299: Add new customizable variable TeX-insert-braces-alist., Stefan Monnier, 2014/11/01
- [elpa] 182/299: Add indentation for tabular environment., Stefan Monnier, 2014/11/01
- [elpa] 183/299: Use enhanced tabular indentation for more envs., Stefan Monnier, 2014/11/01
- [elpa] 187/299: Fix in biblatex style file., Stefan Monnier, 2014/11/01
- [elpa] 188/299: Really fix bug in biblatex style file., Stefan Monnier, 2014/11/01
- [elpa] 189/299: Run style files of the bibliography files when inserting bibliography macros., Stefan Monnier, 2014/11/01
- [elpa] 186/299: Add narrowing commands., Stefan Monnier, 2014/11/01
- [elpa] 190/299: Document missing folding variables., Stefan Monnier, 2014/11/01
- [elpa] 193/299: void-function error fix., Stefan Monnier, 2014/11/01
- [elpa] 184/299: Mention new tabular indentation in changes.texi., Stefan Monnier, 2014/11/01
- [elpa] 185/299: Add completion for ProvidesPackage, ProvidesClass, and ProvidesFile.,
Stefan Monnier <=
- [elpa] 198/299: Declare expert macros and envs in biblatex style file., Stefan Monnier, 2014/11/01
- [elpa] 194/299: Distinguish normal and expert macros/envs., Stefan Monnier, 2014/11/01
- [elpa] 196/299: * bib-cite.el (bib-highlight-mouse): Change regexp to cope with multiple optional arguments of a macro., Stefan Monnier, 2014/11/01
- [elpa] 192/299: Revert "Distinguish common and advanced macros/envs.", Stefan Monnier, 2014/11/01
- [elpa] 197/299: Fix C-x ` (next-error) for compile commands., Stefan Monnier, 2014/11/01
- [elpa] 200/299: Fix of the fix, my fault., Stefan Monnier, 2014/11/01
- [elpa] 195/299: Better signature of expert declaration functions., Stefan Monnier, 2014/11/01
- [elpa] 204/299: Revert "Skip comment or file in parens in output.", Stefan Monnier, 2014/11/01
- [elpa] 201/299: Disable electric-pair-mode., Stefan Monnier, 2014/11/01
- [elpa] 191/299: Distinguish common and advanced macros/envs., Stefan Monnier, 2014/11/01