2

I'm in love with emacs. I don't believe there is anything one can't do with enough effort!

I have just fine working scripts/extensions installed that could be relevant to get my point:

  • org-mode (with a CAPTURE-TEMPLATE named "Journal")
  • color-theme (emacswiki)
  • theme-changer (github)
  • color-theme-buffer-local (github)

emacs-version: "GNU Emacs 23.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-03-25 on roseapple, modified by Debian"

Whats already working fine When I'm starting a journal-entry trough my defined shortcut, what happens is the following:

  • emacs opens a new buffer("CAPTURE-journal.org") in a new window
  • I edit it
  • with another keystroke the entry gets refiled to my defined journal.org file
  • the buffer and the window are then closed automatically
  • I continue working on the file I worked before

What I want it to do additionally:

  • the "CAPTURE-journal.org"-buffer in the new window should have a unique color-theme, lets say color-theme-retro-orange

My .emacs with the code snippet I believe should be relevant.

I have no idea how to tackle this task. Where does one begin editing? Are even all tools needed for this listed above?

Edward
  • 73
  • 4
  • I'm not entirely sure, but I noticed you have `color-theme-is-global` turned on. Would that override the buffer-local settings? – cm2 Aug 09 '12 at 15:09
  • How did you define a shortcut to open a new buffer ("CAPTURE-journal.org") in a new window? – dkim Aug 10 '12 at 02:05
  • @cm2: Good point. I honestly have no idea, whether it overrides or not. But I will defintely give it a try! – Edward Aug 10 '12 at 10:44
  • @Deokhwan Kim: The new buffer is opened by the build in [CAPTURE-function](http://orgmode.org/manual/Capture.html) of org-mode. By the way "a new **window**" means a new **emacs-window**. – Edward Aug 10 '12 at 10:46

1 Answers1

1

Seen from scratch: you need a list with color-themes

(setq my-themes (list "color-theme-retro-orange" "second-theme" "third...))

than you need a pointer, storing position used last. See Emacs Lisp Intro chapter of kill-ring-save

When finished, bind that function at a suitable place, where-from your buffer is opened, resp. load it with the stuff mentioned by OP.

Or create a minor-mode, which will all new buffers provide with this.

Andreas Röhler
  • 4,804
  • 14
  • 18
  • I hope I didn't get you wrong. The [Capture-function](http://orgmode.org/manual/Capture.html) works just fine. The only thing I am missing is the mentioned theme-change after the new buffer is opened. It should come down to evaluating one line of elisp-code after the buffer is created and active. [ referring to [color-theme-buffer-local](https://github.com/vic/color-theme-buffer-local) this line should be `(color-theme-buffer-local 'color-theme-retro-orange (current-buffer))` ]. Now I can't figure out where to put this line without editing the code of the original `org-mode`-files. – Edward Aug 10 '12 at 11:33
  • looks like color-themes is the list, where its selected from – Andreas Röhler Aug 10 '12 at 14:28
  • my-color-theme-buffer-local would replace the prompting by proceeding described above but keep the rest of body for applying it. – Andreas Röhler Aug 10 '12 at 14:31