Showing posts from April 22, 2012

GNU Emacs bug: find-dired

Perm URL with updates: Emacs bug: find-diredthis seems to be a showstopper bug.start emacs runemacs.exe -Qcall find-dired.Give a directory path. e.g. ~/web/xahlee_org/comp/Give the find option: -name "*html"expected result: list of files in dired.Here's what i got: c:/Users/h3/web/xahlee_org/comp/: find . "(" -name "*html"")" -exec ls -ld {} ";" Access denied - . File not found - -NAME ---------- AMPERSAND_HTML_ENTITIES_UNICODE_SEMANTICS.HTML … ---------- APPLE_IPAD_CENSORSHIP.HTML … ---------- ASPELL_SPELL_CHECKING.HTML … ---------- ASPELL_VOCABULARY.HTML … ---------- BLOG.HTML … ---------- YOUR_REGEX_BRAIN.HTML … File not found - ) File not found - -EXEC File not found - LS File not found - -LD File not found - {} File not found - ; find finished at Sat Apr 28 19:46:27 each of the “…” is about n lines of file content. The n can b…

random linux notes 2012-04-28

Perm URL with updates: Xfce desktopXfce is one of the light-weight desktop. If you hate the fancy shit in Ubuntu Unity or GNOME 3, and prefer a classic, standard UI that doesn't suck the blood out of your GPU, then use Xfce. Linus, reportedly, got fedup with KDE 4, then GNOME 3, and now uses install, run this: sudo apt-get install xubuntu-desktop• Xubuntu is basically Ubuntu with xfce as desktop by default.there's another competing light-weight desktop, called LXDE, and Lubuntu is Ubuntu with LXDE as default desktop.If you don't know already, Unity and GNOME 3's UI are bleeding-edge, “simplified”, “smart”. Basically, they try to innovate classic desktop metaphor to cater to those brainless computer-illiterates who just use browser, watch movies, and don't know anything about files, folders/directories, apps, workspaces, etc. They try to fashion it to be intuitive and easy-to-use just like Apple'…

John Carmack Glorifying Functional Programing in 3k Words

John Carmack glorifying functional programing in 3k wordsFunctional Programming in C++2012-04-26 By John-Carmack Rss. @ Source www.altdevblogaday.comwhere was he ten years ago?Programing: What are OOP's Jargons and Complexities (Object Oriented Program as Functional Program)

Emacs *scratch* Poem

The emacs scratch buffer thread on newsgroup (Source is rolling, and became a verse fodder. emacs's *scratch* amounts to a bitch but we cannot ditch the banner of our church

new articles on web dev, 2012-04-26

new articles and updates on web dev.2012-04-26 Javascript: Get a Element's Attribute/Properties2012-04-25 Update HTML CSS Javascript DOM, References2012-04-25 much updated Xah's Javascript Tutorial2012-04-24 Complete update: Xah's CSS Tutorial. More to come.

Emacs 24: Oddity with Bidirectional Language/Script Support

first, here's my emacs version am testing from. “GNU Emacs (i386-mingw-nt6.1.7601) of 2012-02-15 on MARVIN”Some facts:Right arrow key → is bound to right-char.【Ctrl+f】 keys is bound to forward-char.Now, paste this sentence in emacs “(كتاب ألف ليلة و ليلة)”. Then, hold down right arrow key, then when cursor moves into the Arabic text, it'll suddenly reverse direction, and move right to left, until it reaches the left most arabic char sequence, it'll jump back to the english text and continue move right.Now, do the same but using forward-char 【Ctrl+f】. Actually, the same behavior is observed visually!from Eli Zaretskii's post (at Source, it seems to be the expected behavior. But then what's the difference of forward-char and right-char? Am totally confused now.In emacs 23, holding right arrow (or 【Ctrl+f】) simply move cursor to the right, ALWAYS. I was expecting this from emacs 24's right-char.

Sort list-colors-display by Hue

Perm URL with updates: can call list-colors-display to list colors and their RGB hex values. But the result is not sorted. Now, you can sort it by hue. Much better. Put this in your emacs init file: (setq list-colors-sort 'hsv )

Google Chrome's “about:config” Panel

In Firefox, you can goto about:config and tweak your mouse configs.In Google Chrome, there's something similar. Goto chrome://flags/.To turn on autoscroll feature on Linux, paste about:config in the URL field, then set general.autoScroll to true.How to Change Firefox Mouse Wheel Scroll Speed?

Emacs 24 now supports bidirectional Text

Perm URL with updates: {Arabic, Persian (Iran), Hebrew}. They flow from right to left.In emacs 23, the key → invokes forward-char. Always moves the cursor to the right.In emacs 24, the key → invokes right-char. The direction the cursor moves depends on cursor point in current text.Note, it's more logical for the two command's behavior to be exchanged. i.e. “right-char” should always move to the right, and “forward-char” should move depending on context.

Emacs 24: Unicode {Space, Hyphen} Chars Display

Perm URL with updates: non-ASCII space and hyphen Unicode characters are displayed with a reddish color to distinguish them from similar ASCII ones. Emacs 24 added 2 more. The complete list of such chars are:“NO-BREAK SPACE” “HYPHEN” (U+2010) “NON-BREAKING HYPHEN” (U+2011) “SOFT HYPHEN” (U+00AD) ­(Copy the above list and paste in emacs to see.)Call describe-variable on “nobreak-char-display” to see the detail.To insert unicode, call ucs-insert. (➲ Emacs and Unicode Tips)

svn upgrade error “svn: E155019”

Recently i upgrade all packages in cygwin. When i did a commit, i got: svn: E155019: Can't upgrade '/cygdrive/c/Users/h3/ErgoEmacs_Source/ergoemacs/ergoemacs' as it is not a pre-1.7 working copy root, the root is '/cygdrive/c/Users/h3/ErgoEmacs_Source/ergoemacs' Oh no! Error! My mind is psychologically conditioned to think i'll need to spend a hour or more to fix whatever problem is this. Apparently, svn 1.7 changed its repository metadata format. Luckily, the solution is simple:cd to the root of your project's svn svn upgradeRepeat for other project's svn root.Whew, that's not too bad.Subversion Basics (svn tutorial)

Programing Problem: Decimalize Latitude Longitude

Last year, i ran a elisp exercise but i got busy and never gave answer. Let's do this again. Here's the problemWrite a function “latitude-longitude-decimalize”.It should take a string like this: "37°26′36.42″N 06°15′14.28″W". The return value should be a pair of numbers, like this: [37.44345 -6.25396].Feel free to use perl, python, ruby, etc. I'll be posting a solution in emacs lisp in 2 days.If you got stuck, you might peak at Kurt Schwehr's solution in python, at Source's site is down at the moment. Here's a temp site for his python code: Source pastebin.com2012-04-27 update• Jon Snader (jcs)'s solution in elisp + CL package, @ Source• Kurt's solution, Python, @ Source• Mickey Petersen's solution, using emacs calc + elisp, @ Source www.masteringemacs.orgJean-Sébastien Ney, Ruby. Port of Kurt's python code to ruby, @ Source • Jorge A. Alfaro Murillo solution in elisp, @ Sou…

CSS3 Color Linear Gradient

Perm URL with updates: page shows a example CSS3's linear gradient feature.Here's the CSS syntax examples:background-image: linear-gradient(0deg, red, yellow) 0deg, red, yellow CSS code:div {background-image: linear-gradient(0deg, red, yellow)} as of 2012-04-23, no browser supports it. Test it here: CSS linear gradient test.Browsers Experimental Support2012-04-23 Google Chrome, Firefox, Safari, Opera, all have experimental support, except Internet Explorer 9. (IE10 does support it) 270deg, yellow, red Here's the CSS code:background-image: linear-gradient(270deg, yellow, red); background-image: -webkit-linear-gradient(270deg, yellow, red); background-image: -moz-linear-gradient(270deg, yellow, red); background-image: -o-linear-gradient(270deg, yellow, red); background-image: -ms-linear-gradient(270deg, yellow, red); The first parameter is a degree. Here, 270° means going from top to bottom, vertically.Smooth Gradiantsin this exampl…

emacs 24 unicode 6 support

Perm URL with updates: 6 SupportUnicode 6 is now supported. For example, call ucs-insert 【Ctrl+x 8 Enter】 then “GRINNING CAT FACE WITH SMILING EYES”, then you get this char 😸.Note: the char won't display in emacs. First, make sure your system has the font. Best is Symbola. (➲ font for Unicode 6) But even if you have Symbola installed, emacs won't show the char unless you actually switch to that font. Am not sure there's much one can do.Source

Emacs 24 Improvements: copy/paste, describe-char, calc keymap

Perm URL with updates: Copy/Paste ProblemIn linux, if copy/paste doesn't work with other apps, you need to add this line: (setq x-select-enable-clipboard t) 2012-04-22 in GNU Emacs, that var is set to t now.unicode infoWhen calling “describe-char”, now it display the char's position in the first line.Here's emacs 23 output: character: m (109, #o155, #x6d) preferred charset: ascii (ASCII (ISO646 IRV)) code point: 0x6D syntax: w which means: word … Here's emacs 24 output: position: 9198 of 11337 (81%), column: 0 character: m (displayed as m) (codepoint 109, #o155, #x6d) preferred charset: ascii (ASCII (ISO646 IRV)) code point in charset: 0x6D syntax: w which means: word calc keys“calc”'s keymapping seems to have improved.before, supposed you have set 【Alt+z】 for undo globally. But it won't work in calc. You have to use…

Emacs Dired Recursive Load Error 2011-05-26

Perm URL with updates: you loaded ErgoEmacs, everytime you try to open a file or directory, you get a “Recursive load” error: expand-file-name: Recursive load: "/usr/share/emacs/23.2/lisp/net/tramp.elc", "/usr/share/emacs/23.2/lisp/shell.elc", "/usr/share/emacs/23.2/lisp/net/tramp.elc", "/usr/share/emacs/23.2/lisp/shell.elc", "/usr/share/emacs/23.2/lisp/net/tramp.elc", "/usr/share/emacs/23.2/lisp/shell.elc", "/usr/share/emacs/23.2/lisp/net/tramp.elc", "/usr/share/emacs/23.2/lisp/shell.elc", "/usr/share/emacs/23.2/lisp/net/tramp.elc"(Tramp is a package integrated with GNU emacs. It lets you work with files in remote servers.)I couldn't think of where that error came from. Plain GNU Emacs doesn't have that error, only when ErgoEmacs is loaded. However, ErgoEmacs doesn't redefine find-file in any way. A Google search turns…