[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Separating obarray handling from abbrevs
From: |
Przemysław Wojnowski |
Subject: |
Separating obarray handling from abbrevs |
Date: |
Sat, 31 Oct 2015 14:21:43 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Hello everybody,
I'm trying to write a test for abbrev-table-p, but encountered a
problem. The function checks that passed object is a vector, but abbrev
tables are implemented in terms of obarrays, so in the following test,
the last two assertions fail:
(ert-deftest abbrev-table-p-test ()
"Should assert that given object is an abbrev table."
(should-not (abbrev-table-p 42))
(should-not (abbrev-table-p "aoeu"))
(should-not (abbrev-table-p '()))
(should-not (abbrev-table-p []))
(should-not (abbrev-table-p ["a" "b" "c"])))
The check in abbrev-table-p should have been "(obarray-p object)"
instead of "(vectorp object)". Of course, there's no obarray-p function,
but I can write it.
Another thing is that obarray "handling" is mixed with Abbrev
functionality in one file - they are separate concepts. obarray is just
a type of collection that is used as storage implementation and should
be clearly separated.
Can I move obarrays functionality from abbrev.el to a separate file and
changed abbrev.el to use it? Also this would allow to reuse that
functionality in other places where obarrays are used.
Thanks,
Przemysław
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Separating obarray handling from abbrevs,
Przemysław Wojnowski <=