update eaf package
This commit is contained in:
@@ -7,11 +7,11 @@
|
||||
;; Copyright (C) 2020, Andy Stewart, all rights reserved.
|
||||
;; Created: 2020-02-28 16:09:02
|
||||
;; Version: 0.1
|
||||
;; Last-Updated: 2020-02-28 16:09:02
|
||||
;; By: Andy Stewart
|
||||
;; Last-Updated: Tue Jan 19 01:15:47 2021 (-0500)
|
||||
;; By: Mingde (Matthew) Zeng
|
||||
;; URL: http://www.emacswiki.org/emacs/download/eaf-mindmap.el
|
||||
;; Keywords:
|
||||
;; Compatibility: GNU Emacs 26.3
|
||||
;; Compatibility: emacs-version >= 27
|
||||
;;
|
||||
;; Features that might be required by this library:
|
||||
;;
|
||||
@@ -84,11 +84,6 @@
|
||||
|
||||
;;; Code:
|
||||
|
||||
(dbus-register-signal
|
||||
:session "com.lazycat.eaf" "/com/lazycat/eaf"
|
||||
"com.lazycat.eaf" "export_org_json"
|
||||
#'eaf--export-org-json)
|
||||
|
||||
(defun eaf--export-org-json (org-json-content org-file-path)
|
||||
(let (org-parse-data)
|
||||
(with-temp-buffer
|
||||
@@ -114,8 +109,10 @@
|
||||
(end-of-line)
|
||||
(backward-char 1)
|
||||
(point)))))
|
||||
(when (> (length header-string) 2)
|
||||
(setq header-string (string-remove-prefix "*" header-string)))
|
||||
(let ((loop-times (/ (- (length header-string) 1) 2)))
|
||||
(while (> loop-times 0)
|
||||
(setq loop-times (- loop-times 1))
|
||||
(setq header-string (string-remove-prefix "*" header-string))))
|
||||
(setq org-parse-data (concat org-parse-data (format "%s%s\n" header-string content-string)))))
|
||||
|
||||
(with-temp-file org-file-path
|
||||
@@ -302,6 +299,78 @@ actural call `org-json-gen-alist1' to work."
|
||||
(concat h " " vs))
|
||||
))
|
||||
|
||||
(defun eaf--add-multiple-sub-nodes (buffer-id)
|
||||
"EAF Browser: edit FOCUS-TEXT with Emacs's BUFFER-ID."
|
||||
(split-window-below -10)
|
||||
(other-window 1)
|
||||
(let ((edit-text-buffer (generate-new-buffer (format "eaf-%s-add-multiple-sub-nodes" eaf--buffer-app-name))))
|
||||
(with-current-buffer edit-text-buffer
|
||||
(eaf-edit-mode)
|
||||
(set (make-local-variable 'eaf--buffer-id) buffer-id))
|
||||
(switch-to-buffer edit-text-buffer)
|
||||
(setq-local eaf-mindmap--current-add-mode "sub")
|
||||
(setq header-line-format
|
||||
(substitute-command-keys
|
||||
(concat
|
||||
"\\<eaf-edit-mode-map>"
|
||||
" EAF/" eaf--buffer-app-name " EDIT: "
|
||||
"Confirm with `\\[eaf-edit-buffer-confirm]', "
|
||||
"Cancel with `\\[eaf-edit-buffer-cancel]', "
|
||||
"Separate diffrent nodes with 'RET'. "
|
||||
)))
|
||||
;; When text line number above
|
||||
(when (> (line-number-at-pos) 30)
|
||||
(beginning-of-buffer))
|
||||
))
|
||||
|
||||
(defun eaf--add-multiple-brother-nodes (buffer-id)
|
||||
"EAF Browser: edit FOCUS-TEXT with Emacs's BUFFER-ID."
|
||||
(split-window-below -10)
|
||||
(other-window 1)
|
||||
(let ((edit-text-buffer (generate-new-buffer (format "eaf-%s-add-multiple-brother-nodes" eaf--buffer-app-name))))
|
||||
(with-current-buffer edit-text-buffer
|
||||
(eaf-edit-mode)
|
||||
(set (make-local-variable 'eaf--buffer-id) buffer-id))
|
||||
(switch-to-buffer edit-text-buffer)
|
||||
(setq-local eaf-mindmap--current-add-mode "brother")
|
||||
(setq header-line-format
|
||||
(substitute-command-keys
|
||||
(concat
|
||||
"\\<eaf-edit-mode-map>"
|
||||
" EAF/" eaf--buffer-app-name " EDIT: "
|
||||
"Confirm with `\\[eaf-edit-buffer-confirm]', "
|
||||
"Cancel with `\\[eaf-edit-buffer-cancel]', "
|
||||
"Separate diffrent nodes with 'RET'. "
|
||||
)))
|
||||
;; When text line number above
|
||||
(when (> (line-number-at-pos) 30)
|
||||
(beginning-of-buffer))
|
||||
))
|
||||
|
||||
(defun eaf--add-multiple-middle-nodes (buffer-id)
|
||||
"EAF Browser: edit FOCUS-TEXT with Emacs's BUFFER-ID."
|
||||
(split-window-below -10)
|
||||
(other-window 1)
|
||||
(let ((edit-text-buffer (generate-new-buffer (format "eaf-%s-add-multiple-middle-nodes" eaf--buffer-app-name))))
|
||||
(with-current-buffer edit-text-buffer
|
||||
(eaf-edit-mode)
|
||||
(set (make-local-variable 'eaf--buffer-id) buffer-id))
|
||||
(switch-to-buffer edit-text-buffer)
|
||||
(setq-local eaf-mindmap--current-add-mode "middle")
|
||||
(setq header-line-format
|
||||
(substitute-command-keys
|
||||
(concat
|
||||
"\\<eaf-edit-mode-map>"
|
||||
" EAF/" eaf--buffer-app-name " EDIT: "
|
||||
"Confirm with `\\[eaf-edit-buffer-confirm]', "
|
||||
"Cancel with `\\[eaf-edit-buffer-cancel]', "
|
||||
"Separate diffrent nodes with 'RET'. "
|
||||
)))
|
||||
;; When text line number above
|
||||
(when (> (line-number-at-pos) 30)
|
||||
(beginning-of-buffer))
|
||||
))
|
||||
|
||||
(provide 'eaf-mindmap)
|
||||
|
||||
;;; eaf-mindmap.el ends here
|
||||
|
||||
Reference in New Issue
Block a user