The backstage needs a "save as"

5 views
Skip to first unread message

Morris Gray

unread,
Apr 12, 2008, 7:42:13 AM4/12/08
to TiddlyWiki
You know what? The backstage needs a "save as" method.

Morris

Eric Shulman

unread,
Apr 12, 2008, 10:22:19 AM4/12/08
to TiddlyWiki
> You know what? The backstage needs a "save as" method.

This can currently be done use
http://www.TiddlyTools.com/#NewDocumentPlugin

usage: <<newDocument ask all>>

The "ask" parameter prompts for a destination filename (using a system-
native dialog) , and "all" bypasses the plugin's 'filter by tag'
option. When clicked, the result is a complete copy of the current
document content, saved to a different path/filename.

Note: I am currently putting together a smaller plugin that *only*
does the 'saveAs' behavior, so that it can be easily added to the
backstage.

Perhaps the new, reduced-size plugin will be a good 'core candidate'
for a future release...

-e

FND

unread,
Apr 12, 2008, 10:51:45 AM4/12/08
to Tiddl...@googlegroups.com
> Perhaps the new, reduced-size plugin will be a good 'core candidate'
> for a future release...

I'm not entirely sure whether this isn't too narrow a use case to be
included in the core.
However, with some refactoring of the save/backup functionality (also
see ticket #435*), this might be a one- or two-liner...


-- F.


* http://trac.tiddlywiki.org/ticket/435#comment:3

Eric Shulman

unread,
Apr 12, 2008, 12:03:23 PM4/12/08
to TiddlyWiki
> I'm not entirely sure whether this isn't too narrow a use case to be
> included in the core.

Although 'save as" might be considered a 'narrow' use case, it is
nonetheless a very common command that most people expect to find in
their applications.

In addition, while it is easy to make a copy of an existing *saved* TW
document by using the OS filesystem's interface, it is ridiculously
awkward to handle the case where you have made lots of changes or
additions to an *open* TW document and want to save those changes
**without overwriting the previously saved version**.

Currently, to perform a 'save as' operation, you have to perform a
number of "filesystem gymnastics":

1) go to the folder containing the original file.
2) make a temporary duplicate file with a different name (e.g., "Copy
of index.html")
3) go back to the open TW
4) invoke 'save changes' to overwrite the original file
5) go back to the folder
6) rename the original file to a new name
7) rename the temporary duplicate back to the original name

Yuck!

> However, with some refactoring of the save/backup functionality (also
> see ticket #435*), this might be a one- or two-liner...

It's more than just a line or two... specifically, the code that asks
for a 'target' path/file...

Get the new plugin here:
http://www.TiddlyTools.com/#SaveAsPlugin

enjoy,
-e

Phil Whitehouse

unread,
Apr 12, 2008, 12:45:43 PM4/12/08
to TiddlyWiki
> Although 'save as" might be considered a 'narrow' use case, it is
> nonetheless a very common command that most people expect to find in
> their applications.

I would just like to add a 'hear, hear'.

Phil

FND

unread,
Apr 12, 2008, 1:02:19 PM4/12/08
to Tiddl...@googlegroups.com
> Although 'save as" might be considered a 'narrow' use case, it is
> nonetheless a very common command that most people expect to find in
> their applications.

That's a very fair point. But in my personal opinion, it remains a
narrow use case, with considerable code overhead - and as such perfect
for a plugin.
Nevertheless, it's not for me alone to decide, so I've raised a ticket:
http://trac.tiddlywiki.org/ticket/583


-- F.

Eric Shulman

unread,
Apr 12, 2008, 1:57:56 PM4/12/08
to TiddlyWiki
> > Although 'save as" might be considered a 'narrow' use case, it is
> > nonetheless a very common command that most people expect to find in
> > their applications.
> That's a very fair point. But in my personal opinion, it remains a
> narrow use case, with considerable code overhead - and as such perfect
> for a plugin.

The biggest piece of code in SaveAsPlugin is a general
"askForFilename()" function that should be in the core anyway!

... and, in this instance, the phrase "considerable code overhead" is
just plain silly, especially when compared with any of the following
'narrow use case' functions currently present in the TW2.3.0 core:

config.commands.syncing.handlePopup()
Story.prototype.loadMissingTiddler()
config.macros.importTiddlers.onGetWorkspaceList()
config.macros.importTiddlers.onChooseWorkspace()
config.macros.sync.* and SyncMachine.*

and also the entire set of Crypto.* functions, which are being re-
added to the core precisely because "There are required by an
increasing number of plugins and also ccTiddly" (see
http://trac.tiddlywiki.org/ticket/545 and http://trac.tiddlywiki.org/changeset/4213)

The saying "penny wise and pound foolish" comes to mind.

-e

FND

unread,
Apr 12, 2008, 2:01:18 PM4/12/08
to Tiddl...@googlegroups.com
> The biggest piece of code in SaveAsPlugin is a general
> "askForFilename()" function that should be in the core anyway!

That's what I meant about refactoring the whole saving mechanism before.

> in this instance, the phrase "considerable code overhead" is
> just plain silly, especially when compared with any of the following

> 'narrow use case' functions currently present in the TW2.3.0 core [...]

That's why I put it up as a ticket despite my reservations - I'm not
qualified to make that call.


-- F.

Morris Gray

unread,
Apr 12, 2008, 8:20:37 PM4/12/08
to TiddlyWiki
That's terrific Eric. I can't live without it already. As to whether
it should be in the core is without question, but the issue, as to
whether it should be or not, makes one realise that not only are you
worth your weight in gold because you can write JavaScript as fast as
most people write emails; but that you are especially valuable because
you are not a committee:-)

Sometimes you don't know what you've been missing until you have
it. :-) Your little plugin is a valuable file management tool as
well.

At first many people are shocked to see how many backups accumulate
from a TiddlyWiki. The multitude of backups are not just for the
inattentive and risk takers; they are a consequence of TiddlyWiki not
having a "save as..." facility
Most people these days are quite capable of handling their own backup
regimen and that would suffice for many. as well as its many other
uses that people have become to expect.

Morris Gray
http://twhelp.tiddlyspot.com
A TiddlyWiki help file for beginners
http://sidebarnotes.tiddlyspot.com
All things aside
http://groups.google.com/group/sidebarnews

iain

unread,
Apr 12, 2008, 9:12:09 PM4/12/08
to TiddlyWiki
I may be wrong, but I noticed that on the ticket the problem was flick
passed to Jeremy and rated as trivial despite two most experienced
users agreeing that it was a most desirable feature.

wolfgang

unread,
Apr 13, 2008, 4:10:51 AM4/13/08
to TiddlyWiki
Hi everyone,

Though it is nice to have TW perform everything what usual software
does - I for my part certainly don't need a 'save as' in the
backstage. I need swift and lean TiddlyWikis (and functions added from
cast to case).

In this use case, where I need a manual backup copy of a TiddlyWiki
I'm working on, I use 'Backup2Text Macro', and though this macro is
less than half the size of Eric's 'SaveAsPlugin' - even in this case I
use this function so rarely - I enable and load 'Backup2Text Macro'
only on demand, and not automatically on startup!

> ...and rated as trivial despite two most experienced
> users agreeing that it was a most desirable feature.

Eric is the most productive and conscientious developer, there is none
equal to him. Morris is writing and rewriting scripts, and so a
developer too. Therefore they are NOT talking out of the perspective
of users at all. Though they are certainly most experienced with
TiddlyWiki - however, they do that out of the perspective as
developers.
No wonder they need such functions in every case - other than me who
is not able to do coding and a real and pure user! And I say 'no
thanks' to 'saveAs' in the core.

> ... and, in this instance, the phrase "considerable code overhead" is
> just plain silly, especially when compared with any of the following
> 'narrow use case' functions currently present in the TW2.3.0 core:
>
> config.commands.syncing.handlePopup()
> Story.prototype.loadMissingTiddler()
> config.macros.importTiddlers.onGetWorkspaceList()
> config.macros.importTiddlers.onChooseWorkspace()
> config.macros.sync.* and SyncMachine.*

In these cases I agree with Eric (though not in his use of words out
of seeming contempt) that functions which are so rarely used and only
their writer could explain what they do, or even actually are
dysfunctional, should not be given any space in the core (just opened
a TW of 2 years ago, my goodness: only 100 kb and everything there
what one usually and daily needs of a note taking TW!)

'Save as' - as it is now in the form of a plugin with 4515 bytes - is
for me a too narrow use case too. And I wouldn't want it for anything
in the continually growing standard distribution of a empty TW!

kind regards,

W.

Eric Shulman

unread,
Apr 13, 2008, 6:11:09 AM4/13/08
to TiddlyWiki, elsd...@gmail.com
On Apr 13, 1:10 am, wolfgang <wolfgangl...@gmail.com> wrote:
> Eric is the most productive and conscientious developer, there is none
> equal to him. Morris is writing and rewriting scripts, and so a
> developer too. Therefore they are NOT talking out of the perspective
> of users at all. Though they are certainly most experienced with
> TiddlyWiki - however, they do that out of the perspective as
> developers.

If 'user' means someone who only reads TW documents, then I concur
that I'm not a TW user. However, *anyone* who makes even simple
changes to the content of a TW document can benefit from the
SaveAsPlugin, so it is not just an issue for 'developers' such as
myself.

Take for example, the case of a user who imports a bunch of plugins
and attempts to carefully follow the installation instructions,
modifying various templates, stylesheets, etc. only to discover that,
after completing the necessary save-and-reload, something has gone
terribly wrong and their document has become unusable.

While there is (hopefully) a backup file, it still takes a bit of
'filesystem gymnastics' to remove the currently broken document, and
restore the previous version by locating, copying and renaming the
correct backup file.

> No wonder they need such functions in every case - other than me who
> is not able to do coding and a real and pure user! And I say 'no
> thanks' to 'saveAs' in the core.

With all respect (and I do mean that!), I don't think that you are a
typical user. You have an extensive knowledge of a wide range of
available plugins, and have done considerable research on how to load
those plugins 'on demand', using some advanced techniques such as
bookmarklets and compressed external js files. The typical 'pure
user' has no such knowledge to draw upon.

While I was suggesting that SaveAsPlugin *might* be a good 'core
candidate', as a plugin it can be easily added to a document only if
desired, and even loaded on demand via a bookmarklet (if it is first
converted to an external .js file). Nonetheless, this is not likely
to benefit the vast majority of 'pure users', who generally rely upon
only those features that are included in the standard TW core code
plus, perhaps, a few plugins that may have been pre-installed by some
helpful 'power user'.

> > ... and, in this instance, the phrase "considerable code overhead" is
> > just plain silly, especially when compared with any of the following
> > 'narrow use case' functions currently present in the TW2.3.0 core:

> In these cases I agree with Eric (though not in his use of words out
> of seeming contempt) that functions which are so rarely used and only
> their writer could explain what they do, or even actually are
> dysfunctional, should not be given any space in the core (just opened
> a TW of 2 years ago, my goodness: only 100 kb and everything there
> what one usually and daily needs of a note taking TW!)

My 'contempt' was for the phrase 'considerable code overhead', and
certainly not for the writer of those words (FND). I have nothing but
the highest regard for Fred's contributions to the TiddlyWiki
community and did not intend those words to be taken as any kind of
personal criticism.

> 'Save as' - as it is now in the form of a plugin with 4515 bytes - is
> for me a too narrow use case too. And I wouldn't want it for anything
> in the continually growing standard distribution of a empty TW!

If SaveAsPlugin were to be added to the core code, it wouldn't include
any of the documentation or the slice table that are part of the
plugin tiddler. This reduces the 'overhead' to 2373 bytes.... and, if
only the general "ask for filename" functionality were to migrate to
the core, that code is a mere 1320 bytes.

By comparison, the Crypto functions (which *are* being added back to
the core for TW2.3.1) total 3667 bytes and, while not directly needed
by any TW core code are being included in the core primarily so they
can be used by various plugins without having to either A) include
those functions in each plugin (contributing to even an even more
'bloated' document), or B) creating a dependency on the separate
CryptoFunctionsPlugin (which complicates installation and can easily
result in 'broken' documents if omitted)

In this particular case, I think that having the Crypto functions in
the core is the right thing to do. Similarly, I think that adding at
least the general cross-platform 'ask for filename' function to the
core is very sensible.

In fact, that particular chunk of code is currently replicated in
several TiddlyTools plugins/scripts, including: SaveAsPlugin,
ExportTiddlersPlugin, QuickEditPlugin, SaveFromWebPlugin,
NewDocumentPlugin, ShowLocalDirectory and SaveTiddlerToFile. If this
code were in the core and someone were to install some or all of the
above plugins/scripts, it could actually *reduce* the overall document
size by as much as approximately 8K! (6*1336 bytes)

> kind regards,

as always, same here...

-e

FND

unread,
Apr 13, 2008, 6:28:12 AM4/13/08
to Tiddl...@googlegroups.com
> My 'contempt' was for the phrase 'considerable code overhead', and
> certainly not for the writer of those words (FND).

Just for the record, I never took offense at that. I think disagreements
are only natural, inevitable, and even helpful - constructive criticism
is always welcome to me.

> If SaveAsPlugin were to be added to the core code, it wouldn't include
> any of the documentation or the slice table that are part of the
> plugin tiddler. This reduces the 'overhead' to 2373 bytes.... and, if
> only the general "ask for filename" functionality were to migrate to
> the core, that code is a mere 1320 bytes.

Could you create a patch for that?


-- F.

wolfgang

unread,
Apr 13, 2008, 6:49:39 AM4/13/08
to TiddlyWiki
Thanks Eric,

for taking the time for clarity about everything which could be
misunderstood. I really appreciate.
And now I see I overreacted and exaggerated a bit due to the possibly
dividing comments of iain.

> Could you create a patch for that?

As I understand now better what's the 'overhead' for a saveAll (as for
ExportTiddlersPlugin, QuickEditPlugin, SaveFromWebPlugin,
NewDocumentPlugin, ShowLocalDirectory and SaveTiddlerToFile), that
would be my response too.

In this case it would also make much sense to be added to the
CoreTweaks, initially.

> With all respect (and I do mean that!), I don't think that you are a
> typical user. You have an extensive knowledge of a wide range of
> available plugins, and have done considerable research on how to load
> those plugins 'on demand', using some advanced techniques such as
> bookmarklets and compressed external js files. The typical 'pure
> user' has no such knowledge to draw upon.

/* nowhere to hide */

I want to apologize for my overreaction - thanks again for pointing
out :-)

W.

FND

unread,
Apr 13, 2008, 6:59:56 AM4/13/08
to Tiddl...@googlegroups.com
> I may be wrong, but I noticed that on the ticket the problem was flick
> passed to Jeremy and rated as trivial

Jeremy is the default owner for newly-created tickets. Anyone can choose
to accept the ticket though, usually when submitting a patch.

As for the reason I chose to classify this as trivial for now is that
it's not a major issue. But that doesn't mean it won't be implemented -
especially since Eric already has the code for it.


-- F.

iain

unread,
Apr 15, 2008, 4:47:45 AM4/15/08
to TiddlyWiki
That's good because I am a user not a coder and most of the time I
have no idea what any of you are talking about but I can see a good
tool developing and it seems that Save As would be a good addition.

Iain

Morris Gray

unread,
Apr 15, 2008, 7:02:35 AM4/15/08
to TiddlyWiki
Iain you have been an eye-witness to a demonstration of Parkinson's
Law. No, it has nothing to do with getting the shakes, muscle
rigidity, tremor, or a slowing of physical movement. Although you
could say Parkinson's Law is the mental and social equivalent of those
things in the interactions of group decision making.

Outlined in the book by Cyril Northcote Parkinson circa: 1958, roughly
speaking, Parkinson's Law has to do with, among other things, the time
spent by a group talking about an issue being inversely proportional
to its importance.

Or in this case, the time spent talking about the bloody obvious.
Anyone who would even question the need for a 'save as' function on
any utility that could modify a computer file, on any grounds, should
be sent to a mandatory course in common sense.

Then after graduating at the top of the class, they should still be
banned from any group decision making lest they revert back to type.
As Caesar once said; ...... "he thinks too much; such men are
dangerous".

Morris Gray
http://twhelp.tiddlyspot.com
A TiddlyWiki help file for beginners
http://sidebarnotes.tiddlyspot.com
All things aside
http://groups.google.com/group/sidebarnews










wolfgang

unread,
Apr 15, 2008, 2:45:07 PM4/15/08
to TiddlyWiki
Hi Morris,

> Anyone who would even question the need for a 'save as' function on
> any utility that could modify a computer file, on any grounds, should
> be sent to a mandatory course in common sense.

So you are having difficulty if others are of different opinion? - And
feel it's appropriate to ridicule personally if such is the case?

I simply disagree in this point - and consider FND's approach to
opposite opinions much more helpful, enriching and not creating
useless animosities - which are hurting truly only yourself in the
long run:

quote FND:
> ... I think disagreements are only natural, inevitable, and
> helpful - constructive criticism even is always welcome
> to me.

quote Morris:
> Then after graduating at the top of the class, they should still be
> banned from any group decision making lest they revert back to type.
> As Caesar once said; ...... "he thinks too much; such men are
> dangerous".

lol, ... but now I understand, this is not about an exchange of
opinion .. but politics!

And in that I've no interest - this arena I leave to you alone very
happily :-)

The very best,

Wolfgang


On 15 Apr., 13:02, Morris Gray <msg...@symbex.net.au> wrote:
> On Apr 15, 6:47 pm, iain <i...@jcis.net.au> wrote:
>
> > That's good because I am a user not a coder and most of the time I
> > have no idea what any of you are talking about but I can see a good
> > tool developing and it seems that Save As would be a good addition.
>
> Iain you have been an eye-witness to a demonstration of Parkinson's
> Law. No, it has nothing to do with getting the shakes, muscle
> rigidity, tremor, or a slowing of physical movement. Although you
> could say Parkinson's Law is the mental and social equivalent of those
> things in the interactions of group decision making.
>
> Outlined in the book by Cyril Northcote Parkinson circa: 1958, roughly
> speaking, Parkinson's Law has to do with, among other things, the time
> spent by a group talking about an issue being inversely proportional
> to its importance.
>
> Or in this case, the time spent talking about the bloody obvious.
> Anyone who would even question the need for a 'save as' function on
> any utility that could modify a computer file, on any grounds, should
> be sent to a mandatory course in common sense.
>
> Then after graduating at the top of the class, they should still be
> banned from any group decision making lest they revert back to type.
> As Caesar once said; ...... "he thinks too much; such men are
> dangerous".
>
> Morris Grayhttp://twhelp.tiddlyspot.com
> A TiddlyWiki help file for beginnershttp://sidebarnotes.tiddlyspot.com
> All things asidehttp://groups.google.com/group/sidebarnews

Morris Gray

unread,
Apr 15, 2008, 5:59:08 PM4/15/08
to TiddlyWiki
> lol, ... but now I understand, this is not about an exchange of
> opinion .. but politics!

lol, It's neither it's only good natured poking fun with dead-pan
humour :-)

Morris
Reply all
Reply to author
Forward
0 new messages