From igor@REDACTED Sun Mar 4 15:28:05 2007 From: igor@REDACTED (Igor Goryachev) Date: Sun, 04 Mar 2007 17:28:05 +0300 Subject: [erlang-patches] tiny http-auth improvement for http-client Message-ID: <87ejo584ne.fsf@goryachev.org> Hello everyone. HTTP-client could not perform HTTP-Auth with weird user or password, i.e. when password contains "/" symbol: igor@REDACTED:~/http-client% erl Erlang (BEAM) emulator version 5.5.3 [source] [async-threads:0] [kernel-poll:false] Eshell V5.5.3 (abort with ^G) 1> http:request(get, {"http://igor:ac/dc@REDACTED/photos/", []}, [], []). {error,{malformed_url,"http://igor:ac/dc@REDACTED/photos/"}} I added an extra http option (#http_options{http_auth, % {User, Password} = {string(), string()}}) which helps http-client to handle arbitary user and password: 2> http:request(get, {"http://www.goryachev.org/photos/", []}, [{http_auth, {"igor", "ac/dc"}}], []). =INFO REPORT==== 4-Mar-2007::17:07:56 === The inets application was not started. Has now been started as a temporary application. {ok,{{"HTTP/1.1",200,"OK"}, ..... With wrong password: 3> http:request(get, {"http://www.goryachev.org/photos/", []}, [{http_auth, {"igor", "ac\dc"}}], []). {ok,{{"HTTP/1.1",401,"Unauthorized"}, ..... -------------- next part -------------- A non-text attachment was scrubbed... Name: erlang_inets_http_auth_option.diff Type: text/x-diff Size: 2250 bytes Desc: not available URL: -------------- next part -------------- -- Igor Goryachev E-Mail/Jabber: igor@REDACTED From emad@REDACTED Sat Mar 17 07:09:36 2007 From: emad@REDACTED (Emad El-Haraty) Date: Sat, 17 Mar 2007 06:09:36 +0000 Subject: [erlang-patches] PATCH: Support for C-w and C-u in erl shell Message-ID: <20070317060936.GG13487@zork.net> Hi, Attached is a patch that implements the functionality of C-w the unix-discard-line functionality provided by readline and C-u the kill previous word functionality into the erlang shell: Both properly populate the kill_buffer such that C-y behaves as expected. -- Emad El-Haraty E / If you can't beat them, M\/ arrange to have them beaten. A\/ D -------------- next part -------------- --- /usr/local/src/otp_src_R11B-3/lib/stdlib/src/edlin.erl 2006-11-06 07:52:00.000000000 -0600 +++ lib/stdlib-1.14.3/src/edlin.erl 2007-03-17 00:30:05.000000000 -0500 @@ -161,7 +161,8 @@ key_map($\^K, none) -> kill_line; key_map($\r, none) -> new_line; key_map($\^T, none) -> transpose_char; -key_map($\^U, none) -> ctlu; +%key_map($\^U, none) -> ctlu; +key_map($\^U, none) -> kill_full_line; key_map($\^], none) -> auto_blink; key_map($\^X, none) -> ctlx; key_map($\^Y, none) -> yank; @@ -181,6 +182,7 @@ key_map($y, meta) -> yank_pop; key_map($\177, none) -> backward_delete_char; key_map($\177, meta) -> backward_kill_word; +key_map($\^W, none) -> backward_kill_word; key_map($[, meta) -> meta_left_sq_bracket; key_map($D, meta_left_sq_bracket) -> backward_char; key_map($C, meta_left_sq_bracket) -> forward_char; @@ -241,6 +243,9 @@ do_op(kill_line, Bef, Aft, Rs) -> put(kill_buffer, Aft), {{Bef,[]},[{delete_chars,length(Aft)}|Rs]}; +do_op(kill_full_line, Bef, Aft, Rs) -> + put(kill_buffer, reverse(Bef)++Aft), + {{[],[]},[{delete_chars,-length(Bef)},{delete_chars,length(Aft)}|Rs]}; do_op(yank, Bef, [], Rs) -> Kill = get(kill_buffer), {{reverse(Kill, Bef),[]},[{put_chars,Kill}|Rs]};