I'm trying to get familiar with Emacs Lisp, its syntax, data structures etc, so I was wondering what are some built-in packages whose source could help me better understand how to use the language and learn its idioms?
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
I can recommend Ruby Mode in
ruby-mode.el and Python Mode in
python.el, for some aspects of their implementation. The former is a particularly great source for advanced indentation and navigation code based on the new SMIE engine. However, neither uses data structures in any particularly clever or advanced way.
I would also recommend some parts of Org Mode 8, for its design. Notably the exporter framework of Org 8 shows how to create an generic, extensible, object-like framework in plain Emacs Lisp. However, I'd recommend against most other parts of Org, for reasons already stated in comments: It's old, and full of legacy and harmful practices (e.g.
find-file-noselect to read files non-interactively).
Gnus is also said to have good code, but again I'd be careful to determine how well-maintained the particular piece of code is that you are looking at.
Since Emacs itself is very old, and only superficially maintained in many places, the average quality of its code is actually rather low by modern standards. There's many legacy stuff in there. For instance, even in core parts such as the byte compiler you'll find “TODO”s and “DUNNO”s dating back years, if not decades. Also, since Emacs is very slow to take code and developers from the “outside” community due to the restrictive policies established by the FSF, the overall quality increases only slowly.
All in all, you are more likely to find good code in popular 3rd party packages maintained by high-profile community members, e.g. Magit, Projectile, etc.
For basic idioms look into simple.el