Function: org-irc-erc-get-line-from-log
org-irc-erc-get-line-from-log is a byte-compiled function defined in
ol-irc.el.gz.
Signature
(org-irc-erc-get-line-from-log ERC-LINE)
Documentation
Find the best line to link to from the ERC logs given ERC-LINE as a start.
If the user is on the ERC-prompt then search backward for the first non-blank line, otherwise return the current line. The result is a cons of the filename and search string.
Source Code
;; Defined in /usr/src/emacs/lisp/org/ol-irc.el.gz
;; ERC specific functions
(defun org-irc-erc-get-line-from-log (erc-line)
"Find the best line to link to from the ERC logs given ERC-LINE as a start.
If the user is on the ERC-prompt then search backward for the
first non-blank line, otherwise return the current line. The
result is a cons of the filename and search string."
(erc-save-buffer-in-logs)
(require 'erc-log)
(with-current-buffer (find-file-noselect (erc-current-logfile))
(goto-char (point-max))
(list
(abbreviate-file-name buffer-file-name)
;; can we get a '::' part?
(if (string= erc-line (erc-prompt))
(progn
(goto-char (line-beginning-position))
(when (search-backward-regexp "^[^ ]" nil t)
(buffer-substring-no-properties (line-beginning-position)
(line-end-position))))
(when (search-backward erc-line nil t)
(buffer-substring-no-properties (line-beginning-position)
(line-end-position)))))))