Mercurial > emacs
annotate lisp/mh-e/mh-buffers.el @ 71499:51f7fe4f6552
* textprop.c (text_property_stickiness): doc fix.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Wed, 28 Jun 2006 00:02:57 +0000 |
parents | 37d03b3298bf |
children | e3694f1cb928 |
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, |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
4 ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
5 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
6 ;; Author: Bill Wohler <wohler@newt.com> |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
7 ;; Maintainer: Bill Wohler <wohler@newt.com> |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
8 ;; Keywords: mail |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
9 ;; See: mh-e.el |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
10 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
11 ;; This file is part of GNU Emacs. |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
12 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
13 ;; GNU Emacs is free software; you can redistribute it and/or modify |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
14 ;; it under the terms of the GNU General Public License as published by |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
15 ;; the Free Software Foundation; either version 2, or (at your option) |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
16 ;; any later version. |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
17 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
18 ;; 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
|
19 ;; 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
|
20 ;; 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
|
21 ;; GNU General Public License for more details. |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
22 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
23 ;; You should have received a copy of the GNU General Public License |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
26 ;; Boston, MA 02110-1301, USA. |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
27 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
28 ;;; Commentary: |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
29 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
30 ;;; Change Log: |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
31 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
32 ;;; Code: |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
33 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
34 ;; 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
|
35 ;; 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
|
36 ;; 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
|
37 (defconst mh-temp-buffer " *mh-temp*") ;scratch |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
38 (defconst mh-temp-checksum-buffer " *mh-checksum*") |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
39 (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
|
40 (defconst mh-temp-index-buffer " *mh-index*") |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
41 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
42 ;; 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
|
43 ;; 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
|
44 ;; "*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
|
45 ;; 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
|
46 ;; Temporary buffers for search results |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
47 (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
|
48 (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
|
49 (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
|
50 (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
|
51 (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
|
52 (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
|
53 (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
|
54 (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
|
55 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
56 (defvar mh-log-buffer-lines 100 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
57 "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
|
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 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
61 (defun mh-truncate-log-buffer () |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
62 "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
|
63 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
|
64 `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
|
65 `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
|
66 end of the log buffer. |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
67 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
68 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
|
69 (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
|
70 (goto-char (point-max)) |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
71 (save-excursion |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
72 (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
|
73 (delete-region (point-min) (point)))) |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
74 (unless (or (bobp) |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
75 (save-excursion |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
76 (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
|
77 (insert "\n\n")) |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
78 (buffer-size))) |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
79 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
80 (provide 'mh-buffers) |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
81 |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
82 ;; Local Variables: |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
83 ;; indent-tabs-mode: nil |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
84 ;; sentence-end-double-space: nil |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
85 ;; End: |
03bac2d0a4aa
* Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff
changeset
|
86 |
68142 | 87 ;; 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
|
88 ;;; mh-buffers.el ends here |