2019-08-08 Michael Heerdegen [el-search] Improve "New command el-search-repository" Also bump version to 1.12.6.1. * packages/el-search/el-search.el (el-search-repository): Clean up revision files created by us. 2019-07-28 Michael Heerdegen * packages/el-search/el-search.el: New command el-search-repository Also bump version to 1.12.6. 2019-05-03 Michael Heerdegen [el-search] Small fix in occur filter-buffer-substring-function * packages/el-search/el-search.el (el-search--occur): Use dedicated text property to mark headlines in *El Occur*. (el-search-occur-filter-buffer-substring): Use it to check whether the substring includes any headline instead of 'outline-regexp' based guessing. 2019-05-03 Michael Heerdegen [el-search] Extend possible search domains Allow search entities that are neither live buffers nor files. This makes it possible to implement el-search commands that e.g. search old revisions of a repository. (el-search--get-buffer-fun): New buffer local helper var. (el-search--occur): Use value of 'el-search--get-buffer-fun' when bound in any buffer in the matches stream to enable 'el-search--occur-button-action' to recreate that buffer. (el-search--occur-button-action): Allow the first argument to be a function to create the match buffer. 2019-04-28 Michael Heerdegen [el-search] Also overwrite replaced matches automatically * packages/el-search/el-search.el (el-search--search-and-replace-pattern): Automatically replace a match after editing it with e or E even if it had been replaced with the original replacement before. 2019-04-27 Michael Heerdegen [el-search] Harmonize search and qu-replace prefix arg Also update documentation in header and bump version to 1.12.5. * packages/el-search/el-search.el (el-search-jump-to-search-head): Rename to 'el-search-jump'. Change callers. (el-search-pattern): Let prefix argument behave analogue to 'el-search-query-replace'. (el-search-jump): Limit prefix arg semantics to by-match jumping actions; other former meanings are now part of 'el-search-pattern' prefix arg semantics. (el-search-from-beginning): Also remove the prefix arg behavior to restart the current search; any prefix arg now makes the command move to the last buffer match. 2019-04-25 Michael Heerdegen [el-search] Fix a highlighting corner case * packages/el-search/el-search.el (el-search-pattern-backward): Highlight other matches also when last command was 'el-search-pattern' but search had failed. 2019-04-25 Michael Heerdegen [el-search] Minor fix in el-search-query-replace--read-args * packages/el-search/el-search.el (el-search-query-replace--read-args): Fix the case when we come from a resumed older search: in this case (car el-search-pattern-history) doesn't reflect the correct pattern. Use 'el-search--current-pattern' instead. 2019-04-25 Michael Heerdegen [el-search] C-c C-c in edit-replacement means replace * packages/el-search/el-search.el (el-search--search-and-replace-pattern): When user hits e to edit replacement and confirms with C-c C-c, replace current match even when replacement has not been changed. 2019-04-24 Michael Heerdegen [el-search] Prefer rx forms to stringish regexps * packages/el-search/el-search.el (el-search--pushnew-to-history, el-search--ensure-sexp-start) (el-search--make-docstring, el-search--looking-at-1) (el-search-stream-of-directory-files, el-search-help-list-bindings--1) (el-search-skip-directory, el-search-occur-mode) (el-search--replace-hunk, el-search-query-replace-ediff-replacement) (el-search-query-replace--read-args): Replace stringish regexps with equivalent 'rx' forms. 2019-04-24 Michael Heerdegen [el-search] Key syntax cleanup Only bind events that are generated or result of key translation in all environments; avoid binding events that are generated only in some environments (e.g. depending on 'window-system') and typically translated. Also bump version to 1.12.4. * packages/el-search/el-search.el (el-search-read-expression-map) (el-search-basic-transient-map, el-search-occur-mode-map-1): Clean up key syntax. 2019-04-24 Michael Heerdegen [el-search] Query-replace: Change skip keys Move the keys in the 'el-search-query-replace' prompt to skip matches inside replacements away from y and n so that they can't be used by accident. Also bump version to 1.12.3. * packages/el-search/el-search.el (el-search--search-and-replace-pattern): Change keys to skip matches in replacements from y/n/Y/N to s/d/S/D. 2019-04-24 Michael Heerdegen [el-search] Shorten el-search-query-replace prompt again Also update header and bump version to 1.12.2. * packages/el-search/el-search.el (el-search--search-and-replace-pattern): Force using no dialog box which won't work with the large variety of choices. Emacs would try to use a dialog box when resuming a session with the menu entry "Resume Query-Replace". Use shorter names for 'read-multiple-choice' so that the prompt fits in one line. Change o (show) and e (ediff) to e (edit) and E (Ediff). 2019-04-23 Michael Heerdegen [el-search] Minor tweaks and version bump Bump version to 1.12.1. * packages/el-search/el-search.el (el-search--search-and-replace-pattern): When editing the replacement, support C-c C-k as another alternative binding to abort. Make the * in the prompt (signaling "match replaced") more visible by propertizing with face success. (el-search--get-q-r-description-string): Remove redundant 'propertize' call. (el-search-query-replace-to-register): Fix prompt. 2019-04-21 Michael Heerdegen [el-search] Make el-search-query-replace resumable Analogue to search objects we introduce an 'el-search-query-replace-object' struct to represent query-replace sessions and implement the infrastructure to resume and restart sessions, save sessions to registers etc. Some related tweaks. Update documentation. Add a "Resume Query-Replace" menu item. * packages/el-search/el-search.el (el-search-query-replace-object): New struct. (el-search-query-replace-object-history): New history variable for 'el-search-query-replace' sessions. (cl-print-object, register-val-jump-to, register-val-describe): Implement methods for 'el-search-query-replace-object' objects. (el-search-query-replace-to-register): New command. (el-search--read-history-entry): New helper to let the user choose an item from search or query-replace history. Factored out with improved numbering. (el-search--goto-char-maybe-barf): New position jumping function taking care of whether the position to jump to is accessible. (el-search-jump-to-search-head): Use 'el-search--read-history-entry' and 'el-search--goto-char-maybe-barf'. (el-search-continue-search): Use 'el-search--goto-char-maybe-barf'. (el-search--search-and-replace-pattern): Rewrite to make it use 'el-search-query-replace-object's. Allow to directly pass a query-replace object instead of a pattern as first argument. Allow to switch to the driving search with key S. Let key / replace all matches in current buffer then suspend the session. (el-search-query-replace--read-args): Implement prefix arg functionality. (el-search-query-replace): Update and improve documentation. 2019-03-09 Michael Heerdegen [el-search] Fix sanity check regarding comments Also bump version to 1.11.4. * packages/el-search/el-search.el (el-search-query-replace--comments-preserved-p): Fix counting ";" occurrences in strings as comment starts by mistake. Fix equality test of comment multi sets. 2019-02-24 Michael Heerdegen [el-search] Minibuffer pattern prompt hints part 3 Restore the ability of 'el-search-read-display-mb-hints' to warn about errors happening while counting (i.e. searching for) matches, i.e. for patterns that are syntactically valid and compile ok but raise an error when applied to some value. That capability had been gotten lost with the fix in "Fix quits in minibuffer in emacs -nw". We also let 'el-search-display-match-count' accept an ANIMATOR function argument. * packages/el-search/el-search.el (el-search-display-match-count): Allow to pass an animator function as second argument. Change callers to do that. (el-search-read-display-mb-hints): Handle cases when 'el-search-display-match-count' exits nonlocally. 2019-02-24 Michael Heerdegen [el-search] Add "List patterns" menu item * packages/el-search/el-search.el (el-search--make-docstring): Improve wording. 2019-02-24 Michael Heerdegen [el-search] Label matches when copying from *El-Occur* Also bump version to 1.11.3. * packages/el-search/el-search.el (el-search-occur-match-markers): New user option. (el-search-occur-filter-buffer-substring): New function to use as value of 'filter-buffer-substring-function' in *El-Occur* buffers. (el-search-occur-write-file): New function to use in 'write-contents-functions' in *El-Occur* buffers. (el-search-occur-mode): Install these functions. 2019-02-24 Michael Heerdegen [el-search] Improve "Make replacement editable and ediff'able" * packages/el-search/el-search.el (el-search-query-replace--comments-preserved-p): Be more accurate when skipping the header to extract the edited replacement. 2019-02-18 Michael Heerdegen [el-search] Fix quits in minibuffer in emacs -nw Something like (while-no-input (sit-for 10)) is problematic: in a console, hitting a key apparently always lets this generate a quit signal. We try to avoid 'sit-for' wrapped in 'while-no-input'. Bump version to 1.11.2. * packages/el-search/el-search.el (el-search-read-display-mb-hints): Only wrap in 'while-no-input' where it is strictly necessary. 2019-02-17 Michael Heerdegen [el-search] Bump version to 1.11.1 As well as some tiny wording changes in the file header. 2019-02-17 Michael Heerdegen [el-search] Tweak 'display-buffer' actions Try to make the default 'display-buffer' actions feel more natural. * packages/el-search/el-search.el (el-search-display-buffer-popup-action) (el-search-display-next-buffer-action): Change default. (el-search-jump-to-search-head): Use the 'el-search-display-next-buffer-action' instead of the 'el-search-display-buffer-popup-action' to display the head buffer. 2019-02-17 Michael Heerdegen [el-search] Fix behavior after completed single-buffer search Make 'el-search-from-beginning' and 'el-search-jump-to-search-head' after completed single-buffer search work as expected. * packages/el-search/el-search.el (el-search-pattern) (el-search-pattern-backward, el-search-this-sexp) (el-search--occur-button-action) (el-search--search-and-replace-pattern): Make single-buffer ad-hoc searches have the search buffer as non-nil 'is-single-buffer' value. (el-search-object): Add comment about the intended usage of the 'is-single-buffer' property. (el-search-revive-search): New function. (el-search-barf-if-not-search-buffer): If we are in the searched buffer of a completed single-buffer search, silently revive it with 'el-search-revive-search'. (el-search-jump-to-search-head): When the search needs to be restarted, use 'el-search-revive-search' instead of only 'el-search-reset-search'. 2019-02-17 Michael Heerdegen [el-search] Enhance docstring of el-search-occur-mode * packages/el-search/el-search.el (el-search-occur-mode-map-1): New helper variable holding only the non-inherited bindings. (el-search-occur-mode-map): Use it. (el-search-occur-mode): Add docstring. Use 'el-search-occur-mode-map-1' to describe the essential key bindings. 2019-02-17 Michael Heerdegen [el-search] Small fix in el-search--changed-files-in-repo * packages/el-search/el-search-x.el (el-search--changed-files-in-repo): Try to make semantics analogue to that of 'el-search--file-changed-p'. 2019-02-16 Michael Heerdegen [el-search] Improvise eldoc support for search pattern prompt * packages/el-search/el-search.el (el-search-eldoc-documentation-function): New function. (el-search-read-pattern-setup-mb): Install 'el-search-eldoc-documentation-function' buffer-locally. 2019-02-16 Michael Heerdegen [el-search] Add el-search-list-defined-patterns Also bump version to 1.10.2. * packages/el-search/el-search.el (el-search-list-defined-patterns): New autoloaded command replacing 'el-search-help-list-patterns'. (el-search-help-list-patterns): Remove. 2019-02-16 Michael Heerdegen [el-search] Some minor tweaks and bump version to 1.10.1 Diverse whitespace fixes and other minor tweaks. Add some TODOs. * packages/el-search/el-search.el (el-search--pattern-is-unquoted-symbol-p): Make it return a message as non-nil value. Also complain about a 't' pattern which is likely not intended. (el-search--maybe-warn-about-unquoted-symbol) (el-search-read-display-mb-hints): Use it. (el-search-protect-search-head): Add debug spec. (el-search--get-search-description-string): Add colon to description when pattern prints multiline. (el-search--next-buffer): Remove redundant 'inhibit-message' binding. (el-search-hl-post-command-fun): Don't prevent debugging. (el-search-occur-mode): Don't initially 'hs-hide-all' because that has some quirks. (el-search-directory): Tweak prompts. First ask for directory which is more intuitive. (el-search--search-and-replace-pattern): Tweak text of header of the edit-replacement pop-up buffer. * packages/el-search/el-search-x.el (el-search--changed-files-in-repo): Show indicator when running Git. 2019-02-16 Michael Heerdegen [el-search] Improvements for 'change' and 'changed' * packages/el-search/el-search-x.el (el-search--change-p, el-search--changed-p): Only 'user-error' in the interactive case, else silently fail. (change--1, changed--1): New internal helper patterns. (change, changed): Use them. Add implicit test for an associated file. Improve docstrings. 2019-02-15 Michael Heerdegen [el-search] Fine tune separator for splicing replace * packages/el-search/el-search.el (el-search--format-replacement): When splicing the replacement into the buffer and one of the expressions is multi-line, separate all expressions with newlines instead of spaces. 2019-02-15 Michael Heerdegen [el-search] Avoid bytecomp warning windows pop up * packages/el-search/el-search.el (el-search--byte-compile): New helper, a trivial wrapper around 'byte-compile' binding 'byte-compile-log-warning-function' to 'ignore'. Change all relevant callers of 'byte-compile' to use this function instead. 2019-02-15 Michael Heerdegen [el-search] Display colored defun match count * packages/el-search/el-search.el (el-search-display-match-count): Display the fontified defun signature in the defun match count. 2019-02-13 Michael Heerdegen [el-search] Minibuffer pattern prompt hints part 2 Implement displaying hints when prompting for a search pattern. This includes pointing to errors in the pattern and showing a preview of match counts when appropriate. We also fix the case when a search pattern fails later in the search and force a cleanup in this case. * packages/el-search/el-search.el (el-search-read-pattern-trigger-mb-hints) (el-search-read-pattern-setup-mb): New helpers. (el-search--set-this-command-refresh-message-maybe): New helper to set 'this-command' and refresh the last shown message to avoid echo area stuttering. Use where appropriate. (el-search-read-display-mb-hints): The new main function for displaying the hints in the minibuffer. (el-search-read-pattern-for-interactive): If user option 'el-search-display-mb-hints' is on, display hints for errors. Additionally: if the new optional arg DISPLAY-MATCH-COUNT is non-nil, display a match count in the minibuffer. (el-search-pattern--interactive): Likewise: new argument DISPLAY-MATCH-COUNT. Change all callers that want to display a match count in the minibuffer when prompting for the search pattern (mostly, search starting commands that always search the current buffer). (el-search-query-replace--read-args): Call 'el-search-read-pattern-setup-mb'. (el-search-hl-post-command-fun): New optional argument STOP; when non-nil, unconditionally cleanup. Change all callers that call this for cleanup to use that new arg. Display animation when counting matches. (el-search-display-match-count): New optional argument JUST-COUNT that let's the function only return a string. Minor tweaks. (el-search-continue-search): Call 'el-search--set-this-command-refresh-message-maybe' to avoid a stuttering match count. Force cleanup in case of unexpected errors. 2019-02-13 Michael Heerdegen [el-search] Minibuffer pattern prompt hints part 1: preparations * packages/el-search/el-search.el (el-search--pattern-is-unquoted-symbol-p): New helper function factored out of 'el-search--maybe-warn-about-unquoted-symbol'. (el-search--maybe-warn-about-unquoted-symbol): Use it. (el-search--all-matches): When the new optional argument DONT-COPY is non-nil, don't use a copy of the given search object to build the match stream, use the given search directly. (el-search-display-mb-hints, el-search-mb-hints-delay) (el-search-mb-hints-timeout): New user options. (el-search--make-display-animation-function): New helper function to construct animation functions. (el-search-query-replace--read-args): Bind new special var 'el-search--reading-input-for-query-replace' non-nil when reading FROM pattern. (el-search--search-pattern-1-do-fun): New variable that will be used to display animations in the minibuffer or echo area. (el-search--search-pattern-1): Call value of new variable 'el-search--search-pattern-1-do-fun' when non-nil repeatedly while searching. 2019-02-13 Michael Heerdegen [el-search] Add accessible buffer area to a validity check Add (POINT-MIN POINT-MAX) to the 'el-search--buffer-match-count-data' validity checks to ensure that the count data is dismissed when narrowing has changed. * packages/el-search/el-search.el (el-search--buffer-match-count-data): Update docstring. (el-search-display-match-count): Change to make 'el-search--buffer-match-count-data' support that additional check. 2019-02-11 Michael Heerdegen [el-search] Unify go-to-previous/next-match key bindings Also bump version to 1.9.7. * packages/el-search/el-search.el (el-search-loop-over-bindings) (el-search-occur-mode-map): In each case define both of the r, s and p, n key pairs. In 'global-map' move the binding for 'el-search-continue-in-next-buffer' from n to x. 2019-02-10 Michael Heerdegen [el-search] Small fix for my last commit Skip 'proper-list-p' test when that function is not defined. Bump version to 1.9.6. * packages/el-search/el-search.el (el-search--simple-regexp-like-p): Only perform 'proper-list-p' test when the used Emacs version has defined that function. Rename the function's argument. 2019-02-09 Michael Heerdegen [el-search] Allow expressions as args of 'string' Also tweak docstrings and bump version to 1.9.5. * packages/el-search/el-search.el (el-search--simple-regexp-like-p): New helper function. (el-search-regexp-like-p): Change to include expressions. Improve docstring. (el-search--string-matcher): Make it handle expressions. Minor tweaks. (string, symbol): Tweak docstrings. 2019-01-16 Michael Heerdegen Update copyrights of some packages Update copyrights of el-search, iterators, on-screen, smart-yank and stream-x. 2019-01-13 Michael Heerdegen [el-search] Tweak my last commit "Add menus" Also bump version to 1.9.4. * packages/el-search/el-search.el (el-search-occur-revert-function): Respect current value of 'el-search-occur--outline-visible'. (emacs-lisp-mode-map): Declare 'el-search-occur-flag' as special in the "Occur" menu item command since el-search may not have yet been loaded when it is called. 2019-01-12 Michael Heerdegen [el-search] Add menus Add autoloaded menus for el-search under "Tools" and "Emacs-Lisp", and a menu for El-Occur, and bump version to 1.9.3. 2019-01-11 Michael Heerdegen [el-search] Some optimization tweaks Make sure heuristic matchers aren't unnecessarily recomputed. This is important for pattern types whose heuristic matchers need to do some kind of caching like 'el-search-change--heuristic-matcher'. Bump version to 1.9.2. * packages/el-search/el-search.el (el-search-heuristic-buffer-matcher): Allow to pass an existing heuristic matcher. (el-search--set-head-pattern): Compute heuristic matcher only once. (el-search-continue-search): Call 'el-search-compile-pattern-in-search' only when necessary. 2019-01-11 Michael Heerdegen [el-search] Include preceding comments in occur defun context * packages/el-search/el-search.el (el-search-occur-get-defun-context): Include preceding comments. 2019-01-06 Michael Heerdegen [el-search] Improve my last commit "Add C-h help" Also bump version to 1.9.1. * packages/el-search/el-search.el (el-search-help-list-bindings-verbose): Use 'with-help-window'. (el-search-help-list-bindings--1): Make it work with 'with-help-window'. Skip menu bindings in binding lists. (el-search-help-list-bindings): Rewrite to make it work with new 'el-search-help-list-bindings--1' version. 2019-01-05 Michael Heerdegen [el-search] Add C-h help This commit adds integration for the C-h help prefix. Update header and bump version to 1.9.0. * packages/el-search/el-search.el (el-search-help-for-help) (el-search-help-list-bindings, el-search-help-list-bindings-verbose) (el-search-help-list-patterns, el-search-help-read-intro): New help commands. (el-search-help-map): New keymap to access the new help commands. (el-search-basic-transient-map): Add bindings for 'el-search-help-map' and 'el-search-help-list-bindings'. (el-search-keep-transient-map-commands): Add 'el-search-help-list-bindings', 'el-search-help-for-help' and 'describe-key' to the list of transient map commands. (el-search-close-quick-help-maybe, el-search-help-for-help-internal) (el-search-help-list-bindings--1): New helper functions. (el-search-hl-post-command-fun): Close quick help window when necessary. (el-search-jump-to-search-head): Tweak docstring. 2019-01-05 Michael Heerdegen [el-search] Allow to work without installing key bindings Change the default value of 'el-search-use-transient-map' to t. Make "el-search" an alias for "el-search-pattern" for better discoverability. Bump version to 1.8.9. (el-search-use-transient-map): Enable by default. (el-search-install-shift-bindings): Disable 'el-search-use-transient-map'. (el-search): New autoloaded alias for 'el-search-pattern'. 2018-12-22 Michael Heerdegen [el-search] Make mouse clicks not abort the search Also bump version to 1.8.8. * packages/el-search/el-search.el (el-search-keep-session-command-p): Make 'mouse-drag-region' and 'mouse-set-point' succeed. Enhance docstring. 2018-12-21 Michael Heerdegen [el-search] Fix more "redundant _ pattern" warnings Also bump version to 1.8.7. * packages/el-search/el-search.el (el-search-make-matcher): Handle symbols directly as catchall patterns. Remove redundant second pcase branch. * packages/el-search/el-search-x.el (append): Handle one more corner case specially. 2018-12-20 Michael Heerdegen [el-search] Fix search setup with non-nil occur flag Also bump version to 1.8.6. * packages/el-search/el-search.el (el-search-setup-search-1): Skip parts of setup when 'el-search-occur-flag' is non-nil. 2018-12-17 Michael Heerdegen [el-search] Fix C-J with numeric arg in case of no match Also bump version to 1.8.5. * packages/el-search/el-search.el (el-search-jump-to-search-head): Handle case when numeric prefix arg given but according match doesn't exist. Avoid calling 'prefix-numeric-value' on the arg when it could be bound to a search object. 2018-12-16 Michael Heerdegen [el-search] Implement an explicit quit command Let C-g quit and jump to the starting position like in isearch ('el-search-keyboard-quit'). Update header comment and bump version to 1.8.4. * packages/el-search/el-search.el (el-search--set-search-origin-maybe): New function. (el-search-keyboard-quit): New command. (el-search-basic-transient-map): Add binding for 'el-search-keyboard-quit'. (el-search-setup-search-1, el-search-jump-to-search-head) (el-search-continue-search, el-search-from-beginning) (el-search-last-buffer-match): Call 'el-search--set-search-origin-maybe'. (el-search-display-match-count): Handle quit. 2018-12-14 Michael Heerdegen [el-search] Let el-search-query-replace add undo boundaries Also bump version to 1.8.3. * packages/el-search/el-search.el (el-search--search-and-replace-pattern): Add undo-boundaries before and after each manual replacement so that it's possible to undo each change individually afterwards. 2018-12-11 Michael Heerdegen [el-search] Provide el-search-occur-search-object earlier Also bump version to 1.8.2. * packages/el-search/el-search.el (el-search--occur): Make 'el-search-occur-search-object' available when 'el-search-occur-mode-hook' is run. This implies making the local variable permanent-local. 2018-12-09 Michael Heerdegen [el-search] Enhancements to my last two commits Also bump version to 1.8.1. * packages/el-search/el-search.el (el-search--search-and-replace-pattern): Use the modified flag of the buffer to edit the replacement to decide if the user modified the contents. Some more minor tweaks. 2018-12-09 Michael Heerdegen [el-search] Stop for problematic comments Make automatic replacing stop when comments can't be placed automatically. Bump version to 1.8. * packages/el-search/el-search.el (el-search-query-replace-stop-for-comments): New user option. (el-search-query-replace--comments-preserved-p): New helper function. (el-search--search-and-replace-pattern): Change to make it respect the value of 'el-search-query-replace-stop-for-comments'. 2018-12-08 Michael Heerdegen [el-search] Make replacement editable and ediff'able Make the 'el-search-query-replace' replacement editable and ediff'able using a temporary buffer. Update header comment accordingly. * packages/el-search/el-search.el (el-search--replace-hunk): Return a marker pointing to the end of the inserted text. (el-search-query-replace-ediff-replacement): New function. (el-search--search-and-replace-pattern): Add and implement keys to edit the replacement in a separate buffer and to ediff the current match with the current replacement. 2018-12-01 Michael Heerdegen [el-search] Minor tweaks in el-search-query-replace * packages/el-search/el-search.el (el-search--search-and-replace-pattern): Visually annotate whether the current match has been replaced. Use only one description for the 'r' key no matter whether the current match has been replaced. Tweak prompt for ! key. 2018-11-18 Michael Heerdegen [el-search] Make r hit twice restore a replaced match Update commentary in header accordingly. * packages/el-search/el-search.el (el-search--search-and-replace-pattern): Make r hit after replacing a match restore that match using an undo change group. 2018-11-10 Michael Heerdegen [el-search] Make y move forward after replacing Make y in 'el-search-query-replace' instead of n move to the next match after replacing a match with r. This feels more logical when thinking about y and n as abbreviating "yes" and "no". Also do some related minor rewording. * packages/el-search/el-search.el (el-search--search-and-replace-pattern): Make y the key to confirm a replacement and go to the next match after replacing the current match with r. 2018-11-06 Michael Heerdegen [el-search] Don't initially fold El Occur buffers This didn't always work correctly and may also be irritating for new users. Bump version to 1.7.15. * packages/el-search/el-search.el (el-search--occur): Don't initially fold *El Occur* buffer. 2018-11-04 Michael Heerdegen [el-search] Small fix in el-search--reset-wrap-flag We must reset 'el-search--wrap-flag' when the user does something different than search wrapping with the next command - else a later command could wrap the search even when not at the first or last match. Bump version to 1.7.14 * packages/el-search/el-search.el (el-search--reset-wrap-flag): Reset 'el-search--wrap-flag' also when user hasn't wrapped search. 2018-11-04 Michael Heerdegen [el-search] Don't try to kill modified buffers This fixes a problem introduced by 1d2bbf66 "Improve working of `el-search-kill-left-over-search-buffers'": We still need to check whether the buffer to be killed has been modified by 'el-search-query-replace' with 'el-search-auto-save-buffers' off. Bump version to 1.7.13. * packages/el-search/el-search.el (el-search-kill-left-over-search-buffers): Exclude modified buffers from killing. 2018-11-04 Michael Heerdegen [el-search] Follow-up to "Fix nested match issues in *El Occur*" Get rid of the now obsolete el-search-match overlay property. Always create match overlays with front-advance flag so added indentation doesn't get part of the overlays. Bump version to 1.7.12. * packages/el-search/el-search.el (el-search-occur-jump-to-match): Use the data provided through the 'el-search-occur-match-ov-prop' property. (el-search-occur--next-match): Correct a typo. (el-search--occur): Don't attach the el-search-match property any more. Create all match-spanning overlays with front-advance flag. 2018-11-03 Michael Heerdegen [el-search] Fix an infloop in el-search--search-pattern-1 Also bump version to 1.7.11. * packages/el-search/el-search.el (el-search--search-pattern-1): Move forward if a match is discarded because it exceeds a given BOUND. 2018-11-01 Michael Heerdegen [el-search] Fix nested match issues in *El Occur* Fix flawed match count display and by-match moving in *El Occur* buffers for nested or adjacent matches. Bump version to 1.7.10. * packages/el-search/el-search.el (el-search--occur): Cover each match with an individual overlay storing the match number and other data in an overlay property. (el-search-occur--next-match): Use these new overlays for navigation. Call 'el-search--scroll-sexp-in-view'. (el-search-occur--show-match-count): Rewrite to use the new match-spanning overlays. 2018-09-12 Michael Heerdegen [el-search] Some scrolling tweaks (el-search-fancy-scrolling): New user option. (el-search--scroll-sexp-in-view): Use signed screen line counts again. Bump version to 1.7.9. 2018-09-09 Michael Heerdegen [el-search] Open invisible text Make el-search open invisible text like isearch. We only define glue code functions that call the respective isearch functions and use these in the relevant places. We also make 'el-search--scroll-sexp-in-view' do calculations based on visible lines to make it work with invisible text as expected. Bump version to 1.7.8. * packages/el-search/el-search.el (el-search-open-invisible): New variable. (el-search-hide-immediately): New user option. (el-search-unhide-invisible, el-search-rehide-invisible): New functions. (el-search-hl-sexp): Call 'el-search-unhide-invisible'. (el-search-hl-remove): Call 'el-search-rehide-invisible'. (el-search--scroll-sexp-in-view): Do calculation based on visible lines. 2018-09-01 Michael Heerdegen [el-search] Add some key bindings This commit adds key bindings for the recently added scroll commands. It also provides a way to officially cancel a search or query-replace session by hitting RET. Update comments in header and bump version to 1.7.7. * packages/el-search/el-search.el (el-search-keep-transient-map-commands): Add 'el-search-scroll-down' and 'el-search-scroll-up'. (el-search-pause-search): New command. (el-search-basic-transient-map): New keymap that is always enabled when a search is active. Bind RET to 'el-search-pause-search'. (el-search-prefix-key-transient-map): Add binding for 'el-search-scroll-down' and 'el-search-scroll-up'. Set parent keymap to 'el-search-basic-transient-map'. (el-search-prefix-key-maybe-set-transient-map): Enable 'el-search-prefix-key-transient-map' or only the new 'el-search-basic-transient-map' depending on the value of 'el-search-use-transient-map'. (el-search-install-shift-bindings): Add bindings for 'el-search-scroll-down' and 'el-search-scroll-up'. (el-search--search-and-replace-pattern): Let RET terminate query-replace. 2018-08-07 Michael Heerdegen [el-search] Follow-ups to transient map handling This fixes the transient map being still active when hitting the first key after 'el-search-jump-to-search-head' or 'el-search-skip-directory' prompt for minibuffer input. Bump version to 1.7.6. (el-search-keep-transient-map-commands): Remove 'el-search-jump-to-search-head' and 'el-search-skip-directory' from the list. (el-search-jump-to-search-head, el-search-skip-directory): Unconditionally call 'el-search-prefix-key-maybe-set-transient-map'. (el-search--entering-prefix-arg-p): New helper function. (el-search-hl-post-command-fun): Use it. 2018-08-01 Michael Heerdegen [el-search] Minor tweaks and bump version to 1.7.5 (el-search-hl-post-command-fun): Don't hide key input feedback when a prefix argument is entered. (el-search-jump-to-search-head): Simplify test when to call 'el-search-barf-if-not-search-buffer'. (el-search-scroll-down, el-search-scroll-up): Call 'el-search-barf-if-not-search-buffer'. 2018-07-31 Michael Heerdegen [el-search] Add special scroll commands * packages/el-search/el-search.el (el-search-scroll-down) (el-search-scroll-up): New commands. Bindings will be added in a later commit. 2018-07-31 Michael Heerdegen [el-search] Extend meaning of C-J prefix arg * packages/el-search/el-search.el (el-search-jump-to-search-head): Make numerical prefix jump between matches: 0 jumps to the match following point, N and -N jump to the Nth match visible in the selected window or the Nth match before 'window-end'. 2018-07-30 Michael Heerdegen * el-search/el-search.el: Again tweak commentary in header 2018-07-22 Michael Heerdegen [el-search] Improve match faces Optimize face definitions for terminals with few colors. We also define a separate face for highlighting matches in *El Occur* buffers to make them better distinguishable from search buffers, and also to improve the visual feedback when doing an el-search in *El Occur*. Bump version to 1.7.3. (el-search-match, el-search-other-match): Optimize definitions for terminals. (el-search-occur-match): New face. (el-search--occur): Use it. 2018-07-11 Michael Heerdegen [el-search] More minor tweaks Also bump package version to 1.7.2. * packages/el-search/el-search.el: (el-search--search-buffer-p) (el-search-barf-if-not-search-buffer): New functions. (el-search-kill-left-over-search-buffers): Use 'el-search--search-buffer-p'. (el-search-from-beginning, el-search-last-buffer-match): Call 'el-search-barf-if-not-search-buffer' when appropriate. (el-search-loop-over-bindings): Bind 'el-search-last-buffer-match' only in 'emacs-lisp-mode-map' instead of 'global-map'. (el-search-prefix-key-transient-map): Add 'el-search-jump-to-search-head'. (el-search-jump-to-search-head): Indentation fix. 2018-06-23 Michael Heerdegen [el-search] Bump version to 1.7.1 2018-06-23 Michael Heerdegen [el-search] Improve 'el-search-display-match-count' * packages/el-search/el-search.el (el-search-display-match-count): Display name of defun the current match is in. Display match count even when not at a match. 2018-06-23 Michael Heerdegen [el-search] Enforce defun start for heuristic matching Ensure a sexp is top-level before performing heuristic matching on it. This makes it possible to use heuristic matching for context aware pattern types we might add in the future. (el-search--search-pattern-1): Test for (zerop (car (syntax-ppss))) before doing heuristic matching with a following sexp. 2018-06-23 Michael Heerdegen * el-search/el-search.el: Correct NOERROR argument uses Correct calls of el-search search functions in the file to not use 'noerror as NOERROR argument since we have changed the semantics of non-nil non-t argument values. 2018-06-23 Michael Heerdegen [el-search] Avoid most calls to 'scan-sexps' Replace 'scan-sexps' with 'el-search--end-of-sexp' where possible. We do this because 'scan-sexps' currently has a bug - bug#24542 "The symbol `@' and sexp scanning" - which we try to avoid. * packages/el-search/el-search.el (el-search--end-of-sexp): Implement an optional POS argument. Replace all calls of 'scan-sexps' with a COUNT argument 1 with according 'el-search--end-of-sexp' calls. (el-search--search-backward-1): Correct a variable name. * packages/el-search/el-search-x.el: Also replace 'scan-sexps' calls. 2018-06-23 Michael Heerdegen [el-search] Bump version to 1.7 Also add a NEWS entry for this release. 2018-06-23 Michael Heerdegen [el-search] Add bindings for first/last match jumping * packages/el-search/el-search.el (el-search-loop-over-bindings): Add bindings for < and > (to 'el-search-from-beginning' and 'el-search-last-buffer-match'). (el-search-keep-transient-map-commands): Add 'el-search-last-buffer-match' to the list. (el-search-prefix-key-transient-map): Add 'el-search-last-buffer-match' as well. Add the new bindings to the binding listing in the file header. 2018-06-23 Michael Heerdegen [el-search] Add command 'el-search-last-buffer-match' * packages/el-search/el-search.el (el-search--unless-no-buffer-match): New macro. (el-search-pattern-backward): Use it. (el-search-last-buffer-match): New command jumping to the last of the current buffer's matches. (el-search-from-beginning): Let a negative prefix arg make it jump to the last buffer match. 2018-06-21 Michael Heerdegen [el-search] Special case 'el-search-make-matcher' for '_' This makes adding an entry to 'pcase--dontwarn-upats' to suppress a warning about a redundant '_' clause unnecessary. * packages/el-search/el-search.el (el-search-make-matcher): Avoid calling 'pcase' in the constructed lambda for '_' PATTERN argument. 2018-06-21 Michael Heerdegen [el-search] Some more minor tweaks * packages/el-search/el-search.el: Some minor edits in the file header. (el-search-history): Increase ring size. (el-search--ensure-sexp-start): Clarify docstring with respect to behavior at eob. (el-search--scroll-sexp-in-view): Factored out of 'el-search-hl-sexp'. (el-search-hl-sexp): Use it. (el-search-highlight-in-prompt-face): Inherit from 'warning' face to make important prompts even better noticeable. (el-search-make-matcher): Rename second argument to emphasize that its value is an expression. Locally declare 'warning-suppress-log-types' to quiet byte compiler. And some more minor edits. 2018-06-20 Stefan Monnier [el-search] Save two 'eval' calls * packages/el-search/el-search.el (el-search--with-additional-pcase-macros): Reimplement to set and unset respective 'pcase-macroexpander' symbol properties "by hand" (i.e. without 'cl-letf'). (el-search--macroexpand): Remove now unnecessary 'eval' wrapper. (el-search-make-matcher): Remove now unnecessary 'eval' wrapper. Byte compile lambda form instead of function value. 2018-06-09 Michael Heerdegen [el-search] Factor out `el-search-backward' This commit provides a non-interactive backward search function analogue to `el-search-forward'. (el-search--search-backward-1, el-search-backward): New functions. (el-search-pattern-backward): Rewrite to use `el-search-backward'. 2018-06-08 Michael Heerdegen [el-search] Improve forward search functions The goal of this commit is to further align syntax and semantics of el-search's forward search functions with Emacs text search functions. * packages/el-search/el-search.el (el-search--search-pattern-1) (el-search-forward): Implement COUNT argument. Make the NOERROR argument behave like in `search-forward' when neither nil or t. Raise error for invalid search bounds. Search further after a found match ends after BOUND - a subsequent match may still end before. Fix behavior when BOUND is exceeded. Enhance docstrings. 2018-05-27 Michael Heerdegen [el-search] Use current buffer to check for matches in replacement This fixes el-search-query-replace raising an error when the FROM pattern makes use of the `filename' pattern type. * packages/el-search/el-search.el (el-search--search-and-replace-pattern): Use the current buffer of this `el-search-query-replace' session to check for matches inside the inserted replacement. 2018-05-21 Michael Heerdegen [el-search] Raise user-error when replacement contains gensyms * el-search/el-search.el (el-search--format-replacement): Raise a `user-error' when replacement contains uninterned symbols. Also improve the comment about this issue in the file header. 2018-05-21 Michael Heerdegen * el-search/el-search.el: Skip over #N read syntaxes This fixes issues with el-searching being distracted by these constructs. (el-search--ensure-sexp-start): Skip over #N= and #N# read syntaxes. Add a sentence to the docstring telling that parts of cyclic sexps may be skipped. 2018-05-16 Michael Heerdegen * el-search/el-search.el: More minor tweaks (el-search-kill-left-over-search-buffers): Remove unused optional argument. And some more minor edits. 2018-05-14 Michael Heerdegen * el-search/el-search.el: Prefer adverb "backward" in names and text Prefer the adverb "backward" over "backwards" in package "el-search". (el-search-pattern-backward, el-search-search-backward-from-isearch): Renamed from "el-search-pattern-backwards" and "el-search-search-backwards-from-isearch". Change all occurrences; define obsolete function aliases for the old names. Change all other occurrences of the adverb to "backward". 2018-05-12 Michael Heerdegen * el-search/el-search.el: Fix heuristic matcher for 'nil (el-search-heuristic-matcher): Special case 'nil. 2018-05-12 Michael Heerdegen * el-search/el-search.el: Fix infloop in el-search--flatten-tree This fixes `el-search--flatten-tree' inflooping in cases like (el-search--flatten-tree '(x . #1=(y . #1#))) (el-search--flatten-tree): Be more strict in adding objects to the WALKED-OBJECTS hash-table. 2018-05-08 Michael Heerdegen Fix el-search's check for buffers visiting a given file * packages/el-search/el-search.el (el-search-atom-list) (el-search--next-buffer): Use `find-buffer-visiting' instead of `get-file-buffer' to identify buffers already visiting a given file. `find-buffer-visiting' also checks for buffers visiting a file under a different name, which is what we want. 2018-04-07 Michael Heerdegen * el-search/el-search-x.el: Some more tweaks 2018-04-07 Michael Heerdegen * el-search/el-search.el: New user option `el-search-allow-scroll' 2018-04-03 Michael Heerdegen * el-search/el-search-x.el: New user option `el-search-lazy-l' 2018-03-24 Michael Heerdegen * el-search/el-search-x.el: New pattern type `string-lines' 2018-03-18 Michael Heerdegen Show progress of automatic el-search-query-replace * el-search/el-search.el: (el-search--search-and-replace-pattern): Show percentage of progress of automatic query-replace. 2018-03-13 Michael Heerdegen * el-search/el-search.el: Add `el-search-looking-at' (el-search-make-matcher): Renamed from `el-search--matcher'. Change all occurrences, including those in el-search/el-search-x.el. (el-search--looking-at-1, el-search-looking-at): New functions. 2018-02-23 Michael Heerdegen Improve working of `el-search-kill-left-over-search-buffers' We used to consult the ring elements of el-search-history to identify buffers with non-nil el-search--temp-buffer-flag which might still be relevant to the user, which was not optimal. With this change, `el-search--pending-search-p' becomes a reliable mean to do that, and we can reimplement el-search-kill-left-over-search-buffers to use this function instead. * el-search/el-search.el (el-search--next-buffer): Remove `el-search-hl-post-command-fun' from the local binding of `post-command-hook' in the old buffer so that `el-search--pending-search-p' is guaranteed to return nil there. (el-search-kill-left-over-search-buffers): Use `el-search--pending-search-p' to identify temporarily opened file buffers which we should not kill. 2018-02-23 Michael Heerdegen Small improvements to el-search--search-and-replace-pattern * packages/el-search/el-search.el (el-search--search-and-replace-pattern): In particular, unite the "replace all in this buffer" and "replace all in this and all following buffers" answer using a second prompt when appropriate (i.e. when in a multi-buffer session). 2018-02-23 Michael Heerdegen * el-search/el-search.el: Bump version to 1.6; some minor tweaks 2018-02-20 Michael Heerdegen * el-search/el-search.el: Fix single buffer query-replace This fix makes ad-hoc (single-buffer) el-search-query-replace start from current point as expected, instead of from the beginning of the buffer. (el-search--search-and-replace-pattern): Use the setup function of the newly created ad-hoc search to make it start from point. 2018-02-20 Michael Heerdegen Treat inserted replacements as potential to-replace candidates Don't skip the inserted replacement so that it can potentially be subject to query-replace once more when matching the current search pattern unless the user chooses to skip matches in replacements. * packages/el-search/el-search.el (el-search--search-and-replace-pattern): Do it. 2018-02-20 Michael Heerdegen * el-search/el-search.el: Fix handling of void replacements (el-search--replace-hunk): If we effectively killed a match, also kill any left empty line or trailing whitespace. (el-search--search-and-replace-pattern): Don't try to move to the beginning of a void replacement. 2018-02-17 Michael Heerdegen * el-search/el-search.el: Don't highlight inserted replacement (el-search--search-and-replace-pattern): Don't highlight inserted replacement. This was more distracting than helpful. 2018-02-17 Michael Heerdegen Update a variable when splicing mode is toggled * packages/el-search/el-search.el (el-search--search-and-replace-pattern): Recompute `replacement-contains-another-match' when user toggles splicing-mode. 2018-02-17 Michael Heerdegen Improve quit/error handling in el-search-query-replace * packages/el-search/el-search.el (el-search--search-and-replace-pattern): Use catch and throw to implement user quit. Allow hitting `q' to quit also from the "There are matches in this replacement" prompt. Optimize control flow in case of an error. 2018-02-11 Michael Heerdegen Add face `el-search-highlight-in-prompt-face' * packages/el-search/el-search.el (el-search-highlight-in-prompt-face): New face. (el-search--search-and-replace-pattern): When there are matches in the replacement, don't ding, use the new face to make the prompt stand out from other prompts instead. 2018-02-11 Michael Heerdegen * el-search/el-search.el: Some minor tweaks There were two separate bug sections in the header - fix that. Add comment to "Known Limitations" section that circular syntaxes are unmatchable. (el-search-pattern-backwards): Add fixme note. (el-search-load-path): Use `remq' instead of `delq' to prevent altering the `load-path'. And some whitespace changes 2018-02-11 Michael Heerdegen Fix el-search's to register save when no search started yet * packages/el-search/el-search.el: (el-search-to-register) (el-search-clone-to-register): Throw a `user-error' when value of `el-search--current-search' is nil. 2018-02-05 Michael Heerdegen * el-search/el-search.el: Work around Emacs Bug#29857 While trying to get rid of old-style backquotes, Emacs developers made something like (read "(,@a)") - i.e. reading a subexpression of a backquote expression, something that this package needs to be able to do - raise an error. A new variable `force-new-style-backquotes' has now been introduced to prevent this kind of error and force everything to be "interpreted as new style". (el-search-read): New function binding `force-new-style-backquotes' to non-nil when this variable is defined. Change all callers of `read' to use `el-search-read' instead. 2018-01-28 Michael Heerdegen * el-search/el-search.el: Add `el-search-edit-search-description' (el-search-edit-search-description): New command to modify the description of the current search. 2018-01-28 Michael Heerdegen Allow to save the current el-search to a register * el-search/el-search.el (el-search-to-register) (el-search-clone-to-register): New commands. (register-val-jump-to, register-val-describe): Implement methods for `el-search-object' values. 2018-01-28 Michael Heerdegen Implement `cl-print-object' for el-search-objects * el-search/el-search.el: Add (cl-print "1.0") to Package-Requires. Require cl-print. (cl-print-object): Implement for `el-search-object's. 2018-01-21 Michael Heerdegen Add command `el-search-ibuffer-marked-buffers' * el-search/el-search.el (el-search-ibuffer-marked-buffers): New command. (el-search-loop-over-bindings): Add binding in `ibuffer-mode-map'. Also mention the command in the key binding list in the file header. 2018-01-21 Michael Heerdegen * el-search/el-search.el: Bump version to 1.5 2018-01-21 Michael Heerdegen Make el-search key binding installation more flexible Implement a function `el-search-install-bindings-under-prefix' that the user can call to install repeatable versions of the el-search commands under a prefix key. Update header (list of key bindings etc.) accordingly. Also remove the el-search-keep-hl -> 'once hack, since it is not compatible with this change. * el-search/el-search.el (el-search-read-expression-map): Bind M-RET to `el-search-set-occur-flag-exit-minibuffer'. (el-search-use-transient-map, el-search-keep-transient-map-commands): New defvars. (el-search-loop-over-bindings): New abstract key binding function generalizing `el-search-install-shift-bindings'. (el-search-install-shift-bindings): Use it. (el-search-install-bindings-under-prefix): New key binding function. (el-search-prefix-key-transient-map) (el-search-shift-bindings-bind-function) (el-search-bind-under-prefix-key-function): New helper variables and functions. (el-search-prefix-key-maybe-set-transient-map): New function to activate the `el-search-prefix-key-transient-map'. (el-search-setup-search-1, el-search-jump-to-search-head) (el-search-continue-search, el-search-pattern-backwards): Call it. (el-search-keep-hl, el-search-hl-post-command-fun) (el-search--occur-button-action): Remove implementation of el-search-keep-hl -> 'once hack. 2018-01-21 Michael Heerdegen * el-search/el-search.el: Tweak el-search-jump-to-search-head (el-search-jump-to-search-head): Don't use :annotation-function - directly add search description to the candidate instead so that the user can use completion on it. Improve docstring. 2018-01-21 Michael Heerdegen Tweak el-search--get-search-description-string * el-search/el-search.el (el-search--get-search-description-string): Some minor tweaks. 2018-01-21 Michael Heerdegen * el-search/el-search.el: Some minor tweaks (el-search-read-pattern-for-interactive): Add docstring. (el-search-kill-left-over-search-buffers): Improve docstring. (el-search-install-shift-bindings): Move defun. (el-search--format-replacement): Decrease `sit-for' waiting time after messaging the current head file/buffer to 1.0 seconds. (el-search--search-and-replace-pattern): Use faster `el-search--search-pattern-1' instead of `el-search-forward' at one place. And some comment changes. 2018-01-08 Michael Heerdegen Declare any search started with `el-search-this-sexp' single-buffer * el-search/el-search.el (el-search-this-sexp): Do it. 2018-01-08 Michael Heerdegen * el-search/el-search.el: Add two more autoload cookies (el-search-pattern-backwards, el-search-this-sexp): Add autoload cookie. 2018-01-08 Michael Heerdegen New option value ask-multi for `el-search-auto-save-buffers' This should be a bit more convenient than 'ask in practice. * el-search/el-search.el (el-search-auto-save-buffers): Add new value 'ask-multi. (el-search--search-and-replace-pattern): Do the right thing for the new value. * el-search/NEWS: New file, start filling it. 2018-01-05 Michael Heerdegen * el-search/el-search.el: Get rid of orgstruct-mode orgstruct-mode will probably be obsoleted soon. Replace its usage in *El Occur* buffers with similar functions offered by outline.el. (el-search-occur-cycle): Reimplement to use functions from outline.el; add docstring. (el-search-occur-tab-command): New command. (el-search-occur-mode-map): Bind TAB to `el-search-occur-tab-command'. (el-search-occur-mode): Enable `outline-minor-mode' instead of `orgstruct-mode'. 2018-01-05 Michael Heerdegen Allow `string' and `symbol' el-search patterns to set match data The rationale is to allow to use the match data when replacing symbols and strings via `el-search-query-replace'. * packages/el-search/el-search.el (el-search--string-matcher): Use `string-match' instead of `string-match-p. (symbol): Add to documentation an example of using match data with query-replace. 2018-01-05 Michael Heerdegen Update copyrights of some packages Update copyrights of el-search, iterators, on-screen and smart-yank. 2017-12-31 Michael Heerdegen Make the some-context function include an opening backquote When choosing `el-search-occur-get-some-context' as `el-search-get-occur-context-function', when the calculated context follows a backquote, also include that backquote. This also works around one symptom of Emacs bug#29857. * el-search/el-search.el (el-search-occur-get-some-context): Do it. 2017-12-26 Michael Heerdegen * el-search/el-search.el: Some buffer display related minor tweaks (el-search-jump-to-search-head): Use `redisplay' and `sleep-for' to ensure the correct behavior when `pop-to-buffer' generated frame focus events. (el-search-occur-jump-to-match): Call `el-search--occur-button-action' with an empty `display-buffer' action list. (el-search--occur-button-action): Define with `cl-defun' to be able to decide whether the DISPLAY-BUFFER-ACTION argument is specified. (el-search--search-and-replace-pattern): Minor tweaks. 2017-12-26 Michael Heerdegen ; * el-search/el-search.el: Mention Emacs Bug#29857 in the header 2017-12-26 Michael Heerdegen * el-search/el-search.el: Declare doc-string in el-search-defpattern 2017-12-07 Michael Heerdegen packages/el-search: Some minor tweaks * el-search/el-search.el: Explicitly require 'seq. (el-search--read-pattern-for-interactive): Rename to `el-search-read-pattern-for-interactive'; change callers. (el-search--search-and-replace-pattern): Give a short message when switching to the next buffer. And some doc changes, minor tweaks, added comments, and wording improvements. * el-search/el-search-x.el (el-search--file-changed-p): Don't wrap into `ignore-errors' and don't nil-bind `vc-git-diff-switches' (not needed). 2017-12-06 Michael Heerdegen * el-search/el-search.el: Shorten the query-replace prompt Try to make the prompt of `el-search-query-replace' fit into one visible line. (el-search--search-and-replace-pattern): Do it. (el-search-query-replace): Move the elaborations about splicing submode to this command's documentation. 2017-12-04 Michael Heerdegen Use local binding of `post-command-hook' to reset wrap flag The current search is a global thing, so we must use the global value of `post-command-hook' to reset the `el-search--wrap-flag'. 2017-12-04 Michael Heerdegen Fix resuming a single-buffer query-replace 2017-12-04 Michael Heerdegen Display match count for *El Occur* buffers Make `el-search-occur-next-match' and `el-search-occur-previous-match' display an x/y-style match count. 2017-12-04 Michael Heerdegen Fix starting a search with `el-search-this-sexp' Improve behavior of `el-search-jump-to-search-head' and `el-search-query-replace' called directly after `el-search-this-sexp'. 2017-12-01 Stefan Monnier * el-search/el-search.el: Minor tweak. (el-search-make-search): Use `letrec'. (el-search-previous-match): Specify when it was obsoleted. 2017-11-30 Michael Heerdegen Improve folding behavior in *El Occur* buffers 2017-11-29 Michael Heerdegen Fix resuming search in a modified buffer 2017-11-28 Michael Heerdegen Show match count for `el-search-query-replace' 2017-11-23 Michael Heerdegen New command `el-search-count-matches' 2017-11-22 Michael Heerdegen Add a PROMPT arg to `el-search--read-pattern-for-interactive' Use it. 2017-11-15 Michael Heerdegen Bump el-search version to 1.4 2017-11-01 Michael Heerdegen Don't limit `el-search-emacs-elisp-sources' to "lisp/" subdir 2017-10-28 Michael Heerdegen Some details 2017-10-28 Michael Heerdegen Always use the current search for query-replace 2017-10-28 Michael Heerdegen Recover from search head pointing to a killed buffer Try to resume from the associated buffer file; alternatively restart the search. 2017-10-28 Michael Heerdegen Display an x/y-style match count in the echo area 2017-10-23 Michael Heerdegen Improve jumping to matches in *El Occur* buffers 2017-10-22 Michael Heerdegen Require the new rmc.el lib when available 2017-10-22 Michael Heerdegen Fix replacing matches with nil Replacing PATTERN -> nil replaced with t instead. This commit fixes this. 2017-10-22 Michael Heerdegen Fix "Make amount of context around occur matches adjustable" Add missing defun `el-search--bounds-of-defun'. 2017-10-03 Michael Heerdegen Make amount of context around occur matches adjustable Make the amount of context included around each match in *El Occur* buffers adjustable via new commands `el-search-occur-defun-context', `el-search-occur-no-context' and `el-search-occur-some-context'. 2017-09-29 Michael Heerdegen Use a separate function to document defined pattern types 2017-09-29 Michael Heerdegen Show line numbers in *El Occur* buffers 2017-09-29 Michael Heerdegen More multi query-replace related improvements 2017-09-29 Michael Heerdegen Restore current search head in case of error or quit In particular, this change prevents the search head to point to a temporary helper buffer. 2017-09-29 Michael Heerdegen Make `el-search-reset-search' modify its argument Make `el-search-reset-search' modify its argument instead of returning a reset copy. This fixes `el-search-from-beginning' when called with prefix arg which had the first search buffer instantly being killed because the new search had not been taken into consideration when killing temporarily opened file buffers. 2017-09-29 Michael Heerdegen Don't let el-search-pattern resume a paused search When calling `el-search-pattern' from the head buffer of the el-search--current-search, don't automatically resume the el-search--current-search when the last command was not a search command even when the search pattern is the same. Start a new single-buffer search as normal. `el-search-jump-to-search-head' is now the preferred way to resume a suspended el-search--current-search. 2017-09-29 Michael Heerdegen Add some useful commands for *El Occur* buffers Add commands `el-search-occur-next-match', `el-search-occur-previous-match' for quick navigation between matches and `el-search-edit-occur-pattern', a command to modify the search pattern associated with an occur buffer. 2017-09-29 Michael Heerdegen Use stream-x.el 2017-09-29 Michael Heerdegen Narrow down the semantics of symbol LPATs Narrow down the semantics of symbol LPATs: Matching also the quoted and function-quoted symbol made the thing too slow. 2017-08-03 Michael Heerdegen Some details 2017-08-02 Michael Heerdegen Fix el-search--change-p for atoms Factor out predicate `el-search--atomic-p'. Fix a bug in the implementation of `change': Count any el-search--atomic-p thing (e.g. a large string spanning multiple lines) as a change even when not all of its lines have changed. 2017-08-01 Michael Heerdegen Make the el-search-object struct contain an alist of properties Make the el-search-object struct contain a field "properties". Use it to store diverse metadata. Remove the "command" field; instead, use the property "description" which can be bound to a string describing the search. Factor out `el-search--get-search-description-string' which can be called to get a description text for the occur buffer or completion annotation. Make `el-search-setup-search-1' accept an additional optional argument SETUP-FUNCTION that can be used to manipulate the new "properties" field of newly created searches. Use it. 2017-07-25 Michael Heerdegen Fix and speed up the `change' pattern type 2017-07-24 Michael Heerdegen Implement multi-buffer query-replace 2017-07-02 Michael Heerdegen Add new command `el-search-this-sexp' 2017-05-24 Michael Heerdegen Handle read errors when reading and validating replacement 2017-05-17 Michael Heerdegen Some details 2017-05-17 Michael Heerdegen Extend heuristic matching to top-level sexps This speeds up searching in large files. 2017-05-11 Michael Heerdegen Recompile search pattern when resuming searches When resuming a search, recompile the search pattern. This is useful when a pattern type has been redefined. 2017-05-11 Michael Heerdegen Reset wrap flag even when no match 2017-04-28 Michael Heerdegen Tweak el-search--pp-to-string Bind print-circle -> nil. When an object contains multiple occurrences of the empty string, all but the last are printed as #N#. We don't want this (especially when printing a replacement). `string-trim-right' the result from pp which may end with a line break. 2017-04-23 Michael Heerdegen Explicitly require pcase emacs -Q doesn't load pcase any more. 2017-04-15 Michael Heerdegen Add new pattern type `de-morgan' Add pattern `de-morgan' which allows to simplify expressions by applying de Morgan's law. 2017-03-09 Michael Heerdegen el-search version 1.3: Lots of fixes and improvements This change mixes a bunch of new features and fixes: * It is now possible to execute a search as non-interactive occur. * Search patterns, matcher and the invoking command are now stored in the search object instead of separate variables. * A search object doesn't use a stream of matches internally any more but can still export a stream finding all positions of matches of this search with the method `el-search-object-get-matches'. This internal change was a prerequisite to implement a real backward search, bound to C-R when using the default keys. * More careful buffer killing: avoid killing file buffers opened for searching when they are still referenced by a search in the history. * When opening files for searching, avoid `find-file' for better performance. * Displaying buffers has been made customizable by using dedicated `display-buffer' actions. * "Generalized" regexps have been renamed to "regexp-likes". They include function predicates now. * `el-search-jump-to-search-head' now restarts completed searches automatically. * `el-search-forward' now accepts a BOUND argument to make the signature more similar to that of `search-forward'. * A new pattern `in-buffer' (and synonymous `in-file') has been defined that makes it possible to give the heuristic matcher explicit hints. * The `file' pattern has been renamed to `filename' and accepts multiple arguments now. * Searching directories dismisses subdirectories containing a file named ".nosearch" now by default. * Key bindings have been cleaned up. The suggested key bindings can be installed now by calling the new function `el-search-install-shift-bindings'. * `el-search-dired-marked-files' now accepts the list of marked files as an argument and computes the list in the interactive spec instead of the body so that repeating the command from the history works as expected (i.e. uses the same file list). * Improved introduction, lots of details and doc fixes. 2017-01-27 Michael Heerdegen Add a FILE argument to `el-search-dired-marked-files' Make `el-search-dired-marked-files' accept the list of marked files as an argument and compute the list in the interactive spec instead of the body so that repeating the command from the history works as expected (i.e. uses the same file list). 2017-01-26 Michael Heerdegen Update some copyrights 2017-01-25 Michael Heerdegen Use `read' to circumvent bug#24542 Use `read' to jump over symbols starting with an "@" character. This should fix the issues caused by bug#24542 completely instead of handling only special cases. Add some documentation for `el-search--end-of-sexp'. 2017-01-20 Michael Heerdegen Improve half-baked introduction of key bindings Define a helper function installing the suggested key bindings. Don't bind any keys by default, even not in `el-search-map'. 2017-01-19 Michael Heerdegen Improve summary message of `el-search-overview' 2017-01-18 Michael Heerdegen New command `el-search-from-beginning' 2017-01-14 Michael Heerdegen Also count pattern types starting with "_" as internal 2017-01-02 Michael Heerdegen Work around more manifestations of Emacs bug #24542 Not only the symbol `@' but all symbols with names of the form "@+" cause trouble. We need to avoid to call `scan-sexps' from the beginning of any of these symbols. 2016-12-31 Michael Heerdegen el-search: bump version to 1.2.2 2016-12-31 Michael Heerdegen Improve handling of reader errors in el-search-atom-list 2016-12-28 Michael Heerdegen Avoid infinite recursion in circular programs Prevent heuristic matching go into an infinite recursion in circular programs like '#1=(1 . #1#). 2016-12-27 Michael Heerdegen Call `user-error' instead of `error' where appropriate Also improve some error messages. 2016-12-27 Michael Heerdegen Use regexp-opt on suffixes in el-search--elisp-file-name-p 2016-12-21 Michael Heerdegen Use jka-compr-load-suffixes instead of hardcoded suffixes 2016-12-20 Michael Heerdegen Add a helpful comment; bump version to 1.2.1 2016-12-20 Michael Heerdegen Explicitly `error' when trying to jump to invalid search head Give a meaningful error message when the user calls `el-search-jump-to-search-head' but the search head points to a killed buffer. 2016-12-20 Michael Heerdegen Set syntax table for temp buffers in el-search-atom-list 2016-12-20 Michael Heerdegen Fix disregarding compressed elisp files 2016-12-15 Michael Heerdegen Extend the heuristic matching approach; complete review 2016-11-16 Michael Heerdegen Fix leaving behind helper buffers 2016-11-08 Michael Heerdegen Don't use the non-word "heuristical" 2016-11-07 Michael Heerdegen Some details 2016-11-06 Michael Heerdegen Speed up multi searching; version 1.1 2016-10-31 Michael Heerdegen New command `el-search-load-path' 2016-10-30 Michael Heerdegen Document change-revision transformer function; make a defcustom 2016-10-30 Michael Heerdegen Inhibit logging of some messages 2016-10-28 Michael Heerdegen `change', `changed': make "HEAD" as default explicit 2016-10-17 Michael Heerdegen el-search: more cleanup and minor tweaks; version 1.0.1 2016-10-17 Michael Heerdegen Add missing settings of some vars when restoring a previous search 2016-10-17 Michael Heerdegen Call el-search--wrap-pattern at better places Try to call `el-search--wrap-pattern' directly before compiling the pattern to avoid that the wrapped pattern appears in the histories. 2016-10-15 Michael Heerdegen Rewrite of el-search for version 1.0 Big rewrite and cleanup. Add multi-search support. Update and improve docs. 2016-10-15 Michael Heerdegen Work around Emacs bug#24542 Avoid calling `scan-sexps' directly before the symbol `@' since it may error. 2016-10-07 Michael Heerdegen Add section "Patterns for stylistic rewriting" and pattern `iffy-if' 2016-09-16 Michael Heerdegen Make el-search--make-docstring require a NAME argument 2016-09-13 Michael Heerdegen Add `el-search--macroexpand' 2016-09-07 Michael Heerdegen Fix replacement verification for splicing mode 2016-08-30 Michael Heerdegen Some details 2016-08-16 Michael Heerdegen Simplify `el-search--transform-nontrivial-lpat' 2016-08-16 Michael Heerdegen Simplify nested backquotes 2016-08-11 Michael Heerdegen el-search: bump version to 0.2.2 2016-08-11 Michael Heerdegen Improve `change' and `changed' - Renew cache when saved file version has changed. - Use markers as region boundaries so that replacing inside changed expressions works. 2016-08-11 Michael Heerdegen Add calling convention to el-search-defpattern's docstring 2016-08-11 Michael Heerdegen el-search--make-docstring: exclude some specially named patterns Make patterns starting with a hyphen, or containing "--" not appear in the generated docstring of `el-search-pattern': patterns with these names are now considered internal. 2016-08-11 Michael Heerdegen Fix el-search-query-replace reindent wrongly in narrowed buffer 2016-08-10 Michael Heerdegen Move some pattern definitions to new file "el-search-x" 2016-08-10 Michael Heerdegen Update copyright 2016-08-03 Michael Heerdegen Add comment about (pcase) backquote inside (real) backquote 2016-07-11 Paul Eggert Fix some quoting problems in doc strings Most of these are minor issues involving, e.g., quoting `like this' instead of 'like this'. A few involve escaping ` and ' with a preceding \= when the characters should not be turned into curved single quotes. 2016-05-28 Michael Heerdegen Rewrite the `change' and `changed' patterns so that they don't rely on `diff-hl-mode's overlays. Instead use the output of `diff-hl-changes' directly (and cache it). Make both patterns accept an optional REVISION argument. 2016-05-21 Michael Heerdegen el-search version 0.2 2016-05-21 Michael Heerdegen el-search--ensure-sexp-start: don't assume point-min==1 Thanks Stefan. 2016-05-21 Michael Heerdegen Factor out `el-search--replace-hunk' 2016-05-19 Michael Heerdegen Improve history handling 2016-05-19 Michael Heerdegen Set initial input for replace when coming from el-search-pattern 2016-05-19 Michael Heerdegen Clean up el-search-read-expression-map; add some doc 2016-05-19 Michael Heerdegen Make sure not to lose the minibuffer-prompt face 2016-05-19 Michael Heerdegen Reduce duration of a `sit-for' 2016-05-19 Michael Heerdegen Rename a local variable 2016-05-19 Michael Heerdegen Make query-replace accept FROM -> TO style input Use this format for history entries. 2016-05-19 Michael Heerdegen Small fix in el-search--setup-minibuffer 2016-05-19 Michael Heerdegen Use `pp-to-string' to print replacement expression 2016-05-19 Michael Heerdegen Give el-search--s a more meaningful name Rename `el-search--s' to `el-search--transform-nontrivial-lpat'. 2016-05-19 Michael Heerdegen Make el-search-pattern accept an optional NO-ERROR arg 2016-05-19 Michael Heerdegen Fix el-search--ensure-sexp-start error at bob 2016-05-19 Michael Heerdegen Clarify the operation scope of replacing 2016-05-19 Michael Heerdegen Address compiler warnings 2016-05-19 Michael Heerdegen Add patterns for character properties 2016-05-19 Michael Heerdegen Rename two functions 2016-05-19 Michael Heerdegen Handle replacements containing another match 2016-05-19 Michael Heerdegen Improve documentation and argument names of el-search-query-replace 2016-05-19 Michael Heerdegen Comment and whitespace changes only 2016-05-19 Michael Heerdegen Replacing: make C-g an alternative key for quitting 2016-05-19 Michael Heerdegen Rewrite replacement layout restoration 2016-05-19 Michael Heerdegen el-search--check-pattern-args: make arg TYPE a string 2016-05-19 Michael Heerdegen Rewrite `string' pattern definition 2016-05-19 Michael Heerdegen New user option: el-search-use-sloppy-strings 2016-03-11 Michael Heerdegen New function el-search--macroexpand-1 for debugging 2016-03-04 Michael Heerdegen Minor change in `string' pattern 2016-03-02 Michael Heerdegen Fix for non-interactive calls of el-search-pattern 2016-03-02 Michael Heerdegen Tweak docstring of el-search--ensure-sexp-start 2016-03-01 Michael Heerdegen New user option: el-search-smart-case-fold-search 2016-02-15 Michael Heerdegen factor out minibuffer setup hook fun; treat empty input 2016-02-14 Michael Heerdegen Improve doc of el-search-this-expression-identifier. 2016-02-12 Michael Heerdegen Complete and document what a SYMBOL in `l' matches 2016-02-12 Michael Heerdegen use uninterned symbol in `el-search--matcher' 2016-02-09 Michael Heerdegen Go to isearch left end when starting replace with el-search from isearch This partially reverts "When coming from isearch, don't move to other end". 2016-01-10 Michael Heerdegen Support highlighting of all visible matches 2016-01-09 Michael Heerdegen el-search: New pattern type `l' 2015-12-31 Michael Heerdegen el-search: bump version to 0.1.3 2015-12-31 Michael Heerdegen When coming from isearch, don't move to other end when at match end 2015-12-31 Michael Heerdegen el-search: new pattern type `contains' 2015-12-31 Michael Heerdegen use more newlines in `el-search--make-docstring' 2015-12-31 Michael Heerdegen remove annoying message on how to repeat el-search 2015-12-31 Michael Heerdegen factor out `el-search--search-pattern-1' 2015-12-31 Michael Heerdegen el-search: new pattern type `not' 2015-12-31 Michael Heerdegen remove example using `message' in a guard 2015-12-31 Michael Heerdegen el-search: new pattern type `append' 2015-12-29 Michael Heerdegen el-search: some cleanup - fix `help-fns--signature' call to make `el-search--make-docstring' work when loading the library as non-compiled source code - refine definition of `kbd' pattern and documentation - move stuff for defining additional patterns to a separate section - add some commentaries - bump version to 0.1.2 2015-12-12 Michael Heerdegen el-search--matcher: refine when to warn or error 2015-11-27 Michael Heerdegen bump version to 0.1.1 2015-11-27 Michael Heerdegen el-search-query-replace: add s (toggle splicing) and ? (help) keys 2015-11-18 Michael Heerdegen prerequisites to allow replace with multiple expressions 2015-11-16 Michael Heerdegen add a to do 2015-11-15 Michael Heerdegen edit TODO list 2015-11-05 Michael Heerdegen fix compiler errors and warnings 2015-10-31 Michael Heerdegen el-search: bump version to 0.1 2015-10-31 Michael Heerdegen simplify el-search-hl-post-command-fun 2015-10-31 Michael Heerdegen remove search wrapping functionality 2015-10-31 Michael Heerdegen improve docs; new: el-search-defpattern; add some pattern types 2015-10-31 Michael Heerdegen fix whitespace 2015-10-31 Michael Heerdegen spelling fixes 2015-10-31 Michael Heerdegen el-search--read-pattern: fix default(s) 2015-10-31 Michael Heerdegen give feedback in the echo area again 2015-10-31 Michael Heerdegen fix whitespace 2015-10-31 Michael Heerdegen document el-search--do-subsexps 2015-10-31 Michael Heerdegen fix el-search-hl-post-command-fun auto-removal 2015-10-31 Michael Heerdegen fix el-search--repair-replacement-layout: don't move when replacing 2015-10-31 Michael Heerdegen rename a local variable 2015-10-31 Michael Heerdegen some doc tweaks 2015-10-31 Michael Heerdegen change a TODO entry; no code change 2015-10-31 Michael Heerdegen remove not so useful message of how to repeat search 2015-10-31 Michael Heerdegen allow search wrapping 2015-10-31 Michael Heerdegen arrange we can use `call-interactively' when coming from isearch 2015-10-31 Michael Heerdegen call syntax functions less often for better efficiency 2015-10-11 Michael Heerdegen whitespace clean up 2015-10-11 Michael Heerdegen rename a local variable 2015-10-11 Michael Heerdegen rename a function 2015-10-11 Michael Heerdegen new function el-search--end-of-sexp; use it 2015-10-11 Michael Heerdegen avoid repeated expansion of pcase forms 2015-10-11 Michael Heerdegen rename a function 2015-10-11 Michael Heerdegen drop el-search-expression-contains-match-p A correct implementation would have to be more complicated. We didn't recurse on arrays for example, or we didn't find (2 3) in (1 . (2 3)). And it wasn't that effective either, so I remove it. 2015-10-11 Michael Heerdegen fix a condition in el-search--do-subsexps 2015-10-11 Michael Heerdegen el-search: some comment changes 2015-10-11 Michael Heerdegen rename a function 2015-10-11 Michael Heerdegen change default of el-search-this-expression-identifier 2015-10-11 Michael Heerdegen avoid looking-back in el-search--goto-next-sexp because it extremely slows it down 2015-09-22 Michael Heerdegen el-search: bump version 2015-09-22 Michael Heerdegen el-search: some comment changes 2015-09-22 Michael Heerdegen el-search: add autoload cookies 2015-09-22 Michael Heerdegen el-search: remove redundant :group specs from custom defs 2015-09-22 Michael Heerdegen el-search: remove redundant package dependency on cl-lib 2015-09-22 Michael Heerdegen el-search: fix two typos 2015-09-22 Michael Heerdegen el-search: fix comment styles 2015-08-06 Stefan Monnier * el-search.el: Add missing footer 2015-08-05 Stefan Monnier * el-search.el: Fix first line convention 2015-08-05 Michael Heerdegen el-search: some small improvements 2015-08-04 Michael Heerdegen new package el-search for searching elisp