Add some require's to suppress compile warning.
[riece] / lisp / riece-yank.el
index a03c71f..3775f50 100644 (file)
@@ -1,4 +1,4 @@
-;;; riece-yank.el --- enter the element in kill-ring
+;;; riece-yank.el --- enter the element of kill-ring
 ;; Copyright (C) 2004 Masatake YAMATO
 
 ;; Author: Masatake YAMATO <jet@gyve.org>
 ;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
-;;
-;; 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) to test.
-;;
+
+;; NOTE: This is an add-on module for Riece.
+
 ;;; Code:
 (require 'riece-commands)
 
 (defgroup riece-yank nil
-  "Enter the element of `kill-ring'"
+  "Enter the element of kill-ring."
   :tag "Yank"
   :prefix "riece-"
   :group 'riece)
@@ -45,11 +43,15 @@ before/after the first/last non-blank line."
   :type 'boolean
   :group 'riece-yank)
 
+(defconst riece-yank-description
+  "Enter the element of kill-ring.")
+
 (defvar riece-yank-enabled nil)
 
 (defun riece-yank-insinuate ()
   )
 
+(defvar riece-command-mode-map)
 (defun riece-yank-enable ()
   (define-key riece-command-mode-map "\C-cy" 'riece-command-yank)
   (setq riece-yank-enabled t))
@@ -70,14 +72,14 @@ 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 (arg prefix)
@@ -86,7 +88,7 @@ before/after the first/last non-blank line."
            (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