[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/undo-tree 6e5cc0f 104/195: Generate history save filena
From: |
Stefan Monnier |
Subject: |
[elpa] externals/undo-tree 6e5cc0f 104/195: Generate history save filename using a function, to allow customization. |
Date: |
Sat, 28 Nov 2020 13:41:31 -0500 (EST) |
branch: externals/undo-tree
commit 6e5cc0f32d831499451caf37bca002476efbd76b
Author: Toby S. Cubitt <toby-undo-tree@dr-qubit.org>
Commit: Toby S. Cubitt <toby-undo-tree@dr-qubit.org>
Generate history save filename using a function, to allow customization.
(Function undo-tree-make-history-save-file-name replaces previous
undo-tree-history-save-file macro.)
Removed *'s from defface doctrings.
---
undo-tree.el | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/undo-tree.el b/undo-tree.el
index 96564e0..b1395b3 100644
--- a/undo-tree.el
+++ b/undo-tree.el
@@ -644,6 +644,9 @@
;; which prevented registers from being displayed in visualizer
;; * added `undo-tree-visualizer-relative-timestamps' option to make
;; visualizer display timestamps relative to current time
+;; * use a function `undo-tree-make-history-save-file-name' function to
+;; generate history save filename, allowing save file to be customized by
+;; overriding this function
;;
;; Version 0.4
;; * implemented persistent history storage: `undo-tree-save-history' and
@@ -974,12 +977,12 @@ within the current region."
(defface undo-tree-visualizer-default-face
'((((class color)) :foreground "gray"))
- "*Face used to draw undo-tree in visualizer."
+ "Face used to draw undo-tree in visualizer."
:group 'undo-tree)
(defface undo-tree-visualizer-current-face
'((((class color)) :foreground "red"))
- "*Face used to highlight current undo-tree node in visualizer."
+ "Face used to highlight current undo-tree node in visualizer."
:group 'undo-tree)
(defface undo-tree-visualizer-active-branch-face
@@ -987,13 +990,12 @@ within the current region."
(:foreground "white" :weight bold))
(((class color) (background light))
(:foreground "black" :weight bold)))
- "*Face used to highlight active undo-tree branch
-in visualizer."
+ "Face used to highlight active undo-tree branch in visualizer."
:group 'undo-tree)
(defface undo-tree-visualizer-register-face
'((((class color)) :foreground "yellow"))
- "*Face used to highlight undo-tree nodes saved to a register
+ "Face used to highlight undo-tree nodes saved to a register
in visualizer."
:group 'undo-tree)
@@ -2875,10 +2877,9 @@ Argument is a character, naming the register."
-(defmacro undo-tree-history-save-file (file)
- `(concat (file-name-directory ,file)
- "." (file-name-nondirectory ,file)
- ".~undo-tree"))
+(defun undo-tree-make-history-save-file-name ()
+ (concat (file-name-directory (buffer-file-name))
+ "." (file-name-nondirectory (buffer-file-name)) ".~undo-tree"))
(defun undo-tree-save-history (&optional filename overwrite)
@@ -2898,7 +2899,7 @@ without asking for confirmation."
(unless filename
(setq filename
(if buffer-file-name
- (undo-tree-history-save-file buffer-file-name)
+ (undo-tree-make-history-save-file-name)
(expand-file-name (read-file-name "File to save in: ") nil))))
(when (or (not (file-exists-p filename))
overwrite
@@ -2927,7 +2928,7 @@ signaling an error if file is not found."
(unless filename
(setq filename
(if buffer-file-name
- (undo-tree-history-save-file buffer-file-name)
+ (undo-tree-make-history-save-file-name)
(expand-file-name (read-file-name "File to load from: ") nil))))
;; attempt to read undo-tree from FILENAME
- [elpa] externals/undo-tree 897f2ff 089/195: Let-bind inhibit-read-only instead of setting and restoring buffer-read-only., (continued)
- [elpa] externals/undo-tree 897f2ff 089/195: Let-bind inhibit-read-only instead of setting and restoring buffer-read-only., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree adca566 094/195: Allow undo-tree-visualizer-diff variable to be customized., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree da54994 117/195: When discarding root, erase previous link of new root., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 4c6280b 101/195: Fixed bug preventing registers being displayed in visualizer., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 3ab4581 107/195: Avoid error if point was moved manually in visualizer selection mode, Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 824b904 129/195: Preparatory changes for lazy tree drawing., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 40c7065 108/195: Added undo-tree-visualizer-abort command, Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 107d4c8 102/195: Allow visualizer to display relative timestamps., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 1561d8f 099/195: Preserve timestamps when generating diff for visualizer diff view., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 08db836 123/195: Fix bug in undo-tree-visualizer-select-left/right., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 6e5cc0f 104/195: Generate history save filename using a function, to allow customization.,
Stefan Monnier <=
- [elpa] externals/undo-tree 17568c3 113/195: Allow undo history save directory to be customized., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 965650c 127/195: Highlight node in visualizer corresponding to unmodified buffer., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree ca9ec7b 105/195: Clear visualizer data / kill visualizer before saving history., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 270bc25 110/195: Added `~' to end of default history save-file name., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree d5a6148 120/195: Don't try to auto-save undo history if undo is disabled in buffer., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree cfc036a 133/195: Fix undo-tree-redo to avoid corrupting undo-tree state if redoing fails., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree bdfd73f 132/195: Ignore bogus buffer modification entries in undo changesets., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 6e0775d 139/195: Use define-derived-mode and define-minor-mode for undo-tree visualizer., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree d6fa2e7 152/195: Reinstate accidentally deleted file header., Stefan Monnier, 2020/11/28
- [elpa] externals/undo-tree 8afead1 162/195: Add Maintainer line to package headers., Stefan Monnier, 2020/11/28