#!/usr/bin/emacs --script ;;; e2ansi-info --- Print various things to help fine-tuning your terminal ;; -*- emacs-lisp -*- ;; Copyright (C) 2014 Anders Lindgren ;; Author: Anders Lindgren ;; Keywords: faces, languages ;; Created: 2015-01-20 ;; URL: https://github.com/Lindydancer/e2ansi ;; 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, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . ;;; Commentary: ;; This is a command line tool using Emacs in batch mode to output ;; various ANSI-related information. This is useful when fine-tuning ;; your terminal. ;; ;; Usage: ;; ;; e2ansi-info [options] WHAT ;; ;; See the file `e2ansi.el' for more information. ;;; Code: (let ((dir (file-name-directory (file-truename load-file-name)))) (load (concat dir "../e2ansi.el") nil :nomessage) (load (concat dir "../e2ansi-list.el") nil :nomessage)) (setq e2ansi-batch-help-text "\ Print various ANSI color related information. Usage: e2ansi-info WHAT [options] Where WHAT is: settings Print face-exporer settings ansi16 Print color table of the 16 basic ANSI colors. ansi256 Print color tables of the 256 ANSI colors. faces Print a selection of standard faces. mbg Print text with background spanning multiple lines. ") (if (null command-line-args-left) (e2ansi-batch-usage) (while command-line-args-left (let ((arg (pop command-line-args-left))) (cond ((string= arg "settings") (princ "Native settings:\n") (e2ansi-batch-print-setting) (princ "\n") (e2ansi-batch-parse-options) (princ "Settings after parsing options:\n") (e2ansi-batch-print-setting)) ((string= arg "ansi16") (e2ansi-list-print-ansi-colors16)) ((string= arg "ansi256") (e2ansi-list-print-ansi-colors256)) ((string= arg "faces") (e2ansi-batch-parse-options) (e2ansi-list-print-ansi-faces)) ((string= arg "mbg") (e2ansi-batch-parse-options) (e2ansi-list-print-multiline-text-with-background)) (t (error "Unexpected argument: %s" arg)))))) ;;; e2ansi-info ends here.