aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2004-06-29 16:46:06 +0000
committerMiles Bader2004-06-29 16:46:06 +0000
commit12483a9413619e286efc673a2b277d85cebf3b0c (patch)
treed489e0fa758c0d51d792d42140cbeafa4aede31b
parentc786a8ae1c5e84d0f0903d516dd0fc190dc1193c (diff)
parent619b6adbd2b96accbbf18051bf69149a029557ee (diff)
downloademacs-12483a9413619e286efc673a2b277d85cebf3b0c.tar.gz
emacs-12483a9413619e286efc673a2b277d85cebf3b0c.zip
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-17
Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-417 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-419 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-420 Tweak permissions * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-421 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-430 Update from CVS
-rw-r--r--ChangeLog4
-rw-r--r--admin/ChangeLog8
-rw-r--r--admin/FOR-RELEASE48
-rw-r--r--etc/ChangeLog15
-rw-r--r--etc/FOR-RELEASE13
-rw-r--r--etc/MORE.STUFF3
-rw-r--r--etc/NEWS25
-rw-r--r--lisp/ChangeLog109
-rw-r--r--lisp/add-log.el11
-rw-r--r--lisp/comint.el33
-rw-r--r--lisp/emacs-lisp/pp.el1
-rw-r--r--lisp/files.el29
-rw-r--r--lisp/font-lock.el91
-rw-r--r--lisp/gnus/ChangeLog7
-rw-r--r--lisp/gnus/nnimap.el6
-rw-r--r--lisp/gnus/nntp.el9
-rw-r--r--lisp/image.el10
-rw-r--r--lisp/man.el4
-rw-r--r--lisp/net/ange-ftp.el2
-rw-r--r--lisp/net/goto-addr.el4
-rw-r--r--lisp/net/tramp.el9
-rw-r--r--lisp/progmodes/ada-xref.el7
-rw-r--r--lisp/progmodes/gdb-ui.el45
-rw-r--r--lisp/progmodes/grep.el12
-rw-r--r--lisp/replace.el318
-rw-r--r--lisp/vc-arch.el3
-rw-r--r--lisp/woman.el2
-rw-r--r--lispref/ChangeLog47
-rw-r--r--lispref/backups.texi4
-rw-r--r--lispref/buffers.texi4
-rw-r--r--lispref/commands.texi69
-rw-r--r--lispref/control.texi4
-rw-r--r--lispref/customize.texi5
-rw-r--r--lispref/display.texi17
-rw-r--r--lispref/eval.texi8
-rw-r--r--lispref/files.texi19
-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/keymaps.texi33
-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/calendar.texi2
-rw-r--r--man/ediff.texi12
-rw-r--r--man/eshell.texi2
-rw-r--r--man/eudc.texi2
-rw-r--r--man/faq.texi4
-rw-r--r--man/flymake.texi2
-rw-r--r--man/info.texi20
-rw-r--r--man/misc.texi37
-rw-r--r--man/search.texi95
-rw-r--r--man/ses.texi16
-rw-r--r--man/trampver.texi2
-rw-r--r--man/viper.texi24
-rw-r--r--src/ChangeLog128
-rw-r--r--src/alloc.c56
-rw-r--r--src/data.c21
-rw-r--r--src/doc.c2
-rw-r--r--src/editfns.c70
-rw-r--r--src/emacs.c20
-rw-r--r--src/fns.c98
-rw-r--r--src/gtkutil.c52
-rw-r--r--src/keymap.c6
-rw-r--r--src/lisp.h64
-rw-r--r--src/macterm.c108
-rw-r--r--src/print.c2
-rw-r--r--src/search.c125
-rw-r--r--src/w32fns.c25
-rw-r--r--src/xdisp.c5
77 files changed, 1553 insertions, 656 deletions
diff --git a/ChangeLog b/ChangeLog
index 8882deb6954..73b82e15624 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12004-06-21 Kenichi Handa <handa@m17n.org>
2
3 * make-dist: Link leim-ext.el into tempdir.
4
12004-06-15 Luc Teirlinck <teirllm@auburn.edu> 52004-06-15 Luc Teirlinck <teirllm@auburn.edu>
2 6
3 * info/dir (File): Add emacs-xtra. 7 * info/dir (File): Add emacs-xtra.
diff --git a/admin/ChangeLog b/admin/ChangeLog
index d0cc63f1e97..b164f414a88 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,11 @@
12004-06-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * FOR-RELEASE: Removed entry about GTK and monochrome displays (done).
4
52002-06-26 Eli Zaretskii <eliz@is.elta.co.il>
6
7 * FOR-RELEASE: Moved here from the etc directory.
8
12004-05-08 Thien-Thi Nguyen <ttn@gnu.org> 92004-05-08 Thien-Thi Nguyen <ttn@gnu.org>
2 10
3 * notes/BRANCH: New file, to be maintained per CVS branch. 11 * notes/BRANCH: New file, to be maintained per CVS branch.
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
new file mode 100644
index 00000000000..2d5738a8683
--- /dev/null
+++ b/admin/FOR-RELEASE
@@ -0,0 +1,48 @@
1Tasks needed before the next release.
2
3* DOCUMENTATION
4
5** Finish updating the Emacs Lisp manual.
6
7** Finish checking the Emacs Lisp manual.
8
9** Update the Emacs manual.
10
11** Check the Emacs Manual.
12
13** Add missing years in copyright notices of all files.
14
15** Update man/info.texi.
16
17
18* NEW FEATURES
19
20** Test the mbox branch of Rmail.
21
22** Install the mbox branch of Rmail.
23
24** Update Gnus.
25
26** Face remapping.
27
28
29* FATAL ERRORS
30
31** Investigate face cache related crash.
32
33Indications: Face cache seems to have been cleared, but
34redisplay uses an invalidated face_id with FACE_FROM_ID
35which then returns a NULL pointer. Said to happen with
36isearch faces.
37
38
39* GTK RELATED BUGS
40
41** Make geometry specifications work correctly for GTK.
42
43** Make GTK scrollbars behave like others w.r.t. overscrolling.
44
45
46Local variables:
47mode: outline
48end:
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 05c4549bee3..356946001bd 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,18 @@
12002-06-26 Eli Zaretskii <eliz@is.elta.co.il>
2
3 * FOR-RELEASE: Moved to the admin directory.
4
52004-06-24 David Kastrup <dak@gnu.org>
6
7 * NEWS: Move description from new paragraph-start and
8 indent-line-function defaults to general news instead of new
9 packages. Same for query-replace-skip-read-only. Add
10 description of new `\,' and `\?' replacement string features.
11
122004-06-23 Luc Teirlinck <teirllm@auburn.edu>
13
14 * MORE.STUFF: Delete obsolete URL.
15
12004-06-10 Lars Hansen <larsh@math.ku.dk> 162004-06-10 Lars Hansen <larsh@math.ku.dk>
2 17
3 * NEWS: Describe dired-omit-mode. Describe desktop package changes. 18 * NEWS: Describe dired-omit-mode. Describe desktop package changes.
diff --git a/etc/FOR-RELEASE b/etc/FOR-RELEASE
deleted file mode 100644
index b36632b092b..00000000000
--- a/etc/FOR-RELEASE
+++ /dev/null
@@ -1,13 +0,0 @@
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 Lisp manual.
diff --git a/etc/MORE.STUFF b/etc/MORE.STUFF
index 2e1803ae8ba..b060e137e37 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 ef5a3921d38..a7691aed9de 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -988,6 +988,23 @@ search multiple buffers. There is also a new command
988buffers to search by their filename. Internally, Occur mode has been 988buffers to search by their filename. Internally, Occur mode has been
989rewritten, and now uses font-lock, among other changes. 989rewritten, and now uses font-lock, among other changes.
990 990
991** The default values of paragraph-start and indent-line-function have
992been changed to reflect those used in Text mode rather than those used
993in Indented-Text mode.
994
995** New user option `query-replace-skip-read-only': when non-nil,
996`query-replace' and related functions simply ignore
997a match if part of it has a read-only property.
998
999** When used interactively, the commands `query-replace-regexp' and
1000`replace-regexp' allow \,expr to be used in a replacement string,
1001where expr is an arbitrary Lisp expression evaluated at replacement
1002time. In many cases, this will be more convenient than using
1003`query-replace-regexp-eval'. All regular expression replacement
1004commands now allow `\?' in the replacement string to specify a
1005position where the replacement string can be edited for each
1006replacement.
1007
991+++ 1008+++
992** Emacs normally highlights mouse sensitive text whenever the mouse 1009** Emacs normally highlights mouse sensitive text whenever the mouse
993is over the text. By setting the new variable `mouse-highlight', you 1010is over the text. By setting the new variable `mouse-highlight', you
@@ -2210,14 +2227,6 @@ mode-lines in inverse-video.
2210** New package benchmark.el contains simple support for convenient 2227** New package benchmark.el contains simple support for convenient
2211timing measurements of code (including the garbage collection component). 2228timing measurements of code (including the garbage collection component).
2212 2229
2213** The default values of paragraph-start and indent-line-function have
2214been changed to reflect those used in Text mode rather than those used
2215in Indented-Text mode.
2216
2217** If you set `query-replace-skip-read-only' non-nil,
2218`query-replace' and related functions simply ignore
2219a match if part of it has a read-only property.
2220
2221** The new Lisp library fringe.el controls the apperance of fringes. 2230** The new Lisp library fringe.el controls the apperance of fringes.
2222 2231
2223** `cfengine-mode' is a major mode for editing GNU Cfengine 2232** `cfengine-mode' is a major mode for editing GNU Cfengine
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 70f7255782a..effae29fc8f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,112 @@
12004-06-29 Kim F. Storm <storm@cua.dk>
2
3 * progmodes/gdb-ui.el (breakpoint-enabled-bitmap-face)
4 (breakpoint-disabled-bitmap-face): Add :group 'gud.
5
6 * progmodes/ada-xref.el (ada-tight-gvd-integration):
7 Add :group 'ada.
8
9 * vc-arch.el (vc-arch-mode-line-rewrite): Add :group 'vc.
10
112004-06-29 Juri Linkov <juri@jurta.org>
12
13 * replace.el (query-replace-read-args): Swallow a space after
14 everything except )]" which in most cases means after a symbol.
15
16 * emacs-lisp/pp.el (pp-buffer): Add autoload.
17
182004-06-26 David Kastrup <dak@gnu.org>
19
20 * replace.el (perform-replace): Highlight the match even in
21 non-query mode if there is potential replace string editing.
22
232004-06-26 Kai Grossjohann <kai.grossjohann@gmx.net>
24
25 * net/tramp.el (tramp-handle-file-remote-p): New implementation to
26 agree with new return value of `file-remote-p'.
27 This syncs with Tramp 2.0.42.
28
29 * net/ange-ftp.el (ange-ftp-file-remote-p): New return value,
30 according to new documentation of `file-remote-p'.
31
32 * files.el (file-remote-p): Fix doc to say that return value is
33 identification of remote system, if not nil.
34 (file-relative-name): Use new return value of `file-remote-p'.
35
362004-06-26 Nick Roberts <nickrob@gnu.org>
37
38 * progmodes/gdb-ui.el (gdb-toggle-breakpoint)
39 (gdb-goto-breakpoint): Fix breakage.
40
412004-06-26 Eli Zaretskii <eliz@gnu.org>
42
43 * man.el (Man-getpage-in-background): Add windows-nt to the list
44 of systems where shell-file-name should be used instead of
45 literal "sh".
46
472004-06-25 Sam Steingold <sds@gnu.org>
48
49 * add-log.el (change-log-font-lock-keywords): Support Common Lisp
50 function names `(setf symbol)'.
51
522004-06-24 Richard M. Stallman <rms@gnu.org>
53
54 * replace.el (query-replace-read-args): Swallow space after \,SYMBOL.
55
56 * font-lock.el (font-lock-keywords): Change format of compiled values.
57 Document it.
58 (font-lock-add-keywords): If font-lock-keywords is compiled,
59 extract the uncompiled version, modify, then recompile.
60 (font-lock-remove-keywords): Likewise.
61 (font-lock-fontify-keywords-region): Handle changed format.
62 (font-lock-compile-keywords): Handle changed format.
63 (font-lock-set-defaults): Compile the keywords explicitly here.
64
652004-06-24 David Kastrup <dak@gnu.org>
66
67 * replace.el (query-replace-read-args): Implement `\,' and `\#'
68 replacements here.
69 (query-replace-regexp): Doc string explaining this and the new
70 `\?' replacement. Remove `\,' and `\#' implementation here, as it
71 is better placed in `query-replace-read-args'.
72 (replace-regexp): Explain `\,', `\#' and `\?'.
73 (replace-match-data): New function for thorough reuse/destruction
74 of old match-data.
75 (replace-match-maybe-edit): Function for implementing `\?'
76 editing.
77 (perform-replace): Fix maintaining of the match stack including
78 already matched regions, implement `\?', fix various problems
79 with regions while editing and other stuff.
80 (replace-highlight): Simplified.
81
822004-06-24 Daniel Pfeiffer <occitan@esperanto.org>
83
84 * progmodes/grep.el (grep-error-screen-columns): New variable.
85 (grep-regexp-alist): Give it the full functionality of gnu style
86 compilation messages with line and column ranges. Ask me for the
87 perl script I'm working on, that uses these.
88
892004-06-23 Nick Roberts <nickrob@gnu.org>
90
91 * comint.el: (comint-insert-clicked-input, comint-copy-old-input):
92 Remove.
93 (comint-insert-input, comint-mouse-insert-input): New functions
94 based on comint-insert-clicked-input for two bindings but just
95 one functionality.
96
972004-06-23 Luc Teirlinck <teirllm@auburn.edu>
98
99 * net/goto-addr.el (goto-address-fontify): Fix help-echo text.
100
1012004-06-23 Lars Hansen <larsh@math.ku.dk>
102
103 * files.el (write-contents-functions): Doc fix.
104
1052004-06-21 Juanma Barranquero <lektu@terra.es>
106
107 * image.el (image-library-alist): Rewrite docstring in active
108 voice.
109
12004-06-20 Richard M. Stallman <rms@gnu.org> 1102004-06-20 Richard M. Stallman <rms@gnu.org>
2 111
3 * mouse.el (mouse-set-region-1): Set transient-mark-mode to `only'. 112 * mouse.el (mouse-set-region-1): Set transient-mark-mode to `only'.
diff --git a/lisp/add-log.el b/lisp/add-log.el
index 3c29e8a465e..26faea2ddc3 100644
--- a/lisp/add-log.el
+++ b/lisp/add-log.el
@@ -230,13 +230,16 @@ Note: The search is conducted only within 10%, at the beginning of the file."
230 ;; Possibly further names in a list: 230 ;; Possibly further names in a list:
231 ("\\=, \\([^ ,:([\n]+\\)" nil nil (1 'change-log-file-face)) 231 ("\\=, \\([^ ,:([\n]+\\)" nil nil (1 'change-log-file-face))
232 ;; Possibly a parenthesized list of names: 232 ;; Possibly a parenthesized list of names:
233 ("\\= (\\([^) ,\n]+\\)" nil nil (1 'change-log-list-face)) 233 ("\\= (\\([^() ,\n]+\\|(\\(setf\\|SETF\\) [^() ,\n]+)\\)"
234 ("\\=, *\\([^) ,\n]+\\)" nil nil (1 'change-log-list-face))) 234 nil nil (1 'change-log-list-face))
235 ("\\=, *\\([^() ,\n]+\\|(\\(setf\\|SETF\\) [^() ,\n]+)\\)"
236 nil nil (1 'change-log-list-face)))
235 ;; 237 ;;
236 ;; Function or variable names. 238 ;; Function or variable names.
237 ("^\t(\\([^) ,\n]+\\)" 239 ("^\t(\\([^() ,\n]+\\|(\\(setf\\|SETF\\) [^() ,\n]+)\\)"
238 (1 'change-log-list-face) 240 (1 'change-log-list-face)
239 ("\\=, *\\([^) ,\n]+\\)" nil nil (1 'change-log-list-face))) 241 ("\\=, *\\([^() ,\n]+\\|(\\(setf\\|SETF\\) [^() ,\n]+)\\)" nil nil
242 (1 'change-log-list-face)))
240 ;; 243 ;;
241 ;; Conditionals. 244 ;; Conditionals.
242 ("\\[!?\\([^]\n]+\\)\\]\\(:\\| (\\)" (1 'change-log-conditionals-face)) 245 ("\\[!?\\([^]\n]+\\)\\]\\(:\\| (\\)" (1 'change-log-conditionals-face))
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/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el
index 61d31921e57..93e30fb0f55 100644
--- a/lisp/emacs-lisp/pp.el
+++ b/lisp/emacs-lisp/pp.el
@@ -54,6 +54,7 @@ to make output that `read' can handle, whenever this is possible."
54 (buffer-string)) 54 (buffer-string))
55 (kill-buffer (current-buffer))))) 55 (kill-buffer (current-buffer)))))
56 56
57;;;###autoload
57(defun pp-buffer () 58(defun pp-buffer ()
58 "Prettify the current buffer with printed representation of a Lisp object." 59 "Prettify the current buffer with printed representation of a Lisp object."
59 (goto-char (point-min)) 60 (goto-char (point-min))
diff --git a/lisp/files.el b/lisp/files.el
index 1804432ee45..1d500379925 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,
@@ -649,7 +650,13 @@ This is an interface to the function `load'."
649 (load library)) 650 (load library))
650 651
651(defun file-remote-p (file) 652(defun file-remote-p (file)
652 "Test whether FILE specifies a location on a remote system." 653 "Test whether FILE specifies a location on a remote system.
654Return an identification of the system if the location is indeed
655remote. The identification of the system may comprise a method
656to access the system and its hostname, amongst other things.
657
658For example, the filename \"/user@host:/foo\" specifies a location
659on the system \"/user@host:\"."
653 (let ((handler (find-file-name-handler file 'file-remote-p))) 660 (let ((handler (find-file-name-handler file 'file-remote-p)))
654 (if handler 661 (if handler
655 (funcall handler 'file-remote-p file) 662 (funcall handler 'file-remote-p file)
@@ -2915,8 +2922,8 @@ on a DOS/Windows machine, it returns FILENAME on expanded form."
2915 (file-name-as-directory (expand-file-name (or directory 2922 (file-name-as-directory (expand-file-name (or directory
2916 default-directory)))) 2923 default-directory))))
2917 (setq filename (expand-file-name filename)) 2924 (setq filename (expand-file-name filename))
2918 (let ((hf (find-file-name-handler filename 'file-remote-p)) 2925 (let ((fremote (file-remote-p filename))
2919 (hd (find-file-name-handler directory 'file-remote-p))) 2926 (dremote (file-remote-p directory)))
2920 (if ;; Conditions for separate trees 2927 (if ;; Conditions for separate trees
2921 (or 2928 (or
2922 ;; Test for different drives on DOS/Windows 2929 ;; Test for different drives on DOS/Windows
@@ -2924,20 +2931,8 @@ on a DOS/Windows machine, it returns FILENAME on expanded form."
2924 ;; Should `cygwin' really be included here? --stef 2931 ;; Should `cygwin' really be included here? --stef
2925 (memq system-type '(ms-dos cygwin windows-nt)) 2932 (memq system-type '(ms-dos cygwin windows-nt))
2926 (not (eq t (compare-strings filename 0 2 directory 0 2)))) 2933 (not (eq t (compare-strings filename 0 2 directory 0 2))))
2927 ;; Test for different remote file handlers
2928 (not (eq hf hd))
2929 ;; Test for different remote file system identification 2934 ;; Test for different remote file system identification
2930 (and 2935 (not (equal fremote dremote)))
2931 hf
2932 (let ((re (car (rassq hf file-name-handler-alist))))
2933 (not
2934 (equal
2935 (and
2936 (string-match re filename)
2937 (substring filename 0 (match-end 0)))
2938 (and
2939 (string-match re directory)
2940 (substring directory 0 (match-end 0))))))))
2941 filename 2936 filename
2942 (let ((ancestor ".") 2937 (let ((ancestor ".")
2943 (filename-dir (file-name-as-directory filename))) 2938 (filename-dir (file-name-as-directory filename)))
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 1f6127f3ea5..9d3fdd6de5f 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -340,7 +340,15 @@ If a number, only buffers greater than this size have fontification messages."
340 340
341(defvar font-lock-keywords nil 341(defvar font-lock-keywords nil
342 "A list of the keywords to highlight. 342 "A list of the keywords to highlight.
343Each element should have one of these forms: 343There are two kinds of values: user-level, and compiled.
344
345A user-level keywords list is what a major mode or the user would
346set up. Normally the list would come from `font-lock-defaults'.
347through selection of a fontification level and evaluation of any
348contained expressions. You can also alter it by calling
349`font-lock-add-keywords' or `font-lock-remove-keywords' with MODE = nil.
350
351Each element in a user-level keywords list should have one of these forms:
344 352
345 MATCHER 353 MATCHER
346 (MATCHER . MATCH) 354 (MATCHER . MATCH)
@@ -438,7 +446,14 @@ support modes like jit-lock or lazy-lock.
438 446
439This variable is set by major modes via the variable `font-lock-defaults'. 447This variable is set by major modes via the variable `font-lock-defaults'.
440Be careful when composing regexps for this list; a poorly written pattern can 448Be careful when composing regexps for this list; a poorly written pattern can
441dramatically slow things down!") 449dramatically slow things down!
450
451A compiled keywords list starts with t. It is produced internal
452by `font-lock-compile-keywords' from a user-level keywords list.
453Its second element is the user-level keywords list that was
454compiled. The remaining elements have the same form as
455user-level keywords, but normally their values have been
456optimized.")
442 457
443(defvar font-lock-keywords-alist nil 458(defvar font-lock-keywords-alist nil
444 "*Alist of `font-lock-keywords' local to a `major-mode'. 459 "*Alist of `font-lock-keywords' local to a `major-mode'.
@@ -659,16 +674,26 @@ see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types',
659 (font-lock-update-removed-keyword-alist mode keywords append)) 674 (font-lock-update-removed-keyword-alist mode keywords append))
660 (t 675 (t
661 ;; Otherwise set or add the keywords now. 676 ;; Otherwise set or add the keywords now.
677 ;; This is a no-op if it has been done already in this buffer.
662 (font-lock-set-defaults) 678 (font-lock-set-defaults)
663 (if (eq append 'set) 679 (let ((was-compiled (eq (car font-lock-keywords) t)))
664 (setq font-lock-keywords keywords) 680 ;; Bring back the user-level (uncompiled) keywords.
665 (font-lock-remove-keywords nil keywords) ;to avoid duplicates 681 (if was-compiled
666 (let ((old (if (eq (car-safe font-lock-keywords) t) 682 (setq font-lock-keywords (cadr font-lock-keywords)))
667 (cdr font-lock-keywords) 683 ;; Now modify or replace them.
668 font-lock-keywords))) 684 (if (eq append 'set)
669 (setq font-lock-keywords (if append 685 (setq font-lock-keywords keywords)
670 (append old keywords) 686 (font-lock-remove-keywords nil keywords) ;to avoid duplicates
671 (append keywords old)))))))) 687 (let ((old (if (eq (car-safe font-lock-keywords) t)
688 (cdr font-lock-keywords)
689 font-lock-keywords)))
690 (setq font-lock-keywords (if append
691 (append old keywords)
692 (append keywords old)))))
693 ;; If the keywords were compiled before, compile them again.
694 (if was-compiled
695 (set (make-local-variable 'font-lock-keywords)
696 (font-lock-compile-keywords keywords t)))))))
672 697
673(defun font-lock-update-removed-keyword-alist (mode keywords append) 698(defun font-lock-update-removed-keyword-alist (mode keywords append)
674 ;; Update `font-lock-removed-keywords-alist' when adding new 699 ;; Update `font-lock-removed-keywords-alist' when adding new
@@ -762,13 +787,21 @@ subtle problems due to details of the implementation."
762 (t 787 (t
763 ;; Otherwise remove it immediately. 788 ;; Otherwise remove it immediately.
764 (font-lock-set-defaults) 789 (font-lock-set-defaults)
765 (setq font-lock-keywords (copy-sequence font-lock-keywords)) 790 (let ((was-compiled (eq (car font-lock-keywords) t)))
766 (dolist (keyword keywords) 791 ;; Bring back the user-level (uncompiled) keywords.
767 (setq font-lock-keywords 792 (if was-compiled
768 (delete keyword 793 (setq font-lock-keywords (cadr font-lock-keywords)))
769 ;; The keywords might be compiled. 794
770 (delete (font-lock-compile-keyword keyword) 795 ;; Edit them.
771 font-lock-keywords))))))) 796 (setq font-lock-keywords (copy-sequence font-lock-keywords))
797 (dolist (keyword keywords)
798 (setq font-lock-keywords
799 (delete keyword font-lock-keywords)))
800
801 ;; If the keywords were compiled before, compile them again.
802 (if was-compiled
803 (set (make-local-variable 'font-lock-keywords)
804 (font-lock-compile-keywords keywords t)))))))
772 805
773;;; Font Lock Support mode. 806;;; Font Lock Support mode.
774 807
@@ -1224,7 +1257,7 @@ START should be at the beginning of a line."
1224 font-lock-syntactic-keywords))) 1257 font-lock-syntactic-keywords)))
1225 ;; Get down to business. 1258 ;; Get down to business.
1226 (let ((case-fold-search font-lock-keywords-case-fold-search) 1259 (let ((case-fold-search font-lock-keywords-case-fold-search)
1227 (keywords (cdr font-lock-syntactic-keywords)) 1260 (keywords (cddr font-lock-syntactic-keywords))
1228 keyword matcher highlights) 1261 keyword matcher highlights)
1229 (while keywords 1262 (while keywords
1230 ;; Find an occurrence of `matcher' from `start' to `end'. 1263 ;; Find an occurrence of `matcher' from `start' to `end'.
@@ -1349,7 +1382,7 @@ LOUDLY, if non-nil, allows progress-meter bar."
1349 (setq font-lock-keywords 1382 (setq font-lock-keywords
1350 (font-lock-compile-keywords font-lock-keywords t))) 1383 (font-lock-compile-keywords font-lock-keywords t)))
1351 (let ((case-fold-search font-lock-keywords-case-fold-search) 1384 (let ((case-fold-search font-lock-keywords-case-fold-search)
1352 (keywords (cdr font-lock-keywords)) 1385 (keywords (cddr font-lock-keywords))
1353 (bufname (buffer-name)) (count 0) 1386 (bufname (buffer-name)) (count 0)
1354 keyword matcher highlights) 1387 keyword matcher highlights)
1355 ;; 1388 ;;
@@ -1394,14 +1427,16 @@ LOUDLY, if non-nil, allows progress-meter bar."
1394;; Various functions. 1427;; Various functions.
1395 1428
1396(defun font-lock-compile-keywords (keywords &optional regexp) 1429(defun font-lock-compile-keywords (keywords &optional regexp)
1397 "Compile KEYWORDS into the form (t KEYWORD ...). 1430 "Compile KEYWORDS into the form (t KEYWORDS COMPILED...)
1398Here KEYWORD is of the form (MATCHER HIGHLIGHT ...) as shown in the 1431Here each COMPILED is of the form (MATCHER HIGHLIGHT ...) as shown in the
1399`font-lock-keywords' doc string. 1432`font-lock-keywords' doc string.
1400If REGEXP is non-nil, it means these keywords are used for 1433If REGEXP is non-nil, it means these keywords are used for
1401`font-lock-keywords' rather than for `font-lock-syntactic-keywords'." 1434`font-lock-keywords' rather than for `font-lock-syntactic-keywords'."
1402 (if (eq (car-safe keywords) t) 1435 (if (eq (car-safe keywords) t)
1403 keywords 1436 keywords
1404 (setq keywords (cons t (mapcar 'font-lock-compile-keyword keywords))) 1437 (setq keywords
1438 (cons t (cons keywords
1439 (mapcar 'font-lock-compile-keyword keywords))))
1405 (if (and regexp 1440 (if (and regexp
1406 (eq (or syntax-begin-function 1441 (eq (or syntax-begin-function
1407 font-lock-beginning-of-syntax-function) 1442 font-lock-beginning-of-syntax-function)
@@ -1512,17 +1547,21 @@ Sets various variables using `font-lock-defaults' (or, if nil, using
1512 ;; Variable alist? 1547 ;; Variable alist?
1513 (dolist (x (nthcdr 5 defaults)) 1548 (dolist (x (nthcdr 5 defaults))
1514 (set (make-local-variable (car x)) (cdr x))) 1549 (set (make-local-variable (car x)) (cdr x)))
1515 ;; Setup `font-lock-keywords' last because its value might depend 1550 ;; Set up `font-lock-keywords' last because its value might depend
1516 ;; on other settings (e.g. font-lock-compile-keywords uses 1551 ;; on other settings (e.g. font-lock-compile-keywords uses
1517 ;; font-lock-beginning-of-syntax-function). 1552 ;; font-lock-beginning-of-syntax-function).
1518 (set (make-local-variable 'font-lock-keywords) 1553 (set (make-local-variable 'font-lock-keywords)
1519 (font-lock-compile-keywords (font-lock-eval-keywords keywords) t)) 1554 (font-lock-eval-keywords keywords))
1520 ;; Local fontification? 1555 ;; Local fontification?
1521 (while local 1556 (while local
1522 (font-lock-add-keywords nil (car (car local)) (cdr (car local))) 1557 (font-lock-add-keywords nil (car (car local)) (cdr (car local)))
1523 (setq local (cdr local))) 1558 (setq local (cdr local)))
1524 (when removed-keywords 1559 (when removed-keywords
1525 (font-lock-remove-keywords nil removed-keywords))))) 1560 (font-lock-remove-keywords nil removed-keywords))
1561 ;; Now compile the keywords.
1562 (unless (eq (car font-lock-keywords) t)
1563 (set (make-local-variable 'font-lock-keywords)
1564 (font-lock-compile-keywords font-lock-keywords t))))))
1526 1565
1527;;; Colour etc. support. 1566;;; Colour etc. support.
1528 1567
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 78c9f15f912..8169b014e16 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,10 @@
12004-06-29 Kim F. Storm <storm@cua.dk>
2
3 * nntp.el (nntp-authinfo-file): Add :group 'nntp.
4
5 * nnimap.el (nnimap-authinfo-file, nnimap-prune-cache):
6 Add :group 'nnimap.
7
12004-05-18 Stefan Monnier <monnier@iro.umontreal.ca> 82004-05-18 Stefan Monnier <monnier@iro.umontreal.ca>
2 9
3 * mm-view.el (mm-insert-inline): Make it work in read-only buffer. 10 * mm-view.el (mm-insert-inline): Make it work in read-only buffer.
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index a7cf82317b5..ec9d42ee042 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -271,11 +271,13 @@ use this to make replies go directly to the group.")
271 (string :format "Login: %v")) 271 (string :format "Login: %v"))
272 (cons :format "%v" 272 (cons :format "%v"
273 (const :format "" "password") 273 (const :format "" "password")
274 (string :format "Password: %v"))))))) 274 (string :format "Password: %v"))))))
275 :group 'nnimap)
275 276
276(defcustom nnimap-prune-cache t 277(defcustom nnimap-prune-cache t
277 "If non-nil, nnimap check whether articles still exist on server before using data stored in NOV cache." 278 "If non-nil, nnimap check whether articles still exist on server before using data stored in NOV cache."
278 :type 'boolean) 279 :type 'boolean
280 :group 'nnimap)
279 281
280(defvar nnimap-request-list-method 'imap-mailbox-list 282(defvar nnimap-request-list-method 'imap-mailbox-list
281 "Method to use to request a list of all folders from the server. 283 "Method to use to request a list of all folders from the server.
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index 8791c652a45..5722ba8456a 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -174,7 +174,8 @@ server there that you can connect to. See also
174 (string :format "Login: %v")) 174 (string :format "Login: %v"))
175 (cons :format "%v" 175 (cons :format "%v"
176 (const :format "" "password") 176 (const :format "" "password")
177 (string :format "Password: %v"))))))) 177 (string :format "Password: %v"))))))
178 :group 'nntp)
178 179
179 180
180 181
@@ -223,7 +224,7 @@ noticing asynchronous data.")
223(defvar nntp-async-timer nil) 224(defvar nntp-async-timer nil)
224(defvar nntp-async-process-list nil) 225(defvar nntp-async-process-list nil)
225 226
226(defvar nntp-ssl-program 227(defvar nntp-ssl-program
227 "openssl s_client -quiet -ssl3 -connect %s:%p" 228 "openssl s_client -quiet -ssl3 -connect %s:%p"
228"A string containing commands for SSL connections. 229"A string containing commands for SSL connections.
229Within a string, %s is replaced with the server address and %p with 230Within a string, %s is replaced with the server address and %p with
@@ -928,10 +929,10 @@ password contained in '~/.nntp-authinfo'."
928 929
929(defun nntp-open-ssl-stream (buffer) 930(defun nntp-open-ssl-stream (buffer)
930 (let* ((process-connection-type nil) 931 (let* ((process-connection-type nil)
931 (proc (start-process "nntpd" buffer 932 (proc (start-process "nntpd" buffer
932 shell-file-name 933 shell-file-name
933 shell-command-switch 934 shell-command-switch
934 (format-spec nntp-ssl-program 935 (format-spec nntp-ssl-program
935 (format-spec-make 936 (format-spec-make
936 ?s nntp-address 937 ?s nntp-address
937 ?p nntp-port-number))))) 938 ?p nntp-port-number)))))
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/man.el b/lisp/man.el
index 5a07045dda9..cbfae21e44b 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -733,7 +733,9 @@ 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 (if (eq system-type 'cygwin) shell-file-name "sh") 736 (if (memq system-type '(cygwin windows-nt))
737 shell-file-name
738 "sh")
737 shell-command-switch 739 shell-command-switch
738 (format (Man-build-man-command) man-args)) 740 (format (Man-build-man-command) man-args))
739 'Man-bgproc-sentinel) 741 'Man-bgproc-sentinel)
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index 09448e87329..8e9d0bda5af 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -4117,7 +4117,7 @@ directory, so that Emacs will know its current contents."
4117 tmp1)))) 4117 tmp1))))
4118 4118
4119(defun ange-ftp-file-remote-p (file) 4119(defun ange-ftp-file-remote-p (file)
4120 (when (ange-ftp-ftp-name file) t)) 4120 (ange-ftp-replace-name-component file ""))
4121 4121
4122(defun ange-ftp-load (file &optional noerror nomessage nosuffix) 4122(defun ange-ftp-load (file &optional noerror nomessage nosuffix)
4123 (if (ange-ftp-ftp-name file) 4123 (if (ange-ftp-ftp-name file)
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/net/tramp.el b/lisp/net/tramp.el
index 769ad3f51f6..0414859c7eb 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3542,7 +3542,14 @@ This will break if COMMAND prints a newline, followed by the value of
3542 3542
3543(defun tramp-handle-file-remote-p (filename) 3543(defun tramp-handle-file-remote-p (filename)
3544 "Like `file-remote-p' for tramp files." 3544 "Like `file-remote-p' for tramp files."
3545 (when (tramp-tramp-file-p filename) t)) 3545 (when (tramp-tramp-file-p filename)
3546 (with-parsed-tramp-file-name filename nil
3547 (make-tramp-file-name
3548 :multi-method multi-method
3549 :method method
3550 :user user
3551 :host host
3552 :localname ""))))
3546 3553
3547(defun tramp-handle-insert-file-contents 3554(defun tramp-handle-insert-file-contents
3548 (filename &optional visit beg end replace) 3555 (filename &optional visit beg end replace)
diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el
index c7b5717a1bb..c9bfbd76c23 100644
--- a/lisp/progmodes/ada-xref.el
+++ b/lisp/progmodes/ada-xref.el
@@ -143,7 +143,8 @@ Otherwise, ask the user for the name of the project file to use."
143 143
144(defcustom ada-tight-gvd-integration nil 144(defcustom ada-tight-gvd-integration nil
145 "*If non-nil, a new Emacs frame will be swallowed in GVD when debugging. 145 "*If non-nil, a new Emacs frame will be swallowed in GVD when debugging.
146If GVD is not the debugger used, nothing happens.") 146If GVD is not the debugger used, nothing happens."
147 :type 'boolean :group 'ada)
147 148
148(defcustom ada-xref-search-with-egrep t 149(defcustom ada-xref-search-with-egrep t
149 "*If non-nil, use egrep to find the possible declarations for an entity. 150 "*If non-nil, use egrep to find the possible declarations for an entity.
@@ -506,12 +507,12 @@ All the directories are returned as absolute directories."
506 (equal ada-prj-default-project-file 507 (equal ada-prj-default-project-file
507 (car x)) 508 (car x))
508 )))) 509 ))))
509 510
510 ;; Parses all the known project files, and insert at 511 ;; Parses all the known project files, and insert at
511 ;; least the default one (in case 512 ;; least the default one (in case
512 ;; ada-xref-project-files is nil) 513 ;; ada-xref-project-files is nil)
513 (or ada-xref-project-files '(nil)))))) 514 (or ada-xref-project-files '(nil))))))
514 515
515 (easy-menu-add-item ada-mode-menu '() submenu))) 516 (easy-menu-add-item ada-mode-menu '() submenu)))
516 517
517 518
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 2f267787707..1e2ef00580e 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -29,10 +29,9 @@
29;; GDB through the GUD buffer in the usual way, but there are also further 29;; GDB through the GUD buffer in the usual way, but there are also further
30;; buffers which control the execution and describe the state of your program. 30;; buffers which control the execution and describe the state of your program.
31;; It separates the input/output of your program from that of GDB, if 31;; It separates the input/output of your program from that of GDB, if
32;; required, and displays expressions and their current values in their own 32;; required, and watches expressions in the speedbar. It also uses features of
33;; buffers. It also uses features of Emacs 21 such as the display margin for 33;; Emacs 21 such as the fringe/display margin for breakpoints, and the toolbar
34;; breakpoints, and the toolbar (see the GDB Graphical Interface section in 34;; (see the GDB Graphical Interface section in the Emacs info manual).
35;; the Emacs info manual).
36 35
37;; Start the debugger with M-x gdba. 36;; Start the debugger with M-x gdba.
38 37
@@ -40,7 +39,7 @@
40;; Kingdon and uses GDB's annotation interface. You don't need to know about 39;; Kingdon and uses GDB's annotation interface. You don't need to know about
41;; annotations to use this mode as a debugger, but if you are interested 40;; annotations to use this mode as a debugger, but if you are interested
42;; developing the mode itself, then see the Annotations section in the GDB 41;; developing the mode itself, then see the Annotations section in the GDB
43;; info manual. 42;; info manual.
44;; 43;;
45;; GDB developers plan to make the annotation interface obsolete. A new 44;; GDB developers plan to make the annotation interface obsolete. A new
46;; interface called GDB/MI (machine interface) has been designed to replace 45;; interface called GDB/MI (machine interface) has been designed to replace
@@ -71,7 +70,7 @@
71(defvar gdb-variables '() 70(defvar gdb-variables '()
72 "A list of variables that are local to the GUD buffer.") 71 "A list of variables that are local to the GUD buffer.")
73(defvar gdb-server-prefix nil) 72(defvar gdb-server-prefix nil)
74 73
75;;;###autoload 74;;;###autoload
76(defun gdba (command-line) 75(defun gdba (command-line)
77 "Run gdb on program FILE in buffer *gud-FILE*. 76 "Run gdb on program FILE in buffer *gud-FILE*.
@@ -228,7 +227,7 @@ speedbar."
228 (if (string-equal expr (car var)) (throw 'already-watched nil))) 227 (if (string-equal expr (car var)) (throw 'already-watched nil)))
229 (set-text-properties 0 (length expr) nil expr) 228 (set-text-properties 0 (length expr) nil expr)
230 (gdb-enqueue-input 229 (gdb-enqueue-input
231 (list 230 (list
232 (if (eq gud-minor-mode 'gdba) 231 (if (eq gud-minor-mode 'gdba)
233 (concat "server interpreter mi \"-var-create - * " expr "\"\n") 232 (concat "server interpreter mi \"-var-create - * " expr "\"\n")
234 (concat"-var-create - * " expr "\n")) 233 (concat"-var-create - * " expr "\n"))
@@ -327,7 +326,7 @@ speedbar."
327 (if (not (member 'gdb-var-update gdb-pending-triggers)) 326 (if (not (member 'gdb-var-update gdb-pending-triggers))
328 (progn 327 (progn
329 (gdb-enqueue-input 328 (gdb-enqueue-input
330 (list 329 (list
331 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) 330 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
332 "server interpreter mi \"-var-update *\"\n" 331 "server interpreter mi \"-var-update *\"\n"
333 "-var-update *\n") 332 "-var-update *\n")
@@ -363,7 +362,7 @@ speedbar."
363 (varnum (cadr var))) 362 (varnum (cadr var)))
364 (unless (string-match "\\." varnum) 363 (unless (string-match "\\." varnum)
365 (gdb-enqueue-input 364 (gdb-enqueue-input
366 (list 365 (list
367 (if (with-current-buffer gud-comint-buffer 366 (if (with-current-buffer gud-comint-buffer
368 (eq gud-minor-mode 'gdba)) 367 (eq gud-minor-mode 'gdba))
369 (concat "server interpreter mi \"-var-delete " varnum "\"\n") 368 (concat "server interpreter mi \"-var-delete " varnum "\"\n")
@@ -487,7 +486,7 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'."
487 (set (make-local-variable 'gdb-buffer-type) key) 486 (set (make-local-variable 'gdb-buffer-type) key)
488 (if (cdr (cdr rules)) 487 (if (cdr (cdr rules))
489 (funcall (car (cdr (cdr rules))))) 488 (funcall (car (cdr (cdr rules)))))
490 (set (make-local-variable 'gud-minor-mode) 489 (set (make-local-variable 'gud-minor-mode)
491 (with-current-buffer gud-comint-buffer gud-minor-mode)) 490 (with-current-buffer gud-comint-buffer gud-minor-mode))
492 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) 491 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
493 new)))) 492 new))))
@@ -1077,13 +1076,15 @@ static char *magick[] = {
1077 '((t 1076 '((t
1078 :inherit fringe 1077 :inherit fringe
1079 :foreground "red")) 1078 :foreground "red"))
1080 "Face for enabled breakpoint icon in fringe.") 1079 "Face for enabled breakpoint icon in fringe."
1080 :group 'gud)
1081 1081
1082(defface breakpoint-disabled-bitmap-face 1082(defface breakpoint-disabled-bitmap-face
1083 '((t 1083 '((t
1084 :inherit fringe 1084 :inherit fringe
1085 :foreground "grey60")) 1085 :foreground "grey60"))
1086 "Face for disabled breakpoint icon in fringe.") 1086 "Face for disabled breakpoint icon in fringe."
1087 :group 'gud)
1087 1088
1088 1089
1089;;-put breakpoint icons in relevant margins (even those set in the GUD buffer) 1090;;-put breakpoint icons in relevant margins (even those set in the GUD buffer)
@@ -1207,8 +1208,8 @@ static char *magick[] = {
1207 (list 1208 (list
1208 (concat 1209 (concat
1209 (if (eq ?y (char-after (match-beginning 2))) 1210 (if (eq ?y (char-after (match-beginning 2)))
1210 gdb-server-prefix "disable " 1211 (concat gdb-server-prefix "disable ")
1211 gdb-server-prefix "enable ") 1212 (concat gdb-server-prefix "enable "))
1212 (match-string 1) "\n") 1213 (match-string 1) "\n")
1213 'ignore))))) 1214 'ignore)))))
1214 1215
@@ -1226,10 +1227,12 @@ static char *magick[] = {
1226 (interactive) 1227 (interactive)
1227 (save-excursion 1228 (save-excursion
1228 (beginning-of-line 1) 1229 (beginning-of-line 1)
1229 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdbmi)) 1230 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
1230 (looking-at "[0-9]*\\s-*\\S-*\\s-*\\S-*\\s-*.\\s-*\\S-*\\s-*\\(\\S-*\\):\\([0-9]+\\)") 1231 (progn
1231 (re-search-forward "in\\s-+\\S-+\\s-+at\\s-+" nil t) 1232 (re-search-forward "in\\s-+\\S-+\\s-+at\\s-+" nil t)
1232 (looking-at "\\(\\S-*\\):\\([0-9]+\\)"))) 1233 (looking-at "\\(\\S-*\\):\\([0-9]+\\)"))
1234 (looking-at
1235 "[0-9]*\\s-*\\S-*\\s-*\\S-*\\s-*.\\s-*\\S-*\\s-*\\(\\S-*\\):\\([0-9]+\\)")))
1233 (if (match-string 2) 1236 (if (match-string 2)
1234 (let ((line (match-string 2)) 1237 (let ((line (match-string 2))
1235 (file (match-string 1))) 1238 (file (match-string 1)))
@@ -1836,7 +1839,7 @@ BUFFER nil or omitted means use the current buffer."
1836 (save-current-buffer 1839 (save-current-buffer
1837 (setq left-margin-width 2) 1840 (setq left-margin-width 2)
1838 (if (get-buffer-window (current-buffer) 'visible) 1841 (if (get-buffer-window (current-buffer) 'visible)
1839 (set-window-margins 1842 (set-window-margins
1840 (get-buffer-window (current-buffer) 'visible) 1843 (get-buffer-window (current-buffer) 'visible)
1841 left-margin-width right-margin-width)))) 1844 left-margin-width right-margin-width))))
1842 (put-image 1845 (put-image
@@ -1863,7 +1866,7 @@ BUFFER nil or omitted means use the current buffer."
1863 (save-current-buffer 1866 (save-current-buffer
1864 (setq left-margin-width 2) 1867 (setq left-margin-width 2)
1865 (if (get-buffer-window (current-buffer) 'visible) 1868 (if (get-buffer-window (current-buffer) 'visible)
1866 (set-window-margins 1869 (set-window-margins
1867 (get-buffer-window (current-buffer) 'visible) 1870 (get-buffer-window (current-buffer) 'visible)
1868 left-margin-width right-margin-width)))) 1871 left-margin-width right-margin-width))))
1869 (gdb-put-string (if enabled "B" "b") (1+ start))))) 1872 (gdb-put-string (if enabled "B" "b") (1+ start)))))
@@ -1875,7 +1878,7 @@ BUFFER nil or omitted means use the current buffer."
1875 (when remove-margin 1878 (when remove-margin
1876 (setq left-margin-width 0) 1879 (setq left-margin-width 0)
1877 (if (get-buffer-window (current-buffer) 'visible) 1880 (if (get-buffer-window (current-buffer) 'visible)
1878 (set-window-margins 1881 (set-window-margins
1879 (get-buffer-window (current-buffer) 'visible) 1882 (get-buffer-window (current-buffer) 'visible)
1880 left-margin-width right-margin-width)))) 1883 left-margin-width right-margin-width))))
1881 1884
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index aa9a50a2580..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]\\)\\(?:\\([0-9]+\\)\\(?:-\\([0-9]+\\)\\)?\\3\\)?" 1 2 (4 . 5)) 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/replace.el b/lisp/replace.el
index 89f55c2829e..c2305cdecc6 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -95,6 +95,35 @@ strings or patterns."
95 (setq to (read-from-minibuffer (format "%s %s with: " string from) 95 (setq to (read-from-minibuffer (format "%s %s with: " string from)
96 nil nil nil 96 nil nil nil
97 query-replace-to-history-variable from t))) 97 query-replace-to-history-variable from t)))
98 (when (and regexp-flag
99 (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to))
100 (let (pos list char)
101 (while
102 (progn
103 (setq pos (match-end 0))
104 (push (substring to 0 (- pos 2)) list)
105 (setq char (aref to (1- pos))
106 to (substring to pos))
107 (cond ((eq char ?\#)
108 (push '(number-to-string replace-count) list))
109 ((eq char ?\,)
110 (setq pos (read-from-string to))
111 (push `(replace-quote ,(car pos)) list)
112 (setq to (substring
113 to (+ (cdr pos)
114 ;; Swallow a space after a symbol
115 ;; if there is a space.
116 (if (string-match
117 "^[^])\"] "
118 (substring to (1- (cdr pos))))
119 1 0))))))
120 (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to)))
121 (setq to (nreverse (delete "" (cons to list)))))
122 (replace-match-string-symbols to)
123 (setq to (cons 'replace-eval-replacement
124 (if (> (length to) 1)
125 (cons 'concat to)
126 (car to)))))
98 (list from to current-prefix-arg))) 127 (list from to current-prefix-arg)))
99 128
100(defun query-replace (from-string to-string &optional delimited start end) 129(defun query-replace (from-string to-string &optional delimited start end)
@@ -163,59 +192,35 @@ Fourth and fifth arg START and END specify the region to operate on.
163In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP, 192In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP,
164and `\\=\\N' (where N is a digit) stands for 193and `\\=\\N' (where N is a digit) stands for
165whatever what matched the Nth `\\(...\\)' in REGEXP. 194whatever what matched the Nth `\\(...\\)' in REGEXP.
166 195`\\?' lets you edit the replacement text in the minibuffer
167When this function is called interactively, the replacement text 196at the given position for each replacement.
168can also contain `\\,' followed by a Lisp expression. The escaped 197
169shorthands for `query-replace-regexp-eval' are also valid 198In interactive calls, the replacement text can contain `\\,'
170here: within the Lisp expression, you can use `\\&' for the whole 199followed by a Lisp expression. Each
171match string, `\\N' for partial matches, `\\#&' and `\\#N' for 200replacement evaluates that expression to compute the replacement
172the respective numeric values, and `\\#' for `replace-count'. 201string. Inside of that expression, `\\&' is a string denoting the
173 202whole match as a sting, `\\N' for a partial match, `\\#&' and `\\#N'
174If your Lisp expression is an identifier and the next 203for the whole or a partial match converted to a number with
175letter in the replacement string would be interpreted as part of it, 204`string-to-number', and `\\#' itself for the number of replacements
176you can wrap it with an expression like `\\,(or \\#)'. Incidentally, 205done so far (starting with zero).
177for this particular case you may also enter `\\#' in the replacement 206
178text directly. 207If the replacement expression is a symbol, write a space after it
179 208to terminate it. One space there, if any, will be discarded.
180When you use `\\,' or `\\#' in the replacement, TO-STRING actually 209
181becomes a list with expanded shorthands. 210When using those Lisp features interactively in the replacement
182Use \\[repeat-complex-command] after this command to see details." 211text, TO-STRING is actually made a list instead of a string.
212Use \\[repeat-complex-command] after this command for details."
183 (interactive 213 (interactive
184 (let ((common 214 (let ((common
185 (query-replace-read-args "Query replace regexp" t))) 215 (query-replace-read-args "Query replace regexp" t)))
186 (list 216 (list (nth 0 common) (nth 1 common) (nth 2 common)
187 (nth 0 common) 217 ;; These are done separately here
188 (if (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" 218 ;; so that command-history will record these expressions
189 (nth 1 common)) 219 ;; rather than the values they had this time.
190 (let ((to-string (nth 1 common)) pos to-expr char prompt) 220 (if (and transient-mark-mode mark-active)
191 (while (string-match 221 (region-beginning))
192 "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" 222 (if (and transient-mark-mode mark-active)
193 to-string) 223 (region-end)))))
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)))))
219 (perform-replace regexp to-string t t delimited nil nil start end)) 224 (perform-replace regexp to-string t t delimited nil nil start end))
220 225
221(define-key esc-map [?\C-%] 'query-replace-regexp) 226(define-key esc-map [?\C-%] 'query-replace-regexp)
@@ -374,7 +379,27 @@ Fourth and fifth arg START and END specify the region to operate on.
374 379
375In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP, 380In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP,
376and `\\=\\N' (where N is a digit) stands for 381and `\\=\\N' (where N is a digit) stands for
377 whatever what matched the Nth `\\(...\\)' in REGEXP. 382whatever what matched the Nth `\\(...\\)' in REGEXP.
383`\\?' lets you edit the replacement text in the minibuffer
384at the given position for each replacement.
385
386In interactive calls, the replacement text may contain `\\,'
387followed by a Lisp expression used as part of the replacement
388text. Inside of that expression, `\\&' is a string denoting the
389whole match, `\\N' a partial matches, `\\#&' and `\\#N' the
390respective numeric values from `string-to-number', and `\\#'
391itself for `replace-count', the number of replacements occured so
392far.
393
394If your Lisp expression is an identifier and the next letter in
395the replacement string would be interpreted as part of it, you
396can wrap it with an expression like `\\,(or \\#)'. Incidentally,
397for this particular case you may also enter `\\#' in the
398replacement text directly.
399
400When using those Lisp features interactively in the replacement
401text, TO-STRING is actually made a list instead of a string.
402Use \\[repeat-complex-command] after this command for details.
378 403
379If `query-replace-interactive' is non-nil, the last incremental search 404If `query-replace-interactive' is non-nil, the last incremental search
380regexp is used as REGEXP--you don't have to specify it with the minibuffer. 405regexp is used as REGEXP--you don't have to specify it with the minibuffer.
@@ -1115,6 +1140,49 @@ with the `noescape' argument set.
1115 (aset data 2 (if (consp next) next (aref data 3)))))) 1140 (aset data 2 (if (consp next) next (aref data 3))))))
1116 (car (aref data 2))) 1141 (car (aref data 2)))
1117 1142
1143(defun replace-match-data (integers reuse &optional new)
1144 "Like `match-data', but markers in REUSE get invalidated.
1145If NEW is non-NIL, it is set and returned instead of fresh data,
1146but coerced to the correct value of INTEGERS."
1147 (or (and new
1148 (progn
1149 (set-match-data new)
1150 (and (eq new reuse)
1151 (eq (null integers) (markerp (car reuse)))
1152 new)))
1153 (match-data integers
1154 (prog1 reuse
1155 (while reuse
1156 (if (markerp (car reuse))
1157 (set-marker (car reuse) nil))
1158 (setq reuse (cdr reuse)))))))
1159
1160(defun replace-match-maybe-edit (newtext fixedcase literal noedit match-data)
1161 "Make a replacement with `replace-match', editing `\\?'.
1162NEXTEXT, FIXEDCASE, LITERAL are just passed on. If NOEDIT is true, no
1163check for `\\?' is made to save time. MATCH-DATA is used for the
1164replacement. In case editing is done, it is changed to use markers.
1165
1166The return value is non-NIL if there has been no `\\?' or NOEDIT was
1167passed in. If LITERAL is set, no checking is done, anyway."
1168 (unless (or literal noedit)
1169 (setq noedit t)
1170 (while (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\\\?\\)"
1171 newtext)
1172 (setq newtext
1173 (read-input "Edit replacement string: "
1174 (prog1
1175 (cons
1176 (replace-match "" t t newtext 3)
1177 (1+ (match-beginning 3)))
1178 (setq match-data
1179 (replace-match-data
1180 nil match-data match-data))))
1181 noedit nil)))
1182 (set-match-data match-data)
1183 (replace-match newtext fixedcase literal)
1184 noedit)
1185
1118(defun perform-replace (from-string replacements 1186(defun perform-replace (from-string replacements
1119 query-flag regexp-flag delimited-flag 1187 query-flag regexp-flag delimited-flag
1120 &optional repeat-count map start end) 1188 &optional repeat-count map start end)
@@ -1145,6 +1213,7 @@ make, or the user didn't cancel the call."
1145 (search-string from-string) 1213 (search-string from-string)
1146 (real-match-data nil) ; the match data for the current match 1214 (real-match-data nil) ; the match data for the current match
1147 (next-replacement nil) 1215 (next-replacement nil)
1216 (noedit nil)
1148 (keep-going t) 1217 (keep-going t)
1149 (stack nil) 1218 (stack nil)
1150 (replace-count 0) 1219 (replace-count 0)
@@ -1201,7 +1270,9 @@ make, or the user didn't cancel the call."
1201 (setq real-match-data 1270 (setq real-match-data
1202 (if (consp match-again) 1271 (if (consp match-again)
1203 (progn (goto-char (nth 1 match-again)) 1272 (progn (goto-char (nth 1 match-again))
1204 match-again) 1273 (replace-match-data t
1274 real-match-data
1275 match-again))
1205 (and (or match-again 1276 (and (or match-again
1206 ;; MATCH-AGAIN non-nil means we 1277 ;; MATCH-AGAIN non-nil means we
1207 ;; accept an adjacent match. If 1278 ;; accept an adjacent match. If
@@ -1217,7 +1288,7 @@ make, or the user didn't cancel the call."
1217 (funcall search-function search-string limit t) 1288 (funcall search-function search-string limit t)
1218 ;; For speed, use only integers and 1289 ;; For speed, use only integers and
1219 ;; reuse the list used last time. 1290 ;; reuse the list used last time.
1220 (match-data t real-match-data))))) 1291 (replace-match-data t real-match-data)))))
1221 ;; Optionally ignore matches that have a read-only property. 1292 ;; Optionally ignore matches that have a read-only property.
1222 (unless (and query-replace-skip-read-only 1293 (unless (and query-replace-skip-read-only
1223 (text-property-not-all 1294 (text-property-not-all
@@ -1249,16 +1320,27 @@ make, or the user didn't cancel the call."
1249 (set-match-data real-match-data) 1320 (set-match-data real-match-data)
1250 (setq next-replacement 1321 (setq next-replacement
1251 (funcall (car replacements) (cdr replacements) 1322 (funcall (car replacements) (cdr replacements)
1252 replace-count))) 1323 replace-count)
1324 noedit nil))
1253 (if (not query-flag) 1325 (if (not query-flag)
1254 (let ((inhibit-read-only query-replace-skip-read-only)) 1326 (let ((inhibit-read-only
1255 (set-match-data real-match-data) 1327 query-replace-skip-read-only))
1256 (replace-match next-replacement nocasify literal) 1328 (unless noedit
1257 (setq replace-count (1+ replace-count))) 1329 (replace-highlight (nth 0 real-match-data)
1330 (nth 1 real-match-data)))
1331 (setq noedit
1332 (replace-match-maybe-edit
1333 next-replacement nocasify literal
1334 noedit real-match-data)
1335 replace-count (1+ replace-count)))
1258 (undo-boundary) 1336 (undo-boundary)
1259 (let (done replaced key def) 1337 (let (done replaced key def)
1260 ;; Loop reading commands until one of them sets done, 1338 ;; Loop reading commands until one of them sets done,
1261 ;; which means it has finished handling this occurrence. 1339 ;; which means it has finished handling this
1340 ;; occurrence. Any command that sets `done' should
1341 ;; leave behind proper match data for the stack.
1342 ;; Commands not setting `done' need to adjust
1343 ;; `real-match-data'.
1262 (while (not done) 1344 (while (not done)
1263 (set-match-data real-match-data) 1345 (set-match-data real-match-data)
1264 (replace-highlight (match-beginning 0) (match-end 0)) 1346 (replace-highlight (match-beginning 0) (match-end 0))
@@ -1290,37 +1372,49 @@ make, or the user didn't cancel the call."
1290 ((eq def 'backup) 1372 ((eq def 'backup)
1291 (if stack 1373 (if stack
1292 (let ((elt (pop stack))) 1374 (let ((elt (pop stack)))
1293 (goto-char (car elt)) 1375 (goto-char (nth 0 elt))
1294 (setq replaced (eq t (cdr elt))) 1376 (setq replaced (nth 1 elt)
1295 (or replaced 1377 real-match-data
1296 (set-match-data (cdr elt)))) 1378 (replace-match-data
1379 t real-match-data
1380 (nth 2 elt))))
1297 (message "No previous match") 1381 (message "No previous match")
1298 (ding 'no-terminate) 1382 (ding 'no-terminate)
1299 (sit-for 1))) 1383 (sit-for 1)))
1300 ((eq def 'act) 1384 ((eq def 'act)
1301 (or replaced 1385 (or replaced
1302 (progn 1386 (setq noedit
1303 (replace-match next-replacement nocasify literal) 1387 (replace-match-maybe-edit
1304 (setq replace-count (1+ replace-count)))) 1388 next-replacement nocasify literal
1389 noedit real-match-data)
1390 replace-count (1+ replace-count)))
1305 (setq done t replaced t)) 1391 (setq done t replaced t))
1306 ((eq def 'act-and-exit) 1392 ((eq def 'act-and-exit)
1307 (or replaced 1393 (or replaced
1308 (progn 1394 (setq noedit
1309 (replace-match next-replacement nocasify literal) 1395 (replace-match-maybe-edit
1310 (setq replace-count (1+ replace-count)))) 1396 next-replacement nocasify literal
1397 noedit real-match-data)
1398 replace-count (1+ replace-count)))
1311 (setq keep-going nil) 1399 (setq keep-going nil)
1312 (setq done t replaced t)) 1400 (setq done t replaced t))
1313 ((eq def 'act-and-show) 1401 ((eq def 'act-and-show)
1314 (if (not replaced) 1402 (if (not replaced)
1315 (progn 1403 (setq noedit
1316 (replace-match next-replacement nocasify literal) 1404 (replace-match-maybe-edit
1317 (setq replace-count (1+ replace-count)) 1405 next-replacement nocasify literal
1318 (setq replaced t)))) 1406 noedit real-match-data)
1407 replace-count (1+ replace-count)
1408 real-match-data (replace-match-data
1409 t real-match-data)
1410 replaced t)))
1319 ((eq def 'automatic) 1411 ((eq def 'automatic)
1320 (or replaced 1412 (or replaced
1321 (progn 1413 (setq noedit
1322 (replace-match next-replacement nocasify literal) 1414 (replace-match-maybe-edit
1323 (setq replace-count (1+ replace-count)))) 1415 next-replacement nocasify literal
1416 noedit real-match-data)
1417 replace-count (1+ replace-count)))
1324 (setq done t query-flag nil replaced t)) 1418 (setq done t query-flag nil replaced t))
1325 ((eq def 'skip) 1419 ((eq def 'skip)
1326 (setq done t)) 1420 (setq done t))
@@ -1328,36 +1422,45 @@ make, or the user didn't cancel the call."
1328 (recenter nil)) 1422 (recenter nil))
1329 ((eq def 'edit) 1423 ((eq def 'edit)
1330 (let ((opos (point-marker))) 1424 (let ((opos (point-marker)))
1425 (setq real-match-data (replace-match-data
1426 nil real-match-data
1427 real-match-data))
1331 (goto-char (match-beginning 0)) 1428 (goto-char (match-beginning 0))
1332 (save-excursion 1429 (save-excursion
1333 (funcall search-function search-string limit t)
1334 (setq real-match-data (match-data)))
1335 (save-excursion
1336 (save-window-excursion 1430 (save-window-excursion
1337 (recursive-edit))) 1431 (recursive-edit)))
1338 (goto-char opos)) 1432 (goto-char opos)
1339 (set-match-data real-match-data) 1433 (set-marker opos nil))
1340 ;; Before we make the replacement, 1434 ;; Before we make the replacement,
1341 ;; decide whether the search string 1435 ;; decide whether the search string
1342 ;; can match again just after this match. 1436 ;; can match again just after this match.
1343 (if (and regexp-flag nonempty-match) 1437 (if (and regexp-flag nonempty-match)
1344 (setq match-again (and (looking-at search-string) 1438 (setq match-again (and (looking-at search-string)
1345 (match-data))))) 1439 (match-data)))))
1346
1347 ;; Edit replacement. 1440 ;; Edit replacement.
1348 ((eq def 'edit-replacement) 1441 ((eq def 'edit-replacement)
1349 (setq next-replacement 1442 (setq real-match-data (replace-match-data
1443 nil real-match-data
1444 real-match-data)
1445 next-replacement
1350 (read-input "Edit replacement string: " 1446 (read-input "Edit replacement string: "
1351 next-replacement)) 1447 next-replacement)
1352 (or replaced 1448 noedit nil)
1353 (replace-match next-replacement nocasify literal)) 1449 (if replaced
1450 (set-match-data real-match-data)
1451 (setq noedit
1452 (replace-match-maybe-edit
1453 next-replacement nocasify literal noedit
1454 real-match-data)
1455 replaced t))
1354 (setq done t)) 1456 (setq done t))
1355 1457
1356 ((eq def 'delete-and-edit) 1458 ((eq def 'delete-and-edit)
1357 (delete-region (match-beginning 0) (match-end 0)) 1459 (replace-match "" t t)
1358 (set-match-data 1460 (setq real-match-data (replace-match-data
1359 (prog1 (match-data) 1461 nil real-match-data))
1360 (save-excursion (recursive-edit)))) 1462 (replace-dehighlight)
1463 (save-excursion (recursive-edit))
1361 (setq replaced t)) 1464 (setq replaced t))
1362 ;; Note: we do not need to treat `exit-prefix' 1465 ;; Note: we do not need to treat `exit-prefix'
1363 ;; specially here, since we reread 1466 ;; specially here, since we reread
@@ -1372,10 +1475,23 @@ make, or the user didn't cancel the call."
1372 ;; Record previous position for ^ when we move on. 1475 ;; Record previous position for ^ when we move on.
1373 ;; Change markers to numbers in the match data 1476 ;; Change markers to numbers in the match data
1374 ;; since lots of markers slow down editing. 1477 ;; since lots of markers slow down editing.
1375 (setq stack 1478 (push (list (point) replaced
1376 (cons (cons (point) 1479;;; If the replacement has already happened, all we need is the
1377 (or replaced (match-data t))) 1480;;; current match start and end. We could get this with a trivial
1378 stack)))))) 1481;;; match like
1482;;; (save-excursion (goto-char (match-beginning 0))
1483;;; (search-forward (match-string 0))
1484;;; (match-data t))
1485;;; if we really wanted to avoid manually constructing match data.
1486;;; Adding current-buffer is necessary so that match-data calls can
1487;;; return markers which are appropriate for editing.
1488 (if replaced
1489 (list
1490 (match-beginning 0)
1491 (match-end 0)
1492 (current-buffer))
1493 (match-data t)))
1494 stack)))))
1379 1495
1380 ;; The code preventing adjacent regexp matches in the condition 1496 ;; The code preventing adjacent regexp matches in the condition
1381 ;; of the while-loop above will haven taken us one character 1497 ;; of the while-loop above will haven taken us one character
@@ -1405,14 +1521,12 @@ make, or the user didn't cancel the call."
1405 1521
1406(defun replace-highlight (start end) 1522(defun replace-highlight (start end)
1407 (and query-replace-highlight 1523 (and query-replace-highlight
1408 (progn 1524 (if replace-overlay
1409 (or replace-overlay 1525 (move-overlay replace-overlay start end (current-buffer))
1410 (progn 1526 (setq replace-overlay (make-overlay start end))
1411 (setq replace-overlay (make-overlay start end)) 1527 (overlay-put replace-overlay 'face
1412 (overlay-put replace-overlay 'face 1528 (if (facep 'query-replace)
1413 (if (facep 'query-replace) 1529 'query-replace 'region)))))
1414 'query-replace 'region))))
1415 (move-overlay replace-overlay start end (current-buffer)))))
1416 1530
1417;;; arch-tag: 16b4cd61-fd40-497b-b86f-b667c4cf88e4 1531;;; arch-tag: 16b4cd61-fd40-497b-b86f-b667c4cf88e4
1418;;; replace.el ends here 1532;;; replace.el ends here
diff --git a/lisp/vc-arch.el b/lisp/vc-arch.el
index a439174556e..5f24599241c 100644
--- a/lisp/vc-arch.el
+++ b/lisp/vc-arch.el
@@ -309,7 +309,8 @@ Return non-nil if FILE is unchanged."
309(defcustom vc-arch-mode-line-rewrite 309(defcustom vc-arch-mode-line-rewrite
310 '(("\\`.*--\\(.*--.*\\)--\\(v?\\).*-\\([0-9]+\\)\\'" . "\\2\\3[\\1]")) 310 '(("\\`.*--\\(.*--.*\\)--\\(v?\\).*-\\([0-9]+\\)\\'" . "\\2\\3[\\1]"))
311 "Rewrite rules to shorten Arch's revision names on the mode-line." 311 "Rewrite rules to shorten Arch's revision names on the mode-line."
312 :type '(repeat (cons regexp string))) 312 :type '(repeat (cons regexp string))
313 :group 'vc)
313 314
314(defun vc-arch-mode-line-string (file) 315(defun vc-arch-mode-line-string (file)
315 "Return string for placement in modeline by `vc-mode-line' for FILE." 316 "Return string for placement in modeline by `vc-mode-line' for FILE."
diff --git a/lisp/woman.el b/lisp/woman.el
index ba511bca1ae..cea1c61bcc4 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -5,7 +5,7 @@
5;; Author: Francis J. Wright <F.J.Wright@qmul.ac.uk> 5;; Author: Francis J. Wright <F.J.Wright@qmul.ac.uk>
6;; Maintainer: Francis J. Wright <F.J.Wright@qmul.ac.uk> 6;; Maintainer: Francis J. Wright <F.J.Wright@qmul.ac.uk>
7;; Keywords: help, unix 7;; Keywords: help, unix
8;; Adapted-By: Eli Zaretskii <eliz@is.elta.co.il> 8;; Adapted-By: Eli Zaretskii <eliz@gnu.org>
9;; Version: see `woman-version' 9;; Version: see `woman-version'
10;; URL: http://centaur.maths.qmul.ac.uk/Emacs/WoMan/ 10;; URL: http://centaur.maths.qmul.ac.uk/Emacs/WoMan/
11 11
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index c4c6b81e8ba..970ecc4d494 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,50 @@
12004-06-24 Richard M. Stallman <rms@gnu.org>
2
3 * commands.texi (Misc Events): Describe usr1-signal, usr2-signal event.
4
5 * customize.texi (Variable Definitions): Note about doc strings
6 and :set.
7
8 * keymaps.texi (Keymap Terminology): Document `kbd'.
9 (Changing Key Bindings, Key Binding Commands): Use kbd in examples.
10
11 * display.texi (Invisible Text): Setting buffer-invisibility-spec
12 makes it buffer-local.
13
14 * files.texi (Saving Buffers): Correct previous change.
15
16 * commands.texi (Accessing Events):
17 Clarify posn-col-row and posn-actual-col-row.
18
192004-06-24 David Ponce <david.ponce@wanadoo.fr>
20
21 * commands.texi (Accessing Events): New functions
22 posn-at-point and posn-at-x-y. Add example to posn-x-y.
23
242004-06-23 Luc Teirlinck <teirllm@auburn.edu>
25
26 * lists.texi, files.texi, processes.texi, macros.texi, hash.texi:
27 * frames.texi, buffers.texi, backups.texi, variables.texi:
28 * loading.texi, eval.texi, functions.texi, control.texi:
29 * symbols.texi, minibuf.texi: Reposition @anchor's.
30
31 * help.texi: Various small changes in addition to the following.
32 (Describing Characters): Describe PREFIX argument to
33 `key-description'. Correct and clarify definition of
34 `text-char-description'. Describe NEED-VECTOR argument to
35 `read-kbd-macro'.
36 (Help Functions): Clarify definition of `apropos'.
37
382004-06-23 Lars Hansen <larsh@math.ku.dk>
39
40 * files.texi (Saving Buffers): Correct description of
41 `write-contents-functions'.
42
432004-06-21 Juanma Barranquero <lektu@terra.es>
44
45 * display.texi (Images): Remove redundant @vindex directives.
46 Rewrite `image-library-alist' doc in active voice.
47
12004-06-14 Juanma Barranquero <lektu@terra.es> 482004-06-14 Juanma Barranquero <lektu@terra.es>
2 49
3 * display.texi (Images): Document new delayed library loading, 50 * display.texi (Images): Document new delayed library loading,
diff --git a/lispref/backups.texi b/lispref/backups.texi
index d4ef8032ad9..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
@@ -712,8 +712,8 @@ reverts the file without asking the user for confirmation.
712 Some major modes customize @code{revert-buffer} by making 712 Some major modes customize @code{revert-buffer} by making
713buffer-local bindings for these variables: 713buffer-local bindings for these variables:
714 714
715@anchor{Definition of revert-buffer-function}
716@defvar revert-buffer-function 715@defvar revert-buffer-function
716@anchor{Definition of revert-buffer-function}
717The 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
718buffer. 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
719arguments 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/commands.texi b/lispref/commands.texi
index 5a38179996f..7a014080e89 100644
--- a/lispref/commands.texi
+++ b/lispref/commands.texi
@@ -872,7 +872,7 @@ the current Emacs session. If a symbol has not yet been so used,
872* Repeat Events:: Double and triple click (or drag, or down). 872* Repeat Events:: Double and triple click (or drag, or down).
873* Motion Events:: Just moving the mouse, not pushing a button. 873* Motion Events:: Just moving the mouse, not pushing a button.
874* Focus Events:: Moving the mouse between frames. 874* Focus Events:: Moving the mouse between frames.
875* Misc Events:: Other events window systems can generate. 875* Misc Events:: Other events the system can generate.
876* Event Examples:: Examples of the lists for mouse events. 876* Event Examples:: Examples of the lists for mouse events.
877* Classifying Events:: Finding the modifier keys in an event symbol. 877* Classifying Events:: Finding the modifier keys in an event symbol.
878 Event types. 878 Event types.
@@ -1462,9 +1462,9 @@ so that the focus event comes either before or after the multi-event key
1462sequence, and not within it. 1462sequence, and not within it.
1463 1463
1464@node Misc Events 1464@node Misc Events
1465@subsection Miscellaneous Window System Events 1465@subsection Miscellaneous System Events
1466 1466
1467A few other event types represent occurrences within the window system. 1467A few other event types represent occurrences within the system.
1468 1468
1469@table @code 1469@table @code
1470@cindex @code{delete-frame} event 1470@cindex @code{delete-frame} event
@@ -1517,6 +1517,14 @@ The usual way to handle this event is by visiting these files.
1517 1517
1518This kind of event is generated, at present, only on some kinds of 1518This kind of event is generated, at present, only on some kinds of
1519systems. 1519systems.
1520
1521@cindex @code{usr1-signal} event
1522@cindex @code{usr2-signal} event
1523@item usr1-signal
1524@itemx usr2-signal
1525These events are generated when the Emacs process receives the signals
1526@code{SIGUSR1} and @code{SIGUSR2}. They contain no additional data
1527because signals do not carry additional information.
1520@end table 1528@end table
1521 1529
1522 If one of these events arrives in the middle of a key sequence---that 1530 If one of these events arrives in the middle of a key sequence---that
@@ -1695,7 +1703,7 @@ position such events have.
1695@end defun 1703@end defun
1696 1704
1697@cindex mouse position list, accessing 1705@cindex mouse position list, accessing
1698 These seven functions take a position list as described above, and 1706 These functions take a position list as described above, and
1699return various parts of it. 1707return various parts of it.
1700 1708
1701@defun posn-window position 1709@defun posn-window position
@@ -1716,23 +1724,37 @@ is undefined.
1716@end defun 1724@end defun
1717 1725
1718@defun posn-x-y position 1726@defun posn-x-y position
1719Return the pixel-based x and y coordinates in @var{position}, as a cons 1727Return the pixel-based x and y coordinates in @var{position}, as a
1720cell @code{(@var{x} . @var{y})}. 1728cons cell @code{(@var{x} . @var{y})}. These coordinates are relative
1729to the window given by @code{posn-window}.
1730
1731This example shows how to convert these window-relative coordinates
1732into frame-relative coordinates:
1733
1734@example
1735(defun frame-relative-coordinates (position)
1736 "Return frame-relative coordinates from POSITION."
1737 (let* ((x-y (posn-x-y position))
1738 (window (posn-window position))
1739 (edges (window-inside-pixel-edges window)))
1740 (cons (+ (car x-y) (car edges))
1741 (+ (cdr x-y) (cadr edges)))))
1742@end example
1721@end defun 1743@end defun
1722 1744
1723@defun posn-col-row position 1745@defun posn-col-row position
1724Return the row and column (in units of frame default characters) of 1746Return the row and column (in units of the frame's default character
1725@var{position}, as a cons cell @code{(@var{col} . @var{row})}. These 1747height and width) of @var{position}, as a cons cell @code{(@var{col} .
1726are computed from the @var{x} and @var{y} values actually found in 1748@var{row})}. These are computed from the @var{x} and @var{y} values
1727@var{position}. 1749actually found in @var{position}.
1728@end defun 1750@end defun
1729 1751
1730@defun posn-actual-col-row position 1752@defun posn-actual-col-row position
1731Return the actual row and column in @var{position}, as a cons cell 1753Return the actual row and column in @var{position}, as a cons cell
1732@code{(@var{col} . @var{row})}. The values are the actual row number 1754@code{(@var{col} . @var{row})}. The values are the actual row number
1733in the window, and the actual character number in that row. Return 1755in the window, and the actual character number in that row. It returns
1734@code{nil} if @var{position} does not include the actual positions; in that 1756@code{nil} if @var{position} does not include actual positions values.
1735case, @code{posn-col-row} can be used to get approximate values. 1757You can use @code{posn-col-row} to get approximate values.
1736@end defun 1758@end defun
1737 1759
1738@defun posn-string position 1760@defun posn-string position
@@ -1771,6 +1793,27 @@ Return the timestamp in @var{position}. This is the time at which the
1771event occurred, in milliseconds. 1793event occurred, in milliseconds.
1772@end defun 1794@end defun
1773 1795
1796 These functions compute a position list given particular buffer
1797position or screen position. You can access the data in this position
1798list with the functions described above.
1799
1800@defun posn-at-point &optional pos window
1801This function returns a position list for position @var{pos} in
1802@var{window}. @var{pos} defaults to point in @var{window};
1803@var{window} defaults to the selected window.
1804
1805@code{posn-at-point} returns @code{nil} if @var{pos} is not visible in
1806@var{window}.
1807@end defun
1808
1809@defun posn-at-x-y x y &optional frame-or-window
1810This function returns position information corresponding to pixel
1811coordinates @var{x} and @var{y} in a specified frame or window,
1812@var{frame-or-window}, which defaults to the selected window.
1813The coordinates @var{x} and @var{y} are relative to the
1814frame or window used.
1815@end defun
1816
1774 These functions are useful for decoding scroll bar events. 1817 These functions are useful for decoding scroll bar events.
1775 1818
1776@defun scroll-bar-event-ratio event 1819@defun scroll-bar-event-ratio event
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/customize.texi b/lispref/customize.texi
index 5b95e911f85..c2e31462e0e 100644
--- a/lispref/customize.texi
+++ b/lispref/customize.texi
@@ -194,6 +194,11 @@ than one occasion. You should normally avoid using backquotes in
194@var{default} because they are not expanded when editing the value, 194@var{default} because they are not expanded when editing the value,
195causing list values to appear to have the wrong structure. 195causing list values to appear to have the wrong structure.
196 196
197If you specify the @code{:set} option, to make the variable take other
198special actions when set through the customization buffer, the
199variable's documentation string should tell the user specifically how
200to do the same job in hand-written Lisp code.
201
197When you evaluate a @code{defcustom} form with @kbd{C-M-x} in Emacs Lisp 202When you evaluate a @code{defcustom} form with @kbd{C-M-x} in Emacs Lisp
198mode (@code{eval-defun}), a special feature of @code{eval-defun} 203mode (@code{eval-defun}), a special feature of @code{eval-defun}
199arranges to set the variable unconditionally, without testing whether 204arranges to set the variable unconditionally, without testing whether
diff --git a/lispref/display.texi b/lispref/display.texi
index 1f8868981b7..b6fd015beba 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -562,7 +562,8 @@ the buffer looking for properties to change.
562 562
563@defvar buffer-invisibility-spec 563@defvar buffer-invisibility-spec
564This variable specifies which kinds of @code{invisible} properties 564This variable specifies which kinds of @code{invisible} properties
565actually make a character invisible. 565actually make a character invisible. Setting this variable makes it
566buffer-local.
566 567
567@table @asis 568@table @asis
568@item @code{t} 569@item @code{t}
@@ -2892,7 +2893,6 @@ type symbols are @code{xbm}, @code{xpm}, @code{gif}, @code{postscript},
2892@code{pbm}, @code{jpeg}, @code{tiff}, and @code{png}. 2893@code{pbm}, @code{jpeg}, @code{tiff}, and @code{png}.
2893 2894
2894@defvar image-types 2895@defvar image-types
2895@vindex image-types
2896This variable contains a list of those image type symbols that are 2896This variable contains a list of those image type symbols that are
2897potentially supported in the current configuration. 2897potentially supported in the current configuration.
2898@emph{Potentially} here means that Emacs knows about the image types, 2898@emph{Potentially} here means that Emacs knows about the image types,
@@ -2904,7 +2904,6 @@ To know which image types are really available, use
2904@end defvar 2904@end defvar
2905 2905
2906@defvar image-library-alist 2906@defvar image-library-alist
2907@vindex image-library-alist
2908This in an alist of image types vs external libraries needed to 2907This in an alist of image types vs external libraries needed to
2909display them. 2908display them.
2910 2909
@@ -2913,9 +2912,9 @@ where the car is a supported image format from @code{image-types}, and
2913the rest are strings giving alternate filenames for the corresponding 2912the rest are strings giving alternate filenames for the corresponding
2914external libraries to load. 2913external libraries to load.
2915 2914
2916They are tried in the order they appear on the list; if none of them 2915Emacs 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 2916list; if none is loaded, the running session of Emacs won't support
2918type. No entries are needed for @code{pbm} and @code{xbm} images; 2917the image type. @code{pbm} and @code{xbm} don't need to be listed;
2919they're always supported. 2918they're always supported.
2920 2919
2921This variable is ignored if the image libraries are statically linked 2920This variable is ignored if the image libraries are statically linked
@@ -2925,9 +2924,9 @@ into Emacs.
2925@defun image-type-available-p type 2924@defun image-type-available-p type
2926@findex image-type-available-p 2925@findex image-type-available-p
2927 2926
2928This function returns non-nil if image type TYPE is available, i.e., 2927This function returns non-nil if image type @var{TYPE} is available,
2929if images of this type can be loaded and displayed in Emacs. TYPE 2928i.e., if images of this type can be loaded and displayed in Emacs.
2930should be one of the types contained in @code{image-types}. 2929@var{TYPE} should be one of the types contained in @code{image-types}.
2931 2930
2932For image types whose support libraries are statically linked, this 2931For image types whose support libraries are statically linked, this
2933function always returns @code{t}; for other image types, it returns 2932function 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..10d6c808625 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>}
@@ -417,10 +417,11 @@ Even though this is not a normal hook, you can use @code{add-hook} and
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 file, as opposed to hooks that
420pertain to where the file came from. Such hooks are usually set up by 420pertain to the file's name or location. 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/keymaps.texi b/lispref/keymaps.texi
index ee50855bef3..12246f0b236 100644
--- a/lispref/keymaps.texi
+++ b/lispref/keymaps.texi
@@ -95,6 +95,27 @@ precedence over) the corresponding global bindings. The minor mode
95keymaps shadow both local and global keymaps. @xref{Active Keymaps}, 95keymaps shadow both local and global keymaps. @xref{Active Keymaps},
96for details. 96for details.
97 97
98 The Emacs Lisp representation for a key sequence is a string or vector.
99You can enter key sequence constants using the ordinary string or vector
100representation; it is also convenient to use @code{kbd}:
101
102@defmac kbd keyseq-text
103This macro converts the text @var{keyseq-text} (a string constant)
104into a key sequence (a string or vector constant). The contents
105of @var{keyseq-text} should describe the key sequence using the syntax
106used in this manual:
107
108@example
109(kbd "C-x") @result{} "\C-x"
110(kbd "C-x C-f") @result{} "\C-x\C-f"
111(kbd "C-c C-c") @result{} "\C-c\C-c"
112(kbd "C-x 4 C-f") @result{} "\C-x4\C-f"
113(kbd "X") @result{} "X"
114(kbd "RET") @result{} "\^M"
115(kbd "C-c 3") @result{} "\C-c3"
116@end example
117@end defmac
118
98@node Format of Keymaps 119@node Format of Keymaps
99@section Format of Keymaps 120@section Format of Keymaps
100@cindex format of keymaps 121@cindex format of keymaps
@@ -880,6 +901,10 @@ the other functions described in this chapter that look up keys use
880 @result{} find-file 901 @result{} find-file
881@end group 902@end group
882@group 903@group
904(lookup-key (current-global-map) (kbd "C-x C-f"))
905 @result{} find-file
906@end group
907@group
883(lookup-key (current-global-map) "\C-x\C-f12345") 908(lookup-key (current-global-map) "\C-x\C-f12345")
884 @result{} 2 909 @result{} 2
885@end group 910@end group
@@ -1126,7 +1151,7 @@ map
1126 1151
1127@group 1152@group
1128;; @r{Build sparse submap for @kbd{C-x} and bind @kbd{f} in that.} 1153;; @r{Build sparse submap for @kbd{C-x} and bind @kbd{f} in that.}
1129(define-key map "\C-xf" 'forward-word) 1154(define-key map (kbd "C-x f") 'forward-word)
1130 @result{} forward-word 1155 @result{} forward-word
1131@end group 1156@end group
1132@group 1157@group
@@ -1139,14 +1164,14 @@ map
1139 1164
1140@group 1165@group
1141;; @r{Bind @kbd{C-p} to the @code{ctl-x-map}.} 1166;; @r{Bind @kbd{C-p} to the @code{ctl-x-map}.}
1142(define-key map "\C-p" ctl-x-map) 1167(define-key map (kbd "C-p") ctl-x-map)
1143;; @code{ctl-x-map} 1168;; @code{ctl-x-map}
1144@result{} [nil @dots{} find-file @dots{} backward-kill-sentence] 1169@result{} [nil @dots{} find-file @dots{} backward-kill-sentence]
1145@end group 1170@end group
1146 1171
1147@group 1172@group
1148;; @r{Bind @kbd{C-f} to @code{foo} in the @code{ctl-x-map}.} 1173;; @r{Bind @kbd{C-f} to @code{foo} in the @code{ctl-x-map}.}
1149(define-key map "\C-p\C-f" 'foo) 1174(define-key map (kbd "C-p C-f") 'foo)
1150@result{} 'foo 1175@result{} 'foo
1151@end group 1176@end group
1152@group 1177@group
@@ -1333,7 +1358,7 @@ changing key bindings. They work by calling @code{define-key}.
1333(@pxref{Init File}) for simple customization. For example, 1358(@pxref{Init File}) for simple customization. For example,
1334 1359
1335@smallexample 1360@smallexample
1336(global-set-key "\C-x\C-\\" 'next-line) 1361(global-set-key (kbd "C-x C-\\") 'next-line)
1337@end smallexample 1362@end smallexample
1338 1363
1339@noindent 1364@noindent
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 16044ff1114..288cd00386a 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,36 @@
12004-06-29 Jesper Harder <harder@ifa.au.dk>
2
3 * ses.texi, viper.texi, search.texi, flymake.texi, faq.texi:
4 * eshell.texi, ediff.texi, calendar.texi: Markup fixes.
5
62004-06-25 Richard M. Stallman <rms@gnu.org>
7
8 * search.texi (Regexp Replace): Rewrite description of \# \, and \?.
9
102004-06-25 David Kastrup <dak@gnu.org>
11
12 * search.texi (Regexp Replace): Some typo corrections and
13 rearrangement.
14
152004-06-24 David Kastrup <dak@gnu.org>
16
17 * search.texi (Unconditional Replace): Use replace-string instead
18 of query-replace in example.
19 (Regexp Replace): Add explanations for `\,', `\#' and `\?'
20 sequences.
21 (Query Replace): Correct explanation of `^' which does not use
22 the mark stack.
23
242004-06-21 Nick Roberts <nickrob@gnu.org>
25
26 * misc.texi (Shell History Copying): Document comint-insert-input.
27 (Shell Ring): Describe comint-dynamic-list-input-ring here.
28
292004-06-21 Karl Berry <karl@gnu.org>
30
31 * info.texi (Top): mention that only Emacs has mouse support.
32 (Getting Started): mention this in a few other places.
33
12004-06-20 Jesper Harder <harder@ifa.au.dk> 342004-06-20 Jesper Harder <harder@ifa.au.dk>
2 35
3 * msdog.texi (Text and Binary, MS-DOS Printing): Use m-dash. 36 * msdog.texi (Text and Binary, MS-DOS Printing): Use m-dash.
diff --git a/man/calendar.texi b/man/calendar.texi
index 3d3f84b4ba3..9e3d3cf9f41 100644
--- a/man/calendar.texi
+++ b/man/calendar.texi
@@ -1332,7 +1332,7 @@ begins with a recognizable time of day, Emacs can warn you several
1332minutes beforehand that that appointment is pending. Emacs alerts you 1332minutes beforehand that that appointment is pending. Emacs alerts you
1333to the appointment by displaying a message in your chosen format, as 1333to the appointment by displaying a message in your chosen format, as
1334specified by the variable @code{appt-display-format}. If the value 1334specified by the variable @code{appt-display-format}. If the value
1335of @code{appt-audible} is non-nil, an audible reminder is also given. 1335of @code{appt-audible} is non-@code{nil}, an audible reminder is also given.
1336 1336
1337@findex appt-activate 1337@findex appt-activate
1338 To enable appointment notification, call the function 1338 To enable appointment notification, call the function
diff --git a/man/ediff.texi b/man/ediff.texi
index b1447386b0c..954efe4e027 100644
--- a/man/ediff.texi
+++ b/man/ediff.texi
@@ -1067,7 +1067,7 @@ the only such group-level operation is the creation of a multi-file patch.
1067@vindex ediff-autostore-merges 1067@vindex ediff-autostore-merges
1068For group sessions created to merge files, Ediff can store all merges 1068For group sessions created to merge files, Ediff can store all merges
1069automatically in a directory. The user is asked to specify such directory 1069automatically in a directory. The user is asked to specify such directory
1070if the value of @code{ediff-autostore-merges} is non-nil. If the value is 1070if the value of @code{ediff-autostore-merges} is non-@code{nil}. If the value is
1071@code{nil}, nothing is done to the merge buffers---it will be the user's 1071@code{nil}, nothing is done to the merge buffers---it will be the user's
1072responsibility to save them. If the value is @code{t}, the user will be 1072responsibility to save them. If the value is @code{t}, the user will be
1073asked where to save the merge buffers in all merge jobs, even those that do 1073asked where to save the merge buffers in all merge jobs, even those that do
@@ -2338,11 +2338,11 @@ The second of the data buffers being compared.
2338@item ediff-buffer-C 2338@item ediff-buffer-C
2339In three-way comparisons, this is the third buffer being compared. 2339In three-way comparisons, this is the third buffer being compared.
2340In merging, this is the merge buffer. 2340In merging, this is the merge buffer.
2341In two-way comparison, this variable is nil. 2341In two-way comparison, this variable is @code{nil}.
2342 2342
2343@item ediff-window-A 2343@item ediff-window-A
2344The window displaying buffer A. If buffer A is not visible, this variable 2344The window displaying buffer A. If buffer A is not visible, this variable
2345is nil or it may be a dead window. 2345is @code{nil} or it may be a dead window.
2346 2346
2347@item ediff-window-B 2347@item ediff-window-B
2348The window displaying buffer B. 2348The window displaying buffer B.
@@ -2351,9 +2351,9 @@ The window displaying buffer B.
2351The window displaying buffer C, if any. 2351The window displaying buffer C, if any.
2352 2352
2353@item ediff-control-frame 2353@item ediff-control-frame
2354A dedicated frame displaying the control buffer, if it exists. 2354A dedicated frame displaying the control buffer, if it exists. It is
2355It is non-nil only if Ediff uses the multiframe display, i.e., when the 2355non-@code{nil} only if Ediff uses the multiframe display, i.e., when
2356control buffer is in its own frame. 2356the control buffer is in its own frame.
2357@end table 2357@end table
2358 2358
2359@node Credits, Index, Customization, Top 2359@node Credits, Index, Customization, Top
diff --git a/man/eshell.texi b/man/eshell.texi
index c909b6ebb46..fafc60ed186 100644
--- a/man/eshell.texi
+++ b/man/eshell.texi
@@ -846,7 +846,7 @@ At the moment, this is not supported.
846@item Error if a glob doesn't expand due to a predicate 846@item Error if a glob doesn't expand due to a predicate
847 847
848An error should be generated only if @code{eshell-error-if-no-glob} is 848An error should be generated only if @code{eshell-error-if-no-glob} is
849non-nil. 849non-@code{nil}.
850 850
851@item @samp{(+ RET SPC TAB} does not cause @code{indent-according-to-mode} to occur 851@item @samp{(+ RET SPC TAB} does not cause @code{indent-according-to-mode} to occur
852 852
diff --git a/man/eudc.texi b/man/eudc.texi
index aaf130eb489..b5ff83be14a 100644
--- a/man/eudc.texi
+++ b/man/eudc.texi
@@ -475,7 +475,7 @@ An alist specifying methods to display attribute values. Each member of
475the list is of the form @code{(@var{name} . @var{func})} where 475the list is of the form @code{(@var{name} . @var{func})} where
476@var{name} is a lowercased string naming a directory attribute 476@var{name} is a lowercased string naming a directory attribute
477(translated according to @code{eudc-user-attribute-names-alist} if 477(translated according to @code{eudc-user-attribute-names-alist} if
478@code{eudc-use-raw-directory-names} is non-nil) and @var{func} a 478@code{eudc-use-raw-directory-names} is non-@code{nil}) and @var{func} a
479function that will be passed the corresponding attribute values for 479function that will be passed the corresponding attribute values for
480display. 480display.
481@end defvar 481@end defvar
diff --git a/man/faq.texi b/man/faq.texi
index 7c13dc16e7b..fc0afd85620 100644
--- a/man/faq.texi
+++ b/man/faq.texi
@@ -2367,7 +2367,7 @@ file, will bind the sequence @kbd{C-x g} to @code{goto-line}:
2367 2367
2368Each menu title (e.g., @samp{File}, @samp{Edit}, @samp{Buffers}) 2368Each menu title (e.g., @samp{File}, @samp{Edit}, @samp{Buffers})
2369represents a local or global keymap. Selecting a menu title with the 2369represents a local or global keymap. Selecting a menu title with the
2370mouse displays that keymap's non-nil contents in the form of a menu. 2370mouse displays that keymap's non-@code{nil} contents in the form of a menu.
2371 2371
2372So to add a menu option to an existing menu, all you have to do is add a 2372So to add a menu option to an existing menu, all you have to do is add a
2373new definition to the appropriate keymap. Adding a @samp{Forward Word} 2373new definition to the appropriate keymap. Adding a @samp{Forward Word}
@@ -3173,7 +3173,7 @@ Obviously, there is a potential for Trojan horses to exploit this
3173feature. 3173feature.
3174 3174
3175Emacs 18 allowed this feature by default; users could disable it by 3175Emacs 18 allowed this feature by default; users could disable it by
3176setting the variable @code{inhibit-local-variables} to a non-nil value. 3176setting the variable @code{inhibit-local-variables} to a non-@code{nil} value.
3177 3177
3178As of Emacs 19, Emacs has a list of local variables that create a 3178As of Emacs 19, Emacs has a list of local variables that create a
3179security risk. If a file tries to set one of them, it asks the user to 3179security risk. If a file tries to set one of them, it asks the user to
diff --git a/man/flymake.texi b/man/flymake.texi
index e710b903361..c505be21b6e 100644
--- a/man/flymake.texi
+++ b/man/flymake.texi
@@ -542,7 +542,7 @@ lines in the buffer using the accumulated error information.
542 542
543Syntax check is considered possible if there's an entry in 543Syntax check is considered possible if there's an entry in
544@code{flymake-allowed-file-name-masks} matching buffer's filename and 544@code{flymake-allowed-file-name-masks} matching buffer's filename and
545its @code{init-function} returns non-nil value. 545its @code{init-function} returns non-@code{nil} value.
546 546
547Two syntax check modes are distinguished: 547Two syntax check modes are distinguished:
548 548
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/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/search.texi b/man/search.texi
index fbc8d24bf23..43d6af70cf5 100644
--- a/man/search.texi
+++ b/man/search.texi
@@ -231,18 +231,18 @@ of bindings, look at the documentation of @code{isearch-mode} with
231 231
232 Vertical scrolling during incremental search can be enabled by 232 Vertical scrolling during incremental search can be enabled by
233setting the customizable variable @code{isearch-allow-scroll} to a 233setting the customizable variable @code{isearch-allow-scroll} to a
234non-nil value. 234non-@code{nil} value.
235 235
236 You can then use the vertical scroll-bar or certain keyboard 236 You can then use the vertical scroll-bar or certain keyboard
237commands such as @kbd{@key{PRIOR}} (@code{scroll-down}), 237commands such as @kbd{@key{PRIOR}} (@code{scroll-down}),
238@kbd{@key{NEXT}} (@code{scroll-up}) and @kbd{C-l} (@code{recenter}) 238@kbd{@key{NEXT}} (@code{scroll-up}) and @kbd{C-l} (@code{recenter})
239within the search, thus letting you see more of the text near the 239within the search, thus letting you see more of the text near the
240current match. You must run these commands via their key sequences to 240current match. You must run these commands via their key sequences to
241stay in the search - typing M-x @var{comand-name} will always 241stay in the search---typing M-x @var{comand-name} will always
242terminate a search. 242terminate a search.
243 243
244 You can give prefix arguments to these commands in the usual way. 244 You can give prefix arguments to these commands in the usual way.
245The current match cannot be scrolled out of the window - this is 245The current match cannot be scrolled out of the window---this is
246intentional. 246intentional.
247 247
248 Several other commands, such as @kbd{C-x 2} 248 Several other commands, such as @kbd{C-x 2}
@@ -847,7 +847,7 @@ history matching commands (@pxref{Minibuffer History}).
847@vindex isearch-allow-scroll 847@vindex isearch-allow-scroll
848 848
849Scrolling, etc., during incremental search is enabled by setting the 849Scrolling, etc., during incremental search is enabled by setting the
850customizable variable @code{isearch-allow-scroll} to a non-nil value. 850customizable variable @code{isearch-allow-scroll} to a non-@code{nil} value.
851 851
852@c See Subject: Info file: How do I get an itemized list without blank lines? 852@c See Subject: Info file: How do I get an itemized list without blank lines?
853@c Date: Sat, 12 Apr 2003 09:45:31 +0000 in gnu.emacs.help 853@c Date: Sat, 12 Apr 2003 09:45:31 +0000 in gnu.emacs.help
@@ -893,7 +893,7 @@ For example:
893 893
894You should only thus configure commands which are ``safe'': i.e., they 894You should only thus configure commands which are ``safe'': i.e., they
895won't leave emacs in an inconsistent state when executed within a 895won't leave emacs in an inconsistent state when executed within a
896search - that is to say, the following things may be changed by a 896search---that is to say, the following things may be changed by a
897command only temporarily, and must be restored before the command 897command only temporarily, and must be restored before the command
898finishes: 898finishes:
899 899
@@ -913,7 +913,7 @@ not itself attempt an incremental search. It may, however, change the
913window's size, or create or delete other windows and frames. 913window's size, or create or delete other windows and frames.
914 914
915Note that an attempt by a command to scroll the text 915Note that an attempt by a command to scroll the text
916@emph{horizontally} won't work, although it will do no harm - any such 916@emph{horizontally} won't work, although it will do no harm---any such
917scrolling will be overriden and nullified by the display code. 917scrolling will be overriden and nullified by the display code.
918 918
919@node Replace, Other Repeating Search, Configuring Scrolling, Search 919@node Replace, Other Repeating Search, Configuring Scrolling, Search
@@ -977,9 +977,9 @@ by word boundaries. The argument's value doesn't matter.
977 What if you want to exchange @samp{x} and @samp{y}: replace every @samp{x} with a @samp{y} and vice versa? You can do it this way: 977 What if you want to exchange @samp{x} and @samp{y}: replace every @samp{x} with a @samp{y} and vice versa? You can do it this way:
978 978
979@example 979@example
980M-x query-replace @key{RET} x @key{RET} @@TEMP@@ @key{RET} 980M-x replace-string @key{RET} x @key{RET} @@TEMP@@ @key{RET}
981M-x query-replace @key{RET} y @key{RET} x @key{RET} 981M-< M-x replace-string @key{RET} y @key{RET} x @key{RET}
982M-x query-replace @key{RET} @@TEMP@@ @key{RET} y @key{RET} 982M-< M-x replace-string @key{RET} @@TEMP@@ @key{RET} y @key{RET}
983@end example 983@end example
984 984
985@noindent 985@noindent
@@ -993,13 +993,15 @@ in your text.
993single string. The similar command @kbd{M-x replace-regexp} replaces 993single string. The similar command @kbd{M-x replace-regexp} replaces
994any match for a specified pattern. 994any match for a specified pattern.
995 995
996 In @code{replace-regexp}, the @var{newstring} need not be constant: it 996 In @code{replace-regexp}, the @var{newstring} need not be constant:
997can refer to all or part of what is matched by the @var{regexp}. 997it can refer to all or part of what is matched by the @var{regexp}.
998@samp{\&} in @var{newstring} stands for the entire match being replaced. 998@samp{\&} in @var{newstring} stands for the entire match being
999@samp{\@var{d}} in @var{newstring}, where @var{d} is a digit, stands for 999replaced. @samp{\@var{d}} in @var{newstring}, where @var{d} is a
1000whatever matched the @var{d}th parenthesized grouping in @var{regexp}. 1000digit, stands for whatever matched the @var{d}th parenthesized
1001To include a @samp{\} in the text to replace with, you must enter 1001grouping in @var{regexp}. @samp{\#} refers to the count of
1002@samp{\\}. For example, 1002replacements already made in this command, as a decimal number. In
1003the first replacement, @samp{\#} stands for @samp{0}; in the second,
1004for @samp{1}; and so on. For example,
1003 1005
1004@example 1006@example
1005M-x replace-regexp @key{RET} c[ad]+r @key{RET} \&-safe @key{RET} 1007M-x replace-regexp @key{RET} c[ad]+r @key{RET} \&-safe @key{RET}
@@ -1014,7 +1016,61 @@ M-x replace-regexp @key{RET} \(c[ad]+r\)-safe @key{RET} \1 @key{RET}
1014@end example 1016@end example
1015 1017
1016@noindent 1018@noindent
1017performs the inverse transformation. 1019performs the inverse transformation. To include a @samp{\} in the
1020text to replace with, you must enter @samp{\\}.
1021
1022 You can also use Lisp expressions to calculate parts of the
1023replacement string. To do this, write @samp{\,} followed by the
1024expression in the replacement string. Each replacement calculates the
1025value of the expression, which ought to be a string, and uses it in
1026the replacement string in place of the expression itself. If the
1027expression is a symbol, one space in the replacement string after the
1028symbol name counts as part of the symbol name, so the value replaces
1029them both.
1030
1031 Inside such an expression, @samp{\&} and @samp{\@var{n}} used as
1032subexpressions refer respectively to the entire match as a string, and
1033to a submatch as a string. @var{n} may exceed 9 here, and the value
1034of @samp{\@var{n}} is @code{nil} if subexpression @var{n} did not
1035match. You can also use @samp{\#&} and @samp{\#@var{n}} refer to
1036those matches converted to numbers (this is valid when the match or
1037submatch has the form of a number). @samp{\#} stands for the number
1038of already-completed replacements.
1039
1040 Repeating our example to exchange @samp{x} and @samp{y}, we can thus
1041do it also this way:
1042
1043@example
1044M-x replace-regexp @key{RET} \(x\)\|y @key{RET}
1045\,(if \1 "y" "x") @key{RET}
1046@end example
1047
1048 The @code{format} function (@pxref{Formatting Strings,,,elisp, GNU
1049Emacs Lisp Reference Manual}) comes in handy for computing replacement
1050strings for @samp{\,}. For example, to add consecutively numbered
1051strings like @samp{ABC00042} to columns 73 @w{to 80} (unless they are
1052already occupied), you can use
1053
1054@example
1055M-x replace-regexp @key{RET} ^.\@{0,72\@}$ @key{RET}
1056\,(format "%-72sABC%05d" \& \#) @key{RET}
1057@end example
1058
1059 If you want to enter part of the replacement string by hand each
1060time, use @samp{\?} in the replacement string. Each replacement will
1061enter a recursive edit, with point at the position where the @samp{\?}
1062was. For example,
1063
1064@example
1065M-x replace-regexp @key{RET} \footnote@{ @key{RET}
1066\&\\label@{fn:\#\?@} @key{RET}
1067@end example
1068
1069@noindent
1070will add labels starting with @samp{\label@{fn:0@}} to occurences of
1071@samp{\footnote@{}, but letting you edit each replacement before
1072performing it. To number the labels starting at 1, use @samp{\,(1+
1073\#)} instead of @samp{\#}.
1018 1074
1019@node Replacement and Case, Query Replace, Regexp Replace, Replace 1075@node Replacement and Case, Query Replace, Regexp Replace, Replace
1020@subsection Replace Commands and Case 1076@subsection Replace Commands and Case
@@ -1126,9 +1182,8 @@ to replace all remaining occurrences without asking again.
1126 1182
1127@item ^ 1183@item ^
1128to go back to the position of the previous occurrence (or what used to 1184to go back to the position of the previous occurrence (or what used to
1129be an occurrence), in case you changed it by mistake. This works by 1185be an occurrence), in case you changed it by mistake or want to
1130popping the mark ring. Only one @kbd{^} in a row is meaningful, because 1186reexamine it.
1131only one previous replacement position is kept during @code{query-replace}.
1132 1187
1133@item C-r 1188@item C-r
1134to enter a recursive editing level, in case the occurrence needs to be 1189to enter a recursive editing level, in case the occurrence needs to be
diff --git a/man/ses.texi b/man/ses.texi
index 8e0086ac54b..b648f6eef9a 100644
--- a/man/ses.texi
+++ b/man/ses.texi
@@ -251,8 +251,8 @@ one-argument function (a symbol or a lambda), whose result is a string
251(right-aligned) or list of one string (left-aligned). While typing in 251(right-aligned) or list of one string (left-aligned). While typing in
252a lambda, you can use @kbd{M-TAB} to complete the names of symbols. 252a lambda, you can use @kbd{M-TAB} to complete the names of symbols.
253 253
254Each cell has a printer. If nil, the column-printer for the cell's 254Each cell has a printer. If @code{nil}, the column-printer for the cell's
255column is used. If that is also nil, the default-printer for the 255column is used. If that is also @code{nil}, the default-printer for the
256spreadsheet is used. 256spreadsheet is used.
257 257
258@table @kbd 258@table @kbd
@@ -273,7 +273,7 @@ spreadsheet, plus the standard printers.
273 273
274The standard printers are suitable only for cells, not columns or 274The standard printers are suitable only for cells, not columns or
275default, because they format the value using the column-printer (or 275default, because they format the value using the column-printer (or
276default-printer if nil) and then center the result: 276default-printer if @code{nil}) and then center the result:
277 277
278@table @code 278@table @code
279@item ses-center 279@item ses-center
@@ -296,7 +296,7 @@ Centering with tildes (~) and spill-over.
296@node Clearing cells, Copy/cut/paste, Printer functions, The Basics 296@node Clearing cells, Copy/cut/paste, Printer functions, The Basics
297@section Clearing cells 297@section Clearing cells
298 298
299These commands set both formula and printer to nil: 299These commands set both formula and printer to @code{nil}:
300 300
301@table @kbd 301@table @kbd
302@item DEL 302@item DEL
@@ -331,7 +331,7 @@ Mark a region and copy it to kill ring and secondary clipboard
331@item C-w 331@item C-w
332@itemx [cut] 332@itemx [cut]
333@itemx [S-delete] 333@itemx [S-delete]
334The cut functions do not actually delete rows or columns - they copy 334The cut functions do not actually delete rows or columns---they copy
335and then clear (@code{ses-kill-override}). 335and then clear (@code{ses-kill-override}).
336 336
337@item C-y 337@item C-y
@@ -537,7 +537,7 @@ are some useful functions to call from your formulas:
537 537
538@table @code 538@table @code
539@item (ses-delete-blanks &rest @var{args}) 539@item (ses-delete-blanks &rest @var{args})
540Returns a list from which all blank cells (value is either nil or 540Returns a list from which all blank cells (value is either @code{nil} or
541'*skip*) have been deleted. 541'*skip*) have been deleted.
542 542
543@item (ses+ &rest @var{args}) 543@item (ses+ &rest @var{args})
@@ -561,10 +561,10 @@ producing a value: the print cell is filled with hash marks (#).
561@end itemize 561@end itemize
562 562
563If the result from the printer function is too wide for the cell and 563If the result from the printer function is too wide for the cell and
564the following cell is nil, the result will spill over into the 564the following cell is @code{nil}, the result will spill over into the
565following cell. Very wide results can spill over several cells. If 565following cell. Very wide results can spill over several cells. If
566the result is too wide for the available space (up to the end of the 566the result is too wide for the available space (up to the end of the
567row or the next non-nil cell), the result is truncated if the cell's 567row or the next non-@code{nil} cell), the result is truncated if the cell's
568value is a string, or replaced with hash marks otherwise. 568value is a string, or replaced with hash marks otherwise.
569 569
570SES could get confused by printer results that contain newlines or 570SES could get confused by printer results that contain newlines or
diff --git a/man/trampver.texi b/man/trampver.texi
index 4ffc14a48c2..a62583fd6d4 100644
--- a/man/trampver.texi
+++ b/man/trampver.texi
@@ -4,7 +4,7 @@
4@c In the Tramp CVS, the version number is auto-frobbed from 4@c In the Tramp CVS, the version number is auto-frobbed from
5@c configure.ac, so you should edit that file and run 5@c configure.ac, so you should edit that file and run
6@c "autoconf && ./configure" to change the version number. 6@c "autoconf && ./configure" to change the version number.
7@set trampver 2.0.41 7@set trampver 2.0.42
8 8
9@c Other flags from configuration 9@c Other flags from configuration
10@set prefix /usr/local 10@set prefix /usr/local
diff --git a/man/viper.texi b/man/viper.texi
index 5d4329730dc..654f6c9355f 100644
--- a/man/viper.texi
+++ b/man/viper.texi
@@ -1312,7 +1312,7 @@ These two keys invoke many important Emacs functions. For example, if you
1312hit @kbd{C-x} followed by @kbd{2}, then the current window will be split 1312hit @kbd{C-x} followed by @kbd{2}, then the current window will be split
1313into 2. Except for novice users, @kbd{C-c} is also set to execute an Emacs 1313into 2. Except for novice users, @kbd{C-c} is also set to execute an Emacs
1314command from the current major mode. @key{ESC} will do the same, if you 1314command from the current major mode. @key{ESC} will do the same, if you
1315configure @key{ESC} as Meta by setting @code{viper-no-multiple-ESC} to nil 1315configure @key{ESC} as Meta by setting @code{viper-no-multiple-ESC} to @code{nil}
1316in @file{.viper}. @xref{Customization}. @kbd{C-\} in Insert, Replace, or Vi 1316in @file{.viper}. @xref{Customization}. @kbd{C-\} in Insert, Replace, or Vi
1317states will make Emacs think @kbd{Meta} has been hit.@refill 1317states will make Emacs think @kbd{Meta} has been hit.@refill
1318@item \ 1318@item \
@@ -1742,7 +1742,7 @@ executed. Otherwise, it is processed as an ordinary sequence of typed keys.
1742 1742
1743Setting this variable too high may slow down your typing. Setting it too 1743Setting this variable too high may slow down your typing. Setting it too
1744low may make it hard to type macros quickly enough. 1744low may make it hard to type macros quickly enough.
1745@item viper-translate-all-ESC-keysequences t on tty, nil on windowing display 1745@item viper-translate-all-ESC-keysequences @code{t} on tty, @code{nil} on windowing display
1746Normally, Viper lets Emacs translate only those ESC key sequences that are 1746Normally, Viper lets Emacs translate only those ESC key sequences that are
1747defined in the low-level key-translation-map or function-key-map, such as those 1747defined in the low-level key-translation-map or function-key-map, such as those
1748emitted by the arrow and function keys. Other sequences, e.g., @kbd{\\e/}, are 1748emitted by the arrow and function keys. Other sequences, e.g., @kbd{\\e/}, are
@@ -1753,7 +1753,7 @@ The default is to translate all sequences only when using a dumb terminal.
1753This permits you to use @kbd{ESC} as a meta key in insert mode. For instance, 1753This permits you to use @kbd{ESC} as a meta key in insert mode. For instance,
1754hitting @kbd{ESC x} fast would have the effect of typing @kbd{M-x}. 1754hitting @kbd{ESC x} fast would have the effect of typing @kbd{M-x}.
1755If your dumb terminal is not so dumb and understands the meta key, then you 1755If your dumb terminal is not so dumb and understands the meta key, then you
1756probably will be better off setting this variable to nil. Try and see which 1756probably will be better off setting this variable to @code{nil}. Try and see which
1757way suits you best. 1757way suits you best.
1758@item viper-ex-style-motion t 1758@item viper-ex-style-motion t
1759Set this to @code{nil}, if you want @kbd{l,h} to cross 1759Set this to @code{nil}, if you want @kbd{l,h} to cross
@@ -1764,8 +1764,8 @@ Set this to @code{nil}, if you want
1764at the beginning of a line in Insert state, @key{X} and @key{x} to delete 1764at the beginning of a line in Insert state, @key{X} and @key{x} to delete
1765characters across lines in Vi command state, etc. 1765characters across lines in Vi command state, etc.
1766@item viper-ESC-moves-cursor-back t 1766@item viper-ESC-moves-cursor-back t
1767It t, cursor moves back 1 character when switching from insert state to vi 1767It @code{t}, cursor moves back 1 character when switching from insert state to vi
1768state. If nil, the cursor stays where it was before the switch. 1768state. If @code{nil}, the cursor stays where it was before the switch.
1769@item viper-always t 1769@item viper-always t
1770@code{t} means: leave it to Viper to decide when a buffer must be brought 1770@code{t} means: leave it to Viper to decide when a buffer must be brought
1771up in Vi state, 1771up in Vi state,
@@ -1873,17 +1873,17 @@ If set to a valid color, this will be the cursor color when Viper is in
1873insert state. 1873insert state.
1874@item viper-replace-region-end-delimiter "$" 1874@item viper-replace-region-end-delimiter "$"
1875A string used to mark the end of replacement regions. It is used only on 1875A string used to mark the end of replacement regions. It is used only on
1876TTYs or if @code{viper-use-replace-region-delimiters} is non-nil. 1876TTYs or if @code{viper-use-replace-region-delimiters} is non-@code{nil}.
1877@item viper-replace-region-start-delimiter "" 1877@item viper-replace-region-start-delimiter ""
1878A string used to mark the beginning of replacement regions. It is used 1878A string used to mark the beginning of replacement regions. It is used
1879only on TTYs or if @code{viper-use-replace-region-delimiters} is non-nil. 1879only on TTYs or if @code{viper-use-replace-region-delimiters} is non-@code{nil}.
1880@item viper-use-replace-region-delimiters 1880@item viper-use-replace-region-delimiters
1881If non-nil, Viper will always use @code{viper-replace-region-end-delimiter} and 1881If non-@code{nil}, Viper will always use @code{viper-replace-region-end-delimiter} and
1882@code{viper-replace-region-start-delimiter} to delimit replacement regions, 1882@code{viper-replace-region-start-delimiter} to delimit replacement regions,
1883even on color displays (where this is unnecessary). By default, this 1883even on color displays (where this is unnecessary). By default, this
1884variable is non-nil only on TTYs or monochrome displays. 1884variable is non-@code{nil} only on TTYs or monochrome displays.
1885@item viper-allow-multiline-replace-regions t 1885@item viper-allow-multiline-replace-regions t
1886If non-nil, multi-line text replacement regions, such as those produced by 1886If non-@code{nil}, multi-line text replacement regions, such as those produced by
1887commands @kbd{c55w}, @kbd{3C}, etc., will stay around until the user exits 1887commands @kbd{c55w}, @kbd{3C}, etc., will stay around until the user exits
1888the replacement mode. In this variable is set to @code{nil}, Viper will 1888the replacement mode. In this variable is set to @code{nil}, Viper will
1889emulate the standard Vi behavior, which supports only intra-line 1889emulate the standard Vi behavior, which supports only intra-line
@@ -2390,7 +2390,7 @@ can unbind `/' and `:' in @code{viper-dired-modifier-map} (for Dired) or in
2390 2390
2391To unbind the macros `//' and `///' for a major mode where you feel they 2391To unbind the macros `//' and `///' for a major mode where you feel they
2392are undesirable, execute @code{viper-set-emacs-state-searchstyle-macros} with a 2392are undesirable, execute @code{viper-set-emacs-state-searchstyle-macros} with a
2393non-nil argument. This can be done either interactively, by supplying a 2393non-@code{nil} argument. This can be done either interactively, by supplying a
2394prefix argument, or by placing 2394prefix argument, or by placing
2395@example 2395@example
2396(viper-set-emacs-state-searchstyle-macros 'undefine) 2396(viper-set-emacs-state-searchstyle-macros 'undefine)
@@ -3360,7 +3360,7 @@ this function.
3360Find the next bracket/parenthesis/brace and go to its match. 3360Find the next bracket/parenthesis/brace and go to its match.
3361By default, Viper ignores brackets/parentheses/braces that occur inside 3361By default, Viper ignores brackets/parentheses/braces that occur inside
3362parentheses. You can change this by setting 3362parentheses. You can change this by setting
3363@code{viper-parse-sexp-ignore-comments} to nil in your @file{.viper} file. 3363@code{viper-parse-sexp-ignore-comments} to @code{nil} in your @file{.viper} file.
3364This option can also be toggled interactively if you quickly hit @kbd{%%%}. 3364This option can also be toggled interactively if you quickly hit @kbd{%%%}.
3365 3365
3366This latter feature is implemented as a vi-style keyboard macro. If you 3366This latter feature is implemented as a vi-style keyboard macro. If you
diff --git a/src/ChangeLog b/src/ChangeLog
index 00822d9d277..60b8d5da63d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,131 @@
12004-06-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * macterm.c (do_window_activate, do_window_deactivate): Remove.
4 (XTread_socket): Send mouse button events to the toolbox
5 dispatcher even when the mouse is grabbed. Don't process window
6 activate events for non-Emacs windows. Replace function calls to
7 do_window_activate and do_window_deactivate with their contents.
8 Reset mouse grabbing status when a window is deactivated.
9
102004-06-29 Steven Tamm <steventamm@mac.com>
11
12 * macterm.c (mac_get_emulated_btn)
13 (mac_event_to_emacs_modifiers): Fix emulated mouse button
14 support to correctly mask out modifiers.
15
162004-06-29 David Kastrup <dak@gnu.org>
17
18 * search.c (Fset_match_data): Allow buffer before end of list
19 which can happen if set-match-data is using a pre-consed list.
20
212004-06-28 Steven Tamm <steventamm@mac.com>
22
23 * macterm.c (XTread_socket): Correctly set the frame position
24 after the window is moved.
25
262004-06-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
27
28 * gtkutil.c (xg_get_image_for_pixmap): Call g_object_unref on
29 gpix and gmask just before return to avoid memory leak.
30 (xg_get_image_for_pixmap): Add workaround for monochrome displays
31 so insensitive and activated icons look ok.
32
332004-06-27 Jason Rumney <jasonr@gnu.org>
34
35 * w32fns.c (file_dialog_callback): Disable edit control if set
36 to directories only on CDN_INITDONE message.
37 (Fx_file_dialog): Default to directories only when prompt starts
38 with "Dired".
39
402004-06-25 Kim F. Storm <storm@cua.dk>
41
42 * alloc.c (allocate_misc): Update total_free_markers.
43 (free_misc): New function.
44 (safe_alloca_unwind, free_marker): Use it.
45
46 * lisp.h (free_misc): Add prototype.
47
48 * fns.c (Fmapconcat, Fmapcar): Remove superfluous GCPROs.
49
502004-06-24 Richard M. Stallman <rms@gnu.org>
51
52 * emacs.c (Vsignal_USR1_hook, Vsignal_USR2_hook): Definitions deleted.
53 (syms_of_emacs): Lisp variables deleted.
54
552004-06-23 David Kastrup <dak@gnu.org>
56
57 * search.c (Freplace_match): Adjust the match-data more thoroughly
58 when replacing strings in the buffer.
59 (Fmatch_data): When INTEGERS is non-nil and the last match was in
60 a buffer, add the buffer as last element to the match data.
61 (Fset_match_data): If an additional element of the match-data is a
62 buffer, restore it to last_thing_searched.
63 (save_search_regs): Save last_thing_searched as part of the match
64 data.
65 (restore_match_data): Restore it again.
66
672004-06-23 Luc Teirlinck <teirllm@auburn.edu>
68
69 * keymap.c (Ftext_char_description): Doc fix.
70 * doc.c (Fsnarf_documentation): Doc fix.
71
722004-06-22 Kim F. Storm <storm@cua.dk>
73
74 * fns.c (Fmapcar, Fmapconcat): GCPRO the args array.
75
76 * lisp.h (struct Lisp_Save_Value): New member dogc.
77 (SAFE_ALLOCA_LISP): Change second arg to number of elements.
78 Set dogc member in Lisp_Save_Value object so it will be GC'ed.
79 (SAFE_FREE_LISP): New macro.
80
81 * alloc.c (safe_alloca_unwind): Clear dogc and pointer members.
82 (make_save_value): Init new dogc member.
83 (mark_object): Mark Lisp_Save_Value pointer array if dogc is set.
84
85 * fns.c (Fmapconcat, Fmapcar): Use new SAFE_ALLOCA_LISP and
86 SAFE_FREE_LISP macros.
87
882004-06-22 Kim F. Storm <storm@cua.dk>
89
90 * lisp.h (SAFE_ALLOCA_LISP): New macro to allocate Lisp_Objects.
91 Temporarily inhibits GC if memory is xmalloc'ed, as the Lisp_Objects
92 in that memory area are unknown to GC. Add comments.
93
94 * fns.c (Fmapconcat, Fmapcar): Use SAFE_ALLOCA_LISP.
95
962004-06-21 Kim F. Storm <storm@cua.dk>
97
98 * lisp.h (MAX_ALLOCA): Define here.
99 (safe_alloca_unwind): Add prototype.
100 (USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE): New macros.
101
102 * alloc.c (safe_alloca_unwind): New function.
103
104 * casefiddle.c (casify_object): Use SAFE_ALLOCA.
105
106 * charset.c (Fstring): Use SAFE_ALLOCA.
107
108 * coding.c (MAX_ALLOCA): Remove define.
109
110 * data.c (MAX_ALLOCA): Remove define.
111 (Faset): Use SAFE_ALLOCA.
112
113 * editfns.c (Fformat, Ftranspose_regions): Use SAFE_ALLOCA.
114
115 * fns.c (string_make_multibyte, string_to_multibyte)
116 (string_make_unibyte, Fmapconcat, Fmapcar): Use SAFE_ALLOCA.
117 (MAX_ALLOCA): Remove define.
118 (Fbase64_encode_region, Fbase64_encode_string)
119 (Fbase64_decode_region, Fbase64_decode_string): Use SAFE_ALLOCA.
120 (Fbase64_encode_region, Fbase64_encode_string): Fix potential
121 memory leak if encoding fails.
122
123 * xdisp.c (add_to_log): Use SAFE_ALLOCA.
124
1252004-06-21 Eli Zaretskii <eliz@gnu.org>
126
127 * print.c (Fwith_output_to_temp_buffer): Doc fix.
128
12004-06-20 Richard M. Stallman <rms@gnu.org> 1292004-06-20 Richard M. Stallman <rms@gnu.org>
2 130
3 * xfaces.c (Finternal_copy_lisp_face): Small cleanup; doc fix. 131 * xfaces.c (Finternal_copy_lisp_face): Small cleanup; doc fix.
diff --git a/src/alloc.c b/src/alloc.c
index ea7886dd4dc..994dc21079f 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -579,6 +579,22 @@ xstrdup (s)
579} 579}
580 580
581 581
582/* Unwind for SAFE_ALLOCA */
583
584Lisp_Object
585safe_alloca_unwind (arg)
586 Lisp_Object arg;
587{
588 register struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
589
590 p->dogc = 0;
591 xfree (p->pointer);
592 p->pointer = 0;
593 free_misc (arg);
594 return Qnil;
595}
596
597
582/* Like malloc but used for allocating Lisp data. NBYTES is the 598/* Like malloc but used for allocating Lisp data. NBYTES is the
583 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
584 allcated memory block (for strings, for conses, ...). */ 600 allcated memory block (for strings, for conses, ...). */
@@ -2863,17 +2879,32 @@ allocate_misc ()
2863 marker_block = new; 2879 marker_block = new;
2864 marker_block_index = 0; 2880 marker_block_index = 0;
2865 n_marker_blocks++; 2881 n_marker_blocks++;
2882 total_free_markers += MARKER_BLOCK_SIZE;
2866 } 2883 }
2867 XSETMISC (val, &marker_block->markers[marker_block_index]); 2884 XSETMISC (val, &marker_block->markers[marker_block_index]);
2868 marker_block_index++; 2885 marker_block_index++;
2869 } 2886 }
2870 2887
2888 --total_free_markers;
2871 consing_since_gc += sizeof (union Lisp_Misc); 2889 consing_since_gc += sizeof (union Lisp_Misc);
2872 misc_objects_consed++; 2890 misc_objects_consed++;
2873 XMARKER (val)->gcmarkbit = 0; 2891 XMARKER (val)->gcmarkbit = 0;
2874 return val; 2892 return val;
2875} 2893}
2876 2894
2895/* Free a Lisp_Misc object */
2896
2897void
2898free_misc (misc)
2899 Lisp_Object misc;
2900{
2901 XMISC (misc)->u_marker.type = Lisp_Misc_Free;
2902 XMISC (misc)->u_free.chain = marker_free_list;
2903 marker_free_list = XMISC (misc);
2904
2905 total_free_markers++;
2906}
2907
2877/* Return a Lisp_Misc_Save_Value object containing POINTER and 2908/* Return a Lisp_Misc_Save_Value object containing POINTER and
2878 INTEGER. This is used to package C values to call record_unwind_protect. 2909 INTEGER. This is used to package C values to call record_unwind_protect.
2879 The unwind function can get the C values back using XSAVE_VALUE. */ 2910 The unwind function can get the C values back using XSAVE_VALUE. */
@@ -2891,6 +2922,7 @@ make_save_value (pointer, integer)
2891 p = XSAVE_VALUE (val); 2922 p = XSAVE_VALUE (val);
2892 p->pointer = pointer; 2923 p->pointer = pointer;
2893 p->integer = integer; 2924 p->integer = integer;
2925 p->dogc = 0;
2894 return val; 2926 return val;
2895} 2927}
2896 2928
@@ -2919,12 +2951,7 @@ free_marker (marker)
2919 Lisp_Object marker; 2951 Lisp_Object marker;
2920{ 2952{
2921 unchain_marker (XMARKER (marker)); 2953 unchain_marker (XMARKER (marker));
2922 2954 free_misc (marker);
2923 XMISC (marker)->u_marker.type = Lisp_Misc_Free;
2924 XMISC (marker)->u_free.chain = marker_free_list;
2925 marker_free_list = XMISC (marker);
2926
2927 total_free_markers++;
2928} 2955}
2929 2956
2930 2957
@@ -4924,6 +4951,7 @@ mark_object (arg)
4924 if (XMARKER (obj)->gcmarkbit) 4951 if (XMARKER (obj)->gcmarkbit)
4925 break; 4952 break;
4926 XMARKER (obj)->gcmarkbit = 1; 4953 XMARKER (obj)->gcmarkbit = 1;
4954
4927 switch (XMISCTYPE (obj)) 4955 switch (XMISCTYPE (obj))
4928 { 4956 {
4929 case Lisp_Misc_Buffer_Local_Value: 4957 case Lisp_Misc_Buffer_Local_Value:
@@ -4948,6 +4976,8 @@ mark_object (arg)
4948 /* DO NOT mark thru the marker's chain. 4976 /* DO NOT mark thru the marker's chain.
4949 The buffer's markers chain does not preserve markers from gc; 4977 The buffer's markers chain does not preserve markers from gc;
4950 instead, markers are removed from the chain when freed by gc. */ 4978 instead, markers are removed from the chain when freed by gc. */
4979 break;
4980
4951 case Lisp_Misc_Intfwd: 4981 case Lisp_Misc_Intfwd:
4952 case Lisp_Misc_Boolfwd: 4982 case Lisp_Misc_Boolfwd:
4953 case Lisp_Misc_Objfwd: 4983 case Lisp_Misc_Objfwd:
@@ -4957,7 +4987,21 @@ mark_object (arg)
4957 since all markable slots in current buffer marked anyway. */ 4987 since all markable slots in current buffer marked anyway. */
4958 /* Don't need to do Lisp_Objfwd, since the places they point 4988 /* Don't need to do Lisp_Objfwd, since the places they point
4959 are protected with staticpro. */ 4989 are protected with staticpro. */
4990 break;
4991
4960 case Lisp_Misc_Save_Value: 4992 case Lisp_Misc_Save_Value:
4993 {
4994 register struct Lisp_Save_Value *ptr = XSAVE_VALUE (obj);
4995 /* If DOGC is set, POINTER is the address of a memory
4996 area containing INTEGER potential Lisp_Objects. */
4997 if (ptr->dogc)
4998 {
4999 Lisp_Object *p = (Lisp_Object *) ptr->pointer;
5000 int nelt;
5001 for (nelt = ptr->integer; nelt > 0; nelt--, p++)
5002 mark_maybe_object (*p);
5003 }
5004 }
4961 break; 5005 break;
4962 5006
4963 case Lisp_Misc_Overlay: 5007 case Lisp_Misc_Overlay:
diff --git a/src/data.c b/src/data.c
index 935c4348bb7..1071107947c 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1983,11 +1983,6 @@ or a byte-code object. IDX starts at 0. */)
1983 } 1983 }
1984} 1984}
1985 1985
1986/* Don't use alloca for relocating string data larger than this, lest
1987 we overflow their stack. The value is the same as what used in
1988 fns.c for base64 handling. */
1989#define MAX_ALLOCA 16*1024
1990
1991DEFUN ("aset", Faset, Saset, 3, 3, 0, 1986DEFUN ("aset", Faset, Saset, 3, 3, 0,
1992 doc: /* Store into the element of ARRAY at index IDX the value NEWELT. 1987 doc: /* Store into the element of ARRAY at index IDX the value NEWELT.
1993Return NEWELT. ARRAY may be a vector, a string, a char-table or a 1988Return NEWELT. ARRAY may be a vector, a string, a char-table or a
@@ -2051,10 +2046,9 @@ bool-vector. IDX starts at 0. */)
2051 /* We must relocate the string data. */ 2046 /* We must relocate the string data. */
2052 int nchars = SCHARS (array); 2047 int nchars = SCHARS (array);
2053 unsigned char *str; 2048 unsigned char *str;
2049 USE_SAFE_ALLOCA;
2054 2050
2055 str = (nbytes <= MAX_ALLOCA 2051 SAFE_ALLOCA (str, unsigned char *, nbytes);
2056 ? (unsigned char *) alloca (nbytes)
2057 : (unsigned char *) xmalloc (nbytes));
2058 bcopy (SDATA (array), str, nbytes); 2052 bcopy (SDATA (array), str, nbytes);
2059 allocate_string_data (XSTRING (array), nchars, 2053 allocate_string_data (XSTRING (array), nchars,
2060 nbytes + new_bytes - prev_bytes); 2054 nbytes + new_bytes - prev_bytes);
@@ -2062,8 +2056,7 @@ bool-vector. IDX starts at 0. */)
2062 p1 = SDATA (array) + idxval_byte; 2056 p1 = SDATA (array) + idxval_byte;
2063 bcopy (str + idxval_byte + prev_bytes, p1 + new_bytes, 2057 bcopy (str + idxval_byte + prev_bytes, p1 + new_bytes,
2064 nbytes - (idxval_byte + prev_bytes)); 2058 nbytes - (idxval_byte + prev_bytes));
2065 if (nbytes > MAX_ALLOCA) 2059 SAFE_FREE (nbytes);
2066 xfree (str);
2067 clear_string_char_byte_cache (); 2060 clear_string_char_byte_cache ();
2068 } 2061 }
2069 while (new_bytes--) 2062 while (new_bytes--)
@@ -2086,14 +2079,13 @@ bool-vector. IDX starts at 0. */)
2086 unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1; 2079 unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1;
2087 unsigned char *origstr = SDATA (array), *str; 2080 unsigned char *origstr = SDATA (array), *str;
2088 int nchars, nbytes; 2081 int nchars, nbytes;
2082 USE_SAFE_ALLOCA;
2089 2083
2090 nchars = SCHARS (array); 2084 nchars = SCHARS (array);
2091 nbytes = idxval_byte = count_size_as_multibyte (origstr, idxval); 2085 nbytes = idxval_byte = count_size_as_multibyte (origstr, idxval);
2092 nbytes += count_size_as_multibyte (origstr + idxval, 2086 nbytes += count_size_as_multibyte (origstr + idxval,
2093 nchars - idxval); 2087 nchars - idxval);
2094 str = (nbytes <= MAX_ALLOCA 2088 SAFE_ALLOCA (str, unsigned char *, nbytes);
2095 ? (unsigned char *) alloca (nbytes)
2096 : (unsigned char *) xmalloc (nbytes));
2097 copy_text (SDATA (array), str, nchars, 0, 1); 2089 copy_text (SDATA (array), str, nchars, 0, 1);
2098 PARSE_MULTIBYTE_SEQ (str + idxval_byte, nbytes - idxval_byte, 2090 PARSE_MULTIBYTE_SEQ (str + idxval_byte, nbytes - idxval_byte,
2099 prev_bytes); 2091 prev_bytes);
@@ -2106,8 +2098,7 @@ bool-vector. IDX starts at 0. */)
2106 *p1++ = *p0++; 2098 *p1++ = *p0++;
2107 bcopy (str + idxval_byte + prev_bytes, p1, 2099 bcopy (str + idxval_byte + prev_bytes, p1,
2108 nbytes - (idxval_byte + prev_bytes)); 2100 nbytes - (idxval_byte + prev_bytes));
2109 if (nbytes > MAX_ALLOCA) 2101 SAFE_FREE (nbytes);
2110 xfree (str);
2111 clear_string_char_byte_cache (); 2102 clear_string_char_byte_cache ();
2112 } 2103 }
2113 } 2104 }
diff --git a/src/doc.c b/src/doc.c
index 2e66c5cea46..8c116210cda 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 130dffa77de..9928beff678 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3381,6 +3381,7 @@ usage: (format STRING &rest OBJECTS) */)
3381 int longest_format; 3381 int longest_format;
3382 Lisp_Object val; 3382 Lisp_Object val;
3383 int arg_intervals = 0; 3383 int arg_intervals = 0;
3384 USE_SAFE_ALLOCA;
3384 3385
3385 /* discarded[I] is 1 if byte I of the format 3386 /* discarded[I] is 1 if byte I of the format
3386 string was not copied into the output. 3387 string was not copied into the output.
@@ -3429,7 +3430,7 @@ usage: (format STRING &rest OBJECTS) */)
3429 longest_format = 0; 3430 longest_format = 0;
3430 3431
3431 /* Make room in result for all the non-%-codes in the control string. */ 3432 /* Make room in result for all the non-%-codes in the control string. */
3432 total = 5 + CONVERTED_BYTE_SIZE (multibyte, args[0]); 3433 total = 5 + CONVERTED_BYTE_SIZE (multibyte, args[0]) + 1;
3433 3434
3434 /* Allocate the info and discarded tables. */ 3435 /* Allocate the info and discarded tables. */
3435 { 3436 {
@@ -3622,10 +3623,7 @@ usage: (format STRING &rest OBJECTS) */)
3622 3623
3623 /* Allocate the space for the result. 3624 /* Allocate the space for the result.
3624 Note that TOTAL is an overestimate. */ 3625 Note that TOTAL is an overestimate. */
3625 if (total < 1000) 3626 SAFE_ALLOCA (buf, char *, total);
3626 buf = (char *) alloca (total + 1);
3627 else
3628 buf = (char *) xmalloc (total + 1);
3629 3627
3630 p = buf; 3628 p = buf;
3631 nchars = 0; 3629 nchars = 0;
@@ -3758,7 +3756,7 @@ usage: (format STRING &rest OBJECTS) */)
3758 maybe_combine_byte = 1; 3756 maybe_combine_byte = 1;
3759 this_nchars = strlen (p); 3757 this_nchars = strlen (p);
3760 if (multibyte) 3758 if (multibyte)
3761 p += str_to_multibyte (p, buf + total - p, this_nchars); 3759 p += str_to_multibyte (p, buf + total - 1 - p, this_nchars);
3762 else 3760 else
3763 p += this_nchars; 3761 p += this_nchars;
3764 nchars += this_nchars; 3762 nchars += this_nchars;
@@ -3795,7 +3793,7 @@ usage: (format STRING &rest OBJECTS) */)
3795 *p++ = *format++, nchars++; 3793 *p++ = *format++, nchars++;
3796 } 3794 }
3797 3795
3798 if (p > buf + total + 1) 3796 if (p > buf + total)
3799 abort (); 3797 abort ();
3800 3798
3801 if (maybe_combine_byte) 3799 if (maybe_combine_byte)
@@ -3803,8 +3801,7 @@ usage: (format STRING &rest OBJECTS) */)
3803 val = make_specified_string (buf, nchars, p - buf, multibyte); 3801 val = make_specified_string (buf, nchars, p - buf, multibyte);
3804 3802
3805 /* If we allocated BUF with malloc, free it too. */ 3803 /* If we allocated BUF with malloc, free it too. */
3806 if (total >= 1000) 3804 SAFE_FREE (total);
3807 xfree (buf);
3808 3805
3809 /* If the format string has text properties, or any of the string 3806 /* If the format string has text properties, or any of the string
3810 arguments has text properties, set up text properties of the 3807 arguments has text properties, set up text properties of the
@@ -4173,12 +4170,9 @@ Transposing beyond buffer boundaries is an error. */)
4173 /* First region smaller than second. */ 4170 /* First region smaller than second. */
4174 if (len1_byte < len2_byte) 4171 if (len1_byte < len2_byte)
4175 { 4172 {
4176 /* We use alloca only if it is small, 4173 USE_SAFE_ALLOCA;
4177 because we want to avoid stack overflow. */ 4174
4178 if (len2_byte > 20000) 4175 SAFE_ALLOCA (temp, unsigned char *, len2_byte);
4179 temp = (unsigned char *) xmalloc (len2_byte);
4180 else
4181 temp = (unsigned char *) alloca (len2_byte);
4182 4176
4183 /* Don't precompute these addresses. We have to compute them 4177 /* Don't precompute these addresses. We have to compute them
4184 at the last minute, because the relocating allocator might 4178 at the last minute, because the relocating allocator might
@@ -4189,23 +4183,20 @@ Transposing beyond buffer boundaries is an error. */)
4189 bcopy (start2_addr, temp, len2_byte); 4183 bcopy (start2_addr, temp, len2_byte);
4190 bcopy (start1_addr, start1_addr + len2_byte, len1_byte); 4184 bcopy (start1_addr, start1_addr + len2_byte, len1_byte);
4191 bcopy (temp, start1_addr, len2_byte); 4185 bcopy (temp, start1_addr, len2_byte);
4192 if (len2_byte > 20000) 4186 SAFE_FREE (len2_byte);
4193 xfree (temp);
4194 } 4187 }
4195 else 4188 else
4196 /* First region not smaller than second. */ 4189 /* First region not smaller than second. */
4197 { 4190 {
4198 if (len1_byte > 20000) 4191 USE_SAFE_ALLOCA;
4199 temp = (unsigned char *) xmalloc (len1_byte); 4192
4200 else 4193 SAFE_ALLOCA (temp, unsigned char *, len1_byte);
4201 temp = (unsigned char *) alloca (len1_byte);
4202 start1_addr = BYTE_POS_ADDR (start1_byte); 4194 start1_addr = BYTE_POS_ADDR (start1_byte);
4203 start2_addr = BYTE_POS_ADDR (start2_byte); 4195 start2_addr = BYTE_POS_ADDR (start2_byte);
4204 bcopy (start1_addr, temp, len1_byte); 4196 bcopy (start1_addr, temp, len1_byte);
4205 bcopy (start2_addr, start1_addr, len2_byte); 4197 bcopy (start2_addr, start1_addr, len2_byte);
4206 bcopy (temp, start1_addr + len2_byte, len1_byte); 4198 bcopy (temp, start1_addr + len2_byte, len1_byte);
4207 if (len1_byte > 20000) 4199 SAFE_FREE (len1_byte);
4208 xfree (temp);
4209 } 4200 }
4210 graft_intervals_into_buffer (tmp_interval1, start1 + len2, 4201 graft_intervals_into_buffer (tmp_interval1, start1 + len2,
4211 len1, current_buffer, 0); 4202 len1, current_buffer, 0);
@@ -4222,6 +4213,8 @@ Transposing beyond buffer boundaries is an error. */)
4222 if (len1_byte == len2_byte) 4213 if (len1_byte == len2_byte)
4223 /* Regions are same size, though, how nice. */ 4214 /* Regions are same size, though, how nice. */
4224 { 4215 {
4216 USE_SAFE_ALLOCA;
4217
4225 modify_region (current_buffer, start1, end1); 4218 modify_region (current_buffer, start1, end1);
4226 modify_region (current_buffer, start2, end2); 4219 modify_region (current_buffer, start2, end2);
4227 record_change (start1, len1); 4220 record_change (start1, len1);
@@ -4233,17 +4226,14 @@ Transposing beyond buffer boundaries is an error. */)
4233 Fset_text_properties (make_number (start2), make_number (end2), 4226 Fset_text_properties (make_number (start2), make_number (end2),
4234 Qnil, Qnil); 4227 Qnil, Qnil);
4235 4228
4236 if (len1_byte > 20000) 4229 SAFE_ALLOCA (temp, unsigned char *, len1_byte);
4237 temp = (unsigned char *) xmalloc (len1_byte);
4238 else
4239 temp = (unsigned char *) alloca (len1_byte);
4240 start1_addr = BYTE_POS_ADDR (start1_byte); 4230 start1_addr = BYTE_POS_ADDR (start1_byte);
4241 start2_addr = BYTE_POS_ADDR (start2_byte); 4231 start2_addr = BYTE_POS_ADDR (start2_byte);
4242 bcopy (start1_addr, temp, len1_byte); 4232 bcopy (start1_addr, temp, len1_byte);
4243 bcopy (start2_addr, start1_addr, len2_byte); 4233 bcopy (start2_addr, start1_addr, len2_byte);
4244 bcopy (temp, start2_addr, len1_byte); 4234 bcopy (temp, start2_addr, len1_byte);
4245 if (len1_byte > 20000) 4235 SAFE_FREE (len1_byte);
4246 xfree (temp); 4236
4247 graft_intervals_into_buffer (tmp_interval1, start2, 4237 graft_intervals_into_buffer (tmp_interval1, start2,
4248 len1, current_buffer, 0); 4238 len1, current_buffer, 0);
4249 graft_intervals_into_buffer (tmp_interval2, start1, 4239 graft_intervals_into_buffer (tmp_interval2, start1,
@@ -4253,6 +4243,8 @@ Transposing beyond buffer boundaries is an error. */)
4253 else if (len1_byte < len2_byte) /* Second region larger than first */ 4243 else if (len1_byte < len2_byte) /* Second region larger than first */
4254 /* Non-adjacent & unequal size, area between must also be shifted. */ 4244 /* Non-adjacent & unequal size, area between must also be shifted. */
4255 { 4245 {
4246 USE_SAFE_ALLOCA;
4247
4256 modify_region (current_buffer, start1, end2); 4248 modify_region (current_buffer, start1, end2);
4257 record_change (start1, (end2 - start1)); 4249 record_change (start1, (end2 - start1));
4258 tmp_interval1 = copy_intervals (cur_intv, start1, len1); 4250 tmp_interval1 = copy_intervals (cur_intv, start1, len1);
@@ -4262,18 +4254,15 @@ Transposing beyond buffer boundaries is an error. */)
4262 Qnil, Qnil); 4254 Qnil, Qnil);
4263 4255
4264 /* holds region 2 */ 4256 /* holds region 2 */
4265 if (len2_byte > 20000) 4257 SAFE_ALLOCA (temp, unsigned char *, len2_byte);
4266 temp = (unsigned char *) xmalloc (len2_byte);
4267 else
4268 temp = (unsigned char *) alloca (len2_byte);
4269 start1_addr = BYTE_POS_ADDR (start1_byte); 4258 start1_addr = BYTE_POS_ADDR (start1_byte);
4270 start2_addr = BYTE_POS_ADDR (start2_byte); 4259 start2_addr = BYTE_POS_ADDR (start2_byte);
4271 bcopy (start2_addr, temp, len2_byte); 4260 bcopy (start2_addr, temp, len2_byte);
4272 bcopy (start1_addr, start1_addr + len_mid + len2_byte, len1_byte); 4261 bcopy (start1_addr, start1_addr + len_mid + len2_byte, len1_byte);
4273 safe_bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid); 4262 safe_bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid);
4274 bcopy (temp, start1_addr, len2_byte); 4263 bcopy (temp, start1_addr, len2_byte);
4275 if (len2_byte > 20000) 4264 SAFE_FREE (len2_byte);
4276 xfree (temp); 4265
4277 graft_intervals_into_buffer (tmp_interval1, end2 - len1, 4266 graft_intervals_into_buffer (tmp_interval1, end2 - len1,
4278 len1, current_buffer, 0); 4267 len1, current_buffer, 0);
4279 graft_intervals_into_buffer (tmp_interval_mid, start1 + len2, 4268 graft_intervals_into_buffer (tmp_interval_mid, start1 + len2,
@@ -4284,6 +4273,8 @@ Transposing beyond buffer boundaries is an error. */)
4284 else 4273 else
4285 /* Second region smaller than first. */ 4274 /* Second region smaller than first. */
4286 { 4275 {
4276 USE_SAFE_ALLOCA;
4277
4287 record_change (start1, (end2 - start1)); 4278 record_change (start1, (end2 - start1));
4288 modify_region (current_buffer, start1, end2); 4279 modify_region (current_buffer, start1, end2);
4289 4280
@@ -4294,18 +4285,15 @@ Transposing beyond buffer boundaries is an error. */)
4294 Qnil, Qnil); 4285 Qnil, Qnil);
4295 4286
4296 /* holds region 1 */ 4287 /* holds region 1 */
4297 if (len1_byte > 20000) 4288 SAFE_ALLOCA (temp, unsigned char *, len1_byte);
4298 temp = (unsigned char *) xmalloc (len1_byte);
4299 else
4300 temp = (unsigned char *) alloca (len1_byte);
4301 start1_addr = BYTE_POS_ADDR (start1_byte); 4289 start1_addr = BYTE_POS_ADDR (start1_byte);
4302 start2_addr = BYTE_POS_ADDR (start2_byte); 4290 start2_addr = BYTE_POS_ADDR (start2_byte);
4303 bcopy (start1_addr, temp, len1_byte); 4291 bcopy (start1_addr, temp, len1_byte);
4304 bcopy (start2_addr, start1_addr, len2_byte); 4292 bcopy (start2_addr, start1_addr, len2_byte);
4305 bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid); 4293 bcopy (start1_addr + len1_byte, start1_addr + len2_byte, len_mid);
4306 bcopy (temp, start1_addr + len2_byte + len_mid, len1_byte); 4294 bcopy (temp, start1_addr + len2_byte + len_mid, len1_byte);
4307 if (len1_byte > 20000) 4295 SAFE_FREE (len1_byte);
4308 xfree (temp); 4296
4309 graft_intervals_into_buffer (tmp_interval1, end2 - len1, 4297 graft_intervals_into_buffer (tmp_interval1, end2 - len1,
4310 len1, current_buffer, 0); 4298 len1, current_buffer, 0);
4311 graft_intervals_into_buffer (tmp_interval_mid, start1 + len2, 4299 graft_intervals_into_buffer (tmp_interval_mid, start1 + len2,
diff --git a/src/emacs.c b/src/emacs.c
index d348eb86d29..5b7394627ef 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -126,14 +126,6 @@ Lisp_Object Vkill_emacs_hook;
126/* An empty lisp string. To avoid having to build any other. */ 126/* An empty lisp string. To avoid having to build any other. */
127Lisp_Object empty_string; 127Lisp_Object empty_string;
128 128
129#ifdef SIGUSR1
130/* Hooks for signal USR1 and USR2 handling. */
131Lisp_Object Vsignal_USR1_hook;
132#ifdef SIGUSR2
133Lisp_Object Vsignal_USR2_hook;
134#endif
135#endif
136
137/* Search path separator. */ 129/* Search path separator. */
138Lisp_Object Vpath_separator; 130Lisp_Object Vpath_separator;
139 131
@@ -2379,18 +2371,6 @@ The hook is not run in batch mode, i.e., if `noninteractive' is non-nil. */);
2379 empty_string = build_string (""); 2371 empty_string = build_string ("");
2380 staticpro (&empty_string); 2372 staticpro (&empty_string);
2381 2373
2382#ifdef SIGUSR1
2383 DEFVAR_LISP ("signal-USR1-hook", &Vsignal_USR1_hook,
2384 doc: /* Hook to be run whenever emacs receives a USR1 signal. */);
2385 Vsignal_USR1_hook = Qnil;
2386#ifdef SIGUSR2
2387 DEFVAR_LISP ("signal-USR2-hook", &Vsignal_USR2_hook,
2388 doc: /* Hook to be run whenever emacs receives a USR2 signal. */);
2389 Vsignal_USR2_hook = Qnil;
2390#endif
2391#endif
2392
2393
2394 DEFVAR_INT ("emacs-priority", &emacs_priority, 2374 DEFVAR_INT ("emacs-priority", &emacs_priority,
2395 doc: /* Priority for Emacs to run at. 2375 doc: /* Priority for Emacs to run at.
2396This value is effective only if set before Emacs is dumped, 2376This value is effective only if set before Emacs is dumped,
diff --git a/src/fns.c b/src/fns.c
index 5e20687494c..2058fb63a4e 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -929,11 +929,14 @@ string_make_multibyte (string)
929 if (nbytes == SBYTES (string)) 929 if (nbytes == SBYTES (string))
930 return string; 930 return string;
931 931
932 buf = (unsigned char *) alloca (nbytes); 932 SAFE_ALLOCA (buf, unsigned char *, nbytes);
933 copy_text (SDATA (string), buf, SBYTES (string), 933 copy_text (SDATA (string), buf, SBYTES (string),
934 0, 1); 934 0, 1);
935 935
936 return make_multibyte_string (buf, SCHARS (string), nbytes); 936 ret = make_multibyte_string (buf, SCHARS (string), nbytes);
937 SAFE_FREE (nbytes);
938
939 return ret;
937} 940}
938 941
939 942
@@ -947,6 +950,8 @@ string_to_multibyte (string)
947{ 950{
948 unsigned char *buf; 951 unsigned char *buf;
949 int nbytes; 952 int nbytes;
953 Lisp_Object ret;
954 USE_SAFE_ALLOCA;
950 955
951 if (STRING_MULTIBYTE (string)) 956 if (STRING_MULTIBYTE (string))
952 return string; 957 return string;
@@ -957,11 +962,14 @@ string_to_multibyte (string)
957 if (nbytes == SBYTES (string)) 962 if (nbytes == SBYTES (string))
958 return make_multibyte_string (SDATA (string), nbytes, nbytes); 963 return make_multibyte_string (SDATA (string), nbytes, nbytes);
959 964
960 buf = (unsigned char *) alloca (nbytes); 965 SAFE_ALLOCA (buf, unsigned char *, nbytes);
961 bcopy (SDATA (string), buf, SBYTES (string)); 966 bcopy (SDATA (string), buf, SBYTES (string));
962 str_to_multibyte (buf, nbytes, SBYTES (string)); 967 str_to_multibyte (buf, nbytes, SBYTES (string));
963 968
964 return make_multibyte_string (buf, SCHARS (string), nbytes); 969 ret = make_multibyte_string (buf, SCHARS (string), nbytes);
970 SAFE_FREE (nbytes);
971
972 return ret;
965} 973}
966 974
967 975
@@ -971,23 +979,22 @@ Lisp_Object
971string_make_unibyte (string) 979string_make_unibyte (string)
972 Lisp_Object string; 980 Lisp_Object string;
973{ 981{
982 int nchars;
974 unsigned char *buf; 983 unsigned char *buf;
975 Lisp_Object ret; 984 Lisp_Object ret;
985 USE_SAFE_ALLOCA;
976 986
977 if (! STRING_MULTIBYTE (string)) 987 if (! STRING_MULTIBYTE (string))
978 return string; 988 return string;
979 989
980 /* We can not use alloca here, because string might be very long. 990 nchars = SCHARS (string);
981 For example when selecting megabytes of text and then pasting it to
982 another application. */
983 buf = (unsigned char *) xmalloc (SCHARS (string));
984 991
992 SAFE_ALLOCA (buf, unsigned char *, nchars);
985 copy_text (SDATA (string), buf, SBYTES (string), 993 copy_text (SDATA (string), buf, SBYTES (string),
986 1, 0); 994 1, 0);
987 995
988 ret = make_unibyte_string (buf, SCHARS (string)); 996 ret = make_unibyte_string (buf, nchars);
989 997 SAFE_FREE (nchars);
990 xfree (buf);
991 998
992 return ret; 999 return ret;
993} 1000}
@@ -2455,6 +2462,8 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
2455 register Lisp_Object *args; 2462 register Lisp_Object *args;
2456 register int i; 2463 register int i;
2457 struct gcpro gcpro1; 2464 struct gcpro gcpro1;
2465 Lisp_Object ret;
2466 USE_SAFE_ALLOCA;
2458 2467
2459 len = Flength (sequence); 2468 len = Flength (sequence);
2460 if (CHAR_TABLE_P (sequence)) 2469 if (CHAR_TABLE_P (sequence))
@@ -2463,7 +2472,7 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
2463 nargs = leni + leni - 1; 2472 nargs = leni + leni - 1;
2464 if (nargs < 0) return build_string (""); 2473 if (nargs < 0) return build_string ("");
2465 2474
2466 args = (Lisp_Object *) alloca (nargs * sizeof (Lisp_Object)); 2475 SAFE_ALLOCA_LISP (args, nargs);
2467 2476
2468 GCPRO1 (separator); 2477 GCPRO1 (separator);
2469 mapcar1 (leni, args, function, sequence); 2478 mapcar1 (leni, args, function, sequence);
@@ -2475,7 +2484,10 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
2475 for (i = 1; i < nargs; i += 2) 2484 for (i = 1; i < nargs; i += 2)
2476 args[i] = separator; 2485 args[i] = separator;
2477 2486
2478 return Fconcat (nargs, args); 2487 ret = Fconcat (nargs, args);
2488 SAFE_FREE_LISP (nargs);
2489
2490 return ret;
2479} 2491}
2480 2492
2481DEFUN ("mapcar", Fmapcar, Smapcar, 2, 2, 0, 2493DEFUN ("mapcar", Fmapcar, Smapcar, 2, 2, 0,
@@ -2488,16 +2500,22 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */)
2488 register Lisp_Object len; 2500 register Lisp_Object len;
2489 register int leni; 2501 register int leni;
2490 register Lisp_Object *args; 2502 register Lisp_Object *args;
2503 Lisp_Object ret;
2504 USE_SAFE_ALLOCA;
2491 2505
2492 len = Flength (sequence); 2506 len = Flength (sequence);
2493 if (CHAR_TABLE_P (sequence)) 2507 if (CHAR_TABLE_P (sequence))
2494 wrong_type_argument (Qlistp, sequence); 2508 wrong_type_argument (Qlistp, sequence);
2495 leni = XFASTINT (len); 2509 leni = XFASTINT (len);
2496 args = (Lisp_Object *) alloca (leni * sizeof (Lisp_Object)); 2510
2511 SAFE_ALLOCA_LISP (args, leni);
2497 2512
2498 mapcar1 (leni, args, function, sequence); 2513 mapcar1 (leni, args, function, sequence);
2499 2514
2500 return Flist (leni, args); 2515 ret = Flist (leni, args);
2516 SAFE_FREE_LISP (leni);
2517
2518 return ret;
2501} 2519}
2502 2520
2503DEFUN ("mapc", Fmapc, Smapc, 2, 2, 0, 2521DEFUN ("mapc", Fmapc, Smapc, 2, 2, 0,
@@ -3114,10 +3132,6 @@ The data read from the system are decoded using `locale-coding-system'. */)
3114 } \ 3132 } \
3115 while (IS_BASE64_IGNORABLE (c)) 3133 while (IS_BASE64_IGNORABLE (c))
3116 3134
3117/* Don't use alloca for regions larger than this, lest we overflow
3118 their stack. */
3119#define MAX_ALLOCA 16*1024
3120
3121/* Table of characters coding the 64 values. */ 3135/* Table of characters coding the 64 values. */
3122static char base64_value_to_char[64] = 3136static char base64_value_to_char[64] =
3123{ 3137{
@@ -3183,6 +3197,7 @@ into shorter lines. */)
3183 int allength, length; 3197 int allength, length;
3184 int ibeg, iend, encoded_length; 3198 int ibeg, iend, encoded_length;
3185 int old_pos = PT; 3199 int old_pos = PT;
3200 USE_SAFE_ALLOCA;
3186 3201
3187 validate_region (&beg, &end); 3202 validate_region (&beg, &end);
3188 3203
@@ -3197,10 +3212,7 @@ into shorter lines. */)
3197 allength = length + length/3 + 1; 3212 allength = length + length/3 + 1;
3198 allength += allength / MIME_LINE_LENGTH + 1 + 6; 3213 allength += allength / MIME_LINE_LENGTH + 1 + 6;
3199 3214
3200 if (allength <= MAX_ALLOCA) 3215 SAFE_ALLOCA (encoded, char *, allength);
3201 encoded = (char *) alloca (allength);
3202 else
3203 encoded = (char *) xmalloc (allength);
3204 encoded_length = base64_encode_1 (BYTE_POS_ADDR (ibeg), encoded, length, 3216 encoded_length = base64_encode_1 (BYTE_POS_ADDR (ibeg), encoded, length,
3205 NILP (no_line_break), 3217 NILP (no_line_break),
3206 !NILP (current_buffer->enable_multibyte_characters)); 3218 !NILP (current_buffer->enable_multibyte_characters));
@@ -3210,8 +3222,7 @@ into shorter lines. */)
3210 if (encoded_length < 0) 3222 if (encoded_length < 0)
3211 { 3223 {
3212 /* The encoding wasn't possible. */ 3224 /* The encoding wasn't possible. */
3213 if (length > MAX_ALLOCA) 3225 SAFE_FREE (allength);
3214 xfree (encoded);
3215 error ("Multibyte character in data for base64 encoding"); 3226 error ("Multibyte character in data for base64 encoding");
3216 } 3227 }
3217 3228
@@ -3219,8 +3230,7 @@ into shorter lines. */)
3219 and delete the old. (Insert first in order to preserve markers.) */ 3230 and delete the old. (Insert first in order to preserve markers.) */
3220 SET_PT_BOTH (XFASTINT (beg), ibeg); 3231 SET_PT_BOTH (XFASTINT (beg), ibeg);
3221 insert (encoded, encoded_length); 3232 insert (encoded, encoded_length);
3222 if (allength > MAX_ALLOCA) 3233 SAFE_FREE (allength);
3223 xfree (encoded);
3224 del_range_byte (ibeg + encoded_length, iend + encoded_length, 1); 3234 del_range_byte (ibeg + encoded_length, iend + encoded_length, 1);
3225 3235
3226 /* If point was outside of the region, restore it exactly; else just 3236 /* If point was outside of the region, restore it exactly; else just
@@ -3246,6 +3256,7 @@ into shorter lines. */)
3246 int allength, length, encoded_length; 3256 int allength, length, encoded_length;
3247 char *encoded; 3257 char *encoded;
3248 Lisp_Object encoded_string; 3258 Lisp_Object encoded_string;
3259 USE_SAFE_ALLOCA;
3249 3260
3250 CHECK_STRING (string); 3261 CHECK_STRING (string);
3251 3262
@@ -3257,10 +3268,7 @@ into shorter lines. */)
3257 allength += allength / MIME_LINE_LENGTH + 1 + 6; 3268 allength += allength / MIME_LINE_LENGTH + 1 + 6;
3258 3269
3259 /* We need to allocate enough room for decoding the text. */ 3270 /* We need to allocate enough room for decoding the text. */
3260 if (allength <= MAX_ALLOCA) 3271 SAFE_ALLOCA (encoded, char *, allength);
3261 encoded = (char *) alloca (allength);
3262 else
3263 encoded = (char *) xmalloc (allength);
3264 3272
3265 encoded_length = base64_encode_1 (SDATA (string), 3273 encoded_length = base64_encode_1 (SDATA (string),
3266 encoded, length, NILP (no_line_break), 3274 encoded, length, NILP (no_line_break),
@@ -3271,14 +3279,12 @@ into shorter lines. */)
3271 if (encoded_length < 0) 3279 if (encoded_length < 0)
3272 { 3280 {
3273 /* The encoding wasn't possible. */ 3281 /* The encoding wasn't possible. */
3274 if (length > MAX_ALLOCA) 3282 SAFE_FREE (allength);
3275 xfree (encoded);
3276 error ("Multibyte character in data for base64 encoding"); 3283 error ("Multibyte character in data for base64 encoding");
3277 } 3284 }
3278 3285
3279 encoded_string = make_unibyte_string (encoded, encoded_length); 3286 encoded_string = make_unibyte_string (encoded, encoded_length);
3280 if (allength > MAX_ALLOCA) 3287 SAFE_FREE (allength);
3281 xfree (encoded);
3282 3288
3283 return encoded_string; 3289 return encoded_string;
3284} 3290}
@@ -3397,6 +3403,7 @@ If the region can't be decoded, signal an error and don't modify the buffer. */
3397 int decoded_length; 3403 int decoded_length;
3398 int inserted_chars; 3404 int inserted_chars;
3399 int multibyte = !NILP (current_buffer->enable_multibyte_characters); 3405 int multibyte = !NILP (current_buffer->enable_multibyte_characters);
3406 USE_SAFE_ALLOCA;
3400 3407
3401 validate_region (&beg, &end); 3408 validate_region (&beg, &end);
3402 3409
@@ -3409,10 +3416,7 @@ If the region can't be decoded, signal an error and don't modify the buffer. */
3409 working on a multibyte buffer, each decoded code may occupy at 3416 working on a multibyte buffer, each decoded code may occupy at
3410 most two bytes. */ 3417 most two bytes. */
3411 allength = multibyte ? length * 2 : length; 3418 allength = multibyte ? length * 2 : length;
3412 if (allength <= MAX_ALLOCA) 3419 SAFE_ALLOCA (decoded, char *, allength);
3413 decoded = (char *) alloca (allength);
3414 else
3415 decoded = (char *) xmalloc (allength);
3416 3420
3417 move_gap_both (XFASTINT (beg), ibeg); 3421 move_gap_both (XFASTINT (beg), ibeg);
3418 decoded_length = base64_decode_1 (BYTE_POS_ADDR (ibeg), decoded, length, 3422 decoded_length = base64_decode_1 (BYTE_POS_ADDR (ibeg), decoded, length,
@@ -3423,8 +3427,7 @@ If the region can't be decoded, signal an error and don't modify the buffer. */
3423 if (decoded_length < 0) 3427 if (decoded_length < 0)
3424 { 3428 {
3425 /* The decoding wasn't possible. */ 3429 /* The decoding wasn't possible. */
3426 if (allength > MAX_ALLOCA) 3430 SAFE_FREE (allength);
3427 xfree (decoded);
3428 error ("Invalid base64 data"); 3431 error ("Invalid base64 data");
3429 } 3432 }
3430 3433
@@ -3432,8 +3435,8 @@ If the region can't be decoded, signal an error and don't modify the buffer. */
3432 and delete the old. (Insert first in order to preserve markers.) */ 3435 and delete the old. (Insert first in order to preserve markers.) */
3433 TEMP_SET_PT_BOTH (XFASTINT (beg), ibeg); 3436 TEMP_SET_PT_BOTH (XFASTINT (beg), ibeg);
3434 insert_1_both (decoded, inserted_chars, decoded_length, 0, 1, 0); 3437 insert_1_both (decoded, inserted_chars, decoded_length, 0, 1, 0);
3435 if (allength > MAX_ALLOCA) 3438 SAFE_FREE (allength);
3436 xfree (decoded); 3439
3437 /* Delete the original text. */ 3440 /* Delete the original text. */
3438 del_range_both (PT, PT_BYTE, XFASTINT (end) + inserted_chars, 3441 del_range_both (PT, PT_BYTE, XFASTINT (end) + inserted_chars,
3439 iend + decoded_length, 1); 3442 iend + decoded_length, 1);
@@ -3458,15 +3461,13 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string,
3458 char *decoded; 3461 char *decoded;
3459 int length, decoded_length; 3462 int length, decoded_length;
3460 Lisp_Object decoded_string; 3463 Lisp_Object decoded_string;
3464 USE_SAFE_ALLOCA;
3461 3465
3462 CHECK_STRING (string); 3466 CHECK_STRING (string);
3463 3467
3464 length = SBYTES (string); 3468 length = SBYTES (string);
3465 /* We need to allocate enough room for decoding the text. */ 3469 /* We need to allocate enough room for decoding the text. */
3466 if (length <= MAX_ALLOCA) 3470 SAFE_ALLOCA (decoded, char *, length);
3467 decoded = (char *) alloca (length);
3468 else
3469 decoded = (char *) xmalloc (length);
3470 3471
3471 /* The decoded result should be unibyte. */ 3472 /* The decoded result should be unibyte. */
3472 decoded_length = base64_decode_1 (SDATA (string), decoded, length, 3473 decoded_length = base64_decode_1 (SDATA (string), decoded, length,
@@ -3478,8 +3479,7 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string,
3478 else 3479 else
3479 decoded_string = Qnil; 3480 decoded_string = Qnil;
3480 3481
3481 if (length > MAX_ALLOCA) 3482 SAFE_FREE (length);
3482 xfree (decoded);
3483 if (!STRINGP (decoded_string)) 3483 if (!STRINGP (decoded_string))
3484 error ("Invalid base64 data"); 3484 error ("Invalid base64 data");
3485 3485
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 84aa9f46d4d..3ffba0ba745 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -248,8 +248,46 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
248{ 248{
249 GdkPixmap *gpix; 249 GdkPixmap *gpix;
250 GdkPixmap *gmask; 250 GdkPixmap *gmask;
251 GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f)); 251 GdkDisplay *gdpy;
252
253 /* If we are on a one bit display, let GTK do all the image handling.
254 This seems to be the only way to make insensitive and activated icons
255 look good. */
256 if (x_screen_planes (f) == 1)
257 {
258 Lisp_Object specified_file = Qnil;
259 Lisp_Object tail;
260 extern Lisp_Object QCfile;
261
262 for (tail = XCDR (img->spec);
263 NILP (specified_file) && CONSP (tail) && CONSP (XCDR (tail));
264 tail = XCDR (XCDR (tail)))
265 if (EQ (XCAR (tail), QCfile))
266 specified_file = XCAR (XCDR (tail));
267
268 if (STRINGP (specified_file))
269 {
270
271 Lisp_Object file = Qnil;
272 struct gcpro gcpro1;
273 GCPRO1 (file);
252 274
275 file = x_find_image_file (specified_file);
276 /* We already loaded the image once before calling this
277 function, so this should not fail. */
278 xassert (STRINGP (file) != 0);
279
280 if (! old_widget)
281 old_widget = GTK_IMAGE (gtk_image_new_from_file (SDATA (file)));
282 else
283 gtk_image_set_from_file (old_widget, SDATA (file));
284
285 UNGCPRO;
286 return GTK_WIDGET (old_widget);
287 }
288 }
289
290 gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f));
253 gpix = gdk_pixmap_foreign_new_for_display (gdpy, img->pixmap); 291 gpix = gdk_pixmap_foreign_new_for_display (gdpy, img->pixmap);
254 gmask = img->mask ? gdk_pixmap_foreign_new_for_display (gdpy, img->mask) : 0; 292 gmask = img->mask ? gdk_pixmap_foreign_new_for_display (gdpy, img->mask) : 0;
255 293
@@ -262,6 +300,12 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
262 } 300 }
263 else 301 else
264 { 302 {
303 /* This is a workaround to make icons look good on pseudo color
304 displays. Apparently GTK expects the images to have an alpha
305 channel. If they don't, insensitive and activated icons will
306 look bad. This workaround does not work on monochrome displays,
307 and is not needed on true color/static color displays (i.e.
308 16 bits and higher). */
265 int x, y, width, height, rowstride, mask_rowstride; 309 int x, y, width, height, rowstride, mask_rowstride;
266 GdkPixbuf *icon_buf, *tmp_buf; 310 GdkPixbuf *icon_buf, *tmp_buf;
267 guchar *pixels; 311 guchar *pixels;
@@ -308,12 +352,9 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
308 } 352 }
309 } 353 }
310 354
311 g_object_unref (G_OBJECT (gmask));
312 g_object_unref (G_OBJECT (mask_buf)); 355 g_object_unref (G_OBJECT (mask_buf));
313 } 356 }
314 357
315 g_object_unref (G_OBJECT (gpix));
316
317 if (! old_widget) 358 if (! old_widget)
318 old_widget = GTK_IMAGE (gtk_image_new_from_pixbuf (icon_buf)); 359 old_widget = GTK_IMAGE (gtk_image_new_from_pixbuf (icon_buf));
319 else 360 else
@@ -322,6 +363,9 @@ xg_get_image_for_pixmap (f, img, widget, old_widget)
322 g_object_unref (G_OBJECT (icon_buf)); 363 g_object_unref (G_OBJECT (icon_buf));
323 } 364 }
324 365
366 g_object_unref (G_OBJECT (gpix));
367 if (gmask) g_object_unref (G_OBJECT (gmask));
368
325 return GTK_WIDGET (old_widget); 369 return GTK_WIDGET (old_widget);
326} 370}
327 371
diff --git a/src/keymap.c b/src/keymap.c
index fbf1263a71b..4c23977ef41 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -2273,7 +2273,11 @@ push_text_char_description (c, p)
2273 2273
2274DEFUN ("text-char-description", Ftext_char_description, Stext_char_description, 1, 1, 0, 2274DEFUN ("text-char-description", Ftext_char_description, Stext_char_description, 1, 1, 0,
2275 doc: /* Return a pretty description of file-character CHARACTER. 2275 doc: /* Return a pretty description of file-character CHARACTER.
2276Control characters turn into "^char", etc. */) 2276Control characters turn into "^char", etc. This differs from
2277`single-key-description' which turns them into "C-char".
2278Also, this function recognizes the 2**7 bit as the Meta character,
2279whereas `single-key-description' uses the 2**27 bit for Meta.
2280See Info node `(elisp)Describing Characters' for examples. */)
2277 (character) 2281 (character)
2278 Lisp_Object character; 2282 Lisp_Object character;
2279{ 2283{
diff --git a/src/lisp.h b/src/lisp.h
index 7e39313a7fc..aba3073dc68 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1203,7 +1203,10 @@ struct Lisp_Save_Value
1203 { 1203 {
1204 int type : 16; /* = Lisp_Misc_Save_Value */ 1204 int type : 16; /* = Lisp_Misc_Save_Value */
1205 unsigned gcmarkbit : 1; 1205 unsigned gcmarkbit : 1;
1206 int spacer : 15; 1206 int spacer : 14;
1207 /* If DOGC is set, POINTER is the address of a memory
1208 area containing INTEGER potential Lisp_Objects. */
1209 unsigned int dogc : 1;
1207 void *pointer; 1210 void *pointer;
1208 int integer; 1211 int integer;
1209 }; 1212 };
@@ -2498,6 +2501,7 @@ extern Lisp_Object make_float P_ ((double));
2498extern void display_malloc_warning P_ ((void)); 2501extern void display_malloc_warning P_ ((void));
2499extern int inhibit_garbage_collection P_ ((void)); 2502extern int inhibit_garbage_collection P_ ((void));
2500extern Lisp_Object make_save_value P_ ((void *, int)); 2503extern Lisp_Object make_save_value P_ ((void *, int));
2504extern void free_misc P_ ((Lisp_Object));
2501extern void free_marker P_ ((Lisp_Object)); 2505extern void free_marker P_ ((Lisp_Object));
2502extern void free_cons P_ ((struct Lisp_Cons *)); 2506extern void free_cons P_ ((struct Lisp_Cons *));
2503extern void init_alloc_once P_ ((void)); 2507extern void init_alloc_once P_ ((void));
@@ -3290,6 +3294,64 @@ extern Lisp_Object Vdirectory_sep_char;
3290 : Fcons ((el), (check))))) 3294 : Fcons ((el), (check)))))
3291 3295
3292 3296
3297/* SAFE_ALLOCA normally allocates memory on the stack, but if size is
3298 larger than MAX_ALLOCA, use xmalloc to avoid overflowing the stack. */
3299
3300#define MAX_ALLOCA 16*1024
3301
3302extern Lisp_Object safe_alloca_unwind (Lisp_Object);
3303
3304#define USE_SAFE_ALLOCA \
3305 int sa_count = SPECPDL_INDEX ()
3306
3307/* SAFE_ALLOCA allocates a simple buffer. */
3308
3309#define SAFE_ALLOCA(buf, type, size) \
3310 do { \
3311 if ((size) < MAX_ALLOCA) \
3312 buf = (type) alloca (size); \
3313 else \
3314 { \
3315 buf = (type) xmalloc (size); \
3316 record_unwind_protect (safe_alloca_unwind, \
3317 make_save_value (buf, 0)); \
3318 } \
3319 } while (0)
3320
3321/* SAFE_FREE frees xmalloced memory and enables GC as needed. */
3322
3323#define SAFE_FREE(size) \
3324 do { \
3325 if ((size) >= MAX_ALLOCA) \
3326 unbind_to (sa_count, Qnil); \
3327 } while (0)
3328
3329
3330/* SAFE_ALLOCA_LISP allocates an array of Lisp_Objects. */
3331
3332#define SAFE_ALLOCA_LISP(buf, nelt) \
3333 do { \
3334 int size_ = (nelt) * sizeof (Lisp_Object); \
3335 if (size_ < MAX_ALLOCA) \
3336 buf = (Lisp_Object *) alloca (size_); \
3337 else \
3338 { \
3339 Lisp_Object arg_; \
3340 buf = (Lisp_Object *) xmalloc (size_); \
3341 arg_ = make_save_value (buf, nelt); \
3342 XSAVE_VALUE (arg_)->dogc = 1; \
3343 record_unwind_protect (safe_alloca_unwind, arg_); \
3344 } \
3345 } while (0)
3346
3347#define SAFE_FREE_LISP(nelt) \
3348 do { \
3349 if (((nelt) * sizeof (Lisp_Object)) >= MAX_ALLOCA) \
3350 unbind_to (sa_count, Qnil); \
3351 } while (0)
3352
3353
3354
3293#endif /* EMACS_LISP_H */ 3355#endif /* EMACS_LISP_H */
3294 3356
3295/* arch-tag: 9b2ed020-70eb-47ac-94ee-e1c2a5107d5e 3357/* arch-tag: 9b2ed020-70eb-47ac-94ee-e1c2a5107d5e
diff --git a/src/macterm.c b/src/macterm.c
index 360dccd4f16..04d6ec3be64 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -7018,7 +7018,7 @@ mac_get_emulated_btn ( UInt32 modifiers )
7018 int result = 0; 7018 int result = 0;
7019 if (!NILP (Vmac_emulate_three_button_mouse)) { 7019 if (!NILP (Vmac_emulate_three_button_mouse)) {
7020 int cmdIs3 = !EQ (Vmac_emulate_three_button_mouse, Qreverse); 7020 int cmdIs3 = !EQ (Vmac_emulate_three_button_mouse, Qreverse);
7021 if (modifiers & controlKey) 7021 if (modifiers & cmdKey)
7022 result = cmdIs3 ? 2 : 1; 7022 result = cmdIs3 ? 2 : 1;
7023 else if (modifiers & optionKey) 7023 else if (modifiers & optionKey)
7024 result = cmdIs3 ? 1 : 2; 7024 result = cmdIs3 ? 1 : 2;
@@ -7038,7 +7038,7 @@ mac_event_to_emacs_modifiers (EventRef eventRef)
7038 if (!NILP (Vmac_emulate_three_button_mouse) && 7038 if (!NILP (Vmac_emulate_three_button_mouse) &&
7039 GetEventClass(eventRef) == kEventClassMouse) 7039 GetEventClass(eventRef) == kEventClassMouse)
7040 { 7040 {
7041 mods &= ~(optionKey & cmdKey); 7041 mods &= ~(optionKey | cmdKey);
7042 } 7042 }
7043 return mac_to_emacs_modifiers (mods); 7043 return mac_to_emacs_modifiers (mods);
7044} 7044}
@@ -7237,40 +7237,6 @@ is_emacs_window (WindowPtr win)
7237} 7237}
7238 7238
7239static void 7239static void
7240do_window_activate (WindowPtr win)
7241{
7242 struct frame *f;
7243
7244 if (is_emacs_window (win))
7245 {
7246 f = mac_window_to_frame (win);
7247
7248 if (f)
7249 {
7250 x_new_focus_frame (FRAME_MAC_DISPLAY_INFO (f), f);
7251 activate_scroll_bars (f);
7252 }
7253 }
7254}
7255
7256static void
7257do_window_deactivate (WindowPtr win)
7258{
7259 struct frame *f;
7260
7261 if (is_emacs_window (win))
7262 {
7263 f = mac_window_to_frame (win);
7264
7265 if (f == FRAME_MAC_DISPLAY_INFO (f)->x_focus_frame)
7266 {
7267 x_new_focus_frame (FRAME_MAC_DISPLAY_INFO (f), 0);
7268 deactivate_scroll_bars (f);
7269 }
7270 }
7271}
7272
7273static void
7274do_app_resume () 7240do_app_resume ()
7275{ 7241{
7276 WindowPtr wp; 7242 WindowPtr wp;
@@ -8084,6 +8050,25 @@ XTread_socket (sd, expected, hold_quit)
8084 if (!mac_convert_event_ref (eventRef, &er)) 8050 if (!mac_convert_event_ref (eventRef, &er))
8085 switch (GetEventClass (eventRef)) 8051 switch (GetEventClass (eventRef))
8086 { 8052 {
8053 case kEventClassWindow:
8054 if (GetEventKind (eventRef) == kEventWindowBoundsChanged)
8055 {
8056 WindowPtr window_ptr;
8057 GetEventParameter(eventRef, kEventParamDirectObject,
8058 typeWindowRef, NULL, sizeof(WindowPtr),
8059 NULL, &window_ptr);
8060 f = mac_window_to_frame (window_ptr);
8061 if (f && !f->async_iconified)
8062 {
8063 int x, y;
8064
8065 x_real_positions (f, &x, &y);
8066 f->left_pos = x;
8067 f->top_pos = y;
8068 }
8069 SendEventToEventTarget (eventRef, toolbox_dispatcher);
8070 }
8071 break;
8087 case kEventClassMouse: 8072 case kEventClassMouse:
8088 if (GetEventKind (eventRef) == kEventMouseWheelMoved) 8073 if (GetEventKind (eventRef) == kEventMouseWheelMoved)
8089 { 8074 {
@@ -8135,6 +8120,14 @@ XTread_socket (sd, expected, hold_quit)
8135 SInt16 part_code; 8120 SInt16 part_code;
8136 int tool_bar_p = 0; 8121 int tool_bar_p = 0;
8137 8122
8123#if USE_CARBON_EVENTS
8124 /* This is needed to send mouse events like aqua window
8125 buttons to the correct handler. */
8126 if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
8127 != eventNotHandledErr)
8128 break;
8129#endif
8130
8138 if (dpyinfo->grabbed && last_mouse_frame 8131 if (dpyinfo->grabbed && last_mouse_frame
8139 && FRAME_LIVE_P (last_mouse_frame)) 8132 && FRAME_LIVE_P (last_mouse_frame))
8140 { 8133 {
@@ -8150,16 +8143,9 @@ XTread_socket (sd, expected, hold_quit)
8150 window_ptr = FrontWindow (); 8143 window_ptr = FrontWindow ();
8151 } 8144 }
8152 8145
8153#if USE_CARBON_EVENTS
8154 /* This is needed to send mouse events like aqua
8155 window buttons to the correct handler. */
8156 if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
8157 != eventNotHandledErr)
8158 break;
8159
8160 if (!is_emacs_window (window_ptr)) 8146 if (!is_emacs_window (window_ptr))
8161 break; 8147 break;
8162#endif 8148
8163 part_code = FindWindow (er.where, &window_ptr); 8149 part_code = FindWindow (er.where, &window_ptr);
8164 } 8150 }
8165 8151
@@ -8306,6 +8292,18 @@ XTread_socket (sd, expected, hold_quit)
8306#else /* not TARGET_API_MAC_CARBON */ 8292#else /* not TARGET_API_MAC_CARBON */
8307 DragWindow (window_ptr, er.where, &qd.screenBits.bounds); 8293 DragWindow (window_ptr, er.where, &qd.screenBits.bounds);
8308#endif /* not TARGET_API_MAC_CARBON */ 8294#endif /* not TARGET_API_MAC_CARBON */
8295 /* Update the frame parameters. */
8296 {
8297 struct frame *f = mac_window_to_frame (window_ptr);
8298 if (f && !f->async_iconified)
8299 {
8300 int x, y;
8301
8302 x_real_positions (f, &x, &y);
8303 f->left_pos = x;
8304 f->top_pos = y;
8305 }
8306 }
8309 break; 8307 break;
8310 8308
8311 case inGoAway: 8309 case inGoAway:
@@ -8393,24 +8391,38 @@ XTread_socket (sd, expected, hold_quit)
8393 break; 8391 break;
8394 } 8392 }
8395 8393
8394 if (!is_emacs_window (window_ptr))
8395 break;
8396
8397 f = mac_window_to_frame (window_ptr);
8398
8396 if ((er.modifiers & activeFlag) != 0) 8399 if ((er.modifiers & activeFlag) != 0)
8397 { 8400 {
8401 /* A window has been activated */
8398 Point mouse_loc = er.where; 8402 Point mouse_loc = er.where;
8399 8403
8400 do_window_activate (window_ptr); 8404 x_new_focus_frame (dpyinfo, f);
8405 activate_scroll_bars (f);
8401 8406
8402 SetPortWindowPort (window_ptr); 8407 SetPortWindowPort (window_ptr);
8403 GlobalToLocal (&mouse_loc); 8408 GlobalToLocal (&mouse_loc);
8404 /* activateEvt counts as mouse movement, 8409 /* Window-activated event counts as mouse movement,
8405 so update things that depend on mouse position. */ 8410 so update things that depend on mouse position. */
8406 note_mouse_movement (mac_window_to_frame (window_ptr), 8411 note_mouse_movement (mac_window_to_frame (window_ptr),
8407 &mouse_loc); 8412 &mouse_loc);
8408 } 8413 }
8409 else 8414 else
8410 { 8415 {
8411 do_window_deactivate (window_ptr); 8416 /* A window has been deactivated */
8417 dpyinfo->grabbed = 0;
8418
8419 if (f == dpyinfo->x_focus_frame)
8420 {
8421 x_new_focus_frame (dpyinfo, 0);
8422 deactivate_scroll_bars (f);
8423 }
8424
8412 8425
8413 f = mac_window_to_frame (window_ptr);
8414 if (f == dpyinfo->mouse_face_mouse_frame) 8426 if (f == dpyinfo->mouse_face_mouse_frame)
8415 { 8427 {
8416 /* If we move outside the frame, then we're 8428 /* If we move outside the frame, then we're
diff --git a/src/print.c b/src/print.c
index 4b94d77e876..287e77edad1 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 eba74f418ce..bb3f222e2c1 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2543,15 +2543,20 @@ since only regular expressions have distinguished subexpressions. */)
2543 /* Adjust search data for this change. */ 2543 /* Adjust search data for this change. */
2544 { 2544 {
2545 int oldend = search_regs.end[sub]; 2545 int oldend = search_regs.end[sub];
2546 int oldstart = search_regs.start[sub];
2546 int change = newpoint - search_regs.end[sub]; 2547 int change = newpoint - search_regs.end[sub];
2547 int i; 2548 int i;
2548 2549
2549 for (i = 0; i < search_regs.num_regs; i++) 2550 for (i = 0; i < search_regs.num_regs; i++)
2550 { 2551 {
2551 if (search_regs.start[i] > oldend) 2552 if (search_regs.start[i] >= oldend)
2552 search_regs.start[i] += change; 2553 search_regs.start[i] += change;
2553 if (search_regs.end[i] > oldend) 2554 else if (search_regs.start[i] > oldstart)
2555 search_regs.start[i] = oldstart;
2556 if (search_regs.end[i] >= oldend)
2554 search_regs.end[i] += change; 2557 search_regs.end[i] += change;
2558 else if (search_regs.end[i] > oldstart)
2559 search_regs.end[i] = oldstart;
2555 } 2560 }
2556 } 2561 }
2557 2562
@@ -2620,8 +2625,11 @@ All the elements are markers or nil (nil if the Nth pair didn't match)
2620if the last match was on a buffer; integers or nil if a string was matched. 2625if the last match was on a buffer; integers or nil if a string was matched.
2621Use `store-match-data' to reinstate the data in this list. 2626Use `store-match-data' to reinstate the data in this list.
2622 2627
2623If INTEGERS (the optional first argument) is non-nil, always use integers 2628If INTEGERS (the optional first argument) is non-nil, always use
2624\(rather than markers) to represent buffer positions. 2629integers \(rather than markers) to represent buffer positions. In
2630this case, and if the last match was in a buffer, the buffer will get
2631stored as one additional element at the end of the list.
2632
2625If REUSE is a list, reuse it as part of the value. If REUSE is long enough 2633If REUSE is a list, reuse it as part of the value. If REUSE is long enough
2626to hold all the values, and if INTEGERS is non-nil, no consing is done. 2634to hold all the values, and if INTEGERS is non-nil, no consing is done.
2627 2635
@@ -2638,10 +2646,10 @@ Return value is undefined if the last search failed. */)
2638 2646
2639 prev = Qnil; 2647 prev = Qnil;
2640 2648
2641 data = (Lisp_Object *) alloca ((2 * search_regs.num_regs) 2649 data = (Lisp_Object *) alloca ((2 * search_regs.num_regs + 1)
2642 * sizeof (Lisp_Object)); 2650 * sizeof (Lisp_Object));
2643 2651
2644 len = -1; 2652 len = 0;
2645 for (i = 0; i < search_regs.num_regs; i++) 2653 for (i = 0; i < search_regs.num_regs; i++)
2646 { 2654 {
2647 int start = search_regs.start[i]; 2655 int start = search_regs.start[i];
@@ -2668,22 +2676,29 @@ Return value is undefined if the last search failed. */)
2668 /* last_thing_searched must always be Qt, a buffer, or Qnil. */ 2676 /* last_thing_searched must always be Qt, a buffer, or Qnil. */
2669 abort (); 2677 abort ();
2670 2678
2671 len = i; 2679 len = 2*(i+1);
2672 } 2680 }
2673 else 2681 else
2674 data[2 * i] = data [2 * i + 1] = Qnil; 2682 data[2 * i] = data [2 * i + 1] = Qnil;
2675 } 2683 }
2676 2684
2685 if (BUFFERP(last_thing_searched)
2686 && ! NILP (integers))
2687 {
2688 XSETBUFFER(data[len], last_thing_searched);
2689 len++;
2690 }
2691
2677 /* If REUSE is not usable, cons up the values and return them. */ 2692 /* If REUSE is not usable, cons up the values and return them. */
2678 if (! CONSP (reuse)) 2693 if (! CONSP (reuse))
2679 return Flist (2 * len + 2, data); 2694 return Flist (len, data);
2680 2695
2681 /* If REUSE is a list, store as many value elements as will fit 2696 /* If REUSE is a list, store as many value elements as will fit
2682 into the elements of REUSE. */ 2697 into the elements of REUSE. */
2683 for (i = 0, tail = reuse; CONSP (tail); 2698 for (i = 0, tail = reuse; CONSP (tail);
2684 i++, tail = XCDR (tail)) 2699 i++, tail = XCDR (tail))
2685 { 2700 {
2686 if (i < 2 * len + 2) 2701 if (i < len)
2687 XSETCAR (tail, data[i]); 2702 XSETCAR (tail, data[i]);
2688 else 2703 else
2689 XSETCAR (tail, Qnil); 2704 XSETCAR (tail, Qnil);
@@ -2692,8 +2707,8 @@ Return value is undefined if the last search failed. */)
2692 2707
2693 /* If we couldn't fit all value elements into REUSE, 2708 /* If we couldn't fit all value elements into REUSE,
2694 cons up the rest of them and add them to the end of REUSE. */ 2709 cons up the rest of them and add them to the end of REUSE. */
2695 if (i < 2 * len + 2) 2710 if (i < len)
2696 XSETCDR (prev, Flist (2 * len + 2 - i, data + i)); 2711 XSETCDR (prev, Flist (len - i, data + i));
2697 2712
2698 return reuse; 2713 return reuse;
2699} 2714}
@@ -2714,8 +2729,8 @@ LIST should have been created by calling `match-data' previously. */)
2714 if (!CONSP (list) && !NILP (list)) 2729 if (!CONSP (list) && !NILP (list))
2715 list = wrong_type_argument (Qconsp, list); 2730 list = wrong_type_argument (Qconsp, list);
2716 2731
2717 /* Unless we find a marker with a buffer in LIST, assume that this 2732 /* Unless we find a marker with a buffer or an explicit buffer
2718 match data came from a string. */ 2733 in LIST, assume that this match data came from a string. */
2719 last_thing_searched = Qt; 2734 last_thing_searched = Qt;
2720 2735
2721 /* Allocate registers if they don't already exist. */ 2736 /* Allocate registers if they don't already exist. */
@@ -2746,42 +2761,52 @@ LIST should have been created by calling `match-data' previously. */)
2746 2761
2747 search_regs.num_regs = length; 2762 search_regs.num_regs = length;
2748 } 2763 }
2749 }
2750
2751 for (i = 0; i < search_regs.num_regs; i++)
2752 {
2753 marker = Fcar (list);
2754 if (NILP (marker))
2755 {
2756 search_regs.start[i] = -1;
2757 list = Fcdr (list);
2758 }
2759 else
2760 {
2761 int from;
2762
2763 if (MARKERP (marker))
2764 {
2765 if (XMARKER (marker)->buffer == 0)
2766 XSETFASTINT (marker, 0);
2767 else
2768 XSETBUFFER (last_thing_searched, XMARKER (marker)->buffer);
2769 }
2770
2771 CHECK_NUMBER_COERCE_MARKER (marker);
2772 from = XINT (marker);
2773 list = Fcdr (list);
2774 2764
2775 marker = Fcar (list); 2765 for (i = 0;; i++)
2776 if (MARKERP (marker) && XMARKER (marker)->buffer == 0) 2766 {
2777 XSETFASTINT (marker, 0); 2767 marker = Fcar (list);
2768 if (BUFFERP(marker))
2769 {
2770 XSETBUFFER(last_thing_searched, marker);
2771 break;
2772 }
2773 if (i >= length)
2774 break;
2775 if (NILP (marker))
2776 {
2777 search_regs.start[i] = -1;
2778 list = Fcdr (list);
2779 }
2780 else
2781 {
2782 int from;
2783
2784 if (MARKERP (marker))
2785 {
2786 if (XMARKER (marker)->buffer == 0)
2787 XSETFASTINT (marker, 0);
2788 else
2789 XSETBUFFER (last_thing_searched, XMARKER (marker)->buffer);
2790 }
2791
2792 CHECK_NUMBER_COERCE_MARKER (marker);
2793 from = XINT (marker);
2794 list = Fcdr (list);
2795
2796 marker = Fcar (list);
2797 if (MARKERP (marker) && XMARKER (marker)->buffer == 0)
2798 XSETFASTINT (marker, 0);
2799
2800 CHECK_NUMBER_COERCE_MARKER (marker);
2801 search_regs.start[i] = from;
2802 search_regs.end[i] = XINT (marker);
2803 }
2804 list = Fcdr (list);
2805 }
2778 2806
2779 CHECK_NUMBER_COERCE_MARKER (marker); 2807 for (; i < search_regs.num_regs; i++)
2780 search_regs.start[i] = from; 2808 search_regs.start[i] = -1;
2781 search_regs.end[i] = XINT (marker); 2809 }
2782 }
2783 list = Fcdr (list);
2784 }
2785 2810
2786 return Qnil; 2811 return Qnil;
2787} 2812}
@@ -2790,6 +2815,7 @@ LIST should have been created by calling `match-data' previously. */)
2790 during the execution of a sentinel or filter. */ 2815 during the execution of a sentinel or filter. */
2791static int search_regs_saved; 2816static int search_regs_saved;
2792static struct re_registers saved_search_regs; 2817static struct re_registers saved_search_regs;
2818static Lisp_Object saved_last_thing_searched;
2793 2819
2794/* Called from Flooking_at, Fstring_match, search_buffer, Fstore_match_data 2820/* Called from Flooking_at, Fstring_match, search_buffer, Fstore_match_data
2795 if asynchronous code (filter or sentinel) is running. */ 2821 if asynchronous code (filter or sentinel) is running. */
@@ -2801,6 +2827,8 @@ save_search_regs ()
2801 saved_search_regs.num_regs = search_regs.num_regs; 2827 saved_search_regs.num_regs = search_regs.num_regs;
2802 saved_search_regs.start = search_regs.start; 2828 saved_search_regs.start = search_regs.start;
2803 saved_search_regs.end = search_regs.end; 2829 saved_search_regs.end = search_regs.end;
2830 saved_last_thing_searched = last_thing_searched;
2831 last_thing_searched = Qnil;
2804 search_regs.num_regs = 0; 2832 search_regs.num_regs = 0;
2805 search_regs.start = 0; 2833 search_regs.start = 0;
2806 search_regs.end = 0; 2834 search_regs.end = 0;
@@ -2823,7 +2851,8 @@ restore_match_data ()
2823 search_regs.num_regs = saved_search_regs.num_regs; 2851 search_regs.num_regs = saved_search_regs.num_regs;
2824 search_regs.start = saved_search_regs.start; 2852 search_regs.start = saved_search_regs.start;
2825 search_regs.end = saved_search_regs.end; 2853 search_regs.end = saved_search_regs.end;
2826 2854 last_thing_searched = saved_last_thing_searched;
2855 saved_last_thing_searched = Qnil;
2827 search_regs_saved = 0; 2856 search_regs_saved = 0;
2828 } 2857 }
2829} 2858}
diff --git a/src/w32fns.c b/src/w32fns.c
index a5f8c4b61f3..d3342f3ad6a 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -7749,7 +7749,8 @@ file_dialog_callback (hwnd, msg, wParam, lParam)
7749 { 7749 {
7750 OFNOTIFY * notify = (OFNOTIFY *)lParam; 7750 OFNOTIFY * notify = (OFNOTIFY *)lParam;
7751 /* Detect when the Filter dropdown is changed. */ 7751 /* Detect when the Filter dropdown is changed. */
7752 if (notify->hdr.code == CDN_TYPECHANGE) 7752 if (notify->hdr.code == CDN_TYPECHANGE
7753 || notify->hdr.code == CDN_INITDONE)
7753 { 7754 {
7754 HWND dialog = GetParent (hwnd); 7755 HWND dialog = GetParent (hwnd);
7755 HWND edit_control = GetDlgItem (dialog, FILE_NAME_TEXT_FIELD); 7756 HWND edit_control = GetDlgItem (dialog, FILE_NAME_TEXT_FIELD);
@@ -7763,8 +7764,10 @@ file_dialog_callback (hwnd, msg, wParam, lParam)
7763 } 7764 }
7764 else 7765 else
7765 { 7766 {
7766 CommDlg_OpenSave_SetControlText (dialog, FILE_NAME_TEXT_FIELD, 7767 /* Don't override default filename on init done. */
7767 ""); 7768 if (notify->hdr.code == CDN_TYPECHANGE)
7769 CommDlg_OpenSave_SetControlText (dialog,
7770 FILE_NAME_TEXT_FIELD, "");
7768 EnableWindow (edit_control, TRUE); 7771 EnableWindow (edit_control, TRUE);
7769 } 7772 }
7770 } 7773 }
@@ -7786,6 +7789,7 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */)
7786 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 7789 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
7787 char filename[MAX_PATH + 1]; 7790 char filename[MAX_PATH + 1];
7788 char init_dir[MAX_PATH + 1]; 7791 char init_dir[MAX_PATH + 1];
7792 int default_filter_index = 1; /* 1: All Files, 2: Directories only */
7789 7793
7790 GCPRO5 (prompt, dir, default_filename, mustmatch, file); 7794 GCPRO5 (prompt, dir, default_filename, mustmatch, file);
7791 CHECK_STRING (prompt); 7795 CHECK_STRING (prompt);
@@ -7809,9 +7813,7 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */)
7809 if (!file_name_only) 7813 if (!file_name_only)
7810 file_name_only = full_path_name; 7814 file_name_only = full_path_name;
7811 else 7815 else
7812 { 7816 file_name_only++;
7813 file_name_only++;
7814 }
7815 7817
7816 strncpy (filename, file_name_only, MAX_PATH); 7818 strncpy (filename, file_name_only, MAX_PATH);
7817 filename[MAX_PATH] = '\0'; 7819 filename[MAX_PATH] = '\0';
@@ -7836,6 +7838,15 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */)
7836 file_details.nMaxFile = sizeof (filename); 7838 file_details.nMaxFile = sizeof (filename);
7837 file_details.lpstrInitialDir = init_dir; 7839 file_details.lpstrInitialDir = init_dir;
7838 file_details.lpstrTitle = SDATA (prompt); 7840 file_details.lpstrTitle = SDATA (prompt);
7841
7842 /* If prompt starts with Dired, default to directories only. */
7843 /* A bit hacky, but there doesn't seem to be a better way to
7844 DTRT for dired. */
7845 if (strncmp (file_details.lpstrTitle, "Dired", 5) == 0)
7846 default_filter_index = 2;
7847
7848 file_details.nFilterIndex = default_filter_index;
7849
7839 file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR 7850 file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR
7840 | OFN_EXPLORER | OFN_ENABLEHOOK); 7851 | OFN_EXPLORER | OFN_ENABLEHOOK);
7841 if (!NILP (mustmatch)) 7852 if (!NILP (mustmatch))
@@ -7848,7 +7859,7 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */)
7848 dostounix_filename (filename); 7859 dostounix_filename (filename);
7849 if (file_details.nFilterIndex == 2) 7860 if (file_details.nFilterIndex == 2)
7850 { 7861 {
7851 /* "Folder Only" selected - strip dummy file name. */ 7862 /* "Directories" selected - strip dummy file name. */
7852 char * last = strrchr (filename, '/'); 7863 char * last = strrchr (filename, '/');
7853 *last = '\0'; 7864 *last = '\0';
7854 } 7865 }
diff --git a/src/xdisp.c b/src/xdisp.c
index 41e00893c30..c95493d5aa3 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -6426,6 +6426,7 @@ add_to_log (format, arg1, arg2)
6426 char *buffer; 6426 char *buffer;
6427 int len; 6427 int len;
6428 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 6428 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
6429 USE_SAFE_ALLOCA;
6429 6430
6430 /* Do nothing if called asynchronously. Inserting text into 6431 /* Do nothing if called asynchronously. Inserting text into
6431 a buffer may call after-change-functions and alike and 6432 a buffer may call after-change-functions and alike and
@@ -6442,10 +6443,12 @@ add_to_log (format, arg1, arg2)
6442 msg = Fformat (3, args); 6443 msg = Fformat (3, args);
6443 6444
6444 len = SBYTES (msg) + 1; 6445 len = SBYTES (msg) + 1;
6445 buffer = (char *) alloca (len); 6446 SAFE_ALLOCA (buffer, char *, len);
6446 bcopy (SDATA (msg), buffer, len); 6447 bcopy (SDATA (msg), buffer, len);
6447 6448
6448 message_dolog (buffer, len - 1, 1, 0); 6449 message_dolog (buffer, len - 1, 1, 0);
6450 SAFE_FREE (len);
6451
6449 UNGCPRO; 6452 UNGCPRO;
6450} 6453}
6451 6454