Skip to content

Instantly share code, notes, and snippets.

@hlissner
Last active June 9, 2026 19:37
Show Gist options
  • Select an option

  • Save hlissner/7733d13dec09746ea044e2bef98424cb to your computer and use it in GitHub Desktop.

Select an option

Save hlissner/7733d13dec09746ea044e2bef98424cb to your computer and use it in GitHub Desktop.
Generate an info dump about your Emacs environment. Usage instructions are in comments.
(defun emacs-info ()
(interactive)
(pop-to-buffer
(with-current-buffer (get-buffer-create "*emacs info*")
(erase-buffer)
(let ((standard-output (current-buffer)))
(mapc (lambda (line)
(princ (format "%s %s" (car line) (cdr line)))
(terpri (current-buffer)))
`((generated . ,(format-time-string "%b %d, %Y %H:%M:%S"))
(system ,system-type ,(window-system))
(emacs ,emacs-version
,(bound-and-true-p emacs-repository-branch)
,(and (stringp emacs-repository-version)
(substring emacs-repository-version 0 9))
,(format "EMACS=%s/%s" (abbreviate-file-name invocation-directory) invocation-name)
,(format "EMACSD=%s" (abbreviate-file-name user-emacs-directory)))
(shell . ,(abbreviate-file-name shell-file-name))
(features ,@system-configuration-features)
(traits ,@(delq
nil (list (cond (noninteractive 'batch)
((display-graphic-p) 'gui)
('tty))
(cond ((daemonp) 'daemon)
((and (fboundp 'server-running-p)
(server-running-p)
'server)))
(and (boundp 'doom-version)
`(doom . ,doom-version))
(and (boundp 'spacemacs-version)
`(spacemacs . ,spacemacs-version))
(and (boundp 'chemacs-version)
(intern (format "chemacs-%s" chemacs-version)))
(and (featurep 'exec-path-from-shell)
'exec-path-from-shell)
(and (file-symlink-p user-emacs-directory)
'symlinked-emacsdir)
(and (stringp custom-file)
(file-exists-p custom-file)
'custom-file))))
(elpa ,@(condition-case e
(progn
(unless (bound-and-true-p package--initialized)
(package-initialize))
(mapcar #'car package-list))
(error (format "<%S>" e)))))))
(current-buffer))))
@hlissner

hlissner commented Jun 9, 2026

Copy link
Copy Markdown
Author

To use this command:

The emacs-info command will create a new buffer, switch to it, and fill it with an information dump about your Emacs session and environment (which shouldn't include personal/identifiable information; but feel free to modify it as you like).

Here are a couple methods to use it. Choose the method that seems easiest or most available to you; they all produce the same result:

  • Copy the snippet to your Emacs config. Restart Emacs. Type M-x emacs-info (i.e. alt-x followed by emacs-info). Then M-x save-buffer to save the emacs-info dump to a file.

  • Copy it into an elisp buffer in Emacs, run M-x eval-buffer, then M-x emacs-info. M-x save-buffer to save its contents to a file.

  • Save the snippet to a file, say emacs-info.el, then run this in the shell: emacs -l emacs-info.el -f emacs-info. This will launch Emacs with the emacs-info buffer visible. M-x save-buffer to save it to a file.

What if this doesn't work for me?

If all else fails, execute emacs --version in the shell, copy its output to a file, and upload that instead. On linux this is as easy as:

emacs --version > emacs-version.txt

Then upload emacs-version.txt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment