changelog shortlog graph tags branches changeset files file revisions raw help

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

changeset 331: 1e5e4bbcdf8b
parent: ef76122522ca
child: 3e721a3349a0
author: Richard Westhaver <ellis@rwest.io>
date: Sun, 12 May 2024 18:02:46 -0400
permissions: -rw-r--r--
description: add tmux, comment out some broken grovelled constants, fix krypt asd typo
129
80a56483f9b5 more organ work
ellis <ellis@rwest.io>
parents:
diff changeset
1
 ;;; lib/cli/ed.lisp --- Editor functions
80a56483f9b5 more organ work
ellis <ellis@rwest.io>
parents:
diff changeset
2
 
80a56483f9b5 more organ work
ellis <ellis@rwest.io>
parents:
diff changeset
3
 ;;
80a56483f9b5 more organ work
ellis <ellis@rwest.io>
parents:
diff changeset
4
 
80a56483f9b5 more organ work
ellis <ellis@rwest.io>
parents:
diff changeset
5
 ;;; Code:
80a56483f9b5 more organ work
ellis <ellis@rwest.io>
parents:
diff changeset
6
 (in-package :cli/ed)
80a56483f9b5 more organ work
ellis <ellis@rwest.io>
parents:
diff changeset
7
 
331
1e5e4bbcdf8b add tmux, comment out some broken grovelled constants, fix krypt asd typo
Richard Westhaver <ellis@rwest.io>
parents: 311
diff changeset
8
 (defun run-emacs (&optional file args)
1e5e4bbcdf8b add tmux, comment out some broken grovelled constants, fix krypt asd typo
Richard Westhaver <ellis@rwest.io>
parents: 311
diff changeset
9
   (sb-ext:run-program (cli:find-exe "emacs") `(,@(when file (list file)) ,@args :wait nil :output nil)))
129
80a56483f9b5 more organ work
ellis <ellis@rwest.io>
parents:
diff changeset
10
 
331
1e5e4bbcdf8b add tmux, comment out some broken grovelled constants, fix krypt asd typo
Richard Westhaver <ellis@rwest.io>
parents: 311
diff changeset
11
 (defun run-emacsclient (&optional (file ".") (create-frame t))
1e5e4bbcdf8b add tmux, comment out some broken grovelled constants, fix krypt asd typo
Richard Westhaver <ellis@rwest.io>
parents: 311
diff changeset
12
   (sb-ext:run-program (cli:find-exe "emacsclient")
1e5e4bbcdf8b add tmux, comment out some broken grovelled constants, fix krypt asd typo
Richard Westhaver <ellis@rwest.io>
parents: 311
diff changeset
13
                       `(,file ,@(when create-frame (list "-c")) "-a=")
1e5e4bbcdf8b add tmux, comment out some broken grovelled constants, fix krypt asd typo
Richard Westhaver <ellis@rwest.io>
parents: 311
diff changeset
14
                       :wait nil
1e5e4bbcdf8b add tmux, comment out some broken grovelled constants, fix krypt asd typo
Richard Westhaver <ellis@rwest.io>
parents: 311
diff changeset
15
                       :output nil))
129
80a56483f9b5 more organ work
ellis <ellis@rwest.io>
parents:
diff changeset
16
 
331
1e5e4bbcdf8b add tmux, comment out some broken grovelled constants, fix krypt asd typo
Richard Westhaver <ellis@rwest.io>
parents: 311
diff changeset
17
 (push #'run-emacsclient sb-ext:*ed-functions*)
129
80a56483f9b5 more organ work
ellis <ellis@rwest.io>
parents:
diff changeset
18
 (push #'run-emacs sb-ext:*ed-functions*)
331
1e5e4bbcdf8b add tmux, comment out some broken grovelled constants, fix krypt asd typo
Richard Westhaver <ellis@rwest.io>
parents: 311
diff changeset
19
 
148
0d9d5cd46af5 added net/stream.rs, change def-ts-lang to macrolet form
ellis <ellis@rwest.io>
parents: 129
diff changeset
20
 
0d9d5cd46af5 added net/stream.rs, change def-ts-lang to macrolet form
ellis <ellis@rwest.io>
parents: 129
diff changeset
21
 ;;; Org Protocol
0d9d5cd46af5 added net/stream.rs, change def-ts-lang to macrolet form
ellis <ellis@rwest.io>
parents: 129
diff changeset
22
 ;; ref: https://orgmode.org/worg/org-contrib/org-protocol.html
0d9d5cd46af5 added net/stream.rs, change def-ts-lang to macrolet form
ellis <ellis@rwest.io>
parents: 129
diff changeset
23
 
0d9d5cd46af5 added net/stream.rs, change def-ts-lang to macrolet form
ellis <ellis@rwest.io>
parents: 129
diff changeset
24
 ;; On GNU/Linux, Emacs is now the default application for
0d9d5cd46af5 added net/stream.rs, change def-ts-lang to macrolet form
ellis <ellis@rwest.io>
parents: 129
diff changeset
25
 ;; 'org-protocol'. (startup change in Emacs 30.1)
0d9d5cd46af5 added net/stream.rs, change def-ts-lang to macrolet form
ellis <ellis@rwest.io>
parents: 129
diff changeset
26
 (defun org-store-link (url title)
0d9d5cd46af5 added net/stream.rs, change def-ts-lang to macrolet form
ellis <ellis@rwest.io>
parents: 129
diff changeset
27
   (run-emacsclient (format nil "org-protocol://store-link?url=~a&title=~a"
0d9d5cd46af5 added net/stream.rs, change def-ts-lang to macrolet form
ellis <ellis@rwest.io>
parents: 129
diff changeset
28
                            url title)))