aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Dahl2006-07-24 16:17:02 +0000
committerMathias Dahl2006-07-24 16:17:02 +0000
commit3098323a4ddd061862fcd8c5aefc8bdb8c4b67d5 (patch)
tree6291c409694b45e76125c928ebea0db296660594
parent231b0d1cd9e088ab0192f712b91651a1a894197f (diff)
downloademacs-3098323a4ddd061862fcd8c5aefc8bdb8c4b67d5.tar.gz
emacs-3098323a4ddd061862fcd8c5aefc8bdb8c4b67d5.zip
(tumme-write-tags): Add.
(tumme-write-comments): Add. (tumme-tag-files): Change to use `tumme-write-tags'. (tumme-tag-thumbnail): Change to use `tumme-write-tags'. (tumme-dired-comment-files): Change to use `tumme-write-comments'. (tumme-save-information-from-widgets): Change to use `tumme-write-comments' and `tumme-write-tags'. (tumme-comment-thumbnail): Change to use `tumme-write-comments'.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/tumme.el51
2 files changed, 35 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5375b041930..ed3f0ea4829 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,12 @@
2 2
3 * tumme.el (tumme-write-tags): Add. 3 * tumme.el (tumme-write-tags): Add.
4 (tumme-write-comments): Add. 4 (tumme-write-comments): Add.
5 (tumme-tag-files): Change to use `tumme-write-tags'.
6 (tumme-tag-thumbnail): Change to use `tumme-write-tags'.
7 (tumme-dired-comment-files): Change to use `tumme-write-comments'.
8 (tumme-save-information-from-widgets): Change to use
9 `tumme-write-comments' and `tumme-write-tags'.
10 (tumme-comment-thumbnail): Change to use `tumme-write-comments'.
5 11
62006-07-24 mathias <mathias.dahl@gmail.com> 122006-07-24 mathias <mathias.dahl@gmail.com>
7 13
diff --git a/lisp/tumme.el b/lisp/tumme.el
index 7e3d83173a1..667d466e0a5 100644
--- a/lisp/tumme.el
+++ b/lisp/tumme.el
@@ -977,15 +977,19 @@ is an alist in the following form:
977 (let ((tag (read-string "Tags to add (separate tags with a semicolon): ")) 977 (let ((tag (read-string "Tags to add (separate tags with a semicolon): "))
978 curr-file files) 978 curr-file files)
979 (if arg 979 (if arg
980 (setq files (dired-get-filename)) 980 (setq files (list (dired-get-filename)))
981 (setq files (dired-get-marked-files))) 981 (setq files (dired-get-marked-files)))
982 (tumme-write-tag files tag))) 982 (tumme-write-tags
983 (mapcar
984 (lambda (x)
985 (cons x tag))
986 files))))
983 987
984(defun tumme-tag-thumbnail () 988(defun tumme-tag-thumbnail ()
985 "Tag current thumbnail." 989 "Tag current thumbnail."
986 (interactive) 990 (interactive)
987 (let ((tag (read-string "Tags to add (separate tags with a semicolon): "))) 991 (let ((tag (read-string "Tags to add (separate tags with a semicolon): ")))
988 (tumme-write-tag (tumme-original-file-name) tag)) 992 (tumme-write-tags (list (cons (tumme-original-file-name) tag))))
989 (tumme-update-property 993 (tumme-update-property
990 'tags (tumme-list-tags (tumme-original-file-name)))) 994 'tags (tumme-list-tags (tumme-original-file-name))))
991 995
@@ -2121,19 +2125,19 @@ the following form:
2121(defun tumme-dired-comment-files () 2125(defun tumme-dired-comment-files ()
2122 "Add comment to current or marked files in dired." 2126 "Add comment to current or marked files in dired."
2123 (interactive) 2127 (interactive)
2124 (let ((files (dired-get-marked-files)) 2128 (let ((comment (tumme-read-comment)))
2125 (comment (tumme-read-comment))) 2129 (tumme-write-comments
2126 (mapcar 2130 (mapcar
2127 (lambda (curr-file) 2131 (lambda (curr-file)
2128 (tumme-write-comment curr-file comment)) 2132 (cons curr-file comment))
2129 files))) 2133 (dired-get-marked-files)))))
2130 2134
2131(defun tumme-comment-thumbnail () 2135(defun tumme-comment-thumbnail ()
2132 "Add comment to current thumbnail in thumbnail buffer." 2136 "Add comment to current thumbnail in thumbnail buffer."
2133 (interactive) 2137 (interactive)
2134 (let* ((file (tumme-original-file-name)) 2138 (let* ((file (tumme-original-file-name))
2135 (comment (tumme-read-comment file))) 2139 (comment (tumme-read-comment file)))
2136 (tumme-write-comment file comment) 2140 (tumme-write-comments (list (cons file comment)))
2137 (tumme-update-property 'comment comment)) 2141 (tumme-update-property 'comment comment))
2138 (tumme-display-thumb-properties)) 2142 (tumme-display-thumb-properties))
2139 2143
@@ -2573,18 +2577,21 @@ the operation by activating the Cancel button.\n\n")
2573Use the information in `tumme-widget-list' to save comments and 2577Use the information in `tumme-widget-list' to save comments and
2574tags to their respective image file. Internal function used by 2578tags to their respective image file. Internal function used by
2575`tumme-dired-edit-comment-and-tags'." 2579`tumme-dired-edit-comment-and-tags'."
2576 (mapc 2580 (let (file comment tag-string tag-list lst)
2577 (lambda (x) 2581 (tumme-write-comments
2578 (let ((file (car x)) 2582 (mapcar
2579 (comment (widget-value (cadr x))) 2583 (lambda (widget)
2580 (tags (widget-value (car (cddr x))))) 2584 (setq file (car widget)
2581 (tumme-write-comment file comment) 2585 comment (widget-value (cadr widget)))
2582 (mapc 2586 (cons file comment))
2583 (lambda (tag) 2587 tumme-widget-list))
2584 (tumme-write-tag file tag)) 2588 (tumme-write-tags
2585 (split-string tags ",")))) 2589 (dolist (widget tumme-widget-list lst)
2586 tumme-widget-list)) 2590 (setq file (car widget)
2587 2591 tag-string (widget-value (car (cddr widget)))
2592 tag-list (split-string tag-string ","))
2593 (dolist (tag tag-list)
2594 (push (cons file tag) lst))))))
2588 2595
2589;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2596;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2590;;;;;;;;; TEST-SECTION ;;;;;;;;;;; 2597;;;;;;;;; TEST-SECTION ;;;;;;;;;;;