nonsequitur / git-gutter-plus

147 stars 18 forks source link

wrong-number-of-arguments error on package update #20

Closed buster closed 9 years ago

buster commented 9 years ago

Everytime i run package-list, mark all upgrades and press X to run those upgrades i get an error, so the updates don't run. I've found that this is not happening when disabling the git gutter global mode.

Debugger entered--Lisp error: (wrong-number-of-arguments nil 0)
  signal(wrong-number-of-arguments (nil 0))
  git-gutter+-process-diff("/home/buster/.emacs.d/elpa/web-mode-20150304.1240/web-mode-autoloads.el")
  git-gutter+-refresh()
  git-gutter+-mode(t)
  git-gutter+-turn-on()
  run-hooks(find-file-hook)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer web-mode-autoloads.el> "~/.emacs.d/elpa/web-mode-20150304.1240/web-mode-autoloads.el" nil nil "~/projects/dotfiles/.emacs.d/elpa/web-mode-20150304.1240/web-mode-autoloads.el" (15593875 17))
  find-file-noselect("/home/buster/.emacs.d/elpa/web-mode-20150304.1240/web-mode-autoloads.el")
  autoload-find-generated-file()
  update-directory-autoloads("/home/buster/.emacs.d/elpa/web-mode-20150304.1240")
  package-generate-autoloads(web-mode "/home/buster/.emacs.d/elpa/web-mode-20150304.1240")
  package--make-autoloads-and-stuff([cl-struct-package-desc web-mode (20150304 1240) "major mode for editing web templates" nil single "melpa" nil ((:url . "http://web-mode.org") (:keywords "languages")) nil] "/home/buster/.emacs.d/elpa/web-mode-20150304.1240")
  package-unpack([cl-struct-package-desc web-mode (20150304 1240) "major mode for editing web templates" nil single "melpa" nil ((:url . "http://web-mode.org") (:keywords "languages")) nil])
  package-install-from-archive([cl-struct-package-desc web-mode (20150304 1240) "major mode for editing web templates" nil single "melpa" nil ((:url . "http://web-mode.org") (:keywords "languages")) nil])
  mapc(package-install-from-archive ([cl-struct-package-desc web-mode (20150304 1240) "major mode for editing web templates" nil single "melpa" nil ((:url . "http://web-mode.org") (:keywords "languages")) nil]))
  package-download-transaction(([cl-struct-package-desc web-mode (20150304 1240) "major mode for editing web templates" nil single "melpa" nil ((:url . "http://web-mode.org") (:keywords "languages")) nil]))
  package-install([cl-struct-package-desc web-mode (20150304 1240) "major mode for editing web templates" nil single "melpa" nil ((:url . "http://web-mode.org") (:keywords "languages")) nil])
  mapc(package-install ([cl-struct-package-desc web-mode (20150304 1240) "major mode for editing web templates" nil single "melpa" nil ((:url . "http://web-mode.org") (:keywords "languages")) nil] [cl-struct-package-desc json-reformat (20150305 1231) "Reformatting tool for JSON" nil single "melpa" nil ((:url . "https://github.com/gongo/json-reformat") (:keywords "json")) nil] [cl-struct-package-desc js2-mode (20150304 1821) "Improved JavaScript editing mode" ((emacs (24 1)) (cl-lib (0 5))) tar "melpa" nil ((:url . "https://github.com/mooz/js2-mode/") (:keywords "languages" "javascript")) nil] [cl-struct-package-desc ido-ubiquitous (20150305 2254) "Use ido (nearly) everywhere." ((emacs (24 1))) single "melpa" nil ((:url . "https://github.com/DarwinAwardWinner/ido-ubiquitous") (:keywords "convenience" "completion" "ido")) nil] [cl-struct-package-desc helm-ag (20150304 2007) "the silver searcher with helm interface" ((helm (1 5 6)) (cl-lib (0 5))) single "melpa" nil ((:url . "https://github.com/syohex/emacs-helm-ag")) nil] [cl-struct-package-desc helm (20150305 1205) "Helm is an Emacs incremental and narrowing framework" ((emacs (24)) (cl-lib (0 5)) (async (1 2))) tar "melpa" nil nil nil] [cl-struct-package-desc company (20150304 904) "Modular text completion framework" ((emacs (24 1)) (cl-lib (0 5))) tar "melpa" nil ((:url . "http://company-mode.github.io/") (:keywords "abbrev" "convenience" "matching")) nil] [cl-struct-package-desc anzu (20150305 553) "Show number of matches in mode-line while searching" ((cl-lib (0 5)) (emacs (24))) single "melpa" nil ((:url . "https://github.com/syohex/emacs-anzu")) nil]))
  package-menu-execute()
  #<subr call-interactively>(package-menu-execute nil nil)
  ad-Advice-call-interactively(#<subr call-interactively> package-menu-execute nil nil)
  apply(ad-Advice-call-interactively #<subr call-interactively> (package-menu-execute nil nil))
  call-interactively(package-menu-execute nil nil)
  command-execute(package-menu-execute)

I think i sometimes (but only sometimes) get an error in find-files, but i can reproduce this behaviour 100% with list-packages.

buster commented 9 years ago

Also, package updates used to work for some time with git-gutter+, so it is possible to be a bug introduced in one of the later commits? Can't tell exactly when this started to appearing though :(

nonsequitur commented 9 years ago

This looks exactly like issue 16. Are you using Emacs 25?

buster commented 9 years ago

I am using Emacs 24.4.1 from Debian with prelude and emacs in daemon mode, running "emacsclient".. But running emacs in non-daemon mode shows the same error..

nonsequitur commented 9 years ago

Could you try the following (copy-pasted from issue 16)?

Please try to load the uncompiled source by adding to following to your config: (load "path/to/git-gutter+.el")

That should give a more detailed backtrace. Right now, I can't see which function call is failing.

buster commented 9 years ago

Ok.. trying to install ac-helm now leads to this:

Debugger entered--Lisp error: (wrong-number-of-arguments nil 0)
  signal(wrong-number-of-arguments (nil 0))
  (if (= (length --cl-rest--) 2) (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--)))) (signal (quote wrong-number-of-arguments) (list nil (length --cl-rest--))))
  (let* ((--cl-rest-- (git-gutter+-diff curfile)) (diff-header (if (= (length --cl-rest--) 2) (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--)))) (signal (quote wrong-number-of-arguments) (list nil (length --cl-rest--))))) (diffinfos (car --cl-rest--))) (setq git-gutter+-diff-header diff-header git-gutter+-diffinfos diffinfos) (save-restriction (widen) (funcall git-gutter+-view-diff-function diffinfos)))
  (progn (let* ((--cl-rest-- (git-gutter+-diff curfile)) (diff-header (if (= (length --cl-rest--) 2) (car-safe (prog1 --cl-rest-- (setq --cl-rest-- ...))) (signal (quote wrong-number-of-arguments) (list nil (length --cl-rest--))))) (diffinfos (car --cl-rest--))) (setq git-gutter+-diff-header diff-header git-gutter+-diffinfos diffinfos) (save-restriction (widen) (funcall git-gutter+-view-diff-function diffinfos))))
  git-gutter+-process-diff("/home/buster/.emacs.d/elpa/ac-helm-20140919.917/ac-helm-autoloads.el")
  (if (file-remote-p file) (let* ((repo-root (git-gutter+-root-directory file)) (default-directory (git-gutter+-remote-default-directory repo-root file))) (git-gutter+-process-diff (git-gutter+-remote-file-path repo-root file))) (git-gutter+-process-diff (git-gutter+-local-file-path file)))
  (progn (if (file-remote-p file) (let* ((repo-root (git-gutter+-root-directory file)) (default-directory (git-gutter+-remote-default-directory repo-root file))) (git-gutter+-process-diff (git-gutter+-remote-file-path repo-root file))) (git-gutter+-process-diff (git-gutter+-local-file-path file))))
  (if (and file (file-exists-p file)) (progn (if (file-remote-p file) (let* ((repo-root (git-gutter+-root-directory file)) (default-directory (git-gutter+-remote-default-directory repo-root file))) (git-gutter+-process-diff (git-gutter+-remote-file-path repo-root file))) (git-gutter+-process-diff (git-gutter+-local-file-path file)))))
  (let ((file (buffer-file-name))) (if (and file (file-exists-p file)) (progn (if (file-remote-p file) (let* ((repo-root (git-gutter+-root-directory file)) (default-directory (git-gutter+-remote-default-directory repo-root file))) (git-gutter+-process-diff (git-gutter+-remote-file-path repo-root file))) (git-gutter+-process-diff (git-gutter+-local-file-path file))))))
  git-gutter+-refresh()
  (progn (git-gutter+-add-local-hooks) (git-gutter+-refresh))
  (if (and (git-gutter+-file-buffer-p) (git-gutter+-in-git-repository-p (buffer-file-name))) (progn (git-gutter+-add-local-hooks) (git-gutter+-refresh)) (if (called-interactively-p (quote any)) (message "No Git repo for current buffer")) (git-gutter+-mode -1))
  (if git-gutter+-mode (if (and (git-gutter+-file-buffer-p) (git-gutter+-in-git-repository-p (buffer-file-name))) (progn (git-gutter+-add-local-hooks) (git-gutter+-refresh)) (if (called-interactively-p (quote any)) (message "No Git repo for current buffer")) (git-gutter+-mode -1)) (git-gutter+-remove-local-hooks) (git-gutter+-clear))
  (let ((last-message (current-message))) (setq git-gutter+-mode (if (eq arg (quote toggle)) (not git-gutter+-mode) (> (prefix-numeric-value arg) 0))) (if git-gutter+-mode (if (and (git-gutter+-file-buffer-p) (git-gutter+-in-git-repository-p (buffer-file-name))) (progn (git-gutter+-add-local-hooks) (git-gutter+-refresh)) (if (called-interactively-p (quote any)) (message "No Git repo for current buffer")) (git-gutter+-mode -1)) (git-gutter+-remove-local-hooks) (git-gutter+-clear)) (run-hooks (quote git-gutter+-mode-hook) (if git-gutter+-mode (quote git-gutter+-mode-on-hook) (quote git-gutter+-mode-off-hook))) (if (called-interactively-p (quote any)) (progn nil (if (and (current-message) (not (equal last-message (current-message)))) nil (message "Git-Gutter+ mode %sabled" (if git-gutter+-mode "en" "dis"))))))
  git-gutter+-mode(t)
  (progn (git-gutter+-mode t))
  (if (and (buffer-file-name) (not (memq major-mode git-gutter+-disabled-modes)) (not git-gutter+-mode)) (progn (git-gutter+-mode t)))
  git-gutter+-turn-on()
  run-hooks(find-file-hook)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer ac-helm-autoloads.el> "~/.emacs.d/elpa/ac-helm-20140919.917/ac-helm-autoloads.el" nil nil "~/projects/dotfiles/.emacs.d/elpa/ac-helm-20140919.917/ac-helm-autoloads.el" (15607993 17))
  find-file-noselect("/home/buster/.emacs.d/elpa/ac-helm-20140919.917/ac-helm-autoloads.el")
  autoload-find-generated-file()
  update-directory-autoloads("/home/buster/.emacs.d/elpa/ac-helm-20140919.917")
  package-generate-autoloads(ac-helm "/home/buster/.emacs.d/elpa/ac-helm-20140919.917")
  package--make-autoloads-and-stuff([cl-struct-package-desc ac-helm (20140919 917) "Helm interface for auto-complete" ((helm (1 6 3)) (auto-complete (1 4 0)) (popup (0 5 0)) (cl-lib (0 5))) single "melpa" nil ((:keywords "completion" "convenience" "helm")) nil] "/home/buster/.emacs.d/elpa/ac-helm-20140919.917")
  package-unpack([cl-struct-package-desc ac-helm (20140919 917) "Helm interface for auto-complete" ((helm (1 6 3)) (auto-complete (1 4 0)) (popup (0 5 0)) (cl-lib (0 5))) single "melpa" nil ((:keywords "completion" "convenience" "helm")) nil])
  package-install-from-archive([cl-struct-package-desc ac-helm (20140919 917) "Helm interface for auto-complete" ((helm (1 6 3)) (auto-complete (1 4 0)) (popup (0 5 0)) (cl-lib (0 5))) single "melpa" nil ((:keywords "completion" "convenience" "helm")) nil])
  mapc(package-install-from-archive ([cl-struct-package-desc ac-helm (20140919 917) "Helm interface for auto-complete" ((helm (1 6 3)) (auto-complete (1 4 0)) (popup (0 5 0)) (cl-lib (0 5))) single "melpa" nil ((:keywords "completion" "convenience" "helm")) nil]))
  package-download-transaction(([cl-struct-package-desc ac-helm (20140919 917) "Helm interface for auto-complete" ((helm (1 6 3)) (auto-complete (1 4 0)) (popup (0 5 0)) (cl-lib (0 5))) single "melpa" nil ((:keywords "completion" "convenience" "helm")) nil]))
  package-install([cl-struct-package-desc ac-helm (20140919 917) "Helm interface for auto-complete" ((helm (1 6 3)) (auto-complete (1 4 0)) (popup (0 5 0)) (cl-lib (0 5))) single "melpa" nil ((:keywords "completion" "convenience" "helm")) nil])
  package-install-button-action(#<marker (moves after insertion) at 75 in *Help*>)
  button-activate(#<marker (moves after insertion) at 75 in *Help*> nil)
  push-button(75)
  push-button((mouse-2 (#<window 8 on *Help*> 75 (329 . 44) 4828461 nil 75 (40 . 2) nil (7 . 8) (0 . 18))))
  #<subr call-interactively>(push-button nil nil)
  ad-Advice-call-interactively(#<subr call-interactively> push-button nil nil)
  apply(ad-Advice-call-interactively #<subr call-interactively> (push-button nil nil))
  call-interactively(push-button nil nil)
  command-execute(push-button)
buster commented 9 years ago

Ok, i think it has definitely to do with symlinks. My .emacs.d directory is a symlink to a repository where i keep my dot files. Now, the during the updates something like find-file is running in the symlink and triggering this bug in git-gutter+.

When i run find-file and point it to another symlink i get the same error. But only when the symlink is not a symlink to a file in the same directory (i think).

Hope that helps.

nonsequitur commented 9 years ago

That helped, thanks!

I'll fix this in the next release. Meanwhile, here's a super quick fix which disables git-gutter+ on symlinked files.

buster commented 9 years ago

Great, i'll just disable git gutter during package updates for now, since luckily, i don't edit symlinked files too often.. :)

buster commented 9 years ago

How about releasing a fixed version?

nonsequitur commented 9 years ago

Here's the latest news on symlinks.