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