On Tue, Feb 2, 2010 at 12:58 PM, Emanuel Heitlinger
<[email protected]> wrote:
> Hi Mark,
>
> thanks for the suggestion:
> the shell function has to be a bit more complicated
>
> function emacs-web {
> emacsclient -e '(w3m "'$1'")'
> }
>
> otherwise $1 would taken literally.
>
Yeah, sorry. I just threw that down without checking it.
> Next problem appeared on 5) as my conkeror seemed to be ignorant of shell
> functions (that is probably something wrong on my system, it works as a
> little shell script). So I can use this workaround now.
>
That makes total sense. The function declared in .bashrc is only
going to work from a bash shell. Didn't occur to me at the time.
You'll have to do what you said and place the code to execute the
'emacsclient' command within a shell script somewhere in $PATH.
> I am most happy to be teached a little java-script through my .conkerorrc.
> Getting involved more after some time of fiddling with dotfiles of
> ratpoison/emacs/conkeror is a long term goal (... but really loooong term as
> I am a biologist just getting slowly into bioinformatics).
The javascript itself is pretty straight forward (at least I thought
so having never used it before). Setting up some key bindings and
webjumps was enough to give me a feel for it. Learning all the
functionality of the underlying libraries will probably take a little
longer.
>
> Emanuel
>
I took a crack at it and I think what I have below will accomplish
what you want if placed in your .conkerorrc. Hope that helps.
-Mark
function shell_on_url(funcname, funcdesc, cmd) {
//Create an interactive function for running a predetermined
//shell command on a url
//Bind a specific shell command for a url to 'functionname'
//Taken largely from "shell-command-on-url" and
//"shell-command-on-file" in commands.js
interactive(funcname, funcdesc,
function (I) {
var cwd = I.local.cwd;
var element = yield read_browser_object(I);
var spec = load_spec(element);
var uri = load_spec_uri_string(spec);
shell_command_with_argument_blind(cmd, uri, $cwd = cwd);
},
$browser_object = browser_object_links);
}
shell_on_url("w3m-on-url", "Open a url in emacs w3m mode","emacs-web");
_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror