On 24 Feb 2009, at 12:14 AM, Christiaan Hofman wrote:



On Tue, Feb 24, 2009 at 12:08 AM, Michael McCracken <michael.mccrac...@gmail.com > wrote: On Mon, Feb 23, 2009 at 3:39 PM, Christiaan Hofman <cmhof...@gmail.com> wrote:
>
> On 23 Feb 2009, at 10:13 PM, Michael McCracken wrote:
>
>> On Mon, Feb 23, 2009 at 2:59 PM, Maxwell, Adam R
>> <adam.maxw...@pnl.gov> wrote:
>>> On 02/23/09 12:47, "Michael McCracken"
>>> <michael.mccrac...@gmail.com> wrote:
>>>
>>>> I had an idea based on the -users thread about macros and
>>>> autocomplete.
>>>>
>>>> Why not add the macros list to autocomplete too?
>>>
>>> That's been around for a while now...
>>>
>>> http://bibdesk.svn.sourceforge.net/viewvc/bibdesk?view=rev&revision=3648
>>>
>>>> The idea is that if I have a macro "PLDI", I could either start
>>>> typing
>>>> "Proceedings of the IEEE conference on Progr" and then get what I
>>>> want,
>>>> or I could type "PLD" and get what I want.
>>>
>>> Currently I think it only works if you're in the raw editing mode
>>> but I'm
>>> too lazy to check. Do you thing it should complete to a macro in the
>>> regular mode as well?
>>
>> Yeah, autocomplete in raw mode autocompletes the macro, and
>> autocomplete in regular mode will autocomplete the expansion of the
>> macro if it's been used in the document already.
>>
>> You nailed it - what I was suggesting was that autocomplete in regular
>> mode should autocomplete the macro name for macros and insert the
>> macro if chosen, and not offer the expanded version as a choice.
>>
>> It means I could insert macros without being in macro editing mode, by
>> choosing them in the autocomplete. It might be confusing though, if
>> the macro is 'foo' and I type all of 'foo', but don't choose the
>> expansion in the autocomplete, I'd just get "foo" and not whatever it
>> expands to... is there a better way to handle that case?
>>
>> -mike
>
> I think that would be a real mess from the point of view of
> implementation. You're either editing a raw bibtex string or not. When
> you make a complex string while editing in normal mode you'll almost
> certainly get the expanded string.

I was wondering how hard it'd be. I haven't looked at the code in
ages, obviously...
Would it work to have the act of selecting the macro from the
autocomplete switch you into raw mode?
It might be a little jarring but at least it'd preserve the existing
functionality.

-mike

I think that would be very fragile, and doubt it would work. The expanded string in the edited field would be committed before it has a chance to start editing raw bibtex.

Christiaan


More importantly, it's fundamentally impossible. Completion is handled by the field editor. Whether the string that's edited is to be interpreted as raw bibtex or not is a setting in the formatter. This is set by BDSKEditor. The field editor has absolutely no knowledge of the formatter (because both are owned by the NSTextFieldCell). In other words: the field editor cannot choose/change whether it's supposed to be raw bibtex or not, that is decided somewhere else.

Christiaan

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Bibdesk-develop mailing list
Bibdesk-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-develop

Reply via email to