Changeset 18828

Show
Ignore:
Timestamp:
09/04/08 14:40:30 (4 months ago)
Author:
imakado
Message:

anything-execute-persistent-actionが実装されたのでそちらを使用。 \n不要になったアドバイスを削除。

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/elisp/anything-c-moccur/branches/new-anything/anything-c-moccur.el

    r18824 r18828  
    217217  (anything-c-moccur-anything-try-execute-persistent-action)) 
    218218 
    219 ;;; Advise and Hack 
    220 (defun anything-c-moccur-anything-execute-persistent-action () 
    221   "If a candidate was selected then perform the associated action without quitting anything." 
    222   (interactive) 
    223   (save-selected-window 
    224     (select-window (get-buffer-window anything-buffer)) 
    225     (select-window (setq minibuffer-scroll-window 
    226                          (if (one-window-p t) (split-window) (next-window (selected-window) 1)))) 
    227     (let* ((anything-window (get-buffer-window anything-buffer)) 
    228            ;;(same-window-regexps '(".")) 
    229            (selection (if anything-saved-sources 
    230                           ;; the action list is shown 
    231                           anything-saved-selection 
    232                         (anything-get-selection))) 
    233            (default-action (anything-get-action)) 
    234            (action (assoc-default 'persistent-action (anything-get-current-source)))) 
    235       (setq action (or action default-action)) 
    236       (if (and (listp action) 
    237                (not (functionp action))) ; lambda 
    238           ;; select the default action 
    239           (setq action (cdar action))) 
    240       (set-window-dedicated-p anything-window t) 
    241       (unwind-protect 
    242           (and action selection (funcall action selection)) 
    243         (set-window-dedicated-p anything-window nil))))) 
    244  
    245219(defun anything-c-moccur-initialize () 
    246220  (setq anything-c-moccur-anything-invoking-flag t) 
     
    249223 
    250224(defun anything-c-moccur-anything-try-execute-persistent-action () 
    251   (when (and (ignore-errors (anything-get-current-source)) 
    252              anything-c-moccur-enable-auto-look-flag) 
    253     (anything-c-moccur-anything-execute-persistent-action))) 
     225  (when anything-c-moccur-enable-auto-look-flag 
     226    (anything-execute-persistent-action))) 
    254227 
    255228(defmacro anything-c-moccur-with-anything-env (sources &rest body) 
     
    483456  (anything-c-moccur-next-line-if-info-line) 
    484457 
    485   (let ((real-candidate (if anything-saved-sources 
    486                             ;; the action list is shown 
    487                             anything-saved-selection 
    488                           (anything-get-selection)))) 
     458  (let ((real-candidate (anything-get-selection))) 
    489459   
    490460    (multiple-value-bind (buffer file-path) 
     
    494464                 (stringp file-path) 
    495465                 (file-readable-p file-path)) 
    496         (find-file-other-window file-path) 
     466         
     467        (find-file file-path) 
    497468       
    498469        (anything-c-moccur-widen-if-need)