aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Pierre Courtieu <courtieu@lri.fr>2015-04-27 11:30:56 +0000
committerGravatar Pierre Courtieu <courtieu@lri.fr>2015-04-27 11:30:56 +0000
commit2f56971066f672292b99275e52d2921d12b8a1da (patch)
tree90df2b32cfa82df915130046485fbd11c42e3ed0
parent776bdbeda4bc9cf7f4e1746f316b2940d7b1fda0 (diff)
Fixed at-point detection (bis).
-rw-r--r--coq/coq.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/coq/coq.el b/coq/coq.el
index 42ceb2e3..45a0c7c1 100644
--- a/coq/coq.el
+++ b/coq/coq.el
@@ -727,18 +727,23 @@ Return nil if S is nil."
s))
(defun coq-is-symbol-or-punct (c)
- (or (equal (char-syntax c) ?\.) (equal (char-syntax c) ?\_)))
+ "Return non nil if character C is a punctuation or a symbol constituent.
+If C is nil, return nil."
+ (when c
+ (or (equal (char-syntax c) ?\.) (equal (char-syntax c) ?\_))))
(defun coq-grab-punctuation-left (pos)
+ "Return a string made of punctuations chars found immediately before position POS."
(let ((res nil)
(currpos pos))
- (while (and (coq-is-symbol-or-punct (char-before currpos)))
+ (while (coq-is-symbol-or-punct (char-before currpos))
(setq res (concat (char-to-string (char-before currpos)) res))
(setq currpos (- currpos 1)))
res))
(defun coq-grab-punctuation-right (pos)
+ "Return a string made of punctuations chars found immediately after position POS."
(let ((res nil)
(currpos pos))
(while (coq-is-symbol-or-punct (char-after currpos))