Raj Mathur wrote [on 22/08/03 00:50 +0530]: > > Yeah, yeah, Emacs is wonderful, just don't let the Vi fiends hear you > say it :) No, please not another editor war! >
In case of a war, I would be at the receiving end anyway. I love both :) > Santanu> While using emacs, I found that I could use M-x > Santanu> ps-spool-buffer-with-faces to get a wonderful postscript > Santanu> output of the program in the buffer. But still, if I > Santanu> wanted a black and white output with the keywords in > Santanu> bold, remarks in italics, etc. without changing the > Santanu> faces, I had to use enscript. So, I would like to create > Santanu> a keyboard macro to run the following enscript command on > Santanu> the buffer contents: enscript -E lisp -i 10 --media=a4 > Santanu> --output=buffer.ps --color \ --margins=25:25:30:30 > > I'd write a small function to do it. Write a function that selects > the buffer and then shell-command-on-region on it. The output will go > into a named buffer. > Thanks for mentioning the shell-command-on-region command. Somehow I had missed it. After getting a bit more familiar with elisp,I shall try the lisp function you mentioned. In the meantime, I read the entire chapter on shell and about macros and achieved the same using: C-x ( C-x h M-| enscript -Escheme -Ma4 -obuffer.ps C-x ) and then saved the macro using M-x name-last-kbd-macro, and then saved the macro in my .emacs after generating the lisp function using M-x insert-kbd-macro. > Santanu> I would also like to know what is the emacs equivalent of > Santanu> the following vim command: :r!<shell command> > > Another defun: open line below, move to new line, add a space or > something, make it the region, again shell-command-on-region. > > I doubt if these are the optimal solutions, but they should work. > For this, a thorough read of the shell chapter of the manual turned up the following shorter solution: C-u M-! <shell command> Maybe I was a bit too excited after discovering Emacs :) and overlooked some important portions of the manual. Thanks anyway. Regards, Santanu ------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0 _______________________________________________ linux-india-help mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/linux-india-help
