Hi Daniel, I am not sure that inside the xoj file is a particularly logical place to save a current page number. For one, it causes files with identical contents to become different and change for no reason (not ideal e.g. for people who sync files between locations or to the cloud). It is also not particularly logical, if you e-mail me a xoj file in which you last looked at page 5, that it should open on page 5 for me as well.
A more logical location might be in the mru file (.xournal/recent-files). Since that one is local to an installation of xournal (more or less), it is fairly harmless to extend its format (plus, the current xournal doesn't read past 8 lines of the file). See init_mru(), new_mru_entry(), save_mru_list() in xo-file.c (I can't understand for the life of me why the reading of the MRU file is done with g_io_... instead of plain g_fopen() etc., perhaps I was feeling in a mood to explore glib features). It would be logical to simply store in the MRU list, along with the file name, the page number on which it was last opened (in memory, extend the MRU data structure to have not just a menu item widget and a file name but also a page number; in the MRU file, up to you how to do it, perhaps append :1 (or :pagenumber) at the end of each file name in the list stored on disk?) -- and if we want to keep page numbers for more than the last 8 files, increase the length of the list in memory and in the MRU file but not in the menus. Then add to the file-open function a feature to look up the file name in the MRU list and see if we have a preferred page number for it. Does this make sense? Best, Denis On 09/07/2014 01:07 AM, D M German wrote: > > hi Denis, > > what do you think about saving in the xoj file, the current page? > > If you agree with it, how would like it implemented? I can do the work. > > --daniel > > -- > Daniel M. German "Never underestimate the bandwidth > of a station wagon full of > Andrew S. Tanenbaum -> tapes hurtling down the highway." > http://turingmachine.org/ > http://silvernegative.com/ > dmg (at) uvic (dot) ca > replace (at) with @ and (dot) with . > > > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > _______________________________________________ > Xournal-devel mailing list > Xournal-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/xournal-devel > -- Denis Auroux UC Berkeley, Department of Mathematics aur...@math.berkeley.edu Institut Henri Poincare, Paris aur...@ihp.fr ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ Xournal-devel mailing list Xournal-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xournal-devel