From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 4M4mEQ72OV8mIgAA0tVLHw (envelope-from ) for ; Mon, 17 Aug 2020 03:14:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KFHUDA72OV9aVQAAbx9fmQ (envelope-from ) for ; Mon, 17 Aug 2020 03:14:22 +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 4E81C9403C9 for ; Mon, 17 Aug 2020 03:14:21 +0000 (UTC) Received: from localhost ([::1]:47316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k7VbG-0006Az-I9 for larch@yhetil.org; Sun, 16 Aug 2020 23:14:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38000) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k7Vae-000692-PQ for emacs-orgmode@gnu.org; Sun, 16 Aug 2020 23:13:40 -0400 Received: from mail-ua1-x931.google.com ([2607:f8b0:4864:20::931]:45984) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k7VaZ-0000vZ-N4 for emacs-orgmode@gnu.org; Sun, 16 Aug 2020 23:13:40 -0400 Received: by mail-ua1-x931.google.com with SMTP id z12so4319716uam.12 for ; Sun, 16 Aug 2020 20:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wsS2bPFQIamRIFjBLC+a1g/90sH1q5BcV/+C1nxihRM=; b=A+cbmK8GlXpZKahpO8DLHx8Sd3XQlfbFeb5ckUNyG0Ov0RwoZDNPwKMiR+6iNuntcP fLZFOqiYG5xrljs8H9tn8QsmAg23hCArw3VtRPYrst/jyf/oyUj3ZCj9/aO93iWDGHfg JUe9osDn1hoD7umg0G/tlRogVwEA0+dFFKL6e7dA7+BfU6E2s+ugY5HqfA8tfVrKkGOd cj/GYlNTzsZwHLzeRnkGhgQEhQ+nYz98Uxq37MFcY9hvZqY+PH4r4KCW3uOovuCMKsee +Xa0w97nXaVhX/dr5yS8rWrLeO7pbstVc1tOA7eScgWYfcbted9mcx3RTTAyz8LIC0dV pNKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wsS2bPFQIamRIFjBLC+a1g/90sH1q5BcV/+C1nxihRM=; b=I1dbLSAmCBl1dyCWHIfmDnP0UtIo6r9wW8A44rUwEdVaLT2Ix6C0q1/wqkrwchaEA8 9vh0oT1DSX4ddF7I5zNQf1lnd5Yx8zflTaOZFjMYhinxfzuS5f0Xzf3tTYnu1u5dode8 Qi5jXqmKUbpUxqxmz72rUMHu6CTHUT1nXqVNOKErnVaYfmLUZmw21zkGkyfuiHqfTYbJ pclcrhohjv4UhNtIGxZaoUiSYageUWfXsB8BnJRepMNMOBLgI55P4VnYfnAgDkQ6iwy1 n8virQTJMcRPCncOSbh+As9PPIAkQRSJJteM66twDBkFFnKAz5oUN9c5WGGuUtnUrqrR U+7Q== X-Gm-Message-State: AOAM531liKtHjt2Hffi17eiTVm7DxDoIyW1nAIqe+mKew6Wd1A+xVYWk uAbKr1Q6mEThgG8NsrDy1dqyf7dqh4cuvQtEMg== X-Google-Smtp-Source: ABdhPJz6QCz/46PMkmOMWOyOgRWzNuRVI23PiosUCt/DOXjUv7+n1Bhy366gWCvzUzBLBSn22ly/UQAJy2o2LuntNCs= X-Received: by 2002:ab0:22cf:: with SMTP id z15mr6556827uam.52.1597634014438; Sun, 16 Aug 2020 20:13:34 -0700 (PDT) MIME-Version: 1.0 References: <877du1olkf.fsf@localhost> <87v9hktpko.fsf@localhost> <87zh6vgko2.fsf@localhost> <87o8naghyn.fsf@localhost> In-Reply-To: <87o8naghyn.fsf@localhost> From: "numbchild@gmail.com" Date: Mon, 17 Aug 2020 11:13:06 +0800 Message-ID: Subject: Re: How to detect current in logbook drawer? To: Ihor Radchenko Content-Type: multipart/alternative; boundary="000000000000e9699a05ad0a27fd" Received-SPF: pass client-ip=2607:f8b0:4864:20::931; envelope-from=numbchild@gmail.com; helo=mail-ua1-x931.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Org-mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=A+cbmK8G; dmarc=pass (policy=none) header.from=gmail.com; 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-Spam-Score: 0.29 X-TUID: v6HKCMmYaztH --000000000000e9699a05ad0a27fd Content-Type: text/plain; charset="UTF-8" Now I added `save-match-data` in my org-link-beautify. Thanks for tips. Indeed. I will try this problem later and update here if got any news. At last, thanks for your helping. Really thanks. :) [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ On Mon, Aug 17, 2020 at 9:50 AM Ihor Radchenko wrote: > > I reviewed my org-link-beautify ( > > https://github.com/stardiviner/org-link-beautify) source code, I have > not > > use any regexp matching. I guess the function > > `org-link-beautify--get-element` invoked `(org-element-context)` caused > > this problem or other similar places. But I use `debug-on-entry` on > > `org-element-context`. Still have not got stoppoint backtrace. > > Judging from source code of `org-element-context`, it does modify match > data. You can probably send a bug (or patch) fixing this. All is needed > is to wrap the code into `save-match-data`. > > For you package, you can simply wrap all the code in `org-link-beautify` > into (save-match-data ... ). > > > And another step `debug-on-entry` on `org-link-beautify`, > > `org-agenda-finalize`, `org-activate-links`. I have not got a stoppoint > > backtrace on any of upper functions when org-agenda initializes. This is > > weird, because I tested to use `debug-on-entry` on `org-agenda`. It can > > popup a stoppoint backtrace. > > Strange. I had no problem with debugging `org-agenda-finalize` on my > system. > > Best, > Ihor > > > "numbchild@gmail.com" writes: > > > Ihor, thanks for your detailed help. > > I followed your steps, the `elp` step, I confirmed `org-link-beautify` is > > invoked and fall into an infinite loop. > > > > ``` > > org-link-beautify 11265 58.586412984 0.0052007468 > > ``` > > > > And another step `debug-on-entry` on `org-link-beautify`, > > `org-agenda-finalize`, `org-activate-links`. I have not got a stoppoint > > backtrace on any of upper functions when org-agenda initializes. This is > > weird, because I tested to use `debug-on-entry` on `org-agenda`. It can > > popup a stoppoint backtrace. > > > > I reviewed my org-link-beautify ( > > https://github.com/stardiviner/org-link-beautify) source code, I have > not > > use any regexp matching. I guess the function > > `org-link-beautify--get-element` invoked `(org-element-context)` caused > > this problem or other similar places. But I use `debug-on-entry` on > > `org-element-context`. Still have not got stoppoint backtrace. > > > > Need your more help. Sorry for disturbing you.... > > > > [stardiviner] GPG key ID: 47C32433 > > IRC(freeenode): stardiviner Twitter: @numbchild > > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 > > Blog: http://stardiviner.github.io/ > > > > > > On Sun, Aug 16, 2020 at 2:39 PM Ihor Radchenko > wrote: > > > >> > Your suggestion is very useful, I can see what function is invoked > many > >> > times. But still can't understand what's the cause. > >> > >> Looking at your CPU profiler report I can see that the slow part is > >> happening while running org-agenda-finalize when agenda buffer is > >> already populated. Most of time is taken by calling your function. I > >> suspect that it is simply called many times (maybe infinite loop?). > >> > >> You may check the number of times your function is called using > >> > >> (require 'elp) > >> (elp-instrument-function #'org-link-beautify) > >> ;; run agenda > >> ;; M-x elp-results > >> > >> Another suggestion would be invoking debug-on-entry for you function, > >> for org-activate-links, and for org-agenda-finalize. > >> > >> Best, > >> Ihor > >> > >> > >> > >> > >> "numbchild@gmail.com" writes: > >> > >> > I tried use debug-on-entry on: > >> > + org-agenda-list(nil) > >> > - org-agenda-mode() > >> > + org-agenda-set-mode-name() > >> > - org-update-dblock > >> > + org-dblock-write:clocktable > >> > > >> > But got no lucky, Then I followed your another suggestion, use > profiler: > >> > > >> > I got a very big message log, (not suitable for paste in email, so I > >> paste > >> > it on Gist) > >> > > >> > - CPU profiler report: https://www.pastery.net/gststf/ > >> > - Memory profiler report: > https://www.pastery.net/gststf+qzyxaf/#qzyxaf > >> > > >> > The very deepest call stacks seems the output format is not long > enough, > >> so > >> > can't display. > >> > > >> > Your suggestion is very useful, I can see what function is invoked > many > >> > times. But still can't understand what's the cause. > >> > > >> > [stardiviner] GPG key ID: 47C32433 > >> > IRC(freeenode): stardiviner Twitter: @numbchild > >> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 > >> > Blog: http://stardiviner.github.io/ > >> > > >> > > >> > On Sat, Aug 15, 2020 at 2:02 PM Ihor Radchenko > >> wrote: > >> > > >> >> >Here is the backtrace of "toggle-debug-on-quit" when I refresh > >> org-agenda > >> >> >but has long time suspend. > >> >> > >> >> That looks unreadable for me. Also, debug on quit may not show the > >> >> problematic part depending on your luck. > >> >> > >> >> It would be easier to understand your problem if you provided the > >> >> profiler report (M-x profiler-start ... M-x profiler-report). > >> >> Then, you could debug-on-entry using the problematic part according > to > >> >> the profiler report. > >> >> > >> >> A blind guess - maybe you are modifying match data somewhere in your > >> >> code. This might cause infinite loop in > >> >> > >> >> > (while (org-activate-links (point-max)) (goto-char (match-end 0))) > >> >> > >> >> Best, > >> >> Ihor > >> >> > >> >> "numbchild@gmail.com" writes: > >> >> > >> >> > Thanks for replying, Ihor. I will look into this regexp. > >> >> > > >> >> > Here is the backtrace of "toggle-debug-on-quit" when I refresh > >> org-agenda > >> >> > but has long time suspend. > >> >> > > >> >> > ``` > >> >> > Debugger entered--Lisp error: (quit) > >> >> > > >> >> > > >> >> > >> > re-search-forward("\\(\\[\\[\\(\\(?:[^][\\]\\|\\\\\\(?:\\\\\\\\\\)*[][]\\|\\\\+[^][]\\)+..." > >> >> > 17651 t) > >> >> > (while (re-search-forward org-link-any-re limit t) (let* ((start > >> >> > (match-beginning 0)) (end (match-end 0)) (visible-start (or > >> >> > (match-beginning 3) (match-beginning 2))) (visible-end (or > (match-end > >> 3) > >> >> > (match-end 2))) (style (cond ((eq 60 (char-after start)) 'angle) > ((eq > >> 91 > >> >> > (char-after ...)) 'bracket) (t 'plain)))) (if (and (memq style > >> >> > org-highlight-links) (not (string-match-p > >> org-element-paragraph-separate > >> >> > (match-string 0))) (not (and (eq style 'plain) (let (...) (if ... > ... > >> >> > ...))))) (progn (let* ((link-object (save-excursion ... ...)) (link > >> >> > (org-element-property :raw-link link-object)) (type > >> (org-element-property > >> >> > :type link-object)) (path (org-element-property :path link-object)) > >> >> > (properties (list ... ... ... ... ... ... ... ... ... ... ... t))) > >> >> > (org-remove-flyspell-overlays-in start end) (org-rear-nonsticky-at > >> end) > >> >> (if > >> >> > (not (eq ... style)) (add-text-properties start end properties) > >> >> > (remove-text-properties start end '...) (let (...) > >> (add-text-properties > >> >> > start visible-start hidden) (add-text-properties visible-start > >> >> visible-end > >> >> > properties) (add-text-properties visible-end end hidden) > >> >> > (org-rear-nonsticky-at visible-start) (org-rear-nonsticky-at > >> >> visible-end))) > >> >> > (let ((f ...)) (if (functionp f) (progn ...))) (throw :exit t)))))) > >> >> > (catch :exit (while (re-search-forward org-link-any-re limit t) > >> (let* > >> >> > ((start (match-beginning 0)) (end (match-end 0)) (visible-start (or > >> >> > (match-beginning 3) (match-beginning 2))) (visible-end (or > (match-end > >> 3) > >> >> > (match-end 2))) (style (cond ((eq 60 ...) 'angle) ((eq 91 ...) > >> 'bracket) > >> >> (t > >> >> > 'plain)))) (if (and (memq style org-highlight-links) (not > >> (string-match-p > >> >> > org-element-paragraph-separate (match-string 0))) (not (and (eq > style > >> >> ...) > >> >> > (let ... ...)))) (progn (let* ((link-object ...) (link ...) (type > ...) > >> >> > (path ...) (properties ...)) (org-remove-flyspell-overlays-in start > >> end) > >> >> > (org-rear-nonsticky-at end) (if (not ...) (add-text-properties > start > >> end > >> >> > properties) (remove-text-properties start end ...) (let ... ... ... > >> ... > >> >> ... > >> >> > ...)) (let (...) (if ... ...)) (throw :exit t)))))) nil) > >> >> > org-activate-links(17651) > >> >> > (while (org-activate-links (point-max)) (goto-char (match-end > 0))) > >> >> > (save-excursion (while (org-activate-links (point-max)) > (goto-char > >> >> > (match-end 0)))) > >> >> > (save-excursion (goto-char (point-min)) (save-excursion (while > >> >> > (org-activate-links (point-max)) (goto-char (match-end 0)))) (if > (eq > >> >> > org-agenda-remove-tags t) nil (org-agenda-align-tags)) (if > >> >> > org-agenda-with-colors nil (remove-text-properties (point-min) > >> >> (point-max) > >> >> > '(face nil))) (if (and (boundp 'org-overriding-columns-format) > >> >> > org-overriding-columns-format) (progn (set (make-local-variable > >> >> > 'org-local-columns-format) org-overriding-columns-format))) (if > >> >> > org-agenda-view-columns-initially (progn (org-agenda-columns))) (if > >> >> > org-agenda-fontify-priorities (progn > (org-agenda-fontify-priorities))) > >> >> (if > >> >> > (and org-agenda-dim-blocked-tasks org-blocker-hook) (progn > >> >> > (org-agenda-dim-blocked-tasks))) (org-agenda-mark-clocking-task) > (if > >> >> > org-agenda-entry-text-mode (progn (org-agenda-entry-text-hide) > >> >> > (org-agenda-entry-text-show))) (if (and (featurep 'org-habit) > >> >> > (save-excursion (next-single-property-change (point-min) > >> 'org-habit-p))) > >> >> > (progn (org-habit-insert-consistency-graphs))) (setq > org-agenda-type > >> >> > (org-get-at-bol 'org-agenda-type)) (if (or (eq > >> >> > org-agenda-show-inherited-tags 'always) (and (listp > >> >> > org-agenda-show-inherited-tags) (memq org-agenda-type > >> >> > org-agenda-show-inherited-tags)) (and (eq > >> org-agenda-show-inherited-tags > >> >> t) > >> >> > (or (eq org-agenda-use-tag-inheritance t) (and (listp > >> >> > org-agenda-use-tag-inheritance) (not (memq org-agenda-type > >> >> > org-agenda-use-tag-inheritance)))))) nil (let (mrk) (save-excursion > >> >> > (goto-char (point-min)) (while (equal (forward-line) 0) (if (setq > mrk > >> >> > (get-text-property ... ...)) (progn (put-text-property ... ... ... > >> >> > ...))))))) (setq org-agenda-represented-tags nil > >> >> > org-agenda-represented-categories nil) (if > >> org-agenda-top-headline-filter > >> >> > (progn (org-agenda-filter-top-headline-apply > >> >> > org-agenda-top-headline-filter))) (if org-agenda-tag-filter (progn > >> >> > (org-agenda-filter-apply org-agenda-tag-filter 'tag t))) (if (get > >> >> > 'org-agenda-tag-filter :preset-filter) (progn > (org-agenda-filter-apply > >> >> (get > >> >> > 'org-agenda-tag-filter :preset-filter) 'tag t))) (if > >> >> > org-agenda-category-filter (progn (org-agenda-filter-apply > >> >> > org-agenda-category-filter 'category))) (if (get > >> >> > 'org-agenda-category-filter :preset-filter) (progn > >> >> (org-agenda-filter-apply > >> >> > (get 'org-agenda-category-filter :preset-filter) 'category))) (if > >> >> > org-agenda-regexp-filter (progn (org-agenda-filter-apply > >> >> > org-agenda-regexp-filter 'regexp))) (if (get > 'org-agenda-regexp-filter > >> >> > :preset-filter) (progn (org-agenda-filter-apply (get > >> >> > 'org-agenda-regexp-filter :preset-filter) 'regexp))) (if > >> >> > org-agenda-effort-filter (progn (org-agenda-filter-apply > >> >> > org-agenda-effort-filter 'effort))) (if (get > 'org-agenda-effort-filter > >> >> > :preset-filter) (progn (org-agenda-filter-apply (get > >> >> > 'org-agenda-effort-filter :preset-filter) 'effort))) (add-hook > >> >> > 'kill-buffer-hook 'org-agenda-reset-markers 'append 'local)) > >> >> > (let ((inhibit-read-only t)) (save-excursion (goto-char > (point-min)) > >> >> > (save-excursion (while (org-activate-links (point-max)) (goto-char > >> >> > (match-end 0)))) (if (eq org-agenda-remove-tags t) nil > >> >> > (org-agenda-align-tags)) (if org-agenda-with-colors nil > >> >> > (remove-text-properties (point-min) (point-max) '(face nil))) (if > (and > >> >> > (boundp 'org-overriding-columns-format) > org-overriding-columns-format) > >> >> > (progn (set (make-local-variable 'org-local-columns-format) > >> >> > org-overriding-columns-format))) (if > org-agenda-view-columns-initially > >> >> > (progn (org-agenda-columns))) (if org-agenda-fontify-priorities > (progn > >> >> > (org-agenda-fontify-priorities))) (if (and > >> org-agenda-dim-blocked-tasks > >> >> > org-blocker-hook) (progn (org-agenda-dim-blocked-tasks))) > >> >> > (org-agenda-mark-clocking-task) (if org-agenda-entry-text-mode > (progn > >> >> > (org-agenda-entry-text-hide) (org-agenda-entry-text-show))) (if > (and > >> >> > (featurep 'org-habit) (save-excursion (next-single-property-change > >> >> > (point-min) 'org-habit-p))) (progn > >> >> (org-habit-insert-consistency-graphs))) > >> >> > (setq org-agenda-type (org-get-at-bol 'org-agenda-type)) (if (or > (eq > >> >> > org-agenda-show-inherited-tags 'always) (and (listp > >> >> > org-agenda-show-inherited-tags) (memq org-agenda-type > >> >> > org-agenda-show-inherited-tags)) (and (eq > >> org-agenda-show-inherited-tags > >> >> t) > >> >> > (or (eq org-agenda-use-tag-inheritance t) (and (listp > >> >> > org-agenda-use-tag-inheritance) (not ...))))) nil (let (mrk) > >> >> > (save-excursion (goto-char (point-min)) (while (equal > (forward-line) > >> 0) > >> >> (if > >> >> > (setq mrk ...) (progn ...)))))) (setq org-agenda-represented-tags > nil > >> >> > org-agenda-represented-categories nil) (if > >> org-agenda-top-headline-filter > >> >> > (progn (org-agenda-filter-top-headline-apply > >> >> > org-agenda-top-headline-filter))) (if org-agenda-tag-filter (progn > >> >> > (org-agenda-filter-apply org-agenda-tag-filter 'tag t))) (if (get > >> >> > 'org-agenda-tag-filter :preset-filter) (progn > (org-agenda-filter-apply > >> >> (get > >> >> > 'org-agenda-tag-filter :preset-filter) 'tag t))) (if > >> >> > org-agenda-category-filter (progn (org-agenda-filter-apply > >> >> > org-agenda-category-filter 'category))) (if (get > >> >> > 'org-agenda-category-filter :preset-filter) (progn > >> >> (org-agenda-filter-apply > >> >> > (get 'org-agenda-category-filter :preset-filter) 'category))) (if > >> >> > org-agenda-regexp-filter (progn (org-agenda-filter-apply > >> >> > org-agenda-regexp-filter 'regexp))) (if (get > 'org-agenda-regexp-filter > >> >> > :preset-filter) (progn (org-agenda-filter-apply (get > >> >> > 'org-agenda-regexp-filter :preset-filter) 'regexp))) (if > >> >> > org-agenda-effort-filter (progn (org-agenda-filter-apply > >> >> > org-agenda-effort-filter 'effort))) (if (get > 'org-agenda-effort-filter > >> >> > :preset-filter) (progn (org-agenda-filter-apply (get > >> >> > 'org-agenda-effort-filter :preset-filter) 'effort))) (add-hook > >> >> > 'kill-buffer-hook 'org-agenda-reset-markers 'append 'local)) > >> (run-hooks > >> >> > 'org-agenda-finalize-hook)) > >> >> > (if org-agenda-multi nil (let ((inhibit-read-only t)) > >> (save-excursion > >> >> > (goto-char (point-min)) (save-excursion (while (org-activate-links > >> >> > (point-max)) (goto-char (match-end 0)))) (if (eq > >> org-agenda-remove-tags > >> >> t) > >> >> > nil (org-agenda-align-tags)) (if org-agenda-with-colors nil > >> >> > (remove-text-properties (point-min) (point-max) '(face nil))) (if > (and > >> >> > (boundp 'org-overriding-columns-format) > org-overriding-columns-format) > >> >> > (progn (set (make-local-variable 'org-local-columns-format) > >> >> > org-overriding-columns-format))) (if > org-agenda-view-columns-initially > >> >> > (progn (org-agenda-columns))) (if org-agenda-fontify-priorities > (progn > >> >> > (org-agenda-fontify-priorities))) (if (and > >> org-agenda-dim-blocked-tasks > >> >> > org-blocker-hook) (progn (org-agenda-dim-blocked-tasks))) > >> >> > (org-agenda-mark-clocking-task) (if org-agenda-entry-text-mode > (progn > >> >> > (org-agenda-entry-text-hide) (org-agenda-entry-text-show))) (if > (and > >> >> > (featurep 'org-habit) (save-excursion (next-single-property-change > >> >> > (point-min) 'org-habit-p))) (progn > >> >> (org-habit-insert-consistency-graphs))) > >> >> > (setq org-agenda-type (org-get-at-bol 'org-agenda-type)) (if (or > (eq > >> >> > org-agenda-show-inherited-tags 'always) (and (listp > >> >> > org-agenda-show-inherited-tags) (memq org-agenda-type > >> >> > org-agenda-show-inherited-tags)) (and (eq > >> org-agenda-show-inherited-tags > >> >> t) > >> >> > (or (eq org-agenda-use-tag-inheritance t) (and ... ...)))) nil (let > >> (mrk) > >> >> > (save-excursion (goto-char (point-min)) (while (equal ... 0) (if > ... > >> >> > ...))))) (setq org-agenda-represented-tags nil > >> >> > org-agenda-represented-categories nil) (if > >> org-agenda-top-headline-filter > >> >> > (progn (org-agenda-filter-top-headline-apply > >> >> > org-agenda-top-headline-filter))) (if org-agenda-tag-filter (progn > >> >> > (org-agenda-filter-apply org-agenda-tag-filter 'tag t))) (if (get > >> >> > 'org-agenda-tag-filter :preset-filter) (progn > (org-agenda-filter-apply > >> >> (get > >> >> > 'org-agenda-tag-filter :preset-filter) 'tag t))) (if > >> >> > org-agenda-category-filter (progn (org-agenda-filter-apply > >> >> > org-agenda-category-filter 'category))) (if (get > >> >> > 'org-agenda-category-filter :preset-filter) (progn > >> >> (org-agenda-filter-apply > >> >> > (get 'org-agenda-category-filter :preset-filter) 'category))) (if > >> >> > org-agenda-regexp-filter (progn (org-agenda-filter-apply > >> >> > org-agenda-regexp-filter 'regexp))) (if (get > 'org-agenda-regexp-filter > >> >> > :preset-filter) (progn (org-agenda-filter-apply (get > >> >> > 'org-agenda-regexp-filter :preset-filter) 'regexp))) (if > >> >> > org-agenda-effort-filter (progn (org-agenda-filter-apply > >> >> > org-agenda-effort-filter 'effort))) (if (get > 'org-agenda-effort-filter > >> >> > :preset-filter) (progn (org-agenda-filter-apply (get > >> >> > 'org-agenda-effort-filter :preset-filter) 'effort))) (add-hook > >> >> > 'kill-buffer-hook 'org-agenda-reset-markers 'append 'local)) > >> (run-hooks > >> >> > 'org-agenda-finalize-hook))) > >> >> > org-agenda-finalize() > >> >> > (let* ((span (org-agenda-ndays-to-span (or span > org-agenda-span))) > >> >> (today > >> >> > (org-today)) (sd (or start-day today)) (ndays > >> (org-agenda-span-to-ndays > >> >> > span sd)) (org-agenda-start-on-weekday (and (or (eq ndays 7) (eq > ndays > >> >> 14)) > >> >> > org-agenda-start-on-weekday)) (thefiles (org-agenda-files nil > >> 'ifmode)) > >> >> > (files thefiles) (start (if (or (null org-agenda-start-on-weekday) > (< > >> >> ndays > >> >> > 7)) sd (let* ((nt ...) (n1 org-agenda-start-on-weekday) (d ...)) (- > >> sd (+ > >> >> > ... d))))) (day-numbers (list start)) (day-cnt 0) > (inhibit-redisplay > >> (not > >> >> > debug-on-error)) (org-agenda-show-log-scoped org-agenda-show-log) > s e > >> rtn > >> >> > rtnall file date d start-pos end-pos todayp clocktable-start > >> >> clocktable-end > >> >> > filter) (setq org-agenda-redo-command (list 'org-agenda-list (list > >> 'quote > >> >> > arg) start-day (list 'quote span) with-hour)) (let > ((--dotimes-limit-- > >> >> (1- > >> >> > ndays)) (n 0)) (while (< n --dotimes-limit--) (setq day-numbers > (cons > >> (1+ > >> >> > (car day-numbers)) day-numbers)) (setq n (1+ n)))) (setq > day-numbers > >> >> > (nreverse day-numbers)) (setq clocktable-start (car day-numbers) > >> >> > clocktable-end (1+ (or (org-last day-numbers) 0))) (set > >> >> > (make-local-variable 'org-starting-day) (car day-numbers)) (set > >> >> > (make-local-variable 'org-arg-loc) arg) (set (make-local-variable > >> >> > 'org-agenda-current-span) (org-agenda-ndays-to-span span)) (if > >> >> > org-agenda-compact-blocks nil (let* ((d1 (car day-numbers)) (d2 > >> (org-last > >> >> > day-numbers)) (w1 (org-days-to-iso-week d1)) (w2 > (org-days-to-iso-week > >> >> > d2))) (setq s (point)) (cond ((not org-agenda-overriding-header) > >> (insert > >> >> > (concat ... "-agenda" ... ":\n"))) ((equal > >> org-agenda-overriding-header > >> >> "") > >> >> > nil) ((stringp org-agenda-overriding-header) (insert (propertize > >> >> > org-agenda-overriding-header ... ...) "\n")) (t (user-error > "Invalid > >> >> value > >> >> > for `org-agenda-overriding-hea..." org-agenda-overriding-header)))) > >> (if > >> >> (> > >> >> > (point) s) (progn (add-text-properties s (1- (point)) (list 'face > >> >> > 'org-agenda-structure 'org-date-line t)) > (org-agenda-mark-header-line > >> >> s)))) > >> >> > (while (setq d (car-safe (prog1 day-numbers (setq day-numbers (cdr > >> >> > day-numbers))))) (setq date (calendar-gregorian-from-absolute d) s > >> >> (point)) > >> >> > (if (or (setq todayp (= d today)) (and (not start-pos) (= d sd))) > >> (setq > >> >> > start-pos (point)) (if (and start-pos (not end-pos)) (progn (setq > >> end-pos > >> >> > (point))))) (setq files thefiles rtnall nil) (while (setq file > >> (car-safe > >> >> > (prog1 files (setq files ...)))) (catch 'nextfile > >> (org-check-agenda-file > >> >> > file) (let ((org-agenda-entry-types org-agenda-entry-types)) (if > >> (member > >> >> > :deadline* org-agenda-entry-types) (progn ...)) (if (member > >> :scheduled* > >> >> > org-agenda-entry-types) (progn ...)) (if with-hour (progn ... ...)) > >> (if > >> >> > org-agenda-include-deadlines nil (setq org-agenda-entry-types ...)) > >> (cond > >> >> > (... ...) (org-agenda-show-log-scoped ...) (t ...))) (setq rtnall > >> (append > >> >> > rtnall rtn)))) (if org-agenda-include-diary (progn (let > >> >> > ((org-agenda-search-headline-for-time t)) (require 'diary-lib) > (setq > >> rtn > >> >> > (org-get-entries-from-diary date)) (setq rtnall (append rtnall > >> rtn))))) > >> >> (if > >> >> > (or rtnall org-agenda-show-all-dates) (progn (setq day-cnt (1+ > >> day-cnt)) > >> >> > (insert (if (stringp org-agenda-format-date) (format-time-string > >> >> > org-agenda-format-date ...) (funcall org-agenda-format-date date)) > >> "\n") > >> >> > (put-text-property s (1- (point)) 'face (org-agenda-get-day-face > >> date)) > >> >> > (put-text-property s (1- (point)) 'org-date-line t) > >> (put-text-property s > >> >> > (1- (point)) 'org-agenda-date-header t) (put-text-property s (1- > >> (point)) > >> >> > 'org-day-cnt day-cnt) (if todayp (progn (put-text-property s ... > ... > >> t))) > >> >> > (setq rtnall (org-agenda-add-time-grid-maybe rtnall ndays todayp)) > (if > >> >> > rtnall (progn (insert ... "\n"))) (put-text-property s (1- (point)) > >> 'day > >> >> d) > >> >> > (put-text-property s (1- (point)) 'org-day-cnt day-cnt)))) (if (and > >> >> > org-agenda-clockreport-mode clocktable-start) (progn (let > >> >> > ((org-agenda-files (org-agenda-files nil ...)) (p (copy-sequence > >> >> > org-agenda-clockreport-parameter-plist)) tbl) (setq p > >> (org-plist-delete p > >> >> > :block)) (setq p (plist-put p :tstart clocktable-start)) (setq p > >> >> (plist-put > >> >> > p :tend clocktable-end)) (setq p (plist-put p :scope 'agenda)) > (setq > >> tbl > >> >> > (apply 'org-clock-get-clocktable p)) (insert tbl)))) (goto-char > >> >> > (point-min)) (or org-agenda-multi > (org-agenda-fit-window-to-buffer)) > >> (if > >> >> > (or (not (get-buffer-window org-agenda-buffer-name)) (and > >> >> > (pos-visible-in-window-p (point-min)) (pos-visible-in-window-p > >> >> > (point-max)))) nil (goto-char (1- (point-max))) (recenter -1) (if > (not > >> >> > (pos-visible-in-window-p (or start-pos 1))) (progn (goto-char (or > >> >> start-pos > >> >> > 1)) (recenter 1)))) (goto-char (or start-pos 1)) > (add-text-properties > >> >> > (point-min) (point-max) (list 'org-agenda-type 'agenda > 'org-last-args > >> >> (list > >> >> > arg start-day span) 'org-redo-cmd org-agenda-redo-command > >> 'org-series-cmd > >> >> > org-cmd)) (if (eq org-agenda-show-log-scoped 'clockcheck) (progn > >> >> > (org-agenda-show-clocking-issues))) (org-agenda-finalize) (setq > >> >> > buffer-read-only t) (message "")) > >> >> > (catch 'exit (setq org-agenda-buffer-name (or > >> >> org-agenda-buffer-tmp-name > >> >> > (and org-agenda-doing-sticky-redo org-agenda-buffer-name) (if > >> >> > org-agenda-sticky (progn (cond (... ...) (org-keys ...) (t "*Org > >> >> > Agenda(a)*")))) "*Org Agenda*")) (org-agenda-prepare "Day/Week") > (setq > >> >> > start-day (or start-day org-agenda-start-day)) (if (stringp > start-day) > >> >> > (progn (setq start-day (time-to-days (org-read-date nil t > >> start-day))))) > >> >> > (org-compile-prefix-format 'agenda) (org-set-sorting-strategy > 'agenda) > >> >> > (let* ((span (org-agenda-ndays-to-span (or span org-agenda-span))) > >> (today > >> >> > (org-today)) (sd (or start-day today)) (ndays > >> (org-agenda-span-to-ndays > >> >> > span sd)) (org-agenda-start-on-weekday (and (or (eq ndays 7) (eq > ndays > >> >> 14)) > >> >> > org-agenda-start-on-weekday)) (thefiles (org-agenda-files nil > >> 'ifmode)) > >> >> > (files thefiles) (start (if (or (null org-agenda-start-on-weekday) > (< > >> >> ndays > >> >> > 7)) sd (let* (... ... ...) (- sd ...)))) (day-numbers (list start)) > >> >> > (day-cnt 0) (inhibit-redisplay (not debug-on-error)) > >> >> > (org-agenda-show-log-scoped org-agenda-show-log) s e rtn rtnall > file > >> >> date d > >> >> > start-pos end-pos todayp clocktable-start clocktable-end filter) > (setq > >> >> > org-agenda-redo-command (list 'org-agenda-list (list 'quote arg) > >> >> start-day > >> >> > (list 'quote span) with-hour)) (let ((--dotimes-limit-- (1- > ndays)) (n > >> >> 0)) > >> >> > (while (< n --dotimes-limit--) (setq day-numbers (cons (1+ ...) > >> >> > day-numbers)) (setq n (1+ n)))) (setq day-numbers (nreverse > >> day-numbers)) > >> >> > (setq clocktable-start (car day-numbers) clocktable-end (1+ (or > >> (org-last > >> >> > day-numbers) 0))) (set (make-local-variable 'org-starting-day) (car > >> >> > day-numbers)) (set (make-local-variable 'org-arg-loc) arg) (set > >> >> > (make-local-variable 'org-agenda-current-span) > >> (org-agenda-ndays-to-span > >> >> > span)) (if org-agenda-compact-blocks nil (let* ((d1 (car > day-numbers)) > >> >> (d2 > >> >> > (org-last day-numbers)) (w1 (org-days-to-iso-week d1)) (w2 > >> >> > (org-days-to-iso-week d2))) (setq s (point)) (cond ((not > >> >> > org-agenda-overriding-header) (insert ...)) ((equal > >> >> > org-agenda-overriding-header "") nil) ((stringp > >> >> > org-agenda-overriding-header) (insert ... "\n")) (t (user-error > >> "Invalid > >> >> > value for `org-agenda-overriding-hea..." > >> org-agenda-overriding-header)))) > >> >> > (if (> (point) s) (progn (add-text-properties s (1- ...) (list ... > ... > >> >> ... > >> >> > t)) (org-agenda-mark-header-line s)))) (while (setq d (car-safe > (prog1 > >> >> > day-numbers (setq day-numbers ...)))) (setq date > >> >> > (calendar-gregorian-from-absolute d) s (point)) (if (or (setq > todayp > >> (= d > >> >> > today)) (and (not start-pos) (= d sd))) (setq start-pos (point)) > (if > >> (and > >> >> > start-pos (not end-pos)) (progn (setq end-pos ...)))) (setq files > >> >> thefiles > >> >> > rtnall nil) (while (setq file (car-safe (prog1 files ...))) (catch > >> >> > 'nextfile (org-check-agenda-file file) (let (...) (if ... ...) (if > ... > >> >> ...) > >> >> > (if with-hour ...) (if org-agenda-include-deadlines nil ...) (cond > ... > >> >> ... > >> >> > ...)) (setq rtnall (append rtnall rtn)))) (if > org-agenda-include-diary > >> >> > (progn (let (...) (require ...) (setq rtn ...) (setq rtnall ...)))) > >> (if > >> >> (or > >> >> > rtnall org-agenda-show-all-dates) (progn (setq day-cnt (1+ > day-cnt)) > >> >> > (insert (if ... ... ...) "\n") (put-text-property s (1- ...) 'face > >> >> > (org-agenda-get-day-face date)) (put-text-property s (1- ...) > >> >> > 'org-date-line t) (put-text-property s (1- ...) > >> 'org-agenda-date-header > >> >> t) > >> >> > (put-text-property s (1- ...) 'org-day-cnt day-cnt) (if todayp > (progn > >> >> ...)) > >> >> > (setq rtnall (org-agenda-add-time-grid-maybe rtnall ndays todayp)) > (if > >> >> > rtnall (progn ...)) (put-text-property s (1- ...) 'day d) > >> >> > (put-text-property s (1- ...) 'org-day-cnt day-cnt)))) (if (and > >> >> > org-agenda-clockreport-mode clocktable-start) (progn (let > >> >> > ((org-agenda-files ...) (p ...) tbl) (setq p (org-plist-delete p > >> :block)) > >> >> > (setq p (plist-put p :tstart clocktable-start)) (setq p (plist-put > p > >> >> :tend > >> >> > clocktable-end)) (setq p (plist-put p :scope ...)) (setq tbl (apply > >> ... > >> >> p)) > >> >> > (insert tbl)))) (goto-char (point-min)) (or org-agenda-multi > >> >> > (org-agenda-fit-window-to-buffer)) (if (or (not (get-buffer-window > >> >> > org-agenda-buffer-name)) (and (pos-visible-in-window-p (point-min)) > >> >> > (pos-visible-in-window-p (point-max)))) nil (goto-char (1- > >> (point-max))) > >> >> > (recenter -1) (if (not (pos-visible-in-window-p (or start-pos 1))) > >> (progn > >> >> > (goto-char (or start-pos 1)) (recenter 1)))) (goto-char (or > start-pos > >> 1)) > >> >> > (add-text-properties (point-min) (point-max) (list 'org-agenda-type > >> >> 'agenda > >> >> > 'org-last-args (list arg start-day span) 'org-redo-cmd > >> >> > org-agenda-redo-command 'org-series-cmd org-cmd)) (if (eq > >> >> > org-agenda-show-log-scoped 'clockcheck) (progn > >> >> > (org-agenda-show-clocking-issues))) (org-agenda-finalize) (setq > >> >> > buffer-read-only t) (message ""))) > >> >> > org-agenda-list(nil nil day nil) > >> >> > (let nil (org-agenda-list 'nil nil 'day nil)) > >> >> > eval((let nil (org-agenda-list 'nil nil 'day nil))) > >> >> > org-let(nil (org-agenda-list 'nil nil 'day nil)) > >> >> > (if series-redo-cmd (eval series-redo-cmd) (org-let lprops > >> redo-cmd)) > >> >> > (let* ((p (or (and (looking-at "\\'") (1- (point))) (point))) > (cpa > >> (if > >> >> > (eq all t) nil current-prefix-arg)) (org-agenda-doing-sticky-redo > >> >> > org-agenda-sticky) (org-agenda-sticky nil) (org-agenda-buffer-name > (or > >> >> > org-agenda-this-buffer-name org-agenda-buffer-name)) > >> >> (org-agenda-keep-modes > >> >> > t) (tag-filter org-agenda-tag-filter) (tag-preset (get > >> >> > 'org-agenda-tag-filter :preset-filter)) (top-hl-filter > >> >> > org-agenda-top-headline-filter) (cat-filter > >> org-agenda-category-filter) > >> >> > (cat-preset (get 'org-agenda-category-filter :preset-filter)) > >> (re-filter > >> >> > org-agenda-regexp-filter) (re-preset (get 'org-agenda-regexp-filter > >> >> > :preset-filter)) (effort-filter org-agenda-effort-filter) > >> (effort-preset > >> >> > (get 'org-agenda-effort-filter :preset-filter)) > >> >> > (org-agenda-tag-filter-while-redo (or tag-filter tag-preset)) (cols > >> >> > org-agenda-columns-active) (line (org-current-line)) (window-line > (- > >> line > >> >> > (org-current-line (window-start)))) (lprops (get > >> 'org-agenda-redo-command > >> >> > 'org-lprops)) (redo-cmd (get-text-property p 'org-redo-cmd)) > >> (last-args > >> >> > (get-text-property p 'org-last-args)) (org-agenda-overriding-cmd > >> >> > (get-text-property p 'org-series-cmd)) > >> >> (org-agenda-overriding-cmd-arguments > >> >> > (if (eq all t) nil (cond ((listp last-args) (cons (or cpa ...) (cdr > >> >> > last-args))) ((stringp last-args) last-args)))) (series-redo-cmd > >> >> > (get-text-property p 'org-series-redo-cmd))) (put > >> 'org-agenda-tag-filter > >> >> > :preset-filter nil) (put 'org-agenda-category-filter :preset-filter > >> nil) > >> >> > (put 'org-agenda-regexp-filter :preset-filter nil) (put > >> >> > 'org-agenda-effort-filter :preset-filter nil) (and cols > >> >> (org-columns-quit)) > >> >> > (message "Rebuilding agenda buffer...") (if series-redo-cmd (eval > >> >> > series-redo-cmd) (org-let lprops redo-cmd)) (setq > org-agenda-undo-list > >> >> nil > >> >> > org-agenda-pending-undo-list nil org-agenda-tag-filter tag-filter > >> >> > org-agenda-category-filter cat-filter org-agenda-regexp-filter > >> re-filter > >> >> > org-agenda-effort-filter effort-filter > org-agenda-top-headline-filter > >> >> > top-hl-filter) (message "Rebuilding agenda buffer...done") (put > >> >> > 'org-agenda-tag-filter :preset-filter tag-preset) (put > >> >> > 'org-agenda-category-filter :preset-filter cat-preset) (put > >> >> > 'org-agenda-regexp-filter :preset-filter re-preset) (put > >> >> > 'org-agenda-effort-filter :preset-filter effort-preset) (let ((tag > (or > >> >> > tag-filter tag-preset)) (cat (or cat-filter cat-preset)) (effort > (or > >> >> > effort-filter effort-preset)) (re (or re-filter re-preset))) (if > tag > >> >> (progn > >> >> > (org-agenda-filter-apply tag 'tag t))) (if cat (progn > >> >> > (org-agenda-filter-apply cat 'category))) (if effort (progn > >> >> > (org-agenda-filter-apply effort 'effort))) (if re (progn > >> >> > (org-agenda-filter-apply re 'regexp)))) (and top-hl-filter > >> >> > (org-agenda-filter-top-headline-apply top-hl-filter)) (and cols > >> >> > (called-interactively-p 'any) (org-agenda-columns)) (org-goto-line > >> line) > >> >> > (recenter window-line)) > >> >> > org-agenda-redo(t) > >> >> > (if exhaustive (let ((--dolist-tail-- (buffer-list)) buffer) > (while > >> >> > --dolist-tail-- (setq buffer (car --dolist-tail--)) > >> (save-current-buffer > >> >> > (set-buffer buffer) (if (derived-mode-p 'org-agenda-mode) (progn > >> >> > (org-agenda-redo t)))) (setq --dolist-tail-- (cdr > --dolist-tail--)))) > >> >> > (org-agenda-redo t)) > >> >> > org-agenda-redo-all(nil) > >> >> > funcall-interactively(org-agenda-redo-all nil) > >> >> > call-interactively(org-agenda-redo-all nil nil) > >> >> > command-execute(org-agenda-redo-all) > >> >> > ``` > >> >> > > >> >> > [stardiviner] GPG key ID: > 47C32433 > >> >> > IRC(freeenode): stardiviner Twitter: > @numbchild > >> >> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 > 2433 > >> >> > Blog: http://stardiviner.github.io/ > >> >> > > >> >> > > >> >> > On Fri, Aug 14, 2020 at 1:15 PM Ihor Radchenko > > >> >> wrote: > >> >> > > >> >> >> > I want to get around this problem. So need to know how to detect > >> >> >> currently > >> >> >> > in logbook drawer or something else which used to record > clocking > >> >> note, > >> >> >> > `org-add-note`, etc. > >> >> >> > >> >> >> You may try to use `org-logbook-drawer-re'. > >> >> >> > >> >> >> > When I toggle org-log-mode and related options in org-agenda > >> buffer. I > >> >> >> > found my org-link-beautify will caused long time suspend and no > >> stop. > >> >> >> After > >> >> >> > debug, I found org-link-beautify text-property caused this > problem. > >> >> >> > >> >> >> Could you provide more details how your text property is causing > the > >> >> >> problem in org-agenda? Which function in agenda is slow? > >> >> >> > >> >> >> Best, > >> >> >> Ihor > >> >> >> > >> >> >> > >> >> >> "numbchild@gmail.com" writes: > >> >> >> > >> >> >> > I have a org-mode extension: > >> >> >> > > >> >> >> > >> >> > >> > https://github.com/stardiviner/org-link-beautify/blob/master/org-link-beautify.el#L71 > >> >> >> > > >> >> >> > It will beautify links with text-properties. > >> >> >> > > >> >> >> > When I toggle org-log-mode and related options in org-agenda > >> buffer. I > >> >> >> > found my org-link-beautify will caused long time suspend and no > >> stop. > >> >> >> After > >> >> >> > debug, I found org-link-beautify text-property caused this > problem. > >> >> >> > > >> >> >> > I want to get around this problem. So need to know how to detect > >> >> >> currently > >> >> >> > in logbook drawer or something else which used to record > clocking > >> >> note, > >> >> >> > `org-add-note`, etc. > >> >> >> > > >> >> >> > Or maybe org-agenda upstream can do something to work around > this > >> >> >> > text-properties issue? > >> >> >> > > >> >> >> > [stardiviner] GPG key ID: > >> 47C32433 > >> >> >> > IRC(freeenode): stardiviner Twitter: > >> @numbchild > >> >> >> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 > >> 2433 > >> >> >> > Blog: http://stardiviner.github.io/ > >> >> >> > >> >> > >> > --000000000000e9699a05ad0a27fd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Now I added `save-match-data` in my org-link-beautify. Tha= nks for tips.

Indeed. I will try this problem later and upda= te here if got any news.

At last, thanks for your helping. = Really thanks. :)

[stardiviner]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 <Hack this world!>=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 GPG key ID: 47C32433
IRC(freeenode): stardiviner =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 Twitter:=C2=A0 @numbchild
Key fingerprint =3D 9BAA= 92BC CDDD B9EF 3B36=C2=A0 CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/=


On Mon, Aug 17, 2020 at 9:50 AM I= hor Radchenko <yantar92@gmail.com<= /a>> wrote:
&= gt; I reviewed my org-link-beautify (
>
https://github.com/stardiviner/org-link-beautif= y) source code, I have not
> use any regexp matching. I guess the function
> `org-link-beautify--get-element` invoked `(org-element-context)` cause= d
> this problem or other similar places. But I use `debug-on-entry` on > `org-element-context`. Still have not got stoppoint backtrace.

Judging from source code of `org-element-context`, it does modify match
data. You can probably send a bug (or patch) fixing this. All is needed
is to wrap the code into `save-match-data`.

For you package, you can simply wrap all the code in `org-link-beautify` into (save-match-data ... ).

> And another step `debug-on-entry` on `org-link-beautify`,
> `org-agenda-finalize`, `org-activate-links`. I have not got a stoppoin= t
> backtrace on any of upper functions when org-agenda initializes. This = is
> weird, because I tested to use `debug-on-entry` on `org-agenda`. It ca= n
> popup a stoppoint backtrace.

Strange. I had no problem with debugging `org-agenda-finalize` on my
system.

Best,
Ihor


"numbchild@gm= ail.com" <numbchild@gmail.com> writes:

> Ihor, thanks for your detailed help.
> I followed your steps, the `elp` step, I confirmed `org-link-beautify`= is
> invoked and fall into an infinite loop.
>
> ```
> org-link-beautify=C2=A0 11265=C2=A0 =C2=A0 =C2=A0 =C2=A058.586412984= =C2=A0 0.0052007468
> ```
>
> And another step `debug-on-entry` on `org-link-beautify`,
> `org-agenda-finalize`, `org-activate-links`. I have not got a stoppoin= t
> backtrace on any of upper functions when org-agenda initializes. This = is
> weird, because I tested to use `debug-on-entry` on `org-agenda`. It ca= n
> popup a stoppoint backtrace.
>
> I reviewed my org-link-beautify (
> https://github.com/stardiviner/org-link-beautif= y) source code, I have not
> use any regexp matching. I guess the function
> `org-link-beautify--get-element` invoked `(org-element-context)` cause= d
> this problem or other similar places. But I use `debug-on-entry` on > `org-element-context`. Still have not got stoppoint backtrace.
>
> Need your more help. Sorry for disturbing you....
>
> [stardiviner]=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Hack this wo= rld!>=C2=A0 =C2=A0 =C2=A0 GPG key ID: 47C32433
> IRC(freeenode): stardiviner=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Twitter:=C2=A0 @numbchild
> Key fingerprint =3D 9BAA 92BC CDDD B9EF 3B36=C2=A0 CB99 B8C4 B8E5 47C3= 2433
> Blog: http://stardiviner.github.io/
>
>
> On Sun, Aug 16, 2020 at 2:39 PM Ihor Radchenko <yantar92@gmail.com> wrote:
>
>> > Your suggestion is very useful, I can see what function is in= voked many
>> > times. But still can't understand what's the cause. >>
>> Looking at your CPU profiler report I can see that the slow part i= s
>> happening while running org-agenda-finalize when agenda buffer is<= br> >> already populated. Most of time is taken by calling your function.= I
>> suspect that it is simply called many times (maybe infinite loop?)= .
>>
>> You may check the number of times your function is called using >>
>> (require 'elp)
>> (elp-instrument-function #'org-link-beautify)
>> ;; run agenda
>> ;; M-x elp-results
>>
>> Another suggestion would be invoking debug-on-entry for you functi= on,
>> for org-activate-links, and for org-agenda-finalize.
>>
>> Best,
>> Ihor
>>
>>
>>
>>
>> "num= bchild@gmail.com" <numbchild@gmail.com> writes:
>>
>> > I tried use debug-on-entry on:
>> >=C2=A0 =C2=A0+ org-agenda-list(nil)
>> >=C2=A0 =C2=A0 =C2=A0- org-agenda-mode()
>> >=C2=A0 =C2=A0 =C2=A0 =C2=A0+ org-agenda-set-mode-name()
>> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0- org-update-dblock
>> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0+ org-dblock-write:cl= ocktable
>> >
>> > But got no lucky, Then I followed your another suggestion, us= e profiler:
>> >
>> > I got a very big message log, (not suitable for paste in emai= l, so I
>> paste
>> > it on Gist)
>> >
>> > - CPU profiler report: https://www.pastery.net/gststf/<= /a>
>> > - Memory profiler report:
https://www.pas= tery.net/gststf+qzyxaf/#qzyxaf
>> >
>> > The very deepest call stacks seems the output format is not l= ong enough,
>> so
>> > can't display.
>> >
>> > Your suggestion is very useful, I can see what function is in= voked many
>> > times. But still can't understand what's the cause. >> >
>> > [stardiviner]=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<Hac= k this world!>=C2=A0 =C2=A0 =C2=A0 GPG key ID: 47C32433
>> > IRC(freeenode): stardiviner=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Twitter:=C2=A0 @numbchild
>> > Key fingerprint =3D 9BAA 92BC CDDD B9EF 3B36=C2=A0 CB99 B8C4 = B8E5 47C3 2433
>> > Blog: http://stardiviner.github.io/
>> >
>> >
>> > On Sat, Aug 15, 2020 at 2:02 PM Ihor Radchenko <yantar92@gmail.com> >> wrote:
>> >
>> >> >Here is the backtrace of "toggle-debug-on-quit&q= uot; when I refresh
>> org-agenda
>> >> >but has long time suspend.
>> >>
>> >> That looks unreadable for me. Also, debug on quit may not= show the
>> >> problematic part depending on your luck.
>> >>
>> >> It would be easier to understand your problem if you prov= ided the
>> >> profiler report (M-x profiler-start ... M-x profiler-repo= rt).
>> >> Then, you could debug-on-entry using the problematic part= according to
>> >> the profiler report.
>> >>
>> >> A blind guess - maybe you are modifying match data somewh= ere in your
>> >> code. This might cause infinite loop in
>> >>
>> >> > (while (org-activate-links (point-max)) (goto-char (= match-end 0)))
>> >>
>> >> Best,
>> >> Ihor
>> >>
>> >> "numbchild@gmail.com" <numbchild@gmail.com> writes:
>> >>
>> >> > Thanks for replying, Ihor. I will look into this reg= exp.
>> >> >
>> >> > Here is the backtrace of "toggle-debug-on-quit&= quot; when I refresh
>> org-agenda
>> >> > but has long time suspend.
>> >> >
>> >> > ```
>> >> > Debugger entered--Lisp error: (quit)
>> >> >
>> >> >
>> >>
>> re-search-forward("\\(\\[\\[\\(\\(?:[^][\\]\\|\\\\\\(?:\\\\\\= \\\\)*[][]\\|\\\\+[^][]\\)+..."
>> >> > 17651 t)
>> >> >=C2=A0 =C2=A0(while (re-search-forward org-link-any-r= e limit t) (let* ((start
>> >> > (match-beginning 0)) (end (match-end 0)) (visible-st= art (or
>> >> > (match-beginning 3) (match-beginning 2))) (visible-e= nd (or (match-end
>> 3)
>> >> > (match-end 2))) (style (cond ((eq 60 (char-after sta= rt)) 'angle) ((eq
>> 91
>> >> > (char-after ...)) 'bracket) (t 'plain)))) (i= f (and (memq style
>> >> > org-highlight-links) (not (string-match-p
>> org-element-paragraph-separate
>> >> > (match-string 0))) (not (and (eq style 'plain) (= let (...) (if ... ...
>> >> > ...))))) (progn (let* ((link-object (save-excursion = ... ...)) (link
>> >> > (org-element-property :raw-link link-object)) (type<= br> >> (org-element-property
>> >> > :type link-object)) (path (org-element-property :pat= h link-object))
>> >> > (properties (list ... ... ... ... ... ... ... ... ..= . ... ... t)))
>> >> > (org-remove-flyspell-overlays-in start end) (org-rea= r-nonsticky-at
>> end)
>> >> (if
>> >> > (not (eq ... style)) (add-text-properties start end = properties)
>> >> > (remove-text-properties start end '...) (let (..= .)
>> (add-text-properties
>> >> > start visible-start hidden) (add-text-properties vis= ible-start
>> >> visible-end
>> >> > properties) (add-text-properties visible-end end hid= den)
>> >> > (org-rear-nonsticky-at visible-start) (org-rear-nons= ticky-at
>> >> visible-end)))
>> >> > (let ((f ...)) (if (functionp f) (progn ...))) (thro= w :exit t))))))
>> >> >=C2=A0 =C2=A0(catch :exit (while (re-search-forward o= rg-link-any-re limit t)
>> (let*
>> >> > ((start (match-beginning 0)) (end (match-end 0)) (vi= sible-start (or
>> >> > (match-beginning 3) (match-beginning 2))) (visible-e= nd (or (match-end
>> 3)
>> >> > (match-end 2))) (style (cond ((eq 60 ...) 'angle= ) ((eq 91 ...)
>> 'bracket)
>> >> (t
>> >> > 'plain)))) (if (and (memq style org-highlight-li= nks) (not
>> (string-match-p
>> >> > org-element-paragraph-separate (match-string 0))) (n= ot (and (eq style
>> >> ...)
>> >> > (let ... ...)))) (progn (let* ((link-object ...) (li= nk ...) (type ...)
>> >> > (path ...) (properties ...)) (org-remove-flyspell-ov= erlays-in start
>> end)
>> >> > (org-rear-nonsticky-at end) (if (not ...) (add-text-= properties start
>> end
>> >> > properties) (remove-text-properties start end ...) (= let ... ... ...
>> ...
>> >> ...
>> >> > ...)) (let (...) (if ... ...)) (throw :exit t)))))) = nil)
>> >> >=C2=A0 =C2=A0org-activate-links(17651)
>> >> >=C2=A0 =C2=A0(while (org-activate-links (point-max)) = (goto-char (match-end 0)))
>> >> >=C2=A0 =C2=A0(save-excursion (while (org-activate-lin= ks (point-max)) (goto-char
>> >> > (match-end 0))))
>> >> >=C2=A0 =C2=A0(save-excursion (goto-char (point-min)) = (save-excursion (while
>> >> > (org-activate-links (point-max)) (goto-char (match-e= nd 0)))) (if (eq
>> >> > org-agenda-remove-tags t) nil (org-agenda-align-tags= )) (if
>> >> > org-agenda-with-colors nil (remove-text-properties (= point-min)
>> >> (point-max)
>> >> > '(face nil))) (if (and (boundp 'org-overridi= ng-columns-format)
>> >> > org-overriding-columns-format) (progn (set (make-loc= al-variable
>> >> > 'org-local-columns-format) org-overriding-column= s-format))) (if
>> >> > org-agenda-view-columns-initially (progn (org-agenda= -columns))) (if
>> >> > org-agenda-fontify-priorities (progn (org-agenda-fon= tify-priorities)))
>> >> (if
>> >> > (and org-agenda-dim-blocked-tasks org-blocker-hook) = (progn
>> >> > (org-agenda-dim-blocked-tasks))) (org-agenda-mark-cl= ocking-task) (if
>> >> > org-agenda-entry-text-mode (progn (org-agenda-entry-= text-hide)
>> >> > (org-agenda-entry-text-show))) (if (and (featurep &#= 39;org-habit)
>> >> > (save-excursion (next-single-property-change (point-= min)
>> 'org-habit-p)))
>> >> > (progn (org-habit-insert-consistency-graphs))) (setq= org-agenda-type
>> >> > (org-get-at-bol 'org-agenda-type)) (if (or (eq >> >> > org-agenda-show-inherited-tags 'always) (and (li= stp
>> >> > org-agenda-show-inherited-tags) (memq org-agenda-typ= e
>> >> > org-agenda-show-inherited-tags)) (and (eq
>> org-agenda-show-inherited-tags
>> >> t)
>> >> > (or (eq org-agenda-use-tag-inheritance t) (and (list= p
>> >> > org-agenda-use-tag-inheritance) (not (memq org-agend= a-type
>> >> > org-agenda-use-tag-inheritance)))))) nil (let (mrk) = (save-excursion
>> >> > (goto-char (point-min)) (while (equal (forward-line)= 0) (if (setq mrk
>> >> > (get-text-property ... ...)) (progn (put-text-proper= ty ... ... ...
>> >> > ...))))))) (setq org-agenda-represented-tags nil
>> >> > org-agenda-represented-categories nil) (if
>> org-agenda-top-headline-filter
>> >> > (progn (org-agenda-filter-top-headline-apply
>> >> > org-agenda-top-headline-filter))) (if org-agenda-tag= -filter (progn
>> >> > (org-agenda-filter-apply org-agenda-tag-filter '= tag t))) (if (get
>> >> > 'org-agenda-tag-filter :preset-filter) (progn (o= rg-agenda-filter-apply
>> >> (get
>> >> > 'org-agenda-tag-filter :preset-filter) 'tag = t))) (if
>> >> > org-agenda-category-filter (progn (org-agenda-filter= -apply
>> >> > org-agenda-category-filter 'category))) (if (get=
>> >> > 'org-agenda-category-filter :preset-filter) (pro= gn
>> >> (org-agenda-filter-apply
>> >> > (get 'org-agenda-category-filter :preset-filter)= 'category))) (if
>> >> > org-agenda-regexp-filter (progn (org-agenda-filter-a= pply
>> >> > org-agenda-regexp-filter 'regexp))) (if (get = 9;org-agenda-regexp-filter
>> >> > :preset-filter) (progn (org-agenda-filter-apply (get=
>> >> > 'org-agenda-regexp-filter :preset-filter) 'r= egexp))) (if
>> >> > org-agenda-effort-filter (progn (org-agenda-filter-a= pply
>> >> > org-agenda-effort-filter 'effort))) (if (get = 9;org-agenda-effort-filter
>> >> > :preset-filter) (progn (org-agenda-filter-apply (get=
>> >> > 'org-agenda-effort-filter :preset-filter) 'e= ffort))) (add-hook
>> >> > 'kill-buffer-hook 'org-agenda-reset-markers = 'append 'local))
>> >> >=C2=A0 =C2=A0(let ((inhibit-read-only t)) (save-excur= sion (goto-char (point-min))
>> >> > (save-excursion (while (org-activate-links (point-ma= x)) (goto-char
>> >> > (match-end 0)))) (if (eq org-agenda-remove-tags t) n= il
>> >> > (org-agenda-align-tags)) (if org-agenda-with-colors = nil
>> >> > (remove-text-properties (point-min) (point-max) '= ;(face nil))) (if (and
>> >> > (boundp 'org-overriding-columns-format) org-over= riding-columns-format)
>> >> > (progn (set (make-local-variable 'org-local-colu= mns-format)
>> >> > org-overriding-columns-format))) (if org-agenda-view= -columns-initially
>> >> > (progn (org-agenda-columns))) (if org-agenda-fontify= -priorities (progn
>> >> > (org-agenda-fontify-priorities))) (if (and
>> org-agenda-dim-blocked-tasks
>> >> > org-blocker-hook) (progn (org-agenda-dim-blocked-tas= ks)))
>> >> > (org-agenda-mark-clocking-task) (if org-agenda-entry= -text-mode (progn
>> >> > (org-agenda-entry-text-hide) (org-agenda-entry-text-= show))) (if (and
>> >> > (featurep 'org-habit) (save-excursion (next-sing= le-property-change
>> >> > (point-min) 'org-habit-p))) (progn
>> >> (org-habit-insert-consistency-graphs)))
>> >> > (setq org-agenda-type (org-get-at-bol 'org-agend= a-type)) (if (or (eq
>> >> > org-agenda-show-inherited-tags 'always) (and (li= stp
>> >> > org-agenda-show-inherited-tags) (memq org-agenda-typ= e
>> >> > org-agenda-show-inherited-tags)) (and (eq
>> org-agenda-show-inherited-tags
>> >> t)
>> >> > (or (eq org-agenda-use-tag-inheritance t) (and (list= p
>> >> > org-agenda-use-tag-inheritance) (not ...))))) nil (l= et (mrk)
>> >> > (save-excursion (goto-char (point-min)) (while (equa= l (forward-line)
>> 0)
>> >> (if
>> >> > (setq mrk ...) (progn ...)))))) (setq org-agenda-rep= resented-tags nil
>> >> > org-agenda-represented-categories nil) (if
>> org-agenda-top-headline-filter
>> >> > (progn (org-agenda-filter-top-headline-apply
>> >> > org-agenda-top-headline-filter))) (if org-agenda-tag= -filter (progn
>> >> > (org-agenda-filter-apply org-agenda-tag-filter '= tag t))) (if (get
>> >> > 'org-agenda-tag-filter :preset-filter) (progn (o= rg-agenda-filter-apply
>> >> (get
>> >> > 'org-agenda-tag-filter :preset-filter) 'tag = t))) (if
>> >> > org-agenda-category-filter (progn (org-agenda-filter= -apply
>> >> > org-agenda-category-filter 'category))) (if (get=
>> >> > 'org-agenda-category-filter :preset-filter) (pro= gn
>> >> (org-agenda-filter-apply
>> >> > (get 'org-agenda-category-filter :preset-filter)= 'category))) (if
>> >> > org-agenda-regexp-filter (progn (org-agenda-filter-a= pply
>> >> > org-agenda-regexp-filter 'regexp))) (if (get = 9;org-agenda-regexp-filter
>> >> > :preset-filter) (progn (org-agenda-filter-apply (get=
>> >> > 'org-agenda-regexp-filter :preset-filter) 'r= egexp))) (if
>> >> > org-agenda-effort-filter (progn (org-agenda-filter-a= pply
>> >> > org-agenda-effort-filter 'effort))) (if (get = 9;org-agenda-effort-filter
>> >> > :preset-filter) (progn (org-agenda-filter-apply (get=
>> >> > 'org-agenda-effort-filter :preset-filter) 'e= ffort))) (add-hook
>> >> > 'kill-buffer-hook 'org-agenda-reset-markers = 'append 'local))
>> (run-hooks
>> >> > 'org-agenda-finalize-hook))
>> >> >=C2=A0 =C2=A0(if org-agenda-multi nil (let ((inhibit-= read-only t))
>> (save-excursion
>> >> > (goto-char (point-min)) (save-excursion (while (org-= activate-links
>> >> > (point-max)) (goto-char (match-end 0)))) (if (eq
>> org-agenda-remove-tags
>> >> t)
>> >> > nil (org-agenda-align-tags)) (if org-agenda-with-col= ors nil
>> >> > (remove-text-properties (point-min) (point-max) '= ;(face nil))) (if (and
>> >> > (boundp 'org-overriding-columns-format) org-over= riding-columns-format)
>> >> > (progn (set (make-local-variable 'org-local-colu= mns-format)
>> >> > org-overriding-columns-format))) (if org-agenda-view= -columns-initially
>> >> > (progn (org-agenda-columns))) (if org-agenda-fontify= -priorities (progn
>> >> > (org-agenda-fontify-priorities))) (if (and
>> org-agenda-dim-blocked-tasks
>> >> > org-blocker-hook) (progn (org-agenda-dim-blocked-tas= ks)))
>> >> > (org-agenda-mark-clocking-task) (if org-agenda-entry= -text-mode (progn
>> >> > (org-agenda-entry-text-hide) (org-agenda-entry-text-= show))) (if (and
>> >> > (featurep 'org-habit) (save-excursion (next-sing= le-property-change
>> >> > (point-min) 'org-habit-p))) (progn
>> >> (org-habit-insert-consistency-graphs)))
>> >> > (setq org-agenda-type (org-get-at-bol 'org-agend= a-type)) (if (or (eq
>> >> > org-agenda-show-inherited-tags 'always) (and (li= stp
>> >> > org-agenda-show-inherited-tags) (memq org-agenda-typ= e
>> >> > org-agenda-show-inherited-tags)) (and (eq
>> org-agenda-show-inherited-tags
>> >> t)
>> >> > (or (eq org-agenda-use-tag-inheritance t) (and ... .= ..)))) nil (let
>> (mrk)
>> >> > (save-excursion (goto-char (point-min)) (while (equa= l ... 0) (if ...
>> >> > ...))))) (setq org-agenda-represented-tags nil
>> >> > org-agenda-represented-categories nil) (if
>> org-agenda-top-headline-filter
>> >> > (progn (org-agenda-filter-top-headline-apply
>> >> > org-agenda-top-headline-filter))) (if org-agenda-tag= -filter (progn
>> >> > (org-agenda-filter-apply org-agenda-tag-filter '= tag t))) (if (get
>> >> > 'org-agenda-tag-filter :preset-filter) (progn (o= rg-agenda-filter-apply
>> >> (get
>> >> > 'org-agenda-tag-filter :preset-filter) 'tag = t))) (if
>> >> > org-agenda-category-filter (progn (org-agenda-filter= -apply
>> >> > org-agenda-category-filter 'category))) (if (get=
>> >> > 'org-agenda-category-filter :preset-filter) (pro= gn
>> >> (org-agenda-filter-apply
>> >> > (get 'org-agenda-category-filter :preset-filter)= 'category))) (if
>> >> > org-agenda-regexp-filter (progn (org-agenda-filter-a= pply
>> >> > org-agenda-regexp-filter 'regexp))) (if (get = 9;org-agenda-regexp-filter
>> >> > :preset-filter) (progn (org-agenda-filter-apply (get=
>> >> > 'org-agenda-regexp-filter :preset-filter) 'r= egexp))) (if
>> >> > org-agenda-effort-filter (progn (org-agenda-filter-a= pply
>> >> > org-agenda-effort-filter 'effort))) (if (get = 9;org-agenda-effort-filter
>> >> > :preset-filter) (progn (org-agenda-filter-apply (get=
>> >> > 'org-agenda-effort-filter :preset-filter) 'e= ffort))) (add-hook
>> >> > 'kill-buffer-hook 'org-agenda-reset-markers = 'append 'local))
>> (run-hooks
>> >> > 'org-agenda-finalize-hook)))
>> >> >=C2=A0 =C2=A0org-agenda-finalize()
>> >> >=C2=A0 =C2=A0(let* ((span (org-agenda-ndays-to-span (= or span org-agenda-span)))
>> >> (today
>> >> > (org-today)) (sd (or start-day today)) (ndays
>> (org-agenda-span-to-ndays
>> >> > span sd)) (org-agenda-start-on-weekday (and (or (eq = ndays 7) (eq ndays
>> >> 14))
>> >> > org-agenda-start-on-weekday)) (thefiles (org-agenda-= files nil
>> 'ifmode))
>> >> > (files thefiles) (start (if (or (null org-agenda-sta= rt-on-weekday) (<
>> >> ndays
>> >> > 7)) sd (let* ((nt ...) (n1 org-agenda-start-on-weekd= ay) (d ...)) (-
>> sd (+
>> >> > ... d))))) (day-numbers (list start)) (day-cnt 0) (i= nhibit-redisplay
>> (not
>> >> > debug-on-error)) (org-agenda-show-log-scoped org-age= nda-show-log) s e
>> rtn
>> >> > rtnall file date d start-pos end-pos todayp clocktab= le-start
>> >> clocktable-end
>> >> > filter) (setq org-agenda-redo-command (list 'org= -agenda-list (list
>> 'quote
>> >> > arg) start-day (list 'quote span) with-hour)) (l= et ((--dotimes-limit--
>> >> (1-
>> >> > ndays)) (n 0)) (while (< n --dotimes-limit--) (se= tq day-numbers (cons
>> (1+
>> >> > (car day-numbers)) day-numbers)) (setq n (1+ n)))) (= setq day-numbers
>> >> > (nreverse day-numbers)) (setq clocktable-start (car = day-numbers)
>> >> > clocktable-end (1+ (or (org-last day-numbers) 0))) (= set
>> >> > (make-local-variable 'org-starting-day) (car day= -numbers)) (set
>> >> > (make-local-variable 'org-arg-loc) arg) (set (ma= ke-local-variable
>> >> > 'org-agenda-current-span) (org-agenda-ndays-to-s= pan span)) (if
>> >> > org-agenda-compact-blocks nil (let* ((d1 (car day-nu= mbers)) (d2
>> (org-last
>> >> > day-numbers)) (w1 (org-days-to-iso-week d1)) (w2 (or= g-days-to-iso-week
>> >> > d2))) (setq s (point)) (cond ((not org-agenda-overri= ding-header)
>> (insert
>> >> > (concat ... "-agenda" ... ":\n")= )) ((equal
>> org-agenda-overriding-header
>> >> "")
>> >> > nil) ((stringp org-agenda-overriding-header) (insert= (propertize
>> >> > org-agenda-overriding-header ... ...) "\n"= )) (t (user-error "Invalid
>> >> value
>> >> > for `org-agenda-overriding-hea..." org-agenda-o= verriding-header))))
>> (if
>> >> (>
>> >> > (point) s) (progn (add-text-properties s (1- (point)= ) (list 'face
>> >> > 'org-agenda-structure 'org-date-line t)) (or= g-agenda-mark-header-line
>> >> s))))
>> >> > (while (setq d (car-safe (prog1 day-numbers (setq da= y-numbers (cdr
>> >> > day-numbers))))) (setq date (calendar-gregorian-from= -absolute d) s
>> >> (point))
>> >> > (if (or (setq todayp (=3D d today)) (and (not start-= pos) (=3D d sd)))
>> (setq
>> >> > start-pos (point)) (if (and start-pos (not end-pos))= (progn (setq
>> end-pos
>> >> > (point))))) (setq files thefiles rtnall nil) (while = (setq file
>> (car-safe
>> >> > (prog1 files (setq files ...)))) (catch 'nextfil= e
>> (org-check-agenda-file
>> >> > file) (let ((org-agenda-entry-types org-agenda-entry= -types)) (if
>> (member
>> >> > :deadline* org-agenda-entry-types) (progn ...)) (if = (member
>> :scheduled*
>> >> > org-agenda-entry-types) (progn ...)) (if with-hour (= progn ... ...))
>> (if
>> >> > org-agenda-include-deadlines nil (setq org-agenda-en= try-types ...))
>> (cond
>> >> > (... ...) (org-agenda-show-log-scoped ...) (t ...)))= (setq rtnall
>> (append
>> >> > rtnall rtn)))) (if org-agenda-include-diary (progn (= let
>> >> > ((org-agenda-search-headline-for-time t)) (require &= #39;diary-lib) (setq
>> rtn
>> >> > (org-get-entries-from-diary date)) (setq rtnall (app= end rtnall
>> rtn)))))
>> >> (if
>> >> > (or rtnall org-agenda-show-all-dates) (progn (setq d= ay-cnt (1+
>> day-cnt))
>> >> > (insert (if (stringp org-agenda-format-date) (format= -time-string
>> >> > org-agenda-format-date ...) (funcall org-agenda-form= at-date date))
>> "\n")
>> >> > (put-text-property s (1- (point)) 'face (org-age= nda-get-day-face
>> date))
>> >> > (put-text-property s (1- (point)) 'org-date-line= t)
>> (put-text-property s
>> >> > (1- (point)) 'org-agenda-date-header t) (put-tex= t-property s (1-
>> (point))
>> >> > 'org-day-cnt day-cnt) (if todayp (progn (put-tex= t-property s ... ...
>> t)))
>> >> > (setq rtnall (org-agenda-add-time-grid-maybe rtnall = ndays todayp)) (if
>> >> > rtnall (progn (insert ... "\n"))) (put-tex= t-property s (1- (point))
>> 'day
>> >> d)
>> >> > (put-text-property s (1- (point)) 'org-day-cnt d= ay-cnt)))) (if (and
>> >> > org-agenda-clockreport-mode clocktable-start) (progn= (let
>> >> > ((org-agenda-files (org-agenda-files nil ...)) (p (c= opy-sequence
>> >> > org-agenda-clockreport-parameter-plist)) tbl) (setq = p
>> (org-plist-delete p
>> >> > :block)) (setq p (plist-put p :tstart clocktable-sta= rt)) (setq p
>> >> (plist-put
>> >> > p :tend clocktable-end)) (setq p (plist-put p :scope= 'agenda)) (setq
>> tbl
>> >> > (apply 'org-clock-get-clocktable p)) (insert tbl= )))) (goto-char
>> >> > (point-min)) (or org-agenda-multi (org-agenda-fit-wi= ndow-to-buffer))
>> (if
>> >> > (or (not (get-buffer-window org-agenda-buffer-name))= (and
>> >> > (pos-visible-in-window-p (point-min)) (pos-visible-i= n-window-p
>> >> > (point-max)))) nil (goto-char (1- (point-max))) (rec= enter -1) (if (not
>> >> > (pos-visible-in-window-p (or start-pos 1))) (progn (= goto-char (or
>> >> start-pos
>> >> > 1)) (recenter 1)))) (goto-char (or start-pos 1)) (ad= d-text-properties
>> >> > (point-min) (point-max) (list 'org-agenda-type &= #39;agenda 'org-last-args
>> >> (list
>> >> > arg start-day span) 'org-redo-cmd org-agenda-red= o-command
>> 'org-series-cmd
>> >> > org-cmd)) (if (eq org-agenda-show-log-scoped 'cl= ockcheck) (progn
>> >> > (org-agenda-show-clocking-issues))) (org-agenda-fina= lize) (setq
>> >> > buffer-read-only t) (message ""))
>> >> >=C2=A0 =C2=A0(catch 'exit (setq org-agenda-buffer= -name (or
>> >> org-agenda-buffer-tmp-name
>> >> > (and org-agenda-doing-sticky-redo org-agenda-buffer-= name) (if
>> >> > org-agenda-sticky (progn (cond (... ...) (org-keys .= ..) (t "*Org
>> >> > Agenda(a)*")))) "*Org Agenda*")) (org= -agenda-prepare "Day/Week") (setq
>> >> > start-day (or start-day org-agenda-start-day)) (if (= stringp start-day)
>> >> > (progn (setq start-day (time-to-days (org-read-date = nil t
>> start-day)))))
>> >> > (org-compile-prefix-format 'agenda) (org-set-sor= ting-strategy 'agenda)
>> >> > (let* ((span (org-agenda-ndays-to-span (or span org-= agenda-span)))
>> (today
>> >> > (org-today)) (sd (or start-day today)) (ndays
>> (org-agenda-span-to-ndays
>> >> > span sd)) (org-agenda-start-on-weekday (and (or (eq = ndays 7) (eq ndays
>> >> 14))
>> >> > org-agenda-start-on-weekday)) (thefiles (org-agenda-= files nil
>> 'ifmode))
>> >> > (files thefiles) (start (if (or (null org-agenda-sta= rt-on-weekday) (<
>> >> ndays
>> >> > 7)) sd (let* (... ... ...) (- sd ...)))) (day-number= s (list start))
>> >> > (day-cnt 0) (inhibit-redisplay (not debug-on-error))=
>> >> > (org-agenda-show-log-scoped org-agenda-show-log) s e= rtn rtnall file
>> >> date d
>> >> > start-pos end-pos todayp clocktable-start clocktable= -end filter) (setq
>> >> > org-agenda-redo-command (list 'org-agenda-list (= list 'quote arg)
>> >> start-day
>> >> > (list 'quote span) with-hour)) (let ((--dotimes-= limit-- (1- ndays)) (n
>> >> 0))
>> >> > (while (< n --dotimes-limit--) (setq day-numbers = (cons (1+ ...)
>> >> > day-numbers)) (setq n (1+ n)))) (setq day-numbers (n= reverse
>> day-numbers))
>> >> > (setq clocktable-start (car day-numbers) clocktable-= end (1+ (or
>> (org-last
>> >> > day-numbers) 0))) (set (make-local-variable 'org= -starting-day) (car
>> >> > day-numbers)) (set (make-local-variable 'org-arg= -loc) arg) (set
>> >> > (make-local-variable 'org-agenda-current-span) >> (org-agenda-ndays-to-span
>> >> > span)) (if org-agenda-compact-blocks nil (let* ((d1 = (car day-numbers))
>> >> (d2
>> >> > (org-last day-numbers)) (w1 (org-days-to-iso-week d1= )) (w2
>> >> > (org-days-to-iso-week d2))) (setq s (point)) (cond (= (not
>> >> > org-agenda-overriding-header) (insert ...)) ((equal<= br> >> >> > org-agenda-overriding-header "") nil) ((st= ringp
>> >> > org-agenda-overriding-header) (insert ... "\n&q= uot;)) (t (user-error
>> "Invalid
>> >> > value for `org-agenda-overriding-hea..."
>> org-agenda-overriding-header))))
>> >> > (if (> (point) s) (progn (add-text-properties s (= 1- ...) (list ... ...
>> >> ...
>> >> > t)) (org-agenda-mark-header-line s)))) (while (setq = d (car-safe (prog1
>> >> > day-numbers (setq day-numbers ...)))) (setq date
>> >> > (calendar-gregorian-from-absolute d) s (point)) (if = (or (setq todayp
>> (=3D d
>> >> > today)) (and (not start-pos) (=3D d sd))) (setq star= t-pos (point)) (if
>> (and
>> >> > start-pos (not end-pos)) (progn (setq end-pos ...)))= ) (setq files
>> >> thefiles
>> >> > rtnall nil) (while (setq file (car-safe (prog1 files= ...))) (catch
>> >> > 'nextfile (org-check-agenda-file file) (let (...= ) (if ... ...) (if ...
>> >> ...)
>> >> > (if with-hour ...) (if org-agenda-include-deadlines = nil ...) (cond ...
>> >> ...
>> >> > ...)) (setq rtnall (append rtnall rtn)))) (if org-ag= enda-include-diary
>> >> > (progn (let (...) (require ...) (setq rtn ...) (setq= rtnall ...))))
>> (if
>> >> (or
>> >> > rtnall org-agenda-show-all-dates) (progn (setq day-c= nt (1+ day-cnt))
>> >> > (insert (if ... ... ...) "\n") (put-text-p= roperty s (1- ...) 'face
>> >> > (org-agenda-get-day-face date)) (put-text-property s= (1- ...)
>> >> > 'org-date-line t) (put-text-property s (1- ...)<= br> >> 'org-agenda-date-header
>> >> t)
>> >> > (put-text-property s (1- ...) 'org-day-cnt day-c= nt) (if todayp (progn
>> >> ...))
>> >> > (setq rtnall (org-agenda-add-time-grid-maybe rtnall = ndays todayp)) (if
>> >> > rtnall (progn ...)) (put-text-property s (1- ...) &#= 39;day d)
>> >> > (put-text-property s (1- ...) 'org-day-cnt day-c= nt)))) (if (and
>> >> > org-agenda-clockreport-mode clocktable-start) (progn= (let
>> >> > ((org-agenda-files ...) (p ...) tbl) (setq p (org-pl= ist-delete p
>> :block))
>> >> > (setq p (plist-put p :tstart clocktable-start)) (set= q p (plist-put p
>> >> :tend
>> >> > clocktable-end)) (setq p (plist-put p :scope ...)) (= setq tbl (apply
>> ...
>> >> p))
>> >> > (insert tbl)))) (goto-char (point-min)) (or org-agen= da-multi
>> >> > (org-agenda-fit-window-to-buffer)) (if (or (not (get= -buffer-window
>> >> > org-agenda-buffer-name)) (and (pos-visible-in-window= -p (point-min))
>> >> > (pos-visible-in-window-p (point-max)))) nil (goto-ch= ar (1-
>> (point-max)))
>> >> > (recenter -1) (if (not (pos-visible-in-window-p (or = start-pos 1)))
>> (progn
>> >> > (goto-char (or start-pos 1)) (recenter 1)))) (goto-c= har (or start-pos
>> 1))
>> >> > (add-text-properties (point-min) (point-max) (list &= #39;org-agenda-type
>> >> 'agenda
>> >> > 'org-last-args (list arg start-day span) 'or= g-redo-cmd
>> >> > org-agenda-redo-command 'org-series-cmd org-cmd)= ) (if (eq
>> >> > org-agenda-show-log-scoped 'clockcheck) (progn >> >> > (org-agenda-show-clocking-issues))) (org-agenda-fina= lize) (setq
>> >> > buffer-read-only t) (message "")))
>> >> >=C2=A0 =C2=A0org-agenda-list(nil nil day nil)
>> >> >=C2=A0 =C2=A0(let nil (org-agenda-list 'nil nil &= #39;day nil))
>> >> >=C2=A0 =C2=A0eval((let nil (org-agenda-list 'nil = nil 'day nil)))
>> >> >=C2=A0 =C2=A0org-let(nil (org-agenda-list 'nil ni= l 'day nil))
>> >> >=C2=A0 =C2=A0(if series-redo-cmd (eval series-redo-cm= d) (org-let lprops
>> redo-cmd))
>> >> >=C2=A0 =C2=A0(let* ((p (or (and (looking-at "\\&= #39;") (1- (point))) (point))) (cpa
>> (if
>> >> > (eq all t) nil current-prefix-arg)) (org-agenda-doin= g-sticky-redo
>> >> > org-agenda-sticky) (org-agenda-sticky nil) (org-agen= da-buffer-name (or
>> >> > org-agenda-this-buffer-name org-agenda-buffer-name))=
>> >> (org-agenda-keep-modes
>> >> > t) (tag-filter org-agenda-tag-filter) (tag-preset (g= et
>> >> > 'org-agenda-tag-filter :preset-filter)) (top-hl-= filter
>> >> > org-agenda-top-headline-filter) (cat-filter
>> org-agenda-category-filter)
>> >> > (cat-preset (get 'org-agenda-category-filter :pr= eset-filter))
>> (re-filter
>> >> > org-agenda-regexp-filter) (re-preset (get 'org-a= genda-regexp-filter
>> >> > :preset-filter)) (effort-filter org-agenda-effort-fi= lter)
>> (effort-preset
>> >> > (get 'org-agenda-effort-filter :preset-filter))<= br> >> >> > (org-agenda-tag-filter-while-redo (or tag-filter tag= -preset)) (cols
>> >> > org-agenda-columns-active) (line (org-current-line))= (window-line (-
>> line
>> >> > (org-current-line (window-start)))) (lprops (get
>> 'org-agenda-redo-command
>> >> > 'org-lprops)) (redo-cmd (get-text-property p = 9;org-redo-cmd))
>> (last-args
>> >> > (get-text-property p 'org-last-args)) (org-agend= a-overriding-cmd
>> >> > (get-text-property p 'org-series-cmd))
>> >> (org-agenda-overriding-cmd-arguments
>> >> > (if (eq all t) nil (cond ((listp last-args) (cons (o= r cpa ...) (cdr
>> >> > last-args))) ((stringp last-args) last-args)))) (ser= ies-redo-cmd
>> >> > (get-text-property p 'org-series-redo-cmd))) (pu= t
>> 'org-agenda-tag-filter
>> >> > :preset-filter nil) (put 'org-agenda-category-fi= lter :preset-filter
>> nil)
>> >> > (put 'org-agenda-regexp-filter :preset-filter ni= l) (put
>> >> > 'org-agenda-effort-filter :preset-filter nil) (a= nd cols
>> >> (org-columns-quit))
>> >> > (message "Rebuilding agenda buffer...") (i= f series-redo-cmd (eval
>> >> > series-redo-cmd) (org-let lprops redo-cmd)) (setq or= g-agenda-undo-list
>> >> nil
>> >> > org-agenda-pending-undo-list nil org-agenda-tag-filt= er tag-filter
>> >> > org-agenda-category-filter cat-filter org-agenda-reg= exp-filter
>> re-filter
>> >> > org-agenda-effort-filter effort-filter org-agenda-to= p-headline-filter
>> >> > top-hl-filter) (message "Rebuilding agenda buff= er...done") (put
>> >> > 'org-agenda-tag-filter :preset-filter tag-preset= ) (put
>> >> > 'org-agenda-category-filter :preset-filter cat-p= reset) (put
>> >> > 'org-agenda-regexp-filter :preset-filter re-pres= et) (put
>> >> > 'org-agenda-effort-filter :preset-filter effort-= preset) (let ((tag (or
>> >> > tag-filter tag-preset)) (cat (or cat-filter cat-pres= et)) (effort (or
>> >> > effort-filter effort-preset)) (re (or re-filter re-p= reset))) (if tag
>> >> (progn
>> >> > (org-agenda-filter-apply tag 'tag t))) (if cat (= progn
>> >> > (org-agenda-filter-apply cat 'category))) (if ef= fort (progn
>> >> > (org-agenda-filter-apply effort 'effort))) (if r= e (progn
>> >> > (org-agenda-filter-apply re 'regexp)))) (and top= -hl-filter
>> >> > (org-agenda-filter-top-headline-apply top-hl-filter)= ) (and cols
>> >> > (called-interactively-p 'any) (org-agenda-column= s)) (org-goto-line
>> line)
>> >> > (recenter window-line))
>> >> >=C2=A0 =C2=A0org-agenda-redo(t)
>> >> >=C2=A0 =C2=A0(if exhaustive (let ((--dolist-tail-- (b= uffer-list)) buffer) (while
>> >> > --dolist-tail-- (setq buffer (car --dolist-tail--))<= br> >> (save-current-buffer
>> >> > (set-buffer buffer) (if (derived-mode-p 'org-age= nda-mode) (progn
>> >> > (org-agenda-redo t)))) (setq --dolist-tail-- (cdr --= dolist-tail--))))
>> >> > (org-agenda-redo t))
>> >> >=C2=A0 =C2=A0org-agenda-redo-all(nil)
>> >> >=C2=A0 =C2=A0funcall-interactively(org-agenda-redo-al= l nil)
>> >> >=C2=A0 =C2=A0call-interactively(org-agenda-redo-all n= il nil)
>> >> >=C2=A0 =C2=A0command-execute(org-agenda-redo-all)
>> >> > ```
>> >> >
>> >> > [stardiviner]=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0<Hack this world!>=C2=A0 =C2=A0 =C2=A0 GPG key ID: 47C32433
>> >> > IRC(freeenode): stardiviner=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Twitter:=C2=A0 @numbchi= ld
>> >> > Key fingerprint =3D 9BAA 92BC CDDD B9EF 3B36=C2=A0 C= B99 B8C4 B8E5 47C3 2433
>> >> > Blog: http://stardiviner.github.io/
>> >> >
>> >> >
>> >> > On Fri, Aug 14, 2020 at 1:15 PM Ihor Radchenko <<= a href=3D"mailto:yantar92@gmail.com" target=3D"_blank">yantar92@gmail.com>
>> >> wrote:
>> >> >
>> >> >> > I want to get around this problem. So need = to know how to detect
>> >> >> currently
>> >> >> > in logbook drawer or something else which u= sed to record clocking
>> >> note,
>> >> >> > `org-add-note`, etc.
>> >> >>
>> >> >> You may try to use `org-logbook-drawer-re'.<= br> >> >> >>
>> >> >> > When I toggle org-log-mode and related opti= ons in org-agenda
>> buffer. I
>> >> >> > found my org-link-beautify will caused long= time suspend and no
>> stop.
>> >> >> After
>> >> >> > debug, I found org-link-beautify text-prope= rty caused this problem.
>> >> >>
>> >> >> Could you provide more details how your text pro= perty is causing the
>> >> >> problem in org-agenda? Which function in agenda = is slow?
>> >> >>
>> >> >> Best,
>> >> >> Ihor
>> >> >>
>> >> >>
>> >> >> "numbchild@gmail.com" <numbchild@gmail.com> writes:
>> >> >>
>> >> >> > I have a org-mode extension:
>> >> >> >
>> >> >>
>> >>
>> https:= //github.com/stardiviner/org-link-beautify/blob/master/org-link-beautify.el= #L71
>> >> >> >
>> >> >> > It will beautify links with text-properties= .
>> >> >> >
>> >> >> > When I toggle org-log-mode and related opti= ons in org-agenda
>> buffer. I
>> >> >> > found my org-link-beautify will caused long= time suspend and no
>> stop.
>> >> >> After
>> >> >> > debug, I found org-link-beautify text-prope= rty caused this problem.
>> >> >> >
>> >> >> > I want to get around this problem. So need = to know how to detect
>> >> >> currently
>> >> >> > in logbook drawer or something else which u= sed to record clocking
>> >> note,
>> >> >> > `org-add-note`, etc.
>> >> >> >
>> >> >> > Or maybe org-agenda upstream can do somethi= ng to work around this
>> >> >> > text-properties issue?
>> >> >> >
>> >> >> > [stardiviner]=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0<Hack this world!>=C2=A0 =C2=A0 =C2=A0 GPG key ID:
>> 47C32433
>> >> >> > IRC(freeenode): stardiviner=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Twitter:
>> @numbchild
>> >> >> > Key fingerprint =3D 9BAA 92BC CDDD B9EF 3B3= 6=C2=A0 CB99 B8C4 B8E5 47C3
>> 2433
>> >> >> > Blog: http://stardiviner.github.io/=
>> >> >>
>> >>
>>
--000000000000e9699a05ad0a27fd--