Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
49c0a138
Commit
49c0a138
authored
Apr 15, 2011
by
Tristan Carel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fix pass of parameters
- Add new function `ecd'.
parent
a183bcbc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
emacs.plugin.zsh
plugins/emacs/emacs.plugin.zsh
+17
-1
emacsclient.sh
plugins/emacs/emacsclient.sh
+2
-2
No files found.
plugins/emacs/emacs.plugin.zsh
View file @
49c0a138
# Emacs 23 daemon capability is a killing feature.
# Emacs 23 daemon capability is a killing feature.
# One emacs process handles all your frames whether
# One emacs process handles all your frames whether
# you use a frame opened in a terminal via a ssh connection or X frames
# you use a frame opened in a terminal via a ssh connection or X frames
# opened on the same host.
# opened on the same host.
# Benefits are multiple
# Benefits are multiple
...
@@ -23,8 +23,24 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
...
@@ -23,8 +23,24 @@ if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
# to code all night long
# to code all night long
alias
emasc
=
emacs
alias
emasc
=
emacs
alias
emcas
=
emacs
alias
emcas
=
emacs
# jump to the directory of the current buffer
function
ecd
{
local
cmd
=
"(let ((buf-name (buffer-file-name (window-buffer))))
(if buf-name
(file-name-directory buf-name)))"
local dir
=
`
$EDITOR
--eval
"
$cmd
"
|
tr
-d
\"
`
if
[
-n
"
$dir
"
]
;
then
cd
"
$dir
"
else
echo
"can not deduce current buffer filename."
>
/dev/stderr
return
1
fi
}
fi
fi
## Local Variables:
## Local Variables:
## mode: sh
## mode: sh
## End:
## End:
plugins/emacs/emacsclient.sh
View file @
49c0a138
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
x
=
`
emacsclient
--alternate-editor
''
--eval
'(x-display-list)'
2>/dev/null
`
x
=
`
emacsclient
--alternate-editor
''
--eval
'(x-display-list)'
2>/dev/null
`
if
[
-z
"
$x
"
]
;
then
if
[
-z
"
$x
"
]
;
then
emacsclient
--alternate-editor
""
--create-frame
$@
emacsclient
--alternate-editor
""
--create-frame
"
$@
"
else
else
# prevent creating another X frame if there is at least one present.
# prevent creating another X frame if there is at least one present.
emacsclient
--alternate-editor
""
$@
emacsclient
--alternate-editor
""
"
$@
"
fi
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment