help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Widgets and text-changing


From: Stephen Berman
Subject: Re: Widgets and text-changing
Date: Fri, 19 Jun 2009 09:45:13 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux)

On Thu, 18 Jun 2009 16:02:43 -0400 MON KEY <monkey@sandpframing.com> wrote:

> Stephen Berman <stephen.berman@gmx.net> writes:
>
>> Is it possible to apply text-changing commands or functions to widgets
>> in a buffer without dewidgetizing them?  For example, if I eval this
>> sexp:
>>
>>     (with-current-buffer (get-buffer-create "*Widget Test*")
>>       (setq mylist '("delta" "alfa" "charlie" "bravo"))
>> {...}
>> Is it possible to manipulate, e.g. sort, widgets in a buffer without
>> them losing their widgetry?
>
> I'm sure this was obvious and I don't intend any sarcasm, but what about:
[...]
> (setq mylist (sort '("delta" "alfa" "charlie" "bravo") 'string<)

This is fine as far as it goes, though in my specific use case it has to
be a bit more complicated, since I need to both preserve the initial
list and do case insensitive sorting.  This added complication is what
prompted my post, since if it were possible to apply text-changing
functions to widgetized buffers, I would only need to set sort-fold-case
and call sort-lines.  But since this apparently is not possible, I have
indeed resorted to the pre-sorting, despite its additional slight
overhead.

Steve Berman





reply via email to

[Prev in Thread] Current Thread [Next in Thread]