Thursday, February 7, 2013

Perfect emacs, step 1 done.

(Just to be sure, Perfect means perfect *for me*, everyone will have their own perfect dev setup)


I have gotten closer to the perfect emacs setup, I already have had emacs replace tmux and thus my login shell and manager for multiple shells and window.

This has been accomplished totally by using the workgroups package along with some custom elisp functions and .bashrc lines.


Here is my entire init.el file so far;


(workgroups-mode 1) ;; turn on workgroups mode at the start.

(setq wg-morph-on nil) ;; No silly workgroup switching animation


;; Detach function
(defun leave-session ()
  "Leaves session and saves all workgroup states. Will not continue if there is no w\
orkgroups open."
  (interactive)
  (setq last-used-workgroup (wg-current-workgroup))
  (wg-update-all-workgroups)
  (delete-frame)
)
(global-set-key (kbd "") 'leave-session)


This means that when I leave emacs(client) all of my workspaces and pointer positions in them are saved.
And then the rest is done in my .bashrc


function start-emacs() {
    if [ "$TERM" == "eterm-color" ];then
        echo "EMACSEPTION!!!!"
        echo "(Don't run emacs in emacs dawg)"
        return
    fi
    if ./emacs-24.2/lib-src/emacsclient -t -e \
        "(wg-switch-to-workgroup last-used-workgroup)" ; then
        : # Do nothing
    else
        ./emacs-24.2/src/emacs --daemon
        ./emacs-24.2/lib-src/emacsclient -t -e  \
            "(wg-create-workgroup \"Start\")"
    fi
}

alias emacsclient="start-emacs"
alias emacs="start-emacs"

# Allows terminals to run fine *in* emacs.
if [ "$TERM" == "xterm" ];then
    emacs
    exit
fi



What then does is as soon as I login to a ssh session again, I am right where I left off. It is seamless and replaces the need for tmux (or screen or byobu) totally.


You will notice a lot of these things are specific to my installation of emacs (one that I had to compile myself because I don't have root priv on the machine I am ssh'ing into, and they won't update *their* emacs past version 21). If anyone is interested, I will be happy to generalize this and share it on github (I probably will anyway)


So, the next steps for a perfect emacs, as I was coming up with them are below:


Steps for perfect emacs:
 * Install and learn icicles.
 * Setup emacs to automatically use version control for *every* save.           (except when already using git or some *other* vc)
   And *maybe* have one autosave that is different, *maybe*

 * Make binding for common functions, insert-date and compiling code.
 * Find a theme to make Emacs consistent across terminals and themes.
 * Default modes (flyspell, flymake, long-lines) for appropriate buffers.
 * Special way to open files that will open them in their own workspaces. (code will open next to eshell with all the right modes, text will open with flyspell and maybe a thesaurus mode, etc)
 * Learn dired (and if I don't like it, get another file browser for emacs, there are lots)
 * A way to back up all of these settings and load them easily in new computers.


Probably not in that order though, I think the next one to tackle is that auto-version-control everything problem.

Alright everyone, talk to you later.

Wednesday, February 6, 2013

Progress -

On the #emacs irc on freenode. (which is awesome). I was looking for a way to do what I wanted. and I found a package that seems to accomplish 90% of it.

https://github.com/tlh/workgroups.el


All I have to do is get these to update when leaving a frame and remembering the last workgroup, then just load it back, and I am done.

The perfect emacs environment.

Really what I mean is the perfect *terminal* environment, which is also my environment for edited.

Years ago I made a pretty good one, but emacs has grown (v 24) and so have I. So it's time to make something great and make sure to save it.

Here is what I want:

I want emacs to replace: (In short)
My terminal - including using programs like htop and other curses programs.
Tmux - I want all the functionality tmux has, and I think with the right add ons I can get it.
Ssh/ftp - I want emacs to be able (using TRAMP and such) to seamlessly connect and work with my home server and other servers without having to leave my home terminal. And if I need to, have *that* terminal run in emacs.
emacs - Basically this means I want emacs itself to be to the best of it's potential.
My irc client - ERC is great and I don't see why emacs can't fully be used.
Google talk chat - This is a maybe, I have tried this on emacs and enjoyed it a lot, so it will be considered.

What I don't want emacs to replace.

My browser - While good for kicks, w3m-emacs or anything else I've seen doesn't cut it compared to Chrome. Plus I plan to use this in Guake while I view whatever I need to do.
My GUI - I want to live a life with a GUI and a terminal, I am not picking only one.
My operating system - Maybe one day I will mess around with LFS and make a emacs-based OS (with elpa as a package manager) but not yet.

To elaborate, I want these things:
  • Emacs to be able to be detached without closing.
  • Emacs to return to it's old window state when reattaching.
  • Be able to save and switch window configurations like tmux. 
I will return when I have something, bye! 


Tuesday, September 4, 2012

Back again.

Yup, JQ is back. And really, I'm the only one that will read this post. But, hopefully, it's not forever this time. I created a schedule, and have been following it better this time.

See I have this dream, that if I keep working on my blogs everyday, and make new post's, they will become popular and people will follow and read them. Even if it's not true, I really want to try. I have nothing to lose by this.

That's all, for now. Thanks for reading.

Tuesday, July 31, 2012

I don't want to miss July.

Hey everyone, sadly, I have not made as many blog post's as a wished. Here is your's (and mine's) list of things to blame.


  • Google+
  • Reddit
  • U413
  • School
  • Straight up Procrastination
Not in any particular order. 

I for a time had a schedule that I followed, I was ready to write in my blog, practice go, learn stuff. etc.

It was solid and it was working well, I think I certainly felt more productive. I think I will do it again, hopefully after next week ends. Here is to me making a new schedule and following it in the future.

A toast to the occasion?

Really though, I think of what I accomplished in that time, when I was really studying, not just school, but go, programming, I was doing project's, I was reading real books, not just math or programming ones. I didn't do as much as I wanted but god damn it is more then I do now.

Thing is my parents don't complain, nobody would. Why?

I'm acing every test, I'm getting the best grades of my life. But at what sacrifice? When is the last programming project I wrote a line for?
How about writing a line in the spec for?

I would be lying to say I have done nothing, but it is trivial compared to what I should be doing, and have done before.

Is it worth it, is I'm really just working on school?

It's my fault though, you saw above, the first part of this post. My reason's made it clear, I have plenty of time to learn. So why don't I?

Is my brain being lazy? Or is it being tired?
I don't believe in such metal limits, at least I don't want to until they are proven. If I can do school and work on programming for 10 min in a week, there is no conceivable reason I cannot work on it for 20, and so on, until I realize there is no reason I could not be working at full speed right now. Writing in my blog, posting on Youtube, all that good stuff.

So no, it's a cop-out and I know it. I'm not sacrificing my life for school, my lazy subconscious is making that excuse. 
-------------------------------------

That said, I can't seem to even spend full time on school, I am always doing things last minute, getting things done only just before time. And cramming before tests.

It's working for now, I don't want to find out how long it will.

Wednesday, June 20, 2012

My old quotes file.

A long time ago, I used gmail drafts to save data, like links and such. (I now use ubuntu one, dropbox or my own server).

Below is a old quotes file I found, thought it would be interesting to share it. It's at least 4 years old.

I have marked in bold the quotes that I particularly liked, upon reading it again. 


The only "intuitive" interface is the nipple. After that, it's all learned. (Bruce Ediger, bediger@teal.csn.org, in comp.os.linux.misc, on X interfaces.)
..............................................
Walking isn't a lost art: one must, by some means, get to the garage.
- Evan Esar
........................................................
It could be worse I guess. It could be 10,000 rhinoceroses instead of monkeys.
- Rick
........................................................
It is not enough to succeed. Others must fail.
- Gore Vidal
........................................................
Talent hits a target no one else can hit; Genius hits a target no one else can see.
- Arthur Schopenhauer
........................................................
Sometimes what's right isn't as important as what's profitable.
- Trey Parker and Matt Stone
........................................................
The difference between a monk and a philosopher is that a monk spends years trying to clear
his mind by meditation , a philosopher spends years trying to fill it by deep thinking.
- James Mcclain
.......................................................
In hell you think of how great it would be to relive the worst days of your life.
- James Mcclain
........................................................
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
- Eric Hoffer
........................................................
Politics is supposed to be the second oldest profession. I have come to realize that it bears a very close resemblance to the first.
- Ronald Reagan
-------------------------------------------------------
The future is here. It's just not widely distributed yet. (Favorite of this list)
- William Gibson
.....................................................................
I used to think that the brain was the most wonderful organ in my body. Then I realized who was telling me this.
- Emo Phillips



---

Tell me what you think of them, and if you have your own quotes file, share it.

Wednesday, June 6, 2012

Does this exist, or is this a unique mental disorder I invented?

So, I have *no* idea why this was going through my mind. But I had to write it down.
Considering *how* many mental disorders there are, I figure this *has* to be one, but I have not yet found one in my searches.

So here is a description:

Basically, for every object the person see's, they *have* to give it a name. So, as soon as they focus on something specific, in their mind they hear a name, and when they recognize that object again, they will remember that name. The person likely cannot choose the name that their mind gives the object.  So this means that while they should be able to remember what their friends name are, in their mind they will always hear the original name whenever they recognize their friend. It is like you recognize a face, or remember any other object by it's image, it's just they associate a proper noun to it.


So for this person, every door in his house, his cups(if he can distinguish them apart), his tv, the doornobs, have names.

They are not actively *remembering* these names, they simply *know* when they see the same thing again.

It's like this:
You walk into a denny's, you have to sit in a waiting area, and you notice a scratch on the wall. You look at it while you wait.

Then 2 days later, you go to the denny's again, and sit in the same place, you will certainly remember the scratch as the one you looked at before. A person with this disorder is the same, except when they remember it, they also hear "Jeff", or whatever name their brain gave the scratch originally.

So, for anyone reading this what do ya think?

Possible names for this syndrome:


  • Adam and Eve Syndrome Taken
  • Earthsea Syndrome # seems to be good. Maybe you guys can think of a better one.