3

Any existing package that can do incremental search inside a function definition instead of the whole buffer?

Now the best I can do is to turn on semantic-mode along with semantic-stickyfunc-mode and carefully search within its scope.

Drew
  • 77,472
  • 10
  • 114
  • 243
cdnszip
  • 347
  • 1
  • 7
  • 1
    Can you explain what you want more clearly? Do what to do the search from an elisp function, or do want to search interactively within the text of a function definition in some file? In the latter case, you could use narrowing to limit the search. – Andrew Swann Mar 13 '17 at 07:39
  • 7
    C-x n d (or M-x narrow-to-defun) then search? – xuchunyang Mar 13 '17 at 09:17

1 Answers1

3

As @xuchunyang said in a comment to your question, you can first narrow the buffer to the function definition.

Or you can use library Isearch+, which lets you search just the active region, without narrowing.

Non-nil option isearchp-restrict-to-region-flag does this. You can use C-x n (command isearchp-toggle-region-restriction) during search to toggle this option value.

Also, deactivation of the active region when you search is controlled by option isearchp-deactivate-region-flag.

(NOTE: For search to be limited to the active region in Info, you must also use library Info+.)

Drew
  • 77,472
  • 10
  • 114
  • 243