diff options
| author | Stefan Monnier | 2003-06-16 15:16:59 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-06-16 15:16:59 +0000 |
| commit | 3066d4ada1ab3f812d0a0de2dcdac45b7692fef4 (patch) | |
| tree | b3edfc90f52ab90675f2f2e091ae835f9f335bd6 | |
| parent | 6793bc632203b11d4d869b9ab89e323f915a2944 (diff) | |
| download | emacs-3066d4ada1ab3f812d0a0de2dcdac45b7692fef4.tar.gz emacs-3066d4ada1ab3f812d0a0de2dcdac45b7692fef4.zip | |
(add-log-edit-prev-comment, add-log-edit-next-comment): New commands.
(change-log-mode-map): Bind them.
(smerge-resolve-function): Declare to quieten the byte-compiler.
(change-log-mode): Add the keymap to the docstring.
| -rw-r--r-- | lisp/add-log.el | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/lisp/add-log.el b/lisp/add-log.el index a4ae8ad11b9..32eb5e8e403 100644 --- a/lisp/add-log.el +++ b/lisp/add-log.el | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | ;;; add-log.el --- change log maintenance commands for Emacs | 1 | ;;; add-log.el --- change log maintenance commands for Emacs |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 86, 88, 93, 94, 97, 98, 2000 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1985, 86, 88, 93, 94, 97, 98, 2000, 2003 |
| 4 | ;; Free Software Foundation, Inc. | ||
| 4 | 5 | ||
| 5 | ;; Maintainer: FSF | 6 | ;; Maintainer: FSF |
| 6 | ;; Keywords: tools | 7 | ;; Keywords: tools |
| @@ -248,7 +249,11 @@ Note: The search is conducted only within 10%, at the beginning of the file." | |||
| 248 | 2 'change-log-acknowledgement-face)) | 249 | 2 'change-log-acknowledgement-face)) |
| 249 | "Additional expressions to highlight in Change Log mode.") | 250 | "Additional expressions to highlight in Change Log mode.") |
| 250 | 251 | ||
| 251 | (defvar change-log-mode-map (make-sparse-keymap) | 252 | (defvar change-log-mode-map |
| 253 | (let ((map (make-sparse-keymap))) | ||
| 254 | (define-key map [?\C-c ?\C-p] 'add-log-edit-prev-comment) | ||
| 255 | (define-key map [?\C-c ?\C-n] 'add-log-edit-next-comment) | ||
| 256 | map) | ||
| 252 | "Keymap for Change Log major mode.") | 257 | "Keymap for Change Log major mode.") |
| 253 | 258 | ||
| 254 | (defvar change-log-time-zone-rule nil | 259 | (defvar change-log-time-zone-rule nil |
| @@ -289,6 +294,31 @@ If nil, use local time.") | |||
| 289 | "$CHANGE_LOG$.TXT" | 294 | "$CHANGE_LOG$.TXT" |
| 290 | "ChangeLog"))) | 295 | "ChangeLog"))) |
| 291 | 296 | ||
| 297 | (defun add-log-edit-prev-comment (arg) | ||
| 298 | "Cycle backward through Log-Edit mode comment history. | ||
| 299 | With a numeric prefix ARG, go back ARG comments." | ||
| 300 | (interactive "*p") | ||
| 301 | (save-restriction | ||
| 302 | (narrow-to-region (point) | ||
| 303 | (if (memq last-command '(add-log-edit-prev-comment | ||
| 304 | add-log-edit-next-comment)) | ||
| 305 | (mark) (point))) | ||
| 306 | (when (fboundp 'log-edit-previous-comment) | ||
| 307 | (log-edit-previous-comment arg) | ||
| 308 | (indent-region (point-min) (point-max)) | ||
| 309 | (goto-char (point-min)) | ||
| 310 | (unless (save-restriction (widen) (bolp)) | ||
| 311 | (delete-region (point) (progn (skip-chars-forward " \t\n") (point)))) | ||
| 312 | (set-mark (point-min)) | ||
| 313 | (goto-char (point-max)) | ||
| 314 | (delete-region (point) (progn (skip-chars-backward " \t\n") (point)))))) | ||
| 315 | |||
| 316 | (defun add-log-edit-next-comment (arg) | ||
| 317 | "Cycle forward through Log-Edit mode comment history. | ||
| 318 | With a numeric prefix ARG, go back ARG comments." | ||
| 319 | (interactive "*p") | ||
| 320 | (add-log-edit-prev-comment (- arg))) | ||
| 321 | |||
| 292 | ;;;###autoload | 322 | ;;;###autoload |
| 293 | (defun prompt-for-change-log-name () | 323 | (defun prompt-for-change-log-name () |
| 294 | "Prompt for a change log name." | 324 | "Prompt for a change log name." |
| @@ -611,13 +641,16 @@ the change log file in another window." | |||
| 611 | (if (> pos (point)) (goto-char pos)))) | 641 | (if (> pos (point)) (goto-char pos)))) |
| 612 | 642 | ||
| 613 | 643 | ||
| 644 | (defvar smerge-resolve-function) | ||
| 645 | |||
| 614 | ;;;###autoload | 646 | ;;;###autoload |
| 615 | (define-derived-mode change-log-mode text-mode "Change Log" | 647 | (define-derived-mode change-log-mode text-mode "Change Log" |
| 616 | "Major mode for editing change logs; like Indented Text Mode. | 648 | "Major mode for editing change logs; like Indented Text Mode. |
| 617 | Prevents numeric backups and sets `left-margin' to 8 and `fill-column' to 74. | 649 | Prevents numeric backups and sets `left-margin' to 8 and `fill-column' to 74. |
| 618 | New log entries are usually made with \\[add-change-log-entry] or \\[add-change-log-entry-other-window]. | 650 | New log entries are usually made with \\[add-change-log-entry] or \\[add-change-log-entry-other-window]. |
| 619 | Each entry behaves as a paragraph, and the entries for one day as a page. | 651 | Each entry behaves as a paragraph, and the entries for one day as a page. |
| 620 | Runs `change-log-mode-hook'." | 652 | Runs `change-log-mode-hook'. |
| 653 | \\{change-log-mode-map}" | ||
| 621 | (setq left-margin 8 | 654 | (setq left-margin 8 |
| 622 | fill-column 74 | 655 | fill-column 74 |
| 623 | indent-tabs-mode t | 656 | indent-tabs-mode t |