ergoemacs / ergoemacs-mode

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

M-s does not work with icicles #372

Closed sg2002 closed 8 years ago

sg2002 commented 9 years ago

Basically if you have (require 'icicles) M-s gets treated like a prefix and would not switch between windows. M-S-s shifting backwards works.

mattfidler commented 9 years ago

It should work now.

mattfidler commented 9 years ago

ae2cb9b408559c9805b41fbcd4fd2edddb20ac88 fixed a similar issue

sg2002 commented 9 years ago

Now this works similarly to #369. That is - after you add or remove require to(from) your config, it does not work on the first load, starts working on the second.

mattfidler commented 9 years ago

Does it give a similar backtrace?

mattfidler commented 9 years ago

I confirmed the bug. Commit 27e9b600f0e7233a00cf4b55169b0382355a8e7f fixes it but makes it a bit slower. It needs to be optimized.

mattfidler commented 9 years ago

I think it is fixed, with similar times to lookup maps.

mattfidler commented 9 years ago

Need a test for this issue.

mattfidler commented 9 years ago

Let me know if it works for you.

sg2002 commented 9 years ago

This issue still happens. Both in the current master and ed53fbe

mattfidler commented 9 years ago

Have you tried resetting the key cache?

This is done by Alt+a ergoeamcs-mode-clear-cache

Or by looking in ~/.emacs.d/var/pcache/ and deleting everything that has ergoemacs-mode in the name.

When I tested with icicles it worked. How do you run icy mode?

On Sat, Oct 17, 2015, 10:24 AM sg2002 notifications@github.com wrote:

This issue still happens. Both in the current master and ed53fbe https://github.com/ergoemacs/ergoemacs-mode/commit/ed53fbe8945074f41f1869b236e0dbbdc62b624b

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

mattfidler commented 8 years ago

You could also try removing ergoemacs-mode's elc files. Perhaps that will fix the issue for you?

dawid-aurobit commented 8 years ago

I could confirm that issue. I'm using Emacs 24.5.2 and following ~/.emacs.d/init.el:

;; el-get

(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil 'noerror)
  (with-current-buffer
      (url-retrieve-synchronously
       "https://raw.githubusercontent.com/dimitri/el-get/master/el-get-install.el")
    (goto-char (point-max))
    (eval-print-last-sexp)))

;; ergoemcacs

(el-get-bundle! ergoemacs-mode)

M-S-s shifting backwards works as well as other ergoemacs short-cuts. M-s gets treated like a prefix and would not switch between windows.

mattfidler commented 8 years ago

Yes. I did reproduce it earlier, but haven't been able to reproduce it since. I am running 24.5.1 under windows, though. Was there another release of 24.5?

So this is a minimal configuration? I haven't used el-get in awhile. Did you remove all the elc files and start with a clean emacs? What is the load order for ergoemacs and icy. (Is one first the other second). I don't think it should matter, but it may.

mattfidler commented 8 years ago

That is I havent reproduced it since I submitted the fix 27e9b600f0e7233a00cf4b55169b0382355a8e7f

dawid-aurobit commented 8 years ago

I just preformed following test:

Issue is still there. Even without icicles.

My temporary workaround is (global-set-key (kbd "M-s") 'ergoemacs-move-cursor-next-pane) at the end of init.el :sunglasses:

There was no another release of emacs. I have messed up version numbers.

mattfidler commented 8 years ago

Strange. I will have to see if I can reproduce it.

sg2002 commented 8 years ago

I can still repeatedly reproduce this issue. You only need bare bones config that requires ergoemacs. My ergoemacs folder is not compiled. This happens when there's no ergoemacs.gz file in /var/pcache/. After the first run that file gets created and I guess that's the reason it starts working. I'm running the same windows version of emacs. Also, there's another ergoemacs.gz file that gets created, in ergoemacs folder.

mattfidler commented 8 years ago

So, when there is a ergoemacs*.gz in var/pcache/, the M-s works. Is that correct?

I cannot reproduce it still. However, I start using colemak layout with reduction theme, and then switch to the us layout with standard theme. What theme/layout combination are you using?

The ergoemacs*.gz is ergoemacs-mode's knowledge of emacs' default keys based on the version that you are running. If you don't have this file, it will be created. It may change from time to time depending on what ergoemacs-mode wants to capture about the default keymaps in play.

I pushed some fixes to the cache and the labeling of keymaps, but am unsure if this will fix the issue.

sg2002 commented 8 years ago

I've tried the current version, the issue still appears, but now only under very specific circumstances. Here's the config:

(require 'icicles)
(require 'ergoemacs-mode)
(ergoemacs-mode 1)
(setq icicle-search-key-prefix (kbd "C-f"))
(icy-mode 1)

Both last lines are required.

Here's the part of icicles manual that deals with that prefix. I find it logical to rebind it to C-f, since I already have M-y for isearch.

sg2002 commented 8 years ago

I've found another key that is broken in a similar way. It's M-g. Again, only happens when you have (icy-mode 1) in your init.

mattfidler commented 8 years ago

Try enabling icy mode before loading ergoemacs-mode

On Sat, Mar 12, 2016, 10:43 PM sg2002 notifications@github.com wrote:

I've found another key that is broken in a similar way. It's M-g. Again, only happens when you have (icy-mode 1) in your init.

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

sg2002 commented 8 years ago

Ok, this helped with M-s. M-g still gets broken if icy-mode is enabled during init.

Also keys that use icicle-search-key-prefix do not get picked up. In the old version of ergoemacs I used a theme component to reclaim C-f from ergoemacs:

(ergoemacs-theme-component reclaim-C-f ()
  "We need to give at least one sequence to reclaim C-f from isearch and get the new icicle-search-key-prefix picked up."
  (global-set-key (kbd "C-f .") 'isearch-forward-symbol-at-point))
(ergoemacs-require 'reclaim-C-f)

In conjunction with (setq icicle-search-key-prefix (kbd "C-f")) this used to work.

sg2002 commented 8 years ago

Just found another case when M-s bug appears. Whenever there is (require 'outshine), the bug occurs when it's after (setq icicle-search-key-prefix (kbd "C-f")). I guess you probably have some outshine-specific code in ergoemacs that comes in conflict with icicles-specific code.

sg2002 commented 8 years ago

Same thing with (require 'tramp).

sg2002 commented 8 years ago

Found another one, (require 'virtualenvwrapper). That's a pretty obscure package...

mattfidler commented 8 years ago

M-s works with icicles now. C-f doesn't work out of the box

mattfidler commented 8 years ago

bb6ced188b9ea05928e136ff7f42d1929d32ea6d should allow C-f to work out of the box.

mattfidler commented 8 years ago

Unfortunately it seems to break other things...

sg2002 commented 8 years ago

Can confirm that M-g and M-s now always work.

Also I've found another icicles-specific thing that does not work anymore. Those minibuffer bindings. I was able to fix it in my config like this:

(ergoemacs-theme-component icicles-minibuffer ()
  ""
  (add-hook
   'icicle-minibuffer-setup-hook
   '(lambda ()
      (define-key minibuffer-local-map (kbd "<f11>") 'previous-history-element)
      (define-key minibuffer-local-map (kbd "M-<f11>") 'icicle-insert-history-element)
      (define-key minibuffer-local-map (kbd "<f12>") 'next-history-element)
      (define-key minibuffer-local-map (kbd "S-<f11>") 'next-history-element)
      (define-key minibuffer-local-map (kbd "M-<f12>") 'icicle-insert-history-element)
      (define-key minibuffer-local-map (kbd "S-<f12>") 'previous-history-element))))
(ergoemacs-require 'icicles-minibuffer)
sg2002 commented 8 years ago

Found another small, but pretty baffling issue that happens when you have icicles and ergoemacs together. I have this function in my init that i use sometimes:

(defun delete-this-buffer-and-file ()
  "Removes file connected to current buffer and kills buffer."
  (interactive)
  (let ((filename (buffer-file-name))
        (buffer (current-buffer))
        (name (buffer-name)))
    (if (not (and filename (file-exists-p filename)))
        (error "Buffer '%s' is not visiting a file!" name)
      (when (yes-or-no-p "Are you sure you want to remove this file? ")
        (delete-file filename)
        (kill-buffer buffer)
        (message "File '%s' successfully removed" filename)))))

With ergoemacs+icicles this freezes emacs to death.

mattfidler commented 8 years ago

Great. I have opened bugs on the other issues (#406 and #407)