| 45 | | |
| 46 | | (defadvice anything-execute-selection-action (around anything-c-dabbrev-saved-sources activate) |
| 47 | | "If a candidate was selected then perform the associated |
| 48 | | action." |
| 49 | | (cond ((and (boundp 'anything-c-dabbrev-invoking-flag) |
| 50 | | anything-c-dabbrev-invoking-flag) |
| 51 | | (let* ((selection (if anything-saved-sources |
| 52 | | ;; the action list is shown |
| 53 | | anything-saved-selection |
| 54 | | (anything-get-selection))) |
| 55 | | (action (or anything-c-dabbrev-anything-saved-action |
| 56 | | (if anything-saved-sources |
| 57 | | ;; the action list is shown |
| 58 | | (anything-get-selection) |
| 59 | | (anything-get-action))))) |
| 60 | | |
| 61 | | (if (and (listp action) |
| 62 | | (not (functionp action))) ; lambda |
| 63 | | ;;select the default action |
| 64 | | (setq action (cdar action))) |
| 65 | | (setq anything-c-dabbrev-anything-saved-action nil) |
| 66 | | (if (and selection action) |
| 67 | | (funcall action selection)))) |
| 68 | | (t |
| 69 | | ad-do-it))) |