• Stars
    star
    242
  • Rank 167,048 (Top 4 %)
  • Language
    Emacs Lisp
  • License
    GNU General Publi...
  • Created about 13 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Fancy completion all over Emacs, not just for buffers and files.

ido-completing-read+ (formerly ido-ubiquitous)

MELPA Stable CI Status Join the chat at https://gitter.im/DarwinAwardWinner/ido-ubiquitous Coverage Status

This package replaces stock emacs completion with ido completion wherever it is possible to do so without breaking things (i.e. what you were probably hoping for when you set ido-everywhere to t).

Get it from MELPA: https://stable.melpa.org/#/ido-completing-read+

Version 4.0 changes

Long-time users should know that ido-completing-read+ version 4.0 is a major update. The previously separate ido-ubiquitous package has been merged into ido-completing-read+, which now provides all the features of both packages. The distinction between "new" and "old" default selection styles has been eliminated and replaced by a new variable ido-cr+-nil-def-alternate-behavior-list (see FAQ for details), and the override system has been accordingly simplified into just an allow list and a disable list. If you have previously customized any ido-ubiquitous options, be sure to check out

`M-x customize-group ido-completing-read+`

after updating to 4.0 and make sure the new settings are to your liking.

The short-lived ido-describe-fns package has likewise been subsumed into this one.

How to enable ido in as many places as possible

If you are using this package, you probably want to enable ido everywhere that it is possible to do so. Here are all the places to enable ido that I'm aware of. (Note that most of these variables/modes can also be set/enabled via M-x customize-variable if you prefer that.)

Ido itself

First, enable ido-mode and ido-everywhere.

(ido-mode 1)
(ido-everywhere 1)

ido-completing-read+ (this package)

Install this package from MELPA and then turn on ido-ubiquitous-mode:

(require 'ido-completing-read+)
(ido-ubiquitous-mode 1)

Amx

Amx, another of my packages, allows you to use alternate completion systems like ido for commands in M-x, with enhancements like putting your most-used commands at the front of the list. First install amx from MELPA, then turn on amx-mode:

(require 'amx)
(amx-mode 1)

ido-yes-or-no

If you want to use ido for yes-or-no questions, even though it's massive overkill, install my ido-yes-or-no package from MELPA, and then enable the mode:

(require 'ido-yes-or-no)
(ido-yes-or-no-mode 1)

ido for describe-face and certain other commands

Some commands, such as describe-face, use completing-read-multiple instead of completing-read. You can get ido completion for these commands with crm-custom-mode, which replaces completing-read-multiple with repeated calls to completing-read, which would then use ido thanks to ido-ubiquitous-mode. First, install the crm-custom package from MELPA, then enable the mode:

(require 'crm-custom)
(crm-custom-mode 1)

Make sure to read and understand the FAQ entry below about the empty entry at the beginning of the completion list before using this mode, or using it will likely be very confusing.

Packages with built-in ido support

Lastly, some packages already provide their own interfaces to ido, so ido-completing-read+ specifically avoids interfering with these. If you use any of the following packages, you need to enable ido for each of them separately.

  • Magit: (setq magit-completing-read-function 'magit-ido-completing-read)
  • Gnus: (setq gnus-completing-read-function 'gnus-ido-completing-read)
  • ESS: (setq ess-use-ido t)

If you are a package author implementing ido support for your package, you should consider using ido-completing-read+ in place of ido-completing-read, since it smooths out many of the unexpected edge cases of ido relative to completing-read-default.

icomplete-mode

For any case where ido cannot be used, there is another older mode called icomplete-mode that integrates with standard emacs completion and adds some ido-like behavior. It is built in to emacs, so no installation is necessary. Just load the file and enable the mode:

(require 'icomplete)
(icomplete-mode 1)

Frequently asked questions

How does ido-ubiquitous-mode decide when to replace completing-read?
Why don't some commands use ido completion?

Emacs' completing-read is a complex function with many complex features. Not all of these features are supported by ido, so it is impossible to always replace completing-read with ido completion. Trying to use ido when these features are requested can cause confusing and unexpected behavior or even completely break the completion system. So, ido-completing-read+ tries to get out of the way whenever it detects that these features might be used by a given call to completing-read. Furthermore, it's not always possible to detect based on the arguments to completing-read whether such ido-incompatible features are being used or not, so ido-completing-read+ also comes with a list of functions that are known not to work with ido. You can inspect this list using

M-x describe-variable ido-cr+-disable-list

If you want to know why a certain command isn't getting ido completion, you can enable ido-cr+-debug-mode and then run the command. There should then be a line in the *Messages* buffer that explains the reason for disabling ido completion.

Why does RET sometimes not select the first completion on the list?
Why is there an empty entry at the beginning of the completion list?
What happened to old-style default selection?

The simplest way to think about this is that if the command that called completing-read didn't specify a default, then the default is the empty string. In other words, "" is the default default.

Previous versions of ido-ubiquitous-mode gave special consideration to cases where a default value was not provided to completing-read and the user pressed RET without entering any text. The expected behavior is that completing-read should return the empty string in this case, which indicates to the calling function that the user did not select any completion. This conflicts with the standard ido behavior of selecting the first available completion when pressing RET, and this conflict was previously resolved by having two different modes that differed in their handling of RET on an empty input. Now there is only one mode, and the no-default case is handled by acting as if the empty string was specified as the default, which more closely matches the behavior of standard emacs completion. Since you, the user, have no way of knowing how completing-read was called, you can tell when this is occurring by watching for the appearance of an empty completion at the front of the list. Compare:

If the command specifies apple as the default when calling completing-read, the prompt will look like this, and pressing RET will select "apple":

Pick a fruit: {apple | banana | cherry | date}

However, if the command does not specify any default, an extra empty option is displayed before the first option, and pressing RET will select this empty option and return "":

Pick a fruit: { | apple | banana | cherry | date}

To select "apple" instead, you must first press the right arrow key once, or type an "a", before pressing RET.

However, some commands don't take this quirk of completing-read into account and don't expect it to ever return an empty string when require-match is non-nil. You can accommodate these functions by adding them to ido-cr+-nil-def-alternate-behavior-list.

How can I troubleshoot when ido-completing-read+ isn't doing what I want?

First, invoke the ido-cr+-debug-mode command. Then, run the command or code that you are having trouble with, and when the completion prompt appears, make a selection to complete the process. Then, examine the Messages buffer, where ido-completing-read+ will explain which mode of operation it selected and why. Based on this, you can add an entry to ido-cr+-disable-list, or take some other appropriate action.

Updates to ido-completing-read+ may include new disable list entries, but Emacs will not edit your override variables if you have already customized them. So, if you have recently upgraded ido-completing-read+, remember to invoke ido-cr+-update-disable-list to add in any new overrides. By default, ido-completing-read+ will remind you to do this whenever a new version adds to the list. For more information, see:

M-x describe-variable ido-cr+-auto-update-disable-list

Where can I report bugs?

If you end up adding any disable list entries, please report them at https://github.com/DarwinAwardWinner/ido-ubiquitous/issues so I can incorporate them into the defaults for future versions. You can also report any bugs you find in ido-completing-read+.

I'm getting some weird warnings from ido-completing-read+ when Emacs starts.

I've gotten numerous reports about nonsensical warnings produced by this package, such as "free variable" warnings about variables that are most definitely properly declared, or warnings that only appear when ido-completing-read+ is loaded after another unrelated package. For many of these warnings, I've never been able to discover the cause or consistently reproduce the warnings myself, and I've given up trying to figure it out. Please don't report any new bugs about variable warnings unless you can tell me how to consistently reproduce them starting from emacs -Q. If you are an Emacs expert who knows how to fix these warnings, please let me know.

You can see the bug reports about weird warnings here.

What is the "bleeding-edge" branch?

All users should just use the main branch, or better yet, install from MELPA. The bleeding-edge branch is where I test experimental and unfinished features. Because ido-completing-read+ hooks deeply into the bowels of Emacs, a bug in ido-completing-read+ could easily freeze or crash Emacs entirely. Additionally, some bug only show up when ido-completing-read+ is installed and compiled as a package. So I test every new feature myself for some time on this branch before pushing to the main branch. If you report a bug, I might develop a fix for it on the bleeding edge branch and ask then you to try this branch. Otherwise, normal users don't need to think about this branch.

Running the tests

This package comes with a test suite. If you want to run it yourself, first install the Eldev, then use eldev test to run the tests. Please run this test suite before submitting any pull requests, and note in the pull request whether any of the tests fail.

More Repositories

1

mac-pseudo-daemon

Emacs daemon mode that plays nice with Mac OS.
Emacs Lisp
56
star
2

with-simulated-input

Test your interactive elisp functions non-interactively!
Emacs Lisp
38
star
3

rganalysis

A script for adding replaygain tags to music files
Python
31
star
4

CD4-csaw

Reproducible reanalysis of a combined ChIP-Seq & RNA-Seq data set
R
16
star
5

ido-yes-or-no

Use ido to answer yes or no questions.
Emacs Lisp
14
star
6

roll

A command-line dice-rolling simulator for RPGs
Python
13
star
7

screen-sendenv

Modify environment variables in a running screen or tmux session
Python
11
star
8

emacs-named-timer

Simplified timer management for Emacs Lisp
Emacs Lisp
9
star
9

crm-custom

Alternate completing-read-multiple that uses completing-read
Emacs Lisp
9
star
10

transfercoder

Transfer and transcode your music at the same time
Python
9
star
11

dotemacs

My Emacs configuration (contents of ~/.emacs.d/)
Emacs Lisp
9
star
12

mergesam

Automate common sam & bam conversions
Python
7
star
13

git-custom-commands

My extra github commands
Perl
6
star
14

download-youtube-subscriptions

Download your subscribed videos from Youtube
Shell
6
star
15

ido-complete-space-or-hyphen

Make ido completes like built-in M-x does, useful when use smex or use ido to complete other hyphen separated choises
Emacs Lisp
6
star
16

dotemacs-old

My Emacs Configuration
Emacs Lisp
6
star
17

ofxtoolkit

My scripts for munging, merging, and archiving OFX files
Perl
5
star
18

List-Flatten-Recursive

A perl module for flattening lists of lists of lists of lists of ...
Perl
5
star
19

Dist-Zilla-Plugin-CopyFilesFromBuild

Copy specific files after building (for SCM inclusion, etc.)
Perl
5
star
20

fastqident

Guess the quality encoding system used by FASTQ sequence files.
Python
4
star
21

adjust-parens

Indent and dedent Lisp code, automatically adjust close parens
Emacs Lisp
4
star
22

rctutils

A collection various utility functions I have written for data analysis in R
R
3
star
23

mkplaylist

Generate playlists from special music tags
Python
3
star
24

Rprofile

My ~/.Rprofile
Shell
3
star
25

Pod-Weaver-Plugin-EnsureUniqueSections

Ensure that POD has no duplicate section headers.
Perl
2
star
26

cd4-histone-paper-code

Public release of most of the data analysis code for Lamere et. al. 2016
R
2
star
27

Pod-Weaver-Section-WarrantyDisclaimer

Add a standard DISCLAIMER OF WARRANTY section (for your Perl module)
Perl
2
star
28

copytags

Python
2
star
29

python-script-template

A fill-in-the-blank template for writing Python command-line scripts with easy option parsing
Python
2
star
30

memlog

Shell
2
star
31

xls2csv

Extract data from multi-sheet Excel spreadsheets into CSV files
Perl
2
star
32

resume

Scripts to build my resume and supporting files
TeX
2
star
33

Pod-Markdown

Convert POD to Markdown
Perl
2
star
34

Term-DNAColor

Add colors to DNA and RNA sequences in terminal output
Perl
1
star
35

IPC-Open3-System

Perl module to Provide an open3 function with the same syntax as system
Perl
1
star
36

splitloci

Split a SAM file into nonoverlapping read groups
Python
1
star
37

dotdzil

Perl
1
star
38

intemp

A quarantine for incomplete output files
Python
1
star
39

Thesis

The source files for my thesis
TeX
1
star
40

emacs-system-specific-settings

Emacs Lisp
1
star
41

Text-CSV-Euclid

Perl module to provide a csv parser with options specified on the command-line
Perl
1
star
42

piper

Easily set up shell pipelines in Python
Python
1
star
43

nm-actions

Python
1
star
44

Dist-Zilla-Plugin-StaticVersion

Perl
1
star
45

Dist-Zilla-PluginBundle-Author-RTHOMPSON

RTHOMPSON's Dist::Zilla Configuration
Perl
1
star
46

placsupport

Python
1
star
47

Pod-Weaver-PluginBundle-Author-RTHOMPSON

A bundle that implements RTHOMPSON's preferred Pod::Weaver config
Perl
1
star
48

Dist-Zilla-Plugin-CheckVersionIncrement

Perl
1
star
49

hg38-ref

Workflow to download/generate various mapping indices for the human hg38 genome
Python
1
star
50

Dist-Zilla-Plugin-ReadmeMarkdownFromPod

Generate a README.mkdn from the POD of your main_module
Perl
1
star