-
Notifications
You must be signed in to change notification settings - Fork 7
Add functions to restore custom buffer bookmark properties #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shipmints
wants to merge
3
commits into
florommel:main
Choose a base branch
from
shipmints:shipmints-bufferlo-bookmark-buffer-handler-functions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -684,11 +684,32 @@ have ~tab-bar-tab-post-open-functions~, the bookmark context will not | |
| be available when those functions are called. | ||
|
|
||
| #+begin_src emacs-lisp | ||
| (add-hook 'bufferlo-bookmark-map-functions #'buffer-bookmark-store-fun) | ||
| (add-hook 'bufferlo-bookmark-buffer-handler-functions #'buffer-bookmark-restore-fun) | ||
| (add-hook 'bufferlo-bookmark-tab-handler-functions #'tab-bookmark-fun) | ||
| (add-hook 'bufferlo-bookmark-frame-handler-functions #'frame-bookmark-fun) | ||
| (add-hook 'bufferlo-bookmark-set-handler-functions #'set-bookmark-fun) | ||
| #+end_src | ||
|
|
||
| There are buffer-bookmark convenience functions you can use to persist | ||
| text-scale-mode-amount, and persist buffer-local variables (though you should | ||
| prefer [[https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Variables.html][file-local variables]], and directory variables [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html][directory variables]] and | ||
| take care to store buffer local variables that you consider safe to restore, | ||
| see [[https://www.gnu.org/software/emacs/manual/html_node/elisp/File-Local-Variables.html#index-safe_002dlocal_002dvariable_002dp][risky-local-variable-p]]). | ||
|
|
||
| Note: These need to be bound before ~bufferlo-mode~ is enabled. | ||
|
|
||
| #+begin_src emacs-lisp | ||
| ;; To persist text-scale-mode-amount | ||
| (setq bufferlo-bookmark-buffer-locals t) | ||
| #+end_src | ||
|
|
||
| #+begin_src emacs-lisp | ||
| ;; To persist buffer-local variables | ||
| (setq bufferlo-bookmark-text-scale-mode-amount t) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and this should be |
||
| (setq bufferlo-bookmark-buffer-local-variables '(my:special-local-1 my:special-local-2)) | ||
| #+end_src | ||
|
|
||
| *** Frame geometry options | ||
|
|
||
| Bufferlo provides wrappers around Emacs frame functions to provide | ||
|
|
@@ -1133,6 +1154,8 @@ remain in force until they are saved if this policy is set to t. | |
| (setq bufferlo-prefer-local-buffers 'tabs) | ||
| (setq bufferlo-ibuffer-bind-local-buffer-filter t) | ||
| (setq bufferlo-ibuffer-bind-keys t) | ||
| (setq bufferlo-bookmark-buffer-locals t) | ||
| (setq bufferlo-bookmark-text-scale-mode-amount t) | ||
| :config | ||
| (setq bufferlo-mode-line-prefix "🐃") ; "🐮" | ||
| (setq bufferlo-mode-line-set-active-prefix "Ⓢ") | ||
|
|
@@ -1173,6 +1196,7 @@ remain in force until they are saved if this policy is set to t. | |
| (setq bufferlo-bookmark-frame-save-on-delete 'when-bookmarked) | ||
| (setq bufferlo-bookmark-tab-save-on-close 'when-bookmarked) | ||
| (setq bufferlo-close-tab-kill-buffers-prompt t) | ||
| (setq bufferlo-bookmark-buffer-local-variables '(tab-width)) | ||
| (setq bufferlo-bookmark-frame-load-make-frame 'restore-geometry) | ||
| (setq bufferlo-bookmark-frame-load-policy 'prompt) | ||
| (setq bufferlo-bookmark-frame-duplicate-policy 'prompt) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
bufferlo-bookmark-text-scale-mode-amount, right?