diff --git a/.emacs b/.emacs index c7f10105..1f86acbb 100644 --- a/.emacs +++ b/.emacs @@ -10,6 +10,7 @@ (load "~/.emacs.d/theme.el" nil t) (load "~/.emacs.d/modes.el" nil t) (load "~/.emacs.d/functions.el" nil t) +(load "~/.emacs.d/plugins.el" nil t) ;; End of file diff --git a/.emacs-full b/.emacs-light similarity index 91% rename from .emacs-full rename to .emacs-light index 1f86acbb..c7f10105 100644 --- a/.emacs-full +++ b/.emacs-light @@ -10,7 +10,6 @@ (load "~/.emacs.d/theme.el" nil t) (load "~/.emacs.d/modes.el" nil t) (load "~/.emacs.d/functions.el" nil t) -(load "~/.emacs.d/plugins.el" nil t) ;; End of file diff --git a/.homeinit b/.homeinit index 24426dba..46e3e7be 100755 --- a/.homeinit +++ b/.homeinit @@ -20,6 +20,13 @@ SOURCEDIR="${HOME}/personal/dataperso" [ -z "$XDG_DATA_HOME" ] && XDG_DATA_HOME="$HOME/.local/share" [ -z "$XDG_DATA_DIRS" ] && XDG_DATA_DIRS="/usr/local/share" +## Emacsclient launcher. Required for best emacsclient integration. For a fully +## functional daemon, you should write a file like this and set 'EDITOR=em'. +if [ ! -f /bin/em ]; then + sudo sh -c "echo '#!/bin/sh +emacsclient -a \"\" -t \"\$@\"' > '/bin/em'" +fi + ## Mutt echo "==> Mutt" ln -snf "$(realpath ${SOURCEDIR}/mails)" "${HOME}/.mutt" @@ -70,3 +77,4 @@ fi ln -sf "${SOURCEDIR}/bookmarks/bookmarks" "$BROWSER_DATA_DIR" ln -sf "${SOURCEDIR}/bookmarks/quickmarks" "$BROWSER_DATA_DIR" echo + diff --git a/.muttrc b/.muttrc index 687a41f2..5d79ca96 100644 --- a/.muttrc +++ b/.muttrc @@ -1,7 +1,7 @@ ## -*- mode:sh -*- # ################################################################################ ## Mutt Configuration -## Date 2012-10-28 +## Date 2013-01-09 ################################################################################ ## Note on folders: @@ -14,10 +14,10 @@ ## General options ##------------------------------------------------------------------------------- -## TODO: why doesn't the $EDITOR variable work for connection to emacs daemon? ## Seems like $EDITOR is internal to Mutt, whereas variable set between -## backquotes are external. -set editor=`echo \$EDITOR` +## backquotes are external. Mutt will use env EDITOR variable, so we do not +## really need to set it. +# set editor=`echo \$EDITOR` # set editor="emacsclient -a \"\" -t" ## Mailcap diff --git a/.shell.d/alias_rc b/.shell.d/alias_rc index 6a4b099b..7f177e43 100644 --- a/.shell.d/alias_rc +++ b/.shell.d/alias_rc @@ -95,24 +95,10 @@ alias xmorphzi='xrandr --output $(xrandr | grep "\" | cut -f1 -d" ") ##============================================================================== ## Emacs ##============================================================================== -## For the systemd unit, write the following file: -## /etc/systemd/system/emacs@.service -# [Unit] -# Description=Emacs: the extensible, self-documenting text editor -# -# [Service] -# Type=forking -# ExecStart=/usr/bin/emacs --daemon -# ExecStop=/usr/bin/emacsclient --eval "(progn (setq kill-emacs-hook 'nil) (kill-emacs))" -# Restart=always -# User=%i -# -# [Install] -# WantedBy=multi-user.target -if [ -n "$(command -v emacs)" ]; then - alias em='emacsclient -a "" -t' - alias emacs-reload="emacsclient -e '(kill-emacs)' >/dev/null 2>&1; emacs --daemon -q -l ~/.emacs-full" - # alias emacs-reload="sudo systemctl restart emacs@$USER" +# See .homeinit +if [ -f /bin/em ]; then + alias ema='emacs -q -l ~/.emacs-light' + alias emacs-reload="emacsclient -e '(kill-emacs)' >/dev/null 2>&1; emacs --daemon" fi ##============================================================================== @@ -125,7 +111,7 @@ fi #alias -g L='| less' ## Now just type the image name to launch irfanview -#alias -s jpg='/usr/bin/gpicview' +#alias -s jpg='/usr/bin/sxiv' # fi diff --git a/.shell.d/main_rc b/.shell.d/main_rc index 07df993e..cdc09601 100644 --- a/.shell.d/main_rc +++ b/.shell.d/main_rc @@ -76,7 +76,11 @@ if [ -n "$(command -v vim)" ]; then EDITOR=vim fi if [ -n "$(command -v emacs)" ]; then - EDITOR='emacsclient -a "" -t' + EDITOR='emacs' +fi +## 'em' is a script for emacsclient. See '.homeinit'. +if [ -f "/bin/em" ]; then + EDITOR='em' fi export EDITOR @@ -92,3 +96,14 @@ export EDITOR #*) # ;; #esac + +## SSH-Agent +if [ $(ps ax -o command="" | grep -c "ssh-agent") -eq 1 ]; then + SSH_AGENT_VARS=$(ssh-agent) + eval $(echo ${SSH_AGENT_VARS}) + echo ${SSH_AGENT_VARS} | sed '2q' > "$HOME/.ssh/agent_env" + unset $SSH_AGENT_VARS +else + eval $(cat "$HOME/.ssh/agent_env") +fi + diff --git a/README b/README index 84088f42..f93ce9f2 100644 --- a/README +++ b/README @@ -156,10 +156,8 @@ I've only been a casual Vim user, so do not expect too much from it. Known issues ************ -Emacs: some colors do not work as intended. - -Ranger: if editor is 'emacsclient -t -a ""', it will not show up if emacs daemon -is not running. This is because the "" are not properly recognized. +Emacs: some colors do not work as intended. MediaWiki fails to upload pages +after some idle time. Shell: some custom functions would need auto-completion.