New page August 19, 2005 - more to come. Sometime.
I have several X-Faces listed in .slrnrc, for both the new post and reply categories, using the commands:
set custom_headers
set followup_custom_headers
My defaults are uncommented and the rest of them are commented out. The occasional times that I want to change one or both defaults, I comment/uncomment the appropriate commands.
I assume that anyone who enjoys X-Faces and uses slrn is doing that already. But this isn't about that - it's about being able to change X-Faces on the fly while you have an article open for composition, without having to manually replace the default headers.
The following is for the vi family of editors. If you're using something else, and if that something else has macro capabilities, you can probably come up with something that works there; in that case, this is just a jumping-off point for your own skills.
Two things are required for this to work (besides slrn and a vimmish editor, of course).
A directory with a text file for each X-Face header you wish to have available for on-the-fly insertion. Each file will contain one X-Face header. Each X-Face header will including the header name and the unescaped encoded X-Face string. Each text file will be, simply, this:
X-Face: [encoded string]
The [g]vi[m] macro that will, when you press a mapped key of your choice:
This is that macro as it exists here, which you will need to configure for your setup and which you will need to put in your editor's .[g]vi[m]rc file:
au BufNewFile,BufRead ~/.article,~/.followup :nmap <F2> gg/^X-Face:<cr>ddk:r x-face/
You have to know what names you've saved the header files as; this macro doesn't prompt you for filenames. Keep them simple.
Tip Regarding That Last Item: I'm apparently even simpler than my filenames, and I sometimes
forget them myself. So in their directory I keep copies of the image files from which
the X-Face header files were created, so I can peek into that directory and see what
filename I need, via the image half of the filename pair:
foo.gif
shows me what X-Face header file
foo
looks like.
Set the keybinding (<F2>
in the example) to whatever you wish that doesn't conflict with
some other action that you use.
Adjust the path to the header files (~/x-face
in the example) as required.
Want that macro to list filenames for selection? Modify it and contact me in news.software.readers or email me.