unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Adam Porter <adam@alphapapa.net>
To: emacs-devel@gnu.org
Subject: Re: [ELPA] Want to submit two packages "ilist" and "blist"
Date: Sun, 19 Sep 2021 11:33:01 -0500	[thread overview]
Message-ID: <87bl4o8r0i.fsf@alphapapa.net> (raw)
In-Reply-To: m2zgs9rxbp.fsf@gmail.com

Durand <mmemmew@gmail.com> writes:

> I have written two Emacs pacakges, called "ilist" and "blist" (the
> former is the "engine", and hence a dependency, of the latter).  Now I
> am thinking about submitting the packages to GNU ELPA.
>
> The package "blist" is to display the list of bookmarks, in the sense of
> "bookmark.el", in a similar way as Ibuffer.

I see in your readme that you mention grouping.  Rather than
reimplementing that, you may be interested in what I've done in
taxy.el.  For example, it makes it trivial to define a custom grouping
DSL and a custom column-based view using magit-section.el.  See the
example "bookmarky" application:

https://github.com/alphapapa/taxy.el/blob/master/examples/bookmarky.el

It ends up looking like this:

https://raw.githubusercontent.com/alphapapa/taxy.el/master/images/bookmarky.png

Grouping keys and display columns are defined with simple top-level
forms, and these keys and columns can be customized by users by using
the same top-level forms in their configs.  For example:

  (bookmarky-define-key filename (&key name regexp)
    "Return NAME if bookmark ITEM's filename matches REGEXP, or without REGEXP, the filename."
    (when-let (filename (bookmark-prop-get item 'filename))
      (pcase regexp
        (`nil filename)
        (_ (when (string-match-p regexp filename)
             name)))))

  (bookmarky-define-column "File" (:max-width nil :face font-lock-doc-face)
    (bookmark-prop-get item 'filename))

Then a grouping "program" written in the DSL looks like:

  (defvar bookmarky-default-keys
    '(
      ((handler '(burly-bookmark-handler) :name "Burly"))
      ((directory "~/src/emacs/" :name "Emacs" :descendant-p t)))
    "Default keys.")

Turning the resulting hierarchy into the magit-section-based view is
done with a few functions in a standard way, so there's very little
bespoke code to write.

I'll probably publish taxy-magit-section.el on ELPA as a separate
package after it matures a bit more.




  parent reply	other threads:[~2021-09-19 16:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-19  4:41 [ELPA] Want to submit two packages "ilist" and "blist" Durand
2021-09-19 10:15 ` Stefan Kangas
2021-09-20  8:39   ` Durand
2021-09-19 12:45 ` Stefan Monnier
2021-09-19 16:33 ` Adam Porter [this message]
2021-09-20  0:10   ` Durand
2021-09-20  1:56     ` Adam Porter
2021-09-19 16:43 ` Adam Porter
2021-09-19 23:40   ` Durand
2021-09-19 17:01 ` [External] : " Drew Adams
2021-09-19 23:59   ` Durand
2021-09-20  4:18     ` Drew Adams
2021-09-20 11:19       ` Durand
2021-09-20 15:25         ` Drew Adams
2021-09-20 23:48   ` Richard Stallman
2021-09-21  0:45     ` Durand
2021-09-20 23:47 ` Richard Stallman
2021-09-21  0:39   ` Durand

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=87bl4o8r0i.fsf@alphapapa.net \
    --to=adam@alphapapa.net \
    --cc=emacs-devel@gnu.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).