GNU bug report logs - #13041
24.2; diacritic-fold-search

Previous Next

Package: emacs;

Reported by: perin <at> acm.org

Date: Fri, 30 Nov 2012 18:31:02 UTC

Severity: wishlist

Found in version 24.2

Fixed in version 25.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> jurta.org>
Cc: perin <at> acm.org, Eli Zaretskii <eliz <at> gnu.org>, perin <at> panix.com, 13041 <at> debbugs.gnu.org
Subject: bug#13041: 24.2; diacritic-fold-search
Date: Sun, 02 Dec 2012 18:45:38 +0100
> But nevertheless the `decomposition' property should be used to find
> all decomposable characters.  The question is how to use them in the search.

Whatever solution you find most suitable here, it would be nice to come
up with a similar solution for sorting.  I've been playing around with a
function like

(defun decomposed-string-lessp (string1 string2)
  "Return t if STRING1 is decomposition-less than STRING2."
  (let* ((length1 (length string1))
	 (length2 (length string2))
	 (min-length (min length1 length2))
	 (index 0)
	 type1 type2)
    (catch 'found
      (while (< index min-length)
	(setq type1 (car (get-char-code-property
			  (elt string1 index) 'decomposition)))
	(setq type2 (car (get-char-code-property
			  (elt string2 index) 'decomposition)))
	(cond
	 ((< type1 type2)
	  (throw 'found t))
	 ((> type1 type2)
	  (throw 'found nil)))
	;; Continue.
	(setq index (1+ index)))
      ;; Shorter is less.
      (< length1 length2))))

but am not sure whether I'm missing something wrt the return value of
`get-char-code-property'.

martin




This bug report was last modified 8 years and 342 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.