Gettin The Sweet Sauce 64

Forum rules
Share your brain ;)
User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Gettin The Sweet Sauce 64

Unread post by GekkoP » Fri Sep 13, 2013 5:06 pm

^ Well, I'm not sure I'm able to use xaos configs yet. I need to understand this starter kit first, and learning about it is on my todo list (which I made with org-mode, and I love it and... ok, enough).
So far I'm using some of yours config. C indentation (yep, still on it using learncodethehardway) and repositories mainly. And it's working real good. I want to go slow, be sure to know the basic keybindings very well and to work comfortably. I'm going slow, but man I'm loving it.

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Gettin The Sweet Sauce 64

Unread post by GekkoP » Sat Oct 12, 2013 10:49 am

Here comes the noob.
Though emacs-w3m, org-mode and TangoDark are working fine on my emacs -nw, I can't install packages using el-get-install. Every package's name I put in after pressing ENTER gives me the infamous "Symbol's function definition is void: entry".
Now I think I messed up my .emacs, but I'm pretty sure I took almost everything from DebianJoe's github.
Here's my .emacs:

Code: Select all

(setq browse-url-browser-function 'w3m-browse-url)
(autoload 'w3m-browse-url "w3m" "Ask a WWW browser to show a URL." t)
;; optional keyboard short-cut
(global-set-key "\C-xm" 'browse-url-at-point)

(require 'package)
;; Add the original Emacs Lisp Package Archive
(add-to-list 'package-archives
             '("elpa" . "http://tromey.com/elpa/"))
;; Add the user-contributed repository
(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/packages/"))
;; Add Melpa
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/"))

;; Use El-Get to sync repos and dependencies.
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")

(unless (require 'el-get nil 'noerror)
  (with-current-buffer
      (url-retrieve-synchronously
       "https://raw.github.com/dimitri/el-get/master/el-get-install.el")
    (let (el-get-master-branch)
      (goto-char (point-max))
      (eval-print-last-sexp))))

;;Turn on iswitchb to change buffers with C^x b
(iswitchb-mode 1)
;;Allow keys to work like dzen, because I'm lazy
(defun iswitchb-local-keys ()
  (mapc (lambda (K)
(let* ((key (car K)) (fun (cdr K)))
(define-key iswitchb-mode-map (edmacro-parse-keys key) fun)))
'(("<right>" . iswitchb-next-match)
("<left>" . iswitchv-prev-match)
("<up>" . ignore)
("<down>" . ignore))))
(add-hook 'iswitchb-define-mode-map-hook 'iswitchb-local-keys)
(require 'edmacro)

;; C-specific Indentation
;; First FOUR space indents, like Odin intended
;; and then go with the way Linus indents...the RIGHT way.
(setq c-default-style "linux"
      c-basic-offset 4)

;; Org-mode log DONE tasks
(setq org-log-done 'time)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(custom-enabled-themes (quote (tango-dark))))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
Any suggestion, emacs masters?

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Gettin The Sweet Sauce 64

Unread post by DebianJoe » Sat Oct 12, 2013 10:56 am

https://github.com/dimitri/el-get/issues/1257

It seems that you are not alone. Do you get an error on init with emacs? If not, recompiling your repos as discussed on the el-get git repo issue-page may fix it.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
xaos52
The Good Doctor
Posts: 190
Joined: Thu Aug 15, 2013 11:59 am
Location: Eernegem, Belgium

Re: Gettin The Sweet Sauce 64

Unread post by xaos52 » Sat Oct 12, 2013 10:59 am

Start your emacs from the commandline with

Code: Select all

emacs --debug-init
and post the trace that it spits out.
Connected. Take this REPL, brother, and may it serve you well.

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Gettin The Sweet Sauce 64

Unread post by GekkoP » Sat Oct 12, 2013 11:00 am

No error on init, but recompiling the repos worked. Thanks!

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Gettin The Sweet Sauce 64

Unread post by DebianJoe » Sat Oct 12, 2013 11:00 am

No problem. Glad to see that's all it took.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Gettin The Sweet Sauce 64

Unread post by DebianJoe » Sun Oct 13, 2013 9:38 pm

Shell Scripting Tmux Layouts

I went through the posts with "tmux" in them, and didn't see this pop up anywhere else, and it seems that for the Emacs/Tmux builds, it could be pretty useful.

The way that I do it is I have a single little shell script that uses a case-switch for loading different layouts, and I tie it to an alias...kind of like:

Code: Select all

#!/bin/sh

# Tmux Layouts #
if [ $# -lt 1 ]; then
    # in case of no arguments, this is default layout #
    # this creates a NEW window, leaving the last one #
    # totally unchanged, and opens an application layout #
    tmux new-window -a
    tmux rename-window "Main"
    tmux split-window -h
    tmux last-pane
    tmux send-keys "program -switches" C-m
    tmux last-pane
    tmux split-window -p80
    tmux last-pane
    tmux split-window -h
    tmux send-keys "some other program" C-m
    tmux last-pane
    tmux send-keys "program -switches" C-m
    tmux last-pane
else 
case "$1" in
    "bottom")
	    # creates 3 pane bottom-stack #
	    tmux split-window -v
	    tmux split-window -h -p 66
	    tmux split-window -h
	    tmux select-pane -t 0
	    tmux send-keys "clear" C-m
	    ;;
    "top")
	    # creates 3 pane top-stack #
	    tmux split-window -v
	    tmux last-pane
	    tmux split-window -h -p 66
	    tmux split-window -h
	    tmux select-pane -t 0
	    tmux send-keys "clear" C-m
	    ;;
    "left")
	    # creates 3 pane left stack #
	    tmux split-window -h
	    tmux select-pane -t 0
	    tmux split-window -v -p 66
	    tmux split-window -v
	    tmux select-pane -t 0
	    tmux send-keys "clear" C-m
	    ;;
    "right")
	    # creates 3 pane right-stack #
	    tmux split-window -h
	    tmux split-window -v -p 66
	    tmux split-window -v
	    tmux select-pane -t 0
	    tmux send-keys "clear" C-m
	    ;;
# if nothing else #
    *) echo "Invalid layout"
	    ;;
esac
fi
Now, this is just a rough idea of what could be done, but the things that I find to be useful is that when you're testing a layout, you can "C^a q" to get a display over each pane that shows how tmux has indexed the panes. So, you can use the "tmux select-pane -t <index#>" argument in your script to define which pane you wish to manipulate. From there, 'tmux send-keys "whatever you want to send" C-m' will send keystrokes with a enter to the targeted terminal.

This is really useful for something like launching programs (or other scripts) in a predefined pane. The limits of what you could do is really only determined by how much imagination you have.

I strongly recommend "man tmux" to get an idea of how you can use arguments in the script to control percentage slices, window creation/naming, session merging, etc. The above example is a super-basic idea of how you could potentially use the system, but it's only a point to jump off into making layouts that fit your specific needs.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
ivanovnegro
Minister of Truth
Posts: 5449
Joined: Wed Oct 17, 2012 11:12 pm

Re: Gettin The Sweet Sauce 64

Unread post by ivanovnegro » Sun Oct 13, 2013 11:56 pm

I ignored this thread at first sight because of emacs of course. :D But this passion of Joe is incredible so I read through this whole thread and it was really interesting. It is already one of those famous threads on forums that you have to be a part of it and subscribe.
It won't make me an emacs user but I am considering to try it out.

Thanks Joe!

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Gettin The Sweet Sauce 64

Unread post by machinebacon » Mon Oct 14, 2013 4:21 am

Joe has really managed to turn a few people into emacs-curious (like bi-curious, not really sucking on the wrong nipple, but dreaming of it).
I have already pulled a few people into emacs, their reactions were like: how can I remember all these keystrokes? (using the gtk-version makes stuff quite easy, tbh)
..gnutella..

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Gettin The Sweet Sauce 64

Unread post by DebianJoe » Mon Oct 14, 2013 8:07 am

There's a lot of reasons to use emacs, and I'm sure there's an equal amount to not (much like everything else in Linuxland.) I love it, personally. The ability to modify an editor for specific purposes in an actual programming language is really useful. Such as, let's say I hate trailing whitespace (which I do), but I don't like having to manually go through and remove it manually, and typing "M^x delete-trailing-whitespace" after every set of changes I make annoys me.

I could always set up a hook in my .emacs file like:

Code: Select all

(add-hook 'before-save-hook 'delete-trailing-whitespace)
...and then when I go to save files, they are cleaned up first. Good stuff.
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Gettin The Sweet Sauce 64

Unread post by GekkoP » Mon Oct 14, 2013 6:49 pm

Interesting note from an Emacs beginner.
Installing random stuff via package-el is really useful to learn something new. I discovered vkill for instance, which let me have a look at the processes running on my Elektra and kill them if I want to without leaving Emacs.
I also installed some new theme just for the sake of have a look at different colors. I got cyberpunk-theme (I'm a William Gibson fan), tried it with M-x load-theme and fell in love with it. Then I restarted Emacs and the theme wasn't loaded. Probably something you already know, but packages installed with package-el are activated after .emacs is loaded. I needed to put (package-initialize) in there just before (load-theme 'cyberpunk t) to be able to have my new beautiful theme working. Nice stuff.
If there's a different/better way to manage this, please do let me know.

User avatar
bones
Clooney
Posts: 2385
Joined: Fri Jun 28, 2013 11:47 pm
Location: Cascadia

Re: Gettin The Sweet Sauce 64

Unread post by bones » Mon Oct 14, 2013 7:09 pm

GekkoP wrote:I got cyberpunk-theme (I'm a William Gibson fan), tried it with M-x load-theme and fell in love with it.
Off topic, but I'm a big Gibson fan, myself. Met him once, and got a signed copy of Virtual Light. Currently reading Spook Country.

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Gettin The Sweet Sauce 64

Unread post by DebianJoe » Mon Oct 14, 2013 7:23 pm

That's a perfectly acceptable way to load your package GekkoP, sounds cool. Screenshot?
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Gettin The Sweet Sauce 64

Unread post by GekkoP » Mon Oct 14, 2013 7:29 pm

Here it is.
Image

User avatar
DebianJoe
Frame Buffer
Posts: 1915
Joined: Mon Jul 01, 2013 5:41 am
Location: emacs.d

Re: Gettin The Sweet Sauce 64

Unread post by DebianJoe » Mon Oct 14, 2013 8:12 pm

^^ nice. :)
|>>BBQ Roaster, Alpha Branch<< | >> clinky << | >> X11 must die << |
Thanks BASIC

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Gettin The Sweet Sauce 64

Unread post by machinebacon » Tue Oct 15, 2013 2:11 am

Nice, Gekko! Can I have your tmux panel/bar lines from the conf file please?
..gnutella..

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Gettin The Sweet Sauce 64

Unread post by GekkoP » Tue Oct 15, 2013 9:17 am

Of course. I stole it from gutterslob's config a while ago.

Code: Select all

## status line
set -g status-utf8 on
set -g status-justify left
set -g status-bg default
set -g status-fg colour12
set -g status-interval 2

## window status
#setw -g window-status-format " #F#I:#W#F "
#setw -g window-status-current-format " #F#I:#W#F "
setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W "
setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W "
setw -g window-status-current-bg colour0
setw -g window-status-current-fg colour11
setw -g window-status-current-attr dim
setw -g window-status-bg green
setw -g window-status-fg black
setw -g window-status-attr reverse
setw -g window-status-content-bg colour0
setw -g window-status-content-fg colour11
setw -g window-status-content-attr bold,blink,reverse

## loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-content off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-window-option -g monitor-content on
set-option -g bell-action none

# Info on left (I don't have a session display for now)
set -g status-left ''

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Gettin The Sweet Sauce 64

Unread post by machinebacon » Tue Oct 15, 2013 10:47 am

Mille grazie!
..gnutella..

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Gettin The Sweet Sauce 64

Unread post by GekkoP » Tue Oct 15, 2013 10:55 am

Prego :)

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: Gettin The Sweet Sauce 64

Unread post by GekkoP » Tue Oct 29, 2013 9:21 pm

@DebianJoe
There's a typo on your dotfiles/.emacs on git.

Code: Select all

'(("<right>" . iswitchb-next-match)
 ("<left>" . iswitchv-prev-match)
"iswitchv" needs to be "iswitchb" in order to work.

Post Reply