0

I need help with creating a tool. So I have some lines selected by a region, that I need to feed line by line to a shell/python script. The output of shell/python script will be of the form:

0xabcd is in func1 (/path/to/file/a.c:233)

I want to show these lines in a swiper like buffer in this format:

func2(233) /path/to/file/a.c
func1(567) /path/to/another/file/b.c

so that I can use down and up arrows to visit these files. eg. using an up arrow will show file /path/to/file/a.c at line number 233 and using a down arrow will show file f.c at line 567 etc. something like this but with my own entries: imgur.com/gallery/uYtuOyg

What is an efficient way I go about doing this in elisp ?

  • 1
    Please define "swiper-like buffer" in this context. How is it different from another buffer - please consider specifying its properties/mode/behavior. – Drew Jun 30 '19 at 1:47
  • In my experience swiper buffer or even swoop are mini buffers where I can just press up/down arrow on the entries and the corresponding entry would open up. I don't have to press ctrl+<up>/<down> arrow like in helm. Just up and down arrow and entries would be opened up. That's what I meant by "swiper-like buffer". Hope this clarifies. – maindoor Jun 30 '19 at 2:10
  • Have you considered to write your own command using counsel/helm/ido/...? Why reinvent the wheel? – wasamasa Jun 30 '19 at 6:11
  • Please put all info specifying what you request in the question itself. Comments can be deleted at any time. – Drew Jun 30 '19 at 13:41
  • @wasamasa, exactly but I am relatively new to lisp and need a simple application as an example to start on this. Like how do you split a region into separate lines in lisp and how do you get the output of an external application in lisp. – maindoor Jul 2 '19 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.