From: Philip Kaludercic <philipk@posteo.net>
To: Xiang Ruan <ruanxiang@ruanxiang.net>
Cc: help-gnu-emacs@gnu.org
Subject: Re: ask for help
Date: Wed, 20 Apr 2022 08:55:48 +0000 [thread overview]
Message-ID: <875yn4kuaz.fsf@posteo.net> (raw)
In-Reply-To: <87sfq8bob5.fsf@ruanxiang.net> (Xiang Ruan's message of "Wed, 20 Apr 2022 09:12:12 +0900")
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.
>
--
Philip Kaludercic
next prev parent reply other threads:[~2022-04-20 8:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-19 11:14 ask for help Xiang Ruan
2022-04-19 11:40 ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-04-19 11:40 ` Philip Kaludercic
2022-04-19 12:11 ` Xiang Ruan
2022-04-19 13:20 ` tomas
2022-04-19 13:46 ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-04-19 13:48 ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-04-19 14:12 ` Philip Kaludercic
2022-04-20 0:12 ` Xiang Ruan
2022-04-20 8:55 ` Philip Kaludercic [this message]
2022-04-21 2:10 ` Xiang Ruan
[not found] <mailman.178.1650413881.1187.help-gnu-emacs@gnu.org>
2022-04-20 1:35 ` Xiang Ruan
[not found] <mailman.463.1072100396.868.help-gnu-emacs@gnu.org>
2003-12-22 15:37 ` Kai Grossjohann
-- strict thread matches above, loose matches on Subject: below --
2003-12-22 12:34 etang
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.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875yn4kuaz.fsf@posteo.net \
--to=philipk@posteo.net \
--cc=help-gnu-emacs@gnu.org \
--cc=ruanxiang@ruanxiang.net \
/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.
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).