Function: rcirc--make-new-nick

rcirc--make-new-nick is a byte-compiled function defined in rcirc.el.gz.

Signature

(rcirc--make-new-nick NICK LENGTH)

Documentation

Attempt to create a unused nickname out of NICK.

A new nick may at most be LENGTH characters long. If we already have some ` chars at the end, then shorten the non-` bit of the name.

Source Code

;; Defined in /usr/src/emacs/lisp/net/rcirc.el.gz
(defun rcirc--make-new-nick (nick length)
  "Attempt to create a unused nickname out of NICK.
A new nick may at most be LENGTH characters long.  If we already
have some ` chars at the end, then shorten the non-` bit of the
name."
  (when (= (length nick) length)
    (setq nick (replace-regexp-in-string "[^`]\\(`+\\)\\'" "\\1" nick)))
  (concat
   (if (>= (length nick) length)
       (substring nick 0 (1- length))
     nick)
   "`"))