Browse files

* helm-ring.el: Fix use of kill-ring browser in a running helm session.

  • Loading branch information...
1 parent 739a273 commit f462a93634df92eead96cdd33afedaf4ac10bc67 @thierryvolpiatto thierryvolpiatto committed May 8, 2012
Showing with 10 additions and 8 deletions.
  1. +1 −2 helm-buffers.el
  2. +9 −6 helm-ring.el
@@ -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)
@@ -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)
@@ -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))
@@ -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."
- (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)

0 comments on commit f462a93

Please sign in to comment.