Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove selectrum-candidate-full property #403

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ The format is based on [Keep a Changelog].
your configuration or also adjust it to `auto`. For configuring the
window height you should use the new `selectrum-max-window-height`
option now ([#305]).
* The special text property `selectrum-candidate-full` to change the
canonical representation of a candidate has been removed ([#403]).

### Features
* The new option `selectrum-max-window-height` can now be used to
Expand Down Expand Up @@ -333,6 +335,7 @@ The format is based on [Keep a Changelog].
[#398]: https://github.com/raxod502/selectrum/pull/398
[#401]: https://github.com/raxod502/selectrum/pull/401
[#402]: https://github.com/raxod502/selectrum/pull/402
[#403]: https://github.com/raxod502/selectrum/pull/403

## 3.0 (released 2020-10-20)
### Breaking changes
Expand Down
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -547,13 +547,6 @@ which may be applied to candidates using `propertize`:
but it's postpended instead of prepended when the candidate is
dispalyed. This is used, for example, to display candidate
annotations under `completion-in-region`.
* `selectrum-candidate-full`: controls how the candidate appears in
the user input area of the minibuffer. If this property is present,
then it specifies the canonical representation of the candidate.
This is the value that will be returned from `selectrum-read`. It is
also the value that will be inserted when the user presses `TAB`. In
`find-file`, the canonical representation of each candidate is its
absolute path on the filesystem.

Besides, we have:

Expand Down
10 changes: 5 additions & 5 deletions selectrum.el
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ behavior."

(defun selectrum--get-full (candidate)
"Get full form of CANDIDATE."
(or (get-text-property 0 'selectrum-candidate-full candidate)
(or (get-text-property 0 'selectrum--candidate-full candidate)
(when minibuffer-completing-file-name
(if (and selectrum--current-candidate-index
(< selectrum--current-candidate-index 0))
Expand Down Expand Up @@ -2306,7 +2306,7 @@ Selectrum unless RAW is non-nil."
"./" match))
(full (concat prefix path suffix)))
(propertize path
'selectrum-candidate-full
'selectrum--candidate-full
full
'selectrum--partial
prefix))))))))
Expand All @@ -2322,9 +2322,9 @@ For STRING, CANDS, PRED and POINT see
(cands (cl-loop for cand in cands
collect
(propertize (concat prefix cand)
'selectrum-candidate-full
'selectrum--candidate-full
(get-text-property
0 'selectrum-candidate-full cand))))
0 'selectrum--candidate-full cand))))
(res (selectrum--partial-file-completions string cands pred 'raw)))
(cl-loop for cand in res
collect (substring cand len)))))
Expand Down Expand Up @@ -2372,7 +2372,7 @@ For PROMPT, COLLECTION, PREDICATE, REQUIRE-MATCH, INITIAL-INPUT,
collect
(propertize
var
'selectrum-candidate-full
'selectrum--candidate-full
(concat dir val)
'selectrum-candidate-display-right-margin
val)))
Expand Down