mh-e-contrib-1.4/0040755000175700001440000000000007652272515013107 5ustar wohlerusersmh-e-contrib-1.4/ChangeLog0100644000175700001440000003341007652272515014657 0ustar wohlerusers2003-04-25 Bill Wohler * Released MH-E contrib version 1.4. * README: Updated for release 1.4. 2003-04-25 Bill Wohler * Makefile: Added copyright. (MH-E-CONTRIB): Removed mh-junk.el and mh-tick.el. 2003-03-26 Bill Wohler * mh-junk.el, mh-tick.el: Moved/merged into MH-E proper. 2003-03-26 Bill Wohler * Released MH-E contrib version 1.3. * README: Updated for release 1.3. 2003-03-26 Bill Wohler * Makefile (MH-E-CONTRIB): Added ChangeLog. 2003-03-26 Satyaki Das * mh-junk.el (mh-junk-blacklist, mh-junk-whitelist): Use the mh-refile-msg API that is compatible with MH-E-7.2. This change degrades functionality a little since mh-last-destination-folder is modified when spam is refiled. (mh-spamassassin-blacklist): Don't use mh-truncate-log-buffer since it was added after MH-E-7.2 was released. * mh-tick.el (mh-funcall-if-exists): Add compatibility for version 7.2 of MH-E. 2003-03-25 Bill Wohler * README (mh-junk.el, mh-tick.el): Added stanzas. Removed RCS Id per Emacs conventions. * Makefile (MH-E-CONTRIB): Added mh-junk.el and mh-tick.el. * multi-prompt.el: Checkdoc fixes. Moved provide to end. Added local variables per MH-E coding standards. * mh-junk.el: Removed RCS Id per Emacs conventions. Bumped version to 1.1. Updated synopsis since it handles more than spamprobe now. * mh-frame.el: Removed RCS Id per Emacs conventions. Checkdoc fixes. Added local variables per MH-E coding standards. * mh-comp-frame.el: Moved provide to end. Added local variables per MH-E coding standards. * mh-junk.el (mh-bogofilter-blacklist, mh-spamprobe-blacklist, mh-spamassassin-blacklist): Use \\[...] expressions instead of functions or key bindings. Checkdoc fix. 2003-03-24 Satyaki Das * mh-junk.el (mh-junk-blacklist, mh-junk-whitelist): Modified so that the call to mh-refile-msg doesn't change mh-last-destination-folder. 2003-03-21 Satyaki Das * mh-junk.el (mh-junk-blacklist): Handle lack of leading "+" in mh-junk-mail-folder. Also allow a leading "@" so that a folder relative to current folder can be given. 2003-03-20 Satyaki Das * mh-junk.el (mh-junk-blacklist, mh-bogofilter-blacklist) (mh-spamprobe-blacklist, mh-spamassassin-blacklist): Move the comments about usage into the proper function documentation strings. (mh-spamassassin-blacklist, mh-spamassassin-whitelist): Cache the path of the spamassassin and sa-learn programs so that we don't have to search for them everytime. 2003-03-20 Bill Wohler * mh-junk.el (mh-junk-function-alist): Added bogofilter. (mh-junk-program): Added bogofilter. Moved spamassassin after spamprobe. (mh-bogofilter-executable, mh-bogofilter-blacklist, mh-bogofilter-whitelist): New variables and functions for bogofilter support. 2003-03-20 Satyaki Das * mh-junk.el (mh-spamassassin-whitelist): Fix indentation. 2003-03-20 Bill Wohler * mh-junk.el: Edited spamassassin docs, and added information about running a cron-job to update Bayesian databases for spamassassin. (mh-junk-choose): Checkdoc fix. (mh-spamassassin-blacklist, mh-spamassassin-whitelist): Added code to update Bayesian database, if available. (mh-spamassassin-identify-spammers): New function that displays frequency counts of hosts and domains in blacklist_from entries which can be used to create appropriate wildcard entries. Improvements include finishing the job--actually creating the wildcard entries, but be careful not to do something like "blacklist_from *@*.com. Also, while this function is appropriate in contrib, I'm not sure that this would belong in the main distribution. 2003-03-15 Bill Wohler * mh-junk.el (mh-spamassassin-add-rule): If the user_prefs file is already being edited, don't kill the buffer upon exit. This file is often edited by the user and it isn't nice if the buffer just disappears. 2003-03-12 Satyaki Das * mh-tick.el (mh-toggle-tick): Set mh-last-seq-used appropriately. This needs to be done manually since mh-tick-seq is maintained as a internal sequence. 2003-03-11 Jeffrey C Honig * mh-frame.el ("mh-e"): Change reference of "+inbox" to mh-inbox. 2003-03-09 Satyaki Das * mh-tick.el (mh-toggle-tick): Disable toggling of the tick if we are narrowed to the tick sequence. (mh-notate-tick-sequence): Refactor out and enhance the folder highlighting code from the defadvice of mh-notate-user-sequences. The enhancement is to disable tick highlighting if we are narrowed to the tick sequence. (mh-notate-user-sequences): Use mh-notate-tick-sequence. (mh-add-msgs-to-seq, mh-delete-msg-from-seq): Disable these commands if called interactively with the tick sequence. (mh-delete-seq): Remove highlighting of the ticked messages if the tick sequence is being deleted. 2003-03-08 Satyaki Das * mh-tick.el (mh-tick-add-overlay, mh-tick-remove-overlay): Make it work in XEmacs too by using extents. 2003-03-08 Satyaki Das * mh-tick.el: New file that highlights important messages. 2003-02-25 Jeffrey C Honig * mh-junk.el (mh-spamassassin-blacklist): Use scan to extract the From address. If it is one of our addresses (as defined in Alternate-Mailboxes) do not blacklist it. 2003-02-24 Satyaki Das * mh-junk.el (mh-spamassassin-blacklist): Add a call to mh-truncate-log-buffer, so that the log-buffer doesn't grow too big. 2003-02-24 Jeffrey C Honig * mh-junk.el (mh-spamassassin-blacklist): Remove duplicate run of spamassassin. (mh-spamassassin-add-rule): Do not add a rule if it already exists. 2003-02-23 Satyaki Das * mh-junk.el (mh-spamassassin-blacklist): Use the raw message to extract the From header info. 2003-02-22 Jeffrey C Honig * mh-junk.el (mh-spamassassin-blacklist): Use call-process when calling spamassasin, get input from the raw mail message and send any output to mh-log-buffer. (mh-spamassassin-whitelist): Use spamassasin to remove it's markup from the message. 2003-02-22 Satyaki Das * mh-junk.el (mh-junk-map, mh-show-junk-map): Set up J? to bring up quick help. (mh-help-messages): Add help message for spam operations. 2003-02-22 Satyaki Das * mh-junk.el (mh-junk-blacklist, mh-junk-function-alist) (mh-junk-whitelist, mh-show-junk-blacklist) (mh-show-junk-whitelist, mh-spamprobe-blacklist) (mh-spamprobe-whitelist, mh-spamassassin-blacklist) (mh-spamassassin-whitelist): Replace delete with whitelist and undelete with blacklist. (mh-show-junk-map, mh-junk-map): Simplify keymaps. 2003-02-22 Satyaki Das * mh-junk.el (Commentary): Update usage instructions. (mh-junk-function-alist): Make spamassassin the first choice. (mh-junk-choose): Function to set mh-junk-choice when mh-junk-program is changed through the customize interface. (mh-junk-program): Customizable variable that sets the spam program to use. (mh-junk-mail-folder): This is now customizable. (mh-junk-delete, mh-junk-undelete): Direct user to customize mh-junk-program to choose correct spam program instead of setting mh-junk-choice directly. 2003-02-22 Satyaki Das * mh-junk.el (Commentary): Update usage instructions. (mh-junk-choice, mh-junk-mail-folder): Variables that should be appropriately set to decide which spam filter to use. (mh-junk-function-alist): Available spam filters. (mh-junk-delete): Renamed from mh-junk-mail. Also it has been refactored to call the spam filter specific function. (mh-junk-undelete): Renamed from mh-junk-undelete-mail. Refactored to call spam filter specific function. (mh-show-junk-mail, mh-show-junk-undelete-mail): Equivalent functions callable from the show buffer. (mh-junk-map, mh-show-junk-map): Add key bindings in show mode and folder mode. (mh-spamprobe-delete, mh-spamprobe-undelete): Spamprobe functions. (mh-spamassassin-delete): Renamed from the existing mh-junk-blacklist-message. Slightly refactored so that the common actions are done in mh-junk-delete. (mh-spamassassin-undelete): New function to whitelist incorrectly marked message. (mh-spamassassin-add-rule): New function that adds a rule to user_prefs. This has been factored out from mh-spamassassin-delete. 2003-01-17 Bill Wohler * mh-junk.el: Added spamassassin code (mh-junk-blacklist-message). 2003-01-08 Bill Wohler * Released MH-E contrib version 1.2. * README: Updated for release 1.2. 2003-01-08 Bill Wohler * README: Deleted descriptions for mh-alias.el and mh-identity.el. Added description of mh-comp-frame.el. * Makefile (MH-E-CONTRIB): Deleted mh-alias.el and mh-identity.el. Added mh-comp-frame.el. 2002-12-17 Satyaki Das * mh-comp-frame.el: New file. When loaded it does nessage composition in a separate frame. 2002-12-02 Peter S Galbraith * mh-identity.el: Deleted. It's in src/ now. 2002-11-29 Peter S Galbraith * mh-alias.el: Moved to src/ directory. Now part of MH-E! 2002-11-15 Bill Wohler * Released MH-E contrib version 1.1. * Makefile (MH-E-CONTRIB): Added mh-identity.el. * README: Added info about mh-identity.el. * mh-identity.el: New file. 2002-11-14 Peter S Galbraith * mh-alias.el (PC-do-completion): Add autoload, reverting Mark's require for complete.el. It's optional and doesn't exist on XEmacs. 2002-11-13 Mark D. Baushke * mh-frame.el: (mh-frame-sh-pid): New defvar for this variable. (mh-frame-delete-frame-now-flag): Renamed from mh-frame-delete-frame-now. (mh-fame): Use it. Checkdoc fix. (mh-frame-mh-quit-hook, mh-frame-kill-emacs-hook, mh-frame-get-mh-frame, mh-quit): Checkdoc fix. Added RCS Id line to aid in bug reports. This file is now at release 1.1 due to a variable name change. * mh-alias.el (mh-alias-substitute-aliases-flag): Renamed from mh-alias-substitute-aliases. (mh-read-address): Use it. (mh-alias-completion-ignore-case-flag): Renamed from mh-alias-completion-ignore-case. (mh-read-address): Use it. (mh-alias-display-blind-name-on-completion-flag): Renamed from mh-alias-completion-ignore-case. (mh-alias-learn-aliases): Use it. (complete): Add require to satisfy dependency on mh-alias-PC-complete-address. This file is now at release version 2.17 due to external interface changes. 2002-10-31 Bill Wohler * Makefile, README, mh-alias.el, mh-flists.el, mh-frame.el: Replaced mh-e with MH-E. 2002-10-25 Bill Wohler * mh-flists.el (mh-flists-remove-folder): Renamed mh-flists-remove-folder to mh-flists-remove-folder-flag per (elisp) Coding Conventions conversion in mh-e/src. 2002-01-25 Peter S Galbraith * mh-alias.el (mh-alias-minibuffer-confirm-address): Really Fixed for Emacs21? The fix is now more generic and assumes that aliases don't have a colon in them, and that prompts end with a colon. Recall that the difference between emacs20 and emacs21 is that we are free to move into the prompt in emacs21. 2002-01-24 Peter S Galbraith * mh-alias.el (mh-alias-minibuffer-confirm-address): Fixed for Emacs21. 2001-12-16 Bill Wohler * Released mh-e-contrib version 1.0. * Makefile (MH-E-CONTRIB): Added README, mh-alias.el, mh-frame.el, multi-prompt.el. (dist): Replaced $(RM) with rm -rf (closes SF #488661). * README: New file. Describes packages and provides simple installation instructions. 2001-12-07 Eric Ding * mh-frame.el (mh-frame): use make-frame instead of new-frame (deprecated, temporary alias) 2001-11-30 Eric Ding * mh-frame.el (mh-frame): rename get-mh-e-frame to mh-frame-get-mh-frame and move definition out of mh-frame. 2001-11-30 Eric Ding * mh-frame.el: New file (renamed frame-mh-e package). * frame-mh-e.el: removed. 2001-11-29 Eric Ding * frame-mh-e.el: New file. 2001-11-28 Eric Ding * mh-alias.el: Use eval-after-load rather than requiring mh-comp package to be loaded 2001-11-21 Peter S Galbraith * multi-prompt.el: New file. Helper for mh-alias.el. 2001-10-23 Peter S Galbraith * mh-alias.el (mh-alias): change customization group to mh (instead of mh-e) for integration with mh-e. 2001-10-19 Peter S Galbraith * mh-menubar.el: file removed (in CVS' attic) since the functionality has been merged into mh-e.el, mh-comp.el and mh-pick.el. 2001-10-12 Peter S Galbraith * mh-alias.el: updated to V2.14 clean up old code written for emacs19 (buffer-substring -> match-string) 2001-07-31 Peter S Galbraith * mh-menubar.el: file added and updated to V1.2. 2001-07-25 Peter S Galbraith * mh-alias.el: Add file previously known as e-mh-alias.el. MH mail alias expansion and substitution. 2001-02-19 Bill Wohler * Makefile (all): Make `dist' the default target. (dist): contrib now part of tag identifier. Leave release in current directory. Copyright (C) 2003 Bill Wohler Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. mh-e-contrib-1.4/README0100644000175700001440000000330207652272515013762 0ustar wohlerusers* COPYRIGHT Copyright (C) 2003 Bill Wohler Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. * INTRODUCTION This directory contains contributed software that is useful with MH-E. * CONTENTS ** mh-comp-frame.el If this file is loaded into emacs then commands like `mh-send', `mh-reply', and `mh-forward' will create a new frame in which the draft is opened. When the mail is sent (or the draft deleted) this frame goes away. ** mh-frame.el Visit (or, if necessary, open) a frame called "MH-E" for mh-rmail, rescan folder and show current message. On `mh-quit' from +inbox in MH-E frame, delete that frame, and if there's a pid argument argument, kill the proc with that pid. ** multi-prompt.el This package is written for use in Emacs Lisp programs, where the user is prompted for a string of the form: FOO,BAR,BAZ where FOO, BAR, and BAZ are elements of some table. The function `multi-prompt' is a replacement `completing-read' that will allow the user to enter a string like the above, yet get completion on both FOO, BAR, and BAZ. * INSTALL ** Extract the tarball. If you don't have GNU tar, use gzip to uncompress the tarball and drop the `z' option. tar xzf mh-e-contrib-1.4.tgz ** Place these files in your load path. You may simply place the files in a directory that is already in your load path, or you could add something like the following to your .emacs: (add-to-list 'load-path (expand-file-name "~/mh-e-contrib-1.4")) ** Read the documentation within each file for directions specific to it. Local variables: mode: outline paragraph-separate: "[ ]*$" end: mh-e-contrib-1.4/mh-comp-frame.el0100644000175700001440000000562507652272515016066 0ustar wohlerusers;;; mh-comp-frame.el --- Message composition in a separate frame ;; ;; Copyright (C) 2002 Satyaki Das ;; Authors: Satyaki Das ;; Created: 17 Dec 2002 ;; Version: 1.0 (17 Dec 2002) ;; Keywords: mh-e, mail, emacs, xemacs ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;; Commentary: ;; If this file is loaded into emacs then commands like mh-send, mh-reply, ;; mh-forward etc. will create a new frame in which the draft is opened. When ;; the mail is sent (or the draft deleted) this frame goes away. This means ;; that I can continue visiting other messages or folders or read new mail in ;; the original frame. It works best when mh-delete-yanked-msg-window-flag is ;; nil. ;; To enable this, drop the file into a directory that is in the load-path and ;; add: ;; (require 'mh-comp-frame) ;; to the .emacs. ;;; Code: (defvar mh-delete-mail-frame-flag nil "Non-nil means the mail composition frame is to be deleted.") ;; Frame creation advice... (defmacro mh-advise-mh-frame-creation (func) "Advise FUNC to create new frames during MH message composition." `(defadvice ,func (around mh-new-frame activate) "Compose message in new frame." (select-frame (make-frame)) (prog1 ad-do-it (set (make-variable-buffer-local 'mh-delete-mail-frame-flag) t) (delete-other-windows)))) ;; Frame deletion advice... (defmacro mh-advise-mh-frame-deletion (func) "Advise FUNC to delete frame after execution." `(defadvice ,func (around mh-delete-frame activate) "Delete frame if the draft buffer doesn't exist anymore." (let ((buffer-name (buffer-name)) (delete-frame-flag mh-delete-mail-frame-flag)) (prog1 ad-do-it (when (and delete-frame-flag (not (equal (buffer-name) buffer-name))) (delete-frame)))))) ;; Advise the appropriate functions... (mh-advise-mh-frame-creation mh-send) (mh-advise-mh-frame-creation mh-reply) (mh-advise-mh-frame-creation mh-forward) (mh-advise-mh-frame-creation mh-edit-again) (mh-advise-mh-frame-creation mh-extract-rejected-mail) (mh-advise-mh-frame-deletion mh-send-letter) (mh-advise-mh-frame-deletion mh-fully-kill-draft) (provide 'mh-comp-frame) ;;; Local Variables: ;;; indent-tabs-mode: nil ;;; sentence-end-double-space: nil ;;; End: ;;; mh-comp-frame.el ends here mh-e-contrib-1.4/mh-frame.el0100644000175700001440000001614707652272515015133 0ustar wohlerusers;;; mh-frame.el --- Open MH-E in a separate frame ;; ;; Copyright (C) 1995 Mark Crimmins ;; Copyright (C) 1995, 2001, 2002 Eric Ding ;; Authors: Eric Ding , Mark Crimmins ;; Created: 20 Dec 1995 ;; Version: 1.1 (13 Nov 2002) ;; Keywords: mh-e, mail, emacs, xemacs ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;; Commentary: ;; This code is based on mh-e-in-frame.el, originally written by Mark ;; Crimmins. The latest version of mh-frame.el can be found at ;; http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mh-e/contrib/mh-frame.el ;;; Description: ;; Visit (or, if necessary, open) a frame called "MH-E" for mh-rmail, ;; rescan folder and show current message. On mh-quit from +inbox in ;; MH-E frame, delete that frame, and if there's a pid argument ;; argument, kill the proc with that pid (see shell script below). ;; ;; To use mh-frame in emacs, add the following line to your .emacs file: ;; ;; (autoload 'mh-frame "mh-frame" "" t) ;; ;; You can then start up MH-E in a separate frame with ;; ;; M-x mh-frame ;; ;; or you could bind a key to this function: ;; ;; (global-set-key "\C-x\r" 'mh-frame) ;; ;; This elisp code was originally designed to be used with a shell script ;; that calls it via the gnuserv package, which is included in XEmacs, but ;; not in GNU Emacs (YMMV). To use it with GNU emacs, you'll need to install ;; gnuserv yourself. At the time of the writing of this paragraph, you could ;; find gnuserv 3.12.4 at ;; ;; http://meltin.net/hacks/emacs/ ;; #!/bin/sh ;; # MH-E: launch an MH-E session in emacs on xwindows ;; ;; exec 2> /dev/null ;; if (gnudoit < /dev/null) ; then ;; true ;; else ;; if xmessage -buttons Yes:0,Cancel:1 "No emacs running gnuserv. ;; Start emacs?" -default Yes ;; then ;; (emacs &) ;; until (exec gnudoit < /dev/null) ;; do sleep 3 ;; done ;; fi ;; fi > /dev/null ;; ;; # this is approximately 277 hours ;; sleep 1000000 & ;; ;; # tell emacs what to do and the pid of our sleep process ;; gnudoit -q "(require 'mh-frame) ;; (mh-frame $!)" & ;; ;; # We become a zombie until the sleep process is killed ;; exit ;; ---------------------------------------------------------------------------- ;;; Change log: ;; 2002-11-13 Mark D. Baushke ;; (mh-frame-sh-pid): new defvar for this variable. ;; (mh-frame-delete-frame-now-flag): renamed from ;; mh-frame-delete-frame-now. ;; (mh-fame): use it. checkdoc fix. ;; (mh-frame-mh-quit-hook, mh-frame-kill-emacs-hook, ;; mh-frame-get-mh-frame, mh-quit): checkdoc fix. ;; Added RCS Id line to aid in bug reports. ;; This file is now at release 1.1 due to a variable name change. ;; ;; 2001-12-07 Eric Ding ;; (mh-frame): use make-frame instead of new-frame (deprecated, temp alias) ;; ;; 2001-11-30 Eric Ding ;; (mh-frame): rename get-mh-e-frame to mh-frame-get-mh-frame and move ;; definition out of mh-frame. ;; ;; 2001-11-30 Eric Ding ;; rename package to mh-frame ;; ;; Thu Nov 29 09:48:32 2001 Eric Ding ;; define frame-name if it's unbound, rather than checking for xemacs ;; release as frame-mh-e 1.0 ;; ;; Wed Nov 28 15:47:05 2001 Eric Ding ;; use eval-after-load rather than (require 'mh-e) ;; ;; Fri Dec 22 13:58:59 1995 Eric Ding ;; added using-xemacs variable ;; added (require 'mh-e) ;; changed naming from mh-* to frame-mh-e-* ;; conditionalized the frame-title-format change in frame-mh-e ;; added confirmation for mh-quit ;; added explicit defuns for hooks ;; changed (add-to-list features...) to (provide 'frame-mh-e) ;; ;; Fri Dec 22 15:17:12 1995 Eric Ding ;; changed string-match/eq to equal where appropriate ;; ;; Jan 2 1995 Mark Crimmins ;; ask for quit confirmation only if buffer name is "+inbox". ;; ---------------------------------------------------------------------------- ;;; Code: ;;; define frame-name if needed (currently only defined in XEmacs) (if (not (fboundp 'frame-name)) (defun frame-name (&optional FRAME) (let ((params (frame-parameters FRAME)) frame-name) (while (consp params) (let ((elt (car params))) (if (eq (car elt) 'name) (setq frame-name (cdr elt)))) (setq params (cdr params))) frame-name))) (defvar mh-frame-sh-pid nil "Variable to hold the PID of the MH-E frmae if it is running.") (defvar mh-frame-delete-frame-now-flag nil "Non-nil means that the MH-E frame should be killed.") (defun mh-frame (&optional pid) "Open MH-E in a new frame. Optional argument PID is saved to later be able to kill the frame." (interactive) (let (f) (cond ((setq f (mh-frame-get-mh-frame)) (raise-frame f)) (t (setq f (make-frame '((name . "MH-E")))))) (select-frame f)) (mh-rmail) (mh-rescan-folder) (mh-show) (setq mh-frame-sh-pid pid)) (defun mh-frame-get-mh-frame () "Look in the `frame-list' for the MH-E frame." (let (a (l (frame-list))) (while l (if (equal "MH-E" (frame-name (car l))) (setq a (car l))) (setq l (cdr l))) a)) (eval-after-load "mh-e" '(progn (if (not (fboundp 'mh-frame/original-mh-quit)) (fset 'mh-frame/original-mh-quit (symbol-function 'mh-quit))) (defun mh-quit () "Restore the previous window configuration, if one exists. If run from the +inbox buffer, query to delete the MH-E frame before calling the real \\[mh-frame/original-mh-quit] function." (interactive) (if (equal (buffer-name (current-buffer)) mh-inbox) (cond ((y-or-n-p "Quit MH-E? ") (setq mh-frame-delete-frame-now-flag t) (mh-frame/original-mh-quit)) (t (message nil))) (mh-frame/original-mh-quit))) )) (defun mh-frame-mh-quit-hook () "Hook to terminate the MH-E frame if one exists." (cond (mh-frame-delete-frame-now-flag (delete-frame) (if mh-frame-sh-pid (shell-command (concat "kill -9 " mh-frame-sh-pid))) (setq mh-frame-sh-pid nil) (setq mh-frame-delete-frame-now-flag nil)))) (add-hook 'mh-quit-hook 'mh-frame-mh-quit-hook) (defun mh-frame-kill-emacs-hook () "Hook to kille the MH-E frame process if one exists." (if mh-frame-sh-pid (shell-command (concat "kill -9 " mh-frame-sh-pid)))) (add-hook 'kill-emacs-hook 'mh-frame-kill-emacs-hook) (setq mh-frame-delete-frame-now-flag nil) (setq mh-frame-sh-pid nil) (provide 'mh-frame) ;;; Local Variables: ;;; indent-tabs-mode: nil ;;; sentence-end-double-space: nil ;;; End: ;;; mh-frame.el ends here mh-e-contrib-1.4/multi-prompt.el0100644000175700001440000001264107652272515016103 0ustar wohlerusers;;; multi-prompt.el --- completing read of multiple strings. ;; Copyright (C) 1996, 1997, 2000 Per Abrahamsen. ;; Author: Per Abrahamsen ;; Keywords: extensions ;; Version: 0.4 ;; Bogus-Bureaucratic-Cruft: How 'bout ESR and the LCD people agreed ;; on a common format? ;; LCD Archive Entry: ;; multi-prompt|Per Abrahamsen|abraham@dina.kvl.dk| ;; completing read of multiple strings| ;; 1996-08-31|0.1|~/functions/multi-prompt.el.Z| ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;; Commentary: ;; This package is written for use in Emacs Lisp programs, where the ;; user is prompted for a string of the form: ;; ;; FOO,BAR,BAZ ;; ;; where FOO, BAR, and BAZ are elements of some table. The function ;; `multi-prompt' is a replacement `completing-read' that will allow ;; the user to enter a string like the above, yet get completion on ;; both FOO, BAR, and BAZ. ;;; Change Log: ;; ;; Wed Oct 3 14:48:11 EDT 2001 Peter S Galbraith ;; * Version 0.4 released. ;; multi-prompt-next fixed for emacs-21. ;; Mon Jan 3 16:58:49 MET 2000 ;; * Version 0.2 released. ;; Don't allow partial completions when require-match is true. ;; Reported by 'anonymous'. ;; Sat Feb 15 17:58:31 MET 1997 ;; * Version 0.2 released. ;; Renamed predicate to `mp-predicate'. ;; Sat Aug 31 18:32:20 MET DST 1996 ;; * Version 0.1 released. ;; Fixed `predicate' bug. ;; Added provide. ;; Added `multi-prompt-found' variable. ;; Sat Aug 31 16:29:14 MET DST 1996 ;; * Created. ;;; Code: (defvar multi-prompt-found nil "List of entries currently added during a `multi-prompt'.") (defun multi-prompt (separator unique prompt table &optional mp-predicate require-match initial history) "Completing read of a list of strings. The first argument SEPARATOR should be the string (of length 1) to separate the elements in the list. The second argument UNIQUE should be non-nil, if each element must be unique. The remaining elements PROMPT, TABLE, MP-PREDICATE, REQUIRE-MATCH, INITIAL, and HISTORY are the arguments to `completing-read'." (let ((old-map (if require-match minibuffer-local-must-match-map minibuffer-local-completion-map)) (new-map (make-sparse-keymap))) (if (fboundp 'set-keymap-parent) ;; `set-keymap-parent' was introduced in Emacs 19.32. (set-keymap-parent new-map old-map) (setq new-map (copy-keymap old-map))) (define-key new-map separator (if require-match 'multi-prompt-next-must-match 'multi-prompt-next)) (define-key new-map "\C-?" 'multi-prompt-delete) (let* ((minibuffer-local-completion-map new-map) (minibuffer-local-must-match-map new-map) (multi-prompt-found nil) (done nil) (filter (cond (unique (lambda (x) (and (not (member (car x) multi-prompt-found)) (or (null mp-predicate) (funcall mp-predicate x))))) (mp-predicate))) (answer (catch 'multi-prompt-exit (while t (let ((extra (catch 'multi-prompt-next (throw 'multi-prompt-exit (completing-read prompt table filter require-match initial history))))) (cond ((eq extra 'back) (when multi-prompt-found (setq prompt (substring prompt 0 (- 0 (length separator) (length (car multi-prompt-found)))) initial (car multi-prompt-found)) (setq multi-prompt-found (cdr multi-prompt-found)))) (t (setq prompt (concat prompt extra separator) initial nil) (setq multi-prompt-found (cons extra multi-prompt-found))))))))) (if answer (nreverse (cons answer multi-prompt-found)) multi-prompt-found)))) (defun multi-prompt-delete () "Delete the previous character." (interactive) (if (bobp) (throw 'multi-prompt-next 'back) (call-interactively 'backward-delete-char))) (defun multi-prompt-next () "Return the next input." (interactive) (throw 'multi-prompt-next (cond ((fboundp 'minibuffer-contents-no-properties) ;; buffer-substring no longer works in emacs-21, it returns ;; the whole prompt line. Use this instead. (minibuffer-contents-no-properties)) (t (buffer-substring-no-properties (point-min) (point-max)))))) (defun multi-prompt-next-must-match () "Throw an error if the next input is invalid." (interactive) (when (call-interactively 'minibuffer-complete) (let ((content (buffer-substring-no-properties (point-min) (point-max)))) (when (or (not require-match) (assoc content table)) (throw 'multi-prompt-next content))))) (provide 'multi-prompt) ;;; Local Variables: ;;; indent-tabs-mode: nil ;;; sentence-end-double-space: nil ;;; End: ;;; multi-prompt.el ends here