The pleasure of exploration...
Mar. 23rd, 2015 11:28 amI've been using org mode in emacs for a few years, now, to help me keep track of my assignments, and more recently, to help generate invoices.
To generate a line item for an invoice, an item must have certain "Properties" (a feature of org mode). Generally speaking, these are:
So I got to thinking about automating the process, and just as an experiment, I created a function in my .emacs file (the file that emacs reads upon startup).
This is just a first step, but an important one.
To generate a line item for an invoice, an item must have certain "Properties" (a feature of org mode). Generally speaking, these are:
- a BillUnit property, which answers one of the following questions:
- Is the charge based on source words or target words?
- Does the job involve an hourly charge?
- Is this a rush job?
- Is this a minimum job?
- a Units property, which indicates the number of BillUnits to bill.
- and the all-important UnitRate, which is multiplied by the Units to get the line item total.
So I got to thinking about automating the process, and just as an experiment, I created a function in my .emacs file (the file that emacs reads upon startup).
(defun clientA-xl8 () 0.xx)where 0.xx reflects my translation rate for client "A". Then, instead of assigning the value of 0.xx to the UnitRate property of the job, I entered the value
(clientA-xl8)and then, when I ran my invoice generation function... lo, and behold (!), my hypothesis—that emacs evaluates property values in org mode and then uses any returned value—was demonstrated to have merit.
This is just a first step, but an important one.