diff options
| author | Stefan Kangas | 2021-02-07 15:53:46 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2021-02-07 15:53:51 +0100 |
| commit | 4e8d36fdaadade020f0bcadc70d617d8b07b739c (patch) | |
| tree | 4062d784368378fbb55019826a9ab2ee032296f8 | |
| parent | 5ffc55d1e98d04b035c3d8d88d678b74af7a1fd7 (diff) | |
| download | emacs-4e8d36fdaadade020f0bcadc70d617d8b07b739c.tar.gz emacs-4e8d36fdaadade020f0bcadc70d617d8b07b739c.zip | |
Various doc fixes in dictionary.el
* lisp/net/dictionary.el (dictionary-set-server-var)
(dictionary-server, dictionary-port)
(dictionary-default-dictionary)
(dictionary-default-popup-strategy, dictionary-proxy-server)
(dictionary-proxy-port, dictionary-description-open-delimiter)
(dictionary-description-close-delimiter)
(dictionary-window-configuration, dictionary-selected-window)
(dictionary-position-stack, dictionary-data-stack)
(dictionary-positions, dictionary-current-data)
(dictionary-connection, dictionary-instances)
(dictionary-color-support, dictionary-word-history)
(dictionary-mode, dictionary, dictionary-check-connection)
(dictionary-mode-p, dictionary-send-command)
(dictionary-read-reply-and-split, dictionary-check-reply)
(dictionary-check-initial-reply, dictionary-store-state)
(dictionary-store-positions, dictionary-new-search)
(dictionary-new-search-internal, dictionary-do-search)
(dictionary-display-search-result)
(dictionary-display-word-definition)
(dictionary-special-dictionary, dictionary-set-strategy)
(dictionary-tooltip-dictionary, dictionary-switch-tooltip-mode)
(dictionary-tooltip-mode, global-dictionary-tooltip-mode): Doc fixes
to adhere to our conventions.
| -rw-r--r-- | lisp/net/dictionary.el | 124 |
1 files changed, 58 insertions, 66 deletions
diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index f8733429e94..7af8cdc59b2 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el | |||
| @@ -46,7 +46,7 @@ | |||
| 46 | (defun dictionary-set-server-var (name value) | 46 | (defun dictionary-set-server-var (name value) |
| 47 | "Customize helper for setting variable NAME to VALUE. | 47 | "Customize helper for setting variable NAME to VALUE. |
| 48 | The helper is used by customize to check for an active connection | 48 | The helper is used by customize to check for an active connection |
| 49 | when setting a variable. The user has then the choice to close | 49 | when setting a variable. The user has then the choice to close |
| 50 | the existing connection." | 50 | the existing connection." |
| 51 | (if (and (boundp 'dictionary-connection) | 51 | (if (and (boundp 'dictionary-connection) |
| 52 | dictionary-connection | 52 | dictionary-connection |
| @@ -73,8 +73,7 @@ You can specify here: | |||
| 73 | - Automatic: First try localhost, then dict.org after confirmation | 73 | - Automatic: First try localhost, then dict.org after confirmation |
| 74 | - localhost: Only use localhost | 74 | - localhost: Only use localhost |
| 75 | - dict.org: Only use dict.org | 75 | - dict.org: Only use dict.org |
| 76 | - User-defined: You can specify your own server here | 76 | - User-defined: You can specify your own server here" |
| 77 | " | ||
| 78 | :group 'dictionary | 77 | :group 'dictionary |
| 79 | :set 'dictionary-set-server-var | 78 | :set 'dictionary-set-server-var |
| 80 | :type '(choice (const :tag "Automatic" nil) | 79 | :type '(choice (const :tag "Automatic" nil) |
| @@ -86,7 +85,7 @@ You can specify here: | |||
| 86 | (defcustom dictionary-port | 85 | (defcustom dictionary-port |
| 87 | 2628 | 86 | 2628 |
| 88 | "The port of the dictionary server. | 87 | "The port of the dictionary server. |
| 89 | This port is propably always 2628 so there should be no need to modify it." | 88 | This port is propably always 2628 so there should be no need to modify it." |
| 90 | :group 'dictionary | 89 | :group 'dictionary |
| 91 | :set 'dictionary-set-server-var | 90 | :set 'dictionary-set-server-var |
| 92 | :type 'number | 91 | :type 'number |
| @@ -102,8 +101,8 @@ You can specify here: | |||
| 102 | (defcustom dictionary-default-dictionary | 101 | (defcustom dictionary-default-dictionary |
| 103 | "*" | 102 | "*" |
| 104 | "The dictionary which is used for searching definitions and matching. | 103 | "The dictionary which is used for searching definitions and matching. |
| 105 | * and ! have a special meaning, * search all dictionaries, ! search until | 104 | * and ! have a special meaning, * search all dictionaries, ! search until |
| 106 | one dictionary yields matches." | 105 | one dictionary yields matches." |
| 107 | :group 'dictionary | 106 | :group 'dictionary |
| 108 | :type 'string | 107 | :type 'string |
| 109 | :version "28.1") | 108 | :version "28.1") |
| @@ -144,8 +143,7 @@ by the choice value: | |||
| 144 | - User choice | 143 | - User choice |
| 145 | 144 | ||
| 146 | Here you can enter any matching algorithm supported by your | 145 | Here you can enter any matching algorithm supported by your |
| 147 | dictionary server. | 146 | dictionary server." |
| 148 | " | ||
| 149 | :group 'dictionary | 147 | :group 'dictionary |
| 150 | :type '(choice (const :tag "Exact match" "exact") | 148 | :type '(choice (const :tag "Exact match" "exact") |
| 151 | (const :tag "Similiar sounding" "soundex") | 149 | (const :tag "Similiar sounding" "soundex") |
| @@ -177,7 +175,7 @@ by the choice value: | |||
| 177 | 175 | ||
| 178 | (defcustom dictionary-proxy-server | 176 | (defcustom dictionary-proxy-server |
| 179 | "proxy" | 177 | "proxy" |
| 180 | "The name of the HTTP proxy to use when dictionary-use-http-proxy is set." | 178 | "The name of the HTTP proxy to use when `dictionary-use-http-proxy' is set." |
| 181 | :group 'dictionary-proxy | 179 | :group 'dictionary-proxy |
| 182 | :set 'dictionary-set-server-var | 180 | :set 'dictionary-set-server-var |
| 183 | :type 'string | 181 | :type 'string |
| @@ -185,7 +183,7 @@ by the choice value: | |||
| 185 | 183 | ||
| 186 | (defcustom dictionary-proxy-port | 184 | (defcustom dictionary-proxy-port |
| 187 | 3128 | 185 | 3128 |
| 188 | "The port of the proxy server, used only when dictionary-use-http-proxy is set." | 186 | "The port of the proxy server, used only when `dictionary-use-http-proxy' is set." |
| 189 | :group 'dictionary-proxy | 187 | :group 'dictionary-proxy |
| 190 | :set 'dictionary-set-server-var | 188 | :set 'dictionary-set-server-var |
| 191 | :type 'number | 189 | :type 'number |
| @@ -200,14 +198,14 @@ by the choice value: | |||
| 200 | 198 | ||
| 201 | (defcustom dictionary-description-open-delimiter | 199 | (defcustom dictionary-description-open-delimiter |
| 202 | "" | 200 | "" |
| 203 | "The delimiter to display in front of the dictionaries description" | 201 | "The delimiter to display in front of the dictionaries description." |
| 204 | :group 'dictionary | 202 | :group 'dictionary |
| 205 | :type 'string | 203 | :type 'string |
| 206 | :version "28.1") | 204 | :version "28.1") |
| 207 | 205 | ||
| 208 | (defcustom dictionary-description-close-delimiter | 206 | (defcustom dictionary-description-close-delimiter |
| 209 | "" | 207 | "" |
| 210 | "The delimiter to display after of the dictionaries description" | 208 | "The delimiter to display after of the dictionaries description." |
| 211 | :group 'dictionary | 209 | :group 'dictionary |
| 212 | :type 'string | 210 | :type 'string |
| 213 | :version "28.1") | 211 | :version "28.1") |
| @@ -283,27 +281,27 @@ is utf-8" | |||
| 283 | 281 | ||
| 284 | (defvar dictionary-window-configuration | 282 | (defvar dictionary-window-configuration |
| 285 | nil | 283 | nil |
| 286 | "The window configuration to be restored upon closing the buffer") | 284 | "The window configuration to be restored upon closing the buffer.") |
| 287 | 285 | ||
| 288 | (defvar dictionary-selected-window | 286 | (defvar dictionary-selected-window |
| 289 | nil | 287 | nil |
| 290 | "The currently selected window") | 288 | "The currently selected window.") |
| 291 | 289 | ||
| 292 | (defvar dictionary-position-stack | 290 | (defvar dictionary-position-stack |
| 293 | nil | 291 | nil |
| 294 | "The history buffer for point and window position") | 292 | "The history buffer for point and window position.") |
| 295 | 293 | ||
| 296 | (defvar dictionary-data-stack | 294 | (defvar dictionary-data-stack |
| 297 | nil | 295 | nil |
| 298 | "The history buffer for functions and arguments") | 296 | "The history buffer for functions and arguments.") |
| 299 | 297 | ||
| 300 | (defvar dictionary-positions | 298 | (defvar dictionary-positions |
| 301 | nil | 299 | nil |
| 302 | "The current positions") | 300 | "The current positions.") |
| 303 | 301 | ||
| 304 | (defvar dictionary-current-data | 302 | (defvar dictionary-current-data |
| 305 | nil | 303 | nil |
| 306 | "The item that will be placed on stack next time") | 304 | "The item that will be placed on stack next time.") |
| 307 | 305 | ||
| 308 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 306 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 309 | ;; Global variables | 307 | ;; Global variables |
| @@ -330,11 +328,11 @@ is utf-8" | |||
| 330 | 328 | ||
| 331 | (defvar dictionary-connection | 329 | (defvar dictionary-connection |
| 332 | nil | 330 | nil |
| 333 | "The current network connection") | 331 | "The current network connection.") |
| 334 | 332 | ||
| 335 | (defvar dictionary-instances | 333 | (defvar dictionary-instances |
| 336 | 0 | 334 | 0 |
| 337 | "The number of open dictionary buffers") | 335 | "The number of open dictionary buffers.") |
| 338 | 336 | ||
| 339 | (defvar dictionary-marker | 337 | (defvar dictionary-marker |
| 340 | nil | 338 | nil |
| @@ -344,11 +342,11 @@ is utf-8" | |||
| 344 | (condition-case nil | 342 | (condition-case nil |
| 345 | (x-display-color-p) | 343 | (x-display-color-p) |
| 346 | (error nil)) | 344 | (error nil)) |
| 347 | "Determines if the Emacs has support to display color") | 345 | "Determines if the Emacs has support to display color.") |
| 348 | 346 | ||
| 349 | (defvar dictionary-word-history | 347 | (defvar dictionary-word-history |
| 350 | '() | 348 | '() |
| 351 | "History list of searched word") | 349 | "History list of searched word.") |
| 352 | 350 | ||
| 353 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 351 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 354 | ;; Basic function providing startup actions | 352 | ;; Basic function providing startup actions |
| @@ -356,25 +354,25 @@ is utf-8" | |||
| 356 | 354 | ||
| 357 | ;;;###autoload | 355 | ;;;###autoload |
| 358 | (defun dictionary-mode () | 356 | (defun dictionary-mode () |
| 357 | ;; FIXME: Use define-derived-mode. | ||
| 359 | "Mode for searching a dictionary. | 358 | "Mode for searching a dictionary. |
| 360 | This is a mode for searching a dictionary server implementing the | 359 | This is a mode for searching a dictionary server implementing the |
| 361 | protocol defined in RFC 2229. | 360 | protocol defined in RFC 2229. |
| 362 | 361 | ||
| 363 | This is a quick reference to this mode describing the default key bindings: | 362 | This is a quick reference to this mode describing the default key bindings: |
| 363 | \\<dictionary-mode-map> | ||
| 364 | * \\[dictionary-close] close the dictionary buffer | ||
| 365 | * \\[dictionary-help] display this help information | ||
| 366 | * \\[dictionary-search] ask for a new word to search | ||
| 367 | * \\[dictionary-lookup-definition] search the word at point | ||
| 368 | * \\[forward-button] or TAB place point to the next link | ||
| 369 | * \\[backward-button] or S-TAB place point to the prev link | ||
| 364 | 370 | ||
| 365 | * q close the dictionary buffer | 371 | * \\[dictionary-match-words] ask for a pattern and list all matching words. |
| 366 | * h display this help information | 372 | * \\[dictionary-select-dictionary] select the default dictionary |
| 367 | * s ask for a new word to search | 373 | * \\[dictionary-select-strategy] select the default search strategy |
| 368 | * d search the word at point | ||
| 369 | * n or Tab place point to the next link | ||
| 370 | * p or S-Tab place point to the prev link | ||
| 371 | 374 | ||
| 372 | * m ask for a pattern and list all matching words. | 375 | * RET or <mouse-2> visit that link" |
| 373 | * D select the default dictionary | ||
| 374 | * M select the default search strategy | ||
| 375 | |||
| 376 | * Return or Button2 visit that link | ||
| 377 | " | ||
| 378 | 376 | ||
| 379 | (unless (eq major-mode 'dictionary-mode) | 377 | (unless (eq major-mode 'dictionary-mode) |
| 380 | (cl-incf dictionary-instances)) | 378 | (cl-incf dictionary-instances)) |
| @@ -399,7 +397,7 @@ This is a quick reference to this mode describing the default key bindings: | |||
| 399 | 397 | ||
| 400 | ;;;###autoload | 398 | ;;;###autoload |
| 401 | (defun dictionary () | 399 | (defun dictionary () |
| 402 | "Create a new dictonary buffer and install dictionary-mode." | 400 | "Create a new dictonary buffer and install `dictionary-mode'." |
| 403 | (interactive) | 401 | (interactive) |
| 404 | (let ((buffer (or (and dictionary-use-single-buffer | 402 | (let ((buffer (or (and dictionary-use-single-buffer |
| 405 | (get-buffer "*Dictionary*")) | 403 | (get-buffer "*Dictionary*")) |
| @@ -498,13 +496,13 @@ The connection takes the proxy setting in customization group | |||
| 498 | (dictionary-open-server server) | 496 | (dictionary-open-server server) |
| 499 | (error | 497 | (error |
| 500 | (if (y-or-n-p | 498 | (if (y-or-n-p |
| 501 | (format "Failed to open server %s, continue with dict.org?" | 499 | (format "Failed to open server %s, continue with dict.org? " |
| 502 | server)) | 500 | server)) |
| 503 | (dictionary-open-server "dict.org") | 501 | (dictionary-open-server "dict.org") |
| 504 | (error "Failed automatic server selection, please customize dictionary-server")))))))) | 502 | (error "Failed automatic server selection, please customize dictionary-server")))))))) |
| 505 | 503 | ||
| 506 | (defun dictionary-mode-p () | 504 | (defun dictionary-mode-p () |
| 507 | "Return non-nil if current buffer has dictionary-mode." | 505 | "Return non-nil if current buffer has `dictionary-mode'." |
| 508 | (eq major-mode 'dictionary-mode)) | 506 | (eq major-mode 'dictionary-mode)) |
| 509 | 507 | ||
| 510 | (defun dictionary-ensure-buffer () | 508 | (defun dictionary-ensure-buffer () |
| @@ -535,7 +533,7 @@ The connection takes the proxy setting in customization group | |||
| 535 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 533 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 536 | 534 | ||
| 537 | (defun dictionary-send-command (string) | 535 | (defun dictionary-send-command (string) |
| 538 | "Send the command `string' to the network connection." | 536 | "Send the command STRING to the network connection." |
| 539 | (dictionary-check-connection) | 537 | (dictionary-check-connection) |
| 540 | ;;;; ##### | 538 | ;;;; ##### |
| 541 | (dictionary-connection-send-crlf dictionary-connection string)) | 539 | (dictionary-connection-send-crlf dictionary-connection string)) |
| @@ -566,7 +564,7 @@ This function knows about the special meaning of quotes (\")" | |||
| 566 | (nreverse list))) | 564 | (nreverse list))) |
| 567 | 565 | ||
| 568 | (defun dictionary-read-reply-and-split () | 566 | (defun dictionary-read-reply-and-split () |
| 569 | "Reads the reply, splits it into words and returns it." | 567 | "Read the reply, split it into words and return it." |
| 570 | (let ((answer (make-symbol "reply-data")) | 568 | (let ((answer (make-symbol "reply-data")) |
| 571 | (reply (dictionary-read-reply))) | 569 | (reply (dictionary-read-reply))) |
| 572 | (let ((reply-list (dictionary-split-string reply))) | 570 | (let ((reply-list (dictionary-split-string reply))) |
| @@ -589,7 +587,7 @@ The answer is delimited by a decimal point (.) on a line by itself." | |||
| 589 | answer)) | 587 | answer)) |
| 590 | 588 | ||
| 591 | (defun dictionary-check-reply (reply code) | 589 | (defun dictionary-check-reply (reply code) |
| 592 | "Extract the reply code from REPLY and checks against CODE." | 590 | "Extract the reply code from REPLY and check against CODE." |
| 593 | (let ((number (dictionary-reply-code reply))) | 591 | (let ((number (dictionary-reply-code reply))) |
| 594 | (and (numberp number) | 592 | (and (numberp number) |
| 595 | (= number code)))) | 593 | (= number code)))) |
| @@ -623,7 +621,7 @@ The answer is delimited by a decimal point (.) on a line by itself." | |||
| 623 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 621 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 624 | 622 | ||
| 625 | (defun dictionary-check-initial-reply () | 623 | (defun dictionary-check-initial-reply () |
| 626 | "Reads the first reply from server and checks it." | 624 | "Read the first reply from server and check it." |
| 627 | (let ((reply (dictionary-read-reply-and-split))) | 625 | (let ((reply (dictionary-read-reply-and-split))) |
| 628 | (unless (dictionary-check-reply reply 220) | 626 | (unless (dictionary-check-reply reply 220) |
| 629 | (dictionary-connection-close dictionary-connection) | 627 | (dictionary-connection-close dictionary-connection) |
| @@ -631,9 +629,9 @@ The answer is delimited by a decimal point (.) on a line by itself." | |||
| 631 | 629 | ||
| 632 | ;; Store the current state | 630 | ;; Store the current state |
| 633 | (defun dictionary-store-state (function data) | 631 | (defun dictionary-store-state (function data) |
| 634 | "Stores the current state of operation for later restore. | 632 | "Store the current state of operation for later restore. |
| 635 | The current state consist of a tuple of FUNCTION and DATA. This | 633 | The current state consist of a tuple of FUNCTION and DATA. |
| 636 | is basically an implementation of a history to return to a | 634 | This is basically an implementation of a history to return to a |
| 637 | previous state." | 635 | previous state." |
| 638 | (if dictionary-current-data | 636 | (if dictionary-current-data |
| 639 | (progn | 637 | (progn |
| @@ -645,7 +643,7 @@ previous state." | |||
| 645 | (cons function data))) | 643 | (cons function data))) |
| 646 | 644 | ||
| 647 | (defun dictionary-store-positions () | 645 | (defun dictionary-store-positions () |
| 648 | "Stores the current positions for later restore." | 646 | "Store the current positions for later restore." |
| 649 | 647 | ||
| 650 | (setq dictionary-positions (cons (point) (window-start)))) | 648 | (setq dictionary-positions (cons (point) (window-start)))) |
| 651 | 649 | ||
| @@ -664,7 +662,7 @@ previous state." | |||
| 664 | ;; The normal search | 662 | ;; The normal search |
| 665 | 663 | ||
| 666 | (defun dictionary-new-search (args &optional all) | 664 | (defun dictionary-new-search (args &optional all) |
| 667 | "Saves the current state and starts a new search based on ARGS. | 665 | "Save the current state and start a new search based on ARGS. |
| 668 | The parameter ARGS is a cons cell where car is the word to search | 666 | The parameter ARGS is a cons cell where car is the word to search |
| 669 | and cdr is the dictionary where to search the word in." | 667 | and cdr is the dictionary where to search the word in." |
| 670 | (interactive) | 668 | (interactive) |
| @@ -680,15 +678,14 @@ and cdr is the dictionary where to search the word in." | |||
| 680 | (list word dictionary 'dictionary-display-search-result)))) | 678 | (list word dictionary 'dictionary-display-search-result)))) |
| 681 | 679 | ||
| 682 | (defun dictionary-new-search-internal (word dictionary function) | 680 | (defun dictionary-new-search-internal (word dictionary function) |
| 683 | "Starts a new search for WORD in DICTIONARY after preparing the buffer. | 681 | "Start a new search for WORD in DICTIONARY after preparing the buffer. |
| 684 | FUNCTION is the callback which is called for each search result. | 682 | FUNCTION is the callback which is called for each search result." |
| 685 | " | ||
| 686 | (dictionary-pre-buffer) | 683 | (dictionary-pre-buffer) |
| 687 | (dictionary-do-search word dictionary function)) | 684 | (dictionary-do-search word dictionary function)) |
| 688 | 685 | ||
| 689 | (defun dictionary-do-search (word dictionary function &optional nomatching) | 686 | (defun dictionary-do-search (word dictionary function &optional nomatching) |
| 690 | "Searches WORD in DICTIONARY and calls FUNCTION for each result. | 687 | "Search for WORD in DICTIONARY and call FUNCTION for each result. |
| 691 | The parameter NOMATCHING controls whether to suppress the display | 688 | Optional argument NOMATCHING controls whether to suppress the display |
| 692 | of matching words." | 689 | of matching words." |
| 693 | 690 | ||
| 694 | (message "Searching for %s in %s" word dictionary) | 691 | (message "Searching for %s in %s" word dictionary) |
| @@ -712,7 +709,7 @@ of matching words." | |||
| 712 | 'dictionary-display-only-match-result) | 709 | 'dictionary-display-only-match-result) |
| 713 | (dictionary-post-buffer))) | 710 | (dictionary-post-buffer))) |
| 714 | (if (dictionary-check-reply reply 550) | 711 | (if (dictionary-check-reply reply 550) |
| 715 | (error "Dictionary \"%s\" is unknown, please select an existing one." | 712 | (error "Dictionary \"%s\" is unknown, please select an existing one" |
| 716 | dictionary) | 713 | dictionary) |
| 717 | (unless (dictionary-check-reply reply 150) | 714 | (unless (dictionary-check-reply reply 150) |
| 718 | (error "Unknown server answer: %s" (dictionary-reply reply))) | 715 | (error "Unknown server answer: %s" (dictionary-reply reply))) |
| @@ -776,7 +773,7 @@ of matching words." | |||
| 776 | (setq buffer-read-only t)) | 773 | (setq buffer-read-only t)) |
| 777 | 774 | ||
| 778 | (defun dictionary-display-search-result (reply) | 775 | (defun dictionary-display-search-result (reply) |
| 779 | "This function starts displaying the result in REPLY." | 776 | "Start displaying the result in REPLY." |
| 780 | 777 | ||
| 781 | (let ((number (nth 1 (dictionary-reply-list reply)))) | 778 | (let ((number (nth 1 (dictionary-reply-list reply)))) |
| 782 | (insert number (if (equal number "1") | 779 | (insert number (if (equal number "1") |
| @@ -810,8 +807,7 @@ The DICTIONARY is only used for decoding the bytes to display the DESCRIPTION." | |||
| 810 | (defun dictionary-display-word-definition (reply word dictionary) | 807 | (defun dictionary-display-word-definition (reply word dictionary) |
| 811 | "Insert the definition in REPLY for the current WORD from DICTIONARY. | 808 | "Insert the definition in REPLY for the current WORD from DICTIONARY. |
| 812 | It will replace links which are found in the REPLY and replace | 809 | It will replace links which are found in the REPLY and replace |
| 813 | them with buttons to perform a a new search. | 810 | them with buttons to perform a a new search." |
| 814 | " | ||
| 815 | (let ((start (point))) | 811 | (let ((start (point))) |
| 816 | (insert (dictionary-decode-charset reply dictionary)) | 812 | (insert (dictionary-decode-charset reply dictionary)) |
| 817 | (insert "\n\n") | 813 | (insert "\n\n") |
| @@ -931,7 +927,7 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"." | |||
| 931 | (message "Dictionary %s has been selected" dictionary)))) | 927 | (message "Dictionary %s has been selected" dictionary)))) |
| 932 | 928 | ||
| 933 | (defun dictionary-special-dictionary (name) | 929 | (defun dictionary-special-dictionary (name) |
| 934 | "Checks whether the special * or ! dictionary are seen in NAME." | 930 | "Check whether the special * or ! dictionary are seen in NAME." |
| 935 | (or (equal name "*") | 931 | (or (equal name "*") |
| 936 | (equal name "!"))) | 932 | (equal name "!"))) |
| 937 | 933 | ||
| @@ -1011,7 +1007,7 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"." | |||
| 1011 | (insert "\n"))))) | 1007 | (insert "\n"))))) |
| 1012 | 1008 | ||
| 1013 | (defun dictionary-set-strategy (strategy &rest ignored) | 1009 | (defun dictionary-set-strategy (strategy &rest ignored) |
| 1014 | "Select this STRATEGY as new default" | 1010 | "Select this STRATEGY as new default." |
| 1015 | (setq dictionary-default-strategy strategy) | 1011 | (setq dictionary-default-strategy strategy) |
| 1016 | (dictionary-restore-state) | 1012 | (dictionary-restore-state) |
| 1017 | (message "Strategy %s has been selected" strategy)) | 1013 | (message "Strategy %s has been selected" strategy)) |
| @@ -1234,7 +1230,7 @@ allows editing it." | |||
| 1234 | 1230 | ||
| 1235 | (defcustom dictionary-tooltip-dictionary | 1231 | (defcustom dictionary-tooltip-dictionary |
| 1236 | nil | 1232 | nil |
| 1237 | "This dictionary to lookup words for tooltips" | 1233 | "This dictionary to lookup words for tooltips." |
| 1238 | :group 'dictionary | 1234 | :group 'dictionary |
| 1239 | :type '(choice (const :tag "None" nil) string) | 1235 | :type '(choice (const :tag "None" nil) string) |
| 1240 | :version "28.1") | 1236 | :version "28.1") |
| @@ -1296,8 +1292,7 @@ It is normally internally called with 1 to enable support for the | |||
| 1296 | tooltip mode. The hook function will check the value of the | 1292 | tooltip mode. The hook function will check the value of the |
| 1297 | variable dictionary-tooltip-mode to decide if some action must be | 1293 | variable dictionary-tooltip-mode to decide if some action must be |
| 1298 | taken. When disabling the tooltip mode the value of this variable | 1294 | taken. When disabling the tooltip mode the value of this variable |
| 1299 | will be set to nil. | 1295 | will be set to nil." |
| 1300 | " | ||
| 1301 | (interactive) | 1296 | (interactive) |
| 1302 | (tooltip-mode on) | 1297 | (tooltip-mode on) |
| 1303 | (if on | 1298 | (if on |
| @@ -1309,10 +1304,8 @@ will be set to nil. | |||
| 1309 | "Display tooltips for the current word. | 1304 | "Display tooltips for the current word. |
| 1310 | 1305 | ||
| 1311 | This function can be used to enable or disable the tooltip mode | 1306 | This function can be used to enable or disable the tooltip mode |
| 1312 | for the current buffer (based on ARG). If global-tooltip-mode is | 1307 | for the current buffer (based on ARG). If global-tooltip-mode is |
| 1313 | active it will overwrite that mode for the current buffer. | 1308 | active it will overwrite that mode for the current buffer." |
| 1314 | " | ||
| 1315 | |||
| 1316 | (interactive "P") | 1309 | (interactive "P") |
| 1317 | (require 'tooltip) | 1310 | (require 'tooltip) |
| 1318 | (let ((on (if arg | 1311 | (let ((on (if arg |
| @@ -1335,8 +1328,7 @@ Internally it provides a default for the dictionary-tooltip-mode. | |||
| 1335 | It can be overwritten for each buffer using dictionary-tooltip-mode. | 1328 | It can be overwritten for each buffer using dictionary-tooltip-mode. |
| 1336 | 1329 | ||
| 1337 | Note: (global-dictionary-tooltip-mode 0) will not disable the mode | 1330 | Note: (global-dictionary-tooltip-mode 0) will not disable the mode |
| 1338 | any buffer where (dictionary-tooltip-mode 1) has been called. | 1331 | any buffer where (dictionary-tooltip-mode 1) has been called." |
| 1339 | " | ||
| 1340 | (interactive "P") | 1332 | (interactive "P") |
| 1341 | (require 'tooltip) | 1333 | (require 'tooltip) |
| 1342 | (let ((on (if arg (> (prefix-numeric-value arg) 0) | 1334 | (let ((on (if arg (> (prefix-numeric-value arg) 0) |