X-Git-Url: http://git.osdn.net/view?p=howm%2Fhowm.git;a=blobdiff_plain;f=howm-mode.el;h=bce17f5be6390a783c942ab4bc701b7438708d26;hp=ef94d5fa18ddcc614e4ea6aca9241f7db6e9da17;hb=refs%2Fheads%2Fmaster;hpb=3771a06e7a5081b1163bf7fe0380908c0b6c700c diff --git a/howm-mode.el b/howm-mode.el index ef94d5f..56c61bb 100644 --- a/howm-mode.el +++ b/howm-mode.el @@ -446,6 +446,19 @@ key binding (howm-write-history regexp)) (funcall action regexp))) +(defun howm-search (regexp fixed-p &optional emacs-regexp filter bufname) + (if (string= regexp "") + (howm-list-all) + (howm-message-time "search" + (let* ((trio (howm-call-view-search-internal regexp fixed-p emacs-regexp)) + (kw (car trio)) + (name (or bufname (cadr trio))) + (items (cl-caddr trio))) + (when filter + (setq items (funcall filter items))) + (howm-normalize-show name items (or emacs-regexp regexp) nil nil kw) + (howm-record-view-window-configuration))))) + (defun howm-iigrep (completion-p action) (howm-with-iigrep (howm-iigrep-command-for-pattern completion-p) howm-iigrep-show-what action @@ -456,11 +469,16 @@ key binding (defmacro howm-with-iigrep (command-for-pattern show-what action &rest body) (declare (indent 3)) `(let ((*iigrep-post-sentinel* (howm-iigrep-post-sentinel ,action)) + (howm-view-summary-name "*howmS(preview)*") + (howm-view-contents-name "*howmC(preview)*") (howm-history-limit 0) (*howm-show-item-filename* nil) (howm-message-time nil)) - (iigrep-with-grep ,command-for-pattern ,show-what - ,@body))) + (unwind-protect + (iigrep-with-grep ,command-for-pattern ,show-what + ,@body) + (mapc (lambda (b) (and (get-buffer b) (kill-buffer b))) + (list howm-view-summary-name howm-view-contents-name))))) (defmacro howm-iigrep-command-for-pattern (&optional fixed-p converter) ;; use macro due to dynamic binding. Sigh... @@ -481,19 +499,6 @@ key binding (save-selected-window (funcall ,action pattern))))) -(defun howm-search (regexp fixed-p &optional emacs-regexp filter bufname) - (if (string= regexp "") - (howm-list-all) - (howm-message-time "search" - (let* ((trio (howm-call-view-search-internal regexp fixed-p emacs-regexp)) - (kw (car trio)) - (name (or bufname (cadr trio))) - (items (cl-caddr trio))) - (when filter - (setq items (funcall filter items))) - (howm-normalize-show name items (or emacs-regexp regexp) nil nil kw) - (howm-record-view-window-configuration))))) - (defvar *howm-view-window-configuration* nil "For internal use") (defun howm-view-window-configuration ()