1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-31 09:20:54 -08:00

* 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.
This commit is contained in:
Bill Wohler 2006-01-11 19:50:07 +00:00
parent 4076cbf66c
commit 9c2cf222ca
15 changed files with 151 additions and 67 deletions

View 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

View 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:" >> $@

View 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).

View 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.

89
lisp/mh-e/mh-buffers.el Normal file
View file

@ -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

View file

@ -38,6 +38,7 @@
(require 'easymenu)
(require 'gnus-util)
(require 'mh-buffers)
(require 'mh-e)
(require 'mh-gnus)

View file

@ -92,6 +92,7 @@
(require 'easymenu)
(require 'gnus-util)
(require 'mh-buffers)
(require 'mh-seq)
(require 'mh-utils)

View file

@ -37,6 +37,7 @@
(eval-when-compile (require 'mh-acros))
(mh-require-cl)
(require 'mh-buffers)
(require 'mh-e)

View 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)
@ -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 @@ 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)

View file

@ -41,6 +41,7 @@
(eval-when-compile (require 'mh-acros))
(mh-require-cl)
(require 'mh-buffers)
(require 'mh-utils)
(defvar mh-sys-path

View 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

View file

@ -40,6 +40,7 @@
(mh-require-cl)
(require 'gnus-util)
(require 'mh-buffers)
(require 'mh-comp)
(require 'mh-gnus)

View 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))

View file

@ -74,6 +74,7 @@
(eval-when-compile (require 'mh-acros))
(mh-require-cl)
(require 'mh-buffers)
(require 'mh-e)

View 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) ? ))))
(insert "\n \n"))
(buffer-size)))
;;; Issue commands to MH.