[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#39512: 28.0.50; Add command isearch-yank-region
From: |
Juri Linkov |
Subject: |
bug#39512: 28.0.50; Add command isearch-yank-region |
Date: |
Wed, 21 Apr 2021 23:41:05 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) |
tags 39512 fixed
close 39512 28.0.50
quit
>>>(or (thing-at-point 'region)
>>> (thing-at-point 'url)
>>> ;; (thing-at-point 'filename)
>>> ;; (thing-at-point 'list)
>>> (thing-at-point 'symbol))
>>>
> What I meant is just to add to thingatpt.el these 4 lines:
>
> +(put 'region 'bounds-of-thing-at-point
> + (lambda ()
> + (when (use-region-p)
> + (cons (region-beginning) (region-end)))))
>
>> As I already mentioned; IMO the idea is to follow the same logic than here:
>>
>> https://github.com/abo-abo/swiper/blob/471d644d6bdd7d5dc6ca4efb405e6a6389dff245/ivy.el#L427
>>
>> where `(thing-at-point 'region)` is basically the first branch in the
>> cond.
>
> `(thing-at-point 'region)` will work with the patch above.
> Then we could add a customizable user option to specify
> in what order the user wants to try things at point, e.g.
>
> `(region url file symbol)`
Now pushed to master and closed.
>> now I use C-M-SPC for this selection and then M-w to copy and C-s
>> C-y. If you add the command, then it will save the M-w and the C-y to
>> copy the region, because region will be already active... But will
>> require the M-s prefix any way... so not 2 but at least 1 bind will be
>> saved. You can consider this option in the future if you want...
>
> Yes, this is a nice way to yank the next list to the search with just
> C-M-SPC M-s M-.
Now works not only with 'C-M-SPC M-s M-.' but also with just 'M-s M-.'
due to 'sexp' in the default value.