Home | History | Annotate | Download | only in etc

Lines Matching defs:log

5 ;;; and the standard add-log.el provided with 19.34 is that it
10 ;;; below in `~/elisp/add-log.el', and then put something like this in
20 ;;; ~/elisp/add-log.el, bring it up in Emacs, and type
26 ;;; add-log.el --- change log maintenance commands for Emacs
55 (defvar change-log-default-name nil
56 "*Name of a change log file for \\[add-change-log-entry].")
58 (defvar add-log-current-defun-function nil
61 \\[add-change-log-entry] calls this function (if nil, `add-log-current-defun'
65 (defvar add-log-full-name nil
70 (defvar add-log-mailing-address nil
74 (defvar change-log-font-lock-keywords
78 "Additional expressions to highlight in Change Log mode.")
80 (defvar change-log-mode-map nil
81 "Keymap for Change Log major mode.")
82 (if change-log-mode-map
84 (setq change-log-mode-map (make-sparse-keymap))
85 (define-key change-log-mode-map "\M-q" 'change-log-fill-paragraph))
87 (defun change-log-name ()
88 (or change-log-default-name
96 (defun prompt-for-change-log-name ()
97 "Prompt for a change log name."
98 (let* ((default (change-log-name))
100 (read-file-name (format "Log file (default %s): " default)
114 (defun find-change-log (&optional file-name)
115 "Find a change log file for \\[add-change-log-entry] and return the name.
118 If FILE-NAME is nil, use the value of `change-log-default-name'.
119 If 'change-log-default-name' is nil, behave as though it were 'ChangeLog'
122 If 'change-log-default-name' contains a leading directory component, then
126 Once a file is found, `change-log-default-name' is set locally in the
131 (setq file-name (and change-log-default-name
132 (file-name-directory change-log-default-name)
133 change-log-default-name))
136 ;; and use the change log in the dir where it points.
142 (setq file-name (expand-file-name (change-log-name) file-name)))
144 ;; This makes it easier to use a single change log file
148 ;; Move up in the dir hierarchy till we find a change log file.
161 (file-name-nondirectory (change-log-name))
163 ;; If we found a change log in a parent, use that.
167 (set (make-local-variable 'change-log-default-name) file-name)
171 (defun add-change-log-entry (&optional whoami file-name other-window new-entry)
172 "Find change log file and add an entry for today.
174 Second arg is file name of change log. If nil, uses `change-log-default-name'.
179 (prompt-for-change-log-name)))
180 (or add-log-full-name
181 (setq add-log-full-name (user-full-name)))
182 (or add-log-mailing-address
183 (setq add-log-mailing-address user-mail-address))
186 (setq add-log-full-name (read-input "Full name: " add-log-full-name))
191 (setq add-log-mailing-address
192 (read-input "Mailing address: " add-log-mailing-address))))
193 (let ((defun (funcall (or add-log-current-defun-function
194 'add-log-current-defun)))
197 (setq file-name (expand-file-name (find-change-log file-name)))
201 ;; Never want to add a change log entry for the ChangeLog file itself.
213 (or (eq major-mode 'change-log-mode)
214 (change-log-mode))
219 add-log-full-name
220 add-log-mailing-address)))
285 (defun add-change-log-entry-other-window (&optional whoami file-name)
286 "Find change log file in other window and add an entry for today.
288 Second arg is file name of change log. \
289 If nil, uses `change-log-default-name'."
292 (prompt-for-change-log-name))))
293 (add-change-log-entry whoami file-name t))
294 ;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window)
297 (defun change-log-mode ()
300 New log entries are usually made with \\[add-change-log-entry] or \\[add-change-log-entry-other-window].
302 Runs `change-log-mode-hook'."
306 (setq major-mode 'change-log-mode
307 mode-name "Change Log"
312 (use-local-map change-log-mode-map)
325 '(change-log-font-lock-keywords t))
326 (run-hooks 'change-log-mode-hook))
330 ;; moved from bol by filling. change-log-mode would set this to "^\\s *\\s(".
332 (defun change-log-fill-paragraph (&optional justify)
342 (defvar add-log-current-defun-header-regexp
344 "*Heuristic regexp used by `add-log-current-defun' for unknown major modes.")
347 (defun add-log-current-defun ()
356 `add-log-current-defun-header-regexp'.
536 (if (re-search-backward add-log-current-defun-header-regexp
572 (provide 'add-log)
574 ;;; add-log.el ends here