Notes about open source software, computers, other stuff.

Month: February 2014

Fixing the compose key in Emacs on Ubuntu 13.10

After upgrading to Ubuntu 13.10 some time ago I noticed that my compose key (i.e. the key that you press followed by e.g. c and , to create a ç) didn’t work anymore in Emacs. I found two bug reports on this issue [1, 2], both effectively suggesting the same solution: start Emacs like this

XMODIFIERS=@im=none emacs

So I added the following line to my ~/.zshrc and ~/.bashrc files:

alias emacs='XMODIFIERS=@im=none emacs'

(of course somewhere before I set my EDITOR variable). I also changed the command in the launcher I use (GLX-Dock/Cairo-Dock).
This doesn’t make it a system-wide (or even user-wide) fix, e.g. the Firefox add-on “It’s all text” doesn’t get it, but it covers most of my use cases.

Related Images:

Configuring R

I took some time today to configure my R experience. I’m mostly using R from Emacs using ESS (Emacs Speaks Statistics), which means I had to configure some settings there as well.

Previously, my settings only consisted of setting a customised directory in which to install my packages and an alias to start R without asking for saving the histroy when quitting. This I did by setting the following environment variable in my .bashrc and/or .zshrc, as well as an alias:

# Set the library path for R
export R_LIBS_USER=${R_LIBS_USER}:~/Programmeren/R/lib
 
if [ -n "$(/usr/bin/which R 2>/dev/null)" ]; then
alias R="$(/usr/bin/which R) --no-save"
fi

However, Emacs didn’t pick up either of these variables, so high time to fix that. This meant creating two files with the following content:

~/.Rprofile:

# Set the default CRAN repository used by install.packages()
options("repos" = c(CRAN = "http://cran-mirror.cs.uu.nl/"))

~/.Renviron:

R_LIBS="~/Programmeren/R/lib"

I added the following to my .emacs file to start R with the --no-save option:

(setq inferior-R-args "--no-save ")

Additionally I have the following in there to turn on a spelling checker and have line-wraps enabled:

(add-hook 'ess-mode-hook
          (lambda ()
            ;; Set pdflatex as the default command for Sweave (default: texi2pdf)
            (setq ess-swv-pdflatex-commands (quote ("pdflatex"
                                                    "texi2pdf"
                                                    "make")))
            (auto-fill-mode t)
            (flyspell-prog-mode)
            ))

Related Images:

© 2024 Lennart's weblog

Theme by Anders NorénUp ↑