Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

MH Frequently Asked Questions (FAQ) with Answers
Section - Switching xmh's editor

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Business Photos and Profiles ]


Top Document: MH Frequently Asked Questions (FAQ) with Answers
Previous Document: Acknowledgments
Next Document: babyl2mh.pl
See reader questions & answers on this topic! - Help others by sharing your knowledge
Date: Fri, 1 Mar 1991 13:03:15 -0800

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  README Xmh.ad xmh-command.el xmhcommand xmhemacs
# Wrapped by aw@jello on Fri Nov 15 17:10:34 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'README' -a "${1}" != "-c" ; then
  echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(1269 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
XThis is a short description of what to do with each of the enclosed files.
X
XXmh.ad
X  Merge this in with your xmh resources.  If you already have
X  user defined buttons, then you may need to renumber the
X  buttons in this resource file.
X
Xxmh-command.el
X  Byte compile this file and put it in your GNU emacs load-path.
X
Xxmhcommand
Xxmhemacs
X  Put these somewhere in your path.
X
X
XOnce you have installed these, restart the R5 xmh with the new
Xresources.  When you press the repl, forw or comp buttons
Xan xemacs window will come up with your draft message.
X
XOnce you have written your mail, save it and exit GNU emacs (C-xC-c).
XYou will be prompted if you want to send the current message.
XIf you enter 'y', the message will be sent and the output will
Xbe displayed in an emacs window (in case you use -verbose or -snoop).
XThen you will be prompted to exit emacs.  Enter 'y' when you are ready.
X
XIf you answered 'n' when prompted to send the message,
Xthen the draft message will be deleted and emacs will exit.
X
XYou can modify the Xmh.ad resources to add more buttons.
XAny MH command which accepts "+folder msg" can be used
X(e.g. a replx shell script which includes the body of the
Xmessage being replied to can be bound to a replx button)
X
X
XAndrew Wason
Xaw at bae.bellcore.com
END_OF_FILE
if test 1269 -ne `wc -c <'README'`; then
    echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'Xmh.ad' -a "${1}" != "-c" ; then
  echo shar: Will not clobber existing file \"'Xmh.ad'\"
else
echo shar: Extracting \"'Xmh.ad'\" \(457 characters\)
sed "s/^X//" >'Xmh.ad' <<'END_OF_FILE'
XXmh*CommandButtonCount:			3
X
XXmh*commandBox.button1.label:		repl
XXmh*commandBox.button1.translations:\
X	#override\n\
X	<Btn1Up>:	XmhShellCommand(xmhcommand y repl) unset()
X
XXmh*commandBox.button2.label:		forw
XXmh*commandBox.button2.translations:\
X	#override\n\
X	<Btn1Up>:	XmhShellCommand(xmhcommand y forw) unset()
X
XXmh*commandBox.button3.label:		comp
XXmh*commandBox.button3.translations:\
X	#override\n\
X	<Btn1Up>:	XmhShellCommand(xmhcommand n comp) unset()
END_OF_FILE
if test 457 -ne `wc -c <'Xmh.ad'`; then
    echo shar: \"'Xmh.ad'\" unpacked with wrong size!
fi
# end of 'Xmh.ad'
fi
if test -f 'xmh-command.el' -a "${1}" != "-c" ; then
  echo shar: Will not clobber existing file \"'xmh-command.el'\"
else
echo shar: Extracting \"'xmh-command.el'\" \(1294 characters\)
sed "s/^X//" >'xmh-command.el' <<'END_OF_FILE'
X;;; These functions are for use with xemacs and xmh.
X;;; The R5 xmh has a new action - XmhShellCommand which executes
X;;; a shell command with the current msg as an arg.
X;;; By executing something like:
X;;;    XmhShellCommand(xmhcommand repl)
X;;; you can use xemacs as your editor with xmh.
X;;;
X;;; The following elisp functions perform the basic whatnowproc functionality
X;;; (quitting and deleting, sending)
X;;;
X;;; Andrew Wason  aw at bae.bellcore.com
X
X
X;;; Override C-xC-c
X(define-key indented-text-mode-map "\C-x\C-c" 'xmh-command-send-or-delete)
X
X
X(setq mhdraft (getenv "mhdraft"))	; save the filename of the draft
X
X
X(find-file mhdraft)			; load the draft letter
X(indented-text-mode)
X(setq draft-buffer (current-buffer))	; save the buffer the draft is in
X
X
X(defun xmh-command-send-or-delete ()
X  "Prompt to send or delete letter, then quit."
X  (interactive)
X  (set-buffer draft-buffer)
X  (if (y-or-n-p "Send message? ")
X      (progn
X	(save-buffer)				; save the draft buffer
X	(message "Sending...")
X	(pop-to-buffer "MH mail delivery"); pop to a buffer for "send" output
X	(erase-buffer)
X	(call-process "send" nil t t mhdraft)	; call MH "send"
X	(if (y-or-n-p "Exit? ")
X	    (kill-emacs)))			; exit emacs
X    (delete-file mhdraft)			; delete the draft letter
X    (kill-emacs)))				; exit emacs
END_OF_FILE
if test 1294 -ne `wc -c <'xmh-command.el'`; then
    echo shar: \"'xmh-command.el'\" unpacked with wrong size!
fi
# end of 'xmh-command.el'
fi
if test -f 'xmhcommand' -a "${1}" != "-c" ; then
  echo shar: Will not clobber existing file \"'xmhcommand'\"
else
echo shar: Extracting \"'xmhcommand'\" \(669 characters\)
sed "s/^X//" >'xmhcommand' <<'END_OF_FILE'
X#!/bin/sh
X# This shell should be invoked by the xmh XmhShellCommand() action as
X#   XmhShellCommand(xmhcommand y repl)
X#   XmhShellCommand(xmhcommand n comp) etc.
X# If the second arg is y, then the message list will be used.
X
X# We invoke the passed MH command on the identified message
X# (we must strip the message number and folder from the pathname)
X(if [ $1 = "y" ]
Xthen
X	$2 -whatnowproc xmhemacs +`dirname \`echo $3 | \
X		sed "s;\\\`mhpath +\\\`/;;"\`` `basename $3`
X
X# You can use this more readable version instead if you have ksh
X#	$2 -whatnowproc xmhemacs +$(dirname $(echo $3 | \
X#		sed "s;$(mhpath +)/;;")) $(basename $3)
X
Xelse
X	$2 -whatnowproc xmhemacs
Xfi)&
END_OF_FILE
if test 669 -ne `wc -c <'xmhcommand'`; then
    echo shar: \"'xmhcommand'\" unpacked with wrong size!
fi
chmod +x 'xmhcommand'
# end of 'xmhcommand'
fi
if test -f 'xmhemacs' -a "${1}" != "-c" ; then
  echo shar: Will not clobber existing file \"'xmhemacs'\"
else
echo shar: Extracting \"'xmhemacs'\" \(116 characters\)
sed "s/^X//" >'xmhemacs' <<'END_OF_FILE'
X#!/bin/sh
X# Invoke xemacs and load the xmh-command.el stuff.
X# xmhemacs is used by xmhcommand
Xxemacs -l xmh-command
END_OF_FILE
if test 116 -ne `wc -c <'xmhemacs'`; then
    echo shar: \"'xmhemacs'\" unpacked with wrong size!
fi
chmod +x 'xmhemacs'
# end of 'xmhemacs'
fi
echo shar: End of shell archive.
exit 0

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




Top Document: MH Frequently Asked Questions (FAQ) with Answers
Previous Document: Acknowledgments
Next Document: babyl2mh.pl

Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
Bill Wohler <wohler@newt.com>





Last Update March 27 2014 @ 02:11 PM