-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
How to set default zoom level #151
Comments
The right line is
(setf *zoom-ratio-default* 1.6)
- `defvar` is to declare a new variable, but this is already done, so there is
no need to call `defvar` again.
- In Common Lisp, we use `setf` to set general variables.
- Note the surrounding `*`: it's a naming convention for global variables.
All that said, the above will only work if you press `C-x C=0` (`unzoom-page`),
not right after you load the page.
@jmercouris: should we add `unzoom-page` to an after-load hook?
|
@intuser: you are right about the documentation: for now it's still very
nascent, we've got to update it with simple examples like this one!
More suggestions are welcome! :)
|
How then can I customize next so that every page is opened with the desired zoom level? Or is there any place to customize font sizes? |
Right, so basically what you'd have to do (since we haven't figured out minor modes yet), is define a new mode called something like zoomed-mode, and extend document-mode. From there you'd write a defmethod did-commit-navigation, and go ahead and zoom in the page whenever that happens. To retain all the functionality of document-mode's history, after you did you did-commit-navigation operations you would have to write (call-next-method). If that doesn't make sense I can show you a brief code example :) thanks for being so patient with us! We have a lot of bugs to solve :D |
it should be possible within the current system to add a hook anywhere. So you could add a hook to did-commit-navigation, the problem is, that it would not contain any context, we would need a closure (around the hook) to know who loaded what. I think this is a problem we'll have to spend some more time thinking about before implementing a solution. |
That would be very nice. |
Would also like this, as I'm using a high-dpi display and everything is very small in next. |
Indeed, currently Next does not take high-dpi into account.
Mind opening a new issue for this?
|
will do |
At last, since ffaae9c we've got more configuration options thanks to hooks! So now you can set the default zoom with something like (in-package :next)
(defun my-buffer-defaults (buffer)
(setf (zoom-ratio-default buffer) 1.1)
(unzoom-page :buffer buffer)) ; Needed for non-web-mode buffers.
(defun my-interface-defaults ()
(hooks:add-to-hook (hooks:object-hook *interface* 'buffer-make-hook)
#'my-buffer-defaults))
(hooks:add-to-hook '*after-init-hook* #'my-interface-defaults) The hook manipulation might feel a bit cumbersome, but note that
Feel free to re-open if you have more requests regarding zooming. |
For the minibuffer:
|
Thanks for this code snippet. This isn't working for me though. It complains about the I have the following hack but I'm looking for a more robust solution. (define-configuration buffer
((default-modes (append '(emacs-mode my-mode) %slot-default))
(current-zoom-ratio 2.5))) |
I think your solution is pretty OK actually. It zooms every time we make a new buffer. :-) You could use the hook system indeed, but I don't believe it gets you anything in this case. |
Given my eyesight the default zoom level is much too low for me. How can I permanently set a higher one in init.lisp?
As I thought I could overwrite variable definitions, I tried to put things like the following into my init.lisp, but to no effect:
(defvar current-zoom-ratio 1.6)
(defvar zoom-ratio-default 1.6)
I also tried (setq zoom-ratio-default 1.6), again no effect.
General comment: Shouldn't things like this explained with simple examples in the documentation for simple users like me?
The text was updated successfully, but these errors were encountered: