.emacs

2001-01-30 Thread brianr

Mark Fowler writes:
 > I like my .emacs file.  It sets nice fonts and colours, and sets the
 > editing mode and wrapping mode of choice ;-)
 > 
 > I'm sure it can do more...
 > 
 >  1) Where do I find handy things to put into my .emacs file on the web?
 >  2) Got any nice bits of your .emacs file to share?

Apart from the options menu settings, my .emacs file contains:

(require 'gnuserv)
(gnuserv-start)

(load-library "my-startup")

i.e. all my '.emacs' code is in another file and byte compiled for
faster loading. Most of the code in that file is pretty specific to me
(not to mention being a f**king mess), so I'm not going to post
it. However, one of the more general functions that I have not yet
seen elsewhere is:

(defun bfr-mouse-call-last-kbd-macro (event)
  "*Execute last keyboard macro at point of mouse click"
  (interactive "e")
  (progn
(mouse-set-point event)
(call-last-kbd-macro)))
(global-set-key [(control meta button1)] 'bfr-mouse-call-last-kbd-macro)

This is for xemacs BTW. I seem to remember setting the point being
different in GNU emacs IIRC.

I have just started looking at http://tiny-tools.sourceforge.net. It
seems to have a fair bit of interesting emacs (& Perl) related stuff
and links. Indeed, one of the tips I saw there (can't remember exactly
where though) was don't prefix your own functions with your initials
as this make your code harder to share. Oh well.

HTH

-- 
Brian Raven
When in doubt, parenthesize.  At the very least it will let some
poor schmuck bounce on the % key in vi.
 -- Larry Wall in the perl man page



Re: .emacs

2001-01-30 Thread Michael Stevens

On Mon, Jan 29, 2001 at 07:53:00PM +, Mark Fowler wrote:
> I like my .emacs file.  It sets nice fonts and colours, and sets the
> editing mode and wrapping mode of choice ;-)
> I'm sure it can do more...
>  1) Where do I find handy things to put into my .emacs file on the web?
>  2) Got any nice bits of your .emacs file to share?
> Note that (shock, horror) I can't program lisp properly (duh, I program
> perl) so that I may sound stupid when it comes to these things.

;; working for me to get unix line endings on a win32 system
(set-default-coding-systems 'undecided-unix)

;; I like auto-fill when I'm editing text. usually
(add-hook 'text-mode-hook 'auto-fill-mode)

;; show me the region selected right now
(setq transient-mark-mode t)

Michael



Re: .emacs

2001-01-30 Thread Richard Clamp

On Tue, Jan 30, 2001 at 09:55:58AM +, Dominic Mitchell wrote:
> On Mon, Jan 29, 2001 at 08:13:11PM +, Mark Fowler wrote:
> > Robin said:
> > > On Mon, Jan 29, 2001 at 07:53:00PM +, Mark Fowler wrote:
> > > >  2) Got any nice bits of your .emacs file to share?
> > > 
> > > Hmm, well this:
> > > 
> > > (add-hook 'ange-ftp-process-startup-hook
> > >   '(lambda ()
> > >  (ange-ftp-raw-send-cmd proc "passive on")))
> > > 
> > > enables ange-ftp mode to work from inside our firewall.
> > > Not very exciting unless you have the same problem...
> 
> I can't get this to work.  At least not with efs under xemacs.  It just
> hangs after issuing the command.  Unfortunately, my elisp debugging
> skills aren't up to sorting it out.  :-(

That cause efs != angeftp.  M-x apropos efs-.*-process would be my best
guess for where to start tweaking.

Either that or look for something like ftp-command, and change the value of
that from ftp to pftp[0]

[0] YMMV is you're not using the same ftp doohicky as my box does.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: .emacs

2001-01-30 Thread James Powell

On Tue, Jan 30, 2001 at 09:55:58AM +, Dominic Mitchell wrote:
> On Mon, Jan 29, 2001 at 08:13:11PM +, Mark Fowler wrote:
> > Robin said:
> > > On Mon, Jan 29, 2001 at 07:53:00PM +, Mark Fowler wrote:
> > > >  2) Got any nice bits of your .emacs file to share?
> > > 
> > > Hmm, well this:
> > > 
> > > (add-hook 'ange-ftp-process-startup-hook
> > >   '(lambda ()
> > >  (ange-ftp-raw-send-cmd proc "passive on")))
> > > 
> > > enables ange-ftp mode to work from inside our firewall.
> > > Not very exciting unless you have the same problem...
> 
> I can't get this to work.  At least not with efs under xemacs.  It just
> hangs after issuing the command.  Unfortunately, my elisp debugging
> skills aren't up to sorting it out.  :-(
> 
> -Dom

You'll be wanting

;; efs passive FTP mode as behind firewall
(setq efs-use-passive-mode t)

If you want to send some passwords in plaintext then ;)


jp (who has trouble getting OpenSSH's scp to work)




Re: .emacs

2001-01-30 Thread Michael Stevens

On Mon, Jan 29, 2001 at 07:53:00PM +, Mark Fowler wrote:
> I like my .emacs file.  It sets nice fonts and colours, and sets the
> editing mode and wrapping mode of choice ;-)
> 
> I'm sure it can do more...
> 
>  1) Where do I find handy things to put into my .emacs file on the web?
>  2) Got any nice bits of your .emacs file to share?
> 
> Note that (shock, horror) I can't program lisp properly (duh, I program
> perl) so that I may sound stupid when it comes to these things.

The real trick is trying to write something portable between emacs
and xemacs. Anyway...

;; inhibit annoying messages
(setq inhibit-startup-echo-area-message t)
(setq inhibit-startup-message t)

;; set general defaults
(setq tab-width 2)
(setq indent-tabs-mode nil)
(setq initial-major-mode 'text-mode)
(setq default-major-mode 'text-mode)

;; add my libraries to load-path
(setq load-path
      (append (list (expand-file-name "~michaels/etc/emacs"))
  load-path))

p4.el available from http://www.dsmit.com/p4/ is kinda nice if you're
working with perforce.

Michael



Re: .emacs

2001-01-30 Thread Dominic Mitchell

On Mon, Jan 29, 2001 at 08:13:11PM +, Mark Fowler wrote:
> Robin said:
> > On Mon, Jan 29, 2001 at 07:53:00PM +, Mark Fowler wrote:
> > >  2) Got any nice bits of your .emacs file to share?
> > 
> > Hmm, well this:
> > 
> > (add-hook 'ange-ftp-process-startup-hook
> >   '(lambda ()
> >  (ange-ftp-raw-send-cmd proc "passive on")))
> > 
> > enables ange-ftp mode to work from inside our firewall.
> > Not very exciting unless you have the same problem...

I can't get this to work.  At least not with efs under xemacs.  It just
hangs after issuing the command.  Unfortunately, my elisp debugging
skills aren't up to sorting it out.  :-(

-Dom



.emacs

2001-01-30 Thread Adam Worrall

>>>>> "MF" == Mark Fowler <[EMAIL PROTECTED]> writes:

MF> 2) Got any nice bits of your .emacs file to share?

My only foray into elisp was this chunk:

/ Start /
;; This revert function does not prompt.
;; Use a `permenant-local' buffer local variable to allow the function
;; to be switched on once per file; this will prevent accidental
;; damage to important files.
(defvar first-call-to-revert t
  "By default we do not allow serious buffer reverting")
(put 'first-call-to-revert 'permanent-local t)
(make-variable-buffer-local 'first-call-to-revert)

(defun abw-revert-buffer ()
 "Serious, unprompting revert-buffer"
  (interactive)
  (progn
(if first-call-to-revert
(if (y-or-n-p "Enable serious revert buffer ? ")
(progn
  (revert-buffer t t)
  (message "Buffer reverted")
  (setq first-call-to-revert nil)))
  (progn
(revert-buffer t t)
(message "Buffer reverted")

-/ End /-

You then bind 'abw-revert-buffer' toa handy key, and have an
ask-first-time-only buffer reverting thing. I daresay there's on option
for this now, but hey !

 - Adam

PS: If anyone out there is sick enough to use the folding editor
 extension to emacs, I have lots of hand crafted glue to make it
 play nicely with font-lock ...






Re: .emacs

2001-01-29 Thread Jonathan Stowe

On Mon, 29 Jan 2001, Mark Fowler wrote:
>
> P.S. All other editor comments >/dev/null or to sender as I think we've
> had quite enough holy wars on this list this month.
>

Tsk, tsk - you shouldnt have brought it up then had you :)

/J\
-- 
Jonathan Stowe   |
http://www.gellyfish.com |   I'm with Grep on this one
http://www.tackleway.co.uk   |




Re: .emacs

2001-01-29 Thread Richard Clamp

On Mon, Jan 29, 2001 at 08:26:32PM +, Robin Houston wrote:
> On Mon, Jan 29, 2001 at 08:13:11PM +, Mark Fowler wrote:
> > 
> > Hmm. Can you do something to save directly via scp?
> 
> http://ls6-www.informatik.uni-dortmund.de/~grossjoh/emacs/tramp.html

See, that's what you get for posting before/while your modem connection
messes you about as you download mail.

D'oh

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: .emacs

2001-01-29 Thread Richard Clamp

On Mon, Jan 29, 2001 at 08:13:11PM +, Mark Fowler wrote:
> Hmm. Can you do something to save directly via scp?

Yup, in 2 expressions

 (require 'tramp)
 (setq tramp-default-method "scp")

tramp is here:
 http://ls6-www.informatik.uni-dortmund.de/~grossjoh/emacs/tramp.html

scp, well that'll probably be in your path.

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: .emacs

2001-01-29 Thread Robin Houston

On Mon, Jan 29, 2001 at 08:13:11PM +, Mark Fowler wrote:
> 
> Hmm. Can you do something to save directly via scp?

http://ls6-www.informatik.uni-dortmund.de/~grossjoh/emacs/tramp.html

 .robin.

-- 
A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal--Panama!



Re: .emacs

2001-01-29 Thread Michael Stevens

On Mon, Jan 29, 2001 at 07:53:00PM +, Mark Fowler wrote:
> I like my .emacs file.  It sets nice fonts and colours, and sets the
> editing mode and wrapping mode of choice ;-)
> I'm sure it can do more...
>  1) Where do I find handy things to put into my .emacs file on the web?
>  2) Got any nice bits of your .emacs file to share?
> Note that (shock, horror) I can't program lisp properly (duh, I program
> perl) so that I may sound stupid when it comes to these things.

I have a massive emacs setup of multi-pleasure that's been mouldering
for about two-three years.

Maybe I should resurrect it.

Michael



Re: .emacs

2001-01-29 Thread Mark Fowler

Robin said:
> On Mon, Jan 29, 2001 at 07:53:00PM +, Mark Fowler wrote:
> >  2) Got any nice bits of your .emacs file to share?
> 
> Hmm, well this:
> 
> (add-hook 'ange-ftp-process-startup-hook
>   '(lambda ()
>  (ange-ftp-raw-send-cmd proc "passive on")))
> 
> enables ange-ftp mode to work from inside our firewall.
> Not very exciting unless you have the same problem...

Hmm. Can you do something to save directly via scp?

Later.

Mark.

(who if not can see a perl program coming on)

-- 
print "\n",map{my$a="\n"if(length$_>6);' 'x(36-length($_)/2)."$_\n$a"} (
   Name  => 'Mark Fowler',Title => 'Technology Developer'  ,
   Firm  => 'Profero Ltd',Web   => 'http://www.profero.com/'   ,
   Email => '[EMAIL PROTECTED]',   Phone => '+44 (0) 20 7700 9960'  )








.emacs

2001-01-29 Thread Mark Fowler

I like my .emacs file.  It sets nice fonts and colours, and sets the
editing mode and wrapping mode of choice ;-)

I'm sure it can do more...

 1) Where do I find handy things to put into my .emacs file on the web?
 2) Got any nice bits of your .emacs file to share?

Note that (shock, horror) I can't program lisp properly (duh, I program
perl) so that I may sound stupid when it comes to these things.

Later.

Mark.

P.S. All other editor comments >/dev/null or to sender as I think we've
had quite enough holy wars on this list this month.

Oh that goes for pro/anti lisp/scheme comments too ;-)

-- 
print "\n",map{my$a="\n"if(length$_>6);' 'x(36-length($_)/2)."$_\n$a"} (
   Name  => 'Mark Fowler',Title => 'Technology Developer'  ,
   Firm  => 'Profero Ltd',Web   => 'http://www.profero.com/'   ,
   Email => '[EMAIL PROTECTED]',   Phone => '+44 (0) 20 7700 9960'  )