Now on revision 106051. Conflicting tags: mh-e-doc-8.3 mh-e-8.3 ------------------------------------------------------------ revno: 106051 committer: martin rudalics branch nick: trunk timestamp: Tue 2011-10-11 11:30:34 +0200 message: Add NEWS entry wrt which window gets selected after deletion diff: === modified file 'etc/NEWS' --- etc/NEWS 2011-10-09 12:26:29 +0000 +++ etc/NEWS 2011-10-11 09:30:34 +0000 @@ -1059,6 +1059,10 @@ longer delete any windows when they become too small. +++ +*** Deleting the selected window now selects the most recently selected +live window on that frame instead. + ++++ *** `adjust-window-trailing-edge' adjustments. `adjust-window-trailing-edge' can now deal with fixed-size windows and is able to resize other windows if a window adjacent to the trailing ------------------------------------------------------------ revno: 106050 committer: martin rudalics branch nick: trunk timestamp: Tue 2011-10-11 11:27:08 +0200 message: Mention which window gets selected when deleting the selected window. * windows.texi (Deleting Windows): Mention which window gets selected when deleting the selected window. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2011-10-09 12:26:29 +0000 +++ doc/lispref/ChangeLog 2011-10-11 09:27:08 +0000 @@ -1,3 +1,8 @@ +2011-10-11 Martin Rudalics + + * windows.texi (Deleting Windows): Mention which window gets + selected when deleting the selected window. + 2011-10-09 Martin Rudalics * buffers.texi (The Buffer List): Describe how bury-buffer deals === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2011-10-09 12:26:29 +0000 +++ doc/lispref/windows.texi 2011-10-11 09:27:08 +0000 @@ -1608,7 +1608,9 @@ The argument @var{window} can denote any window and defaults to the selected one. An error is signaled if @var{window} is the only window on its frame. Hence @var{window} must have at least one sibling window -(@pxref{Windows and Frames}) in order to get deleted. +(@pxref{Windows and Frames}) in order to get deleted. If @var{window} +is the selected window on its frame, this function selects the most +recently selected live window on that frame instead. If the variable @code{ignore-window-parameters} (@pxref{Window Parameters}) is non-@code{nil}, this function ignores all parameters of @@ -1629,7 +1631,8 @@ @deffn Command delete-other-windows &optional window This function makes @var{window} fill its frame and returns @code{nil}. The argument @var{window} can denote an arbitrary window and defaults to -the selected one. +the selected one. Upon exit, @var{window} will be the selected window +on its frame. If the variable @code{ignore-window-parameters} (@pxref{Window Parameters}) is non-@code{nil}, this function ignores all parameters of ------------------------------------------------------------ revno: 106049 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-10-11 00:28:27 -0700 message: ChangeLog fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-11 07:27:46 +0000 +++ lisp/ChangeLog 2011-10-11 07:28:27 +0000 @@ -5,7 +5,7 @@ 2011-10-11 Thierry Volpiatto - * lisp/eshell/eshell.el (eshell-command): History should be saved + * eshell/eshell.el (eshell-command): History should be saved only in interactive use, to avoid error. 2011-10-11 Stefan Monnier ------------------------------------------------------------ revno: 106048 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-10-11 00:27:46 -0700 message: Small fix for f90-next-statement. * lisp/progmodes/f90.el (f90-next-statement): Ignore preprocessor lines, like f90-previous-statement does. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-11 05:41:39 +0000 +++ lisp/ChangeLog 2011-10-11 07:27:46 +0000 @@ -1,8 +1,13 @@ +2011-10-11 Glenn Morris + + * progmodes/f90.el (f90-next-statement): Ignore preprocessor lines, + like f90-previous-statement does. + 2011-10-11 Thierry Volpiatto - * lisp/eshell/eshell.el (eshell-command): History have to be saved - only in interactive use to avoid error. - + * lisp/eshell/eshell.el (eshell-command): History should be saved + only in interactive use, to avoid error. + 2011-10-11 Stefan Monnier * minibuffer.el (completion-file-name-table): Fix last change, === modified file 'lisp/progmodes/f90.el' --- lisp/progmodes/f90.el 2011-10-08 21:52:08 +0000 +++ lisp/progmodes/f90.el 2011-10-11 07:27:46 +0000 @@ -1578,7 +1578,7 @@ (while (and (setq not-last-statement (and (zerop (forward-line 1)) (not (eobp)))) - (looking-at "[ \t0-9]*\\(!\\|$\\)"))) + (looking-at "[ \t0-9]*\\(!\\|$\\|#\\)"))) not-last-statement)) (defun f90-beginning-of-subprogram () ------------------------------------------------------------ revno: 106047 committer: Katsumi Yamaoka branch nick: trunk timestamp: Tue 2011-10-11 05:51:09 +0000 message: Bugfix: message.el (message-signed-or-encrypted-p): Exclude header when checking if there is signed or encrypted body in text/plain message. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-10-09 16:51:38 +0000 +++ lisp/gnus/ChangeLog 2011-10-11 05:51:09 +0000 @@ -1,3 +1,8 @@ +2011-10-11 Katsumi Yamaoka + + * message.el (message-signed-or-encrypted-p): Exclude header when + checking if there is signed or encrypted body in text/plain message. + 2011-10-09 Andreas Schwab * html2text.el (html2text-get-attr): Correctly handle attribute values === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2011-09-21 22:34:54 +0000 +++ lisp/gnus/message.el 2011-10-11 05:51:09 +0000 @@ -7429,14 +7429,16 @@ (with-temp-buffer (insert-buffer-substring cur) (when (setq handles (mm-dissect-buffer t t)) - (if (and (prog1 - (bufferp (car handles)) - (mm-destroy-parts handles)) + (if (and (bufferp (car handles)) (equal (mm-handle-media-type handles) "text/plain")) (progn + (erase-buffer) + (insert-buffer-substring (car handles)) (mm-decode-content-transfer-encoding (mm-handle-encoding handles)) + (mm-destroy-parts handles) (setq handles (mm-uu-dissect))) + (mm-destroy-parts handles) (setq handles nil)))))) (when handles (prog1 ------------------------------------------------------------ revno: 106046 committer: thierry volpiatto + + * lisp/eshell/eshell.el (eshell-command): History have to be saved + only in interactive use to avoid error. + 2011-10-11 Stefan Monnier * minibuffer.el (completion-file-name-table): Fix last change, === modified file 'lisp/eshell/eshell.el' --- lisp/eshell/eshell.el 2011-10-08 06:08:00 +0000 +++ lisp/eshell/eshell.el 2011-10-11 05:41:39 +0000 @@ -349,11 +349,9 @@ (minibuffer-with-setup-hook #'(lambda () (eshell-mode) (eshell-return-exits-minibuffer)) - (unwind-protect - (unless command - (setq command (read-from-minibuffer "Emacs shell command: "))) - (when command - (eshell-add-input-to-history command))))) + (unless command + (setq command (read-from-minibuffer "Emacs shell command: ")) + (eshell-add-input-to-history command)))) (unless command (error "No command specified!")) ;; redirection into the current buffer is achieved by adding an ------------------------------------------------------------ revno: 106045 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2011-10-11 01:17:04 -0400 message: * lisp/minibuffer.el (completion-file-name-table): Fix last change, i.e. ignore normal errors but not the other ones. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-10 18:47:15 +0000 +++ lisp/ChangeLog 2011-10-11 05:17:04 +0000 @@ -1,3 +1,8 @@ +2011-10-11 Stefan Monnier + + * minibuffer.el (completion-file-name-table): Fix last change, + i.e. ignore normal errors but not the other ones. + 2011-10-10 Martin Rudalics * window.el (special-display-buffer-names) === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2011-10-03 15:03:00 +0000 +++ lisp/minibuffer.el 2011-10-11 05:17:04 +0000 @@ -1789,59 +1789,60 @@ (defun completion-file-name-table (string pred action) "Completion table for file names." - (with-demoted-errors - (cond - ((eq action 'metadata) '(metadata (category . file))) - ((eq (car-safe action) 'boundaries) - (let ((start (length (file-name-directory string))) - (end (string-match-p "/" (cdr action)))) - (list* 'boundaries - ;; if `string' is "C:" in w32, (file-name-directory string) - ;; returns "C:/", so `start' is 3 rather than 2. - ;; Not quite sure what is The Right Fix, but clipping it - ;; back to 2 will work for this particular case. We'll - ;; see if we can come up with a better fix when we bump - ;; into more such problematic cases. - (min start (length string)) end))) - - ((eq action 'lambda) - (if (zerop (length string)) - nil ;Not sure why it's here, but it probably doesn't harm. - (funcall (or pred 'file-exists-p) string))) - - (t - (let* ((name (file-name-nondirectory string)) - (specdir (file-name-directory string)) - (realdir (or specdir default-directory))) - - (cond - ((null action) - (let ((comp (file-name-completion name realdir pred))) - (if (stringp comp) - (concat specdir comp) - comp))) - - ((eq action t) - (let ((all (file-name-all-completions name realdir))) - - ;; Check the predicate, if necessary. - (unless (memq pred '(nil file-exists-p)) - (let ((comp ()) - (pred - (if (eq pred 'file-directory-p) - ;; Brute-force speed up for directory checking: - ;; Discard strings which don't end in a slash. - (lambda (s) - (let ((len (length s))) - (and (> len 0) (eq (aref s (1- len)) ?/)))) - ;; Must do it the hard (and slow) way. - pred))) - (let ((default-directory (expand-file-name realdir))) - (dolist (tem all) - (if (funcall pred tem) (push tem comp)))) - (setq all (nreverse comp)))) - - all)))))))) + (condition-case nil + (cond + ((eq action 'metadata) '(metadata (category . file))) + ((eq (car-safe action) 'boundaries) + (let ((start (length (file-name-directory string))) + (end (string-match-p "/" (cdr action)))) + (list* 'boundaries + ;; if `string' is "C:" in w32, (file-name-directory string) + ;; returns "C:/", so `start' is 3 rather than 2. + ;; Not quite sure what is The Right Fix, but clipping it + ;; back to 2 will work for this particular case. We'll + ;; see if we can come up with a better fix when we bump + ;; into more such problematic cases. + (min start (length string)) end))) + + ((eq action 'lambda) + (if (zerop (length string)) + nil ;Not sure why it's here, but it probably doesn't harm. + (funcall (or pred 'file-exists-p) string))) + + (t + (let* ((name (file-name-nondirectory string)) + (specdir (file-name-directory string)) + (realdir (or specdir default-directory))) + + (cond + ((null action) + (let ((comp (file-name-completion name realdir pred))) + (if (stringp comp) + (concat specdir comp) + comp))) + + ((eq action t) + (let ((all (file-name-all-completions name realdir))) + + ;; Check the predicate, if necessary. + (unless (memq pred '(nil file-exists-p)) + (let ((comp ()) + (pred + (if (eq pred 'file-directory-p) + ;; Brute-force speed up for directory checking: + ;; Discard strings which don't end in a slash. + (lambda (s) + (let ((len (length s))) + (and (> len 0) (eq (aref s (1- len)) ?/)))) + ;; Must do it the hard (and slow) way. + pred))) + (let ((default-directory (expand-file-name realdir))) + (dolist (tem all) + (if (funcall pred tem) (push tem comp)))) + (setq all (nreverse comp)))) + + all)))))) + (file-error nil))) ;PCM often calls with invalid directories. (defvar read-file-name-predicate nil "Current predicate used by `read-file-name-internal'.") ------------------------------------------------------------ revno: 106044 committer: martin rudalics branch nick: trunk timestamp: Mon 2011-10-10 20:47:15 +0200 message: Fix ChangeLog typo diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-10 17:52:03 +0000 +++ lisp/ChangeLog 2011-10-10 18:47:15 +0000 @@ -8,7 +8,7 @@ * vc/vc.el (vc-revert, vc-rollback): * vc/vc-dispatcher.el (vc-finish-logentry): Call quit-windows-on instead of deleting windows. (Bug#4557) (Bug#5310) (Bug#5556) - (Bug#6183) (Bug#7074)((Bug#7447) + (Bug#6183) (Bug#7074) (Bug#7447) 2011-10-09 Martin Rudalics ------------------------------------------------------------ revno: 106043 committer: martin rudalics branch nick: trunk timestamp: Mon 2011-10-10 19:52:03 +0200 message: In vc actions use quit-windows-on instead of delete-windows-on. * window.el (quit-windows-on): New function. * vc/vc.el (vc-revert, vc-rollback): * vc/vc-dispatcher.el (vc-finish-logentry): Call quit-windows-on instead of deleting windows. (Bug#4557) (Bug#5310) (Bug#5556) (Bug#6183) (Bug#7074)((Bug#7447) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-10 06:31:07 +0000 +++ lisp/ChangeLog 2011-10-10 17:52:03 +0000 @@ -3,6 +3,12 @@ * window.el (special-display-buffer-names) (special-display-regexps): Remove some remnants of earlier changes from doc-strings. + (quit-windows-on): New function. + + * vc/vc.el (vc-revert, vc-rollback): + * vc/vc-dispatcher.el (vc-finish-logentry): Call quit-windows-on + instead of deleting windows. (Bug#4557) (Bug#5310) (Bug#5556) + (Bug#6183) (Bug#7074)((Bug#7447) 2011-10-09 Martin Rudalics === modified file 'lisp/vc/vc-dispatcher.el' --- lisp/vc/vc-dispatcher.el 2011-02-19 21:23:51 +0000 +++ lisp/vc/vc-dispatcher.el 2011-10-10 17:52:03 +0000 @@ -666,18 +666,15 @@ (funcall log-operation log-fileset log-entry)) - ;; Remove checkin window (after the checkin so that if that fails - ;; we don't zap the log buffer and the typing therein). - ;; -- IMO this should be replaced with quit-window - (cond ((and logbuf vc-delete-logbuf-window) - (delete-windows-on logbuf (selected-frame)) - ;; Kill buffer and delete any other dedicated windows/frames. - (kill-buffer logbuf)) - (logbuf - (with-selected-window (or (get-buffer-window logbuf 0) - (selected-window)) - (with-current-buffer logbuf - (bury-buffer))))) + + ;; Quit windows on logbuf. + (cond + ((not logbuf)) + (vc-delete-logbuf-window + (quit-windows-on logbuf t (selected-frame))) + (t + (quit-windows-on logbuf nil 0))) + ;; Now make sure we see the expanded headers (when log-fileset (mapc === modified file 'lisp/vc/vc.el' --- lisp/vc/vc.el 2011-07-13 07:58:34 +0000 +++ lisp/vc/vc.el 2011-10-10 17:52:03 +0000 @@ -2302,8 +2302,7 @@ (if (= nfiles 1) "" "s")))))) (error "Revert canceled"))) (when diff-buffer - (delete-windows-on diff-buffer) - (kill-buffer diff-buffer))) + (quit-windows-on diff-buffer t))) (dolist (file files) (message "Reverting %s..." (vc-delistify files)) (vc-revert-file file) @@ -2349,8 +2348,7 @@ ;; Display changes (unless (yes-or-no-p "Discard these revisions? ") (error "Rollback canceled")) - (delete-windows-on "*vc-diff*") - (kill-buffer"*vc-diff*") + (quit-windows-on "*vc-diff*" t) ;; Do the actual reversions (message "Rolling back %s..." (vc-delistify files)) (with-vc-properties === modified file 'lisp/window.el' --- lisp/window.el 2011-10-10 06:31:07 +0000 +++ lisp/window.el 2011-10-10 17:52:03 +0000 @@ -2984,6 +2984,27 @@ (if kill (kill-buffer buffer) (bury-buffer-internal buffer)))) + +(defun quit-windows-on (&optional buffer-or-name kill frame) + "Quit all windows showing BUFFER-OR-NAME. +BUFFER-OR-NAME may be a buffer or the name of an existing buffer +and defaults to the current buffer. Optional argument KILL +non-nil means to kill BUFFER-OR-NAME. KILL nil means to bury +BUFFER-OR-NAME. Optional argument FRAME is handled as by +`delete-windows-on'. + +This function calls `quit-window' on all candidate windows +showing BUFFER-OR-NAME." + (interactive "BQuit windows on (buffer):\nP") + (let ((buffer (window-normalize-buffer buffer-or-name)) + ;; Handle the "inverted" meaning of the FRAME argument wrt other + ;; `window-list-1' based function. + (all-frames (cond ((not frame) t) ((eq frame t) nil) (t frame)))) + (dolist (window (window-list-1 nil nil all-frames)) + (if (eq (window-buffer window) buffer) + (quit-window kill window) + ;; If a window doesn't show BUFFER, unrecord BUFFER in it. + (unrecord-window-buffer window buffer))))) ;;; Splitting windows. (defsubst window-split-min-size (&optional horizontal) ------------------------------------------------------------ revno: 106042 committer: martin rudalics branch nick: trunk timestamp: Mon 2011-10-10 08:31:07 +0200 message: Fix doc-strings of special-display-... variables. * window.el (special-display-buffer-names) (special-display-regexps): Remove some remnants of earlier changes from doc-strings. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-10-09 12:33:56 +0000 +++ lisp/ChangeLog 2011-10-10 06:31:07 +0000 @@ -1,3 +1,9 @@ +2011-10-10 Martin Rudalics + + * window.el (special-display-buffer-names) + (special-display-regexps): Remove some remnants of earlier + changes from doc-strings. + 2011-10-09 Martin Rudalics * window.el (frame-auto-hide-function): Add version tag. === modified file 'lisp/window.el' --- lisp/window.el 2011-10-09 12:33:56 +0000 +++ lisp/window.el 2011-10-10 06:31:07 +0000 @@ -3959,12 +3959,10 @@ \(BUFFER-NAME FUNCTION OTHER-ARGS). In that case, `special-display-popup-frame' will call FUNCTION with the buffer named BUFFER-NAME as first argument, and OTHER-ARGS as the -second. If `special-display-function' specifies some other -function, that function is called with the buffer named -BUFFER-NAME as first, and the element's cdr as second argument. -In any case, that function is responsible for setting the value -The function specified here is responsible for setting the -quit-restore and help-setup parameters of the window used. +second. + +Any alternative function specified here is responsible for +setting up the quit-restore parameter of the window used. If this variable appears \"not to work\", because you added a name to it but the corresponding buffer is displayed in the @@ -4029,10 +4027,10 @@ Finally, an element of this list can be also specified as \(REGEXP FUNCTION OTHER-ARGS). `special-display-popup-frame' will then call FUNCTION with the buffer whose name matched -REGEXP as first, and OTHER-ARGS as second argument. If -`special-display-function' specifies some other function, that -function is called with the buffer whose name matched REGEXP -as first, and the element's cdr as second argument. +REGEXP as first, and OTHER-ARGS as second argument. + +Any alternative function specified here is responsible for +setting up the quit-restore parameter of the window used. If this variable appears \"not to work\", because you added a name to it but the corresponding buffer is displayed in the