Mercurial > emacs
annotate lisp/mh-e/mh-buffers.el @ 103925:1022bba335de
Regenerate.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Thu, 16 Jul 2009 03:16:41 +0000 |
parents | 9d175782fb33 |
children | 1d1d5d9bd884 |
rev | line source |
---|---|
68465 | 1 ;;; mh-buffers.el --- MH-E buffer constants and utilities |
68135
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
2 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
3 ;; Copyright (C) 1993, 1995, 1997, |
101467
9d175782fb33
Follow Glenn's lead and update format of Copyright.
Bill Wohler <wohler@newt.com>
parents:
100908
diff
changeset
|
4 ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 |
9d175782fb33
Follow Glenn's lead and update format of Copyright.
Bill Wohler <wohler@newt.com>
parents:
100908
diff
changeset
|
5 ;; Free Software Foundation, Inc. |
68135
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
6 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
7 ;; Author: Bill Wohler <wohler@newt.com> |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
8 ;; Maintainer: Bill Wohler <wohler@newt.com> |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
9 ;; Keywords: mail |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
10 ;; See: mh-e.el |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
11 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
12 ;; This file is part of GNU Emacs. |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
13 |
94663
90c9ebd43589
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
79713
diff
changeset
|
14 ;; GNU Emacs is free software: you can redistribute it and/or modify |
68135
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
15 ;; it under the terms of the GNU General Public License as published by |
94663
90c9ebd43589
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
79713
diff
changeset
|
16 ;; the Free Software Foundation, either version 3 of the License, or |
90c9ebd43589
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
79713
diff
changeset
|
17 ;; (at your option) any later version. |
68135
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
18 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
19 ;; GNU Emacs is distributed in the hope that it will be useful, |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
22 ;; GNU General Public License for more details. |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
23 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
24 ;; You should have received a copy of the GNU General Public License |
94663
90c9ebd43589
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
79713
diff
changeset
|
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
68135
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
26 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
27 ;;; Commentary: |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
28 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
29 ;;; Change Log: |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
30 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
31 ;;; Code: |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
32 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
33 ;; The names of ephemeral buffers have a " *mh-" prefix (so that they |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
34 ;; are hidden and can be programmatically removed in mh-quit), and the |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
35 ;; variable names have the form mh-temp-.*-buffer. |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
36 (defconst mh-temp-buffer " *mh-temp*") ;scratch |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
37 (defconst mh-temp-checksum-buffer " *mh-checksum*") |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
38 (defconst mh-temp-fetch-buffer " *mh-fetch*") ;wget/curl/fetch output |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
39 (defconst mh-temp-index-buffer " *mh-index*") |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
40 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
41 ;; The names of MH-E buffers that are not ephemeral and can be used by |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
42 ;; the user (and deleted by the user when no longer needed) have a |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
43 ;; "*MH-E " prefix (so they can be programmatically removed in |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
44 ;; mh-quit), and the variable names have the form mh-.*-buffer. |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
45 ;; Temporary buffers for search results |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
46 (defconst mh-aliases-buffer "*MH-E Aliases*") ;alias lookups |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
47 (defconst mh-folders-buffer "*MH-E Folders*") ;folder list |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
48 (defconst mh-help-buffer "*MH-E Help*") ;quick help |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
49 (defconst mh-info-buffer "*MH-E Info*") ;version information buffer |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
50 (defconst mh-log-buffer "*MH-E Log*") ;output of MH commands and so on |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
51 (defconst mh-mail-delivery-buffer "*MH-E Mail Delivery*") ;mail delivery log |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
52 (defconst mh-recipients-buffer "*MH-E Recipients*") ;killed when draft sent |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
53 (defconst mh-sequences-buffer "*MH-E Sequences*") ;sequences list |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
54 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
55 (defvar mh-log-buffer-lines 100 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
56 "Number of lines to keep in `mh-log-buffer'.") |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
57 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
58 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
59 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
60 (defun mh-truncate-log-buffer () |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
61 "If `mh-log-buffer' is too big then truncate it. |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
62 If the number of lines in `mh-log-buffer' exceeds |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
63 `mh-log-buffer-lines' then keep only the last |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
64 `mh-log-buffer-lines'. As a side effect the point is set to the |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
65 end of the log buffer. |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
66 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
67 The function returns the size of the final size of the log buffer." |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
68 (with-current-buffer (get-buffer-create mh-log-buffer) |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
69 (goto-char (point-max)) |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
70 (save-excursion |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
71 (when (equal (forward-line (- mh-log-buffer-lines)) 0) |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
72 (delete-region (point-min) (point)))) |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
73 (unless (or (bobp) |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
74 (save-excursion |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
75 (and (equal (forward-line -1) 0) (equal (char-after) ?)))) |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
76 (insert "\n\n")) |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
77 (buffer-size))) |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
78 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
79 (provide 'mh-buffers) |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
80 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
81 ;; Local Variables: |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
82 ;; indent-tabs-mode: nil |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
83 ;; sentence-end-double-space: nil |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
84 ;; End: |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
85 |
68142 | 86 ;; arch-tag: 812e9f29-78b8-4e73-ada9-aa61dc1ceecb |
68135
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
87 ;;; mh-buffers.el ends here |