Now on revision 110821. ------------------------------------------------------------ revno: 110821 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2012-11-07 09:23:20 +0400 message: * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-06 20:48:35 +0000 +++ src/ChangeLog 2012-11-07 05:23:20 +0000 @@ -1,3 +1,7 @@ +2012-11-07 Dmitry Antipov + + * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring. + 2012-11-06 Paul Eggert Restore some duplicate definitions (Bug#12814). === modified file 'src/xfns.c' --- src/xfns.c 2012-11-06 13:26:20 +0000 +++ src/xfns.c 2012-11-07 05:23:20 +0000 @@ -2996,16 +2996,14 @@ DEFUN ("x-wm-set-size-hint", Fx_wm_set_size_hint, Sx_wm_set_size_hint, 0, 1, 0, doc: /* Send the size hints for frame FRAME to the window manager. -If FRAME is nil, use the selected frame. */) +If FRAME is omitted or nil, use the selected frame. +Signal error if FRAME is not an X frame. */) (Lisp_Object frame) { - struct frame *f; - if (NILP (frame)) - frame = selected_frame; - f = XFRAME (frame); + struct frame *f = check_x_frame (frame); + block_input (); - if (FRAME_X_P (f)) - x_wm_set_size_hint (f, 0, 0); + x_wm_set_size_hint (f, 0, 0); unblock_input (); return Qnil; } ------------------------------------------------------------ revno: 110820 fixes bug: http://debbugs.gnu.org/12814 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-11-06 12:48:35 -0800 message: Restore some duplicate definitions. This undoes part of the 2012-11-03 changes. Some people build with plain -g rather than with -g3, and they need the duplicate definitions for .gdbinit to work; see . * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Define as macros, as well as as enums or as constants. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-06 18:31:19 +0000 +++ src/ChangeLog 2012-11-06 20:48:35 +0000 @@ -1,3 +1,12 @@ +2012-11-06 Paul Eggert + + Restore some duplicate definitions (Bug#12814). + This undoes part of the 2012-11-03 changes. Some people build + with plain -g rather than with -g3, and they need the duplicate + definitions for .gdbinit to work; see . + * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): + Define as macros, as well as as enums or as constants. + 2012-11-06 Jan Djärv * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask === modified file 'src/lisp.h' --- src/lisp.h 2012-11-06 17:40:07 +0000 +++ src/lisp.h 2012-11-06 20:48:35 +0000 @@ -152,15 +152,18 @@ on the few static Lisp_Objects used: all the defsubr as well as the two special buffers buffer_defaults and buffer_local_symbols. */ -/* Number of bits in a Lisp_Object tag. This can be used in #if. */ +enum Lisp_Bits + { + /* Number of bits in a Lisp_Object tag. This can be used in #if, + and for GDB's sake also as a regular symbol. */ + GCTYPEBITS = #define GCTYPEBITS 3 + GCTYPEBITS, -/* 2**GCTYPEBITS. This must be a macro that expands to a literal - integer constant, for MSVC. */ + /* 2**GCTYPEBITS. This must be a macro that expands to a literal + integer constant, for MSVC. */ #define GCALIGNMENT 8 -enum Lisp_Bits - { /* Number of bits in a Lisp_Object value, not counting the tag. */ VALBITS = BITS_PER_EMACS_INT - GCTYPEBITS, @@ -378,11 +381,15 @@ /* In the size word of a vector, this bit means the vector has been marked. */ +static ptrdiff_t const ARRAY_MARK_FLAG #define ARRAY_MARK_FLAG PTRDIFF_MIN + = ARRAY_MARK_FLAG; /* In the size word of a struct Lisp_Vector, this bit means it's really some other vector-like object. */ +static ptrdiff_t const PSEUDOVECTOR_FLAG #define PSEUDOVECTOR_FLAG (PTRDIFF_MAX - PTRDIFF_MAX / 2) + = PSEUDOVECTOR_FLAG; /* In a pseudovector, the size field actually contains a word with one PSEUDOVECTOR_FLAG bit set, and one of the following values extracted @@ -464,7 +471,9 @@ #else /* not USE_LSB_TAG */ +static EMACS_INT const VALMASK #define VALMASK VAL_MAX + = VALMASK; #define XTYPE(a) ((enum Lisp_Type) ((EMACS_UINT) XLI (a) >> VALBITS)) ------------------------------------------------------------ revno: 110819 fixes bug: http://debbugs.gnu.org/12816 committer: Jan D. branch nick: trunk timestamp: Tue 2012-11-06 19:31:19 +0100 message: * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask to keypad keys. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-06 17:40:07 +0000 +++ src/ChangeLog 2012-11-06 18:31:19 +0000 @@ -1,3 +1,8 @@ +2012-11-06 Jan Djärv + + * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask + to keypad keys (Bug#12816). + 2012-11-06 Paul Eggert Minor adjustments of recently-changed frame functions. === modified file 'src/nsterm.m' --- src/nsterm.m 2012-11-04 03:34:10 +0000 +++ src/nsterm.m 2012-11-06 18:31:19 +0000 @@ -145,22 +145,22 @@ NSNewlineCharacter, 0x0D, NSEnterCharacter, 0x8D, - 0x41, 0xAE, /* KP_Decimal */ - 0x43, 0xAA, /* KP_Multiply */ - 0x45, 0xAB, /* KP_Add */ - 0x4B, 0xAF, /* KP_Divide */ - 0x4E, 0xAD, /* KP_Subtract */ - 0x51, 0xBD, /* KP_Equal */ - 0x52, 0xB0, /* KP_0 */ - 0x53, 0xB1, /* KP_1 */ - 0x54, 0xB2, /* KP_2 */ - 0x55, 0xB3, /* KP_3 */ - 0x56, 0xB4, /* KP_4 */ - 0x57, 0xB5, /* KP_5 */ - 0x58, 0xB6, /* KP_6 */ - 0x59, 0xB7, /* KP_7 */ - 0x5B, 0xB8, /* KP_8 */ - 0x5C, 0xB9, /* KP_9 */ + 0x41|NSNumericPadKeyMask, 0xAE, /* KP_Decimal */ + 0x43|NSNumericPadKeyMask, 0xAA, /* KP_Multiply */ + 0x45|NSNumericPadKeyMask, 0xAB, /* KP_Add */ + 0x4B|NSNumericPadKeyMask, 0xAF, /* KP_Divide */ + 0x4E|NSNumericPadKeyMask, 0xAD, /* KP_Subtract */ + 0x51|NSNumericPadKeyMask, 0xBD, /* KP_Equal */ + 0x52|NSNumericPadKeyMask, 0xB0, /* KP_0 */ + 0x53|NSNumericPadKeyMask, 0xB1, /* KP_1 */ + 0x54|NSNumericPadKeyMask, 0xB2, /* KP_2 */ + 0x55|NSNumericPadKeyMask, 0xB3, /* KP_3 */ + 0x56|NSNumericPadKeyMask, 0xB4, /* KP_4 */ + 0x57|NSNumericPadKeyMask, 0xB5, /* KP_5 */ + 0x58|NSNumericPadKeyMask, 0xB6, /* KP_6 */ + 0x59|NSNumericPadKeyMask, 0xB7, /* KP_7 */ + 0x5B|NSNumericPadKeyMask, 0xB8, /* KP_8 */ + 0x5C|NSNumericPadKeyMask, 0xB9, /* KP_9 */ 0x1B, 0x1B /* escape */ }; @@ -4829,7 +4829,7 @@ /* is it a "function key"? */ fnKeysym = (code < 0x00ff && (flags&NSNumericPadKeyMask)) - ? ns_convert_key ([theEvent keyCode]) + ? ns_convert_key ([theEvent keyCode] | NSNumericPadKeyMask) : ns_convert_key (code); if (fnKeysym) ------------------------------------------------------------ revno: 110818 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-11-06 09:40:07 -0800 message: Minor adjustments of recently-changed frame functions. * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already known to be a frame (we're in the FRAMEP branch). * lisp.h (Qframep): Remove decl. frame.h declares this. * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t, since they're meant for Lisp fixnum values. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-06 15:57:14 +0000 +++ src/ChangeLog 2012-11-06 17:40:07 +0000 @@ -1,3 +1,12 @@ +2012-11-06 Paul Eggert + + Minor adjustments of recently-changed frame functions. + * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already + known to be a frame (we're in the FRAMEP branch). + * lisp.h (Qframep): Remove decl. frame.h declares this. + * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t, + since they're meant for Lisp fixnum values. + 2012-11-06 Dmitry Antipov * window.c (Fwindow_combination_limit): Revert to the only === modified file 'src/buffer.c' --- src/buffer.c 2012-11-06 13:26:20 +0000 +++ src/buffer.c 2012-11-06 17:40:07 +0000 @@ -406,7 +406,6 @@ Lisp_Object framelist, prevlist, tail; Lisp_Object args[3]; - CHECK_FRAME (frame); framelist = Fcopy_sequence (XFRAME (frame)->buffer_list); prevlist = Fnreverse (Fcopy_sequence (XFRAME (frame)->buried_buffer_list)); @@ -2103,7 +2102,7 @@ return; BUFFER_CHECK_INDIRECTION (b); - + old_buf = current_buffer; current_buffer = b; last_known_column_point = -1; /* invalidate indentation cache */ === modified file 'src/lisp.h' --- src/lisp.h 2012-11-06 13:26:20 +0000 +++ src/lisp.h 2012-11-06 17:40:07 +0000 @@ -2628,9 +2628,6 @@ EXFUN (Fbyteorder, 0) ATTRIBUTE_CONST; -/* Defined in frame.c. */ -extern Lisp_Object Qframep; - /* Defined in data.c. */ extern Lisp_Object indirect_function (Lisp_Object); extern Lisp_Object find_symbol_value (Lisp_Object); === modified file 'src/window.c' --- src/window.c 2012-11-06 15:57:14 +0000 +++ src/window.c 2012-11-06 17:40:07 +0000 @@ -273,7 +273,7 @@ /* Build a frequently used 4-integer (X Y W H) list. */ static Lisp_Object -quad (ptrdiff_t x, ptrdiff_t y, ptrdiff_t w, ptrdiff_t h) +quad (EMACS_INT x, EMACS_INT y, EMACS_INT w, EMACS_INT h) { return list4 (make_number (x), make_number (y), make_number (w), make_number (h)); @@ -3105,7 +3105,7 @@ DEFUN ("run-window-configuration-change-hook", Frun_window_configuration_change_hook, Srun_window_configuration_change_hook, 0, 1, 0, - doc: /* Run `window-configuration-change-hook' for FRAME. + doc: /* Run `window-configuration-change-hook' for FRAME. If FRAME is omitted or nil, it defaults to the selected frame. */) (Lisp_Object frame) { ------------------------------------------------------------ revno: 110817 fixes bug: http://debbugs.gnu.org/12768 committer: Agustin Martin branch nick: trunk timestamp: Tue 2012-11-06 17:33:56 +0100 message: ispell.el (ispell-region): Do not prefix sent string by comment in autoconf mode This commit changes some of the `in-comment' ocurrences to more specific `add-comment', set only if comment prefix is to be added. When in comment, old code prefixed string by comment string to let ispell know this is part of a comment string. This is only supported in some modes. In particular, this is not supported in autoconf mode where adding the comment string messes everything up because ispell tries to spellcheck the `dnl' string header causing misalignments in some cases (debbugs.gnu.org: #12768). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-06 16:22:09 +0000 +++ lisp/ChangeLog 2012-11-06 16:33:56 +0000 @@ -13,6 +13,9 @@ (ispell-buffer-with-debug): New function that creates a debugging buffer and calls `ispell-buffer' with debugging enabled. + * textmodes/ispell.el (ispell-region): Do not prefix sent string by + comment in autoconf mode. (Bug#12768) + 2012-11-06 Dmitry Antipov * emacs-lisp/byte-opt.el (toplevel): Add compare-window-configurations, === modified file 'lisp/textmodes/ispell.el' --- lisp/textmodes/ispell.el 2012-11-06 16:22:09 +0000 +++ lisp/textmodes/ispell.el 2012-11-06 16:33:56 +0000 @@ -3006,15 +3006,23 @@ (marker-position ispell-region-end)))) (let* ((ispell-start (point)) (ispell-end (min (point-at-eol) reg-end)) + ;; See if line must be prefixed by comment string to let ispell know this is + ;; part of a comment string. This is only supported in some modes. + ;; In particular, this is not supported in autoconf mode where adding the + ;; comment string messes everything up because ispell tries to spellcheck the + ;; `dnl' string header causing misalignments in some cases (debbugs.gnu.org: #12768). + (add-comment (and in-comment + (not (string= in-comment "dnl ")) + in-comment)) (string (ispell-get-line - ispell-start ispell-end in-comment))) + ispell-start ispell-end add-comment))) (ispell-print-if-debug (format - "ispell-region: string pos (%s->%s), eol: %s, [in-comment]: [%s], [string]: [%s]\n" - ispell-start ispell-end (point-at-eol) in-comment string)) - (if in-comment ; account for comment chars added - (setq ispell-start (- ispell-start (length in-comment)) - in-comment nil)) + "ispell-region: string pos (%s->%s), eol: %s, [in-comment]: [%s], [add-comment]: [%s], [string]: [%s]\n" + ispell-start ispell-end (point-at-eol) in-comment add-comment string)) + (if add-comment ; account for comment chars added + (setq ispell-start (- ispell-start (length add-comment)) + add-comment nil)) (setq ispell-end (point)) ; "end" tracks region retrieved. (if string ; there is something to spell check! ;; (special start end) ------------------------------------------------------------ revno: 110816 committer: Agustin Martin branch nick: trunk timestamp: Tue 2012-11-06 17:22:09 +0100 message: textmodes/ispell.el: Experimental support for support debugging. * (ispell-create-debug-buffer): Create a `ispell-debug-buffer' debug buffer for ispell. * (ispell-print-if-debug): New function to print stuff to `ispell-debug-buffer' if debugging is enabled. * (ispell-region, ispell-process-line): Use `ispell-print-if-debug' to show some debugging info. * (ispell-buffer-with-debug): New function that creates a debugging buffer and calls `ispell-buffer' with debugging enabled. This is also en example of a possible way to use this system. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-06 16:04:42 +0000 +++ lisp/ChangeLog 2012-11-06 16:22:09 +0000 @@ -3,6 +3,16 @@ * textmodes/ispell.el (ispell-region): Standard re-indent for better readability. + * textmodes/ispell.el: Experimental support for support debugging. + (ispell-create-debug-buffer): Create a `ispell-debug-buffer' debug + buffer for ispell. + (ispell-print-if-debug): New function to print stuff to + `ispell-debug-buffer' if debugging is enabled. + (ispell-region, ispell-process-line): Use `ispell-print-if-debug' to + show some debugging info. + (ispell-buffer-with-debug): New function that creates a debugging + buffer and calls `ispell-buffer' with debugging enabled. + 2012-11-06 Dmitry Antipov * emacs-lisp/byte-opt.el (toplevel): Add compare-window-configurations, === modified file 'lisp/textmodes/ispell.el' --- lisp/textmodes/ispell.el 2012-11-06 16:04:42 +0000 +++ lisp/textmodes/ispell.el 2012-11-06 16:22:09 +0000 @@ -907,6 +907,24 @@ (setq default-directory (expand-file-name "~/"))) (apply 'call-process-region args))) +(defun ispell-create-debug-buffer (&optional append) + "Create an ispell debug buffer for debugging output. +Use APPEND to append the info to previous buffer if exists, +otherwise is reset. Returns name of ispell debug buffer. +See `ispell-buffer-with-debug' for an example of use." + (let ((ispell-debug-buffer (get-buffer-create "*ispell-debug*"))) + (with-current-buffer ispell-debug-buffer + (if append + (insert + (format "-----------------------------------------------\n")) + (erase-buffer))) + ispell-debug-buffer)) + +(defsubst ispell-print-if-debug (string) + "Print STRING to `ispell-debug-buffer' buffer if enabled." + (if (boundp 'ispell-debug-buffer) + (with-current-buffer ispell-debug-buffer + (insert string)))) ;; The preparation of the menu bar menu must be autoloaded @@ -2902,14 +2920,15 @@ (if (not recheckp) (ispell-accept-buffer-local-defs)) ; set up dictionary, local words, etc. (let ((skip-region-start (make-marker)) - (rstart (make-marker))) + (rstart (make-marker)) + (region-type (if (and (= reg-start (point-min)) (= reg-end (point-max))) + (buffer-name) "region")) + (program-basename (file-name-nondirectory ispell-program-name)) + (dictionary (or ispell-current-dictionary "default"))) (unwind-protect (save-excursion (message "Spell-checking %s using %s with %s dictionary..." - (if (and (= reg-start (point-min)) (= reg-end (point-max))) - (buffer-name) "region") - (file-name-nondirectory ispell-program-name) - (or ispell-current-dictionary "default")) + region-type program-basename dictionary) ;; Returns cursor to original location. (save-window-excursion (goto-char reg-start) @@ -2917,18 +2936,30 @@ (case-fold-search case-fold-search) (query-fcc t) in-comment key) - (let (message-log-max) - (message "searching for regions to skip")) + (ispell-print-if-debug + (concat + (format + "ispell-region: (ispell-skip-region-list):\n%s\n" + (ispell-skip-region-list)) + (format + "ispell-region: (ispell-begin-skip-region-regexp):\n%s\n" + (ispell-begin-skip-region-regexp)) + "ispell-region: Search for first region to skip after (ispell-begin-skip-region-regexp)\n")) (if (re-search-forward (ispell-begin-skip-region-regexp) reg-end t) (progn (setq key (match-string-no-properties 0)) (set-marker skip-region-start (- (point) (length key))) - (goto-char reg-start))) - (let (message-log-max) - (message - "Continuing spelling check using %s with %s dictionary..." - (file-name-nondirectory ispell-program-name) - (or ispell-current-dictionary "default"))) + (goto-char reg-start) + (ispell-print-if-debug + (format "ispell-region: First skip: %s at (pos,line,column): (%s,%s,%s).\n" + key + (save-excursion (goto-char skip-region-start) (point)) + (line-number-at-pos skip-region-start) + (save-excursion (goto-char skip-region-start) (current-column)))))) + (ispell-print-if-debug + (format + "ispell-region: Continue spell-checking with %s and %s dictionary...\n" + program-basename dictionary)) (set-marker rstart reg-start) (set-marker ispell-region-end reg-end) (while (and (not ispell-quit) @@ -2961,7 +2992,13 @@ (setq key (match-string-no-properties 0)) (set-marker skip-region-start (- (point) (length key))) - (goto-char rstart)) + (goto-char rstart) + (ispell-print-if-debug + (format "ispell-region: Next skip: %s at (pos,line,column): (%s,%s,%s).\n" + key + (save-excursion (goto-char skip-region-start) (point)) + (line-number-at-pos skip-region-start) + (save-excursion (goto-char skip-region-start) (current-column))))) (set-marker skip-region-start nil)))) (setq reg-end (max (point) (if (marker-position skip-region-start) @@ -2971,6 +3008,10 @@ (ispell-end (min (point-at-eol) reg-end)) (string (ispell-get-line ispell-start ispell-end in-comment))) + (ispell-print-if-debug + (format + "ispell-region: string pos (%s->%s), eol: %s, [in-comment]: [%s], [string]: [%s]\n" + ispell-start ispell-end (point-at-eol) in-comment string)) (if in-comment ; account for comment chars added (setq ispell-start (- ispell-start (length in-comment)) in-comment nil)) @@ -3006,10 +3047,7 @@ ;; Only save if successful exit. (ispell-pdict-save ispell-silently-savep) (message "Spell-checking %s using %s with %s dictionary...done" - (if (and (= reg-start (point-min)) (= reg-end (point-max))) - (buffer-name) "region") - (file-name-nondirectory ispell-program-name) - (or ispell-current-dictionary "default")))))) + region-type program-basename dictionary))))) (defun ispell-begin-skip-region-regexp () @@ -3256,10 +3294,19 @@ ;; Alignment cannot be tracked and this error will occur when ;; `query-replace' makes multiple corrections on the starting line. (or (ispell-looking-at (car poss)) - ;; This occurs due to filter pipe problems - (error (concat "Ispell misalignment: word " - "`%s' point %d; probably incompatible versions") - (car poss) (marker-position word-start))) + ;; This error occurs due to filter pipe problems + (let* ((ispell-pipe-word (car poss)) + (actual-point (marker-position word-start)) + (actual-line (line-number-at-pos actual-point)) + (actual-column (save-excursion (goto-char actual-point) (current-column)))) + (ispell-print-if-debug + (concat + "ispell-process-line: Ispell misalignment error:\n" + (format " [Word from ispell pipe]: [%s], actual (point,line,column): (%s,%s,%s)\n" + ispell-pipe-word actual-point actual-line actual-column))) + (error (concat "Ispell misalignment: word " + "`%s' point %d; probably incompatible versions") + ispell-pipe-word actual-point))) ;; ispell-cmd-loop can go recursive & change buffer (if ispell-keep-choices-win (setq replace (ispell-command-loop @@ -3393,6 +3440,13 @@ (interactive) (ispell-region (point-min) (point-max))) +;;;###autoload +(defun ispell-buffer-with-debug (&optional append) + "`ispell-buffer' with some output sent to `ispell-debug-buffer' buffer. +Use APPEND to append the info to previous buffer if exists." + (interactive) + (let ((ispell-debug-buffer (ispell-create-debug-buffer append))) + (ispell-buffer))) ;;;###autoload (defun ispell-continue () ------------------------------------------------------------ revno: 110815 committer: Agustin Martin branch nick: trunk timestamp: Tue 2012-11-06 17:04:42 +0100 message: ispell.el (ispell-region): Standard re-indent for better readability. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-06 07:37:06 +0000 +++ lisp/ChangeLog 2012-11-06 16:04:42 +0000 @@ -1,3 +1,8 @@ +2012-11-06 Agustín Martín Domingo + + * textmodes/ispell.el (ispell-region): Standard re-indent for better + readability. + 2012-11-06 Dmitry Antipov * emacs-lisp/byte-opt.el (toplevel): Add compare-window-configurations, === modified file 'lisp/textmodes/ispell.el' --- lisp/textmodes/ispell.el 2012-11-05 16:32:35 +0000 +++ lisp/textmodes/ispell.el 2012-11-06 16:04:42 +0000 @@ -2903,113 +2903,113 @@ (ispell-accept-buffer-local-defs)) ; set up dictionary, local words, etc. (let ((skip-region-start (make-marker)) (rstart (make-marker))) - (unwind-protect - (save-excursion - (message "Spell-checking %s using %s with %s dictionary..." + (unwind-protect + (save-excursion + (message "Spell-checking %s using %s with %s dictionary..." + (if (and (= reg-start (point-min)) (= reg-end (point-max))) + (buffer-name) "region") + (file-name-nondirectory ispell-program-name) + (or ispell-current-dictionary "default")) + ;; Returns cursor to original location. + (save-window-excursion + (goto-char reg-start) + (let ((transient-mark-mode) + (case-fold-search case-fold-search) + (query-fcc t) + in-comment key) + (let (message-log-max) + (message "searching for regions to skip")) + (if (re-search-forward (ispell-begin-skip-region-regexp) reg-end t) + (progn + (setq key (match-string-no-properties 0)) + (set-marker skip-region-start (- (point) (length key))) + (goto-char reg-start))) + (let (message-log-max) + (message + "Continuing spelling check using %s with %s dictionary..." + (file-name-nondirectory ispell-program-name) + (or ispell-current-dictionary "default"))) + (set-marker rstart reg-start) + (set-marker ispell-region-end reg-end) + (while (and (not ispell-quit) + (< (point) ispell-region-end)) + ;; spell-check region with skipping + (if (and (marker-position skip-region-start) + (<= skip-region-start (point))) + (progn + ;; If region inside line comment, must keep comment start. + (setq in-comment (point) + in-comment + (and comment-start + (or (null comment-end) (string= "" comment-end)) + (save-excursion + (beginning-of-line) + (re-search-forward comment-start in-comment t)) + comment-start)) + ;; Can change skip-regexps (in ispell-message) + (ispell-skip-region key) ; moves pt past region. + (set-marker rstart (point)) + ;; check for saving large attachments... + (setq query-fcc (and query-fcc + (ispell-ignore-fcc skip-region-start + rstart))) + (if (and (< rstart ispell-region-end) + (re-search-forward + (ispell-begin-skip-region-regexp) + ispell-region-end t)) + (progn + (setq key (match-string-no-properties 0)) + (set-marker skip-region-start + (- (point) (length key))) + (goto-char rstart)) + (set-marker skip-region-start nil)))) + (setq reg-end (max (point) + (if (marker-position skip-region-start) + (min skip-region-start ispell-region-end) + (marker-position ispell-region-end)))) + (let* ((ispell-start (point)) + (ispell-end (min (point-at-eol) reg-end)) + (string (ispell-get-line + ispell-start ispell-end in-comment))) + (if in-comment ; account for comment chars added + (setq ispell-start (- ispell-start (length in-comment)) + in-comment nil)) + (setq ispell-end (point)) ; "end" tracks region retrieved. + (if string ; there is something to spell check! + ;; (special start end) + (setq shift (ispell-process-line string + (and recheckp shift)))) + (goto-char ispell-end))))) + (if ispell-quit + nil + (or shift 0))) + ;; protected + (if (and (not (and recheckp ispell-keep-choices-win)) + (get-buffer ispell-choices-buffer)) + (kill-buffer ispell-choices-buffer)) + (set-marker skip-region-start nil) + (set-marker rstart nil) + (if ispell-quit + (progn + ;; preserve or clear the region for ispell-continue. + (if (not (numberp ispell-quit)) + (set-marker ispell-region-end nil) + ;; Ispell-continue enabled - ispell-region-end is set. + (goto-char ispell-quit)) + ;; Check for aborting + (if (and ispell-checking-message (numberp ispell-quit)) + (progn + (setq ispell-quit nil) + (error "Message send aborted"))) + (if (not recheckp) (setq ispell-quit nil))) + (if (not recheckp) (set-marker ispell-region-end nil)) + ;; Only save if successful exit. + (ispell-pdict-save ispell-silently-savep) + (message "Spell-checking %s using %s with %s dictionary...done" (if (and (= reg-start (point-min)) (= reg-end (point-max))) (buffer-name) "region") (file-name-nondirectory ispell-program-name) - (or ispell-current-dictionary "default")) - ;; Returns cursor to original location. - (save-window-excursion - (goto-char reg-start) - (let ((transient-mark-mode) - (case-fold-search case-fold-search) - (query-fcc t) - in-comment key) - (let (message-log-max) - (message "searching for regions to skip")) - (if (re-search-forward (ispell-begin-skip-region-regexp) reg-end t) - (progn - (setq key (match-string-no-properties 0)) - (set-marker skip-region-start (- (point) (length key))) - (goto-char reg-start))) - (let (message-log-max) - (message - "Continuing spelling check using %s with %s dictionary..." - (file-name-nondirectory ispell-program-name) - (or ispell-current-dictionary "default"))) - (set-marker rstart reg-start) - (set-marker ispell-region-end reg-end) - (while (and (not ispell-quit) - (< (point) ispell-region-end)) - ;; spell-check region with skipping - (if (and (marker-position skip-region-start) - (<= skip-region-start (point))) - (progn - ;; If region inside line comment, must keep comment start. - (setq in-comment (point) - in-comment - (and comment-start - (or (null comment-end) (string= "" comment-end)) - (save-excursion - (beginning-of-line) - (re-search-forward comment-start in-comment t)) - comment-start)) - ;; Can change skip-regexps (in ispell-message) - (ispell-skip-region key) ; moves pt past region. - (set-marker rstart (point)) - ;; check for saving large attachments... - (setq query-fcc (and query-fcc - (ispell-ignore-fcc skip-region-start - rstart))) - (if (and (< rstart ispell-region-end) - (re-search-forward - (ispell-begin-skip-region-regexp) - ispell-region-end t)) - (progn - (setq key (match-string-no-properties 0)) - (set-marker skip-region-start - (- (point) (length key))) - (goto-char rstart)) - (set-marker skip-region-start nil)))) - (setq reg-end (max (point) - (if (marker-position skip-region-start) - (min skip-region-start ispell-region-end) - (marker-position ispell-region-end)))) - (let* ((ispell-start (point)) - (ispell-end (min (point-at-eol) reg-end)) - (string (ispell-get-line - ispell-start ispell-end in-comment))) - (if in-comment ; account for comment chars added - (setq ispell-start (- ispell-start (length in-comment)) - in-comment nil)) - (setq ispell-end (point)) ; "end" tracks region retrieved. - (if string ; there is something to spell check! - ;; (special start end) - (setq shift (ispell-process-line string - (and recheckp shift)))) - (goto-char ispell-end))))) - (if ispell-quit - nil - (or shift 0))) - ;; protected - (if (and (not (and recheckp ispell-keep-choices-win)) - (get-buffer ispell-choices-buffer)) - (kill-buffer ispell-choices-buffer)) - (set-marker skip-region-start nil) - (set-marker rstart nil) - (if ispell-quit - (progn - ;; preserve or clear the region for ispell-continue. - (if (not (numberp ispell-quit)) - (set-marker ispell-region-end nil) - ;; Ispell-continue enabled - ispell-region-end is set. - (goto-char ispell-quit)) - ;; Check for aborting - (if (and ispell-checking-message (numberp ispell-quit)) - (progn - (setq ispell-quit nil) - (error "Message send aborted"))) - (if (not recheckp) (setq ispell-quit nil))) - (if (not recheckp) (set-marker ispell-region-end nil)) - ;; Only save if successful exit. - (ispell-pdict-save ispell-silently-savep) - (message "Spell-checking %s using %s with %s dictionary...done" - (if (and (= reg-start (point-min)) (= reg-end (point-max))) - (buffer-name) "region") - (file-name-nondirectory ispell-program-name) - (or ispell-current-dictionary "default")))))) + (or ispell-current-dictionary "default")))))) (defun ispell-begin-skip-region-regexp () ------------------------------------------------------------ revno: 110814 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-11-06 19:57:14 +0400 message: * window.c (Fwindow_combination_limit): Revert to the only required argument and adjust docstring as suggested in http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html by Martin Rudalics . diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-06 13:26:20 +0000 +++ src/ChangeLog 2012-11-06 15:57:14 +0000 @@ -1,5 +1,12 @@ 2012-11-06 Dmitry Antipov + * window.c (Fwindow_combination_limit): Revert to the only + required argument and adjust docstring as suggested in + http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html + by Martin Rudalics . + +2012-11-06 Dmitry Antipov + Widely used frame validity and checking functions. * frame.h (decode_live_frame, decode_any_frame): Add prototypes. * frame.c (decode_live_frame, decode_any_frame): New functions. === modified file 'src/window.c' --- src/window.c 2012-11-06 13:26:20 +0000 +++ src/window.c 2012-11-06 15:57:14 +0000 @@ -602,15 +602,18 @@ return decode_valid_window (window)->prev; } -DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 0, 1, 0, +DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 1, 1, 0, doc: /* Return combination limit of window WINDOW. -WINDOW must be a valid window and defaults to the selected one. If the return value is nil, child windows of WINDOW can be recombined with WINDOW's siblings. A return value of t means that child windows of -WINDOW are never \(re-)combined with WINDOW's siblings. */) +WINDOW are never \(re-)combined with WINDOW's siblings. + +WINDOW must be a valid window. The return value is meaningful for +internal windows only. */) (Lisp_Object window) { - return decode_valid_window (window)->combination_limit; + CHECK_VALID_WINDOW (window); + return XWINDOW (window)->combination_limit; } DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0, ------------------------------------------------------------ revno: 110813 committer: Juanma Barranquero branch nick: trunk timestamp: Tue 2012-11-06 16:29:49 +0100 message: lib/makefile.w32-in, src/makefile.w32-in: Trivial reordering of entries. diff: === modified file 'lib/makefile.w32-in' --- lib/makefile.w32-in 2012-11-03 20:43:29 +0000 +++ lib/makefile.w32-in 2012-11-06 15:29:49 +0000 @@ -116,6 +116,12 @@ $(CONFIG_H) \ $(C_CTYPE_H) +$(BLD)/c-strncasecmp.$(O) : \ + $(GNU_LIB)/c-strncasecmp.c \ + $(GNU_LIB)/c-strcase.h \ + $(CONFIG_H) \ + $(C_CTYPE_H) + $(BLD)/close-stream.$(O) : \ $(GNU_LIB)/close-stream.c \ $(GNU_LIB)/close-stream.h \ @@ -123,12 +129,6 @@ $(NT_INC)/stdbool.h \ $(CONFIG_H) -$(BLD)/c-strncasecmp.$(O) : \ - $(GNU_LIB)/c-strncasecmp.c \ - $(GNU_LIB)/c-strcase.h \ - $(CONFIG_H) \ - $(C_CTYPE_H) - $(BLD)/dtoastr.$(O) : \ $(GNU_LIB)/dtoastr.c \ $(FTOASTR_C) === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2012-11-05 16:30:45 +0000 +++ src/makefile.w32-in 2012-11-06 15:29:49 +0000 @@ -1475,8 +1475,8 @@ $(SRC)/w32.h \ $(SRC)/w32common.h \ $(SRC)/w32heap.h \ - $(LISP_H) \ - $(CONFIG_H) + $(CONFIG_H) \ + $(LISP_H) $(BLD)/vm-limit.$(O) : \ $(SRC)/vm-limit.c \ ------------------------------------------------------------ revno: 110812 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-11-06 17:26:20 +0400 message: Widely used frame validity and checking functions. * frame.h (decode_live_frame, decode_any_frame): Add prototypes. * frame.c (decode_live_frame, decode_any_frame): New functions. (delete_frame, Fredirect_frame_focus, Fframe_parameters) (Fframe_parameter, Fframe_char_height, Fframe_char_width) (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width) (Fframe_pointer_visible_p): Use decode_any_frame. (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame) (Fraise_frame, Flower_frame, Fmodify_frame_parameters) (Fset_frame_height, Fset_frame_width): Use decode_live_frame. (Fframe_focus): Likewise. Allow zero number of arguments. Adjust docstring. (frame_buffer_list, frame_buffer_predicate): Remove. * lisp.h (frame_buffer_predicate): Remove prototype. * buffer.c (Fother_buffer): Use decode_any_frame. * xdisp.c (Ftool_bar_lines_needed): Likewise. * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise. * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font) (Fclose_font, Ffont_info): Use decode_live_frame. * fontset.c (check_fontset_name): Likewise. * terminal.c (Fframe_terminal): Likewise. * w32fns.c (check_x_frame): Likewise. * window.c (Fminibuffer_window, Fwindow_at) (Fcurrent_window_configuration): Likewise. (Frun_window_configuration_change_hook, Fwindow_resize_apply): Likewise. Allow zero number of arguments. Adjust docstring. * dispnew.c (Fredraw_frame): Likewise. * xfaces.c (frame_or_selected_frame): Remove. (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font) (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p) (Fframe_face_alist): Use decode_live_frame. * xfns.c (check_x_frame): Likewise. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-11-06 06:27:20 +0000 +++ src/ChangeLog 2012-11-06 13:26:20 +0000 @@ -1,5 +1,40 @@ 2012-11-06 Dmitry Antipov + Widely used frame validity and checking functions. + * frame.h (decode_live_frame, decode_any_frame): Add prototypes. + * frame.c (decode_live_frame, decode_any_frame): New functions. + (delete_frame, Fredirect_frame_focus, Fframe_parameters) + (Fframe_parameter, Fframe_char_height, Fframe_char_width) + (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width) + (Fframe_pointer_visible_p): Use decode_any_frame. + (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame) + (Fraise_frame, Flower_frame, Fmodify_frame_parameters) + (Fset_frame_height, Fset_frame_width): Use decode_live_frame. + (Fframe_focus): Likewise. Allow zero number of arguments. + Adjust docstring. + (frame_buffer_list, frame_buffer_predicate): Remove. + * lisp.h (frame_buffer_predicate): Remove prototype. + * buffer.c (Fother_buffer): Use decode_any_frame. + * xdisp.c (Ftool_bar_lines_needed): Likewise. + * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise. + * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font) + (Fclose_font, Ffont_info): Use decode_live_frame. + * fontset.c (check_fontset_name): Likewise. + * terminal.c (Fframe_terminal): Likewise. + * w32fns.c (check_x_frame): Likewise. + * window.c (Fminibuffer_window, Fwindow_at) + (Fcurrent_window_configuration): Likewise. + (Frun_window_configuration_change_hook, Fwindow_resize_apply): + Likewise. Allow zero number of arguments. Adjust docstring. + * dispnew.c (Fredraw_frame): Likewise. + * xfaces.c (frame_or_selected_frame): Remove. + (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font) + (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p) + (Fframe_face_alist): Use decode_live_frame. + * xfns.c (check_x_frame): Likewise. + +2012-11-06 Dmitry Antipov + * window.c (quad): New function. (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges) (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges) === modified file 'src/buffer.c' --- src/buffer.c 2012-11-03 15:24:00 +0000 +++ src/buffer.c 2012-11-06 13:26:20 +0000 @@ -1543,17 +1543,11 @@ exists, return the buffer `*scratch*' (creating it if necessary). */) (register Lisp_Object buffer, Lisp_Object visible_ok, Lisp_Object frame) { - Lisp_Object tail, buf, pred; - Lisp_Object notsogood = Qnil; - - if (NILP (frame)) - frame = selected_frame; - - CHECK_FRAME (frame); - - pred = frame_buffer_predicate (frame); + struct frame *f = decode_any_frame (frame); + Lisp_Object tail = f->buffer_list, pred = f->buffer_predicate; + Lisp_Object buf, notsogood = Qnil; + /* Consider buffers that have been seen in the frame first. */ - tail = XFRAME (frame)->buffer_list; for (; CONSP (tail); tail = XCDR (tail)) { buf = XCAR (tail); === modified file 'src/dispnew.c' --- src/dispnew.c 2012-11-05 01:59:00 +0000 +++ src/dispnew.c 2012-11-06 13:26:20 +0000 @@ -3071,14 +3071,12 @@ Redrawing Frames **********************************************************************/ -DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 1, 1, 0, - doc: /* Clear frame FRAME and output again what is supposed to appear on it. */) +DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 0, 1, 0, + doc: /* Clear frame FRAME and output again what is supposed to appear on it. +If FRAME is omitted or nil, the selected frame is used. */) (Lisp_Object frame) { - struct frame *f; - - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); + struct frame *f = decode_live_frame (frame); /* Ignore redraw requests, if frame has no glyphs yet. (Implementation note: It still has to be checked why we are === modified file 'src/font.c' --- src/font.c 2012-11-03 05:11:34 +0000 +++ src/font.c 2012-11-06 13:26:20 +0000 @@ -3993,16 +3993,11 @@ are to be displayed on. If omitted, the selected frame is used. */) (Lisp_Object font, Lisp_Object frame) { - struct frame *f; + struct frame *f = decode_live_frame (frame); Lisp_Object plist[10]; Lisp_Object val; int n = 0; - if (NILP (frame)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); - if (STRINGP (font)) { int fontset = fs_query_fontset (font, 0); @@ -4152,18 +4147,15 @@ DEFUN ("font-family-list", Ffont_family_list, Sfont_family_list, 0, 1, 0, doc: /* List available font families on the current frame. -Optional argument FRAME, if non-nil, specifies the target frame. */) +If FRAME is omitted or nil, the selected frame is used. */) (Lisp_Object frame) { - FRAME_PTR f; + struct frame *f = decode_live_frame (frame); struct font_driver_list *driver_list; - Lisp_Object list; - - if (NILP (frame)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); - list = Qnil; + Lisp_Object list = Qnil; + + XSETFRAME (frame, f); + for (driver_list = f->font_driver_list; driver_list; driver_list = driver_list->next) if (driver_list->driver->list_family) @@ -4531,11 +4523,9 @@ (Lisp_Object font_entity, Lisp_Object size, Lisp_Object frame) { EMACS_INT isize; + struct frame *f = decode_live_frame (frame); CHECK_FONT_ENTITY (font_entity); - if (NILP (frame)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); if (NILP (size)) isize = XINT (AREF (font_entity, FONT_SIZE_INDEX)); @@ -4543,7 +4533,7 @@ { CHECK_NUMBER_OR_FLOAT (size); if (FLOATP (size)) - isize = POINT_TO_PIXEL (XFLOAT_DATA (size), XFRAME (frame)->resy); + isize = POINT_TO_PIXEL (XFLOAT_DATA (size), f->resy); else isize = XINT (size); if (! (INT_MIN <= isize && isize <= INT_MAX)) @@ -4551,7 +4541,7 @@ if (isize == 0) isize = 120; } - return font_open_entity (XFRAME (frame), font_entity, isize); + return font_open_entity (f, font_entity, isize); } DEFUN ("close-font", Fclose_font, Sclose_font, 1, 2, 0, @@ -4559,10 +4549,7 @@ (Lisp_Object font_object, Lisp_Object frame) { CHECK_FONT_OBJECT (font_object); - if (NILP (frame)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); - font_close_object (XFRAME (frame), font_object); + font_close_object (decode_live_frame (frame), font_object); return Qnil; } @@ -4847,7 +4834,7 @@ If the named font is not yet loaded, return nil. */) (Lisp_Object name, Lisp_Object frame) { - FRAME_PTR f; + struct frame *f; struct font *font; Lisp_Object info; Lisp_Object font_object; @@ -4856,10 +4843,7 @@ if (! FONTP (name)) CHECK_STRING (name); - if (NILP (frame)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); + f = decode_live_frame (frame); if (STRINGP (name)) { === modified file 'src/fontset.c' --- src/fontset.c 2012-10-07 22:31:58 +0000 +++ src/fontset.c 2012-11-06 13:26:20 +0000 @@ -1326,17 +1326,14 @@ check_fontset_name (Lisp_Object name, Lisp_Object *frame) { int id; + struct frame *f = decode_live_frame (*frame); - if (NILP (*frame)) - *frame = selected_frame; - CHECK_LIVE_FRAME (*frame); + XSETFRAME (*frame, f); if (EQ (name, Qt)) return Vdefault_fontset; if (NILP (name)) - { - id = FRAME_FONTSET (XFRAME (*frame)); - } + id = FRAME_FONTSET (f); else { CHECK_STRING (name); === modified file 'src/frame.c' --- src/frame.c 2012-11-03 05:59:17 +0000 +++ src/frame.c 2012-11-06 13:26:20 +0000 @@ -131,7 +131,24 @@ f->minibuffer_window = val; } - +struct frame * +decode_live_frame (register Lisp_Object frame) +{ + if (NILP (frame)) + frame = selected_frame; + CHECK_LIVE_FRAME (frame); + return XFRAME (frame); +} + +struct frame * +decode_any_frame (register Lisp_Object frame) +{ + if (NILP (frame)) + frame = selected_frame; + CHECK_FRAME (frame); + return XFRAME (frame); +} + static void set_menu_bar_lines_1 (Lisp_Object window, int n) { @@ -1118,23 +1135,12 @@ Lisp_Object delete_frame (Lisp_Object frame, Lisp_Object force) { - struct frame *f; + struct frame *f = decode_any_frame (frame); struct frame *sf = SELECTED_FRAME (); struct kboard *kb; int minibuffer_selected, is_tooltip_frame; - if (EQ (frame, Qnil)) - { - f = sf; - XSETFRAME (frame, f); - } - else - { - CHECK_FRAME (frame); - f = XFRAME (frame); - } - if (! FRAME_LIVE_P (f)) return Qnil; @@ -1146,9 +1152,11 @@ if (NILP (XCDR (Vframe_list)) && !EQ (force, Qnoelisp)) error ("Attempt to delete the only frame"); + XSETFRAME (frame, f); + /* Does this frame have a minibuffer, and is it the surrogate minibuffer for any other frame? */ - if (FRAME_HAS_MINIBUF_P (XFRAME (frame))) + if (FRAME_HAS_MINIBUF_P (f)) { Lisp_Object frames; @@ -1663,25 +1671,23 @@ If omitted, FRAME defaults to the currently selected frame. */) (Lisp_Object frame) { - if (NILP (frame)) - frame = selected_frame; - - CHECK_LIVE_FRAME (frame); + struct frame *f = decode_live_frame (frame); /* I think this should be done with a hook. */ #ifdef HAVE_WINDOW_SYSTEM - if (FRAME_WINDOW_P (XFRAME (frame))) + if (FRAME_WINDOW_P (f)) { - FRAME_SAMPLE_VISIBILITY (XFRAME (frame)); - x_make_frame_visible (XFRAME (frame)); + FRAME_SAMPLE_VISIBILITY (f); + x_make_frame_visible (f); } #endif - make_frame_visible_1 (XFRAME (frame)->root_window); + make_frame_visible_1 (f->root_window); /* Make menu bar update for the Buffers and Frames menus. */ windows_or_buffers_changed++; + XSETFRAME (frame, f); return frame; } @@ -1722,16 +1728,13 @@ displayed in the terminal. */) (Lisp_Object frame, Lisp_Object force) { - if (NILP (frame)) - frame = selected_frame; - - CHECK_LIVE_FRAME (frame); - - if (NILP (force) && !other_visible_frames (XFRAME (frame))) + struct frame *f = decode_live_frame (frame); + + if (NILP (force) && !other_visible_frames (f)) error ("Attempt to make invisible the sole visible or iconified frame"); /* Don't allow minibuf_window to remain on a deleted frame. */ - if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) + if (EQ (f->minibuffer_window, minibuf_window)) { struct frame *sf = XFRAME (selected_frame); /* Use set_window_buffer instead of Fset_window_buffer (see @@ -1743,8 +1746,8 @@ /* I think this should be done with a hook. */ #ifdef HAVE_WINDOW_SYSTEM - if (FRAME_WINDOW_P (XFRAME (frame))) - x_make_frame_invisible (XFRAME (frame)); + if (FRAME_WINDOW_P (f)) + x_make_frame_invisible (f); #endif /* Make menu bar update for the Buffers and Frames menus. */ @@ -1759,19 +1762,10 @@ If omitted, FRAME defaults to the currently selected frame. */) (Lisp_Object frame) { - if (NILP (frame)) - frame = selected_frame; - - CHECK_LIVE_FRAME (frame); - -#if 0 /* This isn't logically necessary, and it can do GC. */ - /* Don't let the frame remain selected. */ - if (EQ (frame, selected_frame)) - Fhandle_switch_frame (next_frame (frame, Qt)); -#endif + struct frame *f = decode_live_frame (frame); /* Don't allow minibuf_window to remain on an iconified frame. */ - if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) + if (EQ (f->minibuffer_window, minibuf_window)) { struct frame *sf = XFRAME (selected_frame); /* Use set_window_buffer instead of Fset_window_buffer (see @@ -1783,8 +1777,8 @@ /* I think this should be done with a hook. */ #ifdef HAVE_WINDOW_SYSTEM - if (FRAME_WINDOW_P (XFRAME (frame))) - x_iconify_frame (XFRAME (frame)); + if (FRAME_WINDOW_P (f)) + x_iconify_frame (f); #endif /* Make menu bar update for the Buffers and Frames menus. */ @@ -1848,13 +1842,9 @@ doesn't support multiple overlapping frames, this function selects FRAME. */) (Lisp_Object frame) { - struct frame *f; - if (NILP (frame)) - frame = selected_frame; - - CHECK_LIVE_FRAME (frame); - - f = XFRAME (frame); + struct frame *f = decode_live_frame (frame); + + XSETFRAME (frame, f); if (FRAME_TERMCAP_P (f)) /* On a text terminal select FRAME. */ @@ -1877,14 +1867,7 @@ doesn't support multiple overlapping frames, this function does nothing. */) (Lisp_Object frame) { - struct frame *f; - - if (NILP (frame)) - frame = selected_frame; - - CHECK_LIVE_FRAME (frame); - - f = XFRAME (frame); + struct frame *f = decode_live_frame (frame); if (FRAME_TERMINAL (f)->frame_raise_lower_hook) (*FRAME_TERMINAL (f)->frame_raise_lower_hook) (f, 0); @@ -1920,18 +1903,14 @@ The redirection lasts until `redirect-frame-focus' is called to change it. */) (Lisp_Object frame, Lisp_Object focus_frame) { - struct frame *f; - /* Note that we don't check for a live frame here. It's reasonable to redirect the focus of a frame you're about to delete, if you know what other frame should receive those keystrokes. */ - CHECK_FRAME (frame); + struct frame *f = decode_any_frame (frame); if (! NILP (focus_frame)) CHECK_LIVE_FRAME (focus_frame); - f = XFRAME (frame); - fset_focus_frame (f, focus_frame); if (FRAME_TERMINAL (f)->frame_rehighlight_hook) @@ -1941,15 +1920,14 @@ } -DEFUN ("frame-focus", Fframe_focus, Sframe_focus, 1, 1, 0, +DEFUN ("frame-focus", Fframe_focus, Sframe_focus, 0, 1, 0, doc: /* Return the frame to which FRAME's keystrokes are currently being sent. -This returns nil if FRAME's focus is not redirected. +If FRAME is omitted or nil, the selected frame is used. +Return nil if FRAME's focus is not redirected. See `redirect-frame-focus'. */) (Lisp_Object frame) { - CHECK_LIVE_FRAME (frame); - - return FRAME_FOCUS_FRAME (XFRAME (frame)); + return FRAME_FOCUS_FRAME (decode_live_frame (frame)); } @@ -1972,22 +1950,6 @@ } #endif -/* Return the buffer-predicate of the selected frame. */ - -Lisp_Object -frame_buffer_predicate (Lisp_Object frame) -{ - return XFRAME (frame)->buffer_predicate; -} - -/* Return the buffer-list of the selected frame. */ - -static Lisp_Object -frame_buffer_list (Lisp_Object frame) -{ - return XFRAME (frame)->buffer_list; -} - /* Discard BUFFER from the buffer-list and buried-buffer-list of each frame. */ void @@ -2166,20 +2128,14 @@ doc: /* Return the parameters-alist of frame FRAME. It is a list of elements of the form (PARM . VALUE), where PARM is a symbol. The meaningful PARMs depend on the kind of frame. -If FRAME is omitted, return information on the currently selected frame. */) +If FRAME is omitted or nil, return information on the currently selected frame. */) (Lisp_Object frame) { Lisp_Object alist; - FRAME_PTR f; + struct frame *f = decode_any_frame (frame); int height, width; struct gcpro gcpro1; - if (NILP (frame)) - frame = selected_frame; - - CHECK_FRAME (frame); - f = XFRAME (frame); - if (!FRAME_LIVE_P (f)) return Qnil; @@ -2240,9 +2196,8 @@ : FRAME_MINIBUF_ONLY_P (f) ? Qonly : FRAME_MINIBUF_WINDOW (f))); store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil)); - store_in_alist (&alist, Qbuffer_list, frame_buffer_list (frame)); - store_in_alist (&alist, Qburied_buffer_list, - XFRAME (frame)->buried_buffer_list); + store_in_alist (&alist, Qbuffer_list, f->buffer_list); + store_in_alist (&alist, Qburied_buffer_list, f->buried_buffer_list); /* I think this should be done with a hook. */ #ifdef HAVE_WINDOW_SYSTEM @@ -2267,17 +2222,12 @@ If FRAME is nil, describe the currently selected frame. */) (Lisp_Object frame, Lisp_Object parameter) { - struct frame *f; - Lisp_Object value; + struct frame *f = decode_any_frame (frame); + Lisp_Object value = Qnil; - if (NILP (frame)) - frame = selected_frame; - else - CHECK_FRAME (frame); CHECK_SYMBOL (parameter); - f = XFRAME (frame); - value = Qnil; + XSETFRAME (frame, f); if (FRAME_LIVE_P (f)) { @@ -2357,14 +2307,9 @@ use is not recommended. Explicitly check for a frame-parameter instead. */) (Lisp_Object frame, Lisp_Object alist) { - FRAME_PTR f; + struct frame *f = decode_live_frame (frame); register Lisp_Object tail, prop, val; - if (EQ (frame, Qnil)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); - /* I think this should be done with a hook. */ #ifdef HAVE_WINDOW_SYSTEM if (FRAME_WINDOW_P (f)) @@ -2419,18 +2364,13 @@ DEFUN ("frame-char-height", Fframe_char_height, Sframe_char_height, 0, 1, 0, doc: /* Height in pixels of a line in the font in frame FRAME. -If FRAME is omitted, the selected frame is used. +If FRAME is omitted or nil, the selected frame is used. For a terminal frame, the value is always 1. */) (Lisp_Object frame) { - struct frame *f; - - if (NILP (frame)) - frame = selected_frame; - CHECK_FRAME (frame); - f = XFRAME (frame); - #ifdef HAVE_WINDOW_SYSTEM + struct frame *f = decode_any_frame (frame); + if (FRAME_WINDOW_P (f)) return make_number (x_char_height (f)); else @@ -2442,19 +2382,14 @@ DEFUN ("frame-char-width", Fframe_char_width, Sframe_char_width, 0, 1, 0, doc: /* Width in pixels of characters in the font in frame FRAME. -If FRAME is omitted, the selected frame is used. +If FRAME is omitted or nil, the selected frame is used. On a graphical screen, the width is the standard width of the default font. For a terminal screen, the value is always 1. */) (Lisp_Object frame) { - struct frame *f; - - if (NILP (frame)) - frame = selected_frame; - CHECK_FRAME (frame); - f = XFRAME (frame); - #ifdef HAVE_WINDOW_SYSTEM + struct frame *f = decode_any_frame (frame); + if (FRAME_WINDOW_P (f)) return make_number (x_char_width (f)); else @@ -2465,7 +2400,7 @@ DEFUN ("frame-pixel-height", Fframe_pixel_height, Sframe_pixel_height, 0, 1, 0, doc: /* Return a FRAME's height in pixels. -If FRAME is omitted, the selected frame is used. The exact value +If FRAME is omitted or nil, the selected frame is used. The exact value of the result depends on the window-system and toolkit in use: In the Gtk+ version of Emacs, it includes only any window (including @@ -2480,12 +2415,7 @@ to `frame-height'). */) (Lisp_Object frame) { - struct frame *f; - - if (NILP (frame)) - frame = selected_frame; - CHECK_FRAME (frame); - f = XFRAME (frame); + struct frame *f = decode_any_frame (frame); #ifdef HAVE_WINDOW_SYSTEM if (FRAME_WINDOW_P (f)) @@ -2499,15 +2429,10 @@ Sframe_pixel_width, 0, 1, 0, doc: /* Return FRAME's width in pixels. For a terminal frame, the result really gives the width in characters. -If FRAME is omitted, the selected frame is used. */) +If FRAME is omitted or nil, the selected frame is used. */) (Lisp_Object frame) { - struct frame *f; - - if (NILP (frame)) - frame = selected_frame; - CHECK_FRAME (frame); - f = XFRAME (frame); + struct frame *f = decode_any_frame (frame); #ifdef HAVE_WINDOW_SYSTEM if (FRAME_WINDOW_P (f)) @@ -2521,17 +2446,15 @@ Stool_bar_pixel_width, 0, 1, 0, doc: /* Return width in pixels of FRAME's tool bar. The result is greater than zero only when the tool bar is on the left -or right side of FRAME. If FRAME is omitted, the selected frame is -used. */) +or right side of FRAME. If FRAME is omitted or nil, the selected frame +is used. */) (Lisp_Object frame) { - if (NILP (frame)) - frame = selected_frame; - CHECK_FRAME (frame); - #ifdef FRAME_TOOLBAR_WIDTH - if (FRAME_WINDOW_P (XFRAME (frame))) - return make_number (FRAME_TOOLBAR_WIDTH (XFRAME (frame))); + struct frame *f = decode_any_frame (frame); + + if (FRAME_WINDOW_P (f)) + return make_number (FRAME_TOOLBAR_WIDTH (f)); #endif return make_number (0); } @@ -2542,13 +2465,9 @@ but that the idea of the actual height of the frame should not be changed. */) (Lisp_Object frame, Lisp_Object lines, Lisp_Object pretend) { - register struct frame *f; + register struct frame *f = decode_live_frame (frame); CHECK_TYPE_RANGED_INTEGER (int, lines); - if (NILP (frame)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); /* I think this should be done with a hook. */ #ifdef HAVE_WINDOW_SYSTEM @@ -2570,12 +2489,9 @@ but that the idea of the actual width of the frame should not be changed. */) (Lisp_Object frame, Lisp_Object cols, Lisp_Object pretend) { - register struct frame *f; + register struct frame *f = decode_live_frame (frame); + CHECK_TYPE_RANGED_INTEGER (int, cols); - if (NILP (frame)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); /* I think this should be done with a hook. */ #ifdef HAVE_WINDOW_SYSTEM @@ -4292,12 +4208,7 @@ selected frame. This is useful when `make-pointer-invisible' is set. */) (Lisp_Object frame) { - if (NILP (frame)) - frame = selected_frame; - - CHECK_FRAME (frame); - - return (XFRAME (frame)->pointer_invisible ? Qnil : Qt); + return decode_any_frame (frame)->pointer_invisible ? Qnil : Qt; } === modified file 'src/frame.h' --- src/frame.h 2012-11-03 05:59:17 +0000 +++ src/frame.h 2012-11-06 13:26:20 +0000 @@ -943,6 +943,8 @@ extern struct frame *last_nonminibuf_frame; extern void set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object); +extern struct frame *decode_live_frame (Lisp_Object); +extern struct frame *decode_any_frame (Lisp_Object); extern struct frame *make_initial_frame (void); extern struct frame *make_frame (int); #ifdef HAVE_WINDOW_SYSTEM === modified file 'src/lisp.h' --- src/lisp.h 2012-11-03 18:19:50 +0000 +++ src/lisp.h 2012-11-06 13:26:20 +0000 @@ -3298,7 +3298,6 @@ #if HAVE_NS extern Lisp_Object get_frame_param (struct frame *, Lisp_Object); #endif -extern Lisp_Object frame_buffer_predicate (Lisp_Object); extern void frames_discard_buffer (Lisp_Object); extern void syms_of_frame (void); === modified file 'src/terminal.c' --- src/terminal.c 2012-10-01 06:36:54 +0000 +++ src/terminal.c 2012-11-06 13:26:20 +0000 @@ -360,14 +360,7 @@ The terminal device is represented by its integer identifier. */) (Lisp_Object frame) { - struct terminal *t; - - if (NILP (frame)) - frame = selected_frame; - - CHECK_LIVE_FRAME (frame); - - t = FRAME_TERMINAL (XFRAME (frame)); + struct terminal *t = FRAME_TERMINAL (decode_live_frame (frame)); if (!t) return Qnil; === modified file 'src/w32fns.c' --- src/w32fns.c 2012-11-05 16:30:45 +0000 +++ src/w32fns.c 2012-11-06 13:26:20 +0000 @@ -264,12 +264,8 @@ FRAME_PTR check_x_frame (Lisp_Object frame) { - FRAME_PTR f; + struct frame *f = decode_live_frame (frame); - if (NILP (frame)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); if (! FRAME_W32_P (f)) error ("Non-W32 frame used"); return f; === modified file 'src/window.c' --- src/window.c 2012-11-06 06:27:20 +0000 +++ src/window.c 2012-11-06 13:26:20 +0000 @@ -340,10 +340,7 @@ If FRAME is omitted or nil, it defaults to the selected frame. */) (Lisp_Object frame) { - if (NILP (frame)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); - return FRAME_MINIBUF_WINDOW (XFRAME (frame)); + return FRAME_MINIBUF_WINDOW (decode_live_frame (frame)); } DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, @@ -1371,12 +1368,7 @@ column 0. */) (Lisp_Object x, Lisp_Object y, Lisp_Object frame) { - struct frame *f; - - if (NILP (frame)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); + struct frame *f = decode_live_frame (frame); /* Check that arguments are integers or floats. */ CHECK_NUMBER_OR_FLOAT (x); @@ -3109,12 +3101,12 @@ } DEFUN ("run-window-configuration-change-hook", Frun_window_configuration_change_hook, - Srun_window_configuration_change_hook, 1, 1, 0, - doc: /* Run `window-configuration-change-hook' for FRAME. */) + Srun_window_configuration_change_hook, 0, 1, 0, + doc: /* Run `window-configuration-change-hook' for FRAME. +If FRAME is omitted or nil, it defaults to the selected frame. */) (Lisp_Object frame) { - CHECK_LIVE_FRAME (frame); - run_window_configuration_change_hook (XFRAME (frame)); + run_window_configuration_change_hook (decode_live_frame (frame)); return Qnil; } @@ -3641,10 +3633,12 @@ } -DEFUN ("window-resize-apply", Fwindow_resize_apply, Swindow_resize_apply, 1, 2, 0, +DEFUN ("window-resize-apply", Fwindow_resize_apply, Swindow_resize_apply, 0, 2, 0, doc: /* Apply requested size values for window-tree of FRAME. -Optional argument HORIZONTAL omitted or nil means apply requested height -values. HORIZONTAL non-nil means apply requested width values. +If FRAME is omitted or nil, it defaults to the selected frame. + +Optional argument HORIZONTAL omitted or nil means apply requested +height values. HORIZONTAL non-nil means apply requested width values. This function checks whether the requested values sum up to a valid window layout, recursively assigns the new sizes of all child windows @@ -3655,17 +3649,10 @@ be applied on the Elisp level. */) (Lisp_Object frame, Lisp_Object horizontal) { - struct frame *f; - struct window *r; + struct frame *f = decode_live_frame (frame); + struct window *r = XWINDOW (FRAME_ROOT_WINDOW (f)); int horflag = !NILP (horizontal); - if (NILP (frame)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); - - f = XFRAME (frame); - r = XWINDOW (FRAME_ROOT_WINDOW (f)); - if (!window_resize_check (r, horflag) || ! EQ (r->new_total, (horflag ? r->total_cols : r->total_lines))) @@ -6148,12 +6135,7 @@ register int n_windows; register struct save_window_data *data; register int i; - FRAME_PTR f; - - if (NILP (frame)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); + struct frame *f = decode_live_frame (frame); n_windows = count_windows (XWINDOW (FRAME_ROOT_WINDOW (f))); data = ALLOCATE_PSEUDOVECTOR (struct save_window_data, frame_cols, === modified file 'src/xdisp.c' --- src/xdisp.c 2012-11-03 19:14:22 +0000 +++ src/xdisp.c 2012-11-06 13:26:20 +0000 @@ -11916,19 +11916,14 @@ DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed, 0, 1, 0, - doc: /* Return the number of lines occupied by the tool bar of FRAME. */) + doc: /* Return the number of lines occupied by the tool bar of FRAME. +If FRAME is nil or omitted, use the selected frame. */) (Lisp_Object frame) { - struct frame *f; + struct frame *f = decode_any_frame (frame); struct window *w; int nlines = 0; - if (NILP (frame)) - frame = selected_frame; - else - CHECK_FRAME (frame); - f = XFRAME (frame); - if (WINDOWP (f->tool_bar_window) && (w = XWINDOW (f->tool_bar_window), WINDOW_TOTAL_LINES (w) > 0)) === modified file 'src/xfaces.c' --- src/xfaces.c 2012-10-23 02:39:13 +0000 +++ src/xfaces.c 2012-11-06 13:26:20 +0000 @@ -669,23 +669,6 @@ } #endif /* HAVE_NS */ -/* If FRAME is nil, return a pointer to the selected frame. - Otherwise, check that FRAME is a live frame, and return a pointer - to it. NPARAM is the parameter number of FRAME, for - CHECK_LIVE_FRAME. This is here because it's a frequent pattern in - Lisp function definitions. */ - -static struct frame * -frame_or_selected_frame (Lisp_Object frame, int nparam) -{ - if (NILP (frame)) - frame = selected_frame; - - CHECK_LIVE_FRAME (frame); - return XFRAME (frame); -} - - /*********************************************************************** Frames and faces ***********************************************************************/ @@ -1204,15 +1187,9 @@ If FRAME is nil or omitted, use the selected frame. */) (Lisp_Object color, Lisp_Object frame) { - struct frame *f; - CHECK_STRING (color); - if (NILP (frame)) - frame = selected_frame; - else - CHECK_FRAME (frame); - f = XFRAME (frame); - return face_color_gray_p (f, SSDATA (color)) ? Qt : Qnil; + return (face_color_gray_p (decode_any_frame (frame), SSDATA (color)) + ? Qt : Qnil); } @@ -1225,17 +1202,10 @@ COLOR must be a valid color name. */) (Lisp_Object color, Lisp_Object frame, Lisp_Object background_p) { - struct frame *f; - CHECK_STRING (color); - if (NILP (frame)) - frame = selected_frame; - else - CHECK_FRAME (frame); - f = XFRAME (frame); - if (face_color_supported_p (f, SSDATA (color), !NILP (background_p))) - return Qt; - return Qnil; + return (face_color_supported_p (decode_any_frame (frame), + SSDATA (color), !NILP (background_p)) + ? Qt : Qnil); } @@ -1683,9 +1653,7 @@ /* We can't simply call check_x_frame because this function may be called before any frame is created. */ - if (NILP (frame)) - frame = selected_frame; - f = frame_or_selected_frame (frame, 2); + f = decode_live_frame (frame); if (! FRAME_WINDOW_P (f)) { /* Perhaps we have not yet created any frame. */ @@ -1693,6 +1661,8 @@ frame = Qnil; face = Qnil; } + else + XSETFRAME (frame, f); /* Determine the width standard for comparison with the fonts we find. */ @@ -3679,21 +3649,12 @@ frames). If FRAME is omitted or nil, use the selected frame. */) (Lisp_Object symbol, Lisp_Object keyword, Lisp_Object frame) { - Lisp_Object lface, value = Qnil; + struct frame *f = EQ (frame, Qt) ? NULL : decode_live_frame (frame); + Lisp_Object lface = lface_from_face_name (f, symbol, 1), value = Qnil; CHECK_SYMBOL (symbol); CHECK_SYMBOL (keyword); - if (EQ (frame, Qt)) - lface = lface_from_face_name (NULL, symbol, 1); - else - { - if (NILP (frame)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); - lface = lface_from_face_name (XFRAME (frame), symbol, 1); - } - if (EQ (keyword, QCfamily)) value = LFACE_FAMILY (lface); else if (EQ (keyword, QCfoundry)) @@ -3876,7 +3837,7 @@ } else { - struct frame *f = frame_or_selected_frame (frame, 1); + struct frame *f = decode_live_frame (frame); int face_id = lookup_named_face (f, face, 1); struct face *fface = FACE_FROM_ID (f, face_id); @@ -3963,14 +3924,11 @@ struct frame *f; Lisp_Object lface1, lface2; - if (EQ (frame, Qt)) - f = NULL; - else - /* Don't use check_x_frame here because this function is called - before X frames exist. At that time, if FRAME is nil, - selected_frame will be used which is the frame dumped with - Emacs. That frame is not an X frame. */ - f = frame_or_selected_frame (frame, 2); + /* Don't use check_x_frame here because this function is called + before X frames exist. At that time, if FRAME is nil, + selected_frame will be used which is the frame dumped with + Emacs. That frame is not an X frame. */ + f = EQ (frame, Qt) ? NULL : decode_live_frame (frame); lface1 = lface_from_face_name (f, face1, 1); lface2 = lface_from_face_name (f, face2, 1); @@ -3988,20 +3946,10 @@ If FRAME is omitted or nil, use the selected frame. */) (Lisp_Object face, Lisp_Object frame) { - struct frame *f; - Lisp_Object lface; + struct frame *f = EQ (frame, Qt) ? NULL : decode_live_frame (frame); + Lisp_Object lface = lface_from_face_name (f, face, 1); int i; - if (NILP (frame)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); - - if (EQ (frame, Qt)) - lface = lface_from_face_name (NULL, face, 1); - else - lface = lface_from_face_name (f, face, 1); - for (i = 1; i < LFACE_VECTOR_SIZE; ++i) if (!UNSPECIFIEDP (AREF (lface, i))) break; @@ -4016,8 +3964,7 @@ For internal use only. */) (Lisp_Object frame) { - struct frame *f = frame_or_selected_frame (frame, 0); - return f->face_alist; + return decode_live_frame (frame)->face_alist; } @@ -4205,14 +4152,9 @@ If FRAME is unspecified or nil, the current frame is used. */) (Lisp_Object color1, Lisp_Object color2, Lisp_Object frame) { - struct frame *f; + struct frame *f = decode_live_frame (frame); XColor cdef1, cdef2; - if (NILP (frame)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); - if (!(CONSP (color1) && parse_rgb_list (color1, &cdef1)) && !(STRINGP (color1) && defined_color (f, SSDATA (color1), &cdef1, 0))) signal_error ("Invalid color", color1); === modified file 'src/xfns.c' --- src/xfns.c 2012-11-03 05:59:17 +0000 +++ src/xfns.c 2012-11-06 13:26:20 +0000 @@ -164,12 +164,8 @@ FRAME_PTR check_x_frame (Lisp_Object frame) { - FRAME_PTR f; + struct frame *f = decode_live_frame (frame); - if (NILP (frame)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); if (! FRAME_X_P (f)) error ("Non-X frame used"); return f; ------------------------------------------------------------ revno: 110811 committer: Dmitry Antipov branch nick: trunk timestamp: Tue 2012-11-06 11:37:06 +0400 message: * emacs-lisp/byte-opt.el (toplevel): Add compare-window-configurations, frame-first-window, frame-root-window, frame-selected-window, minibuffer-selected-window, minibuffer-window, window-absolute-pixel-edges, window-at, window-body-height, window-body-width, window-display-table, window-combination-limit, window-frame, window-fringes, window-inside-absolute-pixel-edges, window-inside-edges, window-inside-pixel-edges, window-left-child, window-left-column, window-margins, window-next-buffers, window-next-sibling, window-new-normal, window-new-total, window-normal-size, window-parameter, window-parameters, window-parent, window-pixel-edges, window-point, window-prev-buffers, window-prev-sibling, window-redisplay-end-trigger, window-scroll-bars, window-start, window-text-height, window-top-child, window-top-line, window-total-height, window-total-width and window-use-time to the list of functions without side-effects. (toplevel): Add window-valid-p to the list of error-free functions without side-effects. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-11-05 16:32:35 +0000 +++ lisp/ChangeLog 2012-11-06 07:37:06 +0000 @@ -1,3 +1,23 @@ +2012-11-06 Dmitry Antipov + + * emacs-lisp/byte-opt.el (toplevel): Add compare-window-configurations, + frame-first-window, frame-root-window, frame-selected-window, + minibuffer-selected-window, minibuffer-window, + window-absolute-pixel-edges, window-at, window-body-height, + window-body-width, window-display-table, window-combination-limit, + window-frame, window-fringes, window-inside-absolute-pixel-edges, + window-inside-edges, window-inside-pixel-edges, window-left-child, + window-left-column, window-margins, window-next-buffers, + window-next-sibling, window-new-normal, window-new-total, + window-normal-size, window-parameter, window-parameters, window-parent, + window-pixel-edges, window-point, window-prev-buffers, + window-prev-sibling, window-redisplay-end-trigger, window-scroll-bars, + window-start, window-text-height, window-top-child, window-top-line, + window-total-height, window-total-width and window-use-time to the list + of functions without side-effects. + (toplevel): Add window-valid-p to the list of error-free functions + without side-effects. + 2012-11-05 Agustín Martín Domingo * textmodes/ispell.el (ispell-program-name): Update === modified file 'lisp/emacs-lisp/byte-opt.el' --- lisp/emacs-lisp/byte-opt.el 2012-07-26 01:27:33 +0000 +++ lisp/emacs-lisp/byte-opt.el 2012-11-06 07:37:06 +0000 @@ -1187,8 +1187,8 @@ boundp buffer-file-name buffer-local-variables buffer-modified-p buffer-substring byte-code-function-p capitalize car-less-than-car car cdr ceiling char-after char-before - char-equal char-to-string char-width - compare-strings concat coordinates-in-window-p + char-equal char-to-string char-width compare-strings + compare-window-configurations concat coordinates-in-window-p copy-alist copy-sequence copy-marker cos count-lines decode-char decode-time default-boundp default-value documentation downcase @@ -1196,17 +1196,18 @@ fboundp fceiling featurep ffloor file-directory-p file-exists-p file-locked-p file-name-absolute-p file-newer-than-file-p file-readable-p file-symlink-p file-writable-p - float float-time floor format format-time-string frame-visible-p - fround ftruncate + float float-time floor format format-time-string frame-first-window + frame-root-window frame-selected-window + frame-visible-p fround ftruncate get gethash get-buffer get-buffer-window getenv get-file-buffer hash-table-count int-to-string intern-soft keymap-parent length local-variable-if-set-p local-variable-p log log10 logand logb logior lognot logxor lsh langinfo - make-list make-string make-symbol - marker-buffer max member memq min mod multibyte-char-to-unibyte - next-window nth nthcdr number-to-string + make-list make-string make-symbol marker-buffer max member memq min + minibuffer-selected-window minibuffer-window + mod multibyte-char-to-unibyte next-window nth nthcdr number-to-string parse-colon-path plist-get plist-member prefix-numeric-value previous-window prin1-to-string propertize degrees-to-radians @@ -1221,9 +1222,19 @@ unibyte-char-to-multibyte upcase user-full-name user-login-name user-original-login-name custom-variable-p vconcat - window-buffer window-dedicated-p window-edges window-height - window-hscroll window-minibuffer-p window-width - zerop)) + window-absolute-pixel-edges window-at window-body-height + window-body-width window-buffer window-dedicated-p window-display-table + window-combination-limit window-edges window-frame window-fringes + window-height window-hscroll window-inside-edges + window-inside-absolute-pixel-edges window-inside-pixel-edges + window-left-child window-left-column window-margins window-minibuffer-p + window-next-buffers window-next-sibling window-new-normal + window-new-total window-normal-size window-parameter window-parameters + window-parent window-pixel-edges window-point window-prev-buffers + window-prev-sibling window-redisplay-end-trigger window-scroll-bars + window-start window-text-height window-top-child window-top-line + window-total-height window-total-width window-use-time window-vscroll + window-width zerop)) (side-effect-and-error-free-fns '(arrayp atom bobp bolp bool-vector-p @@ -1256,7 +1267,8 @@ this-single-command-raw-keys user-real-login-name user-real-uid user-uid vector vectorp visible-frame-list - wholenump window-configuration-p window-live-p windowp))) + wholenump window-configuration-p window-live-p + window-valid-p windowp))) (while side-effect-free-fns (put (car side-effect-free-fns) 'side-effect-free t) (setq side-effect-free-fns (cdr side-effect-free-fns)))