help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ask for help


From: Xiang Ruan
Subject: Re: ask for help
Date: Thu, 21 Apr 2022 11:10:41 +0900
User-agent: mu4e 1.7.12; emacs 29.0.50

Hi, Philip

Thank you for the response.

Yes, I am now can catch update event of a specific file now.
The problem remained for me is that, after the file updating, I want to
execute a specific command but not revert a file buffer.

Thus, after catching up file update event, I need to first find the
window which is showing the command buffer, and execute the command to
update window. And this need to be run in background without disturbing
my working on other emacs windows.

best regards,


Philip Kaludercic <philipk@posteo.net> writes:

> Xiang Ruan <ruanxiang@ruanxiang.net> writes:
>
>> Hi, Philip
>>
>> Thank you for the quick response.
>>
>> I have tried auto-revert-mode before, it seems this function only
>> revert files being opened in buffers. however, "open-gcal-agenda" is a
>> command or function, but not a file opened directly, so
>> auto-revert-mode does not work in my case.
>>
>> I guess the process may like
>> 1. catch system event of "file updated"
>> 2. find buffer
>> 3. invoke the command in the buffer
>>
>> Maybe I need to read auto-revert-mode source code, try to find something 
>> useful and hack it.
>
> If you open the file that is updated via cron, and ensure that a
> function doing the updating is added to the after-revert-hook, it might
> work?
>
>> Thank you.
>>
>>
>> Philip Kaludercic <philipk@posteo.net> writes:
>>
>>> Xiang Ruan <ruanxiang@ruanxiang.net> writes:
>>>
>>> n> Hi, Philip
>>>>
>>>> Thank you for the quick response.
>>>>
>>>> Actually, I follow the below blog 
>>>> https://pragmaticemacs.wordpress.com/2017/01/09/how-i-view-my-google-calendar-agenda-in-emacs/
>>>> to view my google calendar agenda in Emacs.
>>>>
>>>> My cron updates google calendar's agenda to a local file every minute,
>>>> and I use the above “open-gcal-agenda" command to show the agenda in a
>>>> buffer(the buffer will open with name "gcal")
>>>> What I want to do is, when the local file is updated by cron, I need
>>>> Emacs automatically execute "open-gcal-agenda" to update the "gcal"
>>>> agenda buffer.
>>>
>>> I don't know what your `open-gcal-agenda' does, but maybe looking into
>>> auto-revert-mode might be helpful.
>>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]