unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Usecase for inotify? Re: How to add content from a file to a table automatically
       [not found] <50ee34c8.09fb640a.6b64.0e5a@mx.google.com>
@ 2013-01-10  5:07 ` Jambunathan K
  2013-01-10 18:58   ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Jambunathan K @ 2013-01-10  5:07 UTC (permalink / raw)
  To: Darlan Cavalcante Moreira; +Cc: emacs-orgmode, emacs-devel


There is support for inotify in Emacs.  Last I heard, people were
interested in hearing use-cases.

I am not sure it qualifies as a minimal use-case.  But it is something
that comes out of real life.  So here it goes to emacs-devel...

Darlan Cavalcante Moreira <darcamo@gmail.com> writes:

> Is there a way to detect when a file changes and then add the content from
> it (if any, the file could be empty) to a specified org-mode table? Each
> line in that file is already constructed in a way that it could be copied
> and pasted to the table directly (but I can change that if it makes things
> easier).
>
> For instance, suppose I have the table below
>
>
> #+TBLNAME: FoodJanuary2013
> |   | *Place*   | *Date*           | *Debit (R$)* | *Credit (R$)* |
> |---+-----------+------------------+--------------+---------------|
> |   | Some name | [2013-01-07 Seg] |         0.00 |         10.00 |
> |---+-----------+------------------+--------------+---------------|
> | # |           | *Total*          |         0.00 |         10.00 |
> #+TBLFM: @3$4=vsum(@2..@-1);%.2f::@3$5=vsum(@2..@-1);%.2f
>
>
> and a file "food.txt" that was modified externally (Dropbox sync) and now
> has the content below
>
>
> | # | place name | [2013-01-08 Ter] | 0.00 | 12.50 |
> | # | other place | [2013-01-09 Qua] | 9.30 | 0.00 |
>
>
> I'd like the table to be automatically updated to include these two new
> lines so that it should now corresponds to
>
>
> #+TBLNAME: FoodJanuary2013
> |   | *Place*     | *Date*           | *Debit (R$)* | *Credit (R$)* |
> |---+-------------+------------------+--------------+---------------|
> |   | Some name   | [2013-01-09 Qua] |         0.00 |         10.00 |
> | # | place name  | [2013-01-08 Ter] |         0.00 |         12.50 |
> | # | other place | [2013-01-09 Qua] |         9.30 |          0.00 |
> |---+-------------+------------------+--------------+---------------|
> | # |             | *Total*          |         9.30 |         22.50 |
> #+TBLFM: @5$4=vsum(@2..@-1);%.2f::@5$5=vsum(@2..@-1);%.2f
>
>
> Adapting the formula as org-mode would automatically do if I typed enter
> twice before the last hline is important, but updating the total value is
> not (although nice), since I can do that with "C-u C-u C-c *" later when I
> actually see the table.
>
> After that the content of the file should be erased to prevent future
> additions of the same information.
>
> Any hints on how to do the different parts for this are welcome.
>
> --
> Darlan
>
> Ps: I use the latest org-mode and Emacs versions (from git and bzr,
> respectively) in a Linux box.
>
>
> The motivation for all this is that I use org-mode tables to control my
> expenses, but I want to be able to add new expenses from my android
> phone. Using the "tasker" app (REALLY good) I could create a simple UI to
> add the expense to a file that will be synced using Dropbox (one file for
> each category, which corresponds to a different table). All of this is
> working and now I the next step is the one described in this e-mail.
>
>

-- 



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Usecase for inotify? Re: How to add content from a file to a table automatically
  2013-01-10  5:07 ` Usecase for inotify? Re: How to add content from a file to a table automatically Jambunathan K
@ 2013-01-10 18:58   ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2013-01-10 18:58 UTC (permalink / raw)
  To: Jambunathan K; +Cc: darcamo, emacs-orgmode, emacs-devel

> From: Jambunathan K <kjambunathan@gmail.com>
> Date: Thu, 10 Jan 2013 10:37:19 +0530
> Cc: emacs-orgmode <emacs-orgmode@gnu.org>, emacs-devel@gnu.org
> 
> 
> There is support for inotify in Emacs.  Last I heard, people were
> interested in hearing use-cases.
> 
> I am not sure it qualifies as a minimal use-case.  But it is something
> that comes out of real life.  So here it goes to emacs-devel...

Thanks.

However, at least from my perspective, a useful use case should
include a description of how a feature was actually implemented using
the file notification, how the provided APIs were used to implement
it, and what experience and suggestions for API modifications were
gained as result.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-10 18:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <50ee34c8.09fb640a.6b64.0e5a@mx.google.com>
2013-01-10  5:07 ` Usecase for inotify? Re: How to add content from a file to a table automatically Jambunathan K
2013-01-10 18:58   ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).