------------------------------------------------------------ revno: 117719 committer: martin rudalics branch nick: trunk timestamp: Thu 2014-08-21 10:40:29 +0200 message: Handle failed attempts to split a side window (Bug#18304). * window.el (window--side-window-p): New function. (split-window, window-splittable-p): Use window--side-window-p to determine whether WINDOW can be split (Bug#18304). * calendar/calendar.el (calendar-basic-setup): Fix one call of `window-splittable-p' and add another (Bug#18304). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-08-20 20:07:00 +0000 +++ lisp/ChangeLog 2014-08-21 08:40:29 +0000 @@ -1,3 +1,11 @@ +2014-08-21 Martin Rudalics + + * window.el (window--side-window-p): New function. + (split-window, window-splittable-p): Use window--side-window-p to + determine whether WINDOW can be split (Bug#18304). + * calendar/calendar.el (calendar-basic-setup): Fix one call of + `window-splittable-p' and add another (Bug#18304). + 2014-08-20 Sam Steingold * progmodes/python.el (python-new-pythonpath): Extract from === modified file 'lisp/calendar/calendar.el' --- lisp/calendar/calendar.el 2014-06-13 19:37:52 +0000 +++ lisp/calendar/calendar.el 2014-08-21 08:40:29 +0000 @@ -1423,10 +1423,16 @@ ;; the right thing in that case. ;; ;; Is this a wide frame? If so, split it horizontally. - (if (window-splittable-p t) (split-window-right)) + + ;; The following doesn't sound useful: If we split horizontally + ;; here, the subsequent `pop-to-buffer' will likely split again + ;; horizontally and we end up with three side-by-side windows. + (when (window-splittable-p (selected-window) t) + (split-window-right)) (pop-to-buffer calendar-buffer) ;; Has the window already been split vertically? (when (and (not (window-dedicated-p)) + (window-splittable-p (selected-window)) (window-full-height-p)) (let ((win (split-window-below))) ;; In the upper window, show whatever was visible before. === modified file 'lisp/window.el' --- lisp/window.el 2014-08-11 00:59:34 +0000 +++ lisp/window.el 2014-08-21 08:40:29 +0000 @@ -743,6 +743,15 @@ (integer :tag "Number" :value 3 :size 5))) :group 'windows) +(defun window--side-window-p (window) + "Return non-nil if WINDOW is a side window or the parent of one." + (or (window-parameter window 'window-side) + (and (window-child window) + (or (window-parameter + (window-child window) 'window-side) + (window-parameter + (window-last-child window) 'window-side))))) + (defun window--major-non-side-window (&optional frame) "Return the major non-side window of frame FRAME. The optional argument FRAME must be a live frame and defaults to @@ -4378,12 +4387,7 @@ ;; side window, throw an error unless `window-combination-resize' ;; equals 'side. ((and (not (eq window-combination-resize 'side)) - (or (window-parameter window 'window-side) - (and (window-child window) - (or (window-parameter - (window-child window) 'window-side) - (window-parameter - (window-last-child window) 'window-side))))) + (window--side-window-p window)) (error "Cannot split side window or parent of side window")) ;; If `window-combination-resize' is 'side and window has a side ;; window sibling, bind `window-combination-limit' to t. @@ -5798,7 +5802,7 @@ wide as `split-width-threshold'. - When WINDOW is split evenly, the emanating windows are at least `window-min-width' or two (whichever is larger) columns wide." - (when (window-live-p window) + (when (and (window-live-p window) (not (window--side-window-p window))) (with-current-buffer (window-buffer window) (if horizontal ;; A window can be split horizontally when its width is not ------------------------------------------------------------ revno: 117718 committer: Glenn Morris branch nick: trunk timestamp: Wed 2014-08-20 16:07:00 -0400 message: ChangeLog fix Ref: http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01038.html diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-08-20 15:33:10 +0000 +++ lisp/ChangeLog 2014-08-20 20:07:00 +0000 @@ -75,14 +75,15 @@ 2014-08-13 Eric S. Raymond + * vc/vc.git.el (vc-git-resolve-when-done): New function. + Call "git add" when there are no longer conflict markers. + +2014-08-13 Rüdiger Sonderfeld + * vc/vc.git.el (vc-git-find-file-hook): New function. - Adds support for calling smerge on a conflicted file, and calling - "git add" when there are no longer conflict markers in a saved file. - This is a completed version of Rüdiger Sonderfeld's proposal. + Adds support for calling smerge (and resolve) on a conflicted file. (vc-git-conflicted-files): New function. - Integrate Rüdiger Sonderfeld's code for detecting conflicted files - using a status listing. Useful in itself and a step towards better - smerge support. + Useful in itself and a step towards better smerge support. 2014-08-12 Stefan Monnier ------------------------------------------------------------ revno: 117717 committer: Sam Steingold branch nick: trunk timestamp: Wed 2014-08-20 11:33:10 -0400 message: Extract python-new-pythonpath to handle PYTHONPATH in user code * lisp/progmodes/python.el (python-new-pythonpath): Extract from `python-shell-calculate-process-environment'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-08-18 19:28:40 +0000 +++ lisp/ChangeLog 2014-08-20 15:33:10 +0000 @@ -1,3 +1,8 @@ +2014-08-20 Sam Steingold + + * progmodes/python.el (python-new-pythonpath): Extract from + `python-shell-calculate-process-environment'. + 2014-08-18 Thierry Volpiatto * emacs-lisp/eldoc.el (eldoc-highlight-function-argument): Add support === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2014-08-04 21:35:17 +0000 +++ lisp/progmodes/python.el 2014-08-20 15:33:10 +0000 @@ -2069,6 +2069,16 @@ (executable-find python-shell-interpreter) python-shell-interpreter-args))) +(defun python-new-pythonpath () + "Calculate the new PYTHONPATH value from `python-shell-extra-pythonpaths'." + (let ((pythonpath (getenv "PYTHONPATH")) + (extra (mapconcat 'identity + python-shell-extra-pythonpaths + path-separator))) + (if pythonpath + (concat extra path-separator pythonpath) + extra))) + (defun python-shell-calculate-process-environment () "Calculate process environment given `python-shell-virtualenv-path'." (let ((process-environment (append @@ -2078,13 +2088,7 @@ (directory-file-name python-shell-virtualenv-path) nil))) (when python-shell-extra-pythonpaths - (setenv "PYTHONPATH" - (format "%s%s%s" - (mapconcat 'identity - python-shell-extra-pythonpaths - path-separator) - path-separator - (or (getenv "PYTHONPATH") "")))) + (setenv "PYTHONPATH" (python-new-pythonpath))) (if (not virtualenv) process-environment (setenv "PYTHONHOME" nil) ------------------------------------------------------------ revno: 117716 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2014-08-20 17:41:15 +0300 message: Remove 16-bit limitations in scroll bar position reporting on MS-Windows. src/w32term.c (w32_scroll_bar_handle_click) (w32_horizontal_scroll_bar_handle_click) (x_scroll_bar_report_motion) (x_horizontal_scroll_bar_report_motion): For SB_THUMBPOSITION and SB_THUMBTRACK, use the 32-bit position information returned by GetScrollInfo, not the 16-bit information returned in the Windows message sent to us. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-08-19 15:08:02 +0000 +++ src/ChangeLog 2014-08-20 14:41:15 +0000 @@ -1,3 +1,13 @@ +2014-08-20 Eli Zaretskii + + * w32term.c (w32_scroll_bar_handle_click) + (w32_horizontal_scroll_bar_handle_click) + (x_scroll_bar_report_motion) + (x_horizontal_scroll_bar_report_motion): For SB_THUMBPOSITION and + SB_THUMBTRACK, use the 32-bit position information returned by + GetScrollInfo, not the 16-bit information returned in the Windows + message sent to us. + 2014-08-19 Eli Zaretskii * w32term.c (w32_horizontal_scroll_bar_handle_click): Fix the === modified file 'src/w32term.c' --- src/w32term.c 2014-08-19 15:08:02 +0000 +++ src/w32term.c 2014-08-20 14:41:15 +0000 @@ -4166,17 +4166,24 @@ int y; int dragging = bar->dragging; SCROLLINFO si; + int sb_event = LOWORD (msg->msg.wParam); si.cbSize = sizeof (si); - si.fMask = SIF_POS; + if (sb_event == SB_THUMBTRACK) + si.fMask = SIF_TRACKPOS; + else + si.fMask = SIF_POS; GetScrollInfo ((HWND) msg->msg.lParam, SB_CTL, &si); - y = si.nPos; + if (sb_event == SB_THUMBTRACK) + y = si.nTrackPos; + else + y = si.nPos; bar->dragging = 0; FRAME_DISPLAY_INFO (f)->last_mouse_scroll_bar_pos = msg->msg.wParam; - switch (LOWORD (msg->msg.wParam)) + switch (sb_event) { case SB_LINEDOWN: emacs_event->part = scroll_bar_down_arrow; @@ -4200,8 +4207,6 @@ break; case SB_THUMBTRACK: case SB_THUMBPOSITION: - if (VERTICAL_SCROLL_BAR_TOP_RANGE (f, bar->height) <= 0xffff) - y = HIWORD (msg->msg.wParam); bar->dragging = 1; /* ??????? */ emacs_event->part = scroll_bar_handle; @@ -4275,17 +4280,25 @@ int x, y; int dragging = bar->dragging; SCROLLINFO si; + int sb_event = LOWORD (msg->msg.wParam); si.cbSize = sizeof (si); - si.fMask = SIF_POS | SIF_PAGE | SIF_RANGE; + if (sb_event == SB_THUMBTRACK) + si.fMask = SIF_TRACKPOS | SIF_PAGE | SIF_RANGE; + else + si.fMask = SIF_POS | SIF_PAGE | SIF_RANGE; + GetScrollInfo ((HWND) msg->msg.lParam, SB_CTL, &si); - x = si.nPos; - y = si.nMax - si.nPos - si.nPage; + if (sb_event == SB_THUMBTRACK) + x = si.nTrackPos; + else + x = si.nPos; + y = si.nMax - x - si.nPage; bar->dragging = 0; FRAME_DISPLAY_INFO (f)->last_mouse_scroll_bar_pos = msg->msg.wParam; - switch (LOWORD (msg->msg.wParam)) + switch (sb_event) { case SB_LINELEFT: emacs_event->part = scroll_bar_left_arrow; @@ -4309,11 +4322,6 @@ break; case SB_THUMBTRACK: case SB_THUMBPOSITION: - if (HORIZONTAL_SCROLL_BAR_LEFT_RANGE (f, bar->width) <= 0xffff) - { - x = HIWORD (msg->msg.wParam); - y = si.nMax - x - si.nPage; - } bar->dragging = 1; emacs_event->part = scroll_bar_horizontal_handle; @@ -4378,6 +4386,7 @@ int pos; int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, bar->height); SCROLLINFO si; + int sb_event = LOWORD (dpyinfo->last_mouse_scroll_bar_pos); block_input (); @@ -4385,28 +4394,21 @@ *bar_window = bar->window; si.cbSize = sizeof (si); - si.fMask = SIF_POS | SIF_PAGE | SIF_RANGE; + if (sb_event == SB_THUMBTRACK) + si.fMask = SIF_TRACKPOS | SIF_PAGE | SIF_RANGE; + else + si.fMask = SIF_POS | SIF_PAGE | SIF_RANGE; GetScrollInfo (w, SB_CTL, &si); - pos = si.nPos; + if (sb_event == SB_THUMBTRACK) + pos = si.nTrackPos; + else + pos = si.nPos; top_range = si.nMax - si.nPage + 1; - switch (LOWORD (dpyinfo->last_mouse_scroll_bar_pos)) - { - case SB_THUMBPOSITION: - case SB_THUMBTRACK: - *part = scroll_bar_handle; - if (VERTICAL_SCROLL_BAR_TOP_RANGE (f, bar->height) <= 0xffff) - pos = HIWORD (dpyinfo->last_mouse_scroll_bar_pos); - break; - case SB_LINEDOWN: - *part = scroll_bar_handle; - pos++; - break; - default: - *part = scroll_bar_handle; - break; - } + *part = scroll_bar_handle; + if (sb_event == SB_LINEDOWN) + pos++; XSETINT (*x, pos); XSETINT (*y, top_range); @@ -4434,6 +4436,7 @@ int pos; int left_range = HORIZONTAL_SCROLL_BAR_LEFT_RANGE (f, bar->width); SCROLLINFO si; + int sb_event = LOWORD (dpyinfo->last_mouse_scroll_bar_pos); block_input (); @@ -4441,28 +4444,22 @@ *bar_window = bar->window; si.cbSize = sizeof (si); - si.fMask = SIF_POS | SIF_PAGE | SIF_RANGE; + if (sb_event == SB_THUMBTRACK) + si.fMask = SIF_TRACKPOS | SIF_PAGE | SIF_RANGE; + else + si.fMask = SIF_POS | SIF_PAGE | SIF_RANGE; GetScrollInfo (w, SB_CTL, &si); - pos = si.nPos; + if (sb_event == SB_THUMBTRACK) + pos = si.nTrackPos; + else + pos = si.nPos; left_range = si.nMax - si.nPage + 1; - switch (LOWORD (dpyinfo->last_mouse_scroll_bar_pos)) - { - case SB_THUMBPOSITION: - case SB_THUMBTRACK: - *part = scroll_bar_handle; - if (HORIZONTAL_SCROLL_BAR_LEFT_RANGE (f, bar->width) <= 0xffff) - pos = HIWORD (dpyinfo->last_mouse_scroll_bar_pos); - break; - case SB_LINERIGHT: - *part = scroll_bar_handle; - pos++; - break; - default: - *part = scroll_bar_handle; - break; - } + *part = scroll_bar_handle; + if (sb_event == SB_LINERIGHT) + pos++; + XSETINT (*y, pos); XSETINT (*x, left_range); ------------------------------------------------------------ revno: 117715 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2014-08-19 18:08:02 +0300 message: Fix horizontal scroll bar dragging in R2L paragraphs. src/w32term.c (w32_horizontal_scroll_bar_handle_click): Fix the second coordinate ('y') reported for dragging the horizontal scroll bar thumb. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-08-19 00:51:33 +0000 +++ src/ChangeLog 2014-08-19 15:08:02 +0000 @@ -1,3 +1,9 @@ +2014-08-19 Eli Zaretskii + + * w32term.c (w32_horizontal_scroll_bar_handle_click): Fix the + second coordinate ('y') reported for dragging the horizontal + scroll bar thumb. + 2014-08-19 YAMAMOTO Mitsuharu * xdisp.c (erase_phys_cursor): Fix confusion between window-relative === modified file 'src/w32term.c' --- src/w32term.c 2014-08-16 15:47:38 +0000 +++ src/w32term.c 2014-08-19 15:08:02 +0000 @@ -4310,7 +4310,10 @@ case SB_THUMBTRACK: case SB_THUMBPOSITION: if (HORIZONTAL_SCROLL_BAR_LEFT_RANGE (f, bar->width) <= 0xffff) - x = HIWORD (msg->msg.wParam); + { + x = HIWORD (msg->msg.wParam); + y = si.nMax - x - si.nPage; + } bar->dragging = 1; emacs_event->part = scroll_bar_horizontal_handle; ------------------------------------------------------------ revno: 117714 committer: YAMAMOTO Mitsuharu branch nick: trunk timestamp: Tue 2014-08-19 09:51:33 +0900 message: * xdisp.c (erase_phys_cursor): Fix confusion between window-relative and text area-relative x-coordinates. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-08-17 14:58:04 +0000 +++ src/ChangeLog 2014-08-19 00:51:33 +0000 @@ -1,3 +1,8 @@ +2014-08-19 YAMAMOTO Mitsuharu + + * xdisp.c (erase_phys_cursor): Fix confusion between window-relative + and text area-relative x-coordinates. + 2014-08-17 Eli Zaretskii Avoid overwriting the reversed_p flags in the glyph matrices when === modified file 'src/xdisp.c' --- src/xdisp.c 2014-08-17 14:58:04 +0000 +++ src/xdisp.c 2014-08-19 00:51:33 +0000 @@ -27370,7 +27370,7 @@ /* Maybe clear the display under the cursor. */ if (w->phys_cursor_type == HOLLOW_BOX_CURSOR) { - int x, y, left_x; + int x, y; int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w); int width; @@ -27379,13 +27379,15 @@ goto mark_cursor_off; width = cursor_glyph->pixel_width; - left_x = window_box_left_offset (w, TEXT_AREA); x = w->phys_cursor.x; - if (x < left_x) - width -= left_x - x; + if (x < 0) + { + width += x; + x = 0; + } width = min (width, window_box_width (w, TEXT_AREA) - x); y = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, cursor_row->y)); - x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, max (x, left_x)); + x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, x); if (width > 0) FRAME_RIF (f)->clear_frame_area (f, x, y, width, cursor_row->visible_height); ------------------------------------------------------------ revno: 117713 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18048 author: Thierry Volpiatto committer: Stefan Monnier branch nick: trunk timestamp: Mon 2014-08-18 15:28:40 -0400 message: * lisp/emacs-lisp/eldoc.el (eldoc-highlight-function-argument): Add support for &key args. * emacs-lisp/eldoc.el (eldoc-argument-case): Obsolete and change default. (eldoc-function-argstring-format): Remove. (eldoc-function-argstring): Always return upcase args. Use help-make-usage. Don't add parens. (eldoc-get-fnsym-args-string): Don't obey eldoc-argument-case since it's too late to do it right (bug#18048). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-08-18 14:39:26 +0000 +++ lisp/ChangeLog 2014-08-18 19:28:40 +0000 @@ -1,3 +1,17 @@ +2014-08-18 Thierry Volpiatto + + * emacs-lisp/eldoc.el (eldoc-highlight-function-argument): Add support + for &key args (bug#18048). + +2014-08-18 Stefan Monnier + + * emacs-lisp/eldoc.el (eldoc-argument-case): Obsolete and change default. + (eldoc-function-argstring-format): Remove. + (eldoc-function-argstring): Always return upcase args. + Use help-make-usage. Don't add parens. + (eldoc-get-fnsym-args-string): Don't obey eldoc-argument-case since + it's too late to do it right (bug#18048). + 2014-08-18 Eli Zaretskii * scroll-bar.el (scroll-bar-horizontal-drag-1) === modified file 'lisp/emacs-lisp/eldoc.el' --- lisp/emacs-lisp/eldoc.el 2014-03-31 01:31:17 +0000 +++ lisp/emacs-lisp/eldoc.el 2014-08-18 19:28:40 +0000 @@ -48,6 +48,7 @@ ;;; Code: (require 'help-fns) ;For fundoc-usage handling functions. +(require 'cl-lib) (defgroup eldoc nil "Show function arglist or variable docstring in echo area." @@ -75,7 +76,7 @@ :type '(choice string (const :tag "None" nil)) :group 'eldoc) -(defcustom eldoc-argument-case 'upcase +(defcustom eldoc-argument-case #'identity "Case to display argument names of functions, as a symbol. This has two preferred values: `upcase' or `downcase'. Actually, any name of a function which takes a string as an argument and @@ -87,6 +88,7 @@ (function-item downcase) function) :group 'eldoc) +(make-obsolete-variable 'eldoc-argument-case nil "24.5") (defcustom eldoc-echo-area-use-multiline-p 'truncate-sym-name-if-fit "Allow long ElDoc messages to resize echo area display. @@ -341,12 +343,7 @@ (defun eldoc-get-fnsym-args-string (sym &optional index) "Return a string containing the parameter list of the function SYM. If SYM is a subr and no arglist is obtainable from the docstring -or elsewhere, return a 1-line docstring. Calls the functions -`eldoc-function-argstring-format' and -`eldoc-highlight-function-argument' to format the result. The -former calls `eldoc-argument-case'; the latter gives the -function name `font-lock-function-name-face', and optionally -highlights argument number INDEX." +or elsewhere, return a 1-line docstring." (let (args doc advertised) (cond ((not (and sym (symbolp sym) (fboundp sym)))) ((and (eq sym (aref eldoc-last-data 0)) @@ -356,12 +353,7 @@ advertised-signature-table t))) (setq args advertised)) ((setq doc (help-split-fundoc (documentation sym t) sym)) - (setq args (car doc)) - ;; Remove any enclosing (), since e-function-argstring adds them. - (string-match "\\`[^ )]* ?" args) - (setq args (substring args (match-end 0))) - (if (string-match-p ")\\'" args) - (setq args (substring args 0 -1)))) + (setq args (car doc))) (t (setq args (help-function-arglist sym)))) (if args @@ -372,8 +364,7 @@ (setq args doc)) ; use stored value ;; Change case, highlight, truncate. (if args - (eldoc-highlight-function-argument - sym (eldoc-function-argstring-format args) index)))) + (eldoc-highlight-function-argument sym args index)))) (defun eldoc-highlight-function-argument (sym args index) "Highlight argument INDEX in ARGS list for function SYM. @@ -388,6 +379,30 @@ ;; (defun NAME ARGLIST [DOCSTRING] BODY...) case? ;; The problem is there is no robust way to determine if ;; the current argument is indeed a docstring. + + ;; When `&key' is used finding position based on `index' + ;; would be wrong, so find the arg at point and determine + ;; position in ARGS based on this current arg. + (when (string-match "&key" args) + (let* (case-fold-search + (cur-w (current-word)) + (limit (save-excursion + (when (re-search-backward (symbol-name sym) nil t) + (match-end 0)))) + (cur-a (if (string-match ":\\([^ ()]*\\)" cur-w) + (substring cur-w 1) + (save-excursion + (when (re-search-backward ":\\([^ ()\n]*\\)" limit t) + (match-string 1)))))) + ;; If `cur-a' is nil probably cursor is on a positional arg + ;; before `&key', in this case, exit this block and determine + ;; position with `index'. + (when (and cur-a + (string-match (concat "\\_<" (upcase cur-a) "\\_>") args)) + (setq index nil ; Skip next block based on positional args. + start (match-beginning 0) + end (match-end 0))))) + ;; Handle now positional arguments. (while (and index (>= index 1)) (if (string-match "[^ ()]+" args end) (progn @@ -397,9 +412,14 @@ (cond ((string= argument "&rest") ;; All the rest arguments are the same. (setq index 1)) - ((string= argument "&optional")) - ((string-match-p "\\.\\.\\.$" argument) - (setq index 0)) + ((string= argument "&optional")) ; Skip. + ((string= argument "&allow-other-keys")) ; Skip. + ;; Back to index 0 in ARG1 ARG2 ARG2 ARG3 etc... + ;; like in `setq'. + ((or (string-match-p "\\.\\.\\.$" argument) + (and (string-match-p "\\.\\.\\.)?$" args) + (> index 1) (cl-oddp index))) + (setq index 0)) (t (setq index (1- index)))))) (setq end (length args) @@ -533,28 +553,12 @@ (defun eldoc-function-argstring (arglist) "Return ARGLIST as a string enclosed by (). ARGLIST is either a string, or a list of strings or symbols." - (cond ((stringp arglist)) - ((not (listp arglist)) - (setq arglist nil)) - ((symbolp (car arglist)) - (setq arglist - (mapconcat (lambda (s) (symbol-name s)) - arglist " "))) - ((stringp (car arglist)) - (setq arglist - (mapconcat (lambda (s) s) - arglist " ")))) - (if arglist - (format "(%s)" arglist))) - -(defun eldoc-function-argstring-format (argstring) - "Apply `eldoc-argument-case' to each word in ARGSTRING. -The words \"&rest\", \"&optional\" are returned unchanged." - (mapconcat (lambda (s) - (if (string-match-p "\\`(?&\\(?:optional\\|rest\\))?\\'" s) - s - (funcall eldoc-argument-case s))) - (split-string argstring) " ")) + (let ((str (cond ((stringp arglist) arglist) + ((not (listp arglist)) nil) + (t (format "%S" (help-make-usage 'toto arglist)))))) + (if (and str (string-match "\\`([^ ]+ ?" str)) + (replace-match "(" t t str) + str))) ;; When point is in a sexp, the function args are not reprinted in the echo ------------------------------------------------------------ revno: 117712 committer: Eli Zaretskii branch nick: trunk timestamp: Mon 2014-08-18 17:39:26 +0300 message: Fix horizontal scrolling in non-selected windows. lisp/scroll-bar.el (scroll-bar-horizontal-drag-1) (scroll-bar-toolkit-horizontal-scroll): When determining the paragraph direction, use the buffer of the window designated in the event. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-08-16 19:51:27 +0000 +++ lisp/ChangeLog 2014-08-18 14:39:26 +0000 @@ -1,3 +1,10 @@ +2014-08-18 Eli Zaretskii + + * scroll-bar.el (scroll-bar-horizontal-drag-1) + (scroll-bar-toolkit-horizontal-scroll): When determining the + paragraph direction, use the buffer of the window designated in + the event. + 2014-08-16 Andreas Schwab * vc/diff-mode.el (diff-fixup-modifs): Handle empty line in === modified file 'lisp/scroll-bar.el' --- lisp/scroll-bar.el 2014-08-16 15:47:38 +0000 +++ lisp/scroll-bar.el 2014-08-18 14:39:26 +0000 @@ -327,7 +327,8 @@ (window (nth 0 start-position)) (portion-whole (nth 2 start-position)) (unit (frame-char-width (window-frame window)))) - (if (eq (current-bidi-paragraph-direction) 'left-to-right) + (if (eq (current-bidi-paragraph-direction (window-buffer window)) + 'left-to-right) (set-window-hscroll window (/ (1- (+ (car portion-whole) unit)) unit)) (set-window-hscroll @@ -454,9 +455,11 @@ (let* ((end-position (event-end event)) (window (nth 0 end-position)) (part (nth 4 end-position)) - (bidi-factor (if (eq (current-bidi-paragraph-direction) 'left-to-right) - 1 - -1)) + (bidi-factor + (if (eq (current-bidi-paragraph-direction (window-buffer window)) + 'left-to-right) + 1 + -1)) before-scroll) (cond ((eq part 'end-scroll)) ------------------------------------------------------------ revno: 117711 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2014-08-17 17:58:04 +0300 message: Avoid overwriting the reversed_p flags in the glyph matrices. Avoid overwriting the reversed_p flags in the glyph matrices when init_iterator or start_display are called. src/xdisp.c (init_iterator): Don't initialize the reversed_p flag of the glyph row here. (tool_bar_height, redisplay_tool_bar, try_window) (try_window_reusing_current_matrix, try_window_id) (get_overlay_arrow_glyph_row, display_menu_bar): Initialize the reversed_p flag of the iterator's glyph row where the glyph row is going to be redrawn. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-08-16 16:10:50 +0000 +++ src/ChangeLog 2014-08-17 14:58:04 +0000 @@ -1,3 +1,15 @@ +2014-08-17 Eli Zaretskii + + Avoid overwriting the reversed_p flags in the glyph matrices when + init_iterator or start_display are called. + * xdisp.c (init_iterator): Don't initialize the reversed_p flag of + the glyph row here. + (tool_bar_height, redisplay_tool_bar, try_window) + (try_window_reusing_current_matrix, try_window_id) + (get_overlay_arrow_glyph_row, display_menu_bar): Initialize the + reversed_p flag of the iterator's glyph row where the glyph row + is going to be redrawn. + 2014-08-16 Paul Eggert * xdisp.c (set_horizontal_scroll_bar): Don't use uninitialized local. === modified file 'src/xdisp.c' --- src/xdisp.c 2014-08-16 16:10:50 +0000 +++ src/xdisp.c 2014-08-17 14:58:04 +0000 @@ -2971,10 +2971,6 @@ it->glyph_row = row; it->area = TEXT_AREA; - /* Forget any previous info about this row being reversed. */ - if (it->glyph_row) - it->glyph_row->reversed_p = 0; - /* Get the dimensions of the display area. The display area consists of the visible window area plus a horizontally scrolled part to the left of the window. All x-values are relative to the @@ -12294,6 +12290,7 @@ /* Initialize an iterator for iteration over F->desired_tool_bar_string in the tool-bar window of frame F. */ init_iterator (&it, w, -1, -1, temp_row, TOOL_BAR_FACE_ID); + temp_row->reversed_p = false; it.first_visible_x = 0; it.last_visible_x = WINDOW_PIXEL_WIDTH (w); reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); @@ -12378,6 +12375,7 @@ it.first_visible_x = 0; it.last_visible_x = WINDOW_PIXEL_WIDTH (w); row = it.glyph_row; + row->reversed_p = false; /* Build a string that represents the contents of the tool-bar. */ build_desired_tool_bar_string (f); @@ -16898,6 +16896,7 @@ /* Initialize iterator and info to start at POS. */ start_display (&it, w, pos); + it.glyph_row->reversed_p = false; /* Display all lines of W. */ while (it.current_y < it.last_visible_y) @@ -17081,6 +17080,7 @@ && it.current.dpvec_index < 0) break; + it.glyph_row->reversed_p = false; if (display_line (&it)) last_text_row = it.glyph_row - 1; @@ -18101,6 +18101,11 @@ w->cursor.vpos = -1; last_text_row = NULL; overlay_arrow_seen = 0; + if (it.current_y < it.last_visible_y + && !f->fonts_changed + && (first_unchanged_at_end_row == NULL + || IT_CHARPOS (it) < stop_pos)) + it.glyph_row->reversed_p = false; while (it.current_y < it.last_visible_y && !f->fonts_changed && (first_unchanged_at_end_row == NULL @@ -18810,6 +18815,7 @@ set_buffer_temp (buffer); init_iterator (&it, w, -1, -1, &scratch_glyph_row, DEFAULT_FACE_ID); + scratch_glyph_row.reversed_p = false; it.glyph_row->used[TEXT_AREA] = 0; SET_TEXT_POS (it.position, 0, 0); @@ -21400,6 +21406,7 @@ clear_glyph_row (row); row->enabled_p = true; row->full_width_p = 1; + row->reversed_p = false; } /* Display all items of the menu bar. */