aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaroly Lorentey2004-08-31 16:31:03 +0000
committerKaroly Lorentey2004-08-31 16:31:03 +0000
commit8328a03d0cf23b4851e22e3c45d4d24106916766 (patch)
tree8c8f6f0a95f6fbc5b677193e936c31834e800bef
parentbfe3b03c6a537ffbdfa25e3b16acd40ae6a833ef (diff)
parent2aa2f8b8c979787390f8ebf6ebe22fa81bbe7c06 (diff)
downloademacs-8328a03d0cf23b4851e22e3c45d4d24106916766.tar.gz
emacs-8328a03d0cf23b4851e22e3c45d4d24106916766.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-509 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-510 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-511 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-512 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-513 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-514 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-515 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-516 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-517 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-518 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-239
-rw-r--r--admin/ChangeLog11
-rw-r--r--admin/FOR-RELEASE6
-rw-r--r--etc/ChangeLog4
-rw-r--r--etc/MH-E-NEWS6
-rw-r--r--etc/NEWS7
-rw-r--r--lisp/ChangeLog96
-rw-r--r--lisp/calendar/time-date.el1
-rw-r--r--lisp/emacs-lisp/lisp-mode.el48
-rw-r--r--lisp/emulation/cua-base.el91
-rw-r--r--lisp/emulation/cua-rect.el388
-rw-r--r--lisp/ielm.el6
-rw-r--r--lisp/indent.el4
-rw-r--r--lisp/international/utf-8.el6
-rw-r--r--lisp/mh-e/ChangeLog35
-rw-r--r--lisp/mh-e/mh-acros.el13
-rw-r--r--lisp/mh-e/mh-customize.el7
-rw-r--r--lisp/mh-e/mh-e.el5
-rw-r--r--lisp/mh-e/mh-init.el4
-rw-r--r--lisp/mh-e/mh-loaddefs.el28
-rw-r--r--lisp/mh-e/mh-mime.el4
-rw-r--r--lisp/progmodes/etags.el20
-rw-r--r--lisp/progmodes/grep.el23
-rw-r--r--lisp/subr.el21
-rw-r--r--lisp/textmodes/tex-mode.el16
-rw-r--r--lispref/ChangeLog6
-rw-r--r--lispref/abbrevs.texi53
-rw-r--r--lwlib/ChangeLog4
-rw-r--r--lwlib/lwlib.h2
-rw-r--r--man/ChangeLog73
-rw-r--r--man/ack.texi2
-rw-r--r--man/building.texi8
-rw-r--r--man/cmdargs.texi2
-rw-r--r--man/commands.texi8
-rw-r--r--man/custom.texi12
-rw-r--r--man/doclicense.texi3
-rw-r--r--man/emacs.texi198
-rw-r--r--man/entering.texi8
-rw-r--r--man/faq.texi129
-rw-r--r--man/frames.texi24
-rw-r--r--man/indent.texi48
-rw-r--r--man/killing.texi8
-rw-r--r--man/misc.texi13
-rw-r--r--man/programs.texi2
-rw-r--r--man/trouble.texi12
-rw-r--r--man/windows.texi42
-rw-r--r--src/ChangeLog45
-rw-r--r--src/fileio.c2
-rw-r--r--src/gtkutil.c2
-rw-r--r--src/gtkutil.h2
-rw-r--r--src/macfns.c216
-rw-r--r--src/macmenu.c95
-rw-r--r--src/xmenu.c56
52 files changed, 1258 insertions, 667 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog
index b164f414a88..dafae3c1158 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,6 +1,15 @@
12004-08-29 Kim F. Storm <storm@cua.dk>
2
3 * FOR-RELEASE (Documentation): Add man/ack.texi and AUTHORS.
4
52004-08-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
6
7 * FOR-RELEASE (Indications): Remove entry about GTK and geometry,
8 (now behaves as well as other ports).
9
12004-06-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 102004-06-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 11
3 * FOR-RELEASE: Removed entry about GTK and monochrome displays (done). 12 * FOR-RELEASE: Remove entry about GTK and monochrome displays (done).
4 13
52002-06-26 Eli Zaretskii <eliz@is.elta.co.il> 142002-06-26 Eli Zaretskii <eliz@is.elta.co.il>
6 15
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index 2d5738a8683..fbbacaf6456 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -14,6 +14,10 @@ Tasks needed before the next release.
14 14
15** Update man/info.texi. 15** Update man/info.texi.
16 16
17** Update man/ack.texi.
18
19** Update AUTHORS.
20
17 21
18* NEW FEATURES 22* NEW FEATURES
19 23
@@ -38,8 +42,6 @@ isearch faces.
38 42
39* GTK RELATED BUGS 43* GTK RELATED BUGS
40 44
41** Make geometry specifications work correctly for GTK.
42
43** Make GTK scrollbars behave like others w.r.t. overscrolling. 45** Make GTK scrollbars behave like others w.r.t. overscrolling.
44 46
45 47
diff --git a/etc/ChangeLog b/etc/ChangeLog
index cd7888b1a4a..48c6da4e32d 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
12004-08-24 Bill Wohler <wohler@newt.com>
2
3 * NEWS, MH-E-NEWS: Upgraded to MH-E version 7.82.
4
12004-08-22 David Kastrup <dak@gnu.org> 52004-08-22 David Kastrup <dak@gnu.org>
2 6
3 * PROBLEMS, MAILINGLISTS: Update AUCTeX information. 7 * PROBLEMS, MAILINGLISTS: Update AUCTeX information.
diff --git a/etc/MH-E-NEWS b/etc/MH-E-NEWS
index 32b71b1d98c..f82bf4cb045 100644
--- a/etc/MH-E-NEWS
+++ b/etc/MH-E-NEWS
@@ -6,6 +6,12 @@ Copying and distribution of this file, with or without modification,
6are permitted in any medium without royalty provided the copyright 6are permitted in any medium without royalty provided the copyright
7notice and this notice are preserved. 7notice and this notice are preserved.
8 8
9* Changes in MH-E 7.82
10
11Version 7.82 continues to address the saga surrounding the use of CL
12macros in CVS Emacs and fixes the auto-detection of vanilla MH (SF
13#1014781).
14
9* Changes in MH-E 7.81 15* Changes in MH-E 7.81
10 16
11Version 7.81 fixes a `wrong-type-argument' argument error that 17Version 7.81 fixes a `wrong-type-argument' argument error that
diff --git a/etc/NEWS b/etc/NEWS
index 932cf3d3fa8..5995bf3dd97 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -194,6 +194,11 @@ just put point at the end of the buffer and it stays there. This
194rule applies to file buffers. For non-file buffers, the behavior may 194rule applies to file buffers. For non-file buffers, the behavior may
195be mode dependent. 195be mode dependent.
196 196
197If you are sure that the file will only change by growing at the end,
198then you can tail the file more efficiently by using the new minor
199mode Auto Revert Tail mode. The function `auto-revert-tail-mode'
200toggles this mode.
201
197** Auto Revert mode is now more careful to avoid excessive reverts and 202** Auto Revert mode is now more careful to avoid excessive reverts and
198other potential problems when deciding which non-file buffers to 203other potential problems when deciding which non-file buffers to
199revert. This matters especially if Global Auto Revert mode is enabled 204revert. This matters especially if Global Auto Revert mode is enabled
@@ -660,7 +665,7 @@ You can now put the init files .emacs and .emacs_SHELL under
660 665
661** MH-E changes. 666** MH-E changes.
662 667
663Upgraded to MH-E version 7.81. There have been major changes since 668Upgraded to MH-E version 7.82. There have been major changes since
664version 5.0.2; see MH-E-NEWS for details. 669version 5.0.2; see MH-E-NEWS for details.
665 670
666+++ 671+++
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a0dcde78786..e6b3e1f60a7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,92 @@
12004-08-30 John Paul Wallington <jpw@gnu.org>
2
3 * textmodes/tex-mode.el (tex-validate-buffer): Use distinct
4 strings rather than programatically constructing message.
5
62004-08-30 Richard M. Stallman <rms@gnu.org>
7
8 * emacs-lisp/lisp-mode.el (prin1-char): Don't turn S-a into A.
9 Don't return a string that would read as the wrong character code.
10
112004-08-29 Kim F. Storm <storm@cua.dk>
12
13 * emulation/cua-base.el (cua-auto-expand-rectangles): Remove
14 automatic rectangle padding feature; replace by non-destructive
15 virtual rectangle edges feature.
16 (cua-virtual-rectangle-edges): New defcustom.
17 (cua-auto-tabify-rectangles): New defcustom.
18 (cua-paste): If paste into a marked rectangle, insert rectangle at
19 current column, even if virtual; also paste exactly as many lines
20 as has been marked (ignore additional lines or add empty lines),
21 but paste whole source if only one line is marked.
22 (cua--update-indications): No longer use overwrite-cursor to
23 indicate rectangle padding
24
25 * emulation/cua-rect.el (cua--rectangle-padding): Remove.
26 (cua--rectangle-virtual-edges): New defun.
27 (cua--rectangle-get-corners): Remove optional PAD arg.
28 (cua--rectangle-set-corners): Never do padding.
29 (cua--forward-line): Remove optional PAD arg. Simplify.
30 (cua-resize-rectangle-right, cua-resize-rectangle-left)
31 (cua-resize-rectangle-down, cua-resize-rectangle-up):
32 (cua-resize-rectangle-bot, cua-resize-rectangle-top)
33 (cua-resize-rectangle-page-up, cua-resize-rectangle-page-down)
34 (cua--rectangle-move): Never do padding. Simplify.
35 (cua--tabify-start): New defun.
36 (cua--rectangle-operation): Add tabify arg. All callers changed.
37 (cua--pad-rectangle): Remove.
38 (cua--delete-rectangle): Handle delete with virtual edges.
39 (cua--extract-rectangle): Add spaces if rectangle has virtual edges.
40 (cua--insert-rectangle): Handle insert at virtual column.
41 Perform auto-tabify if necessary.
42 (cua--activate-rectangle): Remove optional FORCE arg.
43 Never do padding. Simplify.
44 (cua--highlight-rectangle): Enhance for virtual edges.
45 (cua-toggle-rectangle-padding): Remove command.
46 (cua-toggle-rectangle-virtual-edges): New command.
47 (cua-sequence-rectangle): Add optional TABIFY arg. Callers changed.
48 (cua--rectangle-post-command): Don't force rectangle padding.
49 (cua--init-rectangles): Bind M-p to cua-toggle-rectangle-virtual-edges.
50
512004-08-28 Luc Teirlinck <teirllm@auburn.edu>
52
53 * indent.el (edit-tab-stops-buffer): Doc fix.
54
552004-08-28 Richard M. Stallman <rms@gnu.org>
56
57 * progmodes/grep.el (grep-default-command): Use find-tag-default.
58 (grep-tag-default): Function deleted.
59
60 * subr.el (find-tag-default): Moved from etags.el.
61
62 * progmodes/etags.el (find-tag-default): Moved to subr.el.
63
64 * emacs-lisp/lisp-mode.el (prin1-char): Put `shift' modifier
65 into the basic character if it has an uppercase form.
66
672004-08-27 Kenichi Handa <handa@m17n.org>
68
69 * international/utf-8.el (utf-8-post-read-conversion): If the
70 buffer is unibyte, temporarily make it multibyte.
71
722004-08-27 Masatake YAMATO <jet@gyve.org>
73
74 * calendar/time-date.el (time-to-seconds): Add autoload cookies.
75
762004-08-25 John Paul Wallington <jpw@gnu.org>
77
78 * textmodes/tex-mode.el (tex-validate-buffer): Distinguish between
79 0, 1, and many mismatches in message.
80 (tex-start-shell): Use `set-process-query-on-exit-flag'.
81
82 * ielm.el (ielm-tab, ielm-complete-symbol): Doc fix.
83 (inferior-emacs-lisp-mode): Use `set-process-query-on-exit-flag'.
84
852004-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
86
87 * vc-svn.el (vc-svn-diff): Treat options from vc-svn-diff-switches and
88 vc-diff-switches differently.
89
12004-08-22 Luc Teirlinck <teirllm@auburn.edu> 902004-08-22 Luc Teirlinck <teirllm@auburn.edu>
2 91
3 * speedbar.el (speedbar-file-regexp): Give it a phony defvar 92 * speedbar.el (speedbar-file-regexp): Give it a phony defvar
@@ -7,8 +96,8 @@
7 96
82004-08-22 Richard M. Stallman <rms@gnu.org> 972004-08-22 Richard M. Stallman <rms@gnu.org>
9 98
10 * textmodes/flyspell.el (flyspell-word): Use 99 * textmodes/flyspell.el (flyspell-word):
11 set-process-query-on-exit-flag. 100 Use set-process-query-on-exit-flag.
12 (flyspell-highlight-duplicate-region): Take POSS as arg. 101 (flyspell-highlight-duplicate-region): Take POSS as arg.
13 (flyspell-word): Pass POSS as arg. 102 (flyspell-word): Pass POSS as arg.
14 103
@@ -51,8 +140,7 @@
51 140
522004-08-22 Andreas Schwab <schwab@suse.de> 1412004-08-22 Andreas Schwab <schwab@suse.de>
53 142
54 * cvs-status.el: Require pcvs during byte-compiling for 143 * cvs-status.el: Require pcvs during byte-compiling for defun-cvs-mode.
55 defun-cvs-mode.
56 144
572004-08-22 Masatake YAMATO <jet@gyve.org> 1452004-08-22 Masatake YAMATO <jet@gyve.org>
58 146
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index 846231befe6..6439089273a 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -45,6 +45,7 @@
45 (timezone-make-date-arpa-standard date))) 45 (timezone-make-date-arpa-standard date)))
46 (error (error "Invalid date: %s" date)))) 46 (error (error "Invalid date: %s" date))))
47 47
48;;;###autoload
48(defun time-to-seconds (time) 49(defun time-to-seconds (time)
49 "Convert time value TIME to a floating point number. 50 "Convert time value TIME to a floating point number.
50You can use `float-time' instead." 51You can use `float-time' instead."
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index df05555ae7b..e2aac327ddc 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -363,7 +363,7 @@ if that value is non-nil."
363 (when (stringp default) 363 (when (stringp default)
364 (if (string-match ":+" default) 364 (if (string-match ":+" default)
365 (substring default (match-end 0)) 365 (substring default (match-end 0))
366 default)))) 366 default))))
367 367
368;; Used in old LispM code. 368;; Used in old LispM code.
369(defalias 'common-lisp-mode 'lisp-mode) 369(defalias 'common-lisp-mode 'lisp-mode)
@@ -459,21 +459,37 @@ alternative printed representations that can be displayed."
459If CHAR is not a character, return nil." 459If CHAR is not a character, return nil."
460 (and (integerp char) 460 (and (integerp char)
461 (eventp char) 461 (eventp char)
462 (let ((c (event-basic-type char))) 462 (let ((c (event-basic-type char))
463 (concat 463 (mods (event-modifiers char))
464 "?" 464 string)
465 (mapconcat 465 ;; Prevent ?A from turning into ?\S-a.
466 (lambda (modif) 466 (if (and (memq 'shift mods)
467 (cond ((eq modif 'super) "\\s-") 467 (zerop (logand char ?\S-\^@))
468 (t (string ?\\ (upcase (aref (symbol-name modif) 0)) ?-)))) 468 (not (let ((case-fold-search nil))
469 (event-modifiers char) "") 469 (char-equal c (upcase c)))))
470 (cond 470 (setq c (upcase c) mods nil))
471 ((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c)) 471 ;; What string are we considering using?
472 ((eq c 127) "\\C-?") 472 (condition-case nil
473 (t 473 (setq string
474 (condition-case nil 474 (concat
475 (string c) 475 "?"
476 (error nil)))))))) 476 (mapconcat
477 (lambda (modif)
478 (cond ((eq modif 'super) "\\s-")
479 (t (string ?\\ (upcase (aref (symbol-name modif) 0)) ?-))))
480 mods "")
481 (cond
482 ((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c))
483 ((eq c 127) "\\C-?")
484 (t
485 (string c)))))
486 (error nil))
487 ;; Verify the string reads a CHAR, not to some other character.
488 ;; If it doesn't, return nil instead.
489 (and string
490 (= (car (read-from-string string)) char)
491 string))))
492
477 493
478(defun eval-last-sexp-1 (eval-last-sexp-arg-internal) 494(defun eval-last-sexp-1 (eval-last-sexp-arg-internal)
479 "Evaluate sexp before point; print value in minibuffer. 495 "Evaluate sexp before point; print value in minibuffer.
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index b39945c7712..fb3c537936f 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -141,30 +141,39 @@
141;; completely separate set of "rectangle commands" [C-x r ...] on the 141;; completely separate set of "rectangle commands" [C-x r ...] on the
142;; region to copy, kill, fill a.s.o. the virtual rectangle. 142;; region to copy, kill, fill a.s.o. the virtual rectangle.
143;; 143;;
144;; cua-mode's superior rectangle support is based on using a true visual 144;; cua-mode's superior rectangle support uses a true visual
145;; representation of the selected rectangle. To start a rectangle, use 145;; representation of the selected rectangle, i.e. it highlights the
146;; [S-return] and extend it using the normal movement keys (up, down, 146;; actual part of the buffer that is currently selected as part of the
147;; left, right, home, end, C-home, C-end). Once the rectangle has the 147;; rectangle. Unlike emacs' traditional rectangle commands, the
148;; desired size, you can cut or copy it using C-x and C-c (or C-w and M-w), 148;; selected rectangle always as straight left and right edges, even
149;; and you can subsequently insert it - as a rectangle - using C-v (or 149;; when those are in the middle of a TAB character or beyond the end
150;; C-y). So the only new command you need to know to work with 150;; of the current line. And it does this without actually modifying
151;; cua-mode rectangles is S-return! 151;; the buffer contents (it uses display overlays to visualize the
152;; virtual dimensions of the rectangle).
153;;
154;; This means that cua-mode's rectangles are not limited to the actual
155;; contents of the buffer, so if the cursor is currently at the end of a
156;; short line, you can still extend the rectangle to include more columns
157;; of longer lines in the same rectangle. And you can also have the
158;; left edge of a rectangle start in the middle of a TAB character.
159;; Sounds strange? Try it!
160;;
161;; To start a rectangle, use [S-return] and extend it using the normal
162;; movement keys (up, down, left, right, home, end, C-home,
163;; C-end). Once the rectangle has the desired size, you can cut or
164;; copy it using C-x and C-c (or C-w and M-w), and you can
165;; subsequently insert it - as a rectangle - using C-v (or C-y). So
166;; the only new command you need to know to work with cua-mode
167;; rectangles is S-return!
152;; 168;;
153;; Normally, when you paste a rectangle using C-v (C-y), each line of 169;; Normally, when you paste a rectangle using C-v (C-y), each line of
154;; the rectangle is inserted into the existing lines in the buffer. 170;; the rectangle is inserted into the existing lines in the buffer.
155;; If overwrite-mode is active when you paste a rectangle, it is 171;; If overwrite-mode is active when you paste a rectangle, it is
156;; inserted as normal (multi-line) text. 172;; inserted as normal (multi-line) text.
157;; 173;;
158;; Furthermore, cua-mode's rectangles are not limited to the actual 174;; If you prefer the traditional rectangle marking (i.e. don't want
159;; contents of the buffer, so if the cursor is currently at the end of a 175;; straight edges), [M-p] toggles this for the current rectangle,
160;; short line, you can still extend the rectangle to include more columns 176;; or you can customize cua-virtual-rectangle-edges.
161;; of longer lines in the same rectangle. Sounds strange? Try it!
162;;
163;; You can enable padding for just this rectangle by pressing [M-p];
164;; this works like entering `picture-mode' where the tabs and spaces
165;; are automatically converted/inserted to make the rectangle truly
166;; rectangular. Or you can do it for all rectangles by setting the
167;; `cua-auto-expand-rectangles' variable.
168 177
169;; And there's more: If you want to extend or reduce the size of the 178;; And there's more: If you want to extend or reduce the size of the
170;; rectangle in one of the other corners of the rectangle, just use 179;; rectangle in one of the other corners of the rectangle, just use
@@ -204,8 +213,8 @@
204;; a supplied format string (prompt) 213;; a supplied format string (prompt)
205;; [M-o] opens the rectangle by moving the highlighted text to the 214;; [M-o] opens the rectangle by moving the highlighted text to the
206;; right of the rectangle and filling the rectangle with blanks. 215;; right of the rectangle and filling the rectangle with blanks.
207;; [M-p] toggles rectangle padding, i.e. insert tabs and spaces to 216;; [M-p] toggles virtual straight rectangle edges
208;; make rectangles truly rectangular 217;; [M-P] inserts tabs and spaces (padding) to make real straight edges
209;; [M-q] performs text filling on the rectangle 218;; [M-q] performs text filling on the rectangle
210;; [M-r] replaces REGEXP (prompt) by STRING (prompt) in rectangle 219;; [M-r] replaces REGEXP (prompt) by STRING (prompt) in rectangle
211;; [M-R] reverse the lines in the rectangle 220;; [M-R] reverse the lines in the rectangle
@@ -347,14 +356,27 @@ managers, so try setting this to nil, if prefix override doesn't work."
347 356
348;;; Rectangle Customization 357;;; Rectangle Customization
349 358
350(defcustom cua-auto-expand-rectangles nil 359(defcustom cua-virtual-rectangle-edges t
351 "*If non-nil, rectangles are padded with spaces to make straight edges. 360 "*If non-nil, rectangles have virtual straight edges.
352This implies modifying buffer contents by expanding tabs and inserting spaces. 361Note that although rectangles are always DISPLAYED with straight edges, the
353Consequently, this is inhibited in read-only buffers. 362buffer is NOT modified, until you execute a command that actually modifies it.
354Can be toggled by [M-p] while the rectangle is active," 363\[M-p] toggles this feature when a rectangle is active."
355 :type 'boolean 364 :type 'boolean
356 :group 'cua) 365 :group 'cua)
357 366
367(defcustom cua-auto-tabify-rectangles 1000
368 "*If non-nil, automatically tabify after rectangle commands.
369This basically means that `tabify' is applied to all lines that
370are modified by inserting or deleting a rectangle. If value is
371an integer, cua will look for existing tabs in a region around
372the rectangle, and only do the conversion if any tabs are already
373present. The number specifies then number of characters before
374and after the region marked by the rectangle to search."
375 :type '(choice (number :tag "Auto detect (limit)")
376 (const :tag "Disabled" nil)
377 (other :tag "Enabled" t))
378 :group 'cua)
379
358(defcustom cua-enable-rectangle-auto-help t 380(defcustom cua-enable-rectangle-auto-help t
359 "*If non-nil, automatically show help for region, rectangle and global mark." 381 "*If non-nil, automatically show help for region, rectangle and global mark."
360 :type 'boolean 382 :type 'boolean
@@ -412,7 +434,6 @@ Can be toggled by [M-p] while the rectangle is active,"
412 (frame-parameter nil 'cursor-color) 434 (frame-parameter nil 'cursor-color)
413 "red") 435 "red")
414 "Normal (non-overwrite) cursor color. 436 "Normal (non-overwrite) cursor color.
415Also used to indicate that rectangle padding is not in effect.
416Default is to load cursor color from initial or default frame parameters. 437Default is to load cursor color from initial or default frame parameters.
417 438
418If the value is a COLOR name, then only the `cursor-color' attribute will be 439If the value is a COLOR name, then only the `cursor-color' attribute will be
@@ -462,7 +483,6 @@ a cons (TYPE . COLOR), then both properties are affected."
462 483
463(defcustom cua-overwrite-cursor-color "yellow" 484(defcustom cua-overwrite-cursor-color "yellow"
464 "*Cursor color used when overwrite mode is set, if non-nil. 485 "*Cursor color used when overwrite mode is set, if non-nil.
465Also used to indicate that rectangle padding is in effect.
466Only used when `cua-enable-cursor-indications' is non-nil. 486Only used when `cua-enable-cursor-indications' is non-nil.
467 487
468If the value is a COLOR name, then only the `cursor-color' attribute will be 488If the value is a COLOR name, then only the `cursor-color' attribute will be
@@ -806,7 +826,8 @@ If global mark is active, copy from register or one character."
806 (interactive "P") 826 (interactive "P")
807 (setq arg (cua--prefix-arg arg)) 827 (setq arg (cua--prefix-arg arg))
808 (let ((regtxt (and cua--register (get-register cua--register))) 828 (let ((regtxt (and cua--register (get-register cua--register)))
809 (count (prefix-numeric-value arg))) 829 (count (prefix-numeric-value arg))
830 paste-column paste-lines)
810 (cond 831 (cond
811 ((and cua--register (not regtxt)) 832 ((and cua--register (not regtxt))
812 (message "Nothing in register %c" cua--register)) 833 (message "Nothing in register %c" cua--register))
@@ -825,7 +846,12 @@ If global mark is active, copy from register or one character."
825 ;; the same region that we are going to delete. 846 ;; the same region that we are going to delete.
826 ;; That would make yank a no-op. 847 ;; That would make yank a no-op.
827 (if cua--rectangle 848 (if cua--rectangle
828 (cua--delete-rectangle) 849 (progn
850 (goto-char (min (mark) (point)))
851 (setq paste-column (cua--rectangle-left))
852 (setq paste-lines (cua--delete-rectangle))
853 (if (= paste-lines 1)
854 (setq paste-lines nil))) ;; paste all
829 (if (string= (buffer-substring (point) (mark)) 855 (if (string= (buffer-substring (point) (mark))
830 (car kill-ring)) 856 (car kill-ring))
831 (current-kill 1)) 857 (current-kill 1))
@@ -843,7 +869,8 @@ If global mark is active, copy from register or one character."
843 (setq this-command 'cua--paste-rectangle) 869 (setq this-command 'cua--paste-rectangle)
844 (undo-boundary) 870 (undo-boundary)
845 (setq buffer-undo-list (cons pt buffer-undo-list))) 871 (setq buffer-undo-list (cons pt buffer-undo-list)))
846 (cua--insert-rectangle (cdr cua--last-killed-rectangle)) 872 (cua--insert-rectangle (cdr cua--last-killed-rectangle)
873 nil paste-column paste-lines)
847 (if arg (goto-char pt)))) 874 (if arg (goto-char pt))))
848 (t (yank arg))))))) 875 (t (yank arg)))))))
849 876
@@ -1033,9 +1060,7 @@ If ARG is the atom `-', scroll upward by nearly full screen."
1033 ((and buffer-read-only 1060 ((and buffer-read-only
1034 cua-read-only-cursor-color) 1061 cua-read-only-cursor-color)
1035 cua-read-only-cursor-color) 1062 cua-read-only-cursor-color)
1036 ((and cua-overwrite-cursor-color 1063 ((and cua-overwrite-cursor-color overwrite-mode)
1037 (or overwrite-mode
1038 (and cua--rectangle (cua--rectangle-padding))))
1039 cua-overwrite-cursor-color) 1064 cua-overwrite-cursor-color)
1040 (t cua-normal-cursor-color))) 1065 (t cua-normal-cursor-color)))
1041 (color (if (consp cursor) (cdr cursor) cursor)) 1066 (color (if (consp cursor) (cdr cursor) cursor))
diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el
index 965fe63bced..626ef22cf2d 100644
--- a/lisp/emulation/cua-rect.el
+++ b/lisp/emulation/cua-rect.el
@@ -44,10 +44,10 @@
44(require 'rect) 44(require 'rect)
45 45
46;; If non-nil, restrict current region to this rectangle. 46;; If non-nil, restrict current region to this rectangle.
47;; Value is a vector [top bot left right corner ins pad select]. 47;; Value is a vector [top bot left right corner ins virt select].
48;; CORNER specifies currently active corner 0=t/l 1=t/r 2=b/l 3=b/r. 48;; CORNER specifies currently active corner 0=t/l 1=t/r 2=b/l 3=b/r.
49;; INS specifies whether to insert on left(nil) or right(t) side. 49;; INS specifies whether to insert on left(nil) or right(t) side.
50;; If PAD is non-nil, tabs are converted to spaces when necessary. 50;; If VIRT is non-nil, virtual straight edges are enabled.
51;; If SELECT is a regexp, only lines starting with that regexp are affected.") 51;; If SELECT is a regexp, only lines starting with that regexp are affected.")
52(defvar cua--rectangle nil) 52(defvar cua--rectangle nil)
53(make-variable-buffer-local 'cua--rectangle) 53(make-variable-buffer-local 'cua--rectangle)
@@ -65,6 +65,8 @@
65(defvar cua--rectangle-overlays nil) 65(defvar cua--rectangle-overlays nil)
66(make-variable-buffer-local 'cua--rectangle-overlays) 66(make-variable-buffer-local 'cua--rectangle-overlays)
67 67
68(defvar cua--virtual-edges-debug nil)
69
68;; Per-buffer CUA mode undo list. 70;; Per-buffer CUA mode undo list.
69(defvar cua--undo-list nil) 71(defvar cua--undo-list nil)
70(make-variable-buffer-local 'cua--undo-list) 72(make-variable-buffer-local 'cua--undo-list)
@@ -97,7 +99,7 @@ Knows about CUA rectangle highlighting in addition to standard undo."
97(defvar cua--tidy-undo-counter 0 99(defvar cua--tidy-undo-counter 0
98 "Number of times `cua--tidy-undo-lists' have run successfully.") 100 "Number of times `cua--tidy-undo-lists' have run successfully.")
99 101
100;; Clean out danling entries from cua's undo list. 102;; Clean out dangling entries from cua's undo list.
101;; Since this list contains pointers into the standard undo list, 103;; Since this list contains pointers into the standard undo list,
102;; such references are only meningful as undo information if the 104;; such references are only meningful as undo information if the
103;; corresponding entry is still on the standard undo list. 105;; corresponding entry is still on the standard undo list.
@@ -203,11 +205,11 @@ Knows about CUA rectangle highlighting in addition to standard undo."
203 (aref cua--rectangle 5)) 205 (aref cua--rectangle 5))
204 (cua--rectangle-left)))) 206 (cua--rectangle-left))))
205 207
206(defun cua--rectangle-padding (&optional set val) 208(defun cua--rectangle-virtual-edges (&optional set val)
207 ;; Current setting of rectangle padding 209 ;; Current setting of rectangle virtual-edges
208 (if set 210 (if set
209 (aset cua--rectangle 6 val)) 211 (aset cua--rectangle 6 val))
210 (and (not buffer-read-only) 212 (and ;(not buffer-read-only)
211 (aref cua--rectangle 6))) 213 (aref cua--rectangle 6)))
212 214
213(defun cua--rectangle-restriction (&optional val bounded negated) 215(defun cua--rectangle-restriction (&optional val bounded negated)
@@ -226,7 +228,7 @@ Knows about CUA rectangle highlighting in addition to standard undo."
226 (if (< (cua--rectangle-bot) (cua--rectangle-top)) 228 (if (< (cua--rectangle-bot) (cua--rectangle-top))
227 (message "rectangle bot < top"))) 229 (message "rectangle bot < top")))
228 230
229(defun cua--rectangle-get-corners (&optional pad) 231(defun cua--rectangle-get-corners ()
230 ;; Calculate the rectangular region represented by point and mark, 232 ;; Calculate the rectangular region represented by point and mark,
231 ;; putting start in the upper left corner and end in the 233 ;; putting start in the upper left corner and end in the
232 ;; bottom right corner. 234 ;; bottom right corner.
@@ -245,12 +247,12 @@ Knows about CUA rectangle highlighting in addition to standard undo."
245 (setq r (1- r))) 247 (setq r (1- r)))
246 (setq l (prog1 r (setq r l))) 248 (setq l (prog1 r (setq r l)))
247 (goto-char top) 249 (goto-char top)
248 (move-to-column l pad) 250 (move-to-column l)
249 (setq top (point)) 251 (setq top (point))
250 (goto-char bot) 252 (goto-char bot)
251 (move-to-column r pad) 253 (move-to-column r)
252 (setq bot (point)))) 254 (setq bot (point))))
253 (vector top bot l r corner 0 pad nil))) 255 (vector top bot l r corner 0 cua-virtual-rectangle-edges nil)))
254 256
255(defun cua--rectangle-set-corners () 257(defun cua--rectangle-set-corners ()
256 ;; Set mark and point in opposite corners of current rectangle. 258 ;; Set mark and point in opposite corners of current rectangle.
@@ -269,24 +271,21 @@ Knows about CUA rectangle highlighting in addition to standard undo."
269 (setq pp (cua--rectangle-bot) pc (cua--rectangle-right) 271 (setq pp (cua--rectangle-bot) pc (cua--rectangle-right)
270 mp (cua--rectangle-top) mc (cua--rectangle-left)))) 272 mp (cua--rectangle-top) mc (cua--rectangle-left))))
271 (goto-char mp) 273 (goto-char mp)
272 (move-to-column mc (cua--rectangle-padding)) 274 (move-to-column mc)
273 (set-mark (point)) 275 (set-mark (point))
274 (goto-char pp) 276 (goto-char pp)
275 (move-to-column pc (cua--rectangle-padding)))) 277 (move-to-column pc)
278 ))
276 279
277;;; Rectangle resizing 280;;; Rectangle resizing
278 281
279(defun cua--forward-line (n pad) 282(defun cua--forward-line (n)
280 ;; Move forward/backward one line. Returns t if movement. 283 ;; Move forward/backward one line. Returns t if movement.
281 (if (or (not pad) (< n 0)) 284 (= (forward-line n) 0))
282 (= (forward-line n) 0)
283 (next-line 1)
284 t))
285 285
286(defun cua--rectangle-resized () 286(defun cua--rectangle-resized ()
287 ;; Refresh state after resizing rectangle 287 ;; Refresh state after resizing rectangle
288 (setq cua--buffer-and-point-before-command nil) 288 (setq cua--buffer-and-point-before-command nil)
289 (cua--pad-rectangle)
290 (cua--rectangle-insert-col 0) 289 (cua--rectangle-insert-col 0)
291 (cua--rectangle-set-corners) 290 (cua--rectangle-set-corners)
292 (cua--keep-active)) 291 (cua--keep-active))
@@ -294,47 +293,35 @@ Knows about CUA rectangle highlighting in addition to standard undo."
294(defun cua-resize-rectangle-right (n) 293(defun cua-resize-rectangle-right (n)
295 "Resize rectangle to the right." 294 "Resize rectangle to the right."
296 (interactive "p") 295 (interactive "p")
297 (let ((pad (cua--rectangle-padding)) (resized (> n 0))) 296 (let ((resized (> n 0)))
298 (while (> n 0) 297 (while (> n 0)
299 (setq n (1- n)) 298 (setq n (1- n))
300 (cond 299 (cond
301 ((and (cua--rectangle-right-side) (or pad (eolp)))
302 (cua--rectangle-right (1+ (cua--rectangle-right)))
303 (move-to-column (cua--rectangle-right) pad))
304 ((cua--rectangle-right-side) 300 ((cua--rectangle-right-side)
305 (forward-char 1) 301 (cua--rectangle-right (1+ (cua--rectangle-right)))
306 (cua--rectangle-right (current-column))) 302 (move-to-column (cua--rectangle-right)))
307 ((or pad (eolp))
308 (cua--rectangle-left (1+ (cua--rectangle-left)))
309 (move-to-column (cua--rectangle-right) pad))
310 (t 303 (t
311 (forward-char 1) 304 (cua--rectangle-left (1+ (cua--rectangle-left)))
312 (cua--rectangle-left (current-column))))) 305 (move-to-column (cua--rectangle-right)))))
313 (if resized 306 (if resized
314 (cua--rectangle-resized)))) 307 (cua--rectangle-resized))))
315 308
316(defun cua-resize-rectangle-left (n) 309(defun cua-resize-rectangle-left (n)
317 "Resize rectangle to the left." 310 "Resize rectangle to the left."
318 (interactive "p") 311 (interactive "p")
319 (let ((pad (cua--rectangle-padding)) resized) 312 (let (resized)
320 (while (> n 0) 313 (while (> n 0)
321 (setq n (1- n)) 314 (setq n (1- n))
322 (if (or (= (cua--rectangle-right) 0) 315 (if (or (= (cua--rectangle-right) 0)
323 (and (not (cua--rectangle-right-side)) (= (cua--rectangle-left) 0))) 316 (and (not (cua--rectangle-right-side)) (= (cua--rectangle-left) 0)))
324 (setq n 0) 317 (setq n 0)
325 (cond 318 (cond
326 ((and (cua--rectangle-right-side) (or pad (eolp) (bolp)))
327 (cua--rectangle-right (1- (cua--rectangle-right)))
328 (move-to-column (cua--rectangle-right) pad))
329 ((cua--rectangle-right-side) 319 ((cua--rectangle-right-side)
330 (backward-char 1) 320 (cua--rectangle-right (1- (cua--rectangle-right)))
331 (cua--rectangle-right (current-column))) 321 (move-to-column (cua--rectangle-right)))
332 ((or pad (eolp) (bolp))
333 (cua--rectangle-left (1- (cua--rectangle-left)))
334 (move-to-column (cua--rectangle-right) pad))
335 (t 322 (t
336 (backward-char 1) 323 (cua--rectangle-left (1- (cua--rectangle-left)))
337 (cua--rectangle-left (current-column)))) 324 (move-to-column (cua--rectangle-right))))
338 (setq resized t))) 325 (setq resized t)))
339 (if resized 326 (if resized
340 (cua--rectangle-resized)))) 327 (cua--rectangle-resized))))
@@ -342,20 +329,20 @@ Knows about CUA rectangle highlighting in addition to standard undo."
342(defun cua-resize-rectangle-down (n) 329(defun cua-resize-rectangle-down (n)
343 "Resize rectangle downwards." 330 "Resize rectangle downwards."
344 (interactive "p") 331 (interactive "p")
345 (let ((pad (cua--rectangle-padding)) resized) 332 (let (resized)
346 (while (> n 0) 333 (while (> n 0)
347 (setq n (1- n)) 334 (setq n (1- n))
348 (cond 335 (cond
349 ((>= (cua--rectangle-corner) 2) 336 ((>= (cua--rectangle-corner) 2)
350 (goto-char (cua--rectangle-bot)) 337 (goto-char (cua--rectangle-bot))
351 (when (cua--forward-line 1 pad) 338 (when (cua--forward-line 1)
352 (move-to-column (cua--rectangle-column) pad) 339 (move-to-column (cua--rectangle-column))
353 (cua--rectangle-bot t) 340 (cua--rectangle-bot t)
354 (setq resized t))) 341 (setq resized t)))
355 (t 342 (t
356 (goto-char (cua--rectangle-top)) 343 (goto-char (cua--rectangle-top))
357 (when (cua--forward-line 1 pad) 344 (when (cua--forward-line 1)
358 (move-to-column (cua--rectangle-column) pad) 345 (move-to-column (cua--rectangle-column))
359 (cua--rectangle-top t) 346 (cua--rectangle-top t)
360 (setq resized t))))) 347 (setq resized t)))))
361 (if resized 348 (if resized
@@ -364,20 +351,20 @@ Knows about CUA rectangle highlighting in addition to standard undo."
364(defun cua-resize-rectangle-up (n) 351(defun cua-resize-rectangle-up (n)
365 "Resize rectangle upwards." 352 "Resize rectangle upwards."
366 (interactive "p") 353 (interactive "p")
367 (let ((pad (cua--rectangle-padding)) resized) 354 (let (resized)
368 (while (> n 0) 355 (while (> n 0)
369 (setq n (1- n)) 356 (setq n (1- n))
370 (cond 357 (cond
371 ((>= (cua--rectangle-corner) 2) 358 ((>= (cua--rectangle-corner) 2)
372 (goto-char (cua--rectangle-bot)) 359 (goto-char (cua--rectangle-bot))
373 (when (cua--forward-line -1 pad) 360 (when (cua--forward-line -1)
374 (move-to-column (cua--rectangle-column) pad) 361 (move-to-column (cua--rectangle-column))
375 (cua--rectangle-bot t) 362 (cua--rectangle-bot t)
376 (setq resized t))) 363 (setq resized t)))
377 (t 364 (t
378 (goto-char (cua--rectangle-top)) 365 (goto-char (cua--rectangle-top))
379 (when (cua--forward-line -1 pad) 366 (when (cua--forward-line -1)
380 (move-to-column (cua--rectangle-column) pad) 367 (move-to-column (cua--rectangle-column))
381 (cua--rectangle-top t) 368 (cua--rectangle-top t)
382 (setq resized t))))) 369 (setq resized t)))))
383 (if resized 370 (if resized
@@ -408,7 +395,7 @@ Knows about CUA rectangle highlighting in addition to standard undo."
408 "Resize rectangle to bottom of buffer." 395 "Resize rectangle to bottom of buffer."
409 (interactive) 396 (interactive)
410 (goto-char (point-max)) 397 (goto-char (point-max))
411 (move-to-column (cua--rectangle-column) (cua--rectangle-padding)) 398 (move-to-column (cua--rectangle-column))
412 (cua--rectangle-bot t) 399 (cua--rectangle-bot t)
413 (cua--rectangle-resized)) 400 (cua--rectangle-resized))
414 401
@@ -416,31 +403,29 @@ Knows about CUA rectangle highlighting in addition to standard undo."
416 "Resize rectangle to top of buffer." 403 "Resize rectangle to top of buffer."
417 (interactive) 404 (interactive)
418 (goto-char (point-min)) 405 (goto-char (point-min))
419 (move-to-column (cua--rectangle-column) (cua--rectangle-padding)) 406 (move-to-column (cua--rectangle-column))
420 (cua--rectangle-top t) 407 (cua--rectangle-top t)
421 (cua--rectangle-resized)) 408 (cua--rectangle-resized))
422 409
423(defun cua-resize-rectangle-page-up () 410(defun cua-resize-rectangle-page-up ()
424 "Resize rectangle upwards by one scroll page." 411 "Resize rectangle upwards by one scroll page."
425 (interactive) 412 (interactive)
426 (let ((pad (cua--rectangle-padding))) 413 (scroll-down)
427 (scroll-down) 414 (move-to-column (cua--rectangle-column))
428 (move-to-column (cua--rectangle-column) pad) 415 (if (>= (cua--rectangle-corner) 2)
429 (if (>= (cua--rectangle-corner) 2) 416 (cua--rectangle-bot t)
430 (cua--rectangle-bot t) 417 (cua--rectangle-top t))
431 (cua--rectangle-top t)) 418 (cua--rectangle-resized))
432 (cua--rectangle-resized)))
433 419
434(defun cua-resize-rectangle-page-down () 420(defun cua-resize-rectangle-page-down ()
435 "Resize rectangle downwards by one scroll page." 421 "Resize rectangle downwards by one scroll page."
436 (interactive) 422 (interactive)
437 (let ((pad (cua--rectangle-padding))) 423 (scroll-up)
438 (scroll-up) 424 (move-to-column (cua--rectangle-column))
439 (move-to-column (cua--rectangle-column) pad) 425 (if (>= (cua--rectangle-corner) 2)
440 (if (>= (cua--rectangle-corner) 2) 426 (cua--rectangle-bot t)
441 (cua--rectangle-bot t) 427 (cua--rectangle-top t))
442 (cua--rectangle-top t)) 428 (cua--rectangle-resized))
443 (cua--rectangle-resized)))
444 429
445;;; Mouse support 430;;; Mouse support
446 431
@@ -450,7 +435,8 @@ Knows about CUA rectangle highlighting in addition to standard undo."
450 "Set rectangle corner at mouse click position." 435 "Set rectangle corner at mouse click position."
451 (interactive "e") 436 (interactive "e")
452 (mouse-set-point event) 437 (mouse-set-point event)
453 (if (cua--rectangle-padding) 438 ;; FIX ME -- need to calculate virtual column.
439 (if (cua--rectangle-virtual-edges)
454 (move-to-column (car (posn-col-row (event-end event))) t)) 440 (move-to-column (car (posn-col-row (event-end event))) t))
455 (if (cua--rectangle-right-side) 441 (if (cua--rectangle-right-side)
456 (cua--rectangle-right (current-column)) 442 (cua--rectangle-right (current-column))
@@ -470,6 +456,7 @@ Knows about CUA rectangle highlighting in addition to standard undo."
470 (cua--deactivate t)) 456 (cua--deactivate t))
471 (setq cua--last-rectangle nil) 457 (setq cua--last-rectangle nil)
472 (mouse-set-point event) 458 (mouse-set-point event)
459 ;; FIX ME -- need to calculate virtual column.
473 (cua-set-rectangle-mark) 460 (cua-set-rectangle-mark)
474 (setq cua--buffer-and-point-before-command nil) 461 (setq cua--buffer-and-point-before-command nil)
475 (setq cua--mouse-last-pos nil)) 462 (setq cua--mouse-last-pos nil))
@@ -489,13 +476,13 @@ If command is repeated at same position, delete the rectangle."
489 (let ((cua-keep-region-after-copy t)) 476 (let ((cua-keep-region-after-copy t))
490 (cua-copy-rectangle arg) 477 (cua-copy-rectangle arg)
491 (setq cua--mouse-last-pos (cons (point) cua--last-killed-rectangle))))) 478 (setq cua--mouse-last-pos (cons (point) cua--last-killed-rectangle)))))
479
492(defun cua--mouse-ignore (event) 480(defun cua--mouse-ignore (event)
493 (interactive "e") 481 (interactive "e")
494 (setq this-command last-command)) 482 (setq this-command last-command))
495 483
496(defun cua--rectangle-move (dir) 484(defun cua--rectangle-move (dir)
497 (let ((pad (cua--rectangle-padding)) 485 (let ((moved t)
498 (moved t)
499 (top (cua--rectangle-top)) 486 (top (cua--rectangle-top))
500 (bot (cua--rectangle-bot)) 487 (bot (cua--rectangle-bot))
501 (l (cua--rectangle-left)) 488 (l (cua--rectangle-left))
@@ -503,17 +490,17 @@ If command is repeated at same position, delete the rectangle."
503 (cond 490 (cond
504 ((eq dir 'up) 491 ((eq dir 'up)
505 (goto-char top) 492 (goto-char top)
506 (when (cua--forward-line -1 pad) 493 (when (cua--forward-line -1)
507 (cua--rectangle-top t) 494 (cua--rectangle-top t)
508 (goto-char bot) 495 (goto-char bot)
509 (forward-line -1) 496 (forward-line -1)
510 (cua--rectangle-bot t))) 497 (cua--rectangle-bot t)))
511 ((eq dir 'down) 498 ((eq dir 'down)
512 (goto-char bot) 499 (goto-char bot)
513 (when (cua--forward-line 1 pad) 500 (when (cua--forward-line 1)
514 (cua--rectangle-bot t) 501 (cua--rectangle-bot t)
515 (goto-char top) 502 (goto-char top)
516 (cua--forward-line 1 pad) 503 (cua--forward-line 1)
517 (cua--rectangle-top t))) 504 (cua--rectangle-top t)))
518 ((eq dir 'left) 505 ((eq dir 'left)
519 (when (> l 0) 506 (when (> l 0)
@@ -526,19 +513,37 @@ If command is repeated at same position, delete the rectangle."
526 (setq moved nil))) 513 (setq moved nil)))
527 (when moved 514 (when moved
528 (setq cua--buffer-and-point-before-command nil) 515 (setq cua--buffer-and-point-before-command nil)
529 (cua--pad-rectangle)
530 (cua--rectangle-set-corners) 516 (cua--rectangle-set-corners)
531 (cua--keep-active)))) 517 (cua--keep-active))))
532 518
533 519
534;;; Operations on current rectangle 520;;; Operations on current rectangle
535 521
536(defun cua--rectangle-operation (keep-clear visible undo pad &optional fct post-fct) 522(defun cua--tabify-start (start end)
523 ;; Return position where auto-tabify should start (or nil if not required).
524 (save-excursion
525 (save-restriction
526 (widen)
527 (and (not buffer-read-only)
528 cua-auto-tabify-rectangles
529 (if (or (not (integerp cua-auto-tabify-rectangles))
530 (= (point-min) (point-max))
531 (progn
532 (goto-char (max (point-min)
533 (- start cua-auto-tabify-rectangles)))
534 (search-forward "\t" (min (point-max)
535 (+ end cua-auto-tabify-rectangles)) t)))
536 start)))))
537
538(defun cua--rectangle-operation (keep-clear visible undo pad tabify &optional fct post-fct)
537 ;; Call FCT for each line of region with 4 parameters: 539 ;; Call FCT for each line of region with 4 parameters:
538 ;; Region start, end, left-col, right-col 540 ;; Region start, end, left-col, right-col
539 ;; Point is at start when FCT is called 541 ;; Point is at start when FCT is called
542 ;; Call fct with (s,e) = whole lines if VISIBLE non-nil.
543 ;; Only call fct for visible lines if VISIBLE==t.
540 ;; Set undo boundary if UNDO is non-nil. 544 ;; Set undo boundary if UNDO is non-nil.
541 ;; Rectangle is padded if PAD = t or numeric and (cua--rectangle-padding) 545 ;; Rectangle is padded if PAD = t or numeric and (cua--rectangle-virtual-edges)
546 ;; Perform auto-tabify after operation if TABIFY is non-nil.
542 ;; Mark is kept if keep-clear is 'keep and cleared if keep-clear is 'clear. 547 ;; Mark is kept if keep-clear is 'keep and cleared if keep-clear is 'clear.
543 (let* ((start (cua--rectangle-top)) 548 (let* ((start (cua--rectangle-top))
544 (end (cua--rectangle-bot)) 549 (end (cua--rectangle-bot))
@@ -546,11 +551,12 @@ If command is repeated at same position, delete the rectangle."
546 (r (1+ (cua--rectangle-right))) 551 (r (1+ (cua--rectangle-right)))
547 (m (make-marker)) 552 (m (make-marker))
548 (tabpad (and (integerp pad) (= pad 2))) 553 (tabpad (and (integerp pad) (= pad 2)))
549 (sel (cua--rectangle-restriction))) 554 (sel (cua--rectangle-restriction))
555 (tabify-start (and tabify (cua--tabify-start start end))))
550 (if undo 556 (if undo
551 (cua--rectangle-undo-boundary)) 557 (cua--rectangle-undo-boundary))
552 (if (integerp pad) 558 (if (integerp pad)
553 (setq pad (cua--rectangle-padding))) 559 (setq pad (cua--rectangle-virtual-edges)))
554 (save-excursion 560 (save-excursion
555 (save-restriction 561 (save-restriction
556 (widen) 562 (widen)
@@ -558,7 +564,7 @@ If command is repeated at same position, delete the rectangle."
558 (goto-char end) 564 (goto-char end)
559 (and (bolp) (not (eolp)) (not (eobp)) 565 (and (bolp) (not (eolp)) (not (eobp))
560 (setq end (1+ end)))) 566 (setq end (1+ end))))
561 (when visible 567 (when (eq visible t)
562 (setq start (max (window-start) start)) 568 (setq start (max (window-start) start))
563 (setq end (min (window-end) end))) 569 (setq end (min (window-end) end)))
564 (goto-char end) 570 (goto-char end)
@@ -575,7 +581,7 @@ If command is repeated at same position, delete the rectangle."
575 (forward-char 1)) 581 (forward-char 1))
576 (set-marker m (point)) 582 (set-marker m (point))
577 (move-to-column l pad) 583 (move-to-column l pad)
578 (if (and fct (>= (current-column) l) (<= (current-column) r)) 584 (if (and fct (or visible (and (>= (current-column) l) (<= (current-column) r))))
579 (let ((v t) (p (point))) 585 (let ((v t) (p (point)))
580 (when sel 586 (when sel
581 (if (car (cdr sel)) 587 (if (car (cdr sel))
@@ -585,8 +591,7 @@ If command is repeated at same position, delete the rectangle."
585 (if (car (cdr (cdr sel))) 591 (if (car (cdr (cdr sel)))
586 (setq v (null v)))) 592 (setq v (null v))))
587 (if visible 593 (if visible
588 (unless (eolp) 594 (funcall fct p m l r v)
589 (funcall fct p m l r v))
590 (if v 595 (if v
591 (funcall fct p m l r))))) 596 (funcall fct p m l r)))))
592 (set-marker m nil) 597 (set-marker m nil)
@@ -594,7 +599,9 @@ If command is repeated at same position, delete the rectangle."
594 (if (not visible) 599 (if (not visible)
595 (cua--rectangle-bot t)) 600 (cua--rectangle-bot t))
596 (if post-fct 601 (if post-fct
597 (funcall post-fct l r)))) 602 (funcall post-fct l r))
603 (when tabify-start
604 (tabify tabify-start (point)))))
598 (cond 605 (cond
599 ((eq keep-clear 'keep) 606 ((eq keep-clear 'keep)
600 (cua--keep-active)) 607 (cua--keep-active))
@@ -607,48 +614,96 @@ If command is repeated at same position, delete the rectangle."
607 614
608(put 'cua--rectangle-operation 'lisp-indent-function 4) 615(put 'cua--rectangle-operation 'lisp-indent-function 4)
609 616
610(defun cua--pad-rectangle (&optional pad)
611 (if (or pad (cua--rectangle-padding))
612 (cua--rectangle-operation nil nil t t)))
613
614(defun cua--delete-rectangle () 617(defun cua--delete-rectangle ()
615 (cua--rectangle-operation nil nil t 2 618 (let ((lines 0))
616 '(lambda (s e l r) 619 (if (not (cua--rectangle-virtual-edges))
617 (if (and (> e s) (<= e (point-max))) 620 (cua--rectangle-operation nil nil t 2 t
618 (delete-region s e))))) 621 '(lambda (s e l r v)
622 (setq lines (1+ lines))
623 (if (and (> e s) (<= e (point-max)))
624 (delete-region s e))))
625 (cua--rectangle-operation nil 1 t nil t
626 '(lambda (s e l r v)
627 (setq lines (1+ lines))
628 (when (and (> e s) (<= e (point-max)))
629 (delete-region s e)))))
630 lines))
619 631
620(defun cua--extract-rectangle () 632(defun cua--extract-rectangle ()
621 (let (rect) 633 (let (rect)
622 (cua--rectangle-operation nil nil nil 1 634 (if (not (cua--rectangle-virtual-edges))
623 '(lambda (s e l r) 635 (cua--rectangle-operation nil nil nil nil nil ; do not tabify
624 (setq rect (cons (buffer-substring-no-properties s e) rect)))) 636 '(lambda (s e l r)
625 (nreverse rect))) 637 (setq rect (cons (buffer-substring-no-properties s e) rect))))
626 638 (cua--rectangle-operation nil 1 nil nil nil ; do not tabify
627(defun cua--insert-rectangle (rect &optional below) 639 '(lambda (s e l r v)
640 (let ((copy t) (bs 0) (as 0) row)
641 (if (= s e) (setq e (1+ e)))
642 (goto-char s)
643 (move-to-column l)
644 (if (= (point) (line-end-position))
645 (setq bs (- r l)
646 copy nil)
647 (skip-chars-forward "\s\t" e)
648 (setq bs (- (min r (current-column)) l)
649 s (point))
650 (move-to-column r)
651 (skip-chars-backward "\s\t" s)
652 (setq as (- r (max (current-column) l))
653 e (point)))
654 (setq row (if (and copy (> e s))
655 (buffer-substring-no-properties s e)
656 ""))
657 (when (> bs 0)
658 (setq row (concat (make-string bs ?\s) row)))
659 (when (> as 0)
660 (setq row (concat row (make-string as ?\s))))
661 (setq rect (cons row rect))))))
662 (nreverse rect)))
663
664(defun cua--insert-rectangle (rect &optional below paste-column line-count)
628 ;; Insert rectangle as insert-rectangle, but don't set mark and exit with 665 ;; Insert rectangle as insert-rectangle, but don't set mark and exit with
629 ;; point at either next to top right or below bottom left corner 666 ;; point at either next to top right or below bottom left corner
630 ;; Notice: In overwrite mode, the rectangle is inserted as separate text lines. 667 ;; Notice: In overwrite mode, the rectangle is inserted as separate text lines.
631 (if (and below (eq below 'auto)) 668 (if (eq below 'auto)
632 (setq below (and (bolp) 669 (setq below (and (bolp)
633 (or (eolp) (eobp) (= (1+ (point)) (point-max)))))) 670 (or (eolp) (eobp) (= (1+ (point)) (point-max))))))
671 (unless paste-column
672 (setq paste-column (current-column)))
634 (let ((lines rect) 673 (let ((lines rect)
635 (insertcolumn (current-column))
636 (first t) 674 (first t)
675 (tabify-start (cua--tabify-start (point) (point)))
676 last-column
637 p) 677 p)
638 (while (or lines below) 678 (while (or lines below)
639 (or first 679 (or first
640 (if overwrite-mode 680 (if overwrite-mode
641 (insert ?\n) 681 (insert ?\n)
642 (forward-line 1) 682 (forward-line 1)
643 (or (bolp) (insert ?\n)) 683 (or (bolp) (insert ?\n))))
644 (move-to-column insertcolumn t))) 684 (unless overwrite-mode
685 (move-to-column paste-column t))
645 (if (not lines) 686 (if (not lines)
646 (setq below nil) 687 (setq below nil)
647 (insert-for-yank (car lines)) 688 (insert-for-yank (car lines))
689 (unless last-column
690 (setq last-column (current-column)))
648 (setq lines (cdr lines)) 691 (setq lines (cdr lines))
649 (and first (not below) 692 (and first (not below)
650 (setq p (point)))) 693 (setq p (point))))
651 (setq first nil)) 694 (setq first nil)
695 (if (and line-count (= (setq line-count (1- line-count)) 0))
696 (setq lines nil)))
697 (when (and line-count last-column (not overwrite-mode))
698 (while (> line-count 0)
699 (forward-line 1)
700 (or (bolp) (insert ?\n))
701 (move-to-column paste-column t)
702 (insert-char ?\s (- last-column paste-column -1))
703 (setq line-count (1- line-count))))
704 (when (and tabify-start
705 (not overwrite-mode))
706 (tabify tabify-start (point)))
652 (and p (not overwrite-mode) 707 (and p (not overwrite-mode)
653 (goto-char p)))) 708 (goto-char p))))
654 709
@@ -662,7 +717,7 @@ If command is repeated at same position, delete the rectangle."
662 (function (lambda (row) (concat row "\n"))) 717 (function (lambda (row) (concat row "\n")))
663 killed-rectangle ""))))) 718 killed-rectangle "")))))
664 719
665(defun cua--activate-rectangle (&optional force) 720(defun cua--activate-rectangle ()
666 ;; Turn on rectangular marking mode by disabling transient mark mode 721 ;; Turn on rectangular marking mode by disabling transient mark mode
667 ;; and manually handling highlighting from a post command hook. 722 ;; and manually handling highlighting from a post command hook.
668 ;; Be careful if we are already marking a rectangle. 723 ;; Be careful if we are already marking a rectangle.
@@ -671,12 +726,8 @@ If command is repeated at same position, delete the rectangle."
671 (eq (car cua--last-rectangle) (current-buffer)) 726 (eq (car cua--last-rectangle) (current-buffer))
672 (eq (car (cdr cua--last-rectangle)) (point))) 727 (eq (car (cdr cua--last-rectangle)) (point)))
673 (cdr (cdr cua--last-rectangle)) 728 (cdr (cdr cua--last-rectangle))
674 (cua--rectangle-get-corners 729 (cua--rectangle-get-corners))
675 (and (not buffer-read-only) 730 cua--status-string (if (cua--rectangle-virtual-edges) " [R]" "")
676 (or cua-auto-expand-rectangles
677 force
678 (eq major-mode 'picture-mode)))))
679 cua--status-string (if (cua--rectangle-padding) " Pad" "")
680 cua--last-rectangle nil)) 731 cua--last-rectangle nil))
681 732
682;; (defvar cua-save-point nil) 733;; (defvar cua-save-point nil)
@@ -698,7 +749,7 @@ If command is repeated at same position, delete the rectangle."
698 ;; Each overlay extends across all the columns of the rectangle. 749 ;; Each overlay extends across all the columns of the rectangle.
699 ;; We try to reuse overlays where possible because this is more efficient 750 ;; We try to reuse overlays where possible because this is more efficient
700 ;; and results in less flicker. 751 ;; and results in less flicker.
701 ;; If cua--rectangle-padding is nil and the buffer contains tabs or short lines, 752 ;; If cua--rectangle-virtual-edges is nil and the buffer contains tabs or short lines,
702 ;; the higlighted region may not be perfectly rectangular. 753 ;; the higlighted region may not be perfectly rectangular.
703 (let ((deactivate-mark deactivate-mark) 754 (let ((deactivate-mark deactivate-mark)
704 (old cua--rectangle-overlays) 755 (old cua--rectangle-overlays)
@@ -707,12 +758,59 @@ If command is repeated at same position, delete the rectangle."
707 (right (1+ (cua--rectangle-right)))) 758 (right (1+ (cua--rectangle-right))))
708 (when (/= left right) 759 (when (/= left right)
709 (sit-for 0) ; make window top/bottom reliable 760 (sit-for 0) ; make window top/bottom reliable
710 (cua--rectangle-operation nil t nil nil 761 (cua--rectangle-operation nil t nil nil nil ; do not tabify
711 '(lambda (s e l r v) 762 '(lambda (s e l r v)
712 (let ((rface (if v 'cua-rectangle-face 'cua-rectangle-noselect-face)) 763 (let ((rface (if v 'cua-rectangle-face 'cua-rectangle-noselect-face))
713 overlay) 764 overlay bs as)
714 ;; Trim old leading overlays.
715 (if (= s e) (setq e (1+ e))) 765 (if (= s e) (setq e (1+ e)))
766 (when (cua--rectangle-virtual-edges)
767 (let ((lb (line-beginning-position))
768 (le (line-end-position))
769 cl cl0 pl cr cr0 pr)
770 (goto-char s)
771 (setq cl (move-to-column l)
772 pl (point))
773 (setq cr (move-to-column r)
774 pr (point))
775 (if (= lb pl)
776 (setq cl0 0)
777 (goto-char (1- pl))
778 (setq cl0 (current-column)))
779 (if (= lb le)
780 (setq cr0 0)
781 (goto-char (1- pr))
782 (setq cr0 (current-column)))
783 (unless (and (= cl l) (= cr r))
784 (when (/= cl l)
785 (setq bs (propertize
786 (make-string
787 (- l cl0 (if (and (= le pl) (/= le lb)) 1 0))
788 (if cua--virtual-edges-debug ?. ?\s))
789 'face 'default))
790 (if (/= pl le)
791 (setq s (1- s))))
792 (cond
793 ((= cr r)
794 (if (and (/= cr0 (1- cr))
795 (= (mod cr tab-width) 0))
796 (setq e (1- e))))
797 ((= cr cl)
798 (setq bs (concat bs
799 (propertize
800 (make-string
801 (- r l)
802 (if cua--virtual-edges-debug ?, ?\s))
803 'face rface)))
804 (setq rface nil))
805 (t
806 (setq as (propertize
807 (make-string
808 (- r cr0 (if (= le pr) 1 0))
809 (if cua--virtual-edges-debug ?~ ?\s))
810 'face rface))
811 (if (/= pr le)
812 (setq e (1- e))))))))
813 ;; Trim old leading overlays.
716 (while (and old 814 (while (and old
717 (setq overlay (car old)) 815 (setq overlay (car old))
718 (< (overlay-start overlay) s) 816 (< (overlay-start overlay) s)
@@ -728,8 +826,10 @@ If command is repeated at same position, delete the rectangle."
728 (move-overlay overlay s e) 826 (move-overlay overlay s e)
729 (setq old (cdr old))) 827 (setq old (cdr old)))
730 (setq overlay (make-overlay s e))) 828 (setq overlay (make-overlay s e)))
731 (overlay-put overlay 'face rface) 829 (overlay-put overlay 'before-string bs)
732 (setq new (cons overlay new)))))) 830 (overlay-put overlay 'after-string as)
831 (overlay-put overlay 'face rface)
832 (setq new (cons overlay new))))))
733 ;; Trim old trailing overlays. 833 ;; Trim old trailing overlays.
734 (mapcar (function delete-overlay) old) 834 (mapcar (function delete-overlay) old)
735 (setq cua--rectangle-overlays (nreverse new)))) 835 (setq cua--rectangle-overlays (nreverse new))))
@@ -737,9 +837,9 @@ If command is repeated at same position, delete the rectangle."
737(defun cua--indent-rectangle (&optional ch to-col clear) 837(defun cua--indent-rectangle (&optional ch to-col clear)
738 ;; Indent current rectangle. 838 ;; Indent current rectangle.
739 (let ((col (cua--rectangle-insert-col)) 839 (let ((col (cua--rectangle-insert-col))
740 (pad (cua--rectangle-padding)) 840 (pad (cua--rectangle-virtual-edges))
741 indent) 841 indent)
742 (cua--rectangle-operation (if clear 'clear 'corners) nil t pad 842 (cua--rectangle-operation (if clear 'clear 'corners) nil t pad t
743 '(lambda (s e l r) 843 '(lambda (s e l r)
744 (move-to-column col pad) 844 (move-to-column col pad)
745 (if (and (eolp) 845 (if (and (eolp)
@@ -877,21 +977,18 @@ With prefix argument, the toggle restriction."
877 (cua--rectangle-corner (if (= (cua--rectangle-left) (cua--rectangle-right)) 0 1)) 977 (cua--rectangle-corner (if (= (cua--rectangle-left) (cua--rectangle-right)) 0 1))
878 (cua--rectangle-set-corners)) 978 (cua--rectangle-set-corners))
879 979
880(defun cua-toggle-rectangle-padding () 980(defun cua-toggle-rectangle-virtual-edges ()
881 (interactive) 981 (interactive)
882 (if buffer-read-only 982 (cua--rectangle-virtual-edges t (not (cua--rectangle-virtual-edges)))
883 (message "Cannot do padding in read-only buffer.") 983 (cua--rectangle-set-corners)
884 (cua--rectangle-padding t (not (cua--rectangle-padding))) 984 (setq cua--status-string (and (cua--rectangle-virtual-edges) " [R]"))
885 (cua--pad-rectangle)
886 (cua--rectangle-set-corners))
887 (setq cua--status-string (and (cua--rectangle-padding) " Pad"))
888 (cua--keep-active)) 985 (cua--keep-active))
889 986
890(defun cua-do-rectangle-padding () 987(defun cua-do-rectangle-padding ()
891 (interactive) 988 (interactive)
892 (if buffer-read-only 989 (if buffer-read-only
893 (message "Cannot do padding in read-only buffer.") 990 (message "Cannot do padding in read-only buffer.")
894 (cua--pad-rectangle t) 991 (cua--rectangle-operation nil nil t t t)
895 (cua--rectangle-set-corners)) 992 (cua--rectangle-set-corners))
896 (cua--keep-active)) 993 (cua--keep-active))
897 994
@@ -900,7 +997,7 @@ With prefix argument, the toggle restriction."
900The text previously in the region is not overwritten by the blanks, 997The text previously in the region is not overwritten by the blanks,
901but instead winds up to the right of the rectangle." 998but instead winds up to the right of the rectangle."
902 (interactive) 999 (interactive)
903 (cua--rectangle-operation 'corners nil t 1 1000 (cua--rectangle-operation 'corners nil t 1 nil
904 '(lambda (s e l r) 1001 '(lambda (s e l r)
905 (skip-chars-forward " \t") 1002 (skip-chars-forward " \t")
906 (let ((ws (- (current-column) l)) 1003 (let ((ws (- (current-column) l))
@@ -915,7 +1012,7 @@ On each line in the rectangle, all continuous whitespace starting
915at that column is deleted. 1012at that column is deleted.
916With prefix arg, also delete whitespace to the left of that column." 1013With prefix arg, also delete whitespace to the left of that column."
917 (interactive "P") 1014 (interactive "P")
918 (cua--rectangle-operation 'clear nil t 1 1015 (cua--rectangle-operation 'clear nil t 1 nil
919 '(lambda (s e l r) 1016 '(lambda (s e l r)
920 (when arg 1017 (when arg
921 (skip-syntax-backward " " (line-beginning-position)) 1018 (skip-syntax-backward " " (line-beginning-position))
@@ -927,7 +1024,7 @@ With prefix arg, also delete whitespace to the left of that column."
927 "Blank out CUA rectangle. 1024 "Blank out CUA rectangle.
928The text previously in the rectangle is overwritten by the blanks." 1025The text previously in the rectangle is overwritten by the blanks."
929 (interactive) 1026 (interactive)
930 (cua--rectangle-operation 'keep nil nil 1 1027 (cua--rectangle-operation 'keep nil nil 1 nil
931 '(lambda (s e l r) 1028 '(lambda (s e l r)
932 (goto-char e) 1029 (goto-char e)
933 (skip-syntax-forward " " (line-end-position)) 1030 (skip-syntax-forward " " (line-end-position))
@@ -942,7 +1039,7 @@ The text previously in the rectangle is overwritten by the blanks."
942 "Align rectangle lines to left column." 1039 "Align rectangle lines to left column."
943 (interactive) 1040 (interactive)
944 (let (x) 1041 (let (x)
945 (cua--rectangle-operation 'clear nil t t 1042 (cua--rectangle-operation 'clear nil t t nil
946 '(lambda (s e l r) 1043 '(lambda (s e l r)
947 (let ((b (line-beginning-position))) 1044 (let ((b (line-beginning-position)))
948 (skip-syntax-backward "^ " b) 1045 (skip-syntax-backward "^ " b)
@@ -984,7 +1081,7 @@ The text previously in the rectangle is overwritten by the blanks."
984 "Replace CUA rectangle contents with STRING on each line. 1081 "Replace CUA rectangle contents with STRING on each line.
985The length of STRING need not be the same as the rectangle width." 1082The length of STRING need not be the same as the rectangle width."
986 (interactive "sString rectangle: ") 1083 (interactive "sString rectangle: ")
987 (cua--rectangle-operation 'keep nil t t 1084 (cua--rectangle-operation 'keep nil t t nil
988 '(lambda (s e l r) 1085 '(lambda (s e l r)
989 (delete-region s e) 1086 (delete-region s e)
990 (skip-chars-forward " \t") 1087 (skip-chars-forward " \t")
@@ -999,7 +1096,7 @@ The length of STRING need not be the same as the rectangle width."
999(defun cua-fill-char-rectangle (ch) 1096(defun cua-fill-char-rectangle (ch)
1000 "Replace CUA rectangle contents with CHARACTER." 1097 "Replace CUA rectangle contents with CHARACTER."
1001 (interactive "cFill rectangle with character: ") 1098 (interactive "cFill rectangle with character: ")
1002 (cua--rectangle-operation 'clear nil t 1 1099 (cua--rectangle-operation 'clear nil t 1 nil
1003 '(lambda (s e l r) 1100 '(lambda (s e l r)
1004 (delete-region s e) 1101 (delete-region s e)
1005 (move-to-column l t) 1102 (move-to-column l t)
@@ -1010,7 +1107,7 @@ The length of STRING need not be the same as the rectangle width."
1010 (interactive "sReplace regexp: \nsNew text: ") 1107 (interactive "sReplace regexp: \nsNew text: ")
1011 (if buffer-read-only 1108 (if buffer-read-only
1012 (message "Cannot replace in read-only buffer") 1109 (message "Cannot replace in read-only buffer")
1013 (cua--rectangle-operation 'keep nil t 1 1110 (cua--rectangle-operation 'keep nil t 1 nil
1014 '(lambda (s e l r) 1111 '(lambda (s e l r)
1015 (if (re-search-forward regexp e t) 1112 (if (re-search-forward regexp e t)
1016 (replace-match newtext nil nil)))))) 1113 (replace-match newtext nil nil))))))
@@ -1018,7 +1115,7 @@ The length of STRING need not be the same as the rectangle width."
1018(defun cua-incr-rectangle (increment) 1115(defun cua-incr-rectangle (increment)
1019 "Increment each line of CUA rectangle by prefix amount." 1116 "Increment each line of CUA rectangle by prefix amount."
1020 (interactive "p") 1117 (interactive "p")
1021 (cua--rectangle-operation 'keep nil t 1 1118 (cua--rectangle-operation 'keep nil t 1 nil
1022 '(lambda (s e l r) 1119 '(lambda (s e l r)
1023 (cond 1120 (cond
1024 ((re-search-forward "0x\\([0-9a-fA-F]+\\)" e t) 1121 ((re-search-forward "0x\\([0-9a-fA-F]+\\)" e t)
@@ -1051,36 +1148,36 @@ The numbers are formatted according to the FORMAT string."
1051 (if (= (length fmt) 0) 1148 (if (= (length fmt) 0)
1052 (setq fmt cua--rectangle-seq-format) 1149 (setq fmt cua--rectangle-seq-format)
1053 (setq cua--rectangle-seq-format fmt)) 1150 (setq cua--rectangle-seq-format fmt))
1054 (cua--rectangle-operation 'clear nil t 1 1151 (cua--rectangle-operation 'clear nil t 1 nil
1055 '(lambda (s e l r) 1152 '(lambda (s e l r)
1056 (delete-region s e) 1153 (delete-region s e)
1057 (insert (format fmt first)) 1154 (insert (format fmt first))
1058 (setq first (+ first incr))))) 1155 (setq first (+ first incr)))))
1059 1156
1060(defmacro cua--convert-rectangle-as (command) 1157(defmacro cua--convert-rectangle-as (command tabify)
1061 `(cua--rectangle-operation 'clear nil nil nil 1158 `(cua--rectangle-operation 'clear nil nil nil ,tabify
1062 '(lambda (s e l r) 1159 '(lambda (s e l r)
1063 (,command s e)))) 1160 (,command s e))))
1064 1161
1065(defun cua-upcase-rectangle () 1162(defun cua-upcase-rectangle ()
1066 "Convert the rectangle to upper case." 1163 "Convert the rectangle to upper case."
1067 (interactive) 1164 (interactive)
1068 (cua--convert-rectangle-as upcase-region)) 1165 (cua--convert-rectangle-as upcase-region nil))
1069 1166
1070(defun cua-downcase-rectangle () 1167(defun cua-downcase-rectangle ()
1071 "Convert the rectangle to lower case." 1168 "Convert the rectangle to lower case."
1072 (interactive) 1169 (interactive)
1073 (cua--convert-rectangle-as downcase-region)) 1170 (cua--convert-rectangle-as downcase-region nil))
1074 1171
1075(defun cua-upcase-initials-rectangle () 1172(defun cua-upcase-initials-rectangle ()
1076 "Convert the rectangle initials to upper case." 1173 "Convert the rectangle initials to upper case."
1077 (interactive) 1174 (interactive)
1078 (cua--convert-rectangle-as upcase-initials-region)) 1175 (cua--convert-rectangle-as upcase-initials-region nil))
1079 1176
1080(defun cua-capitalize-rectangle () 1177(defun cua-capitalize-rectangle ()
1081 "Convert the rectangle to proper case." 1178 "Convert the rectangle to proper case."
1082 (interactive) 1179 (interactive)
1083 (cua--convert-rectangle-as capitalize-region)) 1180 (cua--convert-rectangle-as capitalize-region nil))
1084 1181
1085 1182
1086;;; Replace/rearrange text in current rectangle 1183;;; Replace/rearrange text in current rectangle
@@ -1116,7 +1213,7 @@ The numbers are formatted according to the FORMAT string."
1116 (setq z (reverse z)) 1213 (setq z (reverse z))
1117 (if cua--debug 1214 (if cua--debug
1118 (print z auxbuf)) 1215 (print z auxbuf))
1119 (cua--rectangle-operation nil nil t pad 1216 (cua--rectangle-operation nil nil t pad nil
1120 '(lambda (s e l r) 1217 '(lambda (s e l r)
1121 (let (cc) 1218 (let (cc)
1122 (goto-char e) 1219 (goto-char e)
@@ -1232,9 +1329,9 @@ With prefix arg, indent to that column."
1232 "Delete char to left or right of rectangle." 1329 "Delete char to left or right of rectangle."
1233 (interactive) 1330 (interactive)
1234 (let ((col (cua--rectangle-insert-col)) 1331 (let ((col (cua--rectangle-insert-col))
1235 (pad (cua--rectangle-padding)) 1332 (pad (cua--rectangle-virtual-edges))
1236 indent) 1333 indent)
1237 (cua--rectangle-operation 'corners nil t pad 1334 (cua--rectangle-operation 'corners nil t pad nil
1238 '(lambda (s e l r) 1335 '(lambda (s e l r)
1239 (move-to-column 1336 (move-to-column
1240 (if (cua--rectangle-right-side t) 1337 (if (cua--rectangle-right-side t)
@@ -1282,10 +1379,7 @@ With prefix arg, indent to that column."
1282 (cua--rectangle-left (current-column))) 1379 (cua--rectangle-left (current-column)))
1283 (if (>= (cua--rectangle-corner) 2) 1380 (if (>= (cua--rectangle-corner) 2)
1284 (cua--rectangle-bot t) 1381 (cua--rectangle-bot t)
1285 (cua--rectangle-top t)) 1382 (cua--rectangle-top t))))
1286 (if (cua--rectangle-padding)
1287 (setq unread-command-events
1288 (cons (if cua-use-hyper-key ?\H-P ?\M-P) unread-command-events)))))
1289 (if cua--rectangle 1383 (if cua--rectangle
1290 (if (and mark-active 1384 (if (and mark-active
1291 (not deactivate-mark)) 1385 (not deactivate-mark))
@@ -1379,7 +1473,7 @@ With prefix arg, indent to that column."
1379 (cua--rect-M/H-key ?m 'cua-copy-rectangle-as-text) 1473 (cua--rect-M/H-key ?m 'cua-copy-rectangle-as-text)
1380 (cua--rect-M/H-key ?n 'cua-sequence-rectangle) 1474 (cua--rect-M/H-key ?n 'cua-sequence-rectangle)
1381 (cua--rect-M/H-key ?o 'cua-open-rectangle) 1475 (cua--rect-M/H-key ?o 'cua-open-rectangle)
1382 (cua--rect-M/H-key ?p 'cua-toggle-rectangle-padding) 1476 (cua--rect-M/H-key ?p 'cua-toggle-rectangle-virtual-edges)
1383 (cua--rect-M/H-key ?P 'cua-do-rectangle-padding) 1477 (cua--rect-M/H-key ?P 'cua-do-rectangle-padding)
1384 (cua--rect-M/H-key ?q 'cua-refill-rectangle) 1478 (cua--rect-M/H-key ?q 'cua-refill-rectangle)
1385 (cua--rect-M/H-key ?r 'cua-replace-in-rectangle) 1479 (cua--rect-M/H-key ?r 'cua-replace-in-rectangle)
diff --git a/lisp/ielm.el b/lisp/ielm.el
index 944e2453cb9..96969bfc878 100644
--- a/lisp/ielm.el
+++ b/lisp/ielm.el
@@ -198,7 +198,7 @@ This variable is buffer-local.")
198;;; Completion stuff 198;;; Completion stuff
199 199
200(defun ielm-tab nil 200(defun ielm-tab nil
201 "Possibly indent the current line as lisp code." 201 "Possibly indent the current line as Lisp code."
202 (interactive) 202 (interactive)
203 (if (or (eq (preceding-char) ?\n) 203 (if (or (eq (preceding-char) ?\n)
204 (eq (char-syntax (preceding-char)) ? )) 204 (eq (char-syntax (preceding-char)) ? ))
@@ -207,7 +207,7 @@ This variable is buffer-local.")
207 t))) 207 t)))
208 208
209(defun ielm-complete-symbol nil 209(defun ielm-complete-symbol nil
210 "Complete the lisp symbol before point." 210 "Complete the Lisp symbol before point."
211 ;; A wrapper for lisp-complete symbol that returns non-nil if 211 ;; A wrapper for lisp-complete symbol that returns non-nil if
212 ;; completion has occurred 212 ;; completion has occurred
213 (let* ((btick (buffer-modified-tick)) 213 (let* ((btick (buffer-modified-tick))
@@ -528,7 +528,7 @@ Customized bindings may be defined in `ielm-map', which currently contains:
528 (condition-case nil 528 (condition-case nil
529 (start-process "ielm" (current-buffer) "hexl") 529 (start-process "ielm" (current-buffer) "hexl")
530 (file-error (start-process "ielm" (current-buffer) "cat"))) 530 (file-error (start-process "ielm" (current-buffer) "cat")))
531 (process-kill-without-query (ielm-process)) 531 (set-process-query-on-exit-flag (ielm-process) nil)
532 (goto-char (point-max)) 532 (goto-char (point-max))
533 533
534 ;; Lisp output can include raw characters that confuse comint's 534 ;; Lisp output can include raw characters that confuse comint's
diff --git a/lisp/indent.el b/lisp/indent.el
index e56db11b6f1..2d223b05ad6 100644
--- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -442,8 +442,8 @@ This should be a list of integers, ordered from smallest to largest."
442 "Keymap used in `edit-tab-stops'.") 442 "Keymap used in `edit-tab-stops'.")
443 443
444(defvar edit-tab-stops-buffer nil 444(defvar edit-tab-stops-buffer nil
445 "Buffer whose tab stops are being edited--in case 445 "Buffer whose tab stops are being edited.
446the variable `tab-stop-list' is local in that buffer.") 446This matters if the variable `tab-stop-list' is local in that buffer.")
447 447
448(defun edit-tab-stops () 448(defun edit-tab-stops ()
449 "Edit the tab stops used by `tab-to-tab-stop'. 449 "Edit the tab stops used by `tab-to-tab-stop'.
diff --git a/lisp/international/utf-8.el b/lisp/international/utf-8.el
index bad79b58743..5a7acee0f0e 100644
--- a/lisp/international/utf-8.el
+++ b/lisp/international/utf-8.el
@@ -870,7 +870,9 @@ Also compose particular scripts if `utf-8-compose-scripts' is non-nil."
870 ;; version of the string in the loop, since it's always loaded as 870 ;; version of the string in the loop, since it's always loaded as
871 ;; unibyte from a byte-compiled file. 871 ;; unibyte from a byte-compiled file.
872 (let ((range (string-as-multibyte "^\xc0-\xc3\xe1-\xf7")) 872 (let ((range (string-as-multibyte "^\xc0-\xc3\xe1-\xf7"))
873 (buffer-multibyte enable-multibyte-characters)
873 hash-table ch) 874 hash-table ch)
875 (set-buffer-multibyte t)
874 (when utf-translate-cjk-mode 876 (when utf-translate-cjk-mode
875 (if (not utf-translate-cjk-lang-env) 877 (if (not utf-translate-cjk-lang-env)
876 ;; Check these characters: 878 ;; Check these characters:
@@ -893,7 +895,9 @@ Also compose particular scripts if `utf-8-compose-scripts' is non-nil."
893 (progn 895 (progn
894 (insert ch) 896 (insert ch)
895 (delete-char 1)) 897 (delete-char 1))
896 (forward-char 1))))) 898 (forward-char 1))))
899 (or buffer-multibyte
900 (set-buffer-multibyte nil)))
897 901
898 (when (and utf-8-compose-scripts (> length 1)) 902 (when (and utf-8-compose-scripts (> length 1))
899 ;; These currently have definitions which cover the relevant 903 ;; These currently have definitions which cover the relevant
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 990291caead..dd1062da816 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,5 +1,40 @@
12004-08-21 Bill Wohler <wohler@newt.com> 12004-08-21 Bill Wohler <wohler@newt.com>
2 2
3 * Released MH-E version 7.82.
4
5 * MH-E-NEWS, README: Updated for release 7.82.
6
7 * mh-e.el (Version, mh-version): Updated for release 7.82.
8
92004-08-24 Bill Wohler <wohler@newt.com>
10
11 * mh-init.el (mh-variant-set): Changed MH to mh as that's what is
12 emitted by `mh-variant-mh-info' (closes SF #1014781).
13 (mh-variant-p): Added mu-mh to docstring.
14
152004-08-23 Satyaki Das <satyaki@theforce.stanford.edu>
16
17 * mh-acros.el (mh-require-cl): Remove unneeded autoloads.
18 (require): Add an advice to the function so that at compile time
19 the uncompiled file is loaded. This avoids compilation problems
20 when built in the Emacs tree.
21
22 * mh-mime.el (mh-identity-pgg-default-user-id): Defvar the
23 variable, to avoid compiler warnings.
24
25 * mh-e.el (mh-seq): Load mh-seq since functions defined there are
26 used here. Without this, the state mh-seq.elc would be loaded.
27
28 * mh-customize.el (mh-init, mh-identity): Load mh-init and
29 mh-identity at compile time manually, before the corresponding
30 stale elc files get autoloaded.
31
322004-08-21 Bill Wohler <wohler@newt.com>
33
34 * mh-e.el (Version, mh-version): Added +cvs to release number.
35
362004-08-21 Bill Wohler <wohler@newt.com>
37
3 * Released MH-E version 7.81. 38 * Released MH-E version 7.81.
4 39
5 * MH-E-NEWS, README: Updated for release 7.81. 40 * MH-E-NEWS, README: Updated for release 7.81.
diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el
index dd8660a8ce3..16383304503 100644
--- a/lisp/mh-e/mh-acros.el
+++ b/lisp/mh-e/mh-acros.el
@@ -51,12 +51,7 @@ Some versions of `cl' produce code for the expansion of
51\(setf (gethash ...) ...) that uses functions in `cl' at run time. This macro 51\(setf (gethash ...) ...) that uses functions in `cl' at run time. This macro
52recognizes that and loads `cl' where appropriate." 52recognizes that and loads `cl' where appropriate."
53 (if (eq (car (macroexpand '(setf (gethash foo bar) baz))) 'cl-puthash) 53 (if (eq (car (macroexpand '(setf (gethash foo bar) baz))) 'cl-puthash)
54 `(progn 54 `(require 'cl)
55 (require 'cl)
56 ;; Autoloads of CL functions go here...
57 (autoload 'cl-puthash "cl")
58 (autoload 'values "cl")
59 (autoload 'copy-tree "cl"))
60 `(eval-when-compile (require 'cl)))) 55 `(eval-when-compile (require 'cl))))
61 56
62;;; Macros to generate correct code for different emacs variants 57;;; Macros to generate correct code for different emacs variants
@@ -130,6 +125,12 @@ various structure fields. Lookup `defstruct' for more details."
130 (list 'nth ,x z))) 125 (list 'nth ,x z)))
131 (quote ,struct-name)))) 126 (quote ,struct-name))))
132 127
128(defadvice require (around mh-prefer-el activate)
129 "Modify `require' to load uncompiled MH-E files."
130 (or (featurep (ad-get-arg 0))
131 (and (string-match "^mh-" (symbol-name (ad-get-arg 0)))
132 (load (format "%s.el" (ad-get-arg 0)) t t))
133 ad-do-it))
133 134
134(provide 'mh-acros) 135(provide 'mh-acros)
135 136
diff --git a/lisp/mh-e/mh-customize.el b/lisp/mh-e/mh-customize.el
index 67a126a8327..622c457897f 100644
--- a/lisp/mh-e/mh-customize.el
+++ b/lisp/mh-e/mh-customize.el
@@ -78,6 +78,13 @@
78(when mh-xemacs-flag 78(when mh-xemacs-flag
79 (require 'mh-xemacs)) 79 (require 'mh-xemacs))
80 80
81;; XXX: Functions autoloaded from the following files are used to initialize
82;; customizable variables. They are require'd here, since otherwise the
83;; corresponding .elc would be loaded at compile time.
84(eval-when-compile
85 (require 'mh-init)
86 (require 'mh-identity))
87
81(defun mh-customize (&optional delete-other-windows-flag) 88(defun mh-customize (&optional delete-other-windows-flag)
82 "Customize MH-E variables. 89 "Customize MH-E variables.
83If optional argument DELETE-OTHER-WINDOWS-FLAG is non-nil, other windows in 90If optional argument DELETE-OTHER-WINDOWS-FLAG is non-nil, other windows in
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 5cbb97b72d0..2081d49b6cd 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -5,7 +5,7 @@
5 5
6;; Author: Bill Wohler <wohler@newt.com> 6;; Author: Bill Wohler <wohler@newt.com>
7;; Maintainer: Bill Wohler <wohler@newt.com> 7;; Maintainer: Bill Wohler <wohler@newt.com>
8;; Version: 7.81 8;; Version: 7.82
9;; Keywords: mail 9;; Keywords: mail
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
@@ -89,6 +89,7 @@
89(require 'mh-utils) 89(require 'mh-utils)
90(require 'mh-init) 90(require 'mh-init)
91(require 'mh-inc) 91(require 'mh-inc)
92(require 'mh-seq)
92(require 'gnus-util) 93(require 'gnus-util)
93(require 'easymenu) 94(require 'easymenu)
94 95
@@ -96,7 +97,7 @@
96(defvar font-lock-auto-fontify) 97(defvar font-lock-auto-fontify)
97(defvar font-lock-defaults) 98(defvar font-lock-defaults)
98 99
99(defconst mh-version "7.81" "Version number of MH-E.") 100(defconst mh-version "7.82" "Version number of MH-E.")
100 101
101;;; Autoloads 102;;; Autoloads
102(autoload 'Info-goto-node "info") 103(autoload 'Info-goto-node "info")
diff --git a/lisp/mh-e/mh-init.el b/lisp/mh-e/mh-init.el
index ac7305fa217..a975b882128 100644
--- a/lisp/mh-e/mh-init.el
+++ b/lisp/mh-e/mh-init.el
@@ -90,7 +90,7 @@ GNU mailutils."
90 (cond 90 (cond
91 ((mh-variant-set-variant 'nmh) 91 ((mh-variant-set-variant 'nmh)
92 (message "%s installed as MH variant" mh-variant-in-use)) 92 (message "%s installed as MH variant" mh-variant-in-use))
93 ((mh-variant-set-variant 'MH) 93 ((mh-variant-set-variant 'mh)
94 (message "%s installed as MH variant" mh-variant-in-use)) 94 (message "%s installed as MH variant" mh-variant-in-use))
95 ((mh-variant-set-variant 'mu-mh) 95 ((mh-variant-set-variant 'mu-mh)
96 (message "%s installed as MH variant" mh-variant-in-use)) 96 (message "%s installed as MH variant" mh-variant-in-use))
@@ -145,7 +145,7 @@ If VARIANT is a symbol, select the first entry that matches that variant."
145;;;###mh-autoload 145;;;###mh-autoload
146(defun mh-variant-p (&rest variants) 146(defun mh-variant-p (&rest variants)
147 "Return t if variant is any of VARIANTS. 147 "Return t if variant is any of VARIANTS.
148Currently known variants are 'mh and 'nmh." 148Currently known variants are 'MH, 'nmh, and 'mu-mh."
149 (let ((variant-in-use 149 (let ((variant-in-use
150 (cadr (assoc 'variant (assoc mh-variant-in-use mh-variants))))) 150 (cadr (assoc 'variant (assoc mh-variant-in-use mh-variants)))))
151 (not (null (member variant-in-use variants))))) 151 (not (null (member variant-in-use variants)))))
diff --git a/lisp/mh-e/mh-loaddefs.el b/lisp/mh-e/mh-loaddefs.el
index 6a88278a847..fd989ffa3b9 100644
--- a/lisp/mh-e/mh-loaddefs.el
+++ b/lisp/mh-e/mh-loaddefs.el
@@ -13,7 +13,7 @@
13;;;;;; mh-check-whom mh-insert-signature mh-to-fcc mh-to-field mh-fill-paragraph-function 13;;;;;; mh-check-whom mh-insert-signature mh-to-fcc mh-to-field mh-fill-paragraph-function
14;;;;;; mh-get-header-field mh-send-other-window mh-send mh-reply 14;;;;;; mh-get-header-field mh-send-other-window mh-send mh-reply
15;;;;;; mh-redistribute mh-forward mh-extract-rejected-mail mh-edit-again) 15;;;;;; mh-redistribute mh-forward mh-extract-rejected-mail mh-edit-again)
16;;;;;; "mh-comp" "mh-comp.el" (16665 55172)) 16;;;;;; "mh-comp" "mh-comp.el" (16665 53716))
17;;; Generated autoloads from mh-comp.el 17;;; Generated autoloads from mh-comp.el
18 18
19(autoload (quote mh-edit-again) "mh-comp" "\ 19(autoload (quote mh-edit-again) "mh-comp" "\
@@ -183,7 +183,7 @@ If we are at the first header field go to the start of the message body." t nil)
183;;;;;; mh-store-msg mh-undo-folder mh-sort-folder mh-page-digest-backwards 183;;;;;; mh-store-msg mh-undo-folder mh-sort-folder mh-page-digest-backwards
184;;;;;; mh-page-digest mh-pipe-msg mh-pack-folder mh-list-folders 184;;;;;; mh-page-digest mh-pipe-msg mh-pack-folder mh-list-folders
185;;;;;; mh-kill-folder mh-copy-msg mh-burst-digest) "mh-funcs" "mh-funcs.el" 185;;;;;; mh-kill-folder mh-copy-msg mh-burst-digest) "mh-funcs" "mh-funcs.el"
186;;;;;; (16671 49652)) 186;;;;;; (16671 48788))
187;;; Generated autoloads from mh-funcs.el 187;;; Generated autoloads from mh-funcs.el
188 188
189(autoload (quote mh-burst-digest) "mh-funcs" "\ 189(autoload (quote mh-burst-digest) "mh-funcs" "\
@@ -261,7 +261,7 @@ Display cheat sheet for the commands of the current prefix in minibuffer." t nil
261;;;;;; mh-identity-insert-attribution-verb mh-identity-handler-attribution-verb 261;;;;;; mh-identity-insert-attribution-verb mh-identity-handler-attribution-verb
262;;;;;; mh-identity-handler-signature mh-identity-handler-gpg-identity 262;;;;;; mh-identity-handler-signature mh-identity-handler-gpg-identity
263;;;;;; mh-insert-identity mh-identity-list-set mh-identity-make-menu) 263;;;;;; mh-insert-identity mh-identity-list-set mh-identity-make-menu)
264;;;;;; "mh-identity" "mh-identity.el" (16680 7172)) 264;;;;;; "mh-identity" "mh-identity.el" (16671 57010))
265;;; Generated autoloads from mh-identity.el 265;;; Generated autoloads from mh-identity.el
266 266
267(autoload (quote mh-identity-make-menu) "mh-identity" "\ 267(autoload (quote mh-identity-make-menu) "mh-identity" "\
@@ -307,7 +307,7 @@ If the field wasn't present, the VALUE is added at the bottom of the header." ni
307;;;*** 307;;;***
308 308
309;;;### (autoloads (mh-inc-spool-list-set) "mh-inc" "mh-inc.el" (16671 309;;;### (autoloads (mh-inc-spool-list-set) "mh-inc" "mh-inc.el" (16671
310;;;;;; 49652)) 310;;;;;; 48848))
311;;; Generated autoloads from mh-inc.el 311;;; Generated autoloads from mh-inc.el
312 312
313(autoload (quote mh-inc-spool-list-set) "mh-inc" "\ 313(autoload (quote mh-inc-spool-list-set) "mh-inc" "\
@@ -326,7 +326,7 @@ This is called after 'customize is used to alter `mh-inc-spool-list'." nil nil)
326;;;;;; mh-index-parse-search-regexp mh-index-do-search mh-index-p 326;;;;;; mh-index-parse-search-regexp mh-index-do-search mh-index-p
327;;;;;; mh-index-read-data mh-index-search mh-index-create-sequences 327;;;;;; mh-index-read-data mh-index-search mh-index-create-sequences
328;;;;;; mh-create-sequence-map mh-index-update-maps) "mh-index" "mh-index.el" 328;;;;;; mh-create-sequence-map mh-index-update-maps) "mh-index" "mh-index.el"
329;;;;;; (16665 55172)) 329;;;;;; (16665 53754))
330;;; Generated autoloads from mh-index.el 330;;; Generated autoloads from mh-index.el
331 331
332(autoload (quote mh-index-update-maps) "mh-index" "\ 332(autoload (quote mh-index-update-maps) "mh-index" "\
@@ -582,7 +582,7 @@ system." nil nil)
582;;;*** 582;;;***
583 583
584;;;### (autoloads (mh-variants mh-variant-p mh-variant-set) "mh-init" 584;;;### (autoloads (mh-variants mh-variant-p mh-variant-set) "mh-init"
585;;;;;; "mh-init.el" (16680 9361)) 585;;;;;; "mh-init.el" (16684 6777))
586;;; Generated autoloads from mh-init.el 586;;; Generated autoloads from mh-init.el
587 587
588(autoload (quote mh-variant-set) "mh-init" "\ 588(autoload (quote mh-variant-set) "mh-init" "\
@@ -593,7 +593,7 @@ GNU mailutils." t nil)
593 593
594(autoload (quote mh-variant-p) "mh-init" "\ 594(autoload (quote mh-variant-p) "mh-init" "\
595Return t if variant is any of VARIANTS. 595Return t if variant is any of VARIANTS.
596Currently known variants are 'mh and 'nmh." nil nil) 596Currently known variants are 'MH, 'nmh, and 'mu-mh." nil nil)
597 597
598(autoload (quote mh-variants) "mh-init" "\ 598(autoload (quote mh-variants) "mh-init" "\
599Return a list of installed variants of MH on the system. 599Return a list of installed variants of MH on the system.
@@ -604,7 +604,7 @@ by the variable `mh-variants'." nil nil)
604;;;*** 604;;;***
605 605
606;;;### (autoloads (mh-junk-whitelist mh-junk-blacklist) "mh-junk" 606;;;### (autoloads (mh-junk-whitelist mh-junk-blacklist) "mh-junk"
607;;;;;; "mh-junk.el" (16671 49652)) 607;;;;;; "mh-junk.el" (16671 48929))
608;;; Generated autoloads from mh-junk.el 608;;; Generated autoloads from mh-junk.el
609 609
610(autoload (quote mh-junk-blacklist) "mh-junk" "\ 610(autoload (quote mh-junk-blacklist) "mh-junk" "\
@@ -644,7 +644,7 @@ The `mh-junk-program' option specifies the spam program in use." t nil)
644;;;;;; mh-mhn-compose-external-compressed-tar mh-mhn-compose-anon-ftp 644;;;;;; mh-mhn-compose-external-compressed-tar mh-mhn-compose-anon-ftp
645;;;;;; mh-mhn-compose-insertion mh-file-mime-type mh-have-file-command 645;;;;;; mh-mhn-compose-insertion mh-file-mime-type mh-have-file-command
646;;;;;; mh-compose-forward mh-compose-insertion) "mh-mime" "mh-mime.el" 646;;;;;; mh-compose-forward mh-compose-insertion) "mh-mime" "mh-mime.el"
647;;;;;; (16680 7172)) 647;;;;;; (16684 7323))
648;;; Generated autoloads from mh-mime.el 648;;; Generated autoloads from mh-mime.el
649 649
650(autoload (quote mh-compose-insertion) "mh-mime" "\ 650(autoload (quote mh-compose-insertion) "mh-mime" "\
@@ -857,7 +857,7 @@ View MIME PART-INDEX externally." t nil)
857;;;*** 857;;;***
858 858
859;;;### (autoloads (mh-do-search mh-pick-do-search mh-search-folder) 859;;;### (autoloads (mh-do-search mh-pick-do-search mh-search-folder)
860;;;;;; "mh-pick" "mh-pick.el" (16671 49652)) 860;;;;;; "mh-pick" "mh-pick.el" (16671 49140))
861;;; Generated autoloads from mh-pick.el 861;;; Generated autoloads from mh-pick.el
862 862
863(autoload (quote mh-search-folder) "mh-pick" "\ 863(autoload (quote mh-search-folder) "mh-pick" "\
@@ -882,7 +882,7 @@ indexing program specified in `mh-index-program' is used." t nil)
882 882
883;;;### (autoloads (mh-print-msg mh-ps-print-toggle-mime mh-ps-print-toggle-color 883;;;### (autoloads (mh-print-msg mh-ps-print-toggle-mime mh-ps-print-toggle-color
884;;;;;; mh-ps-print-toggle-faces mh-ps-print-msg-show mh-ps-print-msg-file 884;;;;;; mh-ps-print-toggle-faces mh-ps-print-msg-show mh-ps-print-msg-file
885;;;;;; mh-ps-print-msg) "mh-print" "mh-print.el" (16680 9361)) 885;;;;;; mh-ps-print-msg) "mh-print" "mh-print.el" (16680 11171))
886;;; Generated autoloads from mh-print.el 886;;; Generated autoloads from mh-print.el
887 887
888(autoload (quote mh-ps-print-msg) "mh-print" "\ 888(autoload (quote mh-ps-print-msg) "mh-print" "\
@@ -935,7 +935,7 @@ The messages are formatted by mhl. See the variable `mhl-formfile'." t nil)
935;;;;;; mh-rename-seq mh-translate-range mh-read-range mh-read-seq-default 935;;;;;; mh-rename-seq mh-translate-range mh-read-range mh-read-seq-default
936;;;;;; mh-notate-deleted-and-refiled mh-widen mh-put-msg-in-seq 936;;;;;; mh-notate-deleted-and-refiled mh-widen mh-put-msg-in-seq
937;;;;;; mh-narrow-to-seq mh-msg-is-in-seq mh-list-sequences mh-delete-seq) 937;;;;;; mh-narrow-to-seq mh-msg-is-in-seq mh-list-sequences mh-delete-seq)
938;;;;;; "mh-seq" "mh-seq.el" (16668 22297)) 938;;;;;; "mh-seq" "mh-seq.el" (16671 65286))
939;;; Generated autoloads from mh-seq.el 939;;; Generated autoloads from mh-seq.el
940 940
941(autoload (quote mh-delete-seq) "mh-seq" "\ 941(autoload (quote mh-delete-seq) "mh-seq" "\
@@ -1157,7 +1157,7 @@ Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command." t nil)
1157 1157
1158;;;### (autoloads (mh-speed-add-folder mh-speed-invalidate-map mh-speed-flists 1158;;;### (autoloads (mh-speed-add-folder mh-speed-invalidate-map mh-speed-flists
1159;;;;;; mh-speed-view mh-speed-toggle mh-folder-speedbar-buttons) 1159;;;;;; mh-speed-view mh-speed-toggle mh-folder-speedbar-buttons)
1160;;;;;; "mh-speed" "mh-speed.el" (16665 55171)) 1160;;;;;; "mh-speed" "mh-speed.el" (16665 53793))
1161;;; Generated autoloads from mh-speed.el 1161;;; Generated autoloads from mh-speed.el
1162 1162
1163(autoload (quote mh-folder-speedbar-buttons) "mh-speed" "\ 1163(autoload (quote mh-folder-speedbar-buttons) "mh-speed" "\
@@ -1196,7 +1196,7 @@ The function invalidates the latest ancestor that is present." nil nil)
1196;;;;;; mh-alias-grab-from-field mh-alias-add-alias mh-alias-for-from-p 1196;;;;;; mh-alias-grab-from-field mh-alias-add-alias mh-alias-for-from-p
1197;;;;;; mh-alias-address-to-alias mh-alias-letter-expand-alias mh-alias-minibuffer-confirm-address 1197;;;;;; mh-alias-address-to-alias mh-alias-letter-expand-alias mh-alias-minibuffer-confirm-address
1198;;;;;; mh-read-address mh-alias-reload-maybe mh-alias-reload) "mh-alias" 1198;;;;;; mh-read-address mh-alias-reload-maybe mh-alias-reload) "mh-alias"
1199;;;;;; "mh-alias.el" (16671 49553)) 1199;;;;;; "mh-alias.el" (16671 49382))
1200;;; Generated autoloads from mh-alias.el 1200;;; Generated autoloads from mh-alias.el
1201 1201
1202(autoload (quote mh-alias-reload) "mh-alias" "\ 1202(autoload (quote mh-alias-reload) "mh-alias" "\
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index f952f8b80fb..72cb654dedd 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -583,6 +583,8 @@ automatically."
583 (mml-insert-empty-tag 'part 'type type 'filename file 583 (mml-insert-empty-tag 'part 'type type 'filename file
584 'disposition dispos 'description description))) 584 'disposition dispos 'description description)))
585 585
586(defvar mh-identity-pgg-default-user-id)
587
586(defun mh-secure-message (method mode &optional identity) 588(defun mh-secure-message (method mode &optional identity)
587 "Add directive to Encrypt/Sign an entire message. 589 "Add directive to Encrypt/Sign an entire message.
588METHOD should be one of: \"pgpmime\", \"pgp\", \"smime\". 590METHOD should be one of: \"pgpmime\", \"pgp\", \"smime\".
@@ -852,7 +854,7 @@ If message has been encoded for transfer take that into account."
852;;;###mh-autoload 854;;;###mh-autoload
853(defun mh-toggle-mh-decode-mime-flag () 855(defun mh-toggle-mh-decode-mime-flag ()
854 "Toggle whether MH-E should decode MIME or not." 856 "Toggle whether MH-E should decode MIME or not."
855 (interactive) 857 (interactive)
856 (setq mh-decode-mime-flag (not mh-decode-mime-flag)) 858 (setq mh-decode-mime-flag (not mh-decode-mime-flag))
857 (mh-show nil t) 859 (mh-show nil t)
858 (message (format "(setq mh-decode-mime-flag %s)" mh-decode-mime-flag))) 860 (message (format "(setq mh-decode-mime-flag %s)" mh-decode-mime-flag)))
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 4464df3a916..ddbd2ce6f35 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -772,26 +772,6 @@ Assumes the tags table is the current buffer."
772 (all-completions string (tags-completion-table) predicate) 772 (all-completions string (tags-completion-table) predicate)
773 (try-completion string (tags-completion-table) predicate)))) 773 (try-completion string (tags-completion-table) predicate))))
774 774
775;; Return a default tag to search for, based on the text at point.
776(defun find-tag-default ()
777 (save-excursion
778 (while (looking-at "\\sw\\|\\s_")
779 (forward-char 1))
780 (if (or (re-search-backward "\\sw\\|\\s_"
781 (save-excursion (beginning-of-line) (point))
782 t)
783 (re-search-forward "\\(\\sw\\|\\s_\\)+"
784 (save-excursion (end-of-line) (point))
785 t))
786 (progn (goto-char (match-end 0))
787 (buffer-substring-no-properties
788 (point)
789 (progn (forward-sexp -1)
790 (while (looking-at "\\s'")
791 (forward-char 1))
792 (point))))
793 nil)))
794
795;; Read a tag name from the minibuffer with defaulting and completion. 775;; Read a tag name from the minibuffer with defaulting and completion.
796(defun find-tag-tag (string) 776(defun find-tag-tag (string)
797 (let* ((completion-ignore-case (if (memq tags-case-fold-search '(t nil)) 777 (let* ((completion-ignore-case (if (memq tags-case-fold-search '(t nil))
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 5b678f26171..f4acd564a3c 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -384,9 +384,7 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
384 (let ((tag-default 384 (let ((tag-default
385 (funcall (or find-tag-default-function 385 (funcall (or find-tag-default-function
386 (get major-mode 'find-tag-default-function) 386 (get major-mode 'find-tag-default-function)
387 ;; We use grep-tag-default instead of 387 'find-tag-default)))
388 ;; find-tag-default, to avoid loading etags.
389 'grep-tag-default)))
390 (sh-arg-re "\\(\\(?:\"\\(?:[^\"]\\|\\\\\"\\)+\"\\|'[^']+'\\|[^\"' \t\n]\\)+\\)") 388 (sh-arg-re "\\(\\(?:\"\\(?:[^\"]\\|\\\\\"\\)+\"\\|'[^']+'\\|[^\"' \t\n]\\)+\\)")
391 (grep-default (or (car grep-history) grep-command))) 389 (grep-default (or (car grep-history) grep-command)))
392 ;; Replace the thing matching for with that around cursor. 390 ;; Replace the thing matching for with that around cursor.
@@ -457,25 +455,6 @@ temporarily highlight in visited source lines."
457 (set (make-local-variable 'compilation-error-regexp-alist) 455 (set (make-local-variable 'compilation-error-regexp-alist)
458 grep-regexp-alist)) 456 grep-regexp-alist))
459 457
460;; This is a copy of find-tag-default from etags.el.
461;;;###autoload
462(defun grep-tag-default ()
463 (save-excursion
464 (while (looking-at "\\sw\\|\\s_")
465 (forward-char 1))
466 (when (or (re-search-backward "\\sw\\|\\s_"
467 (save-excursion (beginning-of-line) (point))
468 t)
469 (re-search-forward "\\(\\sw\\|\\s_\\)+"
470 (save-excursion (end-of-line) (point))
471 t))
472 (goto-char (match-end 0))
473 (buffer-substring (point)
474 (progn (forward-sexp -1)
475 (while (looking-at "\\s'")
476 (forward-char 1))
477 (point))))))
478
479;;;###autoload 458;;;###autoload
480(defun grep-find (command-args) 459(defun grep-find (command-args)
481 "Run grep via find, with user-specified args COMMAND-ARGS. 460 "Run grep via find, with user-specified args COMMAND-ARGS.
diff --git a/lisp/subr.el b/lisp/subr.el
index bac77872cf0..6676a6b7794 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1981,6 +1981,27 @@ Uses the `derived-mode-parent' property of the symbol to trace backwards."
1981 (setq parent (get parent 'derived-mode-parent)))) 1981 (setq parent (get parent 'derived-mode-parent))))
1982 parent)) 1982 parent))
1983 1983
1984(defun find-tag-default ()
1985 "Determine default tag to search for, based on text at point.
1986If there is no plausible default, return nil."
1987 (save-excursion
1988 (while (looking-at "\\sw\\|\\s_")
1989 (forward-char 1))
1990 (if (or (re-search-backward "\\sw\\|\\s_"
1991 (save-excursion (beginning-of-line) (point))
1992 t)
1993 (re-search-forward "\\(\\sw\\|\\s_\\)+"
1994 (save-excursion (end-of-line) (point))
1995 t))
1996 (progn (goto-char (match-end 0))
1997 (buffer-substring-no-properties
1998 (point)
1999 (progn (forward-sexp -1)
2000 (while (looking-at "\\s'")
2001 (forward-char 1))
2002 (point))))
2003 nil)))
2004
1984(defmacro with-syntax-table (table &rest body) 2005(defmacro with-syntax-table (table &rest body)
1985 "Evaluate BODY with syntax table of current buffer set to TABLE. 2006 "Evaluate BODY with syntax table of current buffer set to TABLE.
1986The syntax table of the current buffer is saved, BODY is evaluated, and the 2007The syntax table of the current buffer is saved, BODY is evaluated, and the
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 28bf9f6cf28..1c4b89f0a62 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -1141,10 +1141,14 @@ on the line for the invalidity you want to see."
1141 'occur-target tem))))) 1141 'occur-target tem)))))
1142 (goto-char prev-end)))) 1142 (goto-char prev-end))))
1143 (with-current-buffer standard-output 1143 (with-current-buffer standard-output
1144 (if (eq num-matches 0) 1144 (let ((no-matches (zerop num-matches)))
1145 (insert "None!\n")) 1145 (if no-matches
1146 (if (interactive-p) 1146 (insert "None!\n"))
1147 (message "%d mismatches found" num-matches)))))) 1147 (if (interactive-p)
1148 (message (cond (no-matches "No mismatches found")
1149 ((= num-matches 1) "1 mismatch found")
1150 (t "%d mismatches found"))
1151 num-matches)))))))
1148 1152
1149(defun tex-validate-region (start end) 1153(defun tex-validate-region (start end)
1150 "Check for mismatched braces or $'s in region. 1154 "Check for mismatched braces or $'s in region.
@@ -1459,7 +1463,7 @@ Mark is left at original location."
1459 nil) 1463 nil)
1460 (let ((proc (get-process "tex-shell"))) 1464 (let ((proc (get-process "tex-shell")))
1461 (set-process-sentinel proc 'tex-shell-sentinel) 1465 (set-process-sentinel proc 'tex-shell-sentinel)
1462 (process-kill-without-query proc) 1466 (set-process-query-on-exit-flag proc nil)
1463 (tex-shell) 1467 (tex-shell)
1464 (while (zerop (buffer-size)) 1468 (while (zerop (buffer-size))
1465 (sleep-for 1))))) 1469 (sleep-for 1)))))
@@ -1928,7 +1932,7 @@ for the error messages."
1928 (re-search-forward 1932 (re-search-forward
1929 "^l\\.\\([0-9]+\\) \\(\\.\\.\\.\\)?\\(.*\\)$" nil 'move)) 1933 "^l\\.\\([0-9]+\\) \\(\\.\\.\\.\\)?\\(.*\\)$" nil 'move))
1930 (let* ((this-error (copy-marker begin-of-error)) 1934 (let* ((this-error (copy-marker begin-of-error))
1931 (linenum (string-to-int (match-string 1))) 1935 (linenum (string-to-number (match-string 1)))
1932 (error-text (regexp-quote (match-string 3))) 1936 (error-text (regexp-quote (match-string 3)))
1933 (filename 1937 (filename
1934 (save-excursion 1938 (save-excursion
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 894d78646d1..234cc779019 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,9 @@
12004-08-27 Luc Teirlinck <teirllm@auburn.edu>
2
3 * abbrevs.texi (Abbrev Expansion): `abbrev-start-location' can be
4 an integer or a marker.
5 (Abbrev Expansion): Replace example for `pre-abbrev-expand-hook'.
6
12004-08-22 Richard M. Stallman <rms@gnu.org> 72004-08-22 Richard M. Stallman <rms@gnu.org>
2 8
3 * modes.texi (Major Mode Conventions): Discuss rebinding of 9 * modes.texi (Major Mode Conventions): Discuss rebinding of
diff --git a/lispref/abbrevs.texi b/lispref/abbrevs.texi
index d586d0bbc13..1f873312222 100644
--- a/lispref/abbrevs.texi
+++ b/lispref/abbrevs.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, 1999 3@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 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/abbrevs 6@setfilename ../info/abbrevs
@@ -288,7 +288,7 @@ expansion.
288@end defopt 288@end defopt
289 289
290@defvar abbrev-start-location 290@defvar abbrev-start-location
291The value of this variable is a marker pointing to the buffer position 291The value of this variable is a buffer position (an integer or a marker)
292for @code{expand-abbrev} to use as the start of the next abbrev to be 292for @code{expand-abbrev} to use as the start of the next abbrev to be
293expanded. The value can also be @code{nil}, which means to use the 293expanded. The value can also be @code{nil}, which means to use the
294word before point instead. @code{abbrev-start-location} is set to 294word before point instead. @code{abbrev-start-location} is set to
@@ -331,32 +331,43 @@ hook, the hook functions receive no arguments. However, they can find
331the abbrev to be expanded by looking in the buffer before point. 331the abbrev to be expanded by looking in the buffer before point.
332Running the hook is the first thing that @code{expand-abbrev} does, and 332Running the hook is the first thing that @code{expand-abbrev} does, and
333so a hook function can be used to change the current abbrev table before 333so a hook function can be used to change the current abbrev table before
334abbrev lookup happens. 334abbrev lookup happens. (Although you have to do this carefully. See
335the example below.)
335@end defvar 336@end defvar
336 337
337 The following sample code shows a simple use of 338 The following sample code shows a simple use of
338@code{pre-abbrev-expand-hook}. If the user terminates an abbrev with 339@code{pre-abbrev-expand-hook}. It assumes that @code{foo-mode} is a
339a punctuation character, the hook function asks for confirmation. It 340mode for editing certain files in which lines that start with @samp{#}
340aborts expansion if the user does not confirm. 341are comments. You want to use Text mode abbrevs for those lines. The
342regular local abbrev table, @code{foo-mode-abbrev-table} is
343appropriate for all other lines. Then you can put the following code
344in your @file{.emacs} file. @xref{Standard Abbrev Tables}, for the
345definitions of @code{local-abbrev-table} and @code{text-mode-abbrev-table}.
341 346
342@smallexample 347@smallexample
343(add-hook 'pre-abbrev-expand-hook 'query-if-not-space) 348(defun foo-mode-pre-abbrev-expand ()
344 349 (when (save-excursion (forward-line 0) (eq (char-after) ?#))
345;; @r{This is the function invoked by @code{pre-abbrev-expand-hook}.} 350 (let ((local-abbrev-table text-mode-abbrev-table)
346 351 ;; Avoid infinite loop.
347;; @r{If the user terminated the abbrev with a space, the function does} 352 (pre-abbrev-expand-hook nil))
348;; @r{nothing (that is, it returns so that the abbrev can expand). If the} 353 (expand-abbrev))
349;; @r{user entered some other character, this function asks whether} 354 ;; We have already called `expand-abbrev' in this hook.
350;; @r{expansion should continue.} 355 ;; Hence we want the "actual" call following this hook to be a no-op.
351 356 (setq abbrev-start-location (point-max)
352;; @r{The function's return value makes no difference.} 357 abbrev-start-location-buffer (current-buffer))))
353 358
354(defun query-if-not-space () 359(add-hook 'foo-mode-hook
355 (if (/= ?\s last-command-char) 360 #'(lambda ()
356 (if (not (y-or-n-p "Do you want to expand this abbrev? ")) 361 (add-hook 'pre-abbrev-expand-hook
357 (error "Not expanding this abbrev")))) 362 'foo-mode-pre-abbrev-expand
363 nil t)))
358@end smallexample 364@end smallexample
359 365
366Note that @code{foo-mode-pre-abbrex-expand} just returns @code{nil}
367without doing anything for lines not starting with @samp{#}. Hence
368abbrevs expand normally using @code{foo-mode-abbrev-table} as local
369abbrev table for such lines.
370
360@node Standard Abbrev Tables, , Abbrev Expansion, Abbrevs 371@node Standard Abbrev Tables, , Abbrev Expansion, Abbrevs
361@comment node-name, next, previous, up 372@comment node-name, next, previous, up
362@section Standard Abbrev Tables 373@section Standard Abbrev Tables
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog
index 3b69d955392..923f52debdd 100644
--- a/lwlib/ChangeLog
+++ b/lwlib/ChangeLog
@@ -1,3 +1,7 @@
12004-08-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * lwlib.h (_widget_value): Added lname and lkey.
4
12004-01-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 52004-01-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 6
3 * xlwmenuP.h (_XlwMenu_part): Added top_depth. 7 * xlwmenuP.h (_XlwMenu_part): Added top_depth.
diff --git a/lwlib/lwlib.h b/lwlib/lwlib.h
index 02560e47545..a141c600526 100644
--- a/lwlib/lwlib.h
+++ b/lwlib/lwlib.h
@@ -64,10 +64,12 @@ enum menu_separator
64typedef struct _widget_value 64typedef struct _widget_value
65{ 65{
66 /* name of widget */ 66 /* name of widget */
67 Lisp_Object lname;
67 char* name; 68 char* name;
68 /* value (meaning depend on widget type) */ 69 /* value (meaning depend on widget type) */
69 char* value; 70 char* value;
70 /* keyboard equivalent. no implications for XtTranslations */ 71 /* keyboard equivalent. no implications for XtTranslations */
72 Lisp_Object lkey;
71 char* key; 73 char* key;
72 /* Help string or nil if none. 74 /* Help string or nil if none.
73 GC finds this string through the frame's menu_bar_vector 75 GC finds this string through the frame's menu_bar_vector
diff --git a/man/ChangeLog b/man/ChangeLog
index 72024ae917a..8af5062c7e7 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,9 +1,76 @@
12004-08-30 Luc Teirlinck <teirllm@auburn.edu>
2
3 * indent.texi: Various minor changes in addition to:
4 (Indentation Commands): Correct description of `indent-relative'.
5 (Tab Stops): <TAB> is no longer bound to `tab-to-tab-stop' in Text
6 mode. The *Tab Stops* buffer uses Overwrite Mode.
7 (Just Spaces): `untabify' converts sequences of at least two
8 spaces to tabs.
9
102004-08-28 Eli Zaretskii <eliz@gnu.org>
11
12 * faq.texi (Emacs for MS-DOS): Update URLs for the MS-DOS port of
13 Emacs and related programs.
14
152004-08-27 Luc Teirlinck <teirllm@auburn.edu>
16
17 * frames.texi (Secondary Selection): Setting the secondary
18 selection with M-Drag-Mouse-1 does not alter the kill ring,
19 setting it with M-Mouse-1 and M-Mouse-3 does.
20 (Mode Line Mouse): C-Mouse-2 on scroll bar now also works for
21 toolkit scroll bars.
22 (Scroll Bars): Ditto.
23
24 * windows.texi (Basic Window): When using a window system, the value
25 of point in a non-selected window is indicated by a hollow box.
26 (Split Window): Side by side windows are separated by a scroll bar,
27 if scroll bars are used.
28 C-Mouse-2 on scroll bar now also works for toolkit scroll bars.
29 (Change Window): Correct Mouse-2 vs Mouse-3 mess-up.
30 (Window Convenience): Update bindings for `winner-undo' and
31 `winner-redo'.
32
33 * ack.texi (Acknowledgments): Use `@unnumbered'.
34 * misc.texi : Adapt sectioning in Info to the node structure.
35 (Invoking emacsclient): Make "Invoking emacsclient" a subsection
36 of "Using Emacs as a Server".
37 * building.texi (Building): Interchange nodes (for correct numbering).
38 * programs.texi (Programs): Interchange nodes (for correct numbering).
39 * killing.texi, entering.texi, commands.texi: Adapt sectioning in
40 Info to the node structure.
41 * emacs.texi: Make "GNU GENERAL PUBLIC LICENSE" an appendix.
42 Rearrange order of nodes and sections such that both "GNU GENERAL
43 PUBLIC LICENSE" and "GNU Free Documentation License" appear at the
44 end, as appropriate for appendices.
45 (Acknowledgments): Put inside @iftex instead of @ifnotinfo.
46 Use `@unnumberedsec'.
47 * trouble.texi: Adapt sectioning in Info to the node structure.
48 Adapt node pointers to change in emacs.texi.
49 * cmdargs.texi, doclicense.texi: Adapt node pointers.
50
512004-08-27 Richard M. Stallman <rms@gnu.org>
52
53 * faq.texi: Fix texinfo usage, esp. doublequotes.
54 (Difference between Emacs and XEmacs): Some clarification.
55
56 * faq.texi (Difference between Emacs and XEmacs):
57 Explain not to contrast XEmacs with GNU Emacs.
58
592004-08-26 Richard M. Stallman <rms@gnu.org>
60
61 * faq.texi (Difference between Emacs and XEmacs): Rewrite.
62
632004-08-25 Kenichi Handa <handa@m17n.org>
64
65 * custom.texi (Non-ASCII Rebinding): Fix and simplify the
66 description for unibyte mode.
67
12004-08-23 Luc Teirlinck <teirllm@auburn.edu> 682004-08-23 Luc Teirlinck <teirllm@auburn.edu>
2 69
3 * display.texi (Font Lock): Correct invalid @xref. 70 * display.texi (Font Lock): Correct invalid (for hardcopy) @xref.
4 71
5 * search.texi (Regexps): Correct cryptic @ref. 72 * search.texi (Regexps): Correct cryptic (in hardcopy) @ref.
6 (Configuring Scrolling): Correct invalid @xref. 73 (Configuring Scrolling): Correct invalid (for hardcopy) @xref.
7 (Regexp Replace): Standardize reference to hardcopy Elisp Manual 74 (Regexp Replace): Standardize reference to hardcopy Elisp Manual
8 in @pxref. 75 in @pxref.
9 76
diff --git a/man/ack.texi b/man/ack.texi
index 5d64b38cdf7..0d957dcef86 100644
--- a/man/ack.texi
+++ b/man/ack.texi
@@ -4,7 +4,7 @@
4@c See file emacs.texi for copying conditions. 4@c See file emacs.texi for copying conditions.
5@c 5@c
6@node Acknowledgments, Screen, Concept Index, Top 6@node Acknowledgments, Screen, Concept Index, Top
7@chapter Acknowledgments 7@unnumbered Acknowledgments
8 8
9Many people have contributed code included in the Free Software 9Many people have contributed code included in the Free Software
10Foundation's distribution of GNU Emacs. To show our appreciation for 10Foundation's distribution of GNU Emacs. To show our appreciation for
diff --git a/man/building.texi b/man/building.texi
index f7c1883e0d3..85240003eec 100644
--- a/man/building.texi
+++ b/man/building.texi
@@ -23,8 +23,8 @@ in the larger process of developing and maintaining programs.
23 with different facilities for running 23 with different facilities for running
24 the Lisp programs. 24 the Lisp programs.
25* Libraries: Lisp Libraries. Creating Lisp programs to run in Emacs. 25* Libraries: Lisp Libraries. Creating Lisp programs to run in Emacs.
26* Interaction: Lisp Interaction. Executing Lisp in an Emacs buffer.
27* Eval: Lisp Eval. Executing a single Lisp expression in Emacs. 26* Eval: Lisp Eval. Executing a single Lisp expression in Emacs.
27* Interaction: Lisp Interaction. Executing Lisp in an Emacs buffer.
28* External Lisp:: Communicating through Emacs with a separate Lisp. 28* External Lisp:: Communicating through Emacs with a separate Lisp.
29@end menu 29@end menu
30 30
@@ -644,7 +644,7 @@ to know GDB commands.
644@menu 644@menu
645* Layout:: Control the number of displayed buffers. 645* Layout:: Control the number of displayed buffers.
646* Breakpoints Buffer:: A breakpoint control panel. 646* Breakpoints Buffer:: A breakpoint control panel.
647* Stack Buffer:: Select a frame from the call stack. 647* Stack Buffer:: Select a frame from the call stack.
648* Watch Expressions:: Monitor variable values in the speedbar. 648* Watch Expressions:: Monitor variable values in the speedbar.
649* Other Buffers:: Input/output, locals, registers and assembler buffers. 649* Other Buffers:: Input/output, locals, registers and assembler buffers.
650@end menu 650@end menu
@@ -698,12 +698,12 @@ is the relevant buffer type e.g breakpoints.
698@node Breakpoints Buffer 698@node Breakpoints Buffer
699@subsubsection Breakpoints Buffer 699@subsubsection Breakpoints Buffer
700 700
701The breakpoints buffer shows the existing breakpoints and watchpoints 701The breakpoints buffer shows the existing breakpoints and watchpoints
702(@pxref{Breakpoints,,, gdb, The GNU debugger}). It has three special 702(@pxref{Breakpoints,,, gdb, The GNU debugger}). It has three special
703commands: 703commands:
704 704
705@table @kbd 705@table @kbd
706@item @key{SPC} 706@item @key{SPC}
707@kindex SPC @r{(GDB breakpoints buffer)} 707@kindex SPC @r{(GDB breakpoints buffer)}
708@findex gdb-toggle-breakpoint 708@findex gdb-toggle-breakpoint
709Enable/disable the breakpoint at the current line 709Enable/disable the breakpoint at the current line
diff --git a/man/cmdargs.texi b/man/cmdargs.texi
index f528b804c72..7548431aa4c 100644
--- a/man/cmdargs.texi
+++ b/man/cmdargs.texi
@@ -1,7 +1,7 @@
1@c This is part of the Emacs manual. 1@c This is part of the Emacs manual.
2@c Copyright (C) 1985,86,87,93,94,95,97,2001,03,2004 Free Software Foundation, Inc. 2@c Copyright (C) 1985,86,87,93,94,95,97,2001,03,2004 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions. 3@c See file emacs.texi for copying conditions.
4@node Command Arguments, X Resources, Service, Top 4@node Command Arguments, X Resources, GNU Free Documentation License, Top
5@appendix Command Line Arguments 5@appendix Command Line Arguments
6@cindex command line arguments 6@cindex command line arguments
7@cindex arguments (command line) 7@cindex arguments (command line)
diff --git a/man/commands.texi b/man/commands.texi
index ea14e36128a..54ec50acfe8 100644
--- a/man/commands.texi
+++ b/man/commands.texi
@@ -10,6 +10,10 @@ of @dfn{keys} and @dfn{commands}, which are fundamental for understanding
10how Emacs interprets your keyboard and mouse input. 10how Emacs interprets your keyboard and mouse input.
11@end iftex 11@end iftex
12 12
13@ifnottex
14@raisesections
15@end ifnottex
16
13@node User Input, Keys, Screen, Top 17@node User Input, Keys, Screen, Top
14@section Kinds of User Input 18@section Kinds of User Input
15@cindex input with the keyboard 19@cindex input with the keyboard
@@ -266,6 +270,10 @@ with codes 128 through 255 can also appear in multibyte buffers.
266alphabet of non-@acronym{ASCII} characters, but they all fit in one byte. They 270alphabet of non-@acronym{ASCII} characters, but they all fit in one byte. They
267use codes 0200 through 0377. @xref{Single-Byte Character Support}. 271use codes 0200 through 0377. @xref{Single-Byte Character Support}.
268 272
273@ifnottex
274@lowersections
275@end ifnottex
276
269@ignore 277@ignore
270 arch-tag: 9be43eef-d1f4-4d03-a916-c741ea713a45 278 arch-tag: 9be43eef-d1f4-4d03-a916-c741ea713a45
271@end ignore 279@end ignore
diff --git a/man/custom.texi b/man/custom.texi
index aa5b35dc43e..d27bc8e0ed5 100644
--- a/man/custom.texi
+++ b/man/custom.texi
@@ -1635,17 +1635,15 @@ The Emacs Lisp Reference Manual}.}:
1635Type @kbd{C-q} followed by the key you want to bind, to insert @var{char}. 1635Type @kbd{C-q} followed by the key you want to bind, to insert @var{char}.
1636 1636
1637Since this puts a non-@acronym{ASCII} character in the @file{.emacs}, 1637Since this puts a non-@acronym{ASCII} character in the @file{.emacs},
1638you should specify the proper coding system for that file. @xref{Init 1638you should specify for that file a coding system that supports
1639Syntax}. You should specify the same coding system for the file that 1639that character. @xref{Init Syntax}.
1640you use for your keyboard.
1641 1640
1642@strong{Warning:} if you change the keyboard encoding, or change 1641@strong{Warning:} if you change the keyboard encoding, such that the code that
1643from unibyte to multibyte mode, such that the code that
1644@kbd{C-q} inserts becomes different, you'll need to edit the 1642@kbd{C-q} inserts becomes different, you'll need to edit the
1645Lisp expression accordingly. 1643Lisp expression accordingly.
1646 1644
1647If you bind 8-bit characters like this in your init file, you may find it 1645@strong{Warning:} @kbd{C-q} will insert the wrong code if you visit
1648convenient to specify that it is unibyte. @xref{Enabling Multibyte}. 1646the file @file{.emacs} in a unibyte buffer, so don't do that.
1649 1647
1650@node Mouse Buttons 1648@node Mouse Buttons
1651@subsection Rebinding Mouse Buttons 1649@subsection Rebinding Mouse Buttons
diff --git a/man/doclicense.texi b/man/doclicense.texi
index 23ec98c202f..78ec35f5aab 100644
--- a/man/doclicense.texi
+++ b/man/doclicense.texi
@@ -1,6 +1,5 @@
1@c -*-texinfo-*- 1@c -*-texinfo-*-
2@node GNU Free Documentation License, Intro, Copying, Top 2@node GNU Free Documentation License, Command Arguments, Copying, Top
3
4@appendix GNU Free Documentation License 3@appendix GNU Free Documentation License
5@center Version 1.1, March 2000 4@center Version 1.1, March 2000
6 5
diff --git a/man/emacs.texi b/man/emacs.texi
index ad9658ab368..82d87f693aa 100644
--- a/man/emacs.texi
+++ b/man/emacs.texi
@@ -901,7 +901,7 @@ all GNU Emacs features. We don't try to describe VMS usage in this
901manual. @xref{MS-DOS}, for information about using Emacs on MS-DOS. 901manual. @xref{MS-DOS}, for information about using Emacs on MS-DOS.
902@end iftex 902@end iftex
903 903
904@node Distrib, Copying, Top, Top 904@node Distrib, Intro, Top, Top
905@unnumbered Distribution 905@unnumbered Distribution
906 906
907GNU Emacs is @dfn{free software}; this means that everyone is free to 907GNU Emacs is @dfn{free software}; this means that everyone is free to
@@ -955,9 +955,9 @@ company policy is unsympathetic to the idea of donating to charity, you
955might instead suggest ordering a CD-ROM from the Foundation 955might instead suggest ordering a CD-ROM from the Foundation
956occasionally, or subscribing to periodic updates. 956occasionally, or subscribing to periodic updates.
957 957
958@ifnotinfo 958@iftex
959@node Acknowledgments, Copying, Distrib, Top 959@node Acknowledgments, Intro, Distrib, Top
960@section Acknowledgments 960@unnumberedsec Acknowledgments
961 961
962Contributors to GNU Emacs include Per Abrahamsen, Jay K. Adams, Joe 962Contributors to GNU Emacs include Per Abrahamsen, Jay K. Adams, Joe
963Arceneaux, Boaz Ben-Zvi, Jim Blandy, Terrence Brannon, Frank Bresz, 963Arceneaux, Boaz Ben-Zvi, Jim Blandy, Terrence Brannon, Frank Bresz,
@@ -1000,10 +1000,102 @@ Warsaw, Morten Welinder, Joseph Brian Wells, Rodney Whitby, Ed
1000Wilkinson, Mike Williams, Steven A. Wood, Dale R. Worley, Felix 1000Wilkinson, Mike Williams, Steven A. Wood, Dale R. Worley, Felix
1001S. T. Wu, Tom Wurgler, Eli Zaretskii, Jamie Zawinski, Ian T. Zimmermann, 1001S. T. Wu, Tom Wurgler, Eli Zaretskii, Jamie Zawinski, Ian T. Zimmermann,
1002Reto Zimmermann, and Neal Ziring. 1002Reto Zimmermann, and Neal Ziring.
1003@end ifnotinfo 1003@end iftex
1004
1005@node Intro, Glossary, Distrib, Top
1006@unnumbered Introduction
1007
1008 You are reading about GNU Emacs, the GNU incarnation of the advanced,
1009self-documenting, customizable, extensible real-time display editor Emacs.
1010(The `G' in `GNU' is not silent.)
1011
1012 We say that Emacs is a @dfn{display} editor because normally the text
1013being edited is visible on the screen and is updated automatically as you
1014type your commands. @xref{Screen,Display}.
1015
1016 We call it a @dfn{real-time} editor because the display is updated very
1017frequently, usually after each character or pair of characters you
1018type. This minimizes the amount of information you must keep in your
1019head as you edit. @xref{Basic,Real-time,Basic Editing}.
1020
1021 We call Emacs advanced because it provides facilities that go beyond
1022simple insertion and deletion: controlling subprocesses; automatic
1023indentation of programs; viewing two or more files at once; editing
1024formatted text; and dealing in terms of characters, words, lines,
1025sentences, paragraphs, and pages, as well as expressions and comments in
1026several different programming languages.
1027
1028 @dfn{Self-documenting} means that at any time you can type a special
1029character, @kbd{Control-h}, to find out what your options are. You can
1030also use it to find out what any command does, or to find all the commands
1031that pertain to a topic. @xref{Help}.
1032
1033 @dfn{Customizable} means that you can change the definitions of Emacs
1034commands in little ways. For example, if you use a programming language in
1035which comments start with @samp{<**} and end with @samp{**>}, you can tell
1036the Emacs comment manipulation commands to use those strings
1037(@pxref{Comments}). Another sort of customization is rearrangement of the
1038command set. For example, if you prefer the four basic cursor motion
1039commands (up, down, left and right) on keys in a diamond pattern on the
1040keyboard, you can rebind the keys that way. @xref{Customization}.
1041
1042 @dfn{Extensible} means that you can go beyond simple customization and
1043write entirely new commands, programs in the Lisp language to be run by
1044Emacs's own Lisp interpreter. Emacs is an ``on-line extensible''
1045system, which means that it is divided into many functions that call
1046each other, any of which can be redefined in the middle of an editing
1047session. Almost any part of Emacs can be replaced without making a
1048separate copy of all of Emacs. Most of the editing commands of Emacs
1049are written in Lisp; the few exceptions could have been written
1050in Lisp but are written in C for efficiency. Although only a programmer
1051can write an extension, anybody can use it afterward. If you want to
1052learn Emacs Lisp programming, we recommend the @cite{Introduction to
1053Emacs Lisp} by Robert J. Chassell, also published by the Free Software
1054Foundation.
1055
1056 When run under the X Window System, Emacs provides its own menus and
1057convenient bindings to mouse buttons. But Emacs can provide many of the
1058benefits of a window system on a text-only terminal. For instance, you
1059can look at or edit several files at once, move text between files, and
1060edit files while running shell commands.
1061
1062@include screen.texi
1063@include commands.texi
1064@include entering.texi
1065@include basic.texi
1066@include mini.texi
1067@include m-x.texi
1068@include help.texi
1069@include mark.texi
1070@include killing.texi
1071@include regs.texi
1072@include display.texi
1073@include search.texi
1074@include fixit.texi
1075@include kmacro.texi
1076@include files.texi
1077@include buffers.texi
1078@include windows.texi
1079@include frames.texi
1080@include mule.texi
1081@include major.texi
1082@include indent.texi
1083@include text.texi
1084@include programs.texi
1085@include building.texi
1086@include maintaining.texi
1087@include abbrevs.texi
1088@include picture.texi
1089@include sending.texi
1090@include rmail.texi
1091@include dired.texi
1092@include calendar.texi
1093@include misc.texi
1094@include custom.texi
1095@include trouble.texi
1004 1096
1005@node Copying, GNU Free Documentation License, Distrib, Top 1097@node Copying, GNU Free Documentation License, Service, Top
1006@unnumbered GNU GENERAL PUBLIC LICENSE 1098@appendix GNU GENERAL PUBLIC LICENSE
1007@center Version 2, June 1991 1099@center Version 2, June 1991
1008 1100
1009@display 1101@display
@@ -1399,98 +1491,6 @@ library. If this is what you want to do, use the GNU Library General
1399Public License instead of this License. 1491Public License instead of this License.
1400 1492
1401@include doclicense.texi 1493@include doclicense.texi
1402
1403@node Intro, Glossary, GNU Free Documentation License, Top
1404@unnumbered Introduction
1405
1406 You are reading about GNU Emacs, the GNU incarnation of the advanced,
1407self-documenting, customizable, extensible real-time display editor Emacs.
1408(The `G' in `GNU' is not silent.)
1409
1410 We say that Emacs is a @dfn{display} editor because normally the text
1411being edited is visible on the screen and is updated automatically as you
1412type your commands. @xref{Screen,Display}.
1413
1414 We call it a @dfn{real-time} editor because the display is updated very
1415frequently, usually after each character or pair of characters you
1416type. This minimizes the amount of information you must keep in your
1417head as you edit. @xref{Basic,Real-time,Basic Editing}.
1418
1419 We call Emacs advanced because it provides facilities that go beyond
1420simple insertion and deletion: controlling subprocesses; automatic
1421indentation of programs; viewing two or more files at once; editing
1422formatted text; and dealing in terms of characters, words, lines,
1423sentences, paragraphs, and pages, as well as expressions and comments in
1424several different programming languages.
1425
1426 @dfn{Self-documenting} means that at any time you can type a special
1427character, @kbd{Control-h}, to find out what your options are. You can
1428also use it to find out what any command does, or to find all the commands
1429that pertain to a topic. @xref{Help}.
1430
1431 @dfn{Customizable} means that you can change the definitions of Emacs
1432commands in little ways. For example, if you use a programming language in
1433which comments start with @samp{<**} and end with @samp{**>}, you can tell
1434the Emacs comment manipulation commands to use those strings
1435(@pxref{Comments}). Another sort of customization is rearrangement of the
1436command set. For example, if you prefer the four basic cursor motion
1437commands (up, down, left and right) on keys in a diamond pattern on the
1438keyboard, you can rebind the keys that way. @xref{Customization}.
1439
1440 @dfn{Extensible} means that you can go beyond simple customization and
1441write entirely new commands, programs in the Lisp language to be run by
1442Emacs's own Lisp interpreter. Emacs is an ``on-line extensible''
1443system, which means that it is divided into many functions that call
1444each other, any of which can be redefined in the middle of an editing
1445session. Almost any part of Emacs can be replaced without making a
1446separate copy of all of Emacs. Most of the editing commands of Emacs
1447are written in Lisp; the few exceptions could have been written
1448in Lisp but are written in C for efficiency. Although only a programmer
1449can write an extension, anybody can use it afterward. If you want to
1450learn Emacs Lisp programming, we recommend the @cite{Introduction to
1451Emacs Lisp} by Robert J. Chassell, also published by the Free Software
1452Foundation.
1453
1454 When run under the X Window System, Emacs provides its own menus and
1455convenient bindings to mouse buttons. But Emacs can provide many of the
1456benefits of a window system on a text-only terminal. For instance, you
1457can look at or edit several files at once, move text between files, and
1458edit files while running shell commands.
1459
1460@include screen.texi
1461@include commands.texi
1462@include entering.texi
1463@include basic.texi
1464@include mini.texi
1465@include m-x.texi
1466@include help.texi
1467@include mark.texi
1468@include killing.texi
1469@include regs.texi
1470@include display.texi
1471@include search.texi
1472@include fixit.texi
1473@include kmacro.texi
1474@include files.texi
1475@include buffers.texi
1476@include windows.texi
1477@include frames.texi
1478@include mule.texi
1479@include major.texi
1480@include indent.texi
1481@include text.texi
1482@include programs.texi
1483@include building.texi
1484@include maintaining.texi
1485@include abbrevs.texi
1486@include picture.texi
1487@include sending.texi
1488@include rmail.texi
1489@include dired.texi
1490@include calendar.texi
1491@include misc.texi
1492@include custom.texi
1493@include trouble.texi
1494@include cmdargs.texi 1494@include cmdargs.texi
1495@include xresources.texi 1495@include xresources.texi
1496 1496
diff --git a/man/entering.texi b/man/entering.texi
index 9200082328a..31ac47b3c62 100644
--- a/man/entering.texi
+++ b/man/entering.texi
@@ -59,6 +59,10 @@ Emacs running, you can use the @command{emacsclient} program to open a
59file in the already running Emacs. @xref{Emacs Server}, for more 59file in the already running Emacs. @xref{Emacs Server}, for more
60information on editing files with Emacs from other programs. 60information on editing files with Emacs from other programs.
61 61
62@ifnottex
63@raisesections
64@end ifnottex
65
62@node Exiting, Basic, Entering Emacs, Top 66@node Exiting, Basic, Entering Emacs, Top
63@section Exiting Emacs 67@section Exiting Emacs
64@cindex exiting 68@cindex exiting
@@ -150,6 +154,10 @@ systems as the characters for stopping or killing a program, but that is
150their only relationship with the operating system. You can customize 154their only relationship with the operating system. You can customize
151these keys to run any commands of your choice (@pxref{Keymaps}). 155these keys to run any commands of your choice (@pxref{Keymaps}).
152 156
157@ifnottex
158@lowersections
159@end ifnottex
160
153@ignore 161@ignore
154 arch-tag: df798d8b-f253-4113-b585-f528f078a944 162 arch-tag: df798d8b-f253-4113-b585-f528f078a944
155@end ignore 163@end ignore
diff --git a/man/faq.texi b/man/faq.texi
index c887739ca8f..6ca849d7b1e 100644
--- a/man/faq.texi
+++ b/man/faq.texi
@@ -17,7 +17,7 @@ Copyright 1990,1991,1992 Joseph Brian Wells@*
17 17
18@quotation 18@quotation
19This list of frequently asked questions about GNU Emacs with answers 19This list of frequently asked questions about GNU Emacs with answers
20("FAQ") may be translated into other languages, transformed into other 20(``FAQ'') may be translated into other languages, transformed into other
21formats (e.g. Texinfo, Info, WWW, WAIS), and updated with new information. 21formats (e.g. Texinfo, Info, WWW, WAIS), and updated with new information.
22 22
23The same conditions apply to any derivative of the FAQ as apply to the FAQ 23The same conditions apply to any derivative of the FAQ as apply to the FAQ
@@ -906,8 +906,8 @@ where that is).
906Emacs General Public License 906Emacs General Public License
907 907
908@item DISTRIB 908@item DISTRIB
909Emacs Availability Information, including the popular "Free Software 909Emacs Availability Information, including the popular Free Software
910Foundation Order Form" 910Foundation Order Form
911 911
912@item FTP 912@item FTP
913How to get GNU Software by Internet FTP or by UUCP 913How to get GNU Software by Internet FTP or by UUCP
@@ -935,7 +935,7 @@ Emacs news, a history of recent user-visible changes
935GNU Service Directory 935GNU Service Directory
936 936
937@item SUN-SUPPORT 937@item SUN-SUPPORT
938including "Using Emacstool with GNU Emacs" 938including ``Using Emacstool with GNU Emacs''
939 939
940@end table 940@end table
941 941
@@ -1045,7 +1045,7 @@ send usenet/news.answers/GNU-Emacs-FAQ/part5
1045@end example 1045@end example
1046 1046
1047For more information, send email to @email{mail-server@@rtfm.mit.edu} 1047For more information, send email to @email{mail-server@@rtfm.mit.edu}
1048with "help" and "index" in the body on separate lines. 1048with @samp{help} and @samp{index} in the body on separate lines.
1049 1049
1050@item 1050@item
1051As the very last resort, you can e-mail a request to 1051As the very last resort, you can e-mail a request to
@@ -1864,7 +1864,7 @@ edge of the window.
1864@end itemize 1864@end itemize
1865 1865
1866@node Overwrite mode, Turning off beeping, Horizontal scrolling, Common requests 1866@node Overwrite mode, Turning off beeping, Horizontal scrolling, Common requests
1867@section How do I make Emacs "typeover" or "overwrite" instead of inserting? 1867@section How do I make Emacs ``typeover'' or ``overwrite'' instead of inserting?
1868@cindex @key{Insert} 1868@cindex @key{Insert}
1869@cindex @code{overwrite-mode} 1869@cindex @code{overwrite-mode}
1870@cindex Overwriting existing text 1870@cindex Overwriting existing text
@@ -2075,7 +2075,7 @@ onwards), to look at the resource names for the menu bar, assuming Emacs
2075was compiled with the X toolkit. 2075was compiled with the X toolkit.
2076 2076
2077@node Evaluating Emacs Lisp code, Changing the length of a Tab, Valid X resources, Common requests 2077@node Evaluating Emacs Lisp code, Changing the length of a Tab, Valid X resources, Common requests
2078@section How do I execute ("evaluate") a piece of Emacs Lisp code? 2078@section How do I execute (``evaluate'') a piece of Emacs Lisp code?
2079@cindex Evaluating Lisp code 2079@cindex Evaluating Lisp code
2080@cindex Lisp forms, evaluating 2080@cindex Lisp forms, evaluating
2081 2081
@@ -2162,7 +2162,7 @@ since version 19.20. @xref{Changing the included text prefix}, for
2162additional information. 2162additional information.
2163 2163
2164@node Underlining paragraphs, Repeating a command as many times as possible, Inserting > at the beginning of each line, Common requests 2164@node Underlining paragraphs, Repeating a command as many times as possible, Inserting > at the beginning of each line, Common requests
2165@section How do I insert "_^H" before each character in a region to get an underlined paragraph? 2165@section How do I insert @samp{_^H} before each character in a region to get an underlined paragraph?
2166@cindex Underlining a region of text 2166@cindex Underlining a region of text
2167@cindex @code{underline-region} 2167@cindex @code{underline-region}
2168 2168
@@ -2264,7 +2264,7 @@ Quick command-line switch descriptions are also available. For example,
2264You probably don't want to do this, since backups are useful, especially 2264You probably don't want to do this, since backups are useful, especially
2265when something goes wrong. 2265when something goes wrong.
2266 2266
2267To avoid seeing backup files (and other "uninteresting" files) in Dired, 2267To avoid seeing backup files (and other ``uninteresting'' files) in Dired,
2268load @code{dired-x} by adding the following to your @file{.emacs} file: 2268load @code{dired-x} by adding the following to your @file{.emacs} file:
2269 2269
2270@lisp 2270@lisp
@@ -2733,7 +2733,7 @@ sizes of up to 33,554,431 bytes):
2733@end example 2733@end example
2734 2734
2735@noindent 2735@noindent
2736This method may result in "ILLEGAL DATATYPE" and other random errors on 2736This method may result in ``ILLEGAL DATATYPE'' and other random errors on
2737some machines. 2737some machines.
2738 2738
2739@email{daveg@@csvax.cs.caltech.edu, David Gillespie} explains how this 2739@email{daveg@@csvax.cs.caltech.edu, David Gillespie} explains how this
@@ -2824,7 +2824,7 @@ stty -icrnl -onlcr -echo susp ^Z
2824@end example 2824@end example
2825 2825
2826@node Shell process exits abnormally, Problems with Shell Mode on MS-Windows, ^M in the shell buffer, Bugs and problems 2826@node Shell process exits abnormally, Problems with Shell Mode on MS-Windows, ^M in the shell buffer, Bugs and problems
2827@section Why do I get "Process shell exited abnormally with code 1"? 2827@section Why do I get ``Process shell exited abnormally with code 1''?
2828@cindex Abnormal exits from @code{shell-mode} 2828@cindex Abnormal exits from @code{shell-mode}
2829@cindex @code{shell-mode} exits 2829@cindex @code{shell-mode} exits
2830@cindex Process shell exited 2830@cindex Process shell exited
@@ -2881,7 +2881,7 @@ antivirus software; disabling the resident antivirus program solves
2881the problems in those cases. 2881the problems in those cases.
2882 2882
2883@node Termcap/Terminfo entries for Emacs, Spontaneous entry into isearch-mode, Problems with Shell Mode on MS-Windows, Bugs and problems 2883@node Termcap/Terminfo entries for Emacs, Spontaneous entry into isearch-mode, Problems with Shell Mode on MS-Windows, Bugs and problems
2884@section Where is the termcap/terminfo entry for terminal type "emacs"? 2884@section Where is the termcap/terminfo entry for terminal type @samp{emacs}?
2885@cindex Termcap 2885@cindex Termcap
2886@cindex Terminfo 2886@cindex Terminfo
2887@cindex Emacs entries for termcap/terminfo 2887@cindex Emacs entries for termcap/terminfo
@@ -2915,7 +2915,7 @@ if ("$term" == emacs) set term=dumb
2915@end example 2915@end example
2916 2916
2917@node Spontaneous entry into isearch-mode, Problems talking to certain hosts, Termcap/Terminfo entries for Emacs, Bugs and problems 2917@node Spontaneous entry into isearch-mode, Problems talking to certain hosts, Termcap/Terminfo entries for Emacs, Bugs and problems
2918@section Why does Emacs spontaneously start displaying "I-search:" and beeping? 2918@section Why does Emacs spontaneously start displaying @samp{I-search:} and beeping?
2919@cindex Spontaneous entry into isearch-mode 2919@cindex Spontaneous entry into isearch-mode
2920@cindex isearch-mode, spontaneous entry into 2920@cindex isearch-mode, spontaneous entry into
2921@cindex Beeping without obvious reason 2921@cindex Beeping without obvious reason
@@ -2972,7 +2972,7 @@ properly told to do DNS lookups with the correct command line switch.
2972@end itemize 2972@end itemize
2973 2973
2974@node Errors with init files, Emacs ignores X resources, Problems talking to certain hosts, Bugs and problems 2974@node Errors with init files, Emacs ignores X resources, Problems talking to certain hosts, Bugs and problems
2975@section Why does Emacs say "Error in init file"? 2975@section Why does Emacs say @samp{Error in init file}?
2976@cindex Error in @file{.emacs} 2976@cindex Error in @file{.emacs}
2977@cindex Error in init file 2977@cindex Error in init file
2978@cindex Init file, errors in 2978@cindex Init file, errors in
@@ -3238,7 +3238,7 @@ access control enabled, only authorized clients can connect
3238@end itemize 3238@end itemize
3239 3239
3240@node Dired claims that no file is on this line, , Security risks with Emacs, Bugs and problems 3240@node Dired claims that no file is on this line, , Security risks with Emacs, Bugs and problems
3241@section Dired says, "no file on this line" when I try to do something. 3241@section Dired says, @samp{no file on this line} when I try to do something.
3242@cindex Dired does not see a file 3242@cindex Dired does not see a file
3243 3243
3244@c FIXME: I think this is fixed in Emacs 21, but I didn't have time to 3244@c FIXME: I think this is fixed in Emacs 21, but I didn't have time to
@@ -3441,7 +3441,7 @@ Emacs needs to be linked with the static version of the X11 library,
3441@file{libX11.a}. This may be missing. 3441@file{libX11.a}. This may be missing.
3442 3442
3443On OpenWindows, you may need to use @code{add_services} to add the 3443On OpenWindows, you may need to use @code{add_services} to add the
3444"OpenWindows Programmers" optional software category from the CD-ROM. 3444``OpenWindows Programmers'' optional software category from the CD-ROM.
3445 3445
3446On HP-UX 8.0, you may need to run @code{update} again to load the 3446On HP-UX 8.0, you may need to run @code{update} again to load the
3447X11-PRG ``fileset''. This may be missing even if you specified ``all 3447X11-PRG ``fileset''. This may be missing even if you specified ``all
@@ -3580,51 +3580,37 @@ A list of sites mirroring @samp{ftp.gnu.org} can be found at
3580@uref{http://www.gnu.org/order/ftp.html} 3580@uref{http://www.gnu.org/order/ftp.html}
3581 3581
3582@node Difference between Emacs and XEmacs, Emacs for MS-DOS, Current GNU distributions, Finding Emacs and related packages 3582@node Difference between Emacs and XEmacs, Emacs for MS-DOS, Current GNU distributions, Finding Emacs and related packages
3583@section What is the difference between Emacs and XEmacs (formerly "Lucid Emacs")? 3583@section What is the difference between Emacs and XEmacs (formerly Lucid Emacs)?
3584@cindex XEmacs 3584@cindex XEmacs
3585@cindex Difference Emacs and XEmacs 3585@cindex Difference Emacs and XEmacs
3586@cindex Lucid Emacs 3586@cindex Lucid Emacs
3587@cindex Epoch 3587@cindex Epoch
3588 3588
3589First of all, they're both GNU Emacs. XEmacs is just as much a later 3589XEmacs is a branch version of Emacs. It was first called Lucid Emacs,
3590version of GNU Emacs as the FSF-distributed version. This FAQ refers to 3590and was initially derived from a prerelease version of Emacs 19. In
3591the latest version to be distributed by the FSF as ``Emacs,'' partly 3591this FAQ, we use the name ``Emacs'' only for the official version.
3592because the XEmacs maintainers now refer to their product using the 3592
3593``XEmacs'' name, and partly because there isn't any accurate way to 3593Emacs and XEmacs each come with Lisp packages that are lacking in the
3594differentiate between the two without getting mired in paragraphs of 3594other. The two versions have some significant differences at the Lisp
3595legalese and history. 3595programming level. Their current features are roughly comparable,
3596 3596though the support for some operating systems, character sets and
3597XEmacs, which began life as Lucid Emacs, is based on an early version of 3597specific packages might be quite different.
3598Emacs 19 and Epoch, an X-aware version of Emacs 18. 3598
3599 3599Some XEmacs code has been contributed to Emacs, and we would like to
3600Emacs (i.e., the version distributed by the FSF) has a larger installed 3600use other parts, but the earlier XEmacs maintainers did not always
3601base and now always contains the MULE multilingual facilities. 3601keep track of the authors of contributed code, which makes it
3602XEmacs can do some clever tricks with X and MS-Windows, such as 3602impossible for the FSF to get copyright papers signed for that code.
3603putting arbitrary graphics in a buffer. Similar facilities have been 3603(The FSF requires these papers for all the code included in the Emacs
3604implemented for Emacs as part of a new redisplay implementation for 3604release, aside from generic C support packages that retain their
3605Emacs 21, and are available in the latest Emacs releases. 3605separate identity and are not integrated into the code of Emacs
3606Emacs and XEmacs each come with 3606proper.)
3607Lisp packages that are lacking in the other; RMS says that the FSF would 3607
3608include more packages that come with XEmacs, but that the XEmacs 3608If you want to talk about these two versions and distinguish them,
3609maintainers don't always keep track of the authors of contributed code, 3609please call them ``Emacs'' and ``XEmacs.'' To contrast ``XEmacs''
3610which makes it impossible for the FSF to have certain legal papers 3610with ``GNU Emacs'' would be misleading, since XEmacs too has its
3611signed. (Without these legal papers, the FSF will not distribute Lisp 3611origin in the work of the GNU Project. Terms such as ``Emacsen'' and
3612packages with Emacs.) The two versions have some 3612``(X)Emacs'' are not wrong, but they are not very clear, so it
3613significant differences at the Lisp programming level. 3613is better to write ``Emacs and XEmacs.''
3614
3615Many XEmacs features have found their way into recent versions of Emacs,
3616and more features can be expected in the future, but there are still many
3617differences between the two.
3618
3619The latest stable branch of XEmacs as of this writing is 21.4; you can
3620get it at
3621
3622@uref{ftp://ftp.xemacs.org/pub/xemacs/xemacs-21.4/xemacs-21.4.12.tar.gz}
3623
3624More information about XEmacs, including a list of frequently asked
3625questions (FAQ), is available at
3626
3627@uref{http://www.xemacs.org/}
3628 3614
3629@node Emacs for MS-DOS, Emacs for Windows, Difference between Emacs and XEmacs, Finding Emacs and related packages 3615@node Emacs for MS-DOS, Emacs for Windows, Difference between Emacs and XEmacs, Finding Emacs and related packages
3630@section Where can I get Emacs for my PC running MS-DOS? 3616@section Where can I get Emacs for my PC running MS-DOS?
@@ -3640,17 +3626,17 @@ Windows (3.X, 9X, ME, NT, and 2000) and supports long file names under
3640Windows 9X, Windows ME, and Windows 2000. More information is available 3626Windows 9X, Windows ME, and Windows 2000. More information is available
3641from 3627from
3642 3628
3643@uref{http://www.simtel.net/pub/djgpp/v2gnu/emacs.README} 3629@uref{ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/emacs.README}
3644 3630
3645The binary itself is available in the files @file{em*.zip} in the 3631The binary itself is available in the files @file{em*.zip} in the
3646directory 3632directory
3647 3633
3648@uref{http://www.simtel.net/pub/djgpp/v2gnu/} 3634@uref{ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/}
3649 3635
3650If you prefer to compile Emacs for yourself, you can do so with the 3636If you prefer to compile Emacs for yourself, you can do so with the
3651current distribution directly. You will need a 386 (or 3637current distribution directly. You will need a 386 (or
3652better) processor, and to be running MS-DOS 3.0 or later. According to 3638better) processor, and to be running MS-DOS 3.0 or later. According to
3653@email{eliz@@is.elta.co.il, Eli Zaretskii} and 3639@email{eliz@@gnu.org, Eli Zaretskii} and
3654@email{hankedr@@dms.auburn.edu, Darrel Hankerson}, you will need the 3640@email{hankedr@@dms.auburn.edu, Darrel Hankerson}, you will need the
3655following: 3641following:
3656 3642
@@ -3664,7 +3650,7 @@ long file names on Windows 9X/ME/2K.
3664You can get the latest release of DJGPP by retrieving all of 3650You can get the latest release of DJGPP by retrieving all of
3665the files in 3651the files in
3666 3652
3667@uref{http://www.simtel.net/pub/gnu/djgpp/v2*} 3653@uref{ftp://ftp.delorie.com/pub/djgpp/current/v2*}
3668 3654
3669@item Unpacking program 3655@item Unpacking program
3670The easiest way is to use @code{djtar} which comes with DJGPP v2.x, 3656The easiest way is to use @code{djtar} which comes with DJGPP v2.x,
@@ -3683,7 +3669,7 @@ actually prevent Emacs from building successfully!
3683@item make, mv, sed, and rm 3669@item make, mv, sed, and rm
3684All of these utilities are available at 3670All of these utilities are available at
3685 3671
3686@uref{http://www.simtel.net/pub/gnu/djgpp/v2gnu} 3672@uref{ftp://ftp.delorie.com/pub/djgpp/current/v2gnu}
3687 3673
368816-bit utilities can be found in GNUish, at 367416-bit utilities can be found in GNUish, at
3689 3675
@@ -3700,7 +3686,7 @@ directory of the Emacs sources contains some additional information
3700regarding Emacs under MS-DOS. 3686regarding Emacs under MS-DOS.
3701 3687
3702For a list of other MS-DOS implementations of Emacs (and Emacs 3688For a list of other MS-DOS implementations of Emacs (and Emacs
3703look-alikes), consult the list of "Emacs implementations and literature," 3689look-alikes), consult the list of ``Emacs implementations and literature,''
3704available at 3690available at
3705 3691
3706@uref{ftp://rtfm.mit.edu/pub/usenet/comp.emacs/} 3692@uref{ftp://rtfm.mit.edu/pub/usenet/comp.emacs/}
@@ -3785,18 +3771,11 @@ menus, and multiple frames. You can get it from
3785@cindex Apple computers, Emacs for 3771@cindex Apple computers, Emacs for
3786@cindex Macintosh, Emacs for 3772@cindex Macintosh, Emacs for
3787 3773
3788An unofficial port of GNU Emacs 18.59 to the Macintosh is available at a
3789number of ftp sites, the home being
3790@uref{ftp://ftp.cs.cornell.edu/pub/parmet/Emacs-1.17.sit.bin}.
3791
3792A port of Emacs 20.4 is available at
3793@uref{http://www.cs.hku.hk/~choi/emacs/index.html}.
3794
3795Beginning with version 21.1, the Macintosh is supported in the official 3774Beginning with version 21.1, the Macintosh is supported in the official
3796Emacs distribution; see the files @file{mac/README} and 3775Emacs distribution; see the files @file{mac/README} and
3797@file{mac/INSTALL} in the Emacs distribution for build instructions. 3776@file{mac/INSTALL} in the Emacs distribution for build instructions.
3798 3777
3799Apple's forthcoming "OS X" is based largely on NeXTSTEP and OpenStep. 3778Apple's ``OS X'' is based largely on NeXTSTEP and OpenStep.
3800@xref{Emacs for NeXTSTEP}, for more details about that version. 3779@xref{Emacs for NeXTSTEP}, for more details about that version.
3801 3780
3802@node Emacs for VMS and DECwindows, Modes for various languages, Emacs for Apple computers, Finding Emacs and related packages 3781@node Emacs for VMS and DECwindows, Modes for various languages, Emacs for Apple computers, Finding Emacs and related packages
@@ -4191,7 +4170,7 @@ jde-subscribe@@sunsite.auc.dk
4191@end table 4170@end table
4192 4171
4193@node Patch, , JDE, Major packages and programs 4172@node Patch, , JDE, Major packages and programs
4194@section Patch --- program to apply "diffs" for updating files 4173@section Patch --- program to apply ``diffs'' for updating files
4195@cindex Updating files with diffs 4174@cindex Updating files with diffs
4196@cindex Patching source files with diffs 4175@cindex Patching source files with diffs
4197@cindex Diffs and patching 4176@cindex Diffs and patching
@@ -4264,8 +4243,8 @@ command are required. For example,
4264 4243
4265@noindent 4244@noindent
4266can be placed directly into the @file{.emacs} file. If the key binding is 4245can be placed directly into the @file{.emacs} file. If the key binding is
4267local, the command is used in conjunction with the "add-hook" command. 4246local, the command is used in conjunction with the @samp{add-hook} function.
4268For example, in tex-mode, a local binding might be 4247For example, in TeX mode, a local binding might be
4269 4248
4270@lisp 4249@lisp
4271(add-hook 'tex-mode-hook 4250(add-hook 'tex-mode-hook
@@ -4304,7 +4283,7 @@ can be bound to a key and thus treated as a macro. For example:
4304@end itemize 4283@end itemize
4305 4284
4306@node Invalid prefix characters, Terminal setup code works after Emacs has begun, Binding keys to commands, Key bindings 4285@node Invalid prefix characters, Terminal setup code works after Emacs has begun, Binding keys to commands, Key bindings
4307@section Why does Emacs say "Key sequence XXX uses invalid prefix characters"? 4286@section Why does Emacs say @samp{Key sequence XXX uses invalid prefix characters}?
4308@cindex Prefix characters, invalid 4287@cindex Prefix characters, invalid
4309@cindex Invalid prefix characters 4288@cindex Invalid prefix characters
4310@cindex Misspecified key sequences 4289@cindex Misspecified key sequences
@@ -4699,7 +4678,7 @@ translation.
4699@cindex Generating control characters 4678@cindex Generating control characters
4700@cindex Control characters, generating 4679@cindex Control characters, generating
4701 4680
4702On terminals (but not under X), some common "aliases" are: 4681On terminals (but not under X), some common ``aliases'' are:
4703 4682
4704@table @asis 4683@table @asis
4705 4684
diff --git a/man/frames.texi b/man/frames.texi
index 7896adc41f6..50b6a4ed398 100644
--- a/man/frames.texi
+++ b/man/frames.texi
@@ -1,5 +1,5 @@
1@c This is part of the Emacs manual. 1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 99, 2000, 2001 2@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 99, 2000, 2001, 2004
3@c Free Software Foundation, Inc. 3@c Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions. 4@c See file emacs.texi for copying conditions.
5@node Frames, International, Windows, Top 5@node Frames, International, Windows, Top
@@ -230,6 +230,8 @@ dragging, the window scrolls at a steady rate until you move the mouse
230back into the window. This way, you can mark regions that don't fit 230back into the window. This way, you can mark regions that don't fit
231entirely on the screen. 231entirely on the screen.
232 232
233This way of setting the secondary selection does not alter the kill ring.
234
233@findex mouse-start-secondary 235@findex mouse-start-secondary
234@kindex M-Mouse-1 236@kindex M-Mouse-1
235@item M-Mouse-1 237@item M-Mouse-1
@@ -240,8 +242,9 @@ Set one endpoint for the @dfn{secondary selection}
240@kindex M-Mouse-3 242@kindex M-Mouse-3
241@item M-Mouse-3 243@item M-Mouse-3
242Make a secondary selection, using the place specified with @kbd{M-Mouse-1} 244Make a secondary selection, using the place specified with @kbd{M-Mouse-1}
243as the other end (@code{mouse-secondary-save-then-kill}). A second click 245as the other end (@code{mouse-secondary-save-then-kill}). This also
244at the same place kills the secondary selection just made. 246puts the selected text in the kill ring. A second click at the same
247place kills the secondary selection just made.
245 248
246@findex mouse-yank-secondary 249@findex mouse-yank-secondary
247@kindex M-Mouse-2 250@kindex M-Mouse-2
@@ -376,8 +379,7 @@ horizontally, above the place in the mode line where you click.
376 379
377@kindex C-Mouse-2 @r{(scroll bar)} 380@kindex C-Mouse-2 @r{(scroll bar)}
378 @kbd{C-Mouse-2} on a scroll bar splits the corresponding window 381 @kbd{C-Mouse-2} on a scroll bar splits the corresponding window
379vertically, unless you are using an X toolkit's implementation of 382vertically. @xref{Split Window}.
380scroll bars. @xref{Split Window}.
381 383
382 The commands above apply to areas of the mode line which do not have 384 The commands above apply to areas of the mode line which do not have
383special mouse bindings of their own. Some areas, such as the buffer 385special mouse bindings of their own. Some areas, such as the buffer
@@ -747,10 +749,8 @@ the level where you click up to the top of the window. @kbd{Mouse-3}
747down to the level where you click. By clicking repeatedly in the same 749down to the level where you click. By clicking repeatedly in the same
748place, you can scroll by the same distance over and over. 750place, you can scroll by the same distance over and over.
749 751
750 If you are using Emacs's own implementation of scroll bars, as opposed 752 You can also click @kbd{C-Mouse-2} in the scroll bar to split a
751to scroll bars from an X toolkit, you can also click @kbd{C-Mouse-2} in 753window vertically. The split occurs on the line where you click.
752the scroll bar to split a window vertically. The split occurs on the
753line where you click.
754 754
755@findex scroll-bar-mode 755@findex scroll-bar-mode
756@vindex scroll-bar-mode 756@vindex scroll-bar-mode
@@ -800,9 +800,9 @@ buffers are scrolled.
800@section Drag and drop in Emacs. 800@section Drag and drop in Emacs.
801 801
802@cindex drag and drop 802@cindex drag and drop
803 Emacs supports drag and drop so that dropping of files and text is handeled. 803 Emacs supports drag and drop so that dropping of files and text is handled.
804Currently supported drag and drop protocols are XDND, Motif and the old 804Currently supported drag and drop protocols are XDND, Motif and the old
805KDE 1.x protocol. There is no drag support yet. 805KDE 1.x protocol. There is no drag support yet.
806When text is dropped on Emacs, Emacs inserts the text where it is dropped. 806When text is dropped on Emacs, Emacs inserts the text where it is dropped.
807When a file is dragged from a file manager to Emacs, Emacs opens that file. 807When a file is dragged from a file manager to Emacs, Emacs opens that file.
808As a special case, if a file is dropped on a dired buffer the file is 808As a special case, if a file is dropped on a dired buffer the file is
@@ -896,7 +896,7 @@ file names.
896 896
897 You can customize the option @code{use-file-dialog} to suppress the 897 You can customize the option @code{use-file-dialog} to suppress the
898use of file selection windows even if you still want other kinds 898use of file selection windows even if you still want other kinds
899of dialogs. This option has no effect if you have supressed all dialog 899of dialogs. This option has no effect if you have suppressed all dialog
900boxes with the option @code{use-dialog-box}. 900boxes with the option @code{use-dialog-box}.
901 901
902 902
diff --git a/man/indent.texi b/man/indent.texi
index d2134103240..ab640e76462 100644
--- a/man/indent.texi
+++ b/man/indent.texi
@@ -1,5 +1,5 @@
1@c This is part of the Emacs manual. 1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 86, 87, 93, 94, 95, 1997 Free Software Foundation, Inc. 2@c Copyright (C) 1985, 86, 87, 93, 94, 95, 1997, 2004 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions. 3@c See file emacs.texi for copying conditions.
4@node Indentation, Text, Major Modes, Top 4@node Indentation, Text, Major Modes, Top
5@chapter Indentation 5@chapter Indentation
@@ -75,7 +75,7 @@ type @key{TAB}, it aligns the line as a whole.
75 Normally, all of the above methods insert an optimal mix of tabs and 75 Normally, all of the above methods insert an optimal mix of tabs and
76spaces to align to the desired column. @xref{Just Spaces}, for how to 76spaces to align to the desired column. @xref{Just Spaces}, for how to
77disable use of tabs. However, @kbd{C-q @key{TAB}} always inserts a 77disable use of tabs. However, @kbd{C-q @key{TAB}} always inserts a
78tab, even they are disabled for the indentation commands. 78tab, even when tabs are disabled for the indentation commands.
79 79
80@c In Text mode, @key{TAB} runs the command @code{tab-to-tab-stop}, which 80@c In Text mode, @key{TAB} runs the command @code{tab-to-tab-stop}, which
81@c indents to the next tab stop column. You can set the tab stops with 81@c indents to the next tab stop column. You can set the tab stops with
@@ -95,7 +95,8 @@ tab, even they are disabled for the indentation commands.
95@findex back-to-indentation 95@findex back-to-indentation
96 To move over the indentation on a line, do @kbd{M-m} 96 To move over the indentation on a line, do @kbd{M-m}
97(@code{back-to-indentation}). This command, given anywhere on a line, 97(@code{back-to-indentation}). This command, given anywhere on a line,
98positions point at the first nonblank character on the line. 98positions point at the first nonblank character on the line, if any,
99or else at the end of the line.
99 100
100 To insert an indented line before the current line, do @kbd{C-a C-o 101 To insert an indented line before the current line, do @kbd{C-a C-o
101@key{TAB}}. To make an indented line after the current line, use 102@key{TAB}}. To make an indented line after the current line, use
@@ -134,13 +135,13 @@ appears after the newline that is deleted. @xref{Fill Prefix}.
134@findex indent-region 135@findex indent-region
135@findex indent-rigidly 136@findex indent-rigidly
136 There are also commands for changing the indentation of several lines 137 There are also commands for changing the indentation of several lines
137at once. @kbd{C-M-\} (@code{indent-region}) applies to all the lines 138at once. They apply to all the lines that begin in the region.
138that begin in the region; it indents each line in the ``usual'' way, as 139@kbd{C-M-\} (@code{indent-region}) indents each line in the ``usual''
139if you had typed @key{TAB} at the beginning of the line. A numeric 140way, as if you had typed @key{TAB} at the beginning of the line. A
140argument specifies the column to indent to, and each line is shifted 141numeric argument specifies the column to indent to, and each line is
141left or right so that its first nonblank character appears in that 142shifted left or right so that its first nonblank character appears in
142column. @kbd{C-x @key{TAB}} (@code{indent-rigidly}) moves all of the 143that column. @kbd{C-x @key{TAB}} (@code{indent-rigidly}) moves all of
143lines in the region right by its argument (left, for negative 144the lines in the region right by its argument (left, for negative
144arguments). The whole group of lines moves rigidly sideways, which is 145arguments). The whole group of lines moves rigidly sideways, which is
145how the command gets its name.@refill 146how the command gets its name.@refill
146 147
@@ -152,12 +153,10 @@ such as -1000.
152@findex indent-relative 153@findex indent-relative
153 @kbd{M-x indent-relative} indents at point based on the previous line 154 @kbd{M-x indent-relative} indents at point based on the previous line
154(actually, the last nonempty line). It inserts whitespace at point, moving 155(actually, the last nonempty line). It inserts whitespace at point, moving
155point, until it is underneath an indentation point in the previous line. 156point, until it is underneath the next indentation point in the previous line.
156An indentation point is the end of a sequence of whitespace or the end of 157An indentation point is the end of a sequence of whitespace or the end of
157the line. If point is farther right than any indentation point in the 158the line. If point is farther right than any indentation point in the
158previous line, the whitespace before point is deleted and the first 159previous line, @code{indent-relative} runs @code{tab-to-tab-stop}
159indentation point then applicable is used. If no indentation point is
160applicable even then, @code{indent-relative} runs @code{tab-to-tab-stop}
161@ifinfo 160@ifinfo
162(@pxref{Tab Stops}), 161(@pxref{Tab Stops}),
163@end ifinfo 162@end ifinfo
@@ -167,9 +166,6 @@ applicable even then, @code{indent-relative} runs @code{tab-to-tab-stop}
167unless it is called with a numeric argument, in which case it does 166unless it is called with a numeric argument, in which case it does
168nothing. 167nothing.
169 168
170 @code{indent-relative} is the definition of @key{TAB} in Indented Text
171mode. @xref{Text}.
172
173 @xref{Format Indentation}, for another way of specifying the 169 @xref{Format Indentation}, for another way of specifying the
174indentation for part of your text. 170indentation for part of your text.
175 171
@@ -181,10 +177,9 @@ indentation for part of your text.
181@cindex tables, indentation for 177@cindex tables, indentation for
182@kindex M-i 178@kindex M-i
183@findex tab-to-tab-stop 179@findex tab-to-tab-stop
184 For typing in tables, you can use Text mode's definition of @key{TAB}, 180 For typing in tables, you can use @kbd{M-i} (@code{tab-to-tab-stop}).
185@code{tab-to-tab-stop}. This command inserts indentation before point, 181This command inserts indentation before point, enough to reach the
186enough to reach the next tab stop column. If you are not in Text mode, 182next tab stop column.
187this command can be found on the key @kbd{M-i}.
188 183
189@findex edit-tab-stops 184@findex edit-tab-stops
190@findex edit-tab-stops-note-changes 185@findex edit-tab-stops-note-changes
@@ -198,10 +193,11 @@ increasing order.
198edit-tab-stops}, which creates and selects a buffer containing a 193edit-tab-stops}, which creates and selects a buffer containing a
199description of the tab stop settings. You can edit this buffer to 194description of the tab stop settings. You can edit this buffer to
200specify different tab stops, and then type @kbd{C-c C-c} to make those 195specify different tab stops, and then type @kbd{C-c C-c} to make those
201new tab stops take effect. @code{edit-tab-stops} records which buffer 196new tab stops take effect. The buffer uses Overwrite mode
202was current when you invoked it, and stores the tab stops back in that 197(@pxref{Minor Modes}). @code{edit-tab-stops} records which buffer was
203buffer; normally all buffers share the same tab stops and changing them 198current when you invoked it, and stores the tab stops back in that
204in one buffer affects all, but if you happen to make 199buffer; normally all buffers share the same tab stops and changing
200them in one buffer affects all, but if you happen to make
205@code{tab-stop-list} local in one buffer then @code{edit-tab-stops} in 201@code{tab-stop-list} local in one buffer then @code{edit-tab-stops} in
206that buffer will edit the local settings. 202that buffer will edit the local settings.
207 203
@@ -242,7 +238,7 @@ that your file looks the same regardless of the tab width setting.
242@findex untabify 238@findex untabify
243 There are also commands to convert tabs to spaces or vice versa, always 239 There are also commands to convert tabs to spaces or vice versa, always
244preserving the columns of all nonblank text. @kbd{M-x tabify} scans the 240preserving the columns of all nonblank text. @kbd{M-x tabify} scans the
245region for sequences of spaces, and converts sequences of at least three 241region for sequences of spaces, and converts sequences of at least two
246spaces to tabs if that can be done without changing indentation. @kbd{M-x 242spaces to tabs if that can be done without changing indentation. @kbd{M-x
247untabify} changes all tabs in the region to appropriate numbers of spaces. 243untabify} changes all tabs in the region to appropriate numbers of spaces.
248 244
diff --git a/man/killing.texi b/man/killing.texi
index b5f1ce30772..8865dfc2f1b 100644
--- a/man/killing.texi
+++ b/man/killing.texi
@@ -25,6 +25,10 @@ one buffer and yank it in another buffer.
25 25
26@end iftex 26@end iftex
27 27
28@ifnottex
29@raisesections
30@end ifnottex
31
28@node Killing, Yanking, Mark, Top 32@node Killing, Yanking, Mark, Top
29@section Deletion and Killing 33@section Deletion and Killing
30 34
@@ -646,6 +650,10 @@ rectangle shifts right.
646@code{string-rectangle}, but inserts the string on each line, 650@code{string-rectangle}, but inserts the string on each line,
647shifting the original text to the right. 651shifting the original text to the right.
648 652
653@ifnottex
654@lowersections
655@end ifnottex
656
649@ignore 657@ignore
650 arch-tag: d8da8f96-0928-449a-816e-ff2d3497866c 658 arch-tag: d8da8f96-0928-449a-816e-ff2d3497866c
651@end ignore 659@end ignore
diff --git a/man/misc.texi b/man/misc.texi
index 3c5909a9f56..d3aa352d091 100644
--- a/man/misc.texi
+++ b/man/misc.texi
@@ -1,5 +1,5 @@
1@c This is part of the Emacs manual. 1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 2000, 2001 2@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 2000, 2001, 2004
3@c Free Software Foundation, Inc. 3@c Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions. 4@c See file emacs.texi for copying conditions.
5@iftex 5@iftex
@@ -14,6 +14,11 @@ an Emacs session for later resumption, emulating other editors, and
14various diversions and amusements. 14various diversions and amusements.
15 15
16@end iftex 16@end iftex
17
18@ifnottex
19@raisesections
20@end ifnottex
21
17@node Gnus, Shell, Calendar/Diary, Top 22@node Gnus, Shell, Calendar/Diary, Top
18@section Gnus 23@section Gnus
19@cindex Gnus 24@cindex Gnus
@@ -1264,7 +1269,7 @@ automatically when you finish with them.
1264@end menu 1269@end menu
1265 1270
1266@node Invoking emacsclient,, Emacs Server, Emacs Server 1271@node Invoking emacsclient,, Emacs Server, Emacs Server
1267@section Invoking @code{emacsclient} 1272@subsection Invoking @code{emacsclient}
1268 1273
1269 To run the @code{emacsclient} program, specify file names as arguments, 1274 To run the @code{emacsclient} program, specify file names as arguments,
1270and optionally line numbers as well. Do it like this: 1275and optionally line numbers as well. Do it like this:
@@ -2448,6 +2453,10 @@ Likewise, @kbd{M-x snake} provides an implementation of Snake.
2448The command @kbd{M-x zone} plays games with the display when Emacs is 2453The command @kbd{M-x zone} plays games with the display when Emacs is
2449idle. 2454idle.
2450 2455
2456@ifnottex
2457@lowersections
2458@end ifnottex
2459
2451@ignore 2460@ignore
2452 arch-tag: 8f094220-c0d5-4e9e-af7d-3e0da8187474 2461 arch-tag: 8f094220-c0d5-4e9e-af7d-3e0da8187474
2453@end ignore 2462@end ignore
diff --git a/man/programs.texi b/man/programs.texi
index e19c8364f2b..abe0083b39e 100644
--- a/man/programs.texi
+++ b/man/programs.texi
@@ -31,8 +31,8 @@ Highlight program syntax (@pxref{Font Lock}).
31* Defuns:: Commands to operate on major top-level parts 31* Defuns:: Commands to operate on major top-level parts
32 of a program. 32 of a program.
33* Program Indent:: Adjusting indentation to show the nesting. 33* Program Indent:: Adjusting indentation to show the nesting.
34* Comments:: Inserting, killing, and aligning comments.
35* Parentheses:: Commands that operate on parentheses. 34* Parentheses:: Commands that operate on parentheses.
35* Comments:: Inserting, killing, and aligning comments.
36* Documentation:: Getting documentation of functions you plan to call. 36* Documentation:: Getting documentation of functions you plan to call.
37* Hideshow:: Displaying blocks selectively. 37* Hideshow:: Displaying blocks selectively.
38* Symbol Completion:: Completion on symbol names of your program or language. 38* Symbol Completion:: Completion on symbol names of your program or language.
diff --git a/man/trouble.texi b/man/trouble.texi
index e7f6ae7608b..142560c1fe8 100644
--- a/man/trouble.texi
+++ b/man/trouble.texi
@@ -1,5 +1,5 @@
1@c This is part of the Emacs manual. 1@c This is part of the Emacs manual.
2@c Copyright (C) 1985,86,87,93,94,95,1997,2001 Free Software Foundation, Inc. 2@c Copyright (C) 1985,86,87,93,94,95,1997,2001,2004 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions. 3@c See file emacs.texi for copying conditions.
4@iftex 4@iftex
5@chapter Dealing with Common Problems 5@chapter Dealing with Common Problems
@@ -10,6 +10,10 @@ recover from a mysterious situation. Emacs bugs and system crashes are
10also considered. 10also considered.
11@end iftex 11@end iftex
12 12
13@ifnottex
14@raisesections
15@end ifnottex
16
13@node Quitting, Lossage, Customization, Top 17@node Quitting, Lossage, Customization, Top
14@section Quitting and Aborting 18@section Quitting and Aborting
15@cindex quitting 19@cindex quitting
@@ -1044,7 +1048,7 @@ you have not yet started work, it is useful to contact
1044possible to suggest ways to make your extension fit in better with the 1048possible to suggest ways to make your extension fit in better with the
1045rest of Emacs. 1049rest of Emacs.
1046 1050
1047@node Service, Command Arguments, Contributing, Top 1051@node Service, Copying, Contributing, Top
1048@section How To Get Help with GNU Emacs 1052@section How To Get Help with GNU Emacs
1049 1053
1050If you need help installing, using or changing GNU Emacs, there are two 1054If you need help installing, using or changing GNU Emacs, there are two
@@ -1063,6 +1067,10 @@ The service directory is found in the file named @file{etc/SERVICE} in the
1063Emacs distribution. 1067Emacs distribution.
1064@end itemize 1068@end itemize
1065 1069
1070@ifnottex
1071@lowersections
1072@end ifnottex
1073
1066@ignore 1074@ignore
1067 arch-tag: c9cba76d-b2cb-4e0c-ae3f-19d5ef35817c 1075 arch-tag: c9cba76d-b2cb-4e0c-ae3f-19d5ef35817c
1068@end ignore 1076@end ignore
diff --git a/man/windows.texi b/man/windows.texi
index f9b4003f038..8416c4be076 100644
--- a/man/windows.texi
+++ b/man/windows.texi
@@ -1,5 +1,5 @@
1@c This is part of the Emacs manual. 1@c This is part of the Emacs manual.
2@c Copyright (C) 1985,86,87,93,94,95,97,2000,2001 Free Software Foundation, Inc. 2@c Copyright (C) 1985,86,87,93,94,95,97,2000,2001,2004 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions. 3@c See file emacs.texi for copying conditions.
4@node Windows, Frames, Buffers, Top 4@node Windows, Frames, Buffers, Top
5@chapter Multiple Windows 5@chapter Multiple Windows
@@ -36,11 +36,11 @@ each window has its own value of point.
36 At any time, one of the windows is the @dfn{selected window}; the 36 At any time, one of the windows is the @dfn{selected window}; the
37buffer this window is displaying is the current buffer. The terminal's 37buffer this window is displaying is the current buffer. The terminal's
38cursor shows the location of point in this window. Each other window 38cursor shows the location of point in this window. Each other window
39has a location of point as well, but since the terminal has only one 39has a location of point as well. On text-only terminals, there is no
40cursor there is no way to show where those locations are. When multiple 40way to show where those locations are, since the terminal has only one
41frames are visible in X, each frame has a cursor which appears in the 41cursor. If you are using a window system, the location of point in a
42frame's selected window. The cursor in the selected frame is solid; the 42non-selected window is indicated by a hollow box. The cursor in the
43cursor in other frames is a hollow box. 43selected window is blinking or solid.
44 44
45 Commands to move point affect the value of point for the selected Emacs 45 Commands to move point affect the value of point for the selected Emacs
46window only. They do not change the value of point in any other Emacs 46window only. They do not change the value of point in any other Emacs
@@ -93,20 +93,20 @@ numeric argument specifies how many lines to give to the top window.
93@findex split-window-horizontally 93@findex split-window-horizontally
94 @kbd{C-x 3} (@code{split-window-horizontally}) breaks the selected 94 @kbd{C-x 3} (@code{split-window-horizontally}) breaks the selected
95window into two side-by-side windows. A numeric argument specifies how 95window into two side-by-side windows. A numeric argument specifies how
96many columns to give the one on the left. A line of vertical bars 96many columns to give the one on the left. If you are not using
97separates the two windows. Windows that are not the full width of the 97scrollbars, a line of vertical bars separates the two windows.
98screen have mode lines, but they are truncated. On terminals where 98Windows that are not the full width of the screen have mode lines, but
99Emacs does not support highlighting, truncated mode lines sometimes do 99they are truncated. On terminals where Emacs does not support
100not appear in inverse video. 100highlighting, truncated mode lines sometimes do not appear in inverse
101video.
101 102
102@kindex C-Mouse-2 @r{(scroll bar)} 103@kindex C-Mouse-2 @r{(scroll bar)}
103 You can split a window horizontally or vertically by clicking 104 You can split a window horizontally or vertically by clicking
104@kbd{C-Mouse-2} in the mode line or the scroll bar. (This does not 105@kbd{C-Mouse-2} in the mode line or the scroll bar. The line of
105work in scroll bars implemented by X toolkits.) The line of splitting 106splitting goes through the place where you click: if you click on the
106goes through the place where you click: if you click on the mode line, 107mode line, the new scroll bar goes above the spot; if you click in the
107the new scroll bar goes above the spot; if you click in the scroll 108scroll bar, the mode line of the split window is side by side with
108bar, the mode line of the split window is side by side with your 109your click.
109click.
110 110
111@vindex truncate-partial-width-windows 111@vindex truncate-partial-width-windows
112 When a window is less than the full width, text lines too long to fit are 112 When a window is less than the full width, text lines too long to fit are
@@ -319,8 +319,8 @@ the minibuffer); the selected window expands to use the whole frame
319except for the echo area. 319except for the echo area.
320 320
321 You can also delete a window by clicking on its mode line with 321 You can also delete a window by clicking on its mode line with
322@kbd{Mouse-2}, and delete all the windows in a frame except one window 322@kbd{Mouse-3}, and delete all the windows in a frame except one window
323by clicking on that window's mode line with @kbd{Mouse-3}. 323by clicking on that window's mode line with @kbd{Mouse-2}.
324 324
325 The easiest way to adjust window heights is with a mouse. If you 325 The easiest way to adjust window heights is with a mouse. If you
326press @kbd{Mouse-1} on a mode line, you can drag that mode line up or 326press @kbd{Mouse-1} on a mode line, you can drag that mode line up or
@@ -370,8 +370,8 @@ heights of all the windows in the selected frame.
370 @kbd{M-x winner-mode} is a global minor mode that records the 370 @kbd{M-x winner-mode} is a global minor mode that records the
371changes in the window configuration (i.e. how the frames are 371changes in the window configuration (i.e. how the frames are
372partitioned into windows), so that you can ``undo'' them. To undo, 372partitioned into windows), so that you can ``undo'' them. To undo,
373use @kbd{C-x left} (@code{winner-undo}). If you change your mind 373use @kbd{C-c left} (@code{winner-undo}). If you change your mind
374while undoing, you can redo the changes you had undone using @kbd{C-x 374while undoing, you can redo the changes you had undone using @kbd{C-c
375right} (@code{M-x winner-redo}). Another way to enable Winner mode is 375right} (@code{M-x winner-redo}). Another way to enable Winner mode is
376by customizing the variable @code{winner-mode}. 376by customizing the variable @code{winner-mode}.
377 377
diff --git a/src/ChangeLog b/src/ChangeLog
index d49514b2fc0..14eece1b04e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,48 @@
12004-08-30 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * macmenu.c (_widget_value): Added lname and lkey.
4 (single_submenu): Set lname and lkey in widget_value
5 instead of name and key.
6 (update_submenu_strings): New function.
7 (set_frame_menubar): Remove call to inhibit_garbage_collection,
8 call update_submenu_strings.
9
10 * xmenu.c (digest_single_submenu): Set lname and lkey in widget_value
11 instead of name and key.
12 (update_submenu_strings): New function.
13 (set_frame_menubar): Remove call to inhibit_garbage_collection,
14 call update_submenu_strings.
15
16 * gtkutil.h (_widget_value): Added lname and lkey.
17
182004-08-30 Steven Tamm <steventamm@mac.com>
19
20 * macmenu.c (mac_menu_show): Remove shadowing of menu variable
21 by using different names for inner loop variables.
22
232004-08-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
24
25 * xmenu.c (set_frame_menubar): Reintroduce inhibit_garbage_collection
26 from 2002-07-15T00:01:34Z!raeburn@raeburn.org so that strings from ENCODE_UTF_8 isn't GC:ed before used.
27
28 * gtkutil.c (xg_create_frame_widgets): Compensate for tool bar when
29 tool bar items is 0.
30
312004-08-26 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
32
33 * macmenu.c (ENCODE_MENU_STRING): Added to handle multibyte
34 strings in menu items.
35 (single_submenu): Use ENCODE_MENU_STRING
36 (mac_menu_show): Use ENCODE_MENU_STRING. Reset grabbed because
37 button release isn't passed to event loop
38 (add_menu_item): Use SetMenuItemWithCFString
39
402004-08-26 Steven Tamm <steventamm@mac.com>
41
42 * fileio.c (Fread_file_name): Call x_file_dialog on carbon on
43 tool-bar/menu click
44 * macfns.c (Fx_file_dialog): Implemented using NavServices
45
12004-08-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 462004-08-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 47
3 * xterm.c (x_catch_errors_unwind): Do not XSync if display has closed. 48 * xterm.c (x_catch_errors_unwind): Do not XSync if display has closed.
diff --git a/src/fileio.c b/src/fileio.c
index da544f72234..707b6e96d86 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -6306,7 +6306,7 @@ and `read-file-name-function'. */)
6306 6306
6307 GCPRO2 (insdef, default_filename); 6307 GCPRO2 (insdef, default_filename);
6308 6308
6309#if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) 6309#if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) || defined (TARGET_API_MAC_CARBON)
6310 if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) 6310 if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
6311 && use_dialog_box 6311 && use_dialog_box
6312 && use_file_dialog 6312 && use_file_dialog
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 3ffba0ba745..fabdae74dc6 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -793,7 +793,7 @@ xg_create_frame_widgets (f)
793 up in the wrong place as tool bar height has not been taken into account. 793 up in the wrong place as tool bar height has not been taken into account.
794 So we cheat a bit by setting a height that is what it will have 794 So we cheat a bit by setting a height that is what it will have
795 later on when tool bar items are added. */ 795 later on when tool bar items are added. */
796 if (FRAME_EXTERNAL_TOOL_BAR (f) && FRAME_TOOLBAR_HEIGHT (f) == 0) 796 if (FRAME_EXTERNAL_TOOL_BAR (f) && f->n_tool_bar_items == 0)
797 FRAME_TOOLBAR_HEIGHT (f) = 34; 797 FRAME_TOOLBAR_HEIGHT (f) = 34;
798 798
799 799
diff --git a/src/gtkutil.h b/src/gtkutil.h
index b31ec8c2a1f..b35ab94b2cb 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -96,10 +96,12 @@ typedef struct xg_menu_item_cb_data_
96typedef struct _widget_value 96typedef struct _widget_value
97{ 97{
98 /* name of widget */ 98 /* name of widget */
99 Lisp_Object lname;
99 char *name; 100 char *name;
100 /* value (meaning depend on widget type) */ 101 /* value (meaning depend on widget type) */
101 char *value; 102 char *value;
102 /* keyboard equivalent. no implications for XtTranslations */ 103 /* keyboard equivalent. no implications for XtTranslations */
104 Lisp_Object lkey;
103 char *key; 105 char *key;
104 /* Help string or nil if none. 106 /* Help string or nil if none.
105 GC finds this string through the frame's menu_bar_vector 107 GC finds this string through the frame's menu_bar_vector
diff --git a/src/macfns.c b/src/macfns.c
index ec014e772e3..fbade05ea17 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -4192,19 +4192,27 @@ Value is t if tooltip was open, nil otherwise. */)
4192 4192
4193 4193
4194 4194
4195#ifdef TARGET_API_MAC_CARBON
4195/*********************************************************************** 4196/***********************************************************************
4196 File selection dialog 4197 File selection dialog
4197 ***********************************************************************/ 4198 ***********************************************************************/
4198 4199
4199#if 0 /* MAC_TODO: can standard file dialog */ 4200/**
4201 There is a relatively standard way to do this using applescript to run
4202 a (choose file) method. However, this doesn't do "the right thing"
4203 by working only if the find-file occurred during a menu or toolbar
4204 click. So we must do the file dialog by hand, using the navigation
4205 manager. This also has more flexibility in determining the default
4206 directory and whether or not we are going to choose a file.
4207 **/
4208
4200extern Lisp_Object Qfile_name_history; 4209extern Lisp_Object Qfile_name_history;
4201 4210
4202DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 4, 0, 4211DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 4, 0,
4203 doc: /* Read file name, prompting with PROMPT in directory DIR. 4212 doc: /* Read file name, prompting with PROMPT in directory DIR.
4204Use a file selection dialog. 4213Use a file selection dialog.
4205Select DEFAULT-FILENAME in the dialog's file selection box, if 4214Select DEFAULT-FILENAME in the dialog's file selection box, if
4206specified. Don't let the user enter a file name in the file 4215specified. Ensure that file exists if MUSTMATCH is non-nil. */)
4207selection dialog's entry field, if MUSTMATCH is non-nil. */)
4208 (prompt, dir, default_filename, mustmatch) 4216 (prompt, dir, default_filename, mustmatch)
4209 Lisp_Object prompt, dir, default_filename, mustmatch; 4217 Lisp_Object prompt, dir, default_filename, mustmatch;
4210{ 4218{
@@ -4212,9 +4220,8 @@ selection dialog's entry field, if MUSTMATCH is non-nil. */)
4212 Lisp_Object file = Qnil; 4220 Lisp_Object file = Qnil;
4213 int count = SPECPDL_INDEX (); 4221 int count = SPECPDL_INDEX ();
4214 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 4222 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
4215 char filename[MAX_PATH + 1]; 4223 char filename[1001];
4216 char init_dir[MAX_PATH + 1]; 4224 int default_filter_index = 1; /* 1: All Files, 2: Directories only */
4217 int use_dialog_p = 1;
4218 4225
4219 GCPRO5 (prompt, dir, default_filename, mustmatch, file); 4226 GCPRO5 (prompt, dir, default_filename, mustmatch, file);
4220 CHECK_STRING (prompt); 4227 CHECK_STRING (prompt);
@@ -4223,87 +4230,150 @@ selection dialog's entry field, if MUSTMATCH is non-nil. */)
4223 /* Create the dialog with PROMPT as title, using DIR as initial 4230 /* Create the dialog with PROMPT as title, using DIR as initial
4224 directory and using "*" as pattern. */ 4231 directory and using "*" as pattern. */
4225 dir = Fexpand_file_name (dir, Qnil); 4232 dir = Fexpand_file_name (dir, Qnil);
4226 strncpy (init_dir, SDATA (dir), MAX_PATH);
4227 init_dir[MAX_PATH] = '\0';
4228 unixtodos_filename (init_dir);
4229
4230 if (STRINGP (default_filename))
4231 {
4232 char *file_name_only;
4233 char *full_path_name = SDATA (default_filename);
4234
4235 unixtodos_filename (full_path_name);
4236
4237 file_name_only = strrchr (full_path_name, '\\');
4238 if (!file_name_only)
4239 file_name_only = full_path_name;
4240 else
4241 {
4242 file_name_only++;
4243
4244 /* If default_file_name is a directory, don't use the open
4245 file dialog, as it does not support selecting
4246 directories. */
4247 if (!(*file_name_only))
4248 use_dialog_p = 0;
4249 }
4250
4251 strncpy (filename, file_name_only, MAX_PATH);
4252 filename[MAX_PATH] = '\0';
4253 }
4254 else
4255 filename[0] = '\0';
4256 4233
4257 if (use_dialog_p) 4234 {
4258 { 4235 OSStatus status;
4259 OPENFILENAME file_details; 4236 NavDialogCreationOptions options;
4260 char *filename_file; 4237 NavDialogRef dialogRef;
4238 NavTypeListHandle fileTypes = NULL;
4239 NavUserAction userAction;
4240 CFStringRef message=NULL, client=NULL, saveName = NULL;
4241
4242 /* No need for a callback function because we are modal */
4243 NavGetDefaultDialogCreationOptions(&options);
4244 options.modality = kWindowModalityAppModal;
4245 options.location.h = options.location.v = -1;
4246 options.optionFlags = kNavDefaultNavDlogOptions;
4247 options.optionFlags |= kNavAllFilesInPopup; /* All files allowed */
4248 options.optionFlags |= kNavSelectAllReadableItem;
4249 if (!NILP(prompt))
4250 {
4251 message = CFStringCreateWithCStringNoCopy(NULL, SDATA(prompt),
4252 kCFStringEncodingUTF8,
4253 kCFAllocatorNull);
4254 options.message = message;
4255 }
4256 /* Don't set the application, let it use default.
4257 client = CFStringCreateWithCStringNoCopy(NULL, "Emacs",
4258 kCFStringEncodingMacRoman, NULL);
4259 options.clientName = client;
4260 */
4261
4262 /* Do Dired hack copied from w32fns.c */
4263 if (!NILP(prompt) && strncmp (SDATA(prompt), "Dired", 5) == 0)
4264 status = NavCreateChooseFolderDialog(&options, NULL, NULL, NULL,
4265 &dialogRef);
4266 else if (NILP (mustmatch))
4267 {
4268 /* This is a save dialog */
4269 if (!NILP(default_filename))
4270 {
4271 saveName = CFStringCreateWithCString(NULL, SDATA(default_filename),
4272 kCFStringEncodingUTF8);
4273 options.saveFileName = saveName;
4274 options.optionFlags |= kNavSelectDefaultLocation;
4275 }
4276 /* MAC_TODO: Find a better way to determine if this is a save
4277 or load dialog than comparing dir with default_filename */
4278 if (EQ(dir, default_filename))
4279 {
4280 status = NavCreateChooseFileDialog(&options, fileTypes,
4281 NULL, NULL, NULL, NULL,
4282 &dialogRef);
4283 }
4284 else {
4285 status = NavCreatePutFileDialog(&options,
4286 'TEXT', kNavGenericSignature,
4287 NULL, NULL, &dialogRef);
4288 }
4289 }
4290 else
4291 {
4292 /* This is an open dialog*/
4293 status = NavCreateChooseFileDialog(&options, fileTypes,
4294 NULL, NULL, NULL, NULL,
4295 &dialogRef);
4296 }
4297
4298 /* Set the default location and continue*/
4299 if (status == noErr) {
4300 if (!NILP(dir)) {
4301 FSRef defLoc;
4302 AEDesc defLocAed;
4303 status = FSPathMakeRef(SDATA(dir), &defLoc, NULL);
4304 if (status == noErr)
4305 {
4306 AECreateDesc(typeFSRef, &defLoc, sizeof(FSRef), &defLocAed);
4307 NavCustomControl(dialogRef, kNavCtlSetLocation, (void*) &defLocAed);
4308 }
4309 AEDisposeDesc(&defLocAed);
4310 }
4261 4311
4262 /* Prevent redisplay. */
4263 specbind (Qinhibit_redisplay, Qt);
4264 BLOCK_INPUT; 4312 BLOCK_INPUT;
4313 status = NavDialogRun(dialogRef);
4314 UNBLOCK_INPUT;
4315 }
4265 4316
4266 bzero (&file_details, sizeof (file_details)); 4317 if (saveName) CFRelease(saveName);
4267 file_details.lStructSize = sizeof (file_details); 4318 if (client) CFRelease(client);
4268 file_details.hwndOwner = FRAME_W32_WINDOW (f); 4319 if (message) CFRelease(message);
4269 file_details.lpstrFile = filename;
4270 file_details.nMaxFile = sizeof (filename);
4271 file_details.lpstrInitialDir = init_dir;
4272 file_details.lpstrTitle = SDATA (prompt);
4273 file_details.Flags = OFN_HIDEREADONLY | OFN_NOCHANGEDIR;
4274
4275 if (!NILP (mustmatch))
4276 file_details.Flags |= OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST;
4277 4320
4278 if (GetOpenFileName (&file_details)) 4321 if (status == noErr) {
4279 { 4322 userAction = NavDialogGetUserAction(dialogRef);
4280 dostounix_filename (filename); 4323 switch (userAction)
4281 file = build_string (filename); 4324 {
4282 } 4325 case kNavUserActionNone:
4283 else 4326 case kNavUserActionCancel:
4284 file = Qnil; 4327 NavDialogDispose(dialogRef);
4285 4328 Fsignal (Qquit, Qnil); /* Treat cancel like C-g */
4286 UNBLOCK_INPUT; 4329 return;
4287 file = unbind_to (count, file); 4330 case kNavUserActionOpen:
4331 case kNavUserActionChoose:
4332 case kNavUserActionSaveAs:
4333 {
4334 NavReplyRecord reply;
4335 AEDesc aed;
4336 FSRef fsRef;
4337 status = NavDialogGetReply(dialogRef, &reply);
4338 AECoerceDesc(&reply.selection, typeFSRef, &aed);
4339 AEGetDescData(&aed, (void *) &fsRef, sizeof (FSRef));
4340 FSRefMakePath(&fsRef, (UInt8 *) filename, 1000);
4341 AEDisposeDesc(&aed);
4342 if (reply.saveFileName)
4343 {
4344 /* If it was a saved file, we need to add the file name */
4345 int len = strlen(filename);
4346 if (len && filename[len-1] != '/')
4347 filename[len++] = '/';
4348 CFStringGetCString(reply.saveFileName, filename+len,
4349 1000-len, kCFStringEncodingUTF8);
4350 }
4351 file = DECODE_FILE(build_string (filename));
4352 NavDisposeReply(&reply);
4353 }
4354 break;
4355 }
4356 NavDialogDispose(dialogRef);
4288 } 4357 }
4289 /* Open File dialog will not allow folders to be selected, so resort 4358 else {
4290 to minibuffer completing reads for directories. */ 4359 /* Fall back on minibuffer if there was a problem */
4291 else 4360 file = Fcompleting_read (prompt, intern ("read-file-name-internal"),
4292 file = Fcompleting_read (prompt, intern ("read-file-name-internal"), 4361 dir, mustmatch, dir, Qfile_name_history,
4293 dir, mustmatch, dir, Qfile_name_history, 4362 default_filename, Qnil);
4294 default_filename, Qnil); 4363 }
4364 }
4295 4365
4296 UNGCPRO; 4366 UNGCPRO;
4297 4367
4298 /* Make "Cancel" equivalent to C-g. */ 4368 /* Make "Cancel" equivalent to C-g. */
4299 if (NILP (file)) 4369 if (NILP (file))
4300 Fsignal (Qquit, Qnil); 4370 Fsignal (Qquit, Qnil);
4301 4371
4302 return unbind_to (count, file); 4372 return unbind_to (count, file);
4303} 4373}
4304#endif /* MAC_TODO */
4305 4374
4306 4375
4376#endif
4307 4377
4308/*********************************************************************** 4378/***********************************************************************
4309 Initialization 4379 Initialization
@@ -4507,7 +4577,7 @@ Chinese, Japanese, and Korean. */);
4507 last_show_tip_args = Qnil; 4577 last_show_tip_args = Qnil;
4508 staticpro (&last_show_tip_args); 4578 staticpro (&last_show_tip_args);
4509 4579
4510#if 0 /* MAC_TODO */ 4580#if TARGET_API_MAC_CARBON
4511 defsubr (&Sx_file_dialog); 4581 defsubr (&Sx_file_dialog);
4512#endif 4582#endif
4513} 4583}
diff --git a/src/macmenu.c b/src/macmenu.c
index d205ee3b877..88012b01f73 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -90,10 +90,12 @@ enum button_type
90typedef struct _widget_value 90typedef struct _widget_value
91{ 91{
92 /* name of widget */ 92 /* name of widget */
93 Lisp_Object lname;
93 char* name; 94 char* name;
94 /* value (meaning depend on widget type) */ 95 /* value (meaning depend on widget type) */
95 char* value; 96 char* value;
96 /* keyboard equivalent. no implications for XtTranslations */ 97 /* keyboard equivalent. no implications for XtTranslations */
98 Lisp_Object lkey;
97 char* key; 99 char* key;
98 /* Help string or nil if none. 100 /* Help string or nil if none.
99 GC finds this string through the frame's menu_bar_vector 101 GC finds this string through the frame's menu_bar_vector
@@ -163,6 +165,12 @@ extern Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map;
163 165
164extern Lisp_Object Qmenu_bar_update_hook; 166extern Lisp_Object Qmenu_bar_update_hook;
165 167
168#if TARGET_API_MAC_CARBON
169#define ENCODE_MENU_STRING(str) ENCODE_UTF_8 (str)
170#else
171#define ENCODE_MENU_STRING(str) ENCODE_SYSTEM (str)
172#endif
173
166void set_frame_menubar (); 174void set_frame_menubar ();
167 175
168static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object, 176static void push_menu_item P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
@@ -1215,12 +1223,9 @@ single_submenu (item_key, item_name, maps)
1215 save_wv->next = wv; 1223 save_wv->next = wv;
1216 else 1224 else
1217 first_wv->contents = wv; 1225 first_wv->contents = wv;
1218 wv->name = pane_string; 1226 wv->lname = pane_name;
1219 /* Ignore the @ that means "separate pane". 1227 /* Set value to 1 so update_submenu_strings can handle '@' */
1220 This is a kludge, but this isn't worth more time. */ 1228 wv->value = (char *)1;
1221 if (!NILP (prefix) && wv->name[0] == '@')
1222 wv->name++;
1223 wv->value = 0;
1224 wv->enabled = 1; 1229 wv->enabled = 1;
1225 wv->button_type = BUTTON_TYPE_NONE; 1230 wv->button_type = BUTTON_TYPE_NONE;
1226 wv->help = Qnil; 1231 wv->help = Qnil;
@@ -1246,13 +1251,13 @@ single_submenu (item_key, item_name, maps)
1246#ifndef HAVE_MULTILINGUAL_MENU 1251#ifndef HAVE_MULTILINGUAL_MENU
1247 if (STRING_MULTIBYTE (item_name)) 1252 if (STRING_MULTIBYTE (item_name))
1248 { 1253 {
1249 item_name = ENCODE_SYSTEM (item_name); 1254 item_name = ENCODE_MENU_STRING (item_name);
1250 AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name; 1255 AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name;
1251 } 1256 }
1252 1257
1253 if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) 1258 if (STRINGP (descrip) && STRING_MULTIBYTE (descrip))
1254 { 1259 {
1255 descrip = ENCODE_SYSTEM (descrip); 1260 descrip = ENCODE_MENU_STRING (descrip);
1256 AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip; 1261 AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip;
1257 } 1262 }
1258#endif /* not HAVE_MULTILINGUAL_MENU */ 1263#endif /* not HAVE_MULTILINGUAL_MENU */
@@ -1263,9 +1268,9 @@ single_submenu (item_key, item_name, maps)
1263 else 1268 else
1264 save_wv->contents = wv; 1269 save_wv->contents = wv;
1265 1270
1266 wv->name = (char *) SDATA (item_name); 1271 wv->lname = item_name;
1267 if (!NILP (descrip)) 1272 if (!NILP (descrip))
1268 wv->key = (char *) SDATA (descrip); 1273 wv->lkey = descrip;
1269 wv->value = 0; 1274 wv->value = 0;
1270 /* The EMACS_INT cast avoids a warning. There's no problem 1275 /* The EMACS_INT cast avoids a warning. There's no problem
1271 as long as pointers have enough bits to hold small integers. */ 1276 as long as pointers have enough bits to hold small integers. */
@@ -1304,6 +1309,41 @@ single_submenu (item_key, item_name, maps)
1304 1309
1305 return first_wv; 1310 return first_wv;
1306} 1311}
1312/* Walk through the widget_value tree starting at FIRST_WV and update
1313 the char * pointers from the corresponding lisp values.
1314 We do this after building the whole tree, since GC may happen while the
1315 tree is constructed, and small strings are relocated. So we must wait
1316 until no GC can happen before storing pointers into lisp values. */
1317static void
1318update_submenu_strings (first_wv)
1319 widget_value *first_wv;
1320{
1321 widget_value *wv;
1322
1323 for (wv = first_wv; wv; wv = wv->next)
1324 {
1325 if (wv->lname && ! NILP (wv->lname))
1326 {
1327 wv->name = SDATA (wv->lname);
1328
1329 /* Ignore the @ that means "separate pane".
1330 This is a kludge, but this isn't worth more time. */
1331 if (wv->value == (char *)1)
1332 {
1333 if (wv->name[0] == '@')
1334 wv->name++;
1335 wv->value = 0;
1336 }
1337 }
1338
1339 if (wv->lkey && ! NILP (wv->lkey))
1340 wv->key = SDATA (wv->lkey);
1341
1342 if (wv->contents)
1343 update_submenu_strings (wv->contents);
1344 }
1345}
1346
1307 1347
1308/* Set the contents of the menubar widgets of frame F. 1348/* Set the contents of the menubar widgets of frame F.
1309 The argument FIRST_TIME is currently ignored; 1349 The argument FIRST_TIME is currently ignored;
@@ -1382,8 +1422,6 @@ set_frame_menubar (f, first_time, deep_p)
1382 1422
1383 items = FRAME_MENU_BAR_ITEMS (f); 1423 items = FRAME_MENU_BAR_ITEMS (f);
1384 1424
1385 inhibit_garbage_collection ();
1386
1387 /* Save the frame's previous menu bar contents data. */ 1425 /* Save the frame's previous menu bar contents data. */
1388 if (previous_menu_items_used) 1426 if (previous_menu_items_used)
1389 bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items, 1427 bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items,
@@ -1448,6 +1486,7 @@ set_frame_menubar (f, first_time, deep_p)
1448 if (NILP (string)) 1486 if (NILP (string))
1449 break; 1487 break;
1450 wv->name = (char *) SDATA (string); 1488 wv->name = (char *) SDATA (string);
1489 update_submenu_strings (wv->contents);
1451 wv = wv->next; 1490 wv = wv->next;
1452 } 1491 }
1453 1492
@@ -1705,12 +1744,12 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
1705#ifndef HAVE_MULTILINGUAL_MENU 1744#ifndef HAVE_MULTILINGUAL_MENU
1706 if (STRINGP (item_name) && STRING_MULTIBYTE (item_name)) 1745 if (STRINGP (item_name) && STRING_MULTIBYTE (item_name))
1707 { 1746 {
1708 item_name = ENCODE_SYSTEM (item_name); 1747 item_name = ENCODE_MENU_STRING (item_name);
1709 AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name; 1748 AREF (menu_items, i + MENU_ITEMS_ITEM_NAME) = item_name;
1710 } 1749 }
1711 if (STRINGP (descrip) && STRING_MULTIBYTE (descrip)) 1750 if (STRINGP (descrip) && STRING_MULTIBYTE (descrip))
1712 { 1751 {
1713 descrip = ENCODE_SYSTEM (descrip); 1752 descrip = ENCODE_MENU_STRING (descrip);
1714 AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip; 1753 AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY) = descrip;
1715 } 1754 }
1716#endif /* not HAVE_MULTILINGUAL_MENU */ 1755#endif /* not HAVE_MULTILINGUAL_MENU */
@@ -1764,7 +1803,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
1764 1803
1765#ifndef HAVE_MULTILINGUAL_MENU 1804#ifndef HAVE_MULTILINGUAL_MENU
1766 if (STRING_MULTIBYTE (title)) 1805 if (STRING_MULTIBYTE (title))
1767 title = ENCODE_SYSTEM (title); 1806 title = ENCODE_MENU_STRING (title);
1768#endif 1807#endif
1769 wv_title->name = (char *) SDATA (title); 1808 wv_title->name = (char *) SDATA (title);
1770 wv_title->enabled = TRUE; 1809 wv_title->enabled = TRUE;
@@ -1801,9 +1840,9 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
1801 /* Get the refcon to find the correct item*/ 1840 /* Get the refcon to find the correct item*/
1802 if (menu_item_selection) 1841 if (menu_item_selection)
1803 { 1842 {
1804 menu = GetMenuHandle (HiWord (menu_item_choice)); 1843 MenuHandle sel_menu = GetMenuHandle (HiWord (menu_item_choice));
1805 if (menu) { 1844 if (sel_menu) {
1806 GetMenuItemRefCon (menu, menu_item_selection, &refcon); 1845 GetMenuItemRefCon (sel_menu, menu_item_selection, &refcon);
1807 } 1846 }
1808 } 1847 }
1809 1848
@@ -1813,6 +1852,10 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
1813 discard_mouse_events (); 1852 discard_mouse_events ();
1814#endif 1853#endif
1815 1854
1855 /* Must reset this manually because the button release event is not
1856 passed to Emacs event loop. */
1857 FRAME_MAC_DISPLAY_INFO (f)->grabbed = 0;
1858
1816 /* Free the widget_value objects we used to specify the 1859 /* Free the widget_value objects we used to specify the
1817 contents. */ 1860 contents. */
1818 free_menubar_widget_value_tree (first_wv); 1861 free_menubar_widget_value_tree (first_wv);
@@ -1821,11 +1864,11 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
1821 { 1864 {
1822 int i = MIN_POPUP_SUBMENU_ID; 1865 int i = MIN_POPUP_SUBMENU_ID;
1823 MenuHandle submenu = GetMenuHandle (i); 1866 MenuHandle submenu = GetMenuHandle (i);
1824 while (menu != NULL) 1867 while (submenu != NULL)
1825 { 1868 {
1826 DeleteMenu (i); 1869 DeleteMenu (i);
1827 DisposeMenu (menu); 1870 DisposeMenu (submenu);
1828 menu = GetMenuHandle (++i); 1871 submenu = GetMenuHandle (++i);
1829 } 1872 }
1830 } 1873 }
1831 1874
@@ -2219,8 +2262,18 @@ add_menu_item (MenuHandle menu, widget_value *wv, int submenu,
2219 strncat (item_name, wv->key, 255); 2262 strncat (item_name, wv->key, 255);
2220 } 2263 }
2221 item_name[255] = 0; 2264 item_name[255] = 0;
2265#if TARGET_API_MAC_CARBON
2266 {
2267 CFStringRef string =
2268 CFStringCreateWithCString (NULL, item_name, kCFStringEncodingUTF8);
2269
2270 SetMenuItemTextWithCFString (menu, pos, string);
2271 CFRelease (string);
2272 }
2273#else
2222 c2pstr (item_name); 2274 c2pstr (item_name);
2223 SetMenuItemText (menu, pos, item_name); 2275 SetMenuItemText (menu, pos, item_name);
2276#endif
2224 2277
2225 if (wv->enabled && !force_disable) 2278 if (wv->enabled && !force_disable)
2226#if TARGET_API_MAC_CARBON 2279#if TARGET_API_MAC_CARBON
diff --git a/src/xmenu.c b/src/xmenu.c
index 2ca6e247e12..aa963935262 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1701,12 +1701,9 @@ digest_single_submenu (start, end, top_level_items)
1701 save_wv->next = wv; 1701 save_wv->next = wv;
1702 else 1702 else
1703 first_wv->contents = wv; 1703 first_wv->contents = wv;
1704 wv->name = pane_string; 1704 wv->lname = pane_name;
1705 /* Ignore the @ that means "separate pane". 1705 /* Set value to 1 so update_submenu_strings can handle '@' */
1706 This is a kludge, but this isn't worth more time. */ 1706 wv->value = (char *)1;
1707 if (!NILP (prefix) && wv->name[0] == '@')
1708 wv->name++;
1709 wv->value = 0;
1710 wv->enabled = 1; 1707 wv->enabled = 1;
1711 wv->button_type = BUTTON_TYPE_NONE; 1708 wv->button_type = BUTTON_TYPE_NONE;
1712 wv->help = Qnil; 1709 wv->help = Qnil;
@@ -1749,9 +1746,9 @@ digest_single_submenu (start, end, top_level_items)
1749 else 1746 else
1750 save_wv->contents = wv; 1747 save_wv->contents = wv;
1751 1748
1752 wv->name = (char *) SDATA (item_name); 1749 wv->lname = item_name;
1753 if (!NILP (descrip)) 1750 if (!NILP (descrip))
1754 wv->key = (char *) SDATA (descrip); 1751 wv->lkey = descrip;
1755 wv->value = 0; 1752 wv->value = 0;
1756 /* The EMACS_INT cast avoids a warning. There's no problem 1753 /* The EMACS_INT cast avoids a warning. There's no problem
1757 as long as pointers have enough bits to hold small integers. */ 1754 as long as pointers have enough bits to hold small integers. */
@@ -1790,6 +1787,42 @@ digest_single_submenu (start, end, top_level_items)
1790 1787
1791 return first_wv; 1788 return first_wv;
1792} 1789}
1790
1791/* Walk through the widget_value tree starting at FIRST_WV and update
1792 the char * pointers from the corresponding lisp values.
1793 We do this after building the whole tree, since GC may happen while the
1794 tree is constructed, and small strings are relocated. So we must wait
1795 until no GC can happen before storing pointers into lisp values. */
1796static void
1797update_submenu_strings (first_wv)
1798 widget_value *first_wv;
1799{
1800 widget_value *wv;
1801
1802 for (wv = first_wv; wv; wv = wv->next)
1803 {
1804 if (wv->lname && ! NILP (wv->lname))
1805 {
1806 wv->name = SDATA (wv->lname);
1807
1808 /* Ignore the @ that means "separate pane".
1809 This is a kludge, but this isn't worth more time. */
1810 if (wv->value == (char *)1)
1811 {
1812 if (wv->name[0] == '@')
1813 wv->name++;
1814 wv->value = 0;
1815 }
1816 }
1817
1818 if (wv->lkey && ! NILP (wv->lkey))
1819 wv->key = SDATA (wv->lkey);
1820
1821 if (wv->contents)
1822 update_submenu_strings (wv->contents);
1823 }
1824}
1825
1793 1826
1794/* Recompute all the widgets of frame F, when the menu bar has been 1827/* Recompute all the widgets of frame F, when the menu bar has been
1795 changed. Value is non-zero if widgets were updated. */ 1828 changed. Value is non-zero if widgets were updated. */
@@ -2022,9 +2055,10 @@ set_frame_menubar (f, first_time, deep_p)
2022 Lisp_Object string; 2055 Lisp_Object string;
2023 string = XVECTOR (items)->contents[i + 1]; 2056 string = XVECTOR (items)->contents[i + 1];
2024 if (NILP (string)) 2057 if (NILP (string))
2025 break; 2058 break;
2026 wv->name = (char *) SDATA (string); 2059 wv->name = (char *) SDATA (string);
2027 wv = wv->next; 2060 update_submenu_strings (wv->contents);
2061 wv = wv->next;
2028 } 2062 }
2029 2063
2030 f->menu_bar_vector = menu_items; 2064 f->menu_bar_vector = menu_items;