[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: form-like process for entering rows in an org-mode table?
From: |
Jean Louis |
Subject: |
Re: form-like process for entering rows in an org-mode table? |
Date: |
Wed, 28 Sep 2022 12:23:44 +0300 |
User-agent: |
Mutt/+ () (2022-06-11) |
* 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/