0

Question:

I customized the variable user-mail-address on PC 1 and thought, I simply could ask for the content of this variable:

(setq org-agenda-files
  (if  (user-mail-address "Keks@Dose.org")
   '(("100-23" . "/mnt/Server1/2023/100-23/%s")
...

But that does not work, because user-mail-address is a variable, the email adress is a string and I have no idea, how to write that if-clause correctly. I read about cond, but in the end I'll probably spent the whole afternoon on this matter.

So any help appreciated to fix this if clause. If you prefer a cond expression, very well.

Drew
  • 75,699
  • 9
  • 109
  • 225
Keks Dose
  • 508
  • 4
  • 19
  • 1
    Please fix the title: it seems to be completely disconnected from the body of the question. Also `elisp` is almost never a good tag: https://emacs.stackexchange.com/tags/elisp/info – NickD Mar 01 '23 at 14:14
  • @NickD Yes, you are right, fixed. – Keks Dose Mar 01 '23 at 14:22

1 Answers1

1

You just need a function that compares strings to see if they are equal:

(setq org-agenda-files
      (if (equal user-mail-address "Keks@Dose.org")
          '(("100-23" . "/mnt/Server1/2023/100-23/%s")
            …
db48x
  • 15,741
  • 1
  • 19
  • 23