From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Antoine Levitt Newsgroups: gmane.emacs.bugs Subject: bug#12740: 24.2.50; ERC fix broke modules after require Date: Fri, 26 Oct 2012 17:52:40 +0200 Message-ID: <87objp9qnr.fsf@gmail.com> References: <87625xe0w0.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1351266778 15971 80.91.229.3 (26 Oct 2012 15:52:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Oct 2012 15:52:58 +0000 (UTC) Cc: 12740@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 26 17:53:06 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TRmDa-0007cH-L8 for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Oct 2012 17:53:06 +0200 Original-Received: from localhost ([::1]:48114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRmDS-00042A-Qy for geb-bug-gnu-emacs@m.gmane.org; Fri, 26 Oct 2012 11:52:58 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRmDQ-00041i-DB for bug-gnu-emacs@gnu.org; Fri, 26 Oct 2012 11:52:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRmDN-00033n-10 for bug-gnu-emacs@gnu.org; Fri, 26 Oct 2012 11:52:56 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52907) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRmDM-00033j-TW for bug-gnu-emacs@gnu.org; Fri, 26 Oct 2012 11:52:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TRmFS-0005Bh-2R for bug-gnu-emacs@gnu.org; Fri, 26 Oct 2012 11:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Antoine Levitt Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Oct 2012 15:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12740 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12740-submit@debbugs.gnu.org id=B12740.135126689619930 (code B ref 12740); Fri, 26 Oct 2012 15:55:02 +0000 Original-Received: (at 12740) by debbugs.gnu.org; 26 Oct 2012 15:54:56 +0000 Original-Received: from localhost ([127.0.0.1]:34925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TRmFM-0005BP-3P for submit@debbugs.gnu.org; Fri, 26 Oct 2012 11:54:56 -0400 Original-Received: from mail-wi0-f174.google.com ([209.85.212.174]:55944) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TRmFJ-0005BI-Fn for 12740@debbugs.gnu.org; Fri, 26 Oct 2012 11:54:55 -0400 Original-Received: by mail-wi0-f174.google.com with SMTP id hq7so471414wib.15 for <12740@debbugs.gnu.org>; Fri, 26 Oct 2012 08:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=PYXSAbARlXgM9jXzzZG+OKMpWwGpCWaZ8ioYtccLYtE=; b=JKJPD7FmoaEE+NqU5eTfL1L4knFWeXtFImLwBe9VMGFJf5bXWaMOTo+bX9NsBeyJyB qk+3gDriaUF/vKh8LrLcAY14fwtpXX1j+O33KxIvjB/ZX4uYRyFoQaZP3wGoruxu4mQV jVchZj4FOrNsSOp23KBOOCevlNknPqTckiw7DsDICxAObbnEM/cbynlrdq9JjtRMe7FB quDdBiplcjd9JZ2PUvZqyMhgQaNQRW6gKHRAzIEuTn4aj8H9BjffAx3EHMN9D6q4qgCG odWpB0E5najQDsJXAIzGfI1eMHJ3EELpKDds+iQ3R9OdzhPw+iLPo0DewtL+YFM/bCJC LHKQ== Original-Received: by 10.180.99.194 with SMTP id es2mr5572568wib.15.1351266762998; Fri, 26 Oct 2012 08:52:42 -0700 (PDT) Original-Received: from sigma ([194.214.160.170]) by mx.google.com with ESMTPS id cn6sm3524780wib.9.2012.10.26.08.52.41 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 26 Oct 2012 08:52:42 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Fri, 26 Oct 2012 11:21:33 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:66082 Archived-At: --=-=-= Content-Type: text/plain 10/26/2012 17:21, Stefan Monnier >> emacs -Q >> (require 'erc) >> (setq erc-modules '(truncate)) >> (erc-update-modules) >> (erc :server "irc.freenode.net") >> This worked fine before > > I don't know what "worked" means precisely, but I tried your above > recipe and "it worked" in the sense that it did something which didn't > look like an error. Sorry if this bug report is confused. I've tried to reduce the original bug (which has weird effects on my configuration) to a simple test case. The bug, which I had not described and you could not guess, was that lines were filled. My bad. Please discard my original bug report and consider the following: (require 'erc) (setq erc-modules '()) (erc-update-modules) used to disable buffer filling (try it on a large window). It did so before your commits, not after. You might argue that this is the intended behaviour, because erc-update-modules says that it only enables modules, not disable them (in which case, to disable modules, is one supposed to set erc-modules before requiring erc ? I liked the old way better). I also attach a more involved example of a bug that appeared with your commits, and has nothing to do with erc-modules (I think). I was hoping the fix for the simpler issue would also fix the more involved one, which is why I didn't report it in the first place, but here it is anywyay. The code is supposed to colour the nicks of people (here, all in yellow). The bug results from an interaction with erc-hide-timestamps, which didn't occur before your commits. Sorry again. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=test.el Content-Transfer-Encoding: quoted-printable ;; (require 'erc) ;; (setq erc-modules '()) ;; (erc-update-modules) (setq erc-modules '(autojoin button completion irccontrols list match menu move-to-prompt netsplit networks noncommands readonly ring scrolltobottom stamp track autoaway truncate)) (setq=20=20=20=20=20=20=20 word-wrap t erc-timestamp-only-if-changed-flag nil erc-timestamp-format "%D %T " erc-hide-timestamps t erc-pcomplete-order-nickname-completions t erc-insert-timestamp-function 'erc-insert-timestamp-left) (fset 'yes-or-no-p 'y-or-n-p) (set-frame-parameter nil 'fullscreen 'fullboth) (defun erc-put-colors-on-line () "Colorise a message. First, we colorize the sender, then we go through the message looking for nicks to colorize. " ;; makes word boundaries work (with-syntax-table erc-button-syntax-table (save-excursion (goto-char (point-min)) ;; colorise the nick of the person talking, unless this is an outgoin= g message, in which case ;; something else already does the coloring and we don't want to inte= rfere ;; erc-send-this is only t in send-modify-hook, see the lambdas below (unless erc-is-sending (if (looking-at "<\\([^>]*\\)>") (let ((nick (match-string 1))) (put-text-property (match-beginning 1) (match-end 1) 'face (cons 'foreground-color (erc-get-color-for-nick nick)))))) ;; go through the message, find nicks and colorise them. ;; From erc-button with modifications ;; ignore the author, already taken care of by the code above (if (looking-at "<\\([^>]*\\)>")(forward-word)) (while (forward-word 1) (setq bounds (bounds-of-thing-at-point 'word)) (when bounds (setq word (buffer-substring-no-properties (car bounds) (cdr bounds))) (when (or (and (erc-server-buffer-p) (erc-get-server-user word)) (and erc-channel-users (erc-get-channel-user word))) (let ((nick ( erc-server-user-nickname (if (erc-server-buffer-p) (erc-get-server-user word) (car (erc-get-channel-user word)))))) (put-text-property (car bounds) (cdr bounds) 'face (list (cons 'foreground-color (erc-get-color-for-nick nick)) :weight 'bold))))))))) ;;put the hooks at the end (require 'erc) (add-hook 'erc-insert-modify-hook '(lambda () (let ((erc-is-sending nil)) (= erc-put-colors-on-line))) 'attheend) (add-hook 'erc-send-modify-hook '(lambda () (let ((erc-is-sending t)) (erc-= put-colors-on-line))) 'attheend) (defun erc-get-color-for-nick (nick) "Gets a color for NICK. If NICK is specified in erc-nick-color-alist, use= it, else hash the nick and get a color from that" "yellow") ;; (erc :server "localhost" :nick "Test") --=-=-=--