From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: Org Capture - Inserting Date and Time Date: Sat, 28 Nov 2020 10:48:03 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37905"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0 (3d08634) (2020-11-07) Cc: Help Gnu Emacs To: daniela-spit@gmx.it Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 28 08:51:28 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kiv0x-0009mS-HX for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 28 Nov 2020 08:51:27 +0100 Original-Received: from localhost ([::1]:40010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kiv0w-00027k-Hr for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 28 Nov 2020 02:51:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kiv0e-00026O-ED for help-gnu-emacs@gnu.org; Sat, 28 Nov 2020 02:51:08 -0500 Original-Received: from static.rcdrun.com ([95.85.24.50]:35663) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kiv0a-0003V4-2w for help-gnu-emacs@gnu.org; Sat, 28 Nov 2020 02:51:08 -0500 Original-Received: from localhost ([::ffff:197.157.0.29]) (AUTH: PLAIN admin, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by static.rcdrun.com with ESMTPSA id 00000000002C0007.000000005FC20165.00001F8F; Sat, 28 Nov 2020 07:51:01 +0000 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=95.85.24.50; envelope-from=bugs@gnu.support; helo=static.rcdrun.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:125719 Archived-At: * daniela-spit@gmx.it [2020-11-28 05:59]: > Have posted an entry of my Org Capture Setup. I ask for a date using %^U which is > introduced in the headline. I would like to also put it in the field "Scheduled:". > Can this be done? > > Would like something as below > > * MEETING [2020-12-02 Wed 03:55] Walk > Scheduled: <2020-12-02 Wed 03:55> > With: Pete > Entered: <2020-11-28 Sat 03:55> > > > ("m" "+ Meeting" entry > (file "~/histr/rcl.org") > ,(concat > "* MEETING %^U %^{Topic}\n" > " Scheduled:\n With: %^{With}%?\n Entered: %T")) I find those customizations way too complex for people who would like to make schedule their meeting. Org is in the context of org-capture still pretty much high level. The above setting is to me about same level complexity as learning how to write Emacs Lisp functions. (defun my-ask-for-meeting () (interactive) (let* ((date (calendar-read-date)) (calendar-date-display-form '((format "%04.f-%02.f-%02.f" (string-to-number year) (string-to-number month) (string-to-number day)))) (date (calendar-date-string date)) (topic (read-from-minibuffer "Meeting for topic: ")) (with (read-from-minibuffer "With: "))) (format "* MEETING %s %s Scheduled: %s With: %s Entered: %s " date topic date with date))) In the org-capture-template you can then under "Template" enter "Function" and just name of the function: my-ask-for-meeting But I think properties must appear in upper case letters like SCHEDULED: instead of Scheduled.