Now on revision 109950. ------------------------------------------------------------ revno: 109950 fixes bug: http://debbugs.gnu.org/8948 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-09-09 14:43:47 +0800 message: Allow scrolling in y-or-n-p. * lisp/replace.el (query-replace-map): Bind four new symbols for requesting window scrolling. * lisp/subr.el (y-or-n-p): Handle the window-scrolling bindings in query-replace-map. * lisp/custom.el (custom-theme-load-confirm): Use y-or-n-p. * lisp/window.el (scroll-other-window-down): Make the arg optional. * lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Don't bind scrolling keys since they are now in query-replace-map. * doc/lispref/minibuf.texi (Yes-or-No Queries): Document recentering and scrolling in y-or-n-p. Remove gratuitous example. * doc/lispref/searching.texi (Search and Replace): Document window scrolling entries in query-replace-map. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-09-08 14:23:01 +0000 +++ doc/lispref/ChangeLog 2012-09-09 06:43:47 +0000 @@ -1,3 +1,11 @@ +2012-09-09 Chong Yidong + + * minibuf.texi (Yes-or-No Queries): Document recentering and + scrolling in y-or-n-p. Remove gratuitous example. + + * searching.texi (Search and Replace): Document window scrolling + entries in query-replace-map. + 2012-09-08 Chong Yidong * syntax.texi (Syntax Table Internals): Define "raw syntax === modified file 'doc/lispref/minibuf.texi' --- doc/lispref/minibuf.texi 2012-05-27 01:34:14 +0000 +++ doc/lispref/minibuf.texi 2012-09-09 06:43:47 +0000 @@ -1888,46 +1888,14 @@ cursor moves to the echo area while the question is being asked. The answers and their meanings, even @samp{y} and @samp{n}, are not -hardwired. The keymap @code{query-replace-map} specifies them. -@xref{Search and Replace}. - -In the following example, the user first types @kbd{q}, which is -invalid. At the next prompt the user types @kbd{y}. - -@c Need an interactive example, because otherwise the return value -@c obscures the display of the valid answer. -@smallexample -@group -(defun ask () - (interactive) - (y-or-n-p "Do you need a lift? ")) - -;; @r{After evaluation of the preceding definition, @kbd{M-x ask}} -;; @r{causes the following prompt to appear in the echo area:} -@end group - -@group ----------- Echo area ---------- -Do you need a lift? (y or n) ----------- Echo area ---------- -@end group - -;; @r{If the user then types @kbd{q}, the following appears:} - -@group ----------- Echo area ---------- -Please answer y or n. Do you need a lift? (y or n) ----------- Echo area ---------- -@end group - -;; @r{When the user types a valid answer,} -;; @r{it is displayed after the question:} - -@group ----------- Echo area ---------- -Do you need a lift? (y or n) y ----------- Echo area ---------- -@end group +hardwired, and are specified by the keymap @code{query-replace-map} +(@pxref{Search and Replace}). In particular, if the user enters the +special responses @code{recenter}, @code{scroll-up}, +@code{scroll-down}, @code{scroll-other-window}, or +@code{scroll-other-window-down} (respectively bound to @kbd{C-l}, +@kbd{C-v}, @kbd{M-v}, @kbd{C-M-v} and @kbd{C-M-S-v} in +@code{query-replace-map}), this function performs the specified window +recentering or scrolling operation, and poses the question again. @end smallexample @noindent === modified file 'doc/lispref/searching.texi' --- doc/lispref/searching.texi 2012-05-27 01:34:14 +0000 +++ doc/lispref/searching.texi 2012-09-09 06:43:47 +0000 @@ -1796,7 +1796,13 @@ it. @item recenter -Redisplay and center the window, then ask the same question again. +@itemx scroll-up +@itemx scroll-down +@itemx scroll-other-window +@itemx scroll-other-window-down +Perform the specified window scroll operation, then ask the same +question again. Only @code{y-or-n-p} and related functions use this +answer. @item quit Perform a quit right away. Only @code{y-or-n-p} and related functions === modified file 'etc/NEWS' --- etc/NEWS 2012-09-08 20:09:06 +0000 +++ etc/NEWS 2012-09-09 06:43:47 +0000 @@ -78,6 +78,10 @@ * Changes in Emacs 24.3 +** You can now scroll the selected window in most y-or-n prompts. +Typing C-v or M-v at a prompt scrolls forward or backward +respectively, without leaving the y-or-n prompt. + ** Help changes *** `C-h f' (describe-function) can now perform autoloading. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-09 05:50:43 +0000 +++ lisp/ChangeLog 2012-09-09 06:43:47 +0000 @@ -1,5 +1,20 @@ 2012-09-09 Chong Yidong + * replace.el (query-replace-map): Bind four new symbols for + requesting window scrolling. + + * subr.el (y-or-n-p): Handle the window-scrolling bindings in + query-replace-map (Bug#8948). + + * custom.el (custom-theme-load-confirm): Use y-or-n-p. + + * emacs-lisp/map-ynp.el (map-y-or-n-p): Don't bind scrolling keys + since they are now in query-replace-map. + + * window.el (scroll-other-window-down): Make the arg optional. + +2012-09-09 Chong Yidong + * files.el (hack-local-variables-confirm): Use quit-window to kill the *Local Variables* buffer. === modified file 'lisp/custom.el' --- lisp/custom.el 2012-08-15 16:29:11 +0000 +++ lisp/custom.el 2012-09-09 06:43:47 +0000 @@ -1223,38 +1223,19 @@ "Query the user about loading a Custom theme that may not be safe. The theme should be in the current buffer. If the user agrees, query also about adding HASH to `custom-safe-themes'." - (if noninteractive - nil - (let ((exit-chars '(?y ?n ?\s)) - window prompt char) - (save-window-excursion - (rename-buffer "*Custom Theme*" t) - (emacs-lisp-mode) - (setq window (display-buffer (current-buffer))) - (setq prompt - (format "Loading a theme can run Lisp code. Really load?%s" - (if (and window - (< (line-number-at-pos (point-max)) - (window-body-height))) - " (y or n) " - (push ?\C-v exit-chars) - "\nType y or n, or C-v to scroll: "))) - (goto-char (point-min)) - (while (null char) - (setq char (read-char-choice prompt exit-chars)) - (when (eq char ?\C-v) - (if window - (with-selected-window window - (condition-case nil - (scroll-up) - (error (goto-char (point-min)))))) - (setq char nil))) - (when (memq char '(?\s ?y)) - ;; Offer to save to `custom-safe-themes'. - (and (or custom-file user-init-file) - (y-or-n-p "Treat this theme as safe in future sessions? ") - (customize-push-and-save 'custom-safe-themes (list hash))) - t))))) + (unless noninteractive + (save-window-excursion + (rename-buffer "*Custom Theme*" t) + (emacs-lisp-mode) + (setq window (pop-to-buffer (current-buffer))) + (goto-char (point-min)) + (prog1 (when (y-or-n-p "Loading a theme can run Lisp code. Really load? ") + ;; Offer to save to `custom-safe-themes'. + (and (or custom-file user-init-file) + (y-or-n-p "Treat this theme as safe in future sessions? ") + (customize-push-and-save 'custom-safe-themes (list hash))) + t) + (quit-window))))) (defun custom-theme-name-valid-p (name) "Return t if NAME is a valid name for a Custom theme, nil otherwise. === modified file 'lisp/emacs-lisp/map-ynp.el' --- lisp/emacs-lisp/map-ynp.el 2012-07-18 11:44:13 +0000 +++ lisp/emacs-lisp/map-ynp.el 2012-09-09 06:43:47 +0000 @@ -123,16 +123,6 @@ map (let ((map (make-sparse-keymap))) (set-keymap-parent map query-replace-map) - (define-key map [?\C-\M-v] 'scroll-other-window) - (define-key map [M-next] 'scroll-other-window) - (define-key map [?\C-\M-\S-v] 'scroll-other-window-down) - (define-key map [M-prior] 'scroll-other-window-down) - ;; The above are rather inconvenient, so maybe we should - ;; provide the non-other keys for the other-scroll as well. - ;; (define-key map [?\C-v] 'scroll-other-window) - ;; (define-key map [next] 'scroll-other-window) - ;; (define-key map [?\M-v] 'scroll-other-window-down) - ;; (define-key map [prior] 'scroll-other-window-down) (dolist (elt action-alist) (define-key map (vector (car elt)) (vector (nth 1 elt)))) map))) === modified file 'lisp/replace.el' --- lisp/replace.el 2012-09-06 08:49:40 +0000 +++ lisp/replace.el 2012-09-09 06:43:47 +0000 @@ -1617,14 +1617,28 @@ (define-key map "?" 'help) (define-key map "\C-g" 'quit) (define-key map "\C-]" 'quit) - (define-key map "\e" 'exit-prefix) + (define-key map "\C-v" 'scroll-up) + (define-key map "\M-v" 'scroll-down) + (define-key map [next] 'scroll-up) + (define-key map [prior] 'scroll-down) + (define-key map [?\C-\M-v] 'scroll-other-window) + (define-key map [M-next] 'scroll-other-window) + (define-key map [?\C-\M-\S-v] 'scroll-other-window-down) + (define-key map [M-prior] 'scroll-other-window-down) + ;; Binding ESC would prohibit the M-v binding. Instead, callers + ;; should check for ESC specially. + ;; (define-key map "\e" 'exit-prefix) (define-key map [escape] 'exit-prefix) map) - "Keymap that defines the responses to questions in `query-replace'. + "Keymap of responses to questions posed by commands like `query-replace'. The \"bindings\" in this map are not commands; they are answers. The valid answers include `act', `skip', `act-and-show', -`exit', `act-and-exit', `edit', `edit-replacement', `delete-and-edit', -`recenter', `automatic', `backup', `exit-prefix', `quit', and `help'.") +`act-and-exit', `exit', `exit-prefix', `recenter', `scroll-up', +`scroll-down', `scroll-other-window', `scroll-other-window-down', +`edit', `edit-replacement', `delete-and-edit', `automatic', +`backup', `quit', and `help'. + +This keymap is used by `y-or-n-p' as well as `query-replace'.") (defvar multi-query-replace-map (let ((map (make-sparse-keymap))) === modified file 'lisp/subr.el' --- lisp/subr.el 2012-09-08 14:30:09 +0000 +++ lisp/subr.el 2012-09-09 06:43:47 +0000 @@ -2319,11 +2319,19 @@ PROMPT is the string to display to ask the question. It should end in a space; `y-or-n-p' adds \"(y or n) \" to it. -No confirmation of the answer is requested; a single character is enough. -Also accepts Space to mean yes, or Delete to mean no. \(Actually, it uses -the bindings in `query-replace-map'; see the documentation of that variable -for more information. In this case, the useful bindings are `act', `skip', -`recenter', and `quit'.\) +No confirmation of the answer is requested; a single character is +enough. SPC also means yes, and DEL means no. + +To be precise, this function translates user input into responses +by consulting the bindings in `query-replace-map'; see the +documentation of that variable for more information. In this +case, the useful bindings are `act', `skip', `recenter', +`scroll-up', `scroll-down', and `quit'. +An `act' response means yes, and a `skip' response means no. +A `quit' response means to invoke `keyboard-quit'. +If the user enters `recenter', `scroll-up', or `scroll-down' +responses, perform the requested window recentering or scrolling +and ask again. Under a windowing system a dialog box will be used if `last-nonmenu-event' is nil and `use-dialog-box' is non-nil." @@ -2355,21 +2363,33 @@ "" " ") "(y or n) ")) (while - (let* ((key + (let* ((scroll-actions '(recenter scroll-up scroll-down + scroll-other-window scroll-other-window-down)) + (key (let ((cursor-in-echo-area t)) (when minibuffer-auto-raise (raise-frame (window-frame (minibuffer-window)))) - (read-key (propertize (if (eq answer 'recenter) + (read-key (propertize (if (memq answer scroll-actions) prompt (concat "Please answer y or n. " prompt)) 'face 'minibuffer-prompt))))) (setq answer (lookup-key query-replace-map (vector key) t)) (cond - ((memq answer '(skip act)) nil) - ((eq answer 'recenter) (recenter) t) - ((memq answer '(exit-prefix quit)) (signal 'quit nil) t) - (t t))) + ((memq answer '(skip act)) nil) + ((eq answer 'recenter) + (recenter) t) + ((eq answer 'scroll-up) + (ignore-errors (scroll-up-command)) t) + ((eq answer 'scroll-down) + (ignore-errors (scroll-down-command)) t) + ((eq answer 'scroll-other-window) + (ignore-errors (scroll-other-window)) t) + ((eq answer 'scroll-other-window-down) + (ignore-errors (scroll-other-window-down)) t) + ((or (memq answer '(exit-prefix quit)) (eq key ?\e)) + (signal 'quit nil) t) + (t t))) (ding) (discard-input)))) (let ((ret (eq answer 'act))) === modified file 'lisp/window.el' --- lisp/window.el 2012-09-08 13:28:11 +0000 +++ lisp/window.el 2012-09-09 06:43:47 +0000 @@ -6301,7 +6301,7 @@ (put 'scroll-down-line 'scroll-command t) -(defun scroll-other-window-down (lines) +(defun scroll-other-window-down (&optional lines) "Scroll the \"other window\" down. For more details, see the documentation for `scroll-other-window'." (interactive "P") ------------------------------------------------------------ revno: 109949 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-09-09 13:50:43 +0800 message: Use quit-window for quitting the *Local Variables* buffer. * lisp/files.el (hack-local-variables-confirm): Use quit-window to kill the *Local Variables* buffer. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-08 23:32:25 +0000 +++ lisp/ChangeLog 2012-09-09 05:50:43 +0000 @@ -1,3 +1,8 @@ +2012-09-09 Chong Yidong + + * files.el (hack-local-variables-confirm): Use quit-window to kill + the *Local Variables* buffer. + 2012-09-08 Dmitry Gutov * progmodes/ruby-mode.el (ruby-toggle-block): Guess the current block, === modified file 'lisp/files.el' --- lisp/files.el 2012-09-07 10:53:29 +0000 +++ lisp/files.el 2012-09-09 05:50:43 +0000 @@ -2951,20 +2951,16 @@ RISKY-VARS is the list of those that are marked as risky. If these settings come from directory-local variables, then DIR-NAME is the name of the associated directory. Otherwise it is nil." - (if noninteractive - nil - (save-window-excursion - (let* ((name (or dir-name - (if buffer-file-name - (file-name-nondirectory buffer-file-name) - (concat "buffer " (buffer-name))))) - (offer-save (and (eq enable-local-variables t) - unsafe-vars)) - (exit-chars - (if offer-save '(?! ?y ?n ?\s ?\C-g) '(?y ?n ?\s ?\C-g))) - (buf (pop-to-buffer "*Local Variables*")) - prompt char) - (set (make-local-variable 'cursor-type) nil) + (unless noninteractive + (let ((name (cond (dir-name) + (buffer-file-name + (file-name-nondirectory buffer-file-name)) + ((concat "buffer " (buffer-name))))) + (offer-save (and (eq enable-local-variables t) + unsafe-vars)) + (buf (get-buffer-create "*Local Variables*"))) + ;; Set up the contents of the *Local Variables* buffer. + (with-current-buffer buf (erase-buffer) (cond (unsafe-vars @@ -2999,25 +2995,35 @@ (let ((print-escape-newlines t)) (prin1 (cdr elt) buf)) (insert "\n")) - (setq prompt - (format "Please type %s%s: " - (if offer-save "y, n, or !" "y or n") - (if (< (line-number-at-pos) (window-body-height)) - "" - (push ?\C-v exit-chars) - ", or C-v to scroll"))) - (goto-char (point-min)) - (while (null char) - (setq char (read-char-choice prompt exit-chars t)) - (when (eq char ?\C-v) - (condition-case nil - (scroll-up) - (error (goto-char (point-min)))) - (setq char nil))) - (kill-buffer buf) - (when (and offer-save (= char ?!) unsafe-vars) - (customize-push-and-save 'safe-local-variable-values unsafe-vars)) - (memq char '(?! ?\s ?y)))))) + (set (make-local-variable 'cursor-type) nil) + (set-buffer-modified-p nil) + (goto-char (point-min))) + + ;; Display the buffer and read a choice. + (save-window-excursion + (pop-to-buffer buf) + (let* ((exit-chars '(?y ?n ?\s ?\C-g ?\C-v)) + (prompt (format "Please type %s%s: " + (if offer-save "y, n, or !" "y or n") + (if (< (line-number-at-pos (point-max)) + (window-body-height)) + "" + (push ?\C-v exit-chars) + ", or C-v to scroll"))) + char) + (if offer-save (push ?! exit-chars)) + (while (null char) + (setq char (read-char-choice prompt exit-chars t)) + (when (eq char ?\C-v) + (condition-case nil + (scroll-up) + (error (goto-char (point-min)) + (recenter 1))) + (setq char nil))) + (when (and offer-save (= char ?!) unsafe-vars) + (customize-push-and-save 'safe-local-variable-values unsafe-vars)) + (prog1 (memq char '(?! ?\s ?y)) + (quit-window t))))))) (defun hack-local-variables-prop-line (&optional mode-only) "Return local variables specified in the -*- line. ------------------------------------------------------------ revno: 109948 committer: Dmitry Gutov branch nick: trunk timestamp: Sun 2012-09-09 03:32:25 +0400 message: * lisp/progmodes/ruby-mode.el (ruby-toggle-block): Guess the current block, not just expect to be at its beginning. Adjust callees. Succeed when do-end block has no space before the pipe character. (ruby-brace-to-do-end): When the original block is one-liner, convert to multiline. Reindent the result. * test/automated/ruby-mode-tests.el: (ruby-toggle-block-to-multiline): New test. (ruby-should-indent-buffer, ruby-toggle-block-to-do-end) (ruby-toggle-block-to-brace): Use buffer-string. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-08 20:09:06 +0000 +++ lisp/ChangeLog 2012-09-08 23:32:25 +0000 @@ -1,3 +1,11 @@ +2012-09-08 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-toggle-block): Guess the current block, + not just expect to be at its beginning. Adjust callees. + Succeed when do-end block has no space before the pipe character. + (ruby-brace-to-do-end): When the original block is one-liner, + convert to multiline. Reindent the result. + 2012-09-08 Jambunathan K * register.el (register): New group. === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2012-09-08 15:34:41 +0000 +++ lisp/progmodes/ruby-mode.el 2012-09-08 23:32:25 +0000 @@ -1107,46 +1107,65 @@ (if mlist (concat mlist mname) mname) mlist))))) -(defun ruby-brace-to-do-end () - (when (looking-at "{") - (let ((orig (point)) (end (progn (ruby-forward-sexp) (point)))) - (when (eq (char-before) ?\}) - (delete-char -1) - (if (eq (char-syntax (char-before)) ?w) - (insert " ")) - (insert "end") - (if (eq (char-syntax (char-after)) ?w) - (insert " ")) - (goto-char orig) - (delete-char 1) - (if (eq (char-syntax (char-before)) ?w) - (insert " ")) - (insert "do") - (when (looking-at "\\sw\\||") - (insert " ") - (backward-char)) - t)))) +(defun ruby-brace-to-do-end (orig end) + (let (beg-marker end-marker) + (goto-char end) + (when (eq (char-before) ?\}) + (delete-char -1) + (skip-chars-backward " \t") + (when (not (bolp)) + (insert "\n")) + (insert "end") + (setq end-marker (point-marker)) + (when (and (not (eobp)) (eq (char-syntax (char-after)) ?w)) + (insert " ")) + (goto-char orig) + (delete-char 1) + (when (eq (char-syntax (char-before)) ?w) + (insert " ")) + (insert "do") + (setq beg-marker (point-marker)) + (when (looking-at "\\(\\s \\)*|") + (unless (match-beginning 1) + (insert " ")) + (goto-char (1+ (match-end 0))) + (search-forward "|")) + (unless (looking-at "\\s *$") + (insert "\n")) + (indent-region beg-marker end-marker) + (goto-char beg-marker) + t))) -(defun ruby-do-end-to-brace () - (when (and (or (bolp) - (not (memq (char-syntax (char-before)) '(?w ?_)))) - (looking-at "\\ end start))) + (if (match-beginning 1) + (ruby-brace-to-do-end beg end) + (ruby-do-end-to-brace beg end))) + (goto-char start)))) (declare-function ruby-syntax-propertize-heredoc "ruby-mode" (limit)) (declare-function ruby-syntax-enclosing-percent-literal "ruby-mode" (limit)) === modified file 'test/ChangeLog' --- test/ChangeLog 2012-09-07 04:15:56 +0000 +++ test/ChangeLog 2012-09-08 23:32:25 +0000 @@ -1,3 +1,10 @@ +2012-09-08 Dmitry Gutov + + * automated/ruby-mode-tests.el: + (ruby-toggle-block-to-multiline): New test. + (ruby-should-indent-buffer, ruby-toggle-block-to-do-end) + (ruby-toggle-block-to-brace): Use buffer-string. + 2012-09-07 Dmitry Gutov * automated/ruby-mode-tests.el: New tests (Bug#11613). === modified file 'test/automated/ruby-mode-tests.el' --- test/automated/ruby-mode-tests.el 2012-09-08 15:13:14 +0000 +++ test/automated/ruby-mode-tests.el 2012-09-08 23:32:25 +0000 @@ -40,8 +40,7 @@ (insert (fix-indent content)) (ruby-mode) (indent-region (point-min) (point-max)) - (should (string= (fix-indent expected) (buffer-substring-no-properties - (point-min) (point-max))))))) + (should (string= (fix-indent expected) (buffer-string)))))) (defun ruby-assert-state (content &rest values-plist) "Assert syntax state values at the end of CONTENT. @@ -213,21 +212,27 @@ (ert-deftest ruby-toggle-block-to-do-end () (with-temp-buffer - (insert "foo {|b|\n}\n") + (insert "foo {|b|\n}") (ruby-mode) - (search-backward "{") + (beginning-of-line) (ruby-toggle-block) - (should (string= "foo do |b|\nend\n" (buffer-substring-no-properties - (point-min) (point-max)))))) + (should (string= "foo do |b|\nend" (buffer-string))))) (ert-deftest ruby-toggle-block-to-brace () (with-temp-buffer - (insert "foo do |b|\nend\n") - (ruby-mode) - (search-backward "do") - (ruby-toggle-block) - (should (string= "foo {|b|\n}\n" (buffer-substring-no-properties - (point-min) (point-max)))))) + (insert "foo do |b|\nend") + (ruby-mode) + (beginning-of-line) + (ruby-toggle-block) + (should (string= "foo {|b|\n}" (buffer-string))))) + +(ert-deftest ruby-toggle-block-to-multiline () + (with-temp-buffer + (insert "foo {|b| b + 1}") + (ruby-mode) + (beginning-of-line) + (ruby-toggle-block) + (should (string= "foo do |b|\n b + 1\nend" (buffer-string))))) (ert-deftest ruby-recognize-symbols-starting-with-at-character () (ruby-assert-face ":@abc" 3 'font-lock-constant-face)) ------------------------------------------------------------ revno: 109947 fixes bug: http://debbugs.gnu.org/12390 committer: Jan D. branch nick: trunk timestamp: Sat 2012-09-08 22:16:39 +0200 message: * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back compositeToPoint for OSX < 10.6. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-08 19:57:32 +0000 +++ src/ChangeLog 2012-09-08 20:16:39 +0000 @@ -1,3 +1,8 @@ +2012-09-08 Jan Djärv + + * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back + compositeToPoint for OSX < 10.6 (Bug#12390). + 2012-09-08 Paul Eggert * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)). === modified file 'src/nsterm.m' --- src/nsterm.m 2012-09-08 17:22:15 +0000 +++ src/nsterm.m 2012-09-08 20:16:39 +0000 @@ -650,7 +650,7 @@ struct frame *f = XFRAME (WINDOW_FRAME (w)); Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); NSTRACE (ns_update_window_begin); - + fprintf(stderr, "%s\n", __func__); updated_window = w; set_output_cursor (&w->cursor); @@ -683,6 +683,7 @@ { Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame)); + fprintf(stderr, "%s\n", __func__); /* note: this fn is nearly identical in all terms */ if (!w->pseudo_window_p) { @@ -1266,6 +1267,7 @@ wr.origin.y += FRAME_PIXEL_HEIGHT (f) - pixelheight; [view setRows: rows andColumns: cols]; + fprintf(stderr, "%s %d %d\n", __func__, cols, (int)wr.origin.x); [window setFrame: wr display: YES]; /*fprintf (stderr, "\tx_set_window_size %d, %d\t%d, %d\n", cols, rows, pixelwidth, pixelheight); */ @@ -1283,6 +1285,7 @@ - NS_SCROLL_BAR_WIDTH (f), 0) : NSMakePoint (0, 0); [view setFrame: NSMakeRect (0, 0, pixelwidth, pixelheight)]; + fprintf(stderr, "%s origin %d\n", __func__, (int)origin.x); [view setBoundsOrigin: origin]; } @@ -2297,12 +2300,20 @@ [ns_lookup_indexed_color(face->background, f) set]; NSRectFill (r); [img setXBMColor: ns_lookup_indexed_color(face->foreground, f)]; +#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 [img drawInRect: r fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0 respectFlipped: YES hints: nil]; +#else + { + NSPoint pt = r.origin; + pt.y += p->h; + [img compositeToPoint: pt operation: NSCompositeSourceOver]; + } +#endif } ns_unfocus (f); } @@ -2961,12 +2972,19 @@ /* Draw the image.. do we need to draw placeholder if img ==nil? */ if (img != nil) + { +#if !defined (NS_IMPL_COCOA) || MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 [img drawInRect: br - fromRect: NSZeroRect + fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0 respectFlipped: YES hints: nil]; +#else + [img compositeToPoint: NSMakePoint (x, y + s->slice.height) + operation: NSCompositeSourceOver]; +#endif + } if (s->hl == DRAW_CURSOR) { @@ -5380,6 +5398,7 @@ change_frame_size (emacsframe, rows, cols, 0, 0, 1); SET_FRAME_GARBAGED (emacsframe); cancel_mouse_face (emacsframe); + fprintf(stderr, "%s %d %d\n", __func__, cols, neww); [view setFrame: NSMakeRect (0, 0, neww, newh)]; } } @@ -6196,8 +6215,20 @@ NSTRACE (constrainFrameRect); if (nr_screens == 1) - return [super constrainFrameRect:frameRect toScreen:screen]; - + { + NSRect r = [super constrainFrameRect:frameRect toScreen:screen]; + fprintf(stderr, "%s %d/%d %d/%d => %d/%d %d/%d\n", __func__, + (int)frameRect.origin.x, + (int)frameRect.origin.y, + (int)frameRect.size.width, + (int)frameRect.size.height, + (int)r.origin.x, + (int)r.origin.y, + (int)r.size.width, + (int)r.size.height); + return r; + } + if (f->output_data.ns->dont_constrain || ns_menu_bar_should_be_hidden ()) return frameRect; ------------------------------------------------------------ revno: 109946 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12217 author: Jambunathan K committer: Stefan Monnier branch nick: trunk timestamp: Sat 2012-09-08 16:09:06 -0400 message: * lisp/register.el (increment-register): Route it to `append-to-register', if register contains text so that `C-x r +' can now be used for appending to a text register. (register): New group. (register-separator): New user option. (append-to-register, prepend-to-register): Add separator based on `register-separator. * doc/emacs/regs.texi (Text Registers): `C-x r +' can now be used instead of M-x append-to-register. New option `register-separator'. (Number Registers): Mention that `C-x r +' is polymorphic. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2012-09-07 10:27:11 +0000 +++ doc/emacs/ChangeLog 2012-09-08 20:09:06 +0000 @@ -1,3 +1,9 @@ +2012-09-08 Jambunathan K + + * regs.texi (Text Registers): `C-x r +' can now be used instead of + M-x append-to-register. New option `register-separator'. + (Number Registers): Mention that `C-x r +' is polymorphic. + 2012-09-07 Chong Yidong * windows.texi (Window Choice): Don't mention obsolete @@ -10,9 +16,9 @@ 2012-08-24 Michael Albinus - * cmdargs.texi (General Variables): Setting - $DBUS_SESSION_BUS_ADDRESS to a dummy value suppresses connections - to the D-Bus session bus. (Bug#12112) + * cmdargs.texi (General Variables): + Setting $DBUS_SESSION_BUS_ADDRESS to a dummy value suppresses + connections to the D-Bus session bus. (Bug#12112) 2012-08-14 Eli Zaretskii === modified file 'doc/emacs/regs.texi' --- doc/emacs/regs.texi 2012-05-27 01:25:06 +0000 +++ doc/emacs/regs.texi 2012-09-08 20:09:06 +0000 @@ -92,6 +92,13 @@ Insert text from register @var{r} (@code{insert-register}). @item M-x append-to-register @key{RET} @var{r} Append region to text in register @var{r}. + +@kindex C-x r + +When register @var{r} contains text, you can use @kbd{C-x r +} +(@code{increment-register}) to append to that register. Note that +command @kbd{C-x r +} behaves differently if @var{r} contains a +number. @xref{Number Registers}. + @item M-x prepend-to-register @key{RET} @var{r} Prepend region to text in register @var{r}. @end table @@ -116,6 +123,19 @@ the region text to the text in the register instead of @emph{appending} it. +@vindex register-separator + When you are collecting text using @code{append-to-register} and +@code{prepend-to-register}, you may want to separate individual +collected pieces using a separator. In that case, configure a +@code{register-separator} and store the separator text in to that +register. For example, to get double newlines as text separator +during the collection process, you can use the following setting. + +@example +(setq register-separator ?+) +(set-register register-separator "\n\n") +@end example + @kindex C-x r i @findex insert-register @kbd{C-x r i @var{r}} inserts in the buffer the text from register @@ -191,8 +211,10 @@ @item C-u @var{number} C-x r + @var{r} @kindex C-x r + @findex increment-register -Increment the number in register @var{r} by @var{number} -(@code{increment-register}). +If @var{r} contains a number, increment the number in that register by +@var{number}. Note that command @kbd{C-x r +} +(@code{increment-register}) behaves differently if @var{r} contains +text. @xref{Text Registers}. @item C-x r i @var{r} Insert the number from register @var{r} into the buffer. @end table === modified file 'etc/NEWS' --- etc/NEWS 2012-09-08 14:48:26 +0000 +++ etc/NEWS 2012-09-08 20:09:06 +0000 @@ -182,6 +182,13 @@ delete-trailing-whitespace command should delete trailing lines at the end of the buffer. It defaults to t. ++++ +** `C-x r +' is now overloaded to invoke `append-to-register. ++++ +** New option `separator-register'. Separator register stores +separator text for use with M-x append-to-register and M-x +prepend-to-register. See manual for details. + ** Search changes *** Global `M-s _' starts a symbol (identifier) incremental search, === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-08 20:00:13 +0000 +++ lisp/ChangeLog 2012-09-08 20:09:06 +0000 @@ -1,15 +1,25 @@ +2012-09-08 Jambunathan K + + * register.el (register): New group. + (register-separator): New user option. + (increment-register): Route it to `append-to-register', if + register contains text. Implication is that `C-x r +' can now be + used for appending to a text register (bug#12217). + (append-to-register, prepend-to-register): Add separator based on + `register-separator. + 2012-09-08 Alan Mackenzie AWK Mode: make auto-newline work when there's "==" in the pattern. * progmodes/cc-cmds.el (c-point-syntax): Handle virtual semicolons correctly. - * progmodes/cc-engine.el (c-guess-basic-syntax CASE 5A.3): Test - more rigorously for "=" token. + * progmodes/cc-engine.el (c-guess-basic-syntax CASE 5A.3): + Test more rigorously for "=" token. 2012-09-08 Dmitry Gutov - * progmodes/ruby-mode.el (ruby-match-expression-expansion): Only - fail when reached LIMIT. + * progmodes/ruby-mode.el (ruby-match-expression-expansion): + Only fail when reached LIMIT. 2012-09-08 Chong Yidong === modified file 'lisp/register.el' --- lisp/register.el 2012-07-29 04:45:48 +0000 +++ lisp/register.el 2012-09-08 20:09:06 +0000 @@ -76,6 +76,22 @@ A list of the form (FRAME-CONFIGURATION POSITION) represents a saved frame configuration plus a saved value of point.") +(defgroup register nil + "Register commands." + :group 'convenience + :version "24.2.50") + +(defcustom separator-register nil + "Use contents of this register to separate collected text. + +When collecting text with +`append-to-register' (resp. `prepend-to-register') contents of +this register is added to the beginning (resp. end) of the marked +text." + :group 'register + :type '(choice (const :tag "None" nil) + (character :tag "Use register" :value ?+))) + (defun get-register (register) "Return contents of Emacs register named REGISTER, or nil if none." (cdr (assq register register-alist))) @@ -192,13 +208,24 @@ (string-to-number (match-string 0))) 0)))) -(defun increment-register (number register) - "Add NUMBER to the contents of register REGISTER. -Interactively, NUMBER is the prefix arg." - (interactive "p\ncIncrement register: ") - (or (numberp (get-register register)) - (error "Register does not contain a number")) - (set-register register (+ number (get-register register)))) +(defun increment-register (prefix register) + "Augment contents of REGISTER. +Interactively, PREFIX is in raw form. + +If REGISTER contains a number, add `prefix-numeric-value' of +PREFIX to it. + +If REGISTER is empty or if it contains text, call +`append-to-register' with `delete-flag' set to PREFIX." + (interactive "P\ncIncrement register: ") + (let ((register-val (get-register register))) + (cond + ((numberp register-val) + (let ((number (prefix-numeric-value prefix))) + (set-register register (+ number register-val)))) + ((or (not register-val) (stringp register-val)) + (append-to-register register (region-beginning) (region-end) prefix)) + (t (error "Register does not contain a number or text"))))) (defun view-register (register) "Display what is contained in register named REGISTER. @@ -349,10 +376,11 @@ START and END are buffer positions indicating what to append." (interactive "cAppend to register: \nr\nP") (let ((reg (get-register register)) - (text (filter-buffer-substring start end))) + (text (filter-buffer-substring start end)) + (separator (and separator-register (get-register separator-register)))) (set-register register (cond ((not reg) text) - ((stringp reg) (concat reg text)) + ((stringp reg) (concat reg separator text)) (t (error "Register does not contain text"))))) (cond (delete-flag (delete-region start end)) @@ -366,10 +394,11 @@ START and END are buffer positions indicating what to prepend." (interactive "cPrepend to register: \nr\nP") (let ((reg (get-register register)) - (text (filter-buffer-substring start end))) + (text (filter-buffer-substring start end)) + (separator (and separator-register (get-register separator-register)))) (set-register register (cond ((not reg) text) - ((stringp reg) (concat text reg)) + ((stringp reg) (concat text separator reg)) (t (error "Register does not contain text"))))) (cond (delete-flag (delete-region start end)) ------------------------------------------------------------ revno: 109945 committer: Alan Mackenzie branch nick: trunk timestamp: Sat 2012-09-08 20:00:13 +0000 message: AWK Mode: make auto-newline work when there's "==" in the pattern. cc-cmds.el (c-point-syntax): Handle virtual semicolons correctly. cc-engine.el (c-guess-basic-syntax CASE 5A.3): Test more rigorously for "=" token. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-08 15:13:14 +0000 +++ lisp/ChangeLog 2012-09-08 20:00:13 +0000 @@ -1,3 +1,11 @@ +2012-09-08 Alan Mackenzie + + AWK Mode: make auto-newline work when there's "==" in the pattern. + * progmodes/cc-cmds.el (c-point-syntax): Handle virtual semicolons + correctly. + * progmodes/cc-engine.el (c-guess-basic-syntax CASE 5A.3): Test + more rigorously for "=" token. + 2012-09-08 Dmitry Gutov * progmodes/ruby-mode.el (ruby-match-expression-expansion): Only === modified file 'lisp/progmodes/cc-cmds.el' --- lisp/progmodes/cc-cmds.el 2012-07-21 06:13:23 +0000 +++ lisp/progmodes/cc-cmds.el 2012-09-08 20:00:13 +0000 @@ -493,13 +493,16 @@ (insert-char ?\n 1) ;; In AWK (etc.) or in a macro, make sure this CR hasn't changed ;; the syntax. (There might already be an escaped NL there.) - (when (or (c-at-vsemi-p (1- (point))) - (let ((pt (point))) - (save-excursion - (backward-char) - (and (c-beginning-of-macro) - (progn (c-end-of-macro) - (< (point) pt)))))) + (when (or + (save-excursion + (c-skip-ws-backward (c-point 'bopl)) + (c-at-vsemi-p)) + (let ((pt (point))) + (save-excursion + (backward-char) + (and (c-beginning-of-macro) + (progn (c-end-of-macro) + (< (point) pt)))))) (backward-char) (insert-char ?\\ 1) (forward-char)) === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2012-07-17 11:40:23 +0000 +++ lisp/progmodes/cc-engine.el 2012-09-08 20:00:13 +0000 @@ -9579,12 +9579,12 @@ (setq tmpsymbol nil) (while (and (> (point) placeholder) (zerop (c-backward-token-2 1 t)) - (/= (char-after) ?=)) + (not (looking-at "=\\([^=]\\|$\\)"))) (and c-opt-inexpr-brace-list-key (not tmpsymbol) (looking-at c-opt-inexpr-brace-list-key) (setq tmpsymbol 'topmost-intro-cont))) - (eq (char-after) ?=)) + (looking-at "=\\([^=]\\|$\\)")) (looking-at c-brace-list-key)) (save-excursion (while (and (< (point) indent-point) ------------------------------------------------------------ revno: 109944 committer: Paul Eggert branch nick: trunk timestamp: Sat 2012-09-08 12:57:32 -0700 message: * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)). This produces more-accurate results. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-08 17:22:15 +0000 +++ src/ChangeLog 2012-09-08 19:57:32 +0000 @@ -1,3 +1,8 @@ +2012-09-08 Paul Eggert + + * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)). + This produces more-accurate results. + 2012-09-08 Jan Djärv * nsterm.m (updateFrameSize): Call setFrame: on the view when size === modified file 'src/floatfns.c' --- src/floatfns.c 2012-09-07 08:46:44 +0000 +++ src/floatfns.c 2012-09-08 19:57:32 +0000 @@ -265,12 +265,12 @@ (register Lisp_Object arg) { double d = extract_float (arg); +#ifdef FLOAT_CHECK_DOMAIN double c = cos (d); -#ifdef FLOAT_CHECK_DOMAIN if (c == 0.0) domain_error ("tan", arg); #endif - IN_FLOAT (d = sin (d) / c, "tan", arg); + IN_FLOAT (d = tan (d), "tan", arg); return make_float (d); } ------------------------------------------------------------ revno: 109943 fixes bug: http://debbugs.gnu.org/12088 committer: Jan D. branch nick: trunk timestamp: Sat 2012-09-08 19:22:15 +0200 message: * nsterm.m (updateFrameSize): Call setFrame: on the view when size changes. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-08 14:23:01 +0000 +++ src/ChangeLog 2012-09-08 17:22:15 +0000 @@ -1,3 +1,8 @@ +2012-09-08 Jan Djärv + + * nsterm.m (updateFrameSize): Call setFrame: on the view when size + changes (Bug#12088). + 2012-09-08 Chong Yidong * syntax.c (Fstring_to_syntax): Doc fix. === modified file 'src/nsterm.m' --- src/nsterm.m 2012-09-08 12:48:33 +0000 +++ src/nsterm.m 2012-09-08 17:22:15 +0000 @@ -5374,11 +5374,13 @@ if (oldr != rows || oldc != cols || neww != oldw || newh != oldh) { + NSView *view = FRAME_NS_VIEW (emacsframe); FRAME_PIXEL_WIDTH (emacsframe) = neww; FRAME_PIXEL_HEIGHT (emacsframe) = newh; change_frame_size (emacsframe, rows, cols, 0, 0, 1); SET_FRAME_GARBAGED (emacsframe); cancel_mouse_face (emacsframe); + [view setFrame: NSMakeRect (0, 0, neww, newh)]; } } ------------------------------------------------------------ revno: 109942 committer: Dmitry Gutov branch nick: trunk timestamp: Sat 2012-09-08 19:34:41 +0400 message: * progmodes/ruby-mode.el (ruby-match-expression-expansion): Shorten previous change. diff: === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2012-09-08 15:13:14 +0000 +++ lisp/progmodes/ruby-mode.el 2012-09-08 15:34:41 +0000 @@ -1550,8 +1550,7 @@ (defun ruby-match-expression-expansion (limit) (when (re-search-forward "[^\\]\\(\\\\\\\\\\)*\\(#\\({[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\|\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+\\)\\)" limit 'move) (or (ruby-in-ppss-context-p 'string) - (and (< (point) limit) - (ruby-match-expression-expansion limit))))) + (ruby-match-expression-expansion limit)))) ;;;###autoload (define-derived-mode ruby-mode prog-mode "Ruby" ------------------------------------------------------------ revno: 109941 committer: Dmitry Gutov branch nick: trunk timestamp: Sat 2012-09-08 19:13:14 +0400 message: * lisp/progmodes/ruby-mode.el (ruby-match-expression-expansion): Only fail when reached LIMIT. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-08 14:48:26 +0000 +++ lisp/ChangeLog 2012-09-08 15:13:14 +0000 @@ -1,3 +1,8 @@ +2012-09-08 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-match-expression-expansion): Only + fail when reached LIMIT. + 2012-09-08 Chong Yidong * dired.el (dired-mode-map): Don't bind M-=. === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2012-09-07 05:06:05 +0000 +++ lisp/progmodes/ruby-mode.el 2012-09-08 15:13:14 +0000 @@ -1549,7 +1549,9 @@ (defun ruby-match-expression-expansion (limit) (when (re-search-forward "[^\\]\\(\\\\\\\\\\)*\\(#\\({[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\|\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+\\)\\)" limit 'move) - (ruby-in-ppss-context-p 'string))) + (or (ruby-in-ppss-context-p 'string) + (and (< (point) limit) + (ruby-match-expression-expansion limit))))) ;;;###autoload (define-derived-mode ruby-mode prog-mode "Ruby" === modified file 'test/automated/ruby-mode-tests.el' --- test/automated/ruby-mode-tests.el 2012-09-07 04:15:56 +0000 +++ test/automated/ruby-mode-tests.el 2012-09-08 15:13:14 +0000 @@ -237,10 +237,12 @@ 'font-lock-variable-name-face) (ruby-assert-face "\"This is \\#{no interpolation} despite the #\"" 15 'font-lock-string-face) - (ruby-assert-face "#@comment, not ruby code" 3 'font-lock-comment-face) - (ruby-assert-state "#@comment, not ruby code" 4 t) + (ruby-assert-face "\n#@comment, not ruby code" 5 'font-lock-comment-face) + (ruby-assert-state "\n#@comment, not ruby code" 4 t) (ruby-assert-face "# A comment cannot have #{an interpolation} in it" - 30 'font-lock-comment-face)) + 30 'font-lock-comment-face) + (ruby-assert-face "# #{comment}\n \"#{interpolation}\"" 16 + 'font-lock-variable-name-face)) (provide 'ruby-mode-tests) ------------------------------------------------------------ revno: 109940 committer: Chong Yidong branch nick: trunk timestamp: Sat 2012-09-08 22:48:26 +0800 message: Don't bind M-= in Dired. * lisp/dired.el (dired-mode-map): Don't bind M-=. * lisp/dired-aux.el (dired-diff): Use backup file as default. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-09-08 13:28:11 +0000 +++ etc/NEWS 2012-09-08 14:48:26 +0000 @@ -423,6 +423,13 @@ if the command ends in `;' (when operating on multiple files). Otherwise, it executes the command on each file in parallel. +*** The minibuffer default for `=' (`dired-diff) has changed. +It is now the backup file for the file at point, if one exists, rather +than the file at the mark. + +*** `M-=' is no longer bound to `dired-backup-diff' in Dired buffers. +The global binding for `M-=', `count-words-region' is in effect. + ** Shell *** New option `async-shell-command-buffer' specifies what buffer to use === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-08 14:30:09 +0000 +++ lisp/ChangeLog 2012-09-08 14:48:26 +0000 @@ -1,3 +1,9 @@ +2012-09-08 Chong Yidong + + * dired.el (dired-mode-map): Don't bind M-=. + + * dired-aux.el (dired-diff): Use backup file as default. + 2012-09-08 Drew Adams * subr.el (add-to-history): Fix delete usage (Bug#12314). === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2012-07-17 18:40:15 +0000 +++ lisp/dired-aux.el 2012-09-08 14:48:26 +0000 @@ -54,43 +54,30 @@ ;;;###autoload (defun dired-diff (file &optional switches) "Compare file at point with file FILE using `diff'. -FILE defaults to the file at the mark. (That's the mark set by -\\[set-mark-command], not by Dired's \\[dired-mark] command.) -The prompted-for FILE is the first file given to `diff'. +If called interactively, prompt for FILE; if the file at point +has a backup file, use that as the default. + +FILE is the first file given to `diff'. With prefix arg, prompt for second argument SWITCHES, which is the string of command switches for `diff'." (interactive (let* ((current (dired-get-filename t)) - ;; Get the file at the mark. - (file-at-mark (if (mark t) - (save-excursion (goto-char (mark t)) - (dired-get-filename t t)))) - ;; Use it as default if it's not the same as the current file, - ;; and the target dir is the current dir or the mark is active. - (default (if (and (not (equal file-at-mark current)) - (or (equal (dired-dwim-target-directory) - (dired-current-directory)) - mark-active)) - file-at-mark)) - (target-dir (if default - (dired-current-directory) - (dired-dwim-target-directory))) - (defaults (dired-dwim-target-defaults (list current) target-dir))) - (require 'diff) - (list - (minibuffer-with-setup-hook - (lambda () - (set (make-local-variable 'minibuffer-default-add-function) nil) - (setq minibuffer-default defaults)) - (read-file-name - (format "Diff %s with%s: " current - (if default (format " (default %s)" default) "")) - target-dir default t)) - (if current-prefix-arg - (read-string "Options for diff: " - (if (stringp diff-switches) - diff-switches - (mapconcat 'identity diff-switches " "))))))) + (oldf (file-newest-backup current)) + (dir (if oldf (file-name-directory oldf)))) + (list (read-file-name + (format "Diff %s with%s: " + (file-name-nondirectory current) + (if oldf + (concat " (default " + (file-name-nondirectory oldf) + ")") + "")) + dir oldf t) + (if current-prefix-arg + (read-string "Options for diff: " + (if (stringp diff-switches) + diff-switches + (mapconcat 'identity diff-switches " "))))))) (let ((current (dired-get-filename t))) (when (or (equal (expand-file-name file) (expand-file-name current)) === modified file 'lisp/dired.el' --- lisp/dired.el 2012-09-03 08:54:25 +0000 +++ lisp/dired.el 2012-09-08 14:48:26 +0000 @@ -1410,7 +1410,6 @@ (define-key map "&" 'dired-do-async-shell-command) ;; Comparison commands (define-key map "=" 'dired-diff) - (define-key map "\M-=" 'dired-backup-diff) ;; Tree Dired commands (define-key map "\M-\C-?" 'dired-unmark-all-files) (define-key map "\M-\C-d" 'dired-tree-down) @@ -3745,14 +3744,15 @@ ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff -;;;;;; dired-diff) "dired-aux" "dired-aux.el" "9499f79f5853da0aa93d26465c7bf3a1") +;;;;;; dired-diff) "dired-aux" "dired-aux.el" "4b260eda371d319a6c8e8e5ec917e287") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ Compare file at point with file FILE using `diff'. -FILE defaults to the file at the mark. (That's the mark set by -\\[set-mark-command], not by Dired's \\[dired-mark] command.) -The prompted-for FILE is the first file given to `diff'. +If called interactively, prompt for FILE; if the file at point +has a backup file, use that as the default. + +FILE is the first file given to `diff'. With prefix arg, prompt for second argument SWITCHES, which is the string of command switches for `diff'. ------------------------------------------------------------ revno: 109939 fixes bug: http://debbugs.gnu.org/12314 author: Drew Adams committer: Chong Yidong branch nick: trunk timestamp: Sat 2012-09-08 22:30:09 +0800 message: * subr.el (add-to-history): Fix delete usage. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-08 14:23:01 +0000 +++ lisp/ChangeLog 2012-09-08 14:30:09 +0000 @@ -1,3 +1,7 @@ +2012-09-08 Drew Adams + + * subr.el (add-to-history): Fix delete usage (Bug#12314). + 2012-09-08 Chong Yidong * subr.el (syntax-after, syntax-class): Doc fix. === modified file 'lisp/subr.el' --- lisp/subr.el 2012-09-08 14:23:01 +0000 +++ lisp/subr.el 2012-09-08 14:30:09 +0000 @@ -1548,7 +1548,7 @@ (or keep-all (not (equal (car history) newelt)))) (if history-delete-duplicates - (delete newelt history)) + (setq history (delete newelt history))) (setq history (cons newelt history)) (when (integerp maxelt) (if (= 0 maxelt) ------------------------------------------------------------ revno: 109938 fixes bug: http://debbugs.gnu.org/12383 committer: Chong Yidong branch nick: trunk timestamp: Sat 2012-09-08 22:23:01 +0800 message: Introduce "raw syntax descriptor" terminology, and use it. * syntax.texi (Syntax Table Internals): Define "raw syntax descriptor" terminology. (Syntax Descriptors): Mention raw syntax descriptors. * lisp/subr.el (syntax-after, syntax-class): Doc fix. * syntax.c (Fstring_to_syntax): Doc fix. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-09-07 14:15:59 +0000 +++ doc/lispref/ChangeLog 2012-09-08 14:23:01 +0000 @@ -1,3 +1,9 @@ +2012-09-08 Chong Yidong + + * syntax.texi (Syntax Table Internals): Define "raw syntax + descriptor" terminology (Bug#12383). + (Syntax Descriptors): Mention raw syntax descriptors. + 2012-09-07 Chong Yidong * variables.texi (Creating Buffer-Local): Fix description of === modified file 'doc/lispref/syntax.texi' --- doc/lispref/syntax.texi 2012-09-07 04:51:26 +0000 +++ doc/lispref/syntax.texi 2012-09-08 14:23:01 +0000 @@ -130,6 +130,10 @@ punctuation, matching character slot unused, first character of a comment-starter, second character of a comment-ender). + Emacs also defines @dfn{raw syntax descriptors}, which are used to +describe syntax classes at a lower level. @xref{Syntax Table +Internals}. + @menu * Syntax Class Table:: Table of syntax classes. * Syntax Flags:: Additional flags each character can have. @@ -531,8 +535,9 @@ underlying text character. @item @code{(@var{syntax-code} . @var{matching-char})} -A cons cell of this format specifies the syntax for the underlying -text character. (@pxref{Syntax Table Internals}) +A cons cell of this format is a raw syntax descriptor (@pxref{Syntax +Table Internals}), which directly specifies a syntax class for the +underlying text character. @item @code{nil} If the property is @code{nil}, the character's syntax is determined from @@ -940,16 +945,20 @@ as syntax properties (@pxref{Syntax Properties}). @cindex syntax code - Each entry in a syntax table is a cons cell of the form -@code{(@var{syntax-code} . @var{matching-char})}. @var{syntax-code} -is an integer that encodes the syntax class and syntax flags, -according to the table below. @var{matching-char}, if non-@code{nil}, -specifies a matching character (similar to the second character in a -syntax descriptor). +@cindex raw syntax descriptor + Each entry in a syntax table is a @dfn{raw syntax descriptor}: a +cons cell of the form @code{(@var{syntax-code} +. @var{matching-char})}. @var{syntax-code} is an integer which +encodes the syntax class and syntax flags, according to the table +below. @var{matching-char}, if non-@code{nil}, specifies a matching +character (similar to the second character in a syntax descriptor). + + Here are the syntax codes corresponding to the various syntax +classes: @multitable @columnfractions .2 .3 .2 .3 @item -@i{Syntax code} @tab @i{Class} @tab @i{Syntax code} @tab @i{Class} +@i{Code} @tab @i{Class} @tab @i{Code} @tab @i{Class} @item 0 @tab whitespace @tab 8 @tab paired delimiter @item @@ -970,7 +979,7 @@ @noindent For example, in the standard syntax table, the entry for @samp{(} is -@code{(4 . 41)}. (41 is the character code for @samp{)}.) +@code{(4 . 41)}. 41 is the character code for @samp{)}. Syntax flags are encoded in higher order bits, starting 16 bits from the least significant bit. This table gives the power of two which @@ -990,33 +999,35 @@ @end multitable @defun string-to-syntax @var{desc} -Given a syntax descriptor @var{desc}, this function returns the -corresponding internal form, a cons cell @code{(@var{syntax-code} -. @var{matching-char})}. +Given a syntax descriptor @var{desc} (a string), this function returns +the corresponding raw syntax descriptor. @end defun @defun syntax-after pos -This function returns the syntax code of the character in the buffer -after position @var{pos}, taking account of syntax properties as well -as the syntax table. If @var{pos} is outside the buffer's accessible -portion (@pxref{Narrowing, accessible portion}), this function returns -@code{nil}. +This function returns the raw syntax descriptor for the character in +the buffer after position @var{pos}, taking account of syntax +properties as well as the syntax table. If @var{pos} is outside the +buffer's accessible portion (@pxref{Narrowing, accessible portion}), +the return value is @code{nil}. @end defun @defun syntax-class syntax -This function returns the syntax class of the syntax code -@var{syntax}. (It masks off the high 16 bits that hold the flags -encoded in the syntax descriptor.) If @var{syntax} is @code{nil}, it -returns @code{nil}; this is so evaluating the expression +This function returns the syntax code for the raw syntax descriptor +@var{syntax}. More precisely, it takes the raw syntax descriptor's +@var{syntax-code} component, masks off the high 16 bits which record +the syntax flags, and returns the resulting integer. + +If @var{syntax} is @code{nil}, the return value is returns @code{nil}. +This is so that the expression @example (syntax-class (syntax-after pos)) @end example @noindent -where @code{pos} is outside the buffer's accessible portion, will -yield @code{nil} without throwing errors or producing wrong syntax -class codes. +evaluates to @code{nil} if @code{pos} is outside the buffer's +accessible portion, without throwing errors or returning an incorrect +code. @end defun @node Categories === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-08 13:28:11 +0000 +++ lisp/ChangeLog 2012-09-08 14:23:01 +0000 @@ -1,3 +1,7 @@ +2012-09-08 Chong Yidong + + * subr.el (syntax-after, syntax-class): Doc fix. + 2012-09-08 Martin Rudalics * window.el (display-buffer-in-previous-window): New buffer === modified file 'lisp/subr.el' --- lisp/subr.el 2012-09-07 10:19:58 +0000 +++ lisp/subr.el 2012-09-08 14:23:01 +0000 @@ -3737,7 +3737,7 @@ table)) (defun syntax-after (pos) - "Return the raw syntax of the char after POS. + "Return the raw syntax descriptor for the char after POS. If POS is outside the buffer's accessible portion, return nil." (unless (or (< pos (point-min)) (>= pos (point-max))) (let ((st (if parse-sexp-lookup-properties @@ -3746,7 +3746,12 @@ (aref (or st (syntax-table)) (char-after pos)))))) (defun syntax-class (syntax) - "Return the syntax class part of the syntax descriptor SYNTAX. + "Return the code for the syntax class described by SYNTAX. + +SYNTAX should be a raw syntax descriptor; the return value is a +integer which encodes the corresponding syntax class. See Info +node `(elisp)Syntax Table Internals' for a list of codes. + If SYNTAX is nil, return nil." (and syntax (logand (car syntax) 65535))) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-08 12:48:33 +0000 +++ src/ChangeLog 2012-09-08 14:23:01 +0000 @@ -1,3 +1,7 @@ +2012-09-08 Chong Yidong + + * syntax.c (Fstring_to_syntax): Doc fix. + 2012-09-08 Jan Djärv * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe === modified file 'src/syntax.c' --- src/syntax.c 2012-08-18 06:06:39 +0000 +++ src/syntax.c 2012-09-08 14:23:01 +0000 @@ -921,11 +921,11 @@ } DEFUN ("string-to-syntax", Fstring_to_syntax, Sstring_to_syntax, 1, 1, 0, - doc: /* Convert a syntax specification STRING into syntax cell form. -STRING should be a string as it is allowed as argument of -`modify-syntax-entry'. Value is the equivalent cons cell -\(CODE . MATCHING-CHAR) that can be used as value of a `syntax-table' -text property. */) + doc: /* Convert a syntax descriptor STRING into a raw syntax descriptor. +STRING should be a string of the form allowed as argument of +`modify-syntax-entry'. The return value is a raw syntax descriptor: a +cons cell \(CODE . MATCHING-CHAR) which can be used, for example, as +the value of a `syntax-table' text property. */) (Lisp_Object string) { register const unsigned char *p; ------------------------------------------------------------ revno: 109937 committer: martin rudalics branch nick: trunk timestamp: Sat 2012-09-08 15:28:11 +0200 message: Fix handling of debugger window. (Bug#8789) * window.el (display-buffer-in-previous-window): New buffer display action function. * emacs-lisp/debug.el (debugger-bury-or-kill): New option. (debugger-previous-window): New variable. (debug): Rewrite using display-buffer-in-previous-window, quit-restore-window and debugger-bury-or-kill. (Bug#8789) diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-09-07 10:27:11 +0000 +++ etc/NEWS 2012-09-08 13:28:11 +0000 @@ -645,6 +645,8 @@ ** New error type and new function `user-error'. Doesn't trigger the debugger. +** New option `debugger-bury-or-kill'. + +++ ** New utility function `buffer-narrowed-p'. @@ -653,20 +655,25 @@ *** The functions get-lru-window, get-mru-window and get-largest-window now accept a third argument to avoid choosing the selected window. -*** New macro with-temp-buffer-window. - -*** New option temp-buffer-resize-frames. - -*** New function fit-frame-to-buffer and new option - fit-frame-to-buffer-bottom-margin. - -*** New display action function display-buffer-below-selected. - -*** New display action alist `inhibit-switch-frame', if non-nil, tells -display action functions to avoid changing which frame is selected. - -*** New display action alist `pop-up-frame-parameters', if non-nil, -specifies frame parameters to give any newly-created frame. +*** New macro `with-temp-buffer-window'. + +*** New option `temp-buffer-resize-frames'. + +*** New function `fit-frame-to-buffer' and new option + `fit-frame-to-buffer-bottom-margin'. + +*** New display action functions `display-buffer-below-selected' and +`display-buffer-in-previous-window'. + +*** New display action alist entry `inhibit-switch-frame', if non-nil, +tells display action functions to avoid changing which frame is +selected. + +*** New display action alist entry `pop-up-frame-parameters', if +non-nil, specifies frame parameters to give any newly-created frame. + +*** New display action alist entry `previous-window', if non-nil, +specifies window to reuse in `display-buffer-in-previous-window'. *** The following variables are obsolete, as they can be replaced by appropriate entries in the `display-buffer-alist' function introduced === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-07 20:14:55 +0000 +++ lisp/ChangeLog 2012-09-08 13:28:11 +0000 @@ -1,3 +1,13 @@ +2012-09-08 Martin Rudalics + + * window.el (display-buffer-in-previous-window): New buffer + display action function. + + * emacs-lisp/debug.el (debugger-bury-or-kill): New option. + (debugger-previous-window): New variable. + (debug): Rewrite using display-buffer-in-previous-window, + quit-restore-window and debugger-bury-or-kill. (Bug#8789) + 2012-09-07 Stefan Monnier * emacs-lisp/byte-run.el (defun): Tweak message. Simplify code. === modified file 'lisp/emacs-lisp/debug.el' --- lisp/emacs-lisp/debug.el 2012-07-26 01:27:33 +0000 +++ lisp/emacs-lisp/debug.el 2012-09-08 13:28:11 +0000 @@ -48,6 +48,39 @@ :group 'debugger :version "21.1") +(defcustom debugger-bury-or-kill 'bury + "How to proceed with the debugger buffer when exiting `debug'. +The value used here affects the behavior of operations on any +window previously showing the debugger buffer. + +`nil' means that if its window is not deleted when exiting the + debugger, invoking `switch-to-prev-buffer' will usually show + the debugger buffer again. + +`append' means that if the window is not deleted, the debugger + buffer moves to the end of the window's previous buffers so + it's less likely that a future invocation of + `switch-to-prev-buffer' will switch to it. Also, it moves the + buffer to the end of the frame's buffer list. + +`bury' means that if the window is not deleted, its buffer is + removed from the window's list of previous buffers. Also, it + moves the buffer to the end of the frame's buffer list. This + value provides the most reliable remedy to not have + `switch-to-prev-buffer' switch to the debugger buffer again + without killing the buffer. + +`kill' means to kill the debugger buffer. + +The value used here is passed to `quit-restore-window'." + :type '(choice + (const :tag "Keep alive" nil) + (const :tag "Append" 'append) + (const :tag "Bury" 'bury) + (const :tag "Kill" 'kill)) + :group 'debugger + :version "24.2") + (defvar debug-function-list nil "List of functions currently set for debug on entry.") @@ -60,6 +93,9 @@ (defvar debugger-old-buffer nil "This is the buffer that was current when the debugger was entered.") +(defvar debugger-previous-window nil + "This is the window last showing the debugger buffer.") + (defvar debugger-previous-backtrace nil "The contents of the previous backtrace (including text properties). This is to optimize `debugger-make-xrefs'.") @@ -133,7 +169,7 @@ (with-current-buffer (get-buffer "*Backtrace*") (list major-mode (buffer-string))))) (debugger-buffer (get-buffer-create "*Backtrace*")) - (debugger-old-buffer (current-buffer)) + (debugger-window nil) (debugger-step-after-exit nil) (debugger-will-be-back nil) ;; Don't keep reading from an executing kbd macro! @@ -184,78 +220,63 @@ (cursor-in-echo-area nil)) (unwind-protect (save-excursion - (save-window-excursion - (with-no-warnings - (setq unread-command-char -1)) - (when (eq (car debugger-args) 'debug) - ;; Skip the frames for backtrace-debug, byte-code, - ;; and implement-debug-on-entry. - (backtrace-debug 4 t) - ;; Place an extra debug-on-exit for macro's. - (when (eq 'lambda (car-safe (cadr (backtrace-frame 4)))) - (backtrace-debug 5 t))) - (pop-to-buffer debugger-buffer) - (debugger-mode) - (debugger-setup-buffer debugger-args) - (when noninteractive - ;; If the backtrace is long, save the beginning - ;; and the end, but discard the middle. - (when (> (count-lines (point-min) (point-max)) - debugger-batch-max-lines) - (goto-char (point-min)) - (forward-line (/ 2 debugger-batch-max-lines)) - (let ((middlestart (point))) - (goto-char (point-max)) - (forward-line (- (/ 2 debugger-batch-max-lines) - debugger-batch-max-lines)) - (delete-region middlestart (point))) - (insert "...\n")) + (with-no-warnings + (setq unread-command-char -1)) + (when (eq (car debugger-args) 'debug) + ;; Skip the frames for backtrace-debug, byte-code, + ;; and implement-debug-on-entry. + (backtrace-debug 4 t) + ;; Place an extra debug-on-exit for macro's. + (when (eq 'lambda (car-safe (cadr (backtrace-frame 4)))) + (backtrace-debug 5 t))) + (pop-to-buffer + debugger-buffer + `((display-buffer-reuse-window + display-buffer-in-previous-window) + . (,(when debugger-previous-window + `(previous-window . ,debugger-previous-window))))) + (setq debugger-window (selected-window)) + (setq debugger-previous-window debugger-window) + (debugger-mode) + (debugger-setup-buffer debugger-args) + (when noninteractive + ;; If the backtrace is long, save the beginning + ;; and the end, but discard the middle. + (when (> (count-lines (point-min) (point-max)) + debugger-batch-max-lines) (goto-char (point-min)) - (message "%s" (buffer-string)) - (kill-emacs -1)) + (forward-line (/ 2 debugger-batch-max-lines)) + (let ((middlestart (point))) + (goto-char (point-max)) + (forward-line (- (/ 2 debugger-batch-max-lines) + debugger-batch-max-lines)) + (delete-region middlestart (point))) + (insert "...\n")) + (goto-char (point-min)) + (message "%s" (buffer-string)) + (kill-emacs -1)) + (message "") + (let ((standard-output nil) + (buffer-read-only t)) (message "") - (let ((standard-output nil) - (buffer-read-only t)) - (message "") - ;; Make sure we unbind buffer-read-only in the right buffer. - (save-excursion - (recursive-edit))))) - ;; Kill or at least neuter the backtrace buffer, so that users - ;; don't try to execute debugger commands in an invalid context. - (if (get-buffer-window debugger-buffer 0) - ;; Still visible despite the save-window-excursion? Maybe it - ;; it's in a pop-up frame. It would be annoying to delete and - ;; recreate it every time the debugger stops, so instead we'll - ;; erase it (and maybe hide it) but keep it alive. - (with-current-buffer debugger-buffer - (with-selected-window (get-buffer-window debugger-buffer 0) - (when (and (window-dedicated-p (selected-window)) - (not debugger-will-be-back)) - ;; If the window is not dedicated, burying the buffer - ;; will mean that the frame created for it is left - ;; around showing some random buffer, and next time we - ;; pop to the debugger buffer we'll create yet - ;; another frame. - ;; If debugger-will-be-back is non-nil, the frame - ;; would need to be de-iconified anyway immediately - ;; after when we re-enter the debugger, so iconifying it - ;; here would cause flashing. - ;; Drew Adams is not happy with this: he wants to frame - ;; to be left at the top-level, still working on how - ;; best to do that. - (bury-buffer)))) - (unless debugger-previous-state - (kill-buffer debugger-buffer))) - ;; Restore the previous state of the debugger-buffer, in case we were - ;; in a recursive invocation of the debugger. - (when (buffer-live-p debugger-buffer) - (with-current-buffer debugger-buffer - (let ((inhibit-read-only t)) - (erase-buffer) - (if (null debugger-previous-state) - (fundamental-mode) - (insert (nth 1 debugger-previous-state)) - (funcall (nth 0 debugger-previous-state)))))) + ;; Make sure we unbind buffer-read-only in the right buffer. + (save-excursion + (recursive-edit)))) + (when (and (window-live-p debugger-window) + (eq (window-buffer debugger-window) debugger-buffer)) + ;; Unshow debugger-buffer. + (quit-restore-window debugger-window debugger-bury-or-kill)) + ;; Restore previous state of debugger-buffer in case we were + ;; in a recursive invocation of the debugger, otherwise just + ;; erase the buffer and put it into fundamental mode. + (when (buffer-live-p debugger-buffer) + (with-current-buffer debugger-buffer + (let ((inhibit-read-only t)) + (erase-buffer) + (if (null debugger-previous-state) + (fundamental-mode) + (insert (nth 1 debugger-previous-state)) + (funcall (nth 0 debugger-previous-state)))))) (with-timeout-unsuspend debugger-with-timeout-suspend) (set-match-data debugger-outer-match-data))) ;; Put into effect the modified values of these variables === modified file 'lisp/window.el' --- lisp/window.el 2012-09-07 13:53:21 +0000 +++ lisp/window.el 2012-09-08 13:28:11 +0000 @@ -5521,6 +5521,62 @@ (window--display-buffer buffer window 'reuse display-buffer-mark-dedicated))))) +(defun display-buffer-in-previous-window (buffer alist) + "Display BUFFER in a window previously showing it. +If ALIST has a non-nil `inhibit-same-window' entry, the selected +window is not eligible for reuse. + +If ALIST contains a `reusable-frames' entry, its value determines +which frames to search for a reusable window: + nil -- the selected frame (actually the last non-minibuffer frame) + A frame -- just that frame + `visible' -- all visible frames + 0 -- all frames on the current terminal + t -- all frames. + +If ALIST contains no `reusable-frames' entry, search just the +selected frame if `display-buffer-reuse-frames' and +`pop-up-frames' are both nil; search all frames on the current +terminal if either of those variables is non-nil. + +If ALIST has a `previous-window' entry, the window specified by +that entry will override any other window found by the methods +above, even if that window never showed BUFFER before." + (let* ((alist-entry (assq 'reusable-frames alist)) + (inhibit-same-window + (cdr (assq 'inhibit-same-window alist))) + (frames (cond + (alist-entry (cdr alist-entry)) + ((if (eq pop-up-frames 'graphic-only) + (display-graphic-p) + pop-up-frames) + 0) + (display-buffer-reuse-frames 0) + (t (last-nonminibuffer-frame)))) + entry best-window second-best-window window) + ;; Scan windows whether they have shown the buffer recently. + (catch 'best + (dolist (window (window-list-1 (frame-first-window) 'nomini frames)) + (when (and (assq buffer (window-prev-buffers window)) + (not (window-dedicated-p window))) + (if (eq window (selected-window)) + (unless inhibit-same-window + (setq second-best-window window)) + (setq best-window window) + (throw 'best t))))) + ;; When ALIST has a `previous-window' entry, that entry may override + ;; anything we found so far. + (when (and (setq window (cdr (assq 'previous-window alist))) + (window-live-p window) + (not (window-dedicated-p window))) + (if (eq window (selected-window)) + (unless inhibit-same-window + (setq second-best-window window)) + (setq best-window window))) + ;; Return best or second best window found. + (when (setq window (or best-window second-best-window)) + (window--display-buffer buffer window 'reuse)))) + (defun display-buffer-use-some-window (buffer alist) "Display BUFFER in an existing window. Search for a usable window, set that window to the buffer, and ------------------------------------------------------------ revno: 109936 fixes bug: http://debbugs.gnu.org/11052 committer: Jan D. branch nick: trunk timestamp: Sat 2012-09-08 14:48:33 +0200 message: * nsterm.h (EmacsView): Add updateFrameSize. * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe in the internal border. (x_set_window_size): Remove static variables and their usage. (ns_redraw_scroll_bars): Fix NSTRACE arg. (ns_after_update_window_line, ns_draw_fringe_bitmap): Remove fringe/internal border adjustment. (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c). (ns_draw_window_cursor): Remove fringe/internal border adjustment. (ns_fix_rect_ibw): Remove. (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw. (ns_dumpglyphs_box_or_relief): Ditto. (ns_maybe_dumpglyphs_background): Remove fringe/internal border adjustment. (ns_dumpglyphs_image): Ditto. (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal border adjustment. (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and their usage. Add fringe_extended_p and its use as in other terms. (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if scroll bar was removed. (updateFrameSize): New function. (windowDidResize): Move code to updateFrameSize and call it. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-07 14:45:28 +0000 +++ src/ChangeLog 2012-09-08 12:48:33 +0000 @@ -1,3 +1,30 @@ +2012-09-08 Jan Djärv + + * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe + in the internal border. + (x_set_window_size): Remove static variables and their usage. + (ns_redraw_scroll_bars): Fix NSTRACE arg. + (ns_after_update_window_line, ns_draw_fringe_bitmap): Remove + fringe/internal border adjustment (Bug#11052). + (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c). + (ns_draw_window_cursor): Remove fringe/internal border adjustment. + (ns_fix_rect_ibw): Remove. + (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw. + (ns_dumpglyphs_box_or_relief): Ditto. + (ns_maybe_dumpglyphs_background): Remove fringe/internal border + adjustment. + (ns_dumpglyphs_image): Ditto. + (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal + border adjustment. + (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and + their usage. Add fringe_extended_p and its use as in other terms. + (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if + scroll bar was removed. + (updateFrameSize): New function. + (windowDidResize): Move code to updateFrameSize and call it. + + * nsterm.h (EmacsView): Add updateFrameSize. + 2012-09-07 Chong Yidong * textprop.c (Fget_text_property): Minor doc fix (Bug#12323). === modified file 'src/nsterm.h' --- src/nsterm.h 2012-09-01 06:38:52 +0000 +++ src/nsterm.h 2012-09-08 12:48:33 +0000 @@ -103,6 +103,7 @@ - (void) setWindowClosing: (BOOL)closing; - (EmacsToolbar *) toolbar; - (void) deleteWorkingText; +- (void) updateFrameSize; #ifdef NS_IMPL_GNUSTEP /* Not declared, but useful. */ === modified file 'src/nsterm.m' --- src/nsterm.m 2012-09-04 17:34:54 +0000 +++ src/nsterm.m 2012-09-08 12:48:33 +0000 @@ -871,25 +871,12 @@ window_box (w, area, &window_x, &window_y, &window_width, 0); - clip_rect.origin.x = window_x - FRAME_INTERNAL_BORDER_WIDTH (f); + clip_rect.origin.x = window_x; clip_rect.origin.y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, row->y)); clip_rect.origin.y = max (clip_rect.origin.y, window_y); - clip_rect.size.width = window_width + 2 * FRAME_INTERNAL_BORDER_WIDTH (f); + clip_rect.size.width = window_width; clip_rect.size.height = row->visible_height; - /* allow a full-height row at the top when requested - (used to draw fringe all the way through internal border area) */ - if (gc && clip_rect.origin.y < 5) - { - clip_rect.origin.y -= FRAME_INTERNAL_BORDER_WIDTH (f); - clip_rect.size.height += FRAME_INTERNAL_BORDER_WIDTH (f); - } - - /* likewise at bottom */ - if (gc && - FRAME_PIXEL_HEIGHT (f) - (clip_rect.origin.y + clip_rect.size.height) < 5) - clip_rect.size.height += FRAME_INTERNAL_BORDER_WIDTH (f); - ns_focus (f, &clip_rect, 1); } @@ -1237,18 +1224,10 @@ NSRect wr = [window frame]; int tb = FRAME_EXTERNAL_TOOL_BAR (f); int pixelwidth, pixelheight; - static int oldRows, oldCols, oldFontWidth, oldFontHeight; - static int oldTB; - static struct frame *oldF; NSTRACE (x_set_window_size); - if (view == nil || - (f == oldF - && rows == oldRows && cols == oldCols - && oldFontWidth == FRAME_COLUMN_WIDTH (f) - && oldFontHeight == FRAME_LINE_HEIGHT (f) - && oldTB == tb)) + if (view == nil) return; /*fprintf (stderr, "\tsetWindowSize: %d x %d, font size %d x %d\n", cols, rows, FRAME_COLUMN_WIDTH (f), FRAME_LINE_HEIGHT (f)); */ @@ -1256,12 +1235,6 @@ BLOCK_INPUT; check_frame_size (f, &rows, &cols); - oldF = f; - oldRows = rows; - oldCols = cols; - oldFontWidth = FRAME_COLUMN_WIDTH (f); - oldFontHeight = FRAME_LINE_HEIGHT (f); - oldTB = tb; f->scroll_bar_actual_width = NS_SCROLL_BAR_WIDTH (f); compute_fringe_widths (f, 0); @@ -1939,7 +1912,7 @@ int i; id view; NSArray *subviews = [[FRAME_NS_VIEW (f) superview] subviews]; - NSTRACE (ns_judge_scroll_bars); + NSTRACE (ns_redraw_scroll_bars); for (i =[subviews count]-1; i >= 0; i--) { view = [subviews objectAtIndex: i]; @@ -2125,9 +2098,9 @@ desired_row->redraw_fringe_bitmaps_p = 1; /* When a window has disappeared, make sure that no rest of - full-width rows stays visible in the internal border. - Under NS this is drawn inside the fringes. */ + full-width rows stays visible in the internal border. */ if (windows_or_buffers_changed + && desired_row->full_width_p && (f = XFRAME (w->frame), width = FRAME_INTERNAL_BORDER_WIDTH (f), width != 0) @@ -2136,24 +2109,11 @@ { int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y)); - /* Internal border is drawn below the tool bar. */ - if (WINDOWP (f->tool_bar_window) - && w == XWINDOW (f->tool_bar_window)) - y -= width; - /* end copy from other terms */ - BLOCK_INPUT; - if (!desired_row->full_width_p) - { - int x1 = WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (w) - + WINDOW_LEFT_FRINGE_WIDTH (w); - int x2 = WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (w) - + FRAME_PIXEL_WIDTH (f) - NS_SCROLL_BAR_WIDTH (f) - - WINDOW_RIGHT_FRINGE_WIDTH (w) - - FRAME_INTERNAL_BORDER_WIDTH (f); - ns_clear_frame_area (f, x1, y, width, height); - ns_clear_frame_area (f, x2, y, width, height); - } + ns_clear_frame_area (f, 0, y, width, height); + ns_clear_frame_area (f, + FRAME_PIXEL_WIDTH (f) - width, + y, width, height); UNBLOCK_INPUT; } } @@ -2238,17 +2198,6 @@ int rowY; static EmacsImage **bimgs = NULL; static int nBimgs = 0; - /* NS-specific: move internal border inside fringe */ - int x = p->bx < 0 ? p->x : p->bx; - int wd = p->bx < 0 ? p->wd : p->nx; - BOOL fringeOnVeryLeft - = x - WINDOW_LEFT_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w) - - FRAME_INTERNAL_BORDER_WIDTH (f) < 10; - BOOL fringeOnVeryRight - = FRAME_PIXEL_WIDTH (f) - x - wd - FRAME_INTERNAL_BORDER_WIDTH (f) - - WINDOW_RIGHT_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w) < 10; - int xAdjust = FRAME_INTERNAL_BORDER_WIDTH (f) * - (fringeOnVeryLeft ? -1 : (fringeOnVeryRight ? 1 : 0)); /* grow bimgs if needed */ if (nBimgs < max_used_fringe_bitmap) @@ -2263,22 +2212,68 @@ rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); ns_clip_to_row (w, row, -1, YES); - if (p->bx >= 0 && !p->overlay_p) + if (!p->overlay_p) { - int yAdjust = rowY - FRAME_INTERNAL_BORDER_WIDTH (f) < 5 ? - -FRAME_INTERNAL_BORDER_WIDTH (f) : 0; - int yIncr = FRAME_PIXEL_HEIGHT (f) - (p->by+yAdjust + p->ny) < 5 ? - FRAME_INTERNAL_BORDER_WIDTH (f) : 0 - + (yAdjust ? FRAME_INTERNAL_BORDER_WIDTH (f) : 0); - NSRect r = NSMakeRect (p->bx+xAdjust, p->by+yAdjust, p->nx, p->ny+yIncr); - NSRectClip (r); - [ns_lookup_indexed_color(face->background, f) set]; - NSRectFill (r); + int bx = p->bx, by = p->by, nx = p->nx, ny = p->ny; + + /* If the fringe is adjacent to the left (right) scroll bar of a + leftmost (rightmost, respectively) window, then extend its + background to the gap between the fringe and the bar. */ + if ((WINDOW_LEFTMOST_P (w) + && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)) + || (WINDOW_RIGHTMOST_P (w) + && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))) + { + int sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w); + + if (sb_width > 0) + { + int bar_area_x = WINDOW_SCROLL_BAR_AREA_X (w); + int bar_area_width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w) + * FRAME_COLUMN_WIDTH (f)); + + if (bx < 0) + { + /* Bitmap fills the fringe. */ + if (bar_area_x + bar_area_width == p->x) + bx = bar_area_x + sb_width; + else if (p->x + p->wd == bar_area_x) + bx = bar_area_x; + if (bx >= 0) + { + int header_line_height = WINDOW_HEADER_LINE_HEIGHT (w); + + nx = bar_area_width - sb_width; + by = WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, + row->y)); + ny = row->visible_height; + } + } + else + { + if (bar_area_x + bar_area_width == bx) + { + bx = bar_area_x + sb_width; + nx += bar_area_width - sb_width; + } + else if (bx + nx == bar_area_x) + nx += bar_area_width - sb_width; + } + } + } + + if (bx >= 0 && nx > 0) + { + NSRect r = NSMakeRect (bx, by, nx, ny); + NSRectClip (r); + [ns_lookup_indexed_color (face->background, f) set]; + NSRectFill (r); + } } if (p->which) { - NSRect r = NSMakeRect (p->x+xAdjust, p->y, p->wd, p->h); + NSRect r = NSMakeRect (p->x, p->y, p->wd, p->h); EmacsImage *img = bimgs[p->which - 1]; if (!img) @@ -2288,7 +2283,7 @@ int i; unsigned char *cbits = xmalloc (len); - for (i =0; ih flip: NO]; @@ -2386,14 +2381,6 @@ r.size.height = h; r.size.width = w->phys_cursor_width; - /* FIXME: if we overwrite the internal border area, it does not get erased; - fix by truncating cursor, but better would be to erase properly */ - overspill = r.origin.x + r.size.width - - WINDOW_TEXT_TO_FRAME_PIXEL_X (w, WINDOW_BOX_RIGHT_EDGE_X (w) - - WINDOW_TOTAL_FRINGE_WIDTH (w) - FRAME_INTERNAL_BORDER_WIDTH (f)); - if (overspill > 0) - r.size.width -= overspill; - /* TODO: only needed in rare cases with last-resort font in HELLO.. should we do this more efficiently? */ ns_clip_to_row (w, glyph_row, -1, NO); /* do ns_focus(f, &r, 1); if remove */ @@ -2517,31 +2504,6 @@ ========================================================================== */ - -static inline NSRect -ns_fix_rect_ibw (NSRect r, int fibw, int frame_pixel_width) -/* -------------------------------------------------------------------------- - Under NS we draw internal borders inside fringes, and want full-width - rendering to go all the way to edge. This function makes that correction. - -------------------------------------------------------------------------- */ -{ - if (r.origin.y <= fibw+1) - { - r.size.height += r.origin.y; - r.origin.y = 0; - } - if (r.origin.x <= fibw+1) - { - r.size.width += r.origin.x; - r.origin.x = 0; - } - if (frame_pixel_width - (r.origin.x+r.size.width) <= fibw+1) - r.size.width += fibw; - - return r; -} - - static int ns_get_glyph_string_clip_rect (struct glyph_string *s, NativeRectangle *nr) /* -------------------------------------------------------------------------- @@ -2551,14 +2513,6 @@ -------------------------------------------------------------------------- */ { int n = get_glyph_string_clip_rects (s, nr, 2); - if (s->row->full_width_p) - { - *nr = ns_fix_rect_ibw (*nr, FRAME_INTERNAL_BORDER_WIDTH (s->f), - FRAME_PIXEL_WIDTH (s->f)); - if (n == 2) - *nr = ns_fix_rect_ibw (*(nr+1), FRAME_INTERNAL_BORDER_WIDTH (s->f), - FRAME_PIXEL_WIDTH (s->f)); - } return n; } @@ -2883,11 +2837,6 @@ r = NSMakeRect (s->x, s->y, right_x - s->x + 1, s->height); - /* expand full-width row over internal borders */ - if (s->row->full_width_p) - r = ns_fix_rect_ibw (r, FRAME_INTERNAL_BORDER_WIDTH (s->f), - FRAME_PIXEL_WIDTH (s->f)); - /* TODO: Sometimes box_color is 0 and this seems wrong; should investigate. */ if (s->face->box == FACE_SIMPLE_BOX && s->face->box_color) { @@ -2943,26 +2892,6 @@ NSRect r = NSMakeRect (s->x, s->y + box_line_width, s->background_width, s->height-2*box_line_width); - - /* expand full-width row over internal borders */ - if (s->row->full_width_p) - { - int fibw = FRAME_INTERNAL_BORDER_WIDTH (s->f); - if (r.origin.y <= fibw+1 + box_line_width) - { - r.size.height += r.origin.y; - r.origin.y = 0; - } - if (r.origin.x <= fibw+1) - { - r.size.width += 2*r.origin.x; - r.origin.x = 0; - } - if (FRAME_PIXEL_WIDTH (s->f) - (r.origin.x + r.size.width) - <= fibw+1) - r.size.width += fibw; - } - NSRectFill (r); } @@ -3028,24 +2957,6 @@ br = NSMakeRect (x, y, s->slice.width, s->slice.height); } - /* expand full-width row over internal borders */ - if (s->row->full_width_p) - { - int fibw = FRAME_INTERNAL_BORDER_WIDTH (s->f); - if (br.origin.y <= fibw+1 + box_line_vwidth) - { - br.size.height += br.origin.y; - br.origin.y = 0; - } - if (br.origin.x <= fibw+1 + box_line_vwidth) - { - br.size.width += br.origin.x; - br.origin.x = 0; - } - if (FRAME_PIXEL_WIDTH (s->f) - (br.origin.x + br.size.width) <= fibw+1) - br.size.width += fibw; - } - NSRectFill (br); /* Draw the image.. do we need to draw placeholder if img ==nil? */ @@ -3143,7 +3054,7 @@ bgCol = ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), s->f); fgCol = ns_lookup_indexed_color (NS_FACE_FOREGROUND (face), s->f); - for (i=0; irow->full_width_p) { @@ -3173,13 +3084,6 @@ r[i].size.height = min (s->height, s->row->visible_height); } - /* expand full-width rows over internal borders */ - else - { - r[i] = ns_fix_rect_ibw (r[i], FRAME_INTERNAL_BORDER_WIDTH (s->f), - FRAME_PIXEL_WIDTH (s->f)); - } - [bgCol set]; /* NOTE: under NS this is NOT used to draw cursors, but we must avoid @@ -3639,9 +3543,9 @@ struct frame *f = XFRAME (WINDOW_FRAME (window)); EmacsView *view = FRAME_NS_VIEW (f); int window_y, window_height; - BOOL barOnVeryLeft, barOnVeryRight; int top, left, height, width, sb_width, sb_left; EmacsScroller *bar; + BOOL fringe_extended_p; /* optimization; display engine sends WAY too many of these.. */ if (!NILP (window->vertical_scroll_bar)) @@ -3668,26 +3572,27 @@ width = WINDOW_CONFIG_SCROLL_BAR_COLS (window) * FRAME_COLUMN_WIDTH (f); left = WINDOW_SCROLL_BAR_AREA_X (window); - if (top < 5) /* top scrollbar adjustment */ - { - top -= FRAME_INTERNAL_BORDER_WIDTH (f); - height += FRAME_INTERNAL_BORDER_WIDTH (f); - } - /* allow for displaying a skinnier scrollbar than char area allotted */ sb_width = (WINDOW_CONFIG_SCROLL_BAR_WIDTH (window) > 0) ? WINDOW_CONFIG_SCROLL_BAR_WIDTH (window) : width; - - barOnVeryLeft = left < 5; - barOnVeryRight = FRAME_PIXEL_WIDTH (f) - left - width < 5; - sb_left = left + FRAME_INTERNAL_BORDER_WIDTH (f) - * (barOnVeryLeft ? -1 : (barOnVeryRight ? 1 : 0)); + sb_left = left; r = NSMakeRect (sb_left, top, sb_width, height); /* the parent view is flipped, so we need to flip y value */ v = [view frame]; r.origin.y = (v.size.height - r.size.height - r.origin.y); + if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (window)) + fringe_extended_p = (WINDOW_LEFTMOST_P (window) + && WINDOW_LEFT_FRINGE_WIDTH (window) + && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (window) + || WINDOW_LEFT_MARGIN_COLS (window) == 0)); + else + fringe_extended_p = (WINDOW_RIGHTMOST_P (window) + && WINDOW_RIGHT_FRINGE_WIDTH (window) + && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (window) + || WINDOW_RIGHT_MARGIN_COLS (window) == 0)); + XSETWINDOW (win, window); BLOCK_INPUT; @@ -3707,7 +3612,14 @@ if (NILP (window->vertical_scroll_bar)) { - ns_clear_frame_area (f, sb_left, top, width, height); + if (width > 0 && height > 0) + { + if (fringe_extended_p) + ns_clear_frame_area (f, sb_left, top, sb_width, height); + else + ns_clear_frame_area (f, left, top, width, height); + } + bar = [[EmacsScroller alloc] initFrame: r window: win]; wset_vertical_scroll_bar (window, make_save_value (bar, 0)); } @@ -3778,14 +3690,21 @@ { int i; id view; - NSArray *subviews = [[FRAME_NS_VIEW (f) superview] subviews]; + EmacsView *eview = FRAME_NS_VIEW (f); + NSArray *subviews = [[eview superview] subviews]; + BOOL removed = NO; + NSTRACE (ns_judge_scroll_bars); - for (i =[subviews count]-1; i >= 0; i--) + for (i = [subviews count]-1; i >= 0; --i) { view = [subviews objectAtIndex: i]; if (![view isKindOfClass: [EmacsScroller class]]) continue; [view judge]; + removed = YES; } + + if (removed) + [eview updateFrameSize]; } @@ -5420,6 +5339,48 @@ return NO; } +- (void) updateFrameSize +{ + NSWindow *window = [self window]; + NSRect wr = [window frame]; +#ifdef NS_IMPL_GNUSTEP + int extra = 3; +#else + int extra = 0; +#endif + + int oldc = cols, oldr = rows; + int oldw = FRAME_PIXEL_WIDTH (emacsframe), + oldh = FRAME_PIXEL_HEIGHT (emacsframe); + int neww, newh; + + cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (emacsframe, wr.size.width + extra); + + if (cols < MINWIDTH) + cols = MINWIDTH; + + rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES + (emacsframe, wr.size.height + - FRAME_NS_TITLEBAR_HEIGHT (emacsframe) + extra + - FRAME_TOOLBAR_HEIGHT (emacsframe)); + + if (rows < MINHEIGHT) + rows = MINHEIGHT; + + neww = (int)wr.size.width - emacsframe->border_width; + newh = ((int)wr.size.height + - FRAME_NS_TITLEBAR_HEIGHT (emacsframe) + - FRAME_TOOLBAR_HEIGHT (emacsframe)); + + if (oldr != rows || oldc != cols || neww != oldw || newh != oldh) + { + FRAME_PIXEL_WIDTH (emacsframe) = neww; + FRAME_PIXEL_HEIGHT (emacsframe) = newh; + change_frame_size (emacsframe, rows, cols, 0, 0, 1); + SET_FRAME_GARBAGED (emacsframe); + cancel_mouse_face (emacsframe); + } +} - (NSSize)windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize /* normalize frame to gridded text size */ @@ -5517,16 +5478,7 @@ x_set_window_size (emacsframe, 0, cols, rows); else { - NSWindow *window = [self window]; - NSRect wr = [window frame]; - FRAME_PIXEL_WIDTH (emacsframe) = (int)wr.size.width - - emacsframe->border_width; - FRAME_PIXEL_HEIGHT (emacsframe) = (int)wr.size.height - - FRAME_NS_TITLEBAR_HEIGHT (emacsframe) - - FRAME_TOOLBAR_HEIGHT (emacsframe); - change_frame_size (emacsframe, rows, cols, 0, 0, 1); - SET_FRAME_GARBAGED (emacsframe); - cancel_mouse_face (emacsframe); + [self updateFrameSize]; } } #endif ------------------------------------------------------------ revno: 109935 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2012-09-08 14:20:32 +0300 message: Fix setting of environment variables by nt/configure.bat. nt/configure.bat : Don't leave it set in the environment when the script exits. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-09-07 12:15:08 +0000 +++ nt/ChangeLog 2012-09-08 11:20:32 +0000 @@ -1,3 +1,8 @@ +2012-09-08 Eli Zaretskii + + * configure.bat : Don't leave it set in the + environment when the script exits. + 2012-09-07 Juanma Barranquero * config.nt: Sync with autogen/config.in. === modified file 'nt/configure.bat' --- nt/configure.bat 2012-07-29 08:18:29 +0000 +++ nt/configure.bat 2012-09-08 11:20:32 +0000 @@ -949,4 +949,6 @@ set HAVE_TIFF= set HAVE_XPM= set dbginfo= +endlocal +set use_extensions= ------------------------------------------------------------ revno: 109934 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2012-09-07 16:14:55 -0400 message: * lisp/emacs-lisp/byte-run.el (defun): Tweak message. Simplify code. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-07 14:53:15 +0000 +++ lisp/ChangeLog 2012-09-07 20:14:55 +0000 @@ -1,7 +1,11 @@ +2012-09-07 Stefan Monnier + + * emacs-lisp/byte-run.el (defun): Tweak message. Simplify code. + 2012-09-07 Matt McClure (tiny change) - * progmodes/python.el (python-shell-send-string): When - default-directory is remote, create temp file on remote + * progmodes/python.el (python-shell-send-string): + When default-directory is remote, create temp file on remote filesystem. (python-shell-send-file): When file is remote, pass local view of file paths to remote Python interpreter. (Bug#12340) @@ -15,8 +19,8 @@ * subr.el (read-char-choice): Allow quitting via ESC ESC. - * userlock.el (ask-user-about-supersession-threat): Use - read-char-choice (Bug#12093). + * userlock.el (ask-user-about-supersession-threat): + Use read-char-choice (Bug#12093). 2012-09-07 Chong Yidong === modified file 'lisp/emacs-lisp/byte-run.el' --- lisp/emacs-lisp/byte-run.el 2012-08-15 16:29:11 +0000 +++ lisp/emacs-lisp/byte-run.el 2012-09-07 20:14:55 +0000 @@ -185,11 +185,10 @@ ((and (featurep 'cl) (memq (car x) ;C.f. cl-do-proclaim. '(special inline notinline optimize warn))) - (if (null (stringp docstring)) - (push (list 'declare x) body) - (setcdr body (cons (list 'declare x) (cdr body)))) + (push (list 'declare x) + (if (stringp docstring) (cdr body) body)) nil) - (t (message "Warning: Unknown defun property %S in %S" + (t (message "Warning: Unknown defun property `%S' in %S" (car x) name))))) decls)) (def (list 'defalias