diff options
author | Reuben Thomas <rrt@sc3d.org> | 2013-05-08 19:54:39 +0200 |
---|---|---|
committer | Torsten Hilbrich <torsten.hilbrich@gmx.net> | 2013-05-08 19:59:06 +0200 |
commit | af254899a5507a776ee7291ae6ace7cc280eedfe (patch) | |
tree | cf9553467bd3dfc19e724eec9ba4fe52758d9528 | |
parent | a5ef20b2c32457880827ceda58f927ad9a26d2b7 (diff) |
Changes coming from debian package
- Bypass custom-add-load to speed startup
- dictionary-set-server-var which will be called after server
related variables are set via customize
- support for --exit-- as dictionary name meaning end of default
search list
Signed-off-by: Torsten Hilbrich <torsten.hilbrich@gmx.net>
-rwxr-xr-x | dictionary-init.el | 3 | ||||
-rwxr-xr-x | dictionary.el | 17 |
2 files changed, 19 insertions, 1 deletions
diff --git a/dictionary-init.el b/dictionary-init.el index 55dc624..7f430f2 100755 --- a/dictionary-init.el +++ b/dictionary-init.el @@ -21,3 +21,6 @@ (autoload 'global-dictionary-tooltip-mode "dictionary" "Enable/disable dictionary-tooltip-mode for all buffers" t)) +;; Bypass custom-add-load to speed startup. +(put 'dictionary 'custom-loads '(dictionary)) +(put 'dictionary-group 'custom-loads '(dictionary))
\ No newline at end of file diff --git a/dictionary.el b/dictionary.el index dd30c14..9548127 100755 --- a/dictionary.el +++ b/dictionary.el @@ -40,6 +40,15 @@ (defmacro defcustom (var value doc &rest ignored) (list 'defvar var value doc)))) +(defun dictionary-set-server-var (name value) + (if (and (boundp 'dictionary-connection) + dictionary-connection + (eq (connection-status dictionary-connection) 'up) + (y-or-n-p + (concat "Close existing connection to " dictionary-server "? "))) + (connection-close dictionary-connection)) + (set-default name value)) + (defgroup dictionary nil "Client for accessing the dictd server based dictionaries" :group 'hypermedia) @@ -52,6 +61,7 @@ "dict.org" "This server is contacted for searching the dictionary" :group 'dictionary + :set 'dictionary-set-server-var :type 'string) (defcustom dictionary-port @@ -59,6 +69,7 @@ "The port of the dictionary server. This port is propably always 2628 so there should be no need to modify it." :group 'dictionary + :set 'dictionary-set-server-var :type 'number) (defcustom dictionary-identification @@ -134,18 +145,21 @@ by the choice value: nil "Connects via a HTTP proxy using the CONNECT command when not nil." :group 'dictionary-proxy + :set 'dictionary-set-server-var :type 'boolean) (defcustom dictionary-proxy-server "proxy" "The name of the HTTP proxy to use when dictionary-use-http-proxy is set." :group 'dictionary-proxy + :set 'dictionary-set-server-var :type 'string) (defcustom dictionary-proxy-port 3128 "The port of the proxy server, used only when dictionary-use-http-proxy is set." :group 'dictionary-proxy + :set 'dictionary-set-server-var :type 'number) (defcustom dictionary-use-single-buffer @@ -836,7 +850,8 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"." (description (cadr list)) (translated (dictionary-decode-charset description dictionary))) (if dictionary - (progn + (if (equal dictionary "--exit--") + (insert "(end of default search list)\n") (link-insert-link (concat dictionary ": " translated) 'dictionary-reference-face 'dictionary-set-dictionary |