From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phil Jackson Subject: patch: link to the log of an ERC session Date: Thu, 10 Jan 2008 14:55:47 +0000 Message-ID: <87k5mh4tn0.fsf@shellarchive.co.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JCyoz-000456-KF for emacs-orgmode@gnu.org; Thu, 10 Jan 2008 09:55:53 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JCyoy-00043Q-JO for emacs-orgmode@gnu.org; Thu, 10 Jan 2008 09:55:53 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JCyoy-00043A-Ec for emacs-orgmode@gnu.org; Thu, 10 Jan 2008 09:55:52 -0500 Received: from b.painless.aaisp.net.uk ([81.187.81.52]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JCyoy-0000Se-0w for emacs-orgmode@gnu.org; Thu, 10 Jan 2008 09:55:52 -0500 Received: from 241.28.187.81.in-addr.arpa ([81.187.28.241] helo=phil-desktop) by b.painless.aaisp.net.uk with esmtp (Exim 4.62) (envelope-from ) id 1JCyov-00074C-Lb for emacs-orgmode@gnu.org; Thu, 10 Jan 2008 14:55:49 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=org-erc-links.diff --- /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 --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --=-=-=--