comparison lisp/image-dired.el @ 99116:2e0e3e5cbd97

* completion.el (add-completion-to-head, add-completion): Doc fixes. (completion-search-next, add-completions-from-file): Fix typos in docstrings. * filesets.el (filesets-menu-ensure-use-cached) (filesets-ingroup-patterns, filesets-filetype-property): * tutorial.el (get-lang-string): * play/gamegrid.el (gamegrid-score-file-length, gamegrid-add-score): Fix typos in docstrings. * image-dired.el (image-dired-dired-after-readin-hook): Doc fix. (image-dired-line-up-method, image-dired-thumb-size) (image-dired-cmd-write-exif-data-options, image-dired-write-tags) (image-dired-track-original-file, image-dired-track-thumbnail) (image-dired-dired-next-line, image-dired-dired-previous-line) (image-dired-write-comments): Reflow docstrings. (image-dired-show-all-from-dir-max-files) (image-dired-format-properties-string, image-dired-create-thumbs) (image-dired-mark-tagged-files, image-dired-gallery-generate): Fix typos in docstrings. * savehist.el (savehist-save-minibuffer-history, savehist-file) (savehist-additional-variables, savehist-ignored-variables) (savehist-file-modes, savehist-autosave-interval): * startup.el (inhibit-startup-echo-area-message, inhibit-default-init) (inhibit-startup-buffer-menu, mail-host-address, user-mail-address) (fancy-splash-image): * thumbs.el (thumbs-thumbsdir, thumbs-geometry, thumbs-relief) (thumbs-conversion-program, thumbs-margin): Remove spurious * in docstrings.
author Juanma Barranquero <lekktu@gmail.com>
date Sat, 25 Oct 2008 00:46:25 +0000
parents 814d2d823dd7
children a9dc0e7c3f2b
comparison
equal deleted inserted replaced
99115:ec94709902e9 99116:2e0e3e5cbd97
364 364
365 (defcustom image-dired-cmd-write-exif-data-options 365 (defcustom image-dired-cmd-write-exif-data-options
366 "%p -%t=\"%v\" \"%f\"" 366 "%p -%t=\"%v\" \"%f\""
367 "Format of command used to write EXIF data. 367 "Format of command used to write EXIF data.
368 Available options are %p which is replaced by 368 Available options are %p which is replaced by
369 `image-dired-cmd-write-exif-data-program', %f which is replaced by the 369 `image-dired-cmd-write-exif-data-program', %f which is replaced by
370 image file name, %t which is replaced by the tag name and %v 370 the image file name, %t which is replaced by the tag name and %v
371 which is replaced by the tag value." 371 which is replaced by the tag value."
372 :type 'string 372 :type 'string
373 :group 'image-dired) 373 :group 'image-dired)
374 374
375 (defcustom image-dired-cmd-read-exif-data-program 375 (defcustom image-dired-cmd-read-exif-data-program
395 :type '(repeat string) 395 :type '(repeat string)
396 :group 'image-dired) 396 :group 'image-dired)
397 397
398 (defcustom image-dired-thumb-size (if (eq 'standard image-dired-thumbnail-storage) 128 100) 398 (defcustom image-dired-thumb-size (if (eq 'standard image-dired-thumbnail-storage) 128 100)
399 "Size of thumbnails, in pixels. 399 "Size of thumbnails, in pixels.
400 This is the default size for both `image-dired-thumb-width' and `image-dired-thumb-height'." 400 This is the default size for both `image-dired-thumb-width'
401 and `image-dired-thumb-height'."
401 :type 'integer 402 :type 'integer
402 :group 'image-dired) 403 :group 'image-dired)
403 404
404 (defcustom image-dired-thumb-width image-dired-thumb-size 405 (defcustom image-dired-thumb-width image-dired-thumb-size
405 "Width of thumbnails, in pixels." 406 "Width of thumbnails, in pixels."
422 :type 'integer 423 :type 'integer
423 :group 'image-dired) 424 :group 'image-dired)
424 425
425 (defcustom image-dired-line-up-method 'dynamic 426 (defcustom image-dired-line-up-method 'dynamic
426 "Default method for line-up of thumbnails in thumbnail buffer. 427 "Default method for line-up of thumbnails in thumbnail buffer.
427 Used by `image-dired-display-thumbs' and other functions that needs to 428 Used by `image-dired-display-thumbs' and other functions that needs
428 line-up thumbnails. Dynamic means to use the available width of the 429 to line-up thumbnails. Dynamic means to use the available width of
429 window containing the thumbnail buffer, Fixed means to use 430 the window containing the thumbnail buffer, Fixed means to use
430 `image-dired-thumbs-per-row', Interactive is for asking the user, and No 431 `image-dired-thumbs-per-row', Interactive is for asking the user,
431 line-up means that no automatic line-up will be done." 432 and No line-up means that no automatic line-up will be done."
432 :type '(choice :tag "Default line-up method" 433 :type '(choice :tag "Default line-up method"
433 (const :tag "Dynamic" dynamic) 434 (const :tag "Dynamic" dynamic)
434 (const :tag "Fixed" fixed) 435 (const :tag "Fixed" fixed)
435 (const :tag "Interactive" interactive) 436 (const :tag "Interactive" interactive)
436 (const :tag "No line-up" none)) 437 (const :tag "No line-up" none))
507 Used by `image-dired-copy-with-exif-file-name'." 508 Used by `image-dired-copy-with-exif-file-name'."
508 :type 'string 509 :type 'string
509 :group 'image-dired) 510 :group 'image-dired)
510 511
511 (defcustom image-dired-show-all-from-dir-max-files 50 512 (defcustom image-dired-show-all-from-dir-max-files 50
512 "Maximum number of files to show using `image-dired-show-all-from-dir'. 513 "Maximum number of files to show using `image-dired-show-all-from-dir'
513 before warning the user." 514 before warning the user."
514 :type 'integer 515 :type 'integer
515 :group 'image-dired) 516 :group 'image-dired)
516 517
517 (defun image-dired-dir () 518 (defun image-dired-dir ()
653 nil) 654 nil)
654 (add-hook 'dired-after-readin-hook 'image-dired-dired-after-readin-hook nil t)) 655 (add-hook 'dired-after-readin-hook 'image-dired-dired-after-readin-hook nil t))
655 656
656 (defun image-dired-dired-after-readin-hook () 657 (defun image-dired-dired-after-readin-hook ()
657 "Relocate existing thumbnail overlays in dired buffer after reverting. 658 "Relocate existing thumbnail overlays in dired buffer after reverting.
658 Move them to their corresponding files if they are still exist. 659 Move them to their corresponding files if they still exist.
659 Otherwise, delete overlays." 660 Otherwise, delete overlays."
660 (mapc (lambda (overlay) 661 (mapc (lambda (overlay)
661 (when (overlay-get overlay 'put-image) 662 (when (overlay-get overlay 'put-image)
662 (let* ((image-file (overlay-get overlay 'image-file)) 663 (let* ((image-file (overlay-get overlay 'image-file))
663 (image-pos (dired-goto-file image-file))) 664 (image-pos (dired-goto-file image-file)))
883 (file-exists-p image-dired-db-file)) 884 (file-exists-p image-dired-db-file))
884 (error "Could not create %s" image-dired-db-file))) 885 (error "Could not create %s" image-dired-db-file)))
885 886
886 (defun image-dired-write-tags (file-tags) 887 (defun image-dired-write-tags (file-tags)
887 "Write file tags to database. 888 "Write file tags to database.
888 Write each file and tag in FILE-TAGS to the database. FILE-TAGS 889 Write each file and tag in FILE-TAGS to the database.
889 is an alist in the following form: 890 FILE-TAGS is an alist in the following form:
890 ((FILE . TAG) ... )" 891 ((FILE . TAG) ... )"
891 (image-dired-sane-db-file) 892 (image-dired-sane-db-file)
892 (let (end file tag) 893 (let (end file tag)
893 (with-temp-file image-dired-db-file 894 (with-temp-file image-dired-db-file
894 (insert-file-contents image-dired-db-file) 895 (insert-file-contents image-dired-db-file)
1019 (equal (window-buffer window) buf)) 1020 (equal (window-buffer window) buf))
1020 nil t)) 1021 nil t))
1021 1022
1022 (defun image-dired-track-original-file () 1023 (defun image-dired-track-original-file ()
1023 "Track the original file in the associated dired buffer. 1024 "Track the original file in the associated dired buffer.
1024 See documentation for `image-dired-toggle-movement-tracking'. Interactive 1025 See documentation for `image-dired-toggle-movement-tracking'.
1025 use only useful if `image-dired-track-movement' is nil." 1026 Interactive use only useful if `image-dired-track-movement' is nil."
1026 (interactive) 1027 (interactive)
1027 (let ((old-buf (current-buffer)) 1028 (let ((old-buf (current-buffer))
1028 (dired-buf (image-dired-associated-dired-buffer)) 1029 (dired-buf (image-dired-associated-dired-buffer))
1029 (file-name (image-dired-original-file-name))) 1030 (file-name (image-dired-original-file-name)))
1030 (when (and (buffer-live-p dired-buf) file-name) 1031 (when (and (buffer-live-p dired-buf) file-name)
1045 (setq image-dired-track-movement (not image-dired-track-movement)) 1046 (setq image-dired-track-movement (not image-dired-track-movement))
1046 (message "Tracking %s" (if image-dired-track-movement "on" "off"))) 1047 (message "Tracking %s" (if image-dired-track-movement "on" "off")))
1047 1048
1048 (defun image-dired-track-thumbnail () 1049 (defun image-dired-track-thumbnail ()
1049 "Track current dired file's thumb in `image-dired-thumbnail-buffer'. 1050 "Track current dired file's thumb in `image-dired-thumbnail-buffer'.
1050 This is almost the same as what `image-dired-track-original-file' does, but 1051 This is almost the same as what `image-dired-track-original-file' does,
1051 the other way around." 1052 but the other way around."
1052 (let ((file (dired-get-filename)) 1053 (let ((file (dired-get-filename))
1053 (old-buf (current-buffer)) 1054 (old-buf (current-buffer))
1054 prop-val found) 1055 prop-val found)
1055 (when (get-buffer image-dired-thumbnail-buffer) 1056 (when (get-buffer image-dired-thumbnail-buffer)
1056 (set-buffer image-dired-thumbnail-buffer) 1057 (set-buffer image-dired-thumbnail-buffer)
1069 (image-dired-display-thumb-properties)) 1070 (image-dired-display-thumb-properties))
1070 (set-buffer old-buf)))) 1071 (set-buffer old-buf))))
1071 1072
1072 (defun image-dired-dired-next-line (&optional arg) 1073 (defun image-dired-dired-next-line (&optional arg)
1073 "Call `dired-next-line', then track thumbnail. 1074 "Call `dired-next-line', then track thumbnail.
1074 This can safely replace `dired-next-line'. With prefix argument, move 1075 This can safely replace `dired-next-line'.
1075 ARG lines." 1076 With prefix argument, move ARG lines."
1076 (interactive "P") 1077 (interactive "P")
1077 (dired-next-line (or arg 1)) 1078 (dired-next-line (or arg 1))
1078 (if image-dired-track-movement 1079 (if image-dired-track-movement
1079 (image-dired-track-thumbnail))) 1080 (image-dired-track-thumbnail)))
1080 1081
1081 (defun image-dired-dired-previous-line (&optional arg) 1082 (defun image-dired-dired-previous-line (&optional arg)
1082 "Call `dired-previous-line', then track thumbnail. 1083 "Call `dired-previous-line', then track thumbnail.
1083 This can safely replace `dired-previous-line'. With prefix argument, 1084 This can safely replace `dired-previous-line'.
1084 move ARG lines." 1085 With prefix argument, move ARG lines."
1085 (interactive "P") 1086 (interactive "P")
1086 (dired-previous-line (or arg 1)) 1087 (dired-previous-line (or arg 1))
1087 (if image-dired-track-movement 1088 (if image-dired-track-movement
1088 (image-dired-track-thumbnail))) 1089 (image-dired-track-thumbnail)))
1089 1090
1156 (image-dired-display-thumb-properties)) 1157 (image-dired-display-thumb-properties))
1157 1158
1158 (defun image-dired-format-properties-string (buf file props comment) 1159 (defun image-dired-format-properties-string (buf file props comment)
1159 "Format display properties. 1160 "Format display properties.
1160 BUF is the associated dired buffer, FILE is the original image file 1161 BUF is the associated dired buffer, FILE is the original image file
1161 name, PROPS is a list of tags and COMMENT is the image files's 1162 name, PROPS is a list of tags and COMMENT is the image file's
1162 comment." 1163 comment."
1163 (format-spec 1164 (format-spec
1164 image-dired-display-properties-format 1165 image-dired-display-properties-format
1165 (list 1166 (list
1166 (cons ?b (or buf "")) 1167 (cons ?b (or buf ""))
1586 (declare-function clear-image-cache "image.c" (&optional filter)) 1587 (declare-function clear-image-cache "image.c" (&optional filter))
1587 1588
1588 (defun image-dired-create-thumbs (&optional arg) 1589 (defun image-dired-create-thumbs (&optional arg)
1589 "Create thumbnail images for all marked files in dired. 1590 "Create thumbnail images for all marked files in dired.
1590 With prefix argument ARG, create thumbnails even if they already exist 1591 With prefix argument ARG, create thumbnails even if they already exist
1591 \(i.e. use this to refresh your thumbnails)." 1592 \(i.e. use this to refresh your thumbnails)."
1592 (interactive "P") 1593 (interactive "P")
1593 (let (curr-file thumb-name files count) 1594 (let (curr-file thumb-name files count)
1594 (setq files (dired-get-marked-files)) 1595 (setq files (dired-get-marked-files))
1595 (mapcar 1596 (mapcar
1596 (lambda (curr-file) 1597 (lambda (curr-file)
2046 (image-dired-backward-image) 2047 (image-dired-backward-image)
2047 (image-dired-display-thumbnail-original-image)) 2048 (image-dired-display-thumbnail-original-image))
2048 2049
2049 (defun image-dired-write-comments (file-comments) 2050 (defun image-dired-write-comments (file-comments)
2050 "Write file comments to database. 2051 "Write file comments to database.
2051 Write file comments to one or more files. FILE-COMMENTS is an alist on 2052 Write file comments to one or more files.
2052 the following form: 2053 FILE-COMMENTS is an alist on the following form:
2053 ((FILE . COMMENT) ... )" 2054 ((FILE . COMMENT) ... )"
2054 (image-dired-sane-db-file) 2055 (image-dired-sane-db-file)
2055 (let (end comment-beg-pos comment-end-pos file comment) 2056 (let (end comment-beg-pos comment-end-pos file comment)
2056 (with-temp-file image-dired-db-file 2057 (with-temp-file image-dired-db-file
2057 (insert-file-contents image-dired-db-file) 2058 (insert-file-contents image-dired-db-file)
2147 "Use regexp to mark files with matching tag. 2148 "Use regexp to mark files with matching tag.
2148 A `tag' is a keyword, a piece of meta data, associated with an 2149 A `tag' is a keyword, a piece of meta data, associated with an
2149 image file and stored in image-dired's database file. This command 2150 image file and stored in image-dired's database file. This command
2150 lets you input a regexp and this will be matched against all tags 2151 lets you input a regexp and this will be matched against all tags
2151 on all image files in the database file. The files that have a 2152 on all image files in the database file. The files that have a
2152 matching tags will be marked in the dired buffer." 2153 matching tag will be marked in the dired buffer."
2153 (interactive) 2154 (interactive)
2154 (image-dired-sane-db-file) 2155 (image-dired-sane-db-file)
2155 (let ((tag (read-string "Mark tagged files (regexp): ")) 2156 (let ((tag (read-string "Mark tagged files (regexp): "))
2156 (hits 0) 2157 (hits 0)
2157 files buf) 2158 files buf)
2358 2359
2359 (defun image-dired-gallery-generate () 2360 (defun image-dired-gallery-generate ()
2360 "Generate gallery pages. 2361 "Generate gallery pages.
2361 First we create a couple of Lisp structures from the database to make 2362 First we create a couple of Lisp structures from the database to make
2362 it easier to generate, then HTML-files are created in 2363 it easier to generate, then HTML-files are created in
2363 `image-dired-gallery-dir'" 2364 `image-dired-gallery-dir'."
2364 (interactive) 2365 (interactive)
2365 (if (eq 'per-directory image-dired-thumbnail-storage) 2366 (if (eq 'per-directory image-dired-thumbnail-storage)
2366 (error "Currently, gallery generation is not supported \ 2367 (error "Currently, gallery generation is not supported \
2367 when using per-directory thumbnail file storage")) 2368 when using per-directory thumbnail file storage"))
2368 (image-dired-create-gallery-lists) 2369 (image-dired-create-gallery-lists)