aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaroly Lorentey2004-03-25 22:21:45 +0000
committerKaroly Lorentey2004-03-25 22:21:45 +0000
commit945c3bbb15ab1af18e94ab6f81e9c72c8ce1402f (patch)
tree05e55d5c123e596a9ce2b3faa4f0cdd4c60da06b
parent628ef544965db216898fbded4baac86343312a11 (diff)
parentabdb9b8306ccc3dc1d0603017466c023f09b9228 (diff)
downloademacs-945c3bbb15ab1af18e94ab6f81e9c72c8ce1402f.tar.gz
emacs-945c3bbb15ab1af18e94ab6f81e9c72c8ce1402f.zip
Merged in changes from CVS HEAD
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-161 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-162 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-163 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-164 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-165 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-166 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-167 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-168 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-169 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-170 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-171 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-172 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-122
-rw-r--r--ChangeLog14
-rw-r--r--configure.in19
-rw-r--r--etc/ChangeLog5
-rw-r--r--etc/NEWS65
-rw-r--r--etc/PROBLEMS18
-rw-r--r--etc/TODO12
-rw-r--r--leim/ChangeLog2
-rw-r--r--leim/quail/cyrillic.el16
-rw-r--r--leim/quail/hebrew.el8
-rw-r--r--lib-src/ChangeLog6
-rw-r--r--lisp/ChangeLog319
-rw-r--r--lisp/abbrevlist.el2
-rw-r--r--lisp/add-log.el5
-rw-r--r--lisp/allout.el6
-rw-r--r--lisp/autorevert.el141
-rw-r--r--lisp/calendar/appt.el36
-rw-r--r--lisp/calendar/calendar.el6
-rw-r--r--lisp/calendar/diary-lib.el2
-rw-r--r--lisp/composite.el2
-rw-r--r--lisp/descr-text.el19
-rw-r--r--lisp/diff-mode.el227
-rw-r--r--lisp/dired-aux.el6
-rw-r--r--lisp/dired-x.el88
-rw-r--r--lisp/dired.el125
-rw-r--r--lisp/disp-table.el6
-rw-r--r--lisp/emacs-lisp/advice.el50
-rw-r--r--lisp/emacs-lisp/backquote.el10
-rw-r--r--lisp/emacs-lisp/byte-opt.el245
-rw-r--r--lisp/emacs-lisp/byte-run.el15
-rw-r--r--lisp/emacs-lisp/bytecomp.el20
-rw-r--r--lisp/emacs-lisp/checkdoc.el6
-rw-r--r--lisp/emacs-lisp/edebug.el24
-rw-r--r--lisp/emacs-lisp/lisp-mnt.el4
-rw-r--r--lisp/emacs-lisp/lisp-mode.el32
-rw-r--r--lisp/emacs-lisp/pp.el12
-rw-r--r--lisp/emacs-lisp/rx.el13
-rw-r--r--lisp/emacs-lisp/warnings.el2
-rw-r--r--lisp/files.el14
-rw-r--r--lisp/finder.el6
-rw-r--r--lisp/font-lock.el2
-rw-r--r--lisp/format.el4
-rw-r--r--lisp/gnus/ChangeLog13
-rw-r--r--lisp/gnus/gnus-art.el79
-rw-r--r--lisp/gnus/gnus-score.el12
-rw-r--r--lisp/gnus/imap.el8
-rw-r--r--lisp/help-at-pt.el10
-rw-r--r--lisp/hexl.el23
-rw-r--r--lisp/info-xref.el161
-rw-r--r--lisp/info.el7
-rw-r--r--lisp/international/characters.el78
-rw-r--r--lisp/international/mule-cmds.el26
-rw-r--r--lisp/international/mule-diag.el2
-rw-r--r--lisp/international/mule.el2
-rw-r--r--lisp/international/quail.el10
-rw-r--r--lisp/jit-lock.el1
-rw-r--r--lisp/jka-compr.el27
-rw-r--r--lisp/kmacro.el2
-rw-r--r--lisp/language/ethio-util.el2
-rw-r--r--lisp/log-edit.el2
-rw-r--r--lisp/man.el72
-rw-r--r--lisp/play/landmark.el2
-rw-r--r--lisp/progmodes/cfengine.el6
-rw-r--r--lisp/progmodes/compile.el6
-rw-r--r--lisp/progmodes/gdb-ui.el (renamed from lisp/gdb-ui.el)0
-rw-r--r--lisp/ruler-mode.el269
-rw-r--r--lisp/simple.el30
-rw-r--r--lisp/smerge-mode.el119
-rw-r--r--lisp/textmodes/fill.el2
-rw-r--r--lisp/textmodes/ispell.el2
-rw-r--r--lisp/textmodes/tex-mode.el8
-rw-r--r--lisp/time.el8
-rw-r--r--lisp/vc-arch.el192
-rw-r--r--lisp/vc-cvs.el12
-rw-r--r--lisp/vc-hooks.el32
-rw-r--r--lisp/vc-rcs.el10
-rw-r--r--lisp/vc-sccs.el10
-rw-r--r--lisp/vc.el71
-rw-r--r--lisp/woman.el4
-rw-r--r--lispref/ChangeLog7
-rw-r--r--lispref/sequences.texi4
-rw-r--r--lispref/text.texi2
-rw-r--r--man/ChangeLog16
-rw-r--r--man/emacs.texi1
-rw-r--r--man/faq.texi8
-rw-r--r--man/glossary.texi24
-rw-r--r--man/help.texi28
-rw-r--r--man/mini.texi8
-rw-r--r--man/misc.texi17
-rw-r--r--man/sending.texi2
-rw-r--r--man/ses.texi2
-rw-r--r--man/text.texi2
-rw-r--r--man/trouble.texi6
-rw-r--r--src/ChangeLog55
-rw-r--r--src/buffer.c2
-rw-r--r--src/dispextern.h4
-rw-r--r--src/editfns.c2
-rw-r--r--src/image.c4
-rw-r--r--src/insdel.c8
-rw-r--r--src/lisp.h2
-rw-r--r--src/s/sol2-6.h5
-rw-r--r--src/term.c88
-rw-r--r--src/xdisp.c503
-rw-r--r--src/xterm.c8
-rwxr-xr-xupdate-subdirs8
104 files changed, 2514 insertions, 1236 deletions
diff --git a/ChangeLog b/ChangeLog
index 11007917351..b50a9a5bd5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
12004-03-22 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * update-subdirs: Add local variables to prevent byte-compiling.
4
52004-03-21 Dave Love <fx@gnu.org>
6
7 * configure.in: Fix previous change.
8
92004-03-18 Dave Love <fx@gnu.org>
10
11 * configure.in: Add -znocombreloc to LDFLAGS if compiler supports it.
12
12004-03-15 Luc Teirlinck <teirllm@auburn.edu> 132004-03-15 Luc Teirlinck <teirllm@auburn.edu>
2 14
3 * info/dir (File): Add SMTP and SES. 15 * info/dir (File): Add SMTP and SES.
@@ -34,7 +46,7 @@
34 46
352004-01-06 Eric Hanchrow <offby1@blarg.net> (tiny change) 472004-01-06 Eric Hanchrow <offby1@blarg.net> (tiny change)
36 48
37 * make-dist (tempdir): Include cursors in nt/icons 49 * make-dist (tempdir): Include cursors in nt/icons.
38 50
392003-12-30 Eli Zaretskii <eliz@elta.co.il> 512003-12-30 Eli Zaretskii <eliz@elta.co.il>
40 52
diff --git a/configure.in b/configure.in
index d5e4ba1e69b..3e89bea0c2d 100644
--- a/configure.in
+++ b/configure.in
@@ -1273,6 +1273,25 @@ then
1273 ac_link="$ac_link $NON_GCC_LINK_TEST_OPTIONS" 1273 ac_link="$ac_link $NON_GCC_LINK_TEST_OPTIONS"
1274fi 1274fi
1275 1275
1276dnl We need -znocombreloc if we're using a relatively recent GNU ld.
1277dnl If we can link with the flag, it shouldn't do any harm anyhow.
1278dnl (Don't use `-z nocombreloc' as -z takes no arg on Irix.)
1279dnl Treat GCC specially since it just gives a non-fatal `unrecognized option'
1280dnl if not built to support GNU ld.
1281
1282late_LDFLAGS=$LDFLAGS
1283if test $GCC = yes; then
1284 LDFLAGS="$LDFLAGS -Wl,-znocombreloc"
1285else
1286 LDFLAGS="$LDFLAGS -znocombreloc"
1287fi
1288
1289AC_MSG_CHECKING([For -znocombreloc])
1290AC_LINK_IFELSE([main(){return 0;}],
1291 [AC_MSG_RESULT(yes)],
1292 LDFLAGS=$late_LDFLAGS
1293 [AC_MSG_RESULT(no)])
1294
1276dnl checks for Unix variants 1295dnl checks for Unix variants
1277AC_AIX 1296AC_AIX
1278 1297
diff --git a/etc/ChangeLog b/etc/ChangeLog
index abb0bf19a45..6d542fb96c5 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,8 @@
12004-03-19 Kim F. Storm <storm@cua.dk>
2
3 * TODO: Remove entries for fringe related issues (DONE).
4 Remove entry about image-relative coordinates of mouse clicks (DONE).
5
12004-03-11 Daniel Pfeiffer <occitan@esperanto.org> 62004-03-11 Daniel Pfeiffer <occitan@esperanto.org>
2 7
3 * compilation.txt: New file. 8 * compilation.txt: New file.
diff --git a/etc/NEWS b/etc/NEWS
index f44134bae40..223f9657583 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -92,7 +92,7 @@ types any more. Add -DUSE_LISP_UNION_TYPE if you want union types.
92 92
93It now uses font-lock for turning compiler output into hypertext. Quite a few 93It now uses font-lock for turning compiler output into hypertext. Quite a few
94more kinds of messages are recognized. Messages that are recognized as 94more kinds of messages are recognized. Messages that are recognized as
95warnings or informational come in orange or green, instead of red. 95warnings or informational come in orange or green, instead of red.
96Informational messages are by default skipped with `next-error'. 96Informational messages are by default skipped with `next-error'.
97 97
98The new file etc/compilation.txt gives examples of each type of message. 98The new file etc/compilation.txt gives examples of each type of message.
@@ -233,7 +233,7 @@ highlighted in `font-lock-doc-face'.
233*** Microsoft SQLServer support has been significantly improved. 233*** Microsoft SQLServer support has been significantly improved.
234Keyword highlighting for SqlServer 2000 is implemented. 234Keyword highlighting for SqlServer 2000 is implemented.
235sql-interactive-mode defaults to use osql, rather than isql, because 235sql-interactive-mode defaults to use osql, rather than isql, because
236osql flushes it's error stream more frequently. Thus error messages 236osql flushes its error stream more frequently. Thus error messages
237are displayed when they occur rather than when the session is 237are displayed when they occur rather than when the session is
238terminated. 238terminated.
239 239
@@ -1627,7 +1627,7 @@ to view diffs or log entries directly from vc-annotate-mode:
1627 L: shows the log of the revision at line 1627 L: shows the log of the revision at line
1628 W: annotates the workfile (most up to date) version 1628 W: annotates the workfile (most up to date) version
1629 1629
1630* New modes and packages in 21.4 1630* New modes and packages in Emacs 21.4
1631 1631
1632+++ 1632+++
1633** The new global minor mode `size-indication-mode' (off by default) 1633** The new global minor mode `size-indication-mode' (off by default)
@@ -1850,6 +1850,65 @@ configuration files.
1850 1850
1851* Lisp Changes in Emacs 21.4 1851* Lisp Changes in Emacs 21.4
1852 1852
1853** The display space :width and :align-to text properties are now
1854supported on text terminals.
1855
1856** Enhancements to stretch display properties
1857
1858The display property stretch specification form `(space PROPS)', where
1859PROPS is a property list now allows pixel based width and height
1860specifications, as well as enhanced horizontal text alignment.
1861
1862The value of these properties can now be a (primitive) expression
1863which is evaluated during redisplay. The following expressions
1864are supported:
1865
1866EXPR ::= NUM | (NUM) | UNIT | ELEM | POS | IMAGE | FORM
1867NUM ::= INTEGER | FLOAT | SYMBOL
1868UNIT ::= in | mm | cm | width | height
1869ELEM ::= left-fringe | right-fringe | left-margin | right-margin
1870 | scroll-bar | text
1871POS ::= left | center | right
1872FORM ::= (NUM . EXPR) | (OP EXPR ...)
1873OP ::= + | -
1874
1875The form `NUM' specifies a fractional width or height of the default
1876frame font size. The form `(NUM)' specifies an absolute number of
1877pixels. If a symbol is specified, its buffer-local variable binding
1878is used. The `in', `mm', and `cm' units specifies the number of
1879pixels per inch, milli-meter, and centi-meter, resp. The `width' and
1880`height' units correspond to the width and height of the current face
1881font. An image specification corresponds to the width or height of
1882the image.
1883
1884The `left-fringe', `right-fringe', `left-margin', `right-margin',
1885`scroll-bar', and `text' elements specify to the width of the
1886corresponding area of the window.
1887
1888The `left', `center', and `right' positions can be used with :align-to
1889to specify a position relative to the left edge, center, or right edge
1890of the text area. One of the above window elements (except `text')
1891can also be used with :align-to to specify that the position is
1892relative to the left edge of the given area. Once the base offset for
1893a relative position has been set (by the first occurrence of one of
1894these symbols), further occurences of these symbols are interpreted as
1895the width of the area.
1896
1897For example, to align to the center of the left-margin, use
1898 :align-to (+ left-margin (0.5 . left-margin))
1899
1900If no specific base offset is set for alignment, it is always relative
1901to the left edge of the text area. For example, :align-to 0 in a
1902header-line aligns with the first text column in the text area.
1903
1904The value of the form `(NUM . EXPR)' is the value of NUM multiplied by
1905the value of the expression EXPR. For example, (2 . in) specifies a
1906width of 2 inches, while (0.5 . IMAGE) specifies half the width (or
1907height) of the specified image.
1908
1909The form `(+ EXPR ...)' adds up the value of the expressions.
1910The form `(- EXPR ...)' negates or subtracts the value of the expressions.
1911
1853** New macro with-local-quit temporarily sets inhibit-quit to nil for use 1912** New macro with-local-quit temporarily sets inhibit-quit to nil for use
1854around potentially blocking or long-running code in timers 1913around potentially blocking or long-running code in timers
1855and post-command-hooks. 1914and post-command-hooks.
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 30a65b01bb7..ed6875821ae 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -58,20 +58,18 @@ xrealloc(). Relinking the application (by deleting src/temacs and
58running make) will solve the problem. It appears to be caused by some 58running make) will solve the problem. It appears to be caused by some
59problems with the unexec code and its interaction with libSystem.B. 59problems with the unexec code and its interaction with libSystem.B.
60 60
61* Emacs crashes with SIGSEGV on Solaris in XtInitializeWidgetClass 61* Emacs crashes with SIGSEGV in XtInitializeWidgetClass
62 62
63It crashes on X, but runs fine when called with option "-nw". 63It crashes on X, but runs fine when called with option "-nw".
64 64
65This has been observed when emacs is linked with GNU ld instead of 65This has been observed when Emacs is linked with GNU ld but without passing
66Solaris ld. To check which ld is used by gcc add "-V" to 66the -z nocombreloc flag. Emacs normally knows to pass the -z nocombreloc
67TEMACS_LDFLAGS in src/Makefile. Alternatively the executable size may 67flag when needed, so if you come across a situation where the flag is
68be used as an indication of which linker is used. The size is 68necessary but missing, please report it via M-x report-emacs-bug.
69approximately 15M when linked with solaris ld compared to 9M when
70linked with GNU ld.
71
72The fix is to reconfigure/install gcc, making sure that the SUN linker
73is used.
74 69
70On platforms such as Solaris, you can also work around this problem by
71configuring your compiler to use the native linker instead of GNU ld.
72
75* Characters from the mule-unicode charsets aren't displayed under X. 73* Characters from the mule-unicode charsets aren't displayed under X.
76 74
77XFree86 4 contains many fonts in iso10646-1 encoding which have 75XFree86 4 contains many fonts in iso10646-1 encoding which have
diff --git a/etc/TODO b/etc/TODO
index f13869a05f1..960adbf553f 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -63,14 +63,6 @@ Important features:
63* Remove the limitation that window and frame widths and heights can 63* Remove the limitation that window and frame widths and heights can
64 be only full columns/lines. 64 be only full columns/lines.
65 65
66* Move fringe to be displayed between display margins and text area.
67 [KFS is looking into this].
68
69* Set fringe widths per-window/per-buffer.
70
71* Make fringe bitmaps user configurable. Maybe add ability to add
72 additional bitmaps to the fringe from lisp.
73
74Other features we would like: 66Other features we would like:
75 67
76* Have a command suggestion help system that recognizes patterns 68* Have a command suggestion help system that recognizes patterns
@@ -266,10 +258,6 @@ Other features we would like:
266 cvs-status (should be described in PCL-CVS manual); other progmodes, 258 cvs-status (should be described in PCL-CVS manual); other progmodes,
267 probably in separate manual. 259 probably in separate manual.
268 260
269* Provide a means to extract image-relative coordinates from mouse
270 clicks on images. (Needed for W3, at least.) Also useful for W3
271 and Gnus: allow images to scroll properly.
272
273* Convert the XPM bitmaps to PPM, replace the PBMs with them and scrap 261* Convert the XPM bitmaps to PPM, replace the PBMs with them and scrap
274 the XPMs so that the colour versions work generally. (Requires care 262 the XPMs so that the colour versions work generally. (Requires care
275 with the colour used for the transparent regions.) 263 with the colour used for the transparent regions.)
diff --git a/leim/ChangeLog b/leim/ChangeLog
index 2f44746ad7d..c9805dbdd2c 100644
--- a/leim/ChangeLog
+++ b/leim/ChangeLog
@@ -722,7 +722,7 @@
722 translation. 722 translation.
723 723
724 * quail/japanese.el ("japanese"): Delete the key sequence for 724 * quail/japanese.el ("japanese"): Delete the key sequence for
725 Roman transliteration from the docstring because it's now shonw 725 Roman transliteration from the docstring because it's now shown
726 automatically. 726 automatically.
727 ("japanese-ascii", "japanese-zenkaku") 727 ("japanese-ascii", "japanese-zenkaku")
728 ("japanese-hankaku-kana", "japanese-hiragana") 728 ("japanese-hankaku-kana", "japanese-hiragana")
diff --git a/leim/quail/cyrillic.el b/leim/quail/cyrillic.el
index 9199a415a6e..82d113be5a2 100644
--- a/leim/quail/cyrillic.el
+++ b/leim/quail/cyrillic.el
@@ -52,8 +52,8 @@
52 nil t t t t nil nil nil nil nil t) 52 nil t t t t nil nil nil nil nil t)
53 53
54;; 1! 2" 3' 4* 5: 6, 7. 8; 9( 0) -_ =+ ,L!(B 54;; 1! 2" 3' 4* 5: 6, 7. 8; 9( 0) -_ =+ ,L!(B
55;; ,L9(B ,LF(B ,LC(B ,L:(B ,L5(B ,L=(B ,L3(B ,LH(B ,LI(B ,L7(B ,LE(B ,Lj(B 55;; ,L9(B ,LF(B ,LC(B ,L:(B ,L5(B ,L=(B ,L3(B ,LH(B ,LI(B ,L7(B ,LE(B ,LJ(B
56;; ,LD(B ,LK(B ,L2(B ,L0(B ,L?(B ,L@(B ,L>(B ,L;(B ,L4(B ,L6(B ,LM(B 56;; ,LD(B ,LK(B ,L2(B ,L0(B ,L?(B ,L@(B ,L>(B ,L;(B ,L4(B ,L6(B ,LM(B
57;; ,LO(B ,LG(B ,LA(B ,L<(B ,L8(B ,LB(B ,LL(B ,L1(B ,LN(B /? 57;; ,LO(B ,LG(B ,LA(B ,L<(B ,L8(B ,LB(B ,LL(B ,L1(B ,LN(B /?
58 58
59(quail-define-rules 59(quail-define-rules
@@ -174,8 +174,8 @@
174 nil t t t t nil nil nil nil nil t) 174 nil t t t t nil nil nil nil nil t)
175 175
176;; 1! 2" 3,Lp(B 4; 5% 6: 7? 8* 9( 0) -_ =+ ,Lq!(B 176;; 1! 2" 3,Lp(B 4; 5% 6: 7? 8* 9( 0) -_ =+ ,Lq!(B
177;; ,L9(B ,LF(B ,LC(B ,L:(B ,L5(B ,L=(B ,L3(B ,LH(B ,LI(B ,L7(B ,LE(B ,Lj(B 177;; ,L9(B ,LF(B ,LC(B ,L:(B ,L5(B ,L=(B ,L3(B ,LH(B ,LI(B ,L7(B ,LE(B ,LJ(B
178;; ,LD(B ,LK(B ,L2(B ,L0(B ,L?(B ,L@(B ,L>(B ,L;(B ,L4(B ,L6(B ,LM(B 178;; ,LD(B ,LK(B ,L2(B ,L0(B ,L?(B ,L@(B ,L>(B ,L;(B ,L4(B ,L6(B ,LM(B
179;; ,LO(B ,LG(B ,LA(B ,L<(B ,L8(B ,LB(B ,LL(B ,L1(B ,LN(B ., 179;; ,LO(B ,LG(B ,LA(B ,L<(B ,L8(B ,LB(B ,LL(B ,L1(B ,LN(B .,
180 180
181(quail-define-rules 181(quail-define-rules
@@ -999,8 +999,8 @@ as follows.
999(quail-define-package 999(quail-define-package
1000 "cyrillic-translit" "Cyrillic" ",L6(Bt" nil 1000 "cyrillic-translit" "Cyrillic" ",L6(Bt" nil
1001 "Intuitively transliterated keyboard layout. 1001 "Intuitively transliterated keyboard layout.
1002Most convenient for entering Russian but all Cyrillic characters are included. 1002Most convenient for entering Russian, but all Cyrillic characters
1003Should handle most cases. However: 1003are included. Should handle most cases. However:
1004 for ,Lf(B (TSE) use \"c\", never \"ts\" 1004 for ,Lf(B (TSE) use \"c\", never \"ts\"
1005 ,Li(B (SHCHA = Bulgarian SHT) = \"shch\", \"sj\", \"/sht\" or \"/t\", 1005 ,Li(B (SHCHA = Bulgarian SHT) = \"shch\", \"sj\", \"/sht\" or \"/t\",
1006 ,Lm(B (REVERSE ROUNDED E) = \"e'\" or \"e`\" 1006 ,Lm(B (REVERSE ROUNDED E) = \"e'\" or \"e`\"
@@ -1072,8 +1072,8 @@ Unicode based."
1072 nil t t t t nil nil nil nil nil t) 1072 nil t t t t nil nil nil nil nil t)
1073 1073
1074;; $,1(q(!(B 1! 2" 3N 4; 5% 6: 7? 8* 9( 0) -_ =+ 1074;; $,1(q(!(B 1! 2" 3N 4; 5% 6: 7? 8* 9( 0) -_ =+
1075;; $,1(9(B $,1(F(B $,1(C(B $,1(:(B $,1(5(B $,1(=(B $,1(3(B $,1(H(B $,1(.(B $,1(7(B $,1(E(B ' 1075;; $,1(9(B $,1(F(B $,1(C(B $,1(:(B $,1(5(B $,1(=(B $,1(3(B $,1(H(B $,1(.(B $,1(7(B $,1(E(B '
1076;; $,1(D(B $,1(K(B $,1(2(B $,1(0(B $,1(?(B $,1(@(B $,1(>(B $,1(;(B $,1(4(B $,1(6(B $,1(M(B 1076;; $,1(D(B $,1(K(B $,1(2(B $,1(0(B $,1(?(B $,1(@(B $,1(>(B $,1(;(B $,1(4(B $,1(6(B $,1(M(B
1077;; $,1(O(B $,1(G(B $,1(A(B $,1(<(B $,1(&(B $,1(B(B $,1(L(B $,1(1(B $,1(N(B ., 1077;; $,1(O(B $,1(G(B $,1(A(B $,1(<(B $,1(&(B $,1(B(B $,1(L(B $,1(1(B $,1(N(B .,
1078 1078
1079(quail-define-rules 1079(quail-define-rules
diff --git a/leim/quail/hebrew.el b/leim/quail/hebrew.el
index b3cce078ef8..e44724e1eb4 100644
--- a/leim/quail/hebrew.el
+++ b/leim/quail/hebrew.el
@@ -35,10 +35,10 @@ Based on Hebrew typewriter keys.
35Hebrew letters are assigned to lowercases. 35Hebrew letters are assigned to lowercases.
36" nil t t t t nil nil nil nil nil t) 36" nil t t t t nil nil nil nil nil t)
37 37
38;; 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) _- += ~; 38;; 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ ;~
39;; /Q 'W ,Hw(BE ,Hx(BR ,H`(BT ,Hh(BY ,He(BU ,Ho(BI ,Hm(BO ,Ht(BP {[ {] 39;; /Q 'W ,Hw(BE ,Hx(BR ,H`(BT ,Hh(BY ,He(BU ,Ho(BI ,Hm(BO ,Ht(BP [{ ]}
40;; ,Hy(BA ,Hc(BS ,Hb(BD ,Hk(BF ,Hr(BG ,Hi(BH ,Hg(BJ ,Hl(BK ,Hj(BL :,Hs(B ", |\ 40;; ,Hy(BA ,Hc(BS ,Hb(BD ,Hk(BF ,Hr(BG ,Hi(BH ,Hg(BJ ,Hl(BK ,Hj(BL ,Hs(B: ," \|
41;; ,Hf(BZ ,Hq(BX ,Ha(BC ,Hd(BV ,Hp(BB ,Hn(BN ,Hv(BM <,Hz(B >,Hu(B ?. 41;; ,Hf(BZ ,Hq(BX ,Ha(BC ,Hd(BV ,Hp(BB ,Hn(BN ,Hv(BM ,Hz(B< ,Hu(B> .?
42;; 42;;
43 43
44(quail-define-rules 44(quail-define-rules
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 4e995ff185a..819b4db4a1d 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -45,12 +45,6 @@
45 Only try su-fallback if the socket name was not explicit. 45 Only try su-fallback if the socket name was not explicit.
46 Check socket name length in su-fallback case as well. 46 Check socket name length in su-fallback case as well.
47 47
482004-01-20 Stefan Monnier <monnier@iro.umontreal.ca>
49
50 * emacsclient.c (main): Stop if socket name too long.
51 Only try su-fallback if the socket name was not explicit.
52 Check socket name length in su-fallback case as well.
53
542004-01-08 Andreas Schwab <schwab@suse.de> 482004-01-08 Andreas Schwab <schwab@suse.de>
55 49
56 * emacsclient.c (main): Save errno from socket_status. 50 * emacsclient.c (main): Save errno from socket_status.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 99af6134a67..89a18361ddd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,310 @@
12004-03-26 Masatake YAMATO <jet@gyve.org>
2
3 * simple.el (completion-setup-function): Emphasize the
4 first uncommon characters in the completions;and de-emphasize
5 the common prefix substrings.
6 (completion-emphasis): New face.
7 (completion-de-emphasis): New face.
8
92004-03-25 Sam Steingold <sds@gnu.org>
10
11 * vc.el (vc-print-log): Fixed a bug in the last patch:
12 backend-function may be a byte-compiled object, not a lambda
13
142004-03-25 Juri Linkov <juri@jurta.org>
15
16 * descr-text.el (describe-property-list): Add a button
17 for `face' property that calls `describe-face'.
18 Suggested by luis fernandes <elf@ee.ryerson.ca>
19
20 * international/mule.el (keyboard-coding-system):
21 * kmacro.el (kmacro-call-macro): Fix docstring.
22
23 * dired.el: Fix comments.
24
25 * textmodes/fill.el (fill): Fix Info link.
26
27 * font-lock.el (fast-lock, lazy-lock):
28 * jit-lock.el (jit-lock): Remove links to removed Support Modes
29 Info node.
30
31 * info-xref.el: Fix commentary.
32
332004-03-25 Kevin Ryde <user42@zip.com.au>
34
35 * info-xref.el (info-xref-check-buffer): Report empty filename parts.
36 Remove spurious node duplicate suppression, doesn't work, not wanted.
37 (info-xref-output): Take format style args, add "sit-for 0" to let
38 user see the results as they progress.
39 (info-xref-check-all-custom): New function.
40
412004-03-25 Nick Roberts <nick@nick.uklinux.net>
42
43 * gdb-ui.el: Moved to progmodes.
44
452004-03-24 Glenn Morris <gmorris@ast.cam.ac.uk>
46
47 * calendar/appt.el (appt-check): Remove superfluous progn.
48 When finished with diary buffer: if it was not being displayed
49 before, kill it; otherwise restore its original state.
50 Suggested by Matthew Mundell <matt@mundell.ukfsn.org>.
51
52 * calendar/calendar.el (calendar-set-mode-line): Use total
53 available mode-line width, rather than frame-width.
54
55 * calendar/diary-lib.el (fancy-diary-display): Set mode-line
56 after mode change so effect not lost.
57
582004-03-23 Dave Love <fx@gnu.org>
59
60 * dired.el (dired) <defgroup>: Add link to manual.
61 (dired-font-lock-keywords): Add highlighting on unusual permissions.
62 (dired-revert): Use dolist.
63 (dired-mode-map): Add U binding.
64 (dired-mode): Add font-lock-beginning-of-syntax-function.
65 (dired-garbage-files-regexp): Make it a defcustom.
66
672004-03-23 Stefan Monnier <monnier@iro.umontreal.ca>
68
69 * vc-arch.el (vc-arch-diff): Handle the special case where `newvers'
70 is equivalent to nil.
71 (vc-arch-diff3-rej-p): Be a bit more flexible in what we accept.
72 (vc-arch-mode-line-string): Accept `added' state.
73 (vc-arch-state): Use inode-sigs if available.
74 (vc-arch-add-tagline): Rename from vc-arch-add-tag.
75 Copy&delete existing id file if any. Fallback if uuidgen is absent.
76 (vc-arch-tagline-re): New var.
77 (vc-arch-file-source-p, vc-arch-file-id, vc-arch-tagging-method):
78 New functions.
79 (vc-arch-find-file-not-found-hook, vc-arch-register): New backend ops.
80 (vc-arch-registered): Try our best guess using vc-arch-file-source-p.
81
82 * vc-hooks.el (vc-default-find-file-not-found-hook): New fun.
83 (vc-file-not-found-hook): Use it.
84
85 * diff-mode.el (diff-default-read-only): Change default.
86 (diff-mode-hook): Make it a defcustom. Add some options.
87 (diff-mode-map): Bind diff-refine-hook.
88 (diff-yank-handler): New var.
89 (diff-yank-function): New fun.
90 (diff-font-lock-keywords): Use them.
91 (diff-end-of-file): Handle case where file-header looks like diff text.
92 (diff-hunk-kill): Adjust to "new" hunk-next behavior.
93 (diff-file-kill): Delete a subsequent empty line, if applicable.
94 (diff-hunk-file-names): New fun, extracted from diff-tell-file-name.
95 (diff-find-file-name): Use it.
96 (diff-tell-file-name): New command.
97 (diff-mode): Be careful with view-mode.
98 (diff-delete-if-empty, diff-delete-empty-files, diff-make-unified):
99 New functions, for use in diff-mode-hook.
100 (diff-find-source-location): Catch "regex too large" errors.
101 (diff-apply-hunk, diff-test-hunk): Go to old or new file.
102 (diff-refine-hunk): New command.
103
104 * smerge-mode.el (smerge-mode-menu): Fix activate pred for resolve.
105 (smerge-context-menu-map): Remove unused var.
106 (smerge-keep-all): Preserve markers.
107 (smerge-keep-n): New fun.
108 (smerge-keep-base, smerge-keep-other, smerge-keep-mine)
109 (smerge-keep-current, smerge-ediff): Use it.
110 (smerge-kill-current): Use it. Make it work on some 3-part conflicts.
111 (smerge-popup-context-menu): Also use context-menu on 3-part conflicts.
112 (smerge-resolve): Resolve trivial 3-part conflicts.
113
1142004-03-23 Juri Linkov <juri@jurta.org>
115
116 * man.el (Man-width): New var.
117 (Man-getpage-in-background): Use it.
118 (Man-support-local-filenames): New var and fun.
119 (Man-build-man-command): Don't add a second %s.
120 (Man-fontify-manpage): Clean up message.
121 (Man-mode): Set outline-regexp, outline-level,
122 imenu-generic-expression.
123
124 * woman.el (woman-fill-frame): Doc fix.
125 (woman-decode-region): Use window-width instead of frame-width.
126
127 * abbrevlist.el (list-one-abbrev-table):
128 * descr-text.el (describe-char):
129 * international/mule-diag.el (describe-current-coding-system):
130 * international/quail.el (quail-insert-decode-map):
131 Use window-width instead of frame-width.
132
133 * jka-compr.el (jka-compr-compression-info-list): Add tbz and dz.
134 (jka-compr-mode-alist-additions): Add tbz.
135 (jka-compr-write-region, jka-compr-insert-file-contents):
136 Add message for undefined compress-program.
137 (jka-compr-write-region): Remove redundant var bindings.
138
139 * dired-x.el (dired-guess-shell-alist-default): Add choices for
140 extracting files into subdirectory. Add tbz and dz. Fix regexps.
141 Add extensions .[0-9] for man and nroff, and .pod for perldoc.
142 (dired-man): Use dired-guess-shell-command.
143 (dired-guess-shell-case-fold-search): Change defvar to defcustom.
144 Change default nil to t.
145
146 * dired-aux.el (dired-compress-file-suffixes): Add dz and tbz.
147 (dired-compare-directories): Add default value for empty input.
148
149 * help-at-pt.el: Move suggestions for key bindings to Commentary.
150
151 * time.el (display-time-string-forms): Fix help-echo date format.
152
1532004-03-22 Luc Teirlinck <teirllm@auburn.edu>
154
155 * autorevert.el (global-auto-revert-non-file-buffers): Expand docstring.
156 (buffer-stale-function): New variable.
157 (auto-revert-list-diff, auto-revert-dired-file-list)
158 (auto-revert-dired-changed-p, auto-revert-buffer-p): Delete.
159 (auto-revert-handler): Take over some functionality of deleted
160 functions.
161 (auto-revert-buffers): Delete call to auto-revert-buffer-p.
162
163 * dired.el (dired-directory-changed-p, dired-buffer-stale-p): New funs.
164 (dired-internal-noselect): Use dired-directory-changed-p.
165 Eliminate revert messages.
166 (dired-mode): Set buffer-stale-function to dired-buffer-stale-p.
167
1682004-03-23 Kenichi Handa <handa@etlken2>
169
170 * international/characters.el: Setup syntaxes for more parentheses
171 Unicode characters.
172
173 * international/mule-cmds.el (select-safe-coding-system):
174 Merge coding-system and auto-cs before comparing them.
175
1762004-03-22 Stefan Monnier <monnier@iro.umontreal.ca>
177
178 * emacs-lisp/pp.el (pp-eval-expression): Simplify.
179
180 * emacs-lisp/lisp-mode.el (lisp-mode-variables): Don't set
181 normal-auto-fill-function and comment-indent-function.
182 The default values now work just as well.
183 Don't set font-lock-beginning-of-syntax-function since we already set
184 syntax-begin-function.
185 (lisp-outline-level): Put ;;;###autoload at same level as (.
186 (prin1-char): Quote special chars.
187
188 * emacs-lisp/lisp-mnt.el (lm-keywords-finder-p): Use defvar rather
189 than with-no-warnings.
190
191 * emacs-lisp/edebug.el (edebug-display): Bring up a debug trace
192 if the source location can't be found.
193 (edebug-compute-previous-result): Use prin1-char.
194
195 * emacs-lisp/checkdoc.el (checkdoc-error): Dont' assume point-min == 1.
196 (debug-ignored-errors): Add an entry.
197
198 * emacs-lisp/bytecomp.el (byte-recompile-directory): Ignore hidden dir.
199 (byte-compile-file): Output warning when deleting a file.
200
201 * emacs-lisp/byte-run.el (defsubst): Add edebug spec and use backquote.
202 (dont-compile, eval-when-compile, eval-and-compile): Add edebug spec.
203
204 * emacs-lisp/byte-opt.el (byte-compile-log-lap)
205 (byte-compile-inline-expand): Use backquote.
206 (byte-optimize-pure-func): Rename from byte-optimize-concat.
207 (symbol-name, regexp-opt, regexp-quote): Mark as pure.
208
209 * emacs-lisp/backquote.el (backquote-list*-macro): Use nreverse.
210
211 * emacs-lisp/advice.el (ad-subr-arglist): Simplify.
212
2132004-03-22 Juri Linkov <juri@jurta.org>
214
215 * finder.el (finder-known-keywords): Fix data, tex, unix.
216
217 * play/landmark.el: Fix keywords.
218
219 * language/ethio-util.el (ethio-find-file): Doc fix.
220
221 * emacs-lisp/warnings.el: Doc fix.
222
223 * textmodes/ispell.el (ispell-help): Doc fix.
224
2252004-03-21 Luc Teirlinck <teirllm@auburn.edu>
226
227 * format.el (format-insert-file): Always return a list of two
228 elements, like insert-file-contents does.
229
2302004-03-21 Andre Spiegel <spiegel@gnu.org>
231
232 * vc.el Add new optional BUFFER argument to vc-BACKEND-print-log
233 and vc-BACKEND-diff.
234 (vc-print-log): If the print-log implementation supports it, use
235 the new BUFFER argument to direct output to *vc-change-log*, not *vc*.
236 (vc-version-diff, vc-diff-internal): Doc fixes.
237
238 * vc-hooks.el (vc-default-workfile-unchanged-p): If the
239 implementation supports it, let diff output go to *vc*,
240 not *vc-diff*, since this is an internal call.
241
242 * vc-cvs.el (vc-cvs-print-log, vc-cvs-diff): Add optional BUFFER arg.
243
244 * vc-rcs.el (vc-rcs-print-log, vc-rcs-diff): Likewise.
245
246 * vc-sccs.el (vc-sccs-print-log, vc-sccs-diff): Likewise.
247
2482004-03-21 Dave Love <fx@gnu.org>
249
250 * progmodes/cfengine.el (cfengine-mode):
251 Set parse-sexp-ignore-comments.
252
253 * emacs-lisp/rx.el (rx): Work at compile time, not run time.
254
2552004-03-21 Juanma Barranquero <lektu@terra.es>
256
257 * allout.el (allout-mode): Fix docstring.
258
2592004-03-20 Luc Teirlinck <teirllm@auburn.edu>
260
261 * files.el (insert-directory): Fix bug if SWITCHES is a list.
262
263 * autorevert.el (auto-revert-interval): Make new value take
264 effect immediately when set through Custom.
265 (auto-revert-set-timer): Add interactive declaration.
266
2672004-03-19 David Ponce <david@dponce.com>
268
269 * ruler-mode.el (ruler-mode-header-line-format-old):
270 Don't `make-variable-buffer-local'.
271 (ruler-mode-ruler-function): Default to `ruler-mode-ruler'.
272 (ruler-mode-header-line-format): Simply funcall the above.
273 (ruler-mode): Use `make-local-variable' and `kill-local-variable'
274 to save/restore a previous header line format.
275 (ruler-mode-space): Don't depend on a numeric WIDTH value.
276 (ruler-mode-ruler): Use symbolic display elements for scrollbar,
277 fringes and margins width.
278 (ruler-mode-ruler-function): Default to ruler-mode-ruler.
279
2802004-03-18 Stefan Monnier <monnier@iro.umontreal.ca>
281
282 * log-edit.el (log-edit-font-lock-keywords): Typo.
283
284 * textmodes/tex-mode.el (tex-shell): Set error parsing function here.
285 (tex-send-tex-command): Rather than here.
286 (tex-compilation-parse-errors): Simplify.
287
288 * info.el (Info-default-dirs): Don't ignore last part of I-d-d-l.
289
290 * time.el (display-time-string-forms): Add help-echo with date on time.
291
292 * composite.el (compose-region): Use restore-buffer-modified-p.
293
294 * disp-table.el (standard-display-8bit): Simplify.
295
296 * server.el (server-process-filter): Delete temp frame.
297
298 * add-log.el (add-change-log-entry): Simplify.
299
3002004-03-19 Kim F. Storm <storm@cua.dk>
301
302 * hexl.el (hexl-mode-ruler): Adapt to new :align-to semantics.
303 (hexl-follow-line): Don't require 'fringe.
304
305 * progmodes/compile.el (compilation-start): Always set
306 compilation-last-buffer and return it.
307
12004-03-17 Luc Teirlinck <teirllm@auburn.edu> 3082004-03-17 Luc Teirlinck <teirllm@auburn.edu>
2 309
3 * simple.el (clone-buffer): Doc fix. 310 * simple.el (clone-buffer): Doc fix.
@@ -443,7 +750,7 @@
443 to 'pty. Suggested by Piet van Oostrum <piet@cs.uu.nl>. 750 to 'pty. Suggested by Piet van Oostrum <piet@cs.uu.nl>.
444 (top-level): Setting default value in `tramp-default-method-alist' 751 (top-level): Setting default value in `tramp-default-method-alist'
445 corrected. Order of USER and HOST have been wrong. 752 corrected. Order of USER and HOST have been wrong.
446 Nobody complaimed for months ... 753 Nobody complained for months ...
447 (tramp-smb-maybe-open-connection): Use `tramp-process-connection-type'. 754 (tramp-smb-maybe-open-connection): Use `tramp-process-connection-type'.
448 (tramp-smb-open-connection): Clear password cache if login has failed. 755 (tramp-smb-open-connection): Clear password cache if login has failed.
449 756
@@ -805,8 +1112,7 @@
805 (rsf-bbdb-dont-create-entries-for-deleted-messages): Rename from 1112 (rsf-bbdb-dont-create-entries-for-deleted-messages): Rename from
806 rsf-bbdb-dont-create-entries-for-spam. 1113 rsf-bbdb-dont-create-entries-for-spam.
807 (check-field): New function, extracted from code in 1114 (check-field): New function, extracted from code in
808 rmail-spam-filter to ease addition of header fields like 1115 rmail-spam-filter to ease addition of header fields like content-type.
809 content-type.
810 (message-content-type): New variable to check the content-type: 1116 (message-content-type): New variable to check the content-type:
811 field added, also in defcustom of rsf-definitions-alist. 1117 field added, also in defcustom of rsf-definitions-alist.
812 (rmail-spam-filter): Replace repeated test code for header fields 1118 (rmail-spam-filter): Replace repeated test code for header fields
@@ -862,9 +1168,8 @@
862 1168
8632004-02-16 Jari Aalto <jari.aalto@poboxes.com> 11692004-02-16 Jari Aalto <jari.aalto@poboxes.com>
864 1170
865 Autorevert: Add support to detect changed dired buffers and for 1171 * autorevert.el: Add support to detect changed dired and VC buffers.
866 VC controlled files. 1172 (auto-revert-active-p, auto-revert-list-diff)
867 * autorevert.el (auto-revert-active-p, auto-revert-list-diff)
868 (auto-revert-dired-file-list, auto-revert-dired-changed-p) 1173 (auto-revert-dired-file-list, auto-revert-dired-changed-p)
869 (auto-revert-handler, auto-revert-active-p): New functions. 1174 (auto-revert-handler, auto-revert-active-p): New functions.
870 (auto-revert-buffers): Move revert logic to `auto-revert-handler' 1175 (auto-revert-buffers): Move revert logic to `auto-revert-handler'
@@ -974,7 +1279,7 @@
9742004-02-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 12792004-02-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
975 1280
976 * x-dnd.el (x-dnd-types-alist): Add COMPOUND_TEXT, FILE_NAME 1281 * x-dnd.el (x-dnd-types-alist): Add COMPOUND_TEXT, FILE_NAME
977 handeled by x-dnd-handle-file-name. 1282 handled by x-dnd-handle-file-name.
978 (x-dnd-known-types): Add COMPOUND_TEXT. 1283 (x-dnd-known-types): Add COMPOUND_TEXT.
979 (x-dnd-init-frame): Call x-dnd-init-motif-for-frame. 1284 (x-dnd-init-frame): Call x-dnd-init-motif-for-frame.
980 (x-dnd-get-state-cons-for-frame): Must do copy-sequence on 1285 (x-dnd-get-state-cons-for-frame): Must do copy-sequence on
diff --git a/lisp/abbrevlist.el b/lisp/abbrevlist.el
index 77cf920b422..9c8b0e0d583 100644
--- a/lisp/abbrevlist.el
+++ b/lisp/abbrevlist.el
@@ -39,7 +39,7 @@
39 abbrev-table) 39 abbrev-table)
40 (setq abbrev-list (sort abbrev-list 'string-lessp)) 40 (setq abbrev-list (sort abbrev-list 'string-lessp))
41 (while abbrev-list 41 (while abbrev-list
42 (if (> (+ first-column 40) (frame-width)) 42 (if (> (+ first-column 40) (window-width))
43 (progn 43 (progn
44 (insert "\n") 44 (insert "\n")
45 (setq first-column 0))) 45 (setq first-column 0)))
diff --git a/lisp/add-log.el b/lisp/add-log.el
index e6ec96baa74..609dfde5f65 100644
--- a/lisp/add-log.el
+++ b/lisp/add-log.el
@@ -1,6 +1,6 @@
1;;; add-log.el --- change log maintenance commands for Emacs 1;;; add-log.el --- change log maintenance commands for Emacs
2 2
3;; Copyright (C) 1985, 86, 88, 93, 94, 97, 98, 2000, 2003 3;; Copyright (C) 1985, 86, 88, 93, 94, 97, 98, 2000, 03, 2004
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -489,8 +489,7 @@ non-nil, otherwise in local time."
489 (funcall add-log-buffer-file-name-function) 489 (funcall add-log-buffer-file-name-function)
490 buffer-file-name)) 490 buffer-file-name))
491 (buffer-file (if buf-file-name (expand-file-name buf-file-name))) 491 (buffer-file (if buf-file-name (expand-file-name buf-file-name)))
492 (file-name (expand-file-name 492 (file-name (expand-file-name (find-change-log file-name buffer-file)))
493 (or file-name (find-change-log file-name buffer-file))))
494 ;; Set ITEM to the file name to use in the new item. 493 ;; Set ITEM to the file name to use in the new item.
495 (item (add-log-file-name buffer-file file-name)) 494 (item (add-log-file-name buffer-file file-name))
496 bound) 495 bound)
diff --git a/lisp/allout.el b/lisp/allout.el
index bd5cd6c36ee..eb7ce68fdbc 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -5,7 +5,7 @@
5;; Author: Ken Manheimer <klm@zope.com> 5;; Author: Ken Manheimer <klm@zope.com>
6;; Maintainer: Ken Manheimer <klm@zope.com> 6;; Maintainer: Ken Manheimer <klm@zope.com>
7;; Created: Dec 1991 - first release to usenet 7;; Created: Dec 1991 - first release to usenet
8;; Version: $Id: allout.el,v 1.46 2004/03/01 22:44:04 lektu Exp $|| 8;; Version: $Id: allout.el,v 1.47 2004/03/21 15:21:38 lektu Exp $||
9;; Keywords: outlines mode wp languages 9;; Keywords: outlines mode wp languages
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
@@ -508,7 +508,7 @@ behavior."
508;;;_ : Version 508;;;_ : Version
509;;;_ = allout-version 509;;;_ = allout-version
510(defvar allout-version 510(defvar allout-version
511 (let ((rcs-rev "$Revision: 1.46 $")) 511 (let ((rcs-rev "$Revision: 1.47 $"))
512 (condition-case err 512 (condition-case err
513 (save-match-data 513 (save-match-data
514 (string-match "Revision: \\([0-9]+\\.[0-9]+\\)" rcs-rev) 514 (string-match "Revision: \\([0-9]+\\.[0-9]+\\)" rcs-rev)
@@ -1049,7 +1049,7 @@ and many other features.
1049Below is a description of the bindings, and then explanation of 1049Below is a description of the bindings, and then explanation of
1050special `allout-mode' features and terminology. See also the outline 1050special `allout-mode' features and terminology. See also the outline
1051menubar additions for quick reference to many of the features, and see 1051menubar additions for quick reference to many of the features, and see
1052the docstring of the variable `allout-init' for instructions on 1052the docstring of the function `allout-init' for instructions on
1053priming your emacs session for automatic activation of `allout-mode'. 1053priming your emacs session for automatic activation of `allout-mode'.
1054 1054
1055 1055
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index b1f0d7b7bfa..efae885de60 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -103,13 +103,27 @@ Global Auto-Revert Mode applies to all buffers."
103Never set this variable directly, use the command `auto-revert-mode' instead.") 103Never set this variable directly, use the command `auto-revert-mode' instead.")
104(put 'auto-revert-mode 'permanent-local t) 104(put 'auto-revert-mode 'permanent-local t)
105 105
106(defvar auto-revert-timer nil
107 "Timer used by Auto-Revert Mode.")
108
106(defcustom auto-revert-interval 5 109(defcustom auto-revert-interval 5
107 "Time, in seconds, between Auto-Revert Mode file checks. 110 "Time, in seconds, between Auto-Revert Mode file checks.
108Setting this variable has no effect on buffers that are already in 111The value may be an integer or floating point number.
109auto-revert-mode; it only affects buffers that are put into 112
110auto-revert-mode afterwards." 113If a timer is already active, there are two ways to make sure
114that the new value will take effect immediately. You can set
115this variable through Custom or you can call the command
116`auto-revert-set-timer' after setting the variable. Otherwise,
117the new value will take effect the first time Auto Revert Mode
118calls `auto-revert-set-timer' for internal reasons or in your
119next editing session."
111 :group 'auto-revert 120 :group 'auto-revert
112 :type 'integer) 121 :type 'number
122 :set (lambda (variable value)
123 (set-default variable value)
124 (and (boundp 'auto-revert-timer)
125 auto-revert-timer
126 (auto-revert-set-timer))))
113 127
114(defcustom auto-revert-stop-on-user-input t 128(defcustom auto-revert-stop-on-user-input t
115 "When non-nil Auto-Revert Mode stops checking files on user input." 129 "When non-nil Auto-Revert Mode stops checking files on user input."
@@ -158,7 +172,12 @@ would only waste precious space."
158When non-nil, both file buffers and buffers with a custom 172When non-nil, both file buffers and buffers with a custom
159`revert-buffer-function' are reverted by Global Auto-Revert Mode. 173`revert-buffer-function' are reverted by Global Auto-Revert Mode.
160 174
161Use this option with care since it could lead to excessive reverts." 175Use this option with care since it could lead to excessive reverts.
176Note also that for some non-file buffers the check whether the
177buffer needs updating may be imperfect, due to efficiency
178considerations, and may not take all information listed in the
179buffer into account. Hence, a non-nil value for this option does
180not necessarily make manual updates useless for non-file buffers."
162 :group 'auto-revert 181 :group 'auto-revert
163 :type 'boolean) 182 :type 'boolean)
164 183
@@ -179,6 +198,18 @@ Use this option with care since it could lead to excessive reverts."
179This variable becomes buffer local when set in any fashion.") 198This variable becomes buffer local when set in any fashion.")
180(make-variable-buffer-local 'global-auto-revert-ignore-buffer) 199(make-variable-buffer-local 'global-auto-revert-ignore-buffer)
181 200
201(defvar buffer-stale-function nil
202 "Function to check whether a non-file buffer needs reverting.
203This should be a function with one optional argument NOCONFIRM.
204Auto Revert Mode sets NOCONFIRM to t. The function should return
205non-nil if the buffer should be reverted. The buffer is current
206when this function is called.
207
208The idea behind the NOCONFIRM argument is that the same function
209can also be used to ask the user whether the buffer should be
210reverted. In such a situation one has to be less careful about,
211say, reverting remote files, than if the function is called at
212regular intervals by Auto Revert Mode.")
182 213
183;; Internal variables: 214;; Internal variables:
184 215
@@ -191,9 +222,6 @@ buffers to this list.
191The timer function `auto-revert-buffers' is responsible for purging 222The timer function `auto-revert-buffers' is responsible for purging
192the list of old buffers.") 223the list of old buffers.")
193 224
194(defvar auto-revert-timer nil
195 "Timer used by Auto-Revert Mode.")
196
197(defvar auto-revert-remaining-buffers '() 225(defvar auto-revert-remaining-buffers '()
198 "Buffers not checked when user input stopped execution.") 226 "Buffers not checked when user input stopped execution.")
199 227
@@ -242,6 +270,7 @@ Use `auto-revert-mode' to revert a particular buffer."
242 270
243(defun auto-revert-set-timer () 271(defun auto-revert-set-timer ()
244 "Restart or cancel the timer." 272 "Restart or cancel the timer."
273 (interactive)
245 (if (timerp auto-revert-timer) 274 (if (timerp auto-revert-timer)
246 (cancel-timer auto-revert-timer)) 275 (cancel-timer auto-revert-timer))
247 (setq auto-revert-timer 276 (setq auto-revert-timer
@@ -260,61 +289,6 @@ Use `auto-revert-mode' to revert a particular buffer."
260 (not (memq major-mode 289 (not (memq major-mode
261 global-auto-revert-ignore-modes))))) 290 global-auto-revert-ignore-modes)))))
262 291
263(defun auto-revert-list-diff (a b)
264 "Check if strings in list A differ from list B."
265 (when (and a b)
266 (setq a (sort a 'string-lessp))
267 (setq b (sort b 'string-lessp))
268 (let (elt1 elt2)
269 (catch 'break
270 (while (and (setq elt1 (and a (pop a)))
271 (setq elt2 (and b (pop b))))
272 (if (not (string= elt1 elt2))
273 (throw 'break t)))))))
274
275(defun auto-revert-dired-file-list ()
276 "Return list of dired files."
277 (let (file list)
278 (save-excursion
279 (goto-char (point-min))
280 (while (not (eobp))
281 (if (setq file (dired-get-filename t t))
282 (push file list))
283 (forward-line 1)))
284 list))
285
286(defun auto-revert-dired-changed-p ()
287 "Check if dired buffer has changed."
288 (when (and (stringp dired-directory)
289 ;; Exclude remote buffers, would be too slow for user
290 ;; modem, timeouts, network lag ... all is possible
291 (not (string-match "@" dired-directory))
292 (file-directory-p dired-directory))
293 (let ((files (directory-files dired-directory))
294 (dired (auto-revert-dired-file-list)))
295 (or (not (eq (length files) (length dired)))
296 (auto-revert-list-diff files dired)))))
297
298(defun auto-revert-buffer-p ()
299 "Check if current buffer should be reverted."
300 ;; - Always include dired buffers to list. It would be too expensive
301 ;; to test the "revert" status here each time timer launches.
302 ;; - Same for VC buffers.
303 (or (and (eq major-mode 'dired-mode)
304 (or (and global-auto-revert-mode
305 global-auto-revert-non-file-buffers)
306 auto-revert-mode))
307 (and (not (buffer-modified-p))
308 (auto-revert-vc-buffer-p))
309 (and (not (buffer-modified-p))
310 (if (buffer-file-name)
311 (and (file-readable-p (buffer-file-name))
312 (not (verify-visited-file-modtime (current-buffer))))
313 (and revert-buffer-function
314 (or (and global-auto-revert-mode
315 global-auto-revert-non-file-buffers)
316 auto-revert-mode))))))
317
318(defun auto-revert-vc-cvs-file-version (file) 292(defun auto-revert-vc-cvs-file-version (file)
319 "Get version of FILE by reading control file on disk." 293 "Get version of FILE by reading control file on disk."
320 (let* ((control "CVS/Entries") 294 (let* ((control "CVS/Entries")
@@ -371,25 +345,27 @@ Use `auto-revert-mode' to revert a particular buffer."
371 345
372(defun auto-revert-handler () 346(defun auto-revert-handler ()
373 "Revert current buffer." 347 "Revert current buffer."
374 (let (revert) 348 (unless (buffer-modified-p)
375 (cond 349 (let (revert)
376 ((eq major-mode 'dired-mode) 350 (cond
377 ;; Dired includes revert-buffer-function 351 ((auto-revert-vc-buffer-p)
378 (when (and revert-buffer-function 352 (when (auto-revert-handler-vc)
379 (auto-revert-dired-changed-p)) 353 (setq revert 'vc)))
354 ((or (and (buffer-file-name)
355 (file-readable-p (buffer-file-name))
356 (not (verify-visited-file-modtime (current-buffer))))
357 (and global-auto-revert-non-file-buffers
358 revert-buffer-function
359 (boundp 'buffer-stale-function)
360 (functionp buffer-stale-function)
361 (funcall buffer-stale-function t)))
380 (setq revert t))) 362 (setq revert t)))
381 ((auto-revert-vc-buffer-p) 363 (when revert
382 (when (auto-revert-handler-vc) 364 (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes)
383 (setq revert 'vc))) 365 (if (eq revert 'vc)
384 ((or (buffer-file-name) 366 (vc-mode-line buffer-file-name))
385 revert-buffer-function) 367 (if auto-revert-verbose
386 (setq revert t))) 368 (message "Reverting buffer `%s'." (buffer-name)))))))
387 (when revert
388 (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes)
389 (if (eq revert 'vc)
390 (vc-mode-line buffer-file-name))
391 (if auto-revert-verbose
392 (message "Reverting buffer `%s'." (buffer-name))))))
393 369
394(defun auto-revert-buffers () 370(defun auto-revert-buffers ()
395 "Revert buffers as specified by Auto-Revert and Global Auto-Revert Mode. 371 "Revert buffers as specified by Auto-Revert and Global Auto-Revert Mode.
@@ -441,8 +417,7 @@ the timer when no buffers need to be checked."
441 (memq buf auto-revert-buffer-list)) 417 (memq buf auto-revert-buffer-list))
442 (setq auto-revert-buffer-list 418 (setq auto-revert-buffer-list
443 (delq buf auto-revert-buffer-list))) 419 (delq buf auto-revert-buffer-list)))
444 (when (and (auto-revert-active-p) 420 (when (auto-revert-active-p)
445 (auto-revert-buffer-p))
446 (auto-revert-handler) 421 (auto-revert-handler)
447 ;; `preserve-modes' avoids changing the (minor) modes. But we 422 ;; `preserve-modes' avoids changing the (minor) modes. But we
448 ;; do want to reset the mode for VC, so we do it explicitly. 423 ;; do want to reset the mode for VC, so we do it explicitly.
diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el
index d002b6fd212..002aec878ca 100644
--- a/lisp/calendar/appt.el
+++ b/lisp/calendar/appt.el
@@ -325,19 +325,33 @@ displayed in a window:
325 ;; At the first check in any given day, update our 325 ;; At the first check in any given day, update our
326 ;; appointments to today's list. 326 ;; appointments to today's list.
327 327
328 (if (or force 328 (if (or force ; eg initialize, diary save
329 (null appt-prev-comp-time) ; first check 329 (null appt-prev-comp-time) ; first check
330 (< cur-comp-time appt-prev-comp-time)) ; new day 330 (< cur-comp-time appt-prev-comp-time)) ; new day
331 (condition-case nil 331 (condition-case nil
332 (progn 332 (if appt-display-diary
333 (if appt-display-diary 333 (let ((diary-hook
334 (let ((diary-hook 334 (if (assoc 'appt-make-list diary-hook)
335 (if (assoc 'appt-make-list diary-hook) 335 diary-hook
336 diary-hook 336 (cons 'appt-make-list diary-hook))))
337 (cons 'appt-make-list diary-hook)))) 337 (diary))
338 (diary)) 338 (let ((diary-display-hook 'appt-make-list)
339 (let ((diary-display-hook 'appt-make-list)) 339 (d-buff (find-buffer-visiting
340 (diary)))) 340 (substitute-in-file-name diary-file)))
341 selective)
342 (if d-buff ; diary buffer exists
343 (with-current-buffer d-buff
344 (setq selective selective-display)))
345 (diary)
346 ;; If the diary buffer existed before this command,
347 ;; restore its display state. Otherwise, kill it.
348 (if d-buff
349 ;; Displays the diary buffer.
350 (or selective (show-all-diary-entries))
351 (and
352 (setq d-buff (find-buffer-visiting
353 (substitute-in-file-name diary-file)))
354 (kill-buffer d-buff)))))
341 (error nil))) 355 (error nil)))
342 356
343 (setq appt-prev-comp-time cur-comp-time 357 (setq appt-prev-comp-time cur-comp-time
@@ -637,7 +651,7 @@ hour and minute parts."
637(defun appt-update-list () 651(defun appt-update-list ()
638 "If the current buffer is visiting the diary, update appointments. 652 "If the current buffer is visiting the diary, update appointments.
639This function is intended for use with `write-file-functions'." 653This function is intended for use with `write-file-functions'."
640 (and (equal buffer-file-name (expand-file-name diary-file)) 654 (and (string-equal buffer-file-name (expand-file-name diary-file))
641 appt-timer 655 appt-timer
642 (let ((appt-display-diary nil)) 656 (let ((appt-display-diary nil))
643 (appt-check t))) 657 (appt-check t)))
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index c1277ca5132..0d38563e637 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -1915,6 +1915,7 @@ Or, for optional MON, YR."
1915 font-lock-mode) 1915 font-lock-mode)
1916 (font-lock-fontify-buffer)) 1916 (font-lock-fontify-buffer))
1917 (and mark-holidays-in-calendar 1917 (and mark-holidays-in-calendar
1918;;; (calendar-date-is-legal-p today) ; useful for BC dates
1918 (mark-calendar-holidays) 1919 (mark-calendar-holidays)
1919 (sit-for 0)) 1920 (sit-for 0))
1920 (unwind-protect 1921 (unwind-protect
@@ -2933,7 +2934,10 @@ Defaults to today's date if DATE is not given."
2933(defun calendar-set-mode-line (str) 2934(defun calendar-set-mode-line (str)
2934 "Set mode line to STR, centered, surrounded by dashes." 2935 "Set mode line to STR, centered, surrounded by dashes."
2935 (setq mode-line-format 2936 (setq mode-line-format
2936 (calendar-string-spread (list str) ?- (frame-width)))) 2937 (calendar-string-spread
2938 (list str) ?-
2939 ;; As per doc of window-width, total visible mode-line length.
2940 (let ((edges (window-edges))) (- (nth 2 edges) (nth 0 edges))))))
2937 2941
2938(defun calendar-mod (m n) 2942(defun calendar-mod (m n)
2939 "Non-negative remainder of M/N with N instead of 0." 2943 "Non-negative remainder of M/N with N instead of 0."
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index f4150ee0825..f79a217cc32 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -554,7 +554,6 @@ This function is provided for optional use as the `diary-display-hook'."
554 (message "%s" msg) 554 (message "%s" msg)
555 (set-buffer (get-buffer-create holiday-buffer)) 555 (set-buffer (get-buffer-create holiday-buffer))
556 (setq buffer-read-only nil) 556 (setq buffer-read-only nil)
557 (calendar-set-mode-line date-string)
558 (erase-buffer) 557 (erase-buffer)
559 (insert (mapconcat 'identity holiday-list "\n")) 558 (insert (mapconcat 'identity holiday-list "\n"))
560 (goto-char (point-min)) 559 (goto-char (point-min))
@@ -658,6 +657,7 @@ This function is provided for optional use as the `diary-display-hook'."
658 (setq buffer-read-only t) 657 (setq buffer-read-only t)
659 (display-buffer fancy-diary-buffer) 658 (display-buffer fancy-diary-buffer)
660 (fancy-diary-display-mode) 659 (fancy-diary-display-mode)
660 (calendar-set-mode-line date-string)
661 (message "Preparing diary...done")))) 661 (message "Preparing diary...done"))))
662 662
663(defun make-fancy-diary-buffer () 663(defun make-fancy-diary-buffer ()
diff --git a/lisp/composite.el b/lisp/composite.el
index fa69ac6ff83..8361e2ad9e3 100644
--- a/lisp/composite.el
+++ b/lisp/composite.el
@@ -193,7 +193,7 @@ text in the composition."
193 (if (or (vectorp components) (listp components)) 193 (if (or (vectorp components) (listp components))
194 (setq components (encode-composition-components components))) 194 (setq components (encode-composition-components components)))
195 (compose-region-internal start end components modification-func) 195 (compose-region-internal start end components modification-func)
196 (set-buffer-modified-p modified-p))) 196 (restore-buffer-modified-p modified-p)))
197 197
198;;;###autoload 198;;;###autoload
199(defun decompose-region (start end) 199(defun decompose-region (start end)
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 05452f359c0..abc0d588a14 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -1,6 +1,6 @@
1;;; descr-text.el --- describe text mode 1;;; descr-text.el --- describe text mode
2 2
3;; Copyright (c) 1994, 1995, 1996, 2001, 02, 03 Free Software Foundation, Inc. 3;; Copyright (c) 1994, 95, 96, 2001, 02, 03, 04 Free Software Foundation, Inc.
4 4
5;; Author: Boris Goldowsky <boris@gnu.org> 5;; Author: Boris Goldowsky <boris@gnu.org>
6;; Keywords: faces 6;; Keywords: faces
@@ -99,8 +99,8 @@ if that value is non-nil."
99(defun describe-property-list (properties) 99(defun describe-property-list (properties)
100 "Insert a description of PROPERTIES in the current buffer. 100 "Insert a description of PROPERTIES in the current buffer.
101PROPERTIES should be a list of overlay or text properties. 101PROPERTIES should be a list of overlay or text properties.
102The `category' property is made into a widget button that call 102The `category' and `face' properties are made into widget buttons
103`describe-text-category' when pushed." 103that call `describe-text-category' or `describe-face' when pushed."
104 ;; Sort the properties by the size of their value. 104 ;; Sort the properties by the size of their value.
105 (dolist (elt (sort (let ((ret nil) 105 (dolist (elt (sort (let ((ret nil)
106 (key nil) 106 (key nil)
@@ -110,7 +110,7 @@ The `category' property is made into a widget button that call
110 (setq key (pop properties) 110 (setq key (pop properties)
111 val (pop properties) 111 val (pop properties)
112 len 0) 112 len 0)
113 (unless (or (eq key 'category) 113 (unless (or (memq key '(category face))
114 (widgetp val)) 114 (widgetp val))
115 (setq val (pp-to-string val) 115 (setq val (pp-to-string val)
116 len (length val))) 116 len (length val)))
@@ -128,6 +128,11 @@ The `category' property is made into a widget button that call
128 :notify `(lambda (&rest ignore) 128 :notify `(lambda (&rest ignore)
129 (describe-text-category ',value)) 129 (describe-text-category ',value))
130 (format "%S" value))) 130 (format "%S" value)))
131 ((eq key 'face)
132 (widget-create 'link
133 :notify `(lambda (&rest ignore)
134 (describe-face ',value))
135 (format "%S" value)))
131 ((widgetp value) 136 ((widgetp value)
132 (describe-text-widget value)) 137 (describe-text-widget value))
133 (t 138 (t
@@ -338,7 +343,7 @@ otherwise."
338;;; (string-to-number (nth 2 fields)) 343;;; (string-to-number (nth 2 fields))
339;;; '((0 . "Spacing") 344;;; '((0 . "Spacing")
340;;; (1 . "Overlays and interior") 345;;; (1 . "Overlays and interior")
341;;; (7 . "Nuktas") 346;;; (7 . "Nuktas")
342;;; (8 . "Hiragana/Katakana voicing marks") 347;;; (8 . "Hiragana/Katakana voicing marks")
343;;; (9 . "Viramas") 348;;; (9 . "Viramas")
344;;; (10 . "Start of fixed position classes") 349;;; (10 . "Start of fixed position classes")
@@ -589,7 +594,7 @@ as well as widgets, buttons, overlays, and text properties."
589 (when (>= (+ (current-column) 594 (when (>= (+ (current-column)
590 (or (string-match "\n" clm) 595 (or (string-match "\n" clm)
591 (string-width clm)) 1) 596 (string-width clm)) 1)
592 (frame-width)) 597 (window-width))
593 (insert "\n") 598 (insert "\n")
594 (indent-to (1+ max-width))) 599 (indent-to (1+ max-width)))
595 (insert " " clm)) 600 (insert " " clm))
@@ -611,7 +616,7 @@ as well as widgets, buttons, overlays, and text properties."
611 "\n "))) 616 "\n ")))
612 (insert "these terminal codes:\n") 617 (insert "these terminal codes:\n")
613 (dotimes (i (length disp-vector)) 618 (dotimes (i (length disp-vector))
614 (insert (car (aref disp-vector i)) 619 (insert (car (aref disp-vector i))
615 (propertize " " 'display '(space :align-to 5)) 620 (propertize " " 'display '(space :align-to 5))
616 (or (cdr (aref disp-vector i)) "-- not encodable --") 621 (or (cdr (aref disp-vector i)) "-- not encodable --")
617 "\n")))) 622 "\n"))))
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index 14be2e841a3..180fefcdd72 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -38,20 +38,19 @@
38 38
39;; Todo: 39;; Todo:
40 40
41;; - Improve narrowed-view support. 41;; - Add a `delete-after-apply' so C-c C-a automatically deletes hunks.
42;; - re-enable (conditionally) the `compile' support after improving it to use 42;; Also allow C-c C-a to delete already-applied hunks.
43;; the same code as diff-goto-source. 43;;
44;; - Support for # comments in context->unified. 44;; - Try `diff <file> <hunk>' to try and fuzzily discover the source location
45;; - Allow diff.el to use diff-mode. 45;; of a hunk. Show then the changes between <file> and <hunk> and make it
46;; This mostly means ability to jump from half-hunk to half-hunk 46;; possible to apply them to <file>, <hunk-src>, or <hunk-dst>.
47;; in context (and normal) diffs and to jump to the corresponding 47;; Or maybe just make it into a ".rej to diff3-markers converter".
48;; (i.e. new or old) file. 48;;
49;; - Refine hunk on a word-by-word basis.
50;;
51;; - Use the new next-error-function to allow C-x `.
49;; - Handle `diff -b' output in context->unified. 52;; - Handle `diff -b' output in context->unified.
50 53
51;; Low priority:
52;; - Spice up the minor-mode with font-lock support.
53;; - Recognize pcl-cvs' special string for `cvs-execute-single'.
54
55;;; Code: 54;;; Code:
56 55
57(eval-when-compile (require 'cl)) 56(eval-when-compile (require 'cl))
@@ -63,7 +62,7 @@
63 :group 'tools 62 :group 'tools
64 :group 'diff) 63 :group 'diff)
65 64
66(defcustom diff-default-read-only t 65(defcustom diff-default-read-only nil
67 "If non-nil, `diff-mode' buffers default to being read-only." 66 "If non-nil, `diff-mode' buffers default to being read-only."
68 :type 'boolean 67 :type 'boolean
69 :group 'diff-mode) 68 :group 'diff-mode)
@@ -87,8 +86,10 @@ when editing big diffs)."
87 :type 'boolean) 86 :type 'boolean)
88 87
89 88
90(defvar diff-mode-hook nil 89(defcustom diff-mode-hook nil
91 "Run after setting up the `diff-mode' major mode.") 90 "Run after setting up the `diff-mode' major mode."
91 :type 'hook
92 :options '(diff-delete-empty-files diff-make-unified))
92 93
93(defvar diff-outline-regexp 94(defvar diff-outline-regexp
94 "\\([*+][*+][*+] [^0-9]\\|@@ ...\\|\\*\\*\\* [0-9].\\|--- [0-9]..\\)") 95 "\\([*+][*+][*+] [^0-9]\\|@@ ...\\|\\*\\*\\* [0-9].\\|--- [0-9]..\\)")
@@ -136,6 +137,7 @@ when editing big diffs)."
136 ;; From compilation-minor-mode. 137 ;; From compilation-minor-mode.
137 ("\C-c\C-c" . diff-goto-source) 138 ("\C-c\C-c" . diff-goto-source)
138 ;; Misc operations. 139 ;; Misc operations.
140 ("\C-c\C-r" . diff-refine-hunk)
139 ("\C-c\C-s" . diff-split-hunk) 141 ("\C-c\C-s" . diff-split-hunk)
140 ("\C-c\C-a" . diff-apply-hunk) 142 ("\C-c\C-a" . diff-apply-hunk)
141 ("\C-c\C-t" . diff-test-hunk)) 143 ("\C-c\C-t" . diff-test-hunk))
@@ -241,8 +243,31 @@ when editing big diffs)."
241 "`diff-mode' face used to highlight nonexistent files in recursive diffs.") 243 "`diff-mode' face used to highlight nonexistent files in recursive diffs.")
242(defvar diff-nonexistent-face 'diff-nonexistent-face) 244(defvar diff-nonexistent-face 'diff-nonexistent-face)
243 245
246(defconst diff-yank-handler '(diff-yank-function))
247(defun diff-yank-function (text)
248 ;; FIXME: the yank-handler is now called separately on each piece of text
249 ;; with a yank-handler property, so the next-single-property-change call
250 ;; below will always return nil :-( --stef
251 (let ((mixed (next-single-property-change 0 'yank-handler text))
252 (start (point)))
253 ;; First insert the text.
254 (insert text)
255 ;; If the text does not include any diff markers and if we're not
256 ;; yanking back into a diff-mode buffer, get rid of the prefixes.
257 (unless (or mixed (derived-mode-p 'diff-mode))
258 (undo-boundary) ; Just in case the user wanted the prefixes.
259 (let ((re (save-excursion
260 (if (re-search-backward "^[><!][ \t]" start t)
261 (if (eq (char-after) ?!)
262 "^[!+- ][ \t]" "^[<>][ \t]")
263 "^[ <>!+-]"))))
264 (save-excursion
265 (while (re-search-backward re start t)
266 (replace-match "" t t)))))))
267
268
244(defvar diff-font-lock-keywords 269(defvar diff-font-lock-keywords
245 '(("^\\(@@ -[0-9,]+ \\+[0-9,]+ @@\\)\\(.*\\)$" ;unified 270 `(("^\\(@@ -[0-9,]+ \\+[0-9,]+ @@\\)\\(.*\\)$" ;unified
246 (1 diff-hunk-header-face) 271 (1 diff-hunk-header-face)
247 (2 diff-function-face)) 272 (2 diff-function-face))
248 ("^--- .+ ----$" . diff-hunk-header-face) ;context 273 ("^--- .+ ----$" . diff-hunk-header-face) ;context
@@ -253,13 +278,13 @@ when editing big diffs)."
253 ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\(\\S-+\\)\\(.*[^*-]\\)?\n" 278 ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\(\\S-+\\)\\(.*[^*-]\\)?\n"
254 (0 diff-header-face) (2 diff-file-header-face prepend)) 279 (0 diff-header-face) (2 diff-file-header-face prepend))
255 ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face) 280 ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face)
256 ("^!.*\n" . diff-changed-face) ;context 281 ("^!.*\n" (0 diff-changed-face))
257 ("^[+>].*\n" . diff-added-face) 282 ("^[+>].*\n" (0 diff-added-face))
258 ("^[-<].*\n" . diff-removed-face) 283 ("^[-<].*\n" (0 diff-removed-face))
259 ("^Index: \\(.+\\).*\n" (0 diff-header-face) (1 diff-index-face prepend)) 284 ("^Index: \\(.+\\).*\n" (0 diff-header-face) (1 diff-index-face prepend))
260 ("^Only in .*\n" . diff-nonexistent-face) 285 ("^Only in .*\n" . diff-nonexistent-face)
261 ("^#.*" . font-lock-string-face) 286 ("^#.*" . font-lock-string-face)
262 ("^[^-=+*!<>].*\n" . diff-context-face))) 287 ("^[^-=+*!<>].*\n" (0 diff-context-face))))
263 288
264(defconst diff-font-lock-defaults 289(defconst diff-font-lock-defaults
265 '(diff-font-lock-keywords t nil nil nil (font-lock-multiline . nil))) 290 '(diff-font-lock-keywords t nil nil nil (font-lock-multiline . nil)))
@@ -311,8 +336,11 @@ when editing big diffs)."
311 336
312(defun diff-end-of-file () 337(defun diff-end-of-file ()
313 (re-search-forward "^[-+#!<>0-9@* \\]" nil t) 338 (re-search-forward "^[-+#!<>0-9@* \\]" nil t)
314 (re-search-forward "^[^-+#!<>0-9@* \\]" nil 'move) 339 (re-search-forward (concat "^[^-+#!<>0-9@* \\]\\|" diff-file-header-re)
315 (beginning-of-line)) 340 nil 'move)
341 (if (match-beginning 1)
342 (goto-char (match-beginning 1))
343 (beginning-of-line)))
316 344
317;; Define diff-{hunk,file}-{prev,next} 345;; Define diff-{hunk,file}-{prev,next}
318(easy-mmode-define-navigation 346(easy-mmode-define-navigation
@@ -337,7 +365,8 @@ If the prefix ARG is given, restrict the view to the current file instead."
337 (interactive) 365 (interactive)
338 (diff-beginning-of-hunk) 366 (diff-beginning-of-hunk)
339 (let* ((start (point)) 367 (let* ((start (point))
340 (nexthunk (ignore-errors (diff-hunk-next) (point))) 368 (nexthunk (when (re-search-forward diff-hunk-header-re nil t)
369 (match-beginning 0)))
341 (firsthunk (ignore-errors 370 (firsthunk (ignore-errors
342 (goto-char start) 371 (goto-char start)
343 (diff-beginning-of-file) (diff-hunk-next) (point))) 372 (diff-beginning-of-file) (diff-hunk-next) (point)))
@@ -363,6 +392,7 @@ If the prefix ARG is given, restrict the view to the current file instead."
363 (re-search-backward "^Index: " prevhunk t)))) 392 (re-search-backward "^Index: " prevhunk t))))
364 (when index (setq start index)) 393 (when index (setq start index))
365 (diff-end-of-file) 394 (diff-end-of-file)
395 (if (looking-at "^\n") (forward-char 1)) ;`tla' generates such diffs.
366 (kill-region start (point)))) 396 (kill-region start (point))))
367 397
368(defun diff-kill-junk () 398(defun diff-kill-junk ()
@@ -439,31 +469,55 @@ like \(diff-merge-strings \"b/foo\" \"b/bar\" \"/a/c/foo\")."
439 (match-string 4 str) 469 (match-string 4 str)
440 (substring str (match-end 6) (match-end 5)))))) 470 (substring str (match-end 6) (match-end 5))))))
441 471
442(defun diff-find-file-name (&optional old) 472(defun diff-tell-file-name (old name)
443 "Return the file corresponding to the current patch. 473 "Tell Emacs where the find the source file of the current hunk.
444Non-nil OLD means that we want the old file." 474If the OLD prefix arg is passed, tell the file NAME of the old file."
475 (interactive
476 (let* ((old current-prefix-arg)
477 (fs (diff-hunk-file-names current-prefix-arg)))
478 (unless fs (error "No file name to look for"))
479 (list old (read-file-name (format "File for %s: " (car fs))
480 nil (diff-find-file-name old) t))))
481 (let ((fs (diff-hunk-file-names old)))
482 (unless fs (error "No file name to look for"))
483 (push (cons fs name) diff-remembered-files-alist)))
484
485(defun diff-hunk-file-names (&optional old)
486 "Give the list of file names textually mentioned for the current hunk."
445 (save-excursion 487 (save-excursion
446 (unless (looking-at diff-file-header-re) 488 (unless (looking-at diff-file-header-re)
447 (or (ignore-errors (diff-beginning-of-file)) 489 (or (ignore-errors (diff-beginning-of-file))
448 (re-search-forward diff-file-header-re nil t))) 490 (re-search-forward diff-file-header-re nil t)))
449 (let* ((limit (save-excursion 491 (let ((limit (save-excursion
450 (condition-case () 492 (condition-case ()
451 (progn (diff-hunk-prev) (point)) 493 (progn (diff-hunk-prev) (point))
452 (error (point-min))))) 494 (error (point-min)))))
453 (header-files 495 (header-files
454 (if (looking-at "[-*][-*][-*] \\(\\S-+\\)\\(\\s-.*\\)?\n[-+][-+][-+] \\(\\S-+\\)") 496 (if (looking-at "[-*][-*][-*] \\(\\S-+\\)\\(\\s-.*\\)?\n[-+][-+][-+] \\(\\S-+\\)")
455 (list (if old (match-string 1) (match-string 3)) 497 (list (if old (match-string 1) (match-string 3))
456 (if old (match-string 3) (match-string 1))) 498 (if old (match-string 3) (match-string 1)))
457 (forward-line 1) nil)) 499 (forward-line 1) nil)))
458 (fs (append 500 (delq nil
459 (when (save-excursion 501 (append
460 (re-search-backward "^Index: \\(.+\\)" limit t)) 502 (when (and (not old)
461 (list (match-string 1))) 503 (save-excursion
462 header-files 504 (re-search-backward "^Index: \\(.+\\)" limit t)))
463 (when (re-search-backward "^diff \\(-\\S-+ +\\)*\\(\\S-+\\)\\( +\\(\\S-+\\)\\)?" nil t) 505 (list (match-string 1)))
464 (list (if old (match-string 2) (match-string 4)) 506 header-files
465 (if old (match-string 4) (match-string 2)))))) 507 (when (re-search-backward
466 (fs (delq nil fs))) 508 "^diff \\(-\\S-+ +\\)*\\(\\S-+\\)\\( +\\(\\S-+\\)\\)?"
509 nil t)
510 (list (if old (match-string 2) (match-string 4))
511 (if old (match-string 4) (match-string 2)))))))))
512
513(defun diff-find-file-name (&optional old)
514 "Return the file corresponding to the current patch.
515Non-nil OLD means that we want the old file."
516 (save-excursion
517 (unless (looking-at diff-file-header-re)
518 (or (ignore-errors (diff-beginning-of-file))
519 (re-search-forward diff-file-header-re nil t)))
520 (let ((fs (diff-hunk-file-names old)))
467 (or 521 (or
468 ;; use any previously used preference 522 ;; use any previously used preference
469 (cdr (assoc fs diff-remembered-files-alist)) 523 (cdr (assoc fs diff-remembered-files-alist))
@@ -876,8 +930,14 @@ a diff with \\[diff-reverse-direction]."
876 (add-hook 'after-change-functions 'diff-after-change-function nil t) 930 (add-hook 'after-change-functions 'diff-after-change-function nil t)
877 (add-hook 'post-command-hook 'diff-post-command-hook nil t)) 931 (add-hook 'post-command-hook 'diff-post-command-hook nil t))
878 ;; Neat trick from Dave Love to add more bindings in read-only mode: 932 ;; Neat trick from Dave Love to add more bindings in read-only mode:
879 (add-to-list 'minor-mode-overriding-map-alist 933 (let ((ro-bind (cons 'buffer-read-only diff-mode-shared-map)))
880 (cons 'buffer-read-only diff-mode-shared-map)) 934 (add-to-list 'minor-mode-overriding-map-alist ro-bind)
935 ;; Turn off this little trick in case the buffer is put in view-mode.
936 (add-hook 'view-mode-hook
937 `(lambda ()
938 (setq minor-mode-overriding-map-alist
939 (delq ,ro-bind minor-mode-overriding-map-alist)))
940 nil t))
881 ;; add-log support 941 ;; add-log support
882 (set (make-local-variable 'add-log-current-defun-function) 942 (set (make-local-variable 'add-log-current-defun-function)
883 'diff-current-defun) 943 'diff-current-defun)
@@ -897,6 +957,29 @@ a diff with \\[diff-reverse-direction]."
897 (add-hook 'after-change-functions 'diff-after-change-function nil t) 957 (add-hook 'after-change-functions 'diff-after-change-function nil t)
898 (add-hook 'post-command-hook 'diff-post-command-hook nil t))) 958 (add-hook 'post-command-hook 'diff-post-command-hook nil t)))
899 959
960;;; Handy hook functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
961
962(defun diff-delete-if-empty ()
963 ;; An empty diff file means there's no more diffs to integrate, so we
964 ;; can just remove the file altogether. Very handy for .rej files if we
965 ;; remove hunks as we apply them.
966 (when (and buffer-file-name
967 (eq 0 (nth 7 (file-attributes buffer-file-name))))
968 (delete-file buffer-file-name)))
969
970(defun diff-delete-empty-files ()
971 "Arrange for empty diff files to be removed."
972 (add-hook 'after-save-hook 'diff-delete-if-empty nil t))
973
974(defun diff-make-unified ()
975 "Turn context diffs into unified diffs if applicable."
976 (if (save-excursion
977 (goto-char (point-min))
978 (looking-at "\\*\\*\\* "))
979 (let ((mod (buffer-modified-p)))
980 (unwind-protect
981 (diff-context->unified (point-min) (point-max))
982 (restore-buffer-modified-p mod)))))
900 983
901;;; 984;;;
902;;; Misc operations that have proved useful at some point. 985;;; Misc operations that have proved useful at some point.
@@ -1060,12 +1143,17 @@ SWITCHED is non-nil if the patch is already applied."
1060 (goto-line (string-to-number line)) 1143 (goto-line (string-to-number line))
1061 (let* ((orig-pos (point)) 1144 (let* ((orig-pos (point))
1062 (switched nil) 1145 (switched nil)
1146 ;; FIXME: Check for case where both OLD and NEW are found.
1063 (pos (or (diff-find-text (car old)) 1147 (pos (or (diff-find-text (car old))
1064 (progn (setq switched t) (diff-find-text (car new))) 1148 (progn (setq switched t) (diff-find-text (car new)))
1065 (progn (setq switched nil) 1149 (progn (setq switched nil)
1066 (diff-find-approx-text (car old))) 1150 (condition-case nil
1151 (diff-find-approx-text (car old))
1152 (invalid-regexp nil))) ;Regex too big.
1067 (progn (setq switched t) 1153 (progn (setq switched t)
1068 (diff-find-approx-text (car new))) 1154 (condition-case nil
1155 (diff-find-approx-text (car new))
1156 (invalid-regexp nil))) ;Regex too big.
1069 (progn (setq switched nil) nil)))) 1157 (progn (setq switched nil) nil))))
1070 (nconc 1158 (nconc
1071 (list buf) 1159 (list buf)
@@ -1096,7 +1184,8 @@ the value of this variable when given an appropriate prefix argument).
1096With a prefix argument, REVERSE the hunk." 1184With a prefix argument, REVERSE the hunk."
1097 (interactive "P") 1185 (interactive "P")
1098 (destructuring-bind (buf line-offset pos old new &optional switched) 1186 (destructuring-bind (buf line-offset pos old new &optional switched)
1099 (diff-find-source-location nil reverse) 1187 ;; If REVERSE go to the new file, otherwise go to the old.
1188 (diff-find-source-location (not reverse) reverse)
1100 (cond 1189 (cond
1101 ((null line-offset) 1190 ((null line-offset)
1102 (error "Can't find the text to patch")) 1191 (error "Can't find the text to patch"))
@@ -1128,7 +1217,8 @@ With a prefix argument, REVERSE the hunk."
1128With a prefix argument, try to REVERSE the hunk." 1217With a prefix argument, try to REVERSE the hunk."
1129 (interactive "P") 1218 (interactive "P")
1130 (destructuring-bind (buf line-offset pos src dst &optional switched) 1219 (destructuring-bind (buf line-offset pos src dst &optional switched)
1131 (diff-find-source-location nil reverse) 1220 ;; If REVERSE go to the new file, otherwise go to the old.
1221 (diff-find-source-location (not reverse) reverse)
1132 (set-window-point (display-buffer buf) (+ (car pos) (cdr src))) 1222 (set-window-point (display-buffer buf) (+ (car pos) (cdr src)))
1133 (diff-hunk-status-msg line-offset (diff-xor reverse switched) t))) 1223 (diff-hunk-status-msg line-offset (diff-xor reverse switched) t)))
1134 1224
@@ -1173,6 +1263,49 @@ For use in `add-log-current-defun-function'."
1173 (goto-char (+ (car pos) (cdr src))) 1263 (goto-char (+ (car pos) (cdr src)))
1174 (add-log-current-defun)))))) 1264 (add-log-current-defun))))))
1175 1265
1266(defun diff-refine-hunk ()
1267 "Refine the current hunk by ignoring space differences."
1268 (interactive)
1269 (let* ((char-offset (- (point) (progn (diff-beginning-of-hunk) (point))))
1270 (opts (case (char-after) (?@ "-bu") (?* "-bc") (t "-b")))
1271 (line-nb (and (or (looking-at "[^0-9]+\\([0-9]+\\)")
1272 (error "Can't find line number"))
1273 (string-to-number (match-string 1))))
1274 (hunk (delete-and-extract-region
1275 (point) (save-excursion (diff-end-of-hunk) (point))))
1276 (lead (make-string (1- line-nb) ?\n)) ;Line nums start at 1.
1277 (file1 (make-temp-file "diff1"))
1278 (file2 (make-temp-file "diff2"))
1279 (coding-system-for-read buffer-file-coding-system)
1280 old new)
1281 (unwind-protect
1282 (save-excursion
1283 (setq old (diff-hunk-text hunk nil char-offset))
1284 (setq new (diff-hunk-text hunk t char-offset))
1285 (write-region (concat lead (car old)) nil file1 nil 'nomessage)
1286 (write-region (concat lead (car new)) nil file2 nil 'nomessage)
1287 (with-temp-buffer
1288 (let ((status
1289 (call-process diff-command nil t nil
1290 opts file1 file2)))
1291 (case status
1292 (0 nil) ;Nothing to reformat.
1293 (1 (goto-char (point-min))
1294 ;; Remove the file-header.
1295 (when (re-search-forward diff-hunk-header-re nil t)
1296 (delete-region (point-min) (match-beginning 0))))
1297 (t (goto-char (point-max))
1298 (unless (bolp) (insert "\n"))
1299 (insert hunk)))
1300 (setq hunk (buffer-string))
1301 (unless (memq status '(0 1))
1302 (error "Diff returned: %s" status)))))
1303 ;; Whatever happens, put back some equivalent text: either the new
1304 ;; one or the original one in case some error happened.
1305 (insert hunk)
1306 (delete-file file1)
1307 (delete-file file2))))
1308
1176;; provide the package 1309;; provide the package
1177(provide 'diff-mode) 1310(provide 'diff-mode)
1178 1311
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index fe8e33cfd48..1fc8e0e805a 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -93,6 +93,8 @@ With prefix arg, prompt for argument SWITCHES which is options for `diff'."
93Compare file attributes of files in the current directory 93Compare file attributes of files in the current directory
94with file attributes in directory DIR2 using PREDICATE on pairs of files 94with file attributes in directory DIR2 using PREDICATE on pairs of files
95with the same name. Mark files for which PREDICATE returns non-nil. 95with the same name. Mark files for which PREDICATE returns non-nil.
96Mark files with different names if PREDICATE is nil (or interactively
97when the user enters empty input at the predicate prompt).
96 98
97PREDICATE is a Lisp expression that can refer to the following variables: 99PREDICATE is a Lisp expression that can refer to the following variables:
98 100
@@ -115,7 +117,7 @@ Examples of PREDICATE:
115 (list (read-file-name (format "Compare %s with: " 117 (list (read-file-name (format "Compare %s with: "
116 (dired-current-directory)) 118 (dired-current-directory))
117 (dired-dwim-target-directory)) 119 (dired-dwim-target-directory))
118 (read-minibuffer "Mark if (lisp expr): "))) 120 (read-from-minibuffer "Mark if (lisp expr or RET): " nil nil t nil "nil")))
119 (let* ((dir1 (dired-current-directory)) 121 (let* ((dir1 (dired-current-directory))
120 (file-alist1 (dired-files-attributes dir1)) 122 (file-alist1 (dired-files-attributes dir1))
121 (file-alist2 (dired-files-attributes dir2)) 123 (file-alist2 (dired-files-attributes dir2))
@@ -659,6 +661,8 @@ and use this command with a prefix argument (the value does not matter)."
659 ;; For .z, try gunzip. It might be an old gzip file, 661 ;; For .z, try gunzip. It might be an old gzip file,
660 ;; or it might be from compact? pack? (which?) but gunzip handles both. 662 ;; or it might be from compact? pack? (which?) but gunzip handles both.
661 ("\\.z\\'" "" "gunzip") 663 ("\\.z\\'" "" "gunzip")
664 ("\\.dz\\'" "" "dictunzip")
665 ("\\.tbz\\'" ".tar" "bunzip2")
662 ("\\.bz2\\'" "" "bunzip2") 666 ("\\.bz2\\'" "" "bunzip2")
663 ;; This item controls naming for compression. 667 ;; This item controls naming for compression.
664 ("\\.tar\\'" ".tgz" nil)) 668 ("\\.tar\\'" ".tgz" nil))
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 3e645cb8a8b..fc30428e562 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -7,7 +7,7 @@
7;; Date: 1994/08/18 19:27:42 7;; Date: 1994/08/18 19:27:42
8;; Keywords: dired extensions files 8;; Keywords: dired extensions files
9 9
10;; Copyright (C) 1993, 1994, 1997, 2001, 2003 Free Software Foundation, Inc. 10;; Copyright (C) 1993, 1994, 1997, 2001, 2003, 2004 Free Software Foundation, Inc.
11 11
12;; This file is part of GNU Emacs. 12;; This file is part of GNU Emacs.
13 13
@@ -887,9 +887,17 @@ dired."
887 887
888(defvar dired-guess-shell-alist-default 888(defvar dired-guess-shell-alist-default
889 (list 889 (list
890 (list "\\.tar$" '(if dired-guess-shell-gnutar 890 (list "\\.tar$"
891 (concat dired-guess-shell-gnutar " xvf") 891 '(if dired-guess-shell-gnutar
892 "tar xvf")) 892 (concat dired-guess-shell-gnutar " xvf")
893 "tar xvf")
894 ;; Extract files into a separate subdirectory
895 '(if dired-guess-shell-gnutar
896 (concat "mkdir " (file-name-sans-extension file)
897 "; " dired-guess-shell-gnutar " -C "
898 (file-name-sans-extension file) " -xvf")
899 (concat "mkdir " (file-name-sans-extension file)
900 "; tar -C " (file-name-sans-extension file) " -xvf")))
893 901
894 ;; REGEXPS for compressed archives must come before the .Z rule to 902 ;; REGEXPS for compressed archives must come before the .Z rule to
895 ;; be recognized: 903 ;; be recognized:
@@ -907,32 +915,68 @@ dired."
907 '(if dired-guess-shell-gnutar 915 '(if dired-guess-shell-gnutar
908 (concat dired-guess-shell-gnutar " zxvf") 916 (concat dired-guess-shell-gnutar " zxvf")
909 (concat "gunzip -qc * | tar xvf -")) 917 (concat "gunzip -qc * | tar xvf -"))
918 ;; Extract files into a separate subdirectory
919 '(if dired-guess-shell-gnutar
920 (concat "mkdir " (file-name-sans-extension file)
921 "; " dired-guess-shell-gnutar " -C "
922 (file-name-sans-extension file) " -zxvf")
923 (concat "mkdir " (file-name-sans-extension file)
924 "; gunzip -qc * | tar -C "
925 (file-name-sans-extension file) " -xvf -"))
910 ;; Optional decompression. 926 ;; Optional decompression.
911 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q" ""))) 927 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q" "")))
928
912 ;; bzip2'ed archives 929 ;; bzip2'ed archives
913 (list "\\.tar\\.bz2$" 930 (list "\\.t\\(ar\\.bz2\\|bz\\)$"
914 "bunzip2 -c * | tar xvf -" 931 "bunzip2 -c * | tar xvf -"
932 ;; Extract files into a separate subdirectory
933 '(concat "mkdir " (file-name-sans-extension file)
934 "; bunzip2 -c * | tar -C "
935 (file-name-sans-extension file) " -xvf -")
915 ;; Optional decompression. 936 ;; Optional decompression.
916 "bunzip2") 937 "bunzip2")
917 938
918 '("\\.shar.Z$" "zcat * | unshar") 939 '("\\.shar\\.Z$" "zcat * | unshar")
919 '("\\.shar.g?z$" "gunzip -qc * | unshar") 940 '("\\.shar\\.g?z$" "gunzip -qc * | unshar")
920 941
921 '("\\.e?ps$" "ghostview" "xloadimage" "lpr") 942 '("\\.e?ps$" "ghostview" "xloadimage" "lpr")
922 (list "\\.e?ps.g?z$" "gunzip -qc * | ghostview -" 943 (list "\\.e?ps\\.g?z$" "gunzip -qc * | ghostview -"
923 ;; Optional decompression. 944 ;; Optional decompression.
924 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q"))) 945 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
925 (list "\\.e?ps.Z$" "zcat * | ghostview -" 946 (list "\\.e?ps\\.Z$" "zcat * | ghostview -"
926 ;; Optional conversion to gzip format. 947 ;; Optional conversion to gzip format.
927 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q") 948 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
928 " " dired-guess-shell-znew-switches)) 949 " " dired-guess-shell-znew-switches))
950
929 '("\\.patch$" "cat * | patch") 951 '("\\.patch$" "cat * | patch")
930 '("\\.patch.g?z$" "gunzip -qc * | patch") 952 (list "\\.patch\\.g?z$" "gunzip -qc * | patch"
931 (list "\\.patch.Z$" "zcat * | patch" 953 ;; Optional decompression.
954 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
955 (list "\\.patch\\.Z$" "zcat * | patch"
932 ;; Optional conversion to gzip format. 956 ;; Optional conversion to gzip format.
933 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q") 957 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
934 " " dired-guess-shell-znew-switches)) 958 " " dired-guess-shell-znew-switches))
935 959
960 ;; The following four extensions are useful with dired-man ("N" key)
961 (list "\\.[0-9]$" '(progn (require 'man)
962 (if (Man-support-local-filenames)
963 "man -l"
964 "cat * | tbl | nroff -man -h")))
965 (list "\\.[0-9]\\.g?z$" '(progn (require 'man)
966 (if (Man-support-local-filenames)
967 "man -l"
968 "gunzip -qc * | tbl | nroff -man -h"))
969 ;; Optional decompression.
970 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
971 (list "\\.[0-9]\\.Z$" '(progn (require 'man)
972 (if (Man-support-local-filenames)
973 "man -l"
974 "zcat * | tbl | nroff -man -h"))
975 ;; Optional conversion to gzip format.
976 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q")
977 " " dired-guess-shell-znew-switches))
978 '("\\.pod$" "perldoc" "pod2man * | nroff -man")
979
936 '("\\.dvi$" "xdvi" "dvips") ; preview and printing 980 '("\\.dvi$" "xdvi" "dvips") ; preview and printing
937 '("\\.au$" "play") ; play Sun audiofiles 981 '("\\.au$" "play") ; play Sun audiofiles
938 '("\\.mpg$" "mpeg_play") 982 '("\\.mpg$" "mpeg_play")
@@ -945,7 +989,7 @@ dired."
945 '("\\.gif$" "xloadimage") ; view gif pictures 989 '("\\.gif$" "xloadimage") ; view gif pictures
946 '("\\.tif$" "xloadimage") 990 '("\\.tif$" "xloadimage")
947 '("\\.png$" "display") ; xloadimage 4.1 doesn't grok PNG 991 '("\\.png$" "display") ; xloadimage 4.1 doesn't grok PNG
948 '("\\.jpg$" "xloadimage") 992 '("\\.jpe?g$" "xloadimage")
949 '("\\.fig$" "xfig") ; edit fig pictures 993 '("\\.fig$" "xfig") ; edit fig pictures
950 '("\\.out$" "xgraph") ; for plotting purposes. 994 '("\\.out$" "xgraph") ; for plotting purposes.
951 '("\\.tex$" "latex" "tex") 995 '("\\.tex$" "latex" "tex")
@@ -953,14 +997,18 @@ dired."
953 '("\\.pdf$" "xpdf") ; edit PDF files 997 '("\\.pdf$" "xpdf") ; edit PDF files
954 998
955 ;; Some other popular archivers. 999 ;; Some other popular archivers.
1000 (list "\\.zip$" "unzip"
1001 ;; Extract files into a separate subdirectory
1002 '(concat "unzip" (if dired-guess-shell-gzip-quiet " -q")
1003 " -d " (file-name-sans-extension file)))
956 '("\\.zoo$" "zoo x//") 1004 '("\\.zoo$" "zoo x//")
957 '("\\.zip$" "unzip")
958 '("\\.lzh$" "lharc x") 1005 '("\\.lzh$" "lharc x")
959 '("\\.arc$" "arc x") 1006 '("\\.arc$" "arc x")
960 '("\\.shar$" "unshar") 1007 '("\\.shar$" "unshar")
961 1008
962 ;; Compression. 1009 ;; Compression.
963 (list "\\.g?z$" '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q"))) 1010 (list "\\.g?z$" '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q")))
1011 (list "\\.dz$" "dictunzip")
964 (list "\\.bz2$" "bunzip2") 1012 (list "\\.bz2$" "bunzip2")
965 (list "\\.Z$" "uncompress" 1013 (list "\\.Z$" "uncompress"
966 ;; Optional conversion to gzip format. 1014 ;; Optional conversion to gzip format.
@@ -998,9 +1046,11 @@ You can set this variable in your ~/.emacs. For example, to add rules for
998 :group 'dired-x 1046 :group 'dired-x
999 :type '(alist :key-type regexp :value-type (repeat sexp))) 1047 :type '(alist :key-type regexp :value-type (repeat sexp)))
1000 1048
1001(defvar dired-guess-shell-case-fold-search nil 1049(defcustom dired-guess-shell-case-fold-search t
1002 "*If non-nil, `dired-guess-shell-alist-default' and 1050 "If non-nil, `dired-guess-shell-alist-default' and
1003`dired-guess-shell-alist-user' are matched case-insensitively.") 1051`dired-guess-shell-alist-user' are matched case-insensitively."
1052 :group 'dired-x
1053 :type 'boolean)
1004 1054
1005(defun dired-guess-default (files) 1055(defun dired-guess-default (files)
1006 "Guess a shell commands for FILES. Return command or list of commands. 1056 "Guess a shell commands for FILES. Return command or list of commands.
@@ -1278,8 +1328,10 @@ NOSELECT the files are merely found but not selected."
1278Uses ../lisp/man.el of \\[manual-entry] fame." 1328Uses ../lisp/man.el of \\[manual-entry] fame."
1279 (interactive) 1329 (interactive)
1280 (require 'man) 1330 (require 'man)
1281 (let ((file (dired-get-filename)) 1331 (let* ((file (dired-get-filename))
1282 (manual-program "nroff -man -h")) 1332 (manual-program (replace-regexp-in-string "\\*" "%s"
1333 (dired-guess-shell-command
1334 "Man command: " (list file)))))
1283 (Man-getpage-in-background file))) 1335 (Man-getpage-in-background file)))
1284 1336
1285;;; Run Info on files. 1337;;; Run Info on files.
diff --git a/lisp/dired.el b/lisp/dired.el
index c3511baea47..515daa03f27 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1,6 +1,6 @@
1;;; dired.el --- directory-browsing commands 1;;; dired.el --- directory-browsing commands
2 2
3;; Copyright (C) 1985, 86, 92, 93, 94, 95, 96, 1997, 2000, 2001, 2003 3;; Copyright (C) 1985, 86, 92, 93, 94, 95, 96, 97, 2000, 01, 03, 2004
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Sebastian Kremer <sk@thp.uni-koeln.de> 6;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>
@@ -39,6 +39,7 @@
39 39
40(defgroup dired nil 40(defgroup dired nil
41 "Directory editing." 41 "Directory editing."
42 :link '(custom-manual "(emacs)Dired")
42 :group 'files) 43 :group 'files)
43 44
44(defgroup dired-mark nil 45(defgroup dired-mark nil
@@ -192,6 +193,7 @@ with the buffer narrowed to the listing."
192;; Note this can't simply be run inside function `dired-ls' as the hook 193;; Note this can't simply be run inside function `dired-ls' as the hook
193;; functions probably depend on the dired-subdir-alist to be OK. 194;; functions probably depend on the dired-subdir-alist to be OK.
194 195
196;; Fixme: This should use mailcap.
195(defcustom dired-view-command-alist 197(defcustom dired-view-command-alist
196 '(("[.]\\(ps\\|ps_pages\\|eps\\)\\'" . "gv -spartan -color -watch %s") 198 '(("[.]\\(ps\\|ps_pages\\|eps\\)\\'" . "gv -spartan -color -watch %s")
197 ("[.]pdf\\'" . "xpdf %s") 199 ("[.]pdf\\'" . "xpdf %s")
@@ -308,6 +310,16 @@ Subexpression 2 must end right before the \\n or \\r.")
308;;; "\\([-d]\\(....w....\\|.......w.\\)\\)") 310;;; "\\([-d]\\(....w....\\|.......w.\\)\\)")
309;;; '(1 font-lock-comment-face) 311;;; '(1 font-lock-comment-face)
310;;; '(".+" (dired-move-to-filename) nil (0 font-lock-comment-face))) 312;;; '(".+" (dired-move-to-filename) nil (0 font-lock-comment-face)))
313 ;; However, we don't need to highlight the file name, only the
314 ;; permissions, to win generally. -- fx.
315 ;; Fixme: we could also put text properties on the permission
316 ;; fields with keymaps to frob the permissions, somewhat a la XEmacs.
317 (list (concat dired-re-maybe-mark dired-re-inode-size
318 "[-d]....\\(w\\)..\\(w\\).") ; group writable
319 '(1 font-lock-warning-face))
320 (list (concat dired-re-maybe-mark dired-re-inode-size
321 "[-d]....\\(w\\)....") ; world writable
322 '(1 font-lock-comment-face))
311 ;; 323 ;;
312 ;; Subdirectories. 324 ;; Subdirectories.
313 (list dired-re-dir 325 (list dired-re-dir
@@ -327,12 +339,12 @@ Subexpression 2 must end right before the \\n or \\r.")
327 339
328;;; Macros must be defined before they are used, for the byte compiler. 340;;; Macros must be defined before they are used, for the byte compiler.
329 341
330;; Mark all files for which CONDITION evals to non-nil.
331;; CONDITION is evaluated on each line, with point at beginning of line.
332;; MSG is a noun phrase for the type of files being marked.
333;; It should end with a noun that can be pluralized by adding `s'.
334;; Return value is the number of files marked, or nil if none were marked.
335(defmacro dired-mark-if (predicate msg) 342(defmacro dired-mark-if (predicate msg)
343 "Mark all files for which PREDICATE evals to non-nil.
344PREDICATE is evaluated on each line, with point at beginning of line.
345MSG is a noun phrase for the type of files being marked.
346It should end with a noun that can be pluralized by adding `s'.
347Return value is the number of files marked, or nil if none were marked."
336 `(let (buffer-read-only count) 348 `(let (buffer-read-only count)
337 (save-excursion 349 (save-excursion
338 (setq count 0) 350 (setq count 0)
@@ -513,12 +525,34 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
513 (setq dir-or-list dirname)) 525 (setq dir-or-list dirname))
514 (dired-internal-noselect dir-or-list switches))) 526 (dired-internal-noselect dir-or-list switches)))
515 527
528;; The following is an internal dired function. It returns non-nil if
529;; the directory visited by the current dired buffer has changed on
530;; disk. DIRNAME should be the directory name of that directory.
531(defun dired-directory-changed-p (dirname)
532 (not (let ((attributes (file-attributes dirname))
533 (modtime (visited-file-modtime)))
534 (or (eq modtime 0)
535 (not (eq (car attributes) t))
536 (and (= (car (nth 5 attributes)) (car modtime))
537 (= (nth 1 (nth 5 attributes)) (cdr modtime)))))))
538
539(defun dired-buffer-stale-p (&optional noconfirm)
540 "Return non-nil if current dired buffer needs updating.
541If NOCONFIRM is non-nil, then this function always returns nil
542for a remote directory. This feature is used by Auto Revert Mode."
543 (let ((dirname
544 (if (consp dired-directory) (car dired-directory) dired-directory)))
545 (and (stringp dirname)
546 (not (when noconfirm (file-remote-p dirname)))
547 (file-readable-p dirname)
548 (dired-directory-changed-p dirname))))
549
516;; Separate function from dired-noselect for the sake of dired-vms.el. 550;; Separate function from dired-noselect for the sake of dired-vms.el.
517(defun dired-internal-noselect (dir-or-list &optional switches mode) 551(defun dired-internal-noselect (dir-or-list &optional switches mode)
518 ;; If there is an existing dired buffer for DIRNAME, just leave 552 ;; If there is an existing dired buffer for DIRNAME, just leave
519 ;; buffer as it is (don't even call dired-revert). 553 ;; buffer as it is (don't even call dired-revert).
520 ;; This saves time especially for deep trees or with ange-ftp. 554 ;; This saves time especially for deep trees or with ange-ftp.
521 ;; The user can type `g'easily, and it is more consistent with find-file. 555 ;; The user can type `g' easily, and it is more consistent with find-file.
522 ;; But if SWITCHES are given they are probably different from the 556 ;; But if SWITCHES are given they are probably different from the
523 ;; buffer's old value, so call dired-sort-other, which does 557 ;; buffer's old value, so call dired-sort-other, which does
524 ;; revert the buffer. 558 ;; revert the buffer.
@@ -544,20 +578,14 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
544 ;; kill-all-local-variables any longer. 578 ;; kill-all-local-variables any longer.
545 (setq buffer (create-file-buffer (directory-file-name dirname))))) 579 (setq buffer (create-file-buffer (directory-file-name dirname)))))
546 (set-buffer buffer) 580 (set-buffer buffer)
547 (if (not new-buffer-p) ; existing buffer ... 581 (if (not new-buffer-p) ; existing buffer ...
548 (cond (switches ; ... but new switches 582 (cond (switches ; ... but new switches
549 ;; file list may have changed 583 ;; file list may have changed
550 (setq dired-directory dir-or-list) 584 (setq dired-directory dir-or-list)
551 ;; this calls dired-revert 585 ;; this calls dired-revert
552 (dired-sort-other switches)) 586 (dired-sort-other switches))
553 ;; If directory has changed on disk, offer to revert. 587 ;; If directory has changed on disk, offer to revert.
554 ((if (let ((attributes (file-attributes dirname)) 588 ((when (dired-directory-changed-p dirname)
555 (modtime (visited-file-modtime)))
556 (or (eq modtime 0)
557 (not (eq (car attributes) t))
558 (and (= (car (nth 5 attributes)) (car modtime))
559 (= (nth 1 (nth 5 attributes)) (cdr modtime)))))
560 nil
561 (message "%s" 589 (message "%s"
562 (substitute-command-keys 590 (substitute-command-keys
563 "Directory has changed on disk; type \\[revert-buffer] to update Dired"))))) 591 "Directory has changed on disk; type \\[revert-buffer] to update Dired")))))
@@ -618,10 +646,12 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
618 646
619;; Read in a new dired buffer 647;; Read in a new dired buffer
620 648
621;; dired-readin differs from dired-insert-subdir in that it accepts
622;; wildcards, erases the buffer, and builds the subdir-alist anew
623;; (including making it buffer-local and clearing it first).
624(defun dired-readin () 649(defun dired-readin ()
650 "Read in a new dired buffer.
651Differs from dired-insert-subdir in that it accepts
652wildcards, erases the buffer, and builds the subdir-alist anew
653\(including making it buffer-local and clearing it first)."
654
625 ;; default-directory and dired-actual-switches must be buffer-local 655 ;; default-directory and dired-actual-switches must be buffer-local
626 ;; and initialized by now. 656 ;; and initialized by now.
627 (let (dirname) 657 (let (dirname)
@@ -634,7 +664,6 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
634 ;; based on dired-directory, e.g. with ange-ftp to a SysV host 664 ;; based on dired-directory, e.g. with ange-ftp to a SysV host
635 ;; where ls won't understand -Al switches. 665 ;; where ls won't understand -Al switches.
636 (run-hooks 'dired-before-readin-hook) 666 (run-hooks 'dired-before-readin-hook)
637 (message "Reading directory %s..." dirname)
638 (if (consp buffer-undo-list) 667 (if (consp buffer-undo-list)
639 (setq buffer-undo-list nil)) 668 (setq buffer-undo-list nil))
640 (let (buffer-read-only 669 (let (buffer-read-only
@@ -643,7 +672,6 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
643 (widen) 672 (widen)
644 (erase-buffer) 673 (erase-buffer)
645 (dired-readin-insert)) 674 (dired-readin-insert))
646 (message "Reading directory %s...done" dirname)
647 (goto-char (point-min)) 675 (goto-char (point-min))
648 ;; Must first make alist buffer local and set it to nil because 676 ;; Must first make alist buffer local and set it to nil because
649 ;; dired-build-subdir-alist will call dired-clear-alist first 677 ;; dired-build-subdir-alist will call dired-clear-alist first
@@ -740,8 +768,8 @@ If HDR is non-nil, insert a header line with the directory name."
740 ;; Insert "wildcard" line where "total" line would be for a full dir. 768 ;; Insert "wildcard" line where "total" line would be for a full dir.
741 (insert " wildcard " (file-name-nondirectory dir) "\n"))))) 769 (insert " wildcard " (file-name-nondirectory dir) "\n")))))
742 770
743;; Make the file names highlight when the mouse is on them.
744(defun dired-insert-set-properties (beg end) 771(defun dired-insert-set-properties (beg end)
772 "Make the file names highlight when the mouse is on them."
745 (save-excursion 773 (save-excursion
746 (goto-char beg) 774 (goto-char beg)
747 (while (< (point) end) 775 (while (< (point) end)
@@ -760,10 +788,10 @@ If HDR is non-nil, insert a header line with the directory name."
760;; Reverting a dired buffer 788;; Reverting a dired buffer
761 789
762(defun dired-revert (&optional arg noconfirm) 790(defun dired-revert (&optional arg noconfirm)
763 ;; Reread the dired buffer. Must also be called after 791 "Reread the dired buffer.
764 ;; dired-actual-switches have changed. 792Must also be called after dired-actual-switches have changed.
765 ;; Should not fail even on completely garbaged buffers. 793Should not fail even on completely garbaged buffers.
766 ;; Preserves old cursor, marks/flags, hidden-p. 794Preserves old cursor, marks/flags, hidden-p."
767 (widen) ; just in case user narrowed 795 (widen) ; just in case user narrowed
768 (let ((opoint (point)) 796 (let ((opoint (point))
769 (ofile (dired-get-filename nil t)) 797 (ofile (dired-get-filename nil t))
@@ -790,10 +818,9 @@ If HDR is non-nil, insert a header line with the directory name."
790 (goto-char opoint)) ; was before 818 (goto-char opoint)) ; was before
791 (dired-move-to-filename) 819 (dired-move-to-filename)
792 (save-excursion ; hide subdirs that were hidden 820 (save-excursion ; hide subdirs that were hidden
793 (mapcar (function (lambda (dir) 821 (dolist (dir hidden-subdirs)
794 (if (dired-goto-subdir dir) 822 (if (dired-goto-subdir dir)
795 (dired-hide-subdir 1)))) 823 (dired-hide-subdir 1)))))
796 hidden-subdirs)))
797 ;; outside of the let scope 824 ;; outside of the let scope
798;;; Might as well not override the user if the user changed this. 825;;; Might as well not override the user if the user changed this.
799;;; (setq buffer-read-only t) 826;;; (setq buffer-read-only t)
@@ -803,7 +830,7 @@ If HDR is non-nil, insert a header line with the directory name."
803;; Some of these are also used when inserting subdirs. 830;; Some of these are also used when inserting subdirs.
804 831
805(defun dired-remember-marks (beg end) 832(defun dired-remember-marks (beg end)
806 ;; Return alist of files and their marks, from BEG to END. 833 "Return alist of files and their marks, from BEG to END."
807 (if selective-display ; must unhide to make this work. 834 (if selective-display ; must unhide to make this work.
808 (let (buffer-read-only) 835 (let (buffer-read-only)
809 (subst-char-in-region beg end ?\r ?\n))) 836 (subst-char-in-region beg end ?\r ?\n)))
@@ -816,9 +843,9 @@ If HDR is non-nil, insert a header line with the directory name."
816 alist (cons (cons fil chr) alist))))) 843 alist (cons (cons fil chr) alist)))))
817 alist)) 844 alist))
818 845
819;; Mark all files remembered in ALIST.
820;; Each element of ALIST looks like (FILE . MARKERCHAR).
821(defun dired-mark-remembered (alist) 846(defun dired-mark-remembered (alist)
847 "Mark all files remembered in ALIST.
848Each element of ALIST looks like (FILE . MARKERCHAR)."
822 (let (elt fil chr) 849 (let (elt fil chr)
823 (while alist 850 (while alist
824 (setq elt (car alist) 851 (setq elt (car alist)
@@ -831,8 +858,8 @@ If HDR is non-nil, insert a header line with the directory name."
831 (delete-char 1) 858 (delete-char 1)
832 (insert chr)))))) 859 (insert chr))))))
833 860
834;; Return a list of names of subdirs currently hidden.
835(defun dired-remember-hidden () 861(defun dired-remember-hidden ()
862 "Return a list of names of subdirs currently hidden."
836 (let ((l dired-subdir-alist) dir pos result) 863 (let ((l dired-subdir-alist) dir pos result)
837 (while l 864 (while l
838 (setq dir (car (car l)) 865 (setq dir (car (car l))
@@ -844,9 +871,9 @@ If HDR is non-nil, insert a header line with the directory name."
844 (setq result (cons dir result)))) 871 (setq result (cons dir result))))
845 result)) 872 result))
846 873
847;; Try to insert all subdirs that were displayed before,
848;; according to the former subdir alist OLD-SUBDIR-ALIST.
849(defun dired-insert-old-subdirs (old-subdir-alist) 874(defun dired-insert-old-subdirs (old-subdir-alist)
875 "Try to insert all subdirs that were displayed before.
876Do so according to the former subdir alist OLD-SUBDIR-ALIST."
850 (or (string-match "R" dired-actual-switches) 877 (or (string-match "R" dired-actual-switches)
851 (let (elt dir) 878 (let (elt dir)
852 (while old-subdir-alist 879 (while old-subdir-alist
@@ -859,20 +886,17 @@ If HDR is non-nil, insert a header line with the directory name."
859 (dired-insert-subdir dir)) 886 (dired-insert-subdir dir))
860 (error nil)))))) 887 (error nil))))))
861 888
862;; Remove directory DIR from any directory cache.
863(defun dired-uncache (dir) 889(defun dired-uncache (dir)
890 "Remove directory DIR from any directory cache."
864 (let ((handler (find-file-name-handler dir 'dired-uncache))) 891 (let ((handler (find-file-name-handler dir 'dired-uncache)))
865 (if handler 892 (if handler
866 (funcall handler 'dired-uncache dir)))) 893 (funcall handler 'dired-uncache dir))))
867 894
868;; dired mode key bindings and initialization 895;; dired mode key bindings and initialization
869 896
870(defvar dired-mode-map nil "Local keymap for dired-mode buffers.") 897(defvar dired-mode-map
871(if dired-mode-map
872 nil
873 ;; This looks ugly when substitute-command-keys uses C-d instead d: 898 ;; This looks ugly when substitute-command-keys uses C-d instead d:
874 ;; (define-key dired-mode-map "\C-d" 'dired-flag-file-deletion) 899 ;; (define-key dired-mode-map "\C-d" 'dired-flag-file-deletion)
875
876 (let ((map (make-keymap))) 900 (let ((map (make-keymap)))
877 (suppress-keymap map) 901 (suppress-keymap map)
878 (define-key map [mouse-2] 'dired-mouse-find-file-other-window) 902 (define-key map [mouse-2] 'dired-mouse-find-file-other-window)
@@ -937,6 +961,7 @@ If HDR is non-nil, insert a header line with the directory name."
937 (define-key map "*u" 'dired-unmark) 961 (define-key map "*u" 'dired-unmark)
938 (define-key map "*?" 'dired-unmark-all-files) 962 (define-key map "*?" 'dired-unmark-all-files)
939 (define-key map "*!" 'dired-unmark-all-marks) 963 (define-key map "*!" 'dired-unmark-all-marks)
964 (define-key map "U" 'dired-unmark-all-marks)
940 (define-key map "*\177" 'dired-unmark-backward) 965 (define-key map "*\177" 'dired-unmark-backward)
941 (define-key map "*\C-n" 'dired-next-marked-file) 966 (define-key map "*\C-n" 'dired-next-marked-file)
942 (define-key map "*\C-p" 'dired-prev-marked-file) 967 (define-key map "*\C-p" 'dired-prev-marked-file)
@@ -1196,11 +1221,14 @@ If HDR is non-nil, insert a header line with the directory name."
1196 '(menu-item "Copy to..." dired-do-copy 1221 '(menu-item "Copy to..." dired-do-copy
1197 :help "Copy current file or all marked files")) 1222 :help "Copy current file or all marked files"))
1198 1223
1199 (setq dired-mode-map map))) 1224 map)
1225 "Local keymap for `dired-mode' buffers.")
1200 1226
1201;; Dired mode is suitable only for specially formatted data. 1227;; Dired mode is suitable only for specially formatted data.
1202(put 'dired-mode 'mode-class 'special) 1228(put 'dired-mode 'mode-class 'special)
1203 1229
1230(defvar buffer-stale-function)
1231
1204(defun dired-mode (&optional dirname switches) 1232(defun dired-mode (&optional dirname switches)
1205 "\ 1233 "\
1206Mode for \"editing\" directory listings. 1234Mode for \"editing\" directory listings.
@@ -1279,6 +1307,8 @@ Keybindings:
1279 (propertized-buffer-identification "%17b")) 1307 (propertized-buffer-identification "%17b"))
1280 (set (make-local-variable 'revert-buffer-function) 1308 (set (make-local-variable 'revert-buffer-function)
1281 (function dired-revert)) 1309 (function dired-revert))
1310 (set (make-local-variable 'buffer-stale-function)
1311 (function dired-buffer-stale-p))
1282 (set (make-local-variable 'page-delimiter) 1312 (set (make-local-variable 'page-delimiter)
1283 "\n\n") 1313 "\n\n")
1284 (set (make-local-variable 'dired-directory) 1314 (set (make-local-variable 'dired-directory)
@@ -1290,7 +1320,8 @@ Keybindings:
1290 dired-directory))) 1320 dired-directory)))
1291 (set (make-local-variable 'dired-actual-switches) 1321 (set (make-local-variable 'dired-actual-switches)
1292 (or switches dired-listing-switches)) 1322 (or switches dired-listing-switches))
1293 (set (make-local-variable 'font-lock-defaults) '(dired-font-lock-keywords t)) 1323 (set (make-local-variable 'font-lock-defaults)
1324 '(dired-font-lock-keywords t nil nil beginning-of-line))
1294 (dired-sort-other dired-actual-switches t) 1325 (dired-sort-other dired-actual-switches t)
1295 (run-hooks 'dired-mode-hook) 1326 (run-hooks 'dired-mode-hook)
1296 (when (featurep 'x-dnd) 1327 (when (featurep 'x-dnd)
@@ -2617,11 +2648,15 @@ A prefix argument says to unflag those files instead."
2617 (file-name-nondirectory fn))))) 2648 (file-name-nondirectory fn)))))
2618 "auto save file"))) 2649 "auto save file")))
2619 2650
2620(defvar dired-garbage-files-regexp 2651(defcustom dired-garbage-files-regexp
2652 ;; `log' here is dubious, since it's typically used for useful log
2653 ;; files, not just TeX stuff. -- fx
2621 (concat (regexp-opt 2654 (concat (regexp-opt
2622 '(".log" ".toc" ".dvi" ".bak" ".orig" ".rej" ".aux")) 2655 '(".log" ".toc" ".dvi" ".bak" ".orig" ".rej" ".aux"))
2623 "\\'") 2656 "\\'")
2624 "*Regular expression to match \"garbage\" files for `dired-flag-garbage-files'.") 2657 "Regular expression to match \"garbage\" files for `dired-flag-garbage-files'."
2658 :type 'regexp
2659 :group 'dired)
2625 2660
2626(defun dired-flag-garbage-files () 2661(defun dired-flag-garbage-files ()
2627 "Flag for deletion all files that match `dired-garbage-files-regexp'." 2662 "Flag for deletion all files that match `dired-garbage-files-regexp'."
diff --git a/lisp/disp-table.el b/lisp/disp-table.el
index 6403b7de8b0..87781f5f8ae 100644
--- a/lisp/disp-table.el
+++ b/lisp/disp-table.el
@@ -1,6 +1,6 @@
1;;; disp-table.el --- functions for dealing with char tables 1;;; disp-table.el --- functions for dealing with char tables
2 2
3;; Copyright (C) 1987, 1994, 1995, 1999 Free Software Foundation, Inc. 3;; Copyright (C) 1987, 94, 95, 1999, 2004 Free Software Foundation, Inc.
4 4
5;; Author: Erik Naggum <erik@naggum.no> 5;; Author: Erik Naggum <erik@naggum.no>
6;; Based on a previous version by Howard Gayle 6;; Based on a previous version by Howard Gayle
@@ -116,9 +116,7 @@ Valid symbols are `truncation', `wrap', `escape', `control',
116 (or standard-display-table 116 (or standard-display-table
117 (setq standard-display-table (make-display-table))) 117 (setq standard-display-table (make-display-table)))
118 (while (<= l h) 118 (while (<= l h)
119 (if (and (>= l ?\ ) (< l 127)) 119 (aset standard-display-table l (if (or (< l ?\ ) (>= l 127)) (vector l)))
120 (aset standard-display-table l nil)
121 (aset standard-display-table l (vector l)))
122 (setq l (1+ l)))) 120 (setq l (1+ l))))
123 121
124;;;###autoload 122;;;###autoload
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index 93ce7776d2f..7686722c5be 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -1,6 +1,6 @@
1;;; advice.el --- an overloading mechanism for Emacs Lisp functions 1;;; advice.el --- an overloading mechanism for Emacs Lisp functions
2 2
3;; Copyright (C) 1993,1994,2000, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1993,1994,2000,01,2004 Free Software Foundation, Inc.
4 4
5;; Author: Hans Chalupsky <hans@cs.buffalo.edu> 5;; Author: Hans Chalupsky <hans@cs.buffalo.edu>
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -2563,29 +2563,31 @@ supplied to make subr arglist lookup more efficient."
2563Either use the one stored under the `ad-subr-arglist' property, 2563Either use the one stored under the `ad-subr-arglist' property,
2564or try to retrieve it from the docstring and cache it under 2564or try to retrieve it from the docstring and cache it under
2565that property, or otherwise use `(&rest ad-subr-args)'." 2565that property, or otherwise use `(&rest ad-subr-args)'."
2566 (cond ((ad-subr-args-defined-p subr-name) 2566 (if (ad-subr-args-defined-p subr-name)
2567 (ad-get-subr-args subr-name)) 2567 (ad-get-subr-args subr-name)
2568 ;; says jwz: Should use this for Lemacs 19.8 and above: 2568 ;; says jwz: Should use this for Lemacs 19.8 and above:
2569 ;;((fboundp 'subr-min-args) 2569 ;;((fboundp 'subr-min-args)
2570 ;; ...) 2570 ;; ...)
2571 ;; says hans: I guess what Jamie means is that I should use the values 2571 ;; says hans: I guess what Jamie means is that I should use the values
2572 ;; of `subr-min-args' and `subr-max-args' to construct the subr arglist 2572 ;; of `subr-min-args' and `subr-max-args' to construct the subr arglist
2573 ;; without having to look it up via parsing the docstring, e.g., 2573 ;; without having to look it up via parsing the docstring, e.g.,
2574 ;; values 1 and 2 would suggest `(arg1 &optional arg2)' as an 2574 ;; values 1 and 2 would suggest `(arg1 &optional arg2)' as an
2575 ;; argument list. However, that won't work because there is no 2575 ;; argument list. However, that won't work because there is no
2576 ;; way to distinguish a subr with args `(a &optional b &rest c)' from 2576 ;; way to distinguish a subr with args `(a &optional b &rest c)' from
2577 ;; one with args `(a &rest c)' using that mechanism. Also, the argument 2577 ;; one with args `(a &rest c)' using that mechanism. Also, the argument
2578 ;; names from the docstring are more meaningful. Hence, I'll stick with 2578 ;; names from the docstring are more meaningful. Hence, I'll stick with
2579 ;; the old way of doing things. 2579 ;; the old way of doing things.
2580 (t (let ((doc (or (ad-real-documentation subr-name t) ""))) 2580 (let ((doc (or (ad-real-documentation subr-name t) "")))
2581 (cond ((string-match "^\\(([^\)]+)\\)\n?\\'" doc) 2581 (if (not (string-match "\n\n\\((.+)\\)\\'" doc))
2582 (ad-define-subr-args 2582 ;; Signalling an error leads to bugs during bootstrapping because
2583 subr-name 2583 ;; the DOC file is not yet built (which is an error, BTW).
2584 (cdr (car (read-from-string 2584 ;; (error "The usage info is missing from the subr %s" subr-name)
2585 (downcase (match-string 1 doc)))))) 2585 '(&rest ad-subr-args)
2586 (ad-get-subr-args subr-name)) 2586 (ad-define-subr-args
2587 ;; This is actually an error. 2587 subr-name
2588 (t '(&rest ad-subr-args))))))) 2588 (cdr (car (read-from-string
2589 (downcase (match-string 1 doc))))))
2590 (ad-get-subr-args subr-name)))))
2589 2591
2590(defun ad-docstring (definition) 2592(defun ad-docstring (definition)
2591 "Return the unexpanded docstring of DEFINITION." 2593 "Return the unexpanded docstring of DEFINITION."
diff --git a/lisp/emacs-lisp/backquote.el b/lisp/emacs-lisp/backquote.el
index 81e1a91f76c..6a2baeb3fe9 100644
--- a/lisp/emacs-lisp/backquote.el
+++ b/lisp/emacs-lisp/backquote.el
@@ -1,6 +1,6 @@
1;;; backquote.el --- implement the ` Lisp construct 1;;; backquote.el --- implement the ` Lisp construct
2 2
3;;; Copyright (C) 1990, 1992, 1994, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 92, 1994, 2001, 2004 Free Software Foundation, Inc.
4 4
5;; Author: Rick Sladkey <jrs@world.std.com> 5;; Author: Rick Sladkey <jrs@world.std.com>
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -44,6 +44,9 @@
44 "Like `list' but the last argument is the tail of the new list. 44 "Like `list' but the last argument is the tail of the new list.
45 45
46For example (backquote-list* 'a 'b 'c) => (a b . c)" 46For example (backquote-list* 'a 'b 'c) => (a b . c)"
47 ;; The recursive solution is much nicer:
48 ;; (if list (cons first (apply 'backquote-list*-function list)) first))
49 ;; but Emacs is not very good at efficiently processing recursion.
47 (if list 50 (if list
48 (let* ((rest list) (newlist (cons first nil)) (last newlist)) 51 (let* ((rest list) (newlist (cons first nil)) (last newlist))
49 (while (cdr rest) 52 (while (cdr rest)
@@ -58,7 +61,10 @@ For example (backquote-list* 'a 'b 'c) => (a b . c)"
58 "Like `list' but the last argument is the tail of the new list. 61 "Like `list' but the last argument is the tail of the new list.
59 62
60For example (backquote-list* 'a 'b 'c) => (a b . c)" 63For example (backquote-list* 'a 'b 'c) => (a b . c)"
61 (setq list (reverse (cons first list)) 64 ;; The recursive solution is much nicer:
65 ;; (if list (list 'cons first (cons 'backquote-list*-macro list)) first))
66 ;; but Emacs is not very good at efficiently processing such things.
67 (setq list (nreverse (cons first list))
62 first (car list) 68 first (car list)
63 list (cdr list)) 69 list (cdr list))
64 (if list 70 (if list
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index a07eb64d737..da8e7583438 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -1,6 +1,6 @@
1;;; byte-opt.el --- the optimization passes of the emacs-lisp byte compiler 1;;; byte-opt.el --- the optimization passes of the emacs-lisp byte compiler
2 2
3;;; Copyright (c) 1991, 1994, 2000, 2001, 2002 Free Software Foundation, Inc. 3;; Copyright (c) 1991,1994,2000,01,02,2004 Free Software Foundation, Inc.
4 4
5;; Author: Jamie Zawinski <jwz@lucid.com> 5;; Author: Jamie Zawinski <jwz@lucid.com>
6;; Hallvard Furuseth <hbf@ulrik.uio.no> 6;; Hallvard Furuseth <hbf@ulrik.uio.no>
@@ -148,37 +148,37 @@
148 148
149;; Other things to consider: 149;; Other things to consider:
150 150
151;;;;; Associative math should recognize subcalls to identical function: 151;; ;; Associative math should recognize subcalls to identical function:
152;;;(disassemble (lambda (x) (+ (+ (foo) 1) (+ (bar) 2)))) 152;; (disassemble (lambda (x) (+ (+ (foo) 1) (+ (bar) 2))))
153;;;;; This should generate the same as (1+ x) and (1- x) 153;; ;; This should generate the same as (1+ x) and (1- x)
154 154
155;;;(disassemble (lambda (x) (cons (+ x 1) (- x 1)))) 155;; (disassemble (lambda (x) (cons (+ x 1) (- x 1))))
156;;;;; An awful lot of functions always return a non-nil value. If they're 156;; ;; An awful lot of functions always return a non-nil value. If they're
157;;;;; error free also they may act as true-constants. 157;; ;; error free also they may act as true-constants.
158 158
159;;;(disassemble (lambda (x) (and (point) (foo)))) 159;; (disassemble (lambda (x) (and (point) (foo))))
160;;;;; When 160;; ;; When
161;;;;; - all but one arguments to a function are constant 161;; ;; - all but one arguments to a function are constant
162;;;;; - the non-constant argument is an if-expression (cond-expression?) 162;; ;; - the non-constant argument is an if-expression (cond-expression?)
163;;;;; then the outer function can be distributed. If the guarding 163;; ;; then the outer function can be distributed. If the guarding
164;;;;; condition is side-effect-free [assignment-free] then the other 164;; ;; condition is side-effect-free [assignment-free] then the other
165;;;;; arguments may be any expressions. Since, however, the code size 165;; ;; arguments may be any expressions. Since, however, the code size
166;;;;; can increase this way they should be "simple". Compare: 166;; ;; can increase this way they should be "simple". Compare:
167 167
168;;;(disassemble (lambda (x) (eq (if (point) 'a 'b) 'c))) 168;; (disassemble (lambda (x) (eq (if (point) 'a 'b) 'c)))
169;;;(disassemble (lambda (x) (if (point) (eq 'a 'c) (eq 'b 'c)))) 169;; (disassemble (lambda (x) (if (point) (eq 'a 'c) (eq 'b 'c))))
170 170
171;;;;; (car (cons A B)) -> (progn B A) 171;; ;; (car (cons A B)) -> (prog1 A B)
172;;;(disassemble (lambda (x) (car (cons (foo) 42)))) 172;; (disassemble (lambda (x) (car (cons (foo) 42))))
173 173
174;;;;; (cdr (cons A B)) -> (progn A B) 174;; ;; (cdr (cons A B)) -> (progn A B)
175;;;(disassemble (lambda (x) (cdr (cons 42 (foo))))) 175;; (disassemble (lambda (x) (cdr (cons 42 (foo)))))
176 176
177;;;;; (car (list A B ...)) -> (progn B ... A) 177;; ;; (car (list A B ...)) -> (prog1 A B ...)
178;;;(disassemble (lambda (x) (car (list (foo) 42 (bar))))) 178;; (disassemble (lambda (x) (car (list (foo) 42 (bar)))))
179 179
180;;;;; (cdr (list A B ...)) -> (progn A (list B ...)) 180;; ;; (cdr (list A B ...)) -> (progn A (list B ...))
181;;;(disassemble (lambda (x) (cdr (list 42 (foo) (bar))))) 181;; (disassemble (lambda (x) (cdr (list 42 (foo) (bar)))))
182 182
183 183
184;;; Code: 184;;; Code:
@@ -217,10 +217,8 @@
217 args))))) 217 args)))))
218 218
219(defmacro byte-compile-log-lap (format-string &rest args) 219(defmacro byte-compile-log-lap (format-string &rest args)
220 (list 'and 220 `(and (memq byte-optimize-log '(t byte))
221 '(memq byte-optimize-log '(t byte)) 221 (byte-compile-log-lap-1 ,format-string ,@args)))
222 (cons 'byte-compile-log-lap-1
223 (cons format-string args))))
224 222
225 223
226;;; byte-compile optimizers to support inlining 224;;; byte-compile optimizers to support inlining
@@ -274,18 +272,18 @@
274 (let (string) 272 (let (string)
275 (fetch-bytecode fn) 273 (fetch-bytecode fn)
276 (setq string (aref fn 1)) 274 (setq string (aref fn 1))
275 ;; Isn't it an error for `string' not to be unibyte?? --stef
277 (if (fboundp 'string-as-unibyte) 276 (if (fboundp 'string-as-unibyte)
278 (setq string (string-as-unibyte string))) 277 (setq string (string-as-unibyte string)))
279 (cons (list 'lambda (aref fn 0) 278 (cons `(lambda ,(aref fn 0)
280 (list 'byte-code string (aref fn 2) (aref fn 3))) 279 (byte-code ,string ,(aref fn 2) ,(aref fn 3)))
281 (cdr form))) 280 (cdr form)))
282 (if (eq (car-safe fn) 'lambda) 281 (if (eq (car-safe fn) 'lambda)
283 (cons fn (cdr form)) 282 (cons fn (cdr form))
284 ;; Give up on inlining. 283 ;; Give up on inlining.
285 form)))))) 284 form))))))
286 285
287;;; ((lambda ...) ...) 286;; ((lambda ...) ...)
288;;;
289(defun byte-compile-unfold-lambda (form &optional name) 287(defun byte-compile-unfold-lambda (form &optional name)
290 (or name (setq name "anonymous lambda")) 288 (or name (setq name "anonymous lambda"))
291 (let ((lambda (car form)) 289 (let ((lambda (car form))
@@ -604,14 +602,14 @@
604 (nreverse result))) 602 (nreverse result)))
605 603
606 604
607;;; some source-level optimizers 605;; some source-level optimizers
608;;; 606;;
609;;; when writing optimizers, be VERY careful that the optimizer returns 607;; when writing optimizers, be VERY careful that the optimizer returns
610;;; something not EQ to its argument if and ONLY if it has made a change. 608;; something not EQ to its argument if and ONLY if it has made a change.
611;;; This implies that you cannot simply destructively modify the list; 609;; This implies that you cannot simply destructively modify the list;
612;;; you must return something not EQ to it if you make an optimization. 610;; you must return something not EQ to it if you make an optimization.
613;;; 611;;
614;;; It is now safe to optimize code such that it introduces new bindings. 612;; It is now safe to optimize code such that it introduces new bindings.
615 613
616;; I'd like this to be a defsubst, but let's not be self-referential... 614;; I'd like this to be a defsubst, but let's not be self-referential...
617(defmacro byte-compile-trueconstp (form) 615(defmacro byte-compile-trueconstp (form)
@@ -721,10 +719,10 @@
721 (condition-case () 719 (condition-case ()
722 (eval form) 720 (eval form)
723 (error form))) 721 (error form)))
724;;; It is not safe to delete the function entirely 722;;; It is not safe to delete the function entirely
725;;; (actually, it would be safe if we know the sole arg 723;;; (actually, it would be safe if we know the sole arg
726;;; is not a marker). 724;;; is not a marker).
727;; ((null (cdr (cdr form))) (nth 1 form)) 725;;; ((null (cdr (cdr form))) (nth 1 form))
728 ((null (cddr form)) 726 ((null (cddr form))
729 (if (numberp (nth 1 form)) 727 (if (numberp (nth 1 form))
730 (nth 1 form) 728 (nth 1 form)
@@ -763,9 +761,9 @@
763 (numberp last)) 761 (numberp last))
764 (setq form (nconc (list '- (- (nth 1 form) last) (nth 2 form)) 762 (setq form (nconc (list '- (- (nth 1 form) last) (nth 2 form))
765 (delq last (copy-sequence (nthcdr 3 form)))))))) 763 (delq last (copy-sequence (nthcdr 3 form))))))))
766;;; It is not safe to delete the function entirely 764;;; It is not safe to delete the function entirely
767;;; (actually, it would be safe if we know the sole arg 765;;; (actually, it would be safe if we know the sole arg
768;;; is not a marker). 766;;; is not a marker).
769;;; (if (eq (nth 2 form) 0) 767;;; (if (eq (nth 2 form) 0)
770;;; (nth 1 form) ; (- x 0) --> x 768;;; (nth 1 form) ; (- x 0) --> x
771 (byte-optimize-predicate 769 (byte-optimize-predicate
@@ -780,9 +778,9 @@
780 (setq form (byte-optimize-delay-constants-math form 1 '*)) 778 (setq form (byte-optimize-delay-constants-math form 1 '*))
781 ;; If there is a constant in FORM, it is now the last element. 779 ;; If there is a constant in FORM, it is now the last element.
782 (cond ((null (cdr form)) 1) 780 (cond ((null (cdr form)) 1)
783;;; It is not safe to delete the function entirely 781;;; It is not safe to delete the function entirely
784;;; (actually, it would be safe if we know the sole arg 782;;; (actually, it would be safe if we know the sole arg
785;;; is not a marker or if it appears in other arithmetic). 783;;; is not a marker or if it appears in other arithmetic).
786;;; ((null (cdr (cdr form))) (nth 1 form)) 784;;; ((null (cdr (cdr form))) (nth 1 form))
787 ((let ((last (car (reverse form)))) 785 ((let ((last (car (reverse form))))
788 (cond ((eq 0 last) (cons 'progn (cdr form))) 786 (cond ((eq 0 last) (cons 'progn (cdr form)))
@@ -1117,8 +1115,16 @@
1117 (byte-optimize-predicate form)) 1115 (byte-optimize-predicate form))
1118 form)) 1116 form))
1119 1117
1120(put 'concat 'byte-optimizer 'byte-optimize-concat) 1118(put 'concat 'byte-optimizer 'byte-optimize-pure-func)
1121(defun byte-optimize-concat (form) 1119(put 'symbol-name 'byte-optimizer 'byte-optimize-pure-func)
1120(put 'regexp-opt 'byte-optimizer 'byte-optimize-pure-func)
1121(put 'regexp-quote 'byte-optimizer 'byte-optimize-pure-func)
1122(defun byte-optimize-pure-func (form)
1123 "Do constant folding for pure functions.
1124This assumes that the function will not have any side-effects and that
1125its return value depends solely on its arguments.
1126If the function can signal an error, this might change the semantics
1127of FORM by signalling the error at compile-time."
1122 (let ((args (cdr form)) 1128 (let ((args (cdr form))
1123 (constant t)) 1129 (constant t))
1124 (while (and args constant) 1130 (while (and args constant)
@@ -1181,28 +1187,28 @@
1181 `(progn ,(cadr form) (setq ,(cadr var) ,@(cddr form)))) 1187 `(progn ,(cadr form) (setq ,(cadr var) ,@(cddr form))))
1182 (t form)))) 1188 (t form))))
1183 1189
1184;;; enumerating those functions which need not be called if the returned 1190;; enumerating those functions which need not be called if the returned
1185;;; value is not used. That is, something like 1191;; value is not used. That is, something like
1186;;; (progn (list (something-with-side-effects) (yow)) 1192;; (progn (list (something-with-side-effects) (yow))
1187;;; (foo)) 1193;; (foo))
1188;;; may safely be turned into 1194;; may safely be turned into
1189;;; (progn (progn (something-with-side-effects) (yow)) 1195;; (progn (progn (something-with-side-effects) (yow))
1190;;; (foo)) 1196;; (foo))
1191;;; Further optimizations will turn (progn (list 1 2 3) 'foo) into 'foo. 1197;; Further optimizations will turn (progn (list 1 2 3) 'foo) into 'foo.
1192 1198
1193;;; Some of these functions have the side effect of allocating memory 1199;; Some of these functions have the side effect of allocating memory
1194;;; and it would be incorrect to replace two calls with one. 1200;; and it would be incorrect to replace two calls with one.
1195;;; But we don't try to do those kinds of optimizations, 1201;; But we don't try to do those kinds of optimizations,
1196;;; so it is safe to list such functions here. 1202;; so it is safe to list such functions here.
1197;;; Some of these functions return values that depend on environment 1203;; Some of these functions return values that depend on environment
1198;;; state, so that constant folding them would be wrong, 1204;; state, so that constant folding them would be wrong,
1199;;; but we don't do constant folding based on this list. 1205;; but we don't do constant folding based on this list.
1200 1206
1201;;; However, at present the only optimization we normally do 1207;; However, at present the only optimization we normally do
1202;;; is delete calls that need not occur, and we only do that 1208;; is delete calls that need not occur, and we only do that
1203;;; with the error-free functions. 1209;; with the error-free functions.
1204 1210
1205;;; I wonder if I missed any :-\) 1211;; I wonder if I missed any :-\)
1206(let ((side-effect-free-fns 1212(let ((side-effect-free-fns
1207 '(% * + - / /= 1+ 1- < <= = > >= abs acos append aref ash asin atan 1213 '(% * + - / /= 1+ 1- < <= = > >= abs acos append aref ash asin atan
1208 assoc assq 1214 assoc assq
@@ -1298,8 +1304,8 @@
1298(defconst byte-constref-ops 1304(defconst byte-constref-ops
1299 '(byte-constant byte-constant2 byte-varref byte-varset byte-varbind)) 1305 '(byte-constant byte-constant2 byte-varref byte-varset byte-varbind))
1300 1306
1301;;; This function extracts the bitfields from variable-length opcodes. 1307;; This function extracts the bitfields from variable-length opcodes.
1302;;; Originally defined in disass.el (which no longer uses it.) 1308;; Originally defined in disass.el (which no longer uses it.)
1303 1309
1304(defun disassemble-offset () 1310(defun disassemble-offset ()
1305 "Don't call this!" 1311 "Don't call this!"
@@ -1336,11 +1342,11 @@
1336 (aref bytes ptr)))) 1342 (aref bytes ptr))))
1337 1343
1338 1344
1339;;; This de-compiler is used for inline expansion of compiled functions, 1345;; This de-compiler is used for inline expansion of compiled functions,
1340;;; and by the disassembler. 1346;; and by the disassembler.
1341;;; 1347;;
1342;;; This list contains numbers, which are pc values, 1348;; This list contains numbers, which are pc values,
1343;;; before each instruction. 1349;; before each instruction.
1344(defun byte-decompile-bytecode (bytes constvec) 1350(defun byte-decompile-bytecode (bytes constvec)
1345 "Turns BYTECODE into lapcode, referring to CONSTVEC." 1351 "Turns BYTECODE into lapcode, referring to CONSTVEC."
1346 (let ((byte-compile-constants nil) 1352 (let ((byte-compile-constants nil)
@@ -1461,38 +1467,39 @@
1461 byte-member byte-assq byte-quo byte-rem) 1467 byte-member byte-assq byte-quo byte-rem)
1462 byte-compile-side-effect-and-error-free-ops)) 1468 byte-compile-side-effect-and-error-free-ops))
1463 1469
1464;;; This crock is because of the way DEFVAR_BOOL variables work. 1470;; This crock is because of the way DEFVAR_BOOL variables work.
1465;;; Consider the code 1471;; Consider the code
1466;;; 1472;;
1467;;; (defun foo (flag) 1473;; (defun foo (flag)
1468;;; (let ((old-pop-ups pop-up-windows) 1474;; (let ((old-pop-ups pop-up-windows)
1469;;; (pop-up-windows flag)) 1475;; (pop-up-windows flag))
1470;;; (cond ((not (eq pop-up-windows old-pop-ups)) 1476;; (cond ((not (eq pop-up-windows old-pop-ups))
1471;;; (setq old-pop-ups pop-up-windows) 1477;; (setq old-pop-ups pop-up-windows)
1472;;; ...)))) 1478;; ...))))
1473;;; 1479;;
1474;;; Uncompiled, old-pop-ups will always be set to nil or t, even if FLAG is 1480;; Uncompiled, old-pop-ups will always be set to nil or t, even if FLAG is
1475;;; something else. But if we optimize 1481;; something else. But if we optimize
1476;;; 1482;;
1477;;; varref flag 1483;; varref flag
1478;;; varbind pop-up-windows 1484;; varbind pop-up-windows
1479;;; varref pop-up-windows 1485;; varref pop-up-windows
1480;;; not 1486;; not
1481;;; to 1487;; to
1482;;; varref flag 1488;; varref flag
1483;;; dup 1489;; dup
1484;;; varbind pop-up-windows 1490;; varbind pop-up-windows
1485;;; not 1491;; not
1486;;; 1492;;
1487;;; we break the program, because it will appear that pop-up-windows and 1493;; we break the program, because it will appear that pop-up-windows and
1488;;; old-pop-ups are not EQ when really they are. So we have to know what 1494;; old-pop-ups are not EQ when really they are. So we have to know what
1489;;; the BOOL variables are, and not perform this optimization on them. 1495;; the BOOL variables are, and not perform this optimization on them.
1490 1496
1491;;; The variable `byte-boolean-vars' is now primitive and updated 1497;; The variable `byte-boolean-vars' is now primitive and updated
1492;;; automatically by DEFVAR_BOOL. 1498;; automatically by DEFVAR_BOOL.
1493 1499
1494(defun byte-optimize-lapcode (lap &optional for-effect) 1500(defun byte-optimize-lapcode (lap &optional for-effect)
1495 "Simple peephole optimizer. LAP is both modified and returned." 1501 "Simple peephole optimizer. LAP is both modified and returned.
1502If FOR-EFFECT is non-nil, the return value is assumed to be of no importance."
1496 (let (lap0 1503 (let (lap0
1497 lap1 1504 lap1
1498 lap2 1505 lap2
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index a7385fe5fd0..9956d5003cc 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -1,6 +1,6 @@
1;;; byte-run.el --- byte-compiler support for inlining 1;;; byte-run.el --- byte-compiler support for inlining
2 2
3;; Copyright (C) 1992 Free Software Foundation, Inc. 3;; Copyright (C) 1992, 2004 Free Software Foundation, Inc.
4 4
5;; Author: Jamie Zawinski <jwz@lucid.com> 5;; Author: Jamie Zawinski <jwz@lucid.com>
6;; Hallvard Furuseth <hbf@ulrik.uio.no> 6;; Hallvard Furuseth <hbf@ulrik.uio.no>
@@ -67,14 +67,14 @@
67;; This has a special byte-hunk-handler in bytecomp.el. 67;; This has a special byte-hunk-handler in bytecomp.el.
68(defmacro defsubst (name arglist &rest body) 68(defmacro defsubst (name arglist &rest body)
69 "Define an inline function. The syntax is just like that of `defun'." 69 "Define an inline function. The syntax is just like that of `defun'."
70 (declare (debug defun))
70 (or (memq (get name 'byte-optimizer) 71 (or (memq (get name 'byte-optimizer)
71 '(nil byte-compile-inline-expand)) 72 '(nil byte-compile-inline-expand))
72 (error "`%s' is a primitive" name)) 73 (error "`%s' is a primitive" name))
73 (list 'prog1 74 `(prog1
74 (cons 'defun (cons name (cons arglist body))) 75 (defun ,name ,arglist ,@body)
75 (list 'eval-and-compile 76 (eval-and-compile
76 (list 'put (list 'quote name) 77 (put ',name 'byte-optimizer 'byte-compile-inline-expand))))
77 ''byte-optimizer ''byte-compile-inline-expand))))
78 78
79(defun make-obsolete (fn new &optional when) 79(defun make-obsolete (fn new &optional when)
80 "Make the byte-compiler warn that FUNCTION is obsolete. 80 "Make the byte-compiler warn that FUNCTION is obsolete.
@@ -109,6 +109,7 @@ was first made obsolete, for example a date or a release number."
109(defmacro dont-compile (&rest body) 109(defmacro dont-compile (&rest body)
110 "Like `progn', but the body always runs interpreted (not compiled). 110 "Like `progn', but the body always runs interpreted (not compiled).
111If you think you need this, you're probably making a mistake somewhere." 111If you think you need this, you're probably making a mistake somewhere."
112 (declare (debug t))
112 (list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body))))) 113 (list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body)))))
113 114
114 115
@@ -121,6 +122,7 @@ If you think you need this, you're probably making a mistake somewhere."
121(defmacro eval-when-compile (&rest body) 122(defmacro eval-when-compile (&rest body)
122 "Like `progn', but evaluates the body at compile time. 123 "Like `progn', but evaluates the body at compile time.
123The result of the body appears to the compiler as a quoted constant." 124The result of the body appears to the compiler as a quoted constant."
125 (declare (debug t))
124 ;; Not necessary because we have it in b-c-initial-macro-environment 126 ;; Not necessary because we have it in b-c-initial-macro-environment
125 ;; (list 'quote (eval (cons 'progn body))) 127 ;; (list 'quote (eval (cons 'progn body)))
126 (cons 'progn body)) 128 (cons 'progn body))
@@ -128,6 +130,7 @@ The result of the body appears to the compiler as a quoted constant."
128(put 'eval-and-compile 'lisp-indent-hook 0) 130(put 'eval-and-compile 'lisp-indent-hook 0)
129(defmacro eval-and-compile (&rest body) 131(defmacro eval-and-compile (&rest body)
130 "Like `progn', but evaluates the body at compile time and at load time." 132 "Like `progn', but evaluates the body at compile time and at load time."
133 (declare (debug t))
131 ;; Remember, it's magic. 134 ;; Remember, it's magic.
132 (cons 'progn body)) 135 (cons 'progn body))
133 136
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 1a290dddc58..5cb8ff7fe32 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1,6 +1,6 @@
1;;; bytecomp.el --- compilation of Lisp code into byte code 1;;; bytecomp.el --- compilation of Lisp code into byte code
2 2
3;; Copyright (C) 1985, 1986, 1987, 1992, 1994, 1998, 2000, 2001, 2002, 2003 3;; Copyright (C) 1985,86,87,92,94,1998,2000,01,02,03,2004
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Jamie Zawinski <jwz@lucid.com> 6;; Author: Jamie Zawinski <jwz@lucid.com>
@@ -10,7 +10,7 @@
10 10
11;;; This version incorporates changes up to version 2.10 of the 11;;; This version incorporates changes up to version 2.10 of the
12;;; Zawinski-Furuseth compiler. 12;;; Zawinski-Furuseth compiler.
13(defconst byte-compile-version "$Revision: 2.143 $") 13(defconst byte-compile-version "$Revision: 2.144 $")
14 14
15;; This file is part of GNU Emacs. 15;; This file is part of GNU Emacs.
16 16
@@ -1493,7 +1493,8 @@ recompile every `.el' file that already has a `.elc' file."
1493 source dest) 1493 source dest)
1494 (dolist (file files) 1494 (dolist (file files)
1495 (setq source (expand-file-name file directory)) 1495 (setq source (expand-file-name file directory))
1496 (if (and (not (member file '("." ".." "RCS" "CVS"))) 1496 (if (and (not (member file '("RCS" "CVS")))
1497 (not (eq ?\. (aref file 0)))
1497 (file-directory-p source) 1498 (file-directory-p source)
1498 (not (file-symlink-p source))) 1499 (not (file-symlink-p source)))
1499 ;; This file is a subdirectory. Handle them differently. 1500 ;; This file is a subdirectory. Handle them differently.
@@ -1611,11 +1612,14 @@ The value is non-nil if there were no errors, nil if errors."
1611 ;; compile this file. 1612 ;; compile this file.
1612 (if (with-current-buffer input-buffer no-byte-compile) 1613 (if (with-current-buffer input-buffer no-byte-compile)
1613 (progn 1614 (progn
1614 (message "%s not compiled because of `no-byte-compile: %s'" 1615 ;; (message "%s not compiled because of `no-byte-compile: %s'"
1615 (file-relative-name filename) 1616 ;; (file-relative-name filename)
1616 (with-current-buffer input-buffer no-byte-compile)) 1617 ;; (with-current-buffer input-buffer no-byte-compile))
1617 (if (file-exists-p target-file) 1618 (when (file-exists-p target-file)
1618 (condition-case nil (delete-file target-file) (error nil))) 1619 (message "%s deleted because of `no-byte-compile: %s'"
1620 (file-relative-name target-file)
1621 (buffer-local-value 'no-byte-compile input-buffer))
1622 (condition-case nil (delete-file target-file) (error nil)))
1619 ;; We successfully didn't compile this file. 1623 ;; We successfully didn't compile this file.
1620 'no-byte-compile) 1624 'no-byte-compile)
1621 (when byte-compile-verbose 1625 (when byte-compile-verbose
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 05f0bb0977d..8e68cb428dc 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -1,6 +1,6 @@
1;;; checkdoc.el --- check documentation strings for style requirements 1;;; checkdoc.el --- check documentation strings for style requirements
2 2
3;;; Copyright (C) 1997, 1998, 2001 Free Software Foundation 3;;; Copyright (C) 1997, 1998, 2001, 2004 Free Software Foundation
4 4
5;; Author: Eric M. Ludlam <zappo@gnu.org> 5;; Author: Eric M. Ludlam <zappo@gnu.org>
6;; Version: 0.6.2 6;; Version: 0.6.2
@@ -2657,7 +2657,7 @@ function called to create the messages."
2657 (setq checkdoc-pending-errors t) 2657 (setq checkdoc-pending-errors t)
2658 (checkdoc-output-to-error-buffer 2658 (checkdoc-output-to-error-buffer
2659 "\n" (checkdoc-buffer-label) ":" 2659 "\n" (checkdoc-buffer-label) ":"
2660 (int-to-string (count-lines (point-min) (or point 1))) ": " 2660 (int-to-string (count-lines (point-min) (or point (point-min)))) ": "
2661 msg)) 2661 msg))
2662 2662
2663(defun checkdoc-output-to-error-buffer (&rest text) 2663(defun checkdoc-output-to-error-buffer (&rest text)
@@ -2692,6 +2692,8 @@ function called to create the messages."
2692 2692
2693(add-to-list 'debug-ignored-errors 2693(add-to-list 'debug-ignored-errors
2694 "Argument `.*' should appear (as .*) in the doc string") 2694 "Argument `.*' should appear (as .*) in the doc string")
2695(add-to-list 'debug-ignored-errors
2696 "Lisp symbol `.*' should appear in quotes")
2695(add-to-list 'debug-ignored-errors "Disambiguate .* by preceding .*") 2697(add-to-list 'debug-ignored-errors "Disambiguate .* by preceding .*")
2696 2698
2697(provide 'checkdoc) 2699(provide 'checkdoc)
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 1ef30a309a3..8a924d045f7 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -1,6 +1,6 @@
1;;; edebug.el --- a source-level debugger for Emacs Lisp 1;;; edebug.el --- a source-level debugger for Emacs Lisp
2 2
3;; Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 97, 1999, 2000, 01, 2003 3;; Copyright (C) 1988,89,90,91,92,93,94,95,97,1999,2000,01,03,2004
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Daniel LaLiberte <liberte@holonexus.org> 6;; Author: Daniel LaLiberte <liberte@holonexus.org>
@@ -2509,6 +2509,11 @@ MSG is printed after `::::} '."
2509 2509
2510 2510
2511(defun edebug-display () 2511(defun edebug-display ()
2512 (unless (marker-position edebug-def-mark)
2513 ;; The buffer holding the source has been killed.
2514 ;; Let's at least show a backtrace so the user can figure out
2515 ;; which function we're talking about.
2516 (debug))
2512 ;; Setup windows for edebug, determine mode, maybe enter recursive-edit. 2517 ;; Setup windows for edebug, determine mode, maybe enter recursive-edit.
2513 ;; Uses local variables of edebug-enter, edebug-before, edebug-after 2518 ;; Uses local variables of edebug-enter, edebug-before, edebug-after
2514 ;; and edebug-debugger. 2519 ;; and edebug-debugger.
@@ -3681,17 +3686,14 @@ Return the result of the last expression."
3681 (edebug-prin1-to-string value))) 3686 (edebug-prin1-to-string value)))
3682 3687
3683(defun edebug-compute-previous-result (edebug-previous-value) 3688(defun edebug-compute-previous-result (edebug-previous-value)
3689 (if edebug-unwrap-results
3690 (setq edebug-previous-value
3691 (edebug-unwrap* edebug-previous-value)))
3684 (setq edebug-previous-result 3692 (setq edebug-previous-result
3685 (if (and (integerp edebug-previous-value) 3693 (concat "Result: "
3686 (< edebug-previous-value 256) 3694 (edebug-safe-prin1-to-string edebug-previous-value)
3687 (>= edebug-previous-value 0)) 3695 (let ((name (prin1-char edebug-previous-value)))
3688 (format "Result: %s = %s" edebug-previous-value 3696 (if name (concat " = " name))))))
3689 (single-key-description edebug-previous-value))
3690 (if edebug-unwrap-results
3691 (setq edebug-previous-value
3692 (edebug-unwrap* edebug-previous-value)))
3693 (concat "Result: "
3694 (edebug-safe-prin1-to-string edebug-previous-value)))))
3695 3697
3696(defun edebug-previous-result () 3698(defun edebug-previous-result ()
3697 "Print the previous result." 3699 "Print the previous result."
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el
index e67835eb82d..671f3c8ce2a 100644
--- a/lisp/emacs-lisp/lisp-mnt.el
+++ b/lisp/emacs-lisp/lisp-mnt.el
@@ -452,14 +452,14 @@ This can be found in an RCS or SCCS header."
452 (if keywords 452 (if keywords
453 (split-string keywords ",?[ \t]")))) 453 (split-string keywords ",?[ \t]"))))
454 454
455(defvar finder-known-keywords)
455(defun lm-keywords-finder-p (&optional file) 456(defun lm-keywords-finder-p (&optional file)
456 "Return non-nil if any keywords in FILE are known to finder." 457 "Return non-nil if any keywords in FILE are known to finder."
457 (require 'finder) 458 (require 'finder)
458 (let ((keys (lm-keywords-list file))) 459 (let ((keys (lm-keywords-list file)))
459 (catch 'keyword-found 460 (catch 'keyword-found
460 (while keys 461 (while keys
461 (if (assoc (intern (car keys)) 462 (if (assoc (intern (car keys)) finder-known-keywords)
462 (with-no-warnings finder-known-keywords))
463 (throw 'keyword-found t)) 463 (throw 'keyword-found t))
464 (setq keys (cdr keys))) 464 (setq keys (cdr keys)))
465 nil))) 465 nil)))
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 6b50318d3e6..853498b0c8c 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -173,8 +173,6 @@
173 ;; because lisp-fill-paragraph should do the job. 173 ;; because lisp-fill-paragraph should do the job.
174 ;; I believe that newcomment's auto-fill code properly deals with it -stef 174 ;; I believe that newcomment's auto-fill code properly deals with it -stef
175 ;;(set (make-local-variable 'adaptive-fill-mode) nil) 175 ;;(set (make-local-variable 'adaptive-fill-mode) nil)
176 (make-local-variable 'normal-auto-fill-function)
177 (setq normal-auto-fill-function 'lisp-mode-auto-fill)
178 (make-local-variable 'indent-line-function) 176 (make-local-variable 'indent-line-function)
179 (setq indent-line-function 'lisp-indent-line) 177 (setq indent-line-function 'lisp-indent-line)
180 (make-local-variable 'indent-region-function) 178 (make-local-variable 'indent-region-function)
@@ -195,8 +193,6 @@
195 (setq comment-add 1) ;default to `;;' in comment-region 193 (setq comment-add 1) ;default to `;;' in comment-region
196 (make-local-variable 'comment-column) 194 (make-local-variable 'comment-column)
197 (setq comment-column 40) 195 (setq comment-column 40)
198 (make-local-variable 'comment-indent-function)
199 (setq comment-indent-function 'lisp-comment-indent)
200 ;; Don't get confused by `;' in doc strings when paragraph-filling. 196 ;; Don't get confused by `;' in doc strings when paragraph-filling.
201 (set (make-local-variable 'comment-use-global-state) t) 197 (set (make-local-variable 'comment-use-global-state) t)
202 (make-local-variable 'imenu-generic-expression) 198 (make-local-variable 'imenu-generic-expression)
@@ -207,14 +203,14 @@
207 (setq font-lock-defaults 203 (setq font-lock-defaults
208 '((lisp-font-lock-keywords 204 '((lisp-font-lock-keywords
209 lisp-font-lock-keywords-1 lisp-font-lock-keywords-2) 205 lisp-font-lock-keywords-1 lisp-font-lock-keywords-2)
210 nil nil (("+-*/.<>=!?$%_&~^:" . "w")) beginning-of-defun 206 nil nil (("+-*/.<>=!?$%_&~^:" . "w")) nil
211 (font-lock-mark-block-function . mark-defun) 207 (font-lock-mark-block-function . mark-defun)
212 (font-lock-syntactic-face-function 208 (font-lock-syntactic-face-function
213 . lisp-font-lock-syntactic-face-function)))) 209 . lisp-font-lock-syntactic-face-function))))
214 210
215(defun lisp-outline-level () 211(defun lisp-outline-level ()
216 "Lisp mode `outline-level' function." 212 "Lisp mode `outline-level' function."
217 (if (looking-at "(") 213 (if (looking-at "(\\|;;;###autoload")
218 1000 214 1000
219 (looking-at outline-regexp) 215 (looking-at outline-regexp)
220 (- (match-end 0) (match-beginning 0)))) 216 (- (match-end 0) (match-beginning 0))))
@@ -453,14 +449,18 @@ alternative printed representations that can be displayed."
453If CHAR is not a character, return nil." 449If CHAR is not a character, return nil."
454 (and (integerp char) 450 (and (integerp char)
455 (char-valid-p (event-basic-type char)) 451 (char-valid-p (event-basic-type char))
456 (concat 452 (let ((c (event-basic-type char)))
457 "?" 453 (concat
458 (mapconcat 454 "?"
459 (lambda (modif) 455 (mapconcat
460 (cond ((eq modif 'super) "\\s-") 456 (lambda (modif)
461 (t (string ?\\ (upcase (aref (symbol-name modif) 0)) ?-)))) 457 (cond ((eq modif 'super) "\\s-")
462 (event-modifiers char) "") 458 (t (string ?\\ (upcase (aref (symbol-name modif) 0)) ?-))))
463 (string (event-basic-type char))))) 459 (event-modifiers char) "")
460 (cond
461 ((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c))
462 ((eq c 127) "\\C-?")
463 (t (string c)))))))
464 464
465(defun eval-last-sexp-1 (eval-last-sexp-arg-internal) 465(defun eval-last-sexp-1 (eval-last-sexp-arg-internal)
466 "Evaluate sexp before point; print value in minibuffer. 466 "Evaluate sexp before point; print value in minibuffer.
@@ -671,8 +671,8 @@ which see."
671;; This function just forces a more costly detection of comments (using 671;; This function just forces a more costly detection of comments (using
672;; parse-partial-sexp from beginning-of-defun). I.e. It avoids the problem of 672;; parse-partial-sexp from beginning-of-defun). I.e. It avoids the problem of
673;; taking a `;' inside a string started on another line for a comment starter. 673;; taking a `;' inside a string started on another line for a comment starter.
674;; Note: `newcomment' gets it right in 99% of the cases if you're using 674;; Note: `newcomment' gets it right now since we set comment-use-global-state
675;; font-lock, anyway, so we could get rid of it. -stef 675;; so we could get rid of it. -stef
676(defun lisp-mode-auto-fill () 676(defun lisp-mode-auto-fill ()
677 (if (> (current-column) (current-fill-column)) 677 (if (> (current-column) (current-fill-column))
678 (if (save-excursion 678 (if (save-excursion
diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el
index 85ec7dbae78..c93868859f0 100644
--- a/lisp/emacs-lisp/pp.el
+++ b/lisp/emacs-lisp/pp.el
@@ -1,6 +1,6 @@
1;;; pp.el --- pretty printer for Emacs Lisp 1;;; pp.el --- pretty printer for Emacs Lisp
2 2
3;; Copyright (C) 1989, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1989, 1993, 2001, 2004 Free Software Foundation, Inc.
4 4
5;; Author: Randal Schwartz <merlyn@stonehenge.com> 5;; Author: Randal Schwartz <merlyn@stonehenge.com>
6;; Keywords: lisp 6;; Keywords: lisp
@@ -120,12 +120,10 @@ in the variable `values'."
120 (message "%s" (buffer-substring (point-min) (point))) 120 (message "%s" (buffer-substring (point-min) (point)))
121 )))))) 121 ))))))
122 (with-output-to-temp-buffer "*Pp Eval Output*" 122 (with-output-to-temp-buffer "*Pp Eval Output*"
123 (pp (car values))) 123 (pp (car values))
124 (save-excursion 124 (with-current-buffer standard-output
125 (set-buffer "*Pp Eval Output*") 125 (emacs-lisp-mode)
126 (emacs-lisp-mode) 126 (set (make-local-variable 'font-lock-verbose) nil)))))
127 (make-local-variable 'font-lock-verbose)
128 (setq font-lock-verbose nil))))
129 127
130;;;###autoload 128;;;###autoload
131(defun pp-eval-last-sexp (arg) 129(defun pp-eval-last-sexp (arg)
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index 86673441fe7..b94ac57eca1 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -1,6 +1,6 @@
1;;; rx.el --- sexp notation for regular expressions 1;;; rx.el --- sexp notation for regular expressions
2 2
3;; Copyright (C) 2001 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 03, 2004 Free Software Foundation, Inc.
4 4
5;; Author: Gerd Moellmann <gerd@gnu.org> 5;; Author: Gerd Moellmann <gerd@gnu.org>
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -799,14 +799,17 @@ CHAR
799`(repeat N M SEXP)' 799`(repeat N M SEXP)'
800 matches N to M occurrences of what SEXP matches. 800 matches N to M occurrences of what SEXP matches.
801 801
802`(backref N)'
803 matches what was matched previously by submatch N.
804
802`(eval FORM)' 805`(eval FORM)'
803 evaluate FORM and insert result. If result is a string, 806 evaluate FORM and insert result. If result is a string,
804 `regexp-quote' it. 807 `regexp-quote' it.
805 808
806`(regexp REGEXP)' 809`(regexp REGEXP)'
807 include REGEXP in string notation in the result." 810 include REGEXP in string notation in the result."
808 811
809 `(rx-to-string ',regexp)) 812 (rx-to-string regexp))
810 813
811 814
812(provide 'rx) 815(provide 'rx)
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index ff6d074fd1f..e2bf813f9ce 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -25,7 +25,7 @@
25;;; Commentary: 25;;; Commentary:
26 26
27;; This file implements the entry points `warn', `lwarn' 27;; This file implements the entry points `warn', `lwarn'
28;; and `display-warnings'. 28;; and `display-warning'.
29 29
30;;; Code: 30;;; Code:
31 31
diff --git a/lisp/files.el b/lisp/files.el
index a63aea99114..15f0f5e5179 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4205,14 +4205,20 @@ program specified by `directory-free-space-program' if that is non-nil."
4205(defun insert-directory (file switches &optional wildcard full-directory-p) 4205(defun insert-directory (file switches &optional wildcard full-directory-p)
4206 "Insert directory listing for FILE, formatted according to SWITCHES. 4206 "Insert directory listing for FILE, formatted according to SWITCHES.
4207Leaves point after the inserted text. 4207Leaves point after the inserted text.
4208SWITCHES may be a string of options, or a list of strings. 4208SWITCHES may be a string of options, or a list of strings
4209representing individual options.
4209Optional third arg WILDCARD means treat FILE as shell wildcard. 4210Optional third arg WILDCARD means treat FILE as shell wildcard.
4210Optional fourth arg FULL-DIRECTORY-P means file is a directory and 4211Optional fourth arg FULL-DIRECTORY-P means file is a directory and
4211switches do not contain `d', so that a full listing is expected. 4212switches do not contain `d', so that a full listing is expected.
4212 4213
4213This works by running a directory listing program 4214This works by running a directory listing program
4214whose name is in the variable `insert-directory-program'. 4215whose name is in the variable `insert-directory-program'.
4215If WILDCARD, it also runs the shell specified by `shell-file-name'." 4216If WILDCARD, it also runs the shell specified by `shell-file-name'.
4217
4218When SWITCHES contains the long `--dired' option,this function
4219treats it specially, for the sake of dired. However, the
4220normally equivalent short `-D' option is just passed on to
4221`insert-directory-program', as any other option."
4216 ;; We need the directory in order to find the right handler. 4222 ;; We need the directory in order to find the right handler.
4217 (let ((handler (find-file-name-handler (expand-file-name file) 4223 (let ((handler (find-file-name-handler (expand-file-name file)
4218 'insert-directory))) 4224 'insert-directory)))
@@ -4301,7 +4307,9 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'."
4301 (access-file file "Reading directory") 4307 (access-file file "Reading directory")
4302 (error "Listing directory failed but `access-file' worked"))) 4308 (error "Listing directory failed but `access-file' worked")))
4303 4309
4304 (when (string-match "--dired\\>" switches) 4310 (when (if (stringp switches)
4311 (string-match "--dired\\>" switches)
4312 (member "--dired" switches))
4305 (forward-line -2) 4313 (forward-line -2)
4306 (when (looking-at "//SUBDIRED//") 4314 (when (looking-at "//SUBDIRED//")
4307 (delete-region (point) (progn (forward-line 1) (point))) 4315 (delete-region (point) (progn (forward-line 1) (point)))
diff --git a/lisp/finder.el b/lisp/finder.el
index 0bd001752fe..40629cab6af 100644
--- a/lisp/finder.el
+++ b/lisp/finder.el
@@ -61,7 +61,7 @@
61 (calendar . "calendar and time management support") 61 (calendar . "calendar and time management support")
62 (comm . "communications, networking, remote access to files") 62 (comm . "communications, networking, remote access to files")
63 (convenience . "convenience features for faster editing") 63 (convenience . "convenience features for faster editing")
64 (data . "support editing files of data") 64 (data . "support for editing files of data")
65 (docs . "support for Emacs documentation") 65 (docs . "support for Emacs documentation")
66 (emulations . "emulations of other editors") 66 (emulations . "emulations of other editors")
67 (extensions . "Emacs Lisp language extensions") 67 (extensions . "Emacs Lisp language extensions")
@@ -87,9 +87,9 @@
87 (outlines . "support for hierarchical outlining") 87 (outlines . "support for hierarchical outlining")
88 (processes . "process, subshell, compilation, and job control support") 88 (processes . "process, subshell, compilation, and job control support")
89 (terminals . "support for terminal types") 89 (terminals . "support for terminal types")
90 (tex . "code related to the TeX formatter") 90 (tex . "supporting code for the TeX formatter")
91 (tools . "programming tools") 91 (tools . "programming tools")
92 (unix . "front-ends/assistants for, or emulators of, UNIX features") 92 (unix . "front-ends/assistants for, or emulators of, UNIX-like features")
93;; Not a custom group and not currently useful. 93;; Not a custom group and not currently useful.
94;; (vms . "support code for vms") 94;; (vms . "support code for vms")
95 (wp . "word processing") 95 (wp . "word processing")
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index ad69cdd960c..11d9ba756f1 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -228,13 +228,11 @@
228;; Define support mode groups here to impose `font-lock' group order. 228;; Define support mode groups here to impose `font-lock' group order.
229(defgroup fast-lock nil 229(defgroup fast-lock nil
230 "Font Lock support mode to cache fontification." 230 "Font Lock support mode to cache fontification."
231 :link '(custom-manual "(emacs)Support Modes")
232 :load 'fast-lock 231 :load 'fast-lock
233 :group 'font-lock) 232 :group 'font-lock)
234 233
235(defgroup lazy-lock nil 234(defgroup lazy-lock nil
236 "Font Lock support mode to fontify lazily." 235 "Font Lock support mode to fontify lazily."
237 :link '(custom-manual "(emacs)Support Modes")
238 :load 'lazy-lock 236 :load 'lazy-lock
239 :group 'font-lock) 237 :group 'font-lock)
240 238
diff --git a/lisp/format.el b/lisp/format.el
index 90047e98a6c..09d3e5fa715 100644
--- a/lisp/format.el
+++ b/lisp/format.el
@@ -416,7 +416,7 @@ The optional third and fourth arguments BEG and END specify
416the part of the file to read. 416the part of the file to read.
417 417
418The return value is like the value of `insert-file-contents': 418The return value is like the value of `insert-file-contents':
419a list (ABSOLUTE-FILE-NAME . SIZE)." 419a list (ABSOLUTE-FILE-NAME SIZE)."
420 (interactive 420 (interactive
421 ;; Same interactive spec as write-file, plus format question. 421 ;; Same interactive spec as write-file, plus format question.
422 (let* ((file (read-file-name "Find file: ")) 422 (let* ((file (read-file-name "Find file: "))
@@ -429,7 +429,7 @@ a list (ABSOLUTE-FILE-NAME . SIZE)."
429 (setq size (nth 1 value))) 429 (setq size (nth 1 value)))
430 (if format 430 (if format
431 (setq size (format-decode format size) 431 (setq size (format-decode format size)
432 value (cons (car value) size))) 432 value (list (car value) size)))
433 value)) 433 value))
434 434
435(defun format-read (&optional prompt) 435(defun format-read (&optional prompt)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 43be1e84e43..0673b44bc1e 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,16 @@
12004-03-22 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * gnus-art.el: Use inhibit-read-only instead of buffer-read-only.
4 (gnus-narrow-to-page): Don't assume point-min == 1.
5 (gnus-article-edit-mode): Derive from message-mode.
6 (gnus-button-alist): Add buttons to (info "(emacs)Keymaps").
7
8 * gnus-score.el (gnus-score-find-bnews): Simplify and don't assume
9 point-min == 1.
10
11 * imap.el (imap-parse-address-list, imap-parse-body-ext):
12 Disable incorrect use of `assert'.
13
12004-03-05 Stefan Monnier <monnier@iro.umontreal.ca> 142004-03-05 Stefan Monnier <monnier@iro.umontreal.ca>
2 15
3 * message.el (message-mode): Fix last change. 16 * message.el (message-mode): Fix last change.
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 0a9920c0387..5f0487968f6 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -1,6 +1,6 @@
1;;; gnus-art.el --- article mode commands for Gnus 1;;; gnus-art.el --- article mode commands for Gnus
2 2
3;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 3;; Copyright (C) 1996, 97, 98, 1999, 2000, 01, 02, 2004
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> 6;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -1142,7 +1142,7 @@ Initialized from `text-mode-syntax-table.")
1142 (unless gnus-inhibit-hiding 1142 (unless gnus-inhibit-hiding
1143 (save-excursion 1143 (save-excursion
1144 (save-restriction 1144 (save-restriction
1145 (let ((buffer-read-only nil) 1145 (let ((inhibit-read-only t)
1146 (case-fold-search t) 1146 (case-fold-search t)
1147 (max (1+ (length gnus-sorted-header-list))) 1147 (max (1+ (length gnus-sorted-header-list)))
1148 (ignored (when (not gnus-visible-headers) 1148 (ignored (when (not gnus-visible-headers)
@@ -1200,7 +1200,7 @@ always hide."
1200 (not gnus-show-all-headers)) 1200 (not gnus-show-all-headers))
1201 (save-excursion 1201 (save-excursion
1202 (save-restriction 1202 (save-restriction
1203 (let ((buffer-read-only nil) 1203 (let ((inhibit-read-only t)
1204 (list gnus-boring-article-headers) 1204 (list gnus-boring-article-headers)
1205 (inhibit-point-motion-hooks t) 1205 (inhibit-point-motion-hooks t)
1206 elem) 1206 elem)
@@ -1303,7 +1303,7 @@ always hide."
1303(defun article-normalize-headers () 1303(defun article-normalize-headers ()
1304 "Make all header lines 40 characters long." 1304 "Make all header lines 40 characters long."
1305 (interactive) 1305 (interactive)
1306 (let ((buffer-read-only nil) 1306 (let ((inhibit-read-only t)
1307 column) 1307 column)
1308 (save-excursion 1308 (save-excursion
1309 (save-restriction 1309 (save-restriction
@@ -1346,7 +1346,7 @@ FROM is a string of characters to translate from; to is a string of
1346characters to translate to." 1346characters to translate to."
1347 (save-excursion 1347 (save-excursion
1348 (when (article-goto-body) 1348 (when (article-goto-body)
1349 (let ((buffer-read-only nil) 1349 (let ((inhibit-read-only t)
1350 (x (make-string 225 ?x)) 1350 (x (make-string 225 ?x))
1351 (i -1)) 1351 (i -1))
1352 (while (< (incf i) (length x)) 1352 (while (< (incf i) (length x))
@@ -1362,7 +1362,7 @@ characters to translate to."
1362MAP is an alist where the elements are on the form (\"from\" \"to\")." 1362MAP is an alist where the elements are on the form (\"from\" \"to\")."
1363 (save-excursion 1363 (save-excursion
1364 (when (article-goto-body) 1364 (when (article-goto-body)
1365 (let ((buffer-read-only nil) 1365 (let ((inhibit-read-only t)
1366 elem) 1366 elem)
1367 (while (setq elem (pop map)) 1367 (while (setq elem (pop map))
1368 (save-excursion 1368 (save-excursion
@@ -1374,7 +1374,7 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")."
1374 (interactive) 1374 (interactive)
1375 (save-excursion 1375 (save-excursion
1376 (when (article-goto-body) 1376 (when (article-goto-body)
1377 (let ((buffer-read-only nil)) 1377 (let ((inhibit-read-only t))
1378 (while (search-forward "\b" nil t) 1378 (while (search-forward "\b" nil t)
1379 (let ((next (char-after)) 1379 (let ((next (char-after))
1380 (previous (char-after (- (point) 2)))) 1380 (previous (char-after (- (point) 2))))
@@ -1399,7 +1399,7 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")."
1399 "Fill lines that are wider than the window width." 1399 "Fill lines that are wider than the window width."
1400 (interactive) 1400 (interactive)
1401 (save-excursion 1401 (save-excursion
1402 (let ((buffer-read-only nil) 1402 (let ((inhibit-read-only t)
1403 (width (window-width (get-buffer-window (current-buffer))))) 1403 (width (window-width (get-buffer-window (current-buffer)))))
1404 (save-restriction 1404 (save-restriction
1405 (article-goto-body) 1405 (article-goto-body)
@@ -1417,7 +1417,7 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")."
1417 "Capitalize the first word in each sentence." 1417 "Capitalize the first word in each sentence."
1418 (interactive) 1418 (interactive)
1419 (save-excursion 1419 (save-excursion
1420 (let ((buffer-read-only nil) 1420 (let ((inhibit-read-only t)
1421 (paragraph-start "^[\n\^L]")) 1421 (paragraph-start "^[\n\^L]"))
1422 (article-goto-body) 1422 (article-goto-body)
1423 (while (not (eobp)) 1423 (while (not (eobp))
@@ -1428,7 +1428,7 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")."
1428 "Remove trailing CRs and then translate remaining CRs into LFs." 1428 "Remove trailing CRs and then translate remaining CRs into LFs."
1429 (interactive) 1429 (interactive)
1430 (save-excursion 1430 (save-excursion
1431 (let ((buffer-read-only nil)) 1431 (let ((inhibit-read-only t))
1432 (goto-char (point-min)) 1432 (goto-char (point-min))
1433 (while (re-search-forward "\r+$" nil t) 1433 (while (re-search-forward "\r+$" nil t)
1434 (replace-match "" t t)) 1434 (replace-match "" t t))
@@ -1440,7 +1440,7 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")."
1440 "Remove all trailing blank lines from the article." 1440 "Remove all trailing blank lines from the article."
1441 (interactive) 1441 (interactive)
1442 (save-excursion 1442 (save-excursion
1443 (let ((buffer-read-only nil)) 1443 (let ((inhibit-read-only t))
1444 (goto-char (point-max)) 1444 (goto-char (point-max))
1445 (delete-region 1445 (delete-region
1446 (point) 1446 (point)
@@ -1583,7 +1583,7 @@ If FORCE, decode the article whether it is marked as quoted-printable
1583or not." 1583or not."
1584 (interactive (list 'force)) 1584 (interactive (list 'force))
1585 (save-excursion 1585 (save-excursion
1586 (let ((buffer-read-only nil) type charset) 1586 (let ((inhibit-read-only t) type charset)
1587 (if (gnus-buffer-live-p gnus-original-article-buffer) 1587 (if (gnus-buffer-live-p gnus-original-article-buffer)
1588 (with-current-buffer gnus-original-article-buffer 1588 (with-current-buffer gnus-original-article-buffer
1589 (setq type 1589 (setq type
@@ -1610,7 +1610,7 @@ or not."
1610If FORCE, decode the article whether it is marked as base64 not." 1610If FORCE, decode the article whether it is marked as base64 not."
1611 (interactive (list 'force)) 1611 (interactive (list 'force))
1612 (save-excursion 1612 (save-excursion
1613 (let ((buffer-read-only nil) type charset) 1613 (let ((inhibit-read-only t) type charset)
1614 (if (gnus-buffer-live-p gnus-original-article-buffer) 1614 (if (gnus-buffer-live-p gnus-original-article-buffer)
1615 (with-current-buffer gnus-original-article-buffer 1615 (with-current-buffer gnus-original-article-buffer
1616 (setq type 1616 (setq type
@@ -1643,14 +1643,14 @@ If FORCE, decode the article whether it is marked as base64 not."
1643 (interactive) 1643 (interactive)
1644 (require 'rfc1843) 1644 (require 'rfc1843)
1645 (save-excursion 1645 (save-excursion
1646 (let ((buffer-read-only nil)) 1646 (let ((inhibit-read-only t))
1647 (rfc1843-decode-region (point-min) (point-max))))) 1647 (rfc1843-decode-region (point-min) (point-max)))))
1648 1648
1649(defun article-wash-html () 1649(defun article-wash-html ()
1650 "Format an html article." 1650 "Format an html article."
1651 (interactive) 1651 (interactive)
1652 (save-excursion 1652 (save-excursion
1653 (let ((buffer-read-only nil) 1653 (let ((inhibit-read-only t)
1654 charset) 1654 charset)
1655 (if (gnus-buffer-live-p gnus-original-article-buffer) 1655 (if (gnus-buffer-live-p gnus-original-article-buffer)
1656 (with-current-buffer gnus-original-article-buffer 1656 (with-current-buffer gnus-original-article-buffer
@@ -1794,7 +1794,7 @@ always hide."
1794 (save-excursion 1794 (save-excursion
1795 (set-buffer gnus-article-buffer) 1795 (set-buffer gnus-article-buffer)
1796 (when (article-goto-body) 1796 (when (article-goto-body)
1797 (let* ((buffer-read-only nil) 1797 (let* ((inhibit-read-only t)
1798 (start (point)) 1798 (start (point))
1799 (end (point-max)) 1799 (end (point-max))
1800 (orig (buffer-substring start end)) 1800 (orig (buffer-substring start end))
@@ -1812,7 +1812,7 @@ always hide."
1812 (unless (gnus-article-check-hidden-text 'signature arg) 1812 (unless (gnus-article-check-hidden-text 'signature arg)
1813 (save-excursion 1813 (save-excursion
1814 (save-restriction 1814 (save-restriction
1815 (let ((buffer-read-only nil)) 1815 (let ((inhibit-read-only t))
1816 (when (gnus-article-narrow-to-signature) 1816 (when (gnus-article-narrow-to-signature)
1817 (gnus-article-hide-text-type 1817 (gnus-article-hide-text-type
1818 (point-min) (point-max) 'signature))))))) 1818 (point-min) (point-max) 'signature)))))))
@@ -2001,7 +2001,7 @@ means show, 0 means toggle."
2001(defun gnus-article-show-hidden-text (type &optional dummy) 2001(defun gnus-article-show-hidden-text (type &optional dummy)
2002 "Show all hidden text of type TYPE. 2002 "Show all hidden text of type TYPE.
2003Originally it is hide instead of DUMMY." 2003Originally it is hide instead of DUMMY."
2004 (let ((buffer-read-only nil) 2004 (let ((inhibit-read-only t)
2005 (inhibit-point-motion-hooks t)) 2005 (inhibit-point-motion-hooks t))
2006 (gnus-remove-text-properties-when 2006 (gnus-remove-text-properties-when
2007 'article-type type 2007 'article-type type
@@ -2054,7 +2054,7 @@ should replace the \"Date:\" one, or should be added below it."
2054 (forward-line 1)) 2054 (forward-line 1))
2055 (when (and date (not (string= date ""))) 2055 (when (and date (not (string= date "")))
2056 (goto-char (point-min)) 2056 (goto-char (point-min))
2057 (let ((buffer-read-only nil)) 2057 (let ((inhibit-read-only t))
2058 ;; Delete any old Date headers. 2058 ;; Delete any old Date headers.
2059 (while (re-search-forward date-regexp nil t) 2059 (while (re-search-forward date-regexp nil t)
2060 (if pos 2060 (if pos
@@ -2238,7 +2238,7 @@ This format is defined by the `gnus-article-time-format' variable."
2238 "Show all hidden text in the article buffer." 2238 "Show all hidden text in the article buffer."
2239 (interactive) 2239 (interactive)
2240 (save-excursion 2240 (save-excursion
2241 (let ((buffer-read-only nil)) 2241 (let ((inhibit-read-only t))
2242 (gnus-article-unhide-text (point-min) (point-max))))) 2242 (gnus-article-unhide-text (point-min) (point-max)))))
2243 2243
2244(defun article-emphasize (&optional arg) 2244(defun article-emphasize (&optional arg)
@@ -2252,7 +2252,7 @@ This format is defined by the `gnus-article-time-format' variable."
2252 gnus-article-emphasis-alist) 2252 gnus-article-emphasis-alist)
2253 (error)) 2253 (error))
2254 gnus-emphasis-alist)) 2254 gnus-emphasis-alist))
2255 (buffer-read-only nil) 2255 (inhibit-read-only t)
2256 (props (append '(article-type emphasis) 2256 (props (append '(article-type emphasis)
2257 gnus-hidden-properties)) 2257 gnus-hidden-properties))
2258 regexp elem beg invisible visible face) 2258 regexp elem beg invisible visible face)
@@ -2837,7 +2837,7 @@ If ALL-HEADERS is non-nil, no headers are hidden."
2837 (when (and (boundp 'transient-mark-mode) 2837 (when (and (boundp 'transient-mark-mode)
2838 transient-mark-mode) 2838 transient-mark-mode)
2839 (setq mark-active nil)) 2839 (setq mark-active nil))
2840 (if (not (setq result (let ((buffer-read-only nil)) 2840 (if (not (setq result (let ((inhibit-read-only t))
2841 (gnus-request-article-this-buffer 2841 (gnus-request-article-this-buffer
2842 article group)))) 2842 article group))))
2843 ;; There is no such article. 2843 ;; There is no such article.
@@ -3671,7 +3671,7 @@ If given a numerical ARG, move forward ARG pages."
3671 (widen) 3671 (widen)
3672 ;; Remove any old next/prev buttons. 3672 ;; Remove any old next/prev buttons.
3673 (when (gnus-visual-p 'page-marker) 3673 (when (gnus-visual-p 'page-marker)
3674 (let ((buffer-read-only nil)) 3674 (let ((inhibit-read-only t))
3675 (gnus-remove-text-with-property 'gnus-prev) 3675 (gnus-remove-text-with-property 'gnus-prev)
3676 (gnus-remove-text-with-property 'gnus-next))) 3676 (gnus-remove-text-with-property 'gnus-next)))
3677 (when 3677 (when
@@ -3686,12 +3686,12 @@ If given a numerical ARG, move forward ARG pages."
3686 (match-beginning 0) 3686 (match-beginning 0)
3687 (point))) 3687 (point)))
3688 (when (and (gnus-visual-p 'page-marker) 3688 (when (and (gnus-visual-p 'page-marker)
3689 (not (= (point-min) 1))) 3689 (> (point-min) (save-restriction (widen) (point-min))))
3690 (save-excursion 3690 (save-excursion
3691 (goto-char (point-min)) 3691 (goto-char (point-min))
3692 (gnus-insert-prev-page-button))) 3692 (gnus-insert-prev-page-button)))
3693 (when (and (gnus-visual-p 'page-marker) 3693 (when (and (gnus-visual-p 'page-marker)
3694 (< (+ (point-max) 2) (buffer-size))) 3694 (< (point-max) (save-restriction (widen) (point-max))))
3695 (save-excursion 3695 (save-excursion
3696 (goto-char (point-max)) 3696 (goto-char (point-max))
3697 (gnus-insert-next-page-button))))) 3697 (gnus-insert-next-page-button)))))
@@ -4044,7 +4044,7 @@ If given a prefix, show the hidden text instead."
4044 (methods (and (stringp article) 4044 (methods (and (stringp article)
4045 gnus-refer-article-method)) 4045 gnus-refer-article-method))
4046 result 4046 result
4047 (buffer-read-only nil)) 4047 (inhibit-read-only t))
4048 (if (or (not (listp methods)) 4048 (if (or (not (listp methods))
4049 (and (symbolp (car methods)) 4049 (and (symbolp (car methods))
4050 (assq (car methods) nnoo-definition-alist))) 4050 (assq (car methods) nnoo-definition-alist)))
@@ -4140,7 +4140,7 @@ If given a prefix, show the hidden text instead."
4140 "\C-c\C-w" gnus-article-edit-mode-map) 4140 "\C-c\C-w" gnus-article-edit-mode-map)
4141 "f" gnus-article-edit-full-stops)) 4141 "f" gnus-article-edit-full-stops))
4142 4142
4143(define-derived-mode gnus-article-edit-mode text-mode "Article Edit" 4143(define-derived-mode gnus-article-edit-mode message-mode "Article Edit"
4144 "Major mode for editing articles. 4144 "Major mode for editing articles.
4145This is an extended text-mode. 4145This is an extended text-mode.
4146 4146
@@ -4212,7 +4212,7 @@ groups."
4212 (gnus-article-edit-exit) 4212 (gnus-article-edit-exit)
4213 (save-excursion 4213 (save-excursion
4214 (set-buffer buf) 4214 (set-buffer buf)
4215 (let ((buffer-read-only nil)) 4215 (let ((inhibit-read-only t))
4216 (funcall func arg)) 4216 (funcall func arg))
4217 ;; The cache and backlog have to be flushed somewhat. 4217 ;; The cache and backlog have to be flushed somewhat.
4218 (when gnus-keep-backlog 4218 (when gnus-keep-backlog
@@ -4289,6 +4289,9 @@ groups."
4289 ("\\bmailto:\\([^ \n\t]+\\)" 0 t gnus-url-mailto 1) 4289 ("\\bmailto:\\([^ \n\t]+\\)" 0 t gnus-url-mailto 1)
4290 ;; This is how URLs _should_ be embedded in text... 4290 ;; This is how URLs _should_ be embedded in text...
4291 ("<URL: *\\([^<>]*\\)>" 0 t gnus-button-embedded-url 1) 4291 ("<URL: *\\([^<>]*\\)>" 0 t gnus-button-embedded-url 1)
4292 ;; Info manual references.
4293 ("(\\(info\\|Info-goto-node\\)[ \n\t]+\"\\(([^)\"\n]+)[^\"\n]+\\)\")"
4294 0 t Info-goto-node 2)
4292 ;; Raw URLs. 4295 ;; Raw URLs.
4293 (,gnus-button-url-regexp 0 t browse-url 0)) 4296 (,gnus-button-url-regexp 0 t browse-url 0))
4294 "*Alist of regexps matching buttons in article bodies. 4297 "*Alist of regexps matching buttons in article bodies.
@@ -4296,7 +4299,7 @@ groups."
4296Each entry has the form (REGEXP BUTTON FORM CALLBACK PAR...), where 4299Each entry has the form (REGEXP BUTTON FORM CALLBACK PAR...), where
4297REGEXP: is the string matching text around the button, 4300REGEXP: is the string matching text around the button,
4298BUTTON: is the number of the regexp grouping actually matching the button, 4301BUTTON: is the number of the regexp grouping actually matching the button,
4299FORM: is a lisp expression which must eval to true for the button to 4302FORM: is a Lisp expression which must eval to true for the button to
4300be added, 4303be added,
4301CALLBACK: is the function to call when the user push this button, and each 4304CALLBACK: is the function to call when the user push this button, and each
4302PAR: is a number of a regexp grouping whose text will be passed to CALLBACK. 4305PAR: is a number of a regexp grouping whose text will be passed to CALLBACK.
@@ -4405,7 +4408,7 @@ do the highlighting. See the documentation for those functions."
4405 (set-buffer gnus-article-buffer) 4408 (set-buffer gnus-article-buffer)
4406 (save-restriction 4409 (save-restriction
4407 (let ((alist gnus-header-face-alist) 4410 (let ((alist gnus-header-face-alist)
4408 (buffer-read-only nil) 4411 (inhibit-read-only t)
4409 (case-fold-search t) 4412 (case-fold-search t)
4410 (inhibit-point-motion-hooks t) 4413 (inhibit-point-motion-hooks t)
4411 entry regexp header-face field-face from hpoints fpoints) 4414 entry regexp header-face field-face from hpoints fpoints)
@@ -4444,7 +4447,7 @@ It does this by highlighting everything after
4444 (interactive) 4447 (interactive)
4445 (save-excursion 4448 (save-excursion
4446 (set-buffer gnus-article-buffer) 4449 (set-buffer gnus-article-buffer)
4447 (let ((buffer-read-only nil) 4450 (let ((inhibit-read-only t)
4448 (inhibit-point-motion-hooks t)) 4451 (inhibit-point-motion-hooks t))
4449 (save-restriction 4452 (save-restriction
4450 (when (and gnus-signature-face 4453 (when (and gnus-signature-face
@@ -4469,7 +4472,7 @@ specified by `gnus-button-alist'."
4469 (interactive (list 'force)) 4472 (interactive (list 'force))
4470 (save-excursion 4473 (save-excursion
4471 (set-buffer gnus-article-buffer) 4474 (set-buffer gnus-article-buffer)
4472 (let ((buffer-read-only nil) 4475 (let ((inhibit-read-only t)
4473 (inhibit-point-motion-hooks t) 4476 (inhibit-point-motion-hooks t)
4474 (case-fold-search t) 4477 (case-fold-search t)
4475 (alist gnus-button-alist) 4478 (alist gnus-button-alist)
@@ -4514,7 +4517,7 @@ specified by `gnus-button-alist'."
4514 (save-excursion 4517 (save-excursion
4515 (set-buffer gnus-article-buffer) 4518 (set-buffer gnus-article-buffer)
4516 (save-restriction 4519 (save-restriction
4517 (let ((buffer-read-only nil) 4520 (let ((inhibit-read-only t)
4518 (inhibit-point-motion-hooks t) 4521 (inhibit-point-motion-hooks t)
4519 (case-fold-search t) 4522 (case-fold-search t)
4520 (alist gnus-header-button-alist) 4523 (alist gnus-header-button-alist)
@@ -4572,7 +4575,7 @@ specified by `gnus-button-alist'."
4572(defun gnus-signature-toggle (end) 4575(defun gnus-signature-toggle (end)
4573 (save-excursion 4576 (save-excursion
4574 (set-buffer gnus-article-buffer) 4577 (set-buffer gnus-article-buffer)
4575 (let ((buffer-read-only nil) 4578 (let ((inhibit-read-only t)
4576 (inhibit-point-motion-hooks t)) 4579 (inhibit-point-motion-hooks t))
4577 (if (text-property-any end (point-max) 'article-type 'signature) 4580 (if (text-property-any end (point-max) 'article-type 'signature)
4578 (gnus-remove-text-properties-when 4581 (gnus-remove-text-properties-when
@@ -4737,7 +4740,7 @@ forbidden in URL encoding."
4737 (define-key gnus-prev-page-map "\r" 'gnus-button-prev-page)) 4740 (define-key gnus-prev-page-map "\r" 'gnus-button-prev-page))
4738 4741
4739(defun gnus-insert-prev-page-button () 4742(defun gnus-insert-prev-page-button ()
4740 (let ((buffer-read-only nil)) 4743 (let ((inhibit-read-only t))
4741 (gnus-eval-format 4744 (gnus-eval-format
4742 gnus-prev-page-line-format nil 4745 gnus-prev-page-line-format nil
4743 `(gnus-prev t local-map ,gnus-prev-page-map 4746 `(gnus-prev t local-map ,gnus-prev-page-map
@@ -4768,7 +4771,7 @@ forbidden in URL encoding."
4768 (select-window win))) 4771 (select-window win)))
4769 4772
4770(defun gnus-insert-next-page-button () 4773(defun gnus-insert-next-page-button ()
4771 (let ((buffer-read-only nil)) 4774 (let ((inhibit-read-only t))
4772 (gnus-eval-format gnus-next-page-line-format nil 4775 (gnus-eval-format gnus-next-page-line-format nil
4773 `(gnus-next 4776 `(gnus-next
4774 t local-map ,gnus-next-page-map 4777 t local-map ,gnus-next-page-map
@@ -4796,8 +4799,8 @@ forbidden in URL encoding."
4796 "List of methods used to decode headers. 4799 "List of methods used to decode headers.
4797 4800
4798This variable is a list of FUNCTION or (REGEXP . FUNCTION). If item 4801This variable is a list of FUNCTION or (REGEXP . FUNCTION). If item
4799is FUNCTION, FUNCTION will be apply to all newsgroups. If item is a 4802is FUNCTION, FUNCTION will be applied to all newsgroups. If item is a
4800\(REGEXP . FUNCTION), FUNCTION will be only apply to these newsgroups 4803\(REGEXP . FUNCTION), FUNCTION will be only applied to these newsgroups
4801whose names match REGEXP. 4804whose names match REGEXP.
4802 4805
4803For example: 4806For example:
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index 0623d1bd8f1..91035d89f2e 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -2586,13 +2586,11 @@ GROUP using BNews sys file syntax."
2586 (replace-match ".*" t t)) 2586 (replace-match ".*" t t))
2587 (goto-char (point-min)) 2587 (goto-char (point-min))
2588 ;; Deal with "not."s. 2588 ;; Deal with "not."s.
2589 (if (looking-at "not.") 2589 (setq not-match (looking-at "not."))
2590 (progn 2590 (setq regexp
2591 (setq not-match t) 2591 (concat "^" (buffer-substring (+ (point-min) (if not-match 4 0))
2592 (setq regexp 2592 (point-max))
2593 (concat "^" (buffer-substring 5 (point-max)) "$"))) 2593 "$"))
2594 (setq regexp (concat "^" (buffer-substring 1 (point-max)) "$"))
2595 (setq not-match nil))
2596 ;; Finally - if this resulting regexp matches the group name, 2594 ;; Finally - if this resulting regexp matches the group name,
2597 ;; we add this score file to the list of score files 2595 ;; we add this score file to the list of score files
2598 ;; applicable to this group. 2596 ;; applicable to this group.
diff --git a/lisp/gnus/imap.el b/lisp/gnus/imap.el
index 0fe3ed88501..45c7ba4bbbf 100644
--- a/lisp/gnus/imap.el
+++ b/lisp/gnus/imap.el
@@ -1,5 +1,5 @@
1;;; imap.el --- imap library 1;;; imap.el --- imap library
2;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 2;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
3;; Free Software Foundation, Inc. 3;; Free Software Foundation, Inc.
4 4
5;; Author: Simon Josefsson <jas@pdc.kth.se> 5;; Author: Simon Josefsson <jas@pdc.kth.se>
@@ -1803,7 +1803,8 @@ Return nil if no complete line has arrived."
1803 (when (eq (char-after) ?\)) 1803 (when (eq (char-after) ?\))
1804 (imap-forward) 1804 (imap-forward)
1805 (nreverse addresses))) 1805 (nreverse addresses)))
1806 (assert (imap-parse-nil)))) 1806 ;; (assert (imap-parse-nil)) ; With assert, the code might not be eval'd.
1807 (imap-parse-nil)))
1807 1808
1808;; mailbox = "INBOX" / astring 1809;; mailbox = "INBOX" / astring
1809;; ; INBOX is case-insensitive. All case variants of 1810;; ; INBOX is case-insensitive. All case variants of
@@ -2343,7 +2344,8 @@ Return nil if no complete line has arrived."
2343 (imap-forward) 2344 (imap-forward)
2344 (push (imap-parse-string-list) dsp) 2345 (push (imap-parse-string-list) dsp)
2345 (imap-forward)) 2346 (imap-forward))
2346 (assert (imap-parse-nil))) 2347 ;; (assert (imap-parse-nil)) ; Code in assert might not be eval'd.
2348 (imap-parse-nil))
2347 (push (nreverse dsp) ext)) 2349 (push (nreverse dsp) ext))
2348 (when (eq (char-after) ?\ );; body-fld-lang 2350 (when (eq (char-after) ?\ );; body-fld-lang
2349 (imap-forward) 2351 (imap-forward)
diff --git a/lisp/help-at-pt.el b/lisp/help-at-pt.el
index 67a0af20359..ad1f2b3a96a 100644
--- a/lisp/help-at-pt.el
+++ b/lisp/help-at-pt.el
@@ -40,6 +40,11 @@
40;; previous region with available local help and print the help found 40;; previous region with available local help and print the help found
41;; there. 41;; there.
42;; 42;;
43;; Suggested key bindings:
44;;
45;; (global-set-key [C-tab] 'scan-buf-next-region)
46;; (global-set-key [C-M-tab] 'scan-buf-previous-region)
47;;
43;; You do not have to do anything special to use the functionality 48;; You do not have to do anything special to use the functionality
44;; provided by this file, because all important functions autoload. 49;; provided by this file, because all important functions autoload.
45 50
@@ -346,11 +351,6 @@ different regions. With numeric argument ARG, behaves like
346(defvar help-at-pt-unload-hook '(help-at-pt-cancel-timer) 351(defvar help-at-pt-unload-hook '(help-at-pt-cancel-timer)
347 "Normal hook run when `help-at-pt' is unloaded.") 352 "Normal hook run when `help-at-pt' is unloaded.")
348 353
349;; Suggested key bindings:
350;;
351;; (global-set-key [C-tab] 'scan-buf-next-region)
352;; (global-set-key [C-M-tab] 'scan-buf-previous-region)
353
354(provide 'help-at-pt) 354(provide 'help-at-pt)
355 355
356;;; arch-tag: d0b8b86d-d23f-45d0-a82d-208d6205a583 356;;; arch-tag: d0b8b86d-d23f-45d0-a82d-208d6205a583
diff --git a/lisp/hexl.el b/lisp/hexl.el
index 66aceeaee71..cc36c37602e 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -900,7 +900,6 @@ Customize the variable `hexl-follow-ascii' to disable this feature."
900(defun hexl-follow-line () 900(defun hexl-follow-line ()
901 "Activate `hl-line-mode'" 901 "Activate `hl-line-mode'"
902 (require 'frame) 902 (require 'frame)
903 (require 'fringe)
904 (require 'hl-line) 903 (require 'hl-line)
905 (set (make-local-variable 'hl-line-range-function) 904 (set (make-local-variable 'hl-line-range-function)
906 'hexl-highlight-line-range) 905 'hexl-highlight-line-range)
@@ -927,11 +926,8 @@ This function is assumed to be used as call back function for `hl-line-mode'."
927(defun hexl-mode-ruler () 926(defun hexl-mode-ruler ()
928 "Return a string ruler for hexl mode." 927 "Return a string ruler for hexl mode."
929 (let* ((highlight (mod (hexl-current-address) 16)) 928 (let* ((highlight (mod (hexl-current-address) 16))
930 (s "87654321 0011 2233 4455 6677 8899 aabb ccdd eeff 0123456789abcdef") 929 (s " 87654321 0011 2233 4455 6677 8899 aabb ccdd eeff 0123456789abcdef")
931 (pos 0) 930 (pos 0))
932 (spaces (+ (scroll-bar-columns 'left)
933 (fringe-columns 'left)
934 (or (car (window-margins)) 0))))
935 (set-text-properties 0 (length s) nil s) 931 (set-text-properties 0 (length s) nil s)
936 ;; Turn spaces in the header into stretch specs so they work 932 ;; Turn spaces in the header into stretch specs so they work
937 ;; regardless of the header-line face. 933 ;; regardless of the header-line face.
@@ -939,21 +935,16 @@ This function is assumed to be used as call back function for `hl-line-mode'."
939 (setq pos (match-end 0)) 935 (setq pos (match-end 0))
940 (put-text-property (match-beginning 0) pos 'display 936 (put-text-property (match-beginning 0) pos 'display
941 ;; Assume fixed-size chars 937 ;; Assume fixed-size chars
942 `(space :align-to (+ (scroll-bar . left) 938 `(space :align-to ,(1- pos))
943 left-fringe left-margin
944 ,pos))
945 s)) 939 s))
946 ;; Highlight the current column. 940 ;; Highlight the current column.
947 (put-text-property (+ 10 (/ (* 5 highlight) 2)) 941 (put-text-property (+ 11 (/ (* 5 highlight) 2))
948 (+ 12 (/ (* 5 highlight) 2)) 942 (+ 13 (/ (* 5 highlight) 2))
949 'face 'highlight s) 943 'face 'highlight s)
950 ;; Highlight the current ascii column 944 ;; Highlight the current ascii column
951 (put-text-property (+ 12 39 highlight) (+ 12 40 highlight) 945 (put-text-property (+ 13 39 highlight) (+ 13 40 highlight)
952 'face 'highlight s) 946 'face 'highlight s)
953 ;; Add the leading space. 947 s))
954 (concat (propertize (make-string (floor spaces) ? )
955 'display `(space :width ,spaces))
956 s)))
957 948
958;; startup stuff. 949;; startup stuff.
959 950
diff --git a/lisp/info-xref.el b/lisp/info-xref.el
index 91c78e2a5c5..ab9b26c10dd 100644
--- a/lisp/info-xref.el
+++ b/lisp/info-xref.el
@@ -1,26 +1,26 @@
1;;; info-xref.el --- check external references in an Info document. 1;;; info-xref.el --- check external references in an Info document
2
3;; Copyright (C) 2003, 2004 Free Software Foundation, Inc.
2 4
3;; Copyright 2003 Free Software Foundation, Inc
4;;
5;; Author: Kevin Ryde <user42@zip.com.au> 5;; Author: Kevin Ryde <user42@zip.com.au>
6;; Keywords: docs 6;; Keywords: docs
7;;
8;; info-xref.el is free software; you can redistribute it and/or modify
9;; it under the terms of the GNU General Public License as published by the
10;; Free Software Foundation; either version 2, or (at your option) any later
11;; version.
12;;
13;; info-xref.el is distributed in the hope that it will be useful, but
14;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
16;; Public License for more details.
17;;
18;; You can get a copy of the GNU General Public License online at
19;; http://www.gnu.org/licenses/gpl.txt, or you should have one in the file
20;; COPYING which comes with GNU Emacs and other GNU programs. Failing that,
21;; write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22;; Boston, MA 02111-1307, USA.
23 7
8;; This file is part of GNU Emacs.
9
10;; GNU Emacs is free software; you can redistribute it and/or modify
11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation; either version 2, or (at your option)
13;; any later version.
14
15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs; see the file COPYING. If not, write to the
22;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23;; Boston, MA 02111-1307, USA.
24 24
25;;; Commentary: 25;;; Commentary:
26 26
@@ -59,31 +59,10 @@
59;; this is that if for instance there's a source code directory in 59;; this is that if for instance there's a source code directory in
60;; `Info-directory-list' then a lot of extraneous files might be read, which 60;; `Info-directory-list' then a lot of extraneous files might be read, which
61;; will be time consuming but should be harmless. 61;; will be time consuming but should be harmless.
62
63
64;;; Install:
65
66;; Put info-xref.el somewhere in your `load-path', and in your .emacs put
67;;
68;; (autoload 'info-xref-check "info-xref" nil t)
69;; (autoload 'info-xref-check-all "info-xref" nil t)
70;;
71;; then
72;; 62;;
73;; M-x info-xref-check 63;; `M-x info-xref-check-all-custom' is a related command, it goes through
74;; 64;; all info document references in customizable variables, checking them
75;; and enter an info file name. 65;; like info file cross references.
76
77
78;;; Emacsen:
79
80;; Designed for use with GNU Emacs 21.
81
82
83;;; History:
84
85;; Version 1 - the first version.
86
87 66
88;;; Code: 67;;; Code:
89 68
@@ -204,32 +183,37 @@ should open up the purported top file and see what subfiles it says."
204This should be the raw file contents, not `Info-mode'." 183This should be the raw file contents, not `Info-mode'."
205 (goto-char (point-min)) 184 (goto-char (point-min))
206 (while (re-search-forward 185 (while (re-search-forward
207 "\\*[Nn]ote[ \n\t]+[^:]*:[ \n\t]+\\(\\(([^)]+)\\)[^.,]+\\)[.,]" 186 "\\*[Nn]ote[ \n\t]+[^:]*:[ \n\t]+\\(\\(([^)]*)\\)[^.,]+\\)[.,]"
208 nil t) 187 nil t)
209 (let* ((file (match-string 2)) 188 (let* ((file (match-string 2))
210 (node ;; Canonicalize spaces: we could use "[\t\n ]+" but 189 (node ;; Canonicalize spaces: we could use "[\t\n ]+" but
211 ;; we try to avoid uselessly replacing " " with " ". 190 ;; we try to avoid uselessly replacing " " with " ".
212 (replace-regexp-in-string "[\t\n][\t\n ]*\\| [\t\n ]+" " " 191 (replace-regexp-in-string "[\t\n][\t\n ]*\\| [\t\n ]+" " "
213 (match-string 1) t t))) 192 (match-string 1) t t)))
214 ;; see if the file exists, if we haven't tried it before 193 (if (string-equal "()" file)
215 (unless (assoc file info-xref-xfile-alist) 194 (info-xref-output "Empty filename part: %s\n" node)
216 (let ((found (info-xref-goto-node-p file))) 195 ;; see if the file exists, if we haven't tried it before
217 (push (cons file found) info-xref-xfile-alist) 196 (unless (assoc file info-xref-xfile-alist)
218 (unless found 197 (let ((found (info-xref-goto-node-p file)))
219 (info-xref-output (format "Not available to check: %s\n" file))))) 198 (push (cons file found) info-xref-xfile-alist)
220 ;; if the file exists, try the node, if we haven't before 199 (unless found
221 (when (cdr (assoc file info-xref-xfile-alist)) 200 (info-xref-output "Not available to check: %s\n" file))))
222 (unless (assoc node info-xref-xfile-alist) 201 ;; if the file exists, try the node
202 (when (cdr (assoc file info-xref-xfile-alist))
223 (if (info-xref-goto-node-p node) 203 (if (info-xref-goto-node-p node)
224 (setq info-xref-good (1+ info-xref-good)) 204 (setq info-xref-good (1+ info-xref-good))
225 (setq info-xref-bad (1+ info-xref-bad)) 205 (setq info-xref-bad (1+ info-xref-bad))
226 (info-xref-output (format "No such node: %s\n" node)))))))) 206 (info-xref-output "No such node: %s\n" node)))))))
227 207
228(defun info-xref-output (str) 208(defun info-xref-output (str &rest args)
229 "Emit STR as an info-xref result message." 209 "Emit a `format'-ed message STR+ARGS to the info-xref output buffer."
230 (with-current-buffer info-xref-results-buffer 210 (with-current-buffer info-xref-results-buffer
231 (insert info-xref-filename-heading str) 211 (insert info-xref-filename-heading
232 (setq info-xref-filename-heading ""))) 212 (apply 'format str args))
213 (setq info-xref-filename-heading "")
214 ;; all this info-xref can be pretty slow, display now so the user can
215 ;; see some progress
216 (sit-for 0)))
233 217
234;; When asking Info-goto-node to fork, *info* needs to be the current 218;; When asking Info-goto-node to fork, *info* needs to be the current
235;; buffer, otherwise it seems to clone the current buffer but then do the 219;; buffer, otherwise it seems to clone the current buffer but then do the
@@ -259,6 +243,67 @@ This should be the raw file contents, not `Info-mode'."
259 (unless (equal (current-buffer) oldbuf) 243 (unless (equal (current-buffer) oldbuf)
260 (kill-buffer (current-buffer)))))))) 244 (kill-buffer (current-buffer))))))))
261 245
246;;;###autoload
247(defun info-xref-check-all-custom ()
248 "Check info references in all customize groups and variables.
249`custom-manual' and `info-link' entries in the `custom-links' list are checked.
250
251`custom-load' autoloads for all symbols are loaded in order to get all the
252link information. This will be a lot of lisp packages loaded, and can take
253quite a while."
254
255 (interactive)
256 (pop-to-buffer info-xref-results-buffer t)
257 (erase-buffer)
258 (let ((info-xref-filename-heading ""))
259
260 ;; `custom-load-symbol' is not used, since it quietly ignores errors,
261 ;; but we want to show them (since they may mean incomplete checking).
262 ;;
263 ;; Just one pass through mapatoms is made. There shouldn't be any new
264 ;; custom-loads setup by packages loaded.
265 ;;
266 (info-xref-output "Loading custom-load autoloads ...\n")
267 (require 'cus-start)
268 (require 'cus-load)
269 (let ((viper-mode nil)) ;; tell viper.el not to ask about viperizing
270 (mapatoms
271 (lambda (symbol)
272 (dolist (load (get symbol 'custom-loads))
273 (cond ((symbolp load)
274 (condition-case cause (require load)
275 (error
276 (info-xref-output "Symbol `%s': cannot require '%s: %s\n"
277 symbol load cause))))
278 ;; skip if previously loaded
279 ((assoc load load-history))
280 ((assoc (locate-library load) load-history))
281 (t
282 (condition-case cause (load load)
283 (error
284 (info-xref-output "Symbol `%s': cannot load \"%s\": %s\n"
285 symbol load cause)))))))))
286
287 ;; Don't bother to check whether the info file exists as opposed to just
288 ;; a missing node. If you have the lisp then you should have the
289 ;; documentation, so missing node name will be the usual fault.
290 ;;
291 (info-xref-output "\nChecking custom-links references ...\n")
292 (let ((good 0)
293 (bad 0))
294 (mapatoms
295 (lambda (symbol)
296 (dolist (link (get symbol 'custom-links))
297 (when (memq (car link) '(custom-manual info-link))
298 (if (info-xref-goto-node-p (cadr link))
299 (setq good (1+ good))
300 (setq bad (1+ bad))
301 ;; symbol-file gives nil for preloaded variables, would need
302 ;; to copy what describe-variable does to show the right place
303 (info-xref-output "Symbol `%s' (in %s): cannot goto node: %s\n"
304 symbol (symbol-file symbol) (cadr link)))))))
305 (info-xref-output "%d good, %d bad\n" good bad))))
306
262(provide 'info-xref) 307(provide 'info-xref)
263 308
264;;; arch-tag: 69d4d528-69ed-4cc2-8eb4-c666a0c1d5ac 309;;; arch-tag: 69d4d528-69ed-4cc2-8eb4-c666a0c1d5ac
diff --git a/lisp/info.el b/lisp/info.el
index 3438320beb4..0f8fc633cfa 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1,7 +1,6 @@
1;;; info.el --- info package for Emacs 1;;; info.el --- info package for Emacs
2 2
3;; Copyright (C) 1985, 86, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 3;; Copyright (C) 1985,86,92,93,94,95,96,97,98,99,2000,01,02,03,2004
4;; 2002, 2003
5;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
6 5
7;; Maintainer: FSF 6;; Maintainer: FSF
@@ -387,7 +386,9 @@ Do the right thing if the file has been compressed or zipped."
387 ;; version, so we should look there first. `Info-insert-dir' 386 ;; version, so we should look there first. `Info-insert-dir'
388 ;; currently expects to find `alternative' first on the list. 387 ;; currently expects to find `alternative' first on the list.
389 (cons alternative 388 (cons alternative
390 (reverse (cdr (reverse Info-default-directory-list))))))) 389 ;; Don't drop the last part, it might contain non-Emacs stuff.
390 ;; (reverse (cdr (reverse
391 Info-default-directory-list)))) ;; )))
391 392
392(defun info-initialize () 393(defun info-initialize ()
393 "Initialize `Info-directory-list', if that hasn't been done yet." 394 "Initialize `Info-directory-list', if that hasn't been done yet."
diff --git a/lisp/international/characters.el b/lisp/international/characters.el
index 5cd6f358da8..301d8ea5454 100644
--- a/lisp/international/characters.el
+++ b/lisp/international/characters.el
@@ -153,21 +153,6 @@
153(modify-syntax-entry ?\$A#)(B ")$A#((B") 153(modify-syntax-entry ?\$A#)(B ")$A#((B")
154(modify-syntax-entry ?\$A#}(B ")$A#{(B") 154(modify-syntax-entry ?\$A#}(B ")$A#{(B")
155(modify-syntax-entry ?\$A#](B ")$A#[(B") 155(modify-syntax-entry ?\$A#](B ")$A#[(B")
156;; Unicode equivalents of above
157(modify-syntax-entry ?\$,2=T(B "($,2=U(B")
158(modify-syntax-entry ?\$,2=H(B "($,2=I(B")
159(modify-syntax-entry ?\$,2=J(B "($,2=K(B")
160(modify-syntax-entry ?\$,2=L(B "($,2=M(B")
161(modify-syntax-entry ?\$,2=N(B "($,2=O(B")
162(modify-syntax-entry ?\$,2=V(B "($,2=W(B")
163(modify-syntax-entry ?\$,2=P(B "($,2=Q(B")
164(modify-syntax-entry ?\$,2=U(B ")$,2=T(B")
165(modify-syntax-entry ?\$,2=I(B ")$,2=H(B")
166(modify-syntax-entry ?\$,2=K(B ")$,2=J(B")
167(modify-syntax-entry ?\$,2=M(B ")$,2=L(B")
168(modify-syntax-entry ?\$,2=O(B ")$,2=N(B")
169(modify-syntax-entry ?\$,2=W(B ")$,2=V(B")
170(modify-syntax-entry ?\$,2=Q(B ")$,2=P(B")
171 156
172(let ((chars "$A#,!"!##.!$#;#:#?#!!C!-!'#|#_!.!/!0!1#"!e#`!d(B")) 157(let ((chars "$A#,!"!##.!$#;#:#?#!!C!-!'#|#_!.!/!0!1#"!e#`!d(B"))
173 (dotimes (i (length chars)) 158 (dotimes (i (length chars))
@@ -187,8 +172,6 @@
187 172
188;; Chinese character set (BIG5) 173;; Chinese character set (BIG5)
189 174
190
191
192(let ((from (decode-big5-char #xA141)) 175(let ((from (decode-big5-char #xA141))
193 (to (decode-big5-char #xA15D))) 176 (to (decode-big5-char #xA15D)))
194 (while (< from to) 177 (while (< from to)
@@ -1141,6 +1124,67 @@
1141 1124
1142 ;; Fixme: syntax for symbols &c 1125 ;; Fixme: syntax for symbols &c
1143 ) 1126 )
1127
1128(let ((pairs
1129 '("$,1sEsF(B" ; U+2045 U+2046
1130 "$,1s}s~(B" ; U+207D U+207E
1131 "$,1t-t.(B" ; U+208D U+208E
1132 "$,1zhzi(B" ; U+2308 U+2309
1133 "$,1zjzk(B" ; U+230A U+230B
1134 "$,1{){*(B" ; U+2329 U+232A
1135 "$,1|T|U(B" ; U+23B4 U+23B5
1136 "$,2&H&I(B" ; U+2768 U+2769
1137 "$,2&J&K(B" ; U+276A U+276B
1138 "$,2&L&M(B" ; U+276C U+276D
1139 "$,2&P&Q(B" ; U+2770 U+2771
1140 "$,2&R&S(B" ; U+2772 U+2773
1141 "$,2&T&U(B" ; U+2774 U+2775
1142 "$,2'f'g(B" ; U+27E6 U+27E7
1143 "$,2'h'i(B" ; U+27E8 U+27E9
1144 "$,2'j'k(B" ; U+27EA U+27EB
1145 "$,2,#,$(B" ; U+2983 U+2984
1146 "$,2,%,&(B" ; U+2985 U+2986
1147 "$,2,',((B" ; U+2987 U+2988
1148 "$,2,),*(B" ; U+2989 U+298A
1149 "$,2,+,,(B" ; U+298B U+298C
1150 "$,2,-,.(B" ; U+298D U+298E
1151 "$,2,/,0(B" ; U+298F U+2990
1152 "$,2,1,2(B" ; U+2991 U+2992
1153 "$,2,3,4(B" ; U+2993 U+2994
1154 "$,2,5,6(B" ; U+2995 U+2996
1155 "$,2,7,8(B" ; U+2997 U+2998
1156 "$,2-<-=(B" ; U+29FC U+29FD
1157 "$,2=H=I(B" ; U+3008 U+3009
1158 "$,2=J=K(B" ; U+300A U+300B
1159 "$,2=L=M(B" ; U+300C U+300D
1160 "$,2=N=O(B" ; U+300E U+300F
1161 "$,2=P=Q(B" ; U+3010 U+3011
1162 "$,2=T=U(B" ; U+3014 U+3015
1163 "$,2=V=W(B" ; U+3016 U+3017
1164 "$,2=X=Y(B" ; U+3018 U+3019
1165 "$,2=Z=[(B" ; U+301A U+301B
1166 "$,3m~m(B" ; U+FD3E U+FD3F
1167 "$,3pUpV(B" ; U+FE35 U+FE36
1168 "$,3pWpX(B" ; U+FE37 U+FE38
1169 "$,3pYpZ(B" ; U+FE39 U+FE3A
1170 "$,3p[p\(B" ; U+FE3B U+FE3C
1171 "$,3p]p^(B" ; U+FE3D U+FE3E
1172 "$,3p_p`(B" ; U+FE3F U+FE40
1173 "$,3papb(B" ; U+FE41 U+FE42
1174 "$,3pcpd(B" ; U+FE43 U+FE44
1175 "$,3pypz(B" ; U+FE59 U+FE5A
1176 "$,3p{p|(B" ; U+FE5B U+FE5C
1177 "$,3p}p~(B" ; U+FE5D U+FE5E
1178 "$,3rhri(B" ; U+FF08 U+FF09
1179 "$,3s;s=(B" ; U+FF3B U+FF3D
1180 "$,3s[s](B" ; U+FF5B U+FF5D
1181 "$,3s_s`(B" ; U+FF5F U+FF60
1182 "$,3sbsc(B" ; U+FF62 U+FF63
1183 )))
1184 (dolist (elt pairs)
1185 (modify-syntax-entry (aref elt 0) (string ?\( (aref elt 1)))
1186 (modify-syntax-entry (aref elt 1) (string ?\) (aref elt 0)))))
1187
1144 1188
1145;;; Setting word boundary. 1189;;; Setting word boundary.
1146 1190
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index dca8b80744e..65e9fcab362 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -926,13 +926,33 @@ at the risk of losing the problematic characters.\n")))
926 (goto-char (point-min)) 926 (goto-char (point-min))
927 (set-auto-coding (or file buffer-file-name "") 927 (set-auto-coding (or file buffer-file-name "")
928 (buffer-size)))))) 928 (buffer-size))))))
929 (if (and auto-cs coding-system 929 ;; Merge coding-system and auto-cs as far as possible.
930 (if (not coding-system)
931 (setq coding-system auto-cs)
932 (if (not auto-cs)
933 (setq auto-cs coding-system)
934 (let ((eol-type-1 (coding-system-eol-type coding-system))
935 (eol-type-2 (coding-system-eol-type auto-cs)))
936 (if (eq (coding-system-base coding-system) 'undecided)
937 (setq coding-system (coding-system-change-text-conversion
938 coding-system auto-cs))
939 (if (eq (coding-system-base auto-cs) 'undecided)
940 (setq auto-cs (coding-system-change-text-conversion
941 auto-cs coding-system))))
942 (if (vectorp eol-type-1)
943 (or (vectorp eol-type-2)
944 (setq coding-system (coding-system-change-eol-conversion
945 coding-system eol-type-2)))
946 (if (vectorp eol-type-2)
947 (setq auto-cs (coding-system-change-eol-conversion
948 auto-cs eol-type-1)))))))
949
950 (if (and auto-cs
930 ;; Don't barf if writing a compressed file, say. 951 ;; Don't barf if writing a compressed file, say.
931 ;; This check perhaps isn't ideal, but is probably 952 ;; This check perhaps isn't ideal, but is probably
932 ;; the best thing to do. 953 ;; the best thing to do.
933 (not (auto-coding-alist-lookup (or file buffer-file-name ""))) 954 (not (auto-coding-alist-lookup (or file buffer-file-name "")))
934 (not (coding-system-equal (coding-system-base coding-system) 955 (not (coding-system-equal coding-system auto-cs)))
935 (coding-system-base auto-cs))))
936 (unless (yes-or-no-p 956 (unless (yes-or-no-p
937 (format "Selected encoding %s disagrees with \ 957 (format "Selected encoding %s disagrees with \
938%s specified by file contents. Really save (else edit coding cookies \ 958%s specified by file contents. Really save (else edit coding cookies \
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el
index 0d74e93f8e8..90d5b87c4c6 100644
--- a/lisp/international/mule-diag.el
+++ b/lisp/international/mule-diag.el
@@ -845,7 +845,7 @@ Priority order for recognizing coding systems when reading files:\n")
845 (setq codings (cons x codings)))) 845 (setq codings (cons x codings))))
846 (get (car categories) 'coding-systems)) 846 (get (car categories) 'coding-systems))
847 (if codings 847 (if codings
848 (let ((max-col (frame-width)) 848 (let ((max-col (window-width))
849 pos) 849 pos)
850 (princ (format "\ 850 (princ (format "\
851 The following are decoded correctly but recognized as %s:\n " 851 The following are decoded correctly but recognized as %s:\n "
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 5ba23ce9514..8c95becaf21 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -1249,7 +1249,7 @@ See Info node `Specify Coding' and Info node `Single-Byte Character Support'.
1249On non-windowing terminals, this is set from the locale by default. 1249On non-windowing terminals, this is set from the locale by default.
1250 1250
1251Setting this variable directly does not take effect; 1251Setting this variable directly does not take effect;
1252use either M-x customize or \\[set-keyboard-coding-system]." 1252use either \\[customize] or \\[set-keyboard-coding-system]."
1253 :type '(coding-system :tag "Coding system") 1253 :type '(coding-system :tag "Coding system")
1254 :link '(info-link "(emacs)Specify Coding") 1254 :link '(info-link "(emacs)Specify Coding")
1255 :link '(info-link "(emacs)Single-Byte Character Support") 1255 :link '(info-link "(emacs)Single-Byte Character Support")
diff --git a/lisp/international/quail.el b/lisp/international/quail.el
index 3451321f24a..2f275a59dca 100644
--- a/lisp/international/quail.el
+++ b/lisp/international/quail.el
@@ -2289,8 +2289,8 @@ should be made by `quail-build-decode-map' (which see)."
2289 (or (> (length x) (length y)) 2289 (or (> (length x) (length y))
2290 (and (= (length x) (length y)) 2290 (and (= (length x) (length y))
2291 (not (string< x y)))))))) 2291 (not (string< x y))))))))
2292 (let ((frame-width (frame-width (window-frame (get-buffer-window 2292 (let ((window-width (window-width (get-buffer-window
2293 (current-buffer) 'visible)))) 2293 (current-buffer) 'visible)))
2294 (single-key-width 3) 2294 (single-key-width 3)
2295 (single-trans-width 4) 2295 (single-trans-width 4)
2296 (multiple-key-width 3) 2296 (multiple-key-width 3)
@@ -2319,7 +2319,7 @@ should be made by `quail-build-decode-map' (which see)."
2319 (setq multiple-key-width width))) 2319 (setq multiple-key-width width)))
2320 (when single-list 2320 (when single-list
2321 (setq col-width (+ single-key-width 1 single-trans-width 1) 2321 (setq col-width (+ single-key-width 1 single-trans-width 1)
2322 cols (/ frame-width col-width) 2322 cols (/ window-width col-width)
2323 rows (/ (length single-list) cols)) 2323 rows (/ (length single-list) cols))
2324 (if (> (% (length single-list) cols) 0) 2324 (if (> (% (length single-list) cols) 0)
2325 (setq rows (1+ rows))) 2325 (setq rows (1+ rows)))
@@ -2365,7 +2365,7 @@ should be made by `quail-build-decode-map' (which see)."
2365 (lambda (x) 2365 (lambda (x)
2366 (let ((width (if (integerp x) (char-width x) 2366 (let ((width (if (integerp x) (char-width x)
2367 (string-width x)))) 2367 (string-width x))))
2368 (when (> (+ (current-column) 1 width) frame-width) 2368 (when (> (+ (current-column) 1 width) window-width)
2369 (insert "\n") 2369 (insert "\n")
2370 (indent-to multiple-key-width)) 2370 (indent-to multiple-key-width))
2371 (insert " " x)))) 2371 (insert " " x))))
@@ -2402,7 +2402,7 @@ package to describe."
2402 (with-current-buffer standard-output 2402 (with-current-buffer standard-output
2403 (setq quail-current-package package-def)))) 2403 (setq quail-current-package package-def))))
2404 ;; Then, insert text in the help buffer while paying attention to 2404 ;; Then, insert text in the help buffer while paying attention to
2405 ;; the width of the frame in which the buffer displayed. 2405 ;; the width of the window in which the buffer displayed.
2406 (with-current-buffer (help-buffer) 2406 (with-current-buffer (help-buffer)
2407 (setq buffer-read-only nil) 2407 (setq buffer-read-only nil)
2408 (insert "Input method: " (quail-name) 2408 (insert "Input method: " (quail-name)
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index 67b1bfbe022..43c8457c80b 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -60,7 +60,6 @@ Preserves the `buffer-modified-p' state of the current buffer."
60 60
61(defgroup jit-lock nil 61(defgroup jit-lock nil
62 "Font Lock support mode to fontify just-in-time." 62 "Font Lock support mode to fontify just-in-time."
63 :link '(custom-manual "(emacs)Support Modes")
64 :version "21.1" 63 :version "21.1"
65 :group 'font-lock) 64 :group 'font-lock)
66 65
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el
index 7a0f39d89ee..fa852bd19b6 100644
--- a/lisp/jka-compr.el
+++ b/lisp/jka-compr.el
@@ -1,6 +1,6 @@
1;;; jka-compr.el --- reading/writing/loading compressed files 1;;; jka-compr.el --- reading/writing/loading compressed files
2 2
3;; Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
4 4
5;; Author: jka@ece.cmu.edu (Jay K. Adams) 5;; Author: jka@ece.cmu.edu (Jay K. Adams)
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -138,6 +138,10 @@ for `jka-compr-compression-info-list')."
138 "bzip2ing" "bzip2" nil 138 "bzip2ing" "bzip2" nil
139 "bunzip2ing" "bzip2" ("-d") 139 "bunzip2ing" "bzip2" ("-d")
140 nil t "BZh"] 140 nil t "BZh"]
141 ["\\.tbz\\'"
142 "bzip2ing" "bzip2" nil
143 "bunzip2ing" "bzip2" ("-d")
144 nil nil "BZh"]
141 ["\\.tgz\\'" 145 ["\\.tgz\\'"
142 "zipping" "gzip" ("-c" "-q") 146 "zipping" "gzip" ("-c" "-q")
143 "unzipping" "gzip" ("-c" "-q" "-d") 147 "unzipping" "gzip" ("-c" "-q" "-d")
@@ -145,7 +149,14 @@ for `jka-compr-compression-info-list')."
145 ["\\.g?z\\(~\\|\\.~[0-9]+~\\)?\\'" 149 ["\\.g?z\\(~\\|\\.~[0-9]+~\\)?\\'"
146 "zipping" "gzip" ("-c" "-q") 150 "zipping" "gzip" ("-c" "-q")
147 "unzipping" "gzip" ("-c" "-q" "-d") 151 "unzipping" "gzip" ("-c" "-q" "-d")
148 t t "\037\213"]) 152 t t "\037\213"]
153 ;; dzip is gzip with random access. Its compression program can't
154 ;; read/write stdin/out, so .dz files can only be viewed without
155 ;; saving, having their contents decompressed with gzip.
156 ["\\.dz\\'"
157 nil nil nil
158 "unzipping" "gzip" ("-c" "-q" "-d")
159 nil t "\037\213"])
149 160
150 "List of vectors that describe available compression techniques. 161 "List of vectors that describe available compression techniques.
151Each element, which describes a compression technique, is a vector of 162Each element, which describes a compression technique, is a vector of
@@ -160,6 +171,7 @@ APPEND-FLAG STRIP-EXTENSION-FLAG FILE-MAGIC-CHARS], where:
160 type of compression (nil means no message) 171 type of compression (nil means no message)
161 172
162 compress-program is a program that performs this compression 173 compress-program is a program that performs this compression
174 (nil means visit file in read-only mode)
163 175
164 compress-args is a list of args to pass to the compress program 176 compress-args is a list of args to pass to the compress program
165 177
@@ -199,7 +211,7 @@ invoked."
199 :group 'jka-compr) 211 :group 'jka-compr)
200 212
201(defcustom jka-compr-mode-alist-additions 213(defcustom jka-compr-mode-alist-additions
202 (list (cons "\\.tgz\\'" 'tar-mode)) 214 (list (cons "\\.tgz\\'" 'tar-mode) (cons "\\.tbz\\'" 'tar-mode))
203 "A list of pairs to add to `auto-mode-alist' when jka-compr is installed." 215 "A list of pairs to add to `auto-mode-alist' when jka-compr is installed."
204 :type '(repeat (cons string symbol)) 216 :type '(repeat (cons string symbol))
205 :group 'jka-compr) 217 :group 'jka-compr)
@@ -421,10 +433,7 @@ There should be no more than seven characters after the final `/'."
421 (let ((can-append (jka-compr-info-can-append info)) 433 (let ((can-append (jka-compr-info-can-append info))
422 (compress-program (jka-compr-info-compress-program info)) 434 (compress-program (jka-compr-info-compress-program info))
423 (compress-message (jka-compr-info-compress-message info)) 435 (compress-message (jka-compr-info-compress-message info))
424 (uncompress-program (jka-compr-info-uncompress-program info))
425 (uncompress-message (jka-compr-info-uncompress-message info))
426 (compress-args (jka-compr-info-compress-args info)) 436 (compress-args (jka-compr-info-compress-args info))
427 (uncompress-args (jka-compr-info-uncompress-args info))
428 (base-name (file-name-nondirectory visit-file)) 437 (base-name (file-name-nondirectory visit-file))
429 temp-file temp-buffer 438 temp-file temp-buffer
430 ;; we need to leave `last-coding-system-used' set to its 439 ;; we need to leave `last-coding-system-used' set to its
@@ -432,6 +441,9 @@ There should be no more than seven characters after the final `/'."
432 ;; that `basic-save-buffer' sees the right value. 441 ;; that `basic-save-buffer' sees the right value.
433 (coding-system-used last-coding-system-used)) 442 (coding-system-used last-coding-system-used))
434 443
444 (or compress-program
445 (error "No compression program defined"))
446
435 (setq temp-buffer (get-buffer-create " *jka-compr-wr-temp*")) 447 (setq temp-buffer (get-buffer-create " *jka-compr-wr-temp*"))
436 (with-current-buffer temp-buffer 448 (with-current-buffer temp-buffer
437 (widen) (erase-buffer)) 449 (widen) (erase-buffer))
@@ -631,6 +643,9 @@ There should be no more than seven characters after the final `/'."
631;;; (setq size insval))) 643;;; (setq size insval)))
632;;; (setq p (cdr p)))) 644;;; (setq p (cdr p))))
633 645
646 (or (jka-compr-info-compress-program info)
647 (message "You can't save this buffer because compression program is not defined"))
648
634 (list filename size)) 649 (list filename size))
635 650
636 (jka-compr-run-real-handler 'insert-file-contents 651 (jka-compr-run-real-handler 'insert-file-contents
diff --git a/lisp/kmacro.el b/lisp/kmacro.el
index 68717653eb8..a129ab53cef 100644
--- a/lisp/kmacro.el
+++ b/lisp/kmacro.el
@@ -609,7 +609,7 @@ command. See `kmacro-call-repeat-key' and `kmacro-call-repeat-with-arg'
609for details on how to adjust or disable this behaviour. 609for details on how to adjust or disable this behaviour.
610 610
611To make a macro permanent so you can call it even after defining 611To make a macro permanent so you can call it even after defining
612others, use M-x name-last-kbd-macro." 612others, use \\[name-last-kbd-macro]."
613 (interactive "p") 613 (interactive "p")
614 (let ((repeat-key (and (null no-repeat) 614 (let ((repeat-key (and (null no-repeat)
615 (> (length (this-single-command-keys)) 1) 615 (> (length (this-single-command-keys)) 1)
diff --git a/lisp/language/ethio-util.el b/lisp/language/ethio-util.el
index 90eed288d6c..9fc2f403655 100644
--- a/lisp/language/ethio-util.el
+++ b/lisp/language/ethio-util.el
@@ -1826,7 +1826,7 @@ Otherwise, [0-9A-F]."
1826 1826
1827;;;###autoload 1827;;;###autoload
1828(defun ethio-find-file nil 1828(defun ethio-find-file nil
1829 "Transcribe file content into Ethiopic dependig on filename suffix." 1829 "Transcribe file content into Ethiopic depending on filename suffix."
1830 (cond 1830 (cond
1831 1831
1832 ((string-match "\\.sera$" (buffer-file-name)) 1832 ((string-match "\\.sera$" (buffer-file-name))
diff --git a/lisp/log-edit.el b/lisp/log-edit.el
index 99ff6cc1586..9a4521bbde9 100644
--- a/lisp/log-edit.el
+++ b/lisp/log-edit.el
@@ -299,7 +299,7 @@ automatically."
299;;; Actual code 299;;; Actual code
300;;; 300;;;
301 301
302(defar log-edit-font-lock-keywords 302(defvar log-edit-font-lock-keywords
303 '(("\\`\\(Summary:\\)\\(.*\\)" 303 '(("\\`\\(Summary:\\)\\(.*\\)"
304 (1 font-lock-keyword-face) 304 (1 font-lock-keyword-face)
305 (2 font-lock-function-name-face)))) 305 (2 font-lock-function-name-face))))
diff --git a/lisp/man.el b/lisp/man.el
index 0e665af723e..7222c1bad15 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -1,6 +1,6 @@
1;;; man.el --- browse UNIX manual pages -*- coding: iso-8859-1 -*- 1;;; man.el --- browse UNIX manual pages -*- coding: iso-8859-1 -*-
2 2
3;; Copyright (C) 1993, 1994, 1996, 1997, 2001, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 1993, 1994, 1996, 1997, 2001, 2003, 2004 Free Software Foundation, Inc.
4 4
5;; Author: Barry A. Warsaw <bwarsaw@cen.com> 5;; Author: Barry A. Warsaw <bwarsaw@cen.com>
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -175,6 +175,17 @@ Any other value of `Man-notify-method' is equivalent to `meek'."
175 (const polite) (const quiet) (const meek)) 175 (const polite) (const quiet) (const meek))
176 :group 'man) 176 :group 'man)
177 177
178(defcustom Man-width nil
179 "*Number of columns for which manual pages should be formatted.
180If nil, the width of the window selected at the moment of man
181invocation is used. If non-nil, the width of the frame selected
182at the moment of man invocation is used. The value also can be a
183positive integer."
184 :type '(choice (const :tag "Window width" nil)
185 (const :tag "Frame width" t)
186 (integer :tag "Specific width" :value 65))
187 :group 'man)
188
178(defcustom Man-frame-parameters nil 189(defcustom Man-frame-parameters nil
179 "*Frame parameter list for creating a new frame for a manual page." 190 "*Frame parameter list for creating a new frame for a manual page."
180 :type 'sexp 191 :type 'sexp
@@ -317,6 +328,12 @@ make -a one of the switches, if your `man' program supports it.")
317 "") 328 "")
318 "Option that indicates a specified a manual section name.") 329 "Option that indicates a specified a manual section name.")
319 330
331(defvar Man-support-local-filenames 'auto-detect
332 "Internal cache for the value of the function `Man-support-local-filenames'.
333`auto-detect' means the value is not yet determined.
334Otherwise, the value is whatever the function
335`Man-support-local-filenames' should return.")
336
320;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 337;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
321;; end user variables 338;; end user variables
322 339
@@ -486,13 +503,15 @@ This is necessary if one wants to dump man.el with Emacs."
486(defsubst Man-build-man-command () 503(defsubst Man-build-man-command ()
487 "Builds the entire background manpage and cleaning command." 504 "Builds the entire background manpage and cleaning command."
488 (let ((command (concat manual-program " " Man-switches 505 (let ((command (concat manual-program " " Man-switches
489 ; Stock MS-DOS shells cannot redirect stderr; 506 (cond
490 ; `call-process' below sends it to /dev/null, 507 ;; Already has %s
491 ; so we don't need `2>' even with DOS shells 508 ((string-match "%s" manual-program) "")
492 ; which do support stderr redirection. 509 ;; Stock MS-DOS shells cannot redirect stderr;
493 (if (not (fboundp 'start-process)) 510 ;; `call-process' below sends it to /dev/null,
494 " %s" 511 ;; so we don't need `2>' even with DOS shells
495 (concat " %s 2>" null-device)))) 512 ;; which do support stderr redirection.
513 ((not (fboundp 'start-process)) " %s")
514 ((concat " %s 2>" null-device)))))
496 (flist Man-filter-list)) 515 (flist Man-filter-list))
497 (while (and flist (car flist)) 516 (while (and flist (car flist))
498 (let ((pcom (car (car flist))) 517 (let ((pcom (car (car flist)))
@@ -555,6 +574,31 @@ and the Man-section-translations-alist variables)."
555 slist nil)))) 574 slist nil))))
556 (concat Man-specified-section-option section " " name)))) 575 (concat Man-specified-section-option section " " name))))
557 576
577(defun Man-support-local-filenames ()
578 "Check the availability of `-l' option of the man command.
579This option allows `man' to interpret command line arguments
580as local filenames.
581Return the value of the variable `Man-support-local-filenames'
582if it was set to nil or t before the call of this function.
583If t, the man command supports `-l' option. If nil, it don't.
584Otherwise, if the value of `Man-support-local-filenames'
585is neither t nor nil, then determine a new value, set it
586to the variable `Man-support-local-filenames' and return
587a new value."
588 (if (or (not Man-support-local-filenames)
589 (eq Man-support-local-filenames t))
590 Man-support-local-filenames
591 (setq Man-support-local-filenames
592 (with-temp-buffer
593 (and (equal (condition-case nil
594 (call-process manual-program nil t nil "--help")
595 (error nil))
596 0)
597 (progn
598 (goto-char (point-min))
599 (search-forward "--local-file" nil t))
600 t)))))
601
558 602
559;; ====================================================================== 603;; ======================================================================
560;; default man entry: get word under point 604;; default man entry: get word under point
@@ -679,7 +723,12 @@ all sections related to a subject, put something appropriate into the
679 ;; This isn't strictly correct, since we don't know how 723 ;; This isn't strictly correct, since we don't know how
680 ;; the page will actually be displayed, but it seems 724 ;; the page will actually be displayed, but it seems
681 ;; reasonable. 725 ;; reasonable.
682 (setenv "COLUMNS" (number-to-string (frame-width))))) 726 (setenv "COLUMNS" (number-to-string
727 (cond
728 ((and (integerp Man-width) (> Man-width 0))
729 Man-width)
730 (Man-width (frame-width))
731 ((window-width)))))))
683 (setenv "GROFF_NO_SGR" "1") 732 (setenv "GROFF_NO_SGR" "1")
684 (if (fboundp 'start-process) 733 (if (fboundp 'start-process)
685 (set-process-sentinel 734 (set-process-sentinel
@@ -757,7 +806,7 @@ See the variable `Man-notify-method' for the different notification behaviors."
757 "Convert overstriking and underlining to the correct fonts. 806 "Convert overstriking and underlining to the correct fonts.
758Same for the ANSI bold and normal escape sequences." 807Same for the ANSI bold and normal escape sequences."
759 (interactive) 808 (interactive)
760 (message "Please wait: making up the %s man page..." Man-arguments) 809 (message "Please wait: formatting the %s man page..." Man-arguments)
761 (goto-char (point-min)) 810 (goto-char (point-min))
762 (while (search-forward "\e[1m" nil t) 811 (while (search-forward "\e[1m" nil t)
763 (delete-backward-char 4) 812 (delete-backward-char 4)
@@ -976,6 +1025,9 @@ The following key bindings are currently in effect in the buffer:
976 (auto-fill-mode -1) 1025 (auto-fill-mode -1)
977 (use-local-map Man-mode-map) 1026 (use-local-map Man-mode-map)
978 (set-syntax-table man-mode-syntax-table) 1027 (set-syntax-table man-mode-syntax-table)
1028 (setq imenu-generic-expression (list (list nil Man-heading-regexp 0)))
1029 (set (make-local-variable 'outline-regexp) Man-heading-regexp)
1030 (set (make-local-variable 'outline-level) (lambda () 1))
979 (Man-build-page-list) 1031 (Man-build-page-list)
980 (Man-strip-page-headers) 1032 (Man-strip-page-headers)
981 (Man-unindent) 1033 (Man-unindent)
diff --git a/lisp/play/landmark.el b/lisp/play/landmark.el
index fff7f73768b..4b5e8f68c2c 100644
--- a/lisp/play/landmark.el
+++ b/lisp/play/landmark.el
@@ -4,7 +4,7 @@
4 4
5;; Author: Terrence Brannon (was: <brannon@rana.usc.edu>) 5;; Author: Terrence Brannon (was: <brannon@rana.usc.edu>)
6;; Created: December 16, 1996 - first release to usenet 6;; Created: December 16, 1996 - first release to usenet
7;; Keywords: gomoku neural network adaptive search chemotaxis 7;; Keywords: gomoku, neural network, adaptive search, chemotaxis
8 8
9;;;_* Usage 9;;;_* Usage
10;;; Just type 10;;; Just type
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el
index 1f15184f552..62633fe2940 100644
--- a/lisp/progmodes/cfengine.el
+++ b/lisp/progmodes/cfengine.el
@@ -239,7 +239,11 @@ to the action header."
239 (setq imenu-generic-expression cfengine-imenu-expression) 239 (setq imenu-generic-expression cfengine-imenu-expression)
240 (set (make-local-variable 'beginning-of-defun-function) 240 (set (make-local-variable 'beginning-of-defun-function)
241 #'cfengine-beginning-of-defun) 241 #'cfengine-beginning-of-defun)
242 (set (make-local-variable 'end-of-defun-function) #'cfengine-end-of-defun)) 242 (set (make-local-variable 'end-of-defun-function) #'cfengine-end-of-defun)
243 ;; Like Lisp mode. Without this, we lose with, say,
244 ;; `backward-up-list' when there's an unbalanced quote in a
245 ;; preceding comment.
246 (set (make-local-variable 'parse-sexp-ignore-comments) t))
243 247
244(provide 'cfengine) 248(provide 'cfengine)
245 249
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 8b820d07472..34611d3aa37 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -927,9 +927,9 @@ exited abnormally with code %d\n"
927 (if (buffer-local-value 'compilation-scroll-output outbuf) 927 (if (buffer-local-value 'compilation-scroll-output outbuf)
928 (save-selected-window 928 (save-selected-window
929 (select-window outwin) 929 (select-window outwin)
930 (goto-char (point-max))) 930 (goto-char (point-max))))
931 ;; Make it so the next C-x ` will use this buffer. 931 ;; Make it so the next C-x ` will use this buffer.
932 (setq compilation-last-buffer outbuf)))) 932 (setq compilation-last-buffer outbuf)))
933 933
934(defun compilation-set-window-height (window) 934(defun compilation-set-window-height (window)
935 "Set the height of WINDOW according to `compilation-window-height'." 935 "Set the height of WINDOW according to `compilation-window-height'."
diff --git a/lisp/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 1ae5ce2cfce..1ae5ce2cfce 100644
--- a/lisp/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el
index 7cadcc7368b..e6861cc486c 100644
--- a/lisp/ruler-mode.el
+++ b/lisp/ruler-mode.el
@@ -1,6 +1,6 @@
1;;; ruler-mode.el --- display a ruler in the header line 1;;; ruler-mode.el --- display a ruler in the header line
2 2
3;; Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
4 4
5;; Author: David Ponce <david@dponce.com> 5;; Author: David Ponce <david@dponce.com>
6;; Maintainer: David Ponce <david@dponce.com> 6;; Maintainer: David Ponce <david@dponce.com>
@@ -95,7 +95,7 @@
95;; important to use the same font family and size for ruler and text 95;; important to use the same font family and size for ruler and text
96;; areas. 96;; areas.
97;; 97;;
98;; You can override the ruler format by defining an appropriate 98;; You can override the ruler format by defining an appropriate
99;; function as the buffer-local value of `ruler-mode-ruler-function'. 99;; function as the buffer-local value of `ruler-mode-ruler-function'.
100 100
101;; Installation 101;; Installation
@@ -531,19 +531,15 @@ START-EVENT is the mouse click event."
531 531
532(defvar ruler-mode-header-line-format-old nil 532(defvar ruler-mode-header-line-format-old nil
533 "Hold previous value of `header-line-format'.") 533 "Hold previous value of `header-line-format'.")
534(make-variable-buffer-local 'ruler-mode-header-line-format-old)
535 534
536(defvar ruler-mode-ruler-function nil 535(defvar ruler-mode-ruler-function 'ruler-mode-ruler
537 "If non-nil, function to call to return ruler string. 536 "Function to call to return ruler header line format.
538This variable is expected to be made buffer-local by modes.") 537This variable is expected to be made buffer-local by modes.")
539 538
540(defconst ruler-mode-header-line-format 539(defconst ruler-mode-header-line-format
541 '(:eval (funcall (if ruler-mode-ruler-function 540 '(:eval (funcall ruler-mode-ruler-function))
542 ruler-mode-ruler-function
543 'ruler-mode-ruler)))
544 "`header-line-format' used in ruler mode. 541 "`header-line-format' used in ruler mode.
545If the non-nil value for ruler-mode-ruler-function is given, use it. 542Call `ruler-mode-ruler-function' to compute the ruler value.")
546Else use `ruler-mode-ruler' is used as default value.")
547 543
548;;;###autoload 544;;;###autoload
549(define-minor-mode ruler-mode 545(define-minor-mode ruler-mode
@@ -556,18 +552,18 @@ Else use `ruler-mode-ruler' is used as default value.")
556 ;; When `ruler-mode' is on save previous header line format 552 ;; When `ruler-mode' is on save previous header line format
557 ;; and install the ruler header line format. 553 ;; and install the ruler header line format.
558 (when (local-variable-p 'header-line-format) 554 (when (local-variable-p 'header-line-format)
559 (setq ruler-mode-header-line-format-old header-line-format)) 555 (set (make-local-variable 'ruler-mode-header-line-format-old)
556 header-line-format))
560 (setq header-line-format ruler-mode-header-line-format) 557 (setq header-line-format ruler-mode-header-line-format)
561 (add-hook 'post-command-hook ; add local hook 558 (add-hook 'post-command-hook 'force-mode-line-update nil t))
562 #'force-mode-line-update nil t))
563 ;; When `ruler-mode' is off restore previous header line format if 559 ;; When `ruler-mode' is off restore previous header line format if
564 ;; the current one is the ruler header line format. 560 ;; the current one is the ruler header line format.
565 (when (eq header-line-format ruler-mode-header-line-format) 561 (when (eq header-line-format ruler-mode-header-line-format)
566 (kill-local-variable 'header-line-format) 562 (kill-local-variable 'header-line-format)
567 (when (local-variable-p 'ruler-mode-header-line-format-old) 563 (when (local-variable-p 'ruler-mode-header-line-format-old)
568 (setq header-line-format ruler-mode-header-line-format-old))) 564 (setq header-line-format ruler-mode-header-line-format-old)
569 (remove-hook 'post-command-hook ; remove local hook 565 (kill-local-variable 'ruler-mode-header-line-format-old)))
570 #'force-mode-line-update t))) 566 (remove-hook 'post-command-hook 'force-mode-line-update t)))
571 567
572;; Add ruler-mode to the minor mode menu in the mode line 568;; Add ruler-mode to the minor mode menu in the mode line
573(define-key mode-line-mode-menu [ruler-mode] 569(define-key mode-line-mode-menu [ruler-mode]
@@ -621,133 +617,124 @@ mouse-2: unset goal column"
621(defsubst ruler-mode-space (width &rest props) 617(defsubst ruler-mode-space (width &rest props)
622 "Return a single space string of WIDTH times the normal character width. 618 "Return a single space string of WIDTH times the normal character width.
623Optional argument PROPS specifies other text properties to apply." 619Optional argument PROPS specifies other text properties to apply."
624 (if (> width 0) 620 (apply 'propertize " " 'display (list 'space :width width) props))
625 (apply 'propertize " " 'display (list 'space :width width) props)
626 ""))
627 621
628(defun ruler-mode-ruler () 622(defun ruler-mode-ruler ()
629 "Return a string ruler." 623 "Compute and return an header line ruler."
630 (when ruler-mode 624 (let* ((w (window-width))
631 (let* ((w (window-width)) 625 (m (window-margins))
632 (m (window-margins)) 626 (f (window-fringes))
633 (lsb (scroll-bar-columns 'left)) 627 (i 0)
634 (lf (fringe-columns 'left t)) 628 (j (window-hscroll))
635 (lm (or (car m) 0)) 629 ;; Setup the scrollbar, fringes, and margins areas.
636 (rsb (scroll-bar-columns 'right)) 630 (lf (ruler-mode-space
637 (rf (fringe-columns 'right t)) 631 'left-fringe
638 (rm (or (cdr m) 0)) 632 'face 'ruler-mode-fringes-face
639 (ruler (make-string w ruler-mode-basic-graduation-char)) 633 'help-echo (format ruler-mode-fringe-help-echo
640 (i 0) 634 "Left" (or (car f) 0))))
641 (j (window-hscroll)) 635 (rf (ruler-mode-space
642 k c l1 l2 r2 r1 h1 h2 f1 f2) 636 'right-fringe
643 637 'face 'ruler-mode-fringes-face
644 ;; Setup the default properties. 638 'help-echo (format ruler-mode-fringe-help-echo
645 (put-text-property 0 w 'face 'ruler-mode-default-face ruler) 639 "Right" (or (cadr f) 0))))
646 (put-text-property 0 w 640 (lm (ruler-mode-space
647 'help-echo 641 'left-margin
648 (cond 642 'face 'ruler-mode-margins-face
649 (ruler-mode-show-tab-stops 643 'help-echo (format ruler-mode-margin-help-echo
650 ruler-mode-ruler-help-echo-when-tab-stops) 644 "Left" (or (car m) 0))))
651 (goal-column 645 (rm (ruler-mode-space
652 ruler-mode-ruler-help-echo-when-goal-column) 646 'right-margin
653 (t 647 'face 'ruler-mode-margins-face
654 ruler-mode-ruler-help-echo)) 648 'help-echo (format ruler-mode-margin-help-echo
655 ruler) 649 "Right" (or (cdr m) 0))))
656 ;; Setup the local map. 650 (sb (ruler-mode-space
657 (put-text-property 0 w 'local-map ruler-mode-map ruler) 651 'scroll-bar
658 652 'face 'ruler-mode-pad-face))
659 ;; Setup the active area. 653 ;; Remember the scrollbar vertical type.
660 (while (< i w) 654 (sbvt (car (window-current-scroll-bars)))
661 ;; Graduations. 655 ;; Create an "clean" ruler.
662 (cond 656 (ruler
663 ;; Show a number graduation. 657 (propertize
664 ((= (mod j 10) 0) 658 (make-string w ruler-mode-basic-graduation-char)
665 (setq c (number-to-string (/ j 10)) 659 'face 'ruler-mode-default-face
666 m (length c) 660 'local-map ruler-mode-map
667 k i) 661 'help-echo (cond
668 (put-text-property 662 (ruler-mode-show-tab-stops
669 i (1+ i) 'face 'ruler-mode-column-number-face 663 ruler-mode-ruler-help-echo-when-tab-stops)
670 ruler) 664 (goal-column
671 (while (and (> m 0) (>= k 0)) 665 ruler-mode-ruler-help-echo-when-goal-column)
672 (aset ruler k (aref c (setq m (1- m)))) 666 (ruler-mode-ruler-help-echo))))
673 (setq k (1- k)))) 667 k c)
674 ;; Show an intermediate graduation. 668 ;; Setup the active area.
675 ((= (mod j 5) 0) 669 (while (< i w)
676 (aset ruler i ruler-mode-inter-graduation-char))) 670 ;; Graduations.
677 ;; Special columns. 671 (cond
678 (cond 672 ;; Show a number graduation.
679 ;; Show the `current-column' marker. 673 ((= (mod j 10) 0)
680 ((= j (current-column)) 674 (setq c (number-to-string (/ j 10))
681 (aset ruler i ruler-mode-current-column-char) 675 m (length c)
682 (put-text-property 676 k i)
683 i (1+ i) 'face 'ruler-mode-current-column-face 677 (put-text-property
684 ruler)) 678 i (1+ i) 'face 'ruler-mode-column-number-face
685 ;; Show the `goal-column' marker. 679 ruler)
686 ((and goal-column (= j goal-column)) 680 (while (and (> m 0) (>= k 0))
687 (aset ruler i ruler-mode-goal-column-char) 681 (aset ruler k (aref c (setq m (1- m))))
688 (put-text-property 682 (setq k (1- k))))
689 i (1+ i) 'face 'ruler-mode-goal-column-face 683 ;; Show an intermediate graduation.
690 ruler) 684 ((= (mod j 5) 0)
691 (put-text-property 685 (aset ruler i ruler-mode-inter-graduation-char)))
692 i (1+ i) 'help-echo ruler-mode-goal-column-help-echo 686 ;; Special columns.
693 ruler)) 687 (cond
694 ;; Show the `comment-column' marker. 688 ;; Show the `current-column' marker.
695 ((= j comment-column) 689 ((= j (current-column))
696 (aset ruler i ruler-mode-comment-column-char) 690 (aset ruler i ruler-mode-current-column-char)
697 (put-text-property 691 (put-text-property
698 i (1+ i) 'face 'ruler-mode-comment-column-face 692 i (1+ i) 'face 'ruler-mode-current-column-face
699 ruler) 693 ruler))
700 (put-text-property 694 ;; Show the `goal-column' marker.
701 i (1+ i) 'help-echo ruler-mode-comment-column-help-echo 695 ((and goal-column (= j goal-column))
702 ruler)) 696 (aset ruler i ruler-mode-goal-column-char)
703 ;; Show the `fill-column' marker. 697 (put-text-property
704 ((= j fill-column) 698 i (1+ i) 'face 'ruler-mode-goal-column-face
705 (aset ruler i ruler-mode-fill-column-char) 699 ruler)
706 (put-text-property 700 (put-text-property
707 i (1+ i) 'face 'ruler-mode-fill-column-face 701 i (1+ i) 'help-echo ruler-mode-goal-column-help-echo
708 ruler) 702 ruler))
709 (put-text-property 703 ;; Show the `comment-column' marker.
710 i (1+ i) 'help-echo ruler-mode-fill-column-help-echo 704 ((= j comment-column)
711 ruler)) 705 (aset ruler i ruler-mode-comment-column-char)
712 ;; Show the `tab-stop-list' markers. 706 (put-text-property
713 ((and ruler-mode-show-tab-stops (member j tab-stop-list)) 707 i (1+ i) 'face 'ruler-mode-comment-column-face
714 (aset ruler i ruler-mode-tab-stop-char) 708 ruler)
715 (put-text-property 709 (put-text-property
716 i (1+ i) 'face 'ruler-mode-tab-stop-face 710 i (1+ i) 'help-echo ruler-mode-comment-column-help-echo
717 ruler))) 711 ruler))
718 (setq i (1+ i) 712 ;; Show the `fill-column' marker.
719 j (1+ j))) 713 ((= j fill-column)
720 714 (aset ruler i ruler-mode-fill-column-char)
721 ;; Highlight the fringes and margins. 715 (put-text-property
722 (if (nth 2 (window-fringes)) 716 i (1+ i) 'face 'ruler-mode-fill-column-face
723 ;; fringes outside margins. 717 ruler)
724 (setq l1 lf 718 (put-text-property
725 l2 lm 719 i (1+ i) 'help-echo ruler-mode-fill-column-help-echo
726 r2 rm 720 ruler))
727 r1 rf 721 ;; Show the `tab-stop-list' markers.
728 h1 ruler-mode-fringe-help-echo 722 ((and ruler-mode-show-tab-stops (member j tab-stop-list))
729 h2 ruler-mode-margin-help-echo 723 (aset ruler i ruler-mode-tab-stop-char)
730 f1 'ruler-mode-fringes-face 724 (put-text-property
731 f2 'ruler-mode-margins-face) 725 i (1+ i) 'face 'ruler-mode-tab-stop-face
732 ;; fringes inside margins. 726 ruler)))
733 (setq l1 lm 727 (setq i (1+ i)
734 l2 lf 728 j (1+ j)))
735 r2 rf 729 ;; Return the ruler propertized string. Using list here,
736 r1 rm 730 ;; instead of concat visually separate the different areas.
737 h1 ruler-mode-margin-help-echo 731 (if (nth 2 (window-fringes))
738 h2 ruler-mode-fringe-help-echo 732 ;; fringes outside margins.
739 f1 'ruler-mode-margins-face 733 (list "" (and (eq 'left sbvt) sb) lf lm
740 f2 'ruler-mode-fringes-face)) 734 ruler rm rf (and (eq 'right sbvt) sb))
741 ;; Return the ruler propertized string. Using list here, 735 ;; fringes inside margins.
742 ;; instead of concat visually separate the different areas. 736 (list "" (and (eq 'left sbvt) sb) lm lf
743 (list 737 ruler rf rm (and (eq 'right sbvt) sb)))))
744 (ruler-mode-space lsb 'face 'ruler-mode-pad-face)
745 (ruler-mode-space l1 'face f1 'help-echo (format h1 "Left" l1))
746 (ruler-mode-space l2 'face f2 'help-echo (format h2 "Left" l2))
747 ruler
748 (ruler-mode-space r2 'face f2 'help-echo (format h2 "Right" r2))
749 (ruler-mode-space r1 'face f1 'help-echo (format h1 "Right" r1))
750 (ruler-mode-space rsb 'face 'ruler-mode-pad-face)))))
751 738
752(provide 'ruler-mode) 739(provide 'ruler-mode)
753 740
diff --git a/lisp/simple.el b/lisp/simple.el
index f41b9cbd11a..6bc89ae1750 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -4116,6 +4116,15 @@ The completion list buffer is available as the value of `standard-output'.")
4116 4116
4117;; This function goes in completion-setup-hook, so that it is called 4117;; This function goes in completion-setup-hook, so that it is called
4118;; after the text of the completion list buffer is written. 4118;; after the text of the completion list buffer is written.
4119(defface completion-emphasis
4120 '((t (:inherit bold)))
4121 "Face put on the first uncommon character in completions in *Completions* buffer."
4122 :group 'completion)
4123
4124(defface completion-de-emphasis
4125 '((t (:inherit default)))
4126 "Face put on the common prefix substring in completions in *Completions* buffer."
4127 :group 'completion)
4119 4128
4120(defun completion-setup-function () 4129(defun completion-setup-function ()
4121 (save-excursion 4130 (save-excursion
@@ -4145,6 +4154,27 @@ The completion list buffer is available as the value of `standard-output'.")
4145 (save-match-data 4154 (save-match-data
4146 (if (minibufferp mainbuf) 4155 (if (minibufferp mainbuf)
4147 (setq completion-base-size 0)))) 4156 (setq completion-base-size 0))))
4157 ;; Put emphasis and de-emphasis faces on completions.
4158 (when completion-base-size
4159 (let ((common-string-length (length
4160 (substring mbuf-contents
4161 completion-base-size)))
4162 (element-start (next-single-property-change
4163 (point-min)
4164 'mouse-face))
4165 element-common-end)
4166 (while element-start
4167 (setq element-common-end (+ element-start common-string-length))
4168 (when (and (get-char-property element-start 'mouse-face)
4169 (get-char-property element-common-end 'mouse-face))
4170 (put-text-property element-start element-common-end
4171 'font-lock-face 'completion-de-emphasis)
4172 (put-text-property element-common-end (1+ element-common-end)
4173 'font-lock-face 'completion-emphasis))
4174 (setq element-start (next-single-property-change
4175 element-start
4176 'mouse-face)))))
4177 ;; Insert help string.
4148 (goto-char (point-min)) 4178 (goto-char (point-min))
4149 (if (display-mouse-p) 4179 (if (display-mouse-p)
4150 (insert (substitute-command-keys 4180 (insert (substitute-command-keys
diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el
index add5d718c25..9778bb35b01 100644
--- a/lisp/smerge-mode.el
+++ b/lisp/smerge-mode.el
@@ -179,16 +179,13 @@ Used in `smerge-diff-base-mine' and related functions."
179 :help "Use Ediff to resolve the conflicts" 179 :help "Use Ediff to resolve the conflicts"
180 :active (smerge-check 1)] 180 :active (smerge-check 1)]
181 ["Auto Resolve" smerge-resolve 181 ["Auto Resolve" smerge-resolve
182 :help "Use mode-provided resolution function" 182 :help "Try auto-resolution heuristics"
183 :active (and (smerge-check 1) (local-variable-p 'smerge-resolve-function))] 183 :active (smerge-check 1)]
184 ["Combine" smerge-combine-with-next 184 ["Combine" smerge-combine-with-next
185 :help "Combine current conflict with next" 185 :help "Combine current conflict with next"
186 :active (smerge-check 1)] 186 :active (smerge-check 1)]
187 )) 187 ))
188 188
189(easy-mmode-defmap smerge-context-menu-map
190 `(([down-mouse-3] . smerge-activate-context-menu))
191 "Keymap for context menu appeared on conflicts area.")
192(easy-menu-define smerge-context-menu nil 189(easy-menu-define smerge-context-menu nil
193 "Context menu for mine area in `smerge-mode'." 190 "Context menu for mine area in `smerge-mode'."
194 '(nil 191 '(nil
@@ -246,15 +243,22 @@ Can be nil if the style is undecided, or else:
246 243
247 244
248(defun smerge-keep-all () 245(defun smerge-keep-all ()
249 "Keep all three versions. 246 "Concatenate all versions."
250Convenient for the kind of conflicts that can arise in ChangeLog files."
251 (interactive) 247 (interactive)
252 (smerge-match-conflict) 248 (smerge-match-conflict)
253 (replace-match (concat (or (match-string 1) "") 249 (let ((mb2 (or (match-beginning 2) (point-max)))
254 (or (match-string 2) "") 250 (me2 (or (match-end 2) (point-min))))
255 (or (match-string 3) "")) 251 (delete-region (match-end 3) (match-end 0))
256 t t) 252 (delete-region (max me2 (match-end 1)) (match-beginning 3))
257 (smerge-auto-leave)) 253 (if (and (match-end 2) (/= (match-end 1) (match-end 3)))
254 (delete-region (match-end 1) (match-beginning 2)))
255 (delete-region (match-beginning 0) (min (match-beginning 1) mb2))
256 (smerge-auto-leave)))
257
258(defun smerge-keep-n (n)
259 ;; We used to use replace-match, but that did not preserve markers so well.
260 (delete-region (match-end n) (match-end 0))
261 (delete-region (match-beginning 0) (match-beginning n)))
258 262
259(defun smerge-combine-with-next () 263(defun smerge-combine-with-next ()
260 "Combine the current conflict with the next one." 264 "Combine the current conflict with the next one."
@@ -310,32 +314,30 @@ according to `smerge-match-conflict'.")
310 "Pop up the Smerge mode context menu under mouse." 314 "Pop up the Smerge mode context menu under mouse."
311 (interactive "e") 315 (interactive "e")
312 (if (and smerge-mode 316 (if (and smerge-mode
313 (save-excursion (mouse-set-point event) (smerge-check 1))) 317 (save-excursion (mouse-set-point event) (smerge-check 1)))
314 (progn 318 (progn
315 (mouse-set-point event) 319 (mouse-set-point event)
316 (smerge-match-conflict) 320 (smerge-match-conflict)
317 (let ((i (smerge-get-current)) 321 (let ((i (smerge-get-current))
318 o) 322 o)
319 (if (<= i 0) 323 (if (<= i 0)
320 ;; Out of range 324 ;; Out of range
321 (popup-menu smerge-mode-menu) 325 (popup-menu smerge-mode-menu)
322 ;; Install overlay. 326 ;; Install overlay.
323 (setq o (make-overlay (match-beginning i) (match-end i))) 327 (setq o (make-overlay (match-beginning i) (match-end i)))
324 (unwind-protect 328 (unwind-protect
325 (progn 329 (progn
326 (overlay-put o 'face 'highlight) 330 (overlay-put o 'face 'highlight)
327 (sit-for 0) 331 (sit-for 0) ;Display the new highlighting.
328 (popup-menu (if (smerge-check 2) 332 (popup-menu smerge-context-menu))
329 smerge-mode-menu 333 ;; Delete overlay.
330 smerge-context-menu))) 334 (delete-overlay o)))))
331 ;; Delete overlay.
332 (delete-overlay o)))))
333 ;; There's no conflict at point, the text-props are just obsolete. 335 ;; There's no conflict at point, the text-props are just obsolete.
334 (save-excursion 336 (save-excursion
335 (let ((beg (re-search-backward smerge-end-re nil t)) 337 (let ((beg (re-search-backward smerge-end-re nil t))
336 (end (re-search-forward smerge-begin-re nil t))) 338 (end (re-search-forward smerge-begin-re nil t)))
337 (smerge-remove-props (or beg (point-min)) (or end (point-max))) 339 (smerge-remove-props (or beg (point-min)) (or end (point-max)))
338 (push event unread-command-events))))) 340 (push event unread-command-events)))))
339 341
340(defun smerge-resolve () 342(defun smerge-resolve ()
341 "Resolve the conflict at point intelligently. 343 "Resolve the conflict at point intelligently.
@@ -344,7 +346,24 @@ some major modes. Uses `smerge-resolve-function' to do the actual work."
344 (interactive) 346 (interactive)
345 (smerge-match-conflict) 347 (smerge-match-conflict)
346 (smerge-remove-props) 348 (smerge-remove-props)
347 (funcall smerge-resolve-function) 349 (cond
350 ;; Trivial diff3 -A non-conflicts.
351 ((and (eq (match-end 1) (match-end 3))
352 (eq (match-beginning 1) (match-beginning 3)))
353 ;; FIXME: Add "if [ diff -b MINE OTHER ]; then select OTHER; fi"
354 (smerge-keep-n 3))
355 ((and (match-end 2)
356 ;; FIXME: Add "diff -b BASE MINE | patch OTHER".
357 ;; FIXME: Add "diff -b BASE OTHER | patch MINE".
358 nil)
359 )
360 ((and (not (match-end 2))
361 ;; FIXME: Add "diff -b"-based refinement.
362 nil)
363 )
364 (t
365 ;; Mode-specific conflict resolution.
366 (funcall smerge-resolve-function)))
348 (smerge-auto-leave)) 367 (smerge-auto-leave))
349 368
350(defun smerge-keep-base () 369(defun smerge-keep-base ()
@@ -353,7 +372,7 @@ some major modes. Uses `smerge-resolve-function' to do the actual work."
353 (smerge-match-conflict) 372 (smerge-match-conflict)
354 (smerge-ensure-match 2) 373 (smerge-ensure-match 2)
355 (smerge-remove-props) 374 (smerge-remove-props)
356 (replace-match (match-string 2) t t) 375 (smerge-keep-n 2)
357 (smerge-auto-leave)) 376 (smerge-auto-leave))
358 377
359(defun smerge-keep-other () 378(defun smerge-keep-other ()
@@ -362,7 +381,7 @@ some major modes. Uses `smerge-resolve-function' to do the actual work."
362 (smerge-match-conflict) 381 (smerge-match-conflict)
363 ;;(smerge-ensure-match 3) 382 ;;(smerge-ensure-match 3)
364 (smerge-remove-props) 383 (smerge-remove-props)
365 (replace-match (match-string 3) t t) 384 (smerge-keep-n 3)
366 (smerge-auto-leave)) 385 (smerge-auto-leave))
367 386
368(defun smerge-keep-mine () 387(defun smerge-keep-mine ()
@@ -371,7 +390,7 @@ some major modes. Uses `smerge-resolve-function' to do the actual work."
371 (smerge-match-conflict) 390 (smerge-match-conflict)
372 ;;(smerge-ensure-match 1) 391 ;;(smerge-ensure-match 1)
373 (smerge-remove-props) 392 (smerge-remove-props)
374 (replace-match (match-string 1) t t) 393 (smerge-keep-n 1)
375 (smerge-auto-leave)) 394 (smerge-auto-leave))
376 395
377(defun smerge-get-current () 396(defun smerge-get-current ()
@@ -389,7 +408,7 @@ some major modes. Uses `smerge-resolve-function' to do the actual work."
389 (let ((i (smerge-get-current))) 408 (let ((i (smerge-get-current)))
390 (if (<= i 0) (error "Not inside a version") 409 (if (<= i 0) (error "Not inside a version")
391 (smerge-remove-props) 410 (smerge-remove-props)
392 (replace-match (match-string i) t t) 411 (smerge-keep-n i)
393 (smerge-auto-leave)))) 412 (smerge-auto-leave))))
394 413
395(defun smerge-kill-current () 414(defun smerge-kill-current ()
@@ -399,11 +418,15 @@ some major modes. Uses `smerge-resolve-function' to do the actual work."
399 (let ((i (smerge-get-current))) 418 (let ((i (smerge-get-current)))
400 (if (<= i 0) (error "Not inside a version") 419 (if (<= i 0) (error "Not inside a version")
401 (smerge-remove-props) 420 (smerge-remove-props)
402 (replace-match (mapconcat 421 (let ((left nil))
403 (lambda (j) 422 (dolist (n '(3 2 1))
404 (match-string j)) 423 (if (and (match-end n) (/= (match-end n) (match-end i)))
405 (remove i '(1 2 3)) "") t t) 424 (push n left)))
406 (smerge-auto-leave)))) 425 (if (and (cdr left)
426 (/= (match-end (car left)) (match-end (cadr left))))
427 (ding) ;We don't know how to do that.
428 (smerge-keep-n (car left))
429 (smerge-auto-leave))))))
407 430
408(defun smerge-diff-base-mine () 431(defun smerge-diff-base-mine ()
409 "Diff 'base' and 'mine' version in current conflict region." 432 "Diff 'base' and 'mine' version in current conflict region."
@@ -567,7 +590,7 @@ buffer names."
567 (goto-char (point-min)) 590 (goto-char (point-min))
568 (while (smerge-find-conflict) 591 (while (smerge-find-conflict)
569 (when (match-beginning 2) (setq base t)) 592 (when (match-beginning 2) (setq base t))
570 (replace-match (match-string 1) t t)) 593 (smerge-keep-n 1))
571 (buffer-enable-undo) 594 (buffer-enable-undo)
572 (set-buffer-modified-p nil) 595 (set-buffer-modified-p nil)
573 (funcall mode)) 596 (funcall mode))
@@ -577,7 +600,7 @@ buffer names."
577 (insert-buffer-substring buf) 600 (insert-buffer-substring buf)
578 (goto-char (point-min)) 601 (goto-char (point-min))
579 (while (smerge-find-conflict) 602 (while (smerge-find-conflict)
580 (replace-match (match-string 3) t t)) 603 (smerge-keep-n 3))
581 (buffer-enable-undo) 604 (buffer-enable-undo)
582 (set-buffer-modified-p nil) 605 (set-buffer-modified-p nil)
583 (funcall mode)) 606 (funcall mode))
@@ -590,7 +613,9 @@ buffer names."
590 (insert-buffer-substring buf) 613 (insert-buffer-substring buf)
591 (goto-char (point-min)) 614 (goto-char (point-min))
592 (while (smerge-find-conflict) 615 (while (smerge-find-conflict)
593 (replace-match (or (match-string 2) "") t t)) 616 (if (match-end 2)
617 (smerge-keep-n 2)
618 (delete-region (match-beginning 0) (match-end 0))))
594 (buffer-enable-undo) 619 (buffer-enable-undo)
595 (set-buffer-modified-p nil) 620 (set-buffer-modified-p nil)
596 (funcall mode))) 621 (funcall mode)))
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 57ba513cd7f..2ac09f11256 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -32,7 +32,7 @@
32 32
33(defgroup fill nil 33(defgroup fill nil
34 "Indenting and filling text." 34 "Indenting and filling text."
35 :link '(custom-manual "(emacs)Filling Text") 35 :link '(custom-manual "(emacs)Filling")
36 :group 'editing) 36 :group 'editing)
37 37
38(defcustom fill-individual-varying-indent nil 38(defcustom fill-individual-varying-indent nil
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index e384c01b31b..39fe89bdaaa 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1947,7 +1947,7 @@ SPC: Accept word this time.
1947 (help-2 (concat "[l]ook a word up in alternate dictionary; " 1947 (help-2 (concat "[l]ook a word up in alternate dictionary; "
1948 "e[x/X]it; [q]uit session")) 1948 "e[x/X]it; [q]uit session"))
1949 (help-3 (concat "[u]ncapitalized insert into dict. " 1949 (help-3 (concat "[u]ncapitalized insert into dict. "
1950 "Type 'x C-h d ispell-help' for more help"))) 1950 "Type 'x C-h f ispell-help' for more help")))
1951 (save-window-excursion 1951 (save-window-excursion
1952 (if ispell-help-in-bufferp 1952 (if ispell-help-in-bufferp
1953 (progn 1953 (progn
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 68b408af081..6e129987ec1 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -1,6 +1,6 @@
1;;; tex-mode.el --- TeX, LaTeX, and SliTeX mode commands -*- coding: utf-8 -*- 1;;; tex-mode.el --- TeX, LaTeX, and SliTeX mode commands -*- coding: utf-8 -*-
2 2
3;; Copyright (C) 1985,86,89,92,94,95,96,97,98,1999,2002,2003 3;; Copyright (C) 1985,86,89,92,94,95,96,97,98,1999,2002,03,2004
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -1446,6 +1446,8 @@ Mark is left at original location."
1446;; The utility functions: 1446;; The utility functions:
1447 1447
1448(define-derived-mode tex-shell shell-mode "TeX-Shell" 1448(define-derived-mode tex-shell shell-mode "TeX-Shell"
1449 (set (make-local-variable 'compilation-parse-errors-function)
1450 'tex-compilation-parse-errors)
1449 (compilation-shell-minor-mode t)) 1451 (compilation-shell-minor-mode t))
1450 1452
1451;;;###autoload 1453;;;###autoload
@@ -1879,8 +1881,6 @@ FILE is typically the output DVI or PDF file."
1879 (let (shell-dirtrack-verbose) 1881 (let (shell-dirtrack-verbose)
1880 (tex-send-command tex-shell-cd-command dir))) 1882 (tex-send-command tex-shell-cd-command dir)))
1881 (with-current-buffer (process-buffer (tex-send-command cmd)) 1883 (with-current-buffer (process-buffer (tex-send-command cmd))
1882 (make-local-variable 'compilation-parse-errors-function)
1883 (setq compilation-parse-errors-function 'tex-compilation-parse-errors)
1884 (setq compilation-last-buffer (current-buffer)) 1884 (setq compilation-last-buffer (current-buffer))
1885 (compilation-forget-errors) 1885 (compilation-forget-errors)
1886 ;; Don't parse previous compilations. 1886 ;; Don't parse previous compilations.
@@ -1927,7 +1927,7 @@ for the error messages."
1927 end-of-error (match-end 0))) 1927 end-of-error (match-end 0)))
1928 (re-search-forward 1928 (re-search-forward
1929 "^l\\.\\([0-9]+\\) \\(\\.\\.\\.\\)?\\(.*\\)$" nil 'move)) 1929 "^l\\.\\([0-9]+\\) \\(\\.\\.\\.\\)?\\(.*\\)$" nil 'move))
1930 (let* ((this-error (set-marker (make-marker) begin-of-error)) 1930 (let* ((this-error (copy-marker begin-of-error))
1931 (linenum (string-to-int (match-string 1))) 1931 (linenum (string-to-int (match-string 1)))
1932 (error-text (regexp-quote (match-string 3))) 1932 (error-text (regexp-quote (match-string 3)))
1933 (filename 1933 (filename
diff --git a/lisp/time.el b/lisp/time.el
index ba1b66f8a72..ebc883b3d8e 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -173,9 +173,11 @@ depend on `display-time-day-and-date' and `display-time-24hr-format'."
173 '((if (and (not display-time-format) display-time-day-and-date) 173 '((if (and (not display-time-format) display-time-day-and-date)
174 (format-time-string "%a %b %e " now) 174 (format-time-string "%a %b %e " now)
175 "") 175 "")
176 (format-time-string (or display-time-format 176 (propertize
177 (if display-time-24hr-format "%H:%M" "%-I:%M%p")) 177 (format-time-string (or display-time-format
178 now) 178 (if display-time-24hr-format "%H:%M" "%-I:%M%p"))
179 now)
180 'help-echo (format-time-string "%a %b %e, %Y" now))
179 load 181 load
180 (if mail 182 (if mail
181 ;; Build the string every time to act on customization. 183 ;; Build the string every time to act on customization.
diff --git a/lisp/vc-arch.el b/lisp/vc-arch.el
index 52dc623e9c4..32c5f5459ad 100644
--- a/lisp/vc-arch.el
+++ b/lisp/vc-arch.el
@@ -25,22 +25,21 @@
25;;; Commentary: 25;;; Commentary:
26 26
27;; The home page of the Arch version control system is at 27;; The home page of the Arch version control system is at
28;; 28;;
29;; http://www.gnuarch.org/ 29;; http://www.gnuarch.org/
30;; 30;;
31;; This is derived from vc-mcvs.el as follows: 31;; This is derived from vc-mcvs.el as follows:
32;; - cp vc-mcvs.el vc-arch.el and then M-% mcvs RET arch RET 32;; - cp vc-mcvs.el vc-arch.el and then M-% mcvs RET arch RET
33;; 33;;
34;; Then of course started the hacking. 34;; Then of course started the hacking.
35;; 35;;
36;; What has been partly tested: 36;; What has been partly tested:
37;; - Open a file 37;; - Open a file.
38;; - C-x v = without any prefix arg 38;; - C-x v = without any prefix arg.
39;; - C-x v v to commit a change to a single file 39;; - C-x v v to commit a change to a single file.
40 40
41;; Bugs: 41;; Bugs:
42 42
43;; - Opening a new file prompts "blabla was lost; check out? (yes or no)".
44;; - *VC-log*'s initial content lacks the `Summary:' lines. 43;; - *VC-log*'s initial content lacks the `Summary:' lines.
45;; - All files under the tree are considered as "under Arch's control" 44;; - All files under the tree are considered as "under Arch's control"
46;; without regards to =tagging-method and such. 45;; without regards to =tagging-method and such.
@@ -56,7 +55,7 @@
56 55
57;;; Code: 56;;; Code:
58 57
59(eval-when-compile (require 'vc)) 58(eval-when-compile (require 'vc) (require 'cl))
60 59
61;;; 60;;;
62;;; Customization options 61;;; Customization options
@@ -86,17 +85,103 @@
86;;;###autoload (load "vc-arch") 85;;;###autoload (load "vc-arch")
87;;;###autoload (vc-arch-registered file))))) 86;;;###autoload (vc-arch-registered file)))))
88 87
89(defun vc-arch-add-tag () 88(defun vc-arch-add-tagline ()
90 "Add an `arch-tag' to the end of the current file." 89 "Add an `arch-tag' to the end of the current file."
91 (interactive) 90 (interactive)
91 (comment-normalize-vars)
92 (goto-char (point-max)) 92 (goto-char (point-max))
93 (forward-comment -1) 93 (forward-comment -1)
94 (unless (bolp) (insert "\n")) 94 (unless (bolp) (insert "\n"))
95 (let ((beg (point))) 95 (let ((beg (point))
96 (idfile (and buffer-file-name
97 (expand-file-name
98 (concat ".arch-ids/"
99 (file-name-nondirectory buffer-file-name)
100 ".id")
101 (file-name-directory buffer-file-name)))))
96 (insert "arch-tag: ") 102 (insert "arch-tag: ")
97 (call-process "uuidgen" nil t) ;Also inserts a terminal newline. 103 (if (and idfile (file-exists-p idfile))
104 ;; If the file is unreadable, we do want to get an error here.
105 (progn
106 (insert-file-contents idfile)
107 (forward-line 1)
108 (delete-file idfile))
109 (condition-case nil
110 (call-process "uuidgen" nil t)
111 (file-error (insert (format "%s <%s> %s"
112 (current-time-string)
113 user-mail-address
114 (+ (nth 2 (current-time))
115 (buffer-size)))))))
98 (comment-region beg (point)))) 116 (comment-region beg (point))))
99 117
118(defconst vc-arch-tagline-re "^\\W*arch-tag:[ \t]*\\(.*[^ \t\n]\\)")
119
120(defun vc-arch-file-source-p (file)
121 "Can return nil, `maybe' or a non-nil value.
122Only the value `maybe' can be trusted :-(."
123 ;; FIXME: Check the tag and name of parent dirs.
124 (unless (string-match "\\`[,+]" (file-name-nondirectory file))
125 (or (string-match "\\`{arch}/"
126 (file-relative-name file (vc-arch-root file)))
127 (file-exists-p
128 ;; Check the presence of an ID file.
129 (expand-file-name
130 (concat ".arch-ids/" (file-name-nondirectory file) ".id")
131 (file-name-directory file)))
132 ;; Check the presence of a tagline.
133 (with-current-buffer (find-file-noselect file)
134 (save-excursion
135 (goto-char (point-max))
136 (or (re-search-backward vc-arch-tagline-re (- (point) 1000) t)
137 (progn
138 (goto-char (point-min))
139 (re-search-forward vc-arch-tagline-re (+ (point) 1000) t)))))
140 ;; FIXME: check =tagging-method to see whether untagged files might
141 ;; be source or not.
142 (with-current-buffer
143 (find-file-noselect (expand-file-name "{arch}/=tagging-method"
144 (vc-arch-root file)))
145 (let ((untagged-source t)) ;Default is `names'.
146 (save-excursion
147 (goto-char (point-min))
148 (if (re-search-forward "^[ \t]*\\(\\(tagline\\|implicit\\|names\\)\\|explicit\\)" nil t)
149 (setq untagged-source (match-end 2)))
150 (if (re-search-forward "^[ \t]*untagged-source[ \t]+\\(\\(source\\)\\|precious\\|backup\\|junk\\|unrecognized\\)" nil t)
151 (setq untagged-source (match-end 2))))
152 (if untagged-source 'maybe))))))
153
154(defun vc-arch-file-id (file)
155 ;; Don't include the kind of ID this is because it seems to be too messy.
156 (let ((idfile (expand-file-name
157 (concat ".arch-ids/" (file-name-nondirectory file) ".id")
158 (file-name-directory file))))
159 (if (file-exists-p idfile)
160 (with-temp-buffer
161 (insert-file-contents idfile)
162 (looking-at ".*[^ \n\t]")
163 (match-string 0)))
164 (with-current-buffer (find-file-noselect file)
165 (save-excursion
166 (goto-char (point-max))
167 (if (or (re-search-backward vc-arch-tagline-re (- (point) 1000) t)
168 (progn
169 (goto-char (point-min))
170 (re-search-forward vc-arch-tagline-re (+ (point) 1000) t)))
171 (match-string 1)
172 (concat "./" (file-relative-name file (vc-arch-root file))))))))
173
174(defun vc-arch-tagging-method (file)
175 (with-current-buffer
176 (find-file-noselect
177 (expand-file-name "{arch}/=tagging-method" (vc-arch-root file)))
178 (save-excursion
179 (goto-char (point-min))
180 (if (re-search-forward
181 "^[ \t]*\\(tagline\\|implicit\\|names\\|explicit\\)" nil t)
182 (intern (match-string 1))
183 'names))))
184
100(defun vc-arch-root (file) 185(defun vc-arch-root (file)
101 "Return the root directory of a Arch project, if any." 186 "Return the root directory of a Arch project, if any."
102 (or (vc-file-getprop file 'arch-root) 187 (or (vc-file-getprop file 'arch-root)
@@ -111,11 +196,20 @@
111 (setq file (directory-file-name file)))) 196 (setq file (directory-file-name file))))
112 root)))) 197 root))))
113 198
199(defun vc-arch-register (file &optional rev comment)
200 (if rev (error "Explicit initial revision not supported for Arch."))
201 (let ((tagmet (vc-arch-tagging-method file)))
202 (if (and (memq tagmet '(tagline implicit)) comment-start)
203 (with-current-buffer (find-file-noselect file)
204 (vc-arch-add-tagline))
205 (vc-arch-command nil 0 file "add"))))
206
114(defun vc-arch-registered (file) 207(defun vc-arch-registered (file)
115 ;; Don't check whether it's source or not. Checking would require 208 ;; Don't seriously check whether it's source or not. Checking would
116 ;; running TLA, so it's better to not do it, so it also works if TLA is 209 ;; require running TLA, so it's better to not do it, so it also works if
117 ;; not installed. 210 ;; TLA is not installed.
118 (vc-arch-root file)) 211 (and (vc-arch-root file)
212 (vc-arch-file-source-p file)))
119 213
120(defun vc-arch-default-version (file) 214(defun vc-arch-default-version (file)
121 (or (vc-file-getprop (vc-arch-root file) 'arch-default-version) 215 (or (vc-file-getprop (vc-arch-root file) 'arch-default-version)
@@ -138,8 +232,47 @@ Return non-nil if FILE is unchanged."
138 ;; There's no checkout operation and merging is not done from VC 232 ;; There's no checkout operation and merging is not done from VC
139 ;; so the only operation that's state dependent that VC supports is commit 233 ;; so the only operation that's state dependent that VC supports is commit
140 ;; which is only activated if the file is `edited'. 234 ;; which is only activated if the file is `edited'.
141 'edited) 235 (let* ((root (vc-arch-root file))
142 236 (ver (vc-arch-default-version file))
237 (pat (concat "\\`" (subst-char-in-string ?/ ?% ver)))
238 (dir (expand-file-name ",,inode-sigs/"
239 (expand-file-name "{arch}" root)))
240 (sigfile nil))
241 (dolist (f (if (file-directory-p dir) (directory-files dir t pat)))
242 (if (or (not sigfile) (file-newer-than-file-p f sigfile))
243 (setq sigfile f)))
244 (if (not sigfile)
245 'edited ;We know nothing.
246 (let ((id (vc-arch-file-id file)))
247 (setq id (replace-regexp-in-string "[ \t]" "_" id))
248 (with-current-buffer (find-file-noselect sigfile)
249 (goto-char (point-min))
250 (while (and (search-forward id nil 'move)
251 (progn (goto-char (- (match-beginning 0) 2))
252 ;; Ignore E_ entries used for foo.id files.
253 (or (not (bolp)) (looking-at "E_")))))
254 (if (eobp)
255 ;; ID not found.
256 (if (equal (file-name-nondirectory sigfile)
257 (subst-char-in-string
258 ?/ ?% (vc-arch-workfile-version file)))
259 'added
260 ;; Might be `added' or `up-to-date' as well.
261 ;; FIXME: Check in the patch logs to find out.
262 'edited)
263 ;; Found the ID, let's check the inode.
264 (if (not (re-search-forward
265 "\t.*mtime=\\([0-9]+\\):size=\\([0-9]+\\)"
266 (line-end-position) t))
267 ;; Buh? Unexpected format.
268 'edited
269 (let ((ats (file-attributes file)))
270 (if (and (= (nth 7 ats) (string-to-number (match-string 2)))
271 (equal (format-time-string "%s" (nth 5 ats))
272 (match-string 1)))
273 'up-to-date
274 'edited)))))))))
275
143(defun vc-arch-workfile-version (file) 276(defun vc-arch-workfile-version (file)
144 (let* ((root (expand-file-name "{arch}" (vc-arch-root file))) 277 (let* ((root (expand-file-name "{arch}" (vc-arch-root file)))
145 (defbranch (vc-arch-default-version file))) 278 (defbranch (vc-arch-default-version file)))
@@ -180,15 +313,19 @@ Return non-nil if FILE is unchanged."
180 (if (string-match (car rule) rev) 313 (if (string-match (car rule) rev)
181 (setq rev (replace-match (cdr rule) t nil rev)))) 314 (setq rev (replace-match (cdr rule) t nil rev))))
182 (format "Arch%c%s" 315 (format "Arch%c%s"
183 (if (memq (vc-state file) '(up-to-date needs-patch)) ?- ?:) 316 (case (vc-state file)
317 ((up-to-date needs-patch) ?-)
318 (added ?@)
319 (t ?:))
184 rev))) 320 rev)))
185 321
186(defun vc-arch-diff3-rej-p (rej) 322(defun vc-arch-diff3-rej-p (rej)
187 (and (eq (nth 7 (file-attributes rej)) 56) 323 (let ((attrs (file-attributes rej)))
188 (with-temp-buffer 324 (and attrs (< (nth 7 attrs) 60)
189 (insert-file-contents rej) 325 (with-temp-buffer
190 (goto-char (point-min)) 326 (insert-file-contents rej)
191 (looking-at "Conflicts occured, diff3 conflict markers left in file\\.$")))) 327 (goto-char (point-min))
328 (looking-at "Conflicts occured, diff3 conflict markers left in file\\.")))))
192 329
193(defun vc-arch-delete-rej-if-obsolete () 330(defun vc-arch-delete-rej-if-obsolete ()
194 "For use in `write-file-functions'." 331 "For use in `write-file-functions'."
@@ -216,6 +353,11 @@ Return non-nil if FILE is unchanged."
216 (message "There are unresolved conflicts in %s" 353 (message "There are unresolved conflicts in %s"
217 (file-name-nondirectory rej)))))) 354 (file-name-nondirectory rej))))))
218 355
356(defun vc-arch-find-file-not-found-hook ()
357 ;; Do nothing. We are not sure whether the file is `source' or not,
358 ;; so we shouldn't ask the user whether she wants to check it out.
359 )
360
219(defun vc-arch-checkout-model (file) 'implicit) 361(defun vc-arch-checkout-model (file) 'implicit)
220 362
221(defun vc-arch-checkin (file rev comment) 363(defun vc-arch-checkin (file rev comment)
@@ -231,6 +373,12 @@ Return non-nil if FILE is unchanged."
231 373
232(defun vc-arch-diff (file &optional oldvers newvers) 374(defun vc-arch-diff (file &optional oldvers newvers)
233 "Get a difference report using Arch between two versions of FILE." 375 "Get a difference report using Arch between two versions of FILE."
376 (if (and newvers
377 (vc-up-to-date-p file)
378 (equal newvers (vc-workfile-version file)))
379 ;; Newvers is the base revision and the current file is unchanged,
380 ;; so we can diff with the current file.
381 (setq newvers nil))
234 (if newvers 382 (if newvers
235 (error "Diffing specific revisions not implemented.") 383 (error "Diffing specific revisions not implemented.")
236 (let* ((async (fboundp 'start-process)) 384 (let* ((async (fboundp 'start-process))
diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el
index feb73dd5c31..338300b3718 100644
--- a/lisp/vc-cvs.el
+++ b/lisp/vc-cvs.el
@@ -5,7 +5,7 @@
5;; Author: FSF (see vc.el for full credits) 5;; Author: FSF (see vc.el for full credits)
6;; Maintainer: Andre Spiegel <spiegel@gnu.org> 6;; Maintainer: Andre Spiegel <spiegel@gnu.org>
7 7
8;; $Id: vc-cvs.el,v 1.67 2004/01/20 17:41:18 uid65624 Exp $ 8;; $Id: vc-cvs.el,v 1.68 2004/03/21 15:45:31 spiegel Exp $
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11 11
@@ -533,14 +533,14 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
533;;; History functions 533;;; History functions
534;;; 534;;;
535 535
536(defun vc-cvs-print-log (file) 536(defun vc-cvs-print-log (file &optional buffer)
537 "Get change log associated with FILE." 537 "Get change log associated with FILE."
538 (vc-cvs-command 538 (vc-cvs-command
539 nil 539 buffer
540 (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0) 540 (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0)
541 file "log")) 541 file "log"))
542 542
543(defun vc-cvs-diff (file &optional oldvers newvers) 543(defun vc-cvs-diff (file &optional oldvers newvers buffer)
544 "Get a difference report using CVS between two versions of FILE." 544 "Get a difference report using CVS between two versions of FILE."
545 (if (string= (vc-workfile-version file) "0") 545 (if (string= (vc-workfile-version file) "0")
546 ;; This file is added but not yet committed; there is no master file. 546 ;; This file is added but not yet committed; there is no master file.
@@ -549,13 +549,13 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
549 ;; We regard this as "changed". 549 ;; We regard this as "changed".
550 ;; Diff it against /dev/null. 550 ;; Diff it against /dev/null.
551 ;; Note: this is NOT a "cvs diff". 551 ;; Note: this is NOT a "cvs diff".
552 (apply 'vc-do-command "*vc-diff*" 552 (apply 'vc-do-command (or buffer "*vc-diff*")
553 1 "diff" file 553 1 "diff" file
554 (append (vc-switches nil 'diff) '("/dev/null"))) 554 (append (vc-switches nil 'diff) '("/dev/null")))
555 ;; Even if it's empty, it's locally modified. 555 ;; Even if it's empty, it's locally modified.
556 1) 556 1)
557 (let* ((async (and (vc-stay-local-p file) (fboundp 'start-process))) 557 (let* ((async (and (vc-stay-local-p file) (fboundp 'start-process)))
558 (status (apply 'vc-cvs-command "*vc-diff*" 558 (status (apply 'vc-cvs-command (or buffer "*vc-diff*")
559 (if async 'async 1) 559 (if async 'async 1)
560 file "diff" 560 file "diff"
561 (and oldvers (concat "-r" oldvers)) 561 (and oldvers (concat "-r" oldvers))
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index baed1ace6ed..4b4b1d6f64f 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -6,7 +6,7 @@
6;; Author: FSF (see vc.el for full credits) 6;; Author: FSF (see vc.el for full credits)
7;; Maintainer: Andre Spiegel <spiegel@gnu.org> 7;; Maintainer: Andre Spiegel <spiegel@gnu.org>
8 8
9;; $Id: vc-hooks.el,v 1.161 2004/03/15 03:53:05 monnier Exp $ 9;; $Id: vc-hooks.el,v 1.163 2004/03/23 20:59:19 monnier Exp $
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12 12
@@ -463,8 +463,15 @@ and does not employ any heuristic at all."
463(defun vc-default-workfile-unchanged-p (backend file) 463(defun vc-default-workfile-unchanged-p (backend file)
464 "Check if FILE is unchanged by diffing against the master version. 464 "Check if FILE is unchanged by diffing against the master version.
465Return non-nil if FILE is unchanged." 465Return non-nil if FILE is unchanged."
466 ;; If rev1 is nil, `diff' uses the current workfile version. 466 (let ((diff-args-length
467 (zerop (vc-call diff file))) 467 (length (cadr (symbol-function
468 (vc-find-backend-function backend 'diff))))))
469 (zerop (if (> diff-args-length 4)
470 ;; If the implementation supports it, let the output
471 ;; go to *vc*, not *vc-diff*, since this is an internal call.
472 (vc-call diff file nil nil "*vc*")
473 ;; for backward compatibility
474 (vc-call diff file)))))
468 475
469(defun vc-workfile-version (file) 476(defun vc-workfile-version (file)
470 "Return the version level of the current workfile FILE. 477 "Return the version level of the current workfile FILE.
@@ -758,14 +765,17 @@ Used in `find-file-not-found-functions'."
758 ;; When a file does not exist, ignore cached info about it 765 ;; When a file does not exist, ignore cached info about it
759 ;; from a previous visit. 766 ;; from a previous visit.
760 (vc-file-clearprops buffer-file-name) 767 (vc-file-clearprops buffer-file-name)
761 (if (and (vc-backend buffer-file-name) 768 (let ((backend (vc-backend buffer-file-name)))
762 (yes-or-no-p 769 (if backend (vc-call-backend backend find-file-not-found-hook))))
763 (format "File %s was lost; check out from version control? " 770
764 (file-name-nondirectory buffer-file-name)))) 771(defun vc-default-find-file-not-found-hook (backend)
765 (save-excursion 772 (if (yes-or-no-p
766 (require 'vc) 773 (format "File %s was lost; check out from version control? "
767 (setq default-directory (file-name-directory buffer-file-name)) 774 (file-name-nondirectory buffer-file-name)))
768 (not (vc-error-occurred (vc-checkout buffer-file-name)))))) 775 (save-excursion
776 (require 'vc)
777 (setq default-directory (file-name-directory buffer-file-name))
778 (not (vc-error-occurred (vc-checkout buffer-file-name))))))
769 779
770(add-hook 'find-file-not-found-functions 'vc-file-not-found-hook) 780(add-hook 'find-file-not-found-functions 'vc-file-not-found-hook)
771 781
diff --git a/lisp/vc-rcs.el b/lisp/vc-rcs.el
index 1e86d0a06df..a730522ef05 100644
--- a/lisp/vc-rcs.el
+++ b/lisp/vc-rcs.el
@@ -5,7 +5,7 @@
5;; Author: FSF (see vc.el for full credits) 5;; Author: FSF (see vc.el for full credits)
6;; Maintainer: Andre Spiegel <spiegel@gnu.org> 6;; Maintainer: Andre Spiegel <spiegel@gnu.org>
7 7
8;; $Id: vc-rcs.el,v 1.38 2003/09/01 15:45:17 miles Exp $ 8;; $Id: vc-rcs.el,v 1.39 2004/03/21 15:46:23 spiegel Exp $
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11 11
@@ -479,14 +479,14 @@ Needs RCS 5.6.2 or later for -M."
479;;; History functions 479;;; History functions
480;;; 480;;;
481 481
482(defun vc-rcs-print-log (file) 482(defun vc-rcs-print-log (file &optional buffer)
483 "Get change log associated with FILE." 483 "Get change log associated with FILE."
484 (vc-do-command nil 0 "rlog" (vc-name file))) 484 (vc-do-command buffer 0 "rlog" (vc-name file)))
485 485
486(defun vc-rcs-diff (file &optional oldvers newvers) 486(defun vc-rcs-diff (file &optional oldvers newvers buffer)
487 "Get a difference report using RCS between two versions of FILE." 487 "Get a difference report using RCS between two versions of FILE."
488 (if (not oldvers) (setq oldvers (vc-workfile-version file))) 488 (if (not oldvers) (setq oldvers (vc-workfile-version file)))
489 (apply 'vc-do-command "*vc-diff*" 1 "rcsdiff" file 489 (apply 'vc-do-command (or buffer "*vc-diff*") 1 "rcsdiff" file
490 (append (list "-q" 490 (append (list "-q"
491 (concat "-r" oldvers) 491 (concat "-r" oldvers)
492 (and newvers (concat "-r" newvers))) 492 (and newvers (concat "-r" newvers)))
diff --git a/lisp/vc-sccs.el b/lisp/vc-sccs.el
index ac867fc2f31..1e626b5709e 100644
--- a/lisp/vc-sccs.el
+++ b/lisp/vc-sccs.el
@@ -5,7 +5,7 @@
5;; Author: FSF (see vc.el for full credits) 5;; Author: FSF (see vc.el for full credits)
6;; Maintainer: Andre Spiegel <spiegel@gnu.org> 6;; Maintainer: Andre Spiegel <spiegel@gnu.org>
7 7
8;; $Id: vc-sccs.el,v 1.24 2003/09/01 15:45:17 miles Exp $ 8;; $Id: vc-sccs.el,v 1.25 2004/03/21 15:49:55 spiegel Exp $
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11 11
@@ -270,9 +270,9 @@ EDITABLE non-nil means previous version should be locked."
270;;; History functions 270;;; History functions
271;;; 271;;;
272 272
273(defun vc-sccs-print-log (file) 273(defun vc-sccs-print-log (file &optional buffer)
274 "Get change log associated with FILE." 274 "Get change log associated with FILE."
275 (vc-do-command nil 0 "prs" (vc-name file))) 275 (vc-do-command buffer 0 "prs" (vc-name file)))
276 276
277(defun vc-sccs-logentry-check () 277(defun vc-sccs-logentry-check ()
278 "Check that the log entry in the current buffer is acceptable for SCCS." 278 "Check that the log entry in the current buffer is acceptable for SCCS."
@@ -280,11 +280,11 @@ EDITABLE non-nil means previous version should be locked."
280 (goto-char 512) 280 (goto-char 512)
281 (error "Log must be less than 512 characters; point is now at pos 512"))) 281 (error "Log must be less than 512 characters; point is now at pos 512")))
282 282
283(defun vc-sccs-diff (file &optional oldvers newvers) 283(defun vc-sccs-diff (file &optional oldvers newvers buffer)
284 "Get a difference report using SCCS between two versions of FILE." 284 "Get a difference report using SCCS between two versions of FILE."
285 (setq oldvers (vc-sccs-lookup-triple file oldvers)) 285 (setq oldvers (vc-sccs-lookup-triple file oldvers))
286 (setq newvers (vc-sccs-lookup-triple file newvers)) 286 (setq newvers (vc-sccs-lookup-triple file newvers))
287 (apply 'vc-do-command "*vc-diff*" 1 "vcdiff" (vc-name file) 287 (apply 'vc-do-command (or buffer "*vc-diff*") 1 "vcdiff" (vc-name file)
288 (append (list "-q" 288 (append (list "-q"
289 (and oldvers (concat "-r" oldvers)) 289 (and oldvers (concat "-r" oldvers))
290 (and newvers (concat "-r" newvers))) 290 (and newvers (concat "-r" newvers)))
diff --git a/lisp/vc.el b/lisp/vc.el
index e347598055a..929abee658d 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -7,7 +7,7 @@
7;; Maintainer: Andre Spiegel <spiegel@gnu.org> 7;; Maintainer: Andre Spiegel <spiegel@gnu.org>
8;; Keywords: tools 8;; Keywords: tools
9 9
10;; $Id: vc.el,v 1.368 2004/03/15 03:55:24 monnier Exp $ 10;; $Id: vc.el,v 1.371 2004/03/25 15:39:03 sds Exp $
11 11
12;; This file is part of GNU Emacs. 12;; This file is part of GNU Emacs.
13 13
@@ -264,9 +264,10 @@
264;; 264;;
265;; HISTORY FUNCTIONS 265;; HISTORY FUNCTIONS
266;; 266;;
267;; * print-log (file) 267;; * print-log (file &optional buffer)
268;; 268;;
269;; Insert the revision log of FILE into the *vc* buffer. 269;; Insert the revision log of FILE into BUFFER, or the *vc* buffer
270;; if BUFFER is nil.
270;; 271;;
271;; - show-log-entry (version) 272;; - show-log-entry (version)
272;; 273;;
@@ -301,17 +302,17 @@
301;; default implementation runs rcs2log, which handles RCS- and 302;; default implementation runs rcs2log, which handles RCS- and
302;; CVS-style logs. 303;; CVS-style logs.
303;; 304;;
304;; * diff (file &optional rev1 rev2) 305;; * diff (file &optional rev1 rev2 buffer)
305;; 306;;
306;; Insert the diff for FILE into the *vc-diff* buffer. If REV1 and 307;; Insert the diff for FILE into BUFFER, or the *vc-diff* buffer if
307;; REV2 are non-nil, report differences from REV1 to REV2. If REV1 308;; BUFFER is nil. If REV1 and REV2 are non-nil, report differences
308;; is nil, use the current workfile version (as found in the 309;; from REV1 to REV2. If REV1 is nil, use the current workfile
309;; repository) as the older version; if REV2 is nil, use the current 310;; version (as found in the repository) as the older version; if
310;; workfile contents as the newer version. This function should 311;; REV2 is nil, use the current workfile contents as the newer
311;; pass the value of (vc-switches BACKEND 'diff) to the backend 312;; version. This function should pass the value of (vc-switches
312;; command. It should return a status of either 0 (no differences 313;; BACKEND 'diff) to the backend command. It should return a status
313;; found), or 1 (either non-empty diff or the diff is run 314;; of either 0 (no differences found), or 1 (either non-empty diff
314;; asynchronously). 315;; or the diff is run asynchronously).
315;; 316;;
316;; - diff-tree (dir &optional rev1 rev2) 317;; - diff-tree (dir &optional rev1 rev2)
317;; 318;;
@@ -434,8 +435,13 @@
434;; 435;;
435;; - find-file-hook () 436;; - find-file-hook ()
436;; 437;;
437;; Operation called in current buffer when opening a new file. This can 438;; Operation called in current buffer when opening a file. This can
438;; be used by the backend to setup some local variables it might need. 439;; be used by the backend to setup some local variables it might need.
440;
441;; - find-file-not-found-hook ()
442;;
443;; Operation called in current buffer when opening a non-existing file.
444;; By default, this asks the user if she wants to check out the file.
439 445
440;;; Code: 446;;; Code:
441 447
@@ -1727,7 +1733,9 @@ versions of all registered files in or below it."
1727 'diff-tree dir rel1 rel2)) 1733 'diff-tree dir rel1 rel2))
1728 (vc-exec-after `(let ((inhibit-read-only t)) 1734 (vc-exec-after `(let ((inhibit-read-only t))
1729 (insert "\nEnd of diffs.\n")))) 1735 (insert "\nEnd of diffs.\n"))))
1730 ;; single file diff 1736 ;; Single file diff. It is important that the vc-controlled buffer
1737 ;; is still current at this time, because any local settings in that
1738 ;; buffer should affect the diff command.
1731 (vc-diff-internal file rel1 rel2)) 1739 (vc-diff-internal file rel1 rel2))
1732 (set-buffer "*vc-diff*") 1740 (set-buffer "*vc-diff*")
1733 (if (and (zerop (buffer-size)) 1741 (if (and (zerop (buffer-size))
@@ -1752,8 +1760,8 @@ versions of all registered files in or below it."
1752 1760
1753(defun vc-diff-internal (file rel1 rel2) 1761(defun vc-diff-internal (file rel1 rel2)
1754 "Run diff to compare FILE's revisions REL1 and REL2. 1762 "Run diff to compare FILE's revisions REL1 and REL2.
1755Output goes to the current buffer, which is assumed properly set up. 1763Diff output goes to the *vc-diff* buffer. The exit status of the diff
1756The exit status of the diff command is returned. 1764command is returned.
1757 1765
1758This function takes care to set up a proper coding system for diff output. 1766This function takes care to set up a proper coding system for diff output.
1759If both revisions are available as local files, then it also does not 1767If both revisions are available as local files, then it also does not
@@ -2322,14 +2330,29 @@ allowed and simply skipped)."
2322 2330
2323;;;###autoload 2331;;;###autoload
2324(defun vc-print-log (&optional focus-rev) 2332(defun vc-print-log (&optional focus-rev)
2325 "List the change log of the current buffer in a window. If 2333 "List the change log of the current buffer in a window.
2326FOCUS-REV is non-nil, leave the point at that revision." 2334If FOCUS-REV is non-nil, leave the point at that revision."
2327 (interactive) 2335 (interactive)
2328 (vc-ensure-vc-buffer) 2336 (vc-ensure-vc-buffer)
2329 (let ((file buffer-file-name)) 2337 (let* ((file buffer-file-name)
2338 (backend-function
2339 (symbol-function
2340 (vc-find-backend-function (vc-backend file) 'print-log)))
2341 (print-log-args
2342 (if (byte-code-function-p backend-function)
2343 (aref backend-function 0)
2344 (cadr backend-function))))
2330 (or focus-rev (setq focus-rev (vc-workfile-version file))) 2345 (or focus-rev (setq focus-rev (vc-workfile-version file)))
2331 (vc-call print-log file) 2346 ;; Don't switch to the output buffer before running the command,
2332 (set-buffer "*vc*") 2347 ;; so that any buffer-local settings in the vc-controlled
2348 ;; buffer can be accessed by the command.
2349 (if (cdr print-log-args)
2350 (progn
2351 (vc-call print-log file "*vc-change-log*")
2352 (set-buffer "*vc-change-log*"))
2353 ;; for backward compatibility
2354 (vc-call print-log file)
2355 (set-buffer "*vc*"))
2333 (pop-to-buffer (current-buffer)) 2356 (pop-to-buffer (current-buffer))
2334 (log-view-mode) 2357 (log-view-mode)
2335 (vc-exec-after 2358 (vc-exec-after
@@ -3043,7 +3066,7 @@ colors. `vc-annotate-background' specifies the background color."
3043 (set (make-local-variable 'vc-annotate-parent-rev) vc-annotate-version) 3066 (set (make-local-variable 'vc-annotate-parent-rev) vc-annotate-version)
3044 (set (make-local-variable 'vc-annotate-parent-display-mode) 3067 (set (make-local-variable 'vc-annotate-parent-display-mode)
3045 vc-annotate-display-mode)) 3068 vc-annotate-display-mode))
3046 3069
3047 ;; Don't use the temp-buffer-name until the buffer is created 3070 ;; Don't use the temp-buffer-name until the buffer is created
3048 ;; (only after `with-output-to-temp-buffer'.) 3071 ;; (only after `with-output-to-temp-buffer'.)
3049 (setq vc-annotate-buffers 3072 (setq vc-annotate-buffers
@@ -3098,7 +3121,7 @@ versions after."
3098 (vc-annotate-warp-version rev-at-line)))))) 3121 (vc-annotate-warp-version rev-at-line))))))
3099 3122
3100(defun vc-annotate-revision-previous-to-line () 3123(defun vc-annotate-revision-previous-to-line ()
3101 "Visit the annotation of the version before the version at line." 3124 "Visit the annotation of the version before the version at line."
3102 (interactive) 3125 (interactive)
3103 (if (not (equal major-mode 'vc-annotate-mode)) 3126 (if (not (equal major-mode 'vc-annotate-mode))
3104 (message "Cannot be invoked outside of a vc annotate buffer") 3127 (message "Cannot be invoked outside of a vc annotate buffer")
diff --git a/lisp/woman.el b/lisp/woman.el
index ed04ae4c83f..d25f60f58c1 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -809,7 +809,7 @@ Only useful when run on a graphic display such as X or MS-Windows."
809 809
810(defcustom woman-fill-frame nil 810(defcustom woman-fill-frame nil
811 ;; Based loosely on a suggestion by Theodore Jump: 811 ;; Based loosely on a suggestion by Theodore Jump:
812 "*If non-nil then most of the frame width is used." 812 "*If non-nil then most of the window width is used."
813 :type 'boolean 813 :type 'boolean
814 :group 'woman-formatting) 814 :group 'woman-formatting)
815 815
@@ -2211,7 +2211,7 @@ Currently set only from '\" t in the first line of the source file.")
2211 ;; Based loosely on a suggestion by Theodore Jump: 2211 ;; Based loosely on a suggestion by Theodore Jump:
2212 (if (or woman-fill-frame 2212 (if (or woman-fill-frame
2213 (not (and (integerp woman-fill-column) (> woman-fill-column 0)))) 2213 (not (and (integerp woman-fill-column) (> woman-fill-column 0))))
2214 (setq woman-fill-column (- (frame-width) woman-default-indent))) 2214 (setq woman-fill-column (- (window-width) woman-default-indent)))
2215 2215
2216 ;; Check for preprocessor requests: 2216 ;; Check for preprocessor requests:
2217 (goto-char from) 2217 (goto-char from)
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index f8a929317e6..1431de7c87e 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,10 @@
12004-03-22 Juri Linkov <juri@jurta.org>
2
3 * sequences.texi (Sequence Functions): Replace xref to `Vectors'
4 with `Vector Functions'.
5
6 * text.texi (Sorting): Add missing quote.
7
12004-03-14 Luc Teirlinck <teirllm@auburn.edu> 82004-03-14 Luc Teirlinck <teirllm@auburn.edu>
2 9
3 * intro.texi (Lisp History): Replace xref to `cl' manual with 10 * intro.texi (Lisp History): Replace xref to `cl' manual with
diff --git a/lispref/sequences.texi b/lispref/sequences.texi
index fd7d6519757..06ac8c5f569 100644
--- a/lispref/sequences.texi
+++ b/lispref/sequences.texi
@@ -172,8 +172,8 @@ list. However, the actual values of the properties are shared.
172@xref{Text Properties}. 172@xref{Text Properties}.
173 173
174See also @code{append} in @ref{Building Lists}, @code{concat} in 174See also @code{append} in @ref{Building Lists}, @code{concat} in
175@ref{Creating Strings}, and @code{vconcat} in @ref{Vectors}, for other 175@ref{Creating Strings}, and @code{vconcat} in @ref{Vector Functions},
176ways to copy sequences. 176for other ways to copy sequences.
177 177
178@example 178@example
179@group 179@group
diff --git a/lispref/text.texi b/lispref/text.texi
index 413c10e29c1..bb57da746bf 100644
--- a/lispref/text.texi
+++ b/lispref/text.texi
@@ -1750,7 +1750,7 @@ REVERSE (non-nil means reverse order),\
1750 BEG and END (region to sort). 1750 BEG and END (region to sort).
1751The variable `sort-fold-case' determines\ 1751The variable `sort-fold-case' determines\
1752 whether alphabetic case affects 1752 whether alphabetic case affects
1753the sort order. 1753the sort order."
1754@end group 1754@end group
1755@group 1755@group
1756 (interactive "P\nr") 1756 (interactive "P\nr")
diff --git a/man/ChangeLog b/man/ChangeLog
index e8f57a84de2..63277cb57f7 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,19 @@
12004-03-22 Juri Linkov <juri@jurta.org>
2
3 * emacs.texi (Top): Add `Misc X'.
4
5 * faq.texi, trouble.texi: Fix help key bindings.
6
7 * glossary.texi: Improve references.
8
9 * help.texi: Sync keywords with finder.el.
10
11 * mini.texi (Completion): Add description for menu items.
12
13 * misc.texi (Browse-URL, FFAP): Add information about keywords.
14
15 * sending.texi (Mail Methods): Fix xref to Message manual.
16
12004-03-17 Luc Teirlinck <teirllm@auburn.edu> 172004-03-17 Luc Teirlinck <teirllm@auburn.edu>
2 18
3 * info.texi (Advanced): Replace @unnumberedsubsec by @subheading 19 * info.texi (Advanced): Replace @unnumberedsubsec by @subheading
diff --git a/man/emacs.texi b/man/emacs.texi
index d932dd04200..3162cd1e167 100644
--- a/man/emacs.texi
+++ b/man/emacs.texi
@@ -810,6 +810,7 @@ Command Line Options and Arguments
810* Borders X:: Internal and external borders, under X. 810* Borders X:: Internal and external borders, under X.
811* Title X:: Specifying the initial frame's title. 811* Title X:: Specifying the initial frame's title.
812* Icons X:: Choosing what sort of icon to use, under X. 812* Icons X:: Choosing what sort of icon to use, under X.
813* Misc X:: Other display options.
813 814
814X Resources 815X Resources
815 816
diff --git a/man/faq.texi b/man/faq.texi
index 91c485fb79f..6894918079e 100644
--- a/man/faq.texi
+++ b/man/faq.texi
@@ -613,7 +613,7 @@ command-apropos}).
613 613
614@cindex Command description in the manual 614@cindex Command description in the manual
615@item 615@item
616The command @kbd{C-h C-f} (@code{Info-goto-emacs-command-node}) prompts 616The command @kbd{C-h F} (@code{Info-goto-emacs-command-node}) prompts
617for the name of a command, and then attempts to find the section in the 617for the name of a command, and then attempts to find the section in the
618Emacs manual where that command is described. 618Emacs manual where that command is described.
619 619
@@ -980,7 +980,7 @@ The Emacs FAQ is available in several ways:
980@item 980@item
981Inside of Emacs itself. You can get it from selecting the @samp{Emacs 981Inside of Emacs itself. You can get it from selecting the @samp{Emacs
982FAQ} option from the @samp{Help} menu of the Emacs menu bar at the top 982FAQ} option from the @samp{Help} menu of the Emacs menu bar at the top
983of any Emacs frame, or by typing @kbd{C-h F} (@kbd{M-x view-emacs-FAQ}). 983of any Emacs frame, or by typing @kbd{C-h C-f} (@kbd{M-x view-emacs-FAQ}).
984 984
985@item 985@item
986Via USENET. If you can read news, the FAQ should be available in your 986Via USENET. If you can read news, the FAQ should be available in your
@@ -1110,7 +1110,7 @@ Emacs @value{VER} is the current version as of this writing.
1110@cindex Differences between Emacs 19 and Emacs 20 1110@cindex Differences between Emacs 19 and Emacs 20
1111@cindex Emacs 20, new features in 1111@cindex Emacs 20, new features in
1112 1112
1113To find out what has changed in recent versions, type @kbd{C-h n} 1113To find out what has changed in recent versions, type @kbd{C-h C-n}
1114(@kbd{M-x view-emacs-news}). The oldest changes are at the bottom of 1114(@kbd{M-x view-emacs-news}). The oldest changes are at the bottom of
1115the file, so you might want to read it starting there, rather than at 1115the file, so you might want to read it starting there, rather than at
1116the top. 1116the top.
@@ -2687,7 +2687,7 @@ instructions how to do that.
2687 2687
2688The file @file{etc/PROBLEMS} in the Emacs distribution lists various 2688The file @file{etc/PROBLEMS} in the Emacs distribution lists various
2689known problems with building and using Emacs on specific platforms; 2689known problems with building and using Emacs on specific platforms;
2690type @kbd{C-h P} to read it. 2690type @kbd{C-h C-e} to read it.
2691 2691
2692@menu 2692@menu
2693* Problems with very large files:: 2693* Problems with very large files::
diff --git a/man/glossary.texi b/man/glossary.texi
index 541abd24064..017630801a6 100644
--- a/man/glossary.texi
+++ b/man/glossary.texi
@@ -234,8 +234,8 @@ is typed. @xref{Completion}.@refill
234When a line of text is longer than the width of the window, it 234When a line of text is longer than the width of the window, it
235takes up more than one screen line when displayed. We say that the 235takes up more than one screen line when displayed. We say that the
236text line is continued, and all screen lines used for it after the 236text line is continued, and all screen lines used for it after the
237first are called continuation lines. @xref{Basic,Continuation,Basic 237first are called continuation lines. @xref{Continuation Lines}.
238Editing}. A related Emacs feature is `filling' (q.v.@:). 238A related Emacs feature is `filling' (q.v.@:).
239 239
240@item Control Character 240@item Control Character
241A control character is a character that you type by holding down the 241A control character is a character that you type by holding down the
@@ -280,7 +280,7 @@ The cursor is the rectangle on the screen which indicates the position
280called point (q.v.@:) at which insertion and deletion takes place. 280called point (q.v.@:) at which insertion and deletion takes place.
281The cursor is on or under the character that follows point. Often 281The cursor is on or under the character that follows point. Often
282people speak of `the cursor' when, strictly speaking, they mean 282people speak of `the cursor' when, strictly speaking, they mean
283`point.' @xref{Basic,Cursor,Basic Editing}. 283`point.' @xref{Point,Cursor}.
284 284
285@item Customization 285@item Customization
286Customization is making minor changes in the way Emacs works. It is 286Customization is making minor changes in the way Emacs works. It is
@@ -317,7 +317,7 @@ A defun is a major definition at the top level in a program. The name
317@key{DEL} is a character that runs the command to delete one character 317@key{DEL} is a character that runs the command to delete one character
318of text before the cursor. It is typically either the @key{DELETE} 318of text before the cursor. It is typically either the @key{DELETE}
319key or the @key{BACKSPACE} key, whichever one is easy to type. 319key or the @key{BACKSPACE} key, whichever one is easy to type.
320@xref{Basic,DEL,Basic Editing}. 320@xref{Erasing,DEL}.
321 321
322@item Deletion 322@item Deletion
323Deletion means erasing text without copying it into the kill ring 323Deletion means erasing text without copying it into the kill ring
@@ -547,7 +547,7 @@ just names. All the non-Meta (q.v.@:) characters except for the
547Control (q.v.@:) characters are graphic characters. These include 547Control (q.v.@:) characters are graphic characters. These include
548letters, digits, punctuation, and spaces; they do not include 548letters, digits, punctuation, and spaces; they do not include
549@key{RET} or @key{ESC}. In Emacs, typing a graphic character inserts 549@key{RET} or @key{ESC}. In Emacs, typing a graphic character inserts
550that character (in ordinary editing modes). @xref{Basic,,Basic Editing}. 550that character (in ordinary editing modes). @xref{Inserting Text}.
551 551
552@item Highlighting 552@item Highlighting
553Highlighting text means displaying it with a different foreground and/or 553Highlighting text means displaying it with a different foreground and/or
@@ -639,7 +639,7 @@ See `incremental search.'
639@item Justification 639@item Justification
640Justification means adding extra spaces within lines of text to make 640Justification means adding extra spaces within lines of text to make
641them extend exactly to a specified width. 641them extend exactly to a specified width.
642@xref{Filling,Justification}. 642@xref{Format Justification}.
643 643
644@item Keyboard Macro 644@item Keyboard Macro
645Keyboard macros are a way of defining new Emacs commands from 645Keyboard macros are a way of defining new Emacs commands from
@@ -730,7 +730,7 @@ A local value of a variable (q.v.@:) applies to only one buffer.
730@item @kbd{M-} 730@item @kbd{M-}
731@kbd{M-} in the name of a character is an abbreviation for @key{META}, 731@kbd{M-} in the name of a character is an abbreviation for @key{META},
732one of the modifier keys that can accompany any character. 732one of the modifier keys that can accompany any character.
733@xref{User Input}. 733@xref{User Input,M-}.
734 734
735@item @kbd{M-C-} 735@item @kbd{M-C-}
736@kbd{M-C-} in the name of a character is an abbreviation for 736@kbd{M-C-} in the name of a character is an abbreviation for
@@ -894,7 +894,7 @@ end of a word or expression. @xref{Syntax}.
894Point is the place in the buffer at which insertion and deletion 894Point is the place in the buffer at which insertion and deletion
895occur. Point is considered to be between two characters, not at one 895occur. Point is considered to be between two characters, not at one
896character. The terminal's cursor (q.v.@:) indicates the location of 896character. The terminal's cursor (q.v.@:) indicates the location of
897point. @xref{Basic,Point,Basic Editing}. 897point. @xref{Point}.
898 898
899@item Prefix Argument 899@item Prefix Argument
900See `numeric argument.' 900See `numeric argument.'
@@ -942,7 +942,7 @@ convention. For example, an ``ordinary'' character as an Emacs command
942inserts itself; so in this context, a special character is any character 942inserts itself; so in this context, a special character is any character
943that does not normally insert itself (such as @key{DEL}, for example), 943that does not normally insert itself (such as @key{DEL}, for example),
944and quoting it makes it insert itself as if it were not special. Not 944and quoting it makes it insert itself as if it were not special. Not
945all contexts allow quoting. @xref{Basic,Quoting,Basic Editing}. 945all contexts allow quoting. @xref{Inserting Text,Quoting}.
946 946
947@item Quoting File Names 947@item Quoting File Names
948Quoting a file name turns off the special significance of constructs 948Quoting a file name turns off the special significance of constructs
@@ -1035,7 +1035,7 @@ systems. @xref{Scroll Bars}.
1035 1035
1036@item Scrolling 1036@item Scrolling
1037Scrolling means shifting the text in the Emacs window so as to see a 1037Scrolling means shifting the text in the Emacs window so as to see a
1038different part of the buffer. @xref{Display,Scrolling}. 1038different part of the buffer. @xref{Scrolling}.
1039 1039
1040@item Searching 1040@item Searching
1041Searching means moving point to the next occurrence of a specified 1041Searching means moving point to the next occurrence of a specified
@@ -1055,7 +1055,7 @@ using the secondary selection. @xref{Secondary Selection}.
1055 1055
1056@item Selecting 1056@item Selecting
1057Selecting a buffer means making it the current (q.v.@:) buffer. 1057Selecting a buffer means making it the current (q.v.@:) buffer.
1058@xref{Buffers,Selecting}. 1058@xref{Select Buffer}.
1059 1059
1060@item Selection 1060@item Selection
1061Windowing systems allow an application program to specify 1061Windowing systems allow an application program to specify
@@ -1212,7 +1212,7 @@ two adjacent characters, words, balanced expressions (q.v.@:) or lines
1212Truncating text lines in the display means leaving out any text on a 1212Truncating text lines in the display means leaving out any text on a
1213line that does not fit within the right margin of the window 1213line that does not fit within the right margin of the window
1214displaying it. See also `continuation line.' 1214displaying it. See also `continuation line.'
1215@xref{Basic,Truncation,Basic Editing}. 1215@xref{Continuation Lines,Truncation}.
1216 1216
1217@item TTY 1217@item TTY
1218See `text-only terminal.' 1218See `text-only terminal.'
diff --git a/man/help.texi b/man/help.texi
index f9c873db0c2..56fb9f542d4 100644
--- a/man/help.texi
+++ b/man/help.texi
@@ -71,7 +71,7 @@ Similar, but searches for @var{topic} (which can be a regular
71expression) in the @emph{text} of the manual rather than in its 71expression) in the @emph{text} of the manual rather than in its
72indices. 72indices.
73 73
74@item C-h F 74@item C-h C-f
75This brings up the Emacs FAQ, where you can use the usual search 75This brings up the Emacs FAQ, where you can use the usual search
76commands (@pxref{Search}) to find the information. 76commands (@pxref{Search}) to find the information.
77 77
@@ -343,38 +343,40 @@ use:
343 343
344@multitable {emulations} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} 344@multitable {emulations} {aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
345@item abbrev@tab abbreviation handling, typing shortcuts, macros. 345@item abbrev@tab abbreviation handling, typing shortcuts, macros.
346@item bib@tab support for the bibliography processor @code{bib}. 346@item bib@tab code related to the @code{bib} bibliography processor.
347@item c@tab C and C++ language support. 347@item c@tab support for the C language and related languages.
348@item calendar@tab calendar and time management support. 348@item calendar@tab calendar and time management support.
349@item comm@tab communications, networking, remote access to files. 349@item comm@tab communications, networking, remote access to files.
350@item convenience@tab convenience features for faster editing.
350@item data@tab support for editing files of data. 351@item data@tab support for editing files of data.
351@item docs@tab support for Emacs documentation. 352@item docs@tab support for Emacs documentation.
352@item emulations@tab emulations of other editors. 353@item emulations@tab emulations of other editors.
353@item extensions@tab Emacs Lisp language extensions. 354@item extensions@tab Emacs Lisp language extensions.
354@item faces@tab support for using faces (fonts and colors; @pxref{Faces}). 355@item faces@tab support for multiple fonts.
356@item files@tab support for editing and manipulating files.
355@item frames@tab support for Emacs frames and window systems. 357@item frames@tab support for Emacs frames and window systems.
356@item games@tab games, jokes and amusements. 358@item games@tab games, jokes and amusements.
357@item hardware@tab support for interfacing with exotic hardware. 359@item hardware@tab support for interfacing with exotic hardware.
358@item help@tab support for on-line help systems. 360@item help@tab support for on-line help systems.
359@item hypermedia@tab support for links within text, or other media types. 361@item hypermedia@tab support for links between text or other media types.
360@item i18n@tab internationalization and alternate character-set support. 362@item i18n@tab internationalization and alternate character-set support.
361@item internal@tab code for Emacs internals, build process, defaults. 363@item internal@tab code for Emacs internals, build process, defaults.
362@item languages@tab specialized modes for editing programming languages. 364@item languages@tab specialized modes for editing programming languages.
363@item lisp@tab support for using Lisp (including Emacs Lisp). 365@item lisp@tab Lisp support, including Emacs Lisp.
364@item local@tab libraries local to your site. 366@item local@tab code local to your site.
365@item maint@tab maintenance aids for the Emacs development group. 367@item maint@tab maintenance aids for the Emacs development group.
366@item mail@tab modes for electronic-mail handling. 368@item mail@tab modes for electronic-mail handling.
367@item matching@tab searching and matching. 369@item matching@tab various sorts of searching and matching.
370@item mouse@tab mouse support.
371@item multimedia@tab images and sound support.
368@item news@tab support for netnews reading and posting. 372@item news@tab support for netnews reading and posting.
369@item non-text@tab support for editing files that are not ordinary text.
370@item oop@tab support for object-oriented programming. 373@item oop@tab support for object-oriented programming.
371@item outlines@tab hierarchical outlining. 374@item outlines@tab support for hierarchical outlining.
372@item processes@tab process, subshell, compilation, and job control support. 375@item processes@tab process, subshell, compilation, and job control support.
373@item terminals@tab support for terminal types. 376@item terminals@tab support for terminal types.
374@item tex@tab support for the @TeX{} formatter. 377@item tex@tab supporting code for the @TeX{} formatter.
375@item tools@tab programming tools. 378@item tools@tab programming tools.
376@item unix@tab front-ends/assistants for, or emulators of, system features. 379@item unix@tab front-ends/assistants for, or emulators of, UNIX-like features.
377@item vms@tab support code for VMS.
378@item wp@tab word processing. 380@item wp@tab word processing.
379@end multitable 381@end multitable
380 382
diff --git a/man/mini.texi b/man/mini.texi
index 1022424f3de..040306ba041 100644
--- a/man/mini.texi
+++ b/man/mini.texi
@@ -206,10 +206,10 @@ Completion does ignore case distinctions for certain arguments in which
206case does not matter. 206case does not matter.
207 207
208@menu 208@menu
209* Example: Completion Example. 209* Example: Completion Example. Examples of using completion.
210* Commands: Completion Commands. 210* Commands: Completion Commands. A list of completion commands.
211* Strict Completion:: 211* Strict Completion:: Different types of completion.
212* Options: Completion Options. 212* Options: Completion Options. Options for completion.
213@end menu 213@end menu
214 214
215@node Completion Example 215@node Completion Example
diff --git a/man/misc.texi b/man/misc.texi
index 9835ef83411..83c86a1867a 100644
--- a/man/misc.texi
+++ b/man/misc.texi
@@ -2172,9 +2172,10 @@ which you might like to bind to keys, such as
2172@code{browse-url-browser-function}. You can invoke actions dependent 2172@code{browse-url-browser-function}. You can invoke actions dependent
2173on the type of URL by defining @code{browse-url-browser-function} as 2173on the type of URL by defining @code{browse-url-browser-function} as
2174an association list. The package's commentary available via @kbd{C-h 2174an association list. The package's commentary available via @kbd{C-h
2175p} provides more information. Packages with facilities for following 2175p} under the @samp{hypermedia} keyword provides more information.
2176URLs should always go through Browse-URL, so that the customization 2176Packages with facilities for following URLs should always go through
2177options for Browse-URL will affect all browsing in Emacs. 2177Browse-URL, so that the customization options for Browse-URL will
2178affect all browsing in Emacs.
2178 2179
2179@node Goto-address 2180@node Goto-address
2180@subsection Activating URLs 2181@subsection Activating URLs
@@ -2221,14 +2222,14 @@ view it.
2221 2222
2222 This feature is useful for following references in mail or news 2223 This feature is useful for following references in mail or news
2223buffers, @file{README} files, @file{MANIFEST} files, and so on. The 2224buffers, @file{README} files, @file{MANIFEST} files, and so on. The
2224@samp{ffap} package's commentary available via @kbd{C-h p} and the 2225@samp{ffap} package's commentary available via @kbd{C-h p} under the
2225@code{ffap} Custom group provide details. 2226@samp{files} keyword and the @code{ffap} Custom group provide details.
2226 2227
2227@cindex FFAP minor mode 2228@cindex FFAP minor mode
2228@findex ffap-mode 2229@findex ffap-mode
2229 You can turn on FFAP minor mode to make the following key bindings 2230 You can turn on FFAP minor mode by calling @code{ffap-bindings} to
2230and to install hooks for using @code{ffap} in Rmail, Gnus and VM 2231make the following key bindings and to install hooks for using
2231article buffers. 2232@code{ffap} in Rmail, Gnus and VM article buffers.
2232 2233
2233@table @kbd 2234@table @kbd
2234@item C-x C-f @var{filename} @key{RET} 2235@item C-x C-f @var{filename} @key{RET}
diff --git a/man/sending.texi b/man/sending.texi
index 99ce5c3a594..5bc54294cf9 100644
--- a/man/sending.texi
+++ b/man/sending.texi
@@ -687,7 +687,7 @@ message into outgoing mail. To do this, add
687and sending mail---Mail mode. Emacs has alternative facilities for 687and sending mail---Mail mode. Emacs has alternative facilities for
688editing and sending mail, including 688editing and sending mail, including
689MH-E and Message mode, not documented in this manual. 689MH-E and Message mode, not documented in this manual.
690@xref{Top,,MH-E,mh-e, The Emacs Interface to MH}. @xref{Top,,,message, 690@xref{Top,,MH-E,mh-e, The Emacs Interface to MH}. @xref{Top,,Message,message,
691Message Manual}. You can choose any of them as your preferred method. 691Message Manual}. You can choose any of them as your preferred method.
692The commands @code{C-x m}, @code{C-x 4 m} and @code{C-x 5 m} use 692The commands @code{C-x m}, @code{C-x 4 m} and @code{C-x 5 m} use
693whichever agent you have specified, as do various other Emacs commands 693whichever agent you have specified, as do various other Emacs commands
diff --git a/man/ses.texi b/man/ses.texi
index ecdc5eed8ba..ef346fa8e02 100644
--- a/man/ses.texi
+++ b/man/ses.texi
@@ -835,7 +835,7 @@ Ami Fischman @email{fischman@@zion.bpnetworks.com}@*
835Thomas Gehrlein @email{Thomas.Gehrlein@@t-online.de}@* 835Thomas Gehrlein @email{Thomas.Gehrlein@@t-online.de}@*
836Chris F.A. Johnson @email{c.f.a.johnson@@rogers.com}@* 836Chris F.A. Johnson @email{c.f.a.johnson@@rogers.com}@*
837Yusong Li @email{lyusong@@hotmail.com}@* 837Yusong Li @email{lyusong@@hotmail.com}@*
838Yuri Linkov @email{link0ff@@yahoo.com}@* 838Juri Linkov @email{juri@@jurta.org}@*
839Harald Maier @email{maierh@@myself.com}@* 839Harald Maier @email{maierh@@myself.com}@*
840Alan Nash @email{anash@@san.rr.com}@* 840Alan Nash @email{anash@@san.rr.com}@*
841François Pinard @email{pinard@@iro.umontreal.ca}@* 841François Pinard @email{pinard@@iro.umontreal.ca}@*
diff --git a/man/text.texi b/man/text.texi
index 3470d035ea0..45c7e504d8a 100644
--- a/man/text.texi
+++ b/man/text.texi
@@ -2198,7 +2198,7 @@ Make the region right-filled (@code{set-justification-right}).
2198@kindex M-j f @r{(Enriched mode)} 2198@kindex M-j f @r{(Enriched mode)}
2199@findex set-justification-full 2199@findex set-justification-full
2200@item M-j f 2200@item M-j f
2201Make the region fully-justified (@code{set-justification-full}). 2201Make the region fully justified (@code{set-justification-full}).
2202@kindex M-j c @r{(Enriched mode)} 2202@kindex M-j c @r{(Enriched mode)}
2203@kindex M-S @r{(Enriched mode)} 2203@kindex M-S @r{(Enriched mode)}
2204@findex set-justification-center 2204@findex set-justification-center
diff --git a/man/trouble.texi b/man/trouble.texi
index 3ff84e68c6c..e7f6ae7608b 100644
--- a/man/trouble.texi
+++ b/man/trouble.texi
@@ -124,8 +124,8 @@ about the undo facility.
124normally, and how to recognize them and correct them. For a list of 124normally, and how to recognize them and correct them. For a list of
125additional problems you might encounter, see @ref{Bugs and problems, , 125additional problems you might encounter, see @ref{Bugs and problems, ,
126Bugs and problems, efaq, GNU Emacs FAQ}, and the file @file{etc/PROBLEMS} 126Bugs and problems, efaq, GNU Emacs FAQ}, and the file @file{etc/PROBLEMS}
127in the Emacs distribution. Type @kbd{C-h F} to read the FAQ; type 127in the Emacs distribution. Type @kbd{C-h C-f} to read the FAQ; type
128@kbd{C-h P} to read the @file{PROBLEMS} file. 128@kbd{C-h C-e} to read the @file{PROBLEMS} file.
129 129
130@menu 130@menu
131* DEL Does Not Delete:: What to do if @key{DEL} doesn't delete. 131* DEL Does Not Delete:: What to do if @key{DEL} doesn't delete.
@@ -426,7 +426,7 @@ to do so effectively, you must know when and how to do it.
426 426
427 Before reporting a bug, it is a good idea to see if it is already 427 Before reporting a bug, it is a good idea to see if it is already
428known. You can find the list of known problems in the file 428known. You can find the list of known problems in the file
429@file{etc/PROBLEMS} in the Emacs distribution; type @kbd{C-h P} to read 429@file{etc/PROBLEMS} in the Emacs distribution; type @kbd{C-h C-e} to read
430it. Some additional user-level problems can be found in @ref{Bugs and 430it. Some additional user-level problems can be found in @ref{Bugs and
431problems, , Bugs and problems, efaq, GNU Emacs FAQ}. Looking up your 431problems, , Bugs and problems, efaq, GNU Emacs FAQ}. Looking up your
432problem in these two documents might provide you with a solution or a 432problem in these two documents might provide you with a solution or a
diff --git a/src/ChangeLog b/src/ChangeLog
index 5f65301a7cd..ce03ac5ccda 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,58 @@
12004-03-26 Masatake YAMATO <jet@gyve.org>
2
3 * insdel.c (adjust_markers_for_insert): Call
4 fix_start_end_in_overlays.
5
6 * buffer.c (fix_start_end_in_overlays): Rename
7 fix_overlays_in_range.
8
9 * editfns.c (Ftranspose_regions): Likewise.
10
11 * lisp.h (top_level): Likewise.
12
132004-03-20 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
14
15 * xterm.c (handle_one_xevent): Do not pass key press events to
16 GTK.
17
182004-03-19 Richard M. Stallman <rms@gnu.org>
19
20 * s/sol2-6.h: Delete previous change.
21
222004-03-19 Kim F. Storm <storm@cua.dk>
23
24 * xdisp.c (move_it_in_display_line_to): Fix MOVE_TO_POS case when
25 to_charpos corresponds to newline in right fringe. Use local
26 BUFFER_POS_REACHED_P macro.
27
282004-03-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
29
30 * xdisp.c (calc_pixel_width_or_height): Add ifdef HAVE_WINDOW_SYSTEM
31 to compile on non-window system.
32
332004-03-19 Kim F. Storm <storm@cua.dk>
34
35 * dispextern.h (calc_pixel_width_or_height): Add prototype.
36
37 * image.c (Qcenter): Move to xdisp.c.
38
39 * xdisp.c (Qcenter): Declare here.
40 (syms_of_xdisp): intern and staticpro it.
41 (handle_single_display_prop): Allow space display property on all
42 platforms.
43 (display_mode_line): Set mode_line_p before displaying line.
44 (calc_pixel_width_or_height): Declare extern. Add separate :align-to
45 handling. Remove complex cases for fringes and scroll-bars.
46 Add left, right, and center alignment positions. Add text (area)
47 width/height. Return width or height for image specs.
48 (produce_stretch_glyph): Improve handling of :align-to. Is now
49 relative to left of text area by default, but other base offsets
50 can be specified -- also for text lines.
51
52 * term.c (produce_glyphs): Handle IT_STRETCH.
53 (produce_stretch_glyph): New function to handle space width and
54 align-to display properties on non-window systems.
55
12004-03-17 Stefan Monnier <monnier@iro.umontreal.ca> 562004-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
2 57
3 * fileio.c (Fread_file_name): Set completion-ignore-case for 58 * fileio.c (Fread_file_name): Set completion-ignore-case for
diff --git a/src/buffer.c b/src/buffer.c
index 27b12845c50..08031a0d72b 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -3293,7 +3293,7 @@ adjust_overlays_for_delete (pos, length)
3293 If so, we'll reverse the endpoints. Can you think of anything 3293 If so, we'll reverse the endpoints. Can you think of anything
3294 better to do in this situation? */ 3294 better to do in this situation? */
3295void 3295void
3296fix_overlays_in_range (start, end) 3296fix_start_end_in_overlays (start, end)
3297 register int start, end; 3297 register int start, end;
3298{ 3298{
3299 Lisp_Object overlay; 3299 Lisp_Object overlay;
diff --git a/src/dispextern.h b/src/dispextern.h
index 96e89a48b05..7056519e7bf 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -74,7 +74,6 @@ typedef XImagePtr XImagePtr_or_DC;
74#define NativeRectangle int 74#define NativeRectangle int
75#endif 75#endif
76 76
77
78/* Structure forward declarations. Some are here because function 77/* Structure forward declarations. Some are here because function
79 prototypes below reference structure types before their definition 78 prototypes below reference structure types before their definition
80 in this file. Some are here because not every file including 79 in this file. Some are here because not every file including
@@ -2530,6 +2529,9 @@ extern struct frame *last_mouse_frame;
2530extern int last_tool_bar_item; 2529extern int last_tool_bar_item;
2531extern int mouse_autoselect_window; 2530extern int mouse_autoselect_window;
2532 2531
2532extern int calc_pixel_width_or_height P_ ((double *, struct it *, Lisp_Object,
2533 /* XFontStruct */ void *, int, int *));
2534
2533#ifdef HAVE_WINDOW_SYSTEM 2535#ifdef HAVE_WINDOW_SYSTEM
2534 2536
2535#if GLYPH_DEBUG 2537#if GLYPH_DEBUG
diff --git a/src/editfns.c b/src/editfns.c
index 51435af0bb2..df183155c4b 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -4157,7 +4157,7 @@ Transposing beyond buffer boundaries is an error. */)
4157 transpose_markers (start1, end1, start2, end2, 4157 transpose_markers (start1, end1, start2, end2,
4158 start1_byte, start1_byte + len1_byte, 4158 start1_byte, start1_byte + len1_byte,
4159 start2_byte, start2_byte + len2_byte); 4159 start2_byte, start2_byte + len2_byte);
4160 fix_overlays_in_range (start1, end2); 4160 fix_start_end_in_overlays (start1, end2);
4161 } 4161 }
4162 4162
4163 return Qnil; 4163 return Qnil;
diff --git a/src/image.c b/src/image.c
index 23777dca253..34db5e53367 100644
--- a/src/image.c
+++ b/src/image.c
@@ -606,6 +606,7 @@ Lisp_Object Qxbm;
606 606
607extern Lisp_Object QCwidth, QCheight, QCforeground, QCbackground, QCfile; 607extern Lisp_Object QCwidth, QCheight, QCforeground, QCbackground, QCfile;
608extern Lisp_Object QCdata, QCtype; 608extern Lisp_Object QCdata, QCtype;
609extern Lisp_Object Qcenter;
609Lisp_Object QCascent, QCmargin, QCrelief; 610Lisp_Object QCascent, QCmargin, QCrelief;
610Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask; 611Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask;
611Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask; 612Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask;
@@ -613,7 +614,6 @@ Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask;
613/* Other symbols. */ 614/* Other symbols. */
614 615
615Lisp_Object Qlaplace, Qemboss, Qedge_detection, Qheuristic; 616Lisp_Object Qlaplace, Qemboss, Qedge_detection, Qheuristic;
616Lisp_Object Qcenter;
617 617
618/* Time in seconds after which images should be removed from the cache 618/* Time in seconds after which images should be removed from the cache
619 if not displayed. */ 619 if not displayed. */
@@ -7400,8 +7400,6 @@ syms_of_image ()
7400 staticpro (&Qedge_detection); 7400 staticpro (&Qedge_detection);
7401 Qheuristic = intern ("heuristic"); 7401 Qheuristic = intern ("heuristic");
7402 staticpro (&Qheuristic); 7402 staticpro (&Qheuristic);
7403 Qcenter = intern ("center");
7404 staticpro (&Qcenter);
7405 7403
7406 Qpostscript = intern ("postscript"); 7404 Qpostscript = intern ("postscript");
7407 staticpro (&Qpostscript); 7405 staticpro (&Qpostscript);
diff --git a/src/insdel.c b/src/insdel.c
index 88bf1ddd085..5e3f69161e0 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -441,9 +441,13 @@ adjust_markers_for_insert (from, from_byte, to, to_byte, before_markers)
441 } 441 }
442 442
443 /* Adjusting only markers whose insertion-type is t may result in 443 /* Adjusting only markers whose insertion-type is t may result in
444 disordered overlays in the slot `overlays_before'. */ 444 - disordered start and end in overlays, and
445 - disordered overlays in the slot `overlays_before' of current_buffer. */
445 if (adjusted) 446 if (adjusted)
446 fix_overlays_before (current_buffer, from, to); 447 {
448 fix_start_end_in_overlays(from, to);
449 fix_overlays_before (current_buffer, from, to);
450 }
447} 451}
448 452
449/* Adjust point for an insertion of NBYTES bytes, which are NCHARS characters. 453/* Adjust point for an insertion of NBYTES bytes, which are NCHARS characters.
diff --git a/src/lisp.h b/src/lisp.h
index cd873076602..2135f80f5e8 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2656,7 +2656,7 @@ EXFUN (Foverlay_start, 1);
2656EXFUN (Foverlay_end, 1); 2656EXFUN (Foverlay_end, 1);
2657extern void adjust_overlays_for_insert P_ ((EMACS_INT, EMACS_INT)); 2657extern void adjust_overlays_for_insert P_ ((EMACS_INT, EMACS_INT));
2658extern void adjust_overlays_for_delete P_ ((EMACS_INT, EMACS_INT)); 2658extern void adjust_overlays_for_delete P_ ((EMACS_INT, EMACS_INT));
2659extern void fix_overlays_in_range P_ ((int, int)); 2659extern void fix_start_end_in_overlays P_ ((int, int));
2660extern void report_overlay_modification P_ ((Lisp_Object, Lisp_Object, int, 2660extern void report_overlay_modification P_ ((Lisp_Object, Lisp_Object, int,
2661 Lisp_Object, Lisp_Object, Lisp_Object)); 2661 Lisp_Object, Lisp_Object, Lisp_Object));
2662extern int overlay_touches_p P_ ((int)); 2662extern int overlay_touches_p P_ ((int));
diff --git a/src/s/sol2-6.h b/src/s/sol2-6.h
index 3ba9ed1f5bd..a43443e48c2 100644
--- a/src/s/sol2-6.h
+++ b/src/s/sol2-6.h
@@ -7,10 +7,5 @@
7#define UNEXEC unexsol.o 7#define UNEXEC unexsol.o
8#endif 8#endif
9 9
10/* "Dennis McRitchie" <dmcr@Princeton.EDU> reported failures
11 with GNU ld without this. */
12
13#define LD_SWITCH_SYSTEM_TEMACS -znocombreloc
14
15/* arch-tag: 71ea3857-89dc-4395-9623-77964e6ed3ca 10/* arch-tag: 71ea3857-89dc-4395-9623-77964e6ed3ca
16 (do not change this comment) */ 11 (do not change this comment) */
diff --git a/src/term.c b/src/term.c
index f9d9dfce8c0..5d0c1fc7319 100644
--- a/src/term.c
+++ b/src/term.c
@@ -102,6 +102,10 @@ void delete_tty_output P_ ((struct frame *));
102 102
103#define OUTPUT1_IF(tty, a) do { if (a) emacs_tputs ((tty), a, 1, cmputc); } while (0) 103#define OUTPUT1_IF(tty, a) do { if (a) emacs_tputs ((tty), a, 1, cmputc); } while (0)
104 104
105/* Display space properties */
106
107extern Lisp_Object Qspace, QCalign_to, QCwidth;
108
105/* Function to use to ring the bell. */ 109/* Function to use to ring the bell. */
106 110
107Lisp_Object Vring_bell_function; 111Lisp_Object Vring_bell_function;
@@ -1493,6 +1497,7 @@ term_get_fkeys_1 ()
1493 ***********************************************************************/ 1497 ***********************************************************************/
1494 1498
1495static void append_glyph P_ ((struct it *)); 1499static void append_glyph P_ ((struct it *));
1500static void produce_stretch_glyph P_ ((struct it *));
1496 1501
1497 1502
1498/* Append glyphs to IT's glyph_row. Called from produce_glyphs for 1503/* Append glyphs to IT's glyph_row. Called from produce_glyphs for
@@ -1556,9 +1561,14 @@ produce_glyphs (it)
1556 /* If a hook is installed, let it do the work. */ 1561 /* If a hook is installed, let it do the work. */
1557 xassert (it->what == IT_CHARACTER 1562 xassert (it->what == IT_CHARACTER
1558 || it->what == IT_COMPOSITION 1563 || it->what == IT_COMPOSITION
1559 || it->what == IT_IMAGE
1560 || it->what == IT_STRETCH); 1564 || it->what == IT_STRETCH);
1561 1565
1566 if (it->what == IT_STRETCH)
1567 {
1568 produce_stretch_glyph (it);
1569 goto done;
1570 }
1571
1562 /* Nothing but characters are supported on terminal frames. For a 1572 /* Nothing but characters are supported on terminal frames. For a
1563 composition sequence, it->c is the first character of the 1573 composition sequence, it->c is the first character of the
1564 sequence. */ 1574 sequence. */
@@ -1632,6 +1642,7 @@ produce_glyphs (it)
1632 append_glyph (it); 1642 append_glyph (it);
1633 } 1643 }
1634 1644
1645 done:
1635 /* Advance current_x by the pixel width as a convenience for 1646 /* Advance current_x by the pixel width as a convenience for
1636 the caller. */ 1647 the caller. */
1637 if (it->area == TEXT_AREA) 1648 if (it->area == TEXT_AREA)
@@ -1641,6 +1652,81 @@ produce_glyphs (it)
1641} 1652}
1642 1653
1643 1654
1655/* Produce a stretch glyph for iterator IT. IT->object is the value
1656 of the glyph property displayed. The value must be a list
1657 `(space KEYWORD VALUE ...)' with the following KEYWORD/VALUE pairs
1658 being recognized:
1659
1660 1. `:width WIDTH' specifies that the space should be WIDTH *
1661 canonical char width wide. WIDTH may be an integer or floating
1662 point number.
1663
1664 2. `:align-to HPOS' specifies that the space should be wide enough
1665 to reach HPOS, a value in canonical character units. */
1666
1667static void
1668produce_stretch_glyph (it)
1669 struct it *it;
1670{
1671 /* (space :width WIDTH ...) */
1672 Lisp_Object prop, plist;
1673 int width = 0, align_to = -1;
1674 int zero_width_ok_p = 0;
1675 double tem;
1676
1677 /* List should start with `space'. */
1678 xassert (CONSP (it->object) && EQ (XCAR (it->object), Qspace));
1679 plist = XCDR (it->object);
1680
1681 /* Compute the width of the stretch. */
1682 if ((prop = Fplist_get (plist, QCwidth), !NILP (prop))
1683 && calc_pixel_width_or_height (&tem, it, prop, 0, 1, 0))
1684 {
1685 /* Absolute width `:width WIDTH' specified and valid. */
1686 zero_width_ok_p = 1;
1687 width = (int)(tem + 0.5);
1688 }
1689 else if ((prop = Fplist_get (plist, QCalign_to), !NILP (prop))
1690 && calc_pixel_width_or_height (&tem, it, prop, 0, 1, &align_to))
1691 {
1692 if (it->glyph_row == NULL || !it->glyph_row->mode_line_p)
1693 align_to = (align_to < 0
1694 ? 0
1695 : align_to - window_box_left_offset (it->w, TEXT_AREA));
1696 else if (align_to < 0)
1697 align_to = window_box_left_offset (it->w, TEXT_AREA);
1698 width = max (0, (int)(tem + 0.5) + align_to - it->current_x);
1699 zero_width_ok_p = 1;
1700 }
1701 else
1702 /* Nothing specified -> width defaults to canonical char width. */
1703 width = FRAME_COLUMN_WIDTH (it->f);
1704
1705 if (width <= 0 && (width < 0 || !zero_width_ok_p))
1706 width = 1;
1707
1708 if (width > 0 && it->glyph_row)
1709 {
1710 Lisp_Object o_object = it->object;
1711 Lisp_Object object = it->stack[it->sp - 1].string;
1712 int n = width;
1713 int c = it->c;
1714
1715 if (!STRINGP (object))
1716 object = it->w->buffer;
1717 it->object = object;
1718 it->c = ' ';
1719 it->pixel_width = it->len = 1;
1720 while (n--)
1721 append_glyph (it);
1722 it->object = o_object;
1723 it->c = c;
1724 }
1725 it->pixel_width = width;
1726 it->nglyphs = width;
1727}
1728
1729
1644/* Get information about special display element WHAT in an 1730/* Get information about special display element WHAT in an
1645 environment described by IT. WHAT is one of IT_TRUNCATION or 1731 environment described by IT. WHAT is one of IT_TRUNCATION or
1646 IT_CONTINUATION. Maybe produce glyphs for WHAT if IT has a 1732 IT_CONTINUATION. Maybe produce glyphs for WHAT if IT has a
diff --git a/src/xdisp.c b/src/xdisp.c
index 796c7d06ce8..8fd0763590a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -301,6 +301,7 @@ extern Lisp_Object Qface, Qinvisible, Qwidth;
301Lisp_Object Vdisplay_pixels_per_inch; 301Lisp_Object Vdisplay_pixels_per_inch;
302Lisp_Object Qspace, QCalign_to, QCrelative_width, QCrelative_height; 302Lisp_Object Qspace, QCalign_to, QCrelative_width, QCrelative_height;
303Lisp_Object Qleft_margin, Qright_margin, Qspace_width, Qraise; 303Lisp_Object Qleft_margin, Qright_margin, Qspace_width, Qraise;
304Lisp_Object Qcenter;
304Lisp_Object Qmargin, Qpointer; 305Lisp_Object Qmargin, Qpointer;
305extern Lisp_Object Qheight; 306extern Lisp_Object Qheight;
306extern Lisp_Object QCwidth, QCheight, QCascent; 307extern Lisp_Object QCwidth, QCheight, QCascent;
@@ -3603,16 +3604,11 @@ handle_single_display_prop (it, prop, object, position,
3603 value = prop; 3604 value = prop;
3604 } 3605 }
3605 3606
3607 valid_p = (STRINGP (value)
3606#ifdef HAVE_WINDOW_SYSTEM 3608#ifdef HAVE_WINDOW_SYSTEM
3607 if (FRAME_TERMCAP_P (it->f)) 3609 || (!FRAME_TERMCAP_P (it->f) && valid_image_p (value))
3608 valid_p = STRINGP (value);
3609 else
3610 valid_p = (STRINGP (value)
3611 || (CONSP (value) && EQ (XCAR (value), Qspace))
3612 || valid_image_p (value));
3613#else /* not HAVE_WINDOW_SYSTEM */
3614 valid_p = STRINGP (value);
3615#endif /* not HAVE_WINDOW_SYSTEM */ 3610#endif /* not HAVE_WINDOW_SYSTEM */
3611 || (CONSP (value) && EQ (XCAR (value), Qspace)));
3616 3612
3617 if ((EQ (location, Qleft_margin) 3613 if ((EQ (location, Qleft_margin)
3618 || EQ (location, Qright_margin) 3614 || EQ (location, Qright_margin)
@@ -5594,15 +5590,18 @@ move_it_in_display_line_to (it, to_charpos, to_x, op)
5594 saved_glyph_row = it->glyph_row; 5590 saved_glyph_row = it->glyph_row;
5595 it->glyph_row = NULL; 5591 it->glyph_row = NULL;
5596 5592
5593#define BUFFER_POS_REACHED_P() \
5594 ((op & MOVE_TO_POS) != 0 \
5595 && BUFFERP (it->object) \
5596 && IT_CHARPOS (*it) >= to_charpos)
5597
5597 while (1) 5598 while (1)
5598 { 5599 {
5599 int x, i, ascent = 0, descent = 0; 5600 int x, i, ascent = 0, descent = 0;
5600 5601
5601 /* Stop when ZV or TO_CHARPOS reached. */ 5602 /* Stop when ZV or TO_CHARPOS reached. */
5602 if (!get_next_display_element (it) 5603 if (!get_next_display_element (it)
5603 || ((op & MOVE_TO_POS) != 0 5604 || BUFFER_POS_REACHED_P ())
5604 && BUFFERP (it->object)
5605 && IT_CHARPOS (*it) >= to_charpos))
5606 { 5605 {
5607 result = MOVE_POS_MATCH_OR_ZV; 5606 result = MOVE_POS_MATCH_OR_ZV;
5608 break; 5607 break;
@@ -5689,7 +5688,8 @@ move_it_in_display_line_to (it, to_charpos, to_x, op)
5689#ifdef HAVE_WINDOW_SYSTEM 5688#ifdef HAVE_WINDOW_SYSTEM
5690 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) 5689 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
5691 { 5690 {
5692 if (!get_next_display_element (it)) 5691 if (!get_next_display_element (it)
5692 || BUFFER_POS_REACHED_P ())
5693 { 5693 {
5694 result = MOVE_POS_MATCH_OR_ZV; 5694 result = MOVE_POS_MATCH_OR_ZV;
5695 break; 5695 break;
@@ -5761,7 +5761,8 @@ move_it_in_display_line_to (it, to_charpos, to_x, op)
5761#ifdef HAVE_WINDOW_SYSTEM 5761#ifdef HAVE_WINDOW_SYSTEM
5762 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) 5762 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
5763 { 5763 {
5764 if (!get_next_display_element (it)) 5764 if (!get_next_display_element (it)
5765 || BUFFER_POS_REACHED_P ())
5765 { 5766 {
5766 result = MOVE_POS_MATCH_OR_ZV; 5767 result = MOVE_POS_MATCH_OR_ZV;
5767 break; 5768 break;
@@ -5778,6 +5779,8 @@ move_it_in_display_line_to (it, to_charpos, to_x, op)
5778 } 5779 }
5779 } 5780 }
5780 5781
5782#undef BUFFER_POS_REACHED_P
5783
5781 /* Restore the iterator settings altered at the beginning of this 5784 /* Restore the iterator settings altered at the beginning of this
5782 function. */ 5785 function. */
5783 it->glyph_row = saved_glyph_row; 5786 it->glyph_row = saved_glyph_row;
@@ -15064,6 +15067,8 @@ display_mode_line (w, face_id, format)
15064 init_iterator (&it, w, -1, -1, NULL, face_id); 15067 init_iterator (&it, w, -1, -1, NULL, face_id);
15065 prepare_desired_row (it.glyph_row); 15068 prepare_desired_row (it.glyph_row);
15066 15069
15070 it.glyph_row->mode_line_p = 1;
15071
15067 if (! mode_line_inverse_video) 15072 if (! mode_line_inverse_video)
15068 /* Force the mode-line to be displayed in the default face. */ 15073 /* Force the mode-line to be displayed in the default face. */
15069 it.base_face_id = it.face_id = DEFAULT_FACE_ID; 15074 it.base_face_id = it.face_id = DEFAULT_FACE_ID;
@@ -15080,7 +15085,6 @@ display_mode_line (w, face_id, format)
15080 15085
15081 compute_line_metrics (&it); 15086 compute_line_metrics (&it);
15082 it.glyph_row->full_width_p = 1; 15087 it.glyph_row->full_width_p = 1;
15083 it.glyph_row->mode_line_p = 1;
15084 it.glyph_row->continued_p = 0; 15088 it.glyph_row->continued_p = 0;
15085 it.glyph_row->truncated_on_left_p = 0; 15089 it.glyph_row->truncated_on_left_p = 0;
15086 it.glyph_row->truncated_on_right_p = 0; 15090 it.glyph_row->truncated_on_right_p = 0;
@@ -16694,6 +16698,252 @@ invisible_p (propval, list)
16694 return 0; 16698 return 0;
16695} 16699}
16696 16700
16701/* Calculate a width or height in pixels from a specification using
16702 the following elements:
16703
16704 SPEC ::=
16705 NUM - a (fractional) multiple of the default font width/height
16706 (NUM) - specifies exactly NUM pixels
16707 UNIT - a fixed number of pixels, see below.
16708 ELEMENT - size of a display element in pixels, see below.
16709 (NUM . SPEC) - equals NUM * SPEC
16710 (+ SPEC SPEC ...) - add pixel values
16711 (- SPEC SPEC ...) - subtract pixel values
16712 (- SPEC) - negate pixel value
16713
16714 NUM ::=
16715 INT or FLOAT - a number constant
16716 SYMBOL - use symbol's (buffer local) variable binding.
16717
16718 UNIT ::=
16719 in - pixels per inch *)
16720 mm - pixels per 1/1000 meter *)
16721 cm - pixels per 1/100 meter *)
16722 width - width of current font in pixels.
16723 height - height of current font in pixels.
16724
16725 *) using the ratio(s) defined in display-pixels-per-inch.
16726
16727 ELEMENT ::=
16728
16729 left-fringe - left fringe width in pixels
16730 right-fringe - right fringe width in pixels
16731
16732 left-margin - left margin width in pixels
16733 right-margin - right margin width in pixels
16734
16735 scroll-bar - scroll-bar area width in pixels
16736
16737 Examples:
16738
16739 Pixels corresponding to 5 inches:
16740 (5 . in)
16741
16742 Total width of non-text areas on left side of window (if scroll-bar is on left):
16743 '(space :width (+ left-fringe left-margin scroll-bar))
16744
16745 Align to first text column (in header line):
16746 '(space :align-to 0)
16747
16748 Align to middle of text area minus half the width of variable `my-image'
16749 containing a loaded image:
16750 '(space :align-to (0.5 . (- text my-image)))
16751
16752 Width of left margin minus width of 1 character in the default font:
16753 '(space :width (- left-margin 1))
16754
16755 Width of left margin minus width of 2 characters in the current font:
16756 '(space :width (- left-margin (2 . width)))
16757
16758 Center 1 character over left-margin (in header line):
16759 '(space :align-to (+ left-margin (0.5 . left-margin) -0.5))
16760
16761 Different ways to express width of left fringe plus left margin minus one pixel:
16762 '(space :width (- (+ left-fringe left-margin) (1)))
16763 '(space :width (+ left-fringe left-margin (- (1))))
16764 '(space :width (+ left-fringe left-margin (-1)))
16765
16766*/
16767
16768#define NUMVAL(X) \
16769 ((INTEGERP (X) || FLOATP (X)) \
16770 ? XFLOATINT (X) \
16771 : - 1)
16772
16773int
16774calc_pixel_width_or_height (res, it, prop, font, width_p, align_to)
16775 double *res;
16776 struct it *it;
16777 Lisp_Object prop;
16778 void *font;
16779 int width_p, *align_to;
16780{
16781 double pixels;
16782
16783#define OK_PIXELS(val) ((*res = (double)(val)), 1)
16784#define OK_ALIGN_TO(val) ((*align_to = (int)(val)), 1)
16785
16786 if (NILP (prop))
16787 return OK_PIXELS (0);
16788
16789 if (SYMBOLP (prop))
16790 {
16791 if (SCHARS (SYMBOL_NAME (prop)) == 2)
16792 {
16793 char *unit = SDATA (SYMBOL_NAME (prop));
16794
16795 if (unit[0] == 'i' && unit[1] == 'n')
16796 pixels = 1.0;
16797 else if (unit[0] == 'm' && unit[1] == 'm')
16798 pixels = 25.4;
16799 else if (unit[0] == 'c' && unit[1] == 'm')
16800 pixels = 2.54;
16801 else
16802 pixels = 0;
16803 if (pixels > 0)
16804 {
16805 double ppi;
16806 if ((ppi = NUMVAL (Vdisplay_pixels_per_inch), ppi > 0)
16807 || (CONSP (Vdisplay_pixels_per_inch)
16808 && (ppi = (width_p
16809 ? NUMVAL (XCAR (Vdisplay_pixels_per_inch))
16810 : NUMVAL (XCDR (Vdisplay_pixels_per_inch))),
16811 ppi > 0)))
16812 return OK_PIXELS (ppi / pixels);
16813
16814 return 0;
16815 }
16816 }
16817
16818#ifdef HAVE_WINDOW_SYSTEM
16819 if (EQ (prop, Qheight))
16820 return OK_PIXELS (font ? FONT_HEIGHT ((XFontStruct *)font) : FRAME_LINE_HEIGHT (it->f));
16821 if (EQ (prop, Qwidth))
16822 return OK_PIXELS (font ? FONT_WIDTH ((XFontStruct *)font) : FRAME_COLUMN_WIDTH (it->f));
16823#else
16824 if (EQ (prop, Qheight) || EQ (prop, Qwidth))
16825 return OK_PIXELS (1);
16826#endif
16827
16828 if (EQ (prop, Qtext))
16829 return OK_PIXELS (width_p
16830 ? window_box_width (it->w, TEXT_AREA)
16831 : WINDOW_BOX_HEIGHT_NO_MODE_LINE (it->w));
16832
16833 if (align_to && *align_to < 0)
16834 {
16835 *res = 0;
16836 if (EQ (prop, Qleft))
16837 return OK_ALIGN_TO (window_box_left_offset (it->w, TEXT_AREA));
16838 if (EQ (prop, Qright))
16839 return OK_ALIGN_TO (window_box_right_offset (it->w, TEXT_AREA));
16840 if (EQ (prop, Qcenter))
16841 return OK_ALIGN_TO (window_box_left_offset (it->w, TEXT_AREA)
16842 + window_box_width (it->w, TEXT_AREA) / 2);
16843 if (EQ (prop, Qleft_fringe))
16844 return OK_ALIGN_TO (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (it->w)
16845 ? WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (it->w)
16846 : window_box_right_offset (it->w, LEFT_MARGIN_AREA));
16847 if (EQ (prop, Qright_fringe))
16848 return OK_ALIGN_TO (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (it->w)
16849 ? window_box_right_offset (it->w, RIGHT_MARGIN_AREA)
16850 : window_box_right_offset (it->w, TEXT_AREA));
16851 if (EQ (prop, Qleft_margin))
16852 return OK_ALIGN_TO (window_box_left_offset (it->w, LEFT_MARGIN_AREA));
16853 if (EQ (prop, Qright_margin))
16854 return OK_ALIGN_TO (window_box_left_offset (it->w, RIGHT_MARGIN_AREA));
16855 if (EQ (prop, Qscroll_bar))
16856 return OK_ALIGN_TO (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (it->w)
16857 ? 0
16858 : (window_box_right_offset (it->w, RIGHT_MARGIN_AREA)
16859 + (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (it->w)
16860 ? WINDOW_RIGHT_FRINGE_WIDTH (it->w)
16861 : 0)));
16862 }
16863 else
16864 {
16865 if (EQ (prop, Qleft_fringe))
16866 return OK_PIXELS (WINDOW_LEFT_FRINGE_WIDTH (it->w));
16867 if (EQ (prop, Qright_fringe))
16868 return OK_PIXELS (WINDOW_RIGHT_FRINGE_WIDTH (it->w));
16869 if (EQ (prop, Qleft_margin))
16870 return OK_PIXELS (WINDOW_LEFT_MARGIN_WIDTH (it->w));
16871 if (EQ (prop, Qright_margin))
16872 return OK_PIXELS (WINDOW_RIGHT_MARGIN_WIDTH (it->w));
16873 if (EQ (prop, Qscroll_bar))
16874 return OK_PIXELS (WINDOW_SCROLL_BAR_AREA_WIDTH (it->w));
16875 }
16876
16877 prop = Fbuffer_local_value (prop, it->w->buffer);
16878 }
16879
16880 if (INTEGERP (prop) || FLOATP (prop))
16881 {
16882 int base_unit = (width_p
16883 ? FRAME_COLUMN_WIDTH (it->f)
16884 : FRAME_LINE_HEIGHT (it->f));
16885 return OK_PIXELS (XFLOATINT (prop) * base_unit);
16886 }
16887
16888 if (CONSP (prop))
16889 {
16890 Lisp_Object car = XCAR (prop);
16891 Lisp_Object cdr = XCDR (prop);
16892
16893 if (SYMBOLP (car))
16894 {
16895#ifdef HAVE_WINDOW_SYSTEM
16896 if (valid_image_p (prop))
16897 {
16898 int id = lookup_image (it->f, prop);
16899 struct image *img = IMAGE_FROM_ID (it->f, id);
16900
16901 return OK_PIXELS (width_p ? img->width : img->height);
16902 }
16903#endif
16904 if (EQ (car, Qplus) || EQ (car, Qminus))
16905 {
16906 int first = 1;
16907 double px;
16908
16909 pixels = 0;
16910 while (CONSP (cdr))
16911 {
16912 if (!calc_pixel_width_or_height (&px, it, XCAR (cdr),
16913 font, width_p, align_to))
16914 return 0;
16915 if (first)
16916 pixels = (EQ (car, Qplus) ? px : -px), first = 0;
16917 else
16918 pixels += px;
16919 cdr = XCDR (cdr);
16920 }
16921 if (EQ (car, Qminus))
16922 pixels = -pixels;
16923 return OK_PIXELS (pixels);
16924 }
16925
16926 car = Fbuffer_local_value (car, it->w->buffer);
16927 }
16928
16929 if (INTEGERP (car) || FLOATP (car))
16930 {
16931 double fact;
16932 pixels = XFLOATINT (car);
16933 if (NILP (cdr))
16934 return OK_PIXELS (pixels);
16935 if (calc_pixel_width_or_height (&fact, it, cdr,
16936 font, width_p, align_to))
16937 return OK_PIXELS (pixels * fact);
16938 return 0;
16939 }
16940
16941 return 0;
16942 }
16943
16944 return 0;
16945}
16946
16697 16947
16698/*********************************************************************** 16948/***********************************************************************
16699 Glyph Display 16949 Glyph Display
@@ -17977,209 +18227,6 @@ append_stretch_glyph (it, object, width, height, ascent)
17977} 18227}
17978 18228
17979 18229
17980/* Calculate a width or height in pixels from a specification using
17981 the following elements:
17982
17983 SPEC ::=
17984 NUM - a (fractional) multiple of the default font width/height
17985 (NUM) - specifies exactly NUM pixels
17986 UNIT - a fixed number of pixels, see below.
17987 ELEMENT - size of a display element in pixels, see below.
17988 (NUM . SPEC) - equals NUM * SPEC
17989 (+ SPEC SPEC ...) - add pixel values
17990 (- SPEC SPEC ...) - subtract pixel values
17991 (- SPEC) - negate pixel value
17992
17993 NUM ::=
17994 INT or FLOAT - a number constant
17995 SYMBOL - use symbol's (buffer local) variable binding.
17996
17997 UNIT ::=
17998 in - pixels per inch *)
17999 mm - pixels per 1/1000 meter *)
18000 cm - pixels per 1/100 meter *)
18001 width - width of current font in pixels.
18002 height - height of current font in pixels.
18003
18004 *) using the ratio(s) defined in display-pixels-per-inch.
18005
18006 ELEMENT ::=
18007
18008 left-fringe - left fringe width in pixels
18009 (left-fringe . nil) - left fringe width if inside margins, else 0
18010 (left-fringe . t) - left fringe width if outside margins, else 0
18011
18012 right-fringe - right fringe width in pixels
18013 (right-fringe . nil) - right fringe width if inside margins, else 0
18014 (right-fringe . t) - right fringe width if outside margins, else 0
18015
18016 left-margin - left margin width in pixels
18017 right-margin - right margin width in pixels
18018
18019 scroll-bar - scroll-bar area width in pixels
18020 (scroll-bar . left) - scroll-bar width if on left, else 0
18021 (scroll-bar . right) - scroll-bar width if on right, else 0
18022
18023 Examples:
18024
18025 Pixels corresponding to 5 inches:
18026 (5 . in)
18027
18028 Total width of non-text areas on left side of window:
18029 (+ left-fringe left-margin (scroll-bar . left))
18030
18031 Total width of fringes if inside display margins:
18032 (+ (left-fringe) (right-fringe))
18033
18034 Width of left margin minus width of 1 character in the default font:
18035 (- left-margin 1)
18036
18037 Width of left margin minus width of 2 characters in the current font:
18038 (- left-margin (2 . width))
18039
18040 Width of left fringe plus left margin minus one pixel:
18041 (- (+ left-fringe left-margin) (1))
18042 (+ left-fringe left-margin (- (1)))
18043 (+ left-fringe left-margin (-1))
18044
18045*/
18046
18047#define NUMVAL(X) \
18048 ((INTEGERP (X) || FLOATP (X)) \
18049 ? XFLOATINT (X) \
18050 : - 1)
18051
18052static int
18053calc_pixel_width_or_height (res, it, prop, font, width_p)
18054 double *res;
18055 struct it *it;
18056 Lisp_Object prop;
18057 XFontStruct *font;
18058 int width_p;
18059{
18060 double pixels;
18061
18062#define OK_PIXELS(val) ((*res = (val)), 1)
18063
18064 if (SYMBOLP (prop))
18065 {
18066 if (SCHARS (SYMBOL_NAME (prop)) == 2)
18067 {
18068 char *unit = SDATA (SYMBOL_NAME (prop));
18069
18070 if (unit[0] == 'i' && unit[1] == 'n')
18071 pixels = 1.0;
18072 else if (unit[0] == 'm' && unit[1] == 'm')
18073 pixels = 25.4;
18074 else if (unit[0] == 'c' && unit[1] == 'm')
18075 pixels = 2.54;
18076 else
18077 pixels = 0;
18078 if (pixels > 0)
18079 {
18080 double ppi;
18081 if ((ppi = NUMVAL (Vdisplay_pixels_per_inch), ppi > 0)
18082 || (CONSP (Vdisplay_pixels_per_inch)
18083 && (ppi = (width_p
18084 ? NUMVAL (XCAR (Vdisplay_pixels_per_inch))
18085 : NUMVAL (XCDR (Vdisplay_pixels_per_inch))),
18086 ppi > 0)))
18087 return OK_PIXELS (ppi / pixels);
18088
18089 return 0;
18090 }
18091 }
18092
18093 if (EQ (prop, Qheight))
18094 return OK_PIXELS (font ? FONT_HEIGHT (font) : FRAME_LINE_HEIGHT (it->f));
18095 if (EQ (prop, Qwidth))
18096 return OK_PIXELS (font ? FONT_WIDTH (font) : FRAME_COLUMN_WIDTH (it->f));
18097 if (EQ (prop, Qleft_fringe))
18098 return OK_PIXELS (WINDOW_LEFT_FRINGE_WIDTH (it->w));
18099 if (EQ (prop, Qright_fringe))
18100 return OK_PIXELS (WINDOW_RIGHT_FRINGE_WIDTH (it->w));
18101 if (EQ (prop, Qleft_margin))
18102 return OK_PIXELS (WINDOW_LEFT_MARGIN_WIDTH (it->w));
18103 if (EQ (prop, Qright_margin))
18104 return OK_PIXELS (WINDOW_RIGHT_MARGIN_WIDTH (it->w));
18105 if (EQ (prop, Qscroll_bar))
18106 return OK_PIXELS (WINDOW_SCROLL_BAR_AREA_WIDTH (it->w));
18107
18108 prop = Fbuffer_local_value (prop, it->w->buffer);
18109 }
18110
18111 if (INTEGERP (prop) || FLOATP (prop))
18112 {
18113 int base_unit = (width_p
18114 ? FRAME_COLUMN_WIDTH (it->f)
18115 : FRAME_LINE_HEIGHT (it->f));
18116 return OK_PIXELS (XFLOATINT (prop) * base_unit);
18117 }
18118
18119 if (CONSP (prop))
18120 {
18121 Lisp_Object car = XCAR (prop);
18122 Lisp_Object cdr = XCDR (prop);
18123
18124 if (SYMBOLP (car))
18125 {
18126 if (EQ (car, Qplus) || EQ (car, Qminus))
18127 {
18128 int first = 1;
18129 double px;
18130
18131 pixels = 0;
18132 while (CONSP (cdr))
18133 {
18134 if (!calc_pixel_width_or_height (&px, it, XCAR (cdr), font, width_p))
18135 return 0;
18136 if (first)
18137 pixels = (EQ (car, Qplus) ? px : -px), first = 0;
18138 else
18139 pixels += px;
18140 cdr = XCDR (cdr);
18141 }
18142 if (EQ (car, Qminus))
18143 pixels = -pixels;
18144 return OK_PIXELS (pixels);
18145 }
18146
18147 if (EQ (car, Qleft_fringe))
18148 return OK_PIXELS ((WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (it->w)
18149 == !NILP (cdr))
18150 ? WINDOW_LEFT_FRINGE_WIDTH (it->w)
18151 : 0);
18152 if (EQ (car, Qright_fringe))
18153 return OK_PIXELS ((WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (it->w)
18154 == !NILP (cdr))
18155 ? WINDOW_RIGHT_FRINGE_WIDTH (it->w)
18156 : 0);
18157 if (EQ (car, Qscroll_bar))
18158 return OK_PIXELS ((WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (it->w)
18159 == EQ (cdr, Qleft))
18160 ? WINDOW_SCROLL_BAR_AREA_WIDTH (it->w)
18161 : 0);
18162
18163 car = Fbuffer_local_value (car, it->w->buffer);
18164 }
18165
18166 if (INTEGERP (car) || FLOATP (car))
18167 {
18168 double fact;
18169 pixels = XFLOATINT (car);
18170 if (NILP (cdr))
18171 return OK_PIXELS (pixels);
18172 if (calc_pixel_width_or_height (&fact, it, cdr, font, width_p))
18173 return OK_PIXELS (pixels * fact);
18174 return 0;
18175 }
18176
18177 return 0;
18178 }
18179
18180 return 0;
18181}
18182
18183/* Produce a stretch glyph for iterator IT. IT->object is the value 18230/* Produce a stretch glyph for iterator IT. IT->object is the value
18184 of the glyph property displayed. The value must be a list 18231 of the glyph property displayed. The value must be a list
18185 `(space KEYWORD VALUE ...)' with the following KEYWORD/VALUE pairs 18232 `(space KEYWORD VALUE ...)' with the following KEYWORD/VALUE pairs
@@ -18217,7 +18264,7 @@ produce_stretch_glyph (it)
18217{ 18264{
18218 /* (space :width WIDTH :height HEIGHT ...) */ 18265 /* (space :width WIDTH :height HEIGHT ...) */
18219 Lisp_Object prop, plist; 18266 Lisp_Object prop, plist;
18220 int width = 0, height = 0; 18267 int width = 0, height = 0, align_to = -1;
18221 int zero_width_ok_p = 0, zero_height_ok_p = 0; 18268 int zero_width_ok_p = 0, zero_height_ok_p = 0;
18222 int ascent = 0; 18269 int ascent = 0;
18223 double tem; 18270 double tem;
@@ -18232,7 +18279,7 @@ produce_stretch_glyph (it)
18232 18279
18233 /* Compute the width of the stretch. */ 18280 /* Compute the width of the stretch. */
18234 if ((prop = Fplist_get (plist, QCwidth), !NILP (prop)) 18281 if ((prop = Fplist_get (plist, QCwidth), !NILP (prop))
18235 && calc_pixel_width_or_height (&tem, it, prop, font, 1)) 18282 && calc_pixel_width_or_height (&tem, it, prop, font, 1, 0))
18236 { 18283 {
18237 /* Absolute width `:width WIDTH' specified and valid. */ 18284 /* Absolute width `:width WIDTH' specified and valid. */
18238 zero_width_ok_p = 1; 18285 zero_width_ok_p = 1;
@@ -18263,9 +18310,15 @@ produce_stretch_glyph (it)
18263 width = NUMVAL (prop) * it2.pixel_width; 18310 width = NUMVAL (prop) * it2.pixel_width;
18264 } 18311 }
18265 else if ((prop = Fplist_get (plist, QCalign_to), !NILP (prop)) 18312 else if ((prop = Fplist_get (plist, QCalign_to), !NILP (prop))
18266 && calc_pixel_width_or_height (&tem, it, prop, font, 1)) 18313 && calc_pixel_width_or_height (&tem, it, prop, font, 1, &align_to))
18267 { 18314 {
18268 width = max (0, (int)tem - it->current_x); 18315 if (it->glyph_row == NULL || !it->glyph_row->mode_line_p)
18316 align_to = (align_to < 0
18317 ? 0
18318 : align_to - window_box_left_offset (it->w, TEXT_AREA));
18319 else if (align_to < 0)
18320 align_to = window_box_left_offset (it->w, TEXT_AREA);
18321 width = max (0, (int)tem + align_to - it->current_x);
18269 zero_width_ok_p = 1; 18322 zero_width_ok_p = 1;
18270 } 18323 }
18271 else 18324 else
@@ -18277,7 +18330,7 @@ produce_stretch_glyph (it)
18277 18330
18278 /* Compute height. */ 18331 /* Compute height. */
18279 if ((prop = Fplist_get (plist, QCheight), !NILP (prop)) 18332 if ((prop = Fplist_get (plist, QCheight), !NILP (prop))
18280 && calc_pixel_width_or_height (&tem, it, prop, font, 0)) 18333 && calc_pixel_width_or_height (&tem, it, prop, font, 0, 0))
18281 { 18334 {
18282 height = (int)tem; 18335 height = (int)tem;
18283 zero_height_ok_p = 1; 18336 zero_height_ok_p = 1;
@@ -18298,7 +18351,7 @@ produce_stretch_glyph (it)
18298 NUMVAL (prop) > 0 && NUMVAL (prop) <= 100) 18351 NUMVAL (prop) > 0 && NUMVAL (prop) <= 100)
18299 ascent = height * NUMVAL (prop) / 100.0; 18352 ascent = height * NUMVAL (prop) / 100.0;
18300 else if (!NILP (prop) 18353 else if (!NILP (prop)
18301 && calc_pixel_width_or_height (&tem, it, prop, font, 0)) 18354 && calc_pixel_width_or_height (&tem, it, prop, font, 0, 0))
18302 ascent = min (max (0, (int)tem), height); 18355 ascent = min (max (0, (int)tem), height);
18303 else 18356 else
18304 ascent = (height * FONT_BASE (font)) / FONT_HEIGHT (font); 18357 ascent = (height * FONT_BASE (font)) / FONT_HEIGHT (font);
@@ -21522,6 +21575,8 @@ syms_of_xdisp ()
21522 staticpro (&Qleft_margin); 21575 staticpro (&Qleft_margin);
21523 Qright_margin = intern ("right-margin"); 21576 Qright_margin = intern ("right-margin");
21524 staticpro (&Qright_margin); 21577 staticpro (&Qright_margin);
21578 Qcenter = intern ("center");
21579 staticpro (&Qcenter);
21525 QCalign_to = intern (":align-to"); 21580 QCalign_to = intern (":align-to");
21526 staticpro (&QCalign_to); 21581 staticpro (&QCalign_to);
21527 QCrelative_width = intern (":relative-width"); 21582 QCrelative_width = intern (":relative-width");
diff --git a/src/xterm.c b/src/xterm.c
index 86feb9ccf57..a297faa2ac0 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -6225,6 +6225,14 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6225 Lisp_Object coding_system = Qlatin_1; 6225 Lisp_Object coding_system = Qlatin_1;
6226 Lisp_Object c; 6226 Lisp_Object c;
6227 6227
6228#ifdef USE_GTK
6229 /* Don't pass keys to GTK. A Tab will shift focus to the
6230 tool bar in GTK 2.4. Keys will still go to menus and
6231 dialogs because in that case popup_activated is TRUE
6232 (see above). */
6233 *finish = X_EVENT_DROP;
6234#endif
6235
6228 event.xkey.state 6236 event.xkey.state
6229 |= x_emacs_to_x_modifiers (FRAME_X_DISPLAY_INFO (f), 6237 |= x_emacs_to_x_modifiers (FRAME_X_DISPLAY_INFO (f),
6230 extra_keyboard_modifiers); 6238 extra_keyboard_modifiers);
diff --git a/update-subdirs b/update-subdirs
index a4d7b5db117..7ac5977d70f 100755
--- a/update-subdirs
+++ b/update-subdirs
@@ -1,7 +1,7 @@
1#!/bin/sh 1#!/bin/sh
2# Write into $1/subdirs.el a list of subdirs of directory $1. 2# Write into $1/subdirs.el a list of subdirs of directory $1.
3 3
4# Copyright (C) 1994, 1995, 1997, 1999, 2001 Free Software Foundation, Inc. 4# Copyright (C) 1994,95,97,1999,2001,2004 Free Software Foundation, Inc.
5# 5#
6# This file is part of GNU Emacs. 6# This file is part of GNU Emacs.
7# 7#
@@ -42,7 +42,11 @@ else
42 echo ";; In load-path, after this directory should come 42 echo ";; In load-path, after this directory should come
43;; certain of its subdirectories. Here we specify them." >> subdirs.el 43;; certain of its subdirectories. Here we specify them." >> subdirs.el
44 44
45 echo "(normal-top-level-add-to-load-path '($subdirs))" >> subdirs.el 45 echo "(normal-top-level-add-to-load-path '($subdirs))
46;; Local" "Variables:
47;; version-control: never
48;; no-byte-compile: t
49;; End:" >> subdirs.el
46fi 50fi
47 51
48# arch-tag: 56ebcf1b-5c30-4934-b0b4-72d374064704 52# arch-tag: 56ebcf1b-5c30-4934-b0b4-72d374064704