changeset 83115:141388e31bb7

Merged in changes from CVS trunk. Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-258 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-259 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-260 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-261 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-155
author Karoly Lorentey <lorentey@elte.hu>
date Thu, 29 Apr 2004 20:45:02 +0000
parents 0c11f1f77626 (current diff) 4edcb259ac74 (diff)
children 6ae3d2810507
files lisp/ChangeLog src/xdisp.c
diffstat 10 files changed, 116 insertions(+), 71 deletions(-) [+]
line wrap: on
line diff
--- a/BUGS	Wed Apr 28 14:10:58 2004 +0000
+++ b/BUGS	Thu Apr 29 20:45:02 2004 +0000
@@ -22,5 +22,5 @@
 (3) By hand.  Do
     cat info/emacs* | more "+/^File: emacs,  Node: Bugs,"
 
-Please first check the file etc/PROBLEMS (e.g. with C-h P in Emacs) to
+Please first check the file etc/PROBLEMS (e.g. with C-h C-e in Emacs) to
 make sure it isn't a known issue.
--- a/lisp/ChangeLog	Wed Apr 28 14:10:58 2004 +0000
+++ b/lisp/ChangeLog	Thu Apr 29 20:45:02 2004 +0000
@@ -1,3 +1,46 @@
+2004-04-28  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* comint.el (comint-prompt-read-only): New variable.
+	(comint-output-filter): Implement it.
+
+	* ielm.el (ielm-prompt-read-only, ielm-prompt): Update docstring.
+	(ielm-prompt-internal): New variable.
+	(ielm-font-lock-keywords): Remove irrelevant ielm-prompt keyword.
+	(ielm-send-input): Delete unused variable `buf'.
+	(ielm-eval-input): Use `ielm-prompt-internal'.
+	(inferior-emacs-lisp-mode): Use new variables
+	`comint-prompt-read-only' and `ielm-prompt-internal'.
+	Get rid of obsolete variable `directory-sep-char'.
+	(ielm): Use `zerop'.
+
+2004-04-29  John Paul Wallington  <jpw@gnu.org>
+
+	* thumbs.el (toplevel): Require cl at compile time.
+	Remove conditional definitions of `ignore-errors' and `caddar'
+	because they occur at run time.
+
+2004-04-28  Nick Roberts  <nickrob@gnu.org>
+
+	* progmodes/gdb-ui.el (gdb-frame-breakpoints-buffer)
+	(gdb-frame-stack-buffer, gdb-frame-threads-buffer)
+	(gdb-frame-registers-buffer, gdb-frame-locals-buffer)
+	(gdb-frame-gdb-buffer, gdb-frame-assembler-buffer): Use
+	selected-window.
+
+	* progmodes/gud.el (gud-common-init): Throw an error if program is
+	already running under gdb.
+
+2004-04-28  John Paul Wallington  <jpw@gnu.org>
+
+	* thumbs.el (thumbs-delete-images): Fix formatting of prompt.
+	(thumbs-show-image-num): Move assignment of
+	`thumbs-current-image-filename' within scope of `i'.
+	(thumbs-emboss-image): Don't use `evenp'.
+
+2004-04-28  Richard M. Stallman  <rms@gnu.org>
+
+	* progmodes/compile.el (compilation-context-lines): Default now 0.
+
 2004-04-28  Juanma Barranquero  <lektu@terra.es>
 
 	Use `time-less-p' from calendar/time-date.el instead of defining
--- a/lisp/comint.el	Wed Apr 28 14:10:58 2004 +0000
+++ b/lisp/comint.el	Thu Apr 29 20:45:02 2004 +0000
@@ -171,6 +171,14 @@
 
 This is a good thing to set in mode hooks.")
 
+(defcustom comint-prompt-read-only nil
+  "If non-nil, the comint prompt is read only.
+This does not affect existing prompts.
+Certain derived modes may override this option."
+  :type 'boolean
+  :group 'comint
+  :version "21.4")
+
 (defvar comint-delimiter-argument-list ()
   "List of characters to recognise as separate arguments in input.
 Strings comprising a character in this list will separate the arguments
@@ -1687,16 +1695,25 @@
               (let ((inhibit-read-only t))
                 (add-text-properties comint-last-output-start (point)
                                      '(rear-nonsticky t
-                                       field output
-                                       inhibit-line-move-field-capture t))))
+				       field output
+				       inhibit-line-move-field-capture t))))
 
 	    ;; Highlight the prompt, where we define `prompt' to mean
 	    ;; the most recent output that doesn't end with a newline.
-	    (unless (and (bolp) (null comint-last-prompt-overlay))
-	      ;; Need to create or move the prompt overlay (in the case
-	      ;; where there is no prompt ((bolp) == t), we still do
-	      ;; this if there's already an existing overlay).
-	      (let ((prompt-start (save-excursion (forward-line 0) (point))))
+	    (let ((prompt-start (save-excursion (forward-line 0) (point)))
+		  (inhibit-read-only t))
+	      (when comint-prompt-read-only
+		(or (= (point-min) prompt-start)
+		    (get-text-property (1- prompt-start) 'read-only)
+		    (put-text-property
+		     (1- prompt-start) prompt-start 'read-only 'fence))
+		(add-text-properties
+		 prompt-start (point)
+		 '(read-only t rear-non-sticky t front-sticky (read-only))))
+	      (unless (and (bolp) (null comint-last-prompt-overlay))
+		;; Need to create or move the prompt overlay (in the case
+		;; where there is no prompt ((bolp) == t), we still do
+		;; this if there's already an existing overlay).
 		(if comint-last-prompt-overlay
 		    ;; Just move an existing overlay
 		    (move-overlay comint-last-prompt-overlay
--- a/lisp/ielm.el	Wed Apr 28 14:10:58 2004 +0000
+++ b/lisp/ielm.el	Thu Apr 29 20:45:02 2004 +0000
@@ -52,34 +52,19 @@
 (defcustom ielm-prompt-read-only t
   "If non-nil, the IELM prompt is read only.
 Setting this variable does not affect existing IELM runs.
-
-You can give the IELM prompt more highly customized read-only
-type properties, by setting this option to nil, and then setting
-`ielm-prompt', outside of Custom, to a string with the desired
-text properties.
-
-Interrupting the IELM process with \\<ielm-map>\\[comint-interrupt-subjob],
-and then restarting it using \\[ielm], makes the then current
-default value affect _new_ prompts.  However, executing \\[ielm]
-does not have this effect on *ielm* buffers with a running process.
-For IELM buffers that are not called `*ielm*', you can execute
-\\[inferior-emacs-lisp-mode] in that IELM buffer to update the value,
-for new prompts.  This works even if the buffer has a running process."
+This works by setting the buffer-local value of `comint-prompt-read-only'.
+Setting that value directly affects new prompts in the current buffer."
   :type 'boolean
   :group 'ielm
   :version "21.4")
 
 (defcustom ielm-prompt "ELISP> "
   "Prompt used in IELM.
-Setting the default value does not affect existing IELM runs.
-`inferior-emacs-lisp-mode' converts this into a buffer-local
-variable in IELM buffers.  The buffer-local value is meant for
-internal use by IELM.  Do not try to set the buffer-local value
-yourself in any way, unless you really know what you are doing.
+Setting this variable does not affect existing IELM runs.
 
 Interrupting the IELM process with \\<ielm-map>\\[comint-interrupt-subjob],
 and then restarting it using \\[ielm], makes the then current
-_default_ value affect _new_ prompts.  Unless the new prompt
+default value affect _new_ prompts.  Unless the new prompt
 differs only in text properties from the old one, IELM will no
 longer recognize the old prompts.  However, executing \\[ielm]
 does not update the prompt of an *ielm* buffer with a running process.
@@ -89,6 +74,12 @@
   :type 'string
   :group 'ielm)
 
+(defvar ielm-prompt-internal "ELISP> "
+  "Stored value of `ielm-prompt' in the current IELM buffer.
+This is an internal variable used by IELM.  Its purpose is to
+prevent a running IELM process from being messed up when the user
+customizes `ielm-prompt'.")
+
 (defcustom ielm-dynamic-return t
   "*Controls whether \\<ielm-map>\\[ielm-return] has intelligent behaviour in IELM.
 If non-nil, \\[ielm-return] evaluates input for complete sexps, or inserts a newline
@@ -178,9 +169,7 @@
   (define-key ielm-map "\C-c\C-v" 'ielm-print-working-buffer))
 
 (defvar ielm-font-lock-keywords
-  (list
-   (cons (concat "^" (regexp-quote ielm-prompt)) 'font-lock-keyword-face)
-   '("\\(^\\*\\*\\*[^*]+\\*\\*\\*\\)\\(.*$\\)"
+  '(("\\(^\\*\\*\\*[^*]+\\*\\*\\*\\)\\(.*$\\)"
      (1 font-lock-comment-face)
      (2 font-lock-constant-face)))
   "Additional expressions to highlight in ielm buffers.")
@@ -283,8 +272,7 @@
 (defun ielm-send-input nil
   "Evaluate the Emacs Lisp expression after the prompt."
   (interactive)
-  (let ((buf (current-buffer))
-	ielm-input)			; set by ielm-input-sender
+  (let (ielm-input)			; set by ielm-input-sender
     (comint-send-input)			; update history, markers etc.
     (ielm-eval-input ielm-input)))
 
@@ -407,7 +395,7 @@
 	    (setq ** *)
 	    (setq * ielm-result))
 	  (setq ielm-output (concat ielm-output "\n"))))
-    (setq ielm-output (concat ielm-output ielm-prompt))
+    (setq ielm-output (concat ielm-output ielm-prompt-internal))
     (comint-output-filter (ielm-process) ielm-output)))
 
 ;;; Process and marker utilities
@@ -478,20 +466,13 @@
   (setq comint-input-sender 'ielm-input-sender)
   (setq comint-process-echoes nil)
   (make-local-variable 'comint-dynamic-complete-functions)
-  (set (make-local-variable 'ielm-prompt)
-       (if ielm-prompt-read-only
-	   (propertize ielm-prompt
-		       'read-only t
-		       'rear-nonsticky t
-		       'front-sticky '(read-only))
-	 ielm-prompt))
+  (set (make-local-variable 'ielm-prompt-internal) ielm-prompt)
+  (set (make-local-variable 'comint-prompt-read-only) ielm-prompt-read-only)
   (setq comint-dynamic-complete-functions
 	'(ielm-tab comint-replace-by-expanded-history ielm-complete-filename ielm-complete-symbol))
   (setq comint-get-old-input 'ielm-get-old-input)
   (make-local-variable 'comint-completion-addsuffix)
-  (setq comint-completion-addsuffix
-	(cons (char-to-string directory-sep-char) ""))
-
+  (setq comint-completion-addsuffix '("/" . ""))
   (setq major-mode 'inferior-emacs-lisp-mode)
   (setq mode-name "IELM")
   (setq mode-line-process '(":%s on " (:eval (buffer-name ielm-working-buffer))))
@@ -541,7 +522,7 @@
         (add-text-properties
          (point-min) (point-max)
          '(rear-nonsticky t field output inhibit-line-move-field-capture t))))
-    (comint-output-filter (ielm-process) ielm-prompt)
+    (comint-output-filter (ielm-process) ielm-prompt-internal)
     (set-marker comint-last-input-start (ielm-pm))
     (set-process-filter (get-buffer-process (current-buffer)) 'comint-output-filter))
 
@@ -568,7 +549,7 @@
   (let (old-point)
     (unless (comint-check-proc "*ielm*")
       (with-current-buffer (get-buffer-create "*ielm*")
-	(unless (eq (buffer-size) 0) (setq old-point (point)))
+	(unless (zerop (buffer-size)) (setq old-point (point)))
 	(inferior-emacs-lisp-mode)))
     (pop-to-buffer "*ielm*")
     (when old-point (push-mark old-point))))
--- a/lisp/progmodes/compile.el	Wed Apr 28 14:10:58 2004 +0000
+++ b/lisp/progmodes/compile.el	Thu Apr 29 20:45:02 2004 +0000
@@ -1472,7 +1472,7 @@
       (setcdr loc (list line file marker)))
     loc))
 
-(defcustom compilation-context-lines next-screen-context-lines
+(defcustom compilation-context-lines 0
   "*Display this many lines of leading context before message."
   :type 'integer
   :group 'compilation
--- a/lisp/progmodes/gdb-ui.el	Wed Apr 28 14:10:58 2004 +0000
+++ b/lisp/progmodes/gdb-ui.el	Thu Apr 29 20:45:02 2004 +0000
@@ -1152,7 +1152,7 @@
   (interactive)
   (select-frame (make-frame gdb-frame-parameters))
   (switch-to-buffer (gdb-get-create-buffer 'gdb-breakpoints-buffer))
-  (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
+  (set-window-dedicated-p (selected-window) t))
 
 (defvar gdb-breakpoints-mode-map
   (let ((map (make-sparse-keymap))
@@ -1274,7 +1274,7 @@
   (interactive)
   (select-frame (make-frame gdb-frame-parameters))
   (switch-to-buffer (gdb-get-create-buffer 'gdb-stack-buffer))
-  (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
+  (set-window-dedicated-p (selected-window) t))
 
 (defvar gdb-frames-mode-map
   (let ((map (make-sparse-keymap)))
@@ -1351,7 +1351,7 @@
   (interactive)
   (select-frame (make-frame gdb-frame-parameters))
   (switch-to-buffer (gdb-get-create-buffer 'gdb-threads-buffer))
-  (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
+  (set-window-dedicated-p (selected-window) t))
 
 (defvar gdb-threads-mode-map
   (let ((map (make-sparse-keymap)))
@@ -1433,7 +1433,7 @@
   (interactive)
   (select-frame (make-frame gdb-frame-parameters))
   (switch-to-buffer (gdb-get-create-buffer 'gdb-registers-buffer))
-  (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
+  (set-window-dedicated-p (selected-window) t))
 
 ;;
 ;; Locals buffer.
@@ -1505,7 +1505,7 @@
   (interactive)
   (select-frame (make-frame gdb-frame-parameters))
   (switch-to-buffer (gdb-get-create-buffer 'gdb-locals-buffer))
-  (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
+  (set-window-dedicated-p (selected-window) t))
 
 
 ;;;; Window management
@@ -1604,7 +1604,7 @@
   (interactive)
   (select-frame (make-frame gdb-frame-parameters))
   (switch-to-buffer (gdb-get-create-buffer 'gdba))
-  (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
+  (set-window-dedicated-p (selected-window) t))
 
 (defun gdb-display-gdb-buffer ()
   (interactive)
@@ -1935,7 +1935,7 @@
   (interactive)
   (select-frame (make-frame gdb-frame-parameters))
   (switch-to-buffer (gdb-get-create-buffer 'gdb-assembler-buffer))
-  (set-window-dedicated-p (get-buffer-window (current-buffer)) t))
+  (set-window-dedicated-p (selected-window) t))
 
 ;; modified because if gdb-current-address has changed value a new command
 ;; must be enqueued to update the buffer with the new output
--- a/lisp/progmodes/gud.el	Wed Apr 28 14:10:58 2004 +0000
+++ b/lisp/progmodes/gud.el	Thu Apr 29 20:45:02 2004 +0000
@@ -2384,8 +2384,10 @@
 		    (if (file-name-directory file-subst)
 			(expand-file-name file-subst)
 		      file-subst)))
-	 (filepart (and file-word (concat "-" (file-name-nondirectory file)))))
+	 (filepart (and file-word (concat "-" (file-name-nondirectory file))))
+	 (existing-buffer (get-buffer (concat "*gud" filepart "*"))))
     (pop-to-buffer (concat "*gud" filepart "*"))
+    (if existing-buffer (error "This program is already running under gdb"))
     ;; Set the dir, in case the buffer already existed with a different dir.
     (setq default-directory dir)
     ;; Set default-directory to the file's directory.
--- a/lisp/thumbs.el	Wed Apr 28 14:10:58 2004 +0000
+++ b/lisp/thumbs.el	Thu Apr 29 20:45:02 2004 +0000
@@ -56,6 +56,8 @@
 
 ;;; Code:
 
+(eval-when-compile
+  (require 'cl))
 (require 'dired)
 
 ;; Abort if in-line imaging isn't supported (i.e. Emacs-20.7)
@@ -182,18 +184,6 @@
     (make-directory thumbs-thumbsdir)
     (message "Creating thumbnails directory")))
 
-(when (not (fboundp 'ignore-errors))
-  (defmacro ignore-errors (&rest body)
-    "Execute FORMS; if anz error occurs, return nil.
-Otherwise, return result of last FORM."
-    (let ((err (thumbs-gensym)))
-      (list 'condition-case err (cons 'progn body) '(error nil)))))
-
-(when (not (fboundp 'caddar))
-  (defun caddar (x)
-    "Return the `car' of the `cdr' of the `cdr' of the `car' of X."
-    (car (cdr (cdr (car x))))))
-
 (defvar thumbs-gensym-counter 0)
 
 (defun thumbs-gensym (&optional arg)
@@ -504,7 +494,7 @@
   "Delete the image at point (and it's thumbnail) (or marked files if any)."
   (interactive)
   (let ((f (or thumbs-markedL (list (cdr (assoc (point) thumbs-fileL))))))
-    (if (yes-or-no-p "Really delete %d files?" (length f))
+    (if (yes-or-no-p (format "Really delete %d files? " (length f)))
 	(progn
 	  (mapcar (lambda (x)
 		    (setq thumbs-fileL (delete (rassoc x thumbs-fileL) thumbs-fileL))
@@ -529,9 +519,9 @@
       (rename-buffer (concat "*Image: "
 			     (file-name-nondirectory i)
 			     " - "
-			     (number-to-string num) "*")))
-    (setq thumbs-image-num num
-	  thumbs-current-image-filename i)))
+			     (number-to-string num) "*"))
+      (setq thumbs-image-num num
+	    thumbs-current-image-filename i))))
 
 (defun thumbs-next-image ()
   "Show next image."
@@ -597,7 +587,7 @@
 (defun thumbs-emboss-image (emboss)
   "Emboss the image with value EMBOSS."
   (interactive "nEmboss value: ")
-  (if (or (< emboss 3)(> emboss 31)(evenp emboss))
+  (if (or (< emboss 3) (> emboss 31) (zerop (logand emboss 1)))
       (error "Arg must be a odd number between 3 and 31"))
   (thumbs-modify-image "emboss" (number-to-string emboss)))
 
--- a/src/ChangeLog	Wed Apr 28 14:10:58 2004 +0000
+++ b/src/ChangeLog	Thu Apr 29 20:45:02 2004 +0000
@@ -1,3 +1,9 @@
+2004-04-29  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (null_glyph_slice): New var.
+	(append_glyph, append_composite_glyph, append_stretch_glyph):
+	Use it to initialize glyph slice.
+
 2004-04-27  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* xdisp.c (x_produce_glyphs): Fix the proverbial int/Lisp_Object mixup.
--- a/src/xdisp.c	Wed Apr 28 14:10:58 2004 +0000
+++ b/src/xdisp.c	Thu Apr 29 20:45:02 2004 +0000
@@ -795,6 +795,9 @@
 
 Lisp_Object previous_help_echo_string;
 
+/* Null glyph slice */
+
+static struct glyph_slice null_glyph_slice = { 0, 0, 0, 0 };
 
 
 /* Function prototypes.  */
@@ -18091,6 +18094,7 @@
       glyph->glyph_not_available_p = it->glyph_not_available_p;
       glyph->face_id = it->face_id;
       glyph->u.ch = it->char_to_display;
+      glyph->slice = null_glyph_slice;
       glyph->font_type = FONT_TYPE_UNKNOWN;
       ++it->glyph_row->used[area];
     }
@@ -18127,6 +18131,7 @@
       glyph->glyph_not_available_p = 0;
       glyph->face_id = it->face_id;
       glyph->u.cmp_id = it->cmp_id;
+      glyph->slice = null_glyph_slice;
       glyph->font_type = FONT_TYPE_UNKNOWN;
       ++it->glyph_row->used[area];
     }
@@ -18338,6 +18343,7 @@
       glyph->face_id = it->face_id;
       glyph->u.stretch.ascent = ascent;
       glyph->u.stretch.height = height;
+      glyph->slice = null_glyph_slice;
       glyph->font_type = FONT_TYPE_UNKNOWN;
       ++it->glyph_row->used[area];
     }