ergoemacs / ergoemacs-mode

ergoemacs-mode
ergoemacs.github.io/
GNU General Public License v3.0
293 stars 35 forks source link

problem with menu c and menu v copy/paste #305

Closed xahlee closed 10 years ago

xahlee commented 10 years ago

s.huchler filed a bug here https://code.google.com/p/ergoemacs/issues/detail?id=151 i think it's related to ergoemacs-mode.

mattfidler commented 10 years ago

I can't reproduce this. I even have a test that passes for this issue.

spiderbit commented 10 years ago

now I am a bit confused,

if I do work with normal marks, like menu + space move with the cursor a bit to get a selction and press then menu again, the selection stays and it works like it should.

But when I select something with the mouse not. In some modes I can select stuff with shift up or down that works not too.

What is the supported method, wasnt it supposed to work like in most other editors with mouse selection or with shift + direction-key? I think that did work I am right there yes?

So at least I have a workaround, use the modifier-space set-mark function.

spiderbit commented 10 years ago

it gets always stranger... now I can select some text again with shift and if I press then alt+a it stays selected but with menu key not.

pfff I have to investegate it further...

mattfidler commented 10 years ago

It is supposed to work. If I can figure out why I will fix it. On Aug 29, 2014 3:37 PM, "Stefan Huchler" notifications@github.com wrote:

it gets always stranger... now I can select some text again with shift and if I press then alt+a it stays selected but with menu key not.

pfff I have to investegate it further...

— Reply to this email directly or view it on GitHub https://github.com/ergoemacs/ergoemacs-mode/issues/305#issuecomment-53927015 .

mattfidler commented 10 years ago

I

mattfidler commented 10 years ago

I tried to reproduce with shift select but could not. I will write a test for the shift select possibility... I will try with the mouse by Tuesday.

spiderbit commented 10 years ago

hmm I think I get closer to the problem playing around with commenting out and in some lines, at the moment with my config ergoemacs 5 times at start (dont know why) and spits such messages:

Respecting Key print (; [print]) Respecting Key Alt+print (; [(meta print)]) Respecting Key ⇧Shift+print (; [(shift print)])

and starting takes forever. But if I start emacs without config and eval only the ergoemacs config lines that doesnt happen, it basicly work then as it should.

One problem I think I had when I tried to debug it, is that its a two part Problem.

  1. even if region select works, at least here I loose it opticaly. So if I only load ergoemacs Menu C Menu V in reallity works, it just fades away the selection on the screen but it then copies the part that was selected. That I guess made me falsely belive that it did not work with pure ergoemacs-mode loaded.
  2. with full config it does not work at all

At the moment I cannot even shift-select at all. With a bit luck I find the problematic setting in next 15 mins and maybe then it works and you can close this bug.

spiderbit commented 10 years ago

k I come closer to the solution. If I manually eval this:

(setq shift-select-mode t)

after emacs start, it works. if its only in the config even as last line, after start is done its set to nil.

ok lol I think I found partialy the problem, my config did load 5 times ergoemacs mode because I have desktopmode activated and it loads the desktop file, several buffers that look like that:

(desktop-create-buffer 206 "/home/black/.emacs.d/init.el" "init.el" 'emacs-lisp-mode '(ergoemacs-mode magit-auto-revert-mode projectile-mode)

that of course sabotises my config a bit, when I comment out ergoemacs mode for testing this desktopfile loads it anyway :)

So ok when I comment that out, shift-select-mode is not overwritten, when I comment in ergoemacs block shift-select-mode t is overwritten.

Is ergoemacs supposed to do that, or is it a bug, or cant u reproduce that?

spiderbit commented 10 years ago

to make it short:

I think ergoemacs sets shift-select-mode to nil, even when I set it explizitly to t.

I think thats a bug?

mattfidler commented 10 years ago

Yes it is a bug. When I run it shift select is enabled. On Aug 30, 2014 11:53 AM, "Stefan Huchler" notifications@github.com wrote:

to make it short:

I think ergoemacs sets shift-select-mode to nil, even when I set it explizitly to t.

I think thats a bug?

— Reply to this email directly or view it on GitHub https://github.com/ergoemacs/ergoemacs-mode/issues/305#issuecomment-53963941 .

mattfidler commented 10 years ago

I noticed that customize also loads ergoemacs mode multiple times.

mattfidler commented 10 years ago

I saw a similar issue with smex. I am going to try to fix it and add a test for it as soon as I can. On Aug 30, 2014 12:51 PM, "Matthew Fidler" matthew.fidler@gmail.com wrote:

Yes it is a bug. When I run it shift select is enabled. On Aug 30, 2014 11:53 AM, "Stefan Huchler" notifications@github.com wrote:

to make it short:

I think ergoemacs sets shift-select-mode to nil, even when I set it explizitly to t.

I think thats a bug?

— Reply to this email directly or view it on GitHub https://github.com/ergoemacs/ergoemacs-mode/issues/305#issuecomment-53963941 .

spiderbit commented 10 years ago

yes I had to kick out smex from my ini else I got a error message with menu+enter or pressing alt+a

mattfidler commented 10 years ago

smex works now. Probably shift-select works too.

spiderbit commented 10 years ago

I test it next hours here

spiderbit commented 10 years ago

yes I can select again text with shift+select so I guess its fixed!

spiderbit commented 10 years ago

hmm ok it still has a small problem... yes if I select the text... then press alt+a it keeps selected and I can do things to the region.

When I press the menu key in general it works too, but opticaly the selection goes away I stop seeing what I did select and then I get unsure if its working or not after the next update. u have then test it.

Would be better if opticaly the selection would not go away.

And another point if I select text press alt+a and press then esc the text is still selected and as example I can make the selection bigger shift shift down. with menu key the selection is gone.

I dont know if thats easy to fix but I think it would be better if pressing menu key would work similar to pressing alt+a if nothing else colides with that?

mattfidler commented 10 years ago

I can't reproduce what you describe. Perhaps you can help me with a recipie on how to produce it.

spiderbit commented 10 years ago

hmm so when u select some text in a buffer and u press menu key with ergoemacs layout and u press the menu key (on a normal keybaord the key between alt and command) the selection stays on the text?

I try it with a empty config again... so with a empty keyboard menu is mapped to alt+x there the selection does not go away. with ergoemacs activated so evaluated this:

(require 'package) (package-initialize) (require 'ergoemacs-mode) (ergoemacs-mode 1

pressing menu key cancels the selection.

  1. I select some text with mouse or shift move
  2. press menu key result: the blue background that marks the selected text goes away.

I also find it interesting that if I use mark-paragraph that does not happen, or when I press menu +space and press then shift + down and then menu key it stays selected.

Is that helping u or do u need something else from me? can I make a video with showing my keys pressed, what package do I need to show my pressed keys :)

mattfidler commented 10 years ago

No it is helpful.

On Fri, Sep 5, 2014 at 8:18 AM, Stefan Huchler notifications@github.com wrote:

hmm so when u select some text in a buffer and u press menu key with ergoemacs layout and u press the menu key (on a normal keybaord the key between alt and command) the selection stays on the text?

I try it with a empty config again... so with a empty keyboard menu is mapped to alt+x there the selection does not go away. with ergoemacs activated so evaluated this:

(require 'package) (package-initialize) (require 'ergoemacs-mode) (ergoemacs-mode 1

pressing menu key cancels the selection.

  1. I select some text with mouse or shift move
  2. press menu key result: the blue background that marks the selected text goes away.

I also find it interesting that if I use mark-paragraph that does not happen, or when I press menu +space and press then shift + down and then menu key it stays selected.

Is that helping u or do u need something else from me? can I make a video with showing my keys pressed, what package do I need to show my pressed keys :)

— Reply to this email directly or view it on GitHub https://github.com/ergoemacs/ergoemacs-mode/issues/305#issuecomment-54623380 .

mattfidler commented 10 years ago

Should be fixed?

spiderbit commented 10 years ago

no its not working yet...

ergoemacs-force-shift-select-mark-active do I have to set that somehow?

ergoemacs-force-shift-select-mark-active's value is nil

or is that normal :) did try it again with only the lines evaluated on a new emacs instance. Sorry does not work

mattfidler commented 10 years ago

Do you have cua-mode enabled?

Did you delete the elc files?

Did you try from a blank emacs session?

I tried from a clean ergoemacs-mode session (You can get there easily by pressing <menu> g <menu> g <menu> h z) and could not reproduce the result any longer.

spiderbit commented 10 years ago

lol menu g menu g menu h z gave me worg type of argument stringp, nil.

But cua-mode did the trick. if its activated it works.

should it work without cua-mode? or should cua-mode get loaded from ergoemacs-mode?

Or whats the relation between cuamode and ergoemacs?

hmm ok without cua-mode and without ergoeamcs mode I cant select text with shift. But with mouse I still can select it, and process the selection.

I am not shure how to solve that make cua-mode a dependency?

mattfidler commented 10 years ago

It should work without cua-mode. Cua-mode handles shift selection differently than standard emacs. I was told by Stephan Monnier, that this is no longer the case in emacs 24.4

mattfidler commented 10 years ago

That is cua-mode no longer implements its own shift-selection.

mattfidler commented 10 years ago

cua-mode actually deactivates shift-selection. So if you start cua-mode and then disable it, I think you have to reactivate shift-select-mode. This is done by evaluating (setq shift-select-mode t)

spiderbit commented 10 years ago

hmm its a bit strange I dont even see if cua-mode is activated. all I know is that when I now start emacs it works like it should with my normal config :)

But I am not 100% shure if cuamode is activated somewhere or not. it sucks taht in the minor-mode list u dont see global modes.

But I think its fixed then. again at least my standard config works :)

spiderbit commented 10 years ago

lol again it works only with cua-mode activated just tested it with a fresh emacs instance with only evaluating the ergoemacs parts.

even shift-select-mode does not help, only if I start cua-mode it works.

now I wonder why does it work now with my normal config, I guess I somewhere load cua-mode.

I dont now hard to debug further, it works for me, 24.4 either fix it or breaks it for everybody I think :)

spiderbit commented 10 years ago

I think u maybe can close this for now...