[Top][All Lists]

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

Re: [AUCTeX-devel] Re: Completion for key=value pairs

From: Ralf Angeli
Subject: Re: [AUCTeX-devel] Re: Completion for key=value pairs
Date: Sun, 05 Apr 2009 17:55:36 +0200

* Holger Sparr (2009-03-30) writes:

> Ralf Angeli wrote:
>> Listings is more or less just a showcase.  The reason I implemented
>> `multi-prompt-key-value' is to use it in pstricks.el instead of the
>> current way pstricks.el tries to prompt for macro options.  I write
>> "tries to" because the prompting mechanism is broken and does not work
>> most of the time.
> I have not used myself pstricks.el for while. Just recently I noticed
> that in emacs-23 a:
>         (require 'cmr)
> was necessary to insert to make it work again.

I don't think this is enough.  In a freshly started Emacs and a file
using PSTricks, try to insert a pspicture environment.  In my case the
prompt of the third argument ready "Boolean" instead of "showgrid".
There seems to be a problem with the value of `parlist' in
`LaTeX-package-parameter-value'.  (In addition `compl' is let-bound but
will never be changed before its value is used.)

> I thought when looking at the source again, it was way to complicated.

This is a reason I'd like to use the new key=value completion mechanism.
However, I'm not familiar with the features the current prompting
mechanism in pstricks.el provides, since I could not try it.  Ideally
the key=value completion should at least be on par with it.

>> Anyway, I think a completion mechanism as provided by
>> `multi-prompt-key-value' would be more natural and fit better into
>> AUCTeX than prompting for every option separately.
> Of course. 
> I would suggest to insert a "=" automatically when the first completion
> is uniquely done or suggest a "=" when possible.

Yeah, I know.  I experimented with "foo=" strings in the completion
table (i.e. `LaTeX-listings-key-val-options' in case of listings.el)
before committing the current version but this did not work.  I'm not
even sure yet if it is a good idea to put the "=" in the strings of the
completion table but it would be one way to distinguish keys with a
value-part from those without one (see e.g. the `print' key in the
listings package).

>> Please check it out with the listings example and let me know what you
>> think.  If there are no objections, I'll go ahead and adapt pstricks.el
>> to use this mechanism as well.
> Can I be of some help?

If you are interested you can replace the current prompting mechanism in
pstricks.el with the key=value completion mechanism.  As mentioned above
we should probably first determine if the key=value completion lacks
some important features the mechanism currently used has.

That reminds me: The key=value completion could possibly improved if it
provided a hint about the expected type of value if there is no fixed
set upon which a completion can be made.  For example, in the listings
package there is the key `breakindent' which accepts a dimension as
value.  In that case we could provide the user with a hint that a) it
requires a dimension and b) what a dimension actually is (e.g. "10pt").

This is just a thought.  I don't know if this would introduce too much
of an inconsistency with normal completion and how difficult this would
be to implement.


reply via email to

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