Function: with-editor-debug

with-editor-debug is an interactive and byte-compiled function defined in with-editor.el.

Signature

(with-editor-debug)

Documentation

Debug configuration issues.

See info node (with-editor)Debugging for instructions.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/with-editor-20260301.1317/with-editor.el
;;; _

(defun with-editor-debug ()
  "Debug configuration issues.
See info node `(with-editor)Debugging' for instructions."
  (interactive)
  (require 'warnings)
  (with-current-buffer (get-buffer-create "*with-editor-debug*")
    (pop-to-buffer (current-buffer))
    (erase-buffer)
    (ignore-errors (with-editor))
    (insert
     (format "with-editor: %s\n" (locate-library "with-editor.el"))
     (format "emacs: %s (%s)\n"
             (expand-file-name invocation-name invocation-directory)
             emacs-version)
     "system:\n"
     (format "  system-type: %s\n" system-type)
     (format "  system-configuration: %s\n" system-configuration)
     (format "  system-configuration-options: %s\n" system-configuration-options)
     "server:\n"
     (format "  server-running-p: %s\n" (server-running-p))
     (format "  server-process: %S\n" server-process)
     (format "  server-use-tcp: %s\n" server-use-tcp)
     (format "  server-name: %s\n" server-name)
     (format "  server-socket-dir: %s\n" server-socket-dir))
    (if (and server-socket-dir (file-accessible-directory-p server-socket-dir))
        (dolist (file (directory-files server-socket-dir nil "^[^.]"))
          (insert (format "    %s\n" file)))
      (insert (format "    %s: not an accessible directory\n"
                      (if server-use-tcp "WARNING" "ERROR"))))
    (insert (format "  server-auth-dir: %s\n" server-auth-dir))
    (if (file-accessible-directory-p server-auth-dir)
        (dolist (file (directory-files server-auth-dir nil "^[^.]"))
          (insert (format "    %s\n" file)))
      (insert (format "    %s: not an accessible directory\n"
                      (if server-use-tcp "ERROR" "WARNING"))))
    (let ((val with-editor-emacsclient-executable)
          (def (default-value 'with-editor-emacsclient-executable))
          (fun (let ((warning-minimum-level :error)
                     (warning-minimum-log-level :error))
                 (with-editor-locate-emacsclient))))
      (insert "with-editor-emacsclient-executable:\n"
              (format " value:   %s (%s)\n" val
                      (and val (with-editor-emacsclient-version val)))
              (format " default: %s (%s)\n" def
                      (and def (with-editor-emacsclient-version def)))
              (format " funcall: %s (%s)\n" fun
                      (and fun (with-editor-emacsclient-version fun)))))
    (insert "path:\n"
            (format "  $PATH:     %s\n" (split-string (getenv "PATH") ":"))
            (format "  exec-path: %s\n" exec-path))
    (insert (format "  with-editor-emacsclient-path:\n"))
    (dolist (dir (with-editor-emacsclient-path))
      (insert (format "    %s (%s)\n" dir (car (file-attributes dir))))
      (when (file-directory-p dir)
        ;; Don't match emacsclientw.exe, it makes popup windows.
        (dolist (exec (directory-files dir t "emacsclient\\(?:[^w]\\|\\'\\)"))
          (insert (format "      %s (%s)\n" exec
                          (with-editor-emacsclient-version exec))))))))