Skip to content

Commit

Permalink
* helm-ring.el: Fix use of kill-ring browser in a running helm session.
Browse files Browse the repository at this point in the history
  • Loading branch information
thierryvolpiatto committed May 8, 2012
1 parent 739a273 commit f462a93
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
3 changes: 1 addition & 2 deletions helm-buffers.el
Expand Up @@ -394,13 +394,12 @@ See `helm-ediff-marked-buffers'."
;;; Candidate Transformers
;;
;;

(defun helm-buffers-skip-entries (seq regexp-list)
"Remove entries which matches REGEXP from SEQ."
(loop for i in seq
unless (loop for regexp in regexp-list
thereis (and (stringp i)
(string-match regexp i)))
(string-match regexp i)))
collect i))

(defun helm-c-skip-boring-buffers (buffers)
Expand Down
15 changes: 9 additions & 6 deletions helm-ring.el
Expand Up @@ -99,16 +99,16 @@ If this action is executed just after `yank',
replace with STR as yanked string."
(setq kill-ring (delete str kill-ring))
(if (not (eq (helm-attr 'last-command) 'yank))
(insert-for-yank str)
(with-helm-current-buffer (insert-for-yank str))
;; from `yank-pop'
(let ((inhibit-read-only t)
(before (< (point) (mark t))))
(if before
(funcall (or yank-undo-function 'delete-region) (point) (mark t))
(funcall (or yank-undo-function 'delete-region) (mark t) (point)))
(setq yank-undo-function nil)
(set-marker (mark-marker) (point) (current-buffer))
(insert-for-yank str)
(set-marker (mark-marker) (point) helm-current-buffer)
(with-helm-current-buffer (insert-for-yank str))
;; Set the window start back where it was in the yank command,
;; if possible.
(set-window-start (selected-window) yank-window-start t)
Expand All @@ -117,7 +117,7 @@ replace with STR as yanked string."
;; It is cleaner to avoid activation, even though the command
;; loop would deactivate the mark because we inserted text.
(goto-char (prog1 (mark t)
(set-marker (mark-marker) (point) (current-buffer)))))))
(set-marker (mark-marker) (point) helm-current-buffer))))))
(kill-new str))


Expand Down Expand Up @@ -344,8 +344,11 @@ It is drop-in replacement of `yank-pop'.
You may bind this command to M-y.
First call open the kill-ring browser, next calls move to next line."
(interactive)
(helm :sources 'helm-c-source-kill-ring
:buffer "*helm kill-ring*"))
(if (get-buffer-window helm-buffer)
(helm-nest :sources 'helm-c-source-kill-ring
:buffer "*helm kill-ring*")
(helm :sources 'helm-c-source-kill-ring
:buffer "*helm kill-ring*")))

(provide 'helm-ring)

Expand Down

0 comments on commit f462a93

Please sign in to comment.