|
From: | Eli Zaretskii |
Subject: | Re: How to get the current column regardless of the content of the current line? |
Date: | Fri, 16 Dec 2022 09:10:18 +0200 |
> Date: Thu, 15 Dec 2022 22:02:59 +0000 > From: Gregory Heytings <gregory@heytings.org> > cc: help-gnu-emacs@gnu.org > > > >> (defun my/current-column () > >> (- (point) (save-excursion (beginning-of-line) (point)))) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > (line-beginning-position) > > > > -- Stefan > > > > Indeed. Or even 'pos-bol': > > (defun my/current-column () > (- (point) (pos-bol))) It's not entirely correct to call this a "column", though...
[Prev in Thread] | Current Thread | [Next in Thread] |