diff --git a/elpa/counsel-20210928.949/counsel-pkg.el b/elpa/counsel-20210928.949/counsel-pkg.el deleted file mode 100644 index 6ec59b9b..00000000 --- a/elpa/counsel-20210928.949/counsel-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; Generated package description from counsel.el -*- no-byte-compile: t -*- -(define-package "counsel" "20210928.949" "Various completion functions using Ivy" '((emacs "24.5") (ivy "0.13.4") (swiper "0.13.4")) :commit "1c6b3da377a840e898b14020133f59fca9ceea1c" :authors '(("Oleh Krehel" . "ohwoeowho@gmail.com")) :maintainer '("Oleh Krehel" . "ohwoeowho@gmail.com") :keywords '("convenience" "matching" "tools") :url "https://github.com/abo-abo/swiper") diff --git a/elpa/counsel-20210928.949/counsel-autoloads.el b/elpa/counsel-20230619.1623/counsel-autoloads.el similarity index 74% rename from elpa/counsel-20210928.949/counsel-autoloads.el rename to elpa/counsel-20230619.1623/counsel-autoloads.el index 7f4339fa..7822880c 100644 --- a/elpa/counsel-20210928.949/counsel-autoloads.el +++ b/elpa/counsel-20230619.1623/counsel-autoloads.el @@ -1,35 +1,32 @@ -;;; counsel-autoloads.el --- automatically extracted autoloads -;; +;;; counsel-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- +;; Generated by the `loaddefs-generate' function. + +;; This file is part of GNU Emacs. + ;;; Code: -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) +(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) + -;;;### (autoloads nil "counsel" "counsel.el" (0 0 0 0)) ;;; Generated autoloads from counsel.el (autoload 'counsel-company "counsel" "\ -Complete using `company-candidates'." t nil) - +Complete using `company-candidates'." t) (autoload 'counsel-irony "counsel" "\ -Inline C/C++ completion using Irony." t nil) - +Inline C/C++ completion using Irony." t) (autoload 'counsel-describe-variable "counsel" "\ Forward to `describe-variable'. Variables declared using `defcustom' are highlighted according to -`ivy-highlight-face'." t nil) - +`ivy-highlight-face'." t) (autoload 'counsel-describe-function "counsel" "\ Forward to `describe-function'. Interactive functions (i.e., commands) are highlighted according -to `ivy-highlight-face'." t nil) - +to `ivy-highlight-face'." t) (autoload 'counsel-describe-symbol "counsel" "\ -Forward to `describe-symbol'." t nil) - +Forward to `describe-symbol'." t) (autoload 'counsel-set-variable "counsel" "\ Set a variable SYM, with completion. @@ -42,64 +39,52 @@ input corresponding to the chosen variable. With a prefix arg, restrict list to variables defined using `defcustom'. -\(fn SYM)" t nil) - +(fn SYM)" t) (autoload 'counsel-apropos "counsel" "\ Show all matching symbols. See `apropos' for further information on what is considered -a symbol and how to search for them." t nil) - +a symbol and how to search for them." t) (autoload 'counsel-info-lookup-symbol "counsel" "\ Forward SYMBOL to `info-lookup-symbol' with ivy completion. With prefix arg MODE a query for the symbol help mode is offered. -\(fn SYMBOL &optional MODE)" t nil) - +(fn SYMBOL &optional MODE)" t) (autoload 'counsel-M-x "counsel" "\ Ivy version of `execute-extended-command'. Optional INITIAL-INPUT is the initial input in the minibuffer. This function integrates with either the `amx' or `smex' package when available, in that order of precedence. -\(fn &optional INITIAL-INPUT)" t nil) - +(fn &optional INITIAL-INPUT)" t) (autoload 'counsel-command-history "counsel" "\ -Show the history of commands." t nil) - +Show the history of commands." t) (autoload 'counsel-load-library "counsel" "\ Load a selected the Emacs Lisp library. -The libraries are offered from `load-path'." t nil) - +The libraries are offered from `load-path'." t) (autoload 'counsel-find-library "counsel" "\ Visit a selected the Emacs Lisp library. -The libraries are offered from `load-path'." t nil) - +The libraries are offered from `load-path'." t) (autoload 'counsel-load-theme "counsel" "\ Forward to `load-theme'. Usable with `ivy-resume', `ivy-next-line-and-call' and -`ivy-previous-line-and-call'." t nil) - +`ivy-previous-line-and-call'." t) (autoload 'counsel-descbinds "counsel" "\ Show a list of all defined keys and their definitions. If non-nil, show only bindings that start with PREFIX. BUFFER defaults to the current one. -\(fn &optional PREFIX BUFFER)" t nil) - +(fn &optional PREFIX BUFFER)" t) (autoload 'counsel-describe-face "counsel" "\ -Completion for `describe-face'." t nil) - +Completion for `describe-face'." t) (autoload 'counsel-faces "counsel" "\ Complete faces with preview. Actions are provided by default for describing or customizing the -selected face." t nil) - +selected face." t) (autoload 'counsel-git "counsel" "\ Find file in the current Git repository. INITIAL-INPUT can be given as the initial minibuffer input. -\(fn &optional INITIAL-INPUT)" t nil) - +(fn &optional INITIAL-INPUT)" t) (autoload 'counsel-git-grep "counsel" "\ Grep for a string in the current Git repository. INITIAL-INPUT can be given as the initial minibuffer input. @@ -107,98 +92,78 @@ INITIAL-DIRECTORY, if non-nil, is used as the root directory for search. When CMD is a string, use it as a \"git grep\" command. When CMD is non-nil, prompt for a specific \"git grep\" command. -\(fn &optional INITIAL-INPUT INITIAL-DIRECTORY CMD)" t nil) - +(fn &optional INITIAL-INPUT INITIAL-DIRECTORY CMD)" t) (autoload 'counsel-git-stash "counsel" "\ -Search through all available git stashes." t nil) - +Search through all available git stashes." t) (autoload 'counsel-git-change-worktree "counsel" "\ -Find the file corresponding to the current buffer on a different worktree." t nil) - +Find the file corresponding to the current buffer on a different worktree." t) (autoload 'counsel-git-checkout "counsel" "\ -Call the \"git checkout\" command." t nil) - +Call the \"git checkout\" command." t) (autoload 'counsel-git-log "counsel" "\ -Call the \"git log --grep\" shell command." t nil) - +Call the \"git log --grep\" shell command." t) (autoload 'counsel-find-file "counsel" "\ Forward to `find-file'. When INITIAL-INPUT is non-nil, use it in the minibuffer during completion. -\(fn &optional INITIAL-INPUT INITIAL-DIRECTORY)" t nil) - +(fn &optional INITIAL-INPUT INITIAL-DIRECTORY)" t) (autoload 'counsel-dired "counsel" "\ Forward to `dired'. When INITIAL-INPUT is non-nil, use it in the minibuffer during completion. -\(fn &optional INITIAL-INPUT)" t nil) - +(fn &optional INITIAL-INPUT)" t) (autoload 'counsel-recentf "counsel" "\ -Find a file on `recentf-list'." t nil) - +Find a file on `recentf-list'." t) (autoload 'counsel-buffer-or-recentf "counsel" "\ -Find a buffer visiting a file or file on `recentf-list'." t nil) - +Find a buffer visiting a file or file on `recentf-list'." t) (autoload 'counsel-bookmark "counsel" "\ -Forward to `bookmark-jump' or `bookmark-set' if bookmark doesn't exist." t nil) - +Forward to `bookmark-jump' or `bookmark-set' if bookmark doesn't exist." t) (autoload 'counsel-bookmarked-directory "counsel" "\ Ivy interface for bookmarked directories. With a prefix argument, this command creates a new bookmark which points to the -current value of `default-directory'." t nil) - +current value of `default-directory'." t) (autoload 'counsel-file-register "counsel" "\ Search file in register. You cannot use Emacs' normal register commands to create file registers. Instead you must use the `set-register' function like so: `(set-register ?i \"/home/eric/.emacs.d/init.el\")'. Now you -can use `C-x r j i' to open that file." t nil) - +can use `C-x r j i' to open that file." t) (autoload 'counsel-locate-action-extern "counsel" "\ Pass X to `xdg-open' or equivalent command via the shell. -\(fn X)" t nil) - +(fn X)" t) (autoload 'counsel-locate "counsel" "\ Call a \"locate\" style shell command. INITIAL-INPUT can be given as the initial minibuffer input. -\(fn &optional INITIAL-INPUT)" t nil) - -(autoload 'counsel-tracker "counsel" nil t nil) - +(fn &optional INITIAL-INPUT)" t) +(autoload 'counsel-tracker "counsel" nil t) (autoload 'counsel-fzf "counsel" "\ Open a file using the fzf shell command. INITIAL-INPUT can be given as the initial minibuffer input. INITIAL-DIRECTORY, if non-nil, is used as the root directory for search. FZF-PROMPT, if non-nil, is passed as `ivy-read' prompt argument. -\(fn &optional INITIAL-INPUT INITIAL-DIRECTORY FZF-PROMPT)" t nil) - +(fn &optional INITIAL-INPUT INITIAL-DIRECTORY FZF-PROMPT)" t) (autoload 'counsel-dpkg "counsel" "\ -Call the \"dpkg\" shell command." t nil) - +Call the \"dpkg\" shell command." t) (autoload 'counsel-rpm "counsel" "\ -Call the \"rpm\" shell command." t nil) - +Call the \"rpm\" shell command." t) (autoload 'counsel-file-jump "counsel" "\ Jump to a file below the current directory. List all files within the current directory or any of its sub-directories. INITIAL-INPUT can be given as the initial minibuffer input. INITIAL-DIRECTORY, if non-nil, is used as the root directory for search. -\(fn &optional INITIAL-INPUT INITIAL-DIRECTORY)" t nil) - +(fn &optional INITIAL-INPUT INITIAL-DIRECTORY)" t) (autoload 'counsel-dired-jump "counsel" "\ Jump to a directory (see `dired-jump') below the current directory. List all sub-directories within the current directory. INITIAL-INPUT can be given as the initial minibuffer input. INITIAL-DIRECTORY, if non-nil, is used as the root directory for search. -\(fn &optional INITIAL-INPUT INITIAL-DIRECTORY)" t nil) - +(fn &optional INITIAL-INPUT INITIAL-DIRECTORY)" t) (autoload 'counsel-ag "counsel" "\ Grep for a string in a root directory using `ag'. @@ -214,24 +179,21 @@ CALLER is passed to `ivy-read'. With a `\\[universal-argument]' prefix argument, prompt for INITIAL-DIRECTORY. With a `\\[universal-argument] \\[universal-argument]' prefix argument, prompt additionally for EXTRA-AG-ARGS. -\(fn &optional INITIAL-INPUT INITIAL-DIRECTORY EXTRA-AG-ARGS AG-PROMPT &key CALLER)" t nil) - +(fn &optional INITIAL-INPUT INITIAL-DIRECTORY EXTRA-AG-ARGS AG-PROMPT &key CALLER)" t) (autoload 'counsel-pt "counsel" "\ Grep for a string in the current directory using pt. INITIAL-INPUT can be given as the initial minibuffer input. This uses `counsel-ag' with `counsel-pt-base-command' instead of `counsel-ag-base-command'. -\(fn &optional INITIAL-INPUT)" t nil) - +(fn &optional INITIAL-INPUT)" t) (autoload 'counsel-ack "counsel" "\ Grep for a string in the current directory using ack. INITIAL-INPUT can be given as the initial minibuffer input. This uses `counsel-ag' with `counsel-ack-base-command' replacing `counsel-ag-base-command'. -\(fn &optional INITIAL-INPUT)" t nil) - +(fn &optional INITIAL-INPUT)" t) (autoload 'counsel-rg "counsel" "\ Grep for a string in the current directory using `rg'. INITIAL-INPUT can be given as the initial minibuffer input. @@ -242,80 +204,62 @@ RG-PROMPT, if non-nil, is passed as `ivy-read' prompt argument. Example input with inclusion and exclusion file patterns: require i -- -g*.el -\(fn &optional INITIAL-INPUT INITIAL-DIRECTORY EXTRA-RG-ARGS RG-PROMPT)" t nil) - +(fn &optional INITIAL-INPUT INITIAL-DIRECTORY EXTRA-RG-ARGS RG-PROMPT)" t) (autoload 'counsel-grep "counsel" "\ Grep for a string in the file visited by the current buffer. When non-nil, INITIAL-INPUT is the initial search pattern. -\(fn &optional INITIAL-INPUT)" t nil) - +(fn &optional INITIAL-INPUT)" t) (autoload 'counsel-grep-backward "counsel" "\ Grep for a string in the file visited by the current buffer going backward similar to `swiper-backward'. When non-nil, INITIAL-INPUT is the initial search pattern. -\(fn &optional INITIAL-INPUT)" t nil) - +(fn &optional INITIAL-INPUT)" t) (autoload 'counsel-grep-or-swiper "counsel" "\ Call `swiper' for small buffers and `counsel-grep' for large ones. When non-nil, INITIAL-INPUT is the initial search pattern. -\(fn &optional INITIAL-INPUT)" t nil) - +(fn &optional INITIAL-INPUT)" t) (autoload 'counsel-grep-or-swiper-backward "counsel" "\ Call `swiper-backward' for small buffers and `counsel-grep-backward' for large ones. When non-nil, INITIAL-INPUT is the initial search pattern. -\(fn &optional INITIAL-INPUT)" t nil) - +(fn &optional INITIAL-INPUT)" t) (autoload 'counsel-recoll "counsel" "\ Search for a string in the recoll database. You'll be given a list of files that match. Selecting a file will launch `swiper' for that file. INITIAL-INPUT can be given as the initial minibuffer input. -\(fn &optional INITIAL-INPUT)" t nil) - -(autoload 'counsel--org-get-tags "counsel" nil nil nil) - +(fn &optional INITIAL-INPUT)" t) +(autoload 'counsel--org-get-tags "counsel") (autoload 'counsel-org-tag "counsel" "\ -Add or remove tags in `org-mode'." t nil) - +Add or remove tags in `org-mode'." t) (autoload 'counsel-org-tag-agenda "counsel" "\ -Set tags for the current agenda item." t nil) - +Set tags for the current agenda item." t) (defalias 'counsel-org-goto #'counsel-outline) - (autoload 'counsel-org-goto-all "counsel" "\ -Go to a different location in any org file." t nil) - +Go to a different location in any org file." t) (autoload 'counsel-org-file "counsel" "\ -Browse all attachments for current Org file." t nil) - +Browse all attachments for current Org file." t) (autoload 'counsel-org-entity "counsel" "\ -Complete Org entities using Ivy." t nil) - +Complete Org entities using Ivy." t) (autoload 'counsel-org-capture "counsel" "\ -Capture something." t nil) - +Capture something." t) (autoload 'counsel-org-agenda-headlines "counsel" "\ -Choose from headers of `org-mode' files in the agenda." t nil) - +Choose from headers of `org-mode' files in the agenda." t) (autoload 'counsel-org-link "counsel" "\ -Insert a link to an headline with completion." t nil) - +Insert a link to an headline with completion." t) (autoload 'counsel-mark-ring "counsel" "\ Browse `mark-ring' interactively. -Obeys `widen-automatically', which see." t nil) - +Obeys `widen-automatically', which see." t) (autoload 'counsel-evil-marks "counsel" "\ Ivy replacement for `evil-show-marks'. By default, this function respects `counsel-evil-marks-exclude-registers'. When ARG is non-nil, display all active evil registers. -\(fn &optional ARG)" t nil) - +(fn &optional ARG)" t) (autoload 'counsel-package "counsel" "\ Install or delete packages. @@ -327,11 +271,9 @@ selecting one of these will try to delete it. Additional actions:\\ \\[ivy-dispatching-done] d: Describe package - \\[ivy-dispatching-done] h: Visit package's homepage" t nil) - + \\[ivy-dispatching-done] h: Visit package's homepage" t) (autoload 'counsel-tmm "counsel" "\ -Text-mode emulation of looking and choosing from a menu bar." t nil) - +Text-mode emulation of looking and choosing from a menu bar." t) (autoload 'counsel-yank-pop "counsel" "\ Ivy replacement for `yank-pop'. With a plain prefix argument (\\[universal-argument]), @@ -342,77 +284,58 @@ See also `counsel-yank-pop-filter' for how to filter candidates. Note: Duplicate elements of `kill-ring' are always deleted. -\(fn &optional ARG)" t nil) - +(fn &optional ARG)" t) (autoload 'counsel-register "counsel" "\ -Interactively choose a register." t nil) - +Interactively choose a register." t) (autoload 'counsel-evil-registers "counsel" "\ -Ivy replacement for `evil-show-registers'." t nil) - +Ivy replacement for `evil-show-registers'." t) (autoload 'counsel-imenu "counsel" "\ -Jump to a buffer position indexed by imenu." t nil) - +Jump to a buffer position indexed by imenu." t) (autoload 'counsel-list-processes "counsel" "\ Offer completion for `process-list'. The default action deletes the selected process. -An extra action allows to switch to the process buffer." t nil) - +An extra action allows to switch to the process buffer." t) (autoload 'counsel-minibuffer-history "counsel" "\ -Browse minibuffer history." t nil) - +Browse minibuffer history." t) (autoload 'counsel-esh-history "counsel" "\ -Browse Eshell history." t nil) - +Browse Eshell history." t) (autoload 'counsel-shell-history "counsel" "\ -Browse shell history." t nil) - +Browse shell history." t) (autoload 'counsel-slime-repl-history "counsel" "\ -Browse Slime REPL history." t nil) - +Browse Slime REPL history." t) (autoload 'counsel-hydra-heads "counsel" "\ -Call a head of the current/last hydra." t nil) - +Call a head of the current/last hydra." t) (autoload 'counsel-semantic "counsel" "\ -Jump to a semantic tag in the current buffer." t nil) - -(autoload 'counsel-semantic-or-imenu "counsel" nil t nil) - +Jump to a semantic tag in the current buffer." t) +(autoload 'counsel-semantic-or-imenu "counsel" nil t) (autoload 'counsel-outline "counsel" "\ -Jump to an outline heading with completion." t nil) - +Jump to an outline heading with completion." t) (autoload 'counsel-ibuffer "counsel" "\ Use ibuffer to switch to another buffer. NAME specifies the name of the buffer (defaults to \"*Ibuffer*\"). -\(fn &optional NAME)" t nil) - +(fn &optional NAME)" t) (autoload 'counsel-switch-to-shell-buffer "counsel" "\ -Switch to a shell buffer, or create one." t nil) - +Switch to a shell buffer, or create one." t) (autoload 'counsel-unicode-char "counsel" "\ Insert COUNT copies of a Unicode character at point. COUNT defaults to 1. -\(fn &optional COUNT)" t nil) - +(fn &optional COUNT)" t) (autoload 'counsel-colors-emacs "counsel" "\ Show a list of all supported colors for a particular frame. You can insert or kill the name or hexadecimal RGB value of the -selected color." t nil) - +selected color." t) (autoload 'counsel-colors-web "counsel" "\ Show a list of all W3C web colors for use in CSS. You can insert or kill the name or hexadecimal RGB value of the -selected color." t nil) - +selected color." t) (autoload 'counsel-fonts "counsel" "\ Show a list of all supported font families for a particular frame. -You can insert or kill the name of the selected font." t nil) - +You can insert or kill the name of the selected font." t) (autoload 'counsel-kmacro "counsel" "\ Interactively choose and run a keyboard macro. @@ -423,35 +346,28 @@ and their respective counter format. Displayed next to each macro is the counter's format and initial value. One can use actions to copy the counter format or initial counter -value of a macro, using them for a new macro." t nil) - +value of a macro, using them for a new macro." t) (autoload 'counsel-geiser-doc-look-up-manual "counsel" "\ -Search Scheme documentation." t nil) - +Search Scheme documentation." t) (autoload 'counsel-rhythmbox "counsel" "\ Choose a song from the Rhythmbox library to play or enqueue. -\(fn &optional ARG)" t nil) - +(fn &optional ARG)" t) (autoload 'counsel-linux-app "counsel" "\ Launch a Linux desktop application, similar to Alt-. When ARG is non-nil, ignore NoDisplay property in *.desktop files. -\(fn &optional ARG)" t nil) - +(fn &optional ARG)" t) (autoload 'counsel-wmctrl "counsel" "\ -Select a desktop window using wmctrl." t nil) - +Select a desktop window using wmctrl." t) (autoload 'counsel-switch-buffer "counsel" "\ Switch to another buffer. Display a preview of the selected ivy completion candidate buffer -in the current window." t nil) - +in the current window." t) (autoload 'counsel-switch-buffer-other-window "counsel" "\ Switch to another buffer in another window. Display a preview of the selected ivy completion candidate buffer -in the current window." t nil) - +in the current window." t) (autoload 'counsel-compile "counsel" "\ Call `compile' completing with smart suggestions, optionally for DIR. @@ -459,11 +375,9 @@ Additional actions: \\{counsel-compile-map} -\(fn &optional DIR)" t nil) - +(fn &optional DIR)" t) (autoload 'counsel-compile-env "counsel" "\ -Update `counsel-compile-env' interactively." t nil) - +Update `counsel-compile-env' interactively." t) (autoload 'counsel-minor "counsel" "\ Enable or disable minor mode. @@ -475,26 +389,20 @@ selecting one of these will enable it. Additional actions:\\ \\[ivy-dispatching-done] d: Go to minor mode definition - \\[ivy-dispatching-done] h: Describe minor mode" t nil) - -(autoload 'counsel-major "counsel" nil t nil) - + \\[ivy-dispatching-done] h: Describe minor mode" t) +(autoload 'counsel-major "counsel" nil t) (autoload 'counsel-compilation-errors "counsel" "\ -Compilation errors." t nil) - +Compilation errors." t) (autoload 'counsel-flycheck "counsel" "\ -Flycheck errors." t nil) - +Flycheck errors." t) (defvar counsel-mode nil "\ -Non-nil if Counsel mode is enabled. +Non-nil if counsel mode is enabled. See the `counsel-mode' command for a description of this minor mode. Setting this variable directly does not take effect; either customize it (see the info node `Easy Customization') or call the function `counsel-mode'.") - (custom-autoload 'counsel-mode "counsel" nil) - (autoload 'counsel-mode "counsel" "\ Toggle Counsel mode on or off. Turn Counsel mode on if ARG is positive, off otherwise. Counsel @@ -504,16 +412,19 @@ replacements. Local bindings (`counsel-mode-map'): \\{counsel-mode-map} -\(fn &optional ARG)" t nil) +(fn &optional ARG)" t) +(register-definition-prefixes "counsel" '("counsel-" "ivy-function-called-at-point")) + +;;; End of scraped data -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "counsel" '("counsel-" "ivy-function-called-at-point" "tmm-km-list"))) +(provide 'counsel-autoloads) -;;;*** - ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 +;; no-native-compile: t +;; coding: utf-8-emacs-unix ;; End: + ;;; counsel-autoloads.el ends here diff --git a/elpa/counsel-20230619.1623/counsel-pkg.el b/elpa/counsel-20230619.1623/counsel-pkg.el new file mode 100644 index 00000000..23589925 --- /dev/null +++ b/elpa/counsel-20230619.1623/counsel-pkg.el @@ -0,0 +1,16 @@ +(define-package "counsel" "20230619.1623" "Various completion functions using Ivy" + '((emacs "24.5") + (ivy "0.14.0") + (swiper "0.14.0")) + :commit "aa18c1f4861cef2ddcf0c70b6fd7edd93ae9c627" :authors + '(("Oleh Krehel" . "ohwoeowho@gmail.com")) + :maintainers + '(("Oleh Krehel" . "ohwoeowho@gmail.com")) + :maintainer + '("Oleh Krehel" . "ohwoeowho@gmail.com") + :keywords + '("convenience" "matching" "tools") + :url "https://github.com/abo-abo/swiper") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/counsel-20210928.949/counsel.el b/elpa/counsel-20230619.1623/counsel.el similarity index 97% rename from elpa/counsel-20210928.949/counsel.el rename to elpa/counsel-20230619.1623/counsel.el index 48732084..4c3cd02a 100644 --- a/elpa/counsel-20210928.949/counsel.el +++ b/elpa/counsel-20230619.1623/counsel.el @@ -1,13 +1,11 @@ ;;; counsel.el --- Various completion functions using Ivy -*- lexical-binding: t -*- -;; Copyright (C) 2015-2021 Free Software Foundation, Inc. +;; Copyright (C) 2015-2023 Free Software Foundation, Inc. ;; Author: Oleh Krehel ;; URL: https://github.com/abo-abo/swiper -;; Package-Version: 20210928.949 -;; Package-Commit: 1c6b3da377a840e898b14020133f59fca9ceea1c -;; Version: 0.13.4 -;; Package-Requires: ((emacs "24.5") (ivy "0.13.4") (swiper "0.13.4")) +;; Version: 0.14.0 +;; Package-Requires: ((emacs "24.5") (ivy "0.14.0") (swiper "0.14.0")) ;; Keywords: convenience, matching, tools ;; This file is part of GNU Emacs. @@ -349,20 +347,19 @@ Update the minibuffer with the amount of lines collected every (delete-process process)))) ;;* Completion at point -(define-obsolete-function-alias 'counsel-el 'complete-symbol "<2020-05-20 Wed>") -(define-obsolete-function-alias 'counsel-cl 'complete-symbol "<2020-05-20 Wed>") -(define-obsolete-function-alias 'counsel-jedi 'complete-symbol "<2020-05-20 Wed>") -(define-obsolete-function-alias 'counsel-clj 'complete-symbol "<2020-05-20 Wed>") +(define-obsolete-function-alias 'counsel-el #'complete-symbol "<2020-05-20 Wed>") +(define-obsolete-function-alias 'counsel-cl #'complete-symbol "<2020-05-20 Wed>") +(define-obsolete-function-alias 'counsel-jedi #'complete-symbol "<2020-05-20 Wed>") +(define-obsolete-function-alias 'counsel-clj #'complete-symbol "<2020-05-20 Wed>") ;;** `counsel-company' (defvar company-candidates) -(defvar company-common) -(defvar company-prefix) (declare-function company-abort "ext:company") (declare-function company-complete "ext:company") (declare-function company-mode "ext:company") (declare-function company-call-backend "ext:company") (declare-function company--clean-string "ext:company") +(declare-function company--continue "ext:company") ;;;###autoload (defun counsel-company () @@ -371,25 +368,15 @@ Update the minibuffer with the amount of lines collected every (company-mode 1) (unless company-candidates (company-complete)) - (let ((len (cond ((let (l) - (and company-common - (string= company-common - (buffer-substring - (- (point) (setq l (length company-common))) - (point))) - l))) - (company-prefix - (length company-prefix))))) - (when len - (setq ivy-completion-beg (- (point) len)) - (setq ivy-completion-end (point)) - (ivy-read "Candidate: " company-candidates - :action #'ivy-completion-in-region-action - :caller 'counsel-company)))) + (when company-candidates + (company--continue) + (ivy-read "Candidate: " company-candidates + :action 'company-finish + :caller 'counsel-company))) (ivy-configure 'counsel-company :display-transformer-fn #'counsel--company-display-transformer - :unwind-fn #'company-abort) + :unwind-fn (lambda() (unless ivy-exit (company-abort)))) (defun counsel--company-display-transformer (s) (concat s (let ((annot (company-call-backend 'annotation s))) @@ -971,7 +958,7 @@ when available, in that order of precedence." ;;** `counsel-command-history' (defun counsel-command-history-action-eval (cmd) "Eval the command CMD." - (eval (read cmd))) + (eval (read cmd) t)) (defun counsel-command-history-action-edit-and-eval (cmd) "Edit and eval the command CMD." @@ -1098,7 +1085,7 @@ Usable with `ivy-resume', `ivy-next-line-and-call' and `ivy-previous-line-and-call'." (interactive) (ivy-read "Load custom theme: " - (mapcar 'symbol-name + (mapcar #'symbol-name (custom-available-themes)) :action #'counsel-load-theme-action :caller 'counsel-load-theme)) @@ -1307,6 +1294,9 @@ Like `locate-dominating-file', but DIR defaults to "\0" t))) +(defvar counsel-git-history nil + "History for `counsel-git'.") + ;;;###autoload (defun counsel-git (&optional initial-input) "Find file in the current Git repository. @@ -1317,6 +1307,7 @@ INITIAL-INPUT can be given as the initial minibuffer input." (ivy-read "Find file: " (counsel-git-cands default-directory) :initial-input initial-input :action #'counsel-git-action + :history 'counsel-git-history :caller 'counsel-git))) (ivy-configure 'counsel-git @@ -1369,10 +1360,10 @@ INITIAL-INPUT can be given as the initial minibuffer input." ;;** `counsel-git-grep' (defvar counsel-git-grep-map (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-l") 'ivy-call-and-recenter) - (define-key map (kbd "M-q") 'counsel-git-grep-query-replace) - (define-key map (kbd "C-c C-m") 'counsel-git-grep-switch-cmd) - (define-key map (kbd "C-x C-d") 'counsel-cd) + (define-key map (kbd "C-l") #'ivy-call-and-recenter) + (define-key map (kbd "M-q") #'counsel-git-grep-query-replace) + (define-key map (kbd "C-c C-m") #'counsel-git-grep-switch-cmd) + (define-key map (kbd "C-x C-d") #'counsel-cd) map)) (defvar counsel-git-grep-cmd-default "git --no-pager grep -n --no-color -I -e \"%s\"" @@ -1390,8 +1381,10 @@ INITIAL-INPUT can be given as the initial minibuffer input." (defcustom counsel-grep-post-action-hook nil "Hook that runs after the point moves to the next candidate. -Typical value: '(recenter)." - :type 'hook) +A typical example of what to add to this hook is the function +`recenter'." + :type 'hook + :options '(recenter)) (defcustom counsel-git-grep-cmd-function #'counsel-git-grep-cmd-function-default "How a git-grep shell call is built from the input. @@ -1611,7 +1604,7 @@ When CMD is non-nil, prompt for a specific \"git grep\" command." (delete-dups counsel-git-grep-cmd-history)) (unless (ivy-state-dynamic-collection ivy-last) (setq ivy--all-candidates - (all-completions "" 'counsel-git-grep-function)))) + (all-completions "" #'counsel-git-grep-function)))) (defun counsel--normalize-grep-match (str) ;; Prepend ./ if necessary: @@ -1795,7 +1788,8 @@ currently checked out." (and (string-match "\\`[[:blank:]]+" line) (list (substring line (match-end 0))))) (let ((default-directory (counsel-locate-git-root))) - (split-string (shell-command-to-string "git branch -vv --all") + (split-string (shell-command-to-string + "git branch -vv --all --no-color") "\n" t)))) ;;;###autoload @@ -1833,11 +1827,11 @@ currently checked out." ;;** `counsel-find-file' (defvar counsel-find-file-map (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-DEL") 'counsel-up-directory) - (define-key map (kbd "C-") 'counsel-up-directory) + (define-key map (kbd "C-DEL") #'counsel-up-directory) + (define-key map (kbd "C-") #'counsel-up-directory) (define-key map (kbd "`") #'counsel-file-jump-from-find) - (define-key map (kbd "C-`") (ivy-make-magic-action 'counsel-find-file "b")) - (define-key map [remap undo] 'counsel-find-file-undo) + (define-key map (kbd "C-`") (ivy-make-magic-action #'counsel-find-file "b")) + (define-key map [remap undo] #'counsel-find-file-undo) map)) (defun counsel-file-jump-from-find () @@ -1962,12 +1956,12 @@ choose between `yes-or-no-p' and `y-or-n-p'; otherwise default to These files are un-ignored if `ivy-text' matches them. The common way to show all files is to start `ivy-text' with a dot. -Example value: \"\\(?:\\`[#.]\\)\\|\\(?:[#~]\\'\\)\". This will hide -temporary and lock files. +Example value: \"\\\\=`[#.]\\|[#~]\\\\='\". +This will hide temporary and lock files. \\ -Choosing the dotfiles option, \"\\`\\.\", might be convenient, +Choosing the dotfiles option, \"\\\\=`\\.\", might be convenient, since you can still access the dotfiles if your input starts with -a dot. The generic way to toggle ignored files is \\[ivy-toggle-ignore], +a dot. The generic way to toggle ignored files is \\[ivy-toggle-ignore], but the leading dot is a lot faster." :type `(choice (const :tag "None" nil) @@ -2058,7 +2052,9 @@ The preselect behavior can be customized via user options "Forward to `find-file'. When INITIAL-INPUT is non-nil, use it in the minibuffer during completion." (interactive) - (let ((default-directory (or initial-directory default-directory))) + (defvar tramp-archive-enabled) + (let ((tramp-archive-enabled nil) + (default-directory (or initial-directory default-directory))) (counsel--find-file-1 "Find file: " initial-input #'counsel-find-file-action 'counsel-find-file))) @@ -2234,40 +2230,38 @@ See variable `counsel-up-directory-level'." (defun counsel-emacs-url-p () "Return a Debbugs issue URL at point." - (when (counsel-require-program "git" t) - (let ((url (counsel-at-git-issue-p))) - (when url - (let ((origin (shell-command-to-string - "git remote get-url origin"))) - (when (string-match "git.sv.gnu.org:/srv/git/emacs.git" origin) - (format "https://debbugs.gnu.org/cgi/bugreport.cgi?bug=%s" - (substring url 1)))))))) + (let ((url (and (counsel-require-program "git" t) + (counsel-at-git-issue-p)))) + (when url + (let ((origin (shell-command-to-string "git remote get-url origin"))) + (when (string-match-p "git.sv.gnu.org:/srv/git/emacs.git" origin) + (format "https://bugs.gnu.org/%s" (substring url 1))))))) (defvar counsel-url-expansions-alist nil "Map of regular expressions to expansions. -This variable should take the form of a list of (REGEXP . FORMAT) -pairs. +The value of this variable is a list of pairs (REGEXP . FORMAT). -`counsel-url-expand' will expand the word at point according to +`counsel-url-expand' expands the word at point according to FORMAT for the first matching REGEXP. FORMAT can be either a -string or a function. If it is a string, it will be used as the -format string for the `format' function, with the word at point -as the next argument. If it is a function, it will be called -with the word at point as the sole argument. +string or a function. If it is a string, it is used as the +format string for the function `format', with the word at point +as the next argument. If it is a function, it is called with the +word at point as the sole argument. For example, a pair of the form: - '(\"\\`BSERV-[[:digit:]]+\\'\" . \"https://jira.atlassian.com/browse/%s\") -will expand to URL `https://jira.atlassian.com/browse/BSERV-100' -when the word at point is BSERV-100. - -If the format element is a function, more powerful -transformations are possible. As an example, - '(\"\\`issue\\([[:digit:]]+\\)\\'\" . + \\='(\"\\\\\\=`BSERV-[[:digit:]]+\\\\\\='\" . + \"https://jira.atlassian.com/browse/%s\") +expands to the URL `https://jira.atlassian.com/browse/BSERV-100' +when the word at point is \"BSERV-100\". + +If FORMAT is a function, more powerful transformations are +possible. As an example, + \\='(\"\\\\\\=`issue\\\\([[:digit:]]+\\\\)\\\\\\='\" . (lambda (word) - (concat \"https://debbugs.gnu.org/cgi/bugreport.cgi?bug=\" - (match-string 1 word)))) -trims the \"issue\" prefix from the word at point before creating the URL.") + (concat \"https://bugs.gnu.org/\" (match-string 1 word)))) +trims the \"issue\" prefix from the word at point before creating +the URL.") (defun counsel-url-expand () "Expand word at point using `counsel-url-expansions-alist'. @@ -2953,10 +2947,10 @@ INITIAL-DIRECTORY, if non-nil, is used as the root directory for search." ;;** `counsel-ag' (defvar counsel-ag-map (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-l") 'ivy-call-and-recenter) - (define-key map (kbd "M-q") 'counsel-git-grep-query-replace) - (define-key map (kbd "C-'") 'swiper-avy) - (define-key map (kbd "C-x C-d") 'counsel-cd) + (define-key map (kbd "C-l") #'ivy-call-and-recenter) + (define-key map (kbd "M-q") #'counsel-git-grep-query-replace) + (define-key map (kbd "C-'") #'swiper-avy) + (define-key map (kbd "C-x C-d") #'counsel-cd) map)) (defcustom counsel-ag-base-command (list "ag" "--vimgrep" "%s") @@ -3288,9 +3282,9 @@ Example input with inclusion and exclusion file patterns: ;;** `counsel-grep' (defvar counsel-grep-map (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-l") 'ivy-call-and-recenter) - (define-key map (kbd "M-q") 'swiper-query-replace) - (define-key map (kbd "C-'") 'swiper-avy) + (define-key map (kbd "C-l") #'ivy-call-and-recenter) + (define-key map (kbd "M-q") #'swiper-query-replace) + (define-key map (kbd "C-'") #'swiper-avy) map)) (defcustom counsel-grep-base-command "grep -E -n -e %s %s" @@ -4047,13 +4041,13 @@ This variable has no effect unless (nth 5 components)))) (list (mapconcat - 'identity - (cl-remove-if 'null + #'identity + (cl-remove-if #'null (list level todo (and priority (format "[#%c]" priority)) - (mapconcat 'identity + (mapconcat #'identity (append path (list text)) counsel-outline-path-separator) tags)) @@ -4359,13 +4353,21 @@ Additional actions:\\ ("h" counsel-package-action-homepage "open package homepage"))) ;;** `counsel-tmm' -(defvar tmm-km-list nil) -(declare-function tmm-get-keymap "tmm") -(declare-function tmm--completion-table "tmm") -(declare-function tmm-get-keybind "tmm") +(declare-function tmm-get-keymap "tmm" (elt &optional in-x-menu)) +(declare-function tmm--completion-table "tmm" (items)) + +(defalias 'counsel--menu-keymap + ;; Added in Emacs 28.1. + (if (fboundp 'menu-bar-keymap) + #'menu-bar-keymap + (autoload 'tmm-get-keybind "tmm") + (declare-function tmm-get-keybind "tmm" (keyseq)) + (lambda () (tmm-get-keybind [menu-bar]))) + "Compatibility shim for `menu-bar-keymap'.") (defun counsel-tmm-prompt (menu) "Select and call an item from the MENU keymap." + (defvar tmm-km-list) (let (out choice chosen-string) @@ -4383,16 +4385,15 @@ Additional actions:\\ (setq last-command-event chosen-string) (call-interactively choice))))) -(defvar tmm-table-undef) - ;;;###autoload (defun counsel-tmm () "Text-mode emulation of looking and choosing from a menu bar." (interactive) (require 'tmm) + (defvar tmm-table-undef) (run-hooks 'menu-bar-update-hook) (setq tmm-table-undef nil) - (counsel-tmm-prompt (tmm-get-keybind [menu-bar]))) + (counsel-tmm-prompt (counsel--menu-keymap))) ;;** `counsel-yank-pop' (defcustom counsel-yank-pop-truncate-radius 2 @@ -4498,24 +4499,27 @@ mark, as per \\[universal-argument] \\[yank]." "Like `yank-pop', but insert the kill corresponding to S. Signal a `buffer-read-only' error if called from a read-only buffer position." - (with-ivy-window - (barf-if-buffer-read-only) - (setq yank-window-start (window-start)) - (unless (eq last-command 'yank) - ;; Avoid unexpected deletions with `yank-handler' properties. - (setq yank-undo-function nil)) - (condition-case nil - (let (;; Deceive `yank-pop'. - (last-command 'yank) - ;; Avoid unexpected additions to `kill-ring'. - interprogram-paste-function) - (yank-pop (counsel--yank-pop-position s))) - (error - ;; Support strings not present in the kill ring. - (insert s))) - (when (funcall (if counsel-yank-pop-after-point #'> #'<) - (point) (mark t)) - (exchange-point-and-mark t)))) + (when (and (eq major-mode 'vterm-mode) + (fboundp 'vterm-insert)) + (let ((inhibit-read-only t)) + (vterm-insert s))) + (barf-if-buffer-read-only) + (setq yank-window-start (window-start)) + (unless (eq last-command 'yank) + ;; Avoid unexpected deletions with `yank-handler' properties. + (setq yank-undo-function nil)) + (condition-case nil + (let (;; Deceive `yank-pop'. + (last-command 'yank) + ;; Avoid unexpected additions to `kill-ring'. + interprogram-paste-function) + (yank-pop (counsel--yank-pop-position s))) + (error + ;; Support strings not present in the kill ring. + (insert s))) + (when (funcall (if counsel-yank-pop-after-point #'> #'<) + (point) (mark t)) + (exchange-point-and-mark t))) (defun counsel-yank-pop-action-remove (s) "Remove all occurrences of S from the kill ring." @@ -4704,9 +4708,13 @@ S will be of the form \"[register]: content\"." imenu-auto-rescan-maxout)) (items (imenu--make-index-alist t)) (items (delete (assoc "*Rescan*" items) items)) - (items (if (eq major-mode 'emacs-lisp-mode) - (counsel-imenu-categorize-functions items) - items))) + (items (cond ((eq major-mode 'emacs-lisp-mode) + (counsel-imenu-categorize-functions items)) + ((and (derived-mode-p 'python-mode) + (fboundp 'python-imenu-create-flat-index)) + (python-imenu-create-flat-index)) + (t + items)))) (counsel-imenu-get-candidates-from items))) (defun counsel-imenu-get-candidates-from (alist &optional prefix) @@ -4734,7 +4742,7 @@ PREFIX is used to create the key." (defvar counsel-imenu-map (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-l") 'ivy-call-and-recenter) + (define-key map (kbd "C-l") #'ivy-call-and-recenter) map)) (defun counsel-imenu-categorize-functions (items) @@ -4746,8 +4754,7 @@ PREFIX is used to create the key." items))) (defun counsel-imenu-action (x) - (with-ivy-window - (imenu (cdr x)))) + (imenu (cdr x))) (defvar counsel-imenu-history nil "History for `counsel-imenu'.") @@ -4895,9 +4902,9 @@ An extra action allows to switch to the process buffer." (counsel--browse-history eshell-history-ring :caller #'counsel-esh-history)) -(defadvice eshell-previous-matching-input (before - counsel-set-eshell-history-index - activate) +(advice-add 'eshell-previous-matching-input + :before #'counsel--set-eshell-history-index) +(defun counsel--set-eshell-history-index (&rest _) "Reassign `eshell-history-index'." (when (and (memq last-command '(ivy-alt-done ivy-done)) (equal (ivy-state-caller ivy-last) 'counsel-esh-history)) @@ -4914,9 +4921,9 @@ An extra action allows to switch to the process buffer." (counsel--browse-history comint-input-ring :caller #'counsel-shell-history)) -(defadvice comint-previous-matching-input (before - counsel-set-comint-history-index - activate) +(advice-add 'comint-previous-matching-input + :before #'counsel--set-comint-history-index) +(defun counsel--set-comint-history-index (&rest _) "Reassign `comint-input-ring-index'." (when (and (memq last-command '(ivy-alt-done ivy-done)) (equal (ivy-state-caller ivy-last) 'counsel-shell-history)) @@ -4948,8 +4955,8 @@ An extra action allows to switch to the process buffer." (let* ((base (substring (prin1-to-string hydra-curr-body-fn) 0 -4)) - (heads (eval (intern (concat base "heads")))) - (keymap (eval (intern (concat base "keymap")))) + (heads (symbol-value (intern (concat base "heads")))) + (keymap (symbol-value (intern (concat base "keymap")))) (head-names (mapcar (lambda (x) (cons @@ -5601,6 +5608,12 @@ You can insert or kill the name of the selected font." (ivy-state-collection ivy-last))) (ivy--kill-current-candidate))) +(defvar kmacro-ring) +(defvar kmacro-initial-counter-value) +(defvar kmacro-counter) +(defvar kmacro-counter-value-start) +(defvar kmacro-counter-format-start) + ;;;###autoload (defun counsel-kmacro () "Interactively choose and run a keyboard macro. @@ -5715,6 +5728,10 @@ This will apply to the next macro a user defines." (format (nth 2 actual-kmacro))) (kmacro-set-format format))) +(declare-function kmacro-cycle-ring-previous "kmacro" (&optional arg)) +(declare-function kmacro-set-format "kmacro" (format)) +(declare-function kmacro-set-counter "kmacro" (arg)) + (defun counsel-kmacro-action-cycle-ring-to-macro (x) "Cycle `kmacro-ring' until `last-kbd-macro' is the selected macro. This is convenient when using \\[kmacro-end-or-call-macro] to call macros. @@ -6108,7 +6125,7 @@ This function always returns its elements in a stable order." (when (file-exists-p dir) (let ((dir (file-name-as-directory dir))) ;; Function `directory-files-recursively' added in Emacs 25.1. - (dolist (file (directory-files-recursively dir ".*\\.desktop$")) + (dolist (file (directory-files-recursively dir "\\.desktop\\'")) (let ((id (subst-char-in-string ?/ ?- (file-relative-name file dir)))) (when (and (not (gethash id hash)) (file-readable-p file)) (push (cons id file) result) @@ -6182,7 +6199,7 @@ Any desktop entries that fail to parse are recorded in (defun counsel-linux-apps-list () "Return list of all Linux desktop applications." (let* ((new-desktop-alist (counsel-linux-apps-list-desktop-files)) - (new-files (mapcar 'cdr new-desktop-alist))) + (new-files (mapcar #'cdr new-desktop-alist))) (unless (and (eq counsel-linux-app-format-function counsel--linux-apps-cache-format-function) @@ -6534,10 +6551,10 @@ sub-directories that builds may be invoked in." (defun counsel-compile--probe-make-help (dir) "Return a list of Make targets based on help for DIR. -It is quite common for a 'make help' invocation to return a human -readable list of targets. Often common targets are marked with a -leading asterisk. The exact search pattern is controlled by -`counsel-compile-help-pattern'." +It is quite common for a \"make help\" invocation to return a +human readable list of targets. Often common targets are marked +with a leading asterisk. The exact search pattern is controlled +by `counsel-compile-help-pattern'." (let ((default-directory dir) primary-targets targets) ;; Only proceed if the help target exists. @@ -6901,7 +6918,7 @@ We update it in the callback with `ivy-update-candidates'." :caller 'counsel-search)) (define-obsolete-function-alias 'counsel-google - 'counsel-search "<2019-10-17 Thu>") + #'counsel-search "<2019-10-17 Thu>") ;;** `counsel-compilation-errors' (defun counsel--compilation-errors-buffer (buf) @@ -7042,7 +7059,7 @@ Local bindings (`counsel-mode-map'): (when counsel-mode-override-describe-bindings (advice-add #'describe-bindings :override #'counsel-descbinds)) (define-key minibuffer-local-map (kbd "C-r") - 'counsel-minibuffer-history)) + #'counsel-minibuffer-history)) (advice-remove #'describe-bindings #'counsel-descbinds))) (provide 'counsel) diff --git a/elpa/counsel-projectile-20190724.1903/counsel-projectile-pkg.el b/elpa/counsel-projectile-20190724.1903/counsel-projectile-pkg.el deleted file mode 100644 index def84ade..00000000 --- a/elpa/counsel-projectile-20190724.1903/counsel-projectile-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "counsel-projectile" "20190724.1903" "Ivy integration for Projectile" '((counsel "0.12.0") (projectile "2.0.0")) :commit "90d3792ab90559a9de6ad419dbfb2435a36a224d" :keywords '("project" "convenience") :authors '(("Eric Danan")) :maintainer '("Eric Danan") :url "https://github.com/ericdanan/counsel-projectile") diff --git a/elpa/counsel-projectile-20190724.1903/counsel-projectile-autoloads.el b/elpa/counsel-projectile-20211004.2003/counsel-projectile-autoloads.el similarity index 73% rename from elpa/counsel-projectile-20190724.1903/counsel-projectile-autoloads.el rename to elpa/counsel-projectile-20211004.2003/counsel-projectile-autoloads.el index 0f51944e..4ff2e129 100644 --- a/elpa/counsel-projectile-20190724.1903/counsel-projectile-autoloads.el +++ b/elpa/counsel-projectile-20211004.2003/counsel-projectile-autoloads.el @@ -1,13 +1,14 @@ -;;; counsel-projectile-autoloads.el --- automatically extracted autoloads -;; +;;; counsel-projectile-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- +;; Generated by the `loaddefs-generate' function. + +;; This file is part of GNU Emacs. + ;;; Code: -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) +(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) + -;;;### (autoloads nil "counsel-projectile" "counsel-projectile.el" -;;;;;; (0 0 0 0)) ;;; Generated autoloads from counsel-projectile.el (autoload 'counsel-projectile-find-file "counsel-projectile" "\ @@ -16,27 +17,28 @@ Jump to a file in the current project. With a prefix ARG, invalidate the cache first. If DWIM is non-nil, use completion based on context. -\(fn &optional ARG DWIM)" t nil) - +(fn &optional ARG DWIM)" t) (autoload 'counsel-projectile-find-file-dwim "counsel-projectile" "\ Jump to a file in the current project using completion based on context. With a prefix ARG, invalidate the cache first. -\(fn &optional ARG)" t nil) - +(fn &optional ARG)" t) (autoload 'counsel-projectile-find-dir "counsel-projectile" "\ Jump to a directory in the current project. With a prefix ARG, invalidate the cache first. -\(fn &optional ARG)" t nil) - +(fn &optional ARG)" t) (autoload 'counsel-projectile-switch-to-buffer "counsel-projectile" "\ Jump to a buffer in the current project. -\(fn)" t nil) +If `counsel-projectile-preview-buffers' is non-nil, display a +preview of the selected ivy completion candidate buffer as in +`counsel-switch-buffer', falling back to the current buffer or +optionally FROM-BUFFER. +(fn &optional FROM-BUFFER)" t) (autoload 'counsel-projectile-grep "counsel-projectile" "\ Search the current project with grep. @@ -46,37 +48,33 @@ use git grep. Otherwise use grep recursively. OPTIONS-OR-CMD, if non-nil, is a string containing either additional options to be passed to grep, or an alternative git grep command. It is read from the minibuffer if the function is -called with a prefix argument. - -\(fn &optional OPTIONS-OR-CMD)" t nil) +called with a `\\[universal-argument]' prefix argument. +(fn &optional OPTIONS-OR-CMD)" t) (autoload 'counsel-projectile-git-grep "counsel-projectile" "\ Search the current project with git grep. CMD, if non-nil, is a string containing an alternative git grep command. It is read from the minibuffer if the function is called -with a prefix argument. - -\(fn &optional CMD)" t nil) +with a `\\[universal-argument]' prefix argument. +(fn &optional CMD)" t) (autoload 'counsel-projectile-ag "counsel-projectile" "\ Search the current project with ag. OPTIONS, if non-nil, is a string containing additional options to be passed to ag. It is read from the minibuffer if the function -is called with a prefix argument. - -\(fn &optional OPTIONS)" t nil) +is called with a `\\[universal-argument]' prefix argument. +(fn &optional OPTIONS)" t) (autoload 'counsel-projectile-rg "counsel-projectile" "\ Search the current project with rg. OPTIONS, if non-nil, is a string containing additional options to be passed to rg. It is read from the minibuffer if the function -is called with a prefix argument. - -\(fn &optional OPTIONS)" t nil) +is called with a `\\[universal-argument]' prefix argument. +(fn &optional OPTIONS)" t) (autoload 'counsel-projectile-org-capture "counsel-projectile" "\ Capture into the current project. @@ -92,8 +90,7 @@ former variable in particular for details. Optional argument FROM-BUFFER specifies the buffer from which to capture. -\(fn &optional FROM-BUFFER)" t nil) - +(fn &optional FROM-BUFFER)" t) (autoload 'counsel-projectile-org-agenda "counsel-projectile" "\ Open project agenda. @@ -103,8 +100,7 @@ agenda files that do not belong to the current project. Optional arguments ARG, KEYS, and RESTRICTION are as in `org-agenda'. -\(fn &optional ARG KEYS RESTRICTION)" t nil) - +(fn &optional ARG KEYS RESTRICTION)" t) (autoload 'counsel-projectile-switch-project "counsel-projectile" "\ Switch project. @@ -112,17 +108,22 @@ Optional argument DEFAULT-ACTION is the key, function, name, or index in the list `counsel-projectile-switch-project-action' (1 for the first action, etc) of the action to set as default. -\(fn &optional DEFAULT-ACTION)" t nil) - +(fn &optional DEFAULT-ACTION)" t) (autoload 'counsel-projectile "counsel-projectile" "\ Jump to a buffer or file in the current project. With a prefix ARG, invalidate the cache first. -If not inside a project, call `counsel-projectile-switch-project'. +If `counsel-projectile-preview-buffers' is non-nil, display a +preview of the selected ivy completion candidate buffer as in +`counsel-switch-buffer', falling back to the current buffer or +optionally FROM-BUFFER. -\(fn &optional ARG)" t nil) +If `counsel-switch-buffer-preview-virtual-buffers' is also +non-nil, also display a preview of the selected ivy completion +candidate non-visited file. +(fn &optional ARG FROM-BUFFER)" t) (defvar counsel-projectile-mode nil "\ Non-nil if Counsel-Projectile mode is enabled. See the `counsel-projectile-mode' command @@ -130,9 +131,7 @@ for a description of this minor mode. Setting this variable directly does not take effect; either customize it (see the info node `Easy Customization') or call the function `counsel-projectile-mode'.") - (custom-autoload 'counsel-projectile-mode "counsel-projectile" nil) - (autoload 'counsel-projectile-mode "counsel-projectile" "\ Toggle Counsel-Projectile mode on or off. @@ -149,16 +148,19 @@ projectile commands to their counsel-projectile replacements or bind keys to counsel-projectile commands that have no projectile counterparts. -\(fn &optional ARG)" t nil) +(fn &optional ARG)" t) +(register-definition-prefixes "counsel-projectile" '("counsel-projectile-")) + +;;; End of scraped data -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "counsel-projectile" '("counsel-projectile-"))) +(provide 'counsel-projectile-autoloads) -;;;*** - ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 +;; no-native-compile: t +;; coding: utf-8-emacs-unix ;; End: + ;;; counsel-projectile-autoloads.el ends here diff --git a/elpa/counsel-projectile-20211004.2003/counsel-projectile-pkg.el b/elpa/counsel-projectile-20211004.2003/counsel-projectile-pkg.el new file mode 100644 index 00000000..9424e13a --- /dev/null +++ b/elpa/counsel-projectile-20211004.2003/counsel-projectile-pkg.el @@ -0,0 +1,15 @@ +(define-package "counsel-projectile" "20211004.2003" "Ivy integration for Projectile" + '((counsel "0.13.4") + (projectile "2.5.0")) + :commit "e30150792a96968f55f34638cbfe63eaa30839cc" :authors + '(("Eric Danan")) + :maintainers + '(("Eric Danan")) + :maintainer + '("Eric Danan") + :keywords + '("project" "convenience") + :url "https://github.com/ericdanan/counsel-projectile") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/counsel-projectile-20190724.1903/counsel-projectile.el b/elpa/counsel-projectile-20211004.2003/counsel-projectile.el similarity index 85% rename from elpa/counsel-projectile-20190724.1903/counsel-projectile.el rename to elpa/counsel-projectile-20211004.2003/counsel-projectile.el index e768fe5b..81b6b011 100644 --- a/elpa/counsel-projectile-20190724.1903/counsel-projectile.el +++ b/elpa/counsel-projectile-20211004.2003/counsel-projectile.el @@ -1,13 +1,12 @@ ;;; counsel-projectile.el --- Ivy integration for Projectile -*- lexical-binding: t -*- -;; Copyright (C) 2016-2019 Eric Danan +;; Copyright (C) 2016-2021 Eric Danan ;; Author: Eric Danan ;; URL: https://github.com/ericdanan/counsel-projectile -;; Package-Version: 20190724.1903 ;; Keywords: project, convenience -;; Version: 0.3.0 -;; Package-Requires: ((counsel "0.12.0") (projectile "2.0.0")) +;; Version: 0.3.2 +;; Package-Requires: ((counsel "0.13.4") (projectile "2.5.0")) ;; This file is NOT part of GNU Emacs. @@ -244,17 +243,6 @@ If anything goes wrong, throw an error and do not modify ACTION-VAR." (cdr action-list)))))) (set action-var action-list))) -;; Copy the function `string-trim-right' from emacs 26 here so as to -;; support emacs 25 (the function exists in emacs 25 but doesn't -;; accept the REGEXP optional argument). -(defsubst counsel-projectile--string-trim-right (string &optional regexp) - "Trim STRING of trailing string matching REGEXP. - -REGEXP defaults to \"[ \\t\\n\\r]+\"." - (if (string-match (concat "\\(?:" (or regexp "[ \t\n\r]+") "\\)\\'") string) - (replace-match "" t t string) - string)) - ;;* counsel-projectile-find-file (defcustom counsel-projectile-sort-files nil @@ -295,6 +283,13 @@ It is also possible to use a custom matcher. It must be a function taking two a (function :tag "Custom function")) :group 'counsel-projectile) +(defcustom counsel-projectile-find-file-more-chars 0 + "Number of characters to input before matching project files are shown. + +Setting it to a strictly positive value can improve performance in large projects." + :type 'integer + :group 'counsel-projectile) + (counsel-projectile--defcustom-action 'counsel-projectile-find-file '(1 @@ -314,6 +309,12 @@ It is also possible to use a custom matcher. It must be a function taking two a "switch project")) 'counsel-projectile) +(defun counsel-projectile--find-file-matcher (regexp candidates) + (let ((ivy-more-chars-alist + `((t . ,counsel-projectile-find-file-more-chars)))) + (or (ivy-more-chars) + (funcall counsel-projectile-find-file-matcher regexp candidates)))) + (defun counsel-projectile-find-file-matcher-basename (regexp candidates) "Return the list of CANDIDATES whose basename matches REGEXP, or if there is none the list of all CANDIDATES matching REGEXP. @@ -405,15 +406,14 @@ non-nil, use completion based on context." (files (and dwim (projectile-select-files project-files)))) (ivy-read (projectile-prepend-project-name "Find file: ") (or files project-files) - :matcher counsel-projectile-find-file-matcher + :matcher #'counsel-projectile--find-file-matcher :require-match t :sort counsel-projectile-sort-files :action counsel-projectile-find-file-action :caller 'counsel-projectile-find-file)))) -(ivy-set-display-transformer - 'counsel-projectile-find-file - 'counsel-projectile-find-file-transformer) +(ivy-configure 'counsel-projectile-find-file + :display-transformer-fn #'counsel-projectile-find-file-transformer) ;;;###autoload (defun counsel-projectile-find-file-dwim (&optional arg) @@ -503,9 +503,8 @@ With a prefix ARG, invalidate the cache first." :action counsel-projectile-find-dir-action :caller 'counsel-projectile-find-dir))) -(ivy-set-display-transformer - 'counsel-projectile-find-dir - 'counsel-projectile-find-dir-transformer) +(ivy-configure 'counsel-projectile-find-dir + :display-transformer-fn #'counsel-projectile-find-dir-transformer) ;;* counsel-projectile-switch-to-buffer @@ -526,6 +525,17 @@ candidates list of `counsel-projectile-switch-to-buffer' and :type 'boolean :group 'counsel-projectile) +(defcustom counsel-projectile-preview-buffers nil + "When non-nil, `counsel-projectile-switch-to-buffer' and `counsel-projectile' +display a preview of the selected buffer in the current window. + +This makes these commands behave similarly to `counsel-switch-buffer'. If +`counsel-switch-buffer-preview-virtual-buffers' is also non-nil, +`counsel-projectile' also displays a preview of the selected +non-visited file." + :type 'boolean + :group 'counsel-projectile) + (counsel-projectile--defcustom-action 'counsel-projectile-switch-to-buffer '(1 @@ -584,12 +594,52 @@ names as in `ivy--buffer-list', and remove current buffer if "Transform candidate STR when switching project buffers. This simply applies the same transformer as in `ivy-switch-buffer', which is `ivy-switch-buffer-transformer' by default but could have been modified e.g. by the ivy-rich package." - (funcall (plist-get ivy--display-transformers-list 'ivy-switch-buffer) + (funcall (ivy-alist-setting ivy--display-transformers-alist 'ivy-switch-buffer) str)) +(defun counsel-projectile--switch-to-buffer-update-fn () + "Update function for `counsel-projectile--switch-to-buffer'." + ;; Adapted from counsel--switch-buffer-update-fn. + (unless counsel--switch-buffer-previous-buffers + (setq counsel--switch-buffer-previous-buffers (buffer-list))) + (when counsel-projectile-preview-buffers + (when (member (ivy-state-current ivy-last) ivy-marked-candidates) + (setf (ivy-state-current ivy-last) + (substring (ivy-state-current ivy-last) (length ivy-mark-prefix)))) + ;; Unlike in `counsel-switch-buffer' we could have an empty string + ;; as candidate if no project buffer is open. + (cond + ((and (not (string= (ivy-state-current ivy-last) "")) + (get-buffer (ivy-state-current ivy-last))) + (let ((ivy-marked-candidates nil)) + (ivy-call))) + ;; Following case if for use in `counsel-projectile'. + ((and (not (string= (ivy-state-current ivy-last) "")) + counsel-switch-buffer-preview-virtual-buffers + (file-exists-p (projectile-expand-root (ivy-state-current ivy-last)))) + (let ((buf (ignore-errors + ;; may not open due to `large-file-warning-threshold' etc. + (find-file-noselect (projectile-expand-root (ivy-state-current ivy-last)))))) + (if buf + (progn + (push buf counsel--switch-buffer-temporary-buffers) + (ivy-call)) + ;; clean up the minibuffer so that there's no delay before + ;; the Ivy candidates are displayed once again + (message "")))) + (t + (with-ivy-window + (switch-to-buffer (or (plist-get (ivy-state-extra-props ivy-last) :from-buffer) + (ivy-state-buffer ivy-last)))))))) + ;;;###autoload -(defun counsel-projectile-switch-to-buffer () - "Jump to a buffer in the current project." +(defun counsel-projectile-switch-to-buffer (&optional from-buffer) + "Jump to a buffer in the current project. + +If `counsel-projectile-preview-buffers' is non-nil, display a +preview of the selected ivy completion candidate buffer as in +`counsel-switch-buffer', falling back to the current buffer or +optionally FROM-BUFFER." (interactive) (if (and (eq projectile-require-project-root 'prompt) (not (projectile-project-p))) @@ -604,11 +654,13 @@ This simply applies the same transformer as in `ivy-switch-buffer', which is `iv :sort counsel-projectile-sort-buffers :action counsel-projectile-switch-to-buffer-action :keymap counsel-projectile-switch-to-buffer-map + :extra-props (list :from-buffer from-buffer) :caller 'counsel-projectile-switch-to-buffer))) -(ivy-set-display-transformer - 'counsel-projectile-switch-to-buffer - 'counsel-projectile-switch-to-buffer-transformer) +(ivy-configure 'counsel-projectile-switch-to-buffer + :display-transformer-fn #'counsel-projectile-switch-to-buffer-transformer + :update-fn #'counsel-projectile--switch-to-buffer-update-fn + :unwind-fn #'counsel--switch-buffer-unwind) ;;* counsel-projectile-grep @@ -649,21 +701,10 @@ of `(ivy-thing-at-point)' by hitting \"M-n\" in the minibuffer." (string :tag " name"))) :group 'counsel-projectile) -(defvar counsel-projectile-grep-base-command "grep -rnEI %s -- %%s %s" +(defvar counsel-projectile-grep-base-command "grep -rnEI %s" "Format string to use in `cousel-projectile-grep' to construct the command.") -(defvar counsel-projectile-grep-command nil) - -(defun counsel-projectile-grep-function (string) - "Grep for STRING in the current project." - (or (ivy-more-chars) - (let ((default-directory (ivy-state-directory ivy-last)) - (regex (counsel--grep-regex string))) - (counsel--async-command (format counsel-projectile-grep-command - (shell-quote-argument regex))) - nil))) - (defun counsel-projectile-grep-action-switch-project (&optional _) "Switch project action for `counsel-projectile-grep'." (counsel-projectile-switch-project 'counsel-projectile-switch-project-action-grep)) @@ -672,18 +713,6 @@ construct the command.") "Switch project action for `counsel-projectile-git-grep'." (counsel-projectile-switch-project 'counsel-projectile-switch-project-action-git-grep)) -(defun counsel-projectile-grep-transformer (str) - "Higlight file and line number in STR, first removing the -\"./\" prefix from the filename." - ;; This makes the display consistent with `counsel-git-grep' and - ;; `counsel-ag'-like commands. - (counsel-git-grep-transformer (string-remove-prefix "./" str))) - -(defun counsel-projectile-grep-occur () - "Generate a custom occur buffer for `counsel-projectile-grep'." - (counsel-grep-like-occur - counsel-projectile-grep-command)) - ;;;###autoload (defun counsel-projectile-grep (&optional options-or-cmd) "Search the current project with grep. @@ -694,7 +723,7 @@ use git grep. Otherwise use grep recursively. OPTIONS-OR-CMD, if non-nil, is a string containing either additional options to be passed to grep, or an alternative git grep command. It is read from the minibuffer if the function is -called with a prefix argument." +called with a `\\[universal-argument]' prefix argument." (interactive) (if (and (eq projectile-require-project-root 'prompt) (not (projectile-project-p))) @@ -702,45 +731,47 @@ called with a prefix argument." (if (and (eq (projectile-project-vcs) 'git) projectile-use-git-grep) (counsel-projectile-git-grep options-or-cmd) - (let* ((path - (mapconcat 'shell-quote-argument - (projectile-normalise-paths - (car (projectile-parse-dirconfig-file))) - " ")) - (ignored-files + (let* ((ignored-files (mapconcat (lambda (i) (concat "--exclude=" (shell-quote-argument i))) - (append + (append (projectile--globally-ignored-file-suffixes-glob) (projectile-ignored-files-rel)) - " ")) + " ")) (ignored-dirs (mapconcat (lambda (i) (concat "--exclude-dir=" (shell-quote-argument i))) - (projectile-ignored-directories-rel) - " ")) + (projectile-ignored-directories-rel) + " ")) (ignored (concat ignored-files " " ignored-dirs)) - (default-directory (projectile-project-root))) - (counsel-require-program - (car (split-string counsel-projectile-grep-base-command))) - (setq counsel-projectile-grep-command - (format counsel-projectile-grep-base-command ignored path)) - (ivy-read (projectile-prepend-project-name "grep: ") - #'counsel-projectile-grep-function - :initial-input (eval counsel-projectile-grep-initial-input) - :dynamic-collection t - :keymap counsel-ag-map - :history 'counsel-git-grep-history - :action counsel-projectile-grep-action - :unwind (lambda () - (counsel-delete-process) - (swiper--cleanup)) - :caller 'counsel-projectile-grep))))) - -(cl-pushnew 'counsel-projectile-grep ivy-highlight-grep-commands) -(counsel-set-async-exit-code 'counsel-projectile-grep 1 "No matches found") -(ivy-set-occur 'counsel-projectile-grep 'counsel-projectile-grep-occur) -(ivy-set-display-transformer 'counsel-projectile-grep 'counsel-projectile-grep-transformer) + (counsel-ag-base-command + (let ((counsel-ag-command counsel-projectile-grep-base-command)) + (counsel--format-ag-command ignored "%s")))) + ;; `counsel-ag' requires a single `\\[universal-argument]' + ;; prefix argument to prompt for initial directory and a double + ;; `\\[universal-argument]' prefix argument to prompt for extra + ;; options. But since the initial directory is always the + ;; project root here, prompt for ortpions with a single + ;; `\\[universal-argument]' prefix argument prefix argument as + ;; well. + (when (= (prefix-numeric-value current-prefix-arg) 4) + (setq current-prefix-arg '(16))) + (counsel-ag (eval counsel-projectile-grep-initial-input) + (projectile-project-root) + options-or-cmd + (projectile-prepend-project-name + (concat (car (if (listp counsel-ag-base-command) + counsel-ag-base-command + (split-string counsel-ag-base-command))) + ": ")) + :caller 'counsel-projectile-grep))))) + +(ivy-configure 'counsel-projectile-grep + :occur #'counsel-ag-occur + :unwind-fn #'counsel--grep-unwind + :display-transformer-fn #'counsel-git-grep-transformer + :grep-p t + :exit-codes '(1 "No matches found")) ;;;###autoload (defun counsel-projectile-git-grep (&optional cmd) @@ -748,25 +779,18 @@ called with a prefix argument." CMD, if non-nil, is a string containing an alternative git grep command. It is read from the minibuffer if the function is called -with a prefix argument." +with a `\\[universal-argument]' prefix argument." (interactive) (if (and (eq projectile-require-project-root 'prompt) (not (projectile-project-p))) (counsel-projectile-git-grep-action-switch-project) - (let* ((ivy--actions-list (copy-sequence ivy--actions-list)) - (path - (mapconcat 'shell-quote-argument - (projectile-normalise-paths - (car (projectile-parse-dirconfig-file))) - " ")) - (counsel-git-grep-cmd-default - (concat (counsel-projectile--string-trim-right counsel-git-grep-cmd-default " \\.") - " " path))) + (let ((ivy--actions-list (copy-sequence ivy--actions-list))) (ivy-add-actions 'counsel-git-grep counsel-projectile-git-grep-extra-actions) - (counsel-git-grep (or current-prefix-arg cmd) - (eval counsel-projectile-grep-initial-input))))) + (counsel-git-grep (eval counsel-projectile-grep-initial-input) + (projectile-project-root) + (or current-prefix-arg cmd))))) ;;* counsel-projectile-ag @@ -808,16 +832,12 @@ of `(ivy-thing-at-point)' by hitting \"M-n\" in the minibuffer." OPTIONS, if non-nil, is a string containing additional options to be passed to ag. It is read from the minibuffer if the function -is called with a prefix argument." +is called with a `\\[universal-argument]' prefix argument." (interactive) (if (and (eq projectile-require-project-root 'prompt) (not (projectile-project-p))) (counsel-projectile-ag-action-switch-project) (let* ((ivy--actions-list (copy-sequence ivy--actions-list)) - (path (mapconcat 'shell-quote-argument - (projectile-normalise-paths - (car (projectile-parse-dirconfig-file))) - " ")) (ignored (mapconcat (lambda (i) (concat "--ignore " (shell-quote-argument i))) @@ -827,16 +847,28 @@ is called with a prefix argument." (projectile-ignored-directories-rel)) " ")) (counsel-ag-base-command - (format (counsel-projectile--string-trim-right counsel-ag-base-command " \\.") - (concat ignored " %s " path)))) + (let ((counsel-ag-command counsel-ag-base-command)) + (counsel--format-ag-command ignored "%s")))) (ivy-add-actions 'counsel-ag counsel-projectile-ag-extra-actions) + ;; `counsel-ag' requires a single `\\[universal-argument]' + ;; prefix argument to prompt for initial directory and a double + ;; `\\[universal-argument]' prefix argument to prompt for extra + ;; options. But since the initial directory is always the + ;; project root here, prompt for ortpions with a single + ;; `\\[universal-argument]' prefix argument prefix argument as + ;; well. + (when (= (prefix-numeric-value current-prefix-arg) 4) + (setq current-prefix-arg '(16))) (counsel-ag (eval counsel-projectile-ag-initial-input) (projectile-project-root) options (projectile-prepend-project-name - (concat (car (split-string counsel-ag-base-command)) ": ")))))) + (concat (car (if (listp counsel-ag-base-command) + counsel-ag-base-command + (split-string counsel-ag-base-command))) + ": ")))))) ;;* counsel-projectile-rg @@ -878,18 +910,12 @@ of `(ivy-thing-at-point)' by hitting \"M-n\" in the minibuffer." OPTIONS, if non-nil, is a string containing additional options to be passed to rg. It is read from the minibuffer if the function -is called with a prefix argument." +is called with a `\\[universal-argument]' prefix argument." (interactive) (if (and (eq projectile-require-project-root 'prompt) (not (projectile-project-p))) (counsel-projectile-rg-action-switch-project) (let* ((ivy--actions-list (copy-sequence ivy--actions-list)) - (path - (mapconcat 'shell-quote-argument - (or (projectile-normalise-paths - (car (projectile-parse-dirconfig-file))) - '(".")) - " ")) (ignored (mapconcat (lambda (i) (concat "--glob !" (shell-quote-argument i))) @@ -897,18 +923,30 @@ is called with a prefix argument." (projectile--globally-ignored-file-suffixes-glob) (projectile-ignored-files-rel) (projectile-ignored-directories-rel)) - " ")) + " ")) (counsel-rg-base-command - (format (counsel-projectile--string-trim-right counsel-rg-base-command " \\.") - (concat ignored " %s " path)))) + (let ((counsel-ag-command counsel-rg-base-command)) + (counsel--format-ag-command ignored "%s")))) (ivy-add-actions - 'counsel-ag + 'counsel-rg counsel-projectile-rg-extra-actions) + ;; `counsel-rg' requires a single `\\[universal-argument]' + ;; prefix argument to prompt for initial directory and a double + ;; `\\[universal-argument]' prefix argument to prompt for extra + ;; options. But since the initial directory is always the + ;; project root here, prompt for ortpions with a single + ;; `\\[universal-argument]' prefix argument prefix argument as + ;; well. + (when (= (prefix-numeric-value current-prefix-arg) 4) + (setq current-prefix-arg '(16))) (counsel-rg (eval counsel-projectile-rg-initial-input) (projectile-project-root) options (projectile-prepend-project-name - (concat (car (split-string counsel-rg-base-command)) ": ")))))) + (concat (car (if (listp counsel-rg-base-command) + counsel-rg-base-command + (split-string counsel-rg-base-command))) + ": ")))))) ;;* counsel-projectile-org-capture @@ -1060,6 +1098,11 @@ The format is the same as in `org-capture-templates-contexts'." (string :tag " name"))) :group 'counsel-projectile) +(defcustom counsel-projectile-org-capture-templates-first-p t + "Non-nil if `counsel-projectile-org-capture' should display templates from `counsel-projectile-org-capture-templates' before those from `org-capture-templates'." + :type 'boolean + :group 'counsel-projectile) + (defvar counsel-projectile--org-capture-templates-backup nil "Stores a backup of `org-capture-templates'.") @@ -1095,6 +1138,8 @@ capture." org-capture-templates-contexts)) (org-capture-templates (append + (unless counsel-projectile-org-capture-templates-first-p + org-capture-templates) (when root (cl-loop with replace-fun = `(lambda (string) @@ -1119,7 +1164,8 @@ capture." collect x) else collect item))) - org-capture-templates))) + (when counsel-projectile-org-capture-templates-first-p + org-capture-templates)))) (ivy-add-actions 'counsel-org-capture counsel-projectile-org-capture-extra-actions) @@ -1149,7 +1195,7 @@ Optional arguments ARG, KEYS, and RESTRICTION are as in (let* ((root (projectile-project-root)) (org-agenda-files (cl-remove-if-not (lambda (file) - (string-prefix-p root file)) + (string-prefix-p root (expand-file-name file))) (org-agenda-files t 'ifmode)))) (org-agenda arg keys restriction)))) @@ -1214,6 +1260,8 @@ candidates list of `counsel-projectile-switch-project'." "invoke eshell from project root") ("xt" counsel-projectile-switch-project-action-run-term "invoke term from project root") + ("xv" counsel-projectile-switch-project-action-run-vterm + "invoke vterm from project root") ("Oc" counsel-projectile-switch-project-action-org-capture "capture into project") ("Oa" counsel-projectile-switch-project-action-org-agenda @@ -1249,9 +1297,10 @@ action." (defun counsel-projectile-switch-project-action (project) "Jump to a file or buffer in PROJECT." - (let ((projectile-switch-project-action - (lambda () - (counsel-projectile ivy-current-prefix-arg)))) + (let* ((from-buffer (ivy-state-buffer ivy-last)) + (projectile-switch-project-action + `(lambda () + (counsel-projectile ivy-current-prefix-arg ,from-buffer)))) (counsel-projectile-switch-project-by-name project))) (defun counsel-projectile-switch-project-action-find-file (project) @@ -1282,7 +1331,10 @@ action." (defun counsel-projectile-switch-project-action-switch-to-buffer (project) "Jump to a buffer in PROJECT." - (let ((projectile-switch-project-action 'counsel-projectile-switch-to-buffer)) + (let* ((from-buffer (ivy-state-buffer ivy-last)) + (projectile-switch-project-action + `(lambda () + (counsel-projectile-switch-to-buffer ,from-buffer)))) (counsel-projectile-switch-project-by-name project))) (defun counsel-projectile-switch-project-action-save-all-buffers (project) @@ -1328,46 +1380,70 @@ action." (defun counsel-projectile-switch-project-action-run-shell (project) "Invoke `shell' from PROJECT's root." - (let ((projectile-switch-project-action 'projectile-run-shell)) + (let ((projectile-switch-project-action + (lambda () + (projectile-run-shell ivy-current-prefix-arg)))) (counsel-projectile-switch-project-by-name project))) (defun counsel-projectile-switch-project-action-run-eshell (project) "Invoke `eshell' from PROJECT's root." - (let ((projectile-switch-project-action 'projectile-run-eshell)) + (let ((projectile-switch-project-action + (lambda () + (projectile-run-eshell ivy-current-prefix-arg)))) (counsel-projectile-switch-project-by-name project))) (defun counsel-projectile-switch-project-action-run-term (project) "Invoke `term' from PROJECT's root." (let ((projectile-switch-project-action (lambda () - (projectile-run-term nil)))) + (projectile-run-term ivy-current-prefix-arg)))) + (counsel-projectile-switch-project-by-name project))) + +(defun counsel-projectile-switch-project-action-run-vterm (project) + "Invoke `vterm' from PROJECT's root." + (let ((projectile-switch-project-action + (lambda () + (projectile-run-vterm ivy-current-prefix-arg)))) (counsel-projectile-switch-project-by-name project))) (defun counsel-projectile-switch-project-action-grep (project) "Search PROJECT with grep." - (let ((projectile-switch-project-action 'counsel-projectile-grep)) + (let ((projectile-switch-project-action + (lambda () + (setq current-prefix-arg ivy-current-prefix-arg) + (counsel-projectile-grep)))) (counsel-projectile-switch-project-by-name project))) (defun counsel-projectile-switch-project-action-git-grep (project) "Search PROJECT with git grep." - (let ((projectile-switch-project-action 'counsel-projectile-git-grep)) + (let ((projectile-switch-project-action + (lambda () + (setq current-prefix-arg ivy-current-prefix-arg) + (counsel-projectile-git-grep)))) (counsel-projectile-switch-project-by-name project))) (defun counsel-projectile-switch-project-action-ag (project) "Search PROJECT with ag." - (let ((projectile-switch-project-action 'counsel-projectile-ag)) + (let ((projectile-switch-project-action + (lambda () + (setq current-prefix-arg ivy-current-prefix-arg) + (counsel-projectile-ag)))) (counsel-projectile-switch-project-by-name project))) (defun counsel-projectile-switch-project-action-rg (project) "Search PROJECT with rg." - (let ((projectile-switch-project-action 'counsel-projectile-rg)) + (let ((projectile-switch-project-action + (lambda () + (setq current-prefix-arg ivy-current-prefix-arg) + (counsel-projectile-rg)))) (counsel-projectile-switch-project-by-name project))) (defun counsel-projectile-switch-project-action-org-capture (project) "Capture into PROJECT." (let* ((from-buffer (ivy-state-buffer ivy-last)) - (projectile-switch-project-action `(lambda () - (counsel-projectile-org-capture ,from-buffer)))) + (projectile-switch-project-action + `(lambda () + (counsel-projectile-org-capture ,from-buffer)))) (counsel-projectile-switch-project-by-name project))) (defun counsel-projectile-switch-project-action-org-agenda (project) @@ -1481,7 +1557,7 @@ Relies on `ivy--switch-buffer-matcher' for buffers and the matcher specified in `counsel-projectile-find-file-matcher' for files." (append (ivy--switch-buffer-matcher regexp counsel-projectile--buffers) - (funcall counsel-projectile-find-file-matcher regexp counsel-projectile--non-visited-files))) + (counsel-projectile--find-file-matcher regexp counsel-projectile--non-visited-files))) (defun counsel-projectile-action (name) "Switch to buffer or find file named NAME." @@ -1531,12 +1607,19 @@ directory of file named NAME." (propertize str 'face 'ivy-virtual))) ;;;###autoload -(defun counsel-projectile (&optional arg) +(defun counsel-projectile (&optional arg from-buffer) "Jump to a buffer or file in the current project. With a prefix ARG, invalidate the cache first. -If not inside a project, call `counsel-projectile-switch-project'." +If `counsel-projectile-preview-buffers' is non-nil, display a +preview of the selected ivy completion candidate buffer as in +`counsel-switch-buffer', falling back to the current buffer or +optionally FROM-BUFFER. + +If `counsel-switch-buffer-preview-virtual-buffers' is also +non-nil, also display a preview of the selected ivy completion +candidate non-visited file." (interactive "P") (if (and (eq projectile-require-project-root 'prompt) (not (projectile-project-p))) @@ -1551,11 +1634,13 @@ If not inside a project, call `counsel-projectile-switch-project'." :require-match t :action counsel-projectile-action :keymap counsel-projectile-map + :extra-props (list :from-buffer from-buffer) :caller 'counsel-projectile))) -(ivy-set-display-transformer - 'counsel-projectile - 'counsel-projectile-transformer) +(ivy-configure 'counsel-projectile +:display-transformer-fn #'counsel-projectile-transformer + :update-fn #'counsel-projectile--switch-to-buffer-update-fn + :unwind-fn #'counsel--switch-buffer-unwind) ;;* counsel-projectile-mode diff --git a/elpa/ivy-20210930.1450/colir.el b/elpa/ivy-20230714.751/colir.el similarity index 98% rename from elpa/ivy-20210930.1450/colir.el rename to elpa/ivy-20230714.751/colir.el index 09b4f5cf..0f4ed1cc 100644 --- a/elpa/ivy-20210930.1450/colir.el +++ b/elpa/ivy-20230714.751/colir.el @@ -1,6 +1,6 @@ ;;; colir.el --- Color blending library -*- lexical-binding: t -*- -;; Copyright (C) 2015-2021 Free Software Foundation, Inc. +;; Copyright (C) 2015-2023 Free Software Foundation, Inc. ;; Author: Oleh Krehel diff --git a/elpa/ivy-20210930.1450/dir b/elpa/ivy-20230714.751/dir similarity index 100% rename from elpa/ivy-20210930.1450/dir rename to elpa/ivy-20230714.751/dir diff --git a/elpa/ivy-20210930.1450/elpa.el b/elpa/ivy-20230714.751/elpa.el similarity index 100% rename from elpa/ivy-20210930.1450/elpa.el rename to elpa/ivy-20230714.751/elpa.el diff --git a/elpa/ivy-20210930.1450/ivy-autoloads.el b/elpa/ivy-20230714.751/ivy-autoloads.el similarity index 75% rename from elpa/ivy-20210930.1450/ivy-autoloads.el rename to elpa/ivy-20230714.751/ivy-autoloads.el index 02ec7e57..3c23564b 100644 --- a/elpa/ivy-20210930.1450/ivy-autoloads.el +++ b/elpa/ivy-20230714.751/ivy-autoloads.el @@ -1,19 +1,19 @@ -;;; ivy-autoloads.el --- automatically extracted autoloads -;; +;;; ivy-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- +;; Generated by the `loaddefs-generate' function. + +;; This file is part of GNU Emacs. + ;;; Code: -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) +(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) + -;;;### (autoloads nil "colir" "colir.el" (0 0 0 0)) ;;; Generated autoloads from colir.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "colir" '("colir-"))) +(register-definition-prefixes "colir" '("colir-")) -;;;*** -;;;### (autoloads nil "ivy" "ivy.el" (0 0 0 0)) ;;; Generated autoloads from ivy.el (autoload 'ivy-resume "ivy" "\ @@ -21,8 +21,7 @@ Resume the last completion session, or SESSION if non-nil. With a prefix arg, try to restore a recorded completion session, if one exists. -\(fn &optional SESSION)" t nil) - +(fn &optional SESSION)" t) (autoload 'ivy-read "ivy" "\ Read a string in the minibuffer, with completion. @@ -36,7 +35,7 @@ PREDICATE is applied to filter out the COLLECTION immediately. This argument is for compatibility with `completing-read'. When REQUIRE-MATCH is non-nil, only members of COLLECTION can be -selected. +selected. In can also be a lambda. If INITIAL-INPUT is non-nil, then insert that input in the minibuffer initially. @@ -89,8 +88,7 @@ CALLER is a symbol to uniquely identify the caller to `ivy-read'. It is used, along with COLLECTION, to determine which customizations apply to the current completion session. -\(fn PROMPT COLLECTION &key PREDICATE REQUIRE-MATCH INITIAL-INPUT HISTORY PRESELECT DEF KEYMAP UPDATE-FN SORT ACTION MULTI-ACTION UNWIND RE-BUILDER MATCHER DYNAMIC-COLLECTION EXTRA-PROPS CALLER)" nil nil) - +(fn PROMPT COLLECTION &key PREDICATE REQUIRE-MATCH INITIAL-INPUT HISTORY PRESELECT DEF KEYMAP UPDATE-FN SORT ACTION MULTI-ACTION UNWIND RE-BUILDER MATCHER DYNAMIC-COLLECTION EXTRA-PROPS CALLER)") (autoload 'ivy-completing-read "ivy" "\ Read a string in the minibuffer, with completion. @@ -106,18 +104,15 @@ HISTORY is a list of previously selected inputs. DEF is the default value. INHERIT-INPUT-METHOD is currently ignored. -\(fn PROMPT COLLECTION &optional PREDICATE REQUIRE-MATCH INITIAL-INPUT HISTORY DEF INHERIT-INPUT-METHOD)" nil nil) - +(fn PROMPT COLLECTION &optional PREDICATE REQUIRE-MATCH INITIAL-INPUT HISTORY DEF INHERIT-INPUT-METHOD)") (defvar ivy-mode nil "\ -Non-nil if Ivy mode is enabled. +Non-nil if ivy mode is enabled. See the `ivy-mode' command for a description of this minor mode. Setting this variable directly does not take effect; either customize it (see the info node `Easy Customization') or call the function `ivy-mode'.") - (custom-autoload 'ivy-mode "ivy" nil) - (autoload 'ivy-mode "ivy" "\ Toggle Ivy mode on or off. Turn Ivy mode on if ARG is positive, off otherwise. @@ -130,37 +125,30 @@ Global bindings: Minibuffer bindings: \\{ivy-minibuffer-map} -\(fn &optional ARG)" t nil) - +(fn &optional ARG)" t) (autoload 'ivy-switch-buffer "ivy" "\ -Switch to another buffer." t nil) - +Switch to another buffer." t) (autoload 'ivy-switch-view "ivy" "\ -Switch to one of the window views stored by `ivy-push-view'." t nil) - +Switch to one of the window views stored by `ivy-push-view'." t) (autoload 'ivy-switch-buffer-other-window "ivy" "\ -Switch to another buffer in another window." t nil) - -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ivy" '("ivy-" "with-ivy-window"))) +Switch to another buffer in another window." t) +(register-definition-prefixes "ivy" '("ivy-" "with-ivy-window")) -;;;*** -;;;### (autoloads nil "ivy-overlay" "ivy-overlay.el" (0 0 0 0)) ;;; Generated autoloads from ivy-overlay.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ivy-overlay" '("ivy-"))) - -;;;*** +(register-definition-prefixes "ivy-overlay" '("ivy-")) -;;;### (autoloads nil nil ("elpa.el" "ivy-faces.el" "ivy-pkg.el") -;;;;;; (0 0 0 0)) +;;; End of scraped data + +(provide 'ivy-autoloads) -;;;*** - ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 +;; no-native-compile: t +;; coding: utf-8-emacs-unix ;; End: + ;;; ivy-autoloads.el ends here diff --git a/elpa/ivy-20210930.1450/ivy-faces.el b/elpa/ivy-20230714.751/ivy-faces.el similarity index 98% rename from elpa/ivy-20210930.1450/ivy-faces.el rename to elpa/ivy-20230714.751/ivy-faces.el index bedb9cb1..beaea3b9 100644 --- a/elpa/ivy-20210930.1450/ivy-faces.el +++ b/elpa/ivy-20230714.751/ivy-faces.el @@ -1,6 +1,6 @@ ;;; ivy-faces.el --- Faces for Ivy -*- lexical-binding: t -*- -;; Copyright (C) 2020-2021 Free Software Foundation, Inc. +;; Copyright (C) 2020-2023 Free Software Foundation, Inc. ;; Author: Oleh Krehel ;; Keywords: convenience diff --git a/elpa/ivy-20210930.1450/ivy-help.org b/elpa/ivy-20230714.751/ivy-help.org similarity index 100% rename from elpa/ivy-20210930.1450/ivy-help.org rename to elpa/ivy-20230714.751/ivy-help.org diff --git a/elpa/ivy-20210930.1450/ivy-overlay.el b/elpa/ivy-20230714.751/ivy-overlay.el similarity index 70% rename from elpa/ivy-20210930.1450/ivy-overlay.el rename to elpa/ivy-20230714.751/ivy-overlay.el index f5373584..4af52b39 100644 --- a/elpa/ivy-20210930.1450/ivy-overlay.el +++ b/elpa/ivy-20230714.751/ivy-overlay.el @@ -1,6 +1,6 @@ ;;; ivy-overlay.el --- Overlay display functions for Ivy -*- lexical-binding: t -*- -;; Copyright (C) 2016-2021 Free Software Foundation, Inc. +;; Copyright (C) 2016-2023 Free Software Foundation, Inc. ;; Author: Oleh Krehel ;; Keywords: convenience @@ -27,6 +27,7 @@ ;;; Code: (eval-when-compile + (require 'cl-lib) (require 'subr-x)) (defface ivy-cursor @@ -97,15 +98,51 @@ Then attach the overlay to the character before point." (declare-function ivy-state-current "ivy") (declare-function ivy-state-window "ivy") +(defun ivy-overlay--current-column () + "Return `current-column', ignoring `ivy-overlay-at'. +Temporarily make `ivy-overlay-at' invisible so that the +`string-width' of its `display' property is not included in the +`current-column' calculation by Emacs >= 29. +See URL `https://bugs.gnu.org/53795'." + (if (overlayp ivy-overlay-at) + (cl-letf (((overlay-get ivy-overlay-at 'invisible) t)) + (1+ (current-column))) + (current-column))) + (defun ivy-overlay-impossible-p (_str) (or (and (eq major-mode 'org-mode) - (plist-get (text-properties-at (point)) 'src-block)) + ;; If this breaks, an alternative is to call the canonical function + ;; `org-in-src-block-p', which is slower. Neither approach works + ;; in Org versions that shipped with Emacs < 26, however. + (get-text-property (point) 'src-block)) (<= (window-height) (+ ivy-height 2)) - (= (point) (point-min)) - (< (- (+ (window-width) (window-hscroll)) (current-column)) + (bobp) + (< (- (+ (window-width) (window-hscroll)) + (ivy-overlay--current-column)) 30))) +(defun ivy-overlay--org-indent () + "Return `ivy-overlay-at' indentation due to `org-indent-mode'. +That is, the additional number of columns needed under the mode." + ;; Emacs 28 includes the following fix for `https://bugs.gnu.org/49695': + ;; + ;; "Fix display of line/wrap-prefix when there's a display property at BOL" + ;; 662f91a795 2021-07-22 21:23:48 +0300 + ;; `https://git.sv.gnu.org/cgit/emacs.git/commit/?id=662f91a795' + ;; + ;; This increasingly misindents `ivy-overlay-at' with each additional Org + ;; level. See also `https://github.com/abo-abo/swiper/commit/ee7f7f8c79'. + ;; FIXME: Is there a better way to work around this? + (if (and (eq major-mode 'org-mode) + (bound-and-true-p org-indent-mode) + (< emacs-major-version 28)) + (let ((level (org-current-level))) + (if (org-at-heading-p) + (1- level) + (* org-indent-indentation-per-level (or level 1)))) + 0)) + (defun ivy-display-function-overlay (str) "Called from the minibuffer, display STR in an overlay in Ivy window. Hide the minibuffer contents and cursor." @@ -134,17 +171,11 @@ Hide the minibuffer contents and cursor." (list "\n" (ivy-left-pad (string-remove-prefix "\n" str) - (+ - (if (and (eq major-mode 'org-mode) - (bound-and-true-p org-indent-mode)) - (if (org-at-heading-p) - (1- (org-current-level)) - (* org-indent-indentation-per-level (or (org-current-level) 1))) - 0) - (save-excursion - (when ivy-completion-beg - (goto-char ivy-completion-beg)) - (current-column))))))))) + (+ (ivy-overlay--org-indent) + (save-excursion + (when ivy-completion-beg + (goto-char ivy-completion-beg)) + (ivy-overlay--current-column))))))))) (let ((cursor-offset (1+ (length ivy-text)))) (add-face-text-property cursor-offset (1+ cursor-offset) 'ivy-cursor t overlay-str)) diff --git a/elpa/ivy-20210930.1450/ivy-pkg.el b/elpa/ivy-20230714.751/ivy-pkg.el similarity index 55% rename from elpa/ivy-20210930.1450/ivy-pkg.el rename to elpa/ivy-20230714.751/ivy-pkg.el index f0e16c18..7838c56e 100644 --- a/elpa/ivy-20210930.1450/ivy-pkg.el +++ b/elpa/ivy-20230714.751/ivy-pkg.el @@ -1,6 +1,8 @@ -(define-package "ivy" "20210930.1450" "Incremental Vertical completYon" +(define-package "ivy" "20230714.751" "Incremental Vertical completYon" '((emacs "24.5")) - :commit "1c6b3da377a840e898b14020133f59fca9ceea1c" :authors + :commit "9d630d800e856a2c984c5a62a6f0ad313a9d2228" :authors + '(("Oleh Krehel" . "ohwoeowho@gmail.com")) + :maintainers '(("Oleh Krehel" . "ohwoeowho@gmail.com")) :maintainer '("Oleh Krehel" . "ohwoeowho@gmail.com") diff --git a/elpa/ivy-20210930.1450/ivy.el b/elpa/ivy-20230714.751/ivy.el similarity index 96% rename from elpa/ivy-20210930.1450/ivy.el rename to elpa/ivy-20230714.751/ivy.el index dcf58da8..78ca8346 100644 --- a/elpa/ivy-20210930.1450/ivy.el +++ b/elpa/ivy-20230714.751/ivy.el @@ -1,10 +1,10 @@ ;;; ivy.el --- Incremental Vertical completYon -*- lexical-binding: t -*- -;; Copyright (C) 2015-2021 Free Software Foundation, Inc. +;; Copyright (C) 2015-2023 Free Software Foundation, Inc. ;; Author: Oleh Krehel ;; URL: https://github.com/abo-abo/swiper -;; Version: 0.13.4 +;; Version: 0.14.0 ;; Package-Requires: ((emacs "24.5")) ;; Keywords: matching @@ -277,8 +277,8 @@ Example: (cl-subseq recentf-list 0 20)) (ivy-set-sources - 'counsel-locate - '((small-recentf) + \\='counsel-locate + \\='((small-recentf) (original-source)))" (setq ivy--sources-list (plist-put ivy--sources-list cmd sources))) @@ -433,7 +433,9 @@ the restoring themselves.") (end (region-end)) (eol (save-excursion (goto-char beg) (line-end-position)))) (buffer-substring-no-properties beg (min end eol)))) - ((thing-at-point 'url)) + ((let ((url (thing-at-point 'url))) + ;; Work around `https://bugs.gnu.org/58091'. + (and (stringp url) url))) ((and (eq (ivy-state-collection ivy-last) #'read-file-name-internal) (let ((inhibit-message t) (ffap-machine-p-known 'reject)) @@ -696,29 +698,33 @@ candidate, not the prompt." (if (ivy--prompt-selected-p) (ivy-immediate-done) (setq ivy-current-prefix-arg current-prefix-arg) - (delete-minibuffer-contents) - (cond ((and (= ivy--length 0) - (eq this-command 'ivy-dispatching-done)) - (ivy--done ivy-text)) - ((or (> ivy--length 0) - ;; the action from `ivy-dispatching-done' may not need a - ;; candidate at all - (eq this-command 'ivy-dispatching-done)) - (ivy--done (ivy-state-current ivy-last))) - ((and (memq (ivy-state-collection ivy-last) - '(read-file-name-internal internal-complete-buffer)) - (eq confirm-nonexistent-file-or-buffer t) - (not (string= " (confirm)" ivy--prompt-extra))) - (setq ivy--prompt-extra " (confirm)") - (insert ivy-text) - (ivy--exhibit)) - ((memq (ivy-state-require-match ivy-last) - '(nil confirm confirm-after-completion)) - (ivy--done ivy-text)) - (t - (setq ivy--prompt-extra " (match required)") - (insert ivy-text) - (ivy--exhibit))))) + (let ((require-match (ivy-state-require-match ivy-last)) + (input (ivy--input))) + (delete-minibuffer-contents) + (cond ((and (= ivy--length 0) + (eq this-command 'ivy-dispatching-done)) + (ivy--done ivy-text)) + ((or (> ivy--length 0) + ;; the action from `ivy-dispatching-done' may not need a + ;; candidate at all + (eq this-command 'ivy-dispatching-done)) + (ivy--done (ivy-state-current ivy-last))) + ((string= " (confirm)" ivy--prompt-extra) + (ivy--done ivy-text)) + ((or (and (memq (ivy-state-collection ivy-last) + '(read-file-name-internal internal-complete-buffer)) + (eq confirm-nonexistent-file-or-buffer t)) + (and (functionp require-match) + (setq require-match (funcall require-match)))) + (setq ivy--prompt-extra " (confirm)") + (insert input) + (ivy--exhibit)) + ((memq require-match '(nil confirm confirm-after-completion)) + (ivy--done ivy-text)) + (t + (setq ivy--prompt-extra " (match required)") + (insert ivy-text) + (ivy--exhibit)))))) (defvar ivy-mouse-1-tooltip "Exit the minibuffer with the selected candidate." @@ -935,10 +941,10 @@ Is is a cons cell, related to `tramp-get-completion-function'." :type '(alist :key-type symbol :value-type function)) (defun ivy--completing-fname-p () - (eq 'file (cdr (assoc - 'category - (ignore-errors - (funcall (ivy-state-collection ivy-last) ivy-text nil 'metadata)))))) + (let ((meta (ignore-errors + (funcall (ivy-state-collection ivy-last) ivy-text nil 'metadata)))) + (and (consp meta) + (eq 'file (cdr (assoc 'category meta)))))) (defun ivy-alt-done (&optional arg) "Exit the minibuffer with the selected candidate. @@ -1120,34 +1126,45 @@ If the text hasn't changed as a result, forward to `ivy-alt-done'." (defun ivy-partial () "Complete the minibuffer text as much as possible." (interactive) - (let* ((parts (or (ivy--split-spaces ivy-text) (list ""))) - (tail (last parts)) - (postfix (car tail)) - (case-fold-search (ivy--case-fold-p ivy-text)) - (completion-ignore-case case-fold-search) - (new (try-completion (string-remove-prefix "^" postfix) - (if (ivy-state-dynamic-collection ivy-last) - ivy--all-candidates + (if (ivy-state-dynamic-collection ivy-last) + (let* ((bnd + (ignore-errors + (funcall + (ivy-state-collection ivy-last) + ivy-text nil (cons 'boundaries (buffer-substring (point) (line-end-position)))))) + (beg (+ (minibuffer-prompt-end) + (if bnd (cadr bnd) 0)))) + (delete-region beg (point-max)) + (insert + (ivy-state-current ivy-last)) + t) + (let* ((parts (or (ivy--split-spaces ivy-text) (list ""))) + (tail (last parts)) + (postfix (car tail)) + (case-fold-search (ivy--case-fold-p ivy-text)) + (completion-ignore-case case-fold-search) + (new (try-completion (string-remove-prefix "^" postfix) (mapcar (lambda (str) (let ((i (string-match-p postfix str))) (and i (substring str i)))) - ivy--old-cands))))) - (cond ((eq new t) nil) - ((string= new ivy-text) nil) - ((string= (car tail) (car (ivy--split-spaces new))) nil) - (new - (delete-region (minibuffer-prompt-end) (point-max)) - (setcar tail - (if (= (string-to-char postfix) ?^) - (concat "^" new) - new)) - (ivy-set-text - (concat - (mapconcat #'identity parts " ") - (and ivy-tab-space (not (= (length ivy--old-cands) 1)) " "))) - (insert ivy-text) - (ivy--partial-cd-for-single-directory) - t)))) + ivy--old-cands)))) + (cond + ((eq new t) nil) + ((string= new ivy-text) nil) + ((string= (car tail) (car (ivy--split-spaces new))) nil) + (new + (delete-region (minibuffer-prompt-end) (point-max)) + (setcar tail + (if (= (string-to-char postfix) ?^) + (concat "^" new) + new)) + (ivy-set-text + (concat + (mapconcat #'identity parts " ") + (and ivy-tab-space (not (= (length ivy--old-cands) 1)) " "))) + (insert ivy-text) + (ivy--partial-cd-for-single-directory) + t))))) (defvar ivy-completion-beg nil "Completion bounds start.") @@ -1661,7 +1678,9 @@ minibuffer." "Forward to `kill-line'." (interactive) (if (eolp) - (kill-region (minibuffer-prompt-end) (point)) + (progn + (kill-region (minibuffer-prompt-end) (point)) + (setq ivy--old-text (current-kill 0 t))) (kill-line))) (defun ivy-kill-whole-line () @@ -1805,7 +1824,7 @@ Possible choices: `ivy--regex', `regexp-quote', `ivy--regex-plus', `ivy--regex-fuzzy', `ivy--regex-ignore-order'. If a function returns a list, it should format like this: -'((\"matching-regexp\" . t) (\"non-matching-regexp\") ...). +\\='((\"matching-regexp\" . t) (\"non-matching-regexp\") ...). The matches will be filtered in a sequence, you can mix the regexps that should match and that should not match as you @@ -2041,7 +2060,7 @@ PREDICATE is applied to filter out the COLLECTION immediately. This argument is for compatibility with `completing-read'. When REQUIRE-MATCH is non-nil, only members of COLLECTION can be -selected. +selected. In can also be a lambda. If INITIAL-INPUT is non-nil, then insert that input in the minibuffer initially. @@ -2185,18 +2204,18 @@ customizations apply to the current completion session." (ivy-call))) (defun ivy--update-history (hist) - (let ((item - (if (or (string= ivy-text "") - (eq - (plist-get (ivy-state-extra-props ivy-last) :caller) - 'ivy-completing-read) - (eq (ivy-state-history ivy-last) 'file-name-history)) - (ivy-state-current ivy-last) - ivy-text))) - (cond ((equal item "")) - ((stringp item) - (set hist (cons (propertize item 'ivy-index ivy--index) - (delete item (symbol-value hist)))))))) + (unless (eq hist t) + (let ((item + (if (or (string= ivy-text "") + (eq (plist-get (ivy-state-extra-props ivy-last) :caller) + #'ivy-completing-read) + (eq (ivy-state-history ivy-last) 'file-name-history)) + (ivy-state-current ivy-last) + ivy-text))) + (cond ((equal item "")) + ((stringp item) + (set hist (cons (propertize item 'ivy-index ivy--index) + (delete item (symbol-value hist))))))))) (defun ivy--cleanup () ;; Fixes a bug in ESS, #1660 @@ -2228,10 +2247,14 @@ customizations apply to the current completion session." (propertize x 'idx (cl-incf i))) (all-completions "" alist)))) +(defvar ivy--minibuffer-metadata nil + "Store `completion-metadata'.") + (defun ivy--reset-state (state) "Reset the ivy to STATE. This is useful for recursive `ivy-read'." (setq ivy-marked-candidates nil) + (setq ivy--minibuffer-metadata nil) (unless (equal (selected-frame) (ivy-state-frame state)) (select-window (active-minibuffer-window))) (let* ((prompt (or (ivy-state-prompt state) "")) @@ -2340,6 +2363,12 @@ This is useful for recursive `ivy-read'." counsel-switch-buffer))) predicate))) (dynamic-collection + (setq ivy--minibuffer-metadata + (ignore-errors + (completion-metadata + "" + (ivy-state-collection ivy-last) + (ivy-state-predicate ivy-last)))) (setq coll (if (and (eq this-command 'ivy-resume) (not (buffer-modified-p))) ivy--all-candidates (ivy--dynamic-collection-cands (or initial-input ""))))) @@ -2860,7 +2889,7 @@ When GREEDY is non-nil, join words in a greedy way." (defun ivy--regex-p (object) "Return OBJECT if it is a valid regular expression, else nil." - (ignore-errors (string-match-p object "") object)) + (ignore-errors (ignore (string-match-p object "")) object)) (defun ivy--regex-or-literal (str) "If STR isn't a legal regexp, escape it." @@ -3178,10 +3207,11 @@ parts beyond their respective faces `ivy-confirm-face' and (sort (copy-sequence collection) sort) collection))) -(defcustom ivy-magic-slash-non-match-action 'ivy-magic-slash-non-match-cd-selected - "Action to take when a slash is added to the end of a non existing directory. -Possible choices are 'ivy-magic-slash-non-match-cd-selected, -'ivy-magic-slash-non-match-create, or nil" +(defcustom ivy-magic-slash-non-match-action + 'ivy-magic-slash-non-match-cd-selected + "Action to take when a slash is appended to a nonexistent directory. +Possible choices are `ivy-magic-slash-non-match-cd-selected', +`ivy-magic-slash-non-match-create', or nil" :type '(choice (const :tag "Use currently selected directory" ivy-magic-slash-non-match-cd-selected) @@ -3353,7 +3383,10 @@ Should be run via minibuffer `post-command-hook'." t)) (defun ivy--dynamic-collection-cands (input) - (let ((coll (funcall (ivy-state-collection ivy-last) input))) + (let ((coll (condition-case nil + (funcall (ivy-state-collection ivy-last) input) + (error + (funcall (ivy-state-collection ivy-last) input nil t))))) (if (listp coll) (mapcar (lambda (x) (if (consp x) (car x) x)) coll) coll))) @@ -4050,12 +4083,10 @@ in this case." (defun ivy--highlight-default (str) "Highlight STR, using the default method." - (unless ivy--old-re - (setq ivy--old-re ivy-regex)) (let ((regexps - (if (listp ivy--old-re) - (mapcar #'car (cl-remove-if-not #'cdr ivy--old-re)) - (list ivy--old-re))) + (if (listp ivy-regex) + (mapcar #'car (cl-remove-if-not #'cdr ivy-regex)) + (list ivy-regex))) start) (dolist (re regexps) (ignore-errors @@ -4146,7 +4177,7 @@ CANDS is a list of candidates that :display-transformer can turn into strings." (let* ((bnd (ivy--minibuffer-index-bounds ivy--index ivy--length ivy-height)) (wnd-cands (cl-subseq cands (car bnd) (cadr bnd))) - (case-fold-search (ivy--case-fold-p ivy-text)) + (case-fold-search (ivy--case-fold-p (ivy-re-to-str ivy-regex))) transformer-fn) (setq ivy--window-index (nth 2 bnd)) (when (setq transformer-fn (ivy-state-display-transformer-fn ivy-last)) @@ -4818,7 +4849,7 @@ This list can be rotated with `ivy-rotate-preferred-builders'." (defun ivy--label-and-delete-dups (entries) "Label ENTRIES with history indices." - (let ((ht (make-hash-table :test 'equal)) + (let ((ht (and entries (make-hash-table :test #'equal))) (idx 0) entry accum) @@ -4829,22 +4860,21 @@ This list can be rotated with `ivy-rotate-preferred-builders'." (cl-incf idx)) (nreverse accum))) -(defvar ivy--reverse-i-search-symbol nil - "Store the history symbol.") +(defvar ivy--reverse-i-search-history nil + "Store the minibuffer history variable.") (defun ivy-reverse-i-search-kill () - "Remove the current item from history" + "Remove the current item from minibuffer history." (interactive) (if (not (eolp)) (ivy-kill-line) - (let ((current (ivy-state-current ivy-last))) - (if (symbolp ivy--reverse-i-search-symbol) - (set - ivy--reverse-i-search-symbol - (delete current (symbol-value ivy--reverse-i-search-symbol))) - (ring-remove - ivy--reverse-i-search-symbol - (ring-member ivy--reverse-i-search-symbol (ivy-state-current ivy-last))))) + (let ((current (ivy-state-current ivy-last)) + (history ivy--reverse-i-search-history)) + (cond ((booleanp history)) + ((symbolp history) + (set history (delete current (symbol-value history)))) + ((ring-p history) + (ring-remove history (ring-member history current))))) (ivy--kill-current-candidate))) (defvar ivy-reverse-i-search-map @@ -4855,20 +4885,17 @@ This list can be rotated with `ivy-rotate-preferred-builders'." (defun ivy-history-contents (history) "Copy contents of HISTORY. A copy is necessary so that we don't clobber any string attributes. -Also set `ivy--reverse-i-search-symbol' to HISTORY." - (setq ivy--reverse-i-search-symbol history) - (cond ((symbolp history) - (ivy--label-and-delete-dups - (copy-sequence (symbol-value history)))) - ((ring-p history) - (ivy--label-and-delete-dups - (when (> (ring-size history) 0) - (ring-elements history)))) - ((sequencep history) - (ivy--label-and-delete-dups - (copy-sequence history))) - (t - (error "Expected a symbol, ring, or sequence: %S" history)))) +Also set `ivy--reverse-i-search-history' to HISTORY." + (prog1 (ivy--label-and-delete-dups + (cond ((booleanp history) ()) + ((symbolp history) + (copy-sequence (symbol-value history))) + ((ring-p history) + (ring-elements history)) + ((sequencep history) + (copy-sequence history)) + ((error "Expected a symbol, ring, or sequence: %S" history)))) + (setq ivy--reverse-i-search-history history))) (defun ivy-reverse-i-search () "Enter a recursive `ivy-read' session using the current history. @@ -4938,6 +4965,7 @@ buffer would modify `ivy-last'.") (define-key map (kbd "q") 'quit-window) (define-key map (kbd "R") 'read-only-mode) (ivy-define-key map (kbd "C-d") 'ivy-occur-delete-candidate) + (ivy-define-key map (kbd "F") 'ivy-occur-flush-lines) map) "Keymap for Ivy Occur mode.") @@ -5039,6 +5067,12 @@ When `ivy-calling' isn't nil, call `ivy-occur-press'." (delete-region (line-beginning-position) (1+ (line-end-position))))) +(defun ivy-occur-flush-lines () + "Delete lines matching regex." + (interactive) + (let ((inhibit-read-only t)) + (call-interactively 'flush-lines))) + (define-derived-mode ivy-occur-grep-mode grep-mode "Ivy-Occur" "Major mode for output from \\[ivy-occur]. @@ -5106,7 +5140,10 @@ There is no limit on the number of *ivy-occur* buffers." "") ivy-text)))) (with-current-buffer buffer - (funcall occur-fn ivy--old-cands) + (funcall occur-fn + (if (ivy-state-dynamic-collection ivy-last) + (funcall (ivy-state-collection ivy-last) ivy-text) + ivy--old-cands)) (setf (ivy-state-text ivy-last) ivy-text) (setq ivy-occur-last ivy-last)) (ivy-exit-with-action @@ -5128,10 +5165,15 @@ updated original buffer." (let ((caller (ivy-state-caller ivy-occur-last)) (ivy-last ivy-occur-last)) (let ((inhibit-read-only t) - (line (line-number-at-pos))) + (line (line-number-at-pos)) + (text (ivy-state-text ivy-last))) (erase-buffer) + (ivy-set-text text) (funcall (or (plist-get ivy--occurs-list caller) - #'ivy--occur-default) nil) + #'ivy--occur-default) + (and (ivy-state-dynamic-collection ivy-last) + (funcall (ivy-state-collection ivy-last) + text))) (goto-char (point-min)) (forward-line (1- line))) (setq ivy-occur-last ivy-last))) diff --git a/elpa/ivy-20210930.1450/ivy.info b/elpa/ivy-20230714.751/ivy.info similarity index 97% rename from elpa/ivy-20210930.1450/ivy.info rename to elpa/ivy-20230714.751/ivy.info index 6f91e189..d4355798 100644 --- a/elpa/ivy-20210930.1450/ivy.info +++ b/elpa/ivy-20230714.751/ivy.info @@ -1,6 +1,6 @@ This is ivy.info, produced by makeinfo version 6.7 from ivy.texi. -Ivy manual, version 0.13.4 +Ivy manual, version 0.14.0 Ivy is an interactive interface for completion in Emacs. Emacs uses completion mechanism in a variety of contexts: code, menus, commands, @@ -11,7 +11,7 @@ available choices while previewing in the minibuffer. Selecting the final candidate is either through simple keyboard character inputs or through powerful regular expressions. - Copyright (C) 2015–2021 Free Software Foundation, Inc. + Copyright (C) 2015–2023 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, @@ -188,8 +188,7 @@ File: ivy.info, Node: Installation, Next: Getting started, Prev: Introduction Install Ivy automatically through Emacs’s package manager, or manually from Ivy’s development repository. - Emacs 24.3 is the oldest version to run Ivy. Emacs 24.4 is the -oldest version that runs Ivy with fancy faces display. + Emacs 24.5 is the oldest version to run Ivy. * Menu: @@ -565,7 +564,7 @@ File: ivy.info, Node: Key bindings that alter the minibuffer input, Next: Othe ‘M-p’ (‘ivy-previous-history-element’) ...................................... - Cycles forward through the Ivy command history. + Cycles backwards through the Ivy command history. ‘M-i’ (‘ivy-insert-current’) ............................ @@ -1002,7 +1001,7 @@ File: ivy.info, Node: Defcustoms, Next: Actions, Prev: Faces, Up: Customizat -- User Option: ivy-display-style Specifies highlighting candidates in the minibuffer. - The default setting is ‘'fancy’ in Emacs versions 24.4 or newer. + The default setting is ‘fancy’. Set ‘ivy-display-style’ to ‘nil’ for a plain minibuffer. @@ -1920,50 +1919,50 @@ Tag Table: Node: Top1192 Node: Introduction3103 Node: Installation5626 -Node: Installing from Emacs Package Manager6076 -Node: Installing from the Git repository7324 -Node: Getting started8144 -Node: Basic customization8451 -Node: Key bindings9046 -Node: Global key bindings9238 -Node: Minibuffer key bindings11712 -Node: Key bindings for navigation12944 -Node: Key bindings for single selection action then exit minibuffer14151 -Node: Key bindings for multiple selections and actions keep minibuffer open16835 -Node: Key bindings that alter the minibuffer input19456 -Node: Other key bindings21401 -Node: Hydra in the minibuffer21779 -Node: Saving the current completion session to a buffer24197 -Node: Completion Styles25609 -Node: ivy--regex-plus27367 -Node: ivy--regex-ignore-order28853 -Node: ivy--regex-fuzzy29221 -Node: Customization29718 -Node: Faces29904 -Node: Defcustoms32333 -Node: Actions33692 -Node: What are actions?34018 -Node: How can different actions be called?34836 -Node: How to modify the actions list?35407 -Node: Example - add two actions to each command36067 -Node: How to undo adding the two actions37026 -Node: How to add actions to a specific command37478 -Node: Example - define a new command with several actions37894 -Node: Test the above function with ivy-occur38831 -Node: Packages39673 -Node: Commands40638 -Node: File Name Completion40823 -Node: Using TRAMP42780 -Node: Buffer Name Completion44282 -Node: Counsel commands44897 -Node: API45544 -Node: Required arguments for ivy-read46142 -Node: Optional arguments for ivy-read46661 -Node: Example - counsel-describe-function50087 -Node: Example - counsel-locate53071 -Node: Example - ivy-read-with-extra-properties56940 -Node: Variable Index58218 -Node: Keystroke Index65342 +Node: Installing from Emacs Package Manager6002 +Node: Installing from the Git repository7250 +Node: Getting started8070 +Node: Basic customization8377 +Node: Key bindings8972 +Node: Global key bindings9164 +Node: Minibuffer key bindings11638 +Node: Key bindings for navigation12870 +Node: Key bindings for single selection action then exit minibuffer14077 +Node: Key bindings for multiple selections and actions keep minibuffer open16761 +Node: Key bindings that alter the minibuffer input19382 +Node: Other key bindings21329 +Node: Hydra in the minibuffer21707 +Node: Saving the current completion session to a buffer24125 +Node: Completion Styles25537 +Node: ivy--regex-plus27295 +Node: ivy--regex-ignore-order28781 +Node: ivy--regex-fuzzy29149 +Node: Customization29646 +Node: Faces29832 +Node: Defcustoms32261 +Node: Actions33587 +Node: What are actions?33913 +Node: How can different actions be called?34731 +Node: How to modify the actions list?35302 +Node: Example - add two actions to each command35962 +Node: How to undo adding the two actions36921 +Node: How to add actions to a specific command37373 +Node: Example - define a new command with several actions37789 +Node: Test the above function with ivy-occur38726 +Node: Packages39568 +Node: Commands40533 +Node: File Name Completion40718 +Node: Using TRAMP42675 +Node: Buffer Name Completion44177 +Node: Counsel commands44792 +Node: API45439 +Node: Required arguments for ivy-read46037 +Node: Optional arguments for ivy-read46556 +Node: Example - counsel-describe-function49982 +Node: Example - counsel-locate52966 +Node: Example - ivy-read-with-extra-properties56835 +Node: Variable Index58113 +Node: Keystroke Index65237  End Tag Table diff --git a/elpa/swiper-20210919.1221/swiper-pkg.el b/elpa/swiper-20210919.1221/swiper-pkg.el deleted file mode 100644 index 8f60a84a..00000000 --- a/elpa/swiper-20210919.1221/swiper-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; Generated package description from swiper.el -*- no-byte-compile: t -*- -(define-package "swiper" "20210919.1221" "Isearch with an overview. Oh, man!" '((emacs "24.5") (ivy "0.13.4")) :commit "1c6b3da377a840e898b14020133f59fca9ceea1c" :authors '(("Oleh Krehel" . "ohwoeowho@gmail.com")) :maintainer '("Oleh Krehel" . "ohwoeowho@gmail.com") :keywords '("matching") :url "https://github.com/abo-abo/swiper") diff --git a/elpa/swiper-20210919.1221/swiper-autoloads.el b/elpa/swiper-20230410.1815/swiper-autoloads.el similarity index 51% rename from elpa/swiper-20210919.1221/swiper-autoloads.el rename to elpa/swiper-20230410.1815/swiper-autoloads.el index 68a557ef..20537d04 100644 --- a/elpa/swiper-20210919.1221/swiper-autoloads.el +++ b/elpa/swiper-20230410.1815/swiper-autoloads.el @@ -1,58 +1,56 @@ -;;; swiper-autoloads.el --- automatically extracted autoloads -;; +;;; swiper-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- +;; Generated by the `loaddefs-generate' function. + +;; This file is part of GNU Emacs. + ;;; Code: -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) +(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) + -;;;### (autoloads nil "swiper" "swiper.el" (0 0 0 0)) ;;; Generated autoloads from swiper.el (autoload 'swiper-avy "swiper" "\ -Jump to one of the current swiper candidates with `avy'." t nil) - +Jump to one of the current swiper candidates with `avy'." t) (autoload 'swiper-backward "swiper" "\ `isearch-backward' with an overview. When non-nil, INITIAL-INPUT is the initial search pattern. -\(fn &optional INITIAL-INPUT)" t nil) - +(fn &optional INITIAL-INPUT)" t) (autoload 'swiper-thing-at-point "swiper" "\ -`swiper' with `ivy-thing-at-point'." t nil) - +`swiper' with `ivy-thing-at-point'." t) (autoload 'swiper-all-thing-at-point "swiper" "\ -`swiper-all' with `ivy-thing-at-point'." t nil) - +`swiper-all' with `ivy-thing-at-point'." t) (autoload 'swiper "swiper" "\ `isearch-forward' with an overview. When non-nil, INITIAL-INPUT is the initial search pattern. -\(fn &optional INITIAL-INPUT)" t nil) - +(fn &optional INITIAL-INPUT)" t) (autoload 'swiper-all "swiper" "\ Run `swiper' for all open buffers. -\(fn &optional INITIAL-INPUT)" t nil) - +(fn &optional INITIAL-INPUT)" t) (autoload 'swiper-isearch "swiper" "\ A `swiper' that's not line-based. -\(fn &optional INITIAL-INPUT)" t nil) - +(fn &optional INITIAL-INPUT)" t) (autoload 'swiper-isearch-backward "swiper" "\ Like `swiper-isearch' but the first result is before the point. -\(fn &optional INITIAL-INPUT)" t nil) +(fn &optional INITIAL-INPUT)" t) +(register-definition-prefixes "swiper" '("swiper-")) + +;;; End of scraped data -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "swiper" '("swiper-"))) +(provide 'swiper-autoloads) -;;;*** - ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 +;; no-native-compile: t +;; coding: utf-8-emacs-unix ;; End: + ;;; swiper-autoloads.el ends here diff --git a/elpa/swiper-20230410.1815/swiper-pkg.el b/elpa/swiper-20230410.1815/swiper-pkg.el new file mode 100644 index 00000000..1df87518 --- /dev/null +++ b/elpa/swiper-20230410.1815/swiper-pkg.el @@ -0,0 +1,15 @@ +(define-package "swiper" "20230410.1815" "Isearch with an overview. Oh, man!" + '((emacs "24.5") + (ivy "0.14.0")) + :commit "d28225e86f8dfb3825809ad287f759f95ee9e479" :authors + '(("Oleh Krehel" . "ohwoeowho@gmail.com")) + :maintainers + '(("Oleh Krehel" . "ohwoeowho@gmail.com")) + :maintainer + '("Oleh Krehel" . "ohwoeowho@gmail.com") + :keywords + '("matching") + :url "https://github.com/abo-abo/swiper") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/swiper-20210919.1221/swiper.el b/elpa/swiper-20230410.1815/swiper.el similarity index 95% rename from elpa/swiper-20210919.1221/swiper.el rename to elpa/swiper-20230410.1815/swiper.el index 426dce08..c9bec1e3 100644 --- a/elpa/swiper-20210919.1221/swiper.el +++ b/elpa/swiper-20230410.1815/swiper.el @@ -1,13 +1,11 @@ -;;; swiper.el --- Isearch with an overview. Oh, man! -*- lexical-binding: t -*- +;;; swiper.el --- Isearch with an overview. Oh, man! -*- lexical-binding: t -*- -;; Copyright (C) 2015-2021 Free Software Foundation, Inc. +;; Copyright (C) 2015-2023 Free Software Foundation, Inc. ;; Author: Oleh Krehel ;; URL: https://github.com/abo-abo/swiper -;; Package-Version: 20210919.1221 -;; Package-Commit: 1c6b3da377a840e898b14020133f59fca9ceea1c -;; Version: 0.13.4 -;; Package-Requires: ((emacs "24.5") (ivy "0.13.4")) +;; Version: 0.14.0 +;; Package-Requires: ((emacs "24.5") (ivy "0.14.0")) ;; Keywords: matching ;; This file is part of GNU Emacs. @@ -36,6 +34,7 @@ ;;; Code: +(require 'cl-lib) (require 'ivy) (defgroup swiper nil @@ -575,8 +574,8 @@ numbers; replaces calculating the width from buffer line count." (cl-incf line-number)) (nreverse candidates)))))) -(defvar swiper--opoint 1 - "The point when `swiper' starts.") +(defvar swiper--opoint nil + "Value of point when `swiper' or `swiper-isearch' starts.") ;;;###autoload (defun swiper-backward (&optional initial-input) @@ -818,7 +817,7 @@ When non-nil, INITIAL-INPUT is the initial search pattern." (if initial-input (cl-position-if (lambda (x) - (= (1+ preselect) (swiper--line-number x))) + (<= (1+ preselect) (swiper--line-number x))) (progn (setq ivy--old-re nil) (ivy--filter initial-input candidates))) @@ -968,8 +967,9 @@ the face, window and priority of the overlay." (line-move (1- num)) (forward-line (1- num)))) (if (and (equal ivy-text "") - (>= swiper--opoint (line-beginning-position)) - (<= swiper--opoint (line-end-position))) + (<= (line-beginning-position) + swiper--opoint + (line-end-position))) (goto-char swiper--opoint) (if (eq swiper--current-line num) (when swiper--current-match-start @@ -1128,7 +1128,8 @@ WND, when specified is the window." #'line-move #'forward-line) ln) - (when (and (re-search-forward re (line-end-position) t) swiper-goto-start-of-match) + (when (and (re-search-forward re (line-end-position) t) + swiper-goto-start-of-match) (goto-char (match-beginning 0))) (swiper--ensure-visible) (swiper--maybe-recenter) @@ -1386,8 +1387,8 @@ See `ivy-format-functions-alist' for further information." (invisible-p (overlay-get ov 'invisible))) (overlays-at (point)))))) -(defvar swiper--isearch-backward nil) -(defvar swiper--isearch-start-point nil) +(defvar swiper--isearch-backward nil + "Non-nil when performing `swiper-isearch-backward'.") (defun swiper--isearch-function-1 (re backward) (unless (string= re ".") @@ -1418,13 +1419,13 @@ See `ivy-format-functions-alist' for further information." (setq re (concat "\\=\\(?:" re "\\)")) (cl-position-if (lambda (x) - (when (< x swiper--isearch-start-point) + (when (< x swiper--opoint) (goto-char x) ;; Note: Not quite the same as `looking-at' + `match-end'. - (re-search-forward re swiper--isearch-start-point t))) + (re-search-forward re swiper--opoint t))) cands :from-end t)) - (cl-position swiper--isearch-start-point cands :test #'<)) + (cl-position swiper--opoint cands :test #'<)) 0)) (defun swiper--isearch-filter-ignore-order (re-full cands) @@ -1489,6 +1490,21 @@ that we search only for one character." ((and (stringp cand) (> (length cand) 0)) (get-text-property 0 'point cand)))) +(defun swiper--isearch-candidate-string (cand) + "Return full match of `swiper-isearch' candidate CAND. +Signal an error on failure." + ;; FIXME: Better way of getting current candidate? + (or (let ((pos (swiper--isearch-candidate-pos cand)) + (re (ivy-re-to-str ivy-regex))) + (save-match-data + (save-excursion + (and pos (goto-char pos) + (if (or swiper--isearch-backward swiper-goto-start-of-match) + (looking-at re) + (looking-back re (point-min))) + (match-string 0))))) + (error "Could not extract `swiper-isearch' candidate: %S" cand))) + (defun swiper-isearch-action (x) "Move to X for `swiper-isearch'." (if (setq x (swiper--isearch-candidate-pos x)) @@ -1526,18 +1542,34 @@ that we search only for one character." "Save `swiper-isearch' candidate CAND to `kill-ring'. Return to original position." (unwind-protect - (progn - (unless (and (setq cand (swiper--isearch-candidate-pos cand)) - ;; FIXME: Better way of getting current candidate? - (goto-char cand) - (looking-back (ivy-re-to-str ivy-regex) (point-min))) - (error "Could not copy `swiper-isearch' candidate: %S" cand)) - (kill-new (match-string 0))) + (kill-new (swiper--isearch-candidate-string cand)) + ;; In case of unexpected error. + (goto-char swiper--opoint))) + +(defun swiper-isearch-action-insert (cand) + "Insert `swiper-isearch' candidate CAND where invoked. +This cannot currently be called repeatedly without exiting +completion." + (goto-char swiper--opoint) + (unwind-protect + ;; FIXME: This seems to invalidate many cached buffer positions, thus + ;; breaking `ivy-dispatching-call'. + (insert (swiper--isearch-candidate-string cand)) + ;; In case of unexpected error. (goto-char swiper--opoint))) (ivy-add-actions 'swiper-isearch '(("w" swiper-isearch-action-copy "copy"))) +(ivy-add-actions 'swiper-isearch '(("i" swiper-isearch-action-insert "insert"))) (ivy-add-actions 'swiper '(("w" swiper-action-copy "copy"))) +(defun swiper--isearch-insert-current () + "Replace minibuffer contents with the current candidate. +Like `ivy-insert-current', but tailored for `swiper-isearch'." + (interactive) + (delete-minibuffer-contents) + (let ((cur (ivy-state-current ivy-last))) + (insert (with-ivy-window (swiper--isearch-candidate-string cur))))) + (defun swiper-isearch-thing-at-point () "Insert `symbol-at-point' into the minibuffer of `swiper-isearch'. When not running `swiper-isearch' already, start it." @@ -1578,8 +1610,9 @@ When the input is empty, browse the search history instead." (defvar swiper-isearch-map (let ((map (make-sparse-keymap))) (set-keymap-parent map swiper-map) - (define-key map (kbd "M-n") 'swiper-isearch-thing-at-point) - (define-key map (kbd "C-r") 'swiper-isearch-C-r) + (define-key map [remap ivy-insert-current] #'swiper--isearch-insert-current) + (define-key map (kbd "M-n") #'swiper-isearch-thing-at-point) + (define-key map (kbd "C-r") #'swiper-isearch-C-r) map) "Keymap for `swiper-isearch'.") @@ -1688,7 +1721,6 @@ When the input is empty, browse the search history instead." (defun swiper--isearch-init () "Initialize `swiper-isearch'." (swiper--init) - (setq swiper--isearch-start-point (point)) (swiper-font-lock-ensure)) (defun swiper--isearch-unwind ()