[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnorb 452a3f0 177/449: Basic skeleton of registry usage
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnorb 452a3f0 177/449: Basic skeleton of registry usage |
Date: |
Fri, 27 Nov 2020 23:15:33 -0500 (EST) |
branch: externals/gnorb
commit 452a3f03b98849fe784db394c5a387768082dcdc
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Basic skeleton of registry usage
* lisp/gnorb-registry.el: New file
---
lisp/gnorb-registry.el | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++
lisp/gnorb.el | 1 +
2 files changed, 61 insertions(+)
diff --git a/lisp/gnorb-registry.el b/lisp/gnorb-registry.el
new file mode 100644
index 0000000..df05029
--- /dev/null
+++ b/lisp/gnorb-registry.el
@@ -0,0 +1,60 @@
+;;; gnorb-registry.el --- Registry implementation for Gnorb
+
+;; This file is in the public domain.
+
+;; Author: Eric Abrahamsen <eric@ericabrahamsen.net.>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Early on, Gnorb's message/todo tracking was done by relying on the
+;; user to insert links to received messages into an Org heading, and
+;; by automatically storing the Message-Ids of sent messages in a
+;; property (`gnorb-org-msg-id-key', defaulting to GNORB_MSG_ID) on
+;; the same heading. The heading could find all relevant messages by
+;; combining the links (incoming) and the IDs of the Gnorb-specific
+;; property (outgoing).
+;;
+;; In the end, this proved to be fragile and messy. Enter the
+;; registry. The Gnus registry is a specialization of a general
+;; "registry" library -- it's possible to roll your own. If you want
+;; to track connections between messages and Org headings, it's an
+;; obvious choice: Each relevant message is stored in the registry,
+;; keyed on its Message-ID, and the org-ids of all relevant headings
+;; are stored in a custom property, in our case gnorb-ids. This allows
+;; us to keep all Gnorb-specific data in one place, without polluting
+;; Org files or Gnus messages, persistent on disk, and with the added
+;; bonus of providing a place to keep arbitrary additional metadata.
+;;
+;; The drawback is that the connections are no longer readily visible
+;; to the user (they need to query the registry to see them), and it
+;; becomes perhaps a bit more difficult (but only a bit) to keep
+;; registry data in sync with the current state of the user's Gnus and
+;; Org files. But a clear win, in the end.
+
+;;; Code:
+
+(require 'gnus-registry)
+
+(defgroup gnorb-registry nil
+ "Gnorb's use of the Gnus registry."
+ :tag "Gnorb Registry"
+ :group 'gnorb)
+
+
+
+(provide 'gnorb-registry)
diff --git a/lisp/gnorb.el b/lisp/gnorb.el
index d972ee8..a7676b1 100644
--- a/lisp/gnorb.el
+++ b/lisp/gnorb.el
@@ -29,6 +29,7 @@
(require 'gnorb-gnus)
(require 'gnorb-bbdb)
(require 'gnorb-org)
+(require 'gnorb-registry)
(provide 'gnorb)
;;; gnorb.el ends here
- [elpa] externals/gnorb 3b6007a 152/449: Autoload cookies all around, (continued)
- [elpa] externals/gnorb 3b6007a 152/449: Autoload cookies all around, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ecf161e 154/449: Use copy-sequence on message-mode-hook!, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb fc9b6cf 153/449: Use existing functions for mime handles, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb f3b9fad 161/449: Split out msg-id to group/link functionality, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb a509ff6 164/449: Still trying to track outgoing messages, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb ade7ee8 163/449: Make hash entries for new sent-message TODOs, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4d584f1 171/449: Require gnorb-bbdb when popping up bbdb buffer, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 260161b 159/449: Check registry-enabled only after registry is loaded, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb f1545cd 162/449: Don't add a 'group key to registry if no group, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb d04bf53 178/449: Rename/move the registry-entry function, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 452a3f0 177/449: Basic skeleton of registry usage,
Stefan Monnier <=
- [elpa] externals/gnorb eaa4bf4 181/449: Begin shifting candidate finding to the registry, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 7f4dbed 180/449: Don't check for relevant headings if not tracking, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 093c4ed 185/449: Spurious 'g', Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 8121bf5 188/449: Stop creating hash table entries and GNORB_MSG_IDS, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 7b70966 190/449: Look up tracked messages via the registry, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 5ba511e 198/449: Dispense with the "insert a link" message, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 05e6a02 204/449: Docstring for gnorb-msg-id-to-link, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 4f302fa 205/449: New gnorb-collect-ids utility function, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 01e7b1e 206/449: New minor mode for nnir summary buffers, Stefan Monnier, 2020/11/27
- [elpa] externals/gnorb 69ddfd3 212/449: Delete duplicate org-ids for outgoing messages, Stefan Monnier, 2020/11/27