changeset 83169:243c49e23626

Merged in changes from CVS trunk. Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-437 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-438 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-209
author Karoly Lorentey <lorentey@elte.hu>
date Sun, 04 Jul 2004 21:51:32 +0000
parents 856533c4b08f (current diff) 2c401662dff4 (diff)
children 952f7cc8274d
files lisp/ChangeLog src/msdos.c
diffstat 12 files changed, 214 insertions(+), 97 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS	Sun Jul 04 05:23:30 2004 +0000
+++ b/etc/NEWS	Sun Jul 04 21:51:32 2004 +0000
@@ -1846,6 +1846,8 @@
 
 ** Grep has been decoupled from compilation mode setup.
 
+*** There's a new separate package grep.el.
+
 *** Grep commands now have their own submenu and customization group.
 
 *** The new variables `grep-window-height', `grep-auto-highlight', and
@@ -2222,6 +2224,10 @@
 modification times.  Magic file name handlers can handle this
 operation.
 
+** file-remote-p now returns an identifier for the remote system,
+if the file is indeed remote.  (Before, the return value was t in
+this case.)
+
 ** The display space :width and :align-to text properties are now
 supported on text terminals.
 
--- a/lisp/ChangeLog	Sun Jul 04 05:23:30 2004 +0000
+++ b/lisp/ChangeLog	Sun Jul 04 21:51:32 2004 +0000
@@ -1,3 +1,44 @@
+2004-07-03  Eli Zaretskii  <eliz@gnu.org>
+
+	* progmodes/grep.el (grep-compute-defaults, grep-command)
+	(grep-program, find-program, grep-find-use-xargs, grep-history)
+	(grep-find-history, grep-tag-default, grep-find-command)
+	(grep-regexp-alist, grep-process-setup, grep-compute-defaults):
+	Add autoload cookies, for unbundled packages that load `compile'
+	and expect all grep-related symbols to become defined.
+
+2004-07-03  KOSEKI Yoshinori  <kose@meadowy.org>
+
+	* iimage.el (turn-on-iimage-mode, iimage-mode): Add autoload
+	cookies.
+	(iimage-mode-image-search-path): New user option to search the
+	image file.
+	(iimage-locate-file): New funcion.  Emacs21.3 or earlier does not
+	have locate-file.
+	(iimage-mode-buffer): Use it.
+
+2004-07-03  Nick Roberts  <nickrob@gnu.org>
+
+	* progmodes/gdb-ui.el (gdb-goto-breakpoint): String match more
+	carefully.
+	(gdb-delete-breakpoint, gdb-toggle-breakpoint): Handle gdbmi.
+
+2004-07-03  Juri Linkov  <juri@jurta.org>
+
+	* replace.el (query-replace-read-args): Swallow space after 'foo,
+	not after (quote foo).  Match space only immediately after symbol,
+	not anywhere in the whole string.
+
+2004-07-02  Richard M. Stallman  <rms@gnu.org>
+
+	* replace.el (query-replace-read-args): Swallow space after
+	symbols, not after closeparens.  But avoid error if string ends there.
+
+	* progmodes/python.el (python-beginning-of-statement):
+	Exit the loop if backward-up-list gets error.
+
+	* textmodes/enriched.el (enriched-encode): Bind inhibit-read-only.
+
 2004-07-02  Andre Spiegel  <spiegel@gnu.org>
 
 	* vc-rcs.el (vc-rcs-checkout-model): Look at the version headers
@@ -45,6 +86,11 @@
 
 	* emacs-lisp/pp.el (pp-buffer): Add autoload.
 
+2004-06-28  Richard M. Stallman  <rms@gnu.org>
+
+	* font-lock.el (font-lock-fontify-syntactic-keywords-region):
+	More changes to go with previous change in font-lock.el.
+
 2004-06-26  David Kastrup  <dak@gnu.org>
 
 	* replace.el (perform-replace): Highlight the match even in
--- a/lisp/iimage.el	Sun Jul 04 05:23:30 2004 +0000
+++ b/lisp/iimage.el	Sun Jul 04 21:51:32 2004 +0000
@@ -25,12 +25,13 @@
 
 ;;; Commentary:
 
-;; Iimage is a minor mode that display a images, when image-filename
-;; exists in buffer.
+;; Iimage is a minor mode that displays images, when image-filename
+;; exists in the buffer.
 ;; http://www.netlaputa.ne.jp/~kose/Emacs/iimage.html
 ;;
 ;; Add to your `~/.emacs':
-;; (autoload 'iimage-mode "iimage" "SUpport Inline image minor mode." t)
+;; (autoload 'iimage-mode "iimage" "Support Inline image minor mode." t)
+;; (autoload 'turn-on-iimage-mode "iimage" "Turn on Inline image minor mode." t)
 ;;
 ;; ** Display images in *Info* buffer.
 ;;
@@ -50,7 +51,7 @@
 (eval-when-compile
   (require 'image-file))
 
-(defconst iimage-version "1.0")
+(defconst iimage-version "1.1")
 (defvar iimage-mode nil)
 (defvar iimage-mode-map nil)
 
@@ -89,6 +90,10 @@
      foo.JPG
 ")
 
+(defvar iimage-mode-image-search-path nil
+"*List of directories to search for image files for iimage-mode.")
+
+;;;###autoload
 (defun turn-on-iimage-mode ()
 "Unconditionally turn on iimage mode."
   (interactive)
@@ -99,6 +104,12 @@
   (interactive)
   (iimage-mode 0))
 
+;; Emacs21.3 or earlier does not heve locate-file.
+(if (fboundp 'locate-file)
+    (defalias 'iimage-locate-file 'locate-file)
+  (defun iimage-locate-file (filename path)
+    (locate-library filename t path)))
+
 (defun iimage-mode-buffer (arg)
 "Display/Undisplay Images.
 With numeric ARG, display the images if and only if ARG is positive."
@@ -113,8 +124,9 @@
       (dolist (pair iimage-mode-image-regex-alist)
 	(while (re-search-forward (car pair) nil t)
 	  (if (and (setq file (match-string (cdr pair)))
-		   (setq file (expand-file-name file default-directory))
-		   (file-exists-p file))
+		   (setq file (iimage-locate-file file
+				   (cons default-directory
+					 iimage-mode-image-search-path))))
 	      (if ing
 		  (add-text-properties (match-beginning 0) (match-end 0)
 				       (list 'display (create-image file)))
@@ -122,6 +134,7 @@
 					'(display)))))))
     (set-buffer-modified-p modp)))
 
+;;;###autoload
 (define-minor-mode iimage-mode
   "Toggle inline image minor mode."
   nil " iImg" iimage-mode-map
--- a/lisp/progmodes/gdb-ui.el	Sun Jul 04 05:23:30 2004 +0000
+++ b/lisp/progmodes/gdb-ui.el	Sun Jul 04 21:51:32 2004 +0000
@@ -1202,48 +1202,52 @@
   (interactive)
   (save-excursion
     (beginning-of-line 1)
-    (if (not (looking-at "\\([0-9]+\\).*point\\s-*\\S-*\\s-*\\(.\\)"))
-	(error "Not recognized as break/watchpoint line")
-      (gdb-enqueue-input
-       (list
-	(concat
-	 (if (eq ?y (char-after (match-beginning 2)))
-	     (concat gdb-server-prefix "disable ")
-	   (concat gdb-server-prefix "enable "))
-	 (match-string 1) "\n")
-	'ignore)))))
+    (if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
+	    (looking-at "\\([0-9]+\\).*point\\s-*\\S-*\\s-*\\(.\\)")
+	  (looking-at
+      "\\([0-9]+\\)\\s-*\\S-*\\s-*\\S-*\\s-*\\(.\\)\\s-*\\S-*\\s-*\\S-*:[0-9]+"))
+	(gdb-enqueue-input
+	 (list
+	  (concat gdb-server-prefix
+		  (if (eq ?y (char-after (match-beginning 2)))
+		      "disable "
+		    "enable ")
+		  (match-string 1) "\n") 'ignore))
+      (error "Not recognized as break/watchpoint line"))))
 
 (defun gdb-delete-breakpoint ()
   "Delete the breakpoint at current line."
   (interactive)
   (beginning-of-line 1)
-  (if (not (looking-at "\\([0-9]+\\).*point\\s-*\\S-*\\s-*\\(.\\)"))
-      (error "Not recognized as break/watchpoint line")
-    (gdb-enqueue-input
-     (list (concat gdb-server-prefix "delete " (match-string 1) "\n") 'ignore))))
+  (if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
+	  (looking-at "\\([0-9]+\\).*point\\s-*\\S-*\\s-*\\(.\\)")
+	(looking-at
+	 "\\([0-9]+\\)\\s-*\\S-*\\s-*\\S-*\\s-*.\\s-*\\S-*\\s-*\\S-*:[0-9]+"))
+      (gdb-enqueue-input
+       (list
+	(concat gdb-server-prefix "delete " (match-string 1) "\n") 'ignore))
+    (error "Not recognized as break/watchpoint line")))
 
 (defun gdb-goto-breakpoint ()
   "Display the breakpoint location specified at current line."
   (interactive)
   (save-excursion
     (beginning-of-line 1)
-    (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
-	(progn
-	  (re-search-forward "in\\s-+\\S-+\\s-+at\\s-+" nil t)
-	  (looking-at "\\(\\S-*\\):\\([0-9]+\\)"))
-    (looking-at
-     "[0-9]*\\s-*\\S-*\\s-*\\S-*\\s-*.\\s-*\\S-*\\s-*\\(\\S-*\\):\\([0-9]+\\)")))
-  (if (match-string 2)
-      (let ((line (match-string 2))
-	    (file (match-string 1)))
-	(save-selected-window
-	  (let* ((buf (find-file-noselect (if (file-exists-p file)
-					      file
-					    (expand-file-name file gdb-cdir))))
-		 (window (gdb-display-buffer buf)))
-		 (with-current-buffer buf
-		   (goto-line (string-to-number line))
-		   (set-window-point window (point))))))))
+    (if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
+	    (looking-at ".*in\\s-+\\S-+\\s-+at\\s-+\\(\\S-*\\):\\([0-9]+\\)")
+	  (looking-at
+     "[0-9]+\\s-*\\S-*\\s-*\\S-*\\s-*.\\s-*\\S-*\\s-*\\(\\S-*\\):\\([0-9]+\\)"))
+	(let ((line (match-string 2))
+	      (file (match-string 1)))
+	  (save-selected-window
+	    (let* ((buf (find-file-noselect (if (file-exists-p file)
+						file
+					      (expand-file-name file gdb-cdir))))
+		   (window (gdb-display-buffer buf)))
+	      (with-current-buffer buf
+		(goto-line (string-to-number line))
+		(set-window-point window (point))))))
+      (error "Not recognized as break/watchpoint line"))))
 
 (defun gdb-mouse-goto-breakpoint (event)
   "Display the breakpoint location that you click on."
--- a/lisp/progmodes/grep.el	Sun Jul 04 05:23:30 2004 +0000
+++ b/lisp/progmodes/grep.el	Sun Jul 04 21:51:32 2004 +0000
@@ -74,6 +74,7 @@
   :version "21.4"
   :group 'grep)
 
+;;;###autoload
 (defcustom grep-command nil
   "The default grep command for \\[grep].
 If the grep program used supports an option to always include file names
@@ -100,6 +101,7 @@
 		 (other :tag "Not Set" auto-detect))
   :group 'grep)
 
+;;;###autoload
 (defcustom grep-find-command nil
   "The default find command for \\[grep-find].
 The default value of this variable is set up by `grep-compute-defaults';
@@ -223,6 +225,7 @@
 Notice that using \\[next-error] or \\[compile-goto-error] modifies
 `complation-last-buffer' rather than `grep-last-buffer'.")
 
+;;;###autoload
 (defvar grep-regexp-alist
   '(("^\\(.+?\\)[:( \t]+\
 \\([0-9]+\\)\\([.:]?\\)\\([0-9]+\\)?\
@@ -258,6 +261,7 @@
    "Additional things to highlight in grep output.
 This gets tacked on the end of the generated expressions.")
 
+;;;###autoload
 (defvar grep-program
   ;; Currently zgrep has trouble.  It runs egrep instead of grep,
   ;; and it doesn't pass along long options right.
@@ -272,10 +276,12 @@
   "The default grep program for `grep-command' and `grep-find-command'.
 This variable's value takes effect when `grep-compute-defaults' is called.")
 
+;;;###autoload
 (defvar find-program "find"
   "The default find program for `grep-find-command'.
 This variable's value takes effect when `grep-compute-defaults' is called.")
 
+;;;###autoload
 (defvar grep-find-use-xargs nil
   "Whether \\[grep-find] uses the `xargs' utility by default.
 
@@ -285,9 +291,12 @@
 This variable's value takes effect when `grep-compute-defaults' is called.")
 
 ;; History of grep commands.
+;;;###autoload
 (defvar grep-history nil)
+;;;###autoload
 (defvar grep-find-history nil)
 
+;;;###autoload
 (defun grep-process-setup ()
   "Setup compilation variables and buffer for `grep'.
 Set up `compilation-exit-message-function' and run `grep-setup-hook'."
@@ -303,6 +312,7 @@
 	   (cons msg code))))
   (run-hooks 'grep-setup-hook))
 
+;;;###autoload
 (defun grep-compute-defaults ()
   (unless (or (not grep-use-null-device) (eq grep-use-null-device t))
     (setq grep-use-null-device
@@ -448,6 +458,7 @@
        grep-regexp-alist))
 
 ;; This is a copy of find-tag-default from etags.el.
+;;;###autoload
 (defun grep-tag-default ()
   (save-excursion
     (while (looking-at "\\sw\\|\\s_")
--- a/lisp/progmodes/python.el	Sun Jul 04 05:23:30 2004 +0000
+++ b/lisp/progmodes/python.el	Sun Jul 04 21:51:32 2004 +0000
@@ -710,16 +710,17 @@
 expressions."
   (beginning-of-line)
   (python-beginning-of-string)
-  (while (python-continuation-line-p)
-    (beginning-of-line)
-    (if (python-backslash-continuation-line-p)
-	(while (python-backslash-continuation-line-p)
-	  (forward-line -1))
-      (python-beginning-of-string)
-      ;; Skip forward out of nested brackets.
-      (condition-case ()		; beware invalid syntax
-	  (progn (backward-up-list (syntax-ppss-depth (syntax-ppss))) t)
-	(error (end-of-line)))))
+  (catch 'foo
+    (while (python-continuation-line-p)
+      (beginning-of-line)
+      (if (python-backslash-continuation-line-p)
+	  (while (python-backslash-continuation-line-p)
+	    (forward-line -1))
+	(python-beginning-of-string)
+	;; Skip forward out of nested brackets.
+	(condition-case ()		; beware invalid syntax
+	    (progn (backward-up-list (syntax-ppss-depth (syntax-ppss))) t)
+	  (error (throw 'foo nil))))))
   (back-to-indentation))
 
 (defun python-end-of-statement ()
--- a/lisp/replace.el	Sun Jul 04 05:23:30 2004 +0000
+++ b/lisp/replace.el	Sun Jul 04 21:51:32 2004 +0000
@@ -118,14 +118,19 @@
 		    ((eq char ?\,)
 		     (setq pos (read-from-string to))
 		     (push `(replace-quote ,(car pos)) list)
-		     (setq to (substring
-			       to (+ (cdr pos)
-				     ;; Swallow a space after a symbol
-				     ;; if there is a space.
-				     (if (string-match
-                                          "^[^])\"] "
-                                          (substring to (1- (cdr pos))))
-					 1 0))))))
+		     (let ((end
+			    ;; Swallow a space after a symbol
+			    ;; if there is a space.
+			    (if (and (or (symbolp (car pos))
+					 ;; Swallow a space after 'foo
+					 ;; but not after (quote foo).
+					 (and (eq (car-safe (car pos)) 'quote)
+					      (not (= ?\( (aref to 0)))))
+				     (eq (string-match " " to (cdr pos))
+					 (cdr pos)))
+				(1+ (cdr pos))
+			      (cdr pos))))
+		       (setq to (substring to end)))))
 	      (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to)))
 	(setq to (nreverse (delete "" (cons to list)))))
       (replace-match-string-symbols to)
@@ -208,7 +213,7 @@
 followed by a Lisp expression.  Each
 replacement evaluates that expression to compute the replacement
 string.  Inside of that expression, `\\&' is a string denoting the
-whole match as a sting, `\\N' for a partial match, `\\#&' and `\\#N'
+whole match as a string, `\\N' for a partial match, `\\#&' and `\\#N'
 for the whole or a partial match converted to a number with
 `string-to-number', and `\\#' itself for the number of replacements
 done so far (starting with zero).
--- a/lisp/textmodes/enriched.el	Sun Jul 04 05:23:30 2004 +0000
+++ b/lisp/textmodes/enriched.el	Sun Jul 04 21:51:32 2004 +0000
@@ -282,33 +282,34 @@
 ;;;###autoload
 (defun enriched-encode (from to orig-buf)
   (if enriched-verbose (message "Enriched: encoding document..."))
-  (save-restriction
-    (narrow-to-region from to)
-    (delete-to-left-margin)
-    (unjustify-region)
-    (goto-char from)
-    (format-replace-strings '(("<" . "<<")))
-    (format-insert-annotations
-     (format-annotate-region from (point-max) enriched-translations
-			     'enriched-make-annotation enriched-ignore))
-    (goto-char from)
-    (insert (if (stringp enriched-initial-annotation)
-		enriched-initial-annotation
-	      (save-excursion
-		;; Eval this in the buffer we are annotating.  This
-		;; fixes a bug which was saving incorrect File-Width
-		;; information, since we were looking at local
-		;; variables in the wrong buffer.
-		(if orig-buf (set-buffer orig-buf))
-		(funcall enriched-initial-annotation))))
-    (enriched-map-property-regions 'hard
-      (lambda (v b e)
-	(if (and v (= ?\n (char-after b)))
-	    (progn (goto-char b) (insert "\n"))))
-      (point) nil)
-    (if enriched-verbose (message nil))
-    ;; Return new end.
-    (point-max)))
+  (let ((inhibit-read-only t))
+    (save-restriction
+      (narrow-to-region from to)
+      (delete-to-left-margin)
+      (unjustify-region)
+      (goto-char from)
+      (format-replace-strings '(("<" . "<<")))
+      (format-insert-annotations
+       (format-annotate-region from (point-max) enriched-translations
+			       'enriched-make-annotation enriched-ignore))
+      (goto-char from)
+      (insert (if (stringp enriched-initial-annotation)
+		  enriched-initial-annotation
+		(save-excursion
+		  ;; Eval this in the buffer we are annotating.  This
+		  ;; fixes a bug which was saving incorrect File-Width
+		  ;; information, since we were looking at local
+		  ;; variables in the wrong buffer.
+		  (if orig-buf (set-buffer orig-buf))
+		  (funcall enriched-initial-annotation))))
+      (enriched-map-property-regions 'hard
+	(lambda (v b e)
+	  (if (and v (= ?\n (char-after b)))
+	      (progn (goto-char b) (insert "\n"))))
+	(point) nil)
+      (if enriched-verbose (message nil))
+      ;; Return new end.
+      (point-max))))
 
 (defun enriched-make-annotation (internal-ann positive)
   "Format an annotation INTERNAL-ANN.
--- a/lispref/ChangeLog	Sun Jul 04 05:23:30 2004 +0000
+++ b/lispref/ChangeLog	Sun Jul 04 21:51:32 2004 +0000
@@ -1,3 +1,13 @@
+2004-07-02  Richard M. Stallman  <rms@gnu.org>
+
+	* files.texi (Saving Buffers): Cleanup write-contents-function.
+	(Magic File Names): Cleanup file-remote-p.
+
+2004-07-02  Kai Grossjohann  <kai@emptydomain.de>
+
+	* files.texi (Magic File Names): `file-remote-p' returns an
+	identifier of the remote system, not just t.
+
 2004-07-02  David Kastrup  <dak@gnu.org>
 
 	* searching.texi (Entire Match Data): Add explanation about new
--- a/lispref/files.texi	Sun Jul 04 05:23:30 2004 +0000
+++ b/lispref/files.texi	Sun Jul 04 21:51:32 2004 +0000
@@ -415,17 +415,17 @@
 
 @c Emacs 19 feature
 @defvar write-contents-functions
-This works just like @code{write-file-functions}, but it is intended for
-hooks that pertain to the contents of the file, as opposed to hooks that
-pertain to the file's name or location.  Such hooks are usually set up by
-major modes, as buffer-local bindings for this variable.  If any of the
-functions in this hook returns non-@code{nil}, the file is considered
-already written and the rest are not called and neither are the functions
-in @code{write-file-functions}.
-
-This variable automatically becomes buffer-local whenever it is set;
-switching to a new major mode always resets this variable, but
-calling @code{set-visited-file-name} does not.
+This works just like @code{write-file-functions}, but it is intended
+for hooks that pertain to the buffer's contents, not to the particular
+visited file or its location.  Such hooks are usually set up by major
+modes, as buffer-local bindings for this variable.  This variable
+automatically becomes buffer-local whenever it is set; switching to a
+new major mode always resets this variable, but calling
+@code{set-visited-file-name} does not.
+
+If any of the functions in this hook returns non-@code{nil}, the file
+is considered already written and the rest are not called and neither
+are the functions in @code{write-file-functions}.
 @end defvar
 
 @defopt before-save-hook
@@ -2646,7 +2646,22 @@
 @end defun
 
 @defun file-remote-p filename
-This function returns @code{t} if @var{filename} is a remote file.
+This function tests whether @var{filename} is a remote file.  If
+@var{filename} is local (not remote), the return value is @code{nil}.
+If @var{filename} is indeed remote, the return value is a string that
+identifies the remote system.
+
+This identifier string may include a host name, a user name, and
+characters designating the method used to access the remote system.
+For example, the remote identifier string for the filename
+@code{/ssh:user@@host:/some/file} is @code{/ssh:user@@host:}.
+
+If @code{file-remote-p} returns the same identifier for two different
+filenames, that means they are stored on the same file system and can
+be accessed locally with respect to each other.  This means, for
+example, that it is possible to start a remote process accessing both
+files at the same time.  Implementors of file handlers need to ensure
+this principle is valid.
 @end defun
 
 @defun unhandled-file-name-directory filename
--- a/src/ChangeLog	Sun Jul 04 05:23:30 2004 +0000
+++ b/src/ChangeLog	Sun Jul 04 21:51:32 2004 +0000
@@ -1,3 +1,8 @@
+2004-07-03  Eli Zaretskii  <eliz@gnu.org>
+
+	* msdos.c (dos_rawgetc): Use make_number to produce Lisp objects
+	for event.x and event.y.
+
 2004-07-01  Kenichi Handa  <handa@m17n.org>
 
 	* w32select.c (Fw32_set_clipboard_data): Update `nbytes' correctly
--- a/src/msdos.c	Sun Jul 04 05:23:30 2004 +0000
+++ b/src/msdos.c	Sun Jul 04 21:51:32 2004 +0000
@@ -3456,8 +3456,8 @@
 		event.code = button_num;
 		event.modifiers = dos_get_modifiers (0)
 		  | (press ? down_modifier : up_modifier);
-		event.x = x;
-		event.y = y;
+		event.x = make_number (x);
+		event.y = make_number (y);
 		event.frame_or_window = selected_frame;
 		event.arg = Qnil;
 		event.timestamp = event_timestamp ();