[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/cape 75cb8c799a 071/146: Unify cape-file and cape-file-
From: |
ELPA Syncer |
Subject: |
[elpa] externals/cape 75cb8c799a 071/146: Unify cape-file and cape-file-capf |
Date: |
Sun, 9 Jan 2022 20:57:43 -0500 (EST) |
branch: externals/cape
commit 75cb8c799a4eb620019a5386112d9da72765b238
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Unify cape-file and cape-file-capf
---
cape.el | 28 +++++++++++++---------------
1 file changed, 13 insertions(+), 15 deletions(-)
diff --git a/cape.el b/cape.el
index e8a6f79608..5671fdd956 100644
--- a/cape.el
+++ b/cape.el
@@ -369,23 +369,21 @@ SORT should be nil to disable sorting."
(defvar cape--file-properties
(list :annotation-function (lambda (s) (if (string-suffix-p "/" s) " Folder"
" File"))
:company-kind (lambda (s) (if (string-suffix-p "/" s) 'folder 'file)))
- "Completion extra properties for `cape-file-capf'.")
+ "Completion extra properties for `cape-file'.")
;;;###autoload
-(defun cape-file-capf ()
- "File name completion-at-point-function."
- (when-let (bounds (bounds-of-thing-at-point 'filename))
- (let ((file (buffer-substring (car bounds) (cdr bounds))))
- (when (and (string-match-p "/" file) (file-exists-p (file-name-directory
file)))
- `(,(car bounds) ,(cdr bounds) ,#'read-file-name-internal
- :company-prefix-length ,(and (not (equal file "/")) (string-suffix-p
"/" file))
- :exclusive no ,@cape--file-properties)))))
-
-;;;###autoload
-(defun cape-file ()
- "Complete file name at point."
- (interactive)
- (cape--complete-thing 'filename #'read-file-name-internal
cape--file-properties))
+(defun cape-file (&optional interactive)
+ "Complete file name at point.
+If INTERACTIVE is nil the function acts like a capf."
+ (interactive (list t))
+ (if interactive
+ (cape--complete-thing 'filename #'read-file-name-internal
cape--file-properties)
+ (when-let (bounds (bounds-of-thing-at-point 'filename))
+ (let ((file (buffer-substring (car bounds) (cdr bounds))))
+ (when (and (string-match-p "/" file) (file-exists-p
(file-name-directory file)))
+ `(,(car bounds) ,(cdr bounds) ,#'read-file-name-internal
+ :company-prefix-length ,(and (not (equal file "/"))
(string-suffix-p "/" file))
+ :exclusive no ,@cape--file-properties))))))
(defvar cape--symbol-properties
(list :annotation-function (lambda (_) " Symbol")
- [elpa] externals/cape c8c0a9f9a6 134/146: Simplify, (continued)
- [elpa] externals/cape c8c0a9f9a6 134/146: Simplify, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 5319e343bb 136/146: Improve repair function, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 12b00151d1 143/146: Improve and simplify cape-dabbrev, ELPA Syncer, 2022/01/09
- [elpa] externals/cape be2014538a 144/146: cape-dabbrev: Use thing-at-point-looking-at, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 5ccece0e34 146/146: Add to GNU ELPA, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 700c9d7bc2 137/146: Remove cape-repair-misbehaving-capf, ELPA Syncer, 2022/01/09
- [elpa] externals/cape bc1c1ee9fc 140/146: Make cape-tex etc less aggressive, add cape-tex-prefix-required variable, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 8726bc7246 138/146: cape--interactive: Simplify, ELPA Syncer, 2022/01/09
- [elpa] externals/cape ac65f2acdf 048/146: Add autoloads, renamings, README, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 0a05e51d2a 053/146: Add cape-capf-with-predicate (See #9), ELPA Syncer, 2022/01/09
- [elpa] externals/cape 75cb8c799a 071/146: Unify cape-file and cape-file-capf,
ELPA Syncer <=
- [elpa] externals/cape 1d72f84b64 046/146: Add cape-capf-with-properties and cape-silent-capf, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 693a376913 054/146: Revert "Add cape-capf-with-predicate (See #9)", ELPA Syncer, 2022/01/09
- [elpa] externals/cape 8a2cc4c7bb 060/146: Add completion categories, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 496bb4a5e4 065/146: Rename function, ELPA Syncer, 2022/01/09
- [elpa] externals/cape ba85197981 075/146: Update README, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 202345e954 083/146: cape-capf-with-properties: Add support for :sort and :category, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 15491cef1a 087/146: Add link to Emacs, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 659f710682 089/146: Add comment, ELPA Syncer, 2022/01/09
- [elpa] externals/cape ceca3a3d06 077/146: Expand readme, ELPA Syncer, 2022/01/09
- [elpa] externals/cape c57b01e982 091/146: Improve dynamic table support of cape-super-capf, ELPA Syncer, 2022/01/09