mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-01 04:30:37 +02:00
merged master branch into kushina
This commit is contained in:
commit
95e8f8de37
2 changed files with 27 additions and 11 deletions
|
|
@ -1,12 +1,27 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# get list of available X windows.
|
function _emacsfun
|
||||||
x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null`
|
{
|
||||||
|
# get list of available X windows.
|
||||||
|
x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null`
|
||||||
|
|
||||||
if [ -z "$x" ] || [ "$x" = "nil" ] ;then
|
if [ -z "$x" ] || [ "$x" = "nil" ] ;then
|
||||||
# Create one if there is no X window yet.
|
# Create one if there is no X window yet.
|
||||||
emacsclient --alternate-editor "" --create-frame "$@"
|
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
|
else
|
||||||
# prevent creating another X frame if there is at least one present.
|
_emacsfun "$@"
|
||||||
emacsclient --alternate-editor "" "$@"
|
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#compdef task
|
#compdef task
|
||||||
#
|
#
|
||||||
# Copyright 2010 - 2015 Johannes Schlatow
|
# Copyright 2010 - 2016 Johannes Schlatow
|
||||||
# Copyright 2009 P.C. Shyamshankar
|
# Copyright 2009 P.C. Shyamshankar
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
# 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
|
typeset -g _task_cmds _task_projects _task_tags _task_config _task_modifiers
|
||||||
_task_projects=($(task _projects))
|
_task_projects=($(task _projects))
|
||||||
_task_tags=($(task _tags))
|
_task_tags=($(task _tags))
|
||||||
_task_ids=($(task _ids))
|
|
||||||
_task_zshids=( ${(f)"$(task _zshids)"} )
|
_task_zshids=( ${(f)"$(task _zshids)"} )
|
||||||
_task_config=($(task _config))
|
_task_config=($(task _config))
|
||||||
_task_columns=($(task _columns))
|
_task_columns=($(task _columns))
|
||||||
|
|
@ -139,8 +138,10 @@ task_dates=(
|
||||||
)
|
)
|
||||||
|
|
||||||
local -a task_zshids
|
local -a task_zshids
|
||||||
_regex_words values 'task IDs' $_task_zshids
|
if (( $#_task_zshids )); then
|
||||||
task_zshids=("$reply[@]")
|
_regex_words values 'task IDs' $_task_zshids
|
||||||
|
task_zshids=("$reply[@]")
|
||||||
|
fi
|
||||||
|
|
||||||
_regex_words values 'task frequencies' \
|
_regex_words values 'task frequencies' \
|
||||||
'daily:Every day' \
|
'daily:Every day' \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue