Ticket #2328 (new defect)

Opened 14 years ago

Last modified 12 years ago

No action without shell patterns

Reported by: gotar Owned by:
Priority: major Milestone: Future Releases
Component: documentation Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

Copy and Move dialogs do nothing when "Using shell patterns" is unchecked. Even example from help doesn't work at all.

Change History

comment:1 Changed 14 years ago by gotar

  • Version changed from 4.7.3 to master

Related #2327.

comment:2 follow-up: ↓ 3 Changed 14 years ago by andrew_b

  1. Create 2 directories: /tmp/tmp1 and /tmp/tmp2.
  2. Open /tmp/tmp1 in left panel, /tmp/tmp2 in right panel.
  3. In any panel run touch aaa. Move cursor on aaa file.

4a. F5 or F6 (note: default source mask is *). Uncheck "Uisng shell pattern". Enter. Nothind happened.
4b. F5 or F6. Uncheck "Uisng shell pattern". Change source mask to .* (dot-asterisk). Enter. Success!

Result: if "Using shell pattern" is unchecket, content of both input lines is interpreted as regexps (pcre). "*" just is not valid regexp:

$ echo aaa | perl -pe 's/.*/bbb/'
bbb
$ echo aaa | perl -pe 's/*/bbb/'
Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE / at -e line 1.

comment:3 in reply to: ↑ 2 ; follow-up: ↓ 4 Changed 14 years ago by gotar

Replying to andrew_b:

4b. F5 or F6. Uncheck "Uisng shell pattern". Change source mask to .* (dot-asterisk). Enter. Success!

Andrew, in our talk in #2327 I've said about TARGET mask and in http://www.midnight-commander.org/ticket/2327#comment:7 I wrote about "renaming more than 1 file". Here you've just answered my question from http://www.midnight-commander.org/ticket/2327#comment:9 - OK, source matches. But TARGET doesn't.

Now, please press F1, read the examples and try to rename your 'aaa' plus mine 'bbb' files to '0-*', '0-\1' or any valid notation. Do I have to attach screenshots? So maybe different approach: having 'aaa' and 'bbb' files rename them both to 'aaa.sh' and 'bbb.sh' respectively.

comment:4 in reply to: ↑ 3 Changed 14 years ago by gotar

Replying to gotar:

And please, don't mention again about '.*' in source mask, just believe me I'm using it.

comment:5 follow-up: ↓ 6 Changed 14 years ago by gotar

  • Component changed from mc-core to documentation
  • Milestone changed from 4.7 to 4.7.5

And yet this is source mask not matching TOO - but only two separate documentation problem:

1a. current You must use '\(...\)' expressions
should be: You must use '(...)' expressions without escaping parentheses.

1b. current The source mask for this is "^\(.*\)\.\(.*\)$"
should be: The source mask for this is "^(.*)\.(.*)$"

  1. current If the source mask is "^\(.*\)\.tar\.gz$", the destination is "/bla/*.tgz"

should be: If the source mask is "^(.*)\.tar\.gz$", the destination is "/bla/\1.tgz" without escaping in source mask and with positional parameters only in target mask

And what does Otherwise target masks are similar to the situation when the shell patterns option is on. mean anyway? Otherwise - i.e. when the shell patterns option isn't off?

comment:6 in reply to: ↑ 5 Changed 14 years ago by gotar

Replying to gotar:

Let's summarize this one too: 4.7.4 with shell patterns OFF:

  • * in target pattern is left literal (after all, there's some bogus code, slightly different than in #2327),
  • ? is being left literal just like it should be,
  • \N backreferences work fine

while:

  • * should be interpreted as consecutive \N (N=1..n) backreferences (just like in older versions - I don't know when that has been broken) - still talking about target mask.

Alternatively, * support might be left abandoned as this was apparently robust implementation of some kind of shortcut. If so - documentation needs adjusing.

Additionally, behaviour of source mask has changed so that no escaping of surrounding parentheses must be used - this needs documentation adjusting.

comment:7 Changed 12 years ago by andrew_b

  • Branch state set to no branch
  • Milestone changed from 4.7.5 to Future Releases
Note: See TracTickets for help on using tickets.