all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: William Xu <william.xwl@gmail.com>
To: emacs-devel@gnu.org
Subject: Nasty conflicts between erc-match.el and erc-stamp.el
Date: Tue, 06 Apr 2010 22:06:23 +0800	[thread overview]
Message-ID: <m2k4skvfog.fsf@gmail.com> (raw)

Hi!

If erc-stamp-mode is enabled before erc-match-mode,
erc-text-matched-hook will never succeed.  Try below and edebug
my-erc-text-matched-hook.  

  (erc-stamp-mode 1)
  (setq erc-insert-timestamp-function
        'erc-insert-timestamp-left)
                  
  (erc-match-mode 1)

  (defun my-erc-text-matched-hook ()
     (message "matched!"))
  
  (add-hook 'erc-text-matched-hook 'my-erc-text-matched-hook)

The cause is that `erc-match-message' tries to find erc-parsed property
at (point-min) in line: 

  (vector (erc-get-parsed-vector (point-min)))

But when timestamp mode is enabled earlier, it will insert a timestamp
string to the beginning, with its own text properties, in
`erc-timestamp-format-left'.  Hence, this makes erc-match-message fail.  

One not-so-good solution is scan the whole line looking for the
erc-parsed property.  

This nasty thing had annoyed a newcomer, and took a while to figure what
was going wrong...

-- 
William

http://xwl.appspot.com





                 reply	other threads:[~2010-04-06 14:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

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

  git send-email \
    --in-reply-to=m2k4skvfog.fsf@gmail.com \
    --to=william.xwl@gmail.com \
    --cc=emacs-devel@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.