From 034327071f3bf1b03ac090c2500ad5b4beb0887e Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Fri, 31 Jan 2020 17:46:11 +0100 Subject: [PATCH] update csv-mode --- .../csv-mode-autoloads.el | 11 +++-- .../csv-mode-pkg.el | 2 +- .../csv-mode.el | 40 +++++++++++++++---- elpa/csv-mode-readme.txt | 21 ++++++---- 4 files changed, 55 insertions(+), 19 deletions(-) rename elpa/{csv-mode-1.10 => csv-mode-1.11}/csv-mode-autoloads.el (88%) rename elpa/{csv-mode-1.10 => csv-mode-1.11}/csv-mode-pkg.el (80%) rename elpa/{csv-mode-1.10 => csv-mode-1.11}/csv-mode.el (98%) diff --git a/elpa/csv-mode-1.10/csv-mode-autoloads.el b/elpa/csv-mode-1.11/csv-mode-autoloads.el similarity index 88% rename from elpa/csv-mode-1.10/csv-mode-autoloads.el rename to elpa/csv-mode-1.11/csv-mode-autoloads.el index 9ccb8d5d..78d02945 100644 --- a/elpa/csv-mode-1.10/csv-mode-autoloads.el +++ b/elpa/csv-mode-1.11/csv-mode-autoloads.el @@ -1,10 +1,12 @@ ;;; csv-mode-autoloads.el --- automatically extracted autoloads ;; ;;; Code: -(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) + +(add-to-list 'load-path (directory-file-name + (or (file-name-directory #$) (car load-path)))) + -;;;### (autoloads nil "csv-mode" "csv-mode.el" (23994 42604 825270 -;;;;;; 991000)) +;;;### (autoloads nil "csv-mode" "csv-mode.el" (0 0 0 0)) ;;; Generated autoloads from csv-mode.el (autoload 'csv-mode "csv-mode" "\ @@ -54,11 +56,14 @@ Major mode for editing files of tab-separated value type. \(fn)" t nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "csv-mode" '("tsv-" "csv-"))) + ;;;*** ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t +;; coding: utf-8 ;; End: ;;; csv-mode-autoloads.el ends here diff --git a/elpa/csv-mode-1.10/csv-mode-pkg.el b/elpa/csv-mode-1.11/csv-mode-pkg.el similarity index 80% rename from elpa/csv-mode-1.10/csv-mode-pkg.el rename to elpa/csv-mode-1.11/csv-mode-pkg.el index 9164a3fd..656faee0 100644 --- a/elpa/csv-mode-1.10/csv-mode-pkg.el +++ b/elpa/csv-mode-1.11/csv-mode-pkg.el @@ -1,2 +1,2 @@ ;;; -*- no-byte-compile: t -*- -(define-package "csv-mode" "1.10" "Major mode for editing comma/char separated values" '((emacs "24.1") (cl-lib "0.5")) :url "http://elpa.gnu.org/packages/csv-mode.html" :keywords '("convenience") :authors '(("\"Francis J. Wright\"" . "F.J.Wright@qmul.ac.uk")) :maintainer '(nil . "emacs-devel@gnu.org")) +(define-package "csv-mode" "1.11" "Major mode for editing comma/char separated values" '((emacs "24.1") (cl-lib "0.5")) :url "http://elpa.gnu.org/packages/csv-mode.html" :keywords '("convenience") :authors '(("\"Francis J. Wright\"" . "F.J.Wright@qmul.ac.uk")) :maintainer '(nil . "emacs-devel@gnu.org")) diff --git a/elpa/csv-mode-1.10/csv-mode.el b/elpa/csv-mode-1.11/csv-mode.el similarity index 98% rename from elpa/csv-mode-1.10/csv-mode.el rename to elpa/csv-mode-1.11/csv-mode.el index f837f6ad..0db04445 100644 --- a/elpa/csv-mode-1.10/csv-mode.el +++ b/elpa/csv-mode-1.11/csv-mode.el @@ -1,10 +1,10 @@ ;;; csv-mode.el --- Major mode for editing comma/char separated values -*- lexical-binding: t -*- -;; Copyright (C) 2003, 2004, 2012-2019 Free Software Foundation, Inc +;; Copyright (C) 2003, 2004, 2012-2020 Free Software Foundation, Inc ;; Author: "Francis J. Wright" ;; Maintainer: emacs-devel@gnu.org -;; Version: 1.10 +;; Version: 1.11 ;; Package-Requires: ((emacs "24.1") (cl-lib "0.5")) ;; Keywords: convenience @@ -273,6 +273,8 @@ Number of spaces used by `csv-align-mode' and `csv-align-fields' after separator (define-key map [(control ?c) (control ?r)] 'csv-reverse-region) (define-key map [(control ?c) (control ?n)] 'csv-sort-numeric-fields) (define-key map [(control ?c) (control ?s)] 'csv-sort-fields) + (define-key map "\t" #'csv-tab-command) + (define-key map [backtab] #'csv-backtab-command) map)) ;;;###autoload @@ -657,17 +659,17 @@ point or marker arguments, BEG and END, delimiting the region." ;;; Moving by field ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defsubst csv-end-of-field () +(defun csv-end-of-field () "Skip forward over one field." (skip-chars-forward " ") - (if (eq (char-syntax (following-char)) ?\") + (if (memq (char-syntax (following-char)) csv-field-quotes) (goto-char (scan-sexps (point) 1))) (skip-chars-forward csv--skip-chars)) -(defsubst csv-beginning-of-field () +(defun csv-beginning-of-field () "Skip backward over one field." (skip-syntax-backward " ") - (if (eq (char-syntax (preceding-char)) ?\") + (if (memq (char-syntax (preceding-char)) csv-field-quotes) (goto-char (scan-sexps (point) -1))) (skip-chars-backward csv--skip-chars)) @@ -704,9 +706,25 @@ move forward across N fields." (if (memq (preceding-char) csv-separator-chars) (backward-char)) (csv-beginning-of-field)))) +(defun csv-tab-command () + "Skip to the next field on the same line. +Create a new field at end of line, if needed." + (interactive) + (skip-chars-forward csv--skip-chars) + (if (eolp) + (insert (car csv-separators)) + (forward-char 1))) + +(defun csv-backtab-command () + "Skip to the beginning of the previous field." + (interactive) + (skip-chars-backward csv--skip-chars) + (forward-char -1) + (skip-chars-backward csv--skip-chars)) + (defun csv-sort-skip-fields (n &optional yank) "Position point at the beginning of field N on the current line. -Fields are separated by `csv-separators'\; null terminal field allowed. +Fields are separated by `csv-separators'; null terminal field allowed. Assumes point is initially at the beginning of the line. YANK non-nil allows N to be greater than the number of fields, in which case extend the record as necessary." @@ -1715,6 +1733,14 @@ setting works better)." ;;;; ChangeLog: +;; 2020-01-30 Stefan Monnier +;; +;; * packages/csv-mode/csv-mode.el: New TAB/backtab commands +;; +;; (csv-tab-command, csv-backtab-command): New commands. +;; (csv-mode-map): Bind them. +;; (csv-end-of-field, csv-beginning-of-field): Obey csv-field-quotes. +;; ;; 2019-10-22 Stefan Monnier ;; ;; * packages/csv-mode/csv-mode.el (csv-align--cursor-truncated): Fix C-e diff --git a/elpa/csv-mode-readme.txt b/elpa/csv-mode-readme.txt index 7d559931..372cc4d8 100644 --- a/elpa/csv-mode-readme.txt +++ b/elpa/csv-mode-readme.txt @@ -1,6 +1,7 @@ This package implements CSV mode, a major mode for editing records in a generalized CSV (character-separated values) format. It binds -finds with prefix ".csv" to `csv-mode' in `auto-mode-alist'. +files with prefix ".csv" to `csv-mode' (and ".tsv" to `tsv-mode') in +`auto-mode-alist'. In CSV mode, the following commands are available: @@ -17,10 +18,13 @@ In CSV mode, the following commands are available: multiple killed fields can be yanked only as a fixed group equivalent to a single field. -- C-c C-a (`csv-align-fields') aligns fields into columns - -- C-c C-u (`csv-unalign-fields') undoes such alignment; separators - can be hidden within aligned records. +- `csv-align-mode' keeps fields visually aligned, on-the-fly. + It truncates fields to a maximum width that can be changed per-column + with `csv-align-set-column-width'. + Alternatively, C-c C-a (`csv-align-fields') aligns fields into columns + and C-c C-u (`csv-unalign-fields') undoes such alignment; + separators can be hidden within aligned records (controlled by + `csv-invisibility-default' and `csv-toggle-invisibility'). - C-c C-t (`csv-transpose') interchanges rows and columns. For details, see the documentation for the individual commands. @@ -31,9 +35,10 @@ characters, specified by the value of the customizable user option characters (and must if they contain separator characters). This implementation supports quoted fields, where the quote characters allowed are specified by the value of the customizable user option -`csv-field-quotes'. By default, the only separator is a comma and -the only field quote is a double quote. These user options can be -changed ONLY by customizing them, e.g. via M-x customize-variable. +`csv-field-quotes'. By default, the both commas and tabs are considered +as separators and the only field quote is a double quote. +These user options can be changed ONLY by customizing them, e.g. via M-x +customize-variable. CSV mode commands ignore blank lines and comment lines beginning with the value of the buffer local variable `csv-comment-start', -- 2.47.3