News for hackers. Stuff that matters.
Re:Emacs standing alone on a Linux Kernel by influx on Tuesday September 16, 2014 @06:42PM (#8327527)
Shit, I did that years ago:

  --- main.c Sun Jun 3 22:02:34 2001 
  +++ main.c~ Tue Jul 10 16:05:26 2001 
  @@ -789,9 +789,9 @@
  
  if (execute_command)
  execve(execute_command,argv_init,envp_init); 
  - execve("/sbin/init",argv_init,envp_init); 
  - execve("/etc/init",argv_init,envp_init); 
  - execve("/bin/init",argv_init,envp_init); 
  - execve("/bin/sh",argv_init,envp_init); 
  - panic("No init found. Try passing init= option to kernel."); 
  + execve("/usr/bin/emacs",argv_init,envp_init); 
  + execve("/usr/local/bin/emacs",argv_init,envp_init) ; 
  + execve("/bin/emacs",argv_init,envp_init); 
  + execve("/usr/bin/xemacs",argv_init,envp_init); 
  + panic("No emacs found. Are you sure this is GNU/Linux?");  
  }
Re:Emacs standing alone on a Linux Kernel by teddyh on Wednesday September 17, 2014 @04:10AM (#8329013)
No need to patch the kernel - I did this many years ago (before the age of initramfs) by simply passing “init=/usr/bin/emacs” on the kernel command line (in lilo, which was what was used at the time).
Re:Emacs standing alone on a Linux Kernel by pyre on Wednesday September 17, 2014 @10:40AM (#8330198)
lilo: the Linux Loader!

/getoffmylawn

Re:Emacs standing alone on a Linux Kernel by josefonseca on Tuesday September 16, 2014 @08:59PM (#8327932)
I did that years ago as well. Soon as I read somewhere that Stallman meant Emacs to be his only shell and do everything in it(?), this was my first thought.
Re:Emacs standing alone on a Linux Kernel by mike_ivanov on Tuesday September 16, 2014 @07:10PM (#8327621)
ln -sf /usr/bin/emacs /sbin/init
Re:Emacs standing alone on a Linux Kernel by scott_karana on Tuesday September 16, 2014 @08:00PM (#8327778)
Where would you find ln, though? ;)
Re:Emacs standing alone on a Linux Kernel by daveloyall on Wednesday September 17, 2014 @04:50PM (#8332287)

    make-symbolic-link is an interactive built-in function in `C source
    code'.
    
    (make-symbolic-link FILENAME LINKNAME &optional OK-IF-ALREADY-EXISTS)
    
    Make a symbolic link to FILENAME, named LINKNAME.
    Both args must be strings.
    Signals a `file-already-exists' error if a file LINKNAME already exists
    unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.
    A number as third arg means request confirmation if LINKNAME already exists.
    This happens for interactive use with M-x.
or...

    dired-do-symlink is an interactive autoloaded compiled Lisp function
    in `dired-aux.el'.
    
    (dired-do-symlink &optional ARG)
    
    Make symbolic links to current file or all marked (or next ARG) files.
    When operating on just the current file, you specify the new name.
    When operating on multiple or marked files, you specify a directory
    and new symbolic links are made in that directory
    with the same names that the files currently have.  The default
    suggested for the target directory depends on the value of
    `dired-dwim-target', which see.
    
    For relative symlinks, use M-x dired-do-relsymlink.
...It doesn't seem to depend on an external `ln`. http://git.savannah.gnu.org/cgit/emacs.git/tree/src/fileio.c...
Re:Emacs standing alone on a Linux Kernel by scott_karana on Wednesday September 17, 2014 @04:58PM (#8332329)
Nice find! :-)
Re:Emacs standing alone on a Linux Kernel by digisign on Tuesday September 16, 2014 @08:09PM (#8327803)
That's pre reboot.
Re:Emacs standing alone on a Linux Kernel by pyre on Wednesday September 17, 2014 @10:41AM (#8330205)
Where would you find gcc to patch the kernel? :P
Re:Emacs standing alone on a Linux Kernel by kjs3 on Wednesday September 17, 2014 @12:40PM (#8330870)
Isn't this something almost everyone who got past the "wrote my first elisp macro" stage has done with emacs since the 90s?
Re:Emacs standing alone on a Linux Kernel by xg15 on Tuesday September 16, 2014 @05:40PM (#8327266)
Now it only needs a decent editor.

(I'm sorry)

Re:Emacs standing alone on a Linux Kernel by jgrahamc on Tuesday September 16, 2014 @05:47PM (#8327292)
I laughed even though I'm a dedicated emacs user.
Re:Emacs standing alone on a Linux Kernel by Crito on Tuesday September 16, 2014 @06:05PM (#8327366)
Re:Emacs standing alone on a Linux Kernel by jfb on Tuesday September 16, 2014 @05:54PM (#8327319)
An old joke, but a good one.
Re:Emacs standing alone on a Linux Kernel by codemac on Tuesday September 16, 2014 @06:27PM (#8327473)
M-x evil-mode
Re:Emacs standing alone on a Linux Kernel by cies on Wednesday September 17, 2014 @06:13AM (#8329330)
Yups! Even that issue can be closed now.
Re:Emacs standing alone on a Linux Kernel by jsmthrowaway on Tuesday September 16, 2014 @06:00PM (#8327342)
Nah. Luckily it can shell out, and /bin/cat is a decent editor in comparison.
Re:Emacs standing alone on a Linux Kernel by gpvos on Wednesday September 17, 2014 @05:18AM (#8329206)
And you get extra points if you set your terminal to raw mode.
Re:Emacs standing alone on a Linux Kernel by danielweber on Tuesday September 16, 2014 @09:25PM (#8328007)
ed
Re:Emacs standing alone on a Linux Kernel by LanceH on Wednesday September 17, 2014 @12:51AM (#8328668)
It is the standard.
Re:Emacs standing alone on a Linux Kernel by jsilence on Wednesday September 17, 2014 @02:20AM (#8328791)
M-x butterfly
Re:Emacs standing alone on a Linux Kernel by abdullahkhalids on Tuesday September 16, 2014 @05:43PM (#8327281)
If I can get a laptop with a e-ink display (or build one using a raspberry pi) this is my dream setup for when I am writing.
Re:Emacs standing alone on a Linux Kernel by 1ris on Wednesday September 17, 2014 @09:58AM (#8329944)
I tried that. I bought a kindle, got root access, added lots of software (a x-server that outputs directly to the framebuffer device that interfaces the display). I only ever had keyboard access from a remote computer from that i was SSHing into it. I planned to add a keyboard, but i never did.

It was not usable. I tried a tiling windows manager, but It does not work.

The latency is huge. Too much for me to write. Forget scrolling. The display is inaccurate, there are plenty of artifacts. You will be able to see what was on the screen 5 minutes ago. Feels like a burned in screen. The kindle display is tiny. I mean, really tiny. That could be fixed. And it the kindle does not have a particular long battery life if you use it as a laptop.

Re:Emacs standing alone on a Linux Kernel by jcrites on Wednesday September 17, 2014 @01:41PM (#8331258)
I believe you need to refresh / redraw the entire screen occasionally. You may notice that the Kindle will draw the entire screen black and then white sometimes, like while turning pages, while other times it will simply erase what was drawn. I gather the screen redraw is to reset the display and minimize those artifacts. (Unless - does the hardware do this for you? I've never tinkered with one and have no special knowledge about Kindles)

Perhaps you could build a tiny program that pops up a black box that covered the entire display occasionally (but it would be frustrating if it appeared at unneeded times). Otherwise I think you'd need to hack on the window manager. Alternatively, perhaps this would all work out better as an app running with the Kindle development kit. I would hope running in the KDK will take advantage of the built in redraw logic. Maybe one could build an SSH client for the Kindle so as to run the programs remotely while displaying with e-ink. (I'm not trying to get you to spend more time on this - your comment just got me thinking :-)

But anyway it's true that e-ink isn't a great fit for dynamically updating displays. Drawing letters one by one while you type them is doable but not its core competency. Switching window focus will be tough since you likely need to redraw the screen.

Re:Emacs standing alone on a Linux Kernel by Someone1234 on Tuesday September 16, 2014 @05:58PM (#8327334)
e-Ink is one of the worlds most underutilized technologies. I wonder why that is?
Re:Emacs standing alone on a Linux Kernel by sho_hn on Tuesday September 16, 2014 @06:02PM (#8327348)
Because it's not very nice to use. It feels unfinished and wonky. I do enjoy using my (high-end and fairly recent, Kobo Aura HD) reader, but fast path page turns degrade the rendition quality of type so quickly that I've set it to do a full refresh every two turns, and so get to put up with how slow and violent they are. It's the sort of tech that would send a cartoon Steve Jobs into a raging fit.

e-Ink feels like a prototype we're putting up with because it has some intrinsic conceptual advantages, but it never feels like it's fully there yet. It's probably the most utilized such technology I can think of (though perhaps I've just gotten more used to other tech's flaws). I'm happy we're willing to do that, really, but e-Ink is unsatisfying and needs to be better.

Re:Emacs standing alone on a Linux Kernel by snogglethorpe on Tuesday September 16, 2014 @09:09PM (#8327962)
Yeah, eink is a great idea, but it feels like it's been just languishing in the "zone of OK" for quite a while, while 99% of industry research dollars are focused on fast-update vivid color light-emitting displays.

Unfortunately the latter are arguably more widely applicable, and vivid color displays are reallly easy to sell to consumers, while the charms of something like eink are more subtle up front (even if very apparent in the long term). Eink-type displays, that emphasize long-period eye comfort and texture over vivacity and color, are probably a smaller niche.

Niches don't really get the money... and subtlety doesn't sell.

Oh well.

Re:Emacs standing alone on a Linux Kernel by derekp7 on Wednesday September 17, 2014 @12:01AM (#8328528)
How about this -- a billboard sized e-ink display. That would let advertisers swap out billboard ads based on time slot (prime time would be rush hours, maybe advertising Crains Business magazine in the morning, and beer in the afternoon rush hour). Or, someone could purchase a flash add that displays for 10 minutes on all billboards in the city. Things like that would be a perfect fit for e-ink.
Re:Emacs standing alone on a Linux Kernel by snogglethorpe on Wednesday September 17, 2014 @12:06AM (#8328545)
Indeed.

There are also (at least around here) vast quantities of poster-sized dynamic advertising displays in pedestrian walking areas that are used "statically" (only update maybe ever minute or so). Right now they use giant lcd monitors for this (hung on the wall like a poster), but they've got to be sucking up a lot of power...

Eink with improved contrast and color support would be very useful...

Re:Emacs standing alone on a Linux Kernel by justincormack on Wednesday September 17, 2014 @06:26AM (#8329349)
I think the colour and motion is more effective at making people notice. And putting these things up is still expensive so the extra hardware costs do not matter so much. And I don't know where to buy giant e-ink displays, and how much they are.
Re:Emacs standing alone on a Linux Kernel by derekp7 on Wednesday September 17, 2014 @05:19PM (#8332417)
That is actually part of the problem -- until the patents run out for e-ink, we won't see these advanced applications.
Re:Emacs standing alone on a Linux Kernel by qbrass on Thursday September 18, 2014 @05:59AM (#8334445)
A billboard sized e-ink display is just a flip-disc display.

http://en.wikipedia.org/wiki/Flip-disc_display

The magic of e-ink is in making the pixels small enough to provide a useable resolution on small screens.

Re:Emacs standing alone on a Linux Kernel by snogglethorpe on Wednesday September 24, 2014 @10:18PM (#8365224)
Being electromechanical though, flip-disk displays apparently have significant maintenance costs, as display elements fail quite frequently. Eink would probably be much better on that front, which would be very beneficial for applications in hard-to-service locations ... like billboards...

One of the earliest applications of eink (before eink "paper" was a thing) was actually in advertising signs with huge feature sizes (10s of cm), so big pixels are not something new to eink.

Re:Emacs standing alone on a Linux Kernel by Immortalin on Tuesday September 16, 2014 @07:46PM (#8327723)
E-ink technology is controlled by only 2 companies in the world. Unless some chinese company manage to clone it, it will be too expensive to use in personal projects. Always wanted an e-ink phone casing....
Re:Emacs standing alone on a Linux Kernel by ptomato on Tuesday September 16, 2014 @11:14PM (#8328363)
Re:Emacs standing alone on a Linux Kernel by Numberwang on Tuesday September 16, 2014 @07:05PM (#8327601)
I'd love to have a large 24" E-ink monitor of the Kindle Paperwhite type. I would have payed good money if such a think would have existed.
Re:Emacs standing alone on a Linux Kernel by rbanffy on Tuesday September 16, 2014 @08:48PM (#8327897)
Not sure it's a very good idea. When I'm typing, I want text not to lag. Using e-ink to edit text feels like ssh through a satellite link.
Re:Emacs standing alone on a Linux Kernel by snogglethorpe on Tuesday September 16, 2014 @09:14PM (#8327976)
From what I've read, though, most of the lag/slowness issues with eink are due to bottlenecks in the supporting electronics, which have relatively narrow channels to the display, and not a lot of processing power. Apparently the focus of most current eink tech is (understandably, given the established markets) power saving and cost, with update speed losing out.

I saw a video a few years ago, where someone had bypassed all that, and was running an eink display at video frame rates. It seemed to work fine.

[...google search...] Ah, here's the video: https://www.youtube.com/watch?v=24srQXX81Oc

There are other similar videos, by other companies, too.

So for a device where more power consumption is acceptable (compared to a power-sipping e-reader), fast-update eink displays may well be possible, and even practical... but it's not so clear anybody is putting much investment in such a thing...

Re:Emacs standing alone on a Linux Kernel by BugBrother on Tuesday September 16, 2014 @11:01PM (#8328320)
I have waited impatiently since the 1990s for a functioning E-ink reader with fast enough page turns to browse documentation.

And the reason it isn't here is not technical problems -- it is because some shaved chimpanzee of an MBA thought high quality E-readers without colour (or a battery good "just" for a few days) was too small a market?!

I have vertigo.

Re:Emacs standing alone on a Linux Kernel by daveloyall on Wednesday September 17, 2014 @12:19PM (#8330746)
I reviewed snogglethorpe's link and then searched a bit. Apparently the same company that made that demo also makes an ebook reader. I don't know if it is cool or not. I don't know their stance on Free Software and Open Hardware. But... They do have a 'video' tag on their blog. http://blog.bookeen.com/tag/video/ Cheers!
Re:Emacs standing alone on a Linux Kernel by MaysonL on Wednesday September 17, 2014 @02:31PM (#8331566)
They seem to have released an 8" 1024X768 reader "Cybook Ocean" earlier this year, about 180 euros.
Re:Emacs standing alone on a Linux Kernel by BugBrother on Wednesday September 17, 2014 @08:06PM (#8332992)
I can't find any info on how quick the page turns are? No A4 size?

(The reader MaysonL mentions doesn't seem to be on sale yet? I don't see review from 2014, at least?)

Re:Emacs standing alone on a Linux Kernel by kazinator on Tuesday September 16, 2014 @05:53PM (#8327316)
Just the fact alone that there is no systemd makes this an awesome distro!
Re:Emacs standing alone on a Linux Kernel by microtherion on Tuesday September 16, 2014 @06:32PM (#8327496)
Now that's what I call "GNU/Linux"
Re:Emacs standing alone on a Linux Kernel by daveloyall on Tuesday September 16, 2014 @06:26PM (#8327469)
Hm, the author really does mean 'standing alone'.

I'd always assumed that when someone does this, they'd make emacs perform the usual init duties, and that the rest of the system would be available.

And you want the rest of the system to be available, to use emacs properly...

    hobbes@metalbaby:~$ find /usr/share/emacs -type f -name \*.el -exec grep '/bin/' {} +|wc -l
    62
    hobbes@metalbaby:~$ find /usr/share/emacs -type f -name \*.el -exec grep call-process {} +|wc -l
    44
...For some reason I thought those numbers would be much larger. I'm probably searching for the wrong strings.
Re:Emacs standing alone on a Linux Kernel by LukeShu on Tuesday September 16, 2014 @08:35PM (#8327868)
Most of the .el files are compressed as .el.gz files; also /sbin/.

    $ find /usr/share/emacs/24.3/ \
    > -name '*.el' -exec grep -E '/s?bin/' {} + -o \
    > -name '*.el.gz' -exec zgrep -E '/s?bin/' {} + | wc -l
    212
    $ find /usr/share/emacs/24.3/ \
    > -name '*.el' -exec grep call-process {} + -o \
    > -name '*.el.gz' -exec zgrep call-process {} + | wc -l
    400
Re:Emacs standing alone on a Linux Kernel by mercurial on Wednesday September 17, 2014 @04:28AM (#8329062)
emacs-systemd, coming soon to your system.
Re:Emacs standing alone on a Linux Kernel by daveloyall on Wednesday September 17, 2014 @12:05PM (#8330665)
Yes! But, we're 0.2 seconds away from the old emacs threading conversation here... :)
Re:Emacs standing alone on a Linux Kernel by spain on Wednesday September 17, 2014 @03:47AM (#8328961)
Sometimes I really do wish GNU Emacs could work as a window manager too. I'm currently using StumpWM but it feels wrong that it's separated from Emacs. Most of the time on my laptop I just have a bunch of emacsclient -c's running, Firefox, and a PDF viewer (though I'm sure Emacs has several browsers, I'm still not willing to give up Firefox).
Re:Emacs standing alone on a Linux Kernel by daveloyall on Wednesday September 17, 2014 @12:41PM (#8330882)
You and I use our computers in a similar manner, right down to the bunch of emacsclient -c's. Throw a deluge and a vlc in there...

I have never quite got emacs integrated into my window manager satisfactorily.

Here are some things I've tried:

* stumpwm without integration

* i3wm with https://github.com/vava/i3-emacs

* Various incarnations of http://www.emacswiki.org/emacs/OneOnOneEmacs with i3wm, awesomewm

Things I have considered trying:

* talking to clfswm via an inferior lisp process

The next thing I'm going to try:

* xmonad (via hackage)

Let's face it, the end goal here is for ALL keys to go through emacs, and then have emacs tell the WM what to do, yeah?

Once that is done, regardless of which wm it gets done to, a bunch of people are going to flock to it, AMIRITE? :)

Re:Emacs standing alone on a Linux Kernel by fdsary on Tuesday September 16, 2014 @05:36PM (#8327253)
A lisp machine!
Re:Emacs standing alone on a Linux Kernel by gpvos on Wednesday September 17, 2014 @05:22AM (#8329219)
> The only external tool needed is mount.

It looks like emacs is missing functionality. Get to it!

Re:Emacs standing alone on a Linux Kernel by postit on Tuesday September 16, 2014 @08:48PM (#8327898)
I always told that Emacs was designed with the fear that some day the OS won't be there. This day is coming
Re:Emacs standing alone on a Linux Kernel by KC8ZKF on Wednesday September 17, 2014 @09:30AM (#8329813)
(replace-regexp-in-string "fear" "hope")
Re:Emacs standing alone on a Linux Kernel by AeroNotix on Tuesday September 16, 2014 @05:29PM (#8327219)
Quite possibly the greatest human achievement ever made.
Re:Emacs standing alone on a Linux Kernel by ejr on Tuesday September 16, 2014 @09:11PM (#8327970)
I imagine there are a number of authors who don't want to be bothered by the extraneous bells and whistles on a new system. It reminds me of this clip of George R.R. Martin. https://www.youtube.com/watch?v=X5REM-3nWHg
Re:Emacs standing alone on a Linux Kernel by hardwaresofton on Tuesday September 16, 2014 @10:48PM (#8328272)
One of these days I'm going to get "All you need is Emacs" on a T-Shirt and teespring it.
Re:Emacs standing alone on a Linux Kernel by hardwaresofton on Thursday September 18, 2014 @11:33PM (#8338875)
http://teespring.com/all-you-need-is-emacs

Pretty impressed with the interface of teespring, it was literally a breeze. Amazing UX and UI design on that site

Re:Emacs standing alone on a Linux Kernel by teddyh on Wednesday September 17, 2014 @05:42AM (#8329261)
> (global-set-key "^\" 'keyboard-quit) ;; strangely, C-g does not work.

That is probably because Emacs remaps the Unix terminal interrupt character from Ctrl-C to Ctrl-G, and then detects the actual interrupt signal. If Emacs is run standalone, then probably the terminal has not been set up correctly, and this needs to be adjusted. I’m sure it could be made to work with a few careful calls to (call-process "/bin/stty" …) or so.

Re:Emacs standing alone on a Linux Kernel by hardwaresofton on Thursday September 18, 2014 @11:33PM (#8338874)
"All you need is Emacs" T-Shirt:

http://teespring.com/all-you-need-is-emacs

(Seemed to be against guidelines to post as it's own thing)

Re:Emacs standing alone on a Linux Kernel by rikkus on Tuesday September 16, 2014 @06:03PM (#8327353)
Only one step left before it's truly a OS in its own right!
Re:Emacs standing alone on a Linux Kernel by bane on Tuesday September 16, 2014 @09:51PM (#8328086)
2017: emacs renamed "GNU Hurd".
Re:Emacs standing alone on a Linux Kernel by cryptos on Wednesday September 17, 2014 @03:20AM (#8328902)
I was thinking that the Emacs operating system already had a kernel! ;-)
Re:Emacs standing alone on a Linux Kernel by izietto on Tuesday September 16, 2014 @05:41PM (#8327272)
King Vim is not amused :P
Re:Emacs standing alone on a Linux Kernel by dredmorbius on Tuesday September 16, 2014 @05:59PM (#8327340)
Consider it a challenge. No real reason you couldn't implement it as well, though AFAIR there's no internal shell mode in vim (you shell out).
Re:Emacs standing alone on a Linux Kernel by mdewinter on Wednesday September 17, 2014 @05:42AM (#8329262)
Re:Emacs standing alone on a Linux Kernel by dredmorbius on Thursday September 18, 2014 @10:03AM (#8335233)
Re:Emacs standing alone on a Linux Kernel by mercurial on Wednesday September 17, 2014 @04:30AM (#8329067)
It's not really the vim way, though. Vim doesn't have web browsers, email client, and the like. Maybe the terribleness of vimscript is a blessing in disguise?
Re:Emacs standing alone on a Linux Kernel by dredmorbius on Wednesday September 17, 2014 @12:51PM (#8330944)
Fair point that. But it's got syntax highlighting for most of the content types you'd be likely to encounter.
Re:Emacs standing alone on a Linux Kernel by emidln on Tuesday September 16, 2014 @07:19PM (#8327654)
You could probably make due with the python plugin, vim-conque, and ipython.
Re:Emacs standing alone on a Linux Kernel by izietto on Tuesday September 16, 2014 @06:04PM (#8327362)
Why all these downvotes... I was just joking :/
Re:Emacs standing alone on a Linux Kernel by krapp on Tuesday September 16, 2014 @06:05PM (#8327368)
text editors is srs bsns.
Re:Emacs standing alone on a Linux Kernel by math0ne on Tuesday September 16, 2014 @05:35PM (#8327242)
I put my shell in your shell so I can shell while you shell.
Re:Emacs standing alone on a Linux Kernel by dredmorbius on Thursday September 18, 2014 @10:05AM (#8335241)
Y'know, that's kind of the point as well.

A number of "BBC" bootable business cards used a /bin/sh script as init. This worked pretty well.

Though, now that I think of it, while I've never had /bin/init itself fail on me, the BBCs would occasionally crash due to a shell hang (either the script or /bin/sh itself, I'm not sure which).