Mercurial > hg > xemacs-beta
comparison lisp/packages/ispell.el @ 120:cca96a509cfe r20-1b12
Import from CVS: tag r20-1b12
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:25:29 +0200 |
parents | 4be1180a9e89 |
children | 9b50b4588a93 |
comparison
equal
deleted
inserted
replaced
119:d101af7320b8 | 120:cca96a509cfe |
---|---|
313 | 313 |
314 ;; ******* THIS FILE IS WRITTEN FOR ISPELL VERSION 3.1 | 314 ;; ******* THIS FILE IS WRITTEN FOR ISPELL VERSION 3.1 |
315 | 315 |
316 ;;; Code: | 316 ;;; Code: |
317 | 317 |
318 (defvar ispell-highlight-p t | 318 (defgroup ispell nil |
319 "*Highlight spelling errors when non-nil.") | 319 "Spell checking using ispell" |
320 | 320 :group 'processes) |
321 (defvar ispell-highlight-face 'highlight | 321 |
322 | |
323 (defcustom ispell-highlight-p t | |
324 "*Highlight spelling errors when non-nil." | |
325 :type 'boolean | |
326 :group 'ispell) | |
327 | |
328 (defcustom ispell-highlight-face 'highlight | |
322 "*The face used for Ispell highlighting. For Emacses with overlays. | 329 "*The face used for Ispell highlighting. For Emacses with overlays. |
323 Possible values are `highlight', `modeline', `secondary-selection', | 330 Possible values are `highlight', `modeline', `secondary-selection', |
324 `region', and `underline'. | 331 `region', and `underline'. |
325 This variable can be set by the user to whatever face they desire. | 332 This variable can be set by the user to whatever face they desire. |
326 It's most convenient if the cursor color and highlight color are | 333 It's most convenient if the cursor color and highlight color are |
327 slightly different.") | 334 slightly different." |
328 | 335 :type 'face |
329 (defvar ispell-check-comments t | 336 :group 'ispell) |
330 "*If nil, don't check spelling of comments.") | 337 |
331 | 338 (defcustom ispell-check-comments t |
332 (defvar ispell-query-replace-choices nil | 339 "*If nil, don't check spelling of comments." |
340 :type 'boolean | |
341 :group 'ispell) | |
342 | |
343 (defcustom ispell-query-replace-choices nil | |
333 "*Corrections made throughout region when non-nil. | 344 "*Corrections made throughout region when non-nil. |
334 Uses `query-replace' (\\[query-replace]) for corrections.") | 345 Uses `query-replace' (\\[query-replace]) for corrections." |
335 | 346 :type 'boolean |
336 (defvar ispell-skip-tib nil | 347 :group 'ispell) |
348 | |
349 (defcustom ispell-skip-tib nil | |
337 "*Does not spell check `tib' bibliography references when non-nil. | 350 "*Does not spell check `tib' bibliography references when non-nil. |
338 Skips any text between strings matching regular expressions | 351 Skips any text between strings matching regular expressions |
339 `ispell-tib-ref-beginning' and `ispell-tib-ref-end'. | 352 `ispell-tib-ref-beginning' and `ispell-tib-ref-end'. |
340 | 353 |
341 TeX users beware: Any field starting with [. will skip until a .] -- even | 354 TeX users beware: Any field starting with [. will skip until a .] -- even |
342 your whole buffer -- unless you set `ispell-skip-tib' to nil. That includes | 355 your whole buffer -- unless you set `ispell-skip-tib' to nil. That includes |
343 a [.5mm] type of number....") | 356 a [.5mm] type of number...." |
357 :type 'boolean | |
358 :group 'ispell) | |
344 | 359 |
345 (defvar ispell-tib-ref-beginning "[[<]\\." | 360 (defvar ispell-tib-ref-beginning "[[<]\\." |
346 "Regexp matching the beginning of a Tib reference.") | 361 "Regexp matching the beginning of a Tib reference.") |
347 | 362 |
348 (defvar ispell-tib-ref-end "\\.[]>]" | 363 (defvar ispell-tib-ref-end "\\.[]>]" |
349 "Regexp matching the end of a Tib reference.") | 364 "Regexp matching the end of a Tib reference.") |
350 | 365 |
351 (defvar ispell-keep-choices-win t | 366 (defcustom ispell-keep-choices-win t |
352 "*When not nil, the `*Choices*' window remains for spelling session. | 367 "*When not nil, the `*Choices*' window remains for spelling session. |
353 This minimizes redisplay thrashing.") | 368 This minimizes redisplay thrashing." |
354 | 369 :type 'boolean |
355 (defvar ispell-choices-win-default-height 2 | 370 :group 'ispell) |
371 | |
372 (defcustom ispell-choices-win-default-height 2 | |
356 "*The default size of the `*Choices*' window, including status line. | 373 "*The default size of the `*Choices*' window, including status line. |
357 Must be greater than 1.") | 374 Must be greater than 1." |
358 | 375 :type 'integer |
359 (defvar ispell-program-name "ispell" | 376 :group 'ispell) |
360 "Program invoked by \\[ispell-word] and \\[ispell-region] commands.") | 377 |
361 | 378 (defcustom ispell-program-name "ispell" |
362 (defvar ispell-alternate-dictionary | 379 "Program invoked by \\[ispell-word] and \\[ispell-region] commands." |
380 :type 'string | |
381 :group 'ispell) | |
382 | |
383 (defcustom ispell-alternate-dictionary | |
363 (cond ((file-exists-p "/usr/dict/web2") "/usr/dict/web2") | 384 (cond ((file-exists-p "/usr/dict/web2") "/usr/dict/web2") |
364 ((file-exists-p "/usr/share/dict/web2") "/usr/share/dict/web2") | 385 ((file-exists-p "/usr/share/dict/web2") "/usr/share/dict/web2") |
365 ((file-exists-p "/usr/dict/words") "/usr/dict/words") | 386 ((file-exists-p "/usr/dict/words") "/usr/dict/words") |
366 ((file-exists-p "/usr/lib/dict/words") "/usr/lib/dict/words") | 387 ((file-exists-p "/usr/lib/dict/words") "/usr/lib/dict/words") |
367 ((file-exists-p "/usr/share/dict/words") "/usr/share/dict/words") | 388 ((file-exists-p "/usr/share/dict/words") "/usr/share/dict/words") |
368 ((file-exists-p "/sys/dict") "/sys/dict") | 389 ((file-exists-p "/sys/dict") "/sys/dict") |
369 (t "/usr/dict/words")) | 390 (t "/usr/dict/words")) |
370 "*Alternate dictionary for spelling help.") | 391 "*Alternate dictionary for spelling help." |
371 | 392 :type 'file |
372 (defvar ispell-complete-word-dict ispell-alternate-dictionary | 393 :group 'ispell) |
373 "*Dictionary used for word completion.") | 394 |
395 (defcustom ispell-complete-word-dict ispell-alternate-dictionary | |
396 "*Dictionary used for word completion." | |
397 :type 'file | |
398 :group 'ispell) | |
374 | 399 |
375 (defvar ispell-grep-command "egrep" | 400 (defvar ispell-grep-command "egrep" |
376 "Name of the grep command for search processes.") | 401 "Name of the grep command for search processes.") |
377 | 402 |
378 (defvar ispell-grep-options "-i" | 403 (defvar ispell-grep-options "-i" |
382 | 407 |
383 (defvar ispell-look-command "look" | 408 (defvar ispell-look-command "look" |
384 "Name of the look command for search processes. | 409 "Name of the look command for search processes. |
385 This must be an absolute file name.") | 410 This must be an absolute file name.") |
386 | 411 |
387 (defvar ispell-look-p (file-exists-p ispell-look-command) | 412 (defcustom ispell-look-p `(file-exists-p ispell-look-command) |
388 "*Non-nil means use `look' rather than `grep'. | 413 "*Non-nil means use `look' rather than `grep'. |
389 Default is based on whether `look' seems to be available.") | 414 Default is based on whether `look' seems to be available." |
390 | 415 :type 'boolean |
391 (defvar ispell-have-new-look nil | 416 :group 'ispell) |
392 "*Non-nil means use the `-r' option (regexp) when running `look'.") | 417 |
418 (defcustom ispell-have-new-look nil | |
419 "*Non-nil means use the `-r' option (regexp) when running `look'." | |
420 :type 'boolean | |
421 :group 'ispell) | |
393 | 422 |
394 (defvar ispell-look-options (if ispell-have-new-look "-dfr" "-df") | 423 (defvar ispell-look-options (if ispell-have-new-look "-dfr" "-df") |
395 "String of command options for `ispell-look-command'.") | 424 "String of command options for `ispell-look-command'.") |
396 | 425 |
397 (defvar ispell-use-ptys-p nil | 426 (defvar ispell-use-ptys-p nil |
398 "When non-nil, Emacs uses ptys to communicate with Ispell. | 427 "When non-nil, Emacs uses ptys to communicate with Ispell. |
399 When nil, Emacs uses pipes.") | 428 When nil, Emacs uses pipes.") |
400 | 429 |
401 (defvar ispell-following-word nil | 430 (defcustom ispell-following-word nil |
402 "*Non-nil means `ispell-word' checks the word around or after point. | 431 "*Non-nil means `ispell-word' checks the word around or after point. |
403 Otherwise `ispell-word' checks the preceding word.") | 432 Otherwise `ispell-word' checks the preceding word." |
404 | 433 :type 'boolean |
405 (defvar ispell-help-in-bufferp nil | 434 :group 'ispell) |
435 | |
436 (defcustom ispell-help-in-bufferp nil | |
406 "*Non-nil means display interactive keymap help in a buffer. | 437 "*Non-nil means display interactive keymap help in a buffer. |
407 Otherwise use the minibuffer.") | 438 Otherwise use the minibuffer." |
408 | 439 :type 'boolean |
409 (defvar ispell-quietly nil | 440 :group 'ispell) |
410 "*Non-nil means suppress messages in `ispell-word'.") | 441 |
411 | 442 (defcustom ispell-quietly nil |
412 (defvar ispell-format-word (function upcase) | 443 "*Non-nil means suppress messages in `ispell-word'." |
444 :type 'boolean | |
445 :group 'ispell) | |
446 | |
447 (defcustom ispell-format-word (function upcase) | |
413 "*Formatting function for displaying word being spell checked. | 448 "*Formatting function for displaying word being spell checked. |
414 The function must take one string argument and return a string.") | 449 The function must take one string argument and return a string." |
450 :type 'function | |
451 :group 'ispell) | |
415 | 452 |
416 ;;;###autoload | 453 ;;;###autoload |
417 (defvar ispell-personal-dictionary nil | 454 (defcustom ispell-personal-dictionary nil |
418 "*File name of your personal spelling dictionary, or nil. | 455 "*File name of your personal spelling dictionary, or nil. |
419 If nil, the default personal dictionary, \"~/.ispell_DICTNAME\" is used, | 456 If nil, the default personal dictionary, \"~/.ispell_DICTNAME\" is used, |
420 where DICTNAME is the name of your default dictionary.") | 457 where DICTNAME is the name of your default dictionary." |
421 | 458 :type 'file |
422 (defvar ispell-silently-savep nil | 459 :group 'ispell) |
423 "*When non-nil, save the personal dictionary without confirmation.") | 460 |
461 (defcustom ispell-silently-savep nil | |
462 "*When non-nil, save the personal dictionary without confirmation." | |
463 :type 'boolean | |
464 :group 'ispell) | |
424 | 465 |
425 ;;; This variable contains the current dictionary being used if the ispell | 466 ;;; This variable contains the current dictionary being used if the ispell |
426 ;;; process is running. Otherwise it contains the global default. | 467 ;;; process is running. Otherwise it contains the global default. |
427 (defvar ispell-dictionary nil | 468 (defvar ispell-dictionary nil |
428 "If non-nil, a dictionary to use instead of the default one. | 469 "If non-nil, a dictionary to use instead of the default one. |
432 You should set this variable before your first use of Emacs spell-checking | 473 You should set this variable before your first use of Emacs spell-checking |
433 commands in the Emacs session, or else use the \\[ispell-change-dictionary] | 474 commands in the Emacs session, or else use the \\[ispell-change-dictionary] |
434 command to change it. Otherwise, this variable only takes effect in a newly | 475 command to change it. Otherwise, this variable only takes effect in a newly |
435 started Ispell process.") | 476 started Ispell process.") |
436 | 477 |
437 (defvar ispell-extra-args nil | 478 (defcustom ispell-extra-args nil |
438 "*If non-nil, a list of extra switches to pass to the Ispell program. | 479 "*If non-nil, a list of extra switches to pass to the Ispell program. |
439 For example, '(\"-W\" \"3\") to cause it to accept all 1-3 character | 480 For example, '(\"-W\" \"3\") to cause it to accept all 1-3 character |
440 words as correct. See also `ispell-dictionary-alist', which may be used | 481 words as correct. See also `ispell-dictionary-alist', which may be used |
441 for language-specific arguments.") | 482 for language-specific arguments." |
483 :type '(repeat string) | |
484 :group 'ispell) | |
442 | 485 |
443 ;;; The preparation of the menu bar menu must be autoloaded | 486 ;;; The preparation of the menu bar menu must be autoloaded |
444 ;;; because otherwise this file gets autoloaded every time Emacs starts | 487 ;;; because otherwise this file gets autoloaded every time Emacs starts |
445 ;;; so that it can set up the menus and determine keyboard equivalents. | 488 ;;; so that it can set up the menus and determine keyboard equivalents. |
446 | 489 |
483 "[---']" t nil "~list") | 526 "[---']" t nil "~list") |
484 ("francais-tex" ; francais.aff | 527 ("francais-tex" ; francais.aff |
485 "[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]" | 528 "[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]" |
486 "[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]" | 529 "[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]" |
487 "[---'^`\"]" t nil "~tex") | 530 "[---'^`\"]" t nil "~tex") |
531 ("italiano" ; italiano.aff | |
532 "[A-Za-z\300\310\311\314\315\316\322\331\332\340\350\351\354\355\356\362\371\372]" | |
533 "[^A-Za-z\300\310\311\314\315\316\322\331\332\340\350\351\354\355\356\362\371\372]" | |
534 "[']" t ("-d" "italiano") "~list") | |
488 ("dansk" ; dansk.aff | 535 ("dansk" ; dansk.aff |
489 "[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]" | 536 "[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]" |
490 "" nil ("-C") nil) | 537 "" nil ("-C") nil) |
491 )) | 538 )) |
492 | 539 |