|
From: | Tom |
Subject: | Occur should use the region as input if it's active |
Date: | Thu, 16 Jan 2014 18:55:48 +0000 (UTC) |
User-agent: | Loom/3.14 (http://gmane.org/) |
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.
[Prev in Thread] | Current Thread | [Next in Thread] |