Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid-function with-editor* #59

Closed
runswithd6s opened this issue Nov 13, 2018 · 5 comments
Closed

invalid-function with-editor* #59

runswithd6s opened this issue Nov 13, 2018 · 5 comments

Comments

@runswithd6s
Copy link

With a recent upgrade of magit and with-editor, I am now experiencing this error:

  Debugger entered--Lisp error: (invalid-function with-editor*)
  with-editor*("GIT_EDITOR" #<process git>)
  magit-run-git-with-editor("commit" ("--"))
  magit-commit-create(nil)
  funcall-interactively(magit-commit-create nil)
  call-interactively(magit-commit-create)
  magit-invoke-popup-action(99)
  funcall-interactively(magit-invoke-popup-action 99)
  call-interactively(magit-invoke-popup-action nil nil)
  command-execute(magit-invoke-popup-action)

Magit 20181106.1203, Git 2.11.0, Emacs 25.1.1, gnu/linux

~/.emacs.d/elpa/with-editor-20181103.2149/

Installed with use-package with the following init.el:

;;
;; An all-around Emacs experience for an all-around development and
;; entertainment environment.
;;
;; Development: clojure, clojurescript, ruby, javascript, react, emacs
;; Entertainment: mu4e (email), emms
;; ---------------------------------------------------------------------------

;; Needed to install packages
(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)
(add-to-list 'package-archives
	     '("org" . "http://orgmode.org/elpa/") t)
(package-initialize)
(package-refresh-contents)

(unless (package-installed-p 'use-package)
  (package-install 'use-package))

(load-library "~/.emacs.d/private/secrets.el.gpg")

;; ----- Helper functions -----
(defun get-string-from-file (filePath)
  "Return FILEPATH's file content."
  (with-temp-buffer
    (insert-file-contents filePath)
    (buffer-string)))

;; ----- Manage Packages -------
(use-package auto-package-update
  :ensure t
  :config
  (setq auto-package-update-delete-old-versions t)
  (setq auto-package-update-hide-results t)
  (auto-package-update-maybe))

(use-package paradox
  :ensure t
  :config
  (paradox-enable))

;; ----- Navigation -------
(use-package ace-jump-mode
  :ensure t
  :bind ("C-." . ace-jump-mode))
(use-package multiple-cursors
  :ensure t
  :bind ("C-S-C C-S-C" . mc/edit-lines))

;; ----- Shell ------
(use-package multi-term
  :ensure t)

(use-package exec-path-from-shell
  :ensure t
  :config
  (exec-path-from-shell-initialize))

;; ----- Development -------
(use-package magit
  :ensure t)

(use-package smartparens
  ;;:delight
  :ensure t
  :config
  (smartparens-global-mode 1))

(use-package rainbow-delimiters
  :delight
  :ensure t
  :hook (prog-mode . rainbow-delimiters-mode))

(use-package company
  :ensure t
  :delight
  :hook (after-init . global-company-mode))

(use-package yasnippet
  :ensure t
  :delight
  :config
  (yas-global-mode 1))

(use-package projectile
  :ensure t)

(use-package projectile-direnv
  :ensure t
  :requires projectile)

(use-package projectile-git-autofetch
  :ensure t
  :requires projectile)

(use-package org-projectile
  :ensure t
  :requires (org projectile))

;; Clojure
(use-package clojure-snippets
  :requires yasnippet
  :ensure t)

(use-package cider
  :ensure t
  :init
  (setq cider-inject-dependencies-at-jack-in t))

(use-package ob-clojurescript
  :ensure t
  :requires org)

(use-package 4clojure
  :ensure t
  :requires cider)


;; Java
(use-package java-snippets
  :requires yasnippet
  :ensure t
  )

;; React
(use-package react-snippets
  :requires yasnippet
  :ensure t)

;; Markdown
(use-package markdown-mode
  :ensure t)

;; ----- RSS -------
(use-package elfeed-org
  :ensure t
  :requires elfeed
  :config
  (setq rmh-elfeed-org-files (list "~/.emacs.d/private/elfeed.org"))
  :init
  (elfeed-org)
  )

;; ------- Entertainment ------
(use-package emms
  :ensure t
  :config
    (setq emms-score-file "~/.emacs.d/private/emms/scores"
        emms-stream-bookmarks-file "~/.emacs.d/private/emms/emms-streams"
        emms-history-file "~/.emacs.d/private/emms/emms-history"
        emms-cache-file "~/.emacs.d/private/emms/emms-cache"
        emms-source-file-default-directory "~/Music"
        emms-player-mpg321-parameters '("-o" "alsa")
        emms-player-list '(emms-player-mplayer
                           emms-player-ogg123
                           emms-player-mpg321))
    :init
    (emms-minimalistic)
    (emms-default-players))

(use-package org-chef
  :ensure t
  :requires org)


;; ----- Miscellaneous -----
(use-package password-store
  :ensure t)

;; Old eyes like a larger font
(set-face-attribute 'default nil :height 140)

;; ------- Emacs Managed Settings ------
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(ansi-color-faces-vector
   [default default default italic underline success warning error])
 '(custom-enabled-themes (quote (tango-dark)))
 '(inhibit-startup-screen t)
 '(package-selected-packages
   (quote
    (markdown-mode markdown chess gnugo magit password-store org-chef emms elfeed-org react-snippets java-snippets 4clojure ob-clojurescript cider clojure-snippets org-projectile projectile-git-autofetch projectile-direnv projectile yasnippet company rainbow-delimiters smartparens ox-reveal exec-path-from-shell multi-term multiple-cursors ace-jump-mode auto-package-update use-package)))
 '(sp-echo-match-when-invisible t))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(rainbow-delimiters-base-face ((t (:inherit nil :weight extra-bold)))))
@runswithd6s
Copy link
Author

If I "Instrument Function for Debugging" on magit-run-git-with-editor, then step through line 458 and line 459, it succeeds. If I exit emacs and re-open, the problem repeats. Somehow, I managed to get this stack trace...

* #[128 "\300\301�\"\210\300\302�\"\207" [apply debug--implement-debug-on-entry (closure (eshell-preoutput-filter-functions t) (envvar &rest body) "Use the Emacsclient as the editor while evaluating BODY.\nModify the `process-environment' for processes started in BODY,\ninstructing them to use the Emacsclient as editor.  ENVVAR is the\nenvironment variable that is exported to do so, it is evaluated\nat run-time.\n\n(fn [ENVVAR] BODY...)" (edebug-enter (quote with-editor*) (list envvar body) (function (lambda nil (edebug-after (edebug-before 0) 3 (cons ... ...)))))) ((depth . -100))] 4 nil](magit-with-editor-envvar (edebug-after (edebug-before 3) 5 (magit-run-git-async (edebug-after 0 4 args))))
  macroexpand((with-editor* magit-with-editor-envvar (edebug-after (edebug-before 3) 5 (magit-run-git-async (edebug-after 0 4 args)))) nil)
  macroexp-macroexpand((with-editor* magit-with-editor-envvar (edebug-after (edebug-before 3) 5 (magit-run-git-async (edebug-after 0 4 args)))) nil)
  macroexp--expand-all((with-editor* magit-with-editor-envvar (edebug-after (edebug-before 3) 5 (magit-run-git-async (edebug-after 0 4 args)))))
  macroexp--all-forms(((with-editor* magit-with-editor-envvar (edebug-after (edebug-before 3) 5 (magit-run-git-async (edebug-after 0 4 args))))))
  #[1028 "\300�\300\301�\302\"\303��!��\242A#��\242#\207" [macroexp--cons macroexp--all-clauses 1 macroexp--all-forms] 10 "\n\n(fn FORM BODY BINDINGS FUN)"](((let ((magit-process-popup-time -1) (shell-file-name (if (and (eq system-type (quote windows-nt)) (not magit-cygwin-mount-points)) "cmdproxy" shell-file-name))) (with-editor* magit-with-editor-envvar (edebug-after (edebug-before 3) 5 (magit-run-git-async (edebug-after 0 4 args)))))) ((with-editor* magit-with-editor-envvar (edebug-after (edebug-before 3) 5 (magit-run-git-async (edebug-after 0 4 args))))) ((magit-process-popup-time -1) (shell-file-name (if (and (eq system-type (quote windows-nt)) (not magit-cygwin-mount-points)) "cmdproxy" shell-file-name))) let)
  macroexp--expand-all((magit-with-editor (edebug-after (edebug-before 3) 5 (magit-run-git-async (edebug-after 0 4 args)))))
  macroexp--all-forms((edebug-after (edebug-before 2) 6 (magit-with-editor (edebug-after (edebug-before 3) 5 (magit-run-git-async (edebug-after 0 4 args))))) 1)
  #[514 "\300�\301\"\211\204�```

@tarsius
Copy link
Member

tarsius commented Nov 13, 2018

Try re-compiling (e.g. by re-installing) with-editor and magit (in that order).

@tarsius
Copy link
Member

tarsius commented Nov 13, 2018

The reason why it works when debugging but not otherwise might be that the uncompiled code is used when debugging but the corrupted compiled code is used otherwise. The corruption is probably due to you having updated magit before with-editor.

@tarsius
Copy link
Member

tarsius commented Nov 13, 2018

Anyway, carefully recompiling almost certainly fixes this.

@tarsius tarsius closed this as completed Nov 13, 2018
@runswithd6s
Copy link
Author

Perfect! Removed the *.elc files from both directories and modified the init.el to have a :requires with-editor. Thank you!

yewton added a commit to yewton/.emacs.d that referenced this issue Jan 29, 2020
magit/with-editor#59 に気をつけよう
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants