electric-pair-mode should not auto-pair single quotes (apostrophes) in strings or comments. In those scenarios, it's not possible to tell if the single quote is going to be part of a contraction or not, so the functionality should revert. In GNU Emacs 24.2.1 (i386-mingw-nt6.2.9200) of 2012-08-28 on MARVIN Windowing system distributor `Microsoft Corp.', version 6.2.9200 Configured using: `configure --with-gcc (4.6) --cflags -ID:/devel/emacs/libs/libXpm-3.5.8/include -ID:/devel/emacs/libs/libXpm-3.5.8/src -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include -ID:/devel/emacs/libs/giflib-4.1.4-1/include -ID:/devel/emacs/libs/jpeg-6b-4/include -ID:/devel/emacs/libs/tiff-3.8.2-1/include -ID:/devel/emacs/libs/gnutls-3.0.9/include' 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: ENU value of $XMODIFIERS: nil locale-coding-system: cp1252 default enable-multibyte-characters: t Major mode: PHP Minor modes in effect: global-auto-revert-mode: t show-paren-mode: t my-keys-minor-mode: t electric-pair-mode: t electric-indent-mode: t tooltip-mode: t mouse-wheel-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 column-number-mode: t line-number-mode: t transient-mark-mode: t abbrev-mode: t Recent input: C-x h M-w C-x C-s C-c C-k C-s c k - k C C-s c c C c C-s C-s C-s C-s C-s c o p y y C-s c o p y t - t h i s C-s C-s c o p y - l i n C-s C-s C-s C-s c o p y SPC t h i s SPC l i n - t h i s C-s C-a C-k C-x C-s C-s c - n C-s C-x b * s C-x h C-x h C-w / * * * / SPC T h i s SPC i s SPC a SPC c o m m e n t . * SPC H e r e SPC i s SPC a SPC s i n e l p o s i s e s i v e SPC w i t h SPC e l e c t i c SPC p a r i i r SPC m o d e SPC t u r n e d SPC o n : * SPC B o b ' s SPC s t u f f M-x r e p o r t - e m a c s - b u g Recent messages: Auto-saving... Mark saved where search started [4 times] byte-code: End of buffer [3 times] Mark saved where search started [2 times] Saving file c:/Users/Philip/AppData/Roaming/.emacs... Wrote c:/Users/Philip/AppData/Roaming/.emacs Mark saved where search started Mark set [2 times] Indenting region... done Mark set [2 times] Load-path shadows: ~/elisp/ispell hides c:/Program Files (x86)/emacs-24.2/lisp/textmodes/ispell c:/Program Files (x86)/emacs-24.2/site-lisp/ess/.dir-locals hides c:/Program Files (x86)/emacs-24.2/lisp/gnus/.dir-locals Features: (shadow sort mail-extr emacsbug sendmail rx php-mode speedbar sb-image ezimage dframe etags flymake compile comint ansi-color cc-langs cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs add-log regexp-opt thingatpt find-func autorevert misearch multi-isearch calc-menu calc calc-loaddefs calc-macs vc-git newcomment git-auto-commit-mode-autoloads git-commit-mode-autoloads magithub-autoloads finder-inf magit-autoloads info paren easy-mmode warnings advice help-fns advice-preload electric edmacro kmacro package tabulated-list ispell weblogger derived ring message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mailabbrev mail-utils gmm-utils mailheader xml-rpc cl timezone url-http tls url url-proxy url-privacy url-expand url-methods url-history mailcap url-auth mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-cookie url-util url-parse auth-source eieio byte-opt bytecomp byte-compile cconv macroexp assoc gnus-util password-cache url-gw url-vars mm-util mail-prsvr xml dvi-view time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32 disp-table ls-lisp w32-win w32-vars tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process multi-tty emacs)