Add emacs plugin (even more updated)

Incorporate changes after code review of #408
pull/2/head
Kelvin Smith 10 years ago
parent 55a2e6d003
commit c501d0f2c6

@ -9,7 +9,9 @@ function __major_version
end
function __set_editor
set -q EDITOR; or set -gx EDITOR emacs
if not set -q EDITOR
set -gx EDITOR emacs
end
end
function __add_functions_to_path
@ -17,8 +19,12 @@ function __add_functions_to_path
set fish_function_path $emacs_functions $fish_function_path
end
set -q __emacs; or set __emacs (which emacs)
set -q __emacs_version; or set __emacs_version (__major_version $__emacs)
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

@ -1,9 +1,9 @@
function __launch_emacs
set -l x (emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null)
if begin; test -z "$x"; or test $x = nil; end
if test -z "$x" -o "$x" = nil
emacsclient $argv --alternate-editor '' --create-frame
else
or emacsclient $argv --alternate-editor ''
emacsclient $argv --alternate-editor ''
end
end

@ -7,6 +7,5 @@ function ecd
echo $dir
else
echo 'cannot deduce current buffer filename.' >/dev/stderr
return 1
end
end

Loading…
Cancel
Save