Do you see the same problem when you start Emacs using emacs -Q? I doubt it. If so, and if your Emacs version is recent, report the problem: M-x report-emacs-bug.
If not, then recursively bisect your init file to determine the culprit. You can use command comment-region to comment out a region of text (and with C-u it uncomments a region).
(With emacs -Q, ...
in my case, scaling didn't work because my variable-pitch configuration specified the :height in the format 140. i switched it to the format 1.3. and now it works.
(thanks Basil for the pointers. emacs -Q will come in handy again i'm sure.)
Variable text-scale-mode-amount holds the number of text-scale-mode steps. (Variable text-scale-mode-step holds the amount to scale for each step.)
Save text-scale-mode-amount, then later pass it to text-scale-increase.
There is a variable image-auto-resize which you can customize to fit-width:
image-auto-resize is a variable defined in ‘image-mode.el’.
Its value is ‘fit-width’
Original value was t
You can customize this variable.
This variable was introduced, or its default value was changed, in
version 27.1 of Emacs.
Probably introduced at or before Emacs version ...
mapping behavior similar to browser might be helpful,
zoom in : Ctrl + mouse-scroll-up and Ctrl + Shift + =
zoom out : Ctrl + mouse-scroll-down and Ctrl + -
zoom 1x : Ctrl + 0
these config are for the single buffer
(global-set-key [C-mouse-4] 'text-scale-increase)
(global-set-key [(control ?+)] 'text-scale-increase)
(global-set-key [C-mouse-5] 'text-...
Library zoom-frm.el lets you do either of these things using the mouse wheel:
Zoom the buffer text size, for all windows showing a given buffer. This is called text-scaling.
Zoom the frame text size, for a given frame or for all frames.
It, in turn, requires these libraries:
See also Changing Font Size.
These are bindings ...
I believe this is related to a recent OS change (from Ubuntu to Arch), which included an Emacs upgrade from 24.3 to 24.4. I think my .emacs.desktop files were not compatible with this update, and this zoom bug was one effect. My desktop files are used to save my open buffers for each emacs session.
Thanks to @Drew's answer, I found the cause of this issue ...
Two methods would be useful to you image-transform-fit-to-width and image-transform-set-scale, you can use these two functions inside a image-mode-hook to setup the display like you want based on the file. You can get the file extension by using file-name-extension on buffer-file-name.
Here is an implementation:
(defun my-image-mode-setup ()
(when (and (...
It does not do what you expect (and request) because the Emacs maintainers rejected that possibility. I even provided a patch to realize it, as soon as text-scaling was made available.
See this message in bug thread #8379.
Fortunately, you can get what you want by using library face-remap+.el. It gives you user option text-scale-resize-window:
Quoting from C-hig (elisp)Frame Font
Each frame has a “default font” which specifies the default character
size for that frame. This size is meant when retrieving or changing the
size of a frame in terms of columns or lines (see Size Parameters).
It is also used when resizing (see Window Sizes) or splitting (see
Splitting Windows) windows.