* Sort Phrases
@ 2012-10-22 11:27 Sanjib Sikder
2012-10-22 11:40 ` Giovanni Ridolfi
2012-10-22 13:26 ` Nick Dokos
0 siblings, 2 replies; 5+ messages in thread
From: Sanjib Sikder @ 2012-10-22 11:27 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 425 bytes --]
Hi,
I know it is possible to sort words and sort lines alphabetically in emacs
org-mode but is it possible to sort phrases ?
For example,
Face the music, Fifteen minutes of fame, A beautiful mind.
I want to sort it alphabetically like,
A beautiful mind, Face the music, Fifteen minutes of fame.
Is it possible ?
Thanks.
-----------------------------
*Sanjib Sikder
*Ph.D. Fellow
Chemical Engineering
IIT Bombay*
*
[-- Attachment #2: Type: text/html, Size: 733 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Sort Phrases
2012-10-22 11:27 Sort Phrases Sanjib Sikder
@ 2012-10-22 11:40 ` Giovanni Ridolfi
2012-10-22 18:14 ` Sanjib Sikder
2012-10-22 13:26 ` Nick Dokos
1 sibling, 1 reply; 5+ messages in thread
From: Giovanni Ridolfi @ 2012-10-22 11:40 UTC (permalink / raw)
To: Sanjib Sikder, emacs-orgmode@gnu.org
Da: Sanjib Sikder <sanjibju2002@gmail.com>
Inviato: Lunedì 22 Ottobre 2012 13:27
> I know it is possible to sort words and sort lines alphabetically in emacs org-mode
Would you please be so kind to explain to me how?
I have only:
org-sort-entries M-x ... RET Sort entries on a certain level of an outline tree.
org-sort-list M-x ... RET Sort list items.
org-table-sort-lines <Sort lines in region> in a table.
Is it possible to sort words like:
banana fruit chees apple
or lines like
banana
fruit
chees
apple
> but is it possible to sort phrases ?
> Face the music, Fifteen minutes of fame, A beautiful mind.
> I want to sort it alphabetically like,
> A beautiful mind, Face the music, Fifteen minutes of fame.
In Emacs everything is possible.
- substitute "," with \n
- sort region
- substitute \n with ","
Cheers,
Giovanni
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Sort Phrases
2012-10-22 11:27 Sort Phrases Sanjib Sikder
2012-10-22 11:40 ` Giovanni Ridolfi
@ 2012-10-22 13:26 ` Nick Dokos
1 sibling, 0 replies; 5+ messages in thread
From: Nick Dokos @ 2012-10-22 13:26 UTC (permalink / raw)
To: Sanjib Sikder; +Cc: emacs-orgmode
Sanjib Sikder <sanjibju2002@gmail.com> wrote:
> Hi,
>
> I know it is possible to sort words and sort lines alphabetically in emacs org-mode but is it
> possible to sort phrases ?
>
> For example,
>
> Face the music, Fifteen minutes of fame, A beautiful mind.
>
> I want to sort it alphabetically like,
>
> A beautiful mind, Face the music, Fifteen minutes of fame.
>
> Is it possible ?
>
Not with native org-mode facilities, I think. It is possible of
course, but you would need to write your own elisp to do it.
Nick
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Sort Phrases
2012-10-22 11:40 ` Giovanni Ridolfi
@ 2012-10-22 18:14 ` Sanjib Sikder
2012-10-22 18:18 ` Sanjib Sikder
0 siblings, 1 reply; 5+ messages in thread
From: Sanjib Sikder @ 2012-10-22 18:14 UTC (permalink / raw)
To: Giovanni Ridolfi; +Cc: emacs-orgmode@gnu.org
[-- Attachment #1: Type: text/plain, Size: 2038 bytes --]
Hi Giovanni,
You need to put the following lines into your .emacs to sort WORDS and
LINES.
--8<---------------cut here---------------start------------->8---
;;;Sort words
(defun sort-words (reverse beg end)
"Sort words in region alphabetically, in REVERSE if negative.
Prefixed with negative \\[universal-argument], sorts in reverse.
The variable `sort-fold-case' determines whether alphabetic case
affects the sort order.
See `sort-regexp-fields'."
(interactive "*P\nr")
(sort-regexp-fields reverse "\\w+" "\\&" beg end))
--8<---------------cut here---------------start------------->8---
Then to sort words like
apple, mango, oranges, cat, elephant
You need to do
M-x sort-words
To sort lines, similarly do
M-x sort-lines
-----------------------------
*Sanjib Sikder
*Ph.D. Fellow
Chemical Engineering
IIT Bombay*
*
On Mon, Oct 22, 2012 at 5:10 PM, Giovanni Ridolfi <giovanni.ridolfi@yahoo.it
> wrote:
> Da: Sanjib Sikder <sanjibju2002@gmail.com>
>
> Inviato: Lunedì 22 Ottobre 2012 13:27
>
>
> > I know it is possible to sort words and sort lines alphabetically in
> emacs org-mode
>
> Would you please be so kind to explain to me how?
>
> I have only:
> org-sort-entries M-x ... RET Sort entries on a certain level
> of an outline tree.
> org-sort-list M-x ... RET Sort list items.
> org-table-sort-lines <Sort lines in region> in a
> table.
>
>
> Is it possible to sort words like:
>
> banana fruit chees apple
>
> or lines like
>
>
> banana
>
> fruit
> chees
>
> apple
>
>
>
> > but is it possible to sort phrases ?
>
> > Face the music, Fifteen minutes of fame, A beautiful mind.
> > I want to sort it alphabetically like,
> > A beautiful mind, Face the music, Fifteen minutes of fame.
>
> In Emacs everything is possible.
>
> - substitute "," with \n
> - sort region
> - substitute \n with ","
>
> Cheers,
>
> Giovanni
>
>
[-- Attachment #2: Type: text/html, Size: 2893 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Sort Phrases
2012-10-22 18:14 ` Sanjib Sikder
@ 2012-10-22 18:18 ` Sanjib Sikder
0 siblings, 0 replies; 5+ messages in thread
From: Sanjib Sikder @ 2012-10-22 18:18 UTC (permalink / raw)
To: Giovanni Ridolfi; +Cc: emacs-orgmode@gnu.org
[-- Attachment #1: Type: text/plain, Size: 2679 bytes --]
Hi Giovanni,
- substitute "," with \n
> - sort region
> - substitute \n with ","
>
1. I am new in org-mode and emacs. Can you please tell me what is "sort
region" and what are the key bindings ?
2. Is there a way by which I can replace all the ',' with '\n' and do the
reverse automatically ?
Thanks.
-----------------------------
*Sanjib Sikder
*Ph.D. Fellow
Chemical Engineering
IIT Bombay*
*
On Mon, Oct 22, 2012 at 11:44 PM, Sanjib Sikder <sanjibju2002@gmail.com>wrote:
> Hi Giovanni,
>
> You need to put the following lines into your .emacs to sort WORDS and
> LINES.
>
> --8<---------------cut here---------------start------------->8---
>
> ;;;Sort words
> (defun sort-words (reverse beg end)
> "Sort words in region alphabetically, in REVERSE if negative.
> Prefixed with negative \\[universal-argument], sorts in reverse.
> The variable `sort-fold-case' determines whether alphabetic case
> affects the sort order.
> See `sort-regexp-fields'."
> (interactive "*P\nr")
> (sort-regexp-fields reverse "\\w+" "\\&" beg end))
>
> --8<---------------cut here---------------start------------->8---
>
> Then to sort words like
>
> apple, mango, oranges, cat, elephant
>
> You need to do
>
> M-x sort-words
>
> To sort lines, similarly do
>
> M-x sort-lines
>
>
>
> -----------------------------
> *Sanjib Sikder
> *Ph.D. Fellow
> Chemical Engineering
> IIT Bombay*
>
> *
>
>
>
> On Mon, Oct 22, 2012 at 5:10 PM, Giovanni Ridolfi <
> giovanni.ridolfi@yahoo.it> wrote:
>
>> Da: Sanjib Sikder <sanjibju2002@gmail.com>
>>
>> Inviato: Lunedì 22 Ottobre 2012 13:27
>>
>>
>> > I know it is possible to sort words and sort lines alphabetically in
>> emacs org-mode
>>
>> Would you please be so kind to explain to me how?
>>
>> I have only:
>> org-sort-entries M-x ... RET Sort entries on a certain level
>> of an outline tree.
>> org-sort-list M-x ... RET Sort list items.
>> org-table-sort-lines <Sort lines in region> in
>> a table.
>>
>>
>> Is it possible to sort words like:
>>
>> banana fruit chees apple
>>
>> or lines like
>>
>>
>> banana
>>
>> fruit
>> chees
>>
>> apple
>>
>>
>>
>> > but is it possible to sort phrases ?
>>
>> > Face the music, Fifteen minutes of fame, A beautiful mind.
>> > I want to sort it alphabetically like,
>> > A beautiful mind, Face the music, Fifteen minutes of fame.
>>
>> In Emacs everything is possible.
>>
>> - substitute "," with \n
>> - sort region
>> - substitute \n with ","
>>
>> Cheers,
>>
>> Giovanni
>>
>>
>
[-- Attachment #2: Type: text/html, Size: 4128 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-10-22 18:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-22 11:27 Sort Phrases Sanjib Sikder
2012-10-22 11:40 ` Giovanni Ridolfi
2012-10-22 18:14 ` Sanjib Sikder
2012-10-22 18:18 ` Sanjib Sikder
2012-10-22 13:26 ` Nick Dokos
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).