[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-devel] Add `unit' type for the parser in siunitx.el
From: |
Mosè Giordano |
Subject: |
[AUCTeX-devel] Add `unit' type for the parser in siunitx.el |
Date: |
Sat, 9 Feb 2013 02:25:46 +0100 |
Hi all,
I'm sending a patch for `siunitx.el' showing an example of using type
in style files. It need the previous patches for `latex.el' and
`tex.el' I sent to the list. Now a `unit' type is reserved for all
unit (and prefix, power, qualifier) macros used in siunitx package.
I'm able to have completion for units directly in minibuffer (there is
just one limitation: space is used as completion separator, but I
think it's acceptable) and unit macros don't flood `TeX-symbol-list'.
I tested `LaTeX-siunitx-regexp' on `siunitx.sty' file with `M-x
regexp-builder' and it is able to catch all units/prefixes/powers
defined there. `TeX-arg-siunitx-unit' function is a bit complicated,
but unit argument to siunitx commands can contain spaces. I also
check the value of some options given to siunitx package at load time
to decide whether or not to use some unit macros.
Here is ChangeLog entry:
2013-02-09 Mosè Giordano <address@hidden>
* siunitx.el ("siunitx-unit"): New type for the parser.
(LaTeX-siunitx-regexp): New variable.
(LaTeX-auto-siunitx-unit): New variable.
(LaTeX-siunitx-prepare): New function.
(LaTeX-siunitx-cleanup): New function.
(TeX-auto-prepare-hook): Add `LaTeX-siunitx-prepare' function.
(TeX-auto-cleanup-hook): Add `LaTeX-siunitx-cleanup' function.
(TeX-arg-siunitx-unit): New function.
(TeX-arg-define-siunitx-unit): New function.
("siunitx"): Add `LaTeX-siunitx-regexp' to list of regexps used for
parsing.
("siunitx"): Use `TeX-arg-siunitx-unit' and
`TeX-arg-define-siunitx-unit' functions.
("siunitx"): Use `LaTeX-add-siunitx-units' for adding siunitx unit
macros to the list of known units.
Bye,
Mosè Giordano
siunitx.el.patch
Description: Binary data
- [AUCTeX-devel] Add `unit' type for the parser in siunitx.el,
Mosè Giordano <=
- Re: [AUCTeX-devel] Add `unit' type for the parser in siunitx.el, Mosè Giordano, 2013/02/09
- Re: [AUCTeX-devel] Add `unit' type for the parser in siunitx.el, Mosè Giordano, 2013/02/10
- Re: [AUCTeX-devel] Add `unit' type for the parser in siunitx.el, Tassilo Horn, 2013/02/12
- Re: [AUCTeX-devel] Add `unit' type for the parser in siunitx.el, Mosè Giordano, 2013/02/13
- Re: [AUCTeX-devel] Add `unit' type for the parser in siunitx.el, Tassilo Horn, 2013/02/13
- Re: [AUCTeX-devel] Add `unit' type for the parser in siunitx.el, Mosè Giordano, 2013/02/13
- Re: [AUCTeX-devel] Add `unit' type for the parser in siunitx.el, Tassilo Horn, 2013/02/13
- Re: [AUCTeX-devel] Add `unit' type for the parser in siunitx.el, Mosè Giordano, 2013/02/13
- Re: [AUCTeX-devel] Add `unit' type for the parser in siunitx.el, Mosè Giordano, 2013/02/23
- Re: [AUCTeX-devel] Add `unit' type for the parser in siunitx.el, Tassilo Horn, 2013/02/24