Article View: news.software.readers
Article #250337[slrn] mixmaster integration *with emacs post-mode*
From: Nomen Nescio
Date: Mon, 28 May 2012 21:27
Date: Mon, 28 May 2012 21:27
47 lines
2359 bytes
2359 bytes
> Anyone know how to configure mixmaster to pass
> an option to emacs to use post-mode?
It's not pretty, because mixmaster is hard-coded to strictly use the
EDITOR environment variable, and emacs cannot be told to enter
post-mode (the "-f post-mode" CLI option) and simultaneously be passed
a file. Emacs can be told to use a particular mode for a given file
extension, but you generally would not want all .txt files to invoke
post-mode. Also, mixmaster is hard-coded to use a .txt extension for
temporary filenames.
I came up with a bash wrapper script ("mm.sh") that solves all this:
mm.sh> #!/bin/bash
mm.sh>
mm.sh> typeset script_pathname=${0}
mm.sh>
mm.sh> case "$1" in
mm.sh> *txt)
mm.sh> tmp_fn="$1"
mm.sh>
mm.sh> emacs --eval '(progn (find-file "'$tmp_fn'")(post-mode))'
mm.sh> ;;
mm.sh> *)
mm.sh> original_editor=$EDITOR
mm.sh> EDITOR=$script_pathname
mm.sh> mixmaster $*
mm.sh> EDITOR=$original_editor
mm.sh> ;;
mm.sh> esac
The slrn config had to be changed to reference the above script instead:
mixmaster.sl> define mixmaster_ff ()
mixmaster.sl> {
mixmaster.sl> pipe_article("mm.sh -ff");
mixmaster.sl> }
mixmaster.sl>
mixmaster.sl> definekey ("mixmaster_ff", "&", "article");
mixmaster.sl>
mixmaster.sl> define mixmaster_fr ()
mixmaster.sl> {
mixmaster.sl> pipe_article("mm.sh -fr");
mixmaster.sl> }
mixmaster.sl>
mixmaster.sl> definekey ("mixmaster_fr", "\e&", "article");
Technical Details
Message-ID:
<6ee5bcc77aa84f7a32da9bbd938730b7@dizum.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!usenetcore.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!news.alt.net!news.dizum.com!sewer-output!mail2news-x2!mail2newsReferences:
<ad9957e21f48a63d9e190796973e8b67@dizum.com>Show Full Headers
Complete Article Headers
Message-ID: <6ee5bcc77aa84f7a32da9bbd938730b7@dizum.com> Subject: [slrn] mixmaster integration *with emacs post-mode* Date: Mon, 28 May 2012 21:27:06 +0000 From: Nomen Nescio <nobody@dizum.com> References: <ad9957e21f48a63d9e190796973e8b67@dizum.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!usenetcore.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!news.alt.net!news.dizum.com!sewer-output!mail2news-x2!mail2news Newsgroups: news.software.readers,alt.privacy.anon-server Mail-To-News-Contact: abuse@dizum.com Organization: mail2news@dizum.com Lines: 46 X-Original-Bytes: 2156