diff options
| author | Mathias Dahl | 2006-02-10 23:43:02 +0000 |
|---|---|---|
| committer | Mathias Dahl | 2006-02-10 23:43:02 +0000 |
| commit | 2f8953c2746d8afb43a969cbcd4345686504ace5 (patch) | |
| tree | 336238ee81430a4d00f8c1b189b20350bdac8ea4 | |
| parent | 6295b3b11d0bf353d7afd2e1aa138374099720d5 (diff) | |
| download | emacs-2f8953c2746d8afb43a969cbcd4345686504ace5.tar.gz emacs-2f8953c2746d8afb43a969cbcd4345686504ace5.zip | |
(tumme-dir): Changed default value to "~/.emacs-d/tumme"
(tumme-dir): New function. Copied from thumbs.el.
| -rw-r--r-- | lisp/tumme.el | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/lisp/tumme.el b/lisp/tumme.el index 0436a0cb55e..0e0b85248c0 100644 --- a/lisp/tumme.el +++ b/lisp/tumme.el | |||
| @@ -57,8 +57,8 @@ | |||
| 57 | ;; | 57 | ;; |
| 58 | ;; `tumme' stores the thumbnail files in `tumme-dir' using the file | 58 | ;; `tumme' stores the thumbnail files in `tumme-dir' using the file |
| 59 | ;; name format ORIGNAME.thumb.ORIGEXT. For example | 59 | ;; name format ORIGNAME.thumb.ORIGEXT. For example |
| 60 | ;; ~/.tumme/myimage01.thumb.jpg. The "database" is for now just a | 60 | ;; ~/.emacs.d/tumme/myimage01.thumb.jpg. The "database" is for now |
| 61 | ;; plain text file with the following format: | 61 | ;; just a plain text file with the following format: |
| 62 | ;; | 62 | ;; |
| 63 | ;; file-name-non-directory;comment:comment-text;tag1;tag2;tag3;...;tagN | 63 | ;; file-name-non-directory;comment:comment-text;tag1;tag2;tag3;...;tagN |
| 64 | ;; | 64 | ;; |
| @@ -508,6 +508,11 @@ | |||
| 508 | ;; `thumme-thumb-name', `tumme-create-thumb', etc. His code to get | 508 | ;; `thumme-thumb-name', `tumme-create-thumb', etc. His code to get |
| 509 | ;; speedbar display tumme thumbnails, might be integrated soon. | 509 | ;; speedbar display tumme thumbnails, might be integrated soon. |
| 510 | ;; | 510 | ;; |
| 511 | ;; * Changed the default value of `tumme-dir' to "~/.emacs.d/tumme" | ||
| 512 | ;; and added a new function, `tumme-dir' to handle the creating of | ||
| 513 | ;; it. Code copied from thumbs.el. | ||
| 514 | ;; | ||
| 515 | ;; | ||
| 511 | ;; TODO | 516 | ;; TODO |
| 512 | ;; ==== | 517 | ;; ==== |
| 513 | ;; | 518 | ;; |
| @@ -572,8 +577,8 @@ | |||
| 572 | :prefix "tumme-" | 577 | :prefix "tumme-" |
| 573 | :group 'files) | 578 | :group 'files) |
| 574 | 579 | ||
| 575 | (defcustom tumme-dir "~/.tumme/" | 580 | (defcustom tumme-dir "~/.emacs.d/tumme/" |
| 576 | "*Directory where thumbnail images for are stored." | 581 | "*Directory where thumbnail images are stored." |
| 577 | :type 'string | 582 | :type 'string |
| 578 | :group 'tumme) | 583 | :group 'tumme) |
| 579 | 584 | ||
| @@ -589,17 +594,17 @@ means that each thumbnail is stored in a subdirectory called | |||
| 589 | (const :tag "Per-directory" per-directory)) | 594 | (const :tag "Per-directory" per-directory)) |
| 590 | :group 'tumme) | 595 | :group 'tumme) |
| 591 | 596 | ||
| 592 | (defcustom tumme-db-file "~/.tumme/.tumme_db" | 597 | (defcustom tumme-db-file "~/.emacs.d/tumme/.tumme_db" |
| 593 | "*Database file where file names and their associated tags are stored." | 598 | "*Database file where file names and their associated tags are stored." |
| 594 | :type 'string | 599 | :type 'string |
| 595 | :group 'tumme) | 600 | :group 'tumme) |
| 596 | 601 | ||
| 597 | (defcustom tumme-temp-image-file "~/.tumme/.tumme_temp" | 602 | (defcustom tumme-temp-image-file "~/.emacs.d/tumme/.tumme_temp" |
| 598 | "*Name of temporary image file used by various commands." | 603 | "*Name of temporary image file used by various commands." |
| 599 | :type 'string | 604 | :type 'string |
| 600 | :group 'tumme) | 605 | :group 'tumme) |
| 601 | 606 | ||
| 602 | (defcustom tumme-gallery-dir "~/.tumme/.tumme_gallery" | 607 | (defcustom tumme-gallery-dir "~/.emacs.d/tumme/.tumme_gallery" |
| 603 | "*Directory to store generated gallery html pages. | 608 | "*Directory to store generated gallery html pages. |
| 604 | This path needs to be \"shared\" to the public so that it can access | 609 | This path needs to be \"shared\" to the public so that it can access |
| 605 | the index.html page that tumme creates." | 610 | the index.html page that tumme creates." |
| @@ -696,7 +701,7 @@ original image file name and %t which is replaced by | |||
| 696 | :group 'tumme) | 701 | :group 'tumme) |
| 697 | 702 | ||
| 698 | (defcustom tumme-temp-rotate-image-file | 703 | (defcustom tumme-temp-rotate-image-file |
| 699 | "~/.tumme/.tumme_rotate_temp" | 704 | "~/.emacs.d/tumme/.tumme_rotate_temp" |
| 700 | "*Temporary file for rotate operations." | 705 | "*Temporary file for rotate operations." |
| 701 | :type 'string | 706 | :type 'string |
| 702 | :group 'tumme) | 707 | :group 'tumme) |
| @@ -851,6 +856,16 @@ before warning the user." | |||
| 851 | :type 'integer | 856 | :type 'integer |
| 852 | :group 'tumme) | 857 | :group 'tumme) |
| 853 | 858 | ||
| 859 | (defun tumme-dir () | ||
| 860 | "Return the current thumbnails directory (from `tumme-dir'). | ||
| 861 | Create the thumbnails directory if it does not exist." | ||
| 862 | (let ((tumme-dir (file-name-as-directory | ||
| 863 | (expand-file-name tumme-dir)))) | ||
| 864 | (unless (file-directory-p tumme-dir) | ||
| 865 | (make-directory tumme-dir t) | ||
| 866 | (message "Creating thumbnails directory")) | ||
| 867 | tumme-dir)) | ||
| 868 | |||
| 854 | (defun tumme-insert-image (file type relief margin) | 869 | (defun tumme-insert-image (file type relief margin) |
| 855 | "Insert image FILE of image TYPE, using RELIEF and MARGIN, at point." | 870 | "Insert image FILE of image TYPE, using RELIEF and MARGIN, at point." |
| 856 | 871 | ||
| @@ -909,7 +924,7 @@ add a subdirectory." | |||
| 909 | ;; be used here. | 924 | ;; be used here. |
| 910 | (setq md5-hash (md5 (file-name-as-directory | 925 | (setq md5-hash (md5 (file-name-as-directory |
| 911 | (file-name-directory file)))) | 926 | (file-name-directory file)))) |
| 912 | (file-name-as-directory (expand-file-name tumme-dir))) | 927 | (file-name-as-directory (expand-file-name (tumme-dir)))) |
| 913 | ((eq 'per-directory tumme-thumbnail-storage) | 928 | ((eq 'per-directory tumme-thumbnail-storage) |
| 914 | (format "%s.tumme/" | 929 | (format "%s.tumme/" |
| 915 | (file-name-directory f)))) | 930 | (file-name-directory f)))) |
| @@ -2710,7 +2725,7 @@ when using per-directory thumbnail file storage")) | |||
| 2710 | ;; (let ((fattribs (file-attributes f))) | 2725 | ;; (let ((fattribs (file-attributes f))) |
| 2711 | ;; ;; Get last access time and file size | 2726 | ;; ;; Get last access time and file size |
| 2712 | ;; `(,(nth 4 fattribs) ,(nth 7 fattribs) ,f))) | 2727 | ;; `(,(nth 4 fattribs) ,(nth 7 fattribs) ,f))) |
| 2713 | ;; (directory-files tumme-dir t ".+\.thumb\..+$")) | 2728 | ;; (directory-files (tumme-dir) t ".+\.thumb\..+$")) |
| 2714 | ;; ;; Sort function. Compare time between two files. | 2729 | ;; ;; Sort function. Compare time between two files. |
| 2715 | ;; '(lambda (l1 l2) | 2730 | ;; '(lambda (l1 l2) |
| 2716 | ;; (time-less-p (car l1) (car l2))))) | 2731 | ;; (time-less-p (car l1) (car l2))))) |