[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/url/url-history.el, v [EMACS_22_BASE
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/url/url-history.el, v [EMACS_22_BASE] |
Date: |
Tue, 11 Dec 2007 05:50:12 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Branch: EMACS_22_BASE
Changes by: Glenn Morris <gm> 07/12/11 05:50:11
Index: url-history.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/url/url-history.el,v
retrieving revision 1.17.2.1
retrieving revision 1.17.2.2
diff -u -b -r1.17.2.1 -r1.17.2.2
--- url-history.el 25 Jul 2007 04:18:21 -0000 1.17.2.1
+++ url-history.el 11 Dec 2007 05:50:11 -0000 1.17.2.2
@@ -112,26 +112,27 @@
(puthash (if (vectorp url) (url-recreate-url url) url) time
url-history-hash-table))
+(autoload 'url-make-private-file "url-util")
+
(defun url-history-save-history (&optional fname)
"Write the global history file into `url-history-file'.
The type of data written is determined by what is in the file to begin
with. If the type of storage cannot be determined, then prompt the
user for what type to save as."
(interactive)
+ (when url-history-changed-since-last-save
(or fname (setq fname (expand-file-name url-history-file)))
- (unless (file-directory-p (file-name-directory fname))
- (ignore-errors (make-directory (file-name-directory fname))))
- (cond
- ((not url-history-changed-since-last-save) nil)
- ((not (file-writable-p fname))
- (message "%s is unwritable." fname))
- (t
+ (if (condition-case nil
+ (progn
+ (url-make-private-file fname)
+ nil)
+ (error t))
+ (message "Error accessing history file `%s'" fname)
(let ((make-backup-files nil)
(version-control nil)
- (require-final-newline t))
- (with-current-buffer (get-buffer-create " *url-tmp*")
- (erase-buffer)
- (let ((count 0))
+ (require-final-newline t)
+ (count 0))
+ (with-temp-buffer
(maphash (lambda (key value)
(while (string-match "[\r\n]+" key)
(setq key (concat (substring key 0 (match-beginning 0))
@@ -151,9 +152,8 @@
;; (/ count 4)))
;; (goto-char (point-max))
(insert "\n")
- (write-file fname))
- (kill-buffer (current-buffer))))))
- (setq url-history-changed-since-last-save nil))
+ (write-file fname)))
+ (setq url-history-changed-since-last-save nil))))
(defun url-have-visited-url (url)
(url-do-setup)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/url/url-history.el, v [EMACS_22_BASE],
Glenn Morris <=