From: Bill Wohler Date: Wed, 11 Jan 2006 19:50:07 +0000 (+0000) Subject: * Makefile (MH_E_SRC): Add mh-buffers.el. X-Git-Tag: emacs-pretest-22.0.90~4798 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9c2cf222ca61e490c5fd52f712ffe3ec5a3e4da5;p=emacs.git * 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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0e4d34248f3..c071922fb16 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-01-11 Bill Wohler + + * 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 * font-lock.el (cpp-font-lock-keywords): Font lock keywords for diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 1cc34fcb663..f45ae590099 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -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 " >> $@ echo ";; Keywords: mail" >> $@ echo ";;; Commentary:" >> $@ diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 6e7fd1ac7d7..4558c336e2a 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,5 +1,29 @@ 2006-01-11 Bill Wohler + * 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). diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el index c1476a26535..af369e0a477 100644 --- a/lisp/mh-e/mh-alias.el +++ b/lisp/mh-e/mh-alias.el @@ -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 index 00000000000..88fb043a800 --- /dev/null +++ b/lisp/mh-e/mh-buffers.el @@ -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 +;; Maintainer: Bill Wohler +;; 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 diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el index 1912c5e0594..6457638b29a 100644 --- a/lisp/mh-e/mh-comp.el +++ b/lisp/mh-e/mh-comp.el @@ -38,6 +38,7 @@ (require 'easymenu) (require 'gnus-util) +(require 'mh-buffers) (require 'mh-e) (require 'mh-gnus) diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index 43743e3cad2..711c9625fb4 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -92,6 +92,7 @@ (require 'easymenu) (require 'gnus-util) +(require 'mh-buffers) (require 'mh-seq) (require 'mh-utils) diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el index f19314403e1..ac5f80adbff 100644 --- a/lisp/mh-e/mh-funcs.el +++ b/lisp/mh-e/mh-funcs.el @@ -37,6 +37,7 @@ (eval-when-compile (require 'mh-acros)) (mh-require-cl) +(require 'mh-buffers) (require 'mh-e) diff --git a/lisp/mh-e/mh-index.el b/lisp/mh-e/mh-index.el index 69ef7ca9c1a..8a32947bd95 100644 --- a/lisp/mh-e/mh-index.el +++ b/lisp/mh-e/mh-index.el @@ -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) diff --git a/lisp/mh-e/mh-init.el b/lisp/mh-e/mh-init.el index 3df0dee0115..6d2f5f5d137 100644 --- a/lisp/mh-e/mh-init.el +++ b/lisp/mh-e/mh-init.el @@ -41,6 +41,7 @@ (eval-when-compile (require 'mh-acros)) (mh-require-cl) +(require 'mh-buffers) (require 'mh-utils) (defvar mh-sys-path diff --git a/lisp/mh-e/mh-junk.el b/lisp/mh-e/mh-junk.el index 71d3fbf7b8b..c94bb153025 100644 --- a/lisp/mh-e/mh-junk.el +++ b/lisp/mh-e/mh-junk.el @@ -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 diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el index 0932dab1e94..613eec23fe1 100644 --- a/lisp/mh-e/mh-mime.el +++ b/lisp/mh-e/mh-mime.el @@ -40,6 +40,7 @@ (mh-require-cl) (require 'gnus-util) +(require 'mh-buffers) (require 'mh-comp) (require 'mh-gnus) diff --git a/lisp/mh-e/mh-print.el b/lisp/mh-e/mh-print.el index a4d53731c72..fd837072014 100644 --- a/lisp/mh-e/mh-print.el +++ b/lisp/mh-e/mh-print.el @@ -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 ;; Maintainer: Bill Wohler @@ -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)) diff --git a/lisp/mh-e/mh-seq.el b/lisp/mh-e/mh-seq.el index c24631041d4..5432612ea8c 100644 --- a/lisp/mh-e/mh-seq.el +++ b/lisp/mh-e/mh-seq.el @@ -74,6 +74,7 @@ (eval-when-compile (require 'mh-acros)) (mh-require-cl) +(require 'mh-buffers) (require 'mh-e) diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el index d9bb6dda979..7f8e24c9a04 100644 --- a/lisp/mh-e/mh-utils.el +++ b/lisp/mh-e/mh-utils.el @@ -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.