1

Question may be very dumb, but I can't find the answer on the web :

I have a command C-u 80 M-x column-marker-1, and I want it to be launched automatically on every buffer I open. What should I add to my ~/.emacs.d/init.el to do that ?

Here is where column-marker-1 is defined : https://www.emacswiki.org/emacs/column-marker.el

1

The emacs wiki page at : https://www.emacswiki.org/emacs/ColumnMarker

gives an example for a hook:

Highlight column 80 in foo mode:

(add-hook 'foo-mode-hook (lambda () (interactive) (column-marker-1 80)))
  • I don't understand how to use it exactly. I was able to add it to major mode (such as c-mode or emacs-lisp-mode) but I would like to have this enabled everytime, and writing one line for every existing major mode seems pretty dirty. I tried to add a hook to column-number-mode(which is a minor mode always enabled by (setq column-number-mode t)), but it did nothing. I can add it to a self created minor mode (defined by (define-minor-mode col80 "foobar"),but I don't know how to automatically launch my minor mode (hence I'm just moving the problem). – Motiss Jan 2 at 11:22
  • have a look at stackoverflow.com/questions/7899949/… – manandearth Jan 2 at 11:24

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.