[elpa] master 36043c1 2/2: Merge commit '11843e2db4a24aaec2ad9a827ed4f079588dcf58'
branch: master commit 36043c1d768b309ba3471d5b3aa79b0520e0e34b Merge: 9f5c4e0 11843e2 Author: Stephen Leake Commit: Stephen Leake Merge commit '11843e2db4a24aaec2ad9a827ed4f079588dcf58' --- externals-list | 3 +- packages/el-search/NEWS | 15 + packages/el-search/el-search.el | 676 +++- packages/sokoban/sokoban.el | 99 -- 4 files changed, 542 insertions(+), 251 deletions(-) diff --git a/externals-list b/externals-list index b2dd210..b6459a7 100644 --- a/externals-list +++ b/externals-list @@ -83,8 +83,7 @@ ("gnome-c-style" :subtree "https://github.com/ueno/gnome-c-style.git";) ("gnorb" :subtree "https://github.com/girzel/gnorb";) ("gpastel":external "https://gitlab.petton.fr/DamienCassou/gpastel";) - ;; FIXME: Waiting for copyright paperwork - ;; ("greader" :external "https://gitlab.com/michelangelo-rodriguez/greader";) + ("greader":external "https://gitlab.com/michelangelo-rodriguez/greader";) ("highlight-escape-sequences" :subtree "https://github.com/dgutov/highlight-escape-sequences/";) ("hyperbole" :external "http://git.savannah.gnu.org/r/hyperbole.git";) ("ioccur" :subtree "https://github.com/thierryvolpiatto/ioccur.git";) diff --git a/packages/el-search/NEWS b/packages/el-search/NEWS index e158df9..07bea82 100644 --- a/packages/el-search/NEWS +++ b/packages/el-search/NEWS @@ -1,6 +1,21 @@ Some of the user visible news were: +Version: 1.9.7 + + Changed default binding schemes: For reasons of harmonization, in + both searches and in el-search-occur both of basic keys s, r and n, p + now move to the next or previous match. + + The default binding of 'el-search-continue-in-next-buffer' therefore + has been moved from n to x respectively. + +Version: 1.9.5 + + 'string' and derived pattern types now support expressions evaluting + to regexps as arguments. This means you can use 'rx' to construct + regexps in 'string' patterns, for example. + Version: 1.9.0 This version adds some help commands available through the C-h help diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el index c85197c..b4981fe 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -7,7 +7,7 @@ ;; Created: 29 Jul 2015 ;; Keywords: lisp ;; Compatibility: GNU Emacs 25 -;; Version: 1.9.4 +;; Version: 1.9.7 ;; Package-Requires: ((emacs "25") (stream "2.2.4") (cl-print "1.0")) @@ -119,7 +119,7 @@ ;; C-O or M-RET (from a search pattern prompt) ;; Execute this search command as occur. ;; -;; C-N, M-s e n (`el-search-continue-in-next-buffer') +;; C-X, M-s e x (`el-search-continue-in-next-buffer') ;; Skip over current buffer or file. ;; ;; C-D, M-s e d (`el-search-skip-directory') @@ -249,7 +249,7 @@ ;; `el-search-jump-to-search-head' (C-J; M-s e j): this command jumps ;; to the last match and re-activates the search. ;; -;; `el-search-continue-in-next-buffer' (C-N; n) skips all remaining +;; `el-search-continue-in-next-buffer' (C-X; x) skips all remaining ;; matches in the current buffer and continues searching in the next ;; buffer. `el-search-skip-directory' (C-D; d) even skips all ;; subsequent files under a specified directory. @@ -474,6 +474,21 @@ "Expression based search and replace for Emacs Lisp." :group 'lisp) +(defcustom el-search-display-mb-hints t + "Whether to show hints in the search pattern prompt." + :type 'boolean) + +(defcustom el-search-mb-hints-delay 0.8 + "Time before displaying minibuffer hints. + +Setting this has only an effect if `el-search-display-mb-hints' +is non-nil." + :type 'number) + +(defcustom el-search-mb-hints-timeout 15 + "How long to display minibuffer hints." + :type 'number) + (defface el-search-match 'class color) (min-colors 88) (background dark)) (:background "#60")) (((class color) (min-colors 88) (background light)) @@ -788,11 +803,18 @@ nil." (unless ,done ,@unwindforms) +(defvar el-search--last-message nil + "Internal var helping to avoid echo area stuttering ") + (defun el-search--message-no-log (format-string &rest args) "Like `message' but with `message-log-max' bound to nil." (let ((message-log-max nil)) (apply #'message format-string args))) +(defun el-search--set-this-command-refresh-message-maybe () + (when (eq (setq this-command 'el-search-pattern) last-command) +(message "%s" el-search--last-message))) + (defalias 'el-search-read (if (boundp 'force-new-style-backquotes) (lambda (&optional stream) @@ -863,10 +885,13 @@ nil." input) (symbol-value histvar) +(defun el-search--pattern-is-unquoted-symbol-p (pattern) + (and (symbolp pattern) + (not (eq pattern '_)) + (not (keywordp pattern + (defun el-search--maybe-warn-about-
[elpa] master 9f5c4e0 1/2: In uniquify-files, use text property to pass completion style
branch: master commit 9f5c4e0fc0e34540f28a84fcf3fcb53592d8ad05 Author: Stephen Leake Commit: Stephen Leake In uniquify-files, use text property to pass completion style * packages/uniquify-files/uniquify-files.el: (uniq-file--regexp, uniq-file--conflicts, uniq-file--hilit): Rename from uniq-files-*. (uniq-file--set-style): New. (uniq-file-all-completions): Use it. (completion-get-data-string, completion-to-table-input): Use 'completion-style text property. * packages/uniquify-files/uniquify-files-test.el: Match code changes. * packages/uniquify-files/file-complete-root-relative.el: (fc-root-rel-all-completions): Set 'completion-style text property. * packages/uniquify-files/file-complete-root-relative-test.el: (test-fc-root-rel-test-completion-1): Match code changes. --- .../file-complete-root-relative-test.el| 43 ++- .../uniquify-files/file-complete-root-relative.el | 1 + packages/uniquify-files/uniquify-files-test.el | 45 +++- packages/uniquify-files/uniquify-files.el | 84 ++ 4 files changed, 90 insertions(+), 83 deletions(-) diff --git a/packages/uniquify-files/file-complete-root-relative-test.el b/packages/uniquify-files/file-complete-root-relative-test.el index f696288..ddf863e 100644 --- a/packages/uniquify-files/file-complete-root-relative-test.el +++ b/packages/uniquify-files/file-complete-root-relative-test.el @@ -174,33 +174,38 @@ ) (defun test-fc-root-rel-test-completion-1 (table) - (should (equal (test-completion "foo-fi" table) -nil)) + ;; In normal operation, 'all-completions' is called before + ;; test-completion, and it sets the 'completion-style text property. + (cl-flet ((ss (str) + (put-text-property 0 1 'completion-style 'file-root-rel str) + str)) +(should (equal (test-completion (ss "foo-fi") table) + nil)) - (should (equal (test-completion "dir/f-fi" table) -nil)) +(should (equal (test-completion (ss "dir/f-fi") table) + nil)) - (should (equal (test-completion "foo-file1.text" table) -t)) ;; starts at root +(should (equal (test-completion (ss "foo-file1.text") table) + t)) ;; starts at root - (should (equal (test-completion "alice-1/foo-file1.text" table) -nil)) ;; does not start at root +(should (equal (test-completion (ss "alice-1/foo-file1.text") table) + nil)) ;; does not start at root - (should (equal (test-completion "Alice/alice-1/foo-file1.text" table) -t)) ;; starts at root +(should (equal (test-completion (ss "Alice/alice-1/foo-file1.text") table) + t)) ;; starts at root - (should (equal (test-completion "foo-file3.text" table) -nil)) +(should (equal (test-completion (ss "foo-file3.text") table) + nil)) - (should (equal (test-completion "foo-file3.texts2" table) -t)) +(should (equal (test-completion (ss "foo-file3.texts2") table) + t)) - (should (equal (test-completion "Alice/alice-/bar-file2.text" table) -nil)) +(should (equal (test-completion (ss "Alice/alice-/bar-file2.text") table) + nil)) - (should (equal (test-completion "Alice/alice-1/bar-file2.text" table) -t)) - ) +(should (equal (test-completion (ss "Alice/alice-1/bar-file2.text") table) + t)) +)) (ert-deftest test-fc-root-rel-test-completion-iter () (let ((table (apply-partially 'fc-root-rel-completion-table-iter fc-root-rel-iter)) diff --git a/packages/uniquify-files/file-complete-root-relative.el b/packages/uniquify-files/file-complete-root-relative.el index 929afdc..e3ece9a 100644 --- a/packages/uniquify-files/file-complete-root-relative.el +++ b/packages/uniquify-files/file-complete-root-relative.el @@ -191,6 +191,7 @@ character after each completion field." (when all (setq all (fc-root-rel-to-user all (fc-root-rel--root table))) (fc-root-rel--hilit user-string all point)) + (uniq-file--set-style all 'file-root-rel)) )) (defun fc-root-rel--valid-completion (string all root) diff --git a/packages/uniquify-files/uniquify-files-test.el b/packages/uniquify-files/uniquify-files-test.el index 4dc1923..13214a4 100644 --- a/packages/uniquify-files/uniquify-files-test.el +++ b/packages/uniquify-files/uniquify-files-test.el @@ -159,30 +159,35 @@ ) (defun test-uniq-file-test-completion-1 (table) - (should (equal (test-completion "foo-fi" table) -nil)) + ;; In normal operation, 'all-completions' is called before + ;; test-completion, and it sets the 'completion-style text property. + (cl-flet ((ss (str) + (put-text-property 0 1 'completion-style 'uniquify-file str) + str)) +(should (equal
[elpa] master 5f87c61: [el-search] Display colored defun match count
branch: master commit 5f87c6157b62118f7ad741463af3c94065c55aab Author: Michael Heerdegen Commit: 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. --- packages/el-search/el-search.el | 30 +++--- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el index b4981fe..dc2a3f8 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -2708,17 +2708,25 @@ don't display anything" buffer-or-file matches-<=-here total-matches -(propertize - (format (pcase (save-excursion - (goto-char (car defun-bounds)) - (el-search-read (current-buffer))) - (`(,a ,b . ,_) (format "(%s %%d/%%d)" - (truncate-string-to-width - (format "%S %S" a b) - 40 nil nil 'ellipsis))) - (_ "(%d/%d)")) - matches-<=-here-in-defun total-matches-in-defun) - 'face 'shadow +(format + (pcase (save-excursion + (goto-char (car defun-bounds)) + (and (el-search-looking-at '`(,_ ,_ . ,_)) + (looking-at "(") ;exclude toplevel `ATOM and sim. + (let ((region (list + (progn (down-list) (point)) + (min (line-end-position) + (scan-sexps (point) 2) + (when (bound-and-true-p jit-lock-mode) + (apply #'jit-lock-fontify-now region)) + (apply #'buffer-substring region + ((and (pred stringp) signature) +(format "(%s %%d/%%d)" +(truncate-string-to-width + signature + 40 nil nil 'ellipsis))) + (_ "(%d/%d)")) + matches-<=-here-in-defun total-matches-in-defun (list (concat (if (not just-count) "[Not at a match] " "") (if (= matches-<=-here total-matches)
[elpa] master 8cd64f9: [el-search] Avoid bytecomp warning windows pop up
branch: master commit 8cd64f9c3cf0b11218f163b1f2290a7c8eaed95e Author: Michael Heerdegen Commit: 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. --- packages/el-search/el-search.el | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el index dc2a3f8..d9787a4 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -811,6 +811,10 @@ nil." (let ((message-log-max nil)) (apply #'message format-string args))) +(defun el-search--byte-compile (form) + (let ((byte-compile-log-warning-function #'ignore)) +(byte-compile form))) + (defun el-search--set-this-command-refresh-message-maybe () (when (eq (setq this-command 'el-search-pattern) last-command) (message "%s" el-search--last-message))) @@ -1232,7 +1236,7 @@ N times." (pattern-is-symbol (and (symbolp pattern) (not (or (keywordp pattern) (null pattern)) - (byte-compile + (el-search--byte-compile `(lambda (,(if pattern-is-catchall '_ expression)) ,(cond (pattern-is-catchall (if result-specified result-expr t)) @@ -2277,7 +2281,7 @@ argument (that should be a string)." (lambda (bindings body) (if (null bindings) body `(let ,bindings ,body) - (byte-compile + (el-search--byte-compile (let ((string (make-symbol "string"))) `(lambda (,string) ,(wrap-let
[elpa] master a91ad33: [el-search] Fine tune separator for splicing replace
branch: master commit a91ad330a8ee5e196e7ecfe48cbfccd6e65d3c83 Author: Michael Heerdegen Commit: 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. --- packages/el-search/el-search.el | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el index d9787a4..1fcf81e 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -4045,7 +4045,11 @@ text." (with-temp-buffer (emacs-lisp-mode) (insert (if splice -(mapconcat #'el-search--pp-to-string replacement " ") +(let ((insertions (mapcar #'el-search--pp-to-string replacement))) + (mapconcat #'identity insertions + (if (cl-some (apply-partially #'string-match-p "\n") + insertions) + "\n" " "))) (el-search--pp-to-string replacement))) (goto-char 1) (let (start this-sexp end orig-match-start orig-match-end done)