changeset 86: |
a86cb552d6df |
parent: |
862659891933
|
child: |
978ce75e54af |
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Wed, 21 Aug 2024 20:29:13 -0400 |
permissions: |
-rw-r--r-- |
description: |
stumpwm utils |
1 ;;; ellis.el --- user Emacs config -*- lexical-binding: t -*- 5 ;; Author: Richard Westhaver <ellis@rwest.io> 7 ;; This program is free software; you can redistribute it and/or modify 8 ;; it under the terms of the GNU General Public License as published by 9 ;; the Free Software Foundation, either version 3 of the License, or 10 ;; (at your option) any later version. 12 ;; This program is distributed in the hope that it will be useful, 13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 ;; GNU General Public License for more details. 17 ;; You should have received a copy of the GNU General Public License 18 ;; along with this program. If not, see <https://www.gnu.org/licenses/>. 22 ;; This is an example of what you may want to add to your custom 23 ;; config file. Feel free to rip. 31 (defalias 'make #'compile) 33 (setopt default-theme 'ef-dream 34 user-lab-directory (join-paths user-home-directory "lab") 35 company-source-directory (join-paths user-home-directory "comp")) 37 ;; (unless (display-graphic-p) (setq default-theme 'wheatgrass)) 39 (when (linux-p) (setq dired-listing-switches "-alsh")) 41 (defvar emacs-config-source (join-paths company-source-directory "core/emacs")) 44 (defun edit-emacs-config (&optional src) 45 (interactive (list current-prefix-arg)) 47 (expand-file-name "default.el" emacs-config-source) 51 (keymap-set user-map "e c" #'edit-emacs-config) 52 (keymap-set emacs-lisp-mode-map "C-c C-l" #'load-file) 53 (keymap-set emacs-lisp-mode-map "C-c M-k" #'elisp-byte-compile-file) 54 (keymap-set user-map "v t" #'org-tags-view) 59 (keymap-set lisp-mode-shared-map "C-(" #'paredit-open-round) 60 (keymap-set lisp-mode-shared-map "M-(" #'paredit-wrap-sexp) 61 (keymap-set lisp-mode-shared-map "M-;" #'paredit-comment-dwim) 62 (keymap-set lisp-mode-shared-map "C-{" #'paredit-backward-barf-sexp) 63 (keymap-set lisp-mode-shared-map "C-}" #'paredit-forward-barf-sexp) 64 (keymap-set lisp-mode-shared-map "C-M-{" #'paredit-forward-slurp-sexp) 65 (keymap-set lisp-mode-shared-map "C-M-}" #'paredit-backward-slurp-sexp) 67 (defun remember-project () 69 (project-remember-project (project-current)) 72 (defun remember-lab-projects () 74 (project-remember-projects-under user-lab-directory t)) 76 (defun remember-comp-projects () 78 (project-remember-projects-under company-source-directory t)) 80 (keymap-global-set "C-<tab>" #'hippie-expand) 81 (keymap-set minibuffer-local-map "C-<tab>" #'hippie-expand) 82 (keymap-set ctl-x-x-map "p p" #'remember-project) 83 (keymap-set ctl-x-x-map "p l" #'remember-lab-projects) 84 (keymap-set ctl-x-x-map "p c" #'remember-comp-projects) 86 (add-hook 'prog-mode-hook #'skel-minor-mode) 87 (add-hook 'org-mode-hook #'skel-minor-mode) 88 ;; (add-hook 'prog-mode-hook #'company-mode) 90 (add-hook 'notmuch-message-mode-hook #'turn-on-orgtbl) 92 ouse-package ef-themes :ensure t) 94 (use-package markdown-mode :ensure t) 96 (use-package ol-notmuch :ensure t) 102 mail-user-agent 'message-user-agent 103 smtpmail-smtp-server "smtp.gmail.com" 104 message-send-mail-function 'message-smtpmail-send-it 105 smtpmail-debug-info t 106 message-default-mail-headers "Cc: \nBcc: \n" 107 message-kill-buffer-on-exit t 108 user-mail-address "richard.westhaver@gmail.com" 109 user-full-name "Richard Westhaver" 110 notmuch-hello-sections '(notmuch-hello-insert-saved-searches 111 notmuch-hello-insert-search 112 notmuch-hello-insert-recent-searches 113 notmuch-hello-insert-alltags) 114 notmuch-show-logo nil 115 notmuch-search-oldest-first nil 116 notmuch-hello-hide-tags '("kill") 117 notmuch-saved-searches '((:name "inbox" :query "tag:inbox" :key "i") 118 (:name "unread" :query "tag:unread" :key "u") 119 (:name "new" :query "tag:new" :key "n") 120 (:name "sent" :query "tag:sent" :key "e") 121 (:name "drafts" :query "tag:draft" :key "d") 122 (:name "all mail" :query "*" :key "a") 123 (:name "todo" :query "tag:todo" :key "t"))) 126 (defun notmuch-exec-offlineimap () 127 "execute offlineimap command and tag new mail with notmuch" 129 (start-process-shell-command "offlineimap" 132 (notmuch-refresh-all-buffers)) 134 (defun offlineimap-get-password (host port) 135 (let* ((netrc (netrc-parse (expand-file-name "~/.netrc.gpg"))) 136 (hostentry (netrc-machine netrc host port port))) 137 (when hostentry (netrc-get hostentry "password")))) 139 (defun mark-as-read () 140 "mark message as read." 142 (notmuch-search-tag '("-new" "-unread" "-inbox"))) 144 (defun mark-as-todo () 145 "mark message as todo." 148 (notmuch-search-tag '("-new" "-unread" "-inbox" "+todo"))) 150 (defun mark-as-spam () 151 "mark message as spam." 154 (notmuch-search-tag (list "+spam"))) 156 (keymap-set user-map "e m" #'notmuch) 157 (keymap-set user-map "e M" #'notmuch-exec-offlineimap) 158 (keymap-set notmuch-search-mode-map "S" #'mark-as-spam) 159 (keymap-set notmuch-search-mode-map "R" #'mark-as-read) 160 (keymap-set notmuch-search-mode-map "T" #'mark-as-todo)) 166 '(("http://threesixty360.wordpress.com/feed/" blog math) 167 ("http://www.50ply.com/atom.xml" blog dev) 168 ("http://blog.cryptographyengineering.com/feeds/posts/default" blog) 169 ("http://abstrusegoose.com/feed.xml" comic) 170 ("http://accidental-art.tumblr.com/rss" image math) 171 ("http://researchcenter.paloaltonetworks.com/unit42/feed/" security) 172 ("http://curiousprogrammer.wordpress.com/feed/" blog dev) 173 ("http://feeds.feedburner.com/amazingsuperpowers" comic) 174 ("http://amitp.blogspot.com/feeds/posts/default" blog dev) 175 ("http://pages.cs.wisc.edu/~psilord/blog/rssfeed.rss" blog) 176 ("http://www.anticscomic.com/?feed=rss2" comic) 177 ("http://feeds.feedburner.com/blogspot/TPQSS" blog dev) 178 ("http://techchrunch.com/feeds" tech news) 179 ("https://rss.nytimes.com/services/xml/rss/nyt/Technology.xml" tech news) 180 ("https://static.fsf.org/fsforg/rss/news.xml" tech news) 181 ("https://feeds.npr.org/1001/rss.xml" news) 182 ("https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=10000664" fin news) 183 ("https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=19854910" tech news) 184 ("https://search.cnbc.com/rs/search/combinedcms/view.xml?partnerId=wrss01&id=100003114" us news) 185 ("http://arxiv.org/rss/cs" cs rnd) 186 ("http://arxiv.org/rss/math" math rnd) 187 ("http://arxiv.org/rss/q-fin" q-fin rnd) 188 ("http://arxiv.org/rss/stat" stat rnd) 189 ("http://arxiv.org/rss/econ" econ rnd) 191 ("http://newartisans.com/rss.xml" dev blog) 193 ;; ("https://lab.rwest.io/comp.atom?feed_token=pHu9qwLkjy4CWJHx9rrJ" comp vc) 194 ("https://www.reddit.com/r/listentothis/.rss" music reddit) 195 ("https://www.ftc.gov/feeds/press-release-consumer-protection.xml" gov ftc) 196 ("https://api2.fcc.gov/edocs/public/api/v1/rss/" gov fcc) 199 (defun yt-dl-it (url) 200 "Downloads the URL in an async shell" 201 (let ((default-directory user-stash-directory)) 202 (async-shell-command (format "yt-dlp %s" url)))) 204 (defun elfeed-youtube-dl (&optional use-generic-p) 207 (let ((entries (elfeed-search-selected))) 208 (cl-loop for entry in entries 209 do (elfeed-untag entry 'unread) 210 when (elfeed-entry-link entry) 212 (mapc #'elfeed-search-update-entry entries) 213 (unless (use-region-p) (forward-line)))) 215 (keymap-set elfeed-search-mode-map "d" 'elfeed-youtube-dl) 216 (keymap-set user-map "e f" #'elfeed) 217 (keymap-set user-map "e F" #'elfeed-update)) 219 (use-package elfeed-tube 223 ;; (elfeed-tube-setup) 224 (elfeed-tube-add-feeds '("detroit techno" "boiler room dj" "brad mehldau" "chris 'daddy' dave")) 225 :bind (:map elfeed-show-mode-map 226 ("F" . elfeed-tube-fetch) 227 ([remap save-buffer] . elfeed-tube-save) 228 :map elfeed-search-mode-map 229 ("F" . elfeed-tube-fetch) 230 ([remap save-buffer] . elfeed-tube-save))) 232 (use-package elfeed-tube-mpv 234 :bind (:map elfeed-show-mode-map 235 ("C-c C-f" . elfeed-tube-mpv-follow-mode) 236 ("C-c C-w" . elfeed-tube-mpv-where))) 238 (use-package org-mime :ensure t) 240 (use-package sh-script 241 :hook (sh-mode . flymake-mode)) 244 (setq publish-dir "/ssh:rurik:/srv/http/compiler.company") 245 (keymap-set user-map "t" #'org-todo) 247 ;; populate org-babel 248 (org-babel-do-load-languages 249 ;; TODO 2021-10-24: bqn, apl, k 250 'org-babel-load-languages '((shell . t) 265 (setq erc-format-nick-function 'erc-format-@nick) 270 (erc-tls :server "irc.libera.chat" :port 6697 271 :client-certificate '("/mnt/y/data/private/krypt/libera.pem")) 272 (setq erc-autojoin-channels-alist '(("irc.libera.chat" "#emacs") 273 ("irc.libera.chat" "#linux") 274 ("irc.libera.chat" "#rust") 275 ("irc.libera.chat" "#btrfs") 276 ("irc.libera.chat" "#lisp") 277 ("irc.libera.chat" "#sbcl") 278 ("irc.oftc.net" "#llvm")))) 281 (defun refresh-tags () 282 "Refresh TAGS database in `user-emacs-directory'." 284 (let ((default-directory user-emacs-directory)) 288 ~/comp/core/emacs/*.el \\ 289 ~/comp/core/emacs/lib/*.el \\ 292 (unless (string-equal "hyde" system-name) 293 (add-hook 'dired-mode-hook #'all-the-icons-dired-mode) 294 (add-hook 'ibuffer-mode-hook #'all-the-icons-ibuffer-mode)) 297 ;; (setq slime-enable-evaluate-in-emacs t) 299 (defun org-word-count (beg end 300 &optional count-latex-macro-args? 302 "Report the number of words in the Org mode buffer or selected region. 306 - source code blocks (#+BEGIN_SRC ... #+END_SRC, and inline blocks) 307 - hyperlinks (but does count words in hyperlink descriptions) 308 - tags, priorities, and TODO keywords in headers 309 - sections tagged as 'not for export'. 311 The text of footnote definitions is ignored, unless the optional argument 312 COUNT-FOOTNOTES? is non-nil. 314 If the optional argument COUNT-LATEX-MACRO-ARGS? is non-nil, the word count 315 includes LaTeX macro arguments (the material between {curly braces}). 316 Otherwise, and by default, every LaTeX macro counts as 1 word regardless 320 (setf beg (point-min) 323 (latex-macro-regexp "\\\\[A-Za-z]+\\(\\[[^]]*\\]\\|\\){\\([^}]*\\)}")) 326 (while (< (point) end) 329 ((or (org-in-commented-line) (org-at-table-p)) 331 ;; Ignore hyperlinks. But if link has a description, count 332 ;; the words within the description. 333 ((looking-at org-bracket-link-analytic-regexp) 334 (when (match-string-no-properties 5) 335 (let ((desc (match-string-no-properties 5))) 337 (cl-incf wc (length (remove "" (org-split-string 339 (goto-char (match-end 0))) 340 ((looking-at org-any-link-re) 341 (goto-char (match-end 0))) 342 ;; Ignore source code blocks. 343 ((org-in-regexps-block-p "^#\\+BEGIN_SRC\\W" "^#\\+END_SRC\\W") 345 ;; Ignore inline source blocks, counting them as 1 word. 348 (looking-at org-babel-inline-src-block-regexp)) 349 (goto-char (match-end 0)) 351 ;; Count latex macros as 1 word, ignoring their arguments. 354 (looking-at latex-macro-regexp)) 355 (goto-char (if count-latex-macro-args? 360 ((and (not count-footnotes?) 361 (or (org-footnote-at-definition-p) 362 (org-footnote-at-reference-p))) 365 (let ((contexts (org-context))) 367 ;; Ignore tags and TODO keywords, etc. 368 ((or (assoc :todo-keyword contexts) 369 (assoc :priority contexts) 370 (assoc :keyword contexts) 371 (assoc :checkbox contexts)) 373 ;; Ignore sections marked with tags that are 374 ;; excluded from export. 375 ((assoc :tags contexts) 376 (if (intersection (org-get-tags-at) org-export-exclude-tags 378 (org-forward-same-level 1) 382 (re-search-forward "\\w+\\W*"))) 383 (message (format "%d words in %s." wc 384 (if mark-active "region" "buffer"))))) 386 (defun org-check-misformatted-subtree () 387 "Check misformatted entries in the current buffer." 392 (when (and (move-beginning-of-line 2) 393 (not (looking-at org-heading-regexp))) 394 (if (or (and (org-get-scheduled-time (point)) 395 (not (looking-at (concat "^.*" org-scheduled-regexp)))) 396 (and (org-get-deadline-time (point)) 397 (not (looking-at (concat "^.*" org-deadline-regexp))))) 398 (when (y-or-n-p "Fix this subtree? ") 399 (message "Call the function again when you're done fixing this subtree.") 401 (message "All subtrees checked.")))))) 403 (defun org-sort-list-by-checkbox-type () 404 "Sort list items according to Checkbox state." 409 (if (looking-at org-list-full-item-re) 410 (cdr (assoc (match-string 3) 411 '(("[X]" . 1) ("[-]" . 2) ("[ ]" . 3) (nil . 4)))) 414 (defun org-time-string-to-seconds (s) 415 "Convert a string HH:MM:SS to a number of seconds." 418 (string-match "\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\)" s)) 419 (let ((hour (string-to-number (match-string 1 s))) 420 (min (string-to-number (match-string 2 s))) 421 (sec (string-to-number (match-string 3 s)))) 422 (+ (* hour 3600) (* min 60) sec))) 424 (string-match "\\([0-9]+\\):\\([0-9]+\\)" s)) 425 (let ((min (string-to-number (match-string 1 s))) 426 (sec (string-to-number (match-string 2 s)))) 428 ((stringp s) (string-to-number s)) 431 (defun org-time-seconds-to-string (secs) 432 "Convert a number of seconds to a time string." 433 (cond ((>= secs 3600) (format-seconds "%h:%.2m:%.2s" secs)) 434 ((>= secs 60) (format-seconds "%m:%.2s" secs)) 435 (t (format-seconds "%s" secs)))) 437 (defmacro with-time (time-output-p &rest exprs) 438 "Evaluate an org-table formula, converting all fields that look 439 like time data to integer seconds. If TIME-OUTPUT-P then return 440 the result as a time value." 442 (if time-output-p 'org-time-seconds-to-string 'identity) 450 (list 'with-time nil el) 451 (org-time-string-to-seconds el))) 455 (defun org-hex-strip-lead (str) 456 (if (and (> (length str) 2) (string= (substring str 0 2) "0x")) 457 (substring str 2) str)) 459 (defun org-hex-to-hex (int) 462 (defun org-hex-to-dec (str) 465 (string-match "\\([0-9a-f]+\\)" (setf str (org-hex-strip-lead str)))) 469 (setf out (+ (* out 16) 470 (if (and (>= ch 48) (<= ch 57)) (- ch 48) (- ch 87))))) 471 (coerce (match-string 1 str) 'list)) 473 ((stringp str) (string-to-number str)) 476 (defmacro with-hex (hex-output-p &rest exprs) 477 "Evaluate an org-table formula, converting all fields that look 478 like hexadecimal to decimal integers. If HEX-OUTPUT-P then 479 return the result as a hex value." 481 (if hex-output-p 'org-hex-to-hex 'identity) 488 (list 'with-hex nil el) 489 (org-hex-to-dec el))) 493 (require 'mm-url) ; to include mm-url-decode-entities-string 495 (defun org-insert-link-with-title () 496 "Insert org link where default description is set to html title." 498 (let* ((url (read-string "URL: ")) 499 (title (get-html-title-from-url url))) 500 (org-insert-link nil url title))) 502 (defun get-html-title-from-url (url) 503 "Return content in <title> tag." 504 (let (x1 x2 (download-buffer (url-retrieve-synchronously url))) 506 (set-buffer download-buffer) 507 (beginning-of-buffer) 508 (setq x1 (search-forward "<title>")) 509 (search-forward "</title>") 510 (setq x2 (search-backward "<")) 511 (mm-url-decode-entities-string (buffer-substring-no-properties x1 x2))))) 513 (defun org-remove-empty-propert-drawers () 514 "*Remove all empty property drawers in current file." 516 (unless (eq major-mode 'org-mode) 517 (error "You need to turn on Org mode for this function.")) 519 (goto-char (point-min)) 520 (while (re-search-forward ":PROPERTIES:" nil t) 522 (org-remove-empty-drawer-at "PROPERTIES" (match-beginning 0)))))) 524 (defun check-for-clock-out-note () 527 (org-back-to-heading) 528 (let ((tags (org-get-tags))) 529 (and tags (message "tags: %s " tags) 530 (when (member "clocknote" tags) 533 (add-hook 'org-clock-out-hook 'check-for-clock-out-note) 535 (defun org-list-files (dirs ext) 536 "Function to create list of org files in multiple subdirectories. 537 This can be called to generate a list of files for 538 org-agenda-files or org-refile-targets. 540 DIRS is a list of directories. 542 EXT is a list of the extensions of files to be included." 543 (let ((dirs (if (listp dirs) 556 (file-expand-wildcards 557 (concat (file-name-as-directory x) "*" y))))) 562 (when (or (string-match "/.#" x) 563 (string-match "#$" x)) 564 (setq files (delete x files)))) 568 (defvar org-agenda-directories (list org-directory 569 ;; (join-paths user-lab-directory "org") 570 (join-paths company-source-directory "org/*") 571 (join-paths company-source-directory "org/*/*")) 572 "List of directories containing org files.") 573 (defvar org-agenda-extensions '(".org") 574 "List of extensions of agenda files") 576 (defun org-set-agenda-files () 578 (setq org-agenda-files 579 (cl-remove-if (lambda (x) (or 580 (string= "archive.org" (file-name-nondirectory x)) 581 (string= "archive" (file-name-directory x)))) 583 org-agenda-directories 584 org-agenda-extensions)))) 586 (with-eval-after-load 'org 587 (org-set-agenda-files)) 592 :load-path user-emacs-lib-directory 595 auto-insert 'no-modify 596 auto-insert-query nil) 600 :load-path user-emacs-lib-directory 602 skt-enable-tempo-elements t 603 skt-delete-duplicate-marks t 605 (defvar skt-default-version "0.1.0") 606 (keymap-set skt-minor-mode-map "b" #'tempo-backward-mark) 607 (keymap-set skt-minor-mode-map "f" #'tempo-forward-mark) 608 (keymap-set skt-minor-mode-map "SPC" #'tempo-complete-tag) 609 (keymap-set skt-minor-mode-map "t" #'skt-add-tag) 611 (defvar skt-skeleton-path-function #'abbreviate-file-name 612 "Function to be called when expanding file-header skeletons. Useful to 613 rebind locally inside a project or module, where you want to delete some 614 prefix or replace it.") 616 (defun skt-buffer-path (&optional function) 617 (let ((path (or buffer-file-name (format "%s.lisp" (gensym "scratch-"))))) 618 (funcall (or function skt-skeleton-path-function) path))) 620 (defun skt-skelfile-path () 621 (if (string= (file-name-nondirectory buffer-file-name) "skelfile") 626 (skt-define-function capture (:abbrev "capture" :tag t) org-capture) 627 (skt-define-function agenda (:abbrev "agenda" :tag t) org-agenda) 628 (skt-define-function mjump (:abbrev "mjump" :tag t) bookmark-jump) 629 (skt-define-function bjump (:abbrev "bjump" :tag t) ibuffer-jump) 630 (skt-define-function rjump (:abbrev "rjump" :tag t) 631 (lambda () (jump-to-register (read-char "register: ")))) 632 (skt-define-function pjump (:abbrev "pjump" :tag t) (lambda () (project-switch-project default-directory))) 635 (skt-define-template readme (:mode org-mode :tag t) 636 "#+title: " (p "title: ") n 637 "#+description: " (p "description: ") n 638 "#+author: " user-full-name n 639 "#+email:" user-mail-address n 640 "#+setupfile: clean.theme" n 641 "#+export_file_name: index" n> 644 "+ version :: " skt-default-version n 647 (skt-define-template clean.theme (:mode org-mode :tag t) 648 "#+setupfile: " (join-paths company-cdn-url "org/clean.theme")) 651 ;; (skt-define-template defsystem (:mode lisp-mode :tag t :abbrev "defsystem")) 652 ;; (skt-define-template defpackage (:mode lisp-mode :tag t :abbrev "defpackage")) 653 ;; (skt-define-template defpkg (:mode lisp-mode :tag t :abbrev "defpkg")) 655 (skt-define-template defmacro (:abbrev "(defmacro" :tag t :mode lisp-mode) 656 "(defmacro " (p "Name: ") " (" (p "Args: ") ")" > n> r ")") 658 (skt-define-template defun (:abbrev "(defun" :tag t :mode lisp-mode) 659 "(defun " (p "Name: ") " (" (p "Args: ") ")" > n> r ")") 661 (skt-define-template defvar (:abbrev "(defvar" :tag t :mode lisp-mode) 662 > "(defvar " > r ")") 665 (skt-define-skeleton head (:abbrev "head" :mode lisp-mode) 667 ";;; " (skt-buffer-path 'file-name-nondirectory) " --- " str \n \n ";; " _ \n \n ";;; Code:" \n >) 669 (skt-define-skeleton head (:abbrev "head" :mode skel-mode) 671 ";;; " (skt-skelfile-path) " --- " str " -*- mode: skel; -*-" \n _) 673 (skt-define-skeleton head (:abbrev "head" :mode org-mode) 676 "#+author: " (skeleton-read "author: ") \n 677 "#+description: " (skeleton-read "description: ") \n 678 "#+setupfile: clean.theme" \n > _) 680 (skt-define-skeleton head (:abbrev "head" :mode rust-mode) 682 "//! " (skt-buffer-path 'file-name-nondirectory) " --- " str \n \n "// " _ \n \n "//! Code: " \n >) 684 (skt-define-skeleton system-head (:abbrev "system-head" :mode lisp-mode) 686 ";;; " (skt-buffer-path) " --- " 687 '(setq v1 (file-name-base (skt-buffer-path))) (capitalize v1) 688 " Sytem Definitions" \n 689 > "(defsystem :" v1 \n 690 > ":depends-on (:std :log)" \n 691 > ":components ((:file \"pkg\")" _ "))") 693 (skt-define-skeleton pkg-head (:abbrev "pkg-head" :mode lisp-mode) 695 ";;; " (skt-buffer-path 'file-name-nondirectory) " --- " 696 '(setq v1 (skeleton-read "name: ")) v1 " Package Definitions" \n 698 > ":use (:std :log))" \n \n 699 > "(in-package :" v1 ")" \n >) 701 (skt-define-skeleton crate-head (:abbrev "crate-head" :mode conf-toml-mode) 703 "### " (skt-buffer-path 'file-name-nondirectory) " --- " 704 '(setq v1 (skeleton-read "name: ")) v1 " Cargo Manifest" \n > 706 "name = \"" v1 "\"" \n 707 "version = \"" skt-default-version "\"" \n 708 "[dependencies]" \n >) 710 (skt-define-skeleton local-vars 711 (:tag t :abbrev "local-vars" 712 :docstring "Insert a local variables section. Use current comment syntax if any.") 713 (completing-read "Mode: " obarray 715 (if (commandp symbol) 716 (string-match "-mode$" (symbol-name symbol)))) 719 (if (re-search-forward page-delimiter nil t) 720 (error "Not on last page"))) 721 comment-start "Local Variables:" comment-end \n 722 comment-start "mode: " str 723 & -5 | '(kill-line 0) & -1 | comment-end \n 724 ( (completing-read (format "Variable, %s: " skeleton-subprompt) 727 (or (eq symbol 'eval) 728 (custom-variable-p symbol))) 730 comment-start str ": " 731 (read-from-minibuffer "Expression: " nil read-expression-map nil 732 'read-expression-history) | _ 735 comment-start "End:" comment-end \n) 738 (skt-register-auto-insert "skelfile" #'skt-template-skel-head) 739 (skt-register-auto-insert "readme.org" #'skt-template-org-readme) 740 (skt-register-auto-insert "Cargo.toml" #'skt-template-conf-toml-crate-head) 741 (skt-register-auto-insert "pkg.lisp" #'skt-template-lisp-pkg-head) 742 (skt-register-auto-insert ".*[.]asd" #'skt-template-lisp-system-head) 743 (skt-register-auto-insert ".*[.]lisp" #'skt-template-lisp-head) 744 (skt-register-auto-insert ".*[.].rs" #'skt-template-rust-head) 746 (keymap-set skel-minor-mode-map "C-<return>" 'company-tempo)) 749 ;; (with-eval-after-load 'org-glossary 750 ;; (setq org-glossary-collection-root (join-paths company-source-directory "org/meta/")) 751 ;; (cl-pushnew '("Terms" . glossary) org-glossary-headings) 752 ;; (cl-pushnew '("Acronyms" . acronym) org-glossary-headings)) 755 ;; ellis.el ends here