This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; ------------------------------------------------------------------- | |
;; A proof of concept for a multi header or mode line | |
;; | |
;; Multi line header or mode line is made possible by generating an | |
;; SVG image made of two small lines of text. It is certainly memory | |
;; hungry but it seems to be fast enough to display line/column while | |
;; typing text. It can probably be extended in a number of ways. | |
;; | |
;; Feel free to modify it for your own needs. | |
;; ------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
palettes = json.load(open("material-colors.json")) | |
levels = [ "L50", "L100", "L200", "L300", "L400", | |
"L500", "L600", "L700", "L800", "L900", | |
"A100", "A200", "A400", "A700"] | |
def enriched_text(t, fg_color, bg_color, space, bold=False): | |
if bold: u0, u1 = "<bold>", "</bold>" | |
else: u0, u1 = "", "" | |
print(f"<x-bg-color><param>{bg_color}</param>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun elegant-agenda (char-width char-height) | |
"" | |
(interactive) | |
(select-frame (make-frame)) | |
(set-frame-width (selected-frame) char-width) | |
(set-frame-height (selected-frame) char-height) | |
(set-frame-position (selected-frame) | |
(/ (- (display-pixel-width) (frame-outer-width)) 2) | |
(/ (- (display-pixel-height) (frame-outer-height)) 2)) | |
(x-focus-frame nil) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'subr-x) | |
(defun enhanced-message (orig-fun &rest args) | |
"This enhanced message displays a regular message in the echo area | |
and adds a specific text on the right part of the echo area. This | |
is to be used as an advice." | |
(let* ((right (propertize | |
;; Hack: The first space is a thin space, not a regular space | |
(format-time-string " %A %d %B %Y, %H:%M ") | |
'face '(:height 0.85 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; ------------------------------------------------------------------- | |
;; An extension of the echo area to display static messages | |
;; Copyright 2020 Nicolas P. Rougier | |
;; ------------------------------------------------------------------- | |
;; This file is not part of GNU Emacs. | |
;; | |
;; 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; animations | |
;; Requires =emacs-mac= fork | |
;; repo: https://bitbucket.org/mituharu/emacs-mac | |
;; homebrew tap: https://github.com/railwaycat/homebrew-emacsmacport | |
;; Crazy example | |
(mac-start-animation nil :type 'page-curl-with-shadow | |
:duration 1.0 :direction 'right :angle 45) | |
;; Less crazy | |
(mac-start-animation (selected-window) :type 'move-out |