anchor.diff:  ;;;; SPDX-License-Identifier: BSD-3-Clause
   
   (uiop:define-package :nyxt/macro-edit-mode
  -    (:use :common-lisp :trivia :nyxt)
  +  (:use :common-lisp :trivia :nyxt)
     (:documentation "Mode for editing macros."))
   (in-package :nyxt/macro-edit-mode)
   
  
positive.code: (defmethod generate-macro-form ((macro-editor macro-edit-mode))
    (let ((name (intern (name macro-editor)))
          (commands (mapcar
                     (lambda (command) (write `(,(name command)) :stream nil))
                     (alexandria:hash-table-values (functions macro-editor)))))
      `(define-command-global ,name () "User generated macro form" ,@commands)))
  
  
negative.code:   "Save the macro to the auto-config.lisp file."
    (if (macro-form-valid-p macro-editor)
        (nyxt::append-configuration (generate-macro-form macro-editor))
        (echo "Macro form is invalid; check it has a title and functions.")))
  
  (define-command evaluate-macro (&optional (macro-editor (current-mode 'macro-edit-mode)))
    "Evaluate the macro for testing."
    (if (macro-form-valid-p macro-editor)
        (progn (eval (generate-macro-form macro-editor)) (echo "Macro evaluated."))
        (echo "Macro form is invalid; check it has a title and functions.")))
  