emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* patch: link to the log of an ERC session
@ 2008-01-10 14:55 Phil Jackson
  2008-01-11  1:06 ` Michael Olson
  0 siblings, 1 reply; 9+ messages in thread
From: Phil Jackson @ 2008-01-10 14:55 UTC (permalink / raw)
  To: emacs-orgmode

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

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-erc-links.diff --]
[-- Type: text/x-diff, Size: 1161 bytes --]

--- /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)

[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


Cheers,
Phil

[-- Attachment #4: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-01-28 17:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-10 14:55 patch: link to the log of an ERC session Phil Jackson
2008-01-11  1:06 ` Michael Olson
2008-01-11 10:49   ` Phil Jackson
2008-01-16 16:52     ` Carsten Dominik
2008-01-16 19:06       ` Phil Jackson
2008-01-21 21:43         ` Phil Jackson
2008-01-22 13:19           ` Carsten Dominik
2008-01-27 18:53             ` Bastien
2008-01-28 17:43               ` Phil Jackson

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).