emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jean Louis <bugs@gnu.support>
To: emacs-orgmode@gnu.org
Subject: Re: form-like process for entering rows in an org-mode table?
Date: Wed, 28 Sep 2022 12:23:44 +0300	[thread overview]
Message-ID: <YzQSoFS590p75Edw@protected.localdomain> (raw)
In-Reply-To: <533058.1664335982@archlinux>

* Greg Minshall <minshall@umich.edu> [2022-09-28 06:34]:
> Jean Louis,
> 
> > * Greg Minshall <minshall@umich.edu> [2022-07-22 19:14]:
> > > hi.  does anyone have any code, or know of any existing package, that
> > > would allow for some sort of form-like (or "transient"-like) interface
> > > for adding rows to an org-mode table?  in particular, that provides some
> > > sort of =completing-read= interface for a given set of choices for a
> > > given column, etc.
> > 
> > I have total understanding for this use case, as I do similar all the
> > time. Just that I don't use Org tables, I use database tables.
> 
> the project that needs this has been on the back-burner for a while,
> but, for the record, i have looked at "Column View" as a possible
> replacement for "org tables as a database".  in addition to a
> completing-read interface, column view gives the opportunity to add
> descriptive text to a row -- i.e., just the regular, non-property,
> content under a headline -- which is very nice.  but, i haven't played
> with it enough to see how well it will fit my "needs".

I do not know what is column view. But I understand that you need
 descriptive text.

What I know is that without unique ID, there can't be conclusive
completion.

That is why I first construct various completions like this:

;; because there can be same names in different rows
(let* ((list '("Greg [1]" "Greg [2]"))
       (choice (completing-read "Choose: " list)))
  (rcd-get-bracketed-id-end choice)) ⇒ 2

(defun rcd-get-bracketed-id-end (s)
  "Return the ID number in string S from within first brackets on its
end. For example it would return 123 from `Some string [123]'"
  (let* ((match (string-match "\\[\\([[:digit:]]*\\)\\][[:space:]]*$" s)))
    (when match
      (string-to-number
       (substring-no-properties s (match-beginning 1) (match-end 1))))))
                                       
-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/


  reply	other threads:[~2022-09-28 11:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-22 16:12 form-like process for entering rows in an org-mode table? Greg Minshall
2022-09-27 21:41 ` Jean Louis
2022-09-28  3:33   ` Greg Minshall
2022-09-28  9:23     ` Jean Louis [this message]
2022-09-29  7:51       ` Greg Minshall
2022-09-29 12:04         ` Quiliro Ordóñez

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=YzQSoFS590p75Edw@protected.localdomain \
    --to=bugs@gnu.support \
    --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).