all messages for Emacs-related lists mirrored at yhetil.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, 17 Aug 2024 17:37:52 +0000	[thread overview]
Message-ID: <87sev3yrrj.fsf@posteo.net> (raw)
In-Reply-To: <87wms5fjjs.fsf@thanosapollo.org> (Thanos Apollo's message of "Fri, 19 Jan 2024 16:45:35 +0200")

Sorry for the delay, trying to clean up my inbox.

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.

That has since changed.

> Is there any alternative that it's recommended instead of emacsql for a
> package to interact with an sqlite databases? (Except triples)
>
>
> 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)))))
>     (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*"))
>             (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.

Thanos Apollo <public@thanosapollo.org> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>> Thanos Apollo <public@thanosapollo.org> writes:
>>
>>> Philip Kaludercic <philipk@posteo.net> writes:
>
> [...]
>
>>> 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.
>>
>
> Thanks for the feedback, FYI I'm rewriting this with the built in
> sqlite & adding new features. Personally, I've found it much easier to
> work with the built in sqlite, since I can import items from other
> arbitrary databases that I've been using before.
>
> I'm also refactoring instances that use completing-read with
> read-multiple-choice.
>
> I will be contacting you when this package has a new stable version that
> is ready to be considered for inclusion in nongnu elpa.

Thanos Apollo <public@thanosapollo.org> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>
> [...]
>> If you want to, we can add the package right now as long as you add a
>> -git, -rc, -alpha suffix or any of the other pseudo-version strings
>> specified in `version-regexp-alist'.  That will instruct the ELPA build
>> server to not distribute the package on the main archive, until you bump
>> a release removing any "negative" version.  Then you don't have to wait
>> for someone to respond to your message again.
>
> This sounds ideal, I have pushed a 0.2.0-alpha version, which is the
> only tagged release available on <https://git.thanosapollo.org/gnosis>,
> to avoid unexpected issues.
>
>
> Thank you,
>
> From 92c89f9bb3dd63fa3e81f22d34d6ab456e4eeb34 Mon Sep 17 00:00:00 2001
> From: Thanos Apollo <public@thanosapollo.org>
> Date: Tue, 23 Jan 2024 01:22:53 +0200
> Subject: [PATCH] * elpa-packages (gnosis): New package
>
> ---
>  elpa-packages | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/elpa-packages b/elpa-packages
> index 9032331c31..068ccb04c3 100644
> --- a/elpa-packages
> +++ b/elpa-packages
> @@ -282,6 +282,10 @@
>   (git-modes		:url "https://github.com/magit/git-modes"
>    :ignored-files ("LICENSE" ".mailmap"))
>  
> + (gnosis                :url "https://git.thanosapollo.org/gnosis"
> +  :doc "doc/gnosis.texi"
> +  :ignored-files ("LICENSE"))
> +
>   (gnu-apl-mode		:url "https://github.com/lokedhs/gnu-apl-mode"
>    ;; :doc "texi/gnu-apl-mode.texi" ; the manual is currently empty
>    :ignored-files ("Makefile"))
> -- 
> 2.43.0

Thanos Apollo <public@thanosapollo.org> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>
> [...]
>>
>> I notice that you have .texi and .info files in your repository.  IIUC
>> these are generated from the .org file, right?  If that is so, you can
>> get rid of the generated files and instead let the ELPA build server
>> prepare these from the .org file for you.
>>
>>> +  :ignored-files ("LICENSE"))
>>
>> It would be preferable, if you could track the files you wish not to
>> distribute in the package in a .elpaignore file within your repository,
>> that we don't need to update nongnu.git for any change.
>>
>
> Oh, this is convenient, thank you.
>
> I've applied the requested changes:
> # .elpaignore
> ================
> doc/gnosis.org
> LICENSE
> Makefile -> Includes Makefile, not sure if that's desired
> ================
>
> # Makefile
> Note: Exports /doc/gnosis.org as .texi AND as .info, this makes it
> easier for me, I hope it's not an issue.
> ================
> .POSIX:
> .PHONY: all compile test clean
> .SUFFIXES: .el .elc
>
> EMACS = emacs
> ORG := doc/gnosis.org
> TEXI := doc/gnosis.texi
> INFO := doc/gnosis.info
>
> ELFILES = $(wildcard *.el)
> BYTEC = $(ELFILES:.el=.elc)
>
> all: compile $(TEXI)
>
> compile: $(BYTEC)
>
> $(TEXI): $(ORG)
> 	 $(EMACS) --batch \
> 	 --load org \
> 	 --eval "(with-current-buffer (find-file \"$(ORG)\") (org-texinfo-export-to-texinfo) (org-texinfo-export-to-info) (save-buffer))" \
> 	 --kill
>
> clean:
> 	rm -f $(BYTEC)
> 	rm -f $(TEXI) $(INFO)
>
> .el.elc:
> 	$(EMACS) -Q --batch -L . -f batch-byte-compile $<
> ================
>
> FYI I tried building nongnu elpa to create a new patch for gnosis, but
> after cloning the repo:
>
> ========
> $ make

What I usually do is

--8<---------------cut here---------------start------------->8---
$ make {fetch,build}/gnosis
emacs --batch -Q -l admin/elpa-admin.el \
         -f elpaa-batch-pkg-spec-make-dependencies .pkg-descs.mk
Source file ‘/home/phi/Source/emacs/lisp/emacs-lisp/package.el’ newer than byte-compiled file; using older file
emacs --batch -l admin/elpa-admin.el -f elpaa-batch-fetch-and-show "gnosis"
Source file ‘/home/phi/Source/emacs/lisp/emacs-lisp/package.el’ newer than byte-compiled file; using older file
Fetching updates for gnosis...
New package gnosis hasn’t been pushed to origin yet
emacs --batch -l /home/phi/Source/nongnu/admin/elpa-admin.el	\
         -f elpaa-batch-make-one-package gnosis
Source file ‘/home/phi/Source/emacs/lisp/emacs-lisp/package.el’ newer than byte-compiled file; using older file
Cloning branch gnosis:
+refs/heads/*:refs/remotes/origin/*
Preparing worktree (new branch 'elpa/gnosis')
HEAD is now at fe019d58f2 dashboard: Display overdue notes.

======== Building tarball archive-devel/gnosis-0.4.0.0.20240811.200740.tar...
Source file ‘/home/phi/Source/emacs/lisp/vc/diff-mode.el’ newer than byte-compiled file; using older file



######## Built new package archive-devel/gnosis-0.4.0.0.20240811.200740.tar!
======== Building tarball archive/gnosis-0.4.0.tar...



######## Built new package archive/gnosis-0.4.0.tar!
--8<---------------cut here---------------end--------------->8---

As you can see, it went through.  But you haven't commited the
.elpaignore file, so the files are still included.

Either way, I have applied the modified patch and pushed the change to
nongnu.git.  You can add the .elpaignore file any time you want, as long
as you eventually bump the version tag in the main file.

Sorry again for the delay!

> git remote add --no-tags -ft elpa-admin \
>     gnu-elpa https://git.savannah.gnu.org/git/emacs/elpa.git
> Updating gnu-elpa
> remote: Counting objects: 1679, done.
> remote: Compressing objects: 100% (776/776), done.
> remote: Total 1679 (delta 798), reused 1628 (delta 787)
> Receiving objects: 100% (1679/1679), 444.55 KiB | 730.00 KiB/s, done.
> Resolving deltas: 100% (798/798), done.
> From https://git.savannah.gnu.org/git/emacs/elpa
>  * [new branch]            elpa-admin -> gnu-elpa/elpa-admin
> git worktree add -b elpa-admin admin gnu-elpa/elpa-admin
> Preparing worktree (new branch 'elpa-admin')
> branch 'elpa-admin' set up to track 'gnu-elpa/elpa-admin'.
> HEAD is now at 897fef4a23 * elpa-admin.el (elpaa--core-files): Simplify
> ln -s admin/GNUmakefile ./
> ln -s admin/elpa-manifest.scm manifest.scm
>
> $ make build-all # I got the following error:
>
> Opening output file: No such file or directory,
> /home/thanos/Dev/emacs-lisp/nongnu/archive/archive-contents make: ***
> [GNUmakefile:25: build-all] Error 255
> ========

-- 
	Philip Kaludercic on peregrine



  parent reply	other threads:[~2024-08-17 17:37 UTC|newest]

Thread overview: 13+ 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
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
2024-08-17 17:37     ` Philip Kaludercic [this message]
2024-08-18 20:54       ` Thanos Apollo
2024-08-18 21:27         ` Philip Kaludercic
2024-08-18 22:10           ` 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

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

  git send-email \
    --in-reply-to=87sev3yrrj.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.