Re: [PATCH] space on prompt bugfix
Hello Oswald, Andy, and Jindrich, This email was in my drafts as I wanted to look into this a bit more before sending it to the list. Sending it anyway as the tab issue is a bit more complicated as you seem to think: On Wed, 2005-05-25 at 18:13, Oswald Buddenhagen wrote: On Wed, May 25, 2005 at 06:31:15PM +0300, Andy Shevchenko wrote: - why do you not drop tabspaces? hmm, indeed, if i go into troubles to press ctrl-q tab, the same issue comes up. This is a bit more complicated. Just adding a match for '\t' on the same line as for the ' ' doesn't do the trick as it interferes with the command completion. It appears the handling of '\t' when the panels are showing need to be fixed altogether. I've committed the patch as is for now. Leonard. -- mount -t life -o ro /dev/dna /genetic/research ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
Hello Andy, Oswald, On Wed, 2005-05-25 at 18:13 +0200, Oswald Buddenhagen wrote: On Wed, May 25, 2005 at 06:31:15PM +0300, Andy Shevchenko wrote: - why do you not drop tabspaces? hmm, indeed, if i go into troubles to press ctrl-q tab, the same issue comes up. I'm attaching the new patch to ignore the tab occurences in the command prompt as well. Pressing Ctrl-q tab isn't a daily practise for a common mc user, but it makes the patch more complete anyway, thanks. Cheers, Jindrich -- Jindrich Novy [EMAIL PROTECTED], http://people.redhat.com/jnovy/ The worst evil in the world is refusal to think. --- mc-4.6.1a/src/main.c.spaceprompt 2005-05-26 15:06:42.285109424 +0200 +++ mc-4.6.1a/src/main.c 2005-05-26 15:15:15.964018360 +0200 @@ -1490,9 +1491,15 @@ midnight_callback (struct Dlg_head *h, d if (parm == '\t') free_completions (cmdline); - if (parm == '\n' cmdline-buffer[0]) { - send_message ((Widget *) cmdline, WIDGET_KEY, parm); - return MSG_HANDLED; + if (parm == '\n') { + for (i = 0; cmdline-buffer[i] + (cmdline-buffer[i] == ' ' || cmdline-buffer[i] == '\t'); i++); + if (cmdline-buffer[i]) { + send_message ((Widget *) cmdline, WIDGET_KEY, parm); + return MSG_HANDLED; + } + stuff (cmdline, , 0); + cmdline-point = 0; } /* Ctrl-Enter and Alt-Enter */ @@ -1527,7 +1534,7 @@ midnight_callback (struct Dlg_head *h, d reverse_selection_cmd (); return MSG_HANDLED; } - } else if (!command_prompt || !strlen (cmdline-buffer)) { + } else if (!command_prompt || !cmdline-buffer[0]) { /* Special treatement '+', '-', '\', '*' only when this is * first char on input line */ ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
On Wed, Jun 01, 2005 at 11:10:16AM +0200, Jindrich Novy wrote: I'm attaching the new patch given that the other patch was finally applied, an incremental patch would be more helpful. anyway, i think the change can be commited without further comment ... -- Hi! I'm a .signature virus! Copy me into your ~/.signature, please! -- Chaos, panic, and disorder - my work here is done. ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
On Wed, 2005-06-01 at 13:32 +0200, Oswald Buddenhagen wrote: On Wed, Jun 01, 2005 at 11:10:16AM +0200, Jindrich Novy wrote: I'm attaching the new patch given that the other patch was finally applied, an incremental patch would be more helpful. I haven't noticed any post confirming the commitment, so I assumed it's not committed yet. anyway, i think the change can be commited without further comment ... Agreed. -- Jindrich Novy [EMAIL PROTECTED], http://people.redhat.com/jnovy/ The worst evil in the world is refusal to think. ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
Oswald Buddenhagen: I see two issues with this patch: - why do you not drop tabspaces? - the beheviour of space...smth should be accorded to shell (no put the command to the history), isn't it? -- With best regards, Andy Shevchenko. mailto: [EMAIL PROTECTED] ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
On Wed, May 25, 2005 at 06:31:15PM +0300, Andy Shevchenko wrote: - why do you not drop tabspaces? hmm, indeed, if i go into troubles to press ctrl-q tab, the same issue comes up. - the beheviour of space...smth should be accorded to shell (no put the command to the history), isn't it? this was discussed already, and this patch was chosen according to this requirement. -- Hi! I'm a .signature virus! Copy me into your ~/.signature, please! -- Chaos, panic, and disorder - my work here is done. ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
Oswald Buddenhagen: I see two issues with this patch: - why do you not drop tabspaces? - the beheviour of space...smth should be accorded to shell (no put the command to the history), isn't it? -- With best regards, Andy Shevchenko. mailto: [EMAIL PROTECTED] ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
Hello Oswald, Leonard, On Tue, 2005-05-24 at 07:52 +0200, Oswald Buddenhagen wrote: On Mon, May 23, 2005 at 11:12:21PM +0200, Leonard den Ottolander wrote: On Mon, 2005-05-23 at 22:56, Oswald Buddenhagen wrote: this paranoid checking policy doesn't get us anywhere but to the current state of stagnation. Bollocks. [how reviewing is good, etc.] i was talking about the testing aspect, in particular. it will be tested after commit (apart from that i expect the author to have tested most possible situations already) Yes, I tested the patch already. Note that the code is pretty straightforward so there shouldn't be any regressions or something bad introduced committing the patch. I have this patch applied since 21st Mar 2005 in Fedora rawhide and nobody complained since then. Cheers, Jindrich -- Jindrich Novy [EMAIL PROTECTED], http://people.redhat.com/jnovy/ The worst evil in the world is refusal to think. ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
Hi Oswald, On Sat, 2005-05-21 at 20:07, Oswald Buddenhagen wrote: On Wed, Apr 27, 2005 at 11:24:06PM +0200, Leonard den Ottolander wrote: Any objections against me committing this patch? The real command line argument seems bogus, as a real command line would accept a command existing of only spaces but mc does not. So can I commit this? I'll verify that it works first ;) , but the patch seems straight forward enough. there were no objections, so i suppose you forgot it. :) I should have asked for a verification ;-p . So you've tested this patch and agree it should be committed? Leonard. -- mount -t life -o ro /dev/dna /genetic/research ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
On Mon, May 23, 2005 at 10:44:01PM +0200, Leonard den Ottolander wrote: On Sat, 2005-05-21 at 20:07, Oswald Buddenhagen wrote: On Wed, Apr 27, 2005 at 11:24:06PM +0200, Leonard den Ottolander wrote: So can I commit this? I'll verify that it works first ;) , but the patch seems straight forward enough. there were no objections, so i suppose you forgot it. :) I should have asked for a verification ;-p . hehe So you've tested this patch of course not. i had a look and have not found something fundamentally broken about it. if a real mc developer would do the same, it should be totally sufficient. this paranoid checking policy doesn't get us anywhere but to the current state of stagnation. head is there for being broken once in a while. and if you find yourself in the situation that you cannot break head because people are relying on it's stability, you should seriously reconsider your release policy ... and agree it should be committed? sure -- Hi! I'm a .signature virus! Copy me into your ~/.signature, please! -- Chaos, panic, and disorder - my work here is done. ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
Hi Oswald, On Mon, 2005-05-23 at 22:56, Oswald Buddenhagen wrote: of course not. i had a look and have not found something fundamentally broken about it. if a real mc developer would do the same, it should be totally sufficient. I'm not sure if I would qualify. this paranoid checking policy doesn't get us anywhere but to the current state of stagnation. Bollocks. If you hadn't noticed pchel and I have done quite a lot of work this way the last half year of 2004. It's just that there don't seem to be many people that want to be the second pair of eyes to check patches. I believe double verification is a good policy to avoid silly mistakes. This might be a rather trivial patch, so yes, I could have committed it. Maybe I'm a bit too cautious at times. Must be my lack of formal training that makes me a bit uncertain about these issues at times. Otoh in all these months nobody seems to have cared just to take a look for a second and reply that they thought the thing was ok. head is there for being broken once in a while. and if you find yourself in the situation that you cannot break head because people are relying on it's stability, you should seriously reconsider your release policy ... I was intending to commit this to PRE as well. and agree it should be committed? sure Right. Thanks. I'll commit it to PRE and HEAD then. Tomorrow. Or the day after. Leonard. -- mount -t life -o ro /dev/dna /genetic/research ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
On Mon, May 23, 2005 at 11:12:21PM +0200, Leonard den Ottolander wrote: On Mon, 2005-05-23 at 22:56, Oswald Buddenhagen wrote: this paranoid checking policy doesn't get us anywhere but to the current state of stagnation. Bollocks. [how reviewing is good, etc.] i was talking about the testing aspect, in particular. it will be tested after commit (apart from that i expect the author to have tested most possible situations already), so why slow down your process by enforcing something that nobody will do anyway? head is there for being broken once in a while. [...] I was intending to commit this to PRE as well. and you have to do this in the same second, right? ;) -- Hi! I'm a .signature virus! Copy me into your ~/.signature, please! -- Chaos, panic, and disorder - my work here is done. ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
On Mon, Mar 21, 2005 at 09:19:34AM +0100, Jindrich Novy wrote: Hi mc-devel! There's a bug I've been annoyed with for some time so I finally decided to fix it. To reproduce: 1. start mc 2. go to some directory where you see some further subdirectories 3. press space once or for more times - spaces will appear in the command prompt 4. try to go to some subdirectory by pressing enter on it or press enter on any *.c, *.mp3 file. Results: You're unable to change a directory until you delete all spaces typed on command prompt and mc does nothing while you're pressing Enter. Furthermore you're unable to launch any application by tapping enter on *.c, *.mp3 files, etc. [...] Allows an user to type leading spaces on the command prompt, but when enter is pressed, it tests whether the user typed at least something except spaces. In case it finds only spaces, it deletes them from the command prompt and let the enter be further processed. On Wed, Apr 27, 2005 at 11:24:06PM +0200, Leonard den Ottolander wrote: Any objections against me committing this patch? The real command line argument seems bogus, as a real command line would accept a command existing of only spaces but mc does not. So can I commit this? I'll verify that it works first ;) , but the patch seems straight forward enough. there were no objections, so i suppose you forgot it. :) -- Hi! I'm a .signature virus! Copy me into your ~/.signature, please! -- Chaos, panic, and disorder - my work here is done. --- mc-4.6.1-pre3/src/main.c.jn 2005-03-19 15:55:40.0 +0100 +++ mc-4.6.1-pre3/src/main.c2005-03-19 17:04:10.0 +0100 @@ -1490,9 +1490,14 @@ midnight_callback (struct Dlg_head *h, d if (parm == '\t') free_completions (cmdline); - if (parm == '\n' cmdline-buffer[0]) { - send_message ((Widget *) cmdline, WIDGET_KEY, parm); - return MSG_HANDLED; + if (parm == '\n') { + for (i = 0; cmdline-buffer[i] cmdline-buffer[i] == ' '; i++); + if (cmdline-buffer[i]) { + send_message ((Widget *) cmdline, WIDGET_KEY, parm); + return MSG_HANDLED; + } + stuff (cmdline, , 0); + cmdline-point = 0; } /* Ctrl-Enter and Alt-Enter */ @@ -1527,7 +1532,7 @@ midnight_callback (struct Dlg_head *h, d reverse_selection_cmd (); return MSG_HANDLED; } - } else if (!command_prompt || !strlen (cmdline-buffer)) { + } else if (!command_prompt || !cmdline-buffer[0]) { /* Special treatement '+', '-', '\', '*' only when this is * first char on input line */ ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
Hi, On Mon, 2005-03-21 at 18:25, Jindrich Novy wrote: On Mon, 2005-03-21 at 17:42 +0100, [EMAIL PROTECTED] wrote: Not a good idea, since I think if you prepend a space to any command, the command is not saved in bash history - a feature. Sometimes it may be thus desirable to be able to type leading space if you do not want to save the command in history - your patch would disallow this Ok, I forgot about this feature, thanks for noticing this. So maybe Patch1 would be the best solution for the issue. Any objections against me committing this patch? The real command line argument seems bogus, as a real command line would accept a command existing of only spaces but mc does not. So can I commit this? I'll verify that it works first ;) , but the patch seems straight forward enough. Leonard. -- mount -t life -o ro /dev/dna /genetic/research ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
Jindrich Novy wrote: I did two patches to fix it so that you can decide which one is better commit candidate. Patch1: Allows an user to type leading spaces on the command prompt, but when enter is pressed, it tests whether the user typed at least something except spaces. In case it finds only spaces, it deletes them from the command prompt and let the enter be further processed. Patch2: Doesn't let the user to type leading spaces if he didn't write a non- space letter already. IMHO, patch1 is better way. Else end user can decide the space key is not working ... -- Dmitry Butskoj [EMAIL PROTECTED] Saint-Petersburg, Russia ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
Jindrich Novy wrote: IMHO, patch1 is better way. Else end user can decide the space key is not working ... Yes, the spacebar won't be working for leading spaces. However, typing the leading spaces in the command prompt IMHO doesn't make too much sense to me so maybe after patch2 is applied we may use the spacebar as an equivalent of Ins for selecting files/dirs as usual in other filemanagers when nothing is actually typed in the command prompt. That is a slight advantage of the second patch so please let me know if you like/dislike the idea so that I can do another patch for this or simply be happy with the patch1. Intuitively, the MC can be perceived as a screen extension to shell (which became possible due to ncurses/slang lib and Ctr/Fn/Alt/Meta keyboard features). Therefore, MC`s cmdline should be closer to a shell command line, rather than a screen application input field. Currently, we have only one printable character -- Tab -- which behaves unser MC and a shell differently (and it is reasonable). But don`t add space to this list! There are a lot of keyboard buttons, modifier keys etc. to do things easy -- let MC cmdline be a true command line. -- Dmitry Butskoj [EMAIL PROTECTED] Saint-Petersburg, Russia ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
Patch2: Doesn't let the user to type leading spaces if he didn't write a non- space letter already. Not a good idea, since I think if you prepend a space to any command, the command is not saved in bash history - a feature. Sometimes it may be thus desirable to be able to type leading space if you do not want to save the command in history - your patch would disallow this Martin Petricek ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
Hello Martin, On Mon, 2005-03-21 at 17:42 +0100, [EMAIL PROTECTED] wrote: Patch2: Doesn't let the user to type leading spaces if he didn't write a non- space letter already. Not a good idea, since I think if you prepend a space to any command, the command is not saved in bash history - a feature. Sometimes it may be thus desirable to be able to type leading space if you do not want to save the command in history - your patch would disallow this Ok, I forgot about this feature, thanks for noticing this. So maybe Patch1 would be the best solution for the issue. Jindrich -- Jindrich Novy [EMAIL PROTECTED], http://people.redhat.com/jnovy/ ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: [PATCH] space on prompt bugfix
Hi Jindrich, On Mon, 2005-03-21 at 18:25, Jindrich Novy wrote: On Mon, 2005-03-21 at 17:42 +0100, [EMAIL PROTECTED] wrote: Not a good idea, since I think if you prepend a space to any command, the command is not saved in bash history - a feature. Sometimes it may be thus desirable to be able to type leading space if you do not want to save the command in history - your patch would disallow this Ok, I forgot about this feature, thanks for noticing this. HISTCONTROL=ignorespace is actually used actively by mc itself to hide mc commands from the history in subshell.c ;) . Leonard. -- mount -t life -o ro /dev/dna /genetic/research ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re[2]: [PATCH] space on prompt bugfix
Hello buc, Monday, March 21, 2005, 7:44:46 PM, you wrote: b Intuitively, the MC can be perceived as a screen extension to shell b (which became possible due to ncurses/slang lib and Ctr/Fn/Alt/Meta b keyboard features). Therefore, MC`s cmdline should be closer to a shell b command line, rather than a screen application input field. bCurrently, we have only one printable character -- Tab -- which b behaves unser MC and a shell differently (and it is reasonable). But b don`t add space to this list! bThere are a lot of keyboard buttons, modifier keys etc. to do things b easy -- let MC cmdline be a true command line. MC cmdline isn't a true command line. Please. Read man mc. Macro Substitution When accessing a user menu, or executing an extension dependent com- mand, or running a command from the command line input, a simple macro substitution takes place. ... and so on. -- Best regards, Pavelmailto:[EMAIL PROTECTED] ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel