[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: collect-string
From: |
Stefan Monnier |
Subject: |
Re: collect-string |
Date: |
Fri, 03 Dec 2010 17:56:51 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
>> > ! '(0)
>> > ! ;; construct a list of subexpression integers
>> > ! (mapcar 'string-to-number
>> > ! (split-string
>> > ! (let ((default (car occur-collect-submatch-history)))
>> > ! (read-from-minibuffer
>> > ! (format "Subexpressions to collect (default %s): "
>> > default)
>> > ! "" nil nil 'occur-collect-submatch-history default)
>> > ! (car occur-collect-submatch-history)))))
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>
>> This should be `default', right?
> No, this is the new input value as read-from-minibuffer prepends this
> value to the history.
Oh, right, there's more parens than I thought. You should use
`read-string' instead, which will take care of this ugliness.
>> Hmm... I didn't think of NLINES turning into a list of submatch-numbers,
>> but that makes me think that maybe we should go one step further and
>> turn it into a string, like the ones used in replace-match.
> This is truly brilliant. Thank you very much. I love this idea
> bouncing process. See below.
It's not always as successful, sadly. But yes, it turned out very well
this time.
Stefan