* orgtbl-insert-radio-table forbid blanks in the table name
@ 2012-10-09 7:05 Pascal Wittmann
2012-10-11 12:35 ` Nicolas Goaziou
0 siblings, 1 reply; 2+ messages in thread
From: Pascal Wittmann @ 2012-10-09 7:05 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 648 bytes --]
Hi,
I noticed that its possible to enter a name containing blanks when
calling orgtbl-insert-radio-table. I don't think that this is intended,
because blanks are used as separators in the "#+ORGTBL" line.
Entering a the name "first table" will result in the following error
message:
"No such transformation function table"
For me (as a novice) it was at first not obvious what I did wrong. My
suggestion is to chose an other input method that forbids blanks.
I fixed this locally with the attached patch, but I'm sure there are
better solutions (I find it unintuitive that blanks terminate the input).
Best Regards
Pascal
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: orgtbl-insert-radio-table-no-blanks.diff --]
[-- Type: text/x-patch; name="orgtbl-insert-radio-table-no-blanks.diff", Size: 529 bytes --]
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 0555041..a8d2826 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -4437,7 +4437,7 @@ First element has index 0, or I0 if given."
(txt (nth 1 e))
name pos)
(unless e (error "No radio table setup defined for %s" major-mode))
- (setq name (read-string "Table name: "))
+ (setq name (read-no-blanks-input "Table name: "))
(while (string-match "%n" txt)
(setq txt (replace-match name t t txt)))
(or (bolp) (insert "\n"))
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: orgtbl-insert-radio-table forbid blanks in the table name
2012-10-09 7:05 orgtbl-insert-radio-table forbid blanks in the table name Pascal Wittmann
@ 2012-10-11 12:35 ` Nicolas Goaziou
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2012-10-11 12:35 UTC (permalink / raw)
To: Pascal Wittmann; +Cc: emacs-orgmode
Hello,
Pascal Wittmann <PascalWittmann@gmx.net> writes:
> I noticed that its possible to enter a name containing blanks when
> calling orgtbl-insert-radio-table. I don't think that this is intended,
> because blanks are used as separators in the "#+ORGTBL" line.
>
> Entering a the name "first table" will result in the following error
> message:
>
> "No such transformation function table"
>
> For me (as a novice) it was at first not obvious what I did wrong. My
> suggestion is to chose an other input method that forbids blanks.
Documentation uses table_name in order to describe the name of the
table, implying there shouldn't be any space in that name. Maybe it
could be made more explicit, with, i.e. a footnote somewhere.
> I fixed this locally with the attached patch, but I'm sure there are
> better solutions (I find it unintuitive that blanks terminate the
> input).
Another possibility is to return an error if the string read contains
any whitespace character.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-11 12:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-09 7:05 orgtbl-insert-radio-table forbid blanks in the table name Pascal Wittmann
2012-10-11 12:35 ` Nicolas Goaziou
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).