aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaroly Lorentey2004-06-24 07:44:13 +0000
committerKaroly Lorentey2004-06-24 07:44:13 +0000
commit3fa701994755105d1fb4b0b802338fc04e8a6937 (patch)
tree02ec9152f5f6e95bbb0b02265f51b832e712e8b5
parent8c8d5f3503a2fb4918414c0b0b9dacd81c50f1a9 (diff)
parentbb72b9d0b5248404a55b599d99c0be5454704e4a (diff)
downloademacs-3fa701994755105d1fb4b0b802338fc04e8a6937.tar.gz
emacs-3fa701994755105d1fb4b0b802338fc04e8a6937.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-409 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-410 Make sure image types are initialized for lookup too * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-411 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-412 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-413 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-414 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-415 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-416 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-417 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-418 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-419 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-202
-rw-r--r--ChangeLog9
-rw-r--r--Makefile.in6
-rw-r--r--etc/ChangeLog4
-rw-r--r--etc/FOR-RELEASE21
-rw-r--r--etc/MORE.STUFF3
-rw-r--r--etc/NEWS7
-rw-r--r--lisp/ChangeLog109
-rw-r--r--lisp/autorevert.el21
-rw-r--r--lisp/comint.el33
-rw-r--r--lisp/cus-edit.el16
-rw-r--r--lisp/dired-aux.el6
-rw-r--r--lisp/emacs-lisp/ewoc.el51
-rw-r--r--lisp/files.el14
-rw-r--r--lisp/frame.el5
-rw-r--r--lisp/image.el10
-rw-r--r--lisp/isearch.el17
-rw-r--r--lisp/makefile.w32-in22
-rw-r--r--lisp/man.el3
-rw-r--r--lisp/mouse.el2
-rw-r--r--lisp/net/goto-addr.el4
-rw-r--r--lisp/newcomment.el20
-rw-r--r--lisp/progmodes/compile.el2
-rw-r--r--lisp/progmodes/grep.el12
-rw-r--r--lisp/ps-print.el4
-rw-r--r--lisp/replace.el104
-rw-r--r--lispref/ChangeLog24
-rw-r--r--lispref/backups.texi3
-rw-r--r--lispref/buffers.texi4
-rw-r--r--lispref/control.texi4
-rw-r--r--lispref/display.texi14
-rw-r--r--lispref/eval.texi8
-rw-r--r--lispref/files.texi21
-rw-r--r--lispref/frames.texi4
-rw-r--r--lispref/functions.texi6
-rw-r--r--lispref/hash.texi2
-rw-r--r--lispref/help.texi90
-rw-r--r--lispref/lists.texi7
-rw-r--r--lispref/loading.texi5
-rw-r--r--lispref/macros.texi2
-rw-r--r--lispref/minibuf.texi10
-rw-r--r--lispref/processes.texi2
-rw-r--r--lispref/symbols.texi4
-rw-r--r--lispref/variables.texi5
-rwxr-xr-xmake-dist1
-rw-r--r--man/ChangeLog33
-rw-r--r--man/Makefile.in10
-rw-r--r--man/abbrevs.texi2
-rw-r--r--man/anti.texi2
-rw-r--r--man/custom.texi2
-rw-r--r--man/emacs-xtra.texi313
-rw-r--r--man/info.texi20
-rw-r--r--man/makefile.w32-in28
-rw-r--r--man/misc.texi37
-rw-r--r--man/msdog.texi4
-rw-r--r--man/programs.texi4
-rw-r--r--src/ChangeLog134
-rw-r--r--src/abbrev.c2
-rw-r--r--src/alloc.c33
-rw-r--r--src/atimer.c2
-rw-r--r--src/atimer.h2
-rw-r--r--src/blockinput.h2
-rw-r--r--src/buffer.c8
-rw-r--r--src/buffer.h2
-rw-r--r--src/callproc.c4
-rw-r--r--src/casefiddle.c12
-rw-r--r--src/charset.c16
-rw-r--r--src/coding.c8
-rw-r--r--src/data.c21
-rw-r--r--src/dispextern.h4
-rw-r--r--src/doc.c2
-rw-r--r--src/editfns.c70
-rw-r--r--src/fns.c107
-rw-r--r--src/image.c4
-rw-r--r--src/keyboard.c12
-rw-r--r--src/keymap.c6
-rw-r--r--src/lisp.h63
-rw-r--r--src/macfns.c4
-rw-r--r--src/macterm.c6
-rw-r--r--src/minibuf.c78
-rw-r--r--src/print.c2
-rw-r--r--src/search.c126
-rw-r--r--src/syntax.c17
-rw-r--r--src/window.c14
-rw-r--r--src/window.h2
-rw-r--r--src/xdisp.c49
-rw-r--r--src/xfaces.c15
-rw-r--r--src/xselect.c4
-rw-r--r--src/xsmfns.c2
-rw-r--r--src/xterm.c6
-rw-r--r--src/xterm.h2
90 files changed, 1513 insertions, 504 deletions
diff --git a/ChangeLog b/ChangeLog
index 80df0d84058..73b82e15624 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
12004-06-21 Kenichi Handa <handa@m17n.org>
2
3 * make-dist: Link leim-ext.el into tempdir.
4
52004-06-15 Luc Teirlinck <teirllm@auburn.edu>
6
7 * info/dir (File): Add emacs-xtra.
8 * Makefile.in (install-arch-indep, uninstall): Add emacs-xtra.
9
12004-06-12 Juri Linkov <juri@jurta.org> 102004-06-12 Juri Linkov <juri@jurta.org>
2 11
3 * info/dir: Move menu help lines from `* Menu:' to file header. 12 * info/dir: Move menu help lines from `* Menu:' to file header.
diff --git a/Makefile.in b/Makefile.in
index 28c3ff81b25..760f7d34f77 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -474,7 +474,7 @@ install-arch-indep: mkdir info
474 chmod a+r ${infodir}/dir); \ 474 chmod a+r ${infodir}/dir); \
475 fi; \ 475 fi; \
476 cd ${srcdir}/info ; \ 476 cd ${srcdir}/info ; \
477 for f in ada-mode* autotype* calc* ccmode* cl* dired-x* ebrowse* ediff* efaq* eintr* elisp* emacs* eshell* eudc* forms* gnus* idlwave* info* message* mh-e* pcl-cvs* reftex* sc* ses* speedbar* tramp* vip* widget* woman* smtpmail*; do \ 477 for f in ada-mode* autotype* calc* ccmode* cl* dired-x* ebrowse* ediff* efaq* eintr* elisp* emacs* emacs-xtra* eshell* eudc* forms* gnus* idlwave* info* message* mh-e* pcl-cvs* reftex* sc* ses* speedbar* tramp* vip* widget* woman* smtpmail*; do \
478 (cd $${thisdir}; \ 478 (cd $${thisdir}; \
479 ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \ 479 ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \
480 chmod a+r ${infodir}/$$f); \ 480 chmod a+r ${infodir}/$$f); \
@@ -484,7 +484,7 @@ install-arch-indep: mkdir info
484 thisdir=`/bin/pwd`; \ 484 thisdir=`/bin/pwd`; \
485 if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \ 485 if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \
486 then \ 486 then \
487 for f in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq elisp eintr emacs emacs-mime eshell eudc forms gnus idlwave info message mh-e pcl-cvs reftex sc ses speedbar tramp vip viper widget woman smtpmail; do \ 487 for f in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq elisp eintr emacs emacs-mime emacs-xtra eshell eudc forms gnus idlwave info message mh-e pcl-cvs reftex sc ses speedbar tramp vip viper widget woman smtpmail; do \
488 (cd $${thisdir}; \ 488 (cd $${thisdir}; \
489 ${INSTALL_INFO} --info-dir=${infodir} ${infodir}/$$f); \ 489 ${INSTALL_INFO} --info-dir=${infodir} ${infodir}/$$f); \
490 done; \ 490 done; \
@@ -550,7 +550,7 @@ uninstall:
550 done 550 done
551 (cd ${archlibdir} && rm -f fns-*) 551 (cd ${archlibdir} && rm -f fns-*)
552 -rm -rf ${libexecdir}/emacs/${version} 552 -rm -rf ${libexecdir}/emacs/${version}
553 (cd ${infodir} && rm -f cl* ada-mode* autotype* calc* ccmode* ebrowse* efaq* eintr elisp* eshell* eudc* idlwave* message* pcl-cvs* reftex* speedbar* tramp* widget* woman* dired-x* ediff* emacs* forms* gnus* info* mh-e* sc* ses* vip* smtpmail*) 553 (cd ${infodir} && rm -f cl* ada-mode* autotype* calc* ccmode* ebrowse* efaq* eintr elisp* eshell* eudc* idlwave* message* pcl-cvs* reftex* speedbar* tramp* widget* woman* dired-x* ediff* emacs* emacs-xtra* forms* gnus* info* mh-e* sc* ses* vip* smtpmail*)
554 (cd ${man1dir} && rm -f emacs${manext} emacsclient${manext} etags${manext} ctags${manext}) 554 (cd ${man1dir} && rm -f emacs${manext} emacsclient${manext} etags${manext} ctags${manext})
555 (cd ${bindir} && rm -f $(EMACSFULL) $(EMACS)) 555 (cd ${bindir} && rm -f $(EMACSFULL) $(EMACS))
556 556
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 05c4549bee3..94c4c3d87e1 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
12004-06-23 Luc Teirlinck <teirllm@auburn.edu>
2
3 * MORE.STUFF: Delete obsolete URL.
4
12004-06-10 Lars Hansen <larsh@math.ku.dk> 52004-06-10 Lars Hansen <larsh@math.ku.dk>
2 6
3 * NEWS: Describe dired-omit-mode. Describe desktop package changes. 7 * NEWS: Describe dired-omit-mode. Describe desktop package changes.
diff --git a/etc/FOR-RELEASE b/etc/FOR-RELEASE
new file mode 100644
index 00000000000..f79bdad041d
--- /dev/null
+++ b/etc/FOR-RELEASE
@@ -0,0 +1,21 @@
1Tasks needed before the next release.
2
3** Test the mbox branch of Rmail.
4
5** Install the mbox branch of Rmail.
6
7** Finish updating the Emacs Lisp manual.
8
9** Finish checking the Emacs Lisp manual.
10
11** Update the Emacs manual.
12
13** Check the Emacs manual.
14
15** Update man/info.texi.
16
17** Make geometry specifications work correctly for GTK.
18
19** Make GTK scrollbars behave like others w.r.t. overscrolling.
20
21** Make GTK toolbar look OK on monochrome displays.
diff --git a/etc/MORE.STUFF b/etc/MORE.STUFF
index 1eec6f23b9e..ba514f2dbac 100644
--- a/etc/MORE.STUFF
+++ b/etc/MORE.STUFF
@@ -36,9 +36,6 @@ You might find bug-fixes or enhancements in these places.
36 36
37 * Ada: <URL:http://libre.act-europe.fr/adamode> 37 * Ada: <URL:http://libre.act-europe.fr/adamode>
38 38
39 * Autorevert, CWarn and Follow:
40 <URL:http://www.andersl.com/emacs/>
41
42 * Battery and Info Look: <URL:ftp://ftp.ul.bawue.de/pub/purple/emacs> 39 * Battery and Info Look: <URL:ftp://ftp.ul.bawue.de/pub/purple/emacs>
43 40
44 * BibTeX: 41 * BibTeX:
diff --git a/etc/NEWS b/etc/NEWS
index 0bef10b88f5..4c9564b24ea 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2150,6 +2150,9 @@ configuration files.
2150 2150
2151* Lisp Changes in Emacs 21.4 2151* Lisp Changes in Emacs 21.4
2152 2152
2153** If a command sets transient-mark-mode to `only', that
2154enables Transient Mark mode for the following command, only.
2155
2153+++ 2156+++
2154** Cleaner way to enter key sequences. 2157** Cleaner way to enter key sequences.
2155 2158
@@ -2178,6 +2181,10 @@ current input method to input a character.
2178click-event-style position information for a given visible buffer 2181click-event-style position information for a given visible buffer
2179position or for a given window pixel coordinate. 2182position or for a given window pixel coordinate.
2180 2183
2184** skip-chars-forward and skip-chars-backward now handle
2185character classes such as [:alpha:], along with individual characters
2186and ranges.
2187
2181** Function pos-visible-in-window-p now returns the pixel coordinates 2188** Function pos-visible-in-window-p now returns the pixel coordinates
2182and partial visiblity state of the corresponding row, if the PARTIALLY 2189and partial visiblity state of the corresponding row, if the PARTIALLY
2183arg is non-nil. 2190arg is non-nil.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4ac29e4ddfc..4b7eb38c208 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,112 @@
12004-06-24 Daniel Pfeiffer <occitan@esperanto.org>
2
3 * progmodes/grep.el (grep-error-screen-columns): New variable.
4 (grep-regexp-alist): Give it the full functionality of gnu style
5 compilation messages with line and column ranges. Ask me for the
6 perl script I'm working on, that uses these.
7
82004-06-23 Nick Roberts <nickrob@gnu.org>
9
10 * comint.el: (comint-insert-clicked-input, comint-copy-old-input):
11 Remove.
12 (comint-insert-input, comint-mouse-insert-input): New functions
13 based on comint-insert-clicked-input for two bindings but just
14 one functionality.
15
162004-06-23 Luc Teirlinck <teirllm@auburn.edu>
17
18 * net/goto-addr.el (goto-address-fontify): Fix help-echo text.
19
202004-06-23 Lars Hansen <larsh@math.ku.dk>
21
22 * files.el (write-contents-functions): Doc fix.
23
242004-06-21 Juanma Barranquero <lektu@terra.es>
25
26 * image.el (image-library-alist): Rewrite docstring in active
27 voice.
28
292004-06-20 Richard M. Stallman <rms@gnu.org>
30
31 * mouse.el (mouse-set-region-1): Set transient-mark-mode to `only'.
32
33 * isearch.el (isearch-repeat): Avoid testing old match data.
34 (isearch-message): Display trailing space in special font
35 when search is failing.
36 (isearch-search-fun-function): Doc fix.
37
38 * autorevert.el (global-auto-revert-non-file-buffers): Doc fix.
39
402004-06-19 Luc Teirlinck <teirllm@auburn.edu>
41
42 * frame.el (show-trailing-whitespace): Doc fix.
43
44 * cus-edit.el (custom-variable-documentation): New function.
45 (custom-variable): Use it.
46
472004-06-19 Nick Roberts <nickrob@gnu.org>
48
49 * man.el (Man-getpage-in-background): Revert previous change but
50 make cygwin a special case.
51
522004-06-18 Luc Teirlinck <teirllm@auburn.edu>
53
54 * autorevert.el (global-auto-revert-non-file-buffers): Update
55 docstring.
56
572004-06-19 Daniel Pfeiffer <occitan@esperanto.org>
58
59 * progmodes/compile.el (compilation-error-properties): Store one
60 more than end-col, if present, so that transient-mark-mode will
61 highlight last char too.
62 * progmodes/grep.el (grep-regexp-alist): Match columns and column
63 ranges, if present.
64
652004-06-18 Jason Rumney <jasonr@gnu.org>
66
67 * makefile.w32-in: Double percent signs in for loops.
68
692004-06-17 David Kastrup <dak@gnu.org>
70
71 * replace.el (query-replace-read-args): Only warn about use of \n
72 and \t when we are doing a regexp replacement and the actual
73 escaped character is n or t.
74 (query-replace-regexp): Add \, and \# interpretation to
75 interactive call and document it.
76 (query-replace-regexp-eval, replace-match-string-symbols): add \#
77 as shortkey for replace-count.
78 (replace-quote): New function for doubling backslashes.
79
802004-06-17 Juanma Barranquero <lektu@terra.es>
81
82 * files.el (parse-colon-path, cd): Mention in docstring that the
83 path separator is colon in GNU-like systems.
84
85 * newcomment.el (comment-region-internal): Fix docstring.
86
87 * emacs-lisp/ewoc.el (ewoc-create, ewoc-map, ewoc-locate)
88 (ewoc-invalidate, ewoc-collect): Doc fixes.
89 (ewoc--create-node, ewoc--delete-node-internal):
90 Fix typos in docstring.
91
922004-06-15 Luc Teirlinck <teirllm@auburn.edu>
93
94 * files.el (buffer-stale-function): Add hyperlink to emacs-xtra
95 manual to docstring.
96
972004-06-15 Vinicius Jose Latorre <viniciusjl@ig.com.br>
98
99 * ps-print.el (ps-time-stamp-iso8601): Comment doc string of defalias.
100
1012004-06-15 Luc Teirlinck <teirllm@auburn.edu>
102
103 * dired-aux.el (dired-do-redisplay, dired-maybe-insert-subdir):
104 Add hyperlink to emacs-xtra manual to docstring.
105
106 * autorevert.el (global-auto-revert-non-file-buffers): Add
107 hyperlink to emacs-xtra manual to docstring, as well as an
108 info-link.
109
12004-06-14 Juanma Barranquero <lektu@terra.es> 1102004-06-14 Juanma Barranquero <lektu@terra.es>
2 111
3 * image.el (image-library-alist): New variable to map image types 112 * image.el (image-library-alist): New variable to map image types
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 7987e880ec1..7b786882cf6 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -174,20 +174,21 @@ would only waste precious space."
174 :type 'hook) 174 :type 'hook)
175 175
176(defcustom global-auto-revert-non-file-buffers nil 176(defcustom global-auto-revert-non-file-buffers nil
177 "When nil only file buffers are reverted by Global Auto-Revert Mode. 177 "When nil, Global Auto-Revert mode operates only on file-visiting buffers.
178 178
179When non-nil, both file buffers and buffers with a custom 179When non-nil, both file buffers and buffers with a custom
180`revert-buffer-function' and a `buffer-stale-function' are 180`revert-buffer-function' and a `buffer-stale-function' are
181reverted by Global Auto-Revert Mode. 181reverted by Global Auto-Revert mode. These include the Buffer
182 182List buffer, and Dired buffers showing complete local
183Use this option with care since it could lead to excessive reverts. 183directories. Dired buffers do not auto-revert as a result of
184Note also that for some non-file buffers the check whether the 184changes in subdirectories or in the contents, size, modes, etc.,
185buffer needs updating may be imperfect, due to efficiency 185of files. You may still sometimes want to revert them manually.
186considerations, and may not take all information listed in the 186
187buffer into account. Hence, a non-nil value for this option does 187Use this option with care since it could lead to excessive auto-reverts.
188not necessarily make manual updates useless for non-file buffers." 188For more information, see Info node `(emacs-xtra)Autorevert'."
189 :group 'auto-revert 189 :group 'auto-revert
190 :type 'boolean) 190 :type 'boolean
191 :link '(info-link "(emacs-xtra)Autorevert"))
191 192
192(defcustom global-auto-revert-ignore-modes '() 193(defcustom global-auto-revert-ignore-modes '()
193 "List of major modes Global Auto-Revert Mode should not check." 194 "List of major modes Global Auto-Revert Mode should not check."
diff --git a/lisp/comint.el b/lisp/comint.el
index 12d8e1fcbb7..8b5a107c7d7 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -571,7 +571,7 @@ Entry to this mode runs the hooks on `comint-mode-hook'."
571 (define-key comint-mode-map "\C-c\C-c" 'comint-interrupt-subjob) 571 (define-key comint-mode-map "\C-c\C-c" 'comint-interrupt-subjob)
572 (define-key comint-mode-map "\C-c\C-z" 'comint-stop-subjob) 572 (define-key comint-mode-map "\C-c\C-z" 'comint-stop-subjob)
573 (define-key comint-mode-map "\C-c\C-\\" 'comint-quit-subjob) 573 (define-key comint-mode-map "\C-c\C-\\" 'comint-quit-subjob)
574 (define-key comint-mode-map "\C-c\C-m" 'comint-copy-old-input) 574 (define-key comint-mode-map "\C-c\C-m" 'comint-insert-input)
575 (define-key comint-mode-map "\C-c\C-o" 'comint-delete-output) 575 (define-key comint-mode-map "\C-c\C-o" 'comint-delete-output)
576 (define-key comint-mode-map "\C-c\C-r" 'comint-show-output) 576 (define-key comint-mode-map "\C-c\C-r" 'comint-show-output)
577 (define-key comint-mode-map "\C-c\C-e" 'comint-show-maximum-output) 577 (define-key comint-mode-map "\C-c\C-e" 'comint-show-maximum-output)
@@ -582,7 +582,7 @@ Entry to this mode runs the hooks on `comint-mode-hook'."
582 (define-key comint-mode-map "\C-c\C-s" 'comint-write-output) 582 (define-key comint-mode-map "\C-c\C-s" 'comint-write-output)
583 (define-key comint-mode-map "\C-c." 'comint-insert-previous-argument) 583 (define-key comint-mode-map "\C-c." 'comint-insert-previous-argument)
584 ;; Mouse Buttons: 584 ;; Mouse Buttons:
585 (define-key comint-mode-map [mouse-2] 'comint-insert-clicked-input) 585 (define-key comint-mode-map [mouse-2] 'comint-mouse-insert-input)
586 ;; Menu bars: 586 ;; Menu bars:
587 ;; completion: 587 ;; completion:
588 (define-key comint-mode-map [menu-bar completion] 588 (define-key comint-mode-map [menu-bar completion]
@@ -615,7 +615,7 @@ Entry to this mode runs the hooks on `comint-mode-hook'."
615 (define-key comint-mode-map [menu-bar inout kill-input] 615 (define-key comint-mode-map [menu-bar inout kill-input]
616 '("Kill Current Input" . comint-kill-input)) 616 '("Kill Current Input" . comint-kill-input))
617 (define-key comint-mode-map [menu-bar inout copy-input] 617 (define-key comint-mode-map [menu-bar inout copy-input]
618 '("Copy Old Input" . comint-copy-old-input)) 618 '("Copy Old Input" . comint-insert-input))
619 (define-key comint-mode-map [menu-bar inout forward-matching-history] 619 (define-key comint-mode-map [menu-bar inout forward-matching-history]
620 '("Forward Matching Input..." . comint-forward-matching-input)) 620 '("Forward Matching Input..." . comint-forward-matching-input))
621 (define-key comint-mode-map [menu-bar inout backward-matching-history] 621 (define-key comint-mode-map [menu-bar inout backward-matching-history]
@@ -798,11 +798,10 @@ buffer. The hook `comint-exec-hook' is run after each exec."
798 (set-process-coding-system proc decoding encoding)) 798 (set-process-coding-system proc decoding encoding))
799 proc)) 799 proc))
800 800
801 801(defun comint-insert-input ()
802(defun comint-insert-clicked-input (event) 802 "In a Comint buffer, set the current input to the previous input at point."
803 "In a Comint buffer, set the current input to the clicked-on previous input." 803 (interactive)
804 (interactive "e") 804 (let ((pos (point)))
805 (let ((pos (posn-point (event-end event))))
806 (if (not (eq (get-char-property pos 'field) 'input)) 805 (if (not (eq (get-char-property pos 'field) 'input))
807 ;; No input at POS, fall back to the global definition. 806 ;; No input at POS, fall back to the global definition.
808 (let* ((keys (this-command-keys)) 807 (let* ((keys (this-command-keys))
@@ -816,11 +815,16 @@ buffer. The hook `comint-exec-hook' is run after each exec."
816 (or (marker-position comint-accum-marker) 815 (or (marker-position comint-accum-marker)
817 (process-mark (get-buffer-process (current-buffer)))) 816 (process-mark (get-buffer-process (current-buffer))))
818 (point)) 817 (point))
819 ;; Insert the clicked-upon input 818 ;; Insert the input at point
820 (insert (buffer-substring-no-properties 819 (insert (buffer-substring-no-properties
821 (previous-single-char-property-change (1+ pos) 'field) 820 (previous-single-char-property-change (1+ pos) 'field)
822 (next-single-char-property-change pos 'field)))))) 821 (next-single-char-property-change pos 'field))))))
823 822
823(defun comint-mouse-insert-input (event)
824 "In a Comint buffer, set the current input to the previous input you click on."
825 (interactive "e")
826 (mouse-set-point event)
827 (comint-insert-input))
824 828
825 829
826;; Input history processing in a buffer 830;; Input history processing in a buffer
@@ -1858,17 +1862,6 @@ the current line with any initial string matching the regexp
1858 (comint-bol) 1862 (comint-bol)
1859 (buffer-substring-no-properties (point) (line-end-position))))) 1863 (buffer-substring-no-properties (point) (line-end-position)))))
1860 1864
1861(defun comint-copy-old-input ()
1862 "Insert after prompt old input at point as new input to be edited.
1863Calls `comint-get-old-input' to get old input."
1864 (interactive)
1865 (let ((input (funcall comint-get-old-input))
1866 (process (get-buffer-process (current-buffer))))
1867 (if (not process)
1868 (error "Current buffer has no process")
1869 (goto-char (process-mark process))
1870 (insert input))))
1871
1872(defun comint-skip-prompt () 1865(defun comint-skip-prompt ()
1873 "Skip past the text matching regexp `comint-prompt-regexp'. 1866 "Skip past the text matching regexp `comint-prompt-regexp'.
1874If this takes us past the end of the current line, don't skip at all." 1867If this takes us past the end of the current line, don't skip at all."
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 5caeb78265e..9e0efc5d3d0 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -2074,11 +2074,25 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
2074 :group 'custom-buffer 2074 :group 'custom-buffer
2075 :version "20.3") 2075 :version "20.3")
2076 2076
2077(defun custom-variable-documentation (variable)
2078 "Return documentation of VARIABLE for use in Custom buffer.
2079Normally just return the docstring. But if VARIABLE automatically
2080becomes buffer local when set, append a message to that effect."
2081 (if (and (local-variable-if-set-p variable)
2082 (or (not (local-variable-p variable))
2083 (with-temp-buffer
2084 (local-variable-if-set-p variable))))
2085 (concat (documentation-property variable 'variable-documentation)
2086 "\n
2087This variable automatically becomes buffer-local when set outside Custom.
2088However, setting it through Custom sets the default value.")
2089 (documentation-property variable 'variable-documentation)))
2090
2077(define-widget 'custom-variable 'custom 2091(define-widget 'custom-variable 'custom
2078 "Customize variable." 2092 "Customize variable."
2079 :format "%v" 2093 :format "%v"
2080 :help-echo "Set or reset this variable." 2094 :help-echo "Set or reset this variable."
2081 :documentation-property 'variable-documentation 2095 :documentation-property #'custom-variable-documentation
2082 :custom-category 'option 2096 :custom-category 'option
2083 :custom-state nil 2097 :custom-state nil
2084 :custom-menu 'custom-variable-menu-create 2098 :custom-menu 'custom-variable-menu-create
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index a58b62498ca..bf7c9c00d18 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -902,7 +902,8 @@ the buffer will not reset them. However, using `dired-undo' to re-insert
902or delete subdirectories can bypass this machinery. Hence, you sometimes 902or delete subdirectories can bypass this machinery. Hence, you sometimes
903may have to reset some subdirectory switches after a `dired-undo'. 903may have to reset some subdirectory switches after a `dired-undo'.
904You can reset all subdirectory switches to the default using 904You can reset all subdirectory switches to the default using
905\\<dired-mode-map>\\[dired-reset-subdir-switches]." 905\\<dired-mode-map>\\[dired-reset-subdir-switches].
906See Info node `(emacs-xtra)Subdir switches' for more details."
906 ;; Moves point if the next ARG files are redisplayed. 907 ;; Moves point if the next ARG files are redisplayed.
907 (interactive "P\np") 908 (interactive "P\np")
908 (if (and test-for-subdir (dired-get-subdir)) 909 (if (and test-for-subdir (dired-get-subdir))
@@ -1751,7 +1752,8 @@ the buffer will not reset them. However, using `dired-undo' to re-insert
1751or delete subdirectories can bypass this machinery. Hence, you sometimes 1752or delete subdirectories can bypass this machinery. Hence, you sometimes
1752may have to reset some subdirectory switches after a `dired-undo'. 1753may have to reset some subdirectory switches after a `dired-undo'.
1753You can reset all subdirectory switches to the default using 1754You can reset all subdirectory switches to the default using
1754\\<dired-mode-map>\\[dired-reset-subdir-switches]." 1755\\<dired-mode-map>\\[dired-reset-subdir-switches].
1756See Info node `(emacs-xtra)Subdir switches' for more details."
1755 (interactive 1757 (interactive
1756 (list (dired-get-filename) 1758 (list (dired-get-filename)
1757 (if current-prefix-arg 1759 (if current-prefix-arg
diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el
index a0c2e3c0d70..a2cb4e9fe46 100644
--- a/lisp/emacs-lisp/ewoc.el
+++ b/lisp/emacs-lisp/ewoc.el
@@ -1,6 +1,7 @@
1;;; ewoc.el --- utility to maintain a view of a list of objects in a buffer 1;;; ewoc.el --- utility to maintain a view of a list of objects in a buffer
2 2
3;; Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation 3;; Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 04
4;; Free Software Foundation
4 5
5;; Author: Per Cederqvist <ceder@lysator.liu.se> 6;; Author: Per Cederqvist <ceder@lysator.liu.se>
6;; Inge Wallin <inge@lysator.liu.se> 7;; Inge Wallin <inge@lysator.liu.se>
@@ -244,7 +245,7 @@ BUT if it is the header or the footer in EWOC return nil instead."
244 245
245(defun ewoc--create-node (data pretty-printer pos) 246(defun ewoc--create-node (data pretty-printer pos)
246 "Call PRETTY-PRINTER with point set at POS in current buffer. 247 "Call PRETTY-PRINTER with point set at POS in current buffer.
247Remember the start position. Create a wrapper containing that 248Remember the start position. Create a wrapper containing that
248start position and the element DATA." 249start position and the element DATA."
249 (save-excursion 250 (save-excursion
250 ;; Remember the position as a number so that it doesn't move 251 ;; Remember the position as a number so that it doesn't move
@@ -263,7 +264,7 @@ start position and the element DATA."
263 264
264(defun ewoc--delete-node-internal (ewoc node) 265(defun ewoc--delete-node-internal (ewoc node)
265 "Delete a data string from EWOC. 266 "Delete a data string from EWOC.
266Can not be used on the footer. Returns the wrapper that is deleted. 267Can not be used on the footer. Returns the wrapper that is deleted.
267The start-marker in the wrapper is set to nil, so that it doesn't 268The start-marker in the wrapper is set to nil, so that it doesn't
268consume any more resources." 269consume any more resources."
269 (let ((dll (ewoc--dll ewoc)) 270 (let ((dll (ewoc--dll ewoc))
@@ -303,14 +304,14 @@ The ewoc will be inserted in the current buffer at the current position.
303 304
304PRETTY-PRINTER should be a function that takes one argument, an 305PRETTY-PRINTER should be a function that takes one argument, an
305element, and inserts a string representing it in the buffer (at 306element, and inserts a string representing it in the buffer (at
306point). The string PRETTY-PRINTER inserts may be empty or span 307point). The string PRETTY-PRINTER inserts may be empty or span
307several linse. A trailing newline will always be inserted 308several lines. A trailing newline will always be inserted
308automatically. The PRETTY-PRINTER should use insert, and not 309automatically. The PRETTY-PRINTER should use `insert', and not
309insert-before-markers. 310`insert-before-markers'.
310 311
311Optional third argument HEADER is a string that will always be 312Optional second argument HEADER is a string that will always be
312present at the top of the ewoc. HEADER should end with a 313present at the top of the ewoc. HEADER should end with a
313newline. Optionaly fourth argument FOOTER is similar, and will 314newline. Optional third argument FOOTER is similar, and will
314be inserted at the bottom of the ewoc." 315be inserted at the bottom of the ewoc."
315 (let ((new-ewoc 316 (let ((new-ewoc
316 (ewoc--create (current-buffer) 317 (ewoc--create (current-buffer)
@@ -394,9 +395,9 @@ MAP-FUNCTION is applied to the first element first.
394If MAP-FUNCTION returns non-nil the element will be refreshed (its 395If MAP-FUNCTION returns non-nil the element will be refreshed (its
395pretty-printer will be called once again). 396pretty-printer will be called once again).
396 397
397Note that the buffer for EWOC will be current buffer when MAP-FUNCTION 398Note that the buffer for EWOC will be the current buffer when
398is called. MAP-FUNCTION must restore the current buffer to BUFFER before 399MAP-FUNCTION is called. MAP-FUNCTION must restore the current
399it returns, if it changes it. 400buffer before it returns, if it changes it.
400 401
401If more than two arguments are given, the remaining 402If more than two arguments are given, the remaining
402arguments will be passed to MAP-FUNCTION." 403arguments will be passed to MAP-FUNCTION."
@@ -411,9 +412,9 @@ arguments will be passed to MAP-FUNCTION."
411(defun ewoc-filter (ewoc predicate &rest args) 412(defun ewoc-filter (ewoc predicate &rest args)
412 "Remove all elements in EWOC for which PREDICATE returns nil. 413 "Remove all elements in EWOC for which PREDICATE returns nil.
413Note that the buffer for EWOC will be current-buffer when PREDICATE 414Note that the buffer for EWOC will be current-buffer when PREDICATE
414is called. PREDICATE must restore the current buffer before it returns 415is called. PREDICATE must restore the current buffer before it returns
415if it changes it. 416if it changes it.
416The PREDICATE is called with the element as its first argument. If any 417The PREDICATE is called with the element as its first argument. If any
417ARGS are given they will be passed to the PREDICATE." 418ARGS are given they will be passed to the PREDICATE."
418 (ewoc--set-buffer-bind-dll-let* ewoc 419 (ewoc--set-buffer-bind-dll-let* ewoc
419 ((node (ewoc--node-nth dll 1)) 420 ((node (ewoc--node-nth dll 1))
@@ -428,7 +429,7 @@ ARGS are given they will be passed to the PREDICATE."
428(defun ewoc-locate (ewoc &optional pos guess) 429(defun ewoc-locate (ewoc &optional pos guess)
429 "Return the node that POS (a buffer position) is within. 430 "Return the node that POS (a buffer position) is within.
430POS may be a marker or an integer. It defaults to point. 431POS may be a marker or an integer. It defaults to point.
431GUESS should be a node that it is likely that POS is near. 432GUESS should be a node that it is likely to be near POS.
432 433
433If POS points before the first element, the first node is returned. 434If POS points before the first element, the first node is returned.
434If POS points after the last element, the last node is returned. 435If POS points after the last element, the last node is returned.
@@ -497,7 +498,7 @@ If the EWOC is empty, nil is returned."
497 498
498(defun ewoc-invalidate (ewoc &rest nodes) 499(defun ewoc-invalidate (ewoc &rest nodes)
499 "Refresh some elements. 500 "Refresh some elements.
500The pretty-printer that for EWOC will be called for all NODES." 501The pretty-printer set for EWOC will be called for all NODES."
501 (ewoc--set-buffer-bind-dll ewoc 502 (ewoc--set-buffer-bind-dll ewoc
502 (dolist (node nodes) 503 (dolist (node nodes)
503 (ewoc--refresh-node (ewoc--pretty-printer ewoc) node)))) 504 (ewoc--refresh-node (ewoc--pretty-printer ewoc) node))))
@@ -564,13 +565,13 @@ number of elements needs to be refreshed."
564(defun ewoc-collect (ewoc predicate &rest args) 565(defun ewoc-collect (ewoc predicate &rest args)
565 "Select elements from EWOC using PREDICATE. 566 "Select elements from EWOC using PREDICATE.
566Return a list of all selected data elements. 567Return a list of all selected data elements.
567PREDICATE is a function that takes a data element as its first argument. 568PREDICATE is a function that takes a data element as its first
568The elements on the returned list will appear in the same order as in 569argument. The elements on the returned list will appear in the
569the buffer. You should not rely on in which order PREDICATE is 570same order as in the buffer. You should not rely on the order of
570called. 571calls to PREDICATE.
571Note that the buffer the EWOC is displayed in is current-buffer 572Note that the buffer the EWOC is displayed in is the current
572when PREDICATE is called. If PREDICATE must restore current-buffer if 573buffer when PREDICATE is called. PREDICATE must restore it if it
573it changes it. 574changes it.
574If more than two arguments are given the 575If more than two arguments are given the
575remaining arguments will be passed to PREDICATE." 576remaining arguments will be passed to PREDICATE."
576 (ewoc--set-buffer-bind-dll-let* ewoc 577 (ewoc--set-buffer-bind-dll-let* ewoc
diff --git a/lisp/files.el b/lisp/files.el
index dc84c79df84..cd11f07969f 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -393,7 +393,8 @@ updates before the buffer is saved, use `before-save-hook' .")
393(defvar write-contents-functions nil 393(defvar write-contents-functions nil
394 "List of functions to be called before writing out a buffer to a file. 394 "List of functions to be called before writing out a buffer to a file.
395If one of them returns non-nil, the file is considered already written 395If one of them returns non-nil, the file is considered already written
396and the rest are not called. 396and the rest are not called and neither are the functions in
397`write-file-functions'.
397 398
398This variable is meant to be used for hooks that pertain to the 399This variable is meant to be used for hooks that pertain to the
399buffer's contents, not to the particular visited file; thus, 400buffer's contents, not to the particular visited file; thus,
@@ -527,7 +528,8 @@ Not actually set up until the first time you use it.")
527 528
528(defun parse-colon-path (cd-path) 529(defun parse-colon-path (cd-path)
529 "Explode a search path into a list of directory names. 530 "Explode a search path into a list of directory names.
530Directories are separated by occurrences of `path-separator'." 531Directories are separated by occurrences of `path-separator'
532\(which is colon in GNU and GNU-like systems)."
531 ;; We could use split-string here. 533 ;; We could use split-string here.
532 (and cd-path 534 (and cd-path
533 (let (cd-list (cd-start 0) cd-colon) 535 (let (cd-list (cd-start 0) cd-colon)
@@ -562,7 +564,8 @@ Directories are separated by occurrences of `path-separator'."
562 "Make DIR become the current buffer's default directory. 564 "Make DIR become the current buffer's default directory.
563If your environment includes a `CDPATH' variable, try each one of 565If your environment includes a `CDPATH' variable, try each one of
564that list of directories (separated by occurrences of 566that list of directories (separated by occurrences of
565`path-separator') when resolving a relative directory name." 567`path-separator') when resolving a relative directory name.
568The path separator is colon in GNU and GNU-like systems."
566 (interactive 569 (interactive
567 (list (read-directory-name "Change default directory: " 570 (list (read-directory-name "Change default directory: "
568 default-directory default-directory 571 default-directory default-directory
@@ -3480,7 +3483,10 @@ this function is called.
3480The idea behind the NOCONFIRM argument is that it should be 3483The idea behind the NOCONFIRM argument is that it should be
3481non-nil if the buffer is going to be reverted without asking the 3484non-nil if the buffer is going to be reverted without asking the
3482user. In such situations, one has to be careful with potentially 3485user. In such situations, one has to be careful with potentially
3483time consuming operations.") 3486time consuming operations.
3487
3488For more information on how this variable is used by Auto Revert mode,
3489see Info node `(emacs-xtra)Supporting additional buffers'.")
3484 3490
3485(defvar before-revert-hook nil 3491(defvar before-revert-hook nil
3486 "Normal hook for `revert-buffer' to run before reverting. 3492 "Normal hook for `revert-buffer' to run before reverting.
diff --git a/lisp/frame.el b/lisp/frame.el
index 585d78cdc13..ad88102af65 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1244,9 +1244,8 @@ left untouched. FRAME nil or omitted means use the selected frame."
1244(make-variable-buffer-local 'show-trailing-whitespace) 1244(make-variable-buffer-local 'show-trailing-whitespace)
1245 1245
1246(defcustom show-trailing-whitespace nil 1246(defcustom show-trailing-whitespace nil
1247 "*Non-nil means highlight trailing whitespace in face `trailing-whitespace'. 1247 "*Non-nil means highlight trailing whitespace.
1248 1248This is done in the face `trailing-whitespace'."
1249Setting this variable makes it local to the current buffer."
1250 :tag "Highlight trailing whitespace." 1249 :tag "Highlight trailing whitespace."
1251 :type 'boolean 1250 :type 'boolean
1252 :group 'font-lock) 1251 :group 'font-lock)
diff --git a/lisp/image.el b/lisp/image.el
index 88e38186d7b..ad8fcafe8de 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -54,10 +54,12 @@ a non-nil value, TYPE is the image's type.")
54 54
55Each element is a list (IMAGE-TYPE LIBRARY...), where the car is a symbol 55Each element is a list (IMAGE-TYPE LIBRARY...), where the car is a symbol
56representing a supported image type, and the rest are strings giving 56representing a supported image type, and the rest are strings giving
57alternate filenames for the corresponding external libraries to load. 57alternate filenames for the corresponding external libraries.
58They are tried in the order they appear on the list; if none of them can 58
59be loaded, the running session of Emacs won't display the image type. 59Emacs tries to load the libraries in the order they appear on the
60No entries are needed for pbm and xbm images; they're always supported.") 60list; if none is loaded, the running session of Emacs won't
61support the image type. Types 'pbm and 'xbm don't need to be
62listed; they're always supported.")
61;;;###autoload (put 'image-library-alist 'risky-local-variable t) 63;;;###autoload (put 'image-library-alist 'risky-local-variable t)
62 64
63(defun image-jpeg-p (data) 65(defun image-jpeg-p (data)
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 8357527dc8c..3898aa13f61 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -999,7 +999,8 @@ Use `isearch-exit' to quit without signaling."
999 999
1000 (if (equal isearch-string "") 1000 (if (equal isearch-string "")
1001 (setq isearch-success t) 1001 (setq isearch-success t)
1002 (if (and isearch-success (equal (match-end 0) (match-beginning 0)) 1002 (if (and isearch-success
1003 (equal (point) isearch-other-end)
1003 (not isearch-just-started)) 1004 (not isearch-just-started))
1004 ;; If repeating a search that found 1005 ;; If repeating a search that found
1005 ;; an empty string, ensure we advance. 1006 ;; an empty string, ensure we advance.
@@ -1764,7 +1765,13 @@ If there is no completion possible, say so and continue searching."
1764 (let ((cursor-in-echo-area ellipsis) 1765 (let ((cursor-in-echo-area ellipsis)
1765 (m (concat 1766 (m (concat
1766 (isearch-message-prefix c-q-hack ellipsis isearch-nonincremental) 1767 (isearch-message-prefix c-q-hack ellipsis isearch-nonincremental)
1767 isearch-message 1768 (if (and (not isearch-success)
1769 (string-match " +$" isearch-message))
1770 (concat
1771 (substring isearch-message 0 (match-beginning 0))
1772 (propertize (substring isearch-message (match-beginning 0))
1773 'face 'trailing-whitespace))
1774 isearch-message)
1768 (isearch-message-suffix c-q-hack ellipsis) 1775 (isearch-message-suffix c-q-hack ellipsis)
1769 ))) 1776 )))
1770 (if c-q-hack 1777 (if c-q-hack
@@ -1811,7 +1818,11 @@ If there is no completion possible, say so and continue searching."
1811 1818
1812;; Searching 1819;; Searching
1813 1820
1814(defvar isearch-search-fun-function nil "Override `isearch-function-fun'.") 1821(defvar isearch-search-fun-function nil
1822 "Override `isearch-search-fun'.
1823This function should return the search function for isearch to use.
1824It will call this function with three arguments
1825as if it were `search-forward'.")
1815 1826
1816(defun isearch-search-fun () 1827(defun isearch-search-fun ()
1817 "Return the function to use for the search. 1828 "Return the function to use for the search.
diff --git a/lisp/makefile.w32-in b/lisp/makefile.w32-in
index 71998d403e4..826cf89bfec 100644
--- a/lisp/makefile.w32-in
+++ b/lisp/makefile.w32-in
@@ -237,7 +237,7 @@ update-subdirs-CMD: doit
237 echo ;; In load-path, after this directory should come>> subdirs.el 237 echo ;; In load-path, after this directory should come>> subdirs.el
238 echo ;; certain of its subdirectories. Here we specify them.>> subdirs.el 238 echo ;; certain of its subdirectories. Here we specify them.>> subdirs.el
239 echo (normal-top-level-add-to-load-path $(SQUOTE)(>> subdirs.el 239 echo (normal-top-level-add-to-load-path $(SQUOTE)(>> subdirs.el
240 @for %d in ($(WINS)) do if not (%d)==(term) echo "%d">> subdirs.el 240 @for %%d in ($(WINS)) do if not (%%d)==(term) echo "%%d">> subdirs.el
241 echo ))>> subdirs.el 241 echo ))>> subdirs.el
242 242
243update-subdirs-SH: doit 243update-subdirs-SH: doit
@@ -282,11 +282,11 @@ $(DONTCOMPILE:.el=.elc):
282compile: subdirs.el compile-$(SHELLTYPE) doit 282compile: subdirs.el compile-$(SHELLTYPE) doit
283 283
284compile-CMD: 284compile-CMD:
285# -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @attrib -r %g 285# -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
286 for %f in ($(COMPILE_FIRST)) do \ 286 for %%f in ($(COMPILE_FIRST)) do \
287 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %f 287 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %%f
288 for %f in (. $(WINS)) do for %g in (%f/*.el) do \ 288 for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \
289 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %f/%g 289 $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %%f/%%g
290 290
291compile-SH: 291compile-SH:
292# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done 292# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
@@ -309,9 +309,9 @@ compile-SH:
309compile-always: subdirs.el compile-always-$(SHELLTYPE) doit 309compile-always: subdirs.el compile-always-$(SHELLTYPE) doit
310 310
311compile-always-CMD: 311compile-always-CMD:
312# -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @attrib -r %g 312# -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g
313 for %f in ($(COMPILE_FIRST)) do $(emacs) -f batch-byte-compile %f 313 for %%f in ($(COMPILE_FIRST)) do $(emacs) -f batch-byte-compile %%f
314 for %f in (. $(WINS)) do for %g in (%f/*.el) do $(emacs) -f batch-byte-compile %f/%g 314 for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) -f batch-byte-compile %%f/%%g
315 315
316compile-always-SH: 316compile-always-SH:
317# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done 317# for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done
@@ -329,7 +329,7 @@ compile-always-SH:
329compile-calc: compile-calc-$(SHELLTYPE) 329compile-calc: compile-calc-$(SHELLTYPE)
330 330
331compile-calc-CMD: 331compile-calc-CMD:
332 for %f in ($(lisp)/calc/*.el) do $(emacs) -f batch-byte-compile %f 332 for %%f in ($(lisp)/calc/*.el) do $(emacs) -f batch-byte-compile %%f
333 333
334compile-calc-SH: 334compile-calc-SH:
335 for el in $(lisp)/calc/*.el; do \ 335 for el in $(lisp)/calc/*.el; do \
@@ -374,7 +374,7 @@ bootstrap-clean: bootstrap-clean-$(SHELLTYPE) loaddefs.el
374bootstrap-clean-CMD: 374bootstrap-clean-CMD:
375# if exist $(EMACS) $(MAKE) $(MFLAGS) autoloads 375# if exist $(EMACS) $(MAKE) $(MFLAGS) autoloads
376 if not exist $(lisp)\loaddefs.el cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el 376 if not exist $(lisp)\loaddefs.el cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el
377 -for %f in (. $(WINS)) do for %g in (%f\*.elc) do @$(DEL) %g 377 -for %%f in (. $(WINS)) do for %%g in (%%f\*.elc) do @$(DEL) %%g
378 378
379bootstrap-clean-SH: 379bootstrap-clean-SH:
380# if test -f $(EMACS); then $(MAKE) $(MFLAGS) autoloads; fi 380# if test -f $(EMACS); then $(MAKE) $(MFLAGS) autoloads; fi
diff --git a/lisp/man.el b/lisp/man.el
index 983be4a91cc..5a07045dda9 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -733,7 +733,8 @@ all sections related to a subject, put something appropriate into the
733 (if (fboundp 'start-process) 733 (if (fboundp 'start-process)
734 (set-process-sentinel 734 (set-process-sentinel
735 (start-process manual-program buffer 735 (start-process manual-program buffer
736 shell-file-name shell-command-switch 736 (if (eq system-type 'cygwin) shell-file-name "sh")
737 shell-command-switch
737 (format (Man-build-man-command) man-args)) 738 (format (Man-build-man-command) man-args))
738 'Man-bgproc-sentinel) 739 'Man-bgproc-sentinel)
739 (let ((exit-status 740 (let ((exit-status
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 621b517e2fe..7f9d080478a 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -625,7 +625,7 @@ This should be bound to a mouse drag event."
625 625
626(defun mouse-set-region-1 () 626(defun mouse-set-region-1 ()
627 ;; Set transient-mark-mode for a little while. 627 ;; Set transient-mark-mode for a little while.
628 (setq transient-mark-mode (or transient-mark-mode 'lambda)) 628 (setq transient-mark-mode (or transient-mark-mode 'only))
629 (setq mouse-last-region-beg (region-beginning)) 629 (setq mouse-last-region-beg (region-beginning))
630 (setq mouse-last-region-end (region-end)) 630 (setq mouse-last-region-end (region-end))
631 (setq mouse-last-region-tick (buffer-modified-tick))) 631 (setq mouse-last-region-tick (buffer-modified-tick)))
diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el
index b77be84deb3..428da8cbe8a 100644
--- a/lisp/net/goto-addr.el
+++ b/lisp/net/goto-addr.el
@@ -168,7 +168,7 @@ and `goto-address-fontify-p'."
168 (overlay-put this-overlay 168 (overlay-put this-overlay
169 'mouse-face goto-address-url-mouse-face) 169 'mouse-face goto-address-url-mouse-face)
170 (overlay-put this-overlay 170 (overlay-put this-overlay
171 'help-echo "mouse-2: follow URL") 171 'help-echo "mouse-2, C-c RET: follow URL")
172 (overlay-put this-overlay 172 (overlay-put this-overlay
173 'keymap goto-address-highlight-keymap) 173 'keymap goto-address-highlight-keymap)
174 (overlay-put this-overlay 'goto-address t))) 174 (overlay-put this-overlay 'goto-address t)))
@@ -182,7 +182,7 @@ and `goto-address-fontify-p'."
182 (overlay-put this-overlay 'mouse-face 182 (overlay-put this-overlay 'mouse-face
183 goto-address-mail-mouse-face) 183 goto-address-mail-mouse-face)
184 (overlay-put this-overlay 184 (overlay-put this-overlay
185 'help-echo "mouse-2: mail this address") 185 'help-echo "mouse-2, C-c RET: mail this address")
186 (overlay-put this-overlay 186 (overlay-put this-overlay
187 'keymap goto-address-highlight-keymap) 187 'keymap goto-address-highlight-keymap)
188 (overlay-put this-overlay 'goto-address t)))))))) 188 (overlay-put this-overlay 'goto-address t))))))))
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 2b9122a8eb9..22713f87a96 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -873,17 +873,17 @@ indentation to be kept as it was before narrowing."
873 (setq ,bindent (- ,bindent n))))))))))) 873 (setq ,bindent (- ,bindent n)))))))))))
874 874
875(defun comment-region-internal (beg end cs ce 875(defun comment-region-internal (beg end cs ce
876 &optional ccs cce block lines indent) 876 &optional ccs cce block lines indent)
877 "Comment region BEG .. END. 877 "Comment region BEG .. END.
878CS and CE are the comment start resp end string. 878CS and CE are the comment start string and comment end string,
879CCS and CCE are the comment continuation strings for the start resp end 879respectively. CCS and CCE are the comment continuation strings
880of lines (default to CS and CE). 880for the start and end of lines, respectively (default to CS and CE).
881BLOCK indicates that end of lines should be marked with either CCE, CE or CS 881BLOCK indicates that end of lines should be marked with either CCE,
882\(if CE is empty) and that those markers should be aligned. 882CE or CS \(if CE is empty) and that those markers should be aligned.
883LINES indicates that an extra lines will be used at the beginning and end 883LINES indicates that an extra lines will be used at the beginning
884of the region for CE and CS. 884and end of the region for CE and CS.
885INDENT indicates to put CS and CCS at the current indentation of the region 885INDENT indicates to put CS and CCS at the current indentation of
886rather than at left margin." 886the region rather than at left margin."
887 ;;(assert (< beg end)) 887 ;;(assert (< beg end))
888 (let ((no-empty (not (or (eq comment-empty-lines t) 888 (let ((no-empty (not (or (eq comment-empty-lines t)
889 (and comment-empty-lines (zerop (length ce))))))) 889 (and comment-empty-lines (zerop (length ce)))))))
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 3a880a4c9ea..033ce883e5f 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -583,7 +583,7 @@ Faces `compilation-error-face', `compilation-warning-face',
583 (setq col (match-string-no-properties col)) 583 (setq col (match-string-no-properties col))
584 (setq col (- (string-to-number col) compilation-first-column))) 584 (setq col (- (string-to-number col) compilation-first-column)))
585 (if (and end-col (setq end-col (match-string-no-properties end-col))) 585 (if (and end-col (setq end-col (match-string-no-properties end-col)))
586 (setq end-col (- (string-to-number end-col) compilation-first-column)) 586 (setq end-col (- (string-to-number end-col) compilation-first-column -1))
587 (if end-line (setq end-col -1))) 587 (if end-line (setq end-col -1)))
588 (if (consp type) ; not a static type, check what it is. 588 (if (consp type) ; not a static type, check what it is.
589 (setq type (or (and (car type) (match-end (car type)) 1) 589 (setq type (or (and (car type) (match-end (car type)) 1)
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index aa81f8aa770..1916bde9ea1 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -146,6 +146,14 @@ The following place holders should be present in the string:
146 :type 'boolean 146 :type 'boolean
147 :group 'grep) 147 :group 'grep)
148 148
149(defcustom grep-error-screen-columns nil
150 "*If non-nil, column numbers in grep hits are screen columns.
151See `compilation-error-screen-columns'"
152 :type '(choice (const :tag "Default" nil)
153 integer)
154 :version "21.4"
155 :group 'grep)
156
149;;;###autoload 157;;;###autoload
150(defcustom grep-setup-hook nil 158(defcustom grep-setup-hook nil
151 "List of hook functions run by `grep-process-setup' (see `run-hooks')." 159 "List of hook functions run by `grep-process-setup' (see `run-hooks')."
@@ -216,7 +224,9 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
216`complation-last-buffer' rather than `grep-last-buffer'.") 224`complation-last-buffer' rather than `grep-last-buffer'.")
217 225
218(defvar grep-regexp-alist 226(defvar grep-regexp-alist
219 '(("^\\(.+?\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 2) 227 '(("^\\(.+?\\)[:( \t]+\
228\\([0-9]+\\)\\([.:]?\\)\\([0-9]+\\)?\
229\\(?:-\\(?:\\([0-9]+\\)\\3\\)?\\.?\\([0-9]+\\)?\\)?[:) \t]" 1 (2 . 5) (4 . 6))
220 ("^Binary file \\(.+\\) matches$" 1 nil nil 1)) 230 ("^Binary file \\(.+\\) matches$" 1 nil nil 1))
221 "Regexp used to match grep hits. See `compilation-error-regexp-alist'.") 231 "Regexp used to match grep hits. See `compilation-error-regexp-alist'.")
222 232
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 4f20013c134..72ba4c24eed 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -3737,8 +3737,8 @@ It can be retrieved with `(ps-get ALIST-SYM KEY)'."
3737 (format-time-string "%Y-%m-%d")) 3737 (format-time-string "%Y-%m-%d"))
3738 3738
3739 3739
3740(defalias 'ps-time-stamp-iso8601 'ps-time-stamp-yyyy-mm-dd 3740;; Alias for `ps-time-stamp-yyyy-mm-dd' (which see).
3741 "Alias for `ps-time-stamp-yyyy-mm-dd' (which see).") 3741(defalias 'ps-time-stamp-iso8601 'ps-time-stamp-yyyy-mm-dd)
3742 3742
3743 3743
3744(defun ps-time-stamp-hh:mm:ss () 3744(defun ps-time-stamp-hh:mm:ss ()
diff --git a/lisp/replace.el b/lisp/replace.el
index 014762be53e..89f55c2829e 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1,7 +1,7 @@
1;;; replace.el --- replace commands for Emacs 1;;; replace.el --- replace commands for Emacs
2 2
3;; Copyright (C) 1985, 86, 87, 92, 94, 96, 1997, 2000, 2001, 2002 3;; Copyright (C) 1985, 86, 87, 92, 94, 96, 1997, 2000, 2001, 2002,
4;; Free Software Foundation, Inc. 4;; 2003, 2004 Free Software Foundation, Inc.
5 5
6;; Maintainer: FSF 6;; Maintainer: FSF
7 7
@@ -81,14 +81,15 @@ strings or patterns."
81 query-replace-from-history-variable 81 query-replace-from-history-variable
82 nil t))) 82 nil t)))
83 ;; Warn if user types \n or \t, but don't reject the input. 83 ;; Warn if user types \n or \t, but don't reject the input.
84 (if (string-match "\\\\[nt]" from) 84 (and regexp-flag
85 (let ((match (match-string 0 from))) 85 (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from)
86 (cond 86 (let ((match (match-string 3 from)))
87 ((string= match "\\n") 87 (cond
88 (message "Note: `\\n' here doesn't match a newline; to do that, type C-q C-j instead")) 88 ((string= match "\\n")
89 ((string= match "\\t") 89 (message "Note: `\\n' here doesn't match a newline; to do that, type C-q C-j instead"))
90 (message "Note: `\\t' here doesn't match a tab; to do that, just type TAB"))) 90 ((string= match "\\t")
91 (sit-for 2)))) 91 (message "Note: `\\t' here doesn't match a tab; to do that, just type TAB")))
92 (sit-for 2))))
92 93
93 (save-excursion 94 (save-excursion
94 (setq to (read-from-minibuffer (format "%s %s with: " string from) 95 (setq to (read-from-minibuffer (format "%s %s with: " string from)
@@ -161,20 +162,62 @@ Fourth and fifth arg START and END specify the region to operate on.
161 162
162In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP, 163In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP,
163and `\\=\\N' (where N is a digit) stands for 164and `\\=\\N' (where N is a digit) stands for
164 whatever what matched the Nth `\\(...\\)' in REGEXP." 165whatever what matched the Nth `\\(...\\)' in REGEXP.
166
167When this function is called interactively, the replacement text
168can also contain `\\,' followed by a Lisp expression. The escaped
169shorthands for `query-replace-regexp-eval' are also valid
170here: within the Lisp expression, you can use `\\&' for the whole
171match string, `\\N' for partial matches, `\\#&' and `\\#N' for
172the respective numeric values, and `\\#' for `replace-count'.
173
174If your Lisp expression is an identifier and the next
175letter in the replacement string would be interpreted as part of it,
176you can wrap it with an expression like `\\,(or \\#)'. Incidentally,
177for this particular case you may also enter `\\#' in the replacement
178text directly.
179
180When you use `\\,' or `\\#' in the replacement, TO-STRING actually
181becomes a list with expanded shorthands.
182Use \\[repeat-complex-command] after this command to see details."
165 (interactive 183 (interactive
166 (let ((common 184 (let ((common
167 (query-replace-read-args "Query replace regexp" t))) 185 (query-replace-read-args "Query replace regexp" t)))
168 (list (nth 0 common) (nth 1 common) (nth 2 common) 186 (list
169 ;; These are done separately here 187 (nth 0 common)
170 ;; so that command-history will record these expressions 188 (if (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]"
171 ;; rather than the values they had this time. 189 (nth 1 common))
172 (if (and transient-mark-mode mark-active) 190 (let ((to-string (nth 1 common)) pos to-expr char prompt)
173 (region-beginning)) 191 (while (string-match
174 (if (and transient-mark-mode mark-active) 192 "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]"
175 (region-end))))) 193 to-string)
176 194 (setq pos (match-end 0))
195 (push (substring to-string 0 (- pos 2)) to-expr)
196 (setq char (aref to-string (1- pos))
197 to-string (substring to-string pos))
198 (cond ((eq char ?\#)
199 (push '(number-to-string replace-count) to-expr))
200 ((eq char ?\,)
201 (setq pos (read-from-string to-string))
202 (push `(replace-quote ,(car pos)) to-expr)
203 (setq to-string (substring to-string (cdr pos))))))
204 (setq to-expr (nreverse (delete "" (cons to-string to-expr))))
205 (replace-match-string-symbols to-expr)
206 (cons 'replace-eval-replacement
207 (if (> (length to-expr) 1)
208 (cons 'concat to-expr)
209 (car to-expr))))
210 (nth 1 common))
211 (nth 2 common)
212 ;; These are done separately here
213 ;; so that command-history will record these expressions
214 ;; rather than the values they had this time.
215 (if (and transient-mark-mode mark-active)
216 (region-beginning))
217 (if (and transient-mark-mode mark-active)
218 (region-end)))))
177 (perform-replace regexp to-string t t delimited nil nil start end)) 219 (perform-replace regexp to-string t t delimited nil nil start end))
220
178(define-key esc-map [?\C-%] 'query-replace-regexp) 221(define-key esc-map [?\C-%] 'query-replace-regexp)
179 222
180(defun query-replace-regexp-eval (regexp to-expr &optional delimited start end) 223(defun query-replace-regexp-eval (regexp to-expr &optional delimited start end)
@@ -191,6 +234,7 @@ For convenience, when entering TO-EXPR interactively, you can use `\\&' or
191`\\0' to stand for whatever matched the whole of REGEXP, and `\\N' (where 234`\\0' to stand for whatever matched the whole of REGEXP, and `\\N' (where
192N is a digit) to stand for whatever matched the Nth `\\(...\\)' in REGEXP. 235N is a digit) to stand for whatever matched the Nth `\\(...\\)' in REGEXP.
193Use `\\#&' or `\\#N' if you want a number instead of a string. 236Use `\\#&' or `\\#N' if you want a number instead of a string.
237In interactive use, `\\#' in itself stands for `replace-count'.
194 238
195In Transient Mark mode, if the mark is active, operate on the contents 239In Transient Mark mode, if the mark is active, operate on the contents
196of the region. Otherwise, operate from point to the end of the buffer. 240of the region. Otherwise, operate from point to the end of the buffer.
@@ -1012,6 +1056,7 @@ N (match-string N) (where N is a string of digits)
1012#N (string-to-number (match-string N)) 1056#N (string-to-number (match-string N))
1013& (match-string 0) 1057& (match-string 0)
1014#& (string-to-number (match-string 0)) 1058#& (string-to-number (match-string 0))
1059# replace-count
1015 1060
1016Note that these symbols must be preceeded by a backslash in order to 1061Note that these symbols must be preceeded by a backslash in order to
1017type them." 1062type them."
@@ -1031,7 +1076,9 @@ type them."
1031 ((string= "&" name) 1076 ((string= "&" name)
1032 (setcar n '(match-string 0))) 1077 (setcar n '(match-string 0)))
1033 ((string= "#&" name) 1078 ((string= "#&" name)
1034 (setcar n '(string-to-number (match-string 0)))))))) 1079 (setcar n '(string-to-number (match-string 0))))
1080 ((string= "#" name)
1081 (setcar n 'replace-count))))))
1035 (setq n (cdr n)))) 1082 (setq n (cdr n))))
1036 1083
1037(defun replace-eval-replacement (expression replace-count) 1084(defun replace-eval-replacement (expression replace-count)
@@ -1040,6 +1087,21 @@ type them."
1040 replacement 1087 replacement
1041 (prin1-to-string replacement t)))) 1088 (prin1-to-string replacement t))))
1042 1089
1090(defun replace-quote (replacement)
1091 "Quote a replacement string.
1092This just doubles all backslashes in REPLACEMENT and
1093returns the resulting string. If REPLACEMENT is not
1094a string, it is first passed through `prin1-to-string'
1095with the `noescape' argument set.
1096
1097`match-data' is preserved across the call."
1098 (save-match-data
1099 (replace-regexp-in-string "\\\\" "\\\\"
1100 (if (stringp replacement)
1101 replacement
1102 (prin1-to-string replacement t))
1103 t t)))
1104
1043(defun replace-loop-through-replacements (data replace-count) 1105(defun replace-loop-through-replacements (data replace-count)
1044 ;; DATA is a vector contaning the following values: 1106 ;; DATA is a vector contaning the following values:
1045 ;; 0 next-rotate-count 1107 ;; 0 next-rotate-count
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index c4c6b81e8ba..ea4ade8c30d 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,27 @@
12004-06-23 Luc Teirlinck <teirllm@auburn.edu>
2
3 * lists.texi, files.texi, processes.texi, macros.texi, hash.texi:
4 * frames.texi, buffers.texi, backups.texi, variables.texi:
5 * loading.texi, eval.texi, functions.texi, control.texi:
6 * symbols.texi, minibuf.texi: Reposition @anchor's.
7
8 * help.texi: Various small changes in addition to the following.
9 (Describing Characters): Describe PREFIX argument to
10 `key-description'. Correct and clarify definition of
11 `text-char-description'. Describe NEED-VECTOR argument to
12 `read-kbd-macro'.
13 (Help Functions): Clarify definition of `apropos'.
14
152004-06-23 Lars Hansen <larsh@math.ku.dk>
16
17 * files.texi (Saving Buffers): Correct description of
18 `write-contents-functions'.
19
202004-06-21 Juanma Barranquero <lektu@terra.es>
21
22 * display.texi (Images): Remove redundant @vindex directives.
23 Rewrite `image-library-alist' doc in active voice.
24
12004-06-14 Juanma Barranquero <lektu@terra.es> 252004-06-14 Juanma Barranquero <lektu@terra.es>
2 26
3 * display.texi (Images): Document new delayed library loading, 27 * display.texi (Images): Document new delayed library loading,
diff --git a/lispref/backups.texi b/lispref/backups.texi
index 89edc6d99cf..52cb86dea88 100644
--- a/lispref/backups.texi
+++ b/lispref/backups.texi
@@ -1,6 +1,6 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1999 3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2004
4@c Free Software Foundation, Inc. 4@c Free Software Foundation, Inc.
5@c See the file elisp.texi for copying conditions. 5@c See the file elisp.texi for copying conditions.
6@setfilename ../info/backups 6@setfilename ../info/backups
@@ -713,6 +713,7 @@ reverts the file without asking the user for confirmation.
713buffer-local bindings for these variables: 713buffer-local bindings for these variables:
714 714
715@defvar revert-buffer-function 715@defvar revert-buffer-function
716@anchor{Definition of revert-buffer-function}
716The value of this variable is the function to use to revert this 717The value of this variable is the function to use to revert this
717buffer. If non-@code{nil}, it should be a function with two optional 718buffer. If non-@code{nil}, it should be a function with two optional
718arguments to do the work of reverting. The two optional arguments, 719arguments to do the work of reverting. The two optional arguments,
diff --git a/lispref/buffers.texi b/lispref/buffers.texi
index 723dae742ab..8391159c088 100644
--- a/lispref/buffers.texi
+++ b/lispref/buffers.texi
@@ -1,6 +1,6 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999 3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2004
4@c Free Software Foundation, Inc. 4@c Free Software Foundation, Inc.
5@c See the file elisp.texi for copying conditions. 5@c See the file elisp.texi for copying conditions.
6@setfilename ../info/buffers 6@setfilename ../info/buffers
@@ -227,8 +227,8 @@ An error is signaled if @var{buffer-or-name} does not identify an
227existing buffer. 227existing buffer.
228@end defmac 228@end defmac
229 229
230@anchor{Definition of with-temp-buffer}
231@defmac with-temp-buffer body... 230@defmac with-temp-buffer body...
231@anchor{Definition of with-temp-buffer}
232The @code{with-temp-buffer} macro evaluates the @var{body} forms 232The @code{with-temp-buffer} macro evaluates the @var{body} forms
233with a temporary buffer as the current buffer. It saves the identity of 233with a temporary buffer as the current buffer. It saves the identity of
234the current buffer, creates a temporary buffer and makes it current, 234the current buffer, creates a temporary buffer and makes it current,
diff --git a/lispref/control.texi b/lispref/control.texi
index 9ab86697367..e2a1e26b170 100644
--- a/lispref/control.texi
+++ b/lispref/control.texi
@@ -1,6 +1,6 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999 3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2003
4@c Free Software Foundation, Inc. 4@c Free Software Foundation, Inc.
5@c See the file elisp.texi for copying conditions. 5@c See the file elisp.texi for copying conditions.
6@setfilename ../info/control 6@setfilename ../info/control
@@ -784,8 +784,8 @@ contains @samp{%}, it will be interpreted as a format specifier, with
784undesirable results. Instead, use @code{(error "%s" @var{string})}. 784undesirable results. Instead, use @code{(error "%s" @var{string})}.
785@end defun 785@end defun
786 786
787@anchor{Definition of signal}
788@defun signal error-symbol data 787@defun signal error-symbol data
788@anchor{Definition of signal}
789This function signals an error named by @var{error-symbol}. The 789This function signals an error named by @var{error-symbol}. The
790argument @var{data} is a list of additional Lisp objects relevant to the 790argument @var{data} is a list of additional Lisp objects relevant to the
791circumstances of the error. 791circumstances of the error.
diff --git a/lispref/display.texi b/lispref/display.texi
index 1f8868981b7..57af37fe159 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -2892,7 +2892,6 @@ type symbols are @code{xbm}, @code{xpm}, @code{gif}, @code{postscript},
2892@code{pbm}, @code{jpeg}, @code{tiff}, and @code{png}. 2892@code{pbm}, @code{jpeg}, @code{tiff}, and @code{png}.
2893 2893
2894@defvar image-types 2894@defvar image-types
2895@vindex image-types
2896This variable contains a list of those image type symbols that are 2895This variable contains a list of those image type symbols that are
2897potentially supported in the current configuration. 2896potentially supported in the current configuration.
2898@emph{Potentially} here means that Emacs knows about the image types, 2897@emph{Potentially} here means that Emacs knows about the image types,
@@ -2904,7 +2903,6 @@ To know which image types are really available, use
2904@end defvar 2903@end defvar
2905 2904
2906@defvar image-library-alist 2905@defvar image-library-alist
2907@vindex image-library-alist
2908This in an alist of image types vs external libraries needed to 2906This in an alist of image types vs external libraries needed to
2909display them. 2907display them.
2910 2908
@@ -2913,9 +2911,9 @@ where the car is a supported image format from @code{image-types}, and
2913the rest are strings giving alternate filenames for the corresponding 2911the rest are strings giving alternate filenames for the corresponding
2914external libraries to load. 2912external libraries to load.
2915 2913
2916They are tried in the order they appear on the list; if none of them 2914Emacs tries to load the libraries in the order they appear on the
2917can be loaded, the running session of Emacs won't support the image 2915list; if none is loaded, the running session of Emacs won't support
2918type. No entries are needed for @code{pbm} and @code{xbm} images; 2916the image type. @code{pbm} and @code{xbm} don't need to be listed;
2919they're always supported. 2917they're always supported.
2920 2918
2921This variable is ignored if the image libraries are statically linked 2919This variable is ignored if the image libraries are statically linked
@@ -2925,9 +2923,9 @@ into Emacs.
2925@defun image-type-available-p type 2923@defun image-type-available-p type
2926@findex image-type-available-p 2924@findex image-type-available-p
2927 2925
2928This function returns non-nil if image type TYPE is available, i.e., 2926This function returns non-nil if image type @var{TYPE} is available,
2929if images of this type can be loaded and displayed in Emacs. TYPE 2927i.e., if images of this type can be loaded and displayed in Emacs.
2930should be one of the types contained in @code{image-types}. 2928@var{TYPE} should be one of the types contained in @code{image-types}.
2931 2929
2932For image types whose support libraries are statically linked, this 2930For image types whose support libraries are statically linked, this
2933function always returns @code{t}; for other image types, it returns 2931function always returns @code{t}; for other image types, it returns
diff --git a/lispref/eval.texi b/lispref/eval.texi
index 3c8a7a5e8a3..6a43466af67 100644
--- a/lispref/eval.texi
+++ b/lispref/eval.texi
@@ -1,6 +1,6 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1998 Free Software Foundation, Inc. 3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1998, 2003, 2004 Free Software Foundation, Inc.
4@c See the file elisp.texi for copying conditions. 4@c See the file elisp.texi for copying conditions.
5@setfilename ../info/eval 5@setfilename ../info/eval
6@node Evaluation, Control Structures, Symbols, Top 6@node Evaluation, Control Structures, Symbols, Top
@@ -313,8 +313,8 @@ symbol function indirection when calling @code{erste}.
313perform symbol function indirection explicitly. 313perform symbol function indirection explicitly.
314 314
315@c Emacs 19 feature 315@c Emacs 19 feature
316@anchor{Definition of indirect-function}
317@defun indirect-function function 316@defun indirect-function function
317@anchor{Definition of indirect-function}
318This function returns the meaning of @var{function} as a function. If 318This function returns the meaning of @var{function} as a function. If
319@var{function} is a symbol, then it finds @var{function}'s function 319@var{function} is a symbol, then it finds @var{function}'s function
320definition and starts over with that value. If @var{function} is not a 320definition and starts over with that value. If @var{function} is not a
@@ -630,8 +630,8 @@ The number of currently active calls to @code{eval} is limited to
630@code{max-lisp-eval-depth} (see below). 630@code{max-lisp-eval-depth} (see below).
631@end defun 631@end defun
632 632
633@anchor{Definition of eval-region}
634@deffn Command eval-region start end &optional stream read-function 633@deffn Command eval-region start end &optional stream read-function
634@anchor{Definition of eval-region}
635This function evaluates the forms in the current buffer in the region 635This function evaluates the forms in the current buffer in the region
636defined by the positions @var{start} and @var{end}. It reads forms from 636defined by the positions @var{start} and @var{end}. It reads forms from
637the region and calls @code{eval} on them until the end of the region is 637the region and calls @code{eval} on them until the end of the region is
@@ -674,8 +674,8 @@ output of the output functions is printed in the echo area.
674@code{eval-current-buffer} is an alias for this command. 674@code{eval-current-buffer} is an alias for this command.
675@end deffn 675@end deffn
676 676
677@anchor{Definition of max-lisp-eval-depth}
678@defvar max-lisp-eval-depth 677@defvar max-lisp-eval-depth
678@anchor{Definition of max-lisp-eval-depth}
679This variable defines the maximum depth allowed in calls to @code{eval}, 679This variable defines the maximum depth allowed in calls to @code{eval},
680@code{apply}, and @code{funcall} before an error is signaled (with error 680@code{apply}, and @code{funcall} before an error is signaled (with error
681message @code{"Lisp nesting exceeds max-lisp-eval-depth"}). 681message @code{"Lisp nesting exceeds max-lisp-eval-depth"}).
diff --git a/lispref/files.texi b/lispref/files.texi
index aa5b0c397b1..42b07879186 100644
--- a/lispref/files.texi
+++ b/lispref/files.texi
@@ -329,8 +329,8 @@ With an argument of 0, unconditionally do @emph{not} make any backup file.
329@end itemize 329@end itemize
330@end deffn 330@end deffn
331 331
332@anchor{Definition of save-some-buffers}
333@deffn Command save-some-buffers &optional save-silently-p pred 332@deffn Command save-some-buffers &optional save-silently-p pred
333@anchor{Definition of save-some-buffers}
334This command saves some modified file-visiting buffers. Normally it 334This command saves some modified file-visiting buffers. Normally it
335asks the user about each buffer. But if @var{save-silently-p} is 335asks the user about each buffer. But if @var{save-silently-p} is
336non-@code{nil}, it saves all the file-visiting buffers without querying 336non-@code{nil}, it saves all the file-visiting buffers without querying
@@ -352,8 +352,8 @@ whether to offer to save that buffer. If it returns a non-@code{nil}
352value in a certain buffer, that means do offer to save that buffer. 352value in a certain buffer, that means do offer to save that buffer.
353@end deffn 353@end deffn
354 354
355@anchor{Definition of write-file}
356@deffn Command write-file filename &optional confirm 355@deffn Command write-file filename &optional confirm
356@anchor{Definition of write-file}
357This function writes the current buffer into file @var{filename}, makes 357This function writes the current buffer into file @var{filename}, makes
358the buffer visit that file, and marks it not modified. Then it renames 358the buffer visit that file, and marks it not modified. Then it renames
359the buffer based on @var{filename}, appending a string like @samp{<2>} 359the buffer based on @var{filename}, appending a string like @samp{<2>}
@@ -416,11 +416,12 @@ Even though this is not a normal hook, you can use @code{add-hook} and
416@c Emacs 19 feature 416@c Emacs 19 feature
417@defvar write-contents-functions 417@defvar write-contents-functions
418This works just like @code{write-file-functions}, but it is intended for 418This works just like @code{write-file-functions}, but it is intended for
419hooks that pertain to the contents of the file, as opposed to hooks that 419hooks that pertain to the contents of the buffer, as opposed to hooks that
420pertain to where the file came from. Such hooks are usually set up by 420pertain to the file the buffers visits. Such hooks are usually set up by
421major modes, as buffer-local bindings for this variable. If any of the 421major modes, as buffer-local bindings for this variable. If any of the
422functions in this hook returns non-@code{nil}, @code{write-file-functions} 422functions in this hook returns non-@code{nil}, the file is considered
423is not run. 423already written and the rest are not called and neither are the functions
424in @code{write-file-functions}.
424 425
425This variable automatically becomes buffer-local whenever it is set; 426This variable automatically becomes buffer-local whenever it is set;
426switching to a new major mode always resets this variable, but 427switching to a new major mode always resets this variable, but
@@ -625,8 +626,8 @@ feature is useful for programs that use files for internal purposes,
625files that the user does not need to know about. 626files that the user does not need to know about.
626@end deffn 627@end deffn
627 628
628@anchor{Definition of with-temp-file}
629@defmac with-temp-file file body... 629@defmac with-temp-file file body...
630@anchor{Definition of with-temp-file}
630The @code{with-temp-file} macro evaluates the @var{body} forms with a 631The @code{with-temp-file} macro evaluates the @var{body} forms with a
631temporary buffer as the current buffer; then, at the end, it writes the 632temporary buffer as the current buffer; then, at the end, it writes the
632buffer contents into file @var{file}. It kills the temporary buffer 633buffer contents into file @var{file}. It kills the temporary buffer
@@ -1124,8 +1125,8 @@ link to.
1124@end example 1125@end example
1125@end defun 1126@end defun
1126 1127
1127@anchor{Definition of file-attributes}
1128@defun file-attributes filename &optional id-format 1128@defun file-attributes filename &optional id-format
1129@anchor{Definition of file-attributes}
1129This function returns a list of attributes of file @var{filename}. If 1130This function returns a list of attributes of file @var{filename}. If
1130the specified file cannot be opened, it returns @code{nil}. 1131the specified file cannot be opened, it returns @code{nil}.
1131The optional parameter @var{id-format} specifies the preferred format 1132The optional parameter @var{id-format} specifies the preferred format
@@ -1823,8 +1824,8 @@ and so on.
1823 To convert a directory name to its abbreviation, use this 1824 To convert a directory name to its abbreviation, use this
1824function: 1825function:
1825 1826
1826@anchor{Definition of abbreviate-file-name}
1827@defun abbreviate-file-name filename 1827@defun abbreviate-file-name filename
1828@anchor{Definition of abbreviate-file-name}
1828This function applies abbreviations from @code{directory-abbrev-alist} 1829This function applies abbreviations from @code{directory-abbrev-alist}
1829to its argument, and substitutes @samp{~} for the user's home 1830to its argument, and substitutes @samp{~} for the user's home
1830directory. You can use it for directory names and for file names, 1831directory. You can use it for directory names and for file names,
@@ -1951,8 +1952,8 @@ default-directory
1951@end example 1952@end example
1952@end defvar 1953@end defvar
1953 1954
1954@anchor{Definition of substitute-in-file-name}
1955@defun substitute-in-file-name filename 1955@defun substitute-in-file-name filename
1956@anchor{Definition of substitute-in-file-name}
1956This function replaces environment variable references in 1957This function replaces environment variable references in
1957@var{filename} with the environment variable values. Following 1958@var{filename} with the environment variable values. Following
1958standard Unix shell syntax, @samp{$} is the prefix to substitute an 1959standard Unix shell syntax, @samp{$} is the prefix to substitute an
diff --git a/lispref/frames.texi b/lispref/frames.texi
index 0be4c525822..fe3bca7c119 100644
--- a/lispref/frames.texi
+++ b/lispref/frames.texi
@@ -1503,8 +1503,8 @@ This function returns the contents of cut buffer number @var{n}.
1503If omitted @var{n} defaults to 0. 1503If omitted @var{n} defaults to 0.
1504@end defun 1504@end defun
1505 1505
1506@anchor{Definition of x-set-cut-buffer}
1507@defun x-set-cut-buffer string &optional push 1506@defun x-set-cut-buffer string &optional push
1507@anchor{Definition of x-set-cut-buffer}
1508This function stores @var{string} into the first cut buffer (cut buffer 1508This function stores @var{string} into the first cut buffer (cut buffer
15090). If @var{push} is @code{nil}, only the first cut buffer is changed. 15090). If @var{push} is @code{nil}, only the first cut buffer is changed.
1510If @var{push} is non-@code{nil}, that says to move the values down 1510If @var{push} is non-@code{nil}, that says to move the values down
@@ -1793,8 +1793,8 @@ This function returns @code{t} if the screen can display shades of gray.
1793(All color displays can do this.) 1793(All color displays can do this.)
1794@end defun 1794@end defun
1795 1795
1796@anchor{Display Face Attribute Testing}
1797@defun display-supports-face-attributes-p attributes &optional display 1796@defun display-supports-face-attributes-p attributes &optional display
1797@anchor{Display Face Attribute Testing}
1798@tindex display-supports-face-attributes-p 1798@tindex display-supports-face-attributes-p
1799This function returns non-@code{nil} if all the face attributes in 1799This function returns non-@code{nil} if all the face attributes in
1800@var{attributes} are supported (@pxref{Face Attributes}). 1800@var{attributes} are supported (@pxref{Face Attributes}).
diff --git a/lispref/functions.texi b/lispref/functions.texi
index 427389b4a68..5c7433507b0 100644
--- a/lispref/functions.texi
+++ b/lispref/functions.texi
@@ -1,6 +1,6 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999 3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2004
4@c Free Software Foundation, Inc. 4@c Free Software Foundation, Inc.
5@c See the file elisp.texi for copying conditions. 5@c See the file elisp.texi for copying conditions.
6@setfilename ../info/functions 6@setfilename ../info/functions
@@ -577,8 +577,8 @@ defined is often done deliberately, and there is no way to distinguish
577deliberate redefinition from unintentional redefinition. 577deliberate redefinition from unintentional redefinition.
578@end defspec 578@end defspec
579 579
580@anchor{Definition of defalias}
581@defun defalias name definition &optional docstring 580@defun defalias name definition &optional docstring
581@anchor{Definition of defalias}
582This special form defines the symbol @var{name} as a function, with 582This special form defines the symbol @var{name} as a function, with
583definition @var{definition} (which can be any valid Lisp function). 583definition @var{definition} (which can be any valid Lisp function).
584It returns @var{definition}. 584It returns @var{definition}.
@@ -752,8 +752,8 @@ is a sparse array whose nominal range of indices is very large. To map
752over a char-table in a way that deals properly with its sparse nature, 752over a char-table in a way that deals properly with its sparse nature,
753use the function @code{map-char-table} (@pxref{Char-Tables}). 753use the function @code{map-char-table} (@pxref{Char-Tables}).
754 754
755@anchor{Definition of mapcar}
756@defun mapcar function sequence 755@defun mapcar function sequence
756@anchor{Definition of mapcar}
757@code{mapcar} applies @var{function} to each element of @var{sequence} 757@code{mapcar} applies @var{function} to each element of @var{sequence}
758in turn, and returns a list of the results. 758in turn, and returns a list of the results.
759 759
diff --git a/lispref/hash.texi b/lispref/hash.texi
index bf4555d3903..107935f1ba0 100644
--- a/lispref/hash.texi
+++ b/lispref/hash.texi
@@ -205,8 +205,8 @@ table.
205@end defun 205@end defun
206 206
207@tindex maphash 207@tindex maphash
208@anchor{Definition of maphash}
209@defun maphash function table 208@defun maphash function table
209@anchor{Definition of maphash}
210This function calls @var{function} once for each of the associations in 210This function calls @var{function} once for each of the associations in
211@var{table}. The function @var{function} should accept two 211@var{table}. The function @var{function} should accept two
212arguments---a @var{key} listed in @var{table}, and its associated 212arguments---a @var{key} listed in @var{table}, and its associated
diff --git a/lispref/help.texi b/lispref/help.texi
index 9a55ebf6724..ddc52253a80 100644
--- a/lispref/help.texi
+++ b/lispref/help.texi
@@ -1,6 +1,6 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999 3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2004
4@c Free Software Foundation, Inc. 4@c Free Software Foundation, Inc.
5@c See the file elisp.texi for copying conditions. 5@c See the file elisp.texi for copying conditions.
6@setfilename ../info/help 6@setfilename ../info/help
@@ -59,7 +59,7 @@ view the documentation string. @xref{Documentation Tips}.
59stand for key bindings to be looked up in the current keymaps when the 59stand for key bindings to be looked up in the current keymaps when the
60documentation is displayed. This allows documentation strings to refer 60documentation is displayed. This allows documentation strings to refer
61to the keys for related commands and be accurate even when a user 61to the keys for related commands and be accurate even when a user
62rearranges the key bindings. (@xref{Accessing Documentation}.) 62rearranges the key bindings. (@xref{Keys in Documentation}.)
63 63
64 In Emacs Lisp, a documentation string is accessible through the 64 In Emacs Lisp, a documentation string is accessible through the
65function or variable that it describes: 65function or variable that it describes:
@@ -260,8 +260,8 @@ as shown above for the @code{goal-column} variable, means that it is a
260user option; see the description of @code{defvar} in @ref{Defining 260user option; see the description of @code{defvar} in @ref{Defining
261Variables}. 261Variables}.
262 262
263@anchor{Definition of Snarf-documentation}
264@defun Snarf-documentation filename 263@defun Snarf-documentation filename
264@anchor{Definition of Snarf-documentation}
265This function is used only during Emacs initialization, just before 265This function is used only during Emacs initialization, just before
266the runnable Emacs is dumped. It finds the file offsets of the 266the runnable Emacs is dumped. It finds the file offsets of the
267documentation strings stored in the file @var{filename}, and records 267documentation strings stored in the file @var{filename}, and records
@@ -282,8 +282,7 @@ built-in and preloaded functions and variables.
282 282
283In most cases, this is the same as @code{data-directory}. They may be 283In most cases, this is the same as @code{data-directory}. They may be
284different when you run Emacs from the directory where you built it, 284different when you run Emacs from the directory where you built it,
285without actually installing it. See @code{data-directory} in @ref{Help 285without actually installing it. @xref{Definition of data-directory}.
286Functions}.
287 286
288In older Emacs versions, @code{exec-directory} was used for this. 287In older Emacs versions, @code{exec-directory} was used for this.
289@end defvar 288@end defvar
@@ -375,13 +374,27 @@ convert non-printing and whitespace characters to sequences of printing
375characters. The description of a non-whitespace printing character is 374characters. The description of a non-whitespace printing character is
376the character itself. 375the character itself.
377 376
378@defun key-description sequence 377@defun key-description sequence &optional prefix
379@cindex Emacs event standard notation 378@cindex Emacs event standard notation
380This function returns a string containing the Emacs standard notation 379This function returns a string containing the Emacs standard notation
381for the input events in @var{sequence}. The argument @var{sequence} may 380for the input events in @var{sequence}. If @var{prefix} is
382be a string, vector or list. @xref{Input Events}, for more information 381non-@code{nil}, it is a sequence of input events leading up to
383about valid events. See also the examples for 382@var{sequence} and is included in the return value. Both arguments
384@code{single-key-description}, below. 383may be strings, vectors or lists. @xref{Input Events}, for more
384information about valid events.
385
386@smallexample
387@group
388(key-description [?\M-3 delete])
389 @result{} "M-3 <delete>"
390@end group
391@group
392(key-description [delete] "\M-3")
393 @result{} "M-3 <delete>"
394@end group
395@end smallexample
396
397 See also the examples for @code{single-key-description}, below.
385@end defun 398@end defun
386 399
387@defun single-key-description event &optional no-angles 400@defun single-key-description event &optional no-angles
@@ -432,8 +445,10 @@ This function returns a string describing @var{character} in the
432standard Emacs notation for characters that appear in text---like 445standard Emacs notation for characters that appear in text---like
433@code{single-key-description}, except that control characters are 446@code{single-key-description}, except that control characters are
434represented with a leading caret (which is how control characters in 447represented with a leading caret (which is how control characters in
435Emacs buffers are usually displayed) and character codes 128 448Emacs buffers are usually displayed). Another difference is that
436and above are not treated as Meta characters. 449@code{text-char-description} recognizes the 2**7 bit as the Meta
450character, whereas @code{single-key-description} uses the 2**27 bit
451for Meta.
437 452
438@smallexample 453@smallexample
439@group 454@group
@@ -448,16 +463,25 @@ and above are not treated as Meta characters.
448(text-char-description ?\C-\M-m) 463(text-char-description ?\C-\M-m)
449 @result{} "\x8d" 464 @result{} "\x8d"
450@end group 465@end group
466@group
467(text-char-description (+ 128 ?m))
468 @result{} "M-m"
469@end group
470@group
471(text-char-description (+ 128 ?\C-m))
472 @result{} "M-^M"
473@end group
451@end smallexample 474@end smallexample
452@end defun 475@end defun
453 476
454@defun read-kbd-macro string 477@defun read-kbd-macro string &optional need-vector
455This function is used mainly for operating on keyboard macros, but it 478This function is used mainly for operating on keyboard macros, but it
456can also be used as a rough inverse for @code{key-description}. You 479can also be used as a rough inverse for @code{key-description}. You
457call it with a string containing key descriptions, separated by spaces; 480call it with a string containing key descriptions, separated by spaces;
458it returns a string or vector containing the corresponding events. 481it returns a string or vector containing the corresponding events.
459(This may or may not be a single valid key sequence, depending on what 482(This may or may not be a single valid key sequence, depending on what
460events you use; @pxref{Keymap Terminology}.) 483events you use; @pxref{Keymap Terminology}.) If @var{need-vector} is
484non-@code{nil}, the return value is always a vector.
461@end defun 485@end defun
462 486
463@node Help Functions 487@node Help Functions
@@ -469,29 +493,20 @@ about them, see @ref{Help, , Help, emacs, The GNU Emacs Manual}. Here
469we describe some program-level interfaces to the same information. 493we describe some program-level interfaces to the same information.
470 494
471@deffn Command apropos regexp &optional do-all 495@deffn Command apropos regexp &optional do-all
472This function finds all symbols whose names contain a match for the 496This function finds all ``meaningful'' symbols whose names contain a
473regular expression @var{regexp}, and returns a list of them 497match for the regular expression @var{regexp}, and returns a list of
474(@pxref{Regular Expressions}). It also displays the symbols in a buffer 498them, with associated documentation (@pxref{Regular Expressions}). It
475named @samp{*Help*}, each with a one-line description taken from the 499also displays the symbols in a buffer named @samp{*Apropos*}, each
476beginning of its documentation string. 500with a one-line description taken from the beginning of its
501documentation string. A symbol is ``meaningful'' if it has a
502definition as a function, variable, or face, or has properties.
477 503
478@c Emacs 19 feature 504@c Emacs 19 feature
479If @var{do-all} is non-@code{nil}, then @code{apropos} also shows key 505If @var{do-all} is non-@code{nil}, or if the user option
480bindings for the functions that are found; it also shows all symbols, 506@code{apropos-do-all} is non-@code{nil}, then @code{apropos} also
481even those that are neither functions nor variables. 507shows key bindings for the functions that are found; it also shows
482 508@emph{all} interned symbols, not just meaningful ones (and it lists
483In the first of the following examples, @code{apropos} finds all the 509them in the return value as well).
484symbols with names containing @samp{exec}. (We don't show here the
485output that results in the @samp{*Help*} buffer.)
486
487@smallexample
488@group
489(apropos "exec")
490 @result{} (Buffer-menu-execute command-execute exec-directory
491 exec-path execute-extended-command execute-kbd-macro
492 executing-kbd-macro executing-macro)
493@end group
494@end smallexample
495@end deffn 510@end deffn
496 511
497@defvar help-map 512@defvar help-map
@@ -506,7 +521,7 @@ follows:
506 521
507@smallexample 522@smallexample
508@group 523@group
509(define-key global-map "\C-h" 'help-command) 524(define-key global-map (char-to-string help-char) 'help-command)
510(fset 'help-command help-map) 525(fset 'help-command help-map)
511@end group 526@end group
512@end smallexample 527@end smallexample
@@ -562,7 +577,7 @@ some other meaning.) Evaluating this expression should result in a
562string that explains what the input is for and how to enter it properly. 577string that explains what the input is for and how to enter it properly.
563 578
564Entry to the minibuffer binds this variable to the value of 579Entry to the minibuffer binds this variable to the value of
565@code{minibuffer-help-form} (@pxref{Minibuffer Misc}). 580@code{minibuffer-help-form} (@pxref{Definition of minibuffer-help-form}).
566@end defvar 581@end defvar
567 582
568@defvar prefix-help-command 583@defvar prefix-help-command
@@ -601,6 +616,7 @@ This can be customized by changing the map @code{Helper-help-map}.
601 616
602@c Emacs 19 feature 617@c Emacs 19 feature
603@defvar data-directory 618@defvar data-directory
619@anchor{Definition of data-directory}
604This variable holds the name of the directory in which Emacs finds 620This variable holds the name of the directory in which Emacs finds
605certain documentation and text files that come with Emacs. In older 621certain documentation and text files that come with Emacs. In older
606Emacs versions, @code{exec-directory} was used for this. 622Emacs versions, @code{exec-directory} was used for this.
diff --git a/lispref/lists.texi b/lispref/lists.texi
index 2aa3c40b0e5..d30dcb0c270 100644
--- a/lispref/lists.texi
+++ b/lispref/lists.texi
@@ -1,6 +1,7 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999 3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999,
4@c 2003, 2004
4@c Free Software Foundation, Inc. 5@c Free Software Foundation, Inc.
5@c See the file elisp.texi for copying conditions. 6@c See the file elisp.texi for copying conditions.
6@setfilename ../info/lists 7@setfilename ../info/lists
@@ -348,8 +349,8 @@ x
348@end example 349@end example
349@end defmac 350@end defmac
350 351
351@anchor{Definition of nth}
352@defun nth n list 352@defun nth n list
353@anchor{Definition of nth}
353This function returns the @var{n}th element of @var{list}. Elements 354This function returns the @var{n}th element of @var{list}. Elements
354are numbered starting with zero, so the @sc{car} of @var{list} is 355are numbered starting with zero, so the @sc{car} of @var{list} is
355element number zero. If the length of @var{list} is @var{n} or less, 356element number zero. If the length of @var{list} is @var{n} or less,
@@ -413,8 +414,8 @@ this link is the list's last element. If @var{list} is null,
413if @var{n} is bigger than @var{list}'s length. 414if @var{n} is bigger than @var{list}'s length.
414@end defun 415@end defun
415 416
416@anchor{Definition of safe-length}
417@defun safe-length list 417@defun safe-length list
418@anchor{Definition of safe-length}
418This function returns the length of @var{list}, with no risk of either 419This function returns the length of @var{list}, with no risk of either
419an error or an infinite loop. It generally returns the number of 420an error or an infinite loop. It generally returns the number of
420distinct cons cells in the list. However, for circular lists, 421distinct cons cells in the list. However, for circular lists,
diff --git a/lispref/loading.texi b/lispref/loading.texi
index 4d13e48def5..1b90ef5f2dd 100644
--- a/lispref/loading.texi
+++ b/lispref/loading.texi
@@ -1,6 +1,7 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999 3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999,
4@c 2003, 2004
4@c Free Software Foundation, Inc. 5@c Free Software Foundation, Inc.
5@c See the file elisp.texi for copying conditions. 6@c See the file elisp.texi for copying conditions.
6@setfilename ../info/loading 7@setfilename ../info/loading
@@ -140,8 +141,8 @@ This variable is non-@code{nil} if Emacs is in the process of loading a
140file, and it is @code{nil} otherwise. 141file, and it is @code{nil} otherwise.
141@end defvar 142@end defvar
142 143
143@anchor{Definition of load-read-function}
144@defvar load-read-function 144@defvar load-read-function
145@anchor{Definition of load-read-function}
145This variable specifies an alternate expression-reading function for 146This variable specifies an alternate expression-reading function for
146@code{load} and @code{eval-region} to use instead of @code{read}. 147@code{load} and @code{eval-region} to use instead of @code{read}.
147The function should accept one argument, just as @code{read} does. 148The function should accept one argument, just as @code{read} does.
diff --git a/lispref/macros.texi b/lispref/macros.texi
index b940125cb87..e903a159c27 100644
--- a/lispref/macros.texi
+++ b/lispref/macros.texi
@@ -232,8 +232,8 @@ called interactively.
232which can specify how @key{TAB} should indent macro calls, and how to 232which can specify how @key{TAB} should indent macro calls, and how to
233step through them for Edebug. 233step through them for Edebug.
234 234
235@anchor{Definition of declare}
236@defmac declare @var{specs}@dots{} 235@defmac declare @var{specs}@dots{}
236@anchor{Definition of declare}
237A @code{declare} form is used in a macro definition to specify various 237A @code{declare} form is used in a macro definition to specify various
238additional information about it. Two kinds of specification are 238additional information about it. Two kinds of specification are
239currently supported: 239currently supported:
diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi
index a2695eab6b9..8e8329967f3 100644
--- a/lispref/minibuf.texi
+++ b/lispref/minibuf.texi
@@ -1,6 +1,7 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001 3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999,
4@c 2001, 2004
4@c Free Software Foundation, Inc. 5@c Free Software Foundation, Inc.
5@c See the file elisp.texi for copying conditions. 6@c See the file elisp.texi for copying conditions.
6@setfilename ../info/minibuf 7@setfilename ../info/minibuf
@@ -214,8 +215,8 @@ functions that do minibuffer input with completion, discard text
214properties unconditionally, regardless of the value of this variable. 215properties unconditionally, regardless of the value of this variable.
215@end defvar 216@end defvar
216 217
217@anchor{Definition of minibuffer-local-map}
218@defvar minibuffer-local-map 218@defvar minibuffer-local-map
219@anchor{Definition of minibuffer-local-map}
219This is the default local keymap for reading from the minibuffer. By 220This is the default local keymap for reading from the minibuffer. By
220default, it makes the following bindings: 221default, it makes the following bindings:
221 222
@@ -531,7 +532,7 @@ etc.
531 532
532Use of a cons cell as the value for @var{initial} arguments is 533Use of a cons cell as the value for @var{initial} arguments is
533deprecated in user code. 534deprecated in user code.
534 535
535@node Completion 536@node Completion
536@section Completion 537@section Completion
537@cindex completion 538@cindex completion
@@ -726,8 +727,8 @@ example for @code{try-completion}:
726@end smallexample 727@end smallexample
727@end defun 728@end defun
728 729
729@anchor{Definition of test-completion}
730@defun test-completion string collection &optional predicate 730@defun test-completion string collection &optional predicate
731@anchor{Definition of test-completion}
731This function returns non-@code{nil} if @var{string} is a valid 732This function returns non-@code{nil} if @var{string} is a valid
732completion possibility specified by @var{collection} and 733completion possibility specified by @var{collection} and
733@var{predicate}. The arguments are the same as in 734@var{predicate}. The arguments are the same as in
@@ -1755,6 +1756,7 @@ This is a normal hook that is run whenever the minibuffer is exited.
1755@end defvar 1756@end defvar
1756 1757
1757@defvar minibuffer-help-form 1758@defvar minibuffer-help-form
1759@anchor{Definition of minibuffer-help-form}
1758The current value of this variable is used to rebind @code{help-form} 1760The current value of this variable is used to rebind @code{help-form}
1759locally inside the minibuffer (@pxref{Help Functions}). 1761locally inside the minibuffer (@pxref{Help Functions}).
1760@end defvar 1762@end defvar
diff --git a/lispref/processes.texi b/lispref/processes.texi
index a4166ee29a0..f580a774ae7 100644
--- a/lispref/processes.texi
+++ b/lispref/processes.texi
@@ -676,8 +676,8 @@ instead of a terminal (see @code{process-connection-type} in
676@ref{Asynchronous Processes}). 676@ref{Asynchronous Processes}).
677@end defun 677@end defun
678 678
679@anchor{Coding systems for a subprocess}
680@defun process-coding-system process 679@defun process-coding-system process
680@anchor{Coding systems for a subprocess}
681This function returns a cons cell describing the coding systems in use 681This function returns a cons cell describing the coding systems in use
682for decoding output from @var{process} and for encoding input to 682for decoding output from @var{process} and for encoding input to
683@var{process} (@pxref{Coding Systems}). The value has this form: 683@var{process} (@pxref{Coding Systems}). The value has this form:
diff --git a/lispref/symbols.texi b/lispref/symbols.texi
index 632f2cc5174..d6743898d6f 100644
--- a/lispref/symbols.texi
+++ b/lispref/symbols.texi
@@ -1,6 +1,6 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999 3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2003
4@c Free Software Foundation, Inc. 4@c Free Software Foundation, Inc.
5@c See the file elisp.texi for copying conditions. 5@c See the file elisp.texi for copying conditions.
6@setfilename ../info/symbols 6@setfilename ../info/symbols
@@ -360,8 +360,8 @@ This variable is the standard obarray for use by @code{intern} and
360@code{read}. 360@code{read}.
361@end defvar 361@end defvar
362 362
363@anchor{Definition of mapatoms}
364@defun mapatoms function &optional obarray 363@defun mapatoms function &optional obarray
364@anchor{Definition of mapatoms}
365This function calls @var{function} once with each symbol in the obarray 365This function calls @var{function} once with each symbol in the obarray
366@var{obarray}. Then it returns @code{nil}. If @var{obarray} is 366@var{obarray}. Then it returns @code{nil}. If @var{obarray} is
367omitted, it defaults to the value of @code{obarray}, the standard 367omitted, it defaults to the value of @code{obarray}, the standard
diff --git a/lispref/variables.texi b/lispref/variables.texi
index c395702a40a..1f793b8f03f 100644
--- a/lispref/variables.texi
+++ b/lispref/variables.texi
@@ -1,6 +1,7 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual. 2@c This is part of the GNU Emacs Lisp Reference Manual.
3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000 3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999,
4@c 2000, 2003, 2004
4@c Free Software Foundation, Inc. 5@c Free Software Foundation, Inc.
5@c See the file elisp.texi for copying conditions. 6@c See the file elisp.texi for copying conditions.
6@setfilename ../info/variables 7@setfilename ../info/variables
@@ -260,8 +261,8 @@ These kinds of bindings work somewhat like ordinary local bindings, but
260they are localized depending on ``where'' you are in Emacs, rather than 261they are localized depending on ``where'' you are in Emacs, rather than
261localized in time. 262localized in time.
262 263
263@anchor{Definition of max-specpdl-size}
264@defvar max-specpdl-size 264@defvar max-specpdl-size
265@anchor{Definition of max-specpdl-size}
265@cindex variable limit error 266@cindex variable limit error
266@cindex evaluation error 267@cindex evaluation error
267@cindex infinite recursion 268@cindex infinite recursion
diff --git a/make-dist b/make-dist
index 78ce196a3da..8cfc41ccd25 100755
--- a/make-dist
+++ b/make-dist
@@ -406,6 +406,7 @@ echo "Making links to \`leim' and its subdirectories"
406 ln MISC-DIC/*.* ../${tempdir}/leim/MISC-DIC 406 ln MISC-DIC/*.* ../${tempdir}/leim/MISC-DIC
407 ln ja-dic/*.el ja-dic/*.elc ../${tempdir}/leim/ja-dic 407 ln ja-dic/*.el ja-dic/*.elc ../${tempdir}/leim/ja-dic
408 ln Makefile.in ../${tempdir}/leim/Makefile.in 408 ln Makefile.in ../${tempdir}/leim/Makefile.in
409 ln leim-ext.el ../${tempdir}/leim/leim-ext.el
409 ln quail/[a-z]*.el quail/[a-z]*.elc ../${tempdir}/leim/quail 410 ln quail/[a-z]*.el quail/[a-z]*.elc ../${tempdir}/leim/quail
410 rm -f ../${tempdir}/leim/quail/quick-b5.* 411 rm -f ../${tempdir}/leim/quail/quick-b5.*
411 rm -f ../${tempdir}/leim/quail/quick-cns.* 412 rm -f ../${tempdir}/leim/quail/quick-cns.*
diff --git a/man/ChangeLog b/man/ChangeLog
index a3216ed4407..3266dbbeab0 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,36 @@
12004-06-21 Nick Roberts <nickrob@gnu.org>
2
3 * misc.texi (Shell History Copying): Document comint-insert-input.
4 (Shell Ring): Describe comint-dynamic-list-input-ring here.
5
62004-06-21 Karl Berry <karl@gnu.org>
7
8 * info.texi (Top): mention that only Emacs has mouse support.
9 (Getting Started): mention this in a few other places.
10
112004-06-20 Jesper Harder <harder@ifa.au.dk>
12
13 * msdog.texi (Text and Binary, MS-DOS Printing): Use m-dash.
14 * custom.texi (Customization): do.
15 * anti.texi (Antinews): do.
16 * abbrevs.texi (Defining Abbrevs): do.
17
18 * programs.texi (Info Lookup): Fix keybinding for
19 info-lookup-symbol.
20
212004-06-16 Juanma Barranquero <lektu@terra.es>
22
23 * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, EMACSSOURCES):
24 Add emacs-xtra.
25 ($(infodir)/emacs-xtra, emacs-xtra.dvi): New dependencies.
26 (clean): Add emacs-xtra and flymake. Remove redundancies.
27
282004-06-15 Luc Teirlinck <teirllm@auburn.edu>
29
30 * Makefile.in (INFO_TARGETS, DVI_TARGETS, ../info/emacs-xtra):
31 Add emacs-xtra.
32 * emacs-xtra.texi: New file.
33
12004-06-14 Luc Teirlinck <teirllm@auburn.edu> 342004-06-14 Luc Teirlinck <teirllm@auburn.edu>
2 35
3 * dired.texi (Dired Enter): Mention conditions on `ls' switches. 36 * dired.texi (Dired Enter): Mention conditions on `ls' switches.
diff --git a/man/Makefile.in b/man/Makefile.in
index 7c2f32e538f..468adf54844 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -33,7 +33,7 @@ VPATH=@srcdir@
33 33
34# The makeinfo program is part of the Texinfo distribution. 34# The makeinfo program is part of the Texinfo distribution.
35MAKEINFO = makeinfo 35MAKEINFO = makeinfo
36INFO_TARGETS = ../info/emacs ../info/ccmode ../info/cl \ 36INFO_TARGETS = ../info/emacs ../info/emacs-xtra ../info/ccmode ../info/cl \
37 ../info/dired-x ../info/ediff ../info/forms ../info/gnus \ 37 ../info/dired-x ../info/ediff ../info/forms ../info/gnus \
38 ../info/info ../info/message ../info/mh-e ../info/reftex \ 38 ../info/info ../info/message ../info/mh-e ../info/reftex \
39 ../info/sc ../info/vip ../info/viper ../info/widget \ 39 ../info/sc ../info/vip ../info/viper ../info/widget \
@@ -47,7 +47,8 @@ DVI_TARGETS = emacs.dvi calc.dvi cc-mode.dvi cl.dvi dired-x.dvi \
47 reftex.dvi sc.dvi vip.dvi viper.dvi widget.dvi faq.dvi \ 47 reftex.dvi sc.dvi vip.dvi viper.dvi widget.dvi faq.dvi \
48 ada-mode.dvi autotype.dvi idlwave.dvi eudc.dvi ebrowse.dvi \ 48 ada-mode.dvi autotype.dvi idlwave.dvi eudc.dvi ebrowse.dvi \
49 pcl-cvs.dvi woman.dvi emacs-mime.dvi eshell.dvi \ 49 pcl-cvs.dvi woman.dvi emacs-mime.dvi eshell.dvi \
50 speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi flymake.dvi 50 speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi flymake.dvi \
51 emacs-xtra.dvi
51INFOSOURCES = info.texi 52INFOSOURCES = info.texi
52 53
53# The following rule does not work with all versions of `make'. 54# The following rule does not work with all versions of `make'.
@@ -174,6 +175,11 @@ dired-x.dvi: dired-x.texi
174ediff.dvi: ediff.texi 175ediff.dvi: ediff.texi
175 $(ENVADD) $(TEXI2DVI) ${srcdir}/ediff.texi 176 $(ENVADD) $(TEXI2DVI) ${srcdir}/ediff.texi
176 177
178../info/emacs-xtra: emacs-xtra.texi
179 cd $(srcdir); $(MAKEINFO) emacs-xtra.texi
180emacs-xtra.dvi: emacs-xtra.texi
181 $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-xtra.texi
182
177../info/forms: forms.texi 183../info/forms: forms.texi
178 cd $(srcdir); $(MAKEINFO) forms.texi 184 cd $(srcdir); $(MAKEINFO) forms.texi
179forms.dvi: forms.texi 185forms.dvi: forms.texi
diff --git a/man/abbrevs.texi b/man/abbrevs.texi
index ce6465564f5..e8cf2dc9c49 100644
--- a/man/abbrevs.texi
+++ b/man/abbrevs.texi
@@ -129,7 +129,7 @@ read with the minibuffer).
129@findex define-global-abbrev 129@findex define-global-abbrev
130 You can define an abbrev without inserting either the abbrev or its 130 You can define an abbrev without inserting either the abbrev or its
131expansion in the buffer using the command @code{define-global-abbrev}. 131expansion in the buffer using the command @code{define-global-abbrev}.
132It reads two arguments--the abbrev, and its expansion. The command 132It reads two arguments---the abbrev, and its expansion. The command
133@code{define-mode-abbrev} does likewise for a mode-specific abbrev. 133@code{define-mode-abbrev} does likewise for a mode-specific abbrev.
134 134
135 To change the definition of an abbrev, just define a new definition. 135 To change the definition of an abbrev, just define a new definition.
diff --git a/man/anti.texi b/man/anti.texi
index edf0031ee8c..242a4301712 100644
--- a/man/anti.texi
+++ b/man/anti.texi
@@ -108,7 +108,7 @@ If you want some other value, you must set it yourself.
108SGML mode does not handle XML syntax, and does not have indentation support. 108SGML mode does not handle XML syntax, and does not have indentation support.
109 109
110@item 110@item
111The @kbd{C-h} subcommands have been rearranged--especially those that 111The @kbd{C-h} subcommands have been rearranged---especially those that
112display specific files. Type @kbd{C-h C-h} to see a list of these 112display specific files. Type @kbd{C-h C-h} to see a list of these
113commands; that will show you what is different. 113commands; that will show you what is different.
114 114
diff --git a/man/custom.texi b/man/custom.texi
index 614fa2442fc..ce52431f3c6 100644
--- a/man/custom.texi
+++ b/man/custom.texi
@@ -12,7 +12,7 @@ Manual} for how to make more far-reaching changes. @xref{X Resources},
12for information on using X resources to customize Emacs. 12for information on using X resources to customize Emacs.
13 13
14 Customization that you do within Emacs normally affects only the 14 Customization that you do within Emacs normally affects only the
15particular Emacs session that you do it in--it does not persist 15particular Emacs session that you do it in---it does not persist
16between sessions unless you save the customization in a file such as 16between sessions unless you save the customization in a file such as
17@file{.emacs} or @file{.Xdefaults} that will affect future sessions. 17@file{.emacs} or @file{.Xdefaults} that will affect future sessions.
18@xref{Init File}. In the customization buffer, when you save 18@xref{Init File}. In the customization buffer, when you save
diff --git a/man/emacs-xtra.texi b/man/emacs-xtra.texi
new file mode 100644
index 00000000000..0d5633d71ca
--- /dev/null
+++ b/man/emacs-xtra.texi
@@ -0,0 +1,313 @@
1\input texinfo @c -*-texinfo-*-
2@comment %**start of header
3@setfilename ../info/emacs-xtra
4@settitle Specialized Emacs Features
5@syncodeindex fn cp
6@syncodeindex vr cp
7@syncodeindex ky cp
8@comment %**end of header
9
10@copying
11This manual describes specialized features of Emacs.
12
13Copyright (C) 2004
14Free Software Foundation, Inc.
15
16@quotation
17Permission is granted to copy, distribute and/or modify this document
18under the terms of the GNU Free Documentation License, Version 1.1 or
19any later version published by the Free Software Foundation; with no
20Invariant Sections, with the Front-Cover texts being ``A GNU
21Manual'', and with the Back-Cover Texts as in (a) below. A copy of the
22license is included in the section entitled ``GNU Free Documentation
23License'' in the Emacs manual.
24
25(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
26this GNU Manual, like GNU software. Copies published by the Free
27Software Foundation raise funds for GNU development.''
28
29This document is part of a collection distributed under the GNU Free
30Documentation License. If you want to distribute this document
31separately from the collection, you can do so by adding a copy of the
32license to the document, as described in section 6 of the license.
33@end quotation
34@end copying
35
36@dircategory Emacs
37@direntry
38* Emacs-Xtra: (emacs-xtra). Specialized Emacs features.
39@end direntry
40
41@titlepage
42@title Specialized Emacs Features
43@page
44@vskip 0pt plus 1filll
45@insertcopying
46@end titlepage
47
48@contents
49
50@ifnottex
51@node Top
52@top Specialized Emacs Features
53
54@insertcopying
55
56@end ifnottex
57
58@menu
59* Introduction:: What documentation belongs here?
60* Autorevert:: Auto Reverting non-file buffers.
61* Subdir switches:: Subdirectory switches in Dired.
62* Index::
63@end menu
64
65@node Introduction
66@unnumbered Introduction
67
68This manual contains detailed information about various features that
69are too specialized to be included in the Emacs manual. It is
70intended to be readable by anyone having a basic knowledge of Emacs.
71However, certain sections may be intended for a more specialized
72audience, such as Elisp authors. This should be clearly pointed out
73at the beginning of these sections.
74
75This manual is intended as a complement, rather than an alternative,
76to other ways to gain a more detailed knowledge of Emacs than the
77Emacs manual can provide, such as browsing packages using @kbd{C-h p},
78accessing mode documentation using @kbd{C-h m} and browsing user
79options using Custom. Also, certain packages, or collections of
80related features, have their own manuals. The present manual is
81mainly intended to be a collection of smaller specialized features,
82too small to get their own manual.
83
84Sections intended specifically for Elisp programmers can follow the
85style of the Elisp manual. Other sections should follow the style of
86the Emacs manual.
87
88@node Autorevert
89@chapter Auto Reverting non-file Buffers
90
91Normally Global Auto Revert Mode only reverts file buffers. There are
92two ways to auto-revert certain non-file buffers: enabling Auto Revert
93Mode in those buffers (using @kbd{M-x auto-revert-mode}) and setting
94@code{global-auto-revert-non-file-buffers} to @code{t}. The latter
95enables Auto Reverting for all types of buffers for which it is
96implemented, that is, for the types of buffers listed in the menu
97below.
98
99Like file buffers, non-file buffers should normally not revert while
100you are working on them, or while they contain information that might
101get lost after reverting. Therefore, they do not revert if they are
102``modified''. This can get tricky, because deciding when a non-file
103buffer should be marked modified is usually more difficult than for
104file buffers.
105
106Another tricky detail is that, for efficiency reasons, Auto Revert
107often does not try to detect all possible changes in the buffer, only
108changes that are ``major'' or easy to detect. Hence, enabling
109auto-reverting for a non-file buffer does not always guarantee that
110all information in the buffer is up to date and does not necessarily
111make manual reverts useless.
112
113At the other extreme, certain buffers automatically auto-revert every
114@code{auto-revert-interval} seconds. (This currently only applies to
115the Buffer Menu.) In this case, Auto Revert does not print any
116messages while reverting, even when @code{auto-revert-verbose} is
117non-@code{nil}.
118
119The details depend on the particular types of buffers and are
120explained in the corresponding sections.
121
122@menu
123* Auto Reverting the Buffer Menu::
124* Auto Reverting Dired::
125* Supporting additional buffers::
126@end menu
127
128@node Auto Reverting the Buffer Menu
129@section Auto Reverting the Buffer Menu
130
131If auto-reverting of non-file buffers is enabled, the Buffer Menu
132automatically reverts every @code{auto-revert-interval} seconds,
133whether there is a need for it or not. (It would probably take longer
134to check whether there is a need than to actually revert.)
135
136If the Buffer Menu inappropriately gets marked modified, just revert
137it manually using @kbd{g} and auto-reverting will resume. However, if
138you marked certain buffers to get deleted or to be displayed, you have
139to be careful, because reverting erases all marks. The fact that
140adding marks sets the buffer's modified flag prevents Auto Revert from
141automatically erasing the marks.
142
143@node Auto Reverting Dired
144@section Auto Reverting Dired buffers
145
146Auto-reverting Dired buffers currently works on GNU or Unix style
147operating systems. It may not work satisfactorily on some other
148systems.
149
150Dired buffers only auto-revert when the file list of the buffer's main
151directory changes. They do not auto-revert when information about a
152particular file changes or when inserted subdirectories change. To be
153sure that @emph{all} listed information is up to date, you have to
154manually revert using @kbd{g}, @emph{even} if auto-reverting is
155enabled in the Dired buffer. Sometimes, you might get the impression
156that modifying or saving files listed in the main directory actually
157does cause auto-reverting. This is because making changes to a file,
158or saving it, very often causes changes in the directory itself, for
159instance, through backup files or auto-save files. However, this is
160not guaranteed.
161
162If the Dired buffer is marked modified and there are no changes you
163want to protect, then most of the time you can make auto-reverting
164resume by manually reverting the buffer using @kbd{g}. There is one
165exception. If you flag or mark files, you can safely revert the
166buffer. This will not erase the flags or marks (unless the marked
167file has been deleted, of course). However, the buffer will stay
168modified, even after reverting, and auto-reverting will not resume.
169This is because, if you flag or mark files, you may be working on the
170buffer and you might not want the buffer to change without warning.
171If you want auto-reverting to resume in the presence of marks and
172flags, mark the buffer non-modified using @kbd{M-~}. However, adding,
173deleting or changing marks or flags will mark it modified again.
174
175Remote Dired buffers are not auto-reverted. Neither are Dired buffers
176for which you used shell wildcards or file arguments to list only some
177of the files. @samp{*Find*} and @samp{*Locate*} buffers do not
178auto-revert either.
179
180@node Supporting additional buffers
181@section Adding Support for Auto-Reverting additional Buffers.
182
183This section is intended for Elisp programmers who would like to add
184support for auto-reverting new types of buffers.
185
186To support auto-reverting the buffer must first of all have a
187@code{revert-buffer-function}. @xref{Definition of
188revert-buffer-function,, Reverting, elisp, the Emacs Lisp Reference Manual}.
189
190In addition, it @emph{must} have a @code{buffer-stale-function}.
191
192@defvar buffer-stale-function
193The value of this variable is a function to check whether a non-file
194buffer needs reverting. This should be a function with one optional
195argument @var{noconfirm}. The function should return non-@code{nil}
196if the buffer should be reverted. The buffer is current when this
197function is called.
198
199While this function is mainly intended for use in auto-reverting, it
200could be used for other purposes as well. For instance, if
201auto-reverting is not enabled, it could be used to warn the user that
202the buffer needs reverting. The idea behind the @var{noconfirm}
203argument is that it should be @code{t} if the buffer is going to be
204reverted without asking the user and @code{nil} if the function is
205just going to be used to warn the user that the buffer is out of date.
206In particular, for use in auto-reverting, @var{noconfirm} is @code{t}.
207If the function is only going to be used for auto-reverting, you can
208ignore the @var{noconfirm} argument.
209
210If you just want to automatically auto-revert every
211@code{auto-revert-interval} seconds, use:
212
213@example
214(set (make-local-variable 'buffer-stale-function)
215 #'(lambda (&optional noconfirm) 'fast))
216@end example
217
218@noindent
219in the buffer's mode function.
220
221The special return value @samp{fast} tells the caller that the need
222for reverting was not checked, but that reverting the buffer is fast.
223It also tells Auto Revert not to print any revert messages, even if
224@code{auto-revert-verbose} is non-@code{nil}. This is important, as
225getting revert messages every @code{auto-revert-interval} seconds can
226be very annoying. The information provided by this return value could
227also be useful if the function is consulted for purposes other than
228auto-reverting.
229@end defvar
230
231Once the buffer has a @code{revert-buffer-function} and a
232@code{buffer-stale-function}, several problems usually remain.
233
234The buffer will only auto-revert if it is marked unmodified. Hence,
235you will have to make sure that various functions mark the buffer
236modified if and only if either the buffer contains information that
237might be lost by reverting or there is reason to believe that the user
238might be inconvenienced by auto-reverting, because he is actively
239working on the buffer. The user can always override this by manually
240adjusting the modified status of the buffer. To support this, calling
241the @code{revert-buffer-function} on a buffer that is marked
242unmodified should always keep the buffer marked unmodified.
243
244It is important to assure that point does not continuously jump around
245as a consequence of auto-reverting. Of course, moving point might be
246inevitable if the buffer radically changes.
247
248You should make sure that the @code{revert-buffer-function} does not
249print messages that unnecessarily duplicate Auto Revert's own messages
250if @code{auto-revert-verbose} is @code{t} and effectively override a
251@code{nil} value for @code{auto-revert-verbose}. Hence, adapting a
252mode for auto-reverting often involves getting rid of such messages.
253This is especially important for buffers that automatically
254auto-revert every @code{auto-revert-interval} seconds.
255
256Also, you may want to update the documentation string of
257@code{global-auto-revert-non-file-buffers}.
258
259@ifinfo
260Finally, you should add a node to this chapter's menu. This node
261@end ifinfo
262@ifnotinfo
263Finally, you should add a section to this chapter. This section
264@end ifnotinfo
265should at the very least make clear whether enabling auto-reverting
266for the buffer reliably assures that all information in the buffer is
267completely up to date (or will be after @code{auto-revert-interval}
268seconds).
269
270@node Subdir switches
271@chapter Subdirectory Switches in Dired
272
273You can insert subdirectories with specified @code{ls} switches in
274Dired buffers, using @kbd{C-u i}. You can change the @code{ls}
275switches of an already inserted subdirectory using @kbd{C-u l}.
276
277In Emacs versions 21.4 and later, Dired remembers the switches, so
278that reverting the buffer will not change them back to the main
279directory's switches. Deleting a subdirectory forgets about its
280switches.
281
282Using @code{dired-undo} (usually bound to @kbd{C-_} and @kbd{C-x u})
283to reinsert or delete subdirectories, that were inserted with explicit
284switches, can bypass Dired's machinery for remembering (or forgetting)
285switches. Deleting a subdirectory using @code{dired-undo} does not
286forget its switches. When later reinserted using @kbd{i}, it will be
287reinserted using its old switches. Using @code{dired-undo} to
288reinsert a subdirectory that was deleted using the regular
289Dired commands (not @code{dired-undo}) will originally insert it with
290its old switches. However, reverting the buffer will relist it using
291the buffer's default switches. If any of this yields problems, you
292can easily correct the situation using @kbd{C-u i} or @kbd{C-u l}.
293
294The buffer's default switches do not affect subdirectories that were
295inserted using explicitly specified switches. In particular,
296commands such as @kbd{s}, that change the buffer's switches do not
297affect such subdirectories. (They do affect subdirectories without
298explicitly assigned switches, however.)
299
300You can make Dired forget about all subdirectory switches and relist
301all subdirectories with the buffer's default switches using
302@kbd{M-x dired-reset-subdir-switches}. This also reverts the Dired buffer.
303
304@node Index
305@unnumbered Index
306
307@printindex cp
308
309@bye
310
311@ignore
312 arch-tag: 75c33f13-32c6-41b6-9537-847a312e2e49
313@end ignore
diff --git a/man/info.texi b/man/info.texi
index 1d62c530bd0..2e42a0b9edc 100644
--- a/man/info.texi
+++ b/man/info.texi
@@ -62,6 +62,11 @@ The GNU Project distributes most of its on-line manuals in the
62@dfn{Info format}, which you read using an @dfn{Info reader}. You are 62@dfn{Info format}, which you read using an @dfn{Info reader}. You are
63probably using an Info reader to read this now. 63probably using an Info reader to read this now.
64 64
65There are two primary Info readers: @code{info}, a stand-alone program
66designed just to read Info files, and the @code{info} package in GNU
67Emacs, a general-purpose editor. At present, only the Emacs reader
68supports using a mouse.
69
65@ifinfo 70@ifinfo
66If you are new to the Info reader and want to learn how to use it, 71If you are new to the Info reader and want to learn how to use it,
67type the command @kbd{h} now. It brings you to a programmed 72type the command @kbd{h} now. It brings you to a programmed
@@ -84,7 +89,7 @@ Started' chapter.
84@comment node-name, next, previous, up 89@comment node-name, next, previous, up
85@chapter Getting Started 90@chapter Getting Started
86 91
87This first part of the Info manual describes how to get around inside 92This first part of this Info manual describes how to get around inside
88of Info. The second part of the manual describes various advanced 93of Info. The second part of the manual describes various advanced
89Info commands, and how to write an Info as distinct from a Texinfo 94Info commands, and how to write an Info as distinct from a Texinfo
90file. The third part briefly explains how to generate Info files from 95file. The third part briefly explains how to generate Info files from
@@ -111,7 +116,7 @@ stand-alone program designed just to read Info files.
111@item 116@item
112Type @code{emacs} at the command line; then type @kbd{C-h i} 117Type @code{emacs} at the command line; then type @kbd{C-h i}
113(@kbd{Control-h}, followed by @kbd{i}). This approach uses the Info 118(@kbd{Control-h}, followed by @kbd{i}). This approach uses the Info
114mode of the Emacs program, an editor with many other capabilities. 119mode of the Emacs editor.
115@end enumerate 120@end enumerate
116 121
117In either case, then type @kbd{mInfo} (just the letters), followed by 122In either case, then type @kbd{mInfo} (just the letters), followed by
@@ -270,9 +275,10 @@ command. Another @kbd{n} command now would take you to the next
270node, @samp{Help-^L}. 275node, @samp{Help-^L}.
271 276
272@format 277@format
273>> But do not type @kbd{n} yet. First, try the @kbd{p} command, 278>> But do not type @kbd{n} yet. First, try the @kbd{p} command, or
274 or click the middle mouse button on the @samp{Prev} link. That 279 (in Emacs) click the middle mouse button on the @samp{Prev} link.
275 takes you to the @samp{Previous} node. Then use @kbd{n} to return here. 280 That takes you to the @samp{Previous} node. Then use @kbd{n} to
281 return here.
276@end format 282@end format
277 283
278 If you read this in Emacs, you will see an @samp{Info} item in the 284 If you read this in Emacs, you will see an @samp{Info} item in the
@@ -288,8 +294,8 @@ to. You could make Info skip past an important warning that was
288coming up. 294coming up.
289 295
290@format 296@format
291>> Now do an @kbd{n}, or click the middle mouse button on the @samp{Next} 297>> Now do an @kbd{n}, or (in Emacs) click the middle mouse button on
292 link, to get to the node @samp{Help-^L} and learn more. 298 the @samp{Next} link, to get to the node @samp{Help-^L} and learn more.
293@end format 299@end format
294 300
295@node Help-^L, Help-Inv, Help-P, Getting Started 301@node Help-^L, Help-Inv, Help-P, Getting Started
diff --git a/man/makefile.w32-in b/man/makefile.w32-in
index 3422f158198..45f890fd07a 100644
--- a/man/makefile.w32-in
+++ b/man/makefile.w32-in
@@ -46,13 +46,14 @@ INFO_TARGETS = $(infodir)/emacs $(infodir)/ccmode \
46 $(infodir)/emacs-mime $(infodir)/eshell \ 46 $(infodir)/emacs-mime $(infodir)/eshell \
47 $(infodir)/speedbar $(infodir)/tramp \ 47 $(infodir)/speedbar $(infodir)/tramp \
48 $(infodir)/ses $(infodir)/smtpmail \ 48 $(infodir)/ses $(infodir)/smtpmail \
49 $(infodir)/flymake 49 $(infodir)/flymake $(infodir)/emacs-xtra
50DVI_TARGETS = emacs.dvi calc.dvi cc-mode.dvi cl.dvi dired-x.dvi \ 50DVI_TARGETS = emacs.dvi calc.dvi cc-mode.dvi cl.dvi dired-x.dvi \
51 ediff.dvi forms.dvi gnus.dvi message.dvi mh-e.dvi \ 51 ediff.dvi forms.dvi gnus.dvi message.dvi mh-e.dvi \
52 reftex.dvi sc.dvi vip.dvi viper.dvi widget.dvi faq.dvi \ 52 reftex.dvi sc.dvi vip.dvi viper.dvi widget.dvi faq.dvi \
53 ada-mode.dvi autotype.dvi idlwave.dvi eudc.dvi ebrowse.dvi \ 53 ada-mode.dvi autotype.dvi idlwave.dvi eudc.dvi ebrowse.dvi \
54 pcl-cvs.dvi woman.dvi emacs-mime.dvi eshell.dvi \ 54 pcl-cvs.dvi woman.dvi emacs-mime.dvi eshell.dvi \
55 speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi flymake.dvi 55 speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi flymake.dvi \
56 emacs-xtra.dvi
56INFOSOURCES = info.texi 57INFOSOURCES = info.texi
57 58
58# The following rule does not work with all versions of `make'. 59# The following rule does not work with all versions of `make'.
@@ -66,6 +67,7 @@ ENVADD = $(srcdir)\..\nt\envadd.bat "TEXINPUTS=$(srcdir);$(TEXINPUTS)" \
66 67
67EMACSSOURCES= \ 68EMACSSOURCES= \
68 $(srcdir)/emacs.texi \ 69 $(srcdir)/emacs.texi \
70 $(srcdir)/emacs-xtra.texi \
69 $(srcdir)/doclicense.texi \ 71 $(srcdir)/doclicense.texi \
70 $(srcdir)/screen.texi \ 72 $(srcdir)/screen.texi \
71 $(srcdir)/commands.texi \ 73 $(srcdir)/commands.texi \
@@ -297,6 +299,12 @@ $(infodir)/smtpmail: smtpmail.texi
297smtpmail.dvi: smtpmail.texi 299smtpmail.dvi: smtpmail.texi
298 $(ENVADD) $(TEXI2DVI) $(srcdir)/smtpmail.texi 300 $(ENVADD) $(TEXI2DVI) $(srcdir)/smtpmail.texi
299 301
302$(infodir)/emacs-xtra: emacs-xtra.texi
303 $(MAKEINFO) emacs-xtra.texi
304
305emacs-xtra.dvi: emacs-xtra.texi
306 $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-xtra.texi
307
300mostlyclean: 308mostlyclean:
301 - $(DEL) *.log *.cp *.fn *.ky *.pg *.vr core *.tp *.core gnustmp.* 309 - $(DEL) *.log *.cp *.fn *.ky *.pg *.vr core *.tp *.core gnustmp.*
302 310
@@ -308,15 +316,15 @@ clean: mostlyclean
308 $(infodir)/gnus* $(infodir)/info* \ 316 $(infodir)/gnus* $(infodir)/info* \
309 $(infodir)/message* $(infodir)/mh-e* \ 317 $(infodir)/message* $(infodir)/mh-e* \
310 $(infodir)/reftex* $(infodir)/sc* \ 318 $(infodir)/reftex* $(infodir)/sc* \
311 $(infodir)/vip* $(infodir)/viper* \ 319 $(infodir)/vip* $(infodir)/widget* \
312 $(infodir)/widget* $(infodir)/efaq* \ 320 $(infodir)/efaq* $(infodir)/ada-mode* \
313 $(infodir)/ada-mode* $(infodir)/autotype* \ 321 $(infodir)/autotype* $(infodir)/calc* \
314 $(infodir)/calc* $(infodir)/idlwave* \ 322 $(infodir)/idlwave* $(infodir)/eudc* \
315 $(infodir)/eudc* $(infodir)/ebrowse* \ 323 $(infodir)/ebrowse* $(infodir)/pcl-cvs* \
316 $(infodir)/pcl-cvs* $(infodir)/woman* \ 324 $(infodir)/woman* $(infodir)/eshell* \
317 $(infodir)/emacs-mime* $(infodir)/eshell* \
318 $(infodir)/speedbar* $(infodir)/tramp* \ 325 $(infodir)/speedbar* $(infodir)/tramp* \
319 $(infodir)/ses* $(infodir)/smtpmail* 326 $(infodir)/ses* $(infodir)/smtpmail* \
327 $(infodir)/flymake*
320 328
321distclean: clean 329distclean: clean
322 330
diff --git a/man/misc.texi b/man/misc.texi
index 83c86a1867a..3c5909a9f56 100644
--- a/man/misc.texi
+++ b/man/misc.texi
@@ -624,12 +624,6 @@ specifies how to recognize the end of a command.
624Move backward across one shell command, but not beyond the current line 624Move backward across one shell command, but not beyond the current line
625(@code{shell-backward-command}). 625(@code{shell-backward-command}).
626 626
627@item C-c C-l
628@kindex C-c C-l @r{(Shell mode)}
629@findex comint-dynamic-list-input-ring
630Display the buffer's history of shell commands in another window
631(@code{comint-dynamic-list-input-ring}).
632
633@item M-x dirs 627@item M-x dirs
634Ask the shell what its current directory is, so that Emacs can agree 628Ask the shell what its current directory is, so that Emacs can agree
635with the shell. 629with the shell.
@@ -740,13 +734,21 @@ Fetch the next later old shell command.
740@itemx M-s @var{regexp} @key{RET} 734@itemx M-s @var{regexp} @key{RET}
741Search backwards or forwards for old shell commands that match @var{regexp}. 735Search backwards or forwards for old shell commands that match @var{regexp}.
742 736
743@item C-c C-x @r{(Shell mode)} 737@item C-c C-x
738@kindex C-c C-x @r{(Shell mode)}
744@findex comint-get-next-from-history 739@findex comint-get-next-from-history
745Fetch the next subsequent command from the history. 740Fetch the next subsequent command from the history.
746 741
747@item C-c . @r{(Shell mode)} 742@item C-c .
743@kindex C-c . @r{(Shell mode)}
748@findex comint-input-previous-argument 744@findex comint-input-previous-argument
749Fetch one argument from an old shell command. 745Fetch one argument from an old shell command.
746
747@item C-c C-l
748@kindex C-c C-l @r{(Shell mode)}
749@findex comint-dynamic-list-input-ring
750Display the buffer's history of shell commands in another window
751(@code{comint-dynamic-list-input-ring}).
750@end table 752@end table
751 753
752 Shell buffers provide a history of previously entered shell commands. To 754 Shell buffers provide a history of previously entered shell commands. To
@@ -815,21 +817,26 @@ Move point to the previous prompt (@code{comint-previous-prompt}).
815Move point to the following prompt (@code{comint-next-prompt}). 817Move point to the following prompt (@code{comint-next-prompt}).
816 818
817@kindex C-c RET @r{(Shell mode)} 819@kindex C-c RET @r{(Shell mode)}
818@findex comint-copy-old-input 820@findex comint-insert-input
819@item C-c @key{RET} 821@item C-c @key{RET}
820Copy the input command which point is in, inserting the copy at the end 822Copy the input command which point is in, inserting the copy at the end
821of the buffer (@code{comint-copy-old-input}). This is useful if you 823of the buffer (@code{comint-insert-input}). This is useful if you
822move point back to a previous command. After you copy the command, you 824move point back to a previous command. After you copy the command, you
823can submit the copy as input with @key{RET}. If you wish, you can 825can submit the copy as input with @key{RET}. If you wish, you can
824edit the copy before resubmitting it. 826edit the copy before resubmitting it.
827
828@item Mouse-2
829Copy the input command that you click on, inserting the copy at the end
830of the buffer.
825@end table 831@end table
826 832
827 Moving to a previous input and then copying it with @kbd{C-c 833 Moving to a previous input and then copying it with @kbd{C-c
828@key{RET}} produces the same results---the same buffer contents---that 834@key{RET}} or @kbd{Mouse-2} produces the same results---the same
829you would get by using @kbd{M-p} enough times to fetch that previous 835buffer contents---that you would get by using @kbd{M-p} enough times
830input from the history list. However, @kbd{C-c @key{RET}} copies the 836to fetch that previous input from the history list. However, @kbd{C-c
831text from the buffer, which can be different from what is in the history 837@key{RET}} copies the text from the buffer, which can be different
832list if you edit the input text in the buffer after it has been sent. 838from what is in the history list if you edit the input text in the
839buffer after it has been sent.
833 840
834@node History References 841@node History References
835@subsubsection Shell History References 842@subsubsection Shell History References
diff --git a/man/msdog.texi b/man/msdog.texi
index e701ba9fc75..157eba28844 100644
--- a/man/msdog.texi
+++ b/man/msdog.texi
@@ -352,7 +352,7 @@ effectively converts the file to Unix EOL style, like @code{dos2unix}.
352@findex add-untranslated-filesystem 352@findex add-untranslated-filesystem
353 When you use NFS or Samba to access file systems that reside on 353 When you use NFS or Samba to access file systems that reside on
354computers using GNU or Unix systems, Emacs should not perform 354computers using GNU or Unix systems, Emacs should not perform
355end-of-line translation on any files in these file systems--not even 355end-of-line translation on any files in these file systems---not even
356when you create a new file. To request this, designate these file 356when you create a new file. To request this, designate these file
357systems as @dfn{untranslated} file systems by calling the function 357systems as @dfn{untranslated} file systems by calling the function
358@code{add-untranslated-filesystem}. It takes one argument: the file 358@code{add-untranslated-filesystem}. It takes one argument: the file
@@ -436,7 +436,7 @@ discarded (sent to the system null device).
436 436
437 On MS-Windows, when the Windows network software is installed, you can 437 On MS-Windows, when the Windows network software is installed, you can
438also use a printer shared by another machine by setting 438also use a printer shared by another machine by setting
439@code{printer-name} to the UNC share name for that printer--for example, 439@code{printer-name} to the UNC share name for that printer---for example,
440@code{"//joes_pc/hp4si"}. (It doesn't matter whether you use forward 440@code{"//joes_pc/hp4si"}. (It doesn't matter whether you use forward
441slashes or backslashes here.) To find out the names of shared printers, 441slashes or backslashes here.) To find out the names of shared printers,
442run the command @samp{net view} at a DOS command prompt to obtain a list 442run the command @samp{net view} at a DOS command prompt to obtain a list
diff --git a/man/programs.texi b/man/programs.texi
index 9c081a7315b..e19c8364f2b 100644
--- a/man/programs.texi
+++ b/man/programs.texi
@@ -1061,9 +1061,9 @@ use in your program.
1061 1061
1062@findex info-lookup-symbol 1062@findex info-lookup-symbol
1063@findex info-lookup-file 1063@findex info-lookup-file
1064@kindex C-h C-i 1064@kindex C-h S
1065 For C, Lisp, and other languages that have documentation in Info, 1065 For C, Lisp, and other languages that have documentation in Info,
1066you can use @kbd{C-h C-i} (@code{info-lookup-symbol}) to view the Info 1066you can use @kbd{C-h S} (@code{info-lookup-symbol}) to view the Info
1067documentation for a symbol. You specify the symbol with the 1067documentation for a symbol. You specify the symbol with the
1068minibuffer; the default is the symbol appearing in the buffer at 1068minibuffer; the default is the symbol appearing in the buffer at
1069point. 1069point.
diff --git a/src/ChangeLog b/src/ChangeLog
index e4bcca81ede..6fae7580745 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,10 +1,142 @@
12004-06-23 David Kastrup <dak@gnu.org>
2
3 * search.c (Freplace_match): Adjust the match-data more
4 thoroughly when replacing strings in the buffer.
5 search.c (match-data): When INTEGERS is non-nil and the last match
6 was in a buffer, add the buffer as last element to the match data.
7 (Fset_match_data): If an additional element of the match-data is
8 a buffer, restore it to last_thing_searched.
9 (save_search_regs): Save last_thing_searched as part of the match
10 data.
11 (restore_match_data): Restore it again.
12
132004-06-23 Luc Teirlinck <teirllm@auburn.edu>
14
15 * keymap.c (Ftext_char_description): Doc fix.
16 * doc.c (Fsnarf_documentation): Doc fix.
17
182004-06-22 Kim F. Storm <storm@cua.dk>
19
20 * fns.c (Fmapcar, Fmapconcat): GCPRO the args array.
21
22 * lisp.h (struct Lisp_Save_Value): New member dogc.
23 (SAFE_ALLOCA_LISP): Change second arg to number of elements.
24 Set dogc member in Lisp_Save_Value object so it will be GC'ed.
25 (SAFE_FREE_LISP): New macro.
26
27 * alloc.c (safe_alloca_unwind): Clear dogc and pointer members.
28 (make_save_value): Init new dogc member.
29 (mark_object): Mark Lisp_Save_Value pointer array if dogc is set.
30
31 * fns.c (Fmapconcat, Fmapcar): Use new SAFE_ALLOCA_LISP and
32 SAFE_FREE_LISP macros.
33
342004-06-22 Kim F. Storm <storm@cua.dk>
35
36 * lisp.h (SAFE_ALLOCA_LISP): New macro to allocate Lisp_Objects.
37 Temporarily inhibits GC if memory is xmalloc'ed, as the Lisp_Objects
38 in that memory area are unknown to GC. Add comments.
39
40 * fns.c (Fmapconcat, Fmapcar): Use SAFE_ALLOCA_LISP.
41
422004-06-21 Kim F. Storm <storm@cua.dk>
43
44 * lisp.h (MAX_ALLOCA): Define here.
45 (safe_alloca_unwind): Add prototype.
46 (USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE): New macros.
47
48 * alloc.c (safe_alloca_unwind): New function.
49
50 * casefiddle.c (casify_object): Use SAFE_ALLOCA.
51
52 * charset.c (Fstring): Use SAFE_ALLOCA.
53
54 * coding.c (MAX_ALLOCA): Remove define.
55
56 * data.c (MAX_ALLOCA): Remove define.
57 (Faset): Use SAFE_ALLOCA.
58
59 * editfns.c (Fformat, Ftranspose_regions): Use SAFE_ALLOCA.
60
61 * fns.c (string_make_multibyte, string_to_multibyte)
62 (string_make_unibyte, Fmapconcat, Fmapcar): Use SAFE_ALLOCA.
63 (MAX_ALLOCA): Remove define.
64 (Fbase64_encode_region, Fbase64_encode_string)
65 (Fbase64_decode_region, Fbase64_decode_string): Use SAFE_ALLOCA.
66 (Fbase64_encode_region, Fbase64_encode_string): Fix potential
67 memory leak if encoding fails.
68
69 * xdisp.c (add_to_log): Use SAFE_ALLOCA.
70
712004-06-21 Eli Zaretskii <eliz@gnu.org>
72
73 * print.c (Fwith_output_to_temp_buffer): Doc fix.
74
752004-06-20 Richard M. Stallman <rms@gnu.org>
76
77 * xfaces.c (Finternal_copy_lisp_face): Small cleanup; doc fix.
78
79 * search.c (match_limit): Cleaner err msg when no match data available.
80
81 * window.c (syms_of_window): Doc fix.
82
83 * keyboard.c (command_loop_1): Handle values `only' and `identity'
84 for Vtransient_mark_mode.
85
86 * buffer.c (syms_of_buffer): Doc fix.
87
882004-06-21 David Kastrup <dak@gnu.org>
89
90 * minibuf.c (Ftry_completion, Fall_completions): Do lazy binding
91 and unbinding of `case-fold-search' according to
92 `completion-ignore-case' around calls of string-match and
93 predicates, respectively. Should give satisfactory performance
94 in all relevant cases.
95
962004-06-17 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
97
98 * xterm.c (x_draw_image_foreground_1): Subtract slice.x/y from
99 clip_x/y_origin.
100
101 * fns.c (string_to_multibyte): Use xmalloc/xfree instead of alloca.
102
103 * macfns.c (Fx_display_color_cells): Do not limit return value to 256.
104
105 * macterm.c (mac_initialize_display_info): Initialize n_planes correctly
106 on Mac OSX.
107
1082004-06-16 Luc Teirlinck <teirllm@auburn.edu>
109
110 * buffer.c (syms_of_buffer): Clarify `fill-column' docstring.
111
1122004-06-16 Kim F. Storm <storm@cua.dk>
113
114 * dispextern.h (Vimage_types): Remove extern.
115
1162004-06-16 Miles Bader <miles@gnu.org>
117
118 * image.c (lookup_image_type): Initialize image type if necessary.
119
1202004-06-15 Kim F. Storm <storm@cua.dk>
121
122 * xdisp.c (try_cursor_movement): Exclude header line from scroll
123 margin at top of window.
124 (try_window_reusing_current_matrix): Calculate proper cursor position
125 after scrolling up with non-zero scroll margin, as the old cursor
126 position corresponds to value of PT before executing this command.
127 (try_window_id): Consider scroll margin at bottom of window too;
128 otherwise we fail to scroll when hl-line-mode is enabled.
129
130 * syntax.c (skip_chars): Only recognize [:class:] when it has the
131 proper format and class is a lower-case word.
132
12004-06-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 1332004-06-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 134
3 * gtkutil.c (xg_get_image_for_pixmap): New function. 135 * gtkutil.c (xg_get_image_for_pixmap): New function.
4 (xg_get_gdk_pixmap_and_mask): Removed. 136 (xg_get_gdk_pixmap_and_mask): Removed.
5 (update_frame_tool_bar): Call xg_get_image_for_pixmap instead of 137 (update_frame_tool_bar): Call xg_get_image_for_pixmap instead of
6 xg_get_gdk_pixmap_and_mask. 138 xg_get_gdk_pixmap_and_mask.
7 139
8 * xterm.h (struct x_display_info): Typo in comment fixed. 140 * xterm.h (struct x_display_info): Typo in comment fixed.
9 141
102004-06-14 Juanma Barranquero <lektu@terra.es> 1422004-06-14 Juanma Barranquero <lektu@terra.es>
diff --git a/src/abbrev.c b/src/abbrev.c
index 41e329ac95d..ac132f20023 100644
--- a/src/abbrev.c
+++ b/src/abbrev.c
@@ -1,5 +1,5 @@
1/* Primitives for word-abbrev mode. 1/* Primitives for word-abbrev mode.
2 Copyright (C) 1985, 1986, 1993, 1996, 1998, 2001 2 Copyright (C) 1985, 1986, 1993, 1996, 1998, 2001,02,03,04
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/alloc.c b/src/alloc.c
index 3a3628f40fd..baf7afa0094 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -580,6 +580,21 @@ xstrdup (s)
580} 580}
581 581
582 582
583/* Unwind for SAFE_ALLOCA */
584
585Lisp_Object
586safe_alloca_unwind (arg)
587 Lisp_Object arg;
588{
589 register struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
590
591 p->dogc = 0;
592 xfree (p->pointer);
593 p->pointer = 0;
594 return Qnil;
595}
596
597
583/* Like malloc but used for allocating Lisp data. NBYTES is the 598/* Like malloc but used for allocating Lisp data. NBYTES is the
584 number of bytes to allocate, TYPE describes the intended use of the 599 number of bytes to allocate, TYPE describes the intended use of the
585 allcated memory block (for strings, for conses, ...). */ 600 allcated memory block (for strings, for conses, ...). */
@@ -2935,6 +2950,7 @@ make_save_value (pointer, integer)
2935 p = XSAVE_VALUE (val); 2950 p = XSAVE_VALUE (val);
2936 p->pointer = pointer; 2951 p->pointer = pointer;
2937 p->integer = integer; 2952 p->integer = integer;
2953 p->dogc = 0;
2938 return val; 2954 return val;
2939} 2955}
2940 2956
@@ -4969,6 +4985,7 @@ mark_object (arg)
4969 if (XMARKER (obj)->gcmarkbit) 4985 if (XMARKER (obj)->gcmarkbit)
4970 break; 4986 break;
4971 XMARKER (obj)->gcmarkbit = 1; 4987 XMARKER (obj)->gcmarkbit = 1;
4988
4972 switch (XMISCTYPE (obj)) 4989 switch (XMISCTYPE (obj))
4973 { 4990 {
4974 case Lisp_Misc_Buffer_Local_Value: 4991 case Lisp_Misc_Buffer_Local_Value:
@@ -4993,6 +5010,8 @@ mark_object (arg)
4993 /* DO NOT mark thru the marker's chain. 5010 /* DO NOT mark thru the marker's chain.
4994 The buffer's markers chain does not preserve markers from gc; 5011 The buffer's markers chain does not preserve markers from gc;
4995 instead, markers are removed from the chain when freed by gc. */ 5012 instead, markers are removed from the chain when freed by gc. */
5013 break;
5014
4996 case Lisp_Misc_Intfwd: 5015 case Lisp_Misc_Intfwd:
4997 case Lisp_Misc_Boolfwd: 5016 case Lisp_Misc_Boolfwd:
4998 case Lisp_Misc_Objfwd: 5017 case Lisp_Misc_Objfwd:
@@ -5002,7 +5021,21 @@ mark_object (arg)
5002 since all markable slots in current buffer marked anyway. */ 5021 since all markable slots in current buffer marked anyway. */
5003 /* Don't need to do Lisp_Objfwd, since the places they point 5022 /* Don't need to do Lisp_Objfwd, since the places they point
5004 are protected with staticpro. */ 5023 are protected with staticpro. */
5024 break;
5025
5005 case Lisp_Misc_Save_Value: 5026 case Lisp_Misc_Save_Value:
5027 {
5028 register struct Lisp_Save_Value *ptr = XSAVE_VALUE (obj);
5029 /* If DOGC is set, POINTER is the address of a memory
5030 area containing INTEGER potential Lisp_Objects. */
5031 if (ptr->dogc)
5032 {
5033 Lisp_Object *p = (Lisp_Object *) ptr->pointer;
5034 int nelt;
5035 for (nelt = ptr->integer; nelt > 0; nelt--, p++)
5036 mark_maybe_object (*p);
5037 }
5038 }
5006 break; 5039 break;
5007 5040
5008 case Lisp_Misc_Overlay: 5041 case Lisp_Misc_Overlay:
diff --git a/src/atimer.c b/src/atimer.c
index 2ddc7427f56..7e78bdad9c0 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -1,5 +1,5 @@
1/* Asynchronous timers. 1/* Asynchronous timers.
2 Copyright (C) 2000 Free Software Foundation, Inc. 2 Copyright (C) 2000, 2004 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/atimer.h b/src/atimer.h
index 3ecc97e5511..f987a47a6bd 100644
--- a/src/atimer.h
+++ b/src/atimer.h
@@ -1,5 +1,5 @@
1/* Asynchronous timers. 1/* Asynchronous timers.
2 Copyright (C) 2000 Free Software Foundation, Inc. 2 Copyright (C) 2000, 2003 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/blockinput.h b/src/blockinput.h
index e9f2f3bc217..a4c8a9b9c22 100644
--- a/src/blockinput.h
+++ b/src/blockinput.h
@@ -1,5 +1,5 @@
1/* blockinput.h - interface to blocking complicated interrupt-driven input. 1/* blockinput.h - interface to blocking complicated interrupt-driven input.
2 Copyright (C) 1989, 1993 Free Software Foundation, Inc. 2 Copyright (C) 1989, 1993, 2004 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
diff --git a/src/buffer.c b/src/buffer.c
index 532a768ba50..031f5da8e6e 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5437,7 +5437,7 @@ nil here means use current buffer's major mode. */);
5437 DEFVAR_PER_BUFFER ("fill-column", &current_buffer->fill_column, 5437 DEFVAR_PER_BUFFER ("fill-column", &current_buffer->fill_column,
5438 make_number (Lisp_Int), 5438 make_number (Lisp_Int),
5439 doc: /* *Column beyond which automatic line-wrapping should happen. 5439 doc: /* *Column beyond which automatic line-wrapping should happen.
5440Interactively, you can set this using \\[set-fill-column]. */); 5440Interactively, you can set the buffer local value using \\[set-fill-column]. */);
5441 5441
5442 DEFVAR_PER_BUFFER ("left-margin", &current_buffer->left_margin, 5442 DEFVAR_PER_BUFFER ("left-margin", &current_buffer->left_margin,
5443 make_number (Lisp_Int), 5443 make_number (Lisp_Int),
@@ -5847,7 +5847,11 @@ If the buffer has never been shown in a window, the value is nil. */);
5847 doc: /* *Non-nil means deactivate the mark when the buffer contents change. 5847 doc: /* *Non-nil means deactivate the mark when the buffer contents change.
5848Non-nil also enables highlighting of the region whenever the mark is active. 5848Non-nil also enables highlighting of the region whenever the mark is active.
5849The variable `highlight-nonselected-windows' controls whether to highlight 5849The variable `highlight-nonselected-windows' controls whether to highlight
5850all windows or just the selected window. */); 5850all windows or just the selected window.
5851
5852If the value is `lambda', that enables Transient Mark mode temporarily
5853until the next buffer modification. If a command sets the value to `only',
5854that enables Transient Mark mode for the following command only. */);
5851 Vtransient_mark_mode = Qnil; 5855 Vtransient_mark_mode = Qnil;
5852 5856
5853 DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only, 5857 DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only,
diff --git a/src/buffer.h b/src/buffer.h
index b5227cb9981..e59211d4111 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -1,5 +1,5 @@
1/* Header file for the buffer manipulation primitives. 1/* Header file for the buffer manipulation primitives.
2 Copyright (C) 1985, 86, 93, 94, 95, 97, 1998, 1999, 2000, 01, 2003 2 Copyright (C) 1985,86,93,94,95,97,98,99,2000,01,03,04
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/callproc.c b/src/callproc.c
index 73d81d81b18..c3345eb3707 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -1,5 +1,5 @@
1/* Synchronous subprocess invocation for GNU Emacs. 1/* Synchronous subprocess invocation for GNU Emacs.
2 Copyright (C) 1985,86,87,88,93,94,95,99, 2000, 2001 2 Copyright (C) 1985,86,87,88,93,94,95,99, 2000,01,02,03,04
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -222,7 +222,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
222 register int pid; 222 register int pid;
223 char buf[16384]; 223 char buf[16384];
224 char *bufptr = buf; 224 char *bufptr = buf;
225 int bufsize = 16384; 225 int bufsize = sizeof buf;
226 int count = SPECPDL_INDEX (); 226 int count = SPECPDL_INDEX ();
227 227
228 register const unsigned char **new_argv 228 register const unsigned char **new_argv
diff --git a/src/casefiddle.c b/src/casefiddle.c
index 6387c4bc845..25a5a3d12b8 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -1,5 +1,6 @@
1/* GNU Emacs case conversion functions. 1/* GNU Emacs case conversion functions.
2 Copyright (C) 1985, 1994, 1997 Free Software Foundation, Inc. 2 Copyright (C) 1985,94,97,98,99, 2001, 2002, 2004
3 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -109,8 +110,12 @@ casify_object (flag, obj)
109 /* The work is not yet finished because of a multibyte 110 /* The work is not yet finished because of a multibyte
110 character just encountered. */ 111 character just encountered. */
111 int fromlen, j_byte = i; 112 int fromlen, j_byte = i;
112 char *buf 113 char *buf;
113 = (char *) alloca ((len - i) * MAX_MULTIBYTE_LENGTH + i); 114 int bufsize;
115 USE_SAFE_ALLOCA;
116
117 bufsize = (len - i) * MAX_MULTIBYTE_LENGTH + i;
118 SAFE_ALLOCA (buf, char *, bufsize);
114 119
115 /* Copy data already handled. */ 120 /* Copy data already handled. */
116 bcopy (SDATA (obj), buf, i); 121 bcopy (SDATA (obj), buf, i);
@@ -132,6 +137,7 @@ casify_object (flag, obj)
132 } 137 }
133 obj = make_multibyte_string (buf, SCHARS (obj), 138 obj = make_multibyte_string (buf, SCHARS (obj),
134 j_byte); 139 j_byte);
140 SAFE_FREE (bufsize);
135 } 141 }
136 return obj; 142 return obj;
137 } 143 }
diff --git a/src/charset.c b/src/charset.c
index 57a12b2398d..8eeddd51c92 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1645,11 +1645,16 @@ usage: (string &rest CHARACTERS) */)
1645 int n; 1645 int n;
1646 Lisp_Object *args; 1646 Lisp_Object *args;
1647{ 1647{
1648 int i; 1648 int i, bufsize;
1649 unsigned char *buf = (unsigned char *) alloca (MAX_MULTIBYTE_LENGTH * n); 1649 unsigned char *buf, *p;
1650 unsigned char *p = buf;
1651 int c; 1650 int c;
1652 int multibyte = 0; 1651 int multibyte = 0;
1652 Lisp_Object ret;
1653 USE_SAFE_ALLOCA;
1654
1655 bufsize = MAX_MULTIBYTE_LENGTH * n;
1656 SAFE_ALLOCA (buf, unsigned char *, bufsize);
1657 p = buf;
1653 1658
1654 for (i = 0; i < n; i++) 1659 for (i = 0; i < n; i++)
1655 { 1660 {
@@ -1667,7 +1672,10 @@ usage: (string &rest CHARACTERS) */)
1667 *p++ = c; 1672 *p++ = c;
1668 } 1673 }
1669 1674
1670 return make_string_from_bytes (buf, n, p - buf); 1675 ret = make_string_from_bytes (buf, n, p - buf);
1676 SAFE_FREE (bufsize);
1677
1678 return ret;
1671} 1679}
1672 1680
1673#endif /* emacs */ 1681#endif /* emacs */
diff --git a/src/coding.c b/src/coding.c
index ed4b131b3a9..b36f7fbfbff 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -2094,7 +2094,7 @@ decode_coding_iso2022 (coding, source, destination, src_bytes, dst_bytes)
2094 int dim, M, L; 2094 int dim, M, L;
2095 int size, required; 2095 int size, required;
2096 int produced_chars; 2096 int produced_chars;
2097 2097
2098 ONE_MORE_BYTE (dim); 2098 ONE_MORE_BYTE (dim);
2099 ONE_MORE_BYTE (M); 2099 ONE_MORE_BYTE (M);
2100 ONE_MORE_BYTE (L); 2100 ONE_MORE_BYTE (L);
@@ -4548,10 +4548,6 @@ struct conversion_buffer
4548 unsigned char *data; 4548 unsigned char *data;
4549}; 4549};
4550 4550
4551/* Don't use alloca for allocating memory space larger than this, lest
4552 we overflow their stack. */
4553#define MAX_ALLOCA 16*1024
4554
4555/* Allocate LEN bytes of memory for BUF (struct conversion_buffer). */ 4551/* Allocate LEN bytes of memory for BUF (struct conversion_buffer). */
4556#define allocate_conversion_buffer(buf, len) \ 4552#define allocate_conversion_buffer(buf, len) \
4557 do { \ 4553 do { \
@@ -6654,7 +6650,7 @@ find_safe_codings (p, pend, safe_codings, work_table, single_byte_char_found)
6654 accept_latin_extra)); 6650 accept_latin_extra));
6655 } 6651 }
6656 } 6652 }
6657 6653
6658 if (! encodable 6654 if (! encodable
6659 && ((CHAR_TABLE_P (translation_table) 6655 && ((CHAR_TABLE_P (translation_table)
6660 && ! NILP (Faref (translation_table, ch))) 6656 && ! NILP (Faref (translation_table, ch)))
diff --git a/src/data.c b/src/data.c
index 5a1a648dcb7..1259c5891a1 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2052,11 +2052,6 @@ or a byte-code object. IDX starts at 0. */)
2052 } 2052 }
2053} 2053}
2054 2054
2055/* Don't use alloca for relocating string data larger than this, lest
2056 we overflow their stack. The value is the same as what used in
2057 fns.c for base64 handling. */
2058#define MAX_ALLOCA 16*1024
2059
2060DEFUN ("aset", Faset, Saset, 3, 3, 0, 2055DEFUN ("aset", Faset, Saset, 3, 3, 0,
2061 doc: /* Store into the element of ARRAY at index IDX the value NEWELT. 2056 doc: /* Store into the element of ARRAY at index IDX the value NEWELT.
2062Return NEWELT. ARRAY may be a vector, a string, a char-table or a 2057Return NEWELT. ARRAY may be a vector, a string, a char-table or a
@@ -2156,10 +2151,9 @@ bool-vector. IDX starts at 0. */)
2156 /* We must relocate the string data. */ 2151 /* We must relocate the string data. */
2157 int nchars = SCHARS (array); 2152 int nchars = SCHARS (array);
2158 unsigned char *str; 2153 unsigned char *str;
2154 USE_SAFE_ALLOCA;
2159 2155
2160 str = (nbytes <= MAX_ALLOCA 2156 SAFE_ALLOCA (str, unsigned char *, nbytes);
2161 ? (unsigned char *) alloca (nbytes)
2162 : (unsigned char *) xmalloc (nbytes));
2163 bcopy (SDATA (array), str, nbytes); 2157 bcopy (SDATA (array), str, nbytes);
2164 allocate_string_data (XSTRING (array), nchars, 2158 allocate_string_data (XSTRING (array), nchars,
2165 nbytes + new_bytes - prev_bytes); 2159 nbytes + new_bytes - prev_bytes);
@@ -2167,8 +2161,7 @@ bool-vector. IDX starts at 0. */)
2167 p1 = SDATA (array) + idxval_byte; 2161 p1 = SDATA (array) + idxval_byte;
2168 bcopy (str + idxval_byte + prev_bytes, p1 + new_bytes, 2162 bcopy (str + idxval_byte + prev_bytes, p1 + new_bytes,
2169 nbytes - (idxval_byte + prev_bytes)); 2163 nbytes - (idxval_byte + prev_bytes));
2170 if (nbytes > MAX_ALLOCA) 2164 SAFE_FREE (nbytes);
2171 xfree (str);
2172 clear_string_char_byte_cache (); 2165 clear_string_char_byte_cache ();
2173 } 2166 }
2174 while (new_bytes--) 2167 while (new_bytes--)
@@ -2190,14 +2183,13 @@ bool-vector. IDX starts at 0. */)
2190 unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1; 2183 unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1;
2191 unsigned char *origstr = SDATA (array), *str; 2184 unsigned char *origstr = SDATA (array), *str;
2192 int nchars, nbytes; 2185 int nchars, nbytes;
2186 USE_SAFE_ALLOCA;
2193 2187
2194 nchars = SCHARS (array); 2188 nchars = SCHARS (array);
2195 nbytes = idxval_byte = count_size_as_multibyte (origstr, idxval); 2189 nbytes = idxval_byte = count_size_as_multibyte (origstr, idxval);
2196 nbytes += count_size_as_multibyte (origstr + idxval, 2190 nbytes += count_size_as_multibyte (origstr + idxval,
2197 nchars - idxval); 2191 nchars - idxval);
2198 str = (nbytes <= MAX_ALLOCA 2192 SAFE_ALLOCA (str, unsigned char *, nbytes);
2199 ? (unsigned char *) alloca (nbytes)
2200 : (unsigned char *) xmalloc (nbytes));
2201 copy_text (SDATA (array), str, nchars, 0, 1); 2193 copy_text (SDATA (array), str, nchars, 0, 1);
2202 PARSE_MULTIBYTE_SEQ (str + idxval_byte, nbytes - idxval_byte, 2194 PARSE_MULTIBYTE_SEQ (str + idxval_byte, nbytes - idxval_byte,
2203 prev_bytes); 2195 prev_bytes);
@@ -2210,8 +2202,7 @@ bool-vector. IDX starts at 0. */)
2210 *p1++ = *p0++; 2202 *p1++ = *p0++;
2211 bcopy (str + idxval_byte + prev_bytes, p1, 2203 bcopy (str + idxval_byte + prev_bytes, p1,
2212 nbytes - (idxval_byte + prev_bytes)); 2204 nbytes - (idxval_byte + prev_bytes));
2213 if (nbytes > MAX_ALLOCA) 2205 SAFE_FREE (nbytes);
2214 xfree (str);
2215 clear_string_char_byte_cache (); 2206 clear_string_char_byte_cache ();
2216 } 2207 }
2217 } 2208 }
diff --git a/src/dispextern.h b/src/dispextern.h
index 2b9ef2adbf0..f48cdbbe273 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1,5 +1,5 @@
1/* Interface definitions for display code. 1/* Interface definitions for display code.
2 Copyright (C) 1985, 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003 2 Copyright (C) 1985,93,94,97,98,99, 2000,01,02,03, 2004
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -2645,8 +2645,6 @@ void w32_reset_fringes P_ ((void));
2645 2645
2646#ifdef HAVE_WINDOW_SYSTEM 2646#ifdef HAVE_WINDOW_SYSTEM
2647 2647
2648extern Lisp_Object Vimage_types;
2649
2650extern int x_bitmap_height P_ ((struct frame *, int)); 2648extern int x_bitmap_height P_ ((struct frame *, int));
2651extern int x_bitmap_width P_ ((struct frame *, int)); 2649extern int x_bitmap_width P_ ((struct frame *, int));
2652extern int x_bitmap_pixmap P_ ((struct frame *, int)); 2650extern int x_bitmap_pixmap P_ ((struct frame *, int));
diff --git a/src/doc.c b/src/doc.c
index a0b840637e0..120d35767b2 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -570,7 +570,7 @@ records them in function and variable definitions.
570The function takes one argument, FILENAME, a string; 570The function takes one argument, FILENAME, a string;
571it specifies the file name (without a directory) of the DOC file. 571it specifies the file name (without a directory) of the DOC file.
572That file is found in `../etc' now; later, when the dumped Emacs is run, 572That file is found in `../etc' now; later, when the dumped Emacs is run,
573the same file name is found in the `data-directory'. */) 573the same file name is found in the `doc-directory'. */)
574 (filename) 574 (filename)
575 Lisp_Object filename; 575 Lisp_Object filename;
576{ 576{
diff --git a/src/editfns.c b/src/editfns.c
index c9dd4ecefdf..9fbdc0363bb 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3225,6 +3225,7 @@ usage: (format STRING &rest OBJECTS) */)
3225 int longest_format; 3225 int longest_format;
3226 Lisp_Object val; 3226 Lisp_Object val;
3227 int arg_intervals = 0; 3227 int arg_intervals = 0;
3228 USE_SAFE_ALLOCA;
3228 3229
3229 /* discarded[I] is 1 if byte I of the format 3230 /* discarded[I] is 1 if byte I of the format
3230 string was not copied into the output. 3231 string was not copied into the output.
@@ -3273,7 +3274,7 @@ usage: (format STRING &rest OBJECTS) */)
3273 longest_format = 0; 3274 longest_format = 0;
3274 3275
3275 /* Make room in result for all the non-%-codes in the control string. */ 3276 /* Make room in result for all the non-%-codes in the control string. */
3276 total = 5 + CONVERTED_BYTE_SIZE (multibyte, args[0]); 3277 total = 5 + CONVERTED_BYTE_SIZE (multibyte, args[0]) + 1;
3277 3278
3278 /* Allocate the info and discarded tables. */ 3279 /* Allocate the info and discarded tables. */
3279 { 3280 {
@@ -3466,10 +3467,7 @@ usage: (format STRING &rest OBJECTS) */)
3466 3467
3467 /* Allocate the space for the result. 3468 /* Allocate the space for the result.
3468 Note that TOTAL is an overestimate. */ 3469 Note that TOTAL is an overestimate. */
3469 if (total < 1000) 3470 SAFE_ALLOCA (buf, char *, total);
3470 buf = (char *) alloca (total + 1);
3471 else
3472 buf = (char *) xmalloc (total + 1);
3473 3471
3474 p = buf; 3472 p = buf;
3475 nchars = 0; 3473 nchars = 0;
@@ -3602,7 +3600,7 @@ usage: (format STRING &rest OBJECTS) */)
3602 maybe_combine_byte = 1; 3600 maybe_combine_byte = 1;
3603 this_nchars = strlen (p); 3601 this_nchars = strlen (p);
3604 if (multibyte) 3602 if (multibyte)
3605 p += str_to_multibyte (p, buf + total - p, this_nchars); 3603 p += str_to_multibyte (p, buf + total - 1 - p, this_nchars);
3606 else 3604 else
3607 p += this_nchars; 3605 p += this_nchars;
3608 nchars += this_nchars; 3606 nchars += this_nchars;
@@ -3639,7 +3637,7 @@ usage: (format STRING &rest OBJECTS) */)
3639 *p++ = *format++, nchars++; 3637 *p++ = *format++, nchars++;
3640 } 3638 }
3641 3639
3642 if (p > buf + total + 1) 3640 if (p > buf + total)
3643 abort (); 3641 abort ();
3644 3642
3645 if (maybe_combine_byte) 3643 if (maybe_combine_byte)
@@ -3647,8 +3645,7 @@ usage: (format STRING &rest OBJECTS) */)
3647 val = make_specified_string (buf, nchars, p - buf, multibyte); 3645 val = make_specified_string (buf, nchars, p - buf, multibyte);
3648 3646
3649 /* If we allocated BUF with malloc, free it too. */ 3647 /* If we allocated BUF with malloc, free it too. */
3650 if (total >= 1000) 3648 SAFE_FREE (total);
3651 xfree (buf);
3652 3649
3653 /* If the format string has text properties, or any of the string 3650 /* If the format string has text properties, or any of the string
3654 arguments has text properties, set up text properties of the 3651 arguments has text properties, set up text properties of the
@@ -4005,12 +4002,9 @@ Transposing beyond buffer boundaries is an error. */)
4005 /* First region smaller than second. */ 4002 /* First region smaller than second. */
4006 if (len1_byte < len2_byte) 4003 if (len1_byte < len2_byte)
4007 { 4004 {
4008 /* We use alloca only if it is small, 4005 USE_SAFE_ALLOCA;
4009 because we want to avoid stack overflow. */ 4006
4010 if (len2_byte > 20000) 4007 SAFE_ALLOCA (temp, unsigned char *, len2_byte);
4011 temp = (unsigned char *) xmalloc (len2_byte);
4012 else
4013 temp = (unsigned char *) alloca (len2_byte);
4014 4008
4015 /* Don't precompute these addresses. We have to compute them 4009 /* Don't precompute these addresses. We have to compute them
4016 at the last minute, because the relocating allocator might 4010 at the last minute, because the relocating allocator might
@@ -4021,23 +4015,20 @@ Transposing beyond buffer boundaries is an error. */)
4021 bcopy (start2_addr, temp, len2_byte); 4015 bcopy (start2_addr, temp, len2_byte);
4022 bcopy (start1_addr, start1_addr + len2_byte, len1_byte); 4016 bcopy (start1_addr, start1_addr + len2_byte, len1_byte);
4023 bcopy (temp, start1_addr, len2_byte); 4017 bcopy (temp, start1_addr, len2_byte);
4024 if (len2_byte > 20000) 4018 SAFE_FREE (len2_byte);
4025 xfree (temp);
4026 } 4019 }
4027 else 4020 else
4028 /* First region not smaller than second. */ 4021 /* First region not smaller than second. */
4029 { 4022 {
4030 if (len1_byte > 20000) 4023 USE_SAFE_ALLOCA;
4031 temp = (unsigned char *) xmalloc (len1_byte); 4024
4032 else 4025 SAFE_ALLOCA (temp, unsigned char *, len1_byte);
4033 temp = (unsigned char *) alloca (len1_byte);
4034 start1_addr = BYTE_POS_ADDR (start1_byte); 4026 start1_addr = BYTE_POS_ADDR (start1_byte);
4035 start2_addr = BYTE_POS_ADDR (start2_byte); 4027 start2_addr = BYTE_POS_ADDR (start2_byte);
4036 bcopy (start1_addr, temp, len1_byte); 4028 bcopy (start1_addr, temp, len1_byte);
4037 bcopy (start2_addr, start1_addr, len2_byte); 4029 bcopy (start2_addr, start1_addr, len2_byte);
4038 bcopy (temp, start1_addr + len2_byte, len1_byte); 4030 bcopy (temp, start1_addr + len2_byte, len1_byte);
4039 if (len1_byte > 20000) 4031 SAFE_FREE (len1_byte);
4040 xfree (temp);
4041 } 4032 }
4042 graft_intervals_into_buffer (tmp_interval1, start1 + len2, 4033 graft_intervals_into_buffer (tmp_interval1, start1 + len2,
4043 len1, current_buffer, 0); 4034 len1, current_buffer, 0);
@@ -4054,6 +4045,8 @@ Transposing beyond buffer boundaries is an error. */)
4054 if (len1_byte == len2_byte) 4045 if (len1_byte == len2_byte)
4055 /* Regions are same size, though, how nice. */ 4046 /* Regions are same size, though, how nice. */
4056 { 4047 {
4048 USE_SAFE_ALLOCA;
4049
4057 modify_region (current_buffer, start1, end1); 4050 modify_region (current_buffer, start1, end1);
4058 modify_region (current_buffer, start2, end2); 4051 modify_region (current_buffer, start2, end2);
4059 record_change (start1, len1); 4052 record_change (start1, len1);
@@ -4065,17 +4058,14 @@ Transposing beyond buffer boundaries is an error. */)
4065 Fset_text_properties (make_number (start2), make_number (end2), 4058 Fset_text_properties (make_number (start2), make_number (end2),
4066 Qnil, Qnil); 4059 Qnil, Qnil);
4067 4060
4068 if (len1_byte > 20000) 4061 SAFE_ALLOCA (temp, unsigned char *, len1_byte);
4069 temp = (unsigned char *) xmalloc (len1_byte);
4070 else
4071 temp = (unsigned char *) alloca (len1_byte);
4072 start1_addr = BYTE_POS_ADDR (start1_byte); 4062 start1_addr = BYTE_POS_ADDR (start1_byte);
4073 start2_addr = BYTE_POS_ADDR (start2_byte); 4063 start2_addr = BYTE_POS_ADDR (start2_byte);
4074 bcopy (start1_addr, temp, len1_byte); 4064 bcopy (start1_addr, temp, len1_byte);
4075 bcopy (start2_addr, start1_addr, len2_byte); 4065 bcopy (start2_addr, start1_addr, len2_byte);
4076 bcopy (temp, start2_addr, len1_byte); 4066 bcopy (temp, start2_addr, len1_byte);
4077 if (len1_byte > 20000) 4067 SAFE_FREE (len1_byte);
4078 xfree (temp); 4068
4079 graft_intervals_into_buffer (tmp_interval1, start2, 4069 graft_intervals_into_buffer (tmp_interval1, start2,
4080 len1, current_buffer, 0); 4070 len1, current_buffer, 0);
4081 graft_intervals_into_buffer (tmp_interval2, start1, 4071 graft_intervals_into_buffer (tmp_interval2, start1,
@@ -4085,6 +4075,8 @@ Transposing beyond buffer boundaries is an error. */)
4085 else if (len1_byte < len2_byte) /* Second region larger than first */ 4075 else if (len1_byte < len2_byte) /* Second region larger than first */
4086 /* Non-adjacent & unequal size, area between must also be shifted. */ 4076 /* Non-adjacent & unequal size, area between must also be shifted. */
4087 { 4077 {
4078 USE_SAFE_ALLOCA;
4079
4088 modify_region (current_buffer, start1, end2); 4080 modify_region (current_buffer, start1, end2);
4089 record_change (start1, (end2 - start1)); 4081 record_change (start1, (end2 - start1));
4090 tmp_interval1 = copy_intervals (cur_intv, start1, len1); 4082 tmp_interval1 = copy_intervals (cur_intv, start1, len1);
@@ -4094,18 +4086,15 @@ Transposing beyond buffer boundaries is an error. */)
4094 Qnil, Qnil); 4086 Qnil, Qnil);
4095 4087
4096 /* holds region 2 */ 4088 /* holds region 2 */
4097 if (len2_byte > 20000) 4089 SAFE_ALLOCA (temp, unsigned char *, len2_byte);
4098 temp = (unsigned char *) xmalloc (len2_byte);
4099 else
4100 temp = (unsigned char *) alloca (len2_byte);
4101 start1_addr = BYTE_POS_ADDR (start1_byte); 4090 start1_addr = BYTE_POS_ADDR (start1_byte);
4102 start2_addr = BYTE_POS_ADDR (start2_byte); 4091 start2_addr = BYTE_POS_ADDR (start2_byte);
4103 bcopy (start2_addr, temp, len2_byte); 4092 bcopy (start2_addr, temp, len2_byte);
4104 bcopy (start1_addr, start1_addr + len_mid + len2_byte, len1_byte); 4093 bcopy (start1_addr, start1_addr + len_mid + len2_byte, len1_byte);
4105 safe_bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid); 4094 safe_bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid);
4106 bcopy (temp, start1_addr, len2_byte); 4095 bcopy (temp, start1_addr, len2_byte);
4107 if (len2_byte > 20000) 4096 SAFE_FREE (len2_byte);
4108 xfree (temp); 4097
4109 graft_intervals_into_buffer (tmp_interval1, end2 - len1, 4098 graft_intervals_into_buffer (tmp_interval1, end2 - len1,
4110 len1, current_buffer, 0); 4099 len1, current_buffer, 0);
4111 graft_intervals_into_buffer (tmp_interval_mid, start1 + len2, 4100 graft_intervals_into_buffer (tmp_interval_mid, start1 + len2,
@@ -4116,6 +4105,8 @@ Transposing beyond buffer boundaries is an error. */)
4116 else 4105 else
4117 /* Second region smaller than first. */ 4106 /* Second region smaller than first. */
4118 { 4107 {
4108 USE_SAFE_ALLOCA;
4109
4119 record_change (start1, (end2 - start1)); 4110 record_change (start1, (end2 - start1));
4120 modify_region (current_buffer, start1, end2); 4111 modify_region (current_buffer, start1, end2);
4121 4112
@@ -4126,18 +4117,15 @@ Transposing beyond buffer boundaries is an error. */)
4126 Qnil, Qnil); 4117 Qnil, Qnil);
4127 4118
4128 /* holds region 1 */ 4119 /* holds region 1 */
4129 if (len1_byte > 20000) 4120 SAFE_ALLOCA (temp, unsigned char *, len1_byte);
4130 temp = (unsigned char *) xmalloc (len1_byte);
4131 else
4132 temp = (unsigned char *) alloca (len1_byte);
4133 start1_addr = BYTE_POS_ADDR (start1_byte); 4121 start1_addr = BYTE_POS_ADDR (start1_byte);
4134 start2_addr = BYTE_POS_ADDR (start2_byte); 4122 start2_addr = BYTE_POS_ADDR (start2_byte);
4135 bcopy (start1_addr, temp, len1_byte); 4123 bcopy (start1_addr, temp, len1_byte);
4136 bcopy (start2_addr, start1_addr, len2_byte); 4124 bcopy (start2_addr, start1_addr, len2_byte);
4137 bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid); 4125 bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid);
4138 bcopy (temp, start1_addr + len2_byte + len_mid, len1_byte); 4126 bcopy (temp, start1_addr + len2_byte + len_mid, len1_byte);
4139 if (len1_byte > 20000) 4127 SAFE_FREE (len1_byte);
4140 xfree (temp); 4128
4141 graft_intervals_into_buffer (tmp_interval1, end2 - len1, 4129 graft_intervals_into_buffer (tmp_interval1, end2 - len1,
4142 len1, current_buffer, 0); 4130 len1, current_buffer, 0);
4143 graft_intervals_into_buffer (tmp_interval_mid, start1 + len2, 4131 graft_intervals_into_buffer (tmp_interval_mid, start1 + len2,
diff --git a/src/fns.c b/src/fns.c
index 6001d99fb49..7e84b775fbb 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -994,6 +994,8 @@ string_make_multibyte (string)
994{ 994{
995 unsigned char *buf; 995 unsigned char *buf;
996 int nbytes; 996 int nbytes;
997 Lisp_Object ret;
998 USE_SAFE_ALLOCA;
997 999
998 if (STRING_MULTIBYTE (string)) 1000 if (STRING_MULTIBYTE (string))
999 return string; 1001 return string;
@@ -1005,11 +1007,14 @@ string_make_multibyte (string)
1005 if (nbytes == SBYTES (string)) 1007 if (nbytes == SBYTES (string))
1006 return string; 1008 return string;
1007 1009
1008 buf = (unsigned char *) alloca (nbytes); 1010 SAFE_ALLOCA (buf, unsigned char *, nbytes);
1009 copy_text (SDATA (string), buf, SBYTES (string), 1011 copy_text (SDATA (string), buf, SBYTES (string),
1010 0, 1); 1012 0, 1);
1011 1013
1012 return make_multibyte_string (buf, SCHARS (string), nbytes); 1014 ret = make_multibyte_string (buf, SCHARS (string), nbytes);
1015 SAFE_FREE (nbytes);
1016
1017 return ret;
1013} 1018}
1014 1019
1015 1020
@@ -1024,6 +1029,8 @@ string_to_multibyte (string)
1024{ 1029{
1025 unsigned char *buf; 1030 unsigned char *buf;
1026 int nbytes; 1031 int nbytes;
1032 Lisp_Object ret;
1033 USE_SAFE_ALLOCA;
1027 1034
1028 if (STRING_MULTIBYTE (string)) 1035 if (STRING_MULTIBYTE (string))
1029 return string; 1036 return string;
@@ -1034,11 +1041,14 @@ string_to_multibyte (string)
1034 if (nbytes == SBYTES (string)) 1041 if (nbytes == SBYTES (string))
1035 return make_multibyte_string (SDATA (string), nbytes, nbytes); 1042 return make_multibyte_string (SDATA (string), nbytes, nbytes);
1036 1043
1037 buf = (unsigned char *) alloca (nbytes); 1044 SAFE_ALLOCA (buf, unsigned char *, nbytes);
1038 bcopy (SDATA (string), buf, SBYTES (string)); 1045 bcopy (SDATA (string), buf, SBYTES (string));
1039 str_to_multibyte (buf, nbytes, SBYTES (string)); 1046 str_to_multibyte (buf, nbytes, SBYTES (string));
1040 1047
1041 return make_multibyte_string (buf, SCHARS (string), nbytes); 1048 ret = make_multibyte_string (buf, SCHARS (string), nbytes);
1049 SAFE_FREE (nbytes);
1050
1051 return ret;
1042} 1052}
1043 1053
1044 1054
@@ -1048,17 +1058,24 @@ Lisp_Object
1048string_make_unibyte (string) 1058string_make_unibyte (string)
1049 Lisp_Object string; 1059 Lisp_Object string;
1050{ 1060{
1061 int nchars;
1051 unsigned char *buf; 1062 unsigned char *buf;
1063 Lisp_Object ret;
1064 USE_SAFE_ALLOCA;
1052 1065
1053 if (! STRING_MULTIBYTE (string)) 1066 if (! STRING_MULTIBYTE (string))
1054 return string; 1067 return string;
1055 1068
1056 buf = (unsigned char *) alloca (SCHARS (string)); 1069 nchars = SCHARS (string);
1057 1070
1071 SAFE_ALLOCA (buf, unsigned char *, nchars);
1058 copy_text (SDATA (string), buf, SBYTES (string), 1072 copy_text (SDATA (string), buf, SBYTES (string),
1059 1, 0); 1073 1, 0);
1060 1074
1061 return make_unibyte_string (buf, SCHARS (string)); 1075 ret = make_unibyte_string (buf, nchars);
1076 SAFE_FREE (nchars);
1077
1078 return ret;
1062} 1079}
1063 1080
1064DEFUN ("string-make-multibyte", Fstring_make_multibyte, Sstring_make_multibyte, 1081DEFUN ("string-make-multibyte", Fstring_make_multibyte, Sstring_make_multibyte,
@@ -2983,13 +3000,15 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
2983 register Lisp_Object *args; 3000 register Lisp_Object *args;
2984 register int i; 3001 register int i;
2985 struct gcpro gcpro1; 3002 struct gcpro gcpro1;
3003 Lisp_Object ret;
3004 USE_SAFE_ALLOCA;
2986 3005
2987 len = Flength (sequence); 3006 len = Flength (sequence);
2988 leni = XINT (len); 3007 leni = XINT (len);
2989 nargs = leni + leni - 1; 3008 nargs = leni + leni - 1;
2990 if (nargs < 0) return build_string (""); 3009 if (nargs < 0) return build_string ("");
2991 3010
2992 args = (Lisp_Object *) alloca (nargs * sizeof (Lisp_Object)); 3011 SAFE_ALLOCA_LISP (args, nargs);
2993 3012
2994 GCPRO1 (separator); 3013 GCPRO1 (separator);
2995 mapcar1 (leni, args, function, sequence); 3014 mapcar1 (leni, args, function, sequence);
@@ -3001,7 +3020,14 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
3001 for (i = 1; i < nargs; i += 2) 3020 for (i = 1; i < nargs; i += 2)
3002 args[i] = separator; 3021 args[i] = separator;
3003 3022
3004 return Fconcat (nargs, args); 3023 GCPRO1 (*args);
3024 gcpro1.nvars = nargs;
3025 ret = Fconcat (nargs, args);
3026 UNGCPRO;
3027
3028 SAFE_FREE_LISP (nargs);
3029
3030 return ret;
3005} 3031}
3006 3032
3007DEFUN ("mapcar", Fmapcar, Smapcar, 2, 2, 0, 3033DEFUN ("mapcar", Fmapcar, Smapcar, 2, 2, 0,
@@ -3014,14 +3040,25 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
3014 register Lisp_Object len; 3040 register Lisp_Object len;
3015 register int leni; 3041 register int leni;
3016 register Lisp_Object *args; 3042 register Lisp_Object *args;
3043 struct gcpro gcpro1;
3044 Lisp_Object ret;
3045 USE_SAFE_ALLOCA;
3017 3046
3018 len = Flength (sequence); 3047 len = Flength (sequence);
3019 leni = XFASTINT (len); 3048 leni = XFASTINT (len);
3020 args = (Lisp_Object *) alloca (leni * sizeof (Lisp_Object)); 3049
3050 SAFE_ALLOCA_LISP (args, leni);
3021 3051
3022 mapcar1 (leni, args, function, sequence); 3052 mapcar1 (leni, args, function, sequence);
3023 3053
3024 return Flist (leni, args); 3054 GCPRO1 (*args);
3055 gcpro1.nvars = leni;
3056 ret = Flist (leni, args);
3057 UNGCPRO;
3058
3059 SAFE_FREE_LISP (leni);
3060
3061 return ret;
3025} 3062}
3026 3063
3027DEFUN ("mapc", Fmapc, Smapc, 2, 2, 0, 3064DEFUN ("mapc", Fmapc, Smapc, 2, 2, 0,
@@ -3636,10 +3673,6 @@ The data read from the system are decoded using `locale-coding-system'. */)
3636 } \ 3673 } \
3637 while (IS_BASE64_IGNORABLE (c)) 3674 while (IS_BASE64_IGNORABLE (c))
3638 3675
3639/* Don't use alloca for regions larger than this, lest we overflow
3640 their stack. */
3641#define MAX_ALLOCA 16*1024
3642
3643/* Table of characters coding the 64 values. */ 3676/* Table of characters coding the 64 values. */
3644static char base64_value_to_char[64] = 3677static char base64_value_to_char[64] =
3645{ 3678{
@@ -3705,6 +3738,7 @@ into shorter lines. */)
3705 int allength, length; 3738 int allength, length;
3706 int ibeg, iend, encoded_length; 3739 int ibeg, iend, encoded_length;
3707 int old_pos = PT; 3740 int old_pos = PT;
3741 USE_SAFE_ALLOCA;
3708 3742
3709 validate_region (&beg, &end); 3743 validate_region (&beg, &end);
3710 3744
@@ -3719,10 +3753,7 @@ into shorter lines. */)
3719 allength = length + length/3 + 1; 3753 allength = length + length/3 + 1;
3720 allength += allength / MIME_LINE_LENGTH + 1 + 6; 3754 allength += allength / MIME_LINE_LENGTH + 1 + 6;
3721 3755
3722 if (allength <= MAX_ALLOCA) 3756 SAFE_ALLOCA (encoded, char *, allength);
3723 encoded = (char *) alloca (allength);
3724 else
3725 encoded = (char *) xmalloc (allength);
3726 encoded_length = base64_encode_1 (BYTE_POS_ADDR (ibeg), encoded, length, 3757 encoded_length = base64_encode_1 (BYTE_POS_ADDR (ibeg), encoded, length,
3727 NILP (no_line_break), 3758 NILP (no_line_break),
3728 !NILP (current_buffer->enable_multibyte_characters)); 3759 !NILP (current_buffer->enable_multibyte_characters));
@@ -3732,8 +3763,7 @@ into shorter lines. */)
3732 if (encoded_length < 0) 3763 if (encoded_length < 0)
3733 { 3764 {
3734 /* The encoding wasn't possible. */ 3765 /* The encoding wasn't possible. */
3735 if (length > MAX_ALLOCA) 3766 SAFE_FREE (allength);
3736 xfree (encoded);
3737 error ("Multibyte character in data for base64 encoding"); 3767 error ("Multibyte character in data for base64 encoding");
3738 } 3768 }
3739 3769
@@ -3741,8 +3771,7 @@ into shorter lines. */)
3741 and delete the old. (Insert first in order to preserve markers.) */ 3771 and delete the old. (Insert first in order to preserve markers.) */
3742 SET_PT_BOTH (XFASTINT (beg), ibeg); 3772 SET_PT_BOTH (XFASTINT (beg), ibeg);
3743 insert (encoded, encoded_length); 3773 insert (encoded, encoded_length);
3744 if (allength > MAX_ALLOCA) 3774 SAFE_FREE (allength);
3745 xfree (encoded);
3746 del_range_byte (ibeg + encoded_length, iend + encoded_length, 1); 3775 del_range_byte (ibeg + encoded_length, iend + encoded_length, 1);
3747 3776
3748 /* If point was outside of the region, restore it exactly; else just 3777 /* If point was outside of the region, restore it exactly; else just
@@ -3768,6 +3797,7 @@ into shorter lines. */)
3768 int allength, length, encoded_length; 3797 int allength, length, encoded_length;
3769 char *encoded; 3798 char *encoded;
3770 Lisp_Object encoded_string; 3799 Lisp_Object encoded_string;
3800 USE_SAFE_ALLOCA;
3771 3801
3772 CHECK_STRING (string); 3802 CHECK_STRING (string);
3773 3803
@@ -3779,10 +3809,7 @@ into shorter lines. */)
3779 allength += allength / MIME_LINE_LENGTH + 1 + 6; 3809 allength += allength / MIME_LINE_LENGTH + 1 + 6;
3780 3810
3781 /* We need to allocate enough room for decoding the text. */ 3811 /* We need to allocate enough room for decoding the text. */
3782 if (allength <= MAX_ALLOCA) 3812 SAFE_ALLOCA (encoded, char *, allength);
3783 encoded = (char *) alloca (allength);
3784 else
3785 encoded = (char *) xmalloc (allength);
3786 3813
3787 encoded_length = base64_encode_1 (SDATA (string), 3814 encoded_length = base64_encode_1 (SDATA (string),
3788 encoded, length, NILP (no_line_break), 3815 encoded, length, NILP (no_line_break),
@@ -3793,14 +3820,12 @@ into shorter lines. */)
3793 if (encoded_length < 0) 3820 if (encoded_length < 0)
3794 { 3821 {
3795 /* The encoding wasn't possible. */ 3822 /* The encoding wasn't possible. */
3796 if (length > MAX_ALLOCA) 3823 SAFE_FREE (allength);
3797 xfree (encoded);
3798 error ("Multibyte character in data for base64 encoding"); 3824 error ("Multibyte character in data for base64 encoding");
3799 } 3825 }
3800 3826
3801 encoded_string = make_unibyte_string (encoded, encoded_length); 3827 encoded_string = make_unibyte_string (encoded, encoded_length);
3802 if (allength > MAX_ALLOCA) 3828 SAFE_FREE (allength);
3803 xfree (encoded);
3804 3829
3805 return encoded_string; 3830 return encoded_string;
3806} 3831}
@@ -3913,6 +3938,7 @@ If the region can't be decoded, signal an error and don't modify the buffer. */
3913 int decoded_length; 3938 int decoded_length;
3914 int inserted_chars; 3939 int inserted_chars;
3915 int multibyte = !NILP (current_buffer->enable_multibyte_characters); 3940 int multibyte = !NILP (current_buffer->enable_multibyte_characters);
3941 USE_SAFE_ALLOCA;
3916 3942
3917 validate_region (&beg, &end); 3943 validate_region (&beg, &end);
3918 3944
@@ -3925,10 +3951,7 @@ If the region can't be decoded, signal an error and don't modify the buffer. */
3925 working on a multibyte buffer, each decoded code may occupy at 3951 working on a multibyte buffer, each decoded code may occupy at
3926 most two bytes. */ 3952 most two bytes. */
3927 allength = multibyte ? length * 2 : length; 3953 allength = multibyte ? length * 2 : length;
3928 if (allength <= MAX_ALLOCA) 3954 SAFE_ALLOCA (decoded, char *, allength);
3929 decoded = (char *) alloca (allength);
3930 else
3931 decoded = (char *) xmalloc (allength);
3932 3955
3933 move_gap_both (XFASTINT (beg), ibeg); 3956 move_gap_both (XFASTINT (beg), ibeg);
3934 decoded_length = base64_decode_1 (BYTE_POS_ADDR (ibeg), decoded, length, 3957 decoded_length = base64_decode_1 (BYTE_POS_ADDR (ibeg), decoded, length,
@@ -3939,8 +3962,7 @@ If the region can't be decoded, signal an error and don't modify the buffer. */
3939 if (decoded_length < 0) 3962 if (decoded_length < 0)
3940 { 3963 {
3941 /* The decoding wasn't possible. */ 3964 /* The decoding wasn't possible. */
3942 if (allength > MAX_ALLOCA) 3965 SAFE_FREE (allength);
3943 xfree (decoded);
3944 error ("Invalid base64 data"); 3966 error ("Invalid base64 data");
3945 } 3967 }
3946 3968
@@ -3948,8 +3970,8 @@ If the region can't be decoded, signal an error and don't modify the buffer. */
3948 and delete the old. (Insert first in order to preserve markers.) */ 3970 and delete the old. (Insert first in order to preserve markers.) */
3949 TEMP_SET_PT_BOTH (XFASTINT (beg), ibeg); 3971 TEMP_SET_PT_BOTH (XFASTINT (beg), ibeg);
3950 insert_1_both (decoded, inserted_chars, decoded_length, 0, 1, 0); 3972 insert_1_both (decoded, inserted_chars, decoded_length, 0, 1, 0);
3951 if (allength > MAX_ALLOCA) 3973 SAFE_FREE (allength);
3952 xfree (decoded); 3974
3953 /* Delete the original text. */ 3975 /* Delete the original text. */
3954 del_range_both (PT, PT_BYTE, XFASTINT (end) + inserted_chars, 3976 del_range_both (PT, PT_BYTE, XFASTINT (end) + inserted_chars,
3955 iend + decoded_length, 1); 3977 iend + decoded_length, 1);
@@ -3974,15 +3996,13 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string,
3974 char *decoded; 3996 char *decoded;
3975 int length, decoded_length; 3997 int length, decoded_length;
3976 Lisp_Object decoded_string; 3998 Lisp_Object decoded_string;
3999 USE_SAFE_ALLOCA;
3977 4000
3978 CHECK_STRING (string); 4001 CHECK_STRING (string);
3979 4002
3980 length = SBYTES (string); 4003 length = SBYTES (string);
3981 /* We need to allocate enough room for decoding the text. */ 4004 /* We need to allocate enough room for decoding the text. */
3982 if (length <= MAX_ALLOCA) 4005 SAFE_ALLOCA (decoded, char *, length);
3983 decoded = (char *) alloca (length);
3984 else
3985 decoded = (char *) xmalloc (length);
3986 4006
3987 /* The decoded result should be unibyte. */ 4007 /* The decoded result should be unibyte. */
3988 decoded_length = base64_decode_1 (SDATA (string), decoded, length, 4008 decoded_length = base64_decode_1 (SDATA (string), decoded, length,
@@ -3994,8 +4014,7 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string,
3994 else 4014 else
3995 decoded_string = Qnil; 4015 decoded_string = Qnil;
3996 4016
3997 if (length > MAX_ALLOCA) 4017 SAFE_FREE (length);
3998 xfree (decoded);
3999 if (!STRINGP (decoded_string)) 4018 if (!STRINGP (decoded_string))
4000 error ("Invalid base64 data"); 4019 error ("Invalid base64 data");
4001 4020
diff --git a/src/image.c b/src/image.c
index 3eccf0f001e..438e132807f 100644
--- a/src/image.c
+++ b/src/image.c
@@ -689,6 +689,10 @@ lookup_image_type (symbol)
689{ 689{
690 struct image_type *type; 690 struct image_type *type;
691 691
692 /* We must initialize the image-type if it hasn't been already. */
693 if (NILP (Finit_image_library (symbol)))
694 return 0; /* unimplemented */
695
692 for (type = image_types; type; type = type->next) 696 for (type = image_types; type; type = type->next)
693 if (EQ (symbol, *type->type)) 697 if (EQ (symbol, *type->type))
694 break; 698 break;
diff --git a/src/keyboard.c b/src/keyboard.c
index de2bcf825a0..e9c9edbd239 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -670,6 +670,8 @@ static void handle_interrupt P_ ((void));
670 to support it. */ 670 to support it. */
671static int cannot_suspend; 671static int cannot_suspend;
672 672
673extern Lisp_Object Qidentity, Qonly;
674
673/* Install the string STR as the beginning of the string of echoing, 675/* Install the string STR as the beginning of the string of echoing,
674 so that it serves as a prompt for the next character. 676 so that it serves as a prompt for the next character.
675 Also start echoing. */ 677 Also start echoing. */
@@ -1809,6 +1811,16 @@ command_loop_1 ()
1809 call1 (Vrun_hooks, intern ("activate-mark-hook")); 1811 call1 (Vrun_hooks, intern ("activate-mark-hook"));
1810 } 1812 }
1811 1813
1814 /* Setting transient-mark-mode to `only' is a way of
1815 turning it on for just one command. */
1816 if (!NILP (current_buffer->mark_active) && !NILP (Vrun_hooks))
1817 {
1818 if (EQ (Vtransient_mark_mode, Qidentity))
1819 Vtransient_mark_mode = Qnil;
1820 if (EQ (Vtransient_mark_mode, Qonly))
1821 Vtransient_mark_mode = Qidentity;
1822 }
1823
1812 finalize: 1824 finalize:
1813 1825
1814 if (current_buffer == prev_buffer 1826 if (current_buffer == prev_buffer
diff --git a/src/keymap.c b/src/keymap.c
index 30d66972094..42bbeb92a18 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -2283,7 +2283,11 @@ push_text_char_description (c, p)
2283 2283
2284DEFUN ("text-char-description", Ftext_char_description, Stext_char_description, 1, 1, 0, 2284DEFUN ("text-char-description", Ftext_char_description, Stext_char_description, 1, 1, 0,
2285 doc: /* Return a pretty description of file-character CHARACTER. 2285 doc: /* Return a pretty description of file-character CHARACTER.
2286Control characters turn into "^char", etc. */) 2286Control characters turn into "^char", etc. This differs from
2287`single-key-description' which turns them into "C-char".
2288Also, this function recognizes the 2**7 bit as the Meta character,
2289whereas `single-key-description' uses the 2**27 bit for Meta.
2290See Info node `(elisp)Describing Characters' for examples. */)
2287 (character) 2291 (character)
2288 Lisp_Object character; 2292 Lisp_Object character;
2289{ 2293{
diff --git a/src/lisp.h b/src/lisp.h
index fdf76399e5d..ba2508e827b 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1199,7 +1199,10 @@ struct Lisp_Save_Value
1199 { 1199 {
1200 int type : 16; /* = Lisp_Misc_Save_Value */ 1200 int type : 16; /* = Lisp_Misc_Save_Value */
1201 unsigned gcmarkbit : 1; 1201 unsigned gcmarkbit : 1;
1202 int spacer : 15; 1202 int spacer : 14;
1203 /* If DOGC is set, POINTER is the address of a memory
1204 area containing INTEGER potential Lisp_Objects. */
1205 unsigned int dogc : 1;
1203 void *pointer; 1206 void *pointer;
1204 int integer; 1207 int integer;
1205 }; 1208 };
@@ -3248,6 +3251,64 @@ extern Lisp_Object Vdirectory_sep_char;
3248 : Fcons ((el), (check))))) 3251 : Fcons ((el), (check)))))
3249 3252
3250 3253
3254/* SAFE_ALLOCA normally allocates memory on the stack, but if size is
3255 larger than MAX_ALLOCA, use xmalloc to avoid overflowing the stack. */
3256
3257#define MAX_ALLOCA 16*1024
3258
3259extern Lisp_Object safe_alloca_unwind (Lisp_Object);
3260
3261#define USE_SAFE_ALLOCA \
3262 int sa_count = SPECPDL_INDEX ()
3263
3264/* SAFE_ALLOCA allocates a simple buffer. */
3265
3266#define SAFE_ALLOCA(buf, type, size) \
3267 do { \
3268 if ((size) < MAX_ALLOCA) \
3269 buf = (type) alloca (size); \
3270 else \
3271 { \
3272 buf = (type) xmalloc (size); \
3273 record_unwind_protect (safe_alloca_unwind, \
3274 make_save_value (buf, 0)); \
3275 } \
3276 } while (0)
3277
3278/* SAFE_FREE frees xmalloced memory and enables GC as needed. */
3279
3280#define SAFE_FREE(size) \
3281 do { \
3282 if ((size) >= MAX_ALLOCA) \
3283 unbind_to (sa_count, Qnil); \
3284 } while (0)
3285
3286
3287/* SAFE_ALLOCA_LISP allocates an array of Lisp_Objects. */
3288
3289#define SAFE_ALLOCA_LISP(buf, nelt) \
3290 do { \
3291 int size_ = (nelt) * sizeof (Lisp_Object); \
3292 if (size_ < MAX_ALLOCA) \
3293 buf = (Lisp_Object *) alloca (size_); \
3294 else \
3295 { \
3296 Lisp_Object arg_; \
3297 buf = (Lisp_Object *) xmalloc (size_); \
3298 arg_ = make_save_value (buf, nelt); \
3299 XSAVE_VALUE (arg_)->dogc = 1; \
3300 record_unwind_protect (safe_alloca_unwind, arg_); \
3301 } \
3302 } while (0)
3303
3304#define SAFE_FREE_LISP(nelt) \
3305 do { \
3306 if (((nelt) * sizeof (Lisp_Object)) >= MAX_ALLOCA) \
3307 unbind_to (sa_count, Qnil); \
3308 } while (0)
3309
3310
3311
3251#endif /* EMACS_LISP_H */ 3312#endif /* EMACS_LISP_H */
3252 3313
3253/* arch-tag: 9b2ed020-70eb-47ac-94ee-e1c2a5107d5e 3314/* arch-tag: 9b2ed020-70eb-47ac-94ee-e1c2a5107d5e
diff --git a/src/macfns.c b/src/macfns.c
index 5c1b7770640..ec014e772e3 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -2939,8 +2939,8 @@ If omitted or nil, that stands for the selected frame's display. */)
2939{ 2939{
2940 struct mac_display_info *dpyinfo = check_x_display_info (display); 2940 struct mac_display_info *dpyinfo = check_x_display_info (display);
2941 2941
2942 /* MAC_TODO: check whether this is right */ 2942 /* We force 24+ bit depths to 24-bit to prevent an overflow. */
2943 return make_number (dpyinfo->n_planes >= 8 ? 256 : 1 << dpyinfo->n_planes - 1); 2943 return make_number (1 << min (dpyinfo->n_planes, 24));
2944} 2944}
2945 2945
2946DEFUN ("x-server-max-request-size", Fx_server_max_request_size, 2946DEFUN ("x-server-max-request-size", Fx_server_max_request_size,
diff --git a/src/macterm.c b/src/macterm.c
index 6a3cad56f46..2af910c5003 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -8840,10 +8840,16 @@ mac_initialize_display_info ()
8840 dpyinfo->resx = 75.0; 8840 dpyinfo->resx = 75.0;
8841 dpyinfo->resy = 75.0; 8841 dpyinfo->resy = 75.0;
8842 dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType); 8842 dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType);
8843#ifdef MAC_OSX
8844 /* HasDepth returns true if it is possible to have a 32 bit display,
8845 but this may not be what is actually used. Mac OSX can do better. */
8846 dpyinfo->n_planes = CGDisplayBitsPerPixel (CGMainDisplayID ());
8847#else
8843 for (dpyinfo->n_planes = 32; dpyinfo->n_planes > 0; dpyinfo->n_planes >>= 1) 8848 for (dpyinfo->n_planes = 32; dpyinfo->n_planes > 0; dpyinfo->n_planes >>= 1)
8844 if (HasDepth (main_device_handle, dpyinfo->n_planes, 8849 if (HasDepth (main_device_handle, dpyinfo->n_planes,
8845 gdDevType, dpyinfo->color_p)) 8850 gdDevType, dpyinfo->color_p))
8846 break; 8851 break;
8852#endif
8847 dpyinfo->height = (**main_device_handle).gdRect.bottom; 8853 dpyinfo->height = (**main_device_handle).gdRect.bottom;
8848 dpyinfo->width = (**main_device_handle).gdRect.right; 8854 dpyinfo->width = (**main_device_handle).gdRect.right;
8849 dpyinfo->grabbed = 0; 8855 dpyinfo->grabbed = 0;
diff --git a/src/minibuf.c b/src/minibuf.c
index 2f05a56d7dd..d28a5799afa 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1212,6 +1212,7 @@ is used to further constrain the set of candidates. */)
1212 || NILP (XCAR (alist)))); 1212 || NILP (XCAR (alist))));
1213 int index = 0, obsize = 0; 1213 int index = 0, obsize = 0;
1214 int matchcount = 0; 1214 int matchcount = 0;
1215 int bindcount = -1;
1215 Lisp_Object bucket, zero, end, tem; 1216 Lisp_Object bucket, zero, end, tem;
1216 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 1217 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
1217 1218
@@ -1290,21 +1291,22 @@ is used to further constrain the set of candidates. */)
1290 XSETFASTINT (zero, 0); 1291 XSETFASTINT (zero, 0);
1291 1292
1292 /* Ignore this element if it fails to match all the regexps. */ 1293 /* Ignore this element if it fails to match all the regexps. */
1293 if (CONSP (Vcompletion_regexp_list)) 1294 {
1294 { 1295 for (regexps = Vcompletion_regexp_list; CONSP (regexps);
1295 int count = SPECPDL_INDEX (); 1296 regexps = XCDR (regexps))
1296 specbind (Qcase_fold_search, completion_ignore_case ? Qt : Qnil); 1297 {
1297 for (regexps = Vcompletion_regexp_list; CONSP (regexps); 1298 if (bindcount < 0) {
1298 regexps = XCDR (regexps)) 1299 bindcount = SPECPDL_INDEX ();
1299 { 1300 specbind (Qcase_fold_search,
1300 tem = Fstring_match (XCAR (regexps), eltstring, zero); 1301 completion_ignore_case ? Qt : Qnil);
1301 if (NILP (tem))
1302 break;
1303 } 1302 }
1304 unbind_to (count, Qnil); 1303 tem = Fstring_match (XCAR (regexps), eltstring, zero);
1305 if (CONSP (regexps)) 1304 if (NILP (tem))
1306 continue; 1305 break;
1307 } 1306 }
1307 if (CONSP (regexps))
1308 continue;
1309 }
1308 1310
1309 /* Ignore this element if there is a predicate 1311 /* Ignore this element if there is a predicate
1310 and the predicate doesn't like it. */ 1312 and the predicate doesn't like it. */
@@ -1315,6 +1317,10 @@ is used to further constrain the set of candidates. */)
1315 tem = Fcommandp (elt, Qnil); 1317 tem = Fcommandp (elt, Qnil);
1316 else 1318 else
1317 { 1319 {
1320 if (bindcount >= 0) {
1321 unbind_to (bindcount, Qnil);
1322 bindcount = -1;
1323 }
1318 GCPRO4 (tail, string, eltstring, bestmatch); 1324 GCPRO4 (tail, string, eltstring, bestmatch);
1319 tem = type == 3 1325 tem = type == 3
1320 ? call2 (predicate, elt, 1326 ? call2 (predicate, elt,
@@ -1396,6 +1402,11 @@ is used to further constrain the set of candidates. */)
1396 } 1402 }
1397 } 1403 }
1398 1404
1405 if (bindcount >= 0) {
1406 unbind_to (bindcount, Qnil);
1407 bindcount = -1;
1408 }
1409
1399 if (NILP (bestmatch)) 1410 if (NILP (bestmatch))
1400 return Qnil; /* No completions found */ 1411 return Qnil; /* No completions found */
1401 /* If we are ignoring case, and there is no exact match, 1412 /* If we are ignoring case, and there is no exact match,
@@ -1458,6 +1469,7 @@ are ignored unless STRING itself starts with a space. */)
1458 && (!SYMBOLP (XCAR (alist)) 1469 && (!SYMBOLP (XCAR (alist))
1459 || NILP (XCAR (alist)))); 1470 || NILP (XCAR (alist))));
1460 int index = 0, obsize = 0; 1471 int index = 0, obsize = 0;
1472 int bindcount = -1;
1461 Lisp_Object bucket, tem; 1473 Lisp_Object bucket, tem;
1462 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 1474 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
1463 1475
@@ -1542,21 +1554,22 @@ are ignored unless STRING itself starts with a space. */)
1542 XSETFASTINT (zero, 0); 1554 XSETFASTINT (zero, 0);
1543 1555
1544 /* Ignore this element if it fails to match all the regexps. */ 1556 /* Ignore this element if it fails to match all the regexps. */
1545 if (CONSP (Vcompletion_regexp_list)) 1557 {
1546 { 1558 for (regexps = Vcompletion_regexp_list; CONSP (regexps);
1547 int count = SPECPDL_INDEX (); 1559 regexps = XCDR (regexps))
1548 specbind (Qcase_fold_search, completion_ignore_case ? Qt : Qnil); 1560 {
1549 for (regexps = Vcompletion_regexp_list; CONSP (regexps); 1561 if (bindcount < 0) {
1550 regexps = XCDR (regexps)) 1562 bindcount = SPECPDL_INDEX ();
1551 { 1563 specbind (Qcase_fold_search,
1552 tem = Fstring_match (XCAR (regexps), eltstring, zero); 1564 completion_ignore_case ? Qt : Qnil);
1553 if (NILP (tem))
1554 break;
1555 } 1565 }
1556 unbind_to (count, Qnil); 1566 tem = Fstring_match (XCAR (regexps), eltstring, zero);
1557 if (CONSP (regexps)) 1567 if (NILP (tem))
1558 continue; 1568 break;
1559 } 1569 }
1570 if (CONSP (regexps))
1571 continue;
1572 }
1560 1573
1561 /* Ignore this element if there is a predicate 1574 /* Ignore this element if there is a predicate
1562 and the predicate doesn't like it. */ 1575 and the predicate doesn't like it. */
@@ -1567,6 +1580,10 @@ are ignored unless STRING itself starts with a space. */)
1567 tem = Fcommandp (elt, Qnil); 1580 tem = Fcommandp (elt, Qnil);
1568 else 1581 else
1569 { 1582 {
1583 if (bindcount >= 0) {
1584 unbind_to (bindcount, Qnil);
1585 bindcount = -1;
1586 }
1570 GCPRO4 (tail, eltstring, allmatches, string); 1587 GCPRO4 (tail, eltstring, allmatches, string);
1571 tem = type == 3 1588 tem = type == 3
1572 ? call2 (predicate, elt, 1589 ? call2 (predicate, elt,
@@ -1581,6 +1598,11 @@ are ignored unless STRING itself starts with a space. */)
1581 } 1598 }
1582 } 1599 }
1583 1600
1601 if (bindcount >= 0) {
1602 unbind_to (bindcount, Qnil);
1603 bindcount = -1;
1604 }
1605
1584 return Fnreverse (allmatches); 1606 return Fnreverse (allmatches);
1585} 1607}
1586 1608
diff --git a/src/print.c b/src/print.c
index a91276d409a..0abd30b5ce0 100644
--- a/src/print.c
+++ b/src/print.c
@@ -658,7 +658,7 @@ If variable `temp-buffer-show-function' is non-nil, call it at the end
658to get the buffer displayed instead of just displaying the non-selected 658to get the buffer displayed instead of just displaying the non-selected
659buffer and calling the hook. It gets one argument, the buffer to display. 659buffer and calling the hook. It gets one argument, the buffer to display.
660 660
661usage: (with-output-to-temp-buffer BUFFNAME BODY ...) */) 661usage: (with-output-to-temp-buffer BUFNAME BODY ...) */)
662 (args) 662 (args)
663 Lisp_Object args; 663 Lisp_Object args;
664{ 664{
diff --git a/src/search.c b/src/search.c
index 24f21f053a5..dc1ca91e38f 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2589,15 +2589,20 @@ since only regular expressions have distinguished subexpressions. */)
2589 /* Adjust search data for this change. */ 2589 /* Adjust search data for this change. */
2590 { 2590 {
2591 int oldend = search_regs.end[sub]; 2591 int oldend = search_regs.end[sub];
2592 int oldstart = search_regs.start[sub];
2592 int change = newpoint - search_regs.end[sub]; 2593 int change = newpoint - search_regs.end[sub];
2593 int i; 2594 int i;
2594 2595
2595 for (i = 0; i < search_regs.num_regs; i++) 2596 for (i = 0; i < search_regs.num_regs; i++)
2596 { 2597 {
2597 if (search_regs.start[i] > oldend) 2598 if (search_regs.start[i] >= oldend)
2598 search_regs.start[i] += change; 2599 search_regs.start[i] += change;
2599 if (search_regs.end[i] > oldend) 2600 else if (search_regs.start[i] > oldstart)
2601 search_regs.start[i] = oldstart;
2602 if (search_regs.end[i] >= oldend)
2600 search_regs.end[i] += change; 2603 search_regs.end[i] += change;
2604 else if (search_regs.end[i] > oldstart)
2605 search_regs.end[i] = oldstart;
2601 } 2606 }
2602 } 2607 }
2603 2608
@@ -2622,8 +2627,10 @@ match_limit (num, beginningp)
2622 2627
2623 CHECK_NUMBER (num); 2628 CHECK_NUMBER (num);
2624 n = XINT (num); 2629 n = XINT (num);
2625 if (n < 0 || search_regs.num_regs <= 0) 2630 if (n < 0)
2626 args_out_of_range (num, make_number (search_regs.num_regs)); 2631 args_out_of_range (num, 0);
2632 if (search_regs.num_regs <= 0)
2633 error ("No match data, because no search succeeded");
2627 if (n >= search_regs.num_regs 2634 if (n >= search_regs.num_regs
2628 || search_regs.start[n] < 0) 2635 || search_regs.start[n] < 0)
2629 return Qnil; 2636 return Qnil;
@@ -2664,8 +2671,11 @@ All the elements are markers or nil (nil if the Nth pair didn't match)
2664if the last match was on a buffer; integers or nil if a string was matched. 2671if the last match was on a buffer; integers or nil if a string was matched.
2665Use `store-match-data' to reinstate the data in this list. 2672Use `store-match-data' to reinstate the data in this list.
2666 2673
2667If INTEGERS (the optional first argument) is non-nil, always use integers 2674If INTEGERS (the optional first argument) is non-nil, always use
2668\(rather than markers) to represent buffer positions. 2675integers \(rather than markers) to represent buffer positions. In
2676this case, and if the last match was in a buffer, the buffer will get
2677stored as one additional element at the end of the list.
2678
2669If REUSE is a list, reuse it as part of the value. If REUSE is long enough 2679If REUSE is a list, reuse it as part of the value. If REUSE is long enough
2670to hold all the values, and if INTEGERS is non-nil, no consing is done. 2680to hold all the values, and if INTEGERS is non-nil, no consing is done.
2671 2681
@@ -2682,10 +2692,10 @@ Return value is undefined if the last search failed. */)
2682 2692
2683 prev = Qnil; 2693 prev = Qnil;
2684 2694
2685 data = (Lisp_Object *) alloca ((2 * search_regs.num_regs) 2695 data = (Lisp_Object *) alloca ((2 * search_regs.num_regs + 1)
2686 * sizeof (Lisp_Object)); 2696 * sizeof (Lisp_Object));
2687 2697
2688 len = -1; 2698 len = 0;
2689 for (i = 0; i < search_regs.num_regs; i++) 2699 for (i = 0; i < search_regs.num_regs; i++)
2690 { 2700 {
2691 int start = search_regs.start[i]; 2701 int start = search_regs.start[i];
@@ -2712,22 +2722,29 @@ Return value is undefined if the last search failed. */)
2712 /* last_thing_searched must always be Qt, a buffer, or Qnil. */ 2722 /* last_thing_searched must always be Qt, a buffer, or Qnil. */
2713 abort (); 2723 abort ();
2714 2724
2715 len = i; 2725 len = 2*(i+1);
2716 } 2726 }
2717 else 2727 else
2718 data[2 * i] = data [2 * i + 1] = Qnil; 2728 data[2 * i] = data [2 * i + 1] = Qnil;
2719 } 2729 }
2720 2730
2731 if (BUFFERP(last_thing_searched)
2732 && ! NILP (integers))
2733 {
2734 XSETBUFFER(data[len], last_thing_searched);
2735 len++;
2736 }
2737
2721 /* If REUSE is not usable, cons up the values and return them. */ 2738 /* If REUSE is not usable, cons up the values and return them. */
2722 if (! CONSP (reuse)) 2739 if (! CONSP (reuse))
2723 return Flist (2 * len + 2, data); 2740 return Flist (len, data);
2724 2741
2725 /* If REUSE is a list, store as many value elements as will fit 2742 /* If REUSE is a list, store as many value elements as will fit
2726 into the elements of REUSE. */ 2743 into the elements of REUSE. */
2727 for (i = 0, tail = reuse; CONSP (tail); 2744 for (i = 0, tail = reuse; CONSP (tail);
2728 i++, tail = XCDR (tail)) 2745 i++, tail = XCDR (tail))
2729 { 2746 {
2730 if (i < 2 * len + 2) 2747 if (i < len)
2731 XSETCAR (tail, data[i]); 2748 XSETCAR (tail, data[i]);
2732 else 2749 else
2733 XSETCAR (tail, Qnil); 2750 XSETCAR (tail, Qnil);
@@ -2736,8 +2753,8 @@ Return value is undefined if the last search failed. */)
2736 2753
2737 /* If we couldn't fit all value elements into REUSE, 2754 /* If we couldn't fit all value elements into REUSE,
2738 cons up the rest of them and add them to the end of REUSE. */ 2755 cons up the rest of them and add them to the end of REUSE. */
2739 if (i < 2 * len + 2) 2756 if (i < len)
2740 XSETCDR (prev, Flist (2 * len + 2 - i, data + i)); 2757 XSETCDR (prev, Flist (len - i, data + i));
2741 2758
2742 return reuse; 2759 return reuse;
2743} 2760}
@@ -2758,8 +2775,8 @@ LIST should have been created by calling `match-data' previously. */)
2758 if (!CONSP (list) && !NILP (list)) 2775 if (!CONSP (list) && !NILP (list))
2759 list = wrong_type_argument (Qconsp, list); 2776 list = wrong_type_argument (Qconsp, list);
2760 2777
2761 /* Unless we find a marker with a buffer in LIST, assume that this 2778 /* Unless we find a marker with a buffer or an explicit buffer
2762 match data came from a string. */ 2779 in LIST, assume that this match data came from a string. */
2763 last_thing_searched = Qt; 2780 last_thing_searched = Qt;
2764 2781
2765 /* Allocate registers if they don't already exist. */ 2782 /* Allocate registers if they don't already exist. */
@@ -2790,42 +2807,49 @@ LIST should have been created by calling `match-data' previously. */)
2790 2807
2791 search_regs.num_regs = length; 2808 search_regs.num_regs = length;
2792 } 2809 }
2793 }
2794 2810
2795 for (i = 0; i < search_regs.num_regs; i++) 2811 for (i = 0; i < length; i++)
2796 { 2812 {
2797 marker = Fcar (list); 2813 marker = Fcar (list);
2798 if (NILP (marker)) 2814 if (NILP (marker))
2799 { 2815 {
2800 search_regs.start[i] = -1; 2816 search_regs.start[i] = -1;
2801 list = Fcdr (list); 2817 list = Fcdr (list);
2802 } 2818 }
2803 else 2819 else
2804 { 2820 {
2805 int from; 2821 int from;
2806 2822
2807 if (MARKERP (marker)) 2823 if (MARKERP (marker))
2808 { 2824 {
2809 if (XMARKER (marker)->buffer == 0) 2825 if (XMARKER (marker)->buffer == 0)
2810 XSETFASTINT (marker, 0); 2826 XSETFASTINT (marker, 0);
2811 else 2827 else
2812 XSETBUFFER (last_thing_searched, XMARKER (marker)->buffer); 2828 XSETBUFFER (last_thing_searched, XMARKER (marker)->buffer);
2813 } 2829 }
2814 2830
2815 CHECK_NUMBER_COERCE_MARKER (marker); 2831 CHECK_NUMBER_COERCE_MARKER (marker);
2816 from = XINT (marker); 2832 from = XINT (marker);
2817 list = Fcdr (list); 2833 list = Fcdr (list);
2834
2835 marker = Fcar (list);
2836 if (MARKERP (marker) && XMARKER (marker)->buffer == 0)
2837 XSETFASTINT (marker, 0);
2838
2839 CHECK_NUMBER_COERCE_MARKER (marker);
2840 search_regs.start[i] = from;
2841 search_regs.end[i] = XINT (marker);
2842 }
2843 list = Fcdr (list);
2844 }
2818 2845
2819 marker = Fcar (list); 2846 for (; i < search_regs.num_regs; i++)
2820 if (MARKERP (marker) && XMARKER (marker)->buffer == 0) 2847 search_regs.start[i] = -1;
2821 XSETFASTINT (marker, 0); 2848 }
2822 2849
2823 CHECK_NUMBER_COERCE_MARKER (marker); 2850 if (CONSP(list) && BUFFERP(XCAR(list))) {
2824 search_regs.start[i] = from; 2851 XSETBUFFER(last_thing_searched, XCAR(list));
2825 search_regs.end[i] = XINT (marker); 2852 }
2826 }
2827 list = Fcdr (list);
2828 }
2829 2853
2830 return Qnil; 2854 return Qnil;
2831} 2855}
@@ -2834,6 +2858,7 @@ LIST should have been created by calling `match-data' previously. */)
2834 during the execution of a sentinel or filter. */ 2858 during the execution of a sentinel or filter. */
2835static int search_regs_saved; 2859static int search_regs_saved;
2836static struct re_registers saved_search_regs; 2860static struct re_registers saved_search_regs;
2861static Lisp_Object saved_last_thing_searched;
2837 2862
2838/* Called from Flooking_at, Fstring_match, search_buffer, Fstore_match_data 2863/* Called from Flooking_at, Fstring_match, search_buffer, Fstore_match_data
2839 if asynchronous code (filter or sentinel) is running. */ 2864 if asynchronous code (filter or sentinel) is running. */
@@ -2845,6 +2870,8 @@ save_search_regs ()
2845 saved_search_regs.num_regs = search_regs.num_regs; 2870 saved_search_regs.num_regs = search_regs.num_regs;
2846 saved_search_regs.start = search_regs.start; 2871 saved_search_regs.start = search_regs.start;
2847 saved_search_regs.end = search_regs.end; 2872 saved_search_regs.end = search_regs.end;
2873 saved_last_thing_searched = last_thing_searched;
2874 last_thing_searched = Qnil;
2848 search_regs.num_regs = 0; 2875 search_regs.num_regs = 0;
2849 search_regs.start = 0; 2876 search_regs.start = 0;
2850 search_regs.end = 0; 2877 search_regs.end = 0;
@@ -2867,7 +2894,8 @@ restore_match_data ()
2867 search_regs.num_regs = saved_search_regs.num_regs; 2894 search_regs.num_regs = saved_search_regs.num_regs;
2868 search_regs.start = saved_search_regs.start; 2895 search_regs.start = saved_search_regs.start;
2869 search_regs.end = saved_search_regs.end; 2896 search_regs.end = saved_search_regs.end;
2870 2897 last_thing_searched = saved_last_thing_searched;
2898 saved_last_thing_searched = Qnil;
2871 search_regs_saved = 0; 2899 search_regs_saved = 0;
2872 } 2900 }
2873} 2901}
diff --git a/src/syntax.c b/src/syntax.c
index 62612620f03..302250c39a4 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1455,7 +1455,7 @@ skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes)
1455 { 1455 {
1456 const unsigned char *class_beg = str + i_byte + 1; 1456 const unsigned char *class_beg = str + i_byte + 1;
1457 const unsigned char *class_end = class_beg; 1457 const unsigned char *class_end = class_beg;
1458 const unsigned char *class_limit = str + size_byte; 1458 const unsigned char *class_limit = str + size_byte - 2;
1459 /* Leave room for the null. */ 1459 /* Leave room for the null. */
1460 unsigned char class_name[CHAR_CLASS_MAX_LENGTH + 1]; 1460 unsigned char class_name[CHAR_CLASS_MAX_LENGTH + 1];
1461 re_wctype_t cc; 1461 re_wctype_t cc;
@@ -1463,17 +1463,13 @@ skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes)
1463 if (class_limit - class_beg > CHAR_CLASS_MAX_LENGTH) 1463 if (class_limit - class_beg > CHAR_CLASS_MAX_LENGTH)
1464 class_limit = class_beg + CHAR_CLASS_MAX_LENGTH; 1464 class_limit = class_beg + CHAR_CLASS_MAX_LENGTH;
1465 1465
1466 while (class_end != class_limit 1466 while (class_end < class_limit
1467 && ! (*class_end >= 0200 1467 && *class_end >= 'a' && *class_end <= 'z')
1468 || *class_end <= 040
1469 || (*class_end == ':'
1470 && class_end[1] == ']')))
1471 class_end++; 1468 class_end++;
1472 1469
1473 if (class_end == class_limit 1470 if (class_end == class_beg
1474 || *class_end >= 0200 1471 || *class_end != ':' || class_end[1] != ']')
1475 || *class_end <= 040) 1472 goto not_a_class_name;
1476 error ("Invalid ISO C character class");
1477 1473
1478 bcopy (class_beg, class_name, class_end - class_beg); 1474 bcopy (class_beg, class_name, class_end - class_beg);
1479 class_name[class_end - class_beg] = 0; 1475 class_name[class_end - class_beg] = 0;
@@ -1488,6 +1484,7 @@ skip_chars (forwardp, syntaxp, string, lim, handle_iso_classes)
1488 continue; 1484 continue;
1489 } 1485 }
1490 1486
1487 not_a_class_name:
1491 if (c == '\\') 1488 if (c == '\\')
1492 { 1489 {
1493 if (i_byte == size_byte) 1490 if (i_byte == size_byte)
diff --git a/src/window.c b/src/window.c
index ff0d810a9c8..5b4c8928232 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6506,9 +6506,10 @@ using `special-display-function'. See also `special-display-regexps'.
6506An element of the list can be a list instead of just a string. 6506An element of the list can be a list instead of just a string.
6507There are two ways to use a list as an element: 6507There are two ways to use a list as an element:
6508 (BUFFER FRAME-PARAMETERS...) (BUFFER FUNCTION OTHER-ARGS...) 6508 (BUFFER FRAME-PARAMETERS...) (BUFFER FUNCTION OTHER-ARGS...)
6509In the first case, FRAME-PARAMETERS are used to create the frame. 6509In the first case, the FRAME-PARAMETERS are pairs of the form
6510In the latter case, FUNCTION is called with BUFFER as the first argument, 6510\(PARAMETER . VALUE); these parameter values are used to create the frame.
6511followed by OTHER-ARGS--it can display BUFFER in any way it likes. 6511In the second case, FUNCTION is called with BUFFER as the first argument,
6512followed by the OTHER-ARGS--it can display BUFFER in any way it likes.
6512All this is done by the function found in `special-display-function'. 6513All this is done by the function found in `special-display-function'.
6513 6514
6514If the specified frame parameters include (same-buffer . t), the 6515If the specified frame parameters include (same-buffer . t), the
@@ -6531,9 +6532,10 @@ using `special-display-function'.
6531An element of the list can be a list instead of just a string. 6532An element of the list can be a list instead of just a string.
6532There are two ways to use a list as an element: 6533There are two ways to use a list as an element:
6533 (REGEXP FRAME-PARAMETERS...) (REGEXP FUNCTION OTHER-ARGS...) 6534 (REGEXP FRAME-PARAMETERS...) (REGEXP FUNCTION OTHER-ARGS...)
6534In the first case, FRAME-PARAMETERS are used to create the frame. 6535In the first case, the FRAME-PARAMETERS are pairs of the form
6535In the latter case, FUNCTION is called with the buffer as first argument, 6536\(PARAMETER . VALUE); these parameter values are used to create the frame.
6536followed by OTHER-ARGS--it can display the buffer in any way it likes. 6537In the second case, FUNCTION is called with BUFFER as the first argument,
6538followed by the OTHER-ARGS--it can display the buffer in any way it likes.
6537All this is done by the function found in `special-display-function'. 6539All this is done by the function found in `special-display-function'.
6538 6540
6539If the specified frame parameters include (same-buffer . t), the 6541If the specified frame parameters include (same-buffer . t), the
diff --git a/src/window.h b/src/window.h
index 59052af96a5..63a19cc4b0d 100644
--- a/src/window.h
+++ b/src/window.h
@@ -1,5 +1,5 @@
1/* Window definitions for GNU Emacs. 1/* Window definitions for GNU Emacs.
2 Copyright (C) 1985, 1986, 1993, 1995, 1997, 1998, 1999, 2000, 2001, 2003 2 Copyright (C) 1985,86,93,95,97,98,99, 2000,01,03,04
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
diff --git a/src/xdisp.c b/src/xdisp.c
index d2410aa82bb..b04eb7ab7b7 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -6311,6 +6311,7 @@ add_to_log (format, arg1, arg2)
6311 char *buffer; 6311 char *buffer;
6312 int len; 6312 int len;
6313 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 6313 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
6314 USE_SAFE_ALLOCA;
6314 6315
6315 /* Do nothing if called asynchronously. Inserting text into 6316 /* Do nothing if called asynchronously. Inserting text into
6316 a buffer may call after-change-functions and alike and 6317 a buffer may call after-change-functions and alike and
@@ -6327,10 +6328,12 @@ add_to_log (format, arg1, arg2)
6327 msg = Fformat (3, args); 6328 msg = Fformat (3, args);
6328 6329
6329 len = SBYTES (msg) + 1; 6330 len = SBYTES (msg) + 1;
6330 buffer = (char *) alloca (len); 6331 SAFE_ALLOCA (buffer, char *, len);
6331 bcopy (SDATA (msg), buffer, len); 6332 bcopy (SDATA (msg), buffer, len);
6332 6333
6333 message_dolog (buffer, len - 1, 1, 0); 6334 message_dolog (buffer, len - 1, 1, 0);
6335 SAFE_FREE (len);
6336
6334 UNGCPRO; 6337 UNGCPRO;
6335} 6338}
6336 6339
@@ -11263,7 +11266,7 @@ try_cursor_movement (window, startp, scroll_step)
11263 && (FRAME_WINDOW_P (f) 11266 && (FRAME_WINDOW_P (f)
11264 || !overlay_arrow_in_current_buffer_p ())) 11267 || !overlay_arrow_in_current_buffer_p ()))
11265 { 11268 {
11266 int this_scroll_margin; 11269 int this_scroll_margin, top_scroll_margin;
11267 struct glyph_row *row = NULL; 11270 struct glyph_row *row = NULL;
11268 11271
11269#if GLYPH_DEBUG 11272#if GLYPH_DEBUG
@@ -11276,6 +11279,10 @@ try_cursor_movement (window, startp, scroll_step)
11276 this_scroll_margin = min (this_scroll_margin, WINDOW_TOTAL_LINES (w) / 4); 11279 this_scroll_margin = min (this_scroll_margin, WINDOW_TOTAL_LINES (w) / 4);
11277 this_scroll_margin *= FRAME_LINE_HEIGHT (f); 11280 this_scroll_margin *= FRAME_LINE_HEIGHT (f);
11278 11281
11282 top_scroll_margin = this_scroll_margin;
11283 if (WINDOW_WANTS_HEADER_LINE_P (w))
11284 top_scroll_margin += CURRENT_HEADER_LINE_HEIGHT (w);
11285
11279 /* Start with the row the cursor was displayed during the last 11286 /* Start with the row the cursor was displayed during the last
11280 not paused redisplay. Give up if that row is not valid. */ 11287 not paused redisplay. Give up if that row is not valid. */
11281 if (w->last_cursor.vpos < 0 11288 if (w->last_cursor.vpos < 0
@@ -11336,7 +11343,7 @@ try_cursor_movement (window, startp, scroll_step)
11336 && (MATRIX_ROW_START_CHARPOS (row) > PT 11343 && (MATRIX_ROW_START_CHARPOS (row) > PT
11337 || (MATRIX_ROW_START_CHARPOS (row) == PT 11344 || (MATRIX_ROW_START_CHARPOS (row) == PT
11338 && MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P (row))) 11345 && MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P (row)))
11339 && (row->y > this_scroll_margin 11346 && (row->y > top_scroll_margin
11340 || CHARPOS (startp) == BEGV)) 11347 || CHARPOS (startp) == BEGV))
11341 { 11348 {
11342 xassert (row->enabled_p); 11349 xassert (row->enabled_p);
@@ -11364,7 +11371,7 @@ try_cursor_movement (window, startp, scroll_step)
11364 ++row; 11371 ++row;
11365 11372
11366 /* If within the scroll margin, scroll. */ 11373 /* If within the scroll margin, scroll. */
11367 if (row->y < this_scroll_margin 11374 if (row->y < top_scroll_margin
11368 && CHARPOS (startp) != BEGV) 11375 && CHARPOS (startp) != BEGV)
11369 scroll_p = 1; 11376 scroll_p = 1;
11370 } 11377 }
@@ -12537,9 +12544,8 @@ try_window_reusing_current_matrix (w)
12537 position. */ 12544 position. */
12538 if (pt_row) 12545 if (pt_row)
12539 { 12546 {
12540 w->cursor.vpos -= MATRIX_ROW_VPOS (first_reusable_row, 12547 w->cursor.vpos -= nrows_scrolled;
12541 w->current_matrix); 12548 w->cursor.y -= first_reusable_row->y - start_row->y;
12542 w->cursor.y -= first_reusable_row->y;
12543 } 12549 }
12544 12550
12545 /* Scroll the display. */ 12551 /* Scroll the display. */
@@ -12584,6 +12590,29 @@ try_window_reusing_current_matrix (w)
12584 for (row -= nrows_scrolled; row < bottom_row; ++row) 12590 for (row -= nrows_scrolled; row < bottom_row; ++row)
12585 row->enabled_p = 0; 12591 row->enabled_p = 0;
12586 12592
12593 /* Point may have moved to a different line, so we cannot assume that
12594 the previous cursor position is valid; locate the correct row. */
12595 if (pt_row)
12596 {
12597 for (row = MATRIX_ROW (w->current_matrix, w->cursor.vpos);
12598 row < bottom_row && PT >= MATRIX_ROW_END_CHARPOS (row);
12599 row++)
12600 {
12601 w->cursor.vpos++;
12602 w->cursor.y = row->y;
12603 }
12604 if (row < bottom_row)
12605 {
12606 struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos;
12607 while (glyph->charpos < PT)
12608 {
12609 w->cursor.hpos++;
12610 w->cursor.x += glyph->pixel_width;
12611 glyph++;
12612 }
12613 }
12614 }
12615
12587 /* Adjust window end. A null value of last_text_row means that 12616 /* Adjust window end. A null value of last_text_row means that
12588 the window end is in reused rows which in turn means that 12617 the window end is in reused rows which in turn means that
12589 only its vpos can have changed. */ 12618 only its vpos can have changed. */
@@ -13367,9 +13396,9 @@ try_window_id (w)
13367 13396
13368 if ((w->cursor.y < this_scroll_margin 13397 if ((w->cursor.y < this_scroll_margin
13369 && CHARPOS (start) > BEGV) 13398 && CHARPOS (start) > BEGV)
13370 /* Don't take scroll margin into account at the bottom because 13399 /* Old redisplay didn't take scroll margin into account at the bottom,
13371 old redisplay didn't do it either. */ 13400 but then global-hl-line-mode doesn't scroll. KFS 2004-06-14 */
13372 || w->cursor.y + cursor_height > it.last_visible_y) 13401 || w->cursor.y + cursor_height + this_scroll_margin > it.last_visible_y)
13373 { 13402 {
13374 w->cursor.vpos = -1; 13403 w->cursor.vpos = -1;
13375 clear_glyph_matrix (w->desired_matrix); 13404 clear_glyph_matrix (w->desired_matrix);
diff --git a/src/xfaces.c b/src/xfaces.c
index 171472dbb31..a5d5c97a332 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -3899,12 +3899,13 @@ Otherwise check for the existence of a global face. */)
3899DEFUN ("internal-copy-lisp-face", Finternal_copy_lisp_face, 3899DEFUN ("internal-copy-lisp-face", Finternal_copy_lisp_face,
3900 Sinternal_copy_lisp_face, 4, 4, 0, 3900 Sinternal_copy_lisp_face, 4, 4, 0,
3901 doc: /* Copy face FROM to TO. 3901 doc: /* Copy face FROM to TO.
3902If FRAME is t, copy the global face definition of FROM to the 3902If FRAME is t, copy the global face definition of FROM.
3903global face definition of TO. Otherwise, copy the frame-local 3903Otherwise, copy the frame-local definition of FROM on FRAME.
3904definition of FROM on FRAME to the frame-local definition of TO 3904If NEW-FRAME is a frame, copy that data into the frame-local
3905on NEW-FRAME, or FRAME if NEW-FRAME is nil. 3905definition of TO on NEW-FRAME. If NEW-FRAME is nil.
3906FRAME controls where the data is copied to.
3906 3907
3907Value is TO. */) 3908The value is TO. */)
3908 (from, to, frame, new_frame) 3909 (from, to, frame, new_frame)
3909 Lisp_Object from, to, frame, new_frame; 3910 Lisp_Object from, to, frame, new_frame;
3910{ 3911{
@@ -3912,8 +3913,6 @@ Value is TO. */)
3912 3913
3913 CHECK_SYMBOL (from); 3914 CHECK_SYMBOL (from);
3914 CHECK_SYMBOL (to); 3915 CHECK_SYMBOL (to);
3915 if (NILP (new_frame))
3916 new_frame = frame;
3917 3916
3918 if (EQ (frame, Qt)) 3917 if (EQ (frame, Qt))
3919 { 3918 {
@@ -3925,6 +3924,8 @@ Value is TO. */)
3925 else 3924 else
3926 { 3925 {
3927 /* Copy frame-local definition of FROM. */ 3926 /* Copy frame-local definition of FROM. */
3927 if (NILP (new_frame))
3928 new_frame = frame;
3928 CHECK_LIVE_FRAME (frame); 3929 CHECK_LIVE_FRAME (frame);
3929 CHECK_LIVE_FRAME (new_frame); 3930 CHECK_LIVE_FRAME (new_frame);
3930 lface = lface_from_face_name (XFRAME (frame), from, 1); 3931 lface = lface_from_face_name (XFRAME (frame), from, 1);
diff --git a/src/xselect.c b/src/xselect.c
index 637b39272b7..8c8f1f98668 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1,5 +1,5 @@
1/* X Selection processing for Emacs. 1/* X Selection processing for Emacs.
2 Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003 2 Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004
3 Free Software Foundation. 3 Free Software Foundation.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -2608,7 +2608,7 @@ are ignored. */)
2608 if (event.xclient.format != 8 && event.xclient.format != 16 2608 if (event.xclient.format != 8 && event.xclient.format != 16
2609 && event.xclient.format != 32) 2609 && event.xclient.format != 32)
2610 error ("FORMAT must be one of 8, 16 or 32"); 2610 error ("FORMAT must be one of 8, 16 or 32");
2611 2611
2612 if (FRAMEP (dest) || NILP (dest)) 2612 if (FRAMEP (dest) || NILP (dest))
2613 { 2613 {
2614 struct frame *fdest = check_x_frame (dest); 2614 struct frame *fdest = check_x_frame (dest);
diff --git a/src/xsmfns.c b/src/xsmfns.c
index 35c7429b66b..080f998e779 100644
--- a/src/xsmfns.c
+++ b/src/xsmfns.c
@@ -1,6 +1,6 @@
1/* Session management module for systems which understand the X Session 1/* Session management module for systems which understand the X Session
2 management protocol. 2 management protocol.
3 Copyright (C) 2002 Free Software Foundation, Inc. 3 Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/xterm.c b/src/xterm.c
index 289f7771852..c17146bde1d 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1,5 +1,5 @@
1/* X Communication module for terminals which understand the X protocol. 1/* X Communication module for terminals which understand the X protocol.
2 Copyright (C) 1989, 93, 94, 95, 96, 97, 98, 1999, 2000, 01, 02, 2003 2 Copyright (C) 1989, 93, 94, 95, 96, 97, 98, 1999, 2000,01,02,03,04
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -2359,8 +2359,8 @@ x_draw_image_foreground_1 (s, pixmap)
2359 XGCValues xgcv; 2359 XGCValues xgcv;
2360 2360
2361 xgcv.clip_mask = s->img->mask; 2361 xgcv.clip_mask = s->img->mask;
2362 xgcv.clip_x_origin = x; 2362 xgcv.clip_x_origin = x - s->slice.x;
2363 xgcv.clip_y_origin = y; 2363 xgcv.clip_y_origin = y - s->slice.y;
2364 xgcv.function = GXcopy; 2364 xgcv.function = GXcopy;
2365 XChangeGC (s->display, s->gc, mask, &xgcv); 2365 XChangeGC (s->display, s->gc, mask, &xgcv);
2366 2366
diff --git a/src/xterm.h b/src/xterm.h
index a71bd275e6f..f0e86f0ecab 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -1,5 +1,5 @@
1/* Definitions and headers for communication with X protocol. 1/* Definitions and headers for communication with X protocol.
2 Copyright (C) 1989, 1993, 1994, 1998, 1999, 2000, 2001, 2001 2 Copyright (C) 1989, 1993, 1994, 1998, 1999, 2000,01,02,03,04
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.