all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Occur should use the region as input if it's active
@ 2014-01-16 18:55 Tom
  2014-01-16 19:23 ` Drew Adams
  2014-01-17  0:52 ` Tak Kunihiro
  0 siblings, 2 replies; 8+ messages in thread
From: Tom @ 2014-01-16 18:55 UTC (permalink / raw)
  To: emacs-devel

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.




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

end of thread, other threads:[~2014-01-17  8:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

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.