From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#17558: 24.4.50; global-subword-mode breaks ERC Date: Sat, 09 Jan 2016 10:04:03 +0100 Message-ID: References: <87ppj4ette.fsf@secretsauce.net> <537FB4C8.3080809@dancol.org> <87a924mbuk.fsf@secretsauce.net> <8rvbghcp9y.fsf@fencepost.gnu.org> <553EB8A7.7070103@dancol.org> <55404294.40908@dancol.org> <87y4iiw0p3.fsf@secretsauce.net> <87wps0opcl.fsf@gnus.org> <87fuy7dhrm.fsf@secretsauce.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1452330331 12348 80.91.229.3 (9 Jan 2016 09:05:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Jan 2016 09:05:31 +0000 (UTC) Cc: 17558@debbugs.gnu.org To: Dima Kogan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 09 10:05:19 2016 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 1aHpSS-0002kp-Bd for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jan 2016 10:05:12 +0100 Original-Received: from localhost ([::1]:39764 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHpSR-0005Sy-MM for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jan 2016 04:05:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHpSN-0005Si-Ht for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2016 04:05:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHpSI-0005a5-Dm for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2016 04:05:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHpSI-0005a1-AD for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2016 04:05:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aHpSH-0006eZ-VT for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2016 04:05:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Magne Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Jan 2016 09:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17558 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17558-submit@debbugs.gnu.org id=B17558.145233026925529 (code B ref 17558); Sat, 09 Jan 2016 09:05:01 +0000 Original-Received: (at 17558) by debbugs.gnu.org; 9 Jan 2016 09:04:29 +0000 Original-Received: from localhost ([127.0.0.1]:43602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aHpRk-0006dh-VH for submit@debbugs.gnu.org; Sat, 09 Jan 2016 04:04:29 -0500 Original-Received: from hermes.netfonds.no ([80.91.224.195]:59978) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aHpRj-0006dW-6E for 17558@debbugs.gnu.org; Sat, 09 Jan 2016 04:04:27 -0500 Original-Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=stories) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aHpRL-00081N-Ro; Sat, 09 Jan 2016 10:04:03 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAADFBMVEU1Njacm5jOzcv6+vmX d6tUAAACSElEQVQokSXOT0ySYQDH8d+LoHN2QBdr1cwutZWHTh06AWW5buh4pBdmeEgKCLlkKs3p +nPqQiUaOkM34R0vi+eEJQuetg5dbU37t3JtgqlLT49M3+Dpbd1+n/0uXyzbTGmSD4SGXnoofo4f Jcm87869dbMVatTie16I7WvrfVaE5ob7lwps54JznuJ7qtq/MxpcJ6qfwj8jVlaLmWgqthTG14n6 J5Ns+n7SxylcUUsLGVNLDnkhDJKDgRW3+QHTERtFtyiK7YMRzhCSYdGxJlIlhnD80WW1SKn4EaNw 06fxBSlQo5+JQHJtfBVS/ZJ3goTh35BvAUheJy6GXh7o03Em6x9IIL4nP9TRyCKjQaRpQd8wiaGM hmw4AjNxGFgkrKN9BCdPfDCw6TENXs9r4FhUYmtMg7vnmg6npCbUDCriDzAwByGqFO/ZbR3zEt+L ekBMs7CkndLGC7Sj2ekGLLa6rTw64SDHYZRsdYubxgY4zJ5xI8xNyq9DdRhsnlrW0ab8Dj3AsJ3o 1bYg/bT/DmabqRUwPM7GS5f0XnvTMlrdSlx+pj+wi8xE52b57keYjTib4F3y9l6/ghuAlOdX0lta OQOHo6Ejy68qeZp0gRxumz3NPVM0Er+J3pDypjHnmX6V3/HAm6hUO3IRNb+1q8EqhOjiwZnAJNUw JkStmyfK6Syt/IOw5xbLgQ3Xf1zk1VSSKxWcE6Jo4AUfF0MKvEIw8NoXTawcQYsO2/laPLjLO9Ej xO7bU2zW+63UA0L8cmyQyG5VVf8CtHEodbLbHikAAAAASUVORK5CYII= In-Reply-To: <87fuy7dhrm.fsf@secretsauce.net> (Dima Kogan's message of "Fri, 08 Jan 2016 10:54:05 -0800") User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (gnu/linux) X-MailScanner-ID: 1aHpRL-00081N-Ro MailScanner-NULL-Check: 1452935044.01108@D3ocC448VhNc0i0FxmmMHw X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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:111410 Archived-At: Dima Kogan writes: > That would be nice, but no. This chunk of code was affected by > subword-mode in two ways: > > 1. (forward-word 1) > 2. (bounds-of-thing-at-point 'word) > > The proposed change only takes care of #1, and I don't see an obvious > way to make it take care of both. I can do (while (erc-forward-word) > ...), but then to get the word, I'd need to backtrack to the previous > word marker, and it's not obvious to me that this would be an > improvement over the existing change in the patch. > > The attached patch thus has no changes to this hunk. Let me know if you > think of a nicer way to do this. [...] > - (while (forward-word 1) > - (setq bounds (bounds-of-thing-at-point 'word)) > - (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))) > - (erc-button-add-button (car bounds) (cdr bounds) > - fun t (list word))))))) > + > + (while > + (progn > + > + ;; I move forward a word (independent of subword-mode) ... > + (skip-syntax-forward "^w") > + (let* > + ((word-start (point)) > + (word-end > + (progn (skip-syntax-forward "w") (point)))) > + This still seems very difficult to understand. The old version has a clear loop condition > - (while (forward-word 1) while in the new version everything is inside a progn, making it kinda difficult to follow. Would it be possible to write a version of (bounds-of-thing-at-point 'word) that's subword-mode agostic (erc-word-at-point) to preserve the logic? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no