From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rodrigo Morales Newsgroups: gmane.emacs.help Subject: Re: How to get the current column regardless of the content of the current line? Date: Thu, 15 Dec 2022 22:28:19 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32079"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Gregory Heytings Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 16 04:29:15 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p61PO-0008AQ-2w for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 16 Dec 2022 04:29:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p61Oq-0000RR-EG; Thu, 15 Dec 2022 22:28:40 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p61Op-0000RI-Gh for help-gnu-emacs@gnu.org; Thu, 15 Dec 2022 22:28:39 -0500 Original-Received: from mail-vs1-xe2b.google.com ([2607:f8b0:4864:20::e2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p61On-0008II-Dr for help-gnu-emacs@gnu.org; Thu, 15 Dec 2022 22:28:39 -0500 Original-Received: by mail-vs1-xe2b.google.com with SMTP id d185so1222048vsd.0 for ; Thu, 15 Dec 2022 19:28:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wgNZdCFY+oiPQfzjtdMfLj0DZo+pEZH11qBz1pfk7/w=; b=KzrB7uvuwaRXNoLn84Fss8AQYOQQ1QnrmAIn9wEVY5gRWveLuxe6Gd+wur+OiUBOTs Am4ywvJqQbMMxB2ojIuujFIv+fRE2DJy/MyUtBBu9v9quWnLc9XGKZNJmt6p1wiefOK6 icQpWGlDk7jzwwmdLHgSJBe/Exehy0cDFNO+eKkPi5Cp24Mq9TwyHoHd0KWb08r3Ew+t QYfhBiI8CH2Ri/OBKuNUBY6yzTJ0bbDkuLW2FCmq7lndBXg6bi+SXO8puCWQ+V/LGIOI EPTjWKL/6UpOcRpvTQRgIU5l9B0fA2VvxpvDJQaKFq808pfLlYSZouTKCDiv/vo7kVc2 moDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wgNZdCFY+oiPQfzjtdMfLj0DZo+pEZH11qBz1pfk7/w=; b=K3hQ6PEOr8WeMjXmO0LsmN91KvjsIwduE0K7TVAqOpIQioT1H5OqZ2c3qx+QqMtdvC oLUh7l6b6rVIng7T8Lh1xIqNKkRBVSI1WUdYhmBpqFAHiXSnbHtyqmzyM6GMcaCL8hc9 dtR4ad5h8ISwt8qpTbEJYE1NCTaLbAQ2kJgLZz6s6T9u8JI64tlR3T4fGE1Vuyhkrr2k VJVs0c6UbFJAex1v0TZoYkjGsfpkQg6iVWrJln/qpsuDq2+167QoidKJvij3MQ7uMh0B bIYvAp9x32FL047E+avtnaF1vJvS9lpDa5fUllY/CoFF2mOnuK8mYdap8FIagrkBadmt 3JsQ== X-Gm-Message-State: ANoB5plkuCbmjyuAxxxuhwPBslxBDQEBIRmChqMJ6YrGgCfvOeeefkmh sg41ayZ5jvr5q8+7ldErtyTed4K5nsfPm2S12+ZYAKle X-Google-Smtp-Source: AA0mqf5bfmiXQSWov7IoqDSXhGwZBQ2LWoga1YOhgBXTJ9rIuqEeWQkG0d91H63WWTYp973BRcbPgCxxc9qJ/ZzCAkE= X-Received: by 2002:a67:f854:0:b0:3b3:fca:82cd with SMTP id b20-20020a67f854000000b003b30fca82cdmr5010987vsp.12.1671161316235; Thu, 15 Dec 2022 19:28:36 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::e2b; envelope-from=moralesrodrigo1100@gmail.com; helo=mail-vs1-xe2b.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:141791 Archived-At: Thanks! That works well. On Thu, Dec 15, 2022 at 4:41 PM Gregory Heytings wrote: > > >> Which function could I use to obtain the column of the current position > >> that would work for any line regardless of its content? > > > > (defun my/current-column () > > (- (point) (progn (save-excursion (beginning-of-line) (point))))) > > > > Sorry, the progn is unnecessary: > > (defun my/current-column () > (- (point) (save-excursion (beginning-of-line) (point)))) > >