From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: Bug in org-table-convert-region? Date: Tue, 28 May 2013 11:03:33 +0200 Message-ID: <87vc63easa.fsf@gmail.com> References: <87vc64vxjy.fsf@gmail.com> <8638t7she1.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhFoz-0000bu-NL for emacs-orgmode@gnu.org; Tue, 28 May 2013 05:04:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhFop-0006Bd-V9 for emacs-orgmode@gnu.org; Tue, 28 May 2013 05:03:57 -0400 Received: from plane.gmane.org ([80.91.229.3]:45379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhFop-0006BL-OA for emacs-orgmode@gnu.org; Tue, 28 May 2013 05:03:47 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UhFon-0003Sn-VF for emacs-orgmode@gnu.org; Tue, 28 May 2013 11:03:45 +0200 Received: from g231106097.adsl.alicedsl.de ([92.231.106.97]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 May 2013 11:03:45 +0200 Received: from tjolitz by g231106097.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 May 2013 11:03:45 +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: emacs-orgmode@gnu.org "Sebastien Vauban" writes: Hi Sebastien, [...] >> From the comment-string: >> >> ,----------------------------------------------------------------------- >> | (org-table-convert-region BEG0 END0 &optional SEPARATOR) >> | >> | Convert region to a table.[...] >> | SEPARATOR specifies the field separator in the lines. It can have the >> | following values: >> | >> | '(4) Use the comma as a field separator >> | '(16) Use a TAB as field separator >> | integer When a number, use that many spaces as field separator >> | nil When nil, the command tries to be smart and figure out the >> `----------------------------------------------------------------------- >> Looks like a bug in the argument handling? > > I don't have an answer, but one extra question (which popped up when reading > your analysis): how does Emacs see the difference between `C-u' and `C-u 4'? > > That is, how to differentiate "Use the comma as a field separator" from "Use > 4 spaces as field separator"? The answer is here: >> and from the elisp manual: >> >> ,----------------------------------------------------------------------- >> | Here are the results of calling display-prefix with various raw prefix >> | arguments: >> | >> | C-u M-x display-prefix -| (4) >> | >> | C-u C-u M-x display-prefix -| (16) >> | >> | C-u 3 M-x display-prefix -| 3 >> `----------------------------------------------------------------------- and in the (interactive "rP") specification: ,------------------------------------------------------------------------- | ‘P’ | | The raw prefix argument. (Note that this ‘P’ is upper case.) No I/O. | | ‘r’ | | Point and the mark, as two numeric arguments, smallest first. This | is the only code letter that specifies two successive arguments | rather than one. No I/O. `------------------------------------------------------------------------- thus ,--------------------------------------------------------- | (org-table-convert-region BEG0 END0 &optional SEPARATOR) `--------------------------------------------------------- with C-u M-x org-table-convert-region should be e.g. ,---------------------------------------- | (org-table-convert-region 38 456 '(4)) `---------------------------------------- and C-u 3 M-x org-table-convert-region should be ,---------------------------------------- | (org-table-convert-region 38 456 3) `---------------------------------------- but I checked with edebug, its actually ,---------------------------------------- | (org-table-convert-region 38 456 nil) `---------------------------------------- and "When nil, the command tries to be smart and figure out [itself]" So the problem seems to be that 'C-u 3' doesn't work as expected in my case. Could you check if it works for you? -- cheers, Thorsten