Q:

Modify the modeline to show all emacsclients editing buffer

Is there a way to modify the Emacs modeline so I'll be able to see all the emacsclients or just the number of emacsclients actually editing/displaying the buffer I'm currently working on? 
I've found inside server.el.gz: 
;; The buffer local variable "server-buffer-clients" lists 
;; the clients who are waiting for this buffer to be edited.
;; The global variable "server-clients" lists all the waiting clients,
;; and which files are yet to be edited for each.   

And this is one example of ouput when I call M-x describe-variable server-buffer-clients:
server-buffer-clients is a variable defined in `server.el'.                                                     
Its value is
(#<process server <5>> #<process server <3>> #<process server <1>>)

Local in buffer basics.hs; global value is nil

  Automatically becomes permanently buffer-local when set.

Documentation:
List of client processes requesting editing of current buffer.

I don't really understand how to interpret the line: (#<process server <5>> #<process server <3>> #<process server <1>>). Thanks for your suggestions.

A:

From the documentation you quoted, I think the following construct
should give what you want.
'(:eval (when server-buffer-clients
          (format " %d" (length server-buffer-clients))))

Here's an example of how to add it to the mode-line, but you can also
add it other places if preferred.
(push '(:eval (when server-buffer-clients
                (format " %d" (length server-buffer-clients))))
      global-mode-string)

Here is another example, closer to the left side.
(setq mode-line-client
      (list mode-line-client
            '(:eval (when server-buffer-clients
                      (format " %d" (length server-buffer-clients))))))

