LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1086|回复: 11

emacs中如何使用print-buffer和print-region?

[复制链接]
发表于 2006-5-29 22:08:47 | 显示全部楼层 |阅读模式
[color="DarkOrchid"]
我试用了ntemacs 21.3中的print-buffer和print-region。一旦执行就会僵在那里,不动了。有谁告诉我这两个命令应该如何使用呢?
发表于 2006-5-29 22:16:02 | 显示全部楼层
Post by mylynx
[color="DarkOrchid"]
我试用了ntemacs 21.3中的print-buffer和print-region。一旦执行就会僵在那里,不动了。有谁告诉我这两个命令应该如何使用呢?

难道是调用Windows下的打印服务有问题?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-7-14 17:19:17 | 显示全部楼层
Post by pluskid
难道是调用Windows下的打印服务有问题?

[color="Magenta"]
想问一下pluskid兄,这是我在NTEMACS 23。0。1中看到的信息:

  1. `M-x print-buffer'
  2.      Print hardcopy of current buffer with page headings containing the
  3.      file name and page number.

  4. `M-x print-region'
  5.      Like `print-buffer' but print only the current region.
复制代码

这与MS的打印服务有关吗?为什么我操作时有时会出现停顿现象呢?能帮我看一下吗?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-7-14 17:20:57 | 显示全部楼层
Post by pluskid
难道是调用Windows下的打印服务有问题?

[color="Magenta"]
想问一下pluskid兄,这是我在NTEMACS 23。0。1中看到的信息:

  1. `M-x print-buffer'
  2.      Print hardcopy of current buffer with page headings containing the
  3.      file name and page number.

  4. `M-x print-region'
  5.      Like `print-buffer' but print only the current region.
复制代码

这与MS的打印服务有关吗?为什么我操作时有时会出现停顿现象呢?能帮我看一下吗?
回复 支持 反对

使用道具 举报

发表于 2006-7-14 20:12:05 | 显示全部楼层
print-buffer is an interactive autoloaded Lisp function in `lpr'.
It is bound to <menu-bar> <file> <print-buffer>.
(print-buffer)

Paginate and print buffer contents.

The variable `lpr-headers-switches' controls how to paginate.
If it is nil (the default), we run the `pr' program (or whatever program
`lpr-page-header-program' specifies) to paginate.
`lpr-page-header-switches' specifies the switches for that program.

Otherwise, the switches in `lpr-headers-switches' are used
in the print command itself; we expect them to request pagination.

See the variables `lpr-switches' and `lpr-command'
for further customization of the printer command.
回复 支持 反对

使用道具 举报

发表于 2006-7-14 20:16:05 | 显示全部楼层
我在 cygwin 里面运行 lpr 是可以出现打印任务的,虽然我没有打印机,但是右下角的那个叫什么东西的那个区域里面出现了打印机图标,并且可以看到已经添加的打印任务,但是在 Emacs 里面的话就是直接死掉了。
回复 支持 反对

使用道具 举报

发表于 2006-7-14 20:21:59 | 显示全部楼层
设置了 lpr-command 之后就不会死掉了,但是我设置:

(setq lpr-command "F:/cygwin/bin/lpr")

之后好像并没有像在 cygwin 里面执行 lpr 那样出现任务栏图标。
lpr-command is a variable defined in `lpr.el'.
Its value is ""

Documentation:
*Name of program for printing a file.

On MS-DOS and MS-Windows systems, if the value is an empty string then
Emacs will write directly to the printer port named by `printer-name'.
The programs `print' and `nprint' (the standard print programs on
Windows NT and Novell Netware respectively) are handled specially, using
`printer-name' as the destination for output; any other program is
treated like `lpr' except that an explicit filename is given as the last
argument.

You can customize this variable.
回复 支持 反对

使用道具 举报

发表于 2006-7-15 09:20:51 | 显示全部楼层
打印的话,我用的是 Printing Interface:
  1. ;; printing interface (>=22)
  2. (if (>= emacs-major-version 22)
  3.     (progn (require 'printing)
  4.            (pr-update-menus)))
复制代码

然后在 File 菜单里就会有一个 Print 项。

不过在 Windows 里,要有一个 ps 查看器才能打印,而且我没弄好中文。

注:以前我是不用 ps 查看器,直接点 Emacs 缓冲区中的“打印”按钮就可以打印的;后来不知道执行了什么操作那个会死掉,于是就用 GSview - 一个 Windows 程序来打印了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-7-16 20:34:00 | 显示全部楼层
Post by herberteuler
打印的话,我用的是 Printing Interface:
  1. ;; printing interface (>=22)
  2. (if (>= emacs-major-version 22)
  3.     (progn (require 'printing)
  4.            (pr-update-menus)))
复制代码

然后在 File 菜单里就会有一个 Print 项。

不过在 Windows 里,要有一个 ps 查看器才能打印,而且我没弄好中文。

注:以前我是不用 ps 查看器,直接点 Emacs 缓冲区中的“打印”按钮就可以打印的;后来不知道执行了什么操作那个会死掉,于是就用 GSview - 一个 Windows 程序来打印了。

[color="Magenta"]
herberteuler兄,你这段emacs lisp代码只能适用于最新的emacs上吧。我这里有一个从网上下载的最新版本的NTEMACS 23。0。1,用得还可以,有些功能可以没有原来21.3版本的好。如果把这段代码加入到其中,能否实现相应的打印功能呢?
回复 支持 反对

使用道具 举报

发表于 2006-7-16 22:37:40 | 显示全部楼层
Post by mylynx
[color="Magenta"]
herberteuler兄,你这段emacs lisp代码只能适用于最新的emacs上吧。我这里有一个从网上下载的最新版本的NTEMACS 23。0。1,用得还可以,有些功能可以没有原来21.3版本的好。如果把这段代码加入到其中,能否实现相应的打印功能呢?
你要打印什么内容呢?包含中文吗?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表