View previous topic :: View next topic |
Author |
Message |
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3640
|
Posted: Wed Jan 03, 2024 3:14 pm Post subject: elisp help wanted for dynamic root of file path... [fixed] |
|
|
Currently within setq() Code: | auto-save-file-name-transforms `((".*" "~/.emacs.d/backups/" t))
| works fine.
I'd like to use user-emacs-directory instead as in: Code: | (list ".*" (concat user-emacs-directory "backups/") t)
| which returns: Code: | (".*" "~/.emacs.d/backups/" t) | Now only surrounding '() are missing, and I don't know how to achieve it.
Seems like it should be doable using a variable for the relative path, but this is just what I want to avoid.
Thks 4 ur attention, interest & support _________________ USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Last edited by CaptainBlood on Thu Jan 04, 2024 2:08 am; edited 3 times in total |
|
Back to top |
|
|
sMueggli Guru
Joined: 03 Sep 2022 Posts: 374
|
Posted: Wed Jan 03, 2024 5:48 pm Post subject: |
|
|
If I understand you correctly, you are looking for something like
Code: | (setq auto-save-file-name-transforms `(( ".*" ,(file-name-concat user-emacs-directory "backups/") t))) |
|
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3640
|
Posted: Wed Jan 03, 2024 7:00 pm Post subject: |
|
|
That works, Nice
I also have similar issue with Code: | undo-tree-history-directory-alist '(("." . "~/.emacs.d/undo-tree")) |
May be you also have a clue?
Thks 4 ur attention, interest & support. _________________ USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. " |
|
Back to top |
|
|
flexibeast Guru
Joined: 04 Apr 2022 Posts: 325 Location: Naarm/Melbourne, Australia
|
Posted: Wed Jan 03, 2024 11:11 pm Post subject: |
|
|
Perhaps i'm misunderstanding what you're after, but doesn't doing the same thing do what you want?
Code: | (setq undo-tree-history-directory-alist `(("." . ,(file-name-concat user-emacs-directory "undo-tree/"))) |
or, if you want to be more explicit, rather than using quasiquoting:
Code: | (setq undo-tree-history-directory-alist (list (cons "." (file-name-concat user-emacs-directory "undo-tree/")))) |
|
|
Back to top |
|
|
CaptainBlood Advocate
Joined: 24 Jan 2010 Posts: 3640
|
Posted: Thu Jan 04, 2024 2:04 am Post subject: |
|
|
Both of you have saved my day.
I should explain I made a mistake in the first hardcoded path I provided, as original snippet doesn't require final /.
The second snippet is genuine in this respect.
I copied & pasted the first example, which worked seamlessly.
When I tried to apply my understanding of the 'recipe' to the second case I failed to add the final /.
Thus my second call for help.
As you might have guess, I still very noob when it comes to operation on lists.
Saying here "I understand quickly must must be taught for quite a while"
Time for lisp homework
Thks 4 ur attention, interest & support. _________________ USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. " |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|