Permalink
Browse files

doc improvement and important startup bugfix

  • Loading branch information...
1 parent 745c860 commit adba7195b9aa79c371d1e08ac9aade1f2f18da8a @jave committed Feb 23, 2011
Showing with 37 additions and 121 deletions.
  1. +4 −102 inkmacs.el
  2. +2 −2 linkedtext.org
  3. +12 −0 linkedtext2.org
  4. +19 −17 linkedtext2.svg
View
@@ -6,59 +6,9 @@
;;; Commentary:
;;
-
;;Experimental integration between inkscape and Emacs using dbus.
+;; See README.org
-;;Currently needs bleeding edge versions of a number of components.
-;; - trunk version of inkscape with dbus enabled (see note below)
-;; - trunk version of Eieio(needs a change which hasnt been merged downstream)
-;; - trunk version of Jan Moringen dbus-proxy
-;; - Emacs 23(i use Emacs from trunk, but 23 should be ok)
-
-;;If you accept that all this really is bleeding edge for real, and
-;;not something i just say, controling inkscape from Emacs is rather
-;;fun! If you furthermore use my inkscape branch mentioned below,
-;;inkmacs even aproaches usable!
-
-;; the long term goal is to make an Emacs that does things quickly
-;; that currently inhibits creative flow with inkscape. In
-;; particular I want to make a framework that supports specialized
-;; 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.
-
-;;, 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
-;; - make an inkscape mode that shows just the canvas
-;; - 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.
-
-;; please note that there is an Inkscape branch where I have some
-;; bugfixes for the dbus support:
-;; lp:~joakim-verona/inkscape/dbus-fixes
-;; In particular the ink-org integration wont work at all without the fixes
-
-
-;;check alive
-;;(dbus-ping :session "org.inkscape" 100)
-
-;;(dbus-introspect-xml :session "org.inkscape" "/")
-
-;;(dbus-introspect-get-all-nodes :session "org.inkscape" "/org/inkscape")
-
-;;(dbus-introspect-get-interface :session "org.inkscape" "/org/inkscape/application" "org.inkscape.application")
-;;(dbus-introspect-get-method-names :session "org.inkscape" "/org/inkscape/application" "org.inkscape.application")
-;;(dbus-introspect-get-method-names :session "org.inkscape" "/org/inkscape/desktop_24" "org.inkscape.document")
-;; (dbus-introspect-get-method :session "org.inkscape" "/org/inkscape/desktop_24" "org.inkscape.document" "rectangle")
-
-;;(dbus-introspect :session "org.inkscape" "/org/inkscape")
;;; Code:
(require 'dbus)
@@ -98,11 +48,7 @@ then we have buffer local instances.")
(message "emacs-inkscape bridge ready for action!")
(setq inkscape-proxies-registered t))
-
;; call-verb support
-;; 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
(defun inkscape-make-verb-list ()
"Create wrappers for the Verb API."
@@ -125,11 +71,7 @@ then we have buffer local instances.")
,doc
(inkdoc-call-verb this ,name))))
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;creating the dbus proxies, using Jan Moringen fantastic
-;;dbus-proxy library. The way emacs dbus integration was meant to be
-
+;;dbus proxies
(defun inkscape-transform-method-name (prefix name)
"Transform NAME. prepend PREFIX.
@@ -154,11 +96,7 @@ slow the first time, then not so bad."
(concat "/org/inkscape/" desktop) t)))
obj))
-;;TODO
-;; should be buffer local
-;; seems to create an inkscape instance mysteriously
-;;(setq inkscape-desktop (inkscape-document-dbus-proxy-create "desktop_0"))
-;;(setq inkscape-desktop-1 (inkscape-document-dbus-proxy-create "desktop_1"))
+;;inkscape process management
(defun inkscape-local-instance ()
"Create a buffer local instance of inkscape."
@@ -174,41 +112,16 @@ slow the first time, then not so bad."
;;;;;;;;;;;;;;;;;;;;;;;;;,,
;;image mode adapter code
-(defun inkscape-open-buffer-file ()
+(defun ()
"Open buffer file un a local inkscape instance."
(interactive)
;;TODO check that the buffer contains a SVG file
- ;;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
(inkscape-local-instance)
(inkdoc-load inkscape-desktop (buffer-file-name)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;inkscape org integration - the pride of inkmacs
-;;
-
-;; strategy:
-;; - tree level 1 represents the file
-;; - tree level 2 is a column heading
-;; - tree level 3 and lower are placed in the column
-
-;; inkscape text is a little bit unintuitive:
-;; text objects are realy a set of text span objects with separate prperties
-;; but tde api doesnt ouite reflect that because its inconvenient anyway
-;; furthermore the spans dont change after you create them
-
-;; for the purpose of inkorg, its nicer if we handle formating and
-;; wordwrap inside inkscape. to get that we need a text object and
-;; another linked object which determines the shape. they are both handled separately.
-
-;; also note that svg 1.2 isnt finalized so convert to text before publishing:
-;; http://wiki.inkscape.org/wiki/index.php/FAQ#What_about_flowed_text.3F
-
-;; tip: create a ospecal txt layer before inkorg-create-text-group
;; these values are used to place new nodes
;; old nodes will retain their placement
@@ -224,17 +137,6 @@ Argument DO-TREE updates the entire subtree."
(inkorg-create-or-update-text-node))
)
-;;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:
-;; - build a list A of all inkscape objects using select-all
-;; - build a list B of all inkorg nodes by iterating the org tree and extracting the id
-;; oh wait - I dont know which A:s used to be inkorg nodes. aargh!
-;; 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>
-
-
(defun inkorg-create-text-group()
"traverse an org tree and create text nodes.
the nodes will be placed on the document canvas according to a simple pattern
View
@@ -7,7 +7,7 @@ Emacs and Inkscape in unholy union.
:PROPERTIES:
:ID: 5b9903b4-b0f6-43f0-b8d6-a3d985f12b69
:END:
-*** There is Org in the mix as well.
+*** There is Orgg 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
@@ -30,7 +30,7 @@ I N K M A C S ?
:PROPERTIES:
:ID: 19cb7688-1d05-4086-bc46-e7b828ee3ae4
:END:
-*** eemacs communicates with inkscape using dbus
+*** Emacs communicates with inkscape using dbus!
:PROPERTIES:
:ID: 88a09eaf-e36c-48fb-b8d7-25c610628033
:END:
View
@@ -0,0 +1,12 @@
+* file
+ :PROPERTIES:
+ :ID: 6820fc9a-86b6-487d-bdad-bcbf8fbb8da3
+ :END:
+** Multi buffer support!
+ :PROPERTIES:
+ :ID: 9daeab04-4a68-4b72-a2f9-8bb18122ddf5
+ :END:
+** newnode
+ :PROPERTIES:
+ :ID: 980f1acf-05f3-49be-92b6-e80d5ca423e0
+ :END:
View
@@ -72,15 +72,15 @@
height="1052.3622"
transform="matrix(2.0358707,0,0,1.5625,245.05155,59.464289)" /></flowRegion><flowPara
id="flowPara1856">file </flowPara></flowRoot> <rect
- x="85.932976"
- y="27.771414"
+ x="74.504402"
+ y="22.057129"
width="324.18561"
height="256"
- style="font-size:72px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#ff36ff;fill-opacity:1;font-family:Nimbus Mono L;-inkscape-font-specification:Nimbus Mono L"
+ style="font-size:72px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#9ae6ac;fill-opacity:0.90582961;font-family:Nimbus Mono L;-inkscape-font-specification:Nimbus Mono L"
id="5b9903b4-b0f6-43f0-b8d6-a3d985f12b69-flow" />
<flowRoot
xml:space="preserve"
- style="font-size:72px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:#334ebc;fill-opacity:1;font-family:Nimbus Mono L;-inkscape-font-specification:Nimbus Mono L"
+ style="font-size:72px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:#334e06;fill-opacity:1;font-family:Nimbus Mono L;-inkscape-font-specification:Nimbus Mono L;stroke:#22002e;stroke-opacity:1"
id="5b9903b4-b0f6-43f0-b8d6-a3d985f12b69"><flowRegion
id="flowRegion1870"><use
x="0"
@@ -89,29 +89,31 @@
id="use1872"
width="744.09448"
height="1052.3622"
- transform="matrix(2.0358707,0,0,1.5625,-172.09131,-351.96428)" /></flowRegion><flowPara
+ transform="matrix(2.0358707,0,0,1.5625,-148.82422,-343.03571)" /></flowRegion><flowPara
id="flowPara1874">I N K M A C S Emacs and Inkscape in unholy union. </flowPara></flowRoot> <rect
- x="20.941935"
- y="386.40005"
+ x="-155.6996"
+ y="426.46774"
width="464.07266"
height="340"
style="font-size:72px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#ffff45;fill-opacity:1;font-family:Nimbus Mono L;-inkscape-font-specification:Nimbus Mono L"
- id="6382a7db-219a-4640-8f22-d07097e97d06-flow" />
+ id="6382a7db-219a-4640-8f22-d07097e97d06-flow"
+ transform="matrix(0.95935948,-0.2821868,0.2821868,0.95935948,0,0)" />
<flowRoot
xml:space="preserve"
- style="font-size:72px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:#334ebc;fill-opacity:1;font-family:Nimbus Mono L;-inkscape-font-specification:Nimbus Mono L"
- id="6382a7db-219a-4640-8f22-d07097e97d06"><flowRegion
+ style="font-size:72px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#334ebc;fill-opacity:1;font-family:Nimbus Mono L;-inkscape-font-specification:Nimbus Mono L"
+ id="6382a7db-219a-4640-8f22-d07097e97d06"
+ transform="matrix(0.46985313,-0.14319907,0.18658227,0.61219855,-16.898429,282.52788)"><flowRegion
id="flowRegion1892"><use
x="0"
y="0"
xlink:href="#6382a7db-219a-4640-8f22-d07097e97d06-flow"
id="use1894"
width="744.09448"
height="1052.3622"
- transform="matrix(2.0358707,0,0,1.5625,-172.09131,-351.96428)" /></flowRegion><flowPara
+ transform="matrix(2.0358707,0,0,1.5625,-148.82422,-343.03571)" /></flowRegion><flowPara
id="flowPara1896">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 </flowPara></flowRoot> <rect
- x="235.59349"
- y="814.39996"
+ x="224.16492"
+ y="808.68567"
width="301.7312"
height="226.74286"
style="font-size:72px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#ff30ff;fill-opacity:1;font-family:Nimbus Mono L;-inkscape-font-specification:Nimbus Mono L"
@@ -127,10 +129,10 @@
id="use1910"
width="744.09448"
height="1052.3622"
- transform="matrix(2.0358707,0,0,1.5625,-172.09131,-351.96428)" /></flowRegion><flowPara
+ transform="matrix(2.0358707,0,0,1.5625,-148.82422,-343.03571)" /></flowRegion><flowPara
id="flowPara1912">Use the power of Emacs to edit svg text </flowPara></flowRoot> <rect
- x="490.60364"
- y="458.17145"
+ x="479.17508"
+ y="452.45715"
width="243.68221"
height="281.82858"
style="font-size:72px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#ff455a;fill-opacity:1;font-family:Nimbus Mono L;-inkscape-font-specification:Nimbus Mono L"
@@ -147,7 +149,7 @@
id="use1928"
width="744.09448"
height="1052.3622"
- transform="matrix(2.0358707,0,0,1.5625,-172.09131,-351.96428)" /></flowRegion><flowPara
+ transform="matrix(2.0358707,0,0,1.5625,-154.64099,-320.71428)" /></flowRegion><flowPara
id="flowPara1930">Can NOTHING stop the awesomeness that is ... I N K M A C S ? </flowPara></flowRoot> <rect
x="479.28799"
y="15.999991"

0 comments on commit adba719

Please sign in to comment.