unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Hanno Perrey <hanno@hoowl.se>
To: rms@gnu.org
Cc: Stefan Kangas <stefankangas@gmail.com>, emacs-devel@gnu.org
Subject: Re: [ELPA] New package: jami-bot and org-jami-bot
Date: Sat, 03 Feb 2024 10:28:19 +0100	[thread overview]
Message-ID: <87y1c1lufe.fsf@hoowl.se> (raw)
In-Reply-To: <E1rV1Md-0007kE-JL@fencepost.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 3958 bytes --]


Hej,

> If I understood the calling conventions for
> jami-bot and the calling conventions for org-capture, rather than
> guessing them, I might be able to quickly develop something comparable
> to org-jami-bot which does not depend on Org.

I am really glad for your interest in jami-bot and happy to help you
with the above!

> I observed another gap: org-jami-bot does not contain documentation
> that answers the basic questions, "What does this do, and how do you use it?"
> Its user options and function arguments were carefully documented in detail;
> what was missing was the overall framework to understand it all.

You have a point in that the documentation has been quite sparse in the
code. I have started to close that gap and extended the documentation in
both jami-bot and org-jami-bot. The latter refers to the former where
appropriate.

It might also be useful to summarize the usage of org-jami-bot here with
a focus to clarify its function to any non-Org mode users:

As a user, the setup of org-jami-bot is done by calling
`org-jami-bot-default-setup' which is now highlighted more explicitly in
the commentary to the package. This function does the following:

- set up a Org mode capture template. Think of this as a combined format
  string and file name to save anything "captured".

- register a hook each to `jami-bot-text-message-functions' and
  `jami-bot-data-transfer-functions'. Both use the capture template to
  save any plain text message and data transfer, respectively, to the
  default notes file. Both message types are essentially just appended
  (under their own Org mode header as the template adds a leading '*'),
  but file transfers have an automatically generated header and include
  a link to the file already downloaded by jami-bot as well as some
  additional meta information such as the timestamp.

- add four entries to `jami-bot-command-function-alist'. jami-bot
  handles plain text messages that start with an exclamation mark
  followed by a single word as a "command" which is mapped to a function
  by said alist. The function then can parse the message or perform any
  other action. The return string of the function is sent as a reply to
  the original message. So this registers four new "commands" in
  jami-bot that are for further, more refined captures (explained below).

The four commands are as follows:

- "!today" and "!schedule" (`org-jami-bot--command-function-today' and
  `org-jami-bot--command-function-schedule', respectively) simply add
  today's date or a date specified in the message, respectively, to the
  Org mode header together with the "SCHEDULED:" keyword. Within Org
  mode, this makes this particular entry appear e.g. in time-based
  searches or the Org mode agenda which summarizes TODO entries for each
  day.

- "!start" and "!done" (`org-jami-bot--command-function-start' and
  `org-jami-bot--command-function-done', respectively) are used to
  redirect captures to a temporary buffer created when sending "!start"
  and finally captured/saved when sending "!done". The idea is that one
  might want to have several messages appended to a single Org mode
  header. So this is only necessary as each message by default (due to
  the capture template format) is added under its own header.

For a user that does not want to modify this behavior, only the call to
`org-jami-bot-default-setup' is needed, everything else is called via
jami-bot when sending messages.

A version without Org mode would only need to adjust the two hooks for
plain text and file transfer handling and store the messages in some
other format to a file. Whether or not the commands introduced by
org-jami-bot make sense in that context depends on the chosen format I
guess.


I attach the new versions of jami-bot and org-jami-bot with the extended
documentation. Please let me know whether or not these close any gap for
you and -- if not -- what to improve.


Thanks and cheers,
Hanno


[-- Attachment #2: jami-bot.el --]
[-- Type: application/emacs-lisp, Size: 15618 bytes --]

[-- Attachment #3: org-jami-bot.el --]
[-- Type: application/emacs-lisp, Size: 15236 bytes --]

  reply	other threads:[~2024-02-03  9:28 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-28 11:21 [ELPA] New package: jami-bot and org-jami-bot Hanno Perrey
2023-12-28 21:33 ` Stefan Kangas
2023-12-29 14:08   ` Hanno Perrey
2023-12-30  3:20 ` Richard Stallman
2023-12-30 10:29   ` Hanno Perrey
2024-01-01  3:34     ` Richard Stallman
2023-12-30 12:15   ` [DISCUSSION] Possible inclusion of org-capture.el into Emacs core (was: [ELPA] New package: jami-bot and org-jami-bot) Ihor Radchenko
2023-12-30 17:43     ` Stefan Kangas
2024-01-01  3:34     ` Richard Stallman
2024-01-01  3:59     ` Richard Stallman
2024-01-01 14:05       ` Ihor Radchenko
2023-12-30 12:43   ` [DISCUSSION] org-capture.el vs remember.el " Ihor Radchenko
2023-12-30 17:20     ` Stefan Kangas
2023-12-30 19:16       ` João Távora
2023-12-30 19:19         ` João Távora
2023-12-31 18:05         ` Adam Porter
2024-01-07 21:01 ` [ELPA] New package: jami-bot and org-jami-bot Stefan Kangas
2024-01-08 21:08   ` Richard Stallman
2024-01-08 21:29     ` Ihor Radchenko
2024-01-09  3:30     ` Eli Zaretskii
2024-01-09  4:42       ` Stefan Kangas
2024-01-10  4:24         ` Richard Stallman
2024-01-10  5:36           ` Stefan Kangas
2024-01-10  4:24       ` Richard Stallman
2024-01-11 15:30         ` ELPA packages and Org mode integration (was: [ELPA] New package: jami-bot and org-jami-bot) Ihor Radchenko
2024-01-09 19:39   ` [ELPA] New package: jami-bot and org-jami-bot Philip Kaludercic
2024-01-11 18:51     ` Richard Stallman
2024-01-11 20:12       ` Stefan Kangas
2024-01-12  7:24         ` Eli Zaretskii
2024-01-12 12:38           ` Ihor Radchenko
2024-01-12 13:59             ` Eli Zaretskii
2024-01-12 14:13               ` Ihor Radchenko
2024-01-12 14:37                 ` Eli Zaretskii
2024-01-12 14:45                   ` Ihor Radchenko
2024-01-12 15:04                     ` Eli Zaretskii
2024-01-12 15:17                       ` Ihor Radchenko
2024-01-14  3:03         ` Richard Stallman
2024-01-14  3:03         ` Richard Stallman
2024-01-14  9:58           ` Stefan Kangas
2024-01-14 10:25             ` Emanuel Berg
2024-01-14 11:43               ` Ihor Radchenko
2024-01-14 10:47             ` Emanuel Berg
2024-01-17  3:29             ` Richard Stallman
2024-01-31  3:34             ` Richard Stallman
2024-02-03  9:28               ` Hanno Perrey [this message]
2024-01-15  3:12           ` Richard Stallman
2024-01-12 15:04       ` Hanno Perrey
2024-01-16  3:31         ` Richard Stallman
2024-01-17  8:00           ` Hanno Perrey
2024-01-12 14:58     ` Hanno Perrey
2024-01-14 18:46     ` Hanno Perrey
2024-01-15  7:06       ` Philip Kaludercic
2024-01-17  7:59         ` Hanno Perrey
2024-01-17 23:39           ` Philip Kaludercic
2024-01-20 14:46             ` Hanno Perrey

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=87y1c1lufe.fsf@hoowl.se \
    --to=hanno@hoowl.se \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    --cc=stefankangas@gmail.com \
    /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).