branch: externals/csv-mode commit c7cbb79cc96812b1bb7b53111de2a55e742e6026 Author: Lars Ingebrigtsen <la...@gnus.org> Commit: Lars Ingebrigtsen <la...@gnus.org>
Fix problem when using columns containing % in csv-mode header lines * csv-mode.el (csv--compute-header-string): Quote percentages before using them (otherwise they'll be interpreted as format directives) (bug#50498). --- csv-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/csv-mode.el b/csv-mode.el index ecc33a7..8ba7161 100644 --- a/csv-mode.el +++ b/csv-mode.el @@ -1370,7 +1370,8 @@ If there is already a header line, then unset the header line." (jit-lock-fontify-now (point) (line-end-position)) ;; Not sure why it is sometimes nil! (move-to-column (or csv--header-hscroll 0)) - (let ((str (buffer-substring (point) (line-end-position))) + (let ((str (replace-regexp-in-string + "%" "%%" (buffer-substring (point) (line-end-position)))) (i 0)) (while (and i (< i (length str))) (let ((prop (get-text-property i 'display str)))