瀏覽代碼

org-macs: Fix indentation for full-width characters

* 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 <sankaku.git@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-09/msg00075.html>
Nicolas Goaziou 5 年之前
父節點
當前提交
55d3dfaaf8
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lisp/org-macs.el

+ 1 - 1
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))))