help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Conveying called function to next function


From: Jean Louis
Subject: Conveying called function to next function
Date: Tue, 12 Jan 2021 20:36:01 +0100

Right now I wish to have computer remember the refreshing function so
I do it here below with:

(lambda () (cf-tabulated-last-people limit))

and that works well. I put it in a local variable and I can refresh
the tabulated list with "g" and get updated listing. Very handy but
not elegant as each time I need to write that lambda.

Would it be possible to convey it as a list:

(rcd-db-sql-report title sql [("ID" 8 t) ("Person" 40 t) ("Account" 32 t)] 
"people" nil '(cf-tabulated-last-people limit))

and how would I best call the list '(cf-tabulated-last-people limit) to be 
executed?

Jean

(defun cf-tabulated-last-people (&optional limit)
  (interactive)
  (let* ((limit (or limit 200))
         (sql (format "SELECT people_id, get_full_contacts_name(people_id), 
coalesce(get_accounts_name(people_account1),'UNKNOWN') FROM people ORDER BY 
people_id DESC LIMIT %s" limit))
         (title (format "Last %s people" limit)))
    (rcd-db-sql-report title sql [("ID" 8 t) ("Person" 40 t) ("Account" 32 t)] 
"people" nil (lambda () (cf-tabulated-last-people limit)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]