Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement