/ jujutsu-formatting.el
jujutsu-formatting.el
 1  ;;; jujutsu-formatting.el --- Description -*- lexical-binding: t; -*-
 2  ;;
 3  ;; Copyright (C) 2024 Benjamin Andresen
 4  ;;
 5  ;; Author: Benjamin Andresen <b@lambda.icu>
 6  ;; Maintainer: Benjamin Andresen <b@lambda.icu>
 7  ;; Created: August 19, 2024
 8  ;; Modified: August 19, 2024
 9  ;; Version: 0.0.1
10  ;; Keywords: abbrev bib c calendar comm convenience data docs emulations extensions faces files frames games hardware help hypermedia i18n internal languages lisp local maint mail matching mouse multimedia news outlines processes terminals tex tools unix vc wp
11  ;; Homepage: https://github.com/bennyandresen/jujutsu-formatting
12  ;; Package-Requires: ((emacs "27.1"))
13  ;;
14  ;; This file is not part of GNU Emacs.
15  ;;
16  ;;; Commentary:
17  ;;
18  ;;  Description
19  ;;
20  ;;; Code:
21  (require 's)
22  (require 'dash)
23  
24  (require 'jujutsu-faces)
25  
26  (define-fringe-bitmap 'jujutsu-fringe-triangle-right
27    [#b01100000
28     #b00110000
29     #b00011000
30     #b00001100
31     #b00011000
32     #b00110000
33     #b01100000
34     #b00000000])
35  
36  (define-fringe-bitmap 'jujutsu-fringe-triangle-down
37    [#b00000000
38     #b10000010
39     #b11000110
40     #b01101100
41     #b00111000
42     #b00010000
43     #b00000000
44     #b00000000])
45  
46  (defun jujutsu-formatting--format-id (id-short id-shortest)
47    "Format ID-SHORT with ID-SHORTEST distinguished."
48    (let* ((shortest-length (length id-shortest))
49           (shortest-part (substring id-short 0 shortest-length))
50           (rest-part (substring id-short shortest-length)))
51      (s-concat
52       (propertize shortest-part 'face 'jujutsu-id-shortest-face)
53       (propertize rest-part 'face 'jujutsu-id-face))))
54  
55  (provide 'jujutsu-formatting)
56  ;;; jujutsu-formatting.el ends here