Features Implemented
Category listing and navigation
Topic viewing with proper formatting
Reply functionality with markdown support
Proper CSRF token handling for API requests
Clean buffer management and UI
Current Focus
Working on improving the user experience with:
They were separate posts. And yes it was a bit spammy. David has since set me up with a testing area. I was testing new features in my discourse package for creating new topics this morning.
;; Global keymap
(define-key global-map (kbd "C-c d") discourse-command-map)
That violates the key bindings convention for packages. C-c <letter> is reserved for users, see (elisp) Key Binding Convention:
D.2 Key Binding Conventions
===========================
Don’t define C-c LETTER as a key in Lisp programs. Sequences consisting of C-c and a letter (either upper or lower case; ASCII or non-ASCII) are reserved for users; they are the only sequences reserved for users, so do not block them.
Changing all the Emacs major modes to respect this convention was a lot of work; abandoning this convention would make that work go to waste, and inconvenience users. Please comply with it.
No worries. I’d just recommend to test your package with a local installation of Discourse. That allows you to also check multi-user experience (e.g. have user Glenneth active in Emacs instance 1 and Troll in Emacs instance 2) without having to ask other users for private messages and/or replies
Another easy fix: remove the duplicate functions. discourse--create-topic is defined twice, once in L870, once in L1183.
It’s also a bit weird to see discourse-api-request intermixed with plain request. That will make refactoring (or replacing request with url-retrieve) harder later on.
(I’d comment on Codeberg, but I don’t have an account there, sorry)
@ashraz i’ve changed the discourse command map keybindings in a feature branch for now and also removed the duplicate create-topic function. New keybindings look like this
Sequences consisting of C-c followed by a control character or a
digit are reserved for major modes.
I’d recommend you to read (elisp) Key Binding Conventions and also go the “usual” way, e.g. instruct your users to set up their own bindings. Both Org mode and Prot’s denote do so in their sample configuration.
Also, that almost looks like you want to have a transient menu. So you might consider using transient and a discourse-menu there instead of a keymap. Speaking of menu, you might also want to tackle an Discourse menu (for menu-bar-mode).