From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marco Wahl Subject: Re: feature proposal. Kill and yank columns Date: Thu, 28 Apr 2016 12:29:43 +0200 Message-ID: <84y47y58mg.fsf@gmail.com> References: <87ziset6iq.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avjCs-0002FV-PZ for emacs-orgmode@gnu.org; Thu, 28 Apr 2016 06:30:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avjCp-0004cJ-JU for emacs-orgmode@gnu.org; Thu, 28 Apr 2016 06:30:02 -0400 Received: from plane.gmane.org ([80.91.229.3]:42894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avjCp-0004bF-DW for emacs-orgmode@gnu.org; Thu, 28 Apr 2016 06:29:59 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1avjCk-0000Ev-QO for emacs-orgmode@gnu.org; Thu, 28 Apr 2016 12:29:54 +0200 Received: from x5f702968.dyn.telefonica.de ([95.112.41.104]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Apr 2016 12:29:54 +0200 Received: from marcowahlsoft by x5f702968.dyn.telefonica.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Apr 2016 12:29:54 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Hi! > 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." (interactive) (unless (org-at-table-p) (user-error "Not at a table")) (org-table-find-dataline) (org-table-check-inside-data-field) (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) (push-mark) (goto-char (1- end)) (org-table-goto-column (1+ col)) (re-search-backward "|" nil t) (exchange-point-and-mark))) 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. HTH, -- Marco Wahl GPG: 0x49010A040A3AE6F2