Home > smarty-ip

smarty-ip

Smarty-ip is a project mainly written in ..., it's free.

smarty-ip: ip location tools for emacs

smarty-ip.el --- ip location tools for emacs

Copyright (C) kbonez.com

Author: Breeze.Kay [email protected] Created: 5 Aug 2011 Version: 0.8.7_r1 Keywords: tools

This file is not (yet) part of GNU Emacs. However, it is distributed under the same license.

GNU Emacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GNU Emacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Change Log: 8 Aug 2011 - fix a document bug 7 Aug 2011 - add user-config feature 6 Aug 2011 - Separate config code and function code 5 Aug 2011 - Rebuild this programe,Separate some function can be used in other programes 5 Aug 2011 - First Release

Commentary: this programe is a subset of smarty-package, To use this, just put/replace it in smarty-package path. NOTE smarty-package must be added in your load-path. When you add smary-package,it will auto load it. To load smarty-package,use this in your .emacs file. (load "smarty")

configure file: If you install versions of smarty-ip in different languages.You MUST clean old language files ,the location is smarty-package-path/configure/smarty-ip-.el If you custom configure name ,it should be your custom-name smarty-package-path/`smarty-configure'/smarty-ip-.el

currently,it only support chinese and english. but you can config which you use.

  • copy smarty-package-path/`smarty-configure'/smarty-ip-en.el to smarty-ip-local.el
  • edit smarty-ip-local.el file.

functions you may want to use: M-x smarty-ip-interactive get ip-info by interacting with the system.the simplest way to get ip but I don't recommend you use it directly.you should use this smarty-ip' M-x smarty-ip smarty-ip-interactive' advanced version,if user active mark,the programe will try to search region,if not,it will be try to search current-point to line-end.

FAQ:

  • Q:The API address provided by smarty-ip can not satisfy my requirement.How to use other ip location API? A:Absolutely,it’s OK. You just need to do as the following steps: Access the path smarty-configure,e.g: cd ~/.emacs.d/smarty/configure/ based on a basic language,e.g: cp smarty-ip-en.el smarty-ip-local.el clear up the existent language package,e.g: rm smarty-ip-en.el
  • Q:What is "smarty-package" mentioned many times in the article? A:Smarty-package is extention of emacs. I planned to release it after all the tool package being packed up. But these days our company are holding a programme contest and smarty-ip is the production of this contest. So I release it ahead of schedule .

ToDo:

  • add replace ip to city in buffer
  • extend return-message format, let it can allow user-define.
  • allow translate the result to user-prefer
Previous:iin22adi