unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Thanos Apollo <public@thanosapollo.org>
Cc: emacs-devel@gnu.org
Subject: Re: Package suggestion[nongnu]: Gnosis (γνῶσις)
Date: Sat, 20 Jan 2024 12:20:42 +0000	[thread overview]
Message-ID: <87il3o8acl.fsf@posteo.net> (raw)
In-Reply-To: <87wms5fjjs.fsf@thanosapollo.org> (Thanos Apollo's message of "Fri, 19 Jan 2024 16:45:35 +0200")

Thanos Apollo <public@thanosapollo.org> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>>
>> Here area few comments in form of a diff (this is NOT a patch):
>
> [...]
>
> Thank you for your suggestions, they've been really helpful.
>
> I got confused and thought emacsql was included in nongnu elpa, but it's only
> available only in nongnu-devel.

You are right, that is peculiar.  One should see what is holding back
the release.

> Is there any alternative that it's recommended instead of emacsql for a
> package to interact with an sqlite databases? (Except triples)

If you require at least Emacs 29, then you could fall back onto the
built-in SQLite support.

> I've refactored a couple important parts of gnosis to take into an
> account future extensibility, even by 3rd party packages. Example:
>
> (defvar gnosis-note-types '(MCQ Cloze Basic Double y-or-n)
>   "Gnosis available note types.")
>   
> (defun gnosis-add-note (type)
>   "Create note(s) as TYPE interactively."
>   (interactive (list (completing-read "Type: " gnosis-note-types nil t)))
>   (when gnosis-testing
>     (unless (y-or-n-p "You are using a testing environment! Continue?")
>       (error "Aborted")))
>   (let ((func-name (intern (format "gnosis-add-note-%s" (downcase type)))))

Perhaps using `intern-soft' would be better here.

>     (if (fboundp func-name)
>         (funcall func-name)
>       (message "No such type."))))
>       
> (defun gnosis-review-note (id)
>   "Start review for note with value of id ID."
>   (when (gnosis-suspended-p id)
>     (message "Suspended note with id: %s" id)
>     (sit-for 0.3)) ;; this should only occur in testing/dev cases
>   (let* ((type (gnosis-get 'type 'notes `(= id ,id)))
>          (func-name (intern (format "gnosis-review-%s" (downcase type)))))
>     (if (fboundp func-name)
>         (progn
>           (with-current-buffer (switch-to-buffer (get-buffer-create "*gnosis*"))

You don't need `switch-to-buffer' if you are using `with-current-buffer'.

>             (gnosis-mode)
>             (funcall func-name id)))
>       (error "Malformed note type: '%s'" type))))
>
> Adding new note types should be a trivial task now.
>
> I hadn't really used emacs without vertico and was unaware of how
> different completing-read user interactions actually are. I will be
> making adjustments for that wherever possible.

I use Emacs that way, so if you have any questions I'd be glad to
clarify usage patterns and annoyances.



  reply	other threads:[~2024-01-20 12:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16  8:14 Package suggestion[nongnu]: Gnosis (γνῶσις) Thanos Apollo
2024-01-18 19:42 ` Philip Kaludercic
2024-01-19 14:45   ` Thanos Apollo
2024-01-20 12:20     ` Philip Kaludercic [this message]
2024-01-22 13:39       ` Thanos Apollo
2024-01-22 17:59         ` Philip Kaludercic
2024-01-22 22:55           ` Thanos Apollo
2024-01-23  7:53             ` Philip Kaludercic
2024-01-23 16:20               ` Thanos Apollo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87il3o8acl.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=emacs-devel@gnu.org \
    --cc=public@thanosapollo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).