emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* how to replace 'org-drawers'
@ 2014-10-06 12:23 Alan Schmitt
  2014-10-06 12:56 ` Thorsten Jolitz
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alan Schmitt @ 2014-10-06 12:23 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 278 bytes --]

Hello,

I'm trying to use org-wc, but it fails because org-drawers no longer
exists. Is there a suggestion to change
https://github.com/dato/org-wc/blob/master/org-wc.el#L55 such that it
works with current org?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: how to replace 'org-drawers'
  2014-10-06 12:23 how to replace 'org-drawers' Alan Schmitt
@ 2014-10-06 12:56 ` Thorsten Jolitz
  2014-10-06 16:50   ` Alan Schmitt
  2014-10-06 15:00 ` Rasmus
  2014-10-06 15:13 ` Jonathan Leech-Pepin
  2 siblings, 1 reply; 7+ messages in thread
From: Thorsten Jolitz @ 2014-10-06 12:56 UTC (permalink / raw)
  To: emacs-orgmode

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> Hello,
>
> I'm trying to use org-wc, but it fails because org-drawers no longer
> exists. 

Not???

I still find this

,----
| 510:;;; Greater elements
| 544:;;;; Center Block
| 594:;;;; Drawer
`----

in my org-element.el. I guess you mean something else?

PS

#+BEGIN_SRC emacs-lisp
 (call-interactively 'org-version)
#+END_SRC

#+results:
: Org-mode version 8.3beta (release_8.3beta-408-g39f5f0 @ /usr/share/emacs/24.3/lisp/org/lisp/)

-- 
cheers,
Thorsten

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: how to replace 'org-drawers'
  2014-10-06 12:23 how to replace 'org-drawers' Alan Schmitt
  2014-10-06 12:56 ` Thorsten Jolitz
@ 2014-10-06 15:00 ` Rasmus
  2014-10-06 16:52   ` Alan Schmitt
  2014-10-06 15:13 ` Jonathan Leech-Pepin
  2 siblings, 1 reply; 7+ messages in thread
From: Rasmus @ 2014-10-06 15:00 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> I'm trying to use org-wc, but it fails because org-drawers no longer
> exists. Is there a suggestion to change
> https://github.com/dato/org-wc/blob/master/org-wc.el#L55 such that it
> works with current org?

A pragmatic approach is to approximate the org-wc word count by
exporting to LaTeX and then use texcount (sometimes called
texcount.pl) or plain text and use wc.  The former understands math
environments.

—Rasmus

-- 
With monopolies the cake is a lie!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: how to replace 'org-drawers'
  2014-10-06 12:23 how to replace 'org-drawers' Alan Schmitt
  2014-10-06 12:56 ` Thorsten Jolitz
  2014-10-06 15:00 ` Rasmus
@ 2014-10-06 15:13 ` Jonathan Leech-Pepin
  2014-10-06 17:21   ` Alan Schmitt
  2 siblings, 1 reply; 7+ messages in thread
From: Jonathan Leech-Pepin @ 2014-10-06 15:13 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 817 bytes --]

Hello Alan

On 6 October 2014 08:23, Alan Schmitt <alan.schmitt@polytechnique.org>
wrote:

> Hello,
>
> I'm trying to use org-wc, but it fails because org-drawers no longer
> exists. Is there a suggestion to change
> https://github.com/dato/org-wc/blob/master/org-wc.el#L55 such that it
> works with current org?
>
>
A quick search for variables reveals `org-drawer-regexp` [ "^[
]*:\\(\\(?:\\w\\|[-_]\\)+\\):[     ]*$" ]

It matches both the name of the drawer and `:END:`.

So the function could be adapted to use `org-drawer-regexp` instead
(untested but should match to the next :END:):

((looking-at org-drawer-regexp)
 (while (or (eobp)
            (not (looking-at ":END:")))
   (re-search-forward org-drawer-regexp nil t)))

Regards,
Jonathan


> Thanks,
>
> Alan
>
> --
> OpenPGP Key ID : 040D0A3B4ED2E5C7
>

[-- Attachment #2: Type: text/html, Size: 1613 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: how to replace 'org-drawers'
  2014-10-06 12:56 ` Thorsten Jolitz
@ 2014-10-06 16:50   ` Alan Schmitt
  0 siblings, 0 replies; 7+ messages in thread
From: Alan Schmitt @ 2014-10-06 16:50 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 812 bytes --]

On 2014-10-06 14:56, Thorsten Jolitz <tjolitz@gmail.com> writes:

> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> Hello,
>>
>> I'm trying to use org-wc, but it fails because org-drawers no longer
>> exists. 
>
> Not???
>
> I still find this
>
> ,----
> | 510:;;; Greater elements
> | 544:;;;; Center Block
> | 594:;;;; Drawer
> `----
>
> in my org-element.el. I guess you mean something else?

I mean that the variable does not exist (I also tested this with an org
file):

ELISP> org-drawers
*** Eval error ***  Symbol's value as variable is void: org-drawers
ELISP>  (call-interactively 'org-version)
"Org-mode version 8.3beta (release_8.3beta-412-g4412fe @ /Users/schmitta/.emacs.d/org/emacs/site-lisp/org/)"

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: how to replace 'org-drawers'
  2014-10-06 15:00 ` Rasmus
@ 2014-10-06 16:52   ` Alan Schmitt
  0 siblings, 0 replies; 7+ messages in thread
From: Alan Schmitt @ 2014-10-06 16:52 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 761 bytes --]

On 2014-10-06 17:00, Rasmus <rasmus@gmx.us> writes:

> Hi,
>
> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> I'm trying to use org-wc, but it fails because org-drawers no longer
>> exists. Is there a suggestion to change
>> https://github.com/dato/org-wc/blob/master/org-wc.el#L55 such that it
>> works with current org?
>
> A pragmatic approach is to approximate the org-wc word count by
> exporting to LaTeX and then use texcount (sometimes called
> texcount.pl) or plain text and use wc.  The former understands math
> environments.

Thank you, but the ulterior motive is this:
https://bitbucket.org/gvol/nanowrimo.el

I'm going to try to fix it using Jonathan's suggestion.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: how to replace 'org-drawers'
  2014-10-06 15:13 ` Jonathan Leech-Pepin
@ 2014-10-06 17:21   ` Alan Schmitt
  0 siblings, 0 replies; 7+ messages in thread
From: Alan Schmitt @ 2014-10-06 17:21 UTC (permalink / raw)
  To: Jonathan Leech-Pepin; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1217 bytes --]

Hello Jonathan,

On 2014-10-06 11:13, Jonathan Leech-Pepin <jonathan.leechpepin@gmail.com> writes:

> Hello Alan
>
> On 6 October 2014 08:23, Alan Schmitt <alan.schmitt@polytechnique.org>
> wrote:
>
>     Hello,
>     
>     I'm trying to use org-wc, but it fails because org-drawers no
>     longer
>     exists. Is there a suggestion to change
>     https://github.com/dato/org-wc/blob/master/org-wc.el#L55 such that
>     it
>     works with current org?
>     
>
> A quick search for variables reveals `org-drawer-regexp` [ "^[ ]*:\\
> (\\(?:\\w\\|[-_]\\)+\\):[ ]*$" ]
>
> It matches both the name of the drawer and `:END:`.
>
> So the function could be adapted to use `org-drawer-regexp` instead
> (untested but should match to the next :END:):
>
> ((looking-at org-drawer-regexp)
> (while (or (eobp)
> (not (looking-at ":END:")))
> (re-search-forward org-drawer-regexp nil t)))

This was a most helpful suggestion. Looking at the commit that got rid
of org-drawers, I saw there is a `org-in-drawer-p' function that works
great. The code is now simply

         ((org-in-drawer-p)
          (forward-line))

Thanks again,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-10-06 17:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-06 12:23 how to replace 'org-drawers' Alan Schmitt
2014-10-06 12:56 ` Thorsten Jolitz
2014-10-06 16:50   ` Alan Schmitt
2014-10-06 15:00 ` Rasmus
2014-10-06 16:52   ` Alan Schmitt
2014-10-06 15:13 ` Jonathan Leech-Pepin
2014-10-06 17:21   ` Alan Schmitt

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).