0

I'm getting the error

kill-buffer: Symbol’s function definition is void: comint-write-input-ring

on startup.

I have this in my config.el (I'm using doom emacs), I don't know if it matters.

(defun comint-write-history-on-exit (process event)
  (comint-write-input-ring)
  (let ((buf (process-buffer process)))
    (when (buffer-live-p buf)
      (with-current-buffer buf
        (insert (format "\nProcess %s %s" process event))))))

(defun turn-on-comint-history ()
  (let ((process (get-buffer-process (current-buffer))))
    (when process
      (setq comint-input-ring-file-name
            (format "~/.emacs.d/inferior-%s-history"
                    (process-name process)))
      (comint-read-input-ring)
      (set-process-sentinel process
                            #'comint-write-history-on-exit))))


(add-hook 'inferior-python-mode-hook 'turn-on-comint-history)
(add-hook 'kill-buffer-hook 'comint-write-input-ring)


(defun mapc-buffers (fn)
  (mapc (lambda (buffer)
          (with-current-buffer buffer
            (funcall fn)))
        (buffer-list)))

(defun comint-write-input-ring-all-buffers ()
  (mapc-buffers 'comint-write-input-ring))

The functions are for saving comint history.

3
  • 1
    You are using the function comint-write-input-ring above (l.2 of the code) and Emacs is complaining that it does not know that function. You have to define it before you use it. You can do that by adding (require 'comint) before the comint-write-history-on-exit function: comint.el[c] is the file where the comint-write-input-ring function is defined. I imagine similar questions have been asked many times before, so this is probably a duplicate.
    – NickD
    Commented Apr 21 at 19:47
  • 2
    Does this answer your question? Symbol's function definition is void: rtags-enable-standard-keybinding
    – NickD
    Commented Apr 21 at 19:57
  • @NickD yes that works, thank you
    – tsorn
    Commented Apr 22 at 12:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.