emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] list items not treated as such.


From: Paul Rudin
Subject: Re: [O] list items not treated as such.
Date: Fri, 04 Oct 2013 19:47:19 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Nicolas Goaziou <address@hidden> writes:

> Hello,
>
> Paul Rudin <address@hidden> writes:
>
>> Paul Rudin <address@hidden> writes:
>>
>> (about lists)
>>
>> Here is a test for this problem. Notice that if you change the "a)" to "1."
>> - for example - the test passes. So this is something specific to
>> alphabetically labelled list items.
>>
>>
>> (ert-deftest org-list-item-test ()
>>   (with-temp-buffer
>>     (org-mode)
>>     (let ((org-allow-alphabetical t)
>>        (fill-column 70))
>>       (insert "1. some stuff\n"
>>            "   a) an alphabetic list item with text longer that the current 
>> fill column so that it gets wrapped by fill-paragraph")
>>       (fill-paragraph)t
>>       (should (not (equal (org-in-item-p) 1))))))
>
> Quoting `org-list-allow-alphabetical' docstring:
>
>   This variable needs to be set before org.el is loaded.  If you
>   need to make a change while Emacs is running, use the customize
>   interface or run the following code, where VALUE stands for the
>   new value of the variable, after updating it:
>
>     (when (featurep 'org-element) (load "org-element" t t))
>
> So let-binding it cannot work.


Aha. So how do you test things like that? This seems to be OK. Is it?

(ert-deftest org-list-item-test ()
  (with-temp-buffer
    (org-mode)
    (let ((fill-column 70))
      (custom-set-variables '(org-list-allow-alphabetical t))
      (insert "1. some stuff\n"
              "   a) an alphabetic list item with text longer that the current 
fill column so that it gets wrapped by fill-paragraph")
      (fill-paragraph)
      (should (not (equal (org-in-item-p) 1))))))


This also explains what I was seeing, as I was setting it in my init
file after org was loaded. I was lulled into a false sense of security
because some aspects of alphabetical list label work in this
circumstance.

All I need now is roman numeral list labels too :)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]