345 |
|
|
346 |
;;; Note handling functions and macros |
;;; Note handling functions and macros |
347 |
|
|
348 |
(defmacro defnote (name contents) |
(defmacro defnote (name contents &optional disabled) |
349 |
`(eval-when #+gcl (load eval) #-gcl (:load-toplevel :execute) |
`(eval-when #+gcl (load eval) #-gcl (:load-toplevel :execute) |
350 |
(let ((note (make-note :name ,name :contents ,contents))) |
(let ((note (make-note :name ',name |
351 |
|
:contents ',contents |
352 |
|
:disabled ',disabled))) |
353 |
(setf (gethash *notes* (note-name note)) note) |
(setf (gethash *notes* (note-name note)) note) |
354 |
note))) |
note))) |
355 |
|
|
356 |
|
(defun disable-note (n) |
357 |
|
(let ((note (if (note-p n) n |
358 |
|
(setf n (gethash n *notes*))))) |
359 |
|
(unless note (error "~A is not a note or note name." n)) |
360 |
|
(setf (note-disabled note) t) |
361 |
|
note)) |
362 |
|
|
363 |
|
(defun enable-note (n) |
364 |
|
(let ((note (if (note-p n) n |
365 |
|
(setf n (gethash n *notes*))))) |
366 |
|
(unless note (error "~A is not a note or note name." n)) |
367 |
|
(setf (note-disabled note) nil) |
368 |
|
note)) |
369 |
|
|
370 |
|
|