GNU bug report logs - #17558
24.4.50; global-subword-mode breaks ERC

Previous Next

Package: emacs;

Reported by: Dima Kogan <dima <at> secretsauce.net>

Date: Fri, 23 May 2014 09:20:02 UTC

Severity: normal

Tags: fixed

Merged with 20347

Found in versions 24.4.50, 25.0.50

Fixed in version 25.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #64 received at 17558 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Dima Kogan <dima <at> secretsauce.net>
Cc: 17558 <at> debbugs.gnu.org
Subject: Re: bug#17558: 24.4.50; global-subword-mode breaks ERC
Date: Sat, 09 Jan 2016 10:04:03 +0100
Dima Kogan <dima <at> secretsauce.net> 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




This bug report was last modified 9 years and 161 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.