* word counts and org-mode drawers
@ 2021-02-01 15:17 Sharon Kimble
2021-02-01 23:29 ` Juan Manuel Macías
2021-02-02 0:43 ` Christopher Miles
0 siblings, 2 replies; 4+ messages in thread
From: Sharon Kimble @ 2021-02-01 15:17 UTC (permalink / raw)
To: emacs-orgmode
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi folks.
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.
Thanks
Sharon.
- --
Debian 10.7, fluxbox 1.3.7, emacs 27.1.50, org 9.4.4
-----BEGIN PGP SIGNATURE-----
iQJPBAEBCgA5FiEELSc/6QwVBIYugJDbNoGAGQr4g1sFAmAYG6cbHGJvdWRpY2Nh
c0Bza2ltYmxlLnBsdXMuY29tAAoJEDaBgBkK+INbCiMP+wU4WdnwbY9FEji4Ns56
5nHDTCFolp1zvG3uuTWz2UIQl3dfyDiJeOHejFP/G77xNBXJrYFWXNb52TpvL436
lvGGDsKewPaY+fRryxcXAq8EcOdI0AE3E62GJpX7iMAGXOGVGTjQY0Cpwi3owyHs
R05UOiDcJJfNg+2oEK0sVL7HFk1Sg1o2vzbVI5Lxfj5/KR1ZuTJXkSvTiT1FgZBq
j6+aXqlsqQvImINYxRHZ/oynU7PhuUFG5v8Gk6XHjERi2ia+BZWUev0AvrbYwCx0
r0Zb5JPBg2gqBQ+Vk4PVd1cdz+n4jNGn+gZpJnxMF7rP4yzLjBKAwPzwnRiPgaEl
OMfnn0x1NzdejLm3B363dOusTG/cwCIABFap9y3xgoRLpord+xBWywtJqgZhEqAs
yAfE9erl0ON9UZD3gI2xspfsuRwIAkcjMQDQR8Ej2SAG1IClGVOEkECGV+tu7kSN
lHWd/PCXXWQTaE9LR1QePUj6naRNqZCY1JfM2upoBXhcSB31r0v9K4zfnYM14qu3
jS5NQasGKR74oSyboIlUyX+5M3r6Iowg57dGVM0JR3nB5O7XenFQv67iqWojYM4L
jxCxFgflgh0ebRqxCEzMV5NiJiGfGAuGliwerB8l/lXkIjLuQ8ZxyjV0MbQe7BUk
ngEgy0ZeKO8dG1z0GAgZfYkx
=Ri0D
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: word counts and org-mode drawers
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
2021-02-02 0:43 ` Christopher Miles
1 sibling, 1 reply; 4+ messages in thread
From: Juan Manuel Macías @ 2021-02-01 23:29 UTC (permalink / raw)
To: Sharon Kimble; +Cc: orgmode
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.
It is not a solution with wc-mode, but maybe this simple function, based on
`count-words', can serve you. It counts the words in the buffer
excluding all drawers and their contents:
#+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
Best regards,
Juan Manuel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: word counts and org-mode drawers
2021-02-01 15:17 word counts and org-mode drawers Sharon Kimble
2021-02-01 23:29 ` Juan Manuel Macías
@ 2021-02-02 0:43 ` Christopher Miles
1 sibling, 0 replies; 4+ messages in thread
From: Christopher Miles @ 2021-02-02 0:43 UTC (permalink / raw)
To: Sharon Kimble; +Cc: emacs-orgmode@gnu.org
[-- Attachment #1.1: Type: text/plain, Size: 1312 bytes --]
<#secure method=pgpmime mode=sign>
Sharon Kimble <boudiccas@skimble.plus.com> writes:
–—BEGIN PGP SIGNED MESSAGE–— Hash: SHA512
Hi folks.
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.
Thanks Sharon.
I remember there is an extension called org-wc, did this thing. Suggest you to use that.
- – Debian 10.7, fluxbox 1.3.7, emacs 27.1.50, org 9.4.4 –—BEGIN PGP SIGNATURE–—
iQJPBAEBCgA5FiEELSc/6QwVBIYugJDbNoGAGQr4g1sFAmAYG6cbHGJvdWRpY2Nh c0Bza2ltYmxlLnBsdXMuY29tAAoJEDaBgBkK+INbCiMP+wU4WdnwbY9FEji4Ns56 5nHDTCFolp1zvG3uuTWz2UIQl3dfyDiJeOHejFP/G77xNBXJrYFWXNb52TpvL436 lvGGDsKewPaY+fRryxcXAq8EcOdI0AE3E62GJpX7iMAGXOGVGTjQY0Cpwi3owyHs R05UOiDcJJfNg+2oEK0sVL7HFk1Sg1o2vzbVI5Lxfj5/KR1ZuTJXkSvTiT1FgZBq j6+aXqlsqQvImINYxRHZ/oynU7PhuUFG5v8Gk6XHjERi2ia+BZWUev0AvrbYwCx0 r0Zb5JPBg2gqBQ+Vk4PVd1cdz+n4jNGn+gZpJnxMF7rP4yzLjBKAwPzwnRiPgaEl OMfnn0x1NzdejLm3B363dOusTG/cwCIABFap9y3xgoRLpord+xBWywtJqgZhEqAs yAfE9erl0ON9UZD3gI2xspfsuRwIAkcjMQDQR8Ej2SAG1IClGVOEkECGV+tu7kSN lHWd/PCXXWQTaE9LR1QePUj6naRNqZCY1JfM2upoBXhcSB31r0v9K4zfnYM14qu3 jS5NQasGKR74oSyboIlUyX+5M3r6Iowg57dGVM0JR3nB5O7XenFQv67iqWojYM4L jxCxFgflgh0ebRqxCEzMV5NiJiGfGAuGliwerB8l/lXkIjLuQ8ZxyjV0MbQe7BUk ngEgy0ZeKO8dG1z0GAgZfYkx =Ri0D –—END PGP SIGNATURE–—
[-- Attachment #1.2: Type: text/html, Size: 1890 bytes --]
[-- Attachment #2: ATT00001.txt --]
[-- Type: text/plain, Size: 253 bytes --]
--
[ 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: word counts and org-mode drawers
2021-02-01 23:29 ` Juan Manuel Macías
@ 2021-02-04 13:50 ` Sharon Kimble
0 siblings, 0 replies; 4+ messages in thread
From: Sharon Kimble @ 2021-02-04 13:50 UTC (permalink / raw)
To: Juan Manuel Macías; +Cc: orgmode
-----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-----
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-02-04 13:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2021-02-02 0:43 ` Christopher Miles
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).