]> code.delx.au - gnu-emacs/commitdiff
* Makefile (MH_E_SRC): Add mh-buffers.el.
authorBill Wohler <wohler@newt.com>
Wed, 11 Jan 2006 19:50:07 +0000 (19:50 +0000)
committerBill Wohler <wohler@newt.com>
Wed, 11 Jan 2006 19:50:07 +0000 (19:50 +0000)
* 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.

15 files changed:
lisp/ChangeLog
lisp/Makefile.in
lisp/mh-e/ChangeLog
lisp/mh-e/mh-alias.el
lisp/mh-e/mh-buffers.el [new file with mode: 0644]
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

index 0e4d34248f37aed499472bcb8554b88431504cf2..c071922fb16fcb9b42f1df4050379c632e4af372 100644 (file)
@@ -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
index 1cc34fcb6634ce9ccb3bb6323fb3dce943dd0835..f45ae590099e6514e41b4ea1f282a2e2724d62c7 100644 (file)
@@ -220,21 +220,21 @@ $(lisp)/progmodes/cc-mode.elc: \
 # 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:" >> $@
index 6e7fd1ac7d7aacc12226adbdce07f56c87a31245..4558c336e2ae83266d26260123a4340450f12a67 100644 (file)
@@ -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).
 
index c1476a26535fcde6a63146785288c19449550d52..af369e0a4775ccfaea1860e3f815c1acb6a45b36 100644 (file)
@@ -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.
diff --git a/lisp/mh-e/mh-buffers.el b/lisp/mh-e/mh-buffers.el
new file mode 100644 (file)
index 0000000..88fb043
--- /dev/null
@@ -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'.")
+
+\f
+
+(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) ?\f))))
+      (insert "\n\f\n"))
+    (buffer-size)))
+
+(provide 'mh-buffers)
+
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; sentence-end-double-space: nil
+;; End:
+
+;;; mh-buffers.el ends here
index 1912c5e05942f90deca6531c4523adaaec0289b7..6457638b29a40058c236152ef0605dbbf53e0d30 100644 (file)
@@ -38,6 +38,7 @@
 
 (require 'easymenu)
 (require 'gnus-util)
+(require 'mh-buffers)
 (require 'mh-e)
 (require 'mh-gnus)
 
index 43743e3cad23a04143e9bbcb5f1e1f2d478a8559..711c9625fb4b70c2a9f88cdca239f3e82ff60b41 100644 (file)
@@ -92,6 +92,7 @@
 
 (require 'easymenu)
 (require 'gnus-util)
+(require 'mh-buffers)
 (require 'mh-seq)
 (require 'mh-utils)
 
index f19314403e1ab0e3a70dec899c58d54ffe93fa16..ac5f80adbff1c1ff311fdd0b4f329e8d429078c4 100644 (file)
@@ -37,6 +37,7 @@
 
 (eval-when-compile (require 'mh-acros))
 (mh-require-cl)
+(require 'mh-buffers)
 (require 'mh-e)
 
 \f
index 69ef7ca9c1ad4008bdabc50a681c80439a0d9849..8a32947bd95e4bec64982d6877a3b9fdce34dad6 100644 (file)
@@ -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)
 (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*")
-
 \f
 
 ;; A few different checksum programs are supported. The supported programs
@@ -219,7 +216,7 @@ origin-index) map is updated too."
   (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 @@ origin-index) map is updated too."
             (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 @@ any sub-folders that may be present.
 
 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 @@ any sub-folders that may be present.
 
 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 @@ this daily from cron:
 
 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 @@ Search for messages belonging to `mh-flists-sequence' in the
 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 @@ recursively. All parameters ARGS are ignored."
               (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 @@ this daily from cron:
 
 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 @@ instead of \"index\".
 
 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 @@ is used to search."
       (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)
index 3df0dee0115251ecfb0cf8bcf8dbb6382ca49315..6d2f5f5d1375d5cf5df62d4d1b6e56401c008dfe 100644 (file)
@@ -41,6 +41,7 @@
 
 (eval-when-compile (require 'mh-acros))
 (mh-require-cl)
+(require 'mh-buffers)
 (require 'mh-utils)
 
 (defvar mh-sys-path
index 71d3fbf7b8bbf96674da6ab8661ee4963d52fe73..c94bb1530258f5fe2cde74e173900cd10c0d9edc 100644 (file)
@@ -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
index 0932dab1e944d23c0798b831fbd0ef8a10007d8c..613eec23fe15bf3dc8fb30fa7fa12246c0adeeb5 100644 (file)
@@ -40,6 +40,7 @@
 (mh-require-cl)
 
 (require 'gnus-util)
+(require 'mh-buffers)
 (require 'mh-comp)
 (require 'mh-gnus)
 
index a4d53731c72a32ba4fb941cd4b411482b6b1d390..fd837072014cd724bfcfee728df9ff7582ab33f9 100644 (file)
@@ -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))
index c24631041d4584975be42bb6f786ebbc546dfcff..5432612ea8ce6e9711a53ef0d89cf405b2ea88cb 100644 (file)
@@ -74,6 +74,7 @@
 (eval-when-compile (require 'mh-acros))
 (mh-require-cl)
 
+(require 'mh-buffers)
 (require 'mh-e)
 
 \f
index d9bb6dda979cbf4b3752e0f59bdcdb0ec2131d72..7f8e24c9a04e4b82bc9b701943af0680f0e18335 100644 (file)
@@ -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 @@ Name of the Previous sequence.")
 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 @@ used in searching."
                     (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) ?\f))))
-      (insert "\n\f\n"))
-    (buffer-size)))
-
 \f
 
 ;;; Issue commands to MH.