Merge branch 'bugfix'

This commit is contained in:
Ihor Radchenko 2022-12-07 17:02:51 +03:00
commit c59d6d82e6
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 7 additions and 0 deletions

View File

@ -4448,6 +4448,13 @@ FIELD is a string. WIDTH is a number. ALIGN is either \"c\",
(defun org-table-justify-field-maybe (&optional new)
"Justify the current field, text to left, number to right.
Optional argument NEW may specify text to replace the current field content."
;; FIXME: Prevent newlines inside field. They are currently not
;; supported.
(when (and (stringp new) (string-match-p "\n" new))
(message "Removing newlines from formula result: %S" new)
(setq new (replace-regexp-in-string
"\n" " "
(replace-regexp-in-string "\\(^\n+\\)\\|\\(\n+$\\)" "" new))))
(cond
((and (not new) org-table-may-need-update)) ; Realignment will happen anyway
((org-at-table-hline-p))