Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

usability improvement

  • Loading branch information...
commit 3306ce3cd7572da8f4adc24915ceee19263540e2 1 parent 92fbf37
@jave authored
Showing with 118 additions and 37 deletions.
  1. +56 −24 README.org
  2. +58 −9 inkmacs.el
  3. +4 −4 linkedtext.org
View
80 README.org
@@ -75,12 +75,12 @@ M-x booster such as Anything or Icicles.
* Technical Discussion
** Dependencies
Currently needs bleeding edge versions of a number of components.
- - trunk version of inkscape with dbus enabled (see note below)
+ - trunk version of inkscape with dbus enabled
- trunk version of Eieio(needs a change which hasnt been merged downstream)
- trunk version of Jan Moringen dbus-proxy
- Emacs 23. I use Emacs 24 from trunk, but 23 should be ok. but since
everything else is bleeding edge you might as well use a bleeding
- edge Emacs also.
+ edge Emacs also. You know you want to.
** DONE get Inkmacs bugfixes merged
@@ -98,23 +98,38 @@ Currently needs bleeding edge versions of a number of components.
workflows, such as producing sketches for blog entries and web comics.
so, when inspiration hits you: m-x inkscape-blog-sketch,
rather than fiddling about in menus etc until you loose inspiration.
+
I am also interested in building a presentation tool on top of the
- inkmacs org integration.
+ inkmacs org integration. This is currently based on org-mode and is
+ called inkorg minor mode in inkmacs. Inkorg seems to be pretty good
+ for the purposes mentioned and is currently the flagsdip UI of Inkmacs.
For this we want to:
- - make the xwidget Emacs branch usable, so inkscape can be embedded in Emacs
- - make inkscape support xembed, so it can be embedded in Emacs(I have
- a branch on launchpad for this)
- - make an inkscape mode that shows just the canvas(maybe using inkview)
- - make an Emacs inkscape control mode that implements a proper Emacs ui on top of inkscape
- - somehow implement the Emacs buffer model with inkscape
- - implement a form of OLE:
- - display svg images inline muse-mode org org mode for example(this is already mostly possible)
- - edit the svg inside inkscape when desired
-
- very important is to support text editing in Emacs. nodes in an outline-mode
- document should preferably be bound to nodes in the inkscape document.
+*** TODO make the xwidget Emacs branch usable, so inkscape can be embedded
+ in Emacs(this is very far future)
+**** TODO make inkscape support xembed, so it can be embedded in Emacs.
+ I have a branch on launchpad for this but it has issues and is
+ long term
+**** TODO make an inkscape mode that shows just the canvas.
+maybe using inkview.
+*** TODO make an Emacs inkscape control mode that implements a proper Emacs
+ ui on top of inkscape. the foundation for this is done. Whats
+ lacking is good bindings.
+*** DONE somehow implement the Emacs buffer model with inkscape
+*** TODO implement a form of OLE.
+display svg images inline muse-mode org org mode for example. this is
+already mostly possible.
+
+*** DONE edit the svg inside inkscape when desired
+
+*** DONE very important is to support text editing in Emacs.
+nodes in an outline-mode document should preferably be bound to nodes
+ in the inkscape document.
+** TODO an annoying extra inkscape window appears
+happens when the proxies are registered. theres seemingly no straightforward way
+around it.
+
** some test code snippets
check alive
(dbus-ping :session "org.inkscape" 100)
@@ -130,27 +145,23 @@ check alive
(dbus-introspect :session "org.inkscape" "/org/inkscape")
-** the verb proxies
+** DONE the verb proxies
inkscape doesnt export all functionality through proper dbus interfaces atm.
there is an older "verb" interface, and a dbus bridge.
here is some code that tries to aproximate the dbus-proxy api for the verb api
-** the dbus proxies
+** DONE the dbus proxies
creating the dbus proxies, using Jan Moringen fantastic
dbus-proxy library. The way emacs dbus integration was meant to be
-** inkdoc load issue
+** TODO inkdoc load issue
BUG funnily crashes if called twice on the same desktop object(not reproducible)
inkdoc-load is awkward:
- 1st open happens inside "virgin" desktop
- subsequent opens happen in new desktops
- the resulting desktop name isnt returned
-** changing name of root inkorg node.
-doesnt really work because the name is used to link to the svg file. a
-property can be added to override the file name. a better error is
-needed to show the error is unlinked file.
-** inkscape org integration
+** DONE inkscape org integration
inkscape org integration - the pride of inkmacs
m-x inkorg-mode
@@ -187,7 +198,7 @@ inkverb-file-export
tip: create a special text layer before inkorg-create-text-group
-** strategy for orphaned nodes
+** TODO strategy for orphaned nodes
*** TODO if a node has been removed from the org doc it should also be
removed from the ink doc. this is however a bit tricky.
naive method to find orphan nodes:
@@ -197,3 +208,24 @@ removed from the ink doc. this is however a bit tricky.
inkscape groups cant really be used because it changes behaviourp
the only reasonable alternative seems to be to use a naming convention:
inkmacs-<type>-<orgid>
+
+** TODO subtree export support
+inkorg mode works sort of like org export but its not always entirely
+the same. Nevertheless inkorg should reuse org export code when possible.
+A big difference is that the svg file is used in tandem with org. it
+is not generated from org like other org exports.
+
+*** TODO changing name of root inkorg node.
+doesnt really work because the name is used to link to the svg file. a
+property can be added to override the file name. a better error is
+needed to show the error is unlinked file.
+
+`EXPORT_FILE_NAME',
+`EXPORT_TITLE',
+
+could be used to override the default file name.
+
+`#+TITLE:' compatibility
+*** CANCELLED [#B] some form ov planner/outline integration that works with ecb
+ CLOSED: [2011-04-17 Sun 01:33]
+org mode does this already.
View
67 inkmacs.el
@@ -14,6 +14,8 @@
(require 'dbus)
(require 'dbus-introspection)
(require 'dbus-proxy)
+(require 'org)
+(require 'org-exp)
(defcustom inkscape-path
"inkscape"
@@ -185,7 +187,7 @@ null if there is no desk. error if there is a broken desk."
;;;;;;;;;;;;;;;;;;;;;;;;;,,
;;image mode adapter code
(defun inkscape-open-buffer-file ()
- "Open buffer file un a local inkscape instance."
+ "Open buffer file on a local inkscape instance."
(interactive)
;;TODO check that the buffer contains a SVG file
(inkscape-local-instance (buffer-file-name)))
@@ -205,7 +207,9 @@ Argument DO-TREE updates the entire subtree."
(interactive "P")
(if do-tree
(inkorg-create-text-group)
- (inkorg-create-or-update-text-node)))
+ (progn
+ (inkorg-create-or-update-text-node)
+ (if (called-interactively-p 'any) (inkorg-select-node 'both)))))
(defun inkorg-create-text-group()
@@ -243,7 +247,7 @@ Argument INKORG-SELECT filters the nodes to select."
(org-back-to-heading)
(setq inkorg-select-start-level (org-outline-level))
(unless (or (= 1 (org-outline-level)) (equal inkorg-select 'keep-subtree))
- (org-up-heading-all 100))
+ (org-up-heading-all 100));;TODO refactor. support EXPORT_FILE_NAME
(org-map-entries (lambda () (inkorg-select-node text-or-flow))
nil 'tree 'inkorg-select-skip)))
@@ -273,6 +277,7 @@ Argument INKORG-SELECT filters the nodes to select."
Return a format suitable to
create an inkscape text node from.
asterisks and properties are removed."
+ ;;TODO there ought to be some code in org-exp for this somewhere
(let ((text (concat (org-get-heading) "\n" (org-get-entry-2))))
(set-text-properties 0 (length text) nil text )
@@ -329,15 +334,59 @@ node, or update the node if it already exists."
(inkdoc-set-text (inkscape-desktop) id (inkorg-entry-text))
(inkorg-create-text-node))))
+(defun inkorg-apply-text-formatting ()
+ "experimental. needs patched inkscape"
+ (interactive)
+ (let* ((text (inkorg-entry-text))
+ (id (inkorg-text-id (org-id-get nil t))))
+ (inkdoc-text-apply-style (inkscape-desktop) id
+ 0 10 "font-weight" "bold") )
+
+
+
+ )
+
(defun inkorg-svg-file-name ()
"Figure out which svg file to use in this context."
+ ;;TODO try (org-export-get-title-from-subtree) instead)
+ ;; (org-entry-get (region-beginning) "EXPORT_FILE_NAME" t)
(save-excursion
- (move-beginning-of-line nil)
- (unless (= 1 (org-outline-level))
- (org-up-heading-all 100))
- (let ((file-name (concat (org-get-heading) ".svg")))
- (set-text-properties 0 (length file-name) nil file-name)
- (concat (mapconcat (lambda (e) e) (butlast (split-string (buffer-file-name ) "/")) "/") "/" file-name))))
+ (let
+ ((export-file-name (org-entry-get (region-beginning) "EXPORT_FILE_NAME" t)))
+ ;;org-entry-property-inherited-from TODO
+ (move-beginning-of-line nil)
+ (unless (= 1 (org-outline-level))
+ (org-up-heading-all 100));;TODO use inkorg-root-node
+ (let ((file-name (concat (or export-file-name
+ (org-get-heading))
+ ".svg")))
+ (set-text-properties 0 (length file-name) nil file-name)
+ (concat (mapconcat (lambda (e) e) (butlast (split-string (buffer-file-name ) "/")) "/") "/" file-name)))))
+
+
+(defun inkorg-root-node ()
+ "Move point to the image root.
+This is either a node with EXPORT_FILE_NAME set or the level 1 parent."
+ (interactive)
+ (let
+ ((export-file-name (org-entry-get (region-beginning) "EXPORT_FILE_NAME" t))
+ (ex-point org-entry-property-inherited-from))
+ (if export-file-name
+ (goto-char ex-point)
+ (progn
+ (org-back-to-heading)
+ (move-beginning-of-line nil)
+ (unless (= 1 (org-outline-level))
+ (org-up-heading-all 100))))))
+
+(defun inkorg-delete-orphans ()
+ ;;TODO
+ ;; - figure out all inkscape nodes somewhen created by inkmacs, set A
+ ;; - figure out all org nodes from the inkorg root node, set B
+ ;; - remove all As not in B
+ ;; this is potentially destructive so prompt for each inksscape node to be removed
+ )
+
(define-minor-mode inkorg-mode "inkorg" nil " inkorg"
'(( "\e\C-x" . inkorg-create-or-update-text))
View
8 linkedtext.org
@@ -3,12 +3,12 @@
:ID: 6820fc9a-86b6-487d-bdad-bcbf8fbb8da3
:END:
** I N K M A C S
-Emacs and Inkscape in unholy union.
+*Emacs* and *Inkscape* in unholy union.
:PROPERTIES:
:ID: 5b9903b4-b0f6-43f0-b8d6-a3d985f12b69
:END:
-*** There is Orgg in the mix as well.
-Org properties can be used to link to svg nodes!
+*** There is Org in the mix as well.
+Org properties *can* be used to link to svg nodes!
m-x inkorg-mode
and then C-M-x on an org node
:PROPERTIES:
@@ -30,7 +30,7 @@ I N K M A C S ?
:PROPERTIES:
:ID: 19cb7688-1d05-4086-bc46-e7b828ee3ae4
:END:
-*** Emacs communicates with inkscape using dbus!
+*** *Emacs* communicates with *inkscape* using dbus!
:PROPERTIES:
:ID: 88a09eaf-e36c-48fb-b8d7-25c610628033
:END:
Please sign in to comment.
Something went wrong with that request. Please try again.