Skip navigation.
 
mlRe: Ephemeral Changes
FROM : Gerriet M. Denkmann
DATE : Wed Mar 26 03:07:15 2008

On 25 Mar 2008, at 23:12, Graham Cox wrote:
> There may be a simpler way, but this is what occurred to me when I 
> read this:
>
> Subclass NSTextView and override -changeFont: -changeAttributes: 
> and any other "ephemeral" method. Turn off the undo manager using -
> disableUndoRegistration, call super, then turn it back on again.
>


I have to apologize for not stating my problem more clearly. Let's 
try again:

I do want to see "Undo Set Font" or "Redo Paste Font" etc. in my Edit 
menu. So disabling the undo manager is probably not the right thing.

Currently NSDocument does, whenever the undo stack changes:
document is dirty if and only if  size of undo stack > 0

What I want it to do is:
document is dirty if and only if number of "real" operations in undo 
stack > 0.


>
>
>
> On 26 Mar 2008, at 4:48 am, Gerriet M. Denkmann wrote:

>>
>> I have a document based Cocoa editor, which handles simple text 
>> files (setRichText: NO).
>> It handles undo and font changes.
>>
>> But the files are just plain text files; no font information gets 
>> stored.
>>
>> So I would like that the document does NOT get dirty 
>> (isDocumentEdited) if only the font has been changed.
>>
>> This would imply that we have two kinds of changes: "real" changes 
>> (like typing, cut and paste of text, etc.) and "ephemeral" changes 
>> (e.g. change of font).
>> Both are recorded by the NSUndoManager, but only "real" changes 
>> make the document dirty.
>>
>> How could this be done in 10.4.11 ?
>>
>> Kind regards,
>>
>> Gerriet.
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (<email_removed>)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/graham.cox%
>> 40bigpond.com
>>
>> This email sent to graham.<email_removed>

>

Related mailsAuthorDate
mlEphemeral Changes Gerriet M. Denkman… Mar 25, 18:48
mlRe: Ephemeral Changes Graham Cox Mar 25, 23:12
mlRe: Ephemeral Changes Gerriet M. Denkman… Mar 26, 03:07
mlRe: Ephemeral Changes Sherm Pendley Mar 26, 04:07
mlRe: Ephemeral Changes Gerriet M. Denkman… Mar 26, 11:26
mlRe: Ephemeral Changes Graham Cox Mar 26, 22:56
mlRe: Ephemeral Changes Jens Miltner Mar 27, 09:50
mlRe: Ephemeral Changes Gerriet M. Denkman… Mar 27, 11:57
mlRe: Ephemeral Changes Jens Miltner Mar 27, 14:46
mlRe: Ephemeral Changes Gerriet M. Denkman… Mar 27, 18:44
mlRe: Ephemeral Changes Gerriet M. Denkman… Mar 27, 18:48