From: Samuel Wales <samologist@gmail.com>
To: Samuel Wales <samologist@gmail.com>,
emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: [bug] canonical context not work in 8.3
Date: Sun, 9 Aug 2015 11:53:16 -0700 [thread overview]
Message-ID: <CAJcAo8uRm10kn-4-sMG-L4SkhK2+68=-+kmrBU43UFotzes9JQ@mail.gmail.com> (raw)
In-Reply-To: <87mvy2b0i5.fsf@nicolasgoaziou.fr>
thank you. this version is significantly faster. qualitatively
improved.
it has a possibly minor bug.
evalled as source:
- command-execute 8072 98%
- call-interactively 8072 98%
- org-agenda-switch-to 7595 92%
- org-show-context 7595 92%
- org-show-set-visibility 7595 92%
- show-children 7039 86%
- save-excursion 7015 85%
- let* 7015 85%
- while 4832 59%
- outline-flag-region 692 8%
remove-overlays 12 0%
- save-excursion 2179 26%
org-end-of-subtree 2179 26%
- funcall 4 0%
org-outline-level 4 0%
however, if the next heading has fewer stars, it errors:
Debugger entered--Lisp error: (invalid-regexp "Invalid content of \\{\\}")
re-search-forward("^\\*\\{27,13\\} +" 2473493 t)
(while (re-search-forward re end t) (outline-flag-region
(line-end-position 0) (line-end-position) nil))
(let* ((current-level (funcall outline-level)) (level (if level (+
(prefix-numeric-value level) current-level) (save-excursion
(outline-next-heading) (if (eobp) current-level (funcall
outline-level))))) (re (format "^\\*\\{%d,%d\\} +" current-level
level)) (end (save-excursion (org-end-of-subtree t t)))) (while
(re-search-forward re end t) (outline-flag-region (line-end-position
0) (line-end-position) nil)))
(save-excursion (org-back-to-heading t) (let* ((current-level
(funcall outline-level)) (level (if level (+ (prefix-numeric-value
level) current-level) (save-excursion (outline-next-heading) (if
(eobp) current-level (funcall outline-level))))) (re (format
"^\\*\\{%d,%d\\} +" current-level level)) (end (save-excursion
(org-end-of-subtree t t)))) (while (re-search-forward re end t)
(outline-flag-region (line-end-position 0) (line-end-position) nil))))
show-children()
org-show-set-visibility(canonical)
org-show-context(agenda)
org-agenda-switch-to()
call-interactively(org-agenda-switch-to nil nil)
command-execute(org-agenda-switch-to)
(defun show-children (&optional level)
(save-excursion
(org-back-to-heading t)
(let* ((current-level (funcall outline-level))
(level (if level (+ (prefix-numeric-value level) current-level)
(save-excursion
(outline-next-heading)
(if (eobp) current-level (funcall outline-level)))))
(re (format "^\\*\\{%d,%d\\} +" current-level level))
(end (save-excursion (org-end-of-subtree t t))))
(while (re-search-forward re end t)
(outline-flag-region (line-end-position 0)
(line-end-position) nil)))))
On 8/8/15, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> This one may improve the situation:
next prev parent reply other threads:[~2015-08-09 18:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-06 23:10 [bug] canonical context not work in 8.3 Samuel Wales
2015-08-07 0:16 ` Nicolas Goaziou
2015-08-07 1:38 ` Samuel Wales
2015-08-07 8:45 ` Nicolas Goaziou
2015-08-07 20:27 ` Samuel Wales
2015-08-08 8:07 ` Nicolas Goaziou
2015-08-08 9:19 ` Nicolas Goaziou
2015-08-09 18:53 ` Samuel Wales [this message]
2015-08-10 11:39 ` Nicolas Goaziou
2015-08-10 18:31 ` Samuel Wales
2015-08-10 21:39 ` Nicolas Goaziou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJcAo8uRm10kn-4-sMG-L4SkhK2+68=-+kmrBU43UFotzes9JQ@mail.gmail.com' \
--to=samologist@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).