emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sławomir Grochowski" <slawomir.grochowski@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [BUG] colview.el regexp - capture operator when title is empty
Date: Mon, 19 Aug 2024 12:45:32 +0200	[thread overview]
Message-ID: <877ccczt83.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 82 bytes --]

Hello,

I have found a bug in regexp.
Test that need to pass to fix it is below.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-testing-lisp-test-org-colview.el-add-test-to-pass-to.patch --]
[-- Type: text/x-diff, Size: 1049 bytes --]

From 9710f6befb1bd4eee2d508d7baaee95e825a68dc Mon Sep 17 00:00:00 2001
From: Slawomir Grochowski <slawomir.grochowski@gmail.com>
Date: Mon, 19 Aug 2024 12:30:49 +0200
Subject: [PATCH] testing/lisp/test-org-colview.el: add test to pass to fix a
 bug

---
 testing/lisp/test-org-colview.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/testing/lisp/test-org-colview.el b/testing/lisp/test-org-colview.el
index 6b603c31b..8615ef760 100644
--- a/testing/lisp/test-org-colview.el
+++ b/testing/lisp/test-org-colview.el
@@ -90,7 +90,12 @@
   (should
    (equal `(("ITEM" "ITEM" nil "+" "%.1f"))
           (org-columns-compile-format
-           "%ITEM{+;%.1f}"))))
+           "%ITEM{+;%.1f}")))
+  (should
+   ;; Bug - when the title is empty, the regular expression will not capture the operator.
+   (equal '(("ITEM" "ITEM" nil "X" nil))
+          (org-columns-compile-format
+           "%ITEM(){X}"))))
 
 (ert-deftest test-org-colview/substring-below-width ()
   "Test `org-columns--truncate-below-width'."
-- 
2.30.2


[-- Attachment #3: Type: text/plain, Size: 223 bytes --]


Steps to reproduce:
1. add new column with an empty title and select one of the operators.
2. press 's' when the cursor is the added column - operator should be
selected, but it's empty. 

Regards,
-- 
Slawomir Grochowski

             reply	other threads:[~2024-08-19 10:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-19 10:45 Sławomir Grochowski [this message]
2024-08-20 18:21 ` [BUG] colview.el regexp - capture operator when title is empty Ihor Radchenko
2024-08-21  8:27   ` Sławomir Grochowski
2024-08-25 12:35     ` Sławomir Grochowski
2024-08-25 12:39       ` Ihor Radchenko
2024-08-25 12:59         ` Sławomir Grochowski
2024-08-31 13:34           ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877ccczt83.fsf@gmail.com \
    --to=slawomir.grochowski@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).