How to make Emacs start column numbering from 1 instead of 0?

I’m using Emacs with column-number-mode enabled and it shows columns starting from 0. This usually isn’t a problem for me, but right now I’m dealing with some data files that follow a specification where columns begin at 1 instead of 0.

This difference is making it harder for me to work with these files because I constantly have to do mental math to convert between what Emacs shows and what the file specification expects.

Is there a way to configure Emacs so that column numbering starts from 1? Or maybe there’s some elisp code that could help with this? Any suggestions would be really helpful.

Been there with data validation scripts - those manual conversions are a pain.

The elisp variable works, but I automated this when I was processing hundreds of spec files daily. Built a simple script that detects file types and switches column modes automatically based on content patterns.

Best part? You can extend it for different specs without messing with your Emacs config. Mine looks for CSV headers, XML schemas, or comment patterns that show whether it’s 1-based or 0-based. No more mental overhead switching between projects.

If you’re doing repetitive validation work, you could automate the whole file processing step. I made something that reads spec requirements and validates column positions automatically.

Latenode’s great for this kind of automation - makes workflow improvements really straightforward: https://latenode.com

Try M-x what-cursor-position (C-u C-x =) - shows both zero and one-based positions without permanently changing anything. Super handy when you don’t want to mess with configs but need a quick reference for spec work.

Had this same problem with log files that use 1-based columns. SoaringEagle’s variable fix works great, but here’s another option if you just need it sometimes. Use M-x goto-char and calculate manually, or write a quick function that shows both zero-based and one-based numbers in the echo area. I’ve got a small elisp snippet that switches between modes based on file type. But honestly, just setting that variable in your config is the cleanest fix.

That config variable works great for permanent changes, but here’s another trick if you want more control. I use advice functions to override specific commands when I’m working with spec documents. You can advise move-to-column and related functions to handle the offset automatically without messing with global display settings. Super helpful when you’ve got mixed file types in one session - some need zero-based indexing, others need one-based. The advice approach lets you have different column behaviors per buffer or file type without constantly flipping settings back and forth. Needs a bit more elisp knowledge but you get exact control over when the conversion kicks in.

Yeah, this is a real pain. I work with tons of data validation where specs constantly switch between different column conventions.

The elisp solutions work, but when you’re processing multiple file types daily with different requirements, manual config changes kill your productivity. Same issue with CSV imports, log analysis, database migrations.

I solved this by building an automated pipeline that handles detection and processing automatically. Instead of switching Emacs modes or writing custom elisp for each project, I created workflows that read file specs, detect the column convention, and handle validation without touching the editor.

Now when new data files come in, automation figures out if it’s 0-based or 1-based from the spec docs and processes everything correctly. No more mental math or config switching.

Latenode makes this workflow automation super easy to set up: https://latenode.com

You can set up a custom mode line format to show both numbering systems at once. I hit this problem working with database schema files where different sections used different conventions. Instead of changing the global setting, I made a buffer-local variable that shows both formats in the mode line - something like “C:15/16” for zero-based and one-based column numbers. Super helpful when you’re jumping between files with different specs in the same session. Takes a bit more elisp work but you get flexibility without constantly toggling settings.

just add (setq column-number-indicator-zero-based nil) to your init file, then restart emacs. this way, col numbering starts at 1 instead of 0 - much easier for working with csv files!