emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

thumbs library nits


From: John Paul Wallington
Subject: thumbs library nits
Date: Wed, 28 Apr 2004 11:40:23 +0100

Compiling thumbs.el gave these warnings:

In thumbs-delete-images:
thumbs.el:507:10:Warning: yes-or-no-p called with 2 arguments, but accepts
    only 1
In thumbs-show-image-num:
thumbs.el:535:11:Warning: reference to free variable i
In end of data:
thumbs.el:730:1:Warning: the following functions are not known to be defined: 
caddar, cadar,
    ignore-errors, evenp

Is it okay to install the following fix in Emacs CVS ?

2004-04-28  John Paul Wallington  <address@hidden>

        * thumbs.el (toplevel): Require cl at compile time.
        (thumbs-delete-images): Fix formatting of prompt.
        (thumbs-show-image-num): Move assignment of
        `thumbs-current-image-filename' within dynamic scope of `i'.
        (thumbs-emboss-image): Don't use `evenp'.

--- thumbs.el   28 Apr 2004 10:47:13 +0100      1.3
+++ thumbs.el   28 Apr 2004 11:30:28 +0100      
@@ -56,6 +56,8 @@
 
 ;;; Code:
 
+(eval-when-compile
+  (require 'cl))
 (require 'dired)
 
 ;; Abort if in-line imaging isn't supported (i.e. Emacs-20.7)
@@ -504,7 +506,7 @@
   "Delete the image at point (and it's thumbnail) (or marked files if any)."
   (interactive)
   (let ((f (or thumbs-markedL (list (cdr (assoc (point) thumbs-fileL))))))
-    (if (yes-or-no-p "Really delete %d files?" (length f))
+    (if (yes-or-no-p (format "Really delete %d files? " (length f)))
        (progn
          (mapcar (lambda (x)
                    (setq thumbs-fileL (delete (rassoc x thumbs-fileL) 
thumbs-fileL))
@@ -529,9 +531,9 @@
       (rename-buffer (concat "*Image: "
                             (file-name-nondirectory i)
                             " - "
-                            (number-to-string num) "*")))
-    (setq thumbs-image-num num
-         thumbs-current-image-filename i)))
+                            (number-to-string num) "*"))
+      (setq thumbs-image-num num
+           thumbs-current-image-filename i))))
 
 (defun thumbs-next-image ()
   "Show next image."
@@ -597,7 +599,7 @@
 (defun thumbs-emboss-image (emboss)
   "Emboss the image with value EMBOSS."
   (interactive "nEmboss value: ")
-  (if (or (< emboss 3)(> emboss 31)(evenp emboss))
+  (if (or (< emboss 3) (> emboss 31) (zerop (logand emboss 1)))
       (error "Arg must be a odd number between 3 and 31"))
   (thumbs-modify-image "emboss" (number-to-string emboss)))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]