emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Phil Jackson <phil@shellarchive.co.uk>
To: emacs-orgmode@gnu.org
Subject: patch: link to the log of an ERC session
Date: Thu, 10 Jan 2008 14:55:47 +0000	[thread overview]
Message-ID: <87k5mh4tn0.fsf@shellarchive.co.uk> (raw)

[-- 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

             reply	other threads:[~2008-01-10 14:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-10 14:55 Phil Jackson [this message]
2008-01-11  1:06 ` patch: link to the log of an ERC session 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k5mh4tn0.fsf@shellarchive.co.uk \
    --to=phil@shellarchive.co.uk \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).