Simple database: Difference between revisions
m
no edit summary
(Add emacs lisp) |
mNo edit summary |
||
Line 1,454:
(switch-to-buffer "**content**")
(end-of-buffer)
(
(insert (format "%s\n" row-data))
(message ">> Row added: %s" row-data) ) ) )
(defun dbe-find-by-id (row-id)
Line 1,463:
(let (row-found)
(dbe-rows (lambda (row)
(when (equal (plist-get row 'id) row-id)
(setq row-found row)) )
:continue (lambda () (null row-found)))
(message "
)
Line 1,478 ⟶ 1,477:
M-x dbe-insert
Please enter the row data in plist format: (name "book1" author "author1")
>> Row added: (id 1 name book1 author author1)
M-x dbe-insert
Please enter the row data in plist format: (name "book2" author "author2")
>> Row added: (id 2 name book2 author author2)
M-x dbe-find-by-id
Please enter row id: 2
</pre>
|