how to configure the way of inserting double quote in auctex with smartparens - emacs

recently I updated emacs package and found double quotes were not inserted as regular double quotes (") any more.
Instead, it insert pair of LaTeX double quotes `` and '' on ". On the second typing of ", it reverts to a single LaTeX double quote ``.
I would like to setup auctex and smartparens such that
make a pair of regular double quotes (") inserted, and return to a pair of LaTeX double quote on the second typing of ".
or
make a pair of regular double quotes (") inserted, and return to a single regular double quote on the second typing of ".
my emacs setup for smartparens and auctex is as follows:
(use-package smartparens
:ensure t
:init
(progn
(use-package smartparens-config)
(smartparens-global-mode t)
(show-smartparens-global-mode t)
)
:config
(progn
(setq smartparens-strict-mode t)
(sp-local-pair 'emacs-lisp-mode "'" nil :when '(sp-in-string-p))
)
(use-package tex
:ensure auctex
:init
(setq-default TeX-master nil)
(setq TeX-auto-save t) ;; Enable parse on load
(setq TeX-parse-self t) ;; Enable parse on save
(setq TeX-engine 'xetex)
(setq TeX-command-extra-options "-shell-escape")
(setq TeX-source-correlate-method 'synctex)
(setq TeX-source-correlate-mode t)
(setq TeX-quote-after-quote 1)
(setq reftex-plug-into-AUCTeX t)
(setq latex-preview-pane-enable t)
:config
(add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode) ; with AUCTeX LaTeX math mode
(add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode
(add-hook 'TeX-mode-hook '(lambda () (TeX-fold-mode 1)))
(add-hook 'TeX-mode-hook '(lambda () (outline-minor-mode 1)))
(add-hook 'TeX-mode-hook '(lambda () (TeX-PDF-mode 1)))
(add-hook 'TeX-mode-hook 'reftex-mode)
(add-hook 'LaTeX-mode-hook
(lambda ()
(define-key LaTeX-mode-map (kbd "<f10>") 'TeX-command-master)
(define-key LaTeX-mode-map (kbd "C-c `") 'TeX-error-overview)
))
)

Related

Deferred error when jedi:complete-on-dot

I get the following error when I try to use jedi:complete-on-dot:
deferred error : (error "Keyword argument :triggered not one of (:requires :force-init)")
I will note that Jedi is not the only issue I'm having with emacs python modes today. isort stopped working (I fixed this). M-x python also stopped working; it simply offers auto-complete suggestions instead of launching a shell (cannot fix this).
Things were working just fine on Monday. Today, they are not working. St
To fix this, I tried updating all of my packages in MELPA, but the issue persists. I'm running emacs 24.5. This was suggested
I realized that, for whatever reason, emacs is pulling Python 2.7, but I actually use Python 3.5. OSX won't let me remove Python 2, because it's used by the OS. To fix py-isort, I just had to install isort via pip outside my virtualenv. I thought the same thing might work for jedi; I installed the following packages again (this time outside my virtualenv):
jedi
rope
epc
argparse
I also ran M-x jedi:install-server and M-x jedi:setup. Unfortunately, I still get the error.
One thought I had for fixing this error is to point emacs to python 3.5, but I can't figure out how to do this.
So, again, this issue may not be directly related to jedi, but hopefully someone will be familiar enough with the whole pipeline to help out.
Additional info
output from M-x pop-to-epc-buffer immediately after error:
56439
jedi:show-setup-info
;; Emacs Lisp version:
(:emacs-version "24.5.1" :jedi-version "0.2.7" :python-environment-version "0.0.2alpha0")
;; Python version:
((:version "2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 12:54:16) \n[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]" :name "sys" :file nil)
(:version "0.9.0" :name "jedi" :file "/Users/alexhall/.emacs.d/.python-environments/default/lib/python2.7/site-packages/jedi/__init__.pyc")
(:version "0.0.5" :name "epc" :file "/Users/alexhall/.emacs.d/.python-environments/default/lib/python2.7/site-packages/epc/__init__.pyc")
(:version "0.0.3" :name "sexpdata" :file "/Users/alexhall/.emacs.d/.python-environments/default/lib/python2.7/site-packages/sexpdata.pyc"))
;; Command line:
(:virtualenv "/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv" :virtualenv-version "15.0.3\n")
;; Customization:
((jedi:complete-on-dot . t)
(jedi:doc-display-buffer . display-buffer)
(jedi:doc-hook view-mode)
(jedi:doc-mode . rst-mode)
(jedi:environment-root)
(jedi:environment-virtualenv)
(jedi:get-in-function-call-delay . 1000)
(jedi:get-in-function-call-timeout . 3000)
(jedi:goto-definition-config
(nil nil nil)
(t nil nil)
(nil definition nil)
(t definition nil)
(nil nil t)
(t nil t)
(nil definition t)
(t definition t))
(jedi:goto-definition-marker-ring-length . 16)
(jedi:imenu-create-index-function . jedi:create-nested-imenu-index)
(jedi:import-python-el-settings . t)
(jedi:install-imenu)
(jedi:install-python-jedi-dev-command "pip" "install" "--upgrade" "git+https://github.com/davidhalter/jedi.git#dev#egg=jedi")
(jedi:key-complete .
[C-tab])
(jedi:key-goto-definition .
[67108910])
(jedi:key-goto-definition-pop-marker .
[67108908])
(jedi:key-related-names . "r")
(jedi:key-show-doc . "d")
(jedi:server-args)
(jedi:server-command "/Users/alexhall/.emacs.d/.python-environments/default/bin/jediepcserver")
(jedi:setup-keys)
(jedi:tooltip-method pos-tip popup)
(jedi:use-shortcuts)
(python-environment-default-root-name . "default")
(python-environment-directory . "~/.emacs.d/.python-environments")
(python-environment-virtualenv "virtualenv" "--system-site-packages" "--quiet"))
My init.el
(only the subsection that I think is relevant)
;;Set up autocomplete
;;Autocomplete Config
(require 'auto-complete)
(require 'auto-complete-config)
(ac-config-default)
(global-auto-complete-mode t)
;;Add autocomplete for coding
(add-to-list 'load-path "~/emacsBackup/.emacs.d/general-tools/")
(add-to-list 'load-path "~/emacsBackup/.emacs.d/auto-complete-1.3.1")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-dict")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-clang")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-anaconda")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-helm")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-html")
;;Python Mode
;;(add-hook 'python-mode-hook 'py-autopep8-enable-on-save)
(add-hook 'python-mode-hook 'my-python-mode-hook)
(defun my-python-mode-hook ()
(rainbow-mode 1)
(anaconda-mode 1)
)
(elpy-enable)
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)
(require 'py-isort)
(add-hook 'before-save-hook 'py-isort-before-save)
;;iPython Notebook
(autoload 'ein "ein")
(require 'python-django)
;; enable autopep8 formatting on save
(require 'py-autopep8)
(add-hook 'python-mode-hook 'py-autopep8-enable-on-save)
The entirety of my messy init.el file (for completeness)
;-------;
; REPO ;
;-------;
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
;make sure the packages are installed; if not install them
(mapc
(lambda (package)
(or (package-installed-p package)
(package-install package)
)
)
'
; generated by C-h v package-activated-list
(ac-anaconda dash anaconda-mode f dash s s dash pythonic f dash s s dash auto-complete popup ac-clang yasnippet pos-tip auto-complete popup ac-helm popup auto-complete popup helm helm-core async popup async ac-html dash f dash s s auto-complete popup ample-theme ample-zen-theme anaconda-mode f dash s s dash pythonic f dash s s dash auctex auto-complete-clang auto-complete popup autopair better-defaults color-theme-sanityinc-tomorrow cuda-mode darkburn-theme ecb ein cl-generic request websocket elpy yasnippet pyvenv highlight-indentation find-file-in-project ivy company ergoemacs-mode undo-tree ergoemacs-status mode-icons powerline es-lib exec-path-from-shell find-file-in-project ivy flatland-black-theme flatland-theme flycheck seq let-alist pkg-info epl dash helm-descbinds helm helm-core async popup async highlight-indentation ivy jedi-direx direx jedi auto-complete popup jedi-core python-environment deferred epc ctable concurrent deferred json-rpc let-alist magit magit-popup dash async git-commit with-editor dash async dash with-editor dash async dash async magit-popup dash async markdown-mode+ markdown-mode markdown-mode matlab-mode mode-icons org php-mode pkg-info epl popup-complete popup pos-tip powerline pretty-lambdada py-autopep8 py-isort pydoc pydoc-info python-django python-environment deferred pythonic f dash s s dash pyvenv rainbow-mode request s scss-mode seq smex tidy undo-tree websocket with-editor dash async yasnippet zen-and-art-theme)
)
(defun set-exec-path-from-shell-PATH ()
"Sets the exec-path to the same value used by the user shell"
(let ((path-from-shell
(replace-regexp-in-string
"[[:space:]\n]*$" ""
(shell-command-to-string "$SHELL -l -c 'echo $PATH'"))))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
;; call function now
(set-exec-path-from-shell-PATH)
;; Enable line numbers in all files.
(global-linum-mode 1)
;; Enable IDO Mode
;; Increases Interactivity and ease of use
;; e.g. Autocomplete
(ido-mode 1)
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
;; Hide splash screen & banner
(setq inhibit-startup-message t
inhibit-startup-echo-area-message t)
;; Enable auto-indenting
(define-key global-map (kbd "RET") 'newline-and-indent)
;; Add new lines if using C-n at the end of the buffer
(setq next-line-add-newlines t)
;; Use Zenburn Theme
;; Theme must be stored in "~/emacsBackup/.emacs.d/themes"
;; Theme available # wikemacs.org/wiki/Zenburn-theme
(add-to-list 'custom-theme-load-path "~/emacsBackup/.emacs.d/themes/")
(load-theme 'zenburn t)
;; Add Solarized Theme
(add-to-list 'custom-theme-load-path "~/emacsBackup/.emacs.d/themes/emacs-color-theme-solarized")
;; Start with subword mode on
;; easier navigation of camelCase
(load "subword.el")
(global-subword-mode 1)
;; Turn on Visible Mark
(add-to-list 'load-path "~/emacsBackup/.emacs.d/general-tools/")
(load "visible-mark.el")
;; Load extra help commands
(load "help-fns+.el")
;; Turn on Whitespace Mode
(require 'whitespace)
(setq whitespace-style '(face lines-tail))
(global-whitespace-mode t)
(setq whitespace-global-modes '(c-mode c++-mode cuda-mode web-mode python-mode php-mode))
;; Enable Smart Scan Mode
;; Quickly search for identifier at current point
(load "smartscan.el")
(smartscan-mode 1)
;;Store all backup files in C:/Temp
(setq backup-directory-alist
`((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
`((".*" ,temporary-file-directory t)))
(put 'set-goal-column 'disabled nil)
;;Swap Windows & Frames quickly
(setq windmove-wrap-around t)
(global-set-key (kbd "M-s M-f") 'windmove-up)
(global-set-key (kbd "M-s M-s") 'windmove-down)
(global-set-key (kbd "M-s M-r") 'windmove-left)
(global-set-key (kbd "M-s M-t") 'windmove-right)
(global-set-key (kbd "M-s M-c") 'other-frame)
(global-set-key (kbd "<Shift-up>") 'windmove-up)
(global-set-key (kbd "<Shift-down>") 'windmove-down)
(global-set-key (kbd "<Shift-left>") 'windmove-left)
(global-set-key (kbd "<Shift-right>") 'windmove-right)
;;Set up Web-Mode for syntax highlighting
(add-to-list 'load-path "~/emacsBackup/.emacs.d/syntax-modes/")
(require 'web-mode)
(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.html\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.js\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.[gj]sp\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.vtl\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.php\\'" . php-mode));; Set PHP-Mode for php files.
(add-to-list 'auto-mode-alist '("\\.cu$" . cuda-mode))
(add-to-list 'auto-mode-alist '("\\.upc$" . c++-mode))
(add-hook 'web-hook 'my-web-mode-hook)
(setq-default rainbow-mode 1)
(setq django-indent-width 4)
;;Display tabs as 4 spaces.
(setq-default tab-width 4)
(defvaralias 'c-basic-offset 'tab-width)
(defvaralias 'cperl-indent-level 'tab-width)
;;Next line moves to next ACTUAL line
;;ignores word wrap
(setq line-move-visual 'nil)
(define-key minibuffer-local-map "\M-s" nil)
(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.
'(ansi-color-names-vector ["#3F3F3F" "#CC9393" "#7F9F7F" "#F0DFAF" "#8CD0D3" "#DC8CC3" "#93E0E3" "#DCDCCC"])
'(ansi-term-color-vector [unspecified "#393939" "#f2777a" "#99cc99" "#ffcc66" "#6699cc" "#cc99cc" "#6699cc" "#e8e6df"])
'(background-color "#002b36")
'(background-mode dark)
'(cursor-color "#839496")
'(custom-safe-themes (quote ("769bb56fb9fd7e73459dcdbbfbae1f13e734cdde3cf82f06a067439568cdaa95" "06f0b439b62164c6f8f84fdda32b62fb50b6d00e8b01c2208e55543a6337433a" "4eaad15465961fd26ef9eef3bee2f630a71d8a4b5b0a588dc851135302f69b16" "2b5aa66b7d5be41b18cc67f3286ae664134b95ccc4a86c9339c886dfd736132d" "ed81411169b1b3e3d4cfc39b09d68ea13e0ff7708dc5b9d0bedb319e071968ad" "51bea7765ddaee2aac2983fac8099ec7d62dff47b708aa3595ad29899e9e9e44" "978ff9496928cc94639cb1084004bf64235c5c7fb0cfbcc38a3871eb95fa88f6" "fc5fcb6f1f1c1bc01305694c59a1a861b008c534cae8d0e48e4d5e81ad718bc6" "17034e7e911c6dced02ff9ed23bae2967b94f2585a7c942afbfae936b9e40a61" "9bac44c2b4dfbb723906b8c491ec06801feb57aa60448d047dbfdbd1a8650897" "e53cc4144192bb4e4ed10a3fa3e7442cae4c3d231df8822f6c02f1220a0d259a" default)))
'(fci-rule-color "#383838")
'(foreground-color "#839496")
'(vc-annotate-background "#2B2B2B")
'(vc-annotate-color-map (quote ((20 . "#BC8383") (40 . "#CC9393") (60 . "#DFAF8F") (80 . "#D0BF8F") (100 . "#E0CF9F") (120 . "#F0DFAF") (140 . "#5F7F5F") (160 . "#7F9F7F") (180 . "#8FB28F") (200 . "#9FC59F") (220 . "#AFD8AF") (240 . "#BFEBBF") (260 . "#93E0E3") (280 . "#6CA0A3") (300 . "#7CB8BB") (320 . "#8CD0D3") (340 . "#94BFF3") (360 . "#DC8CC3"))))
'(vc-annotate-very-old-color "#DC8CC3"))
(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.
)
;;SET UP ORG MODE
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
;;Define Default Workflow States
(setq org-todo-keywords
'((sequence "TODO" "NOW" "DONE")))
;; set key for agenda
(define-key global-map "\C-cl" 'org-store-link)
(global-set-key (kbd "C-c a") 'org-agenda)
(setq org-log-done t)
;;file to save todo items
(setq org-agenda-files (quote ("~/org/todo.org" "~/Documents/filmGrammar/todo.org")))
;;set priority range from A to C with default A
(setq org-highest-priority ?A)
(setq org-lowest-priority ?C)
(setq org-default-priority ?A)
;;set colours for priorities
(setq org-priority-faces '((?A . (:foreground "#F0DFAF" :weight bold))
(?B . (:foreground "LightSteelBlue"))
(?C . (:foreground "OliveDrab"))))
;;open agenda in current window
(setq org-agenda-window-setup (quote current-window))
;;capture todo items using C-c c t
(define-key global-map (kbd "C-c c") 'org-capture)
(setq org-capture-templates
'(("t" "Todo" entry (file+headline "~/org/todo.org" "Tasks")
"* TODO [#B] %? :%^{Tags}:\n:Created: %U\n" ; template
:prepend t ; properties
:empty-lines 1 ; properties
:created t ; properties
)
("j" "Journal" entry (file+datetree "~/org/journal.org")
"* %?"
:empty-lines 1)
("n" "Note" entry (file+headline "~/org/notes.org" "Notes")
"* %?\nEntered on %U\n %i\n %a")
("f" "filmgrammar todo" entry (file+headline "~/Documents/filmGrammar/todo.org" "Tasks")
"* TODO [#B] %? :%^{Tags}:filmgrammar:ucb:research:code:work:\n:Created: %U\n" ; template
:prepend t ; properties
:empty-lines 1 ; properties
:created t ; properties
)
))
(add-hook 'org-mode-hook
(lambda ()
(org-indent-mode t))
t)
(add-hook 'org-mode-hook 'visual-line-mode)
(add-hook 'org-agenda-mode-hook
(lambda ()
(visual-line-mode -1)
(toggle-truncate-lines 1)))
;;Mac key rebinds
(setq mac-option-modifier 'control)
(setq mac-command-modifier 'meta)
(setq mac-control-modifier 'super)
;;Set up autocomplete
;;Autocomplete Config
(require 'auto-complete)
(require 'auto-complete-config)
(ac-config-default)
(global-auto-complete-mode t)
;;Add autocomplete for coding
(add-to-list 'load-path "~/emacsBackup/.emacs.d/general-tools/")
(add-to-list 'load-path "~/emacsBackup/.emacs.d/auto-complete-1.3.1")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-dict")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-clang")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-anaconda")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-helm")
(add-to-list 'ac-dictionary-directories "~/emacsBackup/.emacs.d/general-tools/ac-html")
;;Python Mode
;;(add-hook 'python-mode-hook 'py-autopep8-enable-on-save)
(add-hook 'python-mode-hook 'my-python-mode-hook)
(defun my-python-mode-hook ()
(rainbow-mode 1)
(anaconda-mode 1)
)
(elpy-enable)
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)
(require 'py-isort)
(add-hook 'before-save-hook 'py-isort-before-save)
;;iPython Notebook
(autoload 'ein "ein")
(require 'python-django)
;; enable autopep8 formatting on save
(require 'py-autopep8)
(add-hook 'python-mode-hook 'py-autopep8-enable-on-save)
(require 'cc-mode)
;; AucTeX
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
(add-hook 'LaTeX-mode-hook 'visual-line-mode)
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-AUCTeX t)
(setq TeX-PDF-mode t)
;; Use Skim as viewer, enable source <-> PDF sync
;; make latexmk available via C-c C-c
;; Note: SyncTeX is setup via ~/emacsBackup/.latexmkrc (see below)
(add-hook 'LaTeX-mode-hook (lambda ()
(push
'("latexmk" "latexmk -pdf %s" TeX-run-TeX nil t
:help "Run latexmk on file")
TeX-command-list)))
(add-hook 'TeX-mode-hook '(lambda () (setq TeX-command-default "latexmk")))
;; use Skim as default pdf viewer
;; Skim's displayline is used for forward search (from .tex to .pdf)
;; option -b highlights the current line; option -g opens Skim in the background
(setq TeX-view-program-selection '((output-pdf "PDF Viewer")))
(setq TeX-view-program-list
'(("PDF Viewer" "/Applications/Skim.app/Contents/SharedSupport/displayline -b -g %n %o %b")))
;;Markdown Mode
(autoload 'markdown-mode "markdown-mode"
"Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
;; display “lambda” as “λ”
(global-prettify-symbols-mode 1)
(electric-pair-mode +1)
(setq electric-pair-pairs '(
(?\" . ?\")
(?\{ . ?\})
) )
(add-hook
'web-mode-hook
'(lambda ()
(setq web-mode-enable-auto-pairing nil)
(setq-local
electric-pair-pairs
(append electric-pair-pairs '((?% . ?%))))))
;;tell tramp to use ssh
(setq tramp-default-method "ssh")
;;Activate up and down transposing
(defun move-line-up ()
(interactive)
(transpose-lines 1)
(forward-line -2))
(defun move-line-down ()
(interactive)
(forward-line 1)
(transpose-lines 1)
(forward-line -1)
)
(global-set-key (kbd "<M-down>") 'move-line-down)
(global-set-key (kbd "<M-up>") 'move-line-up)
;; Force frame to 80 column width
(defun set-window-width (n)
"Set the selected window's width."
(adjust-window-trailing-edge (selected-window) (- n (window-width)) t))
(defun set-80-columns ()
"Set the selected window to 80 columns."
(interactive)
(set-window-width 80))
(global-set-key "\C-x~" 'set-80-columns)
(setq debug-on-error t)
;; Adapted From Better Defaults.el
(unless (fboundp 'helm-mode)
(ido-mode t)
(setq ido-enable-flex-matching t))
(menu-bar-mode -1)
(when (fboundp 'tool-bar-mode)
(tool-bar-mode -1))
(when (fboundp 'scroll-bar-mode)
(scroll-bar-mode -1))
(when (fboundp 'horizontal-scroll-bar-mode)
(horizontal-scroll-bar-mode -1))
(autoload 'zap-up-to-char "misc"
"Kill up to, but not including ARGth occurrence of CHAR." t)
(require 'uniquify)
(setq uniquify-buffer-name-style 'forward)
(require 'saveplace)
(setq-default save-place t)
(global-set-key (kbd "M-/") 'hippie-expand)
(global-set-key (kbd "C-x C-b") 'ibuffer)
(global-set-key (kbd "M-z") 'zap-up-to-char)
(global-set-key (kbd "C-s") 'isearch-forward-regexp)
(global-set-key (kbd "C-r") 'isearch-backward-regexp)
(global-set-key (kbd "C-M-s") 'isearch-forward)
(global-set-key (kbd "C-M-r") 'isearch-backward)
(show-paren-mode 1)
(setq x-select-enable-clipboard t
x-select-enable-primary t
save-interprogram-paste-before-kill t
apropos-do-all t
mouse-yank-at-point t
require-final-newline t
visible-bell nil
load-prefer-newer t
ediff-window-setup-function 'ediff-setup-windows-plain
save-place-file (concat user-emacs-directory "places")
backup-directory-alist `(("." . ,(concat user-emacs-directory
"backups"))))
;;; better-defaults.el ends here
It version missmatch between emacs jedi package and JEDI library.
For jedi-version "0.2.8" it require:
pip install jedi==0.17.2

emacs global-set-key M-, seems to be overridden and does not work after upgrading some packages in emacs

Here is my .emacs content. Can someone please help.
(global-set-key (kbd "M-,") 'pop-tag-mark)
(setq projecthome "/tmp/myproject")
(add-hook 'ess-mode-hook
(lambda ()
(let ((ess-build-tags-command "rtags('%s', recursive = TRUE, pattern = '\\\\.[RrSs](rw)?$',ofile = '%s')")
(my-tags-file (concat projecthome "/R/TAGS")))
(ess-build-tags-for-directory (concat projecthome "/R/") (concat projecthome "/R/TAGS"))
(sleep-for 5)
(visit-tags-table my-tags-file)
)))

emacs latex hooks not running

So for some reason some of my hooks for latex mode with auctex in emacs refuse to run but give no errors (at least none I can see in messages buffer). This is most of the stuff in my .emacs about latex (other than some keyword definitions, etc...). I'm running Emacs24.2 on Arch Linux with the latest version of auctex as well. Been wrestling with this for a while now and as far as I can remember this used to work just fine until today I noticed that flyspell and auto fill weren't being set automatically (has probably been happening for a while at this rate since I haven't use auctex in a while).
(add-to-list 'load-path "~/Dropbox/Emacs/")
(add-to-list 'load-path "~/Dropbox/Emacs/git/")
(add-to-list 'load-path "~/Dropbox/Emacs/magit/")
(add-to-list 'load-path "~/Dropbox/Emacs/GLSL/")
;; auto-complete
(require 'auto-complete)
(require 'auto-complete-config)
(require 'auto-complete-clang)
(ac-flyspell-workaround)
(add-to-list 'ac-modes 'LaTeX-mode)
(ac-config-default)
(setq ac-quick-help-delay 0)
(define-key ac-mode-map [(control tab)] 'auto-complete)
(setq-default ac-sources
'(ac-source-abbrev ac-source-dictionary
ac-source-words-in-same-mode-buffers))
(global-auto-complete-mode t)
(add-hook 'emacs-lisp-mode-hook
(lambda ()
(add-to-list 'ac-sources 'ac-source-symbols 'ac-source-variables)))
(defun add-sources-c-modes ()
(add-to-list 'ac-sources 'ac-source-semantic 'ac-source-clang))
(add-hook 'c-mode-hook 'add-sources-c-modes)
(add-hook 'c++-mode-hook 'add-sources-c-modes)
(define-key ac-completing-map "\C-n" 'ac-next)
(define-key ac-completing-map "\C-p" 'ac-previous)
;; DocView
(setq doc-view-continuous t)
(setq doc-view-resolution 300)
;; diff mode colors
(eval-after-load 'diff-mode
'(progn
(set-face-foreground 'diff-added "green")
(set-face-foreground 'diff-header "purple")
(set-face-foreground 'diff-removed "red")))
;; dired colors
(eval-after-load 'dired-mode
'(progn
(set-face-foreground 'dired-directory "cyan")
(set-face-foreground 'dired-flagged "red")
(set-face-foreground 'dired-header "purple")))
;; server mode
;; (server-start)
;; GLSL
(autoload 'glsl-mode "glsl-mode" nil t)
(add-to-list 'auto-mode-alist '("\.vert\'" . glsl-mode))
(add-to-list 'auto-mode-alist '("\.frag\'" . glsl-mode))
;; Git / SVN
(require 'git)
(require 'git-blame)
;; Emacs Code Browser / CEDET
;; (require 'cedet)
;; (require 'ecb)
;; (setq ecb-options-version "2.40")
;; Close scratch buffer on startup
(defun close-scratch-hook ()
(kill-buffer "scratch"))
(add-hook 'emacs-startup-hook 'close-scratch-hook)
;; LaTeX/Auctex settings
(require 'ac-math)
(defun ac-latex-mode-setup ()
(add-to-list 'ac-sources 'ac-source-math-unicode 'ac-source-math-latex
'ac-source-latex-commands))
(add-hook 'LaTeX-mode-hook 'latex-math-mode)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(add-hook 'text-mode-hook 'auto-fill-mode)
(add-hook 'LaTeX-mode-hook 'turn-on-flyspell)
(add-hook 'LaTeX-mode-hook 'ac-latex-mode-setup)
(add-hook 'LaTeX-mode-hook
(lambda ()
(set-face-foreground 'font-latex-sedate-face "cyan")))
(setq reftex-plug-into-AUCTeX t)
(setq font-latex-match-slide-title-keywords (quote (("frametitle" "{"))))
(setq font-latex-match-warning-keywords (quote ("hline" "pause" "and" "hfill")))
(setq font-latex-match-function-keywords
(quote
(("titlepage" "") ("maketitle" "") ("frame" "") ("tableofcontents" "")
("noindent" "") ("usetheme" "{") ("usecolortheme" "{") ("institute" "[{")
("includegraphics" "[{") ("title" "[{") ("href" "{{") ("url" "{") ("hypersetup" "{")
("useoutertheme" "{") ("useinnertheme" "{") ("setbeamercolor" "{{")
("setbeamertemplate" "{{") ("setdescription" "{") ("lstset" "{") ("lstinputlisting" "[{")
("textcolor" "{") ("verbatiminput" "{") ("graphicspath" "{")
("fancyhead" "[{") ("fancyfoot" "[{") ("fontsize" "{{") ("doublespacing" ""))))
;; Line numbers
(require 'linum)
(global-linum-mode t)
;; Disable line numbers in certain buffers
(defcustom linum-disabled-modes-list '(eshell-mode wl-summary-mode compilation-mode org-mode dired-mode)
"* List of modes disabled when global linum mode is on"
:type '(repeat (sexp :tag "Major mode"))
:tag " Major modes where linum is disabled: "
:group 'linum)
(defcustom linum-disable-starred-buffers 't
"* Disable buffers that have stars in them like Gnu Emacs"
:type 'boolean
:group 'linum)
(defun linum-on ()
"* When linum is running globally, disable line number in modes defined in `linum-disabled-modes-list'. Changed by linum-off. Also turns off numbering in starred modes like scratch"
(unless (or (minibufferp) (member major-mode linum-disabled-modes-list)
(and linum-disable-starred-buffers (string-match "*" (buffer-name))))
(linum-mode 1)))
;; Basic emacs settings
(setq initial-scratch-buffer nil)
(setq inhibit-splash-screen t)
(setq inhibit-startup-message t)
(setq-default truncate-lines t)
(setq backup-inhibited t)
(setq auto-save-default nil)
(setq compilation-scroll-output t)
(if (boundp 'scroll-bar-mode) (scroll-bar-mode -1))
(column-number-mode 1)
(setq-default fill-column 80)
(setq auto-fill-mode 1)
(if (boundp 'tool-bar-mode) (tool-bar-mode 0))
(set-face-attribute 'default nil :height 100)
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(global-auto-revert-mode t)
(setq frame-title-format "%b")
;; cscope
(require 'xcscope)
(setq cscope-do-not-update-database t)
;; Enable these to speed up compiler output
;; (setq compilation-error-regexp-alist nil)
;; (setq compilation-error-regexp-alist-alist nil)
;; Indentation rules
(setq c-default-style "bsd" c-basic-offset 4)
(c-set-offset 'case-label '+)
(setq sgml-basic-offset 4)
(setq python-indent 4)
(setq indent-tabs-mode nil)
(setq tab-always-indent t)
(setq tab-width 4)
(setq tab-stop-list (quote (4 8 12 16 20 24 28 32 36 40 44 48 52
56 60 64 68 72 76 80 84 88 92 96
100 104 108 112 116 120)))
;; highlight matching parentheses
(show-paren-mode 1)
(setq show-paren-delay 0)
;; highlight current line
(global-hl-line-mode 1)
(set-face-background 'hl-line "#300")
;; C-Sharp mode
;; (require 'cc-mode)
;; (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
;; (add-to-list 'auto-mode-alist '("\.cs$" . csharp-mode))
;; Change the color scheme
(require 'color-theme)
(color-theme-initialize)
(color-theme-midnight)
;; Make ENTER automatically indent in C derived buffers
(add-hook 'c-mode-common-hook
(lambda ()
(local-set-key (kbd "RET") 'newline-and-indent)))
;; Enable terminal colors
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
;; Hotkeys
(global-set-key [f9] 'compile)
;; Emacs IRC
(setq erc-auto-query 'buffer)
;; assembly mode
(add-hook 'asm-mode-hook
(lambda ()
(local-set-key (kbd "RET") 'newline)))
;; change default Browser
(setq browse-url-generic-program (executable-find "chromium")
browse-url-browser-function 'browse-url-generic)
;; multi-term
(require 'multi-term)
;; yasnippet work around
;; (add-hook 'change-major-mode-hook 'yas/exit-all-snippets)
;; develock
(require 'develock)
My guess is that you launch auto-complete-mode before you add LaTeX-mode to ac-modes.
To know what is happening for sure, we need to see the whole .emacs or a minimal example having the same problem.
By the way your ac-latex-mode-setup is doing nothing because when it is called it just defines a lambda (anonymous function) that will never be used. You need to change it to the following if you want your code to be executed:
(defun ac-latex-mode-setup () ; add ac-sources to default ac-sources
(setq ac-sources
(append '(ac-source-math-unicode ac-source-math-latex ac-source-latex-commands)
ac-sources))
)
The progn you use is also doing nothing. progn allows you to chain multiple instructions and you only use one. You can progn for clarity as follows:
(eval-after-load 'LaTeX-mode
'(set-face-foreground 'font-latex-sedate-face "cyan"))
Stefan has a point with using package-install. This is the preferred way and it works amazingly well. And as a side note you should never use load. Always use require or eval-after-load.
AFAIK, there is no auctex.el. The file to load for AUCTeX in tex-site, IIRC. You may actually prefer to install AUCTeX via M-x package-install RET which will take care of that for you.

emacs 24.x Recursive 'require' for feature 'magit-simple-keys'

I've just upgraded my whole distro and I'm trying to setup my emacs with my previous settings and when using my 'magit' plugin and typing 'M-x magit-status' I get the following error:
Recursive `require' for feature `magit-simple-keys'
Here is my config (.emacs.d/init.el)
(require 'package)
(add-to-list 'package-archives '("elpa" . "http://tromey.com/elpa/"))
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(package-initialize)
(setq required-packages
(list 'mwe-log-commands 'drag-stuff 'flymake-ruby 'flymake-haml 'regex-tool 'mic-paren 'highline 'android-mode 'css-mode 'csv-mode 'apache-mode 'crontab-mode 'emms 'switch-window 'multi-term 'undo-tree 'rvm 'auto-complete 'yasnippet-bundle 'ruby-electric 'rinari 'inf-ruby 'coffee-mode 'yaml-mode 'feature-mode 'scss-mode 'haml-mode 'magit-simple-keys))
(dolist (package required-packages)
(when (not (package-installed-p package))
(package-refresh-contents)
(package-install package)))
;; Setup external directory variable
(setq elisp-dir
(expand-file-name "elisp" user-emacs-directory))
(setq elisp-external-dir
(expand-file-name "external" elisp-dir))
;; Add external projects to load path
(add-to-list 'load-path elisp-external-dir)
(dolist (project (directory-files elisp-external-dir t "\\w+"))
(when (file-directory-p project)
(add-to-list 'load-path project)))
; Keybinding
(global-set-key [f1] 'twit)
(global-set-key [f2] 'gist-region-or-buffer)
(global-set-key [f3] 'switch-window)
(global-set-key [f4] 'magit-display-log)
(global-set-key [f5] 'magit-status)
(global-set-key [f6] 'multi-term)
(global-set-key [f7] 'split-window-vertically)
(global-set-key [f8] 'next-multiframe-window)
;; f9 is taken by git-status somewhere.
(global-set-key [f10] 'undo-tree-visualize)
(global-set-key [f12] 'switch-full-screen)
(global-set-key (kbd "C-x f") 'rinari-find-file-in-project)
(global-set-key (kbd "C-x g") 'rinari-rgrep)
(global-set-key (kbd "C-c I") 'irc)
;fullscreen mode
(defun switch-full-screen ()
(interactive)
(shell-command "wmctrl -r :ACTIVE: -btoggle,fullscreen"))
;; Allow using mouse thumb button to browse URLs
(global-set-key [mouse-10] 'browse-url-at-mouse)
; stop emacs from contaminating each directory with semantic.cache
(setq semanticdb-default-save-directory "/tmp")
; General settings
(setq-default tab-width 4)
(menu-bar-mode 1) ;; enable the menu bar
(tool-bar-mode -1) ; Disable tool-bar
(display-battery-mode)
(setq column-number-mode t)
(display-time)
(setq backup-inhibited t) ;; disable backup
;; Org-mode options
(add-hook 'org-mode-hook 'turn-on-visual-line-mode)
;; (add-hook 'org-mode-hook 'my-org-mode-autosave-settings)
;; (defun my-org-mode-autosave-settings ()
;; (set (make-local-variable 'auto-save-visited-file-name) t)
;; (setq auto-save-interval 20))
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(setq org-agenda-files '("~/Dropbox/org/"))
(setq org-directory "~/Dropbox/org")
(setq org-mobile-inbox-for-pull "~/Dropbox/org/inbox.org");; new notes will be stored here
(setq org-support-shift-select t)
(setq org-mobile-directory "~/Dropbox/MobileOrg") ;; Set to <your Dropbox root directory>/MobileOrg.
;; Set color
(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.
'(default ((t (:inherit nil :stipple nil :background "black" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))))
; Auto complete settings
(setq hippie-expand-try-functions-list
'(try-complete-abbrev
try-complete-file-name
try-expand-dabbrev))
; -------------------- Custom Settings --------------------
(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.
'(column-number-mode t)
'(display-battery-mode t)
'(display-time-mode t)
'(ecb-options-version "2.32")
'(inhibit-startup-screen t)
'(org-agenda-files (quote ("~/Dropbox/org")) t)
'(rails-ws:default-server-type "mongrel")
'(send-mail-function (quote smtpmail-send-it))
'(smtpmail-smtp-server "smtp.googlemail.com")
'(smtpmail-smtp-service "smtp")
'(tool-bar-mode nil)
'(tooltip-mode nil))
; -------------------- File plugins --------------------
; Interactively Do Things
(ido-mode t)
; tramp - remote ssh editing
(require 'tramp)
(setq tramp-default-method "ssh")
; -------------------- Rails setting files --------------------
(require 'yaml-mode)
(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
; -------------------- Rails minor plugin --------------------
(setq x-select-enable-clipboard t)
(setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
;; https://github.com/remvee/emacs-rails
;; Currently this interfers with auto complete, using rinari instead
;; automatically adds end to blocks.
(require 'rails)
;; Rinari - Rails plugin
(add-to-list 'load-path "~/.emacs.d/rinari/")
(require 'rinari)
(add-hook 'ruby-mode-hook
(lambda ()
(defadvice ruby-mode-set-encoding
(around ruby-mode-set-encoding-disable activate) nil)))
; -------------------- Rails Views --------------------
; haml-sass
(require 'haml-mode nil 't)
(add-hook 'haml-mode-hook
'(lambda () (setq tab-width 2)))
(setq scss-compile-at-save nil)
; stylesheets
(autoload 'css-mode "css-mode")
(setq auto-mode-alist (cons '("\\.css\\'" . css-mode) auto-mode-alist))
; html2haml function to convert current buffer to haml
(defun haml-ify ()
"run html2haml on current buffer"
(interactive)
(setf filename buffer-file-name)
(setf newfilename (concat filename ".haml"))
(save-buffer)
(shell-command (concat
"html2haml " filename " > " newfilename))
(kill-buffer (current-buffer))
(delete-file filename)
(find-file newfilename))
;; -------------------- Rails Testing --------------------
;; Cucumber
(require 'feature-mode)
;; -------------------- Rails Tools --------------------
;; Check out abbrev-mode instead as it seems lighter.
(require 'snippet)
;; -------------------- Ruby plugins --------------------
(add-to-list 'auto-mode-alist '("Capfile" . ruby-mode))
(add-to-list 'auto-mode-alist '("Gemfile" . ruby-mode))
(add-to-list 'auto-mode-alist '("Rakefile" . ruby-mode))
(add-to-list 'auto-mode-alist '("god" . ruby-mode))
(add-to-list 'auto-mode-alist '("Guardfile" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rake\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rb\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.ru\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.html.erb\\'" . html-mode))
(add-to-list 'auto-mode-alist '("\\.ejs\\'" . html-mode))
(add-to-list 'auto-mode-alist '("\\.eco\\'" . html-mode))
(add-to-list 'auto-mode-alist '("\\.hamlc\\'" . haml-mode))
;; Ruby-electric
(require 'ruby-electric)
(add-hook 'ruby-mode-hook 'ruby-electric-mode)
;; Issues under some compiles of emacs
;; (require 'ruby-electric)
;; (add-hook 'ruby-mode-hook
;; (lambda()
;; (add-hook 'local-write-file-hooks
;; '(lambda()
;; (save-excursion
;; (untabify (point-min) (point-max))
;; ;(delete-trailing-whitespace)
;; )))
;; (set (make-local-variable 'indent-tabs-mode) 'nil)
;; (set (make-local-variable 'tab-width) 2)
;; (imenu-add-to-menubar "IMENU")
;; (require 'ruby-electric)
;; (ruby-electric-mode t)))
;; Inferior Ruby Mode
(autoload 'inf-ruby "inf-ruby" "Run an inferior Ruby process" t)
(autoload 'inf-ruby-keys "inf-ruby" "" t)
(eval-after-load 'ruby-mode '(add-hook 'ruby-mode-hook 'inf-ruby-keys))
;; -------------------- SQL --------------------
(defun my-sql-interactive-mode-hook ()
(setq tab-width 8))
(add-hook 'sql-interactive-mode-hook 'my-sql-interactive-mode-hook)
(require 'sql)
(put 'upcase-region 'disabled nil)
;; -------------------- Autocomplete --------------------
;; Use with Rsense for Ruby autocomplete:
;; http://cx4a.org/software/rsense/
;; Follow instructions on: http://itstickers.blogspot.com/2010/11/all-about-emacs.html
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(ac-config-default)
;; Rsense
(setq rsense-home "/opt/rsense-0.3")
(add-to-list 'load-path (concat rsense-home "/etc"))
(require 'rsense)
;; Rsense + Autocomplete
(add-hook 'ruby-mode-hook
(lambda ()
(add-to-list 'ac-sources 'ac-source-rsense-method)
(add-to-list 'ac-sources 'ac-source-rsense-constant)))
;; Complete by C-c .
(add-hook 'ruby-mode-hook
(lambda ()
(local-set-key (kbd "C-c .") 'rsense-complete)))
;; RVM in emacs
;; (require 'rvm)
;; (rvm-use-default) ;; use rvm’s default ruby for the current Emacs session
;; Switch windows easier when you have 3 or more.
(require 'switch-window)
;; gist
(require 'gist)
(setq gist-authentication-function 'gist-basic-authentication)
(setq the-secrets-file
(expand-file-name "secrets.el" user-emacs-directory))
(when (file-exists-p the-secrets-file)
(load the-secrets-file))
;; highline-mode
(require 'highline)
(defun highline-mode-on ()
(highline-mode 1))
;; Turn on local highlighting for Dired (C-x d)
(add-hook 'dired-after-readin-hook #'highline-mode-on)
;; Turn on local highlighting for list-buffers (C-x C-b)
(defadvice list-buffers (after highlight-line activate) (save-excursion (set-buffer "*Buffer List*") (highline-mode-on)))
;; mic-paren - advanced highlighting of matching parentheses
(paren-activate)
;; flyspell
(add-hook 'org-mode-hook
(lambda ()
(flyspell-mode)
(setq flyspell-issue-message-flag 'nil)))
(add-hook 'ruby-mode-hook
(lambda ()
(flyspell-prog-mode)
(setq flyspell-issue-message-flag 'nil)))
;; flymake haml
(add-hook 'haml-mode-hook 'flymake-haml-load)
;; undo
(add-hook 'ruby-mode-hook 'undo-tree-mode)
;; multi-term
;; (setq term-default-fg-color "#aaa")
;; Upgrade all packages
(defun package-update-all ()
"Update all packages"
(interactive)
(dolist (elt package-alist)
(let* ((name (car elt))
(file-name (symbol-name name))
(available-pkg (assq name package-archive-contents))
(available-version (and available-pkg
(package-desc-vers (cdr available-pkg))))
(current-version (package-desc-vers (cdr elt)))
)
(when (and available-version
(version-list-< current-version available-version))
(message "Updating to: %s - %s" file-name
(package-version-join available-version))
(package-install name)
(package-delete file-name (package-version-join current-version))))))
;; Music player
(add-to-list 'load-path "~/.emacs.d/elisp/external/bongo")
(setq bongo-global-lastfm-mode t)
(autoload 'bongo "bongo"
"Start Bongo by switching to a Bongo buffer." t)
;; Volume manager (Use 'v' in bongo music player)
(add-to-list 'load-path "~/.emacs.d/elisp/external/volume-el")
(autoload 'volume "volume"
"Tweak your sound card volume." t)
;; Twitter mode
(add-to-list 'load-path "~/.emacs.d/elisp/external/twitter-mode")
(require 'twittering-mode)
(setq twittering-icon-mode t)
(setq twittering-timer-interval 40)
(setq twittering-url-show-status nil)
(add-hook 'twittering-edit-mode-hook (lambda () (ispell-minor-mode) (flyspell-mode)))
(setq twittering-use-master-password t) ;; Don't prompt for authorisation.
;; drag-stuff
(require 'drag-stuff)
;; coffee-mode
(defun coffee-custom ()
"coffee-mode-hook"
(set (make-local-variable 'tab-width) 2))
;; (define-key coffee-mode-map [(meta r)] 'coffee-compile-buffer)
;; (define-key coffee-mode-map [(meta R)] 'coffee-compile-region)
(add-hook 'coffee-mode-hook
'(lambda() (coffee-custom)))
;; Don't ask to save abbrevs
(setq save-abbrevs 'silently)
;; log commands.
;; M-x mwe:open-command-log-buffer
(add-hook 'LaTeX-mode-hook (function mwe:log-keyboard-commands))
;; screensaver
(setq zone-when-idle t)
;; IRC reconnect
(eval-after-load 'rcirc
'(defun-rcirc-command reconnect (arg)
"Reconnect the server process."
(interactive "i")
(unless process
(error "There's no process for this target"))
(let* ((server (car (process-contact process)))
(port (process-contact process :service))
(nick (rcirc-nick process))
channels query-buffers)
(dolist (buf (buffer-list))
(with-current-buffer buf
(when (eq process (rcirc-buffer-process))
(remove-hook 'change-major-mode-hook
'rcirc-change-major-mode-hook)
(if (rcirc-channel-p rcirc-target)
(setq channels (cons rcirc-target channels))
(setq query-buffers (cons buf query-buffers))))))
(delete-process process)
(rcirc-connect server port nick
rcirc-default-user-name
rcirc-default-full-name
channels))))
;; Video editor
;; (load "~/.emacs.d/elisp/external/gneve.el")
The problem was I only need to install 'magit not 'magit-simple-keys.
I am going to guess that you need to update one or other of magit and magit-simple-keys (and you might as well do both).
I can see that you are installing magit-simple-keys via package.el, but not magit itself, so you might want to source magit from there too in order to try to keep the versions synchronised.

Can't seem to get rid of Ctrl-x Ctrl-z Key Binding in Emacs for minimizing window ('suspend-frame)

I keep trying to get rid of this keybinding but setting it to nil or 'undo which would be fine with no luck. I am not sure why it even gets set to C-x C-z in the first place. I wouldn't even mind permanently removing the suspend-frame command if that would provide a solution.
Here is my .emacs file if it helps:
;;Style files and multi-file documents
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
(setq inhibit-splash-screen t)
;; Use PDF mode by default
(setq-default TeX-PDF-mode t)
(setq TeX-save-query nil)
(global-auto-revert-mode t)
(global-set-key "\C-x C-z" nil)
(global-set-key "\C-z" nil)
;;Abbreviation mode and settings
(add-hook 'text-mode-hook (lambda () (abbrev-mode 1)))
(setq save-abbrevs t)
(quietly-read-abbrev-file)
;;Reftex and then turn on for Auctex
(require 'reftex)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
;;Enable preview latex
(load "preview-latex.el" nil t t)
;; For line numbers loading
(require 'linum)
(setq linum-format "%d ")
(global-linum-mode 1)
;; ===== Set the highlight current line minor mode =====
(global-hl-line-mode 1)
;; ===== Set standard indent to 2 rather that 4 ====
;;(setq standard-indent 2)
;; ========== Enable Line and Column Numbering ==========
;; Show line-number in the mode line
(line-number-mode 1)
;; Show column-number in the mode line
(column-number-mode 1)
;; ========== Force emacs to use tabs ==================
;; Turn on tabs
;;(setq indent-tabs-mode t)
;;(setq-default indent-tabs-mode t)
;; Bind the TAB key
;;(global-set-key (kbd "TAB") 'self-insert-command)
;; Set the tab width
;;(setq default-tab-width 4)
;;(setq tab-width 4)
;;(setq c-basic-indent 4)
(setq outline-minor-mode 1)
; Outline-minor-mode key map
(define-prefix-command 'cm-map nil "Outline-")
; HIDE
(define-key cm-map "q" 'hide-sublevels) ; Hide everything but the top-level headings
(define-key cm-map "t" 'hide-body) ; Hide everything but headings (all body lines)
(define-key cm-map "o" 'hide-other) ; Hide other branches
(define-key cm-map "c" 'hide-entry) ; Hide this entry's body
(define-key cm-map "l" 'hide-leaves) ; Hide body lines in this entry and sub-entries
(define-key cm-map "d" 'hide-subtree) ; Hide everything in this entry and sub-entries
; SHOW
(define-key cm-map "a" 'show-all) ; Show (expand) everything
(define-key cm-map "e" 'show-entry) ; Show this heading's body
(define-key cm-map "i" 'show-children) ; Show this heading's immediate child sub-headings
(define-key cm-map "k" 'show-branches) ; Show all sub-headings under this heading
(define-key cm-map "s" 'show-subtree) ; Show (expand) everything in this heading & below
; MOVE
(define-key cm-map "u" 'outline-up-heading) ; Up
(define-key cm-map "n" 'outline-next-visible-heading) ; Next
(define-key cm-map "p" 'outline-previous-visible-heading) ; Previous
(define-key cm-map "f" 'outline-forward-same-level) ; Forward - same level
(define-key cm-map "b" 'outline-backward-same-level) ; Backward - same level
(global-set-key "\M-o" cm-map)
;;Display recent files
(require 'recentf)
(recentf-mode 1)
(setq recentf-max-menu-items 50)
(global-set-key "\C-x\ \C-r" 'recentf-open-files)
;; Allows hiding and folding
(defun turn-on-outline-minor-mode ()
(outline-minor-mode 1))
;;Flymake mode to check syntax on the fly
;;(require 'flymake)
;;(add-hook 'find-file-hook 'flymake-find-file-hook)
;;(defun flymake-get-tex-args (file-name)
;; (list "pdflatex" (list "-file-line-error" "-draftmode" "-interaction=nonstopmode" file-name)))
;;Fly spell mode
(dolist (hook '(text-mode-hook))
(add-hook hook (lambda () (flyspell-mode 1))))
(require 'tabbar)
; turn on the tabbar
(tabbar-mode t)
; define all tabs to be one of 3 possible groups: “Emacs Buffer”, “Dired”,
;“User Buffer”.
(defun tabbar-buffer-groups ()
"Return the list of group names the current buffer belongs to.
This function is a custom function for tabbar-mode's tabbar-buffer-groups.
This function group all buffers into 3 groups:
Those Dired, those user buffer, and those emacs buffer.
Emacs buffer are those starting with “*”."
(list
(cond
((string-equal "*" (substring (buffer-name) 0 1))
"Emacs Buffer"
)
((eq major-mode 'dired-mode)
"Dired"
)
(t
"User Buffer"
)
)))
(setq tabbar-buffer-groups-function 'tabbar-buffer-groups)
(define-key global-map [(super j)] 'tabbar-backward)
(define-key global-map [(super k)] 'tabbar-forward)
(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.
'(LaTeX-indent-level 4)
'(LaTeX-item-indent -2)
'(TeX-PDF-mode t)
'(TeX-auto-save t)
'(TeX-brace-indent-level 4)
'(TeX-command-list (quote (("doall" "%`%l%(mode)%' %t && bibtex %s && %`%l%(mode)%' %t && %`%l%(mode)%' %t && %V" TeX-run-TeX nil t :help "Run LaTeX BibTeX LaTeX LaTeX View") ("ebibno" "%`%l%(mode)%' %t && %`%l%(mode)%' %t && %`%l%(mode)%' %t && %V" TeX-run-TeX nil t :help "Run LaTeX View") ("TeX" "%(PDF)%(tex) %`%S%(PDFout)%(mode)%' %t" TeX-run-TeX nil (plain-tex-mode texinfo-mode ams-tex-mode) :help "Run plain TeX") ("LaTeX" "%`%l%(mode)%' %t" TeX-run-TeX nil (latex-mode doctex-mode) :help "Run LaTeX") ("Makeinfo" "makeinfo %t" TeX-run-compile nil (texinfo-mode) :help "Run Makeinfo with Info output") ("Makeinfo HTML" "makeinfo --html %t" TeX-run-compile nil (texinfo-mode) :help "Run Makeinfo with HTML output") ("AmSTeX" "%(PDF)amstex %`%S%(PDFout)%(mode)%' %t" TeX-run-TeX nil (ams-tex-mode) :help "Run AMSTeX") ("ConTeXt" "texexec --once --texutil %(execopts)%t" TeX-run-TeX nil (context-mode) :help "Run ConTeXt once") ("ConTeXt Full" "texexec %(execopts)%t" TeX-run-TeX nil (context-mode) :help "Run ConTeXt until completion") ("BibTeX" "bibtex %s" TeX-run-BibTeX nil t :help "Run BibTeX") ("View" "%V" TeX-run-discard-or-function t t :help "Run Viewer") ("Print" "%p" TeX-run-command t t :help "Print the file") ("Queue" "%q" TeX-run-background nil t :help "View the printer queue" :visible TeX-queue-command) ("File" "%(o?)dvips %d -o %f " TeX-run-command t t :help "Generate PostScript file") ("Index" "makeindex %s" TeX-run-command nil t :help "Create index file") ("Check" "lacheck %s" TeX-run-compile nil (latex-mode) :help "Check LaTeX file for correctness") ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil t :help "Spell-check the document") ("Clean" "TeX-clean" TeX-run-function nil t :help "Delete generated intermediate files") ("Clean All" "(TeX-clean t)" TeX-run-function nil t :help "Delete generated intermediate and output files") ("Other" "" TeX-run-command t t :help "Run an arbitrary command"))))
'(TeX-debug-warnings t)
'(TeX-master nil)
'(TeX-source-correlate-method (quote synctex))
'(TeX-source-correlate-mode t)
'(TeX-source-correlate-start-server t)
'(TeX-view-program-list (quote (("Okular" "okular --unique %o#src:%n%b"))))
'(TeX-view-program-selection (quote (((output-dvi style-pstricks) "dvips and gv") (output-dvi "xdvi") (output-pdf "Okular") (output-html "xdg-open"))))
'(column-number-mode t)
'(cua-enable-cua-keys t)
'(cua-mode t nil (cua-base)))
(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.
'(default ((t (:inherit nil :stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "unknown" :family "DejaVu Sans")))))
;;Switch to last recent buffer used with F11 or ShiftF11
(when (require 'bubble-buffer nil t)
(global-set-key [f11] 'bubble-buffer-next)
(global-set-key [(shift f11)] 'bubble-buffer-previous))
(setq bubble-buffer-omit-regexp "\\(^ .+$\\|\\*Messages\\*\\|*compilation\\*\\|\\*.+output\\*$\\|\\*TeX Help\\*$\\|\\*vc-diff\\*\\|\\*Occur\\*\\|\\*grep\\*\\|\\*cvs-diff\\*\\)")
(global-set-key "\M-n" (lambda () (interactive) (scroll-up 6)) )
(global-set-key "\M-p" (lambda () (interactive) (scroll-down 6)) )
(defun sfp-page-down (&optional arg)
(interactive "^P")
(setq this-command 'next-line)
(next-line
(- (window-text-height)
next-screen-context-lines)))
(put 'sfp-page-down 'isearch-scroll t)
(put 'sfp-page-down 'CUA 'move)
(defun sfp-page-up (&optional arg)
(interactive "^P")
(setq this-command 'previous-line)
(previous-line
(- (window-text-height)
next-screen-context-lines)))
(put 'sfp-page-up 'isearch-scroll t)
(put 'sfp-page-up 'CUA 'move)
(set-face-attribute 'default nil :height 100)
(setq cua-mode t)
(require 'latex)
(when (require 'browse-kill-ring nil 'noerror)
(browse-kill-ring-default-keybindings))
(global-set-key "\C-cy" '(lambda ()
(interactive)
(popup-menu 'yank-menu)))
(setq x-select-enable-clipboard t)
(define-key LaTeX-mode-map (read-kbd-macro "C-c C-a")
(lambda ()
(interactive)
(TeX-save-document (TeX-master-file))
(TeX-command "Doall" 'TeX-master-file -1)))
;;(autoload 'whizzytex-mode "whizzytex"
;;"WhizzyTeX, a minor-mode WYSIWYG environment for LaTeX" t)
;;Set up extra key-bindings for reftex
;;(setq reftex-extra-bindings t)
(defun my-latex-setup ()
(defun latex-word-count ()
(interactive)
(let* ((this-file (buffer-file-name))
(word-count
(with-output-to-string
(with-current-buffer standard-output
(call-process "texcount" nil t nil "-inc" "-brief" this-file)))))
(string-match "\n$" word-count)
(message (replace-match "" nil nil word-count))))
(define-key LaTeX-mode-map "\C-cw" 'latex-word-count)
(define-key LaTeX-mode-map "\C-xw" 'latex-word-count))
(add-hook 'LaTeX-mode-hook 'my-latex-setup t)
(global-set-key "\C-x C-z" 'undo)
(add-hook 'text-mode-hook (lambda ()
(local-set-key (kbd "C-c C-.")
(lambda () (interactive) (search-forward "." nil t)))))
(add-hook 'text-mode-hook (lambda ()
(local-set-key (kbd "C-c C-,")
(lambda () (interactive) (search-backward "." nil t)))))
(require 'ido)
(ido-mode t)
(fset 'yes-or-no-p 'y-or-n-p)
;(global-set-key (kbd "C-?") 'hippie-expand) not working
;(setq hippie-expand-try-functions-list '(try-expand-dabbrev try-expand-dabbrev-all-buffers try-expand-dabbrev-from-kill try-complete-file-name-partially try-complete-file-name try-expand-all-abbrevs try-expand-list try-expand-line try-complete-lisp-symbol-partially try-complete-lisp-symbol))
;;Save place in files between sessions
(require 'saveplace)
(setq-default save-place t)
;;Added windows.el configuration
(require 'windows)
;; -- load the saved windows automatically on boot
(add-hook 'window-setup-hook 'resume-windows)
;; -- use this command to quit and save your setup
(define-key ctl-x-map "C" 'see-you-again)
;; -- set up window saving !! Place at end of .emacs file
(win:startup-with-window)
Your string representation of C-x C-z needs adjusting. Try either of the following:
(global-set-key "\C-x\C-z" nil)
(global-set-key (kbd "C-x C-z") nil)
Or you can disable the suspend-frame command:
(put 'suspend-frame 'disabled t)
Try this:
(global-unset-key "\C-z")
(global-unset-key "\C-x\C-z")