From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: Re: [PATCH] Add feature to org-drill to auto pronounce word Date: Sun, 27 Jan 2019 10:50:13 +0800 Message-ID: <87womqhl0a.fsf@gmail.com> References: <87r2dmmd8g.fsf@gmail.com> <87a7jqdtep.fsf@gmail.com> <87k1iry7e6.fsf@nicolasgoaziou.fr> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:57274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gnaZt-00056s-Nt for emacs-orgmode@gnu.org; Sat, 26 Jan 2019 21:53:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gnaZs-0002rT-L0 for emacs-orgmode@gnu.org; Sat, 26 Jan 2019 21:53:45 -0500 Received: from [122.236.17.38] (port=51886 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gnaZr-0002qY-Tg for emacs-orgmode@gnu.org; Sat, 26 Jan 2019 21:53:44 -0500 In-reply-to: <87k1iry7e6.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: Paul Sexton , org-mode Nicolas Goaziou writes: > Hello, > > stardiviner writes: > >> A gentle ping.. > > I'm not sure "org-drill.el" is still actively maintained. I'm Cc'ing > Paul Sexton. In the long run, I think this package could be packaged > through ELPA instead. It is indeed not actively maintained. But still has some user are using it. I found some recently used in Org Mode ML mentioned it. I will ping the author Paul Sexton, I would like to particited in maintain it. If he agree to publish it to MELPA, I could help. > >>> * etc/ORG-NEWS: mentioned this new feature. > > Changes to "contrib/" directory are usually not mentioned in this > file. Removed now. > >>> +(defun org-drill-pronounce-word () >>> + "Pronounce word after querying." >>> + (if org-drill-auto-pronounce >>> + (shell-command-to-string >>> + (format "%s %s %s &" >>> + org-drill-pronounce-command org-drill-pronounce-command-args > > What are `org-drill-pronounce-command' and > `org-drill-pronounce-command-args'? I don't see them defined anywhere. > I missed that. Now added. > Also, please prefer `when' to one-armed `if'. Modified. > >>> + (shell-quote-argument >>> + (substring-no-properties >>> + (org-get-heading 'no-tags 'no-todo 'no-priority 'no-comment))))))) >>> + >>> +(add-hook 'org-drill-entry-after-hook #'org-drill-pronounce-word) > > Could it be more integrated? Using hook is usually for users. If you can > modify the code, you probably can do better. Modified now. Those two hooks I think is necessary for user to add custom actions. So keep them. > > Regards, Regards :) -- [ stardiviner ] I try to make every word tell the meaning what I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3