emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/composite.el [emacs-unicode-2]


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/lisp/composite.el [emacs-unicode-2]
Date: Fri, 26 Sep 2003 07:24:11 -0400

Index: emacs/lisp/composite.el
diff -c emacs/lisp/composite.el:1.13.6.2 emacs/lisp/composite.el:1.13.6.3
*** emacs/lisp/composite.el:1.13.6.2    Thu Sep 11 05:24:56 2003
--- emacs/lisp/composite.el     Fri Sep 26 07:24:10 2003
***************
*** 456,461 ****
--- 456,487 ----
        (save-restriction
        (widen)
        (put-text-property (point-min) (point-max) 'auto-composed nil)))))
+ 
+ (defun auto-compose-region (from to)
+   "Force automatic character composition on the region FROM and TO."
+   (save-excursion
+     (if (get-text-property from 'auto-composed)
+       (setq from (next-single-property-change from 'auto-composed nil to)))
+     (goto-char from)
+     (let ((modified-p (buffer-modified-p))
+         (inhibit-read-only '(composition auto-composed))
+         (stop (next-single-property-change (point) 'auto-composed nil to)))
+       (while (< (point) to)
+       (if (= (point) stop)
+           (progn
+             (goto-char (next-single-property-change (point)
+                                                     'auto-composed nil to))
+             (setq stop (next-single-property-change (point)
+                                                     'auto-composed nil to)))
+         (let ((func (aref composition-function-table (following-char)))
+               (pos (point)))
+           (if (functionp func)
+               (goto-char (funcall func (point) nil)))
+           (if (<= (point) pos)
+               (forward-char 1)))))
+       (put-text-property from to 'auto-composed t)
+       (set-buffer-modified-p modified-p))))
+ 
  
  ;;; The following codes are only for backward compatibility with Emacs
  ;;; 20.4 and earlier.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]