From 319931ba76fc3ce5b8157f131d7c71c18f4c5d60 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Wed, 13 Feb 2013 15:07:59 +0800 Subject: [PATCH] Prevent errors with table column narrowing and variable-width strings --- lisp/org-table.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/org-table.el b/lisp/org-table.el index 3f276f8..6fbff7a 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -850,6 +850,7 @@ When nil, simply write \"#ERROR\" in corrupted fields.") (unless (> f1 1) (error "Cannot narrow field starting with wide link \"%s\"" (match-string 0 xx))) + (setq f1 (round (* (/ (float (length xx)) (org-string-width xx)) f1))) (add-text-properties f1 (length xx) (list 'org-cwidth t) xx) (add-text-properties (- f1 2) f1 (list 'display org-narrow-column-arrow) -- 1.8.1.3