Patches applied:

 * emacs@sv.gnu.org/emacs--devo--0--patch-263
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-264
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-265
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-99
   Merge from emacs--devo--0

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-100
   Update from CVS

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-555
This commit is contained in:
Karoly Lorentey 2006-05-05 10:30:28 +00:00
commit f6cf85ac95
26 changed files with 597 additions and 616 deletions

View file

@ -23,8 +23,6 @@ face name prefixes should be in it for good results.
** Ask maintainers of refcard translations to update them.
** Check what should be deleted or updated in MORE.STUFF.
** Send an email to the various distributions, including the GNOME
and KDE projects, to use the new Emacs icons in etc/images/icons.
@ -33,12 +31,15 @@ Assigned to Bill Wohler <wohler@newt.com>.
* BUGS
** Stefan Monnier's March 20 bug report about 3d boxes in header line.
** JD Smith's 17 Apr 2006 bug report that CVS operations
get mysterious unreproducible failures.
** David Hansen's bug report on 16 Apr 2006 about point-entered and
point-left text properties.
** Is there a basic problem with cl-byte-compile-compiler-macro?
** Recalculate the tool bar height after changing the default font.
(Bug report by Yamamoto Mistuharu, 31 Mar 2006)
** Cursor position display bug from Yamamoto Mistuharu, 11 Apr 2006.
** Markus Gritsch's report about Emacs looping on Windoze with the following
.emacs file, and then reduce Emacs frame width to "something quite narrow":
@ -71,97 +72,6 @@ Lisp point of view.
** Check man/info.texi.
** Add missing years in copyright notices of all files.
Please record your name here and say which part of the distribution
you're going to handle.
DIRECTORY STATUS IN CHARGE
--------- ------ ---------
etc (and subdirs) done Thien-Thi Nguyen (ttn(@gnu.org))
leim done Kenichi Handa
lib-src done ttn
lisp done ttn
lisp/calc done Jay Belanger
lisp/calendar done Glenn Morris
lisp/emacs-lisp done ttn
lisp/emulation done ttn
lisp/eshell done ttn
lisp/gnus done Romain Francoise
lisp/international done Kenichi Handa
lisp/language done Kenichi Handa
lisp/mail done ttn
lisp/mh-e done Bill Wohler
lisp/net done ttn
lisp/obsolete done ttn
lisp/play done Romain Francoise
lisp/progmodes done Nick Roberts
lisp/term done ttn
lisp/textmodes done ttn
lisp/url done ttn
lispintro done ttn
lispref done ttn
lwlib done ttn
m4 done ttn
mac (and subdirs) done ttn
man done ttn
msdos done ttn
nt (and subdirs) done ttn
oldXMenu done ttn
src (and subdirs) done ttn
vms done ttn
** Check the Emacs manual.
Each manual section should be checked for factual correctness
regarding recent changes by at least two people. After each file
name, on the same line or the following line, come the names of the
people who have checked it.
SECTION READERS
-----------------------------
man/abbrevs.texi Chong Yidong Joakim Verona
man/anti.texi Chong Yidong
man/basic.texi "Luc Teirlinck" Chong Yidong
man/buffers.texi "Luc Teirlinck" Chong Yidong
man/building.texi "Ted Zlatanov" <tzz@lifelogs.com>
man/calendar.texi joakim@verona.se Chong Yidong
man/cmdargs.texi Chong Yidong "Luc Teirlinck"
man/commands.texi "Luc Teirlinck" Chong Yidong
man/custom.texi Chong Yidong "Luc Teirlinck"
man/dired.texi Chong Yidong joakim@verona.se
man/display.texi "Luc Teirlinck" Chong Yidong
man/emacs.texi "Luc Teirlinck" Lute Kamstra
man/entering.texi "Luc Teirlinck" Chong Yidong
man/files.texi "Luc Teirlinck" Chong Yidong
man/fixit.texi "Luc Teirlinck" Chong Yidong
man/frames.texi "Luc Teirlinck" Chong Yidong
man/glossary.texi Chong Yidong
man/help.texi "Luc Teirlinck" Chong Yidong
man/indent.texi "Luc Teirlinck" Chong Yidong
man/killing.texi "Luc Teirlinck" Chong Yidong
man/kmacro.texi "Luc Teirlinck" Chong Yidong
man/macos.texi Chong Yidong
man/maintaining.texi Chong Yidong
man/major.texi "Luc Teirlinck" Chong Yidong
man/mark.texi "Luc Teirlinck" Chong Yidong
man/mini.texi "Luc Teirlinck" Chong Yidong
man/misc.texi Chong Yidong
man/msdog.texi Chong Yidong
man/mule.texi "Luc Teirlinck" Kenichi Handa
man/m-x.texi "Luc Teirlinck" Chong Yidong
man/picture.texi Joakim Verona <joakim@verona.se> Chong Yidong
man/programs.texi "Stephen Eglen" Chong Yidong
man/regs.texi "Luc Teirlinck" Chong Yidong
man/rmail.texi Chong Yidong "Luc Teirlinck"
man/screen.texi "Luc Teirlinck" Chong Yidong
man/search.texi "Luc Teirlinck" Chong Yidong
man/sending.texi Chong Yidong "Luc Teirlinck"
man/text.texi "Luc Teirlinck" Chong Yidong
man/trouble.texi Chong Yidong
man/windows.texi "Luc Teirlinck" Chong Yidong
man/xresources.texi
** Check the Emacs Lisp manual.
Each manual section should be checked for factual correctness

View file

@ -1,3 +1,36 @@
2006-05-04 Karl Chen <quarl@NOSPAM.quarl.org>
* progmodes/perl-mode.el (perl-beginning-of-function):
Skip anonymous subs.
2006-05-04 Dan Nicolaescu <dann@ics.uci.edu>
* ibuffer.el (ibuffer-compressed-file-name-regexp): Avoid loading
regexp-opt at run time.
* term.el (term-handle-ansi-escape): Fix off by one error.
2006-05-04 Nick Roberts <nickrob@snap.net.nz>
* progmodes/gdb-ui.el (gdb-force-update): Delete variable...
(gdb-init-1, gdb-post-prompt): ...and references to it.
(gdb-frame-handler): Strip directory name from filename if present.
* progmodes/gud.el (gdb-force-update): Delete defvar
(gud-speedbar-buttons): ...and references to it. Use window-start
to try to keep positon in watch expression.
2006-05-03 Richard Stallman <rms@gnu.org>
* simple.el (next-history-element, previous-history-element): Doc fix.
* isearch.el (isearch-update-ring): Doc fix.
2006-05-03 Dan Nicolaescu <dann@ics.uci.edu>
* isearch.el (isearch-update-ring): Take history-delete-duplicates
into consideration. Replace one arm ifs with whens.
2006-05-03 Nick Roberts <nickrob@snap.net.nz>
* progmodes/gdb-ui.el (gud-watch): Let user select an expression.
@ -16,20 +49,17 @@
2006-05-02 Chong Yidong <cyd@mit.edu>
* msb.el (msb): If EVENT is a down event, read and discard the up
event.
* msb.el (msb): If EVENT is a down event, read and discard the up event.
2006-05-02 Reiner Steib <Reiner.Steib@gmx.de>
* startup.el (command-line-1): Refer to Lisp manual when
pure-space-overflow occurs.
* files.el (byte-compile-dynamic)
(byte-compile-dynamic-docstrings, byte-compile-warnings)
(find-file-visit-truename, indent-tabs-mode, left-margin)
(no-byte-compile no-update-autoloads, truncate-lines)
(version-control): Don't use `t' for safe-local-variable
declarations.
* files.el (byte-compile-dynamic, byte-compile-dynamic-docstrings)
(byte-compile-warnings, find-file-visit-truename, indent-tabs-mode)
(left-margin, no-byte-compile, no-update-autoloads, truncate-lines)
(version-control): Don't use `t' for safe-local-variable declarations.
2006-05-01 Richard Stallman <rms@gnu.org>
@ -63,10 +93,10 @@
Returning "/" only doesn't need to be necessary any longer.
(tramp-file-name-handler): Make special attention when in hostname
completion mode.
(tramp-completion-file-name-handler): Revert patch from 2006-04-28.
(tramp-register-file-name-handlers): Register
`tramp-completion-file-name-handler' only when
`partial-completion-mode is enabled.
(tramp-completion-file-name-handler): Revert patch from 2006-04-28.
(tramp-register-file-name-handlers):
Register `tramp-completion-file-name-handler' only when
`partial-completion-mode' is enabled.
(tramp-completion-handle-file-name-all-completions):
Delete directory part from results.
(tramp-get-completion-methods, tramp-get-completion-user-host):
@ -80,8 +110,8 @@
2006-05-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* term/mac-win.el (mac-ae-open-documents, mac-drag-n-drop): Use
select-frame-set-input-focus instead of raise-frame.
* term/mac-win.el (mac-ae-open-documents, mac-drag-n-drop):
Use select-frame-set-input-focus instead of raise-frame.
(global-map): Bind M-drag-n-drop to mac-drag-n-drop.
2006-05-01 Nick Roberts <nickrob@snap.net.nz>

View file

@ -1,3 +1,24 @@
2006-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
* mm-decode.el (mm-dissect-buffer): Remove spurious double assignment.
(mm-copy-to-buffer): Use with-current-buffer.
(mm-display-part): Simplify.
(mm-inlinable-p): Add optional arg `type'.
* gnus-art.el (gnus-mime-view-part-as-type): Add optional PRED
argument.
(gnus-mime-view-part-externally, gnus-mime-view-part-internally):
Try harder to show the attachment internally or externally using
gnus-mime-view-part-as-type.
2006-05-04 Reiner Steib <Reiner.Steib@gmx.de>
* gnus-art.el (gnus-mime-view-part-as-type-internal): Try to fetch
`filename' from Content-Disposition if Content-Type doesn't
provide `name'.
(gnus-mime-view-part-as-type): Set default instead of
initial-input.
2006-04-28 Katsumi Yamaoka <yamaoka@jpl.org>
* mm-uu.el (mm-uu-pgp-encrypted-extract-1): Assume buffer is made

View file

@ -4317,21 +4317,29 @@ Deleting parts may malfunction or destroy the article; continue? ")
(defun gnus-mime-view-part-as-type-internal ()
(gnus-article-check-buffer)
(let* ((name (mail-content-type-get
(mm-handle-type (get-text-property (point) 'gnus-data))
'name))
(let* ((handle (get-text-property (point) 'gnus-data))
(name (or
;; Content-Type: foo/bar; name=...
(mail-content-type-get (mm-handle-type handle) 'name)
;; Content-Disposition: attachment; filename=...
(cdr (assq 'filename (cdr (mm-handle-disposition handle))))))
(def-type (and name (mm-default-file-encoding name))))
(and def-type (cons def-type 0))))
(defun gnus-mime-view-part-as-type (&optional mime-type)
"Choose a MIME media type, and view the part as such."
(defun gnus-mime-view-part-as-type (&optional mime-type pred)
"Choose a MIME media type, and view the part as such.
If non-nil, PRED is a predicate to use during completion to limit the
available media-types."
(interactive)
(unless mime-type
(setq mime-type (completing-read
"View as MIME type: "
(mapcar #'list (mailcap-mime-types))
nil nil
(gnus-mime-view-part-as-type-internal))))
(setq mime-type
(let ((default (gnus-mime-view-part-as-type-internal)))
(completing-read
(format "View as MIME type (default %s): "
(car default))
(mapcar #'list (mailcap-mime-types))
pred nil nil nil
(car default)))))
(gnus-article-check-buffer)
(let ((handle (get-text-property (point) 'gnus-data)))
(when handle
@ -4511,12 +4519,18 @@ specified charset."
(mm-inlined-types nil)
(mail-parse-charset gnus-newsgroup-charset)
(mail-parse-ignored-charsets
(save-excursion (set-buffer gnus-summary-buffer)
gnus-newsgroup-ignored-charsets)))
(when handle
(if (mm-handle-undisplayer handle)
(mm-remove-part handle)
(mm-display-part handle)))))
(with-current-buffer gnus-summary-buffer
gnus-newsgroup-ignored-charsets))
(type (mm-handle-media-type handle))
(method (mailcap-mime-info type))
(mm-enable-external t))
(if (not (stringp method))
(gnus-mime-view-part-as-type
nil (lambda (type) (stringp (mailcap-mime-info type))))
(when handle
(if (mm-handle-undisplayer handle)
(mm-remove-part handle)
(mm-display-part handle))))))
(defun gnus-mime-view-part-internally (&optional handle)
"View the MIME part under point with an internal viewer.
@ -4528,13 +4542,16 @@ If no internal viewer is available, use an external viewer."
(mm-inline-large-images t)
(mail-parse-charset gnus-newsgroup-charset)
(mail-parse-ignored-charsets
(save-excursion (set-buffer gnus-summary-buffer)
gnus-newsgroup-ignored-charsets))
(with-current-buffer gnus-summary-buffer
gnus-newsgroup-ignored-charsets))
(inhibit-read-only t))
(when handle
(if (mm-handle-undisplayer handle)
(mm-remove-part handle)
(mm-display-part handle)))))
(if (not (mm-inlinable-p handle))
(gnus-mime-view-part-as-type
nil (lambda (type) (mm-inlinable-p handle type)))
(when handle
(if (mm-handle-undisplayer handle)
(mm-remove-part handle)
(mm-display-part handle))))))
(defun gnus-mime-action-on-part (&optional action)
"Do something with the MIME attachment at \(point\)."

View file

@ -562,7 +562,7 @@ Postpone undisplaying of viewers for types in
description)
(setq type (split-string (car ctl) "/"))
(setq subtype (cadr type)
type (pop type))
type (car type))
(setq
result
(cond
@ -641,16 +641,15 @@ Postpone undisplaying of viewers for types in
(defun mm-copy-to-buffer ()
"Copy the contents of the current buffer to a fresh buffer."
(save-excursion
(let ((obuf (current-buffer))
beg)
(goto-char (point-min))
(search-forward-regexp "^\n" nil t)
(setq beg (point))
(set-buffer
(with-current-buffer
;; Preserve the data's unibyteness (for url-insert-file-contents).
(let ((default-enable-multibyte-characters (mm-multibyte-p)))
(generate-new-buffer " *mm*")))
(generate-new-buffer " *mm*"))
(insert-buffer-substring obuf beg)
(current-buffer))))
@ -701,7 +700,8 @@ external if displayed external."
(forward-line 1)
(mm-insert-inline handle (mm-get-part handle))
'inline)
(if (and method ;; If nil, we always use "save".
(setq external
(and method ;; If nil, we always use "save".
(stringp method) ;; 'mailcap-save-binary-file
(or (eq mm-enable-external t)
(and (eq mm-enable-external 'ask)
@ -714,9 +714,7 @@ external if displayed external."
(concat
" \"" (format method filename) "\"")
"")
"? ")))))
(setq external t)
(setq external nil))
"? "))))))
(if external
(mm-display-external
handle (or method 'mailcap-save-binary-file))
@ -1019,10 +1017,12 @@ external if displayed external."
methods nil)))
result))
(defun mm-inlinable-p (handle)
"Say whether HANDLE can be displayed inline."
(defun mm-inlinable-p (handle &optional type)
"Say whether HANDLE can be displayed inline.
TYPE is the mime-type of the object; it defaults to the one given
in HANDLE."
(unless type (setq type (mm-handle-media-type handle)))
(let ((alist mm-inline-media-tests)
(type (mm-handle-media-type handle))
test)
(while alist
(when (string-match (caar alist) type)

View file

@ -324,13 +324,14 @@ directory, like `default-directory'."
:type '(repeat function)
:group 'ibuffer)
(eval-when-compile
(defcustom ibuffer-compressed-file-name-regexp
(concat "\\.\\("
(regexp-opt '("arj" "bgz" "bz2" "gz" "lzh" "taz" "tgz" "zip" "z"))
"\\)$")
(concat "\\.\\("
(regexp-opt '("arj" "bgz" "bz2" "gz" "lzh" "taz" "tgz" "zip" "z"))
"\\)$")
"Regexp to match compressed file names."
:type 'regexp
:group 'ibuffer)
:group 'ibuffer))
(defcustom ibuffer-hook nil
"Hook run when `ibuffer' is called."

View file

@ -830,21 +830,22 @@ NOPUSH is t and EDIT is t."
(defun isearch-update-ring (string &optional regexp)
"Add STRING to the beginning of the search ring.
REGEXP says which ring to use."
REGEXP if non-nil says use the regexp search ring."
(if regexp
(if (or (null regexp-search-ring)
(not (string= string (car regexp-search-ring))))
(progn
(push string regexp-search-ring)
(if (> (length regexp-search-ring) regexp-search-ring-max)
(setcdr (nthcdr (1- search-ring-max) regexp-search-ring)
nil))))
(if (or (null search-ring)
(not (string= string (car search-ring))))
(progn
(push string search-ring)
(if (> (length search-ring) search-ring-max)
(setcdr (nthcdr (1- search-ring-max) search-ring) nil))))))
(when (or (null regexp-search-ring)
(not (string= string (car regexp-search-ring))))
(when history-delete-duplicates
(setq regexp-search-ring (delete string regexp-search-ring)))
(push string regexp-search-ring)
(when (> (length regexp-search-ring) regexp-search-ring-max)
(setcdr (nthcdr (1- search-ring-max) regexp-search-ring) nil)))
(when (or (null search-ring)
(not (string= string (car search-ring))))
(when history-delete-duplicates
(setq search-ring (delete string search-ring)))
(push string search-ring)
(when (> (length search-ring) search-ring-max)
(setcdr (nthcdr (1- search-ring-max) search-ring) nil)))))
;; Switching buffers should first terminate isearch-mode.
;; ;; For Emacs 19, the frame switch event is handled.

View file

@ -114,8 +114,6 @@ Set to \"main\" at start if gdb-show-main is t.")
Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS FP)
where STATUS is nil (unchanged), `changed' or `out-of-scope', FP the frame
address for root variables.")
(defvar gdb-force-update t
"Non-nil means that view of watch expressions will be updated in the speedbar.")
(defvar gdb-main-file nil "Source file from which program execution begins.")
(defvar gdb-overlay-arrow-position nil)
(defvar gdb-server-prefix nil)
@ -527,7 +525,6 @@ With arg, use separate IO iff arg is positive."
gdb-current-language nil
gdb-frame-number nil
gdb-var-list nil
gdb-force-update t
gdb-main-file nil
gdb-first-post-prompt t
gdb-prompting nil
@ -1381,7 +1378,6 @@ happens to be appropriate."
;; FIXME: with GDB-6 on Darwin, this might very well work.
;; Only needed/used with speedbar/watch expressions.
(when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
(setq gdb-force-update t)
(if (string-equal gdb-version "pre-6.4")
(gdb-var-update)
(gdb-var-update-1)))))
@ -3166,7 +3162,9 @@ BUFFER nil or omitted means use the current buffer."
(if (and (match-string 3) gud-overlay-arrow-position)
(let ((buffer (marker-buffer gud-overlay-arrow-position))
(position (marker-position gud-overlay-arrow-position)))
(when (and buffer (string-equal (buffer-name buffer) (match-string 3)))
(when (and buffer
(string-equal (buffer-name buffer)
(file-name-nondirectory (match-string 3))))
(with-current-buffer buffer
(setq fringe-indicator-alist
(if (string-equal gdb-frame-number "0")

View file

@ -49,7 +49,6 @@
(defvar gdb-macro-info)
(defvar gdb-server-prefix)
(defvar gdb-show-changed-values)
(defvar gdb-force-update)
(defvar gdb-var-list)
(defvar gdb-speedbar-auto-raise)
(defvar tool-bar-map)
@ -442,37 +441,55 @@ required by the caller."
(buffer-name gud-comint-buffer))
(let* ((minor-mode (with-current-buffer buffer gud-minor-mode))
(window (get-buffer-window (current-buffer) 0))
(start (window-start window))
(p (window-point window)))
(cond
((memq minor-mode '(gdbmi gdba))
(when (or gdb-force-update
(not (save-excursion
(goto-char (point-min))
(looking-at "Watch Expressions:"))))
(erase-buffer)
(insert "Watch Expressions:\n")
(if gdb-speedbar-auto-raise
(raise-frame speedbar-frame))
(let ((var-list gdb-var-list) parent)
(while var-list
(let* (char (depth 0) (start 0) (var (car var-list))
(varnum (car var)) (expr (nth 1 var))
(type (nth 3 var)) (value (nth 4 var))
(status (nth 5 var)))
(put-text-property
0 (length expr) 'face font-lock-variable-name-face expr)
(put-text-property
0 (length type) 'face font-lock-type-face type)
(while (string-match "\\." varnum start)
(setq depth (1+ depth)
start (1+ (match-beginning 0))))
(if (eq depth 0) (setq parent nil))
(if (or (equal (nth 2 var) "0")
(and (equal (nth 2 var) "1")
(string-match "char \\*$" type)))
(erase-buffer)
(insert "Watch Expressions:\n")
(if gdb-speedbar-auto-raise
(raise-frame speedbar-frame))
(let ((var-list gdb-var-list) parent)
(while var-list
(let* (char (depth 0) (start 0) (var (car var-list))
(varnum (car var)) (expr (nth 1 var))
(type (nth 3 var)) (value (nth 4 var))
(status (nth 5 var)))
(put-text-property
0 (length expr) 'face font-lock-variable-name-face expr)
(put-text-property
0 (length type) 'face font-lock-type-face type)
(while (string-match "\\." varnum start)
(setq depth (1+ depth)
start (1+ (match-beginning 0))))
(if (eq depth 0) (setq parent nil))
(if (or (equal (nth 2 var) "0")
(and (equal (nth 2 var) "1")
(string-match "char \\*$" type)))
(speedbar-make-tag-line
'bracket ?? nil nil
(concat expr "\t" value)
(if (or parent (eq status 'out-of-scope))
nil 'gdb-edit-value)
nil
(if gdb-show-changed-values
(or parent (case status
(changed 'font-lock-warning-face)
(out-of-scope 'shadow)
(t t)))
t)
depth)
(if (eq status 'out-of-scope) (setq parent 'shadow))
(if (and (nth 1 var-list)
(string-match (concat varnum "\\.")
(car (nth 1 var-list))))
(setq char ?-)
(setq char ?+))
(if (string-match "\\*$" type)
(speedbar-make-tag-line
'bracket ?? nil nil
(concat expr "\t" value)
'bracket char
'gdb-speedbar-expand-node varnum
(concat expr "\t" type "\t" value)
(if (or parent (eq status 'out-of-scope))
nil 'gdb-edit-value)
nil
@ -483,37 +500,15 @@ required by the caller."
(t t)))
t)
depth)
(if (eq status 'out-of-scope) (setq parent 'shadow))
(if (and (nth 1 var-list)
(string-match (concat varnum "\\.")
(car (nth 1 var-list))))
(setq char ?-)
(setq char ?+))
(if (string-match "\\*$" type)
(speedbar-make-tag-line
'bracket char
'gdb-speedbar-expand-node varnum
(concat expr "\t" type "\t" value)
(if (or parent (eq status 'out-of-scope))
nil 'gdb-edit-value)
nil
(if gdb-show-changed-values
(or parent (case status
(changed 'font-lock-warning-face)
(out-of-scope 'shadow)
(t t)))
t)
depth)
(speedbar-make-tag-line
'bracket char
'gdb-speedbar-expand-node varnum
(concat expr "\t" type)
nil nil
(if (and (or parent status) gdb-show-changed-values)
'shadow t)
depth))))
(setq var-list (cdr var-list))))
(setq gdb-force-update nil)))
(speedbar-make-tag-line
'bracket char
'gdb-speedbar-expand-node varnum
(concat expr "\t" type)
nil nil
(if (and (or parent status) gdb-show-changed-values)
'shadow t)
depth))))
(setq var-list (cdr var-list)))))
(t (unless (and (save-excursion
(goto-char (point-min))
(looking-at "Current Stack:"))
@ -544,6 +539,7 @@ required by the caller."
(t (error "Should never be here")))
frame t))))
(setq gud-last-speedbar-stackframe gud-last-last-frame))))
(set-window-start window start)
(set-window-point window p))))

View file

@ -923,8 +923,9 @@ Returns new value of point in all cases."
(or arg (setq arg 1))
(if (< arg 0) (forward-char 1))
(and (/= arg 0)
(re-search-backward "^\\s(\\|^\\s-*sub\\b[^{]+{\\|^\\s-*format\\b[^=]*=\\|^\\."
nil 'move arg)
(re-search-backward
"^\\s(\\|^\\s-*sub\\b[ \t\n]*\\_<[^{]+{\\|^\\s-*format\\b[^=]*=\\|^\\."
nil 'move arg)
(goto-char (1- (match-end 0))))
(point))

View file

@ -1269,7 +1269,8 @@ makes the search case-sensitive."
(defvar minibuffer-temporary-goal-position nil)
(defun next-history-element (n)
"Insert the next element of the minibuffer history into the minibuffer."
"Puts next element of the minibuffer history in the minibuffer.
With argument N, it uses the Nth following element."
(interactive "p")
(or (zerop n)
(let ((narg (- minibuffer-history-position n))
@ -1312,7 +1313,8 @@ makes the search case-sensitive."
(goto-char (or minibuffer-temporary-goal-position (point-max))))))
(defun previous-history-element (n)
"Inserts the previous element of the minibuffer history into the minibuffer."
"Puts previous element of the minibuffer history in the minibuffer.
With argument N, it uses the Nth previous element."
(interactive "p")
(next-history-element (- n)))

View file

@ -3320,7 +3320,7 @@ See `term-prompt-regexp'."
((eq char ?r)
(term-set-scroll-region
(1- term-terminal-previous-parameter)
term-terminal-parameter))
(1- term-terminal-parameter)))
(t)))
(defun term-set-scroll-region (top bottom)

View file

@ -1,3 +1,31 @@
2006-05-03 Richard Stallman <rms@gnu.org>
* files.texi (Diff Mode): Node moved here.
(Comparing Files): Delete what duplicates new node.
(Files): Put Diff Mode in menu.
* misc.texi (Diff Mode): Moved to files.texi.
* emacs.texi (Top): Update menu for Diff Mode.
* trouble.texi (Emergency Escape): Simplify.
* emacs.texi (Top): Minor clarification.
2006-05-03 Teodor Zlatanov <tzz@lifelogs.com>
* commands.texi, entering.texi, screen.texi: Many simplifications.
2006-05-03 Richard Stallman <rms@gnu.org>
* commands.texi (Text Characters): Delete paragraph about unibyte
non-ASCII printing chars.
* killing.texi (Killing): Say "graphical displays".
* display.texi: Say "graphical displays".
* cmdargs.texi (Misc X): Say "graphical displays".
2006-05-01 Richard Stallman <rms@gnu.org>
* emacs.texi (Top): Add Diff Mode to menu.

View file

@ -1227,7 +1227,7 @@ Specify @var{pixels} as additional space to put between lines, in pixels.
@itemx --no-blinking-cursor
@opindex --no-blinking-cursor
@cindex blinking cursor disable, command-line argument
Disable the blinking cursor on graphical terminals.
Disable the blinking cursor on graphical displays.
@item -D
@opindex -D

View file

@ -6,9 +6,9 @@
@chapter Characters, Keys and Commands
This chapter explains the character sets used by Emacs for input
commands and for the contents of files, and also explains the concepts
of @dfn{keys} and @dfn{commands}, which are fundamental for understanding
how Emacs interprets your keyboard and mouse input.
commands and for the contents of files, and the fundamental concepts of
@dfn{keys} and @dfn{commands}, whereby Emacs interprets your keyboard
and mouse input.
@end iftex
@ifnottex
@ -35,11 +35,11 @@ control characters, such as @kbd{Control-a} (usually written @kbd{C-a}
for short). @kbd{C-a} gets its name from the fact that you type it by
holding down the @key{CTRL} key while pressing @kbd{a}.
Some @acronym{ASCII} control characters have special names, and most terminals
have special keys you can type them with: for example, @key{RET},
@key{TAB}, @key{DEL} and @key{ESC}. The space character is usually
referred to below as @key{SPC}, even though strictly speaking it is a
graphic character whose graphic happens to be blank.
Some @acronym{ASCII} control characters have special names, and most
terminals have special keys you can type them with: for example,
@key{RET}, @key{TAB}, @key{DEL} and @key{ESC}. The space character is
usually known as @key{SPC}, even though strictly speaking it is a
graphic character that is blank.
Emacs extends the @acronym{ASCII} character set with thousands more printing
characters (@pxref{International}), additional control characters, and a
@ -51,11 +51,11 @@ addition, the shift key is meaningless with control characters:
@kbd{C-a} and @kbd{C-A} are the same character, and Emacs cannot
distinguish them.
But the Emacs character set has room for control variants of all
printing characters, and for distinguishing between @kbd{C-a} and
@kbd{C-A}. Graphical terminals make it possible to enter all these
characters. For example, @kbd{C--} (that's Control-Minus) and
@kbd{C-5} are meaningful Emacs commands on a graphical terminal.
The Emacs character set has room for control variants of all
printing characters, and distinguishes @kbd{C-A} from @kbd{C-a}.
Graphical terminals make it possible to enter all these characters.
For example, @kbd{C--} (that's Control-Minus) and @kbd{C-5} are
meaningful Emacs commands on a graphical terminal.
Another Emacs character-set extension is additional modifier bits.
Only one modifier bit is commonly used; it is called Meta. Every
@ -106,10 +106,10 @@ two modifiers by using @kbd{C-x @@} twice for the same character,
because the first one goes to work on the @kbd{C-x}.)
Keyboard input includes keyboard keys that are not characters at
all: for example function keys and arrow keys. Mouse buttons are also
outside the gamut of characters. However, you can modify these events
with the modifier keys @key{CTRL}, @key{META}, @key{SUPER},
@key{HYPER} and @key{ALT}, just as you can modify keyboard characters.
all, such as function keys and arrow keys. Mouse buttons are also not
characters. However, you can modify these events with the modifier
keys @key{CTRL}, @key{META}, @key{SUPER}, @key{HYPER} and @key{ALT},
just like keyboard characters.
@cindex input event
Input characters and non-character inputs are collectively called
@ -121,7 +121,7 @@ some characters or non-character events, see @ref{Customization}.
@acronym{ASCII} terminals cannot really send anything to the computer except
@acronym{ASCII} characters. These terminals use a sequence of characters to
represent each function key. But that is invisible to the Emacs user,
because the keyboard input routines recognize these special sequences
because the keyboard input routines catch these special sequences
and convert them to function key events before any other part of Emacs
gets to see them.
@ -131,9 +131,9 @@ gets to see them.
@cindex key sequence
@cindex key
A @dfn{key sequence} (@dfn{key}, for short) is a sequence of input
events that are meaningful as a unit---as ``a single command.'' Some
Emacs command sequences are just one character or one event; for
example, just @kbd{C-f} is enough to move forward one character in the
events that is meaningful as a unit---a ``single command.'' Some
Emacs command sequences are invoked by just one character or one
event; for example, just @kbd{C-f} moves forward one character in the
buffer. But Emacs also has commands that take two or more events to
invoke.
@ -158,33 +158,33 @@ r}, are themselves prefix keys that lead to three-event key
sequences. There's no limit to the length of a key sequence, but in
practice people rarely use sequences longer than four events.
By contrast, you can't add more events onto a complete key. For
example, the two-event sequence @kbd{C-f C-k} is not a key, because
the @kbd{C-f} is a complete key in itself. It's impossible to give
@kbd{C-f C-k} an independent meaning as a command. @kbd{C-f C-k} is two
key sequences, not one.@refill
You can't add input events onto a complete key. For example, the
two-event sequence @kbd{C-f C-k} is not a key, because the @kbd{C-f}
is a complete key in itself. It's impossible to give @kbd{C-f C-k} an
independent meaning as a command. @kbd{C-f C-k} is two key sequences,
not one.@refill
All told, the prefix keys in Emacs are @kbd{C-c}, @kbd{C-h},
@kbd{C-x}, @kbd{C-x @key{RET}}, @kbd{C-x @@}, @kbd{C-x a}, @kbd{C-x
n}, @w{@kbd{C-x r}}, @kbd{C-x v}, @kbd{C-x 4}, @kbd{C-x 5}, @kbd{C-x
6}, @key{ESC}, @kbd{M-g}, and @kbd{M-o}. (@key{F1} and @key{F2} are
aliases for @kbd{C-h} and @kbd{C-x 6}.) But this list is not cast in
concrete; it is just a matter of Emacs's standard key bindings. If
you customize Emacs, you can make new prefix keys, or eliminate some
of the standard ones. @xref{Key Bindings}.
aliases for @kbd{C-h} and @kbd{C-x 6}.) This list is not cast in stone;
it describes the standard key bindings. If you customize Emacs, you can make
new prefix keys, or eliminate some of the standard ones (not
recommended for most users). @xref{Key Bindings}.
If you do make or eliminate prefix keys, that changes the set of
If you make or eliminate prefix keys, that changes the set of
possible key sequences. For example, if you redefine @kbd{C-f} as a
prefix, @kbd{C-f C-k} automatically becomes a key (complete, unless you
define that too as a prefix). Conversely, if you remove the prefix
definition of @kbd{C-x 4}, then @kbd{C-x 4 f} (or @kbd{C-x 4
@var{anything}}) is no longer a key.
prefix, @kbd{C-f C-k} automatically becomes a key (complete, unless
you define that too as a prefix). Conversely, if you remove the
prefix definition of @kbd{C-x 4}, then @kbd{C-x 4 f} and @kbd{C-x 4
@var{anything}} are no longer keys.
Typing the help character (@kbd{C-h} or @key{F1}) after a prefix key
displays a list of the commands starting with that prefix. There are
a few prefix keys for which @kbd{C-h} does not work---for historical
a few prefix keys after which @kbd{C-h} does not work---for historical
reasons, they define other meanings for @kbd{C-h} which are painful to
change. But @key{F1} should work for all prefix keys.
change. @key{F1} works after all prefix keys.
@node Commands, Text Characters, Keys, Top
@section Keys and Commands
@ -197,61 +197,65 @@ do. But Emacs does not assign meanings to keys directly. Instead,
Emacs assigns meanings to named @dfn{commands}, and then gives keys
their meanings by @dfn{binding} them to commands.
Every command has a name chosen by a programmer. The name is usually
made of a few English words separated by dashes; for example,
Every command has a name chosen by a programmer. The name is
usually made of a few English words separated by dashes; for example,
@code{next-line} or @code{forward-word}. A command also has a
@dfn{function definition} which is a Lisp program; this is what makes
the command do what it does. In Emacs Lisp, a command is actually a
special kind of Lisp function; one which specifies how to read arguments
for it and call it interactively. For more information on commands and
functions, see @ref{What Is a Function,, What Is a Function, elisp, The
Emacs Lisp Reference Manual}. (The definition we use in this manual is
simplified slightly.)
@dfn{function definition} which is a Lisp program; this is how the
command does its work. In Emacs Lisp, a command is a Lisp function with
special options to read arguments and for interactive use. For more
information on commands and functions, see @ref{What Is a Function,,
What Is a Function, elisp, The Emacs Lisp Reference Manual}. (The
definition here is simplified slightly.)
The bindings between keys and commands are recorded in various tables
called @dfn{keymaps}. @xref{Keymaps}.
The bindings between keys and commands are recorded in tables called
@dfn{keymaps}. @xref{Keymaps}.
When we say that ``@kbd{C-n} moves down vertically one line'' we are
glossing over a distinction that is irrelevant in ordinary use but is vital
in understanding how to customize Emacs. It is the command
@code{next-line} that is programmed to move down vertically. @kbd{C-n} has
this effect @emph{because} it is bound to that command. If you rebind
@kbd{C-n} to the command @code{forward-word} then @kbd{C-n} will move
forward by words instead. Rebinding keys is a common method of
customization.@refill
glossing over a subtle distinction that is irrelevant in ordinary use,
but vital for Emacs customization. The command @code{next-line} does
a vertical move downward. @kbd{C-n} has this effect @emph{because} it
is bound to @code{next-line}. If you rebind @kbd{C-n} to the command
@code{forward-word}, @kbd{C-n} will move forward one word instead.
Rebinding keys is an important method of customization.
In the rest of this manual, we usually ignore this distinction to
keep things simple. We will often speak of keys like @kbd{C-n} as
commands, even though strictly speaking a key is bound to some
command. To give the information needed for customization, we state
the name of the command which really does the work in parentheses
after mentioning the key that runs it. For example, we will say that
``The command @kbd{C-n} (@code{next-line}) moves point vertically
down,'' meaning that @code{next-line} is a command that moves
vertically down, and @kbd{C-n} is a key that is normally bound to it.
commands, even though strictly speaking the key is bound to a command.
Usually we state the name of the command which really does the work in
parentheses after mentioning the key that runs it. For example, we
will say that ``The command @kbd{C-n} (@code{next-line}) moves point
vertically down,'' meaning that the command @code{next-line} moves
vertically down, and the key @kbd{C-n} is normally bound to it.
While we are on the subject of information for customization only,
it's a good time to tell you about @dfn{variables}. Often the
description of a command will say, ``To change this, set the variable
@code{mumble-foo}.'' A variable is a name used to remember a value.
Most of the variables documented in this manual exist just to facilitate
customization: some command or other part of Emacs examines the variable
and behaves differently according to the value that you set. Until you
are interested in customizing, you can ignore the information about
variables. When you are ready to be interested, read the basic
information on variables, and then the information on individual
variables will make sense. @xref{Variables}.
Since we are discussing customization, we should tell you about
@dfn{variables}. Often the description of a command will say, ``To
change this, set the variable @code{mumble-foo}.'' A variable is a
name used to store a value. Most of the variables documented in this
manual are meant for customization: some command or other part of
Emacs examines the variable and behaves differently according to the
value that you set. You can ignore the information about variables
until you are interested in customizing them. Then read the basic
information on variables (@pxref{Variables}) and the information about
specific variables will make sense.
@node Text Characters, Entering Emacs, Commands, Top
@section Character Set for Text
@cindex characters (in text)
Text in Emacs buffers is a sequence of 8-bit bytes. Each byte can
hold a single @acronym{ASCII} character. Both @acronym{ASCII} control characters (octal
codes 000 through 037, and 0177) and @acronym{ASCII} printing characters (codes
040 through 0176) are allowed; however, non-@acronym{ASCII} control characters
cannot appear in a buffer. The other modifier flags used in keyboard
input, such as Meta, are not allowed in buffers either.
Text in Emacs buffers is a sequence of characters. In the simplest
case, these are @acronym{ASCII} characters, each stored in one 8-bit
byte. Both @acronym{ASCII} control characters (octal codes 000
through 037, and 0177) and @acronym{ASCII} printing characters (codes
040 through 0176) are allowed. The other modifier flags used in
keyboard input, such as Meta, are not allowed in buffers.
Non-@acronym{ASCII} printing characters can also appear in buffers,
when multibyte characters are enabled. They have character codes
starting at 256, octal 0400, and each one is represented as a sequence
of two or more bytes. @xref{International}. Single-byte characters
with codes 128 through 255 can also appear in multibyte buffers.
However, non-@acronym{ASCII} control characters cannot appear in a
buffer.
Some @acronym{ASCII} control characters serve special purposes in text, and have
special names. For example, the newline character (octal code 012) is
@ -259,16 +263,9 @@ used in the buffer to end a line, and the tab character (octal code 011)
is used for indenting to the next tab stop column (normally every 8
columns). @xref{Text Display}.
Non-@acronym{ASCII} printing characters can also appear in buffers. When
multibyte characters are enabled, you can use any of the non-@acronym{ASCII}
printing characters that Emacs supports. They have character codes
starting at 256, octal 0400, and each one is represented as a sequence
of two or more bytes. @xref{International}. Single-byte characters
with codes 128 through 255 can also appear in multibyte buffers.
If you disable multibyte characters, then you can use only one
alphabet of non-@acronym{ASCII} characters, but they all fit in one byte. They
use codes 0200 through 0377. @xref{Unibyte Mode}.
alphabet of non-@acronym{ASCII} characters, which all fit in one byte.
They use octal codes 0200 through 0377. @xref{Unibyte Mode}.
@ifnottex
@lowersections

View file

@ -1026,7 +1026,7 @@ elisp, The Emacs Lisp Reference Manual}.
@cindex cursor, blinking
You can customize the cursor's color, and whether it blinks, using
the @code{cursor} Custom group (@pxref{Easy Customization}). On
graphical terminals, the command @kbd{M-x blink-cursor-mode} enables
a graphical display, the command @kbd{M-x blink-cursor-mode} enables
or disables the blinking of the cursor. (On text terminals, the
terminal itself blinks the cursor, and Emacs has no control over it.)
You can control how the cursor appears when it blinks off by setting
@ -1050,7 +1050,7 @@ it a @code{nil} value.
@vindex x-stretch-cursor
@cindex wide block cursor
On graphical terminals, Emacs can optionally draw the block cursor
On graphical displays, Emacs can optionally draw the block cursor
as wide as the character under the cursor---for example, if the cursor
is on a tab character, it would cover the full width occupied by that
tab character. To enable this feature, set the variable

View file

@ -197,7 +197,6 @@ Advanced Features
* Sorting:: Sorting lines, paragraphs or pages within Emacs.
* Narrowing:: Restricting display and editing to a portion
of the buffer.
* Diff Mode:: Editing diff output.
* Two-Column:: Splitting apart columns to edit them
in side-by-side windows.
* Editing Binary Files::Using Hexl mode to edit binary files.
@ -373,6 +372,7 @@ File Handling
* Version Control:: Version control systems (RCS, CVS and SCCS).
* Directories:: Creating, deleting, and listing file directories.
* Comparing Files:: Finding where two files differ.
* Diff Mode:: Editing diff output.
* Misc File Ops:: Other things you can do on files.
* Compressed Files:: Accessing compressed files.
* File Archives:: Operating on tar, zip, jar etc. archive files.
@ -873,7 +873,7 @@ programmer, but if you are not interested in customizing, you can
ignore the customization hints.
This is primarily a reference manual, but can also be used as a
primer. If you are a complete beginner, we recommend you start with
primer. If you are new to Emacs, we recommend you start with
the on-line, learn-by-doing tutorial, before reading the manual. To
run the tutorial, start Emacs and type @kbd{C-h t}. The tutorial
describes commands, tells you when to try them, and explains the

View file

@ -8,58 +8,54 @@
@cindex starting Emacs
The usual way to invoke Emacs is with the shell command
@command{emacs}. Emacs clears the screen and then displays an initial
help message and copyright notice. Some operating systems discard all
type-ahead when Emacs starts up; they give Emacs no way to prevent
this. If you ever use those systems, learn the habit of waiting for
Emacs to clear the screen before typing your first editing command.
@command{emacs}. Emacs clears the screen, then displays an initial
help message and copyright notice. Some operating systems discard
your type-ahead when Emacs starts up; they give Emacs no way to
prevent this. On those systems, wait for Emacs to clear the screen
before you start typing.
If you run Emacs from a shell window under the X Window System, run it
in the background with @command{emacs&}. This way, Emacs does not tie up
the shell window, so you can use that to run other shell commands while
Emacs operates its own X windows. You can begin typing Emacs commands
as soon as you direct your keyboard input to the Emacs frame.
From a shell window under the X Window System, run Emacs in the
background with @command{emacs&}. This way, Emacs won't tie up the
shell window, so you can use it to run other shell commands while
Emacs is running. You can type Emacs commands as soon as you direct
your keyboard input to an Emacs frame.
@vindex initial-major-mode
When Emacs starts up, it creates a buffer named @samp{*scratch*}.
That's the buffer you start out in. The @samp{*scratch*} buffer uses
Lisp Interaction mode; you can use it to type Lisp expressions and
evaluate them, or you can ignore that capability and just write notes
in it. (You can specify a different major mode for this buffer by
evaluate them. You can also ignore that capability and just write notes
there. You can specify a different major mode for this buffer by
setting the variable @code{initial-major-mode} in your init file.
@xref{Init File}.)
@xref{Init File}.
It is possible to specify files to be visited, Lisp files to be
loaded, and functions to be called, by giving Emacs arguments in the
shell command line. @xref{Emacs Invocation}. But we don't recommend
doing this. The feature exists mainly for compatibility with other
editors.
loaded, and functions to be called through Emacs command-line
arguments. @xref{Emacs Invocation}. The feature exists mainly for
compatibility with other editors, and for scripts.
Many other editors are designed to be started afresh each time you
want to edit. You edit one file and then exit the editor. The next
time you want to edit either another file or the same one, you must run
the editor again. With these editors, it makes sense to use a
command-line argument to say which file to edit.
Many editors are designed to edit one file. When done with that
file, you exit the editor. The next time you want to edit a file, you
must start the editor again. Working this way, it is convenient to
use a command-line argument to say which file to edit.
But starting a new Emacs each time you want to edit a different file
does not make sense. This would fail to take advantage of Emacs's
ability to visit more than one file in a single editing session, and
it would lose the other accumulated context, such as the kill ring,
registers, undo history, and mark ring, that are useful for operating
on multiple files or even one.
It's not smart to start Emacs afresh for every file you edit. Emacs
can visit more than one file in a single editing session, and upon
exit Emacs loses valuable accumulated context, such as the kill ring,
registers, undo history, and mark ring. These features are useful for
operating on multiple files, or even one. If you kill Emacs after
each file, you don't take advantage of them.
The recommended way to use GNU Emacs is to start it only once, just
after you log in, and do all your editing in the same Emacs session.
Each time you want to edit a different file, you visit it with the
existing Emacs, which eventually comes to have many files in it ready
for editing. Usually you do not kill the Emacs until you are about to
log out. @xref{Files}, for more information on visiting more than one
file.
Each time you edit a file, you visit it with the existing Emacs, which
eventually has many files in it ready for editing. Usually you do not
kill Emacs until you are about to log out. @xref{Files}, for more
information on visiting more than one file.
If you want to edit a file from another program and already have
Emacs running, you can use the @command{emacsclient} program to open a
file in the already running Emacs. @xref{Emacs Server}, for more
information on editing files with Emacs from other programs.
To edit a file from another program while Emacs is running, you can
use the @command{emacsclient} helper program to open a file in the
already running Emacs. @xref{Emacs Server}.
@ifnottex
@raisesections
@ -73,9 +69,9 @@ information on editing files with Emacs from other programs.
@cindex leaving Emacs
@cindex quitting Emacs
There are two commands for exiting Emacs because there are three
kinds of exiting: @dfn{suspending} Emacs, @dfn{Iconifying} Emacs, and
@dfn{killing} Emacs.
There are two commands for exiting Emacs, and three kinds of exiting:
@dfn{suspending} Emacs, @dfn{Iconifying} Emacs, and @dfn{killing}
Emacs.
@dfn{Suspending} means stopping Emacs temporarily and returning
control to its parent process (usually a shell), allowing you to resume
@ -110,11 +106,11 @@ it iconifies the Emacs frame.
Emacs. You can resume Emacs with the shell command @command{%emacs}
in most common shells. On systems that don't support suspending
programs, @kbd{C-z} starts an inferior shell that communicates
directly with the terminal, and Emacs waits until you exit the subshell.
(The way to do that is probably with @kbd{C-d} or @command{exit}, but
it depends on which shell you use.) The only way on these systems to
get back to the shell from which Emacs was run (to log out, for
example) is to kill Emacs.
directly with the terminal, and Emacs waits until you exit the
subshell. (The way to do that is probably with @kbd{C-d} or
@command{exit}, but it depends on which shell you use.) On these
systems, you can only get back to the shell from which Emacs was run
(to log out, for example) when you kill Emacs.
Suspending can fail if you run Emacs under a shell that doesn't
support suspending programs, even if the system itself does support
@ -133,13 +129,13 @@ a shell window.
@kindex C-x C-c
@findex save-buffers-kill-emacs
To exit and kill Emacs, type @kbd{C-x C-c}
(@code{save-buffers-kill-emacs}). A two-character key is used for
this to make it harder to type by accident. This command first offers
to save any modified file-visiting buffers. If you do not save them
all, it asks for reconfirmation with @kbd{yes} before killing Emacs,
since any changes not saved will be lost forever. Also, if any
subprocesses are still running, @kbd{C-x C-c} asks for confirmation
about them, since killing Emacs will also kill the subprocesses.
(@code{save-buffers-kill-emacs}). A two-character key is used to make
it harder to type by accident. This command first offers to save any
modified file-visiting buffers. If you do not save them all, it asks
for confirmation with @kbd{yes} before killing Emacs, since any
changes not saved now will be lost forever. Also, if any subprocesses are
still running, @kbd{C-x C-c} asks for confirmation about them, since
killing Emacs will also kill the subprocesses.
@vindex confirm-kill-emacs
If the value of the variable @code{confirm-kill-emacs} is
@ -150,11 +146,10 @@ function to use as the value of @code{confirm-kill-emacs} is the
function @code{yes-or-no-p}. The default value of
@code{confirm-kill-emacs} is @code{nil}.
There is no way to resume an Emacs session once you have killed it.
You can, however, arrange for Emacs to record certain session
information when you kill it, such as which files are visited, so that
the next time you start Emacs it will try to visit the same files and
so on. @xref{Saving Emacs Sessions}.
You can't resume an Emacs session after killing it. Emacs can,
however, record certain session information when you kill it, such as
which files you visited, so the next time you start Emacs it will try
to visit the same files. @xref{Saving Emacs Sessions}.
The operating system usually listens for certain special characters
whose meaning is to kill or suspend the program you are running.

View file

@ -30,6 +30,7 @@ on file directories.
* Version Control:: Version control systems (RCS, CVS and SCCS).
* Directories:: Creating, deleting, and listing file directories.
* Comparing Files:: Finding where two files differ.
* Diff Mode:: Mode for editing file differences.
* Misc File Ops:: Other things you can do on files.
* Compressed Files:: Accessing compressed files.
* File Archives:: Operating on tar, zip, jar etc. archive files.
@ -2159,6 +2160,8 @@ differences in an Emacs buffer named @samp{*diff*}. It works by
running the @code{diff} program, using options taken from the variable
@code{diff-switches}. The value of @code{diff-switches} should be a
string; the default is @code{"-c"} to specify a context diff.
@xref{Top,, Diff, diff, Comparing and Merging Files}, for more
information about @command{diff} output formats.
@findex diff-backup
The command @kbd{M-x diff-backup} compares a specified file with its most
@ -2166,20 +2169,6 @@ recent backup. If you specify the name of a backup file,
@code{diff-backup} compares it with the source file that it is a backup
of.
@findex diff-goto-source
@findex diff-mode
@cindex Diff mode
The @samp{*diff*} buffer uses Diff mode, which enables you to use
@kbd{C-x `} to visit successive changed locations in the two source
files, as in Compilation mode (@pxref{Compilation Mode}.) You can
also move to a particular hunk of changes and type @kbd{C-c C-c}
(@code{diff-goto-source}) to visit the corresponding source location.
@cindex patches
Differences between versions of files are often distributed as
patches, which are the output from the @command{diff} program. You
can use Diff mode to operate on a patch by typing @kbd{M-x diff-mode}.
@findex compare-windows
The command @kbd{M-x compare-windows} compares the text in the
current window with that in the next window. (For more information
@ -2219,6 +2208,86 @@ changes.
@inforef{Emerge,, emacs-xtra} for the Emerge facility, which
provides a powerful interface for merging files.
@node Diff Mode
@section Diff Mode
@cindex Diff mode
@findex diff-mode
@cindex patches, editing
The @samp{*diff*} buffer uses Diff mode (@pxref{Diff Mode}). Diff
mode is also useful for editing patches and comparisons produced by
the @command{diff} program. To select Diff mode manually, type
@kbd{M-x diff-mode}.
One general feature of Diff mode is that manual edits to the patch
automatically correct line numbers, including those in the hunk
header, so that you can actually apply the edited patch. Diff mode
also provides the following commands to navigate, manipulate and apply
parts of patches:
@table @kbd
@item M-n
Move to the next hunk-start (@code{diff-hunk-next}).
@item M-p
Move to the previous hunk-start (@code{diff-hunk-prev}).
@item M-@}
Move to the next file-start, in a multi-file patch
(@code{diff-file-next}).
@item M-@{
Move to the previous file-start, in a multi-file patch
(@code{diff-file-prev}).
@item M-k
Kill the hunk at point (@code{diff-hunk-kill}).
@item M-K
In a multi-file patch, kill the current file part.
(@code{diff-file-kill}).
@item C-c C-a
Apply this hunk to its target file (@code{diff-apply-hunk}). With a
prefix argument of @kbd{C-u}, revert this hunk.
@item C-c C-c
Go to the source corresponding to this hunk (@code{diff-goto-source}).
@item C-c C-e
Start an Ediff session with the patch (@code{diff-ediff-patch}).
@xref{Top, Ediff, Ediff, ediff, The Ediff Manual}.
@item C-c C-n
Restrict the view to the current hunk (@code{diff-restrict-view}).
@xref{Narrowing}. With a prefix argument of @kbd{C-u}, restrict the
view to the current patch of a multiple file patch. To widen again,
use @kbd{C-x n w}.
@item C-c C-r
Reverse the direction of comparison for the entire buffer
(@code{diff-reverse-direction}).
@item C-c C-s
Split the hunk at point (@code{diff-split-hunk}). This is for
manually editing patches, and only works with the unified diff format.
@item C-c C-u
Convert the entire buffer to unified format
(@code{diff-context->unified}). With a prefix argument, convert
unified format to context format. In Transient Mark mode, when the
mark is active, this command operates only on the region.
@item C-c C-w
Refine the current hunk so that it disregards changes in whitespace
(@code{diff-refine-hunk}).
@end table
@kbd{C-x 4 a} in Diff mode operates on behalf of the target file,
but gets the function name from the patch itself. @xref{Change Log}.
This is useful for making log entries for functions that are deleted
by the patch.
@node Misc File Ops
@section Miscellaneous File Operations

View file

@ -62,7 +62,7 @@ message in the echo area to explain why the text has not been erased.
* Killing by Lines:: How to kill entire lines of text at one time.
* Other Kill Commands:: Commands to kill large regions of text and
syntactic units such as words and sentences.
* Graphical Kill:: The kill ring on graphical terminals:
* Graphical Kill:: The kill ring on graphical displays:
yanking between applications.
@end menu

View file

@ -1761,7 +1761,7 @@ rectangle moves along with the text inside the rectangle.
Many of the sort commands ignore case differences when comparing, if
@code{sort-fold-case} is non-@code{nil}.
@node Narrowing, Diff Mode, Sorting, Top
@node Narrowing, Two-Column, Sorting, Top
@section Narrowing
@cindex widening
@cindex restriction
@ -1827,86 +1827,7 @@ this command asks for confirmation and gives you the option of enabling it;
if you enable the command, confirmation will no longer be required for
it. @xref{Disabling}.
@node Diff Mode, Two-Column, Narrowing, Top
@section Diff Mode
@cindex Diff mode
Diff mode is useful for editing patches and comparisons produced by
the @command{diff} program. You can select Diff mode by typing
@kbd{M-x diff-mode}; Emacs commands that compare files automatically
select Diff mode. @xref{Top,, Diff, diff, Comparing and Merging Files},
for more information about @command{diff} output formats.
One general feature of Diff mode is that manual edits to the patch
automatically correct line numbers, including those in the hunk
header, so that you can actually apply the edited patch. Diff mode
also provides the following commands to navigate, manipulate and apply
parts of patches:
@table @kbd
@item M-n
Move to the next hunk-start (@code{diff-hunk-next}).
@item M-p
Move to the previous hunk-start (@code{diff-hunk-prev}).
@item M-@}
Move to the next file-start, in a multi-file patch
(@code{diff-file-next}).
@item M-@{
Move to the previous file-start, in a multi-file patch
(@code{diff-file-prev}).
@item M-k
Kill the hunk at point (@code{diff-hunk-kill}).
@item M-K
In a multi-file patch, kill the current file part.
(@code{diff-file-kill}).
@item C-c C-a
Apply this hunk to its target file (@code{diff-apply-hunk}). With a
prefix argument of @kbd{C-u}, revert this hunk.
@item C-c C-c
Go to the source corresponding to this hunk (@code{diff-goto-source}).
@item C-c C-e
Start an Ediff session with the patch (@code{diff-ediff-patch}).
@xref{Top, Ediff, Ediff, ediff, The Ediff Manual}.
@item C-c C-n
Restrict the view to the current hunk (@code{diff-restrict-view}).
@xref{Narrowing}. With a prefix argument of @kbd{C-u}, restrict the
view to the current patch of a multiple file patch. To widen again,
use @kbd{C-x n w}.
@item C-c C-r
Reverse the direction of comparison for the entire buffer
(@code{diff-reverse-direction}).
@item C-c C-s
Split the hunk at point (@code{diff-split-hunk}). This is for
manually editing patches, and only works with the unified diff format.
@item C-c C-u
Convert the entire buffer to unified format
(@code{diff-context->unified}). With a prefix argument, convert
unified format to context format. In Transient Mark mode, when the
mark is active, this command operates only on the region.
@item C-c C-w
Refine the current hunk so that it disregards changes in whitespace
(@code{diff-refine-hunk}).
@end table
@kbd{C-x 4 a} in Diff mode operates on behalf of the target file,
but gets the function name from the patch itself. @xref{Change Log}.
This is useful for making log entries for functions that are deleted
by the patch.
@node Two-Column, Editing Binary Files, Diff Mode, Top
@node Two-Column, Editing Binary Files, Narrowing, Top
@section Two-Column Editing
@cindex two-column editing
@cindex splitting columns

View file

@ -24,8 +24,8 @@ be a @dfn{tool bar}, a row of icons that perform editing commands if
you click on them. Below this, the window begins, often with a
@dfn{scroll bar} on one side. Below the window comes the last line of
the frame, a special @dfn{echo area} or @dfn{minibuffer window}, where
prompts appear and where you enter information when Emacs asks for it.
See following sections for more information about these special lines.
prompts appear and you enter information when Emacs asks for it. See
following sections for more information about these special lines.
You can subdivide the window horizontally or vertically to make
multiple text windows, each of which can independently display some
@ -34,22 +34,22 @@ refers to the initial large window if not subdivided, or any one of
the multiple windows you have subdivided it into.
At any time, one window is the @dfn{selected window}. On graphical
terminals, the selected window normally shows a more prominent cursor
displays, the selected window normally shows a more prominent cursor
(usually solid and blinking) while other windows show a weaker cursor
(such as a hollow box). On text terminals, which have just one
cursor, that cursor always appears in the selected window.
(such as a hollow box). Text terminals have just one cursor, so it
always appears in the selected window.
Most Emacs commands implicitly apply to the text in the selected
window (though mouse commands generally operate on whatever window you
click them in, whether selected or not). The text in other windows is
mostly visible for reference, unless/until you select them. If you
use multiple frames on a graphical display, then giving the input
focus to a particular frame selects a window in that frame.
window; the text in unselected windows is mostly visible for
reference. However, mouse commands generally operate on whatever
window you click them in, whether selected or not. If you use
multiple frames on a graphical display, then giving the input focus to
a particular frame selects a window in that frame.
Each window's last line is a @dfn{mode line}, which describes what
is going on in that window. It appears in different color and/or a
``3D'' box, if the terminal supports that; its contents normally begin
with @w{@samp{--:-- @ *scratch*}} when Emacs starts. The mode line
is going on in that window. It appears in different color and/or a ``3D''
box if the terminal supports them; its contents normally begin with
@w{@samp{--:-- @ *scratch*}} when Emacs starts. The mode line
displays status information such as what buffer is being displayed
above it in the window, what major and minor modes are in use, and
whether the buffer contains unsaved changes.
@ -89,18 +89,17 @@ each buffer has its own point location. A buffer that is not
currently displayed remembers its point location in case you display
it again later. When Emacs displays multiple windows, each window has
its own point location. If the same buffer appears in more than one
window, each window has its own position for point in that buffer, and
(when possible) its own cursor.
window, each window has its own point position in that buffer, and (when
possible) its own cursor.
A text-only terminal has just one cursor, so Emacs puts it
in the selected window. The other windows do not show a cursor, even
though they do have a location of point. When Emacs updates the
screen on a text-only terminal, it has to put the cursor temporarily
at the place the output goes. This doesn't mean point is there,
though. Once display updating finishes, Emacs puts the cursor where
point is.
A text-only terminal has just one cursor, in the selected window.
The other windows do not show a cursor, even though they do have their
own position of point. When Emacs updates the screen on a text-only
terminal, it has to put the cursor temporarily at the place the output
goes. This doesn't mean point is there, though. Once display
updating finishes, Emacs puts the cursor where point is.
On graphical terminals, Emacs shows a cursor in each window; the
On graphical displays, Emacs shows a cursor in each window; the
selected window's cursor is solid and blinking, and the other cursors
are just hollow. Thus, the most prominent cursor always shows you the
selected window, on all kinds of terminals.
@ -165,18 +164,19 @@ that appears briefly on the screen, you can switch to the
are often collapsed into one in that buffer.)
@vindex message-log-max
The size of @samp{*Messages*} is limited to a certain number of lines.
The variable @code{message-log-max} specifies how many lines. Once the
buffer has that many lines, each line added at the end deletes one line
from the beginning. @xref{Variables}, for how to set variables such as
@code{message-log-max}.
The size of @samp{*Messages*} is limited to a certain number of
lines. The variable @code{message-log-max} specifies how many lines.
Once the buffer has that many lines, adding lines at the end deletes lines
from the beginning, to keep the size constant. @xref{Variables}, for
how to set variables such as @code{message-log-max}.
The echo area is also used to display the @dfn{minibuffer}, a window that
is used for reading arguments to commands, such as the name of a file to be
edited. When the minibuffer is in use, the echo area begins with a prompt
string that usually ends with a colon; also, the cursor appears in that line
because it is the selected window. You can always get out of the
minibuffer by typing @kbd{C-g}. @xref{Minibuffer}.
The echo area is also used to display the @dfn{minibuffer}, a window
where you can input arguments to commands, such as the name of a file
to be edited. When the minibuffer is in use, the echo area begins
with a prompt string that usually ends with a colon; also, the cursor
appears in that line because it is the selected window. You can
always get out of the minibuffer by typing @kbd{C-g}.
@xref{Minibuffer}.
@node Mode Line
@section The Mode Line
@ -188,11 +188,11 @@ minibuffer by typing @kbd{C-g}. @xref{Minibuffer}.
what is going on in that window. The mode line starts and ends with
dashes. When there is only one text window, the mode line appears
right above the echo area; it is the next-to-last line in the frame.
On a text-mode display, the mode line is in inverse video if the
On a text-only terminal, the mode line is in inverse video if the
terminal supports that; on a graphics display, the mode line has a 3D
box appearance to help it stand out. The mode line of the selected
window has a slightly different appearance than those of other
windows; see @ref{Optional Mode Line}, for more about this.
window is highlighted if possible; see @ref{Optional Mode Line}, for
more information.
Normally, the mode line looks like this:
@ -201,26 +201,26 @@ windows; see @ref{Optional Mode Line}, for more about this.
@end example
@noindent
This gives information about the buffer being displayed in the window: the
buffer's name, what major and minor modes are in use, whether the buffer's
text has been changed, and how far down the buffer you are currently
looking.
This gives information about the window and the buffer it displays: the
buffer's name, what major and minor modes are in use, whether the
buffer's text has been changed, and how far down the buffer you are
currently looking.
@var{ch} contains two stars @samp{**} if the text in the buffer has
been edited (the buffer is ``modified''), or @samp{--} if the buffer has
not been edited. For a read-only buffer, it is @samp{%*} if the buffer
is modified, and @samp{%%} otherwise.
@var{fr} appears only on text-only terminals, to show the selected
frame name. @xref{Frames}. The initial frame's name is @samp{F1}.
@var{fr} gives the selected frame name (@pxref{Frames}). It appears
only on text-only terminals. The initial frame's name is @samp{F1}.
@var{buf} is the name of the window's @dfn{buffer}. In most cases
this is the same as the name of a file you are editing. @xref{Buffers}.
@var{buf} is the name of the window's @dfn{buffer}. Usually this is
the same as the name of a file you are editing. @xref{Buffers}.
The buffer displayed in the selected window (the window that the
cursor is in) is the @dfn{current buffer}--the one that editing takes
place in. When we speak of what some command does to ``the buffer,''
we mean it does those things to the current buffer.
The buffer displayed in the selected window (the window with the
cursor) is the @dfn{current buffer}, where editing happens. When a
command's effect applies to ``the buffer,'' we mean it does those
things to the current buffer.
@var{pos} tells you whether there is additional text above the top of
the window, or below the bottom. If your buffer is small and it is all
@ -232,17 +232,17 @@ With Size Indication mode, you can display the size of the buffer as
well. @xref{Optional Mode Line}.
@var{line} is @samp{L} followed by the current line number of point.
This is present when Line Number mode is enabled (which it normally is).
You can optionally display the current column number too, by turning on
Column Number mode (which is not enabled by default because it is
somewhat slower). @xref{Optional Mode Line}.
This is present when Line Number mode is enabled (it normally is).
You can display the current column number too, by turning on Column
Number mode. It is not enabled by default because it is somewhat
slower. @xref{Optional Mode Line}.
@var{major} is the name of the @dfn{major mode} in effect in the
buffer. At any time, each buffer is in one and only one of the possible
major modes. The major modes available include Fundamental mode (the
least specialized), Text mode, Lisp mode, C mode, Texinfo mode, and many
others. @xref{Major Modes}, for details of how the modes differ and how
to select one.@refill
buffer. A buffer can only be in one major mode at a time. The major
modes available include Fundamental mode (the least specialized), Text
mode, Lisp mode, C mode, Texinfo mode, and many others. @xref{Major
Modes}, for details of how the modes differ and how to select
them.
Some major modes display additional information after the major mode
name. For example, Rmail buffers display the current message number and
@ -253,14 +253,15 @@ display the status of the subprocess.
turned on at the moment in the window's chosen buffer. For example,
@samp{Fill} means that Auto Fill mode is on. @samp{Abbrev} means that
Word Abbrev mode is on. @samp{Ovwrt} means that Overwrite mode is on.
@xref{Minor Modes}, for more information. @samp{Narrow} means that
the buffer being displayed has editing restricted to only a portion of
its text. (This is not really a minor mode, but is like one.)
@xref{Narrowing}. @samp{Def} means that a keyboard macro is being
defined. @xref{Keyboard Macros}.
@xref{Minor Modes}, for more information.
In addition, if Emacs is currently inside a recursive editing level,
square brackets (@samp{[@dots{}]}) appear around the parentheses that
@samp{Narrow} means that the buffer being displayed has editing
restricted to only a portion of its text. (This is not really a minor
mode, but is like one.) @xref{Narrowing}. @samp{Def} means that a
keyboard macro is being defined. @xref{Keyboard Macros}.
In addition, if Emacs is inside a recursive editing level, square
brackets (@samp{[@dots{}]}) appear around the parentheses that
surround the modes. If Emacs is in one recursive editing level within
another, double square brackets appear, and so on. Since recursive
editing levels affect Emacs globally, not just one buffer, the square
@ -288,22 +289,21 @@ identifies the input method. (Some input methods show @samp{+} or
all. @xref{Enabling Multibyte}.
@cindex end-of-line conversion, mode-line indication
The colon after @var{cs} can change to another string in certain
circumstances. Emacs uses newline characters to separate lines in the buffer.
Some files use different conventions for separating lines: either
carriage-return linefeed (the MS-DOS convention) or just carriage-return
(the Macintosh convention). If the buffer's file uses carriage-return
linefeed, the colon changes to either a backslash (@samp{\}) or
@samp{(DOS)}, depending on the operating system. If the file uses just
carriage-return, the colon indicator changes to either a forward slash
(@samp{/}) or @samp{(Mac)}. On some systems, Emacs displays
@samp{(Unix)} instead of the colon even for files that use newline to
separate lines.
The colon after @var{cs} changes to another string in some cases.
Emacs uses newline characters to separate lines in the buffer. Some
files use different conventions for separating lines: either
carriage-return linefeed (the MS-DOS convention) or just
carriage-return (the Macintosh convention). If the buffer's file uses
carriage-return linefeed, the colon changes to either a backslash
(@samp{\}) or @samp{(DOS)}, depending on the operating system. If the
file uses just carriage-return, the colon indicator changes to either
a forward slash (@samp{/}) or @samp{(Mac)}. On some systems, Emacs
displays @samp{(Unix)} instead of the colon for files that use newline
as the line separator.
@xref{Optional Mode Line}, for features that add other handy
information to the mode line, such as the size of the buffer, the
current column number of point, and whether new mail for you has
arrived.
@xref{Optional Mode Line}, to add other handy information to the
mode line, such as the size of the buffer, the current column number
of point, and whether new mail for you has arrived.
The mode line is mouse-sensitive; when you move the mouse across
various parts of it, Emacs displays help text to say what a click in
@ -314,17 +314,17 @@ that place will do. @xref{Mode Line Mouse}.
@cindex menu bar
Each Emacs frame normally has a @dfn{menu bar} at the top which you
can use to perform certain common operations. There's no need to list
them here, as you can more easily see for yourself.
can use to perform common operations. There's no need to list them
here, as you can more easily see them yourself.
@kindex M-`
@kindex F10
@findex tmm-menubar
On a graphical terminal, you can use the mouse to choose a command
from the menu bar. An arrow pointing right, after the menu item,
indicates that the item leads to a subsidiary menu; @samp{...} at the
end means that the command will read arguments (further input from
you) before it actually does anything.
On a graphical display, you can use the mouse to choose a command
from the menu bar. A right-arrow at the end of the menu item means it
leads to a subsidiary menu; @samp{...} at the end means that the
command invoked will read arguments (further input from you) before it
actually does anything.
To view the full command name and documentation for a menu item, type
@kbd{C-h k}, and then select the menu bar with the mouse in the usual
@ -332,11 +332,10 @@ way (@pxref{Key Help}).
On text-only terminals with no mouse, you can use the menu bar by
typing @kbd{M-`} or @key{F10} (these run the command
@code{tmm-menubar}). This command enters a mode in which you can select
a menu item from the keyboard. A provisional choice appears in the echo
area. You can use the up and down arrow keys to move through the
menu to different choices. When you have found the choice you want,
type @key{RET} to select it.
@code{tmm-menubar}). This lets you select a menu item with the
keyboard. A provisional choice appears in the echo area. You can use
the up and down arrow keys to move through the menu to different
items, and then you can type @key{RET} to select the item.
Each menu item also has an assigned letter or digit which designates
that item; it is usually the initial of some word in the item's name.
@ -344,8 +343,7 @@ This letter or digit is separated from the item name by @samp{=>}. You
can type the item's letter or digit to select the item.
Some of the commands in the menu bar have ordinary key bindings as
well; if so, the menu lists one equivalent key binding in parentheses
after the item itself.
well; one such binding is shown in parentheses after the item itself.
@ignore
arch-tag: 104ba40e-d972-4866-a542-a98be94bdf2f

View file

@ -381,9 +381,9 @@ subsequent @kbd{C-g} invokes emergency escape again.
answer @kbd{n} to both questions, and you will get back to the former
state. The quit you requested will happen by and by.
Emergency escape is active only for text terminals. On a graphical
display that supports multiple windows, you can use the window manager
to kill Emacs, or to switch to some other program.
Emergency escape is active only for text terminals. On graphical
displays, you can use the mouse to kill Emacs or switch to another
program.
On MS-DOS, you must type @kbd{C-@key{BREAK}} (twice) to cause
emergency escape---but there are cases where it won't work, when

View file

@ -1,3 +1,12 @@
2006-05-03 Richard Stallman <rms@gnu.org>
* sound.c (Fplay_sound_internal): Dynamically allocate
current_sound_device and current_sound.
(sound_cleanup): Free them.
* minibuf.c (read_minibuf): Don't use read_minibuf_noninteractive
when inside a keyboard macro.
2006-05-02 Andreas Schwab <schwab@suse.de>
* xmenu.c (restore_menu_items): Return a value.

View file

@ -523,7 +523,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
build_string ("Command attempted to use minibuffer while in minibuffer"));
}
if (noninteractive)
if (noninteractive && NILP (Vexecuting_kbd_macro))
{
val = read_minibuf_noninteractive (map, initial, prompt,
make_number (pos),

View file

@ -452,13 +452,12 @@ static Lisp_Object
sound_cleanup (arg)
Lisp_Object arg;
{
if (current_sound_device)
{
if (current_sound_device->close)
current_sound_device->close (current_sound_device);
if (current_sound->fd > 0)
emacs_close (current_sound->fd);
}
if (current_sound_device->close)
current_sound_device->close (current_sound_device);
if (current_sound->fd > 0)
emacs_close (current_sound->fd);
free (current_sound_device);
free (current_sound);
return Qnil;
}
@ -991,8 +990,6 @@ Internal use only, use `play-sound' instead.\n */)
#ifndef WINDOWSNT
Lisp_Object file;
struct gcpro gcpro1, gcpro2;
struct sound_device sd;
struct sound s;
Lisp_Object args[2];
#else /* WINDOWSNT */
int len = 0;
@ -1010,48 +1007,50 @@ Internal use only, use `play-sound' instead.\n */)
#ifndef WINDOWSNT
file = Qnil;
GCPRO2 (sound, file);
bzero (&sd, sizeof sd);
bzero (&s, sizeof s);
current_sound_device = &sd;
current_sound = &s;
current_sound_device = (struct sound_device *) xmalloc (sizeof (struct sound_device));
bzero (current_sound_device, sizeof (struct sound_device));
current_sound = (struct sound *) xmalloc (sizeof (struct sound));
bzero (current_sound, sizeof (struct sound));
record_unwind_protect (sound_cleanup, Qnil);
s.header = (char *) alloca (MAX_SOUND_HEADER_BYTES);
current_sound->header = (char *) alloca (MAX_SOUND_HEADER_BYTES);
if (STRINGP (attrs[SOUND_FILE]))
{
/* Open the sound file. */
s.fd = openp (Fcons (Vdata_directory, Qnil),
attrs[SOUND_FILE], Qnil, &file, Qnil);
if (s.fd < 0)
current_sound->fd = openp (Fcons (Vdata_directory, Qnil),
attrs[SOUND_FILE], Qnil, &file, Qnil);
if (current_sound->fd < 0)
sound_perror ("Could not open sound file");
/* Read the first bytes from the file. */
s.header_size = emacs_read (s.fd, s.header, MAX_SOUND_HEADER_BYTES);
if (s.header_size < 0)
current_sound->header_size
= emacs_read (current_sound->fd, current_sound->header,
MAX_SOUND_HEADER_BYTES);
if (current_sound->header_size < 0)
sound_perror ("Invalid sound file header");
}
else
{
s.data = attrs[SOUND_DATA];
s.header_size = min (MAX_SOUND_HEADER_BYTES, SBYTES (s.data));
bcopy (SDATA (s.data), s.header, s.header_size);
current_sound->data = attrs[SOUND_DATA];
current_sound->header_size = min (MAX_SOUND_HEADER_BYTES, SBYTES (current_sound->data));
bcopy (SDATA (current_sound->data), current_sound->header, current_sound->header_size);
}
/* Find out the type of sound. Give up if we can't tell. */
find_sound_type (&s);
find_sound_type (current_sound);
/* Set up a device. */
if (STRINGP (attrs[SOUND_DEVICE]))
{
int len = SCHARS (attrs[SOUND_DEVICE]);
sd.file = (char *) alloca (len + 1);
strcpy (sd.file, SDATA (attrs[SOUND_DEVICE]));
current_sound_device->file = (char *) alloca (len + 1);
strcpy (current_sound_device->file, SDATA (attrs[SOUND_DEVICE]));
}
if (INTEGERP (attrs[SOUND_VOLUME]))
sd.volume = XFASTINT (attrs[SOUND_VOLUME]);
current_sound_device->volume = XFASTINT (attrs[SOUND_VOLUME]);
else if (FLOATP (attrs[SOUND_VOLUME]))
sd.volume = XFLOAT_DATA (attrs[SOUND_VOLUME]) * 100;
current_sound_device->volume = XFLOAT_DATA (attrs[SOUND_VOLUME]) * 100;
args[0] = Qplay_sound_functions;
args[1] = sound;
@ -1060,27 +1059,15 @@ Internal use only, use `play-sound' instead.\n */)
/* There is only one type of device we currently support, the VOX
sound driver. Set up the device interface functions for that
device. */
vox_init (&sd);
vox_init (current_sound_device);
/* Open the device. */
sd.open (&sd);
current_sound_device->open (current_sound_device);
/* Play the sound. */
s.play (&s, &sd);
/* Close the input file, if any. */
if (!STRINGP (s.data))
{
emacs_close (s.fd);
s.fd = -1;
}
/* Close the device. */
sd.close (&sd);
current_sound->play (current_sound, current_sound_device);
/* Clean up. */
current_sound_device = NULL;
current_sound = NULL;
UNGCPRO;
#else /* WINDOWSNT */