aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKaroly Lorentey2004-04-03 20:24:17 +0000
committerKaroly Lorentey2004-04-03 20:24:17 +0000
commit1ba538094c4cd3da172d91878fa76d96c6b1cbd2 (patch)
treed9379406f3598de5db893fd0f01d6ae214a711d1 /lisp
parentb04f5ad2cc0f71e567ec9ee49351f45f0a5faa3a (diff)
parent9f691b0dd903205d12e447c753bcd92741c68707 (diff)
downloademacs-1ba538094c4cd3da172d91878fa76d96c6b1cbd2.tar.gz
emacs-1ba538094c4cd3da172d91878fa76d96c6b1cbd2.zip
Merged in changes from CVS HEAD
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-177 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-178 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-179 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-180 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-131
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog169
-rw-r--r--lisp/Makefile.in8
-rw-r--r--lisp/autorevert.el119
-rw-r--r--lisp/buff-menu.el2
-rw-r--r--lisp/descr-text.el9
-rw-r--r--lisp/dired-aux.el13
-rw-r--r--lisp/dired-x.el3
-rw-r--r--lisp/dired.el23
-rw-r--r--lisp/files.el6
-rw-r--r--lisp/international/characters.el2
-rw-r--r--lisp/international/mule-util.el13
-rw-r--r--lisp/international/ucs-tables.el10
-rw-r--r--lisp/net/browse-url.el6
-rw-r--r--lisp/pcvs.el12
-rw-r--r--lisp/printing.el25
-rw-r--r--lisp/progmodes/compile.el46
-rw-r--r--lisp/progmodes/ebnf-abn.el4
-rw-r--r--lisp/progmodes/ebnf-ebx.el672
-rw-r--r--lisp/progmodes/ebnf2ps.el125
-rw-r--r--lisp/progmodes/gdb-ui.el81
-rw-r--r--lisp/progmodes/gud.el2
-rw-r--r--lisp/subr.el22
-rw-r--r--lisp/vc.el95
-rw-r--r--lisp/x-dnd.el11
24 files changed, 1168 insertions, 310 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3bb9e41cd2c..6e693be77c2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,134 @@
12004-04-03 Juri Linkov <juri@jurta.org>
2
3 * descr-text.el (describe-property-list): Add `font-lock-face'.
4
5 * dired.el (dired-font-lock-keywords): Fix permission regexps.
6
72004-04-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
8
9 * x-dnd.el (x-dnd-handle-moz-url, x-dnd-insert-utf16-text): Use
10 utf-16le on little endian machines and utf-16be otherwise.
11
122004-04-02 David Kastrup <dak@gnu.org>
13
14 * net/browse-url.el (browse-url-generic): Use call-process
15 instead of start-process to allow browsers that fork and detach.
16
172004-04-01 Daniel Pfeiffer <occitan@esperanto.org>
18
19 * compile.el (compilation-current-error): New var.
20 (compilation-setup, compile-mouse-goto-error)
21 (compile-goto-error, next-error): Use it.
22 (compilation-skip-to-next-location): Default to t, which gives
23 contiguous skipping like old compile (where this was redundant).
24 (compilation-next-error): Prevent previous-* commands from moving
25 back to message at or just before point.
26
272004-04-01 Nick Roberts <nick@nick.uklinux.net>
28
29 * progmodes/gdb-ui.el (gdb-view-source-function, gdb-view-assembler)
30 (gdb-source-info): Don't display source at startup, if required.
31 (gdb-show-main): New option.
32 (gdba): Update documentation.
33 (gdb-source): Cover case of auto-display output.
34
352004-03-31 Luc Teirlinck <teirllm@auburn.edu>
36
37 * autorevert.el: Delete obsolete autoload's and defvar's.
38 (auto-revert-check-vc-info): New user option.
39 (auto-revert-vc-cvs-file-version, auto-revert-vc-buffer-p)
40 (auto-revert-handler-vc): Delete.
41 (auto-revert-handler): Treat return value `fast' of
42 buffer-stale-function specially. Check `auto-revert-check-vc-info'.
43
44 * buff-menu.el (Buffer-menu-mode): Make the buffer-stale-function
45 return `fast'.
46
47 * files.el (buffer-stale-function): Doc change.
48
492004-03-31 Vinicius Jose Latorre <viniciusjl@ig.com.br>
50
51 * printing.el: New tip on Tips section.
52 (pr-version): New version number (6.7.4).
53 (pr-shell-file-name): Initialization fix.
54
552004-03-31 Juri Linkov <juri@jurta.org>
56
57 * dired.el: Add autoload for `dired-do-touch'.
58 (dired-touch-program): New var.
59 (dired-mode-map): Bind `dired-do-touch' to T and add menu-item.
60 (dired-no-confirm): Add `touch' to docstring.
61
62 * dired-aux.el (dired-do-touch): New fun.
63 (dired-do-chxxx): Add argument -t for touch operation.
64
65 * dired-x.el (dired-mark-sexp): Replace hard-coded month names by
66 `dired-move-to-filename-regexp'.
67
682004-03-31 H,Ae(Bkan Granath <hakan.granath@kau.se> (tiny change)
69
70 * dired.el (dired-move-to-filename-regexp): Add . to HH:MM.
71
722004-03-30 Vinicius Jose Latorre <viniciusjl@ig.com.br>
73
74 * progmodes/ebnf2ps.el (ebnf-eps-finish-and-write): Write a buffer if
75 and only if the buffer was modified.
76
772004-03-30 Kenichi Handa <handa@m17n.org>
78
79 * international/characters.el: Delete pairs for U+2308..U+230B.
80
812004-03-29 Nick Roberts <nick@nick.uklinux.net>
82
83 * progmodes/gud.el (gud-gdb-marker-filter): Include "\n" in regexp
84 to detect the beginning of a level 2 or 3 annotation.
85
862004-03-29 Kenichi Handa <handa@m17n.org>
87
88 * international/ucs-tables.el (ucs-insert): Fix the error message.
89
902004-03-29 Kenichi Handa <handa@m17n.org>
91
92 * international/mule-util.el (char-displayable-p): Fix generation
93 of XLFD file name.
94
95 * Makefile.in (setwins, setwins_almost): Change directory to $wd
96 before finding directories by `find'.
97
982004-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
99
100 * subr.el (interactive-form): Delete. Now implemented in C.
101
102 * pcvs.el (cvs-parse-process): Workaround for Darwin.
103
104 * vc.el (vc-version-diff, vc-default-diff-tree): Change `rel' -> `rev'.
105 (vc-diff-label): New fun.
106 (vc-diff-internal): Use it.
107
108 * progmodes/gdb-ui.el (gdb-post-prompt): Fix test.
109
1102004-03-28 Vinicius Jose Latorre <viniciusjl@ig.com.br>
111
112 * progmodes/ebnf-abn.el (ebnf-abn-parser): Handle initial comments.
113
114 * progmodes/ebnf-ebx.el: New file, implement a parser for EBNF used to
115 specify XML (EBNFX).
116
117 * progmodes/ebnf2ps.el: Doc fix.
118 (ebnf-version): New version number (4.1).
119 (ebnf-syntax): Adjust customization.
120 (ebnf-style-database): Add ebnfx entry.
121 (ebnf-syntax-alist): Add ebnfx initialization.
122 (ebnf-ebx-parser, ebnf-ebx-initialize): Autoloaded funs from ebnf-ebx.
123
124 * printing.el: Doc fix.
125 (pr-version): New version number (6.7.3).
126 (pr-menu-position): Adjust X and Y positions when mouse-pixel-position
127 returns nil for mouse position. Reported by Drew Adams
128 <drew.adams@oracle.com>.
129 (pr-update-menus): Modify interactive declaration. Reported by Drew
130 Adams <drew.adams@oracle.com>.
131
12004-03-28 Nick Roberts <nick@nick.uklinux.net> 1322004-03-28 Nick Roberts <nick@nick.uklinux.net>
2 133
3 * progmodes/gdb-ui.el (gdb-ann3, gdb-send-item) 134 * progmodes/gdb-ui.el (gdb-ann3, gdb-send-item)
@@ -286,12 +417,14 @@
286 functions. 417 functions.
287 (auto-revert-buffers): Delete call to auto-revert-buffer-p. 418 (auto-revert-buffers): Delete call to auto-revert-buffer-p.
288 419
289 * dired.el (dired-directory-changed-p, dired-buffer-stale-p): New funs. 420 * dired.el (dired-directory-changed-p): New fun, extracted from
421 dired-internal-noselect.
422 (dired-buffer-stale-p): New fun.
290 (dired-internal-noselect): Use dired-directory-changed-p. 423 (dired-internal-noselect): Use dired-directory-changed-p.
291 Eliminate revert messages. 424 Eliminate revert messages.
292 (dired-mode): Set buffer-stale-function to dired-buffer-stale-p. 425 (dired-mode): Set buffer-stale-function to dired-buffer-stale-p.
293 426
2942004-03-23 Kenichi Handa <handa@etlken2> 4272004-03-23 Kenichi Handa <handa@m17n.org>
295 428
296 * international/characters.el: Setup syntaxes for more parentheses 429 * international/characters.el: Setup syntaxes for more parentheses
297 Unicode characters. 430 Unicode characters.
@@ -940,12 +1073,12 @@
940 1073
9412004-02-28 Vinicius Jose Latorre <viniciusjl@ig.com.br> 10742004-02-28 Vinicius Jose Latorre <viniciusjl@ig.com.br>
942 1075
943 * ebnf-abn.el: Doc fix. 1076 * progmodes/ebnf-abn.el: Doc fix.
944 1077
945 * ebnf-bnf.el: Doc fix. 1078 * progmodes/ebnf-bnf.el: Doc fix.
946 (ebnf-repeat): Code fix. 1079 (ebnf-repeat): Code fix.
947 1080
948 * ebnf2ps.el: Doc fix. 1081 * progmodes/ebnf2ps.el: Doc fix.
949 (ebnf-syntax-directory, ebnf-syntax-file): New funs. 1082 (ebnf-syntax-directory, ebnf-syntax-file): New funs.
950 1083
9512004-02-28 Juri Linkov <juri@jurta.org> 10842004-02-28 Juri Linkov <juri@jurta.org>
@@ -1011,8 +1144,8 @@
1011 1144
10122004-02-25 Vinicius Jose Latorre <viniciusjl@ig.com.br> 11452004-02-25 Vinicius Jose Latorre <viniciusjl@ig.com.br>
1013 1146
1014 * ebnf2ps.el: Doc fix. For compatibility with Emacs 20, define 1147 * progmodes/ebnf2ps.el: Doc fix. For compatibility with Emacs 20,
1015 assq-delete-all if it's not defined. 1148 define assq-delete-all if it's not defined.
1016 (ebnf-generate-region): Code fix. 1149 (ebnf-generate-region): Code fix.
1017 1150
1018 * printing.el: Doc fix. 1151 * printing.el: Doc fix.
@@ -1021,12 +1154,13 @@
1021 1154
10222004-02-24 Vinicius Jose Latorre <viniciusjl@ig.com.br> 11552004-02-24 Vinicius Jose Latorre <viniciusjl@ig.com.br>
1023 1156
1024 * ebnf-abn.el: New file, implements an ABNF parser. 1157 * progmodes/ebnf-abn.el: New file, implements an ABNF parser.
1025 1158
1026 * ebnf2ps.el: Doc fix. Accept ABNF (Augmented BNF). New arrow shapes: 1159 * progmodes/ebnf2ps.el: Doc fix. Accept ABNF (Augmented BNF). New
1027 semi-up-hollow, semi-up-full, semi-down-hollow and semi-down-full. 1160 arrow shapes: semi-up-hollow, semi-up-full, semi-down-hollow and
1028 Fix a bug on productions like test = {"test"}* | ( "tt" ["test"] ). 1161 semi-down-full. Fix a bug on productions like test = {"test"}* | (
1029 Reported by Markus Dreyer <mdreyer@ix.urz.uni-heidelberg.de>. 1162 "tt" ["test"] ). Reported by Markus Dreyer
1163 <mdreyer@ix.urz.uni-heidelberg.de>.
1030 (ebnf-version): New version number (4.0). 1164 (ebnf-version): New version number (4.0).
1031 (ebnf-print-directory, ebnf-print-file, ebnf-spool-directory) 1165 (ebnf-print-directory, ebnf-print-file, ebnf-spool-directory)
1032 (ebnf-spool-file, ebnf-eps-directory, ebnf-eps-file) 1166 (ebnf-spool-file, ebnf-eps-directory, ebnf-eps-file)
@@ -1046,18 +1180,19 @@
1046 (ebnf-make-terminal1, ebnf-make-or-more1, ebnf-make-repeat) 1180 (ebnf-make-terminal1, ebnf-make-or-more1, ebnf-make-repeat)
1047 (ebnf-token-repeat): Code fix. 1181 (ebnf-token-repeat): Code fix.
1048 1182
1049 * ebnf-yac.el: Doc fix. Handle Bison pragmas %nonassoc, %right, %left 1183 * progmodes/ebnf-yac.el: Doc fix. Handle Bison pragmas %nonassoc,
1050 and %prec. Suggested by Matthew K. Junker <junker@alum.mit.edu>. 1184 %right, %left and %prec. Suggested by Matthew K. Junker
1185 <junker@alum.mit.edu>.
1051 (ebnf-yac-definitions, ebnf-yac-lex): Code fix. 1186 (ebnf-yac-definitions, ebnf-yac-lex): Code fix.
1052 1187
1053 * ebnf-iso.el: Doc fix. 1188 * progmodes/ebnf-iso.el: Doc fix.
1054 (ebnf-iso-token-table, ebnf-iso-non-terminal-chars): Adjust vars. 1189 (ebnf-iso-token-table, ebnf-iso-non-terminal-chars): Adjust vars.
1055 (ebnf-iso-lex): Code fix. 1190 (ebnf-iso-lex): Code fix.
1056 1191
1057 * ebnf-bnf.el: Doc fix. 1192 * progmodes/ebnf-bnf.el: Doc fix.
1058 (ebnf-bnf-lex): Code fix. 1193 (ebnf-bnf-lex): Code fix.
1059 1194
1060 * ebnf-otz.el: Doc fix. 1195 * progmodes/ebnf-otz.el: Doc fix.
1061 1196
10622004-02-23 Luc Teirlinck <teirllm@auburn.edu> 11972004-02-23 Luc Teirlinck <teirllm@auburn.edu>
1063 1198
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index e1c6b779db2..9efd587a199 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -136,17 +136,17 @@ emacs = EMACSLOADPATH=$(lisp) $(EMACS) $(EMACSOPT)
136 136
137# Common command to find subdirectories 137# Common command to find subdirectories
138 138
139setwins=subdirs=`find $$wd -type d -print`; \ 139setwins=subdirs=`(cd $$wd; find . -type d -print)`; \
140 for file in $$subdirs; do \ 140 for file in $$subdirs; do \
141 case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* ) ;; \ 141 case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* ) ;; \
142 *) wins="$$wins $$file" ;; \ 142 *) wins="$$wins $$wd/$$file" ;; \
143 esac; \ 143 esac; \
144 done 144 done
145 145
146setwins_almost=subdirs=`find $$wd -type d -print`; \ 146setwins_almost=subdirs=`(cd $$wd; find . -type d -print)`; \
147 for file in $$subdirs; do \ 147 for file in $$subdirs; do \
148 case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */obsolete | */term ) ;; \ 148 case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */obsolete | */term ) ;; \
149 *) wins="$$wins $$file" ;; \ 149 *) wins="$$wins $$wd/$$file" ;; \
150 esac; \ 150 esac; \
151 done 151 done
152 152
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 165c6b8b24f..6e74a96eff5 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -70,14 +70,8 @@
70;; Dependencies: 70;; Dependencies:
71 71
72(require 'timer) 72(require 'timer)
73(autoload 'dired-get-filename "dired")
74(autoload 'vc-workfile-version "vc-hooks")
75(autoload 'vc-mode-line "vc-hooks")
76 73
77(eval-when-compile 74(eval-when-compile (require 'cl))
78 (defvar dired-directory)
79 (defvar vc-mode)
80 (require 'cl))
81 75
82 76
83;; Custom Group: 77;; Custom Group:
@@ -191,6 +185,27 @@ not necessarily make manual updates useless for non-file buffers."
191 :group 'auto-revert 185 :group 'auto-revert
192 :type 'hook) 186 :type 'hook)
193 187
188(defcustom auto-revert-check-vc-info nil
189 "If non-nil Auto Revert Mode reliably updates version control info.
190Auto Revert Mode updates version control info whenever the buffer
191needs reverting, regardless of the value of this variable.
192However, the version control state can change without changes to
193the work file. If the change is made from the current Emacs
194session, all info is updated. But if, for instance, a new
195version is checked in from outside the current Emacs session, the
196version control number in the mode line, as well as other version
197control related information, may not be properly updated. If you
198are worried about this, set this variable to a non-nil value.
199
200This currently works by automatically updating the version
201control info every `auto-revert-interval' seconds. Nevertheless,
202it should not cause excessive CPU usage on a reasonably fast
203machine, if it does not apply to too many version controlled
204buffers. CPU usage depends on the version control system"
205 :group 'auto-revert
206 :type 'boolean
207 :version "21.4")
208
194(defvar global-auto-revert-ignore-buffer nil 209(defvar global-auto-revert-ignore-buffer nil
195 "*When non-nil, Global Auto-Revert Mode will not revert this buffer. 210 "*When non-nil, Global Auto-Revert Mode will not revert this buffer.
196 211
@@ -279,87 +294,29 @@ will use an up-to-date value of `auto-revert-interval'"
279 (not (memq major-mode 294 (not (memq major-mode
280 global-auto-revert-ignore-modes))))) 295 global-auto-revert-ignore-modes)))))
281 296
282(defun auto-revert-vc-cvs-file-version (file)
283 "Get version of FILE by reading control file on disk."
284 (let* ((control "CVS/Entries")
285 (name (file-name-nondirectory file))
286 (path (format "%s/%s"
287 (file-name-directory file)
288 control)))
289 (when (file-exists-p path)
290 (with-temp-buffer
291 (insert-file-contents-literally path)
292 (goto-char (point-min))
293 (when (re-search-forward
294 ;; /file.txt/1.3/Mon Sep 15 18:43:20 2003//
295 (format "%s/\\([.0-9]+\\)" (regexp-quote name))
296 nil t)
297 (match-string 1))))))
298
299(defun auto-revert-vc-buffer-p ()
300 "Check if buffer is version controlled."
301 (and (boundp 'vc-mode)
302 (string-match "[0-9]" (or vc-mode ""))))
303
304(defun auto-revert-handler-vc ()
305 "Check if version controlled buffer needs revert."
306 ;; [Emacs 1]
307 ;; 1. File is saved (*)
308 ;; 2. checkin is done 1.1 -> 1.2
309 ;; 3. VC reverts, so that updated version number is shown in mode line
310 ;;
311 ;; Suppose the same file has been opened in another Emacs and
312 ;; autorevert.el is on.
313 ;;
314 ;; [Emacs 2]
315 ;; 1. Step (1) is detected and buffer is reverted.
316 ;; 2. But check in does not always change the file in dis, but possibly only
317 ;; control files like CVS/Entries
318 ;; 3. The buffer is not reverted to update VC version line.
319 ;; Incorrect version number 1.1 is shown in this Emacs
320 ;;
321 (when (featurep 'vc)
322 (let* ((file (buffer-file-name))
323 (backend (vc-backend (buffer-file-name)))
324 (version-buffer (vc-workfile-version file)))
325 (when (stringp version-buffer)
326 (cond
327 ((eq backend 'CVS)
328 (let ((version-file
329 (auto-revert-vc-cvs-file-version (buffer-file-name))))
330 (and (stringp version-file)
331 (not (string-match version-file version-buffer)))))
332 ((eq backend 'RCS)
333 ;; TODO:
334 ))))))
335
336(defun auto-revert-handler () 297(defun auto-revert-handler ()
337 "Revert current buffer, if appropriate. 298 "Revert current buffer, if appropriate.
338This is an internal function used by Auto-Revert Mode." 299This is an internal function used by Auto-Revert Mode."
339 (unless (buffer-modified-p) 300 (unless (buffer-modified-p)
340 (let (revert) 301 (let (revert)
341 (cond 302 (or (and (buffer-file-name)
342 ((auto-revert-vc-buffer-p) 303 (file-readable-p (buffer-file-name))
343 (when (auto-revert-handler-vc) 304 (not (verify-visited-file-modtime (current-buffer)))
344 (setq revert 'vc))) 305 (setq revert t))
345 ((or (and (buffer-file-name) 306 (and (or auto-revert-mode global-auto-revert-non-file-buffers)
346 (file-readable-p (buffer-file-name)) 307 revert-buffer-function
347 (not (verify-visited-file-modtime (current-buffer)))) 308 (boundp 'buffer-stale-function)
348 (and (or auto-revert-mode global-auto-revert-non-file-buffers) 309 (functionp buffer-stale-function)
349 revert-buffer-function 310 (setq revert (funcall buffer-stale-function t))))
350 (boundp 'buffer-stale-function)
351 (functionp buffer-stale-function)
352 (funcall buffer-stale-function t)))
353 (setq revert t)))
354 (when revert 311 (when revert
355 (when auto-revert-verbose 312 (when (and auto-revert-verbose
313 (not (eq revert 'fast)))
356 (message "Reverting buffer `%s'." (buffer-name))) 314 (message "Reverting buffer `%s'." (buffer-name)))
357 (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes) 315 (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes))
358 ;; `preserve-modes' avoids changing the (minor) modes. But we 316 ;; `preserve-modes' avoids changing the (minor) modes. But we
359 ;; do want to reset the mode for VC, so we do it explicitly. 317 ;; do want to reset the mode for VC, so we do it manually.
360 (vc-find-file-hook) 318 (when (or revert auto-revert-check-vc-info)
361 (if (eq revert 'vc) 319 (vc-find-file-hook)))))
362 (vc-mode-line buffer-file-name))))))
363 320
364(defun auto-revert-buffers () 321(defun auto-revert-buffers ()
365 "Revert buffers as specified by Auto-Revert and Global Auto-Revert Mode. 322 "Revert buffers as specified by Auto-Revert and Global Auto-Revert Mode.
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index a1b0f4093c7..da1c8ed586e 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -185,7 +185,7 @@ Letters do not insert themselves; instead, they are commands.
185 (set (make-local-variable 'revert-buffer-function) 185 (set (make-local-variable 'revert-buffer-function)
186 'Buffer-menu-revert-function) 186 'Buffer-menu-revert-function)
187 (set (make-local-variable 'buffer-stale-function) 187 (set (make-local-variable 'buffer-stale-function)
188 #'(lambda (&optional noconfirm) t)) 188 #'(lambda (&optional noconfirm) 'fast))
189 (setq truncate-lines t) 189 (setq truncate-lines t)
190 (setq buffer-read-only t) 190 (setq buffer-read-only t)
191 (run-hooks 'buffer-menu-mode-hook)) 191 (run-hooks 'buffer-menu-mode-hook))
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index abc0d588a14..30ef3dcf05e 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -99,8 +99,9 @@ if that value is non-nil."
99(defun describe-property-list (properties) 99(defun describe-property-list (properties)
100 "Insert a description of PROPERTIES in the current buffer. 100 "Insert a description of PROPERTIES in the current buffer.
101PROPERTIES should be a list of overlay or text properties. 101PROPERTIES should be a list of overlay or text properties.
102The `category' and `face' properties are made into widget buttons 102The `category', `face' and `font-lock-face' properties are made
103that call `describe-text-category' or `describe-face' when pushed." 103into widget buttons that call `describe-text-category' or
104`describe-face' when pushed."
104 ;; Sort the properties by the size of their value. 105 ;; Sort the properties by the size of their value.
105 (dolist (elt (sort (let ((ret nil) 106 (dolist (elt (sort (let ((ret nil)
106 (key nil) 107 (key nil)
@@ -110,7 +111,7 @@ that call `describe-text-category' or `describe-face' when pushed."
110 (setq key (pop properties) 111 (setq key (pop properties)
111 val (pop properties) 112 val (pop properties)
112 len 0) 113 len 0)
113 (unless (or (memq key '(category face)) 114 (unless (or (memq key '(category face font-lock-face))
114 (widgetp val)) 115 (widgetp val))
115 (setq val (pp-to-string val) 116 (setq val (pp-to-string val)
116 len (length val))) 117 len (length val)))
@@ -128,7 +129,7 @@ that call `describe-text-category' or `describe-face' when pushed."
128 :notify `(lambda (&rest ignore) 129 :notify `(lambda (&rest ignore)
129 (describe-text-category ',value)) 130 (describe-text-category ',value))
130 (format "%S" value))) 131 (format "%S" value)))
131 ((eq key 'face) 132 ((memq key '(face font-lock-face))
132 (widget-create 'link 133 (widget-create 'link
133 :notify `(lambda (&rest ignore) 134 :notify `(lambda (&rest ignore)
134 (describe-face ',value)) 135 (describe-face ',value))
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 1fc8e0e805a..0709e0cfe1c 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -186,7 +186,7 @@ List has a form of (file-name full-file-name (attribute-list))"
186 (directory-files dir))) 186 (directory-files dir)))
187 187
188(defun dired-do-chxxx (attribute-name program op-symbol arg) 188(defun dired-do-chxxx (attribute-name program op-symbol arg)
189 ;; Change file attributes (mode, group, owner) of marked files and 189 ;; Change file attributes (mode, group, owner, timestamp) of marked files and
190 ;; refresh their file lines. 190 ;; refresh their file lines.
191 ;; ATTRIBUTE-NAME is a string describing the attribute to the user. 191 ;; ATTRIBUTE-NAME is a string describing the attribute to the user.
192 ;; PROGRAM is the program used to change the attribute. 192 ;; PROGRAM is the program used to change the attribute.
@@ -203,7 +203,10 @@ List has a form of (file-name full-file-name (attribute-list))"
203 (dired-bunch-files 10000 203 (dired-bunch-files 10000
204 (function dired-check-process) 204 (function dired-check-process)
205 (append 205 (append
206 (list operation program new-attribute) 206 (list operation program)
207 (if (eq op-symbol 'touch)
208 '("-t") nil)
209 (list new-attribute)
207 (if (string-match "gnu" system-configuration) 210 (if (string-match "gnu" system-configuration)
208 '("--") nil)) 211 '("--") nil))
209 files)) 212 files))
@@ -236,6 +239,12 @@ This calls chmod, thus symbolic modes like `g+w' are allowed."
236 (error "chown not supported on this system")) 239 (error "chown not supported on this system"))
237 (dired-do-chxxx "Owner" dired-chown-program 'chown arg)) 240 (dired-do-chxxx "Owner" dired-chown-program 'chown arg))
238 241
242(defun dired-do-touch (&optional arg)
243 "Change the timestamp of the marked (or next ARG) files.
244This calls touch."
245 (interactive "P")
246 (dired-do-chxxx "Timestamp" dired-touch-program 'touch arg))
247
239;; Process all the files in FILES in batches of a convenient size, 248;; Process all the files in FILES in batches of a convenient size,
240;; by means of (FUNCALL FUNCTION ARGS... SOME-FILES...). 249;; by means of (FUNCALL FUNCTION ARGS... SOME-FILES...).
241;; Batches are chosen to need less than MAX chars for the file names, 250;; Batches are chosen to need less than MAX chars for the file names,
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index fc30428e562..21fe4902e58 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -1517,8 +1517,7 @@ to mark all zero length files."
1517 ;; Karsten Wenger <kw@cis.uni-muenchen.de> fixed uid. 1517 ;; Karsten Wenger <kw@cis.uni-muenchen.de> fixed uid.
1518 (setq uid (buffer-substring (+ (point) 1) 1518 (setq uid (buffer-substring (+ (point) 1)
1519 (progn (forward-word 1) (point)))) 1519 (progn (forward-word 1) (point))))
1520 (re-search-forward "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|\ 1520 (re-search-forward dired-move-to-filename-regexp)
1521Jul\\|Aug\\|Sep\\|Oct\\|Nov\\|Dec\\)")
1522 (goto-char (match-beginning 1)) 1521 (goto-char (match-beginning 1))
1523 (forward-char -1) 1522 (forward-char -1)
1524 (setq size (string-to-int (buffer-substring (save-excursion 1523 (setq size (string-to-int (buffer-substring (save-excursion
diff --git a/lisp/dired.el b/lisp/dired.el
index cfdb57d614c..fd51f7158fa 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -79,6 +79,9 @@ some of the `ls' switches are not supported; see the doc string of
79(defvar dired-chmod-program "chmod" 79(defvar dired-chmod-program "chmod"
80 "Name of chmod command (usually `chmod').") 80 "Name of chmod command (usually `chmod').")
81 81
82(defvar dired-touch-program "touch"
83 "Name of touch command (usually `touch').")
84
82;;;###autoload 85;;;###autoload
83(defcustom dired-ls-F-marks-symlinks nil 86(defcustom dired-ls-F-marks-symlinks nil
84 "*Informs dired about how `ls -lF' marks symbolic links. 87 "*Informs dired about how `ls -lF' marks symbolic links.
@@ -315,10 +318,10 @@ Subexpression 2 must end right before the \\n or \\r.")
315 ;; Fixme: we could also put text properties on the permission 318 ;; Fixme: we could also put text properties on the permission
316 ;; fields with keymaps to frob the permissions, somewhat a la XEmacs. 319 ;; fields with keymaps to frob the permissions, somewhat a la XEmacs.
317 (list (concat dired-re-maybe-mark dired-re-inode-size 320 (list (concat dired-re-maybe-mark dired-re-inode-size
318 "[-d]....\\(w\\)..\\(w\\).") ; group writable 321 "[-d]....\\(w\\)....") ; group writable
319 '(1 font-lock-warning-face)) 322 '(1 font-lock-comment-face))
320 (list (concat dired-re-maybe-mark dired-re-inode-size 323 (list (concat dired-re-maybe-mark dired-re-inode-size
321 "[-d]....\\(w\\)....") ; world writable 324 "[-d].......\\(w\\).") ; world writable
322 '(1 font-lock-comment-face)) 325 '(1 font-lock-comment-face))
323 ;; 326 ;;
324 ;; Subdirectories. 327 ;; Subdirectories.
@@ -919,6 +922,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
919 (define-key map "Q" 'dired-do-query-replace-regexp) 922 (define-key map "Q" 'dired-do-query-replace-regexp)
920 (define-key map "R" 'dired-do-rename) 923 (define-key map "R" 'dired-do-rename)
921 (define-key map "S" 'dired-do-symlink) 924 (define-key map "S" 'dired-do-symlink)
925 (define-key map "T" 'dired-do-touch)
922 (define-key map "X" 'dired-do-shell-command) 926 (define-key map "X" 'dired-do-shell-command)
923 (define-key map "Z" 'dired-do-compress) 927 (define-key map "Z" 'dired-do-compress)
924 (define-key map "!" 'dired-do-shell-command) 928 (define-key map "!" 'dired-do-shell-command)
@@ -1189,6 +1193,9 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
1189 (define-key map [menu-bar operate chmod] 1193 (define-key map [menu-bar operate chmod]
1190 '(menu-item "Change Mode..." dired-do-chmod 1194 '(menu-item "Change Mode..." dired-do-chmod
1191 :help "Change mode (attributes) of marked files")) 1195 :help "Change mode (attributes) of marked files"))
1196 (define-key map [menu-bar operate touch]
1197 '(menu-item "Change Timestamp..." dired-do-touch
1198 :help "Change timestamp of marked files"))
1192 (define-key map [menu-bar operate load] 1199 (define-key map [menu-bar operate load]
1193 '(menu-item "Load" dired-do-load 1200 '(menu-item "Load" dired-do-load
1194 :help "Load marked Emacs Lisp files")) 1201 :help "Load marked Emacs Lisp files"))
@@ -1630,7 +1637,7 @@ DIR must be a directory name, not a file name."
1630 (s " ") 1637 (s " ")
1631 (yyyy "[0-9][0-9][0-9][0-9]") 1638 (yyyy "[0-9][0-9][0-9][0-9]")
1632 (dd "[ 0-3][0-9]") 1639 (dd "[ 0-3][0-9]")
1633 (HH:MM "[ 0-2][0-9]:[0-5][0-9]") 1640 (HH:MM "[ 0-2][0-9][:.][0-5][0-9]")
1634 (seconds "[0-6][0-9]\\([.,][0-9]+\\)?") 1641 (seconds "[0-6][0-9]\\([.,][0-9]+\\)?")
1635 (zone "[-+][0-2][0-9][0-5][0-9]") 1642 (zone "[-+][0-2][0-9][0-5][0-9]")
1636 (iso-mm-dd "[01][0-9]-[0-3][0-9]") 1643 (iso-mm-dd "[01][0-9]-[0-3][0-9]")
@@ -2333,8 +2340,8 @@ if there are no flagged files."
2333(defvar dired-no-confirm nil 2340(defvar dired-no-confirm nil
2334 "A list of symbols for commands dired should not confirm. 2341 "A list of symbols for commands dired should not confirm.
2335Command symbols are `byte-compile', `chgrp', `chmod', `chown', `compress', 2342Command symbols are `byte-compile', `chgrp', `chmod', `chown', `compress',
2336`copy', `delete', `hardlink', `load', `move', `print', `shell', `symlink' and 2343`copy', `delete', `hardlink', `load', `move', `print', `shell', `symlink',
2337`uncompress'.") 2344`touch' and `uncompress'.")
2338 2345
2339(defun dired-mark-pop-up (bufname op-symbol files function &rest args) 2346(defun dired-mark-pop-up (bufname op-symbol files function &rest args)
2340 "Return FUNCTION's result on ARGS after showing which files are marked. 2347 "Return FUNCTION's result on ARGS after showing which files are marked.
@@ -2977,6 +2984,10 @@ This calls chmod, thus symbolic modes like `g+w' are allowed."
2977 "Change the owner of the marked (or next ARG) files." 2984 "Change the owner of the marked (or next ARG) files."
2978 t) 2985 t)
2979 2986
2987(autoload 'dired-do-touch "dired-aux"
2988 "Change the timestamp of the marked (or next ARG) files."
2989 t)
2990
2980(autoload 'dired-do-print "dired-aux" 2991(autoload 'dired-do-print "dired-aux"
2981 "Print the marked (or next ARG) files. 2992 "Print the marked (or next ARG) files.
2982Uses the shell command coming from variables `lpr-command' and 2993Uses the shell command coming from variables `lpr-command' and
diff --git a/lisp/files.el b/lisp/files.el
index 706c6856775..be40a0b595e 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3458,8 +3458,10 @@ The function you specify is responsible for updating (or preserving) point.")
3458 "Function to check whether a non-file buffer needs reverting. 3458 "Function to check whether a non-file buffer needs reverting.
3459This should be a function with one optional argument NOCONFIRM. 3459This should be a function with one optional argument NOCONFIRM.
3460Auto Revert Mode sets NOCONFIRM to t. The function should return 3460Auto Revert Mode sets NOCONFIRM to t. The function should return
3461non-nil if the buffer should be reverted. The buffer is current 3461non-nil if the buffer should be reverted. A return value of
3462when this function is called. 3462`fast' means that the need for reverting was not checked, but
3463that reverting the buffer is fast. The buffer is current when
3464this function is called.
3463 3465
3464The idea behind the NOCONFIRM argument is that it should be 3466The idea behind the NOCONFIRM argument is that it should be
3465non-nil if the buffer is going to be reverted without asking the 3467non-nil if the buffer is going to be reverted without asking the
diff --git a/lisp/international/characters.el b/lisp/international/characters.el
index 301d8ea5454..7af456d1878 100644
--- a/lisp/international/characters.el
+++ b/lisp/international/characters.el
@@ -1129,8 +1129,6 @@
1129 '("$,1sEsF(B" ; U+2045 U+2046 1129 '("$,1sEsF(B" ; U+2045 U+2046
1130 "$,1s}s~(B" ; U+207D U+207E 1130 "$,1s}s~(B" ; U+207D U+207E
1131 "$,1t-t.(B" ; U+208D U+208E 1131 "$,1t-t.(B" ; U+208D U+208E
1132 "$,1zhzi(B" ; U+2308 U+2309
1133 "$,1zjzk(B" ; U+230A U+230B
1134 "$,1{){*(B" ; U+2329 U+232A 1132 "$,1{){*(B" ; U+2329 U+232A
1135 "$,1|T|U(B" ; U+23B4 U+23B5 1133 "$,1|T|U(B" ; U+23B4 U+23B5
1136 "$,2&H&I(B" ; U+2768 U+2769 1134 "$,2&H&I(B" ; U+2768 U+2769
diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el
index b667ec9227a..3a3539359ec 100644
--- a/lisp/international/mule-util.el
+++ b/lisp/international/mule-util.el
@@ -384,10 +384,15 @@ basis, this may not be accurate."
384 ;; Now FONT-PATTERN is a string or a cons of family 384 ;; Now FONT-PATTERN is a string or a cons of family
385 ;; field pattern and registry field pattern. 385 ;; field pattern and registry field pattern.
386 (or (stringp font-pattern) 386 (or (stringp font-pattern)
387 (setq font-pattern (concat "-" 387 (let ((family (or (car font-pattern) "*"))
388 (or (car font-pattern) "*") 388 (registry (or (cdr font-pattern) "*")))
389 "-*-" 389 (or (string-match "-" family)
390 (cdr font-pattern)))) 390 (setq family (concat "*-" family)))
391 (or (string-match "-" registry)
392 (setq registry (concat registry "-*")))
393 (setq font-pattern
394 (format "-%s-*-*-*-*-*-*-*-*-*-*-%s"
395 family registry))))
391 (x-list-fonts font-pattern 'default (selected-frame) 1))))) 396 (x-list-fonts font-pattern 'default (selected-frame) 1)))))
392 (t 397 (t
393 (let ((coding (terminal-coding-system))) 398 (let ((coding (terminal-coding-system)))
diff --git a/lisp/international/ucs-tables.el b/lisp/international/ucs-tables.el
index 476c8dfc191..5574cf3d954 100644
--- a/lisp/international/ucs-tables.el
+++ b/lisp/international/ucs-tables.el
@@ -1247,12 +1247,14 @@ unification on input operations."
1247 "Insert the Emacs character representation of the given Unicode. 1247 "Insert the Emacs character representation of the given Unicode.
1248Interactively, prompts for a hex string giving the code." 1248Interactively, prompts for a hex string giving the code."
1249 (interactive "sUnicode (hex): ") 1249 (interactive "sUnicode (hex): ")
1250 (let ((c (decode-char 'ucs (if (integerp arg) 1250 (or (integerp arg)
1251 arg 1251 (setq arg (string-to-number arg 16)))
1252 (string-to-number arg 16))))) 1252 (let ((c (decode-char 'ucs arg)))
1253 (if c 1253 (if c
1254 (insert c) 1254 (insert c)
1255 (error "Character can't be decoded to UCS")))) 1255 (if (or (< arg 0) (> arg #x10FFFF))
1256 (error "Not a Unicode character code: 0x%X" arg)
1257 (error "Character U+%04X is not yet supported" arg)))))
1256 1258
1257;;; Dealing with non-8859 character sets. 1259;;; Dealing with non-8859 character sets.
1258 1260
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index fa0d7ea7914..a70e08028d2 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -1,6 +1,6 @@
1;;; browse-url.el --- pass a URL to a WWW browser 1;;; browse-url.el --- pass a URL to a WWW browser
2 2
3;; Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001 3;; Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001, 2004
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Denis Howe <dbh@doc.ic.ac.uk> 6;; Author: Denis Howe <dbh@doc.ic.ac.uk>
@@ -1352,8 +1352,8 @@ don't offer a form of remote control."
1352 (interactive (browse-url-interactive-arg "URL: ")) 1352 (interactive (browse-url-interactive-arg "URL: "))
1353 (if (not browse-url-generic-program) 1353 (if (not browse-url-generic-program)
1354 (error "No browser defined (`browse-url-generic-program')")) 1354 (error "No browser defined (`browse-url-generic-program')"))
1355 (apply 'start-process (concat browse-url-generic-program url) nil 1355 (apply 'call-process browse-url-generic-program nil
1356 browse-url-generic-program 1356 0 nil
1357 (append browse-url-generic-args (list url)))) 1357 (append browse-url-generic-args (list url))))
1358 1358
1359;;;###autoload 1359;;;###autoload
diff --git a/lisp/pcvs.el b/lisp/pcvs.el
index a7683ce371e..cc72d02f64a 100644
--- a/lisp/pcvs.el
+++ b/lisp/pcvs.el
@@ -1,6 +1,6 @@
1;;; pcvs.el --- a front-end to CVS 1;;; pcvs.el --- a front-end to CVS
2 2
3;; Copyright (C) 1991,92,93,94,95,95,97,98,99,2000,02,2003 3;; Copyright (C) 1991,92,93,94,95,95,97,98,99,2000,02,03,2004
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: (The PCL-CVS Trust) pcl-cvs@cyclic.com 6;; Author: (The PCL-CVS Trust) pcl-cvs@cyclic.com
@@ -12,7 +12,7 @@
12;; (Stefan Monnier) monnier@cs.yale.edu 12;; (Stefan Monnier) monnier@cs.yale.edu
13;; (Greg Klanderman) greg@alphatech.com 13;; (Greg Klanderman) greg@alphatech.com
14;; (Jari Aalto+mail.emacs) jari.aalto@poboxes.com 14;; (Jari Aalto+mail.emacs) jari.aalto@poboxes.com
15;; Maintainer: (Stefan Monnier) monnier+lists/cvs/pcl@flint.cs.yale.edu 15;; Maintainer: (Stefan Monnier) monnier@gnu.org
16;; Keywords: CVS, version control, release management 16;; Keywords: CVS, version control, release management
17 17
18;; This file is part of GNU Emacs. 18;; This file is part of GNU Emacs.
@@ -669,6 +669,14 @@ DCD is the `dont-change-disc' flag to use when parsing that output.
669SUBDIR is the subdirectory (if any) where this command was run. 669SUBDIR is the subdirectory (if any) where this command was run.
670OLD-FIS is the list of fileinfos on which the cvs command was applied and 670OLD-FIS is the list of fileinfos on which the cvs command was applied and
671 which should be considered up-to-date if they are missing from the output." 671 which should be considered up-to-date if they are missing from the output."
672 (when (eq system-type 'darwin)
673 ;; Fixup the ^D^H^H inserted at beginning of buffer sometimes on MacOSX
674 ;; because of the call to `process-send-eof'.
675 (save-excursion
676 (goto-char (point-min))
677 (while (re-search-forward "^\\^D+" nil t)
678 (let ((inhibit-read-only t))
679 (delete-region (match-beginning 0) (match-end 0))))))
672 (let* ((fileinfos (cvs-parse-buffer 'cvs-parse-table dcd subdir)) 680 (let* ((fileinfos (cvs-parse-buffer 'cvs-parse-table dcd subdir))
673 last) 681 last)
674 (with-current-buffer cvs-buffer 682 (with-current-buffer cvs-buffer
diff --git a/lisp/printing.el b/lisp/printing.el
index 377e1fc4538..1e65fdba4ea 100644
--- a/lisp/printing.el
+++ b/lisp/printing.el
@@ -5,13 +5,13 @@
5 5
6;; Author: Vinicius Jose Latorre <vinicius@cpqd.com.br> 6;; Author: Vinicius Jose Latorre <vinicius@cpqd.com.br>
7;; Maintainer: Vinicius Jose Latorre <vinicius@cpqd.com.br> 7;; Maintainer: Vinicius Jose Latorre <vinicius@cpqd.com.br>
8;; Time-stamp: <2004/03/10 20:37:21 vinicius> 8;; Time-stamp: <2004/03/31 23:14:47 vinicius>
9;; Keywords: wp, print, PostScript 9;; Keywords: wp, print, PostScript
10;; Version: 6.7.2 10;; Version: 6.7.4
11;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ 11;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
12 12
13(defconst pr-version "6.7.2" 13(defconst pr-version "6.7.4"
14 "printing.el, v 6.7.2 <2004/02/29 vinicius> 14 "printing.el, v 6.7.4 <2004/03/31 vinicius>
15 15
16Please send all bug fixes and enhancements to 16Please send all bug fixes and enhancements to
17 Vinicius Jose Latorre <vinicius@cpqd.com.br> 17 Vinicius Jose Latorre <vinicius@cpqd.com.br>
@@ -187,6 +187,10 @@ Please send all bug fixes and enhancements to
187;; another buffer and, then, print the file or the new static buffer. 187;; another buffer and, then, print the file or the new static buffer.
188;; An example of dynamic buffer is the *Messages* buffer. 188;; An example of dynamic buffer is the *Messages* buffer.
189;; 189;;
190;; 4. When running Emacs on Windows with cygwin, check if the
191;; `pr-shell-file-name' variable is set to the proper shell. This shell
192;; will execute the commands to preview/print the buffer, file or directory.
193;;
190;; 194;;
191;; Using `printing' 195;; Using `printing'
192;; ---------------- 196;; ----------------
@@ -2304,7 +2308,8 @@ It's used by `pr-interface'."
2304 2308
2305 2309
2306(defcustom pr-shell-file-name 2310(defcustom pr-shell-file-name
2307 (if (eq pr-path-style 'windows) 2311 (if (and (not pr-cygwin-system)
2312 ps-windows-system)
2308 "cmdproxy.exe" 2313 "cmdproxy.exe"
2309 shell-file-name) 2314 shell-file-name)
2310 "*Specify file name to load inferior shells from." 2315 "*Specify file name to load inferior shells from."
@@ -4572,8 +4577,8 @@ See `pr-visible-entry-alist'.")
4572 (defun pr-menu-position (entry index horizontal) 4577 (defun pr-menu-position (entry index horizontal)
4573 (let ((pos (cdr (pr-e-mouse-pixel-position)))) 4578 (let ((pos (cdr (pr-e-mouse-pixel-position))))
4574 (list 4579 (list
4575 (list (car pos) ; X 4580 (list (or (car pos) 0) ; X
4576 (- (cdr pos) ; Y 4581 (- (or (cdr pos) 0) ; Y
4577 (* (pr-menu-index entry index) pr-menu-char-height))) 4582 (* (pr-menu-index entry index) pr-menu-char-height)))
4578 (selected-frame)))) ; frame 4583 (selected-frame)))) ; frame
4579 ) 4584 )
@@ -4582,9 +4587,9 @@ See `pr-visible-entry-alist'.")
4582 (defun pr-menu-position (entry index horizontal) 4587 (defun pr-menu-position (entry index horizontal)
4583 (let ((pos (cdr (pr-e-mouse-pixel-position)))) 4588 (let ((pos (cdr (pr-e-mouse-pixel-position))))
4584 (list 4589 (list
4585 (list (- (car pos) ; X 4590 (list (- (or (car pos) 0) ; X
4586 (* horizontal pr-menu-char-width)) 4591 (* horizontal pr-menu-char-width))
4587 (- (cdr pos) ; Y 4592 (- (or (cdr pos) 0) ; Y
4588 (* (pr-menu-index entry index) pr-menu-char-height))) 4593 (* (pr-menu-index entry index) pr-menu-char-height)))
4589 (selected-frame)))) ; frame 4594 (selected-frame)))) ; frame
4590 )) 4595 ))
@@ -4656,7 +4661,7 @@ otherwise, update PostScript printer menu iff `pr-ps-printer-menu-modified' is
4656non-nil, update text printer menu iff `pr-txt-printer-menu-modified' is 4661non-nil, update text printer menu iff `pr-txt-printer-menu-modified' is
4657non-nil, and update PostScript File menus iff `pr-ps-utility-menu-modified' is 4662non-nil, and update PostScript File menus iff `pr-ps-utility-menu-modified' is
4658non-nil." 4663non-nil."
4659 (interactive) 4664 (interactive "P")
4660 (pr-update-var 'pr-ps-name pr-ps-printer-alist) 4665 (pr-update-var 'pr-ps-name pr-ps-printer-alist)
4661 (pr-update-var 'pr-txt-name pr-txt-printer-alist) 4666 (pr-update-var 'pr-txt-name pr-txt-printer-alist)
4662 (pr-update-var 'pr-ps-utility pr-ps-utility-alist) 4667 (pr-update-var 'pr-ps-utility pr-ps-utility-alist)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 8415fd2050e..05fb8ee059d 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -227,7 +227,7 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
227 ("`\\(\\(\\S +?\\)\\(?::\\([0-9]+\\)\\)?\\)'" nil nil 227 ("`\\(\\(\\S +?\\)\\(?::\\([0-9]+\\)\\)?\\)'" nil nil
228 (2 compilation-info-face) 228 (2 compilation-info-face)
229 (3 compilation-line-face nil t) 229 (3 compilation-line-face nil t)
230 (1 (compilation-error-properties 2 3 nil nil nil 2 nil) 230 (1 (compilation-error-properties 2 3 nil nil nil 0 nil)
231 append))) 231 append)))
232 232
233 (mips-1 233 (mips-1
@@ -1076,11 +1076,17 @@ variable exists."
1076 (if (or noconfirm (yes-or-no-p (format "Restart compilation? "))) 1076 (if (or noconfirm (yes-or-no-p (format "Restart compilation? ")))
1077 (apply 'compilation-start compilation-arguments)))) 1077 (apply 'compilation-start compilation-arguments))))
1078 1078
1079;; This points to the location from where the next error will be found.
1080;; The global commands next/previous/first-error... as well as
1081;; (mouse-)goto-error use this.
1082(defvar compilation-current-error nil)
1083
1079;; A function name can't be a hook, must be something with a value. 1084;; A function name can't be a hook, must be something with a value.
1080(defconst compilation-turn-on-font-lock 'turn-on-font-lock) 1085(defconst compilation-turn-on-font-lock 'turn-on-font-lock)
1081 1086
1082(defun compilation-setup (&optional minor) 1087(defun compilation-setup (&optional minor)
1083 "Prepare the buffer for the compilation parsing commands to work." 1088 "Prepare the buffer for the compilation parsing commands to work."
1089 (make-local-variable 'compilation-current-error)
1084 (make-local-variable 'compilation-error-screen-columns) 1090 (make-local-variable 'compilation-error-screen-columns)
1085 (setq compilation-last-buffer (current-buffer)) 1091 (setq compilation-last-buffer (current-buffer))
1086 (if minor 1092 (if minor
@@ -1233,7 +1239,7 @@ Just inserts the text, but uses `insert-before-markers'."
1233 ;; count this message only if none of the above are true 1239 ;; count this message only if none of the above are true
1234 (setq n (,1+ n))))) 1240 (setq n (,1+ n)))))
1235 1241
1236(defun compilation-next-error (n &optional different-file) 1242(defun compilation-next-error (n &optional different-file pt)
1237 "Move point to the next error in the compilation buffer. 1243 "Move point to the next error in the compilation buffer.
1238Prefix arg N says how many error messages to move forwards (or 1244Prefix arg N says how many error messages to move forwards (or
1239backwards, if negative). 1245backwards, if negative).
@@ -1241,11 +1247,11 @@ Does NOT find the source line like \\[next-error]."
1241 (interactive "p") 1247 (interactive "p")
1242 (or (compilation-buffer-p (current-buffer)) 1248 (or (compilation-buffer-p (current-buffer))
1243 (error "Not in a compilation buffer")) 1249 (error "Not in a compilation buffer"))
1250 (or pt (setq pt (point)))
1244 (setq compilation-last-buffer (current-buffer)) 1251 (setq compilation-last-buffer (current-buffer))
1245 (let* ((pt (point)) 1252 (let* ((msg (get-text-property pt 'message))
1246 (msg (get-text-property pt 'message)) 1253 (loc (car msg))
1247 (loc (car msg)) 1254 last)
1248 last)
1249 (if (zerop n) 1255 (if (zerop n)
1250 (unless (or msg ; find message near here 1256 (unless (or msg ; find message near here
1251 (setq msg (get-text-property (max (1- pt) 1) 'message))) 1257 (setq msg (get-text-property (max (1- pt) 1) 'message)))
@@ -1263,13 +1269,15 @@ Does NOT find the source line like \\[next-error]."
1263 (setq msg (get-text-property pt 'message)) 1269 (setq msg (get-text-property pt 'message))
1264 (setq pt (point))))) 1270 (setq pt (point)))))
1265 (setq last (nth 2 (car msg))) 1271 (setq last (nth 2 (car msg)))
1266 ;; These loops search only either forwards or backwards 1272 (if (>= n 0)
1267 (compilation-loop > next-single-property-change 1- 1273 (compilation-loop > next-single-property-change 1-
1268 (if (get-buffer-process (current-buffer)) 1274 (if (get-buffer-process (current-buffer))
1269 "No more %ss yet" 1275 "No more %ss yet"
1270 "Moved past last %s")) 1276 "Moved past last %s"))
1271 (compilation-loop < previous-single-property-change 1+ 1277 ;; don't move "back" to message at or before point
1272 "Moved back before first %s")) 1278 (setq pt (previous-single-property-change pt 'message))
1279 (compilation-loop < previous-single-property-change 1+
1280 "Moved back before first %s")))
1273 (goto-char pt) 1281 (goto-char pt)
1274 (or msg 1282 (or msg
1275 (error "No %s here" compilation-error)))) 1283 (error "No %s here" compilation-error))))
@@ -1327,6 +1335,7 @@ Prefix arg N says how many files to move backwards (or forwards, if negative)."
1327 (mouse-set-point event) 1335 (mouse-set-point event)
1328 (if (get-text-property (point) 'directory) 1336 (if (get-text-property (point) 'directory)
1329 (dired-other-window (car (get-text-property (point) 'directory))) 1337 (dired-other-window (car (get-text-property (point) 'directory)))
1338 (setq compilation-current-error (point))
1330 (next-error 0))) 1339 (next-error 0)))
1331 1340
1332(defun compile-goto-error () 1341(defun compile-goto-error ()
@@ -1338,6 +1347,7 @@ Use this command in a compilation log buffer. Sets the mark at point there."
1338 (if (get-text-property (point) 'directory) 1347 (if (get-text-property (point) 'directory)
1339 (dired-other-window (car (get-text-property (point) 'directory))) 1348 (dired-other-window (car (get-text-property (point) 'directory)))
1340 (push-mark) 1349 (push-mark)
1350 (setq compilation-current-error (point))
1341 (next-error 0))) 1351 (next-error 0)))
1342 1352
1343;; Return a compilation buffer. 1353;; Return a compilation buffer.
@@ -1393,10 +1403,12 @@ See variable `compilation-error-regexp-alist' for customization ideas."
1393 (set-buffer (setq compilation-last-buffer (compilation-find-buffer))) 1403 (set-buffer (setq compilation-last-buffer (compilation-find-buffer)))
1394 (let* ((columns compilation-error-screen-columns) ; buffer's local value 1404 (let* ((columns compilation-error-screen-columns) ; buffer's local value
1395 (last 1) 1405 (last 1)
1396 (loc (compilation-next-error (or n 1))) 1406 (loc (compilation-next-error (or n 1) nil
1407 (or compilation-current-error (point-min))))
1397 (end-loc (nth 2 loc)) 1408 (end-loc (nth 2 loc))
1398 (marker (point-marker))) 1409 (marker (point-marker)))
1399 (setq loc (car loc)) 1410 (setq compilation-current-error (point-marker)
1411 loc (car loc))
1400 ;; If loc contains no marker, no error in that file has been visited. If 1412 ;; If loc contains no marker, no error in that file has been visited. If
1401 ;; the marker is invalid the buffer has been killed. So, recalculate all 1413 ;; the marker is invalid the buffer has been killed. So, recalculate all
1402 ;; markers for that file. 1414 ;; markers for that file.
@@ -1448,10 +1460,10 @@ With prefix arg N, visit the source code of the Nth error.
1448This operates on the output from the \\[compile] command." 1460This operates on the output from the \\[compile] command."
1449 (interactive "p") 1461 (interactive "p")
1450 (set-buffer (setq compilation-last-buffer (compilation-find-buffer))) 1462 (set-buffer (setq compilation-last-buffer (compilation-find-buffer)))
1451 (goto-char (point-min)) 1463 (setq compilation-current-error (point-min))
1452 (next-error n)) 1464 (next-error n))
1453 1465
1454(defvar compilation-skip-to-next-location nil 1466(defvar compilation-skip-to-next-location t
1455 "*If non-nil, skip multiple error messages for the same source location.") 1467 "*If non-nil, skip multiple error messages for the same source location.")
1456 1468
1457(defcustom compilation-skip-threshold 1 1469(defcustom compilation-skip-threshold 1
diff --git a/lisp/progmodes/ebnf-abn.el b/lisp/progmodes/ebnf-abn.el
index 9c341c5181c..e41d27d0c1f 100644
--- a/lisp/progmodes/ebnf-abn.el
+++ b/lisp/progmodes/ebnf-abn.el
@@ -4,7 +4,7 @@
4 4
5;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> 5;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
6;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> 6;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
7;; Time-stamp: <2004/02/28 17:40:41 vinicius> 7;; Time-stamp: <2004/03/18 23:49:58 vinicius>
8;; Keywords: wp, ebnf, PostScript 8;; Keywords: wp, ebnf, PostScript
9;; Version: 1.0 9;; Version: 1.0
10 10
@@ -233,6 +233,8 @@
233 (setq token (ebnf-abn-lex)) 233 (setq token (ebnf-abn-lex))
234 (and (eq token 'end-of-input) 234 (and (eq token 'end-of-input)
235 (error "Invalid ABNF file format")) 235 (error "Invalid ABNF file format"))
236 (and (eq token 'end-of-rule)
237 (setq token (ebnf-abn-lex)))
236 (while (not (eq token 'end-of-input)) 238 (while (not (eq token 'end-of-input))
237 (ebnf-message-float 239 (ebnf-message-float
238 "Parsing...%s%%" 240 "Parsing...%s%%"
diff --git a/lisp/progmodes/ebnf-ebx.el b/lisp/progmodes/ebnf-ebx.el
new file mode 100644
index 00000000000..4e9fc24ade1
--- /dev/null
+++ b/lisp/progmodes/ebnf-ebx.el
@@ -0,0 +1,672 @@
1;;; ebnf-ebx.el --- parser for EBNF used to specify XML (EBNFX)
2
3;; Copyright (C) 2004 Free Sofware Foundation, Inc.
4
5;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
6;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
7;; Time-stamp: <2004/03/22 08:53:21 vinicius>
8;; Keywords: wp, ebnf, PostScript
9;; Version: 1.0
10
11;; This file is part of GNU Emacs.
12
13;; GNU Emacs is free software; you can redistribute it and/or modify
14;; it under the terms of the GNU General Public License as published by
15;; the Free Software Foundation; either version 2, or (at your option)
16;; any later version.
17
18;; GNU Emacs is distributed in the hope that it will be useful,
19;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;; GNU General Public License for more details.
22
23;; You should have received a copy of the GNU General Public License
24;; along with GNU Emacs; see the file COPYING. If not, write to the
25;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26;; Boston, MA 02111-1307, USA.
27
28;;; Commentary:
29
30;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
31;;
32;;
33;; This is part of ebnf2ps package.
34;;
35;; This package defines a parser for EBNF used to specify XML (EBNFX).
36;;
37;; See ebnf2ps.el for documentation.
38;;
39;;
40;; EBNFX Syntax
41;; ------------
42;;
43;; See the URL:
44;; `http://www.w3.org/TR/2004/REC-xml-20040204/#sec-notation'
45;; (Extensible Markup Language (XML) 1.0 (Third Edition))
46;;
47;;
48;; rule ::= symbol '::=' expression
49;; /* rules are separated by at least one blank line. */
50;;
51;; expression ::= concatenation ('|' concatenation)*
52;;
53;; concatenation ::= exception*
54;;
55;; exception ::= term ('-' term)?
56;;
57;; term ::= factor ('*' | '+' | '?')?
58;;
59;; factor ::= hex-char+
60;; | '[' '^'? ( char ( '-' char )? )+ ']'
61;; | '"' 'string' '"'
62;; | "'" "string" "'"
63;; | '(' expression ')'
64;; | symbol
65;;
66;; symbol ::= 'upper or lower case letter'
67;; ('upper or lower case letter' | '-' | '_')*
68;; /* upper and lower 8-bit accentuated characters are included */
69;;
70;; hex-char ::= '#x' [0-9A-Fa-f]+
71;;
72;; char ::= hex-char | 'any character except control characters'
73;; /* 8-bit accentuated characters are included */
74;;
75;; any-char ::= char | 'newline' | 'tab'
76;;
77;; ignore ::= '[' ('wfc' | 'WFC' | 'vc' | 'VC') ':' ( any-char - ']' )* ']'
78;;
79;; comment ::= '/*' ( any-char - '*/' ) '*/'
80;;
81;;
82;; Below is the Notation section extracted from the URL cited above.
83;;
84;; 6 Notation
85;;
86;; The formal grammar of XML is given in this specification using a simple
87;; Extended Backus-Naur Form (EBNF) notation. Each rule in the grammar defines
88;; one symbol, in the form
89;;
90;; symbol ::= expression
91;;
92;; Symbols are written with an initial capital letter if they are the start
93;; symbol of a regular language, otherwise with an initial lowercase letter.
94;; Literal strings are quoted.
95;;
96;; Within the expression on the right-hand side of a rule, the following
97;; expressions are used to match strings of one or more characters:
98;;
99;; #xN
100;;
101;; where N is a hexadecimal integer, the expression matches the character
102;; whose number (code point) in ISO/IEC 10646 is N. The number of leading
103;; zeros in the #xN form is insignificant.
104;;
105;; [a-zA-Z], [#xN-#xN]
106;;
107;; matches any Char with a value in the range(s) indicated (inclusive).
108;;
109;; [abc], [#xN#xN#xN]
110;;
111;; matches any Char with a value among the characters enumerated.
112;; Enumerations and ranges can be mixed in one set of brackets.
113;;
114;; [^a-z], [^#xN-#xN]
115;;
116;; matches any Char with a value outside the range indicated.
117;;
118;; [^abc], [^#xN#xN#xN]
119;;
120;; matches any Char with a value not among the characters given.
121;; Enumerations and ranges of forbidden values can be mixed in one set of
122;; brackets.
123;;
124;; "string"
125;;
126;; matches a literal string matching that given inside the double quotes.
127;;
128;; 'string'
129;;
130;; matches a literal string matching that given inside the single quotes.
131;;
132;; These symbols may be combined to match more complex patterns as follows,
133;; where A and B represent simple expressions:
134;;
135;; (expression)
136;;
137;; expression is treated as a unit and may be combined as described in this
138;; list.
139;;
140;; A?
141;;
142;; matches A or nothing; optional A.
143;;
144;; A B
145;;
146;; matches A followed by B. This operator has higher precedence than
147;; alternation; thus A B | C D is identical to (A B) | (C D).
148;;
149;; A | B
150;;
151;; matches A or B.
152;;
153;; A - B
154;;
155;; matches any string that matches A but does not match B.
156;;
157;; A+
158;;
159;; matches one or more occurrences of A. Concatenation has higher
160;; precedence than alternation; thus A+ | B+ is identical to (A+) | (B+).
161;;
162;; A*
163;;
164;; matches zero or more occurrences of A. Concatenation has higher
165;; precedence than alternation; thus A* | B* is identical to (A*) | (B*).
166;;
167;; Other notations used in the productions are:
168;;
169;; /* ... */
170;;
171;; comment.
172;;
173;; [ wfc: ... ]
174;;
175;; well-formedness constraint; this identifies by name a constraint on
176;; well-formed documents associated with a production.
177;;
178;; [ vc: ... ]
179;;
180;; validity constraint; this identifies by name a constraint on valid
181;; documents associated with a production.
182;;
183;;
184;; Differences Between EBNFX And ebnf2ps EBNFX
185;; -------------------------------------------
186;;
187;; Besides the characters that EBNFX accepts, ebnf2ps EBNFX accepts also the
188;; underscore (_) and minus (-) for rule name and european 8-bit accentuated
189;; characters (from \240 to \377) for rule name, string and comment. Also
190;; rule name can start with upper case letter.
191;;
192;;
193;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
194
195;;; Code:
196
197
198(require 'ebnf-otz)
199
200
201(defvar ebnf-ebx-lex nil
202 "Value returned by `ebnf-ebx-lex' function.")
203
204
205;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
206;; Syntactic analyzer
207
208
209;;; rulelist ::= rule+
210
211(defun ebnf-ebx-parser (start)
212 "EBNFX parser."
213 (let ((total (+ (- ebnf-limit start) 1))
214 (bias (1- start))
215 (origin (point))
216 rule-list token rule)
217 (goto-char start)
218 (setq token (ebnf-ebx-lex))
219 (and (eq token 'end-of-input)
220 (error "Invalid EBNFX file format"))
221 (and (eq token 'end-of-rule)
222 (setq token (ebnf-ebx-lex)))
223 (while (not (eq token 'end-of-input))
224 (ebnf-message-float
225 "Parsing...%s%%"
226 (/ (* (- (point) bias) 100.0) total))
227 (setq token (ebnf-ebx-rule token)
228 rule (cdr token)
229 token (car token))
230 (or (ebnf-add-empty-rule-list rule)
231 (setq rule-list (cons rule rule-list))))
232 (goto-char origin)
233 rule-list))
234
235
236;;; rule ::= symbol '::=' expression
237
238
239(defun ebnf-ebx-rule (token)
240 (let ((name ebnf-ebx-lex)
241 (action ebnf-action)
242 elements)
243 (setq ebnf-action nil)
244 (or (eq token 'non-terminal)
245 (error "Invalid rule name"))
246 (setq token (ebnf-ebx-lex))
247 (or (eq token 'production)
248 (error "Invalid rule: missing `::='"))
249 (setq elements (ebnf-ebx-expression))
250 (or (memq (car elements) '(end-of-rule end-of-input))
251 (error "Invalid rule: there is no end of rule"))
252 (setq elements (cdr elements))
253 (ebnf-eps-add-production name)
254 (cons (ebnf-ebx-lex)
255 (ebnf-make-production name elements action))))
256
257
258;; expression ::= concatenation ('|' concatenation)*
259
260
261(defun ebnf-ebx-expression ()
262 (let (body concatenation)
263 (while (eq (car (setq concatenation
264 (ebnf-ebx-concatenation (ebnf-ebx-lex))))
265 'alternative)
266 (setq body (cons (cdr concatenation) body)))
267 (ebnf-token-alternative body concatenation)))
268
269
270;; concatenation ::= exception*
271
272
273(defun ebnf-ebx-concatenation (token)
274 (let ((term (ebnf-ebx-exception token))
275 seq)
276 (or (setq token (car term)
277 term (cdr term))
278 (error "Empty element"))
279 (setq seq (cons term seq))
280 (while (setq term (ebnf-ebx-exception token)
281 token (car term)
282 term (cdr term))
283 (setq seq (cons term seq)))
284 (cons token
285 (if (= (length seq) 1)
286 ;; sequence with only one element
287 (car seq)
288 ;; a real sequence
289 (ebnf-make-sequence (nreverse seq))))))
290
291
292;;; exception ::= term ('-' term)?
293
294
295(defun ebnf-ebx-exception (token)
296 (let ((term (ebnf-ebx-term token)))
297 (if (eq (car term) 'exception)
298 (let ((except (ebnf-ebx-term (ebnf-ebx-lex))))
299 (cons (car except)
300 (ebnf-make-except (cdr term) (cdr except))))
301 term)))
302
303
304
305;;; term ::= factor ('*' | '+' | '?')?
306
307
308(defun ebnf-ebx-term (token)
309 (let ((factor (ebnf-ebx-factor token)))
310 (when factor
311 (setq token (ebnf-ebx-lex))
312 (cond ((eq token 'zero-or-more)
313 (setq factor (ebnf-make-zero-or-more factor)
314 token (ebnf-ebx-lex)))
315 ((eq token 'one-or-more)
316 (setq factor (ebnf-make-one-or-more factor)
317 token (ebnf-ebx-lex)))
318 ((eq token 'optional)
319 (setq factor (ebnf-token-optional factor)
320 token (ebnf-ebx-lex)))))
321 (cons token factor)))
322
323
324;;; factor ::= hex-char+
325;;; | '[' '^'? ( char ( '-' char )? )+ ']'
326;;; | '"' 'string' '"'
327;;; | "'" "string" "'"
328;;; | '(' expression ')'
329;;; | symbol
330;;;
331;;; symbol ::= 'upper or lower case letter'
332;;; ('upper or lower case letter' | '-' | '_')*
333;;; /* upper and lower 8-bit accentuated characters are included */
334;;;
335;;; hex-char ::= '#x' [0-9A-Fa-f]+
336;;;
337;;; char ::= hex-char | 'any character except control characters'
338;;; /* 8-bit accentuated characters are included */
339;;;
340;;; any-char ::= char | 'newline' | 'tab'
341
342
343(defun ebnf-ebx-factor (token)
344 (cond
345 ;; terminal
346 ((eq token 'terminal)
347 (ebnf-make-terminal ebnf-ebx-lex))
348 ;; non-terminal
349 ((eq token 'non-terminal)
350 (ebnf-make-non-terminal ebnf-ebx-lex))
351 ;; group
352 ((eq token 'begin-group)
353 (let ((body (ebnf-ebx-expression)))
354 (or (eq (car body) 'end-group)
355 (error "Missing `)'"))
356 (cdr body)))
357 ;; no element
358 (t
359 nil)
360 ))
361
362
363;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
364;; Lexical analyzer
365
366
367(defconst ebnf-ebx-token-table (make-vector 256 'error)
368 "Vector used to map characters to a lexical token.")
369
370
371(defun ebnf-ebx-initialize ()
372 "Initialize EBNFX token table."
373 ;; control character & control 8-bit character are set to `error'
374 (let ((char ?\101))
375 ;; printable character: A-Z
376 (while (< char ?\133)
377 (aset ebnf-ebx-token-table char 'non-terminal)
378 (setq char (1+ char)))
379 ;; printable character: a-z
380 (setq char ?\141)
381 (while (< char ?\173)
382 (aset ebnf-ebx-token-table char 'non-terminal)
383 (setq char (1+ char)))
384 ;; European 8-bit accentuated characters:
385 (setq char ?\240)
386 (while (< char ?\400)
387 (aset ebnf-ebx-token-table char 'non-terminal)
388 (setq char (1+ char)))
389 ;; Override end of line characters:
390 (aset ebnf-ebx-token-table ?\n 'end-of-rule) ; [NL] linefeed
391 (aset ebnf-ebx-token-table ?\r 'end-of-rule) ; [CR] carriage return
392 ;; Override space characters:
393 (aset ebnf-ebx-token-table ?\013 'space) ; [VT] vertical tab
394 (aset ebnf-ebx-token-table ?\t 'space) ; [HT] horizontal tab
395 (aset ebnf-ebx-token-table ?\ 'space) ; [SP] space
396 ;; Override form feed character:
397 (aset ebnf-ebx-token-table ?\f 'form-feed) ; [FF] form feed
398 ;; Override other lexical characters:
399 (aset ebnf-ebx-token-table ?# 'hash)
400 (aset ebnf-ebx-token-table ?\" 'double-quote)
401 (aset ebnf-ebx-token-table ?\' 'single-quote)
402 (aset ebnf-ebx-token-table ?\( 'begin-group)
403 (aset ebnf-ebx-token-table ?\) 'end-group)
404 (aset ebnf-ebx-token-table ?- 'exception)
405 (aset ebnf-ebx-token-table ?: 'colon)
406 (aset ebnf-ebx-token-table ?\[ 'begin-square)
407 (aset ebnf-ebx-token-table ?| 'alternative)
408 (aset ebnf-ebx-token-table ?* 'zero-or-more)
409 (aset ebnf-ebx-token-table ?+ 'one-or-more)
410 (aset ebnf-ebx-token-table ?\? 'optional)
411 ;; Override comment character:
412 (aset ebnf-ebx-token-table ?/ 'comment)))
413
414
415;; replace the range "\240-\377" (see `ebnf-range-regexp').
416(defconst ebnf-ebx-non-terminal-chars
417 (ebnf-range-regexp "-_A-Za-z" ?\240 ?\377))
418(defconst ebnf-ebx-non-terminal-letter-chars
419 (ebnf-range-regexp "A-Za-z" ?\240 ?\377))
420
421
422(defun ebnf-ebx-lex ()
423 "Lexical analyser for EBNFX.
424
425Return a lexical token.
426
427See documentation for variable `ebnf-ebx-lex'."
428 (if (>= (point) ebnf-limit)
429 'end-of-input
430 (let (token)
431 ;; skip spaces and comments
432 (while (if (> (following-char) 255)
433 (progn
434 (setq token 'error)
435 nil)
436 (setq token (aref ebnf-ebx-token-table (following-char)))
437 (cond
438 ((eq token 'space)
439 (skip-chars-forward " \013\t" ebnf-limit)
440 (< (point) ebnf-limit))
441 ((eq token 'comment)
442 (ebnf-ebx-skip-comment))
443 ((eq token 'form-feed)
444 (forward-char)
445 (setq ebnf-action 'form-feed))
446 ((eq token 'end-of-rule)
447 (ebnf-ebx-skip-end-of-rule))
448 ((and (eq token 'begin-square)
449 (let ((case-fold-search t))
450 (looking-at "\\[\\(wfc\\|vc\\):")))
451 (ebnf-ebx-skip-constraint))
452 (t nil)
453 )))
454 (cond
455 ;; end of input
456 ((>= (point) ebnf-limit)
457 'end-of-input)
458 ;; error
459 ((eq token 'error)
460 (error "Illegal character"))
461 ;; end of rule
462 ((eq token 'end-of-rule)
463 'end-of-rule)
464 ;; terminal: #x [0-9A-Fa-f]+
465 ((eq token 'hash)
466 (setq ebnf-ebx-lex (ebnf-ebx-character))
467 'terminal)
468 ;; terminal: "string"
469 ((eq token 'double-quote)
470 (setq ebnf-ebx-lex (ebnf-ebx-string ?\"))
471 'terminal)
472 ;; terminal: 'string'
473 ((eq token 'single-quote)
474 (setq ebnf-ebx-lex (ebnf-ebx-string ?\'))
475 'terminal)
476 ;; terminal: [ ^? ( char ( - char )? )+ ]
477 ((eq token 'begin-square)
478 (setq ebnf-ebx-lex (ebnf-ebx-range))
479 'terminal)
480 ;; non-terminal: NAME
481 ((eq token 'non-terminal)
482 (setq ebnf-ebx-lex
483 (ebnf-buffer-substring ebnf-ebx-non-terminal-chars))
484 'non-terminal)
485 ;; colon: ::=
486 ((eq token 'colon)
487 (or (looking-at "::=")
488 (error "Missing `::=' token"))
489 (forward-char 3)
490 'production)
491 ;; miscellaneous: (, ), *, +, ?, |, -
492 (t
493 (forward-char)
494 token)
495 ))))
496
497
498;; replace the range "\177-\237" (see `ebnf-range-regexp').
499(defconst ebnf-ebx-constraint-chars
500 (ebnf-range-regexp "^\000-\010\016-\037]" ?\177 ?\237))
501
502
503(defun ebnf-ebx-skip-constraint ()
504 (or (> (skip-chars-forward ebnf-ebx-constraint-chars ebnf-limit) 0)
505 (error "Invalid character"))
506 (or (= (following-char) ?\])
507 (error "Missing end of constraint `]'"))
508 (forward-char)
509 t)
510
511
512
513(defun ebnf-ebx-skip-end-of-rule ()
514 (let (eor-p)
515 (while (progn
516 ;; end of rule ==> 2 or more consecutive end of lines
517 (setq eor-p (or (> (skip-chars-forward "\r\n" ebnf-limit) 1)
518 eor-p))
519 ;; skip spaces
520 (skip-chars-forward " \013\t" ebnf-limit)
521 ;; skip comments
522 (and (= (following-char) ?/)
523 (ebnf-ebx-skip-comment))))
524 (not eor-p)))
525
526
527;; replace the range "\177-\237" (see `ebnf-range-regexp').
528(defconst ebnf-ebx-comment-chars
529 (ebnf-range-regexp "^\000-\010\016-\037\\*" ?\177 ?\237))
530(defconst ebnf-ebx-filename-chars
531 (ebnf-range-regexp "^\000-\037\\*" ?\177 ?\237))
532
533
534(defun ebnf-ebx-skip-comment ()
535 (forward-char)
536 (or (= (following-char) ?*)
537 (error "Invalid beginning of comment"))
538 (forward-char)
539 (cond
540 ;; open EPS file
541 ((and ebnf-eps-executing (= (following-char) ?\[))
542 (ebnf-eps-add-context (ebnf-ebx-eps-filename)))
543 ;; close EPS file
544 ((and ebnf-eps-executing (= (following-char) ?\]))
545 (ebnf-eps-remove-context (ebnf-ebx-eps-filename)))
546 ;; any other action in comment
547 (t
548 (setq ebnf-action (aref ebnf-comment-table (following-char))))
549 )
550 (while (progn
551 (skip-chars-forward ebnf-ebx-comment-chars ebnf-limit)
552 (or (= (following-char) ?*)
553 (error "Missing end of comment"))
554 (forward-char)
555 (and (/= (following-char) ?/)
556 (< (point) ebnf-limit))))
557 ;; check for a valid end of comment
558 (and (>= (point) ebnf-limit)
559 (error "Missing end of comment"))
560 (forward-char)
561 t)
562
563
564(defun ebnf-ebx-eps-filename ()
565 (forward-char)
566 (let (fname nchar)
567 (while (progn
568 (setq fname
569 (concat fname
570 (ebnf-buffer-substring ebnf-ebx-filename-chars)))
571 (and (< (point) ebnf-limit)
572 (> (setq nchar (skip-chars-forward "*" ebnf-limit)) 0)
573 (< (point) ebnf-limit)
574 (/= (following-char) ?/)))
575 (setq fname (concat fname (make-string nchar ?*))
576 nchar nil))
577 (if (or (not nchar) (= nchar 0))
578 fname
579 (and (< (point) ebnf-limit)
580 (= (following-char) ?/)
581 (setq nchar (1- nchar)))
582 (concat fname (make-string nchar ?*)))))
583
584
585;; replace the range "\240-\377" (see `ebnf-range-regexp').
586(defconst ebnf-ebx-double-string-chars
587 (ebnf-range-regexp "\t -!#-~" ?\240 ?\377))
588(defconst ebnf-ebx-single-string-chars
589 (ebnf-range-regexp "\t -&(-~" ?\240 ?\377))
590
591
592(defun ebnf-ebx-string (delim)
593 (buffer-substring-no-properties
594 (progn
595 (forward-char)
596 (point))
597 (progn
598 (skip-chars-forward (if (= delim ?\")
599 ebnf-ebx-double-string-chars
600 ebnf-ebx-single-string-chars)
601 ebnf-limit)
602 (or (= (following-char) delim)
603 (error "Missing string delimiter `%c'" delim))
604 (prog1
605 (point)
606 (forward-char)))))
607
608
609(defun ebnf-ebx-character ()
610 ;; #x [0-9A-Fa-f]+
611 (buffer-substring-no-properties
612 (point)
613 (progn
614 (ebnf-ebx-hex-character)
615 (point))))
616
617
618(defun ebnf-ebx-range ()
619 ;; [ ^? ( char ( - char )? )+ ]
620 (buffer-substring-no-properties
621 (point)
622 (progn
623 (forward-char)
624 (and (= (following-char) ?^)
625 (forward-char))
626 (and (= (following-char) ?-)
627 (forward-char))
628 (while (progn
629 (ebnf-ebx-any-character)
630 (when (= (following-char) ?-)
631 (forward-char)
632 (ebnf-ebx-any-character))
633 (and (/= (following-char) ?\])
634 (< (point) ebnf-limit))))
635 (and (>= (point) ebnf-limit)
636 (error "Missing end of character range `]'"))
637 (forward-char)
638 (point))))
639
640
641(defun ebnf-ebx-any-character ()
642 (let ((char (following-char)))
643 (cond ((= char ?#)
644 (ebnf-ebx-hex-character t))
645 ((or (and (<= ?\ char) (<= char ?\")) ; #
646 (and (<= ?$ char) (<= char ?,)) ; -
647 (and (<= ?. char) (<= char ?\\)) ; ]
648 (and (<= ?^ char) (<= char ?~))
649 (and (<= ?\240 char) (<= char ?\377)))
650 (forward-char))
651 (t
652 (error "Invalid character `%c'" char)))))
653
654
655(defun ebnf-ebx-hex-character (&optional no-error)
656 ;; #x [0-9A-Fa-f]+
657 (forward-char)
658 (if (/= (following-char) ?x)
659 (or no-error
660 (error "Invalid hexadecimal character"))
661 (forward-char)
662 (or (> (skip-chars-forward "0-9A-Fa-f" ebnf-limit) 0)
663 (error "Invalid hexadecimal character"))))
664
665
666;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
667
668
669(provide 'ebnf-ebx)
670
671;;; arch-tag: bfe2f95b-66bc-4dc6-8b7e-b7831e68f5fb
672;;; ebnf-ebx.el ends here
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el
index 96ec53ac501..56125cbea5a 100644
--- a/lisp/progmodes/ebnf2ps.el
+++ b/lisp/progmodes/ebnf2ps.el
@@ -5,9 +5,9 @@
5 5
6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> 6;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
7;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br> 7;; Maintainer: Vinicius Jose Latorre <viniciusjl@ig.com.br>
8;; Time-stamp: <2004/02/29 14:06:59 vinicius> 8;; Time-stamp: <2004/03/30 21:49:21 vinicius>
9;; Keywords: wp, ebnf, PostScript 9;; Keywords: wp, ebnf, PostScript
10;; Version: 4.0 10;; Version: 4.1
11;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ 11;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
12 12
13;; This file is part of GNU Emacs. 13;; This file is part of GNU Emacs.
@@ -27,8 +27,8 @@
27;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 27;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
28;; Boston, MA 02111-1307, USA. 28;; Boston, MA 02111-1307, USA.
29 29
30(defconst ebnf-version "4.0" 30(defconst ebnf-version "4.1"
31 "ebnf2ps.el, v 4.0 <2004/02/28 vinicius> 31 "ebnf2ps.el, v 4.1 <2004/03/18 vinicius>
32 32
33Vinicius's last change version. When reporting bugs, please also 33Vinicius's last change version. When reporting bugs, please also
34report the version of Emacs, if any, that ebnf2ps was running with. 34report the version of Emacs, if any, that ebnf2ps was running with.
@@ -320,6 +320,10 @@ Please send all bug fixes and enhancements to
320;; setting: 320;; setting:
321;; `ebnf-yac-ignore-error-recovery'. 321;; `ebnf-yac-ignore-error-recovery'.
322;; 322;;
323;; `ebnfx' ebnf2ps recognizes the syntax described in the URL:
324;; `http://www.w3.org/TR/2004/REC-xml-20040204/#sec-notation'
325;; ("Extensible Markup Language (XML) 1.0 (Third Edition)")
326;;
323;; Any other value is treated as `ebnf'. 327;; Any other value is treated as `ebnf'.
324;; 328;;
325;; The default value is `ebnf'. 329;; The default value is `ebnf'.
@@ -1679,9 +1683,14 @@ Valid values are:
1679 setting: 1683 setting:
1680 `ebnf-yac-ignore-error-recovery'. 1684 `ebnf-yac-ignore-error-recovery'.
1681 1685
1686 `ebnfx' ebnf2ps recognizes the syntax described in the URL:
1687 `http://www.w3.org/TR/2004/REC-xml-20040204/#sec-notation'
1688 (\"Extensible Markup Language (XML) 1.0 (Third Edition)\")
1689
1682Any other value is treated as `ebnf'." 1690Any other value is treated as `ebnf'."
1683 :type '(radio :tag "Syntax" 1691 :type '(radio :tag "Syntax"
1684 (const ebnf) (const abnf) (const iso-ebnf) (const yacc)) 1692 (const ebnf) (const abnf) (const iso-ebnf)
1693 (const yacc) (const ebnfx))
1685 :group 'ebnf-syntactic) 1694 :group 'ebnf-syntactic)
1686 1695
1687 1696
@@ -2393,6 +2402,10 @@ See also `ebnf-syntax-buffer'."
2393 (yacc 2402 (yacc
2394 default 2403 default
2395 (ebnf-syntax . 'yacc)) 2404 (ebnf-syntax . 'yacc))
2405 ;; ebnfx default
2406 (ebnfx
2407 default
2408 (ebnf-syntax . 'ebnfx))
2396 ) 2409 )
2397 "Style database. 2410 "Style database.
2398 2411
@@ -4650,7 +4663,8 @@ killed after process termination."
4650 '((iso-ebnf ebnf-iso-parser ebnf-iso-initialize) 4663 '((iso-ebnf ebnf-iso-parser ebnf-iso-initialize)
4651 (yacc ebnf-yac-parser ebnf-yac-initialize) 4664 (yacc ebnf-yac-parser ebnf-yac-initialize)
4652 (abnf ebnf-abn-parser ebnf-abn-initialize) 4665 (abnf ebnf-abn-parser ebnf-abn-initialize)
4653 (ebnf ebnf-bnf-parser ebnf-bnf-initialize)) 4666 (ebnf ebnf-bnf-parser ebnf-bnf-initialize)
4667 (ebnfx ebnf-ebx-parser ebnf-ebx-initialize))
4654 "Alist associating ebnf syntax with a parser and a initializer.") 4668 "Alist associating ebnf syntax with a parser and a initializer.")
4655 4669
4656 4670
@@ -4748,52 +4762,53 @@ killed after process termination."
4748 4762
4749 4763
4750(defun ebnf-eps-finish-and-write (buffer filename) 4764(defun ebnf-eps-finish-and-write (buffer filename)
4751 (save-excursion 4765 (when (buffer-modified-p buffer)
4752 (set-buffer buffer) 4766 (save-excursion
4753 (setq ebnf-eps-upper-x (max ebnf-eps-upper-x ebnf-eps-max-width) 4767 (set-buffer buffer)
4754 ebnf-eps-upper-y (if (zerop ebnf-eps-upper-y) 4768 (setq ebnf-eps-upper-x (max ebnf-eps-upper-x ebnf-eps-max-width)
4755 ebnf-eps-max-height 4769 ebnf-eps-upper-y (if (zerop ebnf-eps-upper-y)
4756 (+ ebnf-eps-upper-y 4770 ebnf-eps-max-height
4757 ebnf-production-vertical-space 4771 (+ ebnf-eps-upper-y
4758 ebnf-eps-max-height))) 4772 ebnf-production-vertical-space
4759 ;; prologue 4773 ebnf-eps-max-height)))
4760 (goto-char (point-min)) 4774 ;; prologue
4761 (insert 4775 (goto-char (point-min))
4762 "%!PS-Adobe-3.0 EPSF-3.0" 4776 (insert
4763 "\n%%BoundingBox: 0 0 " 4777 "%!PS-Adobe-3.0 EPSF-3.0"
4764 (format "%d %d" (1+ ebnf-eps-upper-x) (1+ ebnf-eps-upper-y)) 4778 "\n%%BoundingBox: 0 0 "
4765 "\n%%Title: " filename 4779 (format "%d %d" (1+ ebnf-eps-upper-x) (1+ ebnf-eps-upper-y))
4766 "\n%%CreationDate: " (format-time-string "%T %b %d %Y") 4780 "\n%%Title: " filename
4767 "\n%%Creator: " (user-full-name) " (using ebnf2ps v" ebnf-version ")" 4781 "\n%%CreationDate: " (format-time-string "%T %b %d %Y")
4768 "\n%%DocumentNeededResources: font " 4782 "\n%%Creator: " (user-full-name) " (using ebnf2ps v" ebnf-version ")"
4769 (or ebnf-fonts-required 4783 "\n%%DocumentNeededResources: font "
4770 (setq ebnf-fonts-required 4784 (or ebnf-fonts-required
4771 (mapconcat 'identity 4785 (setq ebnf-fonts-required
4772 (ps-remove-duplicates 4786 (mapconcat 'identity
4773 (mapcar 'ebnf-font-name-select 4787 (ps-remove-duplicates
4774 (list ebnf-production-font 4788 (mapcar 'ebnf-font-name-select
4775 ebnf-terminal-font 4789 (list ebnf-production-font
4776 ebnf-non-terminal-font 4790 ebnf-terminal-font
4777 ebnf-special-font 4791 ebnf-non-terminal-font
4778 ebnf-except-font 4792 ebnf-special-font
4779 ebnf-repeat-font))) 4793 ebnf-except-font
4780 "\n%%+ font "))) 4794 ebnf-repeat-font)))
4781 "\n%%Pages: 0\n%%EndComments\n\n%%BeginProlog\n" 4795 "\n%%+ font ")))
4782 ebnf-eps-prologue) 4796 "\n%%Pages: 0\n%%EndComments\n\n%%BeginProlog\n"
4783 (ebnf-insert-ebnf-prologue) 4797 ebnf-eps-prologue)
4784 (insert ebnf-eps-begin 4798 (ebnf-insert-ebnf-prologue)
4785 "\n0 " (ebnf-format-float 4799 (insert ebnf-eps-begin
4786 (- ebnf-eps-upper-y (* ebnf-font-height-P 0.7))) 4800 "\n0 " (ebnf-format-float
4787 " #ebnf2ps#begin\n") 4801 (- ebnf-eps-upper-y (* ebnf-font-height-P 0.7)))
4788 ;; epilogue 4802 " #ebnf2ps#begin\n")
4789 (goto-char (point-max)) 4803 ;; epilogue
4790 (insert ebnf-eps-end) 4804 (goto-char (point-max))
4791 ;; write file 4805 (insert ebnf-eps-end)
4792 (message "Saving...") 4806 ;; write file
4793 (setq filename (expand-file-name filename)) 4807 (message "Saving...")
4794 (let ((coding-system-for-write 'raw-text-unix)) 4808 (setq filename (expand-file-name filename))
4795 (write-region (point-min) (point-max) filename)) 4809 (let ((coding-system-for-write 'raw-text-unix))
4796 (message "Wrote %s" filename))) 4810 (write-region (point-min) (point-max) filename))
4811 (message "Wrote %s" filename))))
4797 4812
4798 4813
4799(defun ebnf-insert-ebnf-prologue () 4814(defun ebnf-insert-ebnf-prologue ()
@@ -5688,6 +5703,12 @@ killed after process termination."
5688(autoload 'ebnf-yac-initialize "ebnf-yac" 5703(autoload 'ebnf-yac-initialize "ebnf-yac"
5689 "Initializations for Yacc/Bison parser.") 5704 "Initializations for Yacc/Bison parser.")
5690 5705
5706(autoload 'ebnf-ebx-parser "ebnf-ebx"
5707 "EBNFX parser.")
5708
5709(autoload 'ebnf-ebx-initialize "ebnf-ebx"
5710 "Initializations for EBNFX parser.")
5711
5691(autoload 'ebnf-eliminate-empty-rules "ebnf-otz" 5712(autoload 'ebnf-eliminate-empty-rules "ebnf-otz"
5692 "Eliminate empty rules.") 5713 "Eliminate empty rules.")
5693 5714
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 08a5a2ccbd3..6fccd500af2 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -69,9 +69,14 @@
69The directory containing FILE becomes the initial working directory 69The directory containing FILE becomes the initial working directory
70and source-file directory for your debugger. 70and source-file directory for your debugger.
71 71
72If `gdb-many-windows' is nil (the default value) then gdb starts with 72If `gdb-many-windows' is nil (the default value) then gdb just
73just two windows : the GUD and the source buffer. If it is t the 73pops up the GUD buffer unless `gdb-show-main' is t. In this case
74following layout will appear (keybindings given in relevant buffer) : 74it starts with two windows: one displaying the GUD buffer and the
75other with the source file with the main routine of the debugee.
76
77If `gdb-many-windows' is t the layout below will appear
78regardless of the value of `gdb-show-main'. Keybindings are given
79in relevant buffer.
75 80
76--------------------------------------------------------------------- 81---------------------------------------------------------------------
77 GDB Toolbar 82 GDB Toolbar
@@ -81,7 +86,7 @@ GUD buffer (I/O of GDB) | Locals buffer
81 | 86 |
82 | 87 |
83--------------------------------------------------------------------- 88---------------------------------------------------------------------
84Source buffer | Input/Output (of debuggee) buffer 89Source buffer | Input/Output (of debugee) buffer
85 | (comint-mode) 90 | (comint-mode)
86 | 91 |
87 | 92 |
@@ -309,7 +314,7 @@ speedbar."
309 (let ((varnum (match-string 1))) 314 (let ((varnum (match-string 1)))
310 (gdb-enqueue-input 315 (gdb-enqueue-input
311 (list (concat "server interpreter mi \"-var-evaluate-expression " 316 (list (concat "server interpreter mi \"-var-evaluate-expression "
312 varnum "\"\n") 317 varnum "\"\n")
313 `(lambda () (gdb-var-evaluate-expression-handler 318 `(lambda () (gdb-var-evaluate-expression-handler
314 ,varnum t))))))) 319 ,varnum t)))))))
315 (gdb-set-pending-triggers 320 (gdb-set-pending-triggers
@@ -672,7 +677,10 @@ This filter may simply queue output for a later time."
672 (match-string 1 args) 677 (match-string 1 args)
673 (string-to-int (match-string 2 args)))) 678 (string-to-int (match-string 2 args))))
674 (setq gdb-current-address (match-string 3 args)) 679 (setq gdb-current-address (match-string 3 args))
675 (setq gdb-view-source t)) 680 (setq gdb-view-source t)
681;; cover for auto-display output which comes *before*
682;; stopped annotation
683 (if (eq (gdb-get-output-sink) 'inferior) (gdb-set-output-sink 'user)))
676 684
677(defun gdb-send-item (item) 685(defun gdb-send-item (item)
678 (if gdb-enable-debug-log (push (cons 'send item) gdb-debug-log)) 686 (if gdb-enable-debug-log (push (cons 'send item) gdb-debug-log))
@@ -778,7 +786,8 @@ output from the current command if that happens to be appropriate."
778 (gdb-invalidate-registers) 786 (gdb-invalidate-registers)
779 (gdb-invalidate-locals) 787 (gdb-invalidate-locals)
780 (gdb-invalidate-threads) 788 (gdb-invalidate-threads)
781 (unless (eq window-system 'mac) 789 (unless (eq system-type 'darwin) ;Breaks on Darwin's GDB-5.3.
790 ;; FIXME: with GDB-6 on Darwin, this might very well work.
782 (dolist (frame (frame-list)) 791 (dolist (frame (frame-list))
783 (when (string-equal (frame-parameter frame 'name) "Speedbar") 792 (when (string-equal (frame-parameter frame 'name) "Speedbar")
784 (setq gdb-var-changed t) ; force update 793 (setq gdb-var-changed t) ; force update
@@ -1596,24 +1605,38 @@ the source buffer."
1596(defun gdb-view-source-function () 1605(defun gdb-view-source-function ()
1597 (interactive) 1606 (interactive)
1598 (if gdb-view-source 1607 (if gdb-view-source
1599 (if gud-last-last-frame 1608 (if (window-live-p gdb-source-window)
1600 (set-window-buffer gdb-source-window 1609 (set-window-buffer gdb-source-window
1601 (gud-find-file (car gud-last-last-frame))) 1610 (if gud-last-last-frame
1602 (set-window-buffer gdb-source-window (gud-find-file gdb-main-file)))) 1611 (gud-find-file (car gud-last-last-frame))
1612 (gud-find-file gdb-main-file)))
1613 (setq gdb-source-window
1614 (display-buffer
1615 (if gud-last-last-frame
1616 (gud-find-file (car gud-last-last-frame))
1617 (gud-find-file gdb-main-file))))))
1603 (setq gdb-selected-view 'source)) 1618 (setq gdb-selected-view 'source))
1604 1619
1605(defun gdb-view-assembler() 1620(defun gdb-view-assembler()
1606 (interactive) 1621 (interactive)
1607 (set-window-buffer gdb-source-window 1622 (if (window-live-p gdb-source-window)
1608 (gdb-get-create-buffer 'gdb-assembler-buffer)) 1623 (set-window-buffer gdb-source-window
1624 (gdb-get-create-buffer 'gdb-assembler-buffer))
1625 (setq gdb-source-window
1626 (display-buffer (gdb-get-create-buffer 'gdb-assembler-buffer))))
1609 (setq gdb-selected-view 'assembler)) 1627 (setq gdb-selected-view 'assembler))
1610 1628
1611;(defun gdb-view-both() 1629;(defun gdb-view-both()
1612;(interactive) 1630;(interactive)
1613;(setq gdb-selected-view 'both)) 1631;(setq gdb-selected-view 'both))
1614 1632
1615;; layout for all the windows 1633(defcustom gdb-show-main nil
1634 "Nil means don't display source file containing the main routine."
1635 :type 'boolean
1636 :group 'gud)
1637
1616(defun gdb-setup-windows () 1638(defun gdb-setup-windows ()
1639 "Layout the window pattern for gdb-many-windows."
1617 (gdb-display-locals-buffer) 1640 (gdb-display-locals-buffer)
1618 (gdb-display-stack-buffer) 1641 (gdb-display-stack-buffer)
1619 (delete-other-windows) 1642 (delete-other-windows)
@@ -1714,20 +1737,20 @@ buffers."
1714 (if (looking-at "\\S-*") 1737 (if (looking-at "\\S-*")
1715 (setq gdb-main-file (match-string 0))) 1738 (setq gdb-main-file (match-string 0)))
1716 (setq gdb-view-source nil)) 1739 (setq gdb-view-source nil))
1717 (delete-other-windows)
1718 (switch-to-buffer gud-comint-buffer)
1719 (if gdb-many-windows 1740 (if gdb-many-windows
1720 (gdb-setup-windows) 1741 (gdb-setup-windows)
1721 (gdb-display-breakpoints-buffer) 1742 (gdb-get-create-buffer 'gdb-breakpoints-buffer)
1722 (delete-other-windows) 1743 (when gdb-show-main
1723 (split-window) 1744 (switch-to-buffer gud-comint-buffer)
1724 (other-window 1) 1745 (delete-other-windows)
1725 (switch-to-buffer 1746 (split-window)
1726 (if gdb-view-source 1747 (other-window 1)
1727 (gud-find-file gdb-main-file) 1748 (switch-to-buffer
1728 (gdb-get-create-buffer 'gdb-assembler-buffer))) 1749 (if gdb-view-source
1729 (setq gdb-source-window (get-buffer-window (current-buffer))) 1750 (gud-find-file gdb-main-file)
1730 (other-window 1))) 1751 (gdb-get-create-buffer 'gdb-assembler-buffer)))
1752 (setq gdb-source-window (get-buffer-window (current-buffer)))
1753 (other-window 1))))
1731 1754
1732;;from put-image 1755;;from put-image
1733(defun gdb-put-string (putstring pos &optional dprop) 1756(defun gdb-put-string (putstring pos &optional dprop)
@@ -1764,9 +1787,9 @@ BUFFER nil or omitted means use the current buffer."
1764 (gdb-remove-breakpoint-icons start end) 1787 (gdb-remove-breakpoint-icons start end)
1765 (if (display-images-p) 1788 (if (display-images-p)
1766 (if (>= (car (window-fringes)) 8) 1789 (if (>= (car (window-fringes)) 8)
1767 (gdb-put-string 1790 (gdb-put-string
1768 nil (1+ start) 1791 nil (1+ start)
1769 `(left-fringe 1792 `(left-fringe
1770 ,(or breakpoint-bitmap 1793 ,(or breakpoint-bitmap
1771 (setq breakpoint-bitmap 1794 (setq breakpoint-bitmap
1772 (define-fringe-bitmap 1795 (define-fringe-bitmap
@@ -1786,7 +1809,7 @@ BUFFER nil or omitted means use the current buffer."
1786 (if enabled 1809 (if enabled
1787 (or breakpoint-enabled-icon 1810 (or breakpoint-enabled-icon
1788 (setq breakpoint-enabled-icon 1811 (setq breakpoint-enabled-icon
1789 (find-image `((:type xpm :data 1812 (find-image `((:type xpm :data
1790 ,breakpoint-xpm-data 1813 ,breakpoint-xpm-data
1791 :ascent 100 :pointer hand) 1814 :ascent 100 :pointer hand)
1792 (:type pbm :data 1815 (:type pbm :data
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index ff04c05edff..a34b0bb2d48 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -477,7 +477,7 @@ off the specialized speedbar mode."
477 ;; gud-marker-acc until we receive the rest of it. Since we 477 ;; gud-marker-acc until we receive the rest of it. Since we
478 ;; know the full marker regexp above failed, it's pretty simple to 478 ;; know the full marker regexp above failed, it's pretty simple to
479 ;; test for marker starts. 479 ;; test for marker starts.
480 (if (string-match "\032.*\\'" gud-marker-acc) 480 (if (string-match "\n\\(\032.*\\)?\\'" gud-marker-acc)
481 (progn 481 (progn
482 ;; Everything before the potential marker start can be output. 482 ;; Everything before the potential marker start can be output.
483 (setq output (concat output (substring gud-marker-acc 483 (setq output (concat output (substring gud-marker-acc
diff --git a/lisp/subr.el b/lisp/subr.el
index 2c39a8447cf..74809c678eb 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2274,28 +2274,6 @@ macros."
2274 (subrp object) (byte-code-function-p object) 2274 (subrp object) (byte-code-function-p object)
2275 (eq (car-safe object) 'lambda))) 2275 (eq (car-safe object) 'lambda)))
2276 2276
2277(defun interactive-form (function)
2278 "Return the interactive form of FUNCTION.
2279If function is a command (see `commandp'), value is a list of the form
2280\(interactive SPEC). If function is not a command, return nil."
2281 (setq function (indirect-function function))
2282 (when (commandp function)
2283 (cond ((byte-code-function-p function)
2284 (when (> (length function) 5)
2285 (let ((spec (aref function 5)))
2286 (if spec
2287 (list 'interactive spec)
2288 (list 'interactive)))))
2289 ((subrp function)
2290 (subr-interactive-form function))
2291 ((eq (car-safe function) 'lambda)
2292 (setq function (cddr function))
2293 (when (stringp (car function))
2294 (setq function (cdr function)))
2295 (let ((form (car function)))
2296 (when (eq (car-safe form) 'interactive)
2297 (copy-sequence form)))))))
2298
2299(defun assq-delete-all (key alist) 2277(defun assq-delete-all (key alist)
2300 "Delete from ALIST all elements whose car is KEY. 2278 "Delete from ALIST all elements whose car is KEY.
2301Return the modified alist. 2279Return the modified alist.
diff --git a/lisp/vc.el b/lisp/vc.el
index 7cceab6779c..9e1f36f93ce 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -7,7 +7,7 @@
7;; Maintainer: Andre Spiegel <spiegel@gnu.org> 7;; Maintainer: Andre Spiegel <spiegel@gnu.org>
8;; Keywords: tools 8;; Keywords: tools
9 9
10;; $Id: vc.el,v 1.373 2004/03/26 16:17:12 monnier Exp $ 10;; $Id: vc.el,v 1.374 2004/03/28 22:00:19 monnier Exp $
11 11
12;; This file is part of GNU Emacs. 12;; This file is part of GNU Emacs.
13 13
@@ -1677,10 +1677,10 @@ saving the buffer."
1677 (message "No changes to %s since latest version" file) 1677 (message "No changes to %s since latest version" file)
1678 (vc-version-diff file nil nil))))) 1678 (vc-version-diff file nil nil)))))
1679 1679
1680(defun vc-version-diff (file rel1 rel2) 1680(defun vc-version-diff (file rev1 rev2)
1681 "List the differences between FILE's versions REL1 and REL2. 1681 "List the differences between FILE's versions REV1 and REV2.
1682If REL1 is empty or nil it means to use the current workfile version; 1682If REV1 is empty or nil it means to use the current workfile version;
1683REL2 empty or nil means the current file contents. FILE may also be 1683REV2 empty or nil means the current file contents. FILE may also be
1684a directory, in that case, generate diffs between the correponding 1684a directory, in that case, generate diffs between the correponding
1685versions of all registered files in or below it." 1685versions of all registered files in or below it."
1686 (interactive 1686 (interactive
@@ -1689,7 +1689,7 @@ versions of all registered files in or below it."
1689 "File or dir to diff: (default visited file) " 1689 "File or dir to diff: (default visited file) "
1690 "File or dir to diff: ") 1690 "File or dir to diff: ")
1691 default-directory buffer-file-name t))) 1691 default-directory buffer-file-name t)))
1692 (rel1-default nil) (rel2-default nil)) 1692 (rev1-default nil) (rev2-default nil))
1693 ;; compute default versions based on the file state 1693 ;; compute default versions based on the file state
1694 (cond 1694 (cond
1695 ;; if it's a directory, don't supply any version default 1695 ;; if it's a directory, don't supply any version default
@@ -1697,54 +1697,54 @@ versions of all registered files in or below it."
1697 nil) 1697 nil)
1698 ;; if the file is not up-to-date, use current version as older version 1698 ;; if the file is not up-to-date, use current version as older version
1699 ((not (vc-up-to-date-p file)) 1699 ((not (vc-up-to-date-p file))
1700 (setq rel1-default (vc-workfile-version file))) 1700 (setq rev1-default (vc-workfile-version file)))
1701 ;; if the file is not locked, use last and previous version as default 1701 ;; if the file is not locked, use last and previous version as default
1702 (t 1702 (t
1703 (setq rel1-default (vc-call previous-version file 1703 (setq rev1-default (vc-call previous-version file
1704 (vc-workfile-version file))) 1704 (vc-workfile-version file)))
1705 (if (string= rel1-default "") (setq rel1-default nil)) 1705 (if (string= rev1-default "") (setq rev1-default nil))
1706 (setq rel2-default (vc-workfile-version file)))) 1706 (setq rev2-default (vc-workfile-version file))))
1707 ;; construct argument list 1707 ;; construct argument list
1708 (list file 1708 (list file
1709 (read-string (if rel1-default 1709 (read-string (if rev1-default
1710 (concat "Older version: (default " 1710 (concat "Older version: (default "
1711 rel1-default ") ") 1711 rev1-default ") ")
1712 "Older version: ") 1712 "Older version: ")
1713 nil nil rel1-default) 1713 nil nil rev1-default)
1714 (read-string (if rel2-default 1714 (read-string (if rev2-default
1715 (concat "Newer version: (default " 1715 (concat "Newer version: (default "
1716 rel2-default ") ") 1716 rev2-default ") ")
1717 "Newer version (default: current source): ") 1717 "Newer version (default: current source): ")
1718 nil nil rel2-default)))) 1718 nil nil rev2-default))))
1719 (if (file-directory-p file) 1719 (if (file-directory-p file)
1720 ;; recursive directory diff 1720 ;; recursive directory diff
1721 (progn 1721 (progn
1722 (vc-setup-buffer "*vc-diff*") 1722 (vc-setup-buffer "*vc-diff*")
1723 (if (string-equal rel1 "") (setq rel1 nil)) 1723 (if (string-equal rev1 "") (setq rev1 nil))
1724 (if (string-equal rel2 "") (setq rel2 nil)) 1724 (if (string-equal rev2 "") (setq rev2 nil))
1725 (let ((inhibit-read-only t)) 1725 (let ((inhibit-read-only t))
1726 (insert "Diffs between " 1726 (insert "Diffs between "
1727 (or rel1 "last version checked in") 1727 (or rev1 "last version checked in")
1728 " and " 1728 " and "
1729 (or rel2 "current workfile(s)") 1729 (or rev2 "current workfile(s)")
1730 ":\n\n")) 1730 ":\n\n"))
1731 (let ((dir (file-name-as-directory file))) 1731 (let ((dir (file-name-as-directory file)))
1732 (vc-call-backend (vc-responsible-backend dir) 1732 (vc-call-backend (vc-responsible-backend dir)
1733 'diff-tree dir rel1 rel2)) 1733 'diff-tree dir rev1 rev2))
1734 (vc-exec-after `(let ((inhibit-read-only t)) 1734 (vc-exec-after `(let ((inhibit-read-only t))
1735 (insert "\nEnd of diffs.\n")))) 1735 (insert "\nEnd of diffs.\n"))))
1736 ;; Single file diff. It is important that the vc-controlled buffer 1736 ;; Single file diff. It is important that the vc-controlled buffer
1737 ;; is still current at this time, because any local settings in that 1737 ;; is still current at this time, because any local settings in that
1738 ;; buffer should affect the diff command. 1738 ;; buffer should affect the diff command.
1739 (vc-diff-internal file rel1 rel2)) 1739 (vc-diff-internal file rev1 rev2))
1740 (set-buffer "*vc-diff*") 1740 (set-buffer "*vc-diff*")
1741 (if (and (zerop (buffer-size)) 1741 (if (and (zerop (buffer-size))
1742 (not (get-buffer-process (current-buffer)))) 1742 (not (get-buffer-process (current-buffer))))
1743 (progn 1743 (progn
1744 (if rel1 1744 (if rev1
1745 (if rel2 1745 (if rev2
1746 (message "No changes to %s between %s and %s" file rel1 rel2) 1746 (message "No changes to %s between %s and %s" file rev1 rev2)
1747 (message "No changes to %s since %s" file rel1)) 1747 (message "No changes to %s since %s" file rev1))
1748 (message "No changes to %s since latest version" file)) 1748 (message "No changes to %s since latest version" file))
1749 nil) 1749 nil)
1750 (pop-to-buffer (current-buffer)) 1750 (pop-to-buffer (current-buffer))
@@ -1758,29 +1758,40 @@ versions of all registered files in or below it."
1758 (shrink-window-if-larger-than-buffer))) 1758 (shrink-window-if-larger-than-buffer)))
1759 t)) 1759 t))
1760 1760
1761(defun vc-diff-internal (file rel1 rel2) 1761(defun vc-diff-label (file file-rev rev)
1762 "Run diff to compare FILE's revisions REL1 and REL2. 1762 (concat (file-relative-name file)
1763 (format-time-string "\t%d %b %Y %T %z\t"
1764 (nth 5 (file-attributes file-rev)))
1765 rev))
1766
1767(defun vc-diff-internal (file rev1 rev2)
1768 "Run diff to compare FILE's revisions REV1 and REV2.
1763Diff output goes to the *vc-diff* buffer. The exit status of the diff 1769Diff output goes to the *vc-diff* buffer. The exit status of the diff
1764command is returned. 1770command is returned.
1765 1771
1766This function takes care to set up a proper coding system for diff output. 1772This function takes care to set up a proper coding system for diff output.
1767If both revisions are available as local files, then it also does not 1773If both revisions are available as local files, then it also does not
1768actually call the backend, but performs a local diff." 1774actually call the backend, but performs a local diff."
1769 (if (or (not rel1) (string-equal rel1 "")) 1775 (if (or (not rev1) (string-equal rev1 ""))
1770 (setq rel1 (vc-workfile-version file))) 1776 (setq rev1 (vc-workfile-version file)))
1771 (if (string-equal rel2 "") 1777 (if (string-equal rev2 "")
1772 (setq rel2 nil)) 1778 (setq rev2 nil))
1773 (let ((file-rel1 (vc-version-backup-file file rel1)) 1779 (let ((file-rev1 (vc-version-backup-file file rev1))
1774 (file-rel2 (if (not rel2) 1780 (file-rev2 (if (not rev2)
1775 file 1781 file
1776 (vc-version-backup-file file rel2))) 1782 (vc-version-backup-file file rev2)))
1777 (coding-system-for-read (vc-coding-system-for-diff file))) 1783 (coding-system-for-read (vc-coding-system-for-diff file)))
1778 (if (and file-rel1 file-rel2) 1784 (if (and file-rev1 file-rev2)
1779 (apply 'vc-do-command "*vc-diff*" 1 "diff" nil 1785 (apply 'vc-do-command "*vc-diff*" 1 "diff" nil
1780 (append (vc-switches nil 'diff) 1786 (append (vc-switches nil 'diff)
1781 (list (file-relative-name file-rel1) 1787 ;; Provide explicit labels like RCS or CVS would do
1782 (file-relative-name file-rel2)))) 1788 ;; so diff-mode refers to `file' rather than to
1783 (vc-call diff file rel1 rel2)))) 1789 ;; `file-rev1' when trying to find/apply/undo hunks.
1790 (list "-L" (vc-diff-label file file-rev1 rev1)
1791 "-L" (vc-diff-label file file-rev2 rev2)
1792 (file-relative-name file-rev1)
1793 (file-relative-name file-rev2))))
1794 (vc-call diff file rev1 rev2))))
1784 1795
1785 1796
1786(defun vc-switches (backend op) 1797(defun vc-switches (backend op)
@@ -1804,9 +1815,9 @@ actually call the backend, but performs a local diff."
1804(defmacro vc-diff-switches-list (backend) `(vc-switches ',backend 'diff)) 1815(defmacro vc-diff-switches-list (backend) `(vc-switches ',backend 'diff))
1805(make-obsolete 'vc-diff-switches-list 'vc-switches "21.4") 1816(make-obsolete 'vc-diff-switches-list 'vc-switches "21.4")
1806 1817
1807(defun vc-default-diff-tree (backend dir rel1 rel2) 1818(defun vc-default-diff-tree (backend dir rev1 rev2)
1808 "List differences for all registered files at and below DIR. 1819 "List differences for all registered files at and below DIR.
1809The meaning of REL1 and REL2 is the same as for `vc-version-diff'." 1820The meaning of REV1 and REV2 is the same as for `vc-version-diff'."
1810 ;; This implementation does an explicit tree walk, and calls 1821 ;; This implementation does an explicit tree walk, and calls
1811 ;; vc-BACKEND-diff directly for each file. An optimization 1822 ;; vc-BACKEND-diff directly for each file. An optimization
1812 ;; would be to use `vc-diff-internal', so that diffs can be local, 1823 ;; would be to use `vc-diff-internal', so that diffs can be local,
@@ -1821,7 +1832,7 @@ The meaning of REL1 and REL2 is the same as for `vc-version-diff'."
1821 `(let ((coding-system-for-read (vc-coding-system-for-diff ',f))) 1832 `(let ((coding-system-for-read (vc-coding-system-for-diff ',f)))
1822 (message "Looking at %s" ',f) 1833 (message "Looking at %s" ',f)
1823 (vc-call-backend ',(vc-backend f) 1834 (vc-call-backend ',(vc-backend f)
1824 'diff ',f ',rel1 ',rel2)))))) 1835 'diff ',f ',rev1 ',rev2))))))
1825 1836
1826(defun vc-coding-system-for-diff (file) 1837(defun vc-coding-system-for-diff (file)
1827 "Return the coding system for reading diff output for FILE." 1838 "Return the coding system for reading diff output for FILE."
diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el
index 32645bd6012..41e9e3e78b2 100644
--- a/lisp/x-dnd.el
+++ b/lisp/x-dnd.el
@@ -337,7 +337,12 @@ WINDOW is the window where the drop happened. ACTION is ignored.
337DATA is the moz-url, which is formatted as two strings separated by \r\n. 337DATA is the moz-url, which is formatted as two strings separated by \r\n.
338The first string is the URL, the second string is the title of that URL. 338The first string is the URL, the second string is the title of that URL.
339DATA is encoded in utf-16. Decode the URL and call `x-dnd-handle-uri-list'." 339DATA is encoded in utf-16. Decode the URL and call `x-dnd-handle-uri-list'."
340 (let* ((string (decode-coding-string data 'utf-16le)) ;; ALWAYS LE??? 340 ;; Mozilla and applications based on it (Galeon for example) uses
341 ;; text/unicode, but it is impossible to tell if it is le or be. Use what
342 ;; the machine Emacs runs on use. This looses if dropping between machines
343 ;; with different endian, but it is the best we can do.
344 (let* ((coding (if (eq (byteorder) ?B) 'utf-16be 'utf-16le))
345 (string (decode-coding-string data coding))
341 (strings (split-string string "[\r\n]" t)) 346 (strings (split-string string "[\r\n]" t))
342 ;; Can one drop more than one moz-url ?? Assume not. 347 ;; Can one drop more than one moz-url ?? Assume not.
343 (url (car strings)) 348 (url (car strings))
@@ -352,7 +357,9 @@ TEXT is the text as a string, WINDOW is the window where the drop happened."
352(defun x-dnd-insert-utf16-text (window action text) 357(defun x-dnd-insert-utf16-text (window action text)
353 "Decode the UTF-16 text and insert it at point. 358 "Decode the UTF-16 text and insert it at point.
354TEXT is the text as a string, WINDOW is the window where the drop happened." 359TEXT is the text as a string, WINDOW is the window where the drop happened."
355 (x-dnd-insert-text window action (decode-coding-string text 'utf-16le))) 360 ;; See comment in x-dnd-handle-moz-url about coding.
361 (let ((coding (if (eq (byteorder) ?B) 'utf-16be 'utf-16le)))
362 (x-dnd-insert-text window action (decode-coding-string text coding))))
356 363
357(defun x-dnd-insert-ctext (window action text) 364(defun x-dnd-insert-ctext (window action text)
358 "Decode the compound text and insert it at point. 365 "Decode the compound text and insert it at point.