Newb questions

318 views
Skip to first unread message

Avdi Grimm

unread,
Feb 12, 2013, 11:41:46 PM2/12/13
to xi...@googlegroups.com
Hi! I finally installed Xiki. This is the part where I ask dumb questions which have already been answered a million times.

Most of my questions have to do with how to make Xiki play nicely with my existing Emacs config. Specifically:
  • When I add the documented El4r startup file, it totally stomps my current (mostly vanilla) modeline configuration. New styles, lots of stuff missing. Is there a reason I want this? Can I disable it?
  • The out-of-box Xiki styles don't really work with my usual Emacs color theme (Zenburn). Can I tell Xiki to use my theme colors? Barring that, can I style it to match my current theme? I actually use two different themes, so if there are Emacs faces I could customize separately for the different themes that would be optimal.
  • Is there a way to only have Xiki available in certain buffers, instead of everywhere?
Thanks!

Craig Muth

unread,
Feb 13, 2013, 2:00:25 AM2/13/13
to xi...@googlegroups.com
> Hi! I finally installed Xiki. This is the part where I ask dumb questions
> which have already been answered a million times.

Not dumb at all. The installer still needs a lot of improvement, as
well as the docs / initial experience.

> When I add the documented El4r startup file, it totally stomps my current
> (mostly vanilla) modeline configuration. New styles, lots of stuff missing.
> Is there a reason I want this? Can I disable it?
> The out-of-box Xiki styles don't really work with my usual Emacs color theme
> (Zenburn). Can I tell Xiki to use my theme colors?

Did you add this line? If so, comment it out. That should remove
most of the theming and modeline alteration I think:

~/.el4r/init.rb
| Themes.use "Default" # Use xiki theme

The style / keyboard definitions in Xiki emacs is just ruby delegating
to elisp, so you can disable pretty much anything.

> Is there a way to only have Xiki available in certain buffers, instead of
> everywhere?

Do you have in mind mostly the keyboard shortcuts here? By default
the double-clicking and intra-buffer styling is only enabled when
viewing files ending with .notes, and buffers Xiki opens. All the
keyboard shortcuts are global if you have this line:

~/.el4r/init.rb
| KeyBindings.keys # Use default key bindings

You can optionally comment it out and put any key definitions found in
lib/xiki/key_bindings.rb directly into your init.rb file. You'll
probably want at least C-return:

Keys.set("<C-return>") { Launcher.launch_or_hide(:blink=>true) }

--Craig





> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Xiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to xiki+uns...@googlegroups.com.
> To post to this group, send email to xi...@googlegroups.com.
> Visit this group at http://groups.google.com/group/xiki?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Avdi Grimm

unread,
Feb 18, 2013, 5:11:32 PM2/18/13
to xi...@googlegroups.com
On Wed, Feb 13, 2013 at 2:00 AM, Craig Muth <craig...@gmail.com> wrote:
You can optionally comment it out and put any key definitions found in
lib/xiki/key_bindings.rb directly into your init.rb file.  You'll
probably want at least C-return:

  Keys.set("<C-return>") { Launcher.launch_or_hide(:blink=>true) }

My C-return is bound to starting a rectangular selection, the default for cua-set-rectangle-mark.

Is there a way to only have those keys bound in Xiki buffers? I.e. is there a Xiki keymap which is active in *.notes buffers?

Ideally, I'd bind C-c C-c to be the Xiki "magic key" inside *.notes buffers. C-c C-c is the usual binding for "execute this thing".

Actually, I can think of *one* reason it might be nice to have a global Xiki keybinding: if Xiki can respect comments in other modes. If I could expand Xiki menus inside of comment blocks (and have the expanded results also be commented out correctly) while coding in e.g. Ruby, that would be pretty awesome.

--
Avdi Grimm
http://avdi.org

I only check email twice a day. to reach me sooner, go to http://awayfind.com/avdi

Craig Muth

unread,
Feb 18, 2013, 9:57:24 PM2/18/13
to xi...@googlegroups.com
> Is there a way to only have those keys bound in Xiki buffers? I.e. is
> there a Xiki keymap which is active in *.notes buffers?
> Ideally, I'd bind C-c C-c to be the Xiki "magic key" inside *.notes
> buffers.

Yep, this will accomplish that:

~/.el4r/init.rb
| define_key(:notes_mode_map, kbd("C-c C-c")) {
Launcher.launch_or_hide(:blink=>true) }

> Actually, I can think of *one* reason it might be nice to have a global Xiki
> keybinding: if Xiki can respect comments in other modes. If I could expand
> Xiki menus inside of comment blocks (and have the expanded results also be
> commented out correctly) while coding in e.g. Ruby, that would be pretty
> awesome.

Hah, funny you say that. I've thought this would be cool for a while.
I have this partially implemented. When you Control-return (just
saying that for brevity) on code in a comment...

# Tree.leaf "hey/you"
def self.leaf path, options={}
...

...it inserts the results inline...

# Tree.leaf "hey/you"
you
def self.leaf path, options={}
...

You can also have mini unit-tests in comments that you can Control-return on:

# Tree.leaf "hey/you".should == "you"
true

If it fails, it inserts the "expected: foo, got: bar" message (it just
inserts the text from rspec).

I haven't done the "and have the expanded results also be commented
out correctly" thing yet, but have thought that might be cool. It
would be easy to do!

> Actually, I can think of *one* reason

Other shortcuts that are pretty useful from code... When in a unit
test, you can type a shortcut (as+todo, so Control-a, Control-t, since
xiki shortcuts are "type the acronym") to add a path (like
"xiki/tests/tree/#leaf/returns last item/") to the top left view.
Then you can Control-enter on it to run the test. When it fails it
inserts the message under the menu, so you can Control-enter to
navigate to where the error was. It's pretty nice to have the paths
of the handful of unit tests you're working with in one place, and be
able to go back and forth between running them (see screenshot).

Also when in any file, you can type another shortcut (as+nav), and it
will add the path to that line to the bottom-left view, so you can
navigate back to it later (also in screenshot). There are quite a few
other optional shortcuts as well.

--Craig




> Avdi Grimm
> http://avdi.org
>
> I only check email twice a day. to reach me sooner, go to
> http://awayfind.com/avdi
>
Screen Shot 2013-02-18 at 6.53.32 PM.png
Reply all
Reply to author
Forward
0 new messages