emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tumashu <tumashu@163.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: [PATCH] Let org-agenda align multibyte tags properly
Date: Thu, 28 Feb 2019 21:33:57 +0800 (CST)	[thread overview]
Message-ID: <2f46660.13795.169344fc6d3.Coremail.tumashu@163.com> (raw)


[-- 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 --]

             reply	other threads:[~2019-02-28 13:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-28 13:33 tumashu [this message]
2019-02-28 14:29 ` [PATCH] Let org-agenda align multibyte tags properly Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f46660.13795.169344fc6d3.Coremail.tumashu@163.com \
    --to=tumashu@163.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).