Mercurial > emacs
changeset 108050:7e67a31551fc
Merge from mainline.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Fri, 16 Apr 2010 03:24:45 +0000 |
parents | 56ac0739b76d (current diff) b22d92cb789e (diff) |
children | 741b32aae521 |
files | |
diffstat | 11 files changed, 247 insertions(+), 182 deletions(-) [+] |
line wrap: on
line diff
--- a/etc/NEWS Thu Apr 15 22:47:23 2010 +0000 +++ b/etc/NEWS Fri Apr 16 03:24:45 2010 +0000 @@ -76,8 +76,8 @@ ** New scrolling commands `scroll-up-line' and `scroll-down-line' scroll a line instead of full screen. -** New variable `scroll-preserve-screen-position-commands' defines -a list of scroll command affected by `scroll-preserve-screen-position. +** New property `scroll-command' should be set on a command's symbol to +define it as a scroll command affected by `scroll-preserve-screen-position. * Editing Changes in Emacs 24.1
--- a/lisp/ChangeLog Thu Apr 15 22:47:23 2010 +0000 +++ b/lisp/ChangeLog Fri Apr 16 03:24:45 2010 +0000 @@ -1,3 +1,43 @@ +2010-04-16 Juri Linkov <juri@jurta.org> + + Move scrolling commands from simple.el to window.el + because their primitives are implemented in window.c. + + * simple.el (scroll-error-top-bottom) + (scroll-up-command, scroll-down-command, scroll-up-line) + (scroll-down-line, scroll-other-window-down) + (beginning-of-buffer-other-window, end-of-buffer-other-window): + * window.el (scroll-error-top-bottom) + (scroll-up-command, scroll-down-command, scroll-up-line) + (scroll-down-line, scroll-other-window-down) + (beginning-of-buffer-other-window, end-of-buffer-other-window): + Move from simple.el to window.el because their primitives are + implemented in window.c. + +2010-04-16 Juri Linkov <juri@jurta.org> + + * isearch.el (isearch-lookup-scroll-key): Check both + `isearch-scroll' and `scroll-command' properties. + (scroll-up, scroll-down): Remove `isearch-scroll' property. + + * mwheel.el (mwheel-scroll): Remove `isearch-scroll' property. + + * simple.el (scroll-up-command, scroll-down-command) + (scroll-up-line, scroll-down-line): Remove `isearch-scroll' property. + +2010-04-15 Juri Linkov <juri@jurta.org> + + * simple.el (scroll-up-command, scroll-down-command) + (scroll-up-line, scroll-down-line): Put `scroll-command' + property on the these symbols. Remove them from + `scroll-preserve-screen-position-commands'. + + * mwheel.el (mwheel-scroll): Put `scroll-command' and + `isearch-scroll' properties on the `mwheel-scroll' symbol. + Remove it from `scroll-preserve-screen-position-commands'. + + * isearch.el (isearch-allow-scroll): Doc fix. + 2010-04-15 Michael Albinus <michael.albinus@gmx.de> * net/tramp.el (tramp-error-with-buffer): Don't show the
--- a/lisp/isearch.el Thu Apr 15 22:47:23 2010 +0000 +++ b/lisp/isearch.el Fri Apr 16 03:24:45 2010 +0000 @@ -1708,9 +1708,10 @@ ;; attempts this, we scroll the text back again. ;; ;; We implement this feature with a property called `isearch-scroll'. -;; If a command's symbol has the value t for this property it is a -;; scrolling command. The feature needs to be enabled by setting the -;; customizable variable `isearch-allow-scroll' to a non-nil value. +;; If a command's symbol has the value t for this property or for the +;; `scroll-command' property, it is a scrolling command. The feature +;; needs to be enabled by setting the customizable variable +;; `isearch-allow-scroll' to a non-nil value. ;; ;; The universal argument commands (e.g. C-u) in simple.el are marked ;; as scrolling commands, and isearch.el has been amended to allow @@ -1727,12 +1728,11 @@ (if (fboundp 'w32-handle-scroll-bar-event) (put 'w32-handle-scroll-bar-event 'isearch-scroll t)) -;; Commands which scroll the window: +;; Commands which scroll the window (some scroll commands +;; already have the `scroll-command' property on them): (put 'recenter 'isearch-scroll t) (put 'recenter-top-bottom 'isearch-scroll t) (put 'reposition-window 'isearch-scroll t) -(put 'scroll-up 'isearch-scroll t) -(put 'scroll-down 'isearch-scroll t) ;; Commands which act on the other window (put 'list-buffers 'isearch-scroll t) @@ -1757,7 +1757,7 @@ "Whether scrolling is allowed during incremental search. If non-nil, scrolling commands can be used in Isearch mode. However, the current match will never scroll offscreen. -If nil, scolling commands will first cancel Isearch mode." +If nil, scrolling commands will first cancel Isearch mode." :type 'boolean :group 'isearch) @@ -1821,7 +1821,8 @@ (let* ((overriding-terminal-local-map nil) (binding (key-binding key-seq))) (and binding (symbolp binding) (commandp binding) - (eq (get binding 'isearch-scroll) t) + (or (eq (get binding 'isearch-scroll) t) + (eq (get binding 'scroll-command) t)) binding))) (defalias 'isearch-other-control-char 'isearch-other-meta-char)
--- a/lisp/mwheel.el Thu Apr 15 22:47:23 2010 +0000 +++ b/lisp/mwheel.el Fri Apr 16 03:24:45 2010 +0000 @@ -246,7 +246,7 @@ (run-with-timer mouse-wheel-inhibit-click-time nil 'mwheel-inhibit-click-timeout)))) -(add-to-list 'scroll-preserve-screen-position-commands 'mwheel-scroll) +(put 'mwheel-scroll 'scroll-command t) (defvar mwheel-installed-bindings nil)
--- a/lisp/simple.el Thu Apr 15 22:47:23 2010 +0000 +++ b/lisp/simple.el Fri Apr 16 03:24:45 2010 +0000 @@ -4745,157 +4745,7 @@ (define-globalized-minor-mode global-visual-line-mode visual-line-mode turn-on-visual-line-mode :lighter " vl") - -;;; Scrolling commands. - -;;; Scrolling commands which does not signal errors at top/bottom -;;; of buffer at first key-press (instead moves to top/bottom -;;; of buffer). - -(defcustom scroll-error-top-bottom nil - "Move point to top/bottom of buffer before signalling a scrolling error. -A value of nil means just signal an error if no more scrolling possible. -A value of t means point moves to the beginning or the end of the buffer -\(depending on scrolling direction) when no more scrolling possible. -When point is already on that position, then signal an error." - :type 'boolean - :group 'scrolling - :version "24.1") - -(defun scroll-up-command (&optional arg) - "Scroll text of selected window upward ARG lines; or near full screen if no ARG. -If `scroll-error-top-bottom' is non-nil and `scroll-up' cannot -scroll window further, move cursor to the bottom line. -When point is already on that position, then signal an error. -A near full screen is `next-screen-context-lines' less than a full screen. -Negative ARG means scroll downward. -If ARG is the atom `-', scroll downward by nearly full screen." - (interactive "^P") - (cond - ((null scroll-error-top-bottom) - (scroll-up arg)) - ((eq arg '-) - (scroll-down-command nil)) - ((< (prefix-numeric-value arg) 0) - (scroll-down-command (- (prefix-numeric-value arg)))) - ((eobp) - (scroll-up arg)) ; signal error - (t - (condition-case nil - (scroll-up arg) - (end-of-buffer - (if arg - ;; When scrolling by ARG lines can't be done, - ;; move by ARG lines instead. - (forward-line arg) - ;; When ARG is nil for full-screen scrolling, - ;; move to the bottom of the buffer. - (goto-char (point-max)))))))) - -(put 'scroll-up-command 'isearch-scroll t) -(add-to-list 'scroll-preserve-screen-position-commands 'scroll-up-command) - -(defun scroll-down-command (&optional arg) - "Scroll text of selected window down ARG lines; or near full screen if no ARG. -If `scroll-error-top-bottom' is non-nil and `scroll-down' cannot -scroll window further, move cursor to the top line. -When point is already on that position, then signal an error. -A near full screen is `next-screen-context-lines' less than a full screen. -Negative ARG means scroll upward. -If ARG is the atom `-', scroll upward by nearly full screen." - (interactive "^P") - (cond - ((null scroll-error-top-bottom) - (scroll-down arg)) - ((eq arg '-) - (scroll-up-command nil)) - ((< (prefix-numeric-value arg) 0) - (scroll-up-command (- (prefix-numeric-value arg)))) - ((bobp) - (scroll-down arg)) ; signal error - (t - (condition-case nil - (scroll-down arg) - (beginning-of-buffer - (if arg - ;; When scrolling by ARG lines can't be done, - ;; move by ARG lines instead. - (forward-line (- arg)) - ;; When ARG is nil for full-screen scrolling, - ;; move to the top of the buffer. - (goto-char (point-min)))))))) - -(put 'scroll-down-command 'isearch-scroll t) -(add-to-list 'scroll-preserve-screen-position-commands 'scroll-down-command) - -;;; Scrolling commands which scroll a line instead of full screen. - -(defun scroll-up-line (&optional arg) - "Scroll text of selected window upward ARG lines; or one line if no ARG. -If ARG is omitted or nil, scroll upward by one line. -This is different from `scroll-up-command' that scrolls a full screen." - (interactive "p") - (scroll-up (or arg 1))) - -(put 'scroll-up-line 'isearch-scroll t) -(add-to-list 'scroll-preserve-screen-position-commands 'scroll-up-line) - -(defun scroll-down-line (&optional arg) - "Scroll text of selected window down ARG lines; or one line if no ARG. -If ARG is omitted or nil, scroll down by one line. -This is different from `scroll-down-command' that scrolls a full screen." - (interactive "p") - (scroll-down (or arg 1))) - -(put 'scroll-down-line 'isearch-scroll t) -(add-to-list 'scroll-preserve-screen-position-commands 'scroll-down-line) - - -(defun scroll-other-window-down (lines) - "Scroll the \"other window\" down. -For more details, see the documentation for `scroll-other-window'." - (interactive "P") - (scroll-other-window - ;; Just invert the argument's meaning. - ;; We can do that without knowing which window it will be. - (if (eq lines '-) nil - (if (null lines) '- - (- (prefix-numeric-value lines)))))) - -(defun beginning-of-buffer-other-window (arg) - "Move point to the beginning of the buffer in the other window. -Leave mark at previous position. -With arg N, put point N/10 of the way from the true beginning." - (interactive "P") - (let ((orig-window (selected-window)) - (window (other-window-for-scrolling))) - ;; We use unwind-protect rather than save-window-excursion - ;; because the latter would preserve the things we want to change. - (unwind-protect - (progn - (select-window window) - ;; Set point and mark in that window's buffer. - (with-no-warnings - (beginning-of-buffer arg)) - ;; Set point accordingly. - (recenter '(t))) - (select-window orig-window)))) - -(defun end-of-buffer-other-window (arg) - "Move point to the end of the buffer in the other window. -Leave mark at previous position. -With arg N, put point N/10 of the way from the true end." - (interactive "P") - ;; See beginning-of-buffer-other-window for comments. - (let ((orig-window (selected-window)) - (window (other-window-for-scrolling))) - (unwind-protect - (progn - (select-window window) - (with-no-warnings - (end-of-buffer arg)) - (recenter '(t))) - (select-window orig-window)))) + (defun transpose-chars (arg) "Interchange characters around point, moving forward one character.
--- a/lisp/window.el Thu Apr 15 22:47:23 2010 +0000 +++ b/lisp/window.el Fri Apr 16 03:24:45 2010 +0000 @@ -1617,6 +1617,7 @@ (kill-buffer buffer) (bury-buffer buffer)))) + (defvar recenter-last-op nil "Indicates the last recenter operation performed. Possible values: `top', `middle', `bottom', integer or float numbers.") @@ -1709,6 +1710,154 @@ (define-key global-map [?\M-r] 'move-to-window-line-top-bottom) +;;; Scrolling commands. + +;;; Scrolling commands which does not signal errors at top/bottom +;;; of buffer at first key-press (instead moves to top/bottom +;;; of buffer). + +(defcustom scroll-error-top-bottom nil + "Move point to top/bottom of buffer before signalling a scrolling error. +A value of nil means just signal an error if no more scrolling possible. +A value of t means point moves to the beginning or the end of the buffer +\(depending on scrolling direction) when no more scrolling possible. +When point is already on that position, then signal an error." + :type 'boolean + :group 'scrolling + :version "24.1") + +(defun scroll-up-command (&optional arg) + "Scroll text of selected window upward ARG lines; or near full screen if no ARG. +If `scroll-error-top-bottom' is non-nil and `scroll-up' cannot +scroll window further, move cursor to the bottom line. +When point is already on that position, then signal an error. +A near full screen is `next-screen-context-lines' less than a full screen. +Negative ARG means scroll downward. +If ARG is the atom `-', scroll downward by nearly full screen." + (interactive "^P") + (cond + ((null scroll-error-top-bottom) + (scroll-up arg)) + ((eq arg '-) + (scroll-down-command nil)) + ((< (prefix-numeric-value arg) 0) + (scroll-down-command (- (prefix-numeric-value arg)))) + ((eobp) + (scroll-up arg)) ; signal error + (t + (condition-case nil + (scroll-up arg) + (end-of-buffer + (if arg + ;; When scrolling by ARG lines can't be done, + ;; move by ARG lines instead. + (forward-line arg) + ;; When ARG is nil for full-screen scrolling, + ;; move to the bottom of the buffer. + (goto-char (point-max)))))))) + +(put 'scroll-up-command 'scroll-command t) + +(defun scroll-down-command (&optional arg) + "Scroll text of selected window down ARG lines; or near full screen if no ARG. +If `scroll-error-top-bottom' is non-nil and `scroll-down' cannot +scroll window further, move cursor to the top line. +When point is already on that position, then signal an error. +A near full screen is `next-screen-context-lines' less than a full screen. +Negative ARG means scroll upward. +If ARG is the atom `-', scroll upward by nearly full screen." + (interactive "^P") + (cond + ((null scroll-error-top-bottom) + (scroll-down arg)) + ((eq arg '-) + (scroll-up-command nil)) + ((< (prefix-numeric-value arg) 0) + (scroll-up-command (- (prefix-numeric-value arg)))) + ((bobp) + (scroll-down arg)) ; signal error + (t + (condition-case nil + (scroll-down arg) + (beginning-of-buffer + (if arg + ;; When scrolling by ARG lines can't be done, + ;; move by ARG lines instead. + (forward-line (- arg)) + ;; When ARG is nil for full-screen scrolling, + ;; move to the top of the buffer. + (goto-char (point-min)))))))) + +(put 'scroll-down-command 'scroll-command t) + +;;; Scrolling commands which scroll a line instead of full screen. + +(defun scroll-up-line (&optional arg) + "Scroll text of selected window upward ARG lines; or one line if no ARG. +If ARG is omitted or nil, scroll upward by one line. +This is different from `scroll-up-command' that scrolls a full screen." + (interactive "p") + (scroll-up (or arg 1))) + +(put 'scroll-up-line 'scroll-command t) + +(defun scroll-down-line (&optional arg) + "Scroll text of selected window down ARG lines; or one line if no ARG. +If ARG is omitted or nil, scroll down by one line. +This is different from `scroll-down-command' that scrolls a full screen." + (interactive "p") + (scroll-down (or arg 1))) + +(put 'scroll-down-line 'scroll-command t) + + +(defun scroll-other-window-down (lines) + "Scroll the \"other window\" down. +For more details, see the documentation for `scroll-other-window'." + (interactive "P") + (scroll-other-window + ;; Just invert the argument's meaning. + ;; We can do that without knowing which window it will be. + (if (eq lines '-) nil + (if (null lines) '- + (- (prefix-numeric-value lines)))))) + +(defun beginning-of-buffer-other-window (arg) + "Move point to the beginning of the buffer in the other window. +Leave mark at previous position. +With arg N, put point N/10 of the way from the true beginning." + (interactive "P") + (let ((orig-window (selected-window)) + (window (other-window-for-scrolling))) + ;; We use unwind-protect rather than save-window-excursion + ;; because the latter would preserve the things we want to change. + (unwind-protect + (progn + (select-window window) + ;; Set point and mark in that window's buffer. + (with-no-warnings + (beginning-of-buffer arg)) + ;; Set point accordingly. + (recenter '(t))) + (select-window orig-window)))) + +(defun end-of-buffer-other-window (arg) + "Move point to the end of the buffer in the other window. +Leave mark at previous position. +With arg N, put point N/10 of the way from the true end." + (interactive "P") + ;; See beginning-of-buffer-other-window for comments. + (let ((orig-window (selected-window)) + (window (other-window-for-scrolling))) + (unwind-protect + (progn + (select-window window) + (with-no-warnings + (end-of-buffer arg)) + (recenter '(t))) + (select-window orig-window)))) + + (defvar mouse-autoselect-window-timer nil "Timer used by delayed window autoselection.")
--- a/lwlib/ChangeLog Thu Apr 15 22:47:23 2010 +0000 +++ b/lwlib/ChangeLog Fri Apr 16 03:24:45 2010 +0000 @@ -1,3 +1,7 @@ +2010-04-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * xlwmenu.c (facename_changed): Put function in #ifdef HAVE_XFT. + 2010-04-11 Dan Nicolaescu <dann@ics.uci.edu> * Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE)
--- a/lwlib/xlwmenu.c Thu Apr 15 22:47:23 2010 +0000 +++ b/lwlib/xlwmenu.c Fri Apr 16 03:24:45 2010 +0000 @@ -2135,6 +2135,7 @@ XtFree ((char *) mw->menu.windows); } +#ifdef HAVE_XFT static int facename_changed (XlwMenuWidget newmw, XlwMenuWidget oldmw) @@ -2144,6 +2145,7 @@ we just want to do a redisplay. */ return newmw->menu.faceName != oldmw->menu.faceName; } +#endif static Boolean XlwMenuSetValues (current, request, new)
--- a/src/ChangeLog Thu Apr 15 22:47:23 2010 +0000 +++ b/src/ChangeLog Fri Apr 16 03:24:45 2010 +0000 @@ -1,3 +1,19 @@ +2010-04-16 Ken Brown <kbrown@cornell.edu> (tiny change) + + * s/cygwin.h: Avoid linking against static libgcc. + +2010-04-15 Juri Linkov <juri@jurta.org> + + * window.c: Add Qscroll_command. + Remove Vscroll_preserve_screen_position_commands. + (window_scroll_pixel_based, window_scroll_line_based): Check the + `scroll-command' property on the last command instead of searching + the last command in Vscroll_preserve_screen_position_commands. + (syms_of_window): Initialize and staticpro `Qscroll_command'. + Put Qscroll_command property on Qscroll_up and Qscroll_down. + (scroll-preserve-screen-position): Doc fix. + (Vscroll_preserve_screen_position_commands): Remove variable. + 2010-04-15 Dan Nicolaescu <dann@ics.uci.edu> * xdisp.c (message): Do not use NO_ARG_ARRAY.
--- a/src/s/cygwin.h Thu Apr 15 22:47:23 2010 +0000 +++ b/src/s/cygwin.h Fri Apr 16 03:24:45 2010 +0000 @@ -132,6 +132,14 @@ returns ENOSYS. A workaround is to set G_SLICE=always-malloc. */ #define G_SLICE_ALWAYS_MALLOC +/* Don't link against static libgcc */ +#define LIB_GCC + +/* Don't list system libs on link command line */ +#define LIB_STANDARD +#define LIB_MATH +#define LIBS_DEBUG + /* the end */ /* arch-tag: 5ae7ba00-83b0-4ab3-806a-3e845779191b
--- a/src/window.c Thu Apr 15 22:47:23 2010 +0000 +++ b/src/window.c Fri Apr 16 03:24:45 2010 +0000 @@ -54,7 +54,7 @@ Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configuration_p; Lisp_Object Qdisplay_buffer; -Lisp_Object Qscroll_up, Qscroll_down; +Lisp_Object Qscroll_up, Qscroll_down, Qscroll_command; Lisp_Object Qwindow_size_fixed; extern Lisp_Object Qleft_margin, Qright_margin; @@ -168,10 +168,6 @@ Lisp_Object Vscroll_preserve_screen_position; -/* List of commands affected by `Vscroll_preserve_screen_position'. */ - -Lisp_Object Vscroll_preserve_screen_position_commands; - /* Non-nil means that text is inserted before window's markers. */ Lisp_Object Vwindow_point_insertion_type; @@ -4946,12 +4942,13 @@ if (!NILP (Vscroll_preserve_screen_position)) { /* We preserve the goal pixel coordinate across consecutive - calls to scroll-up or scroll-down. This avoids the + calls to scroll-up, scroll-down and other commands that + have the `scroll-command' property. This avoids the possibility of point becoming "stuck" on a tall line when scrolling by one line. */ if (window_scroll_pixel_based_preserve_y < 0 - || NILP (Fmemq (current_kboard->Vlast_command, - Vscroll_preserve_screen_position_commands))) + || !SYMBOLP (current_kboard->Vlast_command) + || NILP (Fget (current_kboard->Vlast_command, Qscroll_command))) { start_display (&it, w, start); move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); @@ -5211,8 +5208,8 @@ if (!NILP (Vscroll_preserve_screen_position)) { if (window_scroll_preserve_vpos <= 0 - || NILP (Fmemq (current_kboard->Vlast_command, - Vscroll_preserve_screen_position_commands))) + || !SYMBOLP (current_kboard->Vlast_command) + || NILP (Fget (current_kboard->Vlast_command, Qscroll_command))) { struct position posit = *compute_motion (startpos, 0, 0, 0, @@ -7180,6 +7177,12 @@ Qscroll_down = intern_c_string ("scroll-down"); staticpro (&Qscroll_down); + Qscroll_command = intern_c_string ("scroll-command"); + staticpro (&Qscroll_command); + + Fput (Qscroll_up, Qscroll_command, Qt); + Fput (Qscroll_down, Qscroll_command, Qt); + Qwindow_size_fixed = intern_c_string ("window-size-fixed"); staticpro (&Qwindow_size_fixed); Fset (Qwindow_size_fixed, Qnil); @@ -7270,18 +7273,10 @@ command moved it vertically out of the window, e.g. when scrolling by full screens. Any other value means point always keeps its screen position. -Scroll commands are defined by the variable -`scroll-preserve-screen-position-commands'. */); +Scroll commands should have the `scroll-command' property +on their symbols to be controlled by this variable. */); Vscroll_preserve_screen_position = Qnil; - DEFVAR_LISP ("scroll-preserve-screen-position-commands", - &Vscroll_preserve_screen_position_commands, - doc: /* A list of commands whose scrolling should keep screen position unchanged. -This list defines the names of scroll commands affected by the variable -`scroll-preserve-screen-position'. */); - Vscroll_preserve_screen_position_commands = - Fcons (Qscroll_down, Fcons (Qscroll_up, Qnil)); - DEFVAR_LISP ("window-point-insertion-type", &Vwindow_point_insertion_type, doc: /* Type of marker to use for `window-point'. */); Vwindow_point_insertion_type = Qnil;