all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: David Gonzalez Gandara <dggandara@member.fsf.org>
Cc: emacs-devel@gnu.org
Subject: Re: [elpa] master 9a3a508: Package transcribe added
Date: Sun, 29 Nov 2015 17:41:10 -0500	[thread overview]
Message-ID: <jwvvb8kphfh.fsf-monnier+friends@gnu.org> (raw)
In-Reply-To: <E1a31Fj-0001PD-Bq@vcs.savannah.gnu.org> (David Gonzalez Gandara's message of "Sun, 29 Nov 2015 12:38:51 +0000")

Thanks

> +;;;transcribe.el --- package for audio transcriptions
     ^^
The convention for ";;;" is to have a space between ";;;" and the rest.
If the package is only meant to be supported for Emacs>=24, I recommend
you add "-*- lexical-binding:t -*-".

> +;;Copyright 2014 David González Gándara

Oh and for ";;" as well.

> +(require 'emms-setup)

So your package only works with emms, in which case the pseudo-headers
should include

   ;; Package-Requires: ((emms "<version>")) 

or something like that.

> +;(require 'emms-player-mpd)
> +;(setq emms-player-mpd-server-name "localhost")
> +;(setq emms-player-mpd-server-port "6600")
> +
> +(emms-standard)
> +(emms-default-players)
> +(require 'emms-player-mpg321-remote)
> +(push 'emms-player-mpg321-remote emms-player-list)
> +
> +(require 'emms-mode-line)
> +(emms-mode-line 1)
> +(require 'emms-playing-time)
> +(emms-playing-time 1)
> +
> +(global-set-key (kbd "C-x C-p") 'emms-play-file)
> +
> +(global-set-key (kbd "<f5>") 'emms-pause)
> +
> +(global-set-key (kbd "C-x <down>") 'emms-stop)
> +
> +(global-set-key (kbd "C-x <right>") 'emms-seek-forward)
> +
> +(global-set-key (kbd "C-x <left>") 'emms-seek-backward)
> +
> +(global-set-key (kbd "<f8>") 'emms-seek)

I think those settings should be moved to a function: loading
transcribe.el should not make such global changes.  Instead they should
be made via a function.  Activating a mode/feature should never be made
with "require" or "load" but by calling a function (or setting a custom
var) which internally will load the file, if needed.

> +(defun analyze-episode (episode person)
> +  (interactive "sepisode: \nsperson:")

All definitions should use a package prefix, e.g. "transcribe-", so as
to avoid conflicts with other packages.

> +  (shell-command (concat (expand-file-name  "analyze_episodes2.py") " -e " episode " -p " person " -i " buffer-file-name )))

If your file is called "hello; rm -rf ~/." the above command will not do
what you wanted.  You can fix that by quoting the various parts with
shell-quote-argument, but I recommend you just use `call-process'
instead of `shell-command', since you don't make use of any
functionality of the shell, so the use of shell here only introduces
overheads and bugs.


        Stefan



       reply	other threads:[~2015-11-29 22:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20151129123851.5369.35231@vcs.savannah.gnu.org>
     [not found] ` <E1a31Fj-0001PD-Bq@vcs.savannah.gnu.org>
2015-11-29 22:41   ` Stefan Monnier [this message]
2015-11-29 23:37     ` [elpa] master 9a3a508: Package transcribe added Artur Malabarba
     [not found]   ` <E1a31Fj-0001PD-Bq-7jckXlaVFY8RVz71yTsr42D2FQJk+8+b@public.gmane.org>
2015-11-29 23:35     ` Artur Malabarba
2015-11-30  0:19       ` announcing GNU ELPA updates [was: [elpa] master 9a3a508: Package transcribe added] Drew Adams
2015-11-30 10:57         ` Rolf Ade
     [not found]       ` <CAAdUY-LCYa3f4Qd6uKpmgG6hDJi2RjJhcOR2+ZZEboHuG_8qQQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-30 10:19         ` [elpa] master 9a3a508: Package transcribe added Artur Malabarba
2015-11-30 17:11           ` David González Gándara
2015-11-30 17:59 David González Gándara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvvb8kphfh.fsf-monnier+friends@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=dggandara@member.fsf.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.