Mercurial > emacs
comparison lisp/composite.el @ 81073:12cb550b10e4
(compose-region, decompose-region):
Use inhibit-read-only and restore-buffer-modified-p.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Fri, 25 May 2007 16:14:21 +0000 |
parents | e3694f1cb928 |
children | b98604865ea0 03ec96a627ba |
comparison
equal
deleted
inserted
replaced
81072:ecb305fe2f17 | 81073:12cb550b10e4 |
---|---|
192 Optional 4th argument MODIFICATION-FUNC is a function to call to | 192 Optional 4th argument MODIFICATION-FUNC is a function to call to |
193 adjust the composition when it gets invalid because of a change of | 193 adjust the composition when it gets invalid because of a change of |
194 text in the composition." | 194 text in the composition." |
195 (interactive "r") | 195 (interactive "r") |
196 (let ((modified-p (buffer-modified-p)) | 196 (let ((modified-p (buffer-modified-p)) |
197 (buffer-read-only nil)) | 197 (inhibit-read-only t)) |
198 (if (or (vectorp components) (listp components)) | 198 (if (or (vectorp components) (listp components)) |
199 (setq components (encode-composition-components components))) | 199 (setq components (encode-composition-components components))) |
200 (compose-region-internal start end components modification-func) | 200 (compose-region-internal start end components modification-func) |
201 (restore-buffer-modified-p modified-p))) | 201 (restore-buffer-modified-p modified-p))) |
202 | 202 |
206 | 206 |
207 When called from a program, expects two arguments, | 207 When called from a program, expects two arguments, |
208 positions (integers or markers) specifying the region." | 208 positions (integers or markers) specifying the region." |
209 (interactive "r") | 209 (interactive "r") |
210 (let ((modified-p (buffer-modified-p)) | 210 (let ((modified-p (buffer-modified-p)) |
211 (buffer-read-only nil)) | 211 (inhibit-read-only t)) |
212 (remove-text-properties start end '(composition nil)) | 212 (remove-text-properties start end '(composition nil)) |
213 (set-buffer-modified-p modified-p))) | 213 (restore-buffer-modified-p modified-p))) |
214 | 214 |
215 ;;;###autoload | 215 ;;;###autoload |
216 (defun compose-string (string &optional start end components modification-func) | 216 (defun compose-string (string &optional start end components modification-func) |
217 "Compose characters in string STRING. | 217 "Compose characters in string STRING. |
218 | 218 |
370 (compose-chars-after (- (point) chars) (point)))))) | 370 (compose-chars-after (- (point) chars) (point)))))) |
371 | 371 |
372 ;;;###autoload(global-set-key [compose-last-chars] 'compose-last-chars) | 372 ;;;###autoload(global-set-key [compose-last-chars] 'compose-last-chars) |
373 | 373 |
374 | 374 |
375 ;;; The following codes are only for backward compatibility with Emacs | 375 ;; The following codes are only for backward compatibility with Emacs |
376 ;;; 20.4 and earlier. | 376 ;; 20.4 and earlier. |
377 | 377 |
378 ;;;###autoload | 378 ;;;###autoload |
379 (defun decompose-composite-char (char &optional type with-composition-rule) | 379 (defun decompose-composite-char (char &optional type with-composition-rule) |
380 "Convert CHAR to string. | 380 "Convert CHAR to string. |
381 | 381 |
390 ;;;###autoload | 390 ;;;###autoload |
391 (make-obsolete 'decompose-composite-char 'char-to-string "21.1") | 391 (make-obsolete 'decompose-composite-char 'char-to-string "21.1") |
392 | 392 |
393 | 393 |
394 | 394 |
395 ;;; arch-tag: ee703d77-1723-45d4-a31f-e9f0f867aa33 | 395 ;; arch-tag: ee703d77-1723-45d4-a31f-e9f0f867aa33 |
396 ;;; composite.el ends here | 396 ;;; composite.el ends here |