Re: [O] BUG: org tag can align proper when tag is Chinese.

2018-05-08 Thread Nicolas Goaziou
Hello,

tumashu   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



Re: [O] BUG: org tag can align proper when tag is Chinese.

2018-05-07 Thread tumashu










At 2018-05-07 21:22:34, "Nicolas Goaziou"  wrote:
>Hello,
>
>tumashu  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


Re: [O] BUG: org tag can align proper when tag is Chinese.

2018-05-07 Thread tumashu

>
>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 ( 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))
...
)
```


Re: [O] BUG: org tag can align proper when tag is Chinese.

2018-05-07 Thread Nicolas Goaziou
Hello,

tumashu  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



[O] BUG: org tag can align proper when tag is Chinese.

2018-05-07 Thread tumashu

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 ( line)
 ...
  (while (re-search-forward "\\([ \t]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$"
 ...

)
```