From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Noah Friedman Newsgroups: gmane.emacs.devel Subject: Re: IRC client for Emacs Date: Mon, 26 Aug 2002 11:29:12 -0700 (PDT) Sender: emacs-devel-admin@gnu.org Message-ID: <20020826112912.937066.FMU965@piglet.prv.splode.com> References: <873ctot40n.fsf@emacswiki.org> <20020809223753.955308.FMU31823@piglet.prv.splode.com> <200208110355.g7B3tOo06247@wijiji.santafe.edu> <877kixtg8w.fsf@emacswiki.org> <20020811160610.424772.FMU9022@piglet.prv.splode.com> <87fzxhs1ia.fsf@emacswiki.org> <200208151954.g7FJsut07968@wijiji.santafe.edu> <20020820143817.816033.FMU965@piglet.prv.splode.com> <200208210153.g7L1r4W10188@wijiji.santafe.edu> <20020820190744.375246.FMU965@piglet.prv.splode.com> <200208220156.g7M1uvx10414@wijiji.santafe.edu> <20020821193900.557945.FMU965@piglet.prv.splode.com> <200208240233.g7O2XW011692@wijiji.santafe.edu> <200208250527.g7P5RNm12107@wijiji.santafe.edu> Reply-To: Noah Friedman NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1030386651 7499 127.0.0.1 (26 Aug 2002 18:30:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 26 Aug 2002 18:30:51 +0000 (UTC) Cc: ueno@unixuser.org, alex@emacswiki.org, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17jOdR-0001wc-00 for ; Mon, 26 Aug 2002 20:30:45 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17jP8N-0002bG-00 for ; Mon, 26 Aug 2002 21:02:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17jOej-0003Gw-00; Mon, 26 Aug 2002 14:32:05 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17jOc6-0002yY-00 for emacs-devel@gnu.org; Mon, 26 Aug 2002 14:29:22 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17jOc4-0002xs-00 for emacs-devel@gnu.org; Mon, 26 Aug 2002 14:29:21 -0400 Original-Received: from scones-of-silence.splode.com ([216.27.180.143] helo=piglet.prv.splode.com) by monty-python.gnu.org with esmtp (Exim 4.10) id 17jOc4-0002xk-00; Mon, 26 Aug 2002 14:29:20 -0400 Original-Received: (from friedman@localhost) by piglet.prv.splode.com (8.9.3/8.9.3) id LAA12170; Mon, 26 Aug 2002 11:29:13 -0700 Original-To: rms@gnu.org In-Reply-To: <200208250527.g7P5RNm12107@wijiji.santafe.edu> (rms@gnu.org Saturday, 24 Aug 2002 23:27:23 -0600) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6927 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6927 > An MO file has its own internal hash table which is used to relate an > original string to the file position. However, the hashing algorithm is > dependent on gettext internals (See "(gettext)MO Files" for details). > >This suggests another approach: keep the MO file as text in a buffer, >and write Lisp code to do the lookup using the MO file hash table. >The function to do a lookup could recreate the buffer (reading the >file into it) if the buffer does not exist. This way, we could delete >these buffers occasionally (such as, when they have not been >used for 10 minutes), and they would be recreated when needed. >The buffer would serve as a cache for the file. > >What do you think? I think this might be ok, but I'm uncertain whether implementing the hash function in elisp is worth the computation time vs. just using C hashtables, or whether it's better to memoize results parsed out of the MO file into a hashtable for all future references. I'd like to try it and see. Are there any existing tools for extracting strings from elisp source to help build MO files? I'm not very familiar with the format. Regardless, I do like the idea of using gettext's API; the implementation details of gettext.el are a secondary issue.