diff options
| author | João Távora | 2019-11-05 18:04:20 +0000 |
|---|---|---|
| committer | João Távora | 2019-11-05 18:04:20 +0000 |
| commit | 2b0f589134d9427a96ab8cf0d8473715740984ef (patch) | |
| tree | 0e624d53824f485d4245bd48db68988383ef7cb4 | |
| parent | 162979590d04a7d2fe0d980958d3da4b2940e69a (diff) | |
| download | emacs-scratch/fido-mode.tar.gz emacs-scratch/fido-mode.zip | |
Document fido-modescratch/fido-mode
* doc/emacs/buffers.texi (Icomplete): Document Fido Mode.
* etc/NEWS: Mention Fido Mode.
* lisp/icomplete.el (icomplete-mode): Ensure fido-mode is off.
(fido-mode): Ensure icomplete-mode is off.
(icomplete-magic-ido-ret): Don't force completions if no
completions.
| -rw-r--r-- | doc/emacs/buffers.texi | 16 | ||||
| -rw-r--r-- | etc/NEWS | 9 | ||||
| -rw-r--r-- | lisp/icomplete.el | 18 |
3 files changed, 36 insertions, 7 deletions
diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi index 74e6211f808..b5a17416d76 100644 --- a/doc/emacs/buffers.texi +++ b/doc/emacs/buffers.texi | |||
| @@ -725,6 +725,22 @@ of directories. | |||
| 725 | the variable @code{icomplete-mode} to @code{t} (@pxref{Easy | 725 | the variable @code{icomplete-mode} to @code{t} (@pxref{Easy |
| 726 | Customization}). | 726 | Customization}). |
| 727 | 727 | ||
| 728 | @findex fido-mode | ||
| 729 | @cindex fido mode | ||
| 730 | |||
| 731 | An alternative to Icomplete mode is Fido mode. This is very similar | ||
| 732 | to Icomplete mode, but retains some functionality from a popular | ||
| 733 | extension called Ido mode (in fact the name is derived from ``Fake | ||
| 734 | Ido''). Among other things, in Fido mode, @kbd{C-s} and @kbd{C-r} are | ||
| 735 | also used to rotate the completions list, @kbd{C-k} can be used to | ||
| 736 | delete files and kill buffers in-list. Another noteworthy aspect is | ||
| 737 | that @code{flex} is used as the default completion style | ||
| 738 | (@pxref{Completion Styles}). | ||
| 739 | |||
| 740 | To enable Fido mode, type @kbd{M-x fido-mode}, or customize | ||
| 741 | the variable @code{fido-mode} to @code{t} (@pxref{Easy | ||
| 742 | Customization}). | ||
| 743 | |||
| 728 | @node Buffer Menus | 744 | @node Buffer Menus |
| 729 | @subsection Customizing Buffer Menus | 745 | @subsection Customizing Buffer Menus |
| 730 | 746 | ||
| @@ -1181,6 +1181,15 @@ A new command 'xref-revert-buffer' is bound to 'g'. | |||
| 1181 | --- | 1181 | --- |
| 1182 | *** Imenu support has been added to 'xref--xref-buffer-mode'. | 1182 | *** Imenu support has been added to 'xref--xref-buffer-mode'. |
| 1183 | 1183 | ||
| 1184 | ** Icomplete | ||
| 1185 | |||
| 1186 | +++ | ||
| 1187 | *** A new minor mode based on Icomplete, Fido mode, is made available. | ||
| 1188 | The point of this mode, named after "Fake Ido", is to recover much of | ||
| 1189 | the functionality that still separated the popular ido-mode from | ||
| 1190 | Icomplete, while still cooperating fully with all of Emacs's | ||
| 1191 | completion facilities. | ||
| 1192 | |||
| 1184 | ** Ecomplete | 1193 | ** Ecomplete |
| 1185 | 1194 | ||
| 1186 | *** The ecomplete sorting has changed to a decay-based algorithm. | 1195 | *** The ecomplete sorting has changed to a decay-based algorithm. |
diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 777fdce13a0..40f4f0bc688 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el | |||
| @@ -273,20 +273,22 @@ require user confirmation." | |||
| 273 | (exit-minibuffer)))) | 273 | (exit-minibuffer)))) |
| 274 | 274 | ||
| 275 | (defun icomplete-magic-ido-ret () | 275 | (defun icomplete-magic-ido-ret () |
| 276 | "Exit forcing completion or enter directory, like `ido-mode'." | 276 | "Exit minibuffer or enter directory, like `ido-mode'." |
| 277 | (interactive) | 277 | (interactive) |
| 278 | (let* ((beg (icomplete--field-beg)) | 278 | (let* ((beg (icomplete--field-beg)) |
| 279 | (md (completion--field-metadata beg)) | 279 | (md (completion--field-metadata beg)) |
| 280 | (category (alist-get 'category (cdr md))) | 280 | (category (alist-get 'category (cdr md))) |
| 281 | (dir (and (eq category 'file) | 281 | (dir (and (eq category 'file) |
| 282 | (file-name-directory (icomplete--field-string)))) | 282 | (file-name-directory (icomplete--field-string)))) |
| 283 | (current (and dir | 283 | (current (car (completion-all-sorted-completions))) |
| 284 | (car (completion-all-sorted-completions)))) | 284 | (probe (and dir current |
| 285 | (probe (and current | ||
| 286 | (expand-file-name (directory-file-name current) dir)))) | 285 | (expand-file-name (directory-file-name current) dir)))) |
| 287 | (if (and probe (file-directory-p probe) (not (string= current "./"))) | 286 | (cond ((and probe (file-directory-p probe) (not (string= current "./"))) |
| 288 | (icomplete-force-complete) | 287 | (icomplete-force-complete)) |
| 289 | (icomplete-force-complete-and-exit)))) | 288 | (current |
| 289 | (icomplete-force-complete-and-exit)) | ||
| 290 | (t | ||
| 291 | (exit-minibuffer))))) | ||
| 290 | 292 | ||
| 291 | (defun icomplete-magic-ido-backward-updir () | 293 | (defun icomplete-magic-ido-backward-updir () |
| 292 | "Delete char before or go up directory, like `ido-mode'." | 294 | "Delete char before or go up directory, like `ido-mode'." |
| @@ -330,6 +332,7 @@ more like `ido-mode' than regular `icomplete-mode'." | |||
| 330 | (remove-hook 'minibuffer-setup-hook #'icomplete-minibuffer-setup) | 332 | (remove-hook 'minibuffer-setup-hook #'icomplete-minibuffer-setup) |
| 331 | (remove-hook 'minibuffer-setup-hook #'icomplete--fido-mode-setup) | 333 | (remove-hook 'minibuffer-setup-hook #'icomplete--fido-mode-setup) |
| 332 | (when fido-mode | 334 | (when fido-mode |
| 335 | (icomplete-mode -1) | ||
| 333 | (setq icomplete-mode t) | 336 | (setq icomplete-mode t) |
| 334 | (add-hook 'minibuffer-setup-hook #'icomplete-minibuffer-setup) | 337 | (add-hook 'minibuffer-setup-hook #'icomplete-minibuffer-setup) |
| 335 | (add-hook 'minibuffer-setup-hook #'icomplete--fido-mode-setup))) | 338 | (add-hook 'minibuffer-setup-hook #'icomplete--fido-mode-setup))) |
| @@ -355,6 +358,7 @@ completions: | |||
| 355 | (remove-hook 'minibuffer-setup-hook #'icomplete-minibuffer-setup) | 358 | (remove-hook 'minibuffer-setup-hook #'icomplete-minibuffer-setup) |
| 356 | (remove-hook 'completion-in-region-mode-hook #'icomplete--in-region-setup) | 359 | (remove-hook 'completion-in-region-mode-hook #'icomplete--in-region-setup) |
| 357 | (when icomplete-mode | 360 | (when icomplete-mode |
| 361 | (fido-mode -1) | ||
| 358 | (when icomplete-in-buffer | 362 | (when icomplete-in-buffer |
| 359 | (add-hook 'completion-in-region-mode-hook #'icomplete--in-region-setup)) | 363 | (add-hook 'completion-in-region-mode-hook #'icomplete--in-region-setup)) |
| 360 | (add-hook 'minibuffer-setup-hook #'icomplete-minibuffer-setup))) | 364 | (add-hook 'minibuffer-setup-hook #'icomplete-minibuffer-setup))) |