aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaroly Lorentey2005-04-18 13:40:23 +0000
committerKaroly Lorentey2005-04-18 13:40:23 +0000
commit6ab9dd8034fcd76f5d2e92a91243f8d8be3a8f98 (patch)
treea40a6371728d46bdfb26b7090612e0ca70e1c057
parent91fd98fc1eff12aa5a46142efabababa7daf77bb (diff)
parentd4127a9a1111805640eaa06e9767a7a6f56351a5 (diff)
downloademacs-6ab9dd8034fcd76f5d2e92a91243f8d8be3a8f98.tar.gz
emacs-6ab9dd8034fcd76f5d2e92a91243f8d8be3a8f98.zip
Merged from miles@gnu.org--gnu-2005 (patch 60-65, 246-265)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-246 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-247 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-248 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-249 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-250 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-251 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-252 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-253 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-254 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-255 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-256 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-257 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-258 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-259 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-260 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-261 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-262 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-263 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-264 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-265 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-60 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-61 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-62 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-63 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-64 (mm-string-to-multibyte): Use Gnus trunk definition. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-65 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-328
-rw-r--r--ChangeLog11
-rw-r--r--admin/ChangeLog6
-rw-r--r--admin/FOR-RELEASE44
-rw-r--r--admin/admin.el11
-rwxr-xr-xadmin/nt/makedist.bat10
-rw-r--r--etc/ChangeLog12
-rw-r--r--etc/NEWS10
-rw-r--r--etc/TODO13
-rw-r--r--etc/TUTORIAL.ru2
-rw-r--r--etc/TUTORIAL.sk4
-rw-r--r--etc/TUTORIAL.th2
-rw-r--r--lisp/ChangeLog361
-rw-r--r--lisp/Makefile.in115
-rw-r--r--lisp/comint.el3
-rw-r--r--lisp/cus-edit.el4
-rw-r--r--lisp/cus-theme.el2
-rw-r--r--lisp/custom.el26
-rw-r--r--lisp/dired.el26
-rw-r--r--lisp/dnd.el192
-rw-r--r--lisp/emacs-lisp/generic.el (renamed from lisp/generic.el)150
-rw-r--r--lisp/emulation/cua-base.el16
-rw-r--r--lisp/emulation/cua-rect.el10
-rw-r--r--lisp/faces.el6
-rw-r--r--lisp/files.el4
-rw-r--r--lisp/filesets.el13
-rw-r--r--lisp/generic-x.el123
-rw-r--r--lisp/gnus/ChangeLog27
-rw-r--r--lisp/gnus/gnus-art.el27
-rw-r--r--lisp/gnus/message.el3
-rw-r--r--lisp/gnus/mm-util.el7
-rw-r--r--lisp/gnus/nnimap.el2
-rw-r--r--lisp/gnus/nnrss.el7
-rw-r--r--lisp/gnus/qp.el13
-rw-r--r--lisp/help.el4
-rw-r--r--lisp/international/code-pages.el4
-rw-r--r--lisp/international/mule-cmds.el12
-rw-r--r--lisp/international/ucs-tables.el8
-rw-r--r--lisp/jka-compr.el8
-rw-r--r--lisp/loadhist.el44
-rw-r--r--lisp/loadup.el1
-rw-r--r--lisp/mail/rmail.el13
-rw-r--r--lisp/mail/sendmail.el7
-rw-r--r--lisp/makefile.w32-in103
-rw-r--r--lisp/progmodes/f90.el6
-rw-r--r--lisp/progmodes/gdb-ui.el77
-rw-r--r--lisp/progmodes/gud.el27
-rw-r--r--lisp/progmodes/sh-script.el47
-rw-r--r--lisp/repeat.el4
-rw-r--r--lisp/simple.el17
-rw-r--r--lisp/startup.el22
-rw-r--r--lisp/term.el73
-rw-r--r--lisp/term/mac-win.el154
-rw-r--r--lisp/term/w32-win.el6
-rw-r--r--lisp/term/xterm.el80
-rw-r--r--lisp/textmodes/org.el800
-rw-r--r--lisp/tooltip.el30
-rw-r--r--lisp/wdired.el173
-rw-r--r--lisp/whitespace.el9
-rw-r--r--lisp/x-dnd.el177
-rw-r--r--lisp/xt-mouse.el10
-rw-r--r--lispref/ChangeLog8
-rw-r--r--lispref/buffers.texi8
-rw-r--r--lispref/positions.texi19
-rw-r--r--lispref/strings.texi9
-rw-r--r--mac/ChangeLog5
-rw-r--r--mac/makefile.MPW2
-rwxr-xr-xmake-dist30
-rw-r--r--man/ChangeLog45
-rw-r--r--man/cc-mode.texi2
-rw-r--r--man/cmdargs.texi18
-rw-r--r--man/custom.texi38
-rw-r--r--man/frames.texi12
-rw-r--r--man/maintaining.texi14
-rw-r--r--man/major.texi15
-rw-r--r--man/org.texi259
-rw-r--r--man/rmail.texi11
-rw-r--r--man/xresources.texi4
-rw-r--r--src/ChangeLog130
-rw-r--r--src/Makefile.in11
-rw-r--r--src/image.c2
-rw-r--r--src/keyboard.c15
-rw-r--r--src/mac.c82
-rw-r--r--src/macfns.c18
-rw-r--r--src/macterm.c467
-rw-r--r--src/macterm.h11
-rw-r--r--src/term.c21
-rw-r--r--src/termhooks.h9
-rw-r--r--src/window.c19
-rw-r--r--src/xdisp.c37
89 files changed, 2672 insertions, 1827 deletions
diff --git a/ChangeLog b/ChangeLog
index 93cdb3d7872..cc513b9d19c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
12005-04-14 Lute Kamstra <lute@gnu.org>
2
3 * make-dist: Distribute all ChangeLog files in lisp/.
4 Don't distribute ldefs-boot.el.
5 lisp/makefile.nt no longer exists.
6
72005-04-13 Lute Kamstra <lute@gnu.org>
8
9 * make-dist: Don't use DONTCOMPILE from lisp/Makefile.in; check
10 for "no-byte-compile: t" in the file instead.
11
12005-03-16 Stefan Monnier <monnier@iro.umontreal.ca> 122005-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
2 13
3 * configure.in <Motif>: Don't let a special LessTif/Motif1.2 install 14 * configure.in <Motif>: Don't let a special LessTif/Motif1.2 install
diff --git a/admin/ChangeLog b/admin/ChangeLog
index c3c65379a16..64e9c806d4c 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,9 @@
12005-04-14 Lute Kamstra <lute@gnu.org>
2
3 * nt/makedist.bat (elfiles): Update.
4
5 * admin.el (add-release-logs): Fix require call.
6
12005-03-30 Marcelo Toledo <marcelo@marcelotoledo.org> 72005-03-30 Marcelo Toledo <marcelo@marcelotoledo.org>
2 8
3 * FOR-RELEASE (Documentation): Added check the Emacs Tutorial. The 9 * FOR-RELEASE (Documentation): Added check the Emacs Tutorial. The
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index c76af42c4ee..4fd9caa721a 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -20,6 +20,8 @@ See msg from rms to emacs-devel on 21 Dec.
20 20
21** Enhance scroll-bar to handle tall line (similar to line-move). 21** Enhance scroll-bar to handle tall line (similar to line-move).
22 22
23** Adapt mouse-sel-mode to mouse-1-click-follows-link.
24
23 25
24* FATAL ERRORS 26* FATAL ERRORS
25 27
@@ -80,42 +82,6 @@ A fix would be to somehow disable handling of display properties if an error
80is encountered. 82is encountered.
81 83
82 84
83** custom mode-line face makes Emacs freeze up
84
85From: Stephen Berman <Stephen.Berman@gmx.net>
86Date: Sun, 24 Oct 2004 02:08:56 +0200
87
881. Start Emacs with -q -no-site-file.
89
902. Type `M-x customize-face' and at the prompt `mode-line'.
91
923. In the Custom buffer for mode-line face
93 a. check width and give it the value `narrow';
94 b. check height and give it the value 120 in 1/10 pt;
95 c. check underline and give it the value `on' (or `colored');
96 d. check overline and give it the value `on' (or `colored').
97
984. Set for current session.
99
1005. Invoke Ediff on any two files.
101
1026. Now Emacs is frozen and consumes 95-99% of CPU.
103
104The customizations in step 3 appear to be the minimum necessary to
105induce this bug. Leave out any one of them and Ediff runs without a
106problem. Also if the 1/10 point value of height is 130 or greater
107there's no bug (with the default font family; with e.g. Helvetica the
108bug is induced only by a value of 100 or less).
109
110I've noticed this freeze up only when invoking Ediff. The only thing
111I've been able to do is kill Emacs externally, via top or with kill
112when run in gdb, after interrupting. When the freeze up happens
113within a gdb session, there is no automatic debugging feedback. After
114interrupting I can get a backtrace, here's an example:
115
116Update: Maybe only reveals itself when compiled with GTK+
117
118
119* DOCUMENTATION 85* DOCUMENTATION
120 86
121** Document Custom Themes. 87** Document Custom Themes.
@@ -272,11 +238,11 @@ etc/TUTORIAL.nl Lute Kamstra
272etc/TUTORIAL.pl 238etc/TUTORIAL.pl
273etc/TUTORIAL.pt_BR Marcelo Toledo 239etc/TUTORIAL.pt_BR Marcelo Toledo
274etc/TUTORIAL.ro 240etc/TUTORIAL.ro
275etc/TUTORIAL.ru 241etc/TUTORIAL.ru Alex Ott <alexott@gmail.com>
276etc/TUTORIAL.sk 242etc/TUTORIAL.sk Pavel Janík <Pavel@Janik.cz>
277etc/TUTORIAL.sl Primoz PETERLIN <primoz.peterlin@biofiz.mf.uni-lj.si> 243etc/TUTORIAL.sl Primoz PETERLIN <primoz.peterlin@biofiz.mf.uni-lj.si>
278etc/TUTORIAL.sv Mats Lidell <matsl@contactor.se> 244etc/TUTORIAL.sv Mats Lidell <matsl@contactor.se>
279etc/TUTORIAL.th 245etc/TUTORIAL.th Virach Sornlertlamvanich <virach@tcllab.org>
280etc/TUTORIAL.zh 246etc/TUTORIAL.zh
281 247
282 248
diff --git a/admin/admin.el b/admin/admin.el
index 8048ccc78e0..44fbd8ed543 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -1,6 +1,6 @@
1;;; admin.el --- utilities for Emacs administration 1;;; admin.el --- utilities for Emacs administration
2 2
3;; Copyright (C) 2001 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2005 Free Software Foundation, Inc.
4 4
5;; This file is part of GNU Emacs. 5;; This file is part of GNU Emacs.
6 6
@@ -21,8 +21,8 @@
21 21
22;;; Commentary: 22;;; Commentary:
23 23
24;; add-release-log add ``Version X released'' change log entries 24;; add-release-logs Add ``Version X released'' change log entries.
25;; set-version change Emacs version number in source tree. 25;; set-version Change Emacs version number in source tree.
26 26
27;;; Code: 27;;; Code:
28 28
@@ -43,7 +43,6 @@ Signal an error if the program returns with a non-zero exit status."
43 (forward-line 1)) 43 (forward-line 1))
44 (nreverse lines))))) 44 (nreverse lines)))))
45 45
46
47(defun add-release-logs (root version) 46(defun add-release-logs (root version)
48 "Add \"Version VERSION released.\" change log entries in ROOT. 47 "Add \"Version VERSION released.\" change log entries in ROOT.
49Root must be the root of an Emacs source tree." 48Root must be the root of an Emacs source tree."
@@ -51,8 +50,8 @@ Root must be the root of an Emacs source tree."
51 (setq root (expand-file-name root)) 50 (setq root (expand-file-name root))
52 (unless (file-exists-p (expand-file-name "src/emacs.c" root)) 51 (unless (file-exists-p (expand-file-name "src/emacs.c" root))
53 (error "%s doesn't seem to be the root of an Emacs source tree" root)) 52 (error "%s doesn't seem to be the root of an Emacs source tree" root))
53 (require 'add-log)
54 (let* ((logs (process-lines "find" root "-name" "ChangeLog")) 54 (let* ((logs (process-lines "find" root "-name" "ChangeLog"))
55 (require 'add-log)
56 (entry (format "%s %s <%s>\n\n\t* Version %s released.\n\n" 55 (entry (format "%s %s <%s>\n\n\t* Version %s released.\n\n"
57 (funcall add-log-time-format) 56 (funcall add-log-time-format)
58 (or add-log-full-name (user-full-name)) 57 (or add-log-full-name (user-full-name))
@@ -64,7 +63,6 @@ Root must be the root of an Emacs source tree."
64 (goto-char (point-min)) 63 (goto-char (point-min))
65 (insert entry))))) 64 (insert entry)))))
66 65
67
68(defun set-version-in-file (root file version rx) 66(defun set-version-in-file (root file version rx)
69 (find-file (expand-file-name file root)) 67 (find-file (expand-file-name file root))
70 (goto-char (point-min)) 68 (goto-char (point-min))
@@ -72,7 +70,6 @@ Root must be the root of an Emacs source tree."
72 (error "Version not found in %s" file)) 70 (error "Version not found in %s" file))
73 (replace-match (format "%s" version) nil nil nil 1)) 71 (replace-match (format "%s" version) nil nil nil 1))
74 72
75
76(defun set-version (root version) 73(defun set-version (root version)
77 "Set Emacs version to VERSION in relevant files under ROOT. 74 "Set Emacs version to VERSION in relevant files under ROOT.
78Root must be the root of an Emacs source tree." 75Root must be the root of an Emacs source tree."
diff --git a/admin/nt/makedist.bat b/admin/nt/makedist.bat
index d48e6736004..db9d9026aec 100755
--- a/admin/nt/makedist.bat
+++ b/admin/nt/makedist.bat
@@ -26,9 +26,14 @@ if not (%4) == () goto end
26 26
27set eld=emacs-%1/lisp 27set eld=emacs-%1/lisp
28 28
29rem Keep this list in sync with the DONTCOMPILE list in lisp/makefile.w32-in 29rem List of Lisp files that are not compiled and that should be
30rem included in the bin distribution.
30 31
31set elfiles=%eld%/cus-load.el %eld%/cus-start.el %eld%/emacs-lisp/cl-specs.el %eld%/eshell/esh-maint.el %eld%/eshell/esh-groups.el %eld%/finder-inf.el %eld%/forms-d2.el %eld%/forms-pass.el %eld%/generic-x.el %eld%/international/latin-1.el %eld%/international/latin-2.el %eld%/international/latin-3.el %eld%/international/latin-4.el %eld%/international/latin-5.el %eld%/international/latin-8.el %eld%/international/latin-9.el %eld%/international/mule-conf.el %eld%/loaddefs.el %eld%/loadup.el %eld%/mail/blessmail.el %eld%/patcomp.el %eld%/paths.el %eld%/play/bruce.el %eld%/subdirs.el %eld%/version.el 32rem It would be better to generate this list automatically. It is the
33rem list of all .el files for which there is no corresponding .elc
34rem file, minus ldefs-boot.el. --lute
35
36set elfiles=%eld%/cus-load.el %eld%/emacs-lisp/cl-specs.el %eld%/eshell/esh-groups.el %eld%/eshell/esh-maint.el %eld%/finder-inf.el %eld%/forms-d2.el %eld%/forms-pass.el %eld%/international/latin-1.el %eld%/international/latin-2.el %eld%/international/latin-3.el %eld%/international/latin-4.el %eld%/international/latin-5.el %eld%/international/latin-8.el %eld%/international/latin-9.el %eld%/international/mule-conf.el %eld%/language/czech.el %eld%/language/devanagari.el %eld%/language/english.el %eld%/language/georgian.el %eld%/language/greek.el %eld%/language/hebrew.el %eld%/language/japanese.el %eld%/language/kannada.el %eld%/language/korean.el %eld%/language/lao.el %eld%/language/malayalam.el %eld%/language/misc-lang.el %eld%/language/romanian.el %eld%/language/slovak.el %eld%/language/tamil.el %eld%/language/thai.el %eld%/language/utf-8-lang.el %eld%/loaddefs.el %eld%/loadup.el %eld%/mail/blessmail.el %eld%/mh-e/mh-acros.el %eld%/mh-e/mh-gnus.el %eld%/mh-e/mh-loaddefs.el %eld%/obsolete/keyswap.el %eld%/patcomp.el %eld%/paths.el %eld%/play/bruce.el %eld%/subdirs.el %eld%/term/AT386.el %eld%/term/apollo.el %eld%/term/bobcat.el %eld%/term/internal.el %eld%/term/iris-ansi.el %eld%/term/linux.el %eld%/term/lk201.el %eld%/term/news.el %eld%/term/vt102.el %eld%/term/vt125.el %eld%/term/vt200.el %eld%/term/vt201.el %eld%/term/vt220.el %eld%/term/vt240.el %eld%/term/vt300.el %eld%/term/vt320.el %eld%/term/vt400.el %eld%/term/vt420.el %eld%/term/wyse50.el %eld%/version.el
32 37
33set fns_el= 38set fns_el=
34for %%f in (emacs-%1/bin/fns*) do set fns_el=%fns_el% emacs-%1/bin/%%f 39for %%f in (emacs-%1/bin/fns*) do set fns_el=%fns_el% emacs-%1/bin/%%f
@@ -42,7 +47,6 @@ for %%f in (emacs-%1/bin/fns*) do echo emacs-%1/bin/%%f>>#elfiles#
42for %%f in (emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp) do echo %%f>>#files# 47for %%f in (emacs-%1/bin emacs-%1/etc emacs-%1/info emacs-%1/lisp) do echo %%f>>#files#
43for %%f in (emacs-%1/lock emacs-%1/site-lisp) do echo %%f>>#files# 48for %%f in (emacs-%1/lock emacs-%1/site-lisp) do echo %%f>>#files#
44for %%f in (%elfiles% emacs-%1/site-lisp/subdirs.el) do echo %%f>>#elfiles# 49for %%f in (%elfiles% emacs-%1/site-lisp/subdirs.el) do echo %%f>>#elfiles#
45for %%f in (%eld%/term/*.el) do echo %eld%/term/%%f>>#elfiles#
46 50
47%TAR% --exclude temacs.exe --exclude emacs.mdp --exclude *.pdb --exclude *.opt --exclude "*.el" --exclude "*~" -T #files# -cvf %2-bin-i386.tar 51%TAR% --exclude temacs.exe --exclude emacs.mdp --exclude *.pdb --exclude *.opt --exclude "*.el" --exclude "*~" -T #files# -cvf %2-bin-i386.tar
48%TAR% -T #elfiles# -rvf %2-bin-i386.tar 52%TAR% -T #elfiles# -rvf %2-bin-i386.tar
diff --git a/etc/ChangeLog b/etc/ChangeLog
index d873797f5dc..ce3785eba8e 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,15 @@
12005-04-13 Pavel Jan,Am(Bk <Pavel@Janik.cz>
2
3 * TUTORIAL.sk: Updated header.
4
52005-04-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
6
7 * NEWS: Mention cursorBlink resource.
8
92005-04-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10
11 * NEWS: Mention dynamic change of keyboard-coding-system on Mac.
12
12005-04-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 132005-04-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 14
3 * NEWS: Mention fontSet for Lucid menus. 15 * NEWS: Mention fontSet for Lucid menus.
diff --git a/etc/NEWS b/etc/NEWS
index 3b1de666a24..4696853e27d 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -351,11 +351,13 @@ the next/previous matching line found by M-x occur.
351+++ 351+++
352** Telnet now prompts you for a port number with C-u M-x telnet. 352** Telnet now prompts you for a port number with C-u M-x telnet.
353 353
354+++
354** New command line option -Q or --quick. 355** New command line option -Q or --quick.
355 356
356This is like using -q --no-site-file, but in addition it also disables 357This is like using -q --no-site-file, but in addition it also disables
357the fancy startup screen. 358the fancy startup screen.
358 359
360+++
359** New command line option -D or --basic-display. 361** New command line option -D or --basic-display.
360 362
361Disables the menu-bar, the tool-bar, the scroll-bars, tool tips, and 363Disables the menu-bar, the tool-bar, the scroll-bars, tool tips, and
@@ -966,6 +968,9 @@ If the configure option `--without-xim' was used to turn off use of
966XIM by default, the X resource useXIM can be used to turn it on. 968XIM by default, the X resource useXIM can be used to turn it on.
967 969
968+++ 970+++
971** The X resource cursorBlink can be used to turn off cursor blinking.
972
973+++
969** `undo-only' does an undo which does not redo any previous undo. 974** `undo-only' does an undo which does not redo any previous undo.
970 975
971--- 976---
@@ -2449,6 +2454,11 @@ temporary overlay showing in the course of an isearch operation.
2449** New command `recode-region' decodes the region again by a specified 2454** New command `recode-region' decodes the region again by a specified
2450coding system. 2455coding system.
2451 2456
2457** On Mac OS, the value of the variable `keyboard-coding-system' is
2458now dynamically changed according to the current keyboard script. The
2459variable `mac-keyboard-text-encoding' and the constants
2460`kTextEncodingMacRoman', `kTextEncodingISOLatin1', and
2461`kTextEncodingISOLatin2' are obsolete.
2452 2462
2453* New modes and packages in Emacs 22.1 2463* New modes and packages in Emacs 22.1
2454 2464
diff --git a/etc/TODO b/etc/TODO
index ab66def2365..34eade0c01a 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -22,6 +22,11 @@ to the FSF.
22** The buttons at the top of a custom buffer should not omit 22** The buttons at the top of a custom buffer should not omit
23 variables whose values are currently hidden. 23 variables whose values are currently hidden.
24 24
25** Clean up the variables in browse-url. Perhaps use a shell command string to
26 specify the browser instead of the mushrooming set of functions.
27 See also ESR's proposal for a BROWSER environment variable
28 <URL:http://www.catb.org/~esr/BROWSER/browse-url.patch>.
29
25* Important features: 30* Important features:
26 31
27** Provide user-friendly ways to list all available font families, 32** Provide user-friendly ways to list all available font families,
@@ -54,10 +59,10 @@ to the FSF.
54 59
55** Make movemail work with IMAP. 60** Make movemail work with IMAP.
56 61
57** Internationalize Emacs's messages. [Note that this is of limited 62** Internationalize Emacs's messages.
58 use until the menus can display multilingual text. It also doesn't 63
59 address important issues like using the names of symbols essentially 64** Address internationalization of symbols names essentially
60 as documentation, e.g. in command names and Custom. -- fx] 65 as documentation, e.g. in command names and Custom.
61 66
62** Make the Lucid menu widget display multilingual text. [This 67** Make the Lucid menu widget display multilingual text. [This
63 probably needs to be done from actual Emacs buffers, either directly 68 probably needs to be done from actual Emacs buffers, either directly
diff --git a/etc/TUTORIAL.ru b/etc/TUTORIAL.ru
index f1deaf6c89f..3dad1b3daec 100644
--- a/etc/TUTORIAL.ru
+++ b/etc/TUTORIAL.ru
@@ -1,4 +1,4 @@
1ÕÞÅÂÎÉË Emacs. 1õÞÅÂÎÉË Emacs. õÓÌÏ×ÉÑ ÒÁÓÐÒÏÓÔÒÁÎÅÎÉÑ ÓÍÏÔÒÉÔÅ × ËÏÎÃÅ ÆÁÊÌÁ
2Copyright (c) 1985, 1996, 2004 Free Software Foundation, Inc. 2Copyright (c) 1985, 1996, 2004 Free Software Foundation, Inc.
3 3
4äÌÑ ÕÐÒÁ×ÌÅÎÉÑ Emacs ÏÂÙÞÎÏ ÉÓÐÏÌØÚÕÅÔÓÑ ËÌÀÞ (ÓÏÞÅÔÁÎÉÅ ËÌÁ×ÉÛ ËÌÁ×ÉÁÔÕÒÙ 4äÌÑ ÕÐÒÁ×ÌÅÎÉÑ Emacs ÏÂÙÞÎÏ ÉÓÐÏÌØÚÕÅÔÓÑ ËÌÀÞ (ÓÏÞÅÔÁÎÉÅ ËÌÁ×ÉÛ ËÌÁ×ÉÁÔÕÒÙ
diff --git a/etc/TUTORIAL.sk b/etc/TUTORIAL.sk
index 465a3805a62..47f104ffa77 100644
--- a/etc/TUTORIAL.sk
+++ b/etc/TUTORIAL.sk
@@ -1,5 +1,5 @@
1tútorial k Emacsu. 1Tútorial k Emacsu. Podmienky pozri na konci.
2Copyright (c) 1985 Free Software Foundation, Inc; podmienky pozri na konci. 2Copyright (c) 1985, 1996, 1998, 2001, 2002, 2005 Free Software Foundation.
3Do èe¹tiny prelo¾il Milan Zamazal <pdm@zamazal.org>, do slovenèiny Miroslav 3Do èe¹tiny prelo¾il Milan Zamazal <pdm@zamazal.org>, do slovenèiny Miroslav
4Va¹ko <zemiak@zoznam.sk>. 4Va¹ko <zemiak@zoznam.sk>.
5 5
diff --git a/etc/TUTORIAL.th b/etc/TUTORIAL.th
index e1fb9d561e1..86c03d31f3b 100644
--- a/etc/TUTORIAL.th
+++ b/etc/TUTORIAL.th
@@ -1,4 +1,4 @@
10,T7h1R9!S0EQ1'0HV1!IR0$Yh10AW1M!RCc0*i10MU1aA!0Jl1(B. 10,T$Yh10AW1M!RCc0*i10MU1aA!0Jl1(B. ,Tb;C40HV1!IR0Jh1G907i1RB"M'0$Yh10AW1MJSK0CQ1:`0'Wh1M9d"c9!RC7SJS`9R(B.
2,TJ'G90ET1"0JT1708Tl1(B ,T>(B.,TH(B. 2528 ,Tb4B:0CT10IQ17?0CU1+M?05l1aG0Cl1?RG09l1`40*Q19(B (Free Software 2,TJ'G90ET1"0JT1708Tl1(B ,T>(B.,TH(B. 2528 ,Tb4B:0CT10IQ17?0CU1+M?05l1aG0Cl1?RG09l1`40*Q19(B (Free Software
3Foundation, Inc); ,T!0CX13R0HV1!IR`0'Wh1M9d"5M907i1RB:7(B. 3Foundation, Inc); ,T!0CX13R0HV1!IR`0'Wh1M9d"5M907i1RB:7(B.
40,T7h1R9!S0EQ1'0HV1!IR0$Yh10AW1M!RCc0*i10MU1aA!0Jl1(B (Emacs tutorial) ,TM0BYh1c9"3P09Ui1(B. 40,T7h1R9!S0EQ1'0HV1!IR0$Yh10AW1M!RCc0*i10MU1aA!0Jl1(B (Emacs tutorial) ,TM0BYh1c9"3P09Ui1(B.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c299c1cf77f..8b97c774aaa 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,357 @@
12005-04-17 Luc Teirlinck <teirllm@auburn.edu>
2
3 * startup.el (command-line): No longer enable Xterm Mouse mode by
4 default in terminals compatible with xterm.
5
6 * xt-mouse.el (xterm-mouse-mode): Set init value back to nil.
7
82005-04-18 Nick Roberts <nickrob@snap.net.nz>
9
10 * tooltip.el (tooltip-gud-echo-area): Rename from
11 tooltip-use-echo-area.
12 (tooltip-show, tooltip-gud-process-output, gdb-tooltip-print)
13 (tooltip-help-tips): Allow GUD tooltips to be displayed in echo
14 area independently of where help tooltips are displayed.
15
162005-04-17 David Kastrup <dak@gnu.org>
17
18 * cus-theme.el (custom-theme-write-variables): Quote variables
19 where necessary.
20
212005-04-17 Richard M. Stallman <rms@gnu.org>
22
23 * simple.el (yank-excluded-properties): Add follow-link to value.
24
25 * jka-compr.el (jka-compr-compression-info-list): Fix custom type.
26
27 * startup.el (fancy-splash-max-time): Just 30 seconds.
28 (fancy-splash-delay): Just 7.
29 (fancy-splash-screens): No time limit other than fancy-splash-max-time.
30
31 * loadhist.el (unload-feature): Update for new format of load-history.
32 Simplify the code.
33
34 * mail/rmail.el (rmail-ignored-headers): Ignore more headers
35 (rmail-font-lock-keywords): Don't fontify the text of a citation.
36
37 * mail/sendmail.el (mail-font-lock-keywords):
38 Don't fontify subject text.
39 Don't fontify the text of a citation.
40
412005-04-17 Mark H. Weaver <mhw@netris.org> (tiny change)
42
43 * comint.el (comint-output-filter): Run comint-output-filter-functions
44 with point where the user had it.
45
462005-04-16 Stefan Monnier <monnier@iro.umontreal.ca>
47
48 * international/ucs-tables.el (ucs-set-table-for-input):
49 Disable when using unify-on-decoding.
50
512005-04-16 Dan Nicolaescu <dann@ics.uci.edu>
52
53 * emulation/cua-base.el (cua-global-mark-face): Add special case
54 for displays supporting a high number of colors.
55
562005-04-16 Matt Hodges <MPHodges@member.fsf.org> (tiny change)
57
58 * repeat.el (repeat): Invoke pre-command-hook and post-command-hook.
59
602005-04-16 Chong Yidong <cyd@stupidchicken.com>
61
62 * filesets.el (filesets-add-buffer): If user supplies a name of a
63 non-existing fileset, create a new fileset.
64
652005-04-16 Carsten Dominik <dominik@science.uva.nl>
66
67 * textmodes/org.el (org-up-heading-all): Fix bug with
68 `outline-up-heading-all'.
69
702005-04-16 Andreas Schwab <schwab@suse.de>
71
72 * files.el (auto-mode-alist): Handle /etc/sysconfig/*,
73 /etc/permissions.d/* and /etc/aliases.d/*.
74
752005-04-16 Kenichi Handa <handa@m17n.org>
76
77 * international/code-pages.el (cp-make-coding-system):
78 Set `translation-table-for-input' property value to the symbol
79 ucs-mule-to-mule-unicode, not to that value.
80 (pt154): Escape guillemet by `\'.
81
822005-04-15 Luc Teirlinck <teirllm@auburn.edu>
83
84 * loadup.el: Load tooltip if x-show-tip is fboundp.
85
86 * startup.el (command-line): Add comment.
87
88 * tooltip.el (tooltip-mode): Specify correct standard value for
89 Custom in init-value.
90
912005-04-15 Nick Roberts <nickrob@snap.net.nz>
92
93 * progmodes/gud.el (gud-goto-info): Use existing Info buffer, if
94 possible.
95
962005-04-15 Carsten Dominik <dominik@science.uva.nl>
97
98 * textmodes/org.el: (org-agenda-date-prompt): Rename from
99 `org-agenda-date-today'.
100 (org-evaluate-time-range): Insert at point instead of directly
101 after time range.
102 (org-first-headline-recenter, org-subtree-end-visible-p)
103 (org-optimize-window-after-visibility-change): New functions
104 (org-agenda-post-command-hook): Don't allow point at end of line,
105 to make sure it always hits the text properties.
106 (org-agenda-next-date-line, org-agenda-previous-date-line):
107 New commands.
108 (org-set-regexps-and-options): Category may contain white space.
109 (org-agenda-get-deadlines, org-agenda-get-scheduled):
110 Improve marker positions.
111 (org-agenda-new-marker): Argument POS made optional.
112 (org-agenda-get-timestamps): Deadlines which are done are listed
113 in org-done-face now.
114 (org-agenda-get-todos, org-agenda-get-timestamps)
115 (org-agenda-get-deadlines, org-agenda-get-scheduled):
116 Set `undone-face' and `done-face' properties.
117 (org-last-todo-state-is-todo): New variable.
118 (org-todo): Set `org-last-todo-state-is-todo'.
119 (org-agenda-todo): Change face according to
120 `org-last-todo-state-is-todo'. And change other lines refering to
121 the same entry.
122 (org-calendar-goto-agenda): New command.
123 (org-calendar-to-agenda-key): New option.
124 (org-startup-folded): New allowed value `content'.
125 (org-set-regexps-and-options): Accept new value `content' for
126 `org-startup-folded'.
127 (org-get-current-options): Handle new value `content' for
128 `org-startup-folded'.
129 (org-insert-todo-heading): New command.
130 (org-mode): Insert first line "*-* mode: org-mode -*-" when called
131 interactively in empty file and option
132 `org-insert-mode-line-in-empty-file' has been set.
133 (org-agenda-todo,org-agenda-priority): Modify to use
134 `org-agenda-change-all-lines'.
135 (org-warning-face): Change color on dark background
136
1372005-04-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
138
139 * international/mule-cmds.el (set-locale-environment): On Mac OS,
140 use preferences AppleLocale and AppleLanguages, and variable
141 mac-system-locale for default locale. On Mac OS Classic, use
142 mac-system-coding-system for default coding systems.
143
144 * term/mac-win.el: Don't set file-name-coding-system.
145 Decode variables system-name, emacs-build-system, user-login-name, and
146 user-full-name by mac-system-coding-system on Mac OS Classic.
147 (mac-system-coding-system): New variable.
148
1492005-04-13 Luc Teirlinck <teirllm@auburn.edu>
150
151 * startup.el (command-line): Handle `xterm-mouse-mode' before
152 reading init file.
153
154 * xt-mouse.el (xterm-mouse-mode): Adapt to above change.
155
1562005-04-13 Glenn Morris <gmorris@ast.cam.ac.uk>
157
158 * progmodes/sh-script.el (sh-here-document-word): Make it a
159 defcustom. Doc fix.
160 (sh-add): Bash uses $(( )) for arithmetic.
161 (sh-while-getopts) <sh>: Set OPTIND back to 1 at end.
162 (sh-maybe-here-document): Remove quotes and leading whitespace
163 from heredoc word when closing. Indent heredoc with tabs if word
164 starts with "-".
165
1662005-04-13 Richard M. Stallman <rms@gnu.org>
167
168 * simple.el (undo): Fix previous change.
169
170 * custom.el (defface): Doc fix.
171
1722005-04-13 Lute Kamstra <lute@gnu.org>
173
174 * Makefile.in (DONTCOMPILE): Remove list.
175 (compile, compile-always): Don't use DONTCOMPILE.
176 (update-authors): Load the library in which batch-update-authors
177 is defined.
178 * makefile.w32-in (DONTCOMPILE): Remove list.
179 (compile, compile-always): Fix comments.
180 (update-authors): Load the library in which batch-update-authors
181 is defined.
182
183 * generic-x.el (generic-mode-ini-file-find-file-hook):
184 Rename to ini-generic-mode-find-file-hook.
185 Keep generic-mode-ini-file-find-file-hook as an alias.
186 (ini-generic-mode-find-file-hook): Rename from
187 generic-mode-ini-file-find-file-hook. Fix docstring.
188 (ini-generic-mode): Docstring change.
189 (bat-generic-mode-run-as-comint): Silence the byte compiler.
190
191 * help.el (describe-key-briefly): UNTRANSLATED can be nil when
192 called from lisp.
193
194 * generic.el: Move to the emacs-lisp subdir.
195
1962005-04-12 Dan Nicolaescu <dann@ics.uci.edu>
197
198 * term/xterm.el (function-key-map): Add mappings for A-, C-, S-
199 and C-S- function and cursor motion keys.
200
2012005-04-12 Luc Teirlinck <teirllm@auburn.edu>
202
203 * startup.el (command-line): Enable Xterm Mouse mode by default.
204 * xt-mouse.el (xterm-mouse-mode): Provide correct standard value
205 for Custom. No longer show "Mouse" in mode line when enabled.
206 Doc fix.
207
2082005-04-12 Kim F. Storm <storm@cua.dk>
209
210 * emulation/cua-base.el (cua-rectangle-face)
211 (cua-rectangle-noselect-face): Define face attributes here.
212
213 * emulation/cua-rect.el (cua--init-rectangles): Remove face setup.
214
2152005-04-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
216
217 * startup.el (command-line): Turn off blinking cursor if
218 cursorBlink in resources is off or false.
219
2202005-04-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
221
222 * term/mac-win.el (dnd): Require dnd.
223 (mac-drag-n-drop): Call dnd-handle-one-url.
224 (kTextEncodingMacRoman, kTextEncodingISOLatin1)
225 (kTextEncodingISOLatin2): Remove constants.
226 (mac-script-code-coding-systems): New constant.
227 (mac-handle-language-change): New function.
228 (special-event-map): Bind it to `language-change' event.
229 (mac-centraleurroman, mac-cyrillic): New coding systems.
230 (mac-font-encoder-list, ccl-encode-mac-centraleurroman-font)
231 (ccl-encode-mac-cyrillic-font): Rename mac-centraleurroman-encoder
232 and mac-cyrillic-encoder to encode-mac-centraleurroman and
233 encode-mac-cyrillic, respectively.
234
2352005-04-12 Nick Roberts <nickrob@snap.net.nz>
236
237 * progmodes/gud.el, progmodes/gdb-ui.el (gdb-assembler-mode):
238 Don't set overlay-arrow-string to "=>" as this is done
239 globally in C now.
240
2412005-04-12 Lute Kamstra <lute@gnu.org>
242
243 * generic-x.el (rc-generic-mode, rul-generic-mode):
244 Fix auto-mode-alist entries.
245 (etc-fstab-generic-mode): Tweak fontification.
246
247 * generic.el (generic-make-keywords-list): Fix docstring.
248 (generic-mode-internal): Simplify generic-font-lock-keywords.
249
2502005-04-11 Rajesh Vaidheeswarran <rv@gnu.org>
251
252 * whitespace.el (whitespace-buffer-leading)
253 (whitespace-buffer-trailing): Revert the incorrect test
254 inversion. However, fix the highlight area for the leading and
255 trailing whitespaces to show space.
256
2572005-04-11 Rajesh Vaidheeswarran <rv@gnu.org>
258
259 * whitespace.el (whitespace-version): Bump to 3.5
260
261 (whitespace-buffer-leading, whitespace-buffer-trailing):
262 Invert sense of the test to highlight the whitespace.
263
2642005-04-12 Nick Roberts <nickrob@snap.net.nz>
265
266 * progmodes/gud.el (gud-display-line): GUD uses its own
267 overlay arrow now so don't set overlay-arrow-string.
268 (gud-pdb-command-name): Revert back to "pdb" (2004-04-26).
269
2702005-04-11 Dan Nicolaescu <dann@ics.uci.edu>
271
272 * term.el (term-ansi-current-bold, term-ansi-current-underline)
273 (term-ansi-current-reverse, term-ansi-current-invisible)
274 (term-ansi-face-already-done): Change to boolean.
275 (term-reset-terminal, term-handle-colors-array): Handle the above
276 vars accordingly.
277 (term-buffer-vertical-motion): Rename from buffer-vertical-motion.
278 (term-emulate-terminal): Use the new name.
279
280 * faces.el (secondary-selection): Use yellow1, not yellow.
281 (trailing-whitespace): Use red1, not red.
282
2832005-04-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
284
285 * dired.el (dired-mode): Use dnd-* instead of x-dnd-*
286 (dired-dnd-handle-local-file): Call dnd-get-local-file-name.
287 (dired-dnd-handle-file): Call dnd-get-local-file-uri
288
289 * cus-edit.el (dnd): New group.
290
291 * term/w32-win.el (dnd): Require dnd
292 (w32-drag-n-drop): Call dnd-handle-one-url.
293
294 * x-dnd.el: Require dnd.
295 (x-dnd-handle-uri-list, x-dnd-handle-file-name):
296 Call dnd-handle-one-url.
297 (x-dnd-types-alist, x-dnd-insert-utf8-text)
298 (x-dnd-insert-utf16-text, x-dnd-insert-ctext): Change x-dnd-insert-text
299 to dnd-insert-text.
300 (x-dnd-protocol-alist, x-dnd-open-file-other-window)
301 (x-dnd-handle-one-url, x-dnd-get-local-file-uri)
302 (x-dnd-get-local-file-name, x-dnd-open-local-file)
303 (x-dnd-open-file, x-dnd-insert-text): Move to dnd.el (without x-).
304
305 * dnd.el (dnd-protocol-alist): New file with generic DND functions.
306
3072005-04-11 JUAN-LEON Lahoz Garcia <juanleon1@gmail.com>
308
309 * wdired.el: Doc fixes.
310 (wdired-confirm-overwrite): Rename from wdired-is-ok-overwrite.
311 (wdired-use-dired-vertical-movement): Rename from
312 wdired-always-move-to-filename-beginning.
313 (wdired-mode-map): Use `ignore' instead of `wdired-newline'.
314 (wdired-change-to-wdired-mode): Change mode name.
315 (wdired-newline): Delete.
316
3172005-04-11 Richard M. Stallman <rms@gnu.org>
318
319 * whitespace.el (whitespace-highlight-the-space):
320 Don't call whitespace-unhighlight-the-space here.
321
322 * simple.el (undo): Record t in undo-equiv-table
323 for the redo record made by an undo-in-region.
324
3252005-04-12 Nick Roberts <nickrob@snap.net.nz>
326
327 * progmodes/gdb-ui.el (gdb-display-inferior-io-buffer)
328 (gdb-frame-inferior-io-buffer): New Functions to control
329 display of separate IO buffer.
330 (menu): Add them to menu-bar.
331 (gdb-display-buffer): Check for buffer another frame.
332 Protect GUD buffer.
333 (gdb-setup-windows): Create IO buffer if not already there.
334 (gdb-memory-mode): Remove purecopy noops.
335
3362005-04-11 Glenn Morris <gmorris@ast.cam.ac.uk>
337
338 * progmodes/f90.el (f90-electric-insert): Add optional prefix arg,
339 and pass to self-insert-command.
340
3412005-04-11 Lute Kamstra <lute@gnu.org>
342
343 * generic.el: Commentary section cleanup.
344 (generic): Delete.
345 (generic-use-find-file-hook, generic-lines-to-scan)
346 (generic-find-file-regexp, generic-ignore-files-regexp)
347 (default-generic-mode, generic-mode-find-file-hook)
348 (generic-mode-ini-file-find-file-hook): Move to generic-x.el.
349 * generic-x.el (generic-x): Docstring fix. Put it in the data group.
350 (generic-use-find-file-hook, generic-lines-to-scan)
351 (generic-find-file-regexp, generic-ignore-files-regexp)
352 (default-generic-mode, generic-mode-find-file-hook)
353 (generic-mode-ini-file-find-file-hook): Move from generic.el.
354
12005-04-10 Karl Fogel <kfogel@red-bean.com> 3552005-04-10 Karl Fogel <kfogel@red-bean.com>
2 356
3 * bookmark.el (bookmark-write-file): Catch errors writing file. 357 * bookmark.el (bookmark-write-file): Catch errors writing file.
@@ -74,8 +428,8 @@
74 428
752005-04-09 Richard M. Stallman <rms@gnu.org> 4292005-04-09 Richard M. Stallman <rms@gnu.org>
76 430
77 * help.el (describe-key-briefly, describe-key): Replace 431 * help.el (describe-key-briefly, describe-key):
78 strings as event types with "(any string)". 432 Replace strings as event types with "(any string)".
79 433
802005-04-09 Stefan Monnier <monnier@iro.umontreal.ca> 4342005-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
81 435
@@ -188,8 +542,7 @@
188 542
1892005-04-08 Kim F. Storm <storm@cua.dk> 5432005-04-08 Kim F. Storm <storm@cua.dk>
190 544
191 * buff-menu.el (Buffer-menu-mode-map): Map follow-link to 545 * buff-menu.el (Buffer-menu-mode-map): Map follow-link to mouse-face.
192 mouse-face.
193 546
194 * mouse.el (mouse-on-link-p): Doc fix. 547 * mouse.el (mouse-on-link-p): Doc fix.
195 548
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index e87ffa6f265..01dbc563bc0 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -1,5 +1,5 @@
1# Maintenance productions for the Lisp directory 1# Maintenance productions for the Lisp directory
2# Copyright (C) 2000, 01, 03, 2004 Free Software Foundation, Inc. 2# Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
3 3
4# This file is part of GNU Emacs. 4# This file is part of GNU Emacs.
5 5
@@ -39,77 +39,6 @@ lisptagsfiles1 = $(lisp)/[a-zA-Z]*.el
39lisptagsfiles2 = $(lisp)/[a-zA-Z]*/[a-zA-Z]*.el 39lisptagsfiles2 = $(lisp)/[a-zA-Z]*/[a-zA-Z]*.el
40ETAGS = ../lib-src/etags 40ETAGS = ../lib-src/etags
41 41
42# Files which should not be compiled. If you change the name `DONTCOMPILE'
43# to something different, you'll have to change make-dist as well, and
44# modify the lists in $lisp and $shortlisp on src/Makefile.in.
45#
46# - emacs-lisp/cl-specs.el: only contains `def-edebug-spec's so there's
47# no point compiling it, although it doesn't hurt.
48
49DONTCOMPILE = \
50 $(lisp)/cus-load.el \
51 $(lisp)/emacs-lisp/cl-specs.el \
52 $(lisp)/eshell/esh-maint.el \
53 $(lisp)/eshell/esh-groups.el \
54 $(lisp)/finder-inf.el \
55 $(lisp)/forms-d2.el \
56 $(lisp)/forms-pass.el \
57 $(lisp)/generic-x.el \
58 $(lisp)/international/latin-1.el \
59 $(lisp)/international/latin-2.el \
60 $(lisp)/international/latin-3.el \
61 $(lisp)/international/latin-4.el \
62 $(lisp)/international/latin-5.el \
63 $(lisp)/international/latin-8.el \
64 $(lisp)/international/latin-9.el \
65 $(lisp)/international/mule-conf.el \
66 $(lisp)/language/czech.el \
67 $(lisp)/language/devanagari.el \
68 $(lisp)/language/malayalam.el \
69 $(lisp)/language/tamil.el \
70 $(lisp)/language/kannada.el \
71 $(lisp)/language/english.el \
72 $(lisp)/language/greek.el \
73 $(lisp)/language/hebrew.el \
74 $(lisp)/language/japanese.el \
75 $(lisp)/language/korean.el \
76 $(lisp)/language/lao.el \
77 $(lisp)/language/misc-lang.el \
78 $(lisp)/language/romanian.el \
79 $(lisp)/language/slovak.el \
80 $(lisp)/language/thai.el \
81 $(lisp)/language/utf-8-lang.el \
82 $(lisp)/language/georgian.el \
83 $(lisp)/loaddefs.el \
84 $(lisp)/ldefs-boot.el \
85 $(lisp)/loadup.el \
86 $(lisp)/mail/blessmail.el \
87 $(lisp)/patcomp.el \
88 $(lisp)/paths.el \
89 $(lisp)/play/bruce.el \
90 $(lisp)/subdirs.el \
91 $(lisp)/term/internal.el \
92 $(lisp)/term/AT386.el \
93 $(lisp)/term/apollo.el \
94 $(lisp)/term/bobcat.el \
95 $(lisp)/term/iris-ansi.el \
96 $(lisp)/term/keyswap.el \
97 $(lisp)/term/linux.el \
98 $(lisp)/term/lk201.el \
99 $(lisp)/term/news.el \
100 $(lisp)/term/vt102.el \
101 $(lisp)/term/vt125.el \
102 $(lisp)/term/vt200.el \
103 $(lisp)/term/vt201.el \
104 $(lisp)/term/vt220.el \
105 $(lisp)/term/vt240.el \
106 $(lisp)/term/vt300.el \
107 $(lisp)/term/vt320.el \
108 $(lisp)/term/vt400.el \
109 $(lisp)/term/vt420.el \
110 $(lisp)/term/wyse50.el \
111 $(lisp)/version.el
112
113# Elisp files auto-generated. 42# Elisp files auto-generated.
114AUTOGENEL = loaddefs.el \ 43AUTOGENEL = loaddefs.el \
115 cus-load.el \ 44 cus-load.el \
@@ -192,7 +121,7 @@ updates: update-subdirs autoloads finder-data custom-deps
192# Update the AUTHORS file. 121# Update the AUTHORS file.
193 122
194update-authors: 123update-authors:
195 $(emacs) -f batch-update-authors $(srcdir)/AUTHORS $(srcdir) 124 $(emacs) -l authors -f batch-update-authors $(srcdir)/AUTHORS $(srcdir)
196 125
197TAGS: $(lisptagsfiles1) $(lisptagsfiles2) 126TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
198 els=`echo $(lisptagsfiles1) $(lisptagsfiles2) | sed -e "s,$(lisp)/loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,,"`; \ 127 els=`echo $(lisptagsfiles1) $(lisptagsfiles2) | sed -e "s,$(lisp)/loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,,"`; \
@@ -207,31 +136,23 @@ TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2)
207.el.elc: $(lisp)/subdirs.el 136.el.elc: $(lisp)/subdirs.el
208 -$(emacs) -f batch-byte-compile $< 137 -$(emacs) -f batch-byte-compile $<
209 138
210$(DONTCOMPILE:.el=.elc): 139# Compile all Lisp files, but don't recompile those that are up to
211 -rm -f $@ 140# date. Some files don't actually get compiled because they set the
212 141# local variable no-byte-compile.
213# Compile all Lisp files, except those from DONTCOMPILE,
214# but don't recompile those that are up to date.
215 142
216# All .elc files are made writable 143# All .elc files are made writable before compilation in case we
217# before compilation in case we checked out read-only (CVS option -r). 144# checked out read-only (CVS option -r). Files MUST be compiled one by
218# Files MUST be compiled one by one. If we compile several files in a 145# one. If we compile several files in a row we can't make sure that
219# row we can't make sure that the compilation environment is clean. 146# the compilation environment is clean. We also set the load-path of
220# We also set the load-path of the Emacs used for compilation to the 147# the Emacs used for compilation to the current directory and its
221# current directory and its subdirectories, to make sure require's and 148# subdirectories, to make sure require's and load's in the files being
222# load's in the files being compiled find the right files. 149# compiled find the right files.
223
224# NOTE about DONTCOMPILE: in the `echo <foo> | sort | uniq -u' we pass
225# $(DONTCOMPILE) twice. This is in case one of the files in DONTCOMPILE
226# is absent. -stef
227 150
228compile: $(lisp)/subdirs.el doit 151compile: $(lisp)/subdirs.el doit
229 find $(lisp) -name "*.elc" -print | xargs chmod +w >/dev/null 2>&1; \ 152 find $(lisp) -name "*.elc" -print | xargs chmod +w >/dev/null 2>&1; \
230 wd=$(lisp); $(setwins); \ 153 wd=$(lisp); $(setwins); \
231 elpat=`echo $$wins | tr ' ' '\012\012' | \ 154 els=`echo $$wins | tr ' \011' '\012\012' | \
232 sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \ 155 sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \
233 els=`echo $$elpat $(DONTCOMPILE) $(DONTCOMPILE) $(COMPILE_FIRST) | \
234 tr ' ' '\012\012' | sort | uniq -u`; \
235 for el in $(COMPILE_FIRST) $$els; do \ 156 for el in $(COMPILE_FIRST) $$els; do \
236 if test -f $$el; \ 157 if test -f $$el; \
237 then \ 158 then \
@@ -240,17 +161,17 @@ compile: $(lisp)/subdirs.el doit
240 fi \ 161 fi \
241 done 162 done
242 163
243# Compile all Lisp files, except those from DONTCOMPILE. This 164# Compile all Lisp files. This is like `compile' but compiles files
244# is like `compile' but compiles files unconditionally. 165# unconditionally. Some files don't actually get compiled because they
166# set the local variable no-byte-compile.
167
245compile-always: $(lisp)/subdirs.el doit 168compile-always: $(lisp)/subdirs.el doit
246 # `|| true' prevents old Bash versions from getting confused 169 # `|| true' prevents old Bash versions from getting confused
247 # by an error. 170 # by an error.
248 find $(lisp) -name "*.elc" -print | xargs chmod +w >/dev/null 2>&1 || true; \ 171 find $(lisp) -name "*.elc" -print | xargs chmod +w >/dev/null 2>&1 || true; \
249 wd=$(lisp); $(setwins); \ 172 wd=$(lisp); $(setwins); \
250 elpat=`echo $$wins | tr ' ' '\012\012' | \ 173 els=`echo $$wins | tr ' \011' '\012\012' | \
251 sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \ 174 sed -e 's|\(.\)$$|\1/|' -e 's|^\./||' -e 's|$$|*.el|'`; \
252 els=`echo $$elpat $(DONTCOMPILE) $(DONTCOMPILE) $(COMPILE_FIRST) | \
253 tr ' ' '\012\012' | sort | uniq -u`; \
254 for el in $(COMPILE_FIRST) $$els; do \ 175 for el in $(COMPILE_FIRST) $$els; do \
255 if test -f $$el; \ 176 if test -f $$el; \
256 then \ 177 then \
diff --git a/lisp/comint.el b/lisp/comint.el
index fe0987e2076..35309f7507a 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1701,7 +1701,10 @@ Make backspaces delete the previous character."
1701 ;; Interpret any carriage motion characters (newline, backspace) 1701 ;; Interpret any carriage motion characters (newline, backspace)
1702 (comint-carriage-motion comint-last-output-start (point))) 1702 (comint-carriage-motion comint-last-output-start (point)))
1703 1703
1704 ;; Run these hooks with point where the user had it.
1705 (goto-char saved-point)
1704 (run-hook-with-args 'comint-output-filter-functions string) 1706 (run-hook-with-args 'comint-output-filter-functions string)
1707 (set-marker saved-point (point))
1705 1708
1706 (goto-char (process-mark process)) ; in case a filter moved it 1709 (goto-char (process-mark process)) ; in case a filter moved it
1707 1710
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 8d440be9b39..93b310fdb17 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -433,6 +433,10 @@
433 "Input from the menus." 433 "Input from the menus."
434 :group 'environment) 434 :group 'environment)
435 435
436(defgroup dnd nil
437 "Handling data from drag and drop."
438 :group 'environment)
439
436(defgroup auto-save nil 440(defgroup auto-save nil
437 "Preventing accidential loss of data." 441 "Preventing accidential loss of data."
438 :group 'files) 442 :group 'files)
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el
index f1001990d3c..41240303037 100644
--- a/lisp/cus-theme.el
+++ b/lisp/cus-theme.el
@@ -119,7 +119,7 @@ It includes all variables in list VARS."
119 (princ " '(") 119 (princ " '(")
120 (prin1 symbol) 120 (prin1 symbol)
121 (princ " ") 121 (princ " ")
122 (prin1 (symbol-value symbol)) 122 (prin1 (custom-quote (symbol-value symbol)))
123 (princ ")"))) 123 (princ ")")))
124 vars) 124 vars)
125 (if (bolp) 125 (if (bolp)
diff --git a/lisp/custom.el b/lisp/custom.el
index 019fdb79b38..f3cbd1404e9 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -287,9 +287,18 @@ The following KEYWORDs are defined:
287 287
288SPEC should be an alist of the form ((DISPLAY ATTS)...). 288SPEC should be an alist of the form ((DISPLAY ATTS)...).
289 289
290The first element of SPEC where the DISPLAY matches the frame 290In the first element, DISPLAY can be :default. The ATTS in that
291is the one that takes effect in that frame. The ATTRs in this 291element then act as defaults for all the following elements.
292element take effect; the other elements are ignored, on that frame. 292
293Aside from that, DISPLAY specifies conditions to match some or
294all frames. For each frame, the first element of SPEC where the
295DISPLAY conditions are satisfied is the one that applies to that
296frame. The ATTRs in this element take effect, and the following
297elements are ignored, on that frame.
298
299In the last element, DISPLAY can be t. That element applies to a
300frame if none of the previous elements (except the :default if
301any) did.
293 302
294ATTS is a list of face attributes followed by their values: 303ATTS is a list of face attributes followed by their values:
295 (ATTR VALUE ATTR VALUE...) 304 (ATTR VALUE ATTR VALUE...)
@@ -298,11 +307,12 @@ The possible attributes are `:family', `:width', `:height', `:weight',
298`:slant', `:underline', `:overline', `:strike-through', `:box', 307`:slant', `:underline', `:overline', `:strike-through', `:box',
299`:foreground', `:background', `:stipple', `:inverse-video', and `:inherit'. 308`:foreground', `:background', `:stipple', `:inverse-video', and `:inherit'.
300 309
301DISPLAY can either be the symbol t, which will match all frames, or an 310DISPLAY can be `:default' (only in the first element), the symbol
302alist of elements of the form \(REQ ITEM...). For the DISPLAY to match a 311t (only in the last element) to match all frames, or an alist of
303FRAME, each of these elements must be satisfied, meaning that the 312conditions of the form \(REQ ITEM...). For such an alist to
304REQ property of the frame must match one of the corresponding ITEMs. 313match a frame, each of the conditions must be satisfied, meaning
305These are the defined REQ values: 314that the REQ property of the frame must match one of the
315corresponding ITEMs. These are the defined REQ values:
306 316
307`type' (the value of `window-system') 317`type' (the value of `window-system')
308 Under X, in addition to the values `window-system' can take, 318 Under X, in addition to the values `window-system' can take,
diff --git a/lisp/dired.el b/lisp/dired.el
index d709b9f89e8..474b4f3d9b5 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1523,15 +1523,13 @@ Keybindings:
1523 (setq dired-switches-alist nil) 1523 (setq dired-switches-alist nil)
1524 (dired-sort-other dired-actual-switches t) 1524 (dired-sort-other dired-actual-switches t)
1525 (run-mode-hooks 'dired-mode-hook) 1525 (run-mode-hooks 'dired-mode-hook)
1526 (when (featurep 'x-dnd) 1526 (when (featurep 'dnd)
1527 (make-variable-buffer-local 'x-dnd-test-function) 1527 (make-variable-buffer-local 'dnd-protocol-alist)
1528 (make-variable-buffer-local 'x-dnd-protocol-alist) 1528 (setq dnd-protocol-alist
1529 (setq x-dnd-test-function 'dired-dnd-test-function)
1530 (setq x-dnd-protocol-alist
1531 (append '(("^file:///" . dired-dnd-handle-local-file) 1529 (append '(("^file:///" . dired-dnd-handle-local-file)
1532 ("^file://" . dired-dnd-handle-file) 1530 ("^file://" . dired-dnd-handle-file)
1533 ("^file:" . dired-dnd-handle-local-file)) 1531 ("^file:" . dired-dnd-handle-local-file))
1534 x-dnd-protocol-alist)))) 1532 dnd-protocol-alist))))
1535 1533
1536;; Idiosyncratic dired commands that don't deal with marks. 1534;; Idiosyncratic dired commands that don't deal with marks.
1537 1535
@@ -3136,18 +3134,6 @@ Anything else means ask for each directory."
3136 (const :tag "Copy directories without asking" always)) 3134 (const :tag "Copy directories without asking" always))
3137 :group 'dired) 3135 :group 'dired)
3138 3136
3139(defun dired-dnd-test-function (window action types)
3140 "The test function for drag and drop into dired buffers.
3141WINDOW is where the mouse is when this function is called. It may be a frame
3142if the mouse is over the menu bar, scroll bar or tool bar.
3143ACTION is the suggested action from the source, and TYPES are the
3144types the drop data can have. This function only accepts drops with
3145types in `x-dnd-known-types'. It returns the action suggested by the source."
3146 (let ((type (x-dnd-choose-type types)))
3147 (if type
3148 (cons action type)
3149 nil)))
3150
3151(defun dired-dnd-popup-notice () 3137(defun dired-dnd-popup-notice ()
3152 (x-popup-dialog 3138 (x-popup-dialog
3153 t 3139 t
@@ -3176,7 +3162,7 @@ types in `x-dnd-known-types'. It returns the action suggested by the source."
3176URI is the file to handle, ACTION is one of copy, move, link or ask. 3162URI is the file to handle, ACTION is one of copy, move, link or ask.
3177Ask means pop up a menu for the user to select one of copy, move or link." 3163Ask means pop up a menu for the user to select one of copy, move or link."
3178 (require 'dired-aux) 3164 (require 'dired-aux)
3179 (let* ((from (x-dnd-get-local-file-name uri t)) 3165 (let* ((from (dnd-get-local-file-name uri t))
3180 (to (if from (concat (dired-current-directory) 3166 (to (if from (concat (dired-current-directory)
3181 (file-name-nondirectory from)) 3167 (file-name-nondirectory from))
3182 nil))) 3168 nil)))
@@ -3214,7 +3200,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
3214URI is the file to handle. If the hostname in the URI isn't local, do nothing. 3200URI is the file to handle. If the hostname in the URI isn't local, do nothing.
3215ACTION is one of copy, move, link or ask. 3201ACTION is one of copy, move, link or ask.
3216Ask means pop up a menu for the user to select one of copy, move or link." 3202Ask means pop up a menu for the user to select one of copy, move or link."
3217 (let ((local-file (x-dnd-get-local-file-uri uri))) 3203 (let ((local-file (dnd-get-local-file-uri uri)))
3218 (if local-file (dired-dnd-handle-local-file local-file action) 3204 (if local-file (dired-dnd-handle-local-file local-file action)
3219 nil))) 3205 nil)))
3220 3206
diff --git a/lisp/dnd.el b/lisp/dnd.el
new file mode 100644
index 00000000000..b6d4d498c95
--- /dev/null
+++ b/lisp/dnd.el
@@ -0,0 +1,192 @@
1;;; dnd.el --- drag and drop support.
2
3;; Copyright (C) 2005
4;; Free Software Foundation, Inc.
5
6;; Author: Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
7;; Maintainer: FSF
8;; Keywords: window, drag, drop
9
10;; This file is part of GNU Emacs.
11
12;; GNU Emacs is free software; you can redistribute it and/or modify
13;; it under the terms of the GNU General Public License as published by
14;; the Free Software Foundation; either version 2, or (at your option)
15;; any later version.
16
17;; GNU Emacs is distributed in the hope that it will be useful,
18;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;; GNU General Public License for more details.
21
22;; You should have received a copy of the GNU General Public License
23;; along with GNU Emacs; see the file COPYING. If not, write to the
24;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25;; Boston, MA 02111-1307, USA.
26
27;;; Commentary:
28
29;; This file provides the generic handling of the drop part only.
30;; Different DND backends (X11, W32, etc.) that handle the platform
31;; specific DND parts call the functions here to do final delivery of
32;; a drop.
33
34;;; Code:
35
36;;; Customizable variables
37
38
39(defcustom dnd-protocol-alist
40 '(
41 ("^file:///" . dnd-open-local-file) ; XDND format.
42 ("^file://" . dnd-open-file) ; URL with host
43 ("^file:" . dnd-open-local-file) ; Old KDE, Motif, Sun
44 )
45
46 "The functions to call for different protocols when a drop is made.
47This variable is used by `dnd-handle-one-url' and `dnd-handle-file-name'.
48The list contains of (REGEXP . FUNCTION) pairs.
49The functions shall take two arguments, URL, which is the URL dropped and
50ACTION which is the action to be performed for the drop (move, copy, link,
51private or ask).
52If no match is found here, and the value of `browse-url-browser-function'
53is a pair of (REGEXP . FUNCTION), those regexps are tried for a match.
54If no match is found, the URL is inserted as text by calling `dnd-insert-text'.
55The function shall return the action done (move, copy, link or private)
56if some action was made, or nil if the URL is ignored."
57 :version "22.1"
58 :type 'alist
59 :group 'dnd)
60
61
62
63(defcustom dnd-open-file-other-window nil
64 "If non-nil, always use find-file-other-window to open dropped files."
65 :version "22.1"
66 :type 'boolean
67 :group 'dnd)
68
69
70;; Functions
71
72(defun dnd-handle-one-url (window action arg)
73 "Handle one dropped url by calling the appropriate handler.
74The handler is first located by looking at `dnd-protocol-alist'.
75If no match is found here, and the value of `browse-url-browser-function'
76is a pair of (REGEXP . FUNCTION), those regexps are tried for a match.
77If no match is found, just call `dnd-insert-text'.
78WINDOW is where the drop happend, ACTION is the action for the drop,
79ARG is the URL that has been dropped.
80Returns ACTION."
81 (require 'browse-url)
82 (let* ((uri (replace-regexp-in-string
83 "%[A-Z0-9][A-Z0-9]"
84 (lambda (arg)
85 (format "%c" (string-to-number (substring arg 1) 16)))
86 arg))
87 ret)
88 (or
89 (catch 'done
90 (dolist (bf dnd-protocol-alist)
91 (when (string-match (car bf) uri)
92 (setq ret (funcall (cdr bf) uri action))
93 (throw 'done t)))
94 nil)
95 (when (not (functionp browse-url-browser-function))
96 (catch 'done
97 (dolist (bf browse-url-browser-function)
98 (when (string-match (car bf) uri)
99 (setq ret 'private)
100 (funcall (cdr bf) uri action)
101 (throw 'done t)))
102 nil))
103 (progn
104 (dnd-insert-text window action uri)
105 (setq ret 'private)))
106 ret))
107
108
109(defun dnd-get-local-file-uri (uri)
110 "Return an uri converted to file:/// syntax if uri is a local file.
111Return nil if URI is not a local file."
112
113 ;; The hostname may be our hostname, in that case, convert to a local
114 ;; file. Otherwise return nil. TODO: How about an IP-address as hostname?
115 (let ((hostname (when (string-match "^file://\\([^/]*\\)" uri)
116 (downcase (match-string 1 uri))))
117 (system-name-no-dot
118 (downcase (if (string-match "^[^\\.]+" system-name)
119 (match-string 0 system-name)
120 system-name))))
121 (when (and hostname
122 (or (string-equal "localhost" hostname)
123 (string-equal (downcase system-name) hostname)
124 (string-equal system-name-no-dot hostname)))
125 (concat "file://" (substring uri (+ 7 (length hostname)))))))
126
127(defun dnd-get-local-file-name (uri &optional must-exist)
128 "Return file name converted from file:/// or file: syntax.
129URI is the uri for the file. If MUST-EXIST is given and non-nil,
130only return non-nil if the file exists.
131Return nil if URI is not a local file."
132 (let ((f (cond ((string-match "^file:///" uri) ; XDND format.
133 (substring uri (1- (match-end 0))))
134 ((string-match "^file:" uri) ; Old KDE, Motif, Sun
135 (substring uri (match-end 0))))))
136 (when (and f must-exist)
137 (let* ((decoded-f (decode-coding-string
138 f
139 (or file-name-coding-system
140 default-file-name-coding-system)))
141 (try-f (if (file-readable-p decoded-f) decoded-f f)))
142 (when (file-readable-p try-f) try-f)))))
143
144
145(defun dnd-open-local-file (uri action)
146 "Open a local file.
147The file is opened in the current window, or a new window if
148`dnd-open-file-other-window' is set. URI is the url for the file,
149and must have the format file:file-name or file:///file-name.
150The last / in file:/// is part of the file name. ACTION is ignored."
151
152 (let* ((f (dnd-get-local-file-name uri t)))
153 (if (and f (file-readable-p f))
154 (progn
155 (if dnd-open-file-other-window
156 (find-file-other-window f)
157 (find-file f))
158 'private)
159 (error "Can not read %s" uri))))
160
161(defun dnd-open-file (uri action)
162 "Open a local or remote file.
163The file is opened in the current window, or a new window if
164`dnd-open-file-other-window' is set. URI is the url for the file,
165and must have the format file://hostname/file-name. ACTION is ignored.
166The last / in file://hostname/ is part of the file name."
167
168 ;; The hostname may be our hostname, in that case, convert to a local
169 ;; file. Otherwise return nil.
170 (let ((local-file (dnd-get-local-file-uri uri)))
171 (if local-file (dnd-open-local-file local-file action)
172 (error "Remote files not supported"))))
173
174
175(defun dnd-insert-text (window action text)
176 "Insert text at point or push to the kill ring if buffer is read only.
177TEXT is the text as a string, WINDOW is the window where the drop happened."
178 (if (or buffer-read-only
179 (not (windowp window)))
180 (progn
181 (kill-new text)
182 (message
183 (substitute-command-keys
184 "The dropped text can be accessed with \\[yank]")))
185 (insert text))
186 action)
187
188
189(provide 'dnd)
190
191;; arch-tag: 0472f6a5-2e8f-4304-9e44-1a0877c771b7
192;;; dnd.el ends here
diff --git a/lisp/generic.el b/lisp/emacs-lisp/generic.el
index bd3a41e4e66..1bfa598a7c7 100644
--- a/lisp/generic.el
+++ b/lisp/emacs-lisp/generic.el
@@ -23,16 +23,11 @@
23;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24;; Boston, MA 02111-1307, USA. 24;; Boston, MA 02111-1307, USA.
25 25
26;; Purpose:
27
28;; Meta-mode to create simple major modes
29;; with basic comment and font-lock support
30
31;;; Commentary: 26;;; Commentary:
32 27
33;; INTRODUCTION: 28;; INTRODUCTION:
34 29;;
35;; Generic-mode is a meta-mode which can be used to define small modes 30;; The macro `define-generic-mode' can be used to define small modes
36;; which provide basic comment and font-lock support. These modes are 31;; which provide basic comment and font-lock support. These modes are
37;; intended for the many configuration files and such which are too 32;; intended for the many configuration files and such which are too
38;; small for a "real" mode, but still have a regular syntax, comment 33;; small for a "real" mode, but still have a regular syntax, comment
@@ -68,20 +63,9 @@
68;; more than this, or you find yourself writing extensive customizations, 63;; more than this, or you find yourself writing extensive customizations,
69;; perhaps you should be writing a major mode instead! 64;; perhaps you should be writing a major mode instead!
70;; 65;;
71;; LOCAL VARIABLES: 66;; EXAMPLE:
72;;
73;; To put a file into generic mode using local variables, use a line
74;; like this in a Local Variables block:
75;; 67;;
76;; mode: default-generic 68;; You can use `define-generic-mode' like this:
77;;
78;; Do NOT use "mode: generic"!
79;; See also "AUTOMATICALLY ENTERING GENERIC MODE" below.
80;;
81;; DEFINING NEW GENERIC MODES:
82;;
83;; Use the `define-generic-mode' function to define new modes.
84;; For example:
85;; 69;;
86;; (define-generic-mode 'foo-generic-mode 70;; (define-generic-mode 'foo-generic-mode
87;; (list ?%) 71;; (list ?%)
@@ -90,35 +74,24 @@
90;; (list "\\.FOO\\'") 74;; (list "\\.FOO\\'")
91;; (list 'foo-setup-function)) 75;; (list 'foo-setup-function))
92;; 76;;
93;; defines a new generic-mode `foo-generic-mode', which has '%' as a 77;; to define a new generic-mode `foo-generic-mode', which has '%' as a
94;; comment character, and "keyword" as a keyword. When files which 78;; comment character, and "keyword" as a keyword. When files which
95;; end in '.FOO' are loaded, Emacs will go into foo-generic-mode and 79;; end in '.FOO' are loaded, Emacs will go into foo-generic-mode and
96;; call foo-setup-function. You can also use the function 80;; call foo-setup-function. You can also use the function
97;; `foo-generic-mode' (which is interactive) to put a buffer into 81;; `foo-generic-mode' (which is interactive) to put a buffer into
98;; foo-generic-mode. 82;; foo-generic-mode.
99;; 83;;
100;; AUTOMATICALLY ENTERING GENERIC MODE:
101;;
102;; Generic-mode provides a hook which automatically puts a file into
103;; default-generic-mode if the first few lines of a file in
104;; fundamental mode start with a hash comment character. To disable
105;; this functionality, set the variable `generic-use-find-file-hook'
106;; to nil BEFORE loading generic-mode. See the variables
107;; `generic-lines-to-scan' and `generic-find-file-regexp' for
108;; customization options.
109;;
110;; GOTCHAS: 84;; GOTCHAS:
111;; 85;;
112;; Be careful that your font-lock definitions are correct. Getting 86;; Be careful that your font-lock definitions are correct. Getting
113;; them wrong can cause Emacs to continually attempt to fontify! This 87;; them wrong can cause Emacs to continually attempt to fontify! This
114;; problem is not specific to generic-mode. 88;; problem is not specific to generic-mode.
115;;
116 89
117;; Credit for suggestions, brainstorming, help with debugging: 90;; Credit for suggestions, brainstorming, help with debugging:
118;; ACorreir@pervasive-sw.com (Alfred Correira) 91;; ACorreir@pervasive-sw.com (Alfred Correira)
119;; Extensive cleanup by: 92;; Extensive cleanup by:
120;; Stefan Monnier (monnier+gnu/emacs@flint.cs.yale.edu) 93;; Stefan Monnier (monnier+gnu/emacs@flint.cs.yale.edu)
121;; 94
122;;; Code: 95;;; Code:
123 96
124;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 97;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -138,47 +111,6 @@ Do not add entries to this list directly; use `define-generic-mode'
138instead (which see).") 111instead (which see).")
139 112
140;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 113;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
141;; Customization Variables
142;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
143
144(defgroup generic nil
145 "Define simple major modes with comment and font-lock support."
146 :prefix "generic-"
147 :group 'extensions)
148
149(defcustom generic-use-find-file-hook t
150 "*If non-nil, add a hook to enter `default-generic-mode' automatically.
151This is done if the first few lines of a file in fundamental mode
152start with a hash comment character."
153 :group 'generic
154 :type 'boolean)
155
156(defcustom generic-lines-to-scan 3
157 "*Number of lines that `generic-mode-find-file-hook' looks at.
158Relevant when deciding whether to enter Default-Generic mode automatically.
159This variable should be set to a small positive number."
160 :group 'generic
161 :type 'integer)
162
163(defcustom generic-find-file-regexp "^#"
164 "*Regular expression used by `generic-mode-find-file-hook'.
165Files in fundamental mode whose first few lines contain a match
166for this regexp, should be put into Default-Generic mode instead.
167The number of lines tested for the matches is specified by the
168value of the variable `generic-lines-to-scan', which see."
169 :group 'generic
170 :type 'regexp)
171
172(defcustom generic-ignore-files-regexp "[Tt][Aa][Gg][Ss]\\'"
173 "*Regular expression used by `generic-mode-find-file-hook'.
174Files whose names match this regular expression should not be put
175into Default-Generic mode, even if they have lines which match
176the regexp in `generic-find-file-regexp'. If the value is nil,
177`generic-mode-find-file-hook' does not check the file names."
178 :group 'generic
179 :type '(choice (const :tag "Don't check file names" nil) regexp))
180
181;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
182;; Functions 114;; Functions
183;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 115;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
184 116
@@ -290,12 +222,10 @@ See the file generic-x.el for some examples of `define-generic-mode'."
290 ;; Font-lock functionality. 222 ;; Font-lock functionality.
291 ;; Font-lock-defaults is always set even if there are no keywords 223 ;; Font-lock-defaults is always set even if there are no keywords
292 ;; or font-lock expressions, so comments can be highlighted. 224 ;; or font-lock expressions, so comments can be highlighted.
293 (setq generic-font-lock-keywords 225 (setq generic-font-lock-keywords font-lock-list)
294 (append 226 (when keyword-list
295 (when keyword-list 227 (push (concat "\\_<" (regexp-opt keyword-list t) "\\_>")
296 (list (generic-make-keywords-list keyword-list 228 generic-font-lock-keywords))
297 font-lock-keyword-face)))
298 font-lock-list))
299 (setq font-lock-defaults '(generic-font-lock-keywords nil)) 229 (setq font-lock-defaults '(generic-font-lock-keywords nil))
300 230
301 ;; Call a list of functions 231 ;; Call a list of functions
@@ -391,60 +321,20 @@ Some generic modes are defined in `generic-x.el'."
391 '((nil "^\\[\\(.*\\)\\]" 1)) 321 '((nil "^\\[\\(.*\\)\\]" 1))
392 imenu-case-fold-search t)) 322 imenu-case-fold-search t))
393 323
394;; This generic mode is always defined
395(define-generic-mode default-generic-mode (list ?#) nil nil nil nil :group 'generic)
396
397;; A more general solution would allow us to enter generic-mode for
398;; *any* comment character, but would require us to synthesize a new
399;; generic-mode on the fly. I think this gives us most of what we
400;; want.
401(defun generic-mode-find-file-hook ()
402 "Hook function to enter Default-Generic mode automatically.
403
404Done if the first few lines of a file in Fundamental mode start
405with a match for the regexp in `generic-find-file-regexp', unless
406the file's name matches the regexp which is the value of the
407variable `generic-ignore-files-regexp'.
408
409This hook will be installed if the variable
410`generic-use-find-file-hook' is non-nil. The variable
411`generic-lines-to-scan' determines the number of lines to look at."
412 (when (and (eq major-mode 'fundamental-mode)
413 (or (null generic-ignore-files-regexp)
414 (not (string-match
415 generic-ignore-files-regexp
416 (file-name-sans-versions buffer-file-name)))))
417 (save-excursion
418 (goto-char (point-min))
419 (when (re-search-forward generic-find-file-regexp
420 (save-excursion
421 (forward-line generic-lines-to-scan)
422 (point)) t)
423 (goto-char (point-min))
424 (default-generic-mode)))))
425
426(defun generic-mode-ini-file-find-file-hook ()
427 "Hook function to enter Default-Generic mode automatically for INI files.
428Done if the first few lines of a file in Fundamental mode look like an
429INI file. This hook is NOT installed by default."
430 (and (eq major-mode 'fundamental-mode)
431 (save-excursion
432 (goto-char (point-min))
433 (and (looking-at "^\\s-*\\[.*\\]")
434 (ini-generic-mode)))))
435
436(and generic-use-find-file-hook
437 (add-hook 'find-file-hook 'generic-mode-find-file-hook))
438
439;;;###autoload 324;;;###autoload
440(defun generic-make-keywords-list (keywords-list face &optional prefix suffix) 325(defun generic-make-keywords-list (keyword-list face &optional prefix suffix)
441 "Return a regular expression matching the specified KEYWORDS-LIST. 326 "Return a `font-lock-keywords' construct that highlights KEYWORD-LIST.
442The regexp is highlighted with FACE." 327KEYWORD-LIST is a list of keyword strings that should be
443 (unless (listp keywords-list) 328highlighted with face FACE. This function calculates a regular
329expression that matches these keywords and concatenates it with
330PREFIX and SUFFIX. Then it returns a construct based on this
331regular expression that can be used as an element of
332`font-lock-keywords'."
333 (unless (listp keyword-list)
444 (error "Keywords argument must be a list of strings")) 334 (error "Keywords argument must be a list of strings"))
445 (list (concat prefix "\\_<" 335 (list (concat prefix "\\_<"
446 ;; Use an optimized regexp. 336 ;; Use an optimized regexp.
447 (regexp-opt keywords-list t) 337 (regexp-opt keyword-list t)
448 "\\_>" suffix) 338 "\\_>" suffix)
449 1 339 1
450 face)) 340 face))
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index 8852999db2d..77e8f636931 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -384,11 +384,15 @@ and after the region marked by the rectangle to search."
384 :type 'boolean 384 :type 'boolean
385 :group 'cua) 385 :group 'cua)
386 386
387(defface cua-rectangle-face 'nil 387(defface cua-rectangle-face
388 '((default :inherit region)
389 (((class color)) :foreground "white" :background "maroon"))
388 "*Font used by CUA for highlighting the rectangle." 390 "*Font used by CUA for highlighting the rectangle."
389 :group 'cua) 391 :group 'cua)
390 392
391(defface cua-rectangle-noselect-face 'nil 393(defface cua-rectangle-noselect-face
394 '((default :inherit region)
395 (((class color)) :foreground "white" :background "dimgray"))
392 "*Font used by CUA for highlighting the non-selected rectangle lines." 396 "*Font used by CUA for highlighting the non-selected rectangle lines."
393 :group 'cua) 397 :group 'cua)
394 398
@@ -400,10 +404,10 @@ and after the region marked by the rectangle to search."
400 :type 'boolean 404 :type 'boolean
401 :group 'cua) 405 :group 'cua)
402 406
403(defface cua-global-mark-face '((((class color)) 407(defface cua-global-mark-face
404 :foreground "black" 408 '((((min-colors 88)(class color)) :foreground "black" :background "yellow1")
405 :background "yellow") 409 (((class color)) :foreground "black" :background "yellow")
406 (t :bold t)) 410 (t :bold t))
407 "*Font used by CUA for highlighting the global mark." 411 "*Font used by CUA for highlighting the global mark."
408 :group 'cua) 412 :group 'cua)
409 413
diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el
index bfb51694db4..5c24c2dc36f 100644
--- a/lisp/emulation/cua-rect.el
+++ b/lisp/emulation/cua-rect.el
@@ -1402,16 +1402,6 @@ With prefix arg, indent to that column."
1402 (cua--M/H-key cua--rectangle-keymap key cmd)) 1402 (cua--M/H-key cua--rectangle-keymap key cmd))
1403 1403
1404(defun cua--init-rectangles () 1404(defun cua--init-rectangles ()
1405 (unless (face-background 'cua-rectangle-face)
1406 (copy-face 'region 'cua-rectangle-face)
1407 (set-face-background 'cua-rectangle-face "maroon")
1408 (set-face-foreground 'cua-rectangle-face "white"))
1409
1410 (unless (face-background 'cua-rectangle-noselect-face)
1411 (copy-face 'region 'cua-rectangle-noselect-face)
1412 (set-face-background 'cua-rectangle-noselect-face "dimgray")
1413 (set-face-foreground 'cua-rectangle-noselect-face "white"))
1414
1415 (unless (eq cua-use-hyper-key 'only) 1405 (unless (eq cua-use-hyper-key 'only)
1416 (define-key cua--rectangle-keymap [(shift return)] 'cua-clear-rectangle-mark) 1406 (define-key cua--rectangle-keymap [(shift return)] 'cua-clear-rectangle-mark)
1417 (define-key cua--region-keymap [(shift return)] 'cua-toggle-rectangle-mark)) 1407 (define-key cua--region-keymap [(shift return)] 'cua-toggle-rectangle-mark))
diff --git a/lisp/faces.el b/lisp/faces.el
index 2d94c28c9f4..e7940e209b9 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2045,7 +2045,7 @@ Note: Other faces cannot inherit from the cursor face."
2045 2045
2046(defface secondary-selection 2046(defface secondary-selection
2047 '((((class color) (min-colors 88) (background light)) 2047 '((((class color) (min-colors 88) (background light))
2048 :background "yellow") 2048 :background "yellow1")
2049 (((class color) (min-colors 88) (background dark)) 2049 (((class color) (min-colors 88) (background dark))
2050 :background "SkyBlue4") 2050 :background "SkyBlue4")
2051 (((class color) (min-colors 16) (background light)) 2051 (((class color) (min-colors 16) (background light))
@@ -2071,9 +2071,9 @@ Note: Other faces cannot inherit from the cursor face."
2071 2071
2072(defface trailing-whitespace 2072(defface trailing-whitespace
2073 '((((class color) (background light)) 2073 '((((class color) (background light))
2074 :background "red") 2074 :background "red1")
2075 (((class color) (background dark)) 2075 (((class color) (background dark))
2076 :background "red") 2076 :background "red1")
2077 (t :inverse-video t)) 2077 (t :inverse-video t))
2078 "Basic face for highlighting trailing whitespace." 2078 "Basic face for highlighting trailing whitespace."
2079 :version "21.1" 2079 :version "21.1"
diff --git a/lisp/files.el b/lisp/files.el
index f278725cd5d..c8f30138ab1 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1844,8 +1844,8 @@ in that case, this function acts as if `enable-local-variables' were t."
1844 ("\\.properties\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-javaprop-mode) 1844 ("\\.properties\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-javaprop-mode)
1845 ;; *.cf, *.cfg, *.conf, *.config[.local|.de_DE.UTF8|...], */config 1845 ;; *.cf, *.cfg, *.conf, *.config[.local|.de_DE.UTF8|...], */config
1846 ("[/.]c\\(?:on\\)?f\\(?:i?g\\)?\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-mode) 1846 ("[/.]c\\(?:on\\)?f\\(?:i?g\\)?\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-mode)
1847 ("\\`/etc/\\(?:DIR_COLORS\\|ethers\\|.?fstab\\|.*hosts\\|lesskey\\|login\\.?de\\(?:fs\\|vperm\\)\\|magic\\|mtab\\|pam\\.d/.*\\|permissions\\|protocols\\|rpc\\|services\\)\\'" . conf-space-mode) 1847 ("\\`/etc/\\(?:DIR_COLORS\\|ethers\\|.?fstab\\|.*hosts\\|lesskey\\|login\\.?de\\(?:fs\\|vperm\\)\\|magic\\|mtab\\|pam\\.d/.*\\|permissions\\(?:\\.d/.+\\)?\\|protocols\\|rpc\\|services\\)\\'" . conf-space-mode)
1848 ("\\`/etc/\\(?:acpid?/.+\\|aliases\\|default/.+\\|group-?\\|hosts\\..+\\|inittab\\|ksysguarddrc\\|opera6rc\\|passwd-?\\|shadow-?\\)\\'" . conf-mode) 1848 ("\\`/etc/\\(?:acpid?/.+\\|aliases\\(?:\\.d/.+\\)?\\|default/.+\\|group-?\\|hosts\\..+\\|inittab\\|ksysguarddrc\\|opera6rc\\|passwd-?\\|shadow-?\\|sysconfig/.+\\)\\'" . conf-mode)
1849 ;; either user's dot-files or under /etc or some such 1849 ;; either user's dot-files or under /etc or some such
1850 ("/\\.?\\(?:gnokiirc\\|kde.*rc\\|mime\\.types\\|wgetrc\\)\\'" . conf-mode) 1850 ("/\\.?\\(?:gnokiirc\\|kde.*rc\\|mime\\.types\\|wgetrc\\)\\'" . conf-mode)
1851 ;; alas not all ~/.*rc files are like this 1851 ;; alas not all ~/.*rc files are like this
diff --git a/lisp/filesets.el b/lisp/filesets.el
index 5a4dd7bda9a..9d60f20316f 100644
--- a/lisp/filesets.el
+++ b/lisp/filesets.el
@@ -1794,8 +1794,17 @@ User will be queried, if no fileset name is provided."
1794 (name (or name 1794 (name (or name
1795 (completing-read 1795 (completing-read
1796 (format "Add '%s' to fileset: " buffer) 1796 (format "Add '%s' to fileset: " buffer)
1797 filesets-data nil t))) 1797 filesets-data nil)))
1798 (entry (assoc name filesets-data))) 1798 (entry (or (assoc name filesets-data)
1799 (when (y-or-n-p
1800 (format "Fileset %s does not exist. Create it?"
1801 name))
1802 (progn
1803 (add-to-list 'filesets-data (list name '(:files)))
1804 (message
1805 "Fileset %s created. Call `M-x filesets-save-config' to save."
1806 name)
1807 (car filesets-data))))))
1799 (if entry 1808 (if entry
1800 (let* ((files (filesets-entry-get-files entry)) 1809 (let* ((files (filesets-entry-get-files entry))
1801 (this (buffer-file-name buffer)) 1810 (this (buffer-file-name buffer))
diff --git a/lisp/generic-x.el b/lisp/generic-x.el
index 9191c39e553..a13103edb3d 100644
--- a/lisp/generic-x.el
+++ b/lisp/generic-x.el
@@ -41,6 +41,16 @@
41;; You can also send in new modes; if the file types a reasonably common, 41;; You can also send in new modes; if the file types a reasonably common,
42;; we would like to install them. 42;; we would like to install them.
43;; 43;;
44;; DEFAULT GENERIC MODE:
45;;
46;; This file provides a hook which automatically puts a file into
47;; `default-generic-mode' if the first few lines of a file in
48;; fundamental mode start with a hash comment character. To disable
49;; this functionality, set the variable `generic-use-find-file-hook'
50;; to nil BEFORE loading generic-x. See the variables
51;; `generic-lines-to-scan' and `generic-find-file-regexp' for
52;; customization options.
53;;
44;; PROBLEMS WHEN USED WITH FOLDING MODE: 54;; PROBLEMS WHEN USED WITH FOLDING MODE:
45;; 55;;
46;; [The following relates to the obsolete selective-display technique. 56;; [The following relates to the obsolete selective-display technique.
@@ -95,11 +105,86 @@
95(require 'font-lock) 105(require 'font-lock)
96 106
97(defgroup generic-x nil 107(defgroup generic-x nil
98 "Extra modes for generic mode." 108 "A collection of generic modes."
99 :prefix "generic-" 109 :prefix "generic-"
100 :group 'generic 110 :group 'data
101 :version "20.3") 111 :version "20.3")
102 112
113;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
114;; Default-Generic mode
115;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
116
117(defcustom generic-use-find-file-hook t
118 "*If non-nil, add a hook to enter `default-generic-mode' automatically.
119This is done if the first few lines of a file in fundamental mode
120start with a hash comment character."
121 :group 'generic-x
122 :type 'boolean)
123
124(defcustom generic-lines-to-scan 3
125 "*Number of lines that `generic-mode-find-file-hook' looks at.
126Relevant when deciding whether to enter Default-Generic mode automatically.
127This variable should be set to a small positive number."
128 :group 'generic-x
129 :type 'integer)
130
131(defcustom generic-find-file-regexp "^#"
132 "*Regular expression used by `generic-mode-find-file-hook'.
133Files in fundamental mode whose first few lines contain a match
134for this regexp, should be put into Default-Generic mode instead.
135The number of lines tested for the matches is specified by the
136value of the variable `generic-lines-to-scan', which see."
137 :group 'generic-x
138 :type 'regexp)
139
140(defcustom generic-ignore-files-regexp "[Tt][Aa][Gg][Ss]\\'"
141 "*Regular expression used by `generic-mode-find-file-hook'.
142Files whose names match this regular expression should not be put
143into Default-Generic mode, even if they have lines which match
144the regexp in `generic-find-file-regexp'. If the value is nil,
145`generic-mode-find-file-hook' does not check the file names."
146 :group 'generic-x
147 :type '(choice (const :tag "Don't check file names" nil) regexp))
148
149;; This generic mode is always defined
150(define-generic-mode default-generic-mode (list ?#) nil nil nil nil :group 'generic)
151
152;; A more general solution would allow us to enter generic-mode for
153;; *any* comment character, but would require us to synthesize a new
154;; generic-mode on the fly. I think this gives us most of what we
155;; want.
156(defun generic-mode-find-file-hook ()
157 "Hook function to enter Default-Generic mode automatically.
158
159Done if the first few lines of a file in Fundamental mode start
160with a match for the regexp in `generic-find-file-regexp', unless
161the file's name matches the regexp which is the value of the
162variable `generic-ignore-files-regexp'.
163
164This hook will be installed if the variable
165`generic-use-find-file-hook' is non-nil. The variable
166`generic-lines-to-scan' determines the number of lines to look at."
167 (when (and (eq major-mode 'fundamental-mode)
168 (or (null generic-ignore-files-regexp)
169 (not (string-match
170 generic-ignore-files-regexp
171 (file-name-sans-versions buffer-file-name)))))
172 (save-excursion
173 (goto-char (point-min))
174 (when (re-search-forward generic-find-file-regexp
175 (save-excursion
176 (forward-line generic-lines-to-scan)
177 (point)) t)
178 (goto-char (point-min))
179 (default-generic-mode)))))
180
181(and generic-use-find-file-hook
182 (add-hook 'find-file-hook 'generic-mode-find-file-hook))
183
184;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
185;; Other Generic modes
186;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
187
103(defcustom generic-extras-enable-list nil 188(defcustom generic-extras-enable-list nil
104 "*List of generic modes to enable by default. 189 "*List of generic modes to enable by default.
105Each entry in the list should be a symbol. The variables 190Each entry in the list should be a symbol. The variables
@@ -150,10 +235,6 @@ generic-x to enable the specified modes."
150 etc-fstab-generic-mode) 235 etc-fstab-generic-mode)
151 generic-extras-enable-list))) 236 generic-extras-enable-list)))
152 237
153;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
154;; Generic-modes
155;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
156
157;;; Apache 238;;; Apache
158(when (memq 'apache-conf-generic-mode generic-extras-enable-list) 239(when (memq 'apache-conf-generic-mode generic-extras-enable-list)
159 240
@@ -284,8 +365,21 @@ generic-x to enable the specified modes."
284 (setq imenu-generic-expression 365 (setq imenu-generic-expression
285 '((nil "^\\[\\(.*\\)\\]" 1) 366 '((nil "^\\[\\(.*\\)\\]" 1)
286 ("*Variables*" "^\\s-*\\([^=]+\\)\\s-*=" 1)))))) 367 ("*Variables*" "^\\s-*\\([^=]+\\)\\s-*=" 1))))))
287 "Generic mode for MS-Windows INI files." 368 "Generic mode for MS-Windows INI files.
288 :group 'generic-x)) 369You can use `ini-generic-mode-find-file-hook' to enter this mode
370automatically for INI files whose names do not end in \".ini\"."
371 :group 'generic-x)
372
373(defun ini-generic-mode-find-file-hook ()
374 "Hook function to enter Ini-Generic mode automatically for INI files.
375Done if the first few lines of a file in Fundamental mode look
376like an INI file. You can add this hook to `find-file-hook'."
377 (and (eq major-mode 'fundamental-mode)
378 (save-excursion
379 (goto-char (point-min))
380 (and (looking-at "^\\s-*\\[.*\\]")
381 (ini-generic-mode)))))
382(defalias 'generic-mode-ini-file-find-file-hook 'ini-generic-mode-find-file-hook))
289 383
290;;; Windows REG files 384;;; Windows REG files
291;;; Unfortunately, Windows 95 and Windows NT have different REG file syntax! 385;;; Unfortunately, Windows 95 and Windows NT have different REG file syntax!
@@ -396,6 +490,7 @@ generic-x to enable the specified modes."
396 (compile 490 (compile
397 (concat (w32-shell-name) " -c " (buffer-file-name))))) 491 (concat (w32-shell-name) " -c " (buffer-file-name)))))
398 492
493(eval-when-compile (require 'comint))
399(defun bat-generic-mode-run-as-comint () 494(defun bat-generic-mode-run-as-comint ()
400 "Run the current BAT file in a comint buffer." 495 "Run the current BAT file in a comint buffer."
401 (interactive) 496 (interactive)
@@ -785,7 +880,7 @@ generic-x to enable the specified modes."
785 '("^#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?" 880 '("^#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?"
786 (1 font-lock-constant-face) 881 (1 font-lock-constant-face)
787 (2 font-lock-variable-name-face nil t)))) 882 (2 font-lock-variable-name-face nil t))))
788 '("\\.[rR][cC]$") 883 '("\\.[rR][cC]\\'")
789 nil 884 nil
790 "Generic mode for MS-Windows Resource files." 885 "Generic mode for MS-Windows Resource files."
791 :group 'generic-x)) 886 :group 'generic-x))
@@ -1406,7 +1501,7 @@ generic-x to enable the specified modes."
1406 (generic-make-keywords-list 1501 (generic-make-keywords-list
1407 installshield-funarg-constants-list 1502 installshield-funarg-constants-list
1408 font-lock-variable-name-face "[^_]" "[^_]"))) ; is this face the best choice? 1503 font-lock-variable-name-face "[^_]" "[^_]"))) ; is this face the best choice?
1409 '("\\.[rR][uU][lL]$") 1504 '("\\.[rR][uU][lL]\\'")
1410 '(generic-rul-mode-setup-function) 1505 '(generic-rul-mode-setup-function)
1411 "Generic mode for InstallShield RUL files." 1506 "Generic mode for InstallShield RUL files."
1412 :group 'generic-x) 1507 :group 'generic-x)
@@ -1584,8 +1679,8 @@ generic-x to enable the specified modes."
1584 "auto" 1679 "auto"
1585 "ignore") 1680 "ignore")
1586 '(("^\\([/-A-Za-z0-9_]+\\)\\s-+\\([/-A-Za-z0-9_]+\\)" 1681 '(("^\\([/-A-Za-z0-9_]+\\)\\s-+\\([/-A-Za-z0-9_]+\\)"
1587 (1 font-lock-type-face) 1682 (1 font-lock-type-face t)
1588 (2 font-lock-variable-name-face))) 1683 (2 font-lock-variable-name-face t)))
1589 '("/etc/[v]*fstab\\'") 1684 '("/etc/[v]*fstab\\'")
1590 (list 1685 (list
1591 (function 1686 (function
@@ -1667,7 +1762,7 @@ generic-x to enable the specified modes."
1667 ;; List of additional font-lock-expressions 1762 ;; List of additional font-lock-expressions
1668 '(("\\([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\\)" 1 font-lock-constant-face) 1763 '(("\\([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\\)" 1 font-lock-constant-face)
1669 ("^\\([.A-Za-z0-9]+\\)" 1 font-lock-variable-name-face)) 1764 ("^\\([.A-Za-z0-9]+\\)" 1 font-lock-variable-name-face))
1670 ;; List of additional automode-alist expressions 1765 ;; List of additional auto-mode-alist expressions
1671 nil 1766 nil
1672 ;; List of set up functions to call 1767 ;; List of set up functions to call
1673 nil 1768 nil
@@ -1688,7 +1783,7 @@ generic-x to enable the specified modes."
1688 '("nameserver" "domain" "search" "sortlist" "options") 1783 '("nameserver" "domain" "search" "sortlist" "options")
1689 ;; List of additional font-lock-expressions 1784 ;; List of additional font-lock-expressions
1690 nil 1785 nil
1691 ;; List of additional automode-alist expressions 1786 ;; List of additional auto-mode-alist expressions
1692 '("/etc/resolv[e]?.conf\\'") 1787 '("/etc/resolv[e]?.conf\\'")
1693 ;; List of set up functions to call 1788 ;; List of set up functions to call
1694 nil 1789 nil
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 052a7fdf5fc..2ec1e0bc62e 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,8 +1,32 @@
12005-04-13 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus-art.el (gnus-mime-inline-part): Use mm-string-to-multibyte.
4 * qp.el (quoted-printable-encode-region): Use mm-string-to-multibyte.
5
62005-04-13 Miles Bader <miles@gnu.org>
7
8 * mm-util.el (mm-string-to-multibyte): Use Gnus trunk definition.
9
102005-04-12 Katsumi Yamaoka <yamaoka@jpl.org>
11
12 * nnrss.el (nnrss-node-text): Replace CRLFs (which might be
13 contained in text because xml.el decodes entities) with LFs.
14
152005-04-11 Lute Kamstra <lute@gnu.org>
16
17 * message.el (message-make-date): Handle byte-compiler warnings
18 differently.
19 * nnimap.el (nnimap-date-days-ago): Ditto.
20
12005-04-10 Stefan Monnier <monnier@iro.umontreal.ca> 212005-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
2 22
3 * mm-util.el (mm-string-to-multibyte): New function. 23 * mm-util.el (mm-string-to-multibyte): New function.
4 (mm-detect-coding-region): Typo. 24 (mm-detect-coding-region): Typo.
5 25
262005-04-11 Katsumi Yamaoka <yamaoka@jpl.org>
27
28 * gnus-art.el (gnus-article-read-summary-keys): Fix misplaced parens.
29
62005-04-06 Katsumi Yamaoka <yamaoka@jpl.org> 302005-04-06 Katsumi Yamaoka <yamaoka@jpl.org>
7 31
8 * mm-util.el (mm-coding-system-p): Don't return binary for the nil 32 * mm-util.el (mm-coding-system-p): Don't return binary for the nil
@@ -526,9 +550,6 @@
526 550
5272004-11-26 Katsumi Yamaoka <yamaoka@jpl.org> 5512004-11-26 Katsumi Yamaoka <yamaoka@jpl.org>
528 552
529 * lpath.el: Remove bbdb-create-internal, bbdb-records,
530 spam-BBDB-register-routine and spam-enter-ham-BBDB.
531
532 * nnrss.el (nnrss-string-as-multibyte): Redefine it as a macro in 553 * nnrss.el (nnrss-string-as-multibyte): Redefine it as a macro in
533 order to silence the byte compiler. 554 order to silence the byte compiler.
534 555
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 9d09e58fd31..30ac3c6ccd8 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -4358,21 +4358,16 @@ are decompressed."
4358 (mm-read-coding-system "Charset: ")))) 4358 (mm-read-coding-system "Charset: "))))
4359 (t 4359 (t
4360 (if (mm-handle-undisplayer handle) 4360 (if (mm-handle-undisplayer handle)
4361 (mm-remove-part handle)) 4361 (mm-remove-part handle))))
4362 (setq contents
4363 (if (fboundp 'string-to-multibyte)
4364 (string-to-multibyte contents)
4365 (mapconcat
4366 (lambda (ch) (mm-string-as-multibyte (char-to-string ch)))
4367 contents "")))))
4368 (forward-line 2) 4362 (forward-line 2)
4369 (mm-insert-inline handle 4363 (mm-insert-inline
4370 (if (and charset 4364 handle
4371 (setq charset (mm-charset-to-coding-system 4365 (if (and charset
4372 charset)) 4366 (setq charset (mm-charset-to-coding-system
4373 (not (eq charset 'ascii))) 4367 charset))
4374 (mm-decode-coding-string contents charset) 4368 (not (eq charset 'ascii)))
4375 contents)) 4369 (mm-decode-coding-string contents charset)
4370 (mm-string-to-multibyte contents)))
4376 (goto-char b))))) 4371 (goto-char b)))))
4377 4372
4378(defun gnus-mime-view-part-as-charset (&optional handle arg) 4373(defun gnus-mime-view-part-as-charset (&optional handle arg)
@@ -5309,7 +5304,7 @@ not have a face in `gnus-article-boring-faces'."
5309 (when (eq win (selected-window)) 5304 (when (eq win (selected-window))
5310 (setq new-sum-point (point) 5305 (setq new-sum-point (point)
5311 new-sum-start (window-start win) 5306 new-sum-start (window-start win)
5312 new-sum-hscroll (window-hscroll win)) 5307 new-sum-hscroll (window-hscroll win)))
5313 (when (eq in-buffer (current-buffer)) 5308 (when (eq in-buffer (current-buffer))
5314 (setq selected (gnus-summary-select-article)) 5309 (setq selected (gnus-summary-select-article))
5315 (set-buffer obuf) 5310 (set-buffer obuf)
@@ -5325,7 +5320,7 @@ not have a face in `gnus-article-boring-faces'."
5325 new-sum-point) 5320 new-sum-point)
5326 (set-window-point win new-sum-point) 5321 (set-window-point win new-sum-point)
5327 (set-window-start win new-sum-start) 5322 (set-window-start win new-sum-start)
5328 (set-window-hscroll win new-sum-hscroll))))) 5323 (set-window-hscroll win new-sum-hscroll))))
5329 (set-window-configuration owin) 5324 (set-window-configuration owin)
5330 (ding)))))) 5325 (ding))))))
5331 5326
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 0722ec1177b..c07b6c34d3c 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -4564,12 +4564,11 @@ Otherwise, generate and save a value for `canlock-password' first."
4564 (when (re-search-forward ",+$" nil t) 4564 (when (re-search-forward ",+$" nil t)
4565 (replace-match "" t t)))))) 4565 (replace-match "" t t))))))
4566 4566
4567(eval-when-compile (require 'parse-time))
4567(defun message-make-date (&optional now) 4568(defun message-make-date (&optional now)
4568 "Make a valid data header. 4569 "Make a valid data header.
4569If NOW, use that time instead." 4570If NOW, use that time instead."
4570 (require 'parse-time) 4571 (require 'parse-time)
4571 (defvar parse-time-weekdays)
4572 (defvar parse-time-months)
4573 (let* ((now (or now (current-time))) 4572 (let* ((now (or now (current-time)))
4574 (zone (nth 8 (decode-time now))) 4573 (zone (nth 8 (decode-time now)))
4575 (sign "+")) 4574 (sign "+"))
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index 0ee52e797d0..6fe69f2edd5 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -91,7 +91,12 @@
91 ;; (string-to-multibyte s) ~= (decode-coding-string s 'binary) 91 ;; (string-to-multibyte s) ~= (decode-coding-string s 'binary)
92 ;; (string-make-multibyte s) ~= (decode-coding-string s locale-coding-system) 92 ;; (string-make-multibyte s) ~= (decode-coding-string s locale-coding-system)
93 (string-as-multibyte . identity) 93 (string-as-multibyte . identity)
94 (string-to-multibyte . mm-string-as-multibyte) 94 (string-to-multibyte
95 . (lambda (string)
96 "Return a multibyte string with the same individual chars as string."
97 (mapconcat
98 (lambda (ch) (mm-string-as-multibyte (char-to-string ch)))
99 string "")))
95 (multibyte-string-p . ignore) 100 (multibyte-string-p . ignore)
96 ;; It is not a MIME function, but some MIME functions use it. 101 ;; It is not a MIME function, but some MIME functions use it.
97 (make-temp-file . (lambda (prefix &optional dir-flag) 102 (make-temp-file . (lambda (prefix &optional dir-flag)
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index d7cec7a864f..31d96cdd375 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -1386,10 +1386,10 @@ function is generally only called when Gnus is shutting down."
1386 (list (- ms 1) (+ (expt 2 16) ls)) 1386 (list (- ms 1) (+ (expt 2 16) ls))
1387 (list ms ls)))) 1387 (list ms ls))))
1388 1388
1389(eval-when-compile (require 'parse-time))
1389(defun nnimap-date-days-ago (daysago) 1390(defun nnimap-date-days-ago (daysago)
1390 "Return date, in format \"3-Aug-1998\", for DAYSAGO days ago." 1391 "Return date, in format \"3-Aug-1998\", for DAYSAGO days ago."
1391 (require 'parse-time) 1392 (require 'parse-time)
1392 (defvar parse-time-months)
1393 (let* ((time (nnimap-time-substract (current-time) (days-to-time daysago))) 1393 (let* ((time (nnimap-time-substract (current-time) (days-to-time daysago)))
1394 (date (format-time-string 1394 (date (format-time-string
1395 (format "%%d-%s-%%Y" 1395 (format "%%d-%s-%%Y"
diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el
index 006e309c3ff..04bebec79a6 100644
--- a/lisp/gnus/nnrss.el
+++ b/lisp/gnus/nnrss.el
@@ -679,8 +679,11 @@ It is useful when `(setq nnrss-use-local t)'."
679 (text (if (and node (listp node)) 679 (text (if (and node (listp node))
680 (nnrss-node-just-text node) 680 (nnrss-node-just-text node)
681 node)) 681 node))
682 (cleaned-text (if text (gnus-replace-in-string 682 (cleaned-text (if text
683 text "^[\000-\037\177]+\\|^ +\\| +$" "")))) 683 (gnus-replace-in-string
684 (gnus-replace-in-string
685 text "^[\000-\037\177]+\\|^ +\\| +$" "")
686 "\r\n" "\n"))))
684 (if (string-equal "" cleaned-text) 687 (if (string-equal "" cleaned-text)
685 nil 688 nil
686 cleaned-text))) 689 cleaned-text)))
diff --git a/lisp/gnus/qp.el b/lisp/gnus/qp.el
index 6a27b20eb1e..3789e0efda8 100644
--- a/lisp/gnus/qp.el
+++ b/lisp/gnus/qp.el
@@ -100,15 +100,10 @@ You should probably avoid non-ASCII characters in this arg.
100If `mm-use-ultra-safe-encoding' is set, fold lines unconditionally and 100If `mm-use-ultra-safe-encoding' is set, fold lines unconditionally and
101encode lines starting with \"From\"." 101encode lines starting with \"From\"."
102 (interactive "r") 102 (interactive "r")
103 (save-excursion 103 (goto-char from)
104 (goto-char from) 104 (if (re-search-forward (mm-string-to-multibyte "[^\x0-\x7f\x80-\xff]")
105 (if (fboundp 'string-to-multibyte) ; Emacs 22 105 to t)
106 (if (re-search-forward (string-to-multibyte "[^\x0-\x7f\x80-\xff]") 106 (error "Multibyte character in QP encoding region"))
107 to t)
108 ;; Fixme: This is somewhat misleading.
109 (error "Multibyte character in QP encoding region"))
110 (if (re-search-forward (mm-string-as-multibyte "[^\0-\377]") to t)
111 (error "Multibyte character in QP encoding region"))))
112 (unless class 107 (unless class
113 ;; Avoid using 8bit characters. = is \075. 108 ;; Avoid using 8bit characters. = is \075.
114 ;; Equivalent to "^\000-\007\013\015-\037\200-\377=" 109 ;; Equivalent to "^\000-\007\013\015-\037\200-\377="
diff --git a/lisp/help.el b/lisp/help.el
index a3e14014b79..e65982623c1 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -590,7 +590,8 @@ the last key hit are used."
590 ;; Don't bother user with strings from (e.g.) the select-paste menu. 590 ;; Don't bother user with strings from (e.g.) the select-paste menu.
591 (if (stringp (aref key (1- (length key)))) 591 (if (stringp (aref key (1- (length key))))
592 (aset key (1- (length key)) "(any string)")) 592 (aset key (1- (length key)) "(any string)"))
593 (if (stringp (aref untranslated (1- (length untranslated)))) 593 (if (and (> (length untranslated) 0)
594 (stringp (aref untranslated (1- (length untranslated)))))
594 (aset untranslated (1- (length untranslated)) 595 (aset untranslated (1- (length untranslated))
595 "(any string)")) 596 "(any string)"))
596 ;; Now describe the key, perhaps as changed. 597 ;; Now describe the key, perhaps as changed.
@@ -603,7 +604,6 @@ the last key hit are used."
603 key-desc 604 key-desc
604 (if (symbolp defn) defn (prin1-to-string defn))))))))) 605 (if (symbolp defn) defn (prin1-to-string defn)))))))))
605 606
606
607(defun describe-key (key &optional untranslated up-event) 607(defun describe-key (key &optional untranslated up-event)
608 "Display documentation of the function invoked by KEY. 608 "Display documentation of the function invoked by KEY.
609KEY should be a key sequence--when calling from a program, 609KEY should be a key sequence--when calling from a program,
diff --git a/lisp/international/code-pages.el b/lisp/international/code-pages.el
index 112f9ac83d2..7cd92e58aa5 100644
--- a/lisp/international/code-pages.el
+++ b/lisp/international/code-pages.el
@@ -189,7 +189,7 @@ Return an updated `non-iso-charset-alist'."
189 ;; For Quail translation. Fixme: this should really be 189 ;; For Quail translation. Fixme: this should really be
190 ;; a separate table that only translates the coding 190 ;; a separate table that only translates the coding
191 ;; system's safe-chars. 191 ;; system's safe-chars.
192 (cons 'translation-table-for-input ,ucs-mule-to-mule-unicode))) 192 (cons 'translation-table-for-input 'ucs-mule-to-mule-unicode)))
193 (push (list ',name 193 (push (list ',name
194 nil ; charset list 194 nil ; charset list
195 ',decoder 195 ',decoder
@@ -4475,7 +4475,7 @@ Return an updated `non-iso-charset-alist'."
4475 pt154 4475 pt154
4476 [?Җ ?Ғ ?Ӯ ?ғ ?„ ?… ?Ҷ ?Ү ?Ҳ ?ү ?Ҡ ?Ӣ ?Ң ?Қ ?Һ ?Ҹ ?җ ?‘ ?’ ?“ ?†?• ?– 4476 [?Җ ?Ғ ?Ӯ ?ғ ?„ ?… ?Ҷ ?Ү ?Ҳ ?ү ?Ҡ ?Ӣ ?Ң ?Қ ?Һ ?Ҹ ?җ ?‘ ?’ ?“ ?†?• ?–
4477 ?— ?ҳ ?ҷ ?ҡ ?ӣ ?ң ?қ ?һ ?ҹ ?  ?Ў ?ў ?Ј ?Ө ?Ҙ ?Ұ ?§ ?Р?© ?Ә ?\« ?¬ ?ӯ 4477 ?— ?ҳ ?ҷ ?ҡ ?ӣ ?ң ?қ ?һ ?ҹ ?  ?Ў ?ў ?Ј ?Ө ?Ҙ ?Ұ ?§ ?Р?© ?Ә ?\« ?¬ ?ӯ
4478 ?® ?Òœ ?° ?Ò± ?І ?Ñ– ?Ò™ ?Ó© ?¶ ?· ?Ñ‘ ?â„– ?Ó™ ?» ?ј ?Òª ?Ò« ?Ò ?Ð ?Б ?Ð’ ?Г ?Д 4478 ?® ?Òœ ?° ?Ò± ?І ?Ñ– ?Ò™ ?Ó© ?¶ ?· ?Ñ‘ ?â„– ?Ó™ ?\» ?ј ?Òª ?Ò« ?Ò ?Ð ?Б ?Ð’ ?Г ?Д
4479 ?Е ?Ж ?З ?И ?Й ?К ?Л ?М ?Р?О ?П ?Р ?С ?Т ?У ?Ф ?Х ?Ц ?Ч ?Ш ?Щ ?Ъ ?Ы 4479 ?Е ?Ж ?З ?И ?Й ?К ?Л ?М ?Р?О ?П ?Р ?С ?Т ?У ?Ф ?Х ?Ц ?Ч ?Ш ?Щ ?Ъ ?Ы
4480 ?Ь ?Э ?Ю ?Я ?а ?б ?в ?г ?д ?е ?ж ?з ?и ?й ?к ?л ?м ?н ?о ?п ?Ñ€ ?Ñ ?Ñ‚ 4480 ?Ь ?Э ?Ю ?Я ?а ?б ?в ?г ?д ?е ?ж ?з ?и ?й ?к ?л ?м ?н ?о ?п ?Ñ€ ?Ñ ?Ñ‚
4481 ?у ?Ñ„ ?Ñ… ?ц ?ч ?ш ?щ ?ÑŠ ?Ñ‹ ?ÑŒ ?Ñ ?ÑŽ ?Ñ]) 4481 ?у ?Ñ„ ?Ñ… ?ц ?ч ?ш ?щ ?ÑŠ ?Ñ‹ ?ÑŒ ?Ñ ?ÑŽ ?Ñ])
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 5e9f3014dc2..cc39f39638d 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -2395,6 +2395,15 @@ See also `locale-charset-language-names', `locale-language-names',
2395 (= 0 (length locale))) ; nil or empty string 2395 (= 0 (length locale))) ; nil or empty string
2396 (setq locale (getenv (pop vars)))))) 2396 (setq locale (getenv (pop vars))))))
2397 2397
2398 (unless (or locale (not (fboundp 'mac-get-preference)))
2399 (setq locale (mac-get-preference "AppleLocale"))
2400 (unless locale
2401 (let ((languages (mac-get-preference "AppleLanguages")))
2402 (unless (= (length languages) 0) ; nil or empty vector
2403 (setq locale (aref languages 0))))))
2404 (unless (or locale (not (boundp 'mac-system-locale)))
2405 (setq locale mac-system-locale))
2406
2398 (when locale 2407 (when locale
2399 2408
2400 ;; Translate "swedish" into "sv_SE.ISO8859-1", and so on, 2409 ;; Translate "swedish" into "sv_SE.ISO8859-1", and so on,
@@ -2425,7 +2434,8 @@ See also `locale-charset-language-names', `locale-language-names',
2425 (when locale 2434 (when locale
2426 (if (string-match "\\.\\([^@]+\\)" locale) 2435 (if (string-match "\\.\\([^@]+\\)" locale)
2427 (locale-charset-to-coding-system 2436 (locale-charset-to-coding-system
2428 (match-string 1 locale))))))) 2437 (match-string 1 locale))))
2438 (and (eq system-type 'macos) mac-system-coding-system))))
2429 2439
2430 (if (consp language-name) 2440 (if (consp language-name)
2431 ;; locale-language-names specify both lang-env and coding. 2441 ;; locale-language-names specify both lang-env and coding.
diff --git a/lisp/international/ucs-tables.el b/lisp/international/ucs-tables.el
index 5574cf3d954..80a7a960709 100644
--- a/lisp/international/ucs-tables.el
+++ b/lisp/international/ucs-tables.el
@@ -1,6 +1,6 @@
1;;; ucs-tables.el --- translation to, from and via Unicode -*- coding: iso-2022-7bit -*- 1;;; ucs-tables.el --- translation to, from and via Unicode -*- coding: iso-2022-7bit -*-
2 2
3;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Dave Love <fx@gnu.org> 5;; Author: Dave Love <fx@gnu.org>
6;; Keywords: i18n 6;; Keywords: i18n
@@ -2496,8 +2496,10 @@ See also command `unify-8859-on-encoding-mode' and the user option
2496;; normal-mode and minibuffer-setup-hook. 2496;; normal-mode and minibuffer-setup-hook.
2497(defun ucs-set-table-for-input (&optional buffer) 2497(defun ucs-set-table-for-input (&optional buffer)
2498 "Set up an appropriate `translation-table-for-input' for BUFFER. 2498 "Set up an appropriate `translation-table-for-input' for BUFFER.
2499BUFFER defaults to the current buffer." 2499BUFFER defaults to the current buffer.
2500This function is automatically called directly at the end of `get-buffer-create'."
2500 (when (and unify-8859-on-encoding-mode 2501 (when (and unify-8859-on-encoding-mode
2502 (not unify-8859-on-decoding-mode)
2501 (char-table-p translation-table-for-input)) 2503 (char-table-p translation-table-for-input))
2502 (let ((cs (and buffer-file-coding-system 2504 (let ((cs (and buffer-file-coding-system
2503 (coding-system-base buffer-file-coding-system))) 2505 (coding-system-base buffer-file-coding-system)))
@@ -2535,5 +2537,5 @@ Intended to be added to `minibuffer-setup-hook'."
2535 2537
2536(provide 'ucs-tables) 2538(provide 'ucs-tables)
2537 2539
2538;;; arch-tag: b497e22b-7fe1-486a-9352-e2d7f7d76a76 2540;; arch-tag: b497e22b-7fe1-486a-9352-e2d7f7d76a76
2539;;; ucs-tables.el ends here 2541;;; ucs-tables.el ends here
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el
index 59c6de846c2..5bda4349288 100644
--- a/lisp/jka-compr.el
+++ b/lisp/jka-compr.el
@@ -198,12 +198,16 @@ invoked."
198 (choice :tag "Compress Message" 198 (choice :tag "Compress Message"
199 (string :format "%v") 199 (string :format "%v")
200 (const :tag "No Message" nil)) 200 (const :tag "No Message" nil))
201 (string :tag "Compress Program") 201 (choice :tag "Compress Program"
202 (string)
203 (const :tag "None" nil))
202 (repeat :tag "Compress Arguments" string) 204 (repeat :tag "Compress Arguments" string)
203 (choice :tag "Uncompress Message" 205 (choice :tag "Uncompress Message"
204 (string :format "%v") 206 (string :format "%v")
205 (const :tag "No Message" nil)) 207 (const :tag "No Message" nil))
206 (string :tag "Uncompress Program") 208 (choice :tag "Uncompress Program"
209 (string)
210 (const :tag "None" nil))
207 (repeat :tag "Uncompress Arguments" string) 211 (repeat :tag "Uncompress Arguments" string)
208 (boolean :tag "Append") 212 (boolean :tag "Append")
209 (boolean :tag "Strip Extension") 213 (boolean :tag "Strip Extension")
diff --git a/lisp/loadhist.el b/lisp/loadhist.el
index 76ef87ee845..473c8dc3bc8 100644
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -194,29 +194,27 @@ such as redefining an Emacs function."
194 (dolist (elt (cdr unload-hook-features-list)) 194 (dolist (elt (cdr unload-hook-features-list))
195 (if (symbolp elt) 195 (if (symbolp elt)
196 (elp-restore-function elt)))) 196 (elp-restore-function elt))))
197 (mapc 197 (dolist (x (cdr unload-hook-features-list))
198 (lambda (x) 198 (when (consp x)
199 (cond ((stringp x) nil) 199 ;; Remove any feature names that this file provided.
200 ((consp x) 200 (if (eq (car x) 'provide)
201 ;; Remove any feature names that this file provided. 201 (setq features (delq (cdr x) features)))
202 (if (eq (car x) 'provide) 202 (when (eq (car x) 'defvar)
203 (setq features (delq (cdr x) features))) 203 ;; Kill local values as much as possible.
204 (when (eq (car x) 'defvar) 204 (dolist (buf (buffer-list))
205 ;; Kill local values as much as possible. 205 (with-current-buffer buf
206 (dolist (buf (buffer-list)) 206 (kill-local-variable (cdr x))))
207 (with-current-buffer buf 207 ;; Get rid of the default binding if we can.
208 (kill-local-variable (cdr x)))) 208 (unless (local-variable-if-set-p (cdr x))
209 ;; Get rid of the default binding if we can. 209 (makunbound (cdr x))))
210 (unless (local-variable-if-set-p (cdr x)) 210 (when (eq (car x) 'defun)
211 (makunbound (cdr x))))) 211 (let ((fun (cdr x)))
212 (t 212 (when (fboundp fun)
213 (when (fboundp x) 213 (if (fboundp 'ad-unadvise)
214 (if (fboundp 'ad-unadvise) 214 (ad-unadvise fun))
215 (ad-unadvise x)) 215 (fmakunbound fun)
216 (fmakunbound x) 216 (let ((aload (get fun 'autoload)))
217 (let ((aload (get x 'autoload))) 217 (if aload (fset fun (cons 'autoload aload)))))))))
218 (if aload (fset x (cons 'autoload aload))))))))
219 (cdr unload-hook-features-list))
220 ;; Delete the load-history element for this file. 218 ;; Delete the load-history element for this file.
221 (let ((elt (assoc file load-history))) 219 (let ((elt (assoc file load-history)))
222 (setq load-history (delq elt load-history))))) 220 (setq load-history (delq elt load-history)))))
diff --git a/lisp/loadup.el b/lisp/loadup.el
index b5102b4b553..8ada4710400 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -203,6 +203,7 @@
203 203
204(load "vc-hooks") 204(load "vc-hooks")
205(load "ediff-hook") 205(load "ediff-hook")
206(if (fboundp 'x-show-tip) (load "tooltip"))
206(message "%s" (garbage-collect)) 207(message "%s" (garbage-collect))
207 208
208;If you want additional libraries to be preloaded and their 209;If you want additional libraries to be preloaded and their
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index de88b37d91e..e7c634f4202 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -246,7 +246,7 @@ It is useful to set this variable in the site customization file.")
246 246
247;;;###autoload 247;;;###autoload
248(defcustom rmail-ignored-headers 248(defcustom rmail-ignored-headers
249 (concat "^via:\\|^mail-from:\\|^origin:\\|^references:" 249 (concat "^via:\\|^mail-from:\\|^origin:\\|^references:\\|^sender:"
250 "\\|^status:\\|^received:\\|^x400-originator:\\|^x400-recipients:" 250 "\\|^status:\\|^received:\\|^x400-originator:\\|^x400-recipients:"
251 "\\|^x400-received:\\|^x400-mts-identifier:\\|^x400-content-type:" 251 "\\|^x400-received:\\|^x400-mts-identifier:\\|^x400-content-type:"
252 "\\|^\\(resent-\\|\\)message-id:\\|^summary-line:\\|^resent-date:" 252 "\\|^\\(resent-\\|\\)message-id:\\|^summary-line:\\|^resent-date:"
@@ -254,14 +254,17 @@ It is useful to set this variable in the site customization file.")
254 "\\|^x-mailer:\\|^delivered-to:\\|^lines:\\|^mime-version:" 254 "\\|^x-mailer:\\|^delivered-to:\\|^lines:\\|^mime-version:"
255 "\\|^content-transfer-encoding:\\|^x-coding-system:" 255 "\\|^content-transfer-encoding:\\|^x-coding-system:"
256 "\\|^return-path:\\|^errors-to:\\|^return-receipt-to:" 256 "\\|^return-path:\\|^errors-to:\\|^return-receipt-to:"
257 "\\|^x-sign:\\|^x-beenthere:\\|^x-mailman-version:" 257 "\\|^x-sign:\\|^x-beenthere:\\|^x-mailman-version:\\|^x-mailman-copy:"
258 "\\|^precedence:\\|^list-help:\\|^list-post:\\|^list-subscribe:" 258 "\\|^precedence:\\|^list-help:\\|^list-post:\\|^list-subscribe:"
259 "\\|^list-id:\\|^list-unsubscribe:\\|^list-archive:" 259 "\\|^list-id:\\|^list-unsubscribe:\\|^list-archive:"
260 "\\|^content-type:\\|^content-length:" 260 "\\|^content-type:\\|^content-length:"
261 "\\|^x-attribution:\\|^x-disclaimer:\\|^x-trace:" 261 "\\|^x-attribution:\\|^x-disclaimer:\\|^x-trace:"
262 "\\|^x-complaints-to:\\|^nntp-posting-date:\\|^user-agent" 262 "\\|^x-complaints-to:\\|^nntp-posting-date:\\|^user-agent"
263 "\\|^importance:\\|^envelope-to:\\|^delivery-date" 263 "\\|^importance:\\|^envelope-to:\\|^delivery-date"
264 "\\|^x.*-priority:\\|^x-mimeole:") 264 "\\|^x.*-priority:\\|^x-mimeole:\\|^x-archive:"
265 "\\|^resent-face:\\|^resent-x.*:\\|^resent-organization\\|^resent-openpgp"
266 "\\|^openpgp:\\|^x-request-pgp:\\|^x-original.*:"
267 "\\|^x-virus-scanned:\\|^x-spam-[^s].*:")
265 "*Regexp to match header fields that Rmail should normally hide. 268 "*Regexp to match header fields that Rmail should normally hide.
266This variable is used for reformatting the message header, 269This variable is used for reformatting the message header,
267which normally happens once for each message, 270which normally happens once for each message,
@@ -653,6 +656,7 @@ The first parenthesized expression should match the MIME-charset name.")
653 . font-lock-function-name-face) 656 . font-lock-function-name-face)
654 '("^Reply-To:.*$" . font-lock-function-name-face) 657 '("^Reply-To:.*$" . font-lock-function-name-face)
655 '("^Subject:" . font-lock-comment-face) 658 '("^Subject:" . font-lock-comment-face)
659 '("^X-Spam-Status:" . font-lock-keyword-face)
656 '("^\\(To\\|Apparently-To\\|Cc\\|Newsgroups\\):" 660 '("^\\(To\\|Apparently-To\\|Cc\\|Newsgroups\\):"
657 . font-lock-keyword-face) 661 . font-lock-keyword-face)
658 ;; Use MATCH-ANCHORED to effectively anchor the regexp left side. 662 ;; Use MATCH-ANCHORED to effectively anchor the regexp left side.
@@ -662,8 +666,7 @@ The first parenthesized expression should match the MIME-charset name.")
662 "\\(" cite-chars "[ \t]*\\)\\)+" 666 "\\(" cite-chars "[ \t]*\\)\\)+"
663 "\\(.*\\)") 667 "\\(.*\\)")
664 (beginning-of-line) (end-of-line) 668 (beginning-of-line) (end-of-line)
665 (2 font-lock-constant-face nil t) 669 (3 font-lock-comment-face nil t)))
666 (4 font-lock-comment-face nil t)))
667 '("^\\(X-[a-z0-9-]+\\|In-reply-to\\|Date\\):.*\\(\n[ \t]+.*\\)*$" 670 '("^\\(X-[a-z0-9-]+\\|In-reply-to\\|Date\\):.*\\(\n[ \t]+.*\\)*$"
668 . font-lock-string-face)))) 671 . font-lock-string-face))))
669 "Additional expressions to highlight in Rmail mode.") 672 "Additional expressions to highlight in Rmail mode.")
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index af1fca1b1da..fb2760b3bde 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -366,7 +366,9 @@ actually occur.")
366 (list '("^\\(To\\|Newsgroups\\):" . font-lock-function-name-face) 366 (list '("^\\(To\\|Newsgroups\\):" . font-lock-function-name-face)
367 '("^\\(B?CC\\|Reply-to\\|Mail-\\(reply\\|followup\\)-to\\):" . font-lock-keyword-face) 367 '("^\\(B?CC\\|Reply-to\\|Mail-\\(reply\\|followup\\)-to\\):" . font-lock-keyword-face)
368 '("^\\(Subject:\\)[ \t]*\\(.+\\)?" 368 '("^\\(Subject:\\)[ \t]*\\(.+\\)?"
369 (1 font-lock-comment-face) (2 font-lock-type-face nil t)) 369 (1 font-lock-comment-face)
370;; (2 font-lock-type-face nil t)
371 )
370 ;; Use EVAL to delay in case `mail-header-separator' gets changed. 372 ;; Use EVAL to delay in case `mail-header-separator' gets changed.
371 '(eval . 373 '(eval .
372 (let ((separator (if (zerop (length mail-header-separator)) 374 (let ((separator (if (zerop (length mail-header-separator))
@@ -380,8 +382,7 @@ actually occur.")
380 "\\(" cite-chars "[ \t]*\\)\\)+" 382 "\\(" cite-chars "[ \t]*\\)\\)+"
381 "\\(.*\\)") 383 "\\(.*\\)")
382 (beginning-of-line) (end-of-line) 384 (beginning-of-line) (end-of-line)
383 (2 font-lock-constant-face nil t) 385 (3 font-lock-comment-face nil t)))
384 (4 font-lock-comment-face nil t)))
385 '("^\\(X-[A-Za-z0-9-]+\\|In-reply-to\\):.*\\(\n[ \t]+.*\\)*$" 386 '("^\\(X-[A-Za-z0-9-]+\\|In-reply-to\\):.*\\(\n[ \t]+.*\\)*$"
386 . font-lock-string-face)))) 387 . font-lock-string-face))))
387 "Additional expressions to highlight in Mail mode.") 388 "Additional expressions to highlight in Mail mode.")
diff --git a/lisp/makefile.w32-in b/lisp/makefile.w32-in
index 76a63a78b52..54be26a1675 100644
--- a/lisp/makefile.w32-in
+++ b/lisp/makefile.w32-in
@@ -1,5 +1,5 @@
1# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API. 1# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
2# Copyright (c) 2000,2001,2004 Free Software Foundation, Inc. 2# Copyright (c) 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
3# 3#
4# This file is part of GNU Emacs. 4# This file is part of GNU Emacs.
5# 5#
@@ -46,77 +46,6 @@ lisptagsfiles1 = $(lisp)/*.el
46lisptagsfiles2 = $(lisp)/*/*.el 46lisptagsfiles2 = $(lisp)/*/*.el
47ETAGS = "../lib-src/$(BLD)/etags" 47ETAGS = "../lib-src/$(BLD)/etags"
48 48
49# Files which should not be compiled. If you change the name `DONTCOMPILE'
50# to something different, you'll have to change make-dist as well, and
51# modify the lists in $lisp and $shortlisp on src/Makefile.in.
52#
53# - emacs-lisp/cl-specs.el: only contains `def-edebug-spec's so there's
54# no point compiling it, although it doesn't hurt.
55
56DONTCOMPILE = \
57 $(lisp)/cus-load.el \
58 $(lisp)/emacs-lisp/cl-specs.el \
59 $(lisp)/eshell/esh-maint.el \
60 $(lisp)/eshell/esh-groups.el \
61 $(lisp)/finder-inf.el \
62 $(lisp)/forms-d2.el \
63 $(lisp)/forms-pass.el \
64 $(lisp)/generic-x.el \
65 $(lisp)/international/latin-1.el \
66 $(lisp)/international/latin-2.el \
67 $(lisp)/international/latin-3.el \
68 $(lisp)/international/latin-4.el \
69 $(lisp)/international/latin-5.el \
70 $(lisp)/international/latin-8.el \
71 $(lisp)/international/latin-9.el \
72 $(lisp)/international/mule-conf.el \
73 $(lisp)/language/czech.el \
74 $(lisp)/language/devanagari.el \
75 $(lisp)/language/kannada.el \
76 $(lisp)/language/malayalam.el \
77 $(lisp)/language/tamil.el \
78 $(lisp)/language/english.el \
79 $(lisp)/language/greek.el \
80 $(lisp)/language/hebrew.el \
81 $(lisp)/language/japanese.el \
82 $(lisp)/language/korean.el \
83 $(lisp)/language/lao.el \
84 $(lisp)/language/misc-lang.el \
85 $(lisp)/language/romanian.el \
86 $(lisp)/language/slovak.el \
87 $(lisp)/language/thai.el \
88 $(lisp)/language/utf-8-lang.el \
89 $(lisp)/language/georgian.el \
90 $(lisp)/loaddefs.el \
91 $(lisp)/ldefs-boot.el \
92 $(lisp)/loadup.el \
93 $(lisp)/mail/blessmail.el \
94 $(lisp)/patcomp.el \
95 $(lisp)/paths.el \
96 $(lisp)/play/bruce.el \
97 $(lisp)/subdirs.el \
98 $(lisp)/term/internal.el \
99 $(lisp)/term/AT386.el \
100 $(lisp)/term/apollo.el \
101 $(lisp)/term/bobcat.el \
102 $(lisp)/term/iris-ansi.el \
103 $(lisp)/term/keyswap.el \
104 $(lisp)/term/linux.el \
105 $(lisp)/term/lk201.el \
106 $(lisp)/term/news.el \
107 $(lisp)/term/vt102.el \
108 $(lisp)/term/vt125.el \
109 $(lisp)/term/vt200.el \
110 $(lisp)/term/vt201.el \
111 $(lisp)/term/vt220.el \
112 $(lisp)/term/vt240.el \
113 $(lisp)/term/vt300.el \
114 $(lisp)/term/vt320.el \
115 $(lisp)/term/vt400.el \
116 $(lisp)/term/vt420.el \
117 $(lisp)/term/wyse50.el \
118 $(lisp)/version.el
119
120# Files to compile before others during a bootstrap. This is done to 49# Files to compile before others during a bootstrap. This is done to
121# speed up the bootstrap process. The CC files are compiled first 50# speed up the bootstrap process. The CC files are compiled first
122# because CC mode tweaks the compilation process, and requiring 51# because CC mode tweaks the compilation process, and requiring
@@ -251,7 +180,7 @@ updates: update-subdirs autoloads finder-data custom-deps
251# Update the AUTHORS file. 180# Update the AUTHORS file.
252 181
253update-authors: 182update-authors:
254 $(emacs) -f batch-update-authors $(srcdir)/AUTHORS $(srcdir) 183 $(emacs) -l authors -f batch-update-authors $(srcdir)/AUTHORS $(srcdir)
255 184
256TAGS: $(lisptagsfiles1) $(lisptagsfiles2) 185TAGS: $(lisptagsfiles1) $(lisptagsfiles2)
257 $(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2) 186 $(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2)
@@ -264,19 +193,17 @@ TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2)
264.el.elc: 193.el.elc:
265 -$(emacs) -f batch-byte-compile $< 194 -$(emacs) -f batch-byte-compile $<
266 195
267$(DONTCOMPILE:.el=.elc): 196# Compile all Lisp files, but don't recompile those that are up to
268 -$(DEL) $@ 197# date. Some files don't actually get compiled because they set the
198# local variable no-byte-compile.
269 199
270# Compile all Lisp files, except those from DONTCOMPILE, 200# All .elc files are made writable before compilation in case we
271# but don't recompile those that are up to date. 201# checked out read-only (CVS option -r). Files MUST be compiled one by
272 202# one. If we compile several files in a row we can't make sure that
273# All .elc files are made writable 203# the compilation environment is clean. We also set the load-path of
274# before compilation in case we checked out read-only (CVS option -r). 204# the Emacs used for compilation to the current directory and its
275# Files MUST be compiled one by one. If we compile several files in a 205# subdirectories, to make sure require's and load's in the files being
276# row we can't make sure that the compilation environment is clean. 206# compiled find the right files.
277# We also set the load-path of the Emacs used for compilation to the
278# current directory and its subdirectories, to make sure require's and
279# load's in the files being compiled find the right files.
280 207
281# Need separate version for sh and native cmd.exe 208# Need separate version for sh and native cmd.exe
282compile: subdirs.el compile-$(SHELLTYPE) doit 209compile: subdirs.el compile-$(SHELLTYPE) doit
@@ -304,8 +231,10 @@ compile-SH:
304 done; \ 231 done; \
305 done 232 done
306 233
307# Compile all Lisp files, except those from DONTCOMPILE. This 234# Compile all Lisp files. This is like `compile' but compiles files
308# is like `compile' but compiles files unconditionally. 235# unconditionally. Some files don't actually get compiled because they
236# set the local variable no-byte-compile.
237
309compile-always: subdirs.el compile-always-$(SHELLTYPE) doit 238compile-always: subdirs.el compile-always-$(SHELLTYPE) doit
310 239
311compile-always-CMD: 240compile-always-CMD:
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el
index 4c8b847b7cd..14363e4dccf 100644
--- a/lisp/progmodes/f90.el
+++ b/lisp/progmodes/f90.el
@@ -1055,10 +1055,10 @@ block[ \t]*data\\)\\>")
1055 (f90-change-keywords f90-auto-keyword-case 1055 (f90-change-keywords f90-auto-keyword-case
1056 (line-beginning-position) (line-end-position)))) 1056 (line-beginning-position) (line-end-position))))
1057 1057
1058(defun f90-electric-insert () 1058(defun f90-electric-insert (&optional arg)
1059 "Change keyword case and auto-fill line as operators are inserted." 1059 "Change keyword case and auto-fill line as operators are inserted."
1060 (interactive) 1060 (interactive "*p")
1061 (self-insert-command 1) 1061 (self-insert-command arg)
1062 (if auto-fill-function (f90-do-auto-fill) ; also updates line 1062 (if auto-fill-function (f90-do-auto-fill) ; also updates line
1063 (f90-update-line))) 1063 (f90-update-line)))
1064 1064
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 3e4796436f1..95920ff9f02 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -79,7 +79,7 @@
79(defvar gdb-overlay-arrow-position nil) 79(defvar gdb-overlay-arrow-position nil)
80(defvar gdb-server-prefix nil) 80(defvar gdb-server-prefix nil)
81(defvar gdb-flush-pending-output nil) 81(defvar gdb-flush-pending-output nil)
82(defvar gdb-location-list nil "List of directories for source files.") 82(defvar gdb-location-list nil "Alist of breakpoint numbers and full filenames.")
83(defvar gdb-find-file-unhook nil) 83(defvar gdb-find-file-unhook nil)
84 84
85(defvar gdb-buffer-type nil 85(defvar gdb-buffer-type nil
@@ -258,6 +258,7 @@ detailed description of this mode.
258 'gdb-mouse-set-clear-breakpoint) 258 'gdb-mouse-set-clear-breakpoint)
259 (define-key gud-minor-mode-map [left-margin mouse-3] 259 (define-key gud-minor-mode-map [left-margin mouse-3]
260 'gdb-mouse-toggle-breakpoint) 260 'gdb-mouse-toggle-breakpoint)
261; Currently only works in margin.
261; (define-key gud-minor-mode-map [left-fringe mouse-3] 262; (define-key gud-minor-mode-map [left-fringe mouse-3]
262; 'gdb-mouse-toggle-breakpoint) 263; 'gdb-mouse-toggle-breakpoint)
263 264
@@ -606,6 +607,21 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'."
606 (gdb-get-target-string) 607 (gdb-get-target-string)
607 "*")) 608 "*"))
608 609
610(defun gdb-display-inferior-io-buffer ()
611 "Display IO of inferior in a separate window."
612 (interactive)
613 (if gdb-use-inferior-io-buffer
614 (gdb-display-buffer
615 (gdb-get-create-buffer 'gdb-inferior-io))))
616
617(defun gdb-frame-inferior-io-buffer ()
618 "Display IO of inferior in a new frame."
619 (interactive)
620 (if gdb-use-inferior-io-buffer
621 (let ((special-display-regexps (append special-display-regexps '(".*")))
622 (special-display-frame-alist gdb-frame-parameters))
623 (display-buffer (gdb-get-create-buffer 'gdb-inferior-io)))))
624
609(defvar gdb-inferior-io-mode-map 625(defvar gdb-inferior-io-mode-map
610 (let ((map (make-sparse-keymap))) 626 (let ((map (make-sparse-keymap)))
611 (define-key map "\C-c\C-c" 'gdb-inferior-io-interrupt) 627 (define-key map "\C-c\C-c" 'gdb-inferior-io-interrupt)
@@ -1372,9 +1388,9 @@ static char *magick[] = {
1372 (file (match-string 2)) 1388 (file (match-string 2))
1373 (line (match-string 3))) 1389 (line (match-string 3)))
1374 (save-selected-window 1390 (save-selected-window
1375 (let* ((buf (find-file-noselect (if (file-exists-p file) 1391 (let* ((buf (find-file-noselect
1376 file 1392 (if (file-exists-p file) file
1377 (cdr (assoc bptno gdb-location-list))))) 1393 (cdr (assoc bptno gdb-location-list)))))
1378 (window (display-buffer buf))) 1394 (window (display-buffer buf)))
1379 (with-current-buffer buf 1395 (with-current-buffer buf
1380 (goto-line (string-to-number line)) 1396 (goto-line (string-to-number line))
@@ -1810,26 +1826,26 @@ corresponding to the mode line clicked."
1810 "Read address: " 1826 "Read address: "
1811 (propertize gdb-memory-address 1827 (propertize gdb-memory-address
1812 'face font-lock-warning-face 1828 'face font-lock-warning-face
1813 'help-echo (purecopy "mouse-1: Set memory address") 1829 'help-echo "mouse-1: Set memory address"
1814 'local-map (purecopy (gdb-make-header-line-mouse-map 1830 'local-map (gdb-make-header-line-mouse-map
1815 'mouse-1 1831 'mouse-1
1816 #'gdb-memory-set-address))) 1832 #'gdb-memory-set-address))
1817 " Repeat Count: " 1833 " Repeat Count: "
1818 (propertize (number-to-string gdb-memory-repeat-count) 1834 (propertize (number-to-string gdb-memory-repeat-count)
1819 'face font-lock-warning-face 1835 'face font-lock-warning-face
1820 'help-echo (purecopy "mouse-1: Set repeat count") 1836 'help-echo "mouse-1: Set repeat count"
1821 'local-map (purecopy (gdb-make-header-line-mouse-map 1837 'local-map (gdb-make-header-line-mouse-map
1822 'mouse-1 1838 'mouse-1
1823 #'gdb-memory-set-repeat-count))) 1839 #'gdb-memory-set-repeat-count))
1824 " Display Format: " 1840 " Display Format: "
1825 (propertize gdb-memory-format 1841 (propertize gdb-memory-format
1826 'face font-lock-warning-face 1842 'face font-lock-warning-face
1827 'help-echo (purecopy "mouse-3: Select display format") 1843 'help-echo "mouse-3: Select display format"
1828 'local-map gdb-memory-format-keymap) 1844 'local-map gdb-memory-format-keymap)
1829 " Unit Size: " 1845 " Unit Size: "
1830 (propertize gdb-memory-unit 1846 (propertize gdb-memory-unit
1831 'face font-lock-warning-face 1847 'face font-lock-warning-face
1832 'help-echo (purecopy "mouse-3: Select unit size") 1848 'help-echo "mouse-3: Select unit size"
1833 'local-map gdb-memory-unit-keymap)))) 1849 'local-map gdb-memory-unit-keymap))))
1834 (run-mode-hooks 'gdb-memory-mode-hook) 1850 (run-mode-hooks 'gdb-memory-mode-hook)
1835 'gdb-invalidate-memory) 1851 'gdb-invalidate-memory)
@@ -1936,11 +1952,12 @@ corresponding to the mode line clicked."
1936 (let ((answer (get-buffer-window buf 0)) 1952 (let ((answer (get-buffer-window buf 0))
1937 (must-split nil)) 1953 (must-split nil))
1938 (if answer 1954 (if answer
1939 (display-buffer buf) ;Raise the frame if necessary. 1955 (display-buffer buf nil 0) ;Raise the frame if necessary.
1940 ;; The buffer is not yet displayed. 1956 ;; The buffer is not yet displayed.
1941 (pop-to-buffer gud-comint-buffer) ;Select the right frame. 1957 (pop-to-buffer gud-comint-buffer) ;Select the right frame.
1942 (let ((window (get-lru-window))) 1958 (let ((window (get-lru-window)))
1943 (if window 1959 (if (and window
1960 (not (eq window (get-buffer-window gud-comint-buffer))))
1944 (progn 1961 (progn
1945 (set-window-buffer window buf) 1962 (set-window-buffer window buf)
1946 (setq answer window)) 1963 (setq answer window))
@@ -1965,6 +1982,9 @@ corresponding to the mode line clicked."
1965 (define-key menu [memory] '("Memory" . gdb-display-memory-buffer)) 1982 (define-key menu [memory] '("Memory" . gdb-display-memory-buffer))
1966 (define-key menu [assembler] '("Machine" . gdb-display-assembler-buffer)) 1983 (define-key menu [assembler] '("Machine" . gdb-display-assembler-buffer))
1967 (define-key menu [registers] '("Registers" . gdb-display-registers-buffer)) 1984 (define-key menu [registers] '("Registers" . gdb-display-registers-buffer))
1985 (define-key menu [inferior]
1986 '(menu-item "Inferior IO" gdb-display-inferior-io-buffer
1987 :enable gdb-use-inferior-io-buffer))
1968 (define-key menu [locals] '("Locals" . gdb-display-locals-buffer)) 1988 (define-key menu [locals] '("Locals" . gdb-display-locals-buffer))
1969 (define-key menu [frames] '("Stack" . gdb-display-stack-buffer)) 1989 (define-key menu [frames] '("Stack" . gdb-display-stack-buffer))
1970 (define-key menu [breakpoints] '("Breakpoints" . gdb-display-breakpoints-buffer))) 1990 (define-key menu [breakpoints] '("Breakpoints" . gdb-display-breakpoints-buffer)))
@@ -1977,6 +1997,9 @@ corresponding to the mode line clicked."
1977 (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer)) 1997 (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer))
1978 (define-key menu [assembler] '("Machine" . gdb-frame-assembler-buffer)) 1998 (define-key menu [assembler] '("Machine" . gdb-frame-assembler-buffer))
1979 (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer)) 1999 (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer))
2000 (define-key menu [inferior]
2001 '(menu-item "Inferior IO" gdb-frame-inferior-io-buffer
2002 :enable gdb-use-inferior-io-buffer))
1980 (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer)) 2003 (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer))
1981 (define-key menu [frames] '("Stack" . gdb-frame-stack-buffer)) 2004 (define-key menu [frames] '("Stack" . gdb-frame-stack-buffer))
1982 (define-key menu [breakpoints] '("Breakpoints" . gdb-frame-breakpoints-buffer))) 2005 (define-key menu [breakpoints] '("Breakpoints" . gdb-frame-breakpoints-buffer)))
@@ -1985,11 +2008,21 @@ corresponding to the mode line clicked."
1985 (define-key gud-menu-map [ui] 2008 (define-key gud-menu-map [ui]
1986 `(menu-item "GDB-UI" ,menu :visible (eq gud-minor-mode 'gdba))) 2009 `(menu-item "GDB-UI" ,menu :visible (eq gud-minor-mode 'gdba)))
1987 (define-key menu [gdb-restore-windows] 2010 (define-key menu [gdb-restore-windows]
1988 '("Restore Window Layout" . gdb-restore-windows)) 2011 '(menu-item "Restore Window Layout" gdb-restore-windows
2012 :help "Restore standard layout for debug session."))
1989 (define-key menu [gdb-many-windows] 2013 (define-key menu [gdb-many-windows]
1990 (menu-bar-make-toggle gdb-many-windows gdb-many-windows 2014 '(menu-item "Display Other Windows" gdb-many-windows
1991 "Display Other Windows" "Many windows %s" 2015 :help "Toggle display of locals, stack and breakpoint information"
1992 "Toggle display of locals, stack and breakpoint information"))) 2016 :button (:toggle . gdb-many-windows)))
2017 (define-key menu [gdb-use-inferior-io]
2018 (menu-bar-make-toggle toggle-gdb-use-inferior-io-buffer
2019 gdb-use-inferior-io-buffer
2020 "Separate inferior IO" "Use separate IO %s"
2021 "Toggle separate IO for inferior.")))
2022
2023(defadvice toggle-gdb-use-inferior-io-buffer (after gdb-kill-io-buffer activate)
2024 (unless gdb-use-inferior-io-buffer
2025 (kill-buffer (gdb-inferior-io-name))))
1993 2026
1994(defun gdb-frame-gdb-buffer () 2027(defun gdb-frame-gdb-buffer ()
1995 "Display GUD buffer in a new frame." 2028 "Display GUD buffer in a new frame."
@@ -2038,7 +2071,8 @@ corresponding to the mode line clicked."
2038 (when gdb-use-inferior-io-buffer 2071 (when gdb-use-inferior-io-buffer
2039 (split-window-horizontally) 2072 (split-window-horizontally)
2040 (other-window 1) 2073 (other-window 1)
2041 (gdb-set-window-buffer (gdb-inferior-io-name))) 2074 (gdb-set-window-buffer
2075 (gdb-get-create-buffer 'gdb-inferior-io)))
2042 (other-window 1) 2076 (other-window 1)
2043 (gdb-set-window-buffer (gdb-stack-buffer-name)) 2077 (gdb-set-window-buffer (gdb-stack-buffer-name))
2044 (split-window-horizontally) 2078 (split-window-horizontally)
@@ -2337,7 +2371,6 @@ BUFFER nil or omitted means use the current buffer."
2337 (setq mode-name "Machine") 2371 (setq mode-name "Machine")
2338 (setq gdb-overlay-arrow-position nil) 2372 (setq gdb-overlay-arrow-position nil)
2339 (add-to-list 'overlay-arrow-variable-list 'gdb-overlay-arrow-position) 2373 (add-to-list 'overlay-arrow-variable-list 'gdb-overlay-arrow-position)
2340 (put 'gdb-overlay-arrow-position 'overlay-arrow-string "=>")
2341 (setq fringes-outside-margins t) 2374 (setq fringes-outside-margins t)
2342 (setq buffer-read-only t) 2375 (setq buffer-read-only t)
2343 (use-local-map gdb-assembler-mode-map) 2376 (use-local-map gdb-assembler-mode-map)
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 1f9284db9cb..ebb7ee69765 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -89,16 +89,27 @@ If SOFT is non-nil, returns nil if the symbol doesn't already exist."
89 89
90(defvar gud-running nil 90(defvar gud-running nil
91 "Non-nil if debuggee is running. 91 "Non-nil if debuggee is running.
92Used to grey out relevant toolbar icons.") 92Used to grey out relevant togolbar icons.")
93 93
94;; Use existing Info buffer, if possible.
94(defun gud-goto-info () 95(defun gud-goto-info ()
95 "Go to relevant Emacs info node." 96 "Go to relevant Emacs info node."
96 (interactive) 97 (interactive)
97 (select-frame (make-frame)) 98 (let ((same-window-regexps same-window-regexps)
98 (require 'info) 99 (display-buffer-reuse-frames t))
99 (if (memq gud-minor-mode '(gdbmi gdba)) 100 (catch 'info-found
100 (Info-goto-node "(emacs)GDB Graphical Interface") 101 (walk-windows
101 (Info-goto-node "(emacs)Debuggers"))) 102 '(lambda (window)
103 (if (eq (window-buffer window) (get-buffer "*info*"))
104 (progn
105 (setq same-window-regexps nil)
106 (throw 'info-found nil))))
107 nil 0)
108 (require 'info)
109 (select-frame (make-frame)))
110 (if (memq gud-minor-mode '(gdbmi gdba))
111 (Info-goto-node "(emacs)GDB Graphical Interface")
112 (Info-goto-node "(emacs)Debuggers"))))
102 113
103(easy-mmode-defmap gud-menu-map 114(easy-mmode-defmap gud-menu-map
104 '(([help] "Info" . gud-goto-info) 115 '(([help] "Info" . gud-goto-info)
@@ -1417,7 +1428,7 @@ and source-file directory for your debugger."
1417 1428
1418 output)) 1429 output))
1419 1430
1420(defcustom gud-pdb-command-name "pydb" 1431(defcustom gud-pdb-command-name "pdb"
1421 "File name for executing the Python debugger. 1432 "File name for executing the Python debugger.
1422This should be an executable on your path, or an absolute file name." 1433This should be an executable on your path, or an absolute file name."
1423 :type 'string 1434 :type 'string
@@ -2518,7 +2529,6 @@ It is saved for when this flag is not set.")
2518 2529
2519(defvar gud-minor-mode-type nil) 2530(defvar gud-minor-mode-type nil)
2520(defvar gud-overlay-arrow-position nil) 2531(defvar gud-overlay-arrow-position nil)
2521(put 'gud-overlay-arrow-position 'overlay-arrow-string "=>")
2522(add-to-list 'overlay-arrow-variable-list 'gud-overlay-arrow-position) 2532(add-to-list 'overlay-arrow-variable-list 'gud-overlay-arrow-position)
2523 2533
2524(defun gud-sentinel (proc msg) 2534(defun gud-sentinel (proc msg)
@@ -2614,7 +2624,6 @@ Obeying it means displaying in another window the specified file and line."
2614 (widen) 2624 (widen)
2615 (goto-line line) 2625 (goto-line line)
2616 (setq pos (point)) 2626 (setq pos (point))
2617 (setq overlay-arrow-string "=>")
2618 (or gud-overlay-arrow-position 2627 (or gud-overlay-arrow-position
2619 (setq gud-overlay-arrow-position (make-marker))) 2628 (setq gud-overlay-arrow-position (make-marker)))
2620 (set-marker gud-overlay-arrow-position (point) (current-buffer))) 2629 (set-marker gud-overlay-arrow-position (point) (current-buffer)))
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 7015c0d943d..1a87dcaad0f 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -555,14 +555,24 @@ The actual command ends at the end of the first \\(grouping\\)."
555 555
556 556
557 557
558(defvar sh-here-document-word "EOF" 558(defcustom sh-here-document-word "EOF"
559 "Word to delimit here documents. 559 "Word to delimit here documents.
560If the first character of this string is \"-\", this character will 560If the first character of this string is \"-\", this is taken as
561be removed from the string when it is used to close the here document. 561part of the redirection operator, rather than part of the
562This convention is used by the Bash shell, for example, to indicate 562word (that is, \"<<-\" instead of \"<<\"). This is a feature
563that leading tabs inside the here document should be ignored. 563used by some shells (for example Bash) to indicate that leading
564Note that Emacs currently has no support for indenting inside here 564tabs inside the here document should be ignored. In this case,
565documents - you must insert literal tabs by hand.") 565Emacs indents the initial body and end of the here document with
566tabs, to the same level as the start (note that apart from this
567there is no support for indentation of here documents). This
568will only work correctly if `sh-basic-offset' is a multiple of
569`tab-width'.
570
571Any quote characters or leading whitespace in the word are
572removed when closing the here document."
573 :type 'string
574 :group 'sh-script)
575
566 576
567(defvar sh-test 577(defvar sh-test
568 '((sh "[ ]" . 3) 578 '((sh "[ ]" . 3)
@@ -3247,7 +3257,7 @@ t means to return a list of all possible completions of STRING.
3247 (let ((sh-add-buffer (current-buffer))) 3257 (let ((sh-add-buffer (current-buffer)))
3248 (list (completing-read "Variable: " 'sh-add-completer) 3258 (list (completing-read "Variable: " 'sh-add-completer)
3249 (prefix-numeric-value current-prefix-arg)))) 3259 (prefix-numeric-value current-prefix-arg))))
3250 (insert (sh-feature '((bash . "$[ ") 3260 (insert (sh-feature '((bash . "$(( ")
3251 (ksh88 . "$(( ") 3261 (ksh88 . "$(( ")
3252 (posix . "$(( ") 3262 (posix . "$(( ")
3253 (rc . "`{expr $") 3263 (rc . "`{expr $")
@@ -3256,7 +3266,7 @@ t means to return a list of all possible completions of STRING.
3256 (sh-remember-variable var) 3266 (sh-remember-variable var)
3257 (if (< delta 0) " - " " + ") 3267 (if (< delta 0) " - " " + ")
3258 (number-to-string (abs delta)) 3268 (number-to-string (abs delta))
3259 (sh-feature '((bash . " ]") 3269 (sh-feature '((bash . " ))")
3260 (ksh88 . " ))") 3270 (ksh88 . " ))")
3261 (posix . " ))") 3271 (posix . " ))")
3262 (rc . "}") 3272 (rc . "}")
@@ -3482,7 +3492,8 @@ option followed by a colon `:' if the option accepts an argument."
3482 "esac" > 3492 "esac" >
3483 \n "done" 3493 \n "done"
3484 > \n 3494 > \n
3485 "shift " (sh-add "OPTIND" -1) \n)) 3495 "shift " (sh-add "OPTIND" -1) \n
3496 "OPTIND=1" \n))
3486 3497
3487 3498
3488 3499
@@ -3500,7 +3511,6 @@ option followed by a colon `:' if the option accepts an argument."
3500 (match-string 1)))))) 3511 (match-string 1))))))
3501 3512
3502 3513
3503
3504(defun sh-maybe-here-document (arg) 3514(defun sh-maybe-here-document (arg)
3505 "Insert self. Without prefix, following unquoted `<' inserts here document. 3515 "Insert self. Without prefix, following unquoted `<' inserts here document.
3506The document is bounded by `sh-here-document-word'." 3516The document is bounded by `sh-here-document-word'."
@@ -3511,18 +3521,21 @@ The document is bounded by `sh-here-document-word'."
3511 (save-excursion 3521 (save-excursion
3512 (backward-char 2) 3522 (backward-char 2)
3513 (sh-quoted-p)) 3523 (sh-quoted-p))
3514 (progn 3524 (let ((tabs (if (string-match "\\`-" sh-here-document-word)
3525 (make-string (/ (current-indentation) tab-width) ?\t)
3526 ""))
3527 (delim (replace-regexp-in-string "['\"]" ""
3528 sh-here-document-word)))
3515 (insert sh-here-document-word) 3529 (insert sh-here-document-word)
3516 (or (eolp) (looking-at "[ \t]") (insert ? )) 3530 (or (eolp) (looking-at "[ \t]") (insert ? ))
3517 (end-of-line 1) 3531 (end-of-line 1)
3518 (while 3532 (while
3519 (sh-quoted-p) 3533 (sh-quoted-p)
3520 (end-of-line 2)) 3534 (end-of-line 2))
3521 (newline) 3535 (insert ?\n tabs)
3522 (save-excursion 3536 (save-excursion
3523 (insert ?\n (substring 3537 (insert ?\n tabs (replace-regexp-in-string
3524 sh-here-document-word 3538 "\\`-?[ \t]*" "" delim))))))
3525 (if (string-match "^-" sh-here-document-word) 1 0)))))))
3526 3539
3527 3540
3528;; various other commands 3541;; various other commands
@@ -3574,7 +3587,7 @@ With an argument, deletes the backslashes.
3574 3587
3575This function does not modify the last line of the region if the region ends 3588This function does not modify the last line of the region if the region ends
3576right at the start of the following line; it does not modify blank lines 3589right at the start of the following line; it does not modify blank lines
3577at the start of the region. So you can put the region around an entire 3590at the start of the region. So you can put the region around an entire
3578shell command and conveniently use this command." 3591shell command and conveniently use this command."
3579 (interactive "r\nP") 3592 (interactive "r\nP")
3580 (save-excursion 3593 (save-excursion
diff --git a/lisp/repeat.el b/lisp/repeat.el
index aa73c869675..5f0811d355c 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -284,7 +284,9 @@ can be modified by the global variable `repeat-on-final-keystroke'."
284 ;; does not alter it. 284 ;; does not alter it.
285 (let ((real-last-command real-last-command)) 285 (let ((real-last-command real-last-command))
286 (execute-kbd-macro real-last-command)) 286 (execute-kbd-macro real-last-command))
287 (call-interactively real-last-command))))) 287 (run-hooks 'pre-command-hook)
288 (call-interactively real-last-command)
289 (run-hooks 'post-command-hook)))))
288 (when repeat-repeat-char 290 (when repeat-repeat-char
289 ;; A simple recursion here gets into trouble with max-lisp-eval-depth 291 ;; A simple recursion here gets into trouble with max-lisp-eval-depth
290 ;; on long sequences of repetitions of a command like `forward-word' 292 ;; on long sequences of repetitions of a command like `forward-word'
diff --git a/lisp/simple.el b/lisp/simple.el
index 54adc3d3a01..1b7b40a367a 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1279,7 +1279,9 @@ Return 0 if current buffer is not a mini-buffer."
1279(defalias 'advertised-undo 'undo) 1279(defalias 'advertised-undo 'undo)
1280 1280
1281(defconst undo-equiv-table (make-hash-table :test 'eq :weakness t) 1281(defconst undo-equiv-table (make-hash-table :test 'eq :weakness t)
1282 "Table mapping redo records to the corresponding undo one.") 1282 "Table mapping redo records to the corresponding undo one.
1283A redo record for undo-in-region maps to t.
1284A redo record for ordinary undo maps to the following (earlier) undo.")
1283 1285
1284(defvar undo-in-region nil 1286(defvar undo-in-region nil
1285 "Non-nil if `pending-undo-list' is not just a tail of `buffer-undo-list'.") 1287 "Non-nil if `pending-undo-list' is not just a tail of `buffer-undo-list'.")
@@ -1339,7 +1341,7 @@ as an argument limits undo to changes within the current region."
1339 (message (if undo-in-region 1341 (message (if undo-in-region
1340 (if equiv "Redo in region!" "Undo in region!") 1342 (if equiv "Redo in region!" "Undo in region!")
1341 (if equiv "Redo!" "Undo!")))) 1343 (if equiv "Redo!" "Undo!"))))
1342 (when (and equiv undo-no-redo) 1344 (when (and (consp equiv) undo-no-redo)
1343 ;; The equiv entry might point to another redo record if we have done 1345 ;; The equiv entry might point to another redo record if we have done
1344 ;; undo-redo-undo-redo-... so skip to the very last equiv. 1346 ;; undo-redo-undo-redo-... so skip to the very last equiv.
1345 (while (let ((next (gethash equiv undo-equiv-table))) 1347 (while (let ((next (gethash equiv undo-equiv-table)))
@@ -1350,10 +1352,13 @@ as an argument limits undo to changes within the current region."
1350 (prefix-numeric-value arg) 1352 (prefix-numeric-value arg)
1351 1)) 1353 1))
1352 ;; Record the fact that the just-generated undo records come from an 1354 ;; Record the fact that the just-generated undo records come from an
1353 ;; undo operation, so we can skip them later on. 1355 ;; undo operation--that is, they are redo records.
1356 ;; In the ordinary case (not within a region), map the redo
1357 ;; record to the following undos.
1354 ;; I don't know how to do that in the undo-in-region case. 1358 ;; I don't know how to do that in the undo-in-region case.
1355 (unless undo-in-region 1359 (puthash buffer-undo-list
1356 (puthash buffer-undo-list pending-undo-list undo-equiv-table)) 1360 (if undo-in-region t pending-undo-list)
1361 undo-equiv-table)
1357 ;; Don't specify a position in the undo record for the undo command. 1362 ;; Don't specify a position in the undo record for the undo command.
1358 ;; Instead, undoing this should move point to where the change is. 1363 ;; Instead, undoing this should move point to where the change is.
1359 (let ((tail buffer-undo-list) 1364 (let ((tail buffer-undo-list)
@@ -2547,7 +2552,7 @@ The argument is used for internal purposes; do not supply one."
2547;; This is actually used in subr.el but defcustom does not work there. 2552;; This is actually used in subr.el but defcustom does not work there.
2548(defcustom yank-excluded-properties 2553(defcustom yank-excluded-properties
2549 '(read-only invisible intangible field mouse-face help-echo local-map keymap 2554 '(read-only invisible intangible field mouse-face help-echo local-map keymap
2550 yank-handler) 2555 yank-handler follow-link)
2551 "*Text properties to discard when yanking. 2556 "*Text properties to discard when yanking.
2552The value should be a list of text properties to discard or t, 2557The value should be a list of text properties to discard or t,
2553which means to discard all text properties." 2558which means to discard all text properties."
diff --git a/lisp/startup.el b/lisp/startup.el
index 957a97081cd..4bd0db5ab4f 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -719,10 +719,19 @@ opening the first frame (e.g. open a connection to the server).")
719 (and command-line-args 719 (and command-line-args
720 (setcdr command-line-args args))) 720 (setcdr command-line-args args)))
721 721
722 ;; Under X Windows, this creates the X frame and deletes the terminal frame. 722 ;; Under X Window, this creates the X frame and deletes the terminal frame.
723 (when (fboundp 'frame-initialize) 723 (when (fboundp 'frame-initialize)
724 (frame-initialize)) 724 (frame-initialize))
725 725
726 ;; Turn off blinking cursor if so specified in X resources. This is here
727 ;; only because all other settings of no-blinking-cursor are here.
728 (unless (or noninteractive
729 emacs-basic-display
730 (and (memq window-system '(x w32 mac))
731 (not (member (x-get-resource "cursorBlink" "CursorBlink")
732 '("off" "false")))))
733 (setq no-blinking-cursor t))
734
726 ;; If frame was created with a menu bar, set menu-bar-mode on. 735 ;; If frame was created with a menu bar, set menu-bar-mode on.
727 (unless (or noninteractive 736 (unless (or noninteractive
728 emacs-basic-display 737 emacs-basic-display
@@ -742,6 +751,9 @@ opening the first frame (e.g. open a connection to the server).")
742 (custom-reevaluate-setting 'blink-cursor-mode) 751 (custom-reevaluate-setting 'blink-cursor-mode)
743 (custom-reevaluate-setting 'normal-erase-is-backspace) 752 (custom-reevaluate-setting 'normal-erase-is-backspace)
744 753
754 ;; If you change the code below, you need to also change the
755 ;; corresponding code in the tooltip-mode defcustom. The two need
756 ;; to be equivalent under all conditions, or Custom will get confused.
745 (unless (or noninteractive 757 (unless (or noninteractive
746 emacs-basic-display 758 emacs-basic-display
747 (not (display-graphic-p)) 759 (not (display-graphic-p))
@@ -1067,15 +1079,15 @@ Each element in the list should be a list of strings or pairs
1067 :group 'initialization) 1079 :group 'initialization)
1068 1080
1069 1081
1070(defcustom fancy-splash-delay 10 1082(defcustom fancy-splash-delay 7
1071 "*Delay in seconds between splash screens." 1083 "*Delay in seconds between splash screens."
1072 :group 'fancy-splash-screen 1084 :group 'fancy-splash-screen
1073 :type 'integer) 1085 :type 'integer)
1074 1086
1075 1087
1076(defcustom fancy-splash-max-time 60 1088(defcustom fancy-splash-max-time 30
1077 "*Show splash screens for at most this number of seconds. 1089 "*Show splash screens for at most this number of seconds.
1078Values less than 60 seconds are ignored." 1090Values less than twice `fancy-splash-delay' are ignored."
1079 :group 'fancy-splash-screen 1091 :group 'fancy-splash-screen
1080 :type 'integer) 1092 :type 'integer)
1081 1093
@@ -1253,7 +1265,7 @@ mouse."
1253 mode-line-format (propertize "---- %b %-" 1265 mode-line-format (propertize "---- %b %-"
1254 'face '(:weight bold)) 1266 'face '(:weight bold))
1255 fancy-splash-stop-time (+ (float-time) 1267 fancy-splash-stop-time (+ (float-time)
1256 (max 60 fancy-splash-max-time)) 1268 fancy-splash-max-time)
1257 timer (run-with-timer 0 fancy-splash-delay 1269 timer (run-with-timer 0 fancy-splash-delay
1258 #'fancy-splash-screens-1 1270 #'fancy-splash-screens-1
1259 splash-buffer)) 1271 splash-buffer))
diff --git a/lisp/term.el b/lisp/term.el
index 8643ea69fc0..b1ce432144e 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -684,14 +684,13 @@ Buffer local variable.")
684(defvar term-ansi-at-save-user nil) 684(defvar term-ansi-at-save-user nil)
685(defvar term-ansi-at-save-pwd nil) 685(defvar term-ansi-at-save-pwd nil)
686(defvar term-ansi-at-save-anon nil) 686(defvar term-ansi-at-save-anon nil)
687(defvar term-ansi-current-bold 0) 687(defvar term-ansi-current-bold nil)
688(defvar term-ansi-current-color 0) 688(defvar term-ansi-current-color 0)
689(defvar term-ansi-face-already-done 0) 689(defvar term-ansi-face-already-done nil)
690(defvar term-ansi-current-bg-color 0) 690(defvar term-ansi-current-bg-color 0)
691(defvar term-ansi-current-underline 0) 691(defvar term-ansi-current-underline nil)
692(defvar term-ansi-current-highlight 0) 692(defvar term-ansi-current-reverse nil)
693(defvar term-ansi-current-reverse 0) 693(defvar term-ansi-current-invisible nil)
694(defvar term-ansi-current-invisible 0)
695 694
696;;; Four should be enough, if you want more, just add. -mm 695;;; Four should be enough, if you want more, just add. -mm
697(defvar term-terminal-more-parameters 0) 696(defvar term-terminal-more-parameters 0)
@@ -732,8 +731,7 @@ is buffer-local.")
732 [ "Enable paging" term-pager-toggle (not term-pager-count)] 731 [ "Enable paging" term-pager-toggle (not term-pager-count)]
733 [ "Disable paging" term-pager-toggle term-pager-count]))) 732 [ "Disable paging" term-pager-toggle term-pager-count])))
734 733
735(if term-mode-map 734(unless term-mode-map
736 nil
737 (setq term-mode-map (make-sparse-keymap)) 735 (setq term-mode-map (make-sparse-keymap))
738 (define-key term-mode-map "\ep" 'term-previous-input) 736 (define-key term-mode-map "\ep" 'term-previous-input)
739 (define-key term-mode-map "\en" 'term-next-input) 737 (define-key term-mode-map "\en" 'term-next-input)
@@ -1062,7 +1060,6 @@ Entry to this mode runs the hooks on `term-mode-hook'."
1062 (make-local-variable 'term-ansi-face-already-done) 1060 (make-local-variable 'term-ansi-face-already-done)
1063 (make-local-variable 'term-ansi-current-bg-color) 1061 (make-local-variable 'term-ansi-current-bg-color)
1064 (make-local-variable 'term-ansi-current-underline) 1062 (make-local-variable 'term-ansi-current-underline)
1065 (make-local-variable 'term-ansi-current-highlight)
1066 (make-local-variable 'term-ansi-current-reverse) 1063 (make-local-variable 'term-ansi-current-reverse)
1067 (make-local-variable 'term-ansi-current-invisible) 1064 (make-local-variable 'term-ansi-current-invisible)
1068 1065
@@ -2509,14 +2506,14 @@ See `term-prompt-regexp'."
2509(defun term-horizontal-column () 2506(defun term-horizontal-column ()
2510 (- (term-current-column) (term-start-line-column))) 2507 (- (term-current-column) (term-start-line-column)))
2511 2508
2512;; Calls either vertical-motion or buffer-vertical-motion 2509;; Calls either vertical-motion or term-buffer-vertical-motion
2513(defmacro term-vertical-motion (count) 2510(defmacro term-vertical-motion (count)
2514 (list 'funcall 'term-vertical-motion count)) 2511 (list 'funcall 'term-vertical-motion count))
2515 2512
2516;; An emulation of vertical-motion that is independent of having a window. 2513;; An emulation of vertical-motion that is independent of having a window.
2517;; Instead, it uses the term-width variable as the logical window width. 2514;; Instead, it uses the term-width variable as the logical window width.
2518 2515
2519(defun buffer-vertical-motion (count) 2516(defun term-buffer-vertical-motion (count)
2520 (cond ((= count 0) 2517 (cond ((= count 0)
2521 (move-to-column (* term-width (/ (current-column) term-width))) 2518 (move-to-column (* term-width (/ (current-column) term-width)))
2522 0) 2519 0)
@@ -2701,7 +2698,7 @@ See `term-prompt-regexp'."
2701 (setq term-vertical-motion (symbol-function 'vertical-motion)) 2698 (setq term-vertical-motion (symbol-function 'vertical-motion))
2702 (term-check-size proc)) 2699 (term-check-size proc))
2703 (setq term-vertical-motion 2700 (setq term-vertical-motion
2704 (symbol-function 'buffer-vertical-motion))) 2701 (symbol-function 'term-buffer-vertical-motion)))
2705 2702
2706 (setq save-marker (copy-marker (process-mark proc))) 2703 (setq save-marker (copy-marker (process-mark proc)))
2707 2704
@@ -3041,12 +3038,12 @@ See `term-prompt-regexp'."
3041 (setq term-current-column 1) 3038 (setq term-current-column 1)
3042 (setq term-insert-mode nil) 3039 (setq term-insert-mode nil)
3043 (setq term-current-face nil) 3040 (setq term-current-face nil)
3044 (setq term-ansi-current-underline 0) 3041 (setq term-ansi-current-underline nil)
3045 (setq term-ansi-current-bold 0) 3042 (setq term-ansi-current-bold nil)
3046 (setq term-ansi-current-reverse 0) 3043 (setq term-ansi-current-reverse nil)
3047 (setq term-ansi-current-color 0) 3044 (setq term-ansi-current-color 0)
3048 (setq term-ansi-current-invisible 0) 3045 (setq term-ansi-current-invisible nil)
3049 (setq term-ansi-face-already-done 0) 3046 (setq term-ansi-face-already-done nil)
3050 (setq term-ansi-current-bg-color 0)) 3047 (setq term-ansi-current-bg-color 0))
3051 3048
3052;;; New function to deal with ansi colorized output, as you can see you can 3049;;; New function to deal with ansi colorized output, as you can see you can
@@ -3057,32 +3054,32 @@ See `term-prompt-regexp'."
3057 3054
3058;;; Bold (terminfo: bold) 3055;;; Bold (terminfo: bold)
3059 ((eq parameter 1) 3056 ((eq parameter 1)
3060 (setq term-ansi-current-bold 1)) 3057 (setq term-ansi-current-bold t))
3061 3058
3062;;; Underline 3059;;; Underline
3063 ((eq parameter 4) 3060 ((eq parameter 4)
3064 (setq term-ansi-current-underline 1)) 3061 (setq term-ansi-current-underline t))
3065 3062
3066;;; Blink (unsupported by Emacs), will be translated to bold. 3063;;; Blink (unsupported by Emacs), will be translated to bold.
3067;;; This may change in the future though. 3064;;; This may change in the future though.
3068 ((eq parameter 5) 3065 ((eq parameter 5)
3069 (setq term-ansi-current-bold 1)) 3066 (setq term-ansi-current-bold t))
3070 3067
3071;;; Reverse 3068;;; Reverse
3072 ((eq parameter 7) 3069 ((eq parameter 7)
3073 (setq term-ansi-current-reverse 1)) 3070 (setq term-ansi-current-reverse t))
3074 3071
3075;;; Invisible 3072;;; Invisible
3076 ((eq parameter 8) 3073 ((eq parameter 8)
3077 (setq term-ansi-current-invisible 1)) 3074 (setq term-ansi-current-invisible t))
3078 3075
3079;;; Reset underline (i.e. terminfo rmul) 3076;;; Reset underline (i.e. terminfo rmul)
3080 ((eq parameter 24) 3077 ((eq parameter 24)
3081 (setq term-ansi-current-underline 0)) 3078 (setq term-ansi-current-underline nil))
3082 3079
3083;;; Reset reverse (i.e. terminfo rmso) 3080;;; Reset reverse (i.e. terminfo rmso)
3084 ((eq parameter 27) 3081 ((eq parameter 27)
3085 (setq term-ansi-current-reverse 0)) 3082 (setq term-ansi-current-reverse nil))
3086 3083
3087;;; Foreground 3084;;; Foreground
3088 ((and (>= parameter 30) (<= parameter 37)) 3085 ((and (>= parameter 30) (<= parameter 37))
@@ -3103,12 +3100,12 @@ See `term-prompt-regexp'."
3103;;; 0 (Reset) or unknown (reset anyway) 3100;;; 0 (Reset) or unknown (reset anyway)
3104 (t 3101 (t
3105 (setq term-current-face nil) 3102 (setq term-current-face nil)
3106 (setq term-ansi-current-underline 0) 3103 (setq term-ansi-current-underline nil)
3107 (setq term-ansi-current-bold 0) 3104 (setq term-ansi-current-bold nil)
3108 (setq term-ansi-current-reverse 0) 3105 (setq term-ansi-current-reverse nil)
3109 (setq term-ansi-current-color 0) 3106 (setq term-ansi-current-color 0)
3110 (setq term-ansi-current-invisible 0) 3107 (setq term-ansi-current-invisible nil)
3111 (setq term-ansi-face-already-done 1) 3108 (setq term-ansi-face-already-done t)
3112 (setq term-ansi-current-bg-color 0))) 3109 (setq term-ansi-current-bg-color 0)))
3113 3110
3114; (message "Debug: U-%d R-%d B-%d I-%d D-%d F-%d B-%d" 3111; (message "Debug: U-%d R-%d B-%d I-%d D-%d F-%d B-%d"
@@ -3121,9 +3118,9 @@ See `term-prompt-regexp'."
3121; term-ansi-current-bg-color) 3118; term-ansi-current-bg-color)
3122 3119
3123 3120
3124 (if (= term-ansi-face-already-done 0) 3121 (unless term-ansi-face-already-done
3125 (if (= term-ansi-current-reverse 1) 3122 (if term-ansi-current-reverse
3126 (if (= term-ansi-current-invisible 1) 3123 (if term-ansi-current-invisible
3127 (setq term-current-face 3124 (setq term-current-face
3128 (if (= term-ansi-current-color 0) 3125 (if (= term-ansi-current-color 0)
3129 (list :background 3126 (list :background
@@ -3145,13 +3142,13 @@ See `term-prompt-regexp'."
3145 (if (= term-ansi-current-bg-color 0) 3142 (if (= term-ansi-current-bg-color 0)
3146 (face-background 'default) 3143 (face-background 'default)
3147 (elt ansi-term-color-vector term-ansi-current-bg-color)))) 3144 (elt ansi-term-color-vector term-ansi-current-bg-color))))
3148 (if (= term-ansi-current-bold 1) 3145 (when term-ansi-current-bold
3149 (setq term-current-face 3146 (setq term-current-face
3150 (append '(:weight bold) term-current-face))) 3147 (append '(:weight bold) term-current-face)))
3151 (if (= term-ansi-current-underline 1) 3148 (when term-ansi-current-underline
3152 (setq term-current-face 3149 (setq term-current-face
3153 (append '(:underline t) term-current-face)))) 3150 (append '(:underline t) term-current-face))))
3154 (if (= term-ansi-current-invisible 1) 3151 (if term-ansi-current-invisible
3155 (setq term-current-face 3152 (setq term-current-face
3156 (if (= term-ansi-current-bg-color 0) 3153 (if (= term-ansi-current-bg-color 0)
3157 (list :background 3154 (list :background
@@ -3169,15 +3166,15 @@ See `term-prompt-regexp'."
3169 (elt ansi-term-color-vector term-ansi-current-color) 3166 (elt ansi-term-color-vector term-ansi-current-color)
3170 :background 3167 :background
3171 (elt ansi-term-color-vector term-ansi-current-bg-color))) 3168 (elt ansi-term-color-vector term-ansi-current-bg-color)))
3172 (if (= term-ansi-current-bold 1) 3169 (when term-ansi-current-bold
3173 (setq term-current-face 3170 (setq term-current-face
3174 (append '(:weight bold) term-current-face))) 3171 (append '(:weight bold) term-current-face)))
3175 (if (= term-ansi-current-underline 1) 3172 (when term-ansi-current-underline
3176 (setq term-current-face 3173 (setq term-current-face
3177 (append '(:underline t) term-current-face)))))) 3174 (append '(:underline t) term-current-face))))))
3178 3175
3179;;; (message "Debug %S" term-current-face) 3176;;; (message "Debug %S" term-current-face)
3180 (setq term-ansi-face-already-done 0)) 3177 (setq term-ansi-face-already-done nil))
3181 3178
3182 3179
3183;;; Handle a character assuming (eq terminal-state 2) - 3180;;; Handle a character assuming (eq terminal-state 2) -
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index cdf81f02ce2..d5fd541c727 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -77,7 +77,7 @@
77;;(require 'select) 77;;(require 'select)
78(require 'menu-bar) 78(require 'menu-bar)
79(require 'fontset) 79(require 'fontset)
80(require 'x-dnd) 80(require 'dnd)
81 81
82(defvar x-invocation-args) 82(defvar x-invocation-args)
83 83
@@ -1085,13 +1085,38 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
1085(put 'escape 'ascii-character ?\e) 1085(put 'escape 'ascii-character ?\e)
1086 1086
1087 1087
1088;;;; Keysyms 1088;;;; Script codes and coding systems
1089 1089(defconst mac-script-code-coding-systems
1090;; Define constant values to be set to mac-keyboard-text-encoding 1090 '((0 . mac-roman) ; smRoman
1091(defconst kTextEncodingMacRoman 0) 1091 (1 . japanese-shift-jis) ; smJapanese
1092(defconst kTextEncodingISOLatin1 513 "0x201") 1092 (2 . chinese-big5) ; smTradChinese
1093(defconst kTextEncodingISOLatin2 514 "0x202") 1093 (3 . korean-iso-8bit) ; smKorean
1094 1094 (7 . mac-cyrillic) ; smCyrillic
1095 (25 . chinese-iso-8bit) ; smSimpChinese
1096 (29 . mac-centraleurroman) ; smCentralEuroRoman
1097 )
1098 "Alist of Mac script codes vs Emacs coding systems.")
1099
1100(defconst mac-system-coding-system
1101 (let ((base (or (cdr (assq mac-system-script-code
1102 mac-script-code-coding-systems))
1103 'mac-roman)))
1104 (if (eq system-type 'darwin)
1105 base
1106 (coding-system-change-eol-conversion base 'mac)))
1107 "Coding system derived from the system script code.")
1108
1109;;;; Keyboard layout/language change events
1110(defun mac-handle-language-change (event)
1111 (interactive "e")
1112 (let ((coding-system
1113 (cdr (assq (car (cadr event)) mac-script-code-coding-systems))))
1114 (set-keyboard-coding-system (or coding-system 'mac-roman))
1115 ;; MacJapanese maps reverse solidus to ?\x80.
1116 (if (eq coding-system 'japanese-shift-jis)
1117 (define-key key-translation-map [?\x80] "\\"))))
1118
1119(define-key special-event-map [language-change] 'mac-handle-language-change)
1095 1120
1096;;;; Selections and cut buffers 1121;;;; Selections and cut buffers
1097 1122
@@ -1139,21 +1164,14 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
1139 1164
1140(setq frame-creation-function 'x-create-frame-with-faces) 1165(setq frame-creation-function 'x-create-frame-with-faces)
1141 1166
1142(define-ccl-program ccl-encode-mac-roman-font 1167(cp-make-coding-system
1143 `(0 1168 mac-centraleurroman
1144 (if (r0 != ,(charset-id 'ascii)) 1169 (apply
1145 (if (r0 <= ?\x8f) 1170 'vector
1146 (translate-character mac-roman-encoder r0 r1) 1171 (mapcar
1147 ((r1 <<= 7) 1172 (lambda (c) (decode-char 'ucs c))
1148 (r1 |= r2) 1173 ;; mac-centraleurroman (128..255) -> UCS mapping
1149 (translate-character mac-roman-encoder r0 r1))))) 1174 [ #x00C4 ;; 128:LATIN CAPITAL LETTER A WITH DIAERESIS
1150 "CCL program for Mac Roman font")
1151
1152(let
1153 ((encoding-vector (make-vector 256 nil))
1154 (i 0)
1155 (vec ;; mac-centraleurroman (128..255) -> UCS mapping
1156 [ #x00C4 ;; 128:LATIN CAPITAL LETTER A WITH DIAERESIS
1157 #x0100 ;; 129:LATIN CAPITAL LETTER A WITH MACRON 1175 #x0100 ;; 129:LATIN CAPITAL LETTER A WITH MACRON
1158 #x0101 ;; 130:LATIN SMALL LETTER A WITH MACRON 1176 #x0101 ;; 130:LATIN SMALL LETTER A WITH MACRON
1159 #x00C9 ;; 131:LATIN CAPITAL LETTER E WITH ACUTE 1177 #x00C9 ;; 131:LATIN CAPITAL LETTER E WITH ACUTE
@@ -1281,26 +1299,18 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
1281 #x017C ;; 253:LATIN SMALL LETTER Z WITH DOT ABOVE 1299 #x017C ;; 253:LATIN SMALL LETTER Z WITH DOT ABOVE
1282 #x0122 ;; 254:LATIN CAPITAL LETTER G WITH CEDILLA 1300 #x0122 ;; 254:LATIN CAPITAL LETTER G WITH CEDILLA
1283 #x02C7 ;; 255:CARON 1301 #x02C7 ;; 255:CARON
1284 ]) 1302 ]))
1285 translation-table) 1303 "Mac Central European Roman Encoding (MIME:x-mac-centraleurroman).")
1286 (while (< i 128) 1304(coding-system-put 'mac-centraleurroman 'mime-charset 'x-mac-centraleurroman)
1287 (aset encoding-vector i i) 1305
1288 (setq i (1+ i))) 1306(cp-make-coding-system
1289 (while (< i 256) 1307 mac-cyrillic
1290 (aset encoding-vector i 1308 (apply
1291 (decode-char 'ucs (aref vec (- i 128)))) 1309 'vector
1292 (setq i (1+ i))) 1310 (mapcar
1293 (setq translation-table 1311 (lambda (c) (decode-char 'ucs c))
1294 (make-translation-table-from-vector encoding-vector)) 1312 ;; mac-cyrillic (128..255) -> UCS mapping
1295;; (define-translation-table 'mac-centraleurroman-decoder translation-table) 1313 [ #x0410 ;; 128:CYRILLIC CAPITAL LETTER A
1296 (define-translation-table 'mac-centraleurroman-encoder
1297 (char-table-extra-slot translation-table 0)))
1298
1299(let
1300 ((encoding-vector (make-vector 256 nil))
1301 (i 0)
1302 (vec ;; mac-cyrillic (128..255) -> UCS mapping
1303 [ #x0410 ;; 128:CYRILLIC CAPITAL LETTER A
1304 #x0411 ;; 129:CYRILLIC CAPITAL LETTER BE 1314 #x0411 ;; 129:CYRILLIC CAPITAL LETTER BE
1305 #x0412 ;; 130:CYRILLIC CAPITAL LETTER VE 1315 #x0412 ;; 130:CYRILLIC CAPITAL LETTER VE
1306 #x0413 ;; 131:CYRILLIC CAPITAL LETTER GHE 1316 #x0413 ;; 131:CYRILLIC CAPITAL LETTER GHE
@@ -1428,27 +1438,16 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
1428 #x044D ;; 253:CYRILLIC SMALL LETTER E 1438 #x044D ;; 253:CYRILLIC SMALL LETTER E
1429 #x044E ;; 254:CYRILLIC SMALL LETTER YU 1439 #x044E ;; 254:CYRILLIC SMALL LETTER YU
1430 #x20AC ;; 255:EURO SIGN 1440 #x20AC ;; 255:EURO SIGN
1431 ]) 1441 ]))
1432 translation-table) 1442 "Mac Cyrillic Encoding (MIME:x-mac-cyrillic).")
1433 (while (< i 128) 1443(coding-system-put 'mac-cyrillic 'mime-charset 'x-mac-cyrillic)
1434 (aset encoding-vector i i)
1435 (setq i (1+ i)))
1436 (while (< i 256)
1437 (aset encoding-vector i
1438 (decode-char 'ucs (aref vec (- i 128))))
1439 (setq i (1+ i)))
1440 (setq translation-table
1441 (make-translation-table-from-vector encoding-vector))
1442;; (define-translation-table 'mac-cyrillic-decoder translation-table)
1443 (define-translation-table 'mac-cyrillic-encoder
1444 (char-table-extra-slot translation-table 0)))
1445 1444
1446(defvar mac-font-encoder-list 1445(defvar mac-font-encoder-list
1447 '(("mac-roman" mac-roman-encoder 1446 '(("mac-roman" mac-roman-encoder
1448 ccl-encode-mac-roman-font "%s") 1447 ccl-encode-mac-roman-font "%s")
1449 ("mac-centraleurroman" mac-centraleurroman-encoder 1448 ("mac-centraleurroman" encode-mac-centraleurroman
1450 ccl-encode-mac-centraleurroman-font "%s ce") 1449 ccl-encode-mac-centraleurroman-font "%s ce")
1451 ("mac-cyrillic" mac-cyrillic-encoder 1450 ("mac-cyrillic" encode-mac-cyrillic
1452 ccl-encode-mac-cyrillic-font "%s cy"))) 1451 ccl-encode-mac-cyrillic-font "%s cy")))
1453 1452
1454(let ((encoder-list 1453(let ((encoder-list
@@ -1468,24 +1467,34 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
1468 (if mac-encoded 1467 (if mac-encoded
1469 (aset table c mac-encoded)))))))) 1468 (aset table c mac-encoded))))))))
1470 1469
1470(define-ccl-program ccl-encode-mac-roman-font
1471 `(0
1472 (if (r0 != ,(charset-id 'ascii))
1473 (if (r0 <= ?\x8f)
1474 (translate-character mac-roman-encoder r0 r1)
1475 ((r1 <<= 7)
1476 (r1 |= r2)
1477 (translate-character mac-roman-encoder r0 r1)))))
1478 "CCL program for Mac Roman font")
1479
1471(define-ccl-program ccl-encode-mac-centraleurroman-font 1480(define-ccl-program ccl-encode-mac-centraleurroman-font
1472 `(0 1481 `(0
1473 (if (r0 != ,(charset-id 'ascii)) 1482 (if (r0 != ,(charset-id 'ascii))
1474 (if (r0 <= ?\x8f) 1483 (if (r0 <= ?\x8f)
1475 (translate-character mac-centraleurroman-encoder r0 r1) 1484 (translate-character encode-mac-centraleurroman r0 r1)
1476 ((r1 <<= 7) 1485 ((r1 <<= 7)
1477 (r1 |= r2) 1486 (r1 |= r2)
1478 (translate-character mac-centraleurroman-encoder r0 r1))))) 1487 (translate-character encode-mac-centraleurroman r0 r1)))))
1479 "CCL program for Mac Central European Roman font") 1488 "CCL program for Mac Central European Roman font")
1480 1489
1481(define-ccl-program ccl-encode-mac-cyrillic-font 1490(define-ccl-program ccl-encode-mac-cyrillic-font
1482 `(0 1491 `(0
1483 (if (r0 != ,(charset-id 'ascii)) 1492 (if (r0 != ,(charset-id 'ascii))
1484 (if (r0 <= ?\x8f) 1493 (if (r0 <= ?\x8f)
1485 (translate-character mac-cyrillic-encoder r0 r1) 1494 (translate-character encode-mac-cyrillic r0 r1)
1486 ((r1 <<= 7) 1495 ((r1 <<= 7)
1487 (r1 |= r2) 1496 (r1 |= r2)
1488 (translate-character mac-cyrillic-encoder r0 r1))))) 1497 (translate-character encode-mac-cyrillic r0 r1)))))
1489 "CCL program for Mac Cyrillic font") 1498 "CCL program for Mac Cyrillic font")
1490 1499
1491 1500
@@ -1648,8 +1657,8 @@ Switch to a buffer editing the last file dropped."
1648 (if (and (> start 0) (> end 0)) 1657 (if (and (> start 0) (> end 0))
1649 (progn (set-mark start) 1658 (progn (set-mark start)
1650 (goto-char end))))) 1659 (goto-char end)))))
1651 (x-dnd-handle-one-url window 'private 1660 (dnd-handle-one-url window 'private
1652 (concat "file:" file-name)))) 1661 (concat "file:" file-name))))
1653 (car (cdr (cdr event))))) 1662 (car (cdr (cdr event)))))
1654 (raise-frame)) 1663 (raise-frame))
1655 1664
@@ -1739,14 +1748,11 @@ Switch to a buffer editing the last file dropped."
1739 ;; started (see run_mac_command in sysdep.c). 1748 ;; started (see run_mac_command in sysdep.c).
1740 (setq shell-file-name "sh") 1749 (setq shell-file-name "sh")
1741 1750
1742 ;; To display filenames in Chinese or Japanese, replace mac-roman with 1751 ;; Some system variables are encoded with the system script code.
1743 ;; big5 or sjis 1752 (dolist (v '(system-name
1744 (setq file-name-coding-system 'mac-roman)) 1753 emacs-build-system ; Mac OS 9 version cannot dump
1745 1754 user-login-name user-real-login-name user-full-name))
1746;; X Window emulation in macterm.c is not complete enough to start a 1755 (set v (decode-coding-string (symbol-value v) mac-system-coding-system))))
1747;; frame without a minibuffer properly. Call this to tell ediff
1748;; library to use a single frame.
1749; (ediff-toggle-multiframe)
1750 1756
1751;; If Emacs is started from the Finder, change the default directory 1757;; If Emacs is started from the Finder, change the default directory
1752;; to the user's home directory. 1758;; to the user's home directory.
@@ -1763,7 +1769,5 @@ Switch to a buffer editing the last file dropped."
1763;; or bold bitmap versions will not display these variants correctly. 1769;; or bold bitmap versions will not display these variants correctly.
1764(setq scalable-fonts-allowed t) 1770(setq scalable-fonts-allowed t)
1765 1771
1766;; (prefer-coding-system 'mac-roman)
1767
1768;; arch-tag: 71dfcd14-cde8-4d66-b05c-85ec94fb23a6 1772;; arch-tag: 71dfcd14-cde8-4d66-b05c-85ec94fb23a6
1769;;; mac-win.el ends here 1773;;; mac-win.el ends here
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index 69e5c0e793b..862f3fe1d0a 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -76,7 +76,7 @@
76(require 'faces) 76(require 'faces)
77(require 'select) 77(require 'select)
78(require 'menu-bar) 78(require 'menu-bar)
79(require 'x-dnd) 79(require 'dnd)
80(require 'code-pages) 80(require 'code-pages)
81 81
82;; Conditional on new-fontset so bootstrapping works on non-GUI compiles 82;; Conditional on new-fontset so bootstrapping works on non-GUI compiles
@@ -109,8 +109,8 @@ Switch to a buffer editing the last file dropped."
109 (if (and (> x 0) (> y 0)) 109 (if (and (> x 0) (> y 0))
110 (set-frame-selected-window nil window)) 110 (set-frame-selected-window nil window))
111 (mapcar (lambda (file-name) 111 (mapcar (lambda (file-name)
112 (x-dnd-handle-one-url window 'private 112 (dnd-handle-one-url window 'private
113 (concat "file:" file-name))) 113 (concat "file:" file-name)))
114 (car (cdr (cdr event))))) 114 (car (cdr (cdr event)))))
115 (raise-frame))) 115 (raise-frame)))
116 116
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index d9de658c158..96f79f6c864 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -53,15 +53,85 @@
53 (define-key map "\e[24~" [f12]) 53 (define-key map "\e[24~" [f12])
54 (define-key map "\e[29~" [print]) 54 (define-key map "\e[29~" [print])
55 55
56 (define-key map "\e[11;2~" [S-f1])
57 (define-key map "\e[12;2~" [S-f2])
58 (define-key map "\e[13;2~" [S-f3])
59 (define-key map "\e[14;2~" [S-f4])
60 (define-key map "\e[15;2~" [S-f5])
61 (define-key map "\e[17;2~" [S-f6])
62 (define-key map "\e[18;2~" [S-f7])
63 (define-key map "\e[19;2~" [S-f8])
64 (define-key map "\e[20;2~" [S-f9])
65 (define-key map "\e[21;2~" [S-f10])
66 (define-key map "\e[23;2~" [S-f11])
67 (define-key map "\e[24;2~" [S-f12])
68
69 (define-key map "\e[11;5~" [C-f1])
70 (define-key map "\e[12;5~" [C-f2])
71 (define-key map "\e[13;5~" [C-f3])
72 (define-key map "\e[14;5~" [C-f4])
73 (define-key map "\e[15;5~" [C-f5])
74 (define-key map "\e[17;5~" [C-f6])
75 (define-key map "\e[18;5~" [C-f7])
76 (define-key map "\e[19;5~" [C-f8])
77 (define-key map "\e[20;5~" [C-f9])
78 (define-key map "\e[21;5~" [C-f10])
79 (define-key map "\e[23;5~" [C-f11])
80 (define-key map "\e[24;5~" [C-f12])
81
82 (define-key map "\e[11;6~" [C-S-f1])
83 (define-key map "\e[12;6~" [C-S-f2])
84 (define-key map "\e[13;6~" [C-S-f3])
85 (define-key map "\e[14;6~" [C-S-f4])
86 (define-key map "\e[15;6~" [C-S-f5])
87 (define-key map "\e[17;6~" [C-S-f6])
88 (define-key map "\e[18;6~" [C-S-f7])
89 (define-key map "\e[19;6~" [C-S-f8])
90 (define-key map "\e[20;6~" [C-S-f9])
91 (define-key map "\e[21;6~" [C-S-f10])
92 (define-key map "\e[23;6~" [C-S-f11])
93 (define-key map "\e[24;6~" [C-S-f12])
94
95 (define-key map "\e[11;3~" [A-f1])
96 (define-key map "\e[12;3~" [A-f2])
97 (define-key map "\e[13;3~" [A-f3])
98 (define-key map "\e[14;3~" [A-f4])
99 (define-key map "\e[15;3~" [A-f5])
100 (define-key map "\e[17;3~" [A-f6])
101 (define-key map "\e[18;3~" [A-f7])
102 (define-key map "\e[19;3~" [A-f8])
103 (define-key map "\e[20;3~" [A-f9])
104 (define-key map "\e[21;3~" [A-f10])
105 (define-key map "\e[23;3~" [A-f11])
106 (define-key map "\e[24;3~" [A-f12])
107
56 (define-key map "\e[1;2A" [S-up]) 108 (define-key map "\e[1;2A" [S-up])
57 (define-key map "\e[1;2B" [S-down]) 109 (define-key map "\e[1;2B" [S-down])
58 (define-key map "\e[1;2C" [S-right]) 110 (define-key map "\e[1;2C" [S-right])
59 (define-key map "\e[1;2D" [S-left]) 111 (define-key map "\e[1;2D" [S-left])
112 (define-key map "\e[1;2F" [S-end])
113 (define-key map "\e[1;2H" [S-home])
60 114
61 (define-key map "\e[1;5A" [C-up]) 115 (define-key map "\e[1;5A" [C-up])
62 (define-key map "\e[1;5B" [C-down]) 116 (define-key map "\e[1;5B" [C-down])
63 (define-key map "\e[1;5C" [C-right]) 117 (define-key map "\e[1;5C" [C-right])
64 (define-key map "\e[1;5D" [C-left]) 118 (define-key map "\e[1;5D" [C-left])
119 (define-key map "\e[1;5F" [C-end])
120 (define-key map "\e[1;5H" [C-home])
121
122 (define-key map "\e[1;6A" [C-S-up])
123 (define-key map "\e[1;6B" [C-S-down])
124 (define-key map "\e[1;6C" [C-S-right])
125 (define-key map "\e[1;6D" [C-S-left])
126 (define-key map "\e[1;6F" [C-S-end])
127 (define-key map "\e[1;6H" [C-S-home])
128
129 (define-key map "\e[1;3A" [A-up])
130 (define-key map "\e[1;3B" [A-down])
131 (define-key map "\e[1;3C" [A-right])
132 (define-key map "\e[1;3D" [A-left])
133 (define-key map "\e[1;3F" [A-end])
134 (define-key map "\e[1;3H" [A-home])
65 135
66 (define-key map "\e[2;2~" [S-insert]) 136 (define-key map "\e[2;2~" [S-insert])
67 (define-key map "\e[3;2~" [S-delete]) 137 (define-key map "\e[3;2~" [S-delete])
@@ -73,6 +143,16 @@
73 (define-key map "\e[5;5~" [C-prior]) 143 (define-key map "\e[5;5~" [C-prior])
74 (define-key map "\e[6;5~" [C-next]) 144 (define-key map "\e[6;5~" [C-next])
75 145
146 (define-key map "\e[2;6~" [C-S-insert])
147 (define-key map "\e[3;6~" [C-S-delete])
148 (define-key map "\e[5;6~" [C-S-prior])
149 (define-key map "\e[6;6~" [C-S-next])
150
151 (define-key map "\e[2;3~" [A-insert])
152 (define-key map "\e[3;3~" [A-delete])
153 (define-key map "\e[5;3~" [A-prior])
154 (define-key map "\e[6;3~" [A-next])
155
76 (define-key map "\eOA" [up]) 156 (define-key map "\eOA" [up])
77 (define-key map "\eOB" [down]) 157 (define-key map "\eOB" [down])
78 (define-key map "\eOC" [right]) 158 (define-key map "\eOC" [right])
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index 06d4e697d55..c162160397e 100644
--- a/lisp/textmodes/org.el
+++ b/lisp/textmodes/org.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <dominik at science dot uva dot nl> 5;; Author: Carsten Dominik <dominik at science dot uva dot nl>
6;; Keywords: outlines, hypermedia, calendar 6;; Keywords: outlines, hypermedia, calendar
7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ 7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
8;; Version: 3.05 8;; Version: 3.06
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -74,11 +74,18 @@
74;; Documentation 74;; Documentation
75;; ------------- 75;; -------------
76;; The documentation of Org-mode can be found in the TeXInfo file. 76;; The documentation of Org-mode can be found in the TeXInfo file.
77;; This distribution also contains a PDF version of it. At the homepage 77;; The distribution also contains a PDF version of it. At the homepage
78;; of Org-mode, you can read online the same text online as HTML. 78;; of Org-mode, you can read the same text online as HTML.
79;; 79;;
80;; Changes: 80;; Changes:
81;; ------- 81;; -------
82;; Version 3.06
83;; - M-S-RET inserts a new TODO heading.
84;; - New startup option `content'.
85;; - Better visual response when TODO items in agenda change status.
86;; - Window positioning after visibility state changes optimized and made
87;; configurable. See `org-cycle-hook' and `org-occur-hook'.
88;;
82;; Version 3.05 89;; Version 3.05
83;; - Agenda entries from the diary are linked to the diary file, so 90;; - Agenda entries from the diary are linked to the diary file, so
84;; adding and editing diary entries can be done directly from the agenda. 91;; adding and editing diary entries can be done directly from the agenda.
@@ -101,7 +108,7 @@
101;; - Effect of C-u and C-u C-u in org-timeline swapped. 108;; - Effect of C-u and C-u C-u in org-timeline swapped.
102;; - Timeline now always contains today, and `.' jumps to it. 109;; - Timeline now always contains today, and `.' jumps to it.
103;; - Table editor: 110;; - Table editor:
104;; - cut and paste of regtangular regions in tables 111;; - cut and paste of rectangular regions in tables
105;; - command to convert org-mode table to table.el table and back 112;; - command to convert org-mode table to table.el table and back
106;; - command to treat several cells like a paragraph and fill it 113;; - command to treat several cells like a paragraph and fill it
107;; - command to convert a buffer region to a table 114;; - command to convert a buffer region to a table
@@ -121,96 +128,6 @@
121;; - When reading a date, the calendar can be manipulated with keys. 128;; - When reading a date, the calendar can be manipulated with keys.
122;; - Link support for RMAIL and Wanderlust (from planner.el, untested) 129;; - Link support for RMAIL and Wanderlust (from planner.el, untested)
123;; - Minor bug fixes and documentation improvements. 130;; - Minor bug fixes and documentation improvements.
124;;
125;; Version 3.00
126;; - Multifile Agenda shows current entries from many different files.
127;; - TeXInfo documentation (thanks to Christian Egli for the conversion).
128;; - Additional applications for TODO keywords, see documentation.
129;; Different files may have different TODO keywords etc.
130;; - Priorities for TODO items.
131;; - The browser mode used by `org-remember-handler' is improved.
132;; - Images get inlined in HTML export (thanks to Carsten Wimmer).
133;; - File links can contain line numbers, like file:/usr/etc/config:255
134;; - Minor bug fixes.
135;;
136;; Version 2.10
137;; - TODO entries can have additional states besides TODO and DONE.
138;; See new variable `org-todo-keywords'.
139;; - TODO keywords can be interpreted as categories. See variable
140;; `org-todo-interpretation'.
141;; - M-TAB completion on TODO keywords, TeX symbols, and normal words.
142;; - All keywords (like TODO, DEADLINE etc) are configurable.
143;; - Cursor positioning optimized after pro/demotion and TODO cycling.
144;; - Emphasizing in HTML works now for *bold*, /italic/ and _underline_.
145;; - New commands to kill, copy and yank entire subtrees. Yanking
146;; modifies the level of the tree before insertion.
147;; - New command `org-goto' (C-c C-j) to quickly move to other locations
148;; in the buffer without affecting outline visibility.
149;; - Hooks for John Wiegley's remember.el.
150;; - `org-read-date' pops up calendar for date selection with the mouse.
151;; See variable `org-popup-calendar-for-date-prompt'.
152;;
153;; Version 2.6
154;; - TODO items can be SCHEDULED to a certain date.
155;; - Expired DEADLINEs are ignored if in an entry marked DONE.
156;; - From the diary or time-sorted view (C-c C-r), C-c C-t can be used to
157;; change the TODO state of an item remotely.
158;; - Horizontal computations in table editor. See `org-table-eval-formula'.
159;; - Fixed bug with summing tables (command `org-table-sum', `C-c +').
160;; - Calendar window follows the timestamp when a timestamp is changed.
161;; New variable `org-calendar-follow-timestamp-change'.
162;; - Time-sorted view (`org-diary-view', C-c C-r) now uses the prefix
163;; argument to force inclusion of unscheduled TODO items.
164;; - New variable `org-confirm-shell-links' to turn of safety query.
165;; - New variable `org-open-non-existing-files'.
166;;
167;; Version 2.4
168;; - A time-sorted view on all time stamps can be created with C-c C-r.
169;; - Timestamps and Deadlines can be shown in the Emacs diary.
170;; - Date ranges introduced.
171;; - Time-string formats are no longer configurable.
172;; - Vertical lines in tables can be made invisible with `C-c |'.
173;; - New "link" type to execute shell commands, like "shell:ls *.org"
174;; - Upon export, "myfile.org" becomes "myfile.html" or "myfile.txt",
175;; instead of "myfile.org.html" or "myfile.org.txt".
176;; - When the cursor is in the white space at the beginning of a line,
177;; TAB removes the whitespace before indenting again.
178;;
179;; Version 2.0
180;; - Windows (NT/2000) support.
181;; - Works with both Emacs and XEmacs.
182;; - Fully automatic table editor.
183;; - New link types into Gnus, VM and BBDB.
184;; - Other link system changes
185;; - Time stamps are treated as links to the calendar.
186;; - Easy creation of links with global command `org-store-link'.
187;; - Insertion of links with `C-c C-l' works differently now.
188;; - Space characters allowed as part of a link.
189;; - Options in `org-file-apps' extended. The command may now be
190;; symbol 'emacs', or a lisp form.
191;; Please re-read the manual section about links.
192;; - Timestamp changes
193;; - `org-deadline' now prompts for a date.
194;; - A line can now contain several timestamps. Updating of a
195;; timestamp only happens if the cursor is at the timestamp.
196;; - Changed the time-stamp-format to ISO, to make sure it will
197;; always work (non-English month names had caused problems
198;; with `parse-time-string'.). Changing the time stamp format
199;; is not recommended.
200;; - Picture mode enhancements have been removed from org.el
201;;
202;; Version 1.4
203;; - Some option name changes, not backward compatible.
204;; - ASCII exporter upgrade: Table of contents.
205;; - HTML exporter upgrade: fixed-width regions, better
206;; sub/superscripts, many TeX symbols supported.
207;; - Calendar support.
208;;
209;; Version 1.3
210;; - HTML exporter upgrade, in particular table of contents
211;;
212;; Version 1.0
213;; - Initial release
214 131
215;;; Code: 132;;; Code:
216 133
@@ -221,7 +138,7 @@
221 138
222;;; Customization variables 139;;; Customization variables
223 140
224(defvar org-version "3.05" 141(defvar org-version "3.06"
225 "The version number of the file org.el.") 142 "The version number of the file org.el.")
226(defun org-version () 143(defun org-version ()
227 (interactive) 144 (interactive)
@@ -255,9 +172,12 @@ the following lines anywhere in the buffer:
255 172
256 #+STARTUP: fold 173 #+STARTUP: fold
257 #+STARTUP: nofold 174 #+STARTUP: nofold
258" 175 #+STARTUP: content"
259 :group 'org-startup 176 :group 'org-startup
260 :type 'boolean) 177 :type '(choice
178 (const :tag "nofold: show all" nil)
179 (const :tag "fold: overview" t)
180 (const :tag "content: all headlines" content)))
261 181
262(defcustom org-startup-truncated t 182(defcustom org-startup-truncated t
263 "Non-nil means, entering Org-mode will set `truncate-lines'. 183 "Non-nil means, entering Org-mode will set `truncate-lines'.
@@ -281,10 +201,11 @@ the following lines anywhere in the buffer:
281 201
282(defcustom org-insert-mode-line-in-empty-file nil 202(defcustom org-insert-mode-line-in-empty-file nil
283 "Non-nil means insert the first line setting Org-mode in empty files. 203 "Non-nil means insert the first line setting Org-mode in empty files.
284When the function `org-mode' is called interactively in an empty, this 204When the function `org-mode' is called interactively in an empty file, this
285normally means that the file name does not automatically trigger Org-mode. 205normally means that the file name does not automatically trigger Org-mode.
286To ensure that the file will always be in Org-mode in the future, a 206To ensure that the file will always be in Org-mode in the future, a
287line enforcing Org-mode can be inserted into the buffer." 207line enforcing Org-mode will be inserted into the buffer, if this option
208has been set."
288 :group 'org-startup 209 :group 'org-startup
289 :type 'boolean) 210 :type 'boolean)
290 211
@@ -409,9 +330,9 @@ lisp variable `state'."
409(defvar org-todo-line-regexp nil 330(defvar org-todo-line-regexp nil
410 "Matches a headline and puts TODO state into group 2 if present.") 331 "Matches a headline and puts TODO state into group 2 if present.")
411(make-variable-buffer-local 'org-todo-line-regexp) 332(make-variable-buffer-local 'org-todo-line-regexp)
412(defvar orb-nl-done-regexp nil 333(defvar org-nl-done-regexp nil
413 "Matches newline followed by a headline with the DONE keyword.") 334 "Matches newline followed by a headline with the DONE keyword.")
414(make-variable-buffer-local 'orb-nl-done-regexp) 335(make-variable-buffer-local 'org-nl-done-regexp)
415(defvar org-looking-at-done-regexp nil 336(defvar org-looking-at-done-regexp nil
416 "Matches the DONE keyword a point.") 337 "Matches the DONE keyword a point.")
417(make-variable-buffer-local 'org-looking-at-done-regexp) 338(make-variable-buffer-local 'org-looking-at-done-regexp)
@@ -446,7 +367,9 @@ lisp variable `state'."
446 (setq key (match-string 1) value (match-string 2)) 367 (setq key (match-string 1) value (match-string 2))
447 (cond 368 (cond
448 ((equal key "CATEGORY") 369 ((equal key "CATEGORY")
449 (setq cat (intern (car (org-split-string value splitre))))) 370 (if (string-match "[ \t]+$" value)
371 (setq value (replace-match "" t t value)))
372 (setq cat (intern value)))
450 ((equal key "SEQ_TODO") 373 ((equal key "SEQ_TODO")
451 (setq int 'sequence 374 (setq int 'sequence
452 kwds (append kwds (org-split-string value splitre)))) 375 kwds (append kwds (org-split-string value splitre))))
@@ -460,6 +383,7 @@ lisp variable `state'."
460 (let ((opts (org-split-string value splitre)) 383 (let ((opts (org-split-string value splitre))
461 (set '(("fold" org-startup-folded t) 384 (set '(("fold" org-startup-folded t)
462 ("nofold" org-startup-folded nil) 385 ("nofold" org-startup-folded nil)
386 ("content" org-startup-folded 'content)
463 ("dlcheck" org-startup-with-deadline-check t) 387 ("dlcheck" org-startup-with-deadline-check t)
464 ("nodlcheck" org-startup-with-deadline-check nil))) 388 ("nodlcheck" org-startup-with-deadline-check nil)))
465 l var val) 389 l var val)
@@ -490,7 +414,7 @@ lisp variable `state'."
490 (concat "^\\(\\*+\\)[ \t]*\\(" 414 (concat "^\\(\\*+\\)[ \t]*\\("
491 (mapconcat 'regexp-quote org-todo-keywords "\\|") 415 (mapconcat 'regexp-quote org-todo-keywords "\\|")
492 "\\)? *\\(.*\\)") 416 "\\)? *\\(.*\\)")
493 orb-nl-done-regexp 417 org-nl-done-regexp
494 (concat "[\r\n]\\*+[ \t]+" org-done-string "\\>") 418 (concat "[\r\n]\\*+[ \t]+" org-done-string "\\>")
495 org-looking-at-done-regexp (concat "^" org-done-string "\\>") 419 org-looking-at-done-regexp (concat "^" org-done-string "\\>")
496 org-deadline-regexp (concat "\\<" org-deadline-string) 420 org-deadline-regexp (concat "\\<" org-deadline-string)
@@ -555,7 +479,7 @@ When nil, cursor will remain in the current window."
555 :type 'boolean) 479 :type 'boolean)
556 480
557(defcustom org-fit-agenda-window t 481(defcustom org-fit-agenda-window t
558 "Non-nil means, change windo size of agenda to fit content." 482 "Non-nil means, change window size of agenda to fit content."
559 :group 'org-agenda 483 :group 'org-agenda
560 :type 'boolean) 484 :type 'boolean)
561 485
@@ -582,7 +506,7 @@ When nil, always start on the current day."
582 :type 'number) 506 :type 'number)
583 507
584(defcustom org-agenda-include-all-todo t 508(defcustom org-agenda-include-all-todo t
585 "Non-nil means, the multifile agenda will always contain all TODO entries. 509 "Non-nil means, the agenda will always contain all TODO entries.
586When nil, date-less entries will only be shown if `org-agenda' is called 510When nil, date-less entries will only be shown if `org-agenda' is called
587with a prefix argument. 511with a prefix argument.
588When non-nil, the TODO entries will be listed at the top of the agenda, before 512When non-nil, the TODO entries will be listed at the top of the agenda, before
@@ -596,6 +520,13 @@ entries from the emacs calendars diary."
596 :group 'org-agenda 520 :group 'org-agenda
597 :type 'boolean) 521 :type 'boolean)
598 522
523(defcustom org-calendar-to-agenda-key [?c]
524 "The key to be installed in `calendar-mode-map' for switching to the agenda.
525The command `org-calendar-goto-agenda' will be bound to this key. The
526default is the character `c' because then`c' can be used to switch back and
527force between agenda and calendar."
528 :group 'org-agenda
529 :type 'sexp)
599 530
600(defcustom org-agenda-sorting-strategy '(time-up category-keep priority-down) 531(defcustom org-agenda-sorting-strategy '(time-up category-keep priority-down)
601 "Sorting structure for the agenda items of a single day. 532 "Sorting structure for the agenda items of a single day.
@@ -657,6 +588,23 @@ is used instead.")
657 :tag "Org Structure" 588 :tag "Org Structure"
658 :group 'org) 589 :group 'org)
659 590
591(defcustom org-cycle-hook '(org-optimize-window-after-visibility-change)
592 "Hook that is run after `org-cycle' has changed the buffer visibility.
593The function(s) in this hook must accept a single argument which indicates
594the new state that was set by the most recent `org-cycle' command. The
595argument is a symbol. After a global state change, it can have the values
596`overview', `content', or `all'. After a local state change, it can have
597the values `folded', `children', or `subtree'."
598 :group 'org-structure
599 :type 'hook)
600
601(defcustom org-occur-hook '(org-first-headline-recenter)
602 "Hook that is run after `org-occur' has constructed a sparse tree.
603This can be used to recenter the window to show as much of the structure
604as possible."
605 :group 'org-structure
606 :type 'hook)
607
660(defcustom org-adapt-indentation t 608(defcustom org-adapt-indentation t
661 "Non-nil means, adapt indentation when promoting and demoting. 609 "Non-nil means, adapt indentation when promoting and demoting.
662When this is set and the *entire* text in an entry is indented, the 610When this is set and the *entire* text in an entry is indented, the
@@ -692,7 +640,6 @@ unnecessary clutter."
692 :type 'boolean) 640 :type 'boolean)
693 641
694 642
695
696(defgroup org-link nil 643(defgroup org-link nil
697 "Options concerning links in Org-mode." 644 "Options concerning links in Org-mode."
698 :tag "Org Link" 645 :tag "Org Link"
@@ -913,12 +860,12 @@ do the following
913 happens only if changes to a field might have changed the column width. 860 happens only if changes to a field might have changed the column width.
914Optimization requires replacing the functions `self-insert-command', 861Optimization requires replacing the functions `self-insert-command',
915`delete-char', and `backward-delete-char' in Org-mode buffers, with a 862`delete-char', and `backward-delete-char' in Org-mode buffers, with a
916slight (in fact: unnoticable) speed impact for normal typing. Org-mode is 863slight (in fact: unnoticeable) speed impact for normal typing. Org-mode is
917very good at guessing when a re-align will be necessary, but you can always 864very good at guessing when a re-align will be necessary, but you can always
918force one with `C-c C-c'. 865force one with `C-c C-c'.
919 866
920If you would like to use the optimized version in Org-mode, but the un-optimized 867If you would like to use the optimized version in Org-mode, but the
921version in OrgTbl-mode, see the variable `orgtbl-optimized'. 868un-optimized version in OrgTbl-mode, see the variable `orgtbl-optimized'.
922 869
923This variable can be used to turn on and off the table editor during a session, 870This variable can be used to turn on and off the table editor during a session,
924but in order to toggle optimization, a restart is required." 871but in order to toggle optimization, a restart is required."
@@ -931,7 +878,7 @@ but in order to toggle optimization, a restart is required."
931(defcustom org-table-default-size "5x2" 878(defcustom org-table-default-size "5x2"
932 "The default size for newly created tables, Columns x Rows." 879 "The default size for newly created tables, Columns x Rows."
933 :group 'org-table 880 :group 'org-table
934 :type 'string) 881 :type 'string)
935 882
936(defcustom org-table-automatic-realign t 883(defcustom org-table-automatic-realign t
937 "Non-nil means, automatically re-align table when pressing TAB or RETURN. 884 "Non-nil means, automatically re-align table when pressing TAB or RETURN.
@@ -1116,7 +1063,7 @@ This option can also be set with the +OPTIONS line, e.g. \"@:nil\"."
1116 1063
1117(defcustom org-export-with-fixed-width t 1064(defcustom org-export-with-fixed-width t
1118 "Non-nil means, lines starting with \":\" will be in fixed width font. 1065 "Non-nil means, lines starting with \":\" will be in fixed width font.
1119This can be used to have preformatted text, fragments of code etc. For 1066This can be used to have pre-formatted text, fragments of code etc. For
1120example 1067example
1121 : ;; Some Lisp examples 1068 : ;; Some Lisp examples
1122 : (while (defc cnt) 1069 : (while (defc cnt)
@@ -1151,7 +1098,7 @@ borders and spacing."
1151 :type 'string) 1098 :type 'string)
1152 1099
1153(defcustom org-export-with-emphasize t 1100(defcustom org-export-with-emphasize t
1154 "Non-nil means, interprete *word*, /word/, and _word_ as emphasized text. 1101 "Non-nil means, interpret *word*, /word/, and _word_ as emphasized text.
1155If the export target supports emphasizing text, the word will be 1102If the export target supports emphasizing text, the word will be
1156typeset in bold, italic, or underlined, respectively. Works only for 1103typeset in bold, italic, or underlined, respectively. Works only for
1157single words, but you can say: I *really* *mean* *this*. 1104single words, but you can say: I *really* *mean* *this*.
@@ -1169,7 +1116,7 @@ This has to be set before loading org.el to be effective."
1169 1116
1170;; FIXME: Should () parens be removed as well in sub/superscripts? 1117;; FIXME: Should () parens be removed as well in sub/superscripts?
1171(defcustom org-export-with-sub-superscripts t 1118(defcustom org-export-with-sub-superscripts t
1172 "Non-nil means, interprete \"_\" and \"^\" for export. 1119 "Non-nil means, interpret \"_\" and \"^\" for export.
1173When this option is turned on, you can use TeX-like syntax for sub- and 1120When this option is turned on, you can use TeX-like syntax for sub- and
1174superscripts. Several characters after \"_\" or \"^\" will be 1121superscripts. Several characters after \"_\" or \"^\" will be
1175considered as a single item - so grouping with {} is normally not 1122considered as a single item - so grouping with {} is normally not
@@ -1191,7 +1138,7 @@ This option can also be set with the +OPTIONS line, e.g. \"^:nil\"."
1191 :type 'boolean) 1138 :type 'boolean)
1192 1139
1193(defcustom org-export-with-TeX-macros t 1140(defcustom org-export-with-TeX-macros t
1194 "Non-nil means, interprete simple TeX-like macros when exporting. 1141 "Non-nil means, interpret simple TeX-like macros when exporting.
1195For example, HTML export converts \\alpha to &alpha; and \\AA to &Aring;. 1142For example, HTML export converts \\alpha to &alpha; and \\AA to &Aring;.
1196No only real TeX macros will work here, but the standard HTML entities 1143No only real TeX macros will work here, but the standard HTML entities
1197for math can be used as macro names as well. For a list of supported 1144for math can be used as macro names as well. For a list of supported
@@ -1301,9 +1248,10 @@ Otherwise, the buffer will just be saved to a file and stay hidden."
1301(defface org-warning-face ;; font-lock-warning-face 1248(defface org-warning-face ;; font-lock-warning-face
1302 '((((type tty) (class color)) (:foreground "red")) 1249 '((((type tty) (class color)) (:foreground "red"))
1303 (((class color) (background light)) (:foreground "Red" :bold t)) 1250 (((class color) (background light)) (:foreground "Red" :bold t))
1304 (((class color) (background dark)) (:foreground "Pink" :bold t)) 1251 (((class color) (background dark)) (:foreground "Red1" :bold t))
1252; (((class color) (background dark)) (:foreground "Pink" :bold t))
1305 (t (:inverse-video t :bold t))) 1253 (t (:inverse-video t :bold t)))
1306 "Face for deadlines and TODO keyords." 1254 "Face for deadlines and TODO keywords."
1307 :group 'org-faces) 1255 :group 'org-faces)
1308 1256
1309(defcustom org-fontify-done-headline nil 1257(defcustom org-fontify-done-headline nil
@@ -1483,14 +1431,20 @@ The following commands are available:
1483 ;; Hook, and startup actions 1431 ;; Hook, and startup actions
1484 (if (or arg 1432 (if (or arg
1485 (and org-insert-mode-line-in-empty-file 1433 (and org-insert-mode-line-in-empty-file
1434 (interactive-p)
1486 (= (point-min) (point-max)))) 1435 (= (point-min) (point-max))))
1487 (save-excursion 1436 (save-excursion
1488 (goto-char (point-min)) 1437 (goto-char (point-min))
1489 (insert " -*- mode: org -*-\n\n"))) 1438 (insert " -*- mode: org -*-\n\n")))
1490 (run-hooks 'org-mode-hook) 1439 (run-hooks 'org-mode-hook)
1491 (if org-startup-with-deadline-check 1440 (unless (boundp 'org-inhibit-startup)
1492 (call-interactively 'org-check-deadlines) 1441 (if org-startup-with-deadline-check
1493 (if org-startup-folded (org-cycle t)))) 1442 (call-interactively 'org-check-deadlines)
1443 (cond
1444 ((eq org-startup-folded t)
1445 (org-cycle))
1446 ((eq org-startup-folded 'contents)
1447 (org-cycle) (org-cycle))))))
1494 1448
1495;;; Font-Lock stuff 1449;;; Font-Lock stuff
1496 1450
@@ -1534,7 +1488,7 @@ The following commands are available:
1534 t))) 1488 t)))
1535 1489
1536(defun org-activate-dates (limit) 1490(defun org-activate-dates (limit)
1537 "Run through the buffer and add overlays to links." 1491 "Run through the buffer and add overlays to dates."
1538 (if (re-search-forward org-tsr-regexp limit t) 1492 (if (re-search-forward org-tsr-regexp limit t)
1539 (progn 1493 (progn
1540 (add-text-properties (match-beginning 0) (match-end 0) 1494 (add-text-properties (match-beginning 0) (match-end 0)
@@ -1553,7 +1507,8 @@ The following commands are available:
1553 (list 1507 (list
1554 '(org-activate-links (0 'org-link-face)) 1508 '(org-activate-links (0 'org-link-face))
1555 '(org-activate-dates (0 'org-link-face)) 1509 '(org-activate-dates (0 'org-link-face))
1556 (list (concat "^\\*+[ \t]*" org-not-done-regexp) '(1 'org-warning-face t)) 1510 (list (concat "^\\*+[ \t]*" org-not-done-regexp)
1511 '(1 'org-warning-face t))
1557 (list (concat "\\[#[A-Z]\\]") '(0 'org-warning-face t)) 1512 (list (concat "\\[#[A-Z]\\]") '(0 'org-warning-face t))
1558 (list (concat "\\<" org-deadline-string) '(0 'org-warning-face t)) 1513 (list (concat "\\<" org-deadline-string) '(0 'org-warning-face t))
1559 (list (concat "\\<" org-scheduled-string) '(0 'org-warning-face t)) 1514 (list (concat "\\<" org-scheduled-string) '(0 'org-warning-face t))
@@ -1673,20 +1628,23 @@ The following commands are available:
1673 (show-branches) 1628 (show-branches)
1674 (if (bobp) (throw 'exit nil)))) 1629 (if (bobp) (throw 'exit nil))))
1675 (message "CONTENTS...done")) 1630 (message "CONTENTS...done"))
1676 (setq org-cycle-global-status 'contents)) 1631 (setq org-cycle-global-status 'contents)
1632 (run-hook-with-args 'org-cycle-hook 'contents))
1677 1633
1678 ((and (eq last-command this-command) 1634 ((and (eq last-command this-command)
1679 (eq org-cycle-global-status 'contents)) 1635 (eq org-cycle-global-status 'contents))
1680 ;; We just showed the table of contents - now show everything 1636 ;; We just showed the table of contents - now show everything
1681 (show-all) 1637 (show-all)
1682 (message "SHOW ALL") 1638 (message "SHOW ALL")
1683 (setq org-cycle-global-status 'all)) 1639 (setq org-cycle-global-status 'all)
1640 (run-hook-with-args 'org-cycle-hook 'all))
1684 1641
1685 (t 1642 (t
1686 ;; Default action: go to overview 1643 ;; Default action: go to overview
1687 (hide-sublevels 1) 1644 (hide-sublevels 1)
1688 (message "OVERVIEW") 1645 (message "OVERVIEW")
1689 (setq org-cycle-global-status 'overview)))) 1646 (setq org-cycle-global-status 'overview)
1647 (run-hook-with-args 'org-cycle-hook 'overview))))
1690 1648
1691 ((integerp arg) 1649 ((integerp arg)
1692 ;; Show-subtree, ARG levels up from here. 1650 ;; Show-subtree, ARG levels up from here.
@@ -1721,18 +1679,21 @@ The following commands are available:
1721 (show-entry) 1679 (show-entry)
1722 (show-children) 1680 (show-children)
1723 (message "CHILDREN") 1681 (message "CHILDREN")
1724 (setq org-cycle-subtree-status 'children)) 1682 (setq org-cycle-subtree-status 'children)
1683 (run-hook-with-args 'org-cycle-hook 'children))
1725 ((and (eq last-command this-command) 1684 ((and (eq last-command this-command)
1726 (eq org-cycle-subtree-status 'children)) 1685 (eq org-cycle-subtree-status 'children))
1727 ;; We just showed the children, now show everything. 1686 ;; We just showed the children, now show everything.
1728 (show-subtree) 1687 (show-subtree)
1729 (message "SUBTREE") 1688 (message "SUBTREE")
1730 (setq org-cycle-subtree-status 'subtree)) 1689 (setq org-cycle-subtree-status 'subtree)
1690 (run-hook-with-args 'org-cycle-hook 'subtree))
1731 (t 1691 (t
1732 ;; Default action: hide the subtree. 1692 ;; Default action: hide the subtree.
1733 (hide-subtree) 1693 (hide-subtree)
1734 (message "FOLDED") 1694 (message "FOLDED")
1735 (setq org-cycle-subtree-status 'folded))))) 1695 (setq org-cycle-subtree-status 'folded)
1696 (run-hook-with-args 'org-cycle-hook 'folded)))))
1736 1697
1737 ;; TAB emulation 1698 ;; TAB emulation
1738 (buffer-read-only (org-back-to-heading)) 1699 (buffer-read-only (org-back-to-heading))
@@ -1752,6 +1713,30 @@ The following commands are available:
1752 (org-back-to-heading) 1713 (org-back-to-heading)
1753 (org-cycle))))) 1714 (org-cycle)))))
1754 1715
1716(defun org-optimize-window-after-visibility-change (state)
1717 "Adjust the window after a change in outline visibility.
1718This function is the default value of the hook `org-cycle-hook'."
1719 (cond
1720 ((eq state 'overview) (org-first-headline-recenter 1))
1721 ((eq state 'content) nil)
1722 ((eq state 'all) nil)
1723 ((eq state 'folded) nil)
1724 ((eq state 'children) (or (org-subtree-end-visible-p) (recenter 1)))
1725 ((eq state 'subtree) (or (org-subtree-end-visible-p) (recenter 1)))))
1726
1727(defun org-subtree-end-visible-p ()
1728 "Is the end of the current subtree visible?"
1729 (pos-visible-in-window-p
1730 (save-excursion (outline-end-of-subtree) (point))))
1731
1732(defun org-first-headline-recenter (&optional N)
1733 "Move cursor to the first headline and recenter the headline.
1734Optional argument N means, put the headline into the Nth line of the window."
1735 (goto-char (point-min))
1736 (re-search-forward (concat "^" outline-regexp))
1737 (beginning-of-line)
1738 (recenter (prefix-numeric-value N)))
1739
1755(defvar org-goto-window-configuration nil) 1740(defvar org-goto-window-configuration nil)
1756(defvar org-goto-marker nil) 1741(defvar org-goto-marker nil)
1757(defvar org-goto-map (make-sparse-keymap)) 1742(defvar org-goto-map (make-sparse-keymap))
@@ -1788,8 +1773,8 @@ The following commands are available:
1788 1773
1789When you want to go to a different location in a document, the fastest way 1774When you want to go to a different location in a document, the fastest way
1790is often to fold the entire buffer and then dive into the tree. This 1775is often to fold the entire buffer and then dive into the tree. This
1791method has the disadvantage, than the previous location will be folded, and 1776method has the disadvantage, that the previous location will be folded,
1792that can be unwanted. 1777which may not be what you want.
1793 1778
1794This command works around this by showing a copy of the current buffer in 1779This command works around this by showing a copy of the current buffer in
1795overview mode. You can dive into the tree in that copy, to find the 1780overview mode. You can dive into the tree in that copy, to find the
@@ -1883,9 +1868,9 @@ or nil."
1883;;; Promotion, Demotion, Inserting new headlines 1868;;; Promotion, Demotion, Inserting new headlines
1884 1869
1885(defvar org-ignore-region nil 1870(defvar org-ignore-region nil
1886 "To temporary disable the active region.") 1871 "To temporarily disable the active region.")
1887 1872
1888(defun org-insert-heading (arg) 1873(defun org-insert-heading (&optional arg)
1889 "Insert a new heading with same depth at point." 1874 "Insert a new heading with same depth at point."
1890 (interactive "P") 1875 (interactive "P")
1891 (let* ((head (save-excursion 1876 (let* ((head (save-excursion
@@ -1902,6 +1887,22 @@ or nil."
1902 (insert " ")) 1887 (insert " "))
1903 (run-hooks 'org-insert-heading-hook))) 1888 (run-hooks 'org-insert-heading-hook)))
1904 1889
1890(defun org-insert-todo-heading (arg)
1891 "Insert a new heading with the same level and TODO state as current heading.
1892If the heading has no TODO state, or if the state is DONE, use the first
1893state (TODO by default). Also with prefix arg, force first state."
1894 (interactive "P")
1895 (org-insert-heading)
1896 (save-excursion
1897 (org-back-to-heading)
1898 (outline-previous-heading)
1899 (looking-at org-todo-line-regexp))
1900 (if (or arg
1901 (not (match-beginning 2))
1902 (equal (match-string 2) org-done-string))
1903 (insert (car org-todo-keywords) " ")
1904 (insert (match-string 2) " ")))
1905
1905(defun org-promote-subtree (&optional arg) 1906(defun org-promote-subtree (&optional arg)
1906 "Promote the entire subtree. 1907 "Promote the entire subtree.
1907See also `org-promote'." 1908See also `org-promote'."
@@ -2062,7 +2063,7 @@ This is actually only a copy of the kill, because we use the normal kill
2062ring. We need it to check if the kill was created by `org-copy-subtree'.") 2063ring. We need it to check if the kill was created by `org-copy-subtree'.")
2063 2064
2064(defvar org-subtree-clip-folded nil 2065(defvar org-subtree-clip-folded nil
2065 "Was the last copied suptree folded? 2066 "Was the last copied subtree folded?
2066This is used to fold the tree back after pasting.") 2067This is used to fold the tree back after pasting.")
2067 2068
2068(defun org-cut-subtree (&optional arg) 2069(defun org-cut-subtree (&optional arg)
@@ -2074,7 +2075,7 @@ This is a short-hand for marking the subtree and then cutting it."
2074(defun org-copy-subtree (&optional arg cut) 2075(defun org-copy-subtree (&optional arg cut)
2075 "Cut the current subtree into the clipboard. 2076 "Cut the current subtree into the clipboard.
2076This is a short-hand for marking the subtree and then copying it. 2077This is a short-hand for marking the subtree and then copying it.
2077If CUT is non nil, actually cur the subtree." 2078If CUT is non nil, actually cut the subtree."
2078 (interactive "p") 2079 (interactive "p")
2079 (let (beg end folded) 2080 (let (beg end folded)
2080 (org-back-to-heading) 2081 (org-back-to-heading)
@@ -2129,7 +2130,7 @@ If optional TREE is given, use this text instead of the kill ring."
2129 ^re_ (buffer-substring (point-at-bol) (point))) 2130 ^re_ (buffer-substring (point-at-bol) (point)))
2130 (- (match-end 0) (match-beginning 0))) 2131 (- (match-end 0) (match-beginning 0)))
2131 (t nil))) 2132 (t nil)))
2132 (prevous-level (save-excursion 2133 (previous-level (save-excursion
2133 (outline-previous-visible-heading 1) 2134 (outline-previous-visible-heading 1)
2134 (if (looking-at re) 2135 (if (looking-at re)
2135 (- (match-end 0) (match-beginning 0)) 2136 (- (match-end 0) (match-beginning 0))
@@ -2139,7 +2140,7 @@ If optional TREE is given, use this text instead of the kill ring."
2139 (if (looking-at re) 2140 (if (looking-at re)
2140 (- (match-end 0) (match-beginning 0)) 2141 (- (match-end 0) (match-beginning 0))
2141 1))) 2142 1)))
2142 (new-level (or force-level (max prevous-level next-level))) 2143 (new-level (or force-level (max previous-level next-level)))
2143 (shift (if (or (= old-level -1) 2144 (shift (if (or (= old-level -1)
2144 (= new-level -1) 2145 (= new-level -1)
2145 (= old-level new-level)) 2146 (= old-level new-level))
@@ -2181,7 +2182,7 @@ If optional TREE is given, use this text instead of the kill ring."
2181 "Check if the current kill is an outline subtree, or a set of trees. 2182 "Check if the current kill is an outline subtree, or a set of trees.
2182Returns nil if kill does not start with a headline, or if the first 2183Returns nil if kill does not start with a headline, or if the first
2183headline level is not the largest headline level in the tree. 2184headline level is not the largest headline level in the tree.
2184So this will actually acceept several entries of equal levels as well, 2185So this will actually accept several entries of equal levels as well,
2185which is OK for `org-paste-subtree'. 2186which is OK for `org-paste-subtree'.
2186If optional TXT is given, check this string instead of the current kill." 2187If optional TXT is given, check this string instead of the current kill."
2187 (let* ((kill (or txt (current-kill 0) "")) 2188 (let* ((kill (or txt (current-kill 0) ""))
@@ -2203,9 +2204,9 @@ If optional TXT is given, check this string instead of the current kill."
2203 "Perform completion on word at point. 2204 "Perform completion on word at point.
2204At the beginning of a headline, this completes TODO keywords as given in 2205At the beginning of a headline, this completes TODO keywords as given in
2205`org-todo-keywords'. 2206`org-todo-keywords'.
2206If the current word is preceeded by a backslash, completes the TeX symbols 2207If the current word is preceded by a backslash, completes the TeX symbols
2207that are supported for HTML support. 2208that are supported for HTML support.
2208If the current word is preceeded by \"#+\", completes special words for 2209If the current word is preceded by \"#+\", completes special words for
2209setting file options. 2210setting file options.
2210At all other locations, this simply calls `ispell-complete-word'." 2211At all other locations, this simply calls `ispell-complete-word'."
2211 (interactive "P") 2212 (interactive "P")
@@ -2280,6 +2281,11 @@ At all other locations, this simply calls `ispell-complete-word'."
2280 (goto-char (match-end 0)) 2281 (goto-char (match-end 0))
2281 (insert " " org-comment-string)))))) 2282 (insert " " org-comment-string))))))
2282 2283
2284(defvar org-last-todo-state-is-todo nil
2285 "This is non-nil when the last TODO state change led to a TODO state.
2286If the last change removed the TODO tag or switched to DONE, then
2287this is nil.")
2288
2283(defun org-todo (&optional arg) 2289(defun org-todo (&optional arg)
2284 "Change the TODO state of an item. 2290 "Change the TODO state of an item.
2285The state of an item is given by a keyword at the start of the heading, 2291The state of an item is given by a keyword at the start of the heading,
@@ -2326,6 +2332,8 @@ prefix arg, switch to that state."
2326 (t nil))) 2332 (t nil)))
2327 (next (if state (concat " " state " ") " "))) 2333 (next (if state (concat " " state " ") " ")))
2328 (replace-match next t t) 2334 (replace-match next t t)
2335 (setq org-last-todo-state-is-todo
2336 (not (equal state org-done-string)))
2329 (run-hooks 'org-after-todo-state-change-hook))) 2337 (run-hooks 'org-after-todo-state-change-hook)))
2330 ;; Fixup cursor location if close to the keyword 2338 ;; Fixup cursor location if close to the keyword
2331 (if (and (outline-on-heading-p) 2339 (if (and (outline-on-heading-p)
@@ -2390,6 +2398,7 @@ that the match should indeed be shown."
2390 (funcall callback)) 2398 (funcall callback))
2391 (setq cnt (1+ cnt)) 2399 (setq cnt (1+ cnt))
2392 (org-show-hierarchy-above)))) 2400 (org-show-hierarchy-above))))
2401 (run-hooks 'org-occur-hook)
2393 (if (interactive-p) 2402 (if (interactive-p)
2394 (message "%d match(es) for regexp %s" cnt regexp)) 2403 (message "%d match(es) for regexp %s" cnt regexp))
2395 cnt)) 2404 cnt))
@@ -2414,6 +2423,8 @@ that the match should indeed be shown."
2414(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z]\\)\\] ?\\)" 2423(defvar org-priority-regexp ".*?\\(\\[#\\([A-Z]\\)\\] ?\\)"
2415 "Regular expression matching the priority indicator.") 2424 "Regular expression matching the priority indicator.")
2416 2425
2426(defvar org-remove-priority-next-time nil)
2427
2417(defun org-priority-up () 2428(defun org-priority-up ()
2418 "Increase the priority of the current item." 2429 "Increase the priority of the current item."
2419 (interactive) 2430 (interactive)
@@ -2440,7 +2451,10 @@ ACTION can be set, up, or down."
2440 ((eq action 'set) 2451 ((eq action 'set)
2441 (message (format "Priority A-%c, SPC to remove: " org-lowest-priority)) 2452 (message (format "Priority A-%c, SPC to remove: " org-lowest-priority))
2442 (setq new (read-char-exclusive)) 2453 (setq new (read-char-exclusive))
2443 (if (equal new ?\ ) (setq remove t))) 2454 (cond ((equal new ?\ ) (setq remove t))
2455 ((or (< (upcase new) ?A) (> (upcase new) org-lowest-priority))
2456 (error "Priority must be between `%c' and `%c'"
2457 ?A org-lowest-priority))))
2444 ((eq action 'up) 2458 ((eq action 'up)
2445 (setq new (1- current))) 2459 (setq new (1- current)))
2446 ((eq action 'down) 2460 ((eq action 'down)
@@ -2452,13 +2466,15 @@ ACTION can be set, up, or down."
2452 (if remove 2466 (if remove
2453 (replace-match "" t t nil 1) 2467 (replace-match "" t t nil 1)
2454 (replace-match news t t nil 2)) 2468 (replace-match news t t nil 2))
2455 (looking-at org-todo-line-regexp) 2469 (if remove
2456 (if (match-end 2) 2470 (error "No priority cookie found in line")
2457 (progn 2471 (looking-at org-todo-line-regexp)
2458 (goto-char (match-end 2)) 2472 (if (match-end 2)
2459 (insert " [#" news "]")) 2473 (progn
2460 (goto-char (match-beginning 3)) 2474 (goto-char (match-end 2))
2461 (insert "[#" news "] ")))) 2475 (insert " [#" news "]"))
2476 (goto-char (match-beginning 3))
2477 (insert "[#" news "] ")))))
2462 (if remove 2478 (if remove
2463 (message "Priority removed") 2479 (message "Priority removed")
2464 (message "Priority of current item set to %s" news)))) 2480 (message "Priority of current item set to %s" news))))
@@ -2663,9 +2679,9 @@ This is used by `org-read-date' in a temporary keymap for the calendar buffer."
2663(defun org-check-deadlines (ndays) 2679(defun org-check-deadlines (ndays)
2664 "Check if there are any deadlines due or past due. 2680 "Check if there are any deadlines due or past due.
2665A deadline is considered due if it happens within `org-deadline-warning-days' 2681A deadline is considered due if it happens within `org-deadline-warning-days'
2666days from todays date. If the deadline appears in an entry marked DONE, 2682days from today's date. If the deadline appears in an entry marked DONE,
2667it is not shown. The prefix arg NDAYS can be used to test that many 2683it is not shown. The prefix arg NDAYS can be used to test that many
2668days. If the prefix are is a raw C-u prefix, all deadlines are shown." 2684days. If the prefix is a raw C-u prefix, all deadlines are shown."
2669 (interactive "P") 2685 (interactive "P")
2670 (let* ((org-warn-days 2686 (let* ((org-warn-days
2671 (cond 2687 (cond
@@ -2720,22 +2736,21 @@ days in order to avoid rounding problems."
2720 d (floor (/ diff ds)) diff (mod diff ds) 2736 d (floor (/ diff ds)) diff (mod diff ds)
2721 h (floor (/ diff hs)) diff (mod diff hs) 2737 h (floor (/ diff hs)) diff (mod diff hs)
2722 m (floor (/ diff 60))) 2738 m (floor (/ diff 60)))
2723 (if to-buffer 2739 (if (not to-buffer)
2724 (progn 2740 (message (org-make-tdiff-string y d h m))
2725 (goto-char match-end) 2741 (when (org-at-table-p)
2726 (when (and (org-at-table-p) (looking-at " *|")) 2742 (goto-char match-end)
2727 (setq align t) 2743 (setq align t)
2728 (goto-char (match-end 0))) 2744 (and (looking-at " *|") (goto-char (match-end 0))))
2729 (if (looking-at 2745 (if (looking-at
2730 "\\( *-? *[0-9]+y\\)?\\( *[0-9]+d\\)? *[0-9][0-9]:[0-9][0-9]") 2746 "\\( *-? *[0-9]+y\\)?\\( *[0-9]+d\\)? *[0-9][0-9]:[0-9][0-9]")
2731 (replace-match "")) 2747 (replace-match ""))
2732 (if negative (insert " -")) 2748 (if negative (insert " -"))
2733 (if (> y 0) (insert " " (format fy y d h m)) 2749 (if (> y 0) (insert " " (format fy y d h m))
2734 (if (> d 0) (insert " " (format fd d h m)) 2750 (if (> d 0) (insert " " (format fd d h m))
2735 (insert " " (format fh h m)))) 2751 (insert " " (format fh h m))))
2736 (if align (org-table-align)) 2752 (if align (org-table-align))
2737 (message "Time difference inserted")) 2753 (message "Time difference inserted"))))
2738 (message (org-make-tdiff-string y d h m)))))
2739 2754
2740(defun org-make-tdiff-string (y d h m) 2755(defun org-make-tdiff-string (y d h m)
2741 (let ((fmt "") 2756 (let ((fmt "")
@@ -2789,7 +2804,7 @@ With prefix ARG, change that many days."
2789 (org-timestamp-change (prefix-numeric-value arg) 'day)) 2804 (org-timestamp-change (prefix-numeric-value arg) 'day))
2790 2805
2791(defun org-timestamp-down-day (&optional arg) 2806(defun org-timestamp-down-day (&optional arg)
2792 "Increase the date in the time stamp by one day. 2807 "Decrease the date in the time stamp by one day.
2793With prefix ARG, change that many days." 2808With prefix ARG, change that many days."
2794 (interactive "p") 2809 (interactive "p")
2795 (org-timestamp-change (- (prefix-numeric-value arg)) 'day)) 2810 (org-timestamp-change (- (prefix-numeric-value arg)) 'day))
@@ -2800,7 +2815,7 @@ With prefix ARG, change that many days."
2800 (>= (match-end n) pos))) 2815 (>= (match-end n) pos)))
2801 2816
2802(defun org-at-timestamp-p () 2817(defun org-at-timestamp-p ()
2803 "Determine if the the cursor is in or at a timestamp." 2818 "Determine if the cursor is or at a timestamp."
2804 (interactive) 2819 (interactive)
2805 (let* ((tsr org-ts-regexp2) 2820 (let* ((tsr org-ts-regexp2)
2806 (pos (point)) 2821 (pos (point))
@@ -2939,7 +2954,7 @@ The following commands are available:
2939 '("Agenda") "Agenda Files" 2954 '("Agenda") "Agenda Files"
2940 (append 2955 (append
2941 (list 2956 (list
2942 ["Edit file list" (customize-variable 'org-agenda-files) t] 2957 ["Edit File List" (customize-variable 'org-agenda-files) t]
2943 "--") 2958 "--")
2944 (mapcar 'org-file-menu-entry org-agenda-files))) 2959 (mapcar 'org-file-menu-entry org-agenda-files)))
2945 (org-agenda-set-mode-name) 2960 (org-agenda-set-mode-name)
@@ -2957,7 +2972,7 @@ The following commands are available:
2957(define-key org-agenda-mode-map [(shift right)] 'org-agenda-date-later) 2972(define-key org-agenda-mode-map [(shift right)] 'org-agenda-date-later)
2958(define-key org-agenda-mode-map [(shift left)] 'org-agenda-date-earlier) 2973(define-key org-agenda-mode-map [(shift left)] 'org-agenda-date-earlier)
2959 2974
2960(define-key org-agenda-mode-map ">" 'org-agenda-date-today) 2975(define-key org-agenda-mode-map ">" 'org-agenda-date-prompt)
2961(let ((l '(1 2 3 4 5 6 7 8 9 0))) 2976(let ((l '(1 2 3 4 5 6 7 8 9 0)))
2962 (while l (define-key org-agenda-mode-map 2977 (while l (define-key org-agenda-mode-map
2963 (int-to-string (pop l)) 'digit-argument))) 2978 (int-to-string (pop l)) 'digit-argument)))
@@ -2968,10 +2983,17 @@ The following commands are available:
2968(define-key org-agenda-mode-map "q" 'org-agenda-quit) 2983(define-key org-agenda-mode-map "q" 'org-agenda-quit)
2969(define-key org-agenda-mode-map "x" 'org-agenda-exit) 2984(define-key org-agenda-mode-map "x" 'org-agenda-exit)
2970(define-key org-agenda-mode-map "P" 'org-agenda-show-priority) 2985(define-key org-agenda-mode-map "P" 'org-agenda-show-priority)
2971(define-key org-agenda-mode-map "p" 'org-agenda-priority) 2986(define-key org-agenda-mode-map "n" 'next-line)
2987(define-key org-agenda-mode-map "p" 'previous-line)
2988(define-key org-agenda-mode-map "\C-n" 'org-agenda-next-date-line)
2989(define-key org-agenda-mode-map "\C-p" 'org-agenda-previous-date-line)
2972(define-key org-agenda-mode-map "," 'org-agenda-priority) 2990(define-key org-agenda-mode-map "," 'org-agenda-priority)
2991(define-key org-agenda-mode-map "\C-c," 'org-agenda-priority)
2973(define-key org-agenda-mode-map "i" 'org-agenda-diary-entry) 2992(define-key org-agenda-mode-map "i" 'org-agenda-diary-entry)
2974(define-key org-agenda-mode-map "c" 'org-agenda-goto-calendar) 2993(define-key org-agenda-mode-map "c" 'org-agenda-goto-calendar)
2994(eval-after-load "calendar"
2995 '(define-key calendar-mode-map org-calendar-to-agenda-key
2996 'org-calendar-goto-agenda))
2975(define-key org-agenda-mode-map "C" 'org-agenda-convert-date) 2997(define-key org-agenda-mode-map "C" 'org-agenda-convert-date)
2976(define-key org-agenda-mode-map "m" 'org-agenda-phases-of-moon) 2998(define-key org-agenda-mode-map "m" 'org-agenda-phases-of-moon)
2977(define-key org-agenda-mode-map "M" 'org-agenda-phases-of-moon) 2999(define-key org-agenda-mode-map "M" 'org-agenda-phases-of-moon)
@@ -2981,6 +3003,8 @@ The following commands are available:
2981(define-key org-agenda-mode-map "H" 'org-agenda-holidays) 3003(define-key org-agenda-mode-map "H" 'org-agenda-holidays)
2982(define-key org-agenda-mode-map "+" 'org-agenda-priority-up) 3004(define-key org-agenda-mode-map "+" 'org-agenda-priority-up)
2983(define-key org-agenda-mode-map "-" 'org-agenda-priority-down) 3005(define-key org-agenda-mode-map "-" 'org-agenda-priority-down)
3006(define-key org-agenda-mode-map [(shift up)] 'org-agenda-priority-up)
3007(define-key org-agenda-mode-map [(shift down)] 'org-agenda-priority-down)
2984(define-key org-agenda-mode-map [(right)] 'org-agenda-later) 3008(define-key org-agenda-mode-map [(right)] 'org-agenda-later)
2985(define-key org-agenda-mode-map [(left)] 'org-agenda-earlier) 3009(define-key org-agenda-mode-map [(left)] 'org-agenda-earlier)
2986 3010
@@ -3007,7 +3031,7 @@ The following commands are available:
3007 ["Reschedule +1 day" org-agenda-date-later t] 3031 ["Reschedule +1 day" org-agenda-date-later t]
3008 ["Reschedule -1 day" org-agenda-date-earlier t] 3032 ["Reschedule -1 day" org-agenda-date-earlier t]
3009 "--" 3033 "--"
3010 ["Reschedule to today" org-agenda-date-today t]) 3034 ["Reschedule to ..." org-agenda-date-prompt t])
3011 ("Priority" 3035 ("Priority"
3012 ["Set Priority" org-agenda-priority t] 3036 ["Set Priority" org-agenda-priority t]
3013 ["Increase Priority" org-agenda-priority-up t] 3037 ["Increase Priority" org-agenda-priority-up t]
@@ -3024,8 +3048,8 @@ The following commands are available:
3024 :style toggle :selected org-agenda-include-diary :active t] 3048 :style toggle :selected org-agenda-include-diary :active t]
3025 "--" 3049 "--"
3026 ["New Diary Entry" org-agenda-diary-entry t] 3050 ["New Diary Entry" org-agenda-diary-entry t]
3027 ("Calendar commands" 3051 ("Calendar Commands"
3028 ["Goto calendar" org-agenda-goto-calendar t] 3052 ["Goto Calendar" org-agenda-goto-calendar t]
3029 ["Phases of the Moon" org-agenda-phases-of-moon t] 3053 ["Phases of the Moon" org-agenda-phases-of-moon t]
3030 ["Sunrise/Sunset" org-agenda-sunrise-sunset t] 3054 ["Sunrise/Sunset" org-agenda-sunrise-sunset t]
3031 ["Holidays" org-agenda-holidays t] 3055 ["Holidays" org-agenda-holidays t]
@@ -3040,11 +3064,11 @@ The following commands are available:
3040(defvar org-agenda-last-marker-time (time-to-seconds (current-time)) 3064(defvar org-agenda-last-marker-time (time-to-seconds (current-time))
3041 "Creation time of the last agenda marker.") 3065 "Creation time of the last agenda marker.")
3042 3066
3043(defun org-agenda-new-marker (pos) 3067(defun org-agenda-new-marker (&optional pos)
3044 "Return a new agenda marker. 3068 "Return a new agenda marker.
3045Org-mode keeps a list of these markers and resets them when they are 3069Org-mode keeps a list of these markers and resets them when they are
3046no longer in use." 3070no longer in use."
3047 (let ((m (copy-marker pos))) 3071 (let ((m (copy-marker (or pos (point)))))
3048 (setq org-agenda-last-marker-time (time-to-seconds (current-time))) 3072 (setq org-agenda-last-marker-time (time-to-seconds (current-time)))
3049 (push m org-agenda-markers) 3073 (push m org-agenda-markers)
3050 m)) 3074 m))
@@ -3089,7 +3113,7 @@ When a buffer is unmodified, it is just killed. When modified, it is saved
3089(defun org-timeline (&optional include-all) 3113(defun org-timeline (&optional include-all)
3090 "Show a time-sorted view of the entries in the current org file. 3114 "Show a time-sorted view of the entries in the current org file.
3091Only entries with a time stamp of today or later will be listed. With 3115Only entries with a time stamp of today or later will be listed. With
3092one C-u prefix argument, also past entries will be listed. 3116one C-u prefix argument, past entries will also be listed.
3093With two C-u prefixes, all unfinished TODO items will also be shown, 3117With two C-u prefixes, all unfinished TODO items will also be shown,
3094under the current date. 3118under the current date.
3095If the buffer contains an active region, only check the region for 3119If the buffer contains an active region, only check the region for
@@ -3237,7 +3261,6 @@ NDAYS defaults to `org-agenda-ndays'."
3237 (setq rtnall (append rtnall rtn)))) 3261 (setq rtnall (append rtnall rtn))))
3238 (if org-agenda-include-diary 3262 (if org-agenda-include-diary
3239 (progn 3263 (progn
3240 (require 'calendar)
3241 (require 'diary-lib) 3264 (require 'diary-lib)
3242 (setq rtn (org-get-entries-from-diary date)) 3265 (setq rtn (org-get-entries-from-diary date))
3243 (setq rtnall (append rtnall rtn)))) 3266 (setq rtnall (append rtnall rtn))))
@@ -3293,8 +3316,8 @@ NDAYS defaults to `org-agenda-ndays'."
3293 3316
3294(defun org-agenda-exit (arg) 3317(defun org-agenda-exit (arg)
3295 "Exit agenda by removing the window or the buffer. 3318 "Exit agenda by removing the window or the buffer.
3296Also kill all Org-mode buffers which have be loaded by `org-agenda'. 3319Also kill all Org-mode buffers which have been loaded by `org-agenda'.
3297Org-mode buffers visitied directly by the user will no be touched." 3320Org-mode buffers visited directly by the user will not be touched."
3298 (interactive "P") 3321 (interactive "P")
3299 (org-release-buffers org-agenda-new-buffers) 3322 (org-release-buffers org-agenda-new-buffers)
3300 (setq org-agenda-new-buffers nil) 3323 (setq org-agenda-new-buffers nil)
@@ -3356,6 +3379,24 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
3356 (message "Switched to %s view" 3379 (message "Switched to %s view"
3357 (if (equal org-agenda-ndays 1) "day" "week"))) 3380 (if (equal org-agenda-ndays 1) "day" "week")))
3358 3381
3382(defun org-agenda-next-date-line (&optional arg)
3383 "Jump to the next line indicating a date in agenda buffer."
3384 (interactive "p")
3385 (beginning-of-line 1)
3386 (if (looking-at "^\\S-") (forward-char 1))
3387 (if (not (re-search-forward "^\\S-" nil t arg))
3388 (progn
3389 (backward-char 1)
3390 (error "No next date after this line in this buffer.")))
3391 (goto-char (match-beginning 0)))
3392
3393(defun org-agenda-previous-date-line (&optional arg)
3394 "Jump to the next line indicating a date in agenda buffer."
3395 (interactive "p")
3396 (beginning-of-line 1)
3397 (if (not (re-search-backward "^\\S-" nil t arg))
3398 (error "No previous date before this line in this buffer.")))
3399
3359(defun org-agenda-follow-mode () 3400(defun org-agenda-follow-mode ()
3360 "Toggle follow mode in an agenda buffer." 3401 "Toggle follow mode in an agenda buffer."
3361 (interactive) 3402 (interactive)
@@ -3374,7 +3415,7 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
3374 (if org-agenda-include-diary "on" "off"))) 3415 (if org-agenda-include-diary "on" "off")))
3375 3416
3376(defun org-agenda-set-mode-name () 3417(defun org-agenda-set-mode-name ()
3377 "Set the mode name to indicate all the small mode seetings." 3418 "Set the mode name to indicate all the small mode settings."
3378 (setq mode-name 3419 (setq mode-name
3379 (concat "Org-Agenda" 3420 (concat "Org-Agenda"
3380 (if (equal org-agenda-ndays 1) " Day" "") 3421 (if (equal org-agenda-ndays 1) " Day" "")
@@ -3384,6 +3425,7 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
3384 (force-mode-line-update)) 3425 (force-mode-line-update))
3385 3426
3386(defun org-agenda-post-command-hook () 3427(defun org-agenda-post-command-hook ()
3428 (and (eolp) (not (bolp)) (backward-char 1))
3387 (if (and org-agenda-follow-mode 3429 (if (and org-agenda-follow-mode
3388 (get-text-property (point) 'org-marker)) 3430 (get-text-property (point) 'org-marker))
3389 (org-agenda-show))) 3431 (org-agenda-show)))
@@ -3454,7 +3496,7 @@ date."
3454 (replace-match ""))) 3496 (replace-match "")))
3455 3497
3456;; Advise the add-to-diary-list function to allow org to jump to 3498;; Advise the add-to-diary-list function to allow org to jump to
3457;; diary entires. Wrapped into eval-after-load to avoid loading 3499;; diary entries. Wrapped into eval-after-load to avoid loading
3458;; advice unnecessarily 3500;; advice unnecessarily
3459(eval-after-load "diary-lib" 3501(eval-after-load "diary-lib"
3460 '(defadvice add-to-diary-list (before org-mark-diary-entry activate) 3502 '(defadvice add-to-diary-list (before org-mark-diary-entry activate)
@@ -3477,7 +3519,11 @@ date."
3477(defun org-diary-default-entry () 3519(defun org-diary-default-entry ()
3478 "Add a dummy entry to the diary. 3520 "Add a dummy entry to the diary.
3479Needed to avoid empty dates which mess up holiday display." 3521Needed to avoid empty dates which mess up holiday display."
3480 (add-to-diary-list original-date "Org-mode dummy" "" nil)) 3522 ;; Catch the error if dealing with the new add-to-diary-alist
3523 (condition-case nil
3524 (add-to-diary-list original-date "Org-mode dummy" "")
3525 (error
3526 (add-to-diary-list original-date "Org-mode dummy" "" nil))))
3481 3527
3482(defun org-add-file (&optional file) 3528(defun org-add-file (&optional file)
3483 "Add current file to the list of files in variable `org-agenda-files'. 3529 "Add current file to the list of files in variable `org-agenda-files'.
@@ -3561,7 +3607,7 @@ sure that TODAY is included in the list."
3561;;;###autoload 3607;;;###autoload
3562(defun org-diary (&rest args) 3608(defun org-diary (&rest args)
3563 "Returns diary information from org-files. 3609 "Returns diary information from org-files.
3564This function can be used in an \"sexp\" diary entry in the Emacs calendar. 3610This function can be used in a \"sexp\" diary entry in the Emacs calendar.
3565It accesses org files and extracts information from those files to be 3611It accesses org files and extracts information from those files to be
3566listed in the diary. The function accepts arguments specifying what 3612listed in the diary. The function accepts arguments specifying what
3567items should be listed. The following arguments are allowed: 3613items should be listed. The following arguments are allowed:
@@ -3581,7 +3627,7 @@ items should be listed. The following arguments are allowed:
3581 3627
3582 :todo List all TODO items from the org-file. This may be a 3628 :todo List all TODO items from the org-file. This may be a
3583 long list - so this is not turned on by default. 3629 long list - so this is not turned on by default.
3584 Like deadlines, these entires only show up in the 3630 Like deadlines, these entries only show up in the
3585 diary for *today*, not at any other date. 3631 diary for *today*, not at any other date.
3586 3632
3587The call in the diary file should look like this: 3633The call in the diary file should look like this:
@@ -3670,10 +3716,10 @@ the documentation of `org-diary'."
3670 "Is the current entry marked DONE?" 3716 "Is the current entry marked DONE?"
3671 (save-excursion 3717 (save-excursion
3672 (and (re-search-backward "[\r\n]\\*" nil t) 3718 (and (re-search-backward "[\r\n]\\*" nil t)
3673 (looking-at orb-nl-done-regexp)))) 3719 (looking-at org-nl-done-regexp))))
3674 3720
3675(defun org-at-date-range-p () 3721(defun org-at-date-range-p ()
3676 "It the cursor inside a date range?" 3722 "Is the cursor inside a date range?"
3677 (interactive) 3723 (interactive)
3678 (save-excursion 3724 (save-excursion
3679 (catch 'exit 3725 (catch 'exit
@@ -3693,6 +3739,7 @@ the documentation of `org-diary'."
3693(defun org-agenda-get-todos () 3739(defun org-agenda-get-todos ()
3694 "Return the TODO information for agenda display." 3740 "Return the TODO information for agenda display."
3695 (let* ((props (list 'face nil 3741 (let* ((props (list 'face nil
3742 'done-face 'org-done-face
3696 'mouse-face 'highlight 3743 'mouse-face 'highlight
3697 'keymap org-agenda-keymap 3744 'keymap org-agenda-keymap
3698 'help-echo 3745 'help-echo
@@ -3705,7 +3752,7 @@ the documentation of `org-diary'."
3705 (goto-char (point-min)) 3752 (goto-char (point-min))
3706 (while (re-search-forward regexp nil t) 3753 (while (re-search-forward regexp nil t)
3707 (goto-char (match-beginning 1)) 3754 (goto-char (match-beginning 1))
3708 (setq marker (org-agenda-new-marker (point)) 3755 (setq marker (org-agenda-new-marker (point-at-bol))
3709 txt (org-format-agenda-item "" (match-string 1)) 3756 txt (org-format-agenda-item "" (match-string 1))
3710 priority 3757 priority
3711 (+ (org-get-priority txt) 3758 (+ (org-get-priority txt)
@@ -3715,7 +3762,8 @@ the documentation of `org-diary'."
3715 (member (match-string 2) org-todo-keywords))) 3762 (member (match-string 2) org-todo-keywords)))
3716 1))) 3763 1)))
3717 (add-text-properties 3764 (add-text-properties
3718 0 (length txt) (append (list 'org-marker marker 'priority priority) 3765 0 (length txt) (append (list 'org-marker marker 'org-hd-marker marker
3766 'priority priority)
3719 props) 3767 props)
3720 txt) 3768 txt)
3721 (push txt ee) 3769 (push txt ee)
@@ -3740,23 +3788,25 @@ the documentation of `org-diary'."
3740 (apply 'encode-time ; DATE bound by calendar 3788 (apply 'encode-time ; DATE bound by calendar
3741 (list 0 0 0 (nth 1 date) (car date) (nth 2 date)))) 3789 (list 0 0 0 (nth 1 date) (car date) (nth 2 date))))
3742 0 11))) 3790 0 11)))
3743 marker deadlinep scheduledp tmp priority 3791 marker hdmarker deadlinep scheduledp donep tmp priority
3744 ee txt) 3792 ee txt)
3745 (goto-char (point-min)) 3793 (goto-char (point-min))
3746 (while (re-search-forward regexp nil t) 3794 (while (re-search-forward regexp nil t)
3747 (if (not (save-match-data (org-at-date-range-p))) 3795 (if (not (save-match-data (org-at-date-range-p)))
3748 (progn 3796 (progn
3749 (setq marker (org-agenda-new-marker (point)) 3797 (setq marker (org-agenda-new-marker (match-beginning 0))
3750 tmp (buffer-substring (max (point-min) 3798 tmp (buffer-substring (max (point-min)
3751 (- (match-beginning 0) 3799 (- (match-beginning 0)
3752 org-ds-keyword-length)) 3800 org-ds-keyword-length))
3753 (match-beginning 0)) 3801 (match-beginning 0))
3754 deadlinep (string-match org-deadline-regexp tmp) 3802 deadlinep (string-match org-deadline-regexp tmp)
3755 scheduledp (string-match org-scheduled-regexp tmp)) 3803 scheduledp (string-match org-scheduled-regexp tmp)
3804 donep (org-entry-is-done-p))
3756 (save-excursion 3805 (save-excursion
3757 (if (re-search-backward "\\(^\\|\r\\)\\*+" nil t) 3806 (if (re-search-backward "\\(^\\|\r\\)\\*+" nil t)
3758 (progn 3807 (progn
3759 (goto-char (match-end 1)) 3808 (goto-char (match-end 1))
3809 (setq hdmarker (org-agenda-new-marker))
3760 (looking-at "\\*+[ \t]*\\([^\r\n]+\\)") 3810 (looking-at "\\*+[ \t]*\\([^\r\n]+\\)")
3761 (setq txt (org-format-agenda-item 3811 (setq txt (org-format-agenda-item
3762 (format "%s%s" 3812 (format "%s%s"
@@ -3766,18 +3816,24 @@ the documentation of `org-diary'."
3766 (setq txt org-agenda-no-heading-message)) 3816 (setq txt org-agenda-no-heading-message))
3767 (setq priority (org-get-priority txt)) 3817 (setq priority (org-get-priority txt))
3768 (add-text-properties 3818 (add-text-properties
3769 0 (length txt) (append (list 'org-marker marker) props) 3819 0 (length txt) (append (list 'org-marker marker
3820 'org-hd-marker hdmarker) props)
3770 txt) 3821 txt)
3771 (if deadlinep 3822 (if deadlinep
3772 (add-text-properties 3823 (add-text-properties
3773 0 (length txt) 3824 0 (length txt)
3774 (list 'face 'org-warning-face 3825 (list 'face
3826 (if donep 'org-done-face 'org-warning-face)
3827 'undone-face 'org-warning-face
3828 'done-face 'org-done-face
3775 'priority (+ 100 priority)) 3829 'priority (+ 100 priority))
3776 txt) 3830 txt)
3777 (if scheduledp 3831 (if scheduledp
3778 (add-text-properties 3832 (add-text-properties
3779 0 (length txt) 3833 0 (length txt)
3780 (list 'face 'org-scheduled-today-face 3834 (list 'face 'org-scheduled-today-face
3835 'undone-face 'org-scheduled-today-face
3836 'done-face 'org-done-face
3781 priority (+ 99 priority)) 3837 priority (+ 99 priority))
3782 txt) 3838 txt)
3783 (add-text-properties 3839 (add-text-properties
@@ -3790,8 +3846,7 @@ the documentation of `org-diary'."
3790(defun org-agenda-get-deadlines () 3846(defun org-agenda-get-deadlines ()
3791 "Return the deadline information for agenda display." 3847 "Return the deadline information for agenda display."
3792 (let* ((wdays org-deadline-warning-days) 3848 (let* ((wdays org-deadline-warning-days)
3793 (props (list 'face nil 3849 (props (list 'mouse-face 'highlight
3794 'mouse-face 'highlight
3795 'keymap org-agenda-keymap 3850 'keymap org-agenda-keymap
3796 'help-echo 3851 'help-echo
3797 (format "mouse-2 or RET jump to org file %s" 3852 (format "mouse-2 or RET jump to org file %s"
@@ -3799,13 +3854,13 @@ the documentation of `org-diary'."
3799 (regexp org-deadline-time-regexp) 3854 (regexp org-deadline-time-regexp)
3800 (todayp (equal date (calendar-current-date))) ; DATE bound by calendar 3855 (todayp (equal date (calendar-current-date))) ; DATE bound by calendar
3801 (d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar 3856 (d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar
3802 d2 diff pos 3857 d2 diff pos pos1
3803 ee txt head) 3858 ee txt head hdmarker)
3804 (goto-char (point-min)) 3859 (goto-char (point-min))
3805 (while (re-search-forward regexp nil t) 3860 (while (re-search-forward regexp nil t)
3806 (setq d2 (time-to-days 3861 (setq pos (1- (match-beginning 1))
3862 d2 (time-to-days
3807 (org-time-string-to-time (match-string 1))) 3863 (org-time-string-to-time (match-string 1)))
3808 pos (point)
3809 diff (- d2 d1)) 3864 diff (- d2 d1))
3810 ;; When to show a deadline in the calendar: 3865 ;; When to show a deadline in the calendar:
3811 ;; If the expiration is within wdays warning time. 3866 ;; If the expiration is within wdays warning time.
@@ -3815,6 +3870,7 @@ the documentation of `org-diary'."
3815 (if (re-search-backward "\\(^\\|\r\\)\\*+[ \t]*" nil t) 3870 (if (re-search-backward "\\(^\\|\r\\)\\*+[ \t]*" nil t)
3816 (progn 3871 (progn
3817 (goto-char (match-end 0)) 3872 (goto-char (match-end 0))
3873 (setq pos1 (match-end 1))
3818 (setq head (buffer-substring-no-properties 3874 (setq head (buffer-substring-no-properties
3819 (point) 3875 (point)
3820 (progn (skip-chars-forward "^\r\n") 3876 (progn (skip-chars-forward "^\r\n")
@@ -3829,10 +3885,16 @@ the documentation of `org-diary'."
3829 0 (length txt) 3885 0 (length txt)
3830 (append 3886 (append
3831 (list 'org-marker (org-agenda-new-marker pos) 3887 (list 'org-marker (org-agenda-new-marker pos)
3888 'org-hd-marker (org-agenda-new-marker pos1)
3832 'priority (+ (- 10 diff) (org-get-priority txt)) 3889 'priority (+ (- 10 diff) (org-get-priority txt))
3833 'face (cond ((<= diff 0) 'org-warning-face) 3890 'face (cond ((<= diff 0) 'org-warning-face)
3834 ((<= diff 5) 'font-lock-function-name-face) 3891 ((<= diff 5) 'org-scheduled-previously-face)
3835 (t nil))) 3892 (t nil))
3893 'undone-face (cond
3894 ((<= diff 0) 'org-warning-face)
3895 ((<= diff 5) 'org-scheduled-previously-face)
3896 (t nil))
3897 'done-face 'org-done-face)
3836 props) 3898 props)
3837 txt) 3899 txt)
3838 (push txt ee))))) 3900 (push txt ee)))))
@@ -3841,6 +3903,8 @@ the documentation of `org-diary'."
3841(defun org-agenda-get-scheduled () 3903(defun org-agenda-get-scheduled ()
3842 "Return the scheduled information for agenda display." 3904 "Return the scheduled information for agenda display."
3843 (let* ((props (list 'face 'org-scheduled-previously-face 3905 (let* ((props (list 'face 'org-scheduled-previously-face
3906 'undone-face 'org-scheduled-previously-face
3907 'done-face 'org-done-face
3844 'mouse-face 'highlight 3908 'mouse-face 'highlight
3845 'keymap org-agenda-keymap 3909 'keymap org-agenda-keymap
3846 'help-echo 3910 'help-echo
@@ -3849,13 +3913,13 @@ the documentation of `org-diary'."
3849 (regexp org-scheduled-time-regexp) 3913 (regexp org-scheduled-time-regexp)
3850 (todayp (equal date (calendar-current-date))) ; DATE bound by calendar 3914 (todayp (equal date (calendar-current-date))) ; DATE bound by calendar
3851 (d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar 3915 (d1 (calendar-absolute-from-gregorian date)) ; DATE bound by calendar
3852 d2 diff marker pos 3916 d2 diff marker hdmarker pos pos1
3853 ee txt head) 3917 ee txt head)
3854 (goto-char (point-min)) 3918 (goto-char (point-min))
3855 (while (re-search-forward regexp nil t) 3919 (while (re-search-forward regexp nil t)
3856 (setq d2 (time-to-days 3920 (setq pos (1- (match-beginning 1))
3921 d2 (time-to-days
3857 (org-time-string-to-time (match-string 1))) 3922 (org-time-string-to-time (match-string 1)))
3858 pos (point)
3859 diff (- d2 d1)) 3923 diff (- d2 d1))
3860 ;; When to show a scheduled item in the calendar: 3924 ;; When to show a scheduled item in the calendar:
3861 ;; If it is on or past the date. 3925 ;; If it is on or past the date.
@@ -3864,6 +3928,7 @@ the documentation of `org-diary'."
3864 (if (re-search-backward "\\(^\\|\r\\)\\*+[ \t]*" nil t) 3928 (if (re-search-backward "\\(^\\|\r\\)\\*+[ \t]*" nil t)
3865 (progn 3929 (progn
3866 (goto-char (match-end 0)) 3930 (goto-char (match-end 0))
3931 (setq pos1 (match-end 1))
3867 (setq head (buffer-substring-no-properties 3932 (setq head (buffer-substring-no-properties
3868 (point) 3933 (point)
3869 (progn (skip-chars-forward "^\r\n") (point)))) 3934 (progn (skip-chars-forward "^\r\n") (point))))
@@ -3873,10 +3938,10 @@ the documentation of `org-diary'."
3873 (format "Sched.%2dx: " (- 1 diff)) head)))) 3938 (format "Sched.%2dx: " (- 1 diff)) head))))
3874 (setq txt org-agenda-no-heading-message)) 3939 (setq txt org-agenda-no-heading-message))
3875 (when txt 3940 (when txt
3876 (setq marker (org-agenda-new-marker pos))
3877 (add-text-properties 3941 (add-text-properties
3878 0 (length txt) 3942 0 (length txt)
3879 (append (list 'org-marker marker 3943 (append (list 'org-marker (org-agenda-new-marker pos)
3944 'org-hd-marker (org-agenda-new-marker pos1)
3880 'priority (+ (- 5 diff) (org-get-priority txt))) 3945 'priority (+ (- 5 diff) (org-get-priority txt)))
3881 props) txt) 3946 props) txt)
3882 (push txt ee))))) 3947 (push txt ee)))))
@@ -3892,7 +3957,7 @@ the documentation of `org-diary'."
3892 (abbreviate-file-name (buffer-file-name))))) 3957 (abbreviate-file-name (buffer-file-name)))))
3893 (regexp org-tr-regexp) 3958 (regexp org-tr-regexp)
3894 (d0 (calendar-absolute-from-gregorian date)) 3959 (d0 (calendar-absolute-from-gregorian date))
3895 marker ee txt d1 d2 s1 s2) 3960 marker hdmarker ee txt d1 d2 s1 s2)
3896 (goto-char (point-min)) 3961 (goto-char (point-min))
3897 (while (re-search-forward regexp nil t) 3962 (while (re-search-forward regexp nil t)
3898 (setq s1 (match-string 1) 3963 (setq s1 (match-string 1)
@@ -3906,6 +3971,7 @@ the documentation of `org-diary'."
3906 (setq marker (org-agenda-new-marker (point))) 3971 (setq marker (org-agenda-new-marker (point)))
3907 (if (re-search-backward "\\(^\\|\r\\)\\*+" nil t) 3972 (if (re-search-backward "\\(^\\|\r\\)\\*+" nil t)
3908 (progn 3973 (progn
3974 (setq hdmarker (org-agenda-new-marker (match-end 1)))
3909 (goto-char (match-end 1)) 3975 (goto-char (match-end 1))
3910 (looking-at "\\*+[ \t]*\\([^\r\n]+\\)") 3976 (looking-at "\\*+[ \t]*\\([^\r\n]+\\)")
3911 (setq txt (org-format-agenda-item 3977 (setq txt (org-format-agenda-item
@@ -3915,6 +3981,7 @@ the documentation of `org-diary'."
3915 (setq txt org-agenda-no-heading-message)) 3981 (setq txt org-agenda-no-heading-message))
3916 (add-text-properties 3982 (add-text-properties
3917 0 (length txt) (append (list 'org-marker marker 3983 0 (length txt) (append (list 'org-marker marker
3984 'org-hd-marker hdmarker
3918 'priority (org-get-priority txt)) 3985 'priority (org-get-priority txt))
3919 props) 3986 props)
3920 txt) 3987 txt)
@@ -3926,7 +3993,7 @@ the documentation of `org-diary'."
3926 3993
3927(defun org-format-agenda-item (prefix txt) 3994(defun org-format-agenda-item (prefix txt)
3928 "Format TXT to be inserted into the agenda buffer. 3995 "Format TXT to be inserted into the agenda buffer.
3929In particular, this indents the lins and adds a category." 3996In particular, this indents the line and adds a category."
3930 (let ((cat (or org-category 3997 (let ((cat (or org-category
3931 (file-name-sans-extension 3998 (file-name-sans-extension
3932 (file-name-nondirectory (buffer-file-name))))) 3999 (file-name-nondirectory (buffer-file-name)))))
@@ -4040,7 +4107,7 @@ and by additional input from the age of a schedules or deadline entry."
4040 (org-flag-heading nil)))))) ; show the next heading 4107 (org-flag-heading nil)))))) ; show the next heading
4041 4108
4042(defun org-agenda-goto-mouse (ev) 4109(defun org-agenda-goto-mouse (ev)
4043 "Go to the Org-mode file which contains the deadline at the mouse click." 4110 "Go to the Org-mode file which contains the item at the mouse click."
4044 (interactive "e") 4111 (interactive "e")
4045 (mouse-set-point ev) 4112 (mouse-set-point ev)
4046 (org-agenda-goto)) 4113 (org-agenda-goto))
@@ -4061,7 +4128,7 @@ and by additional input from the age of a schedules or deadline entry."
4061 (select-window win))) 4128 (select-window win)))
4062 4129
4063(defun org-agenda-show-mouse (ev) 4130(defun org-agenda-show-mouse (ev)
4064 "Display the Org-mode file which contains the deadline at the mouse click." 4131 "Display the Org-mode file which contains the item at the mouse click."
4065 (interactive "e") 4132 (interactive "e")
4066 (mouse-set-point ev) 4133 (mouse-set-point ev)
4067 (org-agenda-show)) 4134 (org-agenda-show))
@@ -4074,17 +4141,22 @@ and by additional input from the age of a schedules or deadline entry."
4074(defun org-agenda-error () 4141(defun org-agenda-error ()
4075 (error "Command not allowed in this line.")) 4142 (error "Command not allowed in this line."))
4076 4143
4144(defvar org-last-heading-marker (make-marker)
4145 "Marker pointing to the headline that last changed its TODO state
4146by a remote command from the agenda.")
4147
4077(defun org-agenda-todo () 4148(defun org-agenda-todo ()
4078 "Cycle TODO state of line at point, also in Org-mode file." 4149 "Cycle TODO state of line at point, also in Org-mode file.
4150This changes the line at point, all other lines in the agenda referring to
4151the same tree node, and the headline of the tree node in the Org-mode file."
4079 (interactive) 4152 (interactive)
4080 (org-agenda-check-no-diary) 4153 (org-agenda-check-no-diary)
4081 (let* ((props (text-properties-at (point))) 4154 (let* ((col (current-column))
4082 (col (current-column))
4083 (marker (or (get-text-property (point) 'org-marker) 4155 (marker (or (get-text-property (point) 'org-marker)
4084 (org-agenda-error))) 4156 (org-agenda-error)))
4085 (pl (get-text-property (point-at-bol) 'prefix-length))
4086 (buffer (marker-buffer marker)) 4157 (buffer (marker-buffer marker))
4087 (pos (marker-position marker)) 4158 (pos (marker-position marker))
4159 (hdmarker (get-text-property (point) 'org-hd-marker))
4088 (buffer-read-only nil) 4160 (buffer-read-only nil)
4089 newhead) 4161 newhead)
4090 (save-excursion 4162 (save-excursion
@@ -4096,16 +4168,46 @@ and by additional input from the age of a schedules or deadline entry."
4096 (and (outline-next-heading) 4168 (and (outline-next-heading)
4097 (org-flag-heading nil))) ; show the next heading 4169 (org-flag-heading nil))) ; show the next heading
4098 (org-todo) 4170 (org-todo)
4099 (setq newhead (org-get-heading))) 4171 (forward-char 1)
4172 (setq newhead (org-get-heading))
4173 (save-excursion
4174 (org-back-to-heading)
4175 (move-marker org-last-heading-marker (point))))
4100 (beginning-of-line 1) 4176 (beginning-of-line 1)
4101 (move-to-column pl) 4177 (save-excursion
4102 (if (looking-at ".*") 4178 (org-agenda-change-all-lines newhead hdmarker 'fixface))
4103 (progn 4179 (move-to-column col)))
4104 (replace-match newhead t t) 4180
4105 (move-to-column col) 4181(defun org-agenda-change-all-lines (newhead hdmarker &optional fixface)
4106 (add-text-properties (point-at-bol) (point-at-eol) props) 4182 "Change all lines in the agenda buffer which match hdmarker.
4107 (beginning-of-line 1)) 4183The new content of the line will be NEWHEAD. HDMARKER is checked with
4108 (error "Line update did not work")))) 4184`equal' against all `org-hd-marker' text properties in the file."
4185 (let* (props m pl undone-face done-face)
4186 (save-excursion
4187 (goto-char (point-max))
4188 (beginning-of-line 1)
4189 (while (not (bobp))
4190 (when (and (setq m (get-text-property (point) 'org-hd-marker))
4191 (equal m hdmarker))
4192 (setq props (text-properties-at (point))
4193 pl (get-text-property (point) 'prefix-length)
4194 undone-face (get-text-property (point) 'undone-face)
4195 done-face (get-text-property (point) 'done-face))
4196 (move-to-column pl)
4197 (if (looking-at ".*")
4198 (progn
4199 (replace-match newhead t t)
4200 (beginning-of-line 1)
4201 (add-text-properties (point-at-bol) (point-at-eol) props)
4202 (if fixface
4203 (add-text-properties
4204 (point-at-bol) (point-at-eol)
4205 (list 'face
4206 (if org-last-todo-state-is-todo
4207 undone-face done-face))))
4208 (beginning-of-line 1))
4209 (error "Line update did not work")))
4210 (beginning-of-line 0)))))
4109 4211
4110(defun org-agenda-priority-up () 4212(defun org-agenda-priority-up ()
4111 "Increase the priority of line at point, also in Org-mode file." 4213 "Increase the priority of line at point, also in Org-mode file."
@@ -4118,7 +4220,9 @@ and by additional input from the age of a schedules or deadline entry."
4118 (org-agenda-priority 'down)) 4220 (org-agenda-priority 'down))
4119 4221
4120(defun org-agenda-priority (&optional force-direction) 4222(defun org-agenda-priority (&optional force-direction)
4121 "Set the priority of line at point, also in Org-mode file." 4223 "Set the priority of line at point, also in Org-mode file.
4224This changes the line at point, all other lines in the agenda referring to
4225the same tree node, and the headline of the tree node in the Org-mode file."
4122 (interactive) 4226 (interactive)
4123 (org-agenda-check-no-diary) 4227 (org-agenda-check-no-diary)
4124 (let* ((props (text-properties-at (point))) 4228 (let* ((props (text-properties-at (point)))
@@ -4128,6 +4232,7 @@ and by additional input from the age of a schedules or deadline entry."
4128 (pl (get-text-property (point-at-bol) 'prefix-length)) 4232 (pl (get-text-property (point-at-bol) 'prefix-length))
4129 (buffer (marker-buffer marker)) 4233 (buffer (marker-buffer marker))
4130 (pos (marker-position marker)) 4234 (pos (marker-position marker))
4235 (hdmarker (get-text-property (point) 'org-hd-marker))
4131 (buffer-read-only nil) 4236 (buffer-read-only nil)
4132 newhead) 4237 newhead)
4133 (save-excursion 4238 (save-excursion
@@ -4140,15 +4245,8 @@ and by additional input from the age of a schedules or deadline entry."
4140 (org-flag-heading nil))) ; show the next heading 4245 (org-flag-heading nil))) ; show the next heading
4141 (funcall 'org-priority force-direction) 4246 (funcall 'org-priority force-direction)
4142 (setq newhead (org-get-heading))) 4247 (setq newhead (org-get-heading)))
4143 (beginning-of-line 1) 4248 (org-agenda-change-all-lines newhead hdmarker)
4144 (move-to-column pl) 4249 (beginning-of-line 1)))
4145 (if (looking-at ".*")
4146 (progn
4147 (replace-match (concat newhead) t t)
4148 (move-to-column col)
4149 (add-text-properties (point-at-bol) (point-at-eol) props)
4150 (beginning-of-line 1))
4151 (error "Line update did not work"))))
4152 4250
4153(defun org-agenda-date-later (arg &optional what) 4251(defun org-agenda-date-later (arg &optional what)
4154 "Change the date of this item to one day later." 4252 "Change the date of this item to one day later."
@@ -4172,8 +4270,8 @@ and by additional input from the age of a schedules or deadline entry."
4172 (interactive "p") 4270 (interactive "p")
4173 (org-agenda-date-later (- arg) what)) 4271 (org-agenda-date-later (- arg) what))
4174 4272
4175(defun org-agenda-date-today (arg) 4273(defun org-agenda-date-prompt (arg)
4176 "Change the date of this item to today." 4274 "Change the date of this item. Date is prompted for, with default today."
4177 (interactive "p") 4275 (interactive "p")
4178 (org-agenda-check-no-diary) 4276 (org-agenda-check-no-diary)
4179 (let* ((marker (or (get-text-property (point) 'org-marker) 4277 (let* ((marker (or (get-text-property (point) 'org-marker)
@@ -4222,7 +4320,7 @@ All the standard commands work: block, weekly etc"
4222 (or (not (equal ?b char)) 4320 (or (not (equal ?b char))
4223 (get-text-property mark 'day))) 4321 (get-text-property mark 'day)))
4224 (error "Don't know which date to use for diary entry")) 4322 (error "Don't know which date to use for diary entry"))
4225 ;; We implememnt this by hacking the `calendar-cursor-to-date' function 4323 ;; We implement this by hacking the `calendar-cursor-to-date' function
4226 ;; and the `calendar-mark-ring' variable. Saves a lot of code. 4324 ;; and the `calendar-mark-ring' variable. Saves a lot of code.
4227 (let ((calendar-mark-ring 4325 (let ((calendar-mark-ring
4228 (list (calendar-gregorian-from-absolute 4326 (list (calendar-gregorian-from-absolute
@@ -4262,12 +4360,12 @@ the cursor position."
4262 (fset 'calendar-cursor-to-date oldf)))) 4360 (fset 'calendar-cursor-to-date oldf))))
4263 4361
4264(defun org-agenda-phases-of-moon () 4362(defun org-agenda-phases-of-moon ()
4265 "Display the phases of the moon for 3 month around cursor date." 4363 "Display the phases of the moon for the 3 months around the cursor date."
4266 (interactive) 4364 (interactive)
4267 (org-agenda-execute-calendar-command 'calendar-phases-of-moon)) 4365 (org-agenda-execute-calendar-command 'calendar-phases-of-moon))
4268 4366
4269(defun org-agenda-holidays () 4367(defun org-agenda-holidays ()
4270 "Display the holidays for 3 month around cursor date." 4368 "Display the holidays for the 3 months around the cursor date."
4271 (interactive) 4369 (interactive)
4272 (org-agenda-execute-calendar-command 'list-calendar-holidays)) 4370 (org-agenda-execute-calendar-command 'list-calendar-holidays))
4273 4371
@@ -4275,11 +4373,12 @@ the cursor position."
4275 "Display sunrise and sunset for the cursor date. 4373 "Display sunrise and sunset for the cursor date.
4276Latitude and longitude can be specified with the variables 4374Latitude and longitude can be specified with the variables
4277`calendar-latitude' and `calendar-longitude'. When called with prefix 4375`calendar-latitude' and `calendar-longitude'. When called with prefix
4278argument, location will be prompted for." 4376argument, latitude and longitude will be prompted for."
4279 (interactive "P") 4377 (interactive "P")
4280 (let ((calendar-longitude (if arg nil calendar-longitude)) 4378 (let ((calendar-longitude (if arg nil calendar-longitude))
4281 (calendar-latitude (if arg nil calendar-latitude)) 4379 (calendar-latitude (if arg nil calendar-latitude))
4282 (calendar-location-name nil)) 4380 (calendar-location-name
4381 (if arg "the given coordinates" calendar-location-name)))
4283 (org-agenda-execute-calendar-command 'calendar-sunrise-sunset))) 4382 (org-agenda-execute-calendar-command 'calendar-sunrise-sunset)))
4284 4383
4285(defun org-agenda-goto-calendar () 4384(defun org-agenda-goto-calendar ()
@@ -4291,6 +4390,13 @@ argument, location will be prompted for."
4291 (calendar) 4390 (calendar)
4292 (calendar-goto-date date))) 4391 (calendar-goto-date date)))
4293 4392
4393(defun org-calendar-goto-agenda ()
4394 "Compute the Org-mode agenda for the calendar date displayed at the cursor.
4395This is a command that has to be installed in `calendar-mode-map'."
4396 (interactive)
4397 (org-agenda nil (calendar-absolute-from-gregorian
4398 (calendar-cursor-to-date))))
4399
4294(defun org-agenda-convert-date () 4400(defun org-agenda-convert-date ()
4295 (interactive) 4401 (interactive)
4296 (let ((day (get-text-property (point) 'day)) 4402 (let ((day (get-text-property (point) 'day))
@@ -4298,25 +4404,21 @@ argument, location will be prompted for."
4298 (unless day 4404 (unless day
4299 (error "Don't know which date to convert")) 4405 (error "Don't know which date to convert"))
4300 (setq date (calendar-gregorian-from-absolute day)) 4406 (setq date (calendar-gregorian-from-absolute day))
4301 (require 'cal-julian)
4302 (require 'cal-hebrew)
4303 (require 'cal-islam)
4304 (require 'cal-french)
4305 (require 'cal-mayan)
4306 (require 'cal-coptic)
4307 (require 'cal-persia)
4308 (require 'cal-china)
4309 (setq s (concat 4407 (setq s (concat
4310 "Gregorian: " (calendar-date-string date) "\n" 4408 "Gregorian: " (calendar-date-string date) "\n"
4409 "ISO: " (calendar-iso-date-string date) "\n"
4410 "Day of Yr: " (calendar-day-of-year-string date) "\n"
4311 "Julian: " (calendar-julian-date-string date) "\n" 4411 "Julian: " (calendar-julian-date-string date) "\n"
4312 "Astronomic: " (calendar-astro-date-string date) " (at noon UTC)\n" 4412 "Astronomic: " (calendar-astro-date-string date)
4313 "Hebrew: " (calendar-hebrew-date-string date) "\n" 4413 " (Julian date number at noon UTC)\n"
4314 "Islamic: " (calendar-islamic-date-string date) "\n" 4414 "Hebrew: " (calendar-hebrew-date-string date) " (until sunset)\n"
4415 "Islamic: " (calendar-islamic-date-string date) " (until sunset)\n"
4315 "French: " (calendar-french-date-string date) "\n" 4416 "French: " (calendar-french-date-string date) "\n"
4316 "Maya: " (calendar-mayan-date-string date) "\n" 4417 "Mayan: " (calendar-mayan-date-string date) "\n"
4317 "Coptic: " (calendar-coptic-date-string date) "\n" 4418 "Coptic: " (calendar-coptic-date-string date) "\n"
4419 "Ethiopic: " (calendar-ethiopic-date-string date) "\n"
4318 "Persian: " (calendar-persian-date-string date) "\n" 4420 "Persian: " (calendar-persian-date-string date) "\n"
4319 "Chineese: " (calendar-chinese-date-string date) "\n")) 4421 "Chinese: " (calendar-chinese-date-string date) "\n"))
4320 (with-output-to-temp-buffer "*Dates*" 4422 (with-output-to-temp-buffer "*Dates*"
4321 (princ s)) 4423 (princ s))
4322 (fit-window-to-buffer (get-buffer-window "*Dates*")))) 4424 (fit-window-to-buffer (get-buffer-window "*Dates*"))))
@@ -5100,11 +5202,11 @@ Used to check if cursor still is in that table, to minimize realignment.")
5100 "Marker at the end of the table last aligned. 5202 "Marker at the end of the table last aligned.
5101Used to check if cursor still is in that table, to minimize realignment.") 5203Used to check if cursor still is in that table, to minimize realignment.")
5102(defvar org-table-last-alignment nil 5204(defvar org-table-last-alignment nil
5103 "List of flags for flushright alignment, from the last re-algnment. 5205 "List of flags for flushright alignment, from the last re-alignment.
5104This is being used to correctly align a single field after TAB or RET.") 5206This is being used to correctly align a single field after TAB or RET.")
5105;; FIXME: The following is currently not used. 5207;; FIXME: The following is currently not used.
5106(defvar org-table-last-column-widths nil 5208(defvar org-table-last-column-widths nil
5107 "List of max width of ffields in each column. 5209 "List of max width of fields in each column.
5108This is being used to correctly align a single field after TAB or RET.") 5210This is being used to correctly align a single field after TAB or RET.")
5109 5211
5110 5212
@@ -5327,7 +5429,7 @@ Before doing so, re-align the table if necessary."
5327 "Copy a field down in the current column. 5429 "Copy a field down in the current column.
5328If the field at the cursor is empty, copy into it the content of the nearest 5430If the field at the cursor is empty, copy into it the content of the nearest
5329non-empty field above. With argument N, use the Nth non-empty field. 5431non-empty field above. With argument N, use the Nth non-empty field.
5330If the current fields is not empty, it is copied down to the next row, and 5432If the current field is not empty, it is copied down to the next row, and
5331the cursor is moved with it. Therefore, repeating this command causes the 5433the cursor is moved with it. Therefore, repeating this command causes the
5332column to be filled row-by-row. 5434column to be filled row-by-row.
5333If the variable `org-table-copy-increment' is non-nil and the field is an 5435If the variable `org-table-copy-increment' is non-nil and the field is an
@@ -5430,7 +5532,7 @@ However, when FORCE is non-nil, create new columns if necessary."
5430 (progn (end-of-line 1) 5532 (progn (end-of-line 1)
5431 (skip-chars-backward "^|") 5533 (skip-chars-backward "^|")
5432 (insert " |") 5534 (insert " |")
5433 (bachward-char 2) t))))) 5535 (backward-char 2) t)))))
5434 (when (and force (not (looking-at ".*|"))) 5536 (when (and force (not (looking-at ".*|")))
5435 (save-excursion (end-of-line 1) (insert "|"))) 5537 (save-excursion (end-of-line 1) (insert "|")))
5436 (if on-delim 5538 (if on-delim
@@ -5533,7 +5635,7 @@ However, when FORCE is non-nil, create new columns if necessary."
5533 "Please position cursor in a data line for column operations"))))) 5635 "Please position cursor in a data line for column operations")))))
5534 5636
5535(defun org-table-delete-column (&optional arg) 5637(defun org-table-delete-column (&optional arg)
5536 "Insert a new column into the table." 5638 "Delete a column into the table."
5537 (interactive "P") 5639 (interactive "P")
5538 (if (not (org-at-table-p)) 5640 (if (not (org-at-table-p))
5539 (error "Not at a table")) 5641 (error "Not at a table"))
@@ -5603,7 +5705,7 @@ However, when FORCE is non-nil, create new columns if necessary."
5603 (interactive) 5705 (interactive)
5604 (org-table-move-row nil)) 5706 (org-table-move-row nil))
5605(defun org-table-move-row-up () 5707(defun org-table-move-row-up ()
5606 "Move table row down." 5708 "Move table row up."
5607 (interactive) 5709 (interactive)
5608 (org-table-move-row 'up)) 5710 (org-table-move-row 'up))
5609 5711
@@ -5696,7 +5798,7 @@ With prefix ARG, insert above the current line."
5696 5798
5697(defun org-table-copy-region (&optional cut) 5799(defun org-table-copy-region (&optional cut)
5698 "Copy rectangular region in table to clipboard. 5800 "Copy rectangular region in table to clipboard.
5699A special clibbooard is used which can only be accessed 5801A special clipboard is used which can only be accessed
5700with `org-table-paste-rectangle'" 5802with `org-table-paste-rectangle'"
5701 (interactive "P") 5803 (interactive "P")
5702 (unless (org-region-active-p) (error "No active region")) 5804 (unless (org-region-active-p) (error "No active region"))
@@ -5731,7 +5833,7 @@ with `org-table-paste-rectangle'"
5731 (if cut (org-table-align)))) 5833 (if cut (org-table-align))))
5732 5834
5733(defun org-table-paste-rectangle (&optional arg) 5835(defun org-table-paste-rectangle (&optional arg)
5734 "Paste a rectangluar region into a table. 5836 "Paste a rectangular region into a table.
5735The upper right corner ends up in the current field. All involved fields 5837The upper right corner ends up in the current field. All involved fields
5736will be overwritten. If the rectangle does not fit into the present table, 5838will be overwritten. If the rectangle does not fit into the present table,
5737the table is enlarged as needed. The process ignores horizontal separator 5839the table is enlarged as needed. The process ignores horizontal separator
@@ -5835,7 +5937,7 @@ blank, and the content is appended to the field above."
5835 nlines) 5937 nlines)
5836 (org-table-cut-region) 5938 (org-table-cut-region)
5837 (if (> (length (car org-table-clip)) 1) 5939 (if (> (length (car org-table-clip)) 1)
5838 (error "Region must be limited to single columm")) 5940 (error "Region must be limited to single column"))
5839 (setq nlines (if arg 5941 (setq nlines (if arg
5840 (if (< arg 1) 5942 (if (< arg 1)
5841 (+ (length org-table-clip) arg) 5943 (+ (length org-table-clip) arg)
@@ -5873,11 +5975,11 @@ blank, and the content is appended to the field above."
5873 (if (string-match "[ \t]+$" s) (setq s (replace-match "" t t s)))) 5975 (if (string-match "[ \t]+$" s) (setq s (replace-match "" t t s))))
5874 5976
5875(defun org-wrap (string &optional width lines) 5977(defun org-wrap (string &optional width lines)
5876 "Wrap string to either a number of lines, or a with in characters. 5978 "Wrap string to either a number of lines, or a width in characters.
5877If WIDTH is non-nil, the string is wrapped to that width, however many lines 5979If WIDTH is non-nil, the string is wrapped to that width, however many lines
5878that costs. If there is a work longer than WIDTH, the text is actually 5980that costs. If there is a word longer than WIDTH, the text is actually
5879wrapped to the length of that word. 5981wrapped to the length of that word.
5880IF WIDTH is nil and LINES is non-nil, the string is forced into at mot that 5982IF WIDTH is nil and LINES is non-nil, the string is forced into at most that
5881many lines, whatever width that takes. 5983many lines, whatever width that takes.
5882The return value is a list of lines, without newlines at the end." 5984The return value is a list of lines, without newlines at the end."
5883 (let* ((words (org-split-string string "[ \t\n]+")) 5985 (let* ((words (org-split-string string "[ \t\n]+"))
@@ -5961,7 +6063,7 @@ and end of string."
5961(defun org-table-toggle-vline-visibility (&optional arg) 6063(defun org-table-toggle-vline-visibility (&optional arg)
5962 "Toggle the visibility of table vertical lines. 6064 "Toggle the visibility of table vertical lines.
5963The effect is immediate and on all tables in the file. 6065The effect is immediate and on all tables in the file.
5964With prefix ARG, make lines invisible when ARG if positive, make lines 6066With prefix ARG, make lines invisible when ARG is positive, make lines
5965visible when ARG is not positive" 6067visible when ARG is not positive"
5966 (interactive "P") 6068 (interactive "P")
5967 (let ((action (cond 6069 (let ((action (cond
@@ -5983,7 +6085,7 @@ visible when ARG is not positive"
5983 (redraw-frame (selected-frame)))) 6085 (redraw-frame (selected-frame))))
5984 6086
5985(defun org-table-map-tables (function) 6087(defun org-table-map-tables (function)
5986 "Apply FUNCTION to the start of all tables in the buffer." 6088 "Apply FUNCTION to the start of all tables in the buffer."
5987 (save-excursion 6089 (save-excursion
5988 (save-restriction 6090 (save-restriction
5989 (widen) 6091 (widen)
@@ -6005,7 +6107,7 @@ numbers in that rectangle will be summed. If there is no active
6005region and point is located in a table column, sum all numbers in that 6107region and point is located in a table column, sum all numbers in that
6006column. 6108column.
6007 6109
6008If at least on number looks like a time HH:MM or HH:MM:SS, all other 6110If at least one number looks like a time HH:MM or HH:MM:SS, all other
6009numbers are assumed to be times as well (in decimal hours) and the 6111numbers are assumed to be times as well (in decimal hours) and the
6010numbers are added as such." 6112numbers are added as such."
6011 (interactive) 6113 (interactive)
@@ -6115,9 +6217,9 @@ the result.
6115 6217
6116A few examples for formulae: 6218A few examples for formulae:
6117 $1+$2 Sum of first and second field 6219 $1+$2 Sum of first and second field
6118 $1+$2;%f.2 Same, and format result to two digits after dec.point 6220 $1+$2;%.2f Same, and format result to two digits after dec.point
6119 exp($2)+exp($1) Math functions can be used 6221 exp($2)+exp($1) Math functions can be used
6120 $;%f.1 Reformat current cell to 1 digit after dec.point 6222 $;%.1f Reformat current cell to 1 digit after dec.point
6121 ($3-32)*5/9 degrees F -> C conversion 6223 ($3-32)*5/9 degrees F -> C conversion
6122 6224
6123When called with a raw C-u prefix, the formula is applied to the current 6225When called with a raw C-u prefix, the formula is applied to the current
@@ -6210,7 +6312,7 @@ this variable requires a restart of Emacs to become effective."
6210 6312
6211(defvar orgtbl-mode nil 6313(defvar orgtbl-mode nil
6212 "Variable controlling orgtbl-mode, a minor mode enabling the org-mode 6314 "Variable controlling orgtbl-mode, a minor mode enabling the org-mode
6213table editor iin arbitrary modes.") 6315table editor in arbitrary modes.")
6214(make-variable-buffer-local 'orgtbl-mode) 6316(make-variable-buffer-local 'orgtbl-mode)
6215 6317
6216(defvar orgtbl-mode-map (make-sparse-keymap) 6318(defvar orgtbl-mode-map (make-sparse-keymap)
@@ -6399,36 +6501,36 @@ a reduced column width."
6399(easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu" 6501(easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu"
6400 '("Tbl" 6502 '("Tbl"
6401 ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"] 6503 ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"]
6402 ["Next field" org-cycle :active (org-at-table-p) :keys "TAB"] 6504 ["Next Field" org-cycle :active (org-at-table-p) :keys "TAB"]
6403 ["Previous Field" org-shifttab :active (org-at-table-p) :keys "S-TAB"] 6505 ["Previous Field" org-shifttab :active (org-at-table-p) :keys "S-TAB"]
6404 ["Next row" org-return :active (org-at-table-p) :keys "RET"] 6506 ["Next Row" org-return :active (org-at-table-p) :keys "RET"]
6405 "--" 6507 "--"
6406 ["Blank field" org-table-blank-field :active (org-at-table-p) :keys "C-c SPC"] 6508 ["Blank Field" org-table-blank-field :active (org-at-table-p) :keys "C-c SPC"]
6407 ["Copy field from above" 6509 ["Copy Field from Above"
6408 org-table-copy-down :active (org-at-table-p) :keys "S-RET"] 6510 org-table-copy-down :active (org-at-table-p) :keys "S-RET"]
6409 "--" 6511 "--"
6410 ("Column" 6512 ("Column"
6411 ["Move column left" org-metaleft :active (org-at-table-p) :keys "M-<left>"] 6513 ["Move Column Left" org-metaleft :active (org-at-table-p) :keys "M-<left>"]
6412 ["Move column right" org-metaright :active (org-at-table-p) :keys "M-<right>"] 6514 ["Move Column Right" org-metaright :active (org-at-table-p) :keys "M-<right>"]
6413 ["Delete column" org-shiftmetaleft :active (org-at-table-p) :keys "M-S-<left>"] 6515 ["Delete Column" org-shiftmetaleft :active (org-at-table-p) :keys "M-S-<left>"]
6414 ["Insert column" org-shiftmetaright :active (org-at-table-p) :keys "M-S-<right>"]) 6516 ["Insert Column" org-shiftmetaright :active (org-at-table-p) :keys "M-S-<right>"])
6415 ("Row" 6517 ("Row"
6416 ["Move row up" org-metaup :active (org-at-table-p) :keys "M-<up>"] 6518 ["Move Row Up" org-metaup :active (org-at-table-p) :keys "M-<up>"]
6417 ["Move row down" org-metadown :active (org-at-table-p) :keys "M-<down>"] 6519 ["Move Row Down" org-metadown :active (org-at-table-p) :keys "M-<down>"]
6418 ["Delete row" org-shiftmetaup :active (org-at-table-p) :keys "M-S-<up>"] 6520 ["Delete Row" org-shiftmetaup :active (org-at-table-p) :keys "M-S-<up>"]
6419 ["Insert row" org-shiftmetadown :active (org-at-table-p) :keys "M-S-<down>"] 6521 ["Insert Row" org-shiftmetadown :active (org-at-table-p) :keys "M-S-<down>"]
6420 "--" 6522 "--"
6421 ["Insert hline" org-table-insert-hline :active (org-at-table-p) :keys "C-c -"]) 6523 ["Insert Hline" org-table-insert-hline :active (org-at-table-p) :keys "C-c -"])
6422 ("Rectangle" 6524 ("Rectangle"
6423 ["Copy rectangle" org-copy-special :active (org-at-table-p) :keys "C-c M-w"] 6525 ["Copy Rectangle" org-copy-special :active (org-at-table-p) :keys "C-c M-w"]
6424 ["Cut rectangle" org-cut-special :active (org-at-table-p) :keys "C-c C-w"] 6526 ["Cut Rectangle" org-cut-special :active (org-at-table-p) :keys "C-c C-w"]
6425 ["Paste rectangle" org-paste-special :active (org-at-table-p) :keys "C-c C-y"] 6527 ["Paste Rectangle" org-paste-special :active (org-at-table-p) :keys "C-c C-y"]
6426 ["Fill rectangle" org-table-wrap-region :active (org-at-table-p) :keys "C-c C-q"]) 6528 ["Fill Rectangle" org-table-wrap-region :active (org-at-table-p) :keys "C-c C-q"])
6427 "--" 6529 "--"
6428 ["Which column?" org-table-current-column :active (org-at-table-p) :keys "C-c ?"] 6530 ["Which Column?" org-table-current-column :active (org-at-table-p) :keys "C-c ?"]
6429 ["Sum column/rectangle" org-table-sum 6531 ["Sum Column/Rectangle" org-table-sum
6430 :active (or (org-at-table-p) (org-region-active-p)) :keys "C-c +"] 6532 :active (or (org-at-table-p) (org-region-active-p)) :keys "C-c +"]
6431 ["Eval formula" org-table-eval-formula :active (org-at-table-p) :keys "C-c ="] 6533 ["Eval Formula" org-table-eval-formula :active (org-at-table-p) :keys "C-c ="]
6432 )) 6534 ))
6433 6535
6434;;; Exporting 6536;;; Exporting
@@ -6436,7 +6538,7 @@ a reduced column width."
6436(defconst org-level-max 20) 6538(defconst org-level-max 20)
6437 6539
6438(defun org-export-find-first-heading-line (list) 6540(defun org-export-find-first-heading-line (list)
6439 "Remove all lines from LIST which are before the first headline." 6541 "Remove all lines from LIST which are before the first headline."
6440 (let ((orig-list list) 6542 (let ((orig-list list)
6441 (re (concat "^" outline-regexp))) 6543 (re (concat "^" outline-regexp)))
6442 (while (and list 6544 (while (and list
@@ -6897,7 +6999,7 @@ underlined headlines. The default is 3."
6897 (if todo (throw 'exit t)))))))) 6999 (if todo (throw 'exit t))))))))
6898 7000
6899;; FIXME: Try to handle <b> and <i> as faces via text properties. 7001;; FIXME: Try to handle <b> and <i> as faces via text properties.
6900;; FIXME: Can I implement *bold*,/italic/ and _underline_ for AXCII export? 7002;; FIXME: Can I implement *bold*,/italic/ and _underline_ for ASCII export?
6901(defun org-html-expand-for-ascii (line) 7003(defun org-html-expand-for-ascii (line)
6902 "Handle quoted HTML for ASCII export." 7004 "Handle quoted HTML for ASCII export."
6903 (if org-export-html-expand 7005 (if org-export-html-expand
@@ -6930,7 +7032,7 @@ underlined headlines. The default is 3."
6930 7032
6931(defun org-export-copy-visible (&optional arg) 7033(defun org-export-copy-visible (&optional arg)
6932 "Copy the visible part of the buffer to another buffer, for printing. 7034 "Copy the visible part of the buffer to another buffer, for printing.
6933Also removes the first line of the buffer it is specifies a mode, 7035Also removes the first line of the buffer if it specifies a mode,
6934and all options lines." 7036and all options lines."
6935 (interactive "P") 7037 (interactive "P")
6936 (let* ((filename (concat (file-name-sans-extension (buffer-file-name)) 7038 (let* ((filename (concat (file-name-sans-extension (buffer-file-name))
@@ -7013,7 +7115,8 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
7013 (if (equal org-todo-interpretation 'type) 7115 (if (equal org-todo-interpretation 'type)
7014 (mapconcat 'identity org-todo-keywords " ") 7116 (mapconcat 'identity org-todo-keywords " ")
7015 "Me Jason Marie DONE") 7117 "Me Jason Marie DONE")
7016 (if org-startup-folded "fold" "nofold") 7118 (cdr (assoc org-startup-folded
7119 '((nil . "nofold")(t . "fold")(content . "content"))))
7017 (if org-startup-with-deadline-check "dlcheck" "nodlcheck") 7120 (if org-startup-with-deadline-check "dlcheck" "nodlcheck")
7018 )) 7121 ))
7019 7122
@@ -7029,7 +7132,7 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
7029(defun org-toggle-fixed-width-section (arg) 7132(defun org-toggle-fixed-width-section (arg)
7030 "Toggle the fixed-width indicator at the beginning of lines in the region. 7133 "Toggle the fixed-width indicator at the beginning of lines in the region.
7031If there is no active region, only acts on the current line. 7134If there is no active region, only acts on the current line.
7032If the first non-white character in the first line of the region is a 7135If the first non-white character in the first line of the region is a
7033vertical bar \"|\", then the command removes the bar from all lines in 7136vertical bar \"|\", then the command removes the bar from all lines in
7034the region. If the first character is not a bar, the command adds a 7137the region. If the first character is not a bar, the command adds a
7035bar to all lines, in the column given by the beginning of the region. 7138bar to all lines, in the column given by the beginning of the region.
@@ -7736,8 +7839,8 @@ When LEVEL is non-nil, increase section numbers on that level."
7736(define-key org-mode-map "\C-c\C-x\C-a" 'org-export-as-ascii) 7839(define-key org-mode-map "\C-c\C-x\C-a" 'org-export-as-ascii)
7737(define-key org-mode-map "\C-c\C-xv" 'org-export-copy-visible) 7840(define-key org-mode-map "\C-c\C-xv" 'org-export-copy-visible)
7738(define-key org-mode-map "\C-c\C-x\C-v" 'org-export-copy-visible) 7841(define-key org-mode-map "\C-c\C-x\C-v" 'org-export-copy-visible)
7739(define-key org-mode-map "\C-c\C-xo" 'org-export-as-opml) 7842;(define-key org-mode-map "\C-c\C-xo" 'org-export-as-opml)
7740(define-key org-mode-map "\C-c\C-x\C-o" 'org-export-as-opml) 7843;(define-key org-mode-map "\C-c\C-x\C-o" 'org-export-as-opml)
7741(define-key org-mode-map "\C-c\C-xt" 'org-insert-export-options-template) 7844(define-key org-mode-map "\C-c\C-xt" 'org-insert-export-options-template)
7742(define-key org-mode-map "\C-c:" 'org-toggle-fixed-width-section) 7845(define-key org-mode-map "\C-c:" 'org-toggle-fixed-width-section)
7743(define-key org-mode-map "\C-c\C-xh" 'org-export-as-html) 7846(define-key org-mode-map "\C-c\C-xh" 'org-export-as-html)
@@ -7941,6 +8044,8 @@ the automatic table editor has been turned off."
7941 (table-recognize-table)) 8044 (table-recognize-table))
7942 ((org-at-table-p) 8045 ((org-at-table-p)
7943 (org-table-align)) 8046 (org-table-align))
8047 ((save-excursion (beginning-of-line 1) (looking-at "#\\+[A-Z]+"))
8048 (let (org-inhibit-startup) (org-mode)))
7944 ((org-region-active-p) 8049 ((org-region-active-p)
7945 (org-table-convert-region (region-beginning) (region-end) arg)) 8050 (org-table-convert-region (region-beginning) (region-end) arg))
7946 ((and (region-beginning) (region-end)) 8051 ((and (region-beginning) (region-end))
@@ -7996,8 +8101,8 @@ the automatic table editor has been turned off."
7996 "--" 8101 "--"
7997 ["Jump" org-goto t]) 8102 ["Jump" org-goto t])
7998 ("Edit Structure" 8103 ("Edit Structure"
7999 ["Move subtree up" org-shiftmetaup (not (org-at-table-p))] 8104 ["Move Subtree Up" org-shiftmetaup (not (org-at-table-p))]
8000 ["Move subtree down" org-shiftmetadown (not (org-at-table-p))] 8105 ["Move Subtree Down" org-shiftmetadown (not (org-at-table-p))]
8001 "--" 8106 "--"
8002 ["Copy Subtree" org-copy-special (not (org-at-table-p))] 8107 ["Copy Subtree" org-copy-special (not (org-at-table-p))]
8003 ["Cut Subtree" org-cut-special (not (org-at-table-p))] 8108 ["Cut Subtree" org-cut-special (not (org-at-table-p))]
@@ -8008,20 +8113,20 @@ the automatic table editor has been turned off."
8008 ["Demote Heading" org-metaright (not (org-at-table-p))] 8113 ["Demote Heading" org-metaright (not (org-at-table-p))]
8009 ["Demote Subtree" org-shiftmetaright (not (org-at-table-p))]) 8114 ["Demote Subtree" org-shiftmetaright (not (org-at-table-p))])
8010 "--" 8115 "--"
8011 ("TODO lists" 8116 ("TODO Lists"
8012 ["TODO/DONE/-" org-todo t] 8117 ["TODO/DONE/-" org-todo t]
8013 ["Show TODO Tree" org-show-todo-tree t] 8118 ["Show TODO Tree" org-show-todo-tree t]
8014 "--" 8119 "--"
8015 ["Set priority" org-priority t] 8120 ["Set Priority" org-priority t]
8016 ["Priority up" org-shiftup t] 8121 ["Priority Up" org-shiftup t]
8017 ["Priority down" org-shiftdown t]) 8122 ["Priority Down" org-shiftdown t])
8018 ("Dates and Scheduling" 8123 ("Dates and Scheduling"
8019 ["Timestamp" org-time-stamp t] 8124 ["Timestamp" org-time-stamp t]
8020 ("Change Date" 8125 ("Change Date"
8021 ["1 day later" org-timestamp-up-day t] 8126 ["1 Day Later" org-timestamp-up-day t]
8022 ["1 day earlier" org-timestamp-down-day t] 8127 ["1 Day Earlier" org-timestamp-down-day t]
8023 ["1 ... later" org-shiftup t] 8128 ["1 ... Later" org-shiftup t]
8024 ["1 ... earlier" org-shiftdown t]) 8129 ["1 ... Earlier" org-shiftdown t])
8025 ["Compute Time Range" org-evaluate-time-range t] 8130 ["Compute Time Range" org-evaluate-time-range t]
8026 ["Schedule Item" org-schedule t] 8131 ["Schedule Item" org-schedule t]
8027 ["Deadline" org-deadline t] 8132 ["Deadline" org-deadline t]
@@ -8030,71 +8135,70 @@ the automatic table editor has been turned off."
8030 ["Date from Calendar" org-date-from-calendar t]) 8135 ["Date from Calendar" org-date-from-calendar t])
8031 "--" 8136 "--"
8032 ("Timeline/Agenda" 8137 ("Timeline/Agenda"
8033 ["Show TODO Tree this file" org-show-todo-tree t] 8138 ["Show TODO Tree this File" org-show-todo-tree t]
8034 ["Check Deadlines this file" org-check-deadlines t] 8139 ["Check Deadlines this File" org-check-deadlines t]
8035 ["Timeline current file" org-timeline t] 8140 ["Timeline Current File" org-timeline t]
8036 "--" 8141 "--"
8037 ["Adenda (multifile)" org-agenda t]) 8142 ["Agenda" org-agenda t])
8038 ("File List for Agenda") 8143 ("File List for Agenda")
8039 "--" 8144 "--"
8040 ("Hyperlinks" 8145 ("Hyperlinks"
8041 ["Store Link (global)" org-store-link t] 8146 ["Store Link (Global)" org-store-link t]
8042 ["Insert Link" org-insert-link t] 8147 ["Insert Link" org-insert-link t]
8043 ["Follow Link" org-open-at-point t]) 8148 ["Follow Link" org-open-at-point t])
8044 ;; ["BBDB" org-bbdb-name t]
8045 "--" 8149 "--"
8046 ("Table" 8150 ("Table"
8047 ["Align" org-ctrl-c-ctrl-c (org-at-table-p)] 8151 ["Align" org-ctrl-c-ctrl-c (org-at-table-p)]
8048 ["Next field" org-cycle (org-at-table-p)] 8152 ["Next Field" org-cycle (org-at-table-p)]
8049 ["Previous Field" org-shifttab (org-at-table-p)] 8153 ["Previous Field" org-shifttab (org-at-table-p)]
8050 ["Next row" org-return (org-at-table-p)] 8154 ["Next Row" org-return (org-at-table-p)]
8051 "--" 8155 "--"
8052 ["Blank field" org-table-blank-field (org-at-table-p)] 8156 ["Blank Field" org-table-blank-field (org-at-table-p)]
8053 ["Copy field from above" org-table-copy-down (org-at-table-p)] 8157 ["Copy Field from Above" org-table-copy-down (org-at-table-p)]
8054 "--" 8158 "--"
8055 ("Column" 8159 ("Column"
8056 ["Move column left" org-metaleft (org-at-table-p)] 8160 ["Move Column Left" org-metaleft (org-at-table-p)]
8057 ["Move column right" org-metaright (org-at-table-p)] 8161 ["Move Column Right" org-metaright (org-at-table-p)]
8058 ["Delete column" org-shiftmetaleft (org-at-table-p)] 8162 ["Delete Column" org-shiftmetaleft (org-at-table-p)]
8059 ["Insert column" org-shiftmetaright (org-at-table-p)]) 8163 ["Insert Column" org-shiftmetaright (org-at-table-p)])
8060 ("Row" 8164 ("Row"
8061 ["Move row up" org-metaup (org-at-table-p)] 8165 ["Move Row Up" org-metaup (org-at-table-p)]
8062 ["Move row down" org-metadown (org-at-table-p)] 8166 ["Move Row Down" org-metadown (org-at-table-p)]
8063 ["Delete row" org-shiftmetaup (org-at-table-p)] 8167 ["Delete Row" org-shiftmetaup (org-at-table-p)]
8064 ["Insert row" org-shiftmetadown (org-at-table-p)] 8168 ["Insert Row" org-shiftmetadown (org-at-table-p)]
8065 "--" 8169 "--"
8066 ["Insert hline" org-table-insert-hline (org-at-table-p)]) 8170 ["Insert Hline" org-table-insert-hline (org-at-table-p)])
8067 ("Rectangle" 8171 ("Rectangle"
8068 ["Copy rectangle" org-copy-special (org-at-table-p)] 8172 ["Copy Rectangle" org-copy-special (org-at-table-p)]
8069 ["Cut rectangle" org-cut-special (org-at-table-p)] 8173 ["Cut Rectangle" org-cut-special (org-at-table-p)]
8070 ["Paste rectangle" org-paste-special (org-at-table-p)] 8174 ["Paste Rectangle" org-paste-special (org-at-table-p)]
8071 ["Fill rectangle" org-table-wrap-region (org-at-table-p)]) 8175 ["Fill Rectangle" org-table-wrap-region (org-at-table-p)])
8072 "--" 8176 "--"
8073 ["Which column?" org-table-current-column (org-at-table-p)] 8177 ["Which Column?" org-table-current-column (org-at-table-p)]
8074 ["Sum column/rectangle" org-table-sum 8178 ["Sum Column/Rectangle" org-table-sum
8075 (or (org-at-table-p) (org-region-active-p))] 8179 (or (org-at-table-p) (org-region-active-p))]
8076 ["Eval formula" org-table-eval-formula (org-at-table-p)] 8180 ["Eval Formula" org-table-eval-formula (org-at-table-p)]
8077 "--" 8181 "--"
8078 ["Invisible Vlines" org-table-toggle-vline-visibility 8182 ["Invisible Vlines" org-table-toggle-vline-visibility
8079 :style toggle :selected (org-in-invisibility-spec-p '(org-table))] 8183 :style toggle :selected (org-in-invisibility-spec-p '(org-table))]
8080 "--" 8184 "--"
8081 ["Create" org-table-create (and (not (org-at-table-p)) 8185 ["Create" org-table-create (and (not (org-at-table-p))
8082 org-enable-table-editor)] 8186 org-enable-table-editor)]
8083 ["Convert region" org-ctrl-c-ctrl-c (not (org-at-table-p 'any))] 8187 ["Convert Region" org-ctrl-c-ctrl-c (not (org-at-table-p 'any))]
8084 ["Import from file" org-table-import (not (org-at-table-p))] 8188 ["Import from File" org-table-import (not (org-at-table-p))]
8085 ["Export to file" org-table-export (org-at-table-p)] 8189 ["Export to File" org-table-export (org-at-table-p)]
8086 "--" 8190 "--"
8087 ["Create/convert from/to table.el" org-table-create-with-table.el t]) 8191 ["Create/Convert from/to table.el" org-table-create-with-table.el t])
8088 "--" 8192 "--"
8089 ("Export" 8193 ("Export"
8090 ["ASCII" org-export-as-ascii t] 8194 ["ASCII" org-export-as-ascii t]
8091 ["Extract visible text" org-export-copy-visible t] 8195 ["Extract Visible Text" org-export-copy-visible t]
8092 ["HTML" org-export-as-html t] 8196 ["HTML" org-export-as-html t]
8093 ["HTML, and open" org-export-as-html-and-open t] 8197 ["HTML and Open" org-export-as-html-and-open t]
8094 ["OPML" org-export-as-opml nil] 8198; ["OPML" org-export-as-opml nil]
8095 "--" 8199 "--"
8096 ["Option template" org-insert-export-options-template t] 8200 ["Option Template" org-insert-export-options-template t]
8097 ["Toggle fixed width" org-toggle-fixed-width-section t]) 8201 ["Toggle Fixed Width" org-toggle-fixed-width-section t])
8098 "--" 8202 "--"
8099 ("Documentation" 8203 ("Documentation"
8100 ["Show Version" org-version t] 8204 ["Show Version" org-version t]
@@ -8106,7 +8210,6 @@ the automatic table editor has been turned off."
8106 (fboundp 'customize-menu-create)]) 8210 (fboundp 'customize-menu-create)])
8107 )) 8211 ))
8108 8212
8109
8110(defun org-info (&optional node) 8213(defun org-info (&optional node)
8111 "Read documentation for Org-mode in the info system. 8214 "Read documentation for Org-mode in the info system.
8112With optional NODE, go directly to that node." 8215With optional NODE, go directly to that node."
@@ -8114,15 +8217,14 @@ With optional NODE, go directly to that node."
8114 (require 'info) 8217 (require 'info)
8115 (Info-goto-node (format "(org)%s" (or node "")))) 8218 (Info-goto-node (format "(org)%s" (or node ""))))
8116 8219
8117
8118(defun org-install-agenda-files-menu () 8220(defun org-install-agenda-files-menu ()
8119 (easy-menu-change 8221 (easy-menu-change
8120 '("Org") "File List for Agenda" 8222 '("Org") "File List for Agenda"
8121 (append 8223 (append
8122 (list 8224 (list
8123 ["Edit file list" (customize-variable 'org-agenda-files) t] 8225 ["Edit File List" (customize-variable 'org-agenda-files) t]
8124 ["Add current file to list" org-add-file t] 8226 ["Add Current File to List" org-add-file t]
8125 ["Remove current file from list" org-remove-file t] 8227 ["Remove Current File from List" org-remove-file t]
8126 "--") 8228 "--")
8127 (mapcar 'org-file-menu-entry org-agenda-files)))) 8229 (mapcar 'org-file-menu-entry org-agenda-files))))
8128 8230
@@ -8301,7 +8403,7 @@ If INVISIBLE-OK is non-nil, an invisible heading line is ok too."
8301This function considers both visible and invisible heading lines. 8403This function considers both visible and invisible heading lines.
8302With argument, move up ARG levels." 8404With argument, move up ARG levels."
8303 (if org-noutline-p 8405 (if org-noutline-p
8304 (outline-up-heading-all arg) 8406 (outline-up-heading arg t)
8305 (org-back-to-heading t) 8407 (org-back-to-heading t)
8306 (looking-at outline-regexp) 8408 (looking-at outline-regexp)
8307 (if (<= (- (match-end 0) (match-beginning 0)) arg) 8409 (if (<= (- (match-end 0) (match-beginning 0)) arg)
@@ -8381,5 +8483,3 @@ When ENTRY is non-nil, show the entire entry."
8381 8483
8382;;; org.el ends here 8484;;; org.el ends here
8383 8485
8384
8385
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 59f82c12e31..c903dbac523 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -139,10 +139,8 @@ only tooltips in the buffer containing the overlay arrow."
139 :tag "GUD buffers predicate" 139 :tag "GUD buffers predicate"
140 :group 'tooltip) 140 :group 'tooltip)
141 141
142(defcustom tooltip-use-echo-area nil 142(defcustom tooltip-gud-echo-area nil
143 "Use the echo area instead of tooltip frames. 143 "Use the echo area instead of frames for GUD tooltips."
144This is only relevant GUD display, since otherwise it is equivalent to
145turning off Tooltip mode."
146 :type 'boolean 144 :type 'boolean
147 :tag "Use echo area" 145 :tag "Use echo area"
148 :group 'tooltip) 146 :group 'tooltip)
@@ -187,6 +185,12 @@ This might return nil if the event did not occur over a buffer."
187 "Toggle Tooltip display. 185 "Toggle Tooltip display.
188With ARG, turn tooltip mode on if and only if ARG is positive." 186With ARG, turn tooltip mode on if and only if ARG is positive."
189 :global t 187 :global t
188 ;; If you change the :init-value below, you also need to change the
189 ;; corresponding code in startup.el.
190 :init-value (not (or noninteractive
191 emacs-quick-startup
192 (not (display-graphic-p))
193 (not (fboundp 'x-show-tip))))
190 :group 'tooltip 194 :group 'tooltip
191 (unless (or (null tooltip-mode) (fboundp 'x-show-tip)) 195 (unless (or (null tooltip-mode) (fboundp 'x-show-tip))
192 (error "Sorry, tooltips are not yet available on this system")) 196 (error "Sorry, tooltips are not yet available on this system"))
@@ -285,17 +289,19 @@ change the existing association. Value is the resulting alist."
285 (push (cons key value) alist)) 289 (push (cons key value) alist))
286 alist)) 290 alist))
287 291
288(defun tooltip-show (text) 292(defun tooltip-show (text gud-tip)
289 "Show a tooltip window displaying TEXT. 293 "Show a tooltip window displaying TEXT.
290 294
291Text larger than `x-max-tooltip-size' (which see) is clipped. 295Text larger than `x-max-tooltip-size' is clipped.
292 296
293If the alist in `tooltip-frame-parameters' includes `left' and `top' 297If the alist in `tooltip-frame-parameters' includes `left' and `top'
294parameters, they determine the x and y position where the tooltip 298parameters, they determine the x and y position where the tooltip
295is displayed. Otherwise, the tooltip pops at offsets specified by 299is displayed. Otherwise, the tooltip pops at offsets specified by
296`tooltip-x-offset' and `tooltip-y-offset' from the current mouse 300`tooltip-x-offset' and `tooltip-y-offset' from the current mouse
297position." 301position.
298 (if tooltip-use-echo-area 302
303GUD-TIP is t if the tooltip is from a GUD session and nil otherwise."
304 (if (and gud-tip tooltip-gud-echo-area)
299 (message "%s" text) 305 (message "%s" text)
300 (condition-case error 306 (condition-case error
301 (let ((params (copy-sequence tooltip-frame-parameters)) 307 (let ((params (copy-sequence tooltip-frame-parameters))
@@ -411,7 +417,7 @@ This event can be examined by forms in TOOLTIP-GUD-DISPLAY.")
411(defun tooltip-gud-process-output (process output) 417(defun tooltip-gud-process-output (process output)
412 "Process debugger output and show it in a tooltip window." 418 "Process debugger output and show it in a tooltip window."
413 (set-process-filter process tooltip-gud-original-filter) 419 (set-process-filter process tooltip-gud-original-filter)
414 (tooltip-show (tooltip-strip-prompt process output))) 420 (tooltip-show (tooltip-strip-prompt process output) t))
415 421
416(defun tooltip-gud-print-command (expr) 422(defun tooltip-gud-print-command (expr)
417 "Return a suitable command to print the expression EXPR. 423 "Return a suitable command to print the expression EXPR.
@@ -457,8 +463,8 @@ This function must return nil if it doesn't handle EVENT."
457 (tooltip-show 463 (tooltip-show
458 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer) 464 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
459 (let ((string (buffer-string))) 465 (let ((string (buffer-string)))
460 ;; remove newline for tooltip-use-echo-area 466 ;; remove newline for tooltip-gud-echo-area
461 (substring string 0 (- (length string) 1)))))) 467 (substring string 0 (- (length string) 1)))) t))
462 468
463 469
464;;; Tooltip help. 470;;; Tooltip help.
@@ -491,7 +497,7 @@ This is installed on the hook `tooltip-hook', which is run when
491the timer with ID `tooltip-timeout-id' fires. 497the timer with ID `tooltip-timeout-id' fires.
492Value is non-nil if this function handled the tip." 498Value is non-nil if this function handled the tip."
493 (when (stringp tooltip-help-message) 499 (when (stringp tooltip-help-message)
494 (tooltip-show tooltip-help-message) 500 (tooltip-show tooltip-help-message nil)
495 t)) 501 t))
496 502
497(provide 'tooltip) 503(provide 'tooltip)
diff --git a/lisp/wdired.el b/lisp/wdired.el
index 4b37bc33659..3941fd681df 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -31,8 +31,8 @@
31;; 31;;
32;; Have you ever wished to use C-x r t (string-rectangle), M-% 32;; Have you ever wished to use C-x r t (string-rectangle), M-%
33;; (query-replace), M-c (capitalize-word), etc. to change the name of 33;; (query-replace), M-c (capitalize-word), etc. to change the name of
34;; the files in a "dired" buffer? Now you can do this. All the power 34;; the files in a "dired" buffer? Now you can do this. All the power
35;; of emacs commands are available to renaming files! 35;; of Emacs commands are available to renaming files!
36;; 36;;
37;; This package provides a function that makes the filenames of a a 37;; This package provides a function that makes the filenames of a a
38;; dired buffer editable, by changing the buffer mode (which inhibits 38;; dired buffer editable, by changing the buffer mode (which inhibits
@@ -40,7 +40,7 @@
40;; one or more files and directories, and when you press C-c C-c, the 40;; one or more files and directories, and when you press C-c C-c, the
41;; renaming takes effect and you are back to dired mode. 41;; renaming takes effect and you are back to dired mode.
42;; 42;;
43;; Another things you can do with wdired: 43;; Another things you can do with WDired:
44;; 44;;
45;; - To move files to another directory (by typing their path, 45;; - To move files to another directory (by typing their path,
46;; absolute or relative, as a part of the new filename). 46;; absolute or relative, as a part of the new filename).
@@ -49,21 +49,16 @@
49;; 49;;
50;; - To change the permission bits of the filenames (in systems with a 50;; - To change the permission bits of the filenames (in systems with a
51;; working unix-alike `dired-chmod-program'). See and customize the 51;; working unix-alike `dired-chmod-program'). See and customize the
52;; variable `wdired-allow-to-change-permissions'. To change a single 52;; variable `wdired-allow-to-change-permissions'. To change a single
53;; char (toggling between its two more usual values) you can press 53;; char (toggling between its two more usual values) you can press
54;; the space bar over it or left-click the mouse. To set any char to 54;; the space bar over it or left-click the mouse. To set any char to
55;; an specific value (this includes the SUID, SGID and STI bits) you 55;; an specific value (this includes the SUID, SGID and STI bits) you
56;; can use the key labeled as the letter you want. Please note that 56;; can use the key labeled as the letter you want. Please note that
57;; permissions of the links cannot be changed in that way, because 57;; permissions of the links cannot be changed in that way, because
58;; the change would affect to their targets, and this would not be 58;; the change would affect to their targets, and this would not be
59;; WYSIWYG :-). 59;; WYSIWYG :-).
60;; 60;;
61;; - To mark files for deletion, by deleting their whole filename. 61;; - To mark files for deletion, by deleting their whole filename.
62;;
63;; I do not have a URL to hang wdired, but you can use the one below
64;; to find the latest version:
65;;
66;; http://groups.google.com/groups?as_ugroup=gnu.emacs.sources&as_q=wdired
67 62
68;;; Installation: 63;;; Installation:
69 64
@@ -75,21 +70,19 @@
75;; (require 'wdired) 70;; (require 'wdired)
76;; (define-key dired-mode-map "r" 'wdired-change-to-wdired-mode) 71;; (define-key dired-mode-map "r" 'wdired-change-to-wdired-mode)
77;; 72;;
78;; This is recommended way for faster emacs startup time and lower 73;; This is the recommended way for faster Emacs startup time and lower
79;; memory consumption, but remind to add these lines before dired.el 74;; memory consumption:
80;; gets loaded (i.e., near the beginning of your .emacs file):
81;; 75;;
82;; (autoload 'wdired-change-to-wdired-mode "wdired") 76;; (autoload 'wdired-change-to-wdired-mode "wdired")
83;; (add-hook 'dired-load-hook 77;; (eval-after-load "dired"
84;; '(lambda () 78;; '(lambda ()
85;; (define-key dired-mode-map "r" 'wdired-change-to-wdired-mode) 79;; (define-key dired-mode-map "r" 'wdired-change-to-wdired-mode)
86;; (define-key dired-mode-map 80;; (define-key dired-mode-map
87;; [menu-bar immediate wdired-change-to-wdired-mode] 81;; [menu-bar immediate wdired-change-to-wdired-mode]
88;; '("Edit File Names" . wdired-change-to-wdired-mode)))) 82;; '("Edit File Names" . wdired-change-to-wdired-mode))))
89;; 83;;
90;; 84;; Type "M-x customize-group RET wdired" if you want to make changes
91;; Type "M-x customize-group RET wdired" if you want make changes to 85;; to the default behavior.
92;; the default behavior.
93 86
94;;; Usage: 87;;; Usage:
95 88
@@ -103,60 +96,12 @@
103 96
104;;; Change Log: 97;;; Change Log:
105 98
106;; From 1.9 to 1.91 99;; Google is your friend (previous versions with complete changelogs
107;; 100;; were posted to gnu.emacs.sources)
108;; - Fixed a bug (introduced in 1.9) so now files can be marked for
109;; deletion again, by deleting their whole filename.
110
111;; From 1.8 to 1.9
112;;
113;; - Another alternative way of editing permissions allowed, see
114;; `wdired-allow-to-change-permissions' for details.
115;;
116;; - Now wdired doesn't rely on regexp so much. As a consequence of
117;; this, you can add newlines to filenames and symlinks targets
118;; (although this is not very usual, IMHO). Please note that dired
119;; (at least in Emacs 21.1 and previous) does not work very well
120;; with filenames with newlines in them, so RET is deactivated in
121;; wdired mode. But you can activate it if you want.
122;;
123;; - Now `upcase-word' `capitalize-word' and `downcase-word' are not
124;; advised to work better with wdired mode, but the keys bound to
125;; them use wdired versions of those commands.
126;;
127;; - Now "undo" actions are not inherited from wdired mode when
128;; changing to dired mode.
129;;
130;; - Code and documentation cleanups.
131;;
132;; - Fixed a bug that was making wdired to fail on users with
133;; `dired-backup-overwrite' set to t.
134;;
135;; - C-c C-[ now abort changes.
136
137;; From 1.7 to 1.8
138;;
139;; - Now permission (access-control) bits of the files can be changed.
140;; Please see the commentary section and the custom variable
141;; `wdired-allow-to-change-permissions' for details.
142;;
143;; - Added another possible value for the variable
144;; `wdired-always-move-to-filename-beginning', useful to change
145;; permission bits of several files without the cursor jumping to
146;; filenames when changing lines.
147
148;; From 0.1 to 1.7
149
150;; - I've moved the list of changes to another file, because it was
151;; huge. Ask me for it or search older versions in google.
152
153;;; TODO:
154
155;; - Make it to work in XEmacs. Any volunteer?
156 101
157;;; Code: 102;;; Code:
158 103
159(defvar dired-backup-overwrite) ; Only in emacs 20.x this is a custom var 104(defvar dired-backup-overwrite) ; Only in Emacs 20.x this is a custom var
160(eval-when-compile 105(eval-when-compile
161 (set (make-local-variable 'byte-compile-dynamic) t)) 106 (set (make-local-variable 'byte-compile-dynamic) t))
162 107
@@ -170,22 +115,22 @@
170 :group 'dired) 115 :group 'dired)
171 116
172(defcustom wdired-use-interactive-rename nil 117(defcustom wdired-use-interactive-rename nil
173 "*If t, confirmation is required before actually rename the files. 118 "*If non-nil, WDired requires confirmation before actually renaming files.
174Confirmation is required also for overwriting files. If nil, no 119If nil, WDired doesn't require confirmation to change the file names,
175confirmation is required for change the file names, and the variable 120and the variable `wdired-confirm-overwrite' controls whether it is ok
176`wdired-is-ok-overwrite' is used to see if it is ok to overwrite files 121to overwrite files without asking."
177without asking."
178 :type 'boolean 122 :type 'boolean
179 :group 'wdired) 123 :group 'wdired)
180 124
181(defcustom wdired-is-ok-overwrite nil 125(defcustom wdired-confirm-overwrite t
182 "*If non-nil the renames can overwrite files without asking. 126 "*If nil the renames can overwrite files without asking.
183This variable is used only if `wdired-use-interactive-rename' is nil." 127This variable has no effect at all if `wdired-use-interactive-rename'
128is not nil."
184 :type 'boolean 129 :type 'boolean
185 :group 'wdired) 130 :group 'wdired)
186 131
187(defcustom wdired-always-move-to-filename-beginning nil 132(defcustom wdired-use-dired-vertical-movement nil
188 "*If t the \"up\" and \"down\" movement is done as in dired mode. 133 "*If t, the \"up\" and \"down\" movement works as in Dired mode.
189That is, always move the point to the beginning of the filename at line. 134That is, always move the point to the beginning of the filename at line.
190 135
191If `sometimes, only move to the beginning of filename if the point is 136If `sometimes, only move to the beginning of filename if the point is
@@ -199,20 +144,20 @@ If nil, \"up\" and \"down\" movement is done as in any other buffer."
199 :group 'wdired) 144 :group 'wdired)
200 145
201(defcustom wdired-allow-to-redirect-links t 146(defcustom wdired-allow-to-redirect-links t
202 "*If non-nil, the target of the symbolic links can be changed also. 147 "*If non-nil, the target of the symbolic links are editable.
203In systems without symbolic links support, this variable has no effect 148In systems without symbolic links support, this variable has no effect
204at all." 149at all."
205 :type 'boolean 150 :type 'boolean
206 :group 'wdired) 151 :group 'wdired)
207 152
208(defcustom wdired-allow-to-change-permissions nil 153(defcustom wdired-allow-to-change-permissions nil
209 "*If non-nil, the permissions bits of the files can be changed also. 154 "*If non-nil, the permissions bits of the files are editable.
210 155
211If t, to change a single bit, put the cursor over it and press the 156If t, to change a single bit, put the cursor over it and press the
212space bar, or left click over it. You can also hit the letter you want 157space bar, or left click over it. You can also hit the letter you want
213to set: if this value is allowed, the character in the buffer will be 158to set: if this value is allowed, the character in the buffer will be
214changed. Anyway, the point is advanced one position, so, for example, 159changed. Anyway, the point is advanced one position, so, for example,
215you can keep the \"x\" key pressed to give execution permissions to 160you can keep the <x> key pressed to give execution permissions to
216everybody to that file. 161everybody to that file.
217 162
218If `advanced, the bits are freely editable. You can use 163If `advanced, the bits are freely editable. You can use
@@ -220,7 +165,7 @@ If `advanced, the bits are freely editable. You can use
220newlines), but if you want your changes to be useful, you better put a 165newlines), but if you want your changes to be useful, you better put a
221intelligible value. 166intelligible value.
222 167
223Anyway, the real change of the permissions is done with the external 168Anyway, the real change of the permissions is done by the external
224program `dired-chmod-program', which must exist." 169program `dired-chmod-program', which must exist."
225 :type '(choice (const :tag "Not allowed" nil) 170 :type '(choice (const :tag "Not allowed" nil)
226 (const :tag "Toggle/set bits" t) 171 (const :tag "Toggle/set bits" t)
@@ -233,9 +178,9 @@ program `dired-chmod-program', which must exist."
233 (define-key map "\C-c\C-c" 'wdired-finish-edit) 178 (define-key map "\C-c\C-c" 'wdired-finish-edit)
234 (define-key map "\C-c\C-k" 'wdired-abort-changes) 179 (define-key map "\C-c\C-k" 'wdired-abort-changes)
235 (define-key map "\C-c\C-[" 'wdired-abort-changes) 180 (define-key map "\C-c\C-[" 'wdired-abort-changes)
236 (define-key map "\C-m" 'wdired-newline) 181 (define-key map "\C-m" 'ignore)
237 (define-key map "\C-j" 'wdired-newline) 182 (define-key map "\C-j" 'ignore)
238 (define-key map "\C-o" 'wdired-newline) 183 (define-key map "\C-o" 'ignore)
239 (define-key map [up] 'wdired-previous-line) 184 (define-key map [up] 'wdired-previous-line)
240 (define-key map "\C-p" 'wdired-previous-line) 185 (define-key map "\C-p" 'wdired-previous-line)
241 (define-key map [down] 'wdired-next-line) 186 (define-key map [down] 'wdired-next-line)
@@ -261,7 +206,7 @@ program `dired-chmod-program', which must exist."
261 map)) 206 map))
262 207
263(defvar wdired-mode-hook nil 208(defvar wdired-mode-hook nil
264 "Hook run when changing to wdired mode.") 209 "Hooks run when changing to WDired mode.")
265 210
266;; Local variables (put here to avoid compilation gripes) 211;; Local variables (put here to avoid compilation gripes)
267(defvar wdired-col-perm) ;; Column where the permission bits start 212(defvar wdired-col-perm) ;; Column where the permission bits start
@@ -271,15 +216,15 @@ program `dired-chmod-program', which must exist."
271(defun wdired-mode () 216(defun wdired-mode ()
272 "\\<wdired-mode-map>File Names Editing mode. 217 "\\<wdired-mode-map>File Names Editing mode.
273 218
274Press \\[wdired-finish-edit] to make the changes to take effect and 219Press \\[wdired-finish-edit] to make the changes to take effect
275exit. To abort the edit, use \\[wdired-abort-changes]. 220and exit. To abort the edit, use \\[wdired-abort-changes].
276 221
277In this mode you can edit the names of the files, the target of the 222In this mode you can edit the names of the files, the target of
278links and the permission bits of the files. You can `customize-group' 223the links and the permission bits of the files. You can use
279wdired. 224\\[customize-group] RET wdired to customize WDired behavior.
280 225
281Editing things out of the filenames, or adding or deleting lines is 226The only editable texts in a WDired buffer are filenames,
282not allowed, because the rest of the buffer is read-only." 227symbolic link targets, and filenames permission."
283 (interactive) 228 (interactive)
284 (error "This mode can be enabled only by `wdired-change-to-wdired-mode'")) 229 (error "This mode can be enabled only by `wdired-change-to-wdired-mode'"))
285(put 'wdired-mode 'mode-class 'special) 230(put 'wdired-mode 'mode-class 'special)
@@ -288,8 +233,10 @@ not allowed, because the rest of the buffer is read-only."
288;;;###autoload 233;;;###autoload
289(defun wdired-change-to-wdired-mode () 234(defun wdired-change-to-wdired-mode ()
290 "Put a dired buffer in a mode in which filenames are editable. 235 "Put a dired buffer in a mode in which filenames are editable.
291In this mode the names of the files can be changed, and after 236\\<wdired-mode-map>
292typing C-c C-c the files and directories in disk are renamed. 237This mode allows the user to change the names of the files, and after
238typing \\[wdired-finish-edit] Emacs renames the files and directories
239in disk.
293 240
294See `wdired-mode'." 241See `wdired-mode'."
295 (interactive) 242 (interactive)
@@ -302,7 +249,7 @@ See `wdired-mode'."
302 (dired-unadvertise default-directory) 249 (dired-unadvertise default-directory)
303 (add-hook 'kill-buffer-hook 'wdired-check-kill-buffer nil t) 250 (add-hook 'kill-buffer-hook 'wdired-check-kill-buffer nil t)
304 (setq major-mode 'wdired-mode) 251 (setq major-mode 'wdired-mode)
305 (setq mode-name "Edit filenames") 252 (setq mode-name "Editable Dired")
306 (setq revert-buffer-function 'wdired-revert) 253 (setq revert-buffer-function 'wdired-revert)
307 ;; I temp disable undo for performance: since I'm going to clear the 254 ;; I temp disable undo for performance: since I'm going to clear the
308 ;; undo list, it can save more than a 9% of time with big 255 ;; undo list, it can save more than a 9% of time with big
@@ -359,7 +306,7 @@ or \\[wdired-abort-changes] to abort changes")))
359(defun wdired-get-filename (&optional no-dir old) 306(defun wdired-get-filename (&optional no-dir old)
360 "Return the filename at line. 307 "Return the filename at line.
361Similar to `dired-get-filename' but it doesn't rely on regexps. It 308Similar to `dired-get-filename' but it doesn't rely on regexps. It
362relies on wdired buffer's properties. Optional arg NO-DIR with value 309relies on WDired buffer's properties. Optional arg NO-DIR with value
363non-nil means don't include directory. Optional arg OLD with value 310non-nil means don't include directory. Optional arg OLD with value
364non-nil means return old filename." 311non-nil means return old filename."
365 ;; FIXME: Use dired-get-filename's new properties. 312 ;; FIXME: Use dired-get-filename's new properties.
@@ -411,7 +358,7 @@ non-nil means return old filename."
411 "Actually rename files based on your editing in the Dired buffer." 358 "Actually rename files based on your editing in the Dired buffer."
412 (interactive) 359 (interactive)
413 (wdired-change-to-dired-mode) 360 (wdired-change-to-dired-mode)
414 (let ((overwrite (or wdired-is-ok-overwrite 1)) 361 (let ((overwrite (or (not wdired-confirm-overwrite) 1))
415 (changes nil) 362 (changes nil)
416 (files-deleted nil) 363 (files-deleted nil)
417 (errors 0) 364 (errors 0)
@@ -510,12 +457,13 @@ non-nil means return old filename."
510 (forward-line))))) 457 (forward-line)))))
511 458
512(defun wdired-customize () 459(defun wdired-customize ()
513 "Customize wdired options." 460 "Customize WDired options."
514 (interactive) 461 (interactive)
515 (customize-apropos "wdired" 'groups)) 462 (customize-apropos "wdired" 'groups))
516 463
517(defun wdired-revert (&optional arg noconfirm) 464(defun wdired-revert (&optional arg noconfirm)
518 "Discard changes in the buffer and update the changes in the disk." 465 "Discard changes in the buffer and update it based on changes on disk.
466Optional arguments are ignored."
519 (wdired-change-to-dired-mode) 467 (wdired-change-to-dired-mode)
520 (revert-buffer) 468 (revert-buffer)
521 (wdired-change-to-wdired-mode)) 469 (wdired-change-to-wdired-mode))
@@ -529,12 +477,12 @@ non-nil means return old filename."
529 477
530(defun wdired-next-line (arg) 478(defun wdired-next-line (arg)
531 "Move down lines then position at filename or the current column. 479 "Move down lines then position at filename or the current column.
532See `wdired-always-move-to-filename-beginning'. Optional prefix ARG 480See `wdired-use-dired-vertical-movement'. Optional prefix ARG
533says how many lines to move; default is one line." 481says how many lines to move; default is one line."
534 (interactive "p") 482 (interactive "p")
535 (next-line arg) 483 (next-line arg)
536 (if (or (eq wdired-always-move-to-filename-beginning t) 484 (if (or (eq wdired-use-dired-vertical-movement t)
537 (and wdired-always-move-to-filename-beginning 485 (and wdired-use-dired-vertical-movement
538 (< (current-column) 486 (< (current-column)
539 (save-excursion (dired-move-to-filename) 487 (save-excursion (dired-move-to-filename)
540 (current-column))))) 488 (current-column)))))
@@ -542,22 +490,17 @@ says how many lines to move; default is one line."
542 490
543(defun wdired-previous-line (arg) 491(defun wdired-previous-line (arg)
544 "Move up lines then position at filename or the current column. 492 "Move up lines then position at filename or the current column.
545See `wdired-always-move-to-filename-beginning'. Optional prefix ARG 493See `wdired-use-dired-vertical-movement'. Optional prefix ARG
546says how many lines to move; default is one line." 494says how many lines to move; default is one line."
547 (interactive "p") 495 (interactive "p")
548 (previous-line arg) 496 (previous-line arg)
549 (if (or (eq wdired-always-move-to-filename-beginning t) 497 (if (or (eq wdired-use-dired-vertical-movement t)
550 (and wdired-always-move-to-filename-beginning 498 (and wdired-use-dired-vertical-movement
551 (< (current-column) 499 (< (current-column)
552 (save-excursion (dired-move-to-filename) 500 (save-excursion (dired-move-to-filename)
553 (current-column))))) 501 (current-column)))))
554 (dired-move-to-filename))) 502 (dired-move-to-filename)))
555 503
556;; dired doesn't works well with newlines, so ...
557(defun wdired-newline ()
558 "Do nothing."
559 (interactive))
560
561;; Put the needed properties to allow the user to change links' targets 504;; Put the needed properties to allow the user to change links' targets
562(defun wdired-preprocess-symlinks () 505(defun wdired-preprocess-symlinks ()
563 (let ((inhibit-read-only t)) 506 (let ((inhibit-read-only t))
@@ -634,19 +577,19 @@ If OLD, return the old target. If MOVE, move point before it."
634 (setq arg 0)))))))) 577 (setq arg 0))))))))
635 578
636(defun wdired-downcase-word (arg) 579(defun wdired-downcase-word (arg)
637 "Wdired version of `downcase-word'. 580 "WDired version of `downcase-word'.
638Like original function but it skips read-only words." 581Like original function but it skips read-only words."
639 (interactive "p") 582 (interactive "p")
640 (wdired-xcase-word 'downcase-word arg)) 583 (wdired-xcase-word 'downcase-word arg))
641 584
642(defun wdired-upcase-word (arg) 585(defun wdired-upcase-word (arg)
643 "Wdired version of `upcase-word'. 586 "WDired version of `upcase-word'.
644Like original function but it skips read-only words." 587Like original function but it skips read-only words."
645 (interactive "p") 588 (interactive "p")
646 (wdired-xcase-word 'upcase-word arg)) 589 (wdired-xcase-word 'upcase-word arg))
647 590
648(defun wdired-capitalize-word (arg) 591(defun wdired-capitalize-word (arg)
649 "Wdired version of `capitalize-word'. 592 "WDired version of `capitalize-word'.
650Like original function but it skips read-only words." 593Like original function but it skips read-only words."
651 (interactive "p") 594 (interactive "p")
652 (wdired-xcase-word 'capitalize-word arg)) 595 (wdired-xcase-word 'capitalize-word arg))
diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 4406a0615ee..c0d9280a441 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -86,7 +86,7 @@
86 86
87;;; Code: 87;;; Code:
88 88
89(defvar whitespace-version "3.4" "Version of the whitespace library.") 89(defvar whitespace-version "3.5" "Version of the whitespace library.")
90 90
91(defvar whitespace-all-buffer-files nil 91(defvar whitespace-all-buffer-files nil
92 "An associated list of buffers and files checked for whitespace cleanliness. 92 "An associated list of buffers and files checked for whitespace cleanliness.
@@ -599,7 +599,7 @@ whitespace problems."
599 (setq pmax (point)) 599 (setq pmax (point))
600 (if (equal pmin pmax) 600 (if (equal pmin pmax)
601 (progn 601 (progn
602 (whitespace-highlight-the-space pmin pmax) 602 (whitespace-highlight-the-space pmin (1+ pmax))
603 t) 603 t)
604 nil)))) 604 nil))))
605 605
@@ -637,7 +637,7 @@ whitespace problems."
637 (setq pmax (point)) 637 (setq pmax (point))
638 (if (equal pmin pmax) 638 (if (equal pmin pmax)
639 (progn 639 (progn
640 (whitespace-highlight-the-space pmin pmax) 640 (whitespace-highlight-the-space (- pmin 1) pmax)
641 t) 641 t)
642 nil)) 642 nil))
643 nil)))) 643 nil))))
@@ -733,12 +733,11 @@ Also with whitespaces whose testing has been turned off."
733 "Highlight the current line, unhighlighting a previously jumped to line." 733 "Highlight the current line, unhighlighting a previously jumped to line."
734 (if whitespace-display-spaces-in-color 734 (if whitespace-display-spaces-in-color
735 (let ((ol (whitespace-make-overlay b e))) 735 (let ((ol (whitespace-make-overlay b e)))
736 (whitespace-unhighlight-the-space)
737 (push ol whitespace-highlighted-space) 736 (push ol whitespace-highlighted-space)
738 (whitespace-overlay-put ol 'face 'whitespace-highlight-face)))) 737 (whitespace-overlay-put ol 'face 'whitespace-highlight-face))))
739;; (add-hook 'pre-command-hook 'whitespace-unhighlight-the-space)) 738;; (add-hook 'pre-command-hook 'whitespace-unhighlight-the-space))
740 739
741(defun whitespace-unhighlight-the-space () 740(defun whitespace-unhighlight-the-space()
742 "Unhighlight the currently highlight line." 741 "Unhighlight the currently highlight line."
743 (if (and whitespace-display-spaces-in-color whitespace-highlighted-space) 742 (if (and whitespace-display-spaces-in-color whitespace-highlighted-space)
744 (progn 743 (progn
diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el
index da74a987def..78d0e51ef88 100644
--- a/lisp/x-dnd.el
+++ b/lisp/x-dnd.el
@@ -31,9 +31,9 @@
31 31
32;;; Code: 32;;; Code:
33 33
34;;; Customizable variables 34(require 'dnd)
35
36 35
36;;; Customizable variables
37(defcustom x-dnd-test-function 'x-dnd-default-test-function 37(defcustom x-dnd-test-function 'x-dnd-default-test-function
38 "The function drag and drop uses to determine if to accept or reject a drop. 38 "The function drag and drop uses to determine if to accept or reject a drop.
39The function takes three arguments, WINDOW ACTION and TYPES. 39The function takes three arguments, WINDOW ACTION and TYPES.
@@ -51,28 +51,6 @@ The default value for this variable is `x-dnd-default-test-function'."
51 :type 'symbol 51 :type 'symbol
52 :group 'x) 52 :group 'x)
53 53
54(defcustom x-dnd-protocol-alist
55 '(
56 ("^file:///" . x-dnd-open-local-file) ; XDND format.
57 ("^file://" . x-dnd-open-file) ; URL with host
58 ("^file:" . x-dnd-open-local-file) ; Old KDE, Motif, Sun
59 )
60
61 "The functions to call for different protocols when a drop is made.
62This variable is used by `x-dnd-handle-uri-list', `x-dnd-handle-file-name'
63and `x-dnd-handle-moz-url'. The list contains of (REGEXP . FUNCTION) pairs.
64The functions shall take two arguments, URL, which is the URL dropped and
65ACTION which is the action to be performed for the drop (move, copy, link,
66private or ask).
67If no match is found here, and the value of `browse-url-browser-function'
68is a pair of (REGEXP . FUNCTION), those regexps are tried for a match.
69Insertion of text is not handeled by these functions, see `x-dnd-types-alist'
70for that.
71The function shall return the action done (move, copy, link or private)
72if some action was made, or nil if the URL is ignored."
73 :version "22.1"
74 :type 'alist
75 :group 'x)
76 54
77 55
78(defcustom x-dnd-types-alist 56(defcustom x-dnd-types-alist
@@ -85,10 +63,10 @@ if some action was made, or nil if the URL is ignored."
85 ("text/plain;charset=UTF-8" . x-dnd-insert-utf8-text) 63 ("text/plain;charset=UTF-8" . x-dnd-insert-utf8-text)
86 ("text/plain;charset=utf-8" . x-dnd-insert-utf8-text) 64 ("text/plain;charset=utf-8" . x-dnd-insert-utf8-text)
87 ("text/unicode" . x-dnd-insert-utf16-text) 65 ("text/unicode" . x-dnd-insert-utf16-text)
88 ("text/plain" . x-dnd-insert-text) 66 ("text/plain" . dnd-insert-text)
89 ("COMPOUND_TEXT" . x-dnd-insert-ctext) 67 ("COMPOUND_TEXT" . x-dnd-insert-ctext)
90 ("STRING" . x-dnd-insert-text) 68 ("STRING" . dnd-insert-text)
91 ("TEXT" . x-dnd-insert-text) 69 ("TEXT" . dnd-insert-text)
92 ) 70 )
93 "Which function to call to handle a drop of that type. 71 "Which function to call to handle a drop of that type.
94If the type for the drop is not present, or the function is nil, 72If the type for the drop is not present, or the function is nil,
@@ -102,12 +80,6 @@ is successful, nil if not."
102 :type 'alist 80 :type 'alist
103 :group 'x) 81 :group 'x)
104 82
105(defcustom x-dnd-open-file-other-window nil
106 "If non-nil, always use find-file-other-window to open dropped files."
107 :version "22.1"
108 :type 'boolean
109 :group 'x)
110
111(defcustom x-dnd-known-types 83(defcustom x-dnd-known-types
112 '("text/uri-list" 84 '("text/uri-list"
113 "text/x-moz-url" 85 "text/x-moz-url"
@@ -236,109 +208,6 @@ EXTRA-DATA is data needed for a specific protocol."
236 (setcdr (x-dnd-get-state-cons-for-frame window) current-state))) 208 (setcdr (x-dnd-get-state-cons-for-frame window) current-state)))
237 209
238 210
239(defun x-dnd-handle-one-url (window action arg)
240 "Handle one dropped url by calling the appropriate handler.
241The handler is first localted by looking at `x-dnd-protocol-alist'.
242If no match is found here, and the value of `browse-url-browser-function'
243is a pair of (REGEXP . FUNCTION), those regexps are tried for a match.
244If no match is found, just call `x-dnd-insert-text'.
245WINDOW is where the drop happend, ACTION is the action for the drop,
246ARG is the URL that has been dropped.
247Returns ACTION."
248 (require 'browse-url)
249 (let* ((uri (replace-regexp-in-string
250 "%[A-Z0-9][A-Z0-9]"
251 (lambda (arg)
252 (format "%c" (string-to-number (substring arg 1) 16)))
253 arg))
254 ret)
255 (or
256 (catch 'done
257 (dolist (bf x-dnd-protocol-alist)
258 (when (string-match (car bf) uri)
259 (setq ret (funcall (cdr bf) uri action))
260 (throw 'done t)))
261 nil)
262 (when (not (functionp browse-url-browser-function))
263 (catch 'done
264 (dolist (bf browse-url-browser-function)
265 (when (string-match (car bf) uri)
266 (setq ret 'private)
267 (funcall (cdr bf) uri action)
268 (throw 'done t)))
269 nil))
270 (progn
271 (x-dnd-insert-text window action uri)
272 (setq ret 'private)))
273 ret))
274
275
276(defun x-dnd-get-local-file-uri (uri)
277 "Return an uri converted to file:/// syntax if uri is a local file.
278Return nil if URI is not a local file."
279
280 ;; The hostname may be our hostname, in that case, convert to a local
281 ;; file. Otherwise return nil. TODO: How about an IP-address as hostname?
282 (let ((hostname (when (string-match "^file://\\([^/]*\\)" uri)
283 (downcase (match-string 1 uri))))
284 (system-name-no-dot
285 (downcase (if (string-match "^[^\\.]+" system-name)
286 (match-string 0 system-name)
287 system-name))))
288 (when (and hostname
289 (or (string-equal "localhost" hostname)
290 (string-equal (downcase system-name) hostname)
291 (string-equal system-name-no-dot hostname)))
292 (concat "file://" (substring uri (+ 7 (length hostname)))))))
293
294(defun x-dnd-get-local-file-name (uri &optional must-exist)
295 "Return file name converted from file:/// or file: syntax.
296URI is the uri for the file. If MUST-EXIST is given and non-nil,
297only return non-nil if the file exists.
298Return nil if URI is not a local file."
299 (let ((f (cond ((string-match "^file:///" uri) ; XDND format.
300 (substring uri (1- (match-end 0))))
301 ((string-match "^file:" uri) ; Old KDE, Motif, Sun
302 (substring uri (match-end 0))))))
303 (when (and f must-exist)
304 (let* ((decoded-f (decode-coding-string
305 f
306 (or file-name-coding-system
307 default-file-name-coding-system)))
308 (try-f (if (file-readable-p decoded-f) decoded-f f)))
309 (when (file-readable-p try-f) try-f)))))
310
311
312(defun x-dnd-open-local-file (uri action)
313 "Open a local file.
314The file is opened in the current window, or a new window if
315`x-dnd-open-file-other-window' is set. URI is the url for the file,
316and must have the format file:file-name or file:///file-name.
317The last / in file:/// is part of the file name. ACTION is ignored."
318
319 (let* ((f (x-dnd-get-local-file-name uri t)))
320 (if (and f (file-readable-p f))
321 (progn
322 (if x-dnd-open-file-other-window
323 (find-file-other-window f)
324 (find-file f))
325 'private)
326 (error "Can not read %s" uri))))
327
328(defun x-dnd-open-file (uri action)
329 "Open a local or remote file.
330The file is opened in the current window, or a new window if
331`x-dnd-open-file-other-window' is set. URI is the url for the file,
332and must have the format file://hostname/file-name. ACTION is ignored.
333The last / in file://hostname/ is part of the file name."
334
335 ;; The hostname may be our hostname, in that case, convert to a local
336 ;; file. Otherwise return nil.
337 (let ((local-file (x-dnd-get-local-file-uri uri)))
338 (if local-file (x-dnd-open-local-file local-file action)
339 (error "Remote files not supported"))))
340
341
342(defun x-dnd-handle-moz-url (window action data) 211(defun x-dnd-handle-moz-url (window action data)
343 "Handle one item of type text/x-moz-url. 212 "Handle one item of type text/x-moz-url.
344WINDOW is the window where the drop happened. ACTION is ignored. 213WINDOW is the window where the drop happened. ACTION is ignored.
@@ -360,49 +229,36 @@ DATA is encoded in utf-16. Decode the URL and call `x-dnd-handle-uri-list'."
360(defun x-dnd-insert-utf8-text (window action text) 229(defun x-dnd-insert-utf8-text (window action text)
361 "Decode the UTF-8 text and insert it at point. 230 "Decode the UTF-8 text and insert it at point.
362TEXT is the text as a string, WINDOW is the window where the drop happened." 231TEXT is the text as a string, WINDOW is the window where the drop happened."
363 (x-dnd-insert-text window action (decode-coding-string text 'utf-8))) 232 (dnd-insert-text window action (decode-coding-string text 'utf-8)))
364 233
365(defun x-dnd-insert-utf16-text (window action text) 234(defun x-dnd-insert-utf16-text (window action text)
366 "Decode the UTF-16 text and insert it at point. 235 "Decode the UTF-16 text and insert it at point.
367TEXT is the text as a string, WINDOW is the window where the drop happened." 236TEXT is the text as a string, WINDOW is the window where the drop happened."
368 ;; See comment in x-dnd-handle-moz-url about coding. 237 ;; See comment in x-dnd-handle-moz-url about coding.
369 (let ((coding (if (eq (byteorder) ?B) 'utf-16be 'utf-16le))) 238 (let ((coding (if (eq (byteorder) ?B) 'utf-16be 'utf-16le)))
370 (x-dnd-insert-text window action (decode-coding-string text coding)))) 239 (dnd-insert-text window action (decode-coding-string text coding))))
371 240
372(defun x-dnd-insert-ctext (window action text) 241(defun x-dnd-insert-ctext (window action text)
373 "Decode the compound text and insert it at point. 242 "Decode the compound text and insert it at point.
374TEXT is the text as a string, WINDOW is the window where the drop happened." 243TEXT is the text as a string, WINDOW is the window where the drop happened."
375 (x-dnd-insert-text window action 244 (dnd-insert-text window action
376 (decode-coding-string text 245 (decode-coding-string text
377 'compound-text-with-extensions))) 246 'compound-text-with-extensions)))
378
379(defun x-dnd-insert-text (window action text)
380 "Insert text at point or push to the kill ring if buffer is read only.
381TEXT is the text as a string, WINDOW is the window where the drop happened."
382 (if (or buffer-read-only
383 (not (windowp window)))
384 (progn
385 (kill-new text)
386 (message
387 (substitute-command-keys
388 "The dropped text can be accessed with \\[yank]")))
389 (insert text))
390 action)
391 247
392(defun x-dnd-handle-uri-list (window action string) 248(defun x-dnd-handle-uri-list (window action string)
393 "Split an uri-list into separate URIs and call `x-dnd-handle-one-url'. 249 "Split an uri-list into separate URIs and call `dnd-handle-one-url'.
394WINDOW is the window where the drop happened. 250WINDOW is the window where the drop happened.
395STRING is the uri-list as a string. The URIs are separated by \r\n." 251STRING is the uri-list as a string. The URIs are separated by \r\n."
396 (let ((uri-list (split-string string "[\0\r\n]" t)) 252 (let ((uri-list (split-string string "[\0\r\n]" t))
397 retval) 253 retval)
398 (dolist (bf uri-list) 254 (dolist (bf uri-list)
399 ;; If one URL is handeled, treat as if the whole drop succeeded. 255 ;; If one URL is handeled, treat as if the whole drop succeeded.
400 (let ((did-action (x-dnd-handle-one-url window action bf))) 256 (let ((did-action (dnd-handle-one-url window action bf)))
401 (when did-action (setq retval did-action)))) 257 (when did-action (setq retval did-action))))
402 retval)) 258 retval))
403 259
404(defun x-dnd-handle-file-name (window action string) 260(defun x-dnd-handle-file-name (window action string)
405 "Prepend file:// to file names and call `x-dnd-handle-one-url'. 261 "Prepend file:// to file names and call `dnd-handle-one-url'.
406WINDOW is the window where the drop happened. 262WINDOW is the window where the drop happened.
407STRING is the file names as a string, separated by nulls." 263STRING is the file names as a string, separated by nulls."
408 (let ((uri-list (split-string string "[\0\r\n]" t)) 264 (let ((uri-list (split-string string "[\0\r\n]" t))
@@ -410,7 +266,7 @@ STRING is the file names as a string, separated by nulls."
410 (dolist (bf uri-list) 266 (dolist (bf uri-list)
411 ;; If one URL is handeled, treat as if the whole drop succeeded. 267 ;; If one URL is handeled, treat as if the whole drop succeeded.
412 (let* ((file-uri (concat "file://" bf)) 268 (let* ((file-uri (concat "file://" bf))
413 (did-action (x-dnd-handle-one-url window action file-uri))) 269 (did-action (dnd-handle-one-url window action file-uri)))
414 (when did-action (setq retval did-action)))) 270 (when did-action (setq retval did-action))))
415 retval)) 271 retval))
416 272
@@ -456,10 +312,10 @@ nil if not."
456 (if (and (windowp w) (window-live-p w)) 312 (if (and (windowp w) (window-live-p w))
457 ;; If dropping in a window, open files in that window rather 313 ;; If dropping in a window, open files in that window rather
458 ;; than in a new widow. 314 ;; than in a new widow.
459 (let ((x-dnd-open-file-other-window nil)) 315 (let ((dnd-open-file-other-window nil))
460 (goto-char (posn-point (event-start event))) 316 (goto-char (posn-point (event-start event)))
461 (funcall handler window action data)) 317 (funcall handler window action data))
462 (let ((x-dnd-open-file-other-window t)) ;; Dropping on non-window. 318 (let ((dnd-open-file-other-window t)) ;; Dropping on non-window.
463 (select-frame frame) 319 (select-frame frame)
464 (funcall handler window action data)))))) 320 (funcall handler window action data))))))
465 321
@@ -881,7 +737,6 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent."
881 737
882;;; 738;;;
883 739
884
885(provide 'x-dnd) 740(provide 'x-dnd)
886 741
887;;; arch-tag: b621fb7e-50da-4323-850b-5fc71ae64621 742;;; arch-tag: b621fb7e-50da-4323-850b-5fc71ae64621
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index 4f7e19623fe..797893c8f2b 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -156,10 +156,12 @@
156With prefix arg, turn XTerm mouse mode on iff arg is positive. 156With prefix arg, turn XTerm mouse mode on iff arg is positive.
157 157
158Turn it on to use Emacs mouse commands, and off to use xterm mouse commands. 158Turn it on to use Emacs mouse commands, and off to use xterm mouse commands.
159This works in terminal emulators compatible with xterm. Only single clicks 159This works in terminal emulators compatible with xterm. It only
160are supported. When turned on, the normal xterm mouse functionality is still 160works for simple uses of the mouse. Basically, only non-modified
161available by holding down the SHIFT key while pressing the mouse button." 161single clicks are supported. When turned on, the normal xterm
162 nil " Mouse" nil :global t :group 'mouse 162mouse functionality for such clicks is still available by holding
163down the SHIFT key while pressing the mouse button."
164 :global t :group 'mouse
163 (if xterm-mouse-mode 165 (if xterm-mouse-mode
164 ;; Turn it on 166 ;; Turn it on
165 (unless window-system 167 (unless window-system
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 2d3bd39ccca..39bcba57c42 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,11 @@
12005-04-17 Richard M. Stallman <rms@gnu.org>
2
3 * buffers.texi (Indirect Buffers): Clarify.
4
5 * positions.texi (Positions): Clarify converting marker to integer.
6
7 * strings.texi (String Basics): Mention string-match; clarify.
8
12005-04-08 Lute Kamstra <lute@gnu.org> 92005-04-08 Lute Kamstra <lute@gnu.org>
2 10
3 * modes.texi (Search-based Fontification): Fix cross references. 11 * modes.texi (Search-based Fontification): Fix cross references.
diff --git a/lispref/buffers.texi b/lispref/buffers.texi
index e0ef75ccae8..a0769be23dd 100644
--- a/lispref/buffers.texi
+++ b/lispref/buffers.texi
@@ -1067,11 +1067,11 @@ in the other. This includes the text properties as well as the characters
1067themselves. 1067themselves.
1068 1068
1069 In all other respects, the indirect buffer and its base buffer are 1069 In all other respects, the indirect buffer and its base buffer are
1070completely separate. They have different names, different values of 1070completely separate. They have different names, independent values of
1071point, different narrowing, different markers and overlays (though 1071point, independent narrowing, independent markers and overlays (though
1072inserting or deleting text in either buffer relocates the markers and 1072inserting or deleting text in either buffer relocates the markers and
1073overlays for both), different major modes, and different buffer-local 1073overlays for both), independent major modes, and independent
1074variables. 1074buffer-local variable bindings.
1075 1075
1076 An indirect buffer cannot visit a file, but its base buffer can. If 1076 An indirect buffer cannot visit a file, but its base buffer can. If
1077you try to save the indirect buffer, that actually saves the base 1077you try to save the indirect buffer, that actually saves the base
diff --git a/lispref/positions.texi b/lispref/positions.texi
index 822238a6342..3c1e642e6b4 100644
--- a/lispref/positions.texi
+++ b/lispref/positions.texi
@@ -15,14 +15,17 @@ speak of the character before or after a given position. However, we
15often speak of the character ``at'' a position, meaning the character 15often speak of the character ``at'' a position, meaning the character
16after that position. 16after that position.
17 17
18 Positions are usually represented as integers starting from 1, but can 18 Positions are usually represented as integers starting from 1, but
19also be represented as @dfn{markers}---special objects that relocate 19can also be represented as @dfn{markers}---special objects that
20automatically when text is inserted or deleted so they stay with the 20relocate automatically when text is inserted or deleted so they stay
21surrounding characters. Functions that expect an argument to be a 21with the surrounding characters. Functions that expect an argument to
22position (an integer), but accept a marker as a substitute, normally 22be a position (an integer), but accept a marker as a substitute,
23ignore the marker buffer. Of course, markers used this way usually 23normally ignore which buffer the marker points into; they convert the
24point to a position in the buffer that the function operates on, but 24marker to an integer, and use that integer, exactly as if you had
25that is entirely the programmer's responsibility. @xref{Markers}. 25passed the integer as the argument, even if the marker points to the
26``wrong'' buffer. A marker that points nowhere cannot convert to an
27integer; using it instead of an integer causes an error.
28@xref{Markers}.
26 29
27 See also the ``field'' feature (@pxref{Fields}), which provides 30 See also the ``field'' feature (@pxref{Fields}), which provides
28functions that are used by many cursor-motion commands. 31functions that are used by many cursor-motion commands.
diff --git a/lispref/strings.texi b/lispref/strings.texi
index 30802709311..bfe0f1f7e19 100644
--- a/lispref/strings.texi
+++ b/lispref/strings.texi
@@ -74,10 +74,11 @@ a key sequence, you must use a vector instead of a string.
74and other modifiers for keyboard input characters. 74and other modifiers for keyboard input characters.
75 75
76 Strings are useful for holding regular expressions. You can also 76 Strings are useful for holding regular expressions. You can also
77match regular expressions against strings (@pxref{Regexp Search}). The 77match regular expressions against strings with @code{string-match}
78functions @code{match-string} (@pxref{Simple Match Data}) and 78(@pxref{Regexp Search}). The functions @code{match-string}
79@code{replace-match} (@pxref{Replacing Match}) are useful for 79(@pxref{Simple Match Data}) and @code{replace-match} (@pxref{Replacing
80decomposing and modifying strings based on regular expression matching. 80Match}) are useful for decomposing and modifying strings after
81matching regular expressions against them.
81 82
82 Like a buffer, a string can contain text properties for the characters 83 Like a buffer, a string can contain text properties for the characters
83in it, as well as the characters themselves. @xref{Text Properties}. 84in it, as well as the characters themselves. @xref{Text Properties}.
diff --git a/mac/ChangeLog b/mac/ChangeLog
index 9a1ded737ff..4d3dba217d3 100644
--- a/mac/ChangeLog
+++ b/mac/ChangeLog
@@ -1,3 +1,8 @@
12005-04-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * makefile.MPW (NonCarbonLibs): Add LocalesLib. Delete
4 TextEncodingConverter.
5
12005-04-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 62005-04-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 7
3 * Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings 8 * Emacs.app/Contents/Resources/English.lproj/InfoPlist.strings
diff --git a/mac/makefile.MPW b/mac/makefile.MPW
index bd7ced4a14f..5e0a6e1d890 100644
--- a/mac/makefile.MPW
+++ b/mac/makefile.MPW
@@ -146,7 +146,7 @@ NonCarbonLibs = ¶
146 "{SharedLibraries}StdCLib" ¶ 146 "{SharedLibraries}StdCLib" ¶
147 "{SharedLibraries}MathLib" ¶ 147 "{SharedLibraries}MathLib" ¶
148 "{SharedLibraries}AppleScriptLib" ¶ 148 "{SharedLibraries}AppleScriptLib" ¶
149 "{SharedLibraries}TextEncodingConverter" ¶ 149 "{SharedLibraries}LocalesLib" ¶
150 "{SharedLibraries}AppearanceLib" ¶ 150 "{SharedLibraries}AppearanceLib" ¶
151 "{SharedLibraries}QuickTimeLib" ¶ 151 "{SharedLibraries}QuickTimeLib" ¶
152 "{PPCLibraries}StdCRuntime.o" ¶ 152 "{PPCLibraries}StdCRuntime.o" ¶
diff --git a/make-dist b/make-dist
index 8cfc41ccd25..0506087c15a 100755
--- a/make-dist
+++ b/make-dist
@@ -6,7 +6,8 @@
6#### be distributed. This means that if you add a file with an odd name, 6#### be distributed. This means that if you add a file with an odd name,
7#### you should make sure that this script will include it. 7#### you should make sure that this script will include it.
8 8
9# Copyright (C) 1995, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. 9# Copyright (C) 1995, 1997, 1998, 2000, 2001, 2002, 2005
10# Free Software Foundation, Inc.
10# 11#
11# This file is part of GNU Emacs. 12# This file is part of GNU Emacs.
12# 13#
@@ -183,9 +184,9 @@ fi
183if [ $check = yes ]; 184if [ $check = yes ];
184then 185then
185 ### Check for .elc files with no corresponding .el file. 186 ### Check for .elc files with no corresponding .el file.
186 ls -1 lisp/[a-z]*.el lisp/[a-z]*/[a-z]*.el \ 187 ls -1 lisp/[a-zA-Z]*.el lisp/[a-z]*/[a-zA-Z0-9]*.el \
187 leim/[a-z]*/[a-z]*.el | sed 's/\.el$/.elc/' > /tmp/el 188 leim/[a-z]*/[a-z]*.el | sed 's/\.el$/.elc/' > /tmp/el
188 ls -1 lisp/[a-z]*.elc lisp/[a-z]*/[a-z]*.elc \ 189 ls -1 lisp/[a-zA-Z]*.elc lisp/[a-z]*/[a-zA-Z0-9]*.elc \
189 leim/[a-z]*/[a-z]*.elc > /tmp/elc 190 leim/[a-z]*/[a-z]*.elc > /tmp/elc
190 bogosities="`comm -13 /tmp/el /tmp/elc`" 191 bogosities="`comm -13 /tmp/el /tmp/elc`"
191 if [ "${bogosities}" != "" ]; then 192 if [ "${bogosities}" != "" ]; then
@@ -195,21 +196,17 @@ then
195 rm -f /tmp/el /tmp/elc 196 rm -f /tmp/el /tmp/elc
196 197
197 ### Check for .el files with no corresponding .elc file. 198 ### Check for .el files with no corresponding .elc file.
198 (cd lisp; ls -1 [a-z]*.el [a-z]*/[a-z]*.el ; \ 199 ls -1 lisp/[a-zA-Z]*.el lisp/[a-z]*/[a-zA-Z0-9]*.el \
199 cd ../leim; ls -1 [a-z]*/[a-z]*.el) > /tmp/el 200 leim/[a-z]*/[a-z]*.el > /tmp/el
200 (cd lisp; ls -1 [a-z]*.elc [a-z]*/[a-z]*.elc; \ 201 ls -1 lisp/[a-zA-Z]*.elc lisp/[a-z]*/[a-zA-Z0-9]*.elc \
201 cd ../leim; ls -1 [a-z]*/[a-z]*.elc) | sed 's/\.elc$/.el/' > /tmp/elc 202 leim/[a-z]*/[a-z]*.elc | sed 's/\.elc$/.el/' > /tmp/elc
202 losers="`comm -23 /tmp/el /tmp/elc`" 203 losers="`comm -23 /tmp/el /tmp/elc`"
203 bogosities= 204 bogosities=
204 for file in $losers; do 205 for file in $losers; do
205 file1=`echo $file | sed -e "s|.*/||"` 206 if ! grep -q "no-byte-compile: t" $file; then
206 if ! sed -n -e "/^DONTCOMPILE/,/[^\\]\$/p" lisp/Makefile.in |
207 grep -q "[ ]$file1\($\| \)"; then
208 case $file in 207 case $file in
209 site-init.el | site-load.el | site-start.el | default.el) 208 site-init.el | site-load.el | site-start.el | default.el)
210 ;; 209 ;;
211 term/*)
212 ;;
213 *) 210 *)
214 bogosities="$file $bogosities" 211 bogosities="$file $bogosities"
215 ;; 212 ;;
@@ -347,11 +344,12 @@ echo "Making links to \`lisp' and its subdirectories"
347 done 344 done
348 ## simula.el doesn't keep abbreviations in simula.defns any more. 345 ## simula.el doesn't keep abbreviations in simula.defns any more.
349 ## ln [a-zA-Z]*.defns ../${tempdir}/lisp 346 ## ln [a-zA-Z]*.defns ../${tempdir}/lisp
350 ln ChangeLog Makefile.in makefile.nt ChangeLog.? ../${tempdir}/lisp 347 ln ChangeLog ChangeLog.*[0-9] ../${tempdir}/lisp
351 ln makefile.w32-in ../${tempdir}/lisp 348 ln Makefile.in makefile.w32-in ../${tempdir}/lisp
352 test -f README && ln README ../${tempdir}/lisp 349 test -f README && ln README ../${tempdir}/lisp
353 (cd ../${tempdir}/lisp 350 (cd ../${tempdir}/lisp
354 rm -f TAGS =* 351 rm -f TAGS =*
352 rm -f ldefs-boot.el
355 rm -f site-init site-init.el site-init.elc 353 rm -f site-init site-init.el site-init.elc
356 rm -f site-load site-load.el site-load.elc 354 rm -f site-load site-load.el site-load.elc
357 rm -f site-start site-start.el site-start.elc 355 rm -f site-start site-start.el site-start.elc
@@ -387,7 +385,7 @@ echo "Making links to \`lisp' and its subdirectories"
387 385
388 if [ -f $file/ChangeLog ]; then 386 if [ -f $file/ChangeLog ]; then
389 ln $file/ChangeLog ../${tempdir}/lisp/$file 387 ln $file/ChangeLog ../${tempdir}/lisp/$file
390 for f in $file/ChangeLog.[0-9]; do 388 for f in $file/ChangeLog.*[0-9]; do
391 if [ -f $f ]; then 389 if [ -f $f ]; then
392 ln $f ../${tempdir}/lisp/$file 390 ln $f ../${tempdir}/lisp/$file
393 fi 391 fi
@@ -407,6 +405,8 @@ echo "Making links to \`leim' and its subdirectories"
407 ln ja-dic/*.el ja-dic/*.elc ../${tempdir}/leim/ja-dic 405 ln ja-dic/*.el ja-dic/*.elc ../${tempdir}/leim/ja-dic
408 ln Makefile.in ../${tempdir}/leim/Makefile.in 406 ln Makefile.in ../${tempdir}/leim/Makefile.in
409 ln leim-ext.el ../${tempdir}/leim/leim-ext.el 407 ln leim-ext.el ../${tempdir}/leim/leim-ext.el
408 ## Lisp files that start with a capital are generated from TIT
409 ## dictionaries so we don't distribute them.
410 ln quail/[a-z]*.el quail/[a-z]*.elc ../${tempdir}/leim/quail 410 ln quail/[a-z]*.el quail/[a-z]*.elc ../${tempdir}/leim/quail
411 rm -f ../${tempdir}/leim/quail/quick-b5.* 411 rm -f ../${tempdir}/leim/quail/quick-b5.*
412 rm -f ../${tempdir}/leim/quail/quick-cns.* 412 rm -f ../${tempdir}/leim/quail/quick-cns.*
diff --git a/man/ChangeLog b/man/ChangeLog
index 6db3896c457..eccaa607dbd 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,42 @@
12005-04-17 Luc Teirlinck <teirllm@auburn.edu>
2
3 * frames.texi (XTerm Mouse): Xterm Mouse mode is no longer enabled
4 by default in terminals compatible with xterm. Mention that
5 xterm-mouse-mode is a minor mode and put in pxref to Minor Modes
6 node.
7
82005-04-15 Carsten Dominik <dominik@science.uva.nl>
9
10 * org.texi: Update to version 3.06.
11
122005-04-13 Lute Kamstra <lute@gnu.org>
13
14 * cc-mode.texi: Prevent creating an unnecessary empty cc-mode.ss file.
15
162005-04-12 Luc Teirlinck <teirllm@auburn.edu>
17
18 * frames.texi (XTerm Mouse): Xterm Mouse mode is now enabled by
19 default.
20
212005-04-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
22
23 * xresources.texi (Table of Resources): Add cursorBlink.
24
252005-04-11 Luc Teirlinck <teirllm@auburn.edu>
26
27 * rmail.texi (Rmail Summary Edit): Explain numeric arguments to
28 `d', `C-d' and `u'.
29
302005-04-11 Richard M. Stallman <rms@gnu.org>
31
32 * cmdargs.texi (Initial Options): -Q is now --quick, and does less.
33 (Misc X): Add -D, --basic-display.
34
35 * maintaining.texi (Change Log): Correct the description of
36 the example.
37
38 * major.texi (Choosing Modes): Document magic-mode-alist.
39
12005-04-10 Thien-Thi Nguyen <ttn@gnu.org> 402005-04-10 Thien-Thi Nguyen <ttn@gnu.org>
2 41
3 * cl.texi (Porting Common Lisp): Fix typo. 42 * cl.texi (Porting Common Lisp): Fix typo.
@@ -53,6 +92,10 @@
53 92
54 * calendar.texi (Diary): Mention shell utility `calendar'. 93 * calendar.texi (Diary): Mention shell utility `calendar'.
55 94
952005-04-01 Richard M. Stallman <rms@gnu.org>
96
97 * cmdargs.texi (Misc X): Explain horizontal scroll bars don't exist.
98
562005-04-01 Jay Belanger <belanger@truman.edu> 992005-04-01 Jay Belanger <belanger@truman.edu>
57 100
58 * calc.texi (Troubleshooting Commands): Remove comment about 101 * calc.texi (Troubleshooting Commands): Remove comment about
@@ -878,7 +921,7 @@
878 921
8792005-01-15 Sergey Poznyakoff <gray@Mirddin.farlep.net> 9222005-01-15 Sergey Poznyakoff <gray@Mirddin.farlep.net>
880 923
881 * man/rmail.texi (Movemail): Explain differences 924 * rmail.texi (Movemail): Explain differences
882 between standard and mailutils versions of movemail. 925 between standard and mailutils versions of movemail.
883 Describe command line and configuration options introduced 926 Describe command line and configuration options introduced
884 with the latter. 927 with the latter.
diff --git a/man/cc-mode.texi b/man/cc-mode.texi
index a0016aab121..6ac86e986a9 100644
--- a/man/cc-mode.texi
+++ b/man/cc-mode.texi
@@ -55,7 +55,9 @@
55@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 55@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
56 56
57@comment Define an index for syntactic symbols. 57@comment Define an index for syntactic symbols.
58@ifnottex
58@defindex ss 59@defindex ss
60@end ifnottex
59 61
60@comment Combine key, syntactic symbol and concept indices into one. 62@comment Combine key, syntactic symbol and concept indices into one.
61@syncodeindex ss cp 63@syncodeindex ss cp
diff --git a/man/cmdargs.texi b/man/cmdargs.texi
index 8e84978c517..e47a66bcf91 100644
--- a/man/cmdargs.texi
+++ b/man/cmdargs.texi
@@ -268,12 +268,10 @@ option and @samp{-Q} are the only options that block it.
268 268
269@item -Q 269@item -Q
270@opindex -Q 270@opindex -Q
271@itemx --bare-bones 271@itemx --quick
272@opindex --bare-bones 272@opindex --quick
273Start emacs with minimum customizations and window decorations. 273Start emacs with minimum customizations. This is like using @samp{-q}
274This is like using @samp{-q} and @samp{--no-site-file}, but in 274and @samp{--no-site-file}, but also disables the startup screen.
275addition it also disables the menu-bar, the tool-bar, the scroll-bars,
276tool tips, the blinking cursor, and the fancy startup screen.
277 275
278@item --no-splash 276@item --no-splash
279@opindex --no-splash 277@opindex --no-splash
@@ -1222,6 +1220,14 @@ Specify @var{pixels} as additional space to put between lines, in pixels.
1222@opindex --no-blinking-cursor 1220@opindex --no-blinking-cursor
1223@cindex blinking cursor disable, command-line argument 1221@cindex blinking cursor disable, command-line argument
1224Disable the blinking cursor on graphical terminals. 1222Disable the blinking cursor on graphical terminals.
1223
1224@item -D
1225@opindex -D
1226@itemx --basic-display
1227@opindex --basic-display
1228Disable the menu-bar, the tool-bar, the scroll-bars, and tool tips,
1229and turn off the blinking cursor. This can be useful for making a
1230test case that simplifies debugging of display problems.
1225@end table 1231@end table
1226 1232
1227 The @samp{--xrm} option (@pxref{Resources}) specifies additional 1233 The @samp{--xrm} option (@pxref{Resources}) specifies additional
diff --git a/man/custom.texi b/man/custom.texi
index 30bac3bccf2..26c76c68562 100644
--- a/man/custom.texi
+++ b/man/custom.texi
@@ -1,5 +1,5 @@
1@c This is part of the Emacs manual. 1@c This is part of the Emacs manual.
2@c Copyright (C) 1985,86,87,93,94,95,97,2000,2001,2002,2004 2@c Copyright (C) 1985,86,87,93,94,95,97,2000,2001,2002,2004,2005
3@c Free Software Foundation, Inc. 3@c Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions. 4@c See file emacs.texi for copying conditions.
5@node Customization, Quitting, Amusements, Top 5@node Customization, Quitting, Amusements, Top
@@ -2313,8 +2313,44 @@ Enable the use of the command @code{narrow-to-region} without confirmation.
2313@example 2313@example
2314(put 'narrow-to-region 'disabled nil) 2314(put 'narrow-to-region 'disabled nil)
2315@end example 2315@end example
2316
2317@item
2318Adjusting the configuration to various contexts.
2319
2320In most of the cases, people want their Emacs to behave the same on
2321all their machines, so their configuration should be the same, no
2322matter whether it's GNU/Linux or not, under X11 or on a tty, with one
2323version of Emacs or another, ...
2324
2325What can happen, tho, is that depending on the circumstance some
2326features may or may not be available. In that case just prepend each
2327such customization with a little test that ensures that the feature
2328can be used. The best tests are usually checking that the feature is
2329available, rather than checking what kind of environment is
2330being used.
2331
2332@example
2333(if (fboundp 'blinking-cursor-mode)
2334 (blinking-cursor-mode 0))
2335@end example
2336
2337@example
2338(if (boundp 'coding-category-utf-8)
2339 (set-coding-priority '(coding-category-utf-8)))
2340@end example
2341
2342@example
2343(require 'cl) ; To define `ignore-errors'.
2344(ignore-errors (set-face-background 'region "grey75"))
2345@end example
2346
2347Note also that a @code{setq} on a variable which does not exist is
2348generally harmless, so those usually do not need to be made
2349conditional on any kind of test.
2350
2316@end itemize 2351@end itemize
2317 2352
2353
2318@node Terminal Init 2354@node Terminal Init
2319@subsection Terminal-specific Initialization 2355@subsection Terminal-specific Initialization
2320 2356
diff --git a/man/frames.texi b/man/frames.texi
index d09fdca85d7..af91cced8ce 100644
--- a/man/frames.texi
+++ b/man/frames.texi
@@ -1055,10 +1055,14 @@ when the frame is selected.
1055 1055
1056Some terminal emulators under X support mouse clicks in the terminal 1056Some terminal emulators under X support mouse clicks in the terminal
1057window. In a terminal emulator which is compatible with @code{xterm}, 1057window. In a terminal emulator which is compatible with @code{xterm},
1058you can use @kbd{M-x xterm-mouse-mode} to enable simple use of the 1058you can use @kbd{M-x xterm-mouse-mode} to give Emacs control over
1059mouse---only single clicks are supported. The normal @code{xterm} mouse 1059simple use of the mouse---basically, only non-modified single clicks
1060functionality is still available by holding down the @kbd{SHIFT} key 1060are supported. The normal @code{xterm} mouse functionality for such
1061when you press the mouse button. 1061clicks is still available by holding down the @kbd{SHIFT} key when you
1062press the mouse button.
1063
1064 Xterm Mouse mode is a global minor mode (@pxref{Minor Modes}).
1065Repeating the command turns the mode off again.
1062 1066
1063@ignore 1067@ignore
1064 arch-tag: 7dcf3a31-a43b-45d4-a900-445b10d77e49 1068 arch-tag: 7dcf3a31-a43b-45d4-a900-445b10d77e49
diff --git a/man/maintaining.texi b/man/maintaining.texi
index f8bc0de5992..347a15d3c95 100644
--- a/man/maintaining.texi
+++ b/man/maintaining.texi
@@ -58,7 +58,7 @@ date, your name, and your email address (taken from the variable
58line in the change log starts with a space or a tab. The bulk of the 58line in the change log starts with a space or a tab. The bulk of the
59entry consists of @dfn{items}, each of which starts with a line starting 59entry consists of @dfn{items}, each of which starts with a line starting
60with whitespace and a star. Here are two entries, both dated in May 60with whitespace and a star. Here are two entries, both dated in May
611993, each with two items: 611993, with two items and one item respectively.
62 62
63@iftex 63@iftex
64@medbreak 64@medbreak
@@ -79,10 +79,10 @@ with whitespace and a star. Here are two entries, both dated in May
79@end smallexample 79@end smallexample
80 80
81 One entry can describe several changes; each change should have its 81 One entry can describe several changes; each change should have its
82own item. Normally there should be a blank line between items. When 82own item, or its own line in an item. Normally there should be a
83items are related (parts of the same change, in different places), group 83blank line between items. When items are related (parts of the same
84them by leaving no blank line between them. The second entry above 84change, in different places), group them by leaving no blank line
85contains two items grouped in this way. 85between them.
86 86
87 @kbd{C-x 4 a} visits the change log file and creates a new entry 87 @kbd{C-x 4 a} visits the change log file and creates a new entry
88unless the most recent entry is for today's date and your name. It 88unless the most recent entry is for today's date and your name. It
@@ -92,8 +92,8 @@ changed.
92 92
93@vindex add-log-keep-changes-together 93@vindex add-log-keep-changes-together
94 When the variable @code{add-log-keep-changes-together} is 94 When the variable @code{add-log-keep-changes-together} is
95non-@code{nil}, @kbd{C-x 4 a} adds to any existing entry for the file 95non-@code{nil}, @kbd{C-x 4 a} adds to any existing item for the file
96rather than starting a new entry. 96rather than starting a new item.
97 97
98@vindex change-log-version-info-enabled 98@vindex change-log-version-info-enabled
99@vindex change-log-version-number-regexp-list 99@vindex change-log-version-number-regexp-list
diff --git a/man/major.texi b/man/major.texi
index fa44b873031..28f0ff0f32f 100644
--- a/man/major.texi
+++ b/man/major.texi
@@ -98,6 +98,21 @@ the element has the form @code{(@var{regexp} @var{mode-function}
98@var{mode-function}, Emacs discards the suffix that matched 98@var{mode-function}, Emacs discards the suffix that matched
99@var{regexp} and searches the list again for another match. 99@var{regexp} and searches the list again for another match.
100 100
101@vindex magic-mode-alist
102 Sometimes the major mode is determined from the way the file's text
103begins. The variable @code{magic-mode-alist} controls this. Its value
104is a list of elements of this form:
105
106@example
107(@var{regexp} . @var{mode-function})
108@end example
109
110@noindent
111This looks like an element of @code{auto-mode-alist}, but it doesn't work
112the same: this @var{regexp} is matched against the text at the start
113of the buffer, not against the file name. @code{magic-mode-alist}
114takes priority over @code{auto-mode-alist}.
115
101 You can specify the major mode to use for editing a certain file by 116 You can specify the major mode to use for editing a certain file by
102special text in the first nonblank line of the file. The 117special text in the first nonblank line of the file. The
103mode name should appear in this line both preceded and followed by 118mode name should appear in this line both preceded and followed by
diff --git a/man/org.texi b/man/org.texi
index d1a388f958a..c066a00fd15 100644
--- a/man/org.texi
+++ b/man/org.texi
@@ -3,7 +3,7 @@
3@setfilename ../info/org 3@setfilename ../info/org
4@settitle Org Mode Manual 4@settitle Org Mode Manual
5 5
6@set VERSION 3.05 6@set VERSION 3.06
7@set DATE April 2005 7@set DATE April 2005
8 8
9@dircategory Emacs 9@dircategory Emacs
@@ -92,7 +92,7 @@ Software Foundation raise funds for GNU development.''
92Introduction 92Introduction
93 93
94* Summary:: Brief summary of what Org-mode does 94* Summary:: Brief summary of what Org-mode does
95* Installation:: How to install Org-mode 95* Installation and Activation:: How to install Org-mode
96 96
97Document Structure 97Document Structure
98 98
@@ -106,8 +106,8 @@ Document Structure
106TODO items 106TODO items
107 107
108* TODO basics:: Marking and displaying TODO entries 108* TODO basics:: Marking and displaying TODO entries
109* Priorities:: Some things are more important than others
110* TODO extensions:: Workflow and assignments 109* TODO extensions:: Workflow and assignments
110* Priorities:: Some things are more important than others
111 111
112Extended use of TODO keywords 112Extended use of TODO keywords
113 113
@@ -133,8 +133,8 @@ Timestamps
133 133
134Timeline and Agenda 134Timeline and Agenda
135 135
136* Timeline (single file):: Time-sorted view for single file 136* Timeline:: Time-sorted view for single file
137* Agenda (multiple files):: Your weekly planner 137* Agenda:: Your weekly planner
138* Agenda commands:: Remote editing of org trees 138* Agenda commands:: Remote editing of org trees
139* Calendar/Diary integration:: Integrating Anniversaries and more 139* Calendar/Diary integration:: Integrating Anniversaries and more
140 140
@@ -168,10 +168,10 @@ Miscellaneous
168 168
169@menu 169@menu
170* Summary:: Brief summary of what Org-mode does 170* Summary:: Brief summary of what Org-mode does
171* Installation:: How to install Org-mode 171* Installation and Activation:: How to install Org-mode
172@end menu 172@end menu
173 173
174@node Summary, Installation, Introduction, Introduction 174@node Summary, Installation and Activation, Introduction, Introduction
175@section Summary 175@section Summary
176@cindex summary 176@cindex summary
177 177
@@ -214,8 +214,8 @@ and example files. This page is located at
214 214
215@page 215@page
216 216
217@node Installation, , Summary, Introduction 217@node Installation and Activation, , Summary, Introduction
218@section Installation 218@section Installation and Activation
219@cindex installation 219@cindex installation
220@cindex autoload 220@cindex autoload
221@cindex global keybindings 221@cindex global keybindings
@@ -236,12 +236,15 @@ define @emph{global} keys for the commands @command{org-store-link}
236and @command{org-agenda} - please choose suitable keys yourself. 236and @command{org-agenda} - please choose suitable keys yourself.
237 237
238@lisp 238@lisp
239;; These lines only if org-mode is not part of the X/Emacs distribution.
239(autoload 'org-mode "org" "Org mode" t) 240(autoload 'org-mode "org" "Org mode" t)
240(autoload 'org-diary "org" "Diary entries from Org mode") 241(autoload 'org-diary "org" "Diary entries from Org mode")
241(autoload 'org-agenda "org" "Multi-file agenda from Org mode" t) 242(autoload 'org-agenda "org" "Multi-file agenda from Org mode" t)
242(autoload 'org-store-link "org" "Store a link to the current location" t) 243(autoload 'org-store-link "org" "Store a link to the current location" t)
243(autoload 'orgtbl-mode "org" "Org tables as a minor mode" t) 244(autoload 'orgtbl-mode "org" "Org tables as a minor mode" t)
244(autoload 'turn-on-orgtbl "org" "Org tables as a minor mode") 245(autoload 'turn-on-orgtbl "org" "Org tables as a minor mode")
246
247;; The following lines are always needed. Choose your own keys.
245(add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) 248(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
246(define-key global-map "\C-cl" 'org-store-link) 249(define-key global-map "\C-cl" 'org-store-link)
247(define-key global-map "\C-ca" 'org-agenda) 250(define-key global-map "\C-ca" 'org-agenda)
@@ -257,7 +260,8 @@ MY PROJECTS -*- mode: org; -*-
257@end example 260@end example
258 261
259@noindent which will select Org-mode for this buffer no matter what 262@noindent which will select Org-mode for this buffer no matter what
260the file's name is. 263the file's name is. See also the variable
264@code{org-insert-mode-line-in-empty-file'}.
261 265
262@node Document Structure, TODO items, Introduction, Top 266@node Document Structure, TODO items, Introduction, Top
263@chapter Document Structure 267@chapter Document Structure
@@ -361,9 +365,9 @@ buffer:
361@example 365@example
362#+STARTUP: fold 366#+STARTUP: fold
363#+STARTUP: nofold 367#+STARTUP: nofold
368#+STARTUP: content
364@end example 369@end example
365 370
366
367@node Motion, Structure editing, Visibility cycling, Document Structure 371@node Motion, Structure editing, Visibility cycling, Document Structure
368@section Motion 372@section Motion
369@cindex motion, between headlines 373@cindex motion, between headlines
@@ -411,6 +415,9 @@ visible.
411@kindex M-@key{RET} 415@kindex M-@key{RET}
412@item M-@key{RET} 416@item M-@key{RET}
413Insert new heading with same level as current 417Insert new heading with same level as current
418@kindex M-S-@key{RET}
419@item M-S-@key{RET}
420Insert new TODO entry with same level as current heading.
414@kindex M-@key{left} 421@kindex M-@key{left}
415@item M-@key{left} 422@item M-@key{left}
416Promote current heading by one level 423Promote current heading by one level
@@ -437,7 +444,7 @@ Kill subtree, i.e. remove it from buffer but save in kill ring.
437Copy subtree to kill ring. 444Copy subtree to kill ring.
438@kindex C-c C-h C-y 445@kindex C-c C-h C-y
439@item C-c C-h C-y 446@item C-c C-h C-y
440Yank subtree from kill ring. This does modify the level of subtree to 447Yank subtree from kill ring. This does modify the level of the subtree to
441make sure the tree fits in nicely at the yank position. The yank 448make sure the tree fits in nicely at the yank position. The yank
442level can also be specified with a prefix arg, or by yanking after a 449level can also be specified with a prefix arg, or by yanking after a
443headline marker like @samp{****}. 450headline marker like @samp{****}.
@@ -513,11 +520,11 @@ things you have to do.
513 520
514@menu 521@menu
515* TODO basics:: Marking and displaying TODO entries 522* TODO basics:: Marking and displaying TODO entries
516* Priorities:: Some things are more important than others
517* TODO extensions:: Workflow and assignments 523* TODO extensions:: Workflow and assignments
524* Priorities:: Some things are more important than others
518@end menu 525@end menu
519 526
520@node TODO basics, Priorities, TODO items, TODO items 527@node TODO basics, TODO extensions, TODO items, TODO items
521@section Basic TODO functionality 528@section Basic TODO functionality
522 529
523Any headline can become a TODO item by starting it with the word TODO, 530Any headline can become a TODO item by starting it with the word TODO,
@@ -538,49 +545,20 @@ Rotate the TODO state of the current item between
538,-> (unmarked) -> TODO -> DONE --. 545,-> (unmarked) -> TODO -> DONE --.
539'--------------------------------' 546'--------------------------------'
540@end example 547@end example
548The same rotation can also be done ``remotely'' from the timeline and
549agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
541@kindex C-c C-v 550@kindex C-c C-v
542@cindex sparse tree, for TODO 551@cindex sparse tree, for TODO
543@item C-c C-v 552@item C-c C-v
544View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds 553View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds
545the entire buffer, but shows all TODO items and the headings hierarchy 554the entire buffer, but shows all TODO items and the headings hierarchy
546above them. With prefix arg, show also the DONE entries. 555above them. With prefix arg, show also the DONE entries.
556@item C-u C-c a
557A @kbd{C-u} argument to the @code{org-agenda command} (@pxref{Agenda})
558collects all unfinished TODO items into a single place.
547@end table 559@end table
548 560
549@node Priorities, TODO extensions, TODO basics, TODO items 561@node TODO extensions, Priorities, TODO basics, TODO items
550@section Priorities
551@cindex priorities
552
553If you use Org-mode extensively to organize your work, you may end up
554with a number of TODO entries so large that you'd like to prioritize
555them. You can do this by placing a @emph{priority cookie} into the
556headline, like this
557
558@example
559*** TODO [#A] Write letter to Sam Fortune
560@end example
561
562@noindent
563With its standard setup, Org-mode supports priorities @samp{A},
564@samp{B}, and @samp{C}. @samp{A} is the highest priority. An entry
565without a cookie is treated as priority @samp{B}. Priorities make a
566difference only in the multi-file agenda (@pxref{Agenda (multiple files)}).
567
568@table @kbd
569@kindex @kbd{C-c ,}
570@item @kbd{C-c ,}
571Set the priority of the current item. The command prompts for a
572priority character @samp{A}, @samp{B} or @samp{C}. When you press
573@key{SPC} instead, the priority cookie is removed from the headline.
574@kindex S-@key{up}
575@kindex S-@key{down}
576@item S-@key{up}
577@itemx S-@key{down}
578Increase/decrease priority of current item. Note that these keys are
579also used to modify time stamps (@pxref{Creating timestamps}).
580@end table
581
582
583@node TODO extensions, , Priorities, TODO items
584@section Extended use of TODO keywords 562@section Extended use of TODO keywords
585@cindex extended TODO keywords 563@cindex extended TODO keywords
586 564
@@ -624,9 +602,11 @@ If you define many keywords, you can use in-buffer completion (see
624@cindex types as TODO keywords 602@cindex types as TODO keywords
625 603
626The second possibility is to use TODO keywords to indicate different 604The second possibility is to use TODO keywords to indicate different
627types of action items. For example, when you work with several people 605types of action items. For example, you might want to indicate that
628on a single project, you might want to assign action items to 606items are for ``work'' or ``home''. Or, when you work with several
629persons. 607people on a single project, you might want to assign action items
608directly to persons, by using their names as TODO keywords. This
609would be set up like this:
630 610
631@lisp 611@lisp
632(setq org-todo-keywords '("Fred" "Sara" "Lucy" "Mike" "DONE") 612(setq org-todo-keywords '("Fred" "Sara" "Lucy" "Mike" "DONE")
@@ -634,12 +614,15 @@ persons.
634@end lisp 614@end lisp
635 615
636In this case, different keywords do not indicate a sequence, but 616In this case, different keywords do not indicate a sequence, but
637rather different types. This changes the behavior of the command 617rather different types. So it is normally not useful to change from
638@kbd{C-c C-t} slightly. When used several times in succession, it 618one type to another. Therefore, in this case the the behavior of the
639will still cycle through all names. But when when you return to the 619command @kbd{C-c C-t} is changed slightly@footnote{This is also true
640item after some time and execute @kbd{C-c C-t} again, it will switch 620for the @kbd{t} command in the timeline and agenda buffers}. When
641from each name directly to DONE. Use prefix arguments or completion 621used several times in succession, it will still cycle through all
642to quickly select a specific name. 622names. But when when you return to the item after some time and
623execute @kbd{C-c C-t} again, it will switch from each name directly to
624DONE. Use prefix arguments or completion to quickly select a specific
625name.
643 626
644@node Per file keywords, , TODO types, TODO extensions 627@node Per file keywords, , TODO types, TODO extensions
645@subsection Setting up TODO keywords for individual files 628@subsection Setting up TODO keywords for individual files
@@ -647,11 +630,12 @@ to quickly select a specific name.
647@cindex per file keywords 630@cindex per file keywords
648 631
649It can be very useful to use different aspects of the TODO mechanism 632It can be very useful to use different aspects of the TODO mechanism
650in different files. For this you need to add special lines to the 633in different files, which is not possible with the global settings
651file which set the keywords and interpretation for that file only. 634described above. For file-local settings, you need to add special
652For example, to set one of the two examples discussed above, you 635lines to the file which set the keywords and interpretation for that
653need one of the following lines, starting in column zero anywhere in 636file only. For example, to set one of the two examples discussed
654the file: 637above, you need one of the following lines, starting in column zero
638anywhere in the file:
655 639
656@example 640@example
657#+SEQ_TODO: TODO FEEDBACK VERIFY DONE 641#+SEQ_TODO: TODO FEEDBACK VERIFY DONE
@@ -664,11 +648,15 @@ the file:
664@samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion. 648@samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
665 649
666@cindex DONE, final TODO keyword 650@cindex DONE, final TODO keyword
667Remember that the last keyword must always mean that the 651Remember that the last keyword must always mean that the item is DONE
668item is DONE (you may use a different word, though). After changing 652(you may use a different word, though). Also note that in each file,
669these lines, use @kbd{M-x normal-mode} to make the changes known to 653only one of the two aspects of TODO keywords can be used. After
670Org-mode. Also note that in each file, only one of the two aspects 654changing one of these lines, use @kbd{C-c C-c} with the cursor still
671of TODO keywords can be used. 655in the line to make the changes known to Org-mode@footnote{Org-mode
656parses these lines only when Org-mode is activated after visiting a
657file. @kbd{C-c C-c} with the cursor in a line starting with @samp{#-}
658is simply restarting Org-mode, making sure that these changes will be
659respected.}.
672 660
673If you want to use very many keywords, for example when working with a 661If you want to use very many keywords, for example when working with a
674large group of people, you may split the names over several lines: 662large group of people, you may split the names over several lines:
@@ -680,6 +668,43 @@ large group of people, you may split the names over several lines:
680#+TYP_TODO: DONE 668#+TYP_TODO: DONE
681@end example 669@end example
682 670
671@node Priorities, , TODO extensions, TODO items
672@section Priorities
673@cindex priorities
674
675If you use Org-mode extensively to organize your work, you may end up
676with a number of TODO entries so large that you'd like to prioritize
677them. This can be done by placing a @emph{priority cookie} into the
678headline, like this
679
680@example
681*** TODO [#A] Write letter to Sam Fortune
682@end example
683
684@noindent
685With its standard setup, Org-mode supports priorities @samp{A},
686@samp{B}, and @samp{C}. @samp{A} is the highest priority. An entry
687without a cookie is treated as priority @samp{B}. Priorities make a
688difference only in the agenda (@pxref{Agenda}).
689
690@table @kbd
691@kindex @kbd{C-c ,}
692@item @kbd{C-c ,}
693Set the priority of the current item. The command prompts for a
694priority character @samp{A}, @samp{B} or @samp{C}. When you press
695@key{SPC} instead, the priority cookie is removed from the headline.
696The priorities can also be changed ``remotely'' from the timeline and
697agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
698
699@kindex S-@key{up}
700@kindex S-@key{down}
701@item S-@key{up}
702@itemx S-@key{down}
703Increase/decrease priority of current item. Note that these keys are
704also used to modify time stamps (@pxref{Creating timestamps}).
705@end table
706
707
683@node Tables, Hyperlinks, TODO items, Top 708@node Tables, Hyperlinks, TODO items, Top
684@chapter Tables 709@chapter Tables
685@cindex tables 710@cindex tables
@@ -995,7 +1020,7 @@ RMAIL, WANDERLUST, GNUS and BBDB buffers, the link will point to the
995current article/entry. For W3 and W3M buffer, the link goes to the 1020current article/entry. For W3 and W3M buffer, the link goes to the
996current URL. For any other files, the link will just point to the file. 1021current URL. For any other files, the link will just point to the file.
997The key binding @kbd{C-c l} is only a suggestion - see 1022The key binding @kbd{C-c l} is only a suggestion - see
998@ref{Installation}. 1023@ref{Installation and Activation}.
999 1024
1000@kindex C-c C-l 1025@kindex C-c C-l
1001@item C-c C-l 1026@item C-c C-l
@@ -1048,7 +1073,6 @@ directly to the correct location in your Org-mode outline tree. The
1048following customization will tell @emph{Remember} to use org files as 1073following customization will tell @emph{Remember} to use org files as
1049target, and to create annotations compatible with Org-mode links. 1074target, and to create annotations compatible with Org-mode links.
1050 1075
1051
1052@c FIXME: The autoload will not be necessary when Org-mode is part of Emacs 1076@c FIXME: The autoload will not be necessary when Org-mode is part of Emacs
1053@example 1077@example
1054(autoload 'org-remember-annotation "org") 1078(autoload 'org-remember-annotation "org")
@@ -1113,7 +1137,7 @@ A time stamp is a specification of a date (possibly with time) in a
1113special format, either @samp{<2003-09-16 Tue>} or @samp{<2003-09-16 1137special format, either @samp{<2003-09-16 Tue>} or @samp{<2003-09-16
1114Tue 09:39>}. A time stamp can appear anywhere in the headline or body 1138Tue 09:39>}. A time stamp can appear anywhere in the headline or body
1115of an org-tree entry. Its presence allows to show entries on specific 1139of an org-tree entry. Its presence allows to show entries on specific
1116dates in the agenda (@pxref{Agenda (multiple files)}). We distinguish: 1140dates in the agenda (@pxref{Agenda}). We distinguish:
1117 1141
1118@table @var 1142@table @var
1119@cindex timestamp 1143@cindex timestamp
@@ -1192,7 +1216,7 @@ instead.
1192@kindex C-c C-o 1216@kindex C-c C-o
1193@item C-c C-o 1217@item C-c C-o
1194Access the agenda for the date given by the time stamp at point 1218Access the agenda for the date given by the time stamp at point
1195(@pxref{Agenda (multiple files)}). 1219(@pxref{Agenda}).
1196 1220
1197@kindex C-c C-d 1221@kindex C-c C-d
1198@item C-c C-d 1222@item C-c C-d
@@ -1303,13 +1327,13 @@ which covers all of your current projects, action items and
1303appointments. 1327appointments.
1304 1328
1305@menu 1329@menu
1306* Timeline (single file):: Time-sorted view for single file 1330* Timeline:: Time-sorted view for single file
1307* Agenda (multiple files):: Your weekly planner 1331* Agenda:: Your weekly planner
1308* Agenda commands:: Remote editing of org trees 1332* Agenda commands:: Remote editing of org trees
1309* Calendar/Diary integration:: Integrating Anniversaries and more 1333* Calendar/Diary integration:: Integrating Anniversaries and more
1310@end menu 1334@end menu
1311 1335
1312@node Timeline (single file), Agenda (multiple files), Timeline and Agenda, Timeline and Agenda 1336@node Timeline, Agenda, Timeline and Agenda, Timeline and Agenda
1313@section Timeline for a single file 1337@section Timeline for a single file
1314@cindex single file summary 1338@cindex single file summary
1315@cindex agenda, for single file 1339@cindex agenda, for single file
@@ -1335,9 +1359,9 @@ The timeline is shown in a temporary buffer @file{*Org Agenda*}. The
1335commands available in the Agenda buffer are listed in @ref{Agenda 1359commands available in the Agenda buffer are listed in @ref{Agenda
1336commands}. 1360commands}.
1337 1361
1338@node Agenda (multiple files), Agenda commands, Timeline (single file), Timeline and Agenda 1362@node Agenda, Agenda commands, Timeline, Timeline and Agenda
1339@section Agenda from multiple files 1363@section Agenda
1340@cindex agenda, from multiple files 1364@cindex agenda
1341 1365
1342An agenda can be compiled from one or more org files. The main 1366An agenda can be compiled from one or more org files. The main
1343purpose of this command is to act like a planner, in order to show you 1367purpose of this command is to act like a planner, in order to show you
@@ -1374,7 +1398,7 @@ when the variable @code{org-agenda-include-all-todo} is @code{t}), all
1374unfinished TODO items (also those without a date) are also listed at 1398unfinished TODO items (also those without a date) are also listed at
1375the beginning of the buffer, before the first date.@* 1399the beginning of the buffer, before the first date.@*
1376The key binding @kbd{C-c a} is only a suggestion - see 1400The key binding @kbd{C-c a} is only a suggestion - see
1377@ref{Installation}. 1401@ref{Installation and Activation}.
1378@end table 1402@end table
1379 1403
1380The commands available in the Agenda buffer are listed in 1404The commands available in the Agenda buffer are listed in
@@ -1384,24 +1408,18 @@ The commands available in the Agenda buffer are listed in
1384 1408
1385@cindex category 1409@cindex category
1386In the agenda buffer, each entry is preceded by a @emph{category}, 1410In the agenda buffer, each entry is preceded by a @emph{category},
1387which is derived from the file name. You can also set the category of 1411which is derived from the file name. The category can also be set
1388a file through file variables, for example by making the first line of 1412with a special line anywhere in the buffer, looking like this:
1389the file look like this:
1390
1391@cindex file variables
1392@example
1393Planet Finder -*- mode: org; org-category: Cheops -*-
1394@end example
1395@noindent
1396Or, like with TODO keywords (@pxref{Per file keywords}), you can
1397insert a special line anywhere in the file:
1398
1399@example 1413@example
1400#+CATEGORY: Cheops 1414#+CATEGORY: Cheops
1401@end example 1415@end example
1402@noindent 1416@noindent
1403The display looks best if the category is no longer than 10 characters. 1417After changing this line, press @kbd{C-c C-c} with the cursor still in
1418the line, to make the changes know to org-mode. Otherwise, the change
1419will only be active the next time you visit this file with Emacs.
1404 1420
1421The display in the agenda buffer looks best if the category is no
1422longer than 10 characters.
1405 1423
1406@subsection Sorting of agenda items 1424@subsection Sorting of agenda items
1407@cindex sorting, of agenda items 1425@cindex sorting, of agenda items
@@ -1427,7 +1445,7 @@ plus additional increments for overdue scheduled or deadline items.
1427Sorting can be customized using the variable 1445Sorting can be customized using the variable
1428@code{org-agenda-sorting-strategy}. 1446@code{org-agenda-sorting-strategy}.
1429 1447
1430@node Agenda commands, Calendar/Diary integration, Agenda (multiple files), Timeline and Agenda 1448@node Agenda commands, Calendar/Diary integration, Agenda, Timeline and Agenda
1431@section Commands in the agenda buffer 1449@section Commands in the agenda buffer
1432 1450
1433Entries in the agenda buffer are linked back to the org file or diary 1451Entries in the agenda buffer are linked back to the org file or diary
@@ -1443,6 +1461,13 @@ commands are available for both timelines and the agenda. The
1443exceptions are marked. 1461exceptions are marked.
1444 1462
1445@table @kbd 1463@table @kbd
1464@tsubheading{Motion}
1465@kindex n
1466@item n
1467Next line (same as @key{up}).
1468@kindex p
1469@item p
1470Previous line (same as @key{down}).
1446@tsubheading{View/GoTo org file} 1471@tsubheading{View/GoTo org file}
1447@kindex mouse-3 1472@kindex mouse-3
1448@kindex @key{SPC} 1473@kindex @key{SPC}
@@ -1470,7 +1495,6 @@ Toggle follow mode. In follow mode, as you move the cursor through
1470the agenda buffer, the other window always shows the corresponding 1495the agenda buffer, the other window always shows the corresponding
1471location in the org file. 1496location in the org file.
1472 1497
1473
1474@tsubheading{Change display} 1498@tsubheading{Change display}
1475@kindex o 1499@kindex o
1476@item o 1500@item o
@@ -1515,8 +1539,8 @@ Digit argument.
1515Change the TODO state of the item, both in the agenda and in the 1539Change the TODO state of the item, both in the agenda and in the
1516original org file. 1540original org file.
1517 1541
1518@kindex p 1542@kindex ,
1519@item p 1543@item ,
1520Set the priority for the current item. Org-mode prompts for the 1544Set the priority for the current item. Org-mode prompts for the
1521priority character. If you reply with @key{SPC}, the priority cookie 1545priority character. If you reply with @key{SPC}, the priority cookie
1522is removed from the entry. 1546is removed from the entry.
@@ -1526,13 +1550,17 @@ is removed from the entry.
1526Display weighted priority of current item. 1550Display weighted priority of current item.
1527 1551
1528@kindex + 1552@kindex +
1553@kindex S-@key{up}
1529@item + 1554@item +
1555@item S-@key{up}
1530Increase the priority of the current item. The priority is changed in 1556Increase the priority of the current item. The priority is changed in
1531the original buffer, but the agenda is not resorted. Use the @kbd{r} 1557the original buffer, but the agenda is not resorted. Use the @kbd{r}
1532key for this. 1558key for this.
1533 1559
1534@kindex - 1560@kindex -
1561@kindex S-@key{down}
1535@item - 1562@item -
1563@item S-@key{down}
1536Decrease the priority of the current item. 1564Decrease the priority of the current item.
1537 1565
1538@kindex S-@key{right} 1566@kindex S-@key{right}
@@ -1568,10 +1596,9 @@ The date is taken from the cursor position.
1568@item c 1596@item c
1569Open the Emacs calendar and move to the date at the agenda cursor. 1597Open the Emacs calendar and move to the date at the agenda cursor.
1570 1598
1571@kindex C 1599@item c
1572@item C 1600When in the calendar, compute and show the Org-mode agenda for the
1573Convert the date at cursor into many other cultural and historic 1601date at the cursor.
1574calendars.
1575 1602
1576@kindex M 1603@kindex M
1577@item M 1604@item M
@@ -1579,8 +1606,13 @@ Show the phases of the moon for three month around current date.
1579 1606
1580@kindex S 1607@kindex S
1581@item S 1608@item S
1582Show sunrise and sunset times. The location must be set with calendar 1609Show sunrise and sunset times. The geographical location must be set
1583variables, see documentation of the Emacs calendar. 1610with calendar variables, see documentation of the Emacs calendar.
1611
1612@kindex C
1613@item C
1614Convert the date at cursor into many other cultural and historic
1615calendars.
1584 1616
1585@kindex H 1617@kindex H
1586@item H 1618@item H
@@ -1643,7 +1675,8 @@ file, in order to edit existing diary entries. Also the @kbd{i}
1643command to insert new entries for the current date works in the agenda 1675command to insert new entries for the current date works in the agenda
1644buffer, as well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to 1676buffer, as well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to
1645display Sunrise/Sunset times, show lunar phases and to convert to 1677display Sunrise/Sunset times, show lunar phases and to convert to
1646other calendars, respectively. 1678other calendars, respectively. @kbd{c} can be used to switch back and
1679forth between calendar and agenda.
1647 1680
1648@node Agenda to diary, , Diary to agenda, Calendar/Diary integration 1681@node Agenda to diary, , Diary to agenda, Calendar/Diary integration
1649@subsection Including the agenda into the diary 1682@subsection Including the agenda into the diary
@@ -1651,8 +1684,8 @@ other calendars, respectively.
1651If you prefer to use the Emacs diary as your main instrument and if 1684If you prefer to use the Emacs diary as your main instrument and if
1652you wish to include the Org-mode agenda into it, the following steps 1685you wish to include the Org-mode agenda into it, the following steps
1653are necessary: Autoload the function @command{org-diary} as shown 1686are necessary: Autoload the function @command{org-diary} as shown
1654above under @ref{Installation}. You also need to use @emph{fancy 1687above under @ref{Installation and Activation}. You also need to use
1655diary display} by setting in @file{.emacs}: 1688@emph{fancy diary display} by setting in @file{.emacs}:
1656 1689
1657@lisp 1690@lisp
1658(add-hook 'diary-display-hook 'fancy-diary-display) 1691(add-hook 'diary-display-hook 'fancy-diary-display)
@@ -2038,11 +2071,6 @@ planner.
2038Org mode cooperates with table.el, see @ref{table.el}. 2071Org mode cooperates with table.el, see @ref{table.el}.
2039@end table 2072@end table
2040 2073
2041@c EmacsWiki
2042@c organizer-mode
2043@c todo-mode
2044@c records mode
2045
2046@page @c FIXME 2074@page @c FIXME
2047 2075
2048@node Acknowledgments, Bugs, Interaction, Miscellaneous 2076@node Acknowledgments, Bugs, Interaction, Miscellaneous
@@ -2068,9 +2096,9 @@ in HTML output, and other export improvements.
2068Christian Egli converted the documentation into TeXInfo format. He 2096Christian Egli converted the documentation into TeXInfo format. He
2069also showed me his plans for a multifile summary for Org-mode. Some of 2097also showed me his plans for a multifile summary for Org-mode. Some of
2070his ideas have found their way into the agenda. 2098his ideas have found their way into the agenda.
2071@item 2099@item
2072Philip Rooke created the Org-mode reference card and did some 2100Philip Rooke created the Org-mode reference card. He also helped with
2073beta-testing. 2101beta testing and contributed a number of very useful ideas.
2074@item 2102@item
2075Linking to VM/BBDB/GNUS was inspired by Tom Shannon's 2103Linking to VM/BBDB/GNUS was inspired by Tom Shannon's
2076@file{organizer-mode.el}. 2104@file{organizer-mode.el}.
@@ -2102,8 +2130,8 @@ the file), it does so silently. No error message is displayed.
2102Under XEmacs, if Org-mode entries are included into the diary, it is 2130Under XEmacs, if Org-mode entries are included into the diary, it is
2103not possible to jump back from the diary to the org file. Apparently, 2131not possible to jump back from the diary to the org file. Apparently,
2104the text properties are lost when the fancy-diary-display is used. 2132the text properties are lost when the fancy-diary-display is used.
2105However, from Org-mode's agenda (created with @kbd{C-c C-r} or 2133However, from Org-mode's timeline and agenda buffers (created with
2106@kbd{M-x org-agenda}), things do work correctly. 2134@kbd{C-c C-r} and @kbd{C-c a}), things do work correctly.
2107@item 2135@item
2108Linux should also have a default viewer application, using mailcap. 2136Linux should also have a default viewer application, using mailcap.
2109Maybe we can use GNUS or VM mime code? Or dired's guessing commands? 2137Maybe we can use GNUS or VM mime code? Or dired's guessing commands?
@@ -2126,7 +2154,6 @@ The exporters work well, but could be made more efficient.
2126 2154
2127@bye 2155@bye
2128 2156
2129
2130@ignore 2157@ignore
2131 arch-tag: 7893d1fe-cc57-4d13-b5e5-f494a1bcc7ac 2158 arch-tag: 7893d1fe-cc57-4d13-b5e5-f494a1bcc7ac
2132@end ignore 2159@end ignore
diff --git a/man/rmail.texi b/man/rmail.texi
index f7b9a1ea08e..091d1e60b74 100644
--- a/man/rmail.texi
+++ b/man/rmail.texi
@@ -891,10 +891,13 @@ message is selected in the Rmail buffer.
891 891
892 Almost all Rmail commands work in the summary buffer as well as in the 892 Almost all Rmail commands work in the summary buffer as well as in the
893Rmail buffer. Thus, @kbd{d} in the summary buffer deletes the current 893Rmail buffer. Thus, @kbd{d} in the summary buffer deletes the current
894message, @kbd{u} undeletes, and @kbd{x} expunges. @kbd{o} and @kbd{C-o} 894message, @kbd{u} undeletes, and @kbd{x} expunges. (However, in the
895output the current message to a file; @kbd{r} starts a reply to it. You 895summary buffer, a numeric argument to @kbd{d}, @kbd{C-d} and @kbd{u}
896can scroll the current message while remaining in the summary buffer 896serves as a repeat count. A negative argument reverses the meaning of
897using @key{SPC} and @key{DEL}. 897@kbd{d} and @kbd{C-d}.) @kbd{o} and @kbd{C-o} output the current
898message to a file; @kbd{r} starts a reply to it. You can scroll the
899current message while remaining in the summary buffer using @key{SPC}
900and @key{DEL}.
898 901
899 The Rmail commands to move between messages also work in the summary 902 The Rmail commands to move between messages also work in the summary
900buffer, but with a twist: they move through the set of messages included 903buffer, but with a twist: they move through the set of messages included
diff --git a/man/xresources.texi b/man/xresources.texi
index 7e1beb2442a..b5090afd260 100644
--- a/man/xresources.texi
+++ b/man/xresources.texi
@@ -175,6 +175,10 @@ Width in pixels of the external border.
175@item @code{cursorColor} (class @code{Foreground}) 175@item @code{cursorColor} (class @code{Foreground})
176Color name for text cursor (point). 176Color name for text cursor (point).
177 177
178@item @code{cursorBlink} (class @code{CursorBlink})
179Specifies whether to make the cursor blink. The default is @samp{on}. Use
180@samp{off} or @samp{false} to turn cursor blinking off.
181
178@item @code{font} (class @code{Font}) 182@item @code{font} (class @code{Font})
179Font name for text (or fontset name, @pxref{Fontsets}). 183Font name for text (or fontset name, @pxref{Fontsets}).
180 184
diff --git a/src/ChangeLog b/src/ChangeLog
index 26b8a9ce5ad..3483a2c5905 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,102 @@
12005-04-16 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * term.c (struct keys): Add support for shifted keys.
4
52005-04-16 Richard M. Stallman <rms@gnu.org>
6
7 * xdisp.c (with_echo_area_buffer): Delete WHICH < 0 case.
8 (set_message): Call with_echo_area_buffer with WHICH = 0.
9 (set_message_1): Erase the echo area buffer first thing.
10 (echo_area_display): Don't clear echo_message_buffer.
11
122005-04-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13
14 * Makefile.in (mac.o): Depend on charset.h and coding.h.
15
16 * mac.c: Include charset.h and coding.h.
17 [TARGET_API_MAC_CARBON] (Qutf_8): Remove extern.
18 [TARGET_API_MAC_CARBON] (cfstring_create_with_string): New
19 function.
20 [TARGET_API_MAC_CARBON] (Fmac_get_preference): Use it.
21
22 * macfns.c [TARGET_API_MAC_CARBON] (Fx_file_dialog): Likewise.
23
24 * image.c [MAC_OSX] (image_load_quartz2d): Likewise.
25
26 * macterm.c (x_autoselect_window_p): Remove variable.
27 (last_window): New variable.
28 (XTreassert_line_highlight, x_change_line_highlight): Remove
29 declarations.
30 (mac_focus_changed, x_detect_focus_change): New functions and
31 declarations.
32 (XTextExtents16, front_emacs_window): Remove function.
33 (mac_focus_frame): New function.
34 (XTmouse_position, do_menu_choice, do_zoom_window, XTread_socket)
35 (mac_check_for_quit_char): Use it instead of front_emacs_window.
36 (x_scroll_bar_report_motion): Obtain window from control owner.
37 (x_make_frame_invisible): Set window manager size hint.
38 (do_mouse_moved): Remove function.
39 (XTread_socket): Move its contents here. Generate select-window
40 event on mouse movement if needed. Use x_detect_focus_change on
41 activate/deactivate events. Don't deiconify frame or invalidate
42 window rectangle when dnd items are dropped. Don't
43 activate/deactivate root control.
44 (frame_highlight, frame_unhighlight): Activate/deactivate root
45 control here.
46 (syms_of_macterm): Delete DEFVAR_BOOL for x_autoselect_window_p.
47
48 * macterm.h (cfstring_create_with_string) [TARGET_API_MAC_CARBON]:
49 New extern.
50
512005-04-15 Luc Teirlinck <teirllm@auburn.edu>
52
53 * Makefile.in: Define new macro TOOLTIP_SUPPORT.
54 (lisp): Use it.
55 (SOME_MACHINE_LISP): Add tooltip.
56
572005-04-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
58
59 * mac.c [!TARGET_API_MAC_CARBON]: Include MacLocales.h. Don't
60 include TextEncodingConverter.h.
61 (mac_system_script_code, Vmac_system_locale): New variables.
62 (syms_of_mac): Defvar them.
63 (mac_get_system_locale): New function.
64
65 * macfns.c (x_set_name, x_set_title) [!TARGET_API_MAC_CARBON]: Use
66 ENCODE_SYSTEM to encode title bar string.
67 (x_create_tip_frame): Apply 2005-03-18 change for xfns.c.
68 (Fx_file_dialog) [TARGET_API_MAC_CARBON && !MAC_OSX]: Use
69 CFStringGetSystemEncoding to get system default string encoding.
70
71 * macterm.c [!TARGET_API_MAC_CARBON]: Don't include
72 TextEncodingConverter.h.
73
742005-04-13 Steven Tamm <steventamm@mac.com>
75
76 * macterm.c (syms_of_macterm): Remove redundant definition of
77 mac-pass-control-to-system.
78
792005-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
80
81 * window.c (Fset_window_configuration): Be careful when you choose
82 among several possible points for the new_current_buffer.
83
842005-04-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
85
86 * keyboard.c (poll_for_input) [SYNC_INPUT]: Don't call
87 poll_for_input_1. Set interrupt_input_pending to 1 instead.
88 (Qlanguage_change) [MAC_OS]: New variable.
89 (syms_of_keyboard) [MAC_OS]: Intern and staticpro it.
90 (kbd_buffer_get_event) [MAC_OS]: Make event for LANGUAGE_CHANGE_EVENT.
91
92 * macterm.c (mac_keyboard_text_encoding)
93 (current_mac_keyboard_text_encoding): Remove variables.
94 (XTread_socket): Store language-change event if keyboard script change
95 is detected. Don't convert input to `mac_keyboard_text_encoding'.
96 (syms_of_macterm): Delete DEFVAR_INT for mac-keyboard-text-encoding.
97
98 * termhooks.h (enum event_kind) [MAC_OS]: Add LANGUAGE_CHANGE_EVENT.
99
12005-04-10 Richard M. Stallman <rms@gnu.org> 1002005-04-10 Richard M. Stallman <rms@gnu.org>
2 101
3 * emacs.c (standard_args): Rename --bare-bones to --quick. 102 * emacs.c (standard_args): Rename --bare-bones to --quick.
@@ -48,8 +147,8 @@
48 * mac.c (cfdate_to_lisp): Add `const' for variable `epoch_gdate'. 147 * mac.c (cfdate_to_lisp): Add `const' for variable `epoch_gdate'.
49 (Fmac_get_preference): Doc fix. 148 (Fmac_get_preference): Doc fix.
50 149
51 * macfns.c (Fx_create_frame, x_create_tip_frame): Add 150 * macfns.c (Fx_create_frame, x_create_tip_frame):
52 "fontset-mac" to fallback font/fontsets. 151 Add "fontset-mac" to fallback font/fontsets.
53 152
542005-04-04 Kim F. Storm <storm@cua.dk> 1532005-04-04 Kim F. Storm <storm@cua.dk>
55 154
@@ -80,8 +179,8 @@
80 Vascii_downcase_table. 179 Vascii_downcase_table.
81 (fast_string_match_ignore_case): Likewise. 180 (fast_string_match_ignore_case): Likewise.
82 (search_buffer): Fix checking of boyer-moore usability. 181 (search_buffer): Fix checking of boyer-moore usability.
83 (boyer_moore): Calculate translate_prev_byte1/2/3 in advance. No 182 (boyer_moore): Calculate translate_prev_byte1/2/3 in advance.
84 need of tranlating characters in PAT. Fix calculation of 183 No need of tranlating characters in PAT. Fix calculation of
85 simple_translate. 184 simple_translate.
86 185
872005-03-31 Stefan Monnier <monnier@iro.umontreal.ca> 1862005-03-31 Stefan Monnier <monnier@iro.umontreal.ca>
@@ -885,9 +984,9 @@
885 984
8862005-02-02 Steven Tamm <steventamm@mac.com> 9852005-02-02 Steven Tamm <steventamm@mac.com>
887 986
888 * macfns.c (unwind_create_frame): Fixing compile error due to 987 * macfns.c (unwind_create_frame): Fix compile error due to
889 xassert being uncondition, but predicate is. 988 xassert being uncondition, but predicate is.
890 * dispnew.c (update_window): Fixing compile error due to 989 * dispnew.c (update_window): Fix compile error due to
891 xassert being uncondition, but predicate is. 990 xassert being uncondition, but predicate is.
892 991
8932005-02-02 Miles Bader <miles@gnu.org> 9922005-02-02 Miles Bader <miles@gnu.org>
@@ -1031,6 +1130,7 @@
1031 1130
1032 * s/darwin.h: Removed PTY_ITERATION from here. 1131 * s/darwin.h: Removed PTY_ITERATION from here.
1033 (DARWIN): Define. 1132 (DARWIN): Define.
1133
1034 * process.c (init_process): Default process-connection-type to 1134 * process.c (init_process): Default process-connection-type to
1035 nil on darwin 6 or less, t if it is 7 or higher. This way the 1135 nil on darwin 6 or less, t if it is 7 or higher. This way the
1036 broken pty behavior is still allowed on darwin 6 for interactive 1136 broken pty behavior is still allowed on darwin 6 for interactive
@@ -3536,8 +3636,8 @@
35362004-08-26 Steven Tamm <steventamm@mac.com> 36362004-08-26 Steven Tamm <steventamm@mac.com>
3537 3637
3538 * fileio.c (Fread_file_name): Call x_file_dialog on carbon on 3638 * fileio.c (Fread_file_name): Call x_file_dialog on carbon on
3539 tool-bar/menu click 3639 tool-bar/menu click.
3540 * macfns.c (Fx_file_dialog): Implemented using NavServices 3640 * macfns.c (Fx_file_dialog): Implement using NavServices.
3541 3641
35422004-08-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 36422004-08-24 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
3543 3643
@@ -5024,7 +5124,7 @@
5024 5124
50252004-04-26 Steven Tamm <tamm@Steven-Tamms-Computer.local> 51252004-04-26 Steven Tamm <tamm@Steven-Tamms-Computer.local>
5026 5126
5027 * lread.c (init_lread): Fixing typo HAVE_CARBON test logic 5127 * lread.c (init_lread): Fix typo in HAVE_CARBON test logic.
5028 5128
50292004-04-26 Miles Bader <miles@gnu.org> 51292004-04-26 Miles Bader <miles@gnu.org>
5030 5130
@@ -5479,10 +5579,10 @@
5479 5579
54802004-03-11 Steven Tamm <steventamm@mac.com> 55802004-03-11 Steven Tamm <steventamm@mac.com>
5481 5581
5482 * image.c [MAC_OSX]: Include sys/stat.h 5582 * image.c [MAC_OSX]: Include sys/stat.h.
5483 5583
5484 * macfns.c (syms_of_macfns): Remove definitions of things now 5584 * macfns.c (syms_of_macfns): Remove definitions of things now
5485 defined in image.c 5585 defined in image.c.
5486 5586
54872004-03-11 Kim F. Storm <storm@cua.dk> 55872004-03-11 Kim F. Storm <storm@cua.dk>
5488 5588
@@ -6192,7 +6292,7 @@
6192 * macterm.c (Vmac_emulate_three_button_mouse): New variable for 6292 * macterm.c (Vmac_emulate_three_button_mouse): New variable for
6193 controlling emulation of a three button mouse with option and 6293 controlling emulation of a three button mouse with option and
6194 command keys. 6294 command keys.
6195 (Qreverse, mac_get_enumlated_btn): Handle the emulation 6295 (Qreverse, mac_get_enumlated_btn): Handle the emulation.
6196 (mac_event_to_emacs_modifiers, XTread_socket): Ditto. 6296 (mac_event_to_emacs_modifiers, XTread_socket): Ditto.
6197 6297
61982004-02-15 Kim F. Storm <storm@cua.dk> 62982004-02-15 Kim F. Storm <storm@cua.dk>
@@ -11132,7 +11232,7 @@
11132 11232
111332003-01-20 Steven Tamm <steventamm@mac.com> 112332003-01-20 Steven Tamm <steventamm@mac.com>
11134 11234
11135 * macterm.c (XTread_socket): Checks for valid, visible window 11235 * macterm.c (XTread_socket): Check for valid, visible window
11136 before sending a scroll-wheel event. 11236 before sending a scroll-wheel event.
11137 11237
111382003-01-20 Richard M. Stallman <rms@gnu.org> 112382003-01-20 Richard M. Stallman <rms@gnu.org>
@@ -11491,7 +11591,7 @@
11491 11591
114922002-12-28 Steven Tamm <steventamm@mac.com> 115922002-12-28 Steven Tamm <steventamm@mac.com>
11493 11593
11494 * Makefile.in (macosx-bundle): Fixes to Mac OS X/Carbon port to 11594 * Makefile.in (macosx-bundle): Fix Mac OS X/Carbon port to
11495 allow building in a different directory than source. Uses some 11595 allow building in a different directory than source. Uses some
11496 GNU Make extensions, but there is no other make on Mac OS X. 11596 GNU Make extensions, but there is no other make on Mac OS X.
11497 11597
@@ -11534,7 +11634,7 @@
11534 11634
11535 * macterm.c (XTread_socket): Call KeyTranslate for control and 11635 * macterm.c (XTread_socket): Call KeyTranslate for control and
11536 meta to deal correctly shifted non-alpha characters, like C-S-5 11636 meta to deal correctly shifted non-alpha characters, like C-S-5
11537 being treated like C-%. Does not look for shift key to deal 11637 being treated like C-%. Do not look for shift key to deal
11538 with masking off control-key with mac-reverse-ctrl-meta. 11638 with masking off control-key with mac-reverse-ctrl-meta.
11539 11639
115402002-12-21 Richard M. Stallman <rms@gnu.org> 116402002-12-21 Richard M. Stallman <rms@gnu.org>
diff --git a/src/Makefile.in b/src/Makefile.in
index 53725361a80..ec5ff5a4c5f 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -686,6 +686,12 @@ otherobj= $(termcapobj) lastfile.o $(mallocobj) $(allocaobj) $(widgetobj) $(LIBO
686#define WINNT_SUPPORT 686#define WINNT_SUPPORT
687#endif 687#endif
688 688
689#ifdef HAVE_WINDOW_SYSTEM
690#define TOOLTIP_SUPPORT ${lispsource}tooltip.elc
691#else
692#define TOOLTIP_SUPPORT
693#endif
694
689/* List of Lisp files loaded into the dumped Emacs. It's arranged 695/* List of Lisp files loaded into the dumped Emacs. It's arranged
690 like this because it's easier to generate it semi-mechanically from 696 like this because it's easier to generate it semi-mechanically from
691 loadup.el this way. 697 loadup.el this way.
@@ -780,6 +786,7 @@ lisp= \
780 ${lispsource}emacs-lisp/timer.elc \ 786 ${lispsource}emacs-lisp/timer.elc \
781 ${lispsource}vc-hooks.elc \ 787 ${lispsource}vc-hooks.elc \
782 ${lispsource}ediff-hook.elc \ 788 ${lispsource}ediff-hook.elc \
789 TOOLTIP_SUPPORT \
783 VMS_SUPPORT \ 790 VMS_SUPPORT \
784 MSDOS_SUPPORT \ 791 MSDOS_SUPPORT \
785 WINNT_SUPPORT \ 792 WINNT_SUPPORT \
@@ -887,6 +894,7 @@ SOME_MACHINE_LISP = ${dotdot}/lisp/mouse.elc \
887 ${dotdot}/lisp/ls-lisp.elc ${dotdot}/lisp/dos-fns.elc \ 894 ${dotdot}/lisp/ls-lisp.elc ${dotdot}/lisp/dos-fns.elc \
888 ${dotdot}/lisp/w32-fns.elc ${dotdot}/lisp/dos-w32.elc \ 895 ${dotdot}/lisp/w32-fns.elc ${dotdot}/lisp/dos-w32.elc \
889 ${dotdot}/lisp/disp-table.elc ${dotdot}/lisp/dos-vars.elc \ 896 ${dotdot}/lisp/disp-table.elc ${dotdot}/lisp/dos-vars.elc \
897 ${dotdot}/lisp/tooltip.elc \
890 ${dotdot}/lisp/international/ccl.elc \ 898 ${dotdot}/lisp/international/ccl.elc \
891 ${dotdot}/lisp/international/codepage.elc \ 899 ${dotdot}/lisp/international/codepage.elc \
892 ${dotdot}/lisp/mouse.elc ${dotdot}/lisp/international/fontset.elc \ 900 ${dotdot}/lisp/mouse.elc ${dotdot}/lisp/international/fontset.elc \
@@ -1233,7 +1241,8 @@ abbrev.o buffer.o callint.o cmds.o dispnew.o editfns.o fileio.o frame.o \
1233 fontset.o indent.o insdel.o keyboard.o macros.o minibuf.o msdos.o process.o \ 1241 fontset.o indent.o insdel.o keyboard.o macros.o minibuf.o msdos.o process.o \
1234 scroll.o sysdep.o term.o widget.o window.o xdisp.o xfaces.o xfns.o xmenu.o \ 1242 scroll.o sysdep.o term.o widget.o window.o xdisp.o xfaces.o xfns.o xmenu.o \
1235 xterm.o xselect.o sound.o: macgui.h 1243 xterm.o xselect.o sound.o: macgui.h
1236mac.o: mac.c process.h sysselect.h blockinput.h atimer.h systime.h $(config_h) 1244mac.o: mac.c process.h sysselect.h blockinput.h atimer.h systime.h charset.h \
1245 coding.h $(config_h)
1237macfns.o: macfns.c charset.h macterm.h macgui.h frame.h window.h buffer.h \ 1246macfns.o: macfns.c charset.h macterm.h macgui.h frame.h window.h buffer.h \
1238 dispextern.h macgui.h fontset.h $(INTERVAL_SRC) keyboard.h blockinput.h \ 1247 dispextern.h macgui.h fontset.h $(INTERVAL_SRC) keyboard.h blockinput.h \
1239 atimer.h systime.h epaths.h termhooks.h coding.h systime.h $(config_h) 1248 atimer.h systime.h epaths.h termhooks.h coding.h systime.h $(config_h)
diff --git a/src/image.c b/src/image.c
index 0e48b1d2bcb..6a1fc7aa795 100644
--- a/src/image.c
+++ b/src/image.c
@@ -2423,7 +2423,7 @@ image_load_quartz2d (f, img, png_p)
2423 UNGCPRO; 2423 UNGCPRO;
2424 return 0; 2424 return 0;
2425 } 2425 }
2426 path = cfstring_create_with_utf8_cstring (SDATA (file)); 2426 path = cfstring_create_with_string (file);
2427 url = CFURLCreateWithFileSystemPath (NULL, path, 2427 url = CFURLCreateWithFileSystemPath (NULL, path,
2428 kCFURLPOSIXPathStyle, 0); 2428 kCFURLPOSIXPathStyle, 0);
2429 CFRelease (path); 2429 CFRelease (path);
diff --git a/src/keyboard.c b/src/keyboard.c
index 48c47502f85..9afcab10acd 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -521,7 +521,7 @@ Lisp_Object Qmouse_fixup_help_message;
521/* Symbols to denote kinds of events. */ 521/* Symbols to denote kinds of events. */
522Lisp_Object Qfunction_key; 522Lisp_Object Qfunction_key;
523Lisp_Object Qmouse_click; 523Lisp_Object Qmouse_click;
524#ifdef WINDOWSNT 524#if defined (WINDOWSNT) || defined (MAC_OS)
525Lisp_Object Qlanguage_change; 525Lisp_Object Qlanguage_change;
526#endif 526#endif
527Lisp_Object Qdrag_n_drop; 527Lisp_Object Qdrag_n_drop;
@@ -2100,7 +2100,11 @@ poll_for_input (timer)
2100 struct atimer *timer; 2100 struct atimer *timer;
2101{ 2101{
2102 if (poll_suppress_count == 0) 2102 if (poll_suppress_count == 0)
2103#ifdef SYNC_INPUT
2104 interrupt_input_pending = 1;
2105#else
2103 poll_for_input_1 (); 2106 poll_for_input_1 ();
2107#endif
2104} 2108}
2105 2109
2106#endif /* POLL_FOR_INPUT */ 2110#endif /* POLL_FOR_INPUT */
@@ -4026,11 +4030,16 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
4026 x_activate_menubar (XFRAME (event->frame_or_window)); 4030 x_activate_menubar (XFRAME (event->frame_or_window));
4027 } 4031 }
4028#endif 4032#endif
4029#ifdef WINDOWSNT 4033#if defined (WINDOWSNT) || defined (MAC_OS)
4030 else if (event->kind == LANGUAGE_CHANGE_EVENT) 4034 else if (event->kind == LANGUAGE_CHANGE_EVENT)
4031 { 4035 {
4036#ifdef MAC_OS
4037 /* Make an event (language-change (KEY_SCRIPT)). */
4038 obj = Fcons (make_number (event->code), Qnil);
4039#else
4032 /* Make an event (language-change (FRAME CHARSET LCID)). */ 4040 /* Make an event (language-change (FRAME CHARSET LCID)). */
4033 obj = Fcons (event->frame_or_window, Qnil); 4041 obj = Fcons (event->frame_or_window, Qnil);
4042#endif
4034 obj = Fcons (Qlanguage_change, Fcons (obj, Qnil)); 4043 obj = Fcons (Qlanguage_change, Fcons (obj, Qnil));
4035 kbd_fetch_ptr = event + 1; 4044 kbd_fetch_ptr = event + 1;
4036 } 4045 }
@@ -10976,7 +10985,7 @@ syms_of_keyboard ()
10976 staticpro (&Qfunction_key); 10985 staticpro (&Qfunction_key);
10977 Qmouse_click = intern ("mouse-click"); 10986 Qmouse_click = intern ("mouse-click");
10978 staticpro (&Qmouse_click); 10987 staticpro (&Qmouse_click);
10979#ifdef WINDOWSNT 10988#if defined (WINDOWSNT) || defined (MAC_OS)
10980 Qlanguage_change = intern ("language-change"); 10989 Qlanguage_change = intern ("language-change");
10981 staticpro (&Qlanguage_change); 10990 staticpro (&Qlanguage_change);
10982#endif 10991#endif
diff --git a/src/mac.c b/src/mac.c
index da6a61633dc..68e3bdfa065 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -31,6 +31,8 @@ Boston, MA 02111-1307, USA. */
31#include "sysselect.h" 31#include "sysselect.h"
32#include "systime.h" 32#include "systime.h"
33#include "blockinput.h" 33#include "blockinput.h"
34#include "charset.h"
35#include "coding.h"
34 36
35#include "macterm.h" 37#include "macterm.h"
36 38
@@ -49,6 +51,7 @@ Boston, MA 02111-1307, USA. */
49#include <Events.h> 51#include <Events.h>
50#include <Processes.h> 52#include <Processes.h>
51#include <EPPC.h> 53#include <EPPC.h>
54#include <MacLocales.h>
52#endif /* not HAVE_CARBON */ 55#endif /* not HAVE_CARBON */
53 56
54#include <utime.h> 57#include <utime.h>
@@ -67,6 +70,12 @@ Boston, MA 02111-1307, USA. */
67 70
68Lisp_Object QCLIPBOARD; 71Lisp_Object QCLIPBOARD;
69 72
73/* The system script code. */
74static int mac_system_script_code;
75
76/* The system locale identifier string. */
77static Lisp_Object Vmac_system_locale;
78
70/* An instance of the AppleScript component. */ 79/* An instance of the AppleScript component. */
71static ComponentInstance as_scripting_component; 80static ComponentInstance as_scripting_component;
72/* The single script context used for all script executions. */ 81/* The single script context used for all script executions. */
@@ -258,7 +267,6 @@ posix_to_mac_pathname (const char *ufn, char *mfn, int mfnbuflen)
258#if TARGET_API_MAC_CARBON 267#if TARGET_API_MAC_CARBON
259static Lisp_Object Qstring, Qnumber, Qboolean, Qdate, Qdata; 268static Lisp_Object Qstring, Qnumber, Qboolean, Qdate, Qdata;
260static Lisp_Object Qarray, Qdictionary; 269static Lisp_Object Qarray, Qdictionary;
261extern Lisp_Object Qutf_8;
262#define DECODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 0) 270#define DECODE_UTF_8(str) code_convert_string_norecord (str, Qutf_8, 0)
263 271
264struct cfdict_context 272struct cfdict_context
@@ -267,7 +275,7 @@ struct cfdict_context
267 int with_tag, hash_bound; 275 int with_tag, hash_bound;
268}; 276};
269 277
270/* C string to CFString. */ 278/* C string to CFString. */
271 279
272CFStringRef 280CFStringRef
273cfstring_create_with_utf8_cstring (c_str) 281cfstring_create_with_utf8_cstring (c_str)
@@ -284,6 +292,37 @@ cfstring_create_with_utf8_cstring (c_str)
284} 292}
285 293
286 294
295/* Lisp string to CFString. */
296
297CFStringRef
298cfstring_create_with_string (s)
299 Lisp_Object s;
300{
301 CFStringRef string = NULL;
302
303 if (STRING_MULTIBYTE (s))
304 {
305 char *p, *end = SDATA (s) + SBYTES (s);
306
307 for (p = SDATA (s); p < end; p++)
308 if (!isascii (*p))
309 {
310 s = ENCODE_UTF_8 (s);
311 break;
312 }
313 string = CFStringCreateWithBytes (NULL, SDATA (s), SBYTES (s),
314 kCFStringEncodingUTF8, false);
315 }
316
317 if (string == NULL)
318 /* Failed to interpret as UTF 8. Fall back on Mac Roman. */
319 string = CFStringCreateWithBytes (NULL, SDATA (s), SBYTES (s),
320 kCFStringEncodingMacRoman, false);
321
322 return string;
323}
324
325
287/* From CFData to a lisp string. Always returns a unibyte string. */ 326/* From CFData to a lisp string. Always returns a unibyte string. */
288 327
289Lisp_Object 328Lisp_Object
@@ -3704,11 +3743,11 @@ otherwise. */)
3704 app_id = kCFPreferencesCurrentApplication; 3743 app_id = kCFPreferencesCurrentApplication;
3705 if (!NILP (application)) 3744 if (!NILP (application))
3706 { 3745 {
3707 app_id = cfstring_create_with_utf8_cstring (SDATA (application)); 3746 app_id = cfstring_create_with_string (application);
3708 if (app_id == NULL) 3747 if (app_id == NULL)
3709 goto out; 3748 goto out;
3710 } 3749 }
3711 key_str = cfstring_create_with_utf8_cstring (SDATA (XCAR (key))); 3750 key_str = cfstring_create_with_string (XCAR (key));
3712 if (key_str == NULL) 3751 if (key_str == NULL)
3713 goto out; 3752 goto out;
3714 app_plist = CFPreferencesCopyAppValue (key_str, app_id); 3753 app_plist = CFPreferencesCopyAppValue (key_str, app_id);
@@ -3721,7 +3760,7 @@ otherwise. */)
3721 { 3760 {
3722 if (CFGetTypeID (plist) != CFDictionaryGetTypeID ()) 3761 if (CFGetTypeID (plist) != CFDictionaryGetTypeID ())
3723 break; 3762 break;
3724 key_str = cfstring_create_with_utf8_cstring (SDATA (XCAR (key))); 3763 key_str = cfstring_create_with_string (XCAR (key));
3725 if (key_str == NULL) 3764 if (key_str == NULL)
3726 goto out; 3765 goto out;
3727 plist = CFDictionaryGetValue (plist, key_str); 3766 plist = CFDictionaryGetValue (plist, key_str);
@@ -4167,6 +4206,29 @@ init_mac_osx_environment ()
4167} 4206}
4168#endif /* MAC_OSX */ 4207#endif /* MAC_OSX */
4169 4208
4209
4210static Lisp_Object
4211mac_get_system_locale ()
4212{
4213 OSErr err;
4214 LangCode lang;
4215 RegionCode region;
4216 LocaleRef locale;
4217 Str255 str;
4218
4219 lang = GetScriptVariable (smSystemScript, smScriptLang);
4220 region = GetScriptManagerVariable (smRegionCode);
4221 err = LocaleRefFromLangOrRegionCode (lang, region, &locale);
4222 if (err == noErr)
4223 err = LocaleRefGetPartString (locale, kLocaleAllPartsMask,
4224 sizeof (str), str);
4225 if (err == noErr)
4226 return build_string (str);
4227 else
4228 return Qnil;
4229}
4230
4231
4170void 4232void
4171syms_of_mac () 4233syms_of_mac ()
4172{ 4234{
@@ -4197,6 +4259,16 @@ syms_of_mac ()
4197 defsubr (&Sdo_applescript); 4259 defsubr (&Sdo_applescript);
4198 defsubr (&Smac_file_name_to_posix); 4260 defsubr (&Smac_file_name_to_posix);
4199 defsubr (&Sposix_file_name_to_mac); 4261 defsubr (&Sposix_file_name_to_mac);
4262
4263 DEFVAR_INT ("mac-system-script-code", &mac_system_script_code,
4264 doc: /* The system script code. */);
4265 mac_system_script_code = (ScriptCode) GetScriptManagerVariable (smSysScript);
4266
4267 DEFVAR_LISP ("mac-system-locale", &Vmac_system_locale,
4268 doc: /* The system locale identifier string.
4269This is not a POSIX locale ID, but an ICU locale ID. So encoding
4270information is not included. */);
4271 Vmac_system_locale = mac_get_system_locale ();
4200} 4272}
4201 4273
4202/* arch-tag: 29d30c1f-0c6b-4f88-8a6d-0558d7f9dbff 4274/* arch-tag: 29d30c1f-0c6b-4f88-8a6d-0558d7f9dbff
diff --git a/src/macfns.c b/src/macfns.c
index 357f993b0f9..b85c4f01795 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -1895,7 +1895,7 @@ x_set_name (f, name, explicit)
1895#if TARGET_API_MAC_CARBON 1895#if TARGET_API_MAC_CARBON
1896 name = ENCODE_UTF_8 (name); 1896 name = ENCODE_UTF_8 (name);
1897#else 1897#else
1898 return; 1898 name = ENCODE_SYSTEM (name);
1899#endif 1899#endif
1900 1900
1901 BLOCK_INPUT; 1901 BLOCK_INPUT;
@@ -1977,7 +1977,7 @@ x_set_title (f, name, old_name)
1977#if TARGET_API_MAC_CARBON 1977#if TARGET_API_MAC_CARBON
1978 name = ENCODE_UTF_8 (name); 1978 name = ENCODE_UTF_8 (name);
1979#else 1979#else
1980 return; 1980 name = ENCODE_SYSTEM (name);
1981#endif 1981#endif
1982 1982
1983 BLOCK_INPUT; 1983 BLOCK_INPUT;
@@ -3637,9 +3637,6 @@ x_create_tip_frame (dpyinfo, parms, text)
3637 3637
3638 check_mac (); 3638 check_mac ();
3639 3639
3640 /* Use this general default value to start with until we know if
3641 this frame has a specified name. */
3642 Vx_resource_name = Vinvocation_name;
3643 3640
3644#ifdef MULTI_KBOARD 3641#ifdef MULTI_KBOARD
3645 kb = dpyinfo->kboard; 3642 kb = dpyinfo->kboard;
@@ -3653,7 +3650,6 @@ x_create_tip_frame (dpyinfo, parms, text)
3653 && !EQ (name, Qunbound) 3650 && !EQ (name, Qunbound)
3654 && !NILP (name)) 3651 && !NILP (name))
3655 error ("Invalid frame name--not a string or nil"); 3652 error ("Invalid frame name--not a string or nil");
3656 Vx_resource_name = name;
3657 3653
3658 frame = Qnil; 3654 frame = Qnil;
3659 GCPRO3 (parms, name, frame); 3655 GCPRO3 (parms, name, frame);
@@ -4252,8 +4248,7 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */)
4252 options.optionFlags |= kNavSelectAllReadableItem; 4248 options.optionFlags |= kNavSelectAllReadableItem;
4253 if (!NILP(prompt)) 4249 if (!NILP(prompt))
4254 { 4250 {
4255 message = 4251 message = cfstring_create_with_string (prompt);
4256 cfstring_create_with_utf8_cstring (SDATA (ENCODE_UTF_8 (prompt)));
4257 options.message = message; 4252 options.message = message;
4258 } 4253 }
4259 /* Don't set the application, let it use default. 4254 /* Don't set the application, let it use default.
@@ -4362,7 +4357,12 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */)
4362 filename[len++] = '/'; 4357 filename[len++] = '/';
4363 CFStringGetCString(reply.saveFileName, filename+len, 4358 CFStringGetCString(reply.saveFileName, filename+len,
4364 sizeof (filename) - len, 4359 sizeof (filename) - len,
4365 kCFStringEncodingUTF8); 4360#if MAC_OSX
4361 kCFStringEncodingUTF8
4362#else
4363 CFStringGetSystemEncoding ()
4364#endif
4365 );
4366 } 4366 }
4367 file = DECODE_FILE (make_unibyte_string (filename, 4367 file = DECODE_FILE (make_unibyte_string (filename,
4368 strlen (filename))); 4368 strlen (filename)));
diff --git a/src/macterm.c b/src/macterm.c
index 569c728f80e..5aab6ec5364 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -95,6 +95,7 @@ Boston, MA 02111-1307, USA. */
95 : controlKey) 95 : controlKey)
96#define macAltKey (NILP (Vmac_command_key_is_meta) ? cmdKey : optionKey) 96#define macAltKey (NILP (Vmac_command_key_is_meta) ? cmdKey : optionKey)
97 97
98#define mac_window_to_frame(wp) (((mac_output *) GetWRefCon (wp))->mFP)
98 99
99 100
100/* Non-nil means Emacs uses toolkit scroll bars. */ 101/* Non-nil means Emacs uses toolkit scroll bars. */
@@ -110,9 +111,8 @@ Lisp_Object Vmac_use_core_graphics;
110 111
111static int any_help_event_p; 112static int any_help_event_p;
112 113
113/* Non-zero means autoselect window with the mouse cursor. */ 114/* Last window where we saw the mouse. Used by mouse-autoselect-window. */
114 115static Lisp_Object last_window;
115int x_autoselect_window_p;
116 116
117/* Non-zero means make use of UNDERLINE_POSITION font properties. */ 117/* Non-zero means make use of UNDERLINE_POSITION font properties. */
118 118
@@ -273,14 +273,16 @@ static void x_font_min_bounds P_ ((XFontStruct *, int *, int *));
273static int x_compute_min_glyph_bounds P_ ((struct frame *)); 273static int x_compute_min_glyph_bounds P_ ((struct frame *));
274static void x_update_end P_ ((struct frame *)); 274static void x_update_end P_ ((struct frame *));
275static void XTframe_up_to_date P_ ((struct frame *)); 275static void XTframe_up_to_date P_ ((struct frame *));
276static void XTreassert_line_highlight P_ ((int, int));
277static void x_change_line_highlight P_ ((int, int, int, int));
278static void XTset_terminal_modes P_ ((void)); 276static void XTset_terminal_modes P_ ((void));
279static void XTreset_terminal_modes P_ ((void)); 277static void XTreset_terminal_modes P_ ((void));
280static void x_clear_frame P_ ((void)); 278static void x_clear_frame P_ ((void));
281static void frame_highlight P_ ((struct frame *)); 279static void frame_highlight P_ ((struct frame *));
282static void frame_unhighlight P_ ((struct frame *)); 280static void frame_unhighlight P_ ((struct frame *));
283static void x_new_focus_frame P_ ((struct x_display_info *, struct frame *)); 281static void x_new_focus_frame P_ ((struct x_display_info *, struct frame *));
282static void mac_focus_changed P_ ((int, struct mac_display_info *,
283 struct frame *, struct input_event *));
284static void x_detect_focus_change P_ ((struct mac_display_info *,
285 EventRecord *, struct input_event *));
284static void XTframe_rehighlight P_ ((struct frame *)); 286static void XTframe_rehighlight P_ ((struct frame *));
285static void x_frame_rehighlight P_ ((struct x_display_info *)); 287static void x_frame_rehighlight P_ ((struct x_display_info *));
286static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *)); 288static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *));
@@ -1198,15 +1200,6 @@ XSetFont (display, gc, font)
1198} 1200}
1199 1201
1200 1202
1201static void
1202XTextExtents16 (XFontStruct *font, XChar2b *text, int nchars,
1203 int *direction,int *font_ascent,
1204 int *font_descent, XCharStruct *cs)
1205{
1206 /* MAC_TODO: Use GetTextMetrics to do this and inline it below. */
1207}
1208
1209
1210/* x_sync is a no-op on Mac. */ 1203/* x_sync is a no-op on Mac. */
1211void 1204void
1212x_sync (f) 1205x_sync (f)
@@ -3494,6 +3487,14 @@ static void
3494frame_highlight (f) 3487frame_highlight (f)
3495 struct frame *f; 3488 struct frame *f;
3496{ 3489{
3490 OSErr err;
3491 ControlRef root_control;
3492
3493 BLOCK_INPUT;
3494 err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
3495 if (err == noErr)
3496 ActivateControl (root_control);
3497 UNBLOCK_INPUT;
3497 x_update_cursor (f, 1); 3498 x_update_cursor (f, 1);
3498} 3499}
3499 3500
@@ -3501,6 +3502,14 @@ static void
3501frame_unhighlight (f) 3502frame_unhighlight (f)
3502 struct frame *f; 3503 struct frame *f;
3503{ 3504{
3505 OSErr err;
3506 ControlRef root_control;
3507
3508 BLOCK_INPUT;
3509 err = GetRootControl (FRAME_MAC_WINDOW (f), &root_control);
3510 if (err == noErr)
3511 DeactivateControl (root_control);
3512 UNBLOCK_INPUT;
3504 x_update_cursor (f, 1); 3513 x_update_cursor (f, 1);
3505} 3514}
3506 3515
@@ -3543,6 +3552,68 @@ x_new_focus_frame (dpyinfo, frame)
3543 x_frame_rehighlight (dpyinfo); 3552 x_frame_rehighlight (dpyinfo);
3544} 3553}
3545 3554
3555/* Handle FocusIn and FocusOut state changes for FRAME.
3556 If FRAME has focus and there exists more than one frame, puts
3557 a FOCUS_IN_EVENT into *BUFP. */
3558
3559static void
3560mac_focus_changed (type, dpyinfo, frame, bufp)
3561 int type;
3562 struct mac_display_info *dpyinfo;
3563 struct frame *frame;
3564 struct input_event *bufp;
3565{
3566 if (type == activeFlag)
3567 {
3568 if (dpyinfo->x_focus_event_frame != frame)
3569 {
3570 x_new_focus_frame (dpyinfo, frame);
3571 dpyinfo->x_focus_event_frame = frame;
3572
3573 /* Don't stop displaying the initial startup message
3574 for a switch-frame event we don't need. */
3575 if (GC_NILP (Vterminal_frame)
3576 && GC_CONSP (Vframe_list)
3577 && !GC_NILP (XCDR (Vframe_list)))
3578 {
3579 bufp->kind = FOCUS_IN_EVENT;
3580 XSETFRAME (bufp->frame_or_window, frame);
3581 }
3582 }
3583 }
3584 else
3585 {
3586 if (dpyinfo->x_focus_event_frame == frame)
3587 {
3588 dpyinfo->x_focus_event_frame = 0;
3589 x_new_focus_frame (dpyinfo, 0);
3590 }
3591 }
3592}
3593
3594/* The focus may have changed. Figure out if it is a real focus change,
3595 by checking both FocusIn/Out and Enter/LeaveNotify events.
3596
3597 Returns FOCUS_IN_EVENT event in *BUFP. */
3598
3599static void
3600x_detect_focus_change (dpyinfo, event, bufp)
3601 struct mac_display_info *dpyinfo;
3602 EventRecord *event;
3603 struct input_event *bufp;
3604{
3605 struct frame *frame;
3606
3607 frame = mac_window_to_frame ((WindowPtr) event->message);
3608 if (! frame)
3609 return;
3610
3611 /* On Mac, this is only called from focus events, so no switch needed. */
3612 mac_focus_changed ((event->modifiers & activeFlag),
3613 dpyinfo, frame, bufp);
3614}
3615
3616
3546/* Handle an event saying the mouse has moved out of an Emacs frame. */ 3617/* Handle an event saying the mouse has moved out of an Emacs frame. */
3547 3618
3548void 3619void
@@ -3980,25 +4051,19 @@ remember_mouse_glyph (f1, gx, gy)
3980} 4051}
3981 4052
3982 4053
3983static WindowPtr 4054static struct frame *
3984front_emacs_window () 4055mac_focus_frame (dpyinfo)
4056 struct mac_display_info *dpyinfo;
3985{ 4057{
3986#if TARGET_API_MAC_CARBON 4058 if (dpyinfo->x_focus_frame)
3987 WindowPtr wp = GetFrontWindowOfClass (kDocumentWindowClass, true); 4059 return dpyinfo->x_focus_frame;
3988 4060 else
3989 while (wp && !is_emacs_window (wp)) 4061 /* Mac version may get events, such as a menu bar click, even when
3990 wp = GetNextWindowOfClass (wp, kDocumentWindowClass, true); 4062 all the frames are invisible. In this case, we regard the
3991#else 4063 event came to the selected frame. */
3992 WindowPtr wp = FrontWindow (); 4064 return SELECTED_FRAME ();
3993
3994 while (wp && (wp == tip_window || !is_emacs_window (wp)))
3995 wp = GetNextWindow (wp);
3996#endif
3997
3998 return wp;
3999} 4065}
4000 4066
4001#define mac_window_to_frame(wp) (((mac_output *) GetWRefCon (wp))->mFP)
4002 4067
4003/* Return the current position of the mouse. 4068/* Return the current position of the mouse.
4004 *fp should be a frame which indicates which display to ask about. 4069 *fp should be a frame which indicates which display to ask about.
@@ -4031,13 +4096,10 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time)
4031{ 4096{
4032 Point mouse_pos; 4097 Point mouse_pos;
4033 int ignore1, ignore2; 4098 int ignore1, ignore2;
4034 WindowPtr wp = front_emacs_window (); 4099 struct frame *f = mac_focus_frame (FRAME_MAC_DISPLAY_INFO (*fp));
4035 struct frame *f; 4100 WindowPtr wp = FRAME_MAC_WINDOW (f);
4036 Lisp_Object frame, tail; 4101 Lisp_Object frame, tail;
4037 4102
4038 if (is_emacs_window(wp))
4039 f = mac_window_to_frame (wp);
4040
4041 BLOCK_INPUT; 4103 BLOCK_INPUT;
4042 4104
4043 if (! NILP (last_mouse_scroll_bar) && insist == 0) 4105 if (! NILP (last_mouse_scroll_bar) && insist == 0)
@@ -4604,7 +4666,12 @@ x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
4604 unsigned long *time; 4666 unsigned long *time;
4605{ 4667{
4606 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); 4668 struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar);
4607 WindowPtr wp = front_emacs_window (); 4669 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
4670#if TARGET_API_MAC_CARBON
4671 WindowPtr wp = GetControlOwner (ch);
4672#else
4673 WindowPtr wp = (*ch)->contrlOwner;
4674#endif
4608 Point mouse_pos; 4675 Point mouse_pos;
4609 struct frame *f = mac_window_to_frame (wp); 4676 struct frame *f = mac_window_to_frame (wp);
4610 int win_y, top_range; 4677 int win_y, top_range;
@@ -5050,7 +5117,7 @@ x_new_fontset (f, fontsetname)
5050 return Qnil; 5117 return Qnil;
5051 5118
5052 /* Since x_new_font doesn't update any fontset information, do it now. */ 5119 /* Since x_new_font doesn't update any fontset information, do it now. */
5053 FRAME_FONTSET(f) = fontset; 5120 FRAME_FONTSET (f) = fontset;
5054 5121
5055 return build_string (fontsetname); 5122 return build_string (fontsetname);
5056} 5123}
@@ -5498,6 +5565,13 @@ x_make_frame_invisible (f)
5498 5565
5499 BLOCK_INPUT; 5566 BLOCK_INPUT;
5500 5567
5568 /* Before unmapping the window, update the WM_SIZE_HINTS property to claim
5569 that the current position of the window is user-specified, rather than
5570 program-specified, so that when the window is mapped again, it will be
5571 placed at the same location, without forcing the user to position it
5572 by hand again (they have already done that once for this window.) */
5573 x_wm_set_size_hint (f, (long) 0, 1);
5574
5501 HideWindow (FRAME_MAC_WINDOW (f)); 5575 HideWindow (FRAME_MAC_WINDOW (f));
5502 5576
5503 /* We can't distinguish this from iconification 5577 /* We can't distinguish this from iconification
@@ -7070,7 +7144,6 @@ x_find_ccl_program (fontp)
7070#include <Dialogs.h> 7144#include <Dialogs.h>
7071#include <Script.h> 7145#include <Script.h>
7072#include <Types.h> 7146#include <Types.h>
7073#include <TextEncodingConverter.h>
7074#include <Resources.h> 7147#include <Resources.h>
7075 7148
7076#if __MWERKS__ 7149#if __MWERKS__
@@ -7146,11 +7219,6 @@ Lisp_Object Vmac_pass_command_to_system;
7146Lisp_Object Vmac_pass_control_to_system; 7219Lisp_Object Vmac_pass_control_to_system;
7147#endif 7220#endif
7148 7221
7149/* convert input from Mac keyboard (assumed to be in Mac Roman coding)
7150 to this text encoding */
7151int mac_keyboard_text_encoding;
7152int current_mac_keyboard_text_encoding = kTextEncodingMacRoman;
7153
7154/* Set in term/mac-win.el to indicate that event loop can now generate 7222/* Set in term/mac-win.el to indicate that event loop can now generate
7155 drag and drop events. */ 7223 drag and drop events. */
7156Lisp_Object Qmac_ready_for_drag_n_drop; 7224Lisp_Object Qmac_ready_for_drag_n_drop;
@@ -7460,21 +7528,6 @@ do_app_resume ()
7460{ 7528{
7461 /* Window-activate events will do the job. */ 7529 /* Window-activate events will do the job. */
7462#if 0 7530#if 0
7463 WindowPtr wp;
7464 struct frame *f;
7465
7466 wp = front_emacs_window ();
7467 if (wp)
7468 {
7469 f = mac_window_to_frame (wp);
7470
7471 if (f)
7472 {
7473 x_new_focus_frame (FRAME_MAC_DISPLAY_INFO (f), f);
7474 activate_scroll_bars (f);
7475 }
7476 }
7477
7478 app_is_suspended = false; 7531 app_is_suspended = false;
7479 app_sleep_time = WNE_SLEEP_AT_RESUME; 7532 app_sleep_time = WNE_SLEEP_AT_RESUME;
7480#endif 7533#endif
@@ -7485,21 +7538,6 @@ do_app_suspend ()
7485{ 7538{
7486 /* Window-deactivate events will do the job. */ 7539 /* Window-deactivate events will do the job. */
7487#if 0 7540#if 0
7488 WindowPtr wp;
7489 struct frame *f;
7490
7491 wp = front_emacs_window ();
7492 if (wp)
7493 {
7494 f = mac_window_to_frame (wp);
7495
7496 if (f == FRAME_MAC_DISPLAY_INFO (f)->x_focus_frame)
7497 {
7498 x_new_focus_frame (FRAME_MAC_DISPLAY_INFO (f), 0);
7499 deactivate_scroll_bars (f);
7500 }
7501 }
7502
7503 app_is_suspended = true; 7541 app_is_suspended = true;
7504 app_sleep_time = WNE_SLEEP_AT_SUSPEND; 7542 app_sleep_time = WNE_SLEEP_AT_SUSPEND;
7505#endif 7543#endif
@@ -7507,40 +7545,6 @@ do_app_suspend ()
7507 7545
7508 7546
7509static void 7547static void
7510do_mouse_moved (mouse_pos, f)
7511 Point mouse_pos;
7512 FRAME_PTR *f;
7513{
7514 WindowPtr wp = front_emacs_window ();
7515 struct x_display_info *dpyinfo;
7516
7517 if (wp)
7518 {
7519 *f = mac_window_to_frame (wp);
7520 dpyinfo = FRAME_MAC_DISPLAY_INFO (*f);
7521
7522 if (dpyinfo->mouse_face_hidden)
7523 {
7524 dpyinfo->mouse_face_hidden = 0;
7525 clear_mouse_face (dpyinfo);
7526 }
7527
7528 SetPortWindowPort (wp);
7529
7530 GlobalToLocal (&mouse_pos);
7531
7532 if (dpyinfo->grabbed && tracked_scroll_bar)
7533 x_scroll_bar_note_movement (tracked_scroll_bar,
7534 mouse_pos.v
7535 - XINT (tracked_scroll_bar->top),
7536 TickCount() * (1000 / 60));
7537 else
7538 note_mouse_movement (*f, &mouse_pos);
7539 }
7540}
7541
7542
7543static void
7544do_apple_menu (SInt16 menu_item) 7548do_apple_menu (SInt16 menu_item)
7545{ 7549{
7546#if !TARGET_API_MAC_CARBON 7550#if !TARGET_API_MAC_CARBON
@@ -7576,7 +7580,7 @@ do_menu_choice (SInt32 menu_choice)
7576 7580
7577 default: 7581 default:
7578 { 7582 {
7579 struct frame *f = mac_window_to_frame (front_emacs_window ()); 7583 struct frame *f = mac_focus_frame (&one_mac_display_info);
7580 MenuHandle menu = GetMenuHandle (menu_id); 7584 MenuHandle menu = GetMenuHandle (menu_id);
7581 if (menu) 7585 if (menu)
7582 { 7586 {
@@ -7654,13 +7658,14 @@ do_zoom_window (WindowPtr w, int zoom_in_or_out)
7654 Point top_left; 7658 Point top_left;
7655 int w_title_height, columns, rows, width, height; 7659 int w_title_height, columns, rows, width, height;
7656 struct frame *f = mac_window_to_frame (w); 7660 struct frame *f = mac_window_to_frame (w);
7661 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
7657 7662
7658#if TARGET_API_MAC_CARBON 7663#if TARGET_API_MAC_CARBON
7659 { 7664 {
7660 Point standard_size; 7665 Point standard_size;
7661 7666
7662 standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS); 7667 standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS);
7663 standard_size.v = FRAME_MAC_DISPLAY_INFO (f)->height; 7668 standard_size.v = dpyinfo->height;
7664 7669
7665 if (IsWindowInStandardState (w, &standard_size, &zoom_rect)) 7670 if (IsWindowInStandardState (w, &standard_size, &zoom_rect))
7666 zoom_in_or_out = inZoomIn; 7671 zoom_in_or_out = inZoomIn;
@@ -7716,7 +7721,7 @@ do_zoom_window (WindowPtr w, int zoom_in_or_out)
7716 = zoom_rect; 7721 = zoom_rect;
7717 } 7722 }
7718 7723
7719 ZoomWindow (w, zoom_in_or_out, w == front_emacs_window ()); 7724 ZoomWindow (w, zoom_in_or_out, f == mac_focus_frame (dpyinfo));
7720 7725
7721 SetPort (save_port); 7726 SetPort (save_port);
7722#endif /* not TARGET_API_MAC_CARBON */ 7727#endif /* not TARGET_API_MAC_CARBON */
@@ -8582,10 +8587,13 @@ XTread_socket (sd, expected, hold_quit)
8582 { 8587 {
8583 SInt32 delta; 8588 SInt32 delta;
8584 Point point; 8589 Point point;
8585 WindowPtr window_ptr = front_emacs_window (); 8590 struct frame *f = mac_focus_frame (dpyinfo);
8591 WindowPtr window_ptr;
8586 8592
8587 if (!IsValidWindowPtr (window_ptr)) 8593 if (!f)
8588 { 8594 {
8595 /* Beep if wheel move occurs when all the frames
8596 are invisible. */
8589 SysBeep(1); 8597 SysBeep(1);
8590 break; 8598 break;
8591 } 8599 }
@@ -8601,6 +8609,7 @@ XTread_socket (sd, expected, hold_quit)
8601 inev.modifiers = (mac_event_to_emacs_modifiers (eventRef) 8609 inev.modifiers = (mac_event_to_emacs_modifiers (eventRef)
8602 | ((delta < 0) ? down_modifier 8610 | ((delta < 0) ? down_modifier
8603 : up_modifier)); 8611 : up_modifier));
8612 window_ptr = FRAME_MAC_WINDOW (f);
8604 SetPortWindowPort (window_ptr); 8613 SetPortWindowPort (window_ptr);
8605 GlobalToLocal (&point); 8614 GlobalToLocal (&point);
8606 XSETINT (inev.x, point.h); 8615 XSETINT (inev.x, point.h);
@@ -8659,14 +8668,14 @@ XTread_socket (sd, expected, hold_quit)
8659 switch (part_code) 8668 switch (part_code)
8660 { 8669 {
8661 case inMenuBar: 8670 case inMenuBar:
8662 f = mac_window_to_frame (front_emacs_window ()); 8671 f = mac_focus_frame (dpyinfo);
8663 saved_menu_event_location = er.where; 8672 saved_menu_event_location = er.where;
8664 inev.kind = MENU_BAR_ACTIVATE_EVENT; 8673 inev.kind = MENU_BAR_ACTIVATE_EVENT;
8665 XSETFRAME (inev.frame_or_window, f); 8674 XSETFRAME (inev.frame_or_window, f);
8666 break; 8675 break;
8667 8676
8668 case inContent: 8677 case inContent:
8669 if (window_ptr != front_emacs_window ()) 8678 if (window_ptr != FRAME_MAC_WINDOW (mac_focus_frame (dpyinfo)))
8670 SelectWindow (window_ptr); 8679 SelectWindow (window_ptr);
8671 else 8680 else
8672 { 8681 {
@@ -8857,7 +8866,61 @@ XTread_socket (sd, expected, hold_quit)
8857 help_echo_string = help_echo_object = help_echo_window = Qnil; 8866 help_echo_string = help_echo_object = help_echo_window = Qnil;
8858 help_echo_pos = -1; 8867 help_echo_pos = -1;
8859 8868
8860 do_mouse_moved (er.where, &f); 8869 if (dpyinfo->grabbed && last_mouse_frame
8870 && FRAME_LIVE_P (last_mouse_frame))
8871 f = last_mouse_frame;
8872 else
8873 f = dpyinfo->x_focus_frame;
8874
8875 if (dpyinfo->mouse_face_hidden)
8876 {
8877 dpyinfo->mouse_face_hidden = 0;
8878 clear_mouse_face (dpyinfo);
8879 }
8880
8881 if (f)
8882 {
8883 WindowPtr wp = FRAME_MAC_WINDOW (f);
8884 Point mouse_pos = er.where;
8885
8886 SetPortWindowPort (wp);
8887
8888 GlobalToLocal (&mouse_pos);
8889
8890 if (dpyinfo->grabbed && tracked_scroll_bar)
8891 x_scroll_bar_note_movement (tracked_scroll_bar,
8892 mouse_pos.v
8893 - XINT (tracked_scroll_bar->top),
8894 TickCount() * (1000 / 60));
8895 else
8896 {
8897 /* Generate SELECT_WINDOW_EVENTs when needed. */
8898 if (mouse_autoselect_window)
8899 {
8900 Lisp_Object window;
8901
8902 window = window_from_coordinates (f,
8903 mouse_pos.h,
8904 mouse_pos.v,
8905 0, 0, 0, 0);
8906
8907 /* Window will be selected only when it is
8908 not selected now and last mouse movement
8909 event was not in it. Minibuffer window
8910 will be selected iff it is active. */
8911 if (WINDOWP (window)
8912 && !EQ (window, last_window)
8913 && !EQ (window, selected_window))
8914 {
8915 inev.kind = SELECT_WINDOW_EVENT;
8916 inev.frame_or_window = window;
8917 }
8918
8919 last_window=window;
8920 }
8921 note_mouse_movement (f, &mouse_pos);
8922 }
8923 }
8861 8924
8862 /* If the contents of the global variable 8925 /* If the contents of the global variable
8863 help_echo_string has changed, generate a 8926 help_echo_string has changed, generate a
@@ -8871,7 +8934,6 @@ XTread_socket (sd, expected, hold_quit)
8871 case activateEvt: 8934 case activateEvt:
8872 { 8935 {
8873 WindowPtr window_ptr = (WindowPtr) er.message; 8936 WindowPtr window_ptr = (WindowPtr) er.message;
8874 ControlRef root_control;
8875 8937
8876#if USE_CARBON_EVENTS 8938#if USE_CARBON_EVENTS
8877 if (SendEventToEventTarget (eventRef, toolbox_dispatcher) 8939 if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
@@ -8887,16 +8949,12 @@ XTread_socket (sd, expected, hold_quit)
8887 if (!is_emacs_window (window_ptr)) 8949 if (!is_emacs_window (window_ptr))
8888 break; 8950 break;
8889 8951
8890 f = mac_window_to_frame (window_ptr);
8891 GetRootControl (window_ptr, &root_control);
8892
8893 if ((er.modifiers & activeFlag) != 0) 8952 if ((er.modifiers & activeFlag) != 0)
8894 { 8953 {
8895 /* A window has been activated */ 8954 /* A window has been activated */
8896 Point mouse_loc = er.where; 8955 Point mouse_loc = er.where;
8897 8956
8898 x_new_focus_frame (dpyinfo, f); 8957 x_detect_focus_change (dpyinfo, &er, &inev);
8899 ActivateControl (root_control);
8900 8958
8901 SetPortWindowPort (window_ptr); 8959 SetPortWindowPort (window_ptr);
8902 GlobalToLocal (&mouse_loc); 8960 GlobalToLocal (&mouse_loc);
@@ -8910,13 +8968,9 @@ XTread_socket (sd, expected, hold_quit)
8910 /* A window has been deactivated */ 8968 /* A window has been deactivated */
8911 dpyinfo->grabbed = 0; 8969 dpyinfo->grabbed = 0;
8912 8970
8913 if (f == dpyinfo->x_focus_frame) 8971 x_detect_focus_change (dpyinfo, &er, &inev);
8914 {
8915 x_new_focus_frame (dpyinfo, 0);
8916 DeactivateControl (root_control);
8917 }
8918
8919 8972
8973 f = mac_window_to_frame (window_ptr);
8920 if (f == dpyinfo->mouse_face_mouse_frame) 8974 if (f == dpyinfo->mouse_face_mouse_frame)
8921 { 8975 {
8922 /* If we move outside the frame, then we're 8976 /* If we move outside the frame, then we're
@@ -8957,13 +9011,31 @@ XTread_socket (sd, expected, hold_quit)
8957 break; 9011 break;
8958#endif 9012#endif
8959 9013
8960#if TARGET_API_MAC_CARBON 9014 if (dpyinfo->x_focus_frame == NULL)
8961 if (!IsValidWindowPtr (front_emacs_window ()))
8962 { 9015 {
9016 /* Beep if keyboard input occurs when all the frames
9017 are invisible. */
8963 SysBeep (1); 9018 SysBeep (1);
8964 break; 9019 break;
8965 } 9020 }
8966#endif 9021
9022 {
9023 static SInt16 last_key_script = -1;
9024 SInt16 current_key_script = GetScriptManagerVariable (smKeyScript);
9025
9026 if (last_key_script != current_key_script)
9027 {
9028 struct input_event event;
9029
9030 EVENT_INIT (event);
9031 event.kind = LANGUAGE_CHANGE_EVENT;
9032 event.arg = Qnil;
9033 event.code = current_key_script;
9034 kbd_buffer_store_event (&event);
9035 count++;
9036 }
9037 last_key_script = current_key_script;
9038 }
8967 9039
8968 ObscureCursor (); 9040 ObscureCursor ();
8969 9041
@@ -8998,95 +9070,32 @@ XTread_socket (sd, expected, hold_quit)
8998 unsigned long some_state = 0; 9070 unsigned long some_state = 0;
8999 inev.code = KeyTranslate (kchr_ptr, new_keycode, 9071 inev.code = KeyTranslate (kchr_ptr, new_keycode,
9000 &some_state) & 0xff; 9072 &some_state) & 0xff;
9001 } else if (!NILP(Vmac_option_modifier) && (er.modifiers & optionKey)) 9073 }
9002 { 9074 else if (!NILP (Vmac_option_modifier)
9003 /* When using the option key as an emacs modifier, convert 9075 && (er.modifiers & optionKey))
9004 the pressed key code back to one without the Mac option 9076 {
9005 modifier applied. */ 9077 /* When using the option key as an emacs modifier,
9006 int new_modifiers = er.modifiers & ~optionKey; 9078 convert the pressed key code back to one
9007 int new_keycode = keycode | new_modifiers; 9079 without the Mac option modifier applied. */
9008 Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache); 9080 int new_modifiers = er.modifiers & ~optionKey;
9009 unsigned long some_state = 0; 9081 int new_keycode = keycode | new_modifiers;
9010 inev.code = KeyTranslate (kchr_ptr, new_keycode, 9082 Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache);
9011 &some_state) & 0xff; 9083 unsigned long some_state = 0;
9012 } 9084 inev.code = KeyTranslate (kchr_ptr, new_keycode,
9085 &some_state) & 0xff;
9086 }
9013 else 9087 else
9014 inev.code = er.message & charCodeMask; 9088 inev.code = er.message & charCodeMask;
9015 inev.kind = ASCII_KEYSTROKE_EVENT; 9089 inev.kind = ASCII_KEYSTROKE_EVENT;
9016 } 9090 }
9017 } 9091 }
9018 9092
9019 /* If variable mac-convert-keyboard-input-to-latin-1 is
9020 non-nil, convert non-ASCII characters typed at the Mac
9021 keyboard (presumed to be in the Mac Roman encoding) to
9022 iso-latin-1 encoding before they are passed to Emacs.
9023 This enables the Mac keyboard to be used to enter
9024 non-ASCII iso-latin-1 characters directly. */
9025 if (mac_keyboard_text_encoding != kTextEncodingMacRoman
9026 && inev.kind == ASCII_KEYSTROKE_EVENT && inev.code >= 128)
9027 {
9028 static TECObjectRef converter = NULL;
9029 OSStatus the_err = noErr;
9030 OSStatus convert_status = noErr;
9031
9032 if (converter == NULL)
9033 {
9034 the_err = TECCreateConverter (&converter,
9035 kTextEncodingMacRoman,
9036 mac_keyboard_text_encoding);
9037 current_mac_keyboard_text_encoding
9038 = mac_keyboard_text_encoding;
9039 }
9040 else if (mac_keyboard_text_encoding
9041 != current_mac_keyboard_text_encoding)
9042 {
9043 /* Free the converter for the current encoding
9044 before creating a new one. */
9045 TECDisposeConverter (converter);
9046 the_err = TECCreateConverter (&converter,
9047 kTextEncodingMacRoman,
9048 mac_keyboard_text_encoding);
9049 current_mac_keyboard_text_encoding
9050 = mac_keyboard_text_encoding;
9051 }
9052
9053 if (the_err == noErr)
9054 {
9055 unsigned char ch = inev.code;
9056 ByteCount actual_input_length, actual_output_length;
9057 unsigned char outbuf[32];
9058
9059 convert_status = TECConvertText (converter, &ch, 1,
9060 &actual_input_length,
9061 outbuf, 1,
9062 &actual_output_length);
9063 if (convert_status == noErr
9064 && actual_input_length == 1
9065 && actual_output_length == 1)
9066 inev.code = *outbuf;
9067
9068 /* Reset internal states of the converter object.
9069 If it fails, create another one. */
9070 convert_status = TECFlushText (converter, outbuf,
9071 sizeof (outbuf),
9072 &actual_output_length);
9073 if (convert_status != noErr)
9074 {
9075 TECDisposeConverter (converter);
9076 TECCreateConverter (&converter,
9077 kTextEncodingMacRoman,
9078 mac_keyboard_text_encoding);
9079 }
9080 }
9081 }
9082
9083#if USE_CARBON_EVENTS 9093#if USE_CARBON_EVENTS
9084 inev.modifiers = mac_event_to_emacs_modifiers (eventRef); 9094 inev.modifiers = mac_event_to_emacs_modifiers (eventRef);
9085#else 9095#else
9086 inev.modifiers = mac_to_emacs_modifiers (er.modifiers); 9096 inev.modifiers = mac_to_emacs_modifiers (er.modifiers);
9087#endif 9097#endif
9088 XSETFRAME (inev.frame_or_window, 9098 XSETFRAME (inev.frame_or_window, mac_focus_frame (dpyinfo));
9089 mac_window_to_frame (front_emacs_window ()));
9090 inev.timestamp = er.when * (1000 / 60); /* ticks to milliseconds */ 9099 inev.timestamp = er.when * (1000 / 60); /* ticks to milliseconds */
9091 break; 9100 break;
9092 9101
@@ -9099,22 +9108,10 @@ XTread_socket (sd, expected, hold_quit)
9099 constuct_drag_n_drop in w32term.c. */ 9108 constuct_drag_n_drop in w32term.c. */
9100 if (!NILP (drag_and_drop_file_list)) 9109 if (!NILP (drag_and_drop_file_list))
9101 { 9110 {
9102 struct frame *f = NULL; 9111 struct frame *f = mac_focus_frame (dpyinfo);
9103 WindowPtr wp; 9112 WindowPtr wp;
9104 Lisp_Object frame; 9113 Lisp_Object frame;
9105 9114
9106 wp = front_emacs_window ();
9107
9108 if (!wp)
9109 {
9110 struct frame *f = XFRAME (XCAR (Vframe_list));
9111 CollapseWindow (FRAME_MAC_WINDOW (f), false);
9112 wp = front_emacs_window ();
9113 }
9114
9115 if (wp)
9116 f = mac_window_to_frame (wp);
9117
9118 inev.kind = DRAG_N_DROP_EVENT; 9115 inev.kind = DRAG_N_DROP_EVENT;
9119 inev.code = 0; 9116 inev.code = 0;
9120 inev.timestamp = er.when * (1000 / 60); 9117 inev.timestamp = er.when * (1000 / 60);
@@ -9131,10 +9128,12 @@ XTread_socket (sd, expected, hold_quit)
9131 XSETFRAME (frame, f); 9128 XSETFRAME (frame, f);
9132 inev.frame_or_window = Fcons (frame, drag_and_drop_file_list); 9129 inev.frame_or_window = Fcons (frame, drag_and_drop_file_list);
9133 9130
9131#if 0
9134 /* Regardless of whether Emacs was suspended or in the 9132 /* Regardless of whether Emacs was suspended or in the
9135 foreground, ask it to redraw its entire screen. 9133 foreground, ask it to redraw its entire screen.
9136 Otherwise parts of the screen can be left in an 9134 Otherwise parts of the screen can be left in an
9137 inconsistent state. */ 9135 inconsistent state. */
9136 wp = FRAME_MAC_WINDOW (f);
9138 if (wp) 9137 if (wp)
9139#if TARGET_API_MAC_CARBON 9138#if TARGET_API_MAC_CARBON
9140 { 9139 {
@@ -9146,6 +9145,7 @@ XTread_socket (sd, expected, hold_quit)
9146#else /* not TARGET_API_MAC_CARBON */ 9145#else /* not TARGET_API_MAC_CARBON */
9147 InvalRect (&(wp->portRect)); 9146 InvalRect (&(wp->portRect));
9148#endif /* not TARGET_API_MAC_CARBON */ 9147#endif /* not TARGET_API_MAC_CARBON */
9148#endif
9149 } 9149 }
9150 default: 9150 default:
9151 break; 9151 break;
@@ -9625,7 +9625,7 @@ mac_check_for_quit_char ()
9625 e.arg = Qnil; 9625 e.arg = Qnil;
9626 e.modifiers = NULL; 9626 e.modifiers = NULL;
9627 e.timestamp = EventTimeToTicks (GetEventTime (event)) * (1000/60); 9627 e.timestamp = EventTimeToTicks (GetEventTime (event)) * (1000/60);
9628 XSETFRAME (e.frame_or_window, mac_window_to_frame (front_emacs_window ())); 9628 XSETFRAME (e.frame_or_window, mac_focus_frame (&one_mac_display_info));
9629 /* Remove event from queue to prevent looping. */ 9629 /* Remove event from queue to prevent looping. */
9630 RemoveEventFromQueue (GetMainEventQueue (), event); 9630 RemoveEventFromQueue (GetMainEventQueue (), event);
9631 ReleaseEvent (event); 9631 ReleaseEvent (event);
@@ -9819,10 +9819,6 @@ syms_of_macterm ()
9819 Qeuc_kr = intern ("euc-kr"); 9819 Qeuc_kr = intern ("euc-kr");
9820 staticpro (&Qeuc_kr); 9820 staticpro (&Qeuc_kr);
9821 9821
9822 DEFVAR_BOOL ("x-autoselect-window", &x_autoselect_window_p,
9823 doc: /* *Non-nil means autoselect window with mouse pointer. */);
9824 x_autoselect_window_p = 0;
9825
9826 DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, 9822 DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
9827 doc: /* If not nil, Emacs uses toolkit scroll bars. */); 9823 doc: /* If not nil, Emacs uses toolkit scroll bars. */);
9828 Vx_toolkit_scroll_bars = Qt; 9824 Vx_toolkit_scroll_bars = Qt;
@@ -9882,10 +9878,6 @@ Toolbox for processing before Emacs sees it. */);
9882Toolbox for processing before Emacs sees it. */); 9878Toolbox for processing before Emacs sees it. */);
9883 Vmac_pass_control_to_system = Qt; 9879 Vmac_pass_control_to_system = Qt;
9884 9880
9885 DEFVAR_LISP ("mac-pass-control-to-system", &Vmac_pass_control_to_system,
9886 doc: /* If non-nil, the Mac \"Control\" key is passed on to the Mac
9887Toolbox for processing before Emacs sees it. */);
9888 Vmac_pass_control_to_system = Qt;
9889#endif 9881#endif
9890 9882
9891 DEFVAR_LISP ("mac-allow-anti-aliasing", &Vmac_use_core_graphics, 9883 DEFVAR_LISP ("mac-allow-anti-aliasing", &Vmac_use_core_graphics,
@@ -9893,21 +9885,6 @@ Toolbox for processing before Emacs sees it. */);
9893The text will be rendered using Core Graphics text rendering which 9885The text will be rendered using Core Graphics text rendering which
9894may anti-alias the text. */); 9886may anti-alias the text. */);
9895 Vmac_use_core_graphics = Qnil; 9887 Vmac_use_core_graphics = Qnil;
9896
9897 DEFVAR_INT ("mac-keyboard-text-encoding", &mac_keyboard_text_encoding,
9898 doc: /* One of the Text Encoding Base constant values defined in the
9899Basic Text Constants section of Inside Macintosh - Text Encoding
9900Conversion Manager. Its value determines the encoding characters
9901typed at the Mac keyboard (presumed to be in the MacRoman encoding)
9902will convert into. E.g., if it is set to kTextEncodingMacRoman (0),
9903its default value, no conversion takes place. If it is set to
9904kTextEncodingISOLatin1 (0x201) or kTextEncodingISOLatin2 (0x202),
9905characters typed on Mac keyboard are first converted into the
9906ISO Latin-1 or ISO Latin-2 encoding, respectively before being
9907passed to Emacs. Together with Emacs's set-keyboard-coding-system
9908command, this enables the Mac keyboard to be used to enter non-ASCII
9909characters directly. */);
9910 mac_keyboard_text_encoding = kTextEncodingMacRoman;
9911} 9888}
9912 9889
9913/* arch-tag: f2259165-4454-4c04-a029-a133c8af7b5b 9890/* arch-tag: f2259165-4454-4c04-a029-a133c8af7b5b
diff --git a/src/macterm.h b/src/macterm.h
index 3ce3e08947a..705e5d7ac3b 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -195,14 +195,14 @@ struct mac_display_info
195 int bitmaps_last; 195 int bitmaps_last;
196 196
197 /* The frame (if any) which has the window that has keyboard focus. 197 /* The frame (if any) which has the window that has keyboard focus.
198 Zero if none. This is examined by Ffocus_frame in w32fns.c. Note 198 Zero if none. This is examined by Ffocus_frame in macfns.c. Note
199 that a mere EnterNotify event can set this; if you need to know the 199 that a mere EnterNotify event can set this; if you need to know the
200 last frame specified in a FocusIn or FocusOut event, use 200 last frame specified in a FocusIn or FocusOut event, use
201 w32_focus_event_frame. */ 201 x_focus_event_frame. */
202 struct frame *x_focus_frame; 202 struct frame *x_focus_frame;
203 203
204 /* The last frame mentioned in a FocusIn or FocusOut event. This is 204 /* The last frame mentioned in a FocusIn or FocusOut event. This is
205 separate from w32_focus_frame, because whether or not LeaveNotify 205 separate from x_focus_frame, because whether or not LeaveNotify
206 events cause us to lose focus depends on whether or not we have 206 events cause us to lose focus depends on whether or not we have
207 received a FocusIn event for it. */ 207 received a FocusIn event for it. */
208 struct frame *x_focus_event_frame; 208 struct frame *x_focus_event_frame;
@@ -210,7 +210,7 @@ struct mac_display_info
210 /* The frame which currently has the visual highlight, and should get 210 /* The frame which currently has the visual highlight, and should get
211 keyboard input (other sorts of input have the frame encoded in the 211 keyboard input (other sorts of input have the frame encoded in the
212 event). It points to the focus frame's selected window's 212 event). It points to the focus frame's selected window's
213 frame. It differs from w32_focus_frame when we're using a global 213 frame. It differs from x_focus_frame when we're using a global
214 minibuffer. */ 214 minibuffer. */
215 struct frame *x_highlight_frame; 215 struct frame *x_highlight_frame;
216 216
@@ -418,7 +418,7 @@ typedef struct mac_output mac_output;
418 418
419#define FRAME_SIZE_HINTS(f) ((f)->output_data.mac->size_hints) 419#define FRAME_SIZE_HINTS(f) ((f)->output_data.mac->size_hints)
420 420
421/* This gives the w32_display_info structure for the display F is on. */ 421/* This gives the mac_display_info structure for the display F is on. */
422#define FRAME_MAC_DISPLAY_INFO(f) (&one_mac_display_info) 422#define FRAME_MAC_DISPLAY_INFO(f) (&one_mac_display_info)
423#define FRAME_X_DISPLAY_INFO(f) (&one_mac_display_info) 423#define FRAME_X_DISPLAY_INFO(f) (&one_mac_display_info)
424 424
@@ -624,6 +624,7 @@ extern OSErr fsspec_to_posix_pathname P_ ((const FSSpec *, char *, int));
624extern void mac_clear_font_name_table P_ ((void)); 624extern void mac_clear_font_name_table P_ ((void));
625#if TARGET_API_MAC_CARBON 625#if TARGET_API_MAC_CARBON
626extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *)); 626extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *));
627extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object));
627extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef)); 628extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef));
628extern Lisp_Object cfstring_to_lisp P_ ((CFStringRef)); 629extern Lisp_Object cfstring_to_lisp P_ ((CFStringRef));
629extern Lisp_Object cfnumber_to_lisp P_ ((CFNumberRef)); 630extern Lisp_Object cfnumber_to_lisp P_ ((CFNumberRef));
diff --git a/src/term.c b/src/term.c
index 274e453a9d8..bc30e3fb0d8 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1289,7 +1289,26 @@ static struct fkey_table keys[] =
1289 {"k6", "f6"}, 1289 {"k6", "f6"},
1290 {"k7", "f7"}, 1290 {"k7", "f7"},
1291 {"k8", "f8"}, 1291 {"k8", "f8"},
1292 {"k9", "f9"} 1292 {"k9", "f9"},
1293
1294 {"&0", "S-cancel"}, /*shifted cancel key*/
1295 {"&9", "S-begin"}, /*shifted begin key*/
1296 {"*0", "S-find"}, /*shifted find key*/
1297 {"*1", "S-execute"}, /*shifted execute? actually shifted command key*/
1298 {"*4", "S-delete"}, /*shifted delete-character key*/
1299 {"*7", "S-end"}, /*shifted end key*/
1300 {"*8", "S-clearline"}, /*shifted clear-to end-of-line key*/
1301 {"#1", "S-help"}, /*shifted help key*/
1302 {"#2", "S-home"}, /*shifted home key*/
1303 {"#3", "S-insert"}, /*shifted insert-character key*/
1304 {"#4", "S-left"}, /*shifted left-arrow key*/
1305 {"%d", "S-menu"}, /*shifted menu? actually shifted options key*/
1306 {"%c", "S-next"}, /*shifted next key*/
1307 {"%e", "S-prior"}, /*shifted previous key*/
1308 {"%f", "S-print"}, /*shifted print key*/
1309 {"%g", "S-redo"}, /*shifted redo key*/
1310 {"%i", "S-right"}, /*shifted right-arrow key*/
1311 {"!3", "S-undo"} /*shifted undo key*/
1293 }; 1312 };
1294 1313
1295static char **term_get_fkeys_arg; 1314static char **term_get_fkeys_arg;
diff --git a/src/termhooks.h b/src/termhooks.h
index 9aedede55bf..d424ad75e4a 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -103,10 +103,11 @@ enum event_kind
103 the wheel event occurred in. 103 the wheel event occurred in.
104 .timestamp gives a timestamp (in 104 .timestamp gives a timestamp (in
105 milliseconds) for the event. */ 105 milliseconds) for the event. */
106#ifdef WINDOWSNT 106#if defined (WINDOWSNT) || defined (MAC_OS)
107 LANGUAGE_CHANGE_EVENT, /* A LANGUAGE_CHANGE_EVENT is generated 107 LANGUAGE_CHANGE_EVENT, /* A LANGUAGE_CHANGE_EVENT is
108 on WINDOWSNT when the keyboard layout 108 generated on WINDOWSNT or Mac OS
109 or input language is changed by the 109 when the keyboard layout or input
110 language is changed by the
110 user. */ 111 user. */
111#endif 112#endif
112 SCROLL_BAR_CLICK_EVENT, /* .code gives the number of the mouse button 113 SCROLL_BAR_CLICK_EVENT, /* .code gives the number of the mouse button
diff --git a/src/window.c b/src/window.c
index e16416d6fb2..a1b3c879bb5 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1,7 +1,7 @@
1/* Window creation, deletion and examination for GNU Emacs. 1/* Window creation, deletion and examination for GNU Emacs.
2 Does not include redisplay. 2 Does not include redisplay.
3 Copyright (C) 1985,86,87, 1993,94,95,96,97,98, 2000,01,02,03,04 3 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
4 Free Software Foundation, Inc. 4 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
7 7
@@ -5596,7 +5596,20 @@ the return value is nil. Otherwise the value is t. */)
5596 if (XBUFFER (new_current_buffer) == current_buffer) 5596 if (XBUFFER (new_current_buffer) == current_buffer)
5597 old_point = PT; 5597 old_point = PT;
5598 else 5598 else
5599 old_point = BUF_PT (XBUFFER (new_current_buffer)); 5599 /* BUF_PT (XBUFFER (new_current_buffer)) gives us the position of
5600 point in new_current_buffer as of the last time this buffer was
5601 used. This can be non-deterministic since it can be changed by
5602 things like jit-lock by mere temporary selection of some random
5603 window that happens to show this buffer.
5604 So if possible we want this arbitrary choice of "which point" to
5605 be the one from the to-be-selected-window so as to prevent this
5606 window's cursor from being copied from another window. */
5607 if (EQ (XWINDOW (data->current_window)->buffer, new_current_buffer)
5608 /* If current_window = selected_window, its point is in BUF_PT. */
5609 && !EQ (selected_window, data->current_window))
5610 old_point = XMARKER (XWINDOW (data->current_window)->pointm)->charpos;
5611 else
5612 old_point = BUF_PT (XBUFFER (new_current_buffer));
5600 } 5613 }
5601 5614
5602 frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame; 5615 frame = XWINDOW (SAVED_WINDOW_N (saved_windows, 0)->window)->frame;
diff --git a/src/xdisp.c b/src/xdisp.c
index c545b6b2bc2..c832f1fa5e0 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -567,12 +567,21 @@ Lisp_Object Vmessage_log_max;
567 567
568static Lisp_Object Vmessages_buffer_name; 568static Lisp_Object Vmessages_buffer_name;
569 569
570/* Current, index 0, and last displayed echo area message. Either 570/* Index 0 is the buffer that holds the current (desired) echo area message,
571 buffers from echo_buffers, or nil to indicate no message. */ 571 or nil if none is desired right now.
572
573 Index 1 is the buffer that holds the previously displayed echo area message,
574 or nil to indicate no message. This is normally what's on the screen now.
575
576 These two can point to the same buffer. That happens when the last
577 message output by the user (or made by echoing) has been displayed. */
572 578
573Lisp_Object echo_area_buffer[2]; 579Lisp_Object echo_area_buffer[2];
574 580
575/* The buffers referenced from echo_area_buffer. */ 581/* Permanent pointers to the two buffers that are used for echo area
582 purposes. Once the two buffers are made, and their pointers are
583 placed here, these two slots remain unchanged unless those buffers
584 need to be created afresh. */
576 585
577static Lisp_Object echo_buffer[2]; 586static Lisp_Object echo_buffer[2];
578 587
@@ -7213,10 +7222,6 @@ ensure_echo_area_buffers ()
7213 WHICH > 0 means use echo_area_buffer[1]. If that is nil, choose a 7222 WHICH > 0 means use echo_area_buffer[1]. If that is nil, choose a
7214 suitable buffer from echo_buffer[] and clear it. 7223 suitable buffer from echo_buffer[] and clear it.
7215 7224
7216 If WHICH < 0, set echo_area_buffer[1] to echo_area_buffer[0], so
7217 that the current message becomes the last displayed one, make
7218 choose a suitable buffer for echo_area_buffer[0], and clear it.
7219
7220 Value is what FN returns. */ 7225 Value is what FN returns. */
7221 7226
7222static int 7227static int
@@ -7241,17 +7246,6 @@ with_echo_area_buffer (w, which, fn, a1, a2, a3, a4)
7241 this_one = 0, the_other = 1; 7246 this_one = 0, the_other = 1;
7242 else if (which > 0) 7247 else if (which > 0)
7243 this_one = 1, the_other = 0; 7248 this_one = 1, the_other = 0;
7244 else
7245 {
7246 this_one = 0, the_other = 1;
7247 clear_buffer_p = 1;
7248
7249 /* We need a fresh one in case the current echo buffer equals
7250 the one containing the last displayed echo area message. */
7251 if (!NILP (echo_area_buffer[this_one])
7252 && EQ (echo_area_buffer[this_one], echo_area_buffer[the_other]))
7253 echo_area_buffer[this_one] = Qnil;
7254 }
7255 7249
7256 /* Choose a suitable buffer from echo_buffer[] is we don't 7250 /* Choose a suitable buffer from echo_buffer[] is we don't
7257 have one. */ 7251 have one. */
@@ -7871,7 +7865,7 @@ set_message (s, string, nbytes, multibyte_p)
7871 = ((s && multibyte_p) 7865 = ((s && multibyte_p)
7872 || (STRINGP (string) && STRING_MULTIBYTE (string))); 7866 || (STRINGP (string) && STRING_MULTIBYTE (string)));
7873 7867
7874 with_echo_area_buffer (0, -1, set_message_1, 7868 with_echo_area_buffer (0, 0, set_message_1,
7875 (EMACS_INT) s, string, nbytes, multibyte_p); 7869 (EMACS_INT) s, string, nbytes, multibyte_p);
7876 message_buf_print = 0; 7870 message_buf_print = 0;
7877 help_echo_showing_p = 0; 7871 help_echo_showing_p = 0;
@@ -7903,6 +7897,7 @@ set_message_1 (a1, a2, nbytes, multibyte_p)
7903 7897
7904 /* Insert new message at BEG. */ 7898 /* Insert new message at BEG. */
7905 TEMP_SET_PT_BOTH (BEG, BEG_BYTE); 7899 TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
7900 Ferase_buffer ();
7906 7901
7907 if (STRINGP (string)) 7902 if (STRINGP (string))
7908 { 7903 {
@@ -8118,10 +8113,8 @@ echo_area_display (update_frame_p)
8118 else if (!EQ (mini_window, selected_window)) 8113 else if (!EQ (mini_window, selected_window))
8119 windows_or_buffers_changed++; 8114 windows_or_buffers_changed++;
8120 8115
8121 /* Last displayed message is now the current message. */ 8116 /* The current message is now also the last one displayed. */
8122 echo_area_buffer[1] = echo_area_buffer[0]; 8117 echo_area_buffer[1] = echo_area_buffer[0];
8123 /* Inform read_char that we're not echoing. */
8124 echo_message_buffer = Qnil;
8125 8118
8126 /* Prevent redisplay optimization in redisplay_internal by resetting 8119 /* Prevent redisplay optimization in redisplay_internal by resetting
8127 this_line_start_pos. This is done because the mini-buffer now 8120 this_line_start_pos. This is done because the mini-buffer now