Now on revision 105918. Conflicting tags: mh-e-doc-8.3 mh-e-8.3 ------------------------------------------------------------ revno: 105918 committer: Ted Zlatanov branch nick: quickfixes timestamp: Sun 2011-09-25 07:52:53 -0400 message: * lisp/progmodes/cfengine.el (cfengine-auto-mode): Add convenience function. * lisp/progmodes/cfengine.el (cfengine-auto-mode): Add convenience function that picks between cfengine 2 and 3 support automatically. Update docs accordingly. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-24 20:58:23 +0000 +++ lisp/ChangeLog 2011-09-25 11:52:53 +0000 @@ -1,3 +1,9 @@ +2011-09-25 Teodor Zlatanov + + * progmodes/cfengine.el (cfengine-auto-mode): Add convenience + function that picks between cfengine 2 and 3 support + automatically. Update docs accordingly. + 2011-09-22 Ken Manheimer * allout.el (allout-this-command-hid-stuff): Buffer-local variable === modified file 'lisp/progmodes/cfengine.el' --- lisp/progmodes/cfengine.el 2011-07-01 10:12:47 +0000 +++ lisp/progmodes/cfengine.el 2011-09-25 11:52:53 +0000 @@ -26,16 +26,21 @@ ;; Provides support for editing GNU Cfengine files, including ;; font-locking, Imenu and indention, but with no special keybindings. -;; Possible customization for auto-mode selection: -;; (push '(("^cfagent.conf\\'" . cfengine-mode)) auto-mode-alist) -;; (push '(("^cf\\." . cfengine-mode)) auto-mode-alist) -;; (push '(("\\.cf\\'" . cfengine-mode)) auto-mode-alist) - -;; Or, if you want to use the CFEngine 3.x support: - -;; (push '(("^cfagent.conf\\'" . cfengine3-mode)) auto-mode-alist) -;; (push '(("^cf\\." . cfengine3-mode)) auto-mode-alist) -;; (push '(("\\.cf\\'" . cfengine3-mode)) auto-mode-alist) +;; The CFEngine 3.x support doesn't have Imenu support but patches are +;; welcome. + +;; You can set it up so either cfengine-mode (2.x and earlier) or +;; cfengine3-mode (3.x) will be picked, depending on the buffer +;; contents: + +;; (add-to-list 'auto-mode-alist '("\\.cf\\'" . cfengine-auto-mode)) + +;; OR you can choose to always use a specific version, if you prefer +;; it + +;; (add-to-list 'auto-mode-alist '("\\.cf\\'" . cfengine3-mode)) +;; (add-to-list 'auto-mode-alist '("^cf\\." . cfengine-mode)) +;; (add-to-list 'auto-mode-alist '("^cfagent.conf\\'" . cfengine-mode)) ;; This is not the same as the mode written by Rolf Ebert ;; , distributed with cfengine-2.0.5. It does @@ -466,6 +471,18 @@ #'cfengine-beginning-of-defun) (set (make-local-variable 'end-of-defun-function) #'cfengine-end-of-defun)) +;;;###autoload +(defun cfengine-auto-mode () + "Choose between `cfengine-mode' and `cfengine3-mode' depending +on the buffer contents" + (let ((v3 nil)) + (save-restriction + (goto-char (point-min)) + (while (not (or (eobp) v3)) + (setq v3 (looking-at (concat cfengine3-defuns-regex "\\>"))) + (forward-line))) + (if v3 (cfengine3-mode) (cfengine-mode)))) + (provide 'cfengine3) (provide 'cfengine) ------------------------------------------------------------ revno: 105917 committer: Glenn Morris branch nick: trunk timestamp: Sun 2011-09-25 06:19:40 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2011-09-15 10:18:44 +0000 +++ autogen/configure 2011-09-25 10:19:40 +0000 @@ -8057,14 +8057,9 @@ LIB_STANDARD=-lc START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o' ;; - netbsd | openbsd ) - if test -f $CRT_DIR/crti.o; then - LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o' - START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o' - else - LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o' - START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o' - fi + netbsd | openbsd ) + LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o' + START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o' ;; esac @@ -8163,6 +8158,19 @@ +case $opsys in + netbsd | openbsd ) + if test -f $CRT_DIR/crti.o; then + + test -f $CRT_DIR/crtn.o || \ + as_fn_error "Required file not found: crtn.o" "$LINENO" 5 + + LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o' + START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o' + fi + ;; +esac + ------------------------------------------------------------ revno: 105916 committer: martin rudalics branch nick: trunk timestamp: Sun 2011-09-25 12:11:25 +0200 message: Some minor changes in windows section. * windows.texi (Windows and Frames, Display Action Functions) (Switching Buffers): Fix some typos. (Buffers and Windows): Remove reference to window-auto-delete. Reword description of replace-buffer-in-windows. (Window History): Fix some typos and refer to frame local buffer list. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2011-09-25 03:32:51 +0000 +++ doc/lispref/ChangeLog 2011-09-25 10:11:25 +0000 @@ -1,3 +1,12 @@ +2011-09-25 Martin Rudalics + + * windows.texi (Windows and Frames, Display Action Functions) + (Switching Buffers): Fix some typos. + (Buffers and Windows): Remove reference to window-auto-delete. + Reword description of replace-buffer-in-windows. + (Window History): Fix some typos and refer to frame local buffer + list. + 2011-09-25 Chong Yidong * windows.texi (Display Action Functions) === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2011-09-25 03:32:51 +0000 +++ doc/lispref/windows.texi 2011-09-25 10:11:25 +0000 @@ -294,7 +294,7 @@ to the selected one. The return value is @code{nil} if @var{window} is a live window or its children form a vertical combination. In the example above @code{(window-left-child W4)} is @code{W6} while -@code{(window-top-child W3)} is @code{nil}. +@code{(window-left-child W3)} is @code{nil}. @end defun @defun window-child window @@ -2078,15 +2078,15 @@ buffer; it defaults to the current buffer. If a window displaying @var{buffer-or-name} is dedicated -(@pxref{Dedicated Windows}) has never displayed any other buffers and +(@pxref{Dedicated Windows}), has never displayed any other buffers and is not the only window on its frame, that window is deleted. If that -window is the only window on its frame and there are other frames on -the frame's terminal, that frame is deleted too; otherwise, some other -buffer is displayed in that window, as explained above. A user can -prevent the deletion of windows and/or frames by customizing the -option @code{window-auto-delete}. +window is the only window on its frame and there are other frames on the +frame's terminal, that frame is deleted too; otherwise, the buffer +provided by the function @code{switch-to-prev-buffer} (@pxref{Window +History}) is displayed instead. @end deffn + @node Switching Buffers @section Switching to a Buffer in a Window @cindex switching to a buffer @@ -2123,12 +2123,12 @@ list (@pxref{The Buffer List}). However, this is not done if the optional argument @var{norecord} is non-@code{nil}. -If this function is unable to display in the seleted window---usually -because the selected window is a minibuffer window or is strongly -dedicated to its buffer (@pxref{Dedicated Windows})---then it normally -tries to display in some other window, in the manner of -@code{pop-to-buffer} (see below). However, if the optional argument -@var{force-same-window} is non-@code{nil}, it signals an error +If this function is unable to display the buffer in the selected +window---usually because the selected window is a minibuffer window or +is strongly dedicated to its buffer (@pxref{Dedicated Windows})---then +it normally tries to display the buffer in some other window, in the +manner of @code{pop-to-buffer} (see below). However, if the optional +argument @var{force-same-window} is non-@code{nil}, it signals an error instead. @end deffn @@ -2356,7 +2356,7 @@ @defun display-buffer-use-some-window buffer alist This function tries to display @var{buffer} by choosing an existing -buffer and displaying the buffer in that window. It can fail if all +window and displaying the buffer in that window. It can fail if all windows are dedicated to another buffer (@pxref{Dedicated Windows}). @end defun @@ -2629,16 +2629,16 @@ resort, it will try to display @var{buffer-or-name} on a separate frame. In that case, the value of @code{pop-up-frames} is disregarded. + @node Window History @section Window History @cindex window history - Each window remembers the buffers it has displayed earlier and the -order in which these buffers have been removed from it. This history -is used, for example, by @code{replace-buffer-in-windows} -(@pxref{Buffers and Windows}). This list is set automatically -maintained by Emacs, but you can use the following functions to -explicitly inspect or alter it: +Each window remembers the buffers it has displayed earlier and the order +in which these buffers have been removed from it. This history is used, +for example, by @code{replace-buffer-in-windows} (@pxref{Buffers and +Windows}). This list is automatically maintained by Emacs, but you can +use the following functions to explicitly inspect or alter it: @defun window-prev-buffers &optional window This function returns a list specifying the previous contents of @@ -2652,7 +2652,7 @@ that buffer was last shown. The list is ordered so that earlier elements correspond to more -recently-shown buffers, and the first element corresponds to the +recently-shown buffers, and the first element usually corresponds to the buffer most recently removed from the window. @end defun @@ -2671,8 +2671,9 @@ @defun window-next-buffers &optional window This function returns the list of buffers recently re-shown in -@var{window} via @code{switch-to-prev-buffer}. @var{window} should be -a live window or @code{nil} (meaning the selected window). +@var{window} via @code{switch-to-prev-buffer}. The @var{window} +argument must denote a live window or @code{nil} (meaning the selected +window). @end defun @defun set-window-next-buffers window next-buffers @@ -2707,8 +2708,8 @@ If repeated invocations of this command have already shown all buffers previously shown in @var{window}, further invocations will show buffers -from the global buffer list starting with the buffer returned by -@code{last-buffer} (@pxref{The Buffer List}). +from the buffer list of the frame @var{window} appears on (@pxref{The +Buffer List}). @end deffn @deffn Command switch-to-next-buffer &optional window @@ -2717,12 +2718,12 @@ @var{window}. The argument @var{window} must be a live window and defaults to the selected one. -If there is no recent invocation of a @code{switch-to-prev-buffer} -that can be undone, this function tries to show the first buffer from -the global buffer list as returned by @code{other-buffer} (@pxref{The -Buffer List}). +If there is no recent invocation of a @code{switch-to-prev-buffer} that +can be undone, this function tries to show a buffer from the buffer list +of the frame @var{window} appears on (@pxref{The Buffer List}). @end deffn + @node Dedicated Windows @section Dedicated Windows @cindex dedicated window ------------------------------------------------------------ revno: 105915 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-09-24 23:32:51 -0400 message: Document display-buffer-alist and related variables in Lisp manual. * doc/lispref/windows.texi (Display Action Functions) (Choosing Window Options): New nodes. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2011-09-24 22:49:32 +0000 +++ doc/lispref/ChangeLog 2011-09-25 03:32:51 +0000 @@ -1,3 +1,8 @@ +2011-09-25 Chong Yidong + + * windows.texi (Display Action Functions) + (Choosing Window Options): New nodes. + 2011-09-24 Chong Yidong * windows.texi (Window History): New node. Move text here from === modified file 'doc/lispref/elisp.texi' --- doc/lispref/elisp.texi 2011-09-24 22:49:32 +0000 +++ doc/lispref/elisp.texi 2011-09-25 03:32:51 +0000 @@ -937,6 +937,8 @@ * Buffers and Windows:: Each window displays the contents of a buffer. * Switching Buffers:: Higher-level functions for switching to a buffer. * Choosing Window:: How to choose a window for displaying a buffer. +* Display Action Functions:: Subroutines for @code{display-buffer}. +* Choosing Window Options:: Extra options affecting how buffers are displayed. * Window History:: Each window remembers the buffers displayed in it. * Dedicated Windows:: How to avoid displaying another buffer in a specific window. === modified file 'doc/lispref/vol1.texi' --- doc/lispref/vol1.texi 2011-09-24 22:49:32 +0000 +++ doc/lispref/vol1.texi 2011-09-25 03:32:51 +0000 @@ -955,6 +955,8 @@ * Buffers and Windows:: Each window displays the contents of a buffer. * Switching Buffers:: Higher-level functions for switching to a buffer. * Choosing Window:: How to choose a window for displaying a buffer. +* Display Action Functions:: Subroutines for @code{display-buffer}. +* Choosing Window Options:: Extra options affecting how buffers are displayed. * Window History:: Each window remembers the buffers displayed in it. * Dedicated Windows:: How to avoid displaying another buffer in a specific window. === modified file 'doc/lispref/vol2.texi' --- doc/lispref/vol2.texi 2011-09-24 22:49:32 +0000 +++ doc/lispref/vol2.texi 2011-09-25 03:32:51 +0000 @@ -954,6 +954,8 @@ * Buffers and Windows:: Each window displays the contents of a buffer. * Switching Buffers:: Higher-level functions for switching to a buffer. * Choosing Window:: How to choose a window for displaying a buffer. +* Display Action Functions:: Subroutines for @code{display-buffer}. +* Choosing Window Options:: Extra options affecting how buffers are displayed. * Window History:: Each window remembers the buffers displayed in it. * Dedicated Windows:: How to avoid displaying another buffer in a specific window. === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2011-09-24 22:49:32 +0000 +++ doc/lispref/windows.texi 2011-09-25 03:32:51 +0000 @@ -24,6 +24,8 @@ * Buffers and Windows:: Each window displays the contents of a buffer. * Switching Buffers:: Higher-level functions for switching to a buffer. * Choosing Window:: How to choose a window for displaying a buffer. +* Display Action Functions:: Subroutines for @code{display-buffer}. +* Choosing Window Options:: Extra options affecting how buffers are displayed. * Window History:: Each window remembers the buffers displayed in it. * Dedicated Windows:: How to avoid displaying another buffer in a specific window. @@ -2094,11 +2096,12 @@ specified buffer in some window. Do @emph{not} use these functions to make a buffer temporarily -current so that a Lisp program can access or modify it; they have -side-effects that may surprise the user, such as changing window -histories (@pxref{Window History}). Instead, use +current just so a Lisp program can access or modify it. They have +side-effects, such as changing window histories (@pxref{Window +History}), which will surprise the user if used that way. If you want +to make a buffer current to modify it in Lisp, use @code{with-current-buffer}, @code{save-current-buffer}, or -@code{set-buffer} (@pxref{Current Buffer}). +@code{set-buffer}. @xref{Current Buffer}. @deffn Command switch-to-buffer buffer-or-name &optional norecord force-same-window This function displays @var{buffer-or-name} in the selected window, @@ -2203,24 +2206,25 @@ Buffers}). @cindex display action +@cindex action function, for display-buffer +@cindex action alist, for display-buffer This command performs several complex steps to find a window to display in. These steps are described by means of @dfn{display actions}, which have the form @code{(@var{function} . @var{alist})}. Here, @var{function} is either a function or a list of functions, -while @var{alist} is an association list. In this section, we will -refer to such functions as @dfn{action functions}, and such alists as -@dfn{action alists}. +which we refer to as @dfn{action functions}; @var{alist} is an +association list, which we refer to as @dfn{action alists}. - An action function should accept two arguments: the buffer to -display and an action alist. It should attempt to display the buffer -in some window, picking or creating a window based on some internal -criteria (as well as, optionally, the action alist). If successful, -it should return the window; otherwise, it should return @code{nil}. + An action function accepts two arguments: the buffer to display and +an action alist. It attempts to display the buffer in some window, +picking or creating a window according to its own criteria. If +successful, it returns the window; otherwise, it returns @code{nil}. +@xref{Display Action Functions}, for a list of predefined action +functions. @code{display-buffer} works by combining display actions from -several sources (including some user-customizable options), and -calling the action functions in turn, until one of the action -functions manages to display the buffer and returns a non-@code{nil} +several sources, and calling the action functions in turn, until one +of them manages to display the buffer and returns a non-@code{nil} value. @deffn Command display-buffer buffer-or-name &optional action frame @@ -2248,9 +2252,7 @@ The user option @code{display-buffer-base-action}. @item -The variable @code{display-buffer-fallback-action}. This is -non-@code{nil} by default, and specifies the fallback behavior if no -other display actions are given. +The constant @code{display-buffer-fallback-action}. @end itemize @noindent @@ -2266,9 +2268,59 @@ The optional argument @var{frame}, if non-@code{nil}, specifies which frames to check when deciding whether the buffer is already displayed. -If the buffer is already displayed in some window on one of these -frames, @code{display-buffer} simply returns that window. Here are -the possible values of @var{frame}: +It is equivalent to adding an element @code{(reusable-frames +. @var{frame})} to the action alist of @var{action}. @xref{Display +Action Functions}. +@end deffn + +@defvar display-buffer-overriding-action +The value of this variable should be a display action, which is +treated with the highest priority by @code{display-buffer}. The +default value is empty, i.e. @code{(nil . nil)}. +@end defvar + +@defopt display-buffer-alist +The value of this option is an alist mapping regular expressions to +display actions. If the name of the buffer passed to +@code{display-buffer} matches a regular expression in this alist, then +@code{display-buffer} uses the corresponding display action. +@end defopt + +@defopt display-buffer-base-action +The value of this option should be a display action. This option can +be used to define a ``standard'' display action for calls to +@code{display-buffer}. +@end defopt + +@defvr Constant display-buffer-fallback-action +This display action specifies the fallback behavior for +@code{display-buffer} if no other display actions are given. +@end defvr + +@node Display Action Functions +@section Action Functions for @code{display-buffer} + +The following basic action functions are defined in Emacs. Each of +these functions takes two arguments: @var{buffer}, the buffer to +display, and @var{alist}, an action alist. Each action function +returns the window if it succeeds, and @code{nil} if it fails. + +@defun display-buffer-same-window buffer alist +This function tries to display @var{buffer} in the selected window. +It fails if the selected window is a minibuffer window or is dedicated +to another buffer (@pxref{Dedicated Windows}). It also fails if +@var{alist} has a non-nil @code{inhibit-same-window} entry. +@end defun + +@defun display-buffer-reuse-window buffer alist +This function tries to ``display'' @var{buffer} by finding a window +that is already displaying it. + +If @var{alist} has a non-@code{nil} @code{inhibit-same-window} entry, +the selected window is not eligible for reuse. + +If @var{alist} contains a @code{reusable-frames} entry, its value +determines which frames to search for a reusable window: @itemize @bullet @item @@ -2284,9 +2336,36 @@ A frame means consider windows on that frame only. @end itemize -Precisely how @code{display-buffer} finds or creates a window depends on -the variables described below. -@end deffn +If @var{alist} contains no @code{reusable-frames} entry, this function +normally searches just the selected frame; however, if either the +variable @code{display-buffer-reuse-frames} or the variable +@code{pop-up-frames} is non-@code{nil}, it searches all frames on the +current terminal. @xref{Choosing Window Options}. +@end defun + +@defun display-buffer-pop-up-frame buffer alist +This function creates a new frame, and displays the buffer in that +frame's window. +@end defun + +@defun display-buffer-pop-up-window buffer alist +This function tries to display @var{buffer} by splitting the selected +window. It uses @code{split-window-sensibly} as a subroutine +(@pxref{Choosing Window Options}). +@end defun + +@defun display-buffer-use-some-window buffer alist +This function tries to display @var{buffer} by choosing an existing +buffer and displaying the buffer in that window. It can fail if all +windows are dedicated to another buffer (@pxref{Dedicated Windows}). +@end defun + +@node Choosing Window Options +@section Additional Options for Displaying Buffers + +The behavior of the standard display actions of @code{display-buffer} +(@pxref{Choosing Window}) can be modified by a variety of user +options. @defopt display-buffer-reuse-frames If this variable is non-@code{nil}, @code{display-buffer} searches ------------------------------------------------------------ revno: 105914 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-09-24 19:30:31 -0700 message: * src/buffer.c (truncate-lines): Doc fix. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-09-24 22:51:36 +0000 +++ src/ChangeLog 2011-09-25 02:30:31 +0000 @@ -1,3 +1,7 @@ +2011-09-25 Glenn Morris + + * buffer.c (truncate-lines): Doc fix. + 2011-09-24 Chong Yidong * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers) === modified file 'src/buffer.c' --- src/buffer.c 2011-08-25 19:06:56 +0000 +++ src/buffer.c 2011-09-25 02:30:31 +0000 @@ -5493,7 +5493,9 @@ Note that this is overridden by the variable `truncate-partial-width-windows' if that variable is non-nil -and this buffer is not full-frame width. */); +and this buffer is not full-frame width. + +Minibuffers set this variable to nil. */); DEFVAR_PER_BUFFER ("word-wrap", &BVAR (current_buffer, word_wrap), Qnil, doc: /* *Non-nil means to use word-wrapping for continuation lines. ------------------------------------------------------------ revno: 105913 author: Lars Magne Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Sat 2011-09-24 23:09:56 +0000 message: Support a new variable `shr-ignore-cache' to re-fetch images when hitting `g' in Gnus. gnus-sum.el (gnus-summary-show-article): Bind `shr-ignore-cache' to re-fetch images. shr.el (shr-tag-img): Support a new variable `shr-ignore-cache' to re-fetch images when hitting `g' in Gnus. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-09-22 04:43:36 +0000 +++ lisp/gnus/ChangeLog 2011-09-24 23:09:56 +0000 @@ -1,3 +1,11 @@ +2011-09-24 Lars Magne Ingebrigtsen + + * gnus-sum.el (gnus-summary-show-article): Bind `shr-ignore-cache' to + re-fetch images. + + * shr.el (shr-tag-img): Support a new variable `shr-ignore-cache' to + re-fetch images when hitting `g' in Gnus. + 2011-09-22 Katsumi Yamaoka * mml.el (mml-inhibit-compute-boundary): New internal variable. === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2011-09-15 05:46:40 +0000 +++ lisp/gnus/gnus-sum.el 2011-09-24 23:09:56 +0000 @@ -9611,8 +9611,10 @@ (when (gnus-summary-goto-subject (cdr gnus-article-current) nil t) (gnus-summary-update-secondary-mark (cdr gnus-article-current)))))) ((not arg) - ;; Select the article the normal way. - (gnus-summary-select-article nil 'force)) + (require 'shr) + (let ((shr-ignore-cache t)) + ;; Select the article the normal way. + (gnus-summary-select-article nil 'force))) ((equal arg '(16)) ;; C-u C-u g (let ((gnus-inhibit-article-treatments t)) === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2011-07-20 22:48:00 +0000 +++ lisp/gnus/shr.el 2011-09-24 23:09:56 +0000 @@ -112,6 +112,7 @@ (defvar shr-table-depth 0) (defvar shr-stylesheet nil) (defvar shr-base nil) +(defvar shr-ignore-cache nil) (defvar shr-map (let ((map (make-sparse-keymap))) @@ -896,10 +897,16 @@ (if (> (string-width alt) 8) (shr-insert (truncate-string-to-width alt 8)) (shr-insert alt)))) - ((url-is-cached (shr-encode-url url)) + ((and (not shr-ignore-cache) + (url-is-cached (shr-encode-url url))) (funcall shr-put-image-function (shr-get-image-data url) alt)) (t (insert alt) + (when (and shr-ignore-cache + (url-is-cached (shr-encode-url url))) + (let ((file (url-cache-create-filename (shr-encode-url url)))) + (when (file-exists-p file) + (delete-file file)))) (funcall (if (fboundp 'url-queue-retrieve) 'url-queue-retrieve ------------------------------------------------------------ revno: 105912 author: Christopher J. White committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-09-24 18:58:40 -0400 message: * url-http.el (url-http-create-request): Avoid adding extra CRLF (Bug#8931). diff: === modified file 'lisp/url/ChangeLog' --- lisp/url/ChangeLog 2011-09-13 17:18:08 +0000 +++ lisp/url/ChangeLog 2011-09-24 22:58:40 +0000 @@ -1,3 +1,8 @@ +2011-09-24 Christopher J. White (tiny change) + + * url-http.el (url-http-create-request): Avoid adding extra CRLF + (Bug#8931). + 2011-09-13 Lars Magne Ingebrigtsen * url-http.el (url-http-find-free-connection): If there was an === modified file 'lisp/url/url-http.el' --- lisp/url/url-http.el 2011-09-13 17:18:08 +0000 +++ lisp/url/url-http.el 2011-09-24 22:58:40 +0000 @@ -342,7 +342,9 @@ ;; End request "\r\n" ;; Any data - url-http-data)) + url-http-data + ;; If `url-http-data' is nil, avoid two CRLFs (Bug#8931). + (if url-http-data "\r\n"))) "")) (url-http-debug "Request is: \n%s" request) request)) ------------------------------------------------------------ revno: 105911 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-09-24 18:51:36 -0400 message: Minor doc fixes for some window functions. Minor doc fixes for switch-to-buffer, window-prev-buffers, set-window-prev-buffers, set-window-next-buffers. diff: === modified file 'lisp/window.el' --- lisp/window.el 2011-09-23 01:42:40 +0000 +++ lisp/window.el 2011-09-24 22:51:36 +0000 @@ -4937,9 +4937,9 @@ one. If FORCE-SAME-WINDOW is non-nil, BUFFER-OR-NAME must be displayed -in the currently selected window; signal an error if that is -impossible (e.g. if the selected window is minibuffer-only). -If non-nil, BUFFER-OR-NAME may be displayed in another window. +in the selected window; signal an error if that is +impossible (e.g. if the selected window is minibuffer-only). If +non-nil, BUFFER-OR-NAME may be displayed in another window. Return the buffer switched to." (interactive === modified file 'src/ChangeLog' --- src/ChangeLog 2011-09-24 18:29:35 +0000 +++ src/ChangeLog 2011-09-24 22:51:36 +0000 @@ -1,3 +1,8 @@ +2011-09-24 Chong Yidong + + * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers) + (Fset_window_next_buffers): Doc fix. + 2011-09-24 Glenn Morris * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715) === modified file 'src/window.c' --- src/window.c 2011-09-09 01:06:52 +0000 +++ src/window.c 2011-09-24 22:51:36 +0000 @@ -1665,8 +1665,9 @@ doc: /* Return buffers previously shown in WINDOW. WINDOW must be a live window and defaults to the selected one. -The return value is either nil or a list of triples where buffer was previously shown in WINDOW. */) +The return value is a list of elements (BUFFER WINDOW-START POS), +where BUFFER is a buffer, WINDOW-START is the start position of the +window for that buffer, and POS is a window-specific point value. */) (Lisp_Object window) { return decode_window (window)->prev_buffers; @@ -1675,11 +1676,11 @@ DEFUN ("set-window-prev-buffers", Fset_window_prev_buffers, Sset_window_prev_buffers, 2, 2, 0, doc: /* Set WINDOW's previous buffers to PREV-BUFFERS. -WINDOW must be a live window and defaults to the selected one. Return -PREV-BUFFERS. +WINDOW must be a live window and defaults to the selected one. -PREV-BUFFERS should be either nil or a list of triples where buffer was previously shown in WINDOW. */) +PREV-BUFFERS should be a list of elements (BUFFER WINDOW-START POS), +where BUFFER is a buffer, WINDOW-START is the start position of the +window for that buffer, and POS is a window-specific point value. */) (Lisp_Object window, Lisp_Object prev_buffers) { return decode_window (window)->prev_buffers = prev_buffers; @@ -1697,11 +1698,8 @@ DEFUN ("set-window-next-buffers", Fset_window_next_buffers, Sset_window_next_buffers, 2, 2, 0, doc: /* Set WINDOW's next buffers to NEXT-BUFFERS. -WINDOW must be a live window and defaults to the selected one. Return -NEXT-BUFFERS. - -NEXT-BUFFERS should be either nil or a list of buffers that have been -recently re-shown in WINDOW. */) +WINDOW must be a live window and defaults to the selected one. +NEXT-BUFFERS should be a list of buffers. */) (Lisp_Object window, Lisp_Object next_buffers) { return decode_window (window)->next_buffers = next_buffers; ------------------------------------------------------------ revno: 105910 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-09-24 18:49:32 -0400 message: Document display-buffer and other window changes in Lisp manual. * doc/lispref/windows.texi (Window History): New node. Move text here from Buffers and Windows. (Switching Buffers): Rename from Displaying Buffers, since we don't document display-buffer here; callers changed. Document FORCE-SAME-WINDOW arg to switch-to-buffer and switch-to-buffer-other-frame. Delete duplicate replace-buffer-in-windows doc. (Choosing Window): Document display actions. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2011-09-24 14:38:16 +0000 +++ doc/lispref/ChangeLog 2011-09-24 22:49:32 +0000 @@ -1,3 +1,14 @@ +2011-09-24 Chong Yidong + + * windows.texi (Window History): New node. Move text here from + Buffers and Windows. + (Switching Buffers): Rename from Displaying Buffers, since we + don't document display-buffer here; callers changed. Document + FORCE-SAME-WINDOW arg to switch-to-buffer and + switch-to-buffer-other-frame. Delete duplicate + replace-buffer-in-windows doc. + (Choosing Window): Document display actions. + 2011-09-24 Eli Zaretskii * display.texi (Forcing Redisplay): Update the description of === modified file 'doc/lispref/buffers.texi' --- doc/lispref/buffers.texi 2011-04-08 18:53:26 +0000 +++ doc/lispref/buffers.texi 2011-09-24 22:49:32 +0000 @@ -124,7 +124,7 @@ buffer that the cursor is in, when Emacs reads a command, is the buffer to which that command applies (@pxref{Command Loop}). Thus, you should not use @code{set-buffer} to switch visibly to a different -buffer; for that, use the functions described in @ref{Displaying +buffer; for that, use the functions described in @ref{Switching Buffers}. When writing a Lisp function, do @emph{not} rely on this behavior of @@ -775,13 +775,14 @@ @code{other-buffer}, use this ordering. A buffer list displayed for the user also follows this order. - Creating a buffer adds it to the end of the buffer list, and killing a -buffer removes it from that list. A buffer moves to the front of this -list whenever it is chosen for display in a window (@pxref{Displaying -Buffers}) or a window displaying it is selected (@pxref{Selecting -Windows}). A buffer moves to the end of the list when it is buried (see -@code{bury-buffer}, below). There are no functions available to the -Lisp programmer which directly manipulate the buffer list. + Creating a buffer adds it to the end of the buffer list, and killing +a buffer removes it from that list. A buffer moves to the front of +this list whenever it is chosen for display in a window +(@pxref{Switching Buffers}) or a window displaying it is selected +(@pxref{Selecting Windows}). A buffer moves to the end of the list +when it is buried (see @code{bury-buffer}, below). There are no +functions available to the Lisp programmer which directly manipulate +the buffer list. In addition to the fundamental buffer list just described, Emacs maintains a local buffer list for each frame, in which the buffers that @@ -888,24 +889,24 @@ bury will come last in the value of @code{(buffer-list @var{frame})} and in the value of @code{(buffer-list)}. -If @var{buffer-or-name} is @code{nil} or omitted, this means to bury the -current buffer. In addition, if the buffer is displayed in the selected -window, this switches to some other buffer (obtained using -@code{other-buffer}) in the selected window. @xref{Displaying Buffers}. -But if the selected window is dedicated to its buffer, it deletes that -window if there are other windows left on its frame. Otherwise, if the -selected window is the only window on its frame, it iconifies that -frame. If @var{buffer-or-name} is displayed in some other window, it -remains displayed there. +If @var{buffer-or-name} is @code{nil} or omitted, this means to bury +the current buffer. In addition, if the buffer is displayed in the +selected window, this switches to some other buffer (obtained using +@code{other-buffer}) in the selected window. @xref{Switching +Buffers}. But if the selected window is dedicated to its buffer, it +deletes that window if there are other windows left on its frame. +Otherwise, if the selected window is the only window on its frame, it +iconifies that frame. If @var{buffer-or-name} is displayed in some +other window, it remains displayed there. To replace a buffer in all the windows that display it, use @code{replace-buffer-in-windows}. @xref{Buffers and Windows}. @end deffn @deffn Command unbury-buffer -This command switches to the last buffer in the local buffer list of the -selected frame. More precisely, it calls the function -@code{switch-to-buffer} (@pxref{Displaying Buffers}), to display the +This command switches to the last buffer in the local buffer list of +the selected frame. More precisely, it calls the function +@code{switch-to-buffer} (@pxref{Switching Buffers}), to display the buffer returned by @code{last-buffer}, see above, in the selected window. @end deffn === modified file 'doc/lispref/elisp.texi' --- doc/lispref/elisp.texi 2011-09-23 09:12:53 +0000 +++ doc/lispref/elisp.texi 2011-09-24 22:49:32 +0000 @@ -21,7 +21,7 @@ @end ifset @c per rms and peterb, use 10pt fonts for the main text, mostly to -@c save on paper cost. +@c save on paper cost. @c Do this inside @tex for now, so current makeinfo does not complain. @tex @ifset smallbook @@ -935,9 +935,9 @@ * Selecting Windows:: The selected window is the one that you edit in. * Cyclic Window Ordering:: Moving around the existing windows. * Buffers and Windows:: Each window displays the contents of a buffer. -* Displaying Buffers:: Higher-level functions for displaying a buffer - and choosing a window for it. +* Switching Buffers:: Higher-level functions for switching to a buffer. * Choosing Window:: How to choose a window for displaying a buffer. +* Window History:: Each window remembers the buffers displayed in it. * Dedicated Windows:: How to avoid displaying another buffer in a specific window. * Window Point:: Each window has its own location of point. === modified file 'doc/lispref/files.texi' --- doc/lispref/files.texi 2011-08-28 21:15:20 +0000 +++ doc/lispref/files.texi 2011-09-24 22:49:32 +0000 @@ -103,7 +103,7 @@ @end smallexample @noindent -(See @code{switch-to-buffer} in @ref{Displaying Buffers}.) +(See @code{switch-to-buffer} in @ref{Switching Buffers}.) If @var{wildcards} is non-@code{nil}, which is always true in an interactive call, then @code{find-file} expands wildcard characters in @@ -187,8 +187,9 @@ @deffn Command find-file-other-window filename &optional wildcards This command selects a buffer visiting the file @var{filename}, but -does so in a window other than the selected window. It may use another -existing window or split a window; see @ref{Displaying Buffers}. +does so in a window other than the selected window. It may use +another existing window or split a window; see @ref{Switching +Buffers}. When this command is called interactively, it prompts for @var{filename}. === modified file 'doc/lispref/vol1.texi' --- doc/lispref/vol1.texi 2011-08-30 15:24:07 +0000 +++ doc/lispref/vol1.texi 2011-09-24 22:49:32 +0000 @@ -953,11 +953,11 @@ * Selecting Windows:: The selected window is the one that you edit in. * Cyclic Window Ordering:: Moving around the existing windows. * Buffers and Windows:: Each window displays the contents of a buffer. -* Displaying Buffers:: Higher-level functions for displaying a buffer - and choosing a window for it. +* Switching Buffers:: Higher-level functions for switching to a buffer. * Choosing Window:: How to choose a window for displaying a buffer. +* Window History:: Each window remembers the buffers displayed in it. * Dedicated Windows:: How to avoid displaying another buffer in - a specific window. + a specific window. * Window Point:: Each window has its own location of point. * Window Start and End:: Buffer positions indicating which text is on-screen in a window. === modified file 'doc/lispref/vol2.texi' --- doc/lispref/vol2.texi 2011-08-30 15:24:07 +0000 +++ doc/lispref/vol2.texi 2011-09-24 22:49:32 +0000 @@ -952,11 +952,11 @@ * Selecting Windows:: The selected window is the one that you edit in. * Cyclic Window Ordering:: Moving around the existing windows. * Buffers and Windows:: Each window displays the contents of a buffer. -* Displaying Buffers:: Higher-level functions for displaying a buffer - and choosing a window for it. +* Switching Buffers:: Higher-level functions for switching to a buffer. * Choosing Window:: How to choose a window for displaying a buffer. +* Window History:: Each window remembers the buffers displayed in it. * Dedicated Windows:: How to avoid displaying another buffer in - a specific window. + a specific window. * Window Point:: Each window has its own location of point. * Window Start and End:: Buffer positions indicating which text is on-screen in a window. === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2011-09-23 09:12:53 +0000 +++ doc/lispref/windows.texi 2011-09-24 22:49:32 +0000 @@ -22,9 +22,9 @@ * Selecting Windows:: The selected window is the one that you edit in. * Cyclic Window Ordering:: Moving around the existing windows. * Buffers and Windows:: Each window displays the contents of a buffer. -* Displaying Buffers:: Higher-level functions for displaying a buffer - and choosing a window for it. +* Switching Buffers:: Higher-level functions for switching to a buffer. * Choosing Window:: How to choose a window for displaying a buffer. +* Window History:: Each window remembers the buffers displayed in it. * Dedicated Windows:: How to avoid displaying another buffer in a specific window. * Window Point:: Each window has its own location of point. @@ -1963,7 +1963,6 @@ @code{next-window} for details. @end defun - @node Buffers and Windows @section Buffers and Windows @cindex examining windows @@ -1982,10 +1981,11 @@ The basic, low-level function to associate a window with a buffer is @code{set-window-buffer}. Higher-level functions like -@code{display-buffer} try to obey a number of user customizations -regulating which windows are supposed to display which buffers. When -writing an application, programmers should therefore carefully evaluate -whether they really need the power of @code{set-window-buffer}. +@code{switch-to-buffer} and @code{display-buffer} try to obey a number +of user customizations regulating which windows are supposed to +display which buffers. @xref{Switching Buffers}. When writing an +application, you should avoid using @code{set-window-buffer} unless +you are sure you need it. @defun set-window-buffer window buffer-or-name &optional keep-margins This function makes @var{window} display @var{buffer-or-name} and @@ -2067,310 +2067,208 @@ like the optional arguments of @code{get-buffer-window}. @end defun -The following command removes a buffer from all windows showing it. - @deffn Command replace-buffer-in-windows &optional buffer-or-name -This function replaces @var{buffer-or-name} in all windows displaying it -with some other buffer. It uses @code{switch-to-prev-buffer}, see -below, to choose that other buffer which is usually the last buffer -displayed before @var{buffer-or-name} in the respective window. +This command replaces @var{buffer-or-name} with some other buffer, in +all windows displaying it. For each such window, it choose another +buffer using @code{switch-to-prev-buffer} (@pxref{Window History}). -The argument @var{buffer-or-name} may be a buffer or the name of an -existing buffer and defaults to the current buffer. +@var{buffer-or-name} may be a buffer, or the name of an existing +buffer; it defaults to the current buffer. If a window displaying @var{buffer-or-name} is dedicated -(@pxref{Dedicated Windows}) has never displayed any other buffers and is -not the only window on its frame, that window is deleted. If that -window is the only window on its frame and there are other frames left, -the window's frame is deleted too. If there are no other frames left, -some other buffer is displayed in that window as explained above. You -can prevent the deletion of windows and/or frames by customizing the -option @var{window-auto-delete}. - -This function returns @code{nil}. -@end deffn - - When @code{replace-buffer-in-windows} has to show another buffer in a -window, it tries to pick the buffer shown there before. For this -purpose each window remembers the buffers it has displayed earlier and -the order in which these buffers have been removed from it. - -The list of @dfn{previous buffers} of a window is an association list -where each entry specifies a buffer, the last start position of that -buffer in the window (@pxref{Window Start and End}) and the last -position of that buffer's point in the window (@pxref{Window Point}). -This list is ordered by the times of the removal of the respective -buffers from the window. In particular, the first element of the list -references the buffer removed most recently. The function -@code{set-window-buffer} pushes an entry for the old buffer of its -window argument on that list before it shows its buffer argument in the -window. - -The list of @dfn{next buffers} of a window is a list of buffers that -have been recently re-shown by the function @code{switch-to-prev-buffer} -and is used to avoid that that function switches to such a buffer again -before showing other interesting buffers. - -The lists of previous and next buffers and the global buffer list -(@pxref{The Buffer List}) allow to effectively display all buffers in a -window while giving preference to the buffers previously shown in that -window. The commands used for this purpose are -@code{switch-to-prev-buffer} and @code{switch-to-next-buffer} described -below. - -The following functions directly operate on the lists of previous and -next buffers. - -@defun window-prev-buffers &optional window -This function returns an alist specifying the buffers previously shown -in @var{window} together with their window start and point positions. -The argument @var{window} must be a live window and defaults to the -selected one. -@end defun - -@defun set-window-prev-buffers window prev-buffers -This function sets @var{window}'s previous buffers to the value of -@var{prev-buffers}. The argument @var{window} must be a live window and -defaults to the selected one. This function returns -@var{prev-buffers}. - -If non-@code{nil}, @var{prev-buffers} must specify an alist of triples -specifying a buffer and two markers for that buffer's start and point -position in @var{window}. -@end defun - -@defun window-next-buffers &optional window -This function returns the list of buffers recently re-shown in -@var{window}. The argument @var{window} must be a live window and -defaults to the selected one. -@end defun - -@defun set-window-next-buffers window next-buffers -This function sets @var{window}'s next buffers to @var{next-buffers}. -@var{window} must be a live window and defaults to the selected one. -This fucntion returns @var{next-buffers}. - -If non-@code{nil}, the argument @var{next-buffers} should specify a list -of buffers that shall be preferably not shown by the command -@code{switch-to-prev-buffer}, see below. -@end defun - -The following command is used by @code{replace-buffer-in-windows}, -@code{bury-buffer} and @code{quit-window} to show another buffer in a -window. It can be also used interactively to cycle through the list of -all buffers in a window, preferably showing the buffers recently shown -(but not buried or killed) in that window. - -@deffn Command switch-to-prev-buffer &optional window bury-or-kill -This function displays the previous buffer in @var{window}. The -argument @var{window} must be a live window and defaults to the selected -one. If the optional argument @var{bury-or-kill} is non-@code{nil}, -this means that the buffer currently shown in @var{window} is about to -be buried or killed and consequently shall not be switched to in future -invocations of this command. - -The previous buffer is usually the buffer shown before the buffer -currently shown in @var{window}. However, a buffer that has been buried -or killed or has been already shown by a recent invocation of -@code{switch-to-prev-buffer} does not qualify as previous buffer. - -If repeated invocations of this command have already shown all buffers -previously shown in @var{window}, further invocations will show buffers -from the global buffer list starting with the buffer returned by -@code{last-buffer} (@pxref{The Buffer List}). -@end deffn - -The following command can be used to undo the effect of the last undone -@code{switch-to-prev-buffer} command. - -@deffn Command switch-to-next-buffer &optional window -This functions switches to the next buffer in @var{window} thus undoing -the effect of the last @code{switch-to-prev-buffer} command in -@var{window}. The argument @var{window} must be a live window and -defaults to the selected one. - -If there is no recent invocation of a @code{switch-to-prev-buffer} that -can be undone, @code{switch-to-next-buffer} will try to show the first -buffer from the global buffer list as returned by @code{other-buffer} -(@pxref{The Buffer List}). -@end deffn - - Together, @code{switch-to-prev-buffer} and -@code{switch-to-next-buffer} permit to navigate the global buffer list -much like @code{bury-buffer} and @code{unbury-buffer}. In contrast with -the latter, however, they may show a buffer even if it is already shown -in another window. Moreover, they try to restore the window specific -start and point positions of buffers which should handle viewing one and -the same buffer in multiple windows more easily. - - -@node Displaying Buffers -@section Displaying Buffers in Windows +(@pxref{Dedicated Windows}) has never displayed any other buffers and +is not the only window on its frame, that window is deleted. If that +window is the only window on its frame and there are other frames on +the frame's terminal, that frame is deleted too; otherwise, some other +buffer is displayed in that window, as explained above. A user can +prevent the deletion of windows and/or frames by customizing the +option @code{window-auto-delete}. +@end deffn + +@node Switching Buffers +@section Switching to a Buffer in a Window @cindex switching to a buffer @cindex displaying a buffer - In this section we describe convenient functions that choose a window -automatically and use it to display a specified buffer. These functions -can also split an existing window in certain circumstances. We also -describe variables that parameterize the heuristics used for choosing a -window. -@iftex -See the preceding section for -@end iftex -@ifnottex -@xref{Buffers and Windows}, for -@end ifnottex -low-level primitives that give you more precise control. All of these -functions work by calling @code{set-window-buffer}. - - Do not use the functions in this section in order to make a buffer -current so that a Lisp program can access or modify it; they are too -drastic for that purpose, since they change the display of buffers in -windows, which would be gratuitous and surprise the user. Instead, use -@code{set-buffer} and @code{save-current-buffer} (@pxref{Current -Buffer}), which designate buffers as current for programmed access -without affecting the display of buffers in windows. - -@deffn Command switch-to-buffer buffer-or-name &optional norecord -This function makes @var{buffer-or-name} the current buffer, and also -displays the buffer in the selected window. This means that a human can -see the buffer and subsequent keyboard commands will apply to it. -Contrast this with @code{set-buffer}, which makes @var{buffer-or-name} -the current buffer but does not display it in the selected window; -see @ref{Current Buffer}. - -If @var{buffer-or-name} is @code{nil}, @code{switch-to-buffer} chooses a -buffer using @code{other-buffer}. If @var{buffer-or-name} is a string -that does not identify an existing buffer, then a new buffer by that -name is created. The major mode for the new buffer is set according to -the variable @code{major-mode}; see @ref{Auto Major Mode}. - -When the selected window is the minibuffer window or is strongly -dedicated to its buffer (@pxref{Dedicated Windows}), this function calls -@code{pop-to-buffer} (see below) to display the buffer in some other -window. - -Normally the specified buffer is put at the front of the buffer list -(both the selected frame's buffer list and the frame-independent buffer -list). This affects the operation of @code{other-buffer}. However, if -@var{norecord} is non-@code{nil}, this is not done. @xref{The Buffer -List}. - -The @code{switch-to-buffer} function is often used interactively, as -the binding of @kbd{C-x b}. It is also used frequently in programs. It -returns the buffer that it switched to. + This section describes high-level functions for switching to a +specified buffer in some window. + + Do @emph{not} use these functions to make a buffer temporarily +current so that a Lisp program can access or modify it; they have +side-effects that may surprise the user, such as changing window +histories (@pxref{Window History}). Instead, use +@code{with-current-buffer}, @code{save-current-buffer}, or +@code{set-buffer} (@pxref{Current Buffer}). + +@deffn Command switch-to-buffer buffer-or-name &optional norecord force-same-window +This function displays @var{buffer-or-name} in the selected window, +and makes it the current buffer. (In contrast, @code{set-buffer} +makes the buffer current but does not display it; @pxref{Current +Buffer}). It is often used interactively (as the binding of @kbd{C-x +b}), as well as in Lisp programs. The return value is the buffer +switched to. + +If @var{buffer-or-name} is @code{nil}, it defaults to the buffer +returned by @code{other-buffer} (@pxref{The Buffer List}). If +@var{buffer-or-name} is a string that is not the name of any existing +buffer, this function creates a new buffer with that name; the new +buffer's major mode is determined by the variable @code{major-mode} +(@pxref{Major Modes}). + +Normally the specified buffer is put at the front of the buffer +list---both the global buffer list and the selected frame's buffer +list (@pxref{The Buffer List}). However, this is not done if the +optional argument @var{norecord} is non-@code{nil}. + +If this function is unable to display in the seleted window---usually +because the selected window is a minibuffer window or is strongly +dedicated to its buffer (@pxref{Dedicated Windows})---then it normally +tries to display in some other window, in the manner of +@code{pop-to-buffer} (see below). However, if the optional argument +@var{force-same-window} is non-@code{nil}, it signals an error +instead. @end deffn The next two functions are similar to @code{switch-to-buffer}, except for the described features. @deffn Command switch-to-buffer-other-window buffer-or-name &optional norecord -This function makes the buffer specified by @var{buffer-or-name} current -and displays it in a window not currently selected, using the function +This function makes the buffer specified by @var{buffer-or-name} +current and displays it in some window other than the selected window. +It uses the function @code{pop-to-buffer} internally (see below). + +If the selected window already displays the specified buffer, it +continues to do so, but another window is nonetheless found to display +it as well. + +The @var{buffer-or-name} and @var{norecord} arguments have the same +meanings as in @code{switch-to-buffer}. +@end deffn + +@deffn Command switch-to-buffer-other-frame buffer-or-name &optional norecord +This function makes the buffer specified by @var{buffer-or-name} +current and displays it, usually in a new frame. It uses the function @code{pop-to-buffer} (see below). -The currently selected window is absolutely never used to do the job. -If the selected window already displays @var{buffer-or-name}, then it -continues to do so, but another window is nonetheless found to display -it in as well. +If the specified buffer is already displayed in another window, in any +frame on the current terminal, this switches to that window instead of +creating a new frame. However, the selected window is never used for +this. -This function updates the buffer list just like @code{switch-to-buffer} -unless @var{norecord} is non-@code{nil}. +The @var{buffer-or-name} and @var{norecord} arguments have the same +meanings as in @code{switch-to-buffer}. @end deffn -@defun pop-to-buffer buffer-or-name &optional other-window norecord -This function makes @var{buffer-or-name} the current buffer and switches -to it in some window, preferably not the window previously selected. -The ``popped-to'' window becomes the selected window. Its frame is -given the X server's focus, if possible; see @ref{Input Focus}. The -return value is the buffer that was switched to. - -If @var{buffer-or-name} is @code{nil}, that means to choose some other -buffer, but you don't specify which. If @var{buffer-or-name} is a -string that does not name an existing buffer, a buffer by that name is -created. The major mode for the new buffer is set according to the -variable @code{major-mode}. @xref{Auto Major Mode}. - -If either of the variables @code{display-buffer-reuse-frames} or -@code{pop-up-frames} is non-@code{nil}, @code{pop-to-buffer} looks for a -window in any visible frame already displaying the buffer; if there is -one, it selects and returns that window. If no such window exists and -@code{pop-up-frames} is non-@code{nil}, it creates a new frame and -displays the buffer in it. Otherwise, @code{pop-to-buffer} operates -entirely within the selected frame. (If the selected frame has just a -minibuffer, @code{pop-to-buffer} operates within the most recently -selected frame that was not just a minibuffer.) - -If the variable @code{pop-up-windows} is non-@code{nil}, windows may be -split to create a new window that is different from the original window. -For details, see @ref{Choosing Window}. - -If @var{other-window} is non-@code{nil}, @code{pop-to-buffer} finds or -creates another window even if @var{buffer-or-name} is already visible -in the selected window. Thus @var{buffer-or-name} could end up -displayed in two windows. On the other hand, if @var{buffer-or-name} is -already displayed in the selected window and @var{other-window} is -@code{nil}, then the selected window is considered sufficient for -displaying @var{buffer-or-name}, so that nothing needs to be done. - -All the variables that affect @code{display-buffer} affect -@code{pop-to-buffer} as well. @xref{Choosing Window}. - -This function updates the buffer list just like @code{switch-to-buffer} +The above commands use @code{pop-to-buffer}, which is the function +used by Lisp programs to flexibly display a buffer in some window and +select that window for editing: + +@defun pop-to-buffer buffer-or-name &optional action norecord +This function makes @var{buffer-or-name} the current buffer and +displays it in some window, preferably not the window previously +selected. It then selects the displaying window. If that window is +on a different graphical frame, that frame is given input focus if +possible (@pxref{Input Focus}). The return value is the buffer that +was switched to. + +This function uses @code{display-buffer} to display the buffer, so all +the variables affecting @code{display-buffer} will affect it as well. +@xref{Choosing Window}. + +If @var{buffer-or-name} is @code{nil}, it defaults to the buffer +returned by @code{other-buffer} (@pxref{The Buffer List}). If +@var{buffer-or-name} is a string that is not the name of any existing +buffer, this function creates a new buffer with that name; the new +buffer's major mode is determined by the variable @code{major-mode} +(@pxref{Major Modes}). + +If @var{action} is non-@code{nil}, it should be a display action to +pass to @code{display-buffer} (@pxref{Choosing Window}). +Alternatively, a non-@code{nil}, non-list value means to pop to a +window other than the selected one---even if the buffer is already +displayed in the selected window. + +Like @code{switch-to-buffer}, this function updates the buffer list unless @var{norecord} is non-@code{nil}. @end defun -@deffn Command replace-buffer-in-windows &optional buffer-or-name -This function replaces @var{buffer-or-name} in all windows displaying -it with some other buffer. It uses @code{other-buffer} to choose the -other buffer. In the usual applications of this function, you -don't care which other buffer is used; you just want to make sure that -@var{buffer-or-name} is no longer displayed. - -The argument @var{buffer-or-name} may be a buffer or the name of an -existing buffer and defaults to the current buffer. - -If a window displaying @var{buffer-or-name} is dedicated -(@pxref{Dedicated Windows}), and is not the only window on its frame, -that window is deleted. If that window is the only window on its frame -and there are other frames left, the window's frame is deleted too. If -there are no other frames left, some other buffer is displayed in that -window. - -This function returns @code{nil}. -@end deffn - @node Choosing Window @section Choosing a Window for Display - This section describes the basic facility that chooses a window to -display a buffer in---@code{display-buffer}. Higher-level functions and -commands, like @code{switch-to-buffer} and @code{pop-to-buffer}, use this -subroutine. Here we describe how to use @code{display-buffer} and how -to customize it. - -@deffn Command display-buffer buffer-or-name &optional not-this-window frame -This command makes @var{buffer-or-name} appear in some window, but it -does not select that window and does not make the buffer specified by -@var{buffer-or-name} current. The identity of the selected window is -unaltered by this function. The argument @var{buffer-or-name} must be a -buffer or the name of an existing buffer. - -@var{not-this-window} non-@code{nil} means to display the specified -buffer in a window other than the selected one, even if it is already -displayed in the selected window. This can cause the buffer to appear -in two windows at once. Otherwise, if @var{buffer-or-name} is already -being displayed in any window, that is good enough, so this function -does nothing. - -@code{display-buffer} returns the window chosen to display -@var{buffer-or-name}. - -If the optional argument @var{frame} is non-@code{nil}, it specifies -which frames to check when deciding whether the buffer is already -displayed. If the buffer is already displayed in some window on one of -these frames, @code{display-buffer} simply returns that window. Here -are the possible values of @var{frame}: + The command @code{display-buffer} flexibly chooses a window for +display, and displays a specified buffer in that window. It can be +called interactively, via the key binding @kbd{C-x 4 o}. It is also +used as a subroutine by many functions and commands, including +@code{switch-to-buffer} and @code{pop-to-buffer} (@pxref{Switching +Buffers}). + +@cindex display action + This command performs several complex steps to find a window to +display in. These steps are described by means of @dfn{display +actions}, which have the form @code{(@var{function} . @var{alist})}. +Here, @var{function} is either a function or a list of functions, +while @var{alist} is an association list. In this section, we will +refer to such functions as @dfn{action functions}, and such alists as +@dfn{action alists}. + + An action function should accept two arguments: the buffer to +display and an action alist. It should attempt to display the buffer +in some window, picking or creating a window based on some internal +criteria (as well as, optionally, the action alist). If successful, +it should return the window; otherwise, it should return @code{nil}. + + @code{display-buffer} works by combining display actions from +several sources (including some user-customizable options), and +calling the action functions in turn, until one of the action +functions manages to display the buffer and returns a non-@code{nil} +value. + +@deffn Command display-buffer buffer-or-name &optional action frame +This command makes @var{buffer-or-name} appear in some window, without +selecting the window or making the buffer current. The argument +@var{buffer-or-name} must be a buffer or the name of an existing +buffer. The return value is the window chosen to display the buffer. + +The optional argument @var{action}, if non-@code{nil}, should normally +be a display action (described above). @code{display-buffer} builds a +list of action functions and an action alist, by consolidating display +actions from the following sources (in order): + +@itemize +@item +The variable @code{display-buffer-overriding-action}. + +@item +The user option @code{display-buffer-alist}. + +@item +The @var{action} argument. + +@item +The user option @code{display-buffer-base-action}. + +@item +The variable @code{display-buffer-fallback-action}. This is +non-@code{nil} by default, and specifies the fallback behavior if no +other display actions are given. +@end itemize + +@noindent +Each action function is called in turn, passing the buffer as the +first argument and the combined action alist as the second argument, +until one of the functions returns non-nil. + +The argument @var{action} can also have a non-@code{nil}, non-list +value. This has the special meaning that the buffer should be +displayed in a window other than the selected one, even if the +selected window is already displaying it. If called interactively +with a prefix argument, @var{action} is @code{t}. + +The optional argument @var{frame}, if non-@code{nil}, specifies which +frames to check when deciding whether the buffer is already displayed. +If the buffer is already displayed in some window on one of these +frames, @code{display-buffer} simply returns that window. Here are +the possible values of @var{frame}: @itemize @bullet @item @@ -2652,6 +2550,100 @@ resort, it will try to display @var{buffer-or-name} on a separate frame. In that case, the value of @code{pop-up-frames} is disregarded. +@node Window History +@section Window History +@cindex window history + + Each window remembers the buffers it has displayed earlier and the +order in which these buffers have been removed from it. This history +is used, for example, by @code{replace-buffer-in-windows} +(@pxref{Buffers and Windows}). This list is set automatically +maintained by Emacs, but you can use the following functions to +explicitly inspect or alter it: + +@defun window-prev-buffers &optional window +This function returns a list specifying the previous contents of +@var{window}, which should be a live window and defaults to the +selected window. + +Each list element has the form @code{(@var{buffer} @var{window-start} +@var{window-pos})}, where @var{buffer} is a buffer previously shown in +the window, @var{window-start} is the window start position when that +buffer was last shown, and @var{window-pos} is the point position when +that buffer was last shown. + +The list is ordered so that earlier elements correspond to more +recently-shown buffers, and the first element corresponds to the +buffer most recently removed from the window. +@end defun + +@defun set-window-prev-buffers window prev-buffers +This function sets @var{window}'s previous buffers to the value of +@var{prev-buffers}. The argument @var{window} must be a live window +and defaults to the selected one. The argument @var{prev-buffers} +should be a list of the same form as that returned by +@code{window-prev-buffers}. +@end defun + +In addition, each buffer maintains a list of @dfn{next buffers}, which +is a list of buffers re-shown by @code{switch-to-prev-buffer} (see +below). This list is mainly used by @code{switch-to-prev-buffer} and +@code{switch-to-next-buffer} for choosing buffers to switch to. + +@defun window-next-buffers &optional window +This function returns the list of buffers recently re-shown in +@var{window} via @code{switch-to-prev-buffer}. @var{window} should be +a live window or @code{nil} (meaning the selected window). +@end defun + +@defun set-window-next-buffers window next-buffers +This function sets the next buffer list of @var{window} to +@var{next-buffers}. The @var{window} argument should be a live window +or @code{nil} (meaning the selected window). The argument +@var{next-buffers} should be a list of buffers. +@end defun + +The following commands can be used to cycle through the global buffer +list, much like @code{bury-buffer} and @code{unbury-buffer}. However, +they cycle according to the specified window's history list, rather +than the global buffer list. In addition, they restore +window-specific window start and point positions, and may show a +buffer even if it is already shown in another window. The +@code{switch-to-prev-buffer} command, in particular, is used by +@code{replace-buffer-in-windows}, @code{bury-buffer} and +@code{quit-window} to find a replacement buffer for a window. + +@deffn Command switch-to-prev-buffer &optional window bury-or-kill +This command displays the previous buffer in @var{window}. The +argument @var{window} should be a live window or @code{nil} (meaning +the selected window). If the optional argument @var{bury-or-kill} is +non-@code{nil}, this means that the buffer currently shown in +@var{window} is about to be buried or killed and consequently shall +not be switched to in future invocations of this command. + +The previous buffer is usually the buffer shown before the buffer +currently shown in @var{window}. However, a buffer that has been buried +or killed or has been already shown by a recent invocation of +@code{switch-to-prev-buffer} does not qualify as previous buffer. + +If repeated invocations of this command have already shown all buffers +previously shown in @var{window}, further invocations will show buffers +from the global buffer list starting with the buffer returned by +@code{last-buffer} (@pxref{The Buffer List}). +@end deffn + +@deffn Command switch-to-next-buffer &optional window +This command switches to the next buffer in @var{window} thus undoing +the effect of the last @code{switch-to-prev-buffer} command in +@var{window}. The argument @var{window} must be a live window and +defaults to the selected one. + +If there is no recent invocation of a @code{switch-to-prev-buffer} +that can be undone, this function tries to show the first buffer from +the global buffer list as returned by @code{other-buffer} (@pxref{The +Buffer List}). +@end deffn + @node Dedicated Windows @section Dedicated Windows @cindex dedicated window @@ -2666,15 +2658,15 @@ (@pxref{Buffers and Windows}) with respect to dedicated windows is slightly different, see below. -When @code{delete-windows-on} (@pxref{Deleting Windows}) wants to delete -a dedicated window and that window is the only window on its frame, it -deletes the window's frame too, provided there are other frames left. -@code{replace-buffer-in-windows} (@pxref{Displaying Buffers}) tries to -delete all dedicated windows showing its buffer argument. When such a -window is the only window on its frame, that frame is deleted, provided -there are other frames left. If there are no more frames left, some -other buffer is displayed in the window, and the window is marked as -non-dedicated. +When @code{delete-windows-on} (@pxref{Deleting Windows}) wants to +delete a dedicated window and that window is the only window on its +frame, it deletes the window's frame too, provided there are other +frames left. @code{replace-buffer-in-windows} (@pxref{Switching +Buffers}) tries to delete all dedicated windows showing its buffer +argument. When such a window is the only window on its frame, that +frame is deleted, provided there are other frames left. If there are +no more frames left, some other buffer is displayed in the window, and +the window is marked as non-dedicated. When you kill a buffer (@pxref{Killing Buffers}) displayed in a dedicated window, any such window usually gets deleted too, since === modified file 'etc/NEWS' --- etc/NEWS 2011-09-24 18:19:20 +0000 +++ etc/NEWS 2011-09-24 22:49:32 +0000 @@ -1070,6 +1070,7 @@ positions. This also means that the same buffer may be automatically shown twice even if it already appears in another window. ++++ *** `switch-to-buffer' has a new optional argument FORCE-SAME-WINDOW, which if non-nil requires the buffer to be displayed in the currently selected window, signaling an error otherwise. If nil, another window ------------------------------------------------------------ revno: 105909 committer: Ken Manheimer branch nick: trunk timestamp: Sat 2011-09-24 16:58:23 -0400 message: * allout.el (allout-this-command-hid-stuff): Buffer-local variable that's true if the current command involved collapsing of text. It's reset to false at the beginning of the next command. (allout-post-command-business): Move the cursor to the beginning of entry if the cursor is hidden and collapsing activity just happened. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-24 18:38:20 +0000 +++ lisp/ChangeLog 2011-09-24 20:58:23 +0000 @@ -1,3 +1,12 @@ +2011-09-22 Ken Manheimer + + * allout.el (allout-this-command-hid-stuff): Buffer-local variable + that's true if the current command involved collapsing of text. + It's reset to false at the beginning of the next command. + (allout-post-command-business): Move the cursor to the beginning + of entry if the cursor is hidden and collapsing activity just + happened. + 2011-09-24 Chong Yidong * mouse.el (mouse-drag-track): Set scroll-margin to 0 while === modified file 'lisp/allout.el' --- lisp/allout.el 2011-07-05 18:54:08 +0000 +++ lisp/allout.el 2011-09-24 20:58:23 +0000 @@ -3304,6 +3304,10 @@ Set by `allout-pre-command-business', to support allout addons in coordinating with allout activity.") (make-variable-buffer-local 'allout-command-counter) +;;;_ = allout-this-command-hid-text +(defvar allout-this-command-hid-text nil + "True if the most recent allout-mode command hid any text.") +(make-variable-buffer-local 'allout-this-command-hid-text) ;;;_ > allout-post-command-business () (defun allout-post-command-business () "Outline `post-command-hook' function. @@ -3311,6 +3315,9 @@ - Implement (and clear) `allout-post-goto-bullet', for hot-spot outline commands. +- Move the cursor to the beginning of the entry if it is hidden + and collapsing activity just happened. + - If the command we're following was an undo, check for change in the status of encrypted items and adjust auto-save inhibitions accordingly. @@ -3343,8 +3350,9 @@ (if (and allout-post-goto-bullet (allout-current-bullet-pos)) (progn (goto-char (allout-current-bullet-pos)) - (setq allout-post-goto-bullet nil))) - )) + (setq allout-post-goto-bullet nil)) + (when (and (allout-hidden-p) allout-this-command-hid-text) + (allout-beginning-of-current-entry))))) ;;;_ > allout-pre-command-business () (defun allout-pre-command-business () "Outline `pre-command-hook' function for outline buffers. @@ -3367,8 +3375,8 @@ (if (not (allout-mode-p)) nil - ;; Increment allout-command-counter (setq allout-command-counter (1+ allout-command-counter)) + (setq allout-this-command-hid-text nil) ;; Do hot-spot navigation. (if (and (eq this-command 'self-insert-command) (eq (point)(allout-current-bullet-pos))) @@ -4767,7 +4775,8 @@ (condition-case nil ;; as of 2008-02-27, xemacs lacks modification-hooks (overlay-put o (pop props) (pop props)) - (error nil))))))) + (error nil)))))) + (setq allout-this-command-hid-text t)) (run-hook-with-args 'allout-exposure-change-hook from to flag)) ;;;_ > allout-flag-current-subtree (flag) (defun allout-flag-current-subtree (flag) ------------------------------------------------------------ revno: 105908 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-09-24 12:06:20 -0700 message: * configure.in (CRT_DIR): Fix netbsd/openbsd handling. Ref: http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00562.html diff: === modified file 'ChangeLog' --- ChangeLog 2011-09-19 08:26:50 +0000 +++ ChangeLog 2011-09-24 19:06:20 +0000 @@ -1,3 +1,7 @@ +2011-09-24 Glenn Morris + + * configure.in (CRT_DIR): Fix netbsd/openbsd handling. + 2011-09-19 Lars Magne Ingebrigtsen * .dir-locals.el: Change the debbugs regexp to allow having the === modified file 'configure.in' --- configure.in 2011-09-15 03:01:25 +0000 +++ configure.in 2011-09-24 19:06:20 +0000 @@ -985,6 +985,7 @@ LIB_STANDARD= START_FILES= +dnl NB do not use CRT_DIR unquoted here, since it might not be set yet. case $opsys in cygwin ) LIB_MATH= @@ -1007,14 +1008,10 @@ LIB_STANDARD=-lc START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o' ;; + dnl NB this may be adjusted below. netbsd | openbsd ) - if test -f $CRT_DIR/crti.o; then - LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o' - START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o' - else - LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o' - START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o' - fi + LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o' + START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o' ;; esac @@ -1094,6 +1091,19 @@ AC_SUBST(CRT_DIR) +case $opsys in + netbsd | openbsd ) + if test -f $CRT_DIR/crti.o; then + + test -f $CRT_DIR/crtn.o || \ + AC_MSG_ERROR([Required file not found: crtn.o]) + + LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o' + START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o' + fi + ;; +esac + dnl This function definition taken from Gnome 2.0 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) ------------------------------------------------------------ revno: 105907 fixes bug(s): http://debbugs.gnu.org/9541 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-09-24 14:38:20 -0400 message: * mouse.el (mouse-drag-track): Set scroll-margin to 0 while tracking. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-24 14:04:46 +0000 +++ lisp/ChangeLog 2011-09-24 18:38:20 +0000 @@ -1,3 +1,8 @@ +2011-09-24 Chong Yidong + + * mouse.el (mouse-drag-track): Set scroll-margin to 0 while + tracking (Bug#9541). + 2011-09-24 Ulf Jasper * net/newst-reader.el (newsticker-html-renderer) === modified file 'lisp/mouse.el' --- lisp/mouse.el 2011-07-14 14:01:16 +0000 +++ lisp/mouse.el 2011-09-24 18:38:20 +0000 @@ -904,7 +904,8 @@ (mouse-minibuffer-check start-event) (setq mouse-selection-click-count-buffer (current-buffer)) (deactivate-mark) - (let* ((original-window (selected-window)) + (let* ((scroll-margin 0) ; Avoid margin scrolling (Bug#9541). + (original-window (selected-window)) ;; We've recorded what we needed from the current buffer and ;; window, now let's jump to the place of the event, where things ;; are happening. ------------------------------------------------------------ revno: 105906 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-09-24 11:29:35 -0700 message: * src/minibuf.c (read_minibuf): Disable line truncation. (Bug#5715) diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-09-24 16:31:55 +0000 +++ src/ChangeLog 2011-09-24 18:29:35 +0000 @@ -1,3 +1,7 @@ +2011-09-24 Glenn Morris + + * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715) + 2011-09-24 Paul Eggert Fix minor problems found by static checking. === modified file 'src/minibuf.c' --- src/minibuf.c 2011-09-11 22:04:52 +0000 +++ src/minibuf.c 2011-09-24 18:29:35 +0000 @@ -559,6 +559,10 @@ minibuffer = get_minibuffer (minibuf_level); Fset_buffer (minibuffer); + /* Defeat (setq-default truncate-lines t), since truncated lines do + not work correctly in minibuffers. (Bug#5715, etc) */ + BVAR (current_buffer, truncate_lines) = Qnil; + /* If appropriate, copy enable-multibyte-characters into the minibuffer. */ if (inherit_input_method) BVAR (current_buffer, enable_multibyte_characters) = enable_multibyte; ------------------------------------------------------------ revno: 105905 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-09-24 11:27:18 -0700 message: * etc/PROBLEMS: Very long lines being slow is a known issue. diff: === modified file 'etc/PROBLEMS' --- etc/PROBLEMS 2011-08-30 02:05:43 +0000 +++ etc/PROBLEMS 2011-09-24 18:27:18 +0000 @@ -503,6 +503,12 @@ ** Miscellaneous problems +*** Editing files with very long lines is slow. + +For example, simply moving through a file that contains hundreds of +thousands of characters per line is slow, and consumes a lot of CPU. +This is a known limitation of Emacs with no solution at this time. + *** Emacs uses 100% of CPU time This is a known problem with some versions of the Semantic package. ------------------------------------------------------------ revno: 105904 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-09-24 14:19:20 -0400 message: Window-related updates to NEWS and Emacs manual. * etc/NEWS: Reorganize, placing user options in Changes section. * doc/emacs/buffers.texi (Select Buffer): Clarify description of buffer-switching commands. Add xref to Window Display node. Don't repeat confirm-nonexistent-file-or-buffer description from Visiting node. Remove even-window-heights. * doc/emacs/frames.texi (Special Buffer Frames): Add xref to Window Choice. * doc/emacs/windows.texi (Pop Up Window): Defer discussion of window splitting to the Window Choice node. Add index entries. (Force Same Window): Node deleted. (Displaying Buffers, Window Choice): New nodes. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-09-18 20:01:37 +0000 +++ doc/emacs/ChangeLog 2011-09-24 18:19:20 +0000 @@ -1,3 +1,17 @@ +2011-09-24 Chong Yidong + + * windows.texi (Pop Up Window): Defer discussion of window + splitting to the Window Choice node. Add index entries. + (Force Same Window): Node deleted. + (Displaying Buffers, Window Choice): New nodes. + + * buffers.texi (Select Buffer): Clarify description of + buffer-switching commands. Add xref to Window Display node. + Don't repeat confirm-nonexistent-file-or-buffer description from + Visiting node. Remove even-window-heights. + + * frames.texi (Special Buffer Frames): Add xref to Window Choice. + 2011-09-18 Chong Yidong * cmdargs.texi (Icons X): Fix description of Emacs icon. === modified file 'doc/emacs/buffers.texi' --- doc/emacs/buffers.texi 2011-08-28 21:07:10 +0000 +++ doc/emacs/buffers.texi 2011-09-24 18:19:20 +0000 @@ -91,9 +91,9 @@ @var{bufname} @key{RET}}. This runs the command @code{switch-to-buffer} with argument @var{bufname}. While entering the buffer name, you can use the usual minibuffer completion and -history commands (@pxref{Minibuffer}). An empty argument to @kbd{C-x -b} specifies the buffer that was current most recently among those not -now displayed in any window. +history commands (@pxref{Minibuffer}). An empty input specifies the +buffer that was current most recently among those not now displayed in +any window. @cindex minibuffer confirmation @cindex confirming in the minibuffer @@ -107,16 +107,8 @@ realizing that @key{TAB} did not complete far enough to yield the desired buffer name (@pxref{Completion}). Emacs asks for confirmation by putting the message @samp{[Confirm]} in the minibuffer; type -@key{RET} again to confirm and visit the buffer. - -@vindex confirm-nonexistent-file-or-buffer - The variable @code{confirm-nonexistent-file-or-buffer} controls -whether Emacs asks for confirmation before visiting a buffer that did -not previously exist. The default value, @code{after-completion}, -gives the behavior we have just described. If the value is -@code{nil}, Emacs never asks for confirmation; for any other -non-@code{nil} value, Emacs always asks for confirmation. This -variable also affects the @code{find-file} command (@pxref{Visiting}). +@key{RET} again to confirm and visit the buffer. @xref{Visiting}, for +information about modifying this behavior. One reason to create a new buffer is to use it for making temporary notes. If you try to save it, Emacs asks for the file name to use. @@ -136,36 +128,26 @@ @kindex C-x 4 b @findex switch-to-buffer-other-window -@vindex even-window-heights To select a buffer in a window other than the current one, type @kbd{C-x 4 b} (@code{switch-to-buffer-other-window}). This prompts for a buffer name using the minibuffer, displays that buffer in -another window, and selects that window. By default, if displaying -the buffer causes two vertically adjacent windows to be displayed, the -heights of those windows are evened out; to countermand that and -preserve the window configuration, set the variable -@code{even-window-heights} to @code{nil}. +another window, and selects that window. @kindex C-x 5 b @findex switch-to-buffer-other-frame Similarly, @kbd{C-x 5 b} (@code{switch-to-buffer-other-frame}) prompts for a buffer name, displays that buffer in another frame, and -selects that frame. +selects that frame. If the buffer is already being shown in a window +on another frame, Emacs selects that window and frame instead of +creating a new frame. + + @xref{Displaying Buffers}, for how the @kbd{C-x 4 b} and @kbd{C-x 5 +b} commands get the window and/or frame to display in. In addition, @kbd{C-x C-f}, and any other command for visiting a file, can also be used to switch to an existing file-visiting buffer. @xref{Visiting}. -@vindex display-buffer-reuse-frames - You can control how certain buffers are handled by these commands by -customizing the variables @code{special-display-buffer-names}, -@code{special-display-regexps}, @code{same-window-buffer-names}, and -@code{same-window-regexps}. See @ref{Force Same Window}, and -@ref{Special Buffer Frames}, for more about these variables. In -addition, if the value of @code{display-buffer-reuse-frames} is -non-@code{nil}, and the buffer you want to switch to is already -displayed in some frame, Emacs will just raise that frame. - @findex goto-line @kbd{C-u M-g M-g}, that is @code{goto-line} with a plain prefix argument, reads a number @var{n} using the minibuffer, selects the === modified file 'doc/emacs/emacs.texi' --- doc/emacs/emacs.texi 2011-08-28 21:07:10 +0000 +++ doc/emacs/emacs.texi 2011-09-24 18:19:20 +0000 @@ -488,9 +488,8 @@ * Split Window:: New windows are made by splitting existing windows. * Other Window:: Moving to another window or doing something to it. * Pop Up Window:: Finding a file or buffer in another window. -* Force Same Window:: Forcing certain buffers to appear in the selected - window rather than in another window. * Change Window:: Deleting windows and changing their sizes. +* Displaying Buffers:: How Emacs picks a window for displaying a buffer. * Window Convenience:: Convenience functions for window handling. Frames and Graphical Displays === modified file 'doc/emacs/frames.texi' --- doc/emacs/frames.texi 2011-09-12 14:48:34 +0000 +++ doc/emacs/frames.texi 2011-09-24 18:19:20 +0000 @@ -850,11 +850,12 @@ @vindex special-display-buffer-names You can make certain chosen buffers, which Emacs normally displays -in ``another window,'' appear in special frames of their own. To do -this, set the variable @code{special-display-buffer-names} to a list -of buffer names; any buffer whose name is in that list automatically -gets a special frame, when an Emacs command wants to display it ``in -another window.'' +in ``some other window'' (@pxref{Displaying Buffers}), appear in +special frames of their own. To do this, set the variable +@code{special-display-buffer-names} to a list of buffer names; any +buffer whose name is in that list automatically gets a special frame. +@xref{Window Choice}, for how this fits in with the other ways for +Emacs to choose a window to display in. For example, if you set the variable this way, @@ -906,13 +907,6 @@ calling @var{function}; its first argument is the buffer, and its remaining arguments are @var{args}. - An analogous feature lets you specify buffers which should be -displayed in the selected window. @xref{Force Same Window}. The -same-window feature takes precedence over the special-frame feature; -therefore, if you add a buffer name to -@code{special-display-buffer-names} and it has no effect, check to see -whether that feature is also in use for the same buffer name. - @node Frame Parameters @section Setting Frame Parameters @cindex Auto-Raise mode === modified file 'doc/emacs/windows.texi' --- doc/emacs/windows.texi 2011-05-17 02:26:56 +0000 +++ doc/emacs/windows.texi 2011-09-24 18:19:20 +0000 @@ -18,9 +18,8 @@ * Split Window:: New windows are made by splitting existing windows. * Other Window:: Moving to another window or doing something to it. * Pop Up Window:: Finding a file or buffer in another window. -* Force Same Window:: Forcing certain buffers to appear in the selected - window rather than in another window. * Change Window:: Deleting windows and changing their sizes. +* Displaying Buffers:: How Emacs picks a window for displaying a buffer. * Window Convenience:: Convenience functions for window handling. @end menu @@ -191,84 +190,47 @@ @cindex selecting buffers in other windows @kindex C-x 4 - @kbd{C-x 4} is a prefix key for commands that select another window -(splitting the window if there is only one) and select a buffer in that -window. Different @kbd{C-x 4} commands have different ways of finding the -buffer to select. + @kbd{C-x 4} is a prefix key for a variety of commands that switch to +a buffer in a different window---either another existing window, or a +new window created by splitting the selected window. @xref{Window +Choice}, for how Emacs picks or creates the window to use. @table @kbd +@findex switch-to-buffer-other-window @item C-x 4 b @var{bufname} @key{RET} -Select buffer @var{bufname} in another window. This runs -@code{switch-to-buffer-other-window}. +Select buffer @var{bufname} in another window +(@code{switch-to-buffer-other-window}). + +@findex display-buffer @item C-x 4 C-o @var{bufname} @key{RET} -Display buffer @var{bufname} in another window, but -don't select that buffer or that window. This runs -@code{display-buffer}. +Display buffer @var{bufname} in some window, without trying to select +it (@code{display-buffer}). @xref{Displaying Buffers}, for details +about how the window is chosen. + +@findex find-file-other-window @item C-x 4 f @var{filename} @key{RET} -Visit file @var{filename} and select its buffer in another window. This -runs @code{find-file-other-window}. @xref{Visiting}. +Visit file @var{filename} and select its buffer in another window +(@code{find-file-other-window}). @xref{Visiting}. + +@findex dired-other-window @item C-x 4 d @var{directory} @key{RET} -Select a Dired buffer for directory @var{directory} in another window. -This runs @code{dired-other-window}. @xref{Dired}. +Select a Dired buffer for directory @var{directory} in another window +(@code{dired-other-window}). @xref{Dired}. + +@findex mail-other-window @item C-x 4 m -Start composing a mail message in another window. This runs -@code{mail-other-window}; its same-window analogue is @kbd{C-x m} -(@pxref{Sending Mail}). +Start composing a mail message, similar to @kbd{C-x m} (@pxref{Sending +Mail}), but in another window (@code{mail-other-window}). + +@findex find-tag-other-window @item C-x 4 . -Find a tag in the current tags table, in another window. This runs -@code{find-tag-other-window}, the multiple-window variant of @kbd{M-.} -(@pxref{Tags}). +Find a tag in the current tags table, similar to @kbd{M-.} +(@pxref{Tags}), but in another window (@code{find-tag-other-window}). @item C-x 4 r @var{filename} @key{RET} Visit file @var{filename} read-only, and select its buffer in another -window. This runs @code{find-file-read-only-other-window}. -@xref{Visiting}. +window (@code{find-file-read-only-other-window}). @xref{Visiting}. @end table -@vindex split-height-threshold -@vindex split-width-threshold - By default, these commands split the window vertically when there is -only one. You can customize the variables @code{split-height-threshold} -and @code{split-width-threshold} to split the window horizontally -instead. - - -@node Force Same Window -@section Forcing Display in the Same Window - - Certain Emacs commands switch to a specific buffer with special -contents. For example, @kbd{M-x shell} switches to a buffer named -@samp{*shell*}. By convention, all these commands are written to pop up -the buffer in a separate window. But you can specify that certain of -these buffers should appear in the selected window. - -@vindex same-window-buffer-names - If you add a buffer name to the list @code{same-window-buffer-names}, -the effect is that such commands display that particular buffer by -switching to it in the selected window. For example, if you add the -element @code{"*grep*"} to the list, the @code{grep} command will -display its output buffer in the selected window. - - The default value of @code{same-window-buffer-names} is not -@code{nil}: it specifies buffer names @samp{*info*}, @samp{*mail*} and -@samp{*shell*} (as well as others used by more obscure Emacs packages). -This is why @kbd{M-x shell} normally switches to the @samp{*shell*} -buffer in the selected window. If you delete this element from the -value of @code{same-window-buffer-names}, the behavior of @kbd{M-x -shell} will change---it will pop up the buffer in another window -instead. - -@vindex same-window-regexps - You can specify these buffers more generally with the variable -@code{same-window-regexps}. Set it to a list of regular expressions; -then any buffer whose name matches one of those regular expressions is -displayed by switching to it in the selected window. (Once again, this -applies only to buffers that normally get displayed for you in a -separate window.) The default value of this variable specifies Telnet -and rlogin buffers. - - An analogous feature lets you specify buffers which should be -displayed in their own individual frames. @xref{Special Buffer Frames}. - @node Change Window @section Deleting and Rearranging Windows @@ -356,6 +318,113 @@ Mouse clicks on the mode line provide another way to change window heights and to delete windows. @xref{Mode Line Mouse}. +@node Displaying Buffers +@section Displaying a Buffer in a Window + + It is a common Emacs operation to display or ``pop up'' some buffer +in response to a user command. There are several different ways by +which commands do this. + + Many commands, like @kbd{C-x C-f} (@code{find-file}), display the +buffer by ``taking over'' the selected window, expecting that the +user's attention will be diverted to that buffer. These commands +usually work by calling @code{switch-to-buffer} internally +(@pxref{Select Buffer}). + +@findex display-buffer + Some commands try to display ``intelligently'', trying not to take +over the selected window, e.g. by splitting the selected window and +displaying the desired buffer in the child window. Such commands, +which include the various help commands (@pxref{Help}), work by +calling @code{display-buffer} internally. @xref{Window Choice}, for +details. + + Other commands do the same as @code{display-buffer}, and +additionally select the displaying window so that you can begin +editing its buffer. The command @kbd{C-x `} (@code{next-error}) is +one example (@pxref{Compilation Mode}). Such commands work by calling +@code{pop-to-buffer} internally. @xref{Displaying Buffers,,Displaying +Buffers in Windows, elisp, The Emacs Lisp Reference Manual}. + + Commands with names ending in @code{-other-window} behave like +@code{display-buffer}, except that they never display in the selected +window. Several of these commands are bound in the @kbd{C-x 4} prefix +key (@pxref{Pop Up Window}). + + Commands with names ending in @code{-other-frame} behave like +@code{display-buffer}, except that they (i) never display in the +selected window and (ii) prefer to create a new frame to display the +desired buffer instead of splitting a window---as though the variable +@code{pop-up-frames} is set to @code{t} (@pxref{Window Choice}). +Several of these commands are bound in the @kbd{C-x 5} prefix key. + +@menu +* Window Choice:: How @code{display-buffer} works. +@end menu + +@node Window Choice +@subsection How @code{display-buffer} works +@findex display-buffer + +The @code{display-buffer} command (as well as commands that call it +internally) chooses a window to display using the following steps: + +@itemize +@vindex same-window-buffer-names +@vindex same-window-regexps +@item +First, check if the buffer should be displayed in the selected window +regardless of other considerations. You can tell Emacs to do this by +adding the desired buffer's name to the list +@code{same-window-buffer-names}, or adding a matching regular +expression to the list @code{same-window-regexps}. By default, these +variables are @code{nil}, so this step is skipped. + +@vindex display-buffer-reuse-frames +@item +Otherwise, if the buffer is already displayed in an existing window, +``reuse'' that window. Normally, only windows on the selected frame +are considered, but windows on other frames are also reusable if you +change @code{display-buffer-reuse-frames} to @code{t}, or if you +change @code{pop-up-frames} (see below) to @code{t}. + +@item +Otherwise, if you specified that the buffer should be displayed in a +special frame by customizing @code{special-display-buffer-names} or +@code{special-display-regexps}, do so. @xref{Special Buffer Frames}. + +@vindex pop-up-frames +@item +Otherwise, optionally create a new frame and display the buffer there. +By default, this step is skipped. To enable it, change the variable +@code{pop-up-frames} to a non-@code{nil} value. The special value +@code{graphic-only} means to do this only on graphical displays. + +@item +Otherwise, try to create a new window by splitting the selected +window, and display the buffer in that new window. + +@vindex split-height-threshold +@vindex split-width-threshold +The split can be either vertical or horizontal, depending on the +variables @code{split-height-threshold} and +@code{split-width-threshold}. These variables should have integer +values. If @code{split-height-threshold} is smaller than the selected +window's height, the split puts the new window below. Otherwise, if +@code{split-width-threshold} is smaller than the window's width, the +split puts the new window on the right. If neither condition holds, +Emacs tries to split so that the new window is below---but only if the +window was not split before (to avoid excessive splitting). + +@item +Otherwise, display the buffer in an existing window on the selected +frame. + +@item +If all the above methods fail for whatever reason, create a new frame +and display the buffer there. +@end itemize + @node Window Convenience @section Window Handling Convenience Features and Customization === modified file 'etc/NEWS' --- etc/NEWS 2011-09-24 14:38:16 +0000 +++ etc/NEWS 2011-09-24 18:19:20 +0000 @@ -386,6 +386,45 @@ *** `menu-bar-select-buffer-function' lets you choose another operation instead of `switch-to-buffer' when selecting an item in the Buffers menu. +** Window changes + ++++ +*** Resizing an Emacs frame now preserves proportional window sizes, +modulo restrictions like window minimum sizes and fixed-size windows. + +*** The behavior of `display-buffer' is now customizable in detail. + +**** New option `display-buffer-base-action' specifies a list of +user-determined display "actions" (functions and optional arguments +for choosing the displaying window). + +This takes precedence over the default display action, which is +specified by `display-buffer-fallback-action'. + +**** New option `display-buffer-alist' maps buffer name regexps to +display actions, taking precedence over `display-buffer-base-action'. + ++++ +*** New option `window-nest'. +The new option `window-nest' allows to return the space obtained for +resizing or creating a window more reliably to the window from which +such space was obtained. + ++++ +*** New option `window-splits'. +The new option `window-splits' allows to split a window that otherwise +cannot be split because it's too small by stealing space from other +windows in the same combination. + ++++ +*** New commands `maximize-window' and `minimize-window'. +These maximize and minize the size of a window within its frame. + ++++ +*** New commands `switch-to-prev-buffer' and `switch-to-next-buffer'. +These functions allow to navigate through the live buffers that have +been shown in a specific window. + ** The inactive minibuffer has its own major mode `minibuffer-inactive-mode'. This is handy for minibuffer-only frames, and is also used for the "mouse-1 pops up *Messages*" feature, which can now easily be changed. @@ -1003,18 +1042,6 @@ window into two side-by-side windows as before. +++ -*** New option `window-nest'. -The new option `window-nest' allows to return the space obtained for -resizing or creating a window more reliably to the window from which -such space was obtained. - -+++ -*** New option `window-splits'. -The new option `window-splits' allows to split a window that otherwise -cannot be split because it's too small by stealing space from other -windows in the same combination. - -+++ *** `split-window-above-each-other' and `split-window-side-by-side'. The commands `split-window-vertically' and `split-window-horizontally' have been renamed to `split-window-above-each-other' and @@ -1028,12 +1055,6 @@ longer delete any windows when they become too small. +++ -*** Frame/window resizing. -Resizing an Emacs frame now preserves the proportional sizes of -subwindows modulo restrictions imposed by window minimum sizes and -fixed-size windows. - -+++ *** `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 @@ -1042,11 +1063,6 @@ windows which was introduced in Emacs 22. +++ -*** Commands for maximizing and minimizing windows. -New functions to maximize and minimize a window within its frame are -provided, namely `maximize-window' and `minimize-window'. - -+++ *** Window-local buffer lists. Windows now have local buffer lists. This means that removing a buffer from display in a window will preferably show the buffer previously @@ -1054,17 +1070,31 @@ positions. This also means that the same buffer may be automatically shown twice even if it already appears in another window. -+++ -*** New commands `switch-to-prev-buffer' and `switch-to-next-buffer'. -These functions allow to navigate through the live buffers that have -been shown in a specific window. - *** `switch-to-buffer' has a new optional argument FORCE-SAME-WINDOW, which if non-nil requires the buffer to be displayed in the currently selected window, signaling an error otherwise. If nil, another window can be used, e.g. if the selected one is strongly dedicated. -*** FIXME: buffer-display-alist changes +*** `split-window-vertically' and `split-window-horizontally' renamed +to `split-window-above-each-other' and `split-window-side-by-side' +respectively. The old names are kept as aliases. + +*** Display actions + +**** The second arg to `display-buffer' and `pop-to-buffer' is now +named ACTION, and takes a display action of the same form as +`display-buffer-base-action' (see Changes, above). A non-nil, +non-list value is treated specially, as the old meaning. + +**** New variable `display-buffer-overriding-action'. + +**** The procedure of `display-buffer' etc. to choose a window is +determined by combining `display-buffer-overriding-action', +`display-buffer-alist', the ACTION arg, `display-buffer-base-action', +and `display-buffer-fallback-action'. The second and fourth of these +are user-customizable variables. + +See the docstring of `display-buffer' for details. ** Completion ------------------------------------------------------------ revno: 105903 [merge] committer: Paul Eggert branch nick: trunk timestamp: Sat 2011-09-24 09:31:55 -0700 message: Fix minor problems found by static checking. * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int. * indent.c (Fvertical_motion): Fix == vs = typo. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-09-24 14:38:16 +0000 +++ src/ChangeLog 2011-09-24 16:31:55 +0000 @@ -1,3 +1,9 @@ +2011-09-24 Paul Eggert + + Fix minor problems found by static checking. + * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int. + * indent.c (Fvertical_motion): Fix == vs = typo. + 2011-09-24 Eli Zaretskii * dispnew.c (syms_of_display) : Default === modified file 'src/indent.c' --- src/indent.c 2011-09-24 13:23:58 +0000 +++ src/indent.c 2011-09-24 16:15:32 +0000 @@ -2041,7 +2041,7 @@ it_overshoot_count++; } if (!it_overshoot_count) - it_overshoot_count == -1; + it_overshoot_count = -1; } else it_overshoot_count = === modified file 'src/xdisp.c' --- src/xdisp.c 2011-09-24 13:23:58 +0000 +++ src/xdisp.c 2011-09-24 16:28:25 +0000 @@ -1226,7 +1226,7 @@ } else if (VECTORP (spec)) { - int i; + ptrdiff_t i; for (i = 0; i < ASIZE (spec); i++) { ------------------------------------------------------------ revno: 105902 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2011-09-24 17:38:16 +0300 message: Change the default value of redisplay-dont-pause to t. src/dispnew.c (syms_of_display) : Default value is now t. Doc fix. doc/lispref/display.texi (Forcing Redisplay): Update the description of redisplay-dont-pause due to change in the default value. etc/NEWS: Mention the change of the default value. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2011-09-23 15:01:49 +0000 +++ doc/lispref/ChangeLog 2011-09-24 14:38:16 +0000 @@ -1,3 +1,8 @@ +2011-09-24 Eli Zaretskii + + * display.texi (Forcing Redisplay): Update the description of + redisplay-dont-pause due to change in the default value. + 2011-09-23 Martin Rudalics * frames.texi (Frames and Windows): Move section and rename to === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2011-09-21 01:33:33 +0000 +++ doc/lispref/display.texi 2011-09-24 14:38:16 +0000 @@ -118,15 +118,12 @@ to put more work on the queue to be done by redisplay whenever there is a chance. - Emacs redisplay normally stops if input arrives, and does not happen -at all if input is available before it starts. Most of the time, this -is exactly what you want. However, you can prevent preemption by -binding @code{redisplay-dont-pause} to a non-@code{nil} value. - @defvar redisplay-dont-pause -If this variable is non-@code{nil}, pending input does not -prevent or halt redisplay; redisplay occurs, and finishes, -regardless of whether input is available. +If this variable is non-@code{nil}, pending input does not prevent or +halt redisplay; redisplay occurs, and finishes, regardless of whether +input is available. If it is @code{nil}, Emacs redisplay stops if +input arrives, and does not happen at all if input is available before +it starts. The default is @code{t}. @end defvar @defvar redisplay-preemption-period === modified file 'etc/NEWS' --- etc/NEWS 2011-09-23 15:01:49 +0000 +++ etc/NEWS 2011-09-24 14:38:16 +0000 @@ -500,6 +500,13 @@ directory is a remote file name and neither environment variable $ESHELL nor variable `explicit-shell-file-name' is set. ++++ +** The default value of redisplay-dont-change is now t +This makes Emacs feel more responsive to editing commands that arrive +at high rate, e.g. if you lean on some key, because stopping redisplay +in the middle (when this variable is nil) forces more expensive +updates later on, and Emacs appears to be unable to keep up. + * Changes in Specialized Modes and Packages in Emacs 24.1 === modified file 'src/ChangeLog' --- src/ChangeLog 2011-09-24 13:23:58 +0000 +++ src/ChangeLog 2011-09-24 14:38:16 +0000 @@ -1,5 +1,8 @@ 2011-09-24 Eli Zaretskii + * dispnew.c (syms_of_display) : Default + value is now t. Doc fix. + * indent.c (Fvertical_motion): Compute and apply the overshoot logic when moving up, not only when moving down. Fix the confusing name and values of the it_overshoot_expected variable; === modified file 'src/dispnew.c' --- src/dispnew.c 2011-09-09 01:06:52 +0000 +++ src/dispnew.c 2011-09-24 14:38:16 +0000 @@ -6494,8 +6494,8 @@ Vstandard_display_table = Qnil; DEFVAR_BOOL ("redisplay-dont-pause", redisplay_dont_pause, - doc: /* *Non-nil means update isn't paused when input is detected. */); - redisplay_dont_pause = 0; + doc: /* *Non-nil means display update isn't paused when input is detected. */); + redisplay_dont_pause = 1; #if PERIODIC_PREEMPTION_CHECKING DEFVAR_LISP ("redisplay-preemption-period", Vredisplay_preemption_period, ------------------------------------------------------------ revno: 105901 committer: Ulf Jasper branch nick: trunk timestamp: Sat 2011-09-24 16:04:46 +0200 message: newsticker: automatically load html rendering packages. lisp/ChangeLog: 2011-09-24 Ulf Jasper * net/newst-reader.el (newsticker-html-renderer) (newsticker-show-news): Automatically load html rendering package if newsticker-html-renderer is set. Fixes "Warning: defvar ignored because w3m-fill-column is let-bound" and the error "Symbol's value as variable is void: w3m-fill-column". diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-24 11:45:13 +0000 +++ lisp/ChangeLog 2011-09-24 14:04:46 +0000 @@ -1,3 +1,12 @@ +2011-09-24 Ulf Jasper + + * net/newst-reader.el (newsticker-html-renderer) + (newsticker-show-news): Automatically + load html rendering package if newsticker-html-renderer is + set. Fixes "Warning: defvar ignored because w3m-fill-column is + let-bound" and the error "Symbol's value as variable is void: + w3m-fill-column". + 2011-09-24 Michael Albinus * net/dbus.el (dbus-unregister-object): Remove match rule of signals. === modified file 'lisp/net/newst-reader.el' --- lisp/net/newst-reader.el 2011-05-13 19:06:36 +0000 +++ lisp/net/newst-reader.el 2011-09-24 14:04:46 +0000 @@ -5,7 +5,7 @@ ;; Author: Ulf Jasper ;; Filename: newst-reader.el ;; URL: http://www.nongnu.org/newsticker -;; Time-stamp: "13. Mai 2011, 20:55:24 (ulf)" +;; Time-stamp: "24. September 2011, 15:47:49 (ulf)" ;; Package: newsticker ;; ====================================================================== @@ -103,28 +103,11 @@ (defcustom newsticker-html-renderer nil "Function for rendering HTML contents. -If non-nil, newsticker.el will call this function whenever it finds -HTML-like tags in item descriptions. Possible functions are, for -example, `w3m-region', `w3-region', and (if you have htmlr.el installed) -`newsticker-htmlr-render'. - -In order to make sure that the HTML renderer is loaded when you -run newsticker, you should add one of the following statements to -your .emacs. If you use w3m, - - (autoload 'w3m-region \"w3m\" - \"Render region in current buffer and replace with result.\" t) - - (autoload 'w3m-toggle-inline-image \"w3m\" - \"Toggle the visibility of an image under point.\" t) - -or, if you use w3, - - (require 'w3-auto) - -or, if you use htmlr - - (require 'htmlr)" +If non-nil, newsticker.el will call this function whenever it +finds HTML-like tags in item descriptions. Possible functions +are `w3m-region', `w3-region', and `newsticker-htmlr-render'. +Newsticker automatically loads the respective package w3m, w3, or +htmlr if this option is set." :type '(choice :tag "Function" (const :tag "None" nil) (const :tag "w3" w3-region) @@ -286,6 +269,14 @@ "Start reading news. You may want to bind this to a key." (interactive) (newsticker-start t) ;; will start only if not running + ;; Load the html rendering packages + (if newsticker-html-renderer + (cond ((eq newsticker-html-renderer 'w3m-region) + (require 'w3m)) + ((eq newsticker-html-renderer 'w3-region) + (require 'w3-auto)) + ((eq newsticker-html-renderer 'newsticker-htmlr-render) + (require 'htmlr)))) (funcall newsticker-frontend)) ;; ====================================================================== ------------------------------------------------------------ revno: 105900 fixes bug(s): http://debbugs.gnu.org/9254 http://debbugs.gnu.org/9549 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2011-09-24 16:23:58 +0300 message: Fix vertical cursor motion when the newline is covered by a display string. src/indent.c (Fvertical_motion): Compute and apply the overshoot logic when moving up, not only when moving down. Fix the confusing name and values of the it_overshoot_expected variable; logic changes accordingly. (Bug#9254) (Bug#9549) src/xdisp.c (pos_visible_p): Produce correct pixel coordinates when CHARPOS is covered by a display string which includes newlines. (move_it_vertically_backward): Avoid inflooping when START_CHARPOS is covered by a display string with embedded newlines. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-09-24 11:36:53 +0000 +++ src/ChangeLog 2011-09-24 13:23:58 +0000 @@ -1,3 +1,15 @@ +2011-09-24 Eli Zaretskii + + * indent.c (Fvertical_motion): Compute and apply the overshoot + logic when moving up, not only when moving down. Fix the + confusing name and values of the it_overshoot_expected variable; + logic changes accordingly. (Bug#9254) (Bug#9549) + + * xdisp.c (pos_visible_p): Produce correct pixel coordinates when + CHARPOS is covered by a display string which includes newlines. + (move_it_vertically_backward): Avoid inflooping when START_CHARPOS + is covered by a display string with embedded newlines. + 2011-09-24 Michael Albinus * dbusbind.c (Fdbus_register_signal): Add match rule to === modified file 'src/indent.c' --- src/indent.c 2011-09-14 21:45:51 +0000 +++ src/indent.c 2011-09-24 13:23:58 +0000 @@ -2019,7 +2019,8 @@ else { EMACS_INT it_start; - int first_x, it_overshoot_expected IF_LINT (= 0); + int first_x, it_overshoot_count = 0; + int overshoot_handled = 0; itdata = bidi_shelve_cache (); SET_TEXT_POS (pt, PT, PT_BYTE); @@ -2028,22 +2029,23 @@ it_start = IT_CHARPOS (it); /* See comments below for why we calculate this. */ - if (XINT (lines) > 0) + if (it.cmp_it.id >= 0) + it_overshoot_count = 0; + else if (it.method == GET_FROM_STRING) { - if (it.cmp_it.id >= 0) - it_overshoot_expected = 1; - else if (it.method == GET_FROM_STRING) + const char *s = SSDATA (it.string); + const char *e = s + SBYTES (it.string); + while (s < e) { - const char *s = SSDATA (it.string); - const char *e = s + SBYTES (it.string); - while (s < e && *s != '\n') - ++s; - it_overshoot_expected = (s == e) ? -1 : 0; + if (*s++ == '\n') + it_overshoot_count++; } - else - it_overshoot_expected = (it.method == GET_FROM_IMAGE - || it.method == GET_FROM_STRETCH); + if (!it_overshoot_count) + it_overshoot_count == -1; } + else + it_overshoot_count = + !(it.method == GET_FROM_IMAGE || it.method == GET_FROM_STRETCH); /* Scan from the start of the line containing PT. If we don't do this, we start moving with IT->current_x == 0, while PT is @@ -2057,6 +2059,25 @@ tell, and it causes Bug#2694 . -- cyd */ move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); + /* IT may move too far if truncate-lines is on and PT lies + beyond the right margin. IT may also move too far if the + starting point is on a Lisp string that has embedded + newlines. In these cases, backtrack. */ + if (IT_CHARPOS (it) > it_start) + { + /* We need to backtrack also if the Lisp string contains no + newlines, but there is a newline right after it. In this + case, IT overshoots if there is an after-string just + before the newline. */ + if (it_overshoot_count < 0 + && it.method == GET_FROM_BUFFER + && it.c == '\n') + it_overshoot_count = 1; + if (it_overshoot_count > 0) + move_it_by_lines (&it, -it_overshoot_count); + + overshoot_handled = 1; + } if (XINT (lines) <= 0) { it.vpos = 0; @@ -2065,48 +2086,32 @@ if (XINT (lines) == 0 || IT_CHARPOS (it) > 0) move_it_by_lines (&it, max (INT_MIN, XINT (lines))); } + else if (overshoot_handled) + { + it.vpos = 0; + move_it_by_lines (&it, min (INT_MAX, XINT (lines))); + } else { - if (IT_CHARPOS (it) > it_start) - { - /* IT may move too far if truncate-lines is on and PT - lies beyond the right margin. In that case, - backtrack unless the starting point is on an image, - stretch glyph, composition, or Lisp string. */ - if (!it_overshoot_expected - /* Also, backtrack if the Lisp string contains no - newline, but there is a newline right after it. - In this case, IT overshoots if there is an - after-string just before the newline. */ - || (it_overshoot_expected < 0 - && it.method == GET_FROM_BUFFER - && it.c == '\n')) - move_it_by_lines (&it, -1); + /* Otherwise, we are at the first row occupied by PT, which + might span multiple screen lines (e.g., if it's on a + multi-line display string). We want to start from the + last line that it occupies. */ + if (it_start < ZV) + { + while (IT_CHARPOS (it) <= it_start) + { + it.vpos = 0; + move_it_by_lines (&it, 1); + } + if (XINT (lines) > 1) + move_it_by_lines (&it, min (INT_MAX, XINT (lines) - 1)); + } + else + { it.vpos = 0; move_it_by_lines (&it, min (INT_MAX, XINT (lines))); } - else - { - /* Otherwise, we are at the first row occupied by PT, - which might span multiple screen lines (e.g., if it's - on a multi-line display string). We want to start - from the last line that it occupies. */ - if (it_start < ZV) - { - while (IT_CHARPOS (it) <= it_start) - { - it.vpos = 0; - move_it_by_lines (&it, 1); - } - if (XINT (lines) > 1) - move_it_by_lines (&it, min (INT_MAX, XINT (lines) - 1)); - } - else - { - it.vpos = 0; - move_it_by_lines (&it, min (INT_MAX, XINT (lines))); - } - } } /* Move to the goal column, if one was specified. */ === modified file 'src/xdisp.c' --- src/xdisp.c 2011-09-21 08:13:18 +0000 +++ src/xdisp.c 2011-09-24 13:23:58 +0000 @@ -1210,6 +1210,34 @@ return line_top_y + line_height; } +/* Subroutine of pos_visible_p below. Extracts a display string, if + any, from the display spec given as its argument. */ +static Lisp_Object +string_from_display_spec (Lisp_Object spec) +{ + if (CONSP (spec)) + { + while (CONSP (spec)) + { + if (STRINGP (XCAR (spec))) + return XCAR (spec); + spec = XCDR (spec); + } + } + else if (VECTORP (spec)) + { + int i; + + for (i = 0; i < ASIZE (spec); i++) + { + if (STRINGP (AREF (spec, i))) + return AREF (spec, i); + } + return Qnil; + } + + return spec; +} /* Return 1 if position CHARPOS is visible in window W. CHARPOS < 0 means return info about WINDOW_END position. @@ -1304,6 +1332,136 @@ } } } + else if (IT_CHARPOS (it) != charpos) + { + Lisp_Object cpos = make_number (charpos); + Lisp_Object spec = Fget_char_property (cpos, Qdisplay, Qnil); + Lisp_Object string = string_from_display_spec (spec); + int newline_in_string = 0; + + if (STRINGP (string)) + { + const char *s = SSDATA (string); + const char *e = s + SBYTES (string); + while (s < e) + { + if (*s++ == '\n') + { + newline_in_string = 1; + break; + } + } + } + /* The tricky code below is needed because there's a + discrepancy between move_it_to and how we set cursor + when the display line ends in a newline from a + display string. move_it_to will stop _after_ such + display strings, whereas set_cursor_from_row + conspires with cursor_row_p to place the cursor on + the first glyph produced from the display string. */ + + /* We have overshoot PT because it is covered by a + display property whose value is a string. If the + string includes embedded newlines, we are also in the + wrong display line. Backtrack to the correct line, + where the display string begins. */ + if (newline_in_string) + { + Lisp_Object startpos, endpos; + EMACS_INT start, end; + struct it it3; + + /* Find the first and the last buffer positions + covered by the display string. */ + endpos = + Fnext_single_char_property_change (cpos, Qdisplay, + Qnil, Qnil); + startpos = + Fprevious_single_char_property_change (endpos, Qdisplay, + Qnil, Qnil); + start = XFASTINT (startpos); + end = XFASTINT (endpos); + /* Move to the last buffer position before the + display property. */ + start_display (&it3, w, top); + move_it_to (&it3, start - 1, -1, -1, -1, MOVE_TO_POS); + /* Move forward one more line if the position before + the display string is a newline or if it is the + rightmost character on a line that is + continued or word-wrapped. */ + if (it3.method == GET_FROM_BUFFER + && it3.c == '\n') + move_it_by_lines (&it3, 1); + else if (move_it_in_display_line_to (&it3, -1, + it3.current_x + + it3.pixel_width, + MOVE_TO_X) + == MOVE_LINE_CONTINUED) + { + move_it_by_lines (&it3, 1); + /* When we are under word-wrap, the #$@%! + move_it_by_lines moves 2 lines, so we need to + fix that up. */ + if (it3.line_wrap == WORD_WRAP) + move_it_by_lines (&it3, -1); + } + + /* Record the vertical coordinate of the display + line where we wound up. */ + top_y = it3.current_y; + if (it3.bidi_p) + { + /* When characters are reordered for display, + the character displayed to the left of the + display string could be _after_ the display + property in the logical order. Use the + smallest vertical position of these two. */ + start_display (&it3, w, top); + move_it_to (&it3, end + 1, -1, -1, -1, MOVE_TO_POS); + if (it3.current_y < top_y) + top_y = it3.current_y; + } + /* Move from the top of the window to the beginning + of the display line where the display string + begins. */ + start_display (&it3, w, top); + move_it_to (&it3, -1, 0, top_y, -1, MOVE_TO_X | MOVE_TO_Y); + /* Finally, advance the iterator until we hit the + first display element whose character position is + CHARPOS, or until the first newline from the + display string, which signals the end of the + display line. */ + while (get_next_display_element (&it3)) + { + PRODUCE_GLYPHS (&it3); + if (IT_CHARPOS (it3) == charpos + || ITERATOR_AT_END_OF_LINE_P (&it3)) + break; + set_iterator_to_next (&it3, 0); + } + top_x = it3.current_x - it3.pixel_width; + /* Normally, we would exit the above loop because we + found the display element whose character + position is CHARPOS. For the contingency that we + didn't, and stopped at the first newline from the + display string, move back over the glyphs + prfoduced from the string, until we find the + rightmost glyph not from the string. */ + if (IT_CHARPOS (it3) != charpos && EQ (it3.object, string)) + { + struct glyph *g = it3.glyph_row->glyphs[TEXT_AREA] + + it3.glyph_row->used[TEXT_AREA]; + + while (EQ ((g - 1)->object, string)) + { + --g; + top_x -= g->pixel_width; + } + xassert (g < it3.glyph_row->glyphs[TEXT_AREA] + + it3.glyph_row->used[TEXT_AREA]); + } + } + } *x = top_x; *y = max (top_y + max (0, it.max_ascent - it.ascent), window_top_y); @@ -8521,7 +8679,16 @@ move_it_to (&it2, start_pos, -1, -1, it2.vpos + 1, MOVE_TO_POS | MOVE_TO_VPOS); } - while (!IT_POS_VALID_AFTER_MOVE_P (&it2)); + while (!(IT_POS_VALID_AFTER_MOVE_P (&it2) + /* If we are in a display string which starts at START_POS, + and that display string includes a newline, and we are + right after that newline (i.e. at the beginning of a + display line), exit the loop, because otherwise we will + infloop, since move_it_to will see that it is already at + START_POS and will not move. */ + || (it2.method == GET_FROM_STRING + && IT_CHARPOS (it2) == start_pos + && SREF (it2.string, IT_STRING_BYTEPOS (it2) - 1) == '\n'))); xassert (IT_CHARPOS (*it) >= BEGV); SAVE_IT (it3, it2, it3data); ------------------------------------------------------------ revno: 105899 committer: Michael Albinus branch nick: trunk timestamp: Sat 2011-09-24 13:45:13 +0200 message: * net/dbus.el (dbus-unregister-object): Remove match rule of signals. Release services only if they are defined. (Bug#9581) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-09-23 23:55:52 +0000 +++ lisp/ChangeLog 2011-09-24 11:45:13 +0000 @@ -1,3 +1,8 @@ +2011-09-24 Michael Albinus + + * net/dbus.el (dbus-unregister-object): Remove match rule of signals. + Release services only if they are defined. (Bug#9581) + 2011-09-23 Richard Stallman * textmodes/paragraphs.el (forward-sentence): For backwards case, === modified file 'lisp/net/dbus.el' --- lisp/net/dbus.el 2011-05-23 17:57:17 +0000 +++ lisp/net/dbus.el 2011-09-24 11:45:13 +0000 @@ -143,7 +143,7 @@ (value (cdr object)) (entry (gethash key dbus-registered-objects-table)) ret) - ;; entry has the structure ((UNAME SERVICE PATH MEMBER) ...). + ;; entry has the structure ((UNAME SERVICE PATH MEMBER [RULE]) ...). ;; value has the structure ((SERVICE PATH [HANDLER]) ...). ;; MEMBER is either a string (the handler), or a cons cell (a ;; property value). UNAME and property values are not taken into @@ -154,11 +154,17 @@ (when (equal (car value) (butlast (cdr elt) (- (length (cdr elt)) (length (car value))))) + (setq ret t) ;; Compute new hash value. If it is empty, remove it from the ;; hash table. (unless (puthash key (delete elt entry) dbus-registered-objects-table) (remhash key dbus-registered-objects-table)) - (setq ret t))) + ;; Remove match rule of signals. + (let ((rule (nth 4 elt))) + (when (stringp rule) + (dbus-call-method + (car key) dbus-service-dbus dbus-path-dbus dbus-interface-dbus + "RemoveMatch" rule))))) ;; Check, whether there is still a registered function or property ;; for the given service. If not, unregister the service from the ;; bus. @@ -166,17 +172,18 @@ (let ((service (cadr elt)) (bus (car key)) found) - (maphash - (lambda (k v) - (dolist (e v) - (ignore-errors - (when (and (equal bus (car k)) (string-equal service (cadr e))) - (setq found t))))) - dbus-registered-objects-table) - (unless found - (dbus-call-method - bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus - "ReleaseName" service)))) + (when service + (maphash + (lambda (k v) + (dolist (e v) + (ignore-errors + (when (and (equal bus (car k)) (string-equal service (cadr e))) + (setq found t))))) + dbus-registered-objects-table) + (unless found + (dbus-call-method + bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus + "ReleaseName" service))))) ;; Return. ret)) ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.