From: Sharon Kimble <boudiccas@skimble.plus.com>
To: "Juan Manuel Macías" <maciaschain@posteo.net>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: word counts and org-mode drawers
Date: Thu, 04 Feb 2021 13:50:34 +0000 [thread overview]
Message-ID: <87wnvo6ixh.fsf@skimble.plus.com> (raw)
In-Reply-To: <87tuqv1i4r.fsf@posteo.net> ("Juan Manuel =?utf-8?Q?Mac=C3=AD?= =?utf-8?Q?as=22's?= message of "Tue, 02 Feb 2021 00:29:56 +0100")
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi Juan.
Thanks very much for this code, it fits my purpose very well, thanks
again.
Thanks
Sharon.
> Juan Manuel Macías <maciaschain@posteo.net> writes:
>
> Hi,
>
> Sharon Kimble <boudiccas@skimble.plus.com> writes:
>
>> How can I exempt an org-mode drawer, and its contents, from word counts
>> please. I am using 'wc-mode' but I can't see how to do it.
>
> #+begin_src emacs-lisp
> (defun my-count-words-in-org-buffer ()
> (interactive)
> (let ((words 0))
> (save-excursion
> (save-restriction
> (narrow-to-region (point-min) (point-max))
> (goto-char (point-min))
> (while (forward-word-strictly 1)
> (if (org-at-drawer-p)
> (re-search-forward ":END:")
> (setq words (1+ words))))))
> (message "Org buffer has %d word%s."
> words (if (= words 1) "" "s"))))
> #+end_src
>
> Juan Manuel
>
- --
Debian 10.7, fluxbox 1.3.7, emacs 27.1.50, org 9.4.4
-----BEGIN PGP SIGNATURE-----
iQJPBAEBCgA5FiEELSc/6QwVBIYugJDbNoGAGQr4g1sFAmAb+6sbHGJvdWRpY2Nh
c0Bza2ltYmxlLnBsdXMuY29tAAoJEDaBgBkK+INbKfcP/i/rVfnnXUSViX7dD2Rm
Gu2+mvzfwv+lzyRMUsbZoEMi2hYDQ/5CkBChFVtgrG84KqF9+wmxjikCG9q2hL0b
BMYrZ60XNfwMsJ1nd7Q/CHypPgr7//cn6r89B29w2ez0/noWID9OiTDS+dfJFoQQ
8MFv32TeLQtlYiONsiO0Z38iqkyQDGn5aSOtQjMjIxOJ5fiAVAsO/GBiwrNunwbN
yeCrOJQhiooZB/dOQgYwZkd9yDOQ3C/jPfRflLxIBGWUJ3EgCuFqBCuKin+JBnhJ
JUghkoX1BSDfs72QDq5yyzezHTgDnq0IdKBdqz0GVrMH6tkHFxfLDdUbxJgY2KcF
uW/GX17A23EXLT11MhI0C+W3VnG68HWvqZc/x4kY0SKy9pxUbXy9y2BGJFdGl+no
CPMyEn3tA+E8klDVDWe6DSJj2JUxarAT0gaizs7KOJpHCDeHja2i+rN1S0eLZ+t8
PmY32zYHoe5w8yzdwm43V3+mZp6kvusK6SODNalRCIykqPrCeeYMmzolfwXpi6qW
va5g4OigBHmY165SfVdLr8iGzi96VqLlTWkzBN3bCiu9F/fJGqUiPdgDEAR8A2f0
/nFaEbYBNq4h1I8OMAMNhfA2PMeo0qn7vmBsmwboIXn6G+4yaTnQk9R80hb/7JFv
SN043NVKF1XKT5lcjxfDEIWr
=hiQu
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2021-02-04 13:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-01 15:17 word counts and org-mode drawers Sharon Kimble
2021-02-01 23:29 ` Juan Manuel Macías
2021-02-04 13:50 ` Sharon Kimble [this message]
2021-02-02 0:43 ` Christopher Miles
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=87wnvo6ixh.fsf@skimble.plus.com \
--to=boudiccas@skimble.plus.com \
--cc=emacs-orgmode@gnu.org \
--cc=maciaschain@posteo.net \
/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).