Mercurial > emacs
comparison lisp/textmodes/tildify.el @ 88155:d7ddb3e565de
sync with trunk
author | Henrik Enberg <henrik.enberg@telia.com> |
---|---|
date | Mon, 16 Jan 2006 00:03:54 +0000 |
parents | 5ade352e8d1c |
children |
comparison
equal
deleted
inserted
replaced
88154:8ce476d3ba36 | 88155:d7ddb3e565de |
---|---|
1 ;;; tildify.el --- adding hard spaces into texts | 1 ;;; tildify.el --- adding hard spaces into texts |
2 | 2 |
3 ;; Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004, |
4 ;; 2005 Free Software Foundation, Inc. | |
4 | 5 |
5 ;; Author: Milan Zamazal <pdm@zamazal.org> | 6 ;; Author: Milan Zamazal <pdm@zamazal.org> |
6 ;; Version: 4.5 | 7 ;; Version: 4.5 |
7 ;; Keywords: text, TeX, SGML, wp | 8 ;; Keywords: text, TeX, SGML, wp |
8 | 9 |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
19 ;; GNU General Public License for more details. | 20 ;; GNU General Public License for more details. |
20 | 21 |
21 ;; You should have received a copy of the GNU General Public License | 22 ;; You should have received a copy of the GNU General Public License |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the | 23 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
24 ;; Boston, MA 02111-1307, USA. | 25 ;; Boston, MA 02110-1301, USA. |
25 | 26 |
26 ;;; Commentary: | 27 ;;; Commentary: |
27 | 28 |
28 ;; This package can be typically used for adding forgotten tildes in TeX | 29 ;; This package can be typically used for adding forgotten tildes in TeX |
29 ;; sources or adding ` ' sequences in SGML (e.g. HTML) texts. | 30 ;; sources or adding ` ' sequences in SGML (e.g. HTML) texts. |
30 ;; | 31 ;; |
31 ;; For example, the Czech ortography requires avoiding one letter | 32 ;; For example, the Czech orthography requires avoiding one letter |
32 ;; prepositions at line endings. So they should be connected with the | 33 ;; prepositions at line endings. So they should be connected with the |
33 ;; following words by a tilde. Some users forget to do this all the | 34 ;; following words by a tilde. Some users forget to do this all the |
34 ;; time. The purpose of this program is to check the text and suggest | 35 ;; time. The purpose of this program is to check the text and suggest |
35 ;; adding of missing tildes on some places. It works in a similar | 36 ;; adding of missing tildes on some places. It works in a similar |
36 ;; manner to `query-replace-regexp'. | 37 ;; manner to `query-replace-regexp'. |
40 ;; above it is called `tildify'. | 41 ;; above it is called `tildify'. |
41 ;; | 42 ;; |
42 ;; The default variable settings are suited for Czech, so do not try to | 43 ;; The default variable settings are suited for Czech, so do not try to |
43 ;; understand them if you are not familiar with Czech grammar and spelling. | 44 ;; understand them if you are not familiar with Czech grammar and spelling. |
44 ;; | 45 ;; |
45 ;; The algorithm was inspired by Petr Ol¹įk's program `vlna'. Abbilities of | 46 ;; The algorithm was inspired by Petr Ol¹įk's program `vlna'. Abilities of |
46 ;; `tildify.el' are a little limited; if you have improvement suggestions, let | 47 ;; `tildify.el' are a little limited; if you have improvement suggestions, let |
47 ;; me know. | 48 ;; me know. |
48 | 49 |
49 ;;; Code: | 50 ;;; Code: |
50 | 51 |
219 (if (not finish) | 220 (if (not finish) |
220 (if (re-search-forward end-env nil t) | 221 (if (re-search-forward end-env nil t) |
221 (if (> (point) (marker-position marker-end)) | 222 (if (> (point) (marker-position marker-end)) |
222 (setq finish t)) | 223 (setq finish t)) |
223 (message | 224 (message |
224 (format "End of environment not found: %s" end-env)) | 225 "End of environment not found: %s" end-env) |
225 (setq finish t)))))) | 226 (setq finish t)))))) |
226 ;; No ignored environments, tildify directly | 227 ;; No ignored environments, tildify directly |
227 (tildify-tildify beg end ask))) | 228 (tildify-tildify beg end ask))) |
228 (message (format "%d spaces replaced." tildify-count))) | 229 (message "%d spaces replaced." tildify-count)) |
229 | 230 |
230 ;;;###autoload | 231 ;;;###autoload |
231 (defun tildify-buffer () | 232 (defun tildify-buffer () |
232 "Add hard spaces in the current buffer. | 233 "Add hard spaces in the current buffer. |
233 See variables `tildify-pattern-alist', `tildify-string-alist', and | 234 See variables `tildify-pattern-alist', `tildify-string-alist', and |
352 | 353 |
353 ;; Local variables: | 354 ;; Local variables: |
354 ;; coding: iso-latin-2 | 355 ;; coding: iso-latin-2 |
355 ;; End: | 356 ;; End: |
356 | 357 |
358 ;;; arch-tag: fc9b05a6-7355-4639-8170-dcf57853ba22 | |
357 ;;; tildify.el ends here | 359 ;;; tildify.el ends here |