[ESS] ess, noweb and polymode

Tyler Smith ty|er @end|ng |rom p|@nt@rum@c@
Fri Nov 17 20:02:38 CET 2023


Hi Laurent,

You might need to include 

(require 'swiper)

before you run the other code.

ty

-- 
plantarum.ca

On Fri, Nov 17, 2023, at 1:43 PM, Laurent ESS via ESS-help wrote:
> Hi Tyler,
>
> Thank you for the idea, even if I would like to recover the 
> ess-noweb-goto-chunk.
>
> I installed swiper, ivy  and put the following lines in my .emacs.el:
>
> (defun my-list-chunks()
>    (interactive)
>    (swiper "<<"))
>
> (define-key polymode-map "g" #'my-list-chunks)
>
> When I do M-n g I have the message:
>
> my-list-chunks: Symbol’s function definition is void: swiper
>
>
> On 15/11/2023 21:13, Tyler Smith via ESS-help wrote:
>> Hi Laurent,
>>
>> I haven't used `ess-goto-chunk` before, but it sounds quite useful. I think you could get something similar with the `swiper` package. You can install `swiper` via `package-list-packages. It requires the `ivy` package, which should get installed automatically when you install `swiper`.
>>
>> Then you can define your own custom 'swipe'. For Rmd chunks, something like this:
>>
>> ```
>> (defun my-list-chunks ()
>>    (interactive)
>>    (swiper "```{"))
>>
>> (define-key polymode-map "g" #'my-list-chunks)
>> ```
>>
>> By default, `polymode-map` is bound to `M-n`, so this will call `my-list-chunks` when you hit `M-n g`.
>>
>> This displays all the matches in the minibuffer, and you can scroll through them with `C-n` and `C-p`, and hitting `enter` will take you to that chunk header. In my tests, there's something wrong with the text colours, but I don't have time to debug just now.
>>
>> Best,
>>
>> Tyler
>>
>
> ______________________________________________
> ESS-help using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help



More information about the ESS-help mailing list