[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 a7143fa 04/12: Make prettier unique file names in
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] emacs-25 a7143fa 04/12: Make prettier unique file names in eww |
Date: |
Fri, 25 Dec 2015 16:06:00 +0000 |
branch: emacs-25
commit a7143faf482d9b30c120ff969b1a75f1de7f8017
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Make prettier unique file names in eww
(eww-make-unique-file-name): Make unique file names by making
files like foo(2).jpg instead of foo(1)(2).jpg.
Backport:
(cherry picked from commit edfdd0a6cbdfa9e5e4bd0553e2b489401ca39266)
---
lisp/net/eww.el | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 90ddd05..a22664b 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1438,13 +1438,14 @@ Differences in #targets are ignored."
(setq file "!"))
((string-match "\\`[.]" file)
(setq file (concat "!" file))))
- (let ((count 1))
+ (let ((count 1)
+ (stem file)
+ (suffix ""))
+ (when (string-match "\\`\\(.*\\)\\([.][^.]+\\)" file)
+ (setq stem (match-string 1)
+ suffix (match-string 2)))
(while (file-exists-p (expand-file-name file directory))
- (setq file
- (if (string-match "\\`\\(.*\\)\\([.][^.]+\\)" file)
- (format "%s(%d)%s" (match-string 1 file)
- count (match-string 2 file))
- (format "%s(%d)" file count)))
+ (setq file (format "%s(%d)%s" stem count suffix))
(setq count (1+ count)))
(expand-file-name file directory)))
- [Emacs-diffs] emacs-25 updated (cc3de97 -> e59b2ee), Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 5bd3a0c 02/12: Add FreeBSD cert bundle, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 6ef896c 01/12: Ignore invalid SVG images, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 90f82ff 03/12: Decode hex-encoded URLs before using them as file names, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 ec2a509 06/12: Use cl-reduce, not reduce., Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 96ac314 05/12: Allow several <tbody> tags in shr, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 eeff251 08/12: Don't store cookies with empty names, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 5b2401d 07/12: Stop rendering HTML before specdlr exhaustion, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 6c12691 11/12: Always save eww history, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 a7143fa 04/12: Make prettier unique file names in eww,
Lars Ingebrigtsen <=
- [Emacs-diffs] emacs-25 2d33a9c 09/12: Make toggling checkboxes work again, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 1a99bd6 10/12: Default web pages to right-to-left, Lars Ingebrigtsen, 2015/12/25
- [Emacs-diffs] emacs-25 e59b2ee 12/12: More eww file name coding fixes, Lars Ingebrigtsen, 2015/12/25