GNU bug report logs - #46056
hardcoded ~/.emacs.d in elpa package excorporate

Previous Next

Package: emacs;

Reported by: Gunnar Horrigmo <gnunar <at> stoffe-pro.net>

Date: Sat, 23 Jan 2021 21:25:02 UTC

Severity: normal

Tags: patch

Done: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 46056 <at> debbugs.gnu.org (full text, mbox):

From: Gunnar Horrigmo <horrigmo <at> runbox.no>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: Thomas Fitzsimmons <fitzsim <at> fitzsim.org>, 46056 <at> debbugs.gnu.org
Subject: Re: bug#46056: hardcoded ~/.emacs.d in elpa package excorporate
Date: Sun, 24 Jan 2021 03:45:17 +0100
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:

> Right.  CCing Thomas, the package's maintainer.

Thank you.


> Rather than concatenating file names as strings, better to use
> locate-user-emacs-file in this case (or expand-file-name in general).
> See (info "(elisp) Standard File Names").

Good advice! 


> Ideally the patch would include a ChangeLog-style commit message
> referencing this bug number; see the guidelines in the CONTRIBUTE
> file[1] at the top of the Emacs source tree.  Otherwise looks fine :).
>
> [1]: https://git.savannah.gnu.org/cgit/emacs.git/tree/CONTRIBUTE

Not that Thomas needs my help, but just for my own excercise, is this
what you prefer?

Subject: [PATCH] Use `locate-user-emacs-file' instead of hardcoded paths to
 diary files

---
 excorporate-diary.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/excorporate-diary.el b/excorporate-diary.el
index 833df3017c..d936f6494c 100644
--- a/excorporate-diary.el
+++ b/excorporate-diary.el
@@ -76,13 +76,13 @@ respectively."
              #'exco-diary-icalendar--add-diary-entry-around))
 
 (defvar excorporate-diary-today-file
-  "~/.emacs.d/excorporate/diary-excorporate-today"
+  (locate-user-emacs-file "excorporate/diary-excorporate-today")
   "The diary file where Excorporate should save today's meetings.
 This file will be #include'd in `diary-file' by
 `excorporate-diary-enable'.")
 
 (defvar excorporate-diary-transient-file
-  "~/.emacs.d/excorporate/diary-excorporate-transient"
+  (locate-user-emacs-file "excorporate/diary-excorporate-transient")
   "The diary file where Excorporate should save retrieved meetings.
 This file will be #include'd in `diary-file' by
 `excorporate-diary-enable'.")
-- 
2.30.0

-- 
Gunnar




This bug report was last modified 4 years and 114 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.