I have a python script ss.py
that gets a screenshot from a connected device and puts into particular dir. From terminal I run it with the target path as an arg:
$ python ss.py {document-name}/{image-name}
Then I have to insert some text into my document to reference it.
.. image:: /img/{document-name}/{image-name}.*
:alt: {Some alt text here}
I want to write a command that will accept the image name as an argument, take the doc name from the current buffer (minus file extension) and then put the image
directive into the current buffer, leaving me and my cursor at the alt text, so I can keep writing there. And I want to bind it to some key (I don't what is commonly unused/available.)
(I am very new to emacs. So I don't even know where to start with this.)
NB: In case it matters, I need to run the Python command using python3, which normally means I use a virtualenv in a bash shell. Also, in case it matters I am using emacs 25 on Mac OS X.