* Acronym lookups @ 1997-01-08 13:48 Wesley.Hardaker 1997-01-09 11:03 ` Lars Magne Ingebrigtsen 0 siblings, 1 reply; 16+ messages in thread From: Wesley.Hardaker @ 1997-01-08 13:48 UTC (permalink / raw) Cough cough, I uh... got most of the stuff done on my todo list, and therefore decided that I shouldn't be any more productive today... I succeeded... I was trying to keep up with the heavy acronym usage on alt.fan.warlord and wanted to, uh, look them up automagically. So, uh, I wrote probably the most shamefully stupid code of my life. Its enclosed below, in case anyone wants to include it in, say, a gnus release... Wes ;;; acronym.el --- Look up an acronym from a file database or the web. ;; Copyright (C) 1997 Free Software Foundation, Inc. ;; Author: Wes Hardaker <Wesley.Hardaker@sphys.unil.ch> ;; Keywords: fun (require 'url) (defvar acronym-database "~/lib/acronyms.txt" "Text file containing acroynms to serve as a lookup database. The format of this file is simply an acronym on one line followed by a line defining it.") (defvar acronym-sleep-for-time 2 "Length of time to sleep when displaying an acronym in the mini-buffer.") (defvar acronym-web-address "http://www.ucc.ie/cgi-bin/acronym?" "http address to query for acronyms if appended with an acronym.") (defun acronym-lookup (&optional lets) "Look up an acronym from a file database or the web." (interactive "sAcronym: ") (save-excursion (let ((buf (current-buffer)) beg) (cond ;; check local file database first. ((and (file-exists-p acronym-database) (bufferp (set-buffer (find-file-noselect acronym-database t))) (goto-char (point-min)) (search-forward-regexp (concat "^" lets) nil t)) (sit-for 1) (next-line 1) (beginning-of-line) (setq beg (point)) (end-of-line) (message (concat lets ": " (buffer-substring beg (point)))) (sit-for acronym-sleep-for-time)) ;; check web database for acronym. ((progn (set-buffer (setq buf (generate-new-buffer " *acro-tmp*"))) (url-insert-file-contents (concat acronym-web-address lets)) (let* ((results (search-forward-regexp "<dd>" nil t)) (ret (if results (progn (while results (setq beg (point)) (end-of-line) (message (concat lets ": " (buffer-substring beg (- (point) 5)))) (setq results (search-forward-regexp "<dd>" nil t)) (sit-for acronym-sleep-for-time)) t) nil))) (set-buffer-modified-p nil) (kill-buffer buf) ret))) (t (message (format "Acronym %s not found" lets))))))) (provide 'acronym) ;;; acronym.el ends here ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Acronym lookups 1997-01-08 13:48 Acronym lookups Wesley.Hardaker @ 1997-01-09 11:03 ` Lars Magne Ingebrigtsen 1997-01-09 11:29 ` Per Abrahamsen ` (2 more replies) 0 siblings, 3 replies; 16+ messages in thread From: Lars Magne Ingebrigtsen @ 1997-01-09 11:03 UTC (permalink / raw) Wesley.Hardaker@sphys.unil.ch writes: > I was trying to keep up with the heavy acronym usage on > alt.fan.warlord and wanted to, uh, look them up automagically. So, > uh, I wrote probably the most shamefully stupid code of my life. Its > enclosed below, in case anyone wants to include it in, say, a gnus > release... :-) I've included this in Red Gnus 0.80. It might also be nice if the command offered the acronym under point as the default... And perhaps there should be a `buttonize-acronym' command to buttonize acronyms (gee!), so that you could just click on the acronyms to see what they meant. (I don't know how to recognize what is an acronym, though. All three-character-or-more upper-case character words that aren't followed by other upper-case words?) -- (domestic pets only, the antidote for overdose, milk.) larsi@ifi.uio.no * Lars Ingebrigtsen ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Acronym lookups 1997-01-09 11:03 ` Lars Magne Ingebrigtsen @ 1997-01-09 11:29 ` Per Abrahamsen 1997-01-09 16:38 ` Wesley.Hardaker 1997-01-09 12:49 ` Lars Balker Rasmussen 1997-01-09 16:35 ` Wesley.Hardaker 2 siblings, 1 reply; 16+ messages in thread From: Per Abrahamsen @ 1997-01-09 11:29 UTC (permalink / raw) I don't see it has anything to do with news, it should be a separate package like webster.el, and posted to gnu.emacs.sources. It would be nice if it by default selected the word under point, like most other "look up word" functions does. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Acronym lookups 1997-01-09 11:29 ` Per Abrahamsen @ 1997-01-09 16:38 ` Wesley.Hardaker 1997-01-09 17:17 ` David Moore 1997-01-09 19:28 ` William M. Perry 0 siblings, 2 replies; 16+ messages in thread From: Wesley.Hardaker @ 1997-01-09 16:38 UTC (permalink / raw) >>>>> "Per" == Per Abrahamsen <abraham@dina.kvl.dk> writes: Per> I don't see it has anything to do with news, it should be a separate Per> package like webster.el, and posted to gnu.emacs.sources. Well, I'm not sure I totally agree... Granted, it should probably be posted there as well, but... Shouldn't all good news readers (ie, pretty much just gnus) be able to help you decypher the articles you are reading, and hence be able to look up acronyms? I mean, you have rot13 built in to decode articles, what about acronym-lookup... Feeling in sort of a devils advocate kinda mood... sorry... Wes ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Acronym lookups 1997-01-09 16:38 ` Wesley.Hardaker @ 1997-01-09 17:17 ` David Moore 1997-01-09 19:28 ` William M. Perry 1 sibling, 0 replies; 16+ messages in thread From: David Moore @ 1997-01-09 17:17 UTC (permalink / raw) Wesley.Hardaker@sphys.unil.ch writes: > >>>>> "Per" == Per Abrahamsen <abraham@dina.kvl.dk> writes: > > Per> I don't see it has anything to do with news, it should be a separate > Per> package like webster.el, and posted to gnu.emacs.sources. > > Well, I'm not sure I totally agree... Granted, it should probably be > posted there as well, but... Shouldn't all good news readers (ie, > pretty much just gnus) be able to help you decypher the articles you > are reading, and hence be able to look up acronyms? I mean, you have > rot13 built in to decode articles, what about acronym-lookup... I tend to agree with Per here. The functionality seems useful outside of Gnus (such as many reports and C code you have to read/edit that might have acronyms in them). Otherwise shouldn't ispell.el and webster.el be included with Gnus too? All good news readers prevent you from making spelling mistakes. :) -- David Moore <dmoore@ucsd.edu> | Computer Systems Lab __o UCSD Dept. Computer Science - 0114 | Work: (619) 534-8604 _ \<,_ La Jolla, CA 92093-0114 | Fax: (619) 534-1445 (_)/ (_) <URL:http://oj.egbt.org/dmoore/> | ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Acronym lookups 1997-01-09 16:38 ` Wesley.Hardaker 1997-01-09 17:17 ` David Moore @ 1997-01-09 19:28 ` William M. Perry 1997-01-09 20:38 ` Steinar Bang ` (3 more replies) 1 sibling, 4 replies; 16+ messages in thread From: William M. Perry @ 1997-01-09 19:28 UTC (permalink / raw) Cc: ding Wesley Hardaker writes: >>>>>> "Per" == Per Abrahamsen <abraham@dina.kvl.dk> writes: > >Per> I don't see it has anything to do with news, it should be a separate >Per> package like webster.el, and posted to gnu.emacs.sources. > >Well, I'm not sure I totally agree... Granted, it should probably be >posted there as well, but... Shouldn't all good news readers (ie, >pretty much just gnus) be able to help you decypher the articles you >are reading, and hence be able to look up acronyms? I mean, you have >rot13 built in to decode articles, what about acronym-lookup... > >Feeling in sort of a devils advocate kinda mood... sorry... This has been bothering me a bit lately. Lars (GNUS), Kyle (VM), and I (W3) seem to be reimplementing a lot of the same functionality. Notably base64 decoding, md5, POP functionality, rot13, etc, etc. _ALL_ of this functionality should be available to other applications easily, without requiring the user to load up all of GNUS/VM/W3 to be able to base64 a !%#*ing file. This is one of the reasons I've been slowly rewriting chunks of W3 to be more modular. VM, GNUS, and W3 can all benefit from a standard set of libraries that do: - Mailcap Parsing - base64 (en|de)coder - Quoted printable (en|de)code - rot13 display code - URL loading - RFC822 header parsing Any others? Can't we all just get along? :) I'd love to see VM use a user's mailcap file now that it has MIME suppport, GNUS too. Well, enough of this tirade, I'll send mail to lars and kyle privately to discuss some of this, and hope. As you can guess, I'd say distribute it separately, and do your best not to require stuff you don't absolutely need from GNUS, to make it easier for people to using it elsewhere. -Bill P. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Acronym lookups 1997-01-09 19:28 ` William M. Perry @ 1997-01-09 20:38 ` Steinar Bang 1997-01-09 20:49 ` Lars Magne Ingebrigtsen ` (2 subsequent siblings) 3 siblings, 0 replies; 16+ messages in thread From: Steinar Bang @ 1997-01-09 20:38 UTC (permalink / raw) >>>>> "William M. Perry" <wmperry@aventail.com>: [snip!] > _ALL_ of this functionality should be available to other applications > easily, without requiring the user to load up all of GNUS/VM/W3 to be able > to base64 a !%#*ing file. This is one of the reasons I've been slowly > rewriting chunks of W3 to be more modular. VM, GNUS, and W3 can all > benefit from a standard set of libraries that do: > - Mailcap Parsing > - base64 (en|de)coder > - Quoted printable (en|de)code > - rot13 display code > - URL loading > - RFC822 header parsing > Any others? Smiley to icon conversion? ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Acronym lookups 1997-01-09 19:28 ` William M. Perry 1997-01-09 20:38 ` Steinar Bang @ 1997-01-09 20:49 ` Lars Magne Ingebrigtsen 1997-01-09 23:31 ` William M. Perry ` (2 more replies) 1997-01-09 21:51 ` Karl Kleinpaste 1997-01-10 9:01 ` Wesley.Hardaker 3 siblings, 3 replies; 16+ messages in thread From: Lars Magne Ingebrigtsen @ 1997-01-09 20:49 UTC (permalink / raw) "William M. Perry" <wmperry@aventail.com> writes: > _ALL_ of this functionality should be available to other applications > easily, without requiring the user to load up all of GNUS/VM/W3 to be able > to base64 a !%#*ing file. This is one of the reasons I've been slowly > rewriting chunks of W3 to be more modular. VM, GNUS, and W3 can all > benefit from a standard set of libraries that do: > > - Mailcap Parsing > - base64 (en|de)coder > - Quoted printable (en|de)code > - rot13 display code > - URL loading > - RFC822 header parsing Hear, hear. One reason I'm not totally grossed out (just slightly grossed out) by the things happening with Netscape 4.0 (go read news.software.readers) is that I rely on (at some point in the (hopefully) not-too-far-off-future) tm (or something) to do the Mimy things and w3 to do all html'y things. Reinventing wheels is a bore. So... When's w3 going into the Emacs distribution, Bill? :-) Lazy loading makes libraries even more useful than they were before -- if they're programmed sensibly (i. e., don't require everything between heaven and Earth to be loaded in). Which is why I separated out all non-Gnus-specific article functions into article.el. But then I put it back in again, because the division wasn't totally clean... Perhaps I should separate it out again and cleanify it. Hm. > As you can guess, I'd say distribute it separately, and do your best not > to require stuff you don't absolutely need from GNUS, to make it easier for > people to using it elsewhere. Yes, I think so too. So I didn't include acronym.el in Red Gnus 0.80 after all. -- (domestic pets only, the antidote for overdose, milk.) larsi@ifi.uio.no * Lars Ingebrigtsen ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Acronym lookups 1997-01-09 20:49 ` Lars Magne Ingebrigtsen @ 1997-01-09 23:31 ` William M. Perry 1997-01-09 23:35 ` Steven L Baur 1997-01-10 8:03 ` Steinar Bang 2 siblings, 0 replies; 16+ messages in thread From: William M. Perry @ 1997-01-09 23:31 UTC (permalink / raw) Cc: ding Lars Magne Ingebrigtsen writes: >"William M. Perry" <wmperry@aventail.com> writes: > >> _ALL_ of this functionality should be available to other applications >> easily, without requiring the user to load up all of GNUS/VM/W3 to be able >> to base64 a !%#*ing file. This is one of the reasons I've been slowly >> rewriting chunks of W3 to be more modular. VM, GNUS, and W3 can all >> benefit from a standard set of libraries that do: >> >> - Mailcap Parsing >> - base64 (en|de)coder >> - Quoted printable (en|de)code >> - rot13 display code >> - URL loading >> - RFC822 header parsing > >Hear, hear. One reason I'm not totally grossed out (just slightly grossed >out) by the things happening with Netscape 4.0 (go read >news.software.readers) is that I rely on (at some point in the (hopefully) >not-too-far-off-future) tm (or something) to do the Mimy things and w3 to >do all html'y things. Reinventing wheels is a bore. Indeedy. >So... When's w3 going into the Emacs distribution, Bill? :-) Not sure. Stallman has had the papers for quite a while. Perhaps if I get lucky with the timing of Emacs-W3 3.0 and Emacs 19.36. Its been in XEmacs (aka Lemacs) since the 19.(10? 11?) days. I actually just made a few patches to VM so that it can display inlined HTML. So stupid netscape 4.0 stuff isn't a problem for me anymore. :) -Bill P. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Acronym lookups 1997-01-09 20:49 ` Lars Magne Ingebrigtsen 1997-01-09 23:31 ` William M. Perry @ 1997-01-09 23:35 ` Steven L Baur 1997-01-10 0:15 ` Sudish Joseph 1997-01-10 8:03 ` Steinar Bang 2 siblings, 1 reply; 16+ messages in thread From: Steven L Baur @ 1997-01-09 23:35 UTC (permalink / raw) >>>>> "Lars" == Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes: > "William M. Perry" <wmperry@aventail.com> writes: William> _ALL_ of this functionality should be available to other William> applications easily, without requiring the user to load up William> all of GNUS/VM/W3 to be able to base64 a !%#*ing file. This William> is one of the reasons I've been slowly rewriting chunks of W3 William> to be more modular. VM, GNUS, and W3 can all benefit from a William> standard set of libraries that do: William> - Mailcap Parsing William> - base64 (en|de)coder William> - Quoted printable (en|de)code William> - rot13 display code William> - URL loading William> - RFC822 header parsing Lars> Hear, hear. You have my cooperation. Lars> One reason I'm not totally grossed out (just slightly grossed Lars> out) by the things happening with Netscape 4.0 (go read Lars> news.software.readers) is that I rely on (at some point in the Lars> (hopefully) not-too-far-off-future) tm (or something) to do the Lars> Mimy things and w3 to do all html'y things. Reinventing wheels Lars> is a bore. Integrated tm and Gnus in the latest XEmacs betas seems to be working quite well. I've discussed tm with RMS, and so long as the copyright assignment papers are in the kind of order the header comments imply, he's favorable to including it with Emacs. Lars> So... When's w3 going into the Emacs distribution, Bill? :-) ;;; w3.el --- Main functions for emacs-w3 on all platforms/versions ;; Author: wmperry ;; Created: 1996/12/30 20:37:55 ... ;;; Copyright (c) 1996 Free Software Foundation, Inc. :-) -- steve@miranova.com baur Unsolicited commercial e-mail will be billed at $250/message. "That Bill Clinton. He probably doesn't know how to log on to the Internet." -- Rush Limbaugh, noted Computer Expert ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Acronym lookups 1997-01-09 23:35 ` Steven L Baur @ 1997-01-10 0:15 ` Sudish Joseph 0 siblings, 0 replies; 16+ messages in thread From: Sudish Joseph @ 1997-01-10 0:15 UTC (permalink / raw) Steven L Baur writes: > Integrated tm and Gnus in the latest XEmacs betas seems to be working > quite well. Yup, whoever did the integration gets a big vote of thanks from me. For an example of how cool it looks, take a look at one of the messages you posted to the beta list (no one else seems to post MIME encoded images :-): <URL:http://www.mindspring.com/~sj/gnus-tm.gif> Yes, I have no taste at all, -Sudish ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Acronym lookups 1997-01-09 20:49 ` Lars Magne Ingebrigtsen 1997-01-09 23:31 ` William M. Perry 1997-01-09 23:35 ` Steven L Baur @ 1997-01-10 8:03 ` Steinar Bang 2 siblings, 0 replies; 16+ messages in thread From: Steinar Bang @ 1997-01-10 8:03 UTC (permalink / raw) >>>>> Lars Magne Ingebrigtsen <larsi@ifi.uio.no>: > "William M. Perry" <wmperry@aventail.com> writes: >> _ALL_ of this functionality should be available to other applications >> easily, without requiring the user to load up all of GNUS/VM/W3 to be able >> to base64 a !%#*ing file. This is one of the reasons I've been slowly >> rewriting chunks of W3 to be more modular. VM, GNUS, and W3 can all >> benefit from a standard set of libraries that do: >> >> - Mailcap Parsing >> - base64 (en|de)coder >> - Quoted printable (en|de)code >> - rot13 display code >> - URL loading >> - RFC822 header parsing > Hear, hear. One reason I'm not totally grossed out (just slightly > grossed out) by the things happening with Netscape 4.0 (go read > news.software.readers) is that I rely on (at some point in the > (hopefully) not-too-far-off-future) tm (or something) to do the Mimy > things and w3 to do all html'y things. Reinventing wheels is a bore. TM woiks just fine on rgnus 0.79, in this case. I didn't even notice that someone had posted multipart/alternatives, until someone following up an article complained (the version of TM i have, it shows all the alternatives, but the HTML part, is gently tucked away). - Steinar ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Acronym lookups 1997-01-09 19:28 ` William M. Perry 1997-01-09 20:38 ` Steinar Bang 1997-01-09 20:49 ` Lars Magne Ingebrigtsen @ 1997-01-09 21:51 ` Karl Kleinpaste 1997-01-10 9:01 ` Wesley.Hardaker 3 siblings, 0 replies; 16+ messages in thread From: Karl Kleinpaste @ 1997-01-09 21:51 UTC (permalink / raw) "William M. Perry" <wmperry@aventail.com> writes: > Any others? - smilification - emphasization (/word/, *word*, _word_) Both of these are already in use in environments near here for a zephyr interface. But both required hacking things out of the Gnus versions in order to do so. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Acronym lookups 1997-01-09 19:28 ` William M. Perry ` (2 preceding siblings ...) 1997-01-09 21:51 ` Karl Kleinpaste @ 1997-01-10 9:01 ` Wesley.Hardaker 3 siblings, 0 replies; 16+ messages in thread From: Wesley.Hardaker @ 1997-01-10 9:01 UTC (permalink / raw) >>>>> "William" == William M Perry <wmperry@aventail.com> writes: William> This has been bothering me a bit lately. Lars (GNUS), Kyle William> (VM), and I (W3) seem to be reimplementing a lot of the same William> functionality. Notably base64 decoding, md5, POP William> functionality, rot13, etc, etc. Well, I do agree with this of course! Heck, thats one of the reasons that oo is so popular with the theoretical crowd, its supposed to support this type of re-use. The reason I figured I'd just submit it here was that it would get included with both Emacs and XEmacs since they both follow gnus. XEmacs keeps track of a bunch of packages, but Emacs doesn't and gnus is but one of a minor few so I thought if it was going to add a key binding for it it should be shipped with it... Then if something like VM or W3 wants to add a keybinding as well, thats no problem as just because its in the gnus sub-dir in the load path, it can still find it... Gnus is shipped with both packages? Make Sense? I thought not... Doesn't to me much either... Wes ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Acronym lookups 1997-01-09 11:03 ` Lars Magne Ingebrigtsen 1997-01-09 11:29 ` Per Abrahamsen @ 1997-01-09 12:49 ` Lars Balker Rasmussen 1997-01-09 16:35 ` Wesley.Hardaker 2 siblings, 0 replies; 16+ messages in thread From: Lars Balker Rasmussen @ 1997-01-09 12:49 UTC (permalink / raw) Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes: > All three-character-or-more upper-case character words that > aren't followed by other upper-case words?) IMHO NO, HTH. -- Lars Balker Rasmussen <URL:http://www.daimi.aau.dk/~gnort/> Wind the frog! ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Acronym lookups 1997-01-09 11:03 ` Lars Magne Ingebrigtsen 1997-01-09 11:29 ` Per Abrahamsen 1997-01-09 12:49 ` Lars Balker Rasmussen @ 1997-01-09 16:35 ` Wesley.Hardaker 2 siblings, 0 replies; 16+ messages in thread From: Wesley.Hardaker @ 1997-01-09 16:35 UTC (permalink / raw) >>>>> "Lars" == Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes: Lars> :-) I've included this in Red Gnus 0.80. Glad you liked it! Are you going to stick it in a menu and add a keybinding (and therefore, an autoload as well) Lars> It might also be nice if the command offered the acronym under Lars> point as the default... True, but do you ever truely put the point in the article buffer? I think I'd retype it. Lars> And perhaps there should be a `buttonize-acronym' command to Lars> buttonize acronyms (gee!), so that you could just click on the Lars> acronyms to see what they meant. Thought about it, actually, but then decided I'd better get a life and not start such silly coding projects... I'm sure you understand... Wes ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~1997-01-10 9:01 UTC | newest] Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 1997-01-08 13:48 Acronym lookups Wesley.Hardaker 1997-01-09 11:03 ` Lars Magne Ingebrigtsen 1997-01-09 11:29 ` Per Abrahamsen 1997-01-09 16:38 ` Wesley.Hardaker 1997-01-09 17:17 ` David Moore 1997-01-09 19:28 ` William M. Perry 1997-01-09 20:38 ` Steinar Bang 1997-01-09 20:49 ` Lars Magne Ingebrigtsen 1997-01-09 23:31 ` William M. Perry 1997-01-09 23:35 ` Steven L Baur 1997-01-10 0:15 ` Sudish Joseph 1997-01-10 8:03 ` Steinar Bang 1997-01-09 21:51 ` Karl Kleinpaste 1997-01-10 9:01 ` Wesley.Hardaker 1997-01-09 12:49 ` Lars Balker Rasmussen 1997-01-09 16:35 ` Wesley.Hardaker
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).