Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable `fill-column-indicator` on startup

I am using Aquamacs on OS X 10.9.4. I have the following lines in my Preferences.el file (which is similar to the .emacs init file):

(add-to-list 'load-path "~/.emacs.d/")

(require 'fill-column-indicator)

(setq-default fci-mode t)

I use M-x fci-mode to manually toggle the column indicator.

How can fci-mode be enabled on startup using Aquamacs?

like image 690
user3854447 Avatar asked Aug 06 '14 19:08

user3854447


2 Answers

With Emacs 27 comes the display-fill-column-indicator-mode minor mode, which obsoletes the fill-column-indicator package. You can add:

(add-hook 'prog-mode-hook (lambda ()
  (display-fill-column-indicator-mode)))

to ~/.emacs to enable it for prog-mode buffers, or:

(global-display-fill-column-indicator-mode)

to enable it globally. To toggle it, use M-x display-fill-column-indicator-mode.

like image 55
x-yuri Avatar answered Sep 28 '22 02:09

x-yuri


Don't put ~/.emacs.d itself in your load-path. Always use a sub-directory.

e.g.: use ~/.emacs.d/lisp/fill-column-indicator.el and:

(add-to-list 'load-path (expand-file-name "~/.emacs.d/lisp"))
(require 'fill-column-indicator)

This library doesn't provide a global minor mode, but you can make one yourself like so:

(define-globalized-minor-mode my-global-fci-mode fci-mode turn-on-fci-mode)
(my-global-fci-mode 1)

or toggle it interactively with M-x my-global-fci-mode RET

like image 27
phils Avatar answered Sep 28 '22 01:09

phils