From 73b27641c5bf9d5f96fa8447440781d405d1edfd Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Mon, 22 Oct 2007 23:45:05 +0000 Subject: [PATCH] (change-log-mode): Make and set buffer-local variable isearch-buffers-next-buffer-function to change-log-next-buffer. Call isearch-buffers-minor-mode. (change-log-next-buffer): New function. --- lisp/ChangeLog | 14 ++++++++++++++ lisp/add-log.el | 24 +++++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c828474c12f..1ca5e67c6ca 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,17 @@ +2007-10-22 Juri Linkov + + * isearch-multi.el: New file. + + * isearch.el (isearch-search-string): After finding the next + occurrence switch to buffer isearch-buffers-current-buffer when + isearch-buffers-next-buffer-function is non-nil and + isearch-buffers-current-buffer is live. + + * add-log.el (change-log-mode): Make and set buffer-local variable + isearch-buffers-next-buffer-function to change-log-next-buffer. + Call isearch-buffers-minor-mode. + (change-log-next-buffer): New function. + 2007-10-22 Carsten Dominik * org.el (org-read-date-get-relative): New function. diff --git a/lisp/add-log.el b/lisp/add-log.el index a58d6318670..5ec49861906 100644 --- a/lisp/add-log.el +++ b/lisp/add-log.el @@ -760,7 +760,29 @@ Runs `change-log-mode-hook'. 'change-log-resolve-conflict) (set (make-local-variable 'adaptive-fill-regexp) "\\s *") (set (make-local-variable 'font-lock-defaults) - '(change-log-font-lock-keywords t nil nil backward-paragraph))) + '(change-log-font-lock-keywords t nil nil backward-paragraph)) + (set (make-local-variable 'isearch-buffers-next-buffer-function) + 'change-log-next-buffer) + (isearch-buffers-minor-mode)) + +(defun change-log-next-buffer (&optional buffer wrap) + "Return the next buffer in the series of ChangeLog file buffers. +This function is used for multiple buffers isearch. +A sequence of buffers is formed by ChangeLog files with decreasing +numeric file name suffixes in the directory of the initial ChangeLog +file were isearch was started." + (let* ((name (change-log-name)) + (files (cons name (sort (file-expand-wildcards + (concat name "[-.][0-9]*")) + (lambda (a b) + (version< (substring b (length name)) + (substring a (length name))))))) + (files (if isearch-forward files (reverse files)))) + (find-file-noselect + (if wrap + (car files) + (cadr (member (file-name-nondirectory (buffer-file-name buffer)) + files)))))) ;; It might be nice to have a general feature to replace this. The idea I ;; have is a variable giving a regexp matching text which should not be -- 2.39.2