Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
9824ded5
Commit
9824ded5
authored
Dec 11, 2007
by
Glenn Morris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(url-history-save-history): Use url-make-private-file and with-temp-buffer.
parent
4e44324a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
20 deletions
+27
-20
lisp/url/ChangeLog
lisp/url/ChangeLog
+9
-0
lisp/url/url-history.el
lisp/url/url-history.el
+18
-20
No files found.
lisp/url/ChangeLog
View file @
9824ded5
2007-12-11 Glenn Morris <rgm@gnu.org>
* url.el (url-configuration-directory): Make it a defcustom.
* url-util.el (url-make-private-file): New function.
* url-cookie.el (url-cookie-write-file):
* url-history.el (url-history-save-history):
Use url-make-private-file and with-temp-buffer.
2007-12-06 Glenn Morris <rgm@gnu.org>
2007-12-06 Glenn Morris <rgm@gnu.org>
* url-file.el, url-mailto.el: Remove directory part from filenames
* url-file.el, url-mailto.el: Remove directory part from filenames
...
...
lisp/url/url-history.el
View file @
9824ded5
...
@@ -112,28 +112,27 @@ to run the `url-history-setup-save-timer' function manually."
...
@@ -112,28 +112,27 @@ to run the `url-history-setup-save-timer' function manually."
(
puthash
(
if
(
vectorp
url
)
(
url-recreate-url
url
)
url
)
time
(
puthash
(
if
(
vectorp
url
)
(
url-recreate-url
url
)
url
)
time
url-history-hash-table
))
url-history-hash-table
))
(
autoload
'url-make-private-file
"url-util"
)
(
defun
url-history-save-history
(
&optional
fname
)
(
defun
url-history-save-history
(
&optional
fname
)
"Write the global history file into `url-history-file'.
"Write the global history file into `url-history-file'.
The type of data written is determined by what is in the file to begin
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
with. If the type of storage cannot be determined, then prompt the
user for what type to save as."
user for what type to save as."
(
interactive
)
(
interactive
)
(
when
url-history-changed-since-last-save
(
or
fname
(
setq
fname
(
expand-file-name
url-history-file
)))
(
or
fname
(
setq
fname
(
expand-file-name
url-history-file
)))
(
unless
(
file-directory-p
(
file-name-directory
fname
))
(
if
(
condition-case
nil
(
condition-case
nil
(
progn
(
make-directory
(
file-name-directory
fname
))
(
url-make-private-file
fname
)
(
error
nil
)))
nil
)
(
cond
(
error
t
))
((
not
url-history-changed-since-last-save
)
nil
)
(
message
"Error accessing history file `%s'"
fname
)
((
not
(
file-writable-p
fname
))
(
message
"%s is unwritable."
fname
))
(
t
(
let
((
make-backup-files
nil
)
(
let
((
make-backup-files
nil
)
(
version-control
nil
)
(
version-control
nil
)
(
require-final-newline
t
))
(
require-final-newline
t
)
(
with-current-buffer
(
get-buffer-create
" *url-tmp*"
)
(
count
0
))
(
erase-buffer
)
(
with-temp-buffer
(
let
((
count
0
))
(
maphash
(
lambda
(
key
value
)
(
maphash
(
lambda
(
key
value
)
(
while
(
string-match
"[\r\n]+"
key
)
(
while
(
string-match
"[\r\n]+"
key
)
(
setq
key
(
concat
(
substring
key
0
(
match-beginning
0
))
(
setq
key
(
concat
(
substring
key
0
(
match-beginning
0
))
...
@@ -153,9 +152,8 @@ user for what type to save as."
...
@@ -153,9 +152,8 @@ user for what type to save as."
;; (/ count 4)))
;; (/ count 4)))
;; (goto-char (point-max))
;; (goto-char (point-max))
(
insert
"\n"
)
(
insert
"\n"
)
(
write-file
fname
))
(
write-file
fname
)))
(
kill-buffer
(
current-buffer
))))))
(
setq
url-history-changed-since-last-save
nil
))))
(
setq
url-history-changed-since-last-save
nil
))
(
defun
url-have-visited-url
(
url
)
(
defun
url-have-visited-url
(
url
)
(
url-do-setup
)
(
url-do-setup
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment