Software⏱️ 3 min read📅 2026-06-11

How to Fix: How to prevent the "Symbol's function definition is void: error" when running emacs in the console?

Emacs error fix for console mode scrollbar issue.

Quick Answer: Add the following to your .emacs file: (setq scroll-bar-mode nil) or use the --no-scroll-bar option when running emacs.

The 'Symbol's function definition is void: error' in Emacs occurs when you try to run the `toggle-scroll-bar` command, which is used to disable the scrollbar. This error affects users who are running Emacs in console mode and have added `(toggle-scroll-bar -1)` to their `.emacs` file.

This error can be frustrating because it prevents users from disabling the scrollbar as intended. However, there is a solution that can help resolve this issue.

🛑 Root Causes of the Error

  • The primary reason for this error is that the `toggle-scroll-bar` command is not defined in Emacs console mode. This is because the `scroll-bar-mode` function is not available in this environment.
  • Another possible cause is that there are issues with the way the `(toggle-scroll-bar -1)` line is being executed, which may be due to a syntax error or incorrect indentation.

✅ Best Solutions to Fix It

Enabling Emacs console mode

  1. Step 1: To enable Emacs console mode, run `M-x emacs --console` instead of simply typing `emacs`. This will allow you to execute the `toggle-scroll-bar` command without encountering the error.
  2. Step 2: Alternatively, you can also use `--batch-mode` option when running Emacs from the terminal. To do this, type `emacs --batch-mode` and then add `(toggle-scroll-bar -1)` to your `.emacs` file.

Modifying the .emacs file

  1. Step 1: If you still want to use Emacs console mode, you can modify your `.emacs` file to define the `scroll-bar-mode` function. To do this, add the following code to your `.emacs` file: `(defun scroll-bar-mode (arg) ...)`.
  2. Step 2: However, please note that defining a custom `scroll-bar-mode` function may require more advanced knowledge of Emacs and its internals.

🎯 Final Words

By enabling Emacs console mode or modifying your `.emacs` file to define the `scroll-bar-mode` function, you should be able to resolve the 'Symbol's function definition is void: error' issue when running Emacs in terminal mode.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions