Skip to content

Instantly share code, notes, and snippets.

@diasjorge
Last active December 1, 2015 22:08
Show Gist options
  • Save diasjorge/4b6217ec577ce4c1b1f7 to your computer and use it in GitHub Desktop.
Save diasjorge/4b6217ec577ce4c1b1f7 to your computer and use it in GitHub Desktop.
fci-mode vs auto-complete
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line
(setq pfl-packages
'(
auto-complete
fill-column-indicator
))
;; refresh package list if it is not already available
(when (not package-archive-contents) (package-refresh-contents))
;; install packages from the list that are not yet installed
(dolist (pkg pfl-packages)
(when (and (not (package-installed-p pkg)) (assoc pkg package-archive-contents))
(package-install pkg)))
(ac-config-default)
(define-globalized-minor-mode my-global-fci-mode fci-mode turn-on-fci-mode)
(my-global-fci-mode 1)
(defvar sanityinc/fci-mode-suppressed nil)
(defadvice popup-create (before suppress-fci-mode activate)
"Suspend fci-mode while popups are visible"
(when fci-mode
(set (make-local-variable 'sanityinc/fci-mode-suppressed) t)
(turn-off-fci-mode)))
(defadvice popup-delete (after restore-fci-mode activate)
"Restore fci-mode when all popups have closed"
(when sanityinc/fci-mode-suppressed
(setq sanityinc/fci-mode-suppressed nil)
(turn-on-fci-mode)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment