all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#38185: isearch-yank-word-or-char grabs periods at ends of words when used on man pages
@ 2019-11-10  0:02 積丹尼 Dan Jacobson
  2019-11-14  5:41 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: 積丹尼 Dan Jacobson @ 2019-11-10  0:02 UTC (permalink / raw)
  To: 38185

When used on man pages, isearch-yank-word-or-char also gets periods at
the ends of words, along with the word. Commas, however, thankfully, are
not gotten.

    C-w runs the command isearch-yank-word-or-char (found in
    overriding-terminal-local-map), which is an interactive compiled Lisp
    function in ‘isearch.el’.

    (isearch-yank-word-or-char)

    Pull next character, subword or word from buffer into search string.
    Subword is used when ‘subword-mode’ is activated.

M-x man cat
Put cursor here:

  blarf.
  ^
Hit C-s C-w

Cursor now here:
  blarf.
        ^
Should be here:
  blarf.
       ^

emacs-version "26.3".





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#38185: isearch-yank-word-or-char grabs periods at ends of words when used on man pages
  2019-11-10  0:02 bug#38185: isearch-yank-word-or-char grabs periods at ends of words when used on man pages 積丹尼 Dan Jacobson
@ 2019-11-14  5:41 ` Lars Ingebrigtsen
  2019-11-14  5:43   ` Lars Ingebrigtsen
  2019-11-16 20:25   ` Juri Linkov
  0 siblings, 2 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2019-11-14  5:41 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 38185

積丹尼 Dan Jacobson <jidanni@jidanni.org> writes:

> When used on man pages, isearch-yank-word-or-char also gets periods at
> the ends of words, along with the word. Commas, however, thankfully, are
> not gotten.
>
>     C-w runs the command isearch-yank-word-or-char (found in
>     overriding-terminal-local-map), which is an interactive compiled Lisp
>     function in ‘isearch.el’.
>
>     (isearch-yank-word-or-char)
>
>     Pull next character, subword or word from buffer into search string.
>     Subword is used when ‘subword-mode’ is activated.

The command calls

(isearch--yank-char-or-syntax '(?w) 'forward-word arg)

so I guess this means that "." has word syntax in Man buffers, but ","
doesn't?

I guess that makes sense -- you can have stuff like "foo.bar" that
should be considered a single "word", but I agree that it doesn't make
much sense to have a terminating "." be part of a word.

I'm not sure how to fix that, though -- switch isearch-yank-word-or-char
to something like ffap instead of using syntax classes?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#38185: isearch-yank-word-or-char grabs periods at ends of words when used on man pages
  2019-11-14  5:41 ` Lars Ingebrigtsen
@ 2019-11-14  5:43   ` Lars Ingebrigtsen
  2019-11-16 20:25   ` Juri Linkov
  1 sibling, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2019-11-14  5:43 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 38185

Lars Ingebrigtsen <larsi@gnus.org> writes:

> I'm not sure how to fix that, though -- switch isearch-yank-word-or-char
> to something like ffap instead of using syntax classes?

I mean thingatp.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#38185: isearch-yank-word-or-char grabs periods at ends of words when used on man pages
  2019-11-14  5:41 ` Lars Ingebrigtsen
  2019-11-14  5:43   ` Lars Ingebrigtsen
@ 2019-11-16 20:25   ` Juri Linkov
  2019-11-17  5:51     ` Lars Ingebrigtsen
  1 sibling, 1 reply; 5+ messages in thread
From: Juri Linkov @ 2019-11-16 20:25 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 38185, 積丹尼 Dan Jacobson

> (isearch--yank-char-or-syntax '(?w) 'forward-word arg)
>
> so I guess this means that "." has word syntax in Man buffers, but ","
> doesn't?
>
> I guess that makes sense -- you can have stuff like "foo.bar" that
> should be considered a single "word", but I agree that it doesn't make
> much sense to have a terminating "." be part of a word.
>
> I'm not sure how to fix that, though -- switch isearch-yank-word-or-char
> to something like ffap instead of using syntax classes?

isearch-yank-word-or-char was intended to yank exactly the same text
as navigated by forward-word.

However, I can't reproduce this issue in Man buffers: forward-word
doesn't consider "." as part of a word.  Ah, this is because I fixed
this long ago in the init file ~/.emacs as:

  ;; Don't use `man-mode-syntax-table' that sets word syntax to `.', `_', `:'.
  (add-hook 'Man-mode-hook
            (lambda ()
              (set-syntax-table text-mode-syntax-table)))





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#38185: isearch-yank-word-or-char grabs periods at ends of words when used on man pages
  2019-11-16 20:25   ` Juri Linkov
@ 2019-11-17  5:51     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2019-11-17  5:51 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 38185, 積丹尼 Dan Jacobson

Juri Linkov <juri@linkov.net> writes:

> isearch-yank-word-or-char was intended to yank exactly the same text
> as navigated by forward-word.

And I guess we don't really want to change the syntax class of "." in
Man buffers, so there isn't really anything to fix here, and I'm closing
this bug report.

> However, I can't reproduce this issue in Man buffers: forward-word
> doesn't consider "." as part of a word.  Ah, this is because I fixed
> this long ago in the init file ~/.emacs as:
>
>   ;; Don't use `man-mode-syntax-table' that sets word syntax to `.', `_', `:'.
>   (add-hook 'Man-mode-hook
>             (lambda ()
>               (set-syntax-table text-mode-syntax-table)))

(And Dan can do this if he wants a more text-mode like behaviour.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-17  5:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-10  0:02 bug#38185: isearch-yank-word-or-char grabs periods at ends of words when used on man pages 積丹尼 Dan Jacobson
2019-11-14  5:41 ` Lars Ingebrigtsen
2019-11-14  5:43   ` Lars Ingebrigtsen
2019-11-16 20:25   ` Juri Linkov
2019-11-17  5:51     ` Lars Ingebrigtsen

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.