Ticket #2993 (closed enhancement: duplicate)

Opened 11 years ago

Last modified 7 years ago

Copy/Move hot key to paste source filename into destination path

Reported by: szaszg Owned by:
Priority: major Milestone:
Component: mc-core Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

With this patch user can paste (with ctrl-v or ctrl-insert) the source filename if Copy/Move? one file or directory.

Attachments

mc.2993_paste_src_filename.diff (5.0 KB) - added by szaszg 11 years ago.

Change History

Changed 11 years ago by szaszg

comment:1 follow-up: ↓ 2 Changed 11 years ago by andrew_b

Paste for what?

comment:2 in reply to: ↑ 1 ; follow-up: ↓ 4 Changed 11 years ago by szaszg

Replying to andrew_b:

Paste for what?

The cause is the same as in #1907 (It's very useful to slightly alter file name while copy/move file.), but the solution is quite different.

e.g. I just want to rename file '02 - J.S. Bach - Goldberg Variations, BWV 988 Recording.mka' to '02 - J.S. Bach - Goldberg Variations, BWV 988 - 1981 Recording.mka'. Now, i can do it:

  1. if my terminal is wide enough, i can copy the filename with shift+MOUSE from dialog "header" and paste it to "to:" with Shift+mouse-middle-click and edit the name
  2. type some character from the beginning of the filename and press ESC+TAB (M-TAB) to mc copy file name into "to:" and edit the name
  3. go back to "source" pattern and change to something similar *8*, then go down to "to:" and type "*8 - 1981*"
  4. type the whole name

So more easy and less more frustrating if we just press ctrl+v and edit the filename...

Last edited 11 years ago by szaszg (previous) (diff)

comment:3 Changed 11 years ago by szaszg

The patch:

  1. lib/keybind.{h,c}
    • new command: CK_PasteSrcFilename
  2. misc/mc.{default,emacs}.keymap; src/keybind-defaults.c
    • sets ctrl-v and ctrl-insert as default hotkeys
  3. src/filemanager/filegui.c
    • new variable: file_mask_dst_id
    • new variable: file_mask_src_filename
    • new function: file_mask_dialog_cb() to handle hotkey for Copy/Move? dialog
    • changed function: file_mask_dialog()
      • store file name in file_mask_src_filename
      • use file_mask_dst_id to identify "to:" input field
      • use file_mask_dialog_cb() callback for dialog if only one file/directory used

comment:4 in reply to: ↑ 2 ; follow-up: ↓ 5 Changed 11 years ago by andrew_b

Replying to szaszg:

Replying to andrew_b:

Paste for what?

I just want to rename file '02 - J.S. Bach - Goldberg Variations, BWV 988 Recording.mka' to '02 - J.S. Bach - Goldberg Variations, BWV 988 - 1981 Recording.mka'. Now, i can do it:

Do you know about s-f5/s-f6 keys?

So more easy and less more frustrating if we just press ctrl+v and edit the filename...

Don't confuse users. c-v and s-ins are mean and used to paste text from clipboard.

comment:5 in reply to: ↑ 4 Changed 11 years ago by szaszg

Replying to andrew_b:

Replying to szaszg:

Replying to andrew_b:

Paste for what?

I just want to rename file '02 - J.S. Bach - Goldberg Variations, BWV 988 Recording.mka' to '02 - J.S. Bach - Goldberg Variations, BWV 988 - 1981 Recording.mka'. Now, i can do it:

Do you know about s-f5/s-f6 keys?

Hmm... it is not the same. With s-f5/s-f6 the target directory for copy/move is where the file exists (current_dir), not the other panel's directory (other_dir)... now, how can i copy the other_dir name into "to:"? :-(

BTW: where can i read about s-f5/s-f6? (I can't find anything in mc.man or mc.hlp) If i remember well NC just show up the appropriate commands on the "ButtonBar" when user hold Shift or ALT...

So more easy and less more frustrating if we just press ctrl+v and edit the filename...

Don't confuse users. c-v and s-ins are mean and used to paste text from clipboard.

c-v?, shift-insert? (ctrl-insert?)
I see ctrl-v for PageDown only in "panel", "listbox", "tree", "help", "viewer", "hex viewer" keymap, but not in "editor" and "diffview" keymap (confusing?)... so, ctrl-v does not work as "paste text from clipboard" at all, just as PageDown...

But what do you offer instead of ctrl-v/ctrl-ins? (i think, we have a lot of free combo for input field, and this is a particular question)

BTW. the whole "cut-and-paste" thing is confusing and so frustrating in mc (at least under X):
In editor:

  1. ctrl-insert -> copy marked text to mcedit.clip (Store)
  2. shift-del -> cut marked text to mcedit.clip (Cut)
  3. shift-insert -> paste X_PRIMARY (X primary selection) to text (Paste)
  4. shift-F5 (shift-F3) or F15 paste text from a file (by default from mcedit.clip) (InsertFile)

In input:

  1. alt-w -> copy marked text to mcedit.clip (Store)
  2. ctrl-w -> delete marked text (Remove)
  3. ctrl-y -> paste last copied text (not mcedit.clip!!!) (Yank)
  4. there is no keymap entry, but shift-insert paste X_PRIMARY (X primary selection)

So, ctrl-v do PageDown, shift-insert paste from a totally different place where ctrl-insert copy, and in an input field we have a slightly different functions and hotkeys for copy-and-paste... Sorry, but how we can confuse users more???

We cannot copy/cut to X_PRIMARY selection, we cannot copy/cut to and paste from X_CLIPBOARD selection. The most important thing under X is to reach X_CLIPBOARD not X_PRIMARY, because most "modern" applications use X_CLIPBOARD for ctrl-c/Copy/ctrl-v/Paste etc. and use X_PRIMARY for mouse selection and paste...
Other frustrating thing: when we use shift-insert (copy from X) undo (ctrl-u) do char-by-char but we paste from file (f15) undo work all-at-once...
In an input field the marking is so confusing, because marked text with cursor (black on lightgray) very similar to unmarked text with cursor (lightcyan on lightgray), so user cannot see (if e.g. MarkLeft) which chars marked exactly. (if we move the cursor than mark is disappearing - hmmm not in editor... other confusing thing)...
BTW: what is Yank in input field??? there is no Kill, and there is no Yank-pop...???

After all IMHO paste original filename into "to:" field is a very useful thing in some cases.

comment:6 Changed 11 years ago by andrew_b

  • Status changed from new to closed
  • Resolution set to duplicate

I close this ticket in favor of #1907 which is the same idea, actually.

comment:7 Changed 7 years ago by andrew_b

  • Milestone Future Releases deleted
Note: See TracTickets for help on using tickets.