Function: csv--separator-candidates

csv--separator-candidates is a natively compiled function defined in csv-mode.el.

Signature

(csv--separator-candidates TEXT &optional CUTOFF)

Documentation

Return a list of candidate CSV separators in TEXT.

When CUTOFF is passed, look only at the first CUTOFF number of characters.

Source Code

;; Defined in /nix/store/3gmjnyw9n226b7k7jamikx980vf8267p-emacs-packages-deps/share/emacs/site-lisp/elpa/csv-mode-1.27/csv-mode.el
(defun csv--separator-candidates (text &optional cutoff)
  "Return a list of candidate CSV separators in TEXT.
When CUTOFF is passed, look only at the first CUTOFF number of characters."
  (let ((chars (make-hash-table)))
    (dolist (c (string-to-list
                (if cutoff
                    (substring text 0 (min cutoff (length text)))
                  text)))
      (when (and (not (gethash c chars))
                 (or (= c ?\t)
                     (= c ?\C-_)
                     (and (not (member c '(?. ?/ ?\" ?')))
                          (not (= c (string-to-char csv-comment-start)))
                          (not (member (get-char-code-property c 'general-category)
                                       '(Lu Ll Lt Lm Lo Nd Nl No Ps Pe Cc Co))))))
        (puthash c t chars)))
    (hash-table-keys chars)))