A good option 'dired-movement-style' was implemented in bug#65621. But it supports only 'n' and 'p', but not counterpart '<' and '>'. So I took the very nice algorithm that correctly handles the arg on wrapping in 'dired-next-line', and refactored it to a separate function 'dired--move-to-next-line' that is used in both: dired-next-line: (dired--move-to-next-line arg #'dired--trivial-next-line) dired-next-dirline: (dired--move-to-next-line arg #'dired--trivial-next-dirline)