summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2021-09-15 23:38:02 -0500
committerCase Duckworth2021-09-15 23:38:02 -0500
commit76c525767e12f45534a65c34ccdbb7f269768962 (patch)
tree8b322208bc63854e1cb08cfb944e20f9f1686a40 /lisp
parentSteal jao-buffer-same-mode (diff)
parentblech (diff)
downloademacs-76c525767e12f45534a65c34ccdbb7f269768962.tar.gz
emacs-76c525767e12f45534a65c34ccdbb7f269768962.zip
Merge branch 'main' of https://tildegit.org/acdw/emacs
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw-irc.el35
-rw-r--r--lisp/acdw.el24
2 files changed, 59 insertions, 0 deletions
diff --git a/lisp/acdw-irc.el b/lisp/acdw-irc.el index b4b75ec..305dc93 100644 --- a/lisp/acdw-irc.el +++ b/lisp/acdw-irc.el
@@ -73,6 +73,41 @@ and right on t."
73 (dolist (network (mapcar #'car circe-network-options)) 73 (dolist (network (mapcar #'car circe-network-options))
74 (circe-maybe-connect network))) 74 (circe-maybe-connect network)))
75 75
76(el-patch-feature circe)
77(with-eval-after-load 'circe
78 (defvar circe-server-buffer-action 'pop-to-buffer-same-window
79 "What to do with `circe-server' buffers when created.")
80
81 (el-patch-defun circe (network-or-server &rest server-options)
82 "Connect to IRC.
83
84Connect to the given network specified by NETWORK-OR-SERVER.
85
86When this function is called, it collects options from the
87SERVER-OPTIONS argument, the user variable
88`circe-network-options', and the defaults found in
89`circe-network-defaults', in this order.
90
91If NETWORK-OR-SERVER is not found in any of these variables, the
92argument is assumed to be the host name for the server, and all
93relevant settings must be passed via SERVER-OPTIONS.
94
95All SERVER-OPTIONS are treated as variables by getting the string
96\"circe-\" prepended to their name. This variable is then set
97locally in the server buffer.
98
99See `circe-network-options' for a list of common options."
100 (interactive (circe--read-network-and-options))
101 (let* ((options (circe--server-get-network-options network-or-server
102 server-options))
103 (buffer (circe--server-generate-buffer options)))
104 (with-current-buffer buffer
105 (circe-server-mode)
106 (circe--server-set-variables options)
107 (circe-reconnect))
108 (el-patch-swap (pop-to-buffer-same-window buffer)
109 (funcall circe-server-buffer-action buffer)))))
110
76(defun circe-network-connected-p (network) 111(defun circe-network-connected-p (network)
77 "Return non-nil if there's any Circe server-buffer whose 112 "Return non-nil if there's any Circe server-buffer whose
78`circe-server-netwok' is NETWORK." 113`circe-server-netwok' is NETWORK."
diff --git a/lisp/acdw.el b/lisp/acdw.el index d3b0bf9..dcf7b19 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -402,6 +402,30 @@ first."
402 (setq deactivate-mark t) 402 (setq deactivate-mark t)
403 nil) 403 nil)
404 404
405(defun acdw/org-export-copy ()
406 "copy a tree"
407 (interactive)
408 (require 'ox-ascii)
409 (let ((extracted-heading (acdw/org-extract-heading-text)))
410 ;; Export to ASCII - not async, subtree only, visible-only, body-only
411 (let ((org-export-show-temporary-export-buffer nil))
412 (org-ascii-export-as-ascii nil t t t))
413 (with-current-buffer "*Org ASCII Export*"
414 (goto-char (point-min))
415 (insert extracted-heading)
416 (newline)
417 (newline)
418
419 (unfill-region (point-min) (point-max))
420 (flush-lines "^$" (point-min) (point-max))
421
422 (copy-region-as-kill (point-min) (point-max)))
423
424 (when (called-interactively-p 'interactive)
425 (indicate-copied-region))
426 (setq deactivate-mark t)
427 nil))
428
405(defun acdw/org-extract-heading-text () 429(defun acdw/org-extract-heading-text ()
406 "Extract the heading text from an `org-mode' heading." 430 "Extract the heading text from an `org-mode' heading."
407 (let ((heading (org-no-properties (org-get-heading t t t t)))) 431 (let ((heading (org-no-properties (org-get-heading t t t t))))