Now on revision 107719. ------------------------------------------------------------ revno: 107719 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-04-01 10:44:24 +0800 message: Rename file-subdir-of-p to file-in-directory-p. * lisp/files.el (file-in-directory-p): Rename from file-subdir-of-p. Handle root directory properly. (copy-directory): Caller changed. * lisp/dired-aux.el (dired-copy-file-recursive, dired-create-files): * lisp/net/tramp.el (tramp-file-name-for-operation): Callers changed. * doc/lispref/files.texi (Kinds of Files): file-subdir-of-p renamed to file-in-directory-p. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-03-31 19:58:05 +0000 +++ doc/lispref/ChangeLog 2012-04-01 02:44:24 +0000 @@ -1,3 +1,8 @@ +2012-04-01 Chong Yidong + + * files.texi (Kinds of Files): file-subdir-of-p renamed to + file-in-directory-p. + 2012-03-31 Glenn Morris * edebug.texi (Instrumenting Macro Calls): === modified file 'doc/lispref/files.texi' --- doc/lispref/files.texi 2012-03-01 08:21:32 +0000 +++ doc/lispref/files.texi 2012-04-01 02:44:24 +0000 @@ -1024,12 +1024,13 @@ not exist, the return value is unspecified. @end defun -@defun file-subdir-of-p dir1 dir2 -This function returns @code{t} if directory @var{dir1} is a -subdirectory of @var{dir2}, or if @var{dir1} and @var{dir2} are the -same directory. It compares the @code{file-truename} values of the -two directories (@pxref{Truenames}). If @var{dir2} -do not name an existing directory, the return value is @code{nil}. +@defun file-in-directory-p file dir +This function returns @code{t} if @var{file} is a file in directory +@var{dir}, or in a subdirectory of @var{dir}. It also returns +@code{t} if @var{file} and @var{dir} are the same directory. It +compares the @code{file-truename} values of the two directories +(@pxref{Truenames}). If @var{dir} does not name an existing +directory, the return value is @code{nil}. @end defun @node Truenames @@ -2718,7 +2719,7 @@ @code{file-name-nondirectory}, @code{file-name-sans-versions}, @code{file-newer-than-file-p}, @code{file-ownership-preserved-p}, -@code{file-readable-p}, @code{file-regular-p}, @code{file-subdir-of-p}, +@code{file-readable-p}, @code{file-regular-p}, @code{file-in-directory-p}, @code{file-symlink-p}, @code{file-truename}, @code{file-writable-p}, @code{file-equal-p}, @code{find-backup-file-name}, @c Not sure why it was here: @code{find-file-noselect},@* === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-31 20:22:04 +0000 +++ lisp/ChangeLog 2012-04-01 02:44:24 +0000 @@ -1,3 +1,12 @@ +2012-04-01 Chong Yidong + + * files.el (file-in-directory-p): Rename from file-subdir-of-p. + Handle root directory properly. + (copy-directory): Caller changed. + + * dired-aux.el (dired-copy-file-recursive, dired-create-files): + * net/tramp.el (tramp-file-name-for-operation): Callers changed. + 2012-03-31 Glenn Morris * term/xterm.el (xterm-extra-capabilities): Doc fix. === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2012-03-30 16:52:52 +0000 +++ lisp/dired-aux.el 2012-04-01 02:44:24 +0000 @@ -1265,7 +1265,7 @@ (defun dired-copy-file-recursive (from to ok-flag &optional preserve-time top recursive) (when (and (eq t (car (file-attributes from))) - (file-subdir-of-p to from)) + (file-in-directory-p to from)) (error "Cannot copy `%s' into its subdirectory `%s'" from to)) (let ((attrs (file-attributes from))) (if (and recursive @@ -1456,7 +1456,7 @@ ;; and the method in use is copying, signal an error. (and (eq t (car (file-attributes destname))) (eq file-creator 'dired-copy-file) - (file-subdir-of-p destname from) + (file-in-directory-p destname from) (error "Cannot copy `%s' into its subdirectory `%s'" from to))) (condition-case err === modified file 'lisp/dired.el' --- lisp/dired.el 2012-03-31 07:45:33 +0000 +++ lisp/dired.el 2012-04-01 02:44:24 +0000 @@ -3736,7 +3736,7 @@ ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff -;;;;;; dired-diff) "dired-aux" "dired-aux.el" "a07cca6379bd3fdc9eaeba4d341b89ee") +;;;;;; dired-diff) "dired-aux" "dired-aux.el" "58d623eb8e68e472e6164a1bcae83360") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ === modified file 'lisp/files.el' --- lisp/files.el 2012-03-30 16:49:29 +0000 +++ lisp/files.el 2012-04-01 02:44:24 +0000 @@ -5015,20 +5015,20 @@ (setq f2-attr (file-attributes (file-truename file2))) (equal f1-attr f2-attr)))))) -(defun file-subdir-of-p (dir1 dir2) - "Return non-nil if DIR1 is a subdirectory of DIR2. -A directory is considered to be a subdirectory of itself. -Return nil if top directory DIR2 is not an existing directory." - (let ((handler (or (find-file-name-handler dir1 'file-subdir-of-p) - (find-file-name-handler dir2 'file-subdir-of-p)))) +(defun file-in-directory-p (file dir) + "Return non-nil if FILE is in DIR or a subdirectory of DIR. +A directory is considered to be \"in\" itself. +Return nil if DIR is not an existing directory." + (let ((handler (or (find-file-name-handler file 'file-in-directory-p) + (find-file-name-handler dir 'file-in-directory-p)))) (if handler - (funcall handler 'file-subdir-of-p dir1 dir2) - (when (file-directory-p dir2) ; Top dir must exist. - (setq dir1 (file-truename dir1) - dir2 (file-truename dir2)) - (let ((ls1 (or (split-string dir1 "/" t) '("/"))) - (ls2 (or (split-string dir2 "/" t) '("/"))) - (root (if (string-match "\\`/" dir1) "/" "")) + (funcall handler 'file-in-directory-p file dir) + (when (file-directory-p dir) ; DIR must exist. + (setq file (file-truename file) + dir (file-truename dir)) + (let ((ls1 (split-string file "/" t)) + (ls2 (split-string dir "/" t)) + (root (if (string-match "\\`/" file) "/" "")) (mismatch nil)) (while (and ls1 ls2 (not mismatch)) (if (string-equal (car ls1) (car ls2)) @@ -5037,7 +5037,7 @@ (setq ls1 (cdr ls1) ls2 (cdr ls2))) (unless mismatch - (file-equal-p root dir2))))))) + (file-equal-p root dir))))))) (defun copy-directory (directory newname &optional keep-time parents copy-contents) "Copy DIRECTORY to NEWNAME. Both args must be strings. @@ -5065,7 +5065,7 @@ (format "Copy directory %s to: " dir) default-directory default-directory nil nil) current-prefix-arg t nil))) - (when (file-subdir-of-p newname directory) + (when (file-in-directory-p newname directory) (error "Cannot copy `%s' into its subdirectory `%s'" directory newname)) ;; If default-directory is a remote directory, make sure we find its === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2012-02-28 09:28:52 +0000 +++ lisp/net/tramp.el 2012-04-01 02:44:24 +0000 @@ -1810,7 +1810,7 @@ ;; Emacs 23+ only. 'copy-directory ;; Emacs 24+ only. - 'file-equal-p 'file-subdir-of-p + 'file-equal-p 'file-in-directory-p ;; XEmacs only. 'dired-make-relative-symlink 'vm-imap-move-mail 'vm-pop-move-mail 'vm-spool-move-mail)) ------------------------------------------------------------ revno: 107718 committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-03-31 13:22:04 -0700 message: Doc fix for xterm-extra-capabilities * lisp/term/xterm.el (xterm-extra-capabilities): Doc fix. * etc/PROBLEMS: Mention xterm-extra-capabilities issue. diff: === modified file 'etc/PROBLEMS' --- etc/PROBLEMS 2012-03-12 09:55:35 +0000 +++ etc/PROBLEMS 2012-03-31 20:22:04 +0000 @@ -1679,6 +1679,23 @@ global-font-lock-mode RET" or by customizing the variable `global-font-lock-mode'. +** Unexpected characters inserted into the buffer when you start Emacs. +See eg http://debbugs.gnu.org/11129 + +This can happen when you start Emacs in -nw mode in an Xterm. +For example, in the *scratch* buffer, you might see something like: + + 0;276;0c + +This is more likely to happen if you are using Emacs over a slow +connection, and begin typing before Emacs is ready to respond. + +This occurs when Emacs tries to query the terminal to see what +capabilities it supports, and gets confused by the answer. +To avoid it, set xterm-extra-capabilities to a value other than +`check' (the default). See that variable's documentation (in +term/xterm.el) for more details. + * Runtime problems specific to individual Unix variants ** GNU/Linux === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-31 20:05:46 +0000 +++ lisp/ChangeLog 2012-03-31 20:22:04 +0000 @@ -1,5 +1,7 @@ 2012-03-31 Glenn Morris + * term/xterm.el (xterm-extra-capabilities): Doc fix. + * language/indian.el ("Devanagari"): Fix typo. (Bug#11103) * calendar/calendar.el (calendar-window-list) === modified file 'lisp/term/xterm.el' --- lisp/term/xterm.el 2012-02-11 22:13:29 +0000 +++ lisp/term/xterm.el 2012-03-31 20:22:04 +0000 @@ -30,9 +30,15 @@ :group 'emacs) (defcustom xterm-extra-capabilities 'check - "Set to a list if the XTerm supports modifyOtherKeys or -reporting the background color. Set to 'check to check for those -features. Set to nil to skip the checks." + "Whether Xterm supports some additional, more modern, features. +If nil, just assume that it does not. +If `check', try to check if it does. +If a list, assume that the listed features are supported, without checking. + +The relevant features are: + modifyOtherKeys -- if supported, more key bindings work (e.g, \"\\C-,\") + reportBackground -- if supported, Xterm reports its background color +" :version "24.1" :group 'xterm :type '(choice (const :tag "No" nil) ------------------------------------------------------------ revno: 107717 fixes bug(s): http://debbugs.gnu.org/11103 committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-03-31 13:05:46 -0700 message: * lisp/language/indian.el ("Devanagari"): Fix typo. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-31 20:03:59 +0000 +++ lisp/ChangeLog 2012-03-31 20:05:46 +0000 @@ -1,5 +1,7 @@ 2012-03-31 Glenn Morris + * language/indian.el ("Devanagari"): Fix typo. (Bug#11103) + * calendar/calendar.el (calendar-window-list) (calendar-hide-window): Restore. (Bug#11140) (calendar-exit): Use calendar-window-list, calendar-hide-window again. === modified file 'lisp/language/indian.el' --- lisp/language/indian.el 2012-01-19 07:21:25 +0000 +++ lisp/language/indian.el 2012-03-31 20:05:46 +0000 @@ -46,7 +46,7 @@ "Devanagari" '((charset unicode) (coding-system utf-8) (coding-priority utf-8) - (input-method . "dev-aiba") + (input-method . "devanagari-aiba") (documentation . "\ Such languages using Devanagari script as Hindi and Marathi are supported in this language environment.")) ------------------------------------------------------------ revno: 107716 fixes bug(s): http://debbugs.gnu.org/11140 committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-03-31 13:03:59 -0700 message: Revert 2012-03-28 calendar change * lisp/calendar/calendar.el (calendar-window-list) (calendar-hide-window): Restore. (calendar-exit): Use calendar-window-list, calendar-hide-window again. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-31 19:58:05 +0000 +++ lisp/ChangeLog 2012-03-31 20:03:59 +0000 @@ -1,5 +1,9 @@ 2012-03-31 Glenn Morris + * calendar/calendar.el (calendar-window-list) + (calendar-hide-window): Restore. (Bug#11140) + (calendar-exit): Use calendar-window-list, calendar-hide-window again. + * emacs-lisp/edebug.el (edebug-unwrap-results): Doc fix. 2012-03-30 Thierry Volpiatto === modified file 'lisp/calendar/calendar.el' --- lisp/calendar/calendar.el 2012-03-29 14:00:00 +0000 +++ lisp/calendar/calendar.el 2012-03-31 20:03:59 +0000 @@ -1793,6 +1793,19 @@ ?\s (- calendar-right-margin (1- start)))))) (force-mode-line-update)))) +(defun calendar-window-list () + "List of all calendar-related windows." + (let ((calendar-buffers (calendar-buffer-list)) + list) + ;; Using 0 rather than t for last argument - see bug#2199. + ;; This is only used with calendar-hide-window, which ignores + ;; iconified frames anyway, so could use 'visible rather than 0. + (walk-windows (lambda (w) + (if (memq (window-buffer w) calendar-buffers) + (push w list))) + nil 0) + list)) + (defun calendar-buffer-list () "List of all calendar-related buffers (as buffers, not strings)." (let (buffs) @@ -1804,29 +1817,41 @@ (push b buffs))) buffs)) -(defun calendar-exit (&optional kill) +(defun calendar-exit () "Get out of the calendar window and hide it and related buffers." - (interactive "P") - (let ((diary-buffer (get-file-buffer diary-file)) - (calendar-buffers (calendar-buffer-list))) - (when (or (not diary-buffer) - (not (buffer-modified-p diary-buffer)) - (yes-or-no-p - "Diary modified; do you really want to exit the calendar? ")) - (if (and calendar-setup (display-multi-frame-p)) - ;; FIXME: replace this cruft with the `quit-restore' window property - (dolist (w (window-list-1 nil nil t)) - (if (and (memq (window-buffer w) calendar-buffers) - (window-dedicated-p w)) - (if calendar-remove-frame-by-deleting - (delete-frame (window-frame w)) - (iconify-frame (window-frame w))) - (quit-window kill w))) - (dolist (b calendar-buffers) - (quit-windows-on b kill)))))) + (interactive) + (let ((diary-buffer (get-file-buffer diary-file))) + (if (or (not diary-buffer) + (not (buffer-modified-p diary-buffer)) + (yes-or-no-p + "Diary modified; do you really want to exit the calendar? ")) + ;; Need to do this multiple times because one time can replace some + ;; calendar-related buffers with other calendar-related buffers. + (mapc (lambda (x) + (mapc 'calendar-hide-window (calendar-window-list))) + (calendar-window-list))))) (define-obsolete-function-alias 'exit-calendar 'calendar-exit "23.1") +(defun calendar-hide-window (window) + "Hide WINDOW if it is calendar-related." + (let ((buffer (if (window-live-p window) (window-buffer window)))) + (if (memq buffer (calendar-buffer-list)) + (cond + ((and (display-multi-frame-p) + (eq 'icon (cdr (assoc 'visibility + (frame-parameters + (window-frame window)))))) + nil) + ((and (display-multi-frame-p) (window-dedicated-p window)) + (if calendar-remove-frame-by-deleting + (delete-frame (window-frame window)) + (iconify-frame (window-frame window)))) + ((not (and (select-window window) (one-window-p window))) + (delete-window window)) + (t (set-buffer buffer) + (bury-buffer)))))) + (defun calendar-current-date (&optional offset) "Return the current date in a list (month day year). Optional integer OFFSET is a number of days from the current date." ------------------------------------------------------------ revno: 107715 committer: Glenn Morris branch nick: trunk timestamp: Sat 2012-03-31 12:58:05 -0700 message: Edebug doc fixes * doc/lispref/edebug.texi (Instrumenting Macro Calls): Mention defining macros at instrumentation time. (Edebug Options): Mention edebug-unwrap-results. * lisp/emacs-lisp/edebug.el (edebug-unwrap-results): Doc fix. Comments. * admin/FOR-RELEASE: Markup. diff: === modified file 'admin/FOR-RELEASE' --- admin/FOR-RELEASE 2012-03-30 16:31:24 +0000 +++ admin/FOR-RELEASE 2012-03-31 19:58:05 +0000 @@ -183,7 +183,7 @@ abbrevs.texi rgm advice.texi cyd anti.texi -back.texi +back.texi rgm backups.texi cyd buffers.texi cyd commands.texi cyd @@ -192,7 +192,7 @@ customize.texi cyd debugging.texi cyd display.texi cyd -edebug.texi +edebug.texi rgm elisp.texi errors.texi rgm eval.texi cyd === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-03-31 10:27:04 +0000 +++ doc/lispref/ChangeLog 2012-03-31 19:58:05 +0000 @@ -1,3 +1,9 @@ +2012-03-31 Glenn Morris + + * edebug.texi (Instrumenting Macro Calls): + Mention defining macros at instrumentation time. + (Edebug Options): Mention edebug-unwrap-results. + 2012-03-31 Eli Zaretskii * text.texi (Special Properties): Clarify the description of the === modified file 'doc/lispref/edebug.texi' --- doc/lispref/edebug.texi 2012-03-31 01:09:30 +0000 +++ doc/lispref/edebug.texi 2012-03-31 19:58:05 +0000 @@ -1113,6 +1113,15 @@ arguments. @xref{Defining Macros}, for more explanation of the @code{declare} form. +@c See eg http://debbugs.gnu.org/10577 +@c FIXME Maybe there should be an Edebug option to get it to +@c automatically load the entire source file containing the function +@c being instrumented. That would avoid this. + Take care to ensure that the specifications are known to Edebug when +you instrument code. If you are instrumenting a function from a file +that uses @code{eval-when-compile} to require another file containing +macro definitions, you may need to explicitly load that file. + You can also define an edebug specification for a macro separately from the macro definition with @code{def-edebug-spec}. Adding @code{debug} declarations is preferred, and more convenient, for macro @@ -1255,6 +1264,8 @@ of them match, nothing is matched, but the @code{¬} specification succeeds. +@c FIXME &key? + @item &define @c @kindex &define @r{(Edebug)} Indicates that the specification is for a defining form. The defining @@ -1422,7 +1433,15 @@ optional expression. In the specification below, notice the @code{gate} inside of the sublist to prevent backtracking once a sublist is found. -@c FIXME? The actual definition in edebug.el does not have a gate. +@ignore +@c FIXME? The actual definition in edebug.el looks like this (and always +@c has AFAICS). In fact, nothing in edebug.el uses gate. So maybe +@c this is just an example for illustration? +(def-edebug-spec let + ((&rest + &or (symbolp &optional form) symbolp) + body)) +@end ignore @example (def-edebug-spec let ((&rest @@ -1566,7 +1585,28 @@ @xref{Edebug Execution Modes}. @end defopt -@c FIXME edebug-unwrap-results +@defopt edebug-unwrap-results +If non-@code{nil}, Edebug tries to remove any of its own +instrumentation when showing the results of expressions. This is +relevant when debugging macros where the results of expressions are +themselves instrumented expressions. As a very artificial example, +suppose that the example function @code{fac} has been instrumented, +and consider a macro of the form: + +@c FIXME find a less silly example. +@smallexample +(defmacro test () "Edebug example." + (if (symbol-function 'fac) + @dots{})) +@end smallexample + +If you instrument the @code{test} macro and step through it, then by +default the result of the @code{symbol-function} call has numerous +@code{edebug-after} and @code{edebug-before} forms, which can make it +difficult to see the ``actual'' result. If +@code{edebug-unwrap-results} is non-@code{nil}, Edebug tries to remove +these forms from the result. +@end defopt @defopt edebug-on-error Edebug binds @code{debug-on-error} to this value, if === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-30 16:49:29 +0000 +++ lisp/ChangeLog 2012-03-31 19:58:05 +0000 @@ -1,3 +1,7 @@ +2012-03-31 Glenn Morris + + * emacs-lisp/edebug.el (edebug-unwrap-results): Doc fix. + 2012-03-30 Thierry Volpiatto * dired-aux.el (dired-copy-file-recursive, dired-create-files): === modified file 'lisp/emacs-lisp/edebug.el' --- lisp/emacs-lisp/edebug.el 2012-01-19 07:21:25 +0000 +++ lisp/emacs-lisp/edebug.el 2012-03-31 19:58:05 +0000 @@ -1,6 +1,6 @@ ;;; edebug.el --- a source-level debugger for Emacs Lisp -;; Copyright (C) 1988-1995, 1997, 1999-2012 Free Software Foundation, Inc. +;; Copyright (C) 1988-1995, 1997, 1999-2012 Free Software Foundation, Inc. ;; Author: Daniel LaLiberte ;; Maintainer: FSF @@ -191,6 +191,7 @@ (defcustom edebug-unwrap-results nil "Non-nil if Edebug should unwrap results of expressions. +That is, Edebug will try to remove its own instrumentation from the result. This is useful when debugging macros where the results of expressions are instrumented expressions. But don't do this when results might be circular or an infinite loop will result." @@ -2028,7 +2029,10 @@ (def-edebug-spec apply (function-form &rest form)) (def-edebug-spec funcall (function-form &rest form)) -;; FIXME? The manual has a gate here. +;; FIXME? The manual uses this form (maybe that's just for illustration?): +;; (def-edebug-spec let +;; ((&rest &or symbolp (gate symbolp &optional form)) +;; body)) (def-edebug-spec let ((&rest &or (symbolp &optional form) symbolp) body)) @@ -4157,6 +4161,8 @@ ;;; Frequency count and coverage ;; FIXME should this use overlays instead? +;; Definitely, IMO. The current business with undo in +;; edebug-temp-display-freq-count is horrid. (defun edebug-display-freq-count () "Display the frequency count data for each line of the current definition. The frequency counts are inserted as comment lines after each line, @@ -4226,6 +4232,8 @@ (insert "\n") (setq i first-index))))) +;; FIXME this does not work very well. Eg if you press an arrow key, +;; or make a mouse-click, it fails with "Non-character input-event". (defun edebug-temp-display-freq-count () "Temporarily display the frequency count data for the current definition. It is removed when you hit any char." @@ -4235,6 +4243,7 @@ (undo-boundary) (edebug-display-freq-count) (setq unread-command-char (read-char)) + ;; Yuck! This doesn't seem to work at all for me. (undo))) ------------------------------------------------------------ revno: 107714 fixes bug(s): http://debbugs.gnu.org/11063 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-03-31 22:30:53 +0300 message: Fix bug #11063 with move_it_by_lines when there's a before-string at bol. src/xdisp.c (move_it_by_lines): When DVPOS is positive, and the position we get to after a call to move_it_to fails the IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position only if we wind up in a string from display property. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-03-31 18:10:34 +0000 +++ src/ChangeLog 2012-03-31 19:30:53 +0000 @@ -1,5 +1,10 @@ 2012-03-31 Eli Zaretskii + * xdisp.c (move_it_by_lines): When DVPOS is positive, and the + position we get to after a call to move_it_to fails the + IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position + only if we wind up in a string from display property. (Bug#11063) + * window.c (Fdelete_other_windows_internal): Invalidate the row and column information about mouse highlight, so that redisplay restores it after reallocating the glyph matrices. (Bug#7464) === modified file 'src/xdisp.c' --- src/xdisp.c 2012-03-31 17:08:38 +0000 +++ src/xdisp.c 2012-03-31 19:30:53 +0000 @@ -8973,7 +8973,20 @@ { move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS); if (!IT_POS_VALID_AFTER_MOVE_P (it)) - move_it_to (it, IT_CHARPOS (*it) + 1, -1, -1, -1, MOVE_TO_POS); + { + /* Only move to the next buffer position if we ended up in a + string from display property, not in an overlay string + (before-string or after-string). That is because the + latter don't conceal the underlying buffer position, so + we can ask to move the iterator to the exact position we + are interested in. Note that, even if we are already at + IT_CHARPOS (*it), the call below is not a no-op, as it + will detect that we are at the end of the string, pop the + iterator, and compute it->current_x and it->hpos + correctly. */ + move_it_to (it, IT_CHARPOS (*it) + it->string_from_display_prop_p, + -1, -1, -1, MOVE_TO_POS); + } } else { ------------------------------------------------------------ revno: 107713 fixes bug(s): http://debbugs.gnu.org/7464 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-03-31 21:10:34 +0300 message: Fix bug #7464 with mouse highlight after "C-x 1". src/window.c (Fdelete_other_windows_internal): Invalidate the row and column information about mouse highlight, so that redisplay restores it after reallocating the glyph matrices. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-03-31 17:08:38 +0000 +++ src/ChangeLog 2012-03-31 18:10:34 +0000 @@ -1,5 +1,9 @@ 2012-03-31 Eli Zaretskii + * window.c (Fdelete_other_windows_internal): Invalidate the row + and column information about mouse highlight, so that redisplay + restores it after reallocating the glyph matrices. (Bug#7464) + * xdisp.c (set_cursor_from_row): If `cursor' property on a display string comes from a `display' text property, use the buffer position of that property as if we actually saw that position in === modified file 'src/window.c' --- src/window.c 2012-03-12 06:34:32 +0000 +++ src/window.c 2012-03-31 18:10:34 +0000 @@ -2565,6 +2565,7 @@ Lisp_Object sibling, pwindow, swindow IF_LINT (= Qnil), delta; EMACS_INT startpos IF_LINT (= 0); int top IF_LINT (= 0), new_top, resize_failed; + Mouse_HLInfo *hlinfo; w = decode_any_window (window); XSETWINDOW (window, w); @@ -2645,6 +2646,20 @@ } BLOCK_INPUT; + hlinfo = MOUSE_HL_INFO (f); + /* We are going to free the glyph matrices of WINDOW, and with that + we might lose any information about glyph rows that have some of + their glyphs highlighted in mouse face. (These rows are marked + with a non-zero mouse_face_p flag.) If WINDOW indeed has some + glyphs highlighted in mouse face, signal to frame's up-to-date + hook that mouse highlight was overwritten, so that it will + arrange for redisplaying the highlight. */ + if (EQ (hlinfo->mouse_face_window, window)) + { + hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; + hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; + hlinfo->mouse_face_window = Qnil; + } free_window_matrices (r); windows_or_buffers_changed++; ------------------------------------------------------------ revno: 107712 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-03-31 20:08:38 +0300 message: Remove an incorrect assertion on move_it_by_lines. src/xdisp.c (move_it_by_lines): Remove the assertion that "it->current_x == 0 && it->hpos == 0" which can be legitimately violated when there's a before-string at the beginning of a line. (Bug#11063) diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-03-31 07:45:33 +0000 +++ src/ChangeLog 2012-03-31 17:08:38 +0000 @@ -4,6 +4,10 @@ string comes from a `display' text property, use the buffer position of that property as if we actually saw that position in the row's glyphs. + (move_it_by_lines): Remove the assertion that + "it->current_x == 0 && it->hpos == 0" which can be legitimately + violated when there's a before-string at the beginning of a line. + (Bug#11063) 2012-03-30 Eli Zaretskii === modified file 'src/xdisp.c' --- src/xdisp.c 2012-03-31 07:45:33 +0000 +++ src/xdisp.c 2012-03-31 17:08:38 +0000 @@ -8966,7 +8966,6 @@ { /* DVPOS == 0 means move to the start of the screen line. */ move_it_vertically_backward (it, 0); - xassert (it->current_x == 0 && it->hpos == 0); /* Let next call to line_bottom_y calculate real line height */ last_height = 0; } ------------------------------------------------------------ revno: 107711 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-03-31 13:27:04 +0300 message: Improve documentation of 'cursor' text property. doc/lispref/text.texi (Special Properties): Clarify the description of the effect of integer values of the 'cursor' property on cursor position. See the discussions in bug#11068 for more details and context. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-03-31 01:09:30 +0000 +++ doc/lispref/ChangeLog 2012-03-31 10:27:04 +0000 @@ -1,3 +1,10 @@ +2012-03-31 Eli Zaretskii + + * text.texi (Special Properties): Clarify the description of the + effect of integer values of the 'cursor' property on cursor + position. See the discussions in bug#11068 for more details and + context. + 2012-03-31 Glenn Morris * edebug.texi (Edebug Eval, Specification List, Edebug Options): === modified file 'doc/lispref/text.texi' --- doc/lispref/text.texi 2012-03-11 16:27:36 +0000 +++ doc/lispref/text.texi 2012-03-31 10:27:04 +0000 @@ -3179,21 +3179,41 @@ @item cursor @kindex cursor @r{(text property)} -Normally, the cursor is displayed at the end of any overlay and text -property strings present at the current buffer position. You can -place the cursor on any desired character of these strings by giving -that character a non-@code{nil} @code{cursor} text property. In -addition, if the value of the @code{cursor} property of an overlay -string is an integer number, it specifies the number of buffer's -character positions associated with the overlay string; this way, -Emacs will display the cursor on the character with that property -regardless of whether the current buffer position is actually covered -by the overlay. Specifically, if the value of the @code{cursor} -property of a character is the number @var{n}, the cursor will be -displayed on this character for any buffer position in the range -@code{[@var{ovpos}..@var{ovpos}+@var{n}]}, where @var{ovpos} is the -starting buffer position covered by the overlay (@pxref{Managing -Overlays}). +Normally, the cursor is displayed at the beginning or the end of any +overlay and text property strings present at the current buffer +position. You can place the cursor on any desired character of these +strings by giving that character a non-@code{nil} @code{cursor} text +property. In addition, if the value of the @code{cursor} property is +an integer number, it specifies the number of buffer's character +positions, starting with the position where the overlay or the +@code{display} property begins, for which the cursor should be +displayed on that character. Specifically, if the value of the +@code{cursor} property of a character is the number @var{n}, the +cursor will be displayed on this character for any buffer position in +the range @code{[@var{ovpos}..@var{ovpos}+@var{n})}, where @var{ovpos} +is the overlay's starting position given by @code{overlay-start} +(@pxref{Managing Overlays}), or the position where the @code{display} +text property begins in the buffer. + +In other words, the string character with the @code{cursor} property +of any non-@code{nil} value is the character where to display the +cursor. The value of the property says for which buffer positions to +display the cursor there. If the value is an integer number @var{n}, +the cursor is displayed there when point is anywhere between the +beginning of the overlay or @code{display} property and @var{n} +positions after that. If the value is anything else and +non-@code{nil}, the cursor is displayed there only when point is at +the beginning of the @code{display} property or at +@code{overlay-start}. + +@cindex cursor position for @code{display} properties and overlays +When the buffer has many overlay strings (e.g., @pxref{Overlay +Properties, before-string}) or @code{display} properties that are +strings, it is a good idea to use the @code{cursor} property on these +strings to cue the Emacs display about the places where to put the +cursor while traversing these strings. This directly communicates to +the display engine where the Lisp program wants to put the cursor, or +where the user would expect the cursor. @item pointer @kindex pointer @r{(text property)} ------------------------------------------------------------ revno: 107710 fixes bug(s): http://debbugs.gnu.org/11091 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-03-31 12:52:20 +0300 message: Fix bug #11091 with inaccurate docs of emacsclient on MS-Windows. doc/emacs/misc.texi (emacsclient Options): Document peculiarities of new frame creation on MS-Windows under -c or -t options. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2012-03-30 16:31:24 +0000 +++ doc/emacs/ChangeLog 2012-03-31 09:52:20 +0000 @@ -1,3 +1,8 @@ +2012-03-31 Eli Zaretskii + + * misc.texi (emacsclient Options): Document peculiarities of new + frame creation on MS-Windows under -c or -t options. (Bug#11091) + 2012-03-30 Chong Yidong * files.texi (File Conveniences): Clarify Imagemagick discussion. === modified file 'doc/emacs/misc.texi' --- doc/emacs/misc.texi 2012-01-19 07:21:25 +0000 +++ doc/emacs/misc.texi 2012-03-31 09:52:20 +0000 @@ -1506,10 +1506,12 @@ Create a new graphical frame, instead of using an existing Emacs frame. Emacs can create a graphical frame even if it was started in a text-only terminal, provided it is able to connect to a graphical -display. If no graphical display is available, Emacs creates a new -text-only terminal frame (@pxref{Frames}). If you omit a filename -argument while supplying the @samp{-c} option, the new frame displays -the @samp{*scratch*} buffer (@pxref{Buffers}). +display, and provided it can create graphical frames when started from +a text-only terminal. Otherwise@footnote{ +This is what happens on MS-Windows. +}, Emacs creates a new text-only terminal frame (@pxref{Frames}). If +you omit a filename argument while supplying the @samp{-c} option, the +new frame displays the @samp{*scratch*} buffer (@pxref{Buffers}). @item -F @var{alist} @itemx --frame-parameters=@var{alist} @@ -1592,11 +1594,15 @@ @itemx --tty @itemx -nw Create a new Emacs frame on the current text-only terminal, instead of -using an existing Emacs frame. Emacs can open a text-only terminal +using an existing Emacs frame. If Emacs can open a text-only terminal even if it was started in another text-only terminal, or on a -graphical display. If you omit a filename argument while supplying -this option, the new frame displays the @samp{*scratch*} buffer. -@xref{Buffers}. +graphical display, it will create a text-only frame on the current +terminal. Otherwise@footnote{ +This is what happens on MS-Windows. +}, it will create a new frame, either GUI or text-only, on the +same terminal where Emacs was started. If you omit a filename +argument while supplying this option, the new frame displays the +@samp{*scratch*} buffer. @xref{Buffers}. @end table If you type @kbd{C-x C-c} (@code{save-buffers-kill-terminal}) in an ------------------------------------------------------------ revno: 107709 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-03-31 10:45:33 +0300 message: Fix cursor positioning in rows completely covered by display strings. src/xdisp.c (set_cursor_from_row): If `cursor' property on a display string comes from a `display' text property, use the buffer position of that property as if we actually saw that position in the row's glyphs. diff: === modified file 'lisp/dired.el' --- lisp/dired.el 2012-03-30 16:49:29 +0000 +++ lisp/dired.el 2012-03-31 07:45:33 +0000 @@ -3736,7 +3736,7 @@ ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff -;;;;;; dired-diff) "dired-aux" "dired-aux.el" "aefbe886cce7b5436fd41a7c55c86f84") +;;;;;; dired-diff) "dired-aux" "dired-aux.el" "a07cca6379bd3fdc9eaeba4d341b89ee") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ === modified file 'src/ChangeLog' --- src/ChangeLog 2012-03-30 08:45:27 +0000 +++ src/ChangeLog 2012-03-31 07:45:33 +0000 @@ -1,3 +1,10 @@ +2012-03-31 Eli Zaretskii + + * xdisp.c (set_cursor_from_row): If `cursor' property on a display + string comes from a `display' text property, use the buffer + position of that property as if we actually saw that position in + the row's glyphs. + 2012-03-30 Eli Zaretskii * xdisp.c (append_space_for_newline): If the default face was === modified file 'src/xdisp.c' --- src/xdisp.c 2012-03-30 08:45:27 +0000 +++ src/xdisp.c 2012-03-31 07:45:33 +0000 @@ -13800,16 +13800,31 @@ chprop = Fget_char_property (make_number (glyph_pos), Qcursor, glyph->object); + if (!NILP (chprop)) + { + /* If the string came from a `display' text property, + look up the buffer position of that property and + use that position to update bpos_max, as if we + actually saw such a position in one of the row's + glyphs. This helps with supporting integer values + of `cursor' property on the display string in + situations where most or all of the row's buffer + text is completely covered by display properties, + so that no glyph with valid buffer positions is + ever seen in the row. */ + EMACS_INT prop_pos = + string_buffer_position_lim (glyph->object, pos_before, + pos_after, 0); + + if (prop_pos >= pos_before) + bpos_max = prop_pos - 1; + } if (INTEGERP (chprop)) { bpos_covered = bpos_max + XINT (chprop); /* If the `cursor' property covers buffer positions up to and including point, we should display cursor on - this glyph. Note that overlays and text properties - with string values stop bidi reordering, so every - buffer position to the left of the string is always - smaller than any position to the right of the - string. Therefore, if a `cursor' property on one + this glyph. Note that, if a `cursor' property on one of the string's characters has an integer value, we will break out of the loop below _before_ we get to the position match above. IOW, integer values of @@ -13869,6 +13884,15 @@ chprop = Fget_char_property (make_number (glyph_pos), Qcursor, glyph->object); + if (!NILP (chprop)) + { + EMACS_INT prop_pos = + string_buffer_position_lim (glyph->object, pos_before, + pos_after, 0); + + if (prop_pos >= pos_before) + bpos_max = prop_pos - 1; + } if (INTEGERP (chprop)) { bpos_covered = bpos_max + XINT (chprop); ------------------------------------------------------------ revno: 107708 committer: Glenn Morris branch nick: trunk timestamp: Fri 2012-03-30 21:09:30 -0400 message: lispref/edebug.texi copyedits * doc/lispref/edebug.texi (Edebug Eval, Specification List, Edebug Options): Copyedits. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-03-30 16:31:24 +0000 +++ doc/lispref/ChangeLog 2012-03-31 01:09:30 +0000 @@ -1,3 +1,8 @@ +2012-03-31 Glenn Morris + + * edebug.texi (Edebug Eval, Specification List, Edebug Options): + Copyedits. + 2012-03-30 Chong Yidong * display.texi (Image Formats): Add imagemagick type. === modified file 'doc/lispref/edebug.texi' --- doc/lispref/edebug.texi 2012-03-30 16:12:37 +0000 +++ doc/lispref/edebug.texi 2012-03-31 01:09:30 +0000 @@ -629,7 +629,7 @@ @node Edebug Eval @subsection Evaluation - While within Edebug, you can evaluate expressions ``as if'' Edebug + While within Edebug, you can evaluate expressions as if Edebug were not running. Edebug tries to be invisible to the expression's evaluation and printing. Evaluation of expressions that cause side effects will work as expected, except for changes to data that Edebug @@ -656,6 +656,7 @@ lexically bound symbols created by the following constructs in @file{cl.el}: @code{lexical-let}, @code{macrolet}, and @code{symbol-macrolet}. +@c FIXME? What about lexical-binding = t? @node Eval List @subsection Evaluation List Buffer @@ -1170,7 +1171,7 @@ @dfn{specification keywords}, are symbols beginning with @samp{&} (such as @code{&optional}). -A specification list may contain sublists which match arguments that are +A specification list may contain sublists, which match arguments that are themselves lists, or it may contain vectors used for grouping. Sublists and groups thus subdivide the specification list into a hierarchy of levels. Specification keywords apply only to the remainder of the @@ -1221,7 +1222,7 @@ All following elements in the specification list are optional; as soon as one does not match, Edebug stops matching at this level. -To make just a few elements optional followed by non-optional elements, +To make just a few elements optional, followed by non-optional elements, use @code{[&optional @var{specs}@dots{}]}. To specify that several elements must all match or none, use @code{&optional [@var{specs}@dots{}]}. See the @code{defun} example. @@ -1286,8 +1287,8 @@ just as for macros. See the @code{defun} example. Otherwise, the symbol should be a predicate. The predicate is called -with the argument and the specification fails if the predicate returns -@code{nil}, and the argument is not instrumented. +with the argument, and if the predicate returns @code{nil}, the +specification fails and the argument is not instrumented. Some suitable predicates include @code{symbolp}, @code{integerp}, @code{stringp}, @code{vectorp}, and @code{atom}. @@ -1482,8 +1483,8 @@ @defopt edebug-setup-hook Functions to call before Edebug is used. Each time it is set to a new value, Edebug will call those functions once and then -@code{edebug-setup-hook} is reset to @code{nil}. You could use this to -load up Edebug specifications associated with a package you are using +reset @code{edebug-setup-hook} to @code{nil}. You could use this to +load up Edebug specifications associated with a package you are using, but only when you also use Edebug. @xref{Instrumenting}. @end defopt