项目作者: madand

项目描述 :
Hot-patch text-scale-mode with multi-face support
高级语言: Emacs Lisp
项目地址: git://github.com/madand/text-scale-plus.el.git
创建时间: 2020-11-05T04:42:01Z
项目社区:https://github.com/madand/text-scale-plus.el

开源协议:GNU General Public License v3.0

下载


Emacs Logo

text-scale+.el

Hot-patch text-scale-mode with multi-face support


License GPLv3

text-scale+ hot-patches text-scale-mode with support for adjusting
the font size of multiple faces at once.

The vanilla Emacs’ text-scale-mode only adjusts the default face. So when
you use text-scale-mode in a buffer that happens to contain some text
fragments displayed with non-default face (e.g. variable-pitch), you’ll
notice that their font size won’t change. Things become ugly if you happen to
use eww (the Emacs’ built-in web browser) with proportional fonts rendering
enabled (the default) — the entire EWW buffer just won’t scale at all.

text-scale+ solves the aforementioned issue of the current
text-scale-mode implementation by hot-patching. Hot-patching in this case
means that after you have loaded this package, text-scale-mode will be
“fixed” completely transparently to you. All your keybindings and custom
settings (e.g. text-scale-mode-step) will work the same as before.

Installation

Manual installation

Download the file text-scale+.el from this repo and put it somewhere in
your load-path.

  1. # Download the latest version of the package
  2. mkdir -p ~/path/to/text-scale+
  3. cd ~/path/to/text-scale+
  4. wget -q 'https://github.com/madand/text-scale-plus.el/raw/master/text-scale+.el'
  5. # Or clone the whole repo with Git
  6. git clone 'https://github.com/madand/text-scale-plus.el.git' ~/path/to/text-scale+

Now update the load path in your init.el:

  1. (add-to-load-path (expand-file-name "~/path/to/text-scale+"))

Loading

Add one of the follwing to your init.el.

With require
  1. (with-eval-after-load 'face-remap
  2. (require 'text-scale+))
With use-package
  1. (use-package text-scale+
  2. :after face-remap

Installation from MELPA

Not yet there.

Configuration

Variable text-scale+-faces-list

Default: (default fixed-pitch fixed-pitch-serif variable-pitch)

List of the faces to be adjusted by the text-scale-mode.

Customize: M-x customize-variable RET text-scale+-faces-list RET.

Examples with elisp:

  1. ;; Change the global value
  2. (setq text-scale+-faces-list '(default fixed-pitch))
  3. ;; Change the value only in `custom-mode` buffers
  4. (add-hook 'custom-mode-hook
  5. (lambda ()
  6. (setq-local text-scale+-faces-list '(default))))

Function Documentation

(text-scale+-install)

Patch the text-scale-mode with multi-face support.

This function will be called automatically once you’ve loaded
the text-scale+ package.

(text-scale+-uninstall)

Un-patch the text-scale-mode.

Revert all changes applied by text-scale+-install.



Markdown README file generated by
make-readme-markdown.el