aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2005-07-14 08:02:00 +0000
committerMiles Bader2005-07-14 08:02:00 +0000
commitbacb9790f594207469f22ed9f3e8085ab76e5e2b (patch)
treeb1cee62715d6cd2797f3122e4f058d7bc18ceef6
parentd3e4babdd1267fb5690a17949196640a47c6f159 (diff)
parentead25b5cabbe092711864eae13a76437e6a65ce1 (diff)
downloademacs-bacb9790f594207469f22ed9f3e8085ab76e5e2b.tar.gz
emacs-bacb9790f594207469f22ed9f3e8085ab76e5e2b.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-69
Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 474-484) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 88-91) - Merge from emacs--cvs-trunk--0 - Update FSF's address in GPL notices - Update from CVS
-rw-r--r--admin/FOR-RELEASE10
-rw-r--r--etc/ChangeLog27
-rw-r--r--etc/GNU17
-rw-r--r--etc/MORE.STUFF7
-rw-r--r--etc/NEWS3
-rw-r--r--etc/TODO8
-rw-r--r--etc/refcard.tex37
-rw-r--r--etc/tasks.texi964
-rw-r--r--leim/ChangeLog5
-rw-r--r--leim/quail/japanese.el6
-rw-r--r--lib-src/ChangeLog7
-rw-r--r--lib-src/pop.c35
-rw-r--r--lisp/ChangeLog363
-rw-r--r--lisp/allout.el59
-rw-r--r--lisp/calc/calc-embed.el58
-rw-r--r--lisp/calc/calc-units.el8
-rw-r--r--lisp/calc/calc.el86
-rw-r--r--lisp/comint.el4
-rw-r--r--lisp/cus-edit.el18
-rw-r--r--lisp/cus-face.el52
-rw-r--r--lisp/cus-start.el4
-rw-r--r--lisp/custom.el551
-rw-r--r--lisp/desktop.el2
-rw-r--r--lisp/dired-aux.el13
-rw-r--r--lisp/dired.el2
-rw-r--r--lisp/ediff-diff.el122
-rw-r--r--lisp/ediff-init.el108
-rw-r--r--lisp/ediff-mult.el9
-rw-r--r--lisp/ediff-ptch.el2
-rw-r--r--lisp/ediff-util.el13
-rw-r--r--lisp/ediff-vers.el5
-rw-r--r--lisp/ediff.el10
-rw-r--r--lisp/elide-head.el4
-rw-r--r--lisp/emacs-lisp/bytecomp.el41
-rw-r--r--lisp/emacs-lisp/checkdoc.el8
-rw-r--r--lisp/emacs-lisp/debug.el89
-rw-r--r--lisp/emacs-lisp/easy-mmode.el8
-rw-r--r--lisp/emacs-lisp/edebug.el59
-rw-r--r--lisp/emacs-lisp/timer.el32
-rw-r--r--lisp/emulation/viper-cmd.el72
-rw-r--r--lisp/emulation/viper-init.el30
-rw-r--r--lisp/emulation/viper-keym.el97
-rw-r--r--lisp/emulation/viper-macs.el12
-rw-r--r--lisp/emulation/viper-mous.el2
-rw-r--r--lisp/emulation/viper-util.el30
-rw-r--r--lisp/emulation/viper.el35
-rw-r--r--lisp/facemenu.el9
-rw-r--r--lisp/files.el10
-rw-r--r--lisp/font-lock.el6
-rw-r--r--lisp/frame.el7
-rw-r--r--lisp/fringe.el7
-rw-r--r--lisp/gnus/ChangeLog13
-rw-r--r--lisp/gnus/gnus-art.el8
-rw-r--r--lisp/gnus/gnus-salt.el6
-rw-r--r--lisp/gnus/gnus-topic.el9
-rw-r--r--lisp/ido.el28
-rw-r--r--lisp/longlines.el8
-rw-r--r--lisp/mail/rmail.el8
-rw-r--r--lisp/progmodes/compile.el4
-rw-r--r--lisp/progmodes/gdb-ui.el13
-rw-r--r--lisp/progmodes/sh-script.el38
-rw-r--r--lisp/replace.el17
-rw-r--r--lisp/simple.el83
-rw-r--r--lisp/startup.el10
-rw-r--r--lisp/term/mac-win.el15
-rw-r--r--lisp/textmodes/ispell.el25
-rw-r--r--lisp/timezone.el2
-rw-r--r--lisp/tooltip.el9
-rw-r--r--lisp/whitespace.el86
-rw-r--r--lisp/winner.el35
-rw-r--r--lispref/ChangeLog23
-rw-r--r--lispref/README4
-rw-r--r--lispref/book-spine.texinfo2
-rw-r--r--lispref/customize.texi26
-rw-r--r--lispref/display.texi14
-rw-r--r--lispref/elisp.texi2
-rw-r--r--lispref/os.texi2
-rw-r--r--mac/ChangeLog5
-rw-r--r--mac/Emacs.app/Contents/Info.plist38
-rw-r--r--man/ChangeLog32
-rw-r--r--man/anti.texi5
-rw-r--r--man/calc.texi184
-rw-r--r--man/display.texi11
-rw-r--r--man/files.texi5
-rw-r--r--man/gnu.texi31
-rw-r--r--man/mule.texi2
-rw-r--r--man/search.texi74
-rw-r--r--man/viper.texi2
-rw-r--r--src/ChangeLog144
-rw-r--r--src/alloc.c35
-rw-r--r--src/bytecode.c14
-rw-r--r--src/coding.c2
-rw-r--r--src/coding.h2
-rw-r--r--src/eval.c16
-rw-r--r--src/indent.c8
-rw-r--r--src/keyboard.c10
-rw-r--r--src/lisp.h2
-rw-r--r--src/lread.c10
-rw-r--r--src/mac.c294
-rw-r--r--src/macterm.c467
-rw-r--r--src/window.c13
-rw-r--r--src/xdisp.c60
-rw-r--r--src/xfaces.c5
-rw-r--r--src/xselect.c1
104 files changed, 2832 insertions, 2303 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index 5c98c14ca3a..7ef6c4349b7 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -21,6 +21,10 @@ face name prefixes should be in it for good results.
21 21
22** Regenerate the postscript files of the reference cards in etc. 22** Regenerate the postscript files of the reference cards in etc.
23 23
24** Ask maintainers of refcard translations to update them.
25
26** Check what should be deleted or updated in MORE.STUFF.
27
24* NEW FEATURES 28* NEW FEATURES
25 29
26** Make VC-over-Tramp work where possible, or at least fail 30** Make VC-over-Tramp work where possible, or at least fail
@@ -101,14 +105,10 @@ further.
101I think in the near future we will see more of this problem, so it might be 105I think in the near future we will see more of this problem, so it might be
102time to make anfe-ftp more intelligent. 106time to make anfe-ftp more intelligent.
103 107
104** lisp/elide-head.el should recognize the FSF's new address as well.
105
106* DOCUMENTATION 108* DOCUMENTATION
107 109
108** Document Custom Themes. 110** Document Custom Themes.
109 111
110** Update lispref/README.
111
112** Update man/info.texi. 112** Update man/info.texi.
113 113
114** Add missing years in copyright notices of all files. 114** Add missing years in copyright notices of all files.
@@ -128,7 +128,7 @@ lisp/emulation working Thien-Thi Nguyen
128lisp/eshell working Thien-Thi Nguyen 128lisp/eshell working Thien-Thi Nguyen
129lisp/international done Kenichi Handa 129lisp/international done Kenichi Handa
130lisp/languages done Kenichi Handa 130lisp/languages done Kenichi Handa
131lisp/mh-e working Thien-Thi Nguyen 131lisp/mh-e working Bill Wohler
132lisp/net working Thien-Thi Nguyen 132lisp/net working Thien-Thi Nguyen
133lisp/play working Thien-Thi Nguyen 133lisp/play working Thien-Thi Nguyen
134lisp/term working Thien-Thi Nguyen 134lisp/term working Thien-Thi Nguyen
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 0bd12c1d847..2ecc124f001 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,30 @@
12005-07-12 Juri Linkov <juri@jurta.org>
2
3 * refcard.tex (Files): Change description of `C-x C-q' from
4 `checkin/checkout' to `toggle read-only'.
5 (Getting Help): Replace `C-h c' with `C-h k'.
6 (Error Recovery): Replace `recover-file' with `recover-session'.
7 (Info): Replace key binding `C-h C-i' with `C-h S'. Add `t'.
8
92005-07-07 Richard M. Stallman <rms@gnu.org>
10
11 * GNU: Update how to help. Improve footnote 7.
12
132005-07-07 Lute Kamstra <lute@gnu.org>
14
15 * tasks.texi: Delete file. The GNU Task List is obsolete and has
16 been replaced by http://savannah.gnu.org/projects/tasklist.
17
182005-07-07 Lute Kamstra <lute@gnu.org>
19
20 * refcard.tex: Update `versionnumber' and `year'. Update Emacs's
21 version to 22.
22 (Starting Emacs): Delete sentence to fix formatting problems.
23 (Multiple Windows): Clarify first sentence. Mention C-x 5 1.
24 (Formatting): Update the binding of set face.
25 (International Character Sets): set-language-environment is bound
26 to C-x RET l.
27
12005-07-05 Lute Kamstra <lute@gnu.org> 282005-07-05 Lute Kamstra <lute@gnu.org>
2 29
3 Update FSF's address in GPL notices. 30 Update FSF's address in GPL notices.
diff --git a/etc/GNU b/etc/GNU
index 4ee6ef03153..0a0e962fda0 100644
--- a/etc/GNU
+++ b/etc/GNU
@@ -22,8 +22,9 @@ The GNU Manifesto
22 Footnotes added in 1993 help clarify these points. 22 Footnotes added in 1993 help clarify these points.
23 23
24 For up-to-date information about the available GNU software, 24 For up-to-date information about the available GNU software,
25 please see the latest issue of the GNU's Bulletin. The list is 25 please see www.gnu.org. For software tasks to work on, see
26 much too long to include here. 26 http://savannah.gnu.org/projects/tasklist. For other ways
27 to contribute, see http://www.gnu.org/help.
27 28
28What's GNU? Gnu's Not Unix! 29What's GNU? Gnu's Not Unix!
29============================ 30============================
@@ -531,13 +532,13 @@ biased; more subtle is the fact that it lumps together various
531disparate laws which raise very different issues. Nowadays I urge 532disparate laws which raise very different issues. Nowadays I urge
532people to reject the term "intellectual property" entirely, lest it 533people to reject the term "intellectual property" entirely, lest it
533lead others to suppose that those laws form one coherent issue. The way to be 534lead others to suppose that those laws form one coherent issue. The way to be
534clear is to to discuss patents, copyrights, and trademarks separately. 535clear is to discuss patents, copyrights, and trademarks separately.
535See http://www.gnu.org/philosophy/not-ipr.xhtml for more explanation 536See http://www.gnu.org/philosophy/not-ipr.xhtml for more explanation
536of how this term spreads confusion and bias. 537of how this term spreads confusion and bias.
537 538
538 (7) In 1985 I had not yet recognized the importance of distinguishing 539 (7) Subsequently we have learned to distinguish between "free
539between "free software" and "freeware". The term "freeware" means 540software" and "freeware". The term "freeware" means software you are
540software you are free to redistribute, but usually you are not free to study 541free to redistribute, but usually you are not free to study and change
541and change the source code, so most of it is not free software. 542the source code, so most of it is not free software. See
542See http://www.gnu.org/philosophy/words-to-avoid.html for more 543http://www.gnu.org/philosophy/words-to-avoid.html for more
543explanation. 544explanation.
diff --git a/etc/MORE.STUFF b/etc/MORE.STUFF
index c2dce4bfd63..e7a8f8e61d8 100644
--- a/etc/MORE.STUFF
+++ b/etc/MORE.STUFF
@@ -62,11 +62,6 @@ You might find bug-fixes or enhancements in these places.
62 62
63 * Expand: <URL:http://w3.teaser.fr/%7Eflepied/expand.el.gz> 63 * Expand: <URL:http://w3.teaser.fr/%7Eflepied/expand.el.gz>
64 64
65 * Find Func:
66 <URL:http://www.kurims.kyoto-u.ac.jp/%7Epetersen/emacs/find-func.el>
67
68 * Flyspell: <URL:http://kaolin.unice.fr/%7Eserrano/emacs/flyspell>
69
70 * Fortune: <URL:http://www.coling.uni-freiburg.de/%7Eschauer/emacs.html> 65 * Fortune: <URL:http://www.coling.uni-freiburg.de/%7Eschauer/emacs.html>
71 66
72 * Gnus: <URL:http://www.gnus.org/> 67 * Gnus: <URL:http://www.gnus.org/>
@@ -80,8 +75,6 @@ You might find bug-fixes or enhancements in these places.
80 75
81 * Iswitchb: <URL:http://www.anc.ed.ac.uk/%7Estephen/emacs/iswitchb.el> 76 * Iswitchb: <URL:http://www.anc.ed.ac.uk/%7Estephen/emacs/iswitchb.el>
82 77
83 * MH-E: <URL:http://mh-e.sourceforge.net/>
84
85 * PC Selection: <URL:ftp://ftp.thp.uni-duisburg.de/pub/source/elisp/> 78 * PC Selection: <URL:ftp://ftp.thp.uni-duisburg.de/pub/source/elisp/>
86 79
87 * PS mode: <URL:http://odur.let.rug.nl/%7Ekleiweg/postscript/> 80 * PS mode: <URL:http://odur.let.rug.nl/%7Ekleiweg/postscript/>
diff --git a/etc/NEWS b/etc/NEWS
index 01e853a1071..33707393e3b 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2256,6 +2256,9 @@ line is left untouched.
2256The function `c-toggle-syntactic-indentation' can be used to toggle 2256The function `c-toggle-syntactic-indentation' can be used to toggle
2257syntactic indentation. 2257syntactic indentation.
2258 2258
2259** In sh-script, a continuation line is only indented if the backslash was
2260preceded by a SPC or a TAB.
2261
2259--- 2262---
2260** Perl mode has a new variable `perl-indent-continued-arguments'. 2263** Perl mode has a new variable `perl-indent-continued-arguments'.
2261 2264
diff --git a/etc/TODO b/etc/TODO
index 292276796db..24ec1484222 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -93,6 +93,12 @@ to the FSF.
93 93
94* Other features we would like: 94* Other features we would like:
95 95
96** Create a category of errors called `process-error'
97 for some or all errors associated with using subprocesses.
98
99** Maybe reinterpret `parse-error' as a category of errors
100 and put some other errors under it.
101
96** A function to check for customizable options that have been 102** A function to check for customizable options that have been
97 set but not saved, and ask the user whether to save them. 103 set but not saved, and ask the user whether to save them.
98 This could go in kill-emacs-query-functions, to remind people 104 This could go in kill-emacs-query-functions, to remind people
@@ -153,6 +159,8 @@ to the FSF.
153 which gives the same information through a menu structure. [Dave 159 which gives the same information through a menu structure. [Dave
154 Love started on this.] 160 Love started on this.]
155 161
162** Add a cpio mode, more or less like tar mode.
163
156** Implement a variant of uncompress.el or jka-compr.el that works with 164** Implement a variant of uncompress.el or jka-compr.el that works with
157 GNU Privacy Guard for encryption. [Code exists but isn't assigned. 165 GNU Privacy Guard for encryption. [Code exists but isn't assigned.
158 See the Gnus development sources for assigned code concerning GPG 166 See the Gnus development sources for assigned code concerning GPG
diff --git a/etc/refcard.tex b/etc/refcard.tex
index 2e6847da8d7..208a48c7832 100644
--- a/etc/refcard.tex
+++ b/etc/refcard.tex
@@ -1,4 +1,4 @@
1% Reference Card for GNU Emacs version 21 on Unix systems 1% Reference Card for GNU Emacs version 22 on Unix systems
2%**start of header 2%**start of header
3\newcount\columnsperpage 3\newcount\columnsperpage
4\newcount\letterpaper 4\newcount\letterpaper
@@ -14,7 +14,7 @@
14\letterpaper=1 14\letterpaper=1
15 15
16% Nothing else needs to be changed below this line. 16% Nothing else needs to be changed below this line.
17% Copyright (c) 1987, 1993, 1996, 1997 Free Software Foundation, Inc. 17% Copyright (c) 1987, 1993, 1996, 1997, 2005 Free Software Foundation, Inc.
18 18
19% This file is part of GNU Emacs. 19% This file is part of GNU Emacs.
20 20
@@ -62,8 +62,8 @@
62 62
63% If there were room, it would be nice to see a section on Dired. 63% If there were room, it would be nice to see a section on Dired.
64 64
65\def\versionnumber{2.2} 65\def\versionnumber{2.3}
66\def\year{1997} 66\def\year{2005}
67 67
68\def\shortcopyrightnotice{\vskip 1ex plus 2 fill 68\def\shortcopyrightnotice{\vskip 1ex plus 2 fill
69 \centerline{\small \copyright\ \year\ Free Software Foundation, Inc. 69 \centerline{\small \copyright\ \year\ Free Software Foundation, Inc.
@@ -72,7 +72,7 @@
72\def\copyrightnotice{ 72\def\copyrightnotice{
73\vskip 1ex plus 2 fill\begingroup\small 73\vskip 1ex plus 2 fill\begingroup\small
74\centerline{Copyright \copyright\ \year\ Free Software Foundation, Inc.} 74\centerline{Copyright \copyright\ \year\ Free Software Foundation, Inc.}
75\centerline{v\versionnumber{} for GNU Emacs version 21, \year} 75\centerline{v\versionnumber{} for GNU Emacs version 22, \year}
76\centerline{designed by Stephen Gildea} 76\centerline{designed by Stephen Gildea}
77 77
78Permission is granted to make and distribute copies of 78Permission is granted to make and distribute copies of
@@ -270,13 +270,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
270 270
271\title{GNU Emacs Reference Card} 271\title{GNU Emacs Reference Card}
272 272
273\centerline{(for version 21)} 273\centerline{(for version 22)}
274 274
275\section{Starting Emacs} 275\section{Starting Emacs}
276 276
277To enter GNU Emacs 21, just type its name: \kbd{emacs} 277To enter GNU Emacs 22, just type its name: \kbd{emacs}
278
279To read in a file to edit, see Files, below.
280 278
281\section{Leaving Emacs} 279\section{Leaving Emacs}
282 280
@@ -291,7 +289,7 @@ To read in a file to edit, see Files, below.
291\key{{\bf insert} contents of another file into this buffer}{C-x i} 289\key{{\bf insert} contents of another file into this buffer}{C-x i}
292\key{replace this file with the file you really want}{C-x C-v} 290\key{replace this file with the file you really want}{C-x C-v}
293\key{write buffer to a specified file}{C-x C-w} 291\key{write buffer to a specified file}{C-x C-w}
294\key{version control checkin/checkout}{C-x C-q} 292\key{toggle read-only status of buffer}{C-x C-q}
295 293
296\section{Getting Help} 294\section{Getting Help}
297 295
@@ -303,14 +301,14 @@ the directions. If you are a first-time user, type \kbd{C-h t} for a
303\key{scroll help window}{C-M-v} 301\key{scroll help window}{C-M-v}
304 302
305\key{apropos: show commands matching a string}{C-h a} 303\key{apropos: show commands matching a string}{C-h a}
306\key{show the function a key runs}{C-h c} 304\key{describe the function a key runs}{C-h k}
307\key{describe a function}{C-h f} 305\key{describe a function}{C-h f}
308\key{get mode-specific information}{C-h m} 306\key{get mode-specific information}{C-h m}
309 307
310\section{Error Recovery} 308\section{Error Recovery}
311 309
312\key{{\bf abort} partially typed or executing command}{C-g} 310\key{{\bf abort} partially typed or executing command}{C-g}
313\metax{{\bf recover} a file lost by a system crash}{M-x recover-file} 311\metax{{\bf recover} files lost by a system crash}{M-x recover-session}
314\metax{{\bf undo} an unwanted change}{C-x u, C-_ {\rm or} C-/} 312\metax{{\bf undo} an unwanted change}{C-x u, C-_ {\rm or} C-/}
315\metax{restore a buffer to its original contents}{M-x revert-buffer} 313\metax{restore a buffer to its original contents}{M-x revert-buffer}
316\key{redraw garbaged screen}{C-l} 314\key{redraw garbaged screen}{C-l}
@@ -388,6 +386,8 @@ If Emacs is still searching, \kbd{C-g} cancels only the part not done.
388\section{Query Replace} 386\section{Query Replace}
389 387
390\key{interactively replace a text string}{M-\%} 388\key{interactively replace a text string}{M-\%}
389% query-replace-regexp is bound to C-M-% but that can't be typed on
390% consoles.
391\metax{using regular expressions}{M-x query-replace-regexp} 391\metax{using regular expressions}{M-x query-replace-regexp}
392 392
393Valid responses in query-replace mode are 393Valid responses in query-replace mode are
@@ -402,12 +402,12 @@ Valid responses in query-replace mode are
402 402
403\section{Multiple Windows} 403\section{Multiple Windows}
404 404
405When two commands are shown, the second is for ``other frame.'' 405When two commands are shown, the second is a similar command for a
406 406frame instead of a window.
407\key{delete all other windows}{C-x 1}
408 407
409{\setbox0=\hbox{\kbd{0}}\advance\hsize by 0\wd0 408{\setbox0=\hbox{\kbd{0}}\advance\hsize by 0\wd0
410\paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr 409\paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr
410\threecol{delete all other windows}{C-x 1\ \ \ \ }{C-x 5 1}
411\threecol{split window, above and below}{C-x 2\ \ \ \ }{C-x 5 2} 411\threecol{split window, above and below}{C-x 2\ \ \ \ }{C-x 5 2}
412\threecol{delete this window}{C-x 0\ \ \ \ }{C-x 5 0} 412\threecol{delete this window}{C-x 0\ \ \ \ }{C-x 5 0}
413}} 413}}
@@ -449,7 +449,7 @@ When two commands are shown, the second is for ``other frame.''
449\key{set fill column}{C-x f} 449\key{set fill column}{C-x f}
450\key{set prefix each line starts with}{C-x .} 450\key{set prefix each line starts with}{C-x .}
451 451
452\key{set face}{M-g} 452\key{set face}{M-o}
453 453
454\section{Case Change} 454\section{Case Change}
455 455
@@ -562,7 +562,7 @@ minibuffer. Type \kbd{F10} to activate the menu bar using the minibuffer.
562 562
563\section{International Character Sets} 563\section{International Character Sets}
564 564
565\metax{specify principal language}{M-x set-language-environment} 565\key{specify principal language}{C-x RET l}
566\metax{show all input methods}{M-x list-input-methods} 566\metax{show all input methods}{M-x list-input-methods}
567\key{enable or disable input method}{C-\\} 567\key{enable or disable input method}{C-\\}
568\key{set coding system for next command}{C-x RET c} 568\key{set coding system for next command}{C-x RET c}
@@ -572,7 +572,7 @@ minibuffer. Type \kbd{F10} to activate the menu bar using the minibuffer.
572\section{Info} 572\section{Info}
573 573
574\key{enter the Info documentation reader}{C-h i} 574\key{enter the Info documentation reader}{C-h i}
575\key{find specified function or variable in Info}{C-h C-i} 575\key{find specified function or variable in Info}{C-h S}
576\beginindentedkeys 576\beginindentedkeys
577 577
578Moving within a node: 578Moving within a node:
@@ -591,6 +591,7 @@ Moving between nodes:
591\key{follow cross reference (return with \kbd{l})}{f} 591\key{follow cross reference (return with \kbd{l})}{f}
592\key{return to last node you saw}{l} 592\key{return to last node you saw}{l}
593\key{return to directory node}{d} 593\key{return to directory node}{d}
594\key{go to top node of Info file}{t}
594\key{go to any node by name}{g} 595\key{go to any node by name}{g}
595 596
596Other: 597Other:
diff --git a/etc/tasks.texi b/etc/tasks.texi
deleted file mode 100644
index c4ecca49ffe..00000000000
--- a/etc/tasks.texi
+++ /dev/null
@@ -1,964 +0,0 @@
1\input texinfo @c -*-texinfo-*-
2@c %**start of header
3@setfilename tasks.info
4@settitle GNU Task List
5@c This date is automagically updated when you save this file:
6@set lastupdate October 24, 2002
7@c %**end of header
8
9@c On behalf of the Volunteer Coordinators, I humbly request that anyone
10@c who adds an entry to this file please add a pointer to some more info
11@c about that project. People ask us (gvc@gnu.org) for more information
12@c about these projects and it's embarrassing to ask around and find out
13@c that nobody remembers what the project was supposed to be, or do.
14@c We don't need a huge elaborate ISO-9001 document, just a couple of
15@c paragraphs or a URL or something that explains what the e.g. ``stalker''
16@c project should do. It will save us all time in the future.
17@c Thanks, toby@gnu.org
18@c April 27, 2002
19
20@dircategory GNU organization
21@direntry
22* Tasks: (tasks). GNU task list.
23@end direntry
24
25@setchapternewpage off
26
27@copying
28The GNU task list, last updated @value{lastupdate}.
29
30Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
311997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
32
33@quotation
34Copying and distribution of this file, with or without modification,
35are permitted in any medium without royalty provided the copyright
36notice and this notice are preserved.
37@end quotation
38@end copying
39
40@titlepage
41@title GNU Task List
42@author Free Software Foundation
43@author last updated @value{lastupdate}
44@page
45@vskip 0pt plus 1filll
46@insertcopying
47@end titlepage
48
49@contents
50
51@ifnottex
52@node Top, Intro, (dir), (dir)
53@top GNU Task List
54
55@insertcopying
56
57See also
58@uref{http://www.gnu.org/help/help.html#helpgnu} for other suggested tasks.
59@end ifnottex
60
61@menu
62* Intro::
63* Highest Priority::
64* Documentation::
65* Unix-Related Projects::
66* Kernel Projects::
67* Extensions::
68* Java Projects::
69* X Windows Projects::
70* Network Projects::
71* Encryption Projects::
72* Other Projects::
73* Languages::
74* Education::
75* Games and Recreations::
76@end menu
77
78@node Intro, Highest Priority, Top, Top
79@chapter About the GNU Task List
80
81If you did not obtain this file directly from the GNU project and
82recently, please check for a newer version. You can ftp the task list
83from any GNU FTP host in directory @file{/pub/gnu/tasks/}. The task
84list is available there in several different formats: @file{tasks.text},
85@file{tasks.texi}, @file{tasks.info}, and @file{tasks.dvi}.
86@c to fix an overfill, join the paragraphs -len
87The task list is also available on the GNU World Wide Web server:
88@uref{http://www.gnu.org/prep/tasks_toc.html}.
89
90If you start working steadily on a project, please let @email{gvc@@gnu.org}
91know. We might have information that could help you; we'd also like to
92send you the GNU coding standards.
93
94Because of the natural tendency for most volunteers to write programming
95tools or programming languages, we have a comparative shortage of
96applications useful for non-programmer users. Therefore, we ask you to
97consider writing such a program.
98
99Typically, a new program that does a completely new job advances
100the GNU project, and the free software community, more than an
101improvement to an existing program.
102
103Typically, new features or new programs advance the free software
104community more, in the long run, than porting existing programs. One
105reason is that portable new features and programs benefit people on many
106platforms, not just one. At the same time, there tend to be many
107volunteers for porting---so your help will be more valuable in other
108areas, where volunteers are more scarce.
109
110Typically, it is more useful to extend a program in functionality than
111to improve performance. Users who use the new functionality will
112appreciate it very much, if they use it; but even when they benefit from
113a performance improvement, they may not consider it very important.
114
115Finally, if you think of an important job that free software cannot
116solve yet that is typically solved by proprietary software, please send
117a short description of that job to @email{tasks@@gnu.org} so that we can
118add it to this task list.
119
120@node Highest Priority, Documentation, Intro, Top
121@chapter Highest Priority
122
123This task list mentions a large number of tasks that would be more or
124less useful. With luck, at least one of them will inspire you to start
125writing. It's better for you to work on any task that inspires you than
126not write free software at all.
127
128But if you would like to work on what we need most, here is a list of
129high priority projects.
130
131@itemize @bullet
132
133@item
134
135If you are good at writing documentation, please do that. Pick a system
136or program you like, and write a Free tutorial or manual for it.
137
138@item
139
140Help to finish the missing features of the @command{docbook2texi} so
141that as many Docbook tags as possible can be translated into reasonable
142Texinfo. See @uref{http://docbook2x.sourceforge.net/todo.html} for a
143task list of what needs to be done.
144
145@item
146If you are very good at C programming and interested in kernels, you
147can help develop the GNU HURD, the kernel for the GNU system. Please
148have a look at @uref{http://www.gnu.org/software/hurd/hurd.html}, and
149then join the HURD mailing lists at
150@uref{http://www.debian.org/ports/hurd/hurd-contact}.
151
152@item
153If you are a Scheme fan, you can help develop Guile. Please have a look
154at the URL @uref{http://www.gnu.org/software/guile/guile.html}
155and then contact the Guile developers at @email{guile-devel@@gnu.org}.
156
157@item
158Improve the facilities for translating other languages into Scheme,
159so that Guile can provide support for a variety of languages.
160
161@item
162A package to convert programs written using MS Access into Scheme,
163making use of a free data base system and the GTK toolkit.
164
165@item
166A general-purpose document viewing program that can handle PostScript,
167DVI, PDF, HTML, RTF, Word format and Word Perfect format.
168
169@item
170Help develop software to emulate Windows NT on top of GNU systems.
171For example, you could help work on Wine.
172See @uref{http://www.winehq.org/}.
173
174@ignore
175@c panda is a PDF generator library released under the GPL
176@c http://www.stillhq.com/cgi-bin/getpage?area=panda&page=index.htm
177@item
178A free replacement for pdflib. This is a library for generating PDF.
179@end ignore
180
181@item
182Add gettext support to GNU programs that don't have it already. (Please
183contact the developers of the specific packages that you want to work
184on.)
185
186@item
187Develop a substitute, which runs on GNU systems, for some very popular
188or very important application that many non-programmers use on Windows,
189and which has no comparable free equivalent now.
190@end itemize
191
192@node Documentation, Unix-Related Projects, Highest Priority, Top
193@chapter Documentation
194
195We very urgently need documentation for many existing parts of the
196system.
197
198Note that there are proprietary manuals for many of these topics, but
199proprietary manuals do not count, for the same reason proprietary
200software does not count: we are not free to copy and modify them.
201We do not recommend any non-free materials as documentation.
202
203@itemize @bullet
204
205@item
206A reference document for SQL for use as a standard for implementors of
207free software versions of SQL.
208
209@item
210A manual for libstdc++.
211
212
213@ignore
214@c the Indian TeX Users Group has completed a freely distributable version of a LaTex manual - http://www.tug.org.in/tutorials.html
215@item
216A unified manual for La@TeX{}. (Existing documentation is non-free.)
217@end ignore
218
219@ignore
220@c docbook definitive guide http://www.docbook.org/tdg/en/html/ is now FDL
221@item
222A manual for Docbook SGML format.
223@end ignore
224
225@item
226A tutorial introduction to Midnight Commander.
227
228@item
229A thorough manual for RCS.
230
231@item
232A reference manual for Mach.
233
234@item
235A reference manual for the GNU Hurd features in GNU libc.
236
237@item
238A manual for writing Hurd servers.
239
240@ignore
241@c this is done.
242@item
243A manual for GNU sed.
244@end ignore
245
246@item
247Reference manuals for C++, Objective C, Pascal, Fortran 77, and Java.
248
249@item
250A tutorial manual for the C++ STL (standard template library).
251
252@item
253A tutorial manual for Gforth.
254
255@item
256GNU Objective-C Runtime Library Manual; this would be a reference manual
257for the runtime library functions, structures, and classes. Some work
258has been done on this job.
259
260@item
261Manuals for GNUstep: developer tutorial, developer programming manual,
262developer reference manual, and user manual.
263
264@item
265A manual for Ghostscript.
266
267@item
268A manual for TCSH.
269
270@item
271A coherent free reference manual for Perl. Most of the Perl on-line
272reference documentation can be used as a starting point, but work is
273needed to weld them together into a coherent manual.
274
275@c Bradley M. Kuhn is working on this. <bkuhn@gnu.org> Refer volunteers to
276@c him.
277
278@item
279
280A good free Perl language tutorial introduction. The existing Perl
281introductions are published with restrictions on copying and
282modification, so that they cannot be part of a GNU system. bkuhn made a
283start at a free tutorial, but a lot of work is needed.
284
285
286@item
287A manual for PIC (the graphics formatting language).
288
289@item
290A book on how GCC works and why various machine descriptions
291are written as they are.
292
293@item
294A manual for programming applications for X11.
295
296@item
297Manuals for various X window managers.
298
299@item
300Reference cards for those manuals that don't have them: C
301Compiler, Texinfo, Termcap, and maybe the C Library.
302
303@item
304Many utilities still need documentation.
305@end itemize
306
307@node Unix-Related Projects, Kernel Projects, Documentation, Top
308@chapter Unix-Related Projects
309
310@itemize @bullet
311@ignore
312@item
313Modify the GNU @code{dc} program to use the math routines of GNU
314@code{bc}.
315@end ignore
316
317@item
318Rewrite @code{indent} from scratch to make it cleaner.
319
320@item
321Write a free software replacement for the @code{agrep} program.
322
323@item
324Less urgent: make a replacement for the ``writer's workbench'' program
325@code{style}, or something to do the same kind of job. Compatibility
326with Unix is not especially important for this program.
327
328@end itemize
329
330@node Kernel Projects, Extensions, Unix-Related Projects, Top
331@chapter Kernel-Related Projects
332
333@itemize @bullet
334@item
335An over-the-ethernet debugger stub that will allow the kernel to be
336debugged from GDB running on another machine.
337
338This stub needs its own self-contained implementation of all protocols
339to be used, since the GNU system will use user processes to implement
340all but the lowest levels, and the stub won't be able to use those
341processes. If a simple self-contained implementation of IP and TCP is
342impractical, it might be necessary to design a new, simple protocol
343based directly on ethernet. It's not crucial to support high speed or
344communicating across gateways.
345
346It might be possible to use the Mach ethernet driver code, but it would
347need some changes.
348
349@item
350A shared memory X11 server to run under MACH is very desirable. The
351machine specific parts should be kept well separated.
352
353@item
354An implementation of CIFS, the ``Common Internet File System,'' for the
355HURD. This protocol is an offshoot of SMB.
356
357@item
358Support (in Linux?) for dumping the non-textual contents of an SVGA
359console.
360@end itemize
361
362@node Extensions, Java Projects, Kernel Projects, Top
363@chapter Extensions to Existing GNU Software
364
365@itemize @bullet
366@item
367Enhance GCC. See files @file{PROJECTS} and @file{PROBLEMS} in the GCC
368distribution.
369
370@item
371Interface GDB to Guile, so that users can write debugging commands in
372Scheme. This would also make it possible to write, in Scheme, a
373graphical interface that uses GTK and is tightly integrated into GDB.
374
375@item
376Extend Octave to support programs that were written
377to run on Khoros.
378
379@item
380Rewrite Automake in Scheme, so it can run in Guile. Right now it is
381written in Perl. There are also other programs, not terribly long,
382which we would also like to have rewritten in Scheme.
383
384@item
385Finish the partially-implemented C interpreter project.
386
387@item
388Help with the development of GNUstep, a GNU implementation of the
389OpenStep specification.
390
391@item
392Add features to GNU Make to record the precise rule with which each file
393was last recompiled; then recompile any file if its rule in the makefile
394has changed.
395
396@item
397Add a few features to GNU @code{diff}, such as handling large input
398files without reading entire files into core.
399
400@item
401An @code{nroff} macro package to simplify @code{texi2roff}.
402
403@item
404A queueing system for the mailer Smail that groups pending work by
405destination rather than by original message. This makes it possible
406to schedule retries coherently for each destination. Talk to
407@email{tron@@veritas.com} and @email{woods@@weird.com} about this.
408
409@end itemize
410
411@node Java Projects, X Windows Projects, Extensions, Top
412@chapter Java Projects
413
414@itemize @bullet
415
416@item
417The GNU Classpath Extensions project is looking for help. classpathx
418builds free versions of Sun's java extension libraries, the packages
419in the javax namespace.
420
421@item
422Write a replacement for the javadoc utility. The Classpath
423(@uref{http://www.gnu.org/software/classpath}) team has already made a
424start to one.
425
426
427@end itemize
428
429@node X Windows Projects, Network Projects, Java Projects, Top
430@chapter X Windows Projects
431
432@itemize @bullet
433@item
434An emulator for Macintosh graphics calls on top of X Windows.
435
436@ignore
437@c winelib does this http://www.winehq.org/
438@item
439A package that emulates the API of Visual C++'s Foundation Classes
440(MFC), but operates on top of X11. It need not match the screen
441appearance provided by MFC. Instead, it would be best to use GTK, so as
442to give coherence with GNOME.
443@end ignore
444
445@ignore
446@c GNOME Basic is doing this
447@item
448A compatible replacement for Visual Basic, running on top of X11.
449It need not match the screen appearance of Visual C++. Instead,
450it would be best to use GTK, so as to give coherence with GNOME.
451@end ignore
452
453@ignore
454@c Denemo is doing this.
455@item
456A music playing and editing system. This should work with LilyPond, a
457GNU program for music typesetting.
458@end ignore
459
460@ignore @c GNUskies should do this
461@item
462An ephemeris program to replace xephem (which is, alas, too restricted
463to qualify as free software).
464@end ignore
465
466@c Gepetto (@url{http://laurent.riesterer.free.fr/gepetto/intro-main.html},
467@c @email{laurent.riesterer@@free.fr}), according to @email{gnueval@@gnu.org},
468@c does the job of displaing dancers but does not allow editing notation.
469
470
471@item
472Make sure the Vibrant toolkit works with LessTif instead of Motif.
473
474@item
475A program to display and edit Hypercard stacks.
476
477@item
478A two-dimensional outliner program, which lets you draw
479graph structures of textual items, and then display them
480in various ways.
481
482@ignore @c done
483@item
484A program for graphic morphing of scanned photographs.
485@end ignore
486
487@ignore @c Done by gLabels
488@item
489Software for designing and printing business cards.
490@end ignore
491@end itemize
492
493@node Network Projects, Encryption Projects, X Windows Projects, Top
494@chapter Network Projects
495
496@itemize @bullet
497@ignore
498@c Cornell has released a program for this.
499@item
500A teleconferencing program which does the job of CU-SeeMe (which is,
501alas, not free software).
502@end ignore
503
504@ignore
505@c Bishop Bettini <bishop@synxcti.com> is working on this.
506@item
507A free ICQ-compatible server program. (The ICQ server itself is not
508free software.)
509@end ignore
510
511@ignore
512@c if anyone knows what this means please send email to gvc@gnu.org
513@item
514Free software like Stalker for operating a web server for email
515services.
516@end ignore
517
518@end itemize
519
520@node Encryption Projects, Other Projects, Network Projects, Top
521@chapter Encryption Projects
522
523These projects need to be written outside the US by people who are not
524US citizens, to avoid problems with US export control law.
525
526@itemize @bullet
527@ignore
528@c libcrypt is doing this.
529@item
530A free library for public-key encryption. This library can probably be
531developed from the code for the GNU Privacy Guard.
532@end ignore
533
534@ignore
535@item
536@c GNUtls is doing this.
537An implementation of SSLv3 (more precisely, TLSv1) which has
538distribution terms compatible with the GNU GPL. We know of a
539GPL-covered implemention of a version of SSL that you can use as a
540starting point.
541@end ignore
542
543@ignore
544@c akopia interchange appears to do this. if you'd like to re-open this
545@c item please let the GVC know what you want (in some detail)
546@item
547Free software for doing secure commercial transactions on the web.
548This should be based on libgcrypt and GNUtls.
549@end ignore
550
551@end itemize
552
553@node Other Projects, Languages, Encryption Projects, Top
554@chapter Other Projects
555
556If you think of others that should be added, please
557send them to @email{tasks@@gnu.org}.
558
559@itemize @bullet
560
561@ignore
562@c vcg as of version 1.30 (current as of 2002-10-24) is GPL
563@c toby 2002-10-24
564@item
565A library for automatic graph layout. VCG version 1.0, which was free
566software, might provide a base for this.
567@end ignore
568
569@item
570A data visualization program along the lines of xgobi or ggobi.
571
572@item
573A graph visualization program, which would use that library and
574provide a front end for manual and interactive intervention so as to
575provide a full substitute for equivalent proprietory software. It
576would be good to support DOT format as input, and perhaps other
577formats.
578
579@c Such proprietary software is daVinci and graphviz, but are uncommon enough
580@c that we don't mention them here publicly.
581@c http://www.research.att.com/~erg/graphviz/info/lang.html
582@c Some useful information about graph drawing programs can be found here
583@c http://www.research.att.com/sw/tools/graphviz/gdlinks.html
584
585@c At the time of making this entry, VCG's website was
586@c http://rw4.cs.uni-sb.de/users/sander/html/gsvcg1.html
587
588@item
589
590A ``one stop shopping system'' for advocates involved with social
591justice or other non-profit campaigns. The idea would be to create an
592easy-to-use interface to software that would allow someone to register a
593domain for their organisation, build a website, and set up mailing
594lists. The software would need options to easily do all this, and be
595made easy for non-hackers. Mainly the work would involve bringing
596together a number of existing tools with an overriding configuration
597program.
598
599@ignore LinuxBIOS is doing this
600@item
601A simple PC BIOS. On most new PCs, the BIOS is stored in writable
602memory (misleadingly known as ``flash ROM''). In order to have a wholly
603free system on these PCs, we need a free BIOS.
604
605This task is made simpler by the fact that this BIOS need only support
606enough features to enable a boot-loader such as LILO or GRUB to finish
607loading the kernel. Neither Linux nor Mach actually uses the BIOS once
608it starts up. Also, it is not absolutely necessary to do all the many
609diagnostics that an ordinary BIOS does (though it would be useful to do
610some of them). However, there may be a need to configure certain data
611in the computer in a way that is specific to each model of computer.
612@end ignore
613
614@item
615An imitation of Page Maker or Ventura Publisher.
616
617@item
618An imitation of @code{dbase2} or @code{dbase3}. (How dbased!)
619Harbour, a free replacement for Clipper, would provide a useful start.
620@uref{http://www.harbour-project.org/}.
621
622@ignore @c being done by Jonas etc.
623@item
624A general ledger program, including support for accounts payable,
625account receivables, payroll, inventory control, order processing, etc.
626@end ignore
627
628@item
629A free replacement for Glimpse, which is not free software.
630Swish does some parts of the job, but not all.
631
632@item
633Software for desktop publishing. We are extending Emacs into a WYSIWYG
634word processor, to handle primarily linear text; what this item proposes
635is software focused on page layout.
636
637@ignore It looks like TruePrint will fill this gap
638@item
639A program to typeset C code for printing, to make it easier to read on
640paper. For ideas on what to do, see the book,
641
642@display
643Human Factors and Typography for More Readable Programs,
644Ronald M. Baecker and Aaron Marcus,
645Addison-Wesley, ISBN 0-201-10745-7
646@end display
647
648But you don't have to do exactly what they propose.
649@end ignore
650
651@ignore
652@c This is now being worked on -- rms, 22 June 1998
653@item
654A program to convert Microsoft Word documents to text/enriched, TeX,
655LaTeX, Texinfo, or some other format that free software can edit.
656@end ignore
657
658@ignore
659@c People are helping the developer of siff release it as free software.
660
661@item
662A free replacement for siff (sometimes called sif). This would be a
663program to find similar files in a large file system, ``similar''
664meaning that the files contain a significant number of common substrings
665that are of a certain size or greater. You can find some information
666about siff (which is, unfortunately, not free software) at
667@uref{ftp://ftp.cs.arizona.edu/reports/1993/TR93-33.ps.Z}.
668@end ignore
669
670@ignore
671@c This is being developed -- rms, 3 May 1998
672@item
673A free replacement for the semi-free Qt library.
674@end ignore
675
676@ignore
677@c Ogg Vorbis is doing this, see @url{http://www.xiph.org/ogg/vorbis/index.html} or contact @email{Monty <monty@xiph.org>}.
678
679@item
680High-quality music compression software.
681(Talk with @email{mt@@sulaco.org} for relevant suggestions.)
682Unfortunately we cannot implement the popular MP3 format
683due to patents, so this job includes working out some other
684non-patented format and compression method.
685@end ignore
686
687@item
688A program to play sound distributed in ``Real Audio'' format, if only
689because there is a large corpus of data encoded in this format. We
690ask that you encode audio data in Ogg/Vorbis format since it is
691publically documented and there are Free Software encoders and
692decoders available.
693
694@ignore
695@c we do NOT want to provide software to encode data into proprietary secret formats. People should use ogg/vorbis or another well-documented format instead
696@item
697A program to generate ``Real Audio'' format from audio input.
698@end ignore
699
700@item
701Programs to handle audio in RTSP format.
702
703@ignore @c Software patents have made this domain off limits to free software.
704@item
705An MPEG III audio encoder/decoder (but it is necessary to check, first,
706whether patents make this impossible).
707
708@c Chris Hofstader is working on a non-Festival speech-generation program.
709@c Mario Lang <lang@zid.tu-graz.ac.at> reports that Festival needs only
710@c to be 2-5 times faster to work well with Emacspeak.
711@item
712Speech-generation programs that are faster than the Festival engine.
713This might be done by optimizing Festival.
714
715@c We have a project now.
716@item
717Speech-recognition programs (single-speaker, disconnected speech is sufficient).
718@end ignore
719
720@item
721A braille translation and formatting system which can convert marked up
722documents into braille. This should let the user customize the braille
723translation rules; it would be good to divide it into a
724device-independent part plus drivers. Contact Jason White,
725@email{jasonw@@ariel.ucs.unimelb.EDU.AU}.
726
727@ignore Being done
728@item
729A program to display text word by word, always showing just one word at
730a time. This method permits much faster reading than ordinary text
731display. If you want to work on this, contact @email{stutz@@dsl.org} to
732learn more.
733@end ignore
734
735@item
736More scientific mathematical subroutines.
737(A clone of SPSS is being written already.)
738
739@item
740A scientific data collection and processing tool,
741perhaps something like Scientific Workbench and/or Khoros,
742
743@item
744A free replacement for SciRun, which is not free software.
745
746@item
747A program to calculate properties of molecules by solving
748the Schroedinger equation.
749
750
751@ignore
752@c the Koha project appears to satisfy this need. see www.koha.org
753@c toby 2002-06-21
754
755@item
756Software to replace card catalogs in libraries.
757@end ignore
758
759
760@item
761A simulator for heating and air conditioning systems for buildings.
762
763@ignore
764@c Pat Deegan @email{pat@@psychogenic.com} is working on this.
765@c no URL yet, the status is updated in @file{volunteers}
766
767@item
768A program for voting and tabulating election results.
769
770@end ignore
771
772@ignore
773@c at least 4 GPL program exist for this purpose (one of
774@c which, gramps, has a GNOME UI):
775@c http://www.gnu.org/search/fsd-search.py?q=geneology
776@c 2002-06-27 toby
777
778@item
779A package for editing genealogical records conveniently.
780This could perhaps be done as a Gnome program, or perhaps
781as an Emacs extension.
782
783@end ignore
784
785@ignore
786@c ToutDoux aims to do this.
787@c also Minkowsky (at least simple project management) - toby
788
789@item
790A project-scheduling package that accepts a list of project sub-tasks
791with their interdependencies, and generates Gantt charts and Pert charts
792and all the other standard project progress reports.
793@end ignore
794
795@item
796Grammar and style checking programs.
797
798@item
799A diagnostic program to test a hard disk.
800
801@item
802Optical character recognition programs; especially if suitable for
803scanning documents with multiple fonts and capturing font info as well
804as character codes. Work is being done on this, but more help is needed.
805
806@c Some of the OCR work being done:
807@c Luis Cearra <luisjc@lem.eui.upm.es>, http://lem.eui.upm.es/ocre.html
808@c The status of these projects is updated in @file{/gd/gnuorg/volunteers}
809
810@item
811A program to scan a line drawing and convert it to editable Postscript,
812or some other editable format.
813
814@item
815A program to recognize handwriting (we don't believe PocketLinux's
816handwriting capability is ready for non-PocketLinux environments, yet).
817
818
819@item
820A program that can translate from one natural language, into another.
821For example, a program to translate French into English.
822
823@item
824CAD software, such as a vague imitation of Autocad.
825
826@item
827A program to receive data from a serial-line tap to facilitate the
828reverse-engineering of communication protocols.
829
830@item
831A database program designed to store and retrieve patent information.
832
833@item
834A free software package to run on a Palm Pilot in place of its usual
835software, doing more or less the usual jobs. (Linux, the kernel, has
836apparently been ported, but according to what we hear this port is not
837useful yet.)
838
839@end itemize
840
841@node Languages, Education, Other Projects, Top
842@chapter Programming Languages
843
844Volunteers are needed to write parsers/front ends for languages such as
845Algol 60, Algol 68, PL/I, Cobol, Fortran 90, Delphi, Modula 2, Modula 3,
846RPG, and any other languages designed for compilation, to be used with
847the code generation phases of the GNU C compiler.
848
849@ignore
850@c Fortran status is here so gnu@gnu.org and the volunteer coordinators
851@c don't have to answer the question -len
852@c as of 2002-09 this doesn't work anymore - toby
853You can get the status of the Fortran front end with this command:
854
855@example
856finger -l fortran@@gnu.org
857@end example
858@end ignore
859
860We would like to have translators from various languages into Scheme.
861These languages include TCL, Python, Perl, Java, Javascript, and Rexx.
862Perhaps Clipper as well.
863
864@node Education, Games and Recreations, Languages, Top
865@chapter Education
866
867Programs for studying, teaching or doing administrative tasks in schools.
868See @uref{http://www.gnu.org/education/} for additional information.
869
870@itemize @bullet
871@item
872A program to organize automatically the schedule of a school given
873constraints about teachers, rooms, times, and students.
874
875@item
876A program to edit dance notation (such as labanotation) and display
877dancers moving on the screen. Gepetto does some of this work. Contact
878@email{gvc@@gnu.org} if you are interested in helping finish the job.
879
880@end itemize
881
882@node Games and Recreations, , Education, Top
883@chapter Games and Recreations
884
885Video-oriented games that work with the X window system.
886
887@itemize @bullet
888@item
889Empire (there is a free version but it needs upgrading)
890
891@item
892An ``empire builder'' system that makes it easy to write various kinds of
893simulation games.
894
895@item
896Improve GnuGo @uref{http://www.gnu.org/software/gnugo/gnugo.html}.
897
898@item
899Network servers and clients for board and card games for which such
900software does not yet exist.
901
902@item
903A Hierarchical Task Network package which can be used
904to program play the computer's side in various strategic games.
905
906@item
907A game like Mill/Nine Men's Morris.
908
909@item
910A realistic train-driving simulator.
911
912@item
913Write imitations of some popular video games:
914
915@itemize -
916@item
917Space war, Asteroids, Pong, Columns.
918@item
919Defending cities from missiles.
920@item
921Plane shoots at lots of other planes, tanks, etc.
922@item
923Wizard fights fanciful monsters.
924@ignore Peter Sundling peter.sundling@telia.com expressed interest in this.
925@item
926A golf game.
927@ignore Being done by jhall1@isd.net
928@item
929Program a robot by sticking building blocks together,
930then watch it explore a world.
931@end ignore
932@item
933Biomorph evolution (as in Scientific American and @cite{The Blind
934Watchmaker}).
935@end itemize
936@end itemize
937
938We do not need @code{rogue}, as we have @code{hack}.
939
940
941@bye
942@c LocalWords: dir texi lastupdate uref http www org html helpgnu ifinfo ftp
943@c LocalWords: dvi hurd toc gvc URL GTK XmHTML xs nl ripley NT com gettext Qt
944@c LocalWords: GUI libstdc Docbook SGML libc sed STL Gforth GNUstep TCSH Perl
945@c LocalWords: Ghostscript PIC GCC Texinfo grep dc bc ethernet GDB IP CIFS CU
946@c LocalWords: SMB SVGA Khoros Automake OpenStep diff roff Smail tron veritas
947@c LocalWords: cxref ctrace API LilyPond xephem labanotation LessTif outliner
948@c LocalWords: Hypercard morphing SeeMe ICQ Diffie Helman RSA SSLv TLSv GPL
949@c LocalWords: OpenBIOS BIOS LILO dbase dbased Harbour harbour WYSIWYG ISBN
950@c LocalWords: TruePrint Baecker siff sif cs arizona edu TR ps mt sulaco MP
951@c LocalWords: RTSP MPEG jasonw ariel ucs unimelb AU stutz dsl TCL Javascript
952@c LocalWords: Rexx GnuGo jhall isd Biomorph regexp eval gd gnuorg
953
954Local variables:
955eval: (add-hook 'write-file-hooks 'time-stamp)
956time-stamp-start: "@set lastupdate "
957time-stamp-end: "$"
958time-stamp-format: "%:b %:d, %:y"
959compile-command: "make just-tasks"
960End:
961
962@ignore
963 arch-tag: 7ed10085-fa7c-47d4-9ed5-39e885603e5c
964@end ignore
diff --git a/leim/ChangeLog b/leim/ChangeLog
index e53d29a39ae..9ccaad49175 100644
--- a/leim/ChangeLog
+++ b/leim/ChangeLog
@@ -1,3 +1,8 @@
12005-07-08 Kenichi Handa <handa@m17n.org>
2
3 * quail/japanese.el (quail-japanese-kanji-kkc): Fix order of
4 insertion and deletion.
5
12005-07-04 Lute Kamstra <lute@gnu.org> 62005-07-04 Lute Kamstra <lute@gnu.org>
2 7
3 Update FSF's address in GPL notices. 8 Update FSF's address in GPL notices.
diff --git a/leim/quail/japanese.el b/leim/quail/japanese.el
index fa87a9935b9..09b005a7bb2 100644
--- a/leim/quail/japanese.el
+++ b/leim/quail/japanese.el
@@ -79,9 +79,9 @@
79 (when (= (char-before (overlay-end quail-conv-overlay)) ?n) 79 (when (= (char-before (overlay-end quail-conv-overlay)) ?n)
80 ;; The last char is `n'. We had better convert it to `$B$s(B' 80 ;; The last char is `n'. We had better convert it to `$B$s(B'
81 ;; before kana-kanji conversion. 81 ;; before kana-kanji conversion.
82 (goto-char (overlay-end quail-conv-overlay)) 82 (goto-char (1- (overlay-end quail-conv-overlay)))
83 (delete-char -1) 83 (insert ?$B$s(B)
84 (insert ?$B$s(B)) 84 (delete-char 1))
85 (let* ((from (copy-marker (overlay-start quail-conv-overlay))) 85 (let* ((from (copy-marker (overlay-start quail-conv-overlay)))
86 (len (- (overlay-end quail-conv-overlay) from))) 86 (len (- (overlay-end quail-conv-overlay) from)))
87 (quail-delete-overlays) 87 (quail-delete-overlays)
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index bd6949c799c..dd4dc62a562 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,10 @@
12005-07-13 Ken Raeburn <raeburn@gnu.org>
2
3 * pop.c: Don't include des.h (or variants thereof); krb.h will do
4 it.
5 (sendline): Add the \r\n to the line in a temporary buffer, and
6 write it all at once.
7
12005-07-04 Lute Kamstra <lute@gnu.org> 82005-07-04 Lute Kamstra <lute@gnu.org>
2 9
3 Update FSF's address in GPL notices. 10 Update FSF's address in GPL notices.
diff --git a/lib-src/pop.c b/lib-src/pop.c
index 9a85ba3746c..30a4233d417 100644
--- a/lib-src/pop.c
+++ b/lib-src/pop.c
@@ -76,17 +76,6 @@ extern struct servent *hes_getservbyname (/* char *, char * */);
76# ifdef HAVE_KRB5_H 76# ifdef HAVE_KRB5_H
77# include <krb5.h> 77# include <krb5.h>
78# endif 78# endif
79# ifdef HAVE_DES_H
80# include <des.h>
81# else
82# ifdef HAVE_KERBEROSIV_DES_H
83# include <kerberosIV/des.h>
84# else
85# ifdef HAVE_KERBEROS_DES_H
86# include <kerberos/des.h>
87# endif
88# endif
89# endif
90# ifdef HAVE_KRB_H 79# ifdef HAVE_KRB_H
91# include <krb.h> 80# include <krb.h>
92# else 81# else
@@ -1403,12 +1392,24 @@ sendline (server, line)
1403{ 1392{
1404#define SENDLINE_ERROR "Error writing to POP server: " 1393#define SENDLINE_ERROR "Error writing to POP server: "
1405 int ret; 1394 int ret;
1406 1395 char *buf;
1407 ret = fullwrite (server->file, line, strlen (line)); 1396
1408 if (ret >= 0) 1397 /* Combine the string and the CR-LF into one buffer. Otherwise, two
1409 { /* 0 indicates that a blank line was written */ 1398 reasonable network stack optimizations, Nagle's algorithm and
1410 ret = fullwrite (server->file, "\r\n", 2); 1399 delayed acks, combine to delay us a fraction of a second on every
1411 } 1400 message we send. (Movemail writes line without \r\n, client
1401 kernel sends packet, server kernel delays the ack to see if it
1402 can combine it with data, movemail writes \r\n, client kernel
1403 waits because it has unacked data already in its outgoing queue,
1404 client kernel eventually times out and sends.)
1405
1406 This can be something like 0.2s per command, which can add up
1407 over a few dozen messages, and is a big chunk of the time we
1408 spend fetching mail from a server close by. */
1409 buf = alloca (strlen (line) + 3);
1410 strcpy (buf, line);
1411 strcat (buf, "\r\n");
1412 ret = fullwrite (server->file, buf, strlen (buf));
1412 1413
1413 if (ret < 0) 1414 if (ret < 0)
1414 { 1415 {
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a924fc5488b..c822e5cfd34 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,366 @@
12005-07-13 Luc Teirlinck <teirllm@auburn.edu>
2
3 * custom.el (custom-initialize-safe-set)
4 (custom-initialize-safe-default): Doc fixes.
5
6 * frame.el (blink-cursor-mode): Use `custom-initialize-safe-default'
7 and simplify :init-value again.
8
9 * tooltip.el (tooltip-mode): Use `custom-initialize-safe-default'
10 and simplify :init-value again. Delete autoload.
11
12 * startup.el (command-line): Use `custom-reevaluate-setting' again
13 for tooltip-mode.
14
15 * emacs-lisp/easy-mmode.el (define-minor-mode): Do not override
16 explicitly specified :initialize keyword.
17
182005-07-13 Juanma Barranquero <lekktu@gmail.com>
19
20 * allout.el (my-mark-marker, allout-isearch-prior-pos)
21 (allout-unprotected, allout-undo-aggregation, allout-snug-back)
22 (allout-post-command-business, allout-flag-region)
23 (isearch-reenable-font-lock, allout-yank)
24 (allout-insert-latex-header, allout-insert-latex-trailer)
25 (allout-latex-verbatim-quote-curr-line, allout-latexify-exposed)
26 (allout-latex-verb-quote): Fix typos in docstrings.
27 (allout-enwrap-isearch, regexp-sans-escapes): Doc fix.
28 (allout-unprotected, allout-prefix-data):
29 Improve argument/docstring consistency.
30 (allout-chart-subtree): Fix argument spec.
31 (allout-open-topic): Rename `use_sib_bullet' argument to
32 `use-sib-bullet'. Doc fix.
33
34 * whitespace.el (whitespace-check-buffer-leading)
35 (whitespace-check-buffer-trailing)
36 (whitespace-check-buffer-indent)
37 (whitespace-check-buffer-spacetab)
38 (whitespace-check-buffer-ateol, whitespace-highlighted-space)
39 (whitespace-check-leading-whitespace)
40 (whitespace-check-trailing-whitespace)
41 (whitespace-check-spacetab-whitespace)
42 (whitespace-check-indent-whitespace)
43 (whitespace-check-ateol-whitespace, whitespace-abort-on-error)
44 (whitespace-modes): Fix typos in docstrings.
45 (defgroup, defcustom): Doc fix.
46
47 * winner.el (winner-mode, winner-boring-buffers)
48 (winner-pending-undo-ring): Doc fixes.
49 (winner-ring): Remove unneeded `progn'.
50 (winner-equal): `defsubst' it.
51 (winner-redo): Fix message.
52
532005-07-13 Kim F. Storm <storm@cua.dk>
54
55 * simple.el (line-move-1): Always use vertical-motion to
56 do the last (or only) line move to ensure some movement.
57 Undo 2005-06-23 change--don't check for overlays.
58
592005-07-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
60
61 * term/mac-win.el (ccl-encode-mac-roman-font)
62 (ccl-encode-mac-centraleurroman-font)
63 (ccl-encode-mac-cyrillic-font, ccl-encode-mac-symbol-font):
64 (ccl-encode-mac-dingbats-font): Remove check for ASCII.
65 Change charset-id boundary of dimension to ?\xef.
66 (mac-char-fontspec-list): New constant.
67 (fontset-add-mac-fonts): Use it. Accept non-string `base-family'
68 argument. Nil uses itself as family in font-spec. Previous
69 behavior for nil is now provided by non-nil non-string argument.
70 All callers changed. Add font-specs for Mac fonts to
71 "fontset-default" unless iso8859-1 fonts are installed.
72
732005-07-13 Stefan Monnier <monnier@iro.umontreal.ca>
74
75 * progmodes/sh-script.el (sh-get-indent-info): Only indent
76 a continuation line if the \ is preceded by SPC or TAB.
77 (sh-get-indent-info): Simplify.
78 (sh-mark-init, sh-learn-buffer-indent, sh-add-completer):
79 Use with-current-buffer.
80
81 * font-lock.el (font-lock-fontify-keywords-region): Avoid inf-loops
82 when the matched text is empty.
83
842005-07-12 Luc Teirlinck <teirllm@auburn.edu>
85
86 * startup.el (command-line): Revert to previous handling of
87 tooltip-mode. Explain in comment why the complexity is needed.
88
89 * tooltip.el (tooltip-mode): Revert to previous implementation of
90 its defcustom.
91
92 * frame.el (blink-cursor-mode): Revert to previous implementation
93 of its defcustom. Update comment.
94
952005-07-12 Lars Hansen <larsh@soem.dk>
96
97 * desktop.el: Update e-mail address.
98
992005-07-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
100
101 * term/mac-win.el (mac-services-mail-selection)
102 (mac-services-mail-to): New functions.
103 (mac-application-menu-map): Bind them.
104
1052005-07-12 wulei <milton@wulei.net> (tiny change)
106
107 * progmodes/gdb-ui.el: Add note about buffering with Windows.
108
1092005-07-11 Luc Teirlinck <teirllm@auburn.edu>
110
111 * custom.el (custom-reevaluate-setting): Doc fix.
112
1132005-07-11 Jay Belanger <belanger@truman.edu>
114
115 * calc/calc.el (calc-embedded-announce-formula-alist)
116 (calc-embedded-open-close-plain-alist)
117 (calc-embedded-open-close-mode-alist): Add checks for additional
118 major modes (due to Robert J. Chassell <bob@rattlesnake.com>).
119
1202005-07-11 Juanma Barranquero <lekktu@gmail.com>
121
122 * custom.el (custom-enable-theme): Don't add theme to
123 `custom-enabled-themes' with `push' because there is no
124 setf-method for `delq'.
125
1262005-07-11 Richard M. Stallman <rms@gnu.org>
127
128 * custom.el (custom-declare-variable): Doc fix.
129
130 * dired-aux.el (dired-compare-directories): Remove "." and ".."
131 from the alists.
132
133 * emacs-lisp/edebug.el (edebug-slow-after, edebug-slow-before):
134 Do nothing if edebug-active.
135
136 * emacs-lisp/edebug.el (edebug-enter): Don't with-timeout-suspend here.
137 (edebug-display): Do it here instead.
138
1392005-07-10 Richard M. Stallman <rms@gnu.org>
140
141 * cus-face.el (custom-theme-set-faces): Make it work.
142 (custom-reset-faces): Doc fix.
143 (custom-theme-reset-internal-face, custom-theme-face-value):
144 Functions deleted.
145
146 * custom.el (custom-push-theme): Maintain list of the settings
147 of a given theme in its theme-settings property.
148 Maintain position of old settings in the theme-value
149 or theme-face property.
150 (custom-enabled-themes): New variable.
151 (custom-theme-enabled-p): New function.
152 (provide-theme): Update custom-enabled-themes.
153 Disable and reenable the `user' theme.
154 (require-theme): Doc fix.
155 (custom-do-theme-reset, custom-remove-theme): Functions deleted.
156 (custom-theme-value, custom-theme-variable-value): Likewise.
157 (custom-theme-reset-internal): Likewise.
158 (custom-theme-load-themes): Fix bugs and use custom-disable-theme.
159 (custom-enable-theme, custom-disable-theme): New functions.
160 (custom-variable-theme-value, custom-face-theme-value): Likewise.
161 (custom-theme-recalc-variable, custom-theme-recalc-face): Likewise.
162 (custom-theme-reset-variables): Simplify.
163 (deftheme, custom-declare-theme, custom-make-theme-feature):
164 Definitions moved.
165
1662005-07-10 Chong Yidong <cyd@stupidchicken.com>
167
168 * longlines.el (longlines-show-region)
169 (longlines-unshow-hard-newlines): Recognize hard newlines by
170 non-nil hard property, instead of t.
171
1722005-07-10 Michael Kifer <kifer@cs.stonybrook.edu>
173
174 * viper-cmd.el (viper--key-maps): New variable.
175 (viper-normalize-minor-mode-map-alist): Use viper--key-maps and
176 emulation-mode-map-alists.
177 (viper-envelop-ESC-key): Use viper-subseq.
178 (viper-search-forward/backward/next): Disable debug-on-error.
179
180 * viper-keym.el (viper-toggle-key, viper-quoted-insert-key)
181 (viper-ESC-key): New defcustoms.
182
183 * viper-macs.el (ex-map-read-args): Use viper-subseq.
184
185 * viper-util.el (viper-key-to-emacs-key): Use viper-subseq.
186 (viper-subseq): Copy of subseq from cl.el.
187
188 * viper.el (viper-go-away, viper-set-hooks): Use
189 emulation-mode-map-alists, advise self-insert-command, add-minor-mode.
190
191 * viper-mous.el (viper-current-frame-saved): Use defvar.
192
193 * viper-init.el: Get rid of -face in face names.
194
195 * ediff-diff.el (ediff-extract-diffs, ediff-extract-diffs3):
196 Make it work with longlines mode
197
198 * ediff-mult.el (ediff-meta-mode-hook): New variable.
199
200 * ediff-ptch.el (ediff-file-name-sans-prefix): Quote regexp.
201
202 * ediff-init: Get rid of -face in face names.
203
2042005-07-10 Richard M. Stallman <rms@gnu.org>
205
206 * emacs-lisp/edebug.el (edebug-enter): Call with-timeout-suspend
207 and with-timeout-unsuspend.
208
209 * emacs-lisp/debug.el (debug): Call with-timeout-suspend
210 and with-timeout-unsuspend.
211
212 * emacs-lisp/timer.el (with-timeout-timers): New variable.
213 (with-timeout): Bind that variable to record timers.
214 (with-timeout-suspend, with-timeout-unsuspend): New functions.
215
216 * emacs-lisp/debug.el (debug-help-follow): New function.
217 (debugger-mode-map): Use that instead of help-follow.
218 (debugger-setup-buffer): Use eval-buffer-list
219 to handle eval-buffer frames.
220
2212005-07-10 N. Raghavendra <raghu@mri.ernet.in> (tiny change)
222
223 * timezone.el (timezone-parse-date): Change first regexp
224 so it will not mistakenly match dates with no time zone.
225
2262005-07-10 Jeff Dwork <jeff.dwork@amd.com> (tiny change)
227
228 * facemenu.el (facemenu-read-color): Do case-insensitive matching.
229
2302005-07-10 Luc Teirlinck <teirllm@auburn.edu>
231
232 * custom.el (custom-initialize-safe-set)
233 (custom-initialize-safe-default): New functions.
234
235 * frame.el (blink-cursor-mode): Use `custom-initialize-safe-default'
236 and simplify :init-value.
237
238 * tooltip.el (tooltip-mode): Use `custom-initialize-safe-default'
239 and simplify :init-value. Delete obsolete comment.
240
241 * startup.el (command-line): Use `custom-reevaluate-setting' to
242 handle `tooltip-mode'. Delete obsolete comment.
243
244 * files.el (set-visited-file-name): Avoid calling
245 `file-name-nondirectory' with a nil argument.
246
2472005-07-09 Richard M. Stallman <rms@gnu.org>
248
249 * emacs-lisp/debug.el (debugger-setup-buffer): When eval-buffer
250 was called with nil for the buffer, handle the read position right.
251 Handle read position for eval-region, too.
252
2532005-07-09 Juri Linkov <juri@jurta.org>
254
255 * fringe.el (fringe-mode): Add period in docstring.
256 (fringe-query-style): Build prompt depending on `all-frames' arg.
257
258 * dired.el (dired-marker-char): Avoid quotations for `do' and `mark'
259 to not create links to unrelated functions in the Help buffer.
260
261 * progmodes/compile.el (compilation-mode-hook, compilation-mode):
262 Doc fix.
263
264 * simple.el (next-error-hook): New variable.
265 (next-error): Use it. Doc fix.
266
267 * textmodes/ispell.el (ispell-command-loop): Add current
268 dictionary name and program name to mode-line-format.
269 (ispell-region, ispell-process-line): Add current dictionary name
270 and program name to messages.
271
2722005-07-08 Jay Belanger <belanger@truman.edu>
273
274 * calc/calc.el (calc-embedded-announce-formula-alist)
275 (calc-embedded-open-close-formula-alist)
276 (calc-embedded-open-close-word-alist)
277 (calc-embedded-open-close-plain-alist)
278 (calc-embedded-open-close-new-formula-alist)
279 (calc-embedded-open-close-mode-alist)
280 (calc-embedded-new-buffer-hook, calc-embedded-new-formula-hook)
281 (calc-embedded-mode-hook): New variables.
282
283 * calc/calc-embed.el (calc-embedded-firsttime)
284 (calc-embedded-firsttime-buf, calc-embedded-firsttime-formula):
285 New variables.
286 (calc-do-embedded): Use calc-embedded-firsttime,
287 calc-embedded-firsttime-buf and calc-embedded-firsttime-formula to
288 determine whether or not to run hooks.
289 (calc-embedded-make-info) Set calc-embedded-firsttime-buf and
290 calc-embedded-firsttime-formula appropriately.
291 Set calc-embedded delimiter variables according to mode.
292
2932005-07-08 Richard M. Stallman <rms@gnu.org>
294
295 * emacs-lisp/checkdoc.el (checkdoc-proper-noun-list):
296 Check for "emacs", etc., as entire symbol, not just as word.
297 (checkdoc-file-comments-engine): Use regexp-quote on FN.
298
299 * files.el (set-visited-file-name): Report the error
300 for "empty filename" earlier.
301 (kill-some-buffers): Ignore buffers already dead.
302
303 * fringe.el (fringe-mode): Doc fix.
304
305 * emacs-lisp/bytecomp.el (byte-compile-maybe-guarded):
306 Check for (featurep 'xemacs) and turn off warnings in what it guards.
307 Use unwind-protect to ensure byte-compile-unresolved-functions
308 is updated.
309
310 * whitespace.el (whitespace-buffer-leading-cleanup):
311 Simplify w/ skip-chars-forward.
312 (whitespace-buffer-trailing-cleanup): Simplify w/ skip-chars-backward.
313
314 * mail/rmail.el (rmail-only-expunge): Fix paren error.
315 Unconditionally try to leave point at the same old place.
316
3172005-07-08 Ralf Angeli <angeli@iwi.uni-sb.de> (tiny change)
318
319 * comint.el (comint-postoutput-scroll-to-bottom)
320 (comint-show-maximum-output): Take scroll-margin into consideration.
321
3222005-07-08 Kim F. Storm <storm@cua.dk>
323
324 * ido.el (ido-use-filename-at-point): New choice `guess'.
325 (ido-file-internal): Try ffap-guesser if selected.
326
327 * ido.el (ido-before-fallback-functions): New hook.
328 (ido-buffer-internal, ido-file-internal, ido-read-buffer)
329 (ido-read-file-name): Run it.
330
3312005-07-07 Stefan Monnier <monnier@iro.umontreal.ca>
332
333 * progmodes/hideif.el (hide-ifdef-use-define-alist): Pass a list of
334 strings rather than a list of symbols to the completion function.
335
3362005-07-07 Jay Belanger <belanger@truman.edu>
337
338 * calc/calc-units.el (math-apply-units): Change the places in
339 which units are simplified.
340
3412005-07-07 Luc Teirlinck <teirllm@auburn.edu>
342
343 * cus-edit.el (customize-option, customize-option-other-window):
344 Make them handle aliases.
345
346 * custom.el (custom-variable-p): Make it recursively follow
347 aliases. Mention that in the docstring.
348
3492005-07-07 Richard M. Stallman <rms@gnu.org>
350
351 * cus-start.el (exec-path): Use `directory' instead of `file'.
352 Fix tag for nil.
353
3542005-07-07 Juanma Barranquero <lekktu@gmail.com>
355
356 * replace.el (occur-rename-buffer): Use `generate-new-buffer' also
357 when called non-interactively. Doc fix.
358
3592005-07-07 Lute Kamstra <lute@gnu.org>
360
361 * elide-head.el (elide-head-headers-to-hide): Recognize the FSF's
362 new address as well.
363
12005-07-07 Nick Roberts <nickrob@snap.net.nz> 3642005-07-07 Nick Roberts <nickrob@snap.net.nz>
2 365
3 * progmodes/gud.el: Require font-lock for displaying errors. 366 * progmodes/gud.el: Require font-lock for displaying errors.
diff --git a/lisp/allout.el b/lisp/allout.el
index 518e37083e0..eb8df2dae5c 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -868,7 +868,7 @@ allout-pre- and -post-command-hooks.")
868(make-variable-buffer-local 'allout-pre-was-isearching) 868(make-variable-buffer-local 'allout-pre-was-isearching)
869;;;_ = allout-isearch-prior-pos nil 869;;;_ = allout-isearch-prior-pos nil
870(defvar allout-isearch-prior-pos nil 870(defvar allout-isearch-prior-pos nil
871 "Cue for isearch-dynamic-exposure tracking, used by allout-isearch-expose.") 871 "Cue for isearch-dynamic-exposure tracking, used by `allout-isearch-expose'.")
872(make-variable-buffer-local 'allout-isearch-prior-pos) 872(make-variable-buffer-local 'allout-isearch-prior-pos)
873;;;_ = allout-isearch-did-quit 873;;;_ = allout-isearch-did-quit
874(defvar allout-isearch-did-quit nil 874(defvar allout-isearch-did-quit nil
@@ -887,16 +887,16 @@ native outline functions to temporarily override that protection.
887It's automatically reset to nil after every buffer modification.") 887It's automatically reset to nil after every buffer modification.")
888(make-variable-buffer-local 'allout-override-protect) 888(make-variable-buffer-local 'allout-override-protect)
889;;;_ > allout-unprotected (expr) 889;;;_ > allout-unprotected (expr)
890(defmacro allout-unprotected (expr) 890(defmacro allout-unprotected (expression)
891 "Evaluate EXPRESSION with `allout-override-protect' let-bound t." 891 "Evaluate EXPRESSION with `allout-override-protect' let-bound to t."
892 `(let ((allout-override-protect t)) 892 `(let ((allout-override-protect t))
893 ,expr)) 893 ,expression))
894;;;_ = allout-undo-aggregation 894;;;_ = allout-undo-aggregation
895(defvar allout-undo-aggregation 30 895(defvar allout-undo-aggregation 30
896 "Amount of successive self-insert actions to bunch together per undo. 896 "Amount of successive self-insert actions to bunch together per undo.
897 897
898This is purely a kludge variable, regulating the compensation for a bug in 898This is purely a kludge variable, regulating the compensation for a bug in
899the way that before-change-functions and undo interact.") 899the way that `before-change-functions' and undo interact.")
900(make-variable-buffer-local 'allout-undo-aggregation) 900(make-variable-buffer-local 'allout-undo-aggregation)
901;;;_ = file-var-bug hack 901;;;_ = file-var-bug hack
902(defvar allout-v18/19-file-var-hack nil 902(defvar allout-v18/19-file-var-hack nil
@@ -1407,12 +1407,12 @@ OPEN: A topic that is not closed, though its offspring or body may be."
1407 "Buffer point last returned by `allout-end-of-current-subtree'.") 1407 "Buffer point last returned by `allout-end-of-current-subtree'.")
1408(make-variable-buffer-local 'allout-recent-end-of-subtree) 1408(make-variable-buffer-local 'allout-recent-end-of-subtree)
1409;;;_ > allout-prefix-data (beg end) 1409;;;_ > allout-prefix-data (beg end)
1410(defmacro allout-prefix-data (beg end) 1410(defmacro allout-prefix-data (beginning end)
1411 "Register allout-prefix state data - BEGINNING and END of prefix. 1411 "Register allout-prefix state data - BEGINNING and END of prefix.
1412 1412
1413For reference by `allout-recent' funcs. Returns BEGINNING." 1413For reference by `allout-recent' funcs. Returns BEGINNING."
1414 `(setq allout-recent-prefix-end ,end 1414 `(setq allout-recent-prefix-end ,end
1415 allout-recent-prefix-beginning ,beg)) 1415 allout-recent-prefix-beginning ,beginning))
1416;;;_ > allout-recent-depth () 1416;;;_ > allout-recent-depth ()
1417(defmacro allout-recent-depth () 1417(defmacro allout-recent-depth ()
1418 "Return depth of last heading encountered by an outline maneuvering function. 1418 "Return depth of last heading encountered by an outline maneuvering function.
@@ -1632,7 +1632,7 @@ list containing, recursively, the charts for the respective subtopics.
1632The chart for a topics' offspring precedes the entry for the topic 1632The chart for a topics' offspring precedes the entry for the topic
1633itself. 1633itself.
1634 1634
1635\(fn &optional levels)" 1635\(fn &optional LEVELS)"
1636 1636
1637 ;; The other function parameters are for internal recursion, and should 1637 ;; The other function parameters are for internal recursion, and should
1638 ;; not be specified by external callers. ORIG-DEPTH is depth of topic at 1638 ;; not be specified by external callers. ORIG-DEPTH is depth of topic at
@@ -1999,7 +1999,7 @@ Return depth if successful, nil otherwise."
1999 ) 1999 )
2000;;;_ > allout-snug-back () 2000;;;_ > allout-snug-back ()
2001(defun allout-snug-back () 2001(defun allout-snug-back ()
2002 "Position cursor at end of previous topic 2002 "Position cursor at end of previous topic.
2003 2003
2004Presumes point is at the start of a topic prefix." 2004Presumes point is at the start of a topic prefix."
2005 (if (or (bobp) (eobp)) 2005 (if (or (bobp) (eobp))
@@ -2249,8 +2249,8 @@ are mapped to the command of the corresponding control-key on the
2249- Implement (and clear) `allout-post-goto-bullet', for hot-spot 2249- Implement (and clear) `allout-post-goto-bullet', for hot-spot
2250 outline commands. 2250 outline commands.
2251 2251
2252- Massages buffer-undo-list so successive, standard character self-inserts are 2252- Massages `buffer-undo-list' so successive, standard character self-inserts
2253 aggregated. This kludge compensates for lack of undo bunching when 2253 are aggregated. This kludge compensates for lack of undo bunching when
2254 `before-change-functions' is used." 2254 `before-change-functions' is used."
2255 2255
2256 ; Apply any external change func: 2256 ; Apply any external change func:
@@ -2379,7 +2379,7 @@ Called as part of `allout-post-command-business'."
2379 2379
2380;;;_ > allout-flag-region (from to flag) 2380;;;_ > allout-flag-region (from to flag)
2381(defmacro allout-flag-region (from to flag) 2381(defmacro allout-flag-region (from to flag)
2382 "Hide or show lines from FROM to TO, via Emacs selective-display FLAG char. 2382 "Hide or show lines from FROM to TO, via Emacs `selective-display' FLAG char.
2383Ie, text following flag C-m \(carriage-return) is hidden until the 2383Ie, text following flag C-m \(carriage-return) is hidden until the
2384next C-j (newline) char. 2384next C-j (newline) char.
2385 2385
@@ -2421,7 +2421,7 @@ Returns the endpoint of the region."
2421 (setq allout-isearch-did-quit nil)) 2421 (setq allout-isearch-did-quit nil))
2422;;;_ > allout-enwrap-isearch () 2422;;;_ > allout-enwrap-isearch ()
2423(defun allout-enwrap-isearch () 2423(defun allout-enwrap-isearch ()
2424 "Impose `allout-mode' isearch-abort wrapper for dynamic exposure in isearch. 2424 "Impose `isearch-abort' wrapper for dynamic exposure in isearch.
2425 2425
2426The function checks to ensure that the rebinding is done only once." 2426The function checks to ensure that the rebinding is done only once."
2427 2427
@@ -2469,7 +2469,7 @@ actual quits."
2469 font-lock-mode nil))) 2469 font-lock-mode nil)))
2470(add-hook 'isearch-mode-hook 'isearch-inhibit-font-lock) 2470(add-hook 'isearch-mode-hook 'isearch-inhibit-font-lock)
2471(defun isearch-reenable-font-lock () 2471(defun isearch-reenable-font-lock ()
2472 "Reenable font-lock after isearching - for use on isearch-mode-end-hook." 2472 "Reenable font-lock after isearching - for use on `isearch-mode-end-hook'."
2473 (if (and (boundp 'font-lock-mode) font-lock-mode) 2473 (if (and (boundp 'font-lock-mode) font-lock-mode)
2474 (if (and (allout-mode-p) isearch-was-font-locking) 2474 (if (and (allout-mode-p) isearch-was-font-locking)
2475 (setq isearch-was-font-locking nil 2475 (setq isearch-was-font-locking nil
@@ -2671,15 +2671,15 @@ index for each successive sibling)."
2671 ((allout-sibling-index)))))) 2671 ((allout-sibling-index))))))
2672 ) 2672 )
2673 ) 2673 )
2674;;;_ > allout-open-topic (relative-depth &optional before use_sib_bullet) 2674;;;_ > allout-open-topic (relative-depth &optional before use-sib-bullet)
2675(defun allout-open-topic (relative-depth &optional before use_sib_bullet) 2675(defun allout-open-topic (relative-depth &optional before use-sib-bullet)
2676 "Open a new topic at depth RELATIVE-DEPTH. 2676 "Open a new topic at depth RELATIVE-DEPTH.
2677 2677
2678New topic is situated after current one, unless optional flag BEFORE 2678New topic is situated after current one, unless optional flag BEFORE
2679is non-nil, or unless current line is complete empty (not even 2679is non-nil, or unless current line is complete empty (not even
2680whitespace), in which case open is done on current line. 2680whitespace), in which case open is done on current line.
2681 2681
2682If USE_SIB_BULLET is true, use the bullet of the prior sibling. 2682If USE-SIB-BULLET is true, use the bullet of the prior sibling.
2683 2683
2684Nuances: 2684Nuances:
2685 2685
@@ -2821,7 +2821,7 @@ Nuances:
2821 ;;(if doing-beginning (save-excursion (newline (if dbl-space 2 1)))) 2821 ;;(if doing-beginning (save-excursion (newline (if dbl-space 2 1))))
2822 2822
2823 2823
2824 (allout-rebullet-heading (and use_sib_bullet ref-bullet);;; solicit 2824 (allout-rebullet-heading (and use-sib-bullet ref-bullet);;; solicit
2825 depth ;;; depth 2825 depth ;;; depth
2826 nil ;;; number-control 2826 nil ;;; number-control
2827 nil ;;; index 2827 nil ;;; index
@@ -3439,8 +3439,8 @@ exactly like normal yanks.
3439Numbering of yanked topics, and the successive siblings at the depth 3439Numbering of yanked topics, and the successive siblings at the depth
3440into which they're being yanked, is adjusted. 3440into which they're being yanked, is adjusted.
3441 3441
3442`allout-yank-pop' works with `allout-yank' just like normal yank-pop 3442`allout-yank-pop' works with `allout-yank' just like normal `yank-pop'
3443works with normal yank in non-outline buffers." 3443works with normal `yank' in non-outline buffers."
3444 3444
3445 (interactive "*P") 3445 (interactive "*P")
3446 (setq this-command 'yank) 3446 (setq this-command 'yank)
@@ -4365,9 +4365,9 @@ used verbatim."
4365;;;_ - LaTeX formatting 4365;;;_ - LaTeX formatting
4366;;;_ > allout-latex-verb-quote (string &optional flow) 4366;;;_ > allout-latex-verb-quote (string &optional flow)
4367(defun allout-latex-verb-quote (string &optional flow) 4367(defun allout-latex-verb-quote (string &optional flow)
4368 "Return copy of STRING for literal reproduction across latex processing. 4368 "Return copy of STRING for literal reproduction across LaTeX processing.
4369Expresses the original characters \(including carriage returns) of the 4369Expresses the original characters \(including carriage returns) of the
4370string across latex processing." 4370string across LaTeX processing."
4371 (mapconcat (function 4371 (mapconcat (function
4372 (lambda (char) 4372 (lambda (char)
4373 (cond ((memq char '(?\\ ?$ ?% ?# ?& ?{ ?} ?_ ?^ ?- ?*)) 4373 (cond ((memq char '(?\\ ?$ ?% ?# ?& ?{ ?} ?_ ?^ ?- ?*))
@@ -4378,10 +4378,10 @@ string across latex processing."
4378 "")) 4378 ""))
4379;;;_ > allout-latex-verbatim-quote-curr-line () 4379;;;_ > allout-latex-verbatim-quote-curr-line ()
4380(defun allout-latex-verbatim-quote-curr-line () 4380(defun allout-latex-verbatim-quote-curr-line ()
4381 "Express line for exact \(literal) representation across latex processing. 4381 "Express line for exact \(literal) representation across LaTeX processing.
4382 4382
4383Adjust line contents so it is unaltered \(from the original line) 4383Adjust line contents so it is unaltered \(from the original line)
4384across latex processing, within the context of a `verbatim' 4384across LaTeX processing, within the context of a `verbatim'
4385environment. Leaves point at the end of the line." 4385environment. Leaves point at the end of the line."
4386 (beginning-of-line) 4386 (beginning-of-line)
4387 (let ((beg (point)) 4387 (let ((beg (point))
@@ -4397,7 +4397,7 @@ environment. Leaves point at the end of the line."
4397 (goto-char (1+ (match-end 0)))))) 4397 (goto-char (1+ (match-end 0))))))
4398;;;_ > allout-insert-latex-header (buffer) 4398;;;_ > allout-insert-latex-header (buffer)
4399(defun allout-insert-latex-header (buffer) 4399(defun allout-insert-latex-header (buffer)
4400 "Insert initial latex commands at point in BUFFER." 4400 "Insert initial LaTeX commands at point in BUFFER."
4401 ;; Much of this is being derived from the stuff in appendix of E in 4401 ;; Much of this is being derived from the stuff in appendix of E in
4402 ;; the TeXBook, pg 421. 4402 ;; the TeXBook, pg 421.
4403 (set-buffer buffer) 4403 (set-buffer buffer)
@@ -4471,7 +4471,7 @@ environment. Leaves point at the end of the line."
4471 ))) 4471 )))
4472;;;_ > allout-insert-latex-trailer (buffer) 4472;;;_ > allout-insert-latex-trailer (buffer)
4473(defun allout-insert-latex-trailer (buffer) 4473(defun allout-insert-latex-trailer (buffer)
4474 "Insert concluding latex commands at point in BUFFER." 4474 "Insert concluding LaTeX commands at point in BUFFER."
4475 (set-buffer buffer) 4475 (set-buffer buffer)
4476 (insert "\n\\end{document}\n")) 4476 (insert "\n\\end{document}\n"))
4477;;;_ > allout-latexify-one-item (depth prefix bullet text) 4477;;;_ > allout-latexify-one-item (depth prefix bullet text)
@@ -4526,7 +4526,7 @@ BULLET string, and a list of TEXT strings for the body."
4526 ))) 4526 )))
4527;;;_ > allout-latexify-exposed (arg &optional tobuf) 4527;;;_ > allout-latexify-exposed (arg &optional tobuf)
4528(defun allout-latexify-exposed (arg &optional tobuf) 4528(defun allout-latexify-exposed (arg &optional tobuf)
4529 "Format current topics exposed portions to TOBUF for latex processing. 4529 "Format current topics exposed portions to TOBUF for LaTeX processing.
4530TOBUF defaults to a buffer named the same as the current buffer, but 4530TOBUF defaults to a buffer named the same as the current buffer, but
4531with \"*\" prepended and \" latex-formed*\" appended. 4531with \"*\" prepended and \" latex-formed*\" appended.
4532 4532
@@ -4640,7 +4640,8 @@ Optional arg DO-DEFAULTING indicates to accept empty input (CR)."
4640Representations of actual backslashes - '\\\\\\\\' - are left as a 4640Representations of actual backslashes - '\\\\\\\\' - are left as a
4641single backslash. 4641single backslash.
4642 4642
4643Optional arg SUCCESSIVE-BACKSLASHES is used internally for recursion." 4643\(fn REGEXP)"
4644;; Optional arg SUCCESSIVE-BACKSLASHES is used internally for recursion.
4644 4645
4645 (if (string= regexp "") 4646 (if (string= regexp "")
4646 "" 4647 ""
@@ -4683,7 +4684,7 @@ function. If HOOK is void, it is first set to nil."
4683 (cons function (symbol-value hook))))))) 4684 (cons function (symbol-value hook)))))))
4684;;;_ : my-mark-marker to accommodate divergent emacsen: 4685;;;_ : my-mark-marker to accommodate divergent emacsen:
4685(defun my-mark-marker (&optional force buffer) 4686(defun my-mark-marker (&optional force buffer)
4686 "Accommodate the different signature for mark-marker across Emacsen. 4687 "Accommodate the different signature for `mark-marker' across Emacsen.
4687 4688
4688XEmacs takes two optional args, while GNU Emacs does not, 4689XEmacs takes two optional args, while GNU Emacs does not,
4689so pass them along when appropriate." 4690so pass them along when appropriate."
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el
index c6e0e33e559..0a7696c9311 100644
--- a/lisp/calc/calc-embed.el
+++ b/lisp/calc/calc-embed.el
@@ -200,6 +200,11 @@
200(defvar calc-embed-arg) 200(defvar calc-embed-arg)
201 201
202(defvar calc-embedded-quiet nil) 202(defvar calc-embedded-quiet nil)
203
204(defvar calc-embedded-firsttime)
205(defvar calc-embedded-firsttime-buf)
206(defvar calc-embedded-firsttime-formula)
207
203(defun calc-do-embedded (calc-embed-arg end obeg oend) 208(defun calc-do-embedded (calc-embed-arg end obeg oend)
204 (if calc-embedded-info 209 (if calc-embedded-info
205 210
@@ -251,6 +256,9 @@
251 (let ((modes (list mode-line-buffer-identification 256 (let ((modes (list mode-line-buffer-identification
252 (current-local-map) 257 (current-local-map)
253 truncate-lines)) 258 truncate-lines))
259 (calc-embedded-firsttime (not calc-embedded-active))
260 (calc-embedded-firsttime-buf nil)
261 (calc-embedded-firsttime-formula nil)
254 calc-embed-top calc-embed-bot calc-embed-outer-top calc-embed-outer-bot 262 calc-embed-top calc-embed-bot calc-embed-outer-top calc-embed-outer-bot
255 info chg ident) 263 info chg ident)
256 (barf-if-buffer-read-only) 264 (barf-if-buffer-read-only)
@@ -297,6 +305,12 @@
297 (unless (equal str mode-line-buffer-identification) 305 (unless (equal str mode-line-buffer-identification)
298 (setq mode-line-buffer-identification str) 306 (setq mode-line-buffer-identification str)
299 (set-buffer-modified-p (buffer-modified-p)))) 307 (set-buffer-modified-p (buffer-modified-p))))
308 (if calc-embedded-firsttime
309 (run-hooks 'calc-embedded-mode-hook))
310 (if calc-embedded-firsttime-buf
311 (run-hooks 'calc-embedded-new-buffer-hook))
312 (if calc-embedded-firsttime-formula
313 (run-hooks 'calc-embedded-new-formula-hook))
300 (or (eq calc-embedded-quiet t) 314 (or (eq calc-embedded-quiet t)
301 (message "Embedded Calc mode enabled; %s to return to normal" 315 (message "Embedded Calc mode enabled; %s to return to normal"
302 (if calc-embedded-quiet 316 (if calc-embedded-quiet
@@ -792,14 +806,52 @@ The command \\[yank] can retrieve it from there."
792 (new-info nil) 806 (new-info nil)
793 info str) 807 info str)
794 (or found 808 (or found
795 (setq found (list (current-buffer)) 809 (and
796 calc-embedded-active (cons found calc-embedded-active))) 810 (setq found (list (current-buffer))
811 calc-embedded-active (cons found calc-embedded-active)
812 calc-embedded-firsttime-buf t)
813 (let ((newann (assoc major-mode calc-embedded-announce-formula-alist))
814 (newform (assoc major-mode calc-embedded-open-close-formula-alist))
815 (newword (assoc major-mode calc-embedded-open-close-word-alist))
816 (newplain (assoc major-mode calc-embedded-open-close-plain-alist))
817 (newnewform
818 (assoc major-mode calc-embedded-open-close-new-formula-alist))
819 (newmode (assoc major-mode calc-embedded-open-close-mode-alist)))
820 (when newann
821 (make-local-variable 'calc-embedded-announce-formula)
822 (setq calc-embedded-announce-formula (cdr newann)))
823 (when newform
824 (make-local-variable 'calc-embedded-open-formula)
825 (make-local-variable 'calc-embedded-close-formula)
826 (setq calc-embedded-open-formula (nth 0 (cdr newform)))
827 (setq calc-embedded-close-formula (nth 1 (cdr newform))))
828 (when newword
829 (make-local-variable 'calc-embedded-open-word)
830 (make-local-variable 'calc-embedded-close-word)
831 (setq calc-embedded-open-word (nth 0 (cdr newword)))
832 (setq calc-embedded-close-word (nth 1 (cdr newword))))
833 (when newplain
834 (make-local-variable 'calc-embedded-open-plain)
835 (make-local-variable 'calc-embedded-close-plain)
836 (setq calc-embedded-open-plain (nth 0 (cdr newplain)))
837 (setq calc-embedded-close-plain (nth 1 (cdr newplain))))
838 (when newnewform
839 (make-local-variable 'calc-embedded-open-new-formula)
840 (make-local-variable 'calc-embedded-close-new-formula)
841 (setq calc-embedded-open-new-formula (nth 0 (cdr newnewform)))
842 (setq calc-embedded-close-new-formula (nth 1 (cdr newnewform))))
843 (when newmode
844 (make-local-variable 'calc-embedded-open-mode)
845 (make-local-variable 'calc-embedded-close-mode)
846 (setq calc-embedded-open-mode (nth 0 (cdr newmode)))
847 (setq calc-embedded-close-mode (nth 1 (cdr newmode)))))))
797 (while (and (cdr found) 848 (while (and (cdr found)
798 (> point (aref (car (cdr found)) 3))) 849 (> point (aref (car (cdr found)) 3)))
799 (setq found (cdr found))) 850 (setq found (cdr found)))
800 (if (and (cdr found) 851 (if (and (cdr found)
801 (>= point (aref (nth 1 found) 2))) 852 (>= point (aref (nth 1 found) 2)))
802 (setq info (nth 1 found)) 853 (setq info (nth 1 found))
854 (setq calc-embedded-firsttime-formula t)
803 (setq info (make-vector 16 nil) 855 (setq info (make-vector 16 nil)
804 new-info t 856 new-info t
805 fresh t) 857 fresh t)
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index 0983b807fde..3857d930902 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -810,10 +810,10 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).")
810 (mapcar 'math-to-standard-rec (cdr expr)))))) 810 (mapcar 'math-to-standard-rec (cdr expr))))))
811 811
812(defun math-apply-units (expr units ulist &optional pure) 812(defun math-apply-units (expr units ulist &optional pure)
813 (setq expr (math-simplify-units expr))
813 (if ulist 814 (if ulist
814 (let ((new 0) 815 (let ((new 0)
815 value) 816 value)
816 (setq expr (math-simplify-units expr))
817 (or (math-numberp expr) 817 (or (math-numberp expr)
818 (error "Incompatible units")) 818 (error "Incompatible units"))
819 (while (cdr ulist) 819 (while (cdr ulist)
@@ -826,9 +826,9 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).")
826 ulist (cdr ulist))) 826 ulist (cdr ulist)))
827 (math-add new (math-mul (math-div expr (nth 1 (car ulist))) 827 (math-add new (math-mul (math-div expr (nth 1 (car ulist)))
828 (car (car ulist))))) 828 (car (car ulist)))))
829 (math-simplify-units (if pure 829 (if pure
830 expr 830 expr
831 (list '* expr units))))) 831 (math-simplify-units (list '* expr units)))))
832 832
833(defvar math-decompose-units-cache nil) 833(defvar math-decompose-units-cache nil)
834(defun math-decompose-units (units) 834(defun math-decompose-units (units)
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 7317c2a7b9a..1dc4e94adb2 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -241,6 +241,23 @@
241 :group 'calc 241 :group 'calc
242 :type '(regexp)) 242 :type '(regexp))
243 243
244(defcustom calc-embedded-announce-formula-alist
245 '((c++-mode . "//Embed\n\\(// .*\n\\)*")
246 (c-mode . "/\\*Embed\\*/\n\\(/\\* .*\\*/\n\\)*")
247 (f90-mode . "!Embed\n\\(! .*\n\\)*")
248 (fortran-mode . "C Embed\n\\(C .*\n\\)*")
249 (html-helper-mode . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
250 (html-mode . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
251 (nroff-mode . "\\\\\"Embed\n\\(\\\\\" .*\n\\)*")
252 (pascal-mode . "{Embed}\n\\({.*}\n\\)*")
253 (sgml-mode . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
254 (xml-mode . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
255 (texinfo-mode . "@c Embed\n\\(@c .*\n\\)*"))
256 "*Alist of major modes with appropriate values for `calc-embedded-announce-formula'."
257 :group 'calc
258 :type '(alist :key-type (symbol :tag "Major mode")
259 :value-type (regexp :tag "Regexp to announce formula")))
260
244(defcustom calc-embedded-open-formula 261(defcustom calc-embedded-open-formula
245 "\\`\\|^\n\\|\\$\\$?\\|\\\\\\[\\|^\\\\begin[^{].*\n\\|^\\\\begin{.*[^x]}.*\n\\|^@.*\n\\|^\\.EQ.*\n\\|\\\\(\\|^%\n\\|^\\.\\\\\"\n" 262 "\\`\\|^\n\\|\\$\\$?\\|\\\\\\[\\|^\\\\begin[^{].*\n\\|^\\\\begin{.*[^x]}.*\n\\|^@.*\n\\|^\\.EQ.*\n\\|\\\\(\\|^%\n\\|^\\.\\\\\"\n"
246 "*A regular expression for the opening delimiter of a formula used by calc-embedded." 263 "*A regular expression for the opening delimiter of a formula used by calc-embedded."
@@ -253,6 +270,14 @@
253 :group 'calc 270 :group 'calc
254 :type '(regexp)) 271 :type '(regexp))
255 272
273(defcustom calc-embedded-open-close-formula-alist
274 nil
275 "*Alist of major modes with pairs of formula delimiters used by calc-embedded."
276 :group 'calc
277 :type '(alist :key-type (symbol :tag "Major mode")
278 :value-type (list (regexp :tag "Opening formula delimiter")
279 (regexp :tag "Closing formula delimiter"))))
280
256(defcustom calc-embedded-open-word 281(defcustom calc-embedded-open-word
257 "^\\|[^-+0-9.eE]" 282 "^\\|[^-+0-9.eE]"
258 "*A regular expression for the opening delimiter of a formula used by calc-embedded-word." 283 "*A regular expression for the opening delimiter of a formula used by calc-embedded-word."
@@ -265,6 +290,14 @@
265 :group 'calc 290 :group 'calc
266 :type '(regexp)) 291 :type '(regexp))
267 292
293(defcustom calc-embedded-open-close-word-alist
294 nil
295 "*Alist of major modes with pairs of word delimiters used by calc-embedded."
296 :group 'calc
297 :type '(alist :key-type (symbol :tag "Major mode")
298 :value-type (list (regexp :tag "Opening word delimiter")
299 (regexp :tag "Closing word delimiter"))))
300
268(defcustom calc-embedded-open-plain 301(defcustom calc-embedded-open-plain
269 "%%% " 302 "%%% "
270 "*A string which is the opening delimiter for a \"plain\" formula. 303 "*A string which is the opening delimiter for a \"plain\" formula.
@@ -280,6 +313,24 @@ See calc-embedded-open-plain."
280 :group 'calc 313 :group 'calc
281 :type '(string)) 314 :type '(string))
282 315
316(defcustom calc-embedded-open-close-plain-alist
317 '((c++-mode "// %% " " %%\n")
318 (c-mode "/* %% " " %% */\n")
319 (f90-mode "! %% " " %%\n")
320 (fortran-mode "C %% " " %%\n")
321 (html-helper-mode "<!-- %% " " %% -->\n")
322 (html-mode "<!-- %% " " %% -->\n")
323 (nroff-mode "\\\" %% " " %%\n")
324 (pascal-mode "{%% " " %%}\n")
325 (sgml-mode "<!-- %% " " %% -->\n")
326 (xml-mode "<!-- %% " " %% -->\n")
327 (texinfo-mode "@c %% " " %%\n"))
328 "*Alist of major modes with pairs of delimiters for \"plain\" formulas."
329 :group 'calc
330 :type '(alist :key-type (symbol :tag "Major mode")
331 :value-type (list (string :tag "Opening \"plain\" delimiter")
332 (string :tag "Closing \"plain\" delimiter"))))
333
283(defcustom calc-embedded-open-new-formula 334(defcustom calc-embedded-open-new-formula
284 "\n\n" 335 "\n\n"
285 "*A string which is inserted at front of formula by calc-embedded-new-formula." 336 "*A string which is inserted at front of formula by calc-embedded-new-formula."
@@ -292,6 +343,14 @@ See calc-embedded-open-plain."
292 :group 'calc 343 :group 'calc
293 :type '(string)) 344 :type '(string))
294 345
346(defcustom calc-embedded-open-close-new-formula-alist
347 nil
348 "*Alist of major modes with pairs of new formula delimiters used by calc-embedded."
349 :group 'calc
350 :type '(alist :key-type (symbol :tag "Major mode")
351 :value-type (list (string :tag "Opening new formula delimiter")
352 (string :tag "Closing new formula delimiter"))))
353
295(defcustom calc-embedded-open-mode 354(defcustom calc-embedded-open-mode
296 "% " 355 "% "
297 "*A string which should precede calc-embedded mode annotations. 356 "*A string which should precede calc-embedded mode annotations.
@@ -306,6 +365,24 @@ This is not required to be present for user-written mode annotations."
306 :group 'calc 365 :group 'calc
307 :type '(string)) 366 :type '(string))
308 367
368(defcustom calc-embedded-open-close-mode-alist
369 '((c++-mode "// " "\n")
370 (c-mode "/* " " */\n")
371 (f90-mode "! " "\n")
372 (fortran-mode "C " "\n")
373 (html-helper-mode "<!-- " " -->\n")
374 (html-mode "<!-- " " -->\n")
375 (nroff-mode "\\\" " "\n")
376 (pascal-mode "{ " " }\n")
377 (sgml-mode "<!-- " " -->\n")
378 (xml-mode "<!-- " " -->\n")
379 (texinfo-mode "@c " "\n"))
380 "*Alist of major modes with pairs of strings to delimit annotations."
381 :group 'calc
382 :type '(alist :key-type (symbol :tag "Major mode")
383 :value-type (list (string :tag "Opening annotation delimiter")
384 (string :tag "Closing annotation delimiter"))))
385
309(defcustom calc-gnuplot-name 386(defcustom calc-gnuplot-name
310 "gnuplot" 387 "gnuplot"
311 "*Name of GNUPLOT program, for calc-graph features." 388 "*Name of GNUPLOT program, for calc-graph features."
@@ -726,6 +803,15 @@ If nil, selections displayed but ignored.")
726(defvar calc-trail-window-hook nil 803(defvar calc-trail-window-hook nil
727 "Hook called to create the Calc trail window.") 804 "Hook called to create the Calc trail window.")
728 805
806(defvar calc-embedded-new-buffer-hook nil
807 "Hook run when starting embedded mode in a new buffer.")
808
809(defvar calc-embedded-new-formula-hook nil
810 "Hook run when starting embedded mode in a new formula.")
811
812(defvar calc-embedded-mode-hook nil
813 "Hook run when starting embedded mode.")
814
729;; Verify that Calc is running on the right kind of system. 815;; Verify that Calc is running on the right kind of system.
730(defvar calc-emacs-type-lucid (not (not (string-match "Lucid" emacs-version)))) 816(defvar calc-emacs-type-lucid (not (not (string-match "Lucid" emacs-version))))
731 817
diff --git a/lisp/comint.el b/lisp/comint.el
index 188af8a3b0b..99ea2c44436 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1818,7 +1818,7 @@ This function should be in the list `comint-output-filter-functions'."
1818 (= (point) (point-max))) 1818 (= (point) (point-max)))
1819 (save-excursion 1819 (save-excursion
1820 (goto-char (point-max)) 1820 (goto-char (point-max))
1821 (recenter -1))) 1821 (recenter (- -1 scroll-margin))))
1822 (select-window selected))))) 1822 (select-window selected)))))
1823 nil t)) 1823 nil t))
1824 (set-buffer current)))) 1824 (set-buffer current))))
@@ -1852,7 +1852,7 @@ This function could be on `comint-output-filter-functions' or bound to a key."
1852 "Put the end of the buffer at the bottom of the window." 1852 "Put the end of the buffer at the bottom of the window."
1853 (interactive) 1853 (interactive)
1854 (goto-char (point-max)) 1854 (goto-char (point-max))
1855 (recenter -1)) 1855 (recenter (- -1 scroll-margin)))
1856 1856
1857(defun comint-get-old-input-default () 1857(defun comint-get-old-input-default ()
1858 "Default for `comint-get-old-input'. 1858 "Default for `comint-get-old-input'.
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 76e8e5bf7ba..5c3ff9448c0 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -1021,9 +1021,12 @@ then prompt for the MODE to customize."
1021(defun customize-option (symbol) 1021(defun customize-option (symbol)
1022 "Customize SYMBOL, which must be a user option variable." 1022 "Customize SYMBOL, which must be a user option variable."
1023 (interactive (custom-variable-prompt)) 1023 (interactive (custom-variable-prompt))
1024 (custom-buffer-create (list (list symbol 'custom-variable)) 1024 (let ((basevar (indirect-variable symbol)))
1025 (format "*Customize Option: %s*" 1025 (custom-buffer-create (list (list basevar 'custom-variable))
1026 (custom-unlispify-tag-name symbol)))) 1026 (format "*Customize Option: %s*"
1027 (custom-unlispify-tag-name basevar)))
1028 (unless (eq symbol basevar)
1029 (message "`%s' is an alias for `%s'" symbol basevar))))
1027 1030
1028;;;###autoload 1031;;;###autoload
1029(defalias 'customize-variable-other-window 'customize-option-other-window) 1032(defalias 'customize-variable-other-window 'customize-option-other-window)
@@ -1033,9 +1036,12 @@ then prompt for the MODE to customize."
1033 "Customize SYMBOL, which must be a user option variable. 1036 "Customize SYMBOL, which must be a user option variable.
1034Show the buffer in another window, but don't select it." 1037Show the buffer in another window, but don't select it."
1035 (interactive (custom-variable-prompt)) 1038 (interactive (custom-variable-prompt))
1036 (custom-buffer-create-other-window 1039 (let ((basevar (indirect-variable symbol)))
1037 (list (list symbol 'custom-variable)) 1040 (custom-buffer-create-other-window
1038 (format "*Customize Option: %s*" (custom-unlispify-tag-name symbol)))) 1041 (list (list basevar 'custom-variable))
1042 (format "*Customize Option: %s*" (custom-unlispify-tag-name basevar)))
1043 (unless (eq symbol basevar)
1044 (message "`%s' is an alias for `%s'" symbol basevar))))
1039 1045
1040(defvar customize-changed-options-previous-release "20.2" 1046(defvar customize-changed-options-previous-release "20.2"
1041 "Version for `customize-changed-options' to refer back to by default.") 1047 "Version for `customize-changed-options' to refer back to by default.")
diff --git a/lisp/cus-face.el b/lisp/cus-face.el
index 6eaaf97288d..967045b9da4 100644
--- a/lisp/cus-face.el
+++ b/lisp/cus-face.el
@@ -345,53 +345,27 @@ FACE's list property `theme-face' \(using `custom-push-theme')."
345 (setq args (cdr (cdr args)))))))) 345 (setq args (cdr (cdr args))))))))
346 346
347;;;###autoload 347;;;###autoload
348(defun custom-theme-face-value (face theme)
349 "Return spec of FACE in THEME if THEME modifies FACE.
350Value is nil otherwise. The association between theme and spec for FACE
351is stored in FACE's property `theme-face'. The appropriate face
352is retrieved using `custom-theme-value'."
353 ;; Returns car because the value is stored inside a one element list
354 (car-safe (custom-theme-value theme (get face 'theme-face))))
355
356(defun custom-theme-reset-internal-face (face to-theme)
357 "Reset FACE to the value defined by TO-THEME.
358If FACE is not defined in TO-THEME, reset FACE to the standard
359value. See `custom-theme-face-value'. The standard value is
360stored in SYMBOL's property `face-defface-spec' by `defface'."
361 (let ((spec (custom-theme-face-value face to-theme))
362 was-in-theme)
363 (setq was-in-theme spec)
364 (setq spec (or spec (get face 'face-defface-spec)))
365 (when spec
366 (put face 'save-face was-in-theme)
367 (when (or (get face 'force-face) (facep face))
368 (unless (facep face)
369 (make-empty-face face))
370 (face-spec-set face spec)))
371 spec))
372
373;;;###autoload
374(defun custom-theme-reset-faces (theme &rest args) 348(defun custom-theme-reset-faces (theme &rest args)
375 "Reset the value of the face to values previously defined. 349 "Reset the specs in THEME of some faces to their specs in other themes.
376Associate this setting with THEME. 350Each of the arguments ARGS has this form:
377
378ARGS is a list of lists of the form
379 351
380 (FACE TO-THEME) 352 (FACE FROM-THEME)
381 353
382This means reset FACE to its value in TO-THEME." 354This means reset FACE to its value in FROM-THEME."
383 (custom-check-theme theme) 355 (custom-check-theme theme)
384 (mapcar '(lambda (arg) 356 (dolist (arg args)
385 (apply 'custom-theme-reset-internal-face arg) 357 (custom-push-theme 'theme-face (car arg) theme 'reset (cadr arg))))
386 (custom-push-theme 'theme-face (car arg) theme 'reset (cadr arg)))
387 args))
388 358
389;;;###autoload 359;;;###autoload
390(defun custom-reset-faces (&rest args) 360(defun custom-reset-faces (&rest args)
391 "Reset the value of the face to values previously saved. 361 "Reset the specs of some faces to their specs in specified themes.
392This is the setting assosiated the `user' theme. 362This creates settings in the `user' theme.
363
364Each of the arguments ARGS has this form:
365
366 (FACE FROM-THEME)
393 367
394ARGS is defined as for `custom-theme-reset-faces'" 368This means reset FACE to its value in FROM-THEME."
395 (apply 'custom-theme-reset-faces 'user args)) 369 (apply 'custom-theme-reset-faces 'user args))
396 370
397;;; The End. 371;;; The End.
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 16d9e2785a1..68f3ed5a672 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -77,8 +77,8 @@ since it could result in memory overflow and make Emacs crash."
77 ;; callproc.c 77 ;; callproc.c
78 (shell-file-name execute file) 78 (shell-file-name execute file)
79 (exec-path execute 79 (exec-path execute
80 (repeat (choice (const :tag "default" nil) 80 (repeat (choice (const :tag "default directory" nil)
81 (file :format "%v")))) 81 (directory :format "%v"))))
82 ;; charset.c 82 ;; charset.c
83 (charset-map-path installation 83 (charset-map-path installation
84 (repeat (directory :format "%v"))) 84 (repeat (directory :format "%v")))
diff --git a/lisp/custom.el b/lisp/custom.el
index a8c9b864537..9766c77a256 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -76,6 +76,28 @@ if any, or VALUE."
76 (eval (car (get symbol 'saved-value))) 76 (eval (car (get symbol 'saved-value)))
77 (eval value))))) 77 (eval value)))))
78 78
79(defun custom-initialize-safe-set (symbol value)
80 "Like `custom-initialize-set', but catches errors.
81If an error occurs during initialization, SYMBOL is set to nil
82and no error is thrown. This is meant for use in pre-loaded files
83where some variables or functions used to compute VALUE may not yet
84be defined. You can then re-evaluate VALUE in startup.el, for instance
85using `custom-reevaluate-setting'."
86 (condition-case nil
87 (custom-initialize-set symbol value)
88 (error (set-default symbol nil))))
89
90(defun custom-initialize-safe-default (symbol value)
91 "Like `custom-initialize-default', but catches errors.
92If an error occurs during initialization, SYMBOL is set to nil
93and no error is thrown. This is meant for use in pre-loaded files
94where some variables or functions used to compute VALUE may not yet
95be defined. You can then re-evaluate VALUE in startup.el, for instance
96using `custom-reevaluate-setting'."
97 (condition-case nil
98 (custom-initialize-default symbol value)
99 (error (set-default symbol nil))))
100
79(defun custom-initialize-reset (symbol value) 101(defun custom-initialize-reset (symbol value)
80 "Initialize SYMBOL based on VALUE. 102 "Initialize SYMBOL based on VALUE.
81Set the symbol, using its `:set' function (or `set-default' if it has none). 103Set the symbol, using its `:set' function (or `set-default' if it has none).
@@ -115,14 +137,9 @@ For the standard setting, use `set-default'."
115DEFAULT should be an expression to evaluate to compute the default value, 137DEFAULT should be an expression to evaluate to compute the default value,
116not the default value itself. 138not the default value itself.
117 139
118DEFAULT is stored as SYMBOL's value in the standard theme. See 140DEFAULT is stored as SYMBOL's standard value, in SYMBOL's property
119`custom-known-themes' for a list of known themes. For backwards
120compatibility, DEFAULT is also stored in SYMBOL's property
121`standard-value'. At the same time, SYMBOL's property `force-value' is 141`standard-value'. At the same time, SYMBOL's property `force-value' is
122set to nil, as the value is no longer rogue." 142set to nil, as the value is no longer rogue."
123 ;; Remember the standard setting. The value should be in the standard
124 ;; theme, not in this property. However, this would require changing
125 ;; the C source of defvar and others as well...
126 (put symbol 'standard-value (list default)) 143 (put symbol 'standard-value (list default))
127 ;; Maybe this option was rogue in an earlier version. It no longer is. 144 ;; Maybe this option was rogue in an earlier version. It no longer is.
128 (when (get symbol 'force-value) 145 (when (get symbol 'force-value)
@@ -518,7 +535,9 @@ LOAD should be either a library file name, or a feature name."
518 535
519;; This test is also in the C code of `user-variable-p'. 536;; This test is also in the C code of `user-variable-p'.
520(defun custom-variable-p (variable) 537(defun custom-variable-p (variable)
521 "Return non-nil if VARIABLE is a custom variable." 538 "Return non-nil if VARIABLE is a custom variable.
539This recursively follows aliases."
540 (setq variable (indirect-variable variable))
522 (or (get variable 'standard-value) 541 (or (get variable 'standard-value)
523 (get variable 'custom-autoload))) 542 (get variable 'custom-autoload)))
524 543
@@ -560,7 +579,7 @@ LOAD should be either a library file name, or a feature name."
560 ;; and it is not in load-history yet. 579 ;; and it is not in load-history yet.
561 ((equal load "cus-edit")) 580 ((equal load "cus-edit"))
562 (t (condition-case nil (load load) (error nil)))))))) 581 (t (condition-case nil (load load) (error nil))))))))
563 582
564(defvar custom-known-themes '(user standard) 583(defvar custom-known-themes '(user standard)
565 "Themes that have been defined with `deftheme'. 584 "Themes that have been defined with `deftheme'.
566The default value is the list (user standard). The theme `standard' 585The default value is the list (user standard). The theme `standard'
@@ -569,95 +588,6 @@ theme `user' contains all the the settings the user customized and saved.
569Additional themes declared with the `deftheme' macro will be added to 588Additional themes declared with the `deftheme' macro will be added to
570the front of this list.") 589the front of this list.")
571 590
572(defun custom-declare-theme (theme feature &optional doc &rest args)
573 "Like `deftheme', but THEME is evaluated as a normal argument.
574FEATURE is the feature this theme provides. This symbol is created
575from THEME by `custom-make-theme-feature'."
576 (add-to-list 'custom-known-themes theme)
577 (put theme 'theme-feature feature)
578 (when doc
579 (put theme 'theme-documentation doc))
580 (while args
581 (let ((arg (car args)))
582 (setq args (cdr args))
583 (unless (symbolp arg)
584 (error "Junk in args %S" args))
585 (let ((keyword arg)
586 (value (car args)))
587 (unless args
588 (error "Keyword %s is missing an argument" keyword))
589 (setq args (cdr args))
590 (cond ((eq keyword :short-description)
591 (put theme 'theme-short-description value))
592 ((eq keyword :immediate)
593 (put theme 'theme-immediate value))
594 ((eq keyword :variable-set-string)
595 (put theme 'theme-variable-set-string value))
596 ((eq keyword :variable-reset-string)
597 (put theme 'theme-variable-reset-string value))
598 ((eq keyword :face-set-string)
599 (put theme 'theme-face-set-string value))
600 ((eq keyword :face-reset-string)
601 (put theme 'theme-face-reset-string value)))))))
602
603(defmacro deftheme (theme &optional doc &rest args)
604 "Declare custom theme THEME.
605The optional argument DOC is a doc string describing the theme.
606The remaining arguments should have the form
607
608 [KEYWORD VALUE]...
609
610The following KEYWORD's are defined:
611
612:short-description
613 VALUE is a short (one line) description of the theme. If not
614 given, DOC is used.
615:immediate
616 If VALUE is non-nil, variables specified in this theme are set
617 immediately when loading the theme.
618:variable-set-string
619 VALUE is a string used to indicate that a variable takes its
620 setting from this theme. It is passed to FORMAT with the name
621 of the theme as an additional argument. If not given, a
622 generic description is used.
623:variable-reset-string
624 VALUE is a string used in the case a variable has been forced
625 to its value in this theme. It is passed to FORMAT with the
626 name of the theme as an additional argument. If not given, a
627 generic description is used.
628:face-set-string
629 VALUE is a string used to indicate that a face takes its
630 setting from this theme. It is passed to FORMAT with the name
631 of the theme as an additional argument. If not given, a
632 generic description is used.
633:face-reset-string
634 VALUE is a string used in the case a face has been forced to
635 its value in this theme. It is passed to FORMAT with the name
636 of the theme as an additional argument. If not given, a
637 generic description is used.
638
639Any theme `foo' should be defined in a file called `foo-theme.el';
640see `custom-make-theme-feature' for more information."
641 (let ((feature (custom-make-theme-feature theme)))
642 ;; It is better not to use backquote in this file,
643 ;; because that makes a bootstrapping problem
644 ;; if you need to recompile all the Lisp files using interpreted code.
645 (nconc (list 'custom-declare-theme
646 (list 'quote theme)
647 (list 'quote feature)
648 doc) args)))
649
650(defun custom-make-theme-feature (theme)
651 "Given a symbol THEME, create a new symbol by appending \"-theme\".
652Store this symbol in the `theme-feature' property of THEME.
653Calling `provide-theme' to provide THEME actually puts `THEME-theme'
654into `features'.
655
656This allows for a file-name convention for autoloading themes:
657Every theme X has a property `provide-theme' whose value is \"X-theme\".
658\(require-theme X) then attempts to load the file `X-theme.el'."
659 (intern (concat (symbol-name theme) "-theme")))
660
661(defsubst custom-theme-p (theme) 591(defsubst custom-theme-p (theme)
662 "Non-nil when THEME has been defined." 592 "Non-nil when THEME has been defined."
663 (memq theme custom-known-themes)) 593 (memq theme custom-known-themes))
@@ -670,13 +600,15 @@ Every theme X has a property `provide-theme' whose value is \"X-theme\".
670;;; Initializing. 600;;; Initializing.
671 601
672(defun custom-push-theme (prop symbol theme mode value) 602(defun custom-push-theme (prop symbol theme mode value)
673 "Add (THEME MODE VALUE) to the list in property PROP of SYMBOL. 603 "Record a value for face or variable SYMBOL in custom theme THEME.
674If the first element in that list is already (THEME ...), 604PROP is`theme-face' for a face, `theme-value' for a variable.
675discard it first. 605The value is specified by (THEME MODE VALUE), which is interpreted
606by `custom-theme-value'.
676 607
677MODE can be either the symbol `set' or the symbol `reset'. If it is the 608MODE can be either the symbol `set' or the symbol `reset'. If it is the
678symbol `set', then VALUE is the value to use. If it is the symbol 609symbol `set', then VALUE is the value to use. If it is the symbol
679`reset', then VALUE is the mode to query instead. 610`reset', then VALUE is another theme, whose value for this face or
611variable should be used.
680 612
681In the following example for the variable `goto-address-url-face', the 613In the following example for the variable `goto-address-url-face', the
682theme `subtle-hacker' uses the same value for the variable as the theme 614theme `subtle-hacker' uses the same value for the variable as the theme
@@ -709,11 +641,20 @@ This records values for the `standard' and the `gnome2' themes.
709The user has not customized the face; had he done that, 641The user has not customized the face; had he done that,
710the list would contain an entry for the `user' theme, too. 642the list would contain an entry for the `user' theme, too.
711See `custom-known-themes' for a list of known themes." 643See `custom-known-themes' for a list of known themes."
712 (let ((old (get symbol prop))) 644 (let* ((old (get symbol prop))
713 (if (eq (car-safe (car-safe old)) theme) 645 (setting (assq theme old)))
714 (setq old (cdr old))) 646 ;; Alter an existing theme-setting for the symbol,
715 (put symbol prop (cons (list theme mode value) old)))) 647 ;; or add a new one.
716 648 (if setting
649 (progn
650 (setcar (cdr setting) mode)
651 (setcar (cddr setting) value))
652 (put symbol prop (cons (list theme mode value) old)))
653 ;; Record, for each theme, all its settings.
654 (put theme 'theme-settings
655 (cons (list prop symbol theme mode value)
656 (get theme 'theme-settings)))))
657
717(defvar custom-local-buffer nil 658(defvar custom-local-buffer nil
718 "Non-nil, in a Customization buffer, means customize a specific buffer. 659 "Non-nil, in a Customization buffer, means customize a specific buffer.
719If this variable is non-nil, it should be a buffer, 660If this variable is non-nil, it should be a buffer,
@@ -739,10 +680,10 @@ COMMENT is a comment string about SYMBOL."
739 (apply 'custom-theme-set-variables 'user args)) 680 (apply 'custom-theme-set-variables 'user args))
740 681
741(defun custom-reevaluate-setting (symbol) 682(defun custom-reevaluate-setting (symbol)
742 "Reset the value of SYMBOL by re-evaluating its saved or default value. 683 "Reset the value of SYMBOL by re-evaluating its saved or standard value.
743This is useful for variables that are defined before their default value 684Use the :set function to do so. This is useful for customizable options
744can really be computed. E.g. dumped variables whose default depends on 685that are defined before their standard value can really be computed.
745run-time information." 686E.g. dumped variables whose default depends on run-time information."
746 (funcall (or (get symbol 'custom-set) 'set-default) 687 (funcall (or (get symbol 'custom-set) 'set-default)
747 symbol 688 symbol
748 (eval (car (or (get symbol 'saved-value) (get symbol 'standard-value)))))) 689 (eval (car (or (get symbol 'saved-value) (get symbol 'standard-value))))))
@@ -922,11 +863,134 @@ Return non-nil iff the `customized-value' property actually changed."
922 (put symbol 'customized-value nil)) 863 (put symbol 'customized-value nil))
923 ;; Changed? 864 ;; Changed?
924 (not (equal customized (get symbol 'customized-value))))) 865 (not (equal customized (get symbol 'customized-value)))))
866
867;;; Defining themes.
868
869;; deftheme is used at the beginning of the file that records a theme.
870
871(defmacro deftheme (theme &optional doc &rest args)
872 "Declare custom theme THEME.
873The optional argument DOC is a doc string describing the theme.
874The remaining arguments should have the form
925 875
926;;; Theme Manipulation 876 [KEYWORD VALUE]...
877
878The following KEYWORD's are defined:
879
880:short-description
881 VALUE is a short (one line) description of the theme. If not
882 given, DOC is used.
883:immediate
884 If VALUE is non-nil, variables specified in this theme are set
885 immediately when loading the theme.
886:variable-set-string
887 VALUE is a string used to indicate that a variable takes its
888 setting from this theme. It is passed to FORMAT with the name
889 of the theme as an additional argument. If not given, a
890 generic description is used.
891:variable-reset-string
892 VALUE is a string used in the case a variable has been forced
893 to its value in this theme. It is passed to FORMAT with the
894 name of the theme as an additional argument. If not given, a
895 generic description is used.
896:face-set-string
897 VALUE is a string used to indicate that a face takes its
898 setting from this theme. It is passed to FORMAT with the name
899 of the theme as an additional argument. If not given, a
900 generic description is used.
901:face-reset-string
902 VALUE is a string used in the case a face has been forced to
903 its value in this theme. It is passed to FORMAT with the name
904 of the theme as an additional argument. If not given, a
905 generic description is used.
906
907Any theme `foo' should be defined in a file called `foo-theme.el';
908see `custom-make-theme-feature' for more information."
909 (let ((feature (custom-make-theme-feature theme)))
910 ;; It is better not to use backquote in this file,
911 ;; because that makes a bootstrapping problem
912 ;; if you need to recompile all the Lisp files using interpreted code.
913 (nconc (list 'custom-declare-theme
914 (list 'quote theme)
915 (list 'quote feature)
916 doc)
917 args)))
918
919(defun custom-declare-theme (theme feature &optional doc &rest args)
920 "Like `deftheme', but THEME is evaluated as a normal argument.
921FEATURE is the feature this theme provides. This symbol is created
922from THEME by `custom-make-theme-feature'."
923 (add-to-list 'custom-known-themes theme)
924 (put theme 'theme-feature feature)
925 (when doc
926 (put theme 'theme-documentation doc))
927 (while args
928 (let ((arg (car args)))
929 (setq args (cdr args))
930 (unless (symbolp arg)
931 (error "Junk in args %S" args))
932 (let ((keyword arg)
933 (value (car args)))
934 (unless args
935 (error "Keyword %s is missing an argument" keyword))
936 (setq args (cdr args))
937 (cond ((eq keyword :short-description)
938 (put theme 'theme-short-description value))
939 ((eq keyword :immediate)
940 (put theme 'theme-immediate value))
941 ((eq keyword :variable-set-string)
942 (put theme 'theme-variable-set-string value))
943 ((eq keyword :variable-reset-string)
944 (put theme 'theme-variable-reset-string value))
945 ((eq keyword :face-set-string)
946 (put theme 'theme-face-set-string value))
947 ((eq keyword :face-reset-string)
948 (put theme 'theme-face-reset-string value)))))))
949
950(defun custom-make-theme-feature (theme)
951 "Given a symbol THEME, create a new symbol by appending \"-theme\".
952Store this symbol in the `theme-feature' property of THEME.
953Calling `provide-theme' to provide THEME actually puts `THEME-theme'
954into `features'.
955
956This allows for a file-name convention for autoloading themes:
957Every theme X has a property `provide-theme' whose value is \"X-theme\".
958\(require-theme X) then attempts to load the file `X-theme.el'."
959 (intern (concat (symbol-name theme) "-theme")))
960
961;;; Loading themes.
962
963;; The variable and face settings of a theme are recorded in
964;; the `theme-settings' property of the theme name.
965;; This property's value is a list of elements, each of the form
966;; (PROP SYMBOL THEME MODE VALUE), where PROP is `theme-value' or `theme-face'
967;; and SYMBOL is the face or variable name.
968;; THEME is the theme name itself; that's redundant, but simplifies things.
969;; MODE is `set' or `reset'.
970;; If MODE is `set', then VALUE is an expression that specifies the
971;; theme's setting for SYMBOL.
972;; If MODE is `reset', then VALUE is another theme,
973;; and it means to use the value from that theme.
974
975;; Each variable has a `theme-value' property that describes all the
976;; settings of enabled themes that apply to it.
977;; Each face name has a `theme-face' property that describes all the
978;; settings of enabled themes that apply to it.
979;; The property value is a list of settings, each with the form
980;; (THEME MODE VALUE). THEME, MODE and VALUE are as above.
981;; Each of these lists is ordered by decreasing theme precedence.
982;; Thus, the first element is always the one that is in effect.
983
984;; Disabling a theme removes its settings from the `theme-value' and
985;; `theme-face' properties, but the theme's own `theme-settings'
986;; property remains unchanged.
987
988;; Loading a theme implicitly enables it. Enabling a theme adds its
989;; settings to the symbols' `theme-value' and `theme-face' properties,
990;; or moves them to the front of those lists if they're already present.
927 991
928(defvar custom-loaded-themes nil 992(defvar custom-loaded-themes nil
929 "Themes in the order they are loaded.") 993 "Custom themes that have been loaded.")
930 994
931(defcustom custom-theme-directory 995(defcustom custom-theme-directory
932 (if (eq system-type 'ms-dos) 996 (if (eq system-type 'ms-dos)
@@ -942,26 +1006,43 @@ into this directory."
942 :version "22.1") 1006 :version "22.1")
943 1007
944(defun custom-theme-loaded-p (theme) 1008(defun custom-theme-loaded-p (theme)
945 "Return non-nil when THEME has been loaded." 1009 "Return non-nil if THEME has been loaded."
946 (memq theme custom-loaded-themes)) 1010 (memq theme custom-loaded-themes))
947 1011
1012(defvar custom-enabled-themes '(user)
1013 "Custom themes currently enabled, highest precedence first.
1014The first one is always `user'.")
1015
1016(defun custom-theme-enabled-p (theme)
1017 "Return non-nil if THEME is enabled."
1018 (memq theme custom-enabled-themes))
1019
948(defun provide-theme (theme) 1020(defun provide-theme (theme)
949 "Indicate that this file provides THEME. 1021 "Indicate that this file provides THEME.
950Add THEME to `custom-loaded-themes' and `provide' whatever 1022Add THEME to `custom-loaded-themes', and `provide' whatever
951is stored in THEME's property `theme-feature'. 1023feature name is stored in THEME's property `theme-feature'.
952 1024
953Usually the theme-feature property contains a symbol created 1025Usually the `theme-feature' property contains a symbol created
954by `custom-make-theme-feature'." 1026by `custom-make-theme-feature'."
955 (custom-check-theme theme) 1027 (custom-check-theme theme)
956 (provide (get theme 'theme-feature)) 1028 (provide (get theme 'theme-feature))
957 (setq custom-loaded-themes (nconc (list theme) custom-loaded-themes))) 1029 (push theme custom-loaded-themes)
1030 ;; Loading a theme also installs its settings,
1031 ;; so mark it as "enabled".
1032 (push theme custom-enabled-themes)
1033 ;; `user' must always be the highest-precedence enabled theme.
1034 ;; Make that remain true. (This has the effect of making user settings
1035 ;; override the ones just loaded, too.)
1036 (custom-enable-theme 'user))
958 1037
959(defun require-theme (theme) 1038(defun require-theme (theme)
960 "Try to load a theme by requiring its feature. 1039 "Try to load a theme's settings from its file.
961THEME's feature is stored in THEME's `theme-feature' property. 1040This also enables the theme; use `custom-disable-theme' to disable it."
1041
1042 ;; THEME's feature is stored in THEME's `theme-feature' property.
1043 ;; Usually the `theme-feature' property contains a symbol created
1044 ;; by `custom-make-theme-feature'.
962 1045
963Usually the `theme-feature' property contains a symbol created
964by `custom-make-theme-feature'."
965 ;; Note we do no check for validity of the theme here. 1046 ;; Note we do no check for validity of the theme here.
966 ;; This allows to pull in themes by a file-name convention 1047 ;; This allows to pull in themes by a file-name convention
967 (let ((load-path (if (file-directory-p custom-theme-directory) 1048 (let ((load-path (if (file-directory-p custom-theme-directory)
@@ -969,70 +1050,35 @@ by `custom-make-theme-feature'."
969 load-path))) 1050 load-path)))
970 (require (or (get theme 'theme-feature) 1051 (require (or (get theme 'theme-feature)
971 (custom-make-theme-feature theme))))) 1052 (custom-make-theme-feature theme)))))
972 1053
973(defun custom-remove-theme (spec-alist theme) 1054;;; How to load and enable various themes as part of `user'.
974 "Delete all elements from SPEC-ALIST whose car is THEME."
975 (let ((elt (assoc theme spec-alist)))
976 (while elt
977 (setq spec-alist (delete elt spec-alist)
978 elt (assoc theme spec-alist))))
979 spec-alist)
980
981(defun custom-do-theme-reset (theme)
982 "Undo all settings defined by THEME.
983
984A variable remains unchanged if its property `theme-value' does not
985contain a value for THEME. A face remains unchanged if its property
986`theme-face' does not contain a value for THEME. In either case, all
987settings for THEME are removed from the property and the variable or
988face is set to the `user' theme.
989
990See `custom-known-themes' for a list of known themes."
991 (let (spec-list)
992 (mapatoms (lambda (symbol)
993 ;; This works even if symbol is both a variable and a
994 ;; face.
995 (setq spec-list (get symbol 'theme-value))
996 (when spec-list
997 (put symbol 'theme-value (custom-remove-theme spec-list theme))
998 (custom-theme-reset-internal symbol 'user))
999 (setq spec-list (get symbol 'theme-face))
1000 (when spec-list
1001 (put symbol 'theme-face (custom-remove-theme spec-list theme))
1002 (custom-theme-reset-internal-face symbol 'user))))))
1003 1055
1004(defun custom-theme-load-themes (by-theme &rest body) 1056(defun custom-theme-load-themes (by-theme &rest body)
1005 "Load the themes specified by BODY. 1057 "Load the themes specified by BODY.
1006Record them as required by theme BY-THEME. BODY is a sequence of either 1058Record them as required by theme BY-THEME.
1059
1060BODY is a sequence of either
1007 1061
1008THEME 1062THEME
1009 BY-THEME requires THEME 1063 Load THEME and enable it.
1010\(reset THEME) 1064\(reset THEME)
1011 Undo all the settings made by THEME 1065 Undo all the settings made by THEME
1012\(hidden THEME) 1066\(hidden THEME)
1013 Require THEME but hide it from the user 1067 Load THEME but do not enable it.
1014 1068
1015All the themes loaded for BY-THEME are recorded in BY-THEME's property 1069All the themes loaded for BY-THEME are recorded in BY-THEME's property
1016`theme-loads-themes'. Any theme loaded with the hidden predicate will 1070`theme-loads-themes'."
1017be given the property `theme-hidden' unless it has been loaded before.
1018Whether a theme has been loaded before is determined by the function
1019`custom-theme-loaded-p'."
1020 (custom-check-theme by-theme) 1071 (custom-check-theme by-theme)
1021 (let ((theme) 1072 (let ((themes-loaded (get by-theme 'theme-loads-themes)))
1022 (themes-loaded (get by-theme 'theme-loads-themes))) 1073 (dolist (theme body)
1023 (while theme
1024 (setq theme (car body)
1025 body (cdr body))
1026 (cond ((and (consp theme) (eq (car theme) 'reset)) 1074 (cond ((and (consp theme) (eq (car theme) 'reset))
1027 (custom-do-theme-reset (cadr theme))) 1075 (custom-disable-theme (cadr theme)))
1028 ((and (consp theme) (eq (car theme) 'hidden)) 1076 ((and (consp theme) (eq (car theme) 'hidden))
1029 (require-theme (cadr theme)) 1077 (require-theme (cadr theme))
1030 (unless (custom-theme-loaded-p (cadr theme)) 1078 (custom-disable-theme (cadr theme)))
1031 (put (cadr theme) 'theme-hidden t)))
1032 (t 1079 (t
1033 (require-theme theme) 1080 (require-theme theme)))
1034 (put theme 'theme-hidden nil))) 1081 (push theme themes-loaded))
1035 (setq themes-loaded (nconc (list theme) themes-loaded)))
1036 (put by-theme 'theme-loads-themes themes-loaded))) 1082 (put by-theme 'theme-loads-themes themes-loaded)))
1037 1083
1038(defun custom-load-themes (&rest body) 1084(defun custom-load-themes (&rest body)
@@ -1040,82 +1086,127 @@ Whether a theme has been loaded before is determined by the function
1040 1086
1041See `custom-theme-load-themes' for more information on BODY." 1087See `custom-theme-load-themes' for more information on BODY."
1042 (apply 'custom-theme-load-themes 'user body)) 1088 (apply 'custom-theme-load-themes 'user body))
1043 1089
1044; (defsubst copy-upto-last (elt list) 1090;;; Enabling and disabling loaded themes.
1045; "Copy all the elements of the list upto the last occurence of elt" 1091
1046; ;; Is it faster to do more work in C than to do less in elisp? 1092(defun custom-enable-theme (theme)
1047; (nreverse (cdr (member elt (reverse list))))) 1093 "Reenable all variable and face settings defined by THEME.
1048 1094The newly enabled theme gets the highest precedence (after `user').
1049(defun custom-theme-value (theme theme-spec-list) 1095If it is already enabled, just give it highest precedence (after `user')."
1050 "Determine the value for THEME defined by THEME-SPEC-LIST. 1096 (let ((settings (get theme 'theme-settings)))
1051Returns a list with the original value if found; nil otherwise. 1097 (dolist (s settings)
1052 1098 (let* ((prop (car s))
1053THEME-SPEC-LIST is an alist with themes as its key. As new themes are 1099 (symbol (cadr s))
1054installed, these are added to the front of THEME-SPEC-LIST. 1100 (spec-list (get symbol prop)))
1055Each element has the form 1101 (put symbol prop (cons (cddr s) (assq-delete-all theme spec-list)))
1102 (if (eq prop 'theme-value)
1103 (custom-theme-recalc-variable symbol)
1104 (custom-theme-recalc-face symbol)))))
1105 (setq custom-enabled-themes
1106 (cons theme (delq theme custom-enabled-themes)))
1107 ;; `user' must always be the highest-precedence enabled theme.
1108 (unless (eq theme 'user)
1109 (custom-enable-theme 'user)))
1110
1111(defun custom-disable-theme (theme)
1112 "Disable all variable and face settings defined by THEME.
1113See `custom-known-themes' for a list of known themes."
1114 (let ((settings (get theme 'theme-settings)))
1115 (dolist (s settings)
1116 (let* ((prop (car s))
1117 (symbol (cadr s))
1118 (spec-list (get symbol prop)))
1119 (put symbol 'theme-value (assq-delete-all theme spec-list))
1120 (if (eq prop 'theme-value)
1121 (custom-theme-recalc-variable symbol)
1122 (custom-theme-recalc-face symbol)))))
1123 (setq custom-enabled-themes
1124 (delq theme custom-enabled-themes)))
1125
1126(defun custom-theme-value (theme setting-list)
1127 "Determine the value specified for THEME according to SETTING-LIST.
1128Returns a list whose car is the specified value, if we
1129find one; nil otherwise.
1130
1131SETTING-LIST is an alist with themes as its key.
1132Each element has the form:
1056 1133
1057 \(THEME MODE VALUE) 1134 \(THEME MODE VALUE)
1058 1135
1059MODE is either the symbol `set' or the symbol `reset'. See 1136MODE is either the symbol `set' or the symbol `reset'. See
1060`custom-push-theme' for more information on the format of 1137`custom-push-theme' for more information on the format of
1061THEME-SPEC-LIST." 1138SETTING-LIST."
1062 ;; Note we do _NOT_ signal an error if the theme is unknown 1139 ;; Note we do _NOT_ signal an error if the theme is unknown
1063 ;; it might have gone away without the user knowing. 1140 ;; it might have gone away without the user knowing.
1064 (let ((value (cdr (assoc theme theme-spec-list)))) 1141 (let ((elt (cdr (assoc theme setting-list))))
1065 (if value 1142 (if elt
1066 (if (eq (car value) 'set) 1143 (if (eq (car elt) 'set)
1067 (cdr value) 1144 (cdr elt)
1068 (custom-theme-value (cadr value) theme-spec-list))))) 1145 ;; `reset' means refer to another theme's value in the same alist.
1069 1146 (custom-theme-value (cadr elt) setting-list)))))
1070(defun custom-theme-variable-value (variable theme) 1147
1071 "Return (list value) indicating value of VARIABLE in THEME. 1148(defun custom-variable-theme-value (variable)
1072If THEME does not define a value for VARIABLE, return nil. The value 1149 "Return (list VALUE) indicating the custom theme value of VARIABLE.
1073definitions per theme are stored in VARIABLE's property `theme-value'. 1150That is to say, it specifies what the value should be according to
1074The actual work is done by function `custom-theme-value', which see. 1151currently enabled custom themes.
1075See `custom-push-theme' for more information on how these definitions 1152
1076are stored." 1153This function returns nil if no custom theme specifies a value for VARIABLE."
1077 (custom-theme-value theme (get variable 'theme-value))) 1154 (let* ((theme-value (get variable 'theme-value)))
1078 1155 (if theme-value
1079(defun custom-theme-reset-internal (symbol to-theme) 1156 (custom-theme-value (car (car theme-value)) theme-value))))
1080 "Reset SYMBOL to the value defined by TO-THEME. 1157
1081If SYMBOL is not defined in TO-THEME, reset SYMBOL to the standard 1158(defun custom-face-theme-value (face)
1082value. See `custom-theme-variable-value'. The standard value is 1159 "Return the face spec of FACE according to currently enabled custom themes.
1083stored in SYMBOL's property `standard-value'." 1160This function returns nil if no custom theme specifies anything for FACE."
1084 (let ((value (custom-theme-variable-value symbol to-theme)) 1161 (let* ((theme-value (get face 'theme-face)))
1085 was-in-theme) 1162 (if theme-value
1086 (setq was-in-theme value) 1163 (custom-theme-value (car (car theme-value)) theme-value))))
1087 (setq value (or value (get symbol 'standard-value))) 1164
1088 (when value 1165(defun custom-theme-recalc-variable (variable)
1089 (put symbol 'saved-value was-in-theme) 1166 "Set VARIABLE according to currently enabled custom themes."
1090 (if (or (get 'force-value symbol) (default-boundp symbol)) 1167 (let ((valspec (custom-variable-theme-value variable)))
1091 (funcall (or (get symbol 'custom-set) 'set-default) symbol 1168 (when valspec
1092 (eval (car value))))) 1169 (put variable 'saved-value valspec))
1093 value)) 1170 (unless valspec
1094 1171 (setq valspec (get variable 'standard-value)))
1172 (when valspec
1173 (if (or (get 'force-value variable) (default-boundp variable))
1174 (funcall (or (get variable 'custom-set) 'set-default) variable
1175 (eval (car valspec)))))))
1176
1177(defun custom-theme-recalc-face (face)
1178 "Set FACE according to currently enabled custom themes."
1179 (let ((spec (custom-face-theme-value face)))
1180 (when spec
1181 (put face 'save-face spec))
1182 (unless spec
1183 (setq spec (get face 'face-defface-spec)))
1184 (when spec
1185 (when (or (get face 'force-face) (facep face))
1186 (unless (facep face)
1187 (make-empty-face face))
1188 (face-spec-set face spec)))))
1189
1095(defun custom-theme-reset-variables (theme &rest args) 1190(defun custom-theme-reset-variables (theme &rest args)
1096 "Reset the value of the variables to values previously defined. 1191 "Reset the specs in THEME of some variables to their values in other themes.
1097Associate this setting with THEME. 1192Each of the arguments ARGS has this form:
1098
1099ARGS is a list of lists of the form
1100 1193
1101 (VARIABLE TO-THEME) 1194 (VARIABLE FROM-THEME)
1102 1195
1103This means reset VARIABLE to its value in TO-THEME." 1196This means reset VARIABLE to its value in FROM-THEME."
1104 (custom-check-theme theme) 1197 (custom-check-theme theme)
1105 (mapcar '(lambda (arg) 1198 (dolist (arg args)
1106 (apply 'custom-theme-reset-internal arg) 1199 (custom-push-theme 'theme-value (car arg) theme 'reset (cadr arg))))
1107 (custom-push-theme 'theme-value (car arg) theme 'reset (cadr arg)))
1108 args))
1109 1200
1110(defun custom-reset-variables (&rest args) 1201(defun custom-reset-variables (&rest args)
1111 "Reset the value of the variables to values previously saved. 1202 "Reset the specs of some variables to their values in certain themes.
1112This is the setting associated the `user' theme. 1203This creates settings in the `user' theme.
1113 1204
1114ARGS is a list of lists of the form 1205Each of the arguments ARGS has this form:
1115 1206
1116 (VARIABLE TO-THEME) 1207 (VARIABLE FROM-THEME)
1117 1208
1118This means reset VARIABLE to its value in TO-THEME." 1209This means reset VARIABLE to its value in FROM-THEME."
1119 (apply 'custom-theme-reset-variables 'user args)) 1210 (apply 'custom-theme-reset-variables 'user args))
1120 1211
1121;;; The End. 1212;;; The End.
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 70d88be0952..3679140ba38 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -4,7 +4,7 @@
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Morten Welinder <terra@diku.dk> 6;; Author: Morten Welinder <terra@diku.dk>
7;; Maintainter: Lars Hansen <larsh@math.ku.dk> 7;; Maintainter: Lars Hansen <larsh@soem.dk>
8;; Keywords: convenience 8;; Keywords: convenience
9;; Favourite-brand-of-beer: None, I hate beer. 9;; Favourite-brand-of-beer: None, I hate beer.
10 10
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index c9d5c22ded3..617cb38585f 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -126,16 +126,21 @@ Examples of PREDICATE:
126 (let* ((dir1 (dired-current-directory)) 126 (let* ((dir1 (dired-current-directory))
127 (file-alist1 (dired-files-attributes dir1)) 127 (file-alist1 (dired-files-attributes dir1))
128 (file-alist2 (dired-files-attributes dir2)) 128 (file-alist2 (dired-files-attributes dir2))
129 (file-list1 (mapcar 129 file-list1 file-list2)
130 (setq file-alist1 (delq (assoc "." file-alist1) file-alist1))
131 (setq file-alist1 (delq (assoc ".." file-alist1) file-alist1))
132 (setq file-alist2 (delq (assoc "." file-alist2) file-alist2))
133 (setq file-alist2 (delq (assoc ".." file-alist2) file-alist2))
134 (setq file-list1 (mapcar
130 'cadr 135 'cadr
131 (dired-file-set-difference 136 (dired-file-set-difference
132 file-alist1 file-alist2 137 file-alist1 file-alist2
133 predicate))) 138 predicate))
134 (file-list2 (mapcar 139 file-list2 (mapcar
135 'cadr 140 'cadr
136 (dired-file-set-difference 141 (dired-file-set-difference
137 file-alist2 file-alist1 142 file-alist2 file-alist1
138 predicate)))) 143 predicate)))
139 (dired-fun-in-all-buffers 144 (dired-fun-in-all-buffers
140 dir1 nil 145 dir1 nil
141 (lambda () 146 (lambda ()
diff --git a/lisp/dired.el b/lisp/dired.el
index a2d1cf957a8..a45395ecef9 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -224,7 +224,7 @@ as in other buffers."
224 ;; concentric sets or an order for the marked files. 224 ;; concentric sets or an order for the marked files.
225 ;; The code depends on dynamic scoping on the marker char. 225 ;; The code depends on dynamic scoping on the marker char.
226 "In Dired, the current mark character. 226 "In Dired, the current mark character.
227This is what the `do' commands look for and what the `mark' commands store.") 227This is what the do-commands look for, and what the mark-commands store.")
228 228
229(defvar dired-del-marker ?D 229(defvar dired-del-marker ?D
230 "Character used to flag files for deletion.") 230 "Character used to flag files for deletion.")
diff --git a/lisp/ediff-diff.el b/lisp/ediff-diff.el
index 659c4ffedb0..6d6b36692bc 100644
--- a/lisp/ediff-diff.el
+++ b/lisp/ediff-diff.el
@@ -459,24 +459,46 @@ one optional arguments, diff-number to refine.")
459 c-prev c-end) 459 c-prev c-end)
460 ;; else convert lines to points 460 ;; else convert lines to points
461 (ediff-with-current-buffer A-buffer 461 (ediff-with-current-buffer A-buffer
462 (forward-line (- a-begin a-prev)) 462 (let ((longlines-mode-val
463 (setq a-begin-pt (point)) 463 (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
464 (forward-line (- a-end a-begin)) 464 ;; we must disable and then restore longlines-mode
465 (setq a-end-pt (point) 465 (if (eq longlines-mode-val 1)
466 a-prev a-end)) 466 (longlines-mode 0))
467 (forward-line (- a-begin a-prev))
468 (setq a-begin-pt (point))
469 (forward-line (- a-end a-begin))
470 (setq a-end-pt (point)
471 a-prev a-end)
472 (if (eq longlines-mode-val 1)
473 (longlines-mode longlines-mode-val))
474 ))
467 (ediff-with-current-buffer B-buffer 475 (ediff-with-current-buffer B-buffer
468 (forward-line (- b-begin b-prev)) 476 (let ((longlines-mode-val
469 (setq b-begin-pt (point)) 477 (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
470 (forward-line (- b-end b-begin)) 478 (if (eq longlines-mode-val 1)
471 (setq b-end-pt (point) 479 (longlines-mode 0))
472 b-prev b-end)) 480 (forward-line (- b-begin b-prev))
481 (setq b-begin-pt (point))
482 (forward-line (- b-end b-begin))
483 (setq b-end-pt (point)
484 b-prev b-end)
485 (if (eq longlines-mode-val 1)
486 (longlines-mode longlines-mode-val))
487 ))
473 (if (ediff-buffer-live-p C-buffer) 488 (if (ediff-buffer-live-p C-buffer)
474 (ediff-with-current-buffer C-buffer 489 (ediff-with-current-buffer C-buffer
475 (forward-line (- c-begin c-prev)) 490 (let ((longlines-mode-val
476 (setq c-begin-pt (point)) 491 (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
477 (forward-line (- c-end c-begin)) 492 (if (eq longlines-mode-val 1)
478 (setq c-end-pt (point) 493 (longlines-mode 0))
479 c-prev c-end))) 494 (forward-line (- c-begin c-prev))
495 (setq c-begin-pt (point))
496 (forward-line (- c-end c-begin))
497 (setq c-end-pt (point)
498 c-prev c-end)
499 (if (eq longlines-mode-val 1)
500 (longlines-mode longlines-mode-val))
501 )))
480 (setq diff-list 502 (setq diff-list
481 (nconc 503 (nconc
482 diff-list 504 diff-list
@@ -1060,30 +1082,59 @@ delimiter regions"))
1060 c-prev c-end) 1082 c-prev c-end)
1061 ;; else convert lines to points 1083 ;; else convert lines to points
1062 (ediff-with-current-buffer A-buffer 1084 (ediff-with-current-buffer A-buffer
1063 (forward-line (- a-begin a-prev)) 1085 (let ((longlines-mode-val
1064 (setq a-begin-pt (point)) 1086 (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
1065 (forward-line (- a-end a-begin)) 1087 ;; we must disable and then restore longlines-mode
1066 (setq a-end-pt (point) 1088 (if (eq longlines-mode-val 1)
1067 a-prev a-end)) 1089 (longlines-mode 0))
1090 (forward-line (- a-begin a-prev))
1091 (setq a-begin-pt (point))
1092 (forward-line (- a-end a-begin))
1093 (setq a-end-pt (point)
1094 a-prev a-end)
1095 (if (eq longlines-mode-val 1)
1096 (longlines-mode longlines-mode-val))
1097 ))
1068 (ediff-with-current-buffer B-buffer 1098 (ediff-with-current-buffer B-buffer
1069 (forward-line (- b-begin b-prev)) 1099 (let ((longlines-mode-val
1070 (setq b-begin-pt (point)) 1100 (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
1071 (forward-line (- b-end b-begin)) 1101 (if (eq longlines-mode-val 1)
1072 (setq b-end-pt (point) 1102 (longlines-mode 0))
1073 b-prev b-end)) 1103 (forward-line (- b-begin b-prev))
1104 (setq b-begin-pt (point))
1105 (forward-line (- b-end b-begin))
1106 (setq b-end-pt (point)
1107 b-prev b-end)
1108 (if (eq longlines-mode-val 1)
1109 (longlines-mode longlines-mode-val))
1110 ))
1074 (ediff-with-current-buffer C-buffer 1111 (ediff-with-current-buffer C-buffer
1075 (forward-line (- c-begin c-prev)) 1112 (let ((longlines-mode-val
1076 (setq c-begin-pt (point)) 1113 (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
1077 (forward-line (- c-end c-begin)) 1114 (if (eq longlines-mode-val 1)
1078 (setq c-end-pt (point) 1115 (longlines-mode 0))
1079 c-prev c-end)) 1116 (forward-line (- c-begin c-prev))
1117 (setq c-begin-pt (point))
1118 (forward-line (- c-end c-begin))
1119 (setq c-end-pt (point)
1120 c-prev c-end)
1121 (if (eq longlines-mode-val 1)
1122 (longlines-mode longlines-mode-val))
1123 ))
1080 (if (ediff-buffer-live-p anc-buffer) 1124 (if (ediff-buffer-live-p anc-buffer)
1081 (ediff-with-current-buffer anc-buffer 1125 (ediff-with-current-buffer anc-buffer
1082 (forward-line (- c-or-anc-begin anc-prev)) 1126 (let ((longlines-mode-val
1083 (setq anc-begin-pt (point)) 1127 (if (and (boundp 'longlines-mode) longlines-mode) 1 0)))
1084 (forward-line (- c-or-anc-end c-or-anc-begin)) 1128 (if (eq longlines-mode-val 1)
1085 (setq anc-end-pt (point) 1129 (longlines-mode 0))
1086 anc-prev c-or-anc-end))) 1130 (forward-line (- c-or-anc-begin anc-prev))
1131 (setq anc-begin-pt (point))
1132 (forward-line (- c-or-anc-end c-or-anc-begin))
1133 (setq anc-end-pt (point)
1134 anc-prev c-or-anc-end)
1135 (if (eq longlines-mode-val 1)
1136 (longlines-mode longlines-mode-val))
1137 )))
1087 (setq diff-list 1138 (setq diff-list
1088 (nconc 1139 (nconc
1089 diff-list 1140 diff-list
@@ -1425,6 +1476,5 @@ affects only files whose names match the expression."
1425;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body)) 1476;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
1426;;; End: 1477;;; End:
1427 1478
1428
1429;;; arch-tag: a86d448e-58d7-4572-a1d9-fdedfa22f648 1479;;; arch-tag: a86d448e-58d7-4572-a1d9-fdedfa22f648
1430;;; ediff-diff.el ends here 1480;;; ediff-diff.el ends here
diff --git a/lisp/ediff-init.el b/lisp/ediff-init.el
index 18e1a7128f1..8af930ec27e 100644
--- a/lisp/ediff-init.el
+++ b/lisp/ediff-init.el
@@ -854,10 +854,10 @@ to temp files when Ediff needs to find fine differences."
854 854
855;; A-list of current-diff-face-* symbols associated with buf types 855;; A-list of current-diff-face-* symbols associated with buf types
856(defconst ediff-current-diff-face-alist 856(defconst ediff-current-diff-face-alist
857 '((A . ediff-current-diff-face-A) 857 '((A . ediff-current-diff-A)
858 (B . ediff-current-diff-face-B) 858 (B . ediff-current-diff-B)
859 (C . ediff-current-diff-face-C) 859 (C . ediff-current-diff-C)
860 (Ancestor . ediff-current-diff-face-Ancestor))) 860 (Ancestor . ediff-current-diff-Ancestor)))
861 861
862 862
863(defun ediff-set-overlay-face (extent face) 863(defun ediff-set-overlay-face (extent face)
@@ -915,8 +915,6 @@ to temp files when Ediff needs to find fine differences."
915 (t (:inverse-video t)))) 915 (t (:inverse-video t))))
916 "Face for highlighting the selected difference in buffer A." 916 "Face for highlighting the selected difference in buffer A."
917 :group 'ediff-highlighting) 917 :group 'ediff-highlighting)
918;; backward-compatibility alias
919(put 'ediff-current-diff-face-A 'face-alias 'ediff-current-diff-A)
920;; An internal variable. Ediff takes the face from here. When unhighlighting, 918;; An internal variable. Ediff takes the face from here. When unhighlighting,
921;; this variable is set to nil, then again to the appropriate face. 919;; this variable is set to nil, then again to the appropriate face.
922(defvar ediff-current-diff-face-A 'ediff-current-diff-A 920(defvar ediff-current-diff-face-A 'ediff-current-diff-A
@@ -924,13 +922,13 @@ to temp files when Ediff needs to find fine differences."
924DO NOT CHANGE this variable. Instead, use the customization 922DO NOT CHANGE this variable. Instead, use the customization
925widget to customize the actual face object `ediff-current-diff-A' 923widget to customize the actual face object `ediff-current-diff-A'
926this variable represents.") 924this variable represents.")
927(ediff-hide-face 'ediff-current-diff-A) 925(ediff-hide-face ediff-current-diff-face-A)
928;; Until custom.el for XEmacs starts supporting :inverse-video we do this. 926;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
929;; This means that some user customization may be trashed. 927;; This means that some user customization may be trashed.
930(if (and ediff-xemacs-p 928(if (and ediff-xemacs-p
931 (ediff-has-face-support-p) 929 (ediff-has-face-support-p)
932 (not (ediff-color-display-p))) 930 (not (ediff-color-display-p)))
933 (copy-face 'modeline 'ediff-current-diff-A)) 931 (copy-face 'modeline ediff-current-diff-face-A))
934 932
935 933
936 934
@@ -948,8 +946,6 @@ this variable represents.")
948 (t (:inverse-video t)))) 946 (t (:inverse-video t))))
949 "Face for highlighting the selected difference in buffer B." 947 "Face for highlighting the selected difference in buffer B."
950 :group 'ediff-highlighting) 948 :group 'ediff-highlighting)
951;; backward-compatibility alias
952(put 'ediff-current-diff-face-B 'face-alias 'ediff-current-diff-B)
953;; An internal variable. Ediff takes the face from here. When unhighlighting, 949;; An internal variable. Ediff takes the face from here. When unhighlighting,
954;; this variable is set to nil, then again to the appropriate face. 950;; this variable is set to nil, then again to the appropriate face.
955(defvar ediff-current-diff-face-B 'ediff-current-diff-B 951(defvar ediff-current-diff-face-B 'ediff-current-diff-B
@@ -957,13 +953,13 @@ this variable represents.")
957 this variable. Instead, use the customization 953 this variable. Instead, use the customization
958widget to customize the actual face `ediff-current-diff-B' 954widget to customize the actual face `ediff-current-diff-B'
959this variable represents.") 955this variable represents.")
960(ediff-hide-face 'ediff-current-diff-B) 956(ediff-hide-face ediff-current-diff-face-B)
961;; Until custom.el for XEmacs starts supporting :inverse-video we do this. 957;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
962;; This means that some user customization may be trashed. 958;; This means that some user customization may be trashed.
963(if (and ediff-xemacs-p 959(if (and ediff-xemacs-p
964 (ediff-has-face-support-p) 960 (ediff-has-face-support-p)
965 (not (ediff-color-display-p))) 961 (not (ediff-color-display-p)))
966 (copy-face 'modeline 'ediff-current-diff-B)) 962 (copy-face 'modeline ediff-current-diff-face-B))
967 963
968 964
969(defface ediff-current-diff-C 965(defface ediff-current-diff-C
@@ -978,8 +974,6 @@ this variable represents.")
978 (t (:inverse-video t)))) 974 (t (:inverse-video t))))
979 "Face for highlighting the selected difference in buffer C." 975 "Face for highlighting the selected difference in buffer C."
980 :group 'ediff-highlighting) 976 :group 'ediff-highlighting)
981;; backward-compatibility alias
982(put 'ediff-current-diff-face-C 'face-alias 'ediff-current-diff-C)
983;; An internal variable. Ediff takes the face from here. When unhighlighting, 977;; An internal variable. Ediff takes the face from here. When unhighlighting,
984;; this variable is set to nil, then again to the appropriate face. 978;; this variable is set to nil, then again to the appropriate face.
985(defvar ediff-current-diff-face-C 'ediff-current-diff-C 979(defvar ediff-current-diff-face-C 'ediff-current-diff-C
@@ -987,13 +981,13 @@ this variable represents.")
987DO NOT CHANGE this variable. Instead, use the customization 981DO NOT CHANGE this variable. Instead, use the customization
988widget to customize the actual face object `ediff-current-diff-C' 982widget to customize the actual face object `ediff-current-diff-C'
989this variable represents.") 983this variable represents.")
990(ediff-hide-face 'ediff-current-diff-C) 984(ediff-hide-face ediff-current-diff-face-C)
991;; Until custom.el for XEmacs starts supporting :inverse-video we do this. 985;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
992;; This means that some user customization may be trashed. 986;; This means that some user customization may be trashed.
993(if (and ediff-xemacs-p 987(if (and ediff-xemacs-p
994 (ediff-has-face-support-p) 988 (ediff-has-face-support-p)
995 (not (ediff-color-display-p))) 989 (not (ediff-color-display-p)))
996 (copy-face 'modeline 'ediff-current-diff-C)) 990 (copy-face 'modeline ediff-current-diff-face-C))
997 991
998 992
999(defface ediff-current-diff-Ancestor 993(defface ediff-current-diff-Ancestor
@@ -1008,8 +1002,6 @@ this variable represents.")
1008 (t (:inverse-video t)))) 1002 (t (:inverse-video t))))
1009 "Face for highlighting the selected difference in buffer Ancestor." 1003 "Face for highlighting the selected difference in buffer Ancestor."
1010 :group 'ediff-highlighting) 1004 :group 'ediff-highlighting)
1011;; backward-compatibility alias
1012(put 'ediff-current-diff-face-Ancestor 'face-alias 'ediff-current-diff-Ancestor)
1013;; An internal variable. Ediff takes the face from here. When unhighlighting, 1005;; An internal variable. Ediff takes the face from here. When unhighlighting,
1014;; this variable is set to nil, then again to the appropriate face. 1006;; this variable is set to nil, then again to the appropriate face.
1015(defvar ediff-current-diff-face-Ancestor 'ediff-current-diff-Ancestor 1007(defvar ediff-current-diff-face-Ancestor 'ediff-current-diff-Ancestor
@@ -1017,13 +1009,13 @@ this variable represents.")
1017DO NOT CHANGE this variable. Instead, use the customization 1009DO NOT CHANGE this variable. Instead, use the customization
1018widget to customize the actual face object `ediff-current-diff-Ancestor' 1010widget to customize the actual face object `ediff-current-diff-Ancestor'
1019this variable represents.") 1011this variable represents.")
1020(ediff-hide-face 'ediff-current-diff-Ancestor) 1012(ediff-hide-face ediff-current-diff-face-Ancestor)
1021;; Until custom.el for XEmacs starts supporting :inverse-video we do this. 1013;; Until custom.el for XEmacs starts supporting :inverse-video we do this.
1022;; This means that some user customization may be trashed. 1014;; This means that some user customization may be trashed.
1023(if (and ediff-xemacs-p 1015(if (and ediff-xemacs-p
1024 (ediff-has-face-support-p) 1016 (ediff-has-face-support-p)
1025 (not (ediff-color-display-p))) 1017 (not (ediff-color-display-p)))
1026 (copy-face 'modeline 'ediff-current-diff-Ancestor)) 1018 (copy-face 'modeline ediff-current-diff-face-Ancestor))
1027 1019
1028 1020
1029(defface ediff-fine-diff-A 1021(defface ediff-fine-diff-A
@@ -1038,8 +1030,6 @@ this variable represents.")
1038 (t (:underline t :stipple "gray3")))) 1030 (t (:underline t :stipple "gray3"))))
1039 "Face for highlighting the refinement of the selected diff in buffer A." 1031 "Face for highlighting the refinement of the selected diff in buffer A."
1040 :group 'ediff-highlighting) 1032 :group 'ediff-highlighting)
1041;; backward-compatibility alias
1042(put 'ediff-fine-diff-face-A 'face-alias 'ediff-fine-diff-A)
1043;; An internal variable. Ediff takes the face from here. When unhighlighting, 1033;; An internal variable. Ediff takes the face from here. When unhighlighting,
1044;; this variable is set to nil, then again to the appropriate face. 1034;; this variable is set to nil, then again to the appropriate face.
1045(defvar ediff-fine-diff-face-A 'ediff-fine-diff-A 1035(defvar ediff-fine-diff-face-A 'ediff-fine-diff-A
@@ -1047,7 +1037,7 @@ this variable represents.")
1047DO NOT CHANGE this variable. Instead, use the customization 1037DO NOT CHANGE this variable. Instead, use the customization
1048widget to customize the actual face object `ediff-fine-diff-A' 1038widget to customize the actual face object `ediff-fine-diff-A'
1049this variable represents.") 1039this variable represents.")
1050(ediff-hide-face 'ediff-fine-diff-A) 1040(ediff-hide-face ediff-fine-diff-face-A)
1051 1041
1052(defface ediff-fine-diff-B 1042(defface ediff-fine-diff-B
1053 (if ediff-emacs-p 1043 (if ediff-emacs-p
@@ -1061,8 +1051,6 @@ this variable represents.")
1061 (t (:underline t :stipple "gray3")))) 1051 (t (:underline t :stipple "gray3"))))
1062 "Face for highlighting the refinement of the selected diff in buffer B." 1052 "Face for highlighting the refinement of the selected diff in buffer B."
1063 :group 'ediff-highlighting) 1053 :group 'ediff-highlighting)
1064;; backward-compatibility alias
1065(put 'ediff-fine-diff-face-B 'face-alias 'ediff-fine-diff-B)
1066;; An internal variable. Ediff takes the face from here. When unhighlighting, 1054;; An internal variable. Ediff takes the face from here. When unhighlighting,
1067;; this variable is set to nil, then again to the appropriate face. 1055;; this variable is set to nil, then again to the appropriate face.
1068(defvar ediff-fine-diff-face-B 'ediff-fine-diff-B 1056(defvar ediff-fine-diff-face-B 'ediff-fine-diff-B
@@ -1070,7 +1058,7 @@ this variable represents.")
1070DO NOT CHANGE this variable. Instead, use the customization 1058DO NOT CHANGE this variable. Instead, use the customization
1071widget to customize the actual face object `ediff-fine-diff-B' 1059widget to customize the actual face object `ediff-fine-diff-B'
1072this variable represents.") 1060this variable represents.")
1073(ediff-hide-face 'ediff-fine-diff-B) 1061(ediff-hide-face ediff-fine-diff-face-B)
1074 1062
1075(defface ediff-fine-diff-C 1063(defface ediff-fine-diff-C
1076 (if ediff-emacs-p 1064 (if ediff-emacs-p
@@ -1089,8 +1077,6 @@ this variable represents.")
1089 (t (:underline t :stipple "gray3")))) 1077 (t (:underline t :stipple "gray3"))))
1090 "Face for highlighting the refinement of the selected diff in buffer C." 1078 "Face for highlighting the refinement of the selected diff in buffer C."
1091 :group 'ediff-highlighting) 1079 :group 'ediff-highlighting)
1092;; backward-compatibility alias
1093(put 'ediff-fine-diff-face-C 'face-alias 'ediff-fine-diff-C)
1094;; An internal variable. Ediff takes the face from here. When unhighlighting, 1080;; An internal variable. Ediff takes the face from here. When unhighlighting,
1095;; this variable is set to nil, then again to the appropriate face. 1081;; this variable is set to nil, then again to the appropriate face.
1096(defvar ediff-fine-diff-face-C 'ediff-fine-diff-C 1082(defvar ediff-fine-diff-face-C 'ediff-fine-diff-C
@@ -1098,7 +1084,7 @@ this variable represents.")
1098DO NOT CHANGE this variable. Instead, use the customization 1084DO NOT CHANGE this variable. Instead, use the customization
1099widget to customize the actual face object `ediff-fine-diff-C' 1085widget to customize the actual face object `ediff-fine-diff-C'
1100this variable represents.") 1086this variable represents.")
1101(ediff-hide-face 'ediff-fine-diff-C) 1087(ediff-hide-face ediff-fine-diff-face-C)
1102 1088
1103(defface ediff-fine-diff-Ancestor 1089(defface ediff-fine-diff-Ancestor
1104 (if ediff-emacs-p 1090 (if ediff-emacs-p
@@ -1114,8 +1100,6 @@ this variable represents.")
1114At present, this face is not used and no fine differences are computed for the 1100At present, this face is not used and no fine differences are computed for the
1115ancestor buffer." 1101ancestor buffer."
1116 :group 'ediff-highlighting) 1102 :group 'ediff-highlighting)
1117;; backward-compatibility alias
1118(put 'ediff-fine-diff-face-Ancestor 'face-alias 'ediff-fine-diff-Ancestor)
1119;; An internal variable. Ediff takes the face from here. When unhighlighting, 1103;; An internal variable. Ediff takes the face from here. When unhighlighting,
1120;; this variable is set to nil, then again to the appropriate face. 1104;; this variable is set to nil, then again to the appropriate face.
1121(defvar ediff-fine-diff-face-Ancestor 'ediff-fine-diff-Ancestor 1105(defvar ediff-fine-diff-face-Ancestor 'ediff-fine-diff-Ancestor
@@ -1123,7 +1107,7 @@ ancestor buffer."
1123DO NOT CHANGE this variable. Instead, use the customization 1107DO NOT CHANGE this variable. Instead, use the customization
1124widget to customize the actual face object `ediff-fine-diff-Ancestor' 1108widget to customize the actual face object `ediff-fine-diff-Ancestor'
1125this variable represents.") 1109this variable represents.")
1126(ediff-hide-face 'ediff-fine-diff-Ancestor) 1110(ediff-hide-face ediff-fine-diff-face-Ancestor)
1127 1111
1128;; Some installs don't have stipple or Stipple. So, try them in turn. 1112;; Some installs don't have stipple or Stipple. So, try them in turn.
1129(defvar stipple-pixmap 1113(defvar stipple-pixmap
@@ -1151,8 +1135,6 @@ this variable represents.")
1151 (t (:italic t :stipple ,stipple-pixmap)))) 1135 (t (:italic t :stipple ,stipple-pixmap))))
1152 "Face for highlighting even-numbered non-current differences in buffer A." 1136 "Face for highlighting even-numbered non-current differences in buffer A."
1153 :group 'ediff-highlighting) 1137 :group 'ediff-highlighting)
1154;; backward-compatibility alias
1155(put 'ediff-even-diff-face-A 'face-alias 'ediff-even-diff-A)
1156;; An internal variable. Ediff takes the face from here. When unhighlighting, 1138;; An internal variable. Ediff takes the face from here. When unhighlighting,
1157;; this variable is set to nil, then again to the appropriate face. 1139;; this variable is set to nil, then again to the appropriate face.
1158(defvar ediff-even-diff-face-A 'ediff-even-diff-A 1140(defvar ediff-even-diff-face-A 'ediff-even-diff-A
@@ -1160,7 +1142,7 @@ this variable represents.")
1160DO NOT CHANGE this variable. Instead, use the customization 1142DO NOT CHANGE this variable. Instead, use the customization
1161widget to customize the actual face object `ediff-even-diff-A' 1143widget to customize the actual face object `ediff-even-diff-A'
1162this variable represents.") 1144this variable represents.")
1163(ediff-hide-face 'ediff-even-diff-A) 1145(ediff-hide-face ediff-even-diff-face-A)
1164 1146
1165(defface ediff-even-diff-B 1147(defface ediff-even-diff-B
1166 (if ediff-emacs-p 1148 (if ediff-emacs-p
@@ -1174,8 +1156,6 @@ this variable represents.")
1174 (t (:italic t :stipple ,stipple-pixmap)))) 1156 (t (:italic t :stipple ,stipple-pixmap))))
1175 "Face for highlighting even-numbered non-current differences in buffer B." 1157 "Face for highlighting even-numbered non-current differences in buffer B."
1176 :group 'ediff-highlighting) 1158 :group 'ediff-highlighting)
1177;; backward-compatibility alias
1178(put 'ediff-even-diff-face-B 'face-alias 'ediff-even-diff-B)
1179;; An internal variable. Ediff takes the face from here. When unhighlighting, 1159;; An internal variable. Ediff takes the face from here. When unhighlighting,
1180;; this variable is set to nil, then again to the appropriate face. 1160;; this variable is set to nil, then again to the appropriate face.
1181(defvar ediff-even-diff-face-B 'ediff-even-diff-B 1161(defvar ediff-even-diff-face-B 'ediff-even-diff-B
@@ -1183,7 +1163,7 @@ this variable represents.")
1183DO NOT CHANGE this variable. Instead, use the customization 1163DO NOT CHANGE this variable. Instead, use the customization
1184widget to customize the actual face object `ediff-even-diff-B' 1164widget to customize the actual face object `ediff-even-diff-B'
1185this variable represents.") 1165this variable represents.")
1186(ediff-hide-face 'ediff-even-diff-B) 1166(ediff-hide-face ediff-even-diff-face-B)
1187 1167
1188(defface ediff-even-diff-C 1168(defface ediff-even-diff-C
1189 (if ediff-emacs-p 1169 (if ediff-emacs-p
@@ -1202,8 +1182,6 @@ this variable represents.")
1202 (t (:italic t :stipple ,stipple-pixmap)))) 1182 (t (:italic t :stipple ,stipple-pixmap))))
1203 "Face for highlighting even-numbered non-current differences in buffer C." 1183 "Face for highlighting even-numbered non-current differences in buffer C."
1204 :group 'ediff-highlighting) 1184 :group 'ediff-highlighting)
1205;; backward-compatibility alias
1206(put 'ediff-even-diff-face-C 'face-alias 'ediff-even-diff-C)
1207;; An internal variable. Ediff takes the face from here. When unhighlighting, 1185;; An internal variable. Ediff takes the face from here. When unhighlighting,
1208;; this variable is set to nil, then again to the appropriate face. 1186;; this variable is set to nil, then again to the appropriate face.
1209(defvar ediff-even-diff-face-C 'ediff-even-diff-C 1187(defvar ediff-even-diff-face-C 'ediff-even-diff-C
@@ -1211,7 +1189,7 @@ this variable represents.")
1211DO NOT CHANGE this variable. Instead, use the customization 1189DO NOT CHANGE this variable. Instead, use the customization
1212widget to customize the actual face object `ediff-even-diff-C' 1190widget to customize the actual face object `ediff-even-diff-C'
1213this variable represents.") 1191this variable represents.")
1214(ediff-hide-face 'ediff-even-diff-C) 1192(ediff-hide-face ediff-even-diff-face-C)
1215 1193
1216(defface ediff-even-diff-Ancestor 1194(defface ediff-even-diff-Ancestor
1217 (if ediff-emacs-p 1195 (if ediff-emacs-p
@@ -1230,8 +1208,6 @@ this variable represents.")
1230 (t (:italic t :stipple ,stipple-pixmap)))) 1208 (t (:italic t :stipple ,stipple-pixmap))))
1231 "Face for highlighting even-numbered non-current differences in the ancestor buffer." 1209 "Face for highlighting even-numbered non-current differences in the ancestor buffer."
1232 :group 'ediff-highlighting) 1210 :group 'ediff-highlighting)
1233;; backward-compatibility alias
1234(put 'ediff-even-diff-face-Ancestor 'face-alias 'ediff-even-diff-Ancestor)
1235;; An internal variable. Ediff takes the face from here. When unhighlighting, 1211;; An internal variable. Ediff takes the face from here. When unhighlighting,
1236;; this variable is set to nil, then again to the appropriate face. 1212;; this variable is set to nil, then again to the appropriate face.
1237(defvar ediff-even-diff-face-Ancestor 'ediff-even-diff-Ancestor 1213(defvar ediff-even-diff-face-Ancestor 'ediff-even-diff-Ancestor
@@ -1239,7 +1215,7 @@ this variable represents.")
1239DO NOT CHANGE this variable. Instead, use the customization 1215DO NOT CHANGE this variable. Instead, use the customization
1240widget to customize the actual face object `ediff-even-diff-Ancestor' 1216widget to customize the actual face object `ediff-even-diff-Ancestor'
1241this variable represents.") 1217this variable represents.")
1242(ediff-hide-face 'ediff-even-diff-Ancestor) 1218(ediff-hide-face ediff-even-diff-face-Ancestor)
1243 1219
1244;; Association between buffer types and even-diff-face symbols 1220;; Association between buffer types and even-diff-face symbols
1245(defconst ediff-even-diff-face-alist 1221(defconst ediff-even-diff-face-alist
@@ -1263,8 +1239,6 @@ this variable represents.")
1263 (t (:italic t :stipple "gray1")))) 1239 (t (:italic t :stipple "gray1"))))
1264 "Face for highlighting odd-numbered non-current differences in buffer A." 1240 "Face for highlighting odd-numbered non-current differences in buffer A."
1265 :group 'ediff-highlighting) 1241 :group 'ediff-highlighting)
1266;; backward-compatibility alias
1267(put 'ediff-odd-diff-face-A 'face-alias 'ediff-odd-diff-A)
1268;; An internal variable. Ediff takes the face from here. When unhighlighting, 1242;; An internal variable. Ediff takes the face from here. When unhighlighting,
1269;; this variable is set to nil, then again to the appropriate face. 1243;; this variable is set to nil, then again to the appropriate face.
1270(defvar ediff-odd-diff-face-A 'ediff-odd-diff-A 1244(defvar ediff-odd-diff-face-A 'ediff-odd-diff-A
@@ -1272,7 +1246,7 @@ this variable represents.")
1272DO NOT CHANGE this variable. Instead, use the customization 1246DO NOT CHANGE this variable. Instead, use the customization
1273widget to customize the actual face object `ediff-odd-diff-A' 1247widget to customize the actual face object `ediff-odd-diff-A'
1274this variable represents.") 1248this variable represents.")
1275(ediff-hide-face 'ediff-odd-diff-A) 1249(ediff-hide-face ediff-odd-diff-face-A)
1276 1250
1277 1251
1278(defface ediff-odd-diff-B 1252(defface ediff-odd-diff-B
@@ -1290,8 +1264,6 @@ this variable represents.")
1290 (t (:italic t :stipple "gray1")))) 1264 (t (:italic t :stipple "gray1"))))
1291 "Face for highlighting odd-numbered non-current differences in buffer B." 1265 "Face for highlighting odd-numbered non-current differences in buffer B."
1292 :group 'ediff-highlighting) 1266 :group 'ediff-highlighting)
1293;; backward-compatibility alias
1294(put 'ediff-odd-diff-face-B 'face-alias 'ediff-odd-diff-B)
1295;; An internal variable. Ediff takes the face from here. When unhighlighting, 1267;; An internal variable. Ediff takes the face from here. When unhighlighting,
1296;; this variable is set to nil, then again to the appropriate face. 1268;; this variable is set to nil, then again to the appropriate face.
1297(defvar ediff-odd-diff-face-B 'ediff-odd-diff-B 1269(defvar ediff-odd-diff-face-B 'ediff-odd-diff-B
@@ -1299,7 +1271,7 @@ this variable represents.")
1299DO NOT CHANGE this variable. Instead, use the customization 1271DO NOT CHANGE this variable. Instead, use the customization
1300widget to customize the actual face object `ediff-odd-diff-B' 1272widget to customize the actual face object `ediff-odd-diff-B'
1301this variable represents.") 1273this variable represents.")
1302(ediff-hide-face 'ediff-odd-diff-B) 1274(ediff-hide-face ediff-odd-diff-face-B)
1303 1275
1304(defface ediff-odd-diff-C 1276(defface ediff-odd-diff-C
1305 (if ediff-emacs-p 1277 (if ediff-emacs-p
@@ -1316,8 +1288,6 @@ this variable represents.")
1316 (t (:italic t :stipple "gray1")))) 1288 (t (:italic t :stipple "gray1"))))
1317 "Face for highlighting odd-numbered non-current differences in buffer C." 1289 "Face for highlighting odd-numbered non-current differences in buffer C."
1318 :group 'ediff-highlighting) 1290 :group 'ediff-highlighting)
1319;; backward-compatibility alias
1320(put 'ediff-odd-diff-face-C 'face-alias 'ediff-odd-diff-C)
1321;; An internal variable. Ediff takes the face from here. When unhighlighting, 1291;; An internal variable. Ediff takes the face from here. When unhighlighting,
1322;; this variable is set to nil, then again to the appropriate face. 1292;; this variable is set to nil, then again to the appropriate face.
1323(defvar ediff-odd-diff-face-C 'ediff-odd-diff-C 1293(defvar ediff-odd-diff-face-C 'ediff-odd-diff-C
@@ -1325,7 +1295,7 @@ this variable represents.")
1325DO NOT CHANGE this variable. Instead, use the customization 1295DO NOT CHANGE this variable. Instead, use the customization
1326widget to customize the actual face object `ediff-odd-diff-C' 1296widget to customize the actual face object `ediff-odd-diff-C'
1327this variable represents.") 1297this variable represents.")
1328(ediff-hide-face 'ediff-odd-diff-C) 1298(ediff-hide-face ediff-odd-diff-face-C)
1329 1299
1330(defface ediff-odd-diff-Ancestor 1300(defface ediff-odd-diff-Ancestor
1331 (if ediff-emacs-p 1301 (if ediff-emacs-p
@@ -1339,8 +1309,6 @@ this variable represents.")
1339 (t (:italic t :stipple "gray1")))) 1309 (t (:italic t :stipple "gray1"))))
1340 "Face for highlighting odd-numbered non-current differences in the ancestor buffer." 1310 "Face for highlighting odd-numbered non-current differences in the ancestor buffer."
1341 :group 'ediff-highlighting) 1311 :group 'ediff-highlighting)
1342;; backward-compatibility alias
1343(put 'ediff-odd-diff-face-Ancestor 'face-alias 'ediff-odd-diff-Ancestor)
1344;; An internal variable. Ediff takes the face from here. When unhighlighting, 1312;; An internal variable. Ediff takes the face from here. When unhighlighting,
1345;; this variable is set to nil, then again to the appropriate face. 1313;; this variable is set to nil, then again to the appropriate face.
1346(defvar ediff-odd-diff-face-Ancestor 'ediff-odd-diff-Ancestor 1314(defvar ediff-odd-diff-face-Ancestor 'ediff-odd-diff-Ancestor
@@ -1348,30 +1316,30 @@ this variable represents.")
1348DO NOT CHANGE this variable. Instead, use the customization 1316DO NOT CHANGE this variable. Instead, use the customization
1349widget to customize the actual face object `ediff-odd-diff-Ancestor' 1317widget to customize the actual face object `ediff-odd-diff-Ancestor'
1350this variable represents.") 1318this variable represents.")
1351(ediff-hide-face 'ediff-odd-diff-Ancestor) 1319(ediff-hide-face ediff-odd-diff-face-Ancestor)
1352 1320
1353;; Association between buffer types and odd-diff-face symbols 1321;; Association between buffer types and odd-diff-face symbols
1354(defconst ediff-odd-diff-face-alist 1322(defconst ediff-odd-diff-face-alist
1355 '((A . ediff-odd-diff-face-A) 1323 '((A . ediff-odd-diff-A)
1356 (B . ediff-odd-diff-face-B) 1324 (B . ediff-odd-diff-B)
1357 (C . ediff-odd-diff-face-C) 1325 (C . ediff-odd-diff-C)
1358 (Ancestor . ediff-odd-diff-face-Ancestor))) 1326 (Ancestor . ediff-odd-diff-Ancestor)))
1359 1327
1360;; A-list of fine-diff face symbols associated with buffer types 1328;; A-list of fine-diff face symbols associated with buffer types
1361(defconst ediff-fine-diff-face-alist 1329(defconst ediff-fine-diff-face-alist
1362 '((A . ediff-fine-diff-face-A) 1330 '((A . ediff-fine-diff-A)
1363 (B . ediff-fine-diff-face-B) 1331 (B . ediff-fine-diff-B)
1364 (C . ediff-fine-diff-face-C) 1332 (C . ediff-fine-diff-C)
1365 (Ancestor . ediff-fine-diff-face-Ancestor))) 1333 (Ancestor . ediff-fine-diff-Ancestor)))
1366 1334
1367;; Help echo 1335;; Help echo
1368(put 'ediff-fine-diff-A 'ediff-help-echo 1336(put ediff-fine-diff-face-A 'ediff-help-echo
1369 "A `refinement' of the current difference region") 1337 "A `refinement' of the current difference region")
1370(put 'ediff-fine-diff-B 'ediff-help-echo 1338(put ediff-fine-diff-face-B 'ediff-help-echo
1371 "A `refinement' of the current difference region") 1339 "A `refinement' of the current difference region")
1372(put 'ediff-fine-diff-C 'ediff-help-echo 1340(put ediff-fine-diff-face-C 'ediff-help-echo
1373 "A `refinement' of the current difference region") 1341 "A `refinement' of the current difference region")
1374(put 'ediff-fine-diff-Ancestor 'ediff-help-echo 1342(put ediff-fine-diff-face-Ancestor 'ediff-help-echo
1375 "A `refinement' of the current difference region") 1343 "A `refinement' of the current difference region")
1376 1344
1377(add-hook 'ediff-quit-hook 'ediff-cleanup-mess) 1345(add-hook 'ediff-quit-hook 'ediff-cleanup-mess)
@@ -1899,6 +1867,8 @@ Unless optional argument INPLACE is non-nil, return a new string."
1899 (set-buffer ,old-buffer) 1867 (set-buffer ,old-buffer)
1900 (set-syntax-table ,old-table))))))) 1868 (set-syntax-table ,old-table)))))))
1901 1869
1870(provide 'ediff-init)
1871
1902 1872
1903 1873
1904;;; Local Variables: 1874;;; Local Variables:
@@ -1907,7 +1877,5 @@ Unless optional argument INPLACE is non-nil, return a new string."
1907;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body)) 1877;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
1908;;; End: 1878;;; End:
1909 1879
1910(provide 'ediff-init)
1911
1912;;; arch-tag: fa31d384-1e70-4d4b-82a7-3e96307c46f5 1880;;; arch-tag: fa31d384-1e70-4d4b-82a7-3e96307c46f5
1913;;; ediff-init.el ends here 1881;;; ediff-init.el ends here
diff --git a/lisp/ediff-mult.el b/lisp/ediff-mult.el
index c7ad411b4ac..1303d65cf2e 100644
--- a/lisp/ediff-mult.el
+++ b/lisp/ediff-mult.el
@@ -205,6 +205,12 @@ Should be a sexp. For instance (car ediff-filtering-regexp-history) or nil."
205This can be toggled with `ediff-toggle-filename-truncation'." 205This can be toggled with `ediff-toggle-filename-truncation'."
206 :type 'boolean 206 :type 'boolean
207 :group 'ediff-mult) 207 :group 'ediff-mult)
208
209(defcustom ediff-meta-mode-hook nil
210 "*Hooks run just after setting up meta mode."
211 :type 'hook
212 :group 'ediff-mult)
213
208(defcustom ediff-registry-setup-hook nil 214(defcustom ediff-registry-setup-hook nil
209 "*Hooks run just after the registry control panel is set up." 215 "*Hooks run just after the registry control panel is set up."
210 :type 'hook 216 :type 'hook
@@ -411,7 +417,8 @@ Commands:
411 (kill-all-local-variables) 417 (kill-all-local-variables)
412 (setq major-mode 'ediff-meta-mode) 418 (setq major-mode 'ediff-meta-mode)
413 (setq mode-name "MetaEdiff") 419 (setq mode-name "MetaEdiff")
414 (run-mode-hooks 'ediff-meta-mode-hook)) 420 ;; don't use run-mode-hooks here!
421 (run-hooks 'ediff-meta-mode-hook))
415 422
416 423
417;; the keymap for the buffer showing directory differences 424;; the keymap for the buffer showing directory differences
diff --git a/lisp/ediff-ptch.el b/lisp/ediff-ptch.el
index 45b214c0cb3..9176a38c2c9 100644
--- a/lisp/ediff-ptch.el
+++ b/lisp/ediff-ptch.el
@@ -163,7 +163,7 @@ program."
163;; returns /dev/null, if can't strip prefix 163;; returns /dev/null, if can't strip prefix
164(defsubst ediff-file-name-sans-prefix (filename prefix) 164(defsubst ediff-file-name-sans-prefix (filename prefix)
165 (save-match-data 165 (save-match-data
166 (if (string-match (concat "^" prefix) filename) 166 (if (string-match (concat "^" (regexp-quote prefix)) filename)
167 (substring filename (match-end 0)) 167 (substring filename (match-end 0))
168 (concat "/null/" filename)))) 168 (concat "/null/" filename))))
169 169
diff --git a/lisp/ediff-util.el b/lisp/ediff-util.el
index 9434601326c..70b3f304e03 100644
--- a/lisp/ediff-util.el
+++ b/lisp/ediff-util.el
@@ -117,7 +117,13 @@ Commands:
117 (kill-all-local-variables) 117 (kill-all-local-variables)
118 (setq major-mode 'ediff-mode) 118 (setq major-mode 'ediff-mode)
119 (setq mode-name "Ediff") 119 (setq mode-name "Ediff")
120 (run-mode-hooks 'ediff-mode-hook)) 120 ;; We use run-hooks instead of run-mode-hooks for two reasons.
121 ;; The ediff control buffer is read-only and it is not supposed to be
122 ;; modified by minor modes and such. So, run-mode-hooks doesn't do anything
123 ;; useful here on top of what run-hooks does.
124 ;; Second, changing run-hooks to run-mode-hooks would require an
125 ;; if-statement, since XEmacs doesn't have this.
126 (run-hooks 'ediff-mode-hook))
121 127
122 128
123 129
@@ -3788,9 +3794,8 @@ Ediff Control Panel to restore highlighting."
3788 type ediff-current-diff-overlay-alist)) 3794 type ediff-current-diff-overlay-alist))
3789 (buffer (ediff-get-buffer type)) 3795 (buffer (ediff-get-buffer type))
3790 (face (face-name 3796 (face (face-name
3791 (symbol-value 3797 (ediff-get-symbol-from-alist
3792 (ediff-get-symbol-from-alist 3798 type ediff-current-diff-face-alist))))
3793 type ediff-current-diff-face-alist)))))
3794 (set overlay 3799 (set overlay
3795 (ediff-make-bullet-proof-overlay (point-max) (point-max) buffer)) 3800 (ediff-make-bullet-proof-overlay (point-max) (point-max) buffer))
3796 (ediff-set-overlay-face (symbol-value overlay) face) 3801 (ediff-set-overlay-face (symbol-value overlay) face)
diff --git a/lisp/ediff-vers.el b/lisp/ediff-vers.el
index 653f4017cad..70069cc2193 100644
--- a/lisp/ediff-vers.el
+++ b/lisp/ediff-vers.el
@@ -304,13 +304,14 @@
304 (if (stringp tmp-file) (delete-file tmp-file)) 304 (if (stringp tmp-file) (delete-file tmp-file))
305 (if (stringp ancestor-file) (delete-file ancestor-file)))) 305 (if (stringp ancestor-file) (delete-file ancestor-file))))
306 306
307
308(provide 'ediff-vers)
309
307;;; Local Variables: 310;;; Local Variables:
308;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) 311;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
309;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) 312;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
310;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body)) 313;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
311;;; End: 314;;; End:
312 315
313(provide 'ediff-vers)
314
315;;; arch-tag: bbb34f0c-2a90-426a-a77a-c75f479ebbbf 316;;; arch-tag: bbb34f0c-2a90-426a-a77a-c75f479ebbbf
316;;; ediff-vers.el ends here 317;;; ediff-vers.el ends here
diff --git a/lisp/ediff.el b/lisp/ediff.el
index 46b060e29ae..f842e9dec6c 100644
--- a/lisp/ediff.el
+++ b/lisp/ediff.el
@@ -7,7 +7,7 @@
7;; Keywords: comparing, merging, patching, tools, unix 7;; Keywords: comparing, merging, patching, tools, unix
8 8
9(defconst ediff-version "2.80" "The current version of Ediff") 9(defconst ediff-version "2.80" "The current version of Ediff")
10(defconst ediff-date "June 3, 2005" "Date of last update") 10(defconst ediff-date "July 8, 2005" "Date of last update")
11 11
12 12
13;; This file is part of GNU Emacs. 13;; This file is part of GNU Emacs.
@@ -1526,15 +1526,15 @@ With optional NODE, goes to that node."
1526 (add-to-list 'debug-ignored-errors mess)) 1526 (add-to-list 'debug-ignored-errors mess))
1527 1527
1528 1528
1529(require 'ediff-util)
1530
1531(run-hooks 'ediff-load-hook)
1532
1529;;; Local Variables: 1533;;; Local Variables:
1530;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun) 1534;;; eval: (put 'ediff-defvar-local 'lisp-indent-hook 'defun)
1531;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1) 1535;;; eval: (put 'ediff-with-current-buffer 'lisp-indent-hook 1)
1532;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body)) 1536;;; eval: (put 'ediff-with-current-buffer 'edebug-form-spec '(form body))
1533;;; End: 1537;;; End:
1534 1538
1535(require 'ediff-util)
1536
1537(run-hooks 'ediff-load-hook)
1538
1539;;; arch-tag: 97c71396-db02-4f41-8b48-6a51c3348fcc 1539;;; arch-tag: 97c71396-db02-4f41-8b48-6a51c3348fcc
1540;;; ediff.el ends here 1540;;; ediff.el ends here
diff --git a/lisp/elide-head.el b/lisp/elide-head.el
index f47e9e871ea..86e3365c5dd 100644
--- a/lisp/elide-head.el
+++ b/lisp/elide-head.el
@@ -53,9 +53,9 @@
53 53
54(defcustom elide-head-headers-to-hide 54(defcustom elide-head-headers-to-hide
55 '(("is free software; you can redistribute it" . ; GNU boilerplate 55 '(("is free software; you can redistribute it" . ; GNU boilerplate
56 "Boston, MA 02111-1307, USA\\.") 56 "Boston, MA 0211\\(1-1307\\|0-1301\\), USA\\.")
57 ("The Regents of the University of California\\. All rights reserved\\." . 57 ("The Regents of the University of California\\. All rights reserved\\." .
58 "SUCH DAMAGE\\.") ; BSD 58 "SUCH DAMAGE\\.") ; BSD
59 ("Permission is hereby granted, free of charge" . ; X11 59 ("Permission is hereby granted, free of charge" . ; X11
60 "authorization from the X Consortium\\.")) 60 "authorization from the X Consortium\\."))
61 "Alist of regexps defining start end end of text to elide. 61 "Alist of regexps defining start end end of text to elide.
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 05e97a7485f..6aff16143b3 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -3353,11 +3353,14 @@ That command is designed for interactive use only" fn))
3353 3353
3354(defmacro byte-compile-maybe-guarded (condition &rest body) 3354(defmacro byte-compile-maybe-guarded (condition &rest body)
3355 "Execute forms in BODY, potentially guarded by CONDITION. 3355 "Execute forms in BODY, potentially guarded by CONDITION.
3356CONDITION is the test in an `if' form or in a `cond' clause. 3356CONDITION is a variable whose value is a test in an `if' or `cond'.
3357BODY is to compile the first arm of the if or the body of the 3357BODY is the code to compile first arm of the if or the body of the
3358cond clause. If CONDITION is of the form `(foundp 'foo)' 3358cond clause. If CONDITION's value is of the form `(foundp 'foo)'
3359or `(boundp 'foo)', the relevant warnings from BODY about foo 3359or `(boundp 'foo)', the relevant warnings from BODY about foo
3360being undefined will be suppressed." 3360being undefined will be suppressed.
3361
3362If CONDITION's value is `(featurep 'xemacs)', that suppresses all
3363warnings during execution of BODY."
3361 (declare (indent 1) (debug t)) 3364 (declare (indent 1) (debug t))
3362 `(let* ((fbound 3365 `(let* ((fbound
3363 (if (eq 'fboundp (car-safe ,condition)) 3366 (if (eq 'fboundp (car-safe ,condition))
@@ -3375,13 +3378,17 @@ being undefined will be suppressed."
3375 (byte-compile-bound-variables 3378 (byte-compile-bound-variables
3376 (if bound 3379 (if bound
3377 (cons bound byte-compile-bound-variables) 3380 (cons bound byte-compile-bound-variables)
3378 byte-compile-bound-variables))) 3381 byte-compile-bound-variables))
3379 (progn ,@body) 3382 (byte-compile-warnings
3380 ;; Maybe remove the function symbol from the unresolved list. 3383 (if (equal ,condition '(featurep 'xemacs))
3381 (if fbound 3384 nil byte-compile-warnings)))
3382 (setq byte-compile-unresolved-functions 3385 (unwind-protect
3383 (delq (assq fbound byte-compile-unresolved-functions) 3386 (progn ,@body)
3384 byte-compile-unresolved-functions))))) 3387 ;; Maybe remove the function symbol from the unresolved list.
3388 (if fbound
3389 (setq byte-compile-unresolved-functions
3390 (delq (assq fbound byte-compile-unresolved-functions)
3391 byte-compile-unresolved-functions))))))
3385 3392
3386(defun byte-compile-if (form) 3393(defun byte-compile-if (form)
3387 (byte-compile-form (car (cdr form))) 3394 (byte-compile-form (car (cdr form)))
@@ -3422,12 +3429,12 @@ being undefined will be suppressed."
3422 (if (null (cdr clause)) 3429 (if (null (cdr clause))
3423 ;; First clause is a singleton. 3430 ;; First clause is a singleton.
3424 (byte-compile-goto-if t for-effect donetag) 3431 (byte-compile-goto-if t for-effect donetag)
3425 (setq nexttag (byte-compile-make-tag)) 3432 (setq nexttag (byte-compile-make-tag))
3426 (byte-compile-goto 'byte-goto-if-nil nexttag) 3433 (byte-compile-goto 'byte-goto-if-nil nexttag)
3427 (byte-compile-maybe-guarded (car clause) 3434 (byte-compile-maybe-guarded (car clause)
3428 (byte-compile-body (cdr clause) for-effect)) 3435 (byte-compile-body (cdr clause) for-effect))
3429 (byte-compile-goto 'byte-goto donetag) 3436 (byte-compile-goto 'byte-goto donetag)
3430 (byte-compile-out-tag nexttag))))) 3437 (byte-compile-out-tag nexttag)))))
3431 ;; Last clause 3438 ;; Last clause
3432 (let ((guard (car clause))) 3439 (let ((guard (car clause)))
3433 (and (cdr clause) (not (eq guard t)) 3440 (and (cdr clause) (not (eq guard t))
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el
index 6562f04ca1d..6534af050f3 100644
--- a/lisp/emacs-lisp/checkdoc.el
+++ b/lisp/emacs-lisp/checkdoc.el
@@ -317,12 +317,12 @@ This should be set in an Emacs Lisp file's local variables."
317 "List of words (not capitalized) which should be capitalized.") 317 "List of words (not capitalized) which should be capitalized.")
318 318
319(defvar checkdoc-proper-noun-regexp 319(defvar checkdoc-proper-noun-regexp
320 (let ((expr "\\<\\(") 320 (let ((expr "\\_<\\(")
321 (l checkdoc-proper-noun-list)) 321 (l checkdoc-proper-noun-list))
322 (while l 322 (while l
323 (setq expr (concat expr (car l) (if (cdr l) "\\|" "")) 323 (setq expr (concat expr (car l) (if (cdr l) "\\|" ""))
324 l (cdr l))) 324 l (cdr l)))
325 (concat expr "\\)\\>")) 325 (concat expr "\\)\\_>"))
326 "Regular expression derived from `checkdoc-proper-noun-regexp'.") 326 "Regular expression derived from `checkdoc-proper-noun-regexp'.")
327 327
328(defvar checkdoc-common-verbs-regexp nil 328(defvar checkdoc-common-verbs-regexp nil
@@ -2326,10 +2326,10 @@ Code:, and others referenced in the style guide."
2326 (save-excursion 2326 (save-excursion
2327 (goto-char (point-max)) 2327 (goto-char (point-max))
2328 (if (not (re-search-backward 2328 (if (not (re-search-backward
2329 (concat "^;;;[ \t]+" fn "\\(" (regexp-quote fe) 2329 (concat "^;;;[ \t]+" (regexp-quote fn) "\\(" (regexp-quote fe)
2330 "\\)?[ \t]+ends here[ \t]*$" 2330 "\\)?[ \t]+ends here[ \t]*$"
2331 "\\|^;;;[ \t]+ End of file[ \t]+" 2331 "\\|^;;;[ \t]+ End of file[ \t]+"
2332 fn "\\(" (regexp-quote fe) "\\)?") 2332 (regexp-quote fn) "\\(" (regexp-quote fe) "\\)?")
2333 nil t)) 2333 nil t))
2334 (if (checkdoc-y-or-n-p "No identifiable footer! Add one? ") 2334 (if (checkdoc-y-or-n-p "No identifiable footer! Add one? ")
2335 (progn 2335 (progn
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 94cca83a61d..4f968c60b5e 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -150,7 +150,8 @@ first will be printed into the backtrace buffer."
150 (debugger-outer-standard-input standard-input) 150 (debugger-outer-standard-input standard-input)
151 (debugger-outer-standard-output standard-output) 151 (debugger-outer-standard-output standard-output)
152 (debugger-outer-inhibit-redisplay inhibit-redisplay) 152 (debugger-outer-inhibit-redisplay inhibit-redisplay)
153 (debugger-outer-cursor-in-echo-area cursor-in-echo-area)) 153 (debugger-outer-cursor-in-echo-area cursor-in-echo-area)
154 (debugger-with-timeout-suspend (with-timeout-suspend)))
154 ;; Set this instead of binding it, so that `q' 155 ;; Set this instead of binding it, so that `q'
155 ;; will not restore it. 156 ;; will not restore it.
156 (setq overriding-terminal-local-map nil) 157 (setq overriding-terminal-local-map nil)
@@ -235,6 +236,7 @@ first will be printed into the backtrace buffer."
235 ;; Drew Adams. --Stef 236 ;; Drew Adams. --Stef
236 (quit-window)))) 237 (quit-window))))
237 (kill-buffer debugger-buffer)) 238 (kill-buffer debugger-buffer))
239 (with-timeout-unsuspend debugger-with-timeout-suspend)
238 (set-match-data debugger-outer-match-data))) 240 (set-match-data debugger-outer-match-data)))
239 ;; Put into effect the modified values of these variables 241 ;; Put into effect the modified values of these variables
240 ;; in case the user set them with the `e' command. 242 ;; in case the user set them with the `e' command.
@@ -312,11 +314,17 @@ That buffer should be current already."
312 ;; After any frame that uses eval-buffer, 314 ;; After any frame that uses eval-buffer,
313 ;; insert a line that states the buffer position it's reading at. 315 ;; insert a line that states the buffer position it's reading at.
314 (save-excursion 316 (save-excursion
315 (while (re-search-forward "^ eval-buffer(" nil t) 317 (let ((tem eval-buffer-list))
316 (end-of-line) 318 (while (and tem
317 (insert (format "\n ;;; Reading at buffer position %d" 319 (re-search-forward "^ eval-\\(buffer\\|region\\)(" nil t))
318 (with-current-buffer (nth 2 (backtrace-frame (debugger-frame-number))) 320 (end-of-line)
319 (point)))))) 321 (insert (format " ; Reading at buffer position %d"
322 ;; This will get the wrong result
323 ;; if there are two nested eval-region calls
324 ;; for the same buffer. That's not a very useful case.
325 (with-current-buffer (car tem)
326 (point))))
327 (pop tem))))
320 (debugger-make-xrefs)) 328 (debugger-make-xrefs))
321 329
322(defun debugger-make-xrefs (&optional buffer) 330(defun debugger-make-xrefs (&optional buffer)
@@ -591,10 +599,35 @@ Applies to the frame whose line point is on in the backtrace."
591 (define-key map "e" 'debugger-eval-expression) 599 (define-key map "e" 'debugger-eval-expression)
592 (define-key map " " 'next-line) 600 (define-key map " " 'next-line)
593 (define-key map "R" 'debugger-record-expression) 601 (define-key map "R" 'debugger-record-expression)
594 (define-key map "\C-m" 'help-follow) 602 (define-key map "\C-m" 'debug-help-follow)
595 (define-key map [mouse-2] 'push-button) 603 (define-key map [mouse-2] 'push-button)
596 map)) 604 map))
597 605
606(put 'debugger-mode 'mode-class 'special)
607
608(defun debugger-mode ()
609 "Mode for backtrace buffers, selected in debugger.
610\\<debugger-mode-map>
611A line starts with `*' if exiting that frame will call the debugger.
612Type \\[debugger-frame] or \\[debugger-frame-clear] to set or remove the `*'.
613
614When in debugger due to frame being exited,
615use the \\[debugger-return-value] command to override the value
616being returned from that frame.
617
618Use \\[debug-on-entry] and \\[cancel-debug-on-entry] to control
619which functions will enter the debugger when called.
620
621Complete list of commands:
622\\{debugger-mode-map}"
623 (kill-all-local-variables)
624 (setq major-mode 'debugger-mode)
625 (setq mode-name "Debugger")
626 (setq truncate-lines t)
627 (set-syntax-table emacs-lisp-mode-syntax-table)
628 (use-local-map debugger-mode-map)
629 (run-mode-hooks 'debugger-mode-hook))
630
598(defcustom debugger-record-buffer "*Debugger-record*" 631(defcustom debugger-record-buffer "*Debugger-record*"
599 "*Buffer name for expression values, for \\[debugger-record-expression]." 632 "*Buffer name for expression values, for \\[debugger-record-expression]."
600 :type 'string 633 :type 'string
@@ -620,30 +653,26 @@ Applies to the frame whose line point is on in the backtrace."
620 (buffer-substring (line-beginning-position 0) 653 (buffer-substring (line-beginning-position 0)
621 (line-end-position 0))))) 654 (line-end-position 0)))))
622 655
623(put 'debugger-mode 'mode-class 'special) 656(defun debug-help-follow (&optional pos)
624 657 "Follow cross-reference at POS, defaulting to point.
625(defun debugger-mode ()
626 "Mode for backtrace buffers, selected in debugger.
627\\<debugger-mode-map>
628A line starts with `*' if exiting that frame will call the debugger.
629Type \\[debugger-frame] or \\[debugger-frame-clear] to set or remove the `*'.
630 658
631When in debugger due to frame being exited, 659For the cross-reference format, see `help-make-xrefs'."
632use the \\[debugger-return-value] command to override the value 660 (interactive "d")
633being returned from that frame. 661 (require 'help-mode)
634 662 (unless pos
635Use \\[debug-on-entry] and \\[cancel-debug-on-entry] to control 663 (setq pos (point)))
636which functions will enter the debugger when called. 664 (unless (push-button pos)
637 665 ;; check if the symbol under point is a function or variable
638Complete list of commands: 666 (let ((sym
639\\{debugger-mode-map}" 667 (intern
640 (kill-all-local-variables) 668 (save-excursion
641 (setq major-mode 'debugger-mode) 669 (goto-char pos) (skip-syntax-backward "w_")
642 (setq mode-name "Debugger") 670 (buffer-substring (point)
643 (setq truncate-lines t) 671 (progn (skip-syntax-forward "w_")
644 (set-syntax-table emacs-lisp-mode-syntax-table) 672 (point)))))))
645 (use-local-map debugger-mode-map) 673 (when (or (boundp sym) (fboundp sym) (facep sym))
646 (run-mode-hooks 'debugger-mode-hook)) 674 (switch-to-buffer-other-window (generate-new-buffer "*Help*"))
675 (help-do-xref pos #'help-xref-interned (list sym))))))
647 676
648;; When you change this, you may also need to change the number of 677;; When you change this, you may also need to change the number of
649;; frames that the debugger skips. 678;; frames that the debugger skips.
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 4c232b2882c..3b4662277b6 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -142,6 +142,7 @@ For example, you could write
142 (let* ((mode-name (symbol-name mode)) 142 (let* ((mode-name (symbol-name mode))
143 (pretty-name (easy-mmode-pretty-mode-name mode lighter)) 143 (pretty-name (easy-mmode-pretty-mode-name mode lighter))
144 (globalp nil) 144 (globalp nil)
145 (initialize nil)
145 (group nil) 146 (group nil)
146 (extra-args nil) 147 (extra-args nil)
147 (extra-keywords nil) 148 (extra-keywords nil)
@@ -159,6 +160,7 @@ For example, you could write
159 (:lighter (setq lighter (pop body))) 160 (:lighter (setq lighter (pop body)))
160 (:global (setq globalp (pop body))) 161 (:global (setq globalp (pop body)))
161 (:extra-args (setq extra-args (pop body))) 162 (:extra-args (setq extra-args (pop body)))
163 (:initialize (setq initialize (list :initialize (pop body))))
162 (:group (setq group (nconc group (list :group (pop body))))) 164 (:group (setq group (nconc group (list :group (pop body)))))
163 (:require (setq require (pop body))) 165 (:require (setq require (pop body)))
164 (:keymap (setq keymap (pop body))) 166 (:keymap (setq keymap (pop body)))
@@ -167,6 +169,10 @@ For example, you could write
167 (setq keymap-sym (if (and keymap (symbolp keymap)) keymap 169 (setq keymap-sym (if (and keymap (symbolp keymap)) keymap
168 (intern (concat mode-name "-map")))) 170 (intern (concat mode-name "-map"))))
169 171
172 (unless initialize
173 (setq initialize
174 '(:initialize 'custom-initialize-default)))
175
170 (unless group 176 (unless group
171 ;; We might as well provide a best-guess default group. 177 ;; We might as well provide a best-guess default group.
172 (setq group 178 (setq group
@@ -196,7 +202,7 @@ See the command `%s' for a description of this minor-mode."))
196 `(defcustom ,mode ,init-value 202 `(defcustom ,mode ,init-value
197 ,(format base-doc-string pretty-name mode mode) 203 ,(format base-doc-string pretty-name mode mode)
198 :set 'custom-set-minor-mode 204 :set 'custom-set-minor-mode
199 :initialize 'custom-initialize-default 205 ,@initialize
200 ,@group 206 ,@group
201 :type 'boolean 207 :type 'boolean
202 ,@(cond 208 ,@(cond
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index fe0453519df..1a592709819 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -2374,18 +2374,19 @@ MSG is printed after `::::} '."
2374 2374
2375 2375
2376(defun edebug-slow-before (edebug-before-index) 2376(defun edebug-slow-before (edebug-before-index)
2377 ;; Debug current function given BEFORE position. 2377 (unless edebug-active
2378 ;; Called from functions compiled with edebug-eval-top-level-form. 2378 ;; Debug current function given BEFORE position.
2379 ;; Return the before index. 2379 ;; Called from functions compiled with edebug-eval-top-level-form.
2380 (setcar edebug-offset-indices edebug-before-index) 2380 ;; Return the before index.
2381 2381 (setcar edebug-offset-indices edebug-before-index)
2382 ;; Increment frequency count 2382
2383 (aset edebug-freq-count edebug-before-index 2383 ;; Increment frequency count
2384 (1+ (aref edebug-freq-count edebug-before-index))) 2384 (aset edebug-freq-count edebug-before-index
2385 2385 (1+ (aref edebug-freq-count edebug-before-index)))
2386 (if (or (not (memq edebug-execution-mode '(Go-nonstop next))) 2386
2387 (edebug-input-pending-p)) 2387 (if (or (not (memq edebug-execution-mode '(Go-nonstop next)))
2388 (edebug-debugger edebug-before-index 'before nil)) 2388 (edebug-input-pending-p))
2389 (edebug-debugger edebug-before-index 'before nil)))
2389 edebug-before-index) 2390 edebug-before-index)
2390 2391
2391(defun edebug-fast-before (edebug-before-index) 2392(defun edebug-fast-before (edebug-before-index)
@@ -2393,22 +2394,24 @@ MSG is printed after `::::} '."
2393 ) 2394 )
2394 2395
2395(defun edebug-slow-after (edebug-before-index edebug-after-index edebug-value) 2396(defun edebug-slow-after (edebug-before-index edebug-after-index edebug-value)
2396 ;; Debug current function given AFTER position and VALUE. 2397 (if edebug-active
2397 ;; Called from functions compiled with edebug-eval-top-level-form.
2398 ;; Return VALUE.
2399 (setcar edebug-offset-indices edebug-after-index)
2400
2401 ;; Increment frequency count
2402 (aset edebug-freq-count edebug-after-index
2403 (1+ (aref edebug-freq-count edebug-after-index)))
2404 (if edebug-test-coverage (edebug-update-coverage))
2405
2406 (if (and (eq edebug-execution-mode 'Go-nonstop)
2407 (not (edebug-input-pending-p)))
2408 ;; Just return result.
2409 edebug-value 2398 edebug-value
2410 (edebug-debugger edebug-after-index 'after edebug-value) 2399 ;; Debug current function given AFTER position and VALUE.
2411 )) 2400 ;; Called from functions compiled with edebug-eval-top-level-form.
2401 ;; Return VALUE.
2402 (setcar edebug-offset-indices edebug-after-index)
2403
2404 ;; Increment frequency count
2405 (aset edebug-freq-count edebug-after-index
2406 (1+ (aref edebug-freq-count edebug-after-index)))
2407 (if edebug-test-coverage (edebug-update-coverage))
2408
2409 (if (and (eq edebug-execution-mode 'Go-nonstop)
2410 (not (edebug-input-pending-p)))
2411 ;; Just return result.
2412 edebug-value
2413 (edebug-debugger edebug-after-index 'after edebug-value)
2414 )))
2412 2415
2413(defun edebug-fast-after (edebug-before-index edebug-after-index edebug-value) 2416(defun edebug-fast-after (edebug-before-index edebug-after-index edebug-value)
2414 ;; Do nothing but return the value. 2417 ;; Do nothing but return the value.
@@ -2533,6 +2536,7 @@ MSG is printed after `::::} '."
2533 ;; Uses local variables of edebug-enter, edebug-before, edebug-after 2536 ;; Uses local variables of edebug-enter, edebug-before, edebug-after
2534 ;; and edebug-debugger. 2537 ;; and edebug-debugger.
2535 (let ((edebug-active t) ; for minor mode alist 2538 (let ((edebug-active t) ; for minor mode alist
2539 (edebug-with-timeout-suspend (with-timeout-suspend))
2536 edebug-stop ; should we enter recursive-edit 2540 edebug-stop ; should we enter recursive-edit
2537 (edebug-point (+ edebug-def-mark 2541 (edebug-point (+ edebug-def-mark
2538 (aref (nth 2 edebug-data) edebug-offset-index))) 2542 (aref (nth 2 edebug-data) edebug-offset-index)))
@@ -2759,6 +2763,7 @@ MSG is printed after `::::} '."
2759 (set-buffer current-buffer)) 2763 (set-buffer current-buffer))
2760 ;; ... nothing more. 2764 ;; ... nothing more.
2761 ) 2765 )
2766 (with-timeout-unsuspend edebug-with-timeout-suspend)
2762 ;; Reset global variables to outside values in case they were changed. 2767 ;; Reset global variables to outside values in case they were changed.
2763 (setq 2768 (setq
2764 overlay-arrow-position edebug-outside-o-a-p 2769 overlay-arrow-position edebug-outside-o-a-p
diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el
index e207766701c..27f14a6d3ad 100644
--- a/lisp/emacs-lisp/timer.el
+++ b/lisp/emacs-lisp/timer.el
@@ -404,6 +404,9 @@ This function returns a timer object which you can use in `cancel-timer'."
404 404
405;;;###autoload (put 'with-timeout 'lisp-indent-function 1) 405;;;###autoload (put 'with-timeout 'lisp-indent-function 1)
406 406
407(defvar with-timeout-timers nil
408 "List of all timers used by currently pending `with-timeout' calls.")
409
407;;;###autoload 410;;;###autoload
408(defmacro with-timeout (list &rest body) 411(defmacro with-timeout (list &rest body)
409 "Run BODY, but if it doesn't finish in SECONDS seconds, give up. 412 "Run BODY, but if it doesn't finish in SECONDS seconds, give up.
@@ -416,19 +419,46 @@ be detected.
416 (let ((seconds (car list)) 419 (let ((seconds (car list))
417 (timeout-forms (cdr list))) 420 (timeout-forms (cdr list)))
418 `(let ((with-timeout-tag (cons nil nil)) 421 `(let ((with-timeout-tag (cons nil nil))
419 with-timeout-value with-timeout-timer) 422 with-timeout-value with-timeout-timer
423 (with-timeout-timers with-timeout-timers))
420 (if (catch with-timeout-tag 424 (if (catch with-timeout-tag
421 (progn 425 (progn
422 (setq with-timeout-timer 426 (setq with-timeout-timer
423 (run-with-timer ,seconds nil 427 (run-with-timer ,seconds nil
424 'with-timeout-handler 428 'with-timeout-handler
425 with-timeout-tag)) 429 with-timeout-tag))
430 (push with-timeout-timer with-timeout-timers)
426 (setq with-timeout-value (progn . ,body)) 431 (setq with-timeout-value (progn . ,body))
427 nil)) 432 nil))
428 (progn . ,timeout-forms) 433 (progn . ,timeout-forms)
429 (cancel-timer with-timeout-timer) 434 (cancel-timer with-timeout-timer)
430 with-timeout-value)))) 435 with-timeout-value))))
431 436
437(defun with-timeout-suspend ()
438 "Stop the clock for `with-timeout'. Used by debuggers.
439The idea is that the time you spend in the debugger should not
440count against these timeouts.
441
442The value is a list that the debugger can pass to `with-timeout-unsuspend'
443when it exits, to make these timers start counting again."
444 (mapcar (lambda (timer)
445 (cancel-timer timer)
446 (list timer
447 (time-subtract
448 ;; The time that this timer will go off.
449 (list (aref timer 1) (aref timer 2) (aref timer 3))
450 (current-time))))
451 with-timeout-timers))
452
453(defun with-timeout-unsuspend (timer-spec-list)
454 "Restart the clock for `with-timeout'.
455The argument should be a value previously returned by `with-timeout-suspend'."
456 (dolist (elt timer-spec-list)
457 (let ((timer (car elt))
458 (delay (cadr elt)))
459 (timer-set-time timer (time-add (current-time) delay))
460 (timer-activate timer))))
461
432(defun y-or-n-p-with-timeout (prompt seconds default-value) 462(defun y-or-n-p-with-timeout (prompt seconds default-value)
433 "Like (y-or-n-p PROMPT), with a timeout. 463 "Like (y-or-n-p PROMPT), with a timeout.
434If the user does not answer after SECONDS seconds, return DEFAULT-VALUE." 464If the user does not answer after SECONDS seconds, return DEFAULT-VALUE."
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 4f247f2cd38..ecd5251891c 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -36,6 +36,8 @@
36(defvar viper-always) 36(defvar viper-always)
37(defvar viper-mode-string) 37(defvar viper-mode-string)
38(defvar viper-custom-file-name) 38(defvar viper-custom-file-name)
39(defvar viper--key-maps)
40(defvar viper--intercept-key-maps)
39(defvar iso-accents-mode) 41(defvar iso-accents-mode)
40(defvar quail-mode) 42(defvar quail-mode)
41(defvar quail-current-str) 43(defvar quail-current-str)
@@ -92,7 +94,7 @@
92;; Variables for defining VI commands 94;; Variables for defining VI commands
93 95
94;; Modifying commands that can be prefixes to movement commands 96;; Modifying commands that can be prefixes to movement commands
95(defconst viper-prefix-commands '(?c ?d ?y ?! ?= ?# ?< ?> ?\")) 97(defvar viper-prefix-commands '(?c ?d ?y ?! ?= ?# ?< ?> ?\"))
96;; define viper-prefix-command-p 98;; define viper-prefix-command-p
97(viper-test-com-defun viper-prefix-command) 99(viper-test-com-defun viper-prefix-command)
98 100
@@ -440,23 +442,24 @@
440;; This ensures that Viper bindings are in effect, regardless of which minor 442;; This ensures that Viper bindings are in effect, regardless of which minor
441;; modes were turned on by the user or by other packages. 443;; modes were turned on by the user or by other packages.
442(defun viper-normalize-minor-mode-map-alist () 444(defun viper-normalize-minor-mode-map-alist ()
443 (setq minor-mode-map-alist 445 (setq viper--intercept-key-maps
444 (viper-append-filter-alist 446 (list
445 (list (cons 'viper-vi-intercept-minor-mode viper-vi-intercept-map) 447 (cons 'viper-vi-intercept-minor-mode viper-vi-intercept-map)
446 (cons 'viper-vi-minibuffer-minor-mode viper-minibuffer-map) 448 (cons 'viper-insert-intercept-minor-mode viper-insert-intercept-map)
447 (cons 'viper-vi-local-user-minor-mode viper-vi-local-user-map) 449 (cons 'viper-emacs-intercept-minor-mode viper-emacs-intercept-map)
448 (cons 'viper-vi-kbd-minor-mode viper-vi-kbd-map) 450 ))
449 (cons 'viper-vi-global-user-minor-mode viper-vi-global-user-map) 451 (setq viper--key-maps
450 (cons 'viper-vi-state-modifier-minor-mode 452 (list (cons 'viper-vi-minibuffer-minor-mode viper-minibuffer-map)
451 (if (keymapp 453 (cons 'viper-vi-local-user-minor-mode viper-vi-local-user-map)
452 (cdr (assoc major-mode 454 (cons 'viper-vi-kbd-minor-mode viper-vi-kbd-map)
453 viper-vi-state-modifier-alist))) 455 (cons 'viper-vi-global-user-minor-mode viper-vi-global-user-map)
454 (cdr (assoc major-mode viper-vi-state-modifier-alist)) 456 (cons 'viper-vi-state-modifier-minor-mode
455 viper-empty-keymap)) 457 (if (keymapp
456 (cons 'viper-vi-diehard-minor-mode viper-vi-diehard-map) 458 (cdr (assoc major-mode viper-vi-state-modifier-alist)))
457 (cons 'viper-vi-basic-minor-mode viper-vi-basic-map) 459 (cdr (assoc major-mode viper-vi-state-modifier-alist))
458 (cons 'viper-insert-intercept-minor-mode 460 viper-empty-keymap))
459 viper-insert-intercept-map) 461 (cons 'viper-vi-diehard-minor-mode viper-vi-diehard-map)
462 (cons 'viper-vi-basic-minor-mode viper-vi-basic-map)
460 (cons 'viper-replace-minor-mode viper-replace-map) 463 (cons 'viper-replace-minor-mode viper-replace-map)
461 ;; viper-insert-minibuffer-minor-mode must come after 464 ;; viper-insert-minibuffer-minor-mode must come after
462 ;; viper-replace-minor-mode 465 ;; viper-replace-minor-mode
@@ -476,8 +479,6 @@
476 viper-empty-keymap)) 479 viper-empty-keymap))
477 (cons 'viper-insert-diehard-minor-mode viper-insert-diehard-map) 480 (cons 'viper-insert-diehard-minor-mode viper-insert-diehard-map)
478 (cons 'viper-insert-basic-minor-mode viper-insert-basic-map) 481 (cons 'viper-insert-basic-minor-mode viper-insert-basic-map)
479 (cons 'viper-emacs-intercept-minor-mode
480 viper-emacs-intercept-map)
481 (cons 'viper-emacs-local-user-minor-mode 482 (cons 'viper-emacs-local-user-minor-mode
482 viper-emacs-local-user-map) 483 viper-emacs-local-user-map)
483 (cons 'viper-emacs-kbd-minor-mode viper-emacs-kbd-map) 484 (cons 'viper-emacs-kbd-minor-mode viper-emacs-kbd-map)
@@ -490,8 +491,16 @@
490 (cdr 491 (cdr
491 (assoc major-mode viper-emacs-state-modifier-alist)) 492 (assoc major-mode viper-emacs-state-modifier-alist))
492 viper-empty-keymap)) 493 viper-empty-keymap))
493 ) 494 ))
494 minor-mode-map-alist))) 495
496 ;; in emacs with emulation-mode-map-alists, nothing needs to be done
497 (unless
498 (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists))
499 (setq minor-mode-map-alist
500 (viper-append-filter-alist
501 (append viper--intercept-key-maps viper--key-maps)
502 minor-mode-map-alist)))
503 )
495 504
496 505
497 506
@@ -1021,7 +1030,7 @@ as a Meta key and any number of multiple escapes is allowed."
1021 (not viper-translate-all-ESC-keysequences)) 1030 (not viper-translate-all-ESC-keysequences))
1022 ;; put keys following ESC on the unread list 1031 ;; put keys following ESC on the unread list
1023 ;; and return ESC as the key-sequence 1032 ;; and return ESC as the key-sequence
1024 (viper-set-unread-command-events (subseq keyseq 1)) 1033 (viper-set-unread-command-events (viper-subseq keyseq 1))
1025 (setq last-input-event event 1034 (setq last-input-event event
1026 keyseq (if viper-emacs-p 1035 keyseq (if viper-emacs-p
1027 "\e" 1036 "\e"
@@ -1032,7 +1041,7 @@ as a Meta key and any number of multiple escapes is allowed."
1032 (viper-set-unread-command-events 1041 (viper-set-unread-command-events
1033 (vconcat (vector 1042 (vconcat (vector
1034 (character-to-event (event-key first-key))) 1043 (character-to-event (event-key first-key)))
1035 (subseq keyseq 1))) 1044 (viper-subseq keyseq 1)))
1036 (setq last-input-event event 1045 (setq last-input-event event
1037 keyseq (vector (character-to-event ?\e)))) 1046 keyseq (vector (character-to-event ?\e))))
1038 ((eventp first-key) 1047 ((eventp first-key)
@@ -3732,7 +3741,8 @@ Null string will repeat previous search."
3732 (interactive "P") 3741 (interactive "P")
3733 (let ((val (viper-P-val arg)) 3742 (let ((val (viper-P-val arg))
3734 (com (viper-getcom arg)) 3743 (com (viper-getcom arg))
3735 (old-str viper-s-string)) 3744 (old-str viper-s-string)
3745 debug-on-error)
3736 (setq viper-s-forward t) 3746 (setq viper-s-forward t)
3737 (viper-if-string "/") 3747 (viper-if-string "/")
3738 ;; this is not used at present, but may be used later 3748 ;; this is not used at present, but may be used later
@@ -3744,7 +3754,8 @@ Null string will repeat previous search."
3744 (if com 3754 (if com
3745 (progn 3755 (progn
3746 (viper-move-marker-locally 'viper-com-point (mark t)) 3756 (viper-move-marker-locally 'viper-com-point (mark t))
3747 (viper-execute-com 'viper-search-next val com))))) 3757 (viper-execute-com 'viper-search-next val com)))
3758 ))
3748 3759
3749(defun viper-search-backward (arg) 3760(defun viper-search-backward (arg)
3750 "Search a string backward. 3761 "Search a string backward.
@@ -3753,7 +3764,8 @@ Null string will repeat previous search."
3753 (interactive "P") 3764 (interactive "P")
3754 (let ((val (viper-P-val arg)) 3765 (let ((val (viper-P-val arg))
3755 (com (viper-getcom arg)) 3766 (com (viper-getcom arg))
3756 (old-str viper-s-string)) 3767 (old-str viper-s-string)
3768 debug-on-error)
3757 (setq viper-s-forward nil) 3769 (setq viper-s-forward nil)
3758 (viper-if-string "?") 3770 (viper-if-string "?")
3759 ;; this is not used at present, but may be used later 3771 ;; this is not used at present, but may be used later
@@ -3858,7 +3870,8 @@ Null string will repeat previous search."
3858 "Repeat previous search." 3870 "Repeat previous search."
3859 (interactive "P") 3871 (interactive "P")
3860 (let ((val (viper-p-val arg)) 3872 (let ((val (viper-p-val arg))
3861 (com (viper-getcom arg))) 3873 (com (viper-getcom arg))
3874 debug-on-error)
3862 (if (null viper-s-string) (error viper-NoPrevSearch)) 3875 (if (null viper-s-string) (error viper-NoPrevSearch))
3863 (viper-search viper-s-string viper-s-forward arg) 3876 (viper-search viper-s-string viper-s-forward arg)
3864 (if com 3877 (if com
@@ -3870,7 +3883,8 @@ Null string will repeat previous search."
3870 "Repeat previous search in the reverse direction." 3883 "Repeat previous search in the reverse direction."
3871 (interactive "P") 3884 (interactive "P")
3872 (let ((val (viper-p-val arg)) 3885 (let ((val (viper-p-val arg))
3873 (com (viper-getcom arg))) 3886 (com (viper-getcom arg))
3887 debug-on-error)
3874 (if (null viper-s-string) (error viper-NoPrevSearch)) 3888 (if (null viper-s-string) (error viper-NoPrevSearch))
3875 (viper-search viper-s-string (not viper-s-forward) arg) 3889 (viper-search viper-s-string (not viper-s-forward) arg)
3876 (if com 3890 (if com
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el
index 6e188f21a9d..8d9aed94770 100644
--- a/lisp/emulation/viper-init.el
+++ b/lisp/emulation/viper-init.el
@@ -855,15 +855,13 @@ Related buffers can be cycled through via :R and :P commands."
855 (t (:underline t :stipple "gray3"))) 855 (t (:underline t :stipple "gray3")))
856 "*Face used to flash out the search pattern." 856 "*Face used to flash out the search pattern."
857 :group 'viper-highlighting) 857 :group 'viper-highlighting)
858;; backward-compatibility alias
859(put 'viper-search-face 'face-alias 'viper-search)
860;; An internal variable. Viper takes the face from here. 858;; An internal variable. Viper takes the face from here.
861(defvar viper-search-face 'viper-search 859(defvar viper-search-face 'viper-search
862 "Face used to flash out the search pattern. 860 "Face used to flash out the search pattern.
863DO NOT CHANGE this variable. Instead, use the customization widget 861DO NOT CHANGE this variable. Instead, use the customization widget
864to customize the actual face object `viper-search-face' 862to customize the actual face object `viper-search'
865this variable represents.") 863this variable represents.")
866(viper-hide-face 'viper-search) 864(viper-hide-face viper-search-face)
867 865
868 866
869(defface viper-replace-overlay 867(defface viper-replace-overlay
@@ -871,15 +869,13 @@ this variable represents.")
871 (t (:underline t :stipple "gray3"))) 869 (t (:underline t :stipple "gray3")))
872 "*Face for highlighting replace regions on a window display." 870 "*Face for highlighting replace regions on a window display."
873 :group 'viper-highlighting) 871 :group 'viper-highlighting)
874;; backward-compatibility alias
875(put 'viper-replace-overlay-face 'face-alias 'viper-replace-overlay)
876;; An internal variable. Viper takes the face from here. 872;; An internal variable. Viper takes the face from here.
877(defvar viper-replace-overlay-face 'viper-replace-overlay 873(defvar viper-replace-overlay-face 'viper-replace-overlay
878 "Face for highlighting replace regions on a window display. 874 "Face for highlighting replace regions on a window display.
879DO NOT CHANGE this variable. Instead, use the customization widget 875DO NOT CHANGE this variable. Instead, use the customization widget
880to customize the actual face object `viper-replace-overlay-face' 876to customize the actual face object `viper-replace-overlay'
881this variable represents.") 877this variable represents.")
882(viper-hide-face 'viper-replace-overlay) 878(viper-hide-face viper-replace-overlay-face)
883 879
884 880
885(defface viper-minibuffer-emacs 881(defface viper-minibuffer-emacs
@@ -887,15 +883,13 @@ this variable represents.")
887 (t (:weight bold))) 883 (t (:weight bold)))
888 "Face used in the Minibuffer when it is in Emacs state." 884 "Face used in the Minibuffer when it is in Emacs state."
889 :group 'viper-highlighting) 885 :group 'viper-highlighting)
890;; backward-compatibility alias
891(put 'viper-minibuffer-emacs-face 'face-alias 'viper-minibuffer-emacs)
892;; An internal variable. Viper takes the face from here. 886;; An internal variable. Viper takes the face from here.
893(defvar viper-minibuffer-emacs-face 'viper-minibuffer-emacs 887(defvar viper-minibuffer-emacs-face 'viper-minibuffer-emacs
894 "Face used in the Minibuffer when it is in Emacs state. 888 "Face used in the Minibuffer when it is in Emacs state.
895DO NOT CHANGE this variable. Instead, use the customization widget 889DO NOT CHANGE this variable. Instead, use the customization widget
896to customize the actual face object `viper-minibuffer-emacs-face' 890to customize the actual face object `viper-minibuffer-emacs'
897this variable represents.") 891this variable represents.")
898(viper-hide-face 'viper-minibuffer-emacs) 892(viper-hide-face viper-minibuffer-emacs-face)
899 893
900 894
901(defface viper-minibuffer-insert 895(defface viper-minibuffer-insert
@@ -903,15 +897,13 @@ this variable represents.")
903 (t (:slant italic))) 897 (t (:slant italic)))
904 "Face used in the Minibuffer when it is in Insert state." 898 "Face used in the Minibuffer when it is in Insert state."
905 :group 'viper-highlighting) 899 :group 'viper-highlighting)
906;; backward-compatibility alias
907(put 'viper-minibuffer-insert-face 'face-alias 'viper-minibuffer-insert)
908;; An internal variable. Viper takes the face from here. 900;; An internal variable. Viper takes the face from here.
909(defvar viper-minibuffer-insert-face 'viper-minibuffer-insert 901(defvar viper-minibuffer-insert-face 'viper-minibuffer-insert
910 "Face used in the Minibuffer when it is in Insert state. 902 "Face used in the Minibuffer when it is in Insert state.
911DO NOT CHANGE this variable. Instead, use the customization widget 903DO NOT CHANGE this variable. Instead, use the customization widget
912to customize the actual face object `viper-minibuffer-insert-face' 904to customize the actual face object `viper-minibuffer-insert'
913this variable represents.") 905this variable represents.")
914(viper-hide-face 'viper-minibuffer-insert) 906(viper-hide-face viper-minibuffer-insert-face)
915 907
916 908
917(defface viper-minibuffer-vi 909(defface viper-minibuffer-vi
@@ -919,15 +911,13 @@ this variable represents.")
919 (t (:inverse-video t))) 911 (t (:inverse-video t)))
920 "Face used in the Minibuffer when it is in Vi state." 912 "Face used in the Minibuffer when it is in Vi state."
921 :group 'viper-highlighting) 913 :group 'viper-highlighting)
922;; backward-compatibility alias
923(put 'viper-minibuffer-vi-face 'face-alias 'viper-minibuffer-vi)
924;; An internal variable. Viper takes the face from here. 914;; An internal variable. Viper takes the face from here.
925(defvar viper-minibuffer-vi-face 'viper-minibuffer-vi 915(defvar viper-minibuffer-vi-face 'viper-minibuffer-vi
926 "Face used in the Minibuffer when it is in Vi state. 916 "Face used in the Minibuffer when it is in Vi state.
927DO NOT CHANGE this variable. Instead, use the customization widget 917DO NOT CHANGE this variable. Instead, use the customization widget
928to customize the actual face object `viper-minibuffer-vi-face' 918to customize the actual face object `viper-minibuffer-vi'
929this variable represents.") 919this variable represents.")
930(viper-hide-face 'viper-minibuffer-vi) 920(viper-hide-face viper-minibuffer-vi-face)
931 921
932;; the current face to be used in the minibuffer 922;; the current face to be used in the minibuffer
933(viper-deflocalvar 923(viper-deflocalvar
diff --git a/lisp/emulation/viper-keym.el b/lisp/emulation/viper-keym.el
index e83cf14776f..1bbf3dce2c2 100644
--- a/lisp/emulation/viper-keym.el
+++ b/lisp/emulation/viper-keym.el
@@ -50,25 +50,6 @@
50 50
51;;; Variables 51;;; Variables
52 52
53(defcustom viper-toggle-key "\C-z"
54 "The key used to change states from emacs to Vi and back.
55In insert mode, this key also functions as Meta.
56Must be set in .viper file or prior to loading Viper.
57This setting cannot be changed interactively."
58 :type 'string
59 :group 'viper)
60
61(defcustom viper-quoted-insert-key "\C-v"
62 "The key used to quote special characters when inserting them in Insert state."
63 :type 'string
64 :group 'viper)
65
66(defcustom viper-ESC-key "\e"
67 "Key used to ESC.
68Must be set in .viper file or prior to loading Viper.
69This setting cannot be changed interactively."
70 :type 'string
71 :group 'viper)
72 53
73;;; Emacs keys in other states. 54;;; Emacs keys in other states.
74 55
@@ -176,6 +157,78 @@ viper-insert-basic-map. Not recommended, except for novice users.")
176;; and, after .viper is loaded, we add this keymap to viper-vi-basic-map. 157;; and, after .viper is loaded, we add this keymap to viper-vi-basic-map.
177(defvar viper-mode-map (make-sparse-keymap)) 158(defvar viper-mode-map (make-sparse-keymap))
178 159
160;; Some important keys used in viper
161(defcustom viper-toggle-key [(control ?z)] ; "\C-z"
162 "The key used to change states from emacs to Vi and back.
163In insert mode, this key also functions as Meta.
164
165Enter as a sexp. Examples: \"\\C-z\", [(control ?z)]."
166 :type 'sexp
167 :group 'viper
168 :set (lambda (symbol value)
169 (let ((old-value (if (boundp 'viper-toggle-key)
170 viper-toggle-key
171 [(control ?z)])))
172 (mapcar
173 (lambda (buf)
174 (save-excursion
175 (set-buffer buf)
176 (when (and (boundp 'viper-insert-basic-map)
177 (keymapp viper-insert-basic-map))
178 (when old-value
179 (define-key viper-insert-basic-map old-value nil))
180 (define-key viper-insert-basic-map value 'viper-escape-to-vi))
181 (when (and (boundp 'viper-vi-intercept-map)
182 (keymapp viper-vi-intercept-map))
183 (when old-value
184 (define-key viper-vi-intercept-map old-value nil))
185 (define-key
186 viper-vi-intercept-map value 'viper-toggle-key-action))
187 (when (and (boundp 'viper-emacs-intercept-map)
188 (keymapp viper-emacs-intercept-map))
189 (define-key viper-emacs-intercept-map old-value nil)
190 (define-key
191 viper-emacs-intercept-map value 'viper-change-state-to-vi))
192 ))
193 (buffer-list))
194 (set-default symbol value)
195 )))
196
197(defcustom viper-quoted-insert-key "\C-v"
198 "The key used to quote special characters when inserting them in Insert state."
199 :type 'string
200 :group 'viper)
201
202(defcustom viper-ESC-key [(escape)] ; "\e"
203 "Key used to ESC.
204Enter as a sexp. Examples: \"\\e\", [(escape)]."
205 :type 'sexp
206 :group 'viper
207 :set (lambda (symbol value)
208 (let ((old-value (if (boundp 'viper-ESC-key)
209 viper-ESC-key
210 [(escape)])))
211 (mapcar
212 (lambda (buf)
213 (save-excursion
214 (set-buffer buf)
215 (when (and (boundp 'viper-insert-intercept-map)
216 (keymapp viper-insert-intercept-map))
217 (when old-value
218 (define-key viper-insert-intercept-map old-value nil))
219 (define-key
220 viper-insert-intercept-map value 'viper-intercept-ESC-key))
221 (when (and (boundp 'viper-vi-intercept-map)
222 (keymapp viper-vi-intercept-map))
223 (when old-value
224 (define-key viper-vi-intercept-map old-value nil))
225 (define-key
226 viper-vi-intercept-map value 'viper-intercept-ESC-key))
227 ))
228 (buffer-list))
229 (set-default symbol value)
230 )))
231
179 232
180;;; Variables used by minor modes 233;;; Variables used by minor modes
181 234
@@ -197,6 +250,10 @@ viper-insert-basic-map. Not recommended, except for novice users.")
197;; to its Emacs state in various major modes. 250;; to its Emacs state in various major modes.
198(defvar viper-emacs-state-modifier-alist nil) 251(defvar viper-emacs-state-modifier-alist nil)
199 252
253;; The list of viper keymaps. Set by viper-normalize-minor-mode-map-alist
254(viper-deflocalvar viper--key-maps nil)
255(viper-deflocalvar viper--intercept-key-maps nil)
256
200;; Tells viper-add-local-keys to create a new viper-vi-local-user-map for new 257;; Tells viper-add-local-keys to create a new viper-vi-local-user-map for new
201;; buffers. Not a user option. 258;; buffers. Not a user option.
202(viper-deflocalvar viper-need-new-vi-local-map t "") 259(viper-deflocalvar viper-need-new-vi-local-map t "")
@@ -509,7 +566,7 @@ Usage:
509 566
510(defun viper-zap-local-keys () 567(defun viper-zap-local-keys ()
511 "Unconditionally reset Viper viper-*-local-user-map's. 568 "Unconditionally reset Viper viper-*-local-user-map's.
512Rarely useful, but if u made a mistake by switching to a mode that adds 569Rarely useful, but if you made a mistake by switching to a mode that adds
513undesirable local keys, e.g., comint-mode, then this function can restore 570undesirable local keys, e.g., comint-mode, then this function can restore
514sanity." 571sanity."
515 (interactive) 572 (interactive)
diff --git a/lisp/emulation/viper-macs.el b/lisp/emulation/viper-macs.el
index 8a3ce5db9eb..6d79ddec043 100644
--- a/lisp/emulation/viper-macs.el
+++ b/lisp/emulation/viper-macs.el
@@ -178,7 +178,7 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
178 (if (member 178 (if (member
179 key 179 key
180 '(?\b ?\d '^? '^H (control h) (control \?) backspace delete)) 180 '(?\b ?\d '^? '^H (control h) (control \?) backspace delete))
181 (setq key-seq (subseq key-seq 0 (- (length key-seq) 2)))) 181 (setq key-seq (viper-subseq key-seq 0 (- (length key-seq) 2))))
182 (setq message 182 (setq message
183 (format 183 (format
184 ":map%s %s" 184 ":map%s %s"
@@ -242,9 +242,9 @@ a key is a symbol, e.g., `a', `\\1', `f2', etc., or a list, e.g.,
242 (cond ((member 242 (cond ((member
243 key 243 key
244 '(?\b ?\d '^? '^H (control h) (control \?) backspace delete)) 244 '(?\b ?\d '^? '^H (control h) (control \?) backspace delete))
245 (setq key-seq (subseq key-seq 0 (- (length key-seq) 2)))) 245 (setq key-seq (viper-subseq key-seq 0 (- (length key-seq) 2))))
246 ((member key '(tab (control i) ?\t)) 246 ((member key '(tab (control i) ?\t))
247 (setq key-seq (subseq key-seq 0 (1- (length key-seq)))) 247 (setq key-seq (viper-subseq key-seq 0 (1- (length key-seq))))
248 (setq message 248 (setq message
249 (format 249 (format
250 ":unmap%s %s" 250 ":unmap%s %s"
@@ -618,7 +618,7 @@ name from there."
618 618
619 (if (null macro-alist-elt) 619 (if (null macro-alist-elt)
620 (setq macro-alist-elt (car next-best-match) 620 (setq macro-alist-elt (car next-best-match)
621 unmatched-suffix (subseq event-seq (cdr next-best-match)))) 621 unmatched-suffix (viper-subseq event-seq (cdr next-best-match))))
622 622
623 (cond ((null macro-alist-elt)) 623 (cond ((null macro-alist-elt))
624 ((setq macro-body (viper-kbd-buf-definition macro-alist-elt))) 624 ((setq macro-body (viper-kbd-buf-definition macro-alist-elt)))
@@ -701,7 +701,7 @@ name from there."
701 (let ((len1 (length seq1)) 701 (let ((len1 (length seq1))
702 (len2 (length seq2))) 702 (len2 (length seq2)))
703 (if (<= len1 len2) 703 (if (<= len1 len2)
704 (equal seq1 (subseq seq2 0 len1))))) 704 (equal seq1 (viper-subseq seq2 0 len1)))))
705 705
706;; find the longest common prefix 706;; find the longest common prefix
707(defun viper-common-seq-prefix (&rest seqs) 707(defun viper-common-seq-prefix (&rest seqs)
@@ -766,7 +766,7 @@ name from there."
766 (setq macro-def (car lis) 766 (setq macro-def (car lis)
767 def-len (length (car macro-def))) 767 def-len (length (car macro-def)))
768 (if (and (>= str-len def-len) 768 (if (and (>= str-len def-len)
769 (equal (car macro-def) (subseq str 0 def-len))) 769 (equal (car macro-def) (viper-subseq str 0 def-len)))
770 (if (or (viper-kbd-buf-definition macro-def) 770 (if (or (viper-kbd-buf-definition macro-def)
771 (viper-kbd-mode-definition macro-def) 771 (viper-kbd-mode-definition macro-def)
772 (viper-kbd-global-definition macro-def)) 772 (viper-kbd-global-definition macro-def))
diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el
index 503cd145796..77c5f844567 100644
--- a/lisp/emulation/viper-mous.el
+++ b/lisp/emulation/viper-mous.el
@@ -65,7 +65,7 @@
65(defvar viper-frame-of-focus nil) 65(defvar viper-frame-of-focus nil)
66 66
67;; Frame that was selected before the switch-frame event. 67;; Frame that was selected before the switch-frame event.
68(defconst viper-current-frame-saved (selected-frame)) 68(defvar viper-current-frame-saved (selected-frame))
69 69
70(defcustom viper-surrounding-word-function 'viper-surrounding-word 70(defcustom viper-surrounding-word-function 'viper-surrounding-word
71 "*Function that determines what constitutes a word for clicking events. 71 "*Function that determines what constitutes a word for clicking events.
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index 2d713df6ef6..d6fe9b43a64 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -41,7 +41,6 @@
41(defvar viper-syntax-preference) 41(defvar viper-syntax-preference)
42(defvar viper-saved-mark) 42(defvar viper-saved-mark)
43 43
44(require 'cl)
45(require 'ring) 44(require 'ring)
46 45
47(if noninteractive 46(if noninteractive
@@ -1068,7 +1067,7 @@
1068 (t key))) 1067 (t key)))
1069 1068
1070 ((listp key) 1069 ((listp key)
1071 (setq modifiers (subseq key 0 (1- (length key))) 1070 (setq modifiers (viper-subseq key 0 (1- (length key)))
1072 base-key (viper-seq-last-elt key) 1071 base-key (viper-seq-last-elt key)
1073 base-key-name (symbol-name base-key) 1072 base-key-name (symbol-name base-key)
1074 char-p (= (length base-key-name) 1)) 1073 char-p (= (length base-key-name) 1))
@@ -1503,6 +1502,33 @@ This option is appropriate if you like Emacs-style words."
1503 )) 1502 ))
1504 1503
1505 1504
1505;; this is copied from cl-extra.el
1506;; Return the subsequence of SEQ from START to END.
1507;; If END is omitted, it defaults to the length of the sequence.
1508;; If START or END is negative, it counts from the end.
1509(defun viper-subseq (seq start &optional end)
1510 (if (stringp seq) (substring seq start end)
1511 (let (len)
1512 (and end (< end 0) (setq end (+ end (setq len (length seq)))))
1513 (if (< start 0) (setq start (+ start (or len (setq len (length seq))))))
1514 (cond ((listp seq)
1515 (if (> start 0) (setq seq (nthcdr start seq)))
1516 (if end
1517 (let ((res nil))
1518 (while (>= (setq end (1- end)) start)
1519 (push (pop seq) res))
1520 (nreverse res))
1521 (copy-sequence seq)))
1522 (t
1523 (or end (setq end (or len (length seq))))
1524 (let ((res (make-vector (max (- end start) 0) nil))
1525 (i 0))
1526 (while (< start end)
1527 (aset res i (aref seq start))
1528 (setq i (1+ i) start (1+ start)))
1529 res))))))
1530
1531
1506 1532
1507(provide 'viper-util) 1533(provide 'viper-util)
1508 1534
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index fe65cb69cbb..3a95fa26835 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -8,7 +8,7 @@
8;; Author: Michael Kifer <kifer@cs.stonybrook.edu> 8;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
9;; Keywords: emulations 9;; Keywords: emulations
10 10
11(defconst viper-version "3.11.4 of February 19, 2005" 11(defconst viper-version "3.11.5 of July 8, 2005"
12 "The current version of Viper") 12 "The current version of Viper")
13 13
14;; This file is part of GNU Emacs. 14;; This file is part of GNU Emacs.
@@ -320,6 +320,7 @@
320;; end pacifier 320;; end pacifier
321 321
322(require 'viper-init) 322(require 'viper-init)
323(require 'viper-keym)
323 324
324;; better be defined before Viper custom group. 325;; better be defined before Viper custom group.
325(defvar viper-custom-file-name (convert-standard-filename "~/.viper") 326(defvar viper-custom-file-name (convert-standard-filename "~/.viper")
@@ -691,6 +692,12 @@ remains buffer-local."
691 692
692 (setq viper-mode nil) 693 (setq viper-mode nil)
693 694
695 (when (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists))
696 (setq emulation-mode-map-alists
697 (delq 'viper--intercept-key-maps
698 (delq 'viper--key-maps emulation-mode-map-alists))
699 ))
700
694 (viper-delocalize-var 'viper-vi-minibuffer-minor-mode) 701 (viper-delocalize-var 'viper-vi-minibuffer-minor-mode)
695 (viper-delocalize-var 'viper-insert-minibuffer-minor-mode) 702 (viper-delocalize-var 'viper-insert-minibuffer-minor-mode)
696 (viper-delocalize-var 'viper-vi-intercept-minor-mode) 703 (viper-delocalize-var 'viper-vi-intercept-minor-mode)
@@ -874,9 +881,27 @@ remains buffer-local."
874 "Switch to emacs state while reading password." 881 "Switch to emacs state while reading password."
875 (viper-change-state-to-emacs))) 882 (viper-change-state-to-emacs)))
876 883
884 (defadvice self-insert-command (around viper-self-insert-ad activate)
885 "Ignore all self-inserting keys in the vi-state."
886 (if (and (eq viper-current-state 'vi-state) (interactive-p))
887 (beep 1)
888 ad-do-it
889 ))
890
891 (when (and (fboundp 'add-to-ordered-list) (boundp 'emulation-mode-map-alists))
892 ;; needs to be as early as possible
893 (add-to-ordered-list
894 'emulation-mode-map-alists 'viper--intercept-key-maps 100)
895 ;; needs to be after cua-mode
896 (add-to-ordered-list 'emulation-mode-map-alists 'viper--key-maps 500)
897 )
898
877 ;; Emacs shell, ange-ftp, and comint-based modes 899 ;; Emacs shell, ange-ftp, and comint-based modes
878 (add-hook 'comint-mode-hook 'viper-comint-mode-hook) ; comint 900 (add-hook 'comint-mode-hook 'viper-comint-mode-hook) ; comint
879 901
902 (add-hook 'eshell-mode-hook
903 (lambda () (setq viper-auto-indent nil)))
904
880 (viper-set-emacs-state-searchstyle-macros nil 'dired-mode) ; dired 905 (viper-set-emacs-state-searchstyle-macros nil 'dired-mode) ; dired
881 (viper-set-emacs-state-searchstyle-macros nil 'tar-mode) ; tar 906 (viper-set-emacs-state-searchstyle-macros nil 'tar-mode) ; tar
882 (viper-set-emacs-state-searchstyle-macros nil 'mh-folder-mode) ; mhe 907 (viper-set-emacs-state-searchstyle-macros nil 'mh-folder-mode) ; mhe
@@ -1058,6 +1083,14 @@ remains buffer-local."
1058 (define-key viper-insert-intercept-map "\C-x)" nil) 1083 (define-key viper-insert-intercept-map "\C-x)" nil)
1059 (define-key viper-emacs-intercept-map "\C-x)" nil)) 1084 (define-key viper-emacs-intercept-map "\C-x)" nil))
1060 1085
1086 (defadvice add-minor-mode (after
1087 viper-advice-add-minor-mode
1088 (toggle name &optional keymap after toggle-fun)
1089 activate)
1090 "Run viper-normalize-minor-mode-map-alist after adding a minor mode."
1091 (viper-normalize-minor-mode-map-alist)
1092 (setq-default minor-mode-map-alist minor-mode-map-alist))
1093
1061 ;; catch frame switching event 1094 ;; catch frame switching event
1062 (if (viper-window-display-p) 1095 (if (viper-window-display-p)
1063 (if viper-xemacs-p 1096 (if viper-xemacs-p
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index 55ddf663b28..1cda18dda2e 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -475,10 +475,11 @@ These special properties include `invisible', `intangible' and `read-only'."
475;;;###autoload 475;;;###autoload
476(defun facemenu-read-color (&optional prompt) 476(defun facemenu-read-color (&optional prompt)
477 "Read a color using the minibuffer." 477 "Read a color using the minibuffer."
478 (let ((col (completing-read (or prompt "Color: ") 478 (let* ((completion-ignore-case t)
479 (or facemenu-color-alist 479 (col (completing-read (or prompt "Color: ")
480 (defined-colors)) 480 (or facemenu-color-alist
481 nil t))) 481 (defined-colors))
482 nil t)))
482 (if (equal "" col) 483 (if (equal "" col)
483 nil 484 nil
484 col))) 485 col)))
diff --git a/lisp/files.el b/lisp/files.el
index 1840d3e5f06..f41a9b29522 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2544,6 +2544,10 @@ the old visited file has been renamed to the new name FILENAME."
2544 (setq truename (file-truename filename)) 2544 (setq truename (file-truename filename))
2545 (if find-file-visit-truename 2545 (if find-file-visit-truename
2546 (setq filename truename)))) 2546 (setq filename truename))))
2547 (if filename
2548 (let ((new-name (file-name-nondirectory filename)))
2549 (if (string= new-name "")
2550 (error "Empty file name"))))
2547 (let ((buffer (and filename (find-buffer-visiting filename)))) 2551 (let ((buffer (and filename (find-buffer-visiting filename))))
2548 (and buffer (not (eq buffer (current-buffer))) 2552 (and buffer (not (eq buffer (current-buffer)))
2549 (not no-query) 2553 (not no-query)
@@ -2557,8 +2561,6 @@ the old visited file has been renamed to the new name FILENAME."
2557 (setq buffer-file-name filename) 2561 (setq buffer-file-name filename)
2558 (if filename ; make buffer name reflect filename. 2562 (if filename ; make buffer name reflect filename.
2559 (let ((new-name (file-name-nondirectory buffer-file-name))) 2563 (let ((new-name (file-name-nondirectory buffer-file-name)))
2560 (if (string= new-name "")
2561 (error "Empty file name"))
2562 (if (eq system-type 'vax-vms) 2564 (if (eq system-type 'vax-vms)
2563 (setq new-name (downcase new-name))) 2565 (setq new-name (downcase new-name)))
2564 (setq default-directory (file-name-directory buffer-file-name)) 2566 (setq default-directory (file-name-directory buffer-file-name))
@@ -4004,7 +4006,9 @@ specifies the list of buffers to kill, asking for approval for each one."
4004 (while list 4006 (while list
4005 (let* ((buffer (car list)) 4007 (let* ((buffer (car list))
4006 (name (buffer-name buffer))) 4008 (name (buffer-name buffer)))
4007 (and (not (string-equal name "")) 4009 (and name ; Can be nil for an indirect buffer
4010 ; if we killed the base buffer.
4011 (not (string-equal name ""))
4008 (/= (aref name 0) ? ) 4012 (/= (aref name 0) ? )
4009 (yes-or-no-p 4013 (yes-or-no-p
4010 (format "Buffer %s %s. Kill? " 4014 (format "Buffer %s %s. Kill? "
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index d6292fe3c14..0ba073409f2 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1473,7 +1473,11 @@ LOUDLY, if non-nil, allows progress-meter bar."
1473 (while (and (< (point) end) 1473 (while (and (< (point) end)
1474 (if (stringp matcher) 1474 (if (stringp matcher)
1475 (re-search-forward matcher end t) 1475 (re-search-forward matcher end t)
1476 (funcall matcher end))) 1476 (funcall matcher end))
1477 ;; Beware empty string matches since they will
1478 ;; loop indefinitely.
1479 (or (> (point) (match-beginning 0))
1480 (progn (forward-char 1) t)))
1477 (when (and font-lock-multiline 1481 (when (and font-lock-multiline
1478 (>= (point) 1482 (>= (point)
1479 (save-excursion (goto-char (match-beginning 0)) 1483 (save-excursion (goto-char (match-beginning 0))
diff --git a/lisp/frame.el b/lisp/frame.el
index 088a7a9b622..5496c857af0 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1256,10 +1256,6 @@ The function `blink-cursor-start' is called when the timer fires.")
1256This timer calls `blink-cursor-timer-function' every 1256This timer calls `blink-cursor-timer-function' every
1257`blink-cursor-interval' seconds.") 1257`blink-cursor-interval' seconds.")
1258 1258
1259;; We do not know the standard _evaluated_ value yet, because the standard
1260;; expression uses values that are not yet set. The correct evaluated
1261;; standard value will be installed in startup.el using exactly the same
1262;; expression as in the defcustom.
1263(define-minor-mode blink-cursor-mode 1259(define-minor-mode blink-cursor-mode
1264 "Toggle blinking cursor mode. 1260 "Toggle blinking cursor mode.
1265With a numeric argument, turn blinking cursor mode on iff ARG is positive. 1261With a numeric argument, turn blinking cursor mode on iff ARG is positive.
@@ -1270,9 +1266,10 @@ Note that this command is effective only when Emacs
1270displays through a window system, because then Emacs does its own 1266displays through a window system, because then Emacs does its own
1271cursor display. On a text-only terminal, this is not implemented." 1267cursor display. On a text-only terminal, this is not implemented."
1272 :init-value (not (or noninteractive 1268 :init-value (not (or noninteractive
1273 (if (boundp 'no-blinking-cursor) no-blinking-cursor) 1269 no-blinking-cursor
1274 (eq system-type 'ms-dos) 1270 (eq system-type 'ms-dos)
1275 (not (memq window-system '(x w32))))) 1271 (not (memq window-system '(x w32)))))
1272 :initialize 'custom-initialize-safe-default
1276 :group 'cursor 1273 :group 'cursor
1277 :global t 1274 :global t
1278 (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer)) 1275 (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer))
diff --git a/lisp/fringe.el b/lisp/fringe.el
index 71914bd95f3..1265e8308a0 100644
--- a/lisp/fringe.el
+++ b/lisp/fringe.el
@@ -150,7 +150,7 @@ To set this variable in a Lisp program, use `set-fringe-mode' to make
150it take real effect. 150it take real effect.
151Setting the variable with a customization buffer also takes effect. 151Setting the variable with a customization buffer also takes effect.
152If you only want to modify the appearance of the fringe in one frame, 152If you only want to modify the appearance of the fringe in one frame,
153you can use the interactive function `toggle-fringe'" 153you can use the interactive function `set-fringe-style'."
154 :type '(choice (const :tag "Default width" nil) 154 :type '(choice (const :tag "Default width" nil)
155 (const :tag "No fringes" 0) 155 (const :tag "No fringes" 0)
156 (const :tag "Only right" (0 . nil)) 156 (const :tag "Only right" (0 . nil))
@@ -174,7 +174,10 @@ If ALL-FRAMES, the negation of the fringe values in
174Otherwise the negation of the fringe value in the currently selected 174Otherwise the negation of the fringe value in the currently selected
175frame parameter is used." 175frame parameter is used."
176 (let ((mode (intern (completing-read 176 (let ((mode (intern (completing-read
177 "Select fringe mode for all frames (type ? for list): " 177 (concat
178 "Select fringe mode for "
179 (if all-frames "all frames" "selected frame")
180 " (type ? for list): ")
178 '(("none") ("default") ("left-only") 181 '(("none") ("default") ("left-only")
179 ("right-only") ("half") ("minimal")) 182 ("right-only") ("half") ("minimal"))
180 nil t)))) 183 nil t))))
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 053ce91dad9..7298fb92d69 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,16 @@
12005-07-13 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus-salt.el (gnus-pick-mode): Remove the 5th arg of
4 gnus-add-minor-mode.
5 (gnus-binary-mode): Ditto.
6
7 * gnus-topic.el (gnus-topic-mode): Ditto.
8
92005-07-08 Ralf Angeli <angeli@iwi.uni-sb.de> (tiny change)
10
11 * gnus-art.el (gnus-article-next-page, gnus-article-next-page-1)
12 (gnus-article-prev-page): Take scroll-margin into consideration.
13
12005-07-04 Lute Kamstra <lute@gnu.org> 142005-07-04 Lute Kamstra <lute@gnu.org>
2 15
3 Update FSF's address in GPL notices. 16 Update FSF's address in GPL notices.
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index fd032e9964d..82f06d2f5a2 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -5160,7 +5160,7 @@ If given a numerical ARG, move forward ARG pages."
5160If end of article, return non-nil. Otherwise return nil. 5160If end of article, return non-nil. Otherwise return nil.
5161Argument LINES specifies lines to be scrolled up." 5161Argument LINES specifies lines to be scrolled up."
5162 (interactive "p") 5162 (interactive "p")
5163 (move-to-window-line -1) 5163 (move-to-window-line (max (- -1 scroll-margin) (- -1 (window-body-height))))
5164 (if (save-excursion 5164 (if (save-excursion
5165 (end-of-line) 5165 (end-of-line)
5166 (and (pos-visible-in-window-p) ;Not continuation line. 5166 (and (pos-visible-in-window-p) ;Not continuation line.
@@ -5189,13 +5189,13 @@ Argument LINES specifies lines to be scrolled up."
5189 (end-of-buffer 5189 (end-of-buffer
5190 ;; Long lines may cause an end-of-buffer error. 5190 ;; Long lines may cause an end-of-buffer error.
5191 (goto-char (point-max))))) 5191 (goto-char (point-max)))))
5192 (move-to-window-line 0)) 5192 (move-to-window-line (min scroll-margin (window-body-height))))
5193 5193
5194(defun gnus-article-prev-page (&optional lines) 5194(defun gnus-article-prev-page (&optional lines)
5195 "Show previous page of current article. 5195 "Show previous page of current article.
5196Argument LINES specifies lines to be scrolled down." 5196Argument LINES specifies lines to be scrolled down."
5197 (interactive "p") 5197 (interactive "p")
5198 (move-to-window-line 0) 5198 (move-to-window-line (min scroll-margin (window-body-height)))
5199 (if (and gnus-page-broken 5199 (if (and gnus-page-broken
5200 (bobp) 5200 (bobp)
5201 (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer? 5201 (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer?
@@ -5209,7 +5209,7 @@ Argument LINES specifies lines to be scrolled down."
5209 (scroll-down lines) 5209 (scroll-down lines)
5210 (beginning-of-buffer 5210 (beginning-of-buffer
5211 (goto-char (point-min)))) 5211 (goto-char (point-min))))
5212 (move-to-window-line 0))))) 5212 (move-to-window-line (min scroll-margin (window-body-height)))))))
5213 5213
5214(defun gnus-article-only-boring-p () 5214(defun gnus-article-only-boring-p ()
5215 "Decide whether there is only boring text remaining in the article. 5215 "Decide whether there is only boring text remaining in the article.
diff --git a/lisp/gnus/gnus-salt.el b/lisp/gnus/gnus-salt.el
index 8fbe465c76c..c8c0f30b417 100644
--- a/lisp/gnus/gnus-salt.el
+++ b/lisp/gnus/gnus-salt.el
@@ -128,8 +128,7 @@ It accepts the same format specs that `gnus-summary-line-format' does."
128 ;; Set up the menu. 128 ;; Set up the menu.
129 (when (gnus-visual-p 'pick-menu 'menu) 129 (when (gnus-visual-p 'pick-menu 'menu)
130 (gnus-pick-make-menu-bar)) 130 (gnus-pick-make-menu-bar))
131 (gnus-add-minor-mode 'gnus-pick-mode " Pick" gnus-pick-mode-map 131 (gnus-add-minor-mode 'gnus-pick-mode " Pick" gnus-pick-mode-map)
132 nil 'gnus-pick-mode)
133 (gnus-run-hooks 'gnus-pick-mode-hook)))) 132 (gnus-run-hooks 'gnus-pick-mode-hook))))
134 133
135(defun gnus-pick-setup-message () 134(defun gnus-pick-setup-message ()
@@ -362,8 +361,7 @@ This must be bound to a button-down mouse event."
362 ;; Set up the menu. 361 ;; Set up the menu.
363 (when (gnus-visual-p 'binary-menu 'menu) 362 (when (gnus-visual-p 'binary-menu 'menu)
364 (gnus-binary-make-menu-bar)) 363 (gnus-binary-make-menu-bar))
365 (gnus-add-minor-mode 'gnus-binary-mode " Binary" 364 (gnus-add-minor-mode 'gnus-binary-mode " Binary" gnus-binary-mode-map)
366 gnus-binary-mode-map nil 'gnus-binary-mode)
367 (gnus-run-hooks 'gnus-binary-mode-hook)))) 365 (gnus-run-hooks 'gnus-binary-mode-hook))))
368 366
369(defun gnus-binary-display-article (article &optional all-header) 367(defun gnus-binary-display-article (article &optional all-header)
diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el
index 95a2e1ad56a..3b2bfacddb0 100644
--- a/lisp/gnus/gnus-topic.el
+++ b/lisp/gnus/gnus-topic.el
@@ -1,6 +1,6 @@
1;;; gnus-topic.el --- a folding minor mode for Gnus group buffers 1;;; gnus-topic.el --- a folding minor mode for Gnus group buffers
2;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 2;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
3;; Free Software Foundation, Inc. 3;; 2005 Free Software Foundation, Inc.
4 4
5;; Author: Ilja Weis <kult@uni-paderborn.de> 5;; Author: Ilja Weis <kult@uni-paderborn.de>
6;; Lars Magne Ingebrigtsen <larsi@gnus.org> 6;; Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -1136,10 +1136,7 @@ articles in the topic and its subtopics."
1136 (when (gnus-visual-p 'topic-menu 'menu) 1136 (when (gnus-visual-p 'topic-menu 'menu)
1137 (gnus-topic-make-menu-bar)) 1137 (gnus-topic-make-menu-bar))
1138 (gnus-set-format 'topic t) 1138 (gnus-set-format 'topic t)
1139 (gnus-add-minor-mode 'gnus-topic-mode " Topic" 1139 (gnus-add-minor-mode 'gnus-topic-mode " Topic" gnus-topic-mode-map)
1140 gnus-topic-mode-map nil (lambda (&rest junk)
1141 (interactive)
1142 (gnus-topic-mode nil t)))
1143 (add-hook 'gnus-group-catchup-group-hook 'gnus-topic-update-topic) 1140 (add-hook 'gnus-group-catchup-group-hook 'gnus-topic-update-topic)
1144 (set (make-local-variable 'gnus-group-prepare-function) 1141 (set (make-local-variable 'gnus-group-prepare-function)
1145 'gnus-group-prepare-topics) 1142 'gnus-group-prepare-topics)
diff --git a/lisp/ido.el b/lisp/ido.el
index d4d94164f3c..97adb97bdd5 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -578,8 +578,12 @@ the `ido-work-directory-list' list."
578 578
579(defcustom ido-use-filename-at-point nil 579(defcustom ido-use-filename-at-point nil
580 "*Non-nil means that ido shall look for a filename at point. 580 "*Non-nil means that ido shall look for a filename at point.
581May use `ffap-guesser' to guess whether text at point is a filename.
581If found, use that as the starting point for filename selection." 582If found, use that as the starting point for filename selection."
582 :type 'boolean 583 :type '(choice
584 (const :tag "Disabled" nil)
585 (const :tag "Guess filename" guess)
586 (other :tag "Use literal filename" t))
583 :group 'ido) 587 :group 'ido)
584 588
585 589
@@ -881,6 +885,12 @@ the file name using normal `read-file-name' style."
881 :type '(repeat symbol) 885 :type '(repeat symbol)
882 :group 'ido) 886 :group 'ido)
883 887
888(defcustom ido-before-fallback-functions '()
889 "List of functions to call before calling a fallback command.
890The fallback command is passed as an argument to the functions."
891 :type 'hook
892 :group 'ido)
893
884;;; Internal Variables 894;;; Internal Variables
885 895
886;; Persistent variables 896;; Persistent variables
@@ -1918,7 +1928,10 @@ If INITIAL is non-nil, it specifies the initial input string."
1918(defun ido-buffer-internal (method &optional fallback prompt default initial switch-cmd) 1928(defun ido-buffer-internal (method &optional fallback prompt default initial switch-cmd)
1919 ;; Internal function for ido-switch-buffer and friends 1929 ;; Internal function for ido-switch-buffer and friends
1920 (if (not ido-mode) 1930 (if (not ido-mode)
1921 (call-interactively (or fallback 'switch-to-buffer)) 1931 (progn
1932 (run-hook-with-args 'ido-before-fallback-functions
1933 (or fallback 'switch-to-buffer))
1934 (call-interactively (or fallback 'switch-to-buffer)))
1922 (let* ((ido-context-switch-command switch-cmd) 1935 (let* ((ido-context-switch-command switch-cmd)
1923 (ido-current-directory nil) 1936 (ido-current-directory nil)
1924 (ido-directory-nonreadable nil) 1937 (ido-directory-nonreadable nil)
@@ -1937,6 +1950,8 @@ If INITIAL is non-nil, it specifies the initial input string."
1937 1950
1938 ((eq ido-exit 'fallback) 1951 ((eq ido-exit 'fallback)
1939 (let ((read-buffer-function nil)) 1952 (let ((read-buffer-function nil))
1953 (run-hook-with-args 'ido-before-fallback-functions
1954 (or fallback 'switch-to-buffer))
1940 (call-interactively (or fallback 'switch-to-buffer)))) 1955 (call-interactively (or fallback 'switch-to-buffer))))
1941 1956
1942 ;; Check buf is non-nil. 1957 ;; Check buf is non-nil.
@@ -2040,7 +2055,9 @@ If INITIAL is non-nil, it specifies the initial input string."
2040 filename t)) 2055 filename t))
2041 2056
2042 ((and ido-use-filename-at-point 2057 ((and ido-use-filename-at-point
2043 (setq fn (ffap-string-at-point)) 2058 (setq fn (if (eq ido-use-filename-at-point 'guess)
2059 (ffap-guesser)
2060 (ffap-string-at-point)))
2044 (not (string-match "^http:/" fn)) 2061 (not (string-match "^http:/" fn))
2045 (setq d (file-name-directory fn)) 2062 (setq d (file-name-directory fn))
2046 (file-directory-p d)) 2063 (file-directory-p d))
@@ -2068,6 +2085,8 @@ If INITIAL is non-nil, it specifies the initial input string."
2068 ;; we don't want to change directory of current buffer. 2085 ;; we don't want to change directory of current buffer.
2069 (let ((default-directory ido-current-directory) 2086 (let ((default-directory ido-current-directory)
2070 (read-file-name-function nil)) 2087 (read-file-name-function nil))
2088 (run-hook-with-args 'ido-before-fallback-functions
2089 (or fallback 'find-file))
2071 (call-interactively (or fallback 'find-file)))) 2090 (call-interactively (or fallback 'find-file))))
2072 2091
2073 ((eq ido-exit 'switch-to-buffer) 2092 ((eq ido-exit 'switch-to-buffer)
@@ -2134,6 +2153,7 @@ If INITIAL is non-nil, it specifies the initial input string."
2134 (setq filename (concat ido-current-directory filename)) 2153 (setq filename (concat ido-current-directory filename))
2135 (ido-record-command fallback filename) 2154 (ido-record-command fallback filename)
2136 (ido-record-work-directory) 2155 (ido-record-work-directory)
2156 (run-hook-with-args 'ido-before-fallback-functions fallback)
2137 (funcall fallback filename)) 2157 (funcall fallback filename))
2138 2158
2139 ((eq method 'insert) 2159 ((eq method 'insert)
@@ -4210,6 +4230,7 @@ If REQUIRE-MATCH is non-nil, an existing buffer must be selected."
4210 (buf (ido-read-internal 'buffer prompt 'ido-buffer-history default require-match))) 4230 (buf (ido-read-internal 'buffer prompt 'ido-buffer-history default require-match)))
4211 (if (eq ido-exit 'fallback) 4231 (if (eq ido-exit 'fallback)
4212 (let ((read-buffer-function nil)) 4232 (let ((read-buffer-function nil))
4233 (run-hook-with-args 'ido-before-fallback-functions 'read-buffer)
4213 (read-buffer prompt default require-match)) 4234 (read-buffer prompt default require-match))
4214 buf))) 4235 buf)))
4215 4236
@@ -4256,6 +4277,7 @@ See `read-file-name' for additional parameters."
4256 (setq filename 'fallback))) 4277 (setq filename 'fallback)))
4257 (if (eq filename 'fallback) 4278 (if (eq filename 'fallback)
4258 (let ((read-file-name-function nil)) 4279 (let ((read-file-name-function nil))
4280 (run-hook-with-args 'ido-before-fallback-functions 'read-file-name)
4259 (read-file-name prompt dir default-filename mustmatch initial predicate)) 4281 (read-file-name prompt dir default-filename mustmatch initial predicate))
4260 filename))) 4282 filename)))
4261 4283
diff --git a/lisp/longlines.el b/lisp/longlines.el
index 5d68c0a06a3..57e07d1b20a 100644
--- a/lisp/longlines.el
+++ b/lisp/longlines.el
@@ -170,20 +170,20 @@ With optional argument ARG, make the hard newlines invisible again."
170 "Make hard newlines between BEG and END visible." 170 "Make hard newlines between BEG and END visible."
171 (let* ((pmin (min beg end)) 171 (let* ((pmin (min beg end))
172 (pmax (max beg end)) 172 (pmax (max beg end))
173 (pos (text-property-any pmin pmax 'hard t))) 173 (pos (text-property-not-all pmin pmax 'hard nil)))
174 (while pos 174 (while pos
175 (put-text-property pos (1+ pos) 'display 175 (put-text-property pos (1+ pos) 'display
176 (copy-sequence longlines-show-effect)) 176 (copy-sequence longlines-show-effect))
177 (setq pos (text-property-any (1+ pos) pmax 'hard t))))) 177 (setq pos (text-property-not-all (1+ pos) pmax 'hard nil)))))
178 178
179(defun longlines-unshow-hard-newlines () 179(defun longlines-unshow-hard-newlines ()
180 "Make hard newlines invisible again." 180 "Make hard newlines invisible again."
181 (interactive) 181 (interactive)
182 (setq longlines-showing nil) 182 (setq longlines-showing nil)
183 (let ((pos (text-property-any (point-min) (point-max) 'hard t))) 183 (let ((pos (text-property-not-all (point-min) (point-max) 'hard nil)))
184 (while pos 184 (while pos
185 (remove-text-properties pos (1+ pos) '(display)) 185 (remove-text-properties pos (1+ pos) '(display))
186 (setq pos (text-property-any (1+ pos) (point-max) 'hard t))))) 186 (setq pos (text-property-not-all (1+ pos) (point-max) 'hard nil)))))
187 187
188;; Wrapping the paragraphs. 188;; Wrapping the paragraphs.
189 189
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index de1a1bf472f..37df6f66193 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -3316,10 +3316,10 @@ See also user-option `rmail-confirm-expunge'."
3316 (narrow-to-region (- (buffer-size) omin) (- (buffer-size) omax))) 3316 (narrow-to-region (- (buffer-size) omin) (- (buffer-size) omax)))
3317 (if (not dont-show) 3317 (if (not dont-show)
3318 (rmail-show-message 3318 (rmail-show-message
3319 (if (zerop rmail-current-message) 1 nil) 3319 (if (zerop rmail-current-message) 1 nil)))
3320 (if rmail-enable-mime 3320 (if rmail-enable-mime
3321 (goto-char (+ (point-min) opoint)) 3321 (goto-char (+ (point-min) opoint))
3322 (goto-char (+ (point) opoint)))))))) 3322 (goto-char (+ (point) opoint))))))
3323 3323
3324(defun rmail-expunge () 3324(defun rmail-expunge ()
3325 "Erase deleted messages from Rmail file and summary buffer." 3325 "Erase deleted messages from Rmail file and summary buffer."
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 21e7c74e965..d3cbf142222 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -78,7 +78,7 @@
78 78
79;;;###autoload 79;;;###autoload
80(defcustom compilation-mode-hook nil 80(defcustom compilation-mode-hook nil
81 "*List of hook functions run by `compilation-mode' (see `run-hooks')." 81 "*List of hook functions run by `compilation-mode' (see `run-mode-hooks')."
82 :type 'hook 82 :type 'hook
83 :group 'compilation) 83 :group 'compilation)
84 84
@@ -1213,7 +1213,7 @@ from a different message."
1213move point to the error message line and type \\[compile-goto-error]. 1213move point to the error message line and type \\[compile-goto-error].
1214To kill the compilation, type \\[kill-compilation]. 1214To kill the compilation, type \\[kill-compilation].
1215 1215
1216Runs `compilation-mode-hook' with `run-hooks' (which see). 1216Runs `compilation-mode-hook' with `run-mode-hooks' (which see).
1217 1217
1218\\{compilation-mode-map}" 1218\\{compilation-mode-map}"
1219 (interactive) 1219 (interactive)
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 584b0ae8144..f4b6a705ea9 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -50,6 +50,19 @@
50;; still under development and is part of a process to migrate Emacs from 50;; still under development and is part of a process to migrate Emacs from
51;; annotations to GDB/MI. 51;; annotations to GDB/MI.
52;; 52;;
53;; Windows Platforms:
54;;
55;; If you are using Emacs and GDB on Windows you will need to flush the buffer
56;; explicitly in your program if you want timely display of I/O in Emacs.
57;; Alternatively you can make the output stream unbuffered, for example, by
58;; using a macro:
59;;
60;; #ifdef UNBUFFERED
61;; setvbuf(stdout,(char *)NULL, _IONBF,0);
62;; #endif
63;;
64;; and compiling with -DUNBUFFERED while debugging.
65;;
53;; Known Bugs: 66;; Known Bugs:
54;; 67;;
55;; TODO: 68;; TODO:
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index b561579b06d..f7f96130f39 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -2033,11 +2033,20 @@ STRING This is ignored for the purposes of calculating
2033 ;; Continuation lines are handled specially 2033 ;; Continuation lines are handled specially
2034 (if (sh-this-is-a-continuation) 2034 (if (sh-this-is-a-continuation)
2035 (progn 2035 (progn
2036 ;; We assume the line being continued is already 2036 (setq result
2037 ;; properly indented... 2037 (if (save-excursion
2038 ;; (setq prev-line-end (sh-prev-line)) 2038 (beginning-of-line)
2039 (setq align-point (sh-prev-line nil)) 2039 (not (memq (char-before (- (point) 2)) '(?\s ?\t))))
2040 (setq result (list '(+ sh-indent-for-continuation))) 2040 ;; By convention, if the continuation \ is not
2041 ;; preceded by a SPC or a TAB it means that the line
2042 ;; is cut at a place where spaces cannot be freely
2043 ;; added/removed. I.e. do not indent the line.
2044 (list '(= nil))
2045 ;; We assume the line being continued is already
2046 ;; properly indented...
2047 ;; (setq prev-line-end (sh-prev-line))
2048 (setq align-point (sh-prev-line nil))
2049 (list '(+ sh-indent-for-continuation))))
2041 (setq have-result t)) 2050 (setq have-result t))
2042 (beginning-of-line) 2051 (beginning-of-line)
2043 (skip-chars-forward " \t") 2052 (skip-chars-forward " \t")
@@ -2130,10 +2139,9 @@ STRING This is ignored for the purposes of calculating
2130 (sh-debug "result is now: %s" result) 2139 (sh-debug "result is now: %s" result)
2131 2140
2132 (or result 2141 (or result
2133 (if prev-line-end 2142 (setq result (list (if prev-line-end
2134 (setq result (list (list t prev-line-end))) 2143 (list t prev-line-end)
2135 (setq result (list (list '= 'sh-first-lines-indent))) 2144 (list '= 'sh-first-lines-indent)))))
2136 ))
2137 2145
2138 (if (eq result t) 2146 (if (eq result t)
2139 (setq result nil)) 2147 (setq result nil))
@@ -2695,11 +2703,9 @@ unless optional argument ARG (the prefix when interactive) is non-nil."
2695 2703
2696(defun sh-mark-init (buffer) 2704(defun sh-mark-init (buffer)
2697 "Initialize a BUFFER to be used by `sh-mark-line'." 2705 "Initialize a BUFFER to be used by `sh-mark-line'."
2698 (save-excursion 2706 (with-current-buffer (get-buffer-create buffer)
2699 (set-buffer (get-buffer-create buffer))
2700 (erase-buffer) 2707 (erase-buffer)
2701 (occur-mode) 2708 (occur-mode)))
2702 ))
2703 2709
2704 2710
2705(defun sh-mark-line (message point buffer &optional add-linenum occur-point) 2711(defun sh-mark-line (message point buffer &optional add-linenum occur-point)
@@ -2972,8 +2978,7 @@ This command can often take a long time to run."
2972 (let ((var (car learned-var))) 2978 (let ((var (car learned-var)))
2973 (sh-mark-line (format " %s %s" var (symbol-value var)) 2979 (sh-mark-line (format " %s %s" var (symbol-value var))
2974 (nth 2 learned-var) out-buffer))) 2980 (nth 2 learned-var) out-buffer)))
2975 (save-excursion 2981 (with-current-buffer out-buffer
2976 (set-buffer out-buffer)
2977 (goto-char (point-min)) 2982 (goto-char (point-min))
2978 (insert 2983 (insert
2979 (format "Indentation values for buffer %s.\n" name) 2984 (format "Indentation values for buffer %s.\n" name)
@@ -3244,8 +3249,7 @@ nil means to return the best completion of STRING, or nil if there is none.
3244t means to return a list of all possible completions of STRING. 3249t means to return a list of all possible completions of STRING.
3245`lambda' means to return t if STRING is a valid completion as it stands." 3250`lambda' means to return t if STRING is a valid completion as it stands."
3246 (let ((sh-shell-variables 3251 (let ((sh-shell-variables
3247 (save-excursion 3252 (with-current-buffer sh-add-buffer
3248 (set-buffer sh-add-buffer)
3249 (or sh-shell-variables-initialized 3253 (or sh-shell-variables-initialized
3250 (sh-shell-initialize-variables)) 3254 (sh-shell-initialize-variables))
3251 (nconc (mapcar (lambda (var) 3255 (nconc (mapcar (lambda (var)
diff --git a/lisp/replace.el b/lisp/replace.el
index 4b745d54433..a8ef61e828d 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -921,21 +921,22 @@ If the value is nil, don't highlight the buffer names specially."
921 (when current-prefix-arg 921 (when current-prefix-arg
922 (prefix-numeric-value current-prefix-arg)))) 922 (prefix-numeric-value current-prefix-arg))))
923 923
924(defun occur-rename-buffer (&optional unique-p) 924(defun occur-rename-buffer (&optional unique-p interactive-p)
925 "Rename the current *Occur* buffer to *Occur: original-buffer-name*. 925 "Rename the current *Occur* buffer to *Occur: original-buffer-name*.
926Here `original-buffer-name' is the buffer name were occur was originally run. 926Here `original-buffer-name' is the buffer name were Occur was originally run.
927When given the prefix argument, the renaming will not clobber the existing 927When given the prefix argument, or called non-interactively, the renaming
928buffer(s) of that name, but use `generate-new-buffer-name' instead. 928will not clobber the existing buffer(s) of that name, but use
929You can add this to `occur-mode-hook' if you always want a separate *Occur* 929`generate-new-buffer-name' instead. You can add this to `occur-hook'
930buffer for each buffer where you invoke `occur'." 930if you always want a separate *Occur* buffer for each buffer where you
931 (interactive "P") 931invoke `occur'."
932 (interactive "P\np")
932 (with-current-buffer 933 (with-current-buffer
933 (if (eq major-mode 'occur-mode) (current-buffer) (get-buffer "*Occur*")) 934 (if (eq major-mode 'occur-mode) (current-buffer) (get-buffer "*Occur*"))
934 (rename-buffer (concat "*Occur: " 935 (rename-buffer (concat "*Occur: "
935 (mapconcat #'buffer-name 936 (mapconcat #'buffer-name
936 (car (cddr occur-revert-arguments)) "/") 937 (car (cddr occur-revert-arguments)) "/")
937 "*") 938 "*")
938 unique-p))) 939 (or unique-p (not interactive-p)))))
939 940
940(defun occur (regexp &optional nlines) 941(defun occur (regexp &optional nlines)
941 "Show all lines in the current buffer containing a match for REGEXP. 942 "Show all lines in the current buffer containing a match for REGEXP.
diff --git a/lisp/simple.el b/lisp/simple.el
index 3536253e120..4adc5b05273 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -110,6 +110,11 @@ If `fringe-arrow', indicate the locus by the fringe arrow."
110 :group 'next-error 110 :group 'next-error
111 :version "22.1") 111 :version "22.1")
112 112
113(defcustom next-error-hook nil
114 "*List of hook functions run by `next-error' after visiting source file."
115 :type 'hook
116 :group 'next-error)
117
113(defvar next-error-highlight-timer nil) 118(defvar next-error-highlight-timer nil)
114 119
115(defvar next-error-overlay-arrow-position nil) 120(defvar next-error-overlay-arrow-position nil)
@@ -240,9 +245,10 @@ To specify use of a particular buffer for error messages, type
240\\[next-error] in that buffer when it is the only one displayed 245\\[next-error] in that buffer when it is the only one displayed
241in the current frame. 246in the current frame.
242 247
243Once \\[next-error] has chosen the buffer for error messages, 248Once \\[next-error] has chosen the buffer for error messages, it
244it stays with that buffer until you use it in some other buffer which 249runs `next-error-hook' with `run-hooks', and stays with that buffer
245uses Compilation mode or Compilation Minor mode. 250until you use it in some other buffer which uses Compilation mode
251or Compilation Minor mode.
246 252
247See variables `compilation-parse-errors-function' and 253See variables `compilation-parse-errors-function' and
248\`compilation-error-regexp-alist' for customization ideas." 254\`compilation-error-regexp-alist' for customization ideas."
@@ -251,7 +257,8 @@ See variables `compilation-parse-errors-function' and
251 (when (setq next-error-last-buffer (next-error-find-buffer)) 257 (when (setq next-error-last-buffer (next-error-find-buffer))
252 ;; we know here that next-error-function is a valid symbol we can funcall 258 ;; we know here that next-error-function is a valid symbol we can funcall
253 (with-current-buffer next-error-last-buffer 259 (with-current-buffer next-error-last-buffer
254 (funcall next-error-function (prefix-numeric-value arg) reset)))) 260 (funcall next-error-function (prefix-numeric-value arg) reset)
261 (run-hooks 'next-error-hook))))
255 262
256(defalias 'goto-next-locus 'next-error) 263(defalias 'goto-next-locus 'next-error)
257(defalias 'next-match 'next-error) 264(defalias 'next-match 'next-error)
@@ -3433,51 +3440,41 @@ Outline mode sets this."
3433 ;; Now move a line. 3440 ;; Now move a line.
3434 (end-of-line) 3441 (end-of-line)
3435 ;; If there's no invisibility here, move over the newline. 3442 ;; If there's no invisibility here, move over the newline.
3436 (let ((pos-before (point)) 3443 (cond
3437 line-done) 3444 ((eobp)
3438 (if (eobp) 3445 (if (not noerror)
3439 (if (not noerror) 3446 (signal 'end-of-buffer nil)
3440 (signal 'end-of-buffer nil) 3447 (setq done t)))
3441 (setq done t))) 3448 ((and (> arg 1) ;; Use vertical-motion for last move
3442 (when (and (not done) 3449 (not (integerp selective-display))
3443 (not (integerp selective-display)) 3450 (not (line-move-invisible-p (point))))
3444 (not (line-move-invisible-p (point)))) 3451 ;; We avoid vertical-motion when possible
3445 (unless (overlays-in (max (1- pos-before) (point-min)) 3452 ;; because that has to fontify.
3446 (min (1+ (point)) (point-max))) 3453 (forward-line 1))
3447 ;; We avoid vertical-motion when possible 3454 ;; Otherwise move a more sophisticated way.
3448 ;; because that has to fontify. 3455 ((zerop (vertical-motion 1))
3449 (forward-line 1) 3456 (if (not noerror)
3450 (setq line-done t))) 3457 (signal 'end-of-buffer nil)
3451 (and (not done) (not line-done) 3458 (setq done t))))
3452 ;; Otherwise move a more sophisticated way.
3453 (zerop (vertical-motion 1))
3454 (if (not noerror)
3455 (signal 'end-of-buffer nil)
3456 (setq done t))))
3457 (unless done 3459 (unless done
3458 (setq arg (1- arg)))) 3460 (setq arg (1- arg))))
3459 ;; The logic of this is the same as the loop above, 3461 ;; The logic of this is the same as the loop above,
3460 ;; it just goes in the other direction. 3462 ;; it just goes in the other direction.
3461 (while (and (< arg 0) (not done)) 3463 (while (and (< arg 0) (not done))
3462 (beginning-of-line) 3464 (beginning-of-line)
3463 (let ((pos-before (point)) 3465 (cond
3464 line-done) 3466 ((bobp)
3465 (if (bobp) 3467 (if (not noerror)
3466 (if (not noerror) 3468 (signal 'beginning-of-buffer nil)
3467 (signal 'beginning-of-buffer nil) 3469 (setq done t)))
3468 (setq done t))) 3470 ((and (< arg -1) ;; Use vertical-motion for last move
3469 (when (and (not done) 3471 (not (integerp selective-display))
3470 (not (integerp selective-display)) 3472 (not (line-move-invisible-p (1- (point)))))
3471 (not (line-move-invisible-p (1- (point))))) 3473 (forward-line -1))
3472 (unless (overlays-in (max (1- (point)) (point-min)) 3474 ((zerop (vertical-motion -1))
3473 (min (1+ pos-before) (point-max))) 3475 (if (not noerror)
3474 (forward-line -1) 3476 (signal 'beginning-of-buffer nil)
3475 (setq line-done t))) 3477 (setq done t))))
3476 (and (not done) (not line-done)
3477 (zerop (vertical-motion -1))
3478 (if (not noerror)
3479 (signal 'beginning-of-buffer nil)
3480 (setq done t))))
3481 (unless done 3478 (unless done
3482 (setq arg (1+ arg)) 3479 (setq arg (1+ arg))
3483 (while (and ;; Don't move over previous invis lines 3480 (while (and ;; Don't move over previous invis lines
diff --git a/lisp/startup.el b/lisp/startup.el
index a4a6ac58bdf..18b331b3a5f 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -752,15 +752,7 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
752 ;; are not set. 752 ;; are not set.
753 (custom-reevaluate-setting 'blink-cursor-mode) 753 (custom-reevaluate-setting 'blink-cursor-mode)
754 (custom-reevaluate-setting 'normal-erase-is-backspace) 754 (custom-reevaluate-setting 'normal-erase-is-backspace)
755 755 (custom-reevaluate-setting 'tooltip-mode)
756 ;; If you change the code below, you need to also change the
757 ;; corresponding code in the tooltip-mode defcustom. The two need
758 ;; to be equivalent under all conditions, or Custom will get confused.
759 (unless (or noninteractive
760 emacs-basic-display
761 (not (display-graphic-p))
762 (not (fboundp 'x-show-tip)))
763 (tooltip-mode 1))
764 756
765 ;; Register default TTY colors for the case the terminal hasn't a 757 ;; Register default TTY colors for the case the terminal hasn't a
766 ;; terminal init file. 758 ;; terminal init file.
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index 4912f02c09d..5c3f671e6e0 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1377,6 +1377,17 @@ in `selection-converter-alist', which see."
1377 (save-buffer) ; It pops up the save dialog. 1377 (save-buffer) ; It pops up the save dialog.
1378 ) 1378 )
1379 1379
1380(defun mac-services-mail-selection ()
1381 (interactive)
1382 (compose-mail)
1383 (rfc822-goto-eoh)
1384 (forward-line 1)
1385 (insert (x-selection-value mac-services-selection) "\n"))
1386
1387(defun mac-services-mail-to ()
1388 (interactive)
1389 (compose-mail (x-selection-value mac-services-selection)))
1390
1380(defun mac-services-insert-text () 1391(defun mac-services-insert-text ()
1381 (interactive) 1392 (interactive)
1382 (let ((text (x-selection-value mac-services-selection))) 1393 (let ((text (x-selection-value mac-services-selection)))
@@ -1393,6 +1404,10 @@ in `selection-converter-alist', which see."
1393 'mac-services-open-file) 1404 'mac-services-open-file)
1394(define-key mac-application-menu-map [services perform open-selection] 1405(define-key mac-application-menu-map [services perform open-selection]
1395 'mac-services-open-selection) 1406 'mac-services-open-selection)
1407(define-key mac-application-menu-map [services perform mail-selection]
1408 'mac-services-mail-selection)
1409(define-key mac-application-menu-map [services perform mail-to]
1410 'mac-services-mail-to)
1396(define-key mac-application-menu-map [services paste] 1411(define-key mac-application-menu-map [services paste]
1397 'mac-services-insert-text) 1412 'mac-services-insert-text)
1398(define-key mac-application-menu-map [preferences] 'customize) 1413(define-key mac-application-menu-map [preferences] 'customize)
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 73163b5baec..76e1767a9fb 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1629,7 +1629,10 @@ Global `ispell-quit' set to start location to continue spell session."
1629 ;; setup the *Choices* buffer with valid data. 1629 ;; setup the *Choices* buffer with valid data.
1630 (save-excursion 1630 (save-excursion
1631 (set-buffer (get-buffer-create ispell-choices-buffer)) 1631 (set-buffer (get-buffer-create ispell-choices-buffer))
1632 (setq mode-line-format (concat "-- %b -- word: " word)) 1632 (setq mode-line-format
1633 (concat "-- %b -- word: " word
1634 " -- dict: " (or ispell-current-dictionary "default")
1635 " -- prog: " (file-name-nondirectory ispell-program-name)))
1633 ;; XEmacs: no need for horizontal scrollbar in choices window 1636 ;; XEmacs: no need for horizontal scrollbar in choices window
1634 (with-no-warnings 1637 (with-no-warnings
1635 (and (fboundp 'set-specifier) 1638 (and (fboundp 'set-specifier)
@@ -1789,9 +1792,10 @@ Global `ispell-quit' set to start location to continue spell session."
1789 (erase-buffer) 1792 (erase-buffer)
1790 (setq count ?0 1793 (setq count ?0
1791 skipped 0 1794 skipped 0
1792 mode-line-format (concat 1795 mode-line-format
1793 "-- %b -- word: " 1796 (concat "-- %b -- word: " new-word
1794 new-word) 1797 " -- dict: "
1798 ispell-alternate-dictionary)
1795 miss (lookup-words new-word) 1799 miss (lookup-words new-word)
1796 choices miss 1800 choices miss
1797 line ispell-choices-win-default-height) 1801 line ispell-choices-win-default-height)
@@ -2482,9 +2486,10 @@ Return nil if spell session is quit,
2482 (rstart (make-marker))) 2486 (rstart (make-marker)))
2483 (unwind-protect 2487 (unwind-protect
2484 (save-excursion 2488 (save-excursion
2485 (message "Spell checking %s using %s dictionary..." 2489 (message "Spell checking %s using %s with %s dictionary..."
2486 (if (and (= reg-start (point-min)) (= reg-end (point-max))) 2490 (if (and (= reg-start (point-min)) (= reg-end (point-max)))
2487 (buffer-name) "region") 2491 (buffer-name) "region")
2492 (file-name-nondirectory ispell-program-name)
2488 (or ispell-current-dictionary "default")) 2493 (or ispell-current-dictionary "default"))
2489 ;; Returns cursor to original location. 2494 ;; Returns cursor to original location.
2490 (save-window-excursion 2495 (save-window-excursion
@@ -2502,7 +2507,8 @@ Return nil if spell session is quit,
2502 (set-marker skip-region-start (- (point) (length key))) 2507 (set-marker skip-region-start (- (point) (length key)))
2503 (goto-char reg-start))) 2508 (goto-char reg-start)))
2504 (let (message-log-max) 2509 (let (message-log-max)
2505 (message "Continuing spelling check using %s dictionary..." 2510 (message "Continuing spelling check using %s with %s dictionary..."
2511 (file-name-nondirectory ispell-program-name)
2506 (or ispell-current-dictionary "default"))) 2512 (or ispell-current-dictionary "default")))
2507 (set-marker rstart reg-start) 2513 (set-marker rstart reg-start)
2508 (set-marker ispell-region-end reg-end) 2514 (set-marker ispell-region-end reg-end)
@@ -2579,7 +2585,9 @@ Return nil if spell session is quit,
2579 (if (not recheckp) (set-marker ispell-region-end nil)) 2585 (if (not recheckp) (set-marker ispell-region-end nil))
2580 ;; Only save if successful exit. 2586 ;; Only save if successful exit.
2581 (ispell-pdict-save ispell-silently-savep) 2587 (ispell-pdict-save ispell-silently-savep)
2582 (message "Spell-checking done"))))) 2588 (message "Spell-checking using %s with %s dictionary done"
2589 (file-name-nondirectory ispell-program-name)
2590 (or ispell-current-dictionary "default"))))))
2583 2591
2584 2592
2585(defun ispell-begin-skip-region-regexp () 2593(defun ispell-begin-skip-region-regexp ()
@@ -2930,7 +2938,8 @@ Returns the sum shift due to changes in word replacements."
2930 )) 2938 ))
2931 (if (not ispell-quit) 2939 (if (not ispell-quit)
2932 (let (message-log-max) 2940 (let (message-log-max)
2933 (message "Continuing spelling check using %s dictionary..." 2941 (message "Continuing spelling check using %s with %s dictionary..."
2942 (file-name-nondirectory ispell-program-name)
2934 (or ispell-current-dictionary "default")))) 2943 (or ispell-current-dictionary "default"))))
2935 (sit-for 0) 2944 (sit-for 0)
2936 (setq start (marker-position line-start) 2945 (setq start (marker-position line-start)
diff --git a/lisp/timezone.el b/lisp/timezone.el
index cd6e3ce769f..692e2a682ce 100644
--- a/lisp/timezone.el
+++ b/lisp/timezone.el
@@ -149,7 +149,7 @@ Understands the following styles:
149 (time nil) 149 (time nil)
150 (zone nil)) ;This may be nil. 150 (zone nil)) ;This may be nil.
151 (cond ((string-match 151 (cond ((string-match
152 "\\([0-9]+\\)[ \t]+\\([^ \t,]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9:]+\\)[ \t]*\\([-+a-zA-Z0-9]+\\)" date) 152 "\\([0-9]+\\)[ \t]+\\([^ \t,]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9:]+\\)[ \t]+\\([-+a-zA-Z0-9]+\\)" date)
153 ;; Styles: (1) and (2) with timezone and buggy timezone 153 ;; Styles: (1) and (2) with timezone and buggy timezone
154 ;; This is most common in mail and news, 154 ;; This is most common in mail and news,
155 ;; so it is worth trying first. 155 ;; so it is worth trying first.
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index fabb154d7ed..309edde1749 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -154,18 +154,15 @@ This might return nil if the event did not occur over a buffer."
154;; set-buffer prevents redisplay optimizations, so every mouse motion 154;; set-buffer prevents redisplay optimizations, so every mouse motion
155;; would be accompanied by a full redisplay. 155;; would be accompanied by a full redisplay.
156 156
157;;;###autoload
158(define-minor-mode tooltip-mode 157(define-minor-mode tooltip-mode
159 "Toggle Tooltip display. 158 "Toggle Tooltip display.
160With ARG, turn tooltip mode on if and only if ARG is positive." 159With ARG, turn tooltip mode on if and only if ARG is positive."
161 :global t 160 :global t
162 ;; If you change the :init-value below, you also need to change the
163 ;; corresponding code in startup.el.
164 :init-value (not (or noninteractive 161 :init-value (not (or noninteractive
165 (and (boundp 'emacs-quick-startup) emacs-quick-startup) 162 emacs-quick-startup
166 (not (and (fboundp 'display-graphic-p) 163 (not (display-graphic-p))
167 (display-graphic-p)))
168 (not (fboundp 'x-show-tip)))) 164 (not (fboundp 'x-show-tip))))
165 :initialize 'custom-initialize-safe-default
169 :group 'tooltip 166 :group 'tooltip
170 (unless (or (null tooltip-mode) (fboundp 'x-show-tip)) 167 (unless (or (null tooltip-mode) (fboundp 'x-show-tip))
171 (error "Sorry, tooltips are not yet available on this system")) 168 (error "Sorry, tooltips are not yet available on this system"))
diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index f1255df9482..6db1e2b2f3c 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -109,32 +109,32 @@ visited by the buffers.")
109(put 'whitespace-mode-line 'permanent-local nil) 109(put 'whitespace-mode-line 'permanent-local nil)
110 110
111(defvar whitespace-check-buffer-leading nil 111(defvar whitespace-check-buffer-leading nil
112 "Test leading whitespace for file in current buffer if t") 112 "Test leading whitespace for file in current buffer if t.")
113(make-variable-buffer-local 'whitespace-check-buffer-leading) 113(make-variable-buffer-local 'whitespace-check-buffer-leading)
114(put 'whitespace-check-buffer-leading 'permanent-local nil) 114(put 'whitespace-check-buffer-leading 'permanent-local nil)
115 115
116(defvar whitespace-check-buffer-trailing nil 116(defvar whitespace-check-buffer-trailing nil
117 "Test trailing whitespace for file in current buffer if t") 117 "Test trailing whitespace for file in current buffer if t.")
118(make-variable-buffer-local 'whitespace-check-buffer-trailing) 118(make-variable-buffer-local 'whitespace-check-buffer-trailing)
119(put 'whitespace-check-buffer-trailing 'permanent-local nil) 119(put 'whitespace-check-buffer-trailing 'permanent-local nil)
120 120
121(defvar whitespace-check-buffer-indent nil 121(defvar whitespace-check-buffer-indent nil
122 "Test indentation whitespace for file in current buffer if t") 122 "Test indentation whitespace for file in current buffer if t.")
123(make-variable-buffer-local 'whitespace-check-buffer-indent) 123(make-variable-buffer-local 'whitespace-check-buffer-indent)
124(put 'whitespace-check-buffer-indent 'permanent-local nil) 124(put 'whitespace-check-buffer-indent 'permanent-local nil)
125 125
126(defvar whitespace-check-buffer-spacetab nil 126(defvar whitespace-check-buffer-spacetab nil
127 "Test Space-followed-by-TABS whitespace for file in current buffer if t") 127 "Test Space-followed-by-TABS whitespace for file in current buffer if t.")
128(make-variable-buffer-local 'whitespace-check-buffer-spacetab) 128(make-variable-buffer-local 'whitespace-check-buffer-spacetab)
129(put 'whitespace-check-buffer-spacetab 'permanent-local nil) 129(put 'whitespace-check-buffer-spacetab 'permanent-local nil)
130 130
131(defvar whitespace-check-buffer-ateol nil 131(defvar whitespace-check-buffer-ateol nil
132 "Test end-of-line whitespace for file in current buffer if t") 132 "Test end-of-line whitespace for file in current buffer if t.")
133(make-variable-buffer-local 'whitespace-check-buffer-ateol) 133(make-variable-buffer-local 'whitespace-check-buffer-ateol)
134(put 'whitespace-check-buffer-ateol 'permanent-local nil) 134(put 'whitespace-check-buffer-ateol 'permanent-local nil)
135 135
136(defvar whitespace-highlighted-space nil 136(defvar whitespace-highlighted-space nil
137 "The variable to store the extent to highlight") 137 "The variable to store the extent to highlight.")
138(make-variable-buffer-local 'whitespace-highlighted-space) 138(make-variable-buffer-local 'whitespace-highlighted-space)
139(put 'whitespace-highlighted-space 'permanent-local nil) 139(put 'whitespace-highlighted-space 'permanent-local nil)
140 140
@@ -142,13 +142,12 @@ visited by the buffers.")
142(eval-when-compile 142(eval-when-compile
143 (if (not (fboundp 'defgroup)) 143 (if (not (fboundp 'defgroup))
144 (defmacro defgroup (sym memb doc &rest args) 144 (defmacro defgroup (sym memb doc &rest args)
145 "Null macro for defgroup in all versions of Emacs that don't define 145 "Null macro for `defgroup' in all versions of Emacs that don't define it."
146defgroup"
147 t)) 146 t))
148 (if (not (fboundp 'defcustom)) 147 (if (not (fboundp 'defcustom))
149 (defmacro defcustom (sym val doc &rest args) 148 (defmacro defcustom (sym val doc &rest args)
150 "Macro to alias defcustom to defvar in all versions of Emacs that 149 "Macro to alias `defcustom' to `defvar' in all versions of Emacs that
151don't define defcustom" 150don't define it."
152 `(defvar ,sym ,val ,doc)))) 151 `(defvar ,sym ,val ,doc))))
153 152
154(if (fboundp 'make-overlay) 153(if (fboundp 'make-overlay)
@@ -180,23 +179,23 @@ don't define defcustom"
180 :group 'convenience)) 179 :group 'convenience))
181 180
182(defcustom whitespace-check-leading-whitespace t 181(defcustom whitespace-check-leading-whitespace t
183 "Flag to check leading whitespace. This is the global for the system. 182 "Flag to check leading whitespace. This is the global for the system.
184It can be overriden by setting a buffer local variable 183It can be overriden by setting a buffer local variable
185`whitespace-check-buffer-leading'" 184`whitespace-check-buffer-leading'."
186 :type 'boolean 185 :type 'boolean
187 :group 'whitespace) 186 :group 'whitespace)
188 187
189(defcustom whitespace-check-trailing-whitespace t 188(defcustom whitespace-check-trailing-whitespace t
190 "Flag to check trailing whitespace. This is the global for the system. 189 "Flag to check trailing whitespace. This is the global for the system.
191It can be overriden by setting a buffer local variable 190It can be overriden by setting a buffer local variable
192`whitespace-check-buffer-trailing'" 191`whitespace-check-buffer-trailing'."
193 :type 'boolean 192 :type 'boolean
194 :group 'whitespace) 193 :group 'whitespace)
195 194
196(defcustom whitespace-check-spacetab-whitespace t 195(defcustom whitespace-check-spacetab-whitespace t
197 "Flag to check space followed by a TAB. This is the global for the system. 196 "Flag to check space followed by a TAB. This is the global for the system.
198It can be overriden by setting a buffer local variable 197It can be overriden by setting a buffer local variable
199`whitespace-check-buffer-spacetab'" 198`whitespace-check-buffer-spacetab'."
200 :type 'boolean 199 :type 'boolean
201 :group 'whitespace) 200 :group 'whitespace)
202 201
@@ -206,9 +205,9 @@ It can be overriden by setting a buffer local variable
206 :group 'whitespace) 205 :group 'whitespace)
207 206
208(defcustom whitespace-check-indent-whitespace indent-tabs-mode 207(defcustom whitespace-check-indent-whitespace indent-tabs-mode
209 "Flag to check indentation whitespace. This is the global for the system. 208 "Flag to check indentation whitespace. This is the global for the system.
210It can be overriden by setting a buffer local variable 209It can be overriden by setting a buffer local variable
211`whitespace-check-buffer-indent'" 210`whitespace-check-buffer-indent'."
212 :type 'boolean 211 :type 'boolean
213 :group 'whitespace) 212 :group 'whitespace)
214 213
@@ -218,9 +217,9 @@ It can be overriden by setting a buffer local variable
218 :group 'whitespace) 217 :group 'whitespace)
219 218
220(defcustom whitespace-check-ateol-whitespace t 219(defcustom whitespace-check-ateol-whitespace t
221 "Flag to check end-of-line whitespace. This is the global for the system. 220 "Flag to check end-of-line whitespace. This is the global for the system.
222It can be overriden by setting a buffer local variable 221It can be overriden by setting a buffer local variable
223`whitespace-check-buffer-ateol'" 222`whitespace-check-buffer-ateol'."
224 :type 'boolean 223 :type 'boolean
225 :group 'whitespace) 224 :group 'whitespace)
226 225
@@ -242,9 +241,9 @@ determines a file to be clean."
242 :group 'whitespace) 241 :group 'whitespace)
243 242
244(defcustom whitespace-abort-on-error nil 243(defcustom whitespace-abort-on-error nil
245 "While writing a file, abort if the file is unclean. If 244 "While writing a file, abort if the file is unclean.
246`whitespace-auto-cleanup' is set, that takes precedence over this 245If `whitespace-auto-cleanup' is set, that takes precedence over
247variable." 246this variable."
248 :type 'boolean 247 :type 'boolean
249 :group 'whitespace) 248 :group 'whitespace)
250 249
@@ -277,7 +276,7 @@ Errors*' buffer before opening (or closing) another file."
277 tcl-mode tex-mode texinfo-mode 276 tcl-mode tex-mode texinfo-mode
278 vrml-mode xml-mode) 277 vrml-mode xml-mode)
279 278
280 "Major Modes in which we turn on whitespace checking. 279 "Major modes in which we turn on whitespace checking.
281 280
282These are mostly programming and documentation modes. But you may add other 281These are mostly programming and documentation modes. But you may add other
283modes that you want whitespaces checked in by adding something like the 282modes that you want whitespaces checked in by adding something like the
@@ -608,17 +607,9 @@ whitespace problems."
608(defun whitespace-buffer-leading-cleanup () 607(defun whitespace-buffer-leading-cleanup ()
609 "Remove any empty lines at the top of the file." 608 "Remove any empty lines at the top of the file."
610 (save-excursion 609 (save-excursion
611 (let ((pmin nil) 610 (goto-char (point-min))
612 (pmax nil)) 611 (skip-chars-forward "\n")
613 (goto-char (point-min)) 612 (delete-region (point-min) (point))))
614 (beginning-of-line)
615 (setq pmin (point))
616 (end-of-line)
617 (setq pmax (point))
618 (if (equal pmin pmax)
619 (progn
620 (kill-line)
621 (whitespace-buffer-leading-cleanup))))))
622 613
623(defun whitespace-buffer-trailing () 614(defun whitespace-buffer-trailing ()
624 "Check to see if are is more than one empty line at the bottom." 615 "Check to see if are is more than one empty line at the bottom."
@@ -647,26 +638,11 @@ whitespace problems."
647(defun whitespace-buffer-trailing-cleanup () 638(defun whitespace-buffer-trailing-cleanup ()
648 "Delete all the empty lines at the bottom." 639 "Delete all the empty lines at the bottom."
649 (save-excursion 640 (save-excursion
650 (let ((pmin nil) 641 (goto-char (point-max))
651 (pmax nil)) 642 (skip-chars-backward "\n")
652 (goto-char (point-max)) 643 (if (not (bolp))
653 (beginning-of-line) 644 (forward-char 1))
654 (setq pmin (point)) 645 (delete-region (point) (point-max))))
655 (end-of-line)
656 (setq pmax (point))
657 (if (equal pmin pmax)
658 (progn
659 (goto-char (1- pmin))
660 (beginning-of-line)
661 (setq pmin (point))
662 (end-of-line)
663 (setq pmax (point))
664 (if (equal pmin pmax)
665 (progn
666 (goto-char (1- (point-max)))
667 (beginning-of-line)
668 (kill-line)
669 (whitespace-buffer-trailing-cleanup))))))))
670 646
671(defun whitespace-buffer-search (regexp) 647(defun whitespace-buffer-search (regexp)
672 "Search for any given whitespace REGEXP." 648 "Search for any given whitespace REGEXP."
diff --git a/lisp/winner.el b/lisp/winner.el
index c64d00d6255..af72bea14d2 100644
--- a/lisp/winner.el
+++ b/lisp/winner.el
@@ -78,7 +78,7 @@
78 78
79;;;###autoload 79;;;###autoload
80(defcustom winner-mode nil 80(defcustom winner-mode nil
81 "Toggle winner-mode. 81 "Toggle Winner mode.
82Setting this variable directly does not take effect; 82Setting this variable directly does not take effect;
83use either \\[customize] or the function `winner-mode'." 83use either \\[customize] or the function `winner-mode'."
84 :set #'(lambda (symbol value) (funcall symbol (or value 0))) 84 :set #'(lambda (symbol value) (funcall symbol (or value 0)))
@@ -98,8 +98,7 @@ use either \\[customize] or the function `winner-mode'."
98 :group 'winner) 98 :group 'winner)
99 99
100(defcustom winner-boring-buffers '("*Completions*") 100(defcustom winner-boring-buffers '("*Completions*")
101 "`winner-undo' will not restore windows displaying any of these \ 101 "`winner-undo' will not restore windows displaying any of these buffers.
102buffers.
103You may want to include buffer names such as *Help*, *Apropos*, 102You may want to include buffer names such as *Help*, *Apropos*,
104*Buffer List*, *info* and *Compile-Log*." 103*Buffer List*, *info* and *Compile-Log*."
105 :type '(repeat string) 104 :type '(repeat string)
@@ -108,7 +107,8 @@ You may want to include buffer names such as *Help*, *Apropos*,
108 107
109 108
110 109
111 ;;;; Saving old configurations (internal variables and subroutines) 110
111;;;; Saving old configurations (internal variables and subroutines)
112 112
113 113
114;;; Current configuration 114;;; Current configuration
@@ -162,13 +162,13 @@ You may want to include buffer names such as *Help*, *Apropos*,
162;; Find the right ring. If it does not exist, create one. 162;; Find the right ring. If it does not exist, create one.
163(defsubst winner-ring (frame) 163(defsubst winner-ring (frame)
164 (or (cdr (assq frame winner-ring-alist)) 164 (or (cdr (assq frame winner-ring-alist))
165 (progn 165 (let ((ring (make-ring winner-ring-size)))
166 (let ((ring (make-ring winner-ring-size))) 166 (ring-insert ring (winner-configuration frame))
167 (ring-insert ring (winner-configuration frame)) 167 (push (cons frame ring) winner-ring-alist)
168 (push (cons frame ring) winner-ring-alist) 168 ring)))
169 ring))))
170 169
171 ;; If the same command is called several times in a row, 170
171;; If the same command is called several times in a row,
172;; we only save one window configuration. 172;; we only save one window configuration.
173(defvar winner-last-command nil) 173(defvar winner-last-command nil)
174 174
@@ -176,7 +176,7 @@ You may want to include buffer names such as *Help*, *Apropos*,
176(defvar winner-last-frames nil) 176(defvar winner-last-frames nil)
177 177
178 178
179(defun winner-equal (a b) 179(defsubst winner-equal (a b)
180 "Check whether two Winner configurations (as produced by 180 "Check whether two Winner configurations (as produced by
181`winner-conf') are equal." 181`winner-conf') are equal."
182 (equal (cdr a) (cdr b))) 182 (equal (cdr a) (cdr b)))
@@ -240,7 +240,8 @@ You may want to include buffer names such as *Help*, *Apropos*,
240 240
241 241
242 242
243 ;;;; Restoring configurations 243
244;;;; Restoring configurations
244 245
245;; Works almost as `set-window-configuration', 246;; Works almost as `set-window-configuration',
246;; but does not change the contents or the size of the minibuffer, 247;; but does not change the contents or the size of the minibuffer,
@@ -301,7 +302,8 @@ You may want to include buffer names such as *Help*, *Apropos*,
301 winner-point-alist) 302 winner-point-alist)
302 (point))))))) 303 (point)))))))
303 304
304 ;; Make sure point does not end up in the minibuffer and delete 305
306;; Make sure point does not end up in the minibuffer and delete
305;; windows displaying dead or boring buffers 307;; windows displaying dead or boring buffers
306;; (c.f. `winner-boring-buffers'). Return nil iff all the windows 308;; (c.f. `winner-boring-buffers'). Return nil iff all the windows
307;; should be deleted. Preserve correct points and marks. 309;; should be deleted. Preserve correct points and marks.
@@ -410,7 +412,7 @@ With arg, turn Winner mode on if and only if arg is positive."
410(defvar winner-undo-frame nil) 412(defvar winner-undo-frame nil)
411 413
412(defvar winner-pending-undo-ring nil 414(defvar winner-pending-undo-ring nil
413 "The ring currently used by winner undo.") 415 "The ring currently used by `winner-undo'.")
414(defvar winner-undo-counter nil) 416(defvar winner-undo-counter nil)
415(defvar winner-undone-data nil) ; There confs have been passed. 417(defvar winner-undone-data nil) ; There confs have been passed.
416 418
@@ -437,7 +439,8 @@ In other words, \"undo\" changes in window configuration."
437 439
438 440
439 441
440 (defun winner-undo-this () ; The heart of winner undo. 442
443(defun winner-undo-this () ; The heart of winner undo.
441 (loop 444 (loop
442 (cond 445 (cond
443 ((>= winner-undo-counter (ring-length winner-pending-undo-ring)) 446 ((>= winner-undo-counter (ring-length winner-pending-undo-ring))
@@ -467,7 +470,7 @@ In other words, \"undo\" changes in window configuration."
467 (ring-ref winner-pending-undo-ring 0))) 470 (ring-ref winner-pending-undo-ring 0)))
468 (unless (eq (selected-window) (minibuffer-window)) 471 (unless (eq (selected-window) (minibuffer-window))
469 (message "Winner undid undo"))) 472 (message "Winner undid undo")))
470 (t (error "Previous command was not a winner-undo")))) 473 (t (error "Previous command was not a `winner-undo'"))))
471 474
472;;; To be evaluated when the package is loaded: 475;;; To be evaluated when the package is loaded:
473 476
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index cddd1d506b0..d0590a47551 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,26 @@
12005-07-13 Luc Teirlinck <teirllm@auburn.edu>
2
3 * customize.texi (Variable Definitions): Add
4 `custom-initialize-safe-set' and `custom-initialize-safe-default'.
5 `standard-value' is a list too.
6 (Defining New Types): Use @key{RET} instead of @key{ret}.
7
82005-07-13 Francis Litterio <franl@world.std.com> (tiny change)
9
10 * os.texi (Translating Input): Fix typo.
11
122005-07-08 Richard M. Stallman <rms@gnu.org>
13
14 * README: Update edition number and size estimate.
15
16 * elisp.texi (VERSION): Set to 2.9.
17
182005-07-07 Richard M. Stallman <rms@gnu.org>
19
20 * book-spine.texinfo: Update Emacs version.
21
22 * display.texi (Inverse Video): Delete mode-line-inverse-video.
23
12005-07-06 Richard M. Stallman <rms@gnu.org> 242005-07-06 Richard M. Stallman <rms@gnu.org>
2 25
3 * searching.texi (Regexp Search): Clarify what re-search-forward 26 * searching.texi (Regexp Search): Clarify what re-search-forward
diff --git a/lispref/README b/lispref/README
index 1600a5344b3..c9a49f8693b 100644
--- a/lispref/README
+++ b/lispref/README
@@ -1,4 +1,4 @@
1README for Edition 2.8 of the Emacs Lisp Reference Manual. 1README for Edition 2.9 of the Emacs Lisp Reference Manual.
2 2
3* This directory contains the texinfo source files for the Reference 3* This directory contains the texinfo source files for the Reference
4Manual, make-permuted-index, and the latest version of texinfo.tex, 4Manual, make-permuted-index, and the latest version of texinfo.tex,
@@ -11,7 +11,7 @@ Emacs bugs, use bug-gnu-emacs@gnu.org. To ask questions, use the
11newsgroup gnu.emacs.help. 11newsgroup gnu.emacs.help.
12 12
13* The Emacs Lisp Reference Manual is quite large. It totals around 13* The Emacs Lisp Reference Manual is quite large. It totals around
14980 pages in smallbook format; the info files total almost 141100 pages in smallbook format; the info files total over
152.5 megabytes. 152.5 megabytes.
16 16
17* You can format this manual either for Info or for printing hardcopy 17* You can format this manual either for Info or for printing hardcopy
diff --git a/lispref/book-spine.texinfo b/lispref/book-spine.texinfo
index cb52cc6fc3c..7355c4530ae 100644
--- a/lispref/book-spine.texinfo
+++ b/lispref/book-spine.texinfo
@@ -11,7 +11,7 @@
11@center @titlefont{GNU Emacs Lisp Reference Manual} 11@center @titlefont{GNU Emacs Lisp Reference Manual}
12@sp 5 12@sp 5
13@center GNU 13@center GNU
14@center Emacs Version 19.25 14@center Emacs Version 22.1
15@center for Unix Users 15@center for Unix Users
16@sp 5 16@sp 5
17 17
diff --git a/lispref/customize.texi b/lispref/customize.texi
index baaceae47f0..8ee82f088a8 100644
--- a/lispref/customize.texi
+++ b/lispref/customize.texi
@@ -12,7 +12,7 @@ and also customization groups for classifying them. We use the term
12definitions---as well as face definitions (@pxref{Defining Faces}). 12definitions---as well as face definitions (@pxref{Defining Faces}).
13 13
14@menu 14@menu
15* Common Keywords:: Common keyword arguments for all kinds of 15* Common Keywords:: Common keyword arguments for all kinds of
16 customization declarations. 16 customization declarations.
17* Group Definitions:: Writing customization group definitions. 17* Group Definitions:: Writing customization group definitions.
18* Variable Definitions:: Declaring user options. 18* Variable Definitions:: Declaring user options.
@@ -270,6 +270,22 @@ This is the default @code{:initialize} function.
270Use the @code{:set} function to initialize the variable, if it is 270Use the @code{:set} function to initialize the variable, if it is
271already set or has been customized; otherwise, just use 271already set or has been customized; otherwise, just use
272@code{set-default}. 272@code{set-default}.
273
274@item custom-initialize-safe-set
275@itemx custom-initialize-safe-default
276These functions behave like @code{custom-initialize-set}
277(@code{custom-initialize-default}, respectively), but catch errors.
278If an error occurs during initialization, they set the variable to
279@code{nil} using @code{set-default}, and throw no error.
280
281These two functions are only meant for options defined in pre-loaded
282files, where some variables or functions used to compute the option's
283value may not yet be defined. The option normally gets updated in
284@file{startup.el}, ignoring the previously computed value. Because of
285this typical usage, the value which these two functions compute
286normally only matters when, after startup, one unsets the option's
287value and then reevaluates the defcustom. By that time, the necessary
288variables and functions will be defined, so there will not be an error.
273@end table 289@end table
274 290
275@item :set-after @var{variables} 291@item :set-after @var{variables}
@@ -318,8 +334,8 @@ type of @var{symbol}.
318Internally, @code{defcustom} uses the symbol property 334Internally, @code{defcustom} uses the symbol property
319@code{standard-value} to record the expression for the default value, 335@code{standard-value} to record the expression for the default value,
320and @code{saved-value} to record the value saved by the user with the 336and @code{saved-value} to record the value saved by the user with the
321customization buffer. The @code{saved-value} property is actually a 337customization buffer. Both properties are actually lists whose car is
322list whose car is an expression which evaluates to the value. 338an expression which evaluates to the value.
323 339
324@node Customization Types 340@node Customization Types
325@section Customization Types 341@section Customization Types
@@ -1088,8 +1104,8 @@ widget. For the purpose of defining new customization types, the
1088argument with the same syntax as the keyword argument to 1104argument with the same syntax as the keyword argument to
1089@code{defcustom} with the same name. The third argument is a 1105@code{defcustom} with the same name. The third argument is a
1090documentation string for the new widget. You will be able to see that 1106documentation string for the new widget. You will be able to see that
1091string with the @kbd{M-x widget-browse @key{ret} binary-tree-of-string 1107string with the @kbd{M-x widget-browse @key{RET} binary-tree-of-string
1092@key{ret}} command. 1108@key{RET}} command.
1093 1109
1094After these mandatory arguments follow the keyword arguments. The most 1110After these mandatory arguments follow the keyword arguments. The most
1095important is @code{:type}, which describes the data type we want to match 1111important is @code{:type}, which describes the data type we want to match
diff --git a/lispref/display.texi b/lispref/display.texi
index 958ca0325e9..75d20f7e51c 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -1387,6 +1387,10 @@ modified, and the length of the pre-change text replaced by that range.
1387length is the number of characters deleted, and the post-change 1387length is the number of characters deleted, and the post-change
1388beginning and end are equal.) 1388beginning and end are equal.)
1389 1389
1390If these functions modify the buffer, they should bind
1391@code{inhibit-modification-hooks} to @code{t} around doing so, to
1392avoid confusing the internal mechanism that calls these hooks.
1393
1390@item insert-in-front-hooks 1394@item insert-in-front-hooks
1391@kindex insert-in-front-hooks @r{(overlay property)} 1395@kindex insert-in-front-hooks @r{(overlay property)}
1392This property's value is a list of functions to be called before and 1396This property's value is a list of functions to be called before and
@@ -1716,8 +1720,7 @@ This face is used for ordinary text.
1716@item mode-line 1720@item mode-line
1717@kindex mode-line @r{(face name)} 1721@kindex mode-line @r{(face name)}
1718This face is used for the mode line of the selected window, and for 1722This face is used for the mode line of the selected window, and for
1719menu bars when toolkit menus are not used---but only if 1723menu bars when toolkit menus are not used.
1720@code{mode-line-inverse-video} is non-@code{nil}.
1721 1724
1722@item modeline 1725@item modeline
1723@kindex modeline @r{(face name)} 1726@kindex modeline @r{(face name)}
@@ -4598,13 +4601,6 @@ on the screen. Non-@code{nil} means yes, @code{nil} means no. The
4598default is @code{nil}. 4601default is @code{nil}.
4599@end defopt 4602@end defopt
4600 4603
4601@defopt mode-line-inverse-video
4602This variable controls the use of inverse video for mode lines and
4603menu bars. If it is non-@code{nil}, then these lines are displayed in
4604the face @code{mode-line}. Otherwise, these lines are displayed
4605normally, just like other text. The default is @code{t}.
4606@end defopt
4607
4608@node Usual Display 4604@node Usual Display
4609@section Usual Display Conventions 4605@section Usual Display Conventions
4610 4606
diff --git a/lispref/elisp.texi b/lispref/elisp.texi
index f954cdc220e..64b4ee90292 100644
--- a/lispref/elisp.texi
+++ b/lispref/elisp.texi
@@ -6,7 +6,7 @@
6 6
7@c Version of the manual and of Emacs. 7@c Version of the manual and of Emacs.
8@c Please remember to update the edition number in README as well. 8@c Please remember to update the edition number in README as well.
9@set VERSION 2.7 9@set VERSION 2.9
10@set EMACSVER 22.0.50 10@set EMACSVER 22.0.50
11 11
12@dircategory Emacs 12@dircategory Emacs
diff --git a/lispref/os.texi b/lispref/os.texi
index 7bc76799210..1e6dacb7d80 100644
--- a/lispref/os.texi
+++ b/lispref/os.texi
@@ -1721,7 +1721,7 @@ Note however that actual key bindings can have an effect on
1721@code{key-translation-map}, even though they are overridden by it. 1721@code{key-translation-map}, even though they are overridden by it.
1722Indeed, actual key bindings override @code{function-key-map} and thus 1722Indeed, actual key bindings override @code{function-key-map} and thus
1723may alter the key sequence that @code{key-translation-map} receives. 1723may alter the key sequence that @code{key-translation-map} receives.
1724Clearly, it is better to avoid to avoid this type of situation. 1724Clearly, it is better to avoid this type of situation.
1725 1725
1726The intent of @code{key-translation-map} is for users to map one 1726The intent of @code{key-translation-map} is for users to map one
1727character set to another, including ordinary characters normally bound 1727character set to another, including ordinary characters normally bound
diff --git a/mac/ChangeLog b/mac/ChangeLog
index a53b3cd89d4..8715ea3319f 100644
--- a/mac/ChangeLog
+++ b/mac/ChangeLog
@@ -1,3 +1,8 @@
12005-07-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * Emacs.app/Contents/Info.plist (mail-to, mail-selection): New
4 NSServices.
5
12005-07-04 Lute Kamstra <lute@gnu.org> 62005-07-04 Lute Kamstra <lute@gnu.org>
2 7
3 Update FSF's address in GPL notices. 8 Update FSF's address in GPL notices.
diff --git a/mac/Emacs.app/Contents/Info.plist b/mac/Emacs.app/Contents/Info.plist
index 7f79e8f6ab0..176dbf81276 100644
--- a/mac/Emacs.app/Contents/Info.plist
+++ b/mac/Emacs.app/Contents/Info.plist
@@ -75,6 +75,44 @@
75 <string>NSStringPboardType</string> 75 <string>NSStringPboardType</string>
76 </array> 76 </array>
77 </dict> 77 </dict>
78 <dict>
79 <key>NSKeyEquivalent</key>
80 <dict/>
81 <key>NSMenuItem</key>
82 <dict>
83 <key>default</key>
84 <string>Emacs/Send Selection</string>
85 </dict>
86 <key>NSMessage</key>
87 <string>mail-selection</string>
88 <key>NSPortName</key>
89 <string>Emacs</string>
90 <key>NSReturnTypes</key>
91 <array/>
92 <key>NSSendTypes</key>
93 <array>
94 <string>NSStringPboardType</string>
95 </array>
96 </dict>
97 <dict>
98 <key>NSKeyEquivalent</key>
99 <dict/>
100 <key>NSMenuItem</key>
101 <dict>
102 <key>default</key>
103 <string>Emacs/Send To</string>
104 </dict>
105 <key>NSMessage</key>
106 <string>mail-to</string>
107 <key>NSPortName</key>
108 <string>Emacs</string>
109 <key>NSReturnTypes</key>
110 <array/>
111 <key>NSSendTypes</key>
112 <array>
113 <string>NSStringPboardType</string>
114 </array>
115 </dict>
78 </array> 116 </array>
79</dict> 117</dict>
80</plist> 118</plist>
diff --git a/man/ChangeLog b/man/ChangeLog
index c8ace6938bb..2c5852598e0 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,35 @@
12005-07-08 Kenichi Handa <handa@m17n.org>
2
3 * mule.texi (Recognize Coding): Recommend
4 revert-buffer-with-coding-system instead of revert-buffer.
5
62005-07-07 Richard M. Stallman <rms@gnu.org>
7
8 * anti.texi (Antinews): Mention mode-line-inverse-video.
9
10 * files.texi (Saving): Minor correction about C-x C-w.
11
12 * display.texi (Display Custom): Don't mention mode-line-inverse-video.
13
142005-07-07 Luc Teirlinck <teirllm@auburn.edu>
15
16 * search.texi (Isearch Scroll): Add example of using the
17 `isearch-scroll' property.
18 (Slow Isearch): Reference anchor for `baud-rate' instead of entire
19 `Display Custom' node.
20 (Regexp Replace): Put text that requires Emacs Lisp knowledge last
21 and de-emphasize it.
22 (Other Repeating Search): `occur' currently can not correctly
23 handle multiline matches. Correct, clarify and update description
24 of `flush-lines' and `keep-lines'.
25
26 * display.texi (Display Custom): Add anchor for `baud-rate'.
27
282005-07-07 Richard M. Stallman <rms@gnu.org>
29
30 * gnu.texi: Update where to get GNU status; add refs for how to help.
31 Add footnotes 6 and 7.
32
12005-07-04 Lute Kamstra <lute@gnu.org> 332005-07-04 Lute Kamstra <lute@gnu.org>
2 34
3 Update FSF's address in GPL notices. 35 Update FSF's address in GPL notices.
diff --git a/man/anti.texi b/man/anti.texi
index c2ffaf7db72..896924e3ad9 100644
--- a/man/anti.texi
+++ b/man/anti.texi
@@ -18,7 +18,10 @@ the mode line, where they can be more easily seen.
18 18
19@item 19@item
20The mode line of the selected window is no longer displayed with a 20The mode line of the selected window is no longer displayed with a
21special face. All mode lines are created equal. 21special face. All mode lines are created equal. Meanwhile, you can
22use the variable @code{mode-line-inverse-video} to control whether
23mode lines are highlighted at all---@code{nil} means don't highlight
24them.
22 25
23@item 26@item
24Clicking on a link with the left mouse button (@kbd{mouse-1}) will 27Clicking on a link with the left mouse button (@kbd{mouse-1}) will
diff --git a/man/calc.texi b/man/calc.texi
index a2dd6c7c7d8..9b7bf7342bd 100644
--- a/man/calc.texi
+++ b/man/calc.texi
@@ -4314,8 +4314,8 @@ even @kbd{V R x max @key{RET}} if you had preferred.)
4314 4314
4315If your system has the GNUPLOT program, you can see graphs of your 4315If your system has the GNUPLOT program, you can see graphs of your
4316data and your straight line to see how well they match. (If you have 4316data and your straight line to see how well they match. (If you have
4317GNUPLOT 3.0, the following instructions will work regardless of the 4317GNUPLOT 3.0 or higher, the following instructions will work regardless
4318kind of display you have. Some GNUPLOT 2.0, non-X-windows systems 4318of the kind of display you have. Some GNUPLOT 2.0, non-X-windows systems
4319may require additional steps to view the graphs.) 4319may require additional steps to view the graphs.)
4320 4320
4321Let's start by plotting the original data. Recall the ``@var{x}'' and ``@var{y}'' 4321Let's start by plotting the original data. Recall the ``@var{x}'' and ``@var{y}''
@@ -28694,11 +28694,11 @@ treatment to @samp{=>}.
28694 28694
28695@noindent 28695@noindent
28696The commands for graphing data begin with the @kbd{g} prefix key. Calc 28696The commands for graphing data begin with the @kbd{g} prefix key. Calc
28697uses GNUPLOT 2.0 or 3.0 to do graphics. These commands will only work 28697uses GNUPLOT 2.0 or later to do graphics. These commands will only work
28698if GNUPLOT is available on your system. (While GNUPLOT sounds like 28698if GNUPLOT is available on your system. (While GNUPLOT sounds like
28699a relative of GNU Emacs, it is actually completely unrelated. 28699a relative of GNU Emacs, it is actually completely unrelated.
28700However, it is free software and can be obtained from the Free 28700However, it is free software. It can be obtained from
28701Software Foundation's machine @samp{prep.ai.mit.edu}.) 28701@samp{http://www.gnuplot.info}.)
28702 28702
28703@vindex calc-gnuplot-name 28703@vindex calc-gnuplot-name
28704If you have GNUPLOT installed on your system but Calc is unable to 28704If you have GNUPLOT installed on your system but Calc is unable to
@@ -28707,7 +28707,7 @@ in your Calc init file or @file{.emacs}. You may also need to set some Lisp
28707variables to show Calc how to run GNUPLOT on your system; these 28707variables to show Calc how to run GNUPLOT on your system; these
28708are described under @kbd{g D} and @kbd{g O} below. If you are 28708are described under @kbd{g D} and @kbd{g O} below. If you are
28709using the X window system, Calc will configure GNUPLOT for you 28709using the X window system, Calc will configure GNUPLOT for you
28710automatically. If you have GNUPLOT 3.0 and you are not using X, 28710automatically. If you have GNUPLOT 3.0 or later and you are not using X,
28711Calc will configure GNUPLOT to display graphs using simple character 28711Calc will configure GNUPLOT to display graphs using simple character
28712graphics that will work on any terminal. 28712graphics that will work on any terminal.
28713 28713
@@ -28826,7 +28826,7 @@ is the height of the point
28826at coordinate @expr{(x_i, y_j)} on the surface. The 3D graph will 28826at coordinate @expr{(x_i, y_j)} on the surface. The 3D graph will
28827be displayed from a certain default viewpoint; you can change this 28827be displayed from a certain default viewpoint; you can change this
28828viewpoint by adding a @samp{set view} to the @samp{*Gnuplot Commands*} 28828viewpoint by adding a @samp{set view} to the @samp{*Gnuplot Commands*}
28829buffer as described later. See the GNUPLOT 3.0 documentation for a 28829buffer as described later. See the GNUPLOT documentation for a
28830description of the @samp{set view} command. 28830description of the @samp{set view} command.
28831 28831
28832Each point in the matrix will be displayed as a dot in the graph, 28832Each point in the matrix will be displayed as a dot in the graph,
@@ -30268,10 +30268,11 @@ Plain formulas are preceded and followed by @samp{%%%} signs
30268by default. This notation has the advantage that the @samp{%} 30268by default. This notation has the advantage that the @samp{%}
30269character begins a comment in @TeX{} and La@TeX{}, so if your formula is 30269character begins a comment in @TeX{} and La@TeX{}, so if your formula is
30270embedded in a @TeX{} or La@TeX{} document its plain version will be 30270embedded in a @TeX{} or La@TeX{} document its plain version will be
30271invisible in the final printed copy. @xref{Customizing 30271invisible in the final printed copy. Certain major modes have different
30272Embedded Mode}, to see how to change the ``plain'' formula 30272delimiters to ensure that the ``plain'' version will be
30273delimiters, say to something that @dfn{eqn} or some other 30273in a comment for those modes, also.
30274formatter will treat as a comment. 30274See @ref{Customizing Embedded Mode} to see how to change the ``plain''
30275formula delimiters.
30275 30276
30276There are several notations which Calc's parser for ``big'' 30277There are several notations which Calc's parser for ``big''
30277formatted formulas can't yet recognize. In particular, it can't 30278formatted formulas can't yet recognize. In particular, it can't
@@ -30696,8 +30697,9 @@ formula are never used (except for global annotations, described
30696below). 30697below).
30697 30698
30698The scan does not look for the leading @samp{% }, only for the 30699The scan does not look for the leading @samp{% }, only for the
30699square brackets and the text they enclose. You can edit the mode 30700square brackets and the text they enclose. In fact, the leading
30700annotations to a style that works better in context if you wish. 30701characters are different for different major modes. You can edit the
30702mode annotations to a style that works better in context if you wish.
30701@xref{Customizing Embedded Mode}, to see how to change the style 30703@xref{Customizing Embedded Mode}, to see how to change the style
30702that Calc uses when it generates the annotations. You can write 30704that Calc uses when it generates the annotations. You can write
30703mode annotations into the file yourself if you know the syntax; 30705mode annotations into the file yourself if you know the syntax;
@@ -30797,14 +30799,11 @@ You can modify Embedded mode's behavior by setting various Lisp
30797variables described here. These variables are customizable 30799variables described here. These variables are customizable
30798(@pxref{Customizable Variables}), or you can use @kbd{M-x set-variable} 30800(@pxref{Customizable Variables}), or you can use @kbd{M-x set-variable}
30799or @kbd{M-x edit-options} to adjust a variable on the fly. 30801or @kbd{M-x edit-options} to adjust a variable on the fly.
30800(Another possibility would 30802(Another possibility would be to use a file-local variable annotation at
30801be to use a file-local variable annotation at the end of the 30803the end of the file;
30802file; @pxref{File Variables, , Local Variables in Files, emacs, the 30804@pxref{File Variables, , Local Variables in Files, emacs, the Emacs manual}.)
30803Emacs manual}.) 30805Many of the variables given mentioned here can be set to depend on the
30804 30806major mode of the editing buffer (@pxref{Customizable Variables}).
30805While none of these variables will be buffer-local by default, you
30806can make any of them local to any Embedded mode buffer. (Their
30807values in the @samp{*Calculator*} buffer are never used.)
30808 30807
30809@vindex calc-embedded-open-formula 30808@vindex calc-embedded-open-formula
30810The @code{calc-embedded-open-formula} variable holds a regular 30809The @code{calc-embedded-open-formula} variable holds a regular
@@ -30887,11 +30886,13 @@ begins a ``plain'' formula written in front of the formatted
30887formula when @kbd{d p} mode is turned on. Note that this is an 30886formula when @kbd{d p} mode is turned on. Note that this is an
30888actual string, not a regular expression, because Calc must be able 30887actual string, not a regular expression, because Calc must be able
30889to write this string into a buffer as well as to recognize it. 30888to write this string into a buffer as well as to recognize it.
30890The default string is @code{"%%% "} (note the trailing space). 30889The default string is @code{"%%% "} (note the trailing space), but may
30890be different for certain major modes.
30891 30891
30892@vindex calc-embedded-close-plain 30892@vindex calc-embedded-close-plain
30893The @code{calc-embedded-close-plain} variable is a string which 30893The @code{calc-embedded-close-plain} variable is a string which
30894ends a ``plain'' formula. The default is @code{" %%%\n"}. Without 30894ends a ``plain'' formula. The default is @code{" %%%\n"}, but may be
30895different for different major modes. Without
30895the trailing newline here, the first line of a Big mode formula 30896the trailing newline here, the first line of a Big mode formula
30896that followed might be shifted over with respect to the other lines. 30897that followed might be shifted over with respect to the other lines.
30897 30898
@@ -30921,11 +30922,12 @@ not activate just anything surrounded by formula delimiters; after
30921all, blank lines are considered formula delimiters by default! 30922all, blank lines are considered formula delimiters by default!
30922But if your language includes a delimiter which can only occur 30923But if your language includes a delimiter which can only occur
30923actually in front of a formula, you can take advantage of it here. 30924actually in front of a formula, you can take advantage of it here.
30924The default pattern is @code{"%Embed\n\\(% .*\n\\)*"}, which 30925The default pattern is @code{"%Embed\n\\(% .*\n\\)*"}, but may be
30925checks for @samp{%Embed} followed by any number of lines beginning 30926different for different major modes.
30926with @samp{%} and a space. This last is important to make Calc 30927This pattern will check for @samp{%Embed} followed by any number of
30927consider mode annotations part of the pattern, so that the formula's 30928lines beginning with @samp{%} and a space. This last is important to
30928opening delimiter really is sure to follow the pattern. 30929make Calc consider mode annotations part of the pattern, so that the
30930formula's opening delimiter really is sure to follow the pattern.
30929 30931
30930@vindex calc-embedded-open-mode 30932@vindex calc-embedded-open-mode
30931The @code{calc-embedded-open-mode} variable is a string (not a 30933The @code{calc-embedded-open-mode} variable is a string (not a
@@ -30933,14 +30935,15 @@ regular expression) which should precede a mode annotation.
30933Calc never scans for this string; Calc always looks for the 30935Calc never scans for this string; Calc always looks for the
30934annotation itself. But this is the string that is inserted before 30936annotation itself. But this is the string that is inserted before
30935the opening bracket when Calc adds an annotation on its own. 30937the opening bracket when Calc adds an annotation on its own.
30936The default is @code{"% "}. 30938The default is @code{"% "}, but may be different for different major
30939modes.
30937 30940
30938@vindex calc-embedded-close-mode 30941@vindex calc-embedded-close-mode
30939The @code{calc-embedded-close-mode} variable is a string which 30942The @code{calc-embedded-close-mode} variable is a string which
30940follows a mode annotation written by Calc. Its default value 30943follows a mode annotation written by Calc. Its default value
30941is simply a newline, @code{"\n"}. If you change this, it is a 30944is simply a newline, @code{"\n"}, but may be different for different
30942good idea still to end with a newline so that mode annotations 30945major modes. If you change this, it is a good idea still to end with a
30943will appear on lines by themselves. 30946newline so that mode annotations will appear on lines by themselves.
30944 30947
30945@node Programming, Customizable Variables, Embedded Mode, Top 30948@node Programming, Customizable Variables, Embedded Mode, Top
30946@chapter Programming 30949@chapter Programming
@@ -34725,6 +34728,20 @@ which the window should use. Unlike @code{calc-window-hook}, this hook
34725must @emph{not} switch into the new window. 34728must @emph{not} switch into the new window.
34726@end defvar 34729@end defvar
34727 34730
34731@defvar calc-embedded-mode-hook
34732This hook is called the first time that Embedded mode is entered.
34733@end defvar
34734
34735@defvar calc-embedded-new-buffer-hook
34736This hook is called each time that Embedded mode is entered in a
34737new buffer.
34738@end defvar
34739
34740@defvar calc-embedded-new-formula-hook
34741This hook is called each time that Embedded mode is enabled for a
34742new formula.
34743@end defvar
34744
34728@defvar calc-edit-mode-hook 34745@defvar calc-edit-mode-hook
34729This hook is called by @code{calc-edit} (and the other ``edit'' 34746This hook is called by @code{calc-edit} (and the other ``edit''
34730commands) when the temporary editing buffer is being created. 34747commands) when the temporary editing buffer is being created.
@@ -34894,6 +34911,7 @@ The default value of @code{calc-language-alist} is
34894@end defvar 34911@end defvar
34895 34912
34896@defvar calc-embedded-announce-formula 34913@defvar calc-embedded-announce-formula
34914@defvarx calc-embedded-announce-formula-alist
34897See @ref{Customizing Embedded Mode}.@* 34915See @ref{Customizing Embedded Mode}.@*
34898The variable @code{calc-embedded-announce-formula} helps determine 34916The variable @code{calc-embedded-announce-formula} helps determine
34899what formulas @kbd{M-# a} will activate in a buffer. It is a 34917what formulas @kbd{M-# a} will activate in a buffer. It is a
@@ -34905,10 +34923,33 @@ activated. (Calc also uses other patterns to find formulas, such as
34905The default pattern is @code{"%Embed\n\\(% .*\n\\)*"}, which checks 34923The default pattern is @code{"%Embed\n\\(% .*\n\\)*"}, which checks
34906for @samp{%Embed} followed by any number of lines beginning with 34924for @samp{%Embed} followed by any number of lines beginning with
34907@samp{%} and a space. 34925@samp{%} and a space.
34926
34927The variable @code{calc-embedded-announce-formula-alist} is used to
34928set @code{calc-embedded-announce-formula} to different regular
34929expressions depending on the major mode of the editing buffer.
34930It consists of a list of pairs of the form @code{(@var{MAJOR-MODE} .
34931@var{REGEXP})}, and its default value is
34932@example
34933 ((c++-mode . "//Embed\n\\(// .*\n\\)*")
34934 (c-mode . "/\\*Embed\\*/\n\\(/\\* .*\\*/\n\\)*")
34935 (f90-mode . "!Embed\n\\(! .*\n\\)*")
34936 (fortran-mode . "C Embed\n\\(C .*\n\\)*")
34937 (html-helper-mode . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
34938 (html-mode . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
34939 (nroff-mode . "\\\\\"Embed\n\\(\\\\\" .*\n\\)*")
34940 (pascal-mode . "@{Embed@}\n\\(@{.*@}\n\\)*")
34941 (sgml-mode . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
34942 (xml-mode . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
34943 (texinfo-mode . "@@c Embed\n\\(@@c .*\n\\)*"))
34944@end example
34945Any major modes added to @code{calc-embedded-announce-formula-alist}
34946should also be added to @code{calc-embedded-open-close-plain-alist}
34947and @code{calc-embedded-open-close-mode-alist}.
34908@end defvar 34948@end defvar
34909 34949
34910@defvar calc-embedded-open-formula 34950@defvar calc-embedded-open-formula
34911@defvarx calc-embedded-close-formula 34951@defvarx calc-embedded-close-formula
34952@defvarx calc-embedded-open-close-formula-alist
34912See @ref{Customizing Embedded Mode}.@* 34953See @ref{Customizing Embedded Mode}.@*
34913The variables @code{calc-embedded-open-formula} and 34954The variables @code{calc-embedded-open-formula} and
34914@code{calc-embedded-open-formula} control the region that Calc will 34955@code{calc-embedded-open-formula} control the region that Calc will
@@ -34933,10 +34974,20 @@ Lines beginning with @samp{.EQ} and @samp{.EN} (@dfn{eqn} delimiters);
34933@item 34974@item
34934Lines containing a single @samp{%} or @samp{.\"} symbol and nothing else. 34975Lines containing a single @samp{%} or @samp{.\"} symbol and nothing else.
34935@end enumerate 34976@end enumerate
34977
34978The variable @code{calc-embedded-open-close-formula-alist} is used to
34979set @code{calc-embedded-open-formula} and
34980@code{calc-embedded-close-formula} to different regular
34981expressions depending on the major mode of the editing buffer.
34982It consists of a list of lists of the form
34983@code{(@var{MAJOR-MODE} @var{OPEN-FORMULA-REGEXP}
34984@var{CLOSE-FORMULA-REGEXP})}, and its default value is
34985@code{nil}.
34936@end defvar 34986@end defvar
34937 34987
34938@defvar calc-embedded-open-word 34988@defvar calc-embedded-open-word
34939@defvarx calc-embedded-close-word 34989@defvarx calc-embedded-close-word
34990@defvarx calc-embedded-open-close-word-alist
34940See @ref{Customizing Embedded Mode}.@* 34991See @ref{Customizing Embedded Mode}.@*
34941The variables @code{calc-embedded-open-word} and 34992The variables @code{calc-embedded-open-word} and
34942@code{calc-embedded-close-word} control the region that Calc will 34993@code{calc-embedded-close-word} control the region that Calc will
@@ -34946,10 +34997,20 @@ regular expressions.
34946The default values of @code{calc-embedded-open-word} and 34997The default values of @code{calc-embedded-open-word} and
34947@code{calc-embedded-close-word} are @code{"^\\|[^-+0-9.eE]"} and 34998@code{calc-embedded-close-word} are @code{"^\\|[^-+0-9.eE]"} and
34948@code{"$\\|[^-+0-9.eE]"} respectively. 34999@code{"$\\|[^-+0-9.eE]"} respectively.
35000
35001The variable @code{calc-embedded-open-close-word-alist} is used to
35002set @code{calc-embedded-open-word} and
35003@code{calc-embedded-close-word} to different regular
35004expressions depending on the major mode of the editing buffer.
35005It consists of a list of lists of the form
35006@code{(@var{MAJOR-MODE} @var{OPEN-WORD-REGEXP}
35007@var{CLOSE-WORD-REGEXP})}, and its default value is
35008@code{nil}.
34949@end defvar 35009@end defvar
34950 35010
34951@defvar calc-embedded-open-plain 35011@defvar calc-embedded-open-plain
34952@defvarx calc-embedded-close-plain 35012@defvarx calc-embedded-close-plain
35013@defvarx calc-embedded-open-close-plain-alist
34953See @ref{Customizing Embedded Mode}.@* 35014See @ref{Customizing Embedded Mode}.@*
34954The variables @code{calc-embedded-open-plain} and 35015The variables @code{calc-embedded-open-plain} and
34955@code{calc-embedded-open-plain} are used to delimit ``plain'' 35016@code{calc-embedded-open-plain} are used to delimit ``plain''
@@ -34962,10 +35023,35 @@ The default string for @code{calc-embedded-open-plain} is
34962@code{calc-embedded-close-plain} is @code{" %%%\n"}, without 35023@code{calc-embedded-close-plain} is @code{" %%%\n"}, without
34963the trailing newline here, the first line of a Big mode formula 35024the trailing newline here, the first line of a Big mode formula
34964that followed might be shifted over with respect to the other lines. 35025that followed might be shifted over with respect to the other lines.
35026
35027The variable @code{calc-embedded-open-close-plain-alist} is used to
35028set @code{calc-embedded-open-plain} and
35029@code{calc-embedded-close-plain} to different strings
35030depending on the major mode of the editing buffer.
35031It consists of a list of lists of the form
35032@code{(@var{MAJOR-MODE} @var{OPEN-PLAIN-STRING}
35033@var{CLOSE-PLAIN-STRING})}, and its default value is
35034@example
35035 ((c++-mode "// %% " " %%\n")
35036 (c-mode "/* %% " " %% */\n")
35037 (f90-mode "! %% " " %%\n")
35038 (fortran-mode "C %% " " %%\n")
35039 (html-helper-mode "<!-- %% " " %% -->\n")
35040 (html-mode "<!-- %% " " %% -->\n")
35041 (nroff-mode "\\\" %% " " %%\n")
35042 (pascal-mode "@{%% " " %%@}\n")
35043 (sgml-mode "<!-- %% " " %% -->\n")
35044 (xml-mode "<!-- %% " " %% -->\n")
35045 (texinfo-mode "@@c %% " " %%\n"))
35046@end example
35047Any major modes added to @code{calc-embedded-open-close-plain-alist}
35048should also be added to @code{calc-embedded-announce-formula-alist}
35049and @code{calc-embedded-open-close-mode-alist}.
34965@end defvar 35050@end defvar
34966 35051
34967@defvar calc-embedded-open-new-formula 35052@defvar calc-embedded-open-new-formula
34968@defvarx calc-embedded-close-new-formula 35053@defvarx calc-embedded-close-new-formula
35054@defvarx calc-embedded-open-close-new-formula-alist
34969See @ref{Customizing Embedded Mode}.@* 35055See @ref{Customizing Embedded Mode}.@*
34970The variables @code{calc-embedded-open-new-formula} and 35056The variables @code{calc-embedded-open-new-formula} and
34971@code{calc-embedded-close-new-formula} are strings which are 35057@code{calc-embedded-close-new-formula} are strings which are
@@ -34980,10 +35066,20 @@ also @code{"\n\n"}. The final newline is omitted by @w{@kbd{M-# f}}
34980if typed at the end of a line. (It follows that if @kbd{M-# f} is 35066if typed at the end of a line. (It follows that if @kbd{M-# f} is
34981typed on a blank line, both a leading opening newline and a trailing 35067typed on a blank line, both a leading opening newline and a trailing
34982closing newline are omitted.) 35068closing newline are omitted.)
35069
35070The variable @code{calc-embedded-open-close-new-formula-alist} is used to
35071set @code{calc-embedded-open-new-formula} and
35072@code{calc-embedded-close-new-formula} to different strings
35073depending on the major mode of the editing buffer.
35074It consists of a list of lists of the form
35075@code{(@var{MAJOR-MODE} @var{OPEN-NEW-FORMULA-STRING}
35076@var{CLOSE-NEW-FORMULA-STRING})}, and its default value is
35077@code{nil}.
34983@end defvar 35078@end defvar
34984 35079
34985@defvar calc-embedded-open-mode 35080@defvar calc-embedded-open-mode
34986@defvarx calc-embedded-close-mode 35081@defvarx calc-embedded-close-mode
35082@defvarx calc-embedded-open-close-mode-alist
34987See @ref{Customizing Embedded Mode}.@* 35083See @ref{Customizing Embedded Mode}.@*
34988The variables @code{calc-embedded-open-mode} and 35084The variables @code{calc-embedded-open-mode} and
34989@code{calc-embedded-close-mode} are strings which Calc will place before 35085@code{calc-embedded-close-mode} are strings which Calc will place before
@@ -34997,6 +35093,30 @@ and the default value of @code{calc-embedded-close-mode} is
34997If you change the value of @code{calc-embedded-close-mode}, it is a good 35093If you change the value of @code{calc-embedded-close-mode}, it is a good
34998idea still to end with a newline so that mode annotations will appear on 35094idea still to end with a newline so that mode annotations will appear on
34999lines by themselves. 35095lines by themselves.
35096
35097The variable @code{calc-embedded-open-close-mode-alist} is used to
35098set @code{calc-embedded-open-mode} and
35099@code{calc-embedded-close-mode} to different strings
35100expressions depending on the major mode of the editing buffer.
35101It consists of a list of lists of the form
35102@code{(@var{MAJOR-MODE} @var{OPEN-MODE-STRING}
35103@var{CLOSE-MODE-STRING})}, and its default value is
35104@example
35105 ((c++-mode "// " "\n")
35106 (c-mode "/* " " */\n")
35107 (f90-mode "! " "\n")
35108 (fortran-mode "C " "\n")
35109 (html-helper-mode "<!-- " " -->\n")
35110 (html-mode "<!-- " " -->\n")
35111 (nroff-mode "\\\" " "\n")
35112 (pascal-mode "@{ " " @}\n")
35113 (sgml-mode "<!-- " " -->\n")
35114 (xml-mode "<!-- " " -->\n")
35115 (texinfo-mode "@@c " "\n"))
35116@end example
35117Any major modes added to @code{calc-embedded-open-close-mode-alist}
35118should also be added to @code{calc-embedded-announce-formula-alist}
35119and @code{calc-embedded-open-close-plain-alist}.
35000@end defvar 35120@end defvar
35001 35121
35002@node Reporting Bugs, Summary, Customizable Variables, Top 35122@node Reporting Bugs, Summary, Customizable Variables, Top
diff --git a/man/display.texi b/man/display.texi
index 02854b3d6db..2b4bb03df1d 100644
--- a/man/display.texi
+++ b/man/display.texi
@@ -1004,15 +1004,6 @@ global-hl-line-mode} enables or disables the same mode globally.
1004 This section contains information for customization only. Beginning 1004 This section contains information for customization only. Beginning
1005users should skip it. 1005users should skip it.
1006 1006
1007@vindex mode-line-inverse-video
1008 The variable @code{mode-line-inverse-video} is an obsolete way of
1009controlling whether the mode line is displayed in inverse video; the
1010preferred way of doing this is to change the @code{mode-line} face.
1011@xref{Mode Line}. However, if @code{mode-line-inverse-video} has a
1012value of @code{nil}, then the @code{mode-line} face will be ignored,
1013and mode-lines will be drawn using the default text face.
1014@xref{Faces}.
1015
1016@vindex inverse-video 1007@vindex inverse-video
1017 If the variable @code{inverse-video} is non-@code{nil}, Emacs attempts 1008 If the variable @code{inverse-video} is non-@code{nil}, Emacs attempts
1018to invert all the lines of the display from what they normally are. 1009to invert all the lines of the display from what they normally are.
@@ -1135,7 +1126,7 @@ is the default value for @code{indicate-buffer-boundaries} in buffers
1135that do not override it. 1126that do not override it.
1136 1127
1137@vindex baud-rate 1128@vindex baud-rate
1138 The variable @code{baud-rate} holds the output speed of the 1129 The variable @anchor{baud-rate}@code{baud-rate} holds the output speed of the
1139terminal, as far as Emacs knows. Setting this variable does not 1130terminal, as far as Emacs knows. Setting this variable does not
1140change the speed of actual data transmission, but the value is used 1131change the speed of actual data transmission, but the value is used
1141for calculations. On terminals, it affects padding, and decisions 1132for calculations. On terminals, it affects padding, and decisions
diff --git a/man/files.texi b/man/files.texi
index 26f6af37603..06833e785a2 100644
--- a/man/files.texi
+++ b/man/files.texi
@@ -464,8 +464,9 @@ buffer as ``modified'' so that @kbd{C-x C-s} in that buffer
464@kindex C-x C-w 464@kindex C-x C-w
465@findex write-file 465@findex write-file
466 If you wish to mark the buffer as visiting a different file and save it 466 If you wish to mark the buffer as visiting a different file and save it
467right away, use @kbd{C-x C-w} (@code{write-file}). It is precisely 467right away, use @kbd{C-x C-w} (@code{write-file}). It is
468equivalent to @code{set-visited-file-name} followed by @kbd{C-x C-s}. 468equivalent to @code{set-visited-file-name} followed by @kbd{C-x C-s}
469(except that @kbd{C-x C-w} asks for confirmation if the file exists).
469@kbd{C-x C-s} used on a buffer that is not visiting a file has the 470@kbd{C-x C-s} used on a buffer that is not visiting a file has the
470same effect as @kbd{C-x C-w}; that is, it reads a file name, marks the 471same effect as @kbd{C-x C-w}; that is, it reads a file name, marks the
471buffer as visiting that file, and saves it there. The default file name in 472buffer as visiting that file, and saves it there. The default file name in
diff --git a/man/gnu.texi b/man/gnu.texi
index 4185f8f9114..43d4ab0cacd 100644
--- a/man/gnu.texi
+++ b/man/gnu.texi
@@ -39,9 +39,10 @@ Since that time, we have learned about certain common misunderstandings
39that different wording could help avoid. Footnotes added in 1993 help 39that different wording could help avoid. Footnotes added in 1993 help
40clarify these points. 40clarify these points.
41 41
42For up-to-date information about the available GNU software, please see 42For up-to-date information about the available GNU software, please
43the latest issue of the GNU's Bulletin. The list is much too long to 43see @uref{http://www.gnu.org}. For software tasks to work on, see
44include here. 44@uref{http://savannah.gnu.org/projects/tasklist}. For other ways to
45contribute, see @uref{http://www.gnu.org/help}.
45@end quotation 46@end quotation
46 47
47@unnumberedsec What's GNU? Gnu's Not Unix! 48@unnumberedsec What's GNU? Gnu's Not Unix!
@@ -380,7 +381,17 @@ practice they would still make considerably more than that.)
380other people's lives; and it is usually used to make their lives more 381other people's lives; and it is usually used to make their lives more
381difficult. 382difficult.
382 383
383People who have studied the issue of intellectual property rights carefully 384People who have studied the issue of intellectual property
385rights@footnote{In the 80s I had not yet realized how confusing it was
386to speak of ``the issue'' of ``intellectual property.'' That term is
387obviously biased; more subtle is the fact that it lumps together
388various disparate laws which raise very different issues. Nowadays I
389urge people to reject the term ``intellectual property'' entirely,
390lest it lead others to suppose that those laws form one coherent
391issue. The way to be clear is to discuss patents, copyrights, and
392trademarks separately. See
393@uref{http://www.gnu.org/philosophy/not-ipr.xhtml} for more
394explanation of how this term spreads confusion and bias.} carefully
384(such as lawyers) say that there is no intrinsic right to intellectual 395(such as lawyers) say that there is no intrinsic right to intellectual
385property. The kinds of supposed intellectual property rights that the 396property. The kinds of supposed intellectual property rights that the
386government recognizes were created by specific acts of legislation for 397government recognizes were created by specific acts of legislation for
@@ -489,9 +500,15 @@ operating systems onto the new hardware.
489The sale of teaching, hand-holding and maintenance services could also 500The sale of teaching, hand-holding and maintenance services could also
490employ programmers. 501employ programmers.
491 502
492People with new ideas could distribute programs as freeware, asking for 503People with new ideas could distribute programs as
493donations from satisfied users, or selling hand-holding services. I have 504freeware@footnote{Subsequently we have learned to distinguish between
494met people who are already working this way successfully. 505"free software" and "freeware". The term "freeware" means software
506you are free to redistribute, but usually you are not free to study
507and change the source code, so most of it is not free software. See
508@uref{http://www.gnu.org/philosophy/words-to-avoid.html} for more
509explanation.}, asking for donations from satisfied users, or selling
510hand-holding services. I have met people who are already working this
511way successfully.
495 512
496Users with related needs can form users' groups, and pay dues. A group 513Users with related needs can form users' groups, and pay dues. A group
497would contract with programming companies to write programs that the 514would contract with programming companies to write programs that the
diff --git a/man/mule.texi b/man/mule.texi
index 0f9873cdb0d..b14f546c458 100644
--- a/man/mule.texi
+++ b/man/mule.texi
@@ -818,7 +818,7 @@ pattern, are decoded correctly. One of the builtin
818 818
819 If Emacs recognizes the encoding of a file incorrectly, you can 819 If Emacs recognizes the encoding of a file incorrectly, you can
820reread the file using the correct coding system by typing @kbd{C-x 820reread the file using the correct coding system by typing @kbd{C-x
821@key{RET} c @var{coding-system} @key{RET} M-x revert-buffer 821@key{RET} r @var{coding-system}
822@key{RET}}. To see what coding system Emacs actually used to decode 822@key{RET}}. To see what coding system Emacs actually used to decode
823the file, look at the coding system mnemonic letter near the left edge 823the file, look at the coding system mnemonic letter near the left edge
824of the mode line (@pxref{Mode Line}), or type @kbd{C-h C @key{RET}}. 824of the mode line (@pxref{Mode Line}), or type @kbd{C-h C @key{RET}}.
diff --git a/man/search.texi b/man/search.texi
index de530f7ee01..e0bd00d7beb 100644
--- a/man/search.texi
+++ b/man/search.texi
@@ -294,7 +294,7 @@ commands such as @kbd{@key{PRIOR}} (@code{scroll-down}),
294@kbd{@key{NEXT}} (@code{scroll-up}) and @kbd{C-l} (@code{recenter}) 294@kbd{@key{NEXT}} (@code{scroll-up}) and @kbd{C-l} (@code{recenter})
295within the search, thus letting you see more of the text near the 295within the search, thus letting you see more of the text near the
296current match. You must run these commands via their key sequences to 296current match. You must run these commands via their key sequences to
297stay in the search---typing M-x @var{comand-name} will always 297stay in the search---typing M-x @var{command-name} will always
298terminate a search. 298terminate a search.
299 299
300 You can give prefix arguments to these commands in the usual way. 300 You can give prefix arguments to these commands in the usual way.
@@ -309,6 +309,16 @@ handy during a search.
309 309
310 You can make other commands usable within an incremental search by 310 You can make other commands usable within an incremental search by
311giving the command a non-@code{nil} @code{isearch-scroll} property. 311giving the command a non-@code{nil} @code{isearch-scroll} property.
312For example, to make @kbd{C-h l} usable within an incremental search
313in all future Emacs sessions, use @kbd{C-h c} to find what command it
314runs. (You type @kbd{C-h c C-h l}; it says @code{view-lossage}.) Then
315you can put the following line in your @file{.emacs} file (@pxref{Init File}):
316
317@example
318(put 'view-lossage 'isearch-scroll t)
319@end example
320
321@noindent
312This works for commands that don't permanently change point, the 322This works for commands that don't permanently change point, the
313buffer contents, the match data, the current buffer, or the selected 323buffer contents, the match data, the current buffer, or the selected
314window and frame. The command must not delete the current window and 324window and frame. The command must not delete the current window and
@@ -331,7 +341,8 @@ its new position of point.
331@vindex search-slow-speed 341@vindex search-slow-speed
332 The slow terminal style of display is used when the terminal baud rate is 342 The slow terminal style of display is used when the terminal baud rate is
333less than or equal to the value of the variable @code{search-slow-speed}, 343less than or equal to the value of the variable @code{search-slow-speed},
334initially 1200. See @code{baud-rate} in @ref{Display Custom}. 344initially 1200. See also the discussion of the variable @code{baud-rate}
345(@pxref{baud-rate,, Customization of Display}).
335 346
336@vindex search-slow-window-lines 347@vindex search-slow-window-lines
337 The number of lines to use in slow terminal search display is controlled 348 The number of lines to use in slow terminal search display is controlled
@@ -1012,7 +1023,15 @@ M-x replace-regexp @key{RET} \(c[ad]+r\)-safe @key{RET} \1 @key{RET}
1012performs the inverse transformation. To include a @samp{\} in the 1023performs the inverse transformation. To include a @samp{\} in the
1013text to replace with, you must enter @samp{\\}. 1024text to replace with, you must enter @samp{\\}.
1014 1025
1015 You can also use Lisp expressions to calculate parts of the 1026 If you want to enter part of the replacement string by hand each
1027time, use @samp{\?} in the replacement string. Each replacement will
1028ask you to edit the replacement string in the minibuffer, putting
1029point where the @samp{\?} was.
1030
1031 The remainder of this subsection is intended for specialized tasks
1032and requires knowledge of Lisp. Most readers can skip it.
1033
1034 You can use Lisp expressions to calculate parts of the
1016replacement string. To do this, write @samp{\,} followed by the 1035replacement string. To do this, write @samp{\,} followed by the
1017expression in the replacement string. Each replacement calculates the 1036expression in the replacement string. Each replacement calculates the
1018value of the expression and converts it to text without quoting (if 1037value of the expression and converts it to text without quoting (if
@@ -1050,22 +1069,6 @@ M-x replace-regexp @key{RET} ^.\@{0,72\@}$ @key{RET}
1050\,(format "%-72sABC%05d" \& \#) @key{RET} 1069\,(format "%-72sABC%05d" \& \#) @key{RET}
1051@end example 1070@end example
1052 1071
1053 If you want to enter part of the replacement string by hand each
1054time, use @samp{\?} in the replacement string. Each replacement will
1055ask you to edit the replacement string in the minibuffer, putting
1056point where the @samp{\?} was. For example,
1057
1058@example
1059M-x replace-regexp @key{RET} \\footnote@{ @key{RET}
1060\&\\label@{fn:\#\?@} @key{RET}
1061@end example
1062
1063@noindent
1064will add labels starting with @samp{\label@{fn:0@}} to occurrences of
1065@samp{\footnote@{}, but letting you edit each replacement before
1066performing it. To number the labels starting at 1, use @samp{\,(1+
1067\#)} instead of @samp{\#}.
1068
1069@node Replacement and Case, Query Replace, Regexp Replace, Replace 1072@node Replacement and Case, Query Replace, Regexp Replace, Replace
1070@subsection Replace Commands and Case 1073@subsection Replace Commands and Case
1071 1074
@@ -1257,7 +1260,8 @@ Display a list showing each line in the buffer that contains a match
1257for @var{regexp}. To limit the search to part of the buffer, narrow 1260for @var{regexp}. To limit the search to part of the buffer, narrow
1258to that part (@pxref{Narrowing}). A numeric argument @var{n} 1261to that part (@pxref{Narrowing}). A numeric argument @var{n}
1259specifies that @var{n} lines of context are to be displayed before and 1262specifies that @var{n} lines of context are to be displayed before and
1260after each matching line. 1263after each matching line. Currently, @code{occur} can not correctly
1264handle multiline matches.
1261 1265
1262@kindex RET @r{(Occur mode)} 1266@kindex RET @r{(Occur mode)}
1263@kindex o @r{(Occur mode)} 1267@kindex o @r{(Occur mode)}
@@ -1271,7 +1275,7 @@ searched and moves point to the original of the chosen occurrence.
1271does not select it. 1275does not select it.
1272 1276
1273Occur mode supports the @code{next-error} functionality described in 1277Occur mode supports the @code{next-error} functionality described in
1274in @ref{Compilation Mode}. 1278@ref{Compilation Mode}.
1275 1279
1276@item M-x list-matching-lines 1280@item M-x list-matching-lines
1277Synonym for @kbd{M-x occur}. 1281Synonym for @kbd{M-x occur}.
@@ -1290,19 +1294,31 @@ after point. In Transient Mark mode, if the region is active, the
1290command operates on the region instead. 1294command operates on the region instead.
1291 1295
1292@item M-x flush-lines @key{RET} @var{regexp} @key{RET} 1296@item M-x flush-lines @key{RET} @var{regexp} @key{RET}
1293Delete each line that contains a match for @var{regexp}, operating on 1297This command deletes each line that contains a match for @var{regexp},
1294the text after point. In Transient Mark mode, if the region is 1298operating on the text after point; it deletes the current line
1295active, the command operates on the region instead. 1299if it contains a match starting after point. In Transient Mark mode,
1300if the region is active, the command operates on the region instead;
1301it deletes a line partially contained in the region if it contains a
1302match entirely contained in the region.
1303
1304If a match is split across lines, @code{flush-lines} deletes all those
1305lines. It deletes the lines before starting to look for the next
1306match; hence, it ignores a match starting on the same line at which
1307another match ended.
1296 1308
1297@item M-x keep-lines @key{RET} @var{regexp} @key{RET} 1309@item M-x keep-lines @key{RET} @var{regexp} @key{RET}
1298Delete each line that @emph{does not} contain a match for 1310This command deletes each line that @emph{does not} contain a match for
1299@var{regexp}, operating on the text after point. In Transient Mark 1311@var{regexp}, operating on the text after point; if point is not at the
1300mode, if the region is active, the command operates on the region 1312beginning of a line, it always keeps the current line. In Transient
1301instead. 1313Mark mode, if the region is active, the command operates on the region
1314instead; it never deletes lines that are only partially contained in
1315the region (a newline that ends a line counts as part of that line).
1316
1317If a match is split across lines, this command keeps all those lines.
1302@end table 1318@end table
1303 1319
1304 You can also search multiple files under control of a tags table 1320 You can also search multiple files under control of a tags table
1305(@pxref{Tags Search}) or through Dired @kbd{A} command 1321(@pxref{Tags Search}) or through the Dired @kbd{A} command
1306(@pxref{Operating on Files}), or ask the @code{grep} program to do it 1322(@pxref{Operating on Files}), or ask the @code{grep} program to do it
1307(@pxref{Grep Searching}). 1323(@pxref{Grep Searching}).
1308 1324
diff --git a/man/viper.texi b/man/viper.texi
index 7b3a888c8ca..0156c4c6387 100644
--- a/man/viper.texi
+++ b/man/viper.texi
@@ -4502,6 +4502,7 @@ kin@@isi.com (Kin Cho),
4502kwzh@@gnu.org (Karl Heuer), 4502kwzh@@gnu.org (Karl Heuer),
4503lindstro@@biostat.wisc.edu (Mary Lindstrom), 4503lindstro@@biostat.wisc.edu (Mary Lindstrom),
4504lektu@@terra.es (Juanma Barranquero), 4504lektu@@terra.es (Juanma Barranquero),
4505lennart.borgman.073@@student.lu.se (Lennart Borgman),
4505minakaji@@osaka.email.ne.jp (Mikio Nakajima), 4506minakaji@@osaka.email.ne.jp (Mikio Nakajima),
4506Mark.Bordas@@East.Sun.COM (Mark Bordas), 4507Mark.Bordas@@East.Sun.COM (Mark Bordas),
4507meyering@@comco.com (Jim Meyering), 4508meyering@@comco.com (Jim Meyering),
@@ -4519,6 +4520,7 @@ sawdey@@lcse.umn.edu (Aaron Sawdey),
4519simonb@@prl.philips.co.uk (Simon Blanchard), 4520simonb@@prl.philips.co.uk (Simon Blanchard),
4520spadgett1@@nc.rr.com (Samuel Padgett), 4521spadgett1@@nc.rr.com (Samuel Padgett),
4521stephen@@farrell.org (Stephen Farrell), 4522stephen@@farrell.org (Stephen Farrell),
4523storm@@cua.dk (Kim F. Storm),
4522sudish@@MindSpring.COM (Sudish Joseph), 4524sudish@@MindSpring.COM (Sudish Joseph),
4523schwab@@issan.informatik.uni-dortmund.de (Andreas Schwab) 4525schwab@@issan.informatik.uni-dortmund.de (Andreas Schwab)
4524terra@@diku.dk (Morten Welinder), 4526terra@@diku.dk (Morten Welinder),
diff --git a/src/ChangeLog b/src/ChangeLog
index 8501f8fd9dc..f3f865612f6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,130 @@
12005-07-13 Kim F. Storm <storm@cua.dk>
2
3 * xdisp.c (start_display): Don't reseat to next visible line start
4 if current start position is in a string or image.
5 (move_it_vertically_backward): Be sure to move out of strings and
6 images when moving it2 forward.
7 (move_it_by_lines): When moving forward, move to next buffer
8 position if we end up in a string or image. When moving backward,
9 count rows moved over when moving to start of current row in case
10 row starts in middle of a string or image. Also move further
11 backward if we end up in a string or image.
12 (try_cursor_movement): if overlay string spans multiple lines,
13 move backward to set cursor on start of an overlay string.
14 (cursor_row_p): Row is ok if cursor is at newline from string, but
15 string starts on this line (so we always position cursor at start
16 of string).
17
18 * indent.c (Fvertical_motion): If start position is on an image,
19 don't move back if we move too far (that's almost certain to happen).
20
21 * xdisp.c (cursor_row_fully_visible_p): Allow partially visible
22 row in minibuffer windows.
23 (try_window): Don't check margins in minibuffer windows.
24
252005-07-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
26
27 * macterm.c: Don't include stdlib.h or composite.h.
28 (x_use_underline_position_properties, last_mouse_press_frame)
29 (x_noop_count, Qvendor_specific_keysyms): Remove unused variables.
30 (syms_of_macterm, mac_initialize): Don't initialize them.
31 (waiting_for_input, initial_argv, initial_argc)
32 (Vcommand_line_args, Vx_no_window_manager, errno, window_scroll)
33 (set_frame_menubar, path_from_vol_dir_name): Remove externs.
34 (extra_keyboard_modifiers): Fix type in extern.
35 (x_window_to_frame, x_window_to_scroll_bar): Remove declarations.
36 (x_scroll_bar_report_motion): Add argument types to declaration.
37 (mac_compute_glyph_string_overhangs): Add declaration.
38 (disable_mouse_highlight): Remove unused variable.
39 [USE_TOOLKIT_SCROLL_BARS] (construct_scroll_bar_click)
40 (x_scroll_bar_handle_press, x_scroll_bar_handle_release)
41 (x_scroll_bar_handle_drag): Remove argument `timestamp'. All
42 callers changed.
43 [USE_TOOLKIT_SCROLL_BARS] (construct_scroll_bar_click): Don't set
44 timestamp.
45 [USE_CARBON_EVENTS] (mac_handle_mouse_event): Likewise.
46 (x_scroll_bar_create, XTset_vertical_scroll_bar): Show scroll bar
47 only when its width is less than the height.
48 (XTredeem_scroll_bar): Sync with xterm.c.
49 (font_name_table, font_name_table_size, font_name_count): Make
50 static.
51 (drag_and_drop_file_list): Remove variable. Previous use is now
52 local to function.
53 (do_ae_open_documents): Move DRAG_N_DROP event construction part
54 from XTread_socket.
55 (XTread_socket): Consolidate setting of event timestamp. Move
56 DRAG_N_DROP event construction part to do_ae_open_documents.
57 Support extra_keyboard_modifiers.
58
59 * xfaces.c (try_font_list) [MAC_OS]: Try font family name
60 beginning with that for ASCII.
61
622005-07-13 Stefan Monnier <monnier@iro.umontreal.ca>
63
64 * alloc.c (gc_cons_combined_threshold, Vgc_cons_percentage): New vars.
65 (Fgarbage_collect, init_alloc_once): Set gc_cons_combined_threshold.
66 (syms_of_alloc): Declare gc-cons-percentage.
67
68 * eval.c (Feval, Ffuncall):
69 * keyboard.c (read_char):
70 * bytecode.c (MAYBE_GC): Use gc_cons_combined_threshold.
71
72 * lisp.h (gc_cons_combined_threshold): Declare.
73
742005-07-12 Kim F. Storm <storm@cua.dk>
75
76 * coding.c (Qprocess_argument):
77 * coding.h (Qprocess_argument): Remove unused var.
78
79 * xselect.c (intern): Remove dup. intern and staticpro for QTIMESTAMP.
80
812005-07-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
82
83 * mac.c [!TARGET_API_MAC_CARBON]: Include charset.h, coding.h, and
84 Endian.h.
85 [!MAC_OSX] (fchmod, fchown): New functions.
86 (mac_get_code_from_arg): Don't accept Lisp integer as argument.
87 Use SBYTES and EndianU32_BtoN.
88 (mac_get_object_from_code): Return 4 byte string even if argument
89 is 0. Use make_unibyte_string and EndianU32_NtoB.
90 (Fmac_get_file_creator, Fmac_get_file_type, Fmac_set_file_creator)
91 (Fmac_set_file_type): Fix documents and argument declarations.
92 Don't specify kFSCatInfoNodeFlags. Support Mac OS Classic.
93
942005-07-11 Stefan Monnier <monnier@iro.umontreal.ca>
95
96 * window.c (Frecenter): Yet another int/Lisp_Object mixup (YAILOM).
97
982005-07-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
99
100 * xfaces.c (x_update_menu_appearance): Use fontSet resource for
101 Lucid if X_I18N, font otherwise.
102
1032005-07-10 Steven Tamm <steventamm@mac.com>
104
105 * mac.c (Fmac_get_file_type, Fmac_get_file_creator): Add.
106 (Fmac_set_file_type, Fmac_set_file_creator): Add.
107 (mac_get_object_from_code, mac_get_code_from_arg): Add.
108
1092005-07-10 Richard M. Stallman <rms@gnu.org>
110
111 * lread.c (Qeval_buffer_list, Veval_buffer_list): New vars.
112 (syms_of_lread): Set up eval-buffer-list.
113 (Feval_buffer, Feval_region): Bind eval-buffer-list.
114
1152005-07-08 Richard M. Stallman <rms@gnu.org>
116
117 * eval.c (Fdefvar): Allow defvaring a constant to itself quoted.
118
1192005-07-08 Kim F. Storm <storm@cua.dk>
120
121 * keyboard.c (menu_bar_items): Don't GCPRO menu_bar_items_vector here.
122 (syms_of_keyboard): Initialize and staticpro menu_bar_items_vector.
123
1242005-07-07 Kim F. Storm <storm@cua.dk>
125
126 * window.c (Frecenter): Fix last change (set iarg before use).
127
12005-07-06 Richard M. Stallman <rms@gnu.org> 1282005-07-06 Richard M. Stallman <rms@gnu.org>
2 129
3 * window.c (Frecenter): When arg is inside the scroll margin, 130 * window.c (Frecenter): When arg is inside the scroll margin,
@@ -7,7 +134,7 @@
7 134
8 * w32console.c (initialize_w32_display): Detect when the console 135 * w32console.c (initialize_w32_display): Detect when the console
9 dimensions are insane, and default to 80x25 instead. 136 dimensions are insane, and default to 80x25 instead.
10 (w32_use_full_screen_buffer): default to NIL. 137 (w32_use_full_screen_buffer): Default to NIL.
11 138
122005-07-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 1392005-07-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13 140
@@ -15,11 +142,11 @@
15 VERTICAL_BORDER_FACE_ID for vertical border line. 142 VERTICAL_BORDER_FACE_ID for vertical border line.
16 (mac_encode_char): Call check_ccl_update in advance. 143 (mac_encode_char): Call check_ccl_update in advance.
17 (mac_to_x_fontname, x_font_name_to_mac_font_name) 144 (mac_to_x_fontname, x_font_name_to_mac_font_name)
18 (init_font_name_table, mac_do_list_fonts, XLoadQueryFont): Don't 145 (init_font_name_table, mac_do_list_fonts, XLoadQueryFont):
19 assume that font family length is less than 32. 146 Don't assume that font family length is less than 32.
20 (x_compute_min_glyph_bounds): Make static. 147 (x_compute_min_glyph_bounds): Make static.
21 (x_load_font): Never set fonts_changed_p to zero. 148 (x_load_font): Never set fonts_changed_p to zero.
22 149
232005-07-04 Lute Kamstra <lute@gnu.org> 1502005-07-04 Lute Kamstra <lute@gnu.org>
24 151
25 * Update FSF's address in GPL notices. 152 * Update FSF's address in GPL notices.
@@ -67,8 +194,7 @@
67 194
682005-07-01 Masatake YAMATO <jet@gyve.org> 1952005-07-01 Masatake YAMATO <jet@gyve.org>
69 196
70 * emacs.c (main): Passing ADD_NO_RANDOMIZE to 197 * emacs.c (main): Passing ADD_NO_RANDOMIZE to `personality'.
71 `personality'.
72 198
732005-06-30 Juri Linkov <juri@jurta.org> 1992005-06-30 Juri Linkov <juri@jurta.org>
74 200
@@ -196,7 +322,7 @@
196 322
1972005-06-22 Miles Bader <miles@gnu.org> 3232005-06-22 Miles Bader <miles@gnu.org>
198 324
199 * xfaces.c (Qvertical_border): Renamed from `Qvertical_divider'. 325 * xfaces.c (Qvertical_border): Rename from `Qvertical_divider'.
200 (realize_basic_faces, syms_of_xfaces): Update references to it. 326 (realize_basic_faces, syms_of_xfaces): Update references to it.
201 * dispextern.h (enum face_id): Rename `VERTICAL_DIVIDER_FACE_ID' 327 * dispextern.h (enum face_id): Rename `VERTICAL_DIVIDER_FACE_ID'
202 to `VERTICAL_BORDER_FACE_ID'. 328 to `VERTICAL_BORDER_FACE_ID'.
@@ -235,8 +361,8 @@
235 361
2362005-06-17 Richard M. Stallman <rms@gnu.org> 3622005-06-17 Richard M. Stallman <rms@gnu.org>
237 363
238 * xdisp.c (get_next_display_element): Reverse 364 * xdisp.c (get_next_display_element):
239 test of Vshow_nonbreak_escape. 365 Reverse test of Vshow_nonbreak_escape.
240 366
241 * term.c (produce_special_glyphs): Use spec_glyph_lookup_face. 367 * term.c (produce_special_glyphs): Use spec_glyph_lookup_face.
242 (Ftty_no_underline): New function. 368 (Ftty_no_underline): New function.
diff --git a/src/alloc.c b/src/alloc.c
index 26d41c12b50..5c5252b1ba1 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -174,7 +174,9 @@ EMACS_INT strings_consed;
174 174
175/* Number of bytes of consing since GC before another GC should be done. */ 175/* Number of bytes of consing since GC before another GC should be done. */
176 176
177EMACS_INT gc_cons_threshold; 177static EMACS_INT gc_cons_threshold;
178EMACS_INT gc_cons_combined_threshold;
179static Lisp_Object Vgc_cons_percentage;
178 180
179/* Nonzero during GC. */ 181/* Nonzero during GC. */
180 182
@@ -4854,6 +4856,26 @@ returns nil, because real GC can't be done. */)
4854 if (gc_cons_threshold < 10000) 4856 if (gc_cons_threshold < 10000)
4855 gc_cons_threshold = 10000; 4857 gc_cons_threshold = 10000;
4856 4858
4859 gc_cons_combined_threshold = gc_cons_threshold;
4860
4861 if (FLOATP (Vgc_cons_percentage))
4862 { /* Set gc_cons_combined_threshold. */
4863 EMACS_INT total = 0;
4864 EMACS_INT threshold;
4865 total += total_conses * sizeof (struct Lisp_Cons);
4866 total += total_symbols * sizeof (struct Lisp_Symbol);
4867 total += total_markers * sizeof (union Lisp_Misc);
4868 total += total_string_size;
4869 total += total_vector_size * sizeof (Lisp_Object);
4870 total += total_floats * sizeof (struct Lisp_Float);
4871 total += total_intervals * sizeof (struct interval);
4872 total += total_strings * sizeof (struct Lisp_String);
4873
4874 threshold = total * XFLOAT_DATA (Vgc_cons_percentage);
4875 if (threshold > gc_cons_combined_threshold)
4876 gc_cons_combined_threshold = threshold;
4877 }
4878
4857 if (garbage_collection_messages) 4879 if (garbage_collection_messages)
4858 { 4880 {
4859 if (message_p || minibuf_level > 0) 4881 if (message_p || minibuf_level > 0)
@@ -5943,6 +5965,7 @@ init_alloc_once ()
5943 staticidx = 0; 5965 staticidx = 0;
5944 consing_since_gc = 0; 5966 consing_since_gc = 0;
5945 gc_cons_threshold = 100000 * sizeof (Lisp_Object); 5967 gc_cons_threshold = 100000 * sizeof (Lisp_Object);
5968 gc_cons_combined_threshold = gc_cons_threshold;
5946#ifdef VIRT_ADDR_VARIES 5969#ifdef VIRT_ADDR_VARIES
5947 malloc_sbrk_unused = 1<<22; /* A large number */ 5970 malloc_sbrk_unused = 1<<22; /* A large number */
5948 malloc_sbrk_used = 100000; /* as reasonable as any number */ 5971 malloc_sbrk_used = 100000; /* as reasonable as any number */
@@ -5974,7 +5997,15 @@ allocated since the last garbage collection. All data types count.
5974Garbage collection happens automatically only when `eval' is called. 5997Garbage collection happens automatically only when `eval' is called.
5975 5998
5976By binding this temporarily to a large number, you can effectively 5999By binding this temporarily to a large number, you can effectively
5977prevent garbage collection during a part of the program. */); 6000prevent garbage collection during a part of the program.
6001See also `gc-cons-percentage'. */);
6002
6003 DEFVAR_LISP ("gc-cons-percentage", &Vgc_cons_percentage,
6004 doc: /* *Portion of the heap used for allocation.
6005Garbage collection can happen automatically once this portion of the heap
6006has been allocated since the last garbage collection.
6007If this portion is smaller than `gc-cons-threshold', this is ignored. */);
6008 Vgc_cons_percentage = make_float (0.1);
5978 6009
5979 DEFVAR_INT ("pure-bytes-used", &pure_bytes_used, 6010 DEFVAR_INT ("pure-bytes-used", &pure_bytes_used,
5980 doc: /* Number of bytes of sharable Lisp data allocated so far. */); 6011 doc: /* Number of bytes of sharable Lisp data allocated so far. */);
diff --git a/src/bytecode.c b/src/bytecode.c
index 42b2cdfd635..580fdc67119 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -355,13 +355,13 @@ unmark_byte_stack ()
355/* Garbage collect if we have consed enough since the last time. 355/* Garbage collect if we have consed enough since the last time.
356 We do this at every branch, to avoid loops that never GC. */ 356 We do this at every branch, to avoid loops that never GC. */
357 357
358#define MAYBE_GC() \ 358#define MAYBE_GC() \
359 if (consing_since_gc > gc_cons_threshold) \ 359 if (consing_since_gc > gc_cons_combined_threshold) \
360 { \ 360 { \
361 BEFORE_POTENTIAL_GC (); \ 361 BEFORE_POTENTIAL_GC (); \
362 Fgarbage_collect (); \ 362 Fgarbage_collect (); \
363 AFTER_POTENTIAL_GC (); \ 363 AFTER_POTENTIAL_GC (); \
364 } \ 364 } \
365 else 365 else
366 366
367/* Check for jumping out of range. */ 367/* Check for jumping out of range. */
diff --git a/src/coding.c b/src/coding.c
index 77a344eba72..8b1d3a6b626 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -316,7 +316,7 @@ Lisp_Object QCdecode_translation_table, QCencode_translation_table;
316Lisp_Object QCpost_read_conversion, QCpre_write_conversion; 316Lisp_Object QCpost_read_conversion, QCpre_write_conversion;
317 317
318extern Lisp_Object Qinsert_file_contents, Qwrite_region; 318extern Lisp_Object Qinsert_file_contents, Qwrite_region;
319Lisp_Object Qcall_process, Qcall_process_region, Qprocess_argument; 319Lisp_Object Qcall_process, Qcall_process_region;
320Lisp_Object Qstart_process, Qopen_network_stream; 320Lisp_Object Qstart_process, Qopen_network_stream;
321Lisp_Object Qtarget_idx; 321Lisp_Object Qtarget_idx;
322 322
diff --git a/src/coding.h b/src/coding.h
index aab23a2fbf6..f96b86b2413 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -704,7 +704,7 @@ extern Lisp_Object eol_mnemonic_undecided;
704 704
705#ifdef emacs 705#ifdef emacs
706extern Lisp_Object Qfile_coding_system; 706extern Lisp_Object Qfile_coding_system;
707extern Lisp_Object Qcall_process, Qcall_process_region, Qprocess_argument; 707extern Lisp_Object Qcall_process, Qcall_process_region;
708extern Lisp_Object Qstart_process, Qopen_network_stream; 708extern Lisp_Object Qstart_process, Qopen_network_stream;
709extern Lisp_Object Qwrite_region; 709extern Lisp_Object Qwrite_region;
710 710
diff --git a/src/eval.c b/src/eval.c
index f625258229e..3b4e9fe0324 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -807,8 +807,16 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
807 807
808 sym = Fcar (args); 808 sym = Fcar (args);
809 if (SYMBOL_CONSTANT_P (sym)) 809 if (SYMBOL_CONSTANT_P (sym))
810 error ("Constant symbol `%s' specified in defvar", 810 {
811 SDATA (SYMBOL_NAME (sym))); 811 /* For updward compatibility, allow (defvar :foo (quote :foo)). */
812 tem = Fcar (Fcdr (args));
813 if (! (CONSP (tem)
814 && EQ (XCAR (tem), Qquote)
815 && CONSP (XCDR (tem))
816 && EQ (XCAR (XCDR (tem)), sym)))
817 error ("Constant symbol `%s' specified in defvar",
818 SDATA (SYMBOL_NAME (sym)));
819 }
812 820
813 tail = Fcdr (args); 821 tail = Fcdr (args);
814 if (!NILP (Fcdr (Fcdr (tail)))) 822 if (!NILP (Fcdr (Fcdr (tail))))
@@ -2085,7 +2093,7 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0,
2085 return form; 2093 return form;
2086 2094
2087 QUIT; 2095 QUIT;
2088 if (consing_since_gc > gc_cons_threshold) 2096 if (consing_since_gc > gc_cons_combined_threshold)
2089 { 2097 {
2090 GCPRO1 (form); 2098 GCPRO1 (form);
2091 Fgarbage_collect (); 2099 Fgarbage_collect ();
@@ -2785,7 +2793,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
2785 register int i; 2793 register int i;
2786 2794
2787 QUIT; 2795 QUIT;
2788 if (consing_since_gc > gc_cons_threshold) 2796 if (consing_since_gc > gc_cons_combined_threshold)
2789 Fgarbage_collect (); 2797 Fgarbage_collect ();
2790 2798
2791 if (++lisp_eval_depth > max_lisp_eval_depth) 2799 if (++lisp_eval_depth > max_lisp_eval_depth)
diff --git a/src/indent.c b/src/indent.c
index 721b9ea640f..7ad56e02ff3 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2074,6 +2074,7 @@ whether or not it is currently displayed in some window. */)
2074 { 2074 {
2075 int it_start; 2075 int it_start;
2076 int oselective; 2076 int oselective;
2077 int start_on_image_p;
2077 2078
2078 SET_TEXT_POS (pt, PT, PT_BYTE); 2079 SET_TEXT_POS (pt, PT, PT_BYTE);
2079 start_display (&it, w, pt); 2080 start_display (&it, w, pt);
@@ -2085,6 +2086,7 @@ whether or not it is currently displayed in some window. */)
2085 while the end position is really at some X > 0, the same X that 2086 while the end position is really at some X > 0, the same X that
2086 PT had. */ 2087 PT had. */
2087 it_start = IT_CHARPOS (it); 2088 it_start = IT_CHARPOS (it);
2089 start_on_image_p = (it.method == GET_FROM_IMAGE);
2088 reseat_at_previous_visible_line_start (&it); 2090 reseat_at_previous_visible_line_start (&it);
2089 it.current_x = it.hpos = 0; 2091 it.current_x = it.hpos = 0;
2090 /* Temporarily disable selective display so we don't move too far */ 2092 /* Temporarily disable selective display so we don't move too far */
@@ -2094,8 +2096,10 @@ whether or not it is currently displayed in some window. */)
2094 it.selective = oselective; 2096 it.selective = oselective;
2095 2097
2096 /* Move back if we got too far. This may happen if 2098 /* Move back if we got too far. This may happen if
2097 truncate-lines is on and PT is beyond right margin. */ 2099 truncate-lines is on and PT is beyond right margin.
2098 if (IT_CHARPOS (it) > it_start && XINT (lines) > 0) 2100 It may also happen if it_start is on an image --
2101 in that case, don't go back. */
2102 if (IT_CHARPOS (it) > it_start && XINT (lines) > 0 && !start_on_image_p)
2099 move_it_by_lines (&it, -1, 0); 2103 move_it_by_lines (&it, -1, 0);
2100 2104
2101 it.vpos = 0; 2105 it.vpos = 0;
diff --git a/src/keyboard.c b/src/keyboard.c
index 1ab4be0347c..9da6ce92471 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2778,7 +2778,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2778 available, garbage collect if there has been enough 2778 available, garbage collect if there has been enough
2779 consing going on to make it worthwhile. */ 2779 consing going on to make it worthwhile. */
2780 if (!detect_input_pending_run_timers (0) 2780 if (!detect_input_pending_run_timers (0)
2781 && consing_since_gc > gc_cons_threshold / 2) 2781 && consing_since_gc > gc_cons_combined_threshold / 2)
2782 Fgarbage_collect (); 2782 Fgarbage_collect ();
2783 2783
2784 redisplay (); 2784 redisplay ();
@@ -6916,8 +6916,6 @@ menu_bar_items (old)
6916 6916
6917 int i; 6917 int i;
6918 6918
6919 struct gcpro gcpro1;
6920
6921 /* In order to build the menus, we need to call the keymap 6919 /* In order to build the menus, we need to call the keymap
6922 accessors. They all call QUIT. But this function is called 6920 accessors. They all call QUIT. But this function is called
6923 during redisplay, during which a quit is fatal. So inhibit 6921 during redisplay, during which a quit is fatal. So inhibit
@@ -6933,8 +6931,6 @@ menu_bar_items (old)
6933 menu_bar_items_vector = Fmake_vector (make_number (24), Qnil); 6931 menu_bar_items_vector = Fmake_vector (make_number (24), Qnil);
6934 menu_bar_items_index = 0; 6932 menu_bar_items_index = 0;
6935 6933
6936 GCPRO1 (menu_bar_items_vector);
6937
6938 /* Build our list of keymaps. 6934 /* Build our list of keymaps.
6939 If we recognize a function key and replace its escape sequence in 6935 If we recognize a function key and replace its escape sequence in
6940 keybuf with its symbol, or if the sequence starts with a mouse 6936 keybuf with its symbol, or if the sequence starts with a mouse
@@ -7038,7 +7034,6 @@ menu_bar_items (old)
7038 menu_bar_items_index = i; 7034 menu_bar_items_index = i;
7039 7035
7040 Vinhibit_quit = oquit; 7036 Vinhibit_quit = oquit;
7041 UNGCPRO;
7042 return menu_bar_items_vector; 7037 return menu_bar_items_vector;
7043} 7038}
7044 7039
@@ -11009,6 +11004,9 @@ syms_of_keyboard ()
11009 menu_bar_one_keymap_changed_items = Qnil; 11004 menu_bar_one_keymap_changed_items = Qnil;
11010 staticpro (&menu_bar_one_keymap_changed_items); 11005 staticpro (&menu_bar_one_keymap_changed_items);
11011 11006
11007 menu_bar_items_vector = Qnil;
11008 staticpro (&menu_bar_items_vector);
11009
11012 defsubr (&Sevent_convert_list); 11010 defsubr (&Sevent_convert_list);
11013 defsubr (&Sread_key_sequence); 11011 defsubr (&Sread_key_sequence);
11014 defsubr (&Sread_key_sequence_vector); 11012 defsubr (&Sread_key_sequence_vector);
diff --git a/src/lisp.h b/src/lisp.h
index 890359750ec..aaee9dcc879 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1888,7 +1888,7 @@ extern int consing_since_gc;
1888 1888
1889/* Threshold for doing another gc. */ 1889/* Threshold for doing another gc. */
1890 1890
1891extern EMACS_INT gc_cons_threshold; 1891extern EMACS_INT gc_cons_combined_threshold;
1892 1892
1893/* Structure for recording stack slots that need marking. */ 1893/* Structure for recording stack slots that need marking. */
1894 1894
diff --git a/src/lread.c b/src/lread.c
index 72f758e0735..52a68923682 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -87,6 +87,7 @@ Lisp_Object Qvariable_documentation, Vvalues, Vstandard_input, Vafter_load_alist
87Lisp_Object Qascii_character, Qload, Qload_file_name; 87Lisp_Object Qascii_character, Qload, Qload_file_name;
88Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction; 88Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction;
89Lisp_Object Qinhibit_file_name_operation; 89Lisp_Object Qinhibit_file_name_operation;
90Lisp_Object Qeval_buffer_list, Veval_buffer_list;
90 91
91/* Used instead of Qget_file_char while loading *.elc files compiled 92/* Used instead of Qget_file_char while loading *.elc files compiled
92 by Emacs 21 or older. */ 93 by Emacs 21 or older. */
@@ -1643,6 +1644,7 @@ This function preserves the position of point. */)
1643 if (NILP (filename)) 1644 if (NILP (filename))
1644 filename = XBUFFER (buf)->filename; 1645 filename = XBUFFER (buf)->filename;
1645 1646
1647 specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list));
1646 specbind (Qstandard_output, tem); 1648 specbind (Qstandard_output, tem);
1647 record_unwind_protect (save_excursion_restore, save_excursion_save ()); 1649 record_unwind_protect (save_excursion_restore, save_excursion_save ());
1648 BUF_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf))); 1650 BUF_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf)));
@@ -1678,6 +1680,7 @@ This function does not move point. */)
1678 else 1680 else
1679 tem = printflag; 1681 tem = printflag;
1680 specbind (Qstandard_output, tem); 1682 specbind (Qstandard_output, tem);
1683 specbind (Qeval_buffer_list, Fcons (cbuf, Veval_buffer_list));
1681 1684
1682 /* readevalloop calls functions which check the type of start and end. */ 1685 /* readevalloop calls functions which check the type of start and end. */
1683 readevalloop (cbuf, 0, XBUFFER (cbuf)->filename, Feval, 1686 readevalloop (cbuf, 0, XBUFFER (cbuf)->filename, Feval,
@@ -4099,6 +4102,10 @@ to load. See also `load-dangerous-libraries'. */);
4099 Vbytecomp_version_regexp 4102 Vbytecomp_version_regexp
4100 = build_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)"); 4103 = build_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)");
4101 4104
4105 DEFVAR_LISP ("eval-buffer-list", &Veval_buffer_list,
4106 doc: /* List of buffers being read from by calls to `eval-buffer' and `eval-region'. */);
4107 Veval_buffer_list = Qnil;
4108
4102 /* Vsource_directory was initialized in init_lread. */ 4109 /* Vsource_directory was initialized in init_lread. */
4103 4110
4104 load_descriptor_list = Qnil; 4111 load_descriptor_list = Qnil;
@@ -4146,6 +4153,9 @@ to load. See also `load-dangerous-libraries'. */);
4146 Qload_file_name = intern ("load-file-name"); 4153 Qload_file_name = intern ("load-file-name");
4147 staticpro (&Qload_file_name); 4154 staticpro (&Qload_file_name);
4148 4155
4156 Qeval_buffer_list = intern ("eval-buffer-list");
4157 staticpro (&Qeval_buffer_list);
4158
4149 staticpro (&dump_path); 4159 staticpro (&dump_path);
4150 4160
4151 staticpro (&read_objects); 4161 staticpro (&read_objects);
diff --git a/src/mac.c b/src/mac.c
index ef136ab6512..203b47a1975 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -34,10 +34,9 @@ Boston, MA 02110-1301, USA. */
34 34
35#include "macterm.h" 35#include "macterm.h"
36 36
37#if TARGET_API_MAC_CARBON
38#include "charset.h" 37#include "charset.h"
39#include "coding.h" 38#include "coding.h"
40#else /* not TARGET_API_MAC_CARBON */ 39#if !TARGET_API_MAC_CARBON
41#include <Files.h> 40#include <Files.h>
42#include <MacTypes.h> 41#include <MacTypes.h>
43#include <TextUtils.h> 42#include <TextUtils.h>
@@ -53,6 +52,7 @@ Boston, MA 02110-1301, USA. */
53#include <Processes.h> 52#include <Processes.h>
54#include <EPPC.h> 53#include <EPPC.h>
55#include <MacLocales.h> 54#include <MacLocales.h>
55#include <Endian.h>
56#endif /* not TARGET_API_MAC_CARBON */ 56#endif /* not TARGET_API_MAC_CARBON */
57 57
58#include <utime.h> 58#include <utime.h>
@@ -1021,7 +1021,7 @@ xrm_cfproperty_list_to_value (plist)
1021 CFTypeID type_id = CFGetTypeID (plist); 1021 CFTypeID type_id = CFGetTypeID (plist);
1022 1022
1023 if (type_id == CFStringGetTypeID ()) 1023 if (type_id == CFStringGetTypeID ())
1024 return cfstring_to_lisp (plist); 1024 return cfstring_to_lisp (plist);
1025 else if (type_id == CFNumberGetTypeID ()) 1025 else if (type_id == CFNumberGetTypeID ())
1026 { 1026 {
1027 CFStringRef string; 1027 CFStringRef string;
@@ -2490,6 +2490,22 @@ chmod (const char *path, mode_t mode)
2490 2490
2491 2491
2492int 2492int
2493fchmod (int fd, mode_t mode)
2494{
2495 /* say it always succeed for now */
2496 return 0;
2497}
2498
2499
2500int
2501fchown (int fd, uid_t owner, gid_t group)
2502{
2503 /* say it always succeed for now */
2504 return 0;
2505}
2506
2507
2508int
2493dup (int oldd) 2509dup (int oldd)
2494{ 2510{
2495#ifdef __MRC__ 2511#ifdef __MRC__
@@ -3388,12 +3404,278 @@ initialize_applescript ()
3388} 3404}
3389 3405
3390 3406
3391void terminate_applescript() 3407void
3408terminate_applescript()
3392{ 3409{
3393 OSADispose (as_scripting_component, as_script_context); 3410 OSADispose (as_scripting_component, as_script_context);
3394 CloseComponent (as_scripting_component); 3411 CloseComponent (as_scripting_component);
3395} 3412}
3396 3413
3414/* Convert a lisp string to the 4 byte character code. */
3415
3416OSType
3417mac_get_code_from_arg(Lisp_Object arg, OSType defCode)
3418{
3419 OSType result;
3420 if (NILP(arg))
3421 {
3422 result = defCode;
3423 }
3424 else
3425 {
3426 /* check type string */
3427 CHECK_STRING(arg);
3428 if (SBYTES (arg) != 4)
3429 {
3430 error ("Wrong argument: need string of length 4 for code");
3431 }
3432 result = EndianU32_BtoN (*((UInt32 *) SDATA (arg)));
3433 }
3434 return result;
3435}
3436
3437/* Convert the 4 byte character code into a 4 byte string. */
3438
3439Lisp_Object
3440mac_get_object_from_code(OSType defCode)
3441{
3442 UInt32 code = EndianU32_NtoB (defCode);
3443
3444 return make_unibyte_string ((char *)&code, 4);
3445}
3446
3447
3448DEFUN ("mac-get-file-creator", Fmac_get_file_creator, Smac_get_file_creator, 1, 1, 0,
3449 doc: /* Get the creator code of FILENAME as a four character string. */)
3450 (filename)
3451 Lisp_Object filename;
3452{
3453 OSErr status;
3454#ifdef MAC_OSX
3455 FSRef fref;
3456#else
3457 FSSpec fss;
3458#endif
3459 OSType cCode;
3460 Lisp_Object result = Qnil;
3461 CHECK_STRING (filename);
3462
3463 if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) {
3464 return Qnil;
3465 }
3466 filename = Fexpand_file_name (filename, Qnil);
3467
3468 BLOCK_INPUT;
3469#ifdef MAC_OSX
3470 status = FSPathMakeRef(SDATA(ENCODE_FILE(filename)), &fref, NULL);
3471#else
3472 status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (filename)), &fss);
3473#endif
3474
3475 if (status == noErr)
3476 {
3477#ifdef MAC_OSX
3478 FSCatalogInfo catalogInfo;
3479
3480 status = FSGetCatalogInfo(&fref, kFSCatInfoFinderInfo,
3481 &catalogInfo, NULL, NULL, NULL);
3482#else
3483 FInfo finder_info;
3484
3485 status = FSpGetFInfo (&fss, &finder_info);
3486#endif
3487 if (status == noErr)
3488 {
3489#ifdef MAC_OSX
3490 result = mac_get_object_from_code(((FileInfo*)&catalogInfo.finderInfo)->fileCreator);
3491#else
3492 result = mac_get_object_from_code (finder_info.fdCreator);
3493#endif
3494 }
3495 }
3496 UNBLOCK_INPUT;
3497 if (status != noErr) {
3498 error ("Error while getting file information.");
3499 }
3500 return result;
3501}
3502
3503DEFUN ("mac-get-file-type", Fmac_get_file_type, Smac_get_file_type, 1, 1, 0,
3504 doc: /* Get the type code of FILENAME as a four character string. */)
3505 (filename)
3506 Lisp_Object filename;
3507{
3508 OSErr status;
3509#ifdef MAC_OSX
3510 FSRef fref;
3511#else
3512 FSSpec fss;
3513#endif
3514 OSType cCode;
3515 Lisp_Object result = Qnil;
3516 CHECK_STRING (filename);
3517
3518 if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) {
3519 return Qnil;
3520 }
3521 filename = Fexpand_file_name (filename, Qnil);
3522
3523 BLOCK_INPUT;
3524#ifdef MAC_OSX
3525 status = FSPathMakeRef(SDATA(ENCODE_FILE(filename)), &fref, NULL);
3526#else
3527 status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (filename)), &fss);
3528#endif
3529
3530 if (status == noErr)
3531 {
3532#ifdef MAC_OSX
3533 FSCatalogInfo catalogInfo;
3534
3535 status = FSGetCatalogInfo(&fref, kFSCatInfoFinderInfo,
3536 &catalogInfo, NULL, NULL, NULL);
3537#else
3538 FInfo finder_info;
3539
3540 status = FSpGetFInfo (&fss, &finder_info);
3541#endif
3542 if (status == noErr)
3543 {
3544#ifdef MAC_OSX
3545 result = mac_get_object_from_code(((FileInfo*)&catalogInfo.finderInfo)->fileType);
3546#else
3547 result = mac_get_object_from_code (finder_info.fdType);
3548#endif
3549 }
3550 }
3551 UNBLOCK_INPUT;
3552 if (status != noErr) {
3553 error ("Error while getting file information.");
3554 }
3555 return result;
3556}
3557
3558DEFUN ("mac-set-file-creator", Fmac_set_file_creator, Smac_set_file_creator, 1, 2, 0,
3559 doc: /* Set creator code of file FILENAME to CODE.
3560If non-nil, CODE must be a 4-character string. Otherwise, 'EMAx' is
3561assumed. Return non-nil if successful. */)
3562 (filename, code)
3563 Lisp_Object filename, code;
3564{
3565 OSErr status;
3566#ifdef MAC_OSX
3567 FSRef fref;
3568#else
3569 FSSpec fss;
3570#endif
3571 OSType cCode;
3572 CHECK_STRING (filename);
3573
3574 cCode = mac_get_code_from_arg(code, 'EMAx');
3575
3576 if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) {
3577 return Qnil;
3578 }
3579 filename = Fexpand_file_name (filename, Qnil);
3580
3581 BLOCK_INPUT;
3582#ifdef MAC_OSX
3583 status = FSPathMakeRef(SDATA(ENCODE_FILE(filename)), &fref, NULL);
3584#else
3585 status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (filename)), &fss);
3586#endif
3587
3588 if (status == noErr)
3589 {
3590#ifdef MAC_OSX
3591 FSCatalogInfo catalogInfo;
3592 FSRef parentDir;
3593 status = FSGetCatalogInfo(&fref, kFSCatInfoFinderInfo,
3594 &catalogInfo, NULL, NULL, &parentDir);
3595#else
3596 FInfo finder_info;
3597
3598 status = FSpGetFInfo (&fss, &finder_info);
3599#endif
3600 if (status == noErr)
3601 {
3602#ifdef MAC_OSX
3603 ((FileInfo*)&catalogInfo.finderInfo)->fileCreator = cCode;
3604 status = FSSetCatalogInfo(&fref, kFSCatInfoFinderInfo, &catalogInfo);
3605 /* TODO: on Mac OS 10.2, we need to touch the parent dir, FNNotify? */
3606#else
3607 finder_info.fdCreator = cCode;
3608 status = FSpSetFInfo (&fss, &finder_info);
3609#endif
3610 }
3611 }
3612 UNBLOCK_INPUT;
3613 if (status != noErr) {
3614 error ("Error while setting creator information.");
3615 }
3616 return Qt;
3617}
3618
3619DEFUN ("mac-set-file-type", Fmac_set_file_type, Smac_set_file_type, 2, 2, 0,
3620 doc: /* Set file code of file FILENAME to CODE.
3621CODE must be a 4-character string. Return non-nil if successful. */)
3622 (filename, code)
3623 Lisp_Object filename, code;
3624{
3625 OSErr status;
3626#ifdef MAC_OSX
3627 FSRef fref;
3628#else
3629 FSSpec fss;
3630#endif
3631 OSType cCode;
3632 CHECK_STRING (filename);
3633
3634 cCode = mac_get_code_from_arg(code, 0); /* Default to empty code*/
3635
3636 if (NILP(Ffile_exists_p(filename)) || !NILP(Ffile_directory_p(filename))) {
3637 return Qnil;
3638 }
3639 filename = Fexpand_file_name (filename, Qnil);
3640
3641 BLOCK_INPUT;
3642#ifdef MAC_OSX
3643 status = FSPathMakeRef(SDATA(ENCODE_FILE(filename)), &fref, NULL);
3644#else
3645 status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (filename)), &fss);
3646#endif
3647
3648 if (status == noErr)
3649 {
3650#ifdef MAC_OSX
3651 FSCatalogInfo catalogInfo;
3652 FSRef parentDir;
3653 status = FSGetCatalogInfo(&fref, kFSCatInfoFinderInfo,
3654 &catalogInfo, NULL, NULL, &parentDir);
3655#else
3656 FInfo finder_info;
3657
3658 status = FSpGetFInfo (&fss, &finder_info);
3659#endif
3660 if (status == noErr)
3661 {
3662#ifdef MAC_OSX
3663 ((FileInfo*)&catalogInfo.finderInfo)->fileType = cCode;
3664 status = FSSetCatalogInfo(&fref, kFSCatInfoFinderInfo, &catalogInfo);
3665 /* TODO: on Mac OS 10.2, we need to touch the parent dir, FNNotify? */
3666#else
3667 finder_info.fdType = cCode;
3668 status = FSpSetFInfo (&fss, &finder_info);
3669#endif
3670 }
3671 }
3672 UNBLOCK_INPUT;
3673 if (status != noErr) {
3674 error ("Error while setting creator information.");
3675 }
3676 return Qt;
3677}
3678
3397 3679
3398/* Compile and execute the AppleScript SCRIPT and return the error 3680/* Compile and execute the AppleScript SCRIPT and return the error
3399 status as function value. A zero is returned if compilation and 3681 status as function value. A zero is returned if compilation and
@@ -4361,6 +4643,10 @@ syms_of_mac ()
4361#endif 4643#endif
4362 defsubr (&Smac_clear_font_name_table); 4644 defsubr (&Smac_clear_font_name_table);
4363 4645
4646 defsubr (&Smac_set_file_creator);
4647 defsubr (&Smac_set_file_type);
4648 defsubr (&Smac_get_file_creator);
4649 defsubr (&Smac_get_file_type);
4364 defsubr (&Sdo_applescript); 4650 defsubr (&Sdo_applescript);
4365 defsubr (&Smac_file_name_to_posix); 4651 defsubr (&Smac_file_name_to_posix);
4366 defsubr (&Sposix_file_name_to_mac); 4652 defsubr (&Sposix_file_name_to_mac);
diff --git a/src/macterm.c b/src/macterm.c
index 53028f973f2..9420f236e59 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -22,10 +22,10 @@ Boston, MA 02110-1301, USA. */
22 22
23#include <config.h> 23#include <config.h>
24#include <signal.h> 24#include <signal.h>
25
25#include <stdio.h> 26#include <stdio.h>
26#include <stdlib.h> 27
27#include "lisp.h" 28#include "lisp.h"
28#include "charset.h"
29#include "blockinput.h" 29#include "blockinput.h"
30 30
31#include "macterm.h" 31#include "macterm.h"
@@ -62,8 +62,6 @@ Boston, MA 02110-1301, USA. */
62 62
63#include "systty.h" 63#include "systty.h"
64#include "systime.h" 64#include "systime.h"
65#include "atimer.h"
66#include "keymap.h"
67 65
68#include <ctype.h> 66#include <ctype.h>
69#include <errno.h> 67#include <errno.h>
@@ -71,7 +69,8 @@ Boston, MA 02110-1301, USA. */
71#include <sys/stat.h> 69#include <sys/stat.h>
72#include <sys/param.h> 70#include <sys/param.h>
73 71
74#include "keyboard.h" 72#include "charset.h"
73#include "coding.h"
75#include "frame.h" 74#include "frame.h"
76#include "dispextern.h" 75#include "dispextern.h"
77#include "fontset.h" 76#include "fontset.h"
@@ -82,10 +81,11 @@ Boston, MA 02110-1301, USA. */
82#include "disptab.h" 81#include "disptab.h"
83#include "buffer.h" 82#include "buffer.h"
84#include "window.h" 83#include "window.h"
84#include "keyboard.h"
85#include "intervals.h" 85#include "intervals.h"
86#include "composite.h" 86#include "atimer.h"
87#include "keymap.h"
87#include "character.h" 88#include "character.h"
88#include "coding.h"
89#include "ccl.h" 89#include "ccl.h"
90 90
91/* Set of macros that handle mapping of Mac modifier keys to emacs. */ 91/* Set of macros that handle mapping of Mac modifier keys to emacs. */
@@ -116,15 +116,6 @@ static int any_help_event_p;
116/* Last window where we saw the mouse. Used by mouse-autoselect-window. */ 116/* Last window where we saw the mouse. Used by mouse-autoselect-window. */
117static Lisp_Object last_window; 117static Lisp_Object last_window;
118 118
119/* Non-zero means make use of UNDERLINE_POSITION font properties. */
120
121int x_use_underline_position_properties;
122
123/* Non-zero means draw block and hollow cursor as wide as the glyph
124 under it. For example, if a block cursor is over a tab, it will be
125 drawn as wide as that tab on the display. */
126
127
128/* This is a chain of structures for all the X displays currently in 119/* This is a chain of structures for all the X displays currently in
129 use. */ 120 use. */
130 121
@@ -150,8 +141,6 @@ struct mac_display_info one_mac_display_info;
150 141
151extern struct frame *updating_frame; 142extern struct frame *updating_frame;
152 143
153extern int waiting_for_input;
154
155/* This is a frame waiting to be auto-raised, within XTread_socket. */ 144/* This is a frame waiting to be auto-raised, within XTread_socket. */
156 145
157struct frame *pending_autoraise_frame; 146struct frame *pending_autoraise_frame;
@@ -179,7 +168,6 @@ struct frame *pending_autoraise_frame;
179/* Where the mouse was last time we reported a mouse event. */ 168/* Where the mouse was last time we reported a mouse event. */
180 169
181static Rect last_mouse_glyph; 170static Rect last_mouse_glyph;
182static Lisp_Object last_mouse_press_frame;
183 171
184/* The scroll bar in which the last X motion event occurred. 172/* The scroll bar in which the last X motion event occurred.
185 173
@@ -213,45 +201,24 @@ static int volatile input_signal_count;
213static int input_signal_count; 201static int input_signal_count;
214#endif 202#endif
215 203
216/* Used locally within XTread_socket. */ 204extern Lisp_Object Vsystem_name;
217
218static int x_noop_count;
219
220/* Initial values of argv and argc. */
221
222extern char **initial_argv;
223extern int initial_argc;
224
225extern Lisp_Object Vcommand_line_args, Vsystem_name;
226
227/* Tells if a window manager is present or not. */
228
229extern Lisp_Object Vx_no_window_manager;
230
231extern int errno;
232 205
233/* A mask of extra modifier bits to put into every keyboard char. */ 206/* A mask of extra modifier bits to put into every keyboard char. */
234 207
235extern int extra_keyboard_modifiers; 208extern EMACS_INT extra_keyboard_modifiers;
236 209
237/* The keysyms to use for the various modifiers. */ 210/* The keysyms to use for the various modifiers. */
238 211
239static Lisp_Object Qalt, Qhyper, Qsuper, Qmodifier_value; 212static Lisp_Object Qalt, Qhyper, Qsuper, Qmodifier_value;
240 213
241static Lisp_Object Qvendor_specific_keysyms;
242
243#if 0
244extern XrmDatabase x_load_resources P_ ((Display *, char *, char *, char *));
245#endif
246
247extern int inhibit_window_system; 214extern int inhibit_window_system;
248 215
249#if __MRC__ && !TARGET_API_MAC_CARBON 216#if __MRC__ && !TARGET_API_MAC_CARBON
250QDGlobals qd; /* QuickDraw global information structure. */ 217QDGlobals qd; /* QuickDraw global information structure. */
251#endif 218#endif
252 219
220#define mac_window_to_frame(wp) (((mac_output *) GetWRefCon (wp))->mFP)
253 221
254struct frame * x_window_to_frame (struct mac_display_info *, WindowPtr);
255struct mac_display_info *mac_display_info_for_display (Display *); 222struct mac_display_info *mac_display_info_for_display (Display *);
256static void x_update_window_end P_ ((struct window *, int, int)); 223static void x_update_window_end P_ ((struct window *, int, int));
257static int x_io_error_quitter P_ ((Display *)); 224static int x_io_error_quitter P_ ((Display *));
@@ -291,17 +258,18 @@ static void x_flush P_ ((struct frame *f));
291static void x_update_begin P_ ((struct frame *)); 258static void x_update_begin P_ ((struct frame *));
292static void x_update_window_begin P_ ((struct window *)); 259static void x_update_window_begin P_ ((struct window *));
293static void x_after_update_window_line P_ ((struct glyph_row *)); 260static void x_after_update_window_line P_ ((struct glyph_row *));
261static void x_scroll_bar_report_motion P_ ((struct frame **, Lisp_Object *,
262 enum scroll_bar_part *,
263 Lisp_Object *, Lisp_Object *,
264 unsigned long *));
294 265
295static int is_emacs_window (WindowPtr); 266static int is_emacs_window (WindowPtr);
296 267
297int x_bitmap_icon (struct frame *, Lisp_Object); 268int x_bitmap_icon (struct frame *, Lisp_Object);
298void x_make_frame_visible (struct frame *); 269void x_make_frame_visible (struct frame *);
299 270
300extern void window_scroll (Lisp_Object, int, int, int);
301
302/* Defined in macmenu.h. */ 271/* Defined in macmenu.h. */
303extern void menubar_selection_callback (FRAME_PTR, int); 272extern void menubar_selection_callback (FRAME_PTR, int);
304extern void set_frame_menubar (FRAME_PTR, int, int);
305 273
306/* X display function emulation */ 274/* X display function emulation */
307 275
@@ -914,24 +882,6 @@ mac_copy_area_with_mask (display, src, mask, dest, gc, src_x, src_y,
914} 882}
915 883
916 884
917#if 0
918/* Convert a pair of local coordinates to global (screen) coordinates.
919 Assume graphic port has been properly set. */
920static void
921local_to_global_coord (short *h, short *v)
922{
923 Point p;
924
925 p.h = *h;
926 p.v = *v;
927
928 LocalToGlobal (&p);
929
930 *h = p.h;
931 *v = p.v;
932}
933#endif
934
935/* Mac replacement for XCopyArea: used only for scrolling. */ 885/* Mac replacement for XCopyArea: used only for scrolling. */
936 886
937static void 887static void
@@ -955,23 +905,10 @@ mac_scroll_area (display, w, gc, src_x, src_y, width, height, dest_x, dest_y)
955 Rect src_r, dest_r; 905 Rect src_r, dest_r;
956 906
957 SetPort (w); 907 SetPort (w);
958#if 0
959 mac_set_colors (gc, NULL);
960#endif
961 908
962 SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); 909 SetRect (&src_r, src_x, src_y, src_x + width, src_y + height);
963 SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height); 910 SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height);
964 911
965#if 0
966 /* Need to use global coordinates and screenBits since src and dest
967 areas overlap in general. */
968 local_to_global_coord (&src_r.left, &src_r.top);
969 local_to_global_coord (&src_r.right, &src_r.bottom);
970 local_to_global_coord (&dest_r.left, &dest_r.top);
971 local_to_global_coord (&dest_r.right, &dest_r.bottom);
972
973 CopyBits (&qd.screenBits, &qd.screenBits, &src_r, &dest_r, srcCopy, 0);
974#else
975 /* In Color QuickDraw, set ForeColor and BackColor as follows to avoid 912 /* In Color QuickDraw, set ForeColor and BackColor as follows to avoid
976 color mapping in CopyBits. Otherwise, it will be slow. */ 913 color mapping in CopyBits. Otherwise, it will be slow. */
977 ForeColor (blackColor); 914 ForeColor (blackColor);
@@ -979,7 +916,6 @@ mac_scroll_area (display, w, gc, src_x, src_y, width, height, dest_x, dest_y)
979 CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0); 916 CopyBits (&(w->portBits), &(w->portBits), &src_r, &dest_r, srcCopy, 0);
980 917
981 mac_set_colors (gc, NULL); 918 mac_set_colors (gc, NULL);
982#endif
983#endif /* not TARGET_API_MAC_CARBON */ 919#endif /* not TARGET_API_MAC_CARBON */
984} 920}
985 921
@@ -1347,7 +1283,6 @@ mac_draw_vertical_window_border (w, x, y0, y1)
1347 f->output_data.mac->normal_gc, x, y0, x, y1); 1283 f->output_data.mac->normal_gc, x, y0, x, y1);
1348} 1284}
1349 1285
1350
1351/* End update of window W (which is equal to updated_window). 1286/* End update of window W (which is equal to updated_window).
1352 1287
1353 Draw vertical borders between horizontally adjacent windows, and 1288 Draw vertical borders between horizontally adjacent windows, and
@@ -1359,7 +1294,7 @@ mac_draw_vertical_window_border (w, x, y0, y1)
1359 1294
1360 W may be a menu bar pseudo-window in case we don't have X toolkit 1295 W may be a menu bar pseudo-window in case we don't have X toolkit
1361 support. Such windows don't have a cursor, so don't display it 1296 support. Such windows don't have a cursor, so don't display it
1362 here. */ 1297 here. */
1363 1298
1364static void 1299static void
1365x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p) 1300x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
@@ -1392,14 +1327,6 @@ x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
1392 dpyinfo->mouse_face_window = Qnil; 1327 dpyinfo->mouse_face_window = Qnil;
1393 } 1328 }
1394 1329
1395#if 0
1396 /* Unhide the caret. This won't actually show the cursor, unless it
1397 was visible before the corresponding call to HideCaret in
1398 x_update_window_begin. */
1399 if (w32_use_visible_system_caret)
1400 SendMessage (w32_system_caret_hwnd, WM_EMACS_SHOW_CARET, 0, 0);
1401#endif
1402
1403 updated_window = NULL; 1330 updated_window = NULL;
1404} 1331}
1405 1332
@@ -1485,19 +1412,18 @@ x_after_update_window_line (desired_row)
1485 height > 0)) 1412 height > 0))
1486 { 1413 {
1487 int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y)); 1414 int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y));
1415
1488 /* Internal border is drawn below the tool bar. */ 1416 /* Internal border is drawn below the tool bar. */
1489 if (WINDOWP (f->tool_bar_window) 1417 if (WINDOWP (f->tool_bar_window)
1490 && w == XWINDOW (f->tool_bar_window)) 1418 && w == XWINDOW (f->tool_bar_window))
1491 y -= width; 1419 y -= width;
1492 1420
1493 BLOCK_INPUT; 1421 BLOCK_INPUT;
1494
1495 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), 1422 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
1496 0, y, width, height, 0); 1423 0, y, width, height, 0);
1497 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), 1424 XClearArea (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f),
1498 FRAME_PIXEL_WIDTH (f) - width, y, 1425 FRAME_PIXEL_WIDTH (f) - width, y,
1499 width, height, 0); 1426 width, height, 0);
1500
1501 UNBLOCK_INPUT; 1427 UNBLOCK_INPUT;
1502 } 1428 }
1503} 1429}
@@ -1583,6 +1509,7 @@ x_draw_fringe_bitmap (w, row, p)
1583} 1509}
1584 1510
1585 1511
1512
1586/* This is called when starting Emacs and when restarting after 1513/* This is called when starting Emacs and when restarting after
1587 suspend. When starting Emacs, no window is mapped. And nothing 1514 suspend. When starting Emacs, no window is mapped. And nothing
1588 must be done to Emacs's own window if it is suspended (though that 1515 must be done to Emacs's own window if it is suspended (though that
@@ -1601,6 +1528,7 @@ XTreset_terminal_modes ()
1601{ 1528{
1602} 1529}
1603 1530
1531
1604 1532
1605/*********************************************************************** 1533/***********************************************************************
1606 Display Iterator 1534 Display Iterator
@@ -1791,6 +1719,7 @@ mac_encode_char (c, char2b, font_info, charset, two_byte_p)
1791 ***********************************************************************/ 1719 ***********************************************************************/
1792 1720
1793 1721
1722
1794static void x_set_glyph_string_clipping P_ ((struct glyph_string *)); 1723static void x_set_glyph_string_clipping P_ ((struct glyph_string *));
1795static void x_set_glyph_string_gc P_ ((struct glyph_string *)); 1724static void x_set_glyph_string_gc P_ ((struct glyph_string *));
1796static void x_draw_glyph_string_background P_ ((struct glyph_string *, 1725static void x_draw_glyph_string_background P_ ((struct glyph_string *,
@@ -1799,6 +1728,7 @@ static void x_draw_glyph_string_foreground P_ ((struct glyph_string *));
1799static void x_draw_composite_glyph_string_foreground P_ ((struct glyph_string *)); 1728static void x_draw_composite_glyph_string_foreground P_ ((struct glyph_string *));
1800static void x_draw_glyph_string_box P_ ((struct glyph_string *)); 1729static void x_draw_glyph_string_box P_ ((struct glyph_string *));
1801static void x_draw_glyph_string P_ ((struct glyph_string *)); 1730static void x_draw_glyph_string P_ ((struct glyph_string *));
1731static void mac_compute_glyph_string_overhangs P_ ((struct glyph_string *));
1802static void x_set_cursor_gc P_ ((struct glyph_string *)); 1732static void x_set_cursor_gc P_ ((struct glyph_string *));
1803static void x_set_mode_line_face_gc P_ ((struct glyph_string *)); 1733static void x_set_mode_line_face_gc P_ ((struct glyph_string *));
1804static void x_set_mouse_face_gc P_ ((struct glyph_string *)); 1734static void x_set_mouse_face_gc P_ ((struct glyph_string *));
@@ -3402,7 +3332,6 @@ XTring_bell ()
3402 } 3332 }
3403} 3333}
3404 3334
3405
3406 3335
3407/* Specify how many text lines, from the top of the window, 3336/* Specify how many text lines, from the top of the window,
3408 should be affected by insert-lines and delete-lines operations. 3337 should be affected by insert-lines and delete-lines operations.
@@ -3837,43 +3766,6 @@ x_get_keysym_name (keysym)
3837 3766
3838 3767
3839 3768
3840#if 0
3841/* Mouse clicks and mouse movement. Rah. */
3842
3843/* Prepare a mouse-event in *RESULT for placement in the input queue.
3844
3845 If the event is a button press, then note that we have grabbed
3846 the mouse. */
3847
3848static Lisp_Object
3849construct_mouse_click (result, event, f)
3850 struct input_event *result;
3851 EventRecord *event;
3852 struct frame *f;
3853{
3854 Point mouseLoc;
3855
3856 result->kind = MOUSE_CLICK_EVENT;
3857 result->code = 0; /* only one mouse button */
3858 result->timestamp = event->when;
3859 result->modifiers = event->what == mouseDown ? down_modifier : up_modifier;
3860
3861 mouseLoc = event->where;
3862
3863 SetPortWindowPort (FRAME_MAC_WINDOW (f));
3864
3865 GlobalToLocal (&mouseLoc);
3866 XSETINT (result->x, mouseLoc.h);
3867 XSETINT (result->y, mouseLoc.v);
3868
3869 XSETFRAME (result->frame_or_window, f);
3870
3871 result->arg = Qnil;
3872 return Qnil;
3873}
3874#endif
3875
3876
3877/* Function to report a mouse movement to the mainstream Emacs code. 3769/* Function to report a mouse movement to the mainstream Emacs code.
3878 The input handler calls this. 3770 The input handler calls this.
3879 3771
@@ -3929,18 +3821,11 @@ note_mouse_movement (frame, pos)
3929 } 3821 }
3930} 3822}
3931 3823
3932/* This is used for debugging, to turn off note_mouse_highlight. */
3933
3934int disable_mouse_highlight;
3935
3936
3937 3824
3938/************************************************************************ 3825/************************************************************************
3939 Mouse Face 3826 Mouse Face
3940 ************************************************************************/ 3827 ************************************************************************/
3941 3828
3942static struct scroll_bar *x_window_to_scroll_bar ();
3943static void x_scroll_bar_report_motion ();
3944static int glyph_rect P_ ((struct frame *f, int, int, Rect *)); 3829static int glyph_rect P_ ((struct frame *f, int, int, Rect *));
3945 3830
3946 3831
@@ -4152,20 +4037,16 @@ static OSStatus install_scroll_bar_timer P_ ((void));
4152static OSStatus set_scroll_bar_timer P_ ((EventTimerInterval)); 4037static OSStatus set_scroll_bar_timer P_ ((EventTimerInterval));
4153static int control_part_code_to_scroll_bar_part P_ ((ControlPartCode)); 4038static int control_part_code_to_scroll_bar_part P_ ((ControlPartCode));
4154static void construct_scroll_bar_click P_ ((struct scroll_bar *, int, 4039static void construct_scroll_bar_click P_ ((struct scroll_bar *, int,
4155 unsigned long,
4156 struct input_event *)); 4040 struct input_event *));
4157static OSErr get_control_part_bounds P_ ((ControlHandle, ControlPartCode, 4041static OSErr get_control_part_bounds P_ ((ControlHandle, ControlPartCode,
4158 Rect *)); 4042 Rect *));
4159static void x_scroll_bar_handle_press P_ ((struct scroll_bar *, 4043static void x_scroll_bar_handle_press P_ ((struct scroll_bar *,
4160 ControlPartCode, 4044 ControlPartCode,
4161 unsigned long,
4162 struct input_event *)); 4045 struct input_event *));
4163static void x_scroll_bar_handle_release P_ ((struct scroll_bar *, 4046static void x_scroll_bar_handle_release P_ ((struct scroll_bar *,
4164 unsigned long,
4165 struct input_event *)); 4047 struct input_event *));
4166static void x_scroll_bar_handle_drag P_ ((WindowPtr, struct scroll_bar *, 4048static void x_scroll_bar_handle_drag P_ ((WindowPtr, struct scroll_bar *,
4167 Point, unsigned long, 4049 Point, struct input_event *));
4168 struct input_event *));
4169static void x_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *, 4050static void x_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *,
4170 int, int, int)); 4051 int, int, int));
4171 4052
@@ -4264,10 +4145,9 @@ control_part_code_to_scroll_bar_part (part_code)
4264} 4145}
4265 4146
4266static void 4147static void
4267construct_scroll_bar_click (bar, part, timestamp, bufp) 4148construct_scroll_bar_click (bar, part, bufp)
4268 struct scroll_bar *bar; 4149 struct scroll_bar *bar;
4269 int part; 4150 int part;
4270 unsigned long timestamp;
4271 struct input_event *bufp; 4151 struct input_event *bufp;
4272{ 4152{
4273 bufp->kind = SCROLL_BAR_CLICK_EVENT; 4153 bufp->kind = SCROLL_BAR_CLICK_EVENT;
@@ -4275,7 +4155,6 @@ construct_scroll_bar_click (bar, part, timestamp, bufp)
4275 bufp->arg = Qnil; 4155 bufp->arg = Qnil;
4276 bufp->part = part; 4156 bufp->part = part;
4277 bufp->code = 0; 4157 bufp->code = 0;
4278 bufp->timestamp = timestamp;
4279 XSETINT (bufp->x, 0); 4158 XSETINT (bufp->x, 0);
4280 XSETINT (bufp->y, 0); 4159 XSETINT (bufp->y, 0);
4281 bufp->modifiers = 0; 4160 bufp->modifiers = 0;
@@ -4299,10 +4178,9 @@ get_control_part_bounds (ch, part_code, rect)
4299} 4178}
4300 4179
4301static void 4180static void
4302x_scroll_bar_handle_press (bar, part_code, timestamp, bufp) 4181x_scroll_bar_handle_press (bar, part_code, bufp)
4303 struct scroll_bar *bar; 4182 struct scroll_bar *bar;
4304 ControlPartCode part_code; 4183 ControlPartCode part_code;
4305 unsigned long timestamp;
4306 struct input_event *bufp; 4184 struct input_event *bufp;
4307{ 4185{
4308 int part = control_part_code_to_scroll_bar_part (part_code); 4186 int part = control_part_code_to_scroll_bar_part (part_code);
@@ -4312,7 +4190,7 @@ x_scroll_bar_handle_press (bar, part_code, timestamp, bufp)
4312 4190
4313 if (part != scroll_bar_handle) 4191 if (part != scroll_bar_handle)
4314 { 4192 {
4315 construct_scroll_bar_click (bar, part, timestamp, bufp); 4193 construct_scroll_bar_click (bar, part, bufp);
4316 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code); 4194 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code);
4317 set_scroll_bar_timer (SCROLL_BAR_FIRST_DELAY); 4195 set_scroll_bar_timer (SCROLL_BAR_FIRST_DELAY);
4318 } 4196 }
@@ -4323,14 +4201,13 @@ x_scroll_bar_handle_press (bar, part_code, timestamp, bufp)
4323} 4201}
4324 4202
4325static void 4203static void
4326x_scroll_bar_handle_release (bar, timestamp, bufp) 4204x_scroll_bar_handle_release (bar, bufp)
4327 struct scroll_bar *bar; 4205 struct scroll_bar *bar;
4328 unsigned long timestamp;
4329 struct input_event *bufp; 4206 struct input_event *bufp;
4330{ 4207{
4331 if (last_scroll_bar_part != scroll_bar_handle 4208 if (last_scroll_bar_part != scroll_bar_handle
4332 || !GC_NILP (bar->dragging)) 4209 || !GC_NILP (bar->dragging))
4333 construct_scroll_bar_click (bar, scroll_bar_end_scroll, timestamp, bufp); 4210 construct_scroll_bar_click (bar, scroll_bar_end_scroll, bufp);
4334 4211
4335 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), 0); 4212 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), 0);
4336 set_scroll_bar_timer (kEventDurationForever); 4213 set_scroll_bar_timer (kEventDurationForever);
@@ -4341,11 +4218,10 @@ x_scroll_bar_handle_release (bar, timestamp, bufp)
4341} 4218}
4342 4219
4343static void 4220static void
4344x_scroll_bar_handle_drag (win, bar, mouse_pos, timestamp, bufp) 4221x_scroll_bar_handle_drag (win, bar, mouse_pos, bufp)
4345 WindowPtr win; 4222 WindowPtr win;
4346 struct scroll_bar *bar; 4223 struct scroll_bar *bar;
4347 Point mouse_pos; 4224 Point mouse_pos;
4348 unsigned long timestamp;
4349 struct input_event *bufp; 4225 struct input_event *bufp;
4350{ 4226{
4351 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); 4227 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
@@ -4365,13 +4241,13 @@ x_scroll_bar_handle_drag (win, bar, mouse_pos, timestamp, bufp)
4365 top_range = (XINT (bar->track_height) - (r.bottom - r.top)) * 4241 top_range = (XINT (bar->track_height) - (r.bottom - r.top)) *
4366 (1.0 + (float) GetControlViewSize (ch) / GetControl32BitMaximum (ch)) 4242 (1.0 + (float) GetControlViewSize (ch) / GetControl32BitMaximum (ch))
4367 + .5; 4243 + .5;
4368 4244
4369 if (top < 0) 4245 if (top < 0)
4370 top = 0; 4246 top = 0;
4371 if (top > top_range) 4247 if (top > top_range)
4372 top = top_range; 4248 top = top_range;
4373 4249
4374 construct_scroll_bar_click (bar, scroll_bar_handle, timestamp, bufp); 4250 construct_scroll_bar_click (bar, scroll_bar_handle, bufp);
4375 XSETINT (bufp->x, top); 4251 XSETINT (bufp->x, top);
4376 XSETINT (bufp->y, top_range); 4252 XSETINT (bufp->y, top_range);
4377 } 4253 }
@@ -4409,7 +4285,7 @@ x_scroll_bar_handle_drag (win, bar, mouse_pos, timestamp, bufp)
4409 else if (part != last_scroll_bar_part 4285 else if (part != last_scroll_bar_part
4410 || scroll_bar_timer_event_posted_p) 4286 || scroll_bar_timer_event_posted_p)
4411 { 4287 {
4412 construct_scroll_bar_click (bar, part, timestamp, bufp); 4288 construct_scroll_bar_click (bar, part, bufp);
4413 last_scroll_bar_part = part; 4289 last_scroll_bar_part = part;
4414 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code); 4290 HiliteControl (SCROLL_BAR_CONTROL_HANDLE (bar), part_code);
4415 set_scroll_bar_timer (SCROLL_BAR_CONTINUOUS_DELAY); 4291 set_scroll_bar_timer (SCROLL_BAR_CONTINUOUS_DELAY);
@@ -4480,11 +4356,11 @@ x_scroll_bar_create (w, top, left, width, height, disp_top, disp_height)
4480 r.bottom = disp_top + disp_height; 4356 r.bottom = disp_top + disp_height;
4481 4357
4482#if TARGET_API_MAC_CARBON 4358#if TARGET_API_MAC_CARBON
4483 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", 1, 0, 0, 0, 4359 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height,
4484 kControlScrollBarProc, (long) bar); 4360 0, 0, 0, kControlScrollBarProc, (long) bar);
4485#else 4361#else
4486 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", 1, 0, 0, 0, 4362 ch = NewControl (FRAME_MAC_WINDOW (f), &r, "\p", width < disp_height,
4487 scrollBarProc, (long) bar); 4363 0, 0, 0, scrollBarProc, (long) bar);
4488#endif 4364#endif
4489 SET_SCROLL_BAR_CONTROL_HANDLE (bar, ch); 4365 SET_SCROLL_BAR_CONTROL_HANDLE (bar, ch);
4490 4366
@@ -4609,10 +4485,12 @@ x_scroll_bar_remove (bar)
4609 UNBLOCK_INPUT; 4485 UNBLOCK_INPUT;
4610} 4486}
4611 4487
4488
4612/* Set the handle of the vertical scroll bar for WINDOW to indicate 4489/* Set the handle of the vertical scroll bar for WINDOW to indicate
4613 that we are displaying PORTION characters out of a total of WHOLE 4490 that we are displaying PORTION characters out of a total of WHOLE
4614 characters, starting at POSITION. If WINDOW has no scroll bar, 4491 characters, starting at POSITION. If WINDOW has no scroll bar,
4615 create one. */ 4492 create one. */
4493
4616static void 4494static void
4617XTset_vertical_scroll_bar (w, portion, whole, position) 4495XTset_vertical_scroll_bar (w, portion, whole, position)
4618 struct window *w; 4496 struct window *w;
@@ -4707,7 +4585,8 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
4707 MoveControl (ch, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, disp_top); 4585 MoveControl (ch, sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM, disp_top);
4708 SizeControl (ch, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2, 4586 SizeControl (ch, sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
4709 disp_height); 4587 disp_height);
4710 ShowControl (ch); 4588 if (sb_width < disp_height)
4589 ShowControl (ch);
4711 4590
4712 /* Remember new settings. */ 4591 /* Remember new settings. */
4713 XSETINT (bar->left, sb_left); 4592 XSETINT (bar->left, sb_left);
@@ -4810,6 +4689,7 @@ XTredeem_scroll_bar (window)
4810 struct window *window; 4689 struct window *window;
4811{ 4690{
4812 struct scroll_bar *bar; 4691 struct scroll_bar *bar;
4692 struct frame *f;
4813 4693
4814 /* We can't redeem this window's scroll bar if it doesn't have one. */ 4694 /* We can't redeem this window's scroll bar if it doesn't have one. */
4815 if (NILP (window->vertical_scroll_bar)) 4695 if (NILP (window->vertical_scroll_bar))
@@ -4818,36 +4698,33 @@ XTredeem_scroll_bar (window)
4818 bar = XSCROLL_BAR (window->vertical_scroll_bar); 4698 bar = XSCROLL_BAR (window->vertical_scroll_bar);
4819 4699
4820 /* Unlink it from the condemned list. */ 4700 /* Unlink it from the condemned list. */
4821 { 4701 f = XFRAME (WINDOW_FRAME (window));
4822 FRAME_PTR f = XFRAME (WINDOW_FRAME (window)); 4702 if (NILP (bar->prev))
4823 4703 {
4824 if (NILP (bar->prev)) 4704 /* If the prev pointer is nil, it must be the first in one of
4825 { 4705 the lists. */
4826 /* If the prev pointer is nil, it must be the first in one of 4706 if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar))
4827 the lists. */ 4707 /* It's not condemned. Everything's fine. */
4828 if (EQ (FRAME_SCROLL_BARS (f), window->vertical_scroll_bar)) 4708 return;
4829 /* It's not condemned. Everything's fine. */ 4709 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
4830 return; 4710 window->vertical_scroll_bar))
4831 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), 4711 FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next;
4832 window->vertical_scroll_bar)) 4712 else
4833 FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next; 4713 /* If its prev pointer is nil, it must be at the front of
4834 else 4714 one or the other! */
4835 /* If its prev pointer is nil, it must be at the front of 4715 abort ();
4836 one or the other! */ 4716 }
4837 abort (); 4717 else
4838 } 4718 XSCROLL_BAR (bar->prev)->next = bar->next;
4839 else
4840 XSCROLL_BAR (bar->prev)->next = bar->next;
4841 4719
4842 if (! NILP (bar->next)) 4720 if (! NILP (bar->next))
4843 XSCROLL_BAR (bar->next)->prev = bar->prev; 4721 XSCROLL_BAR (bar->next)->prev = bar->prev;
4844 4722
4845 bar->next = FRAME_SCROLL_BARS (f); 4723 bar->next = FRAME_SCROLL_BARS (f);
4846 bar->prev = Qnil; 4724 bar->prev = Qnil;
4847 XSETVECTOR (FRAME_SCROLL_BARS (f), bar); 4725 XSETVECTOR (FRAME_SCROLL_BARS (f), bar);
4848 if (! NILP (bar->next)) 4726 if (! NILP (bar->next))
4849 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); 4727 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar);
4850 }
4851} 4728}
4852 4729
4853/* Remove all scroll bars on FRAME that haven't been saved since the 4730/* Remove all scroll bars on FRAME that haven't been saved since the
@@ -4986,8 +4863,8 @@ x_scroll_bar_note_movement (bar, y_pos, t)
4986 4863
4987#endif /* !USE_TOOLKIT_SCROLL_BARS */ 4864#endif /* !USE_TOOLKIT_SCROLL_BARS */
4988 4865
4989/* Return information to the user about the current position of the 4866/* Return information to the user about the current position of the mouse
4990 mouse on the scroll bar. */ 4867 on the scroll bar. */
4991 4868
4992static void 4869static void
4993x_scroll_bar_report_motion (fp, bar_window, part, x, y, time) 4870x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
@@ -5516,6 +5393,7 @@ mac_get_window_bounds (f, inner, outer)
5516} 5393}
5517 5394
5518 5395
5396
5519/* Calculate the absolute position in frame F 5397/* Calculate the absolute position in frame F
5520 from its current recorded position values and gravity. */ 5398 from its current recorded position values and gravity. */
5521 5399
@@ -5747,7 +5625,6 @@ x_set_mouse_pixel_position (f, pix_x, pix_y)
5747 UNBLOCK_INPUT; 5625 UNBLOCK_INPUT;
5748#endif 5626#endif
5749} 5627}
5750
5751 5628
5752/* focus shifting, raising and lowering. */ 5629/* focus shifting, raising and lowering. */
5753 5630
@@ -5774,6 +5651,7 @@ x_unfocus_frame (f)
5774} 5651}
5775 5652
5776/* Raise frame F. */ 5653/* Raise frame F. */
5654
5777void 5655void
5778x_raise_frame (f) 5656x_raise_frame (f)
5779 struct frame *f; 5657 struct frame *f;
@@ -5787,6 +5665,7 @@ x_raise_frame (f)
5787} 5665}
5788 5666
5789/* Lower frame F. */ 5667/* Lower frame F. */
5668
5790void 5669void
5791x_lower_frame (f) 5670x_lower_frame (f)
5792 struct frame *f; 5671 struct frame *f;
@@ -6195,9 +6074,9 @@ x_get_font_info (f, font_idx)
6195} 6074}
6196 6075
6197/* the global font name table */ 6076/* the global font name table */
6198char **font_name_table = NULL; 6077static char **font_name_table = NULL;
6199int font_name_table_size = 0; 6078static int font_name_table_size = 0;
6200int font_name_count = 0; 6079static int font_name_count = 0;
6201 6080
6202/* Alist linking character set strings to Mac text encoding and Emacs 6081/* Alist linking character set strings to Mac text encoding and Emacs
6203 coding system. */ 6082 coding system. */
@@ -7460,22 +7339,6 @@ x_find_ccl_program (fontp)
7460#define MIN_DOC_SIZE 64 7339#define MIN_DOC_SIZE 64
7461#define MAX_DOC_SIZE 32767 7340#define MAX_DOC_SIZE 32767
7462 7341
7463#if 0
7464/* sleep time for WaitNextEvent */
7465#define WNE_SLEEP_AT_SUSPEND 10
7466#define WNE_SLEEP_AT_RESUME 1
7467
7468/* the flag appl_is_suspended is used both for determining the sleep
7469 time to be passed to WaitNextEvent and whether the cursor should be
7470 drawn when updating the display. The cursor is turned off when
7471 Emacs is suspended. Redrawing it is unnecessary and what needs to
7472 be done depends on whether the cursor lies inside or outside the
7473 redraw region. So we might as well skip drawing it when Emacs is
7474 suspended. */
7475static Boolean app_is_suspended = false;
7476static long app_sleep_time = WNE_SLEEP_AT_RESUME;
7477#endif
7478
7479#define EXTRA_STACK_ALLOC (256 * 1024) 7342#define EXTRA_STACK_ALLOC (256 * 1024)
7480 7343
7481#define ARGV_STRING_LIST_ID 129 7344#define ARGV_STRING_LIST_ID 129
@@ -7512,8 +7375,8 @@ Lisp_Object Vmac_pass_command_to_system;
7512Lisp_Object Vmac_pass_control_to_system; 7375Lisp_Object Vmac_pass_control_to_system;
7513 7376
7514/* Points to the variable `inev' in the function XTread_socket. It is 7377/* Points to the variable `inev' in the function XTread_socket. It is
7515 used for passing an input event to the function back from a Carbon 7378 used for passing an input event to the function back from
7516 event handler. */ 7379 Carbon/Apple event handlers. */
7517static struct input_event *read_socket_inev = NULL; 7380static struct input_event *read_socket_inev = NULL;
7518#endif 7381#endif
7519 7382
@@ -7521,8 +7384,6 @@ static struct input_event *read_socket_inev = NULL;
7521 drag and drop events. */ 7384 drag and drop events. */
7522Lisp_Object Qmac_ready_for_drag_n_drop; 7385Lisp_Object Qmac_ready_for_drag_n_drop;
7523 7386
7524Lisp_Object drag_and_drop_file_list;
7525
7526Point saved_menu_event_location; 7387Point saved_menu_event_location;
7527 7388
7528/* Apple Events */ 7389/* Apple Events */
@@ -7858,20 +7719,12 @@ static void
7858do_app_resume () 7719do_app_resume ()
7859{ 7720{
7860 /* Window-activate events will do the job. */ 7721 /* Window-activate events will do the job. */
7861#if 0
7862 app_is_suspended = false;
7863 app_sleep_time = WNE_SLEEP_AT_RESUME;
7864#endif
7865} 7722}
7866 7723
7867static void 7724static void
7868do_app_suspend () 7725do_app_suspend ()
7869{ 7726{
7870 /* Window-deactivate events will do the job. */ 7727 /* Window-deactivate events will do the job. */
7871#if 0
7872 app_is_suspended = true;
7873 app_sleep_time = WNE_SLEEP_AT_SUSPEND;
7874#endif
7875} 7728}
7876 7729
7877 7730
@@ -8425,8 +8278,6 @@ mac_handle_mouse_event (next_handler, event, data)
8425 XSETINT (read_socket_inev->x, point.h); 8278 XSETINT (read_socket_inev->x, point.h);
8426 XSETINT (read_socket_inev->y, point.v); 8279 XSETINT (read_socket_inev->y, point.v);
8427 XSETFRAME (read_socket_inev->frame_or_window, f); 8280 XSETFRAME (read_socket_inev->frame_or_window, f);
8428 read_socket_inev->timestamp =
8429 EventTimeToTicks (GetEventTime (event)) * (1000/60);
8430 8281
8431 return noErr; 8282 return noErr;
8432 } 8283 }
@@ -8500,11 +8351,6 @@ do_ae_open_application(const AppleEvent *pae, AppleEvent *preply, long prefcon)
8500} 8351}
8501 8352
8502 8353
8503/* Defined in mac.c. */
8504extern int
8505path_from_vol_dir_name (char *, int, short, long, char *);
8506
8507
8508/* Called when we receive an AppleEvent with an ID of 8354/* Called when we receive an AppleEvent with an ID of
8509 "kAEOpenDocuments". This routine gets the direct parameter, 8355 "kAEOpenDocuments". This routine gets the direct parameter,
8510 extracts the FSSpecs in it, and puts their names on a list. */ 8356 extracts the FSSpecs in it, and puts their names on a list. */
@@ -8528,6 +8374,9 @@ do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon)
8528 DescType actual_type; 8374 DescType actual_type;
8529 Size actual_size; 8375 Size actual_size;
8530 SelectionRange position; 8376 SelectionRange position;
8377 Lisp_Object file_list = Qnil;
8378
8379 xassert (read_socket_inev);
8531 8380
8532 err = AEGetParamDesc (message, keyDirectObject, typeAEList, &the_desc); 8381 err = AEGetParamDesc (message, keyDirectObject, typeAEList, &the_desc);
8533 if (err != noErr) 8382 if (err != noErr)
@@ -8535,10 +8384,10 @@ do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon)
8535 8384
8536 err = AEGetParamPtr (message, keyAEPosition, typeChar, &actual_type, &position, sizeof(SelectionRange), &actual_size); 8385 err = AEGetParamPtr (message, keyAEPosition, typeChar, &actual_type, &position, sizeof(SelectionRange), &actual_size);
8537 if (err == noErr) 8386 if (err == noErr)
8538 drag_and_drop_file_list = Fcons (list3 (make_number (position.lineNum + 1), 8387 file_list = Fcons (list3 (make_number (position.lineNum + 1),
8539 make_number (position.startRange + 1), 8388 make_number (position.startRange + 1),
8540 make_number (position.endRange + 1)), 8389 make_number (position.endRange + 1)),
8541 drag_and_drop_file_list); 8390 file_list);
8542 8391
8543 /* Check to see that we got all of the required parameters from the 8392 /* Check to see that we got all of the required parameters from the
8544 event descriptor. For an 'odoc' event this should just be the 8393 event descriptor. For an 'odoc' event this should just be the
@@ -8592,12 +8441,49 @@ do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon)
8592 sizeof (unix_path_name) - 1) == noErr) 8441 sizeof (unix_path_name) - 1) == noErr)
8593#endif 8442#endif
8594 /* x-dnd functions expect undecoded filenames. */ 8443 /* x-dnd functions expect undecoded filenames. */
8595 drag_and_drop_file_list = 8444 file_list = Fcons (make_unibyte_string (unix_path_name,
8596 Fcons (make_unibyte_string (unix_path_name, 8445 strlen (unix_path_name)),
8597 strlen (unix_path_name)), 8446 file_list);
8598 drag_and_drop_file_list);
8599 } 8447 }
8600 } 8448 }
8449
8450 /* Build a DRAG_N_DROP_EVENT type event as is done in
8451 constuct_drag_n_drop in w32term.c. */
8452 if (!NILP (file_list))
8453 {
8454 struct frame *f = mac_focus_frame (&one_mac_display_info);
8455 WindowPtr wp;
8456 Lisp_Object frame;
8457
8458 read_socket_inev->kind = DRAG_N_DROP_EVENT;
8459 read_socket_inev->code = 0;
8460 read_socket_inev->modifiers = 0;
8461
8462 XSETINT (read_socket_inev->x, 0);
8463 XSETINT (read_socket_inev->y, 0);
8464
8465 XSETFRAME (frame, f);
8466 read_socket_inev->frame_or_window = Fcons (frame, file_list);
8467
8468#if 0
8469 /* Regardless of whether Emacs was suspended or in the
8470 foreground, ask it to redraw its entire screen. Otherwise
8471 parts of the screen can be left in an inconsistent
8472 state. */
8473 wp = FRAME_MAC_WINDOW (f);
8474 if (wp)
8475#if TARGET_API_MAC_CARBON
8476 {
8477 Rect r;
8478
8479 GetWindowPortBounds (wp, &r);
8480 InvalWindowRect (wp, &r);
8481 }
8482#else /* not TARGET_API_MAC_CARBON */
8483 InvalRect (&(wp->portRect));
8484#endif /* not TARGET_API_MAC_CARBON */
8485#endif
8486 }
8601 } 8487 }
8602 8488
8603error_exit: 8489error_exit:
@@ -8690,11 +8576,12 @@ mac_do_receive_drag (WindowPtr window, void *handlerRefCon,
8690 ItemReference theItem; 8576 ItemReference theItem;
8691 HFSFlavor data; 8577 HFSFlavor data;
8692 Size size = sizeof (HFSFlavor); 8578 Size size = sizeof (HFSFlavor);
8579 Lisp_Object file_list;
8693 8580
8694 if (GetFrontWindowOfClass (kMovableModalWindowClass, false)) 8581 if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
8695 return dragNotAcceptedErr; 8582 return dragNotAcceptedErr;
8696 8583
8697 drag_and_drop_file_list = Qnil; 8584 file_list = Qnil;
8698 GetDragMouse (theDrag, &mouse, 0L); 8585 GetDragMouse (theDrag, &mouse, 0L);
8699 CountDragItems (theDrag, &items); 8586 CountDragItems (theDrag, &items);
8700 for (index = 1; index <= items; index++) 8587 for (index = 1; index <= items; index++)
@@ -8720,15 +8607,14 @@ mac_do_receive_drag (WindowPtr window, void *handlerRefCon,
8720 sizeof (unix_path_name) - 1) == noErr) 8607 sizeof (unix_path_name) - 1) == noErr)
8721#endif 8608#endif
8722 /* x-dnd functions expect undecoded filenames. */ 8609 /* x-dnd functions expect undecoded filenames. */
8723 drag_and_drop_file_list = 8610 file_list = Fcons (make_unibyte_string (unix_path_name,
8724 Fcons (make_unibyte_string (unix_path_name, 8611 strlen (unix_path_name)),
8725 strlen (unix_path_name)), 8612 file_list);
8726 drag_and_drop_file_list);
8727 } 8613 }
8728 } 8614 }
8729 /* If there are items in the list, construct an event and post it to 8615 /* If there are items in the list, construct an event and post it to
8730 the queue like an interrupt using kbd_buffer_store_event. */ 8616 the queue like an interrupt using kbd_buffer_store_event. */
8731 if (!NILP (drag_and_drop_file_list)) 8617 if (!NILP (file_list))
8732 { 8618 {
8733 struct input_event event; 8619 struct input_event event;
8734 Lisp_Object frame; 8620 Lisp_Object frame;
@@ -8745,7 +8631,7 @@ mac_do_receive_drag (WindowPtr window, void *handlerRefCon,
8745 XSETINT (event.x, mouse.h); 8631 XSETINT (event.x, mouse.h);
8746 XSETINT (event.y, mouse.v); 8632 XSETINT (event.y, mouse.v);
8747 XSETFRAME (frame, f); 8633 XSETFRAME (frame, f);
8748 event.frame_or_window = Fcons (frame, drag_and_drop_file_list); 8634 event.frame_or_window = Fcons (frame, file_list);
8749 event.arg = Qnil; 8635 event.arg = Qnil;
8750 /* Post to the interrupt queue */ 8636 /* Post to the interrupt queue */
8751 kbd_buffer_store_event (&event); 8637 kbd_buffer_store_event (&event);
@@ -9004,6 +8890,7 @@ XTread_socket (sd, expected, hold_quit)
9004 { 8890 {
9005 int do_help = 0; 8891 int do_help = 0;
9006 struct frame *f; 8892 struct frame *f;
8893 unsigned long timestamp;
9007 8894
9008 /* It is necessary to set this (additional) argument slot of an 8895 /* It is necessary to set this (additional) argument slot of an
9009 event to nil because keyboard.c protects incompletely 8896 event to nil because keyboard.c protects incompletely
@@ -9014,6 +8901,12 @@ XTread_socket (sd, expected, hold_quit)
9014 inev.arg = Qnil; 8901 inev.arg = Qnil;
9015 8902
9016#if USE_CARBON_EVENTS 8903#if USE_CARBON_EVENTS
8904 timestamp = GetEventTime (eventRef) / kEventDurationMillisecond;
8905#else
8906 timestamp = er.when * (1000 / 60); /* ticks to milliseconds */
8907#endif
8908
8909#if USE_CARBON_EVENTS
9017 /* Handle new events */ 8910 /* Handle new events */
9018 if (!mac_convert_event_ref (eventRef, &er)) 8911 if (!mac_convert_event_ref (eventRef, &er))
9019 { 8912 {
@@ -9114,8 +9007,6 @@ XTread_socket (sd, expected, hold_quit)
9114#endif 9007#endif
9115 XSETINT (inev.x, mouse_loc.h); 9008 XSETINT (inev.x, mouse_loc.h);
9116 XSETINT (inev.y, mouse_loc.v); 9009 XSETINT (inev.y, mouse_loc.v);
9117 inev.timestamp = er.when * (1000 / 60);
9118 /* ticks to milliseconds */
9119 9010
9120 if (dpyinfo->grabbed && tracked_scroll_bar 9011 if (dpyinfo->grabbed && tracked_scroll_bar
9121 || ch != 0 9012 || ch != 0
@@ -9149,10 +9040,9 @@ XTread_socket (sd, expected, hold_quit)
9149 &er, &inev); 9040 &er, &inev);
9150 else if (er.what == mouseDown) 9041 else if (er.what == mouseDown)
9151 x_scroll_bar_handle_press (bar, control_part_code, 9042 x_scroll_bar_handle_press (bar, control_part_code,
9152 inev.timestamp, &inev); 9043 &inev);
9153 else 9044 else
9154 x_scroll_bar_handle_release (bar, inev.timestamp, 9045 x_scroll_bar_handle_release (bar, &inev);
9155 &inev);
9156#else /* not USE_TOOLKIT_SCROLL_BARS */ 9046#else /* not USE_TOOLKIT_SCROLL_BARS */
9157 x_scroll_bar_handle_click (bar, control_part_code, 9047 x_scroll_bar_handle_click (bar, control_part_code,
9158 &er, &inev); 9048 &er, &inev);
@@ -9326,8 +9216,7 @@ XTread_socket (sd, expected, hold_quit)
9326 if (dpyinfo->grabbed && tracked_scroll_bar) 9216 if (dpyinfo->grabbed && tracked_scroll_bar)
9327#ifdef USE_TOOLKIT_SCROLL_BARS 9217#ifdef USE_TOOLKIT_SCROLL_BARS
9328 x_scroll_bar_handle_drag (wp, tracked_scroll_bar, 9218 x_scroll_bar_handle_drag (wp, tracked_scroll_bar,
9329 mouse_pos, er.when * (1000 / 60), 9219 mouse_pos, &inev);
9330 &inev);
9331#else /* not USE_TOOLKIT_SCROLL_BARS */ 9220#else /* not USE_TOOLKIT_SCROLL_BARS */
9332 x_scroll_bar_note_movement (tracked_scroll_bar, 9221 x_scroll_bar_note_movement (tracked_scroll_bar,
9333 mouse_pos.v 9222 mouse_pos.v
@@ -9415,11 +9304,10 @@ XTread_socket (sd, expected, hold_quit)
9415 9304
9416 EVENT_INIT (event); 9305 EVENT_INIT (event);
9417 event.kind = NO_EVENT; 9306 event.kind = NO_EVENT;
9418 x_scroll_bar_handle_release (tracked_scroll_bar, 9307 x_scroll_bar_handle_release (tracked_scroll_bar, &event);
9419 er.when * (1000 / 60),
9420 &event);
9421 if (event.kind != NO_EVENT) 9308 if (event.kind != NO_EVENT)
9422 { 9309 {
9310 event.timestamp = timestamp;
9423 kbd_buffer_store_event_hold (&event, hold_quit); 9311 kbd_buffer_store_event_hold (&event, hold_quit);
9424 count++; 9312 count++;
9425 } 9313 }
@@ -9495,6 +9383,7 @@ XTread_socket (sd, expected, hold_quit)
9495 event.kind = LANGUAGE_CHANGE_EVENT; 9383 event.kind = LANGUAGE_CHANGE_EVENT;
9496 event.arg = Qnil; 9384 event.arg = Qnil;
9497 event.code = current_key_script; 9385 event.code = current_key_script;
9386 event.timestamp = timestamp;
9498 kbd_buffer_store_event (&event); 9387 kbd_buffer_store_event (&event);
9499 count++; 9388 count++;
9500 } 9389 }
@@ -9559,58 +9448,18 @@ XTread_socket (sd, expected, hold_quit)
9559#else 9448#else
9560 inev.modifiers = mac_to_emacs_modifiers (er.modifiers); 9449 inev.modifiers = mac_to_emacs_modifiers (er.modifiers);
9561#endif 9450#endif
9451 inev.modifiers |= (extra_keyboard_modifiers
9452 & (meta_modifier | alt_modifier
9453 | hyper_modifier | super_modifier));
9562 XSETFRAME (inev.frame_or_window, mac_focus_frame (dpyinfo)); 9454 XSETFRAME (inev.frame_or_window, mac_focus_frame (dpyinfo));
9563 inev.timestamp = er.when * (1000 / 60); /* ticks to milliseconds */
9564 break; 9455 break;
9565 9456
9566 case kHighLevelEvent: 9457 case kHighLevelEvent:
9567 drag_and_drop_file_list = Qnil; 9458 read_socket_inev = &inev;
9568 9459 AEProcessAppleEvent (&er);
9569 AEProcessAppleEvent(&er); 9460 read_socket_inev = NULL;
9570 9461 break;
9571 /* Build a DRAG_N_DROP_EVENT type event as is done in
9572 constuct_drag_n_drop in w32term.c. */
9573 if (!NILP (drag_and_drop_file_list))
9574 {
9575 struct frame *f = mac_focus_frame (dpyinfo);
9576 WindowPtr wp;
9577 Lisp_Object frame;
9578
9579 inev.kind = DRAG_N_DROP_EVENT;
9580 inev.code = 0;
9581 inev.timestamp = er.when * (1000 / 60);
9582 /* ticks to milliseconds */
9583#if USE_CARBON_EVENTS
9584 inev.modifiers = mac_event_to_emacs_modifiers (eventRef);
9585#else
9586 inev.modifiers = mac_to_emacs_modifiers (er.modifiers);
9587#endif
9588
9589 XSETINT (inev.x, 0);
9590 XSETINT (inev.y, 0);
9591
9592 XSETFRAME (frame, f);
9593 inev.frame_or_window = Fcons (frame, drag_and_drop_file_list);
9594
9595#if 0
9596 /* Regardless of whether Emacs was suspended or in the
9597 foreground, ask it to redraw its entire screen.
9598 Otherwise parts of the screen can be left in an
9599 inconsistent state. */
9600 wp = FRAME_MAC_WINDOW (f);
9601 if (wp)
9602#if TARGET_API_MAC_CARBON
9603 {
9604 Rect r;
9605 9462
9606 GetWindowPortBounds (wp, &r);
9607 InvalWindowRect (wp, &r);
9608 }
9609#else /* not TARGET_API_MAC_CARBON */
9610 InvalRect (&(wp->portRect));
9611#endif /* not TARGET_API_MAC_CARBON */
9612#endif
9613 }
9614 default: 9463 default:
9615 break; 9464 break;
9616 } 9465 }
@@ -9620,6 +9469,7 @@ XTread_socket (sd, expected, hold_quit)
9620 9469
9621 if (inev.kind != NO_EVENT) 9470 if (inev.kind != NO_EVENT)
9622 { 9471 {
9472 inev.timestamp = timestamp;
9623 kbd_buffer_store_event_hold (&inev, hold_quit); 9473 kbd_buffer_store_event_hold (&inev, hold_quit);
9624 count++; 9474 count++;
9625 } 9475 }
@@ -10092,7 +9942,7 @@ mac_check_for_quit_char ()
10092 kbd_buffer_store_event (&e); 9942 kbd_buffer_store_event (&e);
10093 } 9943 }
10094} 9944}
10095#endif /* MAC_OSX */ 9945#endif /* MAC_OSX */
10096 9946
10097static void 9947static void
10098init_menu_bar () 9948init_menu_bar ()
@@ -10195,7 +10045,6 @@ mac_initialize ()
10195 off the bottom */ 10045 off the bottom */
10196 baud_rate = 19200; 10046 baud_rate = 19200;
10197 10047
10198 x_noop_count = 0;
10199 last_tool_bar_item = -1; 10048 last_tool_bar_item = -1;
10200 any_help_event_p = 0; 10049 any_help_event_p = 0;
10201 10050
@@ -10267,12 +10116,6 @@ syms_of_macterm ()
10267 staticpro (&last_mouse_scroll_bar); 10116 staticpro (&last_mouse_scroll_bar);
10268 last_mouse_scroll_bar = Qnil; 10117 last_mouse_scroll_bar = Qnil;
10269 10118
10270 staticpro (&Qvendor_specific_keysyms);
10271 Qvendor_specific_keysyms = intern ("vendor-specific-keysyms");
10272
10273 staticpro (&last_mouse_press_frame);
10274 last_mouse_press_frame = Qnil;
10275
10276 Qmac_ready_for_drag_n_drop = intern ("mac-ready-for-drag-n-drop"); 10119 Qmac_ready_for_drag_n_drop = intern ("mac-ready-for-drag-n-drop");
10277 staticpro (&Qmac_ready_for_drag_n_drop); 10120 staticpro (&Qmac_ready_for_drag_n_drop);
10278 10121
@@ -10284,14 +10127,6 @@ syms_of_macterm ()
10284 Vx_toolkit_scroll_bars = Qnil; 10127 Vx_toolkit_scroll_bars = Qnil;
10285#endif 10128#endif
10286 10129
10287 DEFVAR_BOOL ("x-use-underline-position-properties",
10288 &x_use_underline_position_properties,
10289 doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties.
10290nil means ignore them. If you encounter fonts with bogus
10291UNDERLINE_POSITION font properties, for example 7x13 on XFree prior
10292to 4.1, set this to nil. */);
10293 x_use_underline_position_properties = 0;
10294
10295 staticpro (&last_mouse_motion_frame); 10130 staticpro (&last_mouse_motion_frame);
10296 last_mouse_motion_frame = Qnil; 10131 last_mouse_motion_frame = Qnil;
10297 10132
diff --git a/src/window.c b/src/window.c
index 941c0a00133..9ae9bbf55f4 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1472,7 +1472,7 @@ delete_window (window)
1472 1472
1473 /* Check if we have a v/hchild with a v/hchild. In that case remove 1473 /* Check if we have a v/hchild with a v/hchild. In that case remove
1474 one of them. */ 1474 one of them. */
1475 1475
1476 if (! NILP (par->vchild) && ! NILP (XWINDOW (par->vchild)->vchild)) 1476 if (! NILP (par->vchild) && ! NILP (XWINDOW (par->vchild)->vchild))
1477 { 1477 {
1478 p = XWINDOW (par->vchild); 1478 p = XWINDOW (par->vchild);
@@ -5357,6 +5357,7 @@ and redisplay normally--don't erase and redraw the frame. */)
5357 { 5357 {
5358 arg = Fprefix_numeric_value (arg); 5358 arg = Fprefix_numeric_value (arg);
5359 CHECK_NUMBER (arg); 5359 CHECK_NUMBER (arg);
5360 iarg = XINT (arg);
5360 } 5361 }
5361 5362
5362 set_buffer_internal (buf); 5363 set_buffer_internal (buf);
@@ -5391,7 +5392,6 @@ and redisplay normally--don't erase and redraw the frame. */)
5391 int extra_line_spacing; 5392 int extra_line_spacing;
5392 int h = window_box_height (w); 5393 int h = window_box_height (w);
5393 5394
5394 iarg = XINT (arg);
5395 iarg = - max (-iarg, this_scroll_margin); 5395 iarg = - max (-iarg, this_scroll_margin);
5396 5396
5397 SET_TEXT_POS (pt, PT, PT_BYTE); 5397 SET_TEXT_POS (pt, PT, PT_BYTE);
@@ -5453,7 +5453,6 @@ and redisplay normally--don't erase and redraw the frame. */)
5453 { 5453 {
5454 struct position pos; 5454 struct position pos;
5455 5455
5456 iarg = XINT (arg);
5457 iarg = max (iarg, this_scroll_margin); 5456 iarg = max (iarg, this_scroll_margin);
5458 5457
5459 pos = *vmotion (PT, -iarg, w); 5458 pos = *vmotion (PT, -iarg, w);
@@ -5467,11 +5466,9 @@ and redisplay normally--don't erase and redraw the frame. */)
5467 int ht = window_internal_height (w); 5466 int ht = window_internal_height (w);
5468 5467
5469 if (center_p) 5468 if (center_p)
5470 iarg = make_number (ht / 2); 5469 iarg = ht / 2;
5471 else if (XINT (arg) < 0) 5470 else if (iarg < 0)
5472 iarg = XINT (arg) + ht; 5471 iarg += ht;
5473 else
5474 iarg = XINT (arg);
5475 5472
5476 /* Don't let it get into the margin at either top or bottom. */ 5473 /* Don't let it get into the margin at either top or bottom. */
5477 iarg = max (iarg, this_scroll_margin); 5474 iarg = max (iarg, this_scroll_margin);
diff --git a/src/xdisp.c b/src/xdisp.c
index 122481a5ff0..d1229b3cb9f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2411,7 +2411,9 @@ start_display (it, w, pos)
2411 init_iterator (it, w, CHARPOS (pos), BYTEPOS (pos), row, DEFAULT_FACE_ID); 2411 init_iterator (it, w, CHARPOS (pos), BYTEPOS (pos), row, DEFAULT_FACE_ID);
2412 it->first_vpos = first_vpos; 2412 it->first_vpos = first_vpos;
2413 2413
2414 if (!it->truncate_lines_p) 2414 /* Don't reseat to previous visible line start if current start
2415 position is in a string or image. */
2416 if (it->method == GET_FROM_BUFFER && !it->truncate_lines_p)
2415 { 2417 {
2416 int start_at_line_beg_p; 2418 int start_at_line_beg_p;
2417 int first_y = it->current_y; 2419 int first_y = it->current_y;
@@ -6483,8 +6485,12 @@ move_it_vertically_backward (it, dy)
6483 y-distance. */ 6485 y-distance. */
6484 it2 = *it; 6486 it2 = *it;
6485 it2.max_ascent = it2.max_descent = 0; 6487 it2.max_ascent = it2.max_descent = 0;
6486 move_it_to (&it2, start_pos, -1, -1, it2.vpos + 1, 6488 do
6487 MOVE_TO_POS | MOVE_TO_VPOS); 6489 {
6490 move_it_to (&it2, start_pos, -1, -1, it2.vpos + 1,
6491 MOVE_TO_POS | MOVE_TO_VPOS);
6492 }
6493 while (it2.method != GET_FROM_BUFFER);
6488 xassert (IT_CHARPOS (*it) >= BEGV); 6494 xassert (IT_CHARPOS (*it) >= BEGV);
6489 it3 = it2; 6495 it3 = it2;
6490 6496
@@ -6682,21 +6688,45 @@ move_it_by_lines (it, dvpos, need_y_p)
6682 last_height = 0; 6688 last_height = 0;
6683 } 6689 }
6684 else if (dvpos > 0) 6690 else if (dvpos > 0)
6685 move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS); 6691 {
6692 move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS);
6693 if (it->method != GET_FROM_BUFFER)
6694 move_it_to (it, IT_CHARPOS (*it) + 1, -1, -1, -1, MOVE_TO_POS);
6695 }
6686 else 6696 else
6687 { 6697 {
6688 struct it it2; 6698 struct it it2;
6689 int start_charpos, i; 6699 int start_charpos, i;
6690 6700
6691 /* Start at the beginning of the screen line containing IT's 6701 /* Start at the beginning of the screen line containing IT's
6692 position. */ 6702 position. This may actually move vertically backwards,
6703 in case of overlays, so adjust dvpos accordingly. */
6704 dvpos += it->vpos;
6693 move_it_vertically_backward (it, 0); 6705 move_it_vertically_backward (it, 0);
6706 dvpos -= it->vpos;
6694 6707
6695 /* Go back -DVPOS visible lines and reseat the iterator there. */ 6708 /* Go back -DVPOS visible lines and reseat the iterator there. */
6696 start_charpos = IT_CHARPOS (*it); 6709 start_charpos = IT_CHARPOS (*it);
6697 for (i = -dvpos; i && IT_CHARPOS (*it) > BEGV; --i) 6710 for (i = -dvpos; i > 0 && IT_CHARPOS (*it) > BEGV; --i)
6698 back_to_previous_visible_line_start (it); 6711 back_to_previous_visible_line_start (it);
6699 reseat (it, it->current.pos, 1); 6712 reseat (it, it->current.pos, 1);
6713
6714 /* Move further back if we end up in a string or an image. */
6715 while (it->method != GET_FROM_BUFFER)
6716 {
6717 /* First try to move to start of display line. */
6718 dvpos += it->vpos;
6719 move_it_vertically_backward (it, 0);
6720 dvpos -= it->vpos;
6721 if (it->method == GET_FROM_BUFFER)
6722 break;
6723 /* If start of line is still in string or image,
6724 move further back. */
6725 back_to_previous_visible_line_start (it);
6726 reseat (it, it->current.pos, 1);
6727 dvpos--;
6728 }
6729
6700 it->current_x = it->hpos = 0; 6730 it->current_x = it->hpos = 0;
6701 6731
6702 /* Above call may have moved too far if continuation lines 6732 /* Above call may have moved too far if continuation lines
@@ -11389,7 +11419,7 @@ cursor_row_fully_visible_p (w, force_p, current_matrix_p)
11389 window_height = window_box_height (w); 11419 window_height = window_box_height (w);
11390 if (row->height >= window_height) 11420 if (row->height >= window_height)
11391 { 11421 {
11392 if (!force_p || w->vscroll) 11422 if (!force_p || MINI_WINDOW_P (w) || w->vscroll)
11393 return 1; 11423 return 1;
11394 } 11424 }
11395 return 0; 11425 return 0;
@@ -11919,7 +11949,10 @@ try_cursor_movement (window, startp, scroll_step)
11919 while (!row->mode_line_p 11949 while (!row->mode_line_p
11920 && (MATRIX_ROW_START_CHARPOS (row) > PT 11950 && (MATRIX_ROW_START_CHARPOS (row) > PT
11921 || (MATRIX_ROW_START_CHARPOS (row) == PT 11951 || (MATRIX_ROW_START_CHARPOS (row) == PT
11922 && MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P (row))) 11952 && (MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P (row)
11953 || (/* STARTS_IN_MIDDLE_OF_STRING_P (row) */
11954 row > w->current_matrix->rows
11955 && (row-1)->ends_in_newline_from_string_p))))
11923 && (row->y > top_scroll_margin 11956 && (row->y > top_scroll_margin
11924 || CHARPOS (startp) == BEGV)) 11957 || CHARPOS (startp) == BEGV))
11925 { 11958 {
@@ -12824,7 +12857,8 @@ try_window (window, pos, check_margins)
12824 } 12857 }
12825 12858
12826 /* Don't let the cursor end in the scroll margins. */ 12859 /* Don't let the cursor end in the scroll margins. */
12827 if (check_margins) 12860 if (check_margins
12861 && !MINI_WINDOW_P (w))
12828 { 12862 {
12829 int this_scroll_margin, cursor_height; 12863 int this_scroll_margin, cursor_height;
12830 12864
@@ -15089,10 +15123,12 @@ cursor_row_p (w, row)
15089 if (PT == MATRIX_ROW_END_CHARPOS (row)) 15123 if (PT == MATRIX_ROW_END_CHARPOS (row))
15090 { 15124 {
15091 /* If the row ends with a newline from a string, we don't want 15125 /* If the row ends with a newline from a string, we don't want
15092 the cursor there (if the row is continued it doesn't end in a 15126 the cursor there, but we still want it at the start of the
15093 newline). */ 15127 string if the string starts in this row.
15128 If the row is continued it doesn't end in a newline. */
15094 if (CHARPOS (row->end.string_pos) >= 0) 15129 if (CHARPOS (row->end.string_pos) >= 0)
15095 cursor_row_p = row->continued_p; 15130 cursor_row_p = (row->continued_p
15131 || PT >= MATRIX_ROW_START_CHARPOS (row));
15096 else if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row)) 15132 else if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))
15097 { 15133 {
15098 /* If the row ends in middle of a real character, 15134 /* If the row ends in middle of a real character,
diff --git a/src/xfaces.c b/src/xfaces.c
index 165a86a45fc..1e56955a03a 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -4805,7 +4805,12 @@ x_update_menu_appearance (f)
4805 const char *suffix = "List"; 4805 const char *suffix = "List";
4806 Bool motif = True; 4806 Bool motif = True;
4807#else 4807#else
4808#if defined HAVE_X_I18N
4809
4810 const char *suffix = "Set";
4811#else
4808 const char *suffix = ""; 4812 const char *suffix = "";
4813#endif
4809 Bool motif = False; 4814 Bool motif = False;
4810#endif 4815#endif
4811#if defined HAVE_X_I18N 4816#if defined HAVE_X_I18N
diff --git a/src/xselect.c b/src/xselect.c
index 13bc241053f..a424259416b 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -2954,7 +2954,6 @@ A value of 0 means wait as long as necessary. This is initialized from the
2954 QTEXT = intern ("TEXT"); staticpro (&QTEXT); 2954 QTEXT = intern ("TEXT"); staticpro (&QTEXT);
2955 QCOMPOUND_TEXT = intern ("COMPOUND_TEXT"); staticpro (&QCOMPOUND_TEXT); 2955 QCOMPOUND_TEXT = intern ("COMPOUND_TEXT"); staticpro (&QCOMPOUND_TEXT);
2956 QUTF8_STRING = intern ("UTF8_STRING"); staticpro (&QUTF8_STRING); 2956 QUTF8_STRING = intern ("UTF8_STRING"); staticpro (&QUTF8_STRING);
2957 QTIMESTAMP = intern ("TIMESTAMP"); staticpro (&QTIMESTAMP);
2958 QDELETE = intern ("DELETE"); staticpro (&QDELETE); 2957 QDELETE = intern ("DELETE"); staticpro (&QDELETE);
2959 QMULTIPLE = intern ("MULTIPLE"); staticpro (&QMULTIPLE); 2958 QMULTIPLE = intern ("MULTIPLE"); staticpro (&QMULTIPLE);
2960 QINCR = intern ("INCR"); staticpro (&QINCR); 2959 QINCR = intern ("INCR"); staticpro (&QINCR);