X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Friece-yank.el;h=12a21cc530004d57246eaecde31e8cd050b7917f;hb=9426a597f9b6ba184b96ba27e4050ec5d16411f3;hp=c774980f33eb401bd3981b956e361f19aca7ba1a;hpb=a47568b9565c70082b6fc90d58c66e7b85ab8d58;p=riece diff --git a/lisp/riece-yank.el b/lisp/riece-yank.el index c774980..12a21cc 100644 --- a/lisp/riece-yank.el +++ b/lisp/riece-yank.el @@ -1,4 +1,4 @@ -;;; riece-kill.el --- enter the element in kill-ring +;;; riece-yank.el --- enter the element in kill-ring ;; Copyright (C) 2004 Masatake YAMATO ;; Author: Masatake YAMATO @@ -23,7 +23,7 @@ ;; ;; In riece's command buffer, you can send the top element of kill-ring ;; by C-c y. -;; Don't forget do (riece-command-enable-addon 'riece-yank). +;; Don't forget do (riece-command-enable-addon 'riece-yank) to test. ;; ;;; Code: (require 'riece-commands) @@ -70,23 +70,23 @@ before/after the first/last non-blank line." (while (progn (beginning-of-line) (looking-at " *$")) (delete-region (point) (progn (end-of-line 0) (point)))) ;; Delete common spaces in front of lines. - (setq space-width (point-max)) - (while (looking-at " +") - (setq space-width (min space-width (length (match-string 0)))) - (forward-line)) - (goto-char (point-min)) - (while (not (eobp)) - (delete-char space-width) - (forward-line)) + (let ((space-width (point-max))) + (while (looking-at " +") + (setq space-width (min space-width (length (match-string 0)))) + (forward-line)) + (goto-char (point-min)) + (while (not (eobp)) + (delete-char space-width) + (forward-line))) (buffer-string))) -(defun riece-command-yank (prefix) - (interactive "sPrefix: ") +(defun riece-command-yank (arg prefix) + (interactive "P\nsPrefix: ") (when (or (not prefix) (string= prefix "")) (setq prefix " ")) (let* ((kill (current-kill 0)) - msg space-width) + msg) (unless kill (error "Nothing to send in kill-ring")) (if riece-yank-strip-space @@ -95,9 +95,9 @@ before/after the first/last non-blank line." (when (y-or-n-p (format "Send \"%s\"\n? " kill)) (mapcar (lambda (x) - (riece-command-send-message (concat prefix x) nil) + (riece-command-send-message (concat prefix x) arg) ;; Without next line, you will be kicked out from ircd. - ;; It may means "Don't send much data at once." + ;; It may mean "Don't send much data at once." (sit-for riece-yank-tick)) msg))))