update code elpa
This commit is contained in:
parent
a31283923d
commit
738498683f
|
@ -1,6 +1,6 @@
|
|||
(define-package "all-the-icons" "20220325.1238" "A library for inserting Developer icons"
|
||||
(define-package "all-the-icons" "20220801.1541" "A library for inserting Developer icons"
|
||||
'((emacs "24.3"))
|
||||
:commit "65c496d3d1d1298345beb9845840067bffb2ffd8" :authors
|
||||
:commit "6f876fa11ef64af20d9b2a44fdabac6446de51ba" :authors
|
||||
'(("Dominic Charlesworth" . "dgc336@gmail.com"))
|
||||
:maintainer
|
||||
'("Dominic Charlesworth" . "dgc336@gmail.com")
|
|
@ -120,6 +120,11 @@
|
|||
:group 'all-the-icons
|
||||
:type 'number)
|
||||
|
||||
(defcustom all-the-icons-fonts-subdirectory nil
|
||||
"The subdirectory within the system fonts folder where the icons are installed."
|
||||
:group 'all-the-icons
|
||||
:type 'directory)
|
||||
|
||||
(defvar all-the-icons-font-families '() "List of defined icon font families.")
|
||||
(defvar all-the-icons-font-names '() "List of defined font file names this package was built with.")
|
||||
|
||||
|
@ -136,6 +141,8 @@
|
|||
("babelrc" all-the-icons-fileicon "babel" :face all-the-icons-yellow)
|
||||
("bashrc" all-the-icons-alltheicon "script" :height 0.9 :face all-the-icons-dpink)
|
||||
("bowerrc" all-the-icons-alltheicon "bower" :height 1.0 :v-adjust 0.0 :face all-the-icons-silver)
|
||||
("cr" all-the-icons-fileicon "crystal" :v-adjust 0.0 :face all-the-icons-yellow)
|
||||
("ecr" all-the-icons-fileicon "crystal" :v-adjust 0.0 :face all-the-icons-yellow)
|
||||
("ini" all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-yellow)
|
||||
("eslintignore" all-the-icons-fileicon "eslint" :height 0.9 :face all-the-icons-purple)
|
||||
("eslint" all-the-icons-fileicon "eslint" :height 0.9 :face all-the-icons-lpurple)
|
||||
|
@ -202,6 +209,9 @@
|
|||
("rd" all-the-icons-fileicon "R" :face all-the-icons-lblue)
|
||||
("rdx" all-the-icons-fileicon "R" :face all-the-icons-lblue)
|
||||
("rsx" all-the-icons-fileicon "R" :face all-the-icons-lblue)
|
||||
("svelte" all-the-icons-fileicon "svelte" :v-adjust 0.0 :face all-the-icons-red)
|
||||
("gql" all-the-icons-fileicon "graphql" :face all-the-icons-dpink)
|
||||
("graphql" all-the-icons-fileicon "graphql" :face all-the-icons-dpink)
|
||||
;; There seems to be a a bug with this font icon which does not
|
||||
;; let you propertise it without it reverting to being a lower
|
||||
;; case phi
|
||||
|
@ -344,6 +354,8 @@
|
|||
("fsscript" all-the-icons-fileicon "fsharp" :face all-the-icons-blue-alt)
|
||||
;; zig
|
||||
("zig" all-the-icons-fileicon "zig" :face all-the-icons-orange)
|
||||
;; odin
|
||||
("odin" all-the-icons-fileicon "odin" :height 1.1 :face all-the-icons-lblue)
|
||||
;; File Types
|
||||
("ico" all-the-icons-octicon "file-media" :v-adjust 0.0 :face all-the-icons-blue)
|
||||
("png" all-the-icons-octicon "file-media" :v-adjust 0.0 :face all-the-icons-orange)
|
||||
|
@ -426,24 +438,22 @@ for performance sake.")
|
|||
("^readme" all-the-icons-octicon "book" :height 1.0 :v-adjust 0.0 :face all-the-icons-lcyan)
|
||||
|
||||
;; Config
|
||||
("^bower.json$" all-the-icons-alltheicon "bower" :height 1.0 :v-adjust 0.0 :face all-the-icons-lorange)
|
||||
("nginx$" all-the-icons-fileicon "nginx" :height 0.9 :face all-the-icons-dgreen)
|
||||
("apache$" all-the-icons-alltheicon "apache" :height 0.9 :face all-the-icons-dgreen)
|
||||
|
||||
;; C
|
||||
("^Makefile$" all-the-icons-fileicon "gnu" :face all-the-icons-dorange)
|
||||
("^CMakeLists.txt$" all-the-icons-fileicon "cmake" :face all-the-icons-red)
|
||||
("^CMakeCache.txt$" all-the-icons-fileicon "cmake" :face all-the-icons-blue)
|
||||
|
||||
;; Docker
|
||||
("^\\.?Dockerfile" all-the-icons-fileicon "dockerfile" :face all-the-icons-blue)
|
||||
|
||||
;; Homebrew
|
||||
("^Brewfile$" all-the-icons-faicon "beer" :face all-the-icons-lsilver)
|
||||
("\\.npmignore$" all-the-icons-fileicon "npm" :face all-the-icons-dred)
|
||||
("^package.json$" all-the-icons-fileicon "npm" :face all-the-icons-red)
|
||||
("^package.lock.json$" all-the-icons-fileicon "npm" :face all-the-icons-dred)
|
||||
("^yarn\\.lock" all-the-icons-fileicon "yarn" :face all-the-icons-blue-alt)
|
||||
|
||||
;; ;; AWS
|
||||
("^stack.*.json$" all-the-icons-alltheicon "aws" :face all-the-icons-orange)
|
||||
|
||||
|
||||
("^serverless\\.yml$" all-the-icons-faicon "bolt" :v-adjust 0.0 :face all-the-icons-yellow)
|
||||
|
||||
;; lock files
|
||||
|
@ -452,6 +462,7 @@ for performance sake.")
|
|||
;; Source Codes
|
||||
("^mix.lock$" all-the-icons-alltheicon "elixir" :face all-the-icons-lyellow :v-adjust -0.1 :height 0.9)
|
||||
|
||||
;; Ruby
|
||||
("^Gemfile\\(\\.lock\\)?$" all-the-icons-alltheicon "ruby-alt" :face all-the-icons-red)
|
||||
("_?test\\.rb$" all-the-icons-fileicon "test-ruby" :height 1.0 :v-adjust 0.0 :face all-the-icons-red)
|
||||
("_?test_helper\\.rb$" all-the-icons-fileicon "test-ruby" :height 1.0 :v-adjust 0.0 :face all-the-icons-dred)
|
||||
|
@ -471,11 +482,22 @@ for performance sake.")
|
|||
|
||||
;; Stylesheeting
|
||||
("stylelint" all-the-icons-fileicon "stylelint" :face all-the-icons-lyellow)
|
||||
|
||||
;; JavaScript
|
||||
("^package.json$" all-the-icons-fileicon "npm" :face all-the-icons-red)
|
||||
("^package.lock.json$" all-the-icons-fileicon "npm" :face all-the-icons-dred)
|
||||
("^yarn\\.lock" all-the-icons-fileicon "yarn" :face all-the-icons-blue-alt)
|
||||
("\\.npmignore$" all-the-icons-fileicon "npm" :face all-the-icons-dred)
|
||||
("^bower.json$" all-the-icons-alltheicon "bower" :height 1.0 :v-adjust 0.0 :face all-the-icons-lorange)
|
||||
("^gulpfile" all-the-icons-alltheicon "gulp" :height 1.0 :face all-the-icons-lred)
|
||||
("^gruntfile" all-the-icons-alltheicon "grunt" :height 1.0 :v-adjust -0.1 :face all-the-icons-lyellow)
|
||||
("^webpack" all-the-icons-fileicon "webpack" :face all-the-icons-lblue)
|
||||
|
||||
;; Go
|
||||
("^go.mod$" all-the-icons-fileicon "config-go" :height 1.0 :face all-the-icons-blue-alt)
|
||||
("^go.work$" all-the-icons-fileicon "config-go" :height 1.0 :face all-the-icons-blue-alt)
|
||||
|
||||
;; Emacs
|
||||
("bookmark" all-the-icons-octicon "bookmark" :height 1.1 :v-adjust 0.0 :face all-the-icons-lpink)
|
||||
|
||||
("^\\*scratch\\*$" all-the-icons-faicon "sticky-note" :face all-the-icons-lyellow)
|
||||
|
@ -547,6 +569,7 @@ for performance sake.")
|
|||
(emacs-lisp-mode all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.1 :face all-the-icons-purple)
|
||||
(circe-server-mode all-the-icons-faicon "commenting-o" :height 1.0 :v-adjust 0.0)
|
||||
(circe-channel-mode all-the-icons-faicon "commenting-o" :height 1.0 :v-adjust 0.0)
|
||||
(crystal-mode all-the-icons-fileicon "crystal" :v-adjust 0.0 :face all-the-icons-yellow)
|
||||
(erc-mode all-the-icons-faicon "commenting-o" :height 1.0 :v-adjust 0.0)
|
||||
(inferior-emacs-lisp-mode all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.1 :face all-the-icons-lblue)
|
||||
(dired-mode all-the-icons-octicon "file-directory" :v-adjust 0.0)
|
||||
|
@ -611,6 +634,7 @@ for performance sake.")
|
|||
(docker-compose-mode all-the-icons-fileicon "dockerfile" :face all-the-icons-lblue)
|
||||
(nxml-mode all-the-icons-faicon "file-code-o" :height 0.95 :face all-the-icons-lorange)
|
||||
(json-mode all-the-icons-octicon "settings" :face all-the-icons-yellow)
|
||||
(jsonian-mode all-the-icons-octicon "settings" :face all-the-icons-yellow)
|
||||
(yaml-mode all-the-icons-octicon "settings" :v-adjust 0.0 :face all-the-icons-dyellow)
|
||||
(elisp-byte-code-mode all-the-icons-octicon "file-binary" :v-adjust 0.0 :face all-the-icons-dsilver)
|
||||
(archive-mode all-the-icons-octicon "file-zip" :v-adjust 0.0 :face all-the-icons-lmaroon)
|
||||
|
@ -619,6 +643,9 @@ for performance sake.")
|
|||
(elixir-mode all-the-icons-alltheicon "elixir" :face all-the-icons-lorange :v-adjust -0.1 :height 0.9)
|
||||
(java-mode all-the-icons-alltheicon "java" :height 1.0 :face all-the-icons-purple)
|
||||
(go-mode all-the-icons-fileicon "go" :height 1.0 :face all-the-icons-blue)
|
||||
(go-dot-mod-mode all-the-icons-fileicon "config-go" :height 1.0 :face all-the-icons-blue-alt)
|
||||
(go-dot-work-mode all-the-icons-fileicon "config-go" :height 1.0 :face all-the-icons-blue-alt)
|
||||
(graphql-mode all-the-icons-fileicon "graphql" :face all-the-icons-dpink)
|
||||
(matlab-mode all-the-icons-fileicon "matlab" :face all-the-icons-orange)
|
||||
(nix-mode all-the-icons-fileicon "nix" :face all-the-icons-blue)
|
||||
(perl-mode all-the-icons-alltheicon "perl" :face all-the-icons-lorange)
|
||||
|
@ -632,6 +659,7 @@ for performance sake.")
|
|||
(scala-mode all-the-icons-alltheicon "scala" :face all-the-icons-red)
|
||||
(scheme-mode all-the-icons-fileicon "scheme" :height 1.2 :face all-the-icons-red)
|
||||
(swift-mode all-the-icons-alltheicon "swift" :height 1.0 :v-adjust -0.1 :face all-the-icons-green)
|
||||
(svelte-mode all-the-icons-fileicon "svelte" :v-adjust 0.0 :face all-the-icons-red)
|
||||
(c-mode all-the-icons-alltheicon "c-line" :face all-the-icons-blue)
|
||||
(c++-mode all-the-icons-alltheicon "cplusplus-line" :v-adjust -0.2 :face all-the-icons-blue)
|
||||
(csharp-mode all-the-icons-alltheicon "csharp-line" :face all-the-icons-dblue)
|
||||
|
@ -689,6 +717,7 @@ for performance sake.")
|
|||
(hy-mode all-the-icons-fileicon "hy" :face all-the-icons-blue)
|
||||
(glsl-mode all-the-icons-fileicon "vertex-shader" :face all-the-icons-green)
|
||||
(zig-mode all-the-icons-fileicon "zig" :face all-the-icons-orange)
|
||||
(odin-mode all-the-icons-fileicon "odin" :height 1.1 :face all-the-icons-lblue)
|
||||
(pdf-view-mode all-the-icons-octicon "file-pdf" :v-adjust 0.0 :face all-the-icons-dred)
|
||||
(elfeed-search-mode all-the-icons-faicon "rss-square" :face all-the-icons-orange)
|
||||
(elfeed-show-mode all-the-icons-faicon "rss" :face all-the-icons-orange)
|
||||
|
@ -1065,10 +1094,13 @@ When PFX is non-nil, ignore the prompt and just install"
|
|||
((member system-type '(gnu gnu/linux gnu/kfreebsd))
|
||||
(concat (or (getenv "XDG_DATA_HOME")
|
||||
(concat (getenv "HOME") "/.local/share"))
|
||||
"/fonts/"))
|
||||
"/fonts/"
|
||||
all-the-icons-fonts-subdirectory))
|
||||
;; Default MacOS install directory
|
||||
((eq system-type 'darwin)
|
||||
(concat (getenv "HOME") "/Library/Fonts/"))))
|
||||
(concat (getenv "HOME")
|
||||
"/Library/Fonts/"
|
||||
all-the-icons-fonts-subdirectory))))
|
||||
(known-dest? (stringp font-dest))
|
||||
(font-dest (or font-dest (read-directory-name "Font installation directory: " "~/"))))
|
||||
|
|
@ -94,6 +94,16 @@
|
|||
( "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" )
|
||||
|
@ -302,6 +312,7 @@
|
|||
( "objective-j" . "\xe99e" )
|
||||
( "ocaml" . "\xe91a" )
|
||||
( "octave" . "\xea33" )
|
||||
( "odin" . "\eb36" )
|
||||
( "onenote" . "\xe9eb" )
|
||||
( "ooc" . "\xe9cb" )
|
||||
( "opa" . "\x2601" )
|
||||
|
@ -415,6 +426,7 @@
|
|||
( "stylus-orb" . "\x53" )
|
||||
( "sublime" . "\xe986" )
|
||||
( "sv" . "\xe9c3" )
|
||||
( "svelte" . "\x33dc" )
|
||||
( "svn" . "\xea17" )
|
||||
( "swagger" . "\xea29" )
|
||||
( "tag" . "\xf015" )
|
||||
|
@ -482,9 +494,8 @@
|
|||
( "yui" . "\xea00" )
|
||||
( "zbrush" . "\xe9f2" )
|
||||
( "zephir" . "\xe9c7" )
|
||||
("zig" . "\x7A")
|
||||
( "zig" . "\x7A" )
|
||||
( "zimpl" . "\xe9c8" )
|
||||
|
||||
)
|
||||
)
|
||||
|
|
@ -1,159 +0,0 @@
|
|||
;;; all-the-icons-dired.el --- Shows icons for each file in dired mode -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2016-2020 jtbm37
|
||||
;; Copyright (C) 2021 Jimmy Yuen Ho Wong
|
||||
|
||||
;; Author: jtbm37
|
||||
;; Maintainer: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
|
||||
;; Version: 2.0
|
||||
;; Package-Version: 20220304.1638
|
||||
;; Package-Commit: 147ed0dfd1034a686795a08dc63e2c293128597e
|
||||
;; Keywords: files icons dired
|
||||
;; Package-Requires: ((emacs "24.4") (all-the-icons "2.2.0"))
|
||||
;; URL: https://github.com/wyuenho/all-the-icons-dired
|
||||
|
||||
;; 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:
|
||||
;; To use this package, simply add this to your init.el:
|
||||
;; (add-hook 'dired-mode-hook 'all-the-icons-dired-mode)
|
||||
|
||||
;; To manually install, add this to your init.el before the hook mentioned above.
|
||||
;; (add-to-load-path (expand-file-name "~/path/to/all-the-icons-dired"))
|
||||
;; (load "all-the-icons-dired.el")
|
||||
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'cl-lib)
|
||||
(require 'dired)
|
||||
(require 'all-the-icons)
|
||||
(require 'subr-x)
|
||||
|
||||
(defface all-the-icons-dired-dir-face
|
||||
'((((background dark)) :foreground "white")
|
||||
(((background light)) :foreground "black"))
|
||||
"Face for the directory icon"
|
||||
:group 'all-the-icons-faces)
|
||||
|
||||
(defcustom all-the-icons-dired-v-adjust 0.01
|
||||
"The default vertical adjustment of the icon in the dired buffer."
|
||||
:group 'all-the-icons
|
||||
:type 'number)
|
||||
|
||||
(defcustom all-the-icons-dired-monochrome t
|
||||
"Whether to show the icons as the same color as the text on the same line."
|
||||
:group 'all-the-icons
|
||||
:type 'boolean)
|
||||
|
||||
(defvar all-the-icons-dired-mode)
|
||||
|
||||
(defun all-the-icons-dired--add-overlay (pos string)
|
||||
"Add overlay to display STRING at POS."
|
||||
(let ((ov (make-overlay (1- pos) pos)))
|
||||
(overlay-put ov 'all-the-icons-dired-overlay t)
|
||||
(overlay-put ov 'after-string string)))
|
||||
|
||||
(defun all-the-icons-dired--overlays-in (beg end)
|
||||
"Get all all-the-icons-dired overlays between BEG to END."
|
||||
(cl-remove-if-not
|
||||
(lambda (ov)
|
||||
(overlay-get ov 'all-the-icons-dired-overlay))
|
||||
(overlays-in beg end)))
|
||||
|
||||
(defun all-the-icons-dired--overlays-at (pos)
|
||||
"Get all-the-icons-dired overlays at POS."
|
||||
(apply #'all-the-icons-dired--overlays-in `(,pos ,pos)))
|
||||
|
||||
(defun all-the-icons-dired--remove-all-overlays ()
|
||||
"Remove all `all-the-icons-dired' overlays."
|
||||
(save-restriction
|
||||
(widen)
|
||||
(mapc #'delete-overlay
|
||||
(all-the-icons-dired--overlays-in (point-min) (point-max)))))
|
||||
|
||||
(defun all-the-icons-dired--refresh ()
|
||||
"Display the icons of files in a dired buffer."
|
||||
(all-the-icons-dired--remove-all-overlays)
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(while (not (eobp))
|
||||
(when (dired-move-to-filename nil)
|
||||
(let ((case-fold-search t))
|
||||
(when-let* ((file (dired-get-filename 'relative 'noerror))
|
||||
(icon (if (file-directory-p file)
|
||||
(all-the-icons-icon-for-dir file
|
||||
:face 'all-the-icons-dired-dir-face
|
||||
:v-adjust all-the-icons-dired-v-adjust)
|
||||
(apply 'all-the-icons-icon-for-file file
|
||||
(append
|
||||
`(:v-adjust ,all-the-icons-dired-v-adjust)
|
||||
(when all-the-icons-dired-monochrome
|
||||
`(:face ,(face-at-point))))))))
|
||||
(if (member file '("." ".."))
|
||||
(all-the-icons-dired--add-overlay (dired-move-to-filename) " \t")
|
||||
(all-the-icons-dired--add-overlay (dired-move-to-filename) (concat icon "\t"))))))
|
||||
(forward-line 1))))
|
||||
|
||||
(defun all-the-icons-dired--refresh-advice (fn &rest args)
|
||||
"Advice function for FN with ARGS."
|
||||
(prog1 (apply fn args)
|
||||
(when all-the-icons-dired-mode
|
||||
(all-the-icons-dired--refresh))))
|
||||
|
||||
(defvar all-the-icons-dired-advice-alist
|
||||
'((dired-aux dired-do-redisplay all-the-icons-dired--refresh-advice)
|
||||
(dired-aux dired-create-directory all-the-icons-dired--refresh-advice)
|
||||
(dired-aux dired-do-create-files all-the-icons-dired--refresh-advice)
|
||||
(dired-aux dired-do-kill-lines all-the-icons-dired--refresh-advice)
|
||||
(dired-aux dired-do-rename all-the-icons-dired--refresh-advice)
|
||||
(dired-aux dired-insert-subdir all-the-icons-dired--refresh-advice)
|
||||
(dired-aux dired-kill-subdir all-the-icons-dired--refresh-advice)
|
||||
(dired wdired-abort-changes all-the-icons-dired--refresh-advice)
|
||||
(dired dired-internal-do-deletions all-the-icons-dired--refresh-advice)
|
||||
(dired-narrow dired-narrow--internal all-the-icons-dired--refresh-advice)
|
||||
(dired-subtree dired-subtree-insert all-the-icons-dired--refresh-advice)
|
||||
(dired-subtree dired-subtree-remove all-the-icons-dired--refresh-advice)
|
||||
(dired dired-readin all-the-icons-dired--refresh-advice)
|
||||
(dired dired-revert all-the-icons-dired--refresh-advice)
|
||||
(find-dired find-dired-sentinel all-the-icons-dired--refresh-advice))
|
||||
"A list of file, adviced function, and advice function.")
|
||||
|
||||
(defun all-the-icons-dired--setup ()
|
||||
"Setup `all-the-icons-dired'."
|
||||
(setq-local tab-width 1)
|
||||
(pcase-dolist (`(,file ,sym ,fn) all-the-icons-dired-advice-alist)
|
||||
(with-eval-after-load file
|
||||
(advice-add sym :around fn)))
|
||||
(all-the-icons-dired--refresh))
|
||||
|
||||
(defun all-the-icons-dired--teardown ()
|
||||
"Functions used as advice when redisplaying buffer."
|
||||
(kill-local-variable 'tab-width)
|
||||
(pcase-dolist (`(,file ,sym ,fn) all-the-icons-dired-advice-alist)
|
||||
(with-eval-after-load file
|
||||
(advice-remove sym fn)))
|
||||
(all-the-icons-dired--remove-all-overlays))
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode all-the-icons-dired-mode
|
||||
"Display all-the-icons icon for each file in a dired buffer."
|
||||
:lighter " all-the-icons-dired-mode"
|
||||
(when (derived-mode-p 'dired-mode)
|
||||
(if all-the-icons-dired-mode
|
||||
(all-the-icons-dired--setup)
|
||||
(all-the-icons-dired--teardown))))
|
||||
|
||||
(provide 'all-the-icons-dired)
|
||||
;;; all-the-icons-dired.el ends here
|
|
@ -1,2 +1,2 @@
|
|||
;;; Generated package description from all-the-icons-dired.el -*- no-byte-compile: t -*-
|
||||
(define-package "all-the-icons-dired" "20220304.1638" "Shows icons for each file in dired mode" '((emacs "24.4") (all-the-icons "2.2.0")) :commit "147ed0dfd1034a686795a08dc63e2c293128597e" :authors '(("jtbm37")) :maintainer '("Jimmy Yuen Ho Wong" . "wyuenho@gmail.com") :keywords '("files" "icons" "dired") :url "https://github.com/wyuenho/all-the-icons-dired")
|
||||
(define-package "all-the-icons-dired" "20220620.1939" "Shows icons for each file in dired mode" '((emacs "24.4") (all-the-icons "2.2.0")) :commit "b5d3af1e47de09e6ac80d4d7fba516e6a3c38e26" :authors '(("jtbm37")) :maintainer '("Jimmy Yuen Ho Wong" . "wyuenho@gmail.com") :keywords '("files" "icons" "dired") :url "https://github.com/wyuenho/all-the-icons-dired")
|
|
@ -0,0 +1,116 @@
|
|||
;;; all-the-icons-dired.el --- Shows icons for each file in dired mode -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2016-2020 jtbm37
|
||||
;; Copyright (C) 2021 Jimmy Yuen Ho Wong
|
||||
|
||||
;; Author: jtbm37
|
||||
;; Maintainer: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
|
||||
;; Version: 2.0
|
||||
;; Package-Version: 20220620.1939
|
||||
;; Package-Commit: b5d3af1e47de09e6ac80d4d7fba516e6a3c38e26
|
||||
;; Keywords: files icons dired
|
||||
;; Package-Requires: ((emacs "24.4") (all-the-icons "2.2.0"))
|
||||
;; URL: https://github.com/wyuenho/all-the-icons-dired
|
||||
|
||||
;; 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:
|
||||
;; To use this package, simply add this to your init.el:
|
||||
;; (add-hook 'dired-mode-hook 'all-the-icons-dired-mode)
|
||||
|
||||
;; To manually install, add this to your init.el before the hook mentioned above.
|
||||
;; (add-to-load-path (expand-file-name "~/path/to/all-the-icons-dired"))
|
||||
;; (load "all-the-icons-dired.el")
|
||||
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'dired)
|
||||
(require 'all-the-icons)
|
||||
(require 'subr-x)
|
||||
|
||||
(defface all-the-icons-dired-dir-face
|
||||
'((((background dark)) :foreground "white")
|
||||
(((background light)) :foreground "black"))
|
||||
"Face for the directory icon"
|
||||
:group 'all-the-icons-faces)
|
||||
|
||||
(defcustom all-the-icons-dired-v-adjust 0.01
|
||||
"The default vertical adjustment of the icon in the dired buffer."
|
||||
:group 'all-the-icons
|
||||
:type 'number)
|
||||
|
||||
(defcustom all-the-icons-dired-monochrome t
|
||||
"Whether to show the icons as the same color as the text on the same line."
|
||||
:group 'all-the-icons
|
||||
:type 'boolean)
|
||||
|
||||
(defvar all-the-icons-dired-mode)
|
||||
|
||||
(defun all-the-icons-dired--icon (file)
|
||||
"Return the icon for FILE."
|
||||
(if (file-directory-p file)
|
||||
(all-the-icons-icon-for-dir file
|
||||
:face 'all-the-icons-dired-dir-face
|
||||
:v-adjust all-the-icons-dired-v-adjust)
|
||||
(apply 'all-the-icons-icon-for-file file
|
||||
(append
|
||||
`(:v-adjust ,all-the-icons-dired-v-adjust)
|
||||
(when all-the-icons-dired-monochrome
|
||||
`(:face ,(face-at-point)))))))
|
||||
|
||||
(defun all-the-icons-dired--put-icon (pos)
|
||||
"Propertize POS with icon."
|
||||
(let* ((file (dired-get-filename 'relative 'noerror))
|
||||
(icon (all-the-icons-dired--icon file)))
|
||||
(put-text-property (1- pos) pos 'display
|
||||
(if (member file '("." ".."))
|
||||
" "
|
||||
(concat " " icon " ")))))
|
||||
|
||||
(defun all-the-icons-dired--propertize (&optional beg end &rest _)
|
||||
"Add icons using text properties from BEG to END.
|
||||
They defualt to `(point-min)' and `(point-max)'."
|
||||
(let ((beg (or beg (point-min)))
|
||||
(end (or end (point-max))))
|
||||
(when dired-subdir-alist
|
||||
(with-silent-modifications
|
||||
(save-excursion
|
||||
(goto-char beg)
|
||||
(while (< (point) end)
|
||||
(when-let ((pos (dired-move-to-filename)))
|
||||
(all-the-icons-dired--put-icon pos))
|
||||
(forward-line 1)))))))
|
||||
|
||||
(defun all-the-icons-dired--setup ()
|
||||
"Setup `all-the-icons-dired'."
|
||||
(add-hook 'dired-after-readin-hook #'all-the-icons-dired--propertize)
|
||||
(advice-add 'dired-insert-set-properties :before #'all-the-icons-dired--propertize))
|
||||
|
||||
(defun all-the-icons-dired--teardown ()
|
||||
"Functions used as advice when redisplaying buffer."
|
||||
(remove-hook 'dired-after-readin-hook #'all-the-icons-dired--propertize)
|
||||
(advice-remove 'dired-insert-set-properties #'all-the-icons-dired--propertize))
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode all-the-icons-dired-mode
|
||||
"Display all-the-icons icon for each file in a dired buffer."
|
||||
:lighter " all-the-icons-dired-mode"
|
||||
(when (derived-mode-p 'dired-mode)
|
||||
(if all-the-icons-dired-mode
|
||||
(all-the-icons-dired--setup)
|
||||
(all-the-icons-dired--teardown))))
|
||||
|
||||
(provide 'all-the-icons-dired)
|
||||
;;; all-the-icons-dired.el ends here
|
File diff suppressed because it is too large
Load diff
|
@ -1 +1 @@
|
|||
Good signature from 066DAFCB81E42C40 GNU ELPA Signing Agent (2019) <elpasign@elpa.gnu.org> (trust undefined) created at 2022-04-25T05:10:02-0400 using RSA
|
||||
Good signature from 066DAFCB81E42C40 GNU ELPA Signing Agent (2019) <elpasign@elpa.gnu.org> (trust undefined) created at 2022-08-03T17:05:03-0400 using RSA
|
File diff suppressed because it is too large
Load diff
|
@ -28,13 +28,13 @@
|
|||
(:authors
|
||||
("Jordon Biondo" . "jordonbiondo@gmail.com")))])
|
||||
(annotate .
|
||||
[(1 5 3)
|
||||
[(1 7 0)
|
||||
nil "annotate files without changing them" tar
|
||||
((:url . "https://github.com/bastibe/annotate.el")
|
||||
(:maintainer "Bastian Bechtold <bastibe.dev@mailbox.org>, cage" . "cage-dev@twistfold.it")
|
||||
(:authors
|
||||
("Bastian Bechtold"))
|
||||
(:commit . "e694b977cc82887ce722912a2634ae4b0bc4f5ea"))])
|
||||
(:commit . "9bfa065a4e14f7e96c8ac487c4e54b084a02133c"))])
|
||||
(anti-zenburn-theme .
|
||||
[(2 5 1)
|
||||
nil "Low-contrast Zenburn-inverted theme" tar
|
||||
|
@ -60,12 +60,13 @@
|
|||
("Karl Chen" . "quarl@nospam.quarl.org"))
|
||||
(:keywords "languages" "faces"))])
|
||||
(apropospriate-theme .
|
||||
[(0 1 1)
|
||||
[(0 2 0)
|
||||
nil "A light & dark theme set for Emacs." tar
|
||||
((:url . "http://github.com/waymondo/apropospriate-theme")
|
||||
(:maintainer "Justin Talbott" . "justin@waymondo.com")
|
||||
(:authors
|
||||
("Justin Talbott" . "justin@waymondo.com")))])
|
||||
("Justin Talbott" . "justin@waymondo.com"))
|
||||
(:commit . "a03fd98f438806bfd74ed3cd0957de859ea7fd2f"))])
|
||||
(arduino-mode .
|
||||
[(1 3 0)
|
||||
((emacs
|
||||
|
@ -149,12 +150,23 @@
|
|||
("Ian T Zimmerman" . "itz@rahul.net")
|
||||
("Damien Doligez" . "damien.doligez@inria.fr"))
|
||||
(:keywords "ocaml"))])
|
||||
(cdlatex .
|
||||
[(4 12)
|
||||
((auctex
|
||||
(9 9)))
|
||||
"Fast input methods for LaTeX environments and math" tar
|
||||
((:keywords "tex")
|
||||
(:maintainer "Carsten Dominik" . "carsten.dominik@gmail.com")
|
||||
(:authors
|
||||
("Carsten Dominik" . "carsten.dominik@gmail.com"))
|
||||
(:url . "https://elpa.nongnu.org/nongnu/cdlatex.html")
|
||||
(:commit . "7791fa94d509f56ed671055e856c5d00c788dd7e"))])
|
||||
(cider .
|
||||
[(1 3 0)
|
||||
[(1 4 1)
|
||||
((emacs
|
||||
(26))
|
||||
(clojure-mode
|
||||
(5 12))
|
||||
(5 14))
|
||||
(parseedn
|
||||
(1 0 6))
|
||||
(queue
|
||||
|
@ -176,16 +188,16 @@
|
|||
("Artur Malabarba" . "bruce.connor.am@gmail.com")
|
||||
("Hugo Duncan" . "hugo@hugoduncan.org")
|
||||
("Steve Purcell" . "steve@sanityinc.com"))
|
||||
(:commit . "6ddccef1d8cf48515b1cfa0addc1dd41e57e840a"))])
|
||||
(:commit . "11156e7b0cab470f4aab39d3af5ee3cb1e0b09d0"))])
|
||||
(clojure-mode .
|
||||
[(5 14 0)
|
||||
[(5 15 1)
|
||||
((emacs
|
||||
(25 1)))
|
||||
"Major mode for Clojure code" tar
|
||||
((:url . "http://github.com/clojure-emacs/clojure-mode")
|
||||
(:keywords "languages" "clojure" "clojurescript" "lisp")
|
||||
(:maintainer "Bozhidar Batsov" . "bozhidar@batsov.dev")
|
||||
(:commit . "b7d08b87f6a116ff47b33ee857926b60c66c3ab7"))])
|
||||
(:commit . "ad322e989e56c10c05bb286e5b55a82b1e031d62"))])
|
||||
(coffee-mode .
|
||||
[(0 6 3)
|
||||
((emacs
|
||||
|
@ -207,6 +219,21 @@
|
|||
(:maintainer "Julien Barnier")
|
||||
(:authors
|
||||
("Julien Barnier")))])
|
||||
(corfu-terminal .
|
||||
[(0 4)
|
||||
((emacs
|
||||
(26 1))
|
||||
(corfu
|
||||
(0 24))
|
||||
(popon
|
||||
(0 1)))
|
||||
"Corfu popup on terminal" tar
|
||||
((:url . "https://codeberg.org/akib/emacs-corfu-terminal")
|
||||
(:keywords "convenience")
|
||||
(:maintainer "Akib Azmain Turja" . "akib@disroot.org")
|
||||
(:authors
|
||||
("Akib Azmain Turja" . "akib@disroot.org"))
|
||||
(:commit . "7c5a8a1c07b6c1a41b358b083d5bf7773701d26b"))])
|
||||
(crux .
|
||||
[(0 4 0)
|
||||
((seq
|
||||
|
@ -225,6 +252,19 @@
|
|||
(:maintainer "Nicholas M. Van Horn" . "nvanhorn@protonmail.com")
|
||||
(:authors
|
||||
("Nicholas M. Van Horn" . "nvanhorn@protonmail.com")))])
|
||||
(cycle-at-point .
|
||||
[(0 1)
|
||||
((emacs
|
||||
(28 1))
|
||||
(recomplete
|
||||
(0 2)))
|
||||
"Cycle (rotate) the thing under the cursor" tar
|
||||
((:url . "https://codeberg.com/ideasman42/emacs-cycle-at-point")
|
||||
(:keywords "convenience")
|
||||
(:maintainer "Campbell Barton")
|
||||
(:authors
|
||||
("Campbell Barton"))
|
||||
(:commit . "ea22b90f35f4cef73387047b3ef3fad83787d4e2"))])
|
||||
(d-mode .
|
||||
[(202003130913)
|
||||
((emacs
|
||||
|
@ -245,6 +285,27 @@
|
|||
(:authors
|
||||
("https://github.com/bradyt/dart-mode/issues"))
|
||||
(:keywords "languages"))])
|
||||
(diff-ansi .
|
||||
[(0 2)
|
||||
((emacs
|
||||
(27 1)))
|
||||
"Display diff's using alternative diffing tools" tar
|
||||
((:url . "https://codeberg.org/ideasman42/emacs-diff-ansi")
|
||||
(:maintainer "Campbell Barton" . "ideasman42@gmail.com")
|
||||
(:authors
|
||||
("Campbell Barton" . "ideasman42@gmail.com"))
|
||||
(:commit . "71336e614e3150c47c58f99f2df10a3af73370ac"))])
|
||||
(doc-show-inline .
|
||||
[(0 1)
|
||||
((emacs
|
||||
(26 2)))
|
||||
"Show doc-strings found in external files" tar
|
||||
((:url . "https://codeberg.com/ideasman42/emacs-doc-show-inline")
|
||||
(:keywords "convenience")
|
||||
(:maintainer "Campbell Barton" . "ideasman42@gmail.com")
|
||||
(:authors
|
||||
("Campbell Barton" . "ideasman42@gmail.com"))
|
||||
(:commit . "1c5837d2a667d977a1bd90ba44ebd911cc660f26"))])
|
||||
(dockerfile-mode .
|
||||
[(1 5)
|
||||
((emacs
|
||||
|
@ -273,6 +334,16 @@
|
|||
(:authors
|
||||
("Arne Jørgensen" . "arne@arnested.dk"))
|
||||
(:commit . "ed90b0c4d808365e9ae9f16cc8a96eff17815621"))])
|
||||
(edit-indirect .
|
||||
[(0 1 10)
|
||||
((emacs
|
||||
(24 3)))
|
||||
"Edit regions in separate buffers" tar
|
||||
((:url . "https://github.com/Fanael/edit-indirect")
|
||||
(:maintainer "Fanael Linithien" . "fanael4@gmail.com")
|
||||
(:authors
|
||||
("Fanael Linithien" . "fanael4@gmail.com"))
|
||||
(:commit . "f80f63822ffae78de38dbe72cacaeb1aaa96c732"))])
|
||||
(editorconfig .
|
||||
[(0 8 2)
|
||||
((cl-lib
|
||||
|
@ -295,7 +366,7 @@
|
|||
(:keywords "languages" "elixir")
|
||||
(:commit . "1d94b525ddcc995b5a979de7b050c2309648ca6f"))])
|
||||
(elpher .
|
||||
[(3 3 3)
|
||||
[(3 4 2)
|
||||
((emacs
|
||||
(27 1)))
|
||||
"A friendly gopher and gemini client" tar
|
||||
|
@ -304,12 +375,14 @@
|
|||
(:maintainer "Tim Vaughan" . "plugd@thelambdalab.xyz")
|
||||
(:authors
|
||||
("Tim Vaughan" . "plugd@thelambdalab.xyz"))
|
||||
(:commit . "ab75cffa4572115c3d6b17348b6bfa2f746f4798"))])
|
||||
(:commit . "f117f2f53490dbe521d3a726362b37dba0cd418a"))])
|
||||
(evil .
|
||||
[(1 14 0)
|
||||
[(1 15 0)
|
||||
nil "extensible vi layer" tar
|
||||
((:url . "https://github.com/emacs-evil/evil")
|
||||
(:keywords "emulation" "vim"))])
|
||||
(:keywords "emulation" "vim")
|
||||
(:maintainer "Tom Dalziel" . "tom.dalziel@gmail.com")
|
||||
(:commit . "008a6cdb12f15e748979a7d1c2f26c34c84dedbf"))])
|
||||
(evil-anzu .
|
||||
[(0 2)
|
||||
((evil
|
||||
|
@ -385,10 +458,8 @@
|
|||
(:authors
|
||||
("Sylvain Benner" . "sylvain.benner@gmail.com")))])
|
||||
(evil-matchit .
|
||||
[(2 4 4)
|
||||
((evil
|
||||
(1 14 0))
|
||||
(emacs
|
||||
[(3 0 0)
|
||||
((emacs
|
||||
(25 1)))
|
||||
"Vim matchit ported to Evil" tar
|
||||
((:url . "http://github.com/redguardtoo/evil-matchit")
|
||||
|
@ -396,7 +467,7 @@
|
|||
(:maintainer "Chen Bin" . "chenbin.sh@gmail.com")
|
||||
(:authors
|
||||
("Chen Bin" . "chenbin.sh@gmail.com"))
|
||||
(:commit . "b314e816bacfc01bb7df9b19a06b18638af5cdbe"))])
|
||||
(:commit . "7a2a7384b6e752a805d6fbb78cf9425e54c2b18b"))])
|
||||
(evil-nerd-commenter .
|
||||
[(3 5 7)
|
||||
((emacs
|
||||
|
@ -409,7 +480,7 @@
|
|||
("Chen Bin" . "chenbin.sh@gmail.com"))
|
||||
(:commit . "29ced6fda6a76771a8a054ef55c13a1330793d4d"))])
|
||||
(evil-numbers .
|
||||
[(0 6)
|
||||
[(0 7)
|
||||
((emacs
|
||||
(24 1))
|
||||
(evil
|
||||
|
@ -419,7 +490,8 @@
|
|||
(:keywords "convenience" "tools")
|
||||
(:maintainer "Julia Path" . "julia@jpath.de")
|
||||
(:authors
|
||||
("Michael Markert" . "markert.michael@googlemail.com")))])
|
||||
("Michael Markert" . "markert.michael@googlemail.com"))
|
||||
(:commit . "61dde4e3715fd1255df8f87a37d9c8022e909bf4"))])
|
||||
(evil-visualstar .
|
||||
[(0 2 0)
|
||||
((evil
|
||||
|
@ -439,6 +511,23 @@
|
|||
(:maintainer "https://turbocafe.keybase.pub")
|
||||
(:authors
|
||||
("https://turbocafe.keybase.pub")))])
|
||||
(flymake-popon .
|
||||
[(0 3)
|
||||
((emacs
|
||||
(26 1))
|
||||
(flymake
|
||||
(1 2 2))
|
||||
(popon
|
||||
(0 1))
|
||||
(posframe
|
||||
(1 1 7)))
|
||||
"Flymake diagnostics on cursor hover" tar
|
||||
((:url . "https://codeberg.org/akib/emacs-flymake-popon")
|
||||
(:keywords "convenience")
|
||||
(:maintainer "Akib Azmain Turja" . "akib@disroot.org")
|
||||
(:authors
|
||||
("Akib Azmain Turja" . "akib@disroot.org"))
|
||||
(:commit . "3255a917fc90d946a7a6f04ef7f7632c9a89ac94"))])
|
||||
(forth-mode .
|
||||
[(0 2)
|
||||
nil "Programming language mode for Forth" tar
|
||||
|
@ -460,7 +549,7 @@
|
|||
("Matus Goljer" . "matus.goljer@gmail.com"))
|
||||
(:commit . "6f9172376af4d399c7853cbdfdd7425348a878f9"))])
|
||||
(geiser .
|
||||
[(0 23 2)
|
||||
[(0 24)
|
||||
((emacs
|
||||
(25 1))
|
||||
(transient
|
||||
|
@ -473,7 +562,7 @@
|
|||
(:maintainer "Jose Antonio Ortega Ruiz" . "jao@gnu.org")
|
||||
(:authors
|
||||
("Jose Antonio Ortega Ruiz" . "jao@gnu.org"))
|
||||
(:commit . "bc0dde310492de733f9ec528d7aeddd57093d05e"))])
|
||||
(:commit . "d28d19b582347bffebbf0ca905297e744842a5f2"))])
|
||||
(geiser-chez .
|
||||
[(0 17)
|
||||
((emacs
|
||||
|
@ -690,14 +779,15 @@
|
|||
("David Vazquez Pua" . "davazp@gmail.com"))
|
||||
(:commit . "fe8d7e2db5581cd0cb7a69563bc44f0669f76322"))])
|
||||
(gruvbox-theme .
|
||||
[(1 26 0)
|
||||
[(1 27 0)
|
||||
((autothemer
|
||||
(0 2)))
|
||||
"A retro-groove colour theme for Emacs" tar
|
||||
((:url . "http://github.com/greduan/emacs-theme-gruvbox")
|
||||
(:maintainer "Jason Milkins" . "jasonm23@gmail.com")
|
||||
(:authors
|
||||
("Jason Milkins" . "jasonm23@gmail.com")))])
|
||||
("Jason Milkins" . "jasonm23@gmail.com"))
|
||||
(:commit . "01bcb9ed82cf00be15900fbe9721f62a6d1fa673"))])
|
||||
(guru-mode .
|
||||
[(1 0)
|
||||
nil "Become an Emacs guru" tar
|
||||
|
@ -741,29 +831,29 @@
|
|||
((:url . "https://gitlab.com/tseenshe/haskell-tng-mode")
|
||||
(:keywords "languages"))])
|
||||
(helm .
|
||||
[(3 8 5)
|
||||
[(3 8 7)
|
||||
((helm-core
|
||||
(3 8 4))
|
||||
(3 8 7))
|
||||
(popup
|
||||
(0 5 3)))
|
||||
"Helm is an Emacs incremental and narrowing framework" tar
|
||||
((:url . "https://emacs-helm.github.io/helm/")
|
||||
(:maintainer "Thierry Volpiatto" . "thierry.volpiatto@gmail.com")
|
||||
(:maintainer "Thierry Volpiatto" . "thievol@posteo.net")
|
||||
(:authors
|
||||
("Thierry Volpiatto" . "thierry.volpiatto@gmail.com"))
|
||||
(:commit . "5e035c9193bf1e1d4bb709794a154957544dcfc7"))])
|
||||
("Thierry Volpiatto" . "thievol@posteo.net"))
|
||||
(:commit . "4ede199d5d1b7050486a0fdeecbbbf49fef31118"))])
|
||||
(helm-core .
|
||||
[(3 8 5)
|
||||
[(3 8 7)
|
||||
((emacs
|
||||
(25 1))
|
||||
(async
|
||||
(1 9 4)))
|
||||
"Development files for Helm" tar
|
||||
((:url . "https://emacs-helm.github.io/helm/")
|
||||
(:maintainer "Thierry Volpiatto" . "thierry.volpiatto@gmail.com")
|
||||
(:maintainer "Thierry Volpiatto" . "thievol@posteo.net")
|
||||
(:authors
|
||||
("Thierry Volpiatto" . "thierry.volpiatto@gmail.com"))
|
||||
(:commit . "5e035c9193bf1e1d4bb709794a154957544dcfc7"))])
|
||||
("Thierry Volpiatto" . "thievol@posteo.net"))
|
||||
(:commit . "4ede199d5d1b7050486a0fdeecbbbf49fef31118"))])
|
||||
(highlight-parentheses .
|
||||
[(2 1 1)
|
||||
((emacs
|
||||
|
@ -775,6 +865,16 @@
|
|||
(:authors
|
||||
("Nikolaj Schumacher <bugs * nschum de>"))
|
||||
(:commit . "438a1cb2563e2a2496be4678cc0df8d5b22caf5d"))])
|
||||
(hl-block-mode .
|
||||
[(0 1)
|
||||
((emacs
|
||||
(26 1)))
|
||||
"Highlighting nested blocks" tar
|
||||
((:url . "https://codeberg.com/ideasman42/emacs-hl-block-mode")
|
||||
(:maintainer "Campbell Barton" . "ideasman42@gmail.com")
|
||||
(:authors
|
||||
("Campbell Barton" . "ideasman42@gmail.com"))
|
||||
(:commit . "877e14c0645397aa8c1a45eb34ea70f3ecd21280"))])
|
||||
(htmlize .
|
||||
[(1 57)
|
||||
nil "Convert buffer text and decorations to HTML." tar
|
||||
|
@ -783,6 +883,17 @@
|
|||
(:authors
|
||||
("Hrvoje Niksic" . "hniksic@gmail.com"))
|
||||
(:keywords "hypermedia" "extensions"))])
|
||||
(idle-highlight-mode .
|
||||
[(1 1 3)
|
||||
((emacs
|
||||
(27 1)))
|
||||
"Highlight the word the point is on" tar
|
||||
((:url . "https://codeberg.com/ideasman42/emacs-idle-highlight-mode")
|
||||
(:keywords "convenience")
|
||||
(:maintainer "Phil Hagelberg, Cornelius Mika, Campbell Barton")
|
||||
(:authors
|
||||
("Phil Hagelberg, Cornelius Mika, Campbell Barton"))
|
||||
(:commit . "f71e57554071a398dbc0e2d48a71908cf13541b4"))])
|
||||
(idris-mode .
|
||||
[(1 1 0)
|
||||
((emacs
|
||||
|
@ -804,14 +915,42 @@
|
|||
("Victor Ren" . "victorhge@gmail.com"))
|
||||
(:commit . "699e179dac18c78698cba1a2052bee6f0bbc6bf7"))])
|
||||
(inf-clojure .
|
||||
[(3 1 0)
|
||||
[(3 2 1)
|
||||
((emacs
|
||||
(25 1))
|
||||
(clojure-mode
|
||||
(5 11)))
|
||||
"Run an external Clojure process in an Emacs buffer" tar
|
||||
((:url . "http://github.com/clojure-emacs/inf-clojure")
|
||||
(:keywords "processes" "clojure"))])
|
||||
(:keywords "processes" "comint" "clojure")
|
||||
(:maintainer "Bozhidar Batsov" . "bozhidar@batsov.dev")
|
||||
(:commit . "151b20ba9d3ae39b88f91aecbab98bd5a5215f1a"))])
|
||||
(inf-ruby .
|
||||
[(2 6 1)
|
||||
((emacs
|
||||
(24 3)))
|
||||
"Run a Ruby process in a buffer" tar
|
||||
((:url . "http://github.com/nonsequitur/inf-ruby")
|
||||
(:keywords "languages" "ruby")
|
||||
(:maintainer "Yukihiro Matsumoto")
|
||||
(:authors
|
||||
("Yukihiro Matsumoto")
|
||||
("Nobuyoshi Nakada")
|
||||
("Cornelius Mika" . "cornelius.mika@gmail.com")
|
||||
("Dmitry Gutov" . "dgutov@yandex.ru")
|
||||
("Kyle Hargraves" . "pd@krh.me"))
|
||||
(:commit . "4ddf6b3889004156a224e061c78357fa8936777a"))])
|
||||
(inkpot-theme .
|
||||
[(0 1)
|
||||
((emacs
|
||||
(24 1)))
|
||||
"A port of vim's inkpot theme" tar
|
||||
((:url . "https://codeberg.com/ideasman42/emacs-inkpot-theme")
|
||||
(:maintainer "Sarah Iovan" . "sarah@hwaetageek.com")
|
||||
(:authors
|
||||
("Sarah Iovan" . "sarah@hwaetageek.com")
|
||||
("Campbell Barton" . "ideasman42@gmail.com"))
|
||||
(:commit . "de745de9ab7f67431a5ce493a63be68d408ec40e"))])
|
||||
(j-mode .
|
||||
[(1 1 1)
|
||||
nil "Major mode for editing J programs" tar
|
||||
|
@ -852,7 +991,7 @@
|
|||
("Jonas Bernoulli" . "jonas@bernoul.li"))
|
||||
(:commit . "98c2dda1a2ca0fc95f7425847a36abad5b31a4c7"))])
|
||||
(kotlin-mode .
|
||||
[(1 0 0)
|
||||
[(2 0 0)
|
||||
((emacs
|
||||
(24 3)))
|
||||
"Major mode for kotlin" tar
|
||||
|
@ -861,7 +1000,7 @@
|
|||
(:authors
|
||||
("Shodai Yokoyama" . "quantumcars@gmail.com"))
|
||||
(:url . "https://elpa.nongnu.org/nongnu/kotlin-mode.html")
|
||||
(:commit . "b9d03a769b91c6b15e99a9cadb8b1618e5205595"))])
|
||||
(:commit . "d92c3b773473e9fe15f61f6177e4fbf097aadd05"))])
|
||||
(lua-mode .
|
||||
[(20210802)
|
||||
((emacs
|
||||
|
@ -1032,8 +1171,31 @@
|
|||
(:keywords "nix" "languages" "tools" "unix")
|
||||
(:maintainer "Matthew Bauer" . "mjbauer95@gmail.com")
|
||||
(:commit . "e4e604ae3ac91748c4e7d51a591cb9ee60961b7c"))])
|
||||
(oblivion-theme .
|
||||
[(0 1)
|
||||
((emacs
|
||||
(24 1)))
|
||||
"A port of GEdit oblivion theme" tar
|
||||
((:url . "https://codeberg.com/ideasman42/emacs-oblivion-theme")
|
||||
(:maintainer "Campbell Barton" . "ideasman42@gmail.com")
|
||||
(:authors
|
||||
("Campbell Barton" . "ideasman42@gmail.com"))
|
||||
(:commit . "3a1d67637ea4a6099a62de45842b8c5e4440ede4"))])
|
||||
(org-auto-tangle .
|
||||
[(0 5 1)
|
||||
((emacs
|
||||
(24 1))
|
||||
(async
|
||||
(1 9 3)))
|
||||
"Automatically and Asynchronously tangles org files on save" tar
|
||||
((:url . "https://github.com/yilkalargaw/org-auto-tangle")
|
||||
(:keywords "outlines")
|
||||
(:maintainer "Yilkal Argaw" . "yilkalargawworkneh@gmail.com")
|
||||
(:authors
|
||||
("Yilkal Argaw" . "yilkalargawworkneh@gmail.com"))
|
||||
(:commit . "bce665c79fc29f1e80f1eae7db7e91c56b0788fc"))])
|
||||
(org-contrib .
|
||||
[(0 3)
|
||||
[(0 4)
|
||||
((emacs
|
||||
(25 1))
|
||||
(org
|
||||
|
@ -1043,7 +1205,8 @@
|
|||
(:keywords "org")
|
||||
(:maintainer "Bastien Guerry" . "bzg@gnu.org")
|
||||
(:authors
|
||||
("Bastien Guerry" . "bzg@gnu.org")))])
|
||||
("Bastien Guerry" . "bzg@gnu.org"))
|
||||
(:commit . "c6aef31ccfc7c4418c3b51e98f7c3bd8e255f5e6"))])
|
||||
(org-drill .
|
||||
[(2 7 0)
|
||||
((emacs
|
||||
|
@ -1074,16 +1237,16 @@
|
|||
("Bastian Bechtold")
|
||||
("Christian Schwarzgruber")))])
|
||||
(org-mime .
|
||||
[(0 2 6)
|
||||
[(0 3 1)
|
||||
((emacs
|
||||
(25 1)))
|
||||
"org html export for text/html MIME emails" tar
|
||||
((:url . "http://github.com/org-mime/org-mime")
|
||||
(:keywords "mime" "mail" "email" "html")
|
||||
(:maintainer "Chen Bin (redguardtoo)")
|
||||
(:maintainer "Chen Bin" . "chenbin.sh@gmail.com")
|
||||
(:authors
|
||||
("Eric Schulte"))
|
||||
(:commit . "3f1f3a38429da17811f61a7a5685224d79de9594"))])
|
||||
(:commit . "cf96f585c68ad14751a3f73d937cbfcb890171b9"))])
|
||||
(org-present .
|
||||
[(0 1)
|
||||
((org
|
||||
|
@ -1203,6 +1366,17 @@
|
|||
(:authors
|
||||
("Eric James Michael Ritz"))
|
||||
(:keywords "languages" "php"))])
|
||||
(popon .
|
||||
[(0 9)
|
||||
((emacs
|
||||
(25 1)))
|
||||
"\"Pop\" floating text \"on\" a window" tar
|
||||
((:url . "https://codeberg.org/akib/emacs-popon")
|
||||
(:keywords "lisp" "extensions" "frames")
|
||||
(:maintainer "Akib Azmain Turja" . "akib@disroot.org")
|
||||
(:authors
|
||||
("Akib Azmain Turja" . "akib@disroot.org"))
|
||||
(:commit . "b5b370077111ae65f50f8a3dca76e7c270ff0743"))])
|
||||
(popup .
|
||||
[(0 5 9)
|
||||
((emacs
|
||||
|
@ -1223,6 +1397,13 @@
|
|||
(:authors
|
||||
("Bozhidar Batsov" . "bozhidar@batsov.dev"))
|
||||
(:keywords "project" "convenience"))])
|
||||
(proof-general .
|
||||
[(4 5)
|
||||
((emacs
|
||||
(25 2)))
|
||||
"A generic Emacs interface for proof assistants" tar
|
||||
((:url . "https://proofgeneral.github.io/")
|
||||
(:commit . "c366365aaddeb3a65dc0816c8f93ec209dc9de44"))])
|
||||
(prop-menu .
|
||||
[(0 1 2)
|
||||
((emacs
|
||||
|
@ -1255,6 +1436,16 @@
|
|||
(:authors
|
||||
("Hinrik Örn Sigurðsson" . "hinrik.sig@gmail.com"))
|
||||
(:commit . "4ee9045eeb90f7831d7c0ee2e4adfcd957f712be"))])
|
||||
(recomplete .
|
||||
[(0 2)
|
||||
((emacs
|
||||
(26 1)))
|
||||
"Immediately (re)complete actions" tar
|
||||
((:url . "https://codeberg.com/ideasman42/emacs-recomplete")
|
||||
(:maintainer "Campbell Barton" . "ideasman42@gmail.com")
|
||||
(:authors
|
||||
("Campbell Barton" . "ideasman42@gmail.com"))
|
||||
(:commit . "2b38ca25e3392636fe936d3edad447970279a463"))])
|
||||
(request .
|
||||
[(0 3 3)
|
||||
((emacs
|
||||
|
@ -1275,7 +1466,7 @@
|
|||
("Bozhidar Batsov"))
|
||||
(:keywords "project" "convenience"))])
|
||||
(rust-mode .
|
||||
[(1 0 4)
|
||||
[(1 0 5)
|
||||
((emacs
|
||||
(25 1)))
|
||||
"A major-mode for editing Rust source code" tar
|
||||
|
@ -1284,7 +1475,7 @@
|
|||
(:maintainer "Mozilla")
|
||||
(:authors
|
||||
("Mozilla"))
|
||||
(:commit . "e35a1800fc0f9ed178539d6fb82ed885c1014fb5"))])
|
||||
(:commit . "7bff48894dc532caf4010be3060370d315ef75f6"))])
|
||||
(sass-mode .
|
||||
[(3 0 16)
|
||||
((haml-mode
|
||||
|
@ -1302,6 +1493,26 @@
|
|||
nil "Major mode for editing Scala" tar
|
||||
((:url . "https://github.com/hvesalai/emacs-scala-mode")
|
||||
(:keywords "languages"))])
|
||||
(scroll-on-drag .
|
||||
[(0 1)
|
||||
((emacs
|
||||
(26 2)))
|
||||
"Interactive scrolling" tar
|
||||
((:url . "https://codeberg.com/ideasman42/emacs-scroll-on-drag")
|
||||
(:maintainer "Campbell Barton" . "ideasman42@gmail.com")
|
||||
(:authors
|
||||
("Campbell Barton" . "ideasman42@gmail.com"))
|
||||
(:commit . "a668537a8da77e4425b6a4110bdaba598a295f9e"))])
|
||||
(scroll-on-jump .
|
||||
[(0 1)
|
||||
((emacs
|
||||
(26 2)))
|
||||
"Scroll when jumping to a new point" tar
|
||||
((:url . "https://codeberg.com/ideasman42/emacs-scroll-on-jump")
|
||||
(:maintainer "Campbell Barton" . "ideasman42@gmail.com")
|
||||
(:authors
|
||||
("Campbell Barton" . "ideasman42@gmail.com"))
|
||||
(:commit . "30e23e86949b1bd53906d3f9036dfb57213e336c"))])
|
||||
(sesman .
|
||||
[(0 3 2)
|
||||
((emacs
|
||||
|
@ -1313,7 +1524,7 @@
|
|||
(:authors
|
||||
("Vitalie Spinu")))])
|
||||
(shellcop .
|
||||
[(0 0 9)
|
||||
[(0 1 0)
|
||||
((emacs
|
||||
(25 1)))
|
||||
"Analyze info&error in shell-mode" tar
|
||||
|
@ -1322,7 +1533,7 @@
|
|||
(:maintainer "Chen Bin" . "chenbin.sh@gmail.com")
|
||||
(:authors
|
||||
("Chen Bin" . "chenbin.sh@gmail.com"))
|
||||
(:commit . "327f5ac43e5d543149a772aef06cdb616477eb43"))])
|
||||
(:commit . "4e71f5b9199a0ad10017104a6b2bf5ef5f207dfc"))])
|
||||
(slime .
|
||||
[(2 26 1)
|
||||
((cl-lib
|
||||
|
@ -1368,6 +1579,17 @@
|
|||
(:authors
|
||||
("Nasser Alshammari"))
|
||||
(:commit . "4857e6eb7ea20be3a2631beee42d0644dff7eb1b"))])
|
||||
(spell-fu .
|
||||
[(0 3)
|
||||
((emacs
|
||||
(26 2)))
|
||||
"Fast & light spelling highlighter" tar
|
||||
((:url . "https://codeberg.org/ideasman42/emacs-spell-fu")
|
||||
(:keywords "convenience")
|
||||
(:maintainer "Campbell Barton" . "ideasman42@gmail.com")
|
||||
(:authors
|
||||
("Campbell Barton" . "ideasman42@gmail.com"))
|
||||
(:commit . "ddad489f2c87467480520502a93e682f81bfac18"))])
|
||||
(stylus-mode .
|
||||
[(1 0 1)
|
||||
nil "Major mode for editing .styl files" tar
|
||||
|
@ -1387,7 +1609,7 @@
|
|||
("John Olsson" . "john@cryon.se"))
|
||||
(:commit . "2d5acd143a153e16372d59000e57d76291ab81dd"))])
|
||||
(subed .
|
||||
[(1 0 5)
|
||||
[(1 0 7)
|
||||
((emacs
|
||||
(25 1)))
|
||||
"A major mode for editing subtitles" tar
|
||||
|
@ -1396,9 +1618,9 @@
|
|||
(:maintainer "Sacha Chua" . "sacha@sachachua.com")
|
||||
(:authors
|
||||
("Random User"))
|
||||
(:commit . "7a0c36c808e107b5851ba48ec3825dfa3c1a902e"))])
|
||||
(:commit . "eefe94f308d7006a498b17fc9acf01790b793bcd"))])
|
||||
(swift-mode .
|
||||
[(8 4 2)
|
||||
[(8 6 0)
|
||||
((emacs
|
||||
(24 4))
|
||||
(seq
|
||||
|
@ -1411,7 +1633,32 @@
|
|||
("taku0 (http://github.com/taku0)")
|
||||
("Chris Barrett" . "chris.d.barrett@me.com")
|
||||
("Bozhidar Batsov" . "bozhidar@batsov.com")
|
||||
("Arthur Evstifeev" . "lod@pisem.net")))])
|
||||
("Arthur Evstifeev" . "lod@pisem.net"))
|
||||
(:commit . "cdd194cbadcee724a9813da386f0a612082b1ab1"))])
|
||||
(swsw .
|
||||
[(2 2)
|
||||
((emacs
|
||||
(27 1)))
|
||||
"Simple window switching" tar
|
||||
((:url . "https://dsemy.com/projects/swsw")
|
||||
(:keywords "convenience")
|
||||
(:maintainer "swsw Mailing List" . "~dsemy/swsw-devel@lists.sr.ht")
|
||||
(:authors
|
||||
("Daniel Semyonov" . "daniel@dsemy.com"))
|
||||
(:commit . "5faeffc16329a4a4946780c880c343a9fb95deb4"))])
|
||||
(symbol-overlay .
|
||||
[(4 1)
|
||||
((emacs
|
||||
(24 3))
|
||||
(seq
|
||||
(2 2)))
|
||||
"Highlight symbols with keymap-enabled overlays" tar
|
||||
((:url . "https://github.com/wolray/symbol-overlay/")
|
||||
(:keywords "faces" "matching")
|
||||
(:maintainer "wolray" . "wolray@foxmail.com")
|
||||
(:authors
|
||||
("wolray" . "wolray@foxmail.com"))
|
||||
(:commit . "d1464042783e252f5cac1fcac82fee16fc3534db"))])
|
||||
(systemd .
|
||||
[(1 6)
|
||||
((emacs
|
||||
|
@ -1505,24 +1752,58 @@
|
|||
(:maintainer "Mark Tran" . "mark.tran@gmail.com")
|
||||
(:authors
|
||||
("Mark Tran" . "mark.tran@gmail.com")))])
|
||||
(undo-fu .
|
||||
[(0 4)
|
||||
((emacs
|
||||
(25 1)))
|
||||
"Undo helper with redo" tar
|
||||
((:url . "https://codeberg.com/ideasman42/emacs-undo-fu")
|
||||
(:maintainer "Campbell Barton" . "ideasman42@gmail.com")
|
||||
(:authors
|
||||
("Campbell Barton" . "ideasman42@gmail.com"))
|
||||
(:commit . "46de023b5f8ddb989eeff7665feeec2877d8eda8"))])
|
||||
(undo-fu-session .
|
||||
[(0 2)
|
||||
((emacs
|
||||
(28 1)))
|
||||
"Persistent undo, available between sessions" tar
|
||||
((:url . "https://codeberg.com/ideasman42/emacs-undo-fu-session")
|
||||
(:keywords "convenience")
|
||||
(:maintainer "Campbell Barton" . "ideasman42@gmail.com")
|
||||
(:authors
|
||||
("Campbell Barton" . "ideasman42@gmail.com"))
|
||||
(:commit . "e2043f8350970e1a9ef06a94956a733826cdf32b"))])
|
||||
(vc-fossil .
|
||||
[(20210928)
|
||||
[(20220707)
|
||||
nil "VC backend for the fossil sofware configuraiton management system" tar
|
||||
((:maintainer "Alfred M. Szmidt" . "ams@gnu.org")
|
||||
(:authors
|
||||
("Venkat Iyer" . "venkat@comit.com"))
|
||||
(:url . "https://elpa.nongnu.org/nongnu/vc-fossil.html"))])
|
||||
(:url . "https://elpa.nongnu.org/nongnu/vc-fossil.html")
|
||||
(:commit . "8ce6113aa272583130e5f929fefd67115c8f572a"))])
|
||||
(vcomplete .
|
||||
[(1 2 1)
|
||||
((emacs
|
||||
(25 1)))
|
||||
"Visual completions" tar
|
||||
((:url . "https://dsemy.com/projects/vcomplete")
|
||||
(:keywords "convenience" "matching")
|
||||
(:maintainer "Vcomplete Mailing List" . "~dsemy/vcomplete-devel@lists.sr.ht")
|
||||
(:authors
|
||||
("Daniel Semyonov" . "daniel@dsemy.com"))
|
||||
(:commit . "8450b1befd46ac9754d57e2f98f150f33bb317ce"))])
|
||||
(visual-fill-column .
|
||||
[(2 4)
|
||||
[(2 5)
|
||||
((emacs
|
||||
(25 1)))
|
||||
"fill-column for visual-line-mode" tar
|
||||
((:url . "https://codeberg.org/joostkremers/visual-fill-column")
|
||||
(:maintainer "Joost Kremers" . "joostkremers@fastmail.fm")
|
||||
(:authors
|
||||
("Joost Kremers" . "joostkremers@fastmail.fm")))])
|
||||
("Joost Kremers" . "joostkremers@fastmail.fm"))
|
||||
(:commit . "afaad5ac6b15cdf9f362662538e35d48578e218a"))])
|
||||
(web-mode .
|
||||
[(17 2 0)
|
||||
[(17 2 3)
|
||||
((emacs
|
||||
(23 1)))
|
||||
"major mode for editing web templates" tar
|
||||
|
@ -1531,7 +1812,7 @@
|
|||
(:maintainer "François-Xavier Bois" . "fxbois@gmail.com")
|
||||
(:authors
|
||||
("François-Xavier Bois"))
|
||||
(:commit . "f70277774a725e177774cc81ecbd228792cd6656"))])
|
||||
(:commit . "7b5459f58c381f31eed257480b000a9a46209094"))])
|
||||
(webpaste .
|
||||
[(3 2 2)
|
||||
((emacs
|
||||
|
@ -1585,16 +1866,16 @@
|
|||
(:authors
|
||||
("Le Wang")))])
|
||||
(xah-fly-keys .
|
||||
[(17 5 20220416101054)
|
||||
[(17 17 20220709145456)
|
||||
((emacs
|
||||
(24 1)))
|
||||
"ergonomic modal keybinding minor mode." tar
|
||||
((:url . "http://xahlee.info/emacs/misc/ergoemacs_vi_mode.html")
|
||||
((:url . "http://xahlee.info/emacs/misc/xah-fly-keys.html")
|
||||
(:keywords "convenience" "emulations" "vim" "ergoemacs")
|
||||
(:maintainer "Xah Lee ( http://xahlee.info/ )")
|
||||
(:maintainer "Xah Lee" . "xah@xahlee.org")
|
||||
(:authors
|
||||
("Xah Lee ( http://xahlee.info/ )"))
|
||||
(:commit . "cb2b27ed7566b7863ad3e9adf67d75945d4118b0"))])
|
||||
(:commit . "2383b8b546fe6e1db4b86f4122055110ee4775f4"))])
|
||||
(xml-rpc .
|
||||
[(1 6 15)
|
||||
nil "An elisp implementation of clientside XML-RPC" tar
|
||||
|
|
|
@ -1 +1 @@
|
|||
Good signature from 066DAFCB81E42C40 GNU ELPA Signing Agent (2019) <elpasign@elpa.gnu.org> (trust undefined) created at 2022-04-17T05:05:05-0400 using RSA
|
||||
Good signature from 066DAFCB81E42C40 GNU ELPA Signing Agent (2019) <elpasign@elpa.gnu.org> (trust undefined) created at 2022-08-04T05:05:06-0400 using RSA
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
(require 'cl-lib)
|
||||
(require 'async)
|
||||
(require 'bytecomp)
|
||||
|
||||
(declare-function package-desc-name "package.el")
|
||||
(declare-function package-desc-dir "package.el")
|
|
@ -1,6 +1,6 @@
|
|||
(define-package "async" "20220318.1342" "Asynchronous processing in Emacs"
|
||||
(define-package "async" "20220630.57" "Asynchronous processing in Emacs"
|
||||
'((emacs "24.4"))
|
||||
:commit "c78bab7506a70a735d2c3deab13fa87bf44a83d3" :authors
|
||||
:commit "7f4ed1e8b44e0b88eadb2efeeaf97f32c38f14c4" :authors
|
||||
'(("John Wiegley" . "jwiegley@gmail.com"))
|
||||
:maintainer
|
||||
'("Thierry Volpiatto" . "thievol@posteo.net")
|
|
@ -1 +0,0 @@
|
|||
Good signature from 066DAFCB81E42C40 GNU ELPA Signing Agent (2019) <elpasign@elpa.gnu.org> (trust undefined) created at 2022-04-22T17:05:01-0400 using RSA
|
|
@ -1,2 +0,0 @@
|
|||
;; Generated package description from compat.el -*- no-byte-compile: t -*-
|
||||
(define-package "compat" "28.1.1.0" "Compatibility Library" '((emacs "24.3") (nadvice "0.3")) :commit "401df6defaf5ef470a2dc57664b2d258662a5c3d" :authors '(("Philip Kaludercic" . "philipk@posteo.net")) :maintainer '("Compat Development" . "~pkal/compat-devel@lists.sr.ht") :keywords '("lisp") :url "https://sr.ht/~pkal/compat")
|
|
@ -1,99 +0,0 @@
|
|||
;;; compat.el --- Compatibility Library -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2021, 2022 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Philip Kaludercic <philipk@posteo.net>
|
||||
;; Maintainer: Compat Development <~pkal/compat-devel@lists.sr.ht>
|
||||
;; Version: 28.1.1.0
|
||||
;; URL: https://sr.ht/~pkal/compat
|
||||
;; Package-Requires: ((emacs "24.3") (nadvice "0.3"))
|
||||
;; Keywords: 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; To allow for the usage of Emacs functions and macros that are
|
||||
;; defined in newer versions of Emacs, compat.el provides definitions
|
||||
;; that are installed ONLY if necessary. These reimplementations of
|
||||
;; functions and macros are at least subsets of the actual
|
||||
;; implementations. Be sure to read the documentation string to make
|
||||
;; sure.
|
||||
;;
|
||||
;; Not every function provided in newer versions of Emacs is provided
|
||||
;; here. Some depend on new features from the core, others cannot be
|
||||
;; implemented to a meaningful degree. The main audience for this
|
||||
;; library are not regular users, but package maintainers. Therefore
|
||||
;; commands and user options are usually not implemented here.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(eval-when-compile (require 'compat-macs))
|
||||
|
||||
;;;; Core functionality
|
||||
|
||||
;; To accelerate the loading process, we insert the contents of
|
||||
;; compat-N.M.el directly into the compat.elc. Note that by default
|
||||
;; this will not include prefix functions. These have to be required
|
||||
;; separately, by explicitly requiring the feature that defines them.
|
||||
(eval-when-compile
|
||||
(defvar compat--generate-function)
|
||||
(defmacro compat-entwine (version)
|
||||
(cond
|
||||
((or (not (eq compat--generate-function 'compat--generate-minimal))
|
||||
(bound-and-true-p compat-testing))
|
||||
`(load ,(format "compat-%d.el" version)))
|
||||
((let* ((compat--generate-function 'compat--generate-minimal-no-prefix)
|
||||
(file (expand-file-name
|
||||
(format "compat-%d.el" version)
|
||||
(file-name-directory
|
||||
(or (if (fboundp 'macroexp-file-name)
|
||||
(macroexp-file-name)
|
||||
(or (bound-and-true-p byte-compile-current-file)
|
||||
load-file-name))
|
||||
(buffer-file-name)))))
|
||||
defs)
|
||||
(with-temp-buffer
|
||||
(insert-file-contents file)
|
||||
(emacs-lisp-mode)
|
||||
(while (progn
|
||||
(forward-comment 1)
|
||||
(not (eobp)))
|
||||
;; We bind `byte-compile-current-file' before
|
||||
;; macro-expanding, so that `compat--generate-function'
|
||||
;; can correctly infer the compatibility version currently
|
||||
;; being processed.
|
||||
(let ((byte-compile-current-file file)
|
||||
(form (read (current-buffer))))
|
||||
(cond
|
||||
((memq (car-safe form)
|
||||
'(compat-defun
|
||||
compat-defmacro
|
||||
compat-advise
|
||||
compat-defvar))
|
||||
(push (macroexpand-all form) defs))
|
||||
((memq (car-safe form)
|
||||
'(declare-function
|
||||
defvar))
|
||||
(push form defs))))))
|
||||
(macroexp-progn (nreverse defs)))))))
|
||||
|
||||
(compat-entwine 24)
|
||||
(compat-entwine 25)
|
||||
(compat-entwine 26)
|
||||
(compat-entwine 27)
|
||||
(compat-entwine 28)
|
||||
|
||||
(provide 'compat)
|
||||
;;; compat.el ends here
|
1
code/elpa/compat-28.1.2.0.signed
Normal file
1
code/elpa/compat-28.1.2.0.signed
Normal file
|
@ -0,0 +1 @@
|
|||
Good signature from 066DAFCB81E42C40 GNU ELPA Signing Agent (2019) <elpasign@elpa.gnu.org> (trust undefined) created at 2022-07-18T05:05:02-0400 using RSA
|
|
@ -1,3 +1,51 @@
|
|||
#+options: toc:nil num:nil
|
||||
#+link: compat https://todo.sr.ht/~pkal/compat/
|
||||
|
||||
* Release of "Compat" Version 28.1.2.0
|
||||
|
||||
The main change of this release has been the major simplification of
|
||||
Compat's initialisation system, improving the situation around issues
|
||||
people had been reporting ([[compat:4]], once again) with unconventional
|
||||
or unpopular packaging systems.
|
||||
|
||||
In addition to this, the following functional changes have been made:
|
||||
|
||||
- Fix =format-prompt= of an empty string as "default" argument
|
||||
- Add =decoded-time-period= defined in Emacs 28
|
||||
- Add =subr-primitive-p= defined in Emacs 28
|
||||
|
||||
Minor improvements to manual are also part of this release.
|
||||
|
||||
(Release <2022-07-18 Mon>)
|
||||
|
||||
* Release of "Compat" Version 28.1.1.3
|
||||
|
||||
This release just contains a hot-fix for an issue introduced in the
|
||||
last version, where compat.el raises an error during byte compilation.
|
||||
See [[compat:4]].
|
||||
|
||||
(Release <2022-06-19 Sun>)
|
||||
|
||||
* Release of "Compat" Version 28.1.1.2
|
||||
|
||||
Two main changes have necessitated a new patch release:
|
||||
|
||||
1. Fix issues related to the loading of compat when uncompiled. See
|
||||
[[https://lists.sr.ht/~pkal/compat-devel/%3C20220530191000.2183047-1-jonas%40bernoul.li%3E][this thread]] for more details on the problem.
|
||||
2. Fix issues related to the loading of compat on old pre-releases
|
||||
(think of 28.0.50). See [[https://lists.sr.ht/~pkal/compat-devel/%3Cf8635d7d-e233-448f-b325-9e850363241c%40www.fastmail.com%3E][this thread]] for more details on the
|
||||
problem.
|
||||
|
||||
(Released <2022-06-22 Wed>)
|
||||
|
||||
* Release of "Compat" Version 28.1.1.1
|
||||
|
||||
This is a minor release fixing a bug in =json-serialize=, that could
|
||||
cause unintended side-effects, not related to packages using Compat
|
||||
directly (see [[compat:2]]).
|
||||
|
||||
(Released <2022-05-05 Thu>)
|
||||
|
||||
* Release of "Compat" Version 28.1.1.0
|
||||
|
||||
This release mostly fixes a number of smaller bugs that were not
|
|
@ -25,7 +25,15 @@
|
|||
;; Find here the functionality added in Emacs 24.4, needed by older
|
||||
;; versions.
|
||||
;;
|
||||
;; Do NOT load this library manually. Instead require `compat'.
|
||||
;; Only load this library if you need to use one of the following
|
||||
;; functions:
|
||||
;;
|
||||
;; - `compat-='
|
||||
;; - `compat-<'
|
||||
;; - `compat->'
|
||||
;; - `compat-<='
|
||||
;; - `compat->='
|
||||
;; - `split-string'.
|
||||
|
||||
;;; Code:
|
||||
|
||||
|
@ -512,5 +520,5 @@ function for defining FACE and recalculating its attributes."
|
|||
(dolist (frame (frame-list))
|
||||
(face-spec-recalc face frame)))
|
||||
|
||||
(provide 'compat-24)
|
||||
(compat--inhibit-prefixed (provide 'compat-24))
|
||||
;;; compat-24.el ends here
|
|
@ -25,7 +25,10 @@
|
|||
;; Find here the functionality added in Emacs 25.1, needed by older
|
||||
;; versions.
|
||||
;;
|
||||
;; Do NOT load this library manually. Instead require `compat'.
|
||||
;; Only load this library if you need to use one of the following
|
||||
;; functions:
|
||||
;;
|
||||
;; - `compat-sort'
|
||||
|
||||
;;; Code:
|
||||
|
||||
|
@ -313,5 +316,5 @@ recursion."
|
|||
(push (concat dir "/" file) files)))))
|
||||
(nconc result (nreverse files))))
|
||||
|
||||
(provide 'compat-25)
|
||||
(compat--inhibit-prefixed (provide 'compat-25))
|
||||
;;; compat-25.el ends here
|
|
@ -25,7 +25,15 @@
|
|||
;; Find here the functionality added in Emacs 26.1, needed by older
|
||||
;; versions.
|
||||
;;
|
||||
;; Do NOT load this library manually. Instead require `compat'.
|
||||
;; Only load this library if you need to use one of the following
|
||||
;; functions:
|
||||
;;
|
||||
;; - `compat-sort'
|
||||
;; - `line-number-at-pos'
|
||||
;; - `compat-alist-get'
|
||||
;; - `string-trim-left'
|
||||
;; - `string-trim-right'
|
||||
;; - `string-trim'
|
||||
|
||||
;;; Code:
|
||||
|
||||
|
@ -38,8 +46,8 @@
|
|||
"Return minimum and maximum number of args allowed for FUNC.
|
||||
FUNC must be a function of some kind.
|
||||
The returned value is a cons cell (MIN . MAX). MIN is the minimum number
|
||||
of args. MAX is the maximum number, or the symbol ‘many’, for a
|
||||
function with ‘&rest’ args, or ‘unevalled’ for a special form."
|
||||
of args. MAX is the maximum number, or the symbol `many', for a
|
||||
function with `&rest' args, or `unevalled' for a special form."
|
||||
:realname compat--func-arity
|
||||
(cond
|
||||
((or (null func) (and (symbolp func) (not (fboundp func))))
|
||||
|
@ -110,7 +118,7 @@ function with ‘&rest’ args, or ‘unevalled’ for a special form."
|
|||
(compat-defun assoc (key alist &optional testfn)
|
||||
"Handle the optional argument TESTFN.
|
||||
Equality is defined by the function TESTFN, defaulting to
|
||||
‘equal’. TESTFN is called with 2 arguments: a car of an alist
|
||||
`equal'. TESTFN is called with 2 arguments: a car of an alist
|
||||
element and KEY. With no optional argument, the function behaves
|
||||
just like `assoc'."
|
||||
:prefix t
|
||||
|
@ -619,5 +627,5 @@ If VALUE is nil, PROPERTY is removed from IMAGE."
|
|||
(cdr ,image*)
|
||||
,property* ,value*)))))))
|
||||
|
||||
(provide 'compat-26)
|
||||
(compat--inhibit-prefixed (provide 'compat-26))
|
||||
;;; compat-26.el ends here
|
|
@ -25,7 +25,17 @@
|
|||
;; Find here the functionality added in Emacs 27.1, needed by older
|
||||
;; versions.
|
||||
;;
|
||||
;; Do NOT load this library manually. Instead require `compat'.
|
||||
;; Only load this library if you need to use one of the following
|
||||
;; functions or macros:
|
||||
;;
|
||||
;; - `compat-recenter'
|
||||
;; - `compat-lookup-key'
|
||||
;; - `compat-setq-local'
|
||||
;; - `compat-assoc-delete-all'
|
||||
;; - `compat-file-size-human-readable'
|
||||
;; - `compat-executable-find'
|
||||
;; - `compat-regexp-opt'
|
||||
;; - `compat-dired-get-marked-files'
|
||||
|
||||
;;; Code:
|
||||
|
||||
|
@ -125,14 +135,18 @@ Letter-case is significant, but text properties are ignored."
|
|||
;;;; Defined in json.c
|
||||
|
||||
(declare-function json-parse-string nil (string &rest args))
|
||||
(declare-function json-encode-string "json" (object))
|
||||
(declare-function json-encode "json" (object))
|
||||
(declare-function json-read-from-string "json" (string))
|
||||
(declare-function json-read "json" ())
|
||||
(defvar json-encoding-pretty-print)
|
||||
(defvar json-object-type)
|
||||
(defvar json-array-type)
|
||||
(defvar json-false)
|
||||
(defvar json-null)
|
||||
|
||||
;; The function is declared to satisfy the byte compiler while testing
|
||||
;; if native JSON parsing is available.;
|
||||
(declare-function json-serialize nil (object &rest args))
|
||||
(compat-defun json-serialize (object &rest args)
|
||||
"Return the JSON representation of OBJECT as a string.
|
||||
|
||||
|
@ -158,27 +172,72 @@ represent a JSON false value. It defaults to `:false'.
|
|||
In you specify the same value for `:null-object' and `:false-object',
|
||||
a potentially ambiguous situation, the JSON output will not contain
|
||||
any JSON false values."
|
||||
:cond (condition-case nil
|
||||
(let ((inhibit-message t))
|
||||
(equal (json-parse-string "[]") nil))
|
||||
(json-unavailable t)
|
||||
(void-function t))
|
||||
:cond (not (condition-case nil
|
||||
(equal (json-serialize '()) "{}")
|
||||
(:success t)
|
||||
(void-function nil)
|
||||
(json-unavailable nil)))
|
||||
:realname compat--json-serialize
|
||||
(require 'json)
|
||||
(let ((json-false (or (plist-get args :false-object) :false))
|
||||
(letrec ((fix (lambda (obj)
|
||||
(cond
|
||||
((hash-table-p obj)
|
||||
(let ((ht (copy-hash-table obj)))
|
||||
(maphash
|
||||
(lambda (key val)
|
||||
(unless (stringp key)
|
||||
(signal
|
||||
'wrong-type-argument
|
||||
(list 'stringp key)))
|
||||
(puthash key (funcall fix val) ht))
|
||||
obj)
|
||||
ht))
|
||||
((and (listp obj) (consp (car obj))) ;alist
|
||||
(mapcar
|
||||
(lambda (ent)
|
||||
(cons (symbol-name (car ent))
|
||||
(funcall fix (cdr ent))))
|
||||
obj))
|
||||
((listp obj) ;plist
|
||||
(let (alist)
|
||||
(while obj
|
||||
(push (cons (cond
|
||||
((keywordp (car obj))
|
||||
(substring
|
||||
(symbol-name (car obj))
|
||||
1))
|
||||
((symbolp (car obj))
|
||||
(symbol-name (car obj)))
|
||||
((signal
|
||||
'wrong-type-argument
|
||||
(list 'symbolp (car obj)))))
|
||||
(funcall fix (cadr obj)))
|
||||
alist)
|
||||
(unless (consp (cdr obj))
|
||||
(signal 'wrong-type-argument '(consp nil)))
|
||||
(setq obj (cddr obj)))
|
||||
(nreverse alist)))
|
||||
((vectorp obj)
|
||||
(let ((vec (make-vector (length obj) nil)))
|
||||
(dotimes (i (length obj))
|
||||
(aset vec i (funcall fix (aref obj i))))
|
||||
vec))
|
||||
(obj))))
|
||||
(json-encoding-pretty-print nil)
|
||||
(json-false (or (plist-get args :false-object) :false))
|
||||
(json-null (or (plist-get args :null-object) :null)))
|
||||
(json-encode-string object)))
|
||||
(json-encode (funcall fix object))))
|
||||
|
||||
(compat-defun json-insert (object &rest args)
|
||||
"Insert the JSON representation of OBJECT before point.
|
||||
This is the same as (insert (json-serialize OBJECT)), but potentially
|
||||
faster. See the function `json-serialize' for allowed values of
|
||||
OBJECT."
|
||||
:cond (condition-case nil
|
||||
(let ((inhibit-message t))
|
||||
(equal (json-parse-string "[]") nil))
|
||||
(json-unavailable t)
|
||||
(void-function t))
|
||||
:cond (not (condition-case nil
|
||||
(equal (json-serialize '()) "{}")
|
||||
(:success t)
|
||||
(void-function nil)
|
||||
(json-unavailable nil)))
|
||||
(insert (apply #'compat--json-serialize object args)))
|
||||
|
||||
(compat-defun json-parse-string (string &rest args)
|
||||
|
@ -205,11 +264,11 @@ to represent a JSON null value. It defaults to `:null'.
|
|||
|
||||
The keyword argument `:false-object' specifies which object to use to
|
||||
represent a JSON false value. It defaults to `:false'."
|
||||
:cond (condition-case nil
|
||||
(let ((inhibit-message t))
|
||||
(equal (json-parse-string "[]") nil))
|
||||
(json-unavailable t)
|
||||
(void-function t))
|
||||
:cond (not (condition-case nil
|
||||
(equal (json-serialize '()) "{}")
|
||||
(:success t)
|
||||
(void-function nil)
|
||||
(json-unavailable nil)))
|
||||
(require 'json)
|
||||
(condition-case err
|
||||
(let ((json-object-type (or (plist-get args :object-type) 'hash-table))
|
||||
|
@ -249,11 +308,11 @@ to represent a JSON null value. It defaults to `:null'.
|
|||
|
||||
The keyword argument `:false-object' specifies which object to use to
|
||||
represent a JSON false value. It defaults to `:false'."
|
||||
:cond (condition-case nil
|
||||
(let ((inhibit-message t))
|
||||
(equal (json-parse-string "[]") nil))
|
||||
(json-unavailable t)
|
||||
(void-function t))
|
||||
:cond (not (condition-case nil
|
||||
(equal (json-serialize '()) "{}")
|
||||
(:success t)
|
||||
(void-function nil)
|
||||
(json-unavailable nil)))
|
||||
(require 'json)
|
||||
(condition-case err
|
||||
(let ((json-object-type (or (plist-get args :object-type) 'hash-table))
|
||||
|
@ -638,5 +697,5 @@ The return value is a string (or nil in case we can’t find it)."
|
|||
31
|
||||
30)))
|
||||
|
||||
(provide 'compat-27)
|
||||
(compat--inhibit-prefixed (provide 'compat-27))
|
||||
;;; compat-27.el ends here
|
|
@ -25,7 +25,17 @@
|
|||
;; Find here the functionality added in Emacs 28.1, needed by older
|
||||
;; versions.
|
||||
;;
|
||||
;; Do NOT load this library manually. Instead require `compat'.
|
||||
;; Only load this library if you need to use one of the following
|
||||
;; functions:
|
||||
;;
|
||||
;; - `unlock-buffer'
|
||||
;; - `string-width'
|
||||
;; - `directory-files'
|
||||
;; - `json-serialize'
|
||||
;; - `json-insert'
|
||||
;; - `json-parse-string'
|
||||
;; - `json-parse-buffer'
|
||||
;; - `count-windows'
|
||||
|
||||
;;; Code:
|
||||
|
||||
|
@ -145,7 +155,12 @@ continuing as if the error did not occur."
|
|||
Optional arguments FROM and TO specify the substring of STRING to
|
||||
consider, and are interpreted as in `substring'."
|
||||
:prefix t
|
||||
(string-width (substring string (or from 0) to)))
|
||||
(let* ((len (length string))
|
||||
(from (or from 0))
|
||||
(to (or to len)))
|
||||
(if (and (= from 0) (= to len))
|
||||
(string-width string)
|
||||
(string-width (substring string from to)))))
|
||||
|
||||
;;;; Defined in dired.c
|
||||
|
||||
|
@ -182,7 +197,12 @@ If COUNT is non-nil and a natural number, the function will
|
|||
:min-version "27"
|
||||
(if (or (listp object) (vectorp object))
|
||||
(apply #'json-insert object args)
|
||||
(insert (apply #'compat-json-serialize object args))))
|
||||
;; `compat-json-serialize' is not sharp-quoted as the byte
|
||||
;; compiled doesn't always know that the function has been
|
||||
;; defined, but it will only be used in this function if the
|
||||
;; prefixed definition of `json-serialize' (see above) has also
|
||||
;; been defined.
|
||||
(insert (apply 'compat-json-serialize object args))))
|
||||
|
||||
(compat-defun json-parse-string (string &rest args)
|
||||
"Handle top-level JSON values."
|
||||
|
@ -427,6 +447,10 @@ not a list, return a one-element list containing OBJECT."
|
|||
object
|
||||
(list object)))
|
||||
|
||||
(compat-defun subr-primitive-p (object)
|
||||
"Return t if OBJECT is a built-in primitive function."
|
||||
(subrp object))
|
||||
|
||||
;;;; Defined in subr-x.el
|
||||
|
||||
(compat-defun string-clean-whitespace (string)
|
||||
|
@ -717,7 +741,7 @@ is included in the return value."
|
|||
(apply #'format prompt format-args))
|
||||
(and default
|
||||
(or (not (stringp default))
|
||||
(not (null default)))
|
||||
(> (length default) 0))
|
||||
(format " (default %s)"
|
||||
(if (consp default)
|
||||
(car default)
|
||||
|
@ -831,5 +855,25 @@ directory or directories specified."
|
|||
(apply 'update-directory-autoloads
|
||||
(if (listp dir) dir (list dir)))))
|
||||
|
||||
(provide 'compat-28)
|
||||
;;;; Defined in time-data.el
|
||||
|
||||
(compat-defun decoded-time-period (time)
|
||||
"Interpret DECODED as a period and return its length in seconds.
|
||||
For computational purposes, years are 365 days long and months
|
||||
are 30 days long."
|
||||
:feature 'time-date
|
||||
:version "28"
|
||||
;; Inlining the definitions from compat-27
|
||||
(+ (if (consp (nth 0 time))
|
||||
;; Fractional second.
|
||||
(/ (float (car (nth 0 time)))
|
||||
(cdr (nth 0 time)))
|
||||
(or (nth 0 time) 0))
|
||||
(* (or (nth 1 time) 0) 60)
|
||||
(* (or (nth 2 time) 0) 60 60)
|
||||
(* (or (nth 3 time) 0) 60 60 24)
|
||||
(* (or (nth 4 time) 0) 60 60 24 30)
|
||||
(* (or (nth 5 time) 0) 60 60 24 365)))
|
||||
|
||||
(compat--inhibit-prefixed (provide 'compat-28))
|
||||
;;; compat-28.el ends here
|
|
@ -29,6 +29,17 @@
|
|||
"Ignore all arguments."
|
||||
nil)
|
||||
|
||||
(defvar compat--inhibit-prefixed nil
|
||||
"Non-nil means that prefixed definitions are not loaded.
|
||||
A prefixed function is something like `compat-assoc', that is
|
||||
only made visible when the respective compatibility version file
|
||||
is loaded (in this case `compat-26').")
|
||||
|
||||
(defmacro compat--inhibit-prefixed (&rest body)
|
||||
"Ignore BODY unless `compat--inhibit-prefixed' is true."
|
||||
`(unless (bound-and-true-p compat--inhibit-prefixed)
|
||||
,@body))
|
||||
|
||||
(defvar compat--generate-function #'compat--generate-minimal
|
||||
"Function used to generate compatibility code.
|
||||
The function must take six arguments: NAME, DEF-FN, INSTALL-FN,
|
||||
|
@ -82,19 +93,23 @@ DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE."
|
|||
(max-version (plist-get attr :max-version))
|
||||
(feature (plist-get attr :feature))
|
||||
(cond (plist-get attr :cond))
|
||||
(version (or (plist-get attr :version)
|
||||
(let ((file (or (bound-and-true-p byte-compile-current-file)
|
||||
load-file-name
|
||||
(buffer-file-name))))
|
||||
;; Guess the version from the file the macro is
|
||||
;; being defined in.
|
||||
(cond
|
||||
((not file) emacs-version)
|
||||
((string-match
|
||||
"compat-\\([[:digit:]]+\\)\\.\\(?:elc?\\)\\'"
|
||||
file)
|
||||
(match-string 1 file))
|
||||
((error "No version number could be extracted"))))))
|
||||
(version ; If you edit this, also edit `compat--generate-verbose'.
|
||||
(or (plist-get attr :version)
|
||||
(let* ((file (car (last current-load-list)))
|
||||
(file (if (stringp file)
|
||||
;; Some library, which requires compat-XY.el,
|
||||
;; is being compiled and compat-XY.el has not
|
||||
;; been compiled yet.
|
||||
file
|
||||
;; compat-XY.el is being compiled.
|
||||
(or (bound-and-true-p byte-compile-current-file)
|
||||
;; Fallback to the buffer being evaluated.
|
||||
(buffer-file-name)))))
|
||||
(if (and file
|
||||
(string-match
|
||||
"compat-\\([[:digit:]]+\\)\\.\\(?:elc?\\)\\'" file))
|
||||
(concat (match-string 1 file) ".1")
|
||||
(error "BUG: No version number could be extracted")))))
|
||||
(realname (or (plist-get attr :realname)
|
||||
(intern (format "compat--%S" name))))
|
||||
(check (cond
|
||||
|
@ -104,7 +119,7 @@ DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE."
|
|||
(version< max-version emacs-version)))
|
||||
'(compat--ignore))
|
||||
((plist-get attr :prefix)
|
||||
'(progn))
|
||||
'(compat--inhibit-prefixed))
|
||||
((and version (version<= version emacs-version) (not cond))
|
||||
'(compat--ignore))
|
||||
(`(when (and ,(if cond cond t)
|
||||
|
@ -140,13 +155,6 @@ DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE."
|
|||
`(eval-after-load ,feature `(funcall ',(lambda () ,body)))
|
||||
body))))))
|
||||
|
||||
(defun compat--generate-minimal-no-prefix (name def-fn install-fn check-fn attr type)
|
||||
"Generate a leaner compatibility definition.
|
||||
See `compat-generate-function' for details on the arguments NAME,
|
||||
DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE."
|
||||
(unless (plist-get attr :prefix)
|
||||
(compat--generate-minimal name def-fn install-fn check-fn attr type)))
|
||||
|
||||
(defun compat--generate-verbose (name def-fn install-fn check-fn attr type)
|
||||
"Generate a more verbose compatibility definition, fit for testing.
|
||||
See `compat-generate-function' for details on the arguments NAME,
|
||||
|
@ -155,19 +163,18 @@ DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE."
|
|||
(max-version (plist-get attr :max-version))
|
||||
(feature (plist-get attr :feature))
|
||||
(cond (plist-get attr :cond))
|
||||
(version (or (plist-get attr :version)
|
||||
(let ((file (or (bound-and-true-p byte-compile-current-file)
|
||||
load-file-name
|
||||
(buffer-file-name))))
|
||||
;; Guess the version from the file the macro is
|
||||
;; being defined in.
|
||||
(cond
|
||||
((not file) emacs-version)
|
||||
((string-match
|
||||
"compat-\\([[:digit:]]+\\)\\.\\(?:elc?\\)\\'"
|
||||
file)
|
||||
(match-string 1 file))
|
||||
((error "No version number could be extracted"))))))
|
||||
(version ; If you edit this, also edit `compat--generate-minimal'.
|
||||
(or (plist-get attr :version)
|
||||
(let* ((file (car (last current-load-list)))
|
||||
(file (if (stringp file)
|
||||
file
|
||||
(or (bound-and-true-p byte-compile-current-file)
|
||||
(buffer-file-name)))))
|
||||
(if (and file
|
||||
(string-match
|
||||
"compat-\\([[:digit:]]+\\)\\.\\(?:elc?\\)\\'" file))
|
||||
(concat (match-string 1 file) ".1")
|
||||
(error "BUG: No version number could be extracted")))))
|
||||
(realname (or (plist-get attr :realname)
|
||||
(intern (format "compat--%S" name))))
|
||||
(body `(progn
|
||||
|
@ -191,7 +198,7 @@ DEF-FN, INSTALL-FN, CHECK-FN, ATTR and TYPE."
|
|||
(version< max-version emacs-version)))
|
||||
'(compat--ignore))
|
||||
((plist-get attr :prefix)
|
||||
'(progn))
|
||||
'(compat--inhibit-prefixed))
|
||||
((and version (version<= version emacs-version) (not cond))
|
||||
'(compat--ignore))
|
||||
(`(when (and ,(if cond cond t)
|
2
code/elpa/compat-28.1.2.0/compat-pkg.el
Normal file
2
code/elpa/compat-28.1.2.0/compat-pkg.el
Normal file
|
@ -0,0 +1,2 @@
|
|||
;; Generated package description from compat.el -*- no-byte-compile: t -*-
|
||||
(define-package "compat" "28.1.2.0" "Emacs Lisp Compatibility Library" '((emacs "24.3") (nadvice "0.3")) :commit "6b70229adf1ad7c2227789061dd1b2fc00d36ad8" :authors '(("Philip Kaludercic" . "philipk@posteo.net")) :maintainer '("Compat Development" . "~pkal/compat-devel@lists.sr.ht") :keywords '("lisp") :url "https://sr.ht/~pkal/compat")
|
65
code/elpa/compat-28.1.2.0/compat.el
Normal file
65
code/elpa/compat-28.1.2.0/compat.el
Normal file
|
@ -0,0 +1,65 @@
|
|||
;;; compat.el --- Emacs Lisp Compatibility Library -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2021, 2022 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Philip Kaludercic <philipk@posteo.net>
|
||||
;; Maintainer: Compat Development <~pkal/compat-devel@lists.sr.ht>
|
||||
;; Version: 28.1.2.0
|
||||
;; URL: https://sr.ht/~pkal/compat
|
||||
;; Package-Requires: ((emacs "24.3") (nadvice "0.3"))
|
||||
;; Keywords: 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 <https://www.gnu.org/licenses/>.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; To allow for the usage of Emacs functions and macros that are
|
||||
;; defined in newer versions of Emacs, compat.el provides definitions
|
||||
;; that are installed ONLY if necessary. These reimplementations of
|
||||
;; functions and macros are at least subsets of the actual
|
||||
;; implementations. Be sure to read the documentation string to make
|
||||
;; sure.
|
||||
;;
|
||||
;; Not every function provided in newer versions of Emacs is provided
|
||||
;; here. Some depend on new features from the core, others cannot be
|
||||
;; implemented to a meaningful degree. The main audience for this
|
||||
;; library are not regular users, but package maintainers. Therefore
|
||||
;; commands and user options are usually not implemented here.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(eval-when-compile (require 'compat-macs))
|
||||
|
||||
;; We load all the components of Compat with a copied value of
|
||||
;; `features' list, that will prevent the list being modified, and all
|
||||
;; the files can be loaded again. This is done so that
|
||||
;; `compat--inhibit-prefixed' can take effect when loading `compat',
|
||||
;; and do nothing when loading each sub-feature manually.
|
||||
|
||||
(defvar compat--inhibit-prefixed)
|
||||
(let ((compat--inhibit-prefixed (not (bound-and-true-p compat-testing))))
|
||||
;; Instead of using `require', we manually check `features' and call
|
||||
;; `load' to avoid the issue of not using `provide' at the end of
|
||||
;; the file (which is disabled by `compat--inhibit-prefixed', so
|
||||
;; that the file can be loaded again at some later point when the
|
||||
;; prefixed definitions are needed).
|
||||
(dolist (vers '(24 25 26 27 28))
|
||||
(unless (memq (intern (format "compat-%d" vers)) features)
|
||||
(load (format "compat-%d%s" vers
|
||||
(if (bound-and-true-p compat-testing)
|
||||
".el" ""))
|
||||
nil t))))
|
||||
|
||||
(provide 'compat)
|
||||
;;; compat.el ends here
|
|
@ -26,7 +26,7 @@ File: compat.info, Node: Top, Next: Introduction, Up: (dir)
|
|||
|
||||
This manual documents the usage of the "Compat" Emacs lisp library, the
|
||||
forward-compatibility library for Emacs Lisp, corresponding to version
|
||||
28.1.1.0.
|
||||
28.1.2.0.
|
||||
|
||||
Copyright © 2022 Free Software Foundation, Inc.
|
||||
|
||||
|
@ -120,7 +120,7 @@ File: compat.info, Node: Usage, Next: Intentions, Prev: Overview, Up: Introd
|
|||
The intended use-case for this library is for package developers to add
|
||||
as a dependency in the header:
|
||||
|
||||
;; Package-Requires: ((emacs "24.3") (compat "28.1.1.0"))
|
||||
;; Package-Requires: ((emacs "24.3") (compat "28.1.2.0"))
|
||||
|
||||
and later on a
|
||||
|
||||
|
@ -825,6 +825,12 @@ by Compat by default:
|
|||
-- Function: null-device
|
||||
Defined in ‘files.el’.
|
||||
|
||||
-- Function: decoded-time-period
|
||||
Defined in ‘time-data.el’.
|
||||
|
||||
-- Function: subr-primitive-p
|
||||
Defined in ‘subr.el’.
|
||||
|
||||
These functions are prefixed with ‘compat’ prefix, and are only
|
||||
loaded when ‘compat-28’ is required:
|
||||
|
||||
|
@ -951,14 +957,14 @@ Appendix A Function Index
|
|||
* compat-alist-get: Emacs 26.1. (line 111)
|
||||
* compat-assoc: Emacs 26.1. (line 101)
|
||||
* compat-assoc-delete-all: Emacs 27.1. (line 115)
|
||||
* compat-count-windows: Emacs 28.1. (line 150)
|
||||
* compat-count-windows: Emacs 28.1. (line 156)
|
||||
* compat-dired-get-marked-files: Emacs 27.1. (line 125)
|
||||
* compat-executable-find: Emacs 27.1. (line 120)
|
||||
* compat-file-size-human-readable: Emacs 27.1. (line 110)
|
||||
* compat-json-insert: Emacs 28.1. (line 135)
|
||||
* compat-json-parse-buffer: Emacs 28.1. (line 145)
|
||||
* compat-json-parse-string: Emacs 28.1. (line 140)
|
||||
* compat-json-serialize: Emacs 28.1. (line 130)
|
||||
* compat-json-insert: Emacs 28.1. (line 141)
|
||||
* compat-json-parse-buffer: Emacs 28.1. (line 151)
|
||||
* compat-json-parse-string: Emacs 28.1. (line 146)
|
||||
* compat-json-serialize: Emacs 28.1. (line 136)
|
||||
* compat-line-number-at-pos: Emacs 26.1. (line 106)
|
||||
* compat-lookup-key: Emacs 27.1. (line 93)
|
||||
* compat-recenter: Emacs 27.1. (line 88)
|
||||
|
@ -969,8 +975,8 @@ Appendix A Function Index
|
|||
* compat-string-trim: Emacs 26.1. (line 127)
|
||||
* compat-string-trim-left: Emacs 26.1. (line 117)
|
||||
* compat-string-trim-right: Emacs 26.1. (line 122)
|
||||
* compat-string-width: Emacs 28.1. (line 124)
|
||||
* compat-unlock-buffer: Emacs 28.1. (line 119)
|
||||
* compat-string-width: Emacs 28.1. (line 130)
|
||||
* compat-unlock-buffer: Emacs 28.1. (line 125)
|
||||
* completion-table-merge: Emacs 24.4. (line 48)
|
||||
* completion-table-with-cache: Emacs 24.4. (line 51)
|
||||
* cXXXr: Emacs 26.1. (line 15)
|
||||
|
@ -981,6 +987,7 @@ Appendix A Function Index
|
|||
* decoded-time-hour: Emacs 27.1. (line 50)
|
||||
* decoded-time-minute: Emacs 27.1. (line 47)
|
||||
* decoded-time-month: Emacs 27.1. (line 56)
|
||||
* decoded-time-period: Emacs 28.1. (line 116)
|
||||
* decoded-time-second: Emacs 27.1. (line 44)
|
||||
* decoded-time-weekday: Emacs 27.1. (line 62)
|
||||
* decoded-time-year: Emacs 27.1. (line 59)
|
||||
|
@ -1056,6 +1063,7 @@ Appendix A Function Index
|
|||
* string-replace: Emacs 28.1. (line 27)
|
||||
* string-search: Emacs 28.1. (line 9)
|
||||
* string-suffix-p: Emacs 24.4. (line 18)
|
||||
* subr-primitive-p: Emacs 28.1. (line 119)
|
||||
* temporary-file-directory: Emacs 26.1. (line 31)
|
||||
* thing-at-mouse: Emacs 28.1. (line 86)
|
||||
* thread-first: Emacs 25.1. (line 30)
|
||||
|
@ -1098,9 +1106,9 @@ Node: Emacs 25.110565
|
|||
Node: Emacs 26.113160
|
||||
Node: Emacs 27.118253
|
||||
Node: Emacs 28.122838
|
||||
Node: Development28727
|
||||
Node: Function Index29742
|
||||
Node: Variable Index40061
|
||||
Node: Development28861
|
||||
Node: Function Index29876
|
||||
Node: Variable Index40341
|
||||
|
||||
End Tag Table
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
(define-package "dash" "20220417.2250" "A modern list library for Emacs"
|
||||
(define-package "dash" "20220608.1931" "A modern list library for Emacs"
|
||||
'((emacs "24"))
|
||||
:commit "7fd71338dce041b352f84e7939f6966f4d379459" :authors
|
||||
:commit "0ac1ecf6b56eb67bb81a3cf70f8d4354b5782341" :authors
|
||||
'(("Magnar Sveen" . "magnars@gmail.com"))
|
||||
:maintainer
|
||||
'("Magnar Sveen" . "magnars@gmail.com")
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
@ -1,6 +1,6 @@
|
|||
(define-package "dashboard" "20220409.620" "A startup screen extracted from Spacemacs"
|
||||
(define-package "dashboard" "20220717.905" "A startup screen extracted from Spacemacs"
|
||||
'((emacs "26.1"))
|
||||
:commit "09290bf700cc269ad3c07d9518cd758b90971fcd" :authors
|
||||
:commit "36c8da41bca977707c42bd9b13cdf39380b957d7" :authors
|
||||
'(("Rakan Al-Hneiti" . "rakan.alhneiti@gmail.com"))
|
||||
:maintainer
|
||||
'("Jesús Martínez" . "jesusmartinez93@gmail.com")
|
|
@ -475,7 +475,7 @@ If MESSAGEBUF is not nil then MSG is also written in message buffer."
|
|||
(defun dashboard-center-line (string)
|
||||
"Center a STRING accoring to it's size."
|
||||
(insert (make-string (max 0 (floor (/ (- dashboard-banner-length
|
||||
(+ (length string) 1)) 2))) ?\ )))
|
||||
(+ (string-width string) 1)) 2))) ?\ )))
|
||||
|
||||
;;
|
||||
;; BANNER
|
||||
|
@ -873,8 +873,7 @@ to widget creation."
|
|||
(defun dashboard-insert-recents (list-size)
|
||||
"Add the list of LIST-SIZE items from recently edited files."
|
||||
(setq dashboard--recentf-cache-item-format nil)
|
||||
(recentf-mode)
|
||||
(dashboard-mute-apply (recentf-cleanup))
|
||||
(dashboard-mute-apply (recentf-mode 1) (recentf-cleanup))
|
||||
(dashboard-insert-section
|
||||
"Recent Files:"
|
||||
(dashboard-shorten-paths recentf-list 'dashboard-recentf-alist 'recents)
|
|
@ -32,6 +32,7 @@
|
|||
(declare-function dashboard-ls--dirs "ext:dashboard-ls.el")
|
||||
(declare-function dashboard-ls--files "ext:dashboard-ls.el")
|
||||
(declare-function page-break-lines-mode "ext:page-break-lines.el")
|
||||
(declare-function projectile-remove-known-project "ext:projectile.el")
|
||||
(declare-function project-forget-projects-under "ext:project.el")
|
||||
|
||||
(defgroup dashboard nil
|
||||
|
@ -312,7 +313,7 @@ Optional argument ARGS adviced function arguments."
|
|||
(let ((path (save-excursion (end-of-line) (ffap-guesser))))
|
||||
(dashboard-mute-apply
|
||||
(cl-case dashboard-projects-backend
|
||||
(`projectile ) ; TODO: ..
|
||||
(`projectile (projectile-remove-known-project path))
|
||||
(`project-el (project-forget-projects-under path))))))
|
||||
|
||||
(defun dashboard-remove-item-bookmarks ()
|
||||
|
@ -381,21 +382,14 @@ Optional argument ARGS adviced function arguments."
|
|||
(defun dashboard-insert-startupify-lists ()
|
||||
"Insert the list of widgets into the buffer."
|
||||
(interactive)
|
||||
(let ((buffer-exists (buffer-live-p (get-buffer dashboard-buffer-name)))
|
||||
(recentf-is-on (recentf-enabled-p))
|
||||
(let ((recentf-is-on (recentf-enabled-p))
|
||||
(origial-recentf-list recentf-list)
|
||||
(dashboard-num-recents (or (cdr (assoc 'recents dashboard-items)) 0))
|
||||
(max-line-length 0))
|
||||
;; disable recentf mode, so we don't flood the recent files list with org
|
||||
;; mode files do this by making a copy of the part of the list we'll use
|
||||
;; let dashboard widgets change that then restore the orginal list afterwards
|
||||
;; (this avoids many saves/loads that would result from disabling/enabling
|
||||
;; recentf-mode)
|
||||
(when recentf-is-on
|
||||
(setq recentf-list (dashboard-subseq recentf-list dashboard-num-recents)))
|
||||
(when (or dashboard-force-refresh
|
||||
(not (eq dashboard-buffer-last-width (window-width)))
|
||||
(not buffer-exists))
|
||||
(not (eq dashboard-buffer-last-width (window-width))))
|
||||
(setq dashboard-banner-length (window-width)
|
||||
dashboard-buffer-last-width dashboard-banner-length)
|
||||
(with-current-buffer (get-buffer-create dashboard-buffer-name)
|
||||
|
@ -435,7 +429,8 @@ Optional argument ARGS adviced function arguments."
|
|||
|
||||
(add-hook 'window-setup-hook
|
||||
(lambda ()
|
||||
(add-hook 'window-size-change-functions 'dashboard-resize-on-hook)
|
||||
;; 100 means `dashboard-resize-on-hook' will run last
|
||||
(add-hook 'window-size-change-functions 'dashboard-resize-on-hook 100)
|
||||
(dashboard-resize-on-hook)))
|
||||
|
||||
(defun dashboard-refresh-buffer (&rest _)
|
|
@ -1,2 +0,0 @@
|
|||
;;; Generated package description from dired-single.el -*- no-byte-compile: t -*-
|
||||
(define-package "dired-single" "20211101.2319" "Reuse the current dired buffer to visit a directory" 'nil :commit "b254f9b7bfc96a5eab5760a56811f2872d2c590a" :keywords '("dired" "reuse" "buffer") :url "https://github.com/crocket/dired-single")
|
2
code/elpa/dired-single-20220726.137/dired-single-pkg.el
Normal file
2
code/elpa/dired-single-20220726.137/dired-single-pkg.el
Normal file
|
@ -0,0 +1,2 @@
|
|||
;;; Generated package description from dired-single.el -*- no-byte-compile: t -*-
|
||||
(define-package "dired-single" "20220726.137" "Reuse the current dired buffer to visit a directory" 'nil :commit "48532d747f0098280050721b5d016ec59c97c77c" :keywords '("dired" "reuse" "buffer") :url "https://github.com/crocket/dired-single")
|
|
@ -1,8 +1,8 @@
|
|||
;;; dired-single.el --- Reuse the current dired buffer to visit a directory
|
||||
|
||||
;; Version: 0.3.0
|
||||
;; Package-Version: 20211101.2319
|
||||
;; Package-Commit: b254f9b7bfc96a5eab5760a56811f2872d2c590a
|
||||
;; Package-Version: 20220726.137
|
||||
;; Package-Commit: 48532d747f0098280050721b5d016ec59c97c77c
|
||||
;; Keywords: dired, reuse, buffer
|
||||
;; URL: https://github.com/crocket/dired-single
|
||||
;; License: public-domain
|
||||
|
@ -15,6 +15,7 @@
|
|||
(eval-and-compile
|
||||
(require 'cl-lib)
|
||||
(require 'dired)
|
||||
(require 'subr-x)
|
||||
(autoload 'dired-get-filename "dired"))
|
||||
|
||||
;;; **************************************************************************
|
||||
|
@ -99,7 +100,7 @@ a dired buffer). If the current line represents a file, the file is visited
|
|||
in another window."
|
||||
(interactive)
|
||||
;; use arg passed in or find name of current line
|
||||
(let ((name (or default-dirname (dired-get-filename nil t))))
|
||||
(when-let ((name (or default-dirname (dired-get-filename nil t))))
|
||||
(save-excursion
|
||||
(save-match-data
|
||||
;; See if the selection is a directory or not.
|
|
@ -9,9 +9,6 @@
|
|||
;;;### (autoloads nil "doom-modeline" "doom-modeline.el" (0 0 0 0))
|
||||
;;; Generated autoloads from doom-modeline.el
|
||||
|
||||
(autoload 'doom-modeline-init "doom-modeline" "\
|
||||
Initialize doom mode-line." nil nil)
|
||||
|
||||
(autoload 'doom-modeline-set-main-modeline "doom-modeline" "\
|
||||
Set main mode-line.
|
||||
If DEFAULT is non-nil, set the default mode-line for all buffers.
|
||||
|
@ -70,7 +67,7 @@ or call the function `doom-modeline-mode'.")
|
|||
(custom-autoload 'doom-modeline-mode "doom-modeline" nil)
|
||||
|
||||
(autoload 'doom-modeline-mode "doom-modeline" "\
|
||||
Toggle doom-modeline on or off.
|
||||
Toggle `doom-modeline' on or off.
|
||||
|
||||
This is a minor mode. If called interactively, toggle the
|
||||
`Doom-Modeline mode' mode. If the prefix argument is positive,
|
|
@ -28,109 +28,55 @@
|
|||
|
||||
(require 'cl-lib)
|
||||
(require 'subr-x)
|
||||
(require 'dash)
|
||||
(require 'all-the-icons)
|
||||
|
||||
(require 'compat)
|
||||
(require 'shrink-path)
|
||||
|
||||
(require 'all-the-icons nil t)
|
||||
|
||||
|
||||
;;
|
||||
;; Compatibility
|
||||
;; Externals
|
||||
;;
|
||||
|
||||
(eval-and-compile
|
||||
(when (< emacs-major-version 26)
|
||||
;; Define `if-let*' and `when-let*' variants for 25 users.
|
||||
(unless (fboundp 'if-let*) (defalias 'if-let* #'if-let))
|
||||
(unless (fboundp 'when-let*) (defalias 'when-let* #'when-let))))
|
||||
(declare-function all-the-icons--function-name "ext:all-the-icons")
|
||||
|
||||
|
||||
;;
|
||||
;; Optimization
|
||||
;;
|
||||
|
||||
;; Don’t compact font caches during GC.
|
||||
(when (eq system-type 'windows-nt)
|
||||
(setq inhibit-compacting-font-caches t))
|
||||
|
||||
;;`file-local-name' is introduced in 25.2.2.
|
||||
(unless (fboundp 'file-local-name)
|
||||
(defun file-local-name (file)
|
||||
"Return the local name component of FILE.
|
||||
It returns a file name which can be used directly as argument of
|
||||
`process-file', `start-file-process', or `shell-command'."
|
||||
(or (file-remote-p file 'localname) file)))
|
||||
;; WORKAROUND: `string-pixel-width' is introduced in 29,
|
||||
;; which is able to calculate the accurate string width.
|
||||
;; Below is the workaround for backward compatibility.
|
||||
;; `window-font-width' consumes a lot
|
||||
(defvar doom-modeline--font-width-cache nil)
|
||||
(defun doom-modeline--font-width ()
|
||||
"Cache the font width for better performance."
|
||||
(if (display-graphic-p)
|
||||
(let ((attributes (face-all-attributes 'mode-line)))
|
||||
(or (cdr (assoc attributes doom-modeline--font-width-cache))
|
||||
(let ((width (window-font-width nil 'mode-line)))
|
||||
(push (cons attributes width) doom-modeline--font-width-cache)
|
||||
width)))
|
||||
1))
|
||||
|
||||
;; Set correct font width for `all-the-icons' for appropriate mode-line width.
|
||||
;; @see https://emacs.stackexchange.com/questions/14420/how-can-i-fix-incorrect-character-width
|
||||
(defun doom-modeline--set-char-widths (alist)
|
||||
"Set correct widths of icons characters in ALIST."
|
||||
(while (char-table-parent char-width-table)
|
||||
(setq char-width-table (char-table-parent char-width-table)))
|
||||
(dolist (pair alist)
|
||||
(let ((width (car pair))
|
||||
(chars (cdr pair))
|
||||
(table (make-char-table nil)))
|
||||
(dolist (char chars)
|
||||
(set-char-table-range table char width))
|
||||
(optimize-char-table table)
|
||||
(set-char-table-parent table char-width-table)
|
||||
(setq char-width-table table))))
|
||||
;; Refresh the font width after setting frame parameters
|
||||
;; to ensure the font width is correct.
|
||||
(defun doom-modeline-refresh-font-width-cache (&rest _)
|
||||
"Refresh the font width cache."
|
||||
(setq doom-modeline--font-width-cache nil)
|
||||
(doom-modeline--font-width))
|
||||
|
||||
(defconst doom-modeline-rhs-icons-alist
|
||||
'((2 . (;; VCS
|
||||
?\xf0ac ; git-compare
|
||||
?\xf023 ; git-merge
|
||||
?\xf03f ; arrow-down
|
||||
?\xf02d ; alert
|
||||
?\xf020 ; git-branch
|
||||
|
||||
;; Checker
|
||||
?\xe611 ; do_not_disturb_alt
|
||||
?\xe5ca ; check
|
||||
?\xe192 ; access_time
|
||||
?\xe624 ; sim_card_alert
|
||||
?\xe034 ; pause
|
||||
?\xe645 ; priority_high
|
||||
|
||||
;; Minor modes
|
||||
?\xf02f ; gear
|
||||
|
||||
;; Persp
|
||||
?\xe2c7 ; folder
|
||||
|
||||
;; Preview
|
||||
?\xe8a0 ; pageview
|
||||
|
||||
;; REPL
|
||||
?\xf155 ; dollar-sign
|
||||
|
||||
;; LSP
|
||||
?\xf135 ; rocket
|
||||
|
||||
;; GitHub
|
||||
?\xf09b ; github
|
||||
|
||||
;; Debug
|
||||
?\xf188 ; bug
|
||||
|
||||
;; Mail
|
||||
?\xe0be ; email
|
||||
|
||||
;; IRC
|
||||
?\xe0c9 ; message
|
||||
|
||||
;; Battery
|
||||
?\xe939 ; battery-charging
|
||||
?\xf244 ; battery-empty
|
||||
?\xf240 ; battery-full
|
||||
?\xf242 ; battery-half
|
||||
?\xf243 ; battery-quarter
|
||||
?\xf241 ; battery-three-quarters
|
||||
))))
|
||||
|
||||
(defun doom-modeline-set-char-widths (&rest _)
|
||||
"Set char widths for the unicode icons."
|
||||
(doom-modeline--set-char-widths doom-modeline-rhs-icons-alist))
|
||||
|
||||
(if (and (daemonp)
|
||||
(not (frame-parameter nil 'client)))
|
||||
(add-hook 'after-make-frame-functions #'doom-modeline-set-char-widths)
|
||||
(and (display-graphic-p) (doom-modeline-set-char-widths)))
|
||||
(unless (fboundp 'string-pixel-width)
|
||||
(add-hook 'window-setup-hook #'doom-modeline-refresh-font-width-cache)
|
||||
(add-hook 'after-make-frame-functions #'doom-modeline-refresh-font-width-cache)
|
||||
(add-hook 'after-setting-font-hook #'doom-modeline-refresh-font-width-cache)
|
||||
(add-hook 'server-after-make-frame-hook #'doom-modeline-refresh-font-width-cache))
|
||||
|
||||
|
||||
;;
|
||||
|
@ -147,7 +93,7 @@ It returns a file name which can be used directly as argument of
|
|||
This is done by adjusting `lisp-imenu-generic-expression' to
|
||||
include support for finding `doom-modeline-def-*' forms.
|
||||
|
||||
Must be set before loading doom-modeline."
|
||||
Must be set before loading `doom-modeline'."
|
||||
:type 'boolean
|
||||
:set (lambda (_sym val)
|
||||
(if val
|
||||
|
@ -157,8 +103,7 @@ Must be set before loading doom-modeline."
|
|||
|
||||
(defcustom doom-modeline-height 25
|
||||
"How tall the mode-line should be. It's only respected in GUI.
|
||||
If the actual char height is larger, it respects the actual char height.
|
||||
If `doom-modeline-height' is <= 0 the modeline will have default height."
|
||||
If the actual char height is larger, it respects the actual char height."
|
||||
:type 'integer
|
||||
:group 'doom-modeline)
|
||||
|
||||
|
@ -182,11 +127,11 @@ Only respected in GUI."
|
|||
(set sym (if (> val 1) val 1)))
|
||||
:group 'doom-modeline)
|
||||
|
||||
(defcustom doom-modeline-window-width-limit 0.25
|
||||
(defcustom doom-modeline-window-width-limit 85
|
||||
"The limit of the window width.
|
||||
|
||||
If `window-width' is smaller than the limit, some information won't be
|
||||
displayed. It can be an integer or a float number. `nil' means no limit."
|
||||
displayed. It can be an integer or a float number. nil means no limit."
|
||||
:type '(choice integer
|
||||
float
|
||||
(const :tag "Disable" nil))
|
||||
|
@ -212,7 +157,7 @@ Specify another one if you encounter the issue."
|
|||
"Determines the style used by `doom-modeline-buffer-file-name'.
|
||||
|
||||
Given ~/Projects/FOSS/emacs/lisp/comint.el
|
||||
auto => emacs/lisp/comint.el (in a project) or comint.el
|
||||
auto => emacs/l/comint.el (in a project) or comint.el
|
||||
truncate-upto-project => ~/P/F/emacs/lisp/comint.el
|
||||
truncate-from-project => ~/Projects/FOSS/emacs/l/comint.el
|
||||
truncate-with-project => emacs/l/comint.el
|
||||
|
@ -249,7 +194,7 @@ While using the server mode in GUI, should set the value explicitly."
|
|||
(defcustom doom-modeline-major-mode-icon t
|
||||
"Whether display the icon for `major-mode'.
|
||||
|
||||
It respects `doom-modeline-icon'."
|
||||
It respects variable `doom-modeline-icon'."
|
||||
:type 'boolean
|
||||
:group'doom-modeline)
|
||||
|
||||
|
@ -263,14 +208,21 @@ It respects `all-the-icons-color-icons'."
|
|||
(defcustom doom-modeline-buffer-state-icon t
|
||||
"Whether display the icon for the buffer state.
|
||||
|
||||
It respects `doom-modeline-icon'."
|
||||
It respects variable `doom-modeline-icon'."
|
||||
:type 'boolean
|
||||
:group 'doom-modeline)
|
||||
|
||||
(defcustom doom-modeline-buffer-modification-icon t
|
||||
"Whether display the modification icon for the buffer.
|
||||
|
||||
It respects `doom-modeline-icon' and `doom-modeline-buffer-state-icon'."
|
||||
It respects variable `doom-modeline-icon' and `doom-modeline-buffer-state-icon'."
|
||||
:type 'boolean
|
||||
:group 'doom-modeline)
|
||||
|
||||
(defcustom doom-modeline-time-icon t
|
||||
"Whether display the time icon.
|
||||
|
||||
It respects variable `doom-modeline-icon'."
|
||||
:type 'boolean
|
||||
:group 'doom-modeline)
|
||||
|
||||
|
@ -429,10 +381,11 @@ It respects `doom-modeline-enable-word-count'."
|
|||
web-mode-script-padding
|
||||
web-mode-style-padding)
|
||||
(yaml-mode yaml-indent-offset))
|
||||
"Indentation retrieving variables matched to major modes used
|
||||
when `doom-modeline-indent-info' is non-nil. When multiple
|
||||
variables are specified for a mode, they will be tried resolved
|
||||
in the given order."
|
||||
"Indentation retrieving variables matched to major modes.
|
||||
|
||||
Which is used when `doom-modeline-indent-info' is non-nil.
|
||||
When multiple variables are specified for a mode, they will be tried resolved
|
||||
in the given order."
|
||||
:type '(alist :key-type symbol :value-type sexp)
|
||||
:group 'doom-modeline)
|
||||
|
||||
|
@ -580,28 +533,18 @@ It requires `circe' or `erc' package."
|
|||
:group 'faces
|
||||
:link '(url-link :tag "Homepage" "https://github.com/seagle0128/doom-modeline"))
|
||||
|
||||
(defface doom-modeline-spc-face
|
||||
'((t (:inherit mode-line)))
|
||||
"Face used for the white space."
|
||||
(defface doom-modeline-emphasis
|
||||
'((t (:inherit mode-line-emphasis)))
|
||||
"Face used for emphasis."
|
||||
:group 'doom-modeline-faces)
|
||||
|
||||
(defface doom-modeline-spc-inactive-face
|
||||
'((t (:inherit mode-line-inactive)))
|
||||
"Face used for the inactive white space."
|
||||
:group 'doom-modeline-faces)
|
||||
|
||||
(defface doom-modeline-vspc-face
|
||||
'((t (:inherit variable-pitch)))
|
||||
"Face used for the variable white space."
|
||||
:group 'doom-modeline-faces)
|
||||
|
||||
(defface doom-modeline-vspc-inactive-face
|
||||
'((t (:inherit (mode-line-inactive doom-modeline-vspc-face))))
|
||||
"Face used for the variable white space."
|
||||
(defface doom-modeline-highlight
|
||||
'((t (:inherit mode-line-highlight)))
|
||||
"Face used for highlighting."
|
||||
:group 'doom-modeline-faces)
|
||||
|
||||
(defface doom-modeline-buffer-path
|
||||
'((t (:inherit (mode-line-emphasis bold))))
|
||||
'((t (:inherit (doom-modeline-emphasis bold))))
|
||||
"Face used for the dirname part of the buffer path."
|
||||
:group 'doom-modeline-faces)
|
||||
|
||||
|
@ -612,11 +555,11 @@ It requires `circe' or `erc' package."
|
|||
|
||||
(defface doom-modeline-buffer-modified
|
||||
'((t (:inherit (error bold) :background nil)))
|
||||
"Face used for the 'unsaved' symbol in the mode-line."
|
||||
"Face used for the \\='unsaved\\=' symbol in the mode-line."
|
||||
:group 'doom-modeline-faces)
|
||||
|
||||
(defface doom-modeline-buffer-major-mode
|
||||
'((t (:inherit (mode-line-emphasis bold))))
|
||||
'((t (:inherit (doom-modeline-emphasis bold))))
|
||||
"Face used for the major-mode segment in the mode-line."
|
||||
:group 'doom-modeline-faces)
|
||||
|
||||
|
@ -636,18 +579,14 @@ It requires `circe' or `erc' package."
|
|||
:group 'doom-modeline-faces)
|
||||
|
||||
(defface doom-modeline-project-root-dir
|
||||
'((t (:inherit (mode-line-emphasis bold))))
|
||||
'((t (:inherit (doom-modeline-emphasis bold))))
|
||||
"Face used for the project part of the mode-line buffer path."
|
||||
:group 'doom-modeline-faces)
|
||||
|
||||
(defface doom-modeline-highlight
|
||||
'((t (:inherit mode-line-emphasis)))
|
||||
"Face for bright segments of the mode-line."
|
||||
:group 'doom-modeline-faces)
|
||||
|
||||
(defface doom-modeline-panel
|
||||
'((t (:inherit mode-line-highlight)))
|
||||
"Face for 'X out of Y' segments, such as `anzu', `evil-substitute' and`iedit', etc."
|
||||
'((t (:inherit doom-modeline-highlight)))
|
||||
"Face for \\='X out of Y\\=' segments.
|
||||
This applies to `anzu', `evil-substitute', `iedit' etc."
|
||||
:group 'doom-modeline-faces)
|
||||
|
||||
(defface doom-modeline-host
|
||||
|
@ -656,7 +595,7 @@ It requires `circe' or `erc' package."
|
|||
:group 'doom-modeline-faces)
|
||||
|
||||
(defface doom-modeline-input-method
|
||||
'((t (:inherit (mode-line-emphasis bold))))
|
||||
'((t (:inherit (doom-modeline-emphasis bold))))
|
||||
"Face for input method in the mode-line."
|
||||
:group 'doom-modeline-faces)
|
||||
|
||||
|
@ -687,8 +626,8 @@ It requires `circe' or `erc' package."
|
|||
|
||||
(defface doom-modeline-notification
|
||||
'((t (:inherit doom-modeline-warning)))
|
||||
"Face for notifications in the mode-line. Used by GitHub, mu4e,
|
||||
etc. (also see the face `doom-modeline-unread-number')."
|
||||
"Face for notifications in the mode-line. Used by GitHub, mu4e, etc.
|
||||
Also see the face `doom-modeline-unread-number'."
|
||||
:group 'doom-modeline-faces)
|
||||
|
||||
(defface doom-modeline-unread-number
|
||||
|
@ -697,7 +636,7 @@ etc. (also see the face `doom-modeline-unread-number')."
|
|||
:group 'doom-modeline-faces)
|
||||
|
||||
(defface doom-modeline-bar
|
||||
'((t (:inherit highlight)))
|
||||
'((t (:inherit doom-modeline-highlight)))
|
||||
"The face used for the left-most bar in the mode-line of an active window."
|
||||
:group 'doom-modeline-faces)
|
||||
|
||||
|
@ -707,12 +646,10 @@ etc. (also see the face `doom-modeline-unread-number')."
|
|||
:group 'doom-modeline-faces)
|
||||
|
||||
(defface doom-modeline-debug-visual
|
||||
`((((class color) (background light))
|
||||
(:background ,(face-foreground 'all-the-icons-orange)))
|
||||
(((class color) (background dark))
|
||||
(:background ,(face-foreground 'all-the-icons-dorange))))
|
||||
'((((background light)) :foreground "#D4843E")
|
||||
(((background dark)) :foreground "#915B2D"))
|
||||
"Face to use for the mode-line while debugging."
|
||||
:group 'doom-modeline)
|
||||
:group 'doom-modeline-faces)
|
||||
|
||||
(defface doom-modeline-evil-emacs-state
|
||||
'((t (:inherit (font-lock-builtin-face bold))))
|
||||
|
@ -824,14 +761,18 @@ etc. (also see the face `doom-modeline-unread-number')."
|
|||
"Face for timemachine status."
|
||||
:group 'doom-modeline-faces)
|
||||
|
||||
(defface doom-modeline-time
|
||||
'((t (:inherit (mode-line-buffer-id bold))))
|
||||
"Face for display time."
|
||||
:group 'doom-modeline-faces)
|
||||
|
||||
;;
|
||||
;; Externals
|
||||
;;
|
||||
|
||||
(declare-function face-remap-remove-relative "face-remap")
|
||||
(declare-function project-root "project")
|
||||
(declare-function ffip-get-project-root-directory "ext:find-file-in-project")
|
||||
(declare-function project-root "ext:project")
|
||||
(declare-function projectile-project-root "ext:projectile")
|
||||
|
||||
|
||||
|
@ -899,14 +840,23 @@ used as an advice to window creation functions."
|
|||
(unless (>= emacs-major-version 29)
|
||||
(advice-add #'fit-window-to-buffer :before #'doom-modeline-redisplay))
|
||||
|
||||
(defun doom-modeline-icon-displayable-p ()
|
||||
"Return non-nil if icons are displayable."
|
||||
(and doom-modeline-icon
|
||||
(display-graphic-p)
|
||||
(featurep 'all-the-icons)))
|
||||
|
||||
;; Keep `doom-modeline-current-window' up-to-date
|
||||
(defun doom-modeline--get-current-window (&optional frame)
|
||||
"Get the current window but should exclude the child windows."
|
||||
"Get the current window but should exclude the child windows.
|
||||
|
||||
If FRAME is nil, it means the current frame."
|
||||
(if (and (fboundp 'frame-parent) (frame-parent frame))
|
||||
(frame-selected-window (frame-parent frame))
|
||||
(frame-selected-window frame)))
|
||||
|
||||
(defvar doom-modeline-current-window (doom-modeline--get-current-window))
|
||||
(defvar doom-modeline-current-window (doom-modeline--get-current-window)
|
||||
"Current window.")
|
||||
|
||||
(defun doom-modeline--active ()
|
||||
"Whether is an active window."
|
||||
|
@ -930,23 +880,39 @@ used as an advice to window creation functions."
|
|||
|
||||
(add-hook 'pre-redisplay-functions #'doom-modeline-set-selected-window)
|
||||
|
||||
;; Ensure modeline is inactive when Emacs is unfocused (and active otherwise)
|
||||
(defvar doom-modeline-remap-face-cookie nil)
|
||||
;; Ensure modeline is inactive when Emacs is unfocused
|
||||
(defvar doom-modeline--remap-faces '(mode-line
|
||||
mode-line-active
|
||||
solaire-mode-line-face
|
||||
solaire-mode-line-active-face
|
||||
paradox-mode-line-face
|
||||
flycheck-color-mode-line-error-face
|
||||
flycheck-color-mode-line-warning-face
|
||||
flycheck-color-mode-line-info-face
|
||||
flycheck-color-mode-line-success-face))
|
||||
(dolist (face (face-list))
|
||||
(let ((f (symbol-name face)))
|
||||
(and
|
||||
(string-match-p "^\\(doom-modeline\\|all-the-icons\\)" f)
|
||||
(not (string-match-p "\\(-inactive\\|-dired\\|-ivy\\|-ibuffer\\)" f))
|
||||
(add-to-list 'doom-modeline--remap-faces face))))
|
||||
|
||||
(defvar doom-modeline--remap-face-cookie-alist nil)
|
||||
(defun doom-modeline-focus ()
|
||||
"Focus mode-line."
|
||||
(when doom-modeline-remap-face-cookie
|
||||
(require 'face-remap)
|
||||
(face-remap-remove-relative doom-modeline-remap-face-cookie)))
|
||||
(mapc #'face-remap-remove-relative doom-modeline--remap-face-cookie-alist))
|
||||
|
||||
(defun doom-modeline-unfocus ()
|
||||
"Unfocus mode-line."
|
||||
(setq doom-modeline-remap-face-cookie
|
||||
(face-remap-add-relative 'mode-line 'mode-line-inactive)))
|
||||
(dolist (face doom-modeline--remap-faces)
|
||||
(add-to-list 'doom-modeline--remap-face-cookie-alist
|
||||
(face-remap-add-relative face 'mode-line-inactive))))
|
||||
|
||||
(with-no-warnings
|
||||
(if (boundp 'after-focus-change-function)
|
||||
(progn
|
||||
(defun doom-modeline-focus-change (&rest _)
|
||||
(if (frame-focus-state)
|
||||
(if (frame-focus-state (frame-parent))
|
||||
(doom-modeline-focus)
|
||||
(doom-modeline-unfocus)))
|
||||
(advice-add #'handle-switch-frame :after #'doom-modeline-focus-change)
|
||||
|
@ -964,7 +930,7 @@ used as an advice to window creation functions."
|
|||
(defvar doom-modeline-var-alist ())
|
||||
|
||||
(defmacro doom-modeline-def-segment (name &rest body)
|
||||
"Defines a modeline segment NAME with BODY and byte compiles it."
|
||||
"Define a modeline segment NAME with BODY and byte compiles it."
|
||||
(declare (indent defun) (doc-string 2))
|
||||
(let ((sym (intern (format "doom-modeline-segment--%s" name)))
|
||||
(docstring (if (stringp (car body))
|
||||
|
@ -977,11 +943,13 @@ used as an advice to window creation functions."
|
|||
(t
|
||||
(add-to-list 'doom-modeline-fn-alist (cons name sym))
|
||||
`(progn
|
||||
(fset ',sym (lambda () ,docstring ,@body))
|
||||
(defun ,sym () ,docstring ,@body)
|
||||
(add-to-list 'doom-modeline-fn-alist (cons ',name ',sym))
|
||||
,(unless (bound-and-true-p byte-compile-current-file)
|
||||
`(let (byte-compile-warnings)
|
||||
(byte-compile #',sym))))))))
|
||||
(unless (and (fboundp 'subr-native-elisp-p)
|
||||
(subr-native-elisp-p (symbol-function #',sym)))
|
||||
(byte-compile #',sym)))))))))
|
||||
|
||||
(defun doom-modeline--prepare-segments (segments)
|
||||
"Prepare mode-line `SEGMENTS'."
|
||||
|
@ -998,39 +966,17 @@ used as an advice to window creation functions."
|
|||
((error "%s is not a valid segment" seg))))
|
||||
(nreverse forms)))
|
||||
|
||||
(defvar doom-modeline--font-width-cache nil)
|
||||
(defun doom-modeline--font-width ()
|
||||
"Cache the font width."
|
||||
(if (display-graphic-p)
|
||||
(let ((attributes (face-all-attributes 'mode-line)))
|
||||
(or (cdr (assoc attributes doom-modeline--font-width-cache))
|
||||
(let ((width (window-font-width nil 'mode-line)))
|
||||
(push (cons attributes width) doom-modeline--font-width-cache)
|
||||
width)))
|
||||
1))
|
||||
|
||||
;; Refresh the font width after setting frame parameters
|
||||
;; to ensure the font width is correct.
|
||||
(defun doom-modeline-refresh-font-width-cache (&rest _)
|
||||
"Refresh the font width cache."
|
||||
(setq doom-modeline--font-width-cache nil)
|
||||
(doom-modeline--font-width))
|
||||
(add-hook 'window-setup-hook #'doom-modeline-refresh-font-width-cache)
|
||||
(add-hook 'after-make-frame-functions #'doom-modeline-refresh-font-width-cache)
|
||||
(add-hook 'after-setting-font-hook #'doom-modeline-refresh-font-width-cache)
|
||||
(add-hook 'server-after-make-frame-hook #'doom-modeline-refresh-font-width-cache)
|
||||
|
||||
(defun doom-modeline-def-modeline (name lhs &optional rhs)
|
||||
"Defines a modeline format and byte-compiles it.
|
||||
"Define a modeline format and byte-compiles it.
|
||||
NAME is a symbol to identify it (used by `doom-modeline' for retrieval).
|
||||
LHS and RHS are lists of symbols of modeline segments defined with
|
||||
`doom-modeline-def-segment'.
|
||||
|
||||
Example:
|
||||
(doom-modeline-def-modeline 'minimal
|
||||
'(bar matches \" \" buffer-info)
|
||||
'(media-info major-mode))
|
||||
(doom-modeline-set-modeline 'minimal t)"
|
||||
(doom-modeline-def-modeline \\='minimal
|
||||
\\='(bar matches \" \" buffer-info)
|
||||
\\='(media-info major-mode))
|
||||
(doom-modeline-set-modeline \\='minimal t)"
|
||||
(let ((sym (intern (format "doom-modeline-format--%s" name)))
|
||||
(lhs-forms (doom-modeline--prepare-segments lhs))
|
||||
(rhs-forms (doom-modeline--prepare-segments rhs)))
|
||||
|
@ -1039,15 +985,22 @@ Example:
|
|||
(list lhs-forms
|
||||
(propertize
|
||||
" "
|
||||
'face (if (doom-modeline--active) 'mode-line 'mode-line-inactive)
|
||||
'display `((space
|
||||
:align-to
|
||||
(- (+ right right-fringe right-margin scroll-bar)
|
||||
,(* (let ((width (doom-modeline--font-width)))
|
||||
(or (and (= width 1) 1)
|
||||
(/ width (frame-char-width) 1.0)))
|
||||
(string-width
|
||||
(format-mode-line (cons "" rhs-forms))))))))
|
||||
(- (+ right right-margin scroll-bar)
|
||||
,(let ((rhs-str (format-mode-line (cons "" rhs-forms)))
|
||||
(char-width (frame-char-width)))
|
||||
(if (fboundp 'string-pixel-width)
|
||||
;; Accurate calculations in 29+
|
||||
(/ (string-pixel-width
|
||||
(propertize rhs-str 'face 'mode-line))
|
||||
char-width
|
||||
1.0)
|
||||
;; Backward compatibility
|
||||
(* (/ (doom-modeline--font-width)
|
||||
char-width
|
||||
1.0)
|
||||
(string-width rhs-str))))))))
|
||||
rhs-forms))
|
||||
(concat "Modeline:\n"
|
||||
(format " %s\n %s"
|
||||
|
@ -1076,38 +1029,41 @@ If DEFAULT is non-nil, set the default mode-line for all buffers."
|
|||
;; Helpers
|
||||
;;
|
||||
|
||||
(defsubst doom-modeline-spc ()
|
||||
"Text style with whitespace."
|
||||
(propertize " " 'face (if (doom-modeline--active)
|
||||
'doom-modeline-spc-face
|
||||
'doom-modeline-spc-inactive-face)))
|
||||
(defconst doom-modeline-spc " " "Whitespace.")
|
||||
(defconst doom-modeline-wspc " " "Wide whitespace.")
|
||||
(defconst doom-modeline-vspc
|
||||
(propertize " " 'display '((space :relative-width 0.5)))
|
||||
"Thin whitespace.")
|
||||
|
||||
(defsubst doom-modeline-wspc ()
|
||||
"Text style with wide whitespace."
|
||||
(propertize " " 'face (if (doom-modeline--active)
|
||||
'doom-modeline-spc-face
|
||||
'doom-modeline-spc-inactive-face)))
|
||||
(defconst doom-modeline-ellipsis
|
||||
(if (char-displayable-p ?…) "…" "...")
|
||||
"Ellipsis.")
|
||||
|
||||
(defsubst doom-modeline-vspc ()
|
||||
"Text style with icons in mode-line."
|
||||
(propertize " " 'face (if (doom-modeline--active)
|
||||
'doom-modeline-vspc-face
|
||||
'doom-modeline-vspc-inactive-face)))
|
||||
(defun doom-modeline-face (&optional face inactive-face)
|
||||
"Display FACE in active window, and INACTIVE-FACE in inactive window.
|
||||
IF FACE is nil, `mode-line' face will be used.
|
||||
If INACTIVE-FACE is nil, `mode-line-inactive' face will be used."
|
||||
(if (doom-modeline--active)
|
||||
(or (and (facep face) face)
|
||||
(and (facep 'mode-line-active) 'mode-line-active)
|
||||
'mode-line)
|
||||
(or (and (facep inactive-face) inactive-face)
|
||||
'mode-line-inactive)))
|
||||
|
||||
;; Since 27, the calculation of char height was changed
|
||||
;; @see https://github.com/seagle0128/doom-modeline/issues/271
|
||||
(defun doom-modeline--font-height ()
|
||||
"Calculate the actual char height of the mode-line."
|
||||
(let ((height (face-attribute 'mode-line :height)))
|
||||
;; WORKAROUND: Fix tall issue of 27 on Linux
|
||||
;; @see https://github.com/seagle0128/doom-modeline/issues/271
|
||||
(let ((height (face-attribute 'mode-line :height))
|
||||
(char-height (window-font-height nil 'mode-line)))
|
||||
(round
|
||||
(* (if (or (<= doom-modeline-height 0)
|
||||
(and (>= emacs-major-version 27)
|
||||
(not (eq system-type 'darwin))))
|
||||
1.0
|
||||
(if doom-modeline-icon 1.68 1.25))
|
||||
(* (pcase system-type
|
||||
('darwin (if doom-modeline-icon 1.7 1.0))
|
||||
('windows-nt (if doom-modeline-icon 0.88 0.625))
|
||||
(_ (if (and doom-modeline-icon (< emacs-major-version 27)) 1.4 1.0)))
|
||||
(cond ((integerp height) (/ height 10))
|
||||
((floatp height) (* height (frame-char-height)))
|
||||
(t (frame-char-height)))))))
|
||||
((floatp height) (* height char-height))
|
||||
(t char-height))))))
|
||||
|
||||
(defun doom-modeline--original-value (sym)
|
||||
"Return the original value for SYM, if any.
|
||||
|
@ -1134,12 +1090,13 @@ The face should be the first attribute, or the font family may be overridden.
|
|||
So convert the face \":family XXX :height XXX :inherit XXX\" to
|
||||
\":inherit XXX :family XXX :height XXX\".
|
||||
See https://github.com/seagle0128/doom-modeline/issues/301."
|
||||
(if (and doom-modeline-icon (display-graphic-p))
|
||||
(if (doom-modeline-icon-displayable-p)
|
||||
(when-let ((props (get-text-property 0 'face icon)))
|
||||
(when (listp props)
|
||||
(cl-destructuring-bind (&key family height inherit &allow-other-keys) props
|
||||
(propertize icon 'face `(:inherit ,(or face inherit props)
|
||||
:family ,family
|
||||
:height ,height))))
|
||||
(propertize icon 'face `(:inherit ,(or face inherit props 'mode-line)
|
||||
:family ,(or family "")
|
||||
:height ,(or height 1.0))))))
|
||||
(propertize icon 'face face)))
|
||||
|
||||
(defun doom-modeline-icon (icon-set icon-name unicode text &rest args)
|
||||
|
@ -1150,31 +1107,47 @@ etc.
|
|||
UNICODE is the unicode char fallback. TEXT is the ASCII char fallback.
|
||||
ARGS is same as `all-the-icons-octicon' and others."
|
||||
(let ((face (or (plist-get args :face) 'mode-line)))
|
||||
(or
|
||||
;; Icons
|
||||
(when (and (display-graphic-p)
|
||||
doom-modeline-icon
|
||||
(cond
|
||||
;; Icon
|
||||
((and (doom-modeline-icon-displayable-p)
|
||||
icon-name
|
||||
(not (string-empty-p icon-name)))
|
||||
(when-let* ((func (all-the-icons--function-name icon-set))
|
||||
(icon (and (fboundp func) (apply func icon-name args))))
|
||||
(icon (and (fboundp func)
|
||||
(apply func icon-name args))))
|
||||
(doom-modeline-propertize-icon icon face)))
|
||||
;; Unicode fallback
|
||||
(and doom-modeline-unicode-fallback
|
||||
((and doom-modeline-unicode-fallback
|
||||
unicode
|
||||
(not (string-empty-p unicode))
|
||||
(char-displayable-p (string-to-char unicode))
|
||||
(char-displayable-p (string-to-char unicode)))
|
||||
(propertize unicode 'face face))
|
||||
;; ASCII text
|
||||
(and text (propertize text 'face face))
|
||||
"")))
|
||||
(text
|
||||
(propertize text 'face face))
|
||||
;; Fallback
|
||||
(t ""))))
|
||||
|
||||
(defun doom-modeline-display-icon (icon)
|
||||
"Display ICON in mode-line."
|
||||
(if (doom-modeline--active)
|
||||
icon
|
||||
(doom-modeline-propertize-icon icon 'mode-line-inactive)))
|
||||
|
||||
(defun doom-modeline-display-text (text)
|
||||
"Display TEXT in mode-line."
|
||||
(if (doom-modeline--active)
|
||||
text
|
||||
(propertize text 'face 'mode-line-inactive)))
|
||||
|
||||
(defun doom-modeline--create-bar-image (face width height)
|
||||
"Create the bar image.
|
||||
Use FACE1 for the bar, FACE2 for the background.
|
||||
WIDTH and HEIGHT are the image size in pixels."
|
||||
|
||||
Use FACE for the bar, WIDTH and HEIGHT are the image size in pixels."
|
||||
(when (and (display-graphic-p)
|
||||
(image-type-available-p 'pbm))
|
||||
(image-type-available-p 'pbm)
|
||||
(numberp width) (> width 0)
|
||||
(numberp height) (> height 0))
|
||||
(propertize
|
||||
" " 'display
|
||||
(let ((color (or (face-background face nil t) "None")))
|
||||
|
@ -1188,12 +1161,15 @@ WIDTH and HEIGHT are the image size in pixels."
|
|||
(defun doom-modeline--create-hud-image
|
||||
(face1 face2 width height top-margin bottom-margin)
|
||||
"Create the hud image.
|
||||
|
||||
Use FACE1 for the bar, FACE2 for the background.
|
||||
WIDTH and HEIGHT are the image size in pixels.
|
||||
TOP-MARGIN and BOTTOM-MARGIN are the size of the margin above and below the bar,
|
||||
respectively."
|
||||
(when (and (display-graphic-p)
|
||||
(image-type-available-p 'pbm))
|
||||
(image-type-available-p 'pbm)
|
||||
(numberp width) (> width 0)
|
||||
(numberp height) (> height 0))
|
||||
(let ((min-height (min height doom-modeline-hud-min-height)))
|
||||
(unless (> (- height top-margin bottom-margin) min-height)
|
||||
(let ((margin (- height min-height)))
|
||||
|
@ -1224,28 +1200,27 @@ respectively."
|
|||
(<= (/ (window-total-width) (frame-width) 1.0)
|
||||
doom-modeline-window-width-limit)))))
|
||||
|
||||
(add-hook 'window-size-change-functions #'doom-modeline-window-size-change-function)
|
||||
(add-hook 'after-revert-hook #'doom-modeline-window-size-change-function)
|
||||
(add-hook 'buffer-list-update-hook #'doom-modeline-window-size-change-function)
|
||||
(add-hook 'window-size-change-functions #'doom-modeline-window-size-change-function)
|
||||
|
||||
(defvar-local doom-modeline--project-root nil)
|
||||
(defun doom-modeline--project-root ()
|
||||
"Get the path to the root of your project.
|
||||
"Get the path to the project root.
|
||||
Return nil if no project was found."
|
||||
(or doom-modeline--project-root
|
||||
(setq doom-modeline--project-root
|
||||
(pcase (if (eq doom-modeline-project-detection 'auto)
|
||||
(cond
|
||||
((fboundp 'ffip-get-project-root-directory) 'ffip)
|
||||
((fboundp 'projectile-project-root) 'projectile)
|
||||
((fboundp 'project-current) 'project)
|
||||
(t 'default))
|
||||
doom-modeline-project-detection)
|
||||
('ffip
|
||||
((and (memq doom-modeline-project-detection '(auto ffip))
|
||||
(fboundp 'ffip-get-project-root-directory))
|
||||
(let ((inhibit-message t))
|
||||
(ffip-get-project-root-directory)))
|
||||
('projectile
|
||||
((and (memq doom-modeline-project-detection '(auto projectile))
|
||||
(or (fboundp 'projectile-project-root)
|
||||
(require 'projectile nil t)))
|
||||
(projectile-project-root))
|
||||
('project
|
||||
((and (memq doom-modeline-project-detection '(auto project))
|
||||
(fboundp 'project-current))
|
||||
(when-let ((project (project-current)))
|
||||
(expand-file-name (if (fboundp 'project-root)
|
||||
(project-root project)
|
||||
|
@ -1261,8 +1236,7 @@ Return `default-directory' if no project was found."
|
|||
(or (doom-modeline--project-root) default-directory))
|
||||
|
||||
(defun doom-modeline-buffer-file-name ()
|
||||
"Propertized variable `buffer-file-name' based on
|
||||
`doom-modeline-buffer-file-name-style'."
|
||||
"Propertize file name based on `doom-modeline-buffer-file-name-style'."
|
||||
(let* ((buffer-file-name (file-local-name (or (buffer-file-name (buffer-base-buffer)) "")))
|
||||
(buffer-file-truename (file-local-name
|
||||
(or buffer-file-truename (file-truename buffer-file-name) "")))
|
||||
|
@ -1270,7 +1244,7 @@ Return `default-directory' if no project was found."
|
|||
(pcase doom-modeline-buffer-file-name-style
|
||||
('auto
|
||||
(if (doom-modeline-project-p)
|
||||
(doom-modeline--buffer-file-name buffer-file-name buffer-file-truename nil nil 'hide)
|
||||
(doom-modeline--buffer-file-name buffer-file-name buffer-file-truename 'shrink 'shrink 'hide)
|
||||
(propertize "%b" 'face 'doom-modeline-buffer-file)))
|
||||
('truncate-upto-project
|
||||
(doom-modeline--buffer-file-name buffer-file-name buffer-file-truename 'shrink))
|
||||
|
@ -1307,7 +1281,8 @@ Return `default-directory' if no project was found."
|
|||
'local-map mode-line-buffer-identification-keymap)))
|
||||
|
||||
(defun doom-modeline--buffer-file-name-truncate (file-path true-file-path &optional truncate-tail)
|
||||
"Propertized variable `buffer-file-name' that truncates every dir along path.
|
||||
"Propertize file name that truncates every dir along path.
|
||||
|
||||
If TRUNCATE-TAIL is t also truncate the parent directory of the file."
|
||||
(let ((dirs (shrink-path-prompt (file-name-directory true-file-path))))
|
||||
(if (null dirs)
|
||||
|
@ -1322,8 +1297,9 @@ If TRUNCATE-TAIL is t also truncate the parent directory of the file."
|
|||
'face 'doom-modeline-buffer-file))))))
|
||||
|
||||
(defun doom-modeline--buffer-file-name-relative (_file-path true-file-path &optional include-project)
|
||||
"Propertized variable `buffer-file-name' showing directories relative to
|
||||
project's root only."
|
||||
"Propertize file name showing directories relative to project's root only.
|
||||
|
||||
If INCLUDE-PROJECT is non-nil, the project path will be included."
|
||||
(let ((root (file-local-name (doom-modeline-project-root))))
|
||||
(if (null root)
|
||||
(propertize "%b" 'face 'doom-modeline-buffer-file)
|
||||
|
@ -1340,7 +1316,8 @@ project's root only."
|
|||
truncate-project-root-parent
|
||||
truncate-project-relative-path
|
||||
hide-project-root-parent)
|
||||
"Propertized variable `buffer-file-name' given by FILE-PATH.
|
||||
"Propertize buffer name given by FILE-PATH.
|
||||
|
||||
If TRUNCATE-PROJECT-ROOT-PARENT is non-nil will be saved by truncating project
|
||||
root parent down fish-shell style.
|
||||
|
|
@ -33,14 +33,14 @@
|
|||
(defvar python-shell-interpreter)
|
||||
|
||||
|
||||
;; Customizations
|
||||
;; Customization
|
||||
|
||||
(defgroup doom-modeline-env nil
|
||||
"The environment parser for doom-modeline."
|
||||
"The environment parser for `doom-modeline'."
|
||||
:group 'doom-modeline
|
||||
:link '(url-link :tag "Homepage" "https://github.com/seagle0128/doom-modeline"))
|
||||
|
||||
(defcustom doom-modeline-env-load-string "..."
|
||||
(defcustom doom-modeline-env-load-string doom-modeline-ellipsis
|
||||
"What to display as the version while a new one is being loaded."
|
||||
:type 'string
|
||||
:group 'doom-modeline-env)
|
||||
|
@ -69,11 +69,11 @@ Example: \"ruby\"")
|
|||
|
||||
(defvar-local doom-modeline-env--command-args nil
|
||||
"A list of arguments for the command to extract the version from.
|
||||
Example: '(\"--version\") ")
|
||||
Example: \\='(\"--version\")")
|
||||
|
||||
(defvar-local doom-modeline-env--parser nil
|
||||
"A function that returns version number from a command --version (or similar).
|
||||
Example: 'doom-modeline-env--ruby")
|
||||
Example: \\='doom-modeline-env--ruby")
|
||||
|
||||
|
||||
;; Functions & Macros
|
||||
|
@ -115,7 +115,7 @@ passes on the information into the CALLBACK.
|
|||
Example:
|
||||
(doom-modeline-env--get
|
||||
\"ruby\"
|
||||
'(\"--version\")
|
||||
\\='(\"--version\")
|
||||
(lambda (line)
|
||||
(message (doom-modeline-parser--ruby line)))"
|
||||
(let ((proc (apply 'start-process
|
||||
|
@ -131,7 +131,7 @@ Example:
|
|||
(funcall parser line))))))
|
||||
|
||||
(cl-defmacro doom-modeline-def-env (name &key hooks command parser)
|
||||
"Defines a handler for updating & displaying a version string for a language.
|
||||
"Define a handler for updating & displaying a version string for a language.
|
||||
|
||||
NAME is an unquoted symbol representing the handler's unique ID.
|
||||
HOOKS is a list of hook symbols where this handler should be triggered.
|
||||
|
@ -213,7 +213,7 @@ PARSER should be a function for parsing COMMAND's output line-by-line, to
|
|||
"python")
|
||||
"--version"))))
|
||||
:parser (lambda (line) (let ((version (split-string line)))
|
||||
(if (>= (length version) 2)
|
||||
(if (length> version 1)
|
||||
(cadr version)
|
||||
(car version)))))
|
||||
|
|
@ -1,9 +1,8 @@
|
|||
(define-package "doom-modeline" "20220412.853" "A minimal and modern mode-line"
|
||||
(define-package "doom-modeline" "20220804.508" "A minimal and modern mode-line"
|
||||
'((emacs "25.1")
|
||||
(all-the-icons "2.2.0")
|
||||
(shrink-path "0.2.0")
|
||||
(dash "2.11.0"))
|
||||
:commit "7d8eb7c44087a62d8dd6e8ba1afc26facd914fbc" :authors
|
||||
(compat "28.1.1.1")
|
||||
(shrink-path "0.2.0"))
|
||||
:commit "4c4b451fcf705f58e6ca41339f22365434b664cb" :authors
|
||||
'(("Vincent Zhang" . "seagle0128@gmail.com"))
|
||||
:maintainer
|
||||
'("Vincent Zhang" . "seagle0128@gmail.com")
|
File diff suppressed because it is too large
Load diff
|
@ -4,8 +4,8 @@
|
|||
|
||||
;; Author: Vincent Zhang <seagle0128@gmail.com>
|
||||
;; Homepage: https://github.com/seagle0128/doom-modeline
|
||||
;; Version: 3.3.0
|
||||
;; Package-Requires: ((emacs "25.1") (all-the-icons "2.2.0") (shrink-path "0.2.0") (dash "2.11.0"))
|
||||
;; Version: 3.3.2
|
||||
;; Package-Requires: ((emacs "25.1") (compat "28.1.1.1") (shrink-path "0.2.0"))
|
||||
;; Keywords: faces mode-line
|
||||
|
||||
;; This file is not part of GNU Emacs.
|
||||
|
@ -89,71 +89,65 @@
|
|||
|
||||
(doom-modeline-def-modeline 'main
|
||||
'(bar workspace-name window-number modals matches follow buffer-info remote-host buffer-position word-count parrot selection-info)
|
||||
'(objed-state misc-info persp-name battery grip irc mu4e gnus github debug repl lsp minor-modes input-method indent-info buffer-encoding major-mode process vcs checker))
|
||||
'(objed-state misc-info persp-name battery grip irc mu4e gnus github debug repl lsp minor-modes input-method indent-info buffer-encoding major-mode process vcs checker time))
|
||||
|
||||
(doom-modeline-def-modeline 'minimal
|
||||
'(bar matches buffer-info-simple)
|
||||
'(media-info major-mode))
|
||||
'(media-info major-mode time))
|
||||
|
||||
(doom-modeline-def-modeline 'special
|
||||
'(bar window-number modals matches buffer-info buffer-position word-count parrot selection-info)
|
||||
'(objed-state misc-info battery irc-buffers debug minor-modes input-method indent-info buffer-encoding major-mode process))
|
||||
'(objed-state misc-info battery irc-buffers debug minor-modes input-method indent-info buffer-encoding major-mode process time))
|
||||
|
||||
(doom-modeline-def-modeline 'project
|
||||
'(bar window-number modals buffer-default-directory)
|
||||
'(misc-info battery irc mu4e gnus github debug minor-modes input-method major-mode process))
|
||||
'(misc-info battery irc mu4e gnus github debug minor-modes input-method major-mode process time))
|
||||
|
||||
(doom-modeline-def-modeline 'dashboard
|
||||
'(bar window-number buffer-default-directory-simple)
|
||||
'(misc-info battery irc mu4e gnus github debug minor-modes input-method major-mode process))
|
||||
'(misc-info battery irc mu4e gnus github debug minor-modes input-method major-mode process time))
|
||||
|
||||
(doom-modeline-def-modeline 'vcs
|
||||
'(bar window-number modals matches buffer-info buffer-position parrot selection-info)
|
||||
'(misc-info battery irc mu4e gnus github debug minor-modes buffer-encoding major-mode process))
|
||||
'(misc-info battery irc mu4e gnus github debug minor-modes buffer-encoding major-mode process time))
|
||||
|
||||
(doom-modeline-def-modeline 'package
|
||||
'(bar window-number package)
|
||||
'(misc-info major-mode process))
|
||||
'(misc-info major-mode process time))
|
||||
|
||||
(doom-modeline-def-modeline 'info
|
||||
'(bar window-number buffer-info info-nodes buffer-position parrot selection-info)
|
||||
'(misc-info buffer-encoding major-mode))
|
||||
'(misc-info buffer-encoding major-mode time))
|
||||
|
||||
(doom-modeline-def-modeline 'media
|
||||
'(bar window-number buffer-size buffer-info)
|
||||
'(misc-info media-info major-mode process vcs))
|
||||
'(misc-info media-info major-mode process vcs time))
|
||||
|
||||
(doom-modeline-def-modeline 'message
|
||||
'(bar window-number modals matches buffer-info-simple buffer-position word-count parrot selection-info)
|
||||
'(objed-state misc-info battery debug minor-modes input-method indent-info buffer-encoding major-mode))
|
||||
'(objed-state misc-info battery debug minor-modes input-method indent-info buffer-encoding major-mode time))
|
||||
|
||||
(doom-modeline-def-modeline 'pdf
|
||||
'(bar window-number matches buffer-info pdf-pages)
|
||||
'(misc-info major-mode process vcs))
|
||||
'(misc-info major-mode process vcs time))
|
||||
|
||||
(doom-modeline-def-modeline 'org-src
|
||||
'(bar window-number modals matches buffer-info-simple buffer-position word-count parrot selection-info)
|
||||
'(objed-state misc-info debug lsp minor-modes input-method indent-info buffer-encoding major-mode process checker))
|
||||
'(objed-state misc-info debug lsp minor-modes input-method indent-info buffer-encoding major-mode process checker time))
|
||||
|
||||
(doom-modeline-def-modeline 'helm
|
||||
'(bar helm-buffer-id helm-number helm-follow helm-prefix-argument)
|
||||
'(helm-help))
|
||||
'(helm-help time))
|
||||
|
||||
(doom-modeline-def-modeline 'timemachine
|
||||
'(bar window-number modals matches git-timemachine buffer-position word-count parrot selection-info)
|
||||
'(misc-info minor-modes indent-info buffer-encoding major-mode))
|
||||
'(misc-info minor-modes indent-info buffer-encoding major-mode time))
|
||||
|
||||
|
||||
;;
|
||||
;; Interfaces
|
||||
;;
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-modeline-init ()
|
||||
"Initialize doom mode-line."
|
||||
(doom-modeline-mode 1))
|
||||
(make-obsolete 'doom-modeline-init 'doom-modeline-mode "1.6.0")
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-modeline-set-main-modeline (&optional default)
|
||||
"Set main mode-line.
|
||||
|
@ -238,7 +232,7 @@ If DEFAULT is non-nil, set the default mode-line for all buffers."
|
|||
|
||||
;;;###autoload
|
||||
(define-minor-mode doom-modeline-mode
|
||||
"Toggle doom-modeline on or off."
|
||||
"Toggle `doom-modeline' on or off."
|
||||
:group 'doom-modeline
|
||||
:global t
|
||||
:lighter nil
|
|
@ -55,7 +55,7 @@ search.
|
|||
|
||||
\(fn SYMBOL &optional PATH-PREFIX)" t nil)
|
||||
|
||||
(register-definition-prefixes "elisp-refs" '("elisp-refs-"))
|
||||
(register-definition-prefixes "elisp-refs" '("elisp-"))
|
||||
|
||||
;;;***
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
;;; Generated package description from elisp-refs.el -*- no-byte-compile: t -*-
|
||||
(define-package "elisp-refs" "20220220.2305" "find callers of elisp functions or macros" '((dash "2.12.0") (s "1.11.0")) :commit "8f84280997d8b233d66fb9958a34b46078c58b03" :authors '(("Wilfred Hughes" . "me@wilfred.me.uk")) :maintainer '("Wilfred Hughes" . "me@wilfred.me.uk") :keywords '("lisp"))
|
||||
(define-package "elisp-refs" "20220704.2141" "find callers of elisp functions or macros" '((dash "2.12.0") (s "1.11.0")) :commit "af73739084637c8ebadad337a8fe58ff4f1d2ec1" :authors '(("Wilfred Hughes" . "me@wilfred.me.uk")) :maintainer '("Wilfred Hughes" . "me@wilfred.me.uk") :keywords '("lisp"))
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
;; Author: Wilfred Hughes <me@wilfred.me.uk>
|
||||
;; Version: 1.5
|
||||
;; Package-Version: 20220220.2305
|
||||
;; Package-Commit: 8f84280997d8b233d66fb9958a34b46078c58b03
|
||||
;; Package-Version: 20220704.2141
|
||||
;; Package-Commit: af73739084637c8ebadad337a8fe58ff4f1d2ec1
|
||||
;; Keywords: lisp
|
||||
;; Package-Requires: ((dash "2.12.0") (s "1.11.0"))
|
||||
|
||||
|
@ -787,8 +787,9 @@ search."
|
|||
(define-derived-mode elisp-refs-mode special-mode "Refs"
|
||||
"Major mode for refs results buffers.")
|
||||
|
||||
(defun elisp-refs-visit-match ()
|
||||
"Go to the search result at point."
|
||||
(defun elisp--refs-visit-match (open-fn)
|
||||
"Go to the search result at point.
|
||||
Open file with function OPEN_FN. `find-file` or `find-file-other-window`"
|
||||
(interactive)
|
||||
(let* ((path (get-text-property (point) 'elisp-refs-path))
|
||||
(pos (get-text-property (point) 'elisp-refs-start-pos))
|
||||
|
@ -805,7 +806,7 @@ search."
|
|||
(forward-line -1)
|
||||
(cl-incf line-offset)))
|
||||
|
||||
(find-file path)
|
||||
(funcall open-fn path)
|
||||
(goto-char pos)
|
||||
;; Move point so we're on the same char in the buffer that we were
|
||||
;; on in the results buffer.
|
||||
|
@ -819,6 +820,17 @@ search."
|
|||
(cl-incf i))
|
||||
(forward-char 1)))))
|
||||
|
||||
(defun elisp-refs-visit-match ()
|
||||
"Goto the search result at point."
|
||||
(interactive)
|
||||
(elisp--refs-visit-match #'find-file))
|
||||
|
||||
(defun elisp-refs-visit-match-other-window ()
|
||||
"Goto the search result at point, opening in another window."
|
||||
(interactive)
|
||||
(elisp--refs-visit-match #'find-file-other-window))
|
||||
|
||||
|
||||
(defun elisp-refs--move-to-match (direction)
|
||||
"Move point one match forwards.
|
||||
If DIRECTION is -1, moves backwards instead."
|
|
@ -1,2 +0,0 @@
|
|||
;;; Generated package description from f.el -*- no-byte-compile: t -*-
|
||||
(define-package "f" "20220405.1534" "Modern API for working with files and directories" '((s "1.7.0") (dash "2.2.0")) :commit "b5cb884b3b4372a6f3d1d4428cf092ca1e5c8044" :authors '(("Johan Andersson" . "johan.rejeep@gmail.com")) :maintainer '("Johan Andersson" . "johan.rejeep@gmail.com") :keywords '("files" "directories") :url "http://github.com/rejeep/f.el")
|
|
@ -11,6 +11,10 @@
|
|||
|
||||
(register-definition-prefixes "f" '("f-"))
|
||||
|
||||
;;;***
|
||||
|
||||
;;;### (autoloads nil nil ("f-pkg.el" "f-shortdoc.el") (0 0 0 0))
|
||||
|
||||
;;;***
|
||||
|
||||
;; Local Variables:
|
14
code/elpa/f-20220608.943/f-pkg.el
Normal file
14
code/elpa/f-20220608.943/f-pkg.el
Normal file
|
@ -0,0 +1,14 @@
|
|||
(define-package "f" "20220608.943" "Modern API for working with files and directories"
|
||||
'((emacs "24.1")
|
||||
(s "1.7.0")
|
||||
(dash "2.2.0"))
|
||||
:commit "d2019d4f9625bcc44349c69fe46d6645fd9ff4ff" :authors
|
||||
'(("Johan Andersson" . "johan.rejeep@gmail.com"))
|
||||
:maintainer
|
||||
'("Lucien Cartier-Tilet" . "lucien@phundrak.com")
|
||||
:keywords
|
||||
'("files" "directories")
|
||||
:url "http://github.com/rejeep/f.el")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
379
code/elpa/f-20220608.943/f-shortdoc.el
Normal file
379
code/elpa/f-20220608.943/f-shortdoc.el
Normal file
|
@ -0,0 +1,379 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; f-shortdoc.el --- Shortdoc for f.el -*- lexical-binding: t -*-
|
||||
|
||||
;; Author: Lucien Cartier-Tilet <lucien@phundrak.com>
|
||||
;; Maintainer: Lucien Cartier-Tilet <lucien@phundrak.com>
|
||||
;; Version: 0.1.0
|
||||
;; Package-Requires: ((emacs "28.1"))
|
||||
;; Homepage: https://github.com/rejeep/f.el
|
||||
|
||||
;; This file is not part of GNU Emacs
|
||||
|
||||
;; This program is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This 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:
|
||||
|
||||
;; Shortdoc implementation for f.el
|
||||
|
||||
;;; Code:
|
||||
|
||||
(when (version<= "28.1" emacs-version)
|
||||
(require 'shortdoc)
|
||||
|
||||
(define-short-documentation-group f
|
||||
"Paths"
|
||||
(f-join
|
||||
:eval (f-join "path")
|
||||
:eval (f-join "path" "to")
|
||||
:eval (f-join "/" "path" "to" "heaven")
|
||||
:eval (f-join "path" "/to" "file"))
|
||||
|
||||
(f-split
|
||||
:eval (f-split "path")
|
||||
:eval (f-split "path/to")
|
||||
:eval (f-split "/path/to/heaven")
|
||||
:eval (f-split "~/back/to/earth"))
|
||||
|
||||
(f-expand
|
||||
:no-eval (f-expand "name")
|
||||
:result-string "/default/directory/name"
|
||||
:no-eval (f-expand "name" "other/directory")
|
||||
:result-string "other/directory/name")
|
||||
|
||||
(f-filename
|
||||
:eval (f-filename "path/to/file.ext")
|
||||
:eval (f-filename "path/to/directory"))
|
||||
|
||||
(f-dirname
|
||||
:eval (f-dirname "path/to/file.ext")
|
||||
:eval (f-dirname "path/to/directory")
|
||||
:eval (f-dirname "/"))
|
||||
|
||||
(f-common-parent
|
||||
:eval (f-common-parent '("foo/bar/baz" "foo/bar/qux" "foo/bar/mux"))
|
||||
:eval (f-common-parent '("/foo/bar/baz" "/foo/bar/qux" "/foo/bax/mux"))
|
||||
:eval (f-common-parent '("foo/bar/baz" "quack/bar/qux" "lack/bar/mux")))
|
||||
|
||||
(f-ext
|
||||
:eval (f-ext "path/to/file")
|
||||
:eval (f-ext "path/to/file.txt")
|
||||
:eval (f-ext "path/to/file.txt.org"))
|
||||
|
||||
(f-no-ext
|
||||
:eval (f-no-ext "path/to/file")
|
||||
:eval (f-no-ext "path/to/file.txt")
|
||||
:eval (f-no-ext "path/to/file.txt.org"))
|
||||
|
||||
(f-swap-ext
|
||||
:eval (f-swap-ext "path/to/file.ext" "org"))
|
||||
|
||||
(f-base
|
||||
:eval (f-base "path/to/file.ext")
|
||||
:eval (f-base "path/to/directory"))
|
||||
|
||||
(f-relative
|
||||
:eval (f-relative "/some/path/relative/to/my/file.txt" "/some/path/")
|
||||
:eval (f-relative "/default/directory/my/file.txt"))
|
||||
|
||||
(f-short
|
||||
:no-eval (f-short "/Users/foo/Code/on/macOS")
|
||||
:result-string "~/Code/on/macOS"
|
||||
:no-eval (f-short "/home/foo/Code/on/linux")
|
||||
:result-string "~/Code/on/linux"
|
||||
:eval (f-short "/path/to/Code/bar"))
|
||||
|
||||
(f-long
|
||||
:eval (f-long "~/Code/bar")
|
||||
:eval (f-long "/path/to/Code/bar"))
|
||||
|
||||
(f-canonical
|
||||
:eval (f-canonical "/path/to/real/file")
|
||||
:no-eval (f-canonical "/link/to/file")
|
||||
:result-string "/path/to/real/file")
|
||||
|
||||
(f-slash
|
||||
:no-eval (f-slash "/path/to/file")
|
||||
:result-string "/path/to/file"
|
||||
:no-eval (f-slash "/path/to/dir")
|
||||
:result-string "/path/to/dir/"
|
||||
:no-eval (f-slash "/path/to/dir/")
|
||||
:result-string "/path/to/dir/")
|
||||
|
||||
(f-full
|
||||
:eval (f-full "~/path/to/file")
|
||||
:eval (f-full "~/path/to/dir")
|
||||
:eval (f-full "~/path/to/dir/"))
|
||||
|
||||
(f-uniquify
|
||||
:eval (f-uniquify '("/foo/bar" "/foo/baz" "/foo/quux"))
|
||||
:eval (f-uniquify '("/foo/bar" "/www/bar" "/foo/quux"))
|
||||
:eval (f-uniquify '("/foo/bar" "/www/bar" "/www/bar/quux"))
|
||||
:eval (f-uniquify '("/foo/bar" "/foo/baz" "/home/www/bar" "/home/www/baz" "/var/foo" "/opt/foo/www/baz")))
|
||||
|
||||
(f-uniquify-alist
|
||||
:eval (f-uniquify-alist '("/foo/bar" "/foo/baz" "/foo/quux"))
|
||||
:eval (f-uniquify-alist '("/foo/bar" "/www/bar" "/foo/quux"))
|
||||
:eval (f-uniquify-alist '("/foo/bar" "/www/bar" "/www/bar/quux"))
|
||||
:eval (f-uniquify-alist '("/foo/bar" "/foo/baz" "/home/www/bar" "/home/www/baz" "/var/foo" "/opt/foo/www/baz")))
|
||||
|
||||
"I/O"
|
||||
(f-read-bytes
|
||||
:no-eval* (f-read-bytes "path/to/binary/data"))
|
||||
|
||||
(f-write-bytes
|
||||
:no-eval* (f-write-bytes (unibyte-string 72 101 108 108 111 32 119 111 114 108 100) "path/to/binary/data"))
|
||||
|
||||
(f-append-bytes
|
||||
:no-eval* (f-append-bytes "path/to/file" (unibyte-string 72 101 108 108 111 32 119 111 114 108 100)))
|
||||
|
||||
(f-read-text
|
||||
:no-eval* (f-read-text "path/to/file.txt" 'utf-8)
|
||||
:no-eval* (f-read "path/to/file.txt" 'utf-8))
|
||||
|
||||
(f-write-text
|
||||
:no-eval* (f-write-text "Hello world" 'utf-8 "path/to/file.txt")
|
||||
:no-eval* (f-write "Hello world" 'utf-8 "path/to/file.txt"))
|
||||
|
||||
(f-append-text
|
||||
:no-eval* (f-append-text "Hello world" 'utf-8 "path/to/file.txt")
|
||||
:no-eval* (f-append "Hello world" 'utf-8 "path/to/file.txt"))
|
||||
|
||||
"Destructive"
|
||||
(f-mkdir
|
||||
:no-eval (f-mkdir "dir")
|
||||
:result-string "creates /default/directory/dir"
|
||||
:no-eval (f-mkdir "other" "dir")
|
||||
:result-string "creates /default/directory/other/dir"
|
||||
:no-eval (f-mkdir "/" "some" "path")
|
||||
:result-string "creates /some/path"
|
||||
:no-eval (f-mkdir "~" "yet" "another" "dir")
|
||||
:result-string "creates ~/yet/another/dir")
|
||||
|
||||
(f-mkdir-full-path
|
||||
:no-eval (f-mkdir-full-path "dir")
|
||||
:result-string "creates /default/directory/dir"
|
||||
:no-eval (f-mkdir-full-path "other/dir")
|
||||
:result-string "creates /default/directory/other/dir"
|
||||
:no-eval (f-mkdir-full-path "/some/path")
|
||||
:result-string "creates /some/path"
|
||||
:no-eval (f-mkdir-full-path "~/yet/another/dir")
|
||||
:result-string "creates ~/yet/another/dir")
|
||||
|
||||
(f-delete
|
||||
:no-eval* (f-delete "dir")
|
||||
:no-eval* (f-delete "other/dir" t)
|
||||
:no-eval* (f-delete "path/to/file.txt"))
|
||||
|
||||
(f-symlink
|
||||
:no-eval* (f-symlink "path/to/source" "path/to/link"))
|
||||
|
||||
(f-move
|
||||
:no-eval* (f-move "path/to/file.txt" "new-file.txt")
|
||||
:no-eval* (f-move "path/to/file.txt" "other/path"))
|
||||
|
||||
(f-copy
|
||||
:no-eval* (f-copy "path/to/file.txt" "new-file.txt")
|
||||
:no-eval* (f-copy "path/to/dir" "other/dir"))
|
||||
|
||||
(f-copy-contents
|
||||
:no-eval* (f-copy-contents "path/to/dir" "path/to/other/dir"))
|
||||
|
||||
(f-touch
|
||||
:no-eval* (f-touch "path/to/existing/file.txt")
|
||||
:no-eval* (f-touch "path/to/non/existing/file.txt"))
|
||||
|
||||
"Predicates"
|
||||
(f-exists-p
|
||||
:no-eval* (f-exists-p "path/to/file.txt")
|
||||
:no-eval* (f-exists-p "path/to/dir"))
|
||||
|
||||
(f-directory-p
|
||||
:no-eval* (f-directory-p "path/to/file.txt")
|
||||
:no-eval* (f-directory-p "path/to/dir"))
|
||||
|
||||
(f-file-p
|
||||
:no-eval* (f-file-p "path/to/file.txt")
|
||||
:no-eval* (f-file-p "path/to/dir"))
|
||||
|
||||
(f-symlink-p
|
||||
:no-eval* (f-symlink-p "path/to/file.txt")
|
||||
:no-eval* (f-symlink-p "path/to/dir")
|
||||
:no-eval* (f-symlink-p "path/to/link"))
|
||||
|
||||
(f-readable-p
|
||||
:no-eval* (f-readable-p "path/to/file.txt")
|
||||
:no-eval* (f-readable-p "path/to/dir"))
|
||||
|
||||
(f-writable-p
|
||||
:no-eval* (f-writable-p "path/to/file.txt")
|
||||
:no-eval* (f-writable-p "path/to/dir"))
|
||||
|
||||
(f-executable-p
|
||||
:no-eval* (f-executable-p "path/to/file.txt")
|
||||
:no-eval* (f-executable-p "path/to/dir"))
|
||||
|
||||
(f-absolute-p
|
||||
:eval (f-absolute-p "path/to/dir")
|
||||
:eval (f-absolute-p "/full/path/to/dir"))
|
||||
|
||||
(f-relative-p
|
||||
:eval (f-relative-p "path/to/dir")
|
||||
:eval (f-relative-p "/full/path/to/dir"))
|
||||
|
||||
(f-root-p
|
||||
:eval (f-root-p "/")
|
||||
:eval (f-root-p "/not/root"))
|
||||
|
||||
(f-ext-p
|
||||
:eval (f-ext-p "path/to/file.el" "el")
|
||||
:eval (f-ext-p "path/to/file.el" "txt")
|
||||
:eval (f-ext-p "path/to/file.el")
|
||||
:eval (f-ext-p "path/to/file"))
|
||||
|
||||
(f-same-p
|
||||
:eval (f-same-p "foo.txt" "foo.txt")
|
||||
:eval (f-same-p "foo/bar/../baz" "foo/baz")
|
||||
:eval (f-same-p "/path/to/foo.txt" "/path/to/bar.txt"))
|
||||
|
||||
(f-parent-of-p
|
||||
:no-eval (f-parent-of-p "/path/to" "/path/to/dir")
|
||||
:result t
|
||||
:no-eval (f-parent-of-p "/path/to/dir" "/path/to")
|
||||
:result nil
|
||||
:no-eval (f-parent-of-p "/path/to" "/path/to")
|
||||
:result nil)
|
||||
|
||||
(f-child-of-p
|
||||
:no-eval (f-child-of-p "/path/to" "/path/to/dir")
|
||||
:result nil
|
||||
:no-eval (f-child-of-p "/path/to/dir" "/path/to")
|
||||
:result t
|
||||
:no-eval (f-child-of-p "/path/to" "/path/to")
|
||||
:result nil)
|
||||
|
||||
(f-ancestor-of-p
|
||||
:no-eval (f-ancestor-of-p "/path/to" "/path/to/dir")
|
||||
:result t
|
||||
:no-eval (f-ancestor-of-p "/path" "/path/to/dir")
|
||||
:result t
|
||||
:no-eval (f-ancestor-of-p "/path/to/dir" "/path/to")
|
||||
:result nil
|
||||
:no-eval (f-ancestor-of-p "/path/to" "/path/to")
|
||||
:result nil)
|
||||
|
||||
(f-descendant-of-p
|
||||
:no-eval (f-descendant-of-p "/path/to/dir" "/path/to")
|
||||
:result t
|
||||
:no-eval (f-descendant-of-p "/path/to/dir" "/path")
|
||||
:result t
|
||||
:no-eval (f-descendant-of-p "/path/to" "/path/to/dir")
|
||||
:result nil
|
||||
:no-eval (f-descendant-of-p "/path/to" "/path/to")
|
||||
:result nil)
|
||||
|
||||
(f-hidden-p
|
||||
:no-eval (f-hidden-p "/path/to/foo")
|
||||
:result nil
|
||||
:no-eval (f-hidden-p "/path/to/.foo")
|
||||
:result t)
|
||||
|
||||
(f-empty-p
|
||||
:no-eval (f-empty-p "/path/to/empty-file")
|
||||
:result t
|
||||
:no-eval (f-empty-p "/path/to/file-with-contents")
|
||||
:result nil
|
||||
:no-eval (f-empty-p "/path/to/empty-dir/")
|
||||
:result t
|
||||
:no-eval (f-empty-p "/path/to/dir-with-contents/")
|
||||
:result nil)
|
||||
|
||||
"Stats"
|
||||
(f-size
|
||||
:no-eval* (f-size "path/to/file.txt")
|
||||
:no-eval* (f-size "path/to/dir"))
|
||||
|
||||
(f-depth
|
||||
:eval (f-depth "/")
|
||||
:eval (f-depth "/var/")
|
||||
:eval (f-depth "/usr/local/bin"))
|
||||
|
||||
(f-change-time
|
||||
:no-eval* (f-change-time "path/to/file.txt")
|
||||
:no-eval* (f-change-time "path/to/dir"))
|
||||
|
||||
(f-modification-time
|
||||
:no-eval* (f-modification-time "path/to/file.txt")
|
||||
:no-eval* (f-modification-time "path/to/dir"))
|
||||
|
||||
(f-access-time
|
||||
:no-eval* (f-access-time "path/to/file.txt")
|
||||
:no-eval* (f-access-time "path/to/dir"))
|
||||
|
||||
"Misc"
|
||||
(f-this-file
|
||||
:no-eval* (f-this-file))
|
||||
|
||||
(f-path-separator
|
||||
:eval (f-path-separator))
|
||||
|
||||
(f-glob
|
||||
:noeval* (f-glob "path/to/*.el")
|
||||
:noeval* (f-glob "*.el" "path/to"))
|
||||
|
||||
(f-entries
|
||||
:no-eval* (f-entries "path/to/dir")
|
||||
:no-eval* (f-entries "path/to/dir" (lambda (file) (s-matches? "test" file)))
|
||||
:no-eval* (f-entries "path/to/dir" nil t)
|
||||
:no-eval* (f--entries "path/to/dir" (s-matches? "test" it)))
|
||||
|
||||
(f-directories
|
||||
:no-eval* (f-directories "path/to/dir")
|
||||
:no-eval* (f-directories "path/to/dir" (lambda (dir) (equal (f-filename dir) "test")))
|
||||
:no-eval* (f-directories "path/to/dir" nil t)
|
||||
:no-eval* (f--directories "path/to/dir" (equal (f-filename it) "test")))
|
||||
|
||||
(f-files
|
||||
:no-eval* (f-files "path/to/dir")
|
||||
:no-eval* (f-files "path/to/dir" (lambda (file) (equal (f-ext file) "el")))
|
||||
:no-eval* (f-files "path/to/dir" nil t)
|
||||
:no-eval* (f--files "path/to/dir" (equal (f-ext it) "el")))
|
||||
|
||||
(f-root
|
||||
:eval (f-root))
|
||||
|
||||
(f-traverse-upwards
|
||||
:no-eval* (f-traverse-upwards
|
||||
(lambda (path)
|
||||
(f-exists? (f-expand ".git" path)))
|
||||
start-path)
|
||||
|
||||
:no-eval* (f--traverse-upwards (f-exists? (f-expand ".git" it)) start-path))
|
||||
|
||||
(f-with-sandbox
|
||||
:no-eval (f-with-sandbox foo-path
|
||||
(f-touch (f-expand "foo" foo-path)))
|
||||
:no-eval (f-with-sandbox (list foo-path bar-path)
|
||||
(f-touch (f-expand "foo" foo-path))
|
||||
(f-touch (f-expand "bar" bar-path)))
|
||||
:no-eval (f-with-sandbox foo-path
|
||||
(f-touch (f-expand "bar" bar-path)))))) ;; "Destructive operation outside sandbox"
|
||||
|
||||
(eval-when-compile
|
||||
(when (version< emacs-version "28.1")
|
||||
(warn "Emacs should not be compiling this file")))
|
||||
|
||||
(provide 'f-shortdoc)
|
||||
|
||||
;;; f-shortdoc.el ends here
|
|
@ -3,13 +3,11 @@
|
|||
;; Copyright (C) 2013 Johan Andersson
|
||||
|
||||
;; Author: Johan Andersson <johan.rejeep@gmail.com>
|
||||
;; Maintainer: Johan Andersson <johan.rejeep@gmail.com>
|
||||
;; Maintainer: Lucien Cartier-Tilet <lucien@phundrak.com>
|
||||
;; Version: 0.20.0
|
||||
;; Package-Version: 20220405.1534
|
||||
;; Package-Commit: b5cb884b3b4372a6f3d1d4428cf092ca1e5c8044
|
||||
;; Package-Requires: ((emacs "24.1") (s "1.7.0") (dash "2.2.0"))
|
||||
;; Keywords: files, directories
|
||||
;; URL: http://github.com/rejeep/f.el
|
||||
;; Package-Requires: ((s "1.7.0") (dash "2.2.0"))
|
||||
;; Homepage: http://github.com/rejeep/f.el
|
||||
|
||||
;; This file is NOT part of GNU Emacs.
|
||||
|
||||
|
@ -36,6 +34,8 @@
|
|||
|
||||
(require 's)
|
||||
(require 'dash)
|
||||
(when (version<= "28.1" emacs-version)
|
||||
(require 'f-shortdoc))
|
||||
|
||||
(put 'f-guard-error 'error-conditions '(error f-guard-error))
|
||||
(put 'f-guard-error 'error-message "Destructive operation outside sandbox")
|
||||
|
@ -51,8 +51,8 @@ Do not modify this variable.")
|
|||
If PATH is not allowed to be modified, throw error."
|
||||
(declare (indent 1))
|
||||
`(if f--guard-paths
|
||||
(if (--any? (or (f-same? it ,path)
|
||||
(f-ancestor-of? it ,path)) f--guard-paths)
|
||||
(if (--any? (or (f-same-p it ,path)
|
||||
(f-ancestor-of-p it ,path)) f--guard-paths)
|
||||
(progn ,@body)
|
||||
(signal 'f-guard-error (list ,path f--guard-paths)))
|
||||
,@body))
|
||||
|
@ -61,18 +61,28 @@ If PATH is not allowed to be modified, throw error."
|
|||
;;;; Paths
|
||||
|
||||
(defun f-join (&rest args)
|
||||
"Join ARGS to a single path."
|
||||
(let (path (relative (f-relative? (car args))))
|
||||
"Join ARGS to a single path.
|
||||
|
||||
Be aware if one of the arguments is an absolute path, `f-join'
|
||||
will discard all the preceeding arguments and make this absolute
|
||||
path the new root of the generated path."
|
||||
(let (path
|
||||
(relative (f-relative-p (car args))))
|
||||
(-map
|
||||
(lambda (arg)
|
||||
(setq path (f-expand arg path)))
|
||||
(setq path (cond ((not path) arg)
|
||||
((f-absolute-p arg)
|
||||
(progn
|
||||
(setq relative nil)
|
||||
arg))
|
||||
(t (f-expand arg path)))))
|
||||
args)
|
||||
(if relative (f-relative path) path)))
|
||||
|
||||
(defun f-split (path)
|
||||
"Split PATH and return list containing parts."
|
||||
(let ((parts (s-split (f-path-separator) path 'omit-nulls)))
|
||||
(if (f-absolute? path)
|
||||
(let ((parts (split-string path (f-path-separator) 'omit-nulls)))
|
||||
(if (string= (s-left 1 path) (f-path-separator))
|
||||
(push (f-path-separator) parts)
|
||||
parts)))
|
||||
|
||||
|
@ -90,12 +100,13 @@ ignored."
|
|||
(file-name-nondirectory (directory-file-name path)))
|
||||
|
||||
(defalias 'f-parent 'f-dirname)
|
||||
|
||||
(defun f-dirname (path)
|
||||
"Return the parent directory to PATH."
|
||||
(let ((parent (file-name-directory
|
||||
(directory-file-name (f-expand path default-directory)))))
|
||||
(unless (f-same? path parent)
|
||||
(if (f-relative? path)
|
||||
(unless (f-same-p path parent)
|
||||
(if (f-relative-p path)
|
||||
(f-relative parent)
|
||||
(directory-file-name parent)))))
|
||||
|
||||
|
@ -114,7 +125,7 @@ ignored."
|
|||
(setq common (caar paths)))
|
||||
(cond
|
||||
((null re) "")
|
||||
((and (= (length re) 1) (f-root? (car re)))
|
||||
((and (= (length re) 1) (f-root-p (car re)))
|
||||
(f-root))
|
||||
(:otherwise
|
||||
(concat (apply 'f-join (nreverse re)) "/")))))))
|
||||
|
@ -126,7 +137,7 @@ ignored."
|
|||
(defun f-swap-ext (path ext)
|
||||
"Return PATH but with EXT as the new extension.
|
||||
EXT must not be nil or empty."
|
||||
(if (s-blank? ext)
|
||||
(if (s-blank-p ext)
|
||||
(error "Extension cannot be empty or nil")
|
||||
(concat (f-no-ext path) "." ext)))
|
||||
|
||||
|
@ -150,7 +161,7 @@ EXT must not be nil or empty."
|
|||
|
||||
Some functions, such as `call-process' requires there to be an
|
||||
ending slash."
|
||||
(if (f-dir? path)
|
||||
(if (f-dir-p path)
|
||||
(file-name-as-directory path)
|
||||
path))
|
||||
|
||||
|
@ -263,21 +274,38 @@ If APPEND is non-nil, append the DATA to the existing contents."
|
|||
;;;; Destructive
|
||||
|
||||
(defun f-mkdir (&rest dirs)
|
||||
"Create directories DIRS."
|
||||
"Create directories DIRS.
|
||||
|
||||
DIRS should be a successive list of directories forming together
|
||||
a full path. The easiest way to call this function with a fully
|
||||
formed path is using `f-split' alongside it:
|
||||
|
||||
(apply #'f-mkdir (f-split \"path/to/file\"))
|
||||
|
||||
Although it works sometimes, it is not recommended to use fully
|
||||
formed paths in the function. In this case, it is recommended to
|
||||
use `f-mkdir-full-path' instead."
|
||||
(let (path)
|
||||
(-each
|
||||
dirs
|
||||
(lambda (dir)
|
||||
(setq path (f-expand dir path))
|
||||
(unless (f-directory? path)
|
||||
(unless (f-directory-p path)
|
||||
(f--destructive path (make-directory path)))))))
|
||||
|
||||
(defun f-mkdir-full-path (dir)
|
||||
"Create DIR from a full path.
|
||||
|
||||
This function is similar to `f-mkdir' except it can accept a full
|
||||
path instead of requiring several successive directory names."
|
||||
(apply #'f-mkdir (f-split dir)))
|
||||
|
||||
(defun f-delete (path &optional force)
|
||||
"Delete PATH, which can be file or directory.
|
||||
|
||||
If FORCE is t, a directory will be deleted recursively."
|
||||
(f--destructive path
|
||||
(if (or (f-file? path) (f-symlink? path))
|
||||
(if (or (f-file-p path) (f-symlink-p path))
|
||||
(delete-file path)
|
||||
(delete-directory path force))))
|
||||
|
||||
|
@ -295,7 +323,7 @@ If TO is a directory name, move FROM into TO."
|
|||
If FROM names a directory and TO is a directory name, copy FROM
|
||||
into TO as a subdirectory."
|
||||
(f--destructive to
|
||||
(if (f-file? from)
|
||||
(if (f-file-p from)
|
||||
(copy-file from to)
|
||||
;; The behavior of `copy-directory' differs between Emacs 23 and
|
||||
;; 24 in that in Emacs 23, the contents of `from' is copied to
|
||||
|
@ -303,7 +331,7 @@ into TO as a subdirectory."
|
|||
;; `to'. We want the Emacs 24 behavior.
|
||||
(if (> emacs-major-version 23)
|
||||
(copy-directory from to)
|
||||
(if (f-dir? to)
|
||||
(if (f-dir-p to)
|
||||
(progn
|
||||
(apply 'f-mkdir (f-split to))
|
||||
(let ((new-to (f-expand (f-filename from) to)))
|
||||
|
@ -312,9 +340,9 @@ into TO as a subdirectory."
|
|||
|
||||
(defun f-copy-contents (from to)
|
||||
"Copy contents in directory FROM, to directory TO."
|
||||
(unless (f-exists? to)
|
||||
(unless (f-exists-p to)
|
||||
(error "Cannot copy contents to non existing directory %s" to))
|
||||
(unless (f-dir? from)
|
||||
(unless (f-dir-p from)
|
||||
(error "Cannot copy contents as %s is a file" from))
|
||||
(--each (f-entries from)
|
||||
(f-copy it (file-name-as-directory to))))
|
||||
|
@ -322,56 +350,56 @@ into TO as a subdirectory."
|
|||
(defun f-touch (path)
|
||||
"Update PATH last modification date or create if it does not exist."
|
||||
(f--destructive path
|
||||
(if (f-file? path)
|
||||
(if (f-file-p path)
|
||||
(set-file-times path)
|
||||
(f-write-bytes "" path))))
|
||||
|
||||
|
||||
;;;; Predicates
|
||||
|
||||
(defalias 'f-exists? 'file-exists-p)
|
||||
(defalias 'f-exists-p 'file-exists-p)
|
||||
(defalias 'f-exists? 'file-exists-p)
|
||||
|
||||
(defalias 'f-directory? 'file-directory-p)
|
||||
(defalias 'f-directory-p 'file-directory-p)
|
||||
(defalias 'f-dir? 'file-directory-p)
|
||||
(defalias 'f-directory? 'file-directory-p)
|
||||
(defalias 'f-dir-p 'file-directory-p)
|
||||
(defalias 'f-dir? 'file-directory-p)
|
||||
|
||||
|
||||
(defalias 'f-file? 'file-regular-p)
|
||||
(defalias 'f-file-p 'file-regular-p)
|
||||
(defalias 'f-file? 'file-regular-p)
|
||||
|
||||
(defun f-symlink? (path)
|
||||
(defun f-symlink-p (path)
|
||||
"Return t if PATH is symlink, false otherwise."
|
||||
(not (not (file-symlink-p path))))
|
||||
|
||||
(defalias 'f-symlink-p 'f-symlink?)
|
||||
(defalias 'f-symlink? 'f-symlink-p)
|
||||
|
||||
(defalias 'f-readable? 'file-readable-p)
|
||||
(defalias 'f-readable-p 'file-readable-p)
|
||||
(defalias 'f-readable? 'file-readable-p)
|
||||
|
||||
(defalias 'f-writable? 'file-writable-p)
|
||||
(defalias 'f-writable-p 'file-writable-p)
|
||||
(defalias 'f-writable? 'file-writable-p)
|
||||
|
||||
(defalias 'f-executable-p 'file-executable-p)
|
||||
(defalias 'f-executable? 'file-executable-p)
|
||||
(defalias 'f-executable-p 'f-executable?)
|
||||
|
||||
(defalias 'f-absolute? 'file-name-absolute-p)
|
||||
(defalias 'f-absolute-p 'file-name-absolute-p)
|
||||
(defalias 'f-absolute? 'file-name-absolute-p)
|
||||
|
||||
(defun f-relative? (path)
|
||||
(defun f-relative-p (path)
|
||||
"Return t if PATH is relative, false otherwise."
|
||||
(not (f-absolute? path)))
|
||||
(not (f-absolute-p path)))
|
||||
|
||||
(defalias 'f-relative-p 'f-relative?)
|
||||
(defalias 'f-relative? 'f-relative-p)
|
||||
|
||||
(defun f-root? (path)
|
||||
(defun f-root-p (path)
|
||||
"Return t if PATH is root directory, false otherwise."
|
||||
(not (f-parent path)))
|
||||
|
||||
(defalias 'f-root-p 'f-root?)
|
||||
(defalias 'f-root? 'f-root-p)
|
||||
|
||||
(defun f-ext? (path &optional ext)
|
||||
(defun f-ext-p (path &optional ext)
|
||||
"Return t if extension of PATH is EXT, false otherwise.
|
||||
|
||||
If EXT is nil or omitted, return t if PATH has any extension,
|
||||
|
@ -383,67 +411,65 @@ The extension, in a file name, is the part that follows the last
|
|||
(string= (f-ext path) ext)
|
||||
(not (eq (f-ext path) nil))))
|
||||
|
||||
(defalias 'f-ext-p 'f-ext?)
|
||||
(defalias 'f-ext? 'f-ext-p)
|
||||
|
||||
(defalias 'f-equal? 'f-same?)
|
||||
(defalias 'f-equal-p 'f-equal?)
|
||||
(defalias 'f-equal-p 'f-same-p)
|
||||
(defalias 'f-equal? 'f-same-p)
|
||||
|
||||
(defun f-same? (path-a path-b)
|
||||
(defun f-same-p (path-a path-b)
|
||||
"Return t if PATH-A and PATH-B are references to same file."
|
||||
(when (and (f-exists? path-a)
|
||||
(f-exists? path-b))
|
||||
(equal
|
||||
(f-canonical (directory-file-name (f-expand path-a)))
|
||||
(f-canonical (directory-file-name (f-expand path-b))))))
|
||||
(f-canonical (directory-file-name (f-expand path-b)))))
|
||||
|
||||
(defalias 'f-same-p 'f-same?)
|
||||
(defalias 'f-same? 'f-same-p)
|
||||
|
||||
(defun f-parent-of? (path-a path-b)
|
||||
(defun f-parent-of-p (path-a path-b)
|
||||
"Return t if PATH-A is parent of PATH-B."
|
||||
(--when-let (f-parent path-b)
|
||||
(f-same? path-a it)))
|
||||
(f-same-p path-a it)))
|
||||
|
||||
(defalias 'f-parent-of-p 'f-parent-of?)
|
||||
(defalias 'f-parent-of? 'f-parent-of-p)
|
||||
|
||||
(defun f-child-of? (path-a path-b)
|
||||
(defun f-child-of-p (path-a path-b)
|
||||
"Return t if PATH-A is child of PATH-B."
|
||||
(--when-let (f-parent path-a)
|
||||
(f-same? it path-b)))
|
||||
(f-same-p it path-b)))
|
||||
|
||||
(defalias 'f-child-of-p 'f-child-of?)
|
||||
(defalias 'f-child-of? 'f-child-of-p)
|
||||
|
||||
(defun f-ancestor-of? (path-a path-b)
|
||||
(defun f-ancestor-of-p (path-a path-b)
|
||||
"Return t if PATH-A is ancestor of PATH-B."
|
||||
(unless (f-same? path-a path-b)
|
||||
(s-starts-with? (f-full path-a)
|
||||
(unless (f-same-p path-a path-b)
|
||||
(string-prefix-p (f-full path-a)
|
||||
(f-full path-b))))
|
||||
|
||||
(defalias 'f-ancestor-of-p 'f-ancestor-of?)
|
||||
(defalias 'f-ancestor-of? 'f-ancestor-of-p)
|
||||
|
||||
(defun f-descendant-of? (path-a path-b)
|
||||
(defun f-descendant-of-p (path-a path-b)
|
||||
"Return t if PATH-A is desendant of PATH-B."
|
||||
(unless (f-same? path-a path-b)
|
||||
(s-starts-with? (f-full path-b)
|
||||
(unless (f-same-p path-a path-b)
|
||||
(string-prefix-p (f-full path-b)
|
||||
(f-full path-a))))
|
||||
|
||||
(defalias 'f-descendant-of-p 'f-descendant-of?)
|
||||
(defalias 'f-descendant-of? 'f-descendant-of-p)
|
||||
|
||||
(defun f-hidden? (path)
|
||||
(defun f-hidden-p (path)
|
||||
"Return t if PATH is hidden, nil otherwise."
|
||||
(unless (f-exists? path)
|
||||
(unless (f-exists-p path)
|
||||
(error "Path does not exist: %s" path))
|
||||
(string= (substring path 0 1) "."))
|
||||
|
||||
(defalias 'f-hidden-p 'f-hidden?)
|
||||
(defalias 'f-hidden? 'f-hidden-p)
|
||||
|
||||
(defun f-empty? (path)
|
||||
(defun f-empty-p (path)
|
||||
"If PATH is a file, return t if the file in PATH is empty, nil otherwise.
|
||||
If PATH is directory, return t if directory has no files, nil otherwise."
|
||||
(if (f-directory? path)
|
||||
(if (f-directory-p path)
|
||||
(equal (f-files path nil t) nil)
|
||||
(= (f-size path) 0)))
|
||||
|
||||
(defalias 'f-empty-p 'f-empty?)
|
||||
(defalias 'f-empty? 'f-empty-p)
|
||||
|
||||
|
||||
;;;; Stats
|
||||
|
@ -453,7 +479,7 @@ If PATH is directory, return t if directory has no files, nil otherwise."
|
|||
|
||||
If PATH is a file, return size of that file. If PATH is
|
||||
directory, return sum of all files in PATH."
|
||||
(if (f-directory? path)
|
||||
(if (f-directory-p path)
|
||||
(-sum (-map 'f-size (f-files path nil t)))
|
||||
(nth 7 (file-attributes path))))
|
||||
|
||||
|
@ -465,6 +491,27 @@ detect the depth.
|
|||
'/' will be zero depth, '/usr' will be one depth. And so on."
|
||||
(- (length (f-split (f-expand path))) 1))
|
||||
|
||||
(defun f-change-time (path)
|
||||
"Return the last status change time of PATH.
|
||||
|
||||
The status change time (ctime) of PATH in the same format as
|
||||
`current-time'. See `file-attributes' for technical details."
|
||||
(nth 6 (file-attributes path)))
|
||||
|
||||
(defun f-modification-time (path)
|
||||
"Return the last modification time of PATH.
|
||||
|
||||
The modification time (mtime) of PATH in the same format as
|
||||
`current-time'. See `file-attributes' for technical details."
|
||||
(nth 5 (file-attributes path)))
|
||||
|
||||
(defun f-access-time (path)
|
||||
"Return the last access time of PATH.
|
||||
|
||||
The access time (atime) of PATH is in the same format as
|
||||
`current-time'. See `file-attributes' for technical details."
|
||||
(nth 4 (file-attributes path)))
|
||||
|
||||
|
||||
;;;; Misc
|
||||
|
||||
|
@ -494,18 +541,18 @@ detect the depth.
|
|||
(entries
|
||||
(-reject
|
||||
(lambda (file)
|
||||
(or
|
||||
(equal (f-filename file) ".")
|
||||
(equal (f-filename file) "..")))
|
||||
(member (f-filename file) '("." "..")))
|
||||
(directory-files path t))))
|
||||
(cond (recursive
|
||||
(-map
|
||||
(lambda (entry)
|
||||
(if (f-file? entry)
|
||||
(if (f-file-p entry)
|
||||
(setq result (cons entry result))
|
||||
(when (f-directory? entry)
|
||||
(when (f-directory-p entry)
|
||||
(setq result (cons entry result))
|
||||
(setq result (append result (f--collect-entries entry recursive))))))
|
||||
(if (f-readable-p entry)
|
||||
(setq result (append result (f--collect-entries entry recursive)))
|
||||
result))))
|
||||
entries))
|
||||
(t (setq result entries)))
|
||||
result))
|
||||
|
@ -539,7 +586,7 @@ RECURSIVE - Search for files and directories recursive."
|
|||
|
||||
(defun f-directories (path &optional fn recursive)
|
||||
"Find all directories in PATH. See `f-entries'."
|
||||
(let ((directories (-select 'f-directory? (f--collect-entries path recursive))))
|
||||
(let ((directories (-select 'f-directory-p (f--collect-entries path recursive))))
|
||||
(if fn (-select fn directories) directories)))
|
||||
|
||||
(defmacro f--files (path body &optional recursive)
|
||||
|
@ -553,7 +600,7 @@ RECURSIVE - Search for files and directories recursive."
|
|||
|
||||
(defun f-files (path &optional fn recursive)
|
||||
"Find all files in PATH. See `f-entries'."
|
||||
(let ((files (-select 'f-file? (f--collect-entries path recursive))))
|
||||
(let ((files (-select 'f-file-p (f--collect-entries path recursive))))
|
||||
(if fn (-select fn files) files)))
|
||||
|
||||
(defmacro f--traverse-upwards (body &optional path)
|
||||
|
@ -572,16 +619,16 @@ returned. If no function callback return a non-nil value, nil is
|
|||
returned."
|
||||
(unless path
|
||||
(setq path default-directory))
|
||||
(when (f-relative? path)
|
||||
(when (f-relative-p path)
|
||||
(setq path (f-expand path)))
|
||||
(if (funcall fn path)
|
||||
path
|
||||
(unless (f-root? path)
|
||||
(unless (f-root-p path)
|
||||
(f-traverse-upwards fn (f-parent path)))))
|
||||
|
||||
(defun f-root ()
|
||||
"Return absolute root."
|
||||
(f-traverse-upwards 'f-root?))
|
||||
(f-traverse-upwards 'f-root-p))
|
||||
|
||||
(defmacro f-with-sandbox (path-or-paths &rest body)
|
||||
"Only allow PATH-OR-PATHS and descendants to be modified in BODY."
|
|
@ -1,9 +1,9 @@
|
|||
(define-package "git-commit" "20220422.1903" "Edit Git commit messages."
|
||||
(define-package "git-commit" "20220803.2341" "Edit Git commit messages."
|
||||
'((emacs "25.1")
|
||||
(compat "28.1.0.4")
|
||||
(compat "28.1.1.2")
|
||||
(transient "20210920")
|
||||
(with-editor "20211001"))
|
||||
:commit "3cb7f5ba430906bded9e5d9951f5260ab25644d0" :authors
|
||||
:commit "ac7fae6a9893b55ad01942d9ea5a571d44426665" :authors
|
||||
'(("Jonas Bernoulli" . "jonas@bernoul.li")
|
||||
("Sebastian Wiesner" . "lunaryorn@gmail.com")
|
||||
("Florian Ragwitz" . "rafl@debian.org")
|
|
@ -1,4 +1,4 @@
|
|||
;;; git-commit.el --- Edit Git commit messages -*- lexical-binding:t -*-
|
||||
;;; git-commit.el --- Edit Git commit messages -*- lexical-binding:t; coding:utf-8 -*-
|
||||
|
||||
;; Copyright (C) 2008-2022 The Magit Project Contributors
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
|||
;; Package-Version: 3.3.0-git
|
||||
;; Package-Requires: (
|
||||
;; (emacs "25.1")
|
||||
;; (compat "28.1.0.4")
|
||||
;; (compat "28.1.1.2")
|
||||
;; (transient "0.3.6")
|
||||
;; (with-editor "3.0.5"))
|
||||
|
||||
|
@ -116,15 +116,10 @@
|
|||
;; M-x customize-group RET git-commit RET
|
||||
|
||||
;;; Code:
|
||||
;;;; Dependencies
|
||||
|
||||
(require 'seq)
|
||||
(require 'subr-x)
|
||||
|
||||
(require 'magit-base nil t)
|
||||
(require 'magit-git nil t)
|
||||
(require 'magit-mode nil t)
|
||||
|
||||
(require 'log-edit)
|
||||
(require 'ring)
|
||||
(require 'rx)
|
||||
|
@ -132,23 +127,22 @@
|
|||
(require 'transient)
|
||||
(require 'with-editor)
|
||||
|
||||
(defvar recentf-exclude)
|
||||
|
||||
;;;; Declarations
|
||||
;; For historic reasons Magit isn't a hard dependency.
|
||||
(unless (and (require 'magit-base nil t)
|
||||
(require 'magit-git nil t))
|
||||
(declare-function magit-completing-read "magit-base"
|
||||
( prompt collection &optional predicate require-match
|
||||
initial-input hist def fallback))
|
||||
(declare-function magit-expand-git-file-name "magit-git" (filename))
|
||||
(declare-function magit-git-lines "magit-git" (&rest args))
|
||||
(declare-function magit-hook-custom-get "magit-base" (symbol))
|
||||
(declare-function magit-list-local-branch-names "magit-git" ()))
|
||||
|
||||
(defvar diff-default-read-only)
|
||||
(defvar flyspell-generic-check-word-predicate)
|
||||
(defvar font-lock-beg)
|
||||
(defvar font-lock-end)
|
||||
|
||||
(declare-function magit-completing-read "magit-base"
|
||||
(prompt collection &optional predicate require-match
|
||||
initial-input hist def fallback))
|
||||
(declare-function magit-expand-git-file-name "magit-git" (filename))
|
||||
(declare-function magit-git-lines "magit-git" (&rest args))
|
||||
(declare-function magit-list-local-branch-names "magit-git" ())
|
||||
(declare-function magit-list-remote-branch-names "magit-git"
|
||||
(&optional remote relative))
|
||||
(defvar recentf-exclude)
|
||||
|
||||
;;; Options
|
||||
;;;; Variables
|
||||
|
@ -562,6 +556,9 @@ to recover older messages")
|
|||
#'git-commit-save-message nil t)
|
||||
(add-hook 'with-editor-pre-cancel-hook
|
||||
#'git-commit-save-message nil t)
|
||||
(when (fboundp 'magit-commit--reset-command)
|
||||
(add-hook 'with-editor-post-finish-hook #'magit-commit--reset-command)
|
||||
(add-hook 'with-editor-post-cancel-hook #'magit-commit--reset-command))
|
||||
(when (and (fboundp 'magit-rev-parse)
|
||||
(not (memq last-command
|
||||
'(magit-sequencer-continue
|
|
@ -1,2 +0,0 @@
|
|||
;;; Generated package description from go-mode.el -*- no-byte-compile: t -*-
|
||||
(define-package "go-mode" "20220114.2239" "Major mode for the Go programming language" '((emacs "26.1")) :commit "fa2693278637f56759480d2bf203bb8aad107230" :authors '(("The go-mode Authors")) :maintainer '("The go-mode Authors") :keywords '("languages" "go") :url "https://github.com/dominikh/go-mode.el")
|
|
@ -101,6 +101,13 @@ A major mode for editing go.mod files.
|
|||
|
||||
(add-to-list 'auto-mode-alist '("go\\.mod\\'" . go-dot-mod-mode))
|
||||
|
||||
(autoload 'go-dot-work-mode "go-mode" "\
|
||||
A major mode for editor go.work files.
|
||||
|
||||
\(fn)" t nil)
|
||||
|
||||
(add-to-list 'auto-mode-alist '("go\\.work\\'" . go-dot-work-mode))
|
||||
|
||||
(register-definition-prefixes "go-mode" '("go-" "god" "gofmt"))
|
||||
|
||||
;;;***
|
2
code/elpa/go-mode-20220727.115/go-mode-pkg.el
Normal file
2
code/elpa/go-mode-20220727.115/go-mode-pkg.el
Normal file
|
@ -0,0 +1,2 @@
|
|||
;;; Generated package description from go-mode.el -*- no-byte-compile: t -*-
|
||||
(define-package "go-mode" "20220727.115" "Major mode for the Go programming language" '((emacs "26.1")) :commit "08aa90d52f0e7d2ad02f961b554e13329672d7cb" :authors '(("The go-mode Authors")) :maintainer '("The go-mode Authors") :keywords '("languages" "go") :url "https://github.com/dominikh/go-mode.el")
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
;; Author: The go-mode Authors
|
||||
;; Version: 1.6.0
|
||||
;; Package-Version: 20220114.2239
|
||||
;; Package-Commit: fa2693278637f56759480d2bf203bb8aad107230
|
||||
;; Package-Version: 20220727.115
|
||||
;; Package-Commit: 08aa90d52f0e7d2ad02f961b554e13329672d7cb
|
||||
;; Keywords: languages go
|
||||
;; Package-Requires: ((emacs "26.1"))
|
||||
;; URL: https://github.com/dominikh/go-mode.el
|
||||
|
@ -735,31 +735,6 @@ case keyword. It returns nil for the case line itself."
|
|||
"Return non-nil if point is inside a type switch statement."
|
||||
(go--in-paren-with-prefix-p ?{ ".(type)"))
|
||||
|
||||
(defun go--fill-prefix ()
|
||||
"Return fill prefix for following comment paragraph."
|
||||
(save-excursion
|
||||
(beginning-of-line)
|
||||
|
||||
;; Skip over empty lines and empty comment openers/closers.
|
||||
(while (and
|
||||
(or (go--empty-line-p) (go--boring-comment-p))
|
||||
(zerop (forward-line 1))))
|
||||
|
||||
;; If we are in a block comment, set prefix based on first line
|
||||
;; with content.
|
||||
(if (go-in-comment-p)
|
||||
(progn
|
||||
(looking-at "[[:space:]]*")
|
||||
(match-string-no-properties 0))
|
||||
|
||||
;; Else if we are looking at the start of an interesting comment, our
|
||||
;; prefix is the comment opener and any space following.
|
||||
(if (looking-at (concat go--comment-start-regexp "[[:space:]]*"))
|
||||
;; Replace "/*" opener with spaces so following lines don't
|
||||
;; get "/*" prefix.
|
||||
(replace-regexp-in-string "/\\*" " "
|
||||
(match-string-no-properties 0))))))
|
||||
|
||||
(defun go--open-paren-position ()
|
||||
"Return non-nil if point is between '(' and ')'.
|
||||
|
||||
|
@ -1616,7 +1591,7 @@ func foo(i int) string"
|
|||
found-match))
|
||||
|
||||
(defconst go--type-alias-re
|
||||
(concat "^[[:space:]]*\\(type\\)?[[:space:]]*" go-identifier-regexp "[[:space:]]*=[[:space:]]*" go-type-name-regexp))
|
||||
(concat "^[[:space:]]*\\(type[[:space:]]+\\)?" go-identifier-regexp "[[:space:]]*=[[:space:]]*" go-type-name-regexp))
|
||||
|
||||
(defun go--match-type-alias (end)
|
||||
"Search for type aliases.
|
||||
|
@ -2910,6 +2885,33 @@ If BUFFER, return the number of characters in that buffer instead."
|
|||
;;;###autoload
|
||||
(add-to-list 'auto-mode-alist '("go\\.mod\\'" . go-dot-mod-mode))
|
||||
|
||||
(defconst go-dot-work-mode-keywords
|
||||
'("go" "replace" "use")
|
||||
"All keywords for go.work files. Used for font locking.")
|
||||
|
||||
;;;###autoload
|
||||
(define-derived-mode go-dot-work-mode fundamental-mode "Go Work"
|
||||
"A major mode for editor go.work files."
|
||||
:syntax-table go-dot-mod-mode-syntax-table
|
||||
(set (make-local-variable 'comment-start) "// ")
|
||||
(set (make-local-variable 'comment-end) "")
|
||||
(set (make-local-variable 'comment-use-syntax) t)
|
||||
(set (make-local-variable 'comment-start-skip) "\\(//+\\)\\s *")
|
||||
|
||||
(set (make-local-variable 'font-lock-defaults)
|
||||
'(go-dot-work-mode-keywords))
|
||||
(set (make-local-variable 'indent-line-function) 'go-mode-indent-line)
|
||||
|
||||
;; Go style
|
||||
(setq indent-tabs-mode t)
|
||||
|
||||
;; we borrow the go-mode-indent function so we need this buffer cache
|
||||
(set (make-local-variable 'go-dangling-cache) (make-hash-table :test 'eql))
|
||||
(add-hook 'before-change-functions #'go--reset-dangling-cache-before-change t t))
|
||||
|
||||
;;;###autoload
|
||||
(add-to-list 'auto-mode-alist '("go\\.work\\'" . go-dot-work-mode))
|
||||
|
||||
;; The following functions were copied (and modified) from rust-mode.el.
|
||||
;;
|
||||
;; Copyright (c) 2015 The Rust Project Developers
|
|
@ -1,11 +0,0 @@
|
|||
(define-package "helm" "20220423.1712" "Helm is an Emacs incremental and narrowing framework"
|
||||
'((helm-core "3.8.4")
|
||||
(popup "0.5.3"))
|
||||
:commit "dc0c082a451cfe25d35ba3b9b0c0fc2766cc8319" :authors
|
||||
'(("Thierry Volpiatto" . "thierry.volpiatto@gmail.com"))
|
||||
:maintainer
|
||||
'("Thierry Volpiatto" . "thierry.volpiatto@gmail.com")
|
||||
:url "https://emacs-helm.github.io/helm/")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
((nil . ((bug-reference-bug-regexp . "\\(\\b\\(?:[Ii]ssue ?#?\\|[Bb]ug ?#?\\|[Pp]atch ?#\\|RFE ?#\\|PR [a-z+-]+/\\)\\([0-9]+\\(?:#[0-9]+\\)?\\)\\)")
|
||||
(bug-reference-url-format . "https://github.com/emacs-helm/helm/issues/%s")
|
||||
(byte-compile-warnings . (not obsolete not docstrings))))
|
||||
(byte-compile-warnings . (not obsolete docstrings docstrings-non-ascii-quotes))))
|
||||
(emacs-lisp-mode . ((mode . bug-reference-prog)
|
||||
(indent-tabs-mode . nil))))
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
|
||||
## Copyright (C) 2012 ~ 2021 Thierry Volpiatto <thierry.volpiatto@gmail.com>
|
||||
## Copyright (C) 2012 ~ 2021 Thierry Volpiatto
|
||||
##
|
||||
## 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
|
||||
|
@ -234,6 +234,8 @@ cat > $CONF_FILE <<EOF
|
|||
(blink-cursor-mode -1)
|
||||
(require 'helm-config)
|
||||
(helm-mode 1)
|
||||
(with-eval-after-load 'tramp-cache (setq tramp-cache-read-persistent-data t))
|
||||
(with-eval-after-load 'auth-source (setq auth-source-save-behavior nil))
|
||||
(define-key global-map [remap find-file] 'helm-find-files)
|
||||
(define-key global-map [remap occur] 'helm-occur)
|
||||
(define-key global-map [remap list-buffers] 'helm-buffers-list)
|
|
@ -3,7 +3,7 @@
|
|||
;; Original Author: Tamas Patrovics
|
||||
|
||||
;; Copyright (C) 2007 Tamas Patrovics
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto <thierry.volpiatto@gmail.com>
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto
|
||||
|
||||
;; 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
|
||||
|
@ -34,13 +34,11 @@
|
|||
When nil history is not saved nor restored after Emacs restart
|
||||
unless you save/restore `helm-adaptive-history' with something
|
||||
else like psession or desktop."
|
||||
:type 'string
|
||||
:group 'helm-adapt)
|
||||
:type 'string)
|
||||
|
||||
(defcustom helm-adaptive-history-length 50
|
||||
"Maximum number of candidates stored for a source."
|
||||
:type 'number
|
||||
:group 'helm-adapt)
|
||||
:type 'number)
|
||||
|
||||
(defcustom helm-adaptive-sort-by-frequent-recent-usage t
|
||||
"Try to sort on an average of frequent and recent usage when non-nil.
|
||||
|
@ -55,7 +53,6 @@ Frequency+recent:
|
|||
Even with a low frequency, candidate go up on top. If a candidate
|
||||
have a high frequency but it is not used since some time, it goes
|
||||
down slowly, but as soon you reuse it it go up on top quickly."
|
||||
:group 'helm-adapt
|
||||
:type 'boolean)
|
||||
|
||||
;; Internal
|
||||
|
@ -77,26 +74,24 @@ Format: ((SOURCE-NAME
|
|||
;;;###autoload
|
||||
(define-minor-mode helm-adaptive-mode
|
||||
"Toggle adaptive sorting in all sources."
|
||||
:group 'helm-adapt
|
||||
:require 'helm-adaptive
|
||||
:global t
|
||||
(if helm-adaptive-mode
|
||||
(progn
|
||||
(unless helm-adaptive-history
|
||||
(helm-adaptive-maybe-load-history))
|
||||
(add-hook 'kill-emacs-hook 'helm-adaptive-save-history)
|
||||
(add-hook 'kill-emacs-hook #'helm-adaptive-save-history)
|
||||
;; Should run at beginning of `helm-initial-setup'.
|
||||
(add-hook 'helm-before-initialize-hook 'helm-adaptive-done-reset)
|
||||
(add-hook 'helm-before-initialize-hook #'helm-adaptive-done-reset)
|
||||
;; Should run at beginning of `helm-exit-minibuffer'.
|
||||
(add-hook 'helm-before-action-hook 'helm-adaptive-store-selection)
|
||||
(add-hook 'helm-before-action-hook #'helm-adaptive-store-selection)
|
||||
;; Should run at beginning of `helm-select-action'.
|
||||
(add-hook 'helm-select-action-hook 'helm-adaptive-store-selection))
|
||||
(add-hook 'helm-select-action-hook #'helm-adaptive-store-selection))
|
||||
(helm-adaptive-save-history)
|
||||
(setq helm-adaptive-history nil)
|
||||
(remove-hook 'kill-emacs-hook 'helm-adaptive-save-history)
|
||||
(remove-hook 'helm-before-initialize-hook 'helm-adaptive-done-reset)
|
||||
(remove-hook 'helm-before-action-hook 'helm-adaptive-store-selection)
|
||||
(remove-hook 'helm-select-action-hook 'helm-adaptive-store-selection)))
|
||||
(remove-hook 'kill-emacs-hook #'helm-adaptive-save-history)
|
||||
(remove-hook 'helm-before-initialize-hook #'helm-adaptive-done-reset)
|
||||
(remove-hook 'helm-before-action-hook #'helm-adaptive-store-selection)
|
||||
(remove-hook 'helm-select-action-hook #'helm-adaptive-store-selection)))
|
||||
|
||||
(defun helm-adapt-use-adaptive-p (&optional source-name)
|
||||
"Return current source only if it use adaptive history, nil otherwise."
|
|
@ -368,15 +368,6 @@ files.
|
|||
|
||||
\(fn ARG)" t nil)
|
||||
|
||||
(autoload 'helm-delete-tramp-connection "helm-files" "\
|
||||
Allow deleting tramp connection or marked tramp connections at once.
|
||||
|
||||
This replace `tramp-cleanup-connection' which is partially broken
|
||||
in Emacs < to 25.1.50.1 (See Emacs bug http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24432).
|
||||
|
||||
It allows additionally to delete more than one connection at
|
||||
once." t nil)
|
||||
|
||||
(register-definition-prefixes "helm-files" '("eshell-command-aliases-list" "helm-"))
|
||||
|
||||
;;;***
|
||||
|
@ -578,7 +569,7 @@ With a prefix arg refresh the database in each project.
|
|||
(autoload 'helm-locate "helm-locate" "\
|
||||
Preconfigured `helm' for Locate.
|
||||
Note: you can add locate options after entering pattern.
|
||||
See 'man locate' for valid options and also `helm-locate-command'.
|
||||
See \\='man locate' for valid options and also `helm-locate-command'.
|
||||
|
||||
You can specify a local database with prefix argument ARG.
|
||||
With two prefix arg, refresh the current local db or create it if
|
||||
|
@ -792,7 +783,7 @@ in `helm-current-prefix-arg', otherwise if prefix args were given before
|
|||
That means you can pass prefix args before or after calling a command
|
||||
that use `helm-comp-read'. See `helm-M-x' for example.
|
||||
|
||||
\(fn PROMPT COLLECTION &key TEST INITIAL-INPUT DEFAULT PRESELECT (BUFFER \"*Helm Completions*\") MUST-MATCH FUZZY REVERSE-HISTORY (REQUIRES-PATTERN 0) (HISTORY nil SHISTORY) RAW-HISTORY INPUT-HISTORY (CASE-FOLD helm-comp-read-case-fold-search) (PERSISTENT-ACTION nil) (PERSISTENT-HELP \"DoNothing\") (MODE-LINE helm-comp-read-mode-line) HELP-MESSAGE (KEYMAP helm-comp-read-map) (NAME \"Helm Completions\") HEADER-NAME CANDIDATES-IN-BUFFER MATCH-PART MATCH-DYNAMIC EXEC-WHEN-ONLY-ONE QUIT-WHEN-NO-CAND (VOLATILE t) SORT FC-TRANSFORMER HIST-FC-TRANSFORMER (MARKED-CANDIDATES helm-comp-read-use-marked) NOMARK (ALISTP t) (CANDIDATE-NUMBER-LIMIT helm-candidate-number-limit) MULTILINE ALLOW-NEST COERCE (GROUP \\='helm))" nil nil)
|
||||
\(fn PROMPT COLLECTION &key TEST INITIAL-INPUT DEFAULT PRESELECT (BUFFER \"*Helm Completions*\") MUST-MATCH FUZZY REVERSE-HISTORY (REQUIRES-PATTERN 0) (HISTORY nil SHISTORY) RAW-HISTORY INPUT-HISTORY (CASE-FOLD helm-comp-read-case-fold-search) (PERSISTENT-ACTION nil) (PERSISTENT-HELP \"DoNothing\") (MODE-LINE helm-comp-read-mode-line) HELP-MESSAGE (KEYMAP helm-comp-read-map) (NAME \"Helm Completions\") HEADER-NAME CANDIDATES-IN-BUFFER DIACRITICS MATCH-PART MATCH-DYNAMIC EXEC-WHEN-ONLY-ONE QUIT-WHEN-NO-CAND (VOLATILE t) SORT FC-TRANSFORMER HIST-FC-TRANSFORMER (MARKED-CANDIDATES helm-comp-read-use-marked) NOMARK (ALISTP t) (CANDIDATE-NUMBER-LIMIT helm-candidate-number-limit) MULTILINE ALLOW-NEST COERCE (GROUP \\='helm))" nil nil)
|
||||
|
||||
(autoload 'helm-read-file-name "helm-mode" "\
|
||||
Read a file name with helm completion.
|
||||
|
@ -810,7 +801,7 @@ Keys description:
|
|||
|
||||
- BUFFER: `helm-buffer' name, defaults to \"*Helm Completions*\".
|
||||
|
||||
- TEST: A predicate called with one arg 'candidate'.
|
||||
- TEST: A predicate called with one arg \\='candidate'.
|
||||
|
||||
- NORET: Allow disabling helm-ff-RET (have no effect if helm-ff-RET
|
||||
isn't bound to RET).
|
||||
|
@ -821,7 +812,7 @@ Keys description:
|
|||
|
||||
- HISTORY: Display HISTORY in a special source.
|
||||
|
||||
- MUST-MATCH: Can be 'confirm, nil, or t.
|
||||
- MUST-MATCH: Can be \\='confirm, nil, or t.
|
||||
|
||||
- FUZZY: Enable fuzzy matching when non-nil (Enabled by default).
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
;;; helm-bookmark.el --- Helm for Emacs regular Bookmarks. -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto <thierry.volpiatto@gmail.com>
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto
|
||||
|
||||
;; 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
|
||||
|
@ -40,7 +40,6 @@
|
|||
|
||||
(defcustom helm-bookmark-show-location nil
|
||||
"Show location of bookmark on display."
|
||||
:group 'helm-bookmark
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom helm-bookmark-default-filtered-sources
|
||||
|
@ -56,72 +55,76 @@
|
|||
(list 'helm-source-bookmark-uncategorized
|
||||
'helm-source-bookmark-set))
|
||||
"List of sources to use in `helm-filtered-bookmarks'."
|
||||
:group 'helm-bookmark
|
||||
:type '(repeat (choice symbol)))
|
||||
|
||||
(defcustom helm-bookmark-use-icon nil
|
||||
"Display candidates with an icon with `all-the-icons' when non nil."
|
||||
:type 'boolean
|
||||
:group 'helm-bookmark)
|
||||
:type 'boolean)
|
||||
|
||||
|
||||
(defgroup helm-bookmark-faces nil
|
||||
"Customize the appearance of helm-bookmark."
|
||||
:prefix "helm-"
|
||||
:group 'helm-bookmark
|
||||
:group 'helm-faces)
|
||||
|
||||
(defface helm-bookmark-info
|
||||
`((t ,@(and (>= emacs-major-version 27) '(:extend t))
|
||||
:foreground "green"))
|
||||
"Face used for W3m Emacs bookmarks (not w3m bookmarks)."
|
||||
:group 'helm-bookmark)
|
||||
:group 'helm-bookmark-faces)
|
||||
|
||||
(defface helm-bookmark-w3m
|
||||
`((t ,@(and (>= emacs-major-version 27) '(:extend t))
|
||||
:foreground "yellow"))
|
||||
"Face used for W3m Emacs bookmarks (not w3m bookmarks)."
|
||||
:group 'helm-bookmark)
|
||||
:group 'helm-bookmark-faces)
|
||||
|
||||
(defface helm-bookmark-gnus
|
||||
`((t ,@(and (>= emacs-major-version 27) '(:extend t))
|
||||
:foreground "magenta"))
|
||||
"Face used for Gnus bookmarks."
|
||||
:group 'helm-bookmark)
|
||||
:group 'helm-bookmark-faces)
|
||||
|
||||
(defface helm-bookmark-man
|
||||
`((t ,@(and (>= emacs-major-version 27) '(:extend t))
|
||||
:foreground "Orange4"))
|
||||
"Face used for Woman/man bookmarks."
|
||||
:group 'helm-bookmark)
|
||||
:group 'helm-bookmark-faces)
|
||||
|
||||
(defface helm-bookmark-file
|
||||
`((t ,@(and (>= emacs-major-version 27) '(:extend t))
|
||||
:foreground "Deepskyblue2"))
|
||||
"Face used for file bookmarks."
|
||||
:group 'helm-bookmark)
|
||||
:group 'helm-bookmark-faces)
|
||||
|
||||
(defface helm-bookmark-file-not-found
|
||||
`((t ,@(and (>= emacs-major-version 27) '(:extend t))
|
||||
:foreground "Slategray4"))
|
||||
"Face used for file bookmarks."
|
||||
:group 'helm-bookmark)
|
||||
:group 'helm-bookmark-faces)
|
||||
|
||||
(defface helm-bookmark-directory
|
||||
`((t ,@(and (>= emacs-major-version 27) '(:extend t))
|
||||
:inherit helm-ff-directory))
|
||||
"Face used for file bookmarks."
|
||||
:group 'helm-bookmark)
|
||||
:group 'helm-bookmark-faces)
|
||||
|
||||
(defface helm-bookmark-addressbook
|
||||
`((t ,@(and (>= emacs-major-version 27) '(:extend t))
|
||||
:foreground "tomato"))
|
||||
"Face used for addressbook bookmarks."
|
||||
:group 'helm-bookmark)
|
||||
:group 'helm-bookmark-faces)
|
||||
|
||||
|
||||
(defvar helm-bookmark-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent map helm-map)
|
||||
(define-key map (kbd "C-c o") 'helm-bookmark-run-jump-other-window)
|
||||
(define-key map (kbd "C-c C-o") 'helm-bookmark-run-jump-other-frame)
|
||||
(define-key map (kbd "C-d") 'helm-bookmark-run-delete)
|
||||
(define-key map (kbd "C-]") 'helm-bookmark-toggle-filename)
|
||||
(define-key map (kbd "M-e") 'helm-bookmark-run-edit)
|
||||
(define-key map (kbd "C-c o") #'helm-bookmark-run-jump-other-window)
|
||||
(define-key map (kbd "C-c C-o") #'helm-bookmark-run-jump-other-frame)
|
||||
(define-key map (kbd "C-d") #'helm-bookmark-run-delete)
|
||||
(define-key map (kbd "C-]") #'helm-bookmark-toggle-filename)
|
||||
(define-key map (kbd "M-e") #'helm-bookmark-run-edit)
|
||||
map)
|
||||
"Generic Keymap for Emacs bookmark sources.")
|
||||
|
||||
|
@ -220,7 +223,8 @@ BOOKMARK is a bookmark name or a bookmark record."
|
|||
(defun helm-bookmark-mu4e-bookmark-p (bookmark)
|
||||
"Return non nil if BOOKMARK is a mu4e bookmark.
|
||||
BOOKMARK is a bookmark name or a bookmark record."
|
||||
(eq (bookmark-get-handler bookmark) 'mu4e-bookmark-jump))
|
||||
(memq (bookmark-get-handler bookmark)
|
||||
'(mu4e-bookmark-jump mu4e--jump-to-bookmark)))
|
||||
|
||||
(defun helm-bookmark-w3m-bookmark-p (bookmark)
|
||||
"Return non-nil if BOOKMARK is a W3m bookmark.
|
||||
|
@ -337,18 +341,18 @@ If `browse-url-browser-function' is set to something else than
|
|||
;; (`bookmark-w3m-bookmark-jump') will use our handler which open
|
||||
;; the bookmark in a new tab or in an external browser depending
|
||||
;; on `browse-url-browser-function'.
|
||||
(defalias 'bookmark-w3m-bookmark-jump 'helm-bookmark-jump-w3m)
|
||||
(defalias 'bookmark-w3m-bookmark-jump #'helm-bookmark-jump-w3m)
|
||||
|
||||
;; Provide compatibility with old handlers provided in external
|
||||
;; packages bookmark-extensions.el and bookmark+.
|
||||
(defalias 'bmkext-jump-woman 'woman-bookmark-jump)
|
||||
(defalias 'bmkext-jump-man 'Man-bookmark-jump)
|
||||
(defalias 'bmkext-jump-w3m 'helm-bookmark-jump-w3m)
|
||||
(defalias 'bmkext-jump-gnus 'gnus-summary-bookmark-jump)
|
||||
(defalias 'bookmarkp-jump-gnus 'gnus-summary-bookmark-jump)
|
||||
(defalias 'bookmarkp-jump-w3m 'helm-bookmark-jump-w3m)
|
||||
(defalias 'bookmarkp-jump-woman 'woman-bookmark-jump)
|
||||
(defalias 'bookmarkp-jump-man 'Man-bookmark-jump)
|
||||
(defalias 'bmkext-jump-woman #'woman-bookmark-jump)
|
||||
(defalias 'bmkext-jump-man #'Man-bookmark-jump)
|
||||
(defalias 'bmkext-jump-w3m #'helm-bookmark-jump-w3m)
|
||||
(defalias 'bmkext-jump-gnus #'gnus-summary-bookmark-jump)
|
||||
(defalias 'bookmarkp-jump-gnus #'gnus-summary-bookmark-jump)
|
||||
(defalias 'bookmarkp-jump-w3m #'helm-bookmark-jump-w3m)
|
||||
(defalias 'bookmarkp-jump-woman #'woman-bookmark-jump)
|
||||
(defalias 'bookmarkp-jump-man #'Man-bookmark-jump)
|
||||
|
||||
|
||||
;;;; Filtered bookmark sources
|
||||
|
@ -495,7 +499,7 @@ If `browse-url-browser-function' is set to something else than
|
|||
(defvar helm-bookmark-find-files-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent map helm-bookmark-map)
|
||||
(define-key map (kbd "C-x C-d") 'helm-bookmark-run-browse-project)
|
||||
(define-key map (kbd "C-x C-d") #'helm-bookmark-run-browse-project)
|
||||
map))
|
||||
|
||||
(defclass helm-bookmark-override-inheritor (helm-source) ())
|
||||
|
@ -716,7 +720,7 @@ consecutive words from the buffer into the new bookmark name."
|
|||
(let ((newname (or new (read-from-minibuffer
|
||||
"New name: " nil
|
||||
(let ((now-map (copy-keymap minibuffer-local-map)))
|
||||
(define-key now-map "\C-w" 'bookmark-yank-word)
|
||||
(define-key now-map "\C-w" #'bookmark-yank-word)
|
||||
now-map)
|
||||
nil 'bookmark-history))))
|
||||
(bookmark-set-name old newname)
|
|
@ -1,6 +1,6 @@
|
|||
;;; helm-buffers.el --- helm support for buffers. -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto <thierry.volpiatto@gmail.com>
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto
|
||||
|
||||
;; 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
|
||||
|
@ -28,9 +28,11 @@
|
|||
|
||||
(declare-function helm-comp-read "helm-mode")
|
||||
(declare-function helm-browse-project "helm-files")
|
||||
(declare-function helm-ff-switch-to-shell "helm-files")
|
||||
|
||||
(defvar dired-buffers)
|
||||
(defvar org-directory)
|
||||
(defvar helm-ff-default-directory)
|
||||
|
||||
|
||||
(defgroup helm-buffers nil
|
||||
|
@ -43,56 +45,47 @@
|
|||
Buffer candidates matching these regular expression will be
|
||||
filtered from the list of candidates if the
|
||||
`helm-skip-boring-buffers' candidate transformer is used."
|
||||
:type '(repeat (choice regexp))
|
||||
:group 'helm-buffers)
|
||||
:type '(repeat (choice regexp)))
|
||||
|
||||
(defcustom helm-white-buffer-regexp-list nil
|
||||
"The regexp list of not boring buffers.
|
||||
These buffers will be displayed even if they match one of
|
||||
`helm-boring-buffer-regexp-list'."
|
||||
:type '(repeat (choice regexp))
|
||||
:group 'helm-buffers)
|
||||
:type '(repeat (choice regexp)))
|
||||
|
||||
(defcustom helm-buffers-favorite-modes '(lisp-interaction-mode
|
||||
emacs-lisp-mode
|
||||
text-mode
|
||||
org-mode)
|
||||
"List of preferred mode to open new buffers with."
|
||||
:type '(repeat (choice function))
|
||||
:group 'helm-buffers)
|
||||
:type '(repeat (choice function)))
|
||||
|
||||
(defcustom helm-buffer-max-length 20
|
||||
"Max length of buffer names before truncate.
|
||||
When disabled (nil) use the longest `buffer-name' length found."
|
||||
:group 'helm-buffers
|
||||
:type '(choice (const :tag "Disabled" nil)
|
||||
(integer :tag "Length before truncate")))
|
||||
|
||||
(defcustom helm-buffer-details-flag t
|
||||
"Always show details in buffer list when non-nil."
|
||||
:group 'helm-buffers
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom helm-buffers-fuzzy-matching nil
|
||||
"Fuzzy matching buffer names when non-nil.
|
||||
Only buffer names are fuzzy matched when this is enabled,
|
||||
`major-mode' matching is not affected by this."
|
||||
:group 'helm-buffers
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom helm-buffer-skip-remote-checking nil
|
||||
"Ignore checking for `file-exists-p' on remote files."
|
||||
:group 'helm-buffers
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom helm-buffers-truncate-lines t
|
||||
"Truncate lines in `helm-buffers-list' when non-nil."
|
||||
:group 'helm-buffers
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom helm-buffers-left-margin-width helm-left-margin-width
|
||||
"`left-margin-width' value for `helm-mini' and `helm-buffers-list'."
|
||||
:group 'helm-buffers
|
||||
:type 'integer)
|
||||
|
||||
(defcustom helm-mini-default-sources '(helm-source-buffers-list
|
||||
|
@ -102,18 +95,15 @@ Only buffer names are fuzzy matched when this is enabled,
|
|||
|
||||
When adding a source here it is up to you to ensure the library
|
||||
of this source is accessible and properly loaded."
|
||||
:group 'helm-buffers
|
||||
:type '(repeat (choice symbol)))
|
||||
|
||||
(defcustom helm-buffers-end-truncated-string "..."
|
||||
"The string to display at end of truncated buffer names."
|
||||
:type 'string
|
||||
:group 'helm-buffers)
|
||||
:type 'string)
|
||||
|
||||
(defcustom helm-buffers-column-separator " "
|
||||
"Separator for columns in buffer listing."
|
||||
:type 'string
|
||||
:group 'helm-buffers)
|
||||
:type 'string)
|
||||
|
||||
(defcustom helm-buffer--pretty-names '((dired-mode . "Dired")
|
||||
(lisp-interaction-mode . "Lisp Inter"))
|
||||
|
@ -124,13 +114,11 @@ may be a mode-line specification which may be costly to compute,
|
|||
in this case add here the pretty name as a string to avoid this
|
||||
costly computation. Also if some pretty names are too long you
|
||||
can add your own abbreviation here."
|
||||
:type '(alist :key-type symbol :value-type string)
|
||||
:group 'helm-buffers)
|
||||
:type '(alist :key-type symbol :value-type string))
|
||||
|
||||
(defcustom helm-buffers-maybe-switch-to-tab nil
|
||||
"Switch to buffer in its tab when non nil.
|
||||
This has no effect when `tab-bar-mode' is not available."
|
||||
:group 'helm-buffers
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom helm-buffer-list-reorder-fn #'helm-buffers-reorder-buffer-list
|
||||
|
@ -142,7 +130,6 @@ You can write a function that reorder VISIBLES and OTHERS as you
|
|||
want.
|
||||
Default function returns OTHERS buffers on top and VISIBLES
|
||||
buffer at the end. See `helm-buffers-reorder-buffer-list'."
|
||||
:group 'helm-buffers
|
||||
:type 'function)
|
||||
|
||||
(defcustom helm-buffers-sort-fn helm-fuzzy-sort-fn
|
||||
|
@ -151,8 +138,8 @@ buffer at the end. See `helm-buffers-reorder-buffer-list'."
|
|||
Default to `helm-fuzzy-sort-fn' you can use
|
||||
`helm-fuzzy-matching-sort-fn-preserve-ties-order' as alternative if
|
||||
you want to keep the recentest order when narrowing candidates."
|
||||
:type 'function
|
||||
:group 'helm-buffers)
|
||||
:type 'function)
|
||||
|
||||
|
||||
;;; Faces
|
||||
;;
|
||||
|
@ -250,30 +237,31 @@ Note that this variable is buffer-local.")
|
|||
;; No need to have separate command for grep and zgrep
|
||||
;; as we don't use recursivity for buffers.
|
||||
;; So use zgrep for both as it is capable to handle non--compressed files.
|
||||
(define-key map (kbd "M-g s") 'helm-buffer-run-zgrep)
|
||||
(define-key map (kbd "C-s") 'helm-buffers-run-occur)
|
||||
(define-key map (kbd "C-x C-d") 'helm-buffers-run-browse-project)
|
||||
(define-key map (kbd "C-c o") 'helm-buffer-switch-other-window)
|
||||
(define-key map (kbd "C-c C-o") 'helm-buffer-switch-other-frame)
|
||||
(define-key map (kbd "M-g M-g") 'helm-buffer-run-goto-line)
|
||||
(define-key map (kbd "C-c =") 'helm-buffer-run-ediff)
|
||||
(define-key map (kbd "M-=") 'helm-buffer-run-ediff-merge)
|
||||
(define-key map (kbd "C-=") 'helm-buffer-diff-persistent)
|
||||
(define-key map (kbd "M-G") 'helm-buffer-revert-persistent)
|
||||
(define-key map (kbd "C-c d") 'helm-buffer-run-kill-persistent)
|
||||
(define-key map (kbd "M-D") 'helm-buffer-run-kill-buffers)
|
||||
(define-key map (kbd "C-x C-s") 'helm-buffer-save-persistent)
|
||||
(define-key map (kbd "C-x s") 'helm-buffer-run-save-some-buffers)
|
||||
(define-key map (kbd "C-M-%") 'helm-buffer-run-query-replace-regexp)
|
||||
(define-key map (kbd "M-%") 'helm-buffer-run-query-replace)
|
||||
(define-key map (kbd "M-R") 'helm-buffer-run-rename-buffer)
|
||||
(define-key map (kbd "M-m") 'helm-toggle-all-marks)
|
||||
(define-key map (kbd "M-a") 'helm-mark-all)
|
||||
(define-key map (kbd "C-]") 'helm-toggle-buffers-details)
|
||||
(define-key map (kbd "C-c a") 'helm-buffers-toggle-show-hidden-buffers)
|
||||
(define-key map (kbd "C-M-SPC") 'helm-buffers-mark-similar-buffers)
|
||||
(define-key map (kbd "M-g s") #'helm-buffer-run-zgrep)
|
||||
(define-key map (kbd "C-s") #'helm-buffers-run-occur)
|
||||
(define-key map (kbd "C-x C-d") #'helm-buffers-run-browse-project)
|
||||
(define-key map (kbd "C-c o") #'helm-buffer-switch-other-window)
|
||||
(define-key map (kbd "C-c C-o") #'helm-buffer-switch-other-frame)
|
||||
(define-key map (kbd "M-g M-g") #'helm-buffer-run-goto-line)
|
||||
(define-key map (kbd "C-c =") #'helm-buffer-run-ediff)
|
||||
(define-key map (kbd "M-=") #'helm-buffer-run-ediff-merge)
|
||||
(define-key map (kbd "C-=") #'helm-buffer-diff-persistent)
|
||||
(define-key map (kbd "M-G") #'helm-buffer-revert-persistent)
|
||||
(define-key map (kbd "C-c d") #'helm-buffer-run-kill-persistent)
|
||||
(define-key map (kbd "M-D") #'helm-buffer-run-kill-buffers)
|
||||
(define-key map (kbd "C-x C-s") #'helm-buffer-save-persistent)
|
||||
(define-key map (kbd "C-x s") #'helm-buffer-run-save-some-buffers)
|
||||
(define-key map (kbd "C-M-%") #'helm-buffer-run-query-replace-regexp)
|
||||
(define-key map (kbd "M-%") #'helm-buffer-run-query-replace)
|
||||
(define-key map (kbd "M-R") #'helm-buffer-run-rename-buffer)
|
||||
(define-key map (kbd "M-m") #'helm-toggle-all-marks)
|
||||
(define-key map (kbd "M-a") #'helm-mark-all)
|
||||
(define-key map (kbd "M-e") #'helm-buffer-run-switch-to-shell)
|
||||
(define-key map (kbd "C-]") #'helm-toggle-buffers-details)
|
||||
(define-key map (kbd "C-c a") #'helm-buffers-toggle-show-hidden-buffers)
|
||||
(define-key map (kbd "C-M-SPC") #'helm-buffers-mark-similar-buffers)
|
||||
(when (fboundp 'tab-bar-mode)
|
||||
(define-key map (kbd "C-c C-t") 'helm-buffers-switch-to-buffer-new-tab))
|
||||
(define-key map (kbd "C-c C-t") #'helm-buffers-switch-to-buffer-new-tab))
|
||||
map)
|
||||
"Keymap for buffer sources in helm.")
|
||||
|
||||
|
@ -368,8 +356,8 @@ Note that this variable is buffer-local.")
|
|||
(defvar helm-buffer-not-found-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent map helm-map)
|
||||
(define-key map (kbd "C-c o") 'helm-buffers-not-found-run-switch-ow)
|
||||
(define-key map (kbd "C-c C-o") 'helm-buffers-not-found-run-switch-of)
|
||||
(define-key map (kbd "C-c o") #'helm-buffers-not-found-run-switch-ow)
|
||||
(define-key map (kbd "C-c C-o") #'helm-buffers-not-found-run-switch-of)
|
||||
map)
|
||||
"Keymap for `helm-source-buffer-not-found' source.")
|
||||
|
||||
|
@ -611,7 +599,7 @@ buffers)."
|
|||
(cl-loop for p in (helm-mm-split-pattern helm-pattern)
|
||||
unless (member (substring p 0 1) '("*" "/" "@" "!"))
|
||||
collect p into lst
|
||||
finally return (mapconcat 'identity lst (or separator " "))))
|
||||
finally return (mapconcat #'identity lst (or separator " "))))
|
||||
|
||||
(defun helm-buffers-sort-transformer (candidates source)
|
||||
(cl-assert helm-buffers-sort-fn nil "Wrong type argument functionp: nil")
|
||||
|
@ -732,7 +720,7 @@ I.e. same color."
|
|||
for p in (helm-mm-split-pattern pat)
|
||||
when (string-match "\\`@\\(.*\\)" p)
|
||||
collect (match-string 1 p) into lst
|
||||
finally return (mapconcat 'identity lst " ")))
|
||||
finally return (mapconcat #'identity lst " ")))
|
||||
(patterns (helm-mm-3-get-patterns pattern)))
|
||||
(if (and buf patterns)
|
||||
(with-current-buffer buf
|
||||
|
@ -823,7 +811,7 @@ If REGEXP-FLAG is given use `query-replace-regexp'."
|
|||
(and (file-exists-p it) (revert-buffer t t)))))
|
||||
|
||||
(defun helm-revert-marked-buffers (_ignore)
|
||||
(mapc 'helm-revert-buffer (helm-marked-candidates)))
|
||||
(mapc #'helm-revert-buffer (helm-marked-candidates)))
|
||||
|
||||
(defun helm-buffer-revert-and-update (_candidate)
|
||||
(with-helm-buffer
|
||||
|
@ -925,6 +913,19 @@ If REGEXP-FLAG is given use `query-replace-regexp'."
|
|||
(helm-exit-and-execute-action 'helm-kill-marked-buffers)))
|
||||
(put 'helm-buffer-run-kill-buffers 'helm-only t)
|
||||
|
||||
(defun helm-buffer-switch-to-shell (candidate)
|
||||
(require 'helm-files)
|
||||
(let ((helm-ff-default-directory
|
||||
(with-current-buffer candidate
|
||||
default-directory)))
|
||||
(helm-ff-switch-to-shell nil)))
|
||||
|
||||
(defun helm-buffer-run-switch-to-shell ()
|
||||
(interactive)
|
||||
(with-helm-alive-p
|
||||
(helm-exit-and-execute-action 'helm-buffer-switch-to-shell)))
|
||||
(put 'helm-buffer-run-switch-to-shell 'no-helm-mx t)
|
||||
|
||||
(defun helm-buffer-run-grep ()
|
||||
"Run Grep action from `helm-source-buffers-list'."
|
||||
(interactive)
|
||||
|
@ -960,11 +961,25 @@ If REGEXP-FLAG is given use `query-replace-regexp'."
|
|||
(helm-exit-and-execute-action 'helm-buffer-switch-buffers-other-window)))
|
||||
(put 'helm-buffer-switch-other-window 'helm-only t)
|
||||
|
||||
(defun helm-buffer-switch-to-buffer-other-frame (_candidate)
|
||||
"Display marked buffers in other frame."
|
||||
(let ((bufs (helm-marked-candidates)))
|
||||
(select-frame (make-frame))
|
||||
(helm-window-show-buffers bufs)))
|
||||
|
||||
(defun helm-buffers-maybe-raise-buffer-frame (candidate)
|
||||
"Raise buffer frame handling buffer CANDIDATE and switch to it."
|
||||
(let ((oframe (window-frame (get-buffer-window candidate 0))))
|
||||
(unless (eql oframe (selected-frame))
|
||||
(raise-frame oframe))
|
||||
(with-selected-frame oframe
|
||||
(switch-to-buffer candidate))))
|
||||
|
||||
(defun helm-buffer-switch-other-frame ()
|
||||
"Run switch to other frame action from `helm-source-buffers-list'."
|
||||
(interactive)
|
||||
(with-helm-alive-p
|
||||
(helm-exit-and-execute-action 'switch-to-buffer-other-frame)))
|
||||
(helm-exit-and-execute-action 'helm-buffer-switch-to-buffer-other-frame)))
|
||||
(put 'helm-buffer-switch-other-frame 'helm-only t)
|
||||
|
||||
(defun helm-buffers-switch-to-buffer-other-tab (_candidate)
|
|
@ -1,6 +1,6 @@
|
|||
;;; helm-color.el --- colors and faces -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto <thierry.volpiatto@gmail.com>
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto
|
||||
|
||||
;; 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
|
||||
|
@ -113,10 +113,10 @@
|
|||
(defvar helm-color-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent map helm-map)
|
||||
(define-key map (kbd "C-c n") 'helm-color-run-insert-name)
|
||||
(define-key map (kbd "C-c N") 'helm-color-run-kill-name)
|
||||
(define-key map (kbd "C-c r") 'helm-color-run-insert-rgb)
|
||||
(define-key map (kbd "C-c R") 'helm-color-run-kill-rgb)
|
||||
(define-key map (kbd "C-c n") #'helm-color-run-insert-name)
|
||||
(define-key map (kbd "C-c N") #'helm-color-run-kill-name)
|
||||
(define-key map (kbd "C-c r") #'helm-color-run-insert-rgb)
|
||||
(define-key map (kbd "C-c R") #'helm-color-run-kill-rgb)
|
||||
map))
|
||||
|
||||
(defvar helm-source-colors
|
|
@ -80,8 +80,8 @@ you will not have anymore separators between candidates."
|
|||
(defvar helm-comint-prompts-keymap
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent map helm-map)
|
||||
(define-key map (kbd "C-c o") 'helm-comint-prompts-other-window)
|
||||
(define-key map (kbd "C-c C-o") 'helm-comint-prompts-other-frame)
|
||||
(define-key map (kbd "C-c o") #'helm-comint-prompts-other-window)
|
||||
(define-key map (kbd "C-c C-o") #'helm-comint-prompts-other-frame)
|
||||
map)
|
||||
"Keymap for `helm-comint-prompt-all'.")
|
||||
|
||||
|
@ -165,11 +165,11 @@ See `helm-comint-prompts-list'."
|
|||
(defun helm-comint-prompts ()
|
||||
"Pre-configured `helm' to browse the prompts of the current comint buffer."
|
||||
(interactive)
|
||||
(if (apply 'derived-mode-p helm-comint-mode-list)
|
||||
(if (apply #'derived-mode-p helm-comint-mode-list)
|
||||
(helm :sources
|
||||
(helm-build-sync-source "Comint prompts"
|
||||
:candidates (helm-comint-prompts-list major-mode)
|
||||
:candidate-transformer 'helm-comint-prompts-transformer
|
||||
:candidate-transformer #'helm-comint-prompts-transformer
|
||||
:action '(("Go to prompt" . helm-comint-prompts-goto)))
|
||||
:buffer "*helm comint prompts*")
|
||||
(message "Current buffer is not a comint buffer")))
|
||||
|
@ -178,11 +178,11 @@ See `helm-comint-prompts-list'."
|
|||
(defun helm-comint-prompts-all ()
|
||||
"Pre-configured `helm' to browse the prompts of all comint sessions."
|
||||
(interactive)
|
||||
(if (apply 'derived-mode-p helm-comint-mode-list)
|
||||
(if (apply #'derived-mode-p helm-comint-mode-list)
|
||||
(helm :sources
|
||||
(helm-build-sync-source "All comint prompts"
|
||||
:candidates (helm-comint-prompts-list-all major-mode)
|
||||
:candidate-transformer 'helm-comint-prompts-all-transformer
|
||||
:candidate-transformer #'helm-comint-prompts-all-transformer
|
||||
:action (quote (("Go to prompt" . helm-comint-prompts-goto)
|
||||
("Go to prompt in other window `C-c o`" .
|
||||
helm-comint-prompts-goto-other-window)
|
|
@ -1,6 +1,6 @@
|
|||
;;; helm-command.el --- Helm execute-exended-command. -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto <thierry.volpiatto@gmail.com>
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto
|
||||
|
||||
;; 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
|
||||
|
@ -23,6 +23,15 @@
|
|||
(require 'helm-mode)
|
||||
(require 'helm-elisp)
|
||||
|
||||
|
||||
(defvar helm-M-x-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent map helm-comp-read-map)
|
||||
(define-key map (kbd "C-u") nil)
|
||||
(define-key map (kbd "C-u") #'helm-M-x-universal-argument)
|
||||
(define-key map (kbd "C-]") #'helm-M-x-toggle-short-doc)
|
||||
map))
|
||||
|
||||
|
||||
(defgroup helm-command nil
|
||||
"Emacs command related Applications and libraries for Helm."
|
||||
|
@ -30,32 +39,20 @@
|
|||
|
||||
(defcustom helm-M-x-always-save-history nil
|
||||
"`helm-M-x' save command in `extended-command-history' even when it fails."
|
||||
:group 'helm-command
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom helm-M-x-reverse-history nil
|
||||
"The history source of `helm-M-x' appear in second position when non-nil."
|
||||
:group 'helm-command
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom helm-M-x-fuzzy-match t
|
||||
"Helm-M-x fuzzy matching when non nil."
|
||||
:group 'helm-command
|
||||
:type 'boolean)
|
||||
|
||||
(defvar helm-M-x-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent map helm-comp-read-map)
|
||||
(define-key map (kbd "C-u") nil)
|
||||
(define-key map (kbd "C-u") 'helm-M-x-universal-argument)
|
||||
(define-key map (kbd "C-]") 'helm-M-x-toggle-short-doc)
|
||||
map))
|
||||
|
||||
(defcustom helm-M-x-show-short-doc nil
|
||||
"Show short docstring of command when non nil.
|
||||
This value can be toggled with
|
||||
\\<helm-M-x-map>\\[helm-M-x-toggle-short-doc] while in helm-M-x session."
|
||||
:group 'helm-command
|
||||
:type 'boolean)
|
||||
|
||||
|
||||
|
@ -125,7 +122,7 @@ Return nil if no mode-map found."
|
|||
"Toggle short doc display in helm-M-x."
|
||||
(interactive)
|
||||
(setq helm-M-x-show-short-doc (not helm-M-x-show-short-doc))
|
||||
(helm-update (concat "^" (helm-get-selection)) (helm-get-current-source)))
|
||||
(helm-force-update (concat "^" (helm-get-selection)) (helm-get-current-source)))
|
||||
(put 'helm-M-x-toggle-short-doc 'no-helm-mx t)
|
||||
|
||||
(defun helm-M-x-transformer-1 (candidates &optional sort ignore-props)
|
||||
|
@ -139,7 +136,7 @@ algorithm."
|
|||
(with-helm-current-buffer
|
||||
(cl-loop with max-len = (when helm-M-x-show-short-doc
|
||||
(buffer-local-value 'helm-candidate-buffer-longest-len
|
||||
(helm-candidate-buffer)))
|
||||
(get-buffer (helm-candidate-buffer))))
|
||||
with local-map = (helm-M-x-current-mode-map-alist)
|
||||
for cand in candidates
|
||||
for local-key = (car (rassq cand local-map))
|
||||
|
@ -158,7 +155,7 @@ algorithm."
|
|||
(cons (cond ((and (string-match "^M-x" key) local-key)
|
||||
(format "%s%s%s %s"
|
||||
disp
|
||||
(if doc (make-string (+ 4 (- max-len (+ (length cand)))) ? ) "")
|
||||
(if doc (make-string (+ 1 (- max-len (length cand))) ? ) "")
|
||||
(if doc (propertize doc 'face 'helm-M-x-short-doc) "")
|
||||
(propertize
|
||||
" " 'display
|
||||
|
@ -166,11 +163,11 @@ algorithm."
|
|||
((string-match "^M-x" key)
|
||||
(format "%s%s%s"
|
||||
disp
|
||||
(if doc (make-string (+ 4 (- max-len (+ (length cand)))) ? ) "")
|
||||
(if doc (make-string (+ 1 (- max-len (length cand))) ? ) "")
|
||||
(if doc (propertize doc 'face 'helm-M-x-short-doc) "")))
|
||||
(t (format "%s%s%s %s"
|
||||
disp
|
||||
(if doc (make-string (+ 4 (- max-len (+ (length cand)))) ? ) "")
|
||||
(if doc (make-string (+ 1 (- max-len (length cand))) ? ) "")
|
||||
(if doc (propertize doc 'face 'helm-M-x-short-doc) "")
|
||||
(propertize
|
||||
" " 'display
|
||||
|
@ -240,7 +237,7 @@ algorithm."
|
|||
|
||||
(defun helm-M-x--before-action-hook ()
|
||||
(remove-hook 'helm-move-selection-after-hook
|
||||
'helm-M-x--move-selection-after-hook))
|
||||
#'helm-M-x--move-selection-after-hook))
|
||||
|
||||
(defclass helm-M-x-class (helm-source-in-buffer helm-type-command)
|
||||
((requires-pattern :initform 0)
|
||||
|
@ -257,7 +254,7 @@ algorithm."
|
|||
(when (and helm-M-x--timer (timerp helm-M-x--timer))
|
||||
(cancel-timer helm-M-x--timer)
|
||||
(setq helm-M-x--timer nil))
|
||||
(setq helm-M-x--timer (run-at-time 1 0.1 'helm-M-x--notify-prefix-arg))
|
||||
(setq helm-M-x--timer (run-at-time 1 0.1 #'helm-M-x--notify-prefix-arg))
|
||||
(setq helm--mode-line-display-prefarg t)
|
||||
;; Prevent displaying a wrong prefix arg when helm-resume is called
|
||||
;; from prefix arg.
|
||||
|
@ -304,20 +301,21 @@ default to `extended-command-history'."
|
|||
(prompt (concat (cond
|
||||
((eq helm-M-x-prefix-argument '-) "- ")
|
||||
((and (consp helm-M-x-prefix-argument)
|
||||
(eq (car helm-M-x-prefix-argument) 4)) "C-u ")
|
||||
(eq (car helm-M-x-prefix-argument) 4))
|
||||
"C-u ")
|
||||
((and (consp helm-M-x-prefix-argument)
|
||||
(integerp (car helm-M-x-prefix-argument)))
|
||||
(format "%d " (car helm-M-x-prefix-argument)))
|
||||
((integerp helm-M-x-prefix-argument)
|
||||
(format "%d " helm-M-x-prefix-argument)))
|
||||
"M-x ")))
|
||||
(setq helm-M-x--timer (run-at-time 1 0.1 'helm-M-x--notify-prefix-arg))
|
||||
(setq helm-M-x--timer (run-at-time 1 0.1 #'helm-M-x--notify-prefix-arg))
|
||||
;; Fix Bug#2250, add `helm-move-selection-after-hook' which
|
||||
;; reset prefix arg to nil only for this helm session.
|
||||
(add-hook 'helm-move-selection-after-hook
|
||||
'helm-M-x--move-selection-after-hook)
|
||||
#'helm-M-x--move-selection-after-hook)
|
||||
(add-hook 'helm-before-action-hook
|
||||
'helm-M-x--before-action-hook)
|
||||
#'helm-M-x--before-action-hook)
|
||||
(when (and sources helm-M-x-reverse-history)
|
||||
(setq sources (nreverse sources)))
|
||||
(unwind-protect
|
||||
|
@ -326,7 +324,8 @@ default to `extended-command-history'."
|
|||
(helm :sources sources
|
||||
:prompt prompt
|
||||
:buffer "*helm M-x*"
|
||||
:history 'helm-M-x-input-history))
|
||||
:history 'helm-M-x-input-history
|
||||
:truncate-lines t))
|
||||
(helm-M-x--unwind-forms))))
|
||||
|
||||
;; When running a command involving again helm from helm-M-x, the
|
||||
|
@ -342,12 +341,13 @@ default to `extended-command-history'."
|
|||
(when (timerp helm-M-x--timer)
|
||||
(cancel-timer helm-M-x--timer)
|
||||
(setq helm-M-x--timer nil))
|
||||
(setq helm--mode-line-display-prefarg nil)
|
||||
(setq helm--mode-line-display-prefarg nil
|
||||
helm-fuzzy-sort-fn (default-toplevel-value 'helm-fuzzy-sort-fn))
|
||||
;; Be sure to remove it here as well in case of quit.
|
||||
(remove-hook 'helm-move-selection-after-hook
|
||||
'helm-M-x--move-selection-after-hook)
|
||||
#'helm-M-x--move-selection-after-hook)
|
||||
(remove-hook 'helm-before-action-hook
|
||||
'helm-M-x--before-action-hook))
|
||||
#'helm-M-x--before-action-hook))
|
||||
;; Reset helm-M-x--unwind-forms-done to nil when DONE is
|
||||
;; unspecified.
|
||||
(setq helm-M-x--unwind-forms-done done))
|
|
@ -1,6 +1,6 @@
|
|||
;;; helm-config.el --- Applications library for `helm.el' -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto <thierry.volpiatto@gmail.com>
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto
|
||||
|
||||
;; 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
|
||||
|
@ -18,14 +18,12 @@
|
|||
;;; Commentary:
|
||||
;;
|
||||
;; Requiring this file is not needed when using a package manager to
|
||||
;; install helm as this one will take care of loading the autoload
|
||||
;; file.
|
||||
;; install helm as this one will take care of creating and loading the
|
||||
;; autoload file.
|
||||
|
||||
;;; Code:
|
||||
|
||||
;;; Load the autoload file
|
||||
;; It should have been generated either by
|
||||
;; the package manager or the make file.
|
||||
;;; Load the autoload file generated by the make file.
|
||||
|
||||
(load "helm-autoloads" nil t)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
;;; helm-dabbrev.el --- Helm implementation of dabbrev. -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto <thierry.volpiatto@gmail.com>
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto
|
||||
|
||||
;; 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
|
||||
|
@ -31,7 +31,6 @@
|
|||
Note that even if nil, a search in all buffers will occur if the
|
||||
length of candidates is <= than
|
||||
`helm-dabbrev-max-length-result'."
|
||||
:group 'helm-dabbrev
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom helm-dabbrev-candidates-number-limit 1000
|
||||
|
@ -45,13 +44,11 @@ Note that this have nothing to do with
|
|||
candidates stop when this value is reached but only
|
||||
`helm-candidate-number-limit' candidates are displayed in the
|
||||
Helm buffer."
|
||||
:group 'helm-dabbrev
|
||||
:type 'integer)
|
||||
|
||||
(defcustom helm-dabbrev-ignored-buffers-regexps
|
||||
'("\\*helm" "\\*Messages" "\\*Echo Area" "\\*Buffer List")
|
||||
"List of regexps matching names of buffers that `helm-dabbrev' should not check."
|
||||
:group 'helm-dabbrev
|
||||
:type '(repeat regexp))
|
||||
|
||||
(defcustom helm-dabbrev-related-buffer-fn #'helm-dabbrev--same-major-mode-p
|
||||
|
@ -64,7 +61,6 @@ The function take one arg, the buffer which is current, look at
|
|||
`helm-dabbrev--same-major-mode-p' for an example.
|
||||
|
||||
When nil all buffers are considered related to `current-buffer'."
|
||||
:group 'helm-dabbrev
|
||||
:type 'function)
|
||||
|
||||
(defcustom helm-dabbrev-major-mode-assoc nil
|
||||
|
@ -72,30 +68,27 @@ When nil all buffers are considered related to `current-buffer'."
|
|||
|
||||
This allow helm-dabbrev searching in buffers with the associated
|
||||
`major-mode'.
|
||||
E.g. \(emacs-lisp-mode . lisp-interaction-mode\)
|
||||
E.g. (emacs-lisp-mode . lisp-interaction-mode)
|
||||
|
||||
will allow searching in the lisp-interaction-mode buffer when
|
||||
`current-buffer' is an `emacs-lisp-mode' buffer and vice versa
|
||||
i.e. no need to provide \(lisp-interaction-mode .
|
||||
emacs-lisp-mode\) association.
|
||||
i.e. no need to provide (lisp-interaction-mode .
|
||||
emacs-lisp-mode) association.
|
||||
|
||||
When nil check is the searched buffer has same `major-mode' than
|
||||
the `current-buffer'.
|
||||
|
||||
This has no effect when `helm-dabbrev-related-buffer-fn' is nil
|
||||
or of course bound to a function that doesn't handle this var."
|
||||
:type '(alist :key-type symbol :value-type symbol)
|
||||
:group 'helm-dabbrev)
|
||||
:type '(alist :key-type symbol :value-type symbol))
|
||||
|
||||
(defcustom helm-dabbrev-lineno-around 30
|
||||
"Search first in this number of lines before and after point."
|
||||
:group 'helm-dabbrev
|
||||
:type 'integer)
|
||||
|
||||
(defcustom helm-dabbrev-cycle-threshold 5
|
||||
"Number of time helm-dabbrev cycle before displaying helm completion.
|
||||
When nil or 0 disable cycling."
|
||||
:group 'helm-dabbrev
|
||||
:type '(choice (const :tag "Cycling disabled" nil) integer))
|
||||
|
||||
(defcustom helm-dabbrev-case-fold-search 'smart
|
||||
|
@ -103,10 +96,9 @@ When nil or 0 disable cycling."
|
|||
Same as `helm-case-fold-search' but for `helm-dabbrev'.
|
||||
Note that this is not affecting searching in Helm buffer, but the
|
||||
initial search for all candidates in buffer(s)."
|
||||
:group 'helm-dabbrev
|
||||
:type '(choice (const :tag "Ignore case" t)
|
||||
(const :tag "Respect case" nil)
|
||||
(other :tag "Smart" 'smart)))
|
||||
(other :tag "Smart" smart)))
|
||||
|
||||
(defvaralias 'helm-dabbrev--regexp 'helm-dabbrev-separator-regexp)
|
||||
(make-obsolete-variable 'helm-dabbrev--regexp
|
||||
|
@ -120,8 +112,8 @@ initial search for all candidates in buffer(s)."
|
|||
(defvar helm-dabbrev-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent map helm-map)
|
||||
(define-key map (kbd "M-/") 'helm-next-line)
|
||||
(define-key map (kbd "M-:") 'helm-previous-line)
|
||||
(define-key map (kbd "M-/") #'helm-next-line)
|
||||
(define-key map (kbd "M-:") #'helm-previous-line)
|
||||
map))
|
||||
|
||||
;; Internal
|
||||
|
@ -277,7 +269,7 @@ finally removed."
|
|||
(end (point)))
|
||||
(run-with-timer
|
||||
0.01 nil
|
||||
'helm-insert-completion-at-point
|
||||
#'helm-insert-completion-at-point
|
||||
beg end candidate))))
|
||||
|
||||
;;;###autoload
|
|
@ -1,6 +1,6 @@
|
|||
;;; helm-easymenu.el --- Helm easymenu definitions. -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2015 ~ 2020 Thierry Volpiatto <thierry.volpiatto@gmail.com>
|
||||
;; Copyright (C) 2015 ~ 2020 Thierry Volpiatto
|
||||
|
||||
;; 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
|
|
@ -1,6 +1,6 @@
|
|||
;;; helm-elisp-package.el --- helm interface for package.el -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto <thierry.volpiatto@gmail.com>
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto
|
||||
|
||||
;; 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
|
||||
|
@ -27,7 +27,6 @@
|
|||
|
||||
(defcustom helm-el-package-initial-filter 'all
|
||||
"Show only installed, upgraded or all packages at startup."
|
||||
:group 'helm-el-package
|
||||
:type '(radio :tag "Initial filter for elisp packages"
|
||||
(const :tag "Show all packages" all)
|
||||
(const :tag "Show installed packages" installed)
|
||||
|
@ -36,19 +35,16 @@
|
|||
|
||||
(defcustom helm-el-truncate-lines t
|
||||
"Truncate lines in `helm-buffer' when non-nil."
|
||||
:group 'helm-el-package
|
||||
:type 'boolean)
|
||||
|
||||
|
||||
(defcustom helm-el-package-upgrade-on-start nil
|
||||
"Show package upgrades on startup when non nil."
|
||||
:group 'helm-el-package
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom helm-el-package-autoremove-on-start nil
|
||||
"Try to autoremove no more needed packages on startup.
|
||||
See `package-autoremove'."
|
||||
:group 'helm-el-package
|
||||
:type 'boolean)
|
||||
|
||||
;; internals vars
|
||||
|
@ -365,17 +361,17 @@ See `package-autoremove'."
|
|||
(defvar helm-el-package-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent map helm-map)
|
||||
(define-key map (kbd "M-I") 'helm-el-package-show-installed)
|
||||
(define-key map (kbd "M-O") 'helm-el-package-show-uninstalled)
|
||||
(define-key map (kbd "M-U") 'helm-el-package-show-upgrade)
|
||||
(define-key map (kbd "M-B") 'helm-el-package-show-built-in)
|
||||
(define-key map (kbd "M-A") 'helm-el-package-show-all)
|
||||
(define-key map (kbd "C-c i") 'helm-el-run-package-install)
|
||||
(define-key map (kbd "C-c r") 'helm-el-run-package-reinstall)
|
||||
(define-key map (kbd "C-c d") 'helm-el-run-package-uninstall)
|
||||
(define-key map (kbd "C-c u") 'helm-el-run-package-upgrade)
|
||||
(define-key map (kbd "C-c U") 'helm-el-run-package-upgrade-all)
|
||||
(define-key map (kbd "C-c @") 'helm-el-run-visit-homepage)
|
||||
(define-key map (kbd "M-I") #'helm-el-package-show-installed)
|
||||
(define-key map (kbd "M-O") #'helm-el-package-show-uninstalled)
|
||||
(define-key map (kbd "M-U") #'helm-el-package-show-upgrade)
|
||||
(define-key map (kbd "M-B") #'helm-el-package-show-built-in)
|
||||
(define-key map (kbd "M-A") #'helm-el-package-show-all)
|
||||
(define-key map (kbd "C-c i") #'helm-el-run-package-install)
|
||||
(define-key map (kbd "C-c r") #'helm-el-run-package-reinstall)
|
||||
(define-key map (kbd "C-c d") #'helm-el-run-package-uninstall)
|
||||
(define-key map (kbd "C-c u") #'helm-el-run-package-upgrade)
|
||||
(define-key map (kbd "C-c U") #'helm-el-run-package-upgrade-all)
|
||||
(define-key map (kbd "C-c @") #'helm-el-run-visit-homepage)
|
||||
map))
|
||||
|
||||
(defvar helm-source-list-el-package nil)
|
|
@ -1,6 +1,6 @@
|
|||
;;; helm-elisp.el --- Elisp symbols completion for helm. -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto <thierry.volpiatto@gmail.com>
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto
|
||||
|
||||
;; 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
|
||||
|
@ -56,14 +56,14 @@ This is used in macro `with-helm-show-completion'."
|
|||
callf callf2 cl-callf cl-callf2 fset
|
||||
fboundp fmakunbound symbol-function)
|
||||
"List of function where quoted function completion happen.
|
||||
E.g. give only function names after \(funcall '."
|
||||
E.g. give only function names after (funcall \\='."
|
||||
:group 'helm-elisp
|
||||
:type '(repeat (choice symbol)))
|
||||
|
||||
(defcustom helm-lisp-unquoted-function-list
|
||||
'(function defadvice)
|
||||
"List of function where unquoted function completion happen.
|
||||
E.g. give only function names after \(function ."
|
||||
E.g. give only function names after (function ."
|
||||
:group 'helm-elisp
|
||||
:type '(repeat (choice symbol)))
|
||||
|
||||
|
@ -274,7 +274,7 @@ of symbol before point."
|
|||
|
||||
(defun helm-bounds-of-thing-before-point (&optional regexp)
|
||||
"Get the beginning and end position of `helm-thing-before-point'.
|
||||
Return a cons \(beg . end\)."
|
||||
Return a cons (beg . end)."
|
||||
(helm-thing-before-point 'limits regexp))
|
||||
|
||||
(defun helm-insert-completion-at-point (beg end str)
|
||||
|
@ -331,12 +331,12 @@ Return a cons \(beg . end\)."
|
|||
:fuzzy-match helm-lisp-fuzzy-completion
|
||||
:persistent-help (helm-lisp-completion-persistent-help)
|
||||
:filtered-candidate-transformer
|
||||
'helm-lisp-completion-transformer
|
||||
#'helm-lisp-completion-transformer
|
||||
:action (lambda (candidate)
|
||||
(with-helm-current-buffer
|
||||
(run-with-timer
|
||||
0.01 nil
|
||||
'helm-insert-completion-at-point
|
||||
#'helm-insert-completion-at-point
|
||||
beg end candidate))))
|
||||
:input (if helm-lisp-fuzzy-completion
|
||||
target (concat target " "))
|
||||
|
@ -361,16 +361,16 @@ other window according to the value of
|
|||
|
||||
(defun helm-elisp--show-help-1 (candidate &optional name)
|
||||
(let ((sym (intern-soft candidate)))
|
||||
(cl-typecase sym
|
||||
((and fboundp boundp)
|
||||
(pcase sym
|
||||
((and (pred fboundp) (pred boundp))
|
||||
(if (member name `(,helm-describe-function-function ,helm-describe-variable-function))
|
||||
(funcall (intern (format "helm-%s" name)) sym)
|
||||
;; When there is no way to know what to describe
|
||||
;; prefer describe-function.
|
||||
(helm-describe-function sym)))
|
||||
(fbound (helm-describe-function sym))
|
||||
(bound (helm-describe-variable sym))
|
||||
(face (helm-describe-face sym)))))
|
||||
((pred fboundp) (helm-describe-function sym))
|
||||
((pred boundp) (helm-describe-variable sym))
|
||||
((pred facep) (helm-describe-face sym)))))
|
||||
|
||||
(defun helm-elisp-show-help (candidate &optional name)
|
||||
"Show full help for the function CANDIDATE.
|
||||
|
@ -395,36 +395,46 @@ the same time to variable and a function."
|
|||
"Helm candidates transformer for Lisp completion."
|
||||
(cl-loop for c in candidates
|
||||
for sym = (intern c)
|
||||
for annot = (cl-typecase sym
|
||||
(command " (Com)")
|
||||
(class " (Class)")
|
||||
(cl-generic " (Gen)")
|
||||
(fbound " (Fun)")
|
||||
(bound " (Var)")
|
||||
(face " (Face)"))
|
||||
for annot = (pcase sym
|
||||
((pred commandp) " (Com)")
|
||||
((pred class-p) " (Class)")
|
||||
((pred cl-generic-p) " (Gen)")
|
||||
((pred fboundp) " (Fun)")
|
||||
((pred boundp) " (Var)")
|
||||
((pred facep) " (Face)"))
|
||||
for spaces = (make-string (- helm-lgst-len (length c)) ? )
|
||||
collect (cons (concat c spaces annot) c) into lst
|
||||
finally return (sort lst #'helm-generic-sort-fn)))
|
||||
|
||||
(defun helm-get-first-line-documentation (sym &optional name)
|
||||
"Return first line documentation of symbol SYM.
|
||||
If SYM is not documented, return \"Not documented\"."
|
||||
(let ((doc (cl-typecase sym
|
||||
((and fboundp boundp)
|
||||
(cond ((string= name "describe-function")
|
||||
(cl-defun helm-get-first-line-documentation (sym &optional
|
||||
(name "describe-function")
|
||||
(end-column 72))
|
||||
"Return first line documentation of symbol SYM truncated at END-COLUMN.
|
||||
If SYM is not documented, return \"Not documented\".
|
||||
Argument NAME allows specifiying what function to use to display
|
||||
documentation when SYM name is the same for function and variable."
|
||||
(let ((doc (condition-case _err
|
||||
(pcase sym
|
||||
((and (pred fboundp) (pred boundp))
|
||||
(pcase name
|
||||
("describe-function"
|
||||
(documentation sym t))
|
||||
((string= name "describe-variable")
|
||||
("describe-variable"
|
||||
(documentation-property sym 'variable-documentation t))
|
||||
(t (documentation sym t))))
|
||||
(fbound (documentation sym t))
|
||||
(bound (documentation-property sym 'variable-documentation t))
|
||||
(face (face-documentation sym)))))
|
||||
(_ (documentation sym t))))
|
||||
((pred fboundp) (documentation sym t))
|
||||
((pred boundp) (documentation-property
|
||||
sym 'variable-documentation t))
|
||||
((pred facep) (face-documentation sym)))
|
||||
(void-function "Void function -- Not documented"))))
|
||||
(if (and doc (not (string= doc ""))
|
||||
;; `documentation' return "\n\n(args...)"
|
||||
;; for CL-style functions.
|
||||
(not (string-match-p "^\n\n" doc)))
|
||||
;; Some commands specify key bindings in their first line.
|
||||
(truncate-string-to-width
|
||||
(substitute-command-keys (car (split-string doc "\n")))
|
||||
end-column nil nil t)
|
||||
"Not documented")))
|
||||
|
||||
;;; File completion.
|
||||
|
@ -489,33 +499,54 @@ double quote."
|
|||
;;
|
||||
(defvar helm-apropos-history nil)
|
||||
|
||||
(defun helm-apropos-init (test default)
|
||||
"Init candidates buffer for `helm-apropos' sources."
|
||||
(defcustom helm-apropos-show-short-doc nil
|
||||
"Show short docstring of symbols when non nil.
|
||||
|
||||
NOTE: When displaying helm-apropos in a frame, i.e. when
|
||||
`helm-apropos' is member of `helm-commands-using-frame' setting this
|
||||
to non nil have no effect, you have first to remove `helm-apropos'
|
||||
from `helm-commands-using-frame'."
|
||||
:group 'helm-elisp
|
||||
:type 'boolean)
|
||||
|
||||
(defvar helm-apropos-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent map helm-map)
|
||||
(define-key map (kbd "C-]") #'helm-apropos-toggle-details)
|
||||
map))
|
||||
|
||||
(defun helm-apropos-init (test default &optional fn)
|
||||
"Setup `helm-candidate-buffer' for `helm-apropos' sources.
|
||||
A list of symbols fetched with FN is inserted in
|
||||
`helm-candidate-buffer', if FN is not provided symbols are fetched
|
||||
against obarray with predicate TEST. When FN is provided predicate TEST
|
||||
is only used to test DEFAULT."
|
||||
(require 'helm-help)
|
||||
(helm-init-candidates-in-buffer 'global
|
||||
(let ((default-symbol (and (stringp default)
|
||||
(intern-soft default)))
|
||||
(symbols (all-completions "" obarray test)))
|
||||
(symbols (if fn (funcall fn) (all-completions "" obarray test))))
|
||||
(if (and default-symbol (funcall test default-symbol))
|
||||
(cons default-symbol symbols)
|
||||
symbols))))
|
||||
|
||||
(defun helm-apropos-init-faces (default)
|
||||
"Init candidates buffer for faces for `helm-apropos'."
|
||||
(require 'helm-help)
|
||||
(with-current-buffer (helm-candidate-buffer 'global)
|
||||
(goto-char (point-min))
|
||||
(let ((default-symbol (and (stringp default)
|
||||
(intern-soft default)))
|
||||
(faces (face-list)))
|
||||
(when (and default-symbol (facep default-symbol))
|
||||
(insert (concat default "\n")))
|
||||
(insert
|
||||
(mapconcat #'prin1-to-string
|
||||
(if default
|
||||
(cl-remove-if (lambda (sym) (string= sym default)) faces)
|
||||
faces)
|
||||
"\n")))))
|
||||
(defun helm-apropos-short-doc-transformer (candidates _source)
|
||||
(if helm-apropos-show-short-doc
|
||||
(cl-loop with max-len = (buffer-local-value 'helm-candidate-buffer-longest-len
|
||||
(get-buffer (helm-candidate-buffer)))
|
||||
for cand in candidates
|
||||
for doc = (helm-get-first-line-documentation (intern-soft cand))
|
||||
collect (cons (format "%s%s%s"
|
||||
cand
|
||||
(if doc
|
||||
(make-string (+ 1 (if (zerop max-len)
|
||||
max-len
|
||||
(- max-len (string-width cand))))
|
||||
? )
|
||||
"")
|
||||
(if doc (propertize doc 'face 'helm-M-x-short-doc) ""))
|
||||
cand))
|
||||
candidates))
|
||||
|
||||
(defun helm-apropos-default-sort-fn (candidates _source)
|
||||
(if (string= helm-pattern "")
|
||||
|
@ -561,7 +592,7 @@ double quote."
|
|||
(cond ((custom-variable-p sym)
|
||||
(append
|
||||
actions
|
||||
(let ((standard-value (eval (car (get sym 'standard-value)))))
|
||||
(let ((standard-value (eval (car (get sym 'standard-value)) t)))
|
||||
(unless (equal standard-value (symbol-value sym))
|
||||
`(("Reset Variable to default value"
|
||||
. ,(lambda (candidate)
|
||||
|
@ -585,13 +616,17 @@ double quote."
|
|||
(helm-apropos-init
|
||||
(lambda (x) (and (boundp x) (not (keywordp x)))) default))
|
||||
:fuzzy-match helm-apropos-fuzzy-match
|
||||
:filtered-candidate-transformer (and (null helm-apropos-fuzzy-match)
|
||||
:filtered-candidate-transformer
|
||||
(delq nil (list (and (null helm-apropos-fuzzy-match)
|
||||
'helm-apropos-default-sort-fn)
|
||||
(and (null (memq 'helm-apropos helm-commands-using-frame))
|
||||
#'helm-apropos-short-doc-transformer)))
|
||||
:nomark t
|
||||
:persistent-action (lambda (candidate)
|
||||
(helm-elisp--persistent-help
|
||||
candidate 'helm-describe-variable))
|
||||
:persistent-help "Toggle describe variable"
|
||||
:keymap helm-apropos-map
|
||||
:action '(("Describe variable" . helm-describe-variable)
|
||||
("Find variable" . helm-find-variable)
|
||||
("Info lookup" . helm-info-lookup-symbol)
|
||||
|
@ -602,19 +637,22 @@ double quote."
|
|||
"Create `helm' source for faces to be displayed with
|
||||
`helm-apropos'."
|
||||
(helm-build-in-buffer-source "Faces"
|
||||
:init (lambda () (helm-apropos-init-faces default))
|
||||
:init (lambda () (helm-apropos-init 'facep default #'face-list))
|
||||
:fuzzy-match helm-apropos-fuzzy-match
|
||||
:filtered-candidate-transformer
|
||||
(append (and (null helm-apropos-fuzzy-match)
|
||||
'(helm-apropos-default-sort-fn))
|
||||
(list
|
||||
(delq nil (list
|
||||
(and (null helm-apropos-fuzzy-match)
|
||||
#'helm-apropos-default-sort-fn)
|
||||
(lambda (candidates _source)
|
||||
(cl-loop for c in candidates
|
||||
collect (propertize c 'face (intern c))))))
|
||||
collect (propertize c 'face (intern c))))
|
||||
(and (null (memq 'helm-apropos helm-commands-using-frame))
|
||||
#'helm-apropos-short-doc-transformer)))
|
||||
:persistent-action (lambda (candidate)
|
||||
(helm-elisp--persistent-help
|
||||
candidate 'helm-describe-face))
|
||||
:persistent-help "Toggle describe face"
|
||||
:keymap helm-apropos-map
|
||||
:action '(("Describe face" . helm-describe-face)
|
||||
("Find face" . helm-find-face-definition)
|
||||
("Customize face" . (lambda (candidate)
|
||||
|
@ -636,6 +674,7 @@ double quote."
|
|||
(helm-elisp--persistent-help
|
||||
candidate 'helm-describe-function))
|
||||
:persistent-help "Toggle describe command"
|
||||
:keymap helm-apropos-map
|
||||
:action 'helm-type-function-actions))
|
||||
|
||||
(defun helm-def-source--emacs-functions (&optional default)
|
||||
|
@ -648,13 +687,17 @@ double quote."
|
|||
(not (class-p x))))
|
||||
default))
|
||||
:fuzzy-match helm-apropos-fuzzy-match
|
||||
:filtered-candidate-transformer (and (null helm-apropos-fuzzy-match)
|
||||
:filtered-candidate-transformer
|
||||
(delq nil (list (and (null helm-apropos-fuzzy-match)
|
||||
'helm-apropos-default-sort-fn)
|
||||
(and (null (memq 'helm-apropos helm-commands-using-frame))
|
||||
#'helm-apropos-short-doc-transformer)))
|
||||
:display-to-real 'helm-symbolify
|
||||
:persistent-action (lambda (candidate)
|
||||
(helm-elisp--persistent-help
|
||||
candidate 'helm-describe-function))
|
||||
:persistent-help "Toggle describe function"
|
||||
:keymap helm-apropos-map
|
||||
:nomark t
|
||||
:action 'helm-type-function-actions))
|
||||
|
||||
|
@ -665,13 +708,17 @@ double quote."
|
|||
(class-p x))
|
||||
default))
|
||||
:fuzzy-match helm-apropos-fuzzy-match
|
||||
:filtered-candidate-transformer (and (null helm-apropos-fuzzy-match)
|
||||
:filtered-candidate-transformer
|
||||
(delq nil (list (and (null helm-apropos-fuzzy-match)
|
||||
'helm-apropos-default-sort-fn)
|
||||
(and (null (memq 'helm-apropos helm-commands-using-frame))
|
||||
#'helm-apropos-short-doc-transformer)))
|
||||
:nomark t
|
||||
:persistent-action (lambda (candidate)
|
||||
(helm-elisp--persistent-help
|
||||
candidate 'helm-describe-class))
|
||||
:persistent-help "Toggle describe class"
|
||||
:keymap helm-apropos-map
|
||||
:action '(("Describe Class" . helm-describe-class)
|
||||
("Find Class" . helm-find-function)
|
||||
("Info lookup" . helm-info-lookup-symbol))))
|
||||
|
@ -683,13 +730,17 @@ double quote."
|
|||
(cl-generic-p x))
|
||||
default))
|
||||
:fuzzy-match helm-apropos-fuzzy-match
|
||||
:filtered-candidate-transformer (and (null helm-apropos-fuzzy-match)
|
||||
:filtered-candidate-transformer
|
||||
(delq nil (list (and (null helm-apropos-fuzzy-match)
|
||||
'helm-apropos-default-sort-fn)
|
||||
(and (null (memq 'helm-apropos helm-commands-using-frame))
|
||||
#'helm-apropos-short-doc-transformer)))
|
||||
:nomark t
|
||||
:persistent-action (lambda (candidate)
|
||||
(helm-elisp--persistent-help
|
||||
candidate 'helm-describe-function))
|
||||
:persistent-help "Toggle describe generic function"
|
||||
:keymap helm-apropos-map
|
||||
:action '(("Describe function" . helm-describe-function)
|
||||
("Find function" . helm-find-function)
|
||||
("Info lookup" . helm-info-lookup-symbol))))
|
||||
|
@ -735,6 +786,16 @@ double quote."
|
|||
;; (run-with-idle-timer 0.01 nil #'helm-info-lookup-symbol-1 candidate)
|
||||
(helm-info-lookup-symbol-1 candidate))
|
||||
|
||||
(defun helm-apropos-toggle-details ()
|
||||
"Toggle details in `helm-apropos'."
|
||||
(interactive)
|
||||
(with-helm-buffer
|
||||
(unless (memq 'helm-apropos helm-commands-using-frame)
|
||||
(setq helm-M-x-show-short-doc (not helm-M-x-show-short-doc)
|
||||
helm-apropos-show-short-doc (not helm-apropos-show-short-doc))
|
||||
(helm-force-update (concat "^" (helm-stringify (helm-get-selection)))
|
||||
(helm-get-current-source)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun helm-apropos (default)
|
||||
"Preconfigured Helm to describe commands, functions, variables and faces.
|
||||
|
@ -742,14 +803,17 @@ In non interactives calls DEFAULT argument should be provided as
|
|||
a string, i.e. the `symbol-name' of any existing symbol."
|
||||
(interactive (list (with-syntax-table emacs-lisp-mode-syntax-table
|
||||
(thing-at-point 'symbol))))
|
||||
(let (helm-M-x-show-short-doc)
|
||||
(let ((helm-M-x-show-short-doc
|
||||
(and helm-apropos-show-short-doc
|
||||
(null (memq 'helm-apropos helm-commands-using-frame)))))
|
||||
(helm :sources
|
||||
(mapcar (lambda (func)
|
||||
(funcall func default))
|
||||
helm-apropos-function-list)
|
||||
:history 'helm-apropos-history
|
||||
:buffer "*helm apropos*"
|
||||
:preselect (and default (concat "\\_<" (regexp-quote default) "\\_>")))))
|
||||
:preselect (and default (concat "^\\_<" (regexp-quote default) "\\_>"))
|
||||
:truncate-lines t)))
|
||||
|
||||
|
||||
;;; Advices
|
||||
|
@ -903,13 +967,16 @@ a string, i.e. the `symbol-name' of any existing symbol."
|
|||
(format "%s repeat=%s %s(%s)"
|
||||
(let ((time (timer--time timer)))
|
||||
(if (timer--idle-delay timer)
|
||||
(format-time-string "idle-for=%5s" time)
|
||||
(format "idle-for=[%s]"
|
||||
(format-seconds "%dd %hh %mmin %z%,3ss"
|
||||
(time-convert time t)))
|
||||
(format-time-string "%m/%d %T" time)))
|
||||
(or (timer--repeat-delay timer) "nil")
|
||||
(mapconcat 'identity (split-string
|
||||
(mapconcat #'identity (split-string
|
||||
(prin1-to-string (timer--function timer))
|
||||
"\n") " ")
|
||||
(mapconcat 'prin1-to-string (timer--args timer) " ")))
|
||||
"\n")
|
||||
" ")
|
||||
(mapconcat #'prin1-to-string (timer--args timer) " ")))
|
||||
|
||||
;;;###autoload
|
||||
(defun helm-timers ()
|
||||
|
@ -934,7 +1001,7 @@ a string, i.e. the `symbol-name' of any existing symbol."
|
|||
;; an interactive call, See `repeat-complex-command'.
|
||||
(add-hook 'called-interactively-p-functions
|
||||
#'helm-complex-command-history--called-interactively-skip)
|
||||
(eval (read helm-sexp--last-sexp)))
|
||||
(eval (read helm-sexp--last-sexp) t))
|
||||
(remove-hook 'called-interactively-p-functions
|
||||
#'helm-complex-command-history--called-interactively-skip)))
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
;;; helm-epa.el --- helm interface for epa/epg
|
||||
;;; helm-epa.el --- helm interface for epa/epg -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto <thievol@posteo.net>
|
||||
|
||||
|
@ -170,7 +170,7 @@
|
|||
(signal (car error) (cdr error))))
|
||||
(message "Deleting gpg keys done")))
|
||||
|
||||
(defun helm-epa-encrypt-file (candidate)
|
||||
(defun helm-epa-encrypt-file (_candidate)
|
||||
"Select a file to encrypt with key CANDIDATE."
|
||||
(let* ((file (helm-read-file-name "Encrypt file: "))
|
||||
(cands (helm-marked-candidates))
|
||||
|
@ -216,7 +216,7 @@
|
|||
(epa-sign-region start end candidate mode))
|
||||
(message "Mail signed with key `%s %s'" key id)))
|
||||
|
||||
(defun helm-epa-mail-encrypt (candidate)
|
||||
(defun helm-epa-mail-encrypt (_candidate)
|
||||
"Encrypt email with key CANDIDATE."
|
||||
(let ((cands (helm-marked-candidates))
|
||||
start end)
|
|
@ -1,6 +1,6 @@
|
|||
;;; helm-eshell.el --- pcomplete and eshell completion for helm. -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto <thierry.volpiatto@gmail.com>
|
||||
;; Copyright (C) 2012 ~ 2021 Thierry Volpiatto
|
||||
|
||||
;; 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
|
||||
|
@ -50,21 +50,20 @@
|
|||
|
||||
(defcustom helm-eshell-fuzzy-match nil
|
||||
"Enable fuzzy matching in `helm-esh-pcomplete' when non-nil."
|
||||
:group 'helm-eshell
|
||||
:type 'boolean)
|
||||
|
||||
|
||||
(defvar helm-eshell-history-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent map helm-map)
|
||||
(define-key map (kbd "M-p") 'helm-next-line)
|
||||
(define-key map (kbd "M-p") #'helm-next-line)
|
||||
map)
|
||||
"Keymap for `helm-eshell-history'.")
|
||||
|
||||
(defvar helm-esh-completion-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent map helm-map)
|
||||
(define-key map (kbd "TAB") 'helm-next-line)
|
||||
(define-key map (kbd "TAB") #'helm-next-line)
|
||||
map)
|
||||
"Keymap for `helm-esh-pcomplete'.")
|
||||
|
||||
|
@ -116,7 +115,7 @@ at point."
|
|||
(t
|
||||
(file-relative-name i)))
|
||||
into lst
|
||||
finally return (sort lst 'helm-generic-sort-fn)))
|
||||
finally return (sort lst #'helm-generic-sort-fn)))
|
||||
|
||||
(defclass helm-esh-source (helm-source-sync)
|
||||
((init :initform (lambda ()
|
||||
|
@ -305,7 +304,7 @@ at point."
|
|||
;; Set helm-eshell--quit-flag to non-nil only on
|
||||
;; quit, this tells to not add final suffix when quitting
|
||||
;; helm.
|
||||
(add-hook 'helm-quit-hook 'helm-eshell--quit-hook-fn)
|
||||
(add-hook 'helm-quit-hook #'helm-eshell--quit-hook-fn)
|
||||
(with-helm-show-completion beg end
|
||||
(unwind-protect
|
||||
(or (helm-esh-pcomplete--make-helm
|
||||
|
@ -332,7 +331,7 @@ at point."
|
|||
(when (and helm-eshell--quit-flag
|
||||
(string-match-p "[.]\\{2\\}\\'" last))
|
||||
(insert "/"))))
|
||||
(remove-hook 'helm-quit-hook 'helm-eshell--quit-hook-fn)
|
||||
(remove-hook 'helm-quit-hook #'helm-eshell--quit-hook-fn)
|
||||
(setq helm-eshell--quit-flag nil)))))))
|
||||
|
||||
(defun helm-eshell--quit-hook-fn ()
|
||||
|
@ -368,25 +367,22 @@ at point."
|
|||
(defface helm-eshell-prompts-promptidx
|
||||
`((t ,@(and (>= emacs-major-version 27) '(:extend t))
|
||||
:foreground "cyan"))
|
||||
"Face used to highlight Eshell prompt index."
|
||||
:group 'helm-eshell-faces)
|
||||
"Face used to highlight Eshell prompt index.")
|
||||
|
||||
(defface helm-eshell-prompts-buffer-name
|
||||
`((t ,@(and (>= emacs-major-version 27) '(:extend t))
|
||||
:foreground "green"))
|
||||
"Face used to highlight Eshell buffer name."
|
||||
:group 'helm-eshell-faces)
|
||||
"Face used to highlight Eshell buffer name.")
|
||||
|
||||
(defcustom helm-eshell-prompts-promptidx-p t
|
||||
"Show prompt number."
|
||||
:group 'helm-eshell
|
||||
:type 'boolean)
|
||||
|
||||
(defvar helm-eshell-prompts-keymap
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(set-keymap-parent map helm-map)
|
||||
(define-key map (kbd "C-c o") 'helm-eshell-prompts-other-window)
|
||||
(define-key map (kbd "C-c C-o") 'helm-eshell-prompts-other-frame)
|
||||
(define-key map (kbd "C-c o") #'helm-eshell-prompts-other-window)
|
||||
(define-key map (kbd "C-c C-o") #'helm-eshell-prompts-other-frame)
|
||||
map)
|
||||
"Keymap for `helm-eshell-prompt-all'.")
|
||||
|
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue