[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/transcribe 76c5bd2 26/27: * transcribe/transcribe.el: C
From: |
Stefan Monnier |
Subject: |
[elpa] externals/transcribe 76c5bd2 26/27: * transcribe/transcribe.el: Cosmetic changes |
Date: |
Tue, 1 Dec 2020 17:33:51 -0500 (EST) |
branch: externals/transcribe
commit 76c5bd2cadb0d8f03e8b65787c905c32cb685599
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
* transcribe/transcribe.el: Cosmetic changes
(transcribe-analyze): Comment out unused code.
(transcribe-xml-tag-person, transcribe-xml-tag)
(transcribe-add-attribute, transcribe-add-attribute-function)
(transcribe-add-attribute-move, transcribe-xml-tag-l1)
(transcribe-xml-tag-l2, transcribe-xml-tag-break): Use define-skeleton.
---
transcribe.el | 123 +++++++++++++++++++++++++++-------------------------------
1 file changed, 57 insertions(+), 66 deletions(-)
diff --git a/transcribe.el b/transcribe.el
index e7aa6f9..0609a5d 100644
--- a/transcribe.el
+++ b/transcribe.el
@@ -1,6 +1,6 @@
;;; transcribe.el --- Package for audio transcriptions
-;; Copyright 2014-2016 Free Software Foundation, Inc.
+;; Copyright 2014-2017 Free Software Foundation, Inc.
;; Author: David Gonzalez Gandara <dggandara@member.fsf.org>
;; Version: 1.5.2
@@ -22,7 +22,7 @@
;; REQUIRES:
;; -----------------------------
-;; This module works without any requires, but in order to use the audio
+;; This module works without any requires, but in order to use the audio
;; functions, you need to install the Emacs package "emms", by Joe Drew,
;; and the external program "mpg321", by Jorgen Schafer and Ulrik Jensen,
;; both under GPL licenses.
@@ -89,9 +89,9 @@
(defvar emms-player-list)
(push 'emms-player-mpg321-remote emms-player-list)
-(if t (require 'emms-mode-line))
+(if t (require 'emms-mode-line));FIXME: isn't `emms-mode-line' autoloaded?
(emms-mode-line 1)
-(if t (require 'emms-playing-time))
+(if t (require 'emms-playing-time));FIXME: isn't `emms-playing-time'
autoloaded?
(emms-playing-time 1)
(defvar transcribe-function-list '("initiating" "responding" "control"
"expressive" "interpersonal"))
@@ -238,10 +238,10 @@
(when (string-match "@*" l1) (setq shifts (1+
shifts)))
(cl-pushnew l1 interventionsl1 :test #'equal)
(setq asunitsl1 (1+ asunitsl1)))))))))))))
- (reverse interventionsl2)
+ ;; (reverse interventionsl2)
;; (write-region (format "%s" interventionsl2) nil (format
"transcribe-output-%s-%s-l2.txt" episodenumber personid))
;; Write raw interventions to file will be supported by a different function
- (reverse interventionsl1)
+ ;; (reverse interventionsl1)
;; (write-region (format "%s" interventionsl1) nil (format
"transcribe-output-%s-%s-l1.txt" episodenumber personid))
;; (print interventionsl2) ;uncomment to display all the interventions on
screen
(let((asunitspersecondl2 (/ asunitsl2 (string-to-number duration)))
@@ -281,8 +281,8 @@
(let* ((xml (xml-parse-region (point-min) (point-max)))
(results (car xml))
(episodes (xml-get-children results 'episode)))
-
- (with-current-buffer "Statistics Output"
+
+ (with-current-buffer "Statistics Output"
(erase-buffer)
(insert
"person,episode,duration,C-UNITS(L2),C-UNITS(L1),role,context,demand,QUAN-L2,QUAN-L1,QUAL-L2,initiating,responding,control,expressive,interpersonal,shifts,aux,level,subjects,yearofCLIL,month\n"))
(dolist (episode episodes)
@@ -297,64 +297,55 @@
(transcribe-analyze number participant))))))
-(defun transcribe-xml-tag-person (xmltag move)
- "This function allows the automatic insertion of a speaker xml tag and
places the cursor."
- (interactive (list(read-string "Person:")(completing-read "move:"
transcribe-move-list)))
- (end-of-line)
- (insert (format "\n<%s move=\"%s\"></%s>" xmltag move xmltag))
- (backward-char 3)
- (backward-char (string-width xmltag)))
-
-(defun transcribe-xml-tag (xmltag)
- "This function allows the automatic insetion of a custom xml tag and places
the cursor."
- (interactive "stag:")
- (insert (format "<%s></%s>" xmltag xmltag))
- (backward-char 3)
- (backward-char (string-width xmltag)))
-
-(defun transcribe-region-xml-tag (xmltag)
- "This function encapsulates the marked region in the given tag."
- (interactive "stag:")
- (let ((beginning (region-beginning))
- (end (region-end)))
- (goto-char beginning)
- (insert (format "<%s>" xmltag))
- (goto-char (+ (+ end (string-width xmltag)) 2))
- (insert (format "</%s>" xmltag))))
-
-(defun transcribe-add-attribute (att val)
- "Adds a xml attribute at cursor with the name and value specified
(autocompletion possible)"
- (interactive (list(completing-read "attribute name:"
transcribe-attribute-list)(read-string "value:")))
- (insert (format "%s=\"%s\"" att val)))
-
-(defun transcribe-add-attribute-function (val)
- "Adds the xml attribute `function' at cursor with the name specified
(autocompletion possible)"
- (interactive (list(completing-read "function name:"
transcribe-function-list)))
- (insert (format "function=\"%s\"" val)))
-
-(defun transcribe-add-attribute-move (val)
- "Adds the xml attribute `move' at cursor with the name specified
(autocompletion possible)"
- (interactive (list(completing-read "move name:" transcribe-move-list)))
- (insert (format "move=\"%s\"" val)))
-
-(defun transcribe-xml-tag-l1 (function)
- "Inserts a l1 tag and places the cursor"
- (interactive (list(completing-read "function:" transcribe-function-list)))
- (re-search-forward "</l.>" (line-end-position) t)
- (insert (format "<l1 clauses=\"1\" errors=\"0\" function=\"%s\"></l1>"
function))
- (backward-char 5))
-
-(defun transcribe-xml-tag-l2 (function)
- "Inserts a l2 tag and places the cursor"
- (interactive (list(completing-read "function:" transcribe-function-list)))
- (re-search-forward "</l.>" (line-end-position) t)
- (insert (format "<l2 clauses=\"1\" errors=\"0\" function=\"%s\"></l2>"
function))
- (backward-char 5))
-
-(defun transcribe-xml-tag-break (xmltag)
- "This function breaks an unit into two. That is, insert a closing and an
opening equal tags"
- (interactive "stag:")
- (insert (format "</%s><%s>" xmltag xmltag)))
+(define-skeleton transcribe-xml-tag-person
+ "Insert a speaker xml tag and move point accordingly."
+ "Person: "
+ "<" str " move=\"" (completing-read "Move: " transcribe-move-list)
+ "\">" _ "</" str ">")
+
+(define-skeleton transcribe-xml-tag
+ "Encapsulate the marked region in the given tag."
+ "Tag: "
+ "<" str ">" _ "</" str ">")
+(define-obsolete-function-alias 'transcribe-region-xml-tag
+ #'transcribe-xml-tag "1.6")
+
+(define-skeleton transcribe-add-attribute
+ "Add an xml attribute at point with the name and value specified."
+ (completing-read "Attribute name: " transcribe-attribute-list)
+ ;; FIXME: provide more specific value completion depending on the
+ ;; chosen attribute.
+ str "=\"" '(read-string "Value: ") "\"")
+
+(define-skeleton transcribe-add-attribute-function
+ "Add the xml attribute `function' at point with the name specified."
+ (completing-read "Function name: " transcribe-function-list)
+ "function=\"" str "\"")
+
+(define-skeleton transcribe-add-attribute-move
+ "Add the xml attribute `move' at point with the name specified."
+ (completing-read "Move name: " transcribe-move-list)
+ "move=\"" str "\"")
+
+(define-skeleton transcribe-xml-tag-l1
+ "Insert an l1 tag and places the cursor."
+ (completing-read "Function: " transcribe-function-list)
+ '(re-search-forward "</l.>" (line-end-position) t)
+ "<l1 clauses=\"1\" errors=\"0\" function=\"" str "\">" _ "</l1>")
+
+(define-skeleton transcribe-xml-tag-l2
+ "Insert a l2 tag and place the cursor."
+ (completing-read "function:" transcribe-function-list)
+ '(re-search-forward "</l.>" (line-end-position) t)
+ "<l2 clauses=\"1\" errors=\"0\" function=\"" str "\">" _ "</l2>")
+
+(define-skeleton transcribe-xml-tag-break
+ "Break a unit into two.
+That is, insert a closing and an opening tag."
+ "Tag: "
+ ;; FIXME: Auto-compute the tag rather than pestering the user!
+ ;; Maybe we could simply use `nxml-split-element', for example.
+ "</" str "><" str ">")
(defun transcribe-display-audio-info ()
(interactive)
- [elpa] externals/transcribe 4b595d0 08/27: * transcribe/transcribe.el: Remove manual change log, (continued)
- [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
- [elpa] externals/transcribe b99bb85 18/27: * packages/transcribe.el: Fixed key binding error. Added menus, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe d5bf0a5 21/27: packages/transcribe.el: Fixed function calls, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe 481fac9 25/27: packages/transcribe.el: improved analysis functions, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe 76c5bd2 26/27: * transcribe/transcribe.el: Cosmetic changes,
Stefan Monnier <=
- [elpa] externals/transcribe 89832e4 24/27: packages/transcribe.el: interface improvements, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe cd7c67d 13/27: /packages/transcribe.el: Fix global variables, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe 73878e0 14/27: /transcribe/transcribe.el: edit comments, add new functions, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe 580652e 09/27: * /transcribe/transcribe.el: Fix unworking keys, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe 5e39469 16/27: /transcribe/transcribe.el: Add some functions, fix bugs, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe 786539b 15/27: /transcribe/transcribe.el: Fix bug, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe 73da910 19/27: packages/transcribe.el: Applied suggested patches, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe bcba1e3 22/27: Fix some quoting problems in doc strings, Stefan Monnier, 2020/12/01
- [elpa] externals/transcribe f381a3d 27/27: * .gitignore: New file, Stefan Monnier, 2020/12/01