From: <jari.aalto@poboxes.com>
Subject: Re: agent off-line and URLs
Date: 12 Feb 1998 17:55:50 +0200 [thread overview]
Message-ID: <tbhg64hl6h.fsf@pegasus.tele.nokia.fi> (raw)
In-Reply-To: Dave Love's message of "11 Feb 1998 22:27:18 +0000"
[-- Attachment #1: Type: text/plain, Size: 1123 bytes --]
| 98-02-11 Dave Love <d.love@dl.ac.uk> list.ding
|
| Is there a good suggestion for a _simple_ way to use the
| results online afterwards? For instance, just invoking browse-url N
| times in succession (asynchronously) and emptying the file isn't
| right, I think. [I don't know anything about existing implementations
| of that sort of thing.]
This offline URL cacheing idea facinated me, so I added support to
the latest release of my tinyurl.el minor mode. If anybody is
interested here is how the story goes:
Either:
- Turn on tiurl-mode for Gnus buffers and the offline/online detections
is automatic. When gnus is unplugged, the urls are stored to *URL-cache*
buffer. Go there and push the urls when you're online again.
OR
- Replace Gnus and TM browser with this snippet and have tinyurl.el package
somewhere along load-path.
Complete docs for package can be found here. (The new feature is not yet
documented in html page, nor it is implemented in the version located in
the ftp site, please wait for the news tiny tools release)
ftp://cs.uta.fi/pub/ssjaaa/ema-tiny.html#417
Cheers!
jari
[-- Attachment #2: Type: text/plain, Size: 1088 bytes --]
(autoload 'tiurl-mode "tinyurl" t t)
;;; ----------------------------------------------------------------------
;;;
(defun my-gnus-browse-and-cache (URL)
"Browse the URL if online, else use TinyUrl"
(interactive)
(setq URL (gnus-strip-whitespace URL))
(if (string= (second gnus-agent-mode-status) " Plugged")
(funcall browse-url-browser-function URL)
(when (fboundp 'tiurl-mode) ;Let this handle offline URL (cache)
(require 'tinyurl)
(tiurl-cache-url URL)
)))
;;; ----------------------------------------------------------------------
;;;
(defun my-gnus-art-load-hook ()
"Override article settings."
;; Replace functions.
(defalias 'gnus-button-url 'my-gnus-browse-and-cache)
(defalias 'gnus-button-embedded-url 'my-gnus-browse-and-cache)
;; TM occupies Gnus buffers too, redirect the "push" button.
(if (featurep 'tm-setup)
(defalias 'tm:browse-url 'my-gnus-browse-and-cache))
)
(add-hook 'gnus-art-load-hook 'my-gnus-art-load-hook)
(if (featurep 'gnus-art) (my-gnus-art-load-hook)) ;Reload now
[-- Attachment #3: Type: text/plain, Size: 1965 bytes --]
Tinyurl.el -- Marks all urls on current line in any buffer.
Overview of features
o When this global minor mode is on, wait few seconds and the
current line will scanned for url buttons. Because not all
terminals show clolor, there is additional "!" character added to
the front of URL for calling you to *push* it.
o Once the minor mode is turned on, it occupies every buffer,
but there is also function to turn the mode on or off per buffer
basis, see `tiurl-mode-1'.
o Defines binding `mouse-2' and *ESC* *RET* to view the url at
point. These bindings are electric: If there is no button to push,
call original binding according to underlying mode.
o You can change the set of url handler on the fly: eg.
call lynx for a while, then switch to Netscape or use your custom
browser.
o Requirements: In XEmacs, you must have overlay.el package available.
[to be added to docs...]
Cacheing URLs for later use (offline reading)
If you're not connected to the Net, then it doesn't make sense
to call browser directly, but instead cache the pushed urls
to separate buffer. When you're online again, you can go to the
cache buffer and relaunch pointers.
The offline reading is usual in Gnus, where you can toggle between
"plugged" and "unplugged" Gnus. The default unpluggged condition
detector is `tiurl-unplugged-p'. It returns nil if you're running
Gnus and it's in unplugged state.
You can place your own unlpugged state detector to variable
`tiurl-:unplugged-function'. Cache buffer used is
`tiurl-:url-cache-buffer', which is *URL-cache* by default.
Support for programming language URLs
[C/C++] ...snip
[Perl] ...snip
[lisp] ...snip
[Other languages]
prev parent reply other threads:[~1998-02-12 15:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-02-02 18:10 Wes Hardaker
1998-02-08 15:54 ` Lars Magne Ingebrigtsen
1998-02-09 16:09 ` Wes Hardaker
1998-02-11 22:27 ` Dave Love
1998-02-11 22:41 ` Hrvoje Niksic
1998-02-12 0:44 ` Frank D. Cringle
1998-02-12 15:55 ` jari.aalto [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tbhg64hl6h.fsf@pegasus.tele.nokia.fi \
--to=jari.aalto@poboxes.com \
--cc=jari.aalto@ntc.nokia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).