Debian Codegraph @

contrib/mew-edebug.el

raw ◀ ▶
1 Debian patch touch this file
•1 ;; mew-edebug.el --- Help for using edebug for macros in Mew
2
3 ;; Author: Sen Nagata <[email protected]>
4 ;; Created: Nov 11, 2001
5 ;; Version: 0.3
6
7 ;; Set-up:
8 ;;
9 ;; Put this file somewhere in your `load-path' and the following in
10 ;; your .emacs:
11 ;;
12 ;; (add-hook 'mew-init-hook
13 ;; '(lambda ()
14 ;; (require 'mew-edebug)))
15 ;;
16 ;; Upon instrumenting a function with `edebug-defun',
17 ;; `mew-edebug-macro-init' will be run to instrument Mew macros.
18
19 ;; Issues:
20 ;;
21 ;; I've tested many of the macros below with edebug. Although most
22 ;; appear to work, I experienced problems with some
23 ;; (e.g. `mew-time-rfc-*'). I don't know what the problem is yet, but
24 ;; my current suspicion is that it has something to do with
25 ;; `defsubst'.
26
27 ;;; Code:
28
29 (require 'mew)
30
31 (defvar mew-macro-names
32 '(
33 mew-header-encode-cond
34 mew-header-encode-cond2
35 mew-complete-proto-folder
36 mew-decode-narrow-to-header
37 mew-draft-privacy-switch
38 mew-summary-header-mode
39 mew-no-warning-defvar
40 mew-no-warning-defun
41 mew-ntake
42 mew-add-first
43 mew-addq
44 mew-insert-after
45 mew-replace-with
46 mew-remove-entry
47 mew-folder-insert
48 mew-folder-delete
49 mew-elet
50 mew-filter
51 mew-time-rfc-day
52 mew-time-rfc-mon
53 mew-time-rfc-year
54 mew-time-rfc-hour
55 mew-time-rfc-min
56 mew-time-rfc-sec
57 mew-time-rfc-tmzn
58 mew-rendezvous
59 mew-defstruct
60 mew-defstruct-constructor
61 mew-defstruct-s/getter
62 mew-addrstr-parse-syntax-list-check-depth
63 mew-mark-alist-set
64 mew-mode-input-file-name
65 mew-mode-input-directory-name
66 mew-plet
67 mew-piolet
68 mew-flet
69 mew-frwlet
70 mew-alet
71 mew-passwd-rendezvous
72 mew-dolist-eob
73 mew-pick-lex-cut
74 mew-summary-refilable
75 mew-msgid-check
76 mew-summary-msg-or-part
77 mew-summary-msg
78 mew-summary-part
79 mew-summary-multi-msgs
80 mew-summary-only
81 mew-virtual-only
82 mew-thread-only
83 mew-pickable
84 mew-summary-not-in-queue
85 mew-summary-not-in-draft
86 mew-summary-not-in-nntp
87 mew-summary-local-or-imap
88 mew-summary-local-only
89 mew-summary-with-mewl
90 mew-summary-prepare-draft
91 mew-setface
92 mew-setface-bold
93 mew-defface
94 mew-defface-bold
95 ))
96
97 (defun mew-edebug-macro-init ()
98 "Call `def-edebug-spec' for each macro in `mew-macro-names'.
99
100 This function should be invoked before instrumenting a function for
101 use with edebug."
102 (interactive)
103 (let ((macro-names mew-macro-names))
104 (while macro-names
105 (eval `(def-edebug-spec ,(car macro-names) t))
106 (setq macro-names (cdr macro-names)))))
107
108 ;; instrument Mew macros when edebug is used
109 (add-hook 'edebug-setup-hook
110 '(lambda ()
111 (mew-edebug-macro-init)))
112
113 (provide 'mew-edebug)
114
115 ;;; Copyright Notice:
116
117 ;; Copyright (C) 2001 Mew developing team.
118 ;; All rights reserved.
119
120 ;; Redistribution and use in source and binary forms, with or without
121 ;; modification, are permitted provided that the following conditions
122 ;; are met:
123 ;;
124 ;; 1. Redistributions of source code must retain the above copyright
125 ;; notice, this list of conditions and the following disclaimer.
126 ;; 2. Redistributions in binary form must reproduce the above copyright
127 ;; notice, this list of conditions and the following disclaimer in the
128 ;; documentation and/or other materials provided with the distribution.
129 ;; 3. Neither the name of the team nor the names of its contributors
130 ;; may be used to endorse or promote products derived from this software
131 ;; without specific prior written permission.
132 ;;
133 ;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND
134 ;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
135 ;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
136 ;; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE
137 ;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
138 ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
139 ;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
140 ;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
141 ;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
142 ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
143 ;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
144
145 ;;; mew-edebug.el ends here