[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/cape 9defa71303 142/146: cape-dabbrev: Add cape-dabbrev
From: |
ELPA Syncer |
Subject: |
[elpa] externals/cape 9defa71303 142/146: cape-dabbrev: Add cape-dabbrev-forbid-space |
Date: |
Sun, 9 Jan 2022 20:57:49 -0500 (EST) |
branch: externals/cape
commit 9defa71303aa2ec2e1c430b7e6f02bbf10da3934
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
cape-dabbrev: Add cape-dabbrev-forbid-space
Ensure that the abbreviation at point is limited to the current line
---
cape.el | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/cape.el b/cape.el
index cbfbc37279..5dae916e1d 100644
--- a/cape.el
+++ b/cape.el
@@ -64,6 +64,10 @@
"Minimum length of dabbrev expansions."
:type 'integer)
+(defcustom cape-dabbrev-forbid-space t
+ "Forbid space in dabbrev expansions."
+ :type 'boolean)
+
(defcustom cape-dabbrev-check-other-buffers t
"Buffers to check for dabbrev."
:type 'boolean)
@@ -490,17 +494,20 @@ If INTERACTIVE is nil the function acts like a capf."
If INTERACTIVE is nil the function acts like a capf."
(interactive (list t))
(if interactive
- (let ((cape-dabbrev-min-length 0))
+ (let ((cape-dabbrev-min-length 0)
+ cape-dabbrev-forbid-space)
(cape--interactive #'cape-dabbrev))
(require 'dabbrev)
(cape--dabbrev-reset)
- (let ((abbrev (ignore-errors (dabbrev--abbrev-at-point))) beg end)
- (when (and abbrev (not (string-match-p "\\s-" abbrev)))
- (save-excursion
- (search-backward abbrev)
- (setq beg (point))
- (search-forward abbrev)
- (setq end (point)))
+ (let ((abbrev (ignore-errors (dabbrev--abbrev-at-point)))
+ (beg (line-beginning-position))
+ (end (line-end-position)))
+ (when (and abbrev
+ (not (and cape-dabbrev-forbid-space (string-match-p "\\s-"
abbrev)))
+ (save-excursion
+ (setq beg (search-backward abbrev beg 'noerror)
+ end (search-forward abbrev end 'noerror))
+ (and beg end)))
`(,beg ,end
,(cape--table-with-properties
;; Use equal, if candidates must be longer than
cape-dabbrev-min-length.
- [elpa] externals/cape 1e73d032e4 125/146: Fix compilation error (Fix #16), (continued)
- [elpa] externals/cape 1e73d032e4 125/146: Fix compilation error (Fix #16), ELPA Syncer, 2022/01/09
- [elpa] externals/cape 89aaca7789 128/146: Protect cape--char-translation from macro expansion, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 399fdad016 122/146: cape-tex/sgml: Add docsig, improve parsing of describe-input-method, ELPA Syncer, 2022/01/09
- [elpa] externals/cape c2db8ce4d9 127/146: Expand docstrings, ELPA Syncer, 2022/01/09
- [elpa] externals/cape ab91f727fb 126/146: cape-tex/sgml: Filter candidates during compilation, ELPA Syncer, 2022/01/09
- [elpa] externals/cape bb1921b624 130/146: Add cape-repair-misbehaving-capf, ELPA Syncer, 2022/01/09
- [elpa] externals/cape c442f055dd 132/146: Blurb, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 3495692f4c 133/146: Expand README, ELPA Syncer, 2022/01/09
- [elpa] externals/cape ba24e62961 139/146: README: Expand cape-super-capf documentation, ELPA Syncer, 2022/01/09
- [elpa] externals/cape bcf2fe1bdc 141/146: Version 0.4, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 9defa71303 142/146: cape-dabbrev: Add cape-dabbrev-forbid-space,
ELPA Syncer <=
- [elpa] externals/cape c629043156 145/146: cape-abbrev: Take all abbrev tables into account (Fix #19), ELPA Syncer, 2022/01/09