ergoemacs / ergoemacs-mode

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

Ergoemacs advices gives and "args out of range [0]" error when compiling #309

Closed abelardojarab closed 9 years ago

abelardojarab commented 10 years ago
(defun ergoemacs-global-set-key-after (key)
  (if ergoemacs-ignore-advice nil
    (let ((kd (key-description key)))
      (ignore-errors ---> had to add this line, but memq is giving an error
        (unless (or (and (vectorp key)
                       (memq (elt key 0) '(menu-bar 27 remap)))
                  ;; FIXME: don't unbind for packages that use
                  ;; global-set-key.  Like undo-tree
                  (and (not (vectorp key))
                       (string= "ESC" kd)))
        ;; Let `ergoemacs-mode' know these keys have changed.
        (pushnew kd ergoemacs-global-changed-cache :test 'equal)
        (setq ergoemacs-global-not-changed-cache (delete kd ergoemacs-global-not-changed-cache))
        ;; Remove the key from `ergoemacs-mode' bindings
        (ergoemacs-theme-component--ignore-globally-defined-key key t)))
      )))
mattfidler commented 10 years ago

What version of emacs?

abelardojarab commented 10 years ago

24.3

mattfidler commented 10 years ago

That's strange. It compiles cleanly in the test suite. It also compiles cleanly in batch mode. Are you installing the package from melpa?

mattfidler commented 10 years ago

Are you still having this issue?

abelardojarab commented 10 years ago

Haven't tried with latest version but 5 days ago still happening I used version from git I don't use melpa

abelardojarab commented 10 years ago

Thank you for following

mattfidler commented 10 years ago

Did you try make from the command line?

abelardojarab commented 10 years ago

Yes, and it compiles correctly. So sorry for delay in answering, will be super fast in future.

But when I start emacs, it gives that error, so it is not a compilation error but a runtime error.

I have my own emacs config/plugins repository at:

http://gibhub.com/abelardojarab/emacsfull

I constantly copy your repository there and compile your ergoemacs (btw it is very very nice), but the issue now it is if I dont modify this function

(defun ergoemacs-global-set-key-after (key)
(if ergoemacs-ignore-advice nil
(let ((kd (key-description key)))

then I get the error and Emacs doesnt load properly, could you please check.. thanks much

you can use my repository to see what happens, btw in my repository the ergoemacs-global-set-key-after function is already modified and the error doesnt happen, so you may need to use the original version of this function.

Thanks!

mattfidler commented 10 years ago

I don't remember the code at the top. I reread it, and modified it slightly. I see no major issues with ignoring the errors.

Let me know if this works for you.

abelardojarab commented 10 years ago

Now it works perfect, thanks a lot :)