From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Richard Subject: Re: How to set C-o back to open-line? Date: Fri, 17 May 2013 10:58:37 +0200 Message-ID: <87ehd6ugn6.fsf@yahoo.fr> References: <87k3mysg8c.fsf@earlgrey.lan> <20130516231012.GB8732@kuru.dyndns-at-home.com> <87ip2is5ku.fsf@earlgrey.lan> <5195C5C5.3050705@easy-emacs.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdGk0-0000Gn-Df for emacs-orgmode@gnu.org; Fri, 17 May 2013 05:14:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UdGjv-000171-NW for emacs-orgmode@gnu.org; Fri, 17 May 2013 05:14:20 -0400 Received: from mxin.ulb.ac.be ([164.15.128.112]:9863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdGUm-0004F6-UB for emacs-orgmode@gnu.org; Fri, 17 May 2013 04:58:37 -0400 In-Reply-To: <5195C5C5.3050705@easy-emacs.de> ("Andreas \=\?utf-8\?Q\?R\=C3\=B6h\?\= \=\?utf-8\?Q\?ler\=22's\?\= message of "Fri, 17 May 2013 07:53:09 +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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Andreas =?utf-8?Q?R=C3=B6hler?= Cc: emacs-orgmode@gnu.org Andreas R=C3=B6hler writes: > (defun org-open-line (n) > "Insert a new row in tables, call `open-line' elsewhere. > With \C-u NUMBER `open-line' is called the common way also in table conte= xt" > (interactive "*P") > (cond (n > (open-line (prefix-numeric-value n))) > ((org-at-table-p) > (org-table-insert-row)) > (t (open-line (prefix-numeric-value n))))) I think that calling open-line in a table only makes sense at bol, so I'd suggest this : (defun org-open-line (n) "Insert a new row in tables, call `open-line' elsewhere. As an exception, if point is at the beginning of a line,`open-line' is called." (interactive "*p") (if (and (not (bolp)) (org-at-table-p)) (org-table-insert-row) (open-line n))) or even the following, so as to use the argument also in tables. (defun org-open-line (n) "Insert a new row in tables, call `open-line' elsewhere. As an exception, if point is at the beginning of a line,`open-line' is called. The argument N is the number of rows or lines to insert." (interactive "*p") (if (and (not (bolp)) (org-at-table-p)) (dotimes (_ n) (org-table-insert-row)) (open-line n))) --=20 Nico.