#compdef emacs mule

local curcontext="$curcontext" state line
typeset -A opt_args

_arguments -C -s \
    '--help[display help message]' \
    '--batch[do not do interactive display]' \
    '--debug-init[enable Emacs Lisp debugger during init file]' \
    '(--unibyte)--multibyte[run Emacs in multibyte mode]' \
    '(--multibyte)--unibyte[run Emacs in unibyte mode]' \
    '(--no-init-file -q)'{--no-init-file,-q}'[load neither ~/.emacs nor default.el]' \
    '(-nl --no-shared-memory)'{-nl,--no-shared-memory}'[do not use shared memory]' \
    '--no-site-file[do not load site-start.el]' \
    '(-nw --no-windows)'{-nw,--no-windows}'[do not communicate with X, ignoring $DISPLAY]' \
    '(-u --user)'{-u,--user}'[load ~USER/.emacs instead of your own]:user name:_users' \
    '--version[display version information and exit]' \
    '(-fg --foreground-color)'{-fg,--foreground-color}'[window foreground color]:foreground color:_x_color' \
    '(-bg --background-color)'{-bg,--background-color}'[window background color]:background color:_x_color' \
    '(-bd --border-color)'{-bd,--border-color}'[main border color]:border color:_x_color' \
    '(-cr --cursor-color)'{-cr,--cursor-color}'[color of the Emacs cursor indicating point]:cursor color:_x_color' \
    '(-bw --border-width)'{-bw,-border-width}':border width:' \
    '(-fn --font)'{-fn,--font}'[default font, must be fixed-width]:font:_x_font' \
    '(-g --geometry)'{-g,--geometry}'[window geometry]:window geometry:_x_geometry' \
    '--iconic' \
    '(-i --icon-type)'{-i,--icon-type} \
    '(-ib --internal-border)'{-ib,--internal-border}':internal border width:' \
    '(-lsp --line-spacing)'{-lsp,--line-spacing}':line spacing:' \
    '(-ms --mouse-color)'{-ms,--mouse-color}'[mouse cursor color in Emacs window]:mouse color:_x_color' \
    '--name[title of main Emacs window]:name:' \
    '(-T -wn --title)'{-T,-wn,--title}'[title for Emacs windows]:window name:' \
    '(-vb --vertical-scroll-bars)'{-vb,--vertical-scroll-bars}'[enable vertical scroll bars]' \
    '(-L --directory)'{-L,--directory}'[add DIR to variable load-path]:load path dir:_files -g .*(/) *(/) *(@)' \
    '--eval[evaluate Emacs Lisp expression EXPR]:lisp expression:' \
    '--execute[evaluate Emacs Lisp expression EXPR]:lisp expression:' \
    '(-f --funcall)'{-f,--funcall}'[call Emacs function with no arguments]:emacs function:' \
    '--kill[exit without asking for confirmation]' \
    '(-l --load)'{-l,--load}'[load FILE of Emacs Lisp code]:load lisp:_files -g \*.el' \
    '--insert[insert contents of FILE into current buffer]:insert file:_files' \
    '*:file:_files' && return 0

return 1
