comparison lisp/textmodes/tildify.el @ 31529:7f307e299d03

Minor doc/commentary fixes. (tildify) <defgroup>: Add :version.
author Dave Love <fx@gnu.org>
date Sun, 10 Sep 2000 22:07:06 +0000
parents eca255a79645
children 7012133c553b
comparison
equal deleted inserted replaced
31528:a461cad7a942 31529:7f307e299d03
2 2
3 ;; Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. 3 ;; Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
4 4
5 ;; Author: Milan Zamazal <pdm@freesoft.cz> 5 ;; Author: Milan Zamazal <pdm@freesoft.cz>
6 ;; Version: 4.4 6 ;; Version: 4.4
7 ;; Keywords: text, TeX, SGML 7 ;; Keywords: text, TeX, SGML, wp
8 8
9 ;; This file is part of GNU Emacs. 9 ;; This file is part of GNU Emacs.
10 10
11 ;; GNU Emacs is free software; you can redistribute it and/or modify 11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by 12 ;; it under the terms of the GNU General Public License as published by
26 ;;; Commentary: 26 ;;; Commentary:
27 27
28 ;; This package can be typically used for adding forgotten tildes in TeX 28 ;; This package can be typically used for adding forgotten tildes in TeX
29 ;; sources or adding `&nbsp;' sequences in SGML (e.g. HTML) texts. 29 ;; sources or adding `&nbsp;' sequences in SGML (e.g. HTML) texts.
30 ;; 30 ;;
31 ;; For example, the Czech ortography requires to avoid one letter prepositions 31 ;; For example, the Czech ortography requires avoiding one letter
32 ;; at line endings. So they should be connected with following words by tilde. 32 ;; prepositions at line endings. So they should be connected with the
33 ;; Some users forget to do this all the time. Purpose of this program is to 33 ;; following words by a tilde. Some users forget to do this all the
34 ;; check the text and suggest adding of missing tildes on some places. It 34 ;; time. The purpose of this program is to check the text and suggest
35 ;; works in similar manner like `query-replace-regexp'. 35 ;; adding of missing tildes on some places. It works in a similar
36 ;; manner to `query-replace-regexp'.
36 ;; 37 ;;
37 ;; Functionality of this program is actually performing query replace on 38 ;; The functionality of this program is actually performing query
38 ;; certain regions. But from historical reasons explained above it is called 39 ;; replace on certain regions, but for historical reasons explained
39 ;; `tildify'. 40 ;; above it is called `tildify'.
40 ;; 41 ;;
41 ;; The default variable settings are suited for Czech, so do not try to 42 ;; The default variable settings are suited for Czech, so do not try to
42 ;; understand them if you are not familiar with Czech grammar and spelling. 43 ;; understand them if you are not familiar with Czech grammar and spelling.
43 ;; 44 ;;
44 ;; The algorithm was inspired by Petr Ol¹įk's program `vlna'. Abbilities of 45 ;; The algorithm was inspired by Petr Ol¹įk's program `vlna'. Abbilities of
51 ;;; *** User configuration variables *** 52 ;;; *** User configuration variables ***
52 53
53 54
54 (defgroup tildify nil 55 (defgroup tildify nil
55 "Adding missing hard spaces or other text fragments into texts." 56 "Adding missing hard spaces or other text fragments into texts."
57 :version "21.1"
56 :group 'wp) 58 :group 'wp)
57 59
58 (defcustom tildify-pattern-alist 60 (defcustom tildify-pattern-alist
59 '((t "\\([,:;(][ \t]*[a]\\|\\<[AIKOSUVZikosuvz]\\)\\([ \t]+\\|[ \t]*\n[ \t]*\\)\\(\\w\\|[([{\\]\\|<[a-zA-Z]\\)" 2)) 61 '((t "\\([,:;(][ \t]*[a]\\|\\<[AIKOSUVZikosuvz]\\)\\([ \t]+\\|[ \t]*\n[ \t]*\\)\\(\\w\\|[([{\\]\\|<[a-zA-Z]\\)" 2))
60 "Alist specifying where to insert hard spaces. 62 "Alist specifying where to insert hard spaces.
73 75
74 NUMBER defines the number of the REGEXP subexpression which should be replaced 76 NUMBER defines the number of the REGEXP subexpression which should be replaced
75 by the hard space character. 77 by the hard space character.
76 78
77 The form (MAJOR-MODE . SYMBOL) defines alias item for MAJOR-MODE. For this 79 The form (MAJOR-MODE . SYMBOL) defines alias item for MAJOR-MODE. For this
78 mode, the item for the mode SYMBOL is looked up in the alist instead. 80 mode, the item for the mode SYMBOL is looked up in the alist instead."
79 "
80 :group 'tildify 81 :group 'tildify
81 :type '(repeat (choice (list symbol regexp integer) (cons symbol symbol)))) 82 :type '(repeat (choice (list symbol regexp integer) (cons symbol symbol))))
82 83
83 (defcustom tildify-string-alist 84 (defcustom tildify-string-alist
84 '((latex-mode . "~") 85 '((latex-mode . "~")
99 STRING defines the hard space, which is inserted at places defined by 100 STRING defines the hard space, which is inserted at places defined by
100 `tildify-pattern-alist'. For example it can be \"~\" for TeX or \"&nbsp;\" 101 `tildify-pattern-alist'. For example it can be \"~\" for TeX or \"&nbsp;\"
101 for SGML. 102 for SGML.
102 103
103 The form (MAJOR-MODE . SYMBOL) defines alias item for MAJOR-MODE. For this 104 The form (MAJOR-MODE . SYMBOL) defines alias item for MAJOR-MODE. For this
104 mode, the item for the mode SYMBOL is looked up in the alist instead. 105 mode, the item for the mode SYMBOL is looked up in the alist instead."
105 "
106 :group 'tildify 106 :group 'tildify
107 :type '(repeat (cons symbol (choice string symbol)))) 107 :type '(repeat (cons symbol (choice string symbol))))
108 108
109 (defcustom tildify-ignored-environments-alist 109 (defcustom tildify-ignored-environments-alist
110 '((latex-mode 110 '((latex-mode
156 END-REGEX defines end of the corresponding text part and can be either: 156 END-REGEX defines end of the corresponding text part and can be either:
157 - a regexp matching the end of the skipped text part 157 - a regexp matching the end of the skipped text part
158 - a list of regexps and numbers, which will compose the ending regexp by 158 - a list of regexps and numbers, which will compose the ending regexp by
159 concatenating themselves, while replacing the numbers with corresponding 159 concatenating themselves, while replacing the numbers with corresponding
160 subexpressions of BEG-REGEX (this is used to solve cases like 160 subexpressions of BEG-REGEX (this is used to solve cases like
161 \\\\verb<character> in TeX) 161 \\\\verb<character> in TeX)."
162 "
163 :group 'tildify 162 :group 'tildify
164 :type '(repeat (cons symbol (choice symbol (repeat sexp))))) 163 :type '(repeat (cons symbol (choice symbol (repeat sexp)))))
165 164
166 165
167 ;;; *** Internal variables *** 166 ;;; *** Internal variables ***
209 (setq aux (tildify-tildify a (marker-position z) ask)) 208 (setq aux (tildify-tildify a (marker-position z) ask))
210 (if (eq aux 'force) 209 (if (eq aux 'force)
211 (setq ask nil) 210 (setq ask nil)
212 (if (eq aux nil) 211 (if (eq aux nil)
213 (setq finish t))))) 212 (setq finish t)))))
214 (if (>= (marker-position z) (marker-position marker-end)) 213 (if (>= (marker-position z) (marker-position marker-end))
215 (setq finish t)) 214 (setq finish t))
216 (or (>= (point) (marker-position z)) 215 (or (>= (point) (marker-position z))
217 (goto-char (marker-position z))) 216 (goto-char (marker-position z)))
218 (if (not finish) 217 (if (not finish)
219 (if (re-search-forward end-env nil t) 218 (if (re-search-forward end-env nil t)
352 ;; Local variables: 351 ;; Local variables:
353 ;; coding: iso-latin-2 352 ;; coding: iso-latin-2
354 ;; End: 353 ;; End:
355 354
356 ;;; tildify.el ends here 355 ;;; tildify.el ends here
357
358
359