Saving file position in mcedit



Hello!

I have tried the patch for saving file position, and indeed it seems very 
convenient.  I think it should be in 4.6.0.

I'm doing minor cleanups now.  In particular, I changed
edit_move_to_column() to be much more effective (current patch is attached
for the curious).

There is one question I want to ask.  What if we save the positions for
the device and inode combinations, rather than for filenames?  Device and
inode numbers are part of the stat structure, and they are unique for
every file.  They also survive renames.  mc already calls stat(), so we
have the required data already.

On the positive side we have less manipulations with strings in the code
(in fact, the file with positions can just be a binary) and the ability to
rename files and whole directories without losing saved positions for all
files.

On the negative side, it is harder to edit the file with positions, e.g.  
to hide the fact that you were editing certain files.  I don't think it's
important.  You can always erase the whole file to hide evidence.

Any other reasons to tie positions to full filenames?

-- 
Regards,
Pavel Roskin

Attachment: save_pos.diff.gz
Description: GNU Zip compressed data



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