Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
31fb8d02
Commit
31fb8d02
authored
May 31, 2015
by
Justin Hileman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[split] Move emacs plugin to oh-my-fish/plugin-emacs
https://github.com/oh-my-fish/plugin-emacs
parent
78d56bcf
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
0 additions
and
242 deletions
+0
-242
plugins/emacs/README.md
plugins/emacs/README.md
+0
-30
plugins/emacs/emacs.load
plugins/emacs/emacs.load
+0
-39
plugins/emacs/functions/__kill_emacs.fish
plugins/emacs/functions/__kill_emacs.fish
+0
-3
plugins/emacs/functions/__launch_emacs.fish
plugins/emacs/functions/__launch_emacs.fish
+0
-9
plugins/emacs/functions/e.fish
plugins/emacs/functions/e.fish
+0
-3
plugins/emacs/functions/ec.fish
plugins/emacs/functions/ec.fish
+0
-3
plugins/emacs/functions/ecd.fish
plugins/emacs/functions/ecd.fish
+0
-11
plugins/emacs/functions/eeval.fish
plugins/emacs/functions/eeval.fish
+0
-3
plugins/emacs/functions/efile.fish
plugins/emacs/functions/efile.fish
+0
-5
plugins/emacs/functions/eframe.fish
plugins/emacs/functions/eframe.fish
+0
-3
plugins/emacs/functions/ek.fish
plugins/emacs/functions/ek.fish
+0
-3
plugins/emacs/functions/emacs.fish
plugins/emacs/functions/emacs.fish
+0
-3
plugins/emacs/functions/emasc.fish
plugins/emacs/functions/emasc.fish
+0
-3
plugins/emacs/functions/emcas.fish
plugins/emacs/functions/emcas.fish
+0
-3
plugins/emacs/functions/et.fish
plugins/emacs/functions/et.fish
+0
-3
plugins/emacs/spec/emacs.spec.fish
plugins/emacs/spec/emacs.spec.fish
+0
-118
No files found.
plugins/emacs/README.md
deleted
100644 → 0
View file @
78d56bcf
# Emacs Plugin
This plugin replicates the functionality of the
[
emacs
](
https://www.gnu.org/software/emacs/
)
plugin for
[
oh-my-zsh
](
http://ohmyz.sh/
)
.
It is essentially a wrapper around the very useful
[
emacs daemon
](
http://www.emacswiki.org/emacs/EmacsAsDaemon
)
capability.
Below is an extract from the original plugin source file:
"Emacs 23 daemon capability is a killing feature.
One emacs process handles all your frames whether
you use a frame opened in a terminal via a ssh connection or X frames
opened on the same host.
Benefits are multiple
*
You don't have the cost of starting Emacs all the time anymore
*
Opening a file is as fast as Emacs does not have anything else to do.
*
You can share opened buffered across opened frames.
*
Configuration changes made at runtime are applied to all frames."
### Usage
To use this plugin add
`emacs`
to
`fish_plugins`
in you fish config file:
```
bash
set
fish_plugins emacs
```
### Requirements
Emacs 23 or later is required for this plugin.
\ No newline at end of file
plugins/emacs/emacs.load
deleted
100644 → 0
View file @
78d56bcf
function __major_version
if test -n "$argv"
set -l full_metadata (eval $argv --version)
set -l full_version (echo $full_metadata | grep -o "[0-9]\+.[0-9]\+.[0-9]\+.[0-9]\+")
set -l major_version (echo $full_version | sed "s/\..*//")
end
echo $major_version
end
function __set_editor
if not set -q EDITOR
set -gx EDITOR emacs
end
end
function __add_functions_to_path
set emacs_functions $fish_path/plugins/emacs/functions
set fish_function_path $emacs_functions $fish_function_path
end
if not set -q __emacs
set __emacs (which emacs)
end
if not set -q __emacs_version
set __emacs_version (__major_version $__emacs)
end
if test "$__emacs_version" -gt 23
__set_editor
__add_functions_to_path
end
set -e emacs
set -e emacs_version
functions -e __major_version
functions -e __plugins_path
functions -e __set_editor
functions -e __add_functions_to_path
plugins/emacs/functions/__kill_emacs.fish
deleted
100644 → 0
View file @
78d56bcf
function __kill_emacs
emacsclient --alternate-editor '' --eval '(kill-emacs)' 2>/dev/null
end
plugins/emacs/functions/__launch_emacs.fish
deleted
100644 → 0
View file @
78d56bcf
function __launch_emacs
set -l x (emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null)
if test -z "$x" -o "$x" = nil
emacsclient $argv --alternate-editor '' --create-frame
else
emacsclient $argv --alternate-editor ''
end
end
plugins/emacs/functions/e.fish
deleted
100644 → 0
View file @
78d56bcf
function e
__launch_emacs $argv --no-wait
end
plugins/emacs/functions/ec.fish
deleted
100644 → 0
View file @
78d56bcf
function ec
__launch_emacs $argv --create-frame --no-wait
end
plugins/emacs/functions/ecd.fish
deleted
100644 → 0
View file @
78d56bcf
function ecd
set -l cmd '(let ((buf-name (buffer-file-name (window-buffer))))
(if buf-name (file-name-directory buf-name)))'
set -l dir (__launch_emacs --eval $cmd | tr -d '\"')
if test -n "$dir"
echo $dir
else
echo 'cannot deduce current buffer filename.' >/dev/stderr
end
end
plugins/emacs/functions/eeval.fish
deleted
100644 → 0
View file @
78d56bcf
function eeval
__launch_emacs --eval $argv
end
plugins/emacs/functions/efile.fish
deleted
100644 → 0
View file @
78d56bcf
function efile
set -l cmd '(buffer-file-name (window-buffer))'
__launch_emacs --eval $cmd | tr -d '\"'
end
plugins/emacs/functions/eframe.fish
deleted
100644 → 0
View file @
78d56bcf
function eframe
__launch_emacs $argv --create-frame --no-wait
end
plugins/emacs/functions/ek.fish
deleted
100644 → 0
View file @
78d56bcf
function ek
__kill_emacs
end
plugins/emacs/functions/emacs.fish
deleted
100644 → 0
View file @
78d56bcf
function emacs
__launch_emacs $argv --no-wait
end
plugins/emacs/functions/emasc.fish
deleted
100644 → 0
View file @
78d56bcf
function emasc
__launch_emacs $argv --no-wait
end
plugins/emacs/functions/emcas.fish
deleted
100644 → 0
View file @
78d56bcf
function emcas
__launch_emacs $argv --no-wait
end
plugins/emacs/functions/et.fish
deleted
100644 → 0
View file @
78d56bcf
function et
__launch_emacs $argv --tty
end
plugins/emacs/spec/emacs.spec.fish
deleted
100644 → 0
View file @
78d56bcf
import plugins/fish-spec
function describe_emacs
function before_all
set -g __emacs_current_editor $EDITOR
set -g __emacs_load_file $fish_path/plugins/emacs/emacs.load
set -g __emacs_functions e ec ek et ecd eeval efile eframe emacs emasc emcas
end
function before_each
set -e EDITOR
set -g __emacs '/bin/emacs'
set -g __emacs_version 25
end
function it_sets_editor_on_load
load_emacs_plugin
expect $EDITOR --to-equal "emacs"
end
function it_does_not_set_editor_when_it_is_already_set
set EDITOR 'vim'
load_emacs_plugin
expect $EDITOR --to-equal "vim"
end
function it_does_not_set_editor_when_emacs_is_not_found
emacs_is_not_found
load_emacs_plugin
expect "$EDITOR" --to-equal ""
end
function it_does_not_set_editor_when_emacs_version_is_lower_than_23
set __emacs_version 22
load_emacs_plugin
expect "$EDITOR" --to-equal ""
end
function it_adds_functions_to_fish_function_path
load_emacs_plugin
expect (functions) --to-contain-all $__emacs_functions
end
function it_has_a_test_helper_that_removes_emacs_functions
load_emacs_plugin
expect (functions) --to-contain-all $__emacs_functions
remove_emacs_functions
expect (functions) --to-not-contain-all $__emacs_functions
end
function it_does_not_add_functions_when_emacs_is_not_found
remove_emacs_functions
emacs_is_not_found
load_emacs_plugin
expect (functions) --to-not-contain-all $__emacs_functions
end
function it_does_not_add_functions_when_emacs_version_is_lower_than_23
set __emacs_version 22
expect (functions) --to-not-contain-all $__emacs_functions
load_emacs_plugin
expect (functions) --to-not-contain-all $__emacs_functions
end
function emacs_is_not_found
set __emacs ""
set __emacs_version ""
end
function load_emacs_plugin
source $__emacs_load_file
end
function remove_emacs_functions
for path in $fish_function_path
set match (echo $path | grep emacs)
if test -z "$match"
set -g __new_fish_function_path $__new_fish_function_path $path
end
end
set fish_function_path $__new_fish_function_path
set -e __new_fish_function_path
end
function after_all
set EDITOR $__emacs_current_editor
set -e __emacs
set -e __emacs_version
set -e __emacs_load_file
set -e __emacs_functions
set -e __emacs_current_editor
end
end
spec.run $argv
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