emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Let org-agenda align multibyte tags properly
@ 2019-02-28 13:33 tumashu
  2019-02-28 14:29 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: tumashu @ 2019-02-28 13:33 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 136 bytes --]

org agenda can not align tags which include multibyte char, please see before.png

This patch fix the problem, please see after.png





[-- Attachment #1.2: Type: text/html, Size: 271 bytes --]

[-- Attachment #2: 0001-Let-org-agenda-align-multibyte-tags-properly.patch --]
[-- Type: application/octet-stream, Size: 940 bytes --]

From 2a6c969a247ae428c8fb0c8c066ee5ed9d48cb2d Mon Sep 17 00:00:00 2001
From: Feng Shu <tumashu@163.com>
Date: Thu, 28 Feb 2019 21:24:26 +0800
Subject: [PATCH] Let org-agenda align multibyte tags properly

* lisp/org-agenda.el (org-agenda-align-tags): Let org-agenda align multibyte tags properly.
---
 lisp/org-agenda.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 8563d2c51..3511ef336 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -9035,7 +9035,9 @@ current line."
 				 (if (memq 'org-tag prop)
 				     prop
 				   (cons 'org-tag prop))))))
-	(setq l (- (match-end 1) (match-beginning 1))
+	(setq l (string-width
+                 (buffer-substring (match-beginning 1)
+                                   (match-end 1)))
 	      c (if (< org-agenda-tags-column 0)
 		    (- (abs org-agenda-tags-column) l)
 		  org-agenda-tags-column))
-- 
2.20.1


[-- Attachment #3: before.png --]
[-- Type: image/png, Size: 79040 bytes --]

[-- Attachment #4: after.png --]
[-- Type: image/png, Size: 98176 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Let org-agenda align multibyte tags properly
  2019-02-28 13:33 [PATCH] Let org-agenda align multibyte tags properly tumashu
@ 2019-02-28 14:29 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2019-02-28 14:29 UTC (permalink / raw)
  To: tumashu; +Cc: emacs-orgmode

Hello,

tumashu <tumashu@163.com> writes:

> org agenda can not align tags which include multibyte char, please see before.png
>
> This patch fix the problem, please see after.png

I replaced (buffer-substring (match-beginning 1) (match-end 1)) with
(match-string 1) and applied your patch.

Thank you.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-28 14:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-28 13:33 [PATCH] Let org-agenda align multibyte tags properly tumashu
2019-02-28 14:29 ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).