Created
April 21, 2015 19:06
-
-
Save cbilson/10be41b98d4550957b57 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Start-EmacsClient { | |
[CmdletBinding()] | |
param( | |
[switch] $NewWindow, | |
[switch] $CreateFrame, | |
[switch] $Wait, | |
$AlternateEditor = 'notepad', | |
[Parameter(Position=0, ValueFromRemainingArguments)] | |
[string[]] $RestArgs) | |
$argList = @() | |
if ($NewWindow) { $argList += '-nw' } | |
if ($CreateFrame) { $argList += '--create-frame' } | |
if (!$Wait) { $argList += '--no-wait' } | |
$argList += "--alternate-editor=$AlternateEditor" | |
if ($RestArgs) { $argList += $RestArgs } | |
Write-Verbose "Starting: C:\ProgramData\chocolatey\bin\emacsclientw.exe $argList" | |
Start-Process C:\ProgramData\chocolatey\bin\emacsclientw.exe $argList -NoNewWindow | |
} | |
New-Alias ec Start-EmacsClient |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment