I am trying to setup a workflow wherein I generate Ledger files from different record files. Typically I like to view them in ledger mode after cleaning but if I make a change to the conversion, then I have to revert the file, reenable ledger mode and then run the clean operation. I tried making a function to do this for me, but I am encountering an error that I don't understand. Below is the function as written in my initialize code:
(use-package ledger-mode :init :config (defun ledger-revert () (interactive) (if not (eq major-mode 'ledger-mode) (ledger-mode)) (revert-buffer t t t) (ledger-mode-clean-buffer))) when I try to run the function to revert a ledger journal file I get:
>>> Symbol's value as variable is void: not Any thoughts?

not (eq major-mode 'ledger-mode)with(not (eq major-mode 'ledger-mode))would be a start. To help yourself here, you might want to read the Intro to Emacs Lisp manual (C-h i), or another introduction to Lisp, about symbols, variables, and functions in Lisp.