emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-drill: remove duplicates
@ 2014-06-09 11:28 Dennis Yurichev
  2014-06-09 13:17 ` Alexander Baier
  0 siblings, 1 reply; 2+ messages in thread
From: Dennis Yurichev @ 2014-06-09 11:28 UTC (permalink / raw)
  To: emacs-orgmode

Hi.

I just started using org-drill, which is seems pretty good.
One thing I noticed at first: are there a way to remove duplicates which 
will inevitably be added into the file?

And/or: it's possible to sort all entries in org-file by, let's say, "** English" heading?

I've something like...

======================================
* Word
** English
english word 2
** Russian
russian word 2

* Word
** English
english word 1
** Russian
russian word 1
======================================

It's possible to sort file so that's entry with "english word 1" 
will be at top?

-- 
-- http://yurichev.com

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

* Re: org-drill: remove duplicates
  2014-06-09 11:28 org-drill: remove duplicates Dennis Yurichev
@ 2014-06-09 13:17 ` Alexander Baier
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Baier @ 2014-06-09 13:17 UTC (permalink / raw)
  To: Dennis Yurichev; +Cc: emacs-orgmode

On 2014-06-09 13:28 Dennis Yurichev wrote:
> Hi.
>
> I just started using org-drill, which is seems pretty good.
> One thing I noticed at first: are there a way to remove duplicates which 
> will inevitably be added into the file?
>
> And/or: it's possible to sort all entries in org-file by, let's say,
> "** English" heading?
>
> I've something like...
>
> ======================================
> * Word
> ** English
> english word 2
> ** Russian
> russian word 2
>
> * Word
> ** English
> english word 1
> ** Russian
> russian word 1
> ======================================
>
> It's possible to sort file so that's entry with "english word 1" 
> will be at top?

I do not know of any build-in sorting strategy that does what you want.
But you can always write your own function and pass it along with
`C-c ^ f'.  Such a function takes no arguments and returns the sorting
key.  I put together a small function, but it does not work correctly
yet.  Maybe someone can point out why.  Or maybe this will help you as a
point to start and investigate further.

This function is called with point at the beginning of the top level
headline.  Note: I called `C-c ^ f' with an active region over the whole
file.
#+BEGIN_SRC emacs-lisp
  (defun my-sort ()
    (forward-line 2)
    (message "%s" (thing-at-point 'line))
    (thing-at-point 'line))
#+END_SRC

Using this function with org-sort results in some weird behaviour where
only the "English" but not the "Russian" headlines are sorted.


I hope this helps a bit,
-- 
Alexander Baier

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

end of thread, other threads:[~2014-06-09 13:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-09 11:28 org-drill: remove duplicates Dennis Yurichev
2014-06-09 13:17 ` Alexander Baier

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).