annotate lisp/packages/add-log.el @ 147:e186c2b7192d xemacs-20-2

Added tag r20-2p1 for changeset 2af401a6ecca
author cvs
date Mon, 13 Aug 2007 09:34:48 +0200
parents cca96a509cfe
children 59463afc5666
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; add-log.el --- change log maintenance commands for Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
3 ;; Copyright (C) 1985, 1986, 1988, 1993, 1994 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Keywords: maint
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
20 ;; along with XEmacs; see the file COPYING. If not, write to the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 2
diff changeset
22 ;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
24 ;;; Synched up with: FSF 19.34.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;; This facility is documented in the Emacs Manual.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
32 (defgroup change-log nil
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
33 "Change log maintenance"
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
34 :group 'tools
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
35 :prefix "change-log-"
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
36 :prefix "add-log-")
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
37
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;;;###autoload
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
40 (defcustom change-log-default-name nil
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
41 "*Name of a change log file for \\[add-change-log-entry]."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
42 :type '(choice (const :tag "default" nil)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
43 string)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
44 :group 'change-log)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
45
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
46 ;;;###autoload
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
47 (defcustom add-log-current-defun-function nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 "\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 *If non-nil, function to guess name of current function from surrounding text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 \\[add-change-log-entry] calls this function (if nil, `add-log-current-defun'
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
51 instead) with no arguments. It returns a string or nil if it cannot guess."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
52 :type 'boolean
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
53 :group 'change-log)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ;;;###autoload
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
56 (defcustom add-log-full-name nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 "*Full name of user, for inclusion in ChangeLog daily headers.
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
58 This defaults to the value returned by the `user-full-name' function."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
59 :type '(choice (const :tag "Default" nil)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
60 string)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
61 :group 'change-log)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ;; So that the dump-time value doesn't go into loaddefs.el with the autoload.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (or add-log-full-name (setq add-log-full-name (user-full-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ;;;###autoload
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
67 (defcustom add-log-mailing-address nil
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 "*Electronic mail address of user, for inclusion in ChangeLog daily headers.
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
69 This defaults to the value of `user-mail-address'."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
70 :type '(choice (const :tag "Default" nil)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
71 string)
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
72 :group 'change-log)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ;; So that the dump-time value doesn't go into loaddefs.el with the autoload.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (or add-log-mailing-address
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 70
diff changeset
76 (setq add-log-mailing-address (user-mail-address)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (defvar change-log-font-lock-keywords
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
79 '(("^[SMTWF].+" . font-lock-function-name-face) ; Date line.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
80 ("^\t\\* \\([^ :\n]+\\)" 1 font-lock-comment-face) ; File name.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
81 ("(\\([^)\n]+\\)):" 1 font-lock-keyword-face)) ; Function name.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 "Additional expressions to highlight in Change Log mode.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (put 'change-log-mode 'font-lock-defaults
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 '(change-log-font-lock-keywords t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (defvar change-log-mode-map nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 "Keymap for Change Log major mode.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (if change-log-mode-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 nil
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
90 (setq change-log-mode-map (make-sparse-keymap))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
91 (define-key change-log-mode-map "\M-q" 'change-log-fill-paragraph))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (defun change-log-name ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (or change-log-default-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (if (eq system-type 'vax-vms)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
96 "$CHANGE_LOG$.TXT"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
97 (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
98 "changelo"
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
99 "ChangeLog"))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (defun prompt-for-change-log-name ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 "Prompt for a change log name."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (let* ((default (change-log-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (name (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (read-file-name (format "Log file (default %s): " default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 nil default))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 ;; Handle something that is syntactically a directory name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 ;; Look for ChangeLog or whatever in that directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (if (string= (file-name-nondirectory name) "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (expand-file-name (file-name-nondirectory default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 ;; Handle specifying a file that is a directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (if (file-directory-p name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (expand-file-name (file-name-nondirectory default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (file-name-as-directory name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (defun find-change-log (&optional file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 "Find a change log file for \\[add-change-log-entry] and return the name.
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
122
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 Optional arg FILE-NAME specifies the file to use.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 If FILE-NAME is nil, use the value of `change-log-default-name'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 If 'change-log-default-name' is nil, behave as though it were 'ChangeLog'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 \(or whatever we use on this operating system).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 If 'change-log-default-name' contains a leading directory component, then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 simply find it in the current directory. Otherwise, search in the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 directory and its successive parents for a file so named.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 Once a file is found, `change-log-default-name' is set locally in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 current buffer to the complete file name."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 ;; If user specified a file name or if this buffer knows which one to use,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 ;; just use that.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (or file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (setq file-name (and change-log-default-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (file-name-directory change-log-default-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 change-log-default-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 ;; Chase links in the source file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 ;; and use the change log in the dir where it points.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (setq file-name (or (and buffer-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (file-name-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (file-chase-links buffer-file-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (if (file-directory-p file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (setq file-name (expand-file-name (change-log-name) file-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 ;; Chase links before visiting the file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 ;; This makes it easier to use a single change log file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 ;; for several related directories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (setq file-name (file-chase-links file-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (setq file-name (expand-file-name file-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 ;; Move up in the dir hierarchy till we find a change log file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (let ((file1 file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 parent-dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (while (and (not (or (get-file-buffer file1) (file-exists-p file1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (progn (setq parent-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (file-name-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (directory-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (file-name-directory file1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 ;; Give up if we are already at the root dir.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (not (string= (file-name-directory file1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 parent-dir))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 ;; Move up to the parent dir and try again.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (setq file1 (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (file-name-nondirectory (change-log-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 parent-dir)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 ;; If we found a change log in a parent, use that.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (if (or (get-file-buffer file1) (file-exists-p file1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (setq file-name file1)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 ;; Make a local variable in this buffer so we needn't search again.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (set (make-local-variable 'change-log-default-name) file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (defun add-change-log-entry (&optional whoami file-name other-window new-entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 "Find change log file and add an entry for today.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 Optional arg (interactive prefix) non-nil means prompt for user name and site.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 Second arg is file name of change log. If nil, uses `change-log-default-name'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 Third arg OTHER-WINDOW non-nil means visit in other window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 Fourth arg NEW-ENTRY non-nil means always create a new entry at the front;
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
183 never append to an existing entry."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (interactive (list current-prefix-arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (prompt-for-change-log-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (or add-log-full-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (setq add-log-full-name (user-full-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (or add-log-mailing-address
114
8619ce7e4c50 Import from CVS: tag r20-1b9
cvs
parents: 70
diff changeset
189 (setq add-log-mailing-address (user-mail-address)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (if whoami
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (setq add-log-full-name (read-string "Full name: " add-log-full-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 ;; Note that some sites have room and phone number fields in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 ;; full name which look silly when inserted. Rather than do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 ;; anything about that here, let user give prefix argument so that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 ;; s/he can edit the full name field in prompter if s/he wants.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (setq add-log-mailing-address
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (read-string "Mailing address: " add-log-mailing-address))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (let ((defun (funcall (or add-log-current-defun-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 'add-log-current-defun)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 paragraph-end entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (setq file-name (expand-file-name (find-change-log file-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 ;; Set ENTRY to the file name to use in the new entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (and buffer-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 ;; Never want to add a change log entry for the ChangeLog file itself.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (not (string= buffer-file-name file-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (setq entry (if (string-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (concat "^" (regexp-quote (file-name-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 file-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 buffer-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (substring buffer-file-name (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (file-name-nondirectory buffer-file-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (if (and other-window (not (equal file-name buffer-file-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (find-file-other-window file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (find-file file-name))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
219 (or (eq major-mode 'change-log-mode)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
220 (change-log-mode))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (undo-boundary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (goto-char (point-min))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
223 (if (looking-at (concat (regexp-quote (substring (current-time-string)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
224 0 10))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
225 ".* " (regexp-quote add-log-full-name)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
226 " <" (regexp-quote add-log-mailing-address)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
227 (forward-line 1)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
228 (insert (current-time-string)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
229 " " add-log-full-name
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
230 " <" add-log-mailing-address ">\n\n"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 ;; Search only within the first paragraph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (if (looking-at "\n*[^\n* \t]")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (skip-chars-forward "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (forward-paragraph 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (setq paragraph-end (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 ;; Now insert the new line for this entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (cond ((re-search-forward "^\\s *\\*\\s *$" paragraph-end t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 ;; Put this file name into the existing empty entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (if entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (insert entry)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 ((and (not new-entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (let (case-fold-search)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (re-search-forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (concat (regexp-quote (concat "* " entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 ;; Don't accept `foo.bar' when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 ;; looking for `foo':
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 "\\(\\s \\|[(),:]\\)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 paragraph-end t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 ;; Add to the existing entry for the same file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (re-search-forward "^\\s *$\\|^\\s \\*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (goto-char (match-beginning 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 ;; Delete excess empty lines; make just 2.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (while (and (not (eobp)) (looking-at "^\\s *$"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 (delete-region (point) (save-excursion (forward-line 1) (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (insert "\n\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 (forward-line -2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 (indent-relative-maybe))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 ;; Make a new entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 (while (looking-at "\\sW")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (while (and (not (eobp)) (looking-at "^\\s *$"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (delete-region (point) (save-excursion (forward-line 1) (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (insert "\n\n\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (forward-line -2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (indent-to left-margin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (insert "* " (or entry ""))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 ;; Now insert the function name, if we have one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 ;; Point is at the entry for this file,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 ;; either at the end of the line or at the first blank line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (if defun
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 ;; Make it easy to get rid of the function name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (undo-boundary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (insert (if (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (beginning-of-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (looking-at "\\s *$"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 "(" defun "): "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 ;; No function name, so put in a colon unless we have just a star.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (if (not (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (beginning-of-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 (looking-at "\\s *\\(\\*\\s *\\)?$")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 (insert ": ")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (defun add-change-log-entry-other-window (&optional whoami file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 "Find change log file in other window and add an entry for today.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 Optional arg (interactive prefix) non-nil means prompt for user name and site.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 Second arg is file name of change log. \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 If nil, uses `change-log-default-name'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (interactive (if current-prefix-arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 (list current-prefix-arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (prompt-for-change-log-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 (add-change-log-entry whoami file-name t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 ;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
303 (defvar change-log-mode-map nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
304 "Keymap for Change Log major mode.")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
305 (if change-log-mode-map
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
306 nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
307 (setq change-log-mode-map (make-sparse-keymap))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
308 (set-keymap-name change-log-mode-map 'change-log-mode-map)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
309 (define-key change-log-mode-map "\M-q" 'change-log-fill-paragraph))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
310
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 (defun change-log-mode ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 "Major mode for editing change logs; like Indented Text Mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 Prevents numeric backups and sets `left-margin' to 8 and `fill-column' to 74.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 New log entries are usually made with \\[add-change-log-entry] or \\[add-change-log-entry-other-window].
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 Each entry behaves as a paragraph, and the entries for one day as a page.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 Runs `change-log-mode-hook'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (kill-all-local-variables)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (indented-text-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (setq major-mode 'change-log-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 mode-name "Change Log"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 left-margin 8
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
324 fill-column 74
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
325 indent-tabs-mode t
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
326 tab-width 8)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (use-local-map change-log-mode-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 ;; Let each entry behave as one paragraph:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 ;; We really do want "^" in paragraph-start below: it is only the lines that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 ;; begin at column 0 (despite the left-margin of 8) that we are looking for.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
331 (set (make-local-variable 'paragraph-start) "\\s *$\\|\f\\|^\\sw")
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
332 (set (make-local-variable 'paragraph-separate) "\\s *$\\|\f\\|^\\sw")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 ;; Let all entries for one day behave as one page.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 ;; Match null string on the date-line so that the date-line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 ;; is grouped with what follows.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (set (make-local-variable 'page-delimiter) "^\\<\\|^\f")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (set (make-local-variable 'version-control) 'never)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (set (make-local-variable 'adaptive-fill-regexp) "\\s *")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (run-hooks 'change-log-mode-hook))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 ;; It might be nice to have a general feature to replace this. The idea I
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 ;; have is a variable giving a regexp matching text which should not be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 ;; moved from bol by filling. change-log-mode would set this to "^\\s *\\s(".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 ;; But I don't feel up to implementing that today.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (defun change-log-fill-paragraph (&optional justify)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 "Fill the paragraph, but preserve open parentheses at beginning of lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 Prefix arg means justify as well."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (interactive "P")
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
349 (let ((end (save-excursion (forward-paragraph) (point)))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
350 (beg (save-excursion (backward-paragraph)(point)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 (paragraph-start (concat paragraph-start "\\|\\s *\\s(")))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
352 (fill-region beg end justify)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
354 (defcustom add-log-current-defun-header-regexp
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 "^\\([A-Z][A-Z_ ]*[A-Z_]\\|[-_a-zA-Z]+\\)[ \t]*[:=]"
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
356 "*Heuristic regexp used by `add-log-current-defun' for unknown major modes."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
357 :type 'regexp
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 114
diff changeset
358 :group 'change-log)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (defun add-log-current-defun ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 "Return name of function definition point is in, or nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 Understands C, Lisp, LaTeX (\"functions\" are chapters, sections, ...),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 Texinfo (@node titles), Perl, and Fortran.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 Other modes are handled by a heuristic that looks in the 10K before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 point for uppercase headings starting in the first column or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 identifiers followed by `:' or `=', see variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 `add-log-current-defun-header-regexp'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 Has a preference of looking backwards."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (let ((location (point)))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
376 (cond ((memq major-mode '(emacs-lisp-mode lisp-mode scheme-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
377 lisp-interaction-mode))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 ;; If we are now precisely at the beginning of a defun,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 ;; make sure beginning-of-defun finds that one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 ;; rather than the previous one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (or (eobp) (forward-char 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 (beginning-of-defun)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 ;; Make sure we are really inside the defun found, not after it.
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
384 (if (and (looking-at "\\s(")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
385 (progn (end-of-defun)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (< location (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (progn (forward-sexp -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (>= location (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (if (looking-at "\\s(")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 (forward-char 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (forward-sexp 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (skip-chars-forward " '")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (buffer-substring (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 (progn (forward-sexp 1) (point))))))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
396 ((and (memq major-mode '(c-mode c++-mode c++-c-mode objc-mode))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
397 (save-excursion (beginning-of-line)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
398 ;; Use eq instead of = here to avoid
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
399 ;; error when at bob and char-after
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
400 ;; returns nil.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
401 (while (eq (char-after (- (point) 2)) ?\\)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
402 (forward-line -1))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
403 (looking-at "[ \t]*#[ \t]*define[ \t]")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 ;; Handle a C macro definition.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 (while (eq (char-after (- (point) 2)) ?\\) ;not =; note above
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (forward-line -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 (search-forward "define")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 (skip-chars-forward " \t")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 (buffer-substring (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 (progn (forward-sexp 1) (point))))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
412 ((memq major-mode '(c-mode c++-mode c++-c-mode objc-mode))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 ;; See if we are in the beginning part of a function,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 ;; before the open brace. If so, advance forward.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (while (not (looking-at "{\\|\\(\\s *$\\)"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 (forward-line 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (or (eobp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 (forward-char 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (beginning-of-defun)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 (if (progn (end-of-defun)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 (< location (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 (backward-sexp 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (let (beg tem)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (forward-line -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 ;; Skip back over typedefs of arglist.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 (while (and (not (bobp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 (looking-at "[ \t\n]"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 (forward-line -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 ;; See if this is using the DEFUN macro used in Emacs,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 ;; or the DEFUN macro used by the C library.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 (if (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 (and (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (while (= (preceding-char) ?\\)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 (end-of-line 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 (backward-sexp 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 (setq tem (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 (looking-at "DEFUN\\b"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 (>= location tem))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 (error nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 (goto-char tem)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 (down-list 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 (if (= (char-after (point)) ?\")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 (forward-sexp 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 (skip-chars-forward " ,")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 (buffer-substring (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (progn (forward-sexp 1) (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 (if (looking-at "^[+-]")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 (get-method-definition)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 ;; Ordinary C function syntax.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (setq beg (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (if (and (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 ;; Protect against "Unbalanced parens" error.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 (down-list 1) ; into arglist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 (backward-up-list 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 (skip-chars-backward " \t")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (error nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 ;; Verify initial pos was after
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 ;; real start of function.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 (goto-char beg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 ;; For this purpose, include the line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 ;; that has the decl keywords. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 ;; may also include some of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 ;; comments before the function.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (while (and (not (bobp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 (forward-line -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 (looking-at "[^\n\f]")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (forward-line -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (>= location (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 ;; Consistency check: going down and up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 ;; shouldn't take us back before BEG.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 (> (point) beg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 (let (end middle)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 ;; Don't include any final newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 ;; in the name we use.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (if (= (preceding-char) ?\n)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 (forward-char -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 (setq end (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 (backward-sexp 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 ;; Now find the right beginning of the name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 ;; Include certain keywords if they
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 ;; precede the name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (setq middle (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 (forward-word -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 ;; Ignore these subparts of a class decl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 ;; and move back to the class name itself.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 (while (looking-at "public \\|private ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 (skip-chars-backward " \t:")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 (setq end (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 (backward-sexp 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 (setq middle (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 (forward-word -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 (and (bolp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 (looking-at "struct \\|union \\|class ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 (setq middle (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 (buffer-substring middle end)))))))))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
507 ((memq major-mode
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
508 '(TeX-mode plain-TeX-mode LaTeX-mode;; tex-mode.el
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
509 plain-tex-mode latex-mode;; cmutex.el
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 48
diff changeset
510 ))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 (if (re-search-backward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 "\\\\\\(sub\\)*\\(section\\|paragraph\\|chapter\\)" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 (goto-char (match-beginning 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 (buffer-substring (1+ (point));; without initial backslash
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 (point))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 ((eq major-mode 'texinfo-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 (if (re-search-backward "^@node[ \t]+\\([^,\n]+\\)" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 (buffer-substring (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 (match-end 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 ((eq major-mode 'perl-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 (if (re-search-backward "^sub[ \t]+\\([^ \t\n]+\\)" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 (buffer-substring (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 (match-end 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 ((eq major-mode 'fortran-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 ;; must be inside function body for this to work
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 (beginning-of-fortran-subprogram)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 (let ((case-fold-search t)) ; case-insensitive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 ;; search for fortran subprogram start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 (if (re-search-forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 "^[ \t]*\\(program\\|subroutine\\|function\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 \\|[ \ta-z0-9*]*[ \t]+function\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 ;; move to EOL or before first left paren
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 (if (re-search-forward "[(\n]" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 (progn (forward-char -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 (skip-chars-backward " \t"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 (end-of-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 ;; Use the name preceding that.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 (buffer-substring (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (progn (forward-sexp -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (point)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 ;; If all else fails, try heuristics
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 (let (case-fold-search)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 (if (re-search-backward add-log-current-defun-header-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 (- (point) 10000)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 (buffer-substring (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 (match-end 1))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 (error nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (defvar get-method-definition-md)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 ;; Subroutine used within get-method-definition.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 ;; Add the last match in the buffer to the end of `md',
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 ;; followed by the string END; move to the end of that match.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (defun get-method-definition-1 (end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (setq get-method-definition-md
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 (concat get-method-definition-md
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 (buffer-substring (match-beginning 1) (match-end 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 end))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 (goto-char (match-end 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 ;; For objective C, return the method name if we are in a method.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 (defun get-method-definition ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 (let ((get-method-definition-md "["))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 (if (re-search-backward "^@implementation\\s-*\\([A-Za-z_]*\\)" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 (get-method-definition-1 " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 ((re-search-forward "^\\([-+]\\)[ \t\n\f\r]*\\(([^)]*)\\)?\\s-*" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 (get-method-definition-1 "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 (while (not (looking-at "[{;]"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 (looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 "\\([A-Za-z_]*:?\\)\\s-*\\(([^)]*)\\)?[A-Za-z_]*[ \t\n\f\r]*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 (get-method-definition-1 ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 (concat get-method-definition-md "]"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 (provide 'add-log)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 ;;; add-log.el ends here