view etc/emacs.bash @ 70132:f8b9335f0cad

* org.el (org-deadline-announce): Face removed. (org-level-faces, org-n-levels): Converted to constant. (org-compatible-face): New function. (org-hide, org-level-1, org-level-2, org-level-3, org-level-4) (org-level-5, org-level-6, org-level-7, org-level-8) (org-special-keyword, org-warning, org-headline-done, org-link) (org-date, org-tag, org-todo, org-done, org-table, org-formula) (org-scheduled-today, org-scheduled-previously, org-time-grid): Face definition revised for better color tty support. (org-bold-re, org-italic-re, org-underline-re): New constants. (org-set-font-lock-defaults): Use the new constants. (org-agenda-highlight-todo): New function. (org-agenda-todo): Fixed bug with point at end of line. (org-agenda-change-all-lines, org-finalize-agenda-entries): Fontify TODO keywords. (org-insert-link): Preserve relative path in ../ links. (org-export-as-html): Convert links pointing to .org files into links that will work beteen the exported HTML files. (org-todo-list): Fix bug when arg=0. (org-insert-heading): More fine-tuning.
author Carsten Dominik <dominik@science.uva.nl>
date Thu, 20 Apr 2006 11:44:52 +0000
parents 615a90f44f52
children 873c558e1383 72cf6261961e
line wrap: on
line source

# This defines a bash command named `edit' which contacts/resumes an
# existing emacs or starts a new one if none exists.
#
# One way or another, any arguments are passed to emacs to specify files
# (provided you have loaded `resume.el').
#
# This function assumes the emacs program is named `emacs' and is somewhere
# in your load path.  If either of these is not true, the most portable
# (and convenient) thing to do is to make an alias called emacs which
# refers to the real program, e.g.
#
#        alias emacs=/usr/local/bin/gemacs
#
# Written by Noah Friedman.

function edit ()
{
 local windowsys="${WINDOW_PARENT+sun}"

 windowsys="${windowsys:-${DISPLAY+x}}"

 if [ -n "${windowsys:+set}" ]; then
    # Do not just test if these files are sockets.  On some systems
    # ordinary files or fifos are used instead.  Just see if they exist.
    if [ -e "${HOME}/.emacs_server" -o -e "/tmp/emacs${UID}/server" ]; then
       emacsclient "$@"
       return $?
    else
       echo "edit: starting emacs in background..." 1>&2
    fi

    case "${windowsys}" in
      x ) (emacs "$@" &) ;;
      sun ) (emacstool "$@" &) ;;
    esac
 else
    if jobs %emacs 2> /dev/null ; then
       echo "$(pwd)" "$@" >| ${HOME}/.emacs_args && fg %emacs
    else
       emacs "$@"
    fi
 fi
}


# arch-tag: 1e1b74b9-bf2c-4b23-870f-9eebff7515cb