changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/lib/cli/ed.lisp

changeset 684: 29fe829a7ac3
parent: 3e721a3349a0
author: Richard Westhaver <ellis@rwest.io>
date: Sun, 29 Sep 2024 00:31:24 -0400
permissions: -rw-r--r--
description: evdev and io/kbd
1 ;;; lib/cli/ed.lisp --- Editor functions
2 
3 ;;
4 
5 ;;; Code:
6 (in-package :cli/ed)
7 
8 (defun run-emacs (&optional file args)
9  (sb-ext:run-program (find-exe "emacs") `(,@(when file (list file)) ,@args)))
10 
11 (defun run-emacsclient (&optional (file ".") (create-frame t))
12  (sb-ext:run-program (find-exe "emacsclient")
13  `(,file ,@(when create-frame (list "-c")) "-a=")
14  :wait nil
15  :output nil))
16 
17 (push #'run-emacsclient sb-ext:*ed-functions*)
18 (push #'run-emacs sb-ext:*ed-functions*)
19 
20 ;;; Org Protocol
21 ;; ref: https://orgmode.org/worg/org-contrib/org-protocol.html
22 
23 ;; On GNU/Linux, Emacs is now the default application for
24 ;; 'org-protocol'. (startup change in Emacs 30.1)
25 (defun org-store-link (url title)
26  (run-emacsclient (format nil "org-protocol://store-link?url=~a&title=~a"
27  url title)))