Sorry for the long subject line, but I'm unsure if this is one bug or two. I've written an extensive post describing various test cases and outcomes on my blog (http://hholz.com/blog/2012/diagnosing-an-emacs-bug/). I've listed the minimal case to reproduce the bug(s?) in this bug report.
Starting with an empty .emacs file
1. M-x customize-apropos<RET>shell-switcher 2. set shell-switcher-new-shell-function to shell-switcher-make-shell set shell-switcher-mode to on click on Apply and Save
the above steps create a .emacs containing exactly
(custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(shell-switcher-mode t) '(shell-switcher-new-shell-function (quote shell-switcher-make-shell)) )
(custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. )
3. quit emacs. launch emacs (/Applications/Emacs.app/Contents/MacOS/Emacs) 4. M-x shell-switcher-new-shell (launches buffer in eshell) 5. M-x customize-apropos<RET>shell-switcher (flags both settings CHANGED outside Customize) 6. C-x C-f ~/.emacs (contents of .emacs is unchanged)
In GNU Emacs 24.1.50.2 (i386-apple-darwin11.4.0, NS apple-appkit-1138.47) of 2012-05-15 on jessica-2.local Windowing system distributor `Apple', version 10.3.1138 Configured using: `configure '--prefix=/usr/local/Cellar/emacs/HEAD' '--without-dbus' '--enable-locallisppath=/usr/local/share/emacs/site-lisp' '--infodir=/usr/local/Cellar/emacs/HEAD/share/info/emacs' '--with-ns' '--disable-ns-self-contained' 'CC=/usr/bin/clang' 'CFLAGS=-Os -w -pipe -march=native -Qunused-arguments''
Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil value of $XMODIFIERS: nil locale-coding-system: nil default enable-multibyte-characters: t
Major mode: Emacs-Lisp
Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t
Recent input: <help-echo> <help-echo> <escape> x s h e l l - s w i t c h e r - n e w - s h e l l <return> <escape> x c u s t o m i z e - a p r <tab> <return> s h e l l - s w i t c h e r <return> C-x C-f . e m a c s <return> <escape> x r e p o r t - e m a c s - b u g <return >