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
Open sidebar
emacs
emacs
Commits
cdf1fca4
Commit
cdf1fca4
authored
Oct 20, 2010
by
Lars Magne Ingebrigtsen
Committed by
Katsumi Yamaoka
Oct 20, 2010
Browse files
shr.el (shr-save-contents): New command and keystroke.
parent
b643306f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
lisp/gnus/ChangeLog
lisp/gnus/ChangeLog
+1
-0
lisp/gnus/shr.el
lisp/gnus/shr.el
+18
-0
No files found.
lisp/gnus/ChangeLog
View file @
cdf1fca4
...
...
@@ -2,6 +2,7 @@
* shr.el (shr-find-fill-point): Don't leave blanks at the start of some
lines.
(shr-save-contents): New command and keystroke.
* nndoc.el (nndoc-type-alist): Add git support.
(nndoc-git-type-p): New function.
...
...
lisp/gnus/shr.el
View file @
cdf1fca4
...
...
@@ -98,6 +98,7 @@ cid: URL as the argument.")
(
define-key
map
"I"
'shr-insert-image
)
(
define-key
map
"u"
'shr-copy-url
)
(
define-key
map
"v"
'shr-browse-url
)
(
define-key
map
"o"
'shr-save-contents
)
(
define-key
map
"\r"
'shr-browse-url
)
map
))
...
...
@@ -323,6 +324,23 @@ redirects somewhere else."
(
message
"No link under point"
)
(
browse-url
url
))))
(
defun
shr-save-contents
(
directory
)
"Save the contents from URL in a file."
(
interactive
"DSave contents of URL to directory: "
)
(
let
((
url
(
get-text-property
(
point
)
'shr-url
)))
(
if
(
not
url
)
(
message
"No link under point"
)
(
url-retrieve
(
shr-encode-url
url
)
'shr-store-contents
(
list
url
directory
)))))
(
defun
shr-store-contents
(
status
url
directory
)
(
unless
(
plist-get
status
:error
)
(
when
(
or
(
search-forward
"\n\n"
nil
t
)
(
search-forward
"\r\n\r\n"
nil
t
))
(
write-region
(
point
)
(
point-max
)
(
expand-file-name
(
file-name-nondirectory
url
)
directory
)))))
(
defun
shr-image-fetched
(
status
buffer
start
end
)
(
when
(
and
(
buffer-name
buffer
)
(
not
(
plist-get
status
:error
)))
...
...
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