Re: compilation, version control, was: cleaner tramp-aware bindings

2001-03-18 Thread Skip Montanaro
Kai> I just look at the indentation to see the structure. Seems like you'd like Python... ;-) S

Re: compilation, version control, was: cleaner tramp-aware bindings

2001-03-18 Thread Stefan Monnier
> works for me, and seems even cleaner. (Except for the paren placement: > being usually procedural I like starts and ends to line up :-) There are coding conventions in most/all languages. It's usually considered good practice to follow them, even if your habits disagree at first. Ste

Re: compilation, version control, was: cleaner tramp-aware bindings

2001-03-16 Thread Kai Großjohann
On Fri, 16 Mar 2001, Tom Roche wrote: > works for me, and seems even cleaner. (Except for the paren > placement: being usually procedural I like starts and ends to line > up :-) I fail to see why people want to do this parens thing. Whoever looks at them? I just look at the indentation to see

compilation, version control, was: cleaner tramp-aware bindings

2001-03-16 Thread Tom_Roche
"Stefan Monnier" <[EMAIL PROTECTED]> 16 Mar 2001 09:50:19 -0500 > (define-key global-map "\M-`" >(lambda () > "Use `tramp-compile' if in a tramp buffer, `compile' otherwise." > (interactive) > (call-interactively > (if (tramp-tramp-file-p buffer-file-name) > 'tr

Re: cleaner tramp-aware bindings

2001-03-16 Thread Stefan Monnier
> "Daniel" == Daniel Pittman <[EMAIL PROTECTED]> writes: > Point of view, really. &rest accepts zero or more arguments, &optional > accepts zero or one. It makes little difference if you only ignore them. But since the argument is ignored and since no argument is passed when used interactivel

Re: cleaner tramp-aware bindings

2001-03-15 Thread Daniel Pittman
On Thu, 15 Mar 2001, Tom Roche wrote: > Daniel Pittman <[EMAIL PROTECTED]> 6 Mar 2001 14:50:35 +1100 >> Try this for size, it /should/ work (with your key-binging, not mine >> :): > >> (define-key global-map [(control f10)] >> (lambda (&rest args) > > I _knew_ there was a better way

cleaner tramp-aware bindings

2001-03-15 Thread Tom_Roche
Daniel Pittman <[EMAIL PROTECTED]> 6 Mar 2001 14:50:35 +1100 > Try this for size, it /should/ work (with your key-binging, not mine > :): > (define-key global-map [(control f10)] > (lambda (&rest args) I _knew_ there was a better way than &optional ... > (interactive)

Re: found a clue! was: tramp-aware bindings

2001-03-15 Thread Daniel Pittman
On Thu, 15 Mar 2001, Tom Roche wrote: > Daniel Pittman <[EMAIL PROTECTED]> 16 Mar 2001 13:47:29 +1100 >>> So, you need to pass arg from your lambda to `compile'. :) > > <[EMAIL PROTECTED]> Thu, 15 Mar 2001 22:19:32 -0500 >> Hey, no linenoise! But the signature of compile is > >> (defun compile (

Re: tramp-aware bindings

2001-03-15 Thread Daniel Pittman
On Thu, 15 Mar 2001, Tom Roche wrote: > Daniel Pittman <[EMAIL PROTECTED]> 16 Mar 2001 11:18:38 +1100 So, rather than doing (if ... 'tramp-compile 'compile), run the command you want, so: > (if ... (tramp-compile) (compile)) > > On Thu, 15 Mar 2001, Tom Roche wrote: >>> I get nois

found a clue! was: tramp-aware bindings

2001-03-15 Thread Tom_Roche
Daniel Pittman <[EMAIL PROTECTED]> 16 Mar 2001 13:47:29 +1100 >> So, you need to pass arg from your lambda to `compile'. :) <[EMAIL PROTECTED]> Thu, 15 Mar 2001 22:19:32 -0500 > Hey, no linenoise! But the signature of compile is > (defun compile (command) > So how to get 'command to them? Chan

Re: tramp-aware bindings

2001-03-15 Thread Tom_Roche
Daniel Pittman <[EMAIL PROTECTED]> 16 Mar 2001 11:18:38 +1100 >>> So, rather than doing (if ... 'tramp-compile 'compile), run the >>> command you want, so: >>> (if ... (tramp-compile) (compile)) On Thu, 15 Mar 2001, Tom Roche wrote: >> I get noise in *Messages* (broken for mail): Daniel Pittma

Re: tramp-aware bindings

2001-03-15 Thread Daniel Pittman
On Thu, 15 Mar 2001, Tom Roche wrote: > Daniel Pittman <[EMAIL PROTECTED]> 16 Mar 2001 11:18:38 +1100 You want: > (define-key global-map "\M-`" (lambda (&optional arg) (interactive) (if (tramp-tramp-file-p buffer-file-name) 'tramp-compile

addendum to tramp-aware bindings

2001-03-15 Thread Tom_Roche
[EMAIL PROTECTED] Thu, 15 Mar 2001 21:16:12 -0500 > So I delete tramp-util.elc (hoping to avoid bytecode), start another > emacs with -debug-init, eval it again, and run it again: I get > (broken for mail) > *Backtrace* > Signaling: (wrong-number-of-arguments #[(command) "^H^Qà ?Ä\"ˆÅ > Æ\"‡" [co

Re: tramp-aware bindings

2001-03-15 Thread Tom_Roche
Daniel Pittman <[EMAIL PROTECTED]> 16 Mar 2001 11:18:38 +1100 >>> You want: >>> (define-key global-map "\M-`" >>> (lambda (&optional arg) >>> (interactive) >>> (if (tramp-tramp-file-p buffer-file-name) >>> 'tramp-compile >>> 'compile >>> ) >>> ) >>> ) >>> Umm ...

Re: tramp-aware bindings

2001-03-15 Thread Daniel Pittman
On Thu, 15 Mar 2001, Tom Roche wrote: > On Thu, 15 Mar 2001, Tom Roche wrote: > What am I doing wrong? [...] > Daniel Pittman <[EMAIL PROTECTED]> 16 Mar 2001 11:18:38 +1100 >> You want: > >> (define-key global-map "\M-`" >> (lambda (&optional arg) >> (interactive) >> (if (tramp-tr

Re: tramp-aware bindings

2001-03-15 Thread Tom_Roche
On Thu, 15 Mar 2001, Tom Roche wrote: What am I doing wrong? Daniel Pittman <[EMAIL PROTECTED]> 16 Mar 2001 10:48:11 +1100 >>> Add an `interactive' form to the top of the function. <[EMAIL PROTECTED]> Thu, 15 Mar 2001 19:06:25 -0500 >> Actually, I had tried that. If I do >> (define-key glo

Re: tramp-aware bindings

2001-03-15 Thread Daniel Pittman
On Thu, 15 Mar 2001, Tom Roche wrote: > On Thu, 15 Mar 2001, Tom Roche wrote: [...] > Daniel Pittman <[EMAIL PROTECTED]> 16 Mar 2001 10:48:11 +1100 >> Trying to bind a function that isn't interactive to a key sequence. >> Add an `interactive' form to the top of the function. > > Actually, I had

Re: tramp-aware bindings

2001-03-15 Thread Tom_Roche
On Thu, 15 Mar 2001, Tom Roche wrote: >> I've done several variations on >>> (define-key global-map "\M-`" >>> (lambda (&optional arg) >>> (if (tramp-tramp-file-p buffer-file-name) >>> 'tramp-compile >>> 'quote compile >>> ) >>> ) >>> ) >> none of which work: the curr

Re: tramp-aware bindings

2001-03-15 Thread Daniel Pittman
On Thu, 15 Mar 2001, Tom Roche wrote: [...] > Urgghh ... this highlights my elisp deficiency. I've done several > variations on > > ;; "Use 'tramp-compile' if in a tramp buffer, 'compile' otherwise." > (define-key global-map "\M-`" > (lambda (&optional arg) > (if (tramp-tramp-file-p buffe

tramp-aware bindings

2001-03-15 Thread Tom_Roche
On Thu, 15 Mar 2001, Tom Roche wrote: >> ? How to make a key binding tramp-aware? Do I need to? [EMAIL PROTECTED] 15 Mar 2001 23:21:06 +0100 > Oh. Well, write a little function which checks whether the current > file is a tramp file and then calls either compile or > tramp-compile... > The magic