Thread: [gnotepad-users] gnotepad+ 1.3.0pre4 (April-25-2000) - some thoughts
Brought to you by:
ackahn
From: Dermot M. <de...@gl...> - 2000-04-26 17:10:40
|
Hello everyone, I have just been trying the latest gnotepad and it seems way, way better than when I tried it some time ago - thanks for all your work Andy. Some things came to mind while editing some HTML - in no particular order. 1) The 'Apply' button in the Preferences dialog did not apply the changes and I had to restart gnp to make changes (eg the editing font) happen. This was the first time that I ran gnp and it seems OK now. 2) The GtkXmHTML (doc) does not reflect unsaved changes made to the HTML even though the GtkXmHTML (window) seems to. 3) Undo stops working after inserting from the HTML menu (eg Title). 4) I could leverage all your good work in a little app that I am writing if I could tell gnp to open another document (tab). I realise that I can start a whole new gnp each time but I think that it would be cleaner to have all the open docs available in one place. 5) Is it possible to show the full path name of the documents somewhere? Either a tooltip over the tab label or a status bar message would be good. Also the recent files menuitems (or a tooltip?) - I get lost with 6 files called 'index.html'. 6) I have seen this warning several times - I don't know when. Gtk-WARNING **: gtk_signal_disconnect_by_func(): could not find handler (0x8053F50) containing data (0x81C9380) 7) I have seen this - again I don't know what caused it: GLib-CRITICAL **: file gmain.c: line 500 (g_source_remove): assertion `tag > 0' failed. 8) What about a simple signal handler for a GtkXmHTML (doc) 'activate' to load and raise the clicked URL (if it is a local HTML file)? 9) I know that syntax highlighting is a lot of work to achieve but I have done some HTML pseudo-highlighting (in perl) with the sub below. Perhaps it could be a user option although I don't think that this trivial tag highlighting is very expensive. Still it might need another couple of user preferences (HTML_tag_color and HTML_comment_color) to be really friendly. Please excuse my bad coding style - and also that it's in perl :) I don't know C but I guess that this approach would map fairly well. I only re-show the HTML on a notebook page switch or a user-request but it seems pretty snappy on small files. BTW perl's index looks in a string (eg $html) for a character (eg '<'), starting at offset (eg $pos) and returns the new offset if found or -1. sub show_html { my ($class, $textbox, $html) = @_; my $pos = 0; my ($tag, $prev_contents); my $new_pos; my $cm = $textbox->get_toplevel->window->get_colormap; my $plain_color = $cm->color_alloc({red=>0, green=>0, blue=>0}); my $tag_color = $cm->color_alloc({red=>0, green=>0, blue=>65535}); my $comment_color = $cm->color_alloc({red=>65535, green=>0, blue=>0}); my $plain_font = Gtk::Gdk::Font->load( '-b&h-lucidatypewriter-medium-*-*-*-*-120-*-*-*-*-*-*'); my $tag_font = $plain_font; my $comment_font = $plain_font; $textbox->freeze; $textbox->delete_text(0, -1); while (($new_pos = index($html, "<", $pos)) > -1) { $prev_contents = substr($html, $pos, $new_pos-$pos); $pos = $new_pos; $new_pos = index($html, ">", $pos); $tag = substr($html, $pos, $new_pos-$pos+1); $pos = $new_pos+1; $textbox->insert($plain_font, $plain_color, undef, $prev_contents); if ($tag =~ /^\<\s*!--/) { $textbox->insert($comment_font, $comment_color, undef, $tag); } else { $textbox->insert($tag_font, $tag_color, undef, $tag); } } $prev_contents = substr($html, $pos, $new_pos-$pos); $textbox->insert($plain_font, $plain_color, undef, $prev_contents); $textbox->thaw; } Apologies for the long posting and thanks again. Regards, Dermot. PS This is the info from my build. dermot 03:28:38 - ~ >$ gnp --info gnotepad+ 1.3.0pre4 (April-25-2000) Compiled by de...@hi...twrights.farm on Wed Apr 26 02:37:05 BST 2000 Compile/Link info: GTK version = 1.2.7 GNOME version = gnome-libs 1.0.58 CC = gcc GTK_CFLAGS = -I/usr/local/lib/glib/include -I/usr/local/include -I/usr/X11R6/include CFLAGS = -g -O2 -Wall -Wmissing-prototypes -Wno-implicit-int -I/usr/local/include -DNEED_GNOMESUPPORT_H -I/usr/local/lib/gnome-libs/include -I/usr/local/lib/glib/include -I/usr/X11R6/include -I/usr/local/include/gnome-xml GTK_LDFLAGS = -L/usr/local/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXext -lX11 -lm LDFLAGS = -rdynamic -L/usr/local/lib -L/usr/X11R6/lib UNAME = Linux higrade.botwrights.farm 2.2.1 #7 Tue Nov 16 02:22:30 GMT 1999 i586 unknown |
From: Andy K. <ac...@ne...> - 2000-04-26 18:40:33
|
Dermot, > 1) The 'Apply' button in the Preferences dialog did not apply the changes > and I had to restart gnp to make changes (eg the editing font) happen. > This was the first time that I ran gnp and it seems OK now. Odd; I can't seem to reproduce this. > 2) The GtkXmHTML (doc) does not reflect unsaved changes made to the HTML > even though the GtkXmHTML (window) seems to. This was (somewhat) intentional. The way the code is currently structured, it is easier to create a new document by simply rereading the file from disk than to make another copy of what's (unsaved) in memory. > 3) Undo stops working after inserting from the HTML menu (eg Title). Ah. This is indeed a bug. I believe it was introduced by the fix to this bug (from the ChangeLog): - fix: repeated undos after HTML tag insertion on highlighted characters results in a crash (James LewisMoss). Looks like we'll have another new (beta) version to test in the near future... > 4) I could leverage all your good work in a little app that I am writing > if I could tell gnp to open another document (tab). I realise that I can > start a whole new gnp each time but I think that it would be cleaner to > have all the open docs available in one place. This type of request has come up a few times in the past. Most recently, I responded on the mailing list: > The second is dividing background process (as emacsserver) and > opening documents command (as emacsclient). > Background process always running, and open buffer windows on > users demand. It would be useful for those who has "opening many > window" editing style. There have been a couple of requests for this in the past. Again, it's a tradeoff. I see this as useful only if gnotepad gets large enough such that starting another gnotepad process is really time consuming. Currently, I don't feel that gnotepad is large enough to justify this feature, but if gnotepad evolves (mutates?) into a more complex and robust editor, then this feature would certainly be needed. > 5) Is it possible to show the full path name of the documents somewhere? > Either a tooltip over the tab label or a status bar message would be good. > Also the recent files menuitems (or a tooltip?) - I get lost with 6 files > called 'index.html'. The full pathname is show in the window title for the current document. Without taking up a lot of screen space, there's no good way to display the full pathname for *all* opened documents. I'll see if a tooltip and/or a statusbar message can be done though. As for files in the recent menu: I think displaying the full pathname can be a good feature to be added as an option (in the preferences). Some people simply don't want to clutter the recent files menu with obscenely long paths, but others need it. > 6) I have seen this warning several times - I don't know when. > Gtk-WARNING **: gtk_signal_disconnect_by_func(): > could not find handler (0x8053F50) containing data (0x81C9380) > > 7) I have seen this - again I don't know what caused it: > GLib-CRITICAL **: file gmain.c: line 500 (g_source_remove): > assertion `tag > 0' failed. Hmm, please keep an eye on this in the future. I can't determine exactly when those messages are produced. > 8) What about a simple signal handler for a GtkXmHTML (doc) 'activate' to > load and raise the clicked URL (if it is a local HTML file)? I'd prefer to keep browser-like features out of gnotepad+. > 9) I know that syntax highlighting is a lot of work to achieve but I have > done some HTML pseudo-highlighting (in perl) with the sub below. Perhaps ... Please refer to a prior email sent to the mailing list titled "Future version(s) of gnotepad+". I make some comments about adding syntax highlighting. regards, --andy |
From: Dermot M. <de...@gl...> - 2000-04-29 01:03:46
|
Hi again, Thanks for your reply, I have read the list archives but I meant slightly different things :) Andy Kahn wrote: > > Dermot, > > > 1) The 'Apply' button in the Preferences dialog did not apply the changes > > and I had to restart gnp to make changes (eg the editing font) happen. > > This was the first time that I ran gnp and it seems OK now. > > Odd; I can't seem to reproduce this. I guess that the rc files did not exist yet. > > 2) The GtkXmHTML (doc) does not reflect unsaved changes made to the HTML > > even though the GtkXmHTML (window) seems to. > > This was (somewhat) intentional. The way the code is currently > structured, it is easier to create a new document by simply rereading > the file from disk than to make another copy of what's (unsaved) in > memory. I would prefer the same behaviour that you get with the new window but I haven't read the sources enough to understand the difficulties. [..] > Currently, I don't feel that gnotepad is large enough to justify this > feature, but if gnotepad evolves (mutates?) into a more complex and > robust editor, then this feature would certainly be needed. It is not the overhead of a new gnp as much as being able to see all the open documents in one place - especially minimising and restoring them. [...] > The full pathname is show in the window title for the current document. I hadn't noticed that - thanks. [...] > > 8) What about a simple signal handler for a GtkXmHTML (doc) 'activate' to > > load and raise the clicked URL (if it is a local HTML file)? > > I'd prefer to keep browser-like features out of gnotepad+. Fair enough, but that little change would really help work on a website. [...] > Please refer to a prior email sent to the mailing list titled "Future > version(s) of gnotepad+". I make some comments about adding syntax > highlighting. Yes, I read that but I was only suggesting colourising complete HTML tags or comments - which is trivial compared to 'real' syntax highlighting which I know is a _lot_ of work. Thanks again, I am not complaining, but explaining how I would like to use gnotepad. Regards, Dermot |