[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] feature proposal. Kill and yank columns

From: Marco Wahl
Subject: Re: [O] feature proposal. Kill and yank columns
Date: Thu, 28 Apr 2016 12:29:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)


> I know that I can delete columns but I miss a function which would
> *kill* a column,  put it in the some ring (or register) and paste it.
> I do this my marking the content of a column and use kill-rectangle and
> yank-rectangle but I find such a solution which needs the mark,
> cumbersome.

> It also seems a subject which comes up regularly. Is this so difficult
> to implement?

Some time ago I wrote this function:

(defun mw-org-table-mark-column ()
  "Mark the column containing point.
This works only in org tables.

For tables with horizontal lines this function can fail."
  (unless (org-at-table-p) (user-error "Not at a table"))
  (let* ((col (org-table-current-column))
         (beg (org-table-begin))
         (end (org-table-end)))
    (goto-char beg)
    (org-table-goto-column col)
    (re-search-backward "|" nil t)
    (goto-char (1- end))
    (org-table-goto-column (1+ col))
    (re-search-backward "|" nil t)

If you do M-x mw-org-table-mark-column followed by C-x SPACE in a
table-cell you (hopefully) the column gets marked.

This might be a start.

Marco Wahl
GPG: 0x49010A040A3AE6F2

reply via email to

[Prev in Thread] Current Thread [Next in Thread]