From b585b8c48d3969d55d152fcf45df0b193dbaf6a9 Mon Sep 17 00:00:00 2001 From: thierry Date: Mon, 6 Jul 2009 09:37:10 +0200 Subject: [PATCH] Add redefinition of `anything-toggle-visible-mark' waiting a fix in anything.el. --- anything-config.el | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/anything-config.el b/anything-config.el index 6956429..eaebf71 100644 --- a/anything-config.el +++ b/anything-config.el @@ -3301,6 +3301,38 @@ See also `anything-create--actions'." ;; (anything 'anything-c-source-emacs-process) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Marked Candidates ;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defvar anything-c-marked-candidate-list nil) +(defun anything-toggle-visible-mark-2 () + (interactive) + (with-anything-window + (anything-aif (loop for o in anything-visible-mark-overlays + when (equal (line-beginning-position) (overlay-start o)) + do + (return o)) + ;; delete + (progn + (setq anything-c-marked-candidate-list + (remove + (buffer-substring-no-properties (point-at-bol) (point-at-eol)) anything-c-marked-candidate-list)) + (delete-overlay it) + (delq it anything-visible-mark-overlays)) + (let ((o (make-overlay (line-beginning-position) (1+ (line-end-position))))) + (overlay-put o 'face anything-visible-mark-face) + (overlay-put o 'source (assoc-default 'name (anything-get-current-source))) + (overlay-put o 'string (buffer-substring (overlay-start o) (overlay-end o))) + (add-to-list 'anything-visible-mark-overlays o) + (push (buffer-substring-no-properties (point-at-bol) (point-at-eol)) anything-c-marked-candidate-list) + (anything-next-line))))) + +(fset 'anything-toggle-visible-mark (symbol-function 'anything-toggle-visible-mark-2)) + +(add-hook 'anything-after-initialize-hook (lambda () + (setq anything-c-marked-candidate-list nil))) + +(add-hook 'anything-after-action-hook (lambda () + (setq anything-c-marked-candidate-list nil))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Action Helpers ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Files (defvar anything-c-external-commands-list nil -- 2.11.4.GIT