1

I'm a relatively new convert to emacs and a very new convert to Mac. After installing Emacs using the ESS installer (Version 18.10.2).

When I attempt to state a file for commit I receive the following error.

GitError! There was a problem with the editor '/Applications/Emacs.app/Contents/MacOS/bin/emacsclient --socket-name=/var/folders/s2/mjvyfw3d13zd8swxf8ds92c40000gn/T/emacs501/server'.  [Type `$' for details]

Pressing $ yields the following.

0 git … add -u -- inst/process.R
  1 git … commit --
hint: Waiting for your editor to close the file...
Waiting for Emacs...
*ERROR*: Wrong type argument: stringp, nil
error: There was a problem with the editor '/Applications/Emacs.app/Contents/MacOS/bin/emacsclient --socket-name=/var/folders/s2/mjvyfw3d13zd8swxf8ds92c40000gn/T/emacs501/server'.
Please supply the message using either -m or -F option.

  0 git … add -u .
  1 git … commit --
hint: Waiting for your editor to close the file...
Waiting for Emacs...
*ERROR*: Wrong type argument: stringp, nil
error: There was a problem with the editor '/Applications/Emacs.app/Contents/MacOS/bin/emacsclient --socket-name=/var/folders/s2/mjvyfw3d13zd8swxf8ds92c40000gn/T/emacs501/server'.
Please supply the message using either -m or -F option.

  • My EMACS Version
GNU Emacs 26.2 (build 1, x86_64-apple-darwin18.2.0, NS appkit-1671.20 Version 10.14.3 (Build 18D109))
 of 2019-04-12

When run with M-x toggle-on-debug-error I don't seem to get any different output.

GitError! There was a problem with the editor '/Applications/Emacs.app/Contents/MacOS/bin/emacsclient --socket-name=/var/folders/s2/mjvyfw3d13zd8swxf8ds92c40000gn/T/emacs501/server'.  [Type `$' for details]

  1 git … commit --
hint: Waiting for your editor to close the file...
Waiting for Emacs...
*ERROR*: Wrong type argument: stringp, nil
error: There was a problem with the editor '/Applications/Emacs.app/Contents/MacOS/bin/emacsclient --socket-name=/var/folders/s2/mjvyfw3d13zd8swxf8ds92c40000gn/T/emacs501/server'.
Please supply the message using either -m or -F option.

More information. From the below advice I was able to determine that commenting out the below lines in my emacs.d/init.el file allows magit to work properly.

;; (add-hook 'find-file-hook 'my-r-style-hook)
;; (defun my-r-style-hook ()
;;   (when (string-match (file-name-extension buffer-file-name) "[r|R]$")
;;     (ess-set-style 'RStudio)))
  • 1
    Does M-x toggle-debug-on-error get you a backtrace for the Wrong type argument: stringp, nil error? If so, add it to the question. – phils Sep 30 '19 at 8:10
1

Okay. I have it working now. The problem was in my attempt at a hook to set ess-set-style to RStudio automatically.

Thanks to another stackoverflow topic I saw that there was a specific ess-mode-hook I should be using

https://stackoverflow.com/questions/7502540/make-emacs-ess-follow-r-style-guide

Modifying my init.el file with the following fixes my issue with magic.

(add-hook 'ess-mode-hook
           (lambda ()
             (ess-set-style 'RStudio)))

Thanks to everyone for their patience in helping me muddle through this.

| improve this answer | |
0

Some type error has occurred. Based on basically "when committing I get Wrong type argument: stringp, nil" it is very hard to know where exactly that error occurred so without you helping us help you that's all we can say.

Except maybe adding general debugging advice. You should start by trying to reproduce the issue starting from emacs -Q. We provide a tool to make that easier, see https://magit.vc/manual/2.11.0/magit/Debugging-Tools.html.

| improve this answer | |
  • Thanks for the advice. I ran emacs using the -Q argument as you suggested and the commit worked fine. So from that, I suppose the problem lies outside magic and its dependencies. – Duncan Ellis Oct 26 '19 at 21:50
  • From the above advice on running emacs with the -Q argument I did some more investigating and determined that the issue is with something in my /emacs.d/init.el file. I'll start narrowing it down via process of elimination – Duncan Ellis Oct 26 '19 at 22:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.