changeset 83268:7ea3d7198adc

Merged from miles@gnu.org--gnu-2005 (patch 160-161) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-160 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-161 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-308
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 16 Mar 2005 16:03:44 +0000
parents c7d2b6ee3a80 (current diff) c17cdf5decaa (diff)
children 48ba3f89c89f
files lisp/ChangeLog lisp/bindings.el lisp/progmodes/gdb-ui.el lisp/simple.el src/xdisp.c
diffstat 15 files changed, 164 insertions(+), 68 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Mar 16 15:59:10 2005 +0000
+++ b/lisp/ChangeLog	Wed Mar 16 16:03:44 2005 +0000
@@ -1,3 +1,31 @@
+2005-03-07  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp/debug.el (debug-on-entry-1): Fix handling of macros.
+
+2005-03-07  Kim F. Storm  <storm@cua.dk>
+
+	* simple.el (move-beginning-of-line): New command.
+
+	* bindings.el (global-map): Bind C-a to move-beginning-of-line.
+
+	* reveal.el (reveal-mode-map): Bind C-a to beginning-of-line.
+
+	* emulation/cua-base.el: Put CUA move property on move-end-of-line
+	and move-beginning-of-line.
+
+	* apropos.el (apropos-print): Omit command from M-x ... RET.
+
+2005-03-07  Nick Roberts  <nickrob@snap.net.nz>
+
+	* progmodes/gdb-ui.el (gdb-var-create-handler): Handle just MI case.
+	(gdb-send, gdb-send-item): Log items sent from gdb-send too.
+
+2005-03-06  Richard M. Stallman  <rms@gnu.org>
+
+	* bindings.el (esc-map): Bind M-g to goto-line.
+
+	* facemenu.el (global-map): Bind M-o, not M-g.
+
 2005-03-06  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
 	* menu-bar.el (menu-bar-file-menu): Add the same :enable to
@@ -26,7 +54,7 @@
 
 2005-03-03  Stephan Stahl  <stahl@eos.franken.de> (tiny change)
 
-	* progmodes/which-func.el (which-function): 
+	* progmodes/which-func.el (which-function):
 	Specify NOERROR when calling imenu--make-index-alist.
 
 2005-03-05  Stefan Monnier  <monnier@iro.umontreal.ca>
@@ -76,14 +104,12 @@
 
 	* calendar/icalendar.el (icalendar-version): Increase to 0.11.
 	(icalendar-export-file, icalendar-export-region)
-	(icalendar-import-file, icalendar-import-buffer): Add autoload
-	cookies.
+	(icalendar-import-file, icalendar-import-buffer): Add autoload cookies.
 	(icalendar--convert-ical-to-diary): Fix problem with DURATION.
 
 2005-03-04  Lute Kamstra  <lute@gnu.org>
 
-	* emacs-lisp/debug.el (debugger-step-after-exit): Make it a
-	defvar.
+	* emacs-lisp/debug.el (debugger-step-after-exit): Make it a defvar.
 	(debug-function-list): Ditto.
 
 2005-03-04  Robert J. Chassell  <bob@rattlesnake.com>
@@ -93,7 +119,7 @@
 	is not appended by replacing a search for `@refill\\|@bye' with
 	`@refill\\|^[ \t]*@'.  The intent is to solve both the `@end
 	itemize@refill' bug and the unfilled long lines bug.
-	(texinfmt-version): update number and date.
+	(texinfmt-version): Update number and date.
 
 2005-03-04  Reiner Steib  <Reiner.Steib@gmx.de>
 
--- a/lisp/apropos.el	Wed Mar 16 15:59:10 2005 +0000
+++ b/lisp/apropos.el	Wed Mar 16 16:03:44 2005 +0000
@@ -860,13 +860,12 @@
 					      key))
 		       key)
 		     item ", "))
-		 (insert "M-x")
-		 (put-text-property (- (point) 3) (point)
-				    'face apropos-keybinding-face)
-		 (insert " " (symbol-name symbol) " ")
-		 (insert "RET")
-		 (put-text-property (- (point) 3) (point)
-				    'face apropos-keybinding-face)))
+		 (insert "M-x ... RET")
+		 (when apropos-keybinding-face
+		   (put-text-property (- (point) 11) (- (point) 8)
+				      'face apropos-keybinding-face)
+		   (put-text-property (- (point) 3) (point)
+				      'face apropos-keybinding-face))))
 	  (terpri)
 	  (apropos-print-doc 2
 			     (if (commandp symbol)
--- a/lisp/bindings.el	Wed Mar 16 15:59:10 2005 +0000
+++ b/lisp/bindings.el	Wed Mar 16 16:03:44 2005 +0000
@@ -700,6 +700,7 @@
 (define-key global-map "\C-n" 'next-line)
 (define-key global-map "\C-p" 'previous-line)
 (define-key ctl-x-map "\C-n" 'set-goal-column)
+(define-key global-map "\C-a" 'move-beginning-of-line)
 (define-key global-map "\C-e" 'move-end-of-line)
 (define-key esc-map "g" 'goto-line)
 
--- a/lisp/emacs-lisp/debug.el	Wed Mar 16 15:59:10 2005 +0000
+++ b/lisp/emacs-lisp/debug.el	Wed Mar 16 16:03:44 2005 +0000
@@ -693,25 +693,24 @@
 	  (fset function (cons 'lambda (cons (car contents) body)))))))
 
 (defun debug-on-entry-1 (function defn flag)
-  (if (subrp defn)
-      (error "%s is a built-in function" function)
-    (if (eq (car defn) 'macro)
-	(debug-on-entry-1 function (cdr defn) flag)
-      (or (eq (car defn) 'lambda)
-	  (error "%s not user-defined Lisp function" function))
-      (let ((tail (cdr defn)))
-	;; Skip the docstring.
-	(when (and (stringp (cadr tail)) (cddr tail))
-	  (setq tail (cdr tail)))
-	;; Skip the interactive form.
-	(when (eq 'interactive (car-safe (cadr tail)))
-	  (setq tail (cdr tail)))
-	(unless (eq flag (equal (cadr tail) debug-entry-code))
-	  ;; Add/remove debug statement as needed.
-	  (if flag
-	      (setcdr tail (cons debug-entry-code (cdr tail)))
-	    (setcdr tail (cddr tail))))
-	defn))))
+  (let ((tail defn))
+    (if (subrp tail)
+	(error "%s is a built-in function" function)
+      (if (eq (car tail) 'macro) (setq tail (cdr tail)))
+      (if (eq (car tail) 'lambda) (setq tail (cdr tail))
+	(error "%s not user-defined Lisp function" function))
+      ;; Skip the docstring.
+      (when (and (stringp (cadr tail)) (cddr tail))
+	(setq tail (cdr tail)))
+      ;; Skip the interactive form.
+      (when (eq 'interactive (car-safe (cadr tail)))
+	(setq tail (cdr tail)))
+      (unless (eq flag (equal (cadr tail) debug-entry-code))
+	;; Add/remove debug statement as needed.
+	(if flag
+	    (setcdr tail (cons debug-entry-code (cdr tail)))
+	  (setcdr tail (cddr tail))))
+      defn)))
 
 (defun debugger-list-functions ()
   "Display a list of all the functions now set to debug on entry."
--- a/lisp/emulation/cua-base.el	Wed Mar 16 15:59:10 2005 +0000
+++ b/lisp/emulation/cua-base.el	Wed Mar 16 16:03:44 2005 +0000
@@ -1284,6 +1284,7 @@
    next-line previous-line
    forward-word backward-word
    end-of-line beginning-of-line
+   move-end-of-line move-beginning-of-line
    end-of-buffer beginning-of-buffer
    scroll-up scroll-down
    forward-sentence backward-sentence
--- a/lisp/progmodes/gdb-ui.el	Wed Mar 16 15:59:10 2005 +0000
+++ b/lisp/progmodes/gdb-ui.el	Wed Mar 16 16:03:44 2005 +0000
@@ -341,8 +341,12 @@
 	  (speedbar 1)
 	  (if (equal (nth 2 var) "0")
 	      (gdb-enqueue-input
-	       (list (concat "server interpreter mi \"-var-evaluate-expression "
-			     (nth 1 var) "\"\n")
+	       (list
+		(if (with-current-buffer
+			gud-comint-buffer (eq gud-minor-mode 'gdba))
+		    (concat "server interpreter mi \"-var-evaluate-expression "
+			    (nth 1 var) "\"\n")
+		  (concat "-var-evaluate-expression " (nth 1 var) "\n"))
 		     `(lambda () (gdb-var-evaluate-expression-handler
 				  ,(nth 1 var) nil))))
 	    (setq gdb-var-changed t)))
@@ -368,8 +372,8 @@
 
 (defun gdb-var-list-children (varnum)
   (gdb-enqueue-input
-   (list (concat "server interpreter mi \"-var-list-children "  varnum "\"\n")
-	     `(lambda () (gdb-var-list-children-handler ,varnum)))))
+   (list (concat "server interpreter mi \"-var-list-children " varnum "\"\n")
+	 `(lambda () (gdb-var-list-children-handler ,varnum)))))
 
 (defconst gdb-var-list-children-regexp
   "name=\"\\(.*?\\)\",exp=\"\\(.*?\\)\",numchild=\"\\(.*?\\)\"")
@@ -674,9 +678,12 @@
 (defun gdb-send (proc string)
   "A comint send filter for gdb.
 This filter may simply queue input for a later time."
-  (if gud-running
-      (process-send-string proc (concat string "\n"))
-    (gdb-enqueue-input (concat string "\n"))))
+  (let ((item (concat string "\n")))
+    (if gud-running
+      (progn
+	(if gdb-enable-debug-log (push (cons 'send item) gdb-debug-log))
+	(process-send-string proc item))
+      (gdb-enqueue-input item))))
 
 ;; Note: Stuff enqueued here will be sent to the next prompt, even if it
 ;; is a query, or other non-top-level prompt.
@@ -697,7 +704,7 @@
 
 (defun gdb-send-item (item)
   (setq gdb-flush-pending-output nil)
-  (if gdb-enable-debug-log (push (cons 'send item) gdb-debug-log))
+  (if gdb-enable-debug-log (push (cons 'send-item item) gdb-debug-log))
   (setq gdb-current-item item)
   (with-current-buffer gud-comint-buffer
     (if (eq gud-minor-mode 'gdba)
--- a/lisp/reveal.el	Wed Mar 16 15:59:10 2005 +0000
+++ b/lisp/reveal.el	Wed Mar 16 16:03:44 2005 +0000
@@ -161,8 +161,9 @@
 
 (defvar reveal-mode-map
   (let ((map (make-sparse-keymap)))
-    ;; Override the default move-end-of-line which skips valuable
-    ;; invisible text.
+    ;; Override the default move-beginning-of-line and move-end-of-line
+    ;; which skips valuable invisible text.
+    (define-key map [?\C-a] 'beginning-of-line)
     (define-key map [?\C-e] 'end-of-line)
     map))
 
--- a/lisp/simple.el	Wed Mar 16 15:59:10 2005 +0000
+++ b/lisp/simple.el	Wed Mar 16 16:03:44 2005 +0000
@@ -3521,6 +3521,33 @@
 	      (setq arg 1)
 	    (setq done t)))))))
 
+(defun move-beginning-of-line (arg)
+  "Move point to beginning of current display line.
+With argument ARG not nil or 1, move forward ARG - 1 lines first.
+If point reaches the beginning or end of buffer, it stops there.
+To ignore intangibility, bind `inhibit-point-motion-hooks' to t.
+
+This command does not move point across a field boundary unless doing so
+would move beyond there to a different line; if ARG is nil or 1, and
+point starts at a field boundary, point does not move.  To ignore field
+boundaries bind `inhibit-field-text-motion' to t."
+  (interactive "p")
+  (or arg (setq arg 1))
+  (if (/= arg 1)
+      (line-move (1- arg) t))
+  (let (done pos)
+    (while (not done)
+      (beginning-of-line 1)
+      ;; (not bolp) means that it stopped at a field boundary.
+      (if (or (bobp) (not (bolp)))
+	  (setq done t)
+	(sit-for 0)
+	(if (and (consp (setq pos (pos-visible-in-window-p (point) nil t)))
+		 (= (car pos) 0))
+	    (setq done t)
+	  (backward-char 1))))))
+
+
 ;;; Many people have said they rarely use this feature, and often type
 ;;; it by accident.  Maybe it shouldn't even be on a key.
 (put 'set-goal-column 'disabled t)
--- a/man/glossary.texi	Wed Mar 16 15:59:10 2005 +0000
+++ b/man/glossary.texi	Wed Mar 16 16:03:44 2005 +0000
@@ -1077,7 +1077,7 @@
 
 @item Selected Window
 The selected frame is the one your input currently operates on.
-@xref{Basic Windows}.
+@xref{Basic Window}.
 
 @item Selecting a Buffer
 Selecting a buffer means making it the current (q.v.@:) buffer.
--- a/man/mini.texi	Wed Mar 16 15:59:10 2005 +0000
+++ b/man/mini.texi	Wed Mar 16 16:03:44 2005 +0000
@@ -401,7 +401,7 @@
 @code{partial-completion-mode}.  This binds the partial completion
 commands to @key{TAB}, @key{SPC}, @key{RET}, and @kbd{?}.  The usual
 completion commands are available on @kbd{M-@key{TAB}} (or
-@mbd{C-M-i}), @kbd{M-@key{SPC}}, @kbd{M-@key{RET}} and @kbd{M-?}.
+@kbd{C-M-i}), @kbd{M-@key{SPC}}, @kbd{M-@key{RET}} and @kbd{M-?}.
 
 @vindex PC-include-file-path
 @vindex PC-disable-includes
--- a/man/rmail.texi	Wed Mar 16 15:59:10 2005 +0000
+++ b/man/rmail.texi	Wed Mar 16 16:03:44 2005 +0000
@@ -1193,7 +1193,7 @@
 @code{movemail} program and determine its version.  There are two
 versions of @code{movemail} program: the native one, shipped with GNU
 Emacs (the ``emacs version'') and the one included in GNU mailutils
-(the ``mailutils version'', @[xref{movemail,,,mailutils,GNU
+(the ``mailutils version'', @pxref{movemail,,,mailutils,GNU
 mailutils}).  They support the same command line syntax and the same
 basic subset of options.  However, the @samp{mailutils} version offers
 additional features.
--- a/man/sending.texi	Wed Mar 16 15:59:10 2005 +0000
+++ b/man/sending.texi	Wed Mar 16 16:03:44 2005 +0000
@@ -296,12 +296,12 @@
 full name.  Emacs puts them in if they are needed.  For example,
 
 @example
-alias chief-torturer "George W. Bush <bush@whitehouse.gov>"
+alias chief-torturer "George W. Bush <bush@@whitehouse.gov>"
 @end example
 
 @noindent
 is correct.  Emacs will insert the address as @samp{"George W. Bush"
-<bush@whitehouse.gov>}.
+<bush@@whitehouse.gov>}.
 
   Emacs also recognizes ``include'' commands in @samp{.mailrc} files.
 They look like this:
--- a/src/ChangeLog	Wed Mar 16 15:59:10 2005 +0000
+++ b/src/ChangeLog	Wed Mar 16 16:03:44 2005 +0000
@@ -1,3 +1,19 @@
+2005-03-07  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (CLEAR_IMAGE_CACHE_COUNT): New const.
+	(clear_image_cache_count): New var.
+	(redisplay_internal): Don't clear face and image caches in the
+	middle of redisplay; do it afterwards.
+
+	* blockinput.h (TOTALLY_UNBLOCK_INPUT): Avoid dangling else.
+
+	* xdisp.c (notice_overwritten_cursor): Check that phys_cursor.vpos
+	is valid.  If not, clear phys_cursor_on_p and return.
+
+2005-03-07  Andreas Schwab  <schwab@suse.de>
+
+	* blockinput.h (UNBLOCK_INPUT_TO): Always call UNBLOCK_INPUT.
+
 2005-03-06  Richard M. Stallman  <rms@gnu.org>
 
 	* keyboard.c (Ftop_level): Let Fthrow deal with UNBLOCK_INPUT.
--- a/src/blockinput.h	Wed Mar 16 15:59:10 2005 +0000
+++ b/src/blockinput.h	Wed Mar 16 16:03:44 2005 +0000
@@ -98,12 +98,12 @@
    and also reinvoke any pending signal.  */
 
 #define TOTALLY_UNBLOCK_INPUT			\
-  if (interrupt_input_blocked != 0)		\
+  do if (interrupt_input_blocked != 0)		\
     {						\
       interrupt_input_blocked = 1;		\
       UNBLOCK_INPUT;				\
     }						\
-  else
+  while (0)
 
 /* Undo any number of BLOCK_INPUT calls down to level LEVEL,
    and also (if the level is now 0) reinvoke any pending signal.  */
@@ -111,10 +111,8 @@
 #define UNBLOCK_INPUT_TO(LEVEL)				\
   do							\
     {							\
-      int oldlevel = interrupt_input_blocked;		\
       interrupt_input_blocked = (LEVEL) + 1;		\
-      if (interrupt_input_blocked != oldlevel + 1)	\
-        UNBLOCK_INPUT;					\
+      UNBLOCK_INPUT;					\
     }							\
   while (0)
 
--- a/src/xdisp.c	Wed Mar 16 15:59:10 2005 +0000
+++ b/src/xdisp.c	Wed Mar 16 16:03:44 2005 +0000
@@ -781,6 +781,13 @@
 #define CLEAR_FACE_CACHE_COUNT	500
 static int clear_face_cache_count;
 
+/* Similarly for the image cache.  */
+
+#ifdef HAVE_WINDOW_SYSTEM
+#define CLEAR_IMAGE_CACHE_COUNT	101
+static int clear_image_cache_count;
+#endif
+
 /* Non-zero while redisplay_internal is in progress.  */
 
 int redisplaying_p;
@@ -10360,7 +10367,9 @@
   CHARPOS (this_line_start_pos) = 0;
   consider_all_windows_p |= buffer_shared > 1;
   ++clear_face_cache_count;
-
+#ifdef HAVE_WINDOW_SYSTEM
+  ++clear_image_cache_count;
+#endif
 
   /* Build desired matrices, and update the display.  If
      consider_all_windows_p is non-zero, do it for all windows on all
@@ -10373,13 +10382,6 @@
       struct frame **updated
 	= (struct frame **) alloca (size * sizeof *updated);
 
-      /* Clear the face cache eventually.  */
-      if (clear_face_cache_count > CLEAR_FACE_CACHE_COUNT)
-	{
-	  clear_face_cache (0);
-	  clear_face_cache_count = 0;
-	}
-
       /* Recompute # windows showing selected buffer.  This will be
 	 incremented each time such a window is displayed.  */
       buffer_shared = 0;
@@ -10395,12 +10397,6 @@
 		   variables.  */
 		select_frame_for_redisplay (frame);
 
-#ifdef HAVE_WINDOW_SYSTEM
-	      if (clear_face_cache_count % 50 == 0
-		  && FRAME_WINDOW_P (f))
-		clear_image_cache (f, 0);
-#endif /* HAVE_WINDOW_SYSTEM */
-
 	      /* Mark all the scroll bars to be removed; we'll redeem
 		 the ones we want when we redisplay their windows.  */
 	      if (FRAME_DISPLAY (f)->condemn_scroll_bars_hook)
@@ -10604,6 +10600,29 @@
   if (windows_or_buffers_changed && !pause)
     goto retry;
 
+  /* Clear the face cache eventually.  */
+  if (consider_all_windows_p)
+    {
+      if (clear_face_cache_count > CLEAR_FACE_CACHE_COUNT)
+	{
+	  clear_face_cache (0);
+	  clear_face_cache_count = 0;
+	}
+#ifdef HAVE_WINDOW_SYSTEM
+      if (clear_image_cache_count > CLEAR_IMAGE_CACHE_COUNT)
+	{
+	  Lisp_Object tail, frame;
+	  FOR_EACH_FRAME (tail, frame)
+	    {
+	      struct frame *f = XFRAME (frame);
+	      if (FRAME_WINDOW_P (f))
+		clear_image_cache (f, 0);
+	    }
+	  clear_image_cache_count = 0;
+	}
+#endif /* HAVE_WINDOW_SYSTEM */
+    }
+
  end_of_redisplay:
   unbind_to (count, Qnil);
   RESUME_POLLING;
@@ -20202,8 +20221,10 @@
   if (area != TEXT_AREA)
     return;
 
-  row = w->current_matrix->rows + w->phys_cursor.vpos;
-  if (!row->displays_text_p)
+  if (w->phys_cursor.vpos < 0
+      || w->phys_cursor.vpos >= w->current_matrix->nrows
+      || (row = w->current_matrix->rows + w->phys_cursor.vpos,
+	  !(row->enabled_p && row->displays_text_p)))
     return;
 
   if (row->cursor_in_fringe_p)