From b1561c662b8629a33f5ffc89fd1be93b65e5c541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Fri, 17 Jun 2016 11:43:08 +0200 Subject: [PATCH 1/2] Update taskwarrior completion to 2.5.1 (#5171) --- plugins/taskwarrior/_task | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/taskwarrior/_task b/plugins/taskwarrior/_task index afa30d45a..46628be94 100644 --- a/plugins/taskwarrior/_task +++ b/plugins/taskwarrior/_task @@ -1,6 +1,6 @@ #compdef task # -# Copyright 2010 - 2015 Johannes Schlatow +# Copyright 2010 - 2016 Johannes Schlatow # Copyright 2009 P.C. Shyamshankar # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -26,7 +26,6 @@ typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers _task_projects=($(task _projects)) _task_tags=($(task _tags)) -_task_ids=($(task _ids)) _task_zshids=( ${(f)"$(task _zshids)"} ) _task_config=($(task _config)) _task_columns=($(task _columns)) @@ -139,8 +138,10 @@ task_dates=( ) local -a task_zshids -_regex_words values 'task IDs' $_task_zshids -task_zshids=("$reply[@]") +if (( $#_task_zshids )); then + _regex_words values 'task IDs' $_task_zshids + task_zshids=("$reply[@]") +fi _regex_words values 'task frequencies' \ 'daily:Every day' \ From d7c06131a251ec9e9c715383f33eec977c72b6ea Mon Sep 17 00:00:00 2001 From: Jordan Gwyn Date: Fri, 17 Jun 2016 03:12:59 -0700 Subject: [PATCH 2/2] emacs plugin tweak to open buffer from stdin (#5126) --- plugins/emacs/emacsclient.sh | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh index 625201a16..d61ebb15b 100755 --- a/plugins/emacs/emacsclient.sh +++ b/plugins/emacs/emacsclient.sh @@ -1,12 +1,27 @@ #!/bin/sh -# get list of available X windows. -x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null` +function _emacsfun +{ + # get list of available X windows. + x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null` -if [ -z "$x" ] || [ "$x" = "nil" ] ;then - # Create one if there is no X window yet. - emacsclient --alternate-editor "" --create-frame "$@" + if [ -z "$x" ] || [ "$x" = "nil" ] ;then + # Create one if there is no X window yet. + emacsclient --alternate-editor "" --create-frame "$@" + else + # prevent creating another X frame if there is at least one present. + emacsclient --alternate-editor "" "$@" + fi +} + + +# adopted from https://github.com/davidshepherd7/emacs-read-stdin/blob/master/emacs-read-stdin.sh +# If the second argument is - then write stdin to a tempfile and open the +# tempfile. (first argument will be `--no-wait` passed in by the plugin.zsh) +if [[ $# -ge 2 ]] && [[ "$2" == - ]]; then + tempfile="$(mktemp emacs-stdin-$USER.XXXXXXX --tmpdir)" + cat - > "$tempfile" + _emacsfun --no-wait $tempfile else - # prevent creating another X frame if there is at least one present. - emacsclient --alternate-editor "" "$@" + _emacsfun "$@" fi