From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +BnKBedChWG5VAAAgWs5BA (envelope-from ) for ; Fri, 05 Nov 2021 15:42:47 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id CBFtAedChWEhawAA1q6Kng (envelope-from ) for ; Fri, 05 Nov 2021 14:42:47 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 77F8F3134 for ; Fri, 5 Nov 2021 15:42:46 +0100 (CET) Received: from localhost ([::1]:38710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mj0QX-0005c6-Jy for larch@yhetil.org; Fri, 05 Nov 2021 10:42:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mj0LO-00009B-15 for emacs-orgmode@gnu.org; Fri, 05 Nov 2021 10:37:26 -0400 Received: from mail-am6eur05olkn2011.outbound.protection.outlook.com ([40.92.91.11]:47713 helo=EUR05-AM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mj0LL-0007dc-AA for emacs-orgmode@gnu.org; Fri, 05 Nov 2021 10:37:25 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FRATU2wXKl84UTU2UiwA9Dcy84wUCUMmw7u2nakKDn45Z6luUKwrCsCPMniyOuwcd8KhwNQZuFOzOJ6pRgCoHky71vUyfYq/zyxpVZfs9Zr/GKjbm+knbONhfOsQ8QhiWrPcWWExea5Yr5MyERfYXjzgw/MYgsa9vkKeB/jwlkD6F3vY08Hhh8lnVdGt+vd0g+60OxoGUWWcy3HSAZU0DFe8+18WLAdfPhNILnzOM5ePCZviJVweHW6BimD+a0p9Icaum0hCuA90NVEnrXulPhygaH7fwbuPl3nLRna0k0Hdb8ZRHPgoVVydlcBlOkw02zGJqhTg86bOYeIAg34KKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FP+rxOPNwZZkLWQZEUO9hMvy4Pb2DDOGJRyDUXtv5So=; b=oOk/FUp4WgcCRTDwbzUvJSaYGTXKbRlI2E3JfLoZGo5P6cT6GafFxyTIAn/ZN6xEHiCOEP0jBOKI1AXmBYiybL9S93lxJJuCZUvAcUQb1okusB0MiCZS9uH5e1dTcE/l3E4N6pKiqJZdLINZ7nFnu9aijYGZIjLq56/rYEt+FWc0tXXDlxzP4kX6/2xLemponJPb308J4+dcL50ZVRBA9VmMUxU1Pt59uHdRJQJcs9ASoDj+n7urBKCvetz0AwBqHwMfwuirv6YMinkRXNOWHmQM7/N30C/A7LhfeGr1oT2hvgigUziA6egrt0+igT1DqRLKphZ+ggVMgP0IixUeng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FP+rxOPNwZZkLWQZEUO9hMvy4Pb2DDOGJRyDUXtv5So=; b=vN6jUcUWVwppvC7scLJ9kh+6dFukVRvqwaYcU4imVaKqOoAFE+n0Hdy5urU/4xrbWw+rZkBrGKEuDqa09pbeTi//D3K6wfWj8O3NxL0E842bEeM92bljWAd6LK7mO5rTMWoBGEMOWQMA9573EROxzirjlZYGrhrNLmgxcfAbPngDWKGIULt2970R1KoIabEUyYvNUq/yeLAE7C5B3KVsq8NuTfAXGGKlcaFOIoXJfLmqSbZokKaD4CT9R/c9nxwI4r0Yrx+oyx+CuBxCQ8a1x4RsB7eYxGacTcDgm3hDvgmBIs04xfFElJfSc+RKquJaG6dU0kuftAjvmSZZfFLpmw== Received: from PAXPR08MB6640.eurprd08.prod.outlook.com (2603:10a6:102:dd::5) by PR3PR08MB5658.eurprd08.prod.outlook.com (2603:10a6:102:88::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Fri, 5 Nov 2021 14:37:20 +0000 Received: from PAXPR08MB6640.eurprd08.prod.outlook.com ([fe80::90c1:4e36:aaac:49d0]) by PAXPR08MB6640.eurprd08.prod.outlook.com ([fe80::90c1:4e36:aaac:49d0%5]) with mapi id 15.20.4649.020; Fri, 5 Nov 2021 14:37:20 +0000 References: <87sfwag6oy.fsf@localhost> User-agent: mu4e 1.7.0; emacs 28.0.60 From: "Christopher M. Miles" To: Ihor Radchenko Subject: [SOLVED] Re: [QUESTION] How to generate org-agenda view for clocked tasks and logs etc which are sorted by timestamps? Date: Fri, 05 Nov 2021 22:36:33 +0800 In-reply-to: <87sfwag6oy.fsf@localhost> Message-ID: Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-TMN: [xwEFqXmp1JEKjX3WqOl1F0NJb915c7ZVnF8O0Zc+Vcc=] X-ClientProxiedBy: HK2PR06CA0024.apcprd06.prod.outlook.com (2603:1096:202:2e::36) To PAXPR08MB6640.eurprd08.prod.outlook.com (2603:10a6:102:dd::5) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 2 Received: from Mac-mini.local (183.246.145.175) by HK2PR06CA0024.apcprd06.prod.outlook.com (2603:1096:202:2e::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Fri, 5 Nov 2021 14:37:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6ec06330-8524-4047-c1be-08d9a069c570 X-MS-TrafficTypeDiagnostic: PR3PR08MB5658: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fTeqT35t2OwgN74KVlRJW2M3U+InGAJ9HjGOHPc2G/Wm66GVz4nmZ0Zw3WUeP1WWEs/OEHh6kj0G0jKOUWD3nODwCzmmTXC4J0pUm3A5a5hD97aCHCCyncrVZALyPQ6gew3PO4zPS2lATPO5zp9lF/72vek9brLnZFKSghGSpPBpdselGZm0Wsw8V7xDOiaP+2bVFwfFY6mMH0hDhcsS8O2l+A0ceFTd9EODXdd6tuMiDG9knc9HD9WYOKLviz3dyRX25hBeZpDcAbbbvBoe97pyonOkQe0TcS28VWodkIttUfxW1Pn9Bq/1MrtHB5DX5Kx5iuS8+XICNk240PnTwLs3DSSYLqRkWh119gZIdKMw7JUEDVLu608IVpDt21Am8fVz3SCSjC/m86/grEdL0dNR4UO4xCWO2/pmJ377Fj4QTc0mKcJD/u5vB5sUeaiPs4desUrJACXlXpW/8NHdvAG0Xy9b1R1C9psoDBKFKfOqtJlX9u5hyJmjC3Gd60XRIHBbQvtCA+3Z83OD0V3TrljeUTIoE8nFdsM1R0geu+RaMuTjNh9dir4G0LWIWJmvkMhiGr3sBHtOLOPw2Id0Jw== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3r7651EvN8II9lLC0GwtbmmK+wizCQdyEu7CaxU0snbZAQlD4igtW2Nojk7yf/9GIWQLMKCETo0oBSFzIBpUevt8OvzdJol4bEazAdDRLyBcQKtBnXakc13UQ2qLwvVi750bag16FYbK9p8neG43CfdRE3fprmPLsiWGnozyMc1flxnXhAYUqXWZ0jWI+N7NaGQkIYS97h/vi6+nk4xIDZ7DBGUnzka+ZBkaHuGkcphaShqwsp5K5wwB5yl17e25WYifQ4o4iCq47bzMF9YYflNZXdlAt6saw49X6G08x32qUq8etyAnW2HuzuiuQjSEmf0nWOIHTh3MQGmE5SU71vIYA9B+1Qj1SRCrN5h/x+8aoGm0Hov5azhSgIHXmgwuuBH5Ar6VSz+Of5Z6VXWuYRH+8DIjTCsuhxASGo5uMp6UTs3YfzzkqLzFfcb7L6gx+XAGCFeAHn2NvpLlGECXgTn+BjIAF5UzVRNYjfGgsiD7bRGYUJTZnzfhf0bRMiRH3k5DkqOf9WznmSicQyP4pZ6IjNSeEp0wZaw2L9BK0ozsP/6JBzqwKyuIRKlvJFnFADPZFkw/AATqXjPi5//Y5mhaDiCRAialr4jYn58bhLYlcBCCbl5mfMgLo2yW3fMCNc+i+Y0dOiNO7MXvLZTUZKgw7Gp16NAw2E6ckp7KFEXQNG6KGEBq/HG0LHiw+aEOKRrQ9L0YiFaBufRhbyFm/w== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ec06330-8524-4047-c1be-08d9a069c570 X-MS-Exchange-CrossTenant-AuthSource: PAXPR08MB6640.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2021 14:37:20.8653 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5658 Received-SPF: pass client-ip=40.92.91.11; envelope-from=stardiviner@outlook.com; helo=EUR05-AM6-obe.outbound.protection.outlook.com X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MSGID_FROM_MTA_HEADER=0.001, NML_ADSP_CUSTOM_MED=0.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: numbchild@gmail.com Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1636123366; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=FP+rxOPNwZZkLWQZEUO9hMvy4Pb2DDOGJRyDUXtv5So=; b=Dw442dGXlhYB8XIAiLuzHD0YkHEoKW6JhONE95MZv0Omf2oCgWKJamtP/AmHvpQAFWkMrm BPmUB9WV7FHghdkrpngSexLagCbTR2wLr6y8ZAiPw613fD+LoHX0I+TCE5g/ozC6u2thWr ERNDBPsNwN6Dg8quK3+i3mr9bRvt/8rVALvQ3p50M7mU/u1vLJzuxPnXivMx4x56XjGAtH rAQnL2/eEvdF481RiYUCqBZrTgHUVK5stjD+UWIjgc/cF3jSyCe9x2tNtJrYONLovyVVTl mYbRUUGUyMKq+AePHyKV/0Wpb2JRysNjs2OlecMJpuKJNhAGugxtNQQAGyJhbw== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1636123366; a=rsa-sha256; cv=pass; b=GBcTcxJMXmJge3TEHAyVCYCug7wGyVM4nIuEnnWksbetu2m0fG+mNcgVVgnVRtefL4apng KACqafJ6D2Vw2YNZbIjrTYPGD/PKh7oHy8o4j+YsiSUyJ7CorxEU26qKZCX1maUuc61shP ctXGBoxzswBv07rcOtAVPxH1bExqVtX5ngphfgAGcbZLgphv+LipN2g87TWp+sDXuJWHKi 9l/Dmdu2kW+chFtkLBPrDK2AZQ5E5N+DJT8oUrOQOXcM+Zh3fpxUu5hP77+s5EVSIFYySv dzZRHUoX3y6OVLRbgSIyirVDGWijtwHpq0XTcMMB1Epz7oy9ZsutLl3ptwOcgg== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=vN6jUcUW; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=vN6jUcUW; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 77F8F3134 X-Spam-Score: -2.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: o1w3ThsVdTaJ --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Ihor Radchenko writes: > "Christopher M. Miles" writes: > >> In the source code comment "FIXME" org-agenda always in frontend and pop= up buffer. I can't generate >> org-agenda in background then get the buffer content. >> >> Does anybody knows some tricky method for my code? > > Maybe wrap agenda call into save-window-excursion? Thanks for your helpful hint. I finally got a solution: #+begin_src emacs-lisp (add-to-list 'org-agenda-custom-commands '("c" "Tody [c]locked tasks." ((agenda "" ((org-agenda-ndays 1) (org-agenda-span-1) (org-agenda-use-time-grid t) (org-agenda-include-diary nil) (org-agenda-show-log (quote clockcheck)) (org-agenda-clockreport t)))))) (let* ((org-agenda-sticky t) ;; Run it in background instead of switch to agenda buffer with `sav= e-window-excursion'. (_ (save-window-excursion (org-agenda nil "c"))) (origin-buffer (current-buffer)) (origin-buffer-point (point)) (agenda-buffer (with-current-buffer "*Org Agenda(c)*" (buffer-substring (point-min) (point-max))))) (print agenda-buffer)) #+end_src #+RESULTS[(2021-11-05 21:27:30) 96280334f709aece114a7bf308c1ff4762eff1bf]: #+begin_example Day-agenda (W44): Friday 5 November 2021 8:00am...... ---------------- 10:00am...... ---------------- 12:00pm...... ---------------- Feature 1:00pm- 1:04pm Clocked: (0:04) FEATURE [#A] create an = org-agenda like view mode for clocking,note logs sorted by timestamps Feature 1:06pm- 1:38pm Clocked: (0:32) FEATURE [#A] create an = org-agenda like view mode for clocking,note logs sorted by timestamps 2:00pm...... ---------------- 4:00pm...... ---------------- 6:00pm...... ---------------- 6:28pm...... now - - - - - - - - - - - - - - - - - - - -= - - - - - 8:00pm...... ---------------- #+end_example So that I can record those into into Diary. =2D-=20 [ stardiviner ] I try to make every word tell the meaning that I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAmGFQZcACgkQG13xyVro msMUNQf9EGCEQtpwsEMb1CiJOejJ9KabnYY9zQH7EvvnfSXFfGsg8Mgin+R42Ggi mKXaIg72yUsuKpsE59edboJx7KYsATI2uSlDqbEp6yhJ02+w9qhhKxEWJNB3lG/+ HFTua8xfLeLPuIEsp/RxlWUJ+FyqHMw2M2gU4ikCrU1Ej6J6uu3sznYpUuPL6D0Z BgCvl7wjHUyi9I3jrpVE8mAnUM7aS2AnSlBcWT58ca6+Ig+peLyIV/q3i4zRpMxu agvfHkd2G4tb7aPCrXOK0/yB16CqyV0VXuJ3G51usw92hJ+zepU5e3bvMUkhzGCh gbIYc+Cp+6h4wxnMySloBt/Kx9C3tw== =tco3 -----END PGP SIGNATURE----- --=-=-=--