auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] a LaTeX-env-usepackage environment


From: Carlos
Subject: Re: [AUCTeX-devel] a LaTeX-env-usepackage environment
Date: Sun, 16 Feb 2014 04:25:48 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Mosè:

Do you see the line (TeX-add-to-alist 'LaTeX-provided-package-options ? in

+(defun LaTeX-arg-usepackage-insert (packages options)
+  "Actually insert arguments to usepackage."
+  (unless (zerop (length options))
+    (let ((opts (LaTeX-listify-package-options options)))
+      (mapc (lambda (elt)
+             (TeX-add-to-alist 'LaTeX-provided-package-options
+                               (list (cons elt opts))))
+           packages))
+    (insert LaTeX-optop options LaTeX-optcl))
+  (insert TeX-grop (mapconcat 'identity packages ",") TeX-grcl)
+  (run-hooks 'LaTeX-after-usepackage-hook))

Well, long story short, every time I would try to insert the options for
the package, say for example, for the inputenc package, like utf8,
utf8x, etc., it would throw a "symbol's definition is void " error.

So, I said, enough with my faulty reasoning, and I went ahead and
modified it as well to:

(defun LaTeX-arg-usepackage-insert (packages options)
  "Actually insert arguments to usepackage."
  (unless (zerop (length options))
    (let ((opts (LaTeX-listify-package-options options)))
          (mapc 'TeX-run-style-hooks (LaTeX-listify-package-options options))   
    packages)
    (insert LaTeX-optop options LaTeX-optcl))
  (insert TeX-grop (mapconcat 'identity packages ",") TeX-grcl)
  (run-hooks 'LaTeX-after-usepackage-hook))


Now, that did it. If only my emacs could sing. Of course, needless to
say, you can give it the last touch as you wish.

Mosè, that was a monumental achievement!






reply via email to

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