Idiom for shelling out to $EDITOR/$PAGER?

Tim Chase python.list at tim.thechases.com
Fri Dec 23 07:28:26 EST 2011


On 12/23/11 06:06, Ben Finney wrote:
> Cameron Simpson<cs at zip.com.au>  writes:
>> On 23Dec2011 17:12, Ben Finney<ben+python at benfinney.id.au>
>> wrote: | That doesn't address the concern Tim raised: did
>> the user actually do | anything, did the file change?
>>
>> I'm not sure it matters.
>
> I know of numerous applications where it matters, spcifically
> ones which decide what to do with the edited text. Including
> “submit a bug report” and “submit a wiki page edit” and “send
> an email message”.
>
> If the buffer was not edited, the user has most likely changed
> their mind about editing at all, and there are many
> applications where the correct default action differes
> depending on whether the user actually changed anything in the
> text.

Yes, Ben's understanding is correct here, that for some of my 
use-cases, it's helpful to know if the user did anything.  The 
application can then decide whether it should use the original 
data it passed to the function, or whether it should go some 
"abort what you're doing" route.

-tkc





More information about the Python-list mailing list