Re: prettify-symbols-mode in org agenda?

2021-10-26 Thread William Xu
Any updates here? I do hope the patch can be merged.. 

-- 
William




Re: prettify-symbols-mode in org agenda?

2021-06-22 Thread William Xu
Ihor Radchenko  writes:

> Oops. Forgot to rebase the patch to current master. The correct version
> is attached.

Thanks for the fix!

I need to make below additional change, otherwise it works perfectly. I
can't reproduce the original issue any more.

Looking at the changes, I see you changed below `concat' call to
`format'. Is this in the end some bug in the `concat' implementation?

-8<- 
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 299f9ccf1..36a8443c1 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7181,7 +7181,7 @@ The optional argument TYPE tells the agenda type."
   x)
  (when (match-end 1)
(setq x
- (format "%s%s%s"
+ (format "%s%s%s%s"
  (substring x 0 (match-end 1))
   (unless (string-empty-p 
org-agenda-todo-keyword-format)
(format org-agenda-todo-keyword-format
-8<- 

-- 
William




Re: prettify-symbols-mode in org agenda?

2021-06-22 Thread William Xu
Ihor Radchenko  writes:

> William Xu  writes:
>> Thanks. At least not something weird in my emacs config. :)
>>
>> I think your patch is ready to be merged into orgMode. Hopefully it can be
>> merged soon. 
>
> I believe that I managed to fix the problem you observe, though I do not
> understand how. Can you test the attached updated patch?

On which commit is the patch based? When I try to apply it, somehow I
get failures:

-8<- 
$ git am ./0001-Make-sure-that-fontification-is-preserved-in-agenda
Applying: Make sure that fontification is preserved in agenda
.git/rebase-apply/patch:269: space before tab in indent.
   'display))
error: patch failed: lisp/org-agenda.el:7142
error: lisp/org-agenda.el: patch does not apply
Patch failed at 0001 Make sure that fontification is preserved in agenda
-8<- 

-- 
William




Re: prettify-symbols-mode in org agenda?

2021-05-17 Thread William Xu
Ihor Radchenko  writes:

> I can reproduce with ONGOING as well... In fact, I can reproduce the
> issue with any TODO keyword of >4 chars length while using
> prettify-symbols-mode (but not pretty-symbols-mode). Moreover, the
> 'composition property is _not_ removed in agenda. Emacs... just does not
> show the composed string. In this situation I suspect Emacs bug.
>
> I will try to report to emacs-devel and see what they say.

Thanks. At least not something weird in my emacs config. :)

I think your patch is ready to be merged into orgMode. Hopefully it can be
merged soon. 

-- 
William




Re: prettify-symbols-mode in org agenda?

2021-05-16 Thread William Xu
Ihor Radchenko  writes:

> Sorry, I cannot reproduce on my side using Emacs master, Emacs 27, and
> Emacs 25. I used the following recipe:
>
> 1. cd /path/to/org
> 2. make clean
> 3. make
> 4. emacs -Q -L ./lisp/ -l org -l /tmp/1.el ~/Org/inbox.org
> 5. M-x org-agenda < t
> 6. M-x org-todo on the first item selecting "NEXT" state
> 7. M-x org-agenda-redo-all
>
> The 1.el and inbox.org are attached.
>
> Can you try to reproduce using the same steps as I did?

I can't reproduce it using your steps and config. I compared the org
config differences. I'm using a different org keyword ONGOING, instead of
NEXT.

In fact, if I replace NEXT with ONGOING in 1.el, then I can reproduce
the issue. This is very strange..

After step 7, I can see it still shows ONGOING text in the agenda buffer,
but in the buffer inbox.org, it is been correctly prettified.

-- 
William


1.el
Description: application/emacs-lisp


Re: prettify-symbols-mode in org agenda?

2021-05-14 Thread William Xu
Ihor Radchenko  writes:

>> I think I'm still seeing the issue. For example, if i change (M-x
>> org-agenda-todo) a TODO item into next state ONGOING, which i have made
>> prettified:
>>
>>   (push '("ONGOING" . "" ) prettify-symbols-alist)
>>
>> So far so good. But as soon as I call org-agenda-redo-all, after the
>> agenda is refreshed, it changes back to text 'ONGOING'. 
>
> I was able to reproduce using prettify-symbols-mode (though not using
> pretty-symbols-mode). Should be fixed now in the attached patch.

The issue seems still present.

pretty-symbols-mode is deprecated, and replaced by
prettify-symbols-mode? From its homepage: 
https://github.com/drothlis/pretty-symbols

-- 
William




Re: prettify-symbols-mode in org agenda?

2021-05-05 Thread William Xu
Ihor Radchenko  writes:

>>> The only issue I still see, is that when you org-agenda-redo-all, or
>>> org-agenda-log-mode (which triggers org-agenda-redo-all), the
>>> prettify gets lost again. Maybe org-buffer-substring-fontified call is
>>> also required somewhere during org-agenda-redo-all? 
>>
>> I managed to reproduce it. This time, I went through all the agenda.el
>> and updated places where the strings are fetched from Org buffers into
>> agenda. The updated patch is attached.
>
> Still forgot to update fontification in agenda tags view. Yet another
> update...

I think I'm still seeing the issue. For example, if i change (M-x
org-agenda-todo) a TODO item into next state ONGOING, which i have made
prettified:

  (push '("ONGOING" . "" ) prettify-symbols-alist)

So far so good. But as soon as I call org-agenda-redo-all, after the
agenda is refreshed, it changes back to text 'ONGOING'. 

Apart from this, it works pretty well. 

-- 
William




Re: prettify-symbols-mode in org agenda?

2021-05-02 Thread William Xu
Ihor Radchenko  writes:

> See the updated patch.

Thanks, it works quite nice now on the agenda line.

The only issue I still see, is that when you org-agenda-redo-all, or
org-agenda-log-mode (which triggers org-agenda-redo-all), the
prettify gets lost again. Maybe org-buffer-substring-fontified call is
also required somewhere during org-agenda-redo-all? 

-- 
William




Re: prettify-symbols-mode in org agenda?

2021-05-02 Thread William Xu
Ihor Radchenko  writes:

> This change is needed, for example, when you change todo-state using
> `org-agenda-todo'. Refreshing the agenda line in
> org-agenda-highlight-todo involves
>
> (insert (format org-agenda-todo-keyword-format s))
>
> `insert' will destroy the 'composition as 'composition is set by
> pretty-symbols to be self-destructed on change.

Now I try to test it extensively. Even with all your changes, I find
when I use org-agenda-todo to change the todo-state inside the agenda
buffer, the new state isn't always prettified. 

A workaround is that, if I save that org file buffer, then close the
buffer, M-x org-agenda-redo-all again, this time it will be properly
prettified.

Do you see the same behaviour? 

-- 
William




Re: prettify-symbols-mode in org agenda?

2021-05-01 Thread William Xu
Ihor Radchenko  writes:

> Bastien  writes:
>
>> Thanks for bringing this idea up.
>>
>> If allowing prettify-symbols-mode in Org agenda mode does not slow
>> down the agenda display and does not create spacing problems, then
>> yes, why not.
>
> Here is the patch. It will be great if other people test it first, as I
> rewrote it from advised functions in my personal config.

Works for me. Thanks!

> (org-agenda-highlight-todo): Preserve composition property used,
> i.e. by `prettify-symbols-mode'.

It looks like this change is not really needed, my emacs is built from
git master.  Maybe the 'composition property is now preserved
automatically in the buffer?

-William

> @@ -7110,7 +7119,8 @@ (defun org-agenda-limit-interactively (remove)
>  (defun org-agenda-highlight-todo (x)
>(let ((org-done-keywords org-done-keywords-for-agenda)
>   (case-fold-search nil)
> - re)
> + re
> +composition-property)
>  (if (eq x 'line)
>   (save-excursion
> (beginning-of-line 1)
> @@ -7119,10 +7129,12 @@ (defun org-agenda-highlight-todo (x)
> (when (looking-at (concat "[ \t]*\\.*\\(" re "\\) +"))
>   (add-text-properties (match-beginning 0) (match-end 1)
>(list 'face (org-get-todo-face 1)))
> - (let ((s (buffer-substring (match-beginning 1) (match-end 1
> +(setq composition-property (plist-get (text-properties-at 
> (match-beginning 1)) 'composition))
> + (let ((s (org-buffer-substring-fontified (match-beginning 1) 
> (match-end 1
> (delete-region (match-beginning 1) (1- (match-end 0)))
> (goto-char (match-beginning 1))
> -   (insert (format org-agenda-todo-keyword-format s)
> +   (insert (format org-agenda-todo-keyword-format s))
> +  (add-text-properties (match-beginning 1) (match-end 1) (list 
> 'composition composition-property)
>(let ((pl (text-property-any 0 (length x) 'org-heading t x)))
>   (setq re (get-text-property 0 'org-todo-regexp x))
>   (when (and re




Re: prettify-symbols-mode in org agenda?

2020-11-03 Thread William Xu
Ihor Radchenko  writes:

> Feel free to prepare a patch using my code and send it here.
> I think the following function should be sufficient to preserve
> pretty-symbols composition:
>
> (el-patch-defun org-agenda-highlight-todo ...
>
> I have added only 3 lines to the original org-agenda-highlight-todo (see
> el-patch-add instances in the body).
>
> That change simply preserves 'composition text property in agenda.

Thanks for the info. I'll be happy to prepare the patch. However, I
would like to hear what is the opinion of org maintainter(s) on this
topic.

-- 
William




prettify-symbols-mode in org agenda?

2020-10-31 Thread William Xu
Hi,

Is there any plan to support prettify-symbols-mode in org agenda? With
that mode, it would make it easier to, for example, replace the todo
keywords with some nice looking unicode chars. 

>From reddit, I found yantar92 has posted some elisp changes to enable the 
>support: 
https://www.reddit.com/r/orgmode/comments/i3upt6/prettifysymbolsmode_not_working_with_orgagenda/

-- 
William




Re: [O] org-toggle-inline-images bug

2011-08-25 Thread William Xu
2011/8/25 Bastien b...@altern.org:
 Hi William,

 William Xu william@gmail.com writes:

 M-x org-toggle-inline-images doesn't work for links like this:
   [[./ref/diskStructures.png]]

 It works well here on Emacs GNU Emacs 24.0.50.1 or 23.3.1 and
 Org 7.7 (latest git version.)

 What version of Emacs and Org are you using?

Hmm, i'm using Org bundled with Emacs.

emacs-version: GNU Emacs 24.0.50.1 (i386-mingw-nt6.1.7600) of
2011-06-28 on 3249CTO
org-version: 7.4  (BTW, why such big difference from org git...)


-William



[O] org-toggle-inline-images bug

2011-08-10 Thread William Xu
Hi, 

M-x org-toggle-inline-images doesn't work for links like this: 
  [[./ref/diskStructures.png]]

The problem lies in `org-display-inline-images': 

  (let ((re (concat \\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?
(substring (org-image-file-name-regexp) 0 -2)
\\)\\] (if include-linked  \\])))
old file ov img)

org-image-file-name-regexp assumes the last two characters are \\)\\'
or \\)\\$.  However, in its definition: 

  (defun org-image-file-name-regexp (optional extensions)
Return regexp matching the file names of images.
  If EXTENSIONS is given, only match these.
(if (and (not extensions) (fboundp 'image-file-name-regexp))
(image-file-name-regexp)
;; snip 

When image-file-name-regexp is defined, (image-file-name-regexp) doesn't
ends with those two specific characters.  On my machine, it returns: 

(image-file-name-regexp)
= 
\\.\\(GIF\\|JP\\(?:E?G\\)\\|P\\(?:BM\\|GM\\|N[GM]\\|PM\\)\\|SVG\\|TIFF?\\|X\\(?:[BP]M\\)\\|gif\\|jp\\(?:e?g\\)\\|p\\(?:bm\\|gm\\|n[gm]\\|pm\\)\\|svg\\|tiff?\\|x\\(?:[bp]m\\)\\)\\'\\|\\.png$\\|\\.jpeg$\\|\\.jpg$\\|\\.gif$\\|\\.tiff$\\|\\.tif$\\|\\.xbm$\\|\\.xpm$\\|\\.pbm$\\|\\.pgm$\\|\\.ppm$\\|\\.pnm$

Thus, the `re' match fails.  

Maybe we shall not depend on (image-file-name-regexp) ? 

-- 
William

http://xwl.appspot.com




[Orgmode] Re: schedule tasks

2009-09-08 Thread William Xu
PT spamfilteracco...@gmail.com writes:

 I use a similar setup. As I understand if you want items to
 appear on the date they are due you have to use the daily agenda.

 So I use a custom agenda which shows the agenda items and the
 todo list together:


 (setq org-agenda-custom-commands
   '((h My Agenda  TODO
  ((agenda )
   (alltodo home)

 The agenda part is empty if there are no due items today and the
 regular todo items are under it.

 Invoke the agenda with M-1 prefix to show items only for today.
 It can be assigned to a keyboard macro, of course.

Great! Thanks!

-- 
William

http://xwl.appspot.com



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] schedule tasks

2009-09-07 Thread William Xu
Hi folks, 

I'm trying to do this: 

  1. schedule a TODO on THIS_DAY
  2. before THIS_DAY, don't show it in global todo list.  So I have: 

  (setq org-agenda-todo-ignore-scheduled t)

  3. on(and after when not done) THIS_DAY, show it in global todo list

While, to my surprise, on THIS_DAY, the scheduled TODO doesn't show up
in the todo list!!  

The manual (info (org) Deadlines and scheduling) says: 

 Important: Scheduling an item in Org mode should not be understood
 in the same way that we understand scheduling a meeting.  Setting
 a date for a meeting is just a simple appointment, you should mark
 this entry with a simple plain time stamp, to get this item shown
 on the date where it applies. ...  

Does this mean that it will show in the calendar? 

I'm new to orgmode.  I'm thinking of referring to TODO list most of the
time.  Is this a good way? Since switching between agenda and TODO list
looks a bit unconvenient to me.


-- 
William

http://xwl.appspot.com



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: use non-alphabet ascii as todo keywords?

2008-06-09 Thread William Xu
Dominik, C. [EMAIL PROTECTED] writes:

 And here is how to do this:

 (add-hook 'org-mode-hook
   (lambda ()
 (modify-syntax-entry ?- w org-mode-syntax-table)
 (modify-syntax-entry ? w org-mode-syntax-table)))

 Give it a try and report your experiences!  Might actually work well.

Yeah, works!

I've replaced all TODO in org-agenda-files with -, now in
org-agenda, I can change item state from - to  as usual, etc.

Thanks!

-- 
William

http://williamxu.net9.org

A New Way of Taking Pills
A physician one night in Wisconsin being disturbed by a burglar, and
having no ball or shot for his pistol, noiselessly loaded the weapon with
small, hard pills, and gave the intruder a prescription which he thinks
will go far towards curing the rascal of a very bad ailment.
-- Nevada Morning Transcript, January 30, 1861



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Does org-agenda modify org file?

2008-04-05 Thread William Xu
DigitalPig [EMAIL PROTECTED] writes:

 I think you'd better update your Org-Mode. Mine is 5.23c.
 Based on my observation, I don't think it is trying to modify you org
 file when you start it. I am suspicious about your org-files
 themselves. 

Thanks.  It's been resolved in private mails.  I've upgraded my Org, and
now there's no problem.

ps.  I'm sorry I forgot to CC the discussions to the list.  

-- 
William

http://williamxu.net9.org



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Does org-agenda modify org file?

2008-04-02 Thread William Xu
Hi folks, 

I just started to learn Org.  I find that org-agenda will complain
buffer is read only if the org file buffer is read only, like in
view-mode or my personal less-minor-mode[1].  Does org-agenda try to modify
the org files? If not, maybe `let' around with (inhibit-read-only t) is
good.  


[1], http://williamxu.net9.org/ref/less.el

-- 
William

http://williamxu.net9.org



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Does org-agenda modify org file?

2008-04-02 Thread William Xu
Carsten Dominik [EMAIL PROTECTED] writes:

 It does not for me, se we need more info like version numbers of Emacs
 and Org,
 a backtrace would be nice, etc.

I don't get a backtrace, only: 

,[ *Message* ]
| Debug on Error enabled globally
| Press key for agenda command, or [1] or [0] to restrict
| org-prepare-agenda-buffers: Buffer is read-only: #buffer .todo
`

,[ C-h v org-version RET ]
| org-version is a variable defined in `org.el'.
| Its value is 4.67c
| 
| 
| Documentation:
| The version number of the file org.el.
| 
| [back]
`

,[ C-h v emacs-version RET ]
| emacs-version is a variable defined in `version.el'.
| Its value is 22.2.50.1
| 
| 
| Documentation:
| Version numbers of this version of Emacs.
| 
| [back]
`

-- 
William

http://williamxu.net9.org



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode