0

I use org-mode for writing and frequently use a two pane setup, similar to the one described here: Org-mode 2-pane writing setup using indirect buffers (or display-buffer-alist. I have an outline on the left, and can open indirect buffers to work on particular subtrees. This function (which I bind to SHIFT-RETURN), opens up subtrees in a right hand pane, and then resize them, so I have a skinnier outline column on the left, and a writing window on the right.

    (defun org-tree-open-in-right-window ()
      (interactive)
      (org-tree-to-indirect-buffer)
      (windmove-right)
      (window-resize nil (- (truncate (* 0.7 (frame-width))) (window-width)) t)
    )

In addition to opening a subtree in an indirect buffer and changing the window size, I would like to set increase the font size of the right-hand window. That is the skinny, left-hand buffer would have a smaller font size, allowing a view on the whole document, while the right would be larger (in width) and larger in font-size, to facilitate writing.

I've tried: (set-face-attribute 'default nil :height 150) but this changes the font size in both. Is there a value I can pass, instead of nil, that would restrict this function to just a active window?

  • I had hoped face-map-add-relative would work but it looks like it affects both the indirect buffer and the original buffer. text-scale-increase seems to do that too :-( – amitp Jul 16 at 15:50
  • @amitp I just tried @muffinmad's suggestion (Emacs 26.1, Mac OS High Sierra [10.13]) and it seems to work. I just added (text-scale-increase 2) to the end of the function in my original post. So far, so good – cforster Jul 16 at 16:06
  • Cool! I am not sure why it doesn't work for me. It does increase the font size of the indirect buffer, but it is also increasing the font size of the underlying (original) buffer on my system (Emacs 26.2.90, Mac OS Mojave, mituharu-emacs). – amitp Jul 18 at 14:55
1

See the text-scale-increase function:

text-scale-increase is an autoloaded interactive compiled Lisp function in face-remap.el.

(text-scale-increase INC)

Increase the height of the default face in the current buffer by INC steps. If the new height is other than the default, text-scale-mode is enabled.

Each step scales the height of the default face by the variable text-scale-mode-step (a negative number of steps decreases the height by the same amount). As a special case, an argument of 0 will remove any scaling currently active.

Also see text-scale-adjust for interactive use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.