Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    It doesn't seem like Emacs implements such options, but it has --eval, which can take a script to start isearch, and that can be put into a wrapper script. Commented Apr 26, 2019 at 19:20
  • Thanks. Having seen that --eval states "evaluate Emacs Lisp expression EXPR". Do you have an example for this (or a link to examples I can dive into)? I am still getting used to the editor and scripting in lisp is something I have never seen before I touched Emacs. I did manage (somehow) the startup configuration, so Emacs opens in a way I want and I understood most of what I did there. Commented Apr 26, 2019 at 19:24
  • I've been trying to write such an expression, but it seems it involves some trickery with calling commands interactively. If you want some pointers, Emacs ships with info manuals for elisp. Here are online versions of these: gnu.org/software/emacs/manual/html_node/elisp/index.html gnu.org/software/emacs/manual/html_node/eintr/index.html Commented Apr 26, 2019 at 19:30
  • Thanks a lot! I will try my luck with that. If it gets too complicated (for now), I can always use emacs +$(grep -hn "<search>" <file> | head -n 1 | cut -d":" -f1) <file>. Just wanted to avoid the extra commands to get the line numbers if it would work within Emacs natively. Commented Apr 26, 2019 at 19:33