Search history.
Depends on the selection and the left side of the buffer, LBUFFER:
- if selection exists: initialize search with selection as contents
- LBUFFER empty (no selection): initialize search with empty string
- LBUFFER not empty (no selection): initialize search with LBUFFER as contentsn
Make search using previous search string.
Restore state as it was before search, but save variable for ^L search (?same as LASTSEARCH variable?).
Search prompt string: Find what? <cursor>
Shows dialog: #+BEGIN Find what? <cursor> RETURN done | Backspace or ^H erase left ^U cancel | Del erase char #+END bold: “RETURN”, “Backspace”, “^H”, “^U”, “Del”
On enter empty: return
If could not find, display: #+BEGIN Could not find: <string>
Press Esc to continue. #+END bold: “Press Esc to continue.”
If found: cursor on first character of the first occurrence of string in text after cursor position while performing the search.
On ^L: repeat search further.
After the last search, if ^L is pressed, message showed: #+BEGIN End of search for: <string>
Press Esc to continue. #+END bold: “Press Esc to continue.”
^L performs search without dialog. If cursor at the beginning, finds first occurrence. If at the end of document, does nothing. If between the end of document and the last position, displays the error message.
Dialog: #+BEGIN Find what? <cursor> RETURN done | Backspace or ^H erase left ^U cancel | Del erase char #+END
If string is empty, returns without asking/displaying anything.
After string input, L4 becomes: #+BEGIN Replace with? <cursor> #+END
Replace string can be empty.
Finds string, displays on right top corner “Replace Y/N”. If y pressed, replaces. Otherwise, does not.
^L does the same search without string dialog, but with y/n dialog.
For the first search, if string can not be found, returns without displaying and asking anything. For ^L search, displays same as for find with ^QF.