[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transcribe e0032f9 06/27: Added minor-mode function as
From: |
Stefan Monnier |
Subject: |
[elpa] externals/transcribe e0032f9 06/27: Added minor-mode function as suggested |
Date: |
Tue, 1 Dec 2020 17:33:46 -0500 (EST) |
branch: externals/transcribe
commit e0032f99c25eae27b703b10b0c05061adb67d457
Author: David Gonzalez Gandara <dggandara@member.fsf.org>
Commit: David Gonzalez Gandara <dggandara@member.fsf.org>
Added minor-mode function as suggested
---
transcribe.el | 108 ++++++++++++++++++++++++++++++----------------------------
1 file changed, 55 insertions(+), 53 deletions(-)
diff --git a/transcribe.el b/transcribe.el
index 4ab00a3..2cf0494 100644
--- a/transcribe.el
+++ b/transcribe.el
@@ -3,7 +3,7 @@
;; Copyright 2014-2015 Free Software Foundation, Inc.
;; Author: David Gonzalez Gandara <dggandara@member.fsf.org>
-;; Version: 0.0.1
+;; version: 0.5.0
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -20,23 +20,16 @@
;;; Commentary:
-;; INSTALLATION
-;;-------------------
-;; If you don't use transcribe as a package, you can install manually:
-;; Copy this file to somewhere in your drive
-
-;; To load the file --> M-: (load "~/transcribe.el") --- change the route to
where you copied the file
-
-;; DEPENDENCIES:
-;;-----------------------------
+;; REQUIRES:
+;; -----------------------------
;; In order to use the most important functions of transcribe, you need to
install emms and mpg321.
;;
-;; DESCRIPTION
-;;-------------------------
+;; USAGE:
+;; -------------------------
;; Transcribe is a tool to make audio transcriptions easy. It allows the
transcriber to control the audio easily while typing, as well as automate the
insertion of xml tags, in case the transcription protocol include them.
;;
;; AUDIO COMMANDS
-;;------------------------------
+;; ------------------------------
;; C-x C-p --------> Play audio file. You will be prompted for the name of
the file. The recommended format is mp2.
;; <f5> -----------> Pause or play audio.
;; C-x <right> ----> seek audio 10 seconds forward.
@@ -44,14 +37,14 @@
;; <f8> -----------> seek interactively: positive seconds go forward and
negative seconds go backward
;;
;; XML TAGGING COMMANDS
-;;--------------------------------------------------
+;; --------------------------------------------------
;; C-x C-n --> Create new episode structure. This is useful in case your
xml file structure requires it. You can customize the text inserted
manipulating the realted function.
;; <f6> -----> Interactively insert new tag. You will be prompted for the
content of the tag. The starting tag and the end tag will be inserted
automatically and the cursor placed in the proper place to type.
;;
;;
;;
;; SPECIFIC COMMANDS I USE, THAT YOU MAY FIND USEFUL
-;;------------------------------------------------
+;; ------------------------------------------------
;; C-x C-a ------> This runs an external discourse analysis tool. It
defaults to my own script analyze_episodes2.py, but you can customise the
command to launch any other.
;; <f11> --------> Customised tag 1. Edit the function to adapt to your
needs.
;; <f12> --------> Customised tag 2. Edit the function to adapt to your
needs.
@@ -60,7 +53,7 @@
;;; Code:
-(if t (require 'emms-setup)) ;Only require it at run-time.
+(if t (require 'emms-setup))
;(require 'emms-player-mpd)
;(setq emms-player-mpd-server-name "localhost")
;(setq emms-player-mpd-server-port "6600")
@@ -76,71 +69,80 @@
(if t (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)
-
-(defun analyze-episode (episode person)
+(defun transcribe-analyze-episode (episode person)
(interactive "sepisode: \nsperson:")
(shell-command (concat (expand-file-name "analyze_episodes2.py") " -e "
episode " -p " person " -i " buffer-file-name )))
-(global-unset-key (kbd "C-x C-A"))
-(global-set-key (kbd "C-x C-A") 'analyze-episode)
-
-(defun draw-boxplot ()
- (interactive)
- (shell-command (concat (expand-file-name "/usr/bin/Rscript ")
"boxplot_students.R " buffer-file-name)))
-
-(global-unset-key (kbd "C-x C-B"))
-(global-set-key (kbd "C-x C-B") 'draw-boxplot)
-
-(defun define-xml-tag (xmltag)
+(defun transcribe-define-xml-tag (xmltag)
(interactive "stag:")
(insert (format "<%s></%s>" xmltag xmltag))
(backward-char 3)
(backward-char (string-width xmltag)))
-(defun xml-tag-l1 ()
+(defun transcribe-xml-tag-l1 ()
(interactive)
(insert "<l1></l1>")
(backward-char 3)
(backward-char 2))
-(defun xml-tag-l2 ()
+(defun transcribe-xml-tag-l2 ()
(interactive)
(insert "<l2 clauses=\"1\" errors=\"0\"></l2>")
(backward-char 3)
(backward-char 2))
-(fset 'xml-tag-l2-break "</l2><l2 clauses=\"1\" errors=\"0\">")
-(fset 'set-attributes "clauses=\"1\" errors=\"0\"")
+(fset 'transcribe-xml-tag-l2-break "</l2><l2 clauses=\"1\" errors=\"0\">")
+(fset 'transcribe-set-attributes "clauses=\"1\" errors=\"0\"")
-(defun display-audio-info ()
+(defun transcribe-display-audio-info ()
(interactive)
(emms-player-mpg321-remote-proc)
(shell-command "/usr/bin/mpg321 -R - &"))
-(global-set-key (kbd "<f6>") 'define-xml-tag)
-(global-set-key (kbd "<f7>") 'xml-tag-l2-break)
-(global-set-key (kbd "<f4>") 'set-attributes)
-(global-set-key (kbd "<f11>") 'xml-tag-l1)
-(global-set-key (kbd "<f12>") 'xml-tag-l2)
-
(fset 'NewEpisode
"<episode>\n<number>DATE-NUMBER</number>\n<duration></duration>\n<comment></comment>\n<subject>Subject
(level)</subject>\n<task>\n\t<role>low or high</role>\n<context>low or
high</context>\n<demand>low or
high</demand>\r</task>\n<auxiliar>Yes/no</auxiliar>\n<transcription>\n</transcription>\n</episode>")
-(global-unset-key (kbd "C-x C-n"))
-(global-set-key (kbd "C-x C-n") 'NewEpisode)
+(define-minor-mode transcribe-mode
+ "Toggle transcribe-mode"
+ nil
+ " Transcribe"
+ '(([?\C-x ?\C-p] . emms-play-file)
+ ([?\C-x ?\C-a] . transcribe-analyze-episode)
+ ([?\C-x ?\C-n] . 'NewEpisode)
+ ([?\C-x down] . emms-stop)
+ ([?\C-x right] . emms-seek-forward)
+ ([?\C-x left] . emms-seek-backward)
+ ([f5] . emms-pause)
+ ([f6] . transcribe-define-xml-tag)
+ ([f7] . 'transcribe-xml-tag-l2-break)
+ ([f8] . emms-seek)
+ ([f4] . 'transcribe-set-atributes)
+ ([f11] . transcribe-xml-tag-l1)
+ ([f12] . transcribe-xml-tag-l2))
+)
+
+;;;; ChangeLog:
+
+;; 2015-11-29 Stefan Monnier <monnier@iro.umontreal.ca>
+;;
+;; * transcribe.el: Add `provide' statement
+;;
+;; 2015-11-29 Stefan Monnier <monnier@iro.umontreal.ca>
+;;
+;; * transcribe.el: Fix up formatting and copyright
+;;
+;; 2015-11-29 David Gonzalez Gandara <dggandara@member.fsf.org>
+;;
+;; Added some usage information
+;;
+;; 2015-11-29 David Gonzalez Gandara <dggandara@member.fsf.org>
+;;
+;; Package transcribe added
+;;
+
(provide 'transcribe)
-;;; transcribe.el ends here
+;;; transcribe.el ends here
\ No newline at end of file
- [elpa] branch externals/transcribe created (now f381a3d), Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe d5ed001 01/27: Package transcribe added, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe 23566ca 02/27: Added some usage information, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe 6617973 03/27: * transcribe.el: Fix up formatting and copyright, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe e0032f9 06/27: Added minor-mode function as suggested,
Stefan Monnier <=
- [elpa] externals/transcribe 39f91f3 11/27: packages/transcribe.el: Add native discourse analysis in elisp, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe 7fcb7ab 04/27: * transcribe.el: Add `provide' statement, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe aa1a6e2 05/27: * transcribe/transcribe.el: Allow compilation without emms, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe 4b595d0 08/27: * transcribe/transcribe.el: Remove manual change log, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe 51dd51f 10/27: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa: transcribe.el update, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe 6e00216 12/27: /packages/transcribe: Fix variables, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe 5306782 07/27: * packages/transcribe.el: Manually changed Changelog, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe 6cdaf56 23/27: packages/transcribe.el - minor bug corrections, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe c620bda 17/27: * packages/transcribe: New release: new functions and menus, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe 30ae915 20/27: packages/transcribe.el: Fixed void function declaration, Stefan Monnier, 2020/12/01