Skip to content

Instantly share code, notes, and snippets.

@danlamanna
Created September 29, 2014 01:59
Show Gist options
  • Select an option

  • Save danlamanna/369f42089655af4b6bad to your computer and use it in GitHub Desktop.

Select an option

Save danlamanna/369f42089655af4b6bad to your computer and use it in GitHub Desktop.
List the number of files in your dired buffer
(if (equal major-mode 'dired-mode)
(save-excursion
(goto-char (point-max))
(format "(%d files)" (- (line-number-at-pos) 5))))
;; -5 is a hack, but I think it will actually always work since dired requires -al at a minimum.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment