2

I learned that I can edit the whole clipped field in a new window with org-table-edit-field, but it's kind of annoying to open a new window each time I want to edit each field. How can I edit those clipped fields by expanding them temporarily instead?

e.g. expand this:

|<3>|<3>|
|a=>|c=>|

to get this:

|<3>|<3>|
|abra|cadabra|
1

You can save the below to you config, evaluate it and run C-u M-x org-table-align with the point in the table. That will re-align the table without narrowing.

(defun my/org-table-align-maybe-narrow (orig-fun &rest args)
  "Align org-table, but do not do narrowing if prefix argument
\\[universal-argument] is used before ORIG-FUN."
  (let ((org-table-do-narrow (null current-prefix-arg)))
    (apply orig-fun args)))
(advice-add 'org-table-align :around #'my/org-table-align-maybe-narrow)

Here is the example table from your question:

| <3> | <3> |
| abra | cadabra |

With the point on the table, if you do M-x org-table-align, you will get the below (as expected):

| <3> | <3> |
| a=> | c=> |

Now, with the above elisp snippet evaluated, if you do C-u M-x org-table-align, you will get:

| <3>  | <3>     |
| abra | cadabra |

And doing M-x org-table-align again will give:

| <3> | <3> |
| a=> | c=> |

If you need to do this narrowing switching very frequently, you might want to have org-table-align bound to some key. Below is an example:

(define-key org-mode-map (kbd "C-c C-|") #'org-table-align)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.