Discussion:
Searchlist update fix
Andrius
2013-07-01 21:37:28 UTC
Permalink
Hi Olivier,
when number of entries in find bar gets higher than 15, then the searchlist fails to update when saving the project. The searchlist stays always the same, whatever new entries are entered into find bar.
Closer investigation revealed, that save_config_file() in rcfile.c always counts 15 entries from the bottom of the Glist, while several Glist (searchlist, replacelist) are updated from the top. This causes always save of old entries instead of new ones.
I made some kind of dirty patch that fixes this problem. See attached file. I am not sure if this is the best way to do this (uses identifier matching), however, it works for now.
Please let me know if it is OK to commit it.
Andrius
Olivier Sessink
2013-07-02 19:21:34 UTC
Permalink
Post by Andrius
Hi Olivier,
when number of entries in find bar gets higher than 15, then the searchlist fails to update when saving the project. The searchlist stays always the same, whatever new entries are entered into find bar.
Closer investigation revealed, that save_config_file() in rcfile.c always counts 15 entries from the bottom of the Glist, while several Glist (searchlist, replacelist) are updated from the top. This causes always save of old entries instead of new ones.
storing only a limited number of items is done in rcfile.c around line
254. The same code is used for various other history functions, such as
the globlist, recent files, recent directories. Do they suffer from the
same problem or are these lists loaded in a different order?
Post by Andrius
I made some kind of dirty patch that fixes this problem. See attached file. I am not sure if this is the best way to do this (uses identifier matching), however, it works for now.
Please let me know if it is OK to commit it.
Andrius
this is a very crude patch, we better fix it by making sure all lists
that we use init_prop_limitedstringlist() on is ordered the same way
(newest on top seems most logical).

Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Olivier Sessink
2013-07-02 19:49:20 UTC
Permalink
Post by Olivier Sessink
this is a very crude patch, we better fix it by making sure all lists
that we use init_prop_limitedstringlist() on is ordered the same way
(newest on top seems most logical).
changed all code that use add_to_history_stringlist() to have the newest
entry on top. That way we can handle them all the same.

Olivier
Andrius
2013-07-02 19:57:08 UTC
Permalink
I agree that this is dirty patch...
As far as I can tell the globlist, recent files, recent directories are updated from bottom, while searchlist and replacelist are updated from top.
One of the difficulties is that I could not find where recent files and recent directories are used. How they are accessed from UI? globlist I found is used in Advanced Open only?

Probably these are dumb questions, but answers would save me some time...
Andrius



----- Original Message -----
Sent: Tuesday, July 2, 2013 10:21 PM
Subject: Re: Searchlist update fix
Post by Andrius
Hi Olivier,
when number of entries in find bar gets higher than 15, then the searchlist
fails to update when saving the project. The searchlist stays always the same,
whatever new entries are entered into find bar.
Post by Andrius
Closer investigation revealed, that save_config_file() in rcfile.c always
counts 15 entries from the bottom of the Glist, while several Glist (searchlist,
replacelist) are updated from the top. This causes always save of old entries
instead of new ones.
storing only a limited number of items is done in rcfile.c around line
254. The same code is used for various other history functions, such as
the globlist, recent files, recent directories. Do they suffer from the
same problem or are these lists loaded in a different order?
Post by Andrius
I made some kind of dirty patch that fixes this problem. See attached file.
I am not sure if this is the best way to do this (uses identifier matching),
however, it works for now.
Post by Andrius
Please let me know if it is OK to commit it.
Andrius
this is a very crude patch, we better fix it by making sure all lists
that we use init_prop_limitedstringlist() on is ordered the same way
(newest on top seems most logical).
Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
--
To unsubscribe from this list: send the line "unsubscribe
bluefish-dev" in
http://www.ems.ru/cgi-bin/listargate.cgi
Bluefish web site: http://bluefish.openoffice.nl/
Olivier Sessink
2013-07-02 21:02:29 UTC
Permalink
Post by Andrius
I agree that this is dirty patch...
As far as I can tell the globlist, recent files, recent directories are updated from bottom, while searchlist and replacelist are updated from top.
One of the difficulties is that I could not find where recent files and recent directories are used. How they are accessed from UI? globlist I found is used in Advanced Open only?
Probably these are dumb questions, but answers would save me some time...
Andrius
what I do in such a case (as I also don't remember all code):

$ grep recent_files src/*.c
src/bfwin_uimanager.c: if (num > main_v->props.max_recent_files) {
src/bfwin_uimanager.c: if (num > main_v->props.max_recent_files)
src/bfwin_uimanager.c: recent_create_backend(bfwin,
"/MainMenu/FileMenu/FileOpenRecent", bfwin->session->recent_files);
src/document.c: bfwin->session->recent_files =
src/document.c:
add_to_history_stringlist(bfwin->session->recent_files, curi, TRUE);
src/file_dialogs.c: tmplist = g_list_first(bfwin->session->recent_files);
src/preferences.c: max_recent_files, /* length of Open
Recent list */
src/preferences.c: integer_apply(&main_v->props.max_recent_files,
pd->prefs[max_recent_files], FALSE);
src/preferences.c: pd->prefs[max_recent_files] =
src/preferences.c: dialog_spin_button_in_table(3, 25,
main_v->props.max_recent_files, table, 1, 2, 0, 1);
src/preferences.c: dialog_mnemonic_label_in_table(_("_Number of files
in 'Open recent' menu:"), pd->prefs[max_recent_files],
src/project.c: free_stringlist(session->recent_files);
src/rcfile.c: init_prop_integer(&config_rc,
&main_v->props.max_recent_files, "max_recent_files:", 15, TRUE);
src/rcfile.c:
main_v->props.max_recent_files, init_values);
src/rcfile.c: init_prop_limitedstringlist(&configlist,
&session->recent_files, "recent_files:",
src/rcfile.c:
main_v->props.max_recent_files, FALSE);
src/rcfile.c:/* init_prop_stringlist(&configlist,
&project->recentfiles, "recentfiles:", FALSE); / * should be changed to
use the session->recent_files */
src/rcfile.c: DEBUG_MSG("rcfile_save_project, length session
recent_files=%d\n",
src/rcfile.c: g_list_length(project->session->recent_files));


the most important lines:

recent_create_backend() creates the menu for recent files
add_to_history_stringlist() adds a new entry to a list, and if the entry
exists, it will move it to the top (well, since r7996 they all move the
new item to the top)

gr.
Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Andrius
2013-07-02 21:26:55 UTC
Permalink
Thanks for the hint.
On my OSX system recent_files does not work correctly, but I am seeing that saving the list to the .bfproject file probably is OK. There is 15 entries in the file, but only 4 of them are displayed. Other project does not display any Open Recent ... files at all. I will look what might cause this.
Andrius




----- Original Message -----
Sent: Wednesday, July 3, 2013 12:02 AM
Subject: Re: Searchlist update fix
Post by Andrius
I agree that this is dirty patch...
As far as I can tell the globlist, recent files, recent directories are
updated from bottom, while searchlist and replacelist are updated from top.
Post by Andrius
One of the difficulties is that I could not find where recent files and
recent directories are used. How they are accessed from UI? globlist I found is
used in Advanced Open only?
Post by Andrius
Probably these are dumb questions, but answers would save me some time...
Andrius
$ grep recent_files src/*.c
src/bfwin_uimanager.c:        if (num > main_v->props.max_recent_files) {
src/bfwin_uimanager.c:        if (num > main_v->props.max_recent_files)
src/bfwin_uimanager.c:    recent_create_backend(bfwin,
"/MainMenu/FileMenu/FileOpenRecent",
bfwin->session->recent_files);
src/document.c:    bfwin->session->recent_files =
src/document.c:             
add_to_history_stringlist(bfwin->session->recent_files, curi, TRUE);
src/file_dialogs.c:    tmplist =
g_list_first(bfwin->session->recent_files);
src/preferences.c:    max_recent_files,            /* length of Open
Recent list */
src/preferences.c:    integer_apply(&main_v->props.max_recent_files,
pd->prefs[max_recent_files], FALSE);
src/preferences.c:    pd->prefs[max_recent_files] =
src/preferences.c:        dialog_spin_button_in_table(3, 25,
main_v->props.max_recent_files, table, 1, 2, 0, 1);
src/preferences.c:    dialog_mnemonic_label_in_table(_("_Number of files
in 'Open recent' menu:"), pd->prefs[max_recent_files],
src/project.c:    free_stringlist(session->recent_files);
src/rcfile.c:    init_prop_integer(&config_rc,
&main_v->props.max_recent_files, "max_recent_files:", 15,
TRUE);
src/rcfile.c:                             
main_v->props.max_recent_files, init_values);
src/rcfile.c:    init_prop_limitedstringlist(&configlist,
&session->recent_files, "recent_files:",
src/rcfile.c:                             
main_v->props.max_recent_files, FALSE);
src/rcfile.c:/*    init_prop_stringlist(&configlist,
&project->recentfiles, "recentfiles:", FALSE); / * should be
changed to
use the session->recent_files */
src/rcfile.c:    DEBUG_MSG("rcfile_save_project, length session
recent_files=%d\n",
src/rcfile.c:              g_list_length(project->session->recent_files));
recent_create_backend() creates the menu for recent files
add_to_history_stringlist() adds a new entry to a list, and if the entry
exists, it will move it to the top (well, since r7996 they all move the
new item to the top)
gr.
Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
--
To unsubscribe from this list: send the line "unsubscribe
bluefish-dev" in
http://www.ems.ru/cgi-bin/listargate.cgi
Bluefish web site: http://bluefish.openoffice.nl/
Andrius
2013-07-03 04:12:38 UTC
Permalink
Well, I found what confused me...
When I open project with 15 recent_files entries, as the files are added to the notebook, at the same time they are removed from Open Recent... menubar entry. So, when project is loaded, the Open Recent... menu is left empty. Only on rare occassions, when some file is removed from project but still stays on the recent_files list, it is shown in Open Recent... till You save project, so these entries are removed.
So, at first we create recent files menubar entry, and then remove all items from it... It does not looks like right behavior... I think the recent files should not be removed from menubar (the same applies also to recent project). We probably need to add some code to handle opening of the files from Open Recent... if this file or project is already open.
See bfwin_recent_menu_remove() from bfwin_uimanager.c line 1835 and how it is called in document.c and project.c .

Andrius



----- Original Message -----
Sent: Wednesday, July 3, 2013 12:26 AM
Subject: Re: Searchlist update fix
T hanks for the hint.
On my OSX system recent_files does not work correctly, but I am seeing that
saving the list to the .bfproject file probably is OK. There is 15 entries in
the file, but only 4 of them are displayed. Other project does not display any
Open Recent ... files at all. I will look what might cause this.
Andrius
----- Original Message -----
Sent: Wednesday, July 3, 2013 12:02 AM
Subject: Re: Searchlist update fix
  I agree that this is dirty patch...
  As far as I can tell the globlist, recent files, recent directories
are
updated from bottom, while searchlist and replacelist are updated from top.
  One of the difficulties is that I could not find where recent files
and
recent directories are used. How they are accessed from UI? globlist I
found is
used in Advanced Open only?
  Probably these are dumb questions, but answers would save me some
time...
  Andrius
$ grep recent_files src/*.c
src/bfwin_uimanager.c:        if (num >
main_v->props.max_recent_files) {
src/bfwin_uimanager.c:        if (num >
main_v->props.max_recent_files)
src/bfwin_uimanager.c:    recent_create_backend(bfwin,
"/MainMenu/FileMenu/FileOpenRecent",
bfwin->session->recent_files);
src/document.c:    bfwin->session->recent_files =
src/document.c:             
add_to_history_stringlist(bfwin->session->recent_files, curi, TRUE);
src/file_dialogs.c:    tmplist =
g_list_first(bfwin->session->recent_files);
src/preferences.c:    max_recent_files,            /* length of Open
Recent list */
src/preferences.c:    integer_apply(&main_v->props.max_recent_files,
pd->prefs[max_recent_files], FALSE);
src/preferences.c:    pd->prefs[max_recent_files] =
src/preferences.c:        dialog_spin_button_in_table(3, 25,
main_v->props.max_recent_files, table, 1, 2, 0, 1);
src/preferences.c:    dialog_mnemonic_label_in_table(_("_Number of
files
in 'Open recent' menu:"), pd->prefs[max_recent_files],
src/project.c:    free_stringlist(session->recent_files);
src/rcfile.c:    init_prop_integer(&config_rc,
&main_v->props.max_recent_files, "max_recent_files:", 15,
TRUE);
src/rcfile.c:                             
main_v->props.max_recent_files, init_values);
src/rcfile.c:    init_prop_limitedstringlist(&configlist,
&session->recent_files, "recent_files:",
src/rcfile.c:                             
main_v->props.max_recent_files, FALSE);
src/rcfile.c:/*    init_prop_stringlist(&configlist,
&project->recentfiles, "recentfiles:", FALSE); / * should
be
changed to
use the session->recent_files */
src/rcfile.c:    DEBUG_MSG("rcfile_save_project, length session
recent_files=%d\n",
src/rcfile.c:             
g_list_length(project->session->recent_files));
recent_create_backend() creates the menu for recent files
add_to_history_stringlist() adds a new entry to a list, and if the entry
exists, it will move it to the top (well, since r7996 they all move the
new item to the top)
gr.
Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
--
To unsubscribe from this list: send the line "unsubscribe
bluefish-dev" in
panel at
http://www.ems.ru/cgi-bin/listargate.cgi
Bluefish web site: http://bluefish.openoffice.nl/
--
To unsubscribe from this list: send the line "unsubscribe
bluefish-dev" in
http://www.ems.ru/cgi-bin/listargate.cgi
Bluefish web site: http://bluefish.openoffice.nl/
Olivier Sessink
2013-07-03 18:17:44 UTC
Permalink
Well, I found what confused me... When I open project with 15
recent_files entries, as the files are added to the notebook, at the
same time they are removed from Open Recent... menubar entry. So,
when project is loaded, the Open Recent... menu is left empty. Only
on rare occassions, when some file is removed from project but still
stays on the recent_files list, it is shown in Open Recent... till
You save project, so these entries are removed. So, at first we
create recent files menubar entry, and then remove all items from
it... It does not looks like right behavior... I think the recent
files should not be removed from menubar (the same applies also to
recent project). We probably need to add some code to handle opening
of the files from Open Recent... if this file or project is already
open. See bfwin_recent_menu_remove() from bfwin_uimanager.c line 1835
and how it is called in document.c and project.c .
hmmm I never thought about this. Indeed the recent menu shows only files
that have been opened recently, but are not opened at this very moment.

Perhaps we should store more recent filenames (30 ?) and display only
the last 15 (if the user has chosen to see the last 15 recent items).
That way there is less chance that the number shown is very small
because all of the stored recent filenames are opened in the project.

Olivier
--
Blog http://oli4444.wordpress.com/
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Andrius
2013-07-03 20:06:04 UTC
Permalink
Most(if not all) of the other apps have Open Recent lists that do not depends on what files are opened by the same app. They just reflects the order in which the files were accessed. They are changed only when user opens new file (adds new entry, removes last one if list exceeds the limit). At least this is the case for OSX. I think it would be the best to follow convention and do not cause confusion to the users...
As far as I can see, we would need to modify recent_menu_activate() to handle selection of files that are already open (maybe switch to related notebook tab?), and also we need to add here handling for the entries of the files that are removed from the disk.
What do You think?
Andrius
________________________________
Sent: Wednesday, July 3, 2013 9:17 PM
Subject: Re: Searchlist update fix
Well, I found what confused me... When I open project with 15
recent_files entries, as the files are added to the notebook, at the
same time they are removed from Open Recent... menubar entry. So,
when project is loaded, the Open Recent... menu is left empty. Only
on rare occassions, when some file is removed from project but still
stays on the recent_files list, it is shown in Open Recent... till
You save project, so these entries are removed. So, at first we
create recent files menubar entry, and then remove all items from
it... It does not looks like right behavior... I think the recent
files should not be removed from menubar (the same applies also to
recent project). We probably need to add some code to handle opening
of the files from Open Recent... if this file or project is already
open. See bfwin_recent_menu_remove() from bfwin_uimanager.c line 1835
and how it is called in document.c and project.c .
hmmm I never thought about this. Indeed the recent menu shows only files
that have been opened recently, but are not opened at this very moment.
Perhaps we should store more recent filenames (30 ?) and display only
the last 15 (if the user has chosen to see the last 15 recent items).
That way there is less chance that the number shown is very small
because all of the stored recent filenames are opened in the project.
Olivier
--
Blog http://oli4444.wordpress.com/
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
--
To unsubscribe from this list: send the line "unsubscribe bluefish-dev" in
Bluefish web site: http://bluefish.openoffice.nl/
Olivier Sessink
2013-07-04 08:56:13 UTC
Permalink
Post by Andrius
Most(if not all) of the other apps have Open Recent lists that do not
depends on what files are opened by the same app. They just reflects the
order in which the files were accessed. They are changed only when user
opens new file (adds new entry, removes last one if list exceeds the
limit). At least this is the case for OSX. I think it would be the best
to follow convention and do not cause confusion to the users...
As far as I can see, we would need to modify recent_menu_activate() to
handle selection of files that are already open (maybe switch to related
notebook tab?), and also we need to add here handling for the entries of
the files that are removed from the disk.
What do You think?
Andrius
I personally think it's useless to have files in the 'open recent' menu
that are already open. Say you have 10 files open, and your recent menu
lists the 15 most recent files. That essentially means that there are 5
items that actually do something hidden between 10 entries that do
nothing if you click them.

I agree that the current situation is also not perfect: in which
bluefish will show only those 5 files, even if the user wants to have 15
items in the recent menu.

So my proposal would be to actually store more recent files (2X N where
N is the setting by the user), and bluefish shows the most recent N
files that are not already open.

But I would like to hear some more opinions on how the recent menu
should work. Anybody an opinion on the recent menu? Who uses the recent
menu and what do you like/dislike about it?

Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Lindsay Haisley
2013-07-04 16:53:05 UTC
Permalink
Post by Olivier Sessink
But I would like to hear some more opinions on how the recent menu
should work. Anybody an opinion on the recent menu? Who uses the recent
menu and what do you like/dislike about it?
It should be pointed out that there are two recent menus in BF, one for
files and one for Projects. Since I maintain a bunch of websites for a
lot of people, I make extensive use of the BF Projects feature, and in
fact seldom open a file outside of a Project. The number of recents in
the Project "Open Recent" list is rather large, and in almost all cases
I can find the Project I need to open on this list without drilling for
it. Since files in a Project are frequently opened in concert, the fact
that BF remembers which files were opened the last time a Project was
closed, and reopens them when the Project is reopened, is _very_
handy.

This having been said, my opinion on "Open Recent" for files is that
this is a pretty standardized feature, a la the Gnome Standard Menus
<https://developer.gnome.org/hig-book/3.0/menus-standard.html.en>, which
is quite similar across operating systems. The Open Recent file list
should _not_ be modified based on what files are open at the time, but
only in response to the closing of an open file. If the File menu's
Open Recent list had 5 files in it, and you have 4 of them open, the
chances are good that these files are related to one another and would
be better handled in the context of a Project.

I would be very much in favor of having a user-settable option to
control the number of files listed in the "Open Recent" list, and for
symmetry it might be good to provide the same for this list for
Projects. Many applications have such a configuration option, and I
always appreciate having that level of control. I assume it wouldn't be
difficult to privide.
--
Lindsay Haisley | "UNIX is user-friendly, it just
FMP Computer Services | chooses its friends."
512-259-1190 | -- Andreas Bogk
http://www.fmp.com |
Lindsay Haisley
2013-07-04 17:00:05 UTC
Permalink
Post by Lindsay Haisley
I would be very much in favor of having a user-settable option to
control the number of files listed in the "Open Recent" list
Actually I see that this control _does_ exist (I've never used it), so
my comment about this feature is moot. I don't quite understand what
the selection for "Register recent files with your desktop" is all
about, though.
--
Lindsay Haisley | "Everything works if you let it"
FMP Computer Services |
512-259-1190 | --- The Roadie
http://www.fmp.com |
Olivier Sessink
2013-07-04 20:45:57 UTC
Permalink
Post by Lindsay Haisley
Post by Lindsay Haisley
I would be very much in favor of having a user-settable option to
control the number of files listed in the "Open Recent" list
Actually I see that this control _does_ exist (I've never used it), so
my comment about this feature is moot. I don't quite understand what
the selection for "Register recent files with your desktop" is all
about, though.
in various desktop environments (Unity, Gnome shell) you can search for
recently used documents. This option selects if Bluefish will notify
your desktop that you used a file (or not).

Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Testa
2013-07-18 20:52:37 UTC
Permalink
Hi everyone,
I thinking a last few day. I have many problem with backup file option.
The trouble is that the way in which the file is saved. In my work dir.
So i always upload the git. But I love this option.
I write an alternative. What would save in a separate directory. Soon ready.
Keep it to myself, or need ?
Olivier Sessink
2013-07-18 21:31:08 UTC
Permalink
Post by Testa
Hi everyone,
I thinking a last few day. I have many problem with backup file option.
The trouble is that the way in which the file is saved. In my work dir.
So i always upload the git. But I love this option.
I write an alternative. What would save in a separate directory. Soon ready.
Keep it to myself, or need ?
Hi Testa,

please share it, if many other people like it we can include it in Bluefish!

Olivier
--
Bluefish website http://bluefish.openoffice.nl/
Blog http://oli4444.wordpress.com/
Andy G
2013-07-19 22:35:04 UTC
Permalink
Good idea actually; make sure that one can define it as a local
directory to your project or project files or both.

this would save having to filter the ~ files out of uploads.

Andy
Post by Olivier Sessink
Post by Testa
Hi everyone,
I thinking a last few day. I have many problem with backup file option.
The trouble is that the way in which the file is saved. In my work dir.
So i always upload the git. But I love this option.
I write an alternative. What would save in a separate directory. Soon ready.
Keep it to myself, or need ?
Hi Testa,
please share it, if many other people like it we can include it in Bluefish!
Olivier
Continue reading on narkive:
Search results for 'Searchlist update fix' (Questions and Answers)
3
replies
how to delete my FACEBOOK search history?
started 2011-08-07 09:04:59 UTC
facebook
Loading...