emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/tumme.el,v


From: Mathias Dahl
Subject: [Emacs-diffs] Changes to emacs/lisp/tumme.el,v
Date: Mon, 24 Jul 2006 16:16:45 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Mathias Dahl <mathiasdahl>      06/07/24 16:16:45

Index: tumme.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/tumme.el,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- tumme.el    24 Jul 2006 16:10:46 -0000      1.36
+++ tumme.el    24 Jul 2006 16:16:45 -0000      1.37
@@ -977,15 +977,19 @@
   (let ((tag (read-string "Tags to add (separate tags with a semicolon): "))
         curr-file files)
     (if arg
-        (setq files (dired-get-filename))
+        (setq files (list (dired-get-filename)))
       (setq files (dired-get-marked-files)))
-    (tumme-write-tag files tag)))
+    (tumme-write-tags
+     (mapcar
+      (lambda (x)
+        (cons x tag))
+      files))))
 
 (defun tumme-tag-thumbnail ()
   "Tag current thumbnail."
   (interactive)
   (let ((tag (read-string "Tags to add (separate tags with a semicolon): ")))
-    (tumme-write-tag (tumme-original-file-name) tag))
+    (tumme-write-tags (list (cons (tumme-original-file-name) tag))))
   (tumme-update-property
    'tags (tumme-list-tags (tumme-original-file-name))))
 
@@ -2121,19 +2125,19 @@
 (defun tumme-dired-comment-files ()
   "Add comment to current or marked files in dired."
   (interactive)
-  (let ((files (dired-get-marked-files))
-         (comment (tumme-read-comment)))
+  (let ((comment (tumme-read-comment)))
+    (tumme-write-comments
     (mapcar
      (lambda (curr-file)
-       (tumme-write-comment curr-file comment))
-     files)))
+        (cons curr-file comment))
+      (dired-get-marked-files)))))
 
 (defun tumme-comment-thumbnail ()
   "Add comment to current thumbnail in thumbnail buffer."
   (interactive)
   (let* ((file (tumme-original-file-name))
          (comment (tumme-read-comment file)))
-    (tumme-write-comment file comment)
+    (tumme-write-comments (list (cons file comment)))
     (tumme-update-property 'comment comment))
   (tumme-display-thumb-properties))
 
@@ -2573,18 +2577,21 @@
 Use the information in `tumme-widget-list' to save comments and
 tags to their respective image file.  Internal function used by
 `tumme-dired-edit-comment-and-tags'."
-  (mapc
-   (lambda (x)
-     (let ((file (car x))
-           (comment (widget-value (cadr x)))
-           (tags (widget-value (car (cddr x)))))
-       (tumme-write-comment file comment)
-       (mapc
-        (lambda (tag)
-          (tumme-write-tag file tag))
-        (split-string tags ","))))
+  (let (file comment tag-string tag-list lst)
+    (tumme-write-comments
+          (mapcar
+           (lambda (widget)
+             (setq file (car widget)
+                   comment (widget-value (cadr widget)))
+             (cons file comment))
    tumme-widget-list))
-
+    (tumme-write-tags
+     (dolist (widget tumme-widget-list lst)
+       (setq file (car widget)
+             tag-string (widget-value (car (cddr widget)))
+             tag-list (split-string tag-string ","))
+       (dolist (tag tag-list)
+         (push (cons file tag) lst))))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;; TEST-SECTION ;;;;;;;;;;;




reply via email to

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