unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>
To: emacs-devel@gnu.org, adatgyujto@gmail.com
Cc: tkk@misasa.okayama-u.ac.jp
Subject: Re: Occur should use the region as input if it's active
Date: Fri, 17 Jan 2014 09:52:46 +0900 (JST)	[thread overview]
Message-ID: <20140117.095246.07098091.tkk@misasa.okayama-u.ac.jp> (raw)
In-Reply-To: <loom.20140116T194740-227@post.gmane.org>

I think that is a good idea and should be build in with following two
lines. With this, isearch and occur get closer.

  (isearch-mode t)
  (isearch-update-ring (setq isearch-string (buffer-substring-no-properties
                   (region-beginning) (region-end))))


> Date: Thu, 16 Jan 2014 18:55:48 +0000 (UTC)
> From: Tom <adatgyujto@gmail.com>
> To: emacs-devel@gnu.org
> Subject: Occur should use the region as input if it's active
> Message-ID: <loom.20140116T194740-227@post.gmane.org>
> Content-Type: text/plain; charset=us-ascii
> 
> If often happens to me that I'm perusing a buffer and I want to 
> search for some word or phrase in it. To do this I simply select the 
> text and use this code to instantly get occur matches of it:
> 
>     (defun my-occur ()
>       (interactive)
>       (if (use-region-p)
>           (occur (buffer-substring-no-properties
>                   (region-beginning) (region-end)))
>         (call-interactively 'occur)))
> 
> Shouldn't the builtin occur do this? It's quite convenient and
> efficient and in my experience most of the occur searches are
> of these kind (searching for something I see) and it's less
> often that I actualy need to type in the search term.



      parent reply	other threads:[~2014-01-17  0:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-16 18:55 Occur should use the region as input if it's active Tom
2014-01-16 19:23 ` Drew Adams
2014-01-16 19:32   ` Tom
2014-01-16 19:51     ` Drew Adams
2014-01-16 19:36   ` Drew Adams
2014-01-16 20:11     ` Tom
2014-01-17  8:11       ` Juri Linkov
2014-01-17  0:52 ` Tak Kunihiro [this message]

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140117.095246.07098091.tkk@misasa.okayama-u.ac.jp \
    --to=tkk@misasa.okayama-u.ac.jp \
    --cc=adatgyujto@gmail.com \
    --cc=emacs-devel@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).