Skip to content

Commit

Permalink
Drop support for 26.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Dec 10, 2023
1 parent 2aa643c commit 2ff39a1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
emacs-version:
- 26.3
- 27.2
- 28.2
- 29.1
Expand Down
2 changes: 1 addition & 1 deletion Eask
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
(source 'gnu)
(source 'jcs-elpa)

(depends-on "emacs" "26.1")
(depends-on "emacs" "27.1")
(depends-on "csv-mode")

(setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432
19 changes: 13 additions & 6 deletions rainbow-csv.el
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
;; Maintainer: Shen, Jen-Chieh <jcs090218@gmail.com>
;; URL: https://github.com/emacs-vs/rainbow-csv
;; Version: 0.1.0
;; Package-Requires: ((emacs "26.1") (csv-mode "1.22"))
;; Package-Requires: ((emacs "27.1") (csv-mode "1.22"))
;; Keywords: convenience csv

;; This file is not part of GNU Emacs.
Expand Down Expand Up @@ -122,13 +122,22 @@
(line-beginning-position) (line-end-position))))
(n (1+ n)))
(dotimes (i n)
(let ((r (format "^\\([^%c\n]*\"\\(?:[^\"\\]+\\|\\\\\\(?:.\\|\\)\\)*[\"]+[%c\n]+\\)\\{%d\\}"
(let ((r (format "^\\([^%c\"\n]*\"\\(?:[^\"\\]+\\|\\\\\\(?:.\\|\\)\\)*[\"]+[%c]+\\)\\{%d\\}"
separator separator (1+ i)))
(color (or (nth i rainbow-csv-colors)
(rainbow-csv--rgb))))
(setq csv-font-lock-keywords
(append csv-font-lock-keywords
`((,r (1 '(face (:foreground ,color)) prepend t))))))))
;; For last column!
(let* ((r (format "[%c]+.*\\(\"\\(?:[^\"\\]+\\|\\\\\\(?:.\\|\\)\\)*[\"]+[\n]+\\)\\{%d\\}"
separator 1))
(i n)
(color (or (nth i rainbow-csv-colors)
(rainbow-csv--rgb))))
(setq csv-font-lock-keywords
(append csv-font-lock-keywords
`((,r (1 '(face (:foreground ,color)) prepend t))))))
(font-lock-refresh-defaults))

;;
Expand All @@ -137,10 +146,8 @@

(defun rainbow-csv--post-self-insert (&rest _)
"Post insert."
(when (memq last-command-event '(?, ?\"))
(message "update once!")
;;(rainbow-csv-highlight)
))
(when (memq last-command-event '(?,))
(rainbow-csv-highlight)))

(provide 'rainbow-csv)
;;; rainbow-csv.el ends here

0 comments on commit 2ff39a1

Please sign in to comment.