emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: daniela-spit@gmx.it
Cc: emacs-orgmode@gnu.org, Jean Louis <bugs@gnu.support>
Subject: Re: Adding Org Files to org-agenda-files
Date: Mon, 30 Nov 2020 04:01:14 +1100	[thread overview]
Message-ID: <87zh30xfl1.fsf@gmail.com> (raw)
In-Reply-To: <trinity-d8e07e5b-5711-49c9-8618-453e95727484-1606661195105@3c-app-mailcom-bs11>

daniela-spit@gmx.it writes:

>> Sent: Sunday, November 29, 2020 at 5:46 AM
>> From: "Jean Louis" <bugs@gnu.support>
>> To: daniela-spit@gmx.it
>> Cc: "Org-Mode mailing list" <emacs-orgmode@gnu.org>
>> Subject: Re: Adding Org Files to org-agenda-files
>> * daniela-spit@gmx.it <daniela-spit@gmx.it> [2020-11-29 02:30]:
>> > > What you see as a problem some see as a solution. For instance, it depends how many
>> > > org-files you want to add to the agenda. Some users including me have 2
>> > > or three files in  org-agenda-files so I never interact with this
>> > > variable directly.
>> >
>> > I have many and they change quite frequently, depending on project.
>> > So often torture emacs hard.  Have sent a bug-report about it.  Keen
>> > for a change to go through.
>> You may customize any Emacs variables yourself. Just define your
>> agenda files yourself in your init file. Then do:
>> {M-x customize-variables RET org-agenda-files RET} and erase what you
>> find there.
>> Anything before the `custom' section in your init file will be then
>> defined by you and not by the built in system.
>> In that case you should take care as user over time not to use
>> org-agenda-file-to-front command as that would again start adding
>> agend files to init file. Then just use your own settings.
>> As long as you have your own settings hard coded you may erase the
>> variable org-agenda-files
> That worries me because I do not want to change the behaviuor of Emacs
> for users.  Otherwise when people ask for help they will become confused.

Just a small clarification on the above directions.

If you have *both* a settings in your emacs init file for
org-agenda-files using (setq org-agenda-files...) and you have a line in
your (custom ...) section, you should remove one of them to avoid
confusion. In general, what is in the custom section will take
preference as it is usually loaded last. If your going to remove the one
in the custom section, run M-x customize-variable <ret> org-agenda-files
<ret> and then select the options under the 'state' button to 'Erase
Customisation', don't just erase the values in the 'Value Menu' box.

I'm not sure if I would classify the problem you ran into as a bug or
user error. Emacs has 2 main ways to customise behaviour. either you can
do it manually using things like (setq ...) in your init file, *OR* you
can use the customize interface to make the changes using a high level
'widget' base UI. This all works pretty well unless you try to use both
methods to customise the same thing.

In your case, the correct way to update the org-agenda-files list was to
edit your init file, remove the reference to the missing file and then
re-evaluae the variable. this is because you have decided to manage that
variable yourself using setq.

The other alternative is to remove the setq setting from your init file
and then set your agenda file list using customize. The critical point
is not to use both - one or the other.

Many people will use a combination of some things set by hand in their
init file and other things set using the customise interface. This is
fine but you must ensure you don't use both for the same thing.

In your case, because you are not use to configuring Emacs manually, I
would strongly recommend you stick to using the customise interface.
Later, when your more use to customising Emacs, you can move to doing
your customisation in your init file by hand (if you want/need to - many
never do and just use the customisation interface). The customisation
interface is great when your not use to Elisp and don't yet know how to
re-evaluate expressions etc. I know lots of users where the only thing
in their init file is the custom section. All of their customisation is
done using the custom interface and they are never required to write a
single line of elisp.

The org-agenda-files variable is also a little more complicated than
most configuration variables because org allows you to add/remove files
from that list interactively as well. For these interactive changes to
persist across sessions, Emacs has to store them somewhere and it uses
the custom section of your init file to do this. It cannot update your
manual setting with setq because that would require parsing and
modifying user controlled/written configuration code, which can be very
complicated and could be spread over many different files (some people
with large complex manual configurations will break them up into
separate files and include them using (reqire...) or load. This makes
updating such settings very dangerous. On the other hand, the custom
section is managed by Emacs and not modified by hand, so it can store
the updated list in that section safely, which means the changes will
persist across sessions.

for this reason, I would recommend using custom to set/modify your
agenda file list and copletely delete the (setq org-agenda-files...)
from your init file.

You might still consider how this works to be a bug because the way it
works is confusing. However, it is very difficult for Emacs to deal with
the situation where you have both manual configuration and custom
section configuration for the same thing. Emacs does what I think is the
sane things - gives priority to the custom section (actually, this can
also be changed, but lets not go down another rabbit hole).

Tim Cross

  reply	other threads:[~2020-11-29 17:05 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-28 15:39 daniela-spit
2020-11-28 16:51 ` Jeremie Juste
2020-11-28 16:54   ` daniela-spit
2020-11-28 17:01   ` daniela-spit
2020-11-28 17:41     ` Jeremie Juste
2020-11-28 18:12       ` daniela-spit
2020-11-28 18:30       ` daniela-spit
2020-11-28 18:43       ` daniela-spit
2020-11-28 19:01         ` Jeremie Juste
2020-11-28 19:16           ` daniela-spit
2020-11-28 19:26             ` Detlef Steuer
2020-11-28 19:44               ` daniela-spit
2020-11-28 19:55             ` Jeremie Juste
2020-11-28 20:06               ` daniela-spit
2020-11-28 20:11               ` daniela-spit
2020-11-28 20:27                 ` Jeremie Juste
2020-11-28 20:40                   ` daniela-spit
2020-11-28 21:32                     ` Jeremie Juste
2020-11-28 21:45                       ` daniela-spit
2020-11-28 23:18                         ` Jeremie Juste
2020-11-28 23:29                           ` daniela-spit
2020-11-29  1:36                             ` Tim Cross
2020-11-29  2:54                               ` daniela-spit
2020-11-29  3:51                                 ` Tim Cross
2020-11-29  4:05                                   ` daniela-spit
2020-11-29  5:23                                     ` Tim Cross
2020-11-29  9:30                                       ` Jean Louis
2020-11-29  6:50                                     ` Jean Louis
2020-11-29  6:41                                   ` Jean Louis
2020-11-29 12:28                                     ` Ihor Radchenko
2020-11-29 13:00                                       ` Tim Cross
2020-11-29 17:11                                         ` Jean Louis
2020-11-29 17:05                                       ` Jean Louis
2020-12-01  2:24                                         ` Ihor Radchenko
2020-12-01  8:59                                           ` Jean Louis
2020-12-13 15:36                                             ` Ihor Radchenko
2020-12-13 16:27                                               ` steve-humphreys
2020-12-25  2:17                                                 ` Ihor Radchenko
2020-12-13 20:21                                               ` Jean Louis
2020-12-13 20:59                                               ` Tim Cross
2020-12-13 21:59                                                 ` pietru
2020-12-13 23:28                                                 ` Jean Louis
2020-11-29  4:46                             ` Jean Louis
2020-11-29 14:46                               ` daniela-spit
2020-11-29 17:01                                 ` Tim Cross [this message]
2020-11-29 17:38                                   ` daniela-spit
2020-11-29 20:55                                     ` Jeremie Juste
2020-11-30  0:21                                       ` Tim Cross
2020-11-28 23:36                           ` daniela-spit
2020-11-29  5:51                             ` Jean Louis
2020-11-28 20:28                 ` daniela-spit
2020-11-28 18:50       ` daniela-spit

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:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zh30xfl1.fsf@gmail.com \
    --to=theophilusx@gmail.com \
    --cc=bugs@gnu.support \
    --cc=daniela-spit@gmx.it \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: Adding Org Files to org-agenda-files' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


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