Error running emacs

I have just installed emacs and on running it, I get the following error:

Warning (initialization): An error occurred while loading ‘/home/michael/.emacs’:

Symbol’s value as variable is void: x-pointer-left-ptr

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the ‘–debug-init’ option to view a complete error backtrace.

Running with --debug-init gave me the following:

Debugger entered--Lisp error: (void-variable x-pointer-left-ptr)
  (setq x-pointer-shape x-pointer-left-ptr)
  (if (not window-system) (setq ispell-highlight-face 'underline) (if (> emacs-major-version 20) (require 'xfonts)) (setq x-pointer-shape x-pointer-left-ptr) (if (x-display-color-p) (set-mouse-color "RoyalBlue") (set-mouse-color (cdr (assq 'mouse-color (frame-parameters))))) (if (not (x-display-color-p)) (progn (set-face-background 'region (cdr (assq 'foreground-color (frame-parameters)))) (set-face-foreground 'region (cdr (assq 'background-color (frame-parameters)))) (setq ispell-highlight-face 'underline))) (custom-declare-face 'font-lock-string-face '((((class grayscale) (background light)) (:foreground "gray37" :italic t)) (((class grayscale) (background dark)) (:foreground "LightGray" :italic t)) (((class color) (background light)) (:foreground "gray37")) (((class color) (background dark)) (:foreground "LightGray")) (t (:italic t))) "Font Lock mode face used to highlight strings." :group 'font-lock-highlighting-faces) (require 'font-lock) (cond ((and (boundp 'jit-lock-mode) (symbol-value 'jit-lock-mode)) (setq font-lock-support-mode '((latex-mode . fast-lock-mode) (t . jit-lock-mode)))) ((and (boundp 'lazy-lock-mode) (symbol-value 'lazy-lock-mode)) (setq font-lock-support-mode '((latex-mode . fast-lock-mode) (t . lazy-lock-mode))))) (add-hook 'after-init-hook #'(lambda nil (global-font-lock-mode 1))) (setq use-dialog-box t) (setq mouse-scroll-delay 0) (setq x-selection-timeout 0) (if (file-executable-p "/usr/X11R6/bin/Netscape") (setq browse-url-netscape-program "/usr/X11R6/bin/Netscape")))
  load-with-code-conversion("/etc/skel/.gnu-emacs" "/etc/skel/.gnu-emacs" nil t)
  load("/etc/skel/.gnu-emacs" nil t)
  (if (file-readable-p "/etc/skel/.gnu-emacs") (load "/etc/skel/.gnu-emacs" nil t))
  (if (file-readable-p "~/.gnu-emacs") (load "~/.gnu-emacs" nil t) (if (file-readable-p "/etc/skel/.gnu-emacs") (load "/etc/skel/.gnu-emacs" nil t)))
  (if (string-match "XEmacs\\|Lucid" emacs-version) (progn (if (file-readable-p "~/.xemacs/init.el") (load "~/.xemacs/init.el" nil t))) (if (file-readable-p "~/.gnu-emacs") (load "~/.gnu-emacs" nil t) (if (file-readable-p "/etc/skel/.gnu-emacs") (load "/etc/skel/.gnu-emacs" nil t))) (setq custom-file "~/.gnu-emacs-custom") (load "~/.gnu-emacs-custom" t t))
  load-with-code-conversion("/home/michael/.emacs" "/home/michael/.emacs" t t)
  load("~/.emacs" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode 0x1f71349d50e9ea99>) #f(compiled-function () #<bytecode -0x1f3c61addc0bb0b5>) t)
  command-line()
  normal-top-level()

I can’t figure out what is wrong. Can anyone please help?

I ran into this error today after updating tumbleweed.

I don’t know the root cause of the error, but I made the following change to avoid it.

In /etc/skel/.gnu_emacs, I commented out the offending line:

--- /etc/skel/.gnu-emacs~       2024-04-11 02:13:46.000000000 -0400
+++ /etc/skel/.gnu-emacs        2024-04-14 12:22:46.165571207 -0400
@@ -176,7 +176,7 @@
   ;;
   ;; mouse as arrow
   ;; --------------
-  (setq x-pointer-shape x-pointer-left-ptr)
+  ;; (setq x-pointer-shape x-pointer-left-ptr)
   (if (x-display-color-p)
       (set-mouse-color "RoyalBlue")
     (set-mouse-color (cdr (assq 'mouse-color (frame-parameters)))))
2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.