aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeodor Zlatanov2008-08-05 18:37:12 +0000
committerTeodor Zlatanov2008-08-05 18:37:12 +0000
commit7be2b0943a334fcc902c1dbf177c01f4010b2575 (patch)
treed3afb28060657f34f01f8d2bf4ed8a987be6ee7a
parent95889848e895a3da6a97531b4e778dfaec185b72 (diff)
downloademacs-7be2b0943a334fcc902c1dbf177c01f4010b2575.tar.gz
emacs-7be2b0943a334fcc902c1dbf177c01f4010b2575.zip
(change-log-next-error, change-log-mode): Add support
for `next-error' to call `change-log-goto-source' on named files in a ChangeLog.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/add-log.el28
2 files changed, 33 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ed10a856484..9b0e652701e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12008-08-05 Teodor Zlatanov <tzz@lifelogs.com>
2
3 * add-log.el (change-log-next-error, change-log-mode): Add support
4 for `next-error' to call `change-log-goto-source' on named files
5 in a ChangeLog.
6
12008-08-05 Jay Belanger <jay.p.belanger@gmail.com> 72008-08-05 Jay Belanger <jay.p.belanger@gmail.com>
2 8
3 * calc/calc.el (math-read-number): Handle all C-like languages 9 * calc/calc.el (math-read-number): Handle all C-like languages
diff --git a/lisp/add-log.el b/lisp/add-log.el
index d0a21e8286e..1acc064beff 100644
--- a/lisp/add-log.el
+++ b/lisp/add-log.el
@@ -511,6 +511,29 @@ comma-separated list."
511 (error (format "Cannot find matches for tag `%s' in `%s'" 511 (error (format "Cannot find matches for tag `%s' in `%s'"
512 tag file)))))))) 512 tag file))))))))
513 513
514(defun change-log-next-error (&optional argp reset)
515 "Move to the Nth (default 1) next match in an Occur mode buffer.
516Compatibility function for \\[next-error] invocations."
517 (interactive "p")
518 (let* ((argp (or argp 0))
519 (count (abs argp)) ; how many cycles
520 (down (< argp 0)) ; are we going down? (is argp negative?)
521 (up (not down))
522 (search-function (if up 're-search-forward 're-search-backward)))
523
524 ;; set the starting position
525 (goto-char (cond (reset (point-min))
526 (down (line-beginning-position))
527 (up (line-end-position))
528 ((point))))
529
530 (funcall search-function change-log-file-names-re nil t count))
531
532 (beginning-of-line)
533 ;; if we found a place to visit...
534 (when (looking-at change-log-file-names-re)
535 (change-log-goto-source)))
536
514(defvar change-log-mode-map 537(defvar change-log-mode-map
515 (let ((map (make-sparse-keymap))) 538 (let ((map (make-sparse-keymap)))
516 (define-key map [?\C-c ?\C-p] 'add-log-edit-prev-comment) 539 (define-key map [?\C-c ?\C-p] 'add-log-edit-prev-comment)
@@ -997,7 +1020,10 @@ Runs `change-log-mode-hook'.
997 (set (make-local-variable 'beginning-of-defun-function) 1020 (set (make-local-variable 'beginning-of-defun-function)
998 'change-log-beginning-of-defun) 1021 'change-log-beginning-of-defun)
999 (set (make-local-variable 'end-of-defun-function) 1022 (set (make-local-variable 'end-of-defun-function)
1000 'change-log-end-of-defun)) 1023 'change-log-end-of-defun)
1024 ;; next-error function glue
1025 (setq next-error-function 'change-log-next-error)
1026 (setq next-error-last-buffer (current-buffer)))
1001 1027
1002(defun change-log-next-buffer (&optional buffer wrap) 1028(defun change-log-next-buffer (&optional buffer wrap)
1003 "Return the next buffer in the series of ChangeLog file buffers. 1029 "Return the next buffer in the series of ChangeLog file buffers.