all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Masatake YAMATO <yamato@redhat.com>
To: 6220@debbugs.gnu.org
Subject: bug#6220: subword support in isearch-yank-word-or-char
Date: Wed, 19 May 2010 19:28:03 +0900 (JST)	[thread overview]
Message-ID: <20100519.192803.739015423147898448.yamato@redhat.com> (raw)

This is not a bug report. This is a request to include my patch to
official emacs tree.


With the patch you can pull a subword as yank text when you do
\C-w in isearch.

(I've submitted this to emacs-devel the last year.
 http://lists.gnu.org/archive/html/emacs-devel/2009-12/msg00604.html)
      
Masatake YAMATO


2009-12-15  Masatake YAMATO  <yamato@redhat.com>

       * isearch.el (isearch-yank-word-or-char): Pull next subword
       when `subword-mode' is activated.

--- isearch.el  7 Dec 2009 17:30:05 -0000       1.351
+++ isearch.el  15 Dec 2009 08:58:40 -0000
@@ -1538,14 +1538,18 @@
   (interactive "p")
   (isearch-yank-internal (lambda () (forward-char arg) (point))))
 
+(declare-function subword-forward "subword" (&optional arg))
 (defun isearch-yank-word-or-char ()
-  "Pull next character or word from buffer into search string."
+  "Pull next character, subword or word from buffer into search string.
+Subword is used when `subword-mode' is activated. "
   (interactive)
   (isearch-yank-internal
    (lambda ()
      (if (or (= (char-syntax (or (char-after) 0)) ?w)
              (= (char-syntax (or (char-after (1+ (point))) 0)) ?w))
-         (forward-word 1)
+        (if (and (fboundp 'subword-mode) subword-mode)
+            (subword-forward 1)
+            (forward-word 1))
        (forward-char 1)) (point))))
 
 (defun isearch-yank-word ()
--- progmodes/subword.el        1 Dec 2009 09:28:23 -0000       1.3
+++ progmodes/subword.el        15 Dec 2009 08:58:40 -0000
@@ -76,7 +76,7 @@
 ;; the old `c-forward-into-nomenclature' originally contributed by
 ;; Terry_Glanfield dot Southern at rxuk dot xerox dot com.
 
-;; TODO: ispell-word and subword oriented C-w in isearch.
+;; TODO: ispell-word.
 
 ;;; Code:





             reply	other threads:[~2010-05-19 10:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19 10:28 Masatake YAMATO [this message]
2010-05-20 22:36 ` bug#6220: subword support in isearch-yank-word-or-char Juri Linkov

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=20100519.192803.739015423147898448.yamato@redhat.com \
    --to=yamato@redhat.com \
    --cc=6220@debbugs.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.