all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* problems with alphabetic ordering in tables containing non ASCII chars
@ 2016-07-05 20:26 Uwe Brauer
  2016-07-05 20:49 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Brauer @ 2016-07-05 20:26 UTC (permalink / raw)
  To: emacs-orgmode



Hello

Consider please the following example:

| Anton   |
| Álvarez |
| Arrieta |


  org-table-sort-lines using alphabetic ordering results in


| Anton   |
| Arrieta |
| Álvarez |

Which is contra intuitive to say the least. The accented A should be
treated as if it did not have an accent resulting in

| Álvarez |
| Anton   |
| Arrieta |

That is the way excel (which I try to avoid usually but which is doing
the right thing), works, libreoffice ooffice is also on the wired side
here.     

regards

Uwe Brauer

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: problems with alphabetic ordering in tables containing non ASCII chars
  2016-07-05 20:26 problems with alphabetic ordering in tables containing non ASCII chars Uwe Brauer
@ 2016-07-05 20:49 ` Nicolas Goaziou
  2016-07-05 20:54   ` Uwe Brauer
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2016-07-05 20:49 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Uwe Brauer <oub@mat.ucm.es> writes:

> Consider please the following example:
>
> | Anton   |
> | Álvarez |
> | Arrieta |
>
>
>   org-table-sort-lines using alphabetic ordering results in
>
>
> | Anton   |
> | Arrieta |
> | Álvarez |
>
> Which is contra intuitive to say the least. The accented A should be
> treated as if it did not have an accent resulting in
>
> | Álvarez |
> | Anton   |
> | Arrieta |

Alphabetic ordering uses `string-lessp', which doesn't fulfill your
needs here. You can however, sort by an arbitrary function using f or
F key.

In any case, char folding is a complicated matter, because it really
depends on the host language. I think development Emacs provides
something like this.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: problems with alphabetic ordering in tables containing non ASCII chars
  2016-07-05 20:49 ` Nicolas Goaziou
@ 2016-07-05 20:54   ` Uwe Brauer
  2016-07-05 21:48     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Brauer @ 2016-07-05 20:54 UTC (permalink / raw)
  To: emacs-orgmode


    > Hello,
    > Uwe Brauer <oub@mat.ucm.es> writes:

Thanks for the fast answer

    > Alphabetic ordering uses `string-lessp', which doesn't fulfill your
    > needs here. You can however, sort by an arbitrary function using f or
    > F key.

Which function could you recommend?

    > In any case, char folding is a complicated matter, because it really
    > depends on the host language. I think development Emacs provides
    > something like this.

I am using GNU emacs 25.1.50 so that requirement is fulfilled. Do you
have any pointers?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: problems with alphabetic ordering in tables containing non ASCII chars
  2016-07-05 20:54   ` Uwe Brauer
@ 2016-07-05 21:48     ` Nicolas Goaziou
  2016-07-12  8:53       ` a possible solution (was: problems with alphabetic ordering in tables containing non ASCII chars) Uwe Brauer
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2016-07-05 21:48 UTC (permalink / raw)
  To: emacs-orgmode

Uwe Brauer <oub@mat.ucm.es> writes:

> Which function could you recommend?

I don't know. There may be something readily available in Emacs 25.
Otherwise, you'll have to write you own.

> I am using GNU emacs 25.1.50 so that requirement is fulfilled. Do you
> have any pointers?

Probably look for "char-fold.el".

Regards.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* a possible solution (was: problems with alphabetic ordering in tables containing non ASCII chars)
  2016-07-05 21:48     ` Nicolas Goaziou
@ 2016-07-12  8:53       ` Uwe Brauer
  0 siblings, 0 replies; 5+ messages in thread
From: Uwe Brauer @ 2016-07-12  8:53 UTC (permalink / raw)
  To: emacs-orgmode

>>> "Nicolas" == Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

   > Uwe Brauer <oub@mat.ucm.es> writes:
   >> Which function could you recommend?

   > I don't know. There may be something readily available in Emacs 25.
   > Otherwise, you'll have to write you own.

It seems that the easiest solution is the following

    -  run iso-unaccentuate (which runs on regions) on the table, which
       will change Álvarez to 'Alvarez,
       

    -  sort. The sorting is ok

    -  reconvert via iso-accentuate the table.


I don't understand much of the org-table sort code. My naive approach would be to
define

org-table-iso-accentuate and org-table-iso-unaccentuate and then add
that via defadvice to the original function, but that seems a bad
approach since defacvice makes it difficult to debug.

Any suggestions?

Thanks

Uwe Brauer 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-07-12  8:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-05 20:26 problems with alphabetic ordering in tables containing non ASCII chars Uwe Brauer
2016-07-05 20:49 ` Nicolas Goaziou
2016-07-05 20:54   ` Uwe Brauer
2016-07-05 21:48     ` Nicolas Goaziou
2016-07-12  8:53       ` a possible solution (was: problems with alphabetic ordering in tables containing non ASCII chars) Uwe Brauer

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.