[Question]
  [
Before 1994, Spanish dictionaries used alphabetical order [with a peculiarity](https://en.wikipedia.org/wiki/Spanish_orthography#ref_r): digraphs `ll` and `ch` were considered as if they were single letters. `ch` immediately followed `c` , and `ll` immediately followed `l`. Adding the letter `ñ`, which follows `n` in Spanish, the order was then:
```
a, b, c, ch, d, e, f, g, h, i, j, k, l, ll, m, n, ñ, o, p, q, r, s, t, u, v, w, x, y, z
```
Since 1994 `ll` and `ch` are considered as groups of two letters (`l`,`l` and `c`,`h` respectively), and thus alphabetical order is the same as in English, with the exception of the letter `ñ`.
The old order was definitely more *interesting*.
## The challenge
Input a list of zero or more words and output the list sorted according to the old Spanish alphabetical order. Sorting is between words (not between letters within a word). That is, words are atomic, and the output will contain the same words in a possibly different order.
To simplify, we will not consider letter `ñ`, or accented vowels `á`, `é`, `í`, `ó`, `ú`, or uppercase letters. Each word will be a sequence of one or more characters taken from the inclusive range from ASCII 97 (`a`) through ASCII 122 (`z`).
If there are more than two `l` letters in a row, they should be grouped left to right. That is, `lll` is `ll` and then `l` (not `l` and then `ll`).
Input format can be: words separated by spaces, by newlines, or any convenient character. Words may be surrounded by quotation marks or not, at your choice. A list or array of words is also acceptable. Any reasonable format is valid; just state it in your answer.
In a similar way, output will be any reasonable format (not necessarily the same as the input).
Code golf, shortest wins.
## Test cases
In the following examples words are separated by spaces. First line is input, second is output:
```
llama coche luego cocina caldo callar calma
caldo calma callar cocina coche luego llama
cuchara cuchillo cubiertos cuco cueva
cubiertos cuco cuchara cuchillo cueva
```
"Words" can be single letters too:
```
b c a ch ll m l n
a b c ch l ll m n
```
or unlikely combinations (remember the rule that `l`'s are grouped left to right):
```
lll llc llz llll lllz
llc lll lllz llll llz
```
An empty input should give an empty output:
```
```
Of course, this order can be applied to other languages as well:
```
chiaro diventare cucchiaio
cucchiaio chiaro diventare
all alternative almond at ally a amber
a almond alternative all ally amber at
```
  
[Answer]
# Pyth, ~~14~~ 13 bytes
**Update:** saw this got accepted and noticed a trivial 1 byte golf. Whoops.
```
:D"ll|ch|."1Q
```
[Try it online.](https://pyth.herokuapp.com/?code=%3AD%22ll%7Cch%7C.%221Q&input=%5B%22llama%22%2C+%22coche%22%2C+%22luego%22%2C+%22cocina%22%2C+%22caldo%22%2C+%22callar%22%2C+%22calma%22%5D&debug=0) [Test suite.](https://pyth.herokuapp.com/?code=%3AD%22ll%7Cch%7C.%221Q&test_suite=1&test_suite_input=%5B%5D%0A%5B%22llama%22%2C+%22coche%22%2C+%22luego%22%2C+%22cocina%22%2C+%22caldo%22%2C+%22callar%22%2C+%22calma%22%5D%0A%5B%22cuchara%22%2C+%22cuchillo%22%2C+%22cubiertos%22%2C+%22cuco%22%2C+%22cueva%22%5D%0A%5B%22b%22%2C+%22c%22%2C+%22a%22%2C+%22ch%22%2C+%22ll%22%2C+%22m%22%2C+%22l%22%2C+%22n%22%5D%0A%5B%22lll%22%2C+%22llc%22%2C+%22llz%22%2C+%22llll%22%2C+%22lllz%22%5D%0A%5B%22chiaro%22%2C+%22diventare%22%2C+%22cucchiaio%22%5D%0A%5B%22all%22%2C+%22alternative%22%2C+%22almond%22%2C+%22at%22%2C+%22ally%22%2C+%22a%22%2C+%22amber%22%5D&debug=0)
For each word, find all non-overlapping matches for the regex `ll|ch|.`. This splits the word into the "letters". Then, just sort the words by the splitted lists.
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal) `a`, 15 bytes
```
µ‛ch‛c~V‛ll‛l~V
```
Takes input as words separated by newlines, outputs a list.  
[Try it Online!](http://lyxal.pythonanywhere.com?flags=a&code=%C2%B5%E2%80%9Bch%E2%80%9Bc%7EV%E2%80%9Bll%E2%80%9Bl%7EV&inputs=llama%0Acoche%0Aluego%0Acocina%0Acaldo%0Acallar%0Acalma&header=&footer=)
```
µ‛ch‛c~V‛ll‛l~V    # Full program
µ                  # Sort (implicit) input by key:
       V           # Replace...
 ‛ch               # `ch`...
    ‛c~            # with `c~`
              V    # Replace...
        ‛ll        # `ll`...
           ‛l~     # with `l~`
```
[Answer]
# PowerShell, ~~46~~ ~~44~~ ~~51~~ 50 bytes
```
$args|sort @{e={$_-replace'(?=ch|ll)(.).','$1Α'}}
```
The `Α` character is the Greek letter alpha which in comes after all Latin letters in PowerShell's default sort order (at least on my machine, I'm not sure if it's different in other locales). It's counted as 2 bytes in UTF8 encoding.
Example usage, assuming this string is saved in a file named `es-sort.ps1`:
```
> es-sort.ps1 'lzego' 'luego' 'llama'
luego
lzego
llama
```
[Answer]
# Mathematica, 81 bytes
```
StringReplace[Sort@StringReplace[#,"ch"->"cZ","ll"->"lZ"],"cZ"->"ch","lZ"->"ll"]&
```
Same approach as TimmyD's answer.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 15 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
Σ„ch„c~:„ll„l~:
```
I/O as a list of strings.
Very straight-forward approach, but I'm unable to find anything shorter (thus far).
[Try it online](https://tio.run/##yy9OTMpM/f//3OJHDfOSM0BEnRWQzMkBEXVW//9HK@XkJOYmKukoJecnZ6QC6ZzS1PR8CD8zDyyRmJOSD6FzEosgDKCOWAA) or [verify all test cases](https://tio.run/##HY29DcJADIX7m8IKLROkScMizuXEnfSSky4/EhFEVBmAAWjoaNghAzBEFjlsivfZ79myY891cPm6fbb3dDmcqoL29UFFlb@v/f60XrGUQkCxlPl2zAC3TDZa7wijO0ftQycRo4lKcNLSsrGj9ZxkJDUAMh3lYxpir5FaN7GpyZLseAKoJVBnIB1gRbPobzAbucEpUhMm1w2cnN7QLMQf).
**Explanation:**
```
Σ         # Sort the (implicit) input-list of strings by:
 „ch„c~:  #  Replace all "ch" with "c~"
 „ll„l~:  #  Replace all "ll" with "l~"
          #  (and then sort it by default lexicographical order)
          # (after which the sorted list is output implicitly)
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~16~~ ~~15~~ 12 bytes
```
eƬ“ch“ll”µƝÞ
```
[Try it online!](https://tio.run/##y0rNyan8/z/12JpHDXOSM4BETs6jhrmHth6be3je/8Ptkf//q@fkJOYmqusoqCfnJ2ekghg5panp@VCRzDyIXGJOSj6UkZNYBGVB9WUk5qWDNaYk5uapAwA "Jelly – Try It Online")
Previous 12-byter sorted leading digraphs incorrectly, since the index took precedence over the actual character data.
```
           Þ    Sort the input by:
         µƝ     for each pair of adjacent characters as a list,
 Ƭ              apply while unique (collecting all results):
e               is it an element of
  “ch“ll”       ['ch', 'll']?
```
`eƬ2ƤÞ“ch“ll”` also works for 12 bytes, doing precisely the same thing.
[Answer]
# Python 2, ~~128~~ 116 bytes
```
lambda p:map(''.join,sorted([{'!':'ll','?':'ch'}.get(c,c)for c in w.replace('ll','!').replace('ch','?')]for w in p))
```
I still feel like there's definitely room for improvement here.
[Answer]
# Javascript, 95 bytes
```
s=>s.map(a=>a.replace(/ll|ch/g,m=>m[0]+'~')).sort().map(a=>a.replace(/.~/g,m=>m>'d'?'ll':'ch'))
```
[Answer]
# Perl, 40 bytes
Includes +1 for `-p`
Run with the list of words on STDIN:
```
perl -p spanisort.pl <<< "llama coche luego cocina caldo callar calma"
```
`spanisort.pl`
```
s/ll|ch|./\u$&/g;$_="\L@{[sort split]}"
```
[Answer]
# [Ruby](https://www.ruby-lang.org/), 42 bytes
```
->a{a.sort_by{_1.gsub(/ll|ch/){$&[0]+?|}}}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72kqDSpcsEiN9ulpSVpuhY3tXTtEqsT9Yrzi0rikyqr4w310otLkzT0c3JqkjP0NatV1KINYrXta2pra6E6LApKS4oV3KJVy6NzchJzExWS85MzUhVySlPT80HszDygUGJOSj6IzEksAlG5ibGxXBD9CxZAaAA)
]