From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Millar Subject: Re: orgmode and a database Date: Tue, 05 Apr 2016 16:01:38 -0400 Message-ID: <570419A2.6090802@verizon.net> References: <87shz1f97s.fsf@mat.ucm.es> <5702CE16.8020704@verizon.net> <871t6kl50k.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=------------090905060308090605020801 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anXAr-0005Bm-QN for emacs-orgmode@gnu.org; Tue, 05 Apr 2016 16:02:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anXAm-00008S-QK for emacs-orgmode@gnu.org; Tue, 05 Apr 2016 16:02:05 -0400 Received: from vms173007pub.verizon.net ([206.46.173.7]:37678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anXAm-00008L-JU for emacs-orgmode@gnu.org; Tue, 05 Apr 2016 16:02:00 -0400 Received: from vz-proxy-l004.mx.aol.com ([64.236.82.152]) by vms173007.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0O56007RFFMWUE80@vms173007.mailsrvcs.net> for emacs-orgmode@gnu.org; Tue, 05 Apr 2016 15:01:44 -0500 (CDT) In-reply-to: <871t6kl50k.fsf@mat.ucm.es> 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 This is a multi-part message in MIME format. --------------090905060308090605020801 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Uwe, On 04/05/2016 06:32 AM, Uwe Brauer wrote: > > Hi, > > On 04/04/2016 03:46 PM, Uwe Brauer wrote: > > > I have been using recutils with orgmode for more than year - still > > learning of course. So far, my experience has been fine. I am still > > developing some sort of standard databases, e.g. one for contacts, > > another for finance type of records, etc. > > Do you have some example or a pointer or so. I don't know even how to > start. > > A caveat - I am slowly learning lisp - of any kind - and I have not programmed in over 45 years (college). See the attached files - one is a template for entering data into a recfile and the other is a sample of how I use some of the data in that recfile. I also have a couple of remote-descriptors so that I don't have reinvent the wheel for every recfile. Originally I set up an org capture template and switched modes for entries into a refile, but this was not a "good" solution. In the recutils list I mentioned org capture and perhaps it could be modified to recutils, but I never sent Jose a use case. > > Have you checked out the two recutils mailing lists? Not very > > active at the moment. I mentioned in those lists that perhaps some > > sort of capture much like org-capture might be useful, but have > > made no further effort in that regards. > > > I picked up a excellent pointers as to using recutils to create > > org-mode tables from Jose Marchesi's and Eric Shulte's ob-rec.el > > discussion on this list back in 2011. I ultimately export the tables > > and related text to LaTeXpdf docs. > > Could you provide me a link, please? Here's the thread on Gmane http://article.gmane.org/gmane.emacs.orgmode/37697/match=ob+rec+el > Uwe Brauer Charlie Millar --------------090905060308090605020801 Content-Type: text/x-emacs-lisp; name="cm-estate-recfile-entries.el" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cm-estate-recfile-entries.el" (defun cm-estate-rec-entries (Description File &optional Memo AccountDate AccountAmount Shares AccountSchedule1 AccountSchedule2 EstateTaxSchedule FiduciaryTaxSchedule ProceedsDate ProceedsAmount AccountSchedule3 AccountSchedule4 Beneficiary OtherAccount1 &optional CheckDate CheckNumber CheckAmount) (goto-char (point-max)) (newline) (interactive "sDescription: \nsFile: \nsMemo: \nsAccountDate: \nsAccountAmount: \nsShares: \nsAccountSchedule: \nsAccountSchedule: \nsEstateTaxSchedule: \nsFiduciaryTaxSchedule: \nsProceedsDate: \nsProceedsAmount: \nsAccountSchedule: \nsAccountSchedule: \nsBeneficiary: \nsOtherAccount: \nsCheckDate: \nsCheckNumber: \nsCheckAmount: ") (insert "Description: " Description) (newline) (insert "File: " File) (newline) (insert "Memo: " Memo) (newline) (insert "AccountDate: " AccountDate) (newline) (insert "AccountAmount: " AccountAmount) (newline) (insert "Shares: " Shares) (newline) (insert "AccountSchedule: " AccountSchedule1) (newline) (insert "AccountSchedule: " AccountSchedule2) (newline) (insert "EstateTaxSchedule: " EstateTaxSchedule) (newline) (insert "FiduciaryTaxSchedule: " FiduciaryTaxSchedule) (newline) (insert "ProceedsDate: " ProceedsDate) (newline) (insert "Proceeds: " ProceedsAmount) (newline) (insert "AccountSchedule: " AccountSchedule3) (newline) (insert "AccountSchedule: " AccountSchedule4) (newline) (insert "Beneficiary: " Beneficiary) (newline) (insert "OtherAccount: " OtherAccount1) (if (y-or-n-p "Are those checkbook entries necessary?") (progn (newline) (insert "OtherAccount: Checkbook") (newline) (insert "CheckDate: " CheckDate) (newline) (insert "CheckNumber: " CheckNumber) (newline) (insert "CheckAmount: " CheckAmount) (newline)) (progn (newline)))) --------------090905060308090605020801 Content-Type: text/plain; charset=UTF-8; name="cm-sample-recutil-latex.org" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cm-sample-recutil-latex.org" Not sure if this will help, but here is a sample set up for one of my documents that usually have 15 - 20 tables which first are called from a recutils and then passed to a source block for the table. (Please note that I use the numprint package, which does not "like" any text in a number only column, so there is a separate line for the initial row. I am still playing wihtthis) #+Begin_example Some text here which is followed by a table #+LATEX: \label{SCHEDA} \begin{center} \textbf{SCHEDULE A\\PRINCIPAL RECEIVED} \end{center} \setlength{\extrarowheight}{8pt} \vspace{-3.0ex} \ofoot{Schedule A} #+NAME: SCHEDAP #+ATTR_LATEX: :mode table :environment longtable :align p{60pt}p{60pt}p{240pt}p{60pt} | Date | {{{cmhfill}}} Shares | Description | Inventory {{{cm2space}}} Value | #+begin_src rec :data foo.rec :type Finance :fields AccountDate,Description,AccountAmount :results silent (File = 'bar' && AccountSchedule = 'A') #+end_src #+RESULTS: SCHEDAP #+NAME: SCHEDA #+HEADER: :eval no #+begin_src emacs-lisp :var table=SCHEDAP :exports results (setq table (cons 'hline table)) (setq table (append table '(("|Total Schedule A")))) (setq table (append table '(("\n#+TBLFM: at>$>=vsum(atI$>..at>>$>);%.2f::")))) table #+end_src #+ATTR_LATEX: :mode table :environment longtable :align p{60pt}N{6}{3}p{250pt}N{8}{2} #+RESULTS: SCHEDA Some more text here #+End_example --------------090905060308090605020801--