[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/jinx 5a858f2404 2/3: Ignore single quotes and apostroph
From: |
ELPA Syncer |
Subject: |
[elpa] externals/jinx 5a858f2404 2/3: Ignore single quotes and apostrophes at the beginning and end of words |
Date: |
Wed, 29 Mar 2023 16:58:11 -0400 (EDT) |
branch: externals/jinx
commit 5a858f240405032061af9ea3f0f453ef95e0c57a
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Ignore single quotes and apostrophes at the beginning and end of words
---
CHANGELOG.org | 2 ++
jinx.el | 5 ++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.org b/CHANGELOG.org
index 4481081c89..6d548e0435 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -10,6 +10,8 @@
which can be used to go back to the original position.
- Add =jinx-mode-map= to make it easy to bind keys if =jinx-mode= is enabled.
The
map is empty by default.
+- Ignore single quotes and apostrophes at the beginning and end of words.
Please
+ provide feedback if this is a reasonable approach.
* Version 0.4 (2023-03-27)
diff --git a/jinx.el b/jinx.el
index ada1a96ed8..bc05306541 100644
--- a/jinx.el
+++ b/jinx.el
@@ -361,7 +361,10 @@ Returns a pair of updated (START END) bounds."
(while (re-search-forward "\\<\\w+\\>" end t)
(let ((word-start (match-beginning 0))
(word-end (point)))
- ;; No quote or apostrophe at end
+ ;; No quote or apostrophe at start or end
+ (while (and (< word-start word-end)
+ (let ((c (char-after word-start))) (or (= c 39)
(= c 8217))))
+ (cl-incf word-start))
(while (and (< word-start word-end)
(let ((c (char-before word-end))) (or (= c 39)
(= c 8217))))
(cl-decf word-end))