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

Errors running in terminal emacs #50

Closed
Trepanated opened this issue Oct 29, 2014 · 16 comments
Closed

Errors running in terminal emacs #50

Trepanated opened this issue Oct 29, 2014 · 16 comments
Labels

Comments

@Trepanated
Copy link

I'm running emacs 24.4 in Terminal.app on OS X 10.9 (Mavericks). I've run into a series of issues that seem to be related to calling functions not available in terminal mode, starting with this appearing in the Warnings buffer:

Symbol's function definition is void: tool-bar-mode

That's from line 52 of spacemacs/config.el. I changed it to the following which seems to resolve the issue:

(if (functionp 'tool-bar-mode) (tool-bar-mode 0))

Same error on line 56 with scroll-bar-mode, similar fix applied.

That gets me as far as fetching and installing packages, but then this appears:

Symbol's function definition is void: define-fringe-bitmap

That one seemed a bit more involved so I did not attempt a fix.

@syl20bnr
Copy link
Owner

Thank you @Trepanated for the report.

Those warnings are weird, it's like Emacs believes that your run in a graphical environment instead of inside a terminal.

Do you use emacs -nw to launch emacs in your terminal ? What build of emacs do you have (brew, macports or other) ?

@syl20bnr
Copy link
Owner

@Trepanated It works here in terminal.app (OS X 10.10) with emacs -nw and a brew build of Emacs 24.4.

@Trepanated
Copy link
Author

Hi, yes that's strange. I'm using a homebrew build and just running "emacs", which is a link in /usr/local/bin that points to /usr/local/Cellar/emacs/24.4/bin/emacs. I just tried "emacs -nw" but don't notice any difference. Here are the last lines from the Messages buffer after startup:

(Spacemacs) Initializing spacemacs:vi-tilde-fringe...
vi-tilde-fringe-mode: Symbol's function definition is void: define-fringe-bitma
p
Error in post-command-hook (global-vi-tilde-fringe-mode-check-buffers): (void-f
unction define-fringe-bitmap)
ad-handle-definition: `tramp-read-passwd' got redefined
Helm completion enabled

@syl20bnr
Copy link
Owner

I have the same error for tramp since 24.4, not sure if it is related directly to spacemacs. I'll have to check.

Can you tell me the value of the window-system variable with C-h v window-system ?

I built emacs with --with-x so mine has the value x in a graphical environment and nil in a terminal.

@Trepanated
Copy link
Author

Ok, I guess the situation with trying to draw the fringe leaves me in a strange state, because just trying to do "C-h v window-system" still calls the post-command-hook and gives the error as above, without showing the result (at least I couldn't figure out how to see it):

Error in post-command-hook (global-vi-tilde-fringe-mode-check-buffers): (void-f
unction define-fringe-bitmap)

So I tried running "emacs -q" and could see the value of window-system was nil. Then I got the idea to comment out the vi-tilde-fringe package from the list in packages.el, and once I did that spacemacs completed a successful startup. Nice! Especially since the tilde fringe thing doesn't seem vital. Anyway, then I checked the window-system value again and it was still nil.

@syl20bnr
Copy link
Owner

You did not build emacs with a window system support so the functions are not available to you.

I suggest you to uninstall emacs:

$ brew uninstall emacs

and rebuilt it with --with-x or --cocoa:

$ brew install emacs --with-x

and launch emacs with emacs -nw.

Hopefully it should work :-)

@syl20bnr
Copy link
Owner

@Trepanated I will fix what you have reported in order to be able to run spacemacs on an emacs built with no window system support. Thank you !

@Trepanated
Copy link
Author

Sounds good. I will try it tomorrow and let you know. Thanks for your help!

@syl20bnr
Copy link
Owner

syl20bnr commented Dec 2, 2014

From @trishume:

Yah it would be nice to support these kind of builds. But I bet most of the time people use these builds it is unintentional, might be good to just add a warning/error message that tells people that they need to compile with GUI instead of just erroring out on tool-bar-mode

@benekastah
Copy link

Re @trishume's comment, a notification like that isn't enough IMO. I do most of my editing on a remote server via ssh, so I prefer not to install x11 at all (I've tried to get a headless x11 thing going at one point, but it was confusing and fruitless).

@syl20bnr
Copy link
Owner

syl20bnr commented Dec 3, 2014

@benekastah The idea is to support terminal only builds but also log a warning in *Messages* for easy identification of such builds, it may be useful to diagnostic some issues.

Does that make sense to you ?

@syl20bnr
Copy link
Owner

syl20bnr commented Dec 3, 2014

Or maybe we have an easy way in Emacs to get the information.

@benekastah
Copy link

@syl20bnr Oh, I misunderstood. Yes that makes sense.

@tippenein
Copy link

uninstalling and reinstalling with --with-x worked for me. Thanks @syl20bnr

@quanganhdo
Copy link
Contributor

Same problem here (I'm using the macports version). Reinstalling with +x11 fixed it.

taheris pushed a commit to taheris/spacemacs that referenced this issue Jan 8, 2015
* master:
  Bump version to 0.44.1
  Fix missing gh library required for update notification
  Bump release to 0.44.0
  Mode-line indicator for new release
  Fix images in git layer README
  Move noflet to spacemacs layer
  Disable vi-tilde-fringe-mode in neotree buffer
  Fixes remaining function requires graphical support
  Hide hs-minor-mode lighter
  Fixes syl20bnr#50 compatibility for emacs with no graphical support
vijaykiran pushed a commit to vijaykiran/spacemacs that referenced this issue Mar 17, 2015
Resolves syl20bnr#194 Warning if a build has no graphical support
@jgm
Copy link

jgm commented Jan 9, 2016

I get this error starting emacs in a terminal.
I installed emacs in the way recommended on the site:

$ brew tap railwaycat/homebrew-emacsmacport
$ brew install emacs-mac --with-spacemacs-icon  # OR, brew cask install emacs-mac
$ brew linkapps

I think I'm using the right emacs:

% which emacs
/usr/local/bin/emacs
% ls -l /usr/local/bin/emacs
lrwxr-xr-x  1 jmadmin  staff  30 Oct 20 12:25 /usr/local/bin/emacs -> ../Cellar/emacs/24.5/bin/emacs

It doesn't seem to matter whether I start with -nw or not.

EDIT: Fixed things by uninstalling homebrew-emacsmacport and installing the regular version: brew install emac --with-cocoa. After that things worked properly in the console with -nw. I would suggest you add something to your documentation suggesting that people not use emacsmacport if they intend to use spacemacs from the console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants