Patch to avoid history duplicates applied

2003-02-18 Thread Pavel Roskin
Hello!

I have applied a patch to avoid duplicates in the history.  Unlike the
patch posted on Savannah, it affects both the input widgets and the
directory history.

As a side effect, the lists used for history were converted to GList
(double linked list from glib).

Also, Alt-O writes the directory history now.

-- 
Regards,
Pavel Roskin
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



RE: [Patch #1093] User Menu localization

2003-02-18 Thread David Martin


Does ease count? Even if Makefile.in.in comes from gettext
it's just a tiny change that it needs. Cost is very, very low.

Second try: would you like/accept reusing the sed script to
make a dummy C file which could be scanned in a traditional way?

*8-) David


 --- On Tue 02/18,   [EMAIL PROTECTED]  wrote:
From:  [mailto: [EMAIL PROTECTED]]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Date: Tue, 18 Feb 2003 01:36:23 -0500
Subject: [Patch #1093] User Menu localization

Patch #1093 has been updated. 

Project: 
Category: None
Status: Open
Summary: User Menu localization

Follow-Ups:

Date: 2003-Feb-18 01:36
By: proski

Comment:
I agree that localization of the menu needs to be taken care of, but I disagree with 
this approach.  Makefile.in.in comes from gettext and changes between versions.  
Either we should use a documented hook, or the menu should be converted to a C file 
and scanned just like all other files.
---

---
For more info, visit:

http://savannah.gnu.org/patch/?func=detailpatchpatch_id=1093group_id=3521


___
Join Excite! - http://www.excite.com
The most personalized portal on the Web!
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: several issues + wishes

2003-02-18 Thread Oswald Buddenhagen
moin,

thx for the reply.

  mc forgets to reset the x window title when it exits.
 
 It was never meant to reset the title.  There was a discussion how
 to restore the original title, but no good solution was suggested.
 
too bad. is the problem that xterm does not provide a title query
sequence?

  a cmdline switch to replace the mc prefix in the window title would be
  very helpful. i usually have dozens of xterms with mc open, some of them
  are root consoles and some on remote hosts. it's impossible to manage
  them if they are all titled mc - 
 
 I think an environment variable would be better.  Something like PS1, but
 specific to mc.  Then you would set it in .profile on the remote host.

no. a) it complicates things like xterm -e su -c 'mc --title root', as
i need to set up the variable first somehow (note that sh does not
source any files in non-interactive mode by default) and b) i don't want
a remotehost title when i'm working locally on the other host.
i'm not saying that an env var is bad, but a cmdline switch is still
required and should take precedence.

  a single esc keypress should be translated to esc esc after some
  timeout. the timeout could be made dependent on the slow terminal
  setting and/or could be automatically adopted based on measurements of
  previous key sequences. dunno if this is simply doable with curses ...
 
 Sometimes it's useful when Escape doesn't time out.  Users don't have to
 use three fingers to run the Find File dialog.  Also, Escape+number is
 the last resort if the functional keys don't work.
 
indeed, i forgot that case. this smells like a good candidate for an
option.

  the text viewer should support syntax highlighting.
 
 I have no idea how to do it.  The syntax highlighting used in the
 internal editor is tied to a memory model used in the editor. 

there is no problem in IT that cannot be solved by adding another layer
of indirection ... :)

 The viewer uses mmap() on files, so it can read huge files without
 loading them into memory.  I think this feature is more important than
 syntax highlighting.
 
[disclaimer: these observations apply to mc 4.55]
this huge file support is rather theoretical. open /dev/hda and see it
explode. switching to line break mode (and, beware, start scrolling
backwards), switching to hex mode, etc. - all trigger(ed) incredible
memory/cpu consumption.

fwiw, it would also be possible to let the editor keep unmodified chunks
of text as references to a mmaped file. that would make appending to a
gigant file actually doable (especially if some options like don't
compute line numbers if file is  ... mb would be added). keeping the
file writeout consistent would be a bit tricky, though (don't overwrite
fragments that are still needed).

 How portable is file -z?

i don't know. sound like a ./configure candidate. falling back to
calling zip manually shouldn't be that hard.

  c is treated like c++. that's somewhat annoying.
 
 It's annoying for a reason.  Calling a variable new or class is not a
 good idea.
 
that's nonsense. it's a bad idea to do so in interfaces that can be
included in c++ sources, but not in plain .c files. i think treating .h
always as c++ is acceptable, especially given that there is hardly a way
to find out if it is. that does not apply to .c, though.
fwiw, i sometimes miss a menu entry to explicitly set the highlight
style.

now for something esotheric: nested language syntax highlighting, for
example perl embedded into a shell script. the plain text yielded from
de-quoting the outer language would be passed into the next
highlighter. no, this is not very urgent; i just wished it existed when
i was editing one of my highly unreadable bash scripts the other day. :)

  complex sh syntax highlighting, in particular bash syntax is totally
  screwed. see these examples:
cont=$((${delay2[i]}+$now-$(date '+%s')))
${mailclasses:1:$((${#mailclasses}-2))}
fil=$(egrep -i /([0-9]{2,3} - )?${i% $dsh *}( $dsh |( $dsh 
[^/]+)?(/.+)?/([0-9]{2,3} - )?)${i##* $dsh }\$ /tmp/xm-$$ | tr '\n' '\\')
dfil=$ddir/$i - ${sartist:+$(escape ${artist[cntr]}) $dsh
 }$(escape ${title[cntr]}).$ext
 
 The current syntax highlighting code cannot deal with such complex
 expressions.

too bad. :-(  any ETA?

oh, and perl syntax highlight, esp. wrt. the various uses of the $ char
is majorly broken. yes, to highlight it correcty, one needs to keep
incredible amounts of context information ...
btw, is it intentional, that %hashes are not highlightet (as oposed to
@arrays)?

  the type of white-space used by auto-indent should not be based on the
  fill tabs with spaces setting. instead, the leading whitespace from
  the above line should be copied. otherwise it's impossible to use a
  tabbing style like
  tabif (...)
  tabtabif (cond1  function(par1,
  tabtab  par2))
  tabtabtabstatement;
[to say it in words: tab for indentation, space for padding]
  (which is _the_ tabbing style).
 
 I have no idea what 

Re: several issues + wishes

2003-02-18 Thread Nerijus Baliunas
On Tue, 18 Feb 2003 11:53:32 +0100 Oswald Buddenhagen [EMAIL PROTECTED] wrote:

   mc forgets to reset the x window title when it exits.
  
  It was never meant to reset the title.  There was a discussion how
  to restore the original title, but no good solution was suggested.
  
 too bad. is the problem that xterm does not provide a title query
 sequence?

*Please* look in the archives. It was discussed to death during last
2 months...

Regards,
Nerijus

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



RE: [Patch #1093] User Menu localization

2003-02-18 Thread Pavel Roskin
Hello!

 Second try: would you like/accept reusing the sed script to
 make a dummy C file which could be scanned in a traditional way?

Yes.

-- 
Regards,
Pavel Roskin
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



resetting the xterm title (once more) (Re: several issues + wishes)

2003-02-18 Thread Oswald Buddenhagen
On Tue, Feb 18, 2003 at 11:53:32AM +0100, Oswald Buddenhagen wrote:
   mc forgets to reset the x window title when it exits.
  
  It was never meant to reset the title.  There was a discussion how
  to restore the original title, but no good solution was suggested.
  
 too bad. is the problem that xterm does not provide a title query
 sequence?
 
ok, i read the threads about it.
the direct x connection variant is doomed to failure on remote machines 
if no (x forwarding)/(env var setup) is done. i strongly dislike it.
so back to xterm's reporting sequence. it _is_ doable - your approach was
just incorrect: you've tried to force an asynchronous function into a
synchronous execution scheme. not only that it obviously does not work
very well, it's not even necessary: at startup the query command should
be sent and things should continue as usual. the reply should be handled
asynchronously as part of the normal input stream. that effectively
means, that at the time the old title is received, a new one has been set 
already long ago - who cares? on the xterm side the processing is done
in-order, so we'll always get the correct title. one remaining case is
mc exiting before the report arrives, but anybody quitting mc after no
more than 5 seconds should be shot anyway. :)
does this make sense?

greetings

-- 
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
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: MC bug

2003-02-18 Thread Adam Byrtek / alpha
On Tue, Feb 18, 2003 at 12:14:07AM +0100, Martin Tomsik wrote:
 Output is following:
 ---
 mac:~# mc -V
 subshell.c: couldn't get terminal settings: Inappropriate ioctl for device
 ---
 
 - Linux Debian Woody (unstable); Kernel 2.4.20-k7 (from .deb package)
 - GNU Midnight Commander 4.6.0

Another Debian user reported this 'bug' recently, but it is caused by
changed -P behaviour (mentioned in /usr/share/doc/REDAME.Debian). You
should remove/update any mc shell alises/functions. Look in your shell
startup files and read man page about the modified -P option.

See also:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=181302

 S pozdravem

Pozdrawiam,
Adam

-- 

  _.|._ |_  _.: Adam Byrtek, alpha@(irc.pl|debian.org)
 (_|||_)| |(_|: gg 1802819, pgp 0xB25952C0
 |: jid alpha.pl(at)jabber.org
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: Patch to avoid history duplicates applied

2003-02-18 Thread Adam Byrtek / alpha
On Tue, Feb 18, 2003 at 03:29:04AM -0500, Pavel Roskin wrote:
 As a side effect, the lists used for history were converted to GList
 (double linked list from glib).
 
 Also, Alt-O writes the directory history now.

And Alt-P in the command line doesn't work now :) It shows not the
last command, but the previous one. Alt-H works fine. It has to be
some simple mistake.

-- 

  _.|._ |_  _.: Adam Byrtek, alpha@(irc.pl|debian.org)
 (_|||_)| |(_|: gg 1802819, pgp 0xB25952C0
 |: jid alpha.pl(at)jabber.org
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Tilde expansion fix

2003-02-18 Thread Adam Byrtek / alpha
Original Debian bug report:

---cut---
Package: mc
Version: 4.5.42-11.potato.4
Severity: normal

MC believes that regular files with leading tilde and user names
are directories. ~root is one such file. Create one
(touch ~root) and run mc to demonstrate the bug.

Oskar Liljeblad ([EMAIL PROTECTED])
---cut--

I've spend a few hours examining mc code and tracing more and more
levels of recursion. I've decided to apply a very clean fix which:

 - makes mc treat '~name' paths as regular files ('~' is an exception)
 - makes mc treat '~name/...' paths as user directories (with PATH_SEP
   inside)

It makes 'cd' behaviour change a little, but a simple fix in one place
is IMO better than multiple fixes in different pieces of code
(separately for cd, viewer, panel, etc.) And we can't have regular
files shown as directories...

Patch in BTS:
https://savannah.gnu.org/patch/index.php?func=detailpatchpatch_id=1129group_id=3521

Regards

-- 

  _.|._ |_  _.: Adam Byrtek, alpha@(irc.pl|debian.org)
 (_|||_)| |(_|: gg 1802819, pgp 0xB25952C0
 |: jid alpha.pl(at)jabber.org
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: several issues + wishes

2003-02-18 Thread Oswald Buddenhagen
i had one more thought ...

On Tue, Feb 18, 2003 at 11:53:32AM +0100, Oswald Buddenhagen wrote:
   a cmdline switch to replace the mc prefix in the window title would be
   very helpful. i usually have dozens of xterms with mc open, some of them
   are root consoles and some on remote hosts. it's impossible to manage
   them if they are all titled mc - 
  
  I think an environment variable would be better.  Something like PS1, but
  specific to mc.  Then you would set it in .profile on the remote host.
 
 no. a) it complicates things like xterm -e su -c 'mc --title root', as
 i need to set up the variable first somehow (note that sh does not
 source any files in non-interactive mode by default)

valid

 and b) i don't want a remotehost title when i'm working locally on
 the other host.

nonsense. the xterm -e ssh remotehost mc --title remote case is already
covered by a), and the log in interactively, start mc case is the same
with both a var and a switch (i'd set up a shell function to do the
right thing based on login origin).

but i found, that appending to the already existing title would be very
helpful (i hope you can get the title query working):
 xterm -T konsole1
 xterm -T konsole2
 xterm -T root -e su
 xterm -T ktown -e ssh ktown
 xterm -e mc
 xterm -e mc --title mc2
in the interactive shells mc is aliased to 'mc --append-title'. think 
konsole1: mc - ~. the benefit is obvious, i think.
--title  would remove the mc - part entirely to save some space in
the task bar.

to carry things to excess: --title could interpret macros like these:
 %o - old title
 %f - currently open dir/file
 %a - current status ( (=view), edit)
 %F - currently processes dir/file
 %A - precise current status (as %a + the usual file operations)
 %{[var]?[text1]:[text2]} - if var (see above) is non-empty, text1,
  otherwise text2 (both subject to further expansion).
one could create things like this:
 %{o?%o (mc):mc}: %{a?%a :}%f
or the normal variant, but optimized for prefix size (for narrow task
bar entries) (btw, most apps use %f - title order):
 %{o?%o\: :}%f - mc
or for the pedantic:
 mc%{o? (%o):} - %{A?%A:view} %F


greetings

-- 
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
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: Patch to avoid history duplicates applied

2003-02-18 Thread Pavel Roskin
Hello!

 And Alt-P in the command line doesn't work now :) It shows not the
 last command, but the previous one. Alt-H works fine. It has to be
 some simple mistake.

Yes, it was a simple mistake.  Even the comment return pointer to last
entry in list was preserved, but the code actually doing it disappeared
during conversion.

Fixed now.  Thank you!

-- 
Regards,
Pavel Roskin
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel