[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: project--completing-read-strict breaks ada-mode project completion t
From: |
Stephen Leake |
Subject: |
Re: project--completing-read-strict breaks ada-mode project completion table |
Date: |
Thu, 17 Jan 2019 15:17:40 -0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (windows-nt) |
Stephen Leake <address@hidden> writes:
> These are now in the ELPA master branch:
>
> elpa/packages/ada-mode/ada-project.el
> elpa/packages/ada-mode/env-package.el
> elpa/packages/path-iterator/path-iterator.el
> elpa/packages/uniquify-files/uniquify-files.el
Attached is an example project for emacs source to play with. To use it,
eval the following in emacs master *scratch* (adjust paths);
----------------
(add-to-list 'load-path "c:/Projects/elpa/packages/uniquify-files")
(add-to-list 'load-path "c:/Projects/elpa/packages/path-iterator")
(load-file "c:/Projects/emacs_stephe.main/projects/emacs-project.el")
;; revert to emacs-26 version of project--completing-read-strict
;; (skip this to show the problem with the master version)
(defun project--completing-read-strict (prompt
collection &optional predicate
hist default inherit-input-method)
;; Tried both expanding the default before showing the prompt, and
;; removing it when it has no matches. Neither seems natural
;; enough. Removal is confusing; early expansion makes the prompt
;; too long.
(let* ((new-prompt (if default
(format "%s (default %s): " prompt default)
(format "%s: " prompt)))
(res (completing-read new-prompt
collection predicate t
nil hist default inherit-input-method)))
(if (and (equal res default)
(not (test-completion res collection predicate)))
(completing-read (format "%s: " prompt)
collection predicate t res hist nil
inherit-input-method)
res)))
(find-file "c:/Projects/emacs/master/lisp/files.el")
-----------------
Then type "M-x project-find-file", followed by "proje" <tab> <tab>.
Or use icomplete-mode, use C-. , C-, to rotate completions.
There's a bug in path-iterator; I've set :ignore-function to ignore any
dir under ".git", but they are showing up anyway. But that demonstrates
how non-unique file names are handled, so it's good for this demo.
--
-- Stephe
emacs-project.el
Description: application/emacs-lisp
- Making project-files the "canonical" generic, was: Re: [Emacs-diffs] master 55ec674: * lisp/multifile.el: New file, extracted from etags.el, Dmitry Gutov, 2019/01/11
- Re: Making project-files the "canonical" generic, Stephen Leake, 2019/01/12
- Re: Making project-files the "canonical" generic, Dmitry Gutov, 2019/01/12
- Re: Making project-files the "canonical" generic, Stephen Leake, 2019/01/14
- Re: Making project-files the "canonical" generic, Stefan Monnier, 2019/01/16
- Re: Making project-files the "canonical" generic, Dmitry Gutov, 2019/01/16
- Re: Making project-files the "canonical" generic, Stefan Monnier, 2019/01/17
- Re: Making project-files the "canonical" generic, Dmitry Gutov, 2019/01/17
- project--completing-read-strict breaks ada-mode project completion table, Stephen Leake, 2019/01/16
- Re: project--completing-read-strict breaks ada-mode project completion table, Stephen Leake, 2019/01/16
- Re: project--completing-read-strict breaks ada-mode project completion table,
Stephen Leake <=
- Re: project--completing-read-strict breaks ada-mode project completion table, Dmitry Gutov, 2019/01/17
- Re: project--completing-read-strict breaks ada-mode project completion table, Stephen Leake, 2019/01/18
- Re: project--completing-read-strict breaks ada-mode project completion table, Dmitry Gutov, 2019/01/19
- Re: project--completing-read-strict breaks ada-mode project completion table, Stephen Leake, 2019/01/20
- Re: project--completing-read-strict breaks ada-mode project completion table, Dmitry Gutov, 2019/01/16
- Re: project--completing-read-strict breaks ada-mode project completion table, Stefan Monnier, 2019/01/17
- Re: project--completing-read-strict breaks ada-mode project completion table, John Yates, 2019/01/17
- Re: project--completing-read-strict breaks ada-mode project completion table, Dmitry Gutov, 2019/01/17
- Re: project--completing-read-strict breaks ada-mode project completion table, Stefan Monnier, 2019/01/17
- Re: project--completing-read-strict breaks ada-mode project completion table, Dmitry Gutov, 2019/01/18