emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] patch: link to the log of an ERC session


From: Phil Jackson
Subject: [Orgmode] patch: link to the log of an ERC session
Date: Thu, 10 Jan 2008 14:55:47 +0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

Hi,

I get a lot of my information from ERC/bitlbee so wrote this patch to
allow for linking against the log associated with an ERC session.

Sorry, only tested in GNU.

--- /home/phil/org-5.18a/org.el 2008-01-06 15:30:26.000000000 +0000
+++ org.el      2008-01-10 14:12:27.000000000 +0000
@@ -11765,6 +11765,22 @@
              link (org-make-link cpltxt))
        (org-store-link-props :type "bbdb" :name name :company company)))
 
+     ((eq major-mode 'erc-mode)
+      (let ((erc-line (buffer-substring-no-properties
+                       (point-at-bol) (point-at-eol))))
+        (if (erc-logging-enabled nil)
+            (progn
+              (erc-save-buffer-in-logs)
+              (with-current-buffer (find-file-noselect (erc-current-logfile))
+                (goto-char (point-max))
+                (unless (search-backward erc-line nil t)
+                  (error "Unable to find this line in the logs: '%s'"
+                         erc-line))
+                  (setq cpltxt (concat "file:" (abbreviate-file-name
+                                                buffer-file-name)
+                                       "::" erc-line))))
+            (error "This ERC session is not being logged"))))
+
      ((eq major-mode 'Info-mode)
       (setq link (org-make-link "info:"
                                (file-name-nondirectory Info-current-file)
Cheers,
Phil

reply via email to

[Prev in Thread] Current Thread [Next in Thread]