* Iterating over all docstrings in a Lisp buffer
@ 2014-06-24 15:16 Sebastian Wiesner
2014-06-24 15:23 ` Thorsten Jolitz
2014-06-24 16:51 ` Michael Heerdegen
0 siblings, 2 replies; 5+ messages in thread
From: Sebastian Wiesner @ 2014-06-24 15:16 UTC (permalink / raw)
To: help-gnu-emacs
Hello,
how would I iterate over all function/macro/variable docstrings in an Emacs Lisp buffer?
The idea is to write a command that automatically re-wraps all docstrings in the current buffer. I’d like to use this as part of a test suite to automatically check whether contributed code adheres to the Emacs Lisp style guide.
Thanks,
Sebastian Wiesner
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Iterating over all docstrings in a Lisp buffer
2014-06-24 15:16 Iterating over all docstrings in a Lisp buffer Sebastian Wiesner
@ 2014-06-24 15:23 ` Thorsten Jolitz
2014-06-24 15:41 ` Sebastian Wiesner
2014-06-24 16:51 ` Michael Heerdegen
1 sibling, 1 reply; 5+ messages in thread
From: Thorsten Jolitz @ 2014-06-24 15:23 UTC (permalink / raw)
To: help-gnu-emacs
Sebastian Wiesner <swiesner@lunaryorn.com> writes:
> Hello,
>
> how would I iterate over all function/macro/variable docstrings in an
> Emacs Lisp buffer?
>
> The idea is to write a command that automatically re-wraps all
> docstrings in the current buffer. I’d like to use this as part of a
> test suite to automatically check whether contributed code adheres to
> the Emacs Lisp style guide.
Here is a link to a function that cycles docstring visibility and thus
should iterate over the whole buffer:
,----
| http://www.prodevtips.com/2013/06/15/hiding-clojure-and-elisp-docstrings-in-emacs/
`----
--
cheers,
Thorsten
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Iterating over all docstrings in a Lisp buffer
2014-06-24 15:23 ` Thorsten Jolitz
@ 2014-06-24 15:41 ` Sebastian Wiesner
0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Wiesner @ 2014-06-24 15:41 UTC (permalink / raw)
To: Thorsten Jolitz; +Cc: help-gnu-emacs
Am 24.06.2014 um 17:23 schrieb Thorsten Jolitz <tjolitz@gmail.com>:
> Sebastian Wiesner <swiesner@lunaryorn.com> writes:
>
>> Hello,
>>
>> how would I iterate over all function/macro/variable docstrings in an
>> Emacs Lisp buffer?
>>
>> The idea is to write a command that automatically re-wraps all
>> docstrings in the current buffer. I’d like to use this as part of a
>> test suite to automatically check whether contributed code adheres to
>> the Emacs Lisp style guide.
>
> Here is a link to a function that cycles docstring visibility and thus
> should iterate over the whole buffer:
>
> ,----
> | http://www.prodevtips.com/2013/06/15/hiding-clojure-and-elisp-docstrings-in-emacs/
> `——
As far as I can see this function iterates over all multi-line strings in a buffer. That would not be safe to use for the aforementioned purpose: There might be other multi-line strings in a buffer that should not be re-wrapped, because the line breaks therein might be significant.
I’m more looking for a solution that takes `doc-string-elt’ property of the current definition into account.
Thanks for your input, though
>
> --
> cheers,
> Thorsten
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Iterating over all docstrings in a Lisp buffer
2014-06-24 15:16 Iterating over all docstrings in a Lisp buffer Sebastian Wiesner
2014-06-24 15:23 ` Thorsten Jolitz
@ 2014-06-24 16:51 ` Michael Heerdegen
2014-06-24 19:49 ` Sebastian Wiesner
1 sibling, 1 reply; 5+ messages in thread
From: Michael Heerdegen @ 2014-06-24 16:51 UTC (permalink / raw)
To: help-gnu-emacs
Sebastian Wiesner <swiesner@lunaryorn.com> writes:
> Hello,
>
> how would I iterate over all function/macro/variable docstrings in an
> Emacs Lisp buffer?
>
> The idea is to write a command that automatically re-wraps all
> docstrings in the current buffer. I’d like to use this as part of a
> test suite to automatically check whether contributed code adheres to
> the Emacs Lisp style guide.
Did you notice checkdoc.el? Anyway, checkdoc-next-docstring could be
used for your iteration, I think.
Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Iterating over all docstrings in a Lisp buffer
2014-06-24 16:51 ` Michael Heerdegen
@ 2014-06-24 19:49 ` Sebastian Wiesner
0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Wiesner @ 2014-06-24 19:49 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: help-gnu-emacs
Am 24.06.2014 um 18:51 schrieb Michael Heerdegen <michael_heerdegen@web.de>:
> Sebastian Wiesner <swiesner@lunaryorn.com> writes:
>
>> Hello,
>>
>> how would I iterate over all function/macro/variable docstrings in an
>> Emacs Lisp buffer?
>>
>> The idea is to write a command that automatically re-wraps all
>> docstrings in the current buffer. I’d like to use this as part of a
>> test suite to automatically check whether contributed code adheres to
>> the Emacs Lisp style guide.
>
> Did you notice checkdoc.el? Anyway, checkdoc-next-docstring could be
> used for your iteration, I think.
Great, thank you! I actually know checkdoc, but for some strange reason I did not occur to me to take a look at it.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-06-24 19:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-24 15:16 Iterating over all docstrings in a Lisp buffer Sebastian Wiesner
2014-06-24 15:23 ` Thorsten Jolitz
2014-06-24 15:41 ` Sebastian Wiesner
2014-06-24 16:51 ` Michael Heerdegen
2014-06-24 19:49 ` Sebastian Wiesner
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).