mirror of
https://git.sr.ht/~coasteen/dotfiles
synced 2025-11-04 14:47:38 +01:00
emacs
This commit is contained in:
parent
d631d9970a
commit
581fffdc75
1454 changed files with 0 additions and 251075 deletions
|
|
@ -1,4 +0,0 @@
|
|||
/home/coast/sentences.txt
|
||||
/home/coast/#sentences.txt#
|
||||
/home/coast/tutorial.txt
|
||||
/home/coast/#tutorial.txt#
|
||||
|
|
@ -1,115 +0,0 @@
|
|||
;;; ace-window-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*-
|
||||
;; Generated by the `loaddefs-generate' function.
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path)))
|
||||
|
||||
|
||||
|
||||
;;; Generated autoloads from ace-window.el
|
||||
|
||||
(autoload 'ace-select-window "ace-window" "\
|
||||
Ace select window." t)
|
||||
(autoload 'ace-delete-window "ace-window" "\
|
||||
Ace delete window." t)
|
||||
(autoload 'ace-swap-window "ace-window" "\
|
||||
Ace swap window." t)
|
||||
(autoload 'ace-delete-other-windows "ace-window" "\
|
||||
Ace delete other windows." t)
|
||||
(autoload 'ace-display-buffer "ace-window" "\
|
||||
Make `display-buffer' and `pop-to-buffer' select using `ace-window'.
|
||||
See sample config for `display-buffer-base-action' and `display-buffer-alist':
|
||||
https://github.com/abo-abo/ace-window/wiki/display-buffer.
|
||||
|
||||
(fn BUFFER ALIST)")
|
||||
(autoload 'ace-window "ace-window" "\
|
||||
Select a window.
|
||||
Perform an action based on ARG described below.
|
||||
|
||||
By default, behaves like extended `other-window'.
|
||||
See `aw-scope' which extends it to work with frames.
|
||||
|
||||
Prefixed with one \\[universal-argument], does a swap between the
|
||||
selected window and the current window, so that the selected
|
||||
buffer moves to current window (and current buffer moves to
|
||||
selected window).
|
||||
|
||||
Prefixed with two \\[universal-argument]'s, deletes the selected
|
||||
window.
|
||||
|
||||
(fn ARG)" t)
|
||||
(defvar ace-window-display-mode nil "\
|
||||
Non-nil if Ace-Window-Display mode is enabled.
|
||||
See the `ace-window-display-mode' command
|
||||
for a description of this minor mode.
|
||||
Setting this variable directly does not take effect;
|
||||
either customize it (see the info node `Easy Customization')
|
||||
or call the function `ace-window-display-mode'.")
|
||||
(custom-autoload 'ace-window-display-mode "ace-window" nil)
|
||||
(autoload 'ace-window-display-mode "ace-window" "\
|
||||
Minor mode for showing the ace window key in the mode line.
|
||||
|
||||
This is a global minor mode. If called interactively, toggle the
|
||||
`Ace-Window-Display mode' mode. If the prefix argument is positive,
|
||||
enable the mode, and if it is zero or negative, disable the mode.
|
||||
|
||||
If called from Lisp, toggle the mode if ARG is `toggle'. Enable the
|
||||
mode if ARG is nil, omitted, or is a positive number. Disable the mode
|
||||
if ARG is a negative number.
|
||||
|
||||
To check whether the minor mode is enabled in the current buffer,
|
||||
evaluate `(default-value \\='ace-window-display-mode)'.
|
||||
|
||||
The mode's hook is called both when the mode is enabled and when it is
|
||||
disabled.
|
||||
|
||||
(fn &optional ARG)" t)
|
||||
(register-definition-prefixes "ace-window" '("ace-window-mode" "aw-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from ace-window-posframe.el
|
||||
|
||||
(defvar ace-window-posframe-mode nil "\
|
||||
Non-nil if Ace-Window-Posframe mode is enabled.
|
||||
See the `ace-window-posframe-mode' command
|
||||
for a description of this minor mode.
|
||||
Setting this variable directly does not take effect;
|
||||
either customize it (see the info node `Easy Customization')
|
||||
or call the function `ace-window-posframe-mode'.")
|
||||
(custom-autoload 'ace-window-posframe-mode "ace-window-posframe" nil)
|
||||
(autoload 'ace-window-posframe-mode "ace-window-posframe" "\
|
||||
Minor mode for showing the ace window key with child frames.
|
||||
|
||||
This is a global minor mode. If called interactively, toggle the
|
||||
`Ace-Window-Posframe mode' mode. If the prefix argument is positive,
|
||||
enable the mode, and if it is zero or negative, disable the mode.
|
||||
|
||||
If called from Lisp, toggle the mode if ARG is `toggle'. Enable the
|
||||
mode if ARG is nil, omitted, or is a positive number. Disable the mode
|
||||
if ARG is a negative number.
|
||||
|
||||
To check whether the minor mode is enabled in the current buffer,
|
||||
evaluate `(default-value \\='ace-window-posframe-mode)'.
|
||||
|
||||
The mode's hook is called both when the mode is enabled and when it is
|
||||
disabled.
|
||||
|
||||
(fn &optional ARG)" t)
|
||||
(register-definition-prefixes "ace-window-posframe" '("ace-window-posframe-" "aw-"))
|
||||
|
||||
;;; End of scraped data
|
||||
|
||||
(provide 'ace-window-autoloads)
|
||||
|
||||
;; Local Variables:
|
||||
;; version-control: never
|
||||
;; no-byte-compile: t
|
||||
;; no-update-autoloads: t
|
||||
;; no-native-compile: t
|
||||
;; coding: utf-8-emacs-unix
|
||||
;; End:
|
||||
|
||||
;;; ace-window-autoloads.el ends here
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
;; -*- no-byte-compile: t; lexical-binding: nil -*-
|
||||
(define-package "ace-window" "20220911.358"
|
||||
"Quickly switch windows."
|
||||
'((avy "0.5.0"))
|
||||
:url "https://github.com/abo-abo/ace-window"
|
||||
:commit "77115afc1b0b9f633084cf7479c767988106c196"
|
||||
:revdesc "77115afc1b0b"
|
||||
:keywords '("window" "location")
|
||||
:authors '(("Oleh Krehel" . "ohwoeowho@gmail.com"))
|
||||
:maintainers '(("Oleh Krehel" . "ohwoeowho@gmail.com")))
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
;;; ace-window-posframe.el --- posframe support for ace-window -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2015-2022 Free Software Foundation, Inc.
|
||||
|
||||
(require 'ace-window)
|
||||
|
||||
;; Suppress warnings
|
||||
(declare-function posframe-poshandler-window-center "ext:posframe")
|
||||
(declare-function posframe-show "ext:posframe")
|
||||
(declare-function posframe-hide "ext:posframe")
|
||||
(declare-function posframe-workable-p "ext:posframe")
|
||||
|
||||
(defvar aw--posframe-frames '())
|
||||
|
||||
(defvar aw-posframe-position-handler #'posframe-poshandler-window-center)
|
||||
|
||||
(defun aw--lead-overlay-posframe (path leaf)
|
||||
(let* ((wnd (cdr leaf))
|
||||
(str (format "%s" (apply #'string path)))
|
||||
;; It's important that buffer names are not unique across
|
||||
;; multiple invocations: posframe becomes very slow when
|
||||
;; creating new frames, and so being able to reuse old ones
|
||||
;; makes a huge difference. What defines "able to reuse" is
|
||||
;; something like: a frame exists which hasn't been deleted
|
||||
;; (with posframe-delete) and has the same configuration as
|
||||
;; the requested new frame.
|
||||
(bufname (format " *aw-posframe-buffer-%s*" path)))
|
||||
(with-selected-window wnd
|
||||
(push bufname aw--posframe-frames)
|
||||
(posframe-show bufname
|
||||
:string str
|
||||
:poshandler aw-posframe-position-handler
|
||||
:font (face-font 'aw-leading-char-face)
|
||||
:foreground-color (face-foreground 'aw-leading-char-face nil t)
|
||||
:background-color (face-background 'aw-leading-char-face nil t)))))
|
||||
|
||||
(defun aw--remove-leading-chars-posframe ()
|
||||
;; Hide rather than delete. See aw--lead-overlay-posframe for why.
|
||||
(mapc #'posframe-hide aw--posframe-frames)
|
||||
(setq aw--posframe-frames nil))
|
||||
|
||||
(defun ace-window-posframe-enable ()
|
||||
(unless (and (require 'posframe nil t) (posframe-workable-p))
|
||||
(error "Posframe is not workable"))
|
||||
|
||||
(setq aw--lead-overlay-fn #'aw--lead-overlay-posframe)
|
||||
(setq aw--remove-leading-chars-fn #'aw--remove-leading-chars-posframe))
|
||||
|
||||
(defun ace-window-posframe-disable ()
|
||||
(setq aw--lead-overlay-fn #'aw--lead-overlay)
|
||||
(setq aw--remove-leading-chars-fn #'aw--remove-leading-chars))
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode ace-window-posframe-mode
|
||||
"Minor mode for showing the ace window key with child frames."
|
||||
:global t
|
||||
:require 'ace-window
|
||||
:group 'ace-window
|
||||
:init-value nil
|
||||
(if ace-window-posframe-mode
|
||||
(ace-window-posframe-enable)
|
||||
(ace-window-posframe-disable)))
|
||||
|
||||
(provide 'ace-window-posframe)
|
||||
Binary file not shown.
|
|
@ -1,966 +0,0 @@
|
|||
;;; ace-window.el --- Quickly switch windows. -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2015-2022 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Oleh Krehel <ohwoeowho@gmail.com>
|
||||
;; Maintainer: Oleh Krehel <ohwoeowho@gmail.com>
|
||||
;; URL: https://github.com/abo-abo/ace-window
|
||||
;; Package-Version: 20220911.358
|
||||
;; Package-Revision: 77115afc1b0b
|
||||
;; Package-Requires: ((avy "0.5.0"))
|
||||
;; Keywords: window, location
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; This file 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, 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.
|
||||
|
||||
;; For a full copy of the GNU General Public License
|
||||
;; see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; The main function, `ace-window' is meant to replace `other-window'
|
||||
;; by assigning each window a short, unique label. When there are only
|
||||
;; two windows present, `other-window' is called (unless
|
||||
;; aw-dispatch-always is set non-nil). If there are more, each
|
||||
;; window will have its first label character highlighted. Once a
|
||||
;; unique label is typed, ace-window will switch to that window.
|
||||
;;
|
||||
;; To setup this package, just add to your .emacs:
|
||||
;;
|
||||
;; (global-set-key (kbd "M-o") 'ace-window)
|
||||
;;
|
||||
;; replacing "M-o" with an appropriate shortcut.
|
||||
;;
|
||||
;; By default, ace-window uses numbers for window labels so the window
|
||||
;; labeling is intuitively ordered. But if you prefer to type keys on
|
||||
;; your home row for quicker access, use this setting:
|
||||
;;
|
||||
;; (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))
|
||||
;;
|
||||
;; Whenever ace-window prompts for a window selection, it grays out
|
||||
;; all the window characters, highlighting window labels in red. To
|
||||
;; disable this behavior, set this:
|
||||
;;
|
||||
;; (setq aw-background nil)
|
||||
;;
|
||||
;; If you want to know the selection characters ahead of time, turn on
|
||||
;; `ace-window-display-mode'.
|
||||
;;
|
||||
;; When prefixed with one `universal-argument', instead of switching
|
||||
;; to the selected window, the selected window is swapped with the
|
||||
;; current one.
|
||||
;;
|
||||
;; When prefixed with two `universal-argument', the selected window is
|
||||
;; deleted instead.
|
||||
|
||||
;;; Code:
|
||||
(require 'avy)
|
||||
(require 'ring)
|
||||
(require 'subr-x)
|
||||
|
||||
;;* Customization
|
||||
(defgroup ace-window nil
|
||||
"Quickly switch current window."
|
||||
:group 'convenience
|
||||
:prefix "aw-")
|
||||
|
||||
(defcustom aw-keys '(?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9)
|
||||
"Keys for selecting window."
|
||||
:type '(repeat character))
|
||||
|
||||
(defcustom aw-scope 'global
|
||||
"The scope used by `ace-window'."
|
||||
:type '(choice
|
||||
(const :tag "visible frames" visible)
|
||||
(const :tag "global" global)
|
||||
(const :tag "frame" frame)))
|
||||
|
||||
(defcustom aw-translate-char-function #'identity
|
||||
"Function to translate user input key into another key.
|
||||
For example, to make SPC do the same as ?a, use
|
||||
\(lambda (c) (if (= c 32) ?a c))."
|
||||
:type '(choice
|
||||
(const :tag "Off" #'identity)
|
||||
(const :tag "Ignore Case" #'downcase)
|
||||
(function :tag "Custom")))
|
||||
|
||||
(defcustom aw-minibuffer-flag nil
|
||||
"When non-nil, also display `ace-window-mode' string in the minibuffer when ace-window is active."
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom aw-ignored-buffers '("*Calc Trail*" " *LV*")
|
||||
"List of buffers and major-modes to ignore when choosing a window from the window list.
|
||||
Active only when `aw-ignore-on' is non-nil."
|
||||
:type '(repeat string))
|
||||
|
||||
(defcustom aw-ignore-on t
|
||||
"When t, `ace-window' will ignore buffers and major-modes in `aw-ignored-buffers'.
|
||||
Use M-0 `ace-window' to toggle this value."
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom aw-ignore-current nil
|
||||
"When t, `ace-window' will ignore `selected-window'."
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom aw-background t
|
||||
"When t, `ace-window' will dim out all buffers temporarily when used."
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom aw-leading-char-style 'char
|
||||
"Style of the leading char overlay."
|
||||
:type '(choice
|
||||
(const :tag "single char" 'char)
|
||||
(const :tag "full path" 'path)))
|
||||
|
||||
(defcustom aw-dispatch-always nil
|
||||
"When non-nil, `ace-window' will issue a `read-char' even for one window.
|
||||
This will make `ace-window' act different from `other-window' for
|
||||
one or two windows."
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom aw-dispatch-when-more-than 2
|
||||
"If the number of windows is more than this, activate ace-window-ness."
|
||||
:type 'integer)
|
||||
|
||||
(defcustom aw-reverse-frame-list nil
|
||||
"When non-nil `ace-window' will order frames for selection in
|
||||
the reverse of `frame-list'"
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom aw-frame-offset '(13 . 23)
|
||||
"Increase in pixel offset for new ace-window frames relative to the selected frame.
|
||||
Its value is an (x-offset . y-offset) pair in pixels."
|
||||
:type '(cons integer integer))
|
||||
|
||||
(defcustom aw-frame-size nil
|
||||
"Frame size to make new ace-window frames.
|
||||
Its value is a (width . height) pair in pixels or nil for the default frame size.
|
||||
(0 . 0) is special and means make the frame size the same as the last selected frame size."
|
||||
:type '(cons integer integer))
|
||||
|
||||
(defcustom aw-char-position 'top-left
|
||||
"Window positions of the character overlay.
|
||||
Consider changing this if the overlay tends to overlap with other things."
|
||||
:type '(choice
|
||||
(const :tag "top left corner only" 'top-left)
|
||||
(const :tag "both left corners" 'left)))
|
||||
|
||||
;; Must be defined before `aw-make-frame-char' since its :set function references this.
|
||||
(defvar aw-dispatch-alist
|
||||
'((?x aw-delete-window "Delete Window")
|
||||
(?m aw-swap-window "Swap Windows")
|
||||
(?M aw-move-window "Move Window")
|
||||
(?c aw-copy-window "Copy Window")
|
||||
(?j aw-switch-buffer-in-window "Select Buffer")
|
||||
(?n aw-flip-window)
|
||||
(?u aw-switch-buffer-other-window "Switch Buffer Other Window")
|
||||
(?e aw-execute-command-other-window "Execute Command Other Window")
|
||||
(?F aw-split-window-fair "Split Fair Window")
|
||||
(?v aw-split-window-vert "Split Vert Window")
|
||||
(?b aw-split-window-horz "Split Horz Window")
|
||||
(?o delete-other-windows "Delete Other Windows")
|
||||
(?T aw-transpose-frame "Transpose Frame")
|
||||
;; ?i ?r ?t are used by hyperbole.el
|
||||
(?? aw-show-dispatch-help))
|
||||
"List of actions for `aw-dispatch-default'.
|
||||
Each action is a list of either:
|
||||
(char function description) where function takes a single window argument
|
||||
or
|
||||
(char function) where function takes no argument and the description is omitted.")
|
||||
|
||||
(defun aw-set-make-frame-char (option value)
|
||||
;; Signal an error if `aw-make-frame-char' is ever set to an invalid
|
||||
;; or conflicting value.
|
||||
(when value
|
||||
(cond ((not (characterp value))
|
||||
(user-error "`aw-make-frame-char' must be a character, not `%s'" value))
|
||||
((memq value aw-keys)
|
||||
(user-error "`aw-make-frame-char' is `%c'; this conflicts with the same character in `aw-keys'" value))
|
||||
((assq value aw-dispatch-alist)
|
||||
(user-error "`aw-make-frame-char' is `%c'; this conflicts with the same character in `aw-dispatch-alist'" value))))
|
||||
(set option value))
|
||||
|
||||
(defcustom aw-make-frame-char ?z
|
||||
"Non-existing ace window label character that triggers creation of a new single-window frame for display."
|
||||
:set 'aw-set-make-frame-char
|
||||
:type 'character)
|
||||
|
||||
(defface aw-leading-char-face
|
||||
'((((class color)) (:foreground "red"))
|
||||
(((background dark)) (:foreground "gray100"))
|
||||
(((background light)) (:foreground "gray0"))
|
||||
(t (:foreground "gray100" :underline nil)))
|
||||
"Face for each window's leading char.")
|
||||
|
||||
(defface aw-minibuffer-leading-char-face
|
||||
'((t :inherit aw-leading-char-face))
|
||||
"Face for minibuffer leading char.")
|
||||
|
||||
(defface aw-background-face
|
||||
'((t (:foreground "gray40")))
|
||||
"Face for whole window background during selection.")
|
||||
|
||||
(defface aw-mode-line-face
|
||||
'((t (:inherit mode-line-buffer-id)))
|
||||
"Face used for displaying the ace window key in the mode-line.")
|
||||
|
||||
(defface aw-key-face
|
||||
'((t :inherit font-lock-builtin-face))
|
||||
"Face used by `aw-show-dispatch-help'.")
|
||||
|
||||
;;* Implementation
|
||||
(defun aw-ignored-p (window)
|
||||
"Return t if WINDOW should be ignored when choosing from the window list."
|
||||
(or (and aw-ignore-on
|
||||
;; Ignore major-modes and buffer-names in `aw-ignored-buffers'.
|
||||
(or (memq (buffer-local-value 'major-mode (window-buffer window))
|
||||
aw-ignored-buffers)
|
||||
(member (buffer-name (window-buffer window)) aw-ignored-buffers)))
|
||||
;; ignore child frames
|
||||
(and (fboundp 'frame-parent) (frame-parent (window-frame window)))
|
||||
;; Ignore selected window if `aw-ignore-current' is non-nil.
|
||||
(and aw-ignore-current
|
||||
(equal window (selected-window)))
|
||||
;; When `ignore-window-parameters' is nil, ignore windows whose
|
||||
;; `no-other-window’ or `no-delete-other-windows' parameter is non-nil.
|
||||
(unless ignore-window-parameters
|
||||
(cl-case this-command
|
||||
(ace-select-window (window-parameter window 'no-other-window))
|
||||
(ace-delete-window (window-parameter window 'no-delete-other-windows))
|
||||
(ace-delete-other-windows (window-parameter
|
||||
window 'no-delete-other-windows))))))
|
||||
|
||||
(defun aw-window-list ()
|
||||
"Return the list of interesting windows."
|
||||
(sort
|
||||
(cl-remove-if
|
||||
(lambda (w)
|
||||
(let ((f (window-frame w)))
|
||||
(or (not (and (frame-live-p f)
|
||||
(frame-visible-p f)))
|
||||
(string= "initial_terminal" (terminal-name f))
|
||||
(aw-ignored-p w))))
|
||||
(cl-case aw-scope
|
||||
(visible
|
||||
(cl-mapcan #'window-list (visible-frame-list)))
|
||||
(global
|
||||
(cl-mapcan #'window-list (frame-list)))
|
||||
(frame
|
||||
(window-list))
|
||||
(t
|
||||
(error "Invalid `aw-scope': %S" aw-scope))))
|
||||
'aw-window<))
|
||||
|
||||
(defvar aw-overlays-back nil
|
||||
"Hold overlays for when `aw-background' is t.")
|
||||
|
||||
(defvar ace-window-mode nil
|
||||
"Minor mode during the selection process.")
|
||||
|
||||
;; register minor mode
|
||||
(or (assq 'ace-window-mode minor-mode-alist)
|
||||
(nconc minor-mode-alist
|
||||
(list '(ace-window-mode ace-window-mode))))
|
||||
|
||||
(defvar aw-empty-buffers-list nil
|
||||
"Store the read-only empty buffers which had to be modified.
|
||||
Modify them back eventually.")
|
||||
|
||||
(defvar aw--windows-hscroll nil
|
||||
"List of (window . hscroll-columns) items, each listing a window whose
|
||||
horizontal scroll will be restored upon ace-window action completion.")
|
||||
|
||||
(defvar aw--windows-points nil
|
||||
"List of (window . point) items. The point position had to be
|
||||
moved in order to display the overlay.")
|
||||
|
||||
(defun aw--done ()
|
||||
"Clean up mode line and overlays."
|
||||
;; mode line
|
||||
(aw-set-mode-line nil)
|
||||
;; background
|
||||
(mapc #'delete-overlay aw-overlays-back)
|
||||
(setq aw-overlays-back nil)
|
||||
(avy--remove-leading-chars)
|
||||
(dolist (b aw-empty-buffers-list)
|
||||
(with-current-buffer b
|
||||
(when (string= (buffer-string) " ")
|
||||
(let ((inhibit-read-only t))
|
||||
(delete-region (point-min) (point-max))))))
|
||||
(setq aw-empty-buffers-list nil)
|
||||
(aw--restore-windows-hscroll)
|
||||
(let (c)
|
||||
(while (setq c (pop aw--windows-points))
|
||||
(with-selected-window (car c)
|
||||
(goto-char (cdr c))))))
|
||||
|
||||
(defun aw--restore-windows-hscroll ()
|
||||
"Restore horizontal scroll of windows from `aw--windows-hscroll' list."
|
||||
(let (wnd hscroll)
|
||||
(mapc (lambda (wnd-and-hscroll)
|
||||
(setq wnd (car wnd-and-hscroll)
|
||||
hscroll (cdr wnd-and-hscroll))
|
||||
(when (window-live-p wnd)
|
||||
(set-window-hscroll wnd hscroll)))
|
||||
aw--windows-hscroll))
|
||||
(setq aw--windows-hscroll nil))
|
||||
|
||||
(defun aw--overlay-str (wnd pos path)
|
||||
"Return the replacement text for an overlay in WND at POS,
|
||||
accessible by typing PATH."
|
||||
(let ((old-str (or
|
||||
(ignore-errors
|
||||
(with-selected-window wnd
|
||||
(buffer-substring pos (1+ pos))))
|
||||
"")))
|
||||
(concat
|
||||
(cl-case aw-leading-char-style
|
||||
(char
|
||||
(string (avy--key-to-char (car (last path)))))
|
||||
(path
|
||||
(mapconcat
|
||||
(lambda (x) (string (avy--key-to-char x)))
|
||||
(reverse path)
|
||||
""))
|
||||
(t
|
||||
(error "Bad `aw-leading-char-style': %S"
|
||||
aw-leading-char-style)))
|
||||
(cond ((string-equal old-str "\t")
|
||||
(make-string (1- tab-width) ?\ ))
|
||||
((string-equal old-str "\n")
|
||||
"\n")
|
||||
(t
|
||||
(make-string
|
||||
(max 0 (1- (string-width old-str)))
|
||||
?\ ))))))
|
||||
|
||||
(defun aw--point-visible-p ()
|
||||
"Return non-nil if point is visible in the selected window.
|
||||
Return nil when horizontal scrolling has moved it off screen."
|
||||
(and (>= (- (current-column) (window-hscroll)) 0)
|
||||
(< (- (current-column) (window-hscroll))
|
||||
(window-width))))
|
||||
|
||||
(defun aw--lead-overlay (path leaf)
|
||||
"Create an overlay using PATH at LEAF.
|
||||
LEAF is (PT . WND)."
|
||||
;; Properly adds overlay in visible region of most windows except for any one
|
||||
;; receiving output while this function is executing, since that moves point,
|
||||
;; potentially shifting the added overlay outside the window's visible region.
|
||||
(let ((wnd (cdr leaf))
|
||||
;; Prevent temporary movement of point from scrolling any window.
|
||||
(scroll-margin 0))
|
||||
(with-selected-window wnd
|
||||
(when (= 0 (buffer-size))
|
||||
(push (current-buffer) aw-empty-buffers-list)
|
||||
(let ((inhibit-read-only t))
|
||||
(insert " ")))
|
||||
;; If point is not visible due to horizontal scrolling of the
|
||||
;; window, this next expression temporarily scrolls the window
|
||||
;; right until point is visible, so that the leading-char can be
|
||||
;; seen when it is inserted. When ace-window's action finishes,
|
||||
;; the horizontal scroll is restored by (aw--done).
|
||||
(while (and (not (aw--point-visible-p))
|
||||
(not (zerop (window-hscroll)))
|
||||
(progn (push (cons (selected-window) (window-hscroll)) aw--windows-hscroll) t)
|
||||
(not (zerop (scroll-right)))))
|
||||
(let* ((ws (window-start))
|
||||
(prev nil)
|
||||
(vertical-pos (if (eq aw-char-position 'left) -1 0))
|
||||
(horizontal-pos (if (zerop (window-hscroll)) 0 (1+ (window-hscroll))))
|
||||
(old-pt (point))
|
||||
(pt
|
||||
(progn
|
||||
;; If leading-char is to be displayed at the top-left, move
|
||||
;; to the first visible line in the window, otherwise, move
|
||||
;; to the last visible line.
|
||||
(move-to-window-line vertical-pos)
|
||||
(move-to-column horizontal-pos)
|
||||
;; Find a nearby point that is not at the end-of-line but
|
||||
;; is visible so have space for the overlay.
|
||||
(setq prev (1- (point)))
|
||||
(while (and (>= prev ws) (/= prev (point)) (eolp))
|
||||
(setq prev (point))
|
||||
(unless (bobp)
|
||||
(line-move -1 t)
|
||||
(move-to-column horizontal-pos)))
|
||||
(recenter vertical-pos)
|
||||
(point)))
|
||||
(ol (make-overlay pt (1+ pt) (window-buffer wnd))))
|
||||
(if (= (aw--face-rel-height) 1)
|
||||
(goto-char old-pt)
|
||||
(when (/= pt old-pt)
|
||||
(goto-char (+ pt 1))
|
||||
(push (cons wnd old-pt) aw--windows-points)))
|
||||
(overlay-put ol 'display (aw--overlay-str wnd pt path))
|
||||
(if (window-minibuffer-p wnd)
|
||||
(overlay-put ol 'face 'aw-minibuffer-leading-char-face)
|
||||
(overlay-put ol 'face 'aw-leading-char-face))
|
||||
(overlay-put ol 'window wnd)
|
||||
(push ol avy--overlays-lead)))))
|
||||
|
||||
(defvar aw--lead-overlay-fn #'aw--lead-overlay
|
||||
"Function used to display the lead chars.")
|
||||
|
||||
(defun aw--remove-leading-chars ()
|
||||
(avy--remove-leading-chars))
|
||||
|
||||
(defvar aw--remove-leading-chars-fn #'aw--remove-leading-chars
|
||||
"Function used to cleanup lead chars.")
|
||||
|
||||
(defun aw--make-backgrounds (wnd-list)
|
||||
"Create a dim background overlay for each window on WND-LIST."
|
||||
(when aw-background
|
||||
(setq aw-overlays-back
|
||||
(mapcar (lambda (w)
|
||||
(let ((ol (make-overlay
|
||||
(window-start w)
|
||||
(window-end w)
|
||||
(window-buffer w))))
|
||||
(overlay-put ol 'face 'aw-background-face)
|
||||
ol))
|
||||
wnd-list))))
|
||||
|
||||
(defvar aw-dispatch-function 'aw-dispatch-default
|
||||
"Function to call when a character not in `aw-keys' is pressed.")
|
||||
|
||||
(defvar aw-action nil
|
||||
"Function to call at the end of `aw-select'.")
|
||||
|
||||
(defun aw-set-mode-line (str)
|
||||
"Set mode line indicator to STR."
|
||||
(setq ace-window-mode str)
|
||||
(when (and aw-minibuffer-flag ace-window-mode)
|
||||
(message "%s" (string-trim-left str)))
|
||||
(force-mode-line-update))
|
||||
|
||||
(defun aw--dispatch-action (char)
|
||||
"Return item from `aw-dispatch-alist' matching CHAR."
|
||||
(assoc char aw-dispatch-alist))
|
||||
|
||||
(defun aw-make-frame ()
|
||||
"Make a new Emacs frame using the values of `aw-frame-size' and `aw-frame-offset'."
|
||||
(make-frame
|
||||
(delq nil
|
||||
(list
|
||||
;; This first parameter is important because an
|
||||
;; aw-dispatch-alist command may not want to leave this
|
||||
;; frame with input focus. If it is given focus, the
|
||||
;; command may not be able to return focus to a different
|
||||
;; frame since this is done asynchronously by the window
|
||||
;; manager.
|
||||
'(no-focus-on-map . t)
|
||||
(when aw-frame-size
|
||||
(cons 'width
|
||||
(if (zerop (car aw-frame-size))
|
||||
(frame-width)
|
||||
(car aw-frame-size))))
|
||||
(when aw-frame-size
|
||||
(cons 'height
|
||||
(if (zerop (cdr aw-frame-size))
|
||||
(frame-height)
|
||||
(car aw-frame-size))))
|
||||
(cons 'left (+ (car aw-frame-offset)
|
||||
(car (frame-position))))
|
||||
(cons 'top (+ (cdr aw-frame-offset)
|
||||
(cdr (frame-position))))))))
|
||||
|
||||
(defun aw-use-frame (window)
|
||||
"Create a new frame using the contents of WINDOW.
|
||||
|
||||
The new frame is set to the same size as the previous frame, offset by
|
||||
`aw-frame-offset' (x . y) pixels."
|
||||
(aw-switch-to-window window)
|
||||
(aw-make-frame))
|
||||
|
||||
(defun aw-clean-up-avy-current-path ()
|
||||
"Edit `avy-current-path' so only window label characters remain."
|
||||
;; Remove any possible ace-window command char that may
|
||||
;; precede the last specified window label, so
|
||||
;; functions can use `avy-current-path' as the chosen
|
||||
;; window label.
|
||||
(when (and (> (length avy-current-path) 0)
|
||||
(assq (aref avy-current-path 0) aw-dispatch-alist))
|
||||
(setq avy-current-path (substring avy-current-path 1))))
|
||||
|
||||
(defun aw-dispatch-default (char)
|
||||
"Perform an action depending on CHAR."
|
||||
(cond ((and (fboundp 'avy-mouse-event-window)
|
||||
(avy-mouse-event-window char)))
|
||||
((= char (aref (kbd "C-g") 0))
|
||||
(throw 'done 'exit))
|
||||
((and aw-make-frame-char (= char aw-make-frame-char))
|
||||
;; Make a new frame and perform any action on its window.
|
||||
(let ((start-win (selected-window))
|
||||
(end-win (frame-selected-window (aw-make-frame))))
|
||||
(if aw-action
|
||||
;; Action must be called from the start-win. The action
|
||||
;; determines which window to leave selected.
|
||||
(progn (select-frame-set-input-focus (window-frame start-win))
|
||||
(funcall aw-action end-win))
|
||||
;; Select end-win when no action
|
||||
(aw-switch-to-window end-win)))
|
||||
(throw 'done 'exit))
|
||||
(t
|
||||
(let ((action (aw--dispatch-action char)))
|
||||
(if action
|
||||
(cl-destructuring-bind (_key fn &optional description) action
|
||||
(if (and fn description)
|
||||
(prog1 (setq aw-action fn)
|
||||
(aw-set-mode-line (format " Ace - %s" description)))
|
||||
(if (commandp fn)
|
||||
(call-interactively fn)
|
||||
(funcall fn))
|
||||
(throw 'done 'exit)))
|
||||
(aw-clean-up-avy-current-path)
|
||||
;; Prevent any char from triggering an avy dispatch command.
|
||||
(let ((avy-dispatch-alist))
|
||||
(avy-handler-default char)))))))
|
||||
|
||||
(defcustom aw-display-mode-overlay t
|
||||
"When nil, don't display overlays. Rely on the mode line instead."
|
||||
:type 'boolean)
|
||||
|
||||
(defvar ace-window-display-mode)
|
||||
|
||||
(defun aw-select (mode-line &optional action)
|
||||
"Return a selected other window.
|
||||
Amend MODE-LINE to the mode line for the duration of the selection."
|
||||
(setq aw-action action)
|
||||
(let ((start-window (selected-window))
|
||||
(next-window-scope (cl-case aw-scope
|
||||
('visible 'visible)
|
||||
('global 'visible)
|
||||
('frame 'frame)))
|
||||
(wnd-list (aw-window-list))
|
||||
window)
|
||||
(setq window
|
||||
(cond ((<= (length wnd-list) 1)
|
||||
(when aw-dispatch-always
|
||||
(setq aw-action
|
||||
(unwind-protect
|
||||
(catch 'done
|
||||
(funcall aw-dispatch-function (read-char)))
|
||||
(aw--done)))
|
||||
(when (eq aw-action 'exit)
|
||||
(setq aw-action nil)))
|
||||
(or (car wnd-list) start-window))
|
||||
((and (<= (+ (length wnd-list) (if (aw-ignored-p start-window) 1 0))
|
||||
aw-dispatch-when-more-than)
|
||||
(not aw-dispatch-always)
|
||||
(not aw-ignore-current))
|
||||
(let ((wnd (next-window nil nil next-window-scope)))
|
||||
(while (and (or (not (memq wnd wnd-list))
|
||||
(aw-ignored-p wnd))
|
||||
(not (equal wnd start-window)))
|
||||
(setq wnd (next-window wnd nil next-window-scope)))
|
||||
wnd))
|
||||
(t
|
||||
(let ((candidate-list
|
||||
(mapcar (lambda (wnd)
|
||||
(cons (aw-offset wnd) wnd))
|
||||
wnd-list)))
|
||||
(aw--make-backgrounds wnd-list)
|
||||
(aw-set-mode-line mode-line)
|
||||
;; turn off helm transient map
|
||||
(remove-hook 'post-command-hook 'helm--maybe-update-keymap)
|
||||
(unwind-protect
|
||||
(let* ((avy-handler-function aw-dispatch-function)
|
||||
(avy-translate-char-function aw-translate-char-function)
|
||||
(transient-mark-mode nil)
|
||||
(res (avy-read (avy-tree candidate-list aw-keys)
|
||||
(if (and ace-window-display-mode
|
||||
(null aw-display-mode-overlay))
|
||||
(lambda (_path _leaf))
|
||||
aw--lead-overlay-fn)
|
||||
aw--remove-leading-chars-fn)))
|
||||
(if (eq res 'exit)
|
||||
(setq aw-action nil)
|
||||
(or (cdr res)
|
||||
start-window)))
|
||||
(aw--done))))))
|
||||
(if aw-action
|
||||
(funcall aw-action window)
|
||||
window)))
|
||||
|
||||
;;* Interactive
|
||||
;;;###autoload
|
||||
(defun ace-select-window ()
|
||||
"Ace select window."
|
||||
(interactive)
|
||||
(aw-select " Ace - Window"
|
||||
#'aw-switch-to-window))
|
||||
|
||||
;;;###autoload
|
||||
(defun ace-delete-window ()
|
||||
"Ace delete window."
|
||||
(interactive)
|
||||
(aw-select " Ace - Delete Window"
|
||||
#'aw-delete-window))
|
||||
|
||||
;;;###autoload
|
||||
(defun ace-swap-window ()
|
||||
"Ace swap window."
|
||||
(interactive)
|
||||
(aw-select " Ace - Swap Window"
|
||||
#'aw-swap-window))
|
||||
|
||||
;;;###autoload
|
||||
(defun ace-delete-other-windows ()
|
||||
"Ace delete other windows."
|
||||
(interactive)
|
||||
(aw-select " Ace - Delete Other Windows"
|
||||
#'delete-other-windows))
|
||||
|
||||
;;;###autoload
|
||||
(defun ace-display-buffer (buffer alist)
|
||||
"Make `display-buffer' and `pop-to-buffer' select using `ace-window'.
|
||||
See sample config for `display-buffer-base-action' and `display-buffer-alist':
|
||||
https://github.com/abo-abo/ace-window/wiki/display-buffer."
|
||||
(let* ((aw-ignore-current (cdr (assq 'inhibit-same-window alist)))
|
||||
(rf (cdr (assq 'reusable-frames alist)))
|
||||
(aw-scope (cl-case rf
|
||||
((nil) 'frame)
|
||||
(visible 'visible)
|
||||
((0 t) 'global))))
|
||||
(unless (or (<= (length (aw-window-list)) 1)
|
||||
(not aw-scope))
|
||||
(window--display-buffer
|
||||
buffer (aw-select "Ace - Display Buffer") 'reuse))))
|
||||
|
||||
(declare-function transpose-frame "ext:transpose-frame")
|
||||
(defun aw-transpose-frame (w)
|
||||
"Select any window on frame and `tranpose-frame'."
|
||||
(transpose-frame (window-frame w)))
|
||||
|
||||
;;;###autoload
|
||||
(defun ace-window (arg)
|
||||
"Select a window.
|
||||
Perform an action based on ARG described below.
|
||||
|
||||
By default, behaves like extended `other-window'.
|
||||
See `aw-scope' which extends it to work with frames.
|
||||
|
||||
Prefixed with one \\[universal-argument], does a swap between the
|
||||
selected window and the current window, so that the selected
|
||||
buffer moves to current window (and current buffer moves to
|
||||
selected window).
|
||||
|
||||
Prefixed with two \\[universal-argument]'s, deletes the selected
|
||||
window."
|
||||
(interactive "p")
|
||||
(setq avy-current-path "")
|
||||
(cl-case arg
|
||||
(0
|
||||
(let ((aw-ignore-on (not aw-ignore-on)))
|
||||
(ace-select-window)))
|
||||
(4 (ace-swap-window))
|
||||
(16 (ace-delete-window))
|
||||
(t (ace-select-window))))
|
||||
|
||||
;;* Utility
|
||||
(unless (fboundp 'frame-position)
|
||||
(defun frame-position (&optional frame)
|
||||
(let ((pl (frame-parameter frame 'left))
|
||||
(pt (frame-parameter frame 'top)))
|
||||
(when (consp pl)
|
||||
(setq pl (eval pl)))
|
||||
(when (consp pt)
|
||||
(setq pt (eval pt)))
|
||||
(cons pl pt))))
|
||||
|
||||
(defun aw-window< (wnd1 wnd2)
|
||||
"Return true if WND1 is less than WND2.
|
||||
This is determined by their respective window coordinates.
|
||||
Windows are numbered top down, left to right."
|
||||
(let* ((f1 (window-frame wnd1))
|
||||
(f2 (window-frame wnd2))
|
||||
(e1 (window-edges wnd1))
|
||||
(e2 (window-edges wnd2))
|
||||
(p1 (frame-position f1))
|
||||
(p2 (frame-position f2))
|
||||
(nl (or (null (car p1)) (null (car p2)))))
|
||||
(cond ((and (not nl) (< (car p1) (car p2)))
|
||||
(not aw-reverse-frame-list))
|
||||
((and (not nl) (> (car p1) (car p2)))
|
||||
aw-reverse-frame-list)
|
||||
((< (car e1) (car e2))
|
||||
t)
|
||||
((> (car e1) (car e2))
|
||||
nil)
|
||||
((< (cadr e1) (cadr e2))
|
||||
t))))
|
||||
|
||||
(defvar aw--window-ring (make-ring 10)
|
||||
"Hold the window switching history.")
|
||||
|
||||
(defun aw--push-window (window)
|
||||
"Store WINDOW to `aw--window-ring'."
|
||||
(when (or (zerop (ring-length aw--window-ring))
|
||||
(not (equal
|
||||
(ring-ref aw--window-ring 0)
|
||||
window)))
|
||||
(ring-insert aw--window-ring (selected-window))))
|
||||
|
||||
(defun aw--pop-window ()
|
||||
"Return the removed top of `aw--window-ring'."
|
||||
(let (res)
|
||||
(condition-case nil
|
||||
(while (or (not (window-live-p
|
||||
(setq res (ring-remove aw--window-ring 0))))
|
||||
(equal res (selected-window))))
|
||||
(error
|
||||
(if (= (length (aw-window-list)) 2)
|
||||
(progn
|
||||
(other-window 1)
|
||||
(setq res (selected-window)))
|
||||
(error "No previous windows stored"))))
|
||||
res))
|
||||
|
||||
(defun aw-switch-to-window (window)
|
||||
"Switch to the window WINDOW."
|
||||
(let ((frame (window-frame window)))
|
||||
(aw--push-window (selected-window))
|
||||
(when (and (frame-live-p frame)
|
||||
(not (eq frame (selected-frame))))
|
||||
(select-frame-set-input-focus frame))
|
||||
(if (window-live-p window)
|
||||
(select-window window)
|
||||
(error "Got a dead window %S" window))))
|
||||
|
||||
(defun aw-flip-window ()
|
||||
"Switch to the window you were previously in."
|
||||
(interactive)
|
||||
(aw-switch-to-window (aw--pop-window)))
|
||||
|
||||
(defun aw-show-dispatch-help ()
|
||||
"Display action shortucts in echo area."
|
||||
(interactive)
|
||||
(message "%s" (mapconcat
|
||||
(lambda (action)
|
||||
(cl-destructuring-bind (key fn &optional description) action
|
||||
(format "%s: %s"
|
||||
(propertize
|
||||
(char-to-string key)
|
||||
'face 'aw-key-face)
|
||||
(or description fn))))
|
||||
aw-dispatch-alist
|
||||
"\n"))
|
||||
;; Prevent this from replacing any help display
|
||||
;; in the minibuffer.
|
||||
(let (aw-minibuffer-flag)
|
||||
(mapc #'delete-overlay aw-overlays-back)
|
||||
(call-interactively 'ace-window)))
|
||||
|
||||
(defun aw-delete-window (window &optional kill-buffer)
|
||||
"Delete window WINDOW.
|
||||
When KILL-BUFFER is non-nil, also kill the buffer."
|
||||
(let ((frame (window-frame window)))
|
||||
(when (and (frame-live-p frame)
|
||||
(not (eq frame (selected-frame))))
|
||||
(select-frame-set-input-focus (window-frame window)))
|
||||
(if (= 1 (length (window-list)))
|
||||
(delete-frame frame)
|
||||
(if (window-live-p window)
|
||||
(let ((buffer (window-buffer window)))
|
||||
(delete-window window)
|
||||
(when kill-buffer
|
||||
(kill-buffer buffer)))
|
||||
(error "Got a dead window %S" window)))))
|
||||
|
||||
(defun aw-switch-buffer-in-window (window)
|
||||
"Select buffer in WINDOW."
|
||||
(aw-switch-to-window window)
|
||||
(aw--switch-buffer))
|
||||
|
||||
(declare-function ivy-switch-buffer "ext:ivy")
|
||||
|
||||
(defun aw--switch-buffer ()
|
||||
(cond ((bound-and-true-p ivy-mode)
|
||||
(ivy-switch-buffer))
|
||||
((bound-and-true-p ido-mode)
|
||||
(ido-switch-buffer))
|
||||
(t
|
||||
(call-interactively 'switch-to-buffer))))
|
||||
|
||||
(defcustom aw-swap-invert nil
|
||||
"When non-nil, the other of the two swapped windows gets the point."
|
||||
:type 'boolean)
|
||||
|
||||
(defun aw-swap-window (window)
|
||||
"Swap buffers of current window and WINDOW."
|
||||
(cl-labels ((swap-windows (window1 window2)
|
||||
"Swap the buffers of WINDOW1 and WINDOW2."
|
||||
(let ((buffer1 (window-buffer window1))
|
||||
(buffer2 (window-buffer window2)))
|
||||
(set-window-buffer window1 buffer2)
|
||||
(set-window-buffer window2 buffer1)
|
||||
(select-window window2))))
|
||||
(let ((frame (window-frame window))
|
||||
(this-window (selected-window)))
|
||||
(when (and (frame-live-p frame)
|
||||
(not (eq frame (selected-frame))))
|
||||
(select-frame-set-input-focus (window-frame window)))
|
||||
(when (and (window-live-p window)
|
||||
(not (eq window this-window)))
|
||||
(aw--push-window this-window)
|
||||
(if aw-swap-invert
|
||||
(swap-windows window this-window)
|
||||
(swap-windows this-window window))))))
|
||||
|
||||
(defun aw-move-window (window)
|
||||
"Move the current buffer to WINDOW.
|
||||
Switch the current window to the previous buffer."
|
||||
(let ((buffer (current-buffer)))
|
||||
(switch-to-buffer (other-buffer))
|
||||
(aw-switch-to-window window)
|
||||
(switch-to-buffer buffer)))
|
||||
|
||||
(defun aw-copy-window (window)
|
||||
"Copy the current buffer to WINDOW - including window-start and point."
|
||||
(let ((buffer (current-buffer))
|
||||
(window-start (window-start))
|
||||
(point (point)))
|
||||
(aw-switch-to-window window)
|
||||
(switch-to-buffer buffer)
|
||||
(set-window-start (frame-selected-window) window-start)
|
||||
(goto-char point)))
|
||||
|
||||
(defun aw-split-window-vert (window)
|
||||
"Split WINDOW vertically."
|
||||
(select-window window)
|
||||
(split-window-vertically))
|
||||
|
||||
(defun aw-split-window-horz (window)
|
||||
"Split WINDOW horizontally."
|
||||
(select-window window)
|
||||
(split-window-horizontally))
|
||||
|
||||
(defcustom aw-fair-aspect-ratio 2
|
||||
"The aspect ratio to aim for when splitting windows.
|
||||
Sizes are based on the number of characters, not pixels.
|
||||
Increase to prefer wider windows, or decrease for taller windows."
|
||||
:type 'number)
|
||||
|
||||
(defun aw-split-window-fair (window)
|
||||
"Split WINDOW vertically or horizontally, based on its current dimensions.
|
||||
Modify `aw-fair-aspect-ratio' to tweak behavior."
|
||||
(let ((w (window-body-width window))
|
||||
(h (window-body-height window)))
|
||||
(if (< (* h aw-fair-aspect-ratio) w)
|
||||
(aw-split-window-horz window)
|
||||
(aw-split-window-vert window))))
|
||||
|
||||
(defun aw-switch-buffer-other-window (window)
|
||||
"Switch buffer in WINDOW."
|
||||
(aw-switch-to-window window)
|
||||
(unwind-protect
|
||||
(aw--switch-buffer)
|
||||
(aw-flip-window)))
|
||||
|
||||
(defun aw-execute-command-other-window (window)
|
||||
"Execute a command in WINDOW."
|
||||
(aw-switch-to-window window)
|
||||
(unwind-protect
|
||||
(funcall
|
||||
(key-binding
|
||||
(read-key-sequence
|
||||
"Enter key sequence: ")))
|
||||
(aw-flip-window)))
|
||||
|
||||
(defun aw--face-rel-height ()
|
||||
(let ((h (face-attribute 'aw-leading-char-face :height)))
|
||||
(cond
|
||||
((eq h 'unspecified)
|
||||
1)
|
||||
((floatp h)
|
||||
(max (floor h) 1))
|
||||
((integerp h)
|
||||
1)
|
||||
(t
|
||||
(error "unexpected: %s" h)))))
|
||||
|
||||
(defun aw-offset (window)
|
||||
"Return point in WINDOW that's closest to top left corner.
|
||||
The point is writable, i.e. it's not part of space after newline."
|
||||
(let ((h (window-hscroll window))
|
||||
(beg (window-start window))
|
||||
(end (window-end window))
|
||||
(inhibit-field-text-motion t))
|
||||
(with-current-buffer (window-buffer window)
|
||||
(save-excursion
|
||||
(goto-char beg)
|
||||
(forward-line (1-
|
||||
(min
|
||||
(count-lines
|
||||
(point)
|
||||
(point-max))
|
||||
(aw--face-rel-height))))
|
||||
(while (and (< (point) end)
|
||||
(< (- (line-end-position)
|
||||
(line-beginning-position))
|
||||
h))
|
||||
(forward-line))
|
||||
(+ (point) h)))))
|
||||
|
||||
(defun aw--after-make-frame (f)
|
||||
(aw-update)
|
||||
(make-frame-visible f))
|
||||
|
||||
;;* Mode line
|
||||
;;;###autoload
|
||||
(define-minor-mode ace-window-display-mode
|
||||
"Minor mode for showing the ace window key in the mode line."
|
||||
:global t
|
||||
(if ace-window-display-mode
|
||||
(progn
|
||||
(aw-update)
|
||||
(set-default
|
||||
'mode-line-format
|
||||
`((ace-window-display-mode
|
||||
(:eval (window-parameter (selected-window) 'ace-window-path)))
|
||||
,@(assq-delete-all
|
||||
'ace-window-display-mode
|
||||
(default-value 'mode-line-format))))
|
||||
(force-mode-line-update t)
|
||||
(add-hook 'window-configuration-change-hook 'aw-update)
|
||||
;; Add at the end so does not precede select-frame call.
|
||||
(add-hook 'after-make-frame-functions #'aw--after-make-frame t))
|
||||
(set-default
|
||||
'mode-line-format
|
||||
(assq-delete-all
|
||||
'ace-window-display-mode
|
||||
(default-value 'mode-line-format)))
|
||||
(remove-hook 'window-configuration-change-hook 'aw-update)
|
||||
(remove-hook 'after-make-frame-functions 'aw--after-make-frame)))
|
||||
|
||||
(defun aw-update ()
|
||||
"Update ace-window-path window parameter for all windows.
|
||||
|
||||
Ensure all windows are labeled so the user can select a specific
|
||||
one, even from the set of windows typically ignored when making a
|
||||
window list."
|
||||
(let ((aw-ignore-on)
|
||||
(aw-ignore-current)
|
||||
(ignore-window-parameters t))
|
||||
(avy-traverse
|
||||
(avy-tree (aw-window-list) aw-keys)
|
||||
(lambda (path leaf)
|
||||
(set-window-parameter
|
||||
leaf 'ace-window-path
|
||||
(propertize
|
||||
(apply #'string (reverse path))
|
||||
'face 'aw-mode-line-face))))))
|
||||
|
||||
(provide 'ace-window)
|
||||
|
||||
;;; ace-window.el ends here
|
||||
Binary file not shown.
|
|
@ -1,70 +0,0 @@
|
|||
;;; all-the-icons-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*-
|
||||
;; Generated by the `loaddefs-generate' function.
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path)))
|
||||
|
||||
|
||||
|
||||
;;; Generated autoloads from all-the-icons.el
|
||||
|
||||
(autoload 'all-the-icons-icon-for-dir "all-the-icons" "\
|
||||
Get the formatted icon for DIR.
|
||||
ARG-OVERRIDES should be a plist containining `:height',
|
||||
`:v-adjust' or `:face' properties like in the normal icon
|
||||
inserting functions.
|
||||
|
||||
Note: You want chevron, please use `all-the-icons-icon-for-dir-with-chevron'.
|
||||
|
||||
(fn DIR &rest ARG-OVERRIDES)")
|
||||
(autoload 'all-the-icons-icon-for-file "all-the-icons" "\
|
||||
Get the formatted icon for FILE.
|
||||
ARG-OVERRIDES should be a plist containining `:height',
|
||||
`:v-adjust' or `:face' properties like in the normal icon
|
||||
inserting functions.
|
||||
|
||||
(fn FILE &rest ARG-OVERRIDES)")
|
||||
(autoload 'all-the-icons-icon-for-mode "all-the-icons" "\
|
||||
Get the formatted icon for MODE.
|
||||
ARG-OVERRIDES should be a plist containining `:height',
|
||||
`:v-adjust' or `:face' properties like in the normal icon
|
||||
inserting functions.
|
||||
|
||||
(fn MODE &rest ARG-OVERRIDES)")
|
||||
(autoload 'all-the-icons-icon-for-url "all-the-icons" "\
|
||||
Get the formatted icon for URL.
|
||||
If an icon for URL isn't found in `all-the-icons-url-alist', a globe is used.
|
||||
ARG-OVERRIDES should be a plist containining `:height',
|
||||
`:v-adjust' or `:face' properties like in the normal icon
|
||||
inserting functions.
|
||||
|
||||
(fn URL &rest ARG-OVERRIDES)")
|
||||
(autoload 'all-the-icons-install-fonts "all-the-icons" "\
|
||||
Helper function to download and install the latests fonts based on OS.
|
||||
When PFX is non-nil, ignore the prompt and just install
|
||||
|
||||
(fn &optional PFX)" t)
|
||||
(autoload 'all-the-icons-insert "all-the-icons" "\
|
||||
Interactive icon insertion function.
|
||||
When Prefix ARG is non-nil, insert the propertized icon.
|
||||
When FAMILY is non-nil, limit the candidates to the icon set matching it.
|
||||
|
||||
(fn &optional ARG FAMILY)" t)
|
||||
(register-definition-prefixes "all-the-icons" '("all-the-icons-"))
|
||||
|
||||
;;; End of scraped data
|
||||
|
||||
(provide 'all-the-icons-autoloads)
|
||||
|
||||
;; Local Variables:
|
||||
;; version-control: never
|
||||
;; no-byte-compile: t
|
||||
;; no-update-autoloads: t
|
||||
;; no-native-compile: t
|
||||
;; coding: utf-8-emacs-unix
|
||||
;; End:
|
||||
|
||||
;;; all-the-icons-autoloads.el ends here
|
||||
|
|
@ -1,229 +0,0 @@
|
|||
;;; all-the-icons-faces.el --- A module of faces for all-the-icons -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2016 Dominic Charlesworth <dgc336@gmail.com>
|
||||
|
||||
;; Author: Dominic Charlesworth <dgc336@gmail.com>
|
||||
;; Package-Requires: ((emacs "24.3"))
|
||||
;; URL: https://github.com/domtronn/all-the-icons.el
|
||||
;; Keywords: convenient, lisp
|
||||
|
||||
;; 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This file contains all of the faces used by the package for
|
||||
;; colouring icons
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defgroup all-the-icons-faces nil
|
||||
"Manage how All The Icons icons are coloured and themed."
|
||||
:prefix "all-the-icons-"
|
||||
:group 'tools
|
||||
:group 'all-the-icons)
|
||||
|
||||
|
||||
;; red
|
||||
(defface all-the-icons-red
|
||||
'((((background dark)) :foreground "#AC4142")
|
||||
(((background light)) :foreground "#AC4142"))
|
||||
"Face for red icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-lred
|
||||
'((((background dark)) :foreground "#EB595A")
|
||||
(((background light)) :foreground "#EB595A"))
|
||||
"Face for lred icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-dred
|
||||
'((((background dark)) :foreground "#843031")
|
||||
(((background light)) :foreground "#843031"))
|
||||
"Face for dred icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-red-alt
|
||||
'((((background dark)) :foreground "#ce5643")
|
||||
(((background light)) :foreground "#843031"))
|
||||
"Face for dred icons"
|
||||
:group 'all-the-icons-faces)
|
||||
|
||||
;; green
|
||||
(defface all-the-icons-green
|
||||
'((((background dark)) :foreground "#90A959")
|
||||
(((background light)) :foreground "#90A959"))
|
||||
"Face for green icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-lgreen
|
||||
'((((background dark)) :foreground "#C6E87A")
|
||||
(((background light)) :foreground "#3D6837"))
|
||||
"Face for lgreen icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-dgreen
|
||||
'((((background dark)) :foreground "#6D8143")
|
||||
(((background light)) :foreground "#6D8143"))
|
||||
"Face for dgreen icons"
|
||||
:group 'all-the-icons-faces)
|
||||
|
||||
;; yellow
|
||||
(defface all-the-icons-yellow
|
||||
'((((background dark)) :foreground "#FFD446")
|
||||
(((background light)) :foreground "#FFCC0E"))
|
||||
"Face for yellow icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-lyellow
|
||||
'((((background dark)) :foreground "#FFC16D")
|
||||
(((background light)) :foreground "#FF9300"))
|
||||
"Face for lyellow icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-dyellow
|
||||
'((((background dark)) :foreground "#B48D56")
|
||||
(((background light)) :foreground "#B48D56"))
|
||||
"Face for dyellow icons"
|
||||
:group 'all-the-icons-faces)
|
||||
|
||||
;; blue
|
||||
(defface all-the-icons-blue
|
||||
'((((background dark)) :foreground "#6A9FB5")
|
||||
(((background light)) :foreground "#6A9FB5"))
|
||||
"Face for blue icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-blue-alt
|
||||
'((((background dark)) :foreground "#2188b6")
|
||||
(((background light)) :foreground "#2188b6"))
|
||||
"Face for blue icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-lblue
|
||||
'((((background dark)) :foreground "#8FD7F4")
|
||||
(((background light)) :foreground "#677174"))
|
||||
"Face for lblue icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-dblue
|
||||
'((((background dark)) :foreground "#446674")
|
||||
(((background light)) :foreground "#446674"))
|
||||
"Face for dblue icons"
|
||||
:group 'all-the-icons-faces)
|
||||
|
||||
;; maroon
|
||||
(defface all-the-icons-maroon
|
||||
'((((background dark)) :foreground "#8F5536")
|
||||
(((background light)) :foreground "#8F5536"))
|
||||
"Face for maroon icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-lmaroon
|
||||
'((((background dark)) :foreground "#CE7A4E")
|
||||
(((background light)) :foreground "#CE7A4E"))
|
||||
"Face for lmaroon icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-dmaroon
|
||||
'((((background dark)) :foreground "#72584B")
|
||||
(((background light)) :foreground "#72584B"))
|
||||
"Face for dmaroon icons"
|
||||
:group 'all-the-icons-faces)
|
||||
|
||||
;; purple
|
||||
(defface all-the-icons-purple
|
||||
'((((background dark)) :foreground "#AA759F")
|
||||
(((background light)) :foreground "#68295B"))
|
||||
"Face for purple icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-purple-alt
|
||||
'((((background dark)) :foreground "#5D54E1")
|
||||
(((background light)) :foreground "#5D54E1"))
|
||||
"Face for purple icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-lpurple
|
||||
'((((background dark)) :foreground "#E69DD6")
|
||||
(((background light)) :foreground "#E69DD6"))
|
||||
"Face for lpurple icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-dpurple
|
||||
'((((background dark)) :foreground "#694863")
|
||||
(((background light)) :foreground "#694863"))
|
||||
"Face for dpurple icons"
|
||||
:group 'all-the-icons-faces)
|
||||
|
||||
;; orange
|
||||
(defface all-the-icons-orange
|
||||
'((((background dark)) :foreground "#D4843E")
|
||||
(((background light)) :foreground "#D4843E"))
|
||||
"Face for orange icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-lorange
|
||||
'((((background dark)) :foreground "#FFA500")
|
||||
(((background light)) :foreground "#FFA500"))
|
||||
"Face for lorange icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-dorange
|
||||
'((((background dark)) :foreground "#915B2D")
|
||||
(((background light)) :foreground "#915B2D"))
|
||||
"Face for dorange icons"
|
||||
:group 'all-the-icons-faces)
|
||||
|
||||
;; cyan
|
||||
(defface all-the-icons-cyan
|
||||
'((((background dark)) :foreground "#75B5AA")
|
||||
(((background light)) :foreground "#75B5AA"))
|
||||
"Face for cyan icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-cyan-alt
|
||||
'((((background dark)) :foreground "#61dafb")
|
||||
(((background light)) :foreground "#0595bd"))
|
||||
"Face for cyan icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-lcyan
|
||||
'((((background dark)) :foreground "#A5FDEC")
|
||||
(((background light)) :foreground "#2C7D6E"))
|
||||
"Face for lcyan icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-dcyan
|
||||
'((((background dark)) :foreground "#48746D")
|
||||
(((background light)) :foreground "#48746D"))
|
||||
"Face for dcyan icons"
|
||||
:group 'all-the-icons-faces)
|
||||
|
||||
;; pink
|
||||
(defface all-the-icons-pink
|
||||
'((((background dark)) :foreground "#F2B4B8")
|
||||
(((background light)) :foreground "#FC505B"))
|
||||
"Face for pink icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-lpink
|
||||
'((((background dark)) :foreground "#FFBDC1")
|
||||
(((background light)) :foreground "#FF505B"))
|
||||
"Face for lpink icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-dpink
|
||||
'((((background dark)) :foreground "#B18286")
|
||||
(((background light)) :foreground "#7E5D5F"))
|
||||
"Face for dpink icons"
|
||||
:group 'all-the-icons-faces)
|
||||
|
||||
;; silver
|
||||
(defface all-the-icons-silver
|
||||
'((((background dark)) :foreground "#716E68")
|
||||
(((background light)) :foreground "#716E68"))
|
||||
"Face for silver icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-lsilver
|
||||
'((((background dark)) :foreground "#B9B6AA")
|
||||
(((background light)) :foreground "#7F7869"))
|
||||
"Face for lsilver icons"
|
||||
:group 'all-the-icons-faces)
|
||||
(defface all-the-icons-dsilver
|
||||
'((((background dark)) :foreground "#838484")
|
||||
(((background light)) :foreground "#838484"))
|
||||
"Face for dsilver icons"
|
||||
:group 'all-the-icons-faces)
|
||||
|
||||
|
||||
(provide 'all-the-icons-faces)
|
||||
;;; all-the-icons-faces.el ends here
|
||||
Binary file not shown.
|
|
@ -1,10 +0,0 @@
|
|||
;; -*- no-byte-compile: t; lexical-binding: nil -*-
|
||||
(define-package "all-the-icons" "20250527.927"
|
||||
"A library for inserting Developer icons."
|
||||
'((emacs "24.3"))
|
||||
:url "https://github.com/domtronn/all-the-icons.el"
|
||||
:commit "4778632b29c8c8d2b7cd9ce69535d0be01d846f9"
|
||||
:revdesc "4778632b29c8"
|
||||
:keywords '("convenient" "lisp")
|
||||
:authors '(("Dominic Charlesworth" . "dgc336@gmail.com"))
|
||||
:maintainers '(("Dominic Charlesworth" . "dgc336@gmail.com")))
|
||||
File diff suppressed because it is too large
Load diff
Binary file not shown.
|
|
@ -1,72 +0,0 @@
|
|||
;; -*- lexical-binding: t -*-
|
||||
|
||||
(defvar all-the-icons-data/alltheicons-alist
|
||||
'(
|
||||
|
||||
( "apache" . "\xe909" )
|
||||
( "atom" . "\xe917" )
|
||||
( "aws" . "\xe90c" )
|
||||
( "bower" . "\xe918" )
|
||||
( "c" . "\xe915" )
|
||||
( "c-line" . "\xe90f" )
|
||||
( "clojure" . "\xe919" )
|
||||
( "clojure-line" . "\xe91a" )
|
||||
( "coffeescript" . "\xe914" )
|
||||
( "cplusplus" . "\xe913" )
|
||||
( "cplusplus-line" . "\xe910" )
|
||||
( "csharp" . "\xe911" )
|
||||
( "csharp-line" . "\xe912" )
|
||||
( "css3" . "\xe91b" )
|
||||
( "css3-alt" . "\xe91c" )
|
||||
( "d3" . "\xe90e" )
|
||||
( "dlang" . "\xe935" )
|
||||
( "elixir" . "\xe936" )
|
||||
( "erlang" . "\xe934" )
|
||||
( "git" . "\xe907" )
|
||||
( "go" . "\xe91d" )
|
||||
( "google-drive" . "\xe91e" )
|
||||
( "grunt" . "\xe90d" )
|
||||
( "grunt-line" . "\xe91f" )
|
||||
( "gulp" . "\xe920" )
|
||||
( "haskell" . "\xe921" )
|
||||
( "html5" . "\xe932" )
|
||||
( "jasmine" . "\xe904" )
|
||||
( "java" . "\xe922" )
|
||||
( "javascript" . "\xe906" )
|
||||
( "javascript-badge" . "\xe923" )
|
||||
( "javascript-shield" . "\xe924" )
|
||||
( "less" . "\xe90b" )
|
||||
( "nginx" . "\xe933" )
|
||||
( "nodejs" . "\xe925" )
|
||||
( "perl" . "\xe905" )
|
||||
( "perldocs" . "\xe926" )
|
||||
( "postgresql" . "\xe938" )
|
||||
( "prolog" . "\xe927" )
|
||||
( "python" . "\xe928" )
|
||||
( "react" . "\xe929" )
|
||||
( "ruby" . "\xe92a" )
|
||||
( "ruby-alt" . "\xe92b" )
|
||||
( "rust" . "\xe92c" )
|
||||
( "sass" . "\xe92d" )
|
||||
( "scala" . "\xe908" )
|
||||
( "script" . "\xe90a" )
|
||||
( "spring" . "\xe937" )
|
||||
( "stylus" . "\xe92e" )
|
||||
( "svg" . "\xe903" )
|
||||
( "swift" . "\xe92f" )
|
||||
( "terminal" . "\xe930" )
|
||||
( "terminal-alt" . "\xe931" )
|
||||
( "battery-charging" . "\xe939" )
|
||||
|
||||
( "arrow-left" . "\xe93a" )
|
||||
( "arrow-right" . "\xe93b" )
|
||||
( "cup-left" . "\xe93c" )
|
||||
( "cup-right" . "\xe93d" )
|
||||
( "slant-left" . "\xe93e" )
|
||||
( "slant-right" . "\xe93f" )
|
||||
( "wave-left" . "\xe940" )
|
||||
( "wave-right" . "\xe941" )
|
||||
|
||||
))
|
||||
|
||||
(provide 'data-alltheicons)
|
||||
Binary file not shown.
|
|
@ -1,643 +0,0 @@
|
|||
;; -*- lexical-binding: t -*-
|
||||
|
||||
(defvar all-the-icons-data/fa-icon-alist
|
||||
'(
|
||||
|
||||
("500px" . "\xf26e")
|
||||
("adjust" . "\xf042")
|
||||
("adn" . "\xf170")
|
||||
("align-center" . "\xf037")
|
||||
("align-justify" . "\xf039")
|
||||
("align-left" . "\xf036")
|
||||
("align-right" . "\xf038")
|
||||
("amazon" . "\xf270")
|
||||
("ambulance" . "\xf0f9")
|
||||
("american-sign-language-interpreting" . "\xf2a3")
|
||||
("anchor" . "\xf13d")
|
||||
("android" . "\xf17b")
|
||||
("angellist" . "\xf209")
|
||||
("angle-double-down" . "\xf103")
|
||||
("angle-double-left" . "\xf100")
|
||||
("angle-double-right" . "\xf101")
|
||||
("angle-double-up" . "\xf102")
|
||||
("angle-down" . "\xf107")
|
||||
("angle-left" . "\xf104")
|
||||
("angle-right" . "\xf105")
|
||||
("angle-up" . "\xf106")
|
||||
("apple" . "\xf179")
|
||||
("archive" . "\xf187")
|
||||
("area-chart" . "\xf1fe")
|
||||
("arrow-circle-down" . "\xf0ab")
|
||||
("arrow-circle-left" . "\xf0a8")
|
||||
("arrow-circle-o-down" . "\xf01a")
|
||||
("arrow-circle-o-left" . "\xf190")
|
||||
("arrow-circle-o-right" . "\xf18e")
|
||||
("arrow-circle-o-up" . "\xf01b")
|
||||
("arrow-circle-right" . "\xf0a9")
|
||||
("arrow-circle-up" . "\xf0aa")
|
||||
("arrow-down" . "\xf063")
|
||||
("arrow-left" . "\xf060")
|
||||
("arrow-right" . "\xf061")
|
||||
("arrow-up" . "\xf062")
|
||||
("arrows" . "\xf047")
|
||||
("arrows-alt" . "\xf0b2")
|
||||
("arrows-h" . "\xf07e")
|
||||
("arrows-v" . "\xf07d")
|
||||
("assistive-listening-systems" . "\xf2a2")
|
||||
("asterisk" . "\xf069")
|
||||
("at" . "\xf1fa")
|
||||
("audio-description" . "\xf29e")
|
||||
("backward" . "\xf04a")
|
||||
("balance-scale" . "\xf24e")
|
||||
("ban" . "\xf05e")
|
||||
("bar-chart" . "\xf080")
|
||||
("barcode" . "\xf02a")
|
||||
("bars" . "\xf0c9")
|
||||
("battery-empty" . "\xf244")
|
||||
("battery-full" . "\xf240")
|
||||
("battery-half" . "\xf242")
|
||||
("battery-quarter" . "\xf243")
|
||||
("battery-three-quarters" . "\xf241")
|
||||
("bed" . "\xf236")
|
||||
("beer" . "\xf0fc")
|
||||
("behance" . "\xf1b4")
|
||||
("behance-square" . "\xf1b5")
|
||||
("bell" . "\xf0f3")
|
||||
("bell-o" . "\xf0a2")
|
||||
("bell-slash" . "\xf1f6")
|
||||
("bell-slash-o" . "\xf1f7")
|
||||
("bicycle" . "\xf206")
|
||||
("binoculars" . "\xf1e5")
|
||||
("birthday-cake" . "\xf1fd")
|
||||
("bitbucket" . "\xf171")
|
||||
("bitbucket-square" . "\xf172")
|
||||
("black-tie" . "\xf27e")
|
||||
("blind" . "\xf29d")
|
||||
("bluetooth" . "\xf293")
|
||||
("bluetooth-b" . "\xf294")
|
||||
("bold" . "\xf032")
|
||||
("bolt" . "\xf0e7")
|
||||
("bomb" . "\xf1e2")
|
||||
("book" . "\xf02d")
|
||||
("bookmark" . "\xf02e")
|
||||
("bookmark-o" . "\xf097")
|
||||
("braille" . "\xf2a1")
|
||||
("briefcase" . "\xf0b1")
|
||||
("btc" . "\xf15a")
|
||||
("bug" . "\xf188")
|
||||
("building" . "\xf1ad")
|
||||
("building-o" . "\xf0f7")
|
||||
("bullhorn" . "\xf0a1")
|
||||
("bullseye" . "\xf140")
|
||||
("bus" . "\xf207")
|
||||
("buysellads" . "\xf20d")
|
||||
("calculator" . "\xf1ec")
|
||||
("calendar" . "\xf073")
|
||||
("calendar-check-o" . "\xf274")
|
||||
("calendar-minus-o" . "\xf272")
|
||||
("calendar-o" . "\xf133")
|
||||
("calendar-plus-o" . "\xf271")
|
||||
("calendar-times-o" . "\xf273")
|
||||
("camera" . "\xf030")
|
||||
("camera-retro" . "\xf083")
|
||||
("car" . "\xf1b9")
|
||||
("caret-down" . "\xf0d7")
|
||||
("caret-left" . "\xf0d9")
|
||||
("caret-right" . "\xf0da")
|
||||
("caret-square-o-down" . "\xf150")
|
||||
("caret-square-o-left" . "\xf191")
|
||||
("caret-square-o-right" . "\xf152")
|
||||
("caret-square-o-up" . "\xf151")
|
||||
("caret-up" . "\xf0d8")
|
||||
("cart-arrow-down" . "\xf218")
|
||||
("cart-plus" . "\xf217")
|
||||
("cc" . "\xf20a")
|
||||
("cc-amex" . "\xf1f3")
|
||||
("cc-diners-club" . "\xf24c")
|
||||
("cc-discover" . "\xf1f2")
|
||||
("cc-jcb" . "\xf24b")
|
||||
("cc-mastercard" . "\xf1f1")
|
||||
("cc-paypal" . "\xf1f4")
|
||||
("cc-stripe" . "\xf1f5")
|
||||
("cc-visa" . "\xf1f0")
|
||||
("certificate" . "\xf0a3")
|
||||
("chain-broken" . "\xf127")
|
||||
("check" . "\xf00c")
|
||||
("check-circle" . "\xf058")
|
||||
("check-circle-o" . "\xf05d")
|
||||
("check-square" . "\xf14a")
|
||||
("check-square-o" . "\xf046")
|
||||
("chevron-circle-down" . "\xf13a")
|
||||
("chevron-circle-left" . "\xf137")
|
||||
("chevron-circle-right" . "\xf138")
|
||||
("chevron-circle-up" . "\xf139")
|
||||
("chevron-down" . "\xf078")
|
||||
("chevron-left" . "\xf053")
|
||||
("chevron-right" . "\xf054")
|
||||
("chevron-up" . "\xf077")
|
||||
("child" . "\xf1ae")
|
||||
("chrome" . "\xf268")
|
||||
("circle" . "\xf111")
|
||||
("circle-o" . "\xf10c")
|
||||
("circle-o-notch" . "\xf1ce")
|
||||
("circle-thin" . "\xf1db")
|
||||
("clipboard" . "\xf0ea")
|
||||
("clock-o" . "\xf017")
|
||||
("clone" . "\xf24d")
|
||||
("cloud" . "\xf0c2")
|
||||
("cloud-download" . "\xf0ed")
|
||||
("cloud-upload" . "\xf0ee")
|
||||
("code" . "\xf121")
|
||||
("code-fork" . "\xf126")
|
||||
("codepen" . "\xf1cb")
|
||||
("codiepie" . "\xf284")
|
||||
("coffee" . "\xf0f4")
|
||||
("cog" . "\xf013")
|
||||
("cogs" . "\xf085")
|
||||
("columns" . "\xf0db")
|
||||
("comment" . "\xf075")
|
||||
("comment-o" . "\xf0e5")
|
||||
("commenting" . "\xf27a")
|
||||
("commenting-o" . "\xf27b")
|
||||
("comments" . "\xf086")
|
||||
("comments-o" . "\xf0e6")
|
||||
("compass" . "\xf14e")
|
||||
("compress" . "\xf066")
|
||||
("connectdevelop" . "\xf20e")
|
||||
("contao" . "\xf26d")
|
||||
("copyright" . "\xf1f9")
|
||||
("creative-commons" . "\xf25e")
|
||||
("credit-card" . "\xf09d")
|
||||
("credit-card-alt" . "\xf283")
|
||||
("crop" . "\xf125")
|
||||
("crosshairs" . "\xf05b")
|
||||
("css3" . "\xf13c")
|
||||
("cube" . "\xf1b2")
|
||||
("cubes" . "\xf1b3")
|
||||
("cutlery" . "\xf0f5")
|
||||
("dashcube" . "\xf210")
|
||||
("database" . "\xf1c0")
|
||||
("deaf" . "\xf2a4")
|
||||
("delicious" . "\xf1a5")
|
||||
("desktop" . "\xf108")
|
||||
("deviantart" . "\xf1bd")
|
||||
("diamond" . "\xf219")
|
||||
("digg" . "\xf1a6")
|
||||
("dot-circle-o" . "\xf192")
|
||||
("download" . "\xf019")
|
||||
("dribbble" . "\xf17d")
|
||||
("dropbox" . "\xf16b")
|
||||
("drupal" . "\xf1a9")
|
||||
("edge" . "\xf282")
|
||||
("eject" . "\xf052")
|
||||
("ellipsis-h" . "\xf141")
|
||||
("ellipsis-v" . "\xf142")
|
||||
("empire" . "\xf1d1")
|
||||
("envelope" . "\xf0e0")
|
||||
("envelope-o" . "\xf003")
|
||||
("envelope-square" . "\xf199")
|
||||
("envira" . "\xf299")
|
||||
("eraser" . "\xf12d")
|
||||
("eur" . "\xf153")
|
||||
("exchange" . "\xf0ec")
|
||||
("exclamation" . "\xf12a")
|
||||
("exclamation-circle" . "\xf06a")
|
||||
("exclamation-triangle" . "\xf071")
|
||||
("expand" . "\xf065")
|
||||
("expeditedssl" . "\xf23e")
|
||||
("external-link" . "\xf08e")
|
||||
("external-link-square" . "\xf14c")
|
||||
("eye" . "\xf06e")
|
||||
("eye-slash" . "\xf070")
|
||||
("eyedropper" . "\xf1fb")
|
||||
("facebook" . "\xf09a")
|
||||
("facebook-official" . "\xf230")
|
||||
("facebook-square" . "\xf082")
|
||||
("fast-backward" . "\xf049")
|
||||
("fast-forward" . "\xf050")
|
||||
("fax" . "\xf1ac")
|
||||
("female" . "\xf182")
|
||||
("fighter-jet" . "\xf0fb")
|
||||
("file" . "\xf15b")
|
||||
("file-archive-o" . "\xf1c6")
|
||||
("file-audio-o" . "\xf1c7")
|
||||
("file-code-o" . "\xf1c9")
|
||||
("file-excel-o" . "\xf1c3")
|
||||
("file-image-o" . "\xf1c5")
|
||||
("file-o" . "\xf016")
|
||||
("file-pdf-o" . "\xf1c1")
|
||||
("file-powerpoint-o" . "\xf1c4")
|
||||
("file-text" . "\xf15c")
|
||||
("file-text-o" . "\xf0f6")
|
||||
("file-video-o" . "\xf1c8")
|
||||
("file-word-o" . "\xf1c2")
|
||||
("files-o" . "\xf0c5")
|
||||
("film" . "\xf008")
|
||||
("filter" . "\xf0b0")
|
||||
("fire" . "\xf06d")
|
||||
("fire-extinguisher" . "\xf134")
|
||||
("firefox" . "\xf269")
|
||||
("first-order" . "\xf2b0")
|
||||
("flag" . "\xf024")
|
||||
("flag-checkered" . "\xf11e")
|
||||
("flag-o" . "\xf11d")
|
||||
("flask" . "\xf0c3")
|
||||
("flickr" . "\xf16e")
|
||||
("floppy-o" . "\xf0c7")
|
||||
("folder" . "\xf07b")
|
||||
("folder-o" . "\xf114")
|
||||
("folder-open" . "\xf07c")
|
||||
("folder-open-o" . "\xf115")
|
||||
("font" . "\xf031")
|
||||
("font-awesome" . "\xf2b4")
|
||||
("fonticons" . "\xf280")
|
||||
("fort-awesome" . "\xf286")
|
||||
("forumbee" . "\xf211")
|
||||
("forward" . "\xf04e")
|
||||
("foursquare" . "\xf180")
|
||||
("frown-o" . "\xf119")
|
||||
("futbol-o" . "\xf1e3")
|
||||
("gamepad" . "\xf11b")
|
||||
("gavel" . "\xf0e3")
|
||||
("gbp" . "\xf154")
|
||||
("genderless" . "\xf22d")
|
||||
("get-pocket" . "\xf265")
|
||||
("gg" . "\xf260")
|
||||
("gg-circle" . "\xf261")
|
||||
("gift" . "\xf06b")
|
||||
("git" . "\xf1d3")
|
||||
("git-square" . "\xf1d2")
|
||||
("github" . "\xf09b")
|
||||
("github-alt" . "\xf113")
|
||||
("github-square" . "\xf092")
|
||||
("gitlab" . "\xf296")
|
||||
("glass" . "\xf000")
|
||||
("glide" . "\xf2a5")
|
||||
("glide-g" . "\xf2a6")
|
||||
("globe" . "\xf0ac")
|
||||
("google" . "\xf1a0")
|
||||
("google-plus" . "\xf0d5")
|
||||
("google-plus-official" . "\xf2b3")
|
||||
("google-plus-square" . "\xf0d4")
|
||||
("google-wallet" . "\xf1ee")
|
||||
("graduation-cap" . "\xf19d")
|
||||
("gratipay" . "\xf184")
|
||||
("h-square" . "\xf0fd")
|
||||
("hacker-news" . "\xf1d4")
|
||||
("hand-lizard-o" . "\xf258")
|
||||
("hand-o-down" . "\xf0a7")
|
||||
("hand-o-left" . "\xf0a5")
|
||||
("hand-o-right" . "\xf0a4")
|
||||
("hand-o-up" . "\xf0a6")
|
||||
("hand-paper-o" . "\xf256")
|
||||
("hand-peace-o" . "\xf25b")
|
||||
("hand-pointer-o" . "\xf25a")
|
||||
("hand-rock-o" . "\xf255")
|
||||
("hand-scissors-o" . "\xf257")
|
||||
("hand-spock-o" . "\xf259")
|
||||
("hashtag" . "\xf292")
|
||||
("hdd-o" . "\xf0a0")
|
||||
("header" . "\xf1dc")
|
||||
("headphones" . "\xf025")
|
||||
("heart" . "\xf004")
|
||||
("heart-o" . "\xf08a")
|
||||
("heartbeat" . "\xf21e")
|
||||
("history" . "\xf1da")
|
||||
("home" . "\xf015")
|
||||
("hospital-o" . "\xf0f8")
|
||||
("hourglass" . "\xf254")
|
||||
("hourglass-end" . "\xf253")
|
||||
("hourglass-half" . "\xf252")
|
||||
("hourglass-o" . "\xf250")
|
||||
("hourglass-start" . "\xf251")
|
||||
("houzz" . "\xf27c")
|
||||
("html5" . "\xf13b")
|
||||
("i-cursor" . "\xf246")
|
||||
("ils" . "\xf20b")
|
||||
("inbox" . "\xf01c")
|
||||
("indent" . "\xf03c")
|
||||
("industry" . "\xf275")
|
||||
("info" . "\xf129")
|
||||
("info-circle" . "\xf05a")
|
||||
("inr" . "\xf156")
|
||||
("instagram" . "\xf16d")
|
||||
("internet-explorer" . "\xf26b")
|
||||
("ioxhost" . "\xf208")
|
||||
("italic" . "\xf033")
|
||||
("joomla" . "\xf1aa")
|
||||
("jpy" . "\xf157")
|
||||
("jsfiddle" . "\xf1cc")
|
||||
("key" . "\xf084")
|
||||
("keyboard-o" . "\xf11c")
|
||||
("krw" . "\xf159")
|
||||
("language" . "\xf1ab")
|
||||
("laptop" . "\xf109")
|
||||
("lastfm" . "\xf202")
|
||||
("lastfm-square" . "\xf203")
|
||||
("leaf" . "\xf06c")
|
||||
("leanpub" . "\xf212")
|
||||
("lemon-o" . "\xf094")
|
||||
("level-down" . "\xf149")
|
||||
("level-up" . "\xf148")
|
||||
("life-ring" . "\xf1cd")
|
||||
("lightbulb-o" . "\xf0eb")
|
||||
("line-chart" . "\xf201")
|
||||
("link" . "\xf0c1")
|
||||
("linkedin" . "\xf0e1")
|
||||
("linkedin-square" . "\xf08c")
|
||||
("linux" . "\xf17c")
|
||||
("list" . "\xf03a")
|
||||
("list-alt" . "\xf022")
|
||||
("list-ol" . "\xf0cb")
|
||||
("list-ul" . "\xf0ca")
|
||||
("location-arrow" . "\xf124")
|
||||
("lock" . "\xf023")
|
||||
("long-arrow-down" . "\xf175")
|
||||
("long-arrow-left" . "\xf177")
|
||||
("long-arrow-right" . "\xf178")
|
||||
("long-arrow-up" . "\xf176")
|
||||
("low-vision" . "\xf2a8")
|
||||
("magic" . "\xf0d0")
|
||||
("magnet" . "\xf076")
|
||||
("male" . "\xf183")
|
||||
("map" . "\xf279")
|
||||
("map-marker" . "\xf041")
|
||||
("map-o" . "\xf278")
|
||||
("map-pin" . "\xf276")
|
||||
("map-signs" . "\xf277")
|
||||
("mars" . "\xf222")
|
||||
("mars-double" . "\xf227")
|
||||
("mars-stroke" . "\xf229")
|
||||
("mars-stroke-h" . "\xf22b")
|
||||
("mars-stroke-v" . "\xf22a")
|
||||
("maxcdn" . "\xf136")
|
||||
("meanpath" . "\xf20c")
|
||||
("medium" . "\xf23a")
|
||||
("medkit" . "\xf0fa")
|
||||
("meh-o" . "\xf11a")
|
||||
("mercury" . "\xf223")
|
||||
("microphone" . "\xf130")
|
||||
("microphone-slash" . "\xf131")
|
||||
("minus" . "\xf068")
|
||||
("minus-circle" . "\xf056")
|
||||
("minus-square" . "\xf146")
|
||||
("minus-square-o" . "\xf147")
|
||||
("mixcloud" . "\xf289")
|
||||
("mobile" . "\xf10b")
|
||||
("modx" . "\xf285")
|
||||
("money" . "\xf0d6")
|
||||
("moon-o" . "\xf186")
|
||||
("motorcycle" . "\xf21c")
|
||||
("mouse-pointer" . "\xf245")
|
||||
("music" . "\xf001")
|
||||
("neuter" . "\xf22c")
|
||||
("newspaper-o" . "\xf1ea")
|
||||
("object-group" . "\xf247")
|
||||
("object-ungroup" . "\xf248")
|
||||
("odnoklassniki" . "\xf263")
|
||||
("odnoklassniki-square" . "\xf264")
|
||||
("opencart" . "\xf23d")
|
||||
("openid" . "\xf19b")
|
||||
("opera" . "\xf26a")
|
||||
("optin-monster" . "\xf23c")
|
||||
("outdent" . "\xf03b")
|
||||
("pagelines" . "\xf18c")
|
||||
("paint-brush" . "\xf1fc")
|
||||
("paper-plane" . "\xf1d8")
|
||||
("paper-plane-o" . "\xf1d9")
|
||||
("paperclip" . "\xf0c6")
|
||||
("paragraph" . "\xf1dd")
|
||||
("pause" . "\xf04c")
|
||||
("pause-circle" . "\xf28b")
|
||||
("pause-circle-o" . "\xf28c")
|
||||
("paw" . "\xf1b0")
|
||||
("paypal" . "\xf1ed")
|
||||
("pencil" . "\xf040")
|
||||
("pencil-square" . "\xf14b")
|
||||
("pencil-square-o" . "\xf044")
|
||||
("percent" . "\xf295")
|
||||
("phone" . "\xf095")
|
||||
("phone-square" . "\xf098")
|
||||
("picture-o" . "\xf03e")
|
||||
("pie-chart" . "\xf200")
|
||||
("pied-piper" . "\xf2ae")
|
||||
("pied-piper-alt" . "\xf1a8")
|
||||
("pied-piper-pp" . "\xf1a7")
|
||||
("pinterest" . "\xf0d2")
|
||||
("pinterest-p" . "\xf231")
|
||||
("pinterest-square" . "\xf0d3")
|
||||
("plane" . "\xf072")
|
||||
("play" . "\xf04b")
|
||||
("play-circle" . "\xf144")
|
||||
("play-circle-o" . "\xf01d")
|
||||
("plug" . "\xf1e6")
|
||||
("plus" . "\xf067")
|
||||
("plus-circle" . "\xf055")
|
||||
("plus-square" . "\xf0fe")
|
||||
("plus-square-o" . "\xf196")
|
||||
("power-off" . "\xf011")
|
||||
("print" . "\xf02f")
|
||||
("product-hunt" . "\xf288")
|
||||
("puzzle-piece" . "\xf12e")
|
||||
("qq" . "\xf1d6")
|
||||
("qrcode" . "\xf029")
|
||||
("question" . "\xf128")
|
||||
("question-circle" . "\xf059")
|
||||
("question-circle-o" . "\xf29c")
|
||||
("quote-left" . "\xf10d")
|
||||
("quote-right" . "\xf10e")
|
||||
("random" . "\xf074")
|
||||
("rebel" . "\xf1d0")
|
||||
("recycle" . "\xf1b8")
|
||||
("reddit" . "\xf1a1")
|
||||
("reddit-alien" . "\xf281")
|
||||
("reddit-square" . "\xf1a2")
|
||||
("refresh" . "\xf021")
|
||||
("registered" . "\xf25d")
|
||||
("renren" . "\xf18b")
|
||||
("repeat" . "\xf01e")
|
||||
("reply" . "\xf112")
|
||||
("reply-all" . "\xf122")
|
||||
("retweet" . "\xf079")
|
||||
("road" . "\xf018")
|
||||
("rocket" . "\xf135")
|
||||
("rss" . "\xf09e")
|
||||
("rss-square" . "\xf143")
|
||||
("rub" . "\xf158")
|
||||
("safari" . "\xf267")
|
||||
("scissors" . "\xf0c4")
|
||||
("scribd" . "\xf28a")
|
||||
("search" . "\xf002")
|
||||
("search-minus" . "\xf010")
|
||||
("search-plus" . "\xf00e")
|
||||
("sellsy" . "\xf213")
|
||||
("server" . "\xf233")
|
||||
("share" . "\xf064")
|
||||
("share-alt" . "\xf1e0")
|
||||
("share-alt-square" . "\xf1e1")
|
||||
("share-square" . "\xf14d")
|
||||
("share-square-o" . "\xf045")
|
||||
("shield" . "\xf132")
|
||||
("ship" . "\xf21a")
|
||||
("shirtsinbulk" . "\xf214")
|
||||
("shopping-bag" . "\xf290")
|
||||
("shopping-basket" . "\xf291")
|
||||
("shopping-cart" . "\xf07a")
|
||||
("sign-in" . "\xf090")
|
||||
("sign-language" . "\xf2a7")
|
||||
("sign-out" . "\xf08b")
|
||||
("signal" . "\xf012")
|
||||
("simplybuilt" . "\xf215")
|
||||
("sitemap" . "\xf0e8")
|
||||
("skyatlas" . "\xf216")
|
||||
("skype" . "\xf17e")
|
||||
("slack" . "\xf198")
|
||||
("sliders" . "\xf1de")
|
||||
("slideshare" . "\xf1e7")
|
||||
("smile-o" . "\xf118")
|
||||
("snapchat" . "\xf2ab")
|
||||
("snapchat-ghost" . "\xf2ac")
|
||||
("snapchat-square" . "\xf2ad")
|
||||
("sort" . "\xf0dc")
|
||||
("sort-alpha-asc" . "\xf15d")
|
||||
("sort-alpha-desc" . "\xf15e")
|
||||
("sort-amount-asc" . "\xf160")
|
||||
("sort-amount-desc" . "\xf161")
|
||||
("sort-asc" . "\xf0de")
|
||||
("sort-desc" . "\xf0dd")
|
||||
("sort-numeric-asc" . "\xf162")
|
||||
("sort-numeric-desc" . "\xf163")
|
||||
("soundcloud" . "\xf1be")
|
||||
("space-shuttle" . "\xf197")
|
||||
("spinner" . "\xf110")
|
||||
("spoon" . "\xf1b1")
|
||||
("spotify" . "\xf1bc")
|
||||
("square" . "\xf0c8")
|
||||
("square-o" . "\xf096")
|
||||
("stack-exchange" . "\xf18d")
|
||||
("stack-overflow" . "\xf16c")
|
||||
("star" . "\xf005")
|
||||
("star-half" . "\xf089")
|
||||
("star-half-o" . "\xf123")
|
||||
("star-o" . "\xf006")
|
||||
("steam" . "\xf1b6")
|
||||
("steam-square" . "\xf1b7")
|
||||
("step-backward" . "\xf048")
|
||||
("step-forward" . "\xf051")
|
||||
("stethoscope" . "\xf0f1")
|
||||
("sticky-note" . "\xf249")
|
||||
("sticky-note-o" . "\xf24a")
|
||||
("stop" . "\xf04d")
|
||||
("stop-circle" . "\xf28d")
|
||||
("stop-circle-o" . "\xf28e")
|
||||
("street-view" . "\xf21d")
|
||||
("strikethrough" . "\xf0cc")
|
||||
("stumbleupon" . "\xf1a4")
|
||||
("stumbleupon-circle" . "\xf1a3")
|
||||
("subscript" . "\xf12c")
|
||||
("subway" . "\xf239")
|
||||
("suitcase" . "\xf0f2")
|
||||
("sun-o" . "\xf185")
|
||||
("superscript" . "\xf12b")
|
||||
("table" . "\xf0ce")
|
||||
("tablet" . "\xf10a")
|
||||
("tachometer" . "\xf0e4")
|
||||
("tag" . "\xf02b")
|
||||
("tags" . "\xf02c")
|
||||
("tasks" . "\xf0ae")
|
||||
("taxi" . "\xf1ba")
|
||||
("television" . "\xf26c")
|
||||
("tencent-weibo" . "\xf1d5")
|
||||
("terminal" . "\xf120")
|
||||
("text-height" . "\xf034")
|
||||
("text-width" . "\xf035")
|
||||
("th" . "\xf00a")
|
||||
("th-large" . "\xf009")
|
||||
("th-list" . "\xf00b")
|
||||
("themeisle" . "\xf2b2")
|
||||
("thumb-tack" . "\xf08d")
|
||||
("thumbs-down" . "\xf165")
|
||||
("thumbs-o-down" . "\xf088")
|
||||
("thumbs-o-up" . "\xf087")
|
||||
("thumbs-up" . "\xf164")
|
||||
("ticket" . "\xf145")
|
||||
("times" . "\xf00d")
|
||||
("times-circle" . "\xf057")
|
||||
("times-circle-o" . "\xf05c")
|
||||
("tint" . "\xf043")
|
||||
("toggle-off" . "\xf204")
|
||||
("toggle-on" . "\xf205")
|
||||
("trademark" . "\xf25c")
|
||||
("train" . "\xf238")
|
||||
("transgender" . "\xf224")
|
||||
("transgender-alt" . "\xf225")
|
||||
("trash" . "\xf1f8")
|
||||
("trash-o" . "\xf014")
|
||||
("tree" . "\xf1bb")
|
||||
("trello" . "\xf181")
|
||||
("tripadvisor" . "\xf262")
|
||||
("trophy" . "\xf091")
|
||||
("truck" . "\xf0d1")
|
||||
("try" . "\xf195")
|
||||
("tty" . "\xf1e4")
|
||||
("tumblr" . "\xf173")
|
||||
("tumblr-square" . "\xf174")
|
||||
("twitch" . "\xf1e8")
|
||||
("twitter" . "\xf099")
|
||||
("twitter-square" . "\xf081")
|
||||
("umbrella" . "\xf0e9")
|
||||
("underline" . "\xf0cd")
|
||||
("undo" . "\xf0e2")
|
||||
("universal-access" . "\xf29a")
|
||||
("university" . "\xf19c")
|
||||
("unlock" . "\xf09c")
|
||||
("unlock-alt" . "\xf13e")
|
||||
("upload" . "\xf093")
|
||||
("usb" . "\xf287")
|
||||
("usd" . "\xf155")
|
||||
("user" . "\xf007")
|
||||
("user-md" . "\xf0f0")
|
||||
("user-plus" . "\xf234")
|
||||
("user-secret" . "\xf21b")
|
||||
("user-times" . "\xf235")
|
||||
("users" . "\xf0c0")
|
||||
("venus" . "\xf221")
|
||||
("venus-double" . "\xf226")
|
||||
("venus-mars" . "\xf228")
|
||||
("viacoin" . "\xf237")
|
||||
("viadeo" . "\xf2a9")
|
||||
("viadeo-square" . "\xf2aa")
|
||||
("video-camera" . "\xf03d")
|
||||
("vimeo" . "\xf27d")
|
||||
("vimeo-square" . "\xf194")
|
||||
("vine" . "\xf1ca")
|
||||
("vk" . "\xf189")
|
||||
("volume-control-phone" . "\xf2a0")
|
||||
("volume-down" . "\xf027")
|
||||
("volume-off" . "\xf026")
|
||||
("volume-up" . "\xf028")
|
||||
("weibo" . "\xf18a")
|
||||
("weixin" . "\xf1d7")
|
||||
("whatsapp" . "\xf232")
|
||||
("wheelchair" . "\xf193")
|
||||
("wheelchair-alt" . "\xf29b")
|
||||
("wifi" . "\xf1eb")
|
||||
("wikipedia-w" . "\xf266")
|
||||
("windows" . "\xf17a")
|
||||
("wordpress" . "\xf19a")
|
||||
("wpbeginner" . "\xf297")
|
||||
("wpforms" . "\xf298")
|
||||
("wrench" . "\xf0ad")
|
||||
("xing" . "\xf168")
|
||||
("xing-square" . "\xf169")
|
||||
("y-combinator" . "\xf23b")
|
||||
("yahoo" . "\xf19e")
|
||||
("yelp" . "\xf1e9")
|
||||
("yoast" . "\xf2b1")
|
||||
("youtube" . "\xf167")
|
||||
("youtube-play" . "\xf16a")
|
||||
("youtube-square" . "\xf166")
|
||||
|
||||
))
|
||||
|
||||
(provide 'data-faicons)
|
||||
Binary file not shown.
|
|
@ -1,504 +0,0 @@
|
|||
;; -*- lexical-binding: t -*-
|
||||
|
||||
(defvar all-the-icons-data/file-icon-alist
|
||||
'(
|
||||
|
||||
( "1c" . "\xa5ea" )
|
||||
( "1c-alt" . "\xea28" )
|
||||
( "MJML" . "\xea6f" )
|
||||
( "R" . "\xe905" )
|
||||
( "abap" . "\xe92b" )
|
||||
( "abif" . "\xea4e" )
|
||||
( "access" . "\xe9ea" )
|
||||
( "actionscript" . "\xe92e" )
|
||||
( "ada" . "\xe90b" )
|
||||
( "ae" . "\xe9f3" )
|
||||
( "ai" . "\xe6b4" )
|
||||
( "akka" . "\xea0e" )
|
||||
( "alex" . "\x29cb" )
|
||||
( "alloy" . "\xe935" )
|
||||
( "alpine-linux" . "\xe9ff" )
|
||||
( "ampl" . "\xe94e" )
|
||||
( "amx" . "\xe99b" )
|
||||
( "angelscript" . "\xea5b" )
|
||||
( "ansible" . "\x24b6" )
|
||||
( "ansible-alt" . "\x61" )
|
||||
( "ant" . "\xe93e" )
|
||||
( "antlr" . "\xe92c" )
|
||||
( "antwar" . "\x2591" )
|
||||
( "api-blueprint" . "\xe92d" )
|
||||
( "apl" . "\x234b" )
|
||||
( "apl-old" . "\xe909" )
|
||||
( "apple" . "\xe925" )
|
||||
( "appveyor" . "\xe923" )
|
||||
( "arc" . "\xe92f" )
|
||||
( "arch-linux" . "\x41" )
|
||||
( "arduino" . "\xe930" )
|
||||
( "arttext" . "\x24d0" )
|
||||
( "asciidoc" . "\xe918" )
|
||||
( "assembly" . "\xEB4F" )
|
||||
( "ats" . "\xe934" )
|
||||
( "audacity" . "\xe9f9" )
|
||||
( "augeas" . "\xe931" )
|
||||
( "aurelia" . "\xea48" )
|
||||
( "auto-hotkey" . "\xe932" )
|
||||
( "autoit" . "\xe933" )
|
||||
( "babel" . "\xe91f" )
|
||||
( "bazel" . "\xea5a" )
|
||||
( "bem" . "\xea59" )
|
||||
( "bib" . "\xe601" )
|
||||
( "bintray" . "\xea6e" )
|
||||
( "bithound" . "\xea2a" )
|
||||
( "blender" . "\xe9fa" )
|
||||
( "bluespec" . "\xe93c" )
|
||||
( "boo" . "\xe939" )
|
||||
( "brain" . "\xe93a" )
|
||||
( "brakeman" . "\xe9d6" )
|
||||
( "bro" . "\xe93b" )
|
||||
( "broccoli" . "\xe922" )
|
||||
( "brotli" . "\xea6c" )
|
||||
( "browserslist" . "\xea80" )
|
||||
( "brunch" . "\xea47" )
|
||||
( "buck" . "\xea46" )
|
||||
( "build-boot" . "\xf103" )
|
||||
( "bundler" . "\xea45" )
|
||||
( "byond" . "\xe962" )
|
||||
( "cabal" . "\xe9c2" )
|
||||
( "caddy" . "\xea58" )
|
||||
( "cake" . "\xe9e3" )
|
||||
( "cakefile" . "\xe924" )
|
||||
( "cakephp" . "\xea43" )
|
||||
( "cakephp-old" . "\xe9d3" )
|
||||
( "cc" . "\xe9d5" )
|
||||
( "ceylon" . "\xe94f" )
|
||||
( "chai" . "\x63" )
|
||||
( "chapel" . "\xe950" )
|
||||
( "chartjs" . "\xea0b" )
|
||||
( "chef" . "\xea42" )
|
||||
( "chuck" . "\xe943" )
|
||||
( "circle-ci" . "\xea12" )
|
||||
( "cirru" . "\xe951" )
|
||||
( "ckeditor" . "\xea0c" )
|
||||
( "clarion" . "\xe952" )
|
||||
( "clean" . "\xe95b" )
|
||||
( "click" . "\xe95c" )
|
||||
( "clips" . "\xe940" )
|
||||
( "clj" . "\xf105" )
|
||||
( "cljs" . "\xf104" )
|
||||
( "closure-template" . "\xea82" )
|
||||
( "cmake" . "\xe93f" )
|
||||
( "cobol" . "\xea44" )
|
||||
( "codecov" . "\x2602" )
|
||||
( "codekit" . "\xea41" )
|
||||
( "codemirror" . "\xea0d" )
|
||||
( "codeship" . "\xea6a" )
|
||||
( "cold-fusion" . "\xe929" )
|
||||
( "clisp" . "\xe972" )
|
||||
( "composer" . "\xe683" )
|
||||
( "config" . "\xf07c" )
|
||||
( "config-coffeescript" . "\xeb18" )
|
||||
( "config-go" . "\xeb12" )
|
||||
( "config-haskell" . "\xeb14" )
|
||||
( "config-js" . "\xeb1a" )
|
||||
( "config-perl" . "\xeb19" )
|
||||
( "config-python" . "\xeb15" )
|
||||
( "config-react" . "\xeb16" )
|
||||
( "config-ruby" . "\xeb17" )
|
||||
( "config-rust" . "\xeb13" )
|
||||
( "config-typescript" . "\xeb1b" )
|
||||
( "coq" . "\xe95f" )
|
||||
( "cordova" . "\xea11" )
|
||||
( "cp" . "\xe942" )
|
||||
( "cpan" . "\xea87" )
|
||||
( "creole" . "\xe95e" )
|
||||
( "crystal" . "\xe902" )
|
||||
( "cs-script" . "\xe9e2" )
|
||||
( "csound" . "\xe9f0" )
|
||||
( "cucumber" . "\xf02b" )
|
||||
( "cython" . "\xe963" )
|
||||
( "d3" . "\xea10" )
|
||||
( "darcs" . "\xe964" )
|
||||
( "dart" . "\xe698" )
|
||||
( "dashboard" . "\xf07d" )
|
||||
( "dbase" . "\xe9f1" )
|
||||
( "default" . "\x1f5cc" )
|
||||
( "delphi" . "\xea40" )
|
||||
( "devicetree" . "\xea57" )
|
||||
( "diff" . "\xe960" )
|
||||
( "dockerfile" . "\xf106" )
|
||||
( "doclets" . "\xea3f" )
|
||||
( "doge" . "\xe946" )
|
||||
( "dom" . "\xea71" )
|
||||
( "donejs" . "\x1f3c1" )
|
||||
( "doxygen" . "\xe928" )
|
||||
( "dragula" . "\x1f44c" )
|
||||
( "drone" . "\xea3d" )
|
||||
( "dyalog" . "\xe90c" )
|
||||
( "dylib" . "\xea15" )
|
||||
( "e" . "\x45" )
|
||||
( "eagle" . "\xe965" )
|
||||
( "easybuild" . "\xea85" )
|
||||
( "ec" . "\xe9c9" )
|
||||
( "ecere" . "\xe966" )
|
||||
( "edge" . "\xea78" )
|
||||
( "editorconfig" . "\xea1b" )
|
||||
( "eiffel" . "\xe967" )
|
||||
( "ejs" . "\xea4b" )
|
||||
( "electron" . "\xea27" )
|
||||
( "elm" . "\xf102" )
|
||||
( "emacs" . "\xe926" )
|
||||
( "elisp" . "\xe926" )
|
||||
( "ember" . "\xe61b" )
|
||||
( "emberscript" . "\xe968" )
|
||||
( "eq" . "\xea0a" )
|
||||
( "esdoc" . "\xea5c" )
|
||||
( "eslint" . "\xea0f" )
|
||||
( "eslint-old" . "\xe90e" )
|
||||
( "excel" . "\xe9ee" )
|
||||
( "fabfile" . "\xe94b" )
|
||||
( "factor" . "\xe96a" )
|
||||
( "fancy" . "\xe96b" )
|
||||
( "fantom" . "\xe96f" )
|
||||
( "fbx" . "\xe9fc" )
|
||||
( "ffmpeg" . "\xea22" )
|
||||
( "finder" . "\xe9e9" )
|
||||
( "firebase" . "\xea7f" )
|
||||
( "flow" . "\xe921" )
|
||||
( "flux" . "\xe969" )
|
||||
( "font" . "\xe90f" )
|
||||
( "fontforge" . "\xfb00" )
|
||||
( "fortran" . "\xe90a" )
|
||||
( "franca" . "\xea56" )
|
||||
( "freemarker" . "\xe970" )
|
||||
( "frege" . "\xe96e" )
|
||||
( "fsharp" . "\xe6a7" )
|
||||
( "fuel-ux" . "\xea09" )
|
||||
( "gams" . "\xe973" )
|
||||
( "gap" . "\xe971" )
|
||||
( "gdb" . "\xea08" )
|
||||
( "genshi" . "\xe976" )
|
||||
( "gentoo" . "\xe96d" )
|
||||
( "gf" . "\xe978" )
|
||||
( "gitlab" . "\xea3c" )
|
||||
( "glade" . "\xe938" )
|
||||
( "glyphs" . "\x47" )
|
||||
( "gn" . "\xea25" )
|
||||
( "gnu" . "\xe679" )
|
||||
( "go" . "\xeaae" )
|
||||
( "godot" . "\xe974" )
|
||||
( "golo" . "\xe979" )
|
||||
( "gosu" . "\xe97a" )
|
||||
( "gradle" . "\xe903" )
|
||||
( "graphql" . "\xe97c" )
|
||||
( "graphviz" . "\xe97d" )
|
||||
( "groovy" . "\xe904" )
|
||||
( "grunt" . "\xe611" )
|
||||
( "gulp" . "\xe610" )
|
||||
( "hack" . "\xe9ce" )
|
||||
( "haml" . "\xf15b" )
|
||||
( "harbour" . "\xe97b" )
|
||||
( "hashicorp" . "\xe97e" )
|
||||
( "haxe" . "\xe907" )
|
||||
( "haxedevelop" . "\xea3b" )
|
||||
( "hg" . "\x263f" )
|
||||
( "hoplon" . "\xea4d" )
|
||||
( "hy" . "\xe97f" )
|
||||
( "icu" . "\xea23" )
|
||||
( "id" . "\xe9f4" )
|
||||
( "idl" . "\xe947" )
|
||||
( "idris" . "\xe983" )
|
||||
( "igorpro" . "\xe980" )
|
||||
( "image" . "\xf012" )
|
||||
( "inform7" . "\xe984" )
|
||||
( "inno" . "\xe985" )
|
||||
( "io" . "\xe981" )
|
||||
( "ioke" . "\xe982" )
|
||||
( "ionic-project" . "\xf14b" )
|
||||
( "isabelle" . "\xe945" )
|
||||
( "j" . "\xe937" )
|
||||
( "jade" . "\xe90d" )
|
||||
( "jake" . "\xe948" )
|
||||
( "jasmine" . "\xea3a" )
|
||||
( "jenkins" . "\xe667" )
|
||||
( "jest" . "\xea39" )
|
||||
( "jinja" . "\xe944" )
|
||||
( "jison" . "\xea55" )
|
||||
( "jolie" . "\xea75" )
|
||||
( "jsonld" . "\xe958" )
|
||||
( "jsx" . "\xf100" )
|
||||
( "jsx-2" . "\xf101" )
|
||||
( "jsx2-alt" . "\xe9e6" )
|
||||
( "julia" . "\x26ec" )
|
||||
( "junos" . "\xea81" )
|
||||
( "jupyter" . "\xe987" )
|
||||
( "karma" . "\xe9cd" )
|
||||
( "keynote" . "\xe9e5" )
|
||||
( "khronos" . "\xe9f8" )
|
||||
( "kicad" . "\xea4c" )
|
||||
( "kitchenci" . "\xea38" )
|
||||
( "kivy" . "\xe901" )
|
||||
( "knockout" . "\x4b" )
|
||||
( "kotlin" . "\xe989" )
|
||||
( "krl" . "\xe988" )
|
||||
( "labview" . "\xe98a" )
|
||||
( "lasso" . "\xe98c" )
|
||||
( "leaflet" . "\xea07" )
|
||||
( "lean" . "\x4c" )
|
||||
( "lerna" . "\xea37" )
|
||||
( "lfe" . "\xe94c" )
|
||||
( "libuv" . "\xea21" )
|
||||
( "lightwave" . "\xe9fb" )
|
||||
( "lime" . "\xea36" )
|
||||
( "lisp" . "\xe908" )
|
||||
( "livescript" . "\xe914" )
|
||||
( "llvm" . "\xe91d" )
|
||||
( "logtalk" . "\xe98d" )
|
||||
( "lookml" . "\xe98e" )
|
||||
( "lsl" . "\xe98b" )
|
||||
( "lua" . "\xe91b" )
|
||||
( "mako" . "\xe98f" )
|
||||
( "man-page" . "\xe936" )
|
||||
( "mapbox" . "\xe941" )
|
||||
( "markdownlint" . "\xf0c9" )
|
||||
( "marko" . "\xe920" )
|
||||
( "mathematica" . "\xe990" )
|
||||
( "mathjax" . "\xea06" )
|
||||
( "matlab" . "\xe991" )
|
||||
( "max" . "\xe993" )
|
||||
( "maxscript" . "\xe900" )
|
||||
( "maya" . "\xe9f6" )
|
||||
( "mediawiki" . "\xe954" )
|
||||
( "mercury" . "\xe994" )
|
||||
( "meson" . "\xeafe" )
|
||||
( "metal" . "\x4d" )
|
||||
( "meteor" . "\xe6a5" )
|
||||
( "microsoft-infopath" . "\xea35" )
|
||||
( "minecraft" . "\xe9dc" )
|
||||
( "minizinc" . "\xea53" )
|
||||
( "mirah" . "\xe995" )
|
||||
( "miranda" . "\xea52" )
|
||||
( "mocha" . "\x26fe" )
|
||||
( "modula-2" . "\xe996" )
|
||||
( "moment" . "\x1f558" )
|
||||
( "moment-tz" . "\x1f30d" )
|
||||
( "monkey" . "\xe997" )
|
||||
( "moustache" . "\xe60f" )
|
||||
( "mruby" . "\xea18" )
|
||||
( "mupad" . "\xe9ca" )
|
||||
( "nano" . "\xea76" )
|
||||
( "nanoc" . "\xea51" )
|
||||
( "nant" . "\xe9e1" )
|
||||
( "nasm" . "\xea72" )
|
||||
( "neko" . "\xea05" )
|
||||
( "netlogo" . "\xe99c" )
|
||||
( "new-relic" . "\xe9d7" )
|
||||
( "nginx" . "\xf146b" )
|
||||
( "nib" . "\x2712" )
|
||||
( "nimrod" . "\xe998" )
|
||||
( "nit" . "\xe999" )
|
||||
( "nix" . "\xe99a" )
|
||||
( "nmap" . "\xe94d" )
|
||||
( "nodemon" . "\xea26" )
|
||||
( "normalize" . "\xea04" )
|
||||
( "npm" . "\xe91c" )
|
||||
( "npm-old" . "\xf17b" )
|
||||
( "nsis" . "\xea1e" )
|
||||
( "nsis-old" . "\xe992" )
|
||||
( "nuclide" . "\xea34" )
|
||||
( "nuget" . "\xe9d9" )
|
||||
( "numpy" . "\xe99d" )
|
||||
( "nunjucks" . "\xe953" )
|
||||
( "nvidia" . "\xe95d" )
|
||||
( "nxc" . "\xea6b" )
|
||||
( "obj" . "\xe9e8" )
|
||||
( "objective-j" . "\xe99e" )
|
||||
( "ocaml" . "\xe91a" )
|
||||
( "octave" . "\xea33" )
|
||||
( "odin" . "\xeb36" )
|
||||
( "onenote" . "\xe9eb" )
|
||||
( "ooc" . "\xe9cb" )
|
||||
( "opa" . "\x2601" )
|
||||
( "opencl" . "\xe99f" )
|
||||
( "opengl" . "\xea7a" )
|
||||
( "openoffice" . "\xe9e4" )
|
||||
( "openscad" . "\xe911" )
|
||||
( "org" . "\xe917" )
|
||||
( "owl" . "\xe957" )
|
||||
( "ox" . "\xe9a1" )
|
||||
( "oxygene" . "\xe9bf" )
|
||||
( "oz" . "\xe9be" )
|
||||
( "p4" . "\xea50" )
|
||||
( "pan" . "\xe9bd" )
|
||||
( "papyrus" . "\xe9bc" )
|
||||
( "parrot" . "\xe9bb" )
|
||||
( "pascal" . "\xe92a" )
|
||||
( "patch" . "\xe961" )
|
||||
( "pawn" . "\x265f" )
|
||||
( "pb" . "\xea14" )
|
||||
( "pegjs" . "\xea74" )
|
||||
( "raku" . "\xe96c" )
|
||||
( "phalcon" . "\xe94a" )
|
||||
( "phoenix" . "\xea5f" )
|
||||
( "php" . "\xf147" )
|
||||
( "phpunit" . "\xea32" )
|
||||
( "pickle" . "\xe9c4" )
|
||||
( "pike" . "\xe9b9" )
|
||||
( "platformio" . "\xea2c" )
|
||||
( "pm2" . "\x2630" )
|
||||
( "pod" . "\xea84" )
|
||||
( "pogo" . "\xe9b8" )
|
||||
( "pointwise" . "\xe977" )
|
||||
( "polymer" . "\xea2b" )
|
||||
( "pony" . "\xe9b7" )
|
||||
( "postcss" . "\xe910" )
|
||||
( "postscript" . "\xe955" )
|
||||
( "povray" . "\x50" )
|
||||
( "powerpoint" . "\xe9ec" )
|
||||
( "powershell" . "\xe9da" )
|
||||
( "precision" . "\x2295" )
|
||||
( "premiere" . "\xe9f5" )
|
||||
( "processing" . "\xe9a0" )
|
||||
( "progress" . "\xe9c0" )
|
||||
( "propeller" . "\xe9b5" )
|
||||
( "proselint" . "\xea6d" )
|
||||
( "protractor" . "\xe9de" )
|
||||
( "ps" . "\xe6b8" )
|
||||
( "pug" . "\xea13" )
|
||||
( "pug-alt" . "\xe9d0" )
|
||||
( "puppet" . "\xf0c3" )
|
||||
( "purebasic" . "\x1b5" )
|
||||
( "purescript" . "\xe9b2" )
|
||||
( "racket" . "\xe9b1" )
|
||||
( "raml" . "\xe913" )
|
||||
( "rascal" . "\xea24" )
|
||||
( "rdoc" . "\xe9b0" )
|
||||
( "realbasic" . "\xe9af" )
|
||||
( "reason" . "\xea1d" )
|
||||
( "rebol" . "\xe9ae" )
|
||||
( "red" . "\xe9ad" )
|
||||
( "redux" . "\xea30" )
|
||||
( "regex" . "\x2a" )
|
||||
( "rexx" . "\xea16" )
|
||||
( "rhino" . "\xea4a" )
|
||||
( "ring" . "\x1f48d" )
|
||||
( "riot" . "\xe919" )
|
||||
( "robot" . "\xe9ac" )
|
||||
( "rollup" . "\xea20" )
|
||||
( "rollup-old" . "\xe9fd" )
|
||||
( "rot" . "\x1f764" )
|
||||
( "rspec" . "\xea31" )
|
||||
( "rst" . "\xe9cc" )
|
||||
( "sage" . "\xe9ab" )
|
||||
( "saltstack" . "\xe915" )
|
||||
( "sas" . "\xe95a" )
|
||||
( "sbt" . "\xe9d2" )
|
||||
( "sc" . "\xe9a2" )
|
||||
( "scheme" . "\x3bb" )
|
||||
( "scilab" . "\xe9a9" )
|
||||
( "scrutinizer" . "\xe9d4" )
|
||||
( "self" . "\xe9a8" )
|
||||
( "sequelize" . "\xea2f" )
|
||||
( "sf" . "\xe9db" )
|
||||
( "shen" . "\xe9a7" )
|
||||
( "shipit" . "\x26f5" )
|
||||
( "shippable" . "\xea2d" )
|
||||
( "shopify" . "\xe9cf" )
|
||||
( "shuriken" . "\x272b" )
|
||||
( "silverstripe" . "\xe800" )
|
||||
( "sinatra" . "\xea03" )
|
||||
( "sketch" . "\xe927" )
|
||||
( "sketchup-layout" . "\xea7c" )
|
||||
( "sketchup-make" . "\xea7e" )
|
||||
( "sketchup-stylebuilder" . "\xea7d" )
|
||||
( "slash" . "\xe9a6" )
|
||||
( "snyk" . "\xea1c" )
|
||||
( "solidity" . "\xea86" )
|
||||
( "sparql" . "\xe959" )
|
||||
( "spray" . "\xea02" )
|
||||
( "sqf" . "\xe9a5" )
|
||||
( "sqlite" . "\xe9dd" )
|
||||
( "squarespace" . "\xea5e" )
|
||||
( "stan" . "\xe9a4" )
|
||||
( "stata" . "\xe9a3" )
|
||||
( "storyist" . "\xe9ef" )
|
||||
( "strings" . "\xe9e0" )
|
||||
( "stylelint" . "\xe93d" )
|
||||
( "stylus" . "\x73" )
|
||||
( "stylus-full" . "\xe9f7" )
|
||||
( "stylus-orb" . "\x53" )
|
||||
( "sublime" . "\xe986" )
|
||||
( "sv" . "\xe9c3" )
|
||||
( "svelte" . "\x33dc" )
|
||||
( "svn" . "\xea17" )
|
||||
( "swagger" . "\xea29" )
|
||||
( "tag" . "\xf015" )
|
||||
( "tcl" . "\xe956" )
|
||||
( "telegram" . "\x2708" )
|
||||
( "terminal" . "\xf0c8" )
|
||||
( "tern" . "\x1f54a" )
|
||||
( "terraform" . "\xe916" )
|
||||
( "test-coffeescript" . "\xea62" )
|
||||
( "test-dir" . "\xea60" )
|
||||
( "test-generic" . "\xea63" )
|
||||
( "test-js" . "\xea64" )
|
||||
( "test-perl" . "\xea65" )
|
||||
( "test-python" . "\xea66" )
|
||||
( "test-react" . "\xea67" )
|
||||
( "test-ruby" . "\xea68" )
|
||||
( "test-typescript" . "\xea69" )
|
||||
( "tex" . "\xe600" )
|
||||
( "textile" . "\x74" )
|
||||
( "textmate" . "\x2122" )
|
||||
( "thor" . "\xe9d8" )
|
||||
( "tinymce" . "\xea01" )
|
||||
( "tsx" . "\xe9d1" )
|
||||
( "tsx-alt" . "\xe9e7" )
|
||||
( "tt" . "\x54" )
|
||||
( "turing" . "\xe9b6" )
|
||||
( "twig" . "\x2e19" )
|
||||
( "twine" . "\xea5d" )
|
||||
( "txl" . "\xe9c1" )
|
||||
( "typedoc" . "\xe9fe" )
|
||||
( "typescript" . "\xe912" )
|
||||
( "typescript-alt" . "\x2a6" )
|
||||
( "typings" . "\xe9df" )
|
||||
( "uno" . "\xe9b3" )
|
||||
( "unreal" . "\x75" )
|
||||
( "urweb" . "\xe9ba" )
|
||||
( "v8" . "\xea1f" )
|
||||
( "vagrant" . "\x56" )
|
||||
( "vcl" . "\xe9b4" )
|
||||
( "verilog" . "\xe949" )
|
||||
( "vertex-shader" . "\xea79" )
|
||||
( "vhdl" . "\xe9aa" )
|
||||
( "video" . "\xf057" )
|
||||
( "virtualbox" . "\xea3e" )
|
||||
( "virtualbox-alt" . "\xea2e" )
|
||||
( "visio" . "\xea83" )
|
||||
( "vmware" . "\xea49" )
|
||||
( "vue" . "\xe906" )
|
||||
( "wasm" . "\xea70" )
|
||||
( "watchman" . "\xea4f" )
|
||||
( "webgl" . "\xea7b" )
|
||||
( "webpack" . "\xea61" )
|
||||
( "webpack-old" . "\xe91e" )
|
||||
( "wercker" . "\xea19" )
|
||||
( "word" . "\xe9ed" )
|
||||
( "x10" . "\x2169" )
|
||||
( "xamarin" . "\xea77" )
|
||||
( "xmos" . "\x58" )
|
||||
( "xpages" . "\xe9c5" )
|
||||
( "xtend" . "\xe9c6" )
|
||||
( "yarn" . "\xea1a" )
|
||||
( "yasm" . "\xea73" )
|
||||
( "yin-yang" . "\x262f" )
|
||||
( "yoyo" . "\xe975" )
|
||||
( "yui" . "\xea00" )
|
||||
( "zbrush" . "\xe9f2" )
|
||||
( "zephir" . "\xe9c7" )
|
||||
( "zig" . "\x7A" )
|
||||
( "zimpl" . "\xe9c8" )
|
||||
)
|
||||
)
|
||||
|
||||
(provide 'data-fileicons)
|
||||
Binary file not shown.
|
|
@ -1,937 +0,0 @@
|
|||
;; -*- lexical-binding: t -*-
|
||||
|
||||
(defvar all-the-icons-data/material-icons-alist
|
||||
'(("3d_rotation" . "\xe84d")
|
||||
("ac_unit" . "\xeb3b")
|
||||
("access_alarm" . "\xe190")
|
||||
("access_alarms" . "\xe191")
|
||||
("access_time" . "\xe192")
|
||||
("accessibility" . "\xe84e")
|
||||
("accessible" . "\xe914")
|
||||
("account_balance" . "\xe84f")
|
||||
("account_balance_wallet" . "\xe850")
|
||||
("account_box" . "\xe851")
|
||||
("account_circle" . "\xe853")
|
||||
("adb" . "\xe60e")
|
||||
("add" . "\xe145")
|
||||
("add_a_photo" . "\xe439")
|
||||
("add_alarm" . "\xe193")
|
||||
("add_alert" . "\xe003")
|
||||
("add_box" . "\xe146")
|
||||
("add_circle" . "\xe147")
|
||||
("add_circle_outline" . "\xe148")
|
||||
("add_location" . "\xe567")
|
||||
("add_shopping_cart" . "\xe854")
|
||||
("add_to_photos" . "\xe39d")
|
||||
("add_to_queue" . "\xe05c")
|
||||
("adjust" . "\xe39e")
|
||||
("airline_seat_flat" . "\xe630")
|
||||
("airline_seat_flat_angled" . "\xe631")
|
||||
("airline_seat_individual_suite" . "\xe632")
|
||||
("airline_seat_legroom_extra" . "\xe633")
|
||||
("airline_seat_legroom_normal" . "\xe634")
|
||||
("airline_seat_legroom_reduced" . "\xe635")
|
||||
("airline_seat_recline_extra" . "\xe636")
|
||||
("airline_seat_recline_normal" . "\xe637")
|
||||
("airplanemode_active" . "\xe195")
|
||||
("airplanemode_inactive" . "\xe194")
|
||||
("airplay" . "\xe055")
|
||||
("airport_shuttle" . "\xeb3c")
|
||||
("alarm" . "\xe855")
|
||||
("alarm_add" . "\xe856")
|
||||
("alarm_off" . "\xe857")
|
||||
("alarm_on" . "\xe858")
|
||||
("album" . "\xe019")
|
||||
("all_inclusive" . "\xeb3d")
|
||||
("all_out" . "\xe90b")
|
||||
("android" . "\xe859")
|
||||
("announcement" . "\xe85a")
|
||||
("apps" . "\xe5c3")
|
||||
("archive" . "\xe149")
|
||||
("arrow_back" . "\xe5c4")
|
||||
("arrow_downward" . "\xe5db")
|
||||
("arrow_drop_down" . "\xe5c5")
|
||||
("arrow_drop_down_circle" . "\xe5c6")
|
||||
("arrow_drop_up" . "\xe5c7")
|
||||
("arrow_forward" . "\xe5c8")
|
||||
("arrow_upward" . "\xe5d8")
|
||||
("art_track" . "\xe060")
|
||||
("aspect_ratio" . "\xe85b")
|
||||
("assessment" . "\xe85c")
|
||||
("assignment" . "\xe85d")
|
||||
("assignment_ind" . "\xe85e")
|
||||
("assignment_late" . "\xe85f")
|
||||
("assignment_return" . "\xe860")
|
||||
("assignment_returned" . "\xe861")
|
||||
("assignment_turned_in" . "\xe862")
|
||||
("assistant" . "\xe39f")
|
||||
("assistant_photo" . "\xe3a0")
|
||||
("attach_file" . "\xe226")
|
||||
("attach_money" . "\xe227")
|
||||
("attachment" . "\xe2bc")
|
||||
("audiotrack" . "\xe3a1")
|
||||
("autorenew" . "\xe863")
|
||||
("av_timer" . "\xe01b")
|
||||
("backspace" . "\xe14a")
|
||||
("backup" . "\xe864")
|
||||
("battery_alert" . "\xe19c")
|
||||
("battery_charging_full" . "\xe1a3")
|
||||
("battery_full" . "\xe1a4")
|
||||
("battery_std" . "\xe1a5")
|
||||
("battery_unknown" . "\xe1a6")
|
||||
("beach_access" . "\xeb3e")
|
||||
("beenhere" . "\xe52d")
|
||||
("block" . "\xe14b")
|
||||
("bluetooth" . "\xe1a7")
|
||||
("bluetooth_audio" . "\xe60f")
|
||||
("bluetooth_connected" . "\xe1a8")
|
||||
("bluetooth_disabled" . "\xe1a9")
|
||||
("bluetooth_searching" . "\xe1aa")
|
||||
("blur_circular" . "\xe3a2")
|
||||
("blur_linear" . "\xe3a3")
|
||||
("blur_off" . "\xe3a4")
|
||||
("blur_on" . "\xe3a5")
|
||||
("book" . "\xe865")
|
||||
("bookmark" . "\xe866")
|
||||
("bookmark_border" . "\xe867")
|
||||
("border_all" . "\xe228")
|
||||
("border_bottom" . "\xe229")
|
||||
("border_clear" . "\xe22a")
|
||||
("border_color" . "\xe22b")
|
||||
("border_horizontal" . "\xe22c")
|
||||
("border_inner" . "\xe22d")
|
||||
("border_left" . "\xe22e")
|
||||
("border_outer" . "\xe22f")
|
||||
("border_right" . "\xe230")
|
||||
("border_style" . "\xe231")
|
||||
("border_top" . "\xe232")
|
||||
("border_vertical" . "\xe233")
|
||||
("branding_watermark" . "\xe06b")
|
||||
("brightness_1" . "\xe3a6")
|
||||
("brightness_2" . "\xe3a7")
|
||||
("brightness_3" . "\xe3a8")
|
||||
("brightness_4" . "\xe3a9")
|
||||
("brightness_5" . "\xe3aa")
|
||||
("brightness_6" . "\xe3ab")
|
||||
("brightness_7" . "\xe3ac")
|
||||
("brightness_auto" . "\xe1ab")
|
||||
("brightness_high" . "\xe1ac")
|
||||
("brightness_low" . "\xe1ad")
|
||||
("brightness_medium" . "\xe1ae")
|
||||
("broken_image" . "\xe3ad")
|
||||
("brush" . "\xe3ae")
|
||||
("bubble_chart" . "\xe6dd")
|
||||
("bug_report" . "\xe868")
|
||||
("build" . "\xe869")
|
||||
("burst_mode" . "\xe43c")
|
||||
("business" . "\xe0af")
|
||||
("business_center" . "\xeb3f")
|
||||
("cached" . "\xe86a")
|
||||
("cake" . "\xe7e9")
|
||||
("call" . "\xe0b0")
|
||||
("call_end" . "\xe0b1")
|
||||
("call_made" . "\xe0b2")
|
||||
("call_merge" . "\xe0b3")
|
||||
("call_missed" . "\xe0b4")
|
||||
("call_missed_outgoing" . "\xe0e4")
|
||||
("call_received" . "\xe0b5")
|
||||
("call_split" . "\xe0b6")
|
||||
("call_to_action" . "\xe06c")
|
||||
("camera" . "\xe3af")
|
||||
("camera_alt" . "\xe3b0")
|
||||
("camera_enhance" . "\xe8fc")
|
||||
("camera_front" . "\xe3b1")
|
||||
("camera_rear" . "\xe3b2")
|
||||
("camera_roll" . "\xe3b3")
|
||||
("cancel" . "\xe5c9")
|
||||
("card_giftcard" . "\xe8f6")
|
||||
("card_membership" . "\xe8f7")
|
||||
("card_travel" . "\xe8f8")
|
||||
("casino" . "\xeb40")
|
||||
("cast" . "\xe307")
|
||||
("cast_connected" . "\xe308")
|
||||
("center_focus_strong" . "\xe3b4")
|
||||
("center_focus_weak" . "\xe3b5")
|
||||
("change_history" . "\xe86b")
|
||||
("chat" . "\xe0b7")
|
||||
("chat_bubble" . "\xe0ca")
|
||||
("chat_bubble_outline" . "\xe0cb")
|
||||
("check" . "\xe5ca")
|
||||
("check_box" . "\xe834")
|
||||
("check_box_outline_blank" . "\xe835")
|
||||
("check_circle" . "\xe86c")
|
||||
("chevron_left" . "\xe5cb")
|
||||
("chevron_right" . "\xe5cc")
|
||||
("child_care" . "\xeb41")
|
||||
("child_friendly" . "\xeb42")
|
||||
("chrome_reader_mode" . "\xe86d")
|
||||
("class" . "\xe86e")
|
||||
("clear" . "\xe14c")
|
||||
("clear_all" . "\xe0b8")
|
||||
("close" . "\xe5cd")
|
||||
("closed_caption" . "\xe01c")
|
||||
("cloud" . "\xe2bd")
|
||||
("cloud_circle" . "\xe2be")
|
||||
("cloud_done" . "\xe2bf")
|
||||
("cloud_download" . "\xe2c0")
|
||||
("cloud_off" . "\xe2c1")
|
||||
("cloud_queue" . "\xe2c2")
|
||||
("cloud_upload" . "\xe2c3")
|
||||
("code" . "\xe86f")
|
||||
("collections" . "\xe3b6")
|
||||
("collections_bookmark" . "\xe431")
|
||||
("color_lens" . "\xe3b7")
|
||||
("colorize" . "\xe3b8")
|
||||
("comment" . "\xe0b9")
|
||||
("compare" . "\xe3b9")
|
||||
("compare_arrows" . "\xe915")
|
||||
("computer" . "\xe30a")
|
||||
("confirmation_number" . "\xe638")
|
||||
("contact_mail" . "\xe0d0")
|
||||
("contact_phone" . "\xe0cf")
|
||||
("contacts" . "\xe0ba")
|
||||
("content_copy" . "\xe14d")
|
||||
("content_cut" . "\xe14e")
|
||||
("content_paste" . "\xe14f")
|
||||
("control_point" . "\xe3ba")
|
||||
("control_point_duplicate" . "\xe3bb")
|
||||
("copyright" . "\xe90c")
|
||||
("create" . "\xe150")
|
||||
("create_new_folder" . "\xe2cc")
|
||||
("credit_card" . "\xe870")
|
||||
("crop" . "\xe3be")
|
||||
("crop_16_9" . "\xe3bc")
|
||||
("crop_3_2" . "\xe3bd")
|
||||
("crop_5_4" . "\xe3bf")
|
||||
("crop_7_5" . "\xe3c0")
|
||||
("crop_din" . "\xe3c1")
|
||||
("crop_free" . "\xe3c2")
|
||||
("crop_landscape" . "\xe3c3")
|
||||
("crop_original" . "\xe3c4")
|
||||
("crop_portrait" . "\xe3c5")
|
||||
("crop_rotate" . "\xe437")
|
||||
("crop_square" . "\xe3c6")
|
||||
("dashboard" . "\xe871")
|
||||
("data_usage" . "\xe1af")
|
||||
("date_range" . "\xe916")
|
||||
("dehaze" . "\xe3c7")
|
||||
("delete" . "\xe872")
|
||||
("delete_forever" . "\xe92b")
|
||||
("delete_sweep" . "\xe16c")
|
||||
("description" . "\xe873")
|
||||
("desktop_mac" . "\xe30b")
|
||||
("desktop_windows" . "\xe30c")
|
||||
("details" . "\xe3c8")
|
||||
("developer_board" . "\xe30d")
|
||||
("developer_mode" . "\xe1b0")
|
||||
("device_hub" . "\xe335")
|
||||
("devices" . "\xe1b1")
|
||||
("devices_other" . "\xe337")
|
||||
("dialer_sip" . "\xe0bb")
|
||||
("dialpad" . "\xe0bc")
|
||||
("directions" . "\xe52e")
|
||||
("directions_bike" . "\xe52f")
|
||||
("directions_boat" . "\xe532")
|
||||
("directions_bus" . "\xe530")
|
||||
("directions_car" . "\xe531")
|
||||
("directions_railway" . "\xe534")
|
||||
("directions_run" . "\xe566")
|
||||
("directions_subway" . "\xe533")
|
||||
("directions_transit" . "\xe535")
|
||||
("directions_walk" . "\xe536")
|
||||
("disc_full" . "\xe610")
|
||||
("dns" . "\xe875")
|
||||
("do_not_disturb" . "\xe612")
|
||||
("do_not_disturb_alt" . "\xe611")
|
||||
("do_not_disturb_off" . "\xe643")
|
||||
("do_not_disturb_on" . "\xe644")
|
||||
("dock" . "\xe30e")
|
||||
("domain" . "\xe7ee")
|
||||
("done" . "\xe876")
|
||||
("done_all" . "\xe877")
|
||||
("donut_large" . "\xe917")
|
||||
("donut_small" . "\xe918")
|
||||
("drafts" . "\xe151")
|
||||
("drag_handle" . "\xe25d")
|
||||
("drive_eta" . "\xe613")
|
||||
("dvr" . "\xe1b2")
|
||||
("edit" . "\xe3c9")
|
||||
("edit_location" . "\xe568")
|
||||
("eject" . "\xe8fb")
|
||||
("email" . "\xe0be")
|
||||
("enhanced_encryption" . "\xe63f")
|
||||
("equalizer" . "\xe01d")
|
||||
("error" . "\xe000")
|
||||
("error_outline" . "\xe001")
|
||||
("euro_symbol" . "\xe926")
|
||||
("ev_station" . "\xe56d")
|
||||
("event" . "\xe878")
|
||||
("event_available" . "\xe614")
|
||||
("event_busy" . "\xe615")
|
||||
("event_note" . "\xe616")
|
||||
("event_seat" . "\xe903")
|
||||
("exit_to_app" . "\xe879")
|
||||
("expand_less" . "\xe5ce")
|
||||
("expand_more" . "\xe5cf")
|
||||
("explicit" . "\xe01e")
|
||||
("explore" . "\xe87a")
|
||||
("exposure" . "\xe3ca")
|
||||
("exposure_neg_1" . "\xe3cb")
|
||||
("exposure_neg_2" . "\xe3cc")
|
||||
("exposure_plus_1" . "\xe3cd")
|
||||
("exposure_plus_2" . "\xe3ce")
|
||||
("exposure_zero" . "\xe3cf")
|
||||
("extension" . "\xe87b")
|
||||
("face" . "\xe87c")
|
||||
("fast_forward" . "\xe01f")
|
||||
("fast_rewind" . "\xe020")
|
||||
("favorite" . "\xe87d")
|
||||
("favorite_border" . "\xe87e")
|
||||
("featured_play_list" . "\xe06d")
|
||||
("featured_video" . "\xe06e")
|
||||
("feedback" . "\xe87f")
|
||||
("fiber_dvr" . "\xe05d")
|
||||
("fiber_manual_record" . "\xe061")
|
||||
("fiber_new" . "\xe05e")
|
||||
("fiber_pin" . "\xe06a")
|
||||
("fiber_smart_record" . "\xe062")
|
||||
("file_download" . "\xe2c4")
|
||||
("file_upload" . "\xe2c6")
|
||||
("filter" . "\xe3d3")
|
||||
("filter_1" . "\xe3d0")
|
||||
("filter_2" . "\xe3d1")
|
||||
("filter_3" . "\xe3d2")
|
||||
("filter_4" . "\xe3d4")
|
||||
("filter_5" . "\xe3d5")
|
||||
("filter_6" . "\xe3d6")
|
||||
("filter_7" . "\xe3d7")
|
||||
("filter_8" . "\xe3d8")
|
||||
("filter_9" . "\xe3d9")
|
||||
("filter_9_plus" . "\xe3da")
|
||||
("filter_b_and_w" . "\xe3db")
|
||||
("filter_center_focus" . "\xe3dc")
|
||||
("filter_drama" . "\xe3dd")
|
||||
("filter_frames" . "\xe3de")
|
||||
("filter_hdr" . "\xe3df")
|
||||
("filter_list" . "\xe152")
|
||||
("filter_none" . "\xe3e0")
|
||||
("filter_tilt_shift" . "\xe3e2")
|
||||
("filter_vintage" . "\xe3e3")
|
||||
("find_in_page" . "\xe880")
|
||||
("find_replace" . "\xe881")
|
||||
("fingerprint" . "\xe90d")
|
||||
("first_page" . "\xe5dc")
|
||||
("fitness_center" . "\xeb43")
|
||||
("flag" . "\xe153")
|
||||
("flare" . "\xe3e4")
|
||||
("flash_auto" . "\xe3e5")
|
||||
("flash_off" . "\xe3e6")
|
||||
("flash_on" . "\xe3e7")
|
||||
("flight" . "\xe539")
|
||||
("flight_land" . "\xe904")
|
||||
("flight_takeoff" . "\xe905")
|
||||
("flip" . "\xe3e8")
|
||||
("flip_to_back" . "\xe882")
|
||||
("flip_to_front" . "\xe883")
|
||||
("folder" . "\xe2c7")
|
||||
("folder_open" . "\xe2c8")
|
||||
("folder_shared" . "\xe2c9")
|
||||
("folder_special" . "\xe617")
|
||||
("font_download" . "\xe167")
|
||||
("format_align_center" . "\xe234")
|
||||
("format_align_justify" . "\xe235")
|
||||
("format_align_left" . "\xe236")
|
||||
("format_align_right" . "\xe237")
|
||||
("format_bold" . "\xe238")
|
||||
("format_clear" . "\xe239")
|
||||
("format_color_fill" . "\xe23a")
|
||||
("format_color_reset" . "\xe23b")
|
||||
("format_color_text" . "\xe23c")
|
||||
("format_indent_decrease" . "\xe23d")
|
||||
("format_indent_increase" . "\xe23e")
|
||||
("format_italic" . "\xe23f")
|
||||
("format_line_spacing" . "\xe240")
|
||||
("format_list_bulleted" . "\xe241")
|
||||
("format_list_numbered" . "\xe242")
|
||||
("format_paint" . "\xe243")
|
||||
("format_quote" . "\xe244")
|
||||
("format_shapes" . "\xe25e")
|
||||
("format_size" . "\xe245")
|
||||
("format_strikethrough" . "\xe246")
|
||||
("format_textdirection_l_to_r" . "\xe247")
|
||||
("format_textdirection_r_to_l" . "\xe248")
|
||||
("format_underlined" . "\xe249")
|
||||
("forum" . "\xe0bf")
|
||||
("forward" . "\xe154")
|
||||
("forward_10" . "\xe056")
|
||||
("forward_30" . "\xe057")
|
||||
("forward_5" . "\xe058")
|
||||
("free_breakfast" . "\xeb44")
|
||||
("fullscreen" . "\xe5d0")
|
||||
("fullscreen_exit" . "\xe5d1")
|
||||
("functions" . "\xe24a")
|
||||
("g_translate" . "\xe927")
|
||||
("gamepad" . "\xe30f")
|
||||
("games" . "\xe021")
|
||||
("gavel" . "\xe90e")
|
||||
("gesture" . "\xe155")
|
||||
("get_app" . "\xe884")
|
||||
("gif" . "\xe908")
|
||||
("golf_course" . "\xeb45")
|
||||
("gps_fixed" . "\xe1b3")
|
||||
("gps_not_fixed" . "\xe1b4")
|
||||
("gps_off" . "\xe1b5")
|
||||
("grade" . "\xe885")
|
||||
("gradient" . "\xe3e9")
|
||||
("grain" . "\xe3ea")
|
||||
("graphic_eq" . "\xe1b8")
|
||||
("grid_off" . "\xe3eb")
|
||||
("grid_on" . "\xe3ec")
|
||||
("group" . "\xe7ef")
|
||||
("group_add" . "\xe7f0")
|
||||
("group_work" . "\xe886")
|
||||
("hd" . "\xe052")
|
||||
("hdr_off" . "\xe3ed")
|
||||
("hdr_on" . "\xe3ee")
|
||||
("hdr_strong" . "\xe3f1")
|
||||
("hdr_weak" . "\xe3f2")
|
||||
("headset" . "\xe310")
|
||||
("headset_mic" . "\xe311")
|
||||
("healing" . "\xe3f3")
|
||||
("hearing" . "\xe023")
|
||||
("help" . "\xe887")
|
||||
("help_outline" . "\xe8fd")
|
||||
("high_quality" . "\xe024")
|
||||
("highlight" . "\xe25f")
|
||||
("highlight_off" . "\xe888")
|
||||
("history" . "\xe889")
|
||||
("home" . "\xe88a")
|
||||
("hot_tub" . "\xeb46")
|
||||
("hotel" . "\xe53a")
|
||||
("hourglass_empty" . "\xe88b")
|
||||
("hourglass_full" . "\xe88c")
|
||||
("http" . "\xe902")
|
||||
("https" . "\xe88d")
|
||||
("image" . "\xe3f4")
|
||||
("image_aspect_ratio" . "\xe3f5")
|
||||
("import_contacts" . "\xe0e0")
|
||||
("import_export" . "\xe0c3")
|
||||
("important_devices" . "\xe912")
|
||||
("inbox" . "\xe156")
|
||||
("indeterminate_check_box" . "\xe909")
|
||||
("info" . "\xe88e")
|
||||
("info_outline" . "\xe88f")
|
||||
("input" . "\xe890")
|
||||
("insert_chart" . "\xe24b")
|
||||
("insert_comment" . "\xe24c")
|
||||
("insert_drive_file" . "\xe24d")
|
||||
("insert_emoticon" . "\xe24e")
|
||||
("insert_invitation" . "\xe24f")
|
||||
("insert_link" . "\xe250")
|
||||
("insert_photo" . "\xe251")
|
||||
("invert_colors" . "\xe891")
|
||||
("invert_colors_off" . "\xe0c4")
|
||||
("iso" . "\xe3f6")
|
||||
("keyboard" . "\xe312")
|
||||
("keyboard_arrow_down" . "\xe313")
|
||||
("keyboard_arrow_left" . "\xe314")
|
||||
("keyboard_arrow_right" . "\xe315")
|
||||
("keyboard_arrow_up" . "\xe316")
|
||||
("keyboard_backspace" . "\xe317")
|
||||
("keyboard_capslock" . "\xe318")
|
||||
("keyboard_hide" . "\xe31a")
|
||||
("keyboard_return" . "\xe31b")
|
||||
("keyboard_tab" . "\xe31c")
|
||||
("keyboard_voice" . "\xe31d")
|
||||
("kitchen" . "\xeb47")
|
||||
("label" . "\xe892")
|
||||
("label_outline" . "\xe893")
|
||||
("landscape" . "\xe3f7")
|
||||
("language" . "\xe894")
|
||||
("laptop" . "\xe31e")
|
||||
("laptop_chromebook" . "\xe31f")
|
||||
("laptop_mac" . "\xe320")
|
||||
("laptop_windows" . "\xe321")
|
||||
("last_page" . "\xe5dd")
|
||||
("launch" . "\xe895")
|
||||
("layers" . "\xe53b")
|
||||
("layers_clear" . "\xe53c")
|
||||
("leak_add" . "\xe3f8")
|
||||
("leak_remove" . "\xe3f9")
|
||||
("lens" . "\xe3fa")
|
||||
("library_add" . "\xe02e")
|
||||
("library_books" . "\xe02f")
|
||||
("library_music" . "\xe030")
|
||||
("lightbulb_outline" . "\xe90f")
|
||||
("line_style" . "\xe919")
|
||||
("line_weight" . "\xe91a")
|
||||
("linear_scale" . "\xe260")
|
||||
("link" . "\xe157")
|
||||
("linked_camera" . "\xe438")
|
||||
("list" . "\xe896")
|
||||
("live_help" . "\xe0c6")
|
||||
("live_tv" . "\xe639")
|
||||
("local_activity" . "\xe53f")
|
||||
("local_airport" . "\xe53d")
|
||||
("local_atm" . "\xe53e")
|
||||
("local_bar" . "\xe540")
|
||||
("local_cafe" . "\xe541")
|
||||
("local_car_wash" . "\xe542")
|
||||
("local_convenience_store" . "\xe543")
|
||||
("local_dining" . "\xe556")
|
||||
("local_drink" . "\xe544")
|
||||
("local_florist" . "\xe545")
|
||||
("local_gas_station" . "\xe546")
|
||||
("local_grocery_store" . "\xe547")
|
||||
("local_hospital" . "\xe548")
|
||||
("local_hotel" . "\xe549")
|
||||
("local_laundry_service" . "\xe54a")
|
||||
("local_library" . "\xe54b")
|
||||
("local_mall" . "\xe54c")
|
||||
("local_movies" . "\xe54d")
|
||||
("local_offer" . "\xe54e")
|
||||
("local_parking" . "\xe54f")
|
||||
("local_pharmacy" . "\xe550")
|
||||
("local_phone" . "\xe551")
|
||||
("local_pizza" . "\xe552")
|
||||
("local_play" . "\xe553")
|
||||
("local_post_office" . "\xe554")
|
||||
("local_printshop" . "\xe555")
|
||||
("local_see" . "\xe557")
|
||||
("local_shipping" . "\xe558")
|
||||
("local_taxi" . "\xe559")
|
||||
("location_city" . "\xe7f1")
|
||||
("location_disabled" . "\xe1b6")
|
||||
("location_off" . "\xe0c7")
|
||||
("location_on" . "\xe0c8")
|
||||
("location_searching" . "\xe1b7")
|
||||
("lock" . "\xe897")
|
||||
("lock_open" . "\xe898")
|
||||
("lock_outline" . "\xe899")
|
||||
("looks" . "\xe3fc")
|
||||
("looks_3" . "\xe3fb")
|
||||
("looks_4" . "\xe3fd")
|
||||
("looks_5" . "\xe3fe")
|
||||
("looks_6" . "\xe3ff")
|
||||
("looks_one" . "\xe400")
|
||||
("looks_two" . "\xe401")
|
||||
("loop" . "\xe028")
|
||||
("loupe" . "\xe402")
|
||||
("low_priority" . "\xe16d")
|
||||
("loyalty" . "\xe89a")
|
||||
("mail" . "\xe158")
|
||||
("mail_outline" . "\xe0e1")
|
||||
("map" . "\xe55b")
|
||||
("markunread" . "\xe159")
|
||||
("markunread_mailbox" . "\xe89b")
|
||||
("memory" . "\xe322")
|
||||
("menu" . "\xe5d2")
|
||||
("merge_type" . "\xe252")
|
||||
("message" . "\xe0c9")
|
||||
("mic" . "\xe029")
|
||||
("mic_none" . "\xe02a")
|
||||
("mic_off" . "\xe02b")
|
||||
("mms" . "\xe618")
|
||||
("mode_comment" . "\xe253")
|
||||
("mode_edit" . "\xe254")
|
||||
("monetization_on" . "\xe263")
|
||||
("money_off" . "\xe25c")
|
||||
("monochrome_photos" . "\xe403")
|
||||
("mood" . "\xe7f2")
|
||||
("mood_bad" . "\xe7f3")
|
||||
("more" . "\xe619")
|
||||
("more_horiz" . "\xe5d3")
|
||||
("more_vert" . "\xe5d4")
|
||||
("motorcycle" . "\xe91b")
|
||||
("mouse" . "\xe323")
|
||||
("move_to_inbox" . "\xe168")
|
||||
("movie" . "\xe02c")
|
||||
("movie_creation" . "\xe404")
|
||||
("movie_filter" . "\xe43a")
|
||||
("multiline_chart" . "\xe6df")
|
||||
("music_note" . "\xe405")
|
||||
("music_video" . "\xe063")
|
||||
("my_location" . "\xe55c")
|
||||
("nature" . "\xe406")
|
||||
("nature_people" . "\xe407")
|
||||
("navigate_before" . "\xe408")
|
||||
("navigate_next" . "\xe409")
|
||||
("navigation" . "\xe55d")
|
||||
("near_me" . "\xe569")
|
||||
("network_cell" . "\xe1b9")
|
||||
("network_check" . "\xe640")
|
||||
("network_locked" . "\xe61a")
|
||||
("network_wifi" . "\xe1ba")
|
||||
("new_releases" . "\xe031")
|
||||
("next_week" . "\xe16a")
|
||||
("nfc" . "\xe1bb")
|
||||
("no_encryption" . "\xe641")
|
||||
("no_sim" . "\xe0cc")
|
||||
("not_interested" . "\xe033")
|
||||
("note" . "\xe06f")
|
||||
("note_add" . "\xe89c")
|
||||
("notifications" . "\xe7f4")
|
||||
("notifications_active" . "\xe7f7")
|
||||
("notifications_none" . "\xe7f5")
|
||||
("notifications_off" . "\xe7f6")
|
||||
("notifications_paused" . "\xe7f8")
|
||||
("offline_pin" . "\xe90a")
|
||||
("ondemand_video" . "\xe63a")
|
||||
("opacity" . "\xe91c")
|
||||
("open_in_browser" . "\xe89d")
|
||||
("open_in_new" . "\xe89e")
|
||||
("open_with" . "\xe89f")
|
||||
("pages" . "\xe7f9")
|
||||
("pageview" . "\xe8a0")
|
||||
("palette" . "\xe40a")
|
||||
("pan_tool" . "\xe925")
|
||||
("panorama" . "\xe40b")
|
||||
("panorama_fish_eye" . "\xe40c")
|
||||
("panorama_horizontal" . "\xe40d")
|
||||
("panorama_vertical" . "\xe40e")
|
||||
("panorama_wide_angle" . "\xe40f")
|
||||
("party_mode" . "\xe7fa")
|
||||
("pause" . "\xe034")
|
||||
("pause_circle_filled" . "\xe035")
|
||||
("pause_circle_outline" . "\xe036")
|
||||
("payment" . "\xe8a1")
|
||||
("people" . "\xe7fb")
|
||||
("people_outline" . "\xe7fc")
|
||||
("perm_camera_mic" . "\xe8a2")
|
||||
("perm_contact_calendar" . "\xe8a3")
|
||||
("perm_data_setting" . "\xe8a4")
|
||||
("perm_device_information" . "\xe8a5")
|
||||
("perm_identity" . "\xe8a6")
|
||||
("perm_media" . "\xe8a7")
|
||||
("perm_phone_msg" . "\xe8a8")
|
||||
("perm_scan_wifi" . "\xe8a9")
|
||||
("person" . "\xe7fd")
|
||||
("person_add" . "\xe7fe")
|
||||
("person_outline" . "\xe7ff")
|
||||
("person_pin" . "\xe55a")
|
||||
("person_pin_circle" . "\xe56a")
|
||||
("personal_video" . "\xe63b")
|
||||
("pets" . "\xe91d")
|
||||
("phone" . "\xe0cd")
|
||||
("phone_android" . "\xe324")
|
||||
("phone_bluetooth_speaker" . "\xe61b")
|
||||
("phone_forwarded" . "\xe61c")
|
||||
("phone_in_talk" . "\xe61d")
|
||||
("phone_iphone" . "\xe325")
|
||||
("phone_locked" . "\xe61e")
|
||||
("phone_missed" . "\xe61f")
|
||||
("phone_paused" . "\xe620")
|
||||
("phonelink" . "\xe326")
|
||||
("phonelink_erase" . "\xe0db")
|
||||
("phonelink_lock" . "\xe0dc")
|
||||
("phonelink_off" . "\xe327")
|
||||
("phonelink_ring" . "\xe0dd")
|
||||
("phonelink_setup" . "\xe0de")
|
||||
("photo" . "\xe410")
|
||||
("photo_album" . "\xe411")
|
||||
("photo_camera" . "\xe412")
|
||||
("photo_filter" . "\xe43b")
|
||||
("photo_library" . "\xe413")
|
||||
("photo_size_select_actual" . "\xe432")
|
||||
("photo_size_select_large" . "\xe433")
|
||||
("photo_size_select_small" . "\xe434")
|
||||
("picture_as_pdf" . "\xe415")
|
||||
("picture_in_picture" . "\xe8aa")
|
||||
("picture_in_picture_alt" . "\xe911")
|
||||
("pie_chart" . "\xe6c4")
|
||||
("pie_chart_outlined" . "\xe6c5")
|
||||
("pin_drop" . "\xe55e")
|
||||
("place" . "\xe55f")
|
||||
("play_arrow" . "\xe037")
|
||||
("play_circle_filled" . "\xe038")
|
||||
("play_circle_outline" . "\xe039")
|
||||
("play_for_work" . "\xe906")
|
||||
("playlist_add" . "\xe03b")
|
||||
("playlist_add_check" . "\xe065")
|
||||
("playlist_play" . "\xe05f")
|
||||
("plus_one" . "\xe800")
|
||||
("poll" . "\xe801")
|
||||
("polymer" . "\xe8ab")
|
||||
("pool" . "\xeb48")
|
||||
("portable_wifi_off" . "\xe0ce")
|
||||
("portrait" . "\xe416")
|
||||
("power" . "\xe63c")
|
||||
("power_input" . "\xe336")
|
||||
("power_settings_new" . "\xe8ac")
|
||||
("pregnant_woman" . "\xe91e")
|
||||
("present_to_all" . "\xe0df")
|
||||
("print" . "\xe8ad")
|
||||
("priority_high" . "\xe645")
|
||||
("public" . "\xe80b")
|
||||
("publish" . "\xe255")
|
||||
("query_builder" . "\xe8ae")
|
||||
("question_answer" . "\xe8af")
|
||||
("queue" . "\xe03c")
|
||||
("queue_music" . "\xe03d")
|
||||
("queue_play_next" . "\xe066")
|
||||
("radio" . "\xe03e")
|
||||
("radio_button_checked" . "\xe837")
|
||||
("radio_button_unchecked" . "\xe836")
|
||||
("rate_review" . "\xe560")
|
||||
("receipt" . "\xe8b0")
|
||||
("recent_actors" . "\xe03f")
|
||||
("record_voice_over" . "\xe91f")
|
||||
("redeem" . "\xe8b1")
|
||||
("redo" . "\xe15a")
|
||||
("refresh" . "\xe5d5")
|
||||
("remove" . "\xe15b")
|
||||
("remove_circle" . "\xe15c")
|
||||
("remove_circle_outline" . "\xe15d")
|
||||
("remove_from_queue" . "\xe067")
|
||||
("remove_red_eye" . "\xe417")
|
||||
("remove_shopping_cart" . "\xe928")
|
||||
("reorder" . "\xe8fe")
|
||||
("repeat" . "\xe040")
|
||||
("repeat_one" . "\xe041")
|
||||
("replay" . "\xe042")
|
||||
("replay_10" . "\xe059")
|
||||
("replay_30" . "\xe05a")
|
||||
("replay_5" . "\xe05b")
|
||||
("reply" . "\xe15e")
|
||||
("reply_all" . "\xe15f")
|
||||
("report" . "\xe160")
|
||||
("report_problem" . "\xe8b2")
|
||||
("restaurant" . "\xe56c")
|
||||
("restaurant_menu" . "\xe561")
|
||||
("restore" . "\xe8b3")
|
||||
("restore_page" . "\xe929")
|
||||
("ring_volume" . "\xe0d1")
|
||||
("room" . "\xe8b4")
|
||||
("room_service" . "\xeb49")
|
||||
("rotate_90_degrees_ccw" . "\xe418")
|
||||
("rotate_left" . "\xe419")
|
||||
("rotate_right" . "\xe41a")
|
||||
("rounded_corner" . "\xe920")
|
||||
("router" . "\xe328")
|
||||
("rowing" . "\xe921")
|
||||
("rss_feed" . "\xe0e5")
|
||||
("rv_hookup" . "\xe642")
|
||||
("satellite" . "\xe562")
|
||||
("save" . "\xe161")
|
||||
("scanner" . "\xe329")
|
||||
("schedule" . "\xe8b5")
|
||||
("school" . "\xe80c")
|
||||
("screen_lock_landscape" . "\xe1be")
|
||||
("screen_lock_portrait" . "\xe1bf")
|
||||
("screen_lock_rotation" . "\xe1c0")
|
||||
("screen_rotation" . "\xe1c1")
|
||||
("screen_share" . "\xe0e2")
|
||||
("sd_card" . "\xe623")
|
||||
("sd_storage" . "\xe1c2")
|
||||
("search" . "\xe8b6")
|
||||
("security" . "\xe32a")
|
||||
("select_all" . "\xe162")
|
||||
("send" . "\xe163")
|
||||
("sentiment_dissatisfied" . "\xe811")
|
||||
("sentiment_neutral" . "\xe812")
|
||||
("sentiment_satisfied" . "\xe813")
|
||||
("sentiment_very_dissatisfied" . "\xe814")
|
||||
("sentiment_very_satisfied" . "\xe815")
|
||||
("settings" . "\xe8b8")
|
||||
("settings_applications" . "\xe8b9")
|
||||
("settings_backup_restore" . "\xe8ba")
|
||||
("settings_bluetooth" . "\xe8bb")
|
||||
("settings_brightness" . "\xe8bd")
|
||||
("settings_cell" . "\xe8bc")
|
||||
("settings_ethernet" . "\xe8be")
|
||||
("settings_input_antenna" . "\xe8bf")
|
||||
("settings_input_component" . "\xe8c0")
|
||||
("settings_input_composite" . "\xe8c1")
|
||||
("settings_input_hdmi" . "\xe8c2")
|
||||
("settings_input_svideo" . "\xe8c3")
|
||||
("settings_overscan" . "\xe8c4")
|
||||
("settings_phone" . "\xe8c5")
|
||||
("settings_power" . "\xe8c6")
|
||||
("settings_remote" . "\xe8c7")
|
||||
("settings_system_daydream" . "\xe1c3")
|
||||
("settings_voice" . "\xe8c8")
|
||||
("share" . "\xe80d")
|
||||
("shop" . "\xe8c9")
|
||||
("shop_two" . "\xe8ca")
|
||||
("shopping_basket" . "\xe8cb")
|
||||
("shopping_cart" . "\xe8cc")
|
||||
("short_text" . "\xe261")
|
||||
("show_chart" . "\xe6e1")
|
||||
("shuffle" . "\xe043")
|
||||
("signal_cellular_4_bar" . "\xe1c8")
|
||||
("signal_cellular_connected_no_internet_4_bar" . "\xe1cd")
|
||||
("signal_cellular_no_sim" . "\xe1ce")
|
||||
("signal_cellular_null" . "\xe1cf")
|
||||
("signal_cellular_off" . "\xe1d0")
|
||||
("signal_wifi_4_bar" . "\xe1d8")
|
||||
("signal_wifi_4_bar_lock" . "\xe1d9")
|
||||
("signal_wifi_off" . "\xe1da")
|
||||
("sim_card" . "\xe32b")
|
||||
("sim_card_alert" . "\xe624")
|
||||
("skip_next" . "\xe044")
|
||||
("skip_previous" . "\xe045")
|
||||
("slideshow" . "\xe41b")
|
||||
("slow_motion_video" . "\xe068")
|
||||
("smartphone" . "\xe32c")
|
||||
("smoke_free" . "\xeb4a")
|
||||
("smoking_rooms" . "\xeb4b")
|
||||
("sms" . "\xe625")
|
||||
("sms_failed" . "\xe626")
|
||||
("snooze" . "\xe046")
|
||||
("sort" . "\xe164")
|
||||
("sort_by_alpha" . "\xe053")
|
||||
("spa" . "\xeb4c")
|
||||
("space_bar" . "\xe256")
|
||||
("speaker" . "\xe32d")
|
||||
("speaker_group" . "\xe32e")
|
||||
("speaker_notes" . "\xe8cd")
|
||||
("speaker_notes_off" . "\xe92a")
|
||||
("speaker_phone" . "\xe0d2")
|
||||
("spellcheck" . "\xe8ce")
|
||||
("star" . "\xe838")
|
||||
("star_border" . "\xe83a")
|
||||
("star_half" . "\xe839")
|
||||
("stars" . "\xe8d0")
|
||||
("stay_current_landscape" . "\xe0d3")
|
||||
("stay_current_portrait" . "\xe0d4")
|
||||
("stay_primary_landscape" . "\xe0d5")
|
||||
("stay_primary_portrait" . "\xe0d6")
|
||||
("stop" . "\xe047")
|
||||
("stop_screen_share" . "\xe0e3")
|
||||
("storage" . "\xe1db")
|
||||
("store" . "\xe8d1")
|
||||
("store_mall_directory" . "\xe563")
|
||||
("straighten" . "\xe41c")
|
||||
("streetview" . "\xe56e")
|
||||
("strikethrough_s" . "\xe257")
|
||||
("style" . "\xe41d")
|
||||
("subdirectory_arrow_left" . "\xe5d9")
|
||||
("subdirectory_arrow_right" . "\xe5da")
|
||||
("subject" . "\xe8d2")
|
||||
("subscriptions" . "\xe064")
|
||||
("subtitles" . "\xe048")
|
||||
("subway" . "\xe56f")
|
||||
("supervisor_account" . "\xe8d3")
|
||||
("surround_sound" . "\xe049")
|
||||
("swap_calls" . "\xe0d7")
|
||||
("swap_horiz" . "\xe8d4")
|
||||
("swap_vert" . "\xe8d5")
|
||||
("swap_vertical_circle" . "\xe8d6")
|
||||
("switch_camera" . "\xe41e")
|
||||
("switch_video" . "\xe41f")
|
||||
("sync" . "\xe627")
|
||||
("sync_disabled" . "\xe628")
|
||||
("sync_problem" . "\xe629")
|
||||
("system_update" . "\xe62a")
|
||||
("system_update_alt" . "\xe8d7")
|
||||
("tab" . "\xe8d8")
|
||||
("tab_unselected" . "\xe8d9")
|
||||
("tablet" . "\xe32f")
|
||||
("tablet_android" . "\xe330")
|
||||
("tablet_mac" . "\xe331")
|
||||
("tag_faces" . "\xe420")
|
||||
("tap_and_play" . "\xe62b")
|
||||
("terrain" . "\xe564")
|
||||
("text_fields" . "\xe262")
|
||||
("text_format" . "\xe165")
|
||||
("textsms" . "\xe0d8")
|
||||
("texture" . "\xe421")
|
||||
("theaters" . "\xe8da")
|
||||
("thumb_down" . "\xe8db")
|
||||
("thumb_up" . "\xe8dc")
|
||||
("thumbs_up_down" . "\xe8dd")
|
||||
("time_to_leave" . "\xe62c")
|
||||
("timelapse" . "\xe422")
|
||||
("timeline" . "\xe922")
|
||||
("timer" . "\xe425")
|
||||
("timer_10" . "\xe423")
|
||||
("timer_3" . "\xe424")
|
||||
("timer_off" . "\xe426")
|
||||
("title" . "\xe264")
|
||||
("toc" . "\xe8de")
|
||||
("today" . "\xe8df")
|
||||
("toll" . "\xe8e0")
|
||||
("tonality" . "\xe427")
|
||||
("touch_app" . "\xe913")
|
||||
("toys" . "\xe332")
|
||||
("track_changes" . "\xe8e1")
|
||||
("traffic" . "\xe565")
|
||||
("train" . "\xe570")
|
||||
("tram" . "\xe571")
|
||||
("transfer_within_a_station" . "\xe572")
|
||||
("transform" . "\xe428")
|
||||
("translate" . "\xe8e2")
|
||||
("trending_down" . "\xe8e3")
|
||||
("trending_flat" . "\xe8e4")
|
||||
("trending_up" . "\xe8e5")
|
||||
("tune" . "\xe429")
|
||||
("turned_in" . "\xe8e6")
|
||||
("turned_in_not" . "\xe8e7")
|
||||
("tv" . "\xe333")
|
||||
("unarchive" . "\xe169")
|
||||
("undo" . "\xe166")
|
||||
("unfold_less" . "\xe5d6")
|
||||
("unfold_more" . "\xe5d7")
|
||||
("update" . "\xe923")
|
||||
("usb" . "\xe1e0")
|
||||
("verified_user" . "\xe8e8")
|
||||
("vertical_align_bottom" . "\xe258")
|
||||
("vertical_align_center" . "\xe259")
|
||||
("vertical_align_top" . "\xe25a")
|
||||
("vibration" . "\xe62d")
|
||||
("video_call" . "\xe070")
|
||||
("video_label" . "\xe071")
|
||||
("video_library" . "\xe04a")
|
||||
("videocam" . "\xe04b")
|
||||
("videocam_off" . "\xe04c")
|
||||
("videogame_asset" . "\xe338")
|
||||
("view_agenda" . "\xe8e9")
|
||||
("view_array" . "\xe8ea")
|
||||
("view_carousel" . "\xe8eb")
|
||||
("view_column" . "\xe8ec")
|
||||
("view_comfy" . "\xe42a")
|
||||
("view_compact" . "\xe42b")
|
||||
("view_day" . "\xe8ed")
|
||||
("view_headline" . "\xe8ee")
|
||||
("view_list" . "\xe8ef")
|
||||
("view_module" . "\xe8f0")
|
||||
("view_quilt" . "\xe8f1")
|
||||
("view_stream" . "\xe8f2")
|
||||
("view_week" . "\xe8f3")
|
||||
("vignette" . "\xe435")
|
||||
("visibility" . "\xe8f4")
|
||||
("visibility_off" . "\xe8f5")
|
||||
("voice_chat" . "\xe62e")
|
||||
("voicemail" . "\xe0d9")
|
||||
("volume_down" . "\xe04d")
|
||||
("volume_mute" . "\xe04e")
|
||||
("volume_off" . "\xe04f")
|
||||
("volume_up" . "\xe050")
|
||||
("vpn_key" . "\xe0da")
|
||||
("vpn_lock" . "\xe62f")
|
||||
("wallpaper" . "\xe1bc")
|
||||
("warning" . "\xe002")
|
||||
("watch" . "\xe334")
|
||||
("watch_later" . "\xe924")
|
||||
("wb_auto" . "\xe42c")
|
||||
("wb_cloudy" . "\xe42d")
|
||||
("wb_incandescent" . "\xe42e")
|
||||
("wb_iridescent" . "\xe436")
|
||||
("wb_sunny" . "\xe430")
|
||||
("wc" . "\xe63d")
|
||||
("web" . "\xe051")
|
||||
("web_asset" . "\xe069")
|
||||
("weekend" . "\xe16b")
|
||||
("whatshot" . "\xe80e")
|
||||
("widgets" . "\xe1bd")
|
||||
("wifi" . "\xe63e")
|
||||
("wifi_lock" . "\xe1e1")
|
||||
("wifi_tethering" . "\xe1e2")
|
||||
("work" . "\xe8f9")
|
||||
("wrap_text" . "\xe25b")
|
||||
("youtube_searched_for" . "\xe8fa")
|
||||
("zoom_in" . "\xe8ff")
|
||||
("zoom_out" . "\xe900")
|
||||
("zoom_out_map" . "\xe56b")))
|
||||
|
||||
(provide 'data-material)
|
||||
Binary file not shown.
|
|
@ -1,167 +0,0 @@
|
|||
;; -*- lexical-binding: t -*-
|
||||
|
||||
(defvar all-the-icons-data/octicons-alist
|
||||
'(
|
||||
|
||||
("alert" . "\xf02d")
|
||||
("arrow-down" . "\xf03f")
|
||||
("arrow-left" . "\xf040")
|
||||
("arrow-right" . "\xf03e")
|
||||
("arrow-small-down" . "\xf0a0")
|
||||
("arrow-small-left" . "\xf0a1")
|
||||
("arrow-small-right" . "\xf071")
|
||||
("arrow-small-up" . "\xf09f")
|
||||
("arrow-up" . "\xf03d")
|
||||
("book" . "\xf007")
|
||||
("bookmark" . "\xf07b")
|
||||
("briefcase" . "\xf0d3")
|
||||
("broadcast" . "\xf048")
|
||||
("browser" . "\xf0c5")
|
||||
("bug" . "\xf091")
|
||||
("calendar" . "\xf068")
|
||||
("check" . "\xf03a")
|
||||
("checklist" . "\xf076")
|
||||
("chevron-down" . "\xf0a3")
|
||||
("chevron-left" . "\xf0a4")
|
||||
("chevron-right" . "\xf078")
|
||||
("chevron-up" . "\xf0a2")
|
||||
("circle-slash" . "\xf084")
|
||||
("circuit-board" . "\xf0d6")
|
||||
("clippy" . "\xf035")
|
||||
("clock" . "\xf046")
|
||||
("cloud-download" . "\xf00b")
|
||||
("cloud-upload" . "\xf00c")
|
||||
("code" . "\xf05f")
|
||||
("comment" . "\xf02b")
|
||||
("comment-discussion" . "\xf04f")
|
||||
("credit-card" . "\xf045")
|
||||
("dash" . "\xf0ca")
|
||||
("dashboard" . "\xf07d")
|
||||
("database" . "\xf096")
|
||||
("device-camera" . "\xf056")
|
||||
("device-camera-video" . "\xf057")
|
||||
("device-desktop" . "\xf27c")
|
||||
("device-mobile" . "\xf038")
|
||||
("diff" . "\xf04d")
|
||||
("diff-added" . "\xf06b")
|
||||
("diff-ignored" . "\xf099")
|
||||
("diff-modified" . "\xf06d")
|
||||
("diff-removed" . "\xf06c")
|
||||
("diff-renamed" . "\xf06e")
|
||||
("ellipsis" . "\xf09a")
|
||||
("eye" . "\xf04e")
|
||||
("file-binary" . "\xf094")
|
||||
("file-code" . "\xf010")
|
||||
("file-directory" . "\xf016")
|
||||
("file-media" . "\xf012")
|
||||
("file-pdf" . "\xf014")
|
||||
("file-submodule" . "\xf017")
|
||||
("file-symlink-directory" . "\xf0b1")
|
||||
("file-symlink-file" . "\xf0b0")
|
||||
("file-text" . "\xf011")
|
||||
("file-zip" . "\xf013")
|
||||
("flame" . "\xf0d2")
|
||||
("fold" . "\xf0cc")
|
||||
("gear" . "\xf02f")
|
||||
("gift" . "\xf042")
|
||||
("gist" . "\xf00e")
|
||||
("gist-secret" . "\xf08c")
|
||||
("git-branch" . "\xf020")
|
||||
("git-commit" . "\xf01f")
|
||||
("git-compare" . "\xf0ac")
|
||||
("git-merge" . "\xf023")
|
||||
("git-pull-request" . "\xf009")
|
||||
("globe" . "\xf0b6")
|
||||
("graph" . "\xf043")
|
||||
("beaker" . "\xf0dd")
|
||||
("heart" . "\x2665")
|
||||
("history" . "\xf07e")
|
||||
("home" . "\xf08d")
|
||||
("horizontal-rule" . "\xf070")
|
||||
("hourglass" . "\xf09e")
|
||||
("hubot" . "\xf09d")
|
||||
("inbox" . "\xf0cf")
|
||||
("info" . "\xf059")
|
||||
("issue-closed" . "\xf028")
|
||||
("issue-opened" . "\xf026")
|
||||
("issue-reopened" . "\xf027")
|
||||
("jersey" . "\xf019")
|
||||
("key" . "\xf049")
|
||||
("keyboard" . "\xf00d")
|
||||
("law" . "\xf0d8")
|
||||
("light-bulb" . "\xf000")
|
||||
("link" . "\xf05c")
|
||||
("link-external" . "\xf07f")
|
||||
("list-ordered" . "\xf062")
|
||||
("list-unordered" . "\xf061")
|
||||
("location" . "\xf060")
|
||||
("lock" . "\xf06a")
|
||||
("logo-github" . "\xf092")
|
||||
("mail" . "\xf03b")
|
||||
("mail-read" . "\xf03c")
|
||||
("mail-reply" . "\xf051")
|
||||
("mark-github" . "\xf00a")
|
||||
("markdown" . "\xf0c9")
|
||||
("megaphone" . "\xf077")
|
||||
("mention" . "\xf0be")
|
||||
("milestone" . "\xf075")
|
||||
("mirror" . "\xf024")
|
||||
("mortar-board" . "\xf0d7")
|
||||
("mute" . "\xf080")
|
||||
("no-newline" . "\xf09c")
|
||||
("octoface" . "\xf008")
|
||||
("organization" . "\xf037")
|
||||
("package" . "\xf0c4")
|
||||
("paintcan" . "\xf0d1")
|
||||
("pencil" . "\xf058")
|
||||
("person" . "\xf018")
|
||||
("pin" . "\xf041")
|
||||
("plug" . "\xf0d4")
|
||||
("plus" . "\xf05d")
|
||||
("primitive-dot" . "\xf052")
|
||||
("primitive-square" . "\xf053")
|
||||
("pulse" . "\xf085")
|
||||
("puzzle" . "\xf0c0")
|
||||
("question" . "\xf02c")
|
||||
("quote" . "\xf063")
|
||||
("radio-tower" . "\xf030")
|
||||
("repo" . "\xf001")
|
||||
("repo-clone" . "\xf04c")
|
||||
("repo-force-push" . "\xf04a")
|
||||
("repo-forked" . "\xf002")
|
||||
("repo-pull" . "\xf006")
|
||||
("repo-push" . "\xf005")
|
||||
("rocket" . "\xf033")
|
||||
("rss" . "\xf034")
|
||||
("ruby" . "\xf047")
|
||||
("search" . "\xf02e")
|
||||
("server" . "\xf097")
|
||||
("settings" . "\xf07c")
|
||||
("sign-in" . "\xf036")
|
||||
("sign-out" . "\xf032")
|
||||
("squirrel" . "\xf0b2")
|
||||
("star" . "\xf02a")
|
||||
("steps" . "\xf0c7")
|
||||
("stop" . "\xf08f")
|
||||
("sync" . "\xf087")
|
||||
("tag" . "\xf015")
|
||||
("telescope" . "\xf088")
|
||||
("terminal" . "\xf0c8")
|
||||
("three-bars" . "\xf05e")
|
||||
("thumbsdown" . "\xf0db")
|
||||
("thumbsup" . "\xf0da")
|
||||
("tools" . "\xf031")
|
||||
("trashcan" . "\xf0d0")
|
||||
("triangle-down" . "\xf05b")
|
||||
("triangle-left" . "\xf044")
|
||||
("triangle-right" . "\xf05a")
|
||||
("triangle-up" . "\xf0aa")
|
||||
("unfold" . "\xf039")
|
||||
("unmute" . "\xf0ba")
|
||||
("versions" . "\xf064")
|
||||
("x" . "\xf081")
|
||||
("zap" . "\x26A1")
|
||||
|
||||
))
|
||||
|
||||
(provide 'data-octicons)
|
||||
Binary file not shown.
|
|
@ -1,596 +0,0 @@
|
|||
;; -*- lexical-binding: t -*-
|
||||
|
||||
(defvar all-the-icons-data/weather-icons-alist
|
||||
'(
|
||||
|
||||
("alien" . "\xf075")
|
||||
("barometer" . "\xf079")
|
||||
("celsius" . "\xf03c")
|
||||
("cloud" . "\xf041")
|
||||
("cloud-down" . "\xf03d")
|
||||
("cloud-refresh" . "\xf03e")
|
||||
("cloud-up" . "\xf040")
|
||||
("cloudy" . "\xf013")
|
||||
("cloudy-gusts" . "\xf011")
|
||||
("cloudy-windy" . "\xf012")
|
||||
("day-cloudy" . "\xf002")
|
||||
("day-cloudy-gusts" . "\xf000")
|
||||
("day-cloudy-high" . "\xf07d")
|
||||
("day-cloudy-windy" . "\xf001")
|
||||
("day-fog" . "\xf003")
|
||||
("day-hail" . "\xf004")
|
||||
("day-haze" . "\xf0b6")
|
||||
("day-light-wind" . "\xf0c4")
|
||||
("day-lightning" . "\xf005")
|
||||
("day-rain" . "\xf008")
|
||||
("day-rain-mix" . "\xf006")
|
||||
("day-rain-wind" . "\xf007")
|
||||
("day-showers" . "\xf009")
|
||||
("day-sleet" . "\xf0b2")
|
||||
("day-sleet-storm" . "\xf068")
|
||||
("day-snow" . "\xf00a")
|
||||
("day-snow-thunderstorm" . "\xf06b")
|
||||
("day-snow-wind" . "\xf065")
|
||||
("day-sprinkle" . "\xf00b")
|
||||
("day-storm-showers" . "\xf00e")
|
||||
("day-sunny" . "\xf00d")
|
||||
("day-sunny-overcast" . "\xf00c")
|
||||
("day-thunderstorm" . "\xf010")
|
||||
("day-windy" . "\xf085")
|
||||
("degrees" . "\xf042")
|
||||
("direction-down" . "\xf044")
|
||||
("direction-down-left" . "\xf043")
|
||||
("direction-down-right" . "\xf088")
|
||||
("direction-left" . "\xf048")
|
||||
("direction-right" . "\xf04d")
|
||||
("direction-up" . "\xf058")
|
||||
("direction-up-left" . "\xf087")
|
||||
("direction-up-right" . "\xf057")
|
||||
("dust" . "\xf063")
|
||||
("earthquake" . "\xf0c6")
|
||||
("fahrenheit" . "\xf045")
|
||||
("fire" . "\xf0c7")
|
||||
("flood" . "\xf07c")
|
||||
("fog" . "\xf014")
|
||||
("forecast-io-clear-day" . "\xf00d")
|
||||
("forecast-io-clear-night" . "\xf02e")
|
||||
("forecast-io-cloudy" . "\xf013")
|
||||
("forecast-io-fog" . "\xf014")
|
||||
("forecast-io-hail" . "\xf015")
|
||||
("forecast-io-partly-cloudy-day" . "\xf002")
|
||||
("forecast-io-partly-cloudy-night" . "\xf031")
|
||||
("forecast-io-rain" . "\xf019")
|
||||
("forecast-io-sleet" . "\xf0b5")
|
||||
("forecast-io-snow" . "\xf01b")
|
||||
("forecast-io-thunderstorm" . "\xf01e")
|
||||
("forecast-io-tornado" . "\xf056")
|
||||
("forecast-io-wind" . "\xf050")
|
||||
("gale-warning" . "\xf0cd")
|
||||
("hail" . "\xf015")
|
||||
("horizon" . "\xf047")
|
||||
("horizon-alt" . "\xf046")
|
||||
("hot" . "\xf072")
|
||||
("humidity" . "\xf07a")
|
||||
("hurricane" . "\xf073")
|
||||
("hurricane-warning" . "\xf0cf")
|
||||
("lightning" . "\xf016")
|
||||
("lunar-eclipse" . "\xf070")
|
||||
("meteor" . "\xf071")
|
||||
("moon-0" . "\xf095")
|
||||
("moon-1" . "\xf096")
|
||||
("moon-10" . "\xf09f")
|
||||
("moon-11" . "\xf0a0")
|
||||
("moon-12" . "\xf0a1")
|
||||
("moon-13" . "\xf0a2")
|
||||
("moon-14" . "\xf0a3")
|
||||
("moon-15" . "\xf0a4")
|
||||
("moon-16" . "\xf0a5")
|
||||
("moon-17" . "\xf0a6")
|
||||
("moon-18" . "\xf0a7")
|
||||
("moon-19" . "\xf0a8")
|
||||
("moon-2" . "\xf097")
|
||||
("moon-20" . "\xf0a9")
|
||||
("moon-21" . "\xf0aa")
|
||||
("moon-22" . "\xf0ab")
|
||||
("moon-23" . "\xf0ac")
|
||||
("moon-24" . "\xf0ad")
|
||||
("moon-25" . "\xf0ae")
|
||||
("moon-26" . "\xf0af")
|
||||
("moon-27" . "\xf0b0")
|
||||
("moon-3" . "\xf098")
|
||||
("moon-4" . "\xf099")
|
||||
("moon-5" . "\xf09a")
|
||||
("moon-6" . "\xf09b")
|
||||
("moon-7" . "\xf09c")
|
||||
("moon-8" . "\xf09d")
|
||||
("moon-9" . "\xf09e")
|
||||
("moon-alt-first-quarter" . "\xf0d6")
|
||||
("moon-alt-full" . "\xf0dd")
|
||||
("moon-alt-new" . "\xf0eb")
|
||||
("moon-alt-third-quarter" . "\xf0e4")
|
||||
("moon-alt-waning-crescent-1" . "\xf0e5")
|
||||
("moon-alt-waning-crescent-2" . "\xf0e6")
|
||||
("moon-alt-waning-crescent-3" . "\xf0e7")
|
||||
("moon-alt-waning-crescent-4" . "\xf0e8")
|
||||
("moon-alt-waning-crescent-5" . "\xf0e9")
|
||||
("moon-alt-waning-crescent-6" . "\xf0ea")
|
||||
("moon-alt-waning-gibbous-1" . "\xf0de")
|
||||
("moon-alt-waning-gibbous-2" . "\xf0df")
|
||||
("moon-alt-waning-gibbous-3" . "\xf0e0")
|
||||
("moon-alt-waning-gibbous-4" . "\xf0e1")
|
||||
("moon-alt-waning-gibbous-5" . "\xf0e2")
|
||||
("moon-alt-waning-gibbous-6" . "\xf0e3")
|
||||
("moon-alt-waxing-crescent-1" . "\xf0d0")
|
||||
("moon-alt-waxing-crescent-2" . "\xf0d1")
|
||||
("moon-alt-waxing-crescent-3" . "\xf0d2")
|
||||
("moon-alt-waxing-crescent-4" . "\xf0d3")
|
||||
("moon-alt-waxing-crescent-5" . "\xf0d4")
|
||||
("moon-alt-waxing-crescent-6" . "\xf0d5")
|
||||
("moon-alt-waxing-gibbous-1" . "\xf0d7")
|
||||
("moon-alt-waxing-gibbous-2" . "\xf0d8")
|
||||
("moon-alt-waxing-gibbous-3" . "\xf0d9")
|
||||
("moon-alt-waxing-gibbous-4" . "\xf0da")
|
||||
("moon-alt-waxing-gibbous-5" . "\xf0db")
|
||||
("moon-alt-waxing-gibbous-6" . "\xf0dc")
|
||||
("moon-first-quarter" . "\xf09c")
|
||||
("moon-full" . "\xf0a3")
|
||||
("moon-new" . "\xf095")
|
||||
("moon-third-quarter" . "\xf0aa")
|
||||
("moon-waning-crescent-1" . "\xf0ab")
|
||||
("moon-waning-crescent-2" . "\xf0ac")
|
||||
("moon-waning-crescent-3" . "\xf0ad")
|
||||
("moon-waning-crescent-4" . "\xf0ae")
|
||||
("moon-waning-crescent-5" . "\xf0af")
|
||||
("moon-waning-crescent-6" . "\xf0b0")
|
||||
("moon-waning-gibbous-1" . "\xf0a4")
|
||||
("moon-waning-gibbous-2" . "\xf0a5")
|
||||
("moon-waning-gibbous-3" . "\xf0a6")
|
||||
("moon-waning-gibbous-4" . "\xf0a7")
|
||||
("moon-waning-gibbous-5" . "\xf0a8")
|
||||
("moon-waning-gibbous-6" . "\xf0a9")
|
||||
("moon-waxing-crescent-1" . "\xf096")
|
||||
("moon-waxing-crescent-2" . "\xf097")
|
||||
("moon-waxing-crescent-3" . "\xf098")
|
||||
("moon-waxing-crescent-4" . "\xf099")
|
||||
("moon-waxing-crescent-5" . "\xf09a")
|
||||
("moon-waxing-crescent-6" . "\xf09b")
|
||||
("moon-waxing-gibbous-1" . "\xf09d")
|
||||
("moon-waxing-gibbous-2" . "\xf09e")
|
||||
("moon-waxing-gibbous-3" . "\xf09f")
|
||||
("moon-waxing-gibbous-4" . "\xf0a0")
|
||||
("moon-waxing-gibbous-5" . "\xf0a1")
|
||||
("moon-waxing-gibbous-6" . "\xf0a2")
|
||||
("moonrise" . "\xf0c9")
|
||||
("moonset" . "\xf0ca")
|
||||
("na" . "\xf07b")
|
||||
("night-alt-cloudy" . "\xf086")
|
||||
("night-alt-cloudy-gusts" . "\xf022")
|
||||
("night-alt-cloudy-high" . "\xf07e")
|
||||
("night-alt-cloudy-windy" . "\xf023")
|
||||
("night-alt-hail" . "\xf024")
|
||||
("night-alt-lightning" . "\xf025")
|
||||
("night-alt-partly-cloudy" . "\xf081")
|
||||
("night-alt-rain" . "\xf028")
|
||||
("night-alt-rain-mix" . "\xf026")
|
||||
("night-alt-rain-wind" . "\xf027")
|
||||
("night-alt-showers" . "\xf029")
|
||||
("night-alt-sleet" . "\xf0b4")
|
||||
("night-alt-sleet-storm" . "\xf06a")
|
||||
("night-alt-snow" . "\xf02a")
|
||||
("night-alt-snow-thunderstorm" . "\xf06d")
|
||||
("night-alt-snow-wind" . "\xf067")
|
||||
("night-alt-sprinkle" . "\xf02b")
|
||||
("night-alt-storm-showers" . "\xf02c")
|
||||
("night-alt-thunderstorm" . "\xf02d")
|
||||
("night-clear" . "\xf02e")
|
||||
("night-cloudy" . "\xf031")
|
||||
("night-cloudy-gusts" . "\xf02f")
|
||||
("night-cloudy-high" . "\xf080")
|
||||
("night-cloudy-windy" . "\xf030")
|
||||
("night-fog" . "\xf04a")
|
||||
("night-hail" . "\xf032")
|
||||
("night-lightning" . "\xf033")
|
||||
("night-partly-cloudy" . "\xf083")
|
||||
("night-rain" . "\xf036")
|
||||
("night-rain-mix" . "\xf034")
|
||||
("night-rain-wind" . "\xf035")
|
||||
("night-showers" . "\xf037")
|
||||
("night-sleet" . "\xf0b3")
|
||||
("night-sleet-storm" . "\xf069")
|
||||
("night-snow" . "\xf038")
|
||||
("night-snow-thunderstorm" . "\xf06c")
|
||||
("night-snow-wind" . "\xf066")
|
||||
("night-sprinkle" . "\xf039")
|
||||
("night-storm-showers" . "\xf03a")
|
||||
("night-thunderstorm" . "\xf03b")
|
||||
("owm-200" . "\xf01e")
|
||||
("owm-201" . "\xf01e")
|
||||
("owm-202" . "\xf01e")
|
||||
("owm-210" . "\xf016")
|
||||
("owm-211" . "\xf016")
|
||||
("owm-212" . "\xf016")
|
||||
("owm-221" . "\xf016")
|
||||
("owm-230" . "\xf01e")
|
||||
("owm-231" . "\xf01e")
|
||||
("owm-232" . "\xf01e")
|
||||
("owm-300" . "\xf01c")
|
||||
("owm-301" . "\xf01c")
|
||||
("owm-302" . "\xf019")
|
||||
("owm-310" . "\xf017")
|
||||
("owm-311" . "\xf019")
|
||||
("owm-312" . "\xf019")
|
||||
("owm-313" . "\xf01a")
|
||||
("owm-314" . "\xf019")
|
||||
("owm-321" . "\xf01c")
|
||||
("owm-500" . "\xf01c")
|
||||
("owm-501" . "\xf019")
|
||||
("owm-502" . "\xf019")
|
||||
("owm-503" . "\xf019")
|
||||
("owm-504" . "\xf019")
|
||||
("owm-511" . "\xf017")
|
||||
("owm-520" . "\xf01a")
|
||||
("owm-521" . "\xf01a")
|
||||
("owm-522" . "\xf01a")
|
||||
("owm-531" . "\xf01d")
|
||||
("owm-600" . "\xf01b")
|
||||
("owm-601" . "\xf01b")
|
||||
("owm-602" . "\xf0b5")
|
||||
("owm-611" . "\xf017")
|
||||
("owm-612" . "\xf017")
|
||||
("owm-615" . "\xf017")
|
||||
("owm-616" . "\xf017")
|
||||
("owm-620" . "\xf017")
|
||||
("owm-621" . "\xf01b")
|
||||
("owm-622" . "\xf01b")
|
||||
("owm-701" . "\xf01a")
|
||||
("owm-711" . "\xf062")
|
||||
("owm-721" . "\xf0b6")
|
||||
("owm-731" . "\xf063")
|
||||
("owm-741" . "\xf014")
|
||||
("owm-761" . "\xf063")
|
||||
("owm-762" . "\xf063")
|
||||
("owm-771" . "\xf011")
|
||||
("owm-781" . "\xf056")
|
||||
("owm-800" . "\xf00d")
|
||||
("owm-801" . "\xf011")
|
||||
("owm-802" . "\xf011")
|
||||
("owm-803" . "\xf012")
|
||||
("owm-804" . "\xf013")
|
||||
("owm-900" . "\xf056")
|
||||
("owm-901" . "\xf01d")
|
||||
("owm-902" . "\xf073")
|
||||
("owm-903" . "\xf076")
|
||||
("owm-904" . "\xf072")
|
||||
("owm-905" . "\xf021")
|
||||
("owm-906" . "\xf015")
|
||||
("owm-957" . "\xf050")
|
||||
("owm-day-200" . "\xf010")
|
||||
("owm-day-201" . "\xf010")
|
||||
("owm-day-202" . "\xf010")
|
||||
("owm-day-210" . "\xf005")
|
||||
("owm-day-211" . "\xf005")
|
||||
("owm-day-212" . "\xf005")
|
||||
("owm-day-221" . "\xf005")
|
||||
("owm-day-230" . "\xf010")
|
||||
("owm-day-231" . "\xf010")
|
||||
("owm-day-232" . "\xf010")
|
||||
("owm-day-300" . "\xf00b")
|
||||
("owm-day-301" . "\xf00b")
|
||||
("owm-day-302" . "\xf008")
|
||||
("owm-day-310" . "\xf008")
|
||||
("owm-day-311" . "\xf008")
|
||||
("owm-day-312" . "\xf008")
|
||||
("owm-day-313" . "\xf008")
|
||||
("owm-day-314" . "\xf008")
|
||||
("owm-day-321" . "\xf00b")
|
||||
("owm-day-500" . "\xf00b")
|
||||
("owm-day-501" . "\xf008")
|
||||
("owm-day-502" . "\xf008")
|
||||
("owm-day-503" . "\xf008")
|
||||
("owm-day-504" . "\xf008")
|
||||
("owm-day-511" . "\xf006")
|
||||
("owm-day-520" . "\xf009")
|
||||
("owm-day-521" . "\xf009")
|
||||
("owm-day-522" . "\xf009")
|
||||
("owm-day-531" . "\xf00e")
|
||||
("owm-day-600" . "\xf00a")
|
||||
("owm-day-601" . "\xf0b2")
|
||||
("owm-day-602" . "\xf00a")
|
||||
("owm-day-611" . "\xf006")
|
||||
("owm-day-612" . "\xf006")
|
||||
("owm-day-615" . "\xf006")
|
||||
("owm-day-616" . "\xf006")
|
||||
("owm-day-620" . "\xf006")
|
||||
("owm-day-621" . "\xf00a")
|
||||
("owm-day-622" . "\xf00a")
|
||||
("owm-day-701" . "\xf009")
|
||||
("owm-day-711" . "\xf062")
|
||||
("owm-day-721" . "\xf0b6")
|
||||
("owm-day-731" . "\xf063")
|
||||
("owm-day-741" . "\xf003")
|
||||
("owm-day-761" . "\xf063")
|
||||
("owm-day-762" . "\xf063")
|
||||
("owm-day-781" . "\xf056")
|
||||
("owm-day-800" . "\xf00d")
|
||||
("owm-day-801" . "\xf000")
|
||||
("owm-day-802" . "\xf000")
|
||||
("owm-day-803" . "\xf000")
|
||||
("owm-day-804" . "\xf00c")
|
||||
("owm-day-900" . "\xf056")
|
||||
("owm-day-902" . "\xf073")
|
||||
("owm-day-903" . "\xf076")
|
||||
("owm-day-904" . "\xf072")
|
||||
("owm-day-906" . "\xf004")
|
||||
("owm-day-957" . "\xf050")
|
||||
("owm-night-200" . "\xf02d")
|
||||
("owm-night-201" . "\xf02d")
|
||||
("owm-night-202" . "\xf02d")
|
||||
("owm-night-210" . "\xf025")
|
||||
("owm-night-211" . "\xf025")
|
||||
("owm-night-212" . "\xf025")
|
||||
("owm-night-221" . "\xf025")
|
||||
("owm-night-230" . "\xf02d")
|
||||
("owm-night-231" . "\xf02d")
|
||||
("owm-night-232" . "\xf02d")
|
||||
("owm-night-300" . "\xf02b")
|
||||
("owm-night-301" . "\xf02b")
|
||||
("owm-night-302" . "\xf028")
|
||||
("owm-night-310" . "\xf028")
|
||||
("owm-night-311" . "\xf028")
|
||||
("owm-night-312" . "\xf028")
|
||||
("owm-night-313" . "\xf028")
|
||||
("owm-night-314" . "\xf028")
|
||||
("owm-night-321" . "\xf02b")
|
||||
("owm-night-500" . "\xf02b")
|
||||
("owm-night-501" . "\xf028")
|
||||
("owm-night-502" . "\xf028")
|
||||
("owm-night-503" . "\xf028")
|
||||
("owm-night-504" . "\xf028")
|
||||
("owm-night-511" . "\xf026")
|
||||
("owm-night-520" . "\xf029")
|
||||
("owm-night-521" . "\xf029")
|
||||
("owm-night-522" . "\xf029")
|
||||
("owm-night-531" . "\xf02c")
|
||||
("owm-night-600" . "\xf02a")
|
||||
("owm-night-601" . "\xf0b4")
|
||||
("owm-night-602" . "\xf02a")
|
||||
("owm-night-611" . "\xf026")
|
||||
("owm-night-612" . "\xf026")
|
||||
("owm-night-615" . "\xf026")
|
||||
("owm-night-616" . "\xf026")
|
||||
("owm-night-620" . "\xf026")
|
||||
("owm-night-621" . "\xf02a")
|
||||
("owm-night-622" . "\xf02a")
|
||||
("owm-night-701" . "\xf029")
|
||||
("owm-night-711" . "\xf062")
|
||||
("owm-night-721" . "\xf0b6")
|
||||
("owm-night-731" . "\xf063")
|
||||
("owm-night-741" . "\xf04a")
|
||||
("owm-night-761" . "\xf063")
|
||||
("owm-night-762" . "\xf063")
|
||||
("owm-night-781" . "\xf056")
|
||||
("owm-night-800" . "\xf02e")
|
||||
("owm-night-801" . "\xf022")
|
||||
("owm-night-802" . "\xf022")
|
||||
("owm-night-803" . "\xf022")
|
||||
("owm-night-804" . "\xf086")
|
||||
("owm-night-900" . "\xf056")
|
||||
("owm-night-902" . "\xf073")
|
||||
("owm-night-903" . "\xf076")
|
||||
("owm-night-904" . "\xf072")
|
||||
("owm-night-906" . "\xf024")
|
||||
("owm-night-957" . "\xf050")
|
||||
("rain" . "\xf019")
|
||||
("rain-mix" . "\xf017")
|
||||
("rain-wind" . "\xf018")
|
||||
("raindrop" . "\xf078")
|
||||
("raindrops" . "\xf04e")
|
||||
("refresh" . "\xf04c")
|
||||
("refresh-alt" . "\xf04b")
|
||||
("sandstorm" . "\xf082")
|
||||
("showers" . "\xf01a")
|
||||
("sleet" . "\xf0b5")
|
||||
("small-craft-advisory" . "\xf0cc")
|
||||
("smog" . "\xf074")
|
||||
("smoke" . "\xf062")
|
||||
("snow" . "\xf01b")
|
||||
("snow" . "\xf01b")
|
||||
("snow-wind" . "\xf064")
|
||||
("snowflake-cold" . "\xf076")
|
||||
("solar-eclipse" . "\xf06e")
|
||||
("sprinkle" . "\xf01c")
|
||||
("stars" . "\xf077")
|
||||
("storm-showers" . "\xf01d")
|
||||
("storm-showers" . "\xf01d")
|
||||
("storm-warning" . "\xf0ce")
|
||||
("strong-wind" . "\xf050")
|
||||
("sunrise" . "\xf051")
|
||||
("sunset" . "\xf052")
|
||||
("thermometer" . "\xf055")
|
||||
("thermometer-exterior" . "\xf053")
|
||||
("thermometer-internal" . "\xf054")
|
||||
("thunderstorm" . "\xf01e")
|
||||
("thunderstorm" . "\xf01e")
|
||||
("time-1" . "\xf08a")
|
||||
("time-10" . "\xf093")
|
||||
("time-11" . "\xf094")
|
||||
("time-12" . "\xf089")
|
||||
("time-2" . "\xf08b")
|
||||
("time-3" . "\xf08c")
|
||||
("time-4" . "\xf08d")
|
||||
("time-5" . "\xf08e")
|
||||
("time-6" . "\xf08f")
|
||||
("time-7" . "\xf090")
|
||||
("time-8" . "\xf091")
|
||||
("time-9" . "\xf092")
|
||||
("tornado" . "\xf056")
|
||||
("train" . "\xf0cb")
|
||||
("tsunami" . "\xf0c5")
|
||||
("umbrella" . "\xf084")
|
||||
("volcano" . "\xf0c8")
|
||||
("wind-beaufort-0" . "\xf0b7")
|
||||
("wind-beaufort-1" . "\xf0b8")
|
||||
("wind-beaufort-10" . "\xf0c1")
|
||||
("wind-beaufort-11" . "\xf0c2")
|
||||
("wind-beaufort-12" . "\xf0c3")
|
||||
("wind-beaufort-2" . "\xf0b9")
|
||||
("wind-beaufort-3" . "\xf0ba")
|
||||
("wind-beaufort-4" . "\xf0bb")
|
||||
("wind-beaufort-5" . "\xf0bc")
|
||||
("wind-beaufort-6" . "\xf0bd")
|
||||
("wind-beaufort-7" . "\xf0be")
|
||||
("wind-beaufort-8" . "\xf0bf")
|
||||
("wind-beaufort-9" . "\xf0c0")
|
||||
("wind-direction" . "\xf0b1")
|
||||
("windy" . "\xf021")
|
||||
("wmo4680-00" . "\xf055")
|
||||
("wmo4680-01" . "\xf013")
|
||||
("wmo4680-02" . "\xf055")
|
||||
("wmo4680-03" . "\xf013")
|
||||
("wmo4680-04" . "\xf014")
|
||||
("wmo4680-05" . "\xf014")
|
||||
("wmo4680-10" . "\xf014")
|
||||
("wmo4680-11" . "\xf014")
|
||||
("wmo4680-12" . "\xf016")
|
||||
("wmo4680-18" . "\xf050")
|
||||
("wmo4680-20" . "\xf014")
|
||||
("wmo4680-21" . "\xf017")
|
||||
("wmo4680-22" . "\xf017")
|
||||
("wmo4680-23" . "\xf019")
|
||||
("wmo4680-24" . "\xf01b")
|
||||
("wmo4680-25" . "\xf015")
|
||||
("wmo4680-26" . "\xf01e")
|
||||
("wmo4680-27" . "\xf063")
|
||||
("wmo4680-28" . "\xf063")
|
||||
("wmo4680-29" . "\xf063")
|
||||
("wmo4680-30" . "\xf014")
|
||||
("wmo4680-31" . "\xf014")
|
||||
("wmo4680-32" . "\xf014")
|
||||
("wmo4680-33" . "\xf014")
|
||||
("wmo4680-34" . "\xf014")
|
||||
("wmo4680-35" . "\xf014")
|
||||
("wmo4680-40" . "\xf017")
|
||||
("wmo4680-41" . "\xf01c")
|
||||
("wmo4680-42" . "\xf019")
|
||||
("wmo4680-43" . "\xf01c")
|
||||
("wmo4680-44" . "\xf019")
|
||||
("wmo4680-45" . "\xf015")
|
||||
("wmo4680-46" . "\xf015")
|
||||
("wmo4680-47" . "\xf01b")
|
||||
("wmo4680-48" . "\xf01b")
|
||||
("wmo4680-50" . "\xf01c")
|
||||
("wmo4680-51" . "\xf01c")
|
||||
("wmo4680-52" . "\xf019")
|
||||
("wmo4680-53" . "\xf019")
|
||||
("wmo4680-54" . "\xf076")
|
||||
("wmo4680-55" . "\xf076")
|
||||
("wmo4680-56" . "\xf076")
|
||||
("wmo4680-57" . "\xf01c")
|
||||
("wmo4680-58" . "\xf019")
|
||||
("wmo4680-60" . "\xf01c")
|
||||
("wmo4680-61" . "\xf01c")
|
||||
("wmo4680-62" . "\xf019")
|
||||
("wmo4680-63" . "\xf019")
|
||||
("wmo4680-64" . "\xf015")
|
||||
("wmo4680-65" . "\xf015")
|
||||
("wmo4680-66" . "\xf015")
|
||||
("wmo4680-67" . "\xf017")
|
||||
("wmo4680-68" . "\xf017")
|
||||
("wmo4680-70" . "\xf01b")
|
||||
("wmo4680-71" . "\xf01b")
|
||||
("wmo4680-72" . "\xf01b")
|
||||
("wmo4680-73" . "\xf01b")
|
||||
("wmo4680-74" . "\xf076")
|
||||
("wmo4680-75" . "\xf076")
|
||||
("wmo4680-76" . "\xf076")
|
||||
("wmo4680-77" . "\xf01b")
|
||||
("wmo4680-78" . "\xf076")
|
||||
("wmo4680-80" . "\xf019")
|
||||
("wmo4680-81" . "\xf01c")
|
||||
("wmo4680-82" . "\xf019")
|
||||
("wmo4680-83" . "\xf019")
|
||||
("wmo4680-84" . "\xf01d")
|
||||
("wmo4680-85" . "\xf017")
|
||||
("wmo4680-86" . "\xf017")
|
||||
("wmo4680-87" . "\xf017")
|
||||
("wmo4680-89" . "\xf015")
|
||||
("wmo4680-90" . "\xf016")
|
||||
("wmo4680-91" . "\xf01d")
|
||||
("wmo4680-92" . "\xf01e")
|
||||
("wmo4680-93" . "\xf01e")
|
||||
("wmo4680-94" . "\xf016")
|
||||
("wmo4680-95" . "\xf01e")
|
||||
("wmo4680-96" . "\xf01e")
|
||||
("wmo4680-99" . "\xf056")
|
||||
("wu-chanceflurries" . "\xf064")
|
||||
("wu-chancerain" . "\xf019")
|
||||
("wu-chancesleat" . "\xf0b5")
|
||||
("wu-chancesnow" . "\xf01b")
|
||||
("wu-chancetstorms" . "\xf01e")
|
||||
("wu-clear" . "\xf00d")
|
||||
("wu-cloudy" . "\xf002")
|
||||
("wu-flurries" . "\xf064")
|
||||
("wu-hazy" . "\xf0b6")
|
||||
("wu-mostlycloudy" . "\xf002")
|
||||
("wu-mostlysunny" . "\xf00d")
|
||||
("wu-partlycloudy" . "\xf002")
|
||||
("wu-partlysunny" . "\xf00d")
|
||||
("wu-rain" . "\xf01a")
|
||||
("wu-sleat" . "\xf0b5")
|
||||
("wu-snow" . "\xf01b")
|
||||
("wu-sunny" . "\xf00d")
|
||||
("wu-tstorms" . "\xf01e")
|
||||
("wu-unknown" . "\xf00d")
|
||||
("yahoo-0" . "\xf056")
|
||||
("yahoo-1" . "\xf00e")
|
||||
("yahoo-10" . "\xf015")
|
||||
("yahoo-11" . "\xf01a")
|
||||
("yahoo-12" . "\xf01a")
|
||||
("yahoo-13" . "\xf01b")
|
||||
("yahoo-14" . "\xf00a")
|
||||
("yahoo-15" . "\xf064")
|
||||
("yahoo-16" . "\xf01b")
|
||||
("yahoo-17" . "\xf015")
|
||||
("yahoo-18" . "\xf017")
|
||||
("yahoo-19" . "\xf063")
|
||||
("yahoo-2" . "\xf073")
|
||||
("yahoo-20" . "\xf014")
|
||||
("yahoo-21" . "\xf021")
|
||||
("yahoo-22" . "\xf062")
|
||||
("yahoo-23" . "\xf050")
|
||||
("yahoo-24" . "\xf050")
|
||||
("yahoo-25" . "\xf076")
|
||||
("yahoo-26" . "\xf013")
|
||||
("yahoo-27" . "\xf031")
|
||||
("yahoo-28" . "\xf002")
|
||||
("yahoo-29" . "\xf031")
|
||||
("yahoo-3" . "\xf01e")
|
||||
("yahoo-30" . "\xf002")
|
||||
("yahoo-31" . "\xf02e")
|
||||
("yahoo-32" . "\xf00d")
|
||||
("yahoo-3200" . "\xf077")
|
||||
("yahoo-33" . "\xf083")
|
||||
("yahoo-34" . "\xf00c")
|
||||
("yahoo-35" . "\xf017")
|
||||
("yahoo-36" . "\xf072")
|
||||
("yahoo-37" . "\xf00e")
|
||||
("yahoo-38" . "\xf00e")
|
||||
("yahoo-39" . "\xf00e")
|
||||
("yahoo-4" . "\xf01e")
|
||||
("yahoo-40" . "\xf01a")
|
||||
("yahoo-41" . "\xf064")
|
||||
("yahoo-42" . "\xf01b")
|
||||
("yahoo-43" . "\xf064")
|
||||
("yahoo-44" . "\xf00c")
|
||||
("yahoo-45" . "\xf00e")
|
||||
("yahoo-46" . "\xf01b")
|
||||
("yahoo-47" . "\xf00e")
|
||||
("yahoo-5" . "\xf017")
|
||||
("yahoo-6" . "\xf017")
|
||||
("yahoo-7" . "\xf017")
|
||||
("yahoo-8" . "\xf015")
|
||||
("yahoo-9" . "\xf01a")
|
||||
|
||||
))
|
||||
|
||||
(provide 'data-weathericons)
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
|
@ -1 +0,0 @@
|
|||
Good signature from 645357D2883A0966 GNU ELPA Signing Agent (2023) <elpasign@elpa.gnu.org> (trust undefined) created at 2025-06-28T00:35:23+0330 using EDDSA
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,248 +0,0 @@
|
|||
;;; avy-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*-
|
||||
;; Generated by the `loaddefs-generate' function.
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path)))
|
||||
|
||||
|
||||
|
||||
;;; Generated autoloads from avy.el
|
||||
|
||||
(autoload 'avy-process "avy" "\
|
||||
Select one of CANDIDATES using `avy-read'.
|
||||
Use OVERLAY-FN to visualize the decision overlay.
|
||||
CLEANUP-FN should take no arguments and remove the effects of
|
||||
multiple OVERLAY-FN invocations.
|
||||
|
||||
(fn CANDIDATES &optional OVERLAY-FN CLEANUP-FN)")
|
||||
(autoload 'avy-goto-char "avy" "\
|
||||
Jump to the currently visible CHAR.
|
||||
The window scope is determined by `avy-all-windows' (ARG negates it).
|
||||
|
||||
(fn CHAR &optional ARG)" t)
|
||||
(autoload 'avy-goto-char-in-line "avy" "\
|
||||
Jump to the currently visible CHAR in the current line.
|
||||
|
||||
(fn CHAR)" t)
|
||||
(autoload 'avy-goto-char-2 "avy" "\
|
||||
Jump to the currently visible CHAR1 followed by CHAR2.
|
||||
The window scope is determined by `avy-all-windows'.
|
||||
When ARG is non-nil, do the opposite of `avy-all-windows'.
|
||||
BEG and END narrow the scope where candidates are searched.
|
||||
|
||||
(fn CHAR1 CHAR2 &optional ARG BEG END)" t)
|
||||
(autoload 'avy-goto-char-2-above "avy" "\
|
||||
Jump to the currently visible CHAR1 followed by CHAR2.
|
||||
This is a scoped version of `avy-goto-char-2', where the scope is
|
||||
the visible part of the current buffer up to point.
|
||||
The window scope is determined by `avy-all-windows'.
|
||||
When ARG is non-nil, do the opposite of `avy-all-windows'.
|
||||
|
||||
(fn CHAR1 CHAR2 &optional ARG)" t)
|
||||
(autoload 'avy-goto-char-2-below "avy" "\
|
||||
Jump to the currently visible CHAR1 followed by CHAR2.
|
||||
This is a scoped version of `avy-goto-char-2', where the scope is
|
||||
the visible part of the current buffer following point.
|
||||
The window scope is determined by `avy-all-windows'.
|
||||
When ARG is non-nil, do the opposite of `avy-all-windows'.
|
||||
|
||||
(fn CHAR1 CHAR2 &optional ARG)" t)
|
||||
(autoload 'avy-isearch "avy" "\
|
||||
Jump to one of the current isearch candidates." t)
|
||||
(autoload 'avy-goto-word-0 "avy" "\
|
||||
Jump to a word start.
|
||||
The window scope is determined by `avy-all-windows'.
|
||||
When ARG is non-nil, do the opposite of `avy-all-windows'.
|
||||
BEG and END narrow the scope where candidates are searched.
|
||||
|
||||
(fn ARG &optional BEG END)" t)
|
||||
(autoload 'avy-goto-whitespace-end "avy" "\
|
||||
Jump to the end of a whitespace sequence.
|
||||
The window scope is determined by `avy-all-windows'.
|
||||
When ARG is non-nil, do the opposite of `avy-all-windows'.
|
||||
BEG and END narrow the scope where candidates are searched.
|
||||
|
||||
(fn ARG &optional BEG END)" t)
|
||||
(autoload 'avy-goto-word-1 "avy" "\
|
||||
Jump to the currently visible CHAR at a word start.
|
||||
The window scope is determined by `avy-all-windows'.
|
||||
When ARG is non-nil, do the opposite of `avy-all-windows'.
|
||||
BEG and END narrow the scope where candidates are searched.
|
||||
When SYMBOL is non-nil, jump to symbol start instead of word start.
|
||||
|
||||
(fn CHAR &optional ARG BEG END SYMBOL)" t)
|
||||
(autoload 'avy-goto-word-1-above "avy" "\
|
||||
Jump to the currently visible CHAR at a word start.
|
||||
This is a scoped version of `avy-goto-word-1', where the scope is
|
||||
the visible part of the current buffer up to point.
|
||||
The window scope is determined by `avy-all-windows'.
|
||||
When ARG is non-nil, do the opposite of `avy-all-windows'.
|
||||
|
||||
(fn CHAR &optional ARG)" t)
|
||||
(autoload 'avy-goto-word-1-below "avy" "\
|
||||
Jump to the currently visible CHAR at a word start.
|
||||
This is a scoped version of `avy-goto-word-1', where the scope is
|
||||
the visible part of the current buffer following point.
|
||||
The window scope is determined by `avy-all-windows'.
|
||||
When ARG is non-nil, do the opposite of `avy-all-windows'.
|
||||
|
||||
(fn CHAR &optional ARG)" t)
|
||||
(autoload 'avy-goto-symbol-1 "avy" "\
|
||||
Jump to the currently visible CHAR at a symbol start.
|
||||
The window scope is determined by `avy-all-windows'.
|
||||
When ARG is non-nil, do the opposite of `avy-all-windows'.
|
||||
|
||||
(fn CHAR &optional ARG)" t)
|
||||
(autoload 'avy-goto-symbol-1-above "avy" "\
|
||||
Jump to the currently visible CHAR at a symbol start.
|
||||
This is a scoped version of `avy-goto-symbol-1', where the scope is
|
||||
the visible part of the current buffer up to point.
|
||||
The window scope is determined by `avy-all-windows'.
|
||||
When ARG is non-nil, do the opposite of `avy-all-windows'.
|
||||
|
||||
(fn CHAR &optional ARG)" t)
|
||||
(autoload 'avy-goto-symbol-1-below "avy" "\
|
||||
Jump to the currently visible CHAR at a symbol start.
|
||||
This is a scoped version of `avy-goto-symbol-1', where the scope is
|
||||
the visible part of the current buffer following point.
|
||||
The window scope is determined by `avy-all-windows'.
|
||||
When ARG is non-nil, do the opposite of `avy-all-windows'.
|
||||
|
||||
(fn CHAR &optional ARG)" t)
|
||||
(autoload 'avy-goto-subword-0 "avy" "\
|
||||
Jump to a word or subword start.
|
||||
The window scope is determined by `avy-all-windows' (ARG negates it).
|
||||
|
||||
When PREDICATE is non-nil it's a function of zero parameters that
|
||||
should return true.
|
||||
|
||||
BEG and END narrow the scope where candidates are searched.
|
||||
|
||||
(fn &optional ARG PREDICATE BEG END)" t)
|
||||
(autoload 'avy-goto-subword-1 "avy" "\
|
||||
Jump to the currently visible CHAR at a subword start.
|
||||
The window scope is determined by `avy-all-windows' (ARG negates it).
|
||||
The case of CHAR is ignored.
|
||||
|
||||
(fn CHAR &optional ARG)" t)
|
||||
(autoload 'avy-goto-word-or-subword-1 "avy" "\
|
||||
Forward to `avy-goto-subword-1' or `avy-goto-word-1'.
|
||||
Which one depends on variable `subword-mode'." t)
|
||||
(autoload 'avy-goto-line "avy" "\
|
||||
Jump to a line start in current buffer.
|
||||
|
||||
When ARG is 1, jump to lines currently visible, with the option
|
||||
to cancel to `goto-line' by entering a number.
|
||||
|
||||
When ARG is 4, negate the window scope determined by
|
||||
`avy-all-windows'.
|
||||
|
||||
Otherwise, forward to `goto-line' with ARG.
|
||||
|
||||
(fn &optional ARG)" t)
|
||||
(autoload 'avy-goto-line-above "avy" "\
|
||||
Goto visible line above the cursor.
|
||||
OFFSET changes the distance between the closest key to the cursor and
|
||||
the cursor
|
||||
When BOTTOM-UP is non-nil, display avy candidates from top to bottom
|
||||
|
||||
(fn &optional OFFSET BOTTOM-UP)" t)
|
||||
(autoload 'avy-goto-line-below "avy" "\
|
||||
Goto visible line below the cursor.
|
||||
OFFSET changes the distance between the closest key to the cursor and
|
||||
the cursor
|
||||
When BOTTOM-UP is non-nil, display avy candidates from top to bottom
|
||||
|
||||
(fn &optional OFFSET BOTTOM-UP)" t)
|
||||
(autoload 'avy-goto-end-of-line "avy" "\
|
||||
Call `avy-goto-line' and move to the end of the line.
|
||||
|
||||
(fn &optional ARG)" t)
|
||||
(autoload 'avy-copy-line "avy" "\
|
||||
Copy a selected line above the current line.
|
||||
ARG lines can be used.
|
||||
|
||||
(fn ARG)" t)
|
||||
(autoload 'avy-move-line "avy" "\
|
||||
Move a selected line above the current line.
|
||||
ARG lines can be used.
|
||||
|
||||
(fn ARG)" t)
|
||||
(autoload 'avy-copy-region "avy" "\
|
||||
Select two lines and copy the text between them to point.
|
||||
|
||||
The window scope is determined by `avy-all-windows' or
|
||||
`avy-all-windows-alt' when ARG is non-nil.
|
||||
|
||||
(fn ARG)" t)
|
||||
(autoload 'avy-move-region "avy" "\
|
||||
Select two lines and move the text between them above the current line." t)
|
||||
(autoload 'avy-kill-region "avy" "\
|
||||
Select two lines and kill the region between them.
|
||||
|
||||
The window scope is determined by `avy-all-windows' or
|
||||
`avy-all-windows-alt' when ARG is non-nil.
|
||||
|
||||
(fn ARG)" t)
|
||||
(autoload 'avy-kill-ring-save-region "avy" "\
|
||||
Select two lines and save the region between them to the kill ring.
|
||||
The window scope is determined by `avy-all-windows'.
|
||||
When ARG is non-nil, do the opposite of `avy-all-windows'.
|
||||
|
||||
(fn ARG)" t)
|
||||
(autoload 'avy-kill-whole-line "avy" "\
|
||||
Select line and kill the whole selected line.
|
||||
|
||||
With a numerical prefix ARG, kill ARG line(s) starting from the
|
||||
selected line. If ARG is negative, kill backward.
|
||||
|
||||
If ARG is zero, kill the selected line but exclude the trailing
|
||||
newline.
|
||||
|
||||
\\[universal-argument] 3 \\[avy-kil-whole-line] kill three lines
|
||||
starting from the selected line. \\[universal-argument] -3
|
||||
|
||||
\\[avy-kill-whole-line] kill three lines backward including the
|
||||
selected line.
|
||||
|
||||
(fn ARG)" t)
|
||||
(autoload 'avy-kill-ring-save-whole-line "avy" "\
|
||||
Select line and save the whole selected line as if killed, but don’t kill it.
|
||||
|
||||
This command is similar to `avy-kill-whole-line', except that it
|
||||
saves the line(s) as if killed, but does not kill it(them).
|
||||
|
||||
With a numerical prefix ARG, kill ARG line(s) starting from the
|
||||
selected line. If ARG is negative, kill backward.
|
||||
|
||||
If ARG is zero, kill the selected line but exclude the trailing
|
||||
newline.
|
||||
|
||||
(fn ARG)" t)
|
||||
(autoload 'avy-setup-default "avy" "\
|
||||
Setup the default shortcuts.")
|
||||
(autoload 'avy-goto-char-timer "avy" "\
|
||||
Read one or many consecutive chars and jump to the first one.
|
||||
The window scope is determined by `avy-all-windows' (ARG negates it).
|
||||
|
||||
(fn &optional ARG)" t)
|
||||
(autoload 'avy-transpose-lines-in-region "avy" "\
|
||||
Transpose lines in the active region." t)
|
||||
(register-definition-prefixes "avy" '("avy-"))
|
||||
|
||||
;;; End of scraped data
|
||||
|
||||
(provide 'avy-autoloads)
|
||||
|
||||
;; Local Variables:
|
||||
;; version-control: never
|
||||
;; no-byte-compile: t
|
||||
;; no-update-autoloads: t
|
||||
;; no-native-compile: t
|
||||
;; coding: utf-8-emacs-unix
|
||||
;; End:
|
||||
|
||||
;;; avy-autoloads.el ends here
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
;; -*- no-byte-compile: t; lexical-binding: nil -*-
|
||||
(define-package "avy" "20241101.1357"
|
||||
"Jump to arbitrary positions in visible text and select text quickly."
|
||||
'((emacs "24.1")
|
||||
(cl-lib "0.5"))
|
||||
:url "https://github.com/abo-abo/avy"
|
||||
:commit "933d1f36cca0f71e4acb5fac707e9ae26c536264"
|
||||
:revdesc "933d1f36cca0"
|
||||
:keywords '("point" "location")
|
||||
:authors '(("Oleh Krehel" . "ohwoeowho@gmail.com"))
|
||||
:maintainers '(("Oleh Krehel" . "ohwoeowho@gmail.com")))
|
||||
File diff suppressed because it is too large
Load diff
Binary file not shown.
|
|
@ -1,63 +0,0 @@
|
|||
;;; bui-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*-
|
||||
;; Generated by the `loaddefs-generate' function.
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path)))
|
||||
|
||||
|
||||
|
||||
;;; Generated autoloads from bui.el
|
||||
|
||||
(register-definition-prefixes "bui" '("bui-define-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from bui-button.el
|
||||
|
||||
(register-definition-prefixes "bui-button" '("bui"))
|
||||
|
||||
|
||||
;;; Generated autoloads from bui-core.el
|
||||
|
||||
(register-definition-prefixes "bui-core" '("bui-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from bui-entry.el
|
||||
|
||||
(register-definition-prefixes "bui-entry" '("bui-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from bui-history.el
|
||||
|
||||
(register-definition-prefixes "bui-history" '("bui-history"))
|
||||
|
||||
|
||||
;;; Generated autoloads from bui-info.el
|
||||
|
||||
(register-definition-prefixes "bui-info" '("bui-info-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from bui-list.el
|
||||
|
||||
(register-definition-prefixes "bui-list" '("bui-list-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from bui-utils.el
|
||||
|
||||
(register-definition-prefixes "bui-utils" '("bui-"))
|
||||
|
||||
;;; End of scraped data
|
||||
|
||||
(provide 'bui-autoloads)
|
||||
|
||||
;; Local Variables:
|
||||
;; version-control: never
|
||||
;; no-byte-compile: t
|
||||
;; no-update-autoloads: t
|
||||
;; no-native-compile: t
|
||||
;; coding: utf-8-emacs-unix
|
||||
;; End:
|
||||
|
||||
;;; bui-autoloads.el ends here
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
;;; bui-button.el --- Text buttons and faces -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright © 2014-2016 Alex Kost <alezost@gmail.com>
|
||||
|
||||
;; 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This file provides general faces and some code to display buttons and
|
||||
;; to work with them.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'cus-edit) ; for faces
|
||||
(require 'dash)
|
||||
(require 'bui-utils)
|
||||
|
||||
(defface bui-time
|
||||
'((t :inherit font-lock-constant-face))
|
||||
"Face used for timestamps."
|
||||
:group 'bui-faces)
|
||||
|
||||
(defface bui-file-name
|
||||
'((t :inherit link))
|
||||
"Face used for file name buttons."
|
||||
:group 'bui-faces)
|
||||
|
||||
(defface bui-url
|
||||
'((t :inherit link))
|
||||
"Face used for URL buttons."
|
||||
:group 'bui-faces)
|
||||
|
||||
(defface bui-action-button
|
||||
'((t :inherit custom-button))
|
||||
"Face used for action buttons."
|
||||
:group 'bui-faces)
|
||||
|
||||
(defface bui-action-button-mouse
|
||||
'((t :inherit custom-button-mouse))
|
||||
"Mouse face used for action buttons."
|
||||
:group 'bui-faces)
|
||||
|
||||
(defvar bui-button-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent map button-map)
|
||||
(define-key map (kbd "c") 'bui-button-copy-label)
|
||||
map)
|
||||
"Keymap for BUI buttons.")
|
||||
|
||||
(define-button-type 'bui
|
||||
'keymap bui-button-map
|
||||
'follow-link t)
|
||||
|
||||
(define-button-type 'bui-action
|
||||
:supertype 'bui
|
||||
'face 'bui-action-button
|
||||
'mouse-face 'bui-action-button-mouse)
|
||||
|
||||
(define-button-type 'bui-file
|
||||
:supertype 'bui
|
||||
'face 'bui-file-name
|
||||
'help-echo "Find file"
|
||||
'action (lambda (btn)
|
||||
(bui-find-file (or (button-get btn 'file)
|
||||
(button-label btn)))))
|
||||
|
||||
(define-button-type 'bui-url
|
||||
:supertype 'bui
|
||||
'face 'bui-url
|
||||
'help-echo "Browse URL"
|
||||
'action (lambda (btn)
|
||||
(browse-url (or (button-get btn 'url)
|
||||
(button-label btn)))))
|
||||
|
||||
(defun bui-button-copy-label (&optional position)
|
||||
"Copy a label of the button at POSITION into kill ring.
|
||||
If POSITION is nil, use the current point position."
|
||||
(interactive)
|
||||
(--when-let (button-at (or position (point)))
|
||||
(bui-copy-as-kill (button-label it))))
|
||||
|
||||
(defun bui-button-type? (symbol)
|
||||
"Return non-nil, if SYMBOL is a button type."
|
||||
(and symbol
|
||||
(get symbol 'button-category-symbol)))
|
||||
|
||||
(defun bui-insert-button (label &optional type &rest properties)
|
||||
"Make button of TYPE with LABEL and insert it at point.
|
||||
See `insert-text-button' for the meaning of PROPERTIES."
|
||||
(apply #'insert-text-button label
|
||||
:type (or type 'button)
|
||||
properties))
|
||||
|
||||
(defun bui-insert-action-button (label action &optional message
|
||||
&rest properties)
|
||||
"Make action button with LABEL and insert it at point.
|
||||
ACTION is a function called when the button is pressed. It
|
||||
should accept button as the argument.
|
||||
MESSAGE is a button message.
|
||||
See `insert-text-button' for the meaning of PROPERTIES."
|
||||
(apply #'bui-insert-button
|
||||
label 'bui-action
|
||||
'action action
|
||||
'help-echo message
|
||||
properties))
|
||||
|
||||
(defun bui-buttonize (value button-type separator &rest properties)
|
||||
"Make BUTTON-TYPE button(s) from VALUE.
|
||||
Return a string with button(s).
|
||||
|
||||
VALUE can be nil, a button name (string or symbol) or a list of
|
||||
button names. If it is a list, buttons are separated with
|
||||
SEPARATOR string.
|
||||
|
||||
PROPERTIES are passed to `bui-insert-button'."
|
||||
(bui-get-non-nil value
|
||||
(with-temp-buffer
|
||||
(let ((labels (if (listp value) value (list value))))
|
||||
(bui-mapinsert (lambda (label)
|
||||
(apply #'bui-insert-button
|
||||
(if (symbolp label)
|
||||
(symbol-name label)
|
||||
label)
|
||||
button-type properties))
|
||||
labels
|
||||
separator))
|
||||
(buffer-substring (point-min) (point-max)))))
|
||||
|
||||
(provide 'bui-button)
|
||||
|
||||
;;; bui-button.el ends here
|
||||
Binary file not shown.
|
|
@ -1,767 +0,0 @@
|
|||
;;; bui-core.el --- Core functionality for BUI -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright © 2014–2017, 2021 Alex Kost <alezost@gmail.com>
|
||||
;; Copyright © 2020 Joe Bloggs <vapniks@yahoo.com>
|
||||
|
||||
;; 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This file provides the code that is used by both `list' and `info'
|
||||
;; interfaces, and the code to display defined interfaces.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'cl-lib)
|
||||
(require 'dash)
|
||||
(require 'bui-history)
|
||||
(require 'bui-utils)
|
||||
|
||||
(bui-define-groups bui
|
||||
:parent-group tools
|
||||
:parent-faces-group faces
|
||||
:group-doc "Settings for Buffer User Interface.")
|
||||
|
||||
(defvar bui-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(define-key map (kbd "C-c C-b") 'bui-history-back)
|
||||
(define-key map (kbd "C-c C-f") 'bui-history-forward)
|
||||
(define-key map (kbd "l") 'bui-history-back)
|
||||
(define-key map (kbd "r") 'bui-history-forward)
|
||||
(define-key map (kbd "g") 'revert-buffer)
|
||||
(define-key map (kbd "R") 'bui-redisplay)
|
||||
(define-key map (kbd "f") 'bui-filter-map)
|
||||
(define-key map (kbd "h") 'bui-show-hint)
|
||||
(define-key map [remap self-insert-command] 'bui-show-hint)
|
||||
map)
|
||||
"Parent keymap for all BUI modes.")
|
||||
|
||||
(defvar bui-history-hint
|
||||
'("History: "
|
||||
("\\[bui-history-back]") " go back, "
|
||||
("\\[bui-history-forward]") " go forward;\n")
|
||||
"Hint with history keys.
|
||||
See `bui-hint' for details.")
|
||||
|
||||
(defvar bui-common-hint
|
||||
'(("\\[revert-buffer]") " revert (update) buffer;\n"
|
||||
("\\[bui-show-hint]") " show this hint; "
|
||||
("\\[describe-mode]") " show full help.")
|
||||
"Hint with keys common for any buffer type.
|
||||
See `bui-hint' for details.")
|
||||
|
||||
|
||||
;;; Buffer item
|
||||
|
||||
(cl-defstruct (bui-item
|
||||
(:constructor nil)
|
||||
(:constructor bui-make-item
|
||||
(entries entry-type buffer-type args))
|
||||
(:copier nil))
|
||||
entries entry-type buffer-type args)
|
||||
|
||||
(defvar-local bui-item nil
|
||||
"Data (structure) for the current BUI buffer.
|
||||
The structure consists of the following elements:
|
||||
|
||||
- `entries': list of the currently displayed entries.
|
||||
|
||||
Each element of the list is an alist with an entry data of the
|
||||
following form:
|
||||
|
||||
((PARAM . VAL) ...)
|
||||
|
||||
PARAM is a name of the entry parameter.
|
||||
VAL is a value of this parameter.
|
||||
|
||||
- `entry-type': type of the currently displayed entries.
|
||||
|
||||
- `buffer-type': type of the current buffer.
|
||||
|
||||
- `args': arguments used to get the current entries.")
|
||||
(put 'bui-item 'permanent-local t)
|
||||
|
||||
(defmacro bui-with-item (item &rest body)
|
||||
"Evaluate BODY using buffer ITEM.
|
||||
The following local variables are available inside BODY:
|
||||
`%entries', `%buffer-type', `%entry-type', `%args'.
|
||||
See `bui-item' for details."
|
||||
(declare (indent 1) (debug t))
|
||||
(let ((item-var (make-symbol "item")))
|
||||
`(let ((,item-var ,item))
|
||||
(let ((%entries (bui-item-entries ,item-var))
|
||||
(%entry-type (bui-item-entry-type ,item-var))
|
||||
(%buffer-type (bui-item-buffer-type ,item-var))
|
||||
(%args (bui-item-args ,item-var)))
|
||||
,@body))))
|
||||
|
||||
(defmacro bui-with-current-item (&rest body)
|
||||
"Evaluate BODY using `bui-item'.
|
||||
See `bui-with-item' for details."
|
||||
(declare (indent 0) (debug t))
|
||||
`(bui-with-item bui-item
|
||||
,@body))
|
||||
|
||||
(defmacro bui-define-current-item-accessor (name)
|
||||
"Define `bui-current-NAME' function to access NAME
|
||||
element of `bui-item' structure.
|
||||
NAME should be a symbol."
|
||||
(let* ((name-str (symbol-name name))
|
||||
(accessor (intern (concat "bui-item-" name-str)))
|
||||
(fun-name (intern (concat "bui-current-" name-str)))
|
||||
(doc (format "\
|
||||
Return '%s' of the current BUI buffer.
|
||||
See `bui-item' for details."
|
||||
name-str)))
|
||||
`(defun ,fun-name ()
|
||||
,doc
|
||||
(and bui-item
|
||||
(,accessor bui-item)))))
|
||||
|
||||
(defmacro bui-define-current-item-accessors (&rest names)
|
||||
"Define `bui-current-NAME' functions for NAMES.
|
||||
See `bui-define-current-item-accessor' for details."
|
||||
`(progn
|
||||
,@(mapcar (lambda (name)
|
||||
`(bui-define-current-item-accessor ,name))
|
||||
names)))
|
||||
|
||||
(bui-define-current-item-accessors
|
||||
entries entry-type buffer-type args)
|
||||
|
||||
(defmacro bui-define-current-args-accessor (n prefix name)
|
||||
"Define `PREFIX-NAME' function to access Nth element of 'args'
|
||||
field of `bui-item' structure.
|
||||
PREFIX and NAME should be symbols."
|
||||
(let* ((prefix-str (symbol-name prefix))
|
||||
(name-str (symbol-name name))
|
||||
(fun-name (intern (concat prefix-str "-" name-str)))
|
||||
(doc (format "\
|
||||
Return '%s' of the current buffer.
|
||||
'%s' is the element number %d in 'args' field of `bui-item'."
|
||||
name-str name-str n)))
|
||||
`(defun ,fun-name ()
|
||||
,doc
|
||||
(nth ,n (bui-current-args)))))
|
||||
|
||||
(defmacro bui-define-current-args-accessors (prefix &rest names)
|
||||
"Define `PREFIX-NAME' functions for NAMES.
|
||||
See `bui-define-current-args-accessor' for details."
|
||||
(declare (indent 1))
|
||||
`(progn
|
||||
,@(cl-loop for name in names
|
||||
for i from 0
|
||||
collect `(bui-define-current-args-accessor
|
||||
,i ,prefix ,name))))
|
||||
|
||||
|
||||
;;; Filtering
|
||||
|
||||
(defvar bui-filter-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(define-key map (kbd "f") 'bui-enable-filter)
|
||||
(define-key map (kbd "d") 'bui-disable-filters)
|
||||
map)
|
||||
"Keymap with filter commands for BUI modes.")
|
||||
(fset 'bui-filter-map bui-filter-map)
|
||||
|
||||
(defvar bui-filter-hint
|
||||
'(("\\[bui-enable-filter]") " enable filter; "
|
||||
("\\[bui-disable-filters]") " disable filters;\n")
|
||||
"Hint with the default keys for filtering.
|
||||
See `bui-hint' for details.")
|
||||
|
||||
(defcustom bui-filter-predicates
|
||||
'(bui-filter-by-regexp bui-filter-by-sexp)
|
||||
"List of available filter predicates.
|
||||
These predicates are used as completions for
|
||||
'\\[bui-enable-filter]' command to hide entries. See
|
||||
`bui-active-filter-predicates' for details."
|
||||
:type '(repeat function)
|
||||
:group 'bui)
|
||||
(put 'bui-filter-predicates 'permanent-local t)
|
||||
|
||||
(defcustom bui-filter-mode-line-string "(f)"
|
||||
"String displayed in the mode line when filters are enabled.
|
||||
Set it to nil, if you don't want to display such a string."
|
||||
:type '(choice string (const nil))
|
||||
:group 'bui)
|
||||
|
||||
(defvar-local bui-active-filter-predicates nil
|
||||
"List of the active filter predicates.
|
||||
These predicates are used to hide unneeded entries from the
|
||||
current buffer. Each buffer entry is passed (as a single
|
||||
argument) through these predicates in turn. If a predicate
|
||||
returns nil, the entry will be hidden (the rest predicates are
|
||||
not called), otherwise the entry \"survives\" this predicate and
|
||||
it is passed to the next one, and so on.")
|
||||
(put 'bui-active-filter-predicates 'permanent-local t)
|
||||
|
||||
(defun bui-filter-current-entries (&rest predicates)
|
||||
"Filter the current entries using PREDICATES, and redisplay them.
|
||||
If PREDICATES are not specified, display all entries."
|
||||
(setq bui-active-filter-predicates predicates)
|
||||
(bui-show-entries (bui-current-entries)
|
||||
(bui-current-entry-type)
|
||||
(bui-current-buffer-type)))
|
||||
|
||||
(defun bui-filter-by-regexp (entry param regexp)
|
||||
"Filter the current entries by regexp.
|
||||
Return non-nil, if ENTRY's parameter PARAM matches REGEXP.
|
||||
Interactively, prompt for PARAM and REGEXP."
|
||||
(interactive
|
||||
(list '<>
|
||||
(intern
|
||||
(completing-read "Parameter: "
|
||||
(mapcar #'symbol-name (bui-current-params))))
|
||||
(read-regexp "Regexp: ")))
|
||||
(string-match-p regexp
|
||||
(bui-get-string (bui-assq-value entry param))))
|
||||
|
||||
(defun bui-filter-by-sexp (entry sexp)
|
||||
"Filter the current entries using sexp.
|
||||
Evaluate SEXP and return its value.
|
||||
SEXP can use the ENTRY's parameters as symbols, e.g.:
|
||||
|
||||
'(or (string-match-p \"foo\" name)
|
||||
(string-match-p \"bar\" synopsis))
|
||||
"
|
||||
(interactive (list '<> (read--expression "sexp: ")))
|
||||
(dolist (param (bui-current-params))
|
||||
(setq sexp (cl-subst (bui-assq-value entry param)
|
||||
param sexp)))
|
||||
(eval sexp))
|
||||
|
||||
(defun bui-enable-filter (predicate &optional single?)
|
||||
"Apply filter PREDICATE to the current entries.
|
||||
Interactively, prompt for PREDICATE, choosing candidates from the
|
||||
available predicates.
|
||||
|
||||
If SINGLE? is non-nil (with prefix argument), make PREDICATE the
|
||||
only active one (remove the other active predicates)."
|
||||
(interactive
|
||||
(let ((predicates bui-filter-predicates))
|
||||
(if (null predicates)
|
||||
(error "Filter predicates are not specified, see '%S' variable"
|
||||
(bui-entry-symbol (bui-current-entry-type)
|
||||
'filter-predicates))
|
||||
(list (intern (completing-read
|
||||
(if current-prefix-arg
|
||||
"Enable single filter: "
|
||||
"Add filter: ")
|
||||
predicates))
|
||||
current-prefix-arg))))
|
||||
(or (functionp predicate)
|
||||
(error "Wrong filter predicate: %S" predicate))
|
||||
(setq predicate (bui-apply-interactive predicate))
|
||||
(if (if single?
|
||||
(equal (list predicate) bui-active-filter-predicates)
|
||||
(memq predicate bui-active-filter-predicates))
|
||||
(message "Filter predicate '%S' already enabled" predicate)
|
||||
(apply #'bui-filter-current-entries
|
||||
(if single?
|
||||
(list predicate)
|
||||
(cons predicate bui-active-filter-predicates)))))
|
||||
|
||||
(defun bui-disable-filters ()
|
||||
"Disable all active filters."
|
||||
(interactive)
|
||||
(if (null bui-active-filter-predicates)
|
||||
(message "There are no active filters.")
|
||||
(bui-filter-current-entries)))
|
||||
|
||||
|
||||
;;; Hints
|
||||
|
||||
(defface bui-hint-key
|
||||
'((t :inherit font-lock-warning-face))
|
||||
"Face used by `bui-show-hint' to display keys."
|
||||
:group 'bui-faces)
|
||||
|
||||
(defcustom bui-hint-format "[%s]"
|
||||
"String used to format each key in `bui-hint'.
|
||||
This string should contain a single '%s' structure that will be
|
||||
replaced by a key string."
|
||||
:type 'string
|
||||
:group 'bui)
|
||||
|
||||
(defvar bui-hint-key-separator ", "
|
||||
"String used to separate keys in `bui-hint'.")
|
||||
|
||||
(defvar bui-hint #'bui-default-hint
|
||||
"Hint displayed in the echo area by \\[bui-show-hint].
|
||||
|
||||
It can be either a string, a list, or a function returning one of
|
||||
those.
|
||||
|
||||
If it is a list, its elements should have one of the following
|
||||
forms:
|
||||
|
||||
STRING
|
||||
(KEY-STRING ...)
|
||||
|
||||
STRING elements are displayed as is.
|
||||
|
||||
KEY-STRING elements are highlighted with `bui-hint-key' face and
|
||||
are separated with `bui-hint-key-separator'. Also these strings
|
||||
are passed through `substitute-command-keys', so you can use any
|
||||
supported structure.
|
||||
|
||||
Example of a possible value:
|
||||
|
||||
(\"Press:\\n\" (\"a\" \"b\") \" to do something;\\n\")")
|
||||
(put 'bui-hint 'permanent-local t)
|
||||
|
||||
(defun bui-format-hint-keys (key-strings)
|
||||
"Concatenate and highlight KEY-STRINGS.
|
||||
See `bui-hint' for details."
|
||||
(mapconcat (lambda (key)
|
||||
(format bui-hint-format
|
||||
(propertize (substitute-command-keys key)
|
||||
'face 'bui-hint-key)))
|
||||
key-strings
|
||||
bui-hint-key-separator))
|
||||
|
||||
(defun bui-format-hint (hint)
|
||||
"Return string from HINT that has `bui-hint' form."
|
||||
(pcase hint
|
||||
((pred null) "")
|
||||
((pred stringp) hint)
|
||||
((pred functionp) (funcall hint))
|
||||
((pred listp)
|
||||
(mapconcat (lambda (list-or-string)
|
||||
(if (listp list-or-string)
|
||||
(bui-format-hint-keys list-or-string)
|
||||
list-or-string))
|
||||
hint ""))
|
||||
(_ (error "Unknown hint type: %S" hint))))
|
||||
|
||||
(defun bui-format-hints (&rest hints)
|
||||
"Call `bui-format-hint' on all HINTS and concatenate results."
|
||||
(mapconcat #'bui-format-hint hints ""))
|
||||
|
||||
(defun bui-default-hint ()
|
||||
"Return default hint structure for the current buffer."
|
||||
(let* ((buffer-type-hint-fun (bui-make-symbol
|
||||
'bui (bui-current-buffer-type) 'hint))
|
||||
(buffer-type-hint (and (fboundp buffer-type-hint-fun)
|
||||
(funcall buffer-type-hint-fun))))
|
||||
(apply #'bui-format-hints
|
||||
(delq nil
|
||||
(list buffer-type-hint
|
||||
(and bui-filter-predicates
|
||||
bui-filter-hint)
|
||||
bui-history-hint
|
||||
bui-common-hint)))))
|
||||
|
||||
(defun bui-show-hint ()
|
||||
"Show `bui-hint' in the echo area."
|
||||
(interactive)
|
||||
(message (bui-format-hint bui-hint)))
|
||||
|
||||
|
||||
;;; General variables
|
||||
|
||||
(defcustom bui-titles nil
|
||||
"Alist of titles of parameters."
|
||||
:type '(alist :key-type symbol :value-type string)
|
||||
:group 'bui)
|
||||
(put 'bui-titles 'permanent-local t)
|
||||
|
||||
(defvar bui-boolean-params nil
|
||||
"List of boolean parameters.
|
||||
These parameters are displayed using `bui-false-string' for
|
||||
nil values (unlike usual parameters which are displayed using
|
||||
`bui-empty-string').")
|
||||
(put 'bui-boolean-params 'permanent-local t)
|
||||
|
||||
(defvar bui-get-entries-function nil
|
||||
"Function used to receive entries.")
|
||||
(put 'bui-get-entries-function 'permanent-local t)
|
||||
|
||||
(defvar bui-show-entries-function nil
|
||||
"Function used to show entries.
|
||||
This function is called with a list of entries as a single
|
||||
argument. If nil, `bui-show-entries-default' is called with
|
||||
appropriate ENTRY-TYPE and BUFFER-TYPE.")
|
||||
(put 'bui-show-entries-function 'permanent-local t)
|
||||
|
||||
(defvar bui-mode-initialize-function nil
|
||||
"Function used to set up the current BUI buffer.
|
||||
This function is called without arguments after enabling the
|
||||
mode (right before running mode hooks).
|
||||
It can also be nil.")
|
||||
(put 'bui-mode-initialize-function 'permanent-local t)
|
||||
|
||||
(defvar bui-message-function nil
|
||||
"Function used to display a message after showing entries.
|
||||
If nil, do not display messages.")
|
||||
(put 'bui-message-function 'permanent-local t)
|
||||
|
||||
(defcustom bui-buffer-name nil
|
||||
"Default name of a buffer for displaying entries.
|
||||
May be nil, a string or a function returning a string. The
|
||||
function is called with the same arguments as the function used
|
||||
to get entries. If nil, the name is defined automatically."
|
||||
:type '(choice string function (const nil))
|
||||
:group 'bui)
|
||||
(put 'bui-buffer-name 'permanent-local t)
|
||||
|
||||
(defcustom bui-revert-confirm t
|
||||
"If non-nil, ask to confirm for reverting the buffer."
|
||||
:type 'boolean
|
||||
:group 'bui)
|
||||
(put 'bui-revert-confirm 'permanent-local t)
|
||||
|
||||
|
||||
;;; Overriding variables
|
||||
|
||||
(defconst bui-entry-symbol-specifications
|
||||
'((:true-string true-string t)
|
||||
(:false-string false-string t)
|
||||
(:empty-string empty-string t)
|
||||
(:list-separator list-separator t)
|
||||
(:time-format time-format t)
|
||||
(:filter-predicates filter-predicates t)
|
||||
(:boolean-params boolean-params))
|
||||
"Specifications for generating entry variables.
|
||||
See `bui-symbol-specifications' for details.")
|
||||
|
||||
(defconst bui-symbol-specifications
|
||||
'((:get-entries-function get-entries-function)
|
||||
(:show-entries-function show-entries-function)
|
||||
(:mode-init-function mode-initialize-function)
|
||||
(:message-function message-function)
|
||||
(:buffer-name buffer-name t)
|
||||
(:titles titles always)
|
||||
(:hint hint)
|
||||
(:history-size history-size t)
|
||||
(:revert-confirm? revert-confirm t))
|
||||
"Specifications for generating interface variables.
|
||||
Each specification has the following form:
|
||||
|
||||
(KEYWORD SYMBOL-SUFFIX [GENERATE])
|
||||
|
||||
KEYWORD is what can be specified in `bui-define-interface' macro.
|
||||
|
||||
SYMBOL-SUFFIX defines the name of a generated variable (it is
|
||||
prefixed with ENTRY-TYPE-BUFFER-TYPE).
|
||||
|
||||
If GENERATE is nil, generate the variable only if a keyword/value
|
||||
pair is specified in the macro. If it is t, generate the
|
||||
variable, unless the defined interface is reduced. If it is a
|
||||
symbol `always', generate the variable even for the reduced
|
||||
interface.")
|
||||
|
||||
(defalias 'bui-symbol-specification-keyword #'cl-first
|
||||
"Return keyword from symbol specification.")
|
||||
|
||||
(defalias 'bui-symbol-specification-suffix #'cl-second
|
||||
"Return symbol suffix from symbol specification.")
|
||||
|
||||
(defalias 'bui-symbol-specification-generate #'cl-third
|
||||
"Return 'generate' value from symbol specification.")
|
||||
|
||||
(defun bui-symbol-generate? (generate &optional reduced?)
|
||||
"Return non-nil if a symbol should be generated.
|
||||
See `bui-symbol-specifications' for the meaning of GENERATE.
|
||||
If REDUCED? is non-nil, it means a reduced interface should be defined."
|
||||
(or (eq generate 'always)
|
||||
(and generate (not reduced?))))
|
||||
|
||||
(defun bui-map-symbol-specifications (function specifications)
|
||||
"Map through SPECIFICATIONS using FUNCTION.
|
||||
SPECIFICATIONS should have a form of `bui-symbol-specifications'."
|
||||
(mapcar (lambda (spec)
|
||||
(funcall function
|
||||
(bui-symbol-specification-keyword spec)
|
||||
(bui-symbol-specification-suffix spec)
|
||||
(bui-symbol-specification-generate spec)))
|
||||
specifications))
|
||||
|
||||
(defun bui-set-local-variable-maybe (symbol value)
|
||||
"Set SYMBOL's value to VALUE if SYMBOL is bound and VALUE is non-nil."
|
||||
(when (and value (boundp symbol))
|
||||
(set (make-local-variable symbol) value)))
|
||||
|
||||
(defun bui-set-local-variables (entry-type buffer-type)
|
||||
"Set BUI variables according to ENTRY-TYPE/BUFFER-TYPE variables."
|
||||
;; General variables.
|
||||
(dolist (suffix (mapcar #'bui-symbol-specification-suffix
|
||||
(append bui-entry-symbol-specifications
|
||||
bui-symbol-specifications)))
|
||||
(bui-set-local-variable-maybe
|
||||
(bui-make-symbol 'bui suffix)
|
||||
(bui-symbol-value entry-type buffer-type suffix)))
|
||||
;; Variables specific to BUFFER-TYPE.
|
||||
(dolist (suffix (mapcar #'bui-symbol-specification-suffix
|
||||
(symbol-value
|
||||
(bui-symbol-if-bound
|
||||
(bui-make-symbol
|
||||
'bui buffer-type 'symbol-specifications)))))
|
||||
(bui-set-local-variable-maybe
|
||||
(bui-make-symbol 'bui buffer-type suffix)
|
||||
(bui-symbol-value entry-type buffer-type suffix))))
|
||||
|
||||
|
||||
;;; Wrappers for defined variables
|
||||
|
||||
(defalias 'bui-entry-symbol #'bui-make-symbol)
|
||||
(defalias 'bui-symbol #'bui-make-symbol)
|
||||
|
||||
(defun bui-entry-symbol-value (entry-type symbol)
|
||||
"Return SYMBOL's value for ENTRY-TYPE."
|
||||
(symbol-value
|
||||
(bui-symbol-if-bound (bui-entry-symbol entry-type symbol))))
|
||||
|
||||
(defun bui-symbol-value (entry-type buffer-type symbol)
|
||||
"Return SYMBOL's value for ENTRY-TYPE/BUFFER-TYPE."
|
||||
(or (symbol-value (bui-symbol-if-bound
|
||||
(bui-symbol entry-type buffer-type symbol)))
|
||||
(bui-entry-symbol-value entry-type symbol)))
|
||||
|
||||
(defun bui-get-entries (entry-type buffer-type &optional args)
|
||||
"Return ENTRY-TYPE entries.
|
||||
Call an appropriate 'get-entries' function using ARGS as its arguments."
|
||||
(apply (bui-symbol-value entry-type buffer-type 'get-entries-function)
|
||||
args))
|
||||
|
||||
(defun bui-mode-enable (entry-type buffer-type)
|
||||
"Turn on major mode to display ENTRY-TYPE ENTRIES in BUFFER-TYPE buffer."
|
||||
(funcall (bui-symbol entry-type buffer-type 'mode)))
|
||||
|
||||
(define-obsolete-function-alias 'bui-mode-initialize-default
|
||||
'ignore "1.1.0")
|
||||
|
||||
(defun bui-mode-initialize (_entry-type _buffer-type)
|
||||
"Set up the current BUI buffer."
|
||||
(setq-local revert-buffer-function 'bui-revert)
|
||||
(when bui-mode-initialize-function
|
||||
(funcall bui-mode-initialize-function)))
|
||||
|
||||
(defun bui-insert-entries (entries entry-type buffer-type)
|
||||
"Show ENTRY-TYPE ENTRIES in the current BUFFER-TYPE buffer."
|
||||
(funcall (bui-make-symbol 'bui buffer-type 'insert-entries)
|
||||
entries entry-type))
|
||||
|
||||
(defun bui-show-entries-default (entries entry-type buffer-type)
|
||||
"Default function to show ENTRY-TYPE ENTRIES in the BUFFER-TYPE buffer."
|
||||
(let ((inhibit-read-only t))
|
||||
(erase-buffer)
|
||||
(bui-mode-enable entry-type buffer-type)
|
||||
(let ((filtered-entries (apply #'bui-filter
|
||||
entries bui-active-filter-predicates)))
|
||||
(if filtered-entries
|
||||
(bui-insert-entries filtered-entries entry-type buffer-type)
|
||||
(when entries
|
||||
(message (substitute-command-keys
|
||||
"Everything is filtered out :-)
|
||||
Use '\\[bui-disable-filters]' to remove filters")))))
|
||||
(goto-char (point-min))))
|
||||
|
||||
(defun bui-show-entries (entries entry-type buffer-type)
|
||||
"Show ENTRY-TYPE ENTRIES in the current BUFFER-TYPE buffer."
|
||||
(--if-let (bui-symbol-value entry-type buffer-type
|
||||
'show-entries-function)
|
||||
(funcall it entries)
|
||||
(bui-show-entries-default entries entry-type buffer-type)))
|
||||
|
||||
(defun bui-message (entries entry-type buffer-type &optional args)
|
||||
"Display a message for BUFFER-ITEM after showing entries."
|
||||
(--when-let (bui-symbol-value entry-type buffer-type
|
||||
'message-function)
|
||||
(apply it entries args)))
|
||||
|
||||
(defun bui-buffer-name (entry-type buffer-type &optional args)
|
||||
"Return name of BUFFER-TYPE buffer for displaying ENTRY-TYPE entries."
|
||||
(let ((val (bui-symbol-value entry-type buffer-type 'buffer-name)))
|
||||
(cond
|
||||
((stringp val)
|
||||
val)
|
||||
((functionp val)
|
||||
(apply val args))
|
||||
(t
|
||||
(concat "*"
|
||||
(capitalize (symbol-name entry-type))
|
||||
" "
|
||||
(capitalize (symbol-name buffer-type))
|
||||
"*")))))
|
||||
|
||||
(defun bui-param-title (entry-type buffer-type param)
|
||||
"Return PARAM title for ENTRY-TYPE/BUFFER-TYPE."
|
||||
(or (bui-assq-value (bui-symbol-value entry-type buffer-type 'titles)
|
||||
param)
|
||||
(bui-assq-value (bui-entry-symbol-value entry-type 'titles)
|
||||
param)
|
||||
(bui-symbol-title param)))
|
||||
|
||||
(defun bui-current-param-title (param)
|
||||
"Return PARAM title for the current ENTRY-TYPE/BUFFER-TYPE."
|
||||
(bui-param-title (bui-current-entry-type)
|
||||
(bui-current-buffer-type)
|
||||
param))
|
||||
|
||||
(defun bui-boolean-param? (entry-type buffer-type param)
|
||||
"Return non-nil if PARAM for ENTRY-TYPE/BUFFER-TYPE is boolean."
|
||||
(memq param (bui-symbol-value entry-type buffer-type 'boolean-params)))
|
||||
|
||||
(defun bui-current-params ()
|
||||
"Return parameter names of the current buffer."
|
||||
(mapcar #'car
|
||||
(bui-symbol-value (bui-current-entry-type)
|
||||
(bui-current-buffer-type)
|
||||
'format)))
|
||||
|
||||
|
||||
;;; Displaying entries
|
||||
|
||||
(defun bui-display (buffer)
|
||||
"Switch to a BUI BUFFER."
|
||||
(pop-to-buffer buffer
|
||||
'((display-buffer-reuse-window
|
||||
display-buffer-same-window))))
|
||||
|
||||
(defun bui-history-item (buffer-item)
|
||||
"Make and return a history item for displaying BUFFER-ITEM."
|
||||
(list #'bui-set buffer-item 'no))
|
||||
|
||||
(defun bui-set (buffer-item &optional history)
|
||||
"Set up the current buffer for displaying BUFFER-ITEM.
|
||||
HISTORY should be one of the following:
|
||||
|
||||
`nil' or `add' - add it to history,
|
||||
|
||||
`no' - do not save BUFFER-ITEM in history,
|
||||
|
||||
`replace' - replace the current history item."
|
||||
(bui-with-item buffer-item
|
||||
(when %entries
|
||||
;; At first, set buffer item so that its value can be used by the
|
||||
;; code for displaying entries.
|
||||
(setq bui-item buffer-item)
|
||||
(bui-set-local-variables %entry-type %buffer-type)
|
||||
;; History should be set after setting local variables (after
|
||||
;; setting `bui-history-size'), but before showing entries (before
|
||||
;; inserting history buttons).
|
||||
(unless (eq history 'no)
|
||||
(funcall (cl-ecase history
|
||||
((nil add) #'bui-history-add)
|
||||
(replace #'bui-history-replace))
|
||||
(bui-history-item buffer-item)))
|
||||
(bui-show-entries %entries %entry-type %buffer-type))
|
||||
(bui-message %entries %entry-type %buffer-type %args)))
|
||||
|
||||
(defun bui-display-entries-current (entries entry-type buffer-type
|
||||
&optional args history)
|
||||
"Show ENTRIES in the current BUI buffer.
|
||||
See `bui-item' for the meaning of BUFFER-TYPE, ENTRY-TYPE
|
||||
and ARGS, and `bui-set' for the meaning of HISTORY."
|
||||
(bui-set (bui-make-item entries entry-type buffer-type args)
|
||||
history))
|
||||
|
||||
(defun bui-get-display-entries-current (entry-type buffer-type
|
||||
&optional args history)
|
||||
"Search for entries and show them in the current BUI buffer.
|
||||
See `bui-display-entries-current' for details."
|
||||
(bui-display-entries-current
|
||||
(bui-get-entries entry-type buffer-type args)
|
||||
entry-type buffer-type args history))
|
||||
|
||||
(defun bui-display-entries (entries entry-type buffer-type
|
||||
&optional args history)
|
||||
"Show ENTRIES in a BUFFER-TYPE buffer.
|
||||
See `bui-display-entries-current' for details."
|
||||
(if entries
|
||||
(let ((buffer (get-buffer-create
|
||||
(bui-buffer-name entry-type buffer-type args))))
|
||||
(with-current-buffer buffer
|
||||
(bui-display-entries-current
|
||||
entries entry-type buffer-type args history))
|
||||
(bui-display buffer))
|
||||
(bui-message entries entry-type buffer-type args)))
|
||||
|
||||
(defun bui-get-display-entries (entry-type buffer-type
|
||||
&optional args history)
|
||||
"Search for entries and show them in a BUFFER-TYPE buffer.
|
||||
See `bui-display-entries-current' for details."
|
||||
(bui-display-entries
|
||||
(bui-get-entries entry-type buffer-type args)
|
||||
entry-type buffer-type args history))
|
||||
|
||||
(defun bui-revert (_ignore-auto noconfirm)
|
||||
"Update the data in the current BUI buffer.
|
||||
This function is suitable for `revert-buffer-function'.
|
||||
See `revert-buffer' for the meaning of NOCONFIRM."
|
||||
(bui-with-current-item
|
||||
(ignore %entries) ; to avoid compilation warning
|
||||
(when (or noconfirm
|
||||
(not bui-revert-confirm)
|
||||
(y-or-n-p "Update the current buffer? "))
|
||||
(bui-get-display-entries-current
|
||||
%entry-type %buffer-type %args 'replace))))
|
||||
|
||||
(defvar bui-after-redisplay-hook nil
|
||||
"Hook run by `bui-redisplay'.
|
||||
This hook is called before setting up a window position.")
|
||||
|
||||
(defun bui-redisplay ()
|
||||
"Redisplay the current BUI buffer.
|
||||
Restore the point and window positions after redisplaying.
|
||||
|
||||
This function does not update the buffer data, use
|
||||
'\\[revert-buffer]' if you want the full update."
|
||||
(interactive)
|
||||
(let* ((old-point (point))
|
||||
;; For simplicity, ignore an unlikely case when multiple
|
||||
;; windows display the same buffer.
|
||||
(window (car (get-buffer-window-list (current-buffer) nil t)))
|
||||
(window-start (and window (window-start window))))
|
||||
(bui-set bui-item 'no)
|
||||
(goto-char old-point)
|
||||
(run-hooks 'bui-after-redisplay-hook)
|
||||
(when window
|
||||
(set-window-point window (point))
|
||||
(set-window-start window window-start))))
|
||||
|
||||
(defun bui-redisplay-goto-button ()
|
||||
"Redisplay the current buffer and go to the next button, if needed."
|
||||
(let ((bui-after-redisplay-hook
|
||||
(cons (lambda ()
|
||||
(unless (button-at (point))
|
||||
(forward-button 1)))
|
||||
bui-after-redisplay-hook)))
|
||||
(bui-redisplay)))
|
||||
|
||||
|
||||
;; Interfaces
|
||||
|
||||
(defvar bui-interfaces nil
|
||||
"List of defined interfaces.")
|
||||
|
||||
(defalias 'bui-interface-id #'bui-make-symbol
|
||||
"Return some kind of identifier for ENTRY-TYPE/BUFFER-TYPE interface.")
|
||||
|
||||
(defun bui-interface-defined? (entry-type buffer-type)
|
||||
"Return non-nil if ENTRY-TYPE/BUFFER-TYPE interface is defined."
|
||||
(member (bui-interface-id entry-type buffer-type)
|
||||
bui-interfaces))
|
||||
|
||||
(defun bui-register-interface (entry-type buffer-type)
|
||||
"Add new ENTRY-TYPE/BUFFER-TYPE interface to `bui-interfaces'."
|
||||
(cl-pushnew (bui-interface-id entry-type buffer-type)
|
||||
bui-interfaces))
|
||||
|
||||
(provide 'bui-core)
|
||||
|
||||
;;; bui-core.el ends here
|
||||
Binary file not shown.
|
|
@ -1,77 +0,0 @@
|
|||
;;; bui-entry.el --- 'Entry' type -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright © 2015-2016 Alex Kost <alezost@gmail.com>
|
||||
|
||||
;; 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This file provides an API for 'entry' type which is just an alist of
|
||||
;; KEY/VALUE pairs (KEY should be a symbol) with the required 'id' KEY.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'dash)
|
||||
(require 'bui-utils)
|
||||
|
||||
(defvar bui-void-value 'VOID
|
||||
"Value returned by `bui-entry-value' if a parameter does not exist.")
|
||||
|
||||
(defun bui-void-value? (value)
|
||||
"Return non-nil, if VALUE is `bui-void-value'."
|
||||
(eq value bui-void-value))
|
||||
|
||||
(defun bui-entry-value (entry param)
|
||||
"Return value of the ENTRY PARAM.
|
||||
If ENTRY does not have PARAM at all, return `bui-void-value'."
|
||||
(--if-let (assq param entry)
|
||||
(cdr it)
|
||||
bui-void-value))
|
||||
|
||||
(defun bui-entry-non-void-value (entry param)
|
||||
"Like `bui-entry-value' but return nil if value is void."
|
||||
(--when-let (bui-entry-value entry param)
|
||||
(and (not (bui-void-value? it)) it)))
|
||||
|
||||
(defun bui-entry-id (entry)
|
||||
"Return ENTRY ID."
|
||||
(bui-entry-value entry 'id))
|
||||
|
||||
(defun bui-entry-by-id (entries id)
|
||||
"Return an entry from ENTRIES by its ID."
|
||||
(--find (equal (bui-entry-id it) id)
|
||||
entries))
|
||||
|
||||
(defun bui-entries-by-ids (entries ids)
|
||||
"Return entries with IDS (a list of identifiers) from ENTRIES."
|
||||
(--filter (member (bui-entry-id it) ids)
|
||||
entries))
|
||||
|
||||
(defun bui-entry-by-param (entries param value &optional compare)
|
||||
"Return an entry from ENTRIES with PARAM's value equal VALUE.
|
||||
The values are compared using COMPARE function (`equal' by default)."
|
||||
(or compare (setq compare #'equal))
|
||||
(--find (funcall compare (bui-entry-value it param) value)
|
||||
entries))
|
||||
|
||||
(defun bui-replace-entry (entries id new-entry)
|
||||
"Replace an entry with ID from ENTRIES by NEW-ENTRY.
|
||||
Return a list of entries with the replaced entry."
|
||||
(--map-first (equal id (bui-entry-id it))
|
||||
new-entry
|
||||
entries))
|
||||
|
||||
(provide 'bui-entry)
|
||||
|
||||
;;; bui-entry.el ends here
|
||||
Binary file not shown.
|
|
@ -1,154 +0,0 @@
|
|||
;;; bui-history.el --- Buffer history -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright © 2014–2017 Alex Kost <alezost@gmail.com>
|
||||
|
||||
;; 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This file provides a general support for buffer history similar to
|
||||
;; the history of a `help-mode' buffer.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'cl-lib)
|
||||
(require 'help-mode) ; for button labels
|
||||
(require 'bui-button)
|
||||
(require 'bui-utils)
|
||||
|
||||
(bui-define-groups bui-history
|
||||
:group-doc "Settings for BUI buffers history."
|
||||
:faces-group-doc "Faces for history buttons.")
|
||||
|
||||
(defvar-local bui-history-stack-item nil
|
||||
"Current item of the history.
|
||||
A list of the form (FUNCTION [ARGS ...]).
|
||||
The item is used by calling (apply FUNCTION ARGS).")
|
||||
(put 'bui-history-stack-item 'permanent-local t)
|
||||
|
||||
(defvar-local bui-history-back-stack nil
|
||||
"Stack (list) of visited items.
|
||||
Each element of the list has a form of `bui-history-stack-item'.")
|
||||
(put 'bui-history-back-stack 'permanent-local t)
|
||||
|
||||
(defvar-local bui-history-forward-stack nil
|
||||
"Stack (list) of items visited with `bui-history-back'.
|
||||
Each element of the list has a form of `bui-history-stack-item'.")
|
||||
(put 'bui-history-forward-stack 'permanent-local t)
|
||||
|
||||
(defcustom bui-history-size 16
|
||||
"Maximum number of items saved in history.
|
||||
If 0, the history is disabled.
|
||||
If nil, the history is infinite (until Emacs eats all your memory :-))."
|
||||
:type '(choice integer (const :tag "Infinite" nil))
|
||||
:group 'bui-history)
|
||||
(put 'bui-history-size 'permanent-local t)
|
||||
|
||||
(defun bui-history-add (item)
|
||||
"Add ITEM to history."
|
||||
(and bui-history-stack-item
|
||||
(push bui-history-stack-item bui-history-back-stack))
|
||||
(setq bui-history-forward-stack nil
|
||||
bui-history-stack-item item)
|
||||
(when (and bui-history-size
|
||||
(>= (length bui-history-back-stack)
|
||||
bui-history-size))
|
||||
(setq bui-history-back-stack
|
||||
(cl-loop for elt in bui-history-back-stack
|
||||
for i from 1 to bui-history-size
|
||||
collect elt))))
|
||||
|
||||
(defun bui-history-replace (item)
|
||||
"Replace current item in history with ITEM."
|
||||
(setq bui-history-stack-item item))
|
||||
|
||||
(defun bui-history-goto (item)
|
||||
"Go to the ITEM of history.
|
||||
ITEM should have the form of `bui-history-stack-item'."
|
||||
(or (listp item)
|
||||
(error "Wrong value of history element"))
|
||||
(setq bui-history-stack-item item)
|
||||
(apply (car item) (cdr item)))
|
||||
|
||||
(defun bui-history-back ()
|
||||
"Go back to the previous element of history in the current buffer."
|
||||
(interactive)
|
||||
(or bui-history-back-stack
|
||||
(user-error "No previous element in history"))
|
||||
(push bui-history-stack-item bui-history-forward-stack)
|
||||
(bui-history-goto (pop bui-history-back-stack)))
|
||||
|
||||
(defun bui-history-forward ()
|
||||
"Go forward to the next element of history in the current buffer."
|
||||
(interactive)
|
||||
(or bui-history-forward-stack
|
||||
(user-error "No next element in history"))
|
||||
(push bui-history-stack-item bui-history-back-stack)
|
||||
(bui-history-goto (pop bui-history-forward-stack)))
|
||||
|
||||
|
||||
;;; History buttons
|
||||
|
||||
(defface bui-history-button
|
||||
'((t :inherit button))
|
||||
"Face used for history buttons (back/forward)."
|
||||
:group 'bui-history-faces)
|
||||
|
||||
(defcustom bui-history-back-label help-back-label
|
||||
"Label of a button used to move backward by history."
|
||||
:type 'string
|
||||
:group 'bui-history)
|
||||
|
||||
(defcustom bui-history-forward-label help-forward-label
|
||||
"Label of a button used to move forward by history."
|
||||
:type 'string
|
||||
:group 'bui-history)
|
||||
|
||||
(define-button-type 'bui-history
|
||||
:supertype 'bui
|
||||
'face 'bui-history-button)
|
||||
|
||||
(defun bui-history-insert-button (label action &optional message
|
||||
&rest properties)
|
||||
"Insert history button with LABEL at point.
|
||||
ACTION is a function called without arguments when the button is
|
||||
pressed. MESSAGE is a button help message. See
|
||||
`insert-text-button' for the meaning of PROPERTIES."
|
||||
(apply #'bui-insert-button
|
||||
label 'bui-history
|
||||
'action (lambda (_btn) (funcall action))
|
||||
'help-echo message
|
||||
properties))
|
||||
|
||||
(defun bui-history-insert-buttons ()
|
||||
"Insert back/forward history buttons at point if needed."
|
||||
(let ((insert-back? bui-history-back-stack)
|
||||
(insert-forward? bui-history-forward-stack)
|
||||
(insert-any? (or bui-history-back-stack
|
||||
bui-history-forward-stack)))
|
||||
(when insert-any? (bui-newline))
|
||||
(when insert-back?
|
||||
(bui-history-insert-button bui-history-back-label
|
||||
#'bui-history-back
|
||||
"Go back to the previous info"))
|
||||
(when insert-forward?
|
||||
(when insert-back? (insert "\t"))
|
||||
(bui-history-insert-button bui-history-forward-label
|
||||
#'bui-history-forward
|
||||
"Go forward to the next info"))
|
||||
(when insert-any? (bui-newline))))
|
||||
|
||||
(provide 'bui-history)
|
||||
|
||||
;;; bui-history.el ends here
|
||||
Binary file not shown.
|
|
@ -1,372 +0,0 @@
|
|||
;;; bui-info.el --- 'Info' buffer interface for displaying data -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright © 2014–2017 Alex Kost <alezost@gmail.com>
|
||||
;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
|
||||
|
||||
;; 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This file provides 'info' (help-like) buffer interface for displaying
|
||||
;; an arbitrary data.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'dash)
|
||||
(require 'bui-core)
|
||||
(require 'bui-entry)
|
||||
(require 'bui-button)
|
||||
(require 'bui-utils)
|
||||
|
||||
(bui-define-groups bui-info)
|
||||
|
||||
(defface bui-info-heading
|
||||
'((((type tty pc) (class color)) :weight bold)
|
||||
(t :inherit variable-pitch :height 1.2 :weight bold))
|
||||
"Face for headings."
|
||||
:group 'bui-info-faces)
|
||||
|
||||
(defface bui-info-param-title
|
||||
'((t :inherit font-lock-type-face))
|
||||
"Face used for titles of parameters."
|
||||
:group 'bui-info-faces)
|
||||
|
||||
|
||||
;;; General 'info' variables
|
||||
|
||||
(defvar bui-info-format nil
|
||||
"List of methods for inserting entries.
|
||||
Each METHOD should be either nil, a function or a list.
|
||||
|
||||
If METHOD is nil, newline is inserted at point.
|
||||
|
||||
If METHOD is a function, it is called with an entry as argument.
|
||||
|
||||
If METHOD is a list, it should have the following form:
|
||||
|
||||
(PARAM INSERT-TITLE INSERT-VALUE)
|
||||
|
||||
PARAM is a name of the entry parameter.
|
||||
|
||||
INSERT-TITLE may be either a symbol or a list. If it is a
|
||||
symbol, it should be a function or an alias from
|
||||
`bui-info-title-aliases', in which case it is called with title
|
||||
as argument. If it is a list, it should have a
|
||||
form (FUN-OR-ALIAS [ARGS ...]), in which case FUN-OR-ALIAS is
|
||||
called with title and ARGS as arguments.
|
||||
|
||||
INSERT-VALUE may be either a symbol or a list. If it is a
|
||||
symbol, it should be a function or an alias from
|
||||
`bui-info-value-aliases', in which case it is called with value
|
||||
and entry as arguments. If it is a list, it should have a
|
||||
form (FUN-OR-ALIAS [ARGS ...]), in which case FUN-OR-ALIAS is
|
||||
called with value and ARGS as arguments.
|
||||
|
||||
After inserting title/value with such a list METHOD, a new line
|
||||
is inserted.
|
||||
|
||||
Parameters are inserted in the same order as defined by this list.")
|
||||
(put 'bui-info-format 'permanent-local t)
|
||||
|
||||
(defcustom bui-info-ignore-empty-values nil
|
||||
"If non-nil, do not display non-boolean parameters with nil values."
|
||||
:type 'boolean
|
||||
:group 'bui-info)
|
||||
(put 'bui-info-ignore-empty-values 'permanent-local t)
|
||||
|
||||
(defcustom bui-info-ignore-void-values t
|
||||
"If non-nil, do not display non-existing parameters."
|
||||
:type 'boolean
|
||||
:group 'bui-info)
|
||||
(put 'bui-info-ignore-void-values 'permanent-local t)
|
||||
|
||||
(defcustom bui-info-fill t
|
||||
"If non-nil, fill string parameters to fit the window.
|
||||
If nil, insert text parameters in a raw form."
|
||||
:type 'boolean
|
||||
:group 'bui-info)
|
||||
(put 'bui-info-fill 'permanent-local t)
|
||||
|
||||
(defcustom bui-info-param-title-format "%-18s: "
|
||||
"String used to format a title of a parameter.
|
||||
It should be a '%s'-sequence. After inserting a title formatted
|
||||
with this string, a value of the parameter is inserted.
|
||||
This string is used by `bui-info-insert-title-format'."
|
||||
:type 'string
|
||||
:group 'bui-info)
|
||||
(put 'bui-info-param-title-format 'permanent-local t)
|
||||
|
||||
(defcustom bui-info-multiline-prefix
|
||||
(make-string (length (format bui-info-param-title-format " "))
|
||||
?\s)
|
||||
"String used to format multi-line parameter values.
|
||||
If a value occupies more than one line, this string is inserted
|
||||
in the beginning of each line after the first one.
|
||||
This string is used by `bui-info-insert-value-format'."
|
||||
:type 'string
|
||||
:group 'bui-info)
|
||||
(put 'bui-info-multiline-prefix 'permanent-local t)
|
||||
|
||||
(defcustom bui-info-delimiter "\n\f\n"
|
||||
"String used to separate entries."
|
||||
:type 'string
|
||||
:group 'bui-info)
|
||||
(put 'bui-info-delimiter 'permanent-local t)
|
||||
|
||||
(defconst bui-info-symbol-specifications
|
||||
'((:delimiter delimiter t)
|
||||
(:fill fill t)
|
||||
(:format format always)
|
||||
(:ignore-empty-values ignore-empty-values t)
|
||||
(:ignore-void-values ignore-void-values t)
|
||||
(:multiline-prefix multiline-prefix t)
|
||||
(:title-format param-title-format t))
|
||||
"Specifications for generating 'info' variables.
|
||||
See `bui-symbol-specifications' for details.")
|
||||
|
||||
|
||||
;;; Wrappers for 'info' variables
|
||||
|
||||
(defun bui-info-symbol (entry-type symbol)
|
||||
"Return symbol for ENTRY-TYPE and 'info' buffer type."
|
||||
(bui-symbol entry-type 'info symbol))
|
||||
|
||||
(defun bui-info-symbol-value (entry-type symbol)
|
||||
"Return SYMBOL's value for ENTRY-TYPE and 'info' buffer type."
|
||||
(bui-symbol-value entry-type 'info symbol))
|
||||
|
||||
(defun bui-info-param-title (entry-type param)
|
||||
"Return a title of an ENTRY-TYPE parameter PARAM."
|
||||
(bui-param-title entry-type 'info param))
|
||||
|
||||
(defun bui-info-format (entry-type)
|
||||
"Return 'info' format for ENTRY-TYPE."
|
||||
(bui-info-symbol-value entry-type 'format))
|
||||
|
||||
(defun bui-info-displayed-params (entry-type)
|
||||
"Return a list of ENTRY-TYPE parameters that should be displayed."
|
||||
(-non-nil
|
||||
(--map (pcase it
|
||||
(`(,param . ,_) param))
|
||||
(bui-info-format entry-type))))
|
||||
|
||||
|
||||
;;; Inserting entries
|
||||
|
||||
(defvar bui-info-title-aliases
|
||||
'((format . bui-info-insert-title-format)
|
||||
(simple . bui-info-insert-title-simple))
|
||||
"Alist of aliases and functions to insert titles.")
|
||||
|
||||
(defvar bui-info-value-aliases
|
||||
'((format . bui-info-insert-value-format)
|
||||
(indent . bui-info-insert-value-indent)
|
||||
(simple . bui-info-insert-value-simple)
|
||||
(time . bui-info-insert-time))
|
||||
"Alist of aliases and functions to insert values.")
|
||||
|
||||
(defun bui-info-title-function (fun-or-alias)
|
||||
"Convert FUN-OR-ALIAS into a function to insert a title."
|
||||
(or (bui-assq-value bui-info-title-aliases fun-or-alias)
|
||||
fun-or-alias))
|
||||
|
||||
(defun bui-info-value-function (fun-or-alias)
|
||||
"Convert FUN-OR-ALIAS into a function to insert a value."
|
||||
(or (bui-assq-value bui-info-value-aliases fun-or-alias)
|
||||
fun-or-alias))
|
||||
|
||||
(defun bui-info-title-method->function (method)
|
||||
"Convert title METHOD into a function to insert a title."
|
||||
(pcase method
|
||||
((pred null) #'ignore)
|
||||
((pred symbolp) (bui-info-title-function method))
|
||||
(`(,fun-or-alias . ,rest-args)
|
||||
(lambda (title)
|
||||
(apply (bui-info-title-function fun-or-alias)
|
||||
title rest-args)))
|
||||
(_ (error "Unknown title method '%S'" method))))
|
||||
|
||||
(defun bui-info-value-method->function (method)
|
||||
"Convert value METHOD into a function to insert a value."
|
||||
(pcase method
|
||||
((pred null) #'ignore)
|
||||
((pred functionp) method)
|
||||
(`(,fun-or-alias . ,rest-args)
|
||||
(lambda (value _)
|
||||
(apply (bui-info-value-function fun-or-alias)
|
||||
value rest-args)))
|
||||
(_ (error "Unknown value method '%S'" method))))
|
||||
|
||||
(defun bui-info-insert-entries (entries entry-type)
|
||||
"Display ENTRY-TYPE ENTRIES in the current info buffer."
|
||||
(bui-mapinsert (lambda (entry)
|
||||
(bui-info-insert-entry entry entry-type))
|
||||
entries
|
||||
bui-info-delimiter)
|
||||
(bui-history-insert-buttons))
|
||||
|
||||
(defun bui-info-insert-entry (entry entry-type &optional indent-level)
|
||||
"Insert ENTRY-TYPE ENTRY into the current info buffer.
|
||||
If INDENT-LEVEL is non-nil, indent displayed data by this number
|
||||
of `bui-indent' spaces."
|
||||
(bui-with-indent (* (or indent-level 0)
|
||||
bui-indent)
|
||||
(dolist (spec (bui-info-format entry-type))
|
||||
(bui-info-insert-entry-unit spec entry entry-type))))
|
||||
|
||||
(defun bui-info-insert-entry-unit (format-spec entry entry-type)
|
||||
"Insert title and value of a PARAM at point.
|
||||
ENTRY is alist with parameters and their values.
|
||||
ENTRY-TYPE is a type of ENTRY."
|
||||
(pcase format-spec
|
||||
((pred null)
|
||||
(bui-newline))
|
||||
((pred functionp)
|
||||
(funcall format-spec entry))
|
||||
(`(,param ,title-method ,value-method)
|
||||
(let* ((value (bui-entry-value entry param))
|
||||
(void? (bui-void-value? value))
|
||||
(empty? (null value))
|
||||
(boolean? (bui-boolean-param? entry-type 'info param)))
|
||||
(unless (or (and bui-info-ignore-void-values void?)
|
||||
(and bui-info-ignore-empty-values
|
||||
empty? (not boolean?)))
|
||||
(let ((title (bui-info-param-title entry-type param))
|
||||
(insert-title (bui-info-title-method->function title-method))
|
||||
(insert-value (bui-info-value-method->function value-method)))
|
||||
(funcall insert-title title)
|
||||
(cond
|
||||
(void? (insert bui-empty-string))
|
||||
((and empty? boolean?) (insert bui-false-string))
|
||||
(t (funcall insert-value value entry)))
|
||||
(bui-newline)))))
|
||||
(_ (error "Unknown format specification '%S'" format-spec))))
|
||||
|
||||
(defun bui-info-insert-title-simple (title &optional face)
|
||||
"Insert \"TITLE: \" string at point.
|
||||
If FACE is nil, use `bui-info-param-title'."
|
||||
(bui-format-insert title
|
||||
(or face 'bui-info-param-title)
|
||||
"%s: "))
|
||||
|
||||
(defun bui-info-insert-title-format (title &optional face)
|
||||
"Insert TITLE using `bui-info-param-title-format' at point.
|
||||
If FACE is nil, use `bui-info-param-title'."
|
||||
(bui-format-insert title
|
||||
(or face 'bui-info-param-title)
|
||||
bui-info-param-title-format))
|
||||
|
||||
(defun bui-info-insert-value-simple (value &optional button-or-face indent)
|
||||
"Format and insert parameter VALUE at point.
|
||||
|
||||
VALUE may be split into several short lines to fit the current
|
||||
window, depending on `bui-info-fill', and each line is indented
|
||||
with INDENT number of spaces.
|
||||
|
||||
If BUTTON-OR-FACE is a button type symbol, transform VALUE into
|
||||
this (these) button(s) and insert each one on a new line. If it
|
||||
is a face symbol, propertize inserted line(s) with this face."
|
||||
(or indent (setq indent 0))
|
||||
(bui-with-indent indent
|
||||
(let* ((button? (bui-button-type? button-or-face))
|
||||
(face (unless button? button-or-face))
|
||||
(fill-col (unless (or button?
|
||||
(and (stringp value)
|
||||
(not bui-info-fill)))
|
||||
(- (bui-fill-column) indent)))
|
||||
(value (if (and value button?)
|
||||
(bui-buttonize value button-or-face "\n")
|
||||
value)))
|
||||
(bui-split-insert value face fill-col "\n"))))
|
||||
|
||||
(defun bui-info-insert-value-indent (value &optional button-or-face)
|
||||
"Format and insert parameter VALUE at point.
|
||||
|
||||
This function is intended to be called after inserting a title
|
||||
with `bui-info-insert-title-simple'.
|
||||
|
||||
VALUE may be split into several short lines to fit the current
|
||||
window, depending on `bui-info-fill', and each line is indented
|
||||
with `bui-indent'.
|
||||
|
||||
For the meaning of BUTTON-OR-FACE, see `bui-info-insert-value-simple'."
|
||||
(when value (bui-newline))
|
||||
(bui-info-insert-value-simple value button-or-face bui-indent))
|
||||
|
||||
(defun bui-info-insert-value-format (value &optional button-or-face
|
||||
&rest button-properties)
|
||||
"Format and insert parameter VALUE at point.
|
||||
|
||||
This function is intended to be called after inserting a title
|
||||
with `bui-info-insert-title-format'.
|
||||
|
||||
VALUE may be split into several short lines to fit the current
|
||||
window, depending on `bui-info-fill' and
|
||||
`bui-info-multiline-prefix'. If VALUE is a list, its elements
|
||||
will be separated with `bui-list-separator'.
|
||||
|
||||
If BUTTON-OR-FACE is a button type symbol, transform VALUE into
|
||||
this (these) button(s). If it is a face symbol, propertize
|
||||
inserted line(s) with this face.
|
||||
|
||||
BUTTON-PROPERTIES are passed to `bui-buttonize' (only if
|
||||
BUTTON-OR-FACE is a button type)."
|
||||
(let* ((button? (bui-button-type? button-or-face))
|
||||
(face (unless button? button-or-face))
|
||||
(fill-col (when (or button?
|
||||
bui-info-fill
|
||||
(not (stringp value)))
|
||||
(- (bui-fill-column)
|
||||
(length bui-info-multiline-prefix))))
|
||||
(value (if (and value button?)
|
||||
(apply #'bui-buttonize
|
||||
value button-or-face bui-list-separator
|
||||
button-properties)
|
||||
value)))
|
||||
(bui-split-insert value face fill-col
|
||||
(concat "\n" bui-info-multiline-prefix))))
|
||||
|
||||
(defun bui-info-insert-time (time &optional face)
|
||||
"Insert formatted time string using TIME at point.
|
||||
See `bui-get-time-string' for the meaning of TIME."
|
||||
(bui-format-insert (bui-get-time-string time)
|
||||
(or face 'bui-time)))
|
||||
|
||||
|
||||
;;; Major mode
|
||||
|
||||
(defvar bui-info-mode-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent
|
||||
map (make-composed-keymap (list bui-map button-buffer-map)
|
||||
special-mode-map))
|
||||
map)
|
||||
"Keymap for `bui-info-mode' buffers.")
|
||||
|
||||
(define-derived-mode bui-info-mode special-mode "BUI-Info"
|
||||
"Parent mode for displaying data in 'info' form."
|
||||
(bui-info-initialize))
|
||||
|
||||
(defun bui-info-initialize ()
|
||||
"Set up the current 'info' buffer."
|
||||
;; Without this, syntactic fontification is performed, and it may
|
||||
;; break highlighting. For example, if there is a single "
|
||||
;; (double-quote) character, the default syntactic fontification
|
||||
;; highlights the rest text after it as a string.
|
||||
;; See (info "(elisp) Font Lock Basics") for details.
|
||||
(setq font-lock-defaults '(nil t)))
|
||||
|
||||
(provide 'bui-info)
|
||||
|
||||
;;; bui-info.el ends here
|
||||
Binary file not shown.
|
|
@ -1,536 +0,0 @@
|
|||
;;; bui-list.el --- 'List' buffer interface for displaying data -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright © 2014–2018 Alex Kost <alezost@gmail.com>
|
||||
|
||||
;; 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This file provides 'list' buffer interface for displaying an arbitrary
|
||||
;; data.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'cl-lib)
|
||||
(require 'dash)
|
||||
(require 'tabulated-list)
|
||||
(require 'bui-core)
|
||||
(require 'bui-button)
|
||||
(require 'bui-entry)
|
||||
(require 'bui-utils)
|
||||
|
||||
(bui-define-groups bui-list)
|
||||
|
||||
|
||||
;;; General 'list' variables
|
||||
|
||||
(defvar bui-list-format nil
|
||||
"List of methods to get values of the displayed columns.
|
||||
Each element of the list has a form:
|
||||
|
||||
(PARAM VALUE-FUN WIDTH SORT . PROPS)
|
||||
|
||||
PARAM is a name of an entry parameter.
|
||||
|
||||
VALUE-FUN may be either nil or a function returning a value that
|
||||
will be inserted. The function is called with 2 arguments: the
|
||||
first one is the value of the parameter; the second one is an
|
||||
entry (alist of parameter names and values).
|
||||
|
||||
For the meaning of WIDTH, SORT and PROPS, see
|
||||
`tabulated-list-format'.")
|
||||
(put 'bui-list-format 'permanent-local t)
|
||||
|
||||
(defcustom bui-list-sort-key nil
|
||||
"Default sort key for 'list' buffer.
|
||||
Should be nil (no sort) or have a form:
|
||||
|
||||
(PARAM . FLIP)
|
||||
|
||||
PARAM is the name of an entry parameter. For the meaning of
|
||||
FLIP, see `tabulated-list-sort-key'."
|
||||
:type '(choice (const :tag "No sort" nil)
|
||||
(cons symbol boolean))
|
||||
:group 'bui-list)
|
||||
(put 'bui-list-sort-key 'permanent-local t)
|
||||
|
||||
(defvar bui-list-additional-marks nil
|
||||
"Alist of additional marks for 'list' buffer.
|
||||
Marks from this list are used along with `bui-list-default-marks'.")
|
||||
(put 'bui-list-additional-marks 'permanent-local t)
|
||||
|
||||
(defcustom bui-list-show-single nil
|
||||
"If non-nil, list an entry even if it is the only matching result.
|
||||
If nil, show a single entry in the 'info' buffer instead."
|
||||
:type 'boolean
|
||||
:group 'bui-list)
|
||||
(put 'bui-list-show-single 'permanent-local t)
|
||||
|
||||
(defcustom bui-list-describe-warning-count 10
|
||||
"The maximum number of entries to describe without a warning.
|
||||
If you want to describe more than this number of marked entries,
|
||||
you will be prompted for confirmation. See also
|
||||
`bui-list-describe'."
|
||||
:type 'integer
|
||||
:group 'bui-list)
|
||||
(put 'bui-list-describe-warning-count 'permanent-local t)
|
||||
|
||||
(defvar bui-list-describe-function nil
|
||||
"Function used by `bui-list-describe'.
|
||||
It is applied to the entries IDs as the rest arguments.
|
||||
If nil, 'describing' is not performed (it usually means that
|
||||
'info' interface is not defined).")
|
||||
(put 'bui-list-describe-function 'permanent-local t)
|
||||
|
||||
(defconst bui-list-symbol-specifications
|
||||
'((:describe-function describe-function t)
|
||||
(:describe-count describe-warning-count t)
|
||||
(:format format t)
|
||||
(:list-single? show-single t)
|
||||
(:marks additional-marks)
|
||||
(:sort-key sort-key t))
|
||||
"Specifications for generating 'list' variables.
|
||||
See `bui-symbol-specifications' for details.")
|
||||
|
||||
|
||||
;;; Displaying 'info' buffer
|
||||
|
||||
(defun bui-list-describe (&rest mark-names)
|
||||
"Describe entries marked with MARK-NAMES.
|
||||
'Describe' means display entries in 'info' buffer.
|
||||
If no entries are marked, describe the current entry.
|
||||
|
||||
Available MARK-NAMES are symbols from `bui-list-marks'.
|
||||
|
||||
Interactively, describe entries marked with a general mark. With
|
||||
prefix argument, describe entries marked with any mark."
|
||||
(interactive (unless current-prefix-arg '(general)))
|
||||
(or bui-list-describe-function
|
||||
(error "Can't display 'info' buffer: '%S' is unset"
|
||||
(bui-list-symbol (bui-current-entry-type)
|
||||
'describe-function)))
|
||||
(let* ((ids (or (apply #'bui-list-get-marked-id-list mark-names)
|
||||
(list (bui-list-current-id))))
|
||||
(count (length ids)))
|
||||
(when (or (<= count bui-list-describe-warning-count)
|
||||
(y-or-n-p (format "Do you really want to describe %d entries? "
|
||||
count)))
|
||||
(apply bui-list-describe-function ids))))
|
||||
|
||||
|
||||
;;; Wrappers for 'list' variables
|
||||
|
||||
(defun bui-list-symbol (entry-type symbol)
|
||||
"Return symbol for ENTRY-TYPE and 'list' buffer type."
|
||||
(bui-symbol entry-type 'list symbol))
|
||||
|
||||
(defun bui-list-symbol-value (entry-type symbol)
|
||||
"Return SYMBOL's value for ENTRY-TYPE and 'list' buffer type."
|
||||
(bui-symbol-value entry-type 'list symbol))
|
||||
|
||||
(defun bui-list-param-title (entry-type param)
|
||||
"Return column title of an ENTRY-TYPE parameter PARAM."
|
||||
(bui-param-title entry-type 'list param))
|
||||
|
||||
(defun bui-list-format (entry-type)
|
||||
"Return column format for ENTRY-TYPE."
|
||||
(bui-list-symbol-value entry-type 'format))
|
||||
|
||||
(defun bui-list-displayed-params (entry-type)
|
||||
"Return a list of ENTRY-TYPE parameters that should be displayed."
|
||||
(mapcar #'car (bui-list-format entry-type)))
|
||||
|
||||
(defun bui-list-show-single-entry? (entry-type)
|
||||
"Return non-nil, if a single entry of ENTRY-TYPE should be listed."
|
||||
(or (bui-list-symbol-value entry-type 'show-single)
|
||||
bui-list-show-single))
|
||||
|
||||
|
||||
;;; Tabulated list internals
|
||||
|
||||
(defun bui-list-sort-numerically (column a b)
|
||||
"Compare COLUMN of tabulated entries A and B numerically.
|
||||
This function is used for sort predicates for `tabulated-list-format'.
|
||||
Return non-nil, if B is bigger than A."
|
||||
(cl-flet ((num (entry)
|
||||
(string-to-number (aref (cadr entry) column))))
|
||||
(> (num b) (num a))))
|
||||
|
||||
(defmacro bui-list-define-numerical-sorter (column)
|
||||
"Define numerical sort predicate for COLUMN.
|
||||
See `bui-list-sort-numerically' for details."
|
||||
(let ((name (intern (format "bui-list-sort-numerically-%d" column)))
|
||||
(doc (format "\
|
||||
Predicate to sort tabulated list by column %d numerically.
|
||||
See `bui-list-sort-numerically' for details."
|
||||
column)))
|
||||
`(defun ,name (a b)
|
||||
,doc
|
||||
(bui-list-sort-numerically ,column a b))))
|
||||
|
||||
(defmacro bui-list-define-numerical-sorters (n)
|
||||
"Define numerical sort predicates for columns from 0 to N.
|
||||
See `bui-list-define-numerical-sorter' for details."
|
||||
`(progn
|
||||
,@(mapcar (lambda (i)
|
||||
`(bui-list-define-numerical-sorter ,i))
|
||||
(number-sequence 0 n))))
|
||||
|
||||
(bui-list-define-numerical-sorters 9)
|
||||
|
||||
(defun bui-list-tabulated-sort-key ()
|
||||
"Return sort key for `tabulated-list-sort-key'."
|
||||
(and bui-list-sort-key
|
||||
(cons (bui-current-param-title (car bui-list-sort-key))
|
||||
(cdr bui-list-sort-key))))
|
||||
|
||||
(defun bui-list-tabulated-vector (fun)
|
||||
"Call FUN on each column specification.
|
||||
|
||||
FUN is applied to column specification as arguments (see
|
||||
`bui-list-format').
|
||||
|
||||
Return a vector made of values of FUN calls."
|
||||
(apply #'vector
|
||||
(mapcar (lambda (col-spec)
|
||||
(apply fun col-spec))
|
||||
bui-list-format)))
|
||||
|
||||
(defun bui-list-tabulated-format ()
|
||||
"Return list specification for `tabulated-list-format'."
|
||||
(bui-list-tabulated-vector
|
||||
(lambda (param _ &rest rest-spec)
|
||||
(cons (bui-current-param-title param)
|
||||
rest-spec))))
|
||||
|
||||
(defun bui-list-tabulated-entries (entries entry-type)
|
||||
"Return a list of ENTRY-TYPE values for `tabulated-list-entries'."
|
||||
(mapcar (lambda (entry)
|
||||
(list (bui-entry-id entry)
|
||||
(bui-list-tabulated-entry entry entry-type)))
|
||||
entries))
|
||||
|
||||
(defun bui-list-tabulated-entry (entry entry-type)
|
||||
"Return array of values for `tabulated-list-entries'.
|
||||
Parameters are taken from ENTRY-TYPE ENTRY."
|
||||
(bui-list-tabulated-vector
|
||||
(lambda (param fun &rest _)
|
||||
(let ((value (bui-entry-value entry param)))
|
||||
(cond
|
||||
;; If function is specified, then it should probably return
|
||||
;; something, even if VALUE is void, so give it the precedence.
|
||||
(fun (funcall fun (bui-entry-non-void-value entry param) entry))
|
||||
((bui-void-value? value) bui-empty-string)
|
||||
((and (null value)
|
||||
(bui-boolean-param? entry-type 'list param))
|
||||
bui-false-string)
|
||||
(t (bui-get-string value)))))))
|
||||
|
||||
|
||||
;;; Displaying entries
|
||||
|
||||
(defun bui-list-get-display-entries (entry-type &rest args)
|
||||
"Search for entries and show them in a 'list' buffer preferably."
|
||||
(let ((entries (bui-get-entries entry-type 'list args)))
|
||||
(if (or (null entries) ; = 0
|
||||
(cdr entries) ; > 1
|
||||
(bui-list-show-single-entry? entry-type)
|
||||
(not (bui-interface-defined? entry-type 'info)))
|
||||
(bui-display-entries entries entry-type 'list args)
|
||||
(if (equal (bui-symbol-value entry-type 'info 'get-entries-function)
|
||||
(bui-symbol-value entry-type 'list 'get-entries-function))
|
||||
(bui-display-entries entries entry-type 'info args)
|
||||
(bui-get-display-entries entry-type 'info args)))))
|
||||
|
||||
(defun bui-list-insert-entries (entries entry-type)
|
||||
"Print ENTRY-TYPE ENTRIES in the current buffer."
|
||||
(setq tabulated-list-entries
|
||||
(bui-list-tabulated-entries entries entry-type))
|
||||
(tabulated-list-print))
|
||||
|
||||
(defun bui-list-get-one-line (value &optional _)
|
||||
"Return one-line string from a multi-line string VALUE.
|
||||
VALUE may be nil."
|
||||
(bui-get-non-nil value
|
||||
(bui-get-one-line value)))
|
||||
|
||||
(defun bui-list-get-time (time &optional _)
|
||||
"Return formatted time string from TIME.
|
||||
TIME may be nil or another value supported by `bui-get-time-string'."
|
||||
(bui-get-non-nil time
|
||||
(bui-get-string (bui-get-time-string time)
|
||||
'bui-time)))
|
||||
|
||||
(defun bui-list-get-file-name (file-name &optional _)
|
||||
"Return FILE-NAME button specification for `tabulated-list-entries'.
|
||||
FILE-NAME may be nil."
|
||||
(bui-get-non-nil file-name
|
||||
(list file-name
|
||||
:type 'bui-file
|
||||
'file file-name)))
|
||||
|
||||
(defun bui-list-get-url (url &optional _)
|
||||
"Return URL button specification for `tabulated-list-entries'.
|
||||
URL may be nil."
|
||||
(bui-get-non-nil url
|
||||
(list url
|
||||
:type 'bui-url
|
||||
'url url)))
|
||||
|
||||
|
||||
;;; 'List' lines
|
||||
|
||||
(defun bui-list-current-id ()
|
||||
"Return ID of the entry at point."
|
||||
(or (tabulated-list-get-id)
|
||||
(user-error "No entry here")))
|
||||
|
||||
(defun bui-list-current-entry ()
|
||||
"Return entry at point."
|
||||
(bui-entry-by-id (bui-current-entries)
|
||||
(bui-list-current-id)))
|
||||
|
||||
(defun bui-list-for-each-line (fun &rest args)
|
||||
"Call FUN with ARGS for each entry line."
|
||||
(or (derived-mode-p 'bui-list-mode)
|
||||
(error "The current buffer is not in `bui-list-mode'"))
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (not (eobp))
|
||||
(apply fun args)
|
||||
(forward-line))))
|
||||
|
||||
(defun bui-list-fold-lines (fun init)
|
||||
"Fold over entry lines in the current list buffer.
|
||||
Call FUN with RESULT as argument for each line, using INIT as
|
||||
the initial value of RESULT. Return the final result."
|
||||
(let ((res init))
|
||||
(bui-list-for-each-line
|
||||
(lambda () (setq res (funcall fun res))))
|
||||
res))
|
||||
|
||||
|
||||
;;; Marking and sorting
|
||||
|
||||
(defvar-local bui-list-marked nil
|
||||
"List of the marked entries.
|
||||
Each element of the list has a form:
|
||||
|
||||
(ID MARK-NAME . ARGS)
|
||||
|
||||
ID is an entry ID.
|
||||
MARK-NAME is a symbol from `bui-list-marks'.
|
||||
ARGS is a list of additional values.")
|
||||
|
||||
(defvar-local bui-list-marks nil
|
||||
"Alist of available mark names and mark characters.")
|
||||
|
||||
(defvar bui-list-default-marks
|
||||
'((empty . ?\s)
|
||||
(general . ?*))
|
||||
"Alist of default mark names and mark characters.")
|
||||
|
||||
(defun bui-list-get-mark (name)
|
||||
"Return mark character by its NAME."
|
||||
(or (bui-assq-value bui-list-marks name)
|
||||
(error "Mark '%S' not found" name)))
|
||||
|
||||
(defun bui-list-get-mark-string (name)
|
||||
"Return mark string by its NAME."
|
||||
(string (bui-list-get-mark name)))
|
||||
|
||||
(defun bui-list-current-mark ()
|
||||
"Return mark character of the current line."
|
||||
(char-after (line-beginning-position)))
|
||||
|
||||
(defun bui-list-current-mark-name ()
|
||||
"Return name of the mark on the current line."
|
||||
(or (car (bui-assq-value bui-list-marked (bui-list-current-id)))
|
||||
'empty))
|
||||
|
||||
(defun bui-list-get-marked (&rest mark-names)
|
||||
"Return list of specs of entries marked with any mark from MARK-NAMES.
|
||||
Entry specs are elements from `bui-list-marked' list.
|
||||
If MARK-NAMES are not specified, use all marks from
|
||||
`bui-list-marks' except the `empty' one."
|
||||
(or mark-names
|
||||
(setq mark-names
|
||||
(delq 'empty (mapcar #'car bui-list-marks))))
|
||||
(-filter (-lambda ((_id name . _))
|
||||
(memq name mark-names))
|
||||
bui-list-marked))
|
||||
|
||||
(defun bui-list-get-marked-args (mark-name)
|
||||
"Return list of (ID . ARGS) elements from lines marked with MARK-NAME.
|
||||
See `bui-list-marked' for the meaning of ARGS."
|
||||
(mapcar (-lambda ((id _name . args))
|
||||
(cons id args))
|
||||
(bui-list-get-marked mark-name)))
|
||||
|
||||
(defun bui-list-get-marked-id-list (&rest mark-names)
|
||||
"Return list of IDs of entries marked with any mark from MARK-NAMES.
|
||||
See `bui-list-get-marked' for details."
|
||||
(mapcar #'car (apply #'bui-list-get-marked mark-names)))
|
||||
|
||||
(defun bui-list-marked-or-current (&rest mark-names)
|
||||
"Return a list of IDs of the marked entries.
|
||||
If nothing is marked, return a list with ID of the current entry.
|
||||
See `bui-list-get-marked' for the meaning of MARK-NAMES."
|
||||
(or (apply #'bui-list-get-marked-id-list mark-names)
|
||||
(list (bui-list-current-id))))
|
||||
|
||||
(defun bui-list-map-marked (function &rest mark-names)
|
||||
"Apply FUNCTION to each element of the marked entries.
|
||||
If nothing is marked, call FUNCTION on the current entry.
|
||||
See `bui-list-get-marked' for the meaning of MARK-NAMES."
|
||||
(mapcar function
|
||||
(apply #'bui-list-marked-or-current mark-names)))
|
||||
|
||||
(defun bui-list--mark (mark-name &optional advance &rest args)
|
||||
"Put a mark on the current line.
|
||||
Also add the current entry to `bui-list-marked' using its ID and ARGS.
|
||||
MARK-NAME is a symbol from `bui-list-marks'.
|
||||
If ADVANCE is non-nil, move forward by one line after marking."
|
||||
(let ((id (bui-list-current-id)))
|
||||
(if (eq mark-name 'empty)
|
||||
(setq bui-list-marked (assq-delete-all id bui-list-marked))
|
||||
(let ((assoc (assq id bui-list-marked))
|
||||
(val (cons mark-name args)))
|
||||
(if assoc
|
||||
(setcdr assoc val)
|
||||
(push (cons id val) bui-list-marked)))))
|
||||
(tabulated-list-put-tag (bui-list-get-mark-string mark-name)
|
||||
advance))
|
||||
|
||||
(defun bui-list-mark (&optional arg)
|
||||
"Mark the current line and move to the next line.
|
||||
With ARG, mark all lines."
|
||||
(interactive "P")
|
||||
(if arg
|
||||
(bui-list-mark-all)
|
||||
(bui-list--mark 'general t)))
|
||||
|
||||
(defun bui-list-mark-all (&optional mark-name)
|
||||
"Mark all lines with MARK-NAME mark.
|
||||
MARK-NAME is a symbol from `bui-list-marks'.
|
||||
Interactively, put a general mark on all lines."
|
||||
(interactive)
|
||||
(or mark-name (setq mark-name 'general))
|
||||
(setq bui-list-marked
|
||||
(if (eq mark-name 'empty)
|
||||
nil
|
||||
(mapcar (lambda (entry)
|
||||
(list (bui-entry-id entry) mark-name))
|
||||
(bui-current-entries))))
|
||||
(bui-list-for-each-line #'tabulated-list-put-tag
|
||||
(bui-list-get-mark-string mark-name)))
|
||||
|
||||
(defun bui-list-unmark (&optional arg)
|
||||
"Unmark the current line and move to the next line.
|
||||
With ARG, unmark all lines."
|
||||
(interactive "P")
|
||||
(if arg
|
||||
(bui-list-unmark-all)
|
||||
(bui-list--mark 'empty t)))
|
||||
|
||||
(defun bui-list-unmark-backward ()
|
||||
"Move up one line and unmark it."
|
||||
(interactive)
|
||||
(forward-line -1)
|
||||
(bui-list--mark 'empty))
|
||||
|
||||
(defun bui-list-unmark-all ()
|
||||
"Unmark all lines."
|
||||
(interactive)
|
||||
(bui-list-mark-all 'empty))
|
||||
|
||||
(defun bui-list-restore-marks ()
|
||||
"Put marks according to `bui-list-marked'."
|
||||
(bui-list-for-each-line
|
||||
(lambda ()
|
||||
(let ((mark-name (bui-list-current-mark-name)))
|
||||
(unless (eq mark-name 'empty)
|
||||
(tabulated-list-put-tag
|
||||
(bui-list-get-mark-string mark-name)))))))
|
||||
|
||||
(defun bui-list-sort (&optional n)
|
||||
"Sort list entries by the column at point.
|
||||
With a numeric prefix argument N, sort the Nth column.
|
||||
Same as `tabulated-list-sort', but also restore marks after sorting."
|
||||
(interactive "P")
|
||||
(tabulated-list-sort n)
|
||||
(bui-list-restore-marks))
|
||||
|
||||
|
||||
;;; Major mode
|
||||
|
||||
(defvar bui-list-mode-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent
|
||||
map (make-composed-keymap bui-map
|
||||
tabulated-list-mode-map))
|
||||
(define-key map (kbd "i") 'bui-list-describe)
|
||||
(define-key map (kbd "RET") 'bui-list-describe)
|
||||
(define-key map (kbd "*") 'bui-list-mark)
|
||||
(define-key map (kbd "m") 'bui-list-mark)
|
||||
(define-key map (kbd "M") 'bui-list-mark-all)
|
||||
(define-key map (kbd "u") 'bui-list-unmark)
|
||||
(define-key map (kbd "DEL") 'bui-list-unmark-backward)
|
||||
(define-key map (kbd "U") 'bui-list-unmark-all)
|
||||
(define-key map (kbd "s") 'bui-list-sort)
|
||||
(define-key map [remap tabulated-list-sort] 'bui-list-sort)
|
||||
map)
|
||||
"Keymap for `bui-list-mode' buffers.")
|
||||
|
||||
(defvar bui-list-mark-hint
|
||||
'(("\\[bui-list-mark]") " mark; "
|
||||
("\\[bui-list-unmark]") " unmark; "
|
||||
("\\[bui-list-unmark-backward]") " unmark backward;\n")
|
||||
"Hint with 'mark' keys for 'list' buffer.
|
||||
See `bui-hint' for details.")
|
||||
|
||||
(defvar bui-list-sort-hint
|
||||
'(("\\[bui-list-sort]") " sort by column;\n")
|
||||
"Hint with 'sort' keys for 'list' buffer.
|
||||
See `bui-hint' for details.")
|
||||
|
||||
(defvar bui-list-info-hint
|
||||
'(("\\[bui-list-describe]") " show 'info' buffer;\n")
|
||||
"Hint for 'list' buffer used only when 'info' interface is defined.
|
||||
See `bui-hint' for details.")
|
||||
|
||||
(defun bui-list-hint ()
|
||||
"Return hint structure for the current 'list' buffer."
|
||||
(bui-format-hints
|
||||
bui-list-mark-hint
|
||||
(and (bui-interface-defined? (bui-current-entry-type) 'info)
|
||||
bui-list-info-hint)
|
||||
bui-list-sort-hint))
|
||||
|
||||
(define-derived-mode bui-list-mode tabulated-list-mode "BUI-List"
|
||||
"Parent mode for displaying data in 'list' form."
|
||||
(bui-list-initialize))
|
||||
|
||||
(defun bui-list-initialize ()
|
||||
"Set up the current 'list' buffer."
|
||||
(setq tabulated-list-padding 2
|
||||
tabulated-list-format (bui-list-tabulated-format)
|
||||
tabulated-list-sort-key (bui-list-tabulated-sort-key))
|
||||
(setq-local bui-list-marks (append bui-list-default-marks
|
||||
bui-list-additional-marks))
|
||||
(tabulated-list-init-header))
|
||||
|
||||
(provide 'bui-list)
|
||||
|
||||
;;; bui-list.el ends here
|
||||
Binary file not shown.
|
|
@ -1,11 +0,0 @@
|
|||
;; -*- no-byte-compile: t; lexical-binding: nil -*-
|
||||
(define-package "bui" "20210108.1141"
|
||||
"Buffer interface library."
|
||||
'((emacs "24.3")
|
||||
(dash "2.11.0"))
|
||||
:url "https://github.com/alezost/bui.el"
|
||||
:commit "ab62fcefc3c7ddf5e5d64c18045148a3c297592d"
|
||||
:revdesc "ab62fcefc3c7"
|
||||
:keywords '("tools")
|
||||
:authors '(("Alex Kost" . "alezost@gmail.com"))
|
||||
:maintainers '(("Alex Kost" . "alezost@gmail.com")))
|
||||
|
|
@ -1,483 +0,0 @@
|
|||
;;; bui-utils.el --- General utility functions -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright © 2014–2017, 2021 Alex Kost <alezost@gmail.com>
|
||||
;; Copyright © 2020 Joe Bloggs <vapniks@yahoo.com>
|
||||
|
||||
;; 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; This file provides auxiliary functions for "bui.el" package.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'cl-lib)
|
||||
(require 'dash)
|
||||
|
||||
(defcustom bui-true-string "Yes"
|
||||
"String used if the value of a parameter is t."
|
||||
:type 'string
|
||||
:group 'bui)
|
||||
(put 'bui-true-string 'permanent-local t)
|
||||
|
||||
(defcustom bui-false-string "No"
|
||||
"String used if the value of a boolean parameter is nil."
|
||||
:type 'string
|
||||
:group 'bui)
|
||||
(put 'bui-false-string 'permanent-local t)
|
||||
|
||||
(defcustom bui-empty-string "—"
|
||||
"String used if the value of a non-boolean parameter is nil."
|
||||
:type 'string
|
||||
:group 'bui)
|
||||
(put 'bui-empty-string 'permanent-local t)
|
||||
|
||||
(defcustom bui-list-separator ", "
|
||||
"String used to separate list values."
|
||||
:type 'string
|
||||
:group 'bui)
|
||||
(put 'bui-list-separator 'permanent-local t)
|
||||
|
||||
(defcustom bui-time-format "%F %T"
|
||||
"String used to format time values.
|
||||
For possible formats, see `format-time-string'."
|
||||
:type 'string
|
||||
:group 'bui)
|
||||
(put 'bui-time-format 'permanent-local t)
|
||||
|
||||
|
||||
;;; String utils
|
||||
|
||||
(defun bui-propertize-maybe (string &optional face)
|
||||
"Return STRING propertized with FACE font-lock-face if it is non nil."
|
||||
(if face
|
||||
(propertize string 'font-lock-face face)
|
||||
string))
|
||||
|
||||
(defun bui-get-string (value &optional face)
|
||||
"Convert VALUE into a string and return it.
|
||||
|
||||
VALUE can be an expression of any type.
|
||||
If VALUE is t/nil, it is replaced with
|
||||
`bui-true-string'/`bui-empty-string'.
|
||||
If VALUE is list, its elements are concatenated using
|
||||
`bui-list-separator'.
|
||||
|
||||
If FACE is non-nil, propertize returned string with this FACE.
|
||||
If VALUE is nil, it is not propertized."
|
||||
(cond
|
||||
((null value) bui-empty-string)
|
||||
((listp value)
|
||||
(mapconcat (lambda (val)
|
||||
(bui-propertize-maybe (bui-get-string val) face))
|
||||
value
|
||||
bui-list-separator))
|
||||
(t
|
||||
(let ((str (cond
|
||||
((stringp value) value)
|
||||
((eq t value) bui-true-string)
|
||||
((numberp value) (number-to-string value))
|
||||
(t (prin1-to-string value)))))
|
||||
(bui-propertize-maybe str face)))))
|
||||
|
||||
(defmacro bui-get-non-nil (&optional value &rest body)
|
||||
"Return `bui-empty-string' if VALUE is nil, evaluate BODY otherwise."
|
||||
(declare (indent 1) (debug t))
|
||||
`(if (null ,value)
|
||||
bui-empty-string
|
||||
,@body))
|
||||
|
||||
(defmacro bui-insert-non-nil (&optional value &rest body)
|
||||
"Insert `bui-empty-string' if VALUE is nil, evaluate BODY otherwise."
|
||||
(declare (indent 1) (debug t))
|
||||
`(if (null ,value)
|
||||
(insert bui-empty-string)
|
||||
,@body))
|
||||
|
||||
(defun bui-get-time-string (time)
|
||||
"Return formatted time string from TIME using `bui-time-format'.
|
||||
TIME can be either a time value (list), a number of seconds, or a
|
||||
time string."
|
||||
(let ((time (cond ((listp time) time)
|
||||
((numberp time) (seconds-to-time time))
|
||||
((stringp time) (date-to-time time))
|
||||
(t (error "Unknown time format: %S" time)))))
|
||||
(format-time-string bui-time-format time)))
|
||||
|
||||
(defun bui-get-one-line (str)
|
||||
"Return one-line string from a multi-line STR."
|
||||
(replace-regexp-in-string "\n" " " str))
|
||||
|
||||
(defun bui-get-filled-string (str column)
|
||||
"Return string by filling STR to COLUMN."
|
||||
(with-temp-buffer
|
||||
(insert str)
|
||||
(let ((fill-column column))
|
||||
(fill-region (point-min) (point-max)))
|
||||
(buffer-string)))
|
||||
|
||||
(defun bui-split-string (str &optional column)
|
||||
"Split string STR by lines and return a list of the resulting strings.
|
||||
If COLUMN is non-nil, fill STR to this column."
|
||||
(let ((str (if column
|
||||
(bui-get-filled-string str column)
|
||||
str)))
|
||||
(split-string str "\n *" t)))
|
||||
|
||||
|
||||
;;; Inserting text
|
||||
|
||||
(defcustom bui-indent 2
|
||||
"Number of spaces used to indent various parts of inserted text."
|
||||
:type 'integer
|
||||
:group 'bui-info)
|
||||
|
||||
(defun bui-get-indent (&optional level)
|
||||
"Return `bui-indent' \"multiplied\" by LEVEL (1 by default) spaces."
|
||||
(make-string (* bui-indent (or level 1)) ?\s))
|
||||
|
||||
(defun bui-insert-indent (&optional level)
|
||||
"Insert `bui-indent' spaces LEVEL times (1 by default)."
|
||||
(insert (bui-get-indent level)))
|
||||
|
||||
;; `bui-newline' exists because `newline' does too much.
|
||||
(defun bui-newline (&optional n)
|
||||
"Insert N (1 by default) number of newlines at point."
|
||||
(--dotimes (or n 1)
|
||||
(insert "\n")))
|
||||
|
||||
(defmacro bui-with-indent (indent &rest body)
|
||||
"Evaluate BODY and indent inserted text by INDENT number of spaces."
|
||||
(declare (indent 1) (debug t))
|
||||
(let ((region-beg-var (make-symbol "region-beg"))
|
||||
(indent-var (make-symbol "indent")))
|
||||
`(let ((,region-beg-var (point))
|
||||
(,indent-var ,indent))
|
||||
,@body
|
||||
(unless (zerop ,indent-var)
|
||||
(indent-rigidly ,region-beg-var (point) ,indent-var)))))
|
||||
|
||||
(defun bui-format-insert (value &optional face format)
|
||||
"Convert VALUE into a string and insert it at point.
|
||||
If FACE is non-nil, propertize VALUE with FACE.
|
||||
If FORMAT is non-nil, format VALUE with FORMAT."
|
||||
(let ((str (bui-get-string value face)))
|
||||
(insert (if format
|
||||
(format format str)
|
||||
str))))
|
||||
|
||||
(cl-defun bui-mapinsert (function sequence separator &key indent column)
|
||||
"Like `mapconcat' but for inserting text.
|
||||
Apply FUNCTION to each element of SEQUENCE, and insert SEPARATOR
|
||||
at point between each FUNCTION call.
|
||||
|
||||
If INDENT is non-nil, it should be a number of spaces used to
|
||||
indent each line of the inserted text.
|
||||
|
||||
If COLUMN is non-nil, it should be a column number which
|
||||
shouldn't be exceeded by the inserted text."
|
||||
(pcase sequence
|
||||
(`(,first . ,rest)
|
||||
(let* ((indent (or indent 0))
|
||||
(max-column (and column (- column indent))))
|
||||
(bui-with-indent indent
|
||||
(funcall function first)
|
||||
(dolist (element rest)
|
||||
(let ((before-sep-pos (and column (point))))
|
||||
(insert separator)
|
||||
(let ((after-sep-pos (and column (point))))
|
||||
(funcall function element)
|
||||
(when (and column
|
||||
(> (current-column) max-column))
|
||||
(save-excursion
|
||||
(delete-region before-sep-pos after-sep-pos)
|
||||
(goto-char before-sep-pos)
|
||||
(bui-newline)))))))))))
|
||||
|
||||
(defun bui-split-insert (value &optional face column separator)
|
||||
"Convert VALUE into a string, split it and insert at point.
|
||||
|
||||
If FACE is non-nil, propertize returned string with this FACE.
|
||||
|
||||
If COLUMN is non-nil and result string is a one-line string
|
||||
longer than COLUMN, split it into several short lines.
|
||||
|
||||
Separate inserted lines with SEPARATOR."
|
||||
(bui-insert-non-nil value
|
||||
(let ((strings (bui-split-string (bui-get-string value face)
|
||||
column)))
|
||||
(bui-mapinsert #'insert
|
||||
strings
|
||||
(or separator "")))))
|
||||
|
||||
|
||||
;;; Files and URLs
|
||||
|
||||
(defcustom bui-find-file-function #'find-file
|
||||
"Function used to find a file.
|
||||
The function is called by `bui-find-file' with a file name as a
|
||||
single argument."
|
||||
:type '(choice (function-item find-file)
|
||||
(function-item org-open-file)
|
||||
(function :tag "Other function"))
|
||||
:group 'bui)
|
||||
|
||||
(defun bui-find-file (file)
|
||||
"Find FILE (using `bui-find-file-function') if it exists."
|
||||
(if (file-exists-p file)
|
||||
(funcall bui-find-file-function file)
|
||||
(message "File '%s' does not exist." file)))
|
||||
|
||||
|
||||
;;; Symbols, keywords, plists
|
||||
|
||||
(defun bui-keyword->symbol (keyword)
|
||||
"Transform KEYWORD into symbol (without leading ':')."
|
||||
(intern (substring (symbol-name keyword) 1)))
|
||||
|
||||
(defun bui-symbol-if-bound (symbol)
|
||||
"Return SYMBOL if its value is not void, otherwise return nil."
|
||||
(and (boundp symbol) symbol))
|
||||
|
||||
(defun bui-make-symbol (&rest symbols)
|
||||
"Return symbol by appending SYMBOLS separating them with '-'."
|
||||
(intern (mapconcat #'symbol-name symbols "-")))
|
||||
|
||||
(defun bui-symbol-title (symbol)
|
||||
"Return SYMBOL's name, a string.
|
||||
This is like `symbol-name', but fancier."
|
||||
(if (eq symbol 'id)
|
||||
"ID"
|
||||
(let ((str (replace-regexp-in-string "-" " " (symbol-name symbol))))
|
||||
(concat (capitalize (substring str 0 1))
|
||||
(substring str 1)))))
|
||||
|
||||
(defmacro bui-plist-let (args varlist &rest body)
|
||||
"Parse ARGS, bind variables from VARLIST and eval BODY.
|
||||
|
||||
Find keyword values in ARGS, bind them to variables according to
|
||||
VARLIST, then evaluate BODY.
|
||||
|
||||
ARGS is a keyword/value property list.
|
||||
|
||||
Each element of VARLIST has a form:
|
||||
|
||||
(SYMBOL KEYWORD [DEFAULT-VALUE])
|
||||
|
||||
SYMBOL is a variable name. KEYWORD is a symbol that will be
|
||||
searched in ARGS for an according value. If the value of KEYWORD
|
||||
does not exist, bind SYMBOL to DEFAULT-VALUE or nil.
|
||||
|
||||
The rest arguments (that present in ARGS but not in VARLIST) will
|
||||
be bound to `%foreign-args' variable.
|
||||
|
||||
Example:
|
||||
|
||||
(bui-plist-let '(:two 8 :great ! :bui is)
|
||||
((one :one 1)
|
||||
(two :two 2)
|
||||
(foo :smth))
|
||||
(list one two foo %foreign-args))
|
||||
|
||||
=> (1 8 nil (:bui is :great !))"
|
||||
(declare (indent 2))
|
||||
(let ((args-var (make-symbol "args")))
|
||||
`(let (,@(mapcar (lambda (spec)
|
||||
(pcase-let ((`(,name ,_ ,val) spec))
|
||||
(list name val)))
|
||||
varlist)
|
||||
(,args-var ,args)
|
||||
%foreign-args)
|
||||
(while ,args-var
|
||||
(pcase ,args-var
|
||||
(`(,key ,val . ,rest-args)
|
||||
(cl-case key
|
||||
,@(mapcar (lambda (spec)
|
||||
(pcase-let ((`(,name ,key ,_) spec))
|
||||
`(,key (setq ,name val))))
|
||||
varlist)
|
||||
(t (setq %foreign-args
|
||||
(cl-list* key val %foreign-args))))
|
||||
(setq ,args-var rest-args))))
|
||||
,@body)))
|
||||
|
||||
(defun bui-map-plist (function plist)
|
||||
"Apply FUNCTION to each keyword/value pair from PLIST.
|
||||
Return a list of the results."
|
||||
;; (cl-loop for lst on plist by #'cddr
|
||||
;; collect
|
||||
;; (let ((key (car lst))
|
||||
;; (val (cadr lst)))
|
||||
;; (funcall function key val)))
|
||||
|
||||
;; Use recursion (and `pcase') instead of the above variant as it is
|
||||
;; more clean and it should be OK for plists as they are not too big.
|
||||
(pcase plist
|
||||
(`(,key ,val . ,rest)
|
||||
(cons (funcall function key val)
|
||||
(bui-map-plist function rest)))))
|
||||
|
||||
|
||||
;;; Alist procedures
|
||||
|
||||
(defmacro bui-define-alist-accessor (name assoc-fun)
|
||||
"Define NAME function to access alist values using ASSOC-FUN."
|
||||
`(defun ,name (alist &rest keys)
|
||||
,(format "Return value from ALIST by KEYS using `%s'.
|
||||
ALIST is alist of alists of alists ... which can be consecutively
|
||||
accessed with KEYS."
|
||||
assoc-fun)
|
||||
(if (or (null alist) (null keys))
|
||||
alist
|
||||
(apply #',name
|
||||
(cdr (,assoc-fun (car keys) alist))
|
||||
(cdr keys)))))
|
||||
|
||||
(bui-define-alist-accessor bui-assq-value assq)
|
||||
(bui-define-alist-accessor bui-assoc-value assoc)
|
||||
|
||||
|
||||
;;; Misc
|
||||
|
||||
(defun bui-fill-column ()
|
||||
"Return fill column for the current window."
|
||||
(min (window-width) fill-column))
|
||||
|
||||
(defun bui-filter (list &rest predicates)
|
||||
"Apply PREDICATES to all elements from LIST.
|
||||
Return a list of elements which satisfy all the PREDICATES."
|
||||
(if (null predicates)
|
||||
list
|
||||
(-filter (lambda (element)
|
||||
(--every? (funcall it element) predicates))
|
||||
list)))
|
||||
|
||||
(defun bui-copy-as-kill (string &optional no-message?)
|
||||
"Put STRING into `kill-ring'.
|
||||
If NO-MESSAGE? is non-nil, do not display a message about it."
|
||||
(kill-new string)
|
||||
(unless no-message?
|
||||
(message "'%s' has been added to the kill ring." string)))
|
||||
|
||||
(defmacro bui-define-groups (name &rest args)
|
||||
"Define `NAME' and `NAME-faces' customization groups.
|
||||
NAME should be a symbol.
|
||||
|
||||
Remaining arguments (ARGS) should have a form [KEYWORD VALUE] ...
|
||||
|
||||
Optional keywords:
|
||||
|
||||
- `:parent-group' - name of a parent custom group.
|
||||
|
||||
- `:parent-faces-group' - name of a parent custom faces group.
|
||||
|
||||
- `:group-doc' - docstring of the `NAME' group.
|
||||
|
||||
- `:faces-group-doc' - docstring of the `NAME-faces' group."
|
||||
(declare (indent 1))
|
||||
(let* ((name-str (symbol-name name))
|
||||
(faces-name (intern (concat name-str "-faces"))))
|
||||
(bui-plist-let args
|
||||
((parent-group :parent-group 'bui)
|
||||
(parent-faces-group :parent-faces-group 'bui-faces)
|
||||
(group-doc :group-doc
|
||||
(format "Settings for '%s' buffers."
|
||||
name-str))
|
||||
(faces-group-doc :faces-group-doc
|
||||
(format "Faces for '%s' buffers."
|
||||
name-str)))
|
||||
`(progn
|
||||
(defgroup ,name nil
|
||||
,group-doc
|
||||
:group ',parent-group)
|
||||
(defgroup ,faces-name nil
|
||||
,faces-group-doc
|
||||
:group ',name
|
||||
:group ',parent-faces-group)))))
|
||||
|
||||
(cl-defun bui-inherit-defvar-clause (symbol parent &key group
|
||||
(value nil value-bound?))
|
||||
"Return `defvar' clause for SYMBOL inheriting it from PARENT symbol.
|
||||
Take docstring and value (unless VALUE is specified) from PARENT.
|
||||
If custom GROUP is non-nil and PARENT symbol has custom type,
|
||||
return `defcustom' clause instead."
|
||||
(let* ((val (if value-bound?
|
||||
value
|
||||
(symbol-value parent)))
|
||||
(val-null? (and value-bound? (null value)))
|
||||
(doc (documentation-property parent 'variable-documentation))
|
||||
(doc (if val-null?
|
||||
(concat doc (format "\nIf nil, use `%S'." parent))
|
||||
doc))
|
||||
(type (and group (get parent 'custom-type)))
|
||||
(type (if (and val-null?
|
||||
type
|
||||
(not (eq type 'boolean)))
|
||||
`(choice ,type (const nil))
|
||||
type)))
|
||||
(if type
|
||||
`(defcustom ,symbol ,val ,doc
|
||||
:type ',type
|
||||
:group ',group)
|
||||
`(defvar ,symbol ,val ,doc))))
|
||||
|
||||
(defun bui-apply-interactive (function)
|
||||
"Call the interactive form of FUNCTION to (partially) apply arguments.
|
||||
Return FUNCTION, if it has no `interactive' form. Otherwise,
|
||||
return a new function that does the same as FUNCTION, except its
|
||||
arguments are fixed to the values obtained interactively during
|
||||
this FUNCTION call.
|
||||
|
||||
Any `<>' symbols returned by the `interactive' form of FUNCTION will be
|
||||
used as the place holders for arguments of the returned function.
|
||||
Also, if the `interactive' form returns a '&rest symbol, this will
|
||||
be used in the arglist of the returned function.
|
||||
|
||||
For example, the following call:
|
||||
|
||||
(bui-apply-interactive
|
||||
(lambda (x y &rest z)
|
||||
(interactive (list (read-number \"Factor: \")
|
||||
'<> '&rest '<>))
|
||||
(* x (apply '+ y z))))
|
||||
|
||||
will prompt for a number, x, and return a function that takes any
|
||||
number of arguments, adds them together and multiplies the result
|
||||
by x."
|
||||
(let ((interact (interactive-form function)))
|
||||
(if interact
|
||||
(let* ((args (eval `(call-interactively
|
||||
(lambda (&rest args) ,interact args))))
|
||||
(args2 (mapcar (lambda (x) (if (eq x '<>) (gensym) x))
|
||||
(cl-remove-if-not
|
||||
(lambda (y) (memq y '(<> &rest)))
|
||||
args)))
|
||||
(args3 (remove '&rest args))
|
||||
(args4 (remove '&rest args2))
|
||||
(restp (memq '&rest args2)))
|
||||
;; Use `eval' rather than `macroexpand' so that the function
|
||||
;; can be called with `funcall'.
|
||||
(eval `(lambda ,args2
|
||||
(,@(if restp `(apply ,function) `(,function))
|
||||
,@(mapcar
|
||||
(lambda (x) (if (eq x '<>) (pop args4)
|
||||
(if (or (symbolp x) (listp x))
|
||||
(list 'quote x)
|
||||
x)))
|
||||
args3)))))
|
||||
function)))
|
||||
|
||||
(provide 'bui-utils)
|
||||
|
||||
;;; bui-utils.el ends here
|
||||
Binary file not shown.
|
|
@ -1,180 +0,0 @@
|
|||
;;; bui.el --- Buffer interface library -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright © 2014-2018 Alex Kost <alezost@gmail.com>
|
||||
|
||||
;; Author: Alex Kost <alezost@gmail.com>
|
||||
;; Package-Version: 20210108.1141
|
||||
;; Package-Revision: ab62fcefc3c7
|
||||
;; URL: https://github.com/alezost/bui.el
|
||||
;; Keywords: tools
|
||||
;; Package-Requires: ((emacs "24.3") (dash "2.11.0"))
|
||||
|
||||
;; 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; BUI (Buffer User Interface) is a library for making 'list' (similar
|
||||
;; to "M-x list-packages") and 'info' (similar to customization buffers)
|
||||
;; interfaces to display various data (packages, buffers, functions,
|
||||
;; etc.).
|
||||
;;
|
||||
;; It is not an end-user package, it is a library that is intended to be
|
||||
;; used by other packages.
|
||||
;;
|
||||
;; Basically, at first you define 'list'/'info' interface using
|
||||
;; `bui-define-interface' macro, and then you can make user commands
|
||||
;; that will display entries using `bui-get-display-entries' and similar
|
||||
;; functions.
|
||||
;;
|
||||
;; See README at <https://github.com/alezost/bui.el> for more details.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'cl-lib)
|
||||
|
||||
;; Require all features, so a package maker can require only `bui'.
|
||||
(require 'bui-button)
|
||||
(require 'bui-core)
|
||||
(require 'bui-entry)
|
||||
(require 'bui-info)
|
||||
(require 'bui-list)
|
||||
(require 'bui-utils)
|
||||
|
||||
(defmacro bui-define-entry-type (entry-type &rest args)
|
||||
"Define variables for ENTRY-TYPE.
|
||||
ARGS can be the same arguments as for `bui-define-interface'.
|
||||
The difference is: arguments for `bui-define-interface' define
|
||||
specific variables for different buffer types, while this macro
|
||||
defines general variables used for any buffer type."
|
||||
(declare (indent 1))
|
||||
(bui-plist-let args
|
||||
((reduced? :reduced?))
|
||||
`(progn
|
||||
,@(bui-map-symbol-specifications
|
||||
(lambda (key suffix generate)
|
||||
(let ((val (plist-get %foreign-args key)))
|
||||
(when (or val (bui-symbol-generate? generate reduced?))
|
||||
(bui-inherit-defvar-clause
|
||||
(bui-entry-symbol entry-type suffix)
|
||||
(bui-make-symbol 'bui suffix)
|
||||
:value val
|
||||
:group entry-type))))
|
||||
bui-entry-symbol-specifications)
|
||||
|
||||
,@(bui-map-symbol-specifications
|
||||
(lambda (key suffix _generate)
|
||||
(let ((val (plist-get %foreign-args key)))
|
||||
(when val
|
||||
(bui-inherit-defvar-clause
|
||||
(bui-entry-symbol entry-type suffix)
|
||||
(bui-make-symbol 'bui suffix)
|
||||
:value val
|
||||
:group entry-type))))
|
||||
bui-symbol-specifications))))
|
||||
|
||||
(defmacro bui-define-interface (entry-type buffer-type &rest args)
|
||||
"Define BUFFER-TYPE interface for displaying ENTRY-TYPE entries.
|
||||
Remaining arguments ARGS should have a form [KEYWORD VALUE] ...
|
||||
They are used to generate variables specific for the defined
|
||||
interface. For more details and the available keywords, see
|
||||
`bui-symbol-specifications', `bui-entry-symbol-specifications'
|
||||
and `bui-BUFFER-TYPE-symbol-specifications'.
|
||||
|
||||
`:get-entries-function' is the only required keyword (if the
|
||||
interface is reduced, all keywords become optional).
|
||||
|
||||
To denote that the interface is reduced, a special `:reduced?'
|
||||
keyword may be specified. If it is non-nil, generate only
|
||||
customization group, faces group and specified variables. If it
|
||||
is nil, along with the mentioned groups and variables,
|
||||
`ENTRY-TYPE-BUFFER-TYPE-mode' will be generated."
|
||||
(declare (indent 2))
|
||||
(cl-flet ((name (&rest symbols)
|
||||
(apply #'bui-symbol entry-type buffer-type symbols))
|
||||
(bui-name (&rest symbols)
|
||||
(apply #'bui-make-symbol 'bui symbols)))
|
||||
(let ((group (name))
|
||||
(faces-group (name 'faces))
|
||||
(mode (name 'mode))
|
||||
(mode-map (name 'mode-map))
|
||||
(bui-buffer-type (bui-name buffer-type))
|
||||
(symbol-fun (bui-name buffer-type 'symbol))
|
||||
(symbol-specs (bui-name buffer-type 'symbol-specifications))
|
||||
(parent-mode (bui-name buffer-type 'mode)))
|
||||
(bui-plist-let args
|
||||
((mode-name :mode-name (capitalize (symbol-name group)))
|
||||
(reduced? :reduced?))
|
||||
`(progn
|
||||
(defgroup ,group nil
|
||||
,(format "Displaying '%S' entries in '%S' buffer."
|
||||
entry-type buffer-type)
|
||||
:group ',entry-type
|
||||
:group ',bui-buffer-type)
|
||||
|
||||
(defgroup ,faces-group nil
|
||||
,(format "Faces for displaying '%S' entries in '%S' buffer."
|
||||
entry-type buffer-type)
|
||||
:group ',group
|
||||
:group ',(bui-entry-symbol entry-type 'faces)
|
||||
:group ',(bui-name buffer-type 'faces))
|
||||
|
||||
,@(bui-map-symbol-specifications
|
||||
(lambda (key suffix generate)
|
||||
(let ((val (plist-get %foreign-args key)))
|
||||
(when (or val (bui-symbol-generate? generate reduced?))
|
||||
(bui-inherit-defvar-clause
|
||||
(name suffix)
|
||||
(bui-name suffix)
|
||||
:value val
|
||||
:group group))))
|
||||
bui-symbol-specifications)
|
||||
|
||||
,@(bui-map-symbol-specifications
|
||||
(lambda (key suffix _generate)
|
||||
(let ((val (plist-get %foreign-args key)))
|
||||
(when val
|
||||
(bui-inherit-defvar-clause
|
||||
(name suffix)
|
||||
(bui-name suffix)
|
||||
:value val
|
||||
:group group))))
|
||||
bui-entry-symbol-specifications)
|
||||
|
||||
,@(bui-map-symbol-specifications
|
||||
(lambda (key suffix generate)
|
||||
(let ((val (plist-get args key)))
|
||||
(when (or val (bui-symbol-generate? generate reduced?))
|
||||
(bui-inherit-defvar-clause
|
||||
(funcall symbol-fun entry-type suffix)
|
||||
(bui-name buffer-type suffix)
|
||||
:value val
|
||||
:group group))))
|
||||
(symbol-value symbol-specs))
|
||||
|
||||
,(unless reduced?
|
||||
`(define-derived-mode ,mode ,parent-mode
|
||||
'(,mode-name (bui-active-filter-predicates
|
||||
bui-filter-mode-line-string))
|
||||
,(format "\
|
||||
Major mode for displaying '%S' entries in '%S' buffer.
|
||||
|
||||
\\{%S}"
|
||||
entry-type buffer-type mode-map)
|
||||
(bui-mode-initialize ',entry-type ',buffer-type)))
|
||||
|
||||
(bui-register-interface ',entry-type ',buffer-type))))))
|
||||
|
||||
(provide 'bui)
|
||||
|
||||
;;; bui.el ends here
|
||||
Binary file not shown.
|
|
@ -1,32 +0,0 @@
|
|||
;;; cfrs-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*-
|
||||
;; Generated by the `loaddefs-generate' function.
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path)))
|
||||
|
||||
|
||||
|
||||
;;; Generated autoloads from cfrs.el
|
||||
|
||||
(autoload 'cfrs-read "cfrs" "\
|
||||
Read a string using a pos-frame with given PROMPT and INITIAL-INPUT.
|
||||
|
||||
(fn PROMPT &optional INITIAL-INPUT)")
|
||||
(register-definition-prefixes "cfrs" '("cfrs-"))
|
||||
|
||||
;;; End of scraped data
|
||||
|
||||
(provide 'cfrs-autoloads)
|
||||
|
||||
;; Local Variables:
|
||||
;; version-control: never
|
||||
;; no-byte-compile: t
|
||||
;; no-update-autoloads: t
|
||||
;; no-native-compile: t
|
||||
;; coding: utf-8-emacs-unix
|
||||
;; End:
|
||||
|
||||
;;; cfrs-autoloads.el ends here
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
;; -*- no-byte-compile: t; lexical-binding: nil -*-
|
||||
(define-package "cfrs" "20220129.1149"
|
||||
"Child-frame based read-string."
|
||||
'((emacs "26.1")
|
||||
(dash "2.11.0")
|
||||
(s "1.10.0")
|
||||
(posframe "0.6.0"))
|
||||
:url "https://github.com/Alexander-Miller/cfrs"
|
||||
:commit "f3a21f237b2a54e6b9f8a420a9da42b4f0a63121"
|
||||
:revdesc "f3a21f237b2a"
|
||||
:authors '(("Alexander Miller" . "alexanderm@web.de"))
|
||||
:maintainers '(("Alexander Miller" . "alexanderm@web.de")))
|
||||
|
|
@ -1,180 +0,0 @@
|
|||
;;; cfrs.el --- Child-frame based read-string -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2021 Alexander Miller
|
||||
|
||||
;; Author: Alexander Miller <alexanderm@web.de>
|
||||
;; Package-Requires: ((emacs "26.1") (dash "2.11.0") (s "1.10.0") (posframe "0.6.0"))
|
||||
;; Package-Version: 20220129.1149
|
||||
;; Package-Revision: f3a21f237b2a
|
||||
;; Homepage: https://github.com/Alexander-Miller/cfrs
|
||||
|
||||
;; 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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
;;; Simple implementation of reading a string with child-frames.
|
||||
;;; Synchronous control is maintained by using `recursive-edit'. When finished
|
||||
;;; the entered text is read from the input buffer and the child-frame is
|
||||
;;; hidden.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 's)
|
||||
(require 'dash)
|
||||
(require 'posframe)
|
||||
|
||||
(defgroup cfrs nil
|
||||
"Cfrs configuration options."
|
||||
:group 'cfrs
|
||||
:prefix "cfrs-")
|
||||
|
||||
(defcustom cfrs-frame-parameters nil
|
||||
"Alist of parameters for cfrs' child frames.
|
||||
Can be used to override useful parameters like `internal-border-width' or
|
||||
`background-color' for better frame visibility."
|
||||
:type '(alist :key-type symbol)
|
||||
:group 'cfrs)
|
||||
|
||||
(defcustom cfrs-max-width 80
|
||||
"The maximum width of the cfrs input field.
|
||||
cfrs will try to extend its initial width to fit both the prompt and the initial
|
||||
input, up to a maximum of `cfrs-max-width' characters. For any combination
|
||||
longer than this horizontal scrolling will be necessary.
|
||||
|
||||
See also `cfrs-min-width'"
|
||||
:type 'integer
|
||||
:group 'cfrs)
|
||||
|
||||
(defcustom cfrs-min-width 40
|
||||
"The minimum width of the cfrs input field.
|
||||
cfrs will never be smaller than `cfrs-min-width' characters regardless of the
|
||||
length of the prompt and initial input.
|
||||
|
||||
See also `cfrs-max-width'"
|
||||
:type 'integer
|
||||
:group 'cfrs)
|
||||
|
||||
(defface cfrs-border-color
|
||||
`((t :inherit internal-border))
|
||||
"The face for the border of the cfrs popup frame.
|
||||
Only the `:background' part is used."
|
||||
:group 'cfrs)
|
||||
|
||||
;;;###autoload
|
||||
(defun cfrs-read (prompt &optional initial-input)
|
||||
"Read a string using a pos-frame with given PROMPT and INITIAL-INPUT."
|
||||
(if (not (or (display-graphic-p)
|
||||
(not (fboundp #'display-buffer-in-side-window))))
|
||||
(read-string prompt initial-input)
|
||||
(let* ((buffer (get-buffer-create " *Pos-Frame-Read*"))
|
||||
(border-color (face-attribute 'cfrs-border-color :background nil t))
|
||||
(cursor (cfrs--determine-cursor-type))
|
||||
(width (+ 2 ;; extra space for margin and cursor
|
||||
(min cfrs-max-width
|
||||
(max cfrs-min-width
|
||||
(+ (length prompt)
|
||||
(if initial-input (length initial-input) 0))))))
|
||||
(frame (posframe-show
|
||||
buffer
|
||||
:min-height 1
|
||||
:min-width width
|
||||
:internal-border-width 2
|
||||
:internal-border-color border-color
|
||||
:string ""
|
||||
:accept-focus t
|
||||
:override-parameters `(,@cfrs-frame-parameters
|
||||
(cursor-type . ,cursor)))))
|
||||
(with-selected-frame frame
|
||||
(select-frame frame)
|
||||
(x-focus-frame frame)
|
||||
(add-hook 'delete-frame-functions #'cfrs--on-frame-kill nil :local)
|
||||
(with-current-buffer buffer
|
||||
(cfrs-input-mode)
|
||||
(-each (overlays-in (point-min) (point-max)) #'delete-overlay)
|
||||
(erase-buffer)
|
||||
(-doto (make-overlay 1 2)
|
||||
(overlay-put
|
||||
'before-string
|
||||
(propertize (concat " " prompt) 'face 'minibuffer-prompt))
|
||||
(overlay-put 'rear-nonsticky t)
|
||||
(overlay-put 'read-only t))
|
||||
(when initial-input
|
||||
(insert initial-input))
|
||||
(when (and (bound-and-true-p evil-mode)
|
||||
(fboundp 'evil-insert-state))
|
||||
(evil-insert-state nil))
|
||||
(end-of-line)
|
||||
(recursive-edit)
|
||||
(cfrs--hide)
|
||||
(s-trim (buffer-string)))))))
|
||||
|
||||
(defun cfrs--determine-cursor-type ()
|
||||
"Determine the cursor type for the popup frame.
|
||||
Prevents showing an invisible cursor with a height or width of 0."
|
||||
(let ((ct (if (memq cursor-type '(t nil))
|
||||
(frame-parameter (selected-frame) 'cursor-type)
|
||||
cursor-type)))
|
||||
(pcase ct
|
||||
(`(,_ . 0) ct)
|
||||
(`nil 'hbar)
|
||||
(_ ct))))
|
||||
|
||||
(defun cfrs--hide ()
|
||||
"Hide the current cfrs frame."
|
||||
(when (eq major-mode 'cfrs-input-mode)
|
||||
(posframe-hide (current-buffer))
|
||||
(x-focus-frame (frame-parent (selected-frame)))))
|
||||
|
||||
(defun cfrs--adjust-height ()
|
||||
"Adjust input frame's height to the number of lines in the buffer."
|
||||
(set-frame-height (selected-frame) (count-lines (point-min) (point-max))))
|
||||
|
||||
(defun cfrs--on-frame-kill (frame)
|
||||
"Redirect focus after FRAME is killed."
|
||||
(-let [parent (or (frame-parent frame) (selected-frame))]
|
||||
(x-focus-frame parent)))
|
||||
|
||||
(defun cfrs-finish ()
|
||||
"Finish the cfrs read, returning the entered string."
|
||||
(interactive)
|
||||
;; XXX: workaround for persp believing we are in a different frame
|
||||
;; and need a new perspective when the recursive edit ends
|
||||
(set-frame-parameter (selected-frame) 'persp--recursive nil)
|
||||
(exit-recursive-edit))
|
||||
|
||||
(defun cfrs-cancel ()
|
||||
"Cancel the `cfrs-read' call and the function that called it."
|
||||
(interactive)
|
||||
(cfrs--hide)
|
||||
(abort-recursive-edit))
|
||||
|
||||
(defvar cfrs-input-mode-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(define-key map (kbd "C-c C-c") #'cfrs-finish)
|
||||
(define-key map [return] #'cfrs-finish)
|
||||
(define-key map [remap keyboard-quit] #'cfrs-cancel)
|
||||
map))
|
||||
|
||||
(define-derived-mode cfrs-input-mode fundamental-mode "Child Frame Read String"
|
||||
"Simple mode for buffers displayed in cfrs's input frames."
|
||||
(add-hook 'post-command-hook #'cfrs--adjust-height nil :local)
|
||||
(display-line-numbers-mode -1))
|
||||
|
||||
;; https://github.com/Alexander-Miller/treemacs/issues/775
|
||||
(with-eval-after-load 'beacon
|
||||
(with-no-warnings
|
||||
(add-to-list 'beacon-dont-blink-major-modes 'cfrs-input-mode)))
|
||||
|
||||
(provide 'cfrs)
|
||||
|
||||
;;; cfrs.el ends here
|
||||
Binary file not shown.
|
|
@ -1,54 +0,0 @@
|
|||
;;; company-abbrev.el --- company-mode completion backend for abbrev -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2015, 2021, 2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'cl-lib)
|
||||
(require 'abbrev)
|
||||
|
||||
(defun company-abbrev-insert (_match)
|
||||
"Replace MATCH with the expanded abbrev."
|
||||
(expand-abbrev))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-abbrev (command &optional arg &rest _ignored)
|
||||
"`company-mode' completion backend for abbrev."
|
||||
(interactive (list 'interactive))
|
||||
(cl-case command
|
||||
(interactive (company-begin-backend 'company-abbrev
|
||||
'company-abbrev-insert))
|
||||
(prefix (company-grab-symbol))
|
||||
(candidates (apply
|
||||
#'nconc
|
||||
(mapcar (lambda (table)
|
||||
(delete "" (all-completions arg table)))
|
||||
(abbrev--active-tables))))
|
||||
(kind 'snippet)
|
||||
(meta (abbrev-expansion arg))
|
||||
(post-completion (expand-abbrev))))
|
||||
|
||||
(provide 'company-abbrev)
|
||||
;;; company-abbrev.el ends here
|
||||
Binary file not shown.
|
|
@ -1,324 +0,0 @@
|
|||
;;; company-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*-
|
||||
;; Generated by the `loaddefs-generate' function.
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path)))
|
||||
|
||||
|
||||
|
||||
;;; Generated autoloads from company.el
|
||||
|
||||
(autoload 'company-mode "company" "\
|
||||
\"complete anything\"; is an in-buffer completion framework.
|
||||
|
||||
Completion starts automatically, depending on the values
|
||||
`company-idle-delay' and `company-minimum-prefix-length'.
|
||||
|
||||
Completion can be controlled with the commands:
|
||||
`company-complete-common', `company-complete-selection', `company-complete',
|
||||
`company-select-next', `company-select-previous'. If these commands are
|
||||
called before `company-idle-delay', completion will also start.
|
||||
|
||||
Completions can be searched with `company-search-candidates' or
|
||||
`company-filter-candidates'. These can be used while completion is
|
||||
inactive, as well.
|
||||
|
||||
The completion data is retrieved using `company-backends' and displayed
|
||||
using `company-frontends'. If you want to start a specific backend, call
|
||||
it interactively or use `company-begin-backend'.
|
||||
|
||||
By default, the completions list is sorted alphabetically, unless the
|
||||
backend chooses otherwise, or `company-transformers' changes it later.
|
||||
|
||||
regular keymap (`company-mode-map'):
|
||||
|
||||
\\{company-mode-map}
|
||||
keymap during active completions (`company-active-map'):
|
||||
|
||||
\\{company-active-map}
|
||||
|
||||
This is a minor mode. If called interactively, toggle the `Company
|
||||
mode' mode. If the prefix argument is positive, enable the mode, and if
|
||||
it is zero or negative, disable the mode.
|
||||
|
||||
If called from Lisp, toggle the mode if ARG is `toggle'. Enable the
|
||||
mode if ARG is nil, omitted, or is a positive number. Disable the mode
|
||||
if ARG is a negative number.
|
||||
|
||||
To check whether the minor mode is enabled in the current buffer,
|
||||
evaluate the variable `company-mode'.
|
||||
|
||||
The mode's hook is called both when the mode is enabled and when it is
|
||||
disabled.
|
||||
|
||||
(fn &optional ARG)" t)
|
||||
(put 'global-company-mode 'globalized-minor-mode t)
|
||||
(defvar global-company-mode nil "\
|
||||
Non-nil if Global Company mode is enabled.
|
||||
See the `global-company-mode' command
|
||||
for a description of this minor mode.
|
||||
Setting this variable directly does not take effect;
|
||||
either customize it (see the info node `Easy Customization')
|
||||
or call the function `global-company-mode'.")
|
||||
(custom-autoload 'global-company-mode "company" nil)
|
||||
(autoload 'global-company-mode "company" "\
|
||||
Toggle Company mode in all buffers.
|
||||
With prefix ARG, enable Global Company mode if ARG is positive;
|
||||
otherwise, disable it.
|
||||
|
||||
If called from Lisp, toggle the mode if ARG is `toggle'.
|
||||
Enable the mode if ARG is nil, omitted, or is a positive number.
|
||||
Disable the mode if ARG is a negative number.
|
||||
|
||||
Company mode is enabled in all buffers where `company-mode-on' would
|
||||
do it.
|
||||
|
||||
See `company-mode' for more information on Company mode.
|
||||
|
||||
(fn &optional ARG)" t)
|
||||
(autoload 'company-manual-begin "company" "\
|
||||
Start the completion interface.
|
||||
|
||||
Unlike `company-complete-selection' or `company-complete', this command
|
||||
doesn't cause any immediate changes to the buffer text." t)
|
||||
(autoload 'company-complete "company" "\
|
||||
Insert the common part of all candidates or the current selection.
|
||||
The first time this is called, the common part is inserted, the second
|
||||
time, or when the selection has been changed, the selected candidate is
|
||||
inserted." t)
|
||||
(register-definition-prefixes "company" '("company-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-abbrev.el
|
||||
|
||||
(autoload 'company-abbrev "company-abbrev" "\
|
||||
`company-mode' completion backend for abbrev.
|
||||
|
||||
(fn COMMAND &optional ARG &rest IGNORED)" t)
|
||||
(register-definition-prefixes "company-abbrev" '("company-abbrev-insert"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-bbdb.el
|
||||
|
||||
(autoload 'company-bbdb "company-bbdb" "\
|
||||
`company-mode' completion backend for BBDB.
|
||||
|
||||
(fn COMMAND &optional ARG &rest IGNORE)" t)
|
||||
(register-definition-prefixes "company-bbdb" '("company-bbdb-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-capf.el
|
||||
|
||||
(register-definition-prefixes "company-capf" '("company-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-clang.el
|
||||
|
||||
(register-definition-prefixes "company-clang" '("company-clang"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-cmake.el
|
||||
|
||||
(register-definition-prefixes "company-cmake" '("company-cmake"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-css.el
|
||||
|
||||
(autoload 'company-css "company-css" "\
|
||||
`company-mode' completion backend for `css-mode'.
|
||||
|
||||
(fn COMMAND &optional ARG &rest IGNORED)" t)
|
||||
(register-definition-prefixes "company-css" '("company-css-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-dabbrev.el
|
||||
|
||||
(autoload 'company-dabbrev "company-dabbrev" "\
|
||||
dabbrev-like `company-mode' completion backend.
|
||||
|
||||
(fn COMMAND &optional ARG &rest IGNORED)" t)
|
||||
(register-definition-prefixes "company-dabbrev" '("company-dabbrev-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-dabbrev-code.el
|
||||
|
||||
(autoload 'company-dabbrev-code "company-dabbrev-code" "\
|
||||
dabbrev-like `company-mode' backend for code.
|
||||
The backend looks for all symbols in the current buffer that aren't in
|
||||
comments or strings.
|
||||
|
||||
(fn COMMAND &optional ARG &rest REST)" t)
|
||||
(register-definition-prefixes "company-dabbrev-code" '("company-dabbrev-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-etags.el
|
||||
|
||||
(autoload 'company-etags "company-etags" "\
|
||||
`company-mode' completion backend for etags.
|
||||
|
||||
(fn COMMAND &optional ARG &rest REST)" t)
|
||||
(register-definition-prefixes "company-etags" '("company-etags-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-files.el
|
||||
|
||||
(autoload 'company-files "company-files" "\
|
||||
`company-mode' completion backend existing file names.
|
||||
Completions works for proper absolute and relative files paths.
|
||||
File paths with spaces are only supported inside strings.
|
||||
|
||||
(fn COMMAND &optional ARG &rest REST)" t)
|
||||
(register-definition-prefixes "company-files" '("company-file"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-gtags.el
|
||||
|
||||
(autoload 'company-gtags "company-gtags" "\
|
||||
`company-mode' completion backend for GNU Global.
|
||||
|
||||
(fn COMMAND &optional ARG &rest IGNORED)" t)
|
||||
(register-definition-prefixes "company-gtags" '("company-gtags-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-ispell.el
|
||||
|
||||
(autoload 'company-ispell "company-ispell" "\
|
||||
`company-mode' completion backend using Ispell.
|
||||
|
||||
(fn COMMAND &optional ARG &rest IGNORED)" t)
|
||||
(register-definition-prefixes "company-ispell" '("company-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-keywords.el
|
||||
|
||||
(autoload 'company-keywords "company-keywords" "\
|
||||
`company-mode' backend for programming language keywords.
|
||||
|
||||
(fn COMMAND &optional ARG &rest IGNORED)" t)
|
||||
(register-definition-prefixes "company-keywords" '("company-keywords-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-nxml.el
|
||||
|
||||
(autoload 'company-nxml "company-nxml" "\
|
||||
`company-mode' completion backend for `nxml-mode'.
|
||||
|
||||
(fn COMMAND &optional ARG &rest IGNORED)" t)
|
||||
(register-definition-prefixes "company-nxml" '("company-nxml-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-oddmuse.el
|
||||
|
||||
(autoload 'company-oddmuse "company-oddmuse" "\
|
||||
`company-mode' completion backend for `oddmuse-mode'.
|
||||
|
||||
(fn COMMAND &optional ARG &rest IGNORED)" t)
|
||||
(register-definition-prefixes "company-oddmuse" '("company-oddmuse-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-semantic.el
|
||||
|
||||
(autoload 'company-semantic "company-semantic" "\
|
||||
`company-mode' completion backend using CEDET Semantic.
|
||||
|
||||
(fn COMMAND &optional ARG &rest IGNORED)" t)
|
||||
(register-definition-prefixes "company-semantic" '("company-semantic-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-template.el
|
||||
|
||||
(register-definition-prefixes "company-template" '("company-template-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-tempo.el
|
||||
|
||||
(autoload 'company-tempo "company-tempo" "\
|
||||
`company-mode' completion backend for tempo.
|
||||
|
||||
(fn COMMAND &optional ARG &rest IGNORED)" t)
|
||||
(register-definition-prefixes "company-tempo" '("company-tempo-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-tng.el
|
||||
|
||||
(autoload 'company-tng-frontend "company-tng" "\
|
||||
When the user changes the selection at least once, this
|
||||
frontend will display the candidate in the buffer as if it's
|
||||
already there and any key outside of `company-active-map' will
|
||||
confirm the selection and finish the completion.
|
||||
|
||||
(fn COMMAND)")
|
||||
(define-obsolete-function-alias 'company-tng-configure-default 'company-tng-mode "0.10.0" "Applies the default configuration to enable company-tng.")
|
||||
(defvar company-tng-mode nil "\
|
||||
Non-nil if Company-Tng mode is enabled.
|
||||
See the `company-tng-mode' command
|
||||
for a description of this minor mode.
|
||||
Setting this variable directly does not take effect;
|
||||
either customize it (see the info node `Easy Customization')
|
||||
or call the function `company-tng-mode'.")
|
||||
(custom-autoload 'company-tng-mode "company-tng" nil)
|
||||
(autoload 'company-tng-mode "company-tng" "\
|
||||
This minor mode enables `company-tng-frontend'.
|
||||
|
||||
This is a global minor mode. If called interactively, toggle the
|
||||
`Company-Tng mode' mode. If the prefix argument is positive, enable the
|
||||
mode, and if it is zero or negative, disable the mode.
|
||||
|
||||
If called from Lisp, toggle the mode if ARG is `toggle'. Enable the
|
||||
mode if ARG is nil, omitted, or is a positive number. Disable the mode
|
||||
if ARG is a negative number.
|
||||
|
||||
To check whether the minor mode is enabled in the current buffer,
|
||||
evaluate `(default-value \\='company-tng-mode)'.
|
||||
|
||||
The mode's hook is called both when the mode is enabled and when it is
|
||||
disabled.
|
||||
|
||||
(fn &optional ARG)" t)
|
||||
(register-definition-prefixes "company-tng" '("company-tng-"))
|
||||
|
||||
|
||||
;;; Generated autoloads from company-yasnippet.el
|
||||
|
||||
(autoload 'company-yasnippet "company-yasnippet" "\
|
||||
`company-mode' backend for `yasnippet'.
|
||||
|
||||
This backend should be used with care, because as long as there are
|
||||
snippets defined for the current major mode, this backend will always
|
||||
shadow backends that come after it. Recommended usages:
|
||||
|
||||
* In a buffer-local value of `company-backends', grouped with a backend or
|
||||
several that provide actual text completions.
|
||||
|
||||
(add-hook \\='js-mode-hook
|
||||
(lambda ()
|
||||
(set (make-local-variable \\='company-backends)
|
||||
\\='((company-dabbrev-code company-yasnippet)))))
|
||||
|
||||
* After keyword `:with', grouped with other backends.
|
||||
|
||||
(push \\='(company-semantic :with company-yasnippet) company-backends)
|
||||
|
||||
* Not in `company-backends', just bound to a key.
|
||||
|
||||
(global-set-key (kbd \"C-c y\") \\='company-yasnippet)
|
||||
|
||||
(fn COMMAND &optional ARG &rest IGNORE)" t)
|
||||
(register-definition-prefixes "company-yasnippet" '("company-yasnippet-"))
|
||||
|
||||
;;; End of scraped data
|
||||
|
||||
(provide 'company-autoloads)
|
||||
|
||||
;; Local Variables:
|
||||
;; version-control: never
|
||||
;; no-byte-compile: t
|
||||
;; no-update-autoloads: t
|
||||
;; no-native-compile: t
|
||||
;; coding: utf-8-emacs-unix
|
||||
;; End:
|
||||
|
||||
;;; company-autoloads.el ends here
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
;;; company-bbdb.el --- company-mode completion backend for BBDB in message-mode -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2013-2016, 2020, 2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Jan Tatarik <jan.tatarik@gmail.com>
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
(require 'company)
|
||||
(require 'cl-lib)
|
||||
|
||||
(declare-function bbdb-record-get-field "bbdb")
|
||||
(declare-function bbdb-dwim-mail "bbdb-com")
|
||||
|
||||
(defgroup company-bbdb nil
|
||||
"Completion backend for BBDB."
|
||||
:group 'company)
|
||||
|
||||
(defcustom company-bbdb-modes '(message-mode)
|
||||
"Major modes in which `company-bbdb' may complete."
|
||||
:type '(repeat (symbol :tag "Major mode"))
|
||||
:package-version '(company . "0.8.8"))
|
||||
|
||||
(defun company-bbdb--candidates (arg)
|
||||
(cl-mapcan (lambda (record)
|
||||
(mapcar (lambda (mail) (bbdb-dwim-mail record mail))
|
||||
(bbdb-record-get-field record 'mail)))
|
||||
(eval `(let ((arg ,arg))
|
||||
(bbdb-search (bbdb-records) :all-names arg :mail arg))
|
||||
t)))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-bbdb (command &optional arg &rest _ignore)
|
||||
"`company-mode' completion backend for BBDB."
|
||||
(interactive (list 'interactive))
|
||||
(cl-case command
|
||||
(interactive (company-begin-backend 'company-bbdb))
|
||||
(prefix (and (memq major-mode company-bbdb-modes)
|
||||
(featurep 'bbdb-com)
|
||||
(let ((case-fold-search t))
|
||||
(looking-back
|
||||
"^\\([^ :]*-\\)?\\(To\\|B?Cc\\|From\\):.*? *\\([^,;]*\\)"
|
||||
(line-beginning-position)))
|
||||
(match-string-no-properties 3)))
|
||||
(candidates (company-bbdb--candidates arg))
|
||||
(sorted t)
|
||||
(no-cache t)))
|
||||
|
||||
(provide 'company-bbdb)
|
||||
;;; company-bbdb.el ends here
|
||||
Binary file not shown.
|
|
@ -1,258 +0,0 @@
|
|||
;;; company-capf.el --- company-mode completion-at-point-functions backend -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2013-2024 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; The CAPF back-end provides a bridge to the standard
|
||||
;; completion-at-point-functions facility, and thus can support any major mode
|
||||
;; that defines a proper completion function, including emacs-lisp-mode,
|
||||
;; css-mode and nxml-mode.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'cl-lib)
|
||||
|
||||
(defgroup company-capf nil
|
||||
"Completion backend as adapter for `completion-at-point-functions'."
|
||||
:group 'company)
|
||||
|
||||
(defcustom company-capf-disabled-functions '(tags-completion-at-point-function
|
||||
ispell-completion-at-point)
|
||||
"List of completion functions which should be ignored in this backend.
|
||||
|
||||
By default it contains the functions that duplicate the built-in backends
|
||||
but don't support the corresponding configuration options and/or alter the
|
||||
intended priority of the default backends' configuration."
|
||||
:type 'hook
|
||||
:package-version '(company . "1.0.0"))
|
||||
|
||||
;; Amortizes several calls to a c-a-p-f from the same position.
|
||||
(defvar company--capf-cache nil)
|
||||
|
||||
;; FIXME: Provide a way to save this info once in Company itself
|
||||
;; (https://github.com/company-mode/company-mode/pull/845).
|
||||
(defvar-local company-capf--current-completion-data nil
|
||||
"Value last returned by `company-capf' in response to `candidates'.
|
||||
For most properties/actions, this is just what we need: the exact values
|
||||
that accompanied the completion table that's currently is use.
|
||||
|
||||
`company-capf', however, could be called at some different positions during
|
||||
a completion session (most importantly, by `company-sort-by-occurrence'),
|
||||
so we can't just use the preceding variable instead.")
|
||||
|
||||
(defvar-local company-capf--current-completion-metadata nil
|
||||
"Metadata computed with the current prefix and data above.")
|
||||
|
||||
(defun company--capf-data ()
|
||||
(let ((cache company--capf-cache))
|
||||
(if (and (equal (current-buffer) (car cache))
|
||||
(equal (point) (car (setq cache (cdr cache))))
|
||||
(equal (buffer-chars-modified-tick) (car (setq cache (cdr cache)))))
|
||||
(cadr cache)
|
||||
(let ((data (company--capf-data-real)))
|
||||
(setq company--capf-cache
|
||||
(list (current-buffer) (point) (buffer-chars-modified-tick) data))
|
||||
data))))
|
||||
|
||||
(defun company--capf-data-real ()
|
||||
(let ((data (run-hook-wrapped 'completion-at-point-functions
|
||||
;; Ignore disabled and misbehaving functions.
|
||||
#'company--capf-wrapper 'optimist)))
|
||||
(when (and (consp (cdr data)) (integer-or-marker-p (nth 1 data))) data)))
|
||||
|
||||
(defun company--capf-wrapper (fun which)
|
||||
;; E.g. tags-completion-at-point-function subverts company-etags in the
|
||||
;; default value of company-backends, where the latter comes later.
|
||||
(unless (memq fun company-capf-disabled-functions)
|
||||
(let ((buffer-read-only t)
|
||||
(inhibit-read-only nil)
|
||||
(completion-in-region-function
|
||||
(lambda (beg end coll pred)
|
||||
(throw 'company--illegal-completion-in-region
|
||||
(list fun beg end coll :predicate pred)))))
|
||||
(catch 'company--illegal-completion-in-region
|
||||
(condition-case nil
|
||||
(completion--capf-wrapper fun which)
|
||||
(buffer-read-only nil))))))
|
||||
|
||||
(declare-function python-shell-get-process "python")
|
||||
|
||||
(defun company-capf--save-current-data (data metadata)
|
||||
(setq company-capf--current-completion-data data
|
||||
company-capf--current-completion-metadata metadata)
|
||||
(add-hook 'company-after-completion-hook
|
||||
#'company-capf--clear-current-data nil t))
|
||||
|
||||
(defun company-capf--clear-current-data (_ignored)
|
||||
(setq company-capf--current-completion-data nil
|
||||
company-capf--current-completion-metadata nil))
|
||||
|
||||
(defvar-local company-capf--sorted nil)
|
||||
(defvar-local company-capf--current-boundaries nil)
|
||||
|
||||
(defun company-capf (command &optional arg &rest rest)
|
||||
"`company-mode' backend using `completion-at-point-functions'."
|
||||
(interactive (list 'interactive))
|
||||
(pcase command
|
||||
(`interactive (company-begin-backend 'company-capf))
|
||||
(`prefix
|
||||
(company-capf--prefix))
|
||||
(`candidates
|
||||
(company-capf--candidates arg (car rest)))
|
||||
(`sorted
|
||||
company-capf--sorted)
|
||||
(`match
|
||||
;; Ask the for the `:company-match' function. If that doesn't help,
|
||||
;; fallback to sniffing for face changes to get a suitable value.
|
||||
(let ((f (or (plist-get (nthcdr 4 company-capf--current-completion-data)
|
||||
:company-match)
|
||||
#'company--match-from-capf-face)))
|
||||
(funcall f arg)))
|
||||
(`duplicates t)
|
||||
(`no-cache t) ;Not much can be done here, as long as we handle
|
||||
;non-prefix matches.
|
||||
(`meta
|
||||
(let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
|
||||
:company-docsig)))
|
||||
(when f (funcall f arg))))
|
||||
(`doc-buffer
|
||||
(let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
|
||||
:company-doc-buffer)))
|
||||
(when f (funcall f arg))))
|
||||
(`location
|
||||
(let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
|
||||
:company-location)))
|
||||
(when f (funcall f arg))))
|
||||
(`annotation
|
||||
(company-capf--annotation arg))
|
||||
(`kind
|
||||
(let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
|
||||
:company-kind)))
|
||||
(when f (funcall f arg))))
|
||||
(`deprecated
|
||||
(let ((f (plist-get (nthcdr 4 company-capf--current-completion-data)
|
||||
:company-deprecated)))
|
||||
(when f (funcall f arg))))
|
||||
(`require-match
|
||||
(plist-get (nthcdr 4 (company--capf-data)) :company-require-match))
|
||||
(`init nil) ;Don't bother: plenty of other ways to initialize the code.
|
||||
(`post-completion
|
||||
(company-capf--post-completion arg))
|
||||
(`adjust-boundaries
|
||||
(company--capf-boundaries
|
||||
company-capf--current-boundaries))
|
||||
(`expand-common
|
||||
(company-capf--expand-common arg (car rest)))
|
||||
))
|
||||
|
||||
(defun company-capf--prefix ()
|
||||
(let ((res (company--capf-data)))
|
||||
(when res
|
||||
(let ((length (plist-get (nthcdr 4 res) :company-prefix-length))
|
||||
(prefix (buffer-substring-no-properties (nth 1 res) (point)))
|
||||
(suffix (buffer-substring-no-properties (point) (nth 2 res))))
|
||||
(list prefix suffix length)))))
|
||||
|
||||
(defun company-capf--expand-common (prefix suffix)
|
||||
(let* ((data company-capf--current-completion-data)
|
||||
(table (nth 3 data))
|
||||
(pred (plist-get (nthcdr 4 data) :predicate)))
|
||||
(company--capf-expand-common prefix suffix table pred
|
||||
company-capf--current-completion-metadata)))
|
||||
|
||||
(defun company-capf--annotation (arg)
|
||||
(let* ((f (or (plist-get (nthcdr 4 company-capf--current-completion-data)
|
||||
:annotation-function)
|
||||
;; FIXME: Add a test.
|
||||
(cdr (assq 'annotation-function
|
||||
company-capf--current-completion-metadata))))
|
||||
(annotation (when f (funcall f arg))))
|
||||
(if (and company-format-margin-function
|
||||
(equal annotation " <f>") ; elisp-completion-at-point, pre-icons
|
||||
(plist-get (nthcdr 4 company-capf--current-completion-data)
|
||||
:company-kind))
|
||||
nil
|
||||
annotation)))
|
||||
|
||||
(defun company-capf--candidates (input suffix)
|
||||
(let* ((current-capf (car company-capf--current-completion-data))
|
||||
(res (company--capf-data))
|
||||
(table (nth 3 res))
|
||||
(pred (plist-get (nthcdr 4 res) :predicate))
|
||||
(meta (and res
|
||||
(completion-metadata
|
||||
(buffer-substring (nth 1 res) (nth 2 res))
|
||||
table pred))))
|
||||
(when (and res
|
||||
(or (not current-capf)
|
||||
(equal current-capf (car res))))
|
||||
(let* ((interrupt (plist-get (nthcdr 4 res) :company-use-while-no-input))
|
||||
(all-result (company-capf--candidates-1 input suffix
|
||||
table pred
|
||||
meta
|
||||
(and non-essential
|
||||
(eq interrupt t))))
|
||||
(sortfun (cdr (assq 'display-sort-function meta)))
|
||||
(candidates (assoc-default :completions all-result)))
|
||||
(setq company-capf--sorted (functionp sortfun))
|
||||
(when candidates
|
||||
(company-capf--save-current-data res meta)
|
||||
(setq company-capf--current-boundaries
|
||||
(company--capf-boundaries-markers
|
||||
(assoc-default :boundaries all-result)
|
||||
company-capf--current-boundaries)))
|
||||
(when sortfun
|
||||
(setq candidates (funcall sortfun candidates)))
|
||||
candidates))))
|
||||
|
||||
(defun company-capf--candidates-1 (prefix suffix table pred meta interrupt-on-input)
|
||||
(if (not interrupt-on-input)
|
||||
(company--capf-completions prefix suffix table pred meta)
|
||||
(let (res)
|
||||
(and (while-no-input
|
||||
(setq res
|
||||
(company--capf-completions prefix suffix table pred meta))
|
||||
nil)
|
||||
(throw 'interrupted 'new-input))
|
||||
res)))
|
||||
|
||||
(defun company-capf--post-completion (arg)
|
||||
(let* ((res company-capf--current-completion-data)
|
||||
(exit-function (plist-get (nthcdr 4 res) :exit-function))
|
||||
(table (nth 3 res))
|
||||
(prefix (nth 0 (company-capf--prefix))))
|
||||
(if exit-function
|
||||
;; Follow the example of `completion--done'.
|
||||
(funcall exit-function arg
|
||||
;; FIXME: Should probably use an additional heuristic:
|
||||
;; completion-at-point doesn't know when the user picked a
|
||||
;; particular candidate explicitly (it only checks whether
|
||||
;; further completions exist). Whereas company user can press
|
||||
;; RET (or use implicit completion with company-tng).
|
||||
(if (= (car (completion-boundaries prefix table nil ""))
|
||||
(length prefix))
|
||||
'exact
|
||||
'finished)))))
|
||||
|
||||
(provide 'company-capf)
|
||||
|
||||
;;; company-capf.el ends here
|
||||
Binary file not shown.
|
|
@ -1,430 +0,0 @@
|
|||
;;; company-clang.el --- company-mode completion backend for Clang -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'company-template)
|
||||
(require 'cl-lib)
|
||||
|
||||
(defgroup company-clang nil
|
||||
"Completion backend for Clang."
|
||||
:group 'company)
|
||||
|
||||
(defcustom company-clang-executable
|
||||
(executable-find "clang")
|
||||
"Location of clang executable."
|
||||
:type 'file)
|
||||
|
||||
(defcustom company-clang-begin-after-member-access t
|
||||
"When non-nil, start automatic completion after member access operators.
|
||||
|
||||
Automatic completion starts whenever the current symbol is preceded by
|
||||
\".\", \"->\" or \"::\", ignoring `company-minimum-prefix-length'.
|
||||
|
||||
If `company-begin-commands' is a list, it should include `c-electric-lt-gt'
|
||||
and `c-electric-colon', for automatic completion right after \">\" and
|
||||
\":\"."
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom company-clang-use-compile-flags-txt nil
|
||||
"When non-nil, use flags from compile_flags.txt if present.
|
||||
|
||||
The lines from that files will be appended to `company-clang-arguments'.
|
||||
|
||||
And if such file is found, Clang is called from the directory containing
|
||||
it. That allows the flags use relative file names within the project."
|
||||
:type 'boolean
|
||||
:safe 'booleanp)
|
||||
|
||||
(defcustom company-clang-arguments nil
|
||||
"A list of additional arguments to pass to clang when completing.
|
||||
Prefix files (-include ...) can be selected with `company-clang-set-prefix'
|
||||
or automatically through a custom `company-clang-prefix-guesser'."
|
||||
:type '(repeat (string :tag "Argument")))
|
||||
|
||||
(defcustom company-clang-prefix-guesser 'company-clang-guess-prefix
|
||||
"A function to determine the prefix file for the current buffer."
|
||||
:type '(function :tag "Guesser function" nil))
|
||||
|
||||
(defvar company-clang-modes '(c-mode c++-mode objc-mode)
|
||||
"Major modes which clang may complete.")
|
||||
|
||||
(defcustom company-clang-insert-arguments t
|
||||
"When non-nil, insert function arguments as a template after completion."
|
||||
:type 'boolean
|
||||
:package-version '(company . "0.8.0"))
|
||||
|
||||
;; prefix ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defvar company-clang--prefix nil)
|
||||
|
||||
(defsubst company-clang--guess-pch-file (file)
|
||||
(let ((dir (directory-file-name (file-name-directory file))))
|
||||
(when (equal (file-name-nondirectory dir) "Classes")
|
||||
(setq dir (file-name-directory dir)))
|
||||
(car (directory-files dir t "\\([^.]h\\|[^h]\\).pch\\'" t))))
|
||||
|
||||
(defsubst company-clang--file-substring (file beg end)
|
||||
(with-temp-buffer
|
||||
(insert-file-contents-literally file nil beg end)
|
||||
(buffer-string)))
|
||||
|
||||
(defun company-clang-guess-prefix ()
|
||||
"Try to guess the prefix file for the current buffer."
|
||||
;; Prefixes seem to be called .pch. Pre-compiled headers do, too.
|
||||
;; So we look at the magic number to rule them out.
|
||||
(let* ((file (company-clang--guess-pch-file buffer-file-name))
|
||||
(magic-number (and file (company-clang--file-substring file 0 4))))
|
||||
(unless (member magic-number '("CPCH" "gpch"))
|
||||
file)))
|
||||
|
||||
(defun company-clang-set-prefix (&optional prefix)
|
||||
"Use PREFIX as a prefix (-include ...) file for clang completion."
|
||||
(interactive (let ((def (funcall company-clang-prefix-guesser)))
|
||||
(unless (stringp def)
|
||||
(setq def default-directory))
|
||||
(list (read-file-name "Prefix file: "
|
||||
(when def (file-name-directory def))
|
||||
def t (when def (file-name-nondirectory def))))))
|
||||
;; TODO: pre-compile?
|
||||
(setq company-clang--prefix (and (stringp prefix)
|
||||
(file-regular-p prefix)
|
||||
prefix)))
|
||||
|
||||
;; Clean-up on exit.
|
||||
(add-hook 'kill-emacs-hook 'company-clang-set-prefix)
|
||||
|
||||
;; parsing ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; Do we ever see OVERLOAD (or OVERRIDE)?
|
||||
(defconst company-clang--completion-pattern
|
||||
"^COMPLETION: \\_<\\(%s[a-zA-Z0-9_:]*\\|Pattern\\)\\(?:\\(?: (InBase)\\)? : \\(.*\\)$\\)?$")
|
||||
|
||||
(defconst company-clang--error-buffer-name "*clang-error*")
|
||||
|
||||
(defun company-clang--lang-option ()
|
||||
(if (eq major-mode 'objc-mode)
|
||||
(if (string= "m" (file-name-extension buffer-file-name))
|
||||
"objective-c" "objective-c++")
|
||||
(substring (symbol-name major-mode) 0 -5)))
|
||||
|
||||
(defun company-clang--parse-output (prefix _objc)
|
||||
(goto-char (point-min))
|
||||
(let ((pattern (format company-clang--completion-pattern
|
||||
(regexp-quote prefix)))
|
||||
(case-fold-search nil)
|
||||
(results (make-hash-table :test 'equal :size (/ (point-max) 100)))
|
||||
lines)
|
||||
(while (re-search-forward pattern nil t)
|
||||
(let ((match (match-string-no-properties 1))
|
||||
(meta (match-string-no-properties 2)))
|
||||
(when (equal match "Pattern")
|
||||
(setq match (company-clang--pattern-to-match meta)))
|
||||
(when (string-match ":" match)
|
||||
(setq match (substring match 0 (match-beginning 0))))
|
||||
;; Avoiding duplicates:
|
||||
;; https://github.com/company-mode/company-mode/issues/841
|
||||
(cond
|
||||
;; Either meta != completion (not a macro)
|
||||
((not (equal match meta))
|
||||
(puthash match meta results))
|
||||
;; Or it's the first time we see this completion
|
||||
((eq (gethash match results 'none) 'none)
|
||||
(puthash match nil results)))))
|
||||
(maphash
|
||||
(lambda (match meta)
|
||||
(when meta
|
||||
(put-text-property 0 1 'meta (company-clang--strip-formatting meta) match))
|
||||
(push match lines))
|
||||
results)
|
||||
lines))
|
||||
|
||||
(defun company-clang--pattern-to-match (pat)
|
||||
(let ((start 0)
|
||||
(end nil))
|
||||
(when (string-match "#]" pat)
|
||||
(setq start (match-end 0)))
|
||||
(when (string-match "[ \(]<#" pat start)
|
||||
(setq end (match-beginning 0)))
|
||||
(substring pat start end)))
|
||||
|
||||
(defun company-clang--meta (candidate)
|
||||
(get-text-property 0 'meta candidate))
|
||||
|
||||
(defun company-clang--annotation (candidate)
|
||||
(let ((ann (company-clang--annotation-1 candidate)))
|
||||
(if (not (and ann (string-prefix-p "(*)" ann)))
|
||||
ann
|
||||
(with-temp-buffer
|
||||
(insert ann)
|
||||
(search-backward ")")
|
||||
(let ((pt (1+ (point))))
|
||||
(re-search-forward ".\\_>" nil t)
|
||||
(delete-region pt (point)))
|
||||
(buffer-string)))))
|
||||
|
||||
;; TODO: Parse the original formatting here, rather than guess.
|
||||
;; Strip it every time in the `meta' handler instead.
|
||||
(defun company-clang--annotation-1 (candidate)
|
||||
(let ((meta (company-clang--meta candidate)))
|
||||
(cond
|
||||
((null meta) nil)
|
||||
((string-match "[^:]:[^:]" meta)
|
||||
(substring meta (1+ (match-beginning 0))))
|
||||
((string-match "(anonymous)" meta) nil)
|
||||
((string-match "\\((.*)[ a-z]*\\'\\)" meta)
|
||||
(let ((paren (match-beginning 1)))
|
||||
(if (not (eq (aref meta (1- paren)) ?>))
|
||||
(match-string 1 meta)
|
||||
(with-temp-buffer
|
||||
(insert meta)
|
||||
(goto-char paren)
|
||||
(substring meta (1- (search-backward "<"))))))))))
|
||||
|
||||
(defun company-clang--strip-formatting (text)
|
||||
(replace-regexp-in-string
|
||||
"#]" " "
|
||||
(replace-regexp-in-string "[<{[]#\\|#[>}]" "" text t)
|
||||
t))
|
||||
|
||||
(defun company-clang--handle-error (res args)
|
||||
(goto-char (point-min))
|
||||
(let* ((buf (get-buffer-create company-clang--error-buffer-name))
|
||||
(cmd (concat company-clang-executable " " (mapconcat 'identity args " ")))
|
||||
(pattern (format company-clang--completion-pattern ""))
|
||||
(message-truncate-lines t)
|
||||
(err (if (and (re-search-forward pattern nil t)
|
||||
;; Something in the Windows build?
|
||||
;; Looks like Clang doesn't always include the error text
|
||||
;; before completions (even if exited with error).
|
||||
(> (match-beginning 0) (point-min)))
|
||||
(buffer-substring-no-properties (point-min)
|
||||
(1- (match-beginning 0)))
|
||||
;; Warn the user more aggressively if no match was found.
|
||||
(message "clang failed with error %d: %s" res cmd)
|
||||
(buffer-string))))
|
||||
|
||||
(with-current-buffer buf
|
||||
(let ((inhibit-read-only t))
|
||||
(erase-buffer)
|
||||
(insert (current-time-string)
|
||||
(format "\nclang failed with error %d:\n" res)
|
||||
cmd "\n\n")
|
||||
(insert err)
|
||||
(setq buffer-read-only t)
|
||||
(goto-char (point-min))))))
|
||||
|
||||
(defun company-clang--start-process (prefix callback &rest args)
|
||||
(let* ((objc (derived-mode-p 'objc-mode))
|
||||
(buf (get-buffer-create "*clang-output*"))
|
||||
;; Looks unnecessary in Emacs 25.1 and later.
|
||||
;; (Inconclusive, needs more testing):
|
||||
;; https://github.com/company-mode/company-mode/pull/288#issuecomment-72491808
|
||||
(process-adaptive-read-buffering nil)
|
||||
(existing-process (get-buffer-process buf)))
|
||||
(when existing-process
|
||||
(kill-process existing-process))
|
||||
(with-current-buffer buf
|
||||
(erase-buffer)
|
||||
(setq buffer-undo-list t))
|
||||
(let* ((process-connection-type nil)
|
||||
(process (apply #'start-file-process "company-clang" buf
|
||||
company-clang-executable args)))
|
||||
(set-process-sentinel
|
||||
process
|
||||
(lambda (proc status)
|
||||
(unless (string-match-p "hangup\\|killed" status)
|
||||
(funcall
|
||||
callback
|
||||
(let ((res (process-exit-status proc)))
|
||||
(with-current-buffer buf
|
||||
(unless (eq 0 res)
|
||||
(company-clang--handle-error res args))
|
||||
;; Still try to get any useful input.
|
||||
(company-clang--parse-output prefix objc)))))))
|
||||
(unless (company-clang--auto-save-p)
|
||||
(send-region process (point-min) (point-max))
|
||||
(send-string process "\n")
|
||||
(process-send-eof process)))))
|
||||
|
||||
(defsubst company-clang--build-location (pos)
|
||||
(save-excursion
|
||||
(goto-char pos)
|
||||
(format "%s:%d:%d"
|
||||
(if (company-clang--auto-save-p) buffer-file-name "-")
|
||||
(line-number-at-pos)
|
||||
(1+ (length
|
||||
(encode-coding-region
|
||||
(line-beginning-position)
|
||||
(point)
|
||||
'utf-8
|
||||
t))))))
|
||||
|
||||
(defsubst company-clang--build-complete-args (pos)
|
||||
(append '("-fsyntax-only" "-Xclang" "-code-completion-macros")
|
||||
(unless (company-clang--auto-save-p)
|
||||
(list "-x" (company-clang--lang-option)))
|
||||
(company-clang--arguments)
|
||||
(when (stringp company-clang--prefix)
|
||||
(list "-include" (expand-file-name company-clang--prefix)))
|
||||
(list "-Xclang" (format "-code-completion-at=%s"
|
||||
(company-clang--build-location pos)))
|
||||
(list (if (company-clang--auto-save-p) buffer-file-name "-"))))
|
||||
|
||||
(defun company-clang--arguments ()
|
||||
(let ((fname "compile_flags.txt")
|
||||
(args company-clang-arguments)
|
||||
current-dir-rel)
|
||||
(when company-clang-use-compile-flags-txt
|
||||
(let ((dir (locate-dominating-file default-directory fname)))
|
||||
(when dir
|
||||
(setq current-dir-rel (file-relative-name default-directory dir))
|
||||
(setq default-directory dir)
|
||||
(with-temp-buffer
|
||||
(insert-file-contents fname)
|
||||
(setq args
|
||||
(append
|
||||
args
|
||||
(split-string (buffer-substring-no-properties
|
||||
(point-min) (point-max))
|
||||
"[\n\r]+"
|
||||
t
|
||||
"[ \t]+"))))
|
||||
(unless (equal current-dir-rel "./")
|
||||
(push (format "-I%s" current-dir-rel) args)))))
|
||||
args))
|
||||
|
||||
(defun company-clang--candidates (prefix callback)
|
||||
(and (company-clang--auto-save-p)
|
||||
(buffer-modified-p)
|
||||
(basic-save-buffer))
|
||||
(when (null company-clang--prefix)
|
||||
(company-clang-set-prefix (or (funcall company-clang-prefix-guesser)
|
||||
'none)))
|
||||
(let ((default-directory default-directory))
|
||||
(apply 'company-clang--start-process
|
||||
prefix
|
||||
callback
|
||||
(company-clang--build-complete-args
|
||||
(if (company-clang--check-version 4.0 9.0)
|
||||
(point)
|
||||
(- (point) (length prefix)))))))
|
||||
|
||||
(defun company-clang--prefix ()
|
||||
(if company-clang-begin-after-member-access
|
||||
(company-grab-symbol-parts "\\.\\|->\\|::" 2)
|
||||
(company-grab-symbol-parts)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defconst company-clang-required-version 1.1)
|
||||
|
||||
(defvar company-clang--version nil)
|
||||
|
||||
(defun company-clang--auto-save-p ()
|
||||
(not
|
||||
(company-clang--check-version 2.9 3.1)))
|
||||
|
||||
(defun company-clang--check-version (min apple-min)
|
||||
(pcase-exhaustive company-clang--version
|
||||
(`(apple . ,ver) (>= ver apple-min))
|
||||
(`(normal . ,ver) (>= ver min))))
|
||||
|
||||
(defsubst company-clang-version ()
|
||||
"Return the version of `company-clang-executable'."
|
||||
(with-temp-buffer
|
||||
(call-process company-clang-executable nil t nil "--version")
|
||||
(goto-char (point-min))
|
||||
(if (re-search-forward
|
||||
"\\(clang\\|Apple LLVM\\|bcc32x\\|bcc64\\) version \\([0-9.]+\\)" nil t)
|
||||
(cons
|
||||
(if (equal (match-string-no-properties 1) "Apple LLVM")
|
||||
'apple
|
||||
'normal)
|
||||
(string-to-number (match-string-no-properties 2)))
|
||||
0)))
|
||||
|
||||
(defun company-clang (command &optional arg &rest _ignored)
|
||||
"`company-mode' completion backend for Clang.
|
||||
Clang is a parser for C and ObjC. Clang version 1.1 or newer is required.
|
||||
|
||||
Additional command line arguments can be specified in
|
||||
`company-clang-arguments'. Prefix files (-include ...) can be selected
|
||||
with `company-clang-set-prefix' or automatically through a custom
|
||||
`company-clang-prefix-guesser'.
|
||||
|
||||
With Clang versions before 2.9, we have to save the buffer before
|
||||
performing completion. With Clang 2.9 and later, buffer contents are
|
||||
passed via standard input."
|
||||
(interactive (list 'interactive))
|
||||
(cl-case command
|
||||
(interactive (company-begin-backend 'company-clang))
|
||||
(init (when (memq major-mode company-clang-modes)
|
||||
(unless company-clang-executable
|
||||
(error "Company found no clang executable"))
|
||||
(setq company-clang--version (company-clang-version))
|
||||
(unless (company-clang--check-version
|
||||
company-clang-required-version
|
||||
company-clang-required-version)
|
||||
(error "Company requires clang version %s"
|
||||
company-clang-required-version))))
|
||||
(prefix (and (memq major-mode company-clang-modes)
|
||||
buffer-file-name
|
||||
company-clang-executable
|
||||
(not (company-in-string-or-comment))
|
||||
(or (company-clang--prefix) 'stop)))
|
||||
(candidates (cons :async
|
||||
(lambda (cb) (company-clang--candidates arg cb))))
|
||||
(meta (company-clang--meta arg))
|
||||
(kind (company-clang--kind arg))
|
||||
(annotation (company-clang--annotation arg))
|
||||
(post-completion (let ((anno (company-clang--annotation arg)))
|
||||
(when (and company-clang-insert-arguments anno)
|
||||
(insert anno)
|
||||
(if (string-match "\\`:[^:]" anno)
|
||||
(company-template-objc-templatify anno)
|
||||
(company-template-c-like-templatify
|
||||
(concat arg anno))))))))
|
||||
|
||||
(defun company-clang--kind (arg)
|
||||
;; XXX: Not very precise.
|
||||
;; E.g. it will say that an arg-less ObjC method is a variable (perhaps we
|
||||
;; could look around for brackets, etc, if there any actual users who's
|
||||
;; bothered by it).
|
||||
;; And we can't distinguish between local vars and struct fields.
|
||||
;; Or between keywords and macros.
|
||||
(let ((meta (company-clang--meta arg)))
|
||||
(cond
|
||||
((null meta) 'keyword)
|
||||
((string-match "(" meta)
|
||||
(if (string-match-p (format "\\`%s *\\'" (regexp-quote arg))
|
||||
(substring meta 0 (match-beginning 0)))
|
||||
'keyword ; Also macro, actually (no return type).
|
||||
'function))
|
||||
(t 'variable))))
|
||||
|
||||
(provide 'company-clang)
|
||||
;;; company-clang.el ends here
|
||||
Binary file not shown.
|
|
@ -1,204 +0,0 @@
|
|||
;;; company-cmake.el --- company-mode completion backend for CMake -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2013-2015, 2017-2018, 2020, 2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Chen Bin <chenbin DOT sh AT gmail>
|
||||
|
||||
;; 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; company-cmake offers completions for module names, variable names and
|
||||
;; commands used by CMake. And their descriptions.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'cl-lib)
|
||||
|
||||
(defgroup company-cmake nil
|
||||
"Completion backend for CMake."
|
||||
:group 'company)
|
||||
|
||||
(defcustom company-cmake-executable
|
||||
(executable-find "cmake")
|
||||
"Location of cmake executable."
|
||||
:type 'file)
|
||||
|
||||
(defvar company-cmake-executable-arguments
|
||||
'("--help-command-list"
|
||||
"--help-module-list"
|
||||
"--help-property-list"
|
||||
"--help-variable-list")
|
||||
"The arguments we pass to cmake, separately.
|
||||
They affect which types of symbols we get completion candidates for.")
|
||||
|
||||
(defvar company-cmake--completion-pattern
|
||||
"^\\(%s[a-zA-Z0-9_<>]%s\\)$"
|
||||
"Regexp to match the candidates.")
|
||||
|
||||
(defvar company-cmake-modes '(cmake-mode cmake-ts-mode)
|
||||
"Major modes in which cmake may complete.")
|
||||
|
||||
(defvar company-cmake--candidates-cache nil
|
||||
"Cache for the raw candidates.")
|
||||
|
||||
(defvar company-cmake--meta-command-cache nil
|
||||
"Cache for command arguments to retrieve descriptions for the candidates.")
|
||||
|
||||
(defun company-cmake--replace-tags (rlt)
|
||||
(setq rlt (replace-regexp-in-string
|
||||
"\\(.*?\\(IS_GNU\\)?\\)<LANG>\\(.*\\)"
|
||||
(lambda (_match)
|
||||
(mapconcat 'identity
|
||||
(if (match-beginning 2)
|
||||
'("\\1CXX\\3" "\\1C\\3" "\\1G77\\3")
|
||||
'("\\1CXX\\3" "\\1C\\3" "\\1Fortran\\3"))
|
||||
"\n"))
|
||||
rlt t))
|
||||
(setq rlt (replace-regexp-in-string
|
||||
"\\(.*\\)<CONFIG>\\(.*\\)"
|
||||
(mapconcat 'identity '("\\1DEBUG\\2" "\\1RELEASE\\2"
|
||||
"\\1RELWITHDEBINFO\\2" "\\1MINSIZEREL\\2")
|
||||
"\n")
|
||||
rlt))
|
||||
rlt)
|
||||
|
||||
(defun company-cmake--fill-candidates-cache (arg)
|
||||
"Fill candidates cache if needed."
|
||||
(let (rlt)
|
||||
(unless company-cmake--candidates-cache
|
||||
(setq company-cmake--candidates-cache (make-hash-table :test 'equal)))
|
||||
|
||||
;; If hash is empty, fill it.
|
||||
(unless (gethash arg company-cmake--candidates-cache)
|
||||
(with-temp-buffer
|
||||
(let ((res (call-process company-cmake-executable nil t nil arg)))
|
||||
(unless (zerop res)
|
||||
(message "cmake executable exited with error=%d" res)))
|
||||
(setq rlt (buffer-string)))
|
||||
(setq rlt (company-cmake--replace-tags rlt))
|
||||
(puthash arg rlt company-cmake--candidates-cache))
|
||||
))
|
||||
|
||||
(defun company-cmake--parse (prefix content cmd)
|
||||
(let ((pattern (format company-cmake--completion-pattern
|
||||
(regexp-quote prefix)
|
||||
(if (zerop (length prefix)) "+" "*")))
|
||||
(lines (split-string content "\n"))
|
||||
rlt)
|
||||
(dolist (line lines)
|
||||
(when (string-match pattern line)
|
||||
(let ((match (match-string 1 line)))
|
||||
(when match
|
||||
(puthash match cmd company-cmake--meta-command-cache)
|
||||
(push match rlt)))))
|
||||
rlt))
|
||||
|
||||
(defun company-cmake--candidates (prefix)
|
||||
(let (results
|
||||
cmd-opts
|
||||
str)
|
||||
|
||||
(unless company-cmake--meta-command-cache
|
||||
(setq company-cmake--meta-command-cache (make-hash-table :test 'equal)))
|
||||
|
||||
(dolist (arg company-cmake-executable-arguments)
|
||||
(company-cmake--fill-candidates-cache arg)
|
||||
(setq cmd-opts (replace-regexp-in-string "-list$" "" arg) )
|
||||
|
||||
(setq str (gethash arg company-cmake--candidates-cache))
|
||||
(when str
|
||||
(setq results (nconc results
|
||||
(company-cmake--parse prefix str cmd-opts)))))
|
||||
results))
|
||||
|
||||
(defun company-cmake--unexpand-candidate (candidate)
|
||||
(cond
|
||||
((string-match "^CMAKE_\\(C\\|CXX\\|Fortran\\)\\(_.*\\)$" candidate)
|
||||
(setq candidate (concat "CMAKE_<LANG>" (match-string 2 candidate))))
|
||||
|
||||
;; C flags
|
||||
((string-match "^\\(.*_\\)IS_GNU\\(C\\|CXX\\|G77\\)$" candidate)
|
||||
(setq candidate (concat (match-string 1 candidate) "IS_GNU<LANG>")))
|
||||
|
||||
;; C flags
|
||||
((string-match "^\\(.*_\\)OVERRIDE_\\(C\\|CXX\\|Fortran\\)$" candidate)
|
||||
(setq candidate (concat (match-string 1 candidate) "OVERRIDE_<LANG>")))
|
||||
|
||||
((string-match "^\\(.*\\)\\(_DEBUG\\|_RELEASE\\|_RELWITHDEBINFO\\|_MINSIZEREL\\)\\(.*\\)$" candidate)
|
||||
(setq candidate (concat (match-string 1 candidate)
|
||||
"_<CONFIG>"
|
||||
(match-string 3 candidate)))))
|
||||
candidate)
|
||||
|
||||
(defun company-cmake--meta (candidate)
|
||||
(let ((cmd-opts (gethash candidate company-cmake--meta-command-cache))
|
||||
result)
|
||||
(setq candidate (company-cmake--unexpand-candidate candidate))
|
||||
|
||||
;; Don't cache the documentation of every candidate (command)
|
||||
;; Cache in this case will cost too much memory.
|
||||
(with-temp-buffer
|
||||
(call-process company-cmake-executable nil t nil cmd-opts candidate)
|
||||
;; Go to the third line, trim it and return the result.
|
||||
;; Tested with cmake 2.8.9.
|
||||
(goto-char (point-min))
|
||||
(forward-line 2)
|
||||
(setq result (buffer-substring-no-properties (line-beginning-position)
|
||||
(line-end-position)))
|
||||
(setq result (replace-regexp-in-string "^[ \t\n\r]+" "" result))
|
||||
result)))
|
||||
|
||||
(defun company-cmake--doc-buffer (candidate)
|
||||
(let ((cmd-opts (gethash candidate company-cmake--meta-command-cache)))
|
||||
|
||||
(setq candidate (company-cmake--unexpand-candidate candidate))
|
||||
(with-temp-buffer
|
||||
(call-process company-cmake-executable nil t nil cmd-opts candidate)
|
||||
;; Go to the third line, trim it and return the doc buffer.
|
||||
;; Tested with cmake 2.8.9.
|
||||
(goto-char (point-min))
|
||||
(forward-line 2)
|
||||
(company-doc-buffer
|
||||
(buffer-substring-no-properties (line-beginning-position)
|
||||
(point-max))))))
|
||||
|
||||
(defun company-cmake-prefix-dollar-brace-p ()
|
||||
"Test if the current symbol follows ${."
|
||||
(save-excursion
|
||||
(skip-syntax-backward "w_")
|
||||
(and (eq (char-before (point)) ?\{)
|
||||
(eq (char-before (1- (point))) ?$))))
|
||||
|
||||
(defun company-cmake (command &optional arg &rest _ignored)
|
||||
"`company-mode' completion backend for CMake.
|
||||
CMake is a cross-platform, open-source make system."
|
||||
(interactive (list 'interactive))
|
||||
(cl-case command
|
||||
(interactive (company-begin-backend 'company-cmake))
|
||||
(init (when (memq major-mode company-cmake-modes)
|
||||
(unless company-cmake-executable
|
||||
(error "Company found no cmake executable"))))
|
||||
(prefix (and (memq major-mode company-cmake-modes)
|
||||
(or (not (company-in-string-or-comment))
|
||||
(company-cmake-prefix-dollar-brace-p))
|
||||
(company-grab-symbol)))
|
||||
(candidates (company-cmake--candidates arg))
|
||||
(meta (company-cmake--meta arg))
|
||||
(doc-buffer (company-cmake--doc-buffer arg))
|
||||
))
|
||||
|
||||
(provide 'company-cmake)
|
||||
;;; company-cmake.el ends here
|
||||
Binary file not shown.
|
|
@ -1,446 +0,0 @@
|
|||
;;; company-css.el --- company-mode completion backend for css-mode -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2015, 2018 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; In Emacs >= 26, company-capf is used instead.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'cl-lib)
|
||||
|
||||
(declare-function web-mode-language-at-pos "web-mode" (&optional pos))
|
||||
|
||||
(defconst company-css-property-alist
|
||||
;; see http://www.w3.org/TR/CSS21/propidx.html
|
||||
'(("azimuth" angle "left-side" "far-left" "left" "center-left" "center"
|
||||
"center-right" "right" "far-right" "right-side" "behind" "leftwards"
|
||||
"rightwards")
|
||||
("background" background-color background-image background-repeat
|
||||
background-attachment background-position
|
||||
background-clip background-origin background-size)
|
||||
("background-attachment" "scroll" "fixed")
|
||||
("background-color" color "transparent")
|
||||
("background-image" uri "none")
|
||||
("background-position" percentage length "left" "center" "right" percentage
|
||||
length "top" "center" "bottom" "left" "center" "right" "top" "center"
|
||||
"bottom")
|
||||
("background-repeat" "repeat" "repeat-x" "repeat-y" "no-repeat")
|
||||
("border" border-width border-style border-color)
|
||||
("border-bottom" border)
|
||||
("border-bottom-color" border-color)
|
||||
("border-bottom-style" border-style)
|
||||
("border-bottom-width" border-width)
|
||||
("border-collapse" "collapse" "separate")
|
||||
("border-color" color "transparent")
|
||||
("border-left" border)
|
||||
("border-left-color" border-color)
|
||||
("border-left-style" border-style)
|
||||
("border-left-width" border-width)
|
||||
("border-right" border)
|
||||
("border-right-color" border-color)
|
||||
("border-right-style" border-style)
|
||||
("border-right-width" border-width)
|
||||
("border-spacing" length length)
|
||||
("border-style" border-style)
|
||||
("border-top" border)
|
||||
("border-top-color" border-color)
|
||||
("border-top-style" border-style)
|
||||
("border-top-width" border-width)
|
||||
("border-width" border-width)
|
||||
("bottom" length percentage "auto")
|
||||
("caption-side" "top" "bottom")
|
||||
("clear" "none" "left" "right" "both")
|
||||
("clip" shape "auto")
|
||||
("color" color)
|
||||
("content" "normal" "none" string uri counter "attr()" "open-quote"
|
||||
"close-quote" "no-open-quote" "no-close-quote")
|
||||
("counter-increment" identifier integer "none")
|
||||
("counter-reset" identifier integer "none")
|
||||
("cue" cue-before cue-after)
|
||||
("cue-after" uri "none")
|
||||
("cue-before" uri "none")
|
||||
("cursor" uri "*" "auto" "crosshair" "default" "pointer" "move" "e-resize"
|
||||
"ne-resize" "nw-resize" "n-resize" "se-resize" "sw-resize" "s-resize"
|
||||
"w-resize" "text" "wait" "help" "progress")
|
||||
("direction" "ltr" "rtl")
|
||||
("display" "inline" "block" "list-item" "run-in" "inline-block" "table"
|
||||
"inline-table" "table-row-group" "table-header-group" "table-footer-group"
|
||||
"table-row" "table-column-group" "table-column" "table-cell"
|
||||
"table-caption" "none")
|
||||
("elevation" angle "below" "level" "above" "higher" "lower")
|
||||
("empty-cells" "show" "hide")
|
||||
("float" "left" "right" "none")
|
||||
("font" font-style font-weight font-size "/" line-height
|
||||
font-family "caption" "icon" "menu" "message-box" "small-caption"
|
||||
"status-bar" "normal" "small-caps"
|
||||
;; CSS3
|
||||
font-stretch)
|
||||
("font-family" family-name generic-family)
|
||||
("font-size" absolute-size relative-size length percentage)
|
||||
("font-style" "normal" "italic" "oblique")
|
||||
("font-weight" "normal" "bold" "bolder" "lighter" "100" "200" "300" "400"
|
||||
"500" "600" "700" "800" "900")
|
||||
("height" length percentage "auto")
|
||||
("left" length percentage "auto")
|
||||
("letter-spacing" "normal" length)
|
||||
("line-height" "normal" number length percentage)
|
||||
("list-style" list-style-type list-style-position list-style-image)
|
||||
("list-style-image" uri "none")
|
||||
("list-style-position" "inside" "outside")
|
||||
("list-style-type" "disc" "circle" "square" "decimal" "decimal-leading-zero"
|
||||
"lower-roman" "upper-roman" "lower-greek" "lower-latin" "upper-latin"
|
||||
"armenian" "georgian" "lower-alpha" "upper-alpha" "none")
|
||||
("margin" margin-width)
|
||||
("margin-bottom" margin-width)
|
||||
("margin-left" margin-width)
|
||||
("margin-right" margin-width)
|
||||
("margin-top" margin-width)
|
||||
("max-height" length percentage "none")
|
||||
("max-width" length percentage "none")
|
||||
("min-height" length percentage)
|
||||
("min-width" length percentage)
|
||||
("orphans" integer)
|
||||
("outline" outline-color outline-style outline-width)
|
||||
("outline-color" color "invert")
|
||||
("outline-style" border-style)
|
||||
("outline-width" border-width)
|
||||
("overflow" "visible" "hidden" "scroll" "auto"
|
||||
;; CSS3:
|
||||
"no-display" "no-content")
|
||||
("padding" padding-width)
|
||||
("padding-bottom" padding-width)
|
||||
("padding-left" padding-width)
|
||||
("padding-right" padding-width)
|
||||
("padding-top" padding-width)
|
||||
("page-break-after" "auto" "always" "avoid" "left" "right")
|
||||
("page-break-before" "auto" "always" "avoid" "left" "right")
|
||||
("page-break-inside" "avoid" "auto")
|
||||
("pause" time percentage)
|
||||
("pause-after" time percentage)
|
||||
("pause-before" time percentage)
|
||||
("pitch" frequency "x-low" "low" "medium" "high" "x-high")
|
||||
("pitch-range" number)
|
||||
("play-during" uri "mix" "repeat" "auto" "none")
|
||||
("position" "static" "relative" "absolute" "fixed")
|
||||
("quotes" string string "none")
|
||||
("richness" number)
|
||||
("right" length percentage "auto")
|
||||
("speak" "normal" "none" "spell-out")
|
||||
("speak-header" "once" "always")
|
||||
("speak-numeral" "digits" "continuous")
|
||||
("speak-punctuation" "code" "none")
|
||||
("speech-rate" number "x-slow" "slow" "medium" "fast" "x-fast" "faster"
|
||||
"slower")
|
||||
("stress" number)
|
||||
("table-layout" "auto" "fixed")
|
||||
("text-align" "left" "right" "center" "justify")
|
||||
("text-indent" length percentage)
|
||||
("text-transform" "capitalize" "uppercase" "lowercase" "none")
|
||||
("top" length percentage "auto")
|
||||
("unicode-bidi" "normal" "embed" "bidi-override")
|
||||
("vertical-align" "baseline" "sub" "super" "top" "text-top" "middle"
|
||||
"bottom" "text-bottom" percentage length)
|
||||
("visibility" "visible" "hidden" "collapse")
|
||||
("voice-family" specific-voice generic-voice "*" specific-voice
|
||||
generic-voice)
|
||||
("volume" number percentage "silent" "x-soft" "soft" "medium" "loud"
|
||||
"x-loud")
|
||||
("white-space" "normal" "pre" "nowrap" "pre-wrap" "pre-line")
|
||||
("widows" integer)
|
||||
("width" length percentage "auto")
|
||||
("word-spacing" "normal" length)
|
||||
("z-index" "auto" integer)
|
||||
;; CSS3
|
||||
("align-content" align-stretch "space-between" "space-around")
|
||||
("align-items" align-stretch "baseline")
|
||||
("align-self" align-items "auto")
|
||||
("animation" animation-name animation-duration animation-timing-function
|
||||
animation-delay animation-iteration-count animation-direction
|
||||
animation-fill-mode)
|
||||
("animation-delay" time)
|
||||
("animation-direction" "normal" "reverse" "alternate" "alternate-reverse")
|
||||
("animation-duration" time)
|
||||
("animation-fill-mode" "none" "forwards" "backwards" "both")
|
||||
("animation-iteration-count" integer "infinite")
|
||||
("animation-name" "none")
|
||||
("animation-play-state" "paused" "running")
|
||||
("animation-timing-function" transition-timing-function
|
||||
"step-start" "step-end" "steps(,)")
|
||||
("backface-visibility" "visible" "hidden")
|
||||
("background-clip" background-origin)
|
||||
("background-origin" "border-box" "padding-box" "content-box")
|
||||
("background-size" length percentage "auto" "cover" "contain")
|
||||
("border-image" border-image-outset border-image-repeat border-image-source
|
||||
border-image-slice border-image-width)
|
||||
("border-image-outset" length)
|
||||
("border-image-repeat" "stretch" "repeat" "round" "space")
|
||||
("border-image-source" uri "none")
|
||||
("border-image-slice" length)
|
||||
("border-image-width" length percentage)
|
||||
("border-radius" length)
|
||||
("border-top-left-radius" length)
|
||||
("border-top-right-radius" length)
|
||||
("border-bottom-left-radius" length)
|
||||
("border-bottom-right-radius" length)
|
||||
("box-decoration-break" "slice" "clone")
|
||||
("box-shadow" length color)
|
||||
("box-sizing" "content-box" "border-box")
|
||||
("break-after" "auto" "always" "avoid" "left" "right" "page" "column"
|
||||
"avoid-page" "avoid-column")
|
||||
("break-before" break-after)
|
||||
("break-inside" "avoid" "auto")
|
||||
("columns" column-width column-count)
|
||||
("column-count" integer)
|
||||
("column-fill" "auto" "balance")
|
||||
("column-gap" length "normal")
|
||||
("column-rule" column-rule-width column-rule-style column-rule-color)
|
||||
("column-rule-color" color)
|
||||
("column-rule-style" border-style)
|
||||
("column-rule-width" border-width)
|
||||
("column-span" "all" "none")
|
||||
("column-width" length "auto")
|
||||
("filter" url "blur()" "brightness()" "contrast()" "drop-shadow()"
|
||||
"grayscale()" "hue-rotate()" "invert()" "opacity()" "saturate()" "sepia()")
|
||||
("flex" flex-grow flex-shrink flex-basis)
|
||||
("flex-basis" percentage length "auto")
|
||||
("flex-direction" "row" "row-reverse" "column" "column-reverse")
|
||||
("flex-flow" flex-direction flex-wrap)
|
||||
("flex-grow" number)
|
||||
("flex-shrink" number)
|
||||
("flex-wrap" "nowrap" "wrap" "wrap-reverse")
|
||||
("font-feature-setting" normal string number)
|
||||
("font-kerning" "auto" "normal" "none")
|
||||
("font-language-override" "normal" string)
|
||||
("font-size-adjust" "none" number)
|
||||
("font-stretch" "normal" "ultra-condensed" "extra-condensed" "condensed"
|
||||
"semi-condensed" "semi-expanded" "expanded" "extra-expanded" "ultra-expanded")
|
||||
("font-synthesis" "none" "weight" "style")
|
||||
("font-variant" font-variant-alternates font-variant-caps
|
||||
font-variant-east-asian font-variant-ligatures font-variant-numeric
|
||||
font-variant-position)
|
||||
("font-variant-alternates" "normal" "historical-forms" "stylistic()"
|
||||
"styleset()" "character-variant()" "swash()" "ornaments()" "annotation()")
|
||||
("font-variant-caps" "normal" "small-caps" "all-small-caps" "petite-caps"
|
||||
"all-petite-caps" "unicase" "titling-caps")
|
||||
("font-variant-east-asian" "jis78" "jis83" "jis90" "jis04" "simplified"
|
||||
"traditional" "full-width" "proportional-width" "ruby")
|
||||
("font-variant-ligatures" "normal" "none" "common-ligatures"
|
||||
"no-common-ligatures" "discretionary-ligatures" "no-discretionary-ligatures"
|
||||
"historical-ligatures" "no-historical-ligatures" "contextual" "no-contextual")
|
||||
("font-variant-numeric" "normal" "ordinal" "slashed-zero"
|
||||
"lining-nums" "oldstyle-nums" "proportional-nums" "tabular-nums"
|
||||
"diagonal-fractions" "stacked-fractions")
|
||||
("font-variant-position" "normal" "sub" "super")
|
||||
("hyphens" "none" "manual" "auto")
|
||||
("justify-content" align-common "space-between" "space-around")
|
||||
("line-break" "auto" "loose" "normal" "strict")
|
||||
("marquee-direction" "forward" "reverse")
|
||||
("marquee-play-count" integer "infinite")
|
||||
("marquee-speed" "slow" "normal" "fast")
|
||||
("marquee-style" "scroll" "slide" "alternate")
|
||||
("opacity" number)
|
||||
("order" number)
|
||||
("outline-offset" length)
|
||||
("overflow-x" overflow)
|
||||
("overflow-y" overflow)
|
||||
("overflow-style" "auto" "marquee-line" "marquee-block")
|
||||
("overflow-wrap" "normal" "break-word")
|
||||
("perspective" "none" length)
|
||||
("perspective-origin" percentage length "left" "center" "right" "top" "bottom")
|
||||
("resize" "none" "both" "horizontal" "vertical")
|
||||
("tab-size" integer length)
|
||||
("text-align-last" "auto" "start" "end" "left" "right" "center" "justify")
|
||||
("text-decoration" text-decoration-color text-decoration-line text-decoration-style)
|
||||
("text-decoration-color" color)
|
||||
("text-decoration-line" "none" "underline" "overline" "line-through" "blink")
|
||||
("text-decoration-style" "solid" "double" "dotted" "dashed" "wavy")
|
||||
("text-overflow" "clip" "ellipsis")
|
||||
("text-shadow" color length)
|
||||
("text-underline-position" "auto" "under" "left" "right")
|
||||
("transform" "matrix(,,,,,)" "translate(,)" "translateX()" "translateY()"
|
||||
"scale()" "scaleX()" "scaleY()" "rotate()" "skewX()" "skewY()" "none")
|
||||
("transform-origin" perspective-origin)
|
||||
("transform-style" "flat" "preserve-3d")
|
||||
("transition" transition-property transition-duration
|
||||
transition-timing-function transition-delay)
|
||||
("transition-delay" time)
|
||||
("transition-duration" time)
|
||||
("transition-timing-function"
|
||||
"ease" "linear" "ease-in" "ease-out" "ease-in-out" "cubic-bezier(,,,)")
|
||||
("transition-property" "none" "all" identifier)
|
||||
("word-wrap" overflow-wrap)
|
||||
("word-break" "normal" "break-all" "keep-all"))
|
||||
"A list of CSS properties and their possible values.")
|
||||
|
||||
(defconst company-css-value-classes
|
||||
'((absolute-size "xx-small" "x-small" "small" "medium" "large" "x-large"
|
||||
"xx-large")
|
||||
(align-common "flex-start" "flex-end" "center")
|
||||
(align-stretch align-common "stretch")
|
||||
(border-style "none" "hidden" "dotted" "dashed" "solid" "double" "groove"
|
||||
"ridge" "inset" "outset")
|
||||
(border-width "thick" "medium" "thin")
|
||||
(color "aqua" "black" "blue" "fuchsia" "gray" "green" "lime" "maroon" "navy"
|
||||
"olive" "orange" "purple" "red" "silver" "teal" "white" "yellow")
|
||||
(counter "counter(,)")
|
||||
(family-name "Courier" "Helvetica" "Times")
|
||||
(generic-family "serif" "sans-serif" "cursive" "fantasy" "monospace")
|
||||
(generic-voice "male" "female" "child")
|
||||
(margin-width "auto") ;; length percentage
|
||||
(relative-size "larger" "smaller")
|
||||
(shape "rect(,,,)")
|
||||
(uri "url()"))
|
||||
"A list of CSS property value classes and their contents.")
|
||||
;; missing, because not completable
|
||||
;; <angle><frequency><identifier><integer><length><number><padding-width>
|
||||
;; <percentage><specific-voice><string><time><uri>
|
||||
|
||||
(defconst company-css-html-tags
|
||||
'("a" "abbr" "acronym" "address" "applet" "area" "b" "base" "basefont" "bdo"
|
||||
"big" "blockquote" "body" "br" "button" "caption" "center" "cite" "code"
|
||||
"col" "colgroup" "dd" "del" "dfn" "dir" "div" "dl" "dt" "em" "fieldset"
|
||||
"font" "form" "frame" "frameset" "h1" "h2" "h3" "h4" "h5" "h6" "head" "hr"
|
||||
"html" "i" "iframe" "img" "input" "ins" "isindex" "kbd" "label" "legend"
|
||||
"li" "link" "map" "menu" "meta" "noframes" "noscript" "object" "ol"
|
||||
"optgroup" "option" "p" "param" "pre" "q" "s" "samp" "script" "select"
|
||||
"small" "span" "strike" "strong" "style" "sub" "sup" "table" "tbody" "td"
|
||||
"textarea" "tfoot" "th" "thead" "title" "tr" "tt" "u" "ul" "var"
|
||||
;; HTML5
|
||||
"section" "article" "aside" "header" "footer" "nav" "figure" "figcaption"
|
||||
"time" "mark" "main")
|
||||
"A list of HTML tags for use in CSS completion.")
|
||||
|
||||
(defconst company-css-pseudo-classes
|
||||
'("active" "after" "before" "first" "first-child" "first-letter" "first-line"
|
||||
"focus" "hover" "lang" "left" "link" "right" "visited")
|
||||
"Identifiers for CSS pseudo-elements and pseudo-classes.")
|
||||
|
||||
(defconst company-css-property-cache (make-hash-table :size 115 :test 'equal))
|
||||
|
||||
(defun company-css-property-values (attribute)
|
||||
"Access the `company-css-property-alist' cached and flattened."
|
||||
(or (gethash attribute company-css-property-cache)
|
||||
(let (results)
|
||||
(dolist (value (cdr (assoc attribute company-css-property-alist)))
|
||||
(if (symbolp value)
|
||||
(dolist (child (or (cdr (assoc value company-css-value-classes))
|
||||
(company-css-property-values
|
||||
(symbol-name value))))
|
||||
(push child results))
|
||||
(push value results)))
|
||||
(setq results (sort results 'string<))
|
||||
(puthash attribute
|
||||
(if (fboundp 'delete-consecutive-dups)
|
||||
(delete-consecutive-dups results)
|
||||
(delete-dups results))
|
||||
company-css-property-cache)
|
||||
results)))
|
||||
|
||||
;;; bracket detection
|
||||
|
||||
(defconst company-css-braces-syntax-table
|
||||
(let ((table (make-syntax-table)))
|
||||
(setf (aref table ?{) '(4 . 125))
|
||||
(setf (aref table ?}) '(5 . 123))
|
||||
table)
|
||||
"A syntax table giving { and } paren syntax.")
|
||||
|
||||
(defun company-css-inside-braces-p ()
|
||||
"Return non-nil, if point is within matched { and }."
|
||||
(ignore-errors
|
||||
(with-syntax-table company-css-braces-syntax-table
|
||||
(let ((parse-sexp-ignore-comments t))
|
||||
(scan-lists (point) -1 1)))))
|
||||
|
||||
;;; tags
|
||||
(defconst company-css-tag-regexp
|
||||
(concat "\\(?:\\`\\|}\\)[[:space:]]*"
|
||||
;; multiple
|
||||
"\\(?:"
|
||||
;; previous tags:
|
||||
"\\(?:#\\|\\_<[[:alpha:]]\\)[[:alnum:]-#]*\\(?:\\[[^]]*\\]\\)?"
|
||||
;; space or selectors
|
||||
"\\(?:[[:space:]]+\\|[[:space:]]*[+,>][[:space:]]*\\)"
|
||||
"\\)*"
|
||||
"\\(\\(?:#\\|\\_<[[:alpha:]]\\)\\(?:[[:alnum:]-#]*\\_>\\)?\\_>\\|\\)"
|
||||
"\\=")
|
||||
"A regular expression matching CSS tags.")
|
||||
|
||||
;;; pseudo id
|
||||
(defconst company-css-pseudo-regexp
|
||||
(concat "\\(?:\\`\\|}\\)[[:space:]]*"
|
||||
;; multiple
|
||||
"\\(?:"
|
||||
;; previous tags:
|
||||
"\\(?:#\\|\\_<[[:alpha:]]\\)[[:alnum:]-#]*\\(?:\\[[^]]*\\]\\)?"
|
||||
;; space or delimiters
|
||||
"\\(?:[[:space:]]+\\|[[:space:]]*[+,>][[:space:]]*\\)"
|
||||
"\\)*"
|
||||
"\\(?:\\(?:\\#\\|\\_<[[:alpha:]]\\)[[:alnum:]-#]*\\):"
|
||||
"\\([[:alpha:]-]+\\_>\\|\\)\\_>\\=")
|
||||
"A regular expression matching CSS pseudo classes.")
|
||||
|
||||
;;; properties
|
||||
|
||||
(defun company-css-grab-property ()
|
||||
"Return the CSS property before point, if any.
|
||||
Returns \"\" if no property found, but feasible at this position."
|
||||
(when (company-css-inside-braces-p)
|
||||
(company-grab-symbol)))
|
||||
|
||||
;;; values
|
||||
(defconst company-css-property-value-regexp
|
||||
"\\_<\\([[:alpha:]-]+\\):\\(?:[^{};]*[[:space:]]+\\)?\\([^{};]*\\_>\\|\\)\\="
|
||||
"A regular expression matching CSS tags.")
|
||||
|
||||
;;;###autoload
|
||||
(defun company-css (command &optional arg &rest _ignored)
|
||||
"`company-mode' completion backend for `css-mode'."
|
||||
(interactive (list 'interactive))
|
||||
(cl-case command
|
||||
(interactive (company-begin-backend 'company-css))
|
||||
(prefix (and (or (derived-mode-p 'css-mode)
|
||||
(and (derived-mode-p 'web-mode)
|
||||
(string= (web-mode-language-at-pos) "css")))
|
||||
(or (company-grab company-css-tag-regexp 1)
|
||||
(company-grab company-css-pseudo-regexp 1)
|
||||
(company-grab company-css-property-value-regexp 2
|
||||
(line-beginning-position))
|
||||
(company-css-grab-property))))
|
||||
(candidates
|
||||
(cond
|
||||
((company-grab company-css-tag-regexp 1)
|
||||
(all-completions arg company-css-html-tags))
|
||||
((company-grab company-css-pseudo-regexp 1)
|
||||
(all-completions arg company-css-pseudo-classes))
|
||||
((company-grab company-css-property-value-regexp 2
|
||||
(line-beginning-position))
|
||||
(all-completions arg
|
||||
(company-css-property-values
|
||||
(company-grab company-css-property-value-regexp 1))))
|
||||
((company-css-grab-property)
|
||||
(all-completions arg company-css-property-alist))))
|
||||
(sorted t)))
|
||||
|
||||
(provide 'company-css)
|
||||
;;; company-css.el ends here
|
||||
Binary file not shown.
|
|
@ -1,187 +0,0 @@
|
|||
;;; company-dabbrev-code.el --- dabbrev-like company-mode backend for code -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2016, 2021-2024 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'company-dabbrev)
|
||||
(require 'cl-lib)
|
||||
|
||||
(defgroup company-dabbrev-code nil
|
||||
"dabbrev-like completion backend for code."
|
||||
:group 'company)
|
||||
|
||||
(defcustom company-dabbrev-code-modes
|
||||
'(prog-mode
|
||||
batch-file-mode csharp-mode css-mode erlang-mode haskell-mode jde-mode
|
||||
lua-mode python-mode)
|
||||
"Modes that use `company-dabbrev-code'.
|
||||
In all these modes (and their derivatives) `company-dabbrev-code' will
|
||||
complete only symbols, not text in comments or strings. In other modes
|
||||
`company-dabbrev-code' will pass control to other backends
|
||||
\(e.g. `company-dabbrev'\). Value t means complete in all modes."
|
||||
:type '(choice (repeat :tag "Some modes" (symbol :tag "Major mode"))
|
||||
(const :tag "All modes" t)))
|
||||
|
||||
(defcustom company-dabbrev-code-other-buffers t
|
||||
"Determines whether `company-dabbrev-code' should search other buffers.
|
||||
If `all', search all other buffers, except the ignored ones. If t, search
|
||||
buffers with the same major mode. If `code', search all
|
||||
buffers with major modes in `company-dabbrev-code-modes', or derived from one of
|
||||
them. This can also be a function that takes the current buffer as
|
||||
parameter and returns a list of major modes to search. See also
|
||||
`company-dabbrev-code-time-limit'."
|
||||
:type '(choice (const :tag "Off" nil)
|
||||
(const :tag "Same major mode" t)
|
||||
(const :tag "Code major modes" code)
|
||||
(const :tag "All" all)
|
||||
(function :tag "Function to return similar major-modes" group)))
|
||||
|
||||
(defcustom company-dabbrev-code-time-limit .1
|
||||
"Determines how long `company-dabbrev-code' should look for matches."
|
||||
:type '(choice (const :tag "Off" nil)
|
||||
(number :tag "Seconds")))
|
||||
|
||||
(defcustom company-dabbrev-code-everywhere nil
|
||||
"Non-nil to offer completions in comments and strings."
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom company-dabbrev-code-ignore-case nil
|
||||
"Non-nil to ignore case when collecting completion candidates."
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom company-dabbrev-code-completion-styles nil
|
||||
"Non-nil to use the completion styles for fuzzy matching."
|
||||
:type '(choice (const :tag "Prefix matching only" nil)
|
||||
(const :tag "Matching according to `completion-styles'" t)
|
||||
(list :tag "Custom list of styles" symbol))
|
||||
:package-version '(company . "1.0.0"))
|
||||
|
||||
(defvar-local company-dabbrev--boundaries nil)
|
||||
(defvar-local company-dabbrev-code--sorted nil)
|
||||
|
||||
(defun company-dabbrev-code--make-regexp (prefix)
|
||||
(let ((prefix-re
|
||||
(cond
|
||||
((string-empty-p prefix)
|
||||
"\\([a-zA-Z]\\|\\s_\\)")
|
||||
((not company-dabbrev-code-completion-styles)
|
||||
(regexp-quote prefix))
|
||||
(t
|
||||
;; Use the cache at least after 2 chars. We could also cache
|
||||
;; earlier, for users who set company-min-p-l to 1 or 0.
|
||||
(let ((prefix (if (>= (length prefix) 2)
|
||||
(substring prefix 0 2)
|
||||
prefix)))
|
||||
(concat
|
||||
"\\(\\sw\\|\\s_\\)*"
|
||||
(mapconcat #'regexp-quote
|
||||
(mapcar #'string prefix)
|
||||
"\\(\\sw\\|\\s_\\)*")))))))
|
||||
(concat "\\_<" prefix-re "\\(\\sw\\|\\s_\\)*\\_>")))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-dabbrev-code (command &optional arg &rest rest)
|
||||
"dabbrev-like `company-mode' backend for code.
|
||||
The backend looks for all symbols in the current buffer that aren't in
|
||||
comments or strings."
|
||||
(interactive (list 'interactive))
|
||||
(cl-case command
|
||||
(interactive (company-begin-backend 'company-dabbrev-code))
|
||||
(prefix (and (or (eq t company-dabbrev-code-modes)
|
||||
(cl-some #'derived-mode-p company-dabbrev-code-modes))
|
||||
(or company-dabbrev-code-everywhere
|
||||
(not (company-in-string-or-comment)))
|
||||
(company-grab-symbol-parts)))
|
||||
(candidates (company-dabbrev--candidates arg (car rest)))
|
||||
(adjust-boundaries (and company-dabbrev-code-completion-styles
|
||||
(company--capf-boundaries
|
||||
company-dabbrev--boundaries)))
|
||||
(expand-common (company-dabbrev-code--expand-common arg (car rest)))
|
||||
(kind 'text)
|
||||
(sorted company-dabbrev-code--sorted)
|
||||
(no-cache t)
|
||||
(ignore-case company-dabbrev-code-ignore-case)
|
||||
(match (when company-dabbrev-code-completion-styles
|
||||
(company--match-from-capf-face arg)))
|
||||
(duplicates t)))
|
||||
|
||||
(defun company-dabbrev-code--expand-common (prefix suffix)
|
||||
(when company-dabbrev-code-completion-styles
|
||||
(let ((completion-styles (if (listp company-dabbrev-code-completion-styles)
|
||||
company-dabbrev-code-completion-styles
|
||||
completion-styles)))
|
||||
(company--capf-expand-common prefix suffix
|
||||
(company-dabbrev-code--table prefix)))))
|
||||
|
||||
(defun company-dabbrev--candidates (prefix suffix)
|
||||
(let* ((case-fold-search company-dabbrev-code-ignore-case))
|
||||
(company-dabbrev-code--filter
|
||||
prefix suffix
|
||||
(company-dabbrev-code--table prefix))))
|
||||
|
||||
(defun company-dabbrev-code--table (prefix)
|
||||
(let ((regexp (company-dabbrev-code--make-regexp prefix)))
|
||||
(company-cache-fetch
|
||||
'dabbrev-code-candidates
|
||||
(lambda ()
|
||||
(company-dabbrev--search
|
||||
regexp
|
||||
company-dabbrev-code-time-limit
|
||||
(pcase company-dabbrev-code-other-buffers
|
||||
(`t (list major-mode))
|
||||
(`code company-dabbrev-code-modes)
|
||||
((pred functionp) (funcall company-dabbrev-code-other-buffers (current-buffer)))
|
||||
(`all `all))
|
||||
(not company-dabbrev-code-everywhere)))
|
||||
:expire t
|
||||
:check-tag
|
||||
(cons regexp company-dabbrev-code-completion-styles))))
|
||||
|
||||
(defun company-dabbrev-code--filter (prefix suffix table)
|
||||
(let ((completion-ignore-case company-dabbrev-code-ignore-case)
|
||||
(completion-styles (if (listp company-dabbrev-code-completion-styles)
|
||||
company-dabbrev-code-completion-styles
|
||||
completion-styles))
|
||||
(metadata (completion-metadata prefix table nil))
|
||||
res)
|
||||
(if (not company-dabbrev-code-completion-styles)
|
||||
(all-completions prefix table)
|
||||
(setq res (company--capf-completions
|
||||
prefix suffix
|
||||
table nil
|
||||
metadata))
|
||||
(when-let* ((sort-fn (completion-metadata-get metadata 'display-sort-function)))
|
||||
(setq company-dabbrev-code--sorted t)
|
||||
(setf (alist-get :completions res)
|
||||
(funcall sort-fn (alist-get :completions res))))
|
||||
(setq company-dabbrev--boundaries
|
||||
(company--capf-boundaries-markers
|
||||
(assoc-default :boundaries res)
|
||||
company-dabbrev--boundaries))
|
||||
(assoc-default :completions res))))
|
||||
|
||||
(provide 'company-dabbrev-code)
|
||||
;;; company-dabbrev-code.el ends here
|
||||
Binary file not shown.
|
|
@ -1,224 +0,0 @@
|
|||
;;; company-dabbrev.el --- dabbrev-like company-mode completion backend -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2018, 2021-2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'cl-lib)
|
||||
|
||||
(defgroup company-dabbrev nil
|
||||
"dabbrev-like completion backend."
|
||||
:group 'company)
|
||||
|
||||
(defcustom company-dabbrev-other-buffers 'all
|
||||
"Determines whether `company-dabbrev' should search other buffers.
|
||||
If `all', search all other buffers, except the ignored ones. If t, search
|
||||
buffers with the same major mode. This can also be a function that takes
|
||||
the current buffer as parameter and returns a list of major modes to
|
||||
search. See also `company-dabbrev-time-limit'."
|
||||
:type '(choice (const :tag "Off" nil)
|
||||
(const :tag "Same major mode" t)
|
||||
(const :tag "All" all)
|
||||
(function :tag "Function to return similar major-modes" group)))
|
||||
|
||||
(defcustom company-dabbrev-ignore-buffers "\\`[ *]"
|
||||
"Regexp matching the names of buffers to ignore.
|
||||
Or a function that returns non-nil for such buffers."
|
||||
:type '(choice (regexp :tag "Regexp")
|
||||
(function :tag "Predicate"))
|
||||
:package-version '(company . "0.9.0"))
|
||||
|
||||
(defcustom company-dabbrev-time-limit .1
|
||||
"Determines how many seconds `company-dabbrev' should look for matches."
|
||||
:type '(choice (const :tag "Off" nil)
|
||||
(number :tag "Seconds")))
|
||||
|
||||
(defcustom company-dabbrev-char-regexp "\\sw"
|
||||
"A regular expression matching the characters `company-dabbrev' looks for."
|
||||
:type 'regexp)
|
||||
|
||||
(defcustom company-dabbrev-ignore-case 'keep-prefix
|
||||
"Non-nil to ignore case when collecting completion candidates.
|
||||
When it's `keep-prefix', the text before point will remain unchanged after
|
||||
candidate is inserted, even some of its characters have different case."
|
||||
:type '(choice
|
||||
(const :tag "Don't ignore case" nil)
|
||||
(const :tag "Ignore case" t)
|
||||
(const :tag "Keep case before point" keep-prefix)))
|
||||
|
||||
(defcustom company-dabbrev-downcase 'case-replace
|
||||
"Whether to downcase the returned candidates.
|
||||
|
||||
The value of nil means keep them as-is.
|
||||
`case-replace' means use the value of `case-replace'.
|
||||
Any other value means downcase."
|
||||
:type '(choice
|
||||
(const :tag "Keep as-is" nil)
|
||||
(const :tag "Downcase" t)
|
||||
(const :tag "Use case-replace" case-replace)))
|
||||
|
||||
(defcustom company-dabbrev-minimum-length 4
|
||||
"The minimum length for the completion candidate to be included.
|
||||
This variable affects both `company-dabbrev' and `company-dabbrev-code'."
|
||||
:type 'integer
|
||||
:package-version '(company . "0.8.3"))
|
||||
|
||||
(defcustom company-dabbrev-ignore-invisible nil
|
||||
"Non-nil to skip invisible text."
|
||||
:type 'boolean
|
||||
:package-version '(company . "0.9.0"))
|
||||
|
||||
(defmacro company-dabbrev--time-limit-while (test start limit freq &rest body)
|
||||
(declare (indent 3) (debug t))
|
||||
`(let ((company-time-limit-while-counter 0))
|
||||
(catch 'done
|
||||
(while ,test
|
||||
,@body
|
||||
(and ,limit
|
||||
(= (cl-incf company-time-limit-while-counter) ,freq)
|
||||
(setq company-time-limit-while-counter 0)
|
||||
(> (float-time (time-since ,start)) ,limit)
|
||||
(throw 'done 'company-time-out))))))
|
||||
|
||||
(defun company-dabbrev--make-regexp ()
|
||||
(concat "\\(?:" company-dabbrev-char-regexp "\\)+"))
|
||||
|
||||
(defun company-dabbrev--search-buffer (regexp pos symbols start limit
|
||||
ignore-comments)
|
||||
(save-excursion
|
||||
(cl-labels ((maybe-collect-match
|
||||
()
|
||||
(let ((match (match-string-no-properties 0)))
|
||||
(when (and (>= (length match) company-dabbrev-minimum-length)
|
||||
(not (and company-dabbrev-ignore-invisible
|
||||
(invisible-p (match-beginning 0)))))
|
||||
(puthash match t symbols)))))
|
||||
(goto-char (if pos (1- pos) (point-min)))
|
||||
;; Search before pos.
|
||||
(let ((tmp-end (point)))
|
||||
(company-dabbrev--time-limit-while (and (not (input-pending-p))
|
||||
(> tmp-end (point-min)))
|
||||
start limit 1
|
||||
(ignore-errors
|
||||
(forward-char -10000))
|
||||
(forward-line 0)
|
||||
(save-excursion
|
||||
;; Before, we used backward search, but it matches non-greedily, and
|
||||
;; that forced us to use the "beginning/end of word" anchors in
|
||||
;; `company-dabbrev--make-regexp'. It's also about 2x slower.
|
||||
(while (and (not (input-pending-p))
|
||||
(re-search-forward regexp tmp-end t))
|
||||
(if (and ignore-comments (save-match-data (company-in-string-or-comment)))
|
||||
(re-search-forward "\\s>\\|\\s!\\|\\s\"" tmp-end t)
|
||||
(maybe-collect-match))))
|
||||
(setq tmp-end (point))))
|
||||
(goto-char (or pos (point-min)))
|
||||
;; Search after pos.
|
||||
(company-dabbrev--time-limit-while (and (not (input-pending-p))
|
||||
(re-search-forward regexp nil t))
|
||||
start limit 25
|
||||
(if (and ignore-comments (save-match-data (company-in-string-or-comment)))
|
||||
(re-search-forward "\\s>\\|\\s!\\|\\s\"" nil t)
|
||||
(maybe-collect-match)))
|
||||
symbols)))
|
||||
|
||||
(defun company-dabbrev--search (regexp &optional limit other-buffer-modes
|
||||
ignore-comments)
|
||||
(let* ((start (current-time))
|
||||
(symbols (company-dabbrev--search-buffer regexp (point)
|
||||
(make-hash-table :test 'equal)
|
||||
start limit
|
||||
ignore-comments)))
|
||||
(when other-buffer-modes
|
||||
(cl-dolist (buffer (delq (current-buffer) (buffer-list)))
|
||||
(unless (if (stringp company-dabbrev-ignore-buffers)
|
||||
(string-match-p company-dabbrev-ignore-buffers
|
||||
(buffer-name buffer))
|
||||
(funcall company-dabbrev-ignore-buffers buffer))
|
||||
(with-current-buffer buffer
|
||||
(when (or (eq other-buffer-modes 'all)
|
||||
(cl-some #'derived-mode-p other-buffer-modes))
|
||||
(setq symbols
|
||||
(company-dabbrev--search-buffer regexp nil symbols start
|
||||
limit ignore-comments)))))
|
||||
(and limit
|
||||
(> (float-time (time-since start)) limit)
|
||||
(cl-return))))
|
||||
symbols))
|
||||
|
||||
(defun company-dabbrev--prefix ()
|
||||
;; Emacs can't do greedy backward-search.
|
||||
(list
|
||||
(company-grab-line (format "\\(?:^\\| \\)[^ ]*?\\(\\(?:%s\\)*\\)"
|
||||
company-dabbrev-char-regexp)
|
||||
1)
|
||||
(and (looking-at (format "\\(?:%s\\)*" company-dabbrev-char-regexp))
|
||||
(match-string 0))))
|
||||
|
||||
(defun company-dabbrev--filter (prefix candidates)
|
||||
(let* ((completion-ignore-case company-dabbrev-ignore-case)
|
||||
(filtered (all-completions prefix candidates))
|
||||
(lp (length prefix))
|
||||
(downcase (if (eq company-dabbrev-downcase 'case-replace)
|
||||
case-replace
|
||||
company-dabbrev-downcase)))
|
||||
(when downcase
|
||||
(let ((ptr filtered))
|
||||
(while ptr
|
||||
(setcar ptr (downcase (car ptr)))
|
||||
(setq ptr (cdr ptr)))))
|
||||
(if (and (eq company-dabbrev-ignore-case 'keep-prefix)
|
||||
(not (= lp 0)))
|
||||
(company-substitute-prefix prefix filtered)
|
||||
filtered)))
|
||||
|
||||
(defun company-dabbrev--fetch ()
|
||||
(company-dabbrev--search (company-dabbrev--make-regexp)
|
||||
company-dabbrev-time-limit
|
||||
(pcase company-dabbrev-other-buffers
|
||||
(`t (list major-mode))
|
||||
((pred functionp) (funcall company-dabbrev-other-buffers (current-buffer)))
|
||||
(`all `all))))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-dabbrev (command &optional arg &rest _ignored)
|
||||
"dabbrev-like `company-mode' completion backend."
|
||||
(interactive (list 'interactive))
|
||||
(cl-case command
|
||||
(interactive (company-begin-backend 'company-dabbrev))
|
||||
(prefix (company-dabbrev--prefix))
|
||||
(candidates
|
||||
(company-dabbrev--filter
|
||||
arg
|
||||
;; FIXME: Only cache the result of non-interrupted scans?
|
||||
(company-cache-fetch 'dabbrev-candidates #'company-dabbrev--fetch
|
||||
:expire t)))
|
||||
(kind 'text)
|
||||
(no-cache t)
|
||||
(ignore-case (and company-dabbrev-ignore-case t))
|
||||
(duplicates t)))
|
||||
|
||||
(provide 'company-dabbrev)
|
||||
;;; company-dabbrev.el ends here
|
||||
Binary file not shown.
|
|
@ -1,146 +0,0 @@
|
|||
;;; company-etags.el --- company-mode completion backend for etags -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2015, 2018-2019, 2023-2024 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'cl-lib)
|
||||
(require 'etags)
|
||||
|
||||
(defgroup company-etags nil
|
||||
"Completion backend for etags."
|
||||
:group 'company)
|
||||
|
||||
(defcustom company-etags-use-main-table-list t
|
||||
"Always search `tags-table-list' if set.
|
||||
If this is disabled, `company-etags' will try to find the one table for each
|
||||
buffer automatically."
|
||||
:type '(choice (const :tag "off" nil)
|
||||
(const :tag "on" t)))
|
||||
|
||||
(defcustom company-etags-ignore-case nil
|
||||
"Non-nil to ignore case in completion candidates."
|
||||
:type 'boolean
|
||||
:package-version '(company . "0.7.3"))
|
||||
|
||||
(defcustom company-etags-everywhere nil
|
||||
"Non-nil to offer completions in comments and strings.
|
||||
Set it to t or to a list of major modes."
|
||||
:type '(choice (const :tag "Off" nil)
|
||||
(const :tag "Any supported mode" t)
|
||||
(repeat :tag "Some major modes"
|
||||
(symbol :tag "Major mode")))
|
||||
:package-version '(company . "0.9.0"))
|
||||
|
||||
(defcustom company-etags-completion-styles nil
|
||||
"Non-nil to use the completion styles for fuzzy matching."
|
||||
:type '(choice (const :tag "Prefix matching only" nil)
|
||||
(const :tag "Matching according to `completion-styles'" t)
|
||||
(list :tag "Custom list of styles" symbol))
|
||||
:package-version '(company . "1.0.0"))
|
||||
|
||||
(defvar company-etags-modes '(prog-mode c-mode objc-mode c++-mode java-mode
|
||||
jde-mode pascal-mode perl-mode python-mode))
|
||||
|
||||
(defvar-local company-etags-buffer-table 'unknown)
|
||||
(defvar-local company-etags--boundaries nil)
|
||||
|
||||
(defun company-etags-find-table ()
|
||||
(let ((file (expand-file-name
|
||||
"TAGS"
|
||||
(locate-dominating-file (or buffer-file-name
|
||||
default-directory)
|
||||
"TAGS"))))
|
||||
(when (and file (file-regular-p file))
|
||||
(list file))))
|
||||
|
||||
(defun company-etags-buffer-table ()
|
||||
(or (and company-etags-use-main-table-list tags-table-list)
|
||||
(if (eq company-etags-buffer-table 'unknown)
|
||||
(setq company-etags-buffer-table (company-etags-find-table))
|
||||
company-etags-buffer-table)))
|
||||
|
||||
(defun company-etags--candidates (prefix suffix)
|
||||
(let ((completion-ignore-case company-etags-ignore-case)
|
||||
(completion-styles (if (listp company-etags-completion-styles)
|
||||
company-etags-completion-styles
|
||||
completion-styles))
|
||||
(table (company-etags--table)))
|
||||
(and table
|
||||
(if company-etags-completion-styles
|
||||
(let ((res (company--capf-completions prefix suffix table)))
|
||||
(setq company-etags--boundaries
|
||||
(company--capf-boundaries-markers
|
||||
(assoc-default :boundaries res)
|
||||
company-etags--boundaries))
|
||||
(assoc-default :completions res))
|
||||
(all-completions prefix table)))))
|
||||
|
||||
(defun company-etags--table ()
|
||||
(let ((tags-table-list (company-etags-buffer-table))
|
||||
(tags-file-name tags-file-name))
|
||||
(and (or tags-file-name tags-table-list)
|
||||
(fboundp 'tags-completion-table)
|
||||
(save-excursion
|
||||
(visit-tags-table-buffer)
|
||||
(tags-completion-table)))))
|
||||
|
||||
(defun company-etags--expand-common (prefix suffix)
|
||||
(when company-etags-completion-styles
|
||||
(let ((completion-styles (if (listp company-etags-completion-styles)
|
||||
company-etags-completion-styles
|
||||
completion-styles)))
|
||||
(company--capf-expand-common prefix suffix
|
||||
(company-etags--table)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-etags (command &optional arg &rest rest)
|
||||
"`company-mode' completion backend for etags."
|
||||
(interactive (list 'interactive))
|
||||
(cl-case command
|
||||
(interactive (company-begin-backend 'company-etags))
|
||||
(prefix (and (cl-some #'derived-mode-p company-etags-modes)
|
||||
(or (eq t company-etags-everywhere)
|
||||
(cl-some #'derived-mode-p company-etags-everywhere)
|
||||
(not (company-in-string-or-comment)))
|
||||
(company-etags-buffer-table)
|
||||
(company-grab-symbol-parts)))
|
||||
(candidates (company-etags--candidates arg (car rest)))
|
||||
(adjust-boundaries (and company-etags-completion-styles
|
||||
(company--capf-boundaries
|
||||
company-etags--boundaries)))
|
||||
(expand-common (company-etags--expand-common arg (car rest)))
|
||||
(no-cache company-etags-completion-styles)
|
||||
(location (let ((tags-table-list (company-etags-buffer-table)))
|
||||
(when (fboundp 'find-tag-noselect)
|
||||
(save-excursion
|
||||
(let ((buffer (find-tag-noselect arg)))
|
||||
(cons buffer (with-current-buffer buffer (point))))))))
|
||||
(match (when company-etags-completion-styles
|
||||
(company--match-from-capf-face arg)))
|
||||
(ignore-case company-etags-ignore-case)))
|
||||
|
||||
(provide 'company-etags)
|
||||
;;; company-etags.el ends here
|
||||
Binary file not shown.
|
|
@ -1,157 +0,0 @@
|
|||
;;; company-files.el --- company-mode completion backend for file names -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2024 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'cl-lib)
|
||||
|
||||
(defgroup company-files nil
|
||||
"Completion backend for file names."
|
||||
:group 'company)
|
||||
|
||||
(defcustom company-files-exclusions nil
|
||||
"A list of file name extensions and directory names to ignore.
|
||||
The values should use the same format as `completion-ignored-extensions'."
|
||||
:type '(repeat (string :tag "File extension or directory name"))
|
||||
:package-version '(company . "0.9.1"))
|
||||
|
||||
(defun company-files--directory-files (dir prefix)
|
||||
;; Don't use directory-files. It produces directories without trailing /.
|
||||
(condition-case _err
|
||||
(let ((comp (sort (file-name-all-completions prefix dir)
|
||||
(lambda (s1 s2) (string-lessp (downcase s1) (downcase s2))))))
|
||||
(when company-files-exclusions
|
||||
(setq comp (company-files--exclusions-filtered comp)))
|
||||
(if (string-empty-p prefix)
|
||||
(delete "../" (delete "./" comp))
|
||||
comp))
|
||||
(file-error nil)))
|
||||
|
||||
(defun company-files--exclusions-filtered (completions)
|
||||
(let* ((dir-exclusions (cl-remove-if-not #'company-files--trailing-slash-p
|
||||
company-files-exclusions))
|
||||
(file-exclusions (cl-set-difference company-files-exclusions
|
||||
dir-exclusions)))
|
||||
(cl-loop for c in completions
|
||||
unless (if (company-files--trailing-slash-p c)
|
||||
(member c dir-exclusions)
|
||||
(cl-find-if (lambda (exclusion)
|
||||
(string-suffix-p exclusion c))
|
||||
file-exclusions))
|
||||
collect c)))
|
||||
|
||||
(defvar company-files--regexps
|
||||
(let* ((root (if (eq system-type 'windows-nt)
|
||||
"[a-zA-Z]:/"
|
||||
"/"))
|
||||
(begin (concat "\\(?:\\.\\{1,2\\}/\\|~/\\|" root "\\)")))
|
||||
(list (concat "\"\\(" begin "[^\"\n]*\\)")
|
||||
(concat "\'\\(" begin "[^\'\n]*\\)")
|
||||
(concat "\\(?:[ \t=\[]\\|^\\)\\(" begin "[^ \t\n]*\\)"))))
|
||||
|
||||
(defun company-files--grab-existing-name ()
|
||||
;; Grab the file name.
|
||||
;; When surrounded with quotes, it can include spaces.
|
||||
(let (file dir)
|
||||
(and (cl-dolist (regexp company-files--regexps)
|
||||
(when (setq file (company-grab-line regexp 1))
|
||||
(cl-return file)))
|
||||
(company-files--connected-p file)
|
||||
(setq dir (file-name-directory file))
|
||||
(not (string-match "//" dir))
|
||||
(file-exists-p dir)
|
||||
file)))
|
||||
|
||||
(defun company-files--connected-p (file)
|
||||
(or (not (file-remote-p file))
|
||||
(file-remote-p file nil t)))
|
||||
|
||||
(defun company-files--trailing-slash-p (file)
|
||||
;; `file-directory-p' is very expensive on remotes. We are relying on
|
||||
;; `file-name-all-completions' returning directories with trailing / instead.
|
||||
(let ((len (length file)))
|
||||
(and (> len 0) (eq (aref file (1- len)) ?/))))
|
||||
|
||||
(defvar company-files--completion-cache nil)
|
||||
|
||||
(defun company-files--complete (_prefix)
|
||||
(let* ((full-prefix (company-files--grab-existing-name))
|
||||
(dir (file-name-directory full-prefix))
|
||||
(file (file-name-nondirectory full-prefix))
|
||||
(key (list file
|
||||
(expand-file-name dir)
|
||||
(nth 5 (file-attributes dir))))
|
||||
(completion-ignore-case read-file-name-completion-ignore-case))
|
||||
(unless (or (company-file--keys-match-p key (car company-files--completion-cache))
|
||||
(not (company-files--connected-p dir)))
|
||||
(let* ((candidates (company-files--directory-files dir file))
|
||||
(directories (unless (file-remote-p dir)
|
||||
(cl-remove-if-not (lambda (f)
|
||||
(company-files--trailing-slash-p f))
|
||||
candidates)))
|
||||
(children (and directories
|
||||
(cl-mapcan (lambda (d)
|
||||
(company-files--directory-files d ""))
|
||||
directories))))
|
||||
(setq company-files--completion-cache
|
||||
(cons key (append candidates children)))))
|
||||
(all-completions file (cdr company-files--completion-cache))))
|
||||
|
||||
(defun company-files--prefix ()
|
||||
(let ((existing (company-files--grab-existing-name)))
|
||||
(when existing
|
||||
(list existing (company-grab-suffix "[^ '\"\t\n\r/]*/?")))))
|
||||
|
||||
(defun company-file--keys-match-p (new old)
|
||||
(and (equal (cdr old) (cdr new))
|
||||
(string-prefix-p (car old) (car new))))
|
||||
|
||||
(defun company-files--adjust-boundaries (_file prefix suffix)
|
||||
(cons
|
||||
(file-name-nondirectory prefix)
|
||||
suffix))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-files (command &optional arg &rest rest)
|
||||
"`company-mode' completion backend existing file names.
|
||||
Completions works for proper absolute and relative files paths.
|
||||
File paths with spaces are only supported inside strings."
|
||||
(interactive (list 'interactive))
|
||||
(cl-case command
|
||||
(interactive (company-begin-backend 'company-files))
|
||||
(prefix (company-files--prefix))
|
||||
(candidates
|
||||
(company-files--complete arg))
|
||||
(adjust-boundaries
|
||||
(company-files--adjust-boundaries arg (nth 0 rest) (nth 1 rest)))
|
||||
(location (cons (dired-noselect
|
||||
(file-name-directory (directory-file-name arg))) 1))
|
||||
(kind (if (string-suffix-p "/" arg) 'folder 'file))
|
||||
(sorted t)
|
||||
(no-cache t)))
|
||||
|
||||
(provide 'company-files)
|
||||
;;; company-files.el ends here
|
||||
Binary file not shown.
|
|
@ -1,160 +0,0 @@
|
|||
;;; company-gtags.el --- company-mode completion backend for GNU Global -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2021, 2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'company-template)
|
||||
(require 'cl-lib)
|
||||
|
||||
(defgroup company-gtags nil
|
||||
"Completion backend for GNU Global."
|
||||
:group 'company)
|
||||
|
||||
(define-obsolete-variable-alias
|
||||
'company-gtags-gnu-global-program-name
|
||||
'company-gtags-executable "earlier")
|
||||
|
||||
(defcustom company-gtags-executable
|
||||
(executable-find "global")
|
||||
"Location of GNU global executable."
|
||||
:type 'string)
|
||||
|
||||
(defcustom company-gtags-insert-arguments t
|
||||
"When non-nil, insert function arguments as a template after completion."
|
||||
:type 'boolean
|
||||
:package-version '(company . "0.8.1"))
|
||||
|
||||
(defvar-local company-gtags--tags-available-p 'unknown)
|
||||
(defvar-local company-gtags--executable 'unknown)
|
||||
|
||||
(defcustom company-gtags-modes '(prog-mode jde-mode)
|
||||
"Modes that use `company-gtags'.
|
||||
In all these modes (and their derivatives) `company-gtags' will perform
|
||||
completion."
|
||||
:type '(repeat (symbol :tag "Major mode"))
|
||||
:package-version '(company . "0.8.4"))
|
||||
|
||||
(defun company-gtags--tags-available-p ()
|
||||
(if (eq company-gtags--tags-available-p 'unknown)
|
||||
(setq company-gtags--tags-available-p
|
||||
(locate-dominating-file buffer-file-name "GTAGS"))
|
||||
company-gtags--tags-available-p))
|
||||
|
||||
;; Avoid byte-compilation warnings on Emacs < 27.
|
||||
(declare-function with-connection-local-variables "files-x")
|
||||
(declare-function connection-local-set-profile-variables "files-x")
|
||||
(declare-function connection-local-set-profiles "files-x")
|
||||
|
||||
(defun company-gtags--executable ()
|
||||
(cond
|
||||
((not (eq company-gtags--executable 'unknown)) ;; the value is already cached
|
||||
company-gtags--executable)
|
||||
((and (version<= "27" emacs-version) ;; can search remotely to set
|
||||
(file-remote-p default-directory))
|
||||
|
||||
(with-connection-local-variables
|
||||
(if (boundp 'company-gtags--executable-connection)
|
||||
(setq-local company-gtags--executable ;; use if defined as connection-local
|
||||
company-gtags--executable-connection)
|
||||
|
||||
;; Else search and set as connection local for next uses.
|
||||
(setq-local company-gtags--executable
|
||||
(with-no-warnings (executable-find "global" t)))
|
||||
(let* ((host (file-remote-p default-directory 'host))
|
||||
(symvars (intern (concat host "-vars")))) ;; profile name
|
||||
|
||||
(connection-local-set-profile-variables
|
||||
symvars
|
||||
`((company-gtags--executable-connection . ,company-gtags--executable)))
|
||||
|
||||
(connection-local-set-profiles `(:machine ,host) symvars))
|
||||
company-gtags--executable)))
|
||||
(t ;; use default value (searched locally)
|
||||
company-gtags-executable)))
|
||||
|
||||
(defun company-gtags--fetch-tags (prefix)
|
||||
(with-temp-buffer
|
||||
;; For some reason Global v 6.6.3 is prone to returning exit status 1
|
||||
;; even on successful searches when '-T' is used.
|
||||
(when (/= 3 (process-file (company-gtags--executable) nil
|
||||
;; "-T" goes through all the tag files listed in GTAGSLIBPATH
|
||||
(list (current-buffer) nil) nil "-xGqT" (concat "^" prefix)))
|
||||
(goto-char (point-min))
|
||||
(cl-loop while
|
||||
(re-search-forward (concat
|
||||
"^"
|
||||
"\\([^ ]*\\)" ;; completion
|
||||
"[ \t]+\\([[:digit:]]+\\)" ;; linum
|
||||
"[ \t]+\\([^ \t]+\\)" ;; file
|
||||
"[ \t]+\\(.*\\)" ;; definition
|
||||
"$"
|
||||
) nil t)
|
||||
collect
|
||||
(propertize (match-string 1)
|
||||
'meta (match-string 4)
|
||||
'location (cons (expand-file-name (match-string 3))
|
||||
(string-to-number (match-string 2)))
|
||||
)))))
|
||||
|
||||
(defun company-gtags--annotation (arg)
|
||||
(let ((meta (get-text-property 0 'meta arg)))
|
||||
(when (string-match (concat (regexp-quote arg) " *(") meta)
|
||||
(with-temp-buffer
|
||||
(let ((start (match-end 0)))
|
||||
(insert meta)
|
||||
(goto-char start)
|
||||
(condition-case nil
|
||||
(forward-sexp)
|
||||
(scan-error
|
||||
(goto-char (point-max))))
|
||||
(buffer-substring-no-properties
|
||||
start (point)))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-gtags (command &optional arg &rest _ignored)
|
||||
"`company-mode' completion backend for GNU Global."
|
||||
(interactive (list 'interactive))
|
||||
(cl-case command
|
||||
(interactive (company-begin-backend 'company-gtags))
|
||||
(prefix (and (company-gtags--executable)
|
||||
buffer-file-name
|
||||
(cl-some #'derived-mode-p company-gtags-modes)
|
||||
(not (company-in-string-or-comment))
|
||||
(company-gtags--tags-available-p)
|
||||
(or (company-grab-symbol) 'stop)))
|
||||
(candidates (company-gtags--fetch-tags arg))
|
||||
(sorted t)
|
||||
(duplicates t)
|
||||
(annotation (company-gtags--annotation arg))
|
||||
(meta (get-text-property 0 'meta arg))
|
||||
(location (get-text-property 0 'location arg))
|
||||
(post-completion (let ((anno (company-gtags--annotation arg)))
|
||||
(when (and company-gtags-insert-arguments anno)
|
||||
(insert anno)
|
||||
(company-template-c-like-templatify anno))))))
|
||||
|
||||
(provide 'company-gtags)
|
||||
;;; company-gtags.el ends here
|
||||
Binary file not shown.
|
|
@ -1,99 +0,0 @@
|
|||
;;; company-ispell.el --- company-mode completion backend using Ispell -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2016, 2018, 2021, 2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'cl-lib)
|
||||
(require 'ispell)
|
||||
|
||||
(defgroup company-ispell nil
|
||||
"Completion backend using Ispell."
|
||||
:group 'company)
|
||||
|
||||
(defun company--set-dictionary (symbol value)
|
||||
(set-default-toplevel-value symbol value)
|
||||
(company-cache-delete 'ispell-candidates))
|
||||
|
||||
(defcustom company-ispell-dictionary nil
|
||||
"Dictionary to use for `company-ispell'.
|
||||
|
||||
If nil, use `ispell-complete-word-dict' or `ispell-alternate-dictionary'."
|
||||
:type '(choice (const :tag "default (nil)" nil)
|
||||
(file :tag "dictionary" t))
|
||||
:set #'company--set-dictionary)
|
||||
|
||||
(defvar company-ispell-available 'unknown)
|
||||
|
||||
(defun company-ispell-available ()
|
||||
(when (eq company-ispell-available 'unknown)
|
||||
(condition-case err
|
||||
(progn
|
||||
(ispell-lookup-words "WHATEVER")
|
||||
(setq company-ispell-available t))
|
||||
(error
|
||||
(message "Company-Ispell: %s" (error-message-string err))
|
||||
(setq company-ispell-available nil))))
|
||||
company-ispell-available)
|
||||
|
||||
(defun company--ispell-dict ()
|
||||
"Determine which dictionary to use."
|
||||
(let ((dict (or company-ispell-dictionary
|
||||
ispell-complete-word-dict
|
||||
ispell-alternate-dictionary)))
|
||||
(when dict
|
||||
(expand-file-name dict))))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-ispell (command &optional arg &rest _ignored)
|
||||
"`company-mode' completion backend using Ispell."
|
||||
(interactive (list 'interactive))
|
||||
(cl-case command
|
||||
(interactive (company-begin-backend 'company-ispell))
|
||||
(prefix (when (company-ispell-available)
|
||||
(list
|
||||
(company-grab-word)
|
||||
(company-grab-word-suffix))))
|
||||
(candidates
|
||||
(let* ((dict (company--ispell-dict))
|
||||
(all-words
|
||||
(company-cache-fetch 'ispell-candidates
|
||||
(lambda () (ispell-lookup-words "" dict))
|
||||
:check-tag dict))
|
||||
(completion-ignore-case t))
|
||||
(if (string-empty-p arg)
|
||||
;; Small optimization.
|
||||
all-words
|
||||
(company-substitute-prefix
|
||||
arg
|
||||
;; Work around issue #284.
|
||||
(all-completions arg all-words)))))
|
||||
(kind 'text)
|
||||
(no-cache t)
|
||||
(sorted t)
|
||||
(ignore-case t)))
|
||||
|
||||
(provide 'company-ispell)
|
||||
;;; company-ispell.el ends here
|
||||
Binary file not shown.
|
|
@ -1,481 +0,0 @@
|
|||
;;; company-keywords.el --- A company backend for programming language keywords -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2018, 2020-2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'cl-lib)
|
||||
(eval-when-compile (require 'make-mode))
|
||||
|
||||
(defgroup company-keywords nil
|
||||
"Completion backend for keywords."
|
||||
:group 'company)
|
||||
|
||||
(defcustom company-keywords-ignore-case nil
|
||||
"Non-nil to ignore case in completion candidates."
|
||||
:type 'boolean)
|
||||
|
||||
(defun company-keywords-upper-lower (&rest lst)
|
||||
;; Upcase order is different for _.
|
||||
(nconc (sort (mapcar 'upcase lst) 'string<) lst))
|
||||
|
||||
(defvar company-keywords-alist
|
||||
;; Please contribute corrections or additions.
|
||||
`((c++-mode
|
||||
;; from https://en.cppreference.com/w/cpp/keyword
|
||||
"alignas" "alignof" "and" "and_eq" "asm" "atomic_cancel" "atomic_commit"
|
||||
"atomic_noexcept" "auto" "bitand" "bitor" "bool" "break" "case" "catch"
|
||||
"char" "char16_t" "char32_t" "char8_t" "class" "co_await" "co_return"
|
||||
"co_yield" "compl" "concept" "const" "const_cast" "consteval" "constexpr"
|
||||
"constinit" "continue" "decltype" "default" "delete" "do" "double"
|
||||
"dynamic_cast" "else" "enum" "explicit" "export" "extern" "false" "final"
|
||||
"float" "for" "friend" "goto" "if" "import" "inline" "int" "long" "module"
|
||||
"mutable" "namespace" "new" "noexcept" "not" "not_eq" "nullptr" "operator"
|
||||
"or" "or_eq" "override" "private" "protected" "public" "reflexpr" "register"
|
||||
"reinterpret_cast" "requires" "return" "short" "signed" "sizeof" "static"
|
||||
"static_assert" "static_cast" "struct" "switch" "synchronized" "template"
|
||||
"this" "thread_local" "throw" "true" "try" "typedef" "typeid" "typename"
|
||||
"union" "unsigned" "using" "virtual" "void" "volatile" "wchar_t" "while"
|
||||
"xor" "xor_eq")
|
||||
(c-mode
|
||||
;; from https://en.cppreference.com/w/c/keyword
|
||||
"_Alignas" "_Alignof" "_Atomic" "_Bool" "_Complex"
|
||||
"_Decimal128" "_Decimal32" "_Decimal64" "_Generic" "_Imaginary"
|
||||
"_Noreturn" "_Static_assert" "_Thread_local" "__asm__" "asm"
|
||||
"auto" "break" "case" "char" "const" "continue" "default" "do"
|
||||
"double" "else" "enum" "extern" "float" "for" "goto" "if" "inline"
|
||||
"int" "long" "register" "restrict" "return" "short" "signed" "sizeof"
|
||||
"static" "struct" "switch" "typedef" "union" "unsigned" "void" "volatile"
|
||||
"while")
|
||||
(crystal-mode
|
||||
;; from https://github.com/crystal-lang/crystal-book/issues/124#issuecomment-1008311227
|
||||
"abstract" "alias" "annotation" "as" "as?" "asm" "begin" "break" "case" "class"
|
||||
"def" "do" "else" "elsif" "end" "ensure" "enum" "extend" "false" "for" "fun"
|
||||
"if" "in" "include" "instance_sizeof" "is_a?" "lib" "macro" "module" "next"
|
||||
"nil" "nil?" "of" "offsetof" "out" "pointerof" "private" "protected" "require"
|
||||
"rescue" "responds_to?" "return" "select" "self" "sizeof" "struct" "super"
|
||||
"then" "true" "type" "typeof" "uninitialized" "union" "unless" "until" "verbatim"
|
||||
"when" "while" "with" "yield")
|
||||
(csharp-mode
|
||||
"abstract" "add" "alias" "as" "base" "bool" "break" "byte" "case"
|
||||
"catch" "char" "checked" "class" "const" "continue" "decimal" "default"
|
||||
"delegate" "do" "double" "else" "enum" "event" "explicit" "extern"
|
||||
"false" "finally" "fixed" "float" "for" "foreach" "get" "global" "goto"
|
||||
"if" "implicit" "in" "int" "interface" "internal" "is" "lock" "long"
|
||||
"namespace" "new" "null" "object" "operator" "out" "override" "params"
|
||||
"partial" "private" "protected" "public" "readonly" "ref" "remove"
|
||||
"return" "sbyte" "sealed" "set" "short" "sizeof" "stackalloc" "static"
|
||||
"string" "struct" "switch" "this" "throw" "true" "try" "typeof" "uint"
|
||||
"ulong" "unchecked" "unsafe" "ushort" "using" "value" "var" "virtual"
|
||||
"void" "volatile" "where" "while" "yield")
|
||||
(d-mode
|
||||
;; from http://www.digitalmars.com/d/2.0/lex.html
|
||||
"abstract" "alias" "align" "asm"
|
||||
"assert" "auto" "body" "bool" "break" "byte" "case" "cast" "catch"
|
||||
"cdouble" "cent" "cfloat" "char" "class" "const" "continue" "creal"
|
||||
"dchar" "debug" "default" "delegate" "delete" "deprecated" "do"
|
||||
"double" "else" "enum" "export" "extern" "false" "final" "finally"
|
||||
"float" "for" "foreach" "foreach_reverse" "function" "goto" "idouble"
|
||||
"if" "ifloat" "import" "in" "inout" "int" "interface" "invariant"
|
||||
"ireal" "is" "lazy" "long" "macro" "mixin" "module" "new" "nothrow"
|
||||
"null" "out" "override" "package" "pragma" "private" "protected"
|
||||
"public" "pure" "real" "ref" "return" "scope" "short" "static" "struct"
|
||||
"super" "switch" "synchronized" "template" "this" "throw" "true" "try"
|
||||
"typedef" "typeid" "typeof" "ubyte" "ucent" "uint" "ulong" "union"
|
||||
"unittest" "ushort" "version" "void" "volatile" "wchar" "while" "with")
|
||||
(elixir-mode
|
||||
;; from https://hexdocs.pm/elixir/Kernel.html
|
||||
"__CALLER__" "__DIR__" "__ENV__" "__MODULE__" "__STACKTRACE__"
|
||||
"__aliases__" "__block__" "abs" "alias" "alias!" "and" "apply"
|
||||
"binary_part" "binary_slice" "binding" "bit_size" "byte_size" "case" "ceil"
|
||||
"cond" "dbg" "def" "defdelegate" "defexception" "defguard" "defguardp"
|
||||
"defimpl" "defmacro" "defmacrop" "defmodule" "defoverridable" "defp"
|
||||
"defprotocol" "defstruct" "destructure" "div" "elem" "exit" "floor" "fn"
|
||||
"for" "function_exported?" "get_and_update_in" "get_in" "hd" "if" "import"
|
||||
"in" "inspect" "is_atom" "is_binary" "is_bitstring" "is_boolean"
|
||||
"is_exception" "is_float" "is_function" "is_integer" "is_list" "is_map"
|
||||
"is_map_key" "is_nil" "is_number" "is_pid" "is_port" "is_reference"
|
||||
"is_struct" "is_tuple" "length" "macro_exported?" "make_ref" "map_size"
|
||||
"match?" "max" "min" "node" "not" "or" "pop_in" "put_elem" "put_in" "quote"
|
||||
"raise" "receive" "rem" "require" "reraise" "round" "self" "send" "spawn"
|
||||
"spawn_link" "spawn_monitor" "struct" "struct!" "super" "tap" "then"
|
||||
"throw" "tl" "to_charlist" "to_string" "trunc" "try" "tuple_size" "unless"
|
||||
"unquote" "unquote_splicing" "update_in" "use" "var!" "with")
|
||||
(erlang-mode
|
||||
;; from https://www.erlang.org/docs/20/reference_manual/introduction.html#id63536
|
||||
"after" "and" "andalso" "band" "begin" "bnot" "bor" "bsl" "bsr" "bxor"
|
||||
"case" "catch" "cond" "div" "end" "fun" "if" "let" "not" "of" "or" "orelse"
|
||||
"receive" "rem" "try" "when" "xor")
|
||||
(f90-mode .
|
||||
;; from f90.el
|
||||
;; ".AND." ".GE." ".GT." ".LT." ".LE." ".NE." ".OR." ".TRUE." ".FALSE."
|
||||
,(company-keywords-upper-lower
|
||||
"abs" "abstract" "achar" "acos" "adjustl" "adjustr" "aimag" "aint"
|
||||
"align" "all" "all_prefix" "all_scatter" "all_suffix" "allocatable"
|
||||
"allocate" "allocated" "and" "anint" "any" "any_prefix" "any_scatter"
|
||||
"any_suffix" "asin" "assign" "assignment" "associate" "associated"
|
||||
"asynchronous" "atan" "atan2" "backspace" "bind" "bit_size" "block"
|
||||
"btest" "c_alert" "c_associated" "c_backspace" "c_bool"
|
||||
"c_carriage_return" "c_char" "c_double" "c_double_complex" "c_f_pointer"
|
||||
"c_f_procpointer" "c_float" "c_float_complex" "c_form_feed" "c_funloc"
|
||||
"c_funptr" "c_horizontal_tab" "c_int" "c_int16_t" "c_int32_t" "c_int64_t"
|
||||
"c_int8_t" "c_int_fast16_t" "c_int_fast32_t" "c_int_fast64_t"
|
||||
"c_int_fast8_t" "c_int_least16_t" "c_int_least32_t" "c_int_least64_t"
|
||||
"c_int_least8_t" "c_intmax_t" "c_intptr_t" "c_loc" "c_long"
|
||||
"c_long_double" "c_long_double_complex" "c_long_long" "c_new_line"
|
||||
"c_null_char" "c_null_funptr" "c_null_ptr" "c_ptr" "c_short"
|
||||
"c_signed_char" "c_size_t" "c_vertical_tab" "call" "case" "ceiling"
|
||||
"char" "character" "character_storage_size" "class" "close" "cmplx"
|
||||
"command_argument_count" "common" "complex" "conjg" "contains" "continue"
|
||||
"copy_prefix" "copy_scatter" "copy_suffix" "cos" "cosh" "count"
|
||||
"count_prefix" "count_scatter" "count_suffix" "cpu_time" "cshift"
|
||||
"cycle" "cyclic" "data" "date_and_time" "dble" "deallocate" "deferred"
|
||||
"digits" "dim" "dimension" "distribute" "do" "dot_product" "double"
|
||||
"dprod" "dynamic" "elemental" "else" "elseif" "elsewhere" "end" "enddo"
|
||||
"endfile" "endif" "entry" "enum" "enumerator" "eoshift" "epsilon" "eq"
|
||||
"equivalence" "eqv" "error_unit" "exit" "exp" "exponent" "extends"
|
||||
"extends_type_of" "external" "extrinsic" "false" "file_storage_size"
|
||||
"final" "floor" "flush" "forall" "format" "fraction" "function" "ge"
|
||||
"generic" "get_command" "get_command_argument" "get_environment_variable"
|
||||
"goto" "grade_down" "grade_up" "gt" "hpf_alignment" "hpf_distribution"
|
||||
"hpf_template" "huge" "iachar" "iall" "iall_prefix" "iall_scatter"
|
||||
"iall_suffix" "iand" "iany" "iany_prefix" "iany_scatter" "iany_suffix"
|
||||
"ibclr" "ibits" "ibset" "ichar" "ieee_arithmetic" "ieee_exceptions"
|
||||
"ieee_features" "ieee_get_underflow_mode" "ieee_set_underflow_mode"
|
||||
"ieee_support_underflow_control" "ieor" "if" "ilen" "implicit"
|
||||
"import" "include" "independent" "index" "inherit" "input_unit"
|
||||
"inquire" "int" "integer" "intent" "interface" "intrinsic" "ior"
|
||||
"iostat_end" "iostat_eor" "iparity" "iparity_prefix" "iparity_scatter"
|
||||
"iparity_suffix" "ishft" "ishftc" "iso_c_binding" "iso_fortran_env"
|
||||
"kind" "lbound" "le" "leadz" "len" "len_trim" "lge" "lgt" "lle" "llt"
|
||||
"log" "log10" "logical" "lt" "matmul" "max" "maxexponent" "maxloc"
|
||||
"maxval" "maxval_prefix" "maxval_scatter" "maxval_suffix" "merge"
|
||||
"min" "minexponent" "minloc" "minval" "minval_prefix" "minval_scatter"
|
||||
"minval_suffix" "mod" "module" "modulo" "move_alloc" "mvbits" "namelist"
|
||||
"ne" "nearest" "neqv" "new" "new_line" "nint" "non_intrinsic"
|
||||
"non_overridable" "none" "nopass" "not" "null" "nullify"
|
||||
"number_of_processors" "numeric_storage_size" "only" "onto" "open"
|
||||
"operator" "optional" "or" "output_unit" "pack" "parameter" "parity"
|
||||
"parity_prefix" "parity_scatter" "parity_suffix" "pass" "pause"
|
||||
"pointer" "popcnt" "poppar" "precision" "present" "print" "private"
|
||||
"procedure" "processors" "processors_shape" "product" "product_prefix"
|
||||
"product_scatter" "product_suffix" "program" "protected" "public"
|
||||
"pure" "radix" "random_number" "random_seed" "range" "read" "real"
|
||||
"realign" "recursive" "redistribute" "repeat" "reshape" "result"
|
||||
"return" "rewind" "rrspacing" "same_type_as" "save" "scale" "scan"
|
||||
"select" "selected_char_kind" "selected_int_kind" "selected_real_kind"
|
||||
"sequence" "set_exponent" "shape" "sign" "sin" "sinh" "size" "spacing"
|
||||
"spread" "sqrt" "stop" "subroutine" "sum" "sum_prefix" "sum_scatter"
|
||||
"sum_suffix" "system_clock" "tan" "tanh" "target" "template" "then"
|
||||
"tiny" "transfer" "transpose" "trim" "true" "type" "ubound" "unpack"
|
||||
"use" "value" "verify" "volatile" "wait" "where" "while" "with" "write"))
|
||||
(go-mode
|
||||
;; 1. Keywords ref: https://golang.org/ref/spec#Keywords
|
||||
;; 2. Builtin functions and types ref: https://golang.org/pkg/builtin/
|
||||
"append" "bool" "break" "byte" "cap" "case" "chan" "close" "complex" "complex128"
|
||||
"complex64" "const" "continue" "copy" "default" "defer" "delete" "else" "error"
|
||||
"fallthrough" "false" "float32" "float64" "for" "func" "go" "goto" "if" "imag"
|
||||
"import" "int" "int16" "int32" "int64" "int8" "interface" "len" "make"
|
||||
"map" "new" "nil" "package" "panic" "print" "println" "range" "real" "recover"
|
||||
"return" "rune" "select" "string" "struct" "switch" "true" "type" "uint" "uint16"
|
||||
"uint32" "uint64" "uint8" "uintptr" "var")
|
||||
(java-mode
|
||||
"abstract" "assert" "boolean" "break" "byte" "case" "catch" "char" "class"
|
||||
"continue" "default" "do" "double" "else" "enum" "extends" "final"
|
||||
"finally" "float" "for" "if" "implements" "import" "instanceof" "int"
|
||||
"interface" "long" "native" "new" "package" "private" "protected" "public"
|
||||
"return" "short" "static" "strictfp" "super" "switch" "synchronized"
|
||||
"this" "throw" "throws" "transient" "try" "void" "volatile" "while")
|
||||
(javascript-mode
|
||||
;; https://tc39.github.io/ecma262/ + async, static and undefined
|
||||
"async" "await" "break" "case" "catch" "class" "const" "continue"
|
||||
"debugger" "default" "delete" "do" "else" "enum" "export" "extends" "false"
|
||||
"finally" "for" "function" "if" "import" "in" "instanceof" "let" "new"
|
||||
"null" "return" "static" "super" "switch" "this" "throw" "true" "try"
|
||||
"typeof" "undefined" "var" "void" "while" "with" "yield")
|
||||
(kotlin-mode
|
||||
"abstract" "annotation" "as" "break" "by" "catch" "class" "companion"
|
||||
"const" "constructor" "continue" "data" "do" "else" "enum" "false" "final"
|
||||
"finally" "for" "fun" "if" "import" "in" "init" "inner" "interface"
|
||||
"internal" "is" "lateinit" "nested" "null" "object" "open" "out" "override"
|
||||
"package" "private" "protected" "public" "return" "super" "this" "throw"
|
||||
"trait" "true" "try" "typealias" "val" "var" "when" "while")
|
||||
(lua-mode
|
||||
;; https://www.lua.org/manual/5.3/manual.html
|
||||
"and" "break" "do" "else" "elseif" "end" "false" "for" "function" "goto" "if"
|
||||
"in" "local" "nil" "not" "or" "repeat" "return" "then" "true" "until" "while")
|
||||
(nim-mode
|
||||
;; https://nim-lang.org/docs/manual.html#lexical-analysis-identifiers-amp-keywords
|
||||
"addr" "and" "as" "asm" "bind" "block" "break" "case" "cast" "concept" "const" "continue"
|
||||
"converter" "defer" "discard" "distinct" "div" "do" "elif" "else" "end" "enum" "except"
|
||||
"export" "finally" "for" "from" "func" "if" "import" "in" "include" "interface" "is" "isnot"
|
||||
"iterator" "let" "macro" "method" "mixin" "mod" "nil" "not" "notin" "object" "of" "or" "out"
|
||||
"proc" "ptr" "raise" "ref" "return" "shl" "shr" "static" "template" "try" "tuple" "type"
|
||||
"using" "var" "when" "while" "xor" "yield")
|
||||
(objc-mode
|
||||
"@catch" "@class" "@encode" "@end" "@finally" "@implementation"
|
||||
"@interface" "@private" "@protected" "@protocol" "@public"
|
||||
"@selector" "@synchronized" "@throw" "@try" "alloc" "autorelease"
|
||||
"bycopy" "byref" "in" "inout" "oneway" "out" "release" "retain")
|
||||
(perl-mode
|
||||
;; from cperl.el
|
||||
"AUTOLOAD" "BEGIN" "CHECK" "CORE" "DESTROY" "END" "INIT" "__END__"
|
||||
"__FILE__" "__LINE__" "abs" "accept" "alarm" "and" "atan2" "bind"
|
||||
"binmode" "bless" "caller" "chdir" "chmod" "chomp" "chop" "chown" "chr"
|
||||
"chroot" "close" "closedir" "cmp" "connect" "continue" "cos"
|
||||
"crypt" "dbmclose" "dbmopen" "defined" "delete" "die" "do" "dump" "each"
|
||||
"else" "elsif" "endgrent" "endhostent" "endnetent" "endprotoent"
|
||||
"endpwent" "endservent" "eof" "eq" "eval" "exec" "exists" "exit" "exp"
|
||||
"fcntl" "fileno" "flock" "for" "foreach" "fork" "format" "formline"
|
||||
"ge" "getc" "getgrent" "getgrgid" "getgrnam" "gethostbyaddr"
|
||||
"gethostbyname" "gethostent" "getlogin" "getnetbyaddr" "getnetbyname"
|
||||
"getnetent" "getpeername" "getpgrp" "getppid" "getpriority"
|
||||
"getprotobyname" "getprotobynumber" "getprotoent" "getpwent" "getpwnam"
|
||||
"getpwuid" "getservbyname" "getservbyport" "getservent" "getsockname"
|
||||
"getsockopt" "glob" "gmtime" "goto" "grep" "gt" "hex" "if" "index" "int"
|
||||
"ioctl" "join" "keys" "kill" "last" "lc" "lcfirst" "le" "length"
|
||||
"link" "listen" "local" "localtime" "lock" "log" "lstat" "lt" "map"
|
||||
"mkdir" "msgctl" "msgget" "msgrcv" "msgsnd" "my" "ne" "next" "no"
|
||||
"not" "oct" "open" "opendir" "or" "ord" "our" "pack" "package" "pipe"
|
||||
"pop" "pos" "print" "printf" "push" "q" "qq" "quotemeta" "qw" "qx"
|
||||
"rand" "read" "readdir" "readline" "readlink" "readpipe" "recv" "redo"
|
||||
"ref" "rename" "require" "reset" "return" "reverse" "rewinddir" "rindex"
|
||||
"rmdir" "scalar" "seek" "seekdir" "select" "semctl" "semget" "semop"
|
||||
"send" "setgrent" "sethostent" "setnetent" "setpgrp" "setpriority"
|
||||
"setprotoent" "setpwent" "setservent" "setsockopt" "shift" "shmctl"
|
||||
"shmget" "shmread" "shmwrite" "shutdown" "sin" "sleep" "socket"
|
||||
"socketpair" "sort" "splice" "split" "sprintf" "sqrt" "srand" "stat"
|
||||
"study" "sub" "substr" "symlink" "syscall" "sysopen" "sysread" "system"
|
||||
"syswrite" "tell" "telldir" "tie" "time" "times" "tr" "truncate" "uc"
|
||||
"ucfirst" "umask" "undef" "unless" "unlink" "unpack" "unshift" "untie"
|
||||
"until" "use" "utime" "values" "vec" "wait" "waitpid"
|
||||
"wantarray" "warn" "while" "write" "x" "xor" "y")
|
||||
(php-mode ;; https://www.php.net/manual/reserved.php
|
||||
"Closure" "Error" "Exception" "Generator" "Throwable"
|
||||
"__CLASS__" "__DIR__" "__FILE__" "__FUNCTION__" "__LINE__" "__METHOD__"
|
||||
"__NAMESPACE__" "__TRAIT__"
|
||||
"abstract" "and" "array" "as" "bool" "break" "callable" "case" "catch"
|
||||
"class" "clone" "const" "continue" "declare" "default" "die" "do" "echo"
|
||||
"else" "elseif" "empty" "enddeclare" "endfor" "endforeach" "endif"
|
||||
"endswitch" "endwhile" "enum" "eval" "exit" "extends" "false" "final" "finally"
|
||||
"float" "fn" "for" "foreach" "function" "global" "goto" "if"
|
||||
"implements" "include" "include_once" "instanceof" "insteadof" "interface"
|
||||
"isset" "iterable" "list" "match" "namespace" "new" "null" "object" "or"
|
||||
"print" "private" "protected" "public" "readonly" "require" "require_once"
|
||||
"return" "self" "static" "string" "switch" "this" "throw" "trait" "true"
|
||||
"try" "unset" "use" "var" "void" "while" "xor" "yield" "yield from")
|
||||
(purescript-mode ;; purescript-font-lock.el
|
||||
"ado" "case" "class" "data" "default" "deriving" "do" "else" "if" "import"
|
||||
"in" "infix" "infixl" "infixr" "instance" "let" "module" "newtype" "of"
|
||||
"then" "type" "where")
|
||||
(python-mode
|
||||
;; https://docs.python.org/3/reference/lexical_analysis.html#keywords
|
||||
"False" "None" "True" "and" "as" "assert" "break" "class" "continue" "def"
|
||||
"del" "elif" "else" "except" "exec" "finally" "for" "from" "global" "if"
|
||||
"import" "in" "is" "lambda" "nonlocal" "not" "or" "pass" "print" "raise"
|
||||
"return" "try" "while" "with" "yield")
|
||||
(ruby-mode
|
||||
"BEGIN" "END" "alias" "and" "begin" "break" "case" "class" "def" "defined?"
|
||||
"do" "else" "elsif" "end" "ensure" "false" "for" "if" "in" "module"
|
||||
"next" "nil" "not" "or" "redo" "rescue" "retry" "return" "self" "super"
|
||||
"then" "true" "undef" "unless" "until" "when" "while" "yield")
|
||||
;; From https://doc.rust-lang.org/grammar.html#keywords
|
||||
;; but excluding unused reserved words: https://www.reddit.com/r/rust/comments/34fq0k/is_there_a_good_list_of_rusts_keywords/cqucvnj
|
||||
(rust-mode
|
||||
"Self"
|
||||
"as" "box" "break" "const" "continue" "crate" "else" "enum" "extern"
|
||||
"false" "fn" "for" "if" "impl" "in" "let" "loop" "macro" "match" "mod"
|
||||
"move" "mut" "pub" "ref" "return" "self" "static" "struct" "super"
|
||||
"trait" "true" "type" "unsafe" "use" "where" "while")
|
||||
; Extract from R7RS-small Tex: https://small.r7rs.org/
|
||||
(scheme-mode
|
||||
"abs" "acos" "angle" "append" "apply" "asin" "assoc" "assq" "assv"
|
||||
"atan" "binary-port?" "body" "boolean=?" "boolean?" "bytevector"
|
||||
"bytevector-append" "bytevector-copy" "bytevector-copy!"
|
||||
"bytevector-length" "bytevector-u8-ref" "bytevector-u8-set!"
|
||||
"bytevector?" "caaaar" "caaadr" "caaar" "caadar" "caaddr" "caadr"
|
||||
"caar" "cadaar" "cadadr" "cadar" "caddar" "cadddr" "caddr" "cadr"
|
||||
"call-with-port" "call-with-values" "car" "car-internal" "cdaaar"
|
||||
"cdaadr" "cdaar" "cdadar" "cdaddr" "cdadr" "cdar" "cddaar" "cddadr"
|
||||
"cddar" "cdddar" "cddddr" "cdddr" "cddr" "cdr" "ceiling"
|
||||
"char->integer" "char-alphabetic?" "char-ci<=?" "char-ci<?"
|
||||
"char-ci=?" "char-ci>=?" "char-ci>?" "char-downcase" "char-foldcase"
|
||||
"char-lower-case?" "char-numeric?" "char-ready?" "char-upcase"
|
||||
"char-upper-case?" "char-whitespace?" "char<=?" "char<?" "char=?"
|
||||
"char>=?" "char>?" "char?" "close-input-port" "close-output-port"
|
||||
"close-port" "command-line" "complex?" "cons" "cos"
|
||||
"current-error-port" "current-input-port" "current-jiffy"
|
||||
"current-output-port" "current-second" "delete-file" "denominator"
|
||||
"digit-value" "display" "dynamic-wind" "emergency-exit" "environment"
|
||||
"eof-object" "eof-object?" "eq?" "equal?" "eqv?" "error"
|
||||
"error-object-irritants" "error-object-message" "error-object?" "eval"
|
||||
"even?" "exact" "exact-integer-sqrt" "exact-integer?" "exact?" "exit"
|
||||
"exp" "expt" "features" "file-error?" "file-exists?" "finite?" "floor"
|
||||
"floor-quotient" "floor-remainder" "floor/" "flush-output-port" "gcd"
|
||||
"get-environment-variable" "get-environment-variables"
|
||||
"get-output-bytevector" "get-output-string" "imag-part" "inexact"
|
||||
"inexact?" "infinite?" "input-port-open?" "input-port?"
|
||||
"integer->char" "integer?" "interaction-environment"
|
||||
"jiffies-per-second" "lcm" "length" "list" "list->string"
|
||||
"list->vector" "list-copy" "list-ref" "list-set!" "list-tail" "list?"
|
||||
"load" "log" "magnitude" "make-bytevector" "make-list"
|
||||
"make-parameter" "make-polar" "make-promise" "make-rectangular"
|
||||
"make-string" "make-vector" "max" "member" "memq" "memv" "min"
|
||||
"modulo" "nan?" "negative?" "newline" "nil" "not" "null-environment"
|
||||
"null?" "number->string" "number?" "numerator" "odd?"
|
||||
"open-binary-input-file" "open-binary-output-file"
|
||||
"open-input-bytevector" "open-input-file" "open-input-string"
|
||||
"open-output-bytevector" "open-output-file" "open-output-string"
|
||||
"output-port-open?" "output-port?" "pair?" "peek-char" "peek-u8"
|
||||
"port?" "positive?" "procedure?" "promise?" "quasiquote" "quote"
|
||||
"quotient" "raise" "raise-continuable" "rational?" "rationalize"
|
||||
"read" "read-bytevector" "read-bytevector!" "read-char" "read-error?"
|
||||
"read-line" "read-string" "read-u8" "real-part" "real?" "remainder"
|
||||
"reverse" "round" "scheme-report-environment" "set!" "set-car!"
|
||||
"set-cdr!" "setcar" "sin" "sqrt" "square" "string" "string->list"
|
||||
"string->number" "string->symbol" "string->utf" "string->vector"
|
||||
"string-append" "string-ci<=?" "string-ci<?" "string-ci=?"
|
||||
"string-ci>=?" "string-ci>?" "string-copy" "string-copy!"
|
||||
"string-downcase" "string-fill!" "string-foldcase" "string-for-each"
|
||||
"string-length" "string-map" "string-ref" "string-set!"
|
||||
"string-upcase" "string<=?" "string<?" "string=?" "string>=?"
|
||||
"string>?" "string?" "substring" "symbol->string" "symbol=?" "symbol?"
|
||||
"tan" "textual-port?" "truncate" "truncate-quotient"
|
||||
"truncate-remainder" "truncate/" "u8-ready?" "unquote"
|
||||
"unquote-splicing" "utf->string" "values" "vector" "vector->list"
|
||||
"vector->string" "vector-append" "vector-copy" "vector-copy!"
|
||||
"vector-fill!" "vector-for-each" "vector-length" "vector-map"
|
||||
"vector-ref" "vector-set!" "vector?" "with-exception-handler"
|
||||
"with-input-from-file" "with-output-to-file" "write"
|
||||
"write-bytevector" "write-char" "write-shared" "write-simple"
|
||||
"write-string" "write-u8" "zero?")
|
||||
(scala-mode
|
||||
"abstract" "case" "catch" "class" "def" "do" "else" "extends" "false"
|
||||
"final" "finally" "for" "forSome" "if" "implicit" "import" "lazy" "match"
|
||||
"new" "null" "object" "override" "package" "private" "protected"
|
||||
"return" "sealed" "super" "this" "throw" "trait" "true" "try" "type" "val"
|
||||
"var" "while" "with" "yield")
|
||||
(sh-mode
|
||||
"break" "case" "continue" "do" "done" "elif" "else" "esac" "eval"
|
||||
"exec" "exit" "export" "false" "fi" "for" "function" "if" "in" "readonly"
|
||||
"return" "set" "shift" "test" "then" "time" "times" "trap" "true" "unset"
|
||||
"until" "while")
|
||||
(swift-mode
|
||||
"Protocol" "Self" "Type" "and" "as" "assignment" "associatedtype"
|
||||
"associativity" "available" "break" "case" "catch" "class" "column" "continue"
|
||||
"convenience" "default" "defer" "deinit" "didSet" "do" "dynamic" "dynamicType"
|
||||
"else" "elseif" "endif" "enum" "extension" "fallthrough" "false" "file"
|
||||
"fileprivate" "final" "for" "func" "function" "get" "guard" "higherThan" "if"
|
||||
"import" "in" "indirect" "infix" "init" "inout" "internal" "is" "lazy" "left"
|
||||
"let" "line" "lowerThan" "mutating" "nil" "none" "nonmutating" "open"
|
||||
"operator" "optional" "override" "postfix" "precedence" "precedencegroup"
|
||||
"prefix" "private" "protocol" "public" "repeat" "required" "rethrows" "return"
|
||||
"right" "selector" "self" "set" "static" "struct" "subscript" "super" "switch"
|
||||
"throw" "throws" "true" "try" "typealias" "unowned" "var" "weak" "where"
|
||||
"while" "willSet")
|
||||
(julia-mode
|
||||
"abstract" "break" "case" "catch" "const" "continue" "do" "else" "elseif"
|
||||
"end" "eval" "export" "false" "finally" "for" "function" "global" "if"
|
||||
"ifelse" "immutable" "import" "importall" "in" "let" "macro" "module"
|
||||
"otherwise" "quote" "return" "switch" "throw" "true" "try" "type"
|
||||
"typealias" "using" "while"
|
||||
)
|
||||
;; From https://github.com/apache/thrift/blob/master/contrib/thrift.el
|
||||
(thrift-mode
|
||||
"binary" "bool" "byte" "const" "double" "enum" "exception" "extends"
|
||||
"i16" "i32" "i64" "include" "list" "map" "oneway" "optional" "required"
|
||||
"service" "set" "string" "struct" "throws" "typedef" "void"
|
||||
)
|
||||
(tuareg-mode
|
||||
;; ocaml, from https://v2.ocaml.org/manual/lex.html#sss:keywords
|
||||
"and" "as" "asr" "assert" "begin" "class"
|
||||
"constraint" "do" "done" "downto" "else" "end"
|
||||
"exception" "external" "false" "for" "fun" "function"
|
||||
"functor" "if" "in" "include" "inherit" "initializer"
|
||||
"land" "lazy" "let" "lor" "lsl" "lsr"
|
||||
"lxor" "match" "method" "mod" "module" "mutable"
|
||||
"new" "nonrec" "object" "of" "open" "or"
|
||||
"private" "rec" "sig" "struct" "then" "to"
|
||||
"true" "try" "type" "val" "virtual" "when"
|
||||
"while" "with"
|
||||
)
|
||||
;; aliases
|
||||
(caml-mode . tuareg-mode)
|
||||
(js2-mode . javascript-mode)
|
||||
(js2-jsx-mode . javascript-mode)
|
||||
(espresso-mode . javascript-mode)
|
||||
(js-mode . javascript-mode)
|
||||
(js-jsx-mode . javascript-mode)
|
||||
(rjsx-mode . javascript-mode)
|
||||
(cperl-mode . perl-mode)
|
||||
(jde-mode . java-mode)
|
||||
(ess-julia-mode . julia-mode)
|
||||
(php-ts-mode . php-mode)
|
||||
(phps-mode . php-mode)
|
||||
(enh-ruby-mode . ruby-mode))
|
||||
"Alist mapping major-modes to sorted keywords for `company-keywords'.")
|
||||
|
||||
(with-eval-after-load 'make-mode
|
||||
(mapc
|
||||
(lambda (mode-stmnts)
|
||||
(setf (alist-get (car mode-stmnts) company-keywords-alist)
|
||||
(cl-remove-duplicates
|
||||
(sort (append makefile-special-targets-list
|
||||
(cl-mapcan #'identity
|
||||
(mapcar
|
||||
#'split-string
|
||||
(cl-remove-if-not
|
||||
#'stringp
|
||||
(symbol-value (cdr mode-stmnts))))))
|
||||
#'string<)
|
||||
:test #'string=)))
|
||||
'((makefile-automake-mode . makefile-automake-statements)
|
||||
(makefile-gmake-mode . makefile-gmake-statements)
|
||||
(makefile-makepp-mode . makefile-makepp-statements)
|
||||
(makefile-bsdmake-mode . makefile-bsdmake-statements)
|
||||
(makefile-imake-mode . makefile-statements)
|
||||
(makefile-mode . makefile-statements))))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-keywords (command &optional arg &rest _ignored)
|
||||
"`company-mode' backend for programming language keywords."
|
||||
(interactive (list 'interactive))
|
||||
(cl-case command
|
||||
(interactive (company-begin-backend 'company-keywords))
|
||||
(prefix (and (assq major-mode company-keywords-alist)
|
||||
(not (company-in-string-or-comment))
|
||||
(or (company-grab-symbol) 'stop)))
|
||||
(candidates
|
||||
(let ((completion-ignore-case company-keywords-ignore-case)
|
||||
(symbols (cdr (assq major-mode company-keywords-alist))))
|
||||
(all-completions arg (if (consp symbols)
|
||||
symbols
|
||||
(cdr (assq symbols company-keywords-alist))))))
|
||||
(kind 'keyword)
|
||||
(sorted t)
|
||||
(ignore-case company-keywords-ignore-case)))
|
||||
|
||||
(provide 'company-keywords)
|
||||
;;; company-keywords.el ends here
|
||||
Binary file not shown.
|
|
@ -1,142 +0,0 @@
|
|||
;;; company-nxml.el --- company-mode completion backend for nxml-mode -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2015, 2017-2018, 2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; In Emacs >= 26, company-capf is used instead.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'cl-lib)
|
||||
|
||||
(defvar rng-open-elements)
|
||||
(defvar rng-validate-mode)
|
||||
(defvar rng-in-attribute-regex)
|
||||
(defvar rng-in-attribute-value-regex)
|
||||
(declare-function rng-set-state-after "rng-nxml")
|
||||
(declare-function rng-match-possible-start-tag-names "rng-match")
|
||||
(declare-function rng-adjust-state-for-attribute "rng-nxml")
|
||||
(declare-function rng-match-possible-attribute-names "rng-match")
|
||||
(declare-function rng-adjust-state-for-attribute-value "rng-nxml")
|
||||
(declare-function rng-match-possible-value-strings "rng-match")
|
||||
|
||||
(defconst company-nxml-token-regexp
|
||||
"\\(?:[_[:alpha:]][-._[:alnum:]]*\\_>\\)")
|
||||
|
||||
(defvar company-nxml-in-attribute-value-regexp
|
||||
(replace-regexp-in-string "w" company-nxml-token-regexp
|
||||
"<w\\(?::w\\)?\
|
||||
\\(?:[ \t\r\n]+w\\(?::w\\)?[ \t\r\n]*=\
|
||||
\[ \t\r\n]*\\(?:\"[^\"]*\"\\|'[^']*'\\)\\)*\
|
||||
\[ \t\r\n]+\\(w\\(:w\\)?\\)[ \t\r\n]*=[ \t\r\n]*\
|
||||
\\(\"\\([^\"]*\\>\\)\\|'\\([^']*\\>\\)\\)\\="
|
||||
t t))
|
||||
|
||||
(defvar company-nxml-in-tag-name-regexp
|
||||
(replace-regexp-in-string "w" company-nxml-token-regexp
|
||||
"<\\(/?w\\(?::w?\\)?\\)?\\=" t t))
|
||||
|
||||
(defun company-nxml-all-completions (prefix alist)
|
||||
(let ((candidates (mapcar 'cdr alist))
|
||||
(case-fold-search nil)
|
||||
filtered)
|
||||
(when (cdar rng-open-elements)
|
||||
(push (concat "/" (cdar rng-open-elements)) candidates))
|
||||
(setq candidates (sort (all-completions prefix candidates) 'string<))
|
||||
(while candidates
|
||||
(unless (equal (car candidates) (car filtered))
|
||||
(push (car candidates) filtered))
|
||||
(pop candidates))
|
||||
(nreverse filtered)))
|
||||
|
||||
(defmacro company-nxml-prepared (&rest body)
|
||||
(declare (indent 0) (debug t))
|
||||
`(let ((lt-pos (save-excursion (search-backward "<" nil t))))
|
||||
(when (and lt-pos (= (rng-set-state-after lt-pos) lt-pos))
|
||||
,@body)))
|
||||
|
||||
(defun company-nxml-tag (command &optional arg &rest _ignored)
|
||||
(cl-case command
|
||||
(prefix (and (derived-mode-p 'nxml-mode)
|
||||
rng-validate-mode
|
||||
(company-grab company-nxml-in-tag-name-regexp 1)))
|
||||
(candidates (company-nxml-prepared
|
||||
(company-nxml-all-completions
|
||||
arg (rng-match-possible-start-tag-names))))
|
||||
(sorted t)))
|
||||
|
||||
(defun company-nxml-attribute (command &optional arg &rest _ignored)
|
||||
(cl-case command
|
||||
(prefix (and (derived-mode-p 'nxml-mode)
|
||||
rng-validate-mode
|
||||
(memq (char-after) '(?\ ?\t ?\n)) ;; outside word
|
||||
(company-grab rng-in-attribute-regex 1)))
|
||||
(candidates (company-nxml-prepared
|
||||
(and (rng-adjust-state-for-attribute
|
||||
lt-pos (- (point) (length arg)))
|
||||
(company-nxml-all-completions
|
||||
arg (rng-match-possible-attribute-names)))))
|
||||
(sorted t)))
|
||||
|
||||
(defun company-nxml-attribute-value (command &optional arg &rest _ignored)
|
||||
(cl-case command
|
||||
(prefix (and (derived-mode-p 'nxml-mode)
|
||||
rng-validate-mode
|
||||
(and (memq (char-after) '(?' ?\" ?\ ?\t ?\n)) ;; outside word
|
||||
(looking-back company-nxml-in-attribute-value-regexp nil)
|
||||
(or (match-string-no-properties 4)
|
||||
(match-string-no-properties 5)
|
||||
""))))
|
||||
(candidates (company-nxml-prepared
|
||||
(let (attr-start attr-end colon)
|
||||
(and (looking-back rng-in-attribute-value-regex lt-pos)
|
||||
(setq colon (match-beginning 2)
|
||||
attr-start (match-beginning 1)
|
||||
attr-end (match-end 1))
|
||||
(rng-adjust-state-for-attribute lt-pos attr-start)
|
||||
(rng-adjust-state-for-attribute-value
|
||||
attr-start colon attr-end)
|
||||
(all-completions
|
||||
arg (rng-match-possible-value-strings))))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-nxml (command &optional arg &rest _ignored)
|
||||
"`company-mode' completion backend for `nxml-mode'."
|
||||
(interactive (list 'interactive))
|
||||
(cl-case command
|
||||
(interactive (company-begin-backend 'company-nxml))
|
||||
(prefix (or (company-nxml-tag 'prefix)
|
||||
(company-nxml-attribute 'prefix)
|
||||
(company-nxml-attribute-value 'prefix)))
|
||||
(candidates (cond
|
||||
((company-nxml-tag 'prefix)
|
||||
(company-nxml-tag 'candidates arg))
|
||||
((company-nxml-attribute 'prefix)
|
||||
(company-nxml-attribute 'candidates arg))
|
||||
((company-nxml-attribute-value 'prefix)
|
||||
(sort (company-nxml-attribute-value 'candidates arg)
|
||||
'string<))))
|
||||
(sorted t)))
|
||||
|
||||
(provide 'company-nxml)
|
||||
;;; company-nxml.el ends here
|
||||
Binary file not shown.
|
|
@ -1,57 +0,0 @@
|
|||
;;; company-oddmuse.el --- company-mode completion backend for oddmuse-mode -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2016, 2022, 2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'cl-lib)
|
||||
(eval-when-compile (require 'yaoddmuse nil t))
|
||||
(eval-when-compile (require 'oddmuse nil t))
|
||||
|
||||
(defvar company-oddmuse-link-regexp
|
||||
"\\(\\<[A-Z][[:alnum:]]*\\>\\)\\|\\[\\[\\([[:alnum:]]+\\>\\|\\)")
|
||||
|
||||
(defun company-oddmuse-get-page-table ()
|
||||
(cl-case major-mode
|
||||
(yaoddmuse-mode (with-no-warnings
|
||||
(yaoddmuse-get-pagename-table yaoddmuse-wikiname)))
|
||||
(oddmuse-mode (with-no-warnings
|
||||
(oddmuse-make-completion-table oddmuse-wiki)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-oddmuse (command &optional arg &rest _ignored)
|
||||
"`company-mode' completion backend for `oddmuse-mode'."
|
||||
(interactive (list 'interactive))
|
||||
(cl-case command
|
||||
(interactive (company-begin-backend 'company-oddmuse))
|
||||
(prefix (let ((case-fold-search nil))
|
||||
(and (memq major-mode '(oddmuse-mode yaoddmuse-mode))
|
||||
(looking-back company-oddmuse-link-regexp (line-beginning-position))
|
||||
(or (match-string 1)
|
||||
(match-string 2)))))
|
||||
(candidates (all-completions arg (company-oddmuse-get-page-table)))))
|
||||
|
||||
(provide 'company-oddmuse)
|
||||
;;; company-oddmuse.el ends here
|
||||
Binary file not shown.
|
|
@ -1,9 +0,0 @@
|
|||
;; -*- no-byte-compile: t; lexical-binding: nil -*-
|
||||
(define-package "company" "20250426.1319"
|
||||
"Modular text completion framework."
|
||||
'((emacs "26.1"))
|
||||
:url "http://company-mode.github.io/"
|
||||
:commit "41f07c7d401c1374a76f3004a3448d3d36bdf347"
|
||||
:revdesc "41f07c7d401c"
|
||||
:keywords '("abbrev" "convenience" "matching")
|
||||
:maintainers '(("Dmitry Gutov" . "dmitry@gutov.dev")))
|
||||
|
|
@ -1,168 +0,0 @@
|
|||
;;; company-semantic.el --- company-mode completion backend using Semantic -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2018, 2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'company-template)
|
||||
(require 'cl-lib)
|
||||
|
||||
(defvar semantic-idle-summary-function)
|
||||
(declare-function semantic-documentation-for-tag "semantic/doc" )
|
||||
(declare-function semantic-analyze-current-context "semantic/analyze")
|
||||
(declare-function semantic-analyze-possible-completions "semantic/complete")
|
||||
(declare-function semantic-analyze-find-tags-by-prefix "semantic/analyze/fcn")
|
||||
(declare-function semantic-tag-class "semantic/tag")
|
||||
(declare-function semantic-tag-name "semantic/tag")
|
||||
(declare-function semantic-tag-start "semantic/tag")
|
||||
(declare-function semantic-tag-buffer "semantic/tag")
|
||||
(declare-function semantic-active-p "semantic")
|
||||
(declare-function semantic-format-tag-prototype "semantic/format")
|
||||
|
||||
(defgroup company-semantic nil
|
||||
"Completion backend using Semantic."
|
||||
:group 'company)
|
||||
|
||||
(defcustom company-semantic-metadata-function 'company-semantic-summary-and-doc
|
||||
"The function turning a semantic tag into doc information."
|
||||
:type 'function)
|
||||
|
||||
(defcustom company-semantic-begin-after-member-access t
|
||||
"When non-nil, automatic completion will start whenever the current
|
||||
symbol is preceded by \".\", \"->\" or \"::\", ignoring
|
||||
`company-minimum-prefix-length'.
|
||||
|
||||
If `company-begin-commands' is a list, it should include `c-electric-lt-gt'
|
||||
and `c-electric-colon', for automatic completion right after \">\" and
|
||||
\":\"."
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom company-semantic-insert-arguments t
|
||||
"When non-nil, insert function arguments as a template after completion."
|
||||
:type 'boolean
|
||||
:package-version '(company . "0.9.0"))
|
||||
|
||||
(defvar company-semantic-modes '(c-mode c++-mode jde-mode java-mode))
|
||||
|
||||
(defvar-local company-semantic--current-tags nil
|
||||
"Tags for the current context.")
|
||||
|
||||
(defun company-semantic-documentation-for-tag (tag)
|
||||
(when (semantic-tag-buffer tag)
|
||||
;; When TAG's buffer is unknown, the function below raises an error.
|
||||
(semantic-documentation-for-tag tag)))
|
||||
|
||||
(defun company-semantic-doc-or-summary (tag)
|
||||
(or (company-semantic-documentation-for-tag tag)
|
||||
(and (require 'semantic-idle nil t)
|
||||
(require 'semantic/idle nil t)
|
||||
(funcall semantic-idle-summary-function tag nil t))))
|
||||
|
||||
(defun company-semantic-summary-and-doc (tag)
|
||||
(let ((doc (company-semantic-documentation-for-tag tag))
|
||||
(summary (funcall semantic-idle-summary-function tag nil t)))
|
||||
(and (stringp doc)
|
||||
(string-match "\n*\\(.*\\)$" doc)
|
||||
(setq doc (match-string 1 doc)))
|
||||
(concat summary
|
||||
(when doc
|
||||
(if (< (+ (length doc) (length summary) 4) (window-width))
|
||||
" -- "
|
||||
"\n"))
|
||||
doc)))
|
||||
|
||||
(defun company-semantic-doc-buffer (tag)
|
||||
(let ((doc (company-semantic-documentation-for-tag tag)))
|
||||
(when doc
|
||||
(company-doc-buffer
|
||||
(concat (funcall semantic-idle-summary-function tag nil t)
|
||||
"\n"
|
||||
doc)))))
|
||||
|
||||
(defsubst company-semantic-completions (prefix)
|
||||
(ignore-errors
|
||||
(let ((completion-ignore-case nil)
|
||||
(context (semantic-analyze-current-context)))
|
||||
(setq company-semantic--current-tags
|
||||
(semantic-analyze-possible-completions context 'no-unique))
|
||||
(all-completions prefix company-semantic--current-tags))))
|
||||
|
||||
(defun company-semantic-completions-raw (prefix)
|
||||
(setq company-semantic--current-tags nil)
|
||||
(dolist (tag (semantic-analyze-find-tags-by-prefix prefix))
|
||||
(unless (eq (semantic-tag-class tag) 'include)
|
||||
(push tag company-semantic--current-tags)))
|
||||
(delete "" (mapcar 'semantic-tag-name company-semantic--current-tags)))
|
||||
|
||||
(defun company-semantic-annotation (argument tags)
|
||||
(let* ((tag (assq argument tags))
|
||||
(kind (when tag (elt tag 1))))
|
||||
(cl-case kind
|
||||
(function (let* ((prototype (semantic-format-tag-prototype tag nil nil))
|
||||
(par-pos (string-match "(" prototype)))
|
||||
(when par-pos (substring prototype par-pos)))))))
|
||||
|
||||
(defun company-semantic--prefix ()
|
||||
(if company-semantic-begin-after-member-access
|
||||
(company-grab-symbol-parts "\\.\\|->\\|::" 2)
|
||||
(company-grab-symbol-parts)))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-semantic (command &optional arg &rest _ignored)
|
||||
"`company-mode' completion backend using CEDET Semantic."
|
||||
(interactive (list 'interactive))
|
||||
(cl-case command
|
||||
(interactive (company-begin-backend 'company-semantic))
|
||||
(prefix (and (featurep 'semantic)
|
||||
(semantic-active-p)
|
||||
(memq major-mode company-semantic-modes)
|
||||
(not (company-in-string-or-comment))
|
||||
(or (company-semantic--prefix) 'stop)))
|
||||
(candidates (if (and (string-empty-p arg)
|
||||
(not (looking-back "->\\|\\.\\|::" (- (point) 2))))
|
||||
(company-semantic-completions-raw arg)
|
||||
(company-semantic-completions arg)))
|
||||
(meta (funcall company-semantic-metadata-function
|
||||
(assoc arg company-semantic--current-tags)))
|
||||
(annotation (company-semantic-annotation arg
|
||||
company-semantic--current-tags))
|
||||
(doc-buffer (company-semantic-doc-buffer
|
||||
(assoc arg company-semantic--current-tags)))
|
||||
;; Because "" is an empty context and doesn't return local variables.
|
||||
(no-cache (string-empty-p arg))
|
||||
(duplicates t)
|
||||
(location (let ((tag (assoc arg company-semantic--current-tags)))
|
||||
(when (buffer-live-p (semantic-tag-buffer tag))
|
||||
(cons (semantic-tag-buffer tag)
|
||||
(semantic-tag-start tag)))))
|
||||
(post-completion (let ((anno (company-semantic-annotation
|
||||
arg company-semantic--current-tags)))
|
||||
(when (and company-semantic-insert-arguments anno)
|
||||
(insert anno)
|
||||
(company-template-c-like-templatify (concat arg anno)))
|
||||
))))
|
||||
|
||||
(provide 'company-semantic)
|
||||
;;; company-semantic.el ends here
|
||||
Binary file not shown.
|
|
@ -1,273 +0,0 @@
|
|||
;;; company-template.el --- utility library for template expansion -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2010, 2013-2017, 2019, 2023-2024 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'cl-lib)
|
||||
|
||||
(defface company-template-field
|
||||
'((((background dark)) (:background "yellow" :foreground "black"))
|
||||
(((background light)) (:background "orange" :foreground "black")))
|
||||
"Face used for editable text in template fields."
|
||||
:group 'company-faces)
|
||||
|
||||
(defvar company-template-forward-field-item
|
||||
'(menu-item "" company-template-forward-field
|
||||
:filter company-template--keymap-filter))
|
||||
|
||||
(defvar company-template-nav-map
|
||||
(let ((keymap (make-sparse-keymap)))
|
||||
(define-key keymap [tab] company-template-forward-field-item)
|
||||
(define-key keymap (kbd "TAB") company-template-forward-field-item)
|
||||
keymap))
|
||||
|
||||
(defvar company-template-clear-field-item
|
||||
'(menu-item "" company-template-clear-field
|
||||
:filter company-template--keymap-filter))
|
||||
|
||||
(defvar company-template-field-map
|
||||
(let ((keymap (make-sparse-keymap)))
|
||||
(set-keymap-parent keymap company-template-nav-map)
|
||||
(define-key keymap (kbd "C-d") company-template-clear-field-item)
|
||||
keymap))
|
||||
|
||||
(defvar-local company-template--buffer-templates nil)
|
||||
|
||||
;; interactive ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defun company-template-templates-at (pos)
|
||||
(let (os)
|
||||
(dolist (o (overlays-at pos))
|
||||
;; FIXME: Always return the whole list of templates?
|
||||
;; We remove templates not at point after every command.
|
||||
(when (memq o company-template--buffer-templates)
|
||||
(push o os)))
|
||||
os))
|
||||
|
||||
(defun company-template-move-to-first (templ)
|
||||
(interactive)
|
||||
(goto-char (overlay-start templ))
|
||||
(company-template-forward-field))
|
||||
|
||||
(defun company-template-forward-field ()
|
||||
(interactive)
|
||||
(let ((start (point))
|
||||
(next-field-start (company-template-find-next-field)))
|
||||
(push-mark)
|
||||
(goto-char next-field-start)
|
||||
(company-template-remove-field (company-template-field-at start))))
|
||||
|
||||
(defun company-template-clear-field ()
|
||||
"Clear the field at point."
|
||||
(interactive)
|
||||
(let ((ovl (company-template-field-at (point))))
|
||||
(when ovl
|
||||
(company-template-remove-field ovl t)
|
||||
(let ((after-clear-fn
|
||||
(overlay-get ovl 'company-template-after-clear)))
|
||||
(when (functionp after-clear-fn)
|
||||
(funcall after-clear-fn))))))
|
||||
|
||||
(defun company-template--keymap-filter (cmd)
|
||||
(unless (run-hook-with-args-until-success 'yas-keymap-disable-hook)
|
||||
cmd))
|
||||
|
||||
(defun company-template--after-clear-c-like-field ()
|
||||
"Function that can be called after deleting a field of a c-like template.
|
||||
For c-like templates it is set as `after-post-fn' property on fields in
|
||||
`company-template-add-field'. If there is a next field, delete everything
|
||||
from point to it. If there is no field after point, remove preceding comma
|
||||
if present."
|
||||
(let* ((pos (point))
|
||||
(next-field-start (company-template-find-next-field))
|
||||
(last-field-p (not (company-template-field-at next-field-start))))
|
||||
(cond ((and (not last-field-p)
|
||||
(< pos next-field-start)
|
||||
(string-match "^[ ]*,+[ ]*$" (buffer-substring-no-properties
|
||||
pos next-field-start)))
|
||||
(delete-region pos next-field-start))
|
||||
((and last-field-p
|
||||
(looking-back ",+[ ]*" (line-beginning-position)))
|
||||
(delete-region (match-beginning 0) pos)))))
|
||||
|
||||
(defun company-template-find-next-field ()
|
||||
(let* ((start (point))
|
||||
(templates (company-template-templates-at start))
|
||||
(minimum (apply 'max (mapcar 'overlay-end templates)))
|
||||
(fields (cl-loop for templ in templates
|
||||
append (overlay-get templ 'company-template-fields))))
|
||||
(dolist (pos (mapcar 'overlay-start fields) minimum)
|
||||
(and pos
|
||||
(> pos start)
|
||||
(< pos minimum)
|
||||
(setq minimum pos)))))
|
||||
|
||||
(defun company-template-field-at (&optional point)
|
||||
(cl-loop for ovl in (overlays-at (or point (point)))
|
||||
when (overlay-get ovl 'company-template-parent)
|
||||
return ovl))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defun company-template-declare-template (beg end)
|
||||
(let ((ov (make-overlay beg end)))
|
||||
;; (overlay-put ov 'face 'highlight)
|
||||
(overlay-put ov 'keymap company-template-nav-map)
|
||||
(overlay-put ov 'priority 101)
|
||||
(overlay-put ov 'evaporate t)
|
||||
(push ov company-template--buffer-templates)
|
||||
(add-hook 'post-command-hook 'company-template-post-command nil t)
|
||||
ov))
|
||||
|
||||
(defun company-template-remove-template (templ)
|
||||
(mapc 'company-template-remove-field
|
||||
(overlay-get templ 'company-template-fields))
|
||||
(setq company-template--buffer-templates
|
||||
(delq templ company-template--buffer-templates))
|
||||
(delete-overlay templ))
|
||||
|
||||
(defun company-template-add-field (templ beg end &optional display after-clear-fn)
|
||||
"Add new field to template TEMPL spanning from BEG to END.
|
||||
When DISPLAY is non-nil, set the respective property on the overlay.
|
||||
Leave point at the end of the field.
|
||||
AFTER-CLEAR-FN is a function that can be used to apply custom behavior
|
||||
after deleting a field in `company-template-remove-field'."
|
||||
(cl-assert templ)
|
||||
(when (> end (overlay-end templ))
|
||||
(move-overlay templ (overlay-start templ) end))
|
||||
(let ((ov (make-overlay beg end))
|
||||
(siblings (overlay-get templ 'company-template-fields)))
|
||||
;; (overlay-put ov 'evaporate t)
|
||||
(overlay-put ov 'intangible t)
|
||||
(overlay-put ov 'face 'company-template-field)
|
||||
(when display
|
||||
(overlay-put ov 'display display))
|
||||
(overlay-put ov 'company-template-parent templ)
|
||||
(overlay-put ov 'insert-in-front-hooks '(company-template-insert-hook))
|
||||
(when after-clear-fn
|
||||
(overlay-put ov 'company-template-after-clear after-clear-fn))
|
||||
(overlay-put ov 'keymap company-template-field-map)
|
||||
(overlay-put ov 'priority 101)
|
||||
(push ov siblings)
|
||||
(overlay-put templ 'company-template-fields siblings)))
|
||||
|
||||
(defun company-template-remove-field (ovl &optional clear)
|
||||
(when (overlayp ovl)
|
||||
(when (overlay-buffer ovl)
|
||||
(when clear
|
||||
(delete-region (overlay-start ovl) (overlay-end ovl)))
|
||||
(delete-overlay ovl))
|
||||
(let* ((templ (overlay-get ovl 'company-template-parent))
|
||||
(siblings (overlay-get templ 'company-template-fields)))
|
||||
(setq siblings (delq ovl siblings))
|
||||
(overlay-put templ 'company-template-fields siblings))))
|
||||
|
||||
(defun company-template-clean-up (&optional pos)
|
||||
"Clean up all templates that don't contain POS."
|
||||
(let ((local-ovs (overlays-at (or pos (point)))))
|
||||
(dolist (templ company-template--buffer-templates)
|
||||
(unless (memq templ local-ovs)
|
||||
(company-template-remove-template templ)))))
|
||||
|
||||
;; hooks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defun company-template-insert-hook (ovl after-p &rest _ignore)
|
||||
"Called when a snippet input prompt is modified."
|
||||
(unless after-p
|
||||
(company-template-remove-field ovl t)))
|
||||
|
||||
(defun company-template-post-command ()
|
||||
(company-template-clean-up)
|
||||
(unless company-template--buffer-templates
|
||||
(remove-hook 'post-command-hook 'company-template-post-command t)))
|
||||
|
||||
;; common ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defun company-template-c-like-templatify (call)
|
||||
(let* ((end (point-marker))
|
||||
(beg (- (point) (length call)))
|
||||
(templ (company-template-declare-template beg end))
|
||||
forward-sexp-function
|
||||
paren-open paren-close)
|
||||
(with-syntax-table (make-syntax-table (syntax-table))
|
||||
(modify-syntax-entry ?< "(")
|
||||
(modify-syntax-entry ?> ")")
|
||||
(when (search-backward ")" beg t)
|
||||
(setq paren-close (point-marker))
|
||||
(forward-char 1)
|
||||
(delete-region (point) end)
|
||||
(backward-sexp)
|
||||
(forward-char 1)
|
||||
(setq paren-open (point-marker)))
|
||||
(when (search-backward ">" beg t)
|
||||
(let ((angle-close (point-marker)))
|
||||
(forward-char 1)
|
||||
(backward-sexp)
|
||||
(forward-char)
|
||||
(company-template--c-like-args templ angle-close)))
|
||||
(when (looking-back "\\((\\*)\\)(" (line-beginning-position))
|
||||
(delete-region (match-beginning 1) (match-end 1)))
|
||||
(when paren-open
|
||||
(goto-char paren-open)
|
||||
(company-template--c-like-args templ paren-close)))
|
||||
(if (overlay-get templ 'company-template-fields)
|
||||
(company-template-move-to-first templ)
|
||||
(company-template-remove-template templ)
|
||||
(goto-char end))))
|
||||
|
||||
(defun company-template--c-like-args (templ end)
|
||||
(let ((last-pos (point)))
|
||||
(while (re-search-forward "\\([^,]+\\),?" end 'move)
|
||||
(when (zerop (car (parse-partial-sexp last-pos (point))))
|
||||
(company-template-add-field templ last-pos (match-end 1) nil
|
||||
#'company-template--after-clear-c-like-field)
|
||||
(skip-chars-forward " ")
|
||||
(setq last-pos (point))))))
|
||||
|
||||
;; objc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defun company-template-objc-templatify (selector)
|
||||
(let* ((end (point-marker))
|
||||
(beg (- (point) (length selector) 1))
|
||||
(templ (company-template-declare-template beg end))
|
||||
(cnt 0))
|
||||
(save-excursion
|
||||
(goto-char beg)
|
||||
(catch 'stop
|
||||
(while (search-forward ":" end t)
|
||||
(if (looking-at "\\(([^)]*)\\) ?")
|
||||
(company-template-add-field templ (point) (match-end 1))
|
||||
;; Not sure which conditions this case manifests under, but
|
||||
;; apparently it did before, when I wrote the first test for this
|
||||
;; function. FIXME: Revisit it.
|
||||
(company-template-add-field templ (point)
|
||||
(progn
|
||||
(insert (format "arg%d" cnt))
|
||||
(point)))
|
||||
(when (< (point) end)
|
||||
(insert " "))
|
||||
(cl-incf cnt))
|
||||
(when (>= (point) end)
|
||||
(throw 'stop t)))))
|
||||
(company-template-move-to-first templ)))
|
||||
|
||||
(provide 'company-template)
|
||||
;;; company-template.el ends here
|
||||
Binary file not shown.
|
|
@ -1,72 +0,0 @@
|
|||
;;; company-tempo.el --- company-mode completion backend for tempo -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009-2011, 2013-2016, 2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'cl-lib)
|
||||
(require 'tempo)
|
||||
|
||||
(defgroup company-tempo nil
|
||||
"Tempo completion backend."
|
||||
:group 'company)
|
||||
|
||||
(defcustom company-tempo-expand nil
|
||||
"Whether to expand a tempo tag after completion."
|
||||
:type '(choice (const :tag "Off" nil)
|
||||
(const :tag "On" t)))
|
||||
|
||||
(defsubst company-tempo-lookup (match)
|
||||
(cdr (assoc match (tempo-build-collection))))
|
||||
|
||||
(defun company-tempo-insert (match)
|
||||
"Replace MATCH with the expanded tempo template."
|
||||
(search-backward match)
|
||||
(goto-char (match-beginning 0))
|
||||
(replace-match "")
|
||||
(call-interactively (company-tempo-lookup match)))
|
||||
|
||||
(defsubst company-tempo-meta (match)
|
||||
(let ((templ (company-tempo-lookup match))
|
||||
doc)
|
||||
(and templ
|
||||
(setq doc (documentation templ t))
|
||||
(car (split-string doc "\n" t)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-tempo (command &optional arg &rest _ignored)
|
||||
"`company-mode' completion backend for tempo."
|
||||
(interactive (list 'interactive))
|
||||
(cl-case command
|
||||
(interactive (company-begin-backend 'company-tempo))
|
||||
(prefix (or (car (tempo-find-match-string tempo-match-finder)) ""))
|
||||
(candidates (all-completions arg (tempo-build-collection)))
|
||||
(kind 'snippet)
|
||||
(meta (company-tempo-meta arg))
|
||||
(post-completion (when company-tempo-expand (company-tempo-insert arg)))
|
||||
(sorted t)))
|
||||
|
||||
(provide 'company-tempo)
|
||||
;;; company-tempo.el ends here
|
||||
Binary file not shown.
|
|
@ -1,196 +0,0 @@
|
|||
;;; company-tng.el --- company-mode configuration for single-button interaction -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2017-2024 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikita Leshenko
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; company-tng (Tab and Go) allows you to perform completion using just TAB.
|
||||
;; Pressing it will both select the next completion candidate in the list and
|
||||
;; insert it into the buffer (or make it look like it's inserted, in fact).
|
||||
;;
|
||||
;; It cycles the candidates like `yank-pop' or `dabbrev-expand' or Vim:
|
||||
;; Pressing TAB selects the first item in the completion menu and inserts it in
|
||||
;; the buffer. Pressing TAB again selects the second item and replaces the
|
||||
;; "inserted" item with the second one. This can continue as long as the user
|
||||
;; wishes to cycle through the menu. You can also press S-TAB to select the
|
||||
;; previous candidate, of course.
|
||||
;;
|
||||
;; The benefits are that you only have to use one shortcut key and there is no
|
||||
;; need to confirm the entry.
|
||||
;;
|
||||
;; Usage:
|
||||
;;
|
||||
;; Enable `company-tng-mode' with:
|
||||
;;
|
||||
;; (add-hook 'after-init-hook 'company-tng-mode)
|
||||
;;
|
||||
;; in your init script. It will set up the required frontend, as well as make a
|
||||
;; number of recommended configuration changes described below.
|
||||
;;
|
||||
;; To avoid these changes, if you want to tweak everything yourself, customize
|
||||
;;`company-tng-auto-configure' to nil.
|
||||
;;
|
||||
;; We recommend to bind TAB to `company-select-next', S-TAB to
|
||||
;; `company-select-previous', and unbind RET and other now-unnecessary
|
||||
;; keys from `company-active-map':
|
||||
;;
|
||||
;; (define-key company-active-map (kbd "TAB") 'company-select-next)
|
||||
;; (define-key company-active-map (kbd "<backtab>") 'company-select-previous)
|
||||
;; (define-key company-active-map (kbd "RET") nil)
|
||||
;;
|
||||
;; Note that it's not necessary to rebind keys to use this frontend,
|
||||
;; you can use the arrow keys or M-n/M-p to select and insert
|
||||
;; candidates. You also need to decide which keys to unbind, depending
|
||||
;; on whether you want them to do the Company action or the default
|
||||
;; Emacs action (for example C-s or C-w).
|
||||
;;
|
||||
;; We recommend to disable `company-require-match' to allow free typing at any
|
||||
;; point.
|
||||
;;
|
||||
;; By default, company-tng doesn't work well with backends that insert function
|
||||
;; arguments into the buffer and (optionally) expand them into a snippet
|
||||
;; (usually performed in `post-completion' using yasnippet or company-template).
|
||||
;; In company-tng, completion candidates
|
||||
;; are inserted into the buffer as the user selects them and the completion is
|
||||
;; finished implicitly when the user continues typing after selecting a
|
||||
;; candidate. Modifying the buffer (by expanding a snippet) when the user
|
||||
;; continues typing would be surprising and undesirable, since the candidate was
|
||||
;; already inserted into the buffer.
|
||||
;;
|
||||
;; For this reason `company-tng-mode' by default disables arguments insertion
|
||||
;; for a number of popular backends. If the backend you are using is not among
|
||||
;; them, you might have to configure it not to do that yourself.
|
||||
;;
|
||||
;; YASnippet and company-tng both use TAB, which causes conflicts. The
|
||||
;; recommended way to use YASnippet with company-tng is to choose a different
|
||||
;; key for expanding a snippet and moving to the next snippet field:
|
||||
;;
|
||||
;; (define-key yas-minor-mode-map "\C-j" 'yas-expand)
|
||||
;; (define-key yas-keymap "\C-j" 'yas-next-field-or-maybe-expand)
|
||||
;; (dolist (keymap (list yas-minor-mode-map yas-keymap))
|
||||
;; (define-key keymap (kbd "TAB") nil)
|
||||
;; (define-key keymap [(tab)] nil))
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'cl-lib)
|
||||
|
||||
(defvar-local company-tng--overlay nil)
|
||||
|
||||
;;;###autoload
|
||||
(defun company-tng-frontend (command)
|
||||
"When the user changes the selection at least once, this
|
||||
frontend will display the candidate in the buffer as if it's
|
||||
already there and any key outside of `company-active-map' will
|
||||
confirm the selection and finish the completion."
|
||||
(cl-case command
|
||||
(show
|
||||
(let ((ov (make-overlay (point) (point))))
|
||||
(setq company-tng--overlay ov)
|
||||
(overlay-put ov 'priority 2)))
|
||||
(update
|
||||
(let* ((ov company-tng--overlay)
|
||||
(selected (and company-selection
|
||||
(nth company-selection company-candidates)))
|
||||
(prefix (length (car (company--boundaries)))))
|
||||
(move-overlay ov (- (point) prefix) (point))
|
||||
(overlay-put ov
|
||||
(if (= prefix 0) 'after-string 'display)
|
||||
selected)))
|
||||
(hide
|
||||
(when company-tng--overlay
|
||||
(delete-overlay company-tng--overlay)
|
||||
(kill-local-variable 'company-tng--overlay)))
|
||||
(pre-command
|
||||
(when (and company-selection
|
||||
(not (company--company-command-p (this-command-keys))))
|
||||
(company--unread-this-command-keys)
|
||||
(setq this-command 'company-complete-selection)))))
|
||||
|
||||
(defvar company-clang-insert-arguments)
|
||||
(defvar company-semantic-insert-arguments)
|
||||
(defvar company-rtags-insert-arguments)
|
||||
(defvar lsp-enable-snippet)
|
||||
|
||||
(defgroup company-tng nil
|
||||
"Company Tab and Go."
|
||||
:group 'company)
|
||||
|
||||
(defcustom company-tng-auto-configure t
|
||||
"Automatically apply default configure when enable `company-tng-mode'."
|
||||
:type 'boolean)
|
||||
|
||||
;;;###autoload
|
||||
(define-obsolete-function-alias 'company-tng-configure-default 'company-tng-mode "0.10.0"
|
||||
"Applies the default configuration to enable company-tng.")
|
||||
|
||||
(declare-function eglot--snippet-expansion-fn "eglot")
|
||||
|
||||
(defvar company-tng-map
|
||||
(let ((keymap (make-sparse-keymap)))
|
||||
(set-keymap-parent keymap company-active-map)
|
||||
(define-key keymap [return] nil)
|
||||
(define-key keymap (kbd "RET") nil)
|
||||
(define-key keymap [tab] 'company-select-next)
|
||||
(define-key keymap (kbd "TAB") 'company-select-next)
|
||||
(define-key keymap [backtab] 'company-select-previous)
|
||||
(define-key keymap (kbd "S-TAB") 'company-select-previous)
|
||||
keymap))
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode company-tng-mode
|
||||
"This minor mode enables `company-tng-frontend'."
|
||||
:init-value nil
|
||||
:global t
|
||||
(cond
|
||||
(company-tng-mode
|
||||
(setq company-frontends
|
||||
(add-to-list 'company-frontends 'company-tng-frontend))
|
||||
(when company-tng-auto-configure
|
||||
(setq company-frontends '(company-tng-frontend
|
||||
company-pseudo-tooltip-frontend
|
||||
company-echo-metadata-frontend))
|
||||
(setq company-require-match nil
|
||||
company-clang-insert-arguments nil
|
||||
company-semantic-insert-arguments nil
|
||||
company-rtags-insert-arguments nil
|
||||
lsp-enable-snippet nil)
|
||||
(advice-add #'eglot--snippet-expansion-fn :override #'ignore)
|
||||
(setq company-active-map company-tng-map))
|
||||
(setq company-selection-default nil))
|
||||
(t
|
||||
(setq company-frontends
|
||||
'(company-pseudo-tooltip-unless-just-one-frontend
|
||||
company-preview-if-just-one-frontend
|
||||
company-echo-metadata-frontend))
|
||||
(when company-tng-auto-configure
|
||||
(setq company-require-match 'company-explicit-action-p
|
||||
company-clang-insert-arguments t
|
||||
company-semantic-insert-arguments t
|
||||
company-rtags-insert-arguments t
|
||||
lsp-enable-snippet t)
|
||||
(advice-remove #'eglot--snippet-expansion-fn #'ignore)
|
||||
(setq company-active-map (keymap-parent company-tng-map)))
|
||||
(setq company-selection-default 0))))
|
||||
|
||||
(provide 'company-tng)
|
||||
;;; company-tng.el ends here
|
||||
Binary file not shown.
|
|
@ -1,200 +0,0 @@
|
|||
;;; company-yasnippet.el --- company-mode completion backend for Yasnippet -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2014-2015, 2020-2023 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Dmitry Gutov
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
;; GNU Emacs 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.
|
||||
|
||||
;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Commentary:
|
||||
;;
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'company)
|
||||
(require 'cl-lib)
|
||||
|
||||
(declare-function yas--table-hash "yasnippet")
|
||||
(declare-function yas--get-snippet-tables "yasnippet")
|
||||
(declare-function yas-expand-snippet "yasnippet")
|
||||
(declare-function yas--template-content "yasnippet")
|
||||
(declare-function yas--template-expand-env "yasnippet")
|
||||
(declare-function yas--warning "yasnippet")
|
||||
(declare-function yas-minor-mode "yasnippet")
|
||||
(declare-function yas--require-template-specific-condition-p "yasnippet")
|
||||
(declare-function yas--template-can-expand-p "yasnippet")
|
||||
(declare-function yas--template-condition "yasnippet")
|
||||
|
||||
(defvar company-yasnippet-annotation-fn
|
||||
(lambda (name)
|
||||
(concat
|
||||
(unless company-tooltip-align-annotations " -> ")
|
||||
name))
|
||||
"Function to format completion annotation.
|
||||
It has to accept one argument: the snippet's name.")
|
||||
|
||||
(defun company-yasnippet--key-prefixes ()
|
||||
;; Mostly copied from `yas--templates-for-key-at-point'.
|
||||
(defvar yas-key-syntaxes)
|
||||
(save-excursion
|
||||
(let ((original (point))
|
||||
(methods yas-key-syntaxes)
|
||||
prefixes
|
||||
method)
|
||||
(while methods
|
||||
(unless (eq method (car methods))
|
||||
(goto-char original))
|
||||
(setq method (car methods))
|
||||
(cond ((stringp method)
|
||||
(skip-syntax-backward method)
|
||||
(setq methods (cdr methods)))
|
||||
((functionp method)
|
||||
(unless (eq (funcall method original)
|
||||
'again)
|
||||
(setq methods (cdr methods))))
|
||||
(t
|
||||
(setq methods (cdr methods))
|
||||
(yas--warning "Invalid element `%s' in `yas-key-syntaxes'" method)))
|
||||
(let ((prefix (buffer-substring-no-properties (point) original)))
|
||||
(unless (equal prefix (car prefixes))
|
||||
(push prefix prefixes))))
|
||||
(nreverse prefixes))))
|
||||
|
||||
(defun company-yasnippet--candidates (prefix)
|
||||
;; Process the prefixes in reverse: unlike Yasnippet, we look for prefix
|
||||
;; matches, so the longest prefix with any matches should be the most useful.
|
||||
(cl-loop with tables = (yas--get-snippet-tables)
|
||||
for key-prefix in (company-yasnippet--key-prefixes)
|
||||
;; Only consider keys at least as long as the symbol at point.
|
||||
when (>= (length key-prefix) (length prefix))
|
||||
thereis (company-yasnippet--completions-for-prefix prefix
|
||||
key-prefix
|
||||
tables)))
|
||||
|
||||
(defun company-yasnippet--completions-for-prefix (prefix key-prefix tables)
|
||||
(cl-mapcan
|
||||
(lambda (table)
|
||||
(let ((keyhash (yas--table-hash table))
|
||||
(requirement (yas--require-template-specific-condition-p))
|
||||
res)
|
||||
(when keyhash
|
||||
(maphash
|
||||
(lambda (key value)
|
||||
(when (and (stringp key)
|
||||
(string-prefix-p key-prefix key))
|
||||
(maphash
|
||||
(lambda (name template)
|
||||
(when (yas--template-can-expand-p
|
||||
(yas--template-condition template) requirement)
|
||||
(push
|
||||
(propertize key
|
||||
'yas-annotation name
|
||||
'yas-template template
|
||||
'yas-prefix-offset (- (length key-prefix)
|
||||
(length prefix)))
|
||||
res)))
|
||||
value)))
|
||||
keyhash))
|
||||
res))
|
||||
tables))
|
||||
|
||||
(defun company-yasnippet--doc (arg)
|
||||
(let ((template (get-text-property 0 'yas-template arg))
|
||||
(mode major-mode)
|
||||
(file-name (buffer-file-name)))
|
||||
(defvar yas-prompt-functions)
|
||||
(with-current-buffer (company-doc-buffer)
|
||||
(let ((buffer-file-name file-name))
|
||||
(yas-minor-mode 1)
|
||||
(setq-local yas-prompt-functions '(yas-no-prompt))
|
||||
(condition-case error
|
||||
(yas-expand-snippet (yas--template-content template))
|
||||
(error
|
||||
(message "%s" (error-message-string error))))
|
||||
(delay-mode-hooks
|
||||
(let ((inhibit-message t))
|
||||
(if (eq mode 'web-mode)
|
||||
(progn
|
||||
(setq mode 'html-mode)
|
||||
(funcall mode))
|
||||
(funcall mode)))
|
||||
(ignore-errors (font-lock-ensure))))
|
||||
(current-buffer))))
|
||||
|
||||
(defun company-yasnippet--prefix ()
|
||||
;; We can avoid the prefix length manipulations after GH#426 is fixed.
|
||||
(let* ((prefix (company-grab-symbol))
|
||||
(tables (yas--get-snippet-tables))
|
||||
(key-prefixes (company-yasnippet--key-prefixes))
|
||||
key-prefix)
|
||||
(while (and key-prefixes
|
||||
(setq key-prefix (pop key-prefixes)))
|
||||
(when (company-yasnippet--completions-for-prefix
|
||||
prefix key-prefix tables)
|
||||
;; Stop iteration.
|
||||
(setq key-prefixes nil)))
|
||||
(if (equal key-prefix prefix)
|
||||
prefix
|
||||
(cons prefix (length key-prefix)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun company-yasnippet (command &optional arg &rest _ignore)
|
||||
"`company-mode' backend for `yasnippet'.
|
||||
|
||||
This backend should be used with care, because as long as there are
|
||||
snippets defined for the current major mode, this backend will always
|
||||
shadow backends that come after it. Recommended usages:
|
||||
|
||||
* In a buffer-local value of `company-backends', grouped with a backend or
|
||||
several that provide actual text completions.
|
||||
|
||||
(add-hook \\='js-mode-hook
|
||||
(lambda ()
|
||||
(set (make-local-variable \\='company-backends)
|
||||
\\='((company-dabbrev-code company-yasnippet)))))
|
||||
|
||||
* After keyword `:with', grouped with other backends.
|
||||
|
||||
(push \\='(company-semantic :with company-yasnippet) company-backends)
|
||||
|
||||
* Not in `company-backends', just bound to a key.
|
||||
|
||||
(global-set-key (kbd \"C-c y\") \\='company-yasnippet)
|
||||
"
|
||||
(interactive (list 'interactive))
|
||||
(cl-case command
|
||||
(interactive (company-begin-backend 'company-yasnippet))
|
||||
(prefix
|
||||
(and (bound-and-true-p yas-minor-mode)
|
||||
(company-yasnippet--prefix)))
|
||||
(annotation
|
||||
(funcall company-yasnippet-annotation-fn
|
||||
(get-text-property 0 'yas-annotation arg)))
|
||||
(candidates (company-yasnippet--candidates arg))
|
||||
(doc-buffer (company-yasnippet--doc arg))
|
||||
(no-cache t)
|
||||
(kind 'snippet)
|
||||
(post-completion
|
||||
(let ((template (get-text-property 0 'yas-template arg))
|
||||
(prefix-offset (get-text-property 0 'yas-prefix-offset arg)))
|
||||
(yas-expand-snippet (yas--template-content template)
|
||||
(- (point) (length arg) prefix-offset)
|
||||
(point)
|
||||
(yas--template-expand-env template))))))
|
||||
|
||||
(provide 'company-yasnippet)
|
||||
;;; company-yasnippet.el ends here
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load diff
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
|
@ -1,18 +0,0 @@
|
|||
This is the file .../info/dir, which contains the
|
||||
topmost node of the Info hierarchy, called (dir)Top.
|
||||
The first time you invoke Info you start off looking at this node.
|
||||
|
||||
File: dir, Node: Top This is the top of the INFO tree
|
||||
|
||||
This (the Directory node) gives a menu of major topics.
|
||||
Typing "q" exits, "H" lists all Info commands, "d" returns here,
|
||||
"h" gives a primer for first-timers,
|
||||
"mEmacs<Return>" visits the Emacs manual, etc.
|
||||
|
||||
In Emacs, you can click mouse button 2 on a menu item or cross reference
|
||||
to select it.
|
||||
|
||||
* Menu:
|
||||
|
||||
Emacs misc features
|
||||
* Company: (company). A modular text completion framework.
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue