changeset 68135:03bac2d0a4aa

* Makefile (MH_E_SRC): Add mh-buffers.el. * emacs/lisp/Makefile.in (MH_E_SRC): Rename from MH-E-SRC since the dashes can give some systems gas. Add new file mh-buffers.el. * emacs/lisp/mh-e/mh-buffers.el: New file. Contains constants and code from mh-index.el and mh-utils.el. * emacs/lisp/mh-e/mh-alias.el: * emacs/lisp/mh-e/mh-comp.el: * emacs/lisp/mh-e/mh-e.el: * emacs/lisp/mh-e/mh-funcs.el: * emacs/lisp/mh-e/mh-init.el: * emacs/lisp/mh-e/mh-junk.el: * emacs/lisp/mh-e/mh-mime.el: * emacs/lisp/mh-e/mh-print.el: * emacs/lisp/mh-e/mh-seq.el: Require new file mh-buffers.el. * emacs/lisp/mh-e/mh-index.el: Require new file mh-buffers.el. (mh-index-temp-buffer, mh-checksum-buffer): Move to new file mh-buffers.el. * emacs/lisp/mh-e/mh-utils.el: Require new file mh-buffers.el. (mh-temp-buffer, mh-temp-fetch-buffer) (mh-aliases-buffer, mh-folders-buffer, mh-help-buffer) (mh-info-buffer, mh-log-buffer, mh-mail-delivery-buffer) (mh-recipients-buffer, mh-sequences-buffer, mh-log-buffer-lines) (mh-truncate-log-buffer): Move to new file mh-buffers.el.
author Bill Wohler <wohler@newt.com>
date Wed, 11 Jan 2006 19:50:07 +0000
parents 48bf79d0aede
children 98275190ec04
files lisp/ChangeLog lisp/Makefile.in lisp/mh-e/ChangeLog lisp/mh-e/mh-alias.el lisp/mh-e/mh-buffers.el lisp/mh-e/mh-comp.el lisp/mh-e/mh-e.el lisp/mh-e/mh-funcs.el lisp/mh-e/mh-index.el lisp/mh-e/mh-init.el lisp/mh-e/mh-junk.el lisp/mh-e/mh-mime.el lisp/mh-e/mh-print.el lisp/mh-e/mh-seq.el lisp/mh-e/mh-utils.el
diffstat 15 files changed, 151 insertions(+), 67 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Jan 11 14:29:44 2006 +0000
+++ b/lisp/ChangeLog	Wed Jan 11 19:50:07 2006 +0000
@@ -1,3 +1,8 @@
+2006-01-11  Bill Wohler  <wohler@newt.com>
+
+	* Makefile.in (MH_E_SRC): Rename from MH-E-SRC since the dashes
+	can give some systems gas. Add new file mh-buffers.el.
+
 2006-01-06  Masatake YAMATO  <jet@gyve.org>
 
 	* font-lock.el (cpp-font-lock-keywords): Font lock keywords for
--- a/lisp/Makefile.in	Wed Jan 11 14:29:44 2006 +0000
+++ b/lisp/Makefile.in	Wed Jan 11 19:50:07 2006 +0000
@@ -220,21 +220,21 @@
 # Update MH-E internal autoloads. These are not to be confused with
 # the autoloads for the MH-E entry points, which are already in
 # loaddefs.el.
-MH-E-SRC = $(lisp)/mh-e/mh-acros.el $(lisp)/mh-e/mh-alias.el	\
-	$(lisp)/mh-e/mh-comp.el $(lisp)/mh-e/mh-customize.el	\
-	$(lisp)/mh-e/mh-e.el $(lisp)/mh-e/mh-funcs.el		\
-	$(lisp)/mh-e/mh-mime.el $(lisp)/mh-e/mh-pick.el		\
-	$(lisp)/mh-e/mh-print.el $(lisp)/mh-e/mh-inc.el		\
-	$(lisp)/mh-e/mh-init.el $(lisp)/mh-e/mh-index.el	\
-	$(lisp)/mh-e/mh-identity.el $(lisp)/mh-e/mh-junk.el	\
-	$(lisp)/mh-e/mh-seq.el $(lisp)/mh-e/mh-speed.el		\
-	$(lisp)/mh-e/mh-utils.el
+MH_E_SRC = $(lisp)/mh-e/mh-acros.el $(lisp)/mh-e/mh-alias.el	\
+	$(lisp)/mh-e/mh-buffers.el $(lisp)/mh-e/mh-comp.el	\
+	$(lisp)/mh-e/mh-customize.el $(lisp)/mh-e/mh-e.el	\
+	$(lisp)/mh-e/mh-funcs.el $(lisp)/mh-e/mh-mime.el	\
+	$(lisp)/mh-e/mh-pick.el $(lisp)/mh-e/mh-print.el	\
+	$(lisp)/mh-e/mh-inc.el $(lisp)/mh-e/mh-init.el		\
+	$(lisp)/mh-e/mh-index.el $(lisp)/mh-e/mh-identity.el	\
+	$(lisp)/mh-e/mh-junk.el $(lisp)/mh-e/mh-seq.el		\
+	$(lisp)/mh-e/mh-speed.el $(lisp)/mh-e/mh-utils.el
 
 mh-autoloads: $(lisp)/mh-e/mh-loaddefs.el
-$(lisp)/mh-e/mh-loaddefs.el: $(MH-E-SRC)
+$(lisp)/mh-e/mh-loaddefs.el: $(MH_E_SRC)
 	echo ";;; mh-loaddefs.el --- automatically extracted autoloads" > $@
 	echo ";;" >> $@
-	echo ";; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc." >> $@
+	echo ";; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc." >> $@
 	echo ";; Author: Bill Wohler <wohler@newt.com>" >> $@
 	echo ";; Keywords: mail" >> $@
 	echo ";;; Commentary:" >> $@
--- a/lisp/mh-e/ChangeLog	Wed Jan 11 14:29:44 2006 +0000
+++ b/lisp/mh-e/ChangeLog	Wed Jan 11 19:50:07 2006 +0000
@@ -1,5 +1,29 @@
 2006-01-11  Bill Wohler  <wohler@newt.com>
 
+	* mh-buffers.el: New file. Contains constants and code from
+	mh-index.el and mh-utils.el.
+
+	* mh-alias.el: 
+	* mh-comp.el: 
+	* mh-e.el: 
+	* mh-funcs.el: 
+	* mh-init.el:
+	* mh-junk.el: 
+	* mh-mime.el:
+	* mh-print.el:
+	* mh-seq.el: Require new file mh-buffers.el.
+
+	* mh-index.el: Require new file mh-buffers.el.
+	(mh-index-temp-buffer, mh-checksum-buffer): Move to new file
+	mh-buffers.el.
+
+	* mh-utils.el: Require new file mh-buffers.el.
+	(mh-temp-buffer, mh-temp-fetch-buffer)
+	(mh-aliases-buffer, mh-folders-buffer, mh-help-buffer)
+	(mh-info-buffer, mh-log-buffer, mh-mail-delivery-buffer)
+	(mh-recipients-buffer, mh-sequences-buffer, mh-log-buffer-lines)
+	(mh-truncate-log-buffer): Move to new file mh-buffers.el.
+
 	* mh-comp.el (mh-forward): Cosmetics on prompt when draft exists.
 	(mh-send-letter): Add -msgid to mh-send-args (closes SF #725425).
 
--- a/lisp/mh-e/mh-alias.el	Wed Jan 11 14:29:44 2006 +0000
+++ b/lisp/mh-e/mh-alias.el	Wed Jan 11 19:50:07 2006 +0000
@@ -33,6 +33,7 @@
 
 (eval-when-compile (require 'mh-acros))
 (mh-require-cl)
+(require 'mh-buffers)
 (require 'mh-e)
 (load "cmr" t t)                        ; Non-fatal dependency for
 					; completing-read-multiple.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/mh-e/mh-buffers.el	Wed Jan 11 19:50:07 2006 +0000
@@ -0,0 +1,89 @@
+;;; mh-buffers.el --- Temporary buffer constants and utilities used by MH-E
+
+;; Copyright (C) 1993, 1995, 1997,
+;;  2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+
+;; Author: Bill Wohler <wohler@newt.com>
+;; Maintainer: Bill Wohler <wohler@newt.com>
+;; Keywords: mail
+;; See: mh-e.el
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;; Temporary buffer constants and utilities used by MH-E.
+
+;;; Change Log:
+
+;;; Code:
+
+;; The names of ephemeral buffers have a " *mh-" prefix (so that they
+;; are hidden and can be programmatically removed in mh-quit), and the
+;; variable names have the form mh-temp-.*-buffer.
+(defconst mh-temp-buffer " *mh-temp*")  ;scratch
+(defconst mh-temp-checksum-buffer " *mh-checksum*")
+(defconst mh-temp-fetch-buffer " *mh-fetch*")  ;wget/curl/fetch output
+(defconst mh-temp-index-buffer " *mh-index*")
+
+;; The names of MH-E buffers that are not ephemeral and can be used by
+;; the user (and deleted by the user when no longer needed) have a
+;; "*MH-E " prefix (so they can be programmatically removed in
+;; mh-quit), and the variable names have the form mh-.*-buffer.
+;; Temporary buffers for search results
+(defconst mh-aliases-buffer "*MH-E Aliases*") ;alias lookups
+(defconst mh-folders-buffer "*MH-E Folders*") ;folder list
+(defconst mh-help-buffer "*MH-E Help*") ;quick help
+(defconst mh-info-buffer "*MH-E Info*") ;version information buffer
+(defconst mh-log-buffer "*MH-E Log*") ;output of MH commands and so on
+(defconst mh-mail-delivery-buffer "*MH-E Mail Delivery*") ;mail delivery log
+(defconst mh-recipients-buffer "*MH-E Recipients*") ;killed when draft sent
+(defconst mh-sequences-buffer "*MH-E Sequences*") ;sequences list
+
+(defvar mh-log-buffer-lines 100
+  "Number of lines to keep in `mh-log-buffer'.")
+
+
+
+(defun mh-truncate-log-buffer ()
+  "If `mh-log-buffer' is too big then truncate it.
+If the number of lines in `mh-log-buffer' exceeds
+`mh-log-buffer-lines' then keep only the last
+`mh-log-buffer-lines'. As a side effect the point is set to the
+end of the log buffer.
+
+The function returns the size of the final size of the log buffer."
+  (with-current-buffer (get-buffer-create mh-log-buffer)
+    (goto-char (point-max))
+    (save-excursion
+      (when (equal (forward-line (- mh-log-buffer-lines)) 0)
+        (delete-region (point-min) (point))))
+    (unless (or (bobp)
+                (save-excursion
+                  (and (equal (forward-line -1) 0) (equal (char-after) ?))))
+      (insert "\n\n"))
+    (buffer-size)))
+
+(provide 'mh-buffers)
+
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; sentence-end-double-space: nil
+;; End:
+
+;;; mh-buffers.el ends here
--- a/lisp/mh-e/mh-comp.el	Wed Jan 11 14:29:44 2006 +0000
+++ b/lisp/mh-e/mh-comp.el	Wed Jan 11 19:50:07 2006 +0000
@@ -38,6 +38,7 @@
 
 (require 'easymenu)
 (require 'gnus-util)
+(require 'mh-buffers)
 (require 'mh-e)
 (require 'mh-gnus)
 
--- a/lisp/mh-e/mh-e.el	Wed Jan 11 14:29:44 2006 +0000
+++ b/lisp/mh-e/mh-e.el	Wed Jan 11 19:50:07 2006 +0000
@@ -92,6 +92,7 @@
 
 (require 'easymenu)
 (require 'gnus-util)
+(require 'mh-buffers)
 (require 'mh-seq)
 (require 'mh-utils)
 
--- a/lisp/mh-e/mh-funcs.el	Wed Jan 11 14:29:44 2006 +0000
+++ b/lisp/mh-e/mh-funcs.el	Wed Jan 11 19:50:07 2006 +0000
@@ -37,6 +37,7 @@
 
 (eval-when-compile (require 'mh-acros))
 (mh-require-cl)
+(require 'mh-buffers)
 (require 'mh-e)
 
 
--- a/lisp/mh-e/mh-index.el	Wed Jan 11 14:29:44 2006 +0000
+++ b/lisp/mh-e/mh-index.el	Wed Jan 11 19:50:07 2006 +0000
@@ -46,6 +46,7 @@
 (eval-when-compile (require 'mh-acros))
 (mh-require-cl)
 
+(require 'mh-buffers)
 (require 'mh-e)
 (require 'mh-mime)
 (require 'mh-pick)
@@ -85,10 +86,6 @@
 (defvar mh-index-folder "+mhe-index"
   "Folder that contains the folders resulting from the index searches.")
 
-;; Temporary buffers for search results
-(defvar mh-index-temp-buffer " *mh-index-temp*")
-(defvar mh-checksum-buffer " *mh-checksum-buffer*")
-
 
 
 ;; A few different checksum programs are supported. The supported programs
@@ -219,7 +216,7 @@
   (clrhash mh-index-msg-checksum-map)
   (save-excursion
     ;; Clear temp buffer
-    (set-buffer (get-buffer-create mh-checksum-buffer))
+    (set-buffer (get-buffer-create mh-temp-checksum-buffer))
     (erase-buffer)
     ;; Run scan to check if any messages needs MD5 annotations at all
     (with-temp-buffer
@@ -236,7 +233,7 @@
             (cond ((not (string-match "^[0-9]*$" msg)))
                   ((eolp)
                    ;; need to compute checksum
-                   (set-buffer mh-checksum-buffer)
+                   (set-buffer mh-temp-checksum-buffer)
                    (insert mh-user-path (substring folder 1) "/" msg "\n"))
                   (t
                    ;; update maps
@@ -1055,7 +1052,7 @@
 
 In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP
 is used to search."
-  (set-buffer (get-buffer-create mh-index-temp-buffer))
+  (set-buffer (get-buffer-create mh-temp-index-buffer))
   (erase-buffer)
   (setq mh-index-pick-folder
         (concat "+" (substring folder-path (length mh-user-path))))
@@ -1091,7 +1088,7 @@
 
 In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP
 is used to search."
-  (set-buffer (get-buffer-create mh-index-temp-buffer))
+  (set-buffer (get-buffer-create mh-temp-index-buffer))
   (erase-buffer)
   (call-process mh-grep-binary nil '(t nil) nil
                 "-i" "-r" search-regexp folder-path)
@@ -1165,7 +1162,7 @@
 
 In a program, FOLDER-PATH is the directory in which
 SEARCH-REGEXP-LIST is used to search."
-  (set-buffer (get-buffer-create mh-index-temp-buffer))
+  (set-buffer (get-buffer-create mh-temp-index-buffer))
   (erase-buffer)
   (unless mh-mairix-binary
     (error "Set `mh-mairix-binary' appropriately"))
@@ -1287,7 +1284,7 @@
 folders specified by `mh-flists-search-folders'. If
 `mh-recursive-folders-flag' is t, then the folders are searched
 recursively. All parameters ARGS are ignored."
-  (set-buffer (get-buffer-create mh-index-temp-buffer))
+  (set-buffer (get-buffer-create mh-temp-index-buffer))
   (erase-buffer)
   (unless (executable-find "sh")
     (error "Didn't find sh"))
@@ -1306,7 +1303,7 @@
               (expand-file-name "mhpath" mh-progs) " \"+$folder\" " seq "\n"
               "done\n"))
     (call-process-region
-     (point-min) (point-max) "sh" nil (get-buffer mh-index-temp-buffer))))
+     (point-min) (point-max) "sh" nil (get-buffer mh-temp-index-buffer))))
 
 ;;;###mh-autoload
 (defun mh-index-sequenced-messages (folders sequence)
@@ -1443,7 +1440,7 @@
 
 In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP
 is used to search."
-  (set-buffer (get-buffer-create mh-index-temp-buffer))
+  (set-buffer (get-buffer-create mh-temp-index-buffer))
   (erase-buffer)
   (unless mh-swish-binary
     (error "Set `mh-swish-binary' appropriately"))
@@ -1532,7 +1529,7 @@
 
 In a program, FOLDER-PATH is the directory in which SEARCH-REGEXP is
 used to search."
-  (set-buffer (get-buffer-create mh-index-temp-buffer))
+  (set-buffer (get-buffer-create mh-temp-index-buffer))
   (erase-buffer)
   (unless mh-swish++-binary
     (error "Set `mh-swish++-binary' appropriately"))
@@ -1615,7 +1612,7 @@
       (error "Namazu directory %s not present" namazu-index-directory))
     (unless (executable-find mh-namazu-binary)
       (error "Set `mh-namazu-binary' appropriately"))
-    (set-buffer (get-buffer-create mh-index-temp-buffer))
+    (set-buffer (get-buffer-create mh-temp-index-buffer))
     (erase-buffer)
     (call-process mh-namazu-binary nil '(t nil) nil
                   "-alR" search-regexp namazu-index-directory)
--- a/lisp/mh-e/mh-init.el	Wed Jan 11 14:29:44 2006 +0000
+++ b/lisp/mh-e/mh-init.el	Wed Jan 11 19:50:07 2006 +0000
@@ -41,6 +41,7 @@
 
 (eval-when-compile (require 'mh-acros))
 (mh-require-cl)
+(require 'mh-buffers)
 (require 'mh-utils)
 
 (defvar mh-sys-path
--- a/lisp/mh-e/mh-junk.el	Wed Jan 11 14:29:44 2006 +0000
+++ b/lisp/mh-e/mh-junk.el	Wed Jan 11 19:50:07 2006 +0000
@@ -34,6 +34,7 @@
 
 (eval-when-compile (require 'mh-acros))
 (mh-require-cl)
+(require 'mh-buffers)
 (require 'mh-e)
 
 ;; Interactive functions callable from the folder buffer
--- a/lisp/mh-e/mh-mime.el	Wed Jan 11 14:29:44 2006 +0000
+++ b/lisp/mh-e/mh-mime.el	Wed Jan 11 19:50:07 2006 +0000
@@ -40,6 +40,7 @@
 (mh-require-cl)
 
 (require 'gnus-util)
+(require 'mh-buffers)
 (require 'mh-comp)
 (require 'mh-gnus)
 
--- a/lisp/mh-e/mh-print.el	Wed Jan 11 14:29:44 2006 +0000
+++ b/lisp/mh-e/mh-print.el	Wed Jan 11 19:50:07 2006 +0000
@@ -1,6 +1,6 @@
 ;;; mh-print.el --- MH-E printing support
 
-;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Jeffrey C Honig <jch@honig.net>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -33,6 +33,7 @@
 (eval-when-compile (require 'mh-acros))
 (mh-require-cl)
 (require 'ps-print)
+(require 'mh-buffers)
 (require 'mh-utils)
 (require 'mh-funcs)
 (eval-when-compile (require 'mh-seq))
--- a/lisp/mh-e/mh-seq.el	Wed Jan 11 14:29:44 2006 +0000
+++ b/lisp/mh-e/mh-seq.el	Wed Jan 11 19:50:07 2006 +0000
@@ -74,6 +74,7 @@
 (eval-when-compile (require 'mh-acros))
 (mh-require-cl)
 
+(require 'mh-buffers)
 (require 'mh-e)
 
 
--- a/lisp/mh-e/mh-utils.el	Wed Jan 11 14:29:44 2006 +0000
+++ b/lisp/mh-e/mh-utils.el	Wed Jan 11 19:50:07 2006 +0000
@@ -45,6 +45,7 @@
 
 (require 'font-lock)
 (require 'gnus-util)
+(require 'mh-buffers)
 (require 'mh-customize)
 (require 'mh-inc)
 (require 'mouse)
@@ -517,28 +518,6 @@
 Set to \"+inbox\" if no such component.
 Name of the Inbox folder.")
 
-;; The names of ephemeral buffers have a " *mh-" prefix (so that they are
-;; hidden and can be programmatically removed in mh-quit), and the variable
-;; names have the form mh-temp-.*-buffer.
-(defconst mh-temp-buffer " *mh-temp*")  ;scratch
-(defconst mh-temp-fetch-buffer " *mh-fetch*")  ;wget/curl/fetch output
-
-;; The names of MH-E buffers that are not ephemeral and can be used by the
-;; user (and deleted by the user when no longer needed) have a "*MH-E " prefix
-;; (so they can be programmatically removed in mh-quit), and the variable
-;; names have the form mh-.*-buffer.
-(defconst mh-aliases-buffer "*MH-E Aliases*") ;alias lookups
-(defconst mh-folders-buffer "*MH-E Folders*") ;folder list
-(defconst mh-help-buffer "*MH-E Help*") ;quick help
-(defconst mh-info-buffer "*MH-E Info*") ;version information buffer
-(defconst mh-log-buffer "*MH-E Log*") ;output of MH commands and so on
-(defconst mh-mail-delivery-buffer "*MH-E Mail Delivery*") ;mail delivery log
-(defconst mh-recipients-buffer "*MH-E Recipients*") ;killed when draft sent
-(defconst mh-sequences-buffer "*MH-E Sequences*") ;sequences list
-
-(defvar mh-log-buffer-lines 100
-  "Number of lines to keep in `mh-log-buffer'.")
-
 (defvar mh-previous-window-config nil
   "Window configuration before MH-E command.")
 
@@ -2388,25 +2367,6 @@
                     (mh-expand-file-name folder-name)))))
     folder-name))
 
-(defun mh-truncate-log-buffer ()
-  "If `mh-log-buffer' is too big then truncate it.
-If the number of lines in `mh-log-buffer' exceeds
-`mh-log-buffer-lines' then keep only the last
-`mh-log-buffer-lines'. As a side effect the point is set to the
-end of the log buffer.
-
-The function returns the size of the final size of the log buffer."
-  (with-current-buffer (get-buffer-create mh-log-buffer)
-    (goto-char (point-max))
-    (save-excursion
-      (when (equal (forward-line (- mh-log-buffer-lines)) 0)
-        (delete-region (point-min) (point))))
-    (unless (or (bobp)
-                (save-excursion
-                  (and (equal (forward-line -1) 0) (equal (char-after) ?))))
-      (insert "\n\n"))
-    (buffer-size)))
-
 
 
 ;;; Issue commands to MH.