aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichal Nazarewicz2014-05-27 21:00:44 -0400
committerStefan Monnier2014-05-27 21:00:44 -0400
commitfc21a7de3a92a38c5b00ce64a81c8668d0482fbb (patch)
tree5791ec3019cdb37ff4798f9ec4f93a79a815038d /lisp
parent4c539a7b387874577136190d8e1a413da1d7e240 (diff)
downloademacs-fc21a7de3a92a38c5b00ce64a81c8668d0482fbb.tar.gz
emacs-fc21a7de3a92a38c5b00ce64a81c8668d0482fbb.zip
* test/automated/tildify-tests.el: New file.
* lisp/textmodes/tildify.el (tildify-buffer, tildify-region): Add dont-ask option. Fixes: debbugs:17547
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/textmodes/tildify.el22
2 files changed, 18 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 22e88a453ce..01f68d8c338 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12014-05-21 Michal Nazarewicz <mina86@mina86.com>
2
3 * textmodes/tildify.el (tildify-buffer, tildify-region):
4 Add dont-ask option.
5
12014-05-28 Stefan Monnier <monnier@iro.umontreal.ca> 62014-05-28 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * subr.el (zerop): Move from C. Add compiler-macro (bug#17475). 8 * subr.el (zerop): Move from C. Add compiler-macro (bug#17475).
diff --git a/lisp/textmodes/tildify.el b/lisp/textmodes/tildify.el
index 9732e7fa649..339f9006cf2 100644
--- a/lisp/textmodes/tildify.el
+++ b/lisp/textmodes/tildify.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 1997-2014 Free Software Foundation, Inc. 3;; Copyright (C) 1997-2014 Free Software Foundation, Inc.
4 4
5;; Author: Milan Zamazal <pdm@zamazal.org> 5;; Author: Milan Zamazal <pdm@zamazal.org>
6;; Version: 4.5 6;; Version: 4.5.1
7;; Keywords: text, TeX, SGML, wp 7;; Keywords: text, TeX, SGML, wp
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
@@ -172,20 +172,22 @@ END-REGEX defines end of the corresponding text part and can be either:
172;;; *** Interactive functions *** 172;;; *** Interactive functions ***
173 173
174;;;###autoload 174;;;###autoload
175(defun tildify-region (beg end) 175(defun tildify-region (beg end &optional dont-ask)
176 "Add hard spaces in the region between BEG and END. 176 "Add hard spaces in the region between BEG and END.
177See variables `tildify-pattern-alist', `tildify-string-alist', and 177See variables `tildify-pattern-alist', `tildify-string-alist', and
178`tildify-ignored-environments-alist' for information about configuration 178`tildify-ignored-environments-alist' for information about configuration
179parameters. 179parameters.
180This function performs no refilling of the changed text." 180This function performs no refilling of the changed text.
181 (interactive "*r") 181If DONT-ASK is set, or called interactively with prefix argument, user
182won't be prompted for confirmation of each substitution."
183 (interactive "*rP")
182 (setq tildify-count 0) 184 (setq tildify-count 0)
183 (let (a 185 (let (a
184 z 186 z
185 (marker-end (copy-marker end)) 187 (marker-end (copy-marker end))
186 end-env 188 end-env
187 finish 189 finish
188 (ask t) 190 (ask (not dont-ask))
189 (case-fold-search nil) 191 (case-fold-search nil)
190 (regexp (tildify-build-regexp)) ; beginnings of environments 192 (regexp (tildify-build-regexp)) ; beginnings of environments
191 aux) 193 aux)
@@ -226,14 +228,16 @@ This function performs no refilling of the changed text."
226 (message "%d spaces replaced." tildify-count)) 228 (message "%d spaces replaced." tildify-count))
227 229
228;;;###autoload 230;;;###autoload
229(defun tildify-buffer () 231(defun tildify-buffer (&optional dont-ask)
230 "Add hard spaces in the current buffer. 232 "Add hard spaces in the current buffer.
231See variables `tildify-pattern-alist', `tildify-string-alist', and 233See variables `tildify-pattern-alist', `tildify-string-alist', and
232`tildify-ignored-environments-alist' for information about configuration 234`tildify-ignored-environments-alist' for information about configuration
233parameters. 235parameters.
234This function performs no refilling of the changed text." 236This function performs no refilling of the changed text.
235 (interactive "*") 237If DONT-ASK is set, or called interactively with prefix argument, user
236 (tildify-region (point-min) (point-max))) 238won't be prompted for confirmation of each substitution."
239 (interactive "*P")
240 (tildify-region (point-min) (point-max) dont-ask))
237 241
238 242
239;;; *** Auxiliary functions *** 243;;; *** Auxiliary functions ***