2000-06-30 Akira Ohashi <bg66@luck.gr.jp>
[elisp/liece.git] / lisp / liece-misc.el
index 496a372..3603ef6 100644 (file)
 (defmacro liece-server-host ()
   '(if (listp liece-server)
        (plist-get liece-server ':host)
-     liece-server))
+     (if (or (string-match "^\\[\\([^]]+\\)\\]:?[0-9]*" liece-server)
+            (string-match "^\\([^:]+\\):?[0-9]*" liece-server))
+         (match-string 1 liece-server)
+       liece-server)))
 
 (defmacro liece-clean-hostname (hostname)
   "Return the arg HOSTNAME, but if is a dotted-quad, put brackets around it."