[elpa] master 3824489: * transcribe/transcribe.el: Cosmetic changes

2017-12-02 Thread Stefan Monnier
branch: master
commit 38244897e4178efca61431a1aac952d43a692d86
Author: Stefan Monnier 
Commit: Stefan Monnier 

* 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.
---
 packages/transcribe/transcribe.el | 123 ++
 1 file changed, 57 insertions(+), 66 deletions(-)

diff --git a/packages/transcribe/transcribe.el 
b/packages/transcribe/transcribe.el
index e7aa6f9..0609a5d 100644
--- a/packages/transcribe/transcribe.el
+++ b/packages/transcribe/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 
 ;; 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\">" 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>" 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 "" 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 xm

[elpa] master 990d508: New option gnorb-org-log-add-link

2017-12-02 Thread Eric Abrahamsen
branch: master
commit 990d508978ce5aae51228eae37186d50cedb8583
Author: Eric Abrahamsen 
Commit: Eric Abrahamsen 

New option gnorb-org-log-add-link

* packages/gnorb/gnorb-org.el (gnorb-org-log-add-link): When non-nil,
  a message link will be added to any log note that is taken as part
  of the trigger process.
* packages/gnorb/gnorb-utils.el (gnorb-trigger-todo-action): Maybe add
  link to log note.
  (gnorb-msg-id-to-link): Adjust calling signature to allow passing
  the group in.
* packages/gnorb/gnorb.org: Document.
---
 packages/gnorb/gnorb-org.el   |  10 +++
 packages/gnorb/gnorb-utils.el |  22 --
 packages/gnorb/gnorb.info | 159 --
 packages/gnorb/gnorb.org  |  13 ++--
 packages/gnorb/gnorb.texi |  56 +++
 5 files changed, 132 insertions(+), 128 deletions(-)

diff --git a/packages/gnorb/gnorb-org.el b/packages/gnorb/gnorb-org.el
index 6790078..324f646 100644
--- a/packages/gnorb/gnorb-org.el
+++ b/packages/gnorb/gnorb-org.el
@@ -89,6 +89,16 @@ information about the message from which we're triggering."
   :type 'list
   :package-version '(gnorb . "1.1.3"))
 
+(defcustom gnorb-org-log-add-link t
+  "When non-nil, add a message link in a heading's LOGBOOK.
+When triggering an Org heading from a message, and adding a log
+note, the message id will be added to the text of the log note.
+When later viewing the messages, call `gnorb-org-view' with point
+on a particular logbook item to automatically go to the linked
+message."
+  :group 'gnorb-org
+  :type 'boolean)
+
 (defcustom gnorb-org-msg-id-key "GNORB_MSG_ID"
   "The name of the org property used to store the Message-IDs
   from relevant messages. This is no longer used, and will be
diff --git a/packages/gnorb/gnorb-utils.el b/packages/gnorb/gnorb-utils.el
index 36bab54..8810a18 100644
--- a/packages/gnorb/gnorb-utils.el
+++ b/packages/gnorb/gnorb-utils.el
@@ -346,7 +346,12 @@ agenda. Then let the user choose an action from the value 
of
  (format
   "Trigger action on %s: "
   (gnorb-pretty-outline id))
- gnorb-org-trigger-actions)))
+ gnorb-org-trigger-actions))
+(link (when gnorb-org-log-add-link
+(format "[[gnus:%s][message]] "
+(gnorb-msg-id-to-link
+ (plist-get gnorb-gnus-message-info :msg-id)
+ (plist-get gnorb-gnus-message-info :group))
 (unless agenda-p
   (org-reveal))
 (cl-labels
@@ -367,7 +372,7 @@ agenda. Then let the user choose an action from the value of
  (note
   (org-with-point-at root-marker
 (make-entry (org-id-get-create))
-(call-interactively 'org-add-note)))
+(org-add-log-setup 'note nil nil nil (or link nil
  (todo
   (if agenda-p
   (progn
@@ -376,7 +381,9 @@ agenda. Then let the user choose an action from the value of
 (call-interactively 'org-agenda-todo))
 (org-with-point-at root-marker
   (make-entry (org-id-get-create))
-  (call-interactively 'org-todo
+  (call-interactively 'org-todo)
+  (when link
+   (setq org-log-note-extra link)
  (no-associate
   nil)
  (associate
@@ -385,7 +392,7 @@ agenda. Then let the user choose an action from the value of
  ;; We're going to capture a new heading
  ((cap-child cap-sib)
   (org-with-point-at root-marker
-   (setq gnorb-trigger-capture-location (point-marker)))
+(setq gnorb-trigger-capture-location (point-marker)))
   (let ((entry
  ;; Pick a template.
  (copy-sequence (org-capture-select-template
@@ -483,10 +490,11 @@ to those symbols."
(push link (alist-get sym alist)
   alist)))
 
-(defun gnorb-msg-id-to-link (msg-id)
+(defun gnorb-msg-id-to-link (msg-id &optional server-group)
   "Create a full Org link to the message MSG-ID.
-The main work is figuring out which group the message is in."
-  (let ((server-group (car (gnorb-msg-id-request-head msg-id
+If SERVER-GROUP isn't given, try to figure it out."
+  (let ((server-group (or server-group
+ (car (gnorb-msg-id-request-head msg-id)
 (when server-group
   (org-link-escape
(concat server-group "#"
diff --git a/packages/gnorb/gnorb.info b/packages/gnorb/gnorb.info
index 09fc886..c1a54f3 100644
--- a/packages/gnorb/gnorb.info
+++ b/packages/gnorb/gnorb.info
@@ -1,4 +1,4 @@
-This is gnorb.info, produced by makeinfo version 6.3 from gnorb.texi.
+This is gnorb.info, produced by makeinfo version 6.5 from gnorb.texi.
 
 INFO-DIR-SECTION Emacs
 START-INFO-DIR-ENTRY
@@ -28,9 +28,6 @@ Gnorb Manual
 
 — The Detailed Node Listing —
 
-
-
-
 Email Tracking
 
 * Tracking Setup::
@@ -42,3