nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] definition of filestruct with ENABLE_MULTIBUFFER


From: David Lawrence Ramsey
Subject: Re: [Nano-devel] definition of filestruct with ENABLE_MULTIBUFFER
Date: Tue, 26 Mar 2002 06:38:29 -0800 (PST)

--- David Benbennick <address@hidden> wrote:
>On Fri, 22 Mar 2002, David Lawrence Ramsey wrote:
>> --- David Benbennick <address@hidden> wrote:
>> > I think fileage should be removed (that is, open_files would be
>> > defined in all cases, and would just have ->prev == NULL == ->next if
>> > !ENABLE_MULTIBUFFER).  That would generally make the code cleaner.  
>> > Perhaps I will do that soon.
>> 
>> Hvae you been able to yet?
>
>No, I haven't done anything with it yet.  I intend to work on that
>soon; if I really do I will start with your nanopieces.patch.  Thanks for
>including my other small patches there.

No problem.  Just be warned: I've discovered a few minor bugs in it already, 
which need fixing before going to step two.

* open_file_fileage_sync() can probably be called fewer times (maybe just where 
it's called now in close_open_file(), and at the beginning of do_exit()), in 
which case it could just be reduced to "open_files->fileage = fileage;" in both 
areas

* open_files->file_lineno isn't initialized properly

* there should be a few comments detailing the tweaks to 
thanks_for_all_the_fish()

However, it's an extremely busy week for me; I don't know exactly when I'll be 
able to get to these.  If you get to any of them first, let me know.

>I agree that going in steps is wise.  What do you think of the following
>as the final goal for the definition of openfilestruct in nano.h?  
>Differences with your current definition:
>
>* make only next and prev be conditional on ENABLE_MULTIBUFFER,

I don't know about this one, since all the prev and next references would then 
have to be #ifdef'ed out, which could end up being a mess.  I was thinking of 
having a small function (as opposed to add_open_file()) to just initialize 
open_files->fileage if ENABLE_MULTIBUFFER is not defined.

>* use file_flags instead of file_modified, to eventually support
>buffer-local MARK_ISSET,

That sounds good.

>* keep edittop and filebot instead of file_lineno.  When switching between
>very large files, it can be arbitrarily slow to recalculate them from
>file_lineno.  There is not much need to keep openfilestruct as small as
>possible, since the number of open files is usually small.

You have a point about edittop and filebot, but the line number would still 
have to be preserved in order to keep the cursor exactly where the user had 
left it before (i. e. do_gotopos() won't work without a line number specified).

>* and have mark_beginbuf and mark_beginx, for eventual MARK_ISSET.

Yes; that'll work.


_____________________________________________________________
Sluggy.Net: The Sluggy Freelance Community!

_____________________________________________________________
Run a small business? Then you need professional email like address@hidden from 
Everyone.net  http://www.everyone.net?tag



reply via email to

[Prev in Thread] Current Thread [Next in Thread]