aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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))