 (def-modeline-segment! buffer-info
   "Combined information about the current buffer, including the current working
 directory, the file name, and its state (modified, read-only or non-existent)."
-  (let ((all-the-icons-scale-factor 1.2)
-        (modified-p (buffer-modified-p))
-        (active (active))
-        faces)
-    (if modified-p (push 'doom-modeline-buffer-modified faces))
+  (let* ((all-the-icons-scale-factor 1.2)
+         (modified-p (buffer-modified-p))
+         (active (active))
+         (faces (if modified-p 'doom-modeline-buffer-modified)))
     (concat (if buffer-read-only
                 (concat (all-the-icons-octicon
                          "lock"

                       :face 'doom-modeline-urgent
                       :v-adjust -0.05)
                      " "))
            (let ((dir-path  (+doom-modeline--buffer-path))
                  (faces (or faces (if active 'doom-modeline-buffer-path))))
              (when dir-path
                (if faces
                    (propertize dir-path 'face `(:inherit ,faces))
                  dir-path)))
            (let ((file-path (+doom-modeline--buffer-file))
                  (faces (or faces (if active 'doom-modeline-buffer-file))))
              (if faces
                  (propertize file-path 'face `(:inherit ,faces))
                file-path)))))


project root). Excludes the file basename. See `doom-buffer-name' for that."
  (when buffer-file-name
    (let ((buffer-path
           (file-relative-name (file-name-directory
                                (or buffer-file-truename (file-truename buffer-file-name)))
                               (doom-project-root))))
      (unless (equal buffer-path "./")
        (let ((max-length (truncate (* (window-body-width) 0.4))))
