diff options
author | Pierre Courtieu <courtieu@lri.fr> | 2015-04-27 11:30:56 +0000 |
---|---|---|
committer | Pierre Courtieu <courtieu@lri.fr> | 2015-04-27 11:30:56 +0000 |
commit | 2f56971066f672292b99275e52d2921d12b8a1da (patch) | |
tree | 90df2b32cfa82df915130046485fbd11c42e3ed0 | |
parent | 776bdbeda4bc9cf7f4e1746f316b2940d7b1fda0 (diff) |
Fixed at-point detection (bis).
-rw-r--r-- | coq/coq.el | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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)) |