Bruce-Connor/smart-mode-line — pull request #98 by ffevotte (2014-11-13 16:05:24+00:00)
Title: Better handle clones

The code in pull request #97 allows handling cloned buffer in such a way that the newly-created clone is identified by the default string "filename<N>". This is however not very consistent with the way the original buffer is identified through `sml`: "path/to/filename".

I'm not sure haw this problem should be tackled. This patch is one way of dealing with this (potentially not the best, but I haven't thought of anything else).

It advises `clone-indirect-buffer` so that the newly-created clone:

1. inherits its parent `buffer-file-name`, and
2. is clearly identified by having a non-nil buffer-local `sml/clone` variable.

`sml/buffer-name` then always returns `(buffer-name)` for buffers identified as clones, as a way to disambiguate them from their parent.

As a consequence, with this patch, the generated buffer identifications respectively read:

- path/to/filename
- path/to/filename<N>