X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Friece-identity.el;h=77e4474b0670965f441b2e95a2ea8036479f2998;hb=c17d0121166c759a3b8a552abb1e309d62d9572f;hp=0f12d547705f194a164c9d7174c5103a01740bb5;hpb=8494a52113e0e498a2c0e6ff888ddaca095d669b;p=riece diff --git a/lisp/riece-identity.el b/lisp/riece-identity.el index 0f12d54..77e4474 100644 --- a/lisp/riece-identity.el +++ b/lisp/riece-identity.el @@ -121,6 +121,13 @@ RFC2812, 2.2 \"Character codes\" says: list)) (defun riece-format-identity (identity &optional prefix-only) + "Convert IDENTITY object to a string. +If the optional 2nd argument PREFIX-ONLY is non-nil, don't append +server part of the identity. + +The returned string will be abbreviated by +`riece-abbrev-identity-string-function', and `riece-identity' property +will be added." (let ((string (if (or prefix-only (equal (riece-identity-server identity) "")) @@ -133,6 +140,9 @@ RFC2812, 2.2 \"Character codes\" says: string)) (defun riece-parse-identity (string) + "Convert STRING to an identity object. +The string will be expanded by +`riece-expand-identity-string-function'." (if riece-expand-identity-string-function (setq string (funcall riece-expand-identity-string-function string))) (riece-make-identity (if (string-match " " string) @@ -143,8 +153,12 @@ RFC2812, 2.2 \"Character codes\" says: ""))) (defun riece-completing-read-identity (prompt channels - &optional predicate must-match - initial) + &optional predicate require-match + initial history default) + "Read an identity object in the minibuffer, with completion. +PROMPT is a string to prompt with; normally it ends in a colon and a space. +CHANNELS is a list of identity objects. +The rest of arguments are the same as `completing-read'." (let* ((string (completing-read prompt @@ -152,7 +166,7 @@ RFC2812, 2.2 \"Character codes\" says: (list (riece-format-identity channel))) (delq nil (copy-sequence (or channels riece-current-channels)))) - predicate must-match initial)) + predicate require-match initial history default)) (identity (riece-parse-identity string))) (unless (string-match (concat "^\\(" riece-channel-regexp "\\|"