emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-orgmode@gnu.org
Subject: Re: how to copy a column of a table (with content)
Date: Thu, 20 Jan 2022 17:22:42 +0100	[thread overview]
Message-ID: <875yqe2x7x.fsf@mat.ucm.es> (raw)
In-Reply-To: 87r192n1ky.fsf@gmail.com

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

Hi Marco
> Uwe Brauer <oub@mat.ucm.es> writes:

> I use the following function occasionally.  Possibly it helps in your case.

> (defun mw-org-table-mark-column ()
>   "Mark the column containing point."
>   (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)
>     (forward-char)))
very nice, !!!

> Copy a column would be:

> 1. Put the cursor into that column.
> 2. M-x mw-org-table-mark-column
> 3. Move the cursor onto the |.  E.g. { C-b }.
> 4. M-x copy-rectangle-as-kill
> 5. Move the cursor to a suitable position in the first line of the table.
> 6. M-x yank-rectangle

> BTW rectangle-mark-mode -- possibly activated with { C-x SPC } -- can
> help with the copy and yank in this case.
Right, I completely forgot that mode! Thanks



> HTH,
very much so. Why not include the code into master?

Uwe 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

      reply	other threads:[~2022-01-20 21:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-20  8:06 how to copy a column of a table (with content) Uwe Brauer
2022-01-20 10:28 ` Marco Wahl
2022-01-20 16:22   ` Uwe Brauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875yqe2x7x.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).