diff options
| author | Glenn Morris | 2016-06-07 21:29:30 -0400 |
|---|---|---|
| committer | Glenn Morris | 2016-06-07 21:29:30 -0400 |
| commit | 95443fc07f2a0ac22d4852fd68f94b46d5b78909 (patch) | |
| tree | f76894eba2bdb76cbc25ca43609226c48d0a2bfd | |
| parent | 3a28d64e275ca6860f81016b04a2024d9c66da1f (diff) | |
| download | emacs-95443fc07f2a0ac22d4852fd68f94b46d5b78909.tar.gz emacs-95443fc07f2a0ac22d4852fd68f94b46d5b78909.zip | |
Misc small webjump updates.
* lisp/net/webjump.el (webjump): Add custom group.
(webjump-sample-sites): Make it a constant.
Remove explicit, old list of GNU ftp mirrors.
(webjump-state-to-postal-alist): Make it a constant.
(webjump-sites): Make it a defcustom.
(webjump-to-iwin): Update for changed remote service.
| -rw-r--r-- | lisp/net/webjump.el | 209 |
1 files changed, 49 insertions, 160 deletions
diff --git a/lisp/net/webjump.el b/lisp/net/webjump.el index 41b7a7bb9cd..46f17afed47 100644 --- a/lisp/net/webjump.el +++ b/lisp/net/webjump.el | |||
| @@ -67,142 +67,18 @@ | |||
| 67 | 67 | ||
| 68 | ;;------------------------------------------------------------------- Constants | 68 | ;;------------------------------------------------------------------- Constants |
| 69 | 69 | ||
| 70 | (defvar webjump-sample-sites | 70 | (defgroup webjump nil |
| 71 | "Programmable Web hotlist." | ||
| 72 | :prefix "webjump-" | ||
| 73 | :group 'browse-url) | ||
| 74 | |||
| 75 | (defconst webjump-sample-sites | ||
| 71 | '( | 76 | '( |
| 72 | ;; FSF, not including Emacs-specific. | 77 | ;; FSF, not including Emacs-specific. |
| 73 | ("GNU Project FTP Archive" . | 78 | ("GNU Project FTP Archive" . |
| 74 | ;; GNU FTP Mirror List from http://www.gnu.org/order/ftp.html | 79 | ;; GNU FTP Mirror List from http://www.gnu.org/order/ftp.html |
| 75 | [mirrors "ftp://ftp.gnu.org/pub/gnu/" | 80 | [mirrors "ftp://ftp.gnu.org/pub/gnu/" |
| 76 | ;; United States | 81 | "http://ftpmirror.gnu.org"]) |
| 77 | "ftp://mirrors.kernel.org/gnu" | ||
| 78 | "ftp://gatekeeper.dec.com/pub/GNU/" | ||
| 79 | "ftp://ftp.keystealth.org/pub/gnu/" | ||
| 80 | "ftp://mirrors.usc.edu/pub/gnu/" | ||
| 81 | "ftp://cudlug.cudenver.edu/pub/mirrors/ftp.gnu.org/" | ||
| 82 | "ftp://ftp.cise.ufl.edu/pub/mirrors/GNU/" | ||
| 83 | "ftp://uiarchive.cso.uiuc.edu/pub/ftp/ftp.gnu.org/gnu/" | ||
| 84 | "ftp://gnu.cs.lewisu.edu/gnu/" | ||
| 85 | "ftp://ftp.in-span.net/pub/mirrors/ftp.gnu.org/" | ||
| 86 | "ftp://gnu.ms.uky.edu/pub/mirrors/gnu/" | ||
| 87 | "ftp://ftp.algx.net/pub/gnu/" | ||
| 88 | "ftp://aeneas.mit.edu/pub/gnu/" | ||
| 89 | "ftp://ftp.egr.msu.edu/pub/gnu/" | ||
| 90 | "ftp://ftp.wayne.edu/pub/gnu/" | ||
| 91 | "ftp://wuarchive.wustl.edu/mirrors/gnu/" | ||
| 92 | "ftp://gnu.teleglobe.net/ftp.gnu.org/" | ||
| 93 | "ftp://ftp.cs.columbia.edu/archives/gnu/prep/" | ||
| 94 | "ftp://ftp.ece.cornell.edu/pub/mirrors/gnu/" | ||
| 95 | "ftp://ftp.ibiblio.org/pub/mirrors/gnu/" | ||
| 96 | "ftp://ftp.cis.ohio-state.edu/mirror/gnu/" | ||
| 97 | "ftp://ftp.club.cc.cmu.edu/gnu/" | ||
| 98 | "ftp://ftp.sunsite.utk.edu/pub/gnu/ftp/" | ||
| 99 | "ftp://thales.memphis.edu/pub/gnu/" | ||
| 100 | "ftp://gnu.wwc.edu" | ||
| 101 | "ftp://ftp.twtelecom.net/pub/GNU/" | ||
| 102 | ;; Africa | ||
| 103 | "ftp://ftp.sun.ac.za/mirrorsites/ftp.gnu.org" | ||
| 104 | ;; The Americas | ||
| 105 | "ftp://ftp.unicamp.br/pub/gnu/" | ||
| 106 | "ftp://master.softaplic.com.br/pub/gnu/" | ||
| 107 | "ftp://ftp.matrix.com.br/pub/gnu/" | ||
| 108 | "ftp://ftp.pucpr.br/gnu" | ||
| 109 | "ftp://ftp.linorg.usp.br/gnu" | ||
| 110 | "ftp://ftp.cs.ubc.ca/mirror2/gnu/" | ||
| 111 | "ftp://cs.ubishops.ca/pub/ftp.gnu.org/" | ||
| 112 | "ftp://ftp.inf.utfsm.cl/pub/gnu/" | ||
| 113 | "ftp://sunsite.ulatina.ac.cr/Mirrors/GNU/" | ||
| 114 | "ftp://www.gnu.unam.mx/pub/gnu/software/" | ||
| 115 | "ftp://gnu.cem.itesm.mx/pub/mirrors/gnu.org/" | ||
| 116 | "ftp://ftp.azc.uam.mx/mirrors/gnu/" | ||
| 117 | ;; Australia | ||
| 118 | "ftp://mirror.aarnet.edu.au/pub/gnu/" | ||
| 119 | "ftp://gnu.mirror.pacific.net.au/gnu/" | ||
| 120 | ;; Asia | ||
| 121 | "ftp://ftp.cs.cuhk.edu.hk/pub/gnu/gnu/" | ||
| 122 | "ftp://sunsite.ust.hk/pub/gnu/" | ||
| 123 | "ftp://ftp.gnupilgrims.org/pub/gnu" | ||
| 124 | "ftp://www.imtech.res.in/mirror/gnuftp/" | ||
| 125 | "ftp://kambing.vlsm.org/gnu" | ||
| 126 | "ftp://ftp.cs.huji.ac.il/mirror/GNU/" | ||
| 127 | "ftp://tron.um.u-tokyo.ac.jp/pub/GNU/" | ||
| 128 | "ftp://core.ring.gr.jp/pub/GNU/" | ||
| 129 | "ftp://ftp.ring.gr.jp/pub/GNU/" | ||
| 130 | "ftp://mirrors.hbi.co.jp/gnu/" | ||
| 131 | "ftp://ftp.cs.titech.ac.jp/pub/gnu/" | ||
| 132 | "ftp://ftpmirror.hanyang.ac.kr/GNU/" | ||
| 133 | "ftp://ftp.linux.sarang.net/mirror/gnu/gnu/" | ||
| 134 | "ftp://ftp.xgate.co.kr/pub/mirror/gnu/" | ||
| 135 | "ftp://ftp://gnu.xinicks.com/" | ||
| 136 | "ftp://ftp.isu.net.sa/pub/gnu/" | ||
| 137 | "ftp://ftp.nctu.edu.tw/UNIX/gnu/" | ||
| 138 | "ftp://coda.nctu.edu.tw/UNIX/gnu/" | ||
| 139 | "ftp://ftp1.sinica.edu.tw/pub3/GNU/gnu/" | ||
| 140 | "ftp://gnu.cdpa.nsysu.edu.tw/gnu" | ||
| 141 | "ftp://ftp.nectec.or.th/pub/mirrors/gnu/" | ||
| 142 | ;; Europe | ||
| 143 | "ftp://ftp.gnu.vbs.at/" | ||
| 144 | "ftp://ftp.univie.ac.at/packages/gnu/" | ||
| 145 | "ftp://gd.tuwien.ac.at/gnu/gnusrc/" | ||
| 146 | "ftp://ftp.belnet.be/mirror/ftp.gnu.org/" | ||
| 147 | "ftp://gnu.blic.net/pub/gnu/" | ||
| 148 | "ftp://ftp.fi.muni.cz/pub/gnu/" | ||
| 149 | "ftp://ftp.dkuug.dk/pub/gnu/" | ||
| 150 | "ftp://sunsite.dk/mirrors/gnu" | ||
| 151 | "ftp://ftp.funet.fi/pub/gnu/prep/" | ||
| 152 | "ftp://ftp.irisa.fr/pub/gnu/" | ||
| 153 | "ftp://ftp.cs.univ-paris8.fr/mirrors/ftp.gnu.org/" | ||
| 154 | "ftp://ftp.cs.tu-berlin.de/pub/gnu/" | ||
| 155 | "ftp://ftp.leo.org/pub/comp/os/unix/gnu/" | ||
| 156 | "ftp://ftp.informatik.rwth-aachen.de/pub/gnu/" | ||
| 157 | "ftp://ftp.de.uu.net/pub/gnu/" | ||
| 158 | "ftp://ftp.freenet.de/pub/ftp.gnu.org/gnu/" | ||
| 159 | "ftp://ftp.cs.uni-bonn.de/pub/gnu/" | ||
| 160 | "ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/ftp.gnu.org/" | ||
| 161 | "ftp://ftp.stw-bonn.de/pub/mirror/ftp.gnu.org/" | ||
| 162 | "ftp://ftp.math.uni-bremen.de/pub/gnu" | ||
| 163 | "ftp://ftp.forthnet.gr/pub/gnu/" | ||
| 164 | "ftp://ftp.ntua.gr/pub/gnu/" | ||
| 165 | "ftp://ftp.duth.gr/pub/gnu/" | ||
| 166 | "ftp://ftp.physics.auth.gr/pub/gnu/" | ||
| 167 | "ftp://ftp.esat.net/pub/gnu/" | ||
| 168 | "ftp://ftp.heanet.ie/mirrors/ftp.gnu.org" | ||
| 169 | "ftp://ftp.lugroma2.org/pub/gnu/" | ||
| 170 | "ftp://ftp.gnu.inetcosmos.org/pub/gnu/" | ||
| 171 | "ftp://ftp.digitaltrust.it/pub/gnu" | ||
| 172 | "ftp://ftp://rm.mirror.garr.it/mirrors/gnuftp" | ||
| 173 | "ftp://ftp.nluug.nl/pub/gnu/" | ||
| 174 | "ftp://ftp.mirror.nl/pub/mirror/gnu/" | ||
| 175 | "ftp://ftp.nl.uu.net/pub/gnu/" | ||
| 176 | "ftp://mirror.widexs.nl/pub/gnu/" | ||
| 177 | "ftp://ftp.easynet.nl/mirror/GNU/" | ||
| 178 | "ftp://ftp.win.tue.nl/pub/gnu" | ||
| 179 | "ftp://gnu.mirror.vuurwerk.net/pub/GNU/" | ||
| 180 | "ftp://gnu.kookel.org/pub/ftp.gnu.org/" | ||
| 181 | "ftp://ftp.uninett.no/pub/gnu/" | ||
| 182 | "ftp://ftp.task.gda.pl/pub/gnu/" | ||
| 183 | "ftp://sunsite.icm.edu.pl/pub/gnu/" | ||
| 184 | "ftp://ftp.man.poznan.pl/pub/gnu" | ||
| 185 | "ftp://ftp.ist.utl.pt/pub/GNU/gnu/" | ||
| 186 | "ftp://ftp.telepac.pt/pub/gnu/" | ||
| 187 | "ftp://ftp.timisoara.roedu.net/mirrors/ftp.gnu.org/pub/gnu" | ||
| 188 | "ftp://ftp.chg.ru/pub/gnu/" | ||
| 189 | "ftp://gnuftp.axitel.ru/" | ||
| 190 | "ftp://ftp.arnes.si/software/gnu/" | ||
| 191 | "ftp://ftp.etsimo.uniovi.es/pub/gnu/" | ||
| 192 | "ftp://ftp.rediris.es/pub/gnu/" | ||
| 193 | "ftp://ftp.chl.chalmers.se/pub/gnu/" | ||
| 194 | "ftp://ftp.isy.liu.se/pub/gnu/" | ||
| 195 | "ftp://ftp.luth.se/pub/unix/gnu/" | ||
| 196 | "ftp://ftp.stacken.kth.se/pub/gnu/" | ||
| 197 | "ftp://ftp.sunet.se/pub/gnu/" | ||
| 198 | "ftp://sunsite.cnlab-switch.ch/mirror/gnu/" | ||
| 199 | "ftp://ftp.ulak.net.tr/gnu/" | ||
| 200 | "ftp://ftp.gnu.org.ua" | ||
| 201 | "ftp://ftp.mcc.ac.uk/pub/gnu/" | ||
| 202 | "ftp://ftp.mirror.ac.uk/sites/ftp.gnu.org/gnu/" | ||
| 203 | "ftp://ftp.warwick.ac.uk/pub/gnu/" | ||
| 204 | "ftp://ftp.hands.com/ftp.gnu.org/" | ||
| 205 | "ftp://gnu.teleglobe.net/ftp.gnu.org/"]) | ||
| 206 | ("GNU Project Home Page" . "www.gnu.org") | 82 | ("GNU Project Home Page" . "www.gnu.org") |
| 207 | 83 | ||
| 208 | ;; Emacs. | 84 | ;; Emacs. |
| @@ -233,7 +109,7 @@ | |||
| 233 | [simple-query "wikipedia.org" "wikipedia.org/wiki/" ""]) | 109 | [simple-query "wikipedia.org" "wikipedia.org/wiki/" ""]) |
| 234 | 110 | ||
| 235 | ;; Misc. general interest. | 111 | ;; Misc. general interest. |
| 236 | ("Interactive Weather Information Network" . webjump-to-iwin) | 112 | ("National Weather Service" . webjump-to-iwin) |
| 237 | ("Usenet FAQs" . | 113 | ("Usenet FAQs" . |
| 238 | "www.faqs.org/faqs/") | 114 | "www.faqs.org/faqs/") |
| 239 | ("RTFM Usenet FAQs by Group" . | 115 | ("RTFM Usenet FAQs by Group" . |
| @@ -254,10 +130,10 @@ | |||
| 254 | "www.neilvandyke.org/webjump/") | 130 | "www.neilvandyke.org/webjump/") |
| 255 | 131 | ||
| 256 | ) | 132 | ) |
| 257 | "Sample hotlist for WebJump. See the documentation for the `webjump' | 133 | "Sample hotlist for WebJump. |
| 258 | function and the `webjump-sites' variable.") | 134 | See the documentation for `webjump' and `webjump-sites'.") |
| 259 | 135 | ||
| 260 | (defvar webjump-state-to-postal-alist | 136 | (defconst webjump-state-to-postal-alist |
| 261 | '(("Alabama" . "al") ("Alaska" . "ak") ("Arizona" . "az") ("Arkansas" . "ar") | 137 | '(("Alabama" . "al") ("Alaska" . "ak") ("Arizona" . "az") ("Arkansas" . "ar") |
| 262 | ("California" . "ca") ("Colorado" . "co") ("Connecticut" . "ct") | 138 | ("California" . "ca") ("Colorado" . "co") ("Connecticut" . "ct") |
| 263 | ("Delaware" . "de") ("Florida" . "fl") ("Georgia" . "ga") ("Hawaii" . "hi") | 139 | ("Delaware" . "de") ("Florida" . "fl") ("Georgia" . "ga") ("Hawaii" . "hi") |
| @@ -277,8 +153,7 @@ function and the `webjump-sites' variable.") | |||
| 277 | 153 | ||
| 278 | ;;------------------------------------------------------------ Option Variables | 154 | ;;------------------------------------------------------------ Option Variables |
| 279 | 155 | ||
| 280 | (defvar webjump-sites | 156 | (defcustom webjump-sites webjump-sample-sites |
| 281 | webjump-sample-sites | ||
| 282 | "Hotlist for WebJump. | 157 | "Hotlist for WebJump. |
| 283 | 158 | ||
| 284 | The hotlist is represented as an association list, with the CAR of each cell | 159 | The hotlist is represented as an association list, with the CAR of each cell |
| @@ -309,33 +184,47 @@ parameter. This might come in handy for various kludges. | |||
| 309 | 184 | ||
| 310 | For convenience, if the `http://', `ftp://', or `file://' prefix is missing | 185 | For convenience, if the `http://', `ftp://', or `file://' prefix is missing |
| 311 | from a URL, WebJump will make a guess at what you wanted and prepend it before | 186 | from a URL, WebJump will make a guess at what you wanted and prepend it before |
| 312 | submitting the URL.") | 187 | submitting the URL." |
| 188 | :type '(alist :key-type (string :tag "Name") | ||
| 189 | :value-type (choice :tag "URL" | ||
| 190 | (string :tag "URL") | ||
| 191 | function | ||
| 192 | (vector :tag "Builtin" | ||
| 193 | (symbol :tag "Name") | ||
| 194 | (repeat :inline t :tag "Arguments" | ||
| 195 | string)) | ||
| 196 | (sexp :tag "Expression to eval")))) | ||
| 313 | 197 | ||
| 314 | ;;------------------------------------------------------- Sample Site Functions | 198 | ;;------------------------------------------------------- Sample Site Functions |
| 315 | 199 | ||
| 316 | (defun webjump-to-iwin (name) | 200 | (defun webjump-to-iwin (name) |
| 317 | (let ((prefix "http://iwin.nws.noaa.gov/") | 201 | (let* ((prefix "http://www.nws.noaa.gov/view/") |
| 318 | (state (webjump-read-choice name "state" | 202 | (state (webjump-read-choice name "state" |
| 319 | (append '(("Puerto Rico" . "pr")) | 203 | (append '(("Puerto Rico" . "pr") |
| 320 | webjump-state-to-postal-alist)))) | 204 | ("Guam" . "gu") |
| 321 | (if state | 205 | ("American Samoa" . "as") |
| 322 | (concat prefix "iwin/" state "/" | 206 | ("District of Columbia" . "dc") |
| 323 | (webjump-read-choice name "option" | 207 | ("US Virgin Islands" . "vi")) |
| 324 | '(("Hourly Report" . "hourly") | 208 | webjump-state-to-postal-alist))) |
| 325 | ("State Forecast" . "state") | 209 | (opt (if state |
| 326 | ("Local Forecast" . "local") | 210 | (webjump-read-choice |
| 327 | ("Zone Forecast" . "zone") | 211 | name "option" |
| 328 | ("Short-Term Forecast" . "shortterm") | 212 | '(("Hourly Report" . "hourly") |
| 329 | ("Weather Summary" . "summary") | 213 | ("State Forecast" . "state") |
| 330 | ("Public Information" . "public") | 214 | ("Zone Forecast" . "zone") |
| 331 | ("Climatic Data" . "climate") | 215 | ("Short-Term Forecast" . "shortterm") |
| 332 | ("Aviation Products" . "aviation") | 216 | ("Forecast Discussion" . "discussion") |
| 333 | ("Hydro Products" . "hydro") | 217 | ("Weather Summary" . "summary") |
| 334 | ("Special Weather" . "special") | 218 | ("Public Information" . "public") |
| 335 | ("Watches and Warnings" . "warnings")) | 219 | ("Climatic Data" . "climate") |
| 336 | "zone") | 220 | ("Hydro Products" . "hydro") |
| 337 | ".html") | 221 | ("Watches" . "watches") |
| 338 | prefix))) | 222 | ("Special Weather" . "special") |
| 223 | ("Warnings and Advisories" . "warnings") | ||
| 224 | ("Fire Weather" . "firewx")))))) | ||
| 225 | (cond (opt (concat prefix "prodsByState.php?state=" state "&prodtype=" opt)) | ||
| 226 | (state (concat prefix "states.php?state=" state)) | ||
| 227 | (t prefix)))) | ||
| 339 | 228 | ||
| 340 | (defun webjump-to-risks (name) | 229 | (defun webjump-to-risks (name) |
| 341 | (let (issue volume) | 230 | (let (issue volume) |