purcell / exec-path-from-shell

Make Emacs use the $PATH set up by the user's shell
Other
1.43k stars 82 forks source link

Debugger error on startup #103

Closed Pilgrim1379 closed 3 years ago

Pilgrim1379 commented 3 years ago

So emacs wasn't finding some applications that are installed on my system macOS - Big Sur and Emacs 27. So I turned on debug on error and tweaks the config for exec-path-from-shell to:

(use-package exec-path-from-shell
  :if (memq window-system '(mac ns))
  :init
  (setq exec-path-from-shell-debug t)
  (setq exec-path-from-shell-arguments t)
  (setq exec-path-from-shell-check-startup-files t)
  :config
  (exec-path-from-shell-initialize))

When I start emacs, I get the following error:

Debugger entered--Lisp error: (wrong-type-argument sequencep t)
  append(t ("-c" "/usr/bin/printf '__RESULT\\000%s\\000%s\\000__RESULT'..."))
  exec-path-from-shell-printf("%s\\000%s" ("${PATH-c4dc862a7e2fca8ea1066b1c3da8e0cc}" "${MANPATH-c4dc862a7e2fca8ea1066b1c3da8e0cc}"))
  exec-path-from-shell-getenvs(("PATH" "MANPATH"))
  exec-path-from-shell-copy-envs(("PATH" "MANPATH"))
  exec-path-from-shell-initialize()
  (progn (exec-path-from-shell-initialize) t)
  (condition-case err (progn (exec-path-from-shell-initialize) t) ((debug error) (funcall use-package--warning5 :config err)))
  (prog1 (condition-case err (progn (exec-path-from-shell-initialize) t) ((debug error) (funcall use-package--warning5 :config err))) (let ((elapsed (float-time (time-subtract (current-time) now)))) (if (> elapsed 0.1) (message "%s...done (%.3fs)" "Configuring package exec-path-from-shell" elapsed) (message "%s...done" "Configuring package exec-path-from-shell"))))
  (let ((now (current-time))) (message "%s..." "Configuring package exec-path-from-shell") (prog1 (condition-case err (progn (exec-path-from-shell-initialize) t) ((debug error) (funcall use-package--warning5 :config err))) (let ((elapsed (float-time (time-subtract (current-time) now)))) (if (> elapsed 0.1) (message "%s...done (%.3fs)" "Configuring package exec-path-from-shell" elapsed) (message "%s...done" "Configuring package exec-path-from-shell")))))
  (if (not (require 'exec-path-from-shell nil t)) (display-warning 'use-package (format "Cannot load %s" 'exec-path-from-shell) :error) (use-package-statistics-gather :config 'exec-path-from-shell nil) (let ((now (current-time))) (message "%s..." "Configuring package exec-path-from-shell") (prog1 (condition-case err (progn (exec-path-from-shell-initialize) t) ((debug error) (funcall use-package--warning5 :config err))) (let ((elapsed (float-time (time-subtract ... now)))) (if (> elapsed 0.1) (message "%s...done (%.3fs)" "Configuring package exec-path-from-shell" elapsed) (message "%s...done" "Configuring package exec-path-from-shell"))))) (use-package-statistics-gather :config 'exec-path-from-shell t))
  (prog1 (if (not (require 'exec-path-from-shell nil t)) (display-warning 'use-package (format "Cannot load %s" 'exec-path-from-shell) :error) (use-package-statistics-gather :config 'exec-path-from-shell nil) (let ((now (current-time))) (message "%s..." "Configuring package exec-path-from-shell") (prog1 (condition-case err (progn (exec-path-from-shell-initialize) t) ((debug error) (funcall use-package--warning5 :config err))) (let ((elapsed (float-time ...))) (if (> elapsed 0.1) (message "%s...done (%.3fs)" "Configuring package exec-path-from-shell" elapsed) (message "%s...done" "Configuring package exec-path-from-shell"))))) (use-package-statistics-gather :config 'exec-path-from-shell t)) (let ((elapsed (float-time (time-subtract (current-time) now)))) (if (> elapsed 0.1) (message "%s...done (%.3fs)" "Loading package exec-path-from-shell" elapsed) (message "%s...done" "Loading package exec-path-from-shell"))))
  (let ((now (current-time))) (message "%s..." "Loading package exec-path-from-shell") (prog1 (if (not (require 'exec-path-from-shell nil t)) (display-warning 'use-package (format "Cannot load %s" 'exec-path-from-shell) :error) (use-package-statistics-gather :config 'exec-path-from-shell nil) (let ((now (current-time))) (message "%s..." "Configuring package exec-path-from-shell") (prog1 (condition-case err (progn (exec-path-from-shell-initialize) t) ((debug error) (funcall use-package--warning5 :config err))) (let ((elapsed ...)) (if (> elapsed 0.1) (message "%s...done (%.3fs)" "Configuring package exec-path-from-shell" elapsed) (message "%s...done" "Configuring package exec-path-from-shell"))))) (use-package-statistics-gather :config 'exec-path-from-shell t)) (let ((elapsed (float-time (time-subtract (current-time) now)))) (if (> elapsed 0.1) (message "%s...done (%.3fs)" "Loading package exec-path-from-shell" elapsed) (message "%s...done" "Loading package exec-path-from-shell")))))
  (progn (use-package-statistics-gather :init 'exec-path-from-shell nil) (condition-case err (progn (setq exec-path-from-shell-debug t) (setq exec-path-from-shell-arguments t) (setq exec-path-from-shell-check-startup-files t)) ((debug error) (funcall use-package--warning5 :init err))) (let ((now (current-time))) (message "%s..." "Loading package exec-path-from-shell") (prog1 (if (not (require 'exec-path-from-shell nil t)) (display-warning 'use-package (format "Cannot load %s" 'exec-path-from-shell) :error) (use-package-statistics-gather :config 'exec-path-from-shell nil) (let ((now (current-time))) (message "%s..." "Configuring package exec-path-from-shell") (prog1 (condition-case err (progn ... t) (... ...)) (let (...) (if ... ... ...)))) (use-package-statistics-gather :config 'exec-path-from-shell t)) (let ((elapsed (float-time (time-subtract ... now)))) (if (> elapsed 0.1) (message "%s...done (%.3fs)" "Loading package exec-path-from-shell" elapsed) (message "%s...done" "Loading package exec-path-from-shell"))))) (use-package-statistics-gather :init 'exec-path-from-shell t))
  (condition-case err (progn (use-package-statistics-gather :init 'exec-path-from-shell nil) (condition-case err (progn (setq exec-path-from-shell-debug t) (setq exec-path-from-shell-arguments t) (setq exec-path-from-shell-check-startup-files t)) ((debug error) (funcall use-package--warning5 :init err))) (let ((now (current-time))) (message "%s..." "Loading package exec-path-from-shell") (prog1 (if (not (require 'exec-path-from-shell nil t)) (display-warning 'use-package (format "Cannot load %s" 'exec-path-from-shell) :error) (use-package-statistics-gather :config 'exec-path-from-shell nil) (let ((now ...)) (message "%s..." "Configuring package exec-path-from-shell") (prog1 (condition-case err ... ...) (let ... ...))) (use-package-statistics-gather :config 'exec-path-from-shell t)) (let ((elapsed (float-time ...))) (if (> elapsed 0.1) (message "%s...done (%.3fs)" "Loading package exec-path-from-shell" elapsed) (message "%s...done" "Loading package exec-path-from-shell"))))) (use-package-statistics-gather :init 'exec-path-from-shell t)) ((debug error) (funcall use-package--warning5 :catch err)))
  (progn (defvar use-package--warning5 #'(lambda (keyword err) (let ((msg (format "%s/%s: %s" ... keyword ...))) (display-warning 'use-package msg :error)))) (condition-case err (progn (use-package-statistics-gather :init 'exec-path-from-shell nil) (condition-case err (progn (setq exec-path-from-shell-debug t) (setq exec-path-from-shell-arguments t) (setq exec-path-from-shell-check-startup-files t)) ((debug error) (funcall use-package--warning5 :init err))) (let ((now (current-time))) (message "%s..." "Loading package exec-path-from-shell") (prog1 (if (not (require ... nil t)) (display-warning 'use-package (format "Cannot load %s" ...) :error) (use-package-statistics-gather :config 'exec-path-from-shell nil) (let (...) (message "%s..." "Configuring package exec-path-from-shell") (prog1 ... ...)) (use-package-statistics-gather :config 'exec-path-from-shell t)) (let ((elapsed ...)) (if (> elapsed 0.1) (message "%s...done (%.3fs)" "Loading package exec-path-from-shell" elapsed) (message "%s...done" "Loading package exec-path-from-shell"))))) (use-package-statistics-gather :init 'exec-path-from-shell t)) ((debug error) (funcall use-package--warning5 :catch err))))
  (if (memq window-system '(mac ns)) (progn (defvar use-package--warning5 #'(lambda (keyword err) (let ((msg ...)) (display-warning 'use-package msg :error)))) (condition-case err (progn (use-package-statistics-gather :init 'exec-path-from-shell nil) (condition-case err (progn (setq exec-path-from-shell-debug t) (setq exec-path-from-shell-arguments t) (setq exec-path-from-shell-check-startup-files t)) ((debug error) (funcall use-package--warning5 :init err))) (let ((now (current-time))) (message "%s..." "Loading package exec-path-from-shell") (prog1 (if (not ...) (display-warning ... ... :error) (use-package-statistics-gather :config ... nil) (let ... ... ...) (use-package-statistics-gather :config ... t)) (let (...) (if ... ... ...)))) (use-package-statistics-gather :init 'exec-path-from-shell t)) ((debug error) (funcall use-package--warning5 :catch err)))))
  eval-buffer(#<buffer  *load*> nil "/Users/nqa/.config/emacs/init.el" nil t)  ; Reading at buffer position 3350
  load-with-code-conversion("/Users/nqa/.config/emacs/init.el" "/Users/nqa/.config/emacs/init.el" t t)
  load("/Users/nqa/.config/emacs/init" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode 0x1ffad30b928d>) #f(compiled-function () #<bytecode 0x1ffad30b92a5>) t)
  command-line()
  normal-top-level()

Sorry about the formatting of the error message.

Pilgrim1379 commented 3 years ago

I think the error is because I'm passing the wrong argument to exec-path-from-shell-arguments. If so what argument does it expect?

Pilgrim1379 commented 3 years ago

I figured it out (setq exec-path-from-shell-arguments '("-l")) thanks,

purcell commented 3 years ago

Great, glad you figured it out.