ag91 / ol-emacs-slack

Org links for emacs-slack (https://github.com/yuya373/emacs-slack)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Org link for Emacs Slack

This is a bit of code to make Org links from Emacs Slack buffers. Note that this is a work in progress, so the links point to the buffers. If necessary, I will look into how to make them point to the exact line of the conversation.

Usage

Load the Elisp file like this:

(load "ol-emacs-slack.el")
(require 'ol-emacs-slack)

Then visit an Emacs Slack buffer and run org-store-link to store a pure Org Link to that buffer.

Ideas on how to use this

I use this to add link to my Org Agenda when I receive message similarly to what I wrote about in https://ag91.github.io/blog/2020/08/14/slack-messages-in-your-org-agenda/

(use-package alert
  :after slack
  :init
  (alert-define-style
   'my/alert-style :title
   "Make Org headings for messages I receive - Style"
   :notifier
   (lambda (info)
     (when (get-buffer "Slack.org") (with-current-buffer "Slack.org" (save-buffer)))
     (write-region
      (s-concat
       "* TODO "
       (plist-get info :title)
       " : "
       (format
        "[[emacs-slack:%s][%s]] :slack:"
        (plist-get info :title)
        (s-truncate 127 (s-replace "\n" ";" (plist-get info :message))))
       "\n"
       (format "<%s>" (format-time-string "%Y-%m-%d %H:%M"))
       "\n"
       (plist-get info :message)
       "\n")
      nil
      "~/<yourPath>/Slack.org"
      t)))
  (setq alert-default-style 'message)
  (add-to-list 'alert-user-configuration
               '(((:category . "slack")) my/alert-style nil)))

Hopefully it is helpful to you as well.

About

Org links for emacs-slack (https://github.com/yuya373/emacs-slack)


Languages

Language:Emacs Lisp 100.0%