Malabarba/smart-mode-line

Fallback to uniquified buffer name for paths not covered by sml/replacer-regexp-list

Closed this issue · 2 comments

Currently sml/generate-buffer-identification falls back to the full path for paths that aren't covered by sml/replacer-regexp-list. I think it would be nice if it optionally yielded to the that mechanism that would otherwise be used, e.g. for file-visiting buffers buffer-file-name should be used.

When the uniquify package is loaded, then I think that should count as the user having opted in to that optional behavior (why would you load it otherwise?). You should probably add an option for this, but if uniquify is already loaded when that option is set, then it should default to optional behavior.

I am guessing that the easiest and most compatible way to implement this boils down to:

(if (match-in sml/replacer-regexp-list)
    (what is currently being done)
  (format-mode-line (propertized-buffer-identification "%b")))

Ps: Sorry for opening many issues in quick succession. I hate it when someone does that in one of my repositories. So let me note that I do not in any way expect you to tackle all of this anytime soon.

Pps: This issues is the one I personally care about most. (As I can easily hack around the others.)

I've pushed a change that makes this configurable. Unfortunately I can't rely on checking if the uniquify package is loaded because it's been on by default since 24.4

Thanks!