annotate lisp/mh-e/mh-buffers.el @ 68146:e5c85a134e67

[HAVE_INTTYPES_H]: Include inttypes.h. (ifflag_table): Fix typo (IFF_OACTIV -> IFF_OACTIVE). (Fnetwork_interface_info): Use HAVE_STRUCT_IFREQ_IFR_NETMASK macro. Also try member ifr_addr when getting netmask.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Thu, 12 Jan 2006 08:15:50 +0000
parents 7864e29d620b
children 37d03b3298bf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
68135
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
1 ;;; mh-buffers.el --- Temporary buffer constants and utilities used by MH-E
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 ;; Temporary buffer constants and utilities used by MH-E.
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 ;;; Change Log:
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 ;;; Code:
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
35
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
36 ;; 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
37 ;; 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
38 ;; 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
39 (defconst mh-temp-buffer " *mh-temp*") ;scratch
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
40 (defconst mh-temp-checksum-buffer " *mh-checksum*")
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
41 (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
42 (defconst mh-temp-index-buffer " *mh-index*")
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
43
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
44 ;; 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
45 ;; 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
46 ;; "*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
47 ;; 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
48 ;; Temporary buffers for search results
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
49 (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
50 (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
51 (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
52 (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
53 (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
54 (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
55 (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
56 (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
57
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
58 (defvar mh-log-buffer-lines 100
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
59 "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
60
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
61
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
62
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
63 (defun mh-truncate-log-buffer ()
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
64 "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
65 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
66 `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
67 `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
68 end of the log buffer.
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
69
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
70 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
71 (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
72 (goto-char (point-max))
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
73 (save-excursion
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
74 (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
75 (delete-region (point-min) (point))))
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
76 (unless (or (bobp)
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
77 (save-excursion
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
78 (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
79 (insert "\n \n"))
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
80 (buffer-size)))
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 (provide 'mh-buffers)
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
83
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
84 ;; Local Variables:
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
85 ;; indent-tabs-mode: nil
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
86 ;; sentence-end-double-space: nil
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
87 ;; End:
03bac2d0a4aa * Makefile (MH_E_SRC): Add mh-buffers.el.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
88
68142
7864e29d620b Add arch tagline
Miles Bader <miles@gnu.org>
parents: 68135
diff changeset
89 ;; 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
90 ;;; mh-buffers.el ends here