emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* BUG: org tag can align proper when tag is Chinese.
@ 2018-05-07 13:12 tumashu
  2018-05-07 13:22 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: tumashu @ 2018-05-07 13:12 UTC (permalink / raw)
  To: emacs-orgmode


1.  [:alnum:] can not match Chinese char,  what about add [:multibyte:] ?
```
(defun org--align-tags-here (to-col)
 ...
    (if    (or (not (looking-at ".*?\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"))

 ...
)

(defun org-agenda-align-tags (&optional line)
 ...
      (while (re-search-forward "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"
 ...

)
```

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

* Re: BUG: org tag can align proper when tag is Chinese.
  2018-05-07 13:12 BUG: org tag can align proper when tag is Chinese tumashu
@ 2018-05-07 13:22 ` Nicolas Goaziou
  2018-05-07 13:34   ` tumashu
  2018-05-07 13:58   ` tumashu
  0 siblings, 2 replies; 5+ messages in thread
From: Nicolas Goaziou @ 2018-05-07 13:22 UTC (permalink / raw)
  To: tumashu; +Cc: emacs-orgmode

Hello,

tumashu <tumashu@163.com> writes:

> 1.  [:alnum:] can not match Chinese char,  what about add [:multibyte:] ?

What about :

  [:alnum:] + [:multibyte:] -> [:word:]

Could you test this change?

Regards,

-- 
Nicolas Goaziou

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

* Re: BUG: org tag can align proper when tag is Chinese.
  2018-05-07 13:22 ` Nicolas Goaziou
@ 2018-05-07 13:34   ` tumashu
  2018-05-07 13:58   ` tumashu
  1 sibling, 0 replies; 5+ messages in thread
From: tumashu @ 2018-05-07 13:34 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode


>
>Could you test this change?

Seem to work!


Another problem I have found is that: when having Chinese char, (window-text-width) is not a stable method, but I do
not know how to fix it.
```
(defun org-agenda-align-tags (&optional line)
  "Align all tags in agenda items to `org-agenda-tags-column'."
  (let ((inhibit-read-only t)
	    (org-agenda-tags-column (if (eq 'auto org-agenda-tags-column)
				                    (- (window-text-width))
				                  org-agenda-tags-column))
...
)
```

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

* Re: BUG: org tag can align proper when tag is Chinese.
  2018-05-07 13:22 ` Nicolas Goaziou
  2018-05-07 13:34   ` tumashu
@ 2018-05-07 13:58   ` tumashu
  2018-05-08 17:38     ` Nicolas Goaziou
  1 sibling, 1 reply; 5+ messages in thread
From: tumashu @ 2018-05-07 13:58 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode











At 2018-05-07 21:22:34, "Nicolas Goaziou" <mail@nicolasgoaziou.fr> wrote:
>Hello,
>
>tumashu <tumashu@163.com> writes:
>
>> 1.  [:alnum:] can not match Chinese char,  what about add [:multibyte:] ?
>
>What about :
>
>  [:alnum:] + [:multibyte:] -> [:word:]



 I found [:alnum:] can match Chinese 

     (string-match-p "[[:alnum:]]" "@@@你好")  => 3

But using [:word:] may better, in my opinion.

the real problem is that my org-head face's height is not 1.0,

Sorry ....


>Could you test this change?
>
>Regards,
>
>-- 
>Nicolas Goaziou

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

* Re: BUG: org tag can align proper when tag is Chinese.
  2018-05-07 13:58   ` tumashu
@ 2018-05-08 17:38     ` Nicolas Goaziou
  0 siblings, 0 replies; 5+ messages in thread
From: Nicolas Goaziou @ 2018-05-08 17:38 UTC (permalink / raw)
  To: tumashu; +Cc: emacs-orgmode

Hello,

tumashu  <tumashu@163.com> writes:

>  I found [:alnum:] can match Chinese 
>
>      (string-match-p "[[:alnum:]]" "@@@你好")  => 3

Great.
>
> But using [:word:] may better, in my opinion.

I'm not so sure about it. It would be better to see a concrete
limitation before extending syntax for tags.

Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2018-05-08 17:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-07 13:12 BUG: org tag can align proper when tag is Chinese tumashu
2018-05-07 13:22 ` Nicolas Goaziou
2018-05-07 13:34   ` tumashu
2018-05-07 13:58   ` tumashu
2018-05-08 17:38     ` 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).