1

I'm using Aquamacs since few weeks and I'm trying to find good customizations. First, I just wanted my aquamacs to look like this on starting :

alt text

I mean on the left, my source code. and on the right a shell pane (started with C-X 3 + M-X shell).

I've done some search on emacs/aquamacs forums, and in stackOverflow too. But I'm still blocked on this. Thanks. :)

ocodo
  • 29,401
  • 18
  • 105
  • 117
  • 1
    I really think people shouldn't be voting to close if they can't be bothered to comment a remedy, that note aside, perhaps this belongs on http://superuser.com - but, since the solution will require elisp I think it's fair to say that it's programming related enough for SO. – ocodo Jan 16 '11 at 01:21

2 Answers2

2

If all you need is to split the window and open the shell in the newly created window, you should be able to add this:

(split-window-horizontally nil)
(other-window 1)
(shell nil)
(other-window 1) ;; return you to the original window.

to the end of your .emacs or .emacs.d/init.el depending on how you initialise emacs.

Alternatively, make it a separate function, and bind to a key command. (add these to .emacs instead of the above code.)

e.g.

(defun split-window-for-shell ()
  "Split the current window and open a shell in the new window."
  (interactive)
    (split-window-horizontally nil)
    (other-window 1)
    (shell nil)
    (other-window 1) ;; return you to the original window.
  )

And bind with

(global-set-key (kbd "C-|") split-window-for-shell)

So you can use it when you want, and not just at startup.

(It will always show the same instance of shell.)

ocodo
  • 29,401
  • 18
  • 105
  • 117
  • Wow! thank you very munch! it works exactly as it is supposed to!! – SamirBoulil Jan 16 '11 at 10:26
  • also, I wanted to enable c-hungry-delete mode at starting. But it's not working when i put : (c-toggle-hungry-delete 1) on my init.el. I got an error like : "Symbol's function definition is void: c-toggle-hungry-delete" do you know what's going on ? :) – SamirBoulil Jan 16 '11 at 17:02
  • My Emacs doesn't have hungry-delete mode, I don't know why (I can see that it's in the Emacs manual.) - But even Emacs Help, aprops 'hungry' shows no results, odd. -- Anyway, Does hungry delete work for you usually? – ocodo Jan 16 '11 at 20:16
  • Yes it does when i open a c file. I guess c-mode starts and In a menu "c" then toggles. I can enable "Hungry-delete". – SamirBoulil Jan 16 '11 at 21:50
  • Ok, there's no `c-toggle-hungry-delete` only, `c-toggle-hungry-state` ... I generally use something like `M-x` name[TAB] to find the correct identifier. – ocodo Jan 16 '11 at 22:33
  • humm.. c-toggle-hungry state is only available when C-mode is enabled. When i tried "(c-toggle-hungry-state 1)", emacs failed to load. do you have an idea ? like (require c-mode)\n(c-toggle-hungry-state 1) – SamirBoulil Jan 17 '11 at 08:17
  • HEre is the stuff !! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; C programming stuff ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Hungry delete is nice since we use spaces instead of tabs. (setq c-hungry-delete-key t) ;; Let emacs insert newlines automatically whenever it can. (setq c-auto-newline 1) ;; Set the K&R indentation style when starting C-mode. (add-hook 'c-mode-hook '(lambda () (c-set-style "k&r") (auto-fill-mode 1) )) – SamirBoulil Jan 21 '11 at 12:41
-2

HEre is the stuff !!

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; C programming stuff

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Hungry delete is nice since we use spaces instead of tabs. (setq c-hungry-delete-key t)

;; Let emacs insert newlines automatically whenever it can. (setq c-auto-newline 1)

;; Set the K&R indentation style when starting C-mode.

(add-hook 'c-mode-hook

      '(lambda ()
         (c-set-style "k&r")
         (auto-fill-mode 1)
         ))