For lack of a better term.
- Update Andrea’s image.
| ;; Score out this text | |
| (require 'svg) | |
| (defun replace-text (start end) | |
| (let* ((str (buffer-substring start end)) | |
| (scale (cadr (assoc :height (assoc 'default face-remapping-alist)))) | |
| (family (face-attribute 'default :family)) | |
| (height (* (aref (font-info family) 2) (if scale scale 1))) | |
| (ascent (* (aref (font-info family) 8) (if scale scale 1))) | |
| (img (svg-create (car (window-text-pixel-size nil start end)) |
| ;; An experiment for an SVG toolbar using icons from material.io | |
| ;; | |
| ;; Example usage: (toolbar 48 "black" "white" t t) | |
| ;; Material icons freely available (Apache 2 license) from | |
| ;; - https://material.io/resources/icons/?style=outline | |
| ;; - https://github.com/google/material-design-icons | |
| (require 'xml) (require 'svg) | |
| (defun toobar-item (label icon fg-color bg-color size with-icon with-label) |
| ;; --------------------------------------------------------------------- | |
| ;; Tag minor mode | |
| ;; Copyright (C) 2020 Nicolas .P Rougier | |
| ;; | |
| ;; This program is free software; you can redistribute it and/or modify | |
| ;; it under the terms of the GNU General Public License as published by | |
| ;; the Free Software Foundation, either version 3 of the License, or | |
| ;; (at your option) any later version. | |
| ;; | |
| ;; This program is distributed in the hope that it will be useful, |
| ;; Material colors from https://material.io/design/color/ | |
| (defconst levels | |
| (list "L50" "L100" "L200" "L300" "L400" | |
| "L500" "L600" "L700" "L800" "L900" | |
| "A100" "A200" "A400" "A700")) | |
| (defconst red | |
| (list "#FFEBEE" "#FFCDD2" "#EF9A9A" "#E57373" "#EF5350" | |
| "#F44336" "#E53935" "#D32F2F" "#C62828" "#B71C1C" | |
| "#FF8A80" "#FF5252" "#FF1744" "#D50000")) |
| (require 'svg) | |
| ;; Rounded boxes using SVG: | |
| ;; This could be made into a function but size of text needs to be computed | |
| (defun tag (text &optional foreground background font-size) | |
| (let* ((font-size (or font-size 12)) | |
| ;; The char-width ratio depends on the font family | |
| (char-width (* font-size 0.58)) | |
| (char-height (+ font-size 1)) |
| ;; Copyright 2020 Nicolas Rougier - BSD License | |
| ;; Usage: emacs -q -l bordered.el | |
| (set-face-font 'default "Roboto Mono Light 14") | |
| (setq default-frame-alist | |
| (append (list '(width . 72) '(height . 40) | |
| '(vertical-scroll-bars . nil) | |
| '(internal-border-width . 0) | |
| '(font . "Roboto Mono Light 14")))) | |
| (set-frame-parameter (selected-frame) | |
| 'internal-border-width 0) |
| (require 'org) | |
| (setq-default indent-tabs-mode nil) | |
| (setq org-display-inline-images t) | |
| (setq org-redisplay-inline-images t) | |
| (setq org-startup-with-inline-images "inlineimages") | |
| (setq default-frame-alist | |
| (append (list '(width . 72) '(height . 40)))) |
| ;; When editing an image with many layers (e.g. an animated GIF with | |
| ;; hundreds of frames), it's impossibly tedious to click hundreds and | |
| ;; hundreds of times on small little boxes to hide or show all layers. | |
| ;; Since GIMP seems to lack a button to hide/show all of them, and it | |
| ;; doesn't allow selection of multiple layers, this script provides | |
| ;; menu items to hide/show all layers at once. | |
| ;; Who knows if later versions of GIMP than I have provide a way to do | |
| ;; this, but this works, and maybe it will be helpful to someone. |
| # Please see the script's new home: https://github.com/alphapapa/magit.sh |