Ihor Radchenko <yanta...@posteo.net> writes:

AFAIK, there is no such feature for tables that is built-in.
I also do not recall any package doing something similar.
You may need to write your own helper command and maybe hook it to
org-shiftright-hook / org-shiftleft-hook.

Ok, I have a partial solution:

--8<---------------cut here---------------start------------->8---
#+BEGIN_SRC emacs-lisp
   (defun my/org-cycle-status ()
     "Cycle through custom status values in the current table column."
     (interactive)
     (let* ((current (org-table-get (org-table-current-line) 
(org-table-current-column)))
            (statuses '("TODO" "TO_BE_SENT" "SENT" "TO_BE_PAID" "PAID"))
            (next (or (cadr (member current statuses)) (car statuses))))
       (org-table-put (org-table-current-line) (org-table-current-column) 
next)))

 ;; Add to hook for functions attaching themselves to ‘S-right’
 (add-hook 'org-shiftright-hook 'my/org-cycle-status)
#+END_SRC

| Invoice Date     | Invoice # | Amount | Status |
|------------------+-----------+--------+--------|
| [2025-03-02 Sun] | INV01     |   2400 | TODO   |
--8<---------------cut here---------------end--------------->8---

Obviously the problem is that I lose the ability to shift columns.

Is there a free keybinding in orgmode I could associate this helper? Or
is there any way I could have it not interfere with the column shift?

Thanks.

Cheers,

Reply via email to