From 55d3dfaaf8f915f6634208325f3ee5c76e3993b0 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Mon, 16 Sep 2019 18:42:59 +0200 Subject: [PATCH] org-macs: Fix indentation for full-width characters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/org-macs.el (org-do-remove-indentation): Handle full-width characters. When the least indented line in buffer begins from fullwidth character like 'あ', a Japanese character, `org-do-remove-indentation' doesn't remove indentation at all or removes improperly. e.g. 'あ' with 2 spaces indent -----[buffer begin]----- あ -----[buffer end]----- `org-do-remove-indentation' does nothing in this buffer. Expected result is: -----[buffer begin]----- あ -----[buffer end]----- Reported-by: Yuichiro Hakozaki --- lisp/org-macs.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-macs.el b/lisp/org-macs.el index d9c5e8dd1..10b339e0d 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -335,7 +335,7 @@ if it fails." (let ((min-ind (point-max))) (save-excursion (while (re-search-forward "^[ \t]*\\S-" nil t) - (let ((ind (1- (current-column)))) + (let ((ind (current-indentation))) (if (zerop ind) (throw :exit nil) (setq min-ind (min min-ind ind)))))) min-ind))))