Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
ca0acf31
Unverified
Commit
ca0acf31
authored
Jan 13, 2023
by
Carlo Sala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(emacs): make `alternate-editor` work for emacs >28
Closes #11441
parent
eb2147c7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
README.md
plugins/emacs/README.md
+1
-1
emacs.plugin.zsh
plugins/emacs/emacs.plugin.zsh
+1
-1
emacsclient.sh
plugins/emacs/emacsclient.sh
+2
-2
No files found.
plugins/emacs/README.md
View file @
ca0acf31
...
...
@@ -25,6 +25,6 @@ The plugin uses a custom launcher (which we'll call here `$EMACS_LAUNCHER`) that
| e |
`emacs`
| Same as emacs alias |
| te |
`$EMACS_LAUNCHER -nw`
| Open terminal emacsclient |
| eeval |
`$EMACS_LAUNCHER --eval`
| Same as
`M-x eval`
but from outside Emacs |
| eframe |
`emacsclient --alternate-editor
"" --create-frame`
| Create new X frame |
| eframe |
`emacsclient --alternate-editor
=
"" --create-frame`
| Create new X frame |
| efile | - | Print the path to the file open in the current buffer |
| ecd | - | Print the directory of the file open in the the current buffer |
plugins/emacs/emacs.plugin.zsh
View file @
ca0acf31
...
...
@@ -32,7 +32,7 @@ alias te="$EMACS_PLUGIN_LAUNCHER -nw"
# same than M-x eval but from outside Emacs.
alias
eeval
=
"
$EMACS_PLUGIN_LAUNCHER
--eval"
# create a new X frame
alias
eframe
=
'emacsclient --alternate-editor
"" --create-frame'
alias
eframe
=
'emacsclient --alternate-editor
=
"" --create-frame'
# Emacs ANSI Term tracking
if
[[
-n
"
$INSIDE_EMACS
"
]]
;
then
...
...
plugins/emacs/emacsclient.sh
View file @
ca0acf31
...
...
@@ -15,11 +15,11 @@ emacsfun() {
# Only create another X frame if there isn't one present
if
[
-z
"
$frames
"
-o
"
$frames
"
=
nil
]
;
then
emacsclient
--alternate-editor
""
--create-frame
"
$@
"
emacsclient
--alternate-editor
=
""
--create-frame
"
$@
"
return
$?
fi
emacsclient
--alternate-editor
""
"
$@
"
emacsclient
--alternate-editor
=
""
"
$@
"
}
# Adapted from https://github.com/davidshepherd7/emacs-read-stdin/blob/master/emacs-read-stdin.sh
...
...
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