Gnus development mailing list
 help / color / mirror / Atom feed
From: David Moore <dmoore@UCSD.EDU>
Subject: Re: IMAP problems.
Date: 11 Nov 1996 14:15:14 -0800	[thread overview]
Message-ID: <rvwwvs46tp.fsf@sdnp5.ucsd.edu> (raw)
In-Reply-To: visigoth@naiad.fac.cs.cmu.edu's message of 11 Nov 1996 10:21:15 -0500

> So--there are a couple of ways I can see of dealing with this.  One is
> to squirrel away the UID of the first message of a folder the first
> time you look at it--this number would be stored either as a string or
> as a float, since neither of these are limited to 32 bit integers.
> When a message is fetched or received from the server, the UID is read
> as a float or a string and then added/substracted from the "base" UID
> that was originally read (UIDs are guaranteed to grow over time.
> Usually grow by 1 per message in folder.) depending on whether it's
> going out or coming in.
> 
> This is kind of icky.  It means that we have to keep an extra number
> around for the group (not too hard), and that we need to mangle every
> message number as it goes from Emacs <-> IMAP.  If it's a string, we
> need to do our own math.  If it's a float, we need to do float math.
> 
> Any other ideas about how to deal with this?

	As long as they are always increasing, logically things will
work with subtracting an offset.  I also suspect that converting the
UID's will not be too expensive, since you will probably have to do
other cleanup on the incoming data anyways.

	When the message numbers come in, you could just stick a space
character before the 5th digit from the right hand edge of the number,
then use read to load both of these numbers (if there are less than 5
digits, just do 1 read).  The first (left hand) number is always between
0-42949, and the second is always between 0-99999, which are both
representable in emacs.  Subtract your initial number from these pair
wise and multiple the first by 10000.  Then just stuff that value back
into the buffer.


Initial number is 123432 -->  keep: (1 23431)  ;; make first message #1

When you get: 137563	-->  (1 37563) - (1 23432) = (0 14131)
			-->  new value: 14131


Of course, it might just be faster to stick a .0 on the end of the
number, read it as a float, do a float subtraction and convert back to
an integer.  The overhead of simple floating point operations isn't as
large in emacs as in other languages, due to the large constant overhead
of the interpreter.

	And I suspect that the cost of mangling won't be that noticable
in current gnus, due to high costs elsewhere in NOV processing.


-- 
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/>    | Solo Furnace Creek 508 -- 1996!


  reply	other threads:[~1996-11-11 22:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-11 15:21 visigoth
1996-11-11 22:15 ` David Moore [this message]
1996-11-12  0:05   ` visigoth
2002-04-10 22:00 IMAP Problems Niranjan Rao
2002-04-10 22:05 ` Paul Jarc
2002-04-11  7:57 ` Simon Josefsson
2003-09-19 17:24 IMAP problems Frank Schmitt
2003-09-19 17:46 ` Simon Josefsson
2003-09-19 20:21   ` Frank Schmitt
2003-09-19 21:19     ` Simon Josefsson
2003-09-19 20:24   ` Frank Schmitt
2003-09-19 21:23     ` Simon Josefsson
2003-09-20 10:50       ` Frank Schmitt

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=rvwwvs46tp.fsf@sdnp5.ucsd.edu \
    --to=dmoore@ucsd.edu \
    /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).