I've seen some discussion about the consistency of case folding of custom field names and how mixed case names are problematic. The NewMeansNewPlugin looks for a custom field "isJournal". I have altered my <<newjournal>> parameters to add this field but custom fields of that name have a habit of being folded to lowercase. NewMeansNewPlugin subsequently misses these fields.
Is the best way to have the NewMeansNewPlugin ignore journal entries to alter it to look for "isjournal" and create journal entries with a lower case tag?
I've had a quick look at it. isJournal is not a custom field. Rather it is an attribute that is set in createNewTiddlerButton in the core and used to distinguish between new journal and new tiddler buttons. See:
config.macros.newTiddler.createNewTiddlerButton
So I think you've got that mixed up a little. But I'm not understanding what you're trying to do so perhaps there is still a problem. Can you explain it a little more?
On Thu, Sep 18, 2008 at 3:06 PM, Chris W <goo...@psychogeeks.com> wrote:
> G'day All,
> I've seen some discussion about the consistency of case folding of > custom field names and how mixed case names are problematic. The > NewMeansNewPlugin looks for a custom field "isJournal". I have altered > my <<newjournal>> parameters to add this field but custom fields of that > name have a habit of being folded to lowercase. NewMeansNewPlugin > subsequently misses these fields.
> Is the best way to have the NewMeansNewPlugin ignore journal entries to > alter it to look for "isjournal" and create journal entries with a lower > case tag?
OK. Where this started was with the basic New Journal button in the side bar (TW2.4.1 + MPTW 2.5.1). Pressing this creates a new journal entry [[18 September 2008]], tags it "journal", and lets you edit it etc. Save the journal entry and press the New Journal again and the NewMeansNewPlugin kicks in giving, by default, a new tiddler "18 September 2008 (1)" attached to the name. I prefer the vanilla TW behaviour here, but NewMeansNew most other places.
I went looking in the plugin and saw the exception for "isJournal" and assumed that we were talking a custom field (i.e. XML attribute). I set the New Journal link up create the entry with this custom field, but NewMeansNew still added the "(1)".
So, how do I suppress the NewMeansNew behaviour on journal entries?
Simon Baird wrote: > I've had a quick look at it. isJournal is not a custom field. Rather it is > an attribute that is set in createNewTiddlerButton in the core and used to > distinguish between new journal and new tiddler buttons. See:
> config.macros.newTiddler.createNewTiddlerButton
> So I think you've got that mixed up a little. But I'm not understanding what > you're trying to do so perhaps there is still a problem. Can you explain it > a little more?
> Simon.
> On Thu, Sep 18, 2008 at 3:06 PM, Chris W <goo...@psychogeeks.com> wrote:
>> G'day All,
>> I've seen some discussion about the consistency of case folding of >> custom field names and how mixed case names are problematic. The >> NewMeansNewPlugin looks for a custom field "isJournal". I have altered >> my <<newjournal>> parameters to add this field but custom fields of that >> name have a habit of being folded to lowercase. NewMeansNewPlugin >> subsequently misses these fields.
>> Is the best way to have the NewMeansNewPlugin ignore journal entries to >> alter it to look for "isjournal" and create journal entries with a lower >> case tag?
> Save the journal entry and press the New Journal again and the
> NewMeansNewPlugin kicks in giving, by default, a new tiddler "18
> September 2008 (1)" attached to the name. I prefer the vanilla TW
> behaviour here, but NewMeansNew most other places.
This seems reasonable, given that the journal titles are auto-
generated based on date/time, so there is normally supposed to be only
one journal created per day (unless your journal date format includes
the time as well).
The following very tiny change to the [[NewMeansNewPlugin]] code will
allow it to bypass the title fixup handling for journal titles, while
still applying the fixup logic to all other titles. First, find this
line in the plugin:
title = config.macros.newTiddler.getName(title); // <--- only changed
bit
and then simply add 'else' to the beginning of the line, so it
becomes:
else title = config.macros.newTiddler.getName(title); // <--- only
changed bit
That's it... just an additional five bytes of code and the plugin
behavior will then work as you've suggested.
Note: So, what do you think, Simon? Is this a good tweak to add to the
official NewMeansNewPlugin?
On Thu, Sep 18, 2008 at 8:26 PM, Eric Shulman <elsdes...@gmail.com> wrote:
> > Save the journal entry and press the New Journal again and the > > NewMeansNewPlugin kicks in giving, by default, a new tiddler "18 > > September 2008 (1)" attached to the name. I prefer the vanilla TW > > behaviour here, but NewMeansNew most other places.
> This seems reasonable, given that the journal titles are auto- > generated based on date/time, so there is normally supposed to be only > one journal created per day (unless your journal date format includes > the time as well).
> The following very tiny change to the [[NewMeansNewPlugin]] code will > allow it to bypass the title fixup handling for journal titles, while > still applying the fixup logic to all other titles. First, find this > line in the plugin:
> title = config.macros.newTiddler.getName(title); // <--- only > changed > bit
> and then simply add 'else' to the beginning of the line, so it > becomes:
> else title = config.macros.newTiddler.getName(title); // <--- only > changed bit
> That's it... just an additional five bytes of code and the plugin > behavior will then work as you've suggested.
> Note: So, what do you think, Simon? Is this a good tweak to add to the > official NewMeansNewPlugin?
Cool. A nice easy change. I've added this to the plugin as a configuration option (but switched off by default since I don't want to change the name to NewMeansNewMostOfTheTimePlugin... :)
So if you put config.newMeansNewForJournalsToo = false;
in your MptwUserConfigPlugin (or ConfigTweaks or whatever you have) then you will get your desired behaviour.
Simon Baird wrote: > Cool. A nice easy change. I've added this to the plugin as a configuration > option (but switched off by default since I don't want to change the name to > NewMeansNewMostOfTheTimePlugin... :)
Excellent. Thanks guys. I guess NMNMOTTP doesn't roll of the tongue any better.