[AUCTeX-devel] [PATCH] Various patches

2016-01-24 Thread Arash Esbati
Hi all,

please find attached 4 patches improving some styles I touched recently.
My apologies for not getting it right last time.

* style/enumitem.el (LaTeX-enumitem-newlist-list)
(LaTeX-enumitem-newlist-list-item-arg)
(LaTeX-auto-enumitem-newlist): Remove variables.
(LaTeX-enumitem-newlist-list-local): Fix docstring.
(LaTeX-enumitem-auto-cleanup): Plug \newlist into AUCTeX parser.
("enumitem"): Offer only enumerated environments as completion for
\restartlist.

* style/theorem.el (LaTeX-theorem-fontdecl): Do not prefix the
elements with `TeX-esc'.
(LaTeX-arg-theorem-fontdecl): New function.
("theorem"): Use `LaTeX-arg-theorem-fontdecl' for font related
queries.

* style/ntheorem.el (LaTeX-ntheorem-fontdecl): Do not prefix the
elements with `TeX-esc'.
(LaTeX-arg-ntheorem-fontdecl): New function.
("ntheorem"): Use `LaTeX-arg-ntheorem-fontdecl' for font related
queries.

* style/amsthm.el (LaTeX-amsthm-fontdecl): Do not prefix the
elements with `TeX-esc'.
(LaTeX-arg-amsthm-fontdecl): New function.
("amsthm"): Use `LaTeX-arg-amsthm-fontdecl' for font related
queries.

Best, Arash

>From e313d690b13d83a3b9e0d2290758af6e3f061a3c Mon Sep 17 00:00:00 2001
From: Arash Esbati 
Date: Sat, 23 Jan 2016 17:05:12 +0100
Subject: [PATCH 1/4] Improve font related queries

* style/amsthm.el (LaTeX-amsthm-fontdecl): Do not prefix the
elements with `TeX-esc'.
(LaTeX-arg-amsthm-fontdecl): New function.
("amsthm"): Use `LaTeX-arg-amsthm-fontdecl' for font related
queries.
---
 style/amsthm.el | 50 --
 1 file changed, 28 insertions(+), 22 deletions(-)

diff --git a/style/amsthm.el b/style/amsthm.el
index a01cfe3..5c83724 100644
--- a/style/amsthm.el
+++ b/style/amsthm.el
@@ -40,21 +40,34 @@
 defined with \"\\newtheoremstyle\".")
 
 (defvar LaTeX-amsthm-fontdecl
-  (mapcar (lambda (elt) (concat TeX-esc elt))
-	  '(;; family
-	"rmfamily" "sffamily" "ttfamily"
-	;; series
-	"mdseries" "bfseries"
-	;; shape
-	"upshape" "itshape" "slshape" "scshape"
-	;; size
-	"tiny"  "scriptsize" "footnotesize"
-	"small" "normalsize" "large"
-	"Large" "LARGE" "huge" "Huge"
-	;; reset macro
-	"normalfont"))
+  '(;; family
+"rmfamily" "sffamily" "ttfamily"
+;; series
+"mdseries" "bfseries"
+;; shape
+"upshape" "itshape" "slshape" "scshape"
+;; size
+"tiny"  "scriptsize" "footnotesize"
+"small" "normalsize" "large"
+"Large" "LARGE" "huge" "Huge"
+;; reset macro
+"normalfont")
   "List of font declaration commands for \"\\newtheoremstyle\".")
 
+(defun LaTeX-arg-amsthm-fontdecl (optional  prompt)
+  "Prompt for font declaration commands in \"\\newtheoremstyle\".
+If OPTIONAL is non-nil, insert the resulting value as an optional
+argument.  Use PROMPT as the prompt string."
+  ;; `INITIAL-INPUT' (5th argument to `TeX-completing-read-multiple')
+  ;; is hard-coded to `TeX-esc'.
+  (let* ((crm-separator (regexp-quote TeX-esc))
+	 (fontdecl (mapconcat 'identity
+			  (TeX-completing-read-multiple
+			   (TeX-argument-prompt optional prompt "Font")
+			   LaTeX-amsthm-fontdecl nil nil TeX-esc)
+			  TeX-esc)))
+(TeX-argument-insert fontdecl optional)))
+
 (defun LaTeX-amsthm-env-label (environment)
   "Insert ENVIRONMENT, query for an optional argument and prompt
 for label.  AUCTeX users should add ENVIRONMENT to
@@ -161,16 +174,9 @@ make them available as new environments.  Update
 	   (format "%s" nthmstyle
   (TeX-arg-length "Space above")
   (TeX-arg-length "Space below")
-  (TeX-arg-eval mapconcat 'identity
-		(TeX-completing-read-multiple
-		 "Body font: "
-		 LaTeX-amsthm-fontdecl) "")
+  (LaTeX-arg-amsthm-fontdecl "Body font")
   "Indent amount"
-  (TeX-arg-eval mapconcat 'identity
-		(TeX-completing-read-multiple
-		 "Theorem head font: "
-		 LaTeX-amsthm-fontdecl) "")
-
+  (LaTeX-arg-amsthm-fontdecl "Theorem head font")
   "Punctuation after head"
   (TeX-arg-length "Space after head")
   "Theorem head spec"))
-- 
2.7.0

>From 74a74a7e7bb03e23178759cb849daf1e64d13259 Mon Sep 17 00:00:00 2001
From: Arash Esbati 
Date: Sat, 23 Jan 2016 17:07:52 +0100
Subject: [PATCH 2/4] Improve font related queries

* style/ntheorem.el (LaTeX-ntheorem-fontdecl): Do not prefix the
elements with `TeX-esc'.
(LaTeX-arg-ntheorem-fontdecl): New function.
("ntheorem"): Use `LaTeX-arg-ntheorem-fontdecl' for font related
queries.
---
 style/ntheorem.el | 49 -
 1 file changed, 28 insertions(+), 21 deletions(-)

diff --git a/style/ntheorem.el b/style/ntheorem.el
index cedc5a8..630c09b 100644
--- a/style/ntheorem.el
+++ b/style/ntheorem.el
@@ -49,21 +49,34 @@ defined with \"\\newtheoremstyle\".")
 defined with \"\\newtheoremlisttype\".")
 
 (defvar LaTeX-ntheorem-fontdecl
-  (mapcar (lambda (elt) (concat TeX-esc elt))
-	  '(;; family
-	"rmfamily" "sffamily" "ttfamily"
-	   

Re: [AUCTeX-devel] [PATCH] Various patches

2016-01-24 Thread Mosè Giordano
Hi Arash,

2016-01-24 10:42 GMT+01:00 Arash Esbati :
> Hi all,
>
> please find attached 4 patches improving some styles I touched recently.
> My apologies for not getting it right last time.
>
> * style/enumitem.el (LaTeX-enumitem-newlist-list)
> (LaTeX-enumitem-newlist-list-item-arg)
> (LaTeX-auto-enumitem-newlist): Remove variables.
> (LaTeX-enumitem-newlist-list-local): Fix docstring.
> (LaTeX-enumitem-auto-cleanup): Plug \newlist into AUCTeX parser.
> ("enumitem"): Offer only enumerated environments as completion for
> \restartlist.
>
> * style/theorem.el (LaTeX-theorem-fontdecl): Do not prefix the
> elements with `TeX-esc'.
> (LaTeX-arg-theorem-fontdecl): New function.
> ("theorem"): Use `LaTeX-arg-theorem-fontdecl' for font related
> queries.
>
> * style/ntheorem.el (LaTeX-ntheorem-fontdecl): Do not prefix the
> elements with `TeX-esc'.
> (LaTeX-arg-ntheorem-fontdecl): New function.
> ("ntheorem"): Use `LaTeX-arg-ntheorem-fontdecl' for font related
> queries.
>
> * style/amsthm.el (LaTeX-amsthm-fontdecl): Do not prefix the
> elements with `TeX-esc'.
> (LaTeX-arg-amsthm-fontdecl): New function.
> ("amsthm"): Use `LaTeX-arg-amsthm-fontdecl' for font related
> queries.
>
> Best, Arash

Patches installed, thanks!

Bye,
Mosè

___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] [PATCH] Various patches

2015-11-30 Thread Mosè Giordano
Hi Arash,

2015-11-28 18:38 GMT+01:00 Arash Esbati :
> Hi Tassilo,
>
> Tassilo Horn  writes:
>
>> Arash Esbati  writes:
>>
>>> please find attached 4 patch sets containing:
>>>
>>> * Makefile.in (STYLESRC): Add new style.
>>>
>>> * style/ntheorem.el: New file.
>>>
>>> * Makefile.in (STYLESRC): Add new style.
>>>
>>> * style/theorem.el: New file.
>>>
>>> * style/amsthm.el (LaTeX-amsthm-fontdecl): Cover all font changing
>>> declarations.
>>> ("amsthm"): Overrule the defintion for \newtheorem in `latex.el'.
>>> ("amsthm"): Use `TeX-completing-read-multiple' for font related
>>> queries.
>>>
>>> * style/hologo.el: Fix the file name in header.
>>
>> Great, thanks a lot.  I've applied and pushed them.
>
> Thanks for installing them.  I found a small bug in 2 files, could you
> please apply the attached patch as well?

It would be great if all bugs were simply wrongly named prompts ;-)
Patch installed, thank you.

Bye,
Mosè

___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] [PATCH] Various patches

2015-11-28 Thread Arash Esbati
Hi Tassilo,

Tassilo Horn  writes:

> Arash Esbati  writes:
>
>> please find attached 4 patch sets containing:
>>
>> * Makefile.in (STYLESRC): Add new style.
>>
>> * style/ntheorem.el: New file.
>>
>> * Makefile.in (STYLESRC): Add new style.
>>
>> * style/theorem.el: New file.
>>
>> * style/amsthm.el (LaTeX-amsthm-fontdecl): Cover all font changing
>> declarations.
>> ("amsthm"): Overrule the defintion for \newtheorem in `latex.el'.
>> ("amsthm"): Use `TeX-completing-read-multiple' for font related
>> queries.
>>
>> * style/hologo.el: Fix the file name in header.
>
> Great, thanks a lot.  I've applied and pushed them.

Thanks for installing them.  I found a small bug in 2 files, could you
please apply the attached patch as well?

TIA, Arash

>From 3ce4fafca9e5011cf4efb94ecea1d1d11180facb Mon Sep 17 00:00:00 2001
From: Arash Esbati 
Date: Sat, 28 Nov 2015 18:32:43 +0100
Subject: [PATCH] Fix query prompt

* style/ntheorem.el ("ntheorem"):
* style/theorem.el ("theorem"): Fix wrong query prompt.
---
 style/ntheorem.el | 2 +-
 style/theorem.el  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/style/ntheorem.el b/style/ntheorem.el
index 6be49b7..cedc5a8 100644
--- a/style/ntheorem.el
+++ b/style/ntheorem.el
@@ -198,7 +198,7 @@ make them available as new environments.  Update
 '("theoremheaderfont"
   (TeX-arg-eval mapconcat 'identity
 		(TeX-completing-read-multiple
-		 "Body font: "
+		 "Header font: "
 		 LaTeX-ntheorem-fontdecl) ""))
 
 '("theoremnumbering"
diff --git a/style/theorem.el b/style/theorem.el
index e422122..7d8bffd 100644
--- a/style/theorem.el
+++ b/style/theorem.el
@@ -141,7 +141,7 @@ make them available as new environments."
 '("theoremheaderfont"
   (TeX-arg-eval mapconcat 'identity
 		(TeX-completing-read-multiple
-		 "Body font: "
+		 "Header font: "
 		 LaTeX-theorem-fontdecl) ""))
 
 '("theorempreskipamount"
-- 
2.6.3

___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] [PATCH] Various patches

2015-11-23 Thread Tassilo Horn
Arash Esbati  writes:

Hi Arash,

> please find attached 4 patch sets containing:
>
> * Makefile.in (STYLESRC): Add new style.
>
> * style/ntheorem.el: New file.
>
> * Makefile.in (STYLESRC): Add new style.
>
> * style/theorem.el: New file.
>
> * style/amsthm.el (LaTeX-amsthm-fontdecl): Cover all font changing
> declarations.
> ("amsthm"): Overrule the defintion for \newtheorem in `latex.el'.
> ("amsthm"): Use `TeX-completing-read-multiple' for font related
> queries.
>
> * style/hologo.el: Fix the file name in header.

Great, thanks a lot.  I've applied and pushed them.

Bye,
Tassilo


___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


[AUCTeX-devel] [PATCH] Various patches

2015-11-21 Thread Arash Esbati
Hi all,

please find attached 4 patch sets containing:

* Makefile.in (STYLESRC): Add new style.

* style/ntheorem.el: New file.

* Makefile.in (STYLESRC): Add new style.

* style/theorem.el: New file.

* style/amsthm.el (LaTeX-amsthm-fontdecl): Cover all font changing
declarations.
("amsthm"): Overrule the defintion for \newtheorem in `latex.el'.
("amsthm"): Use `TeX-completing-read-multiple' for font related
queries.

* style/hologo.el: Fix the file name in header.

Any comments welcome.

Best, Arash

>From 615e1867757fc83297f8382ea6421eb02335dc53 Mon Sep 17 00:00:00 2001
From: Arash Esbati 
Date: Sat, 21 Nov 2015 22:15:38 +0100
Subject: [PATCH 1/4] ; Fix a typo in header

* style/hologo.el: Fix the file name in header.
---
 style/hologo.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/style/hologo.el b/style/hologo.el
index 1795870..64031cb 100644
--- a/style/hologo.el
+++ b/style/hologo.el
@@ -1,4 +1,4 @@
-;;; holog.el --- AUCTeX style for `hologo.sty' (v1.10)
+;;; hologo.el --- AUCTeX style for `hologo.sty' (v1.10)
 
 ;; Copyright (C) 2015 Free Software Foundation, Inc.
 
-- 
2.6.3

>From f9c9ae8f3c77b48f3cb2915a85d34bfb61fd3cbb Mon Sep 17 00:00:00 2001
From: Arash Esbati 
Date: Sat, 21 Nov 2015 22:21:02 +0100
Subject: [PATCH 2/4] Improve style/amsthm.el

* style/amsthm.el (LaTeX-amsthm-fontdecl): Cover all font changing
declarations.
("amsthm"): Overrule the defintion for \newtheorem in `latex.el'.
("amsthm"): Use `TeX-completing-read-multiple' for font related
queries.
---
 style/amsthm.el | 48 +++-
 1 file changed, 39 insertions(+), 9 deletions(-)

diff --git a/style/amsthm.el b/style/amsthm.el
index 8bc33d4..a01cfe3 100644
--- a/style/amsthm.el
+++ b/style/amsthm.el
@@ -41,9 +41,18 @@ defined with \"\\newtheoremstyle\".")
 
 (defvar LaTeX-amsthm-fontdecl
   (mapcar (lambda (elt) (concat TeX-esc elt))
-	  '("itshape" "bfseries" "scshape"
-	"ttfamily" "upshape" "mdseries"
-	"rmfamily" "sffamily" "slshape"))
+	  '(;; family
+	"rmfamily" "sffamily" "ttfamily"
+	;; series
+	"mdseries" "bfseries"
+	;; shape
+	"upshape" "itshape" "slshape" "scshape"
+	;; size
+	"tiny"  "scriptsize" "footnotesize"
+	"small" "normalsize" "large"
+	"Large" "LARGE" "huge" "Huge"
+	;; reset macro
+	"normalfont"))
   "List of font declaration commands for \"\\newtheoremstyle\".")
 
 (defun LaTeX-amsthm-env-label (environment)
@@ -106,6 +115,23 @@ make them available as new environments.  Update
(LaTeX-add-environments
 '("proof" LaTeX-amsthm-env-label))
(TeX-add-symbols
+;; Overrule the defintion in `latex.el':
+'("newtheorem"
+  (TeX-arg-eval
+   (lambda ()
+	 (let ((nthm (TeX-read-string
+		  (TeX-argument-prompt nil nil "Environment"
+	   (LaTeX-add-amsthm-newtheorems nthm)
+	   (LaTeX-add-environments (list nthm 'LaTeX-theorem-env-label))
+	   (format "%s" nthm
+  [ TeX-arg-environment "Numbered like" ]
+  t [ (TeX-arg-eval progn (if (eq (save-excursion
+	(backward-char 2)
+	(preceding-char)) ?\])
+  ()
+(TeX-arg-counter t "Within counter"))
+			"") ])
+
 '("newtheorem*"
   (TeX-arg-eval
(lambda ()
@@ -119,8 +145,7 @@ make them available as new environments.  Update
 	   (format "%s" heading)
 
 '("theoremstyle"
-  (TeX-arg-eval completing-read
-		"Style: "
+  (TeX-arg-eval completing-read "Style: "
 		LaTeX-amsthm-theoremstyle-list))
 "qedhere"
 "swapnumbers"
@@ -136,11 +161,16 @@ make them available as new environments.  Update
 	   (format "%s" nthmstyle
   (TeX-arg-length "Space above")
   (TeX-arg-length "Space below")
-  (TeX-arg-eval completing-read
-		"Body font: " LaTeX-amsthm-fontdecl)
+  (TeX-arg-eval mapconcat 'identity
+		(TeX-completing-read-multiple
+		 "Body font: "
+		 LaTeX-amsthm-fontdecl) "")
   "Indent amount"
-  (TeX-arg-eval completing-read
-		"Theorem head font: " LaTeX-amsthm-fontdecl)
+  (TeX-arg-eval mapconcat 'identity
+		(TeX-completing-read-multiple
+		 "Theorem head font: "
+		 LaTeX-amsthm-fontdecl) "")
+
   "Punctuation after head"
   (TeX-arg-length "Space after head")
   "Theorem head spec"))
-- 
2.6.3

>From 746103ae245cdbf3dc964498aeb32ec84d73696a Mon Sep 17 00:00:00 2001
From: Arash Esbati 
Date: Sat, 21 Nov 2015 22:24:50 +0100
Subject: [PATCH 3/4] Add new style/theorem.el

* Makefile.in (STYLESRC): Add new style.

* style/theorem.el: New file.
---
 Makefile.in  |   2 +-
 style/theorem.el | 167 +++
 2 files changed, 168 insertions(+), 1 deletion(-)
 create mode 100644 style/theorem.el

diff --git a/Makefile.in b/Makefile.in
index 25b9dba..2ace810 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -153,7 +153,7 @@ STYLESRC = style/prosper.el \
 	   style/vwcol.el style/textpos.el   

[AUCTeX-devel] [PATCH] Various patches

2015-10-08 Thread Arash Esbati
Hi all,

please find attached 4 patches covering:

* style/longtable.el ("longtable"): Use `LaTeX-add-counters' on
"LTchunksize" and not `TeX-add-symbols'.

* style/enumitem.el (LaTeX-arg-SetEnumitemKey): Remove unused
`prompt' from arguments list.
(LaTeX-arg-SetEnumitemValue): ditto.

* style/listings.el (LaTeX-listings-key-val-options-local): New
variable used for all key-val queries.
("listings-lstdefinestyle"): Add parsing support for
"\lstdefinestyle".
(LaTeX-listings-lstnewenvironment-regexp): Add missing "s" to
"listing".
(LaTeX-listings-update-style-key): New function adding newly
defined values to "style" key in
`LaTeX-listings-key-val-options-local'.
("listings"): Extend "lstdefinestyle".

* style/wrapfig.el ("wrapfig"): Check for new floating
environments definded through "newfloat.el" and offer them as
completion to "wrapfloat" environment.

As always any comments welcome and my apologies for missing the change
in `longtable' last time.

Best, Arash

>From 90bbbfb68f219c0a47314eec6d11c066c2cd22a1 Mon Sep 17 00:00:00 2001
From: Arash Esbati 
Date: Thu, 8 Oct 2015 21:53:17 +0200
Subject: [PATCH 1/4] Support newfloat.el.

* style/wrapfig.el ("wrapfig"): Check for new floating
environments definded through "newfloat.el" and offer them as
completion to "wrapfloat" environment.
---
 ChangeLog|  6 ++
 style/wrapfig.el | 15 +--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b287587..62199eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-10-08  Arash Esbati  
+
+	* style/wrapfig.el ("wrapfig"): Check for new floating
+	environments definded through "newfloat.el" and offer them as
+	completion to "wrapfloat" environment.
+
 2015-10-05  Mosè Giordano  
 
 	* context.el (TeX-ConTeXt-sentinel): Parse ConTeXt Mark IV output.
diff --git a/style/wrapfig.el b/style/wrapfig.el
index 097e5ad..64bb265 100644
--- a/style/wrapfig.el
+++ b/style/wrapfig.el
@@ -1,6 +1,6 @@
 ;;; wrapfig.el --- AUCTeX style for `wrapfig.sty' version v3.6
 
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2015 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati 
 ;; Maintainer: auctex-devel@gnu.org
@@ -78,11 +78,22 @@
 	(format "{%s}" width))
 ;;
 ;; \begin{wrapfloat}{}[No.lines]{Placement}[Overhang]{Width} ... \end{wrapfloat}
+;;
+;;  can be a new floating environment defined with
+;; "\DeclareFloatingEnvironment" from newfloat.el.  We check if
+;; the function `LaTeX-newfloat-DeclareFloatingEnvironment-list'
+;; is bound and returns non-nil before offering environment for
+;; completion.  Otherwise, just ask user without completion.
 '("wrapfloat"
   (lambda (env  ignore)
 	(LaTeX-insert-environment
 	 env
-	 (let ((floattype (TeX-read-string "Float type: "))
+	 (let ((floattype (if (and (fboundp 'LaTeX-newfloat-DeclareFloatingEnvironment-list)
+   (LaTeX-newfloat-DeclareFloatingEnvironment-list))
+			  (completing-read
+			   "Float type: "
+			   (mapcar 'car (LaTeX-newfloat-DeclareFloatingEnvironment-list)))
+			(TeX-read-string "Float type: ")))
 	   (narrow(TeX-read-string "(Optional) Number of narrow lines: "))
 	   (placement (completing-read
 			   "Placement: " '(("r") ("R")
-- 
2.6.0

>From 45bc65d6adfdfe05c33b1d037e186da9b994af41 Mon Sep 17 00:00:00 2001
From: Arash Esbati 
Date: Thu, 8 Oct 2015 22:08:03 +0200
Subject: [PATCH 2/4] Add user-defined values to "style" key.

* style/listings.el (LaTeX-listings-key-val-options-local): New
variable used for all key-val queries.
("listings-lstdefinestyle"): Add parsing support for
"\lstdefinestyle".
(LaTeX-listings-lstnewenvironment-regexp): Add missing "s" to
"listing".
(LaTeX-listings-update-style-key): New function adding newly
defined values to "style" key in
`LaTeX-listings-key-val-options-local'.
("listings"): Extend "lstdefinestyle".
---
 ChangeLog | 11 +
 style/listings.el | 70 ++-
 2 files changed, 70 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 62199eb..f699850 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2015-10-08  Arash Esbati  
 
+	* style/listings.el (LaTeX-listings-key-val-options-local): New
+	variable used for all key-val queries.
+	("listings-lstdefinestyle"): Add parsing support for
+	"\lstdefinestyle".
+	(LaTeX-listings-lstnewenvironment-regexp): Add missing "s" to
+	"listing".
+	(LaTeX-listings-update-style-key): New function adding newly
+	defined values to "style" key in
+	`LaTeX-listings-key-val-options-local'.
+	("listings"): Extend "lstdefinestyle".
+
 	* style/wrapfig.el ("wrapfig"): Check for new floating
 	environments definded through "newfloat.el" and offer them as
 	completion to "wrapfloat" environment.
diff --git a/style/listings.el b/style/listings.el

Re: [AUCTeX-devel] [PATCH] Various patches

2015-10-08 Thread Mosè Giordano
Hi Arash,

2015-10-08 22:41 GMT+02:00 Arash Esbati :
> Hi all,
>
> please find attached 4 patches covering:
>
> * style/longtable.el ("longtable"): Use `LaTeX-add-counters' on
> "LTchunksize" and not `TeX-add-symbols'.
>
> * style/enumitem.el (LaTeX-arg-SetEnumitemKey): Remove unused
> `prompt' from arguments list.
> (LaTeX-arg-SetEnumitemValue): ditto.
>
> * style/listings.el (LaTeX-listings-key-val-options-local): New
> variable used for all key-val queries.
> ("listings-lstdefinestyle"): Add parsing support for
> "\lstdefinestyle".
> (LaTeX-listings-lstnewenvironment-regexp): Add missing "s" to
> "listing".
> (LaTeX-listings-update-style-key): New function adding newly
> defined values to "style" key in
> `LaTeX-listings-key-val-options-local'.
> ("listings"): Extend "lstdefinestyle".
>
> * style/wrapfig.el ("wrapfig"): Check for new floating
> environments definded through "newfloat.el" and offer them as
> completion to "wrapfloat" environment.
>
> As always any comments welcome and my apologies for missing the change
> in `longtable' last time.

Patches installed, thanks!

Bye,
Mosè

___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] [PATCH] Various patches

2015-09-25 Thread Tassilo Horn
Arash Esbati  writes:

Hi Arash,

> please find attaches some patches.

Thanks a lot, I've applied and pushed your changes.

Bye,
Tassilo


___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


[AUCTeX-devel] [PATCH] Various patches

2015-09-25 Thread Arash Esbati
Hi all,

please find attaches some patches.  From the ChangeLog:

* Makefile.in (STYLESRC): Add new style.

* style/subcaption.el: New file.

* style/caption.el (LaTeX-caption-key-val-options): Fix values of hypcap-key.
(LaTeX-caption-update-key-val-options): Add support for
subcaption.el if loaded.
(LaTeX-arg-caption-captionbox): Do not query for the third
optional arg. if the second one is empty.
("caption"): Add support for all lowercase \continuedfloat*?.
("caption"): Fix fontification for \captionof.

* style/hyperref.el ("hyperref"): Make
`LaTeX-indent-environment-list' local before adding new env's.

* style/filecontents.el ("filecontents"): Make
`LaTeX-indent-environment-list' local before adding new env's.

* style/fontenc.el: Fix mail address in Maintainer-header.

As always, any comments welcome.

Best, Arash

>From 30c800350c4c5582e7e2a0585c5488435a51709d Mon Sep 17 00:00:00 2001
From: Arash Esbati 
Date: Fri, 25 Sep 2015 23:44:21 +0200
Subject: [PATCH 1/5] Fix mail address in Maintainer-header.

* style/fontenc.el: Fix mail address in Maintainer-header.
---
 ChangeLog| 4 
 style/fontenc.el | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 3fd1716..7558e4d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-09-25  Arash Esbati  
+
+	* style/fontenc.el: Fix mail address in Maintainer-header.
+
 2015-09-25  Mosè Giordano  
 
 	* latex.el (LaTeX-common-initialization): Remove "abstract"
diff --git a/style/fontenc.el b/style/fontenc.el
index 3df5e5d..c57f6d7 100644
--- a/style/fontenc.el
+++ b/style/fontenc.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2015 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati 
-;; Maintainer: address@hidden
+;; Maintainer: auctex-devel@gnu.org
 ;; Created: 2015-09-12
 ;; Keywords: tex
 
-- 
2.5.2

>From a824e8a85408c341a576c8b57fd5a72c3eb75ecb Mon Sep 17 00:00:00 2001
From: Arash Esbati 
Date: Fri, 25 Sep 2015 23:49:20 +0200
Subject: [PATCH 2/5] Make `LaTeX-indent-environment-list' local.

* style/filecontents.el ("filecontents"): Make
`LaTeX-indent-environment-list' local before adding new env's.
---
 ChangeLog | 3 +++
 style/filecontents.el | 1 +
 2 files changed, 4 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 7558e4d..488269a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-09-25  Arash Esbati  
 
+	* style/filecontents.el ("filecontents"): Make
+	`LaTeX-indent-environment-list' local before adding new env's.
+
 	* style/fontenc.el: Fix mail address in Maintainer-header.
 
 2015-09-25  Mosè Giordano  
diff --git a/style/filecontents.el b/style/filecontents.el
index 20cfa98..256c214 100644
--- a/style/filecontents.el
+++ b/style/filecontents.el
@@ -40,6 +40,7 @@
 '("filecontents" LaTeX-env-filecontents)
 '("filecontents*" LaTeX-env-filecontents))
 
+   (make-local-variable 'LaTeX-indent-environment-list)
(add-to-list 'LaTeX-indent-environment-list
 		'("filecontents" current-indentation))
(add-to-list 'LaTeX-indent-environment-list
-- 
2.5.2

>From 24047610ef720983b6aa58cb551df5a88a58356f Mon Sep 17 00:00:00 2001
From: Arash Esbati 
Date: Fri, 25 Sep 2015 23:52:51 +0200
Subject: [PATCH 3/5] Make `LaTeX-indent-environment-list' local.

* style/hyperref.el ("hyperref"): Make
`LaTeX-indent-environment-list' local before adding new env's.
---
 ChangeLog | 3 +++
 style/hyperref.el | 1 +
 2 files changed, 4 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 488269a..74a97ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2015-09-25  Arash Esbati  
 
+	* style/hyperref.el ("hyperref"): Make
+	`LaTeX-indent-environment-list' local before adding new env's.
+
 	* style/filecontents.el ("filecontents"): Make
 	`LaTeX-indent-environment-list' local before adding new env's.
 
diff --git a/style/hyperref.el b/style/hyperref.el
index 9f4d0be..630f24c 100644
--- a/style/hyperref.el
+++ b/style/hyperref.el
@@ -269,6 +269,7 @@
 
;; Do not indent the content of the "Form"-env; it is odd if the
;; whole document is indented.
+   (make-local-variable 'LaTeX-indent-environment-list)
(add-to-list 'LaTeX-indent-environment-list '("Form" current-indentation))
 
(add-to-list 'LaTeX-verbatim-macros-with-braces-local "nolinkurl")
-- 
2.5.2

>From 9bed6eab40cf3f079392d0186cc7caa53da1d498 Mon Sep 17 00:00:00 2001
From: Arash Esbati 
Date: Sat, 26 Sep 2015 00:05:03 +0200
Subject: [PATCH 4/5] Apply some fixes to caption.el.

* style/caption.el (LaTeX-caption-key-val-options): Fix values of hypcap-key.
(LaTeX-caption-update-key-val-options): Add support for
subcaption.el if loaded.
(LaTeX-arg-caption-captionbox): Do not query for the third
optional arg. if the second one is empty.
("caption"): Add support for all lowercase \continuedfloat*?.
("caption"): Fix fontification for \captionof.
---
 

Re: [AUCTeX-devel] [PATCH] Various patches

2015-08-30 Thread Mosè Giordano
Hi Arash,

2015-08-30 15:22 GMT+02:00 Arash Esbati esb...@gmx.de:
 Mosč Giordano m...@gnu.org writes:

 Hi Mosč,

 2015-08-24 22:49 GMT+02:00 Arash Esbati esb...@gmx.de:

 Regarding `TeX-arg-{opening,closing}-brace' values, we have
 `TeX-gr{op,cl}' variables, avoid using hardcoded { and }.  In
 addition, since there is an `optional' argument you may want to bind
 `TeX-arg-{opening,closing}-brace' to `LaTeX-opt{op,cl}' when
 `optional' is non-nil, but that argument is actually always mandatory
 in real cases so this could be an overkill.

 Thanks for your comments.  I went the non overkill route and used
 `TeX-gr{op,cl}' straight away.

 I will clean up the code and make a new patch this weekend.  Reg. the
 other patches, I could also re-submit them as well.  Just give me a hint
 how you want to proceed.

 It would be great if you manage to resend a full changeset, but
 working with ChangeLog conflicts is a bit tedious.

 I know now ;-)  Please find them all attached and thanks for your
 patience.

Patches installed, thank you!

Bye,
Mosè

___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] [PATCH] Various patches

2015-08-24 Thread Mosè Giordano
Hi Arash,

2015-08-24 22:49 GMT+02:00 Arash Esbati esb...@gmx.de:
 Mosè Giordano m...@gnu.org writes:

 Hi Mosè,

 2015-08-22 12:13 GMT+02:00 Arash Esbati esb...@gmx.de:
 As always, any comments welcome.

 I reviewed your patches, they're overall fine, as usual, I have only a
 minor concern about captionbox: for the label you could simply call

 (TeX-insert-macro label)

 which will do the-right-thing.

 Many thanks again for looking at this.  Indeed, `TeX-insert-macro' does
 the trick.  Now I have:

 --8---cut here---start-8---
 (defun LaTeX-arg-caption-captionbox (optional optional star prompt)
   Query for the arguments of `\\captionbox' incl. a label and
 insert them.  If STAR is t, then do not query for a `\\label' and
 insert only a caption.
   (let ((caption (TeX-read-string (TeX-argument-prompt optional prompt 
 Caption)))
 (TeX-arg-opening-brace {)
 (TeX-arg-closing-brace }))
 (LaTeX-indent-line)
 (insert TeX-arg-opening-brace caption)
 (unless star (TeX-insert-macro label))
 (insert TeX-arg-closing-brace))
   (let ((width (completing-read (TeX-argument-prompt t prompt Width)
   (mapcar (lambda(elt) (concat TeX-esc (car 
 elt)))
   (LaTeX-length-list
 (inpos (completing-read (TeX-argument-prompt t prompt Inner 
 position)
'(c l r s
 (cond (;; 2 optional args
(and width (not (string-equal width ))
 inpos (not (string-equal inpos )))
(insert (format [%s][%s] width inpos)))
   (;; 1st empty opt. arg, 2nd opt. arg
(and (string-equal width )
 inpos (not (string-equal inpos )))
(insert (format [][%s] inpos)))
   (;; 1st opt. arg, 2nd empty opt. arg
(and width (not (string-equal width ))
 (string-equal inpos ))
(insert (format [%s] width)))
   (t ; Do nothing if both empty
(ignore
   (LaTeX-fill-paragraph))
 --8---cut here---end---8---

Regarding `TeX-arg-{opening,closing}-brace' values, we have
`TeX-gr{op,cl}' variables, avoid using hardcoded { and }.  In
addition, since there is an `optional' argument you may want to bind
`TeX-arg-{opening,closing}-brace' to `LaTeX-opt{op,cl}' when
`optional' is non-nil, but that argument is actually always mandatory
in real cases so this could be an overkill.

 I will clean up the code and make a new patch this weekend.  Reg. the
 other patches, I could also re-submit them as well.  Just give me a hint
 how you want to proceed.

It would be great if you manage to resend a full changeset, but
working with ChangeLog conflicts is a bit tedious.  You could create a
branch from current AUCTeX master HEAD and cherry-pick one by one your
commits and fix one by one ChangeLog conflicts.  This should work.

Bye,
Mosè

___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] [PATCH] Various patches

2015-08-24 Thread Arash Esbati
Mosè Giordano m...@gnu.org writes:

Hi Mosè,

 2015-08-22 12:13 GMT+02:00 Arash Esbati esb...@gmx.de:
 As always, any comments welcome.

 I reviewed your patches, they're overall fine, as usual, I have only a
 minor concern about captionbox: for the label you could simply call

 (TeX-insert-macro label)

 which will do the-right-thing.

Many thanks again for looking at this.  Indeed, `TeX-insert-macro' does
the trick.  Now I have:

--8---cut here---start-8---
(defun LaTeX-arg-caption-captionbox (optional optional star prompt)
  Query for the arguments of `\\captionbox' incl. a label and
insert them.  If STAR is t, then do not query for a `\\label' and
insert only a caption.
  (let ((caption (TeX-read-string (TeX-argument-prompt optional prompt 
Caption)))
(TeX-arg-opening-brace {)
(TeX-arg-closing-brace }))
(LaTeX-indent-line)
(insert TeX-arg-opening-brace caption)
(unless star (TeX-insert-macro label))
(insert TeX-arg-closing-brace))
  (let ((width (completing-read (TeX-argument-prompt t prompt Width)
  (mapcar (lambda(elt) (concat TeX-esc (car 
elt)))
  (LaTeX-length-list
(inpos (completing-read (TeX-argument-prompt t prompt Inner position)
   '(c l r s
(cond (;; 2 optional args
   (and width (not (string-equal width ))
inpos (not (string-equal inpos )))
   (insert (format [%s][%s] width inpos)))
  (;; 1st empty opt. arg, 2nd opt. arg
   (and (string-equal width )
inpos (not (string-equal inpos )))
   (insert (format [][%s] inpos)))
  (;; 1st opt. arg, 2nd empty opt. arg
   (and width (not (string-equal width ))
(string-equal inpos ))
   (insert (format [%s] width)))
  (t ; Do nothing if both empty
   (ignore
  (LaTeX-fill-paragraph))
--8---cut here---end---8---

I will clean up the code and make a new patch this weekend.  Reg. the
other patches, I could also re-submit them as well.  Just give me a hint
how you want to proceed.

Best, Arash


___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


Re: [AUCTeX-devel] [PATCH] Various patches

2015-08-23 Thread Mosè Giordano
Hi Arash,

2015-08-22 12:13 GMT+02:00 Arash Esbati esb...@gmx.de:
 As always, any comments welcome.

I reviewed your patches, they're overall fine, as usual, I have only a
minor concern about captionbox: for the label you could simply call

(TeX-insert-macro label)

which will do the-right-thing.  In this way `TeX-read-label' isn't
needed anymore.!  So,

(TeX-argument-insert heading optional)

can be replaced by (didn't actually tested, but this or something
close to this should do the trick)

(insert TeX-arg-opening-brace caption)
(if star (TeX-insert-macro label))
(insert TeX-arg-closing-brace)

Just remember to let-bind the opening/closing brace depending on the
value of `optional'.

Sorry, I didn't look closely to the patch in your previous email.

Bye,
Mosè

___
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel


[AUCTeX-devel] [PATCH] Various patches

2015-08-22 Thread Arash Esbati
Hi all,

please find attached five patches, from ChangeLog:

* Makefile.in (STYLESRC): Add new style.

* style/transparent.el: New file.

* style/filecontents.el (filecontents): Do not indent the
content of the `filecontents[*]'-env.

* style/hyperref.el (hyperref): Do not indent the content of the
`Form'-env.

* style/caption.el (caption): Add support for undocumented
macros `\captionbox[*]'.
(LaTeX-arg-caption-captionbox): New function.

* style/array.el (array): Add fontification for
`\newcolumntype'.

As always, any comments welcome.

Best, Arash

From e575352a9842e8b257bf79d881bdd74d9a6db01d Mon Sep 17 00:00:00 2001
From: Arash Esbati esb...@gmx.de
Date: Sat, 22 Aug 2015 10:30:13 +0200
Subject: [PATCH 1/5] Add fontification for `\newcolumntype'.

* style/array.el (array): Add fontification for
`\newcolumntype'.
---
 ChangeLog  | 5 +
 style/array.el | 8 +++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 7201d85..c60975e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-22  Arash Esbati  esb...@gmx.de
+
+	* style/array.el (array): Add fontification for
+	`\newcolumntype'.
+
 2015-08-21  Mosè Giordano  m...@gnu.org
 
 	* tex-buf.el (TeX-check-engine): New customizable variable.
diff --git a/style/array.el b/style/array.el
index 058eb92..645371d 100644
--- a/style/array.el
+++ b/style/array.el
@@ -90,7 +90,13 @@ and make it buffer local. 
 
;; `array.sty' adds some new column specification letters.
(set (make-local-variable 'LaTeX-array-column-letters)
-	(concat LaTeX-array-column-letters m b)))
+	(concat LaTeX-array-column-letters m b))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+	  (eq TeX-install-font-lock 'font-latex-setup))
+ (font-latex-add-keywords '((newcolumntype {[{))
+			  'function)))
  LaTeX-dialect)
 
 (defvar LaTeX-array-package-options nil
-- 
2.5.0

From 05c1daf6d4f347ad5f22e752c994a80540bff803 Mon Sep 17 00:00:00 2001
From: Arash Esbati esb...@gmx.de
Date: Sat, 22 Aug 2015 11:29:27 +0200
Subject: [PATCH 2/5] Add support for \captionbox[*].

* style/caption.el (caption): Add support for undocumented
macros `\captionbox[*]'.
(LaTeX-arg-caption-captionbox): New function.
---
 ChangeLog|  4 
 style/caption.el | 60 +++-
 2 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index c60975e..4a4812e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2015-08-22  Arash Esbati  esb...@gmx.de
 
+	* style/caption.el (caption): Add support for undocumented
+	macros `\captionbox[*]'.
+	(LaTeX-arg-caption-captionbox): New function.
+
 	* style/array.el (array): Add fontification for
 	`\newcolumntype'.
 
diff --git a/style/caption.el b/style/caption.el
index 0ec6c29..3ceb2c6 100644
--- a/style/caption.el
+++ b/style/caption.el
@@ -190,6 +190,59 @@ suffix of the command.
 	   format name))
 (TeX-argument-insert name optional)))
 
+;; Support for an undocumented feature of caption.sty:
+;; `\captionbox' sets the width of the caption equal to the width of
+;; the contents (a feature provided e.g. by `threeparttable.sty').
+;; The starred version typesets the caption without label and without
+;; entry to the list of figures or tables.
+
+;; The first mandatory argument {heading} contains the caption text
+;; and the label.  For now, we check if `LaTeX-label-function' is eq
+;; to `reftex-label' and run it, otherwise run
+;; `TeX-read-label'. (Thanks to M. Giordano for implementing this
+;; function!)
+
+;; Syntax:
+;; \captionbox[list entry]{heading}[width][inner-pos]{contents}
+;; \captionbox*{heading}[width][inner-pos]{contents}
+
+(defun LaTeX-arg-caption-captionbox (optional optional star prompt)
+  Query for the arguments of `\\captionbox' incl. a label and
+insert them.  If the STAR is t, then do not query for a `\\label'
+and insert only a caption.
+  (let* ((caption (TeX-read-string (TeX-argument-prompt optional prompt Caption)))
+	 (label (unless star (if (and (boundp 'LaTeX-label-function)
+  LaTeX-label-function
+  (fboundp LaTeX-label-function)
+  (eq LaTeX-label-function 'reftex-label))
+ (funcall LaTeX-label-function nil t)
+			   (TeX-read-label optional Label t
+	 (width   (completing-read (TeX-argument-prompt t prompt Width)
+   (mapcar (lambda(elt) (concat TeX-esc (car elt)))
+	   (LaTeX-length-list
+	 (inpos   (completing-read (TeX-argument-prompt t prompt Inner position)
+   '(c l r s)))
+	 (heading (if star
+		  (format %s caption)
+		(format %s\\label{%s} caption label
+(LaTeX-indent-line)
+(TeX-argument-insert heading optional)
+(cond (;; 2 optional args
+	   (and width (not (string-equal width ))
+		inpos (not (string-equal inpos )))
+	   (insert (format [%s][%s] width inpos)))
+	  (;; 1st empty opt. arg, 2nd opt. arg
+	   (and (string-equal width )
+		inpos (not (string-equal inpos )))
+