aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2016-02-04 16:05:05 +1100
committerLars Ingebrigtsen2016-02-04 16:05:05 +1100
commitd90ab1e2215cd7afbc1957a4928b3a35931cd425 (patch)
treeaabc0da64becc03ecfb5b18e71be4a80882b8c63
parent7f818250739d9b7404dbe79326e1bf89fce0fd13 (diff)
downloademacs-d90ab1e2215cd7afbc1957a4928b3a35931cd425.tar.gz
emacs-d90ab1e2215cd7afbc1957a4928b3a35931cd425.zip
Fix typo in eww-make-unique-file-name
* lisp/net/eww.el (eww-make-unique-file-name): Make this function actually work.
-rw-r--r--lisp/net/eww.el30
1 files changed, 15 insertions, 15 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 7cb324e2399..6872be4edaa 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1469,21 +1469,21 @@ Differences in #targets are ignored."
1469 string))) 1469 string)))
1470 1470
1471(defun eww-make-unique-file-name (file directory) 1471(defun eww-make-unique-file-name (file directory)
1472 (cond 1472 (cond
1473 ((zerop (length file)) 1473 ((zerop (length file))
1474 (setq file "!")) 1474 (setq file "!"))
1475 ((string-match "\\`[.]" file) 1475 ((string-match "\\`[.]" file)
1476 (setq file (concat "!" file)))) 1476 (setq file (concat "!" file))))
1477 (let ((count 1) 1477 (let ((count 1)
1478 (stem file) 1478 (stem file)
1479 (suffix "")) 1479 (suffix ""))
1480 (when (string-match "\\`\\(.*\\)\\([.][^.]+\\)" file) 1480 (when (string-match "\\`\\(.*\\)\\([.][^.]+\\)" file)
1481 (setq stem (match-string 1) 1481 (setq stem (match-string 1 file)
1482 suffix (match-string 2))) 1482 suffix (match-string 2)))
1483 (while (file-exists-p (expand-file-name file directory)) 1483 (while (file-exists-p (expand-file-name file directory))
1484 (setq file (format "%s(%d)%s" stem count suffix)) 1484 (setq file (format "%s(%d)%s" stem count suffix))
1485 (setq count (1+ count))) 1485 (setq count (1+ count)))
1486 (expand-file-name file directory))) 1486 (expand-file-name file directory)))
1487 1487
1488(defun eww-set-character-encoding (charset) 1488(defun eww-set-character-encoding (charset)
1489 "Set character encoding to CHARSET. 1489 "Set character encoding to CHARSET.