diff options
| author | Thien-Thi Nguyen | 2006-08-11 09:28:44 +0000 |
|---|---|---|
| committer | Thien-Thi Nguyen | 2006-08-11 09:28:44 +0000 |
| commit | bad03cfc8030793473927dff7f8c87bc45fc4bbe (patch) | |
| tree | e81e9d7bd00f7dae914777fc4008e3fa2fa81e27 | |
| parent | 2f2f340fb561971fef6a846ff4621c69dab0a969 (diff) | |
| download | emacs-bad03cfc8030793473927dff7f8c87bc45fc4bbe.tar.gz emacs-bad03cfc8030793473927dff7f8c87bc45fc4bbe.zip | |
(bindat-ip-to-string): Use `format-network-address' if possible.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/bindat.el | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ada27d2c275..a6ee985c659 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2006-08-11 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/bindat.el (bindat-ip-to-string): | ||
| 4 | Use `format-network-address' if possible. | ||
| 5 | |||
| 1 | 2006-08-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 6 | 2006-08-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 2 | 7 | ||
| 3 | * x-dnd.el (x-dnd-init-frame): Call x-register-dnd-atom. | 8 | * x-dnd.el (x-dnd-init-frame): Call x-register-dnd-atom. |
diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el index d05eed2c4a2..1b37f3f772f 100644 --- a/lisp/emacs-lisp/bindat.el +++ b/lisp/emacs-lisp/bindat.el | |||
| @@ -619,9 +619,12 @@ If optional second arg SEP is a string, use that as separator." | |||
| 619 | (bindat-format-vector vect "%02x" (if (stringp sep) sep ":"))) | 619 | (bindat-format-vector vect "%02x" (if (stringp sep) sep ":"))) |
| 620 | 620 | ||
| 621 | (defun bindat-ip-to-string (ip) | 621 | (defun bindat-ip-to-string (ip) |
| 622 | "Format vector IP as an ip address in dotted notation." | 622 | "Format vector IP as an ip address in dotted notation. |
| 623 | (format "%d.%d.%d.%d" | 623 | The port (if any) is omitted. IP can be a string, as well." |
| 624 | (aref ip 0) (aref ip 1) (aref ip 2) (aref ip 3))) | 624 | (if (vectorp ip) |
| 625 | (format-network-address ip t) | ||
| 626 | (format "%d.%d.%d.%d" | ||
| 627 | (aref ip 0) (aref ip 1) (aref ip 2) (aref ip 3)))) | ||
| 625 | 628 | ||
| 626 | (provide 'bindat) | 629 | (provide 'bindat) |
| 627 | 630 | ||