Hi,

On Emacs 29, make test will fail on both bugfix and main:

5 unexpected results:
   FAILED  test-org-colview/columns-move-left
   FAILED  test-org-colview/columns-move-right
   FAILED  test-org-colview/columns-new
   FAILED  test-org-colview/columns-next-allowed-value
   FAILED  test-org-colview/columns-update

This happens since Emacs commit
4243747b1b8c3b7e3463822804b32e83febe2878:

;; Fix 'current-column' in the presence of display strings

;; * src/indent.c (check_display_width): Support calculation of width
;; of 'display' properties whose values are strings.  This fixes the
;; value returned by 'current-column' when display strings are
;; present between BOL and point.  (Bug#53795)

There is nothing wrong in this Emacs commit.
However, org-colview.el, and particularly

(nth (current-column) org-columns-current-fmt-compiled)
statements, e.g. in org-columns-update (also in other places)

rely on current-column ignoring overlays and display properties.

To see the issue interactively, one can use the following example
recipe:

1. Run Emacs 29 master loading the latest bugfix/main Org branch
2. Open the following file:

* H
:PROPERTIES:
:A: 1
:END:
** S
:PROPERTIES:
:A: 2
:END:

3. Put point at the beginning of the first heading
4. Run M-: (let ((org-columns-default-format "%A %A{min}")) (org-columns))
5. Run M-: (org-columns-update "A")
6. Observe (error "Invalid column specification format: nil") caused by
   org-columns-update trying to retrieve the column format using the
   sexp relying of (current-column).

Note that fixing this bug will probably require checking the logic of
org-colview - one may need to dive deeply into that code.

Best,
Ihor

Reply via email to