Changeset 18828 for lang/elisp
- Timestamp:
- 09/04/08 14:40:30 (3 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/elisp/anything-c-moccur/branches/new-anything/anything-c-moccur.el
r18824 r18828 217 217 (anything-c-moccur-anything-try-execute-persistent-action)) 218 218 219 ;;; Advise and Hack220 (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-window224 (select-window (get-buffer-window anything-buffer))225 (select-window (setq minibuffer-scroll-window226 (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-sources230 ;; the action list is shown231 anything-saved-selection232 (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))) ; lambda238 ;; select the default action239 (setq action (cdar action)))240 (set-window-dedicated-p anything-window t)241 (unwind-protect242 (and action selection (funcall action selection))243 (set-window-dedicated-p anything-window nil)))))244 245 219 (defun anything-c-moccur-initialize () 246 220 (setq anything-c-moccur-anything-invoking-flag t) … … 249 223 250 224 (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))) 254 227 255 228 (defmacro anything-c-moccur-with-anything-env (sources &rest body) … … 483 456 (anything-c-moccur-next-line-if-info-line) 484 457 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))) 489 459 490 460 (multiple-value-bind (buffer file-path) … … 494 464 (stringp file-path) 495 465 (file-readable-p file-path)) 496 (find-file-other-window file-path) 466 467 (find-file file-path) 497 468 498 469 (anything-c-moccur-widen-if-need)
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)