Now on revision 109788. ------------------------------------------------------------ revno: 109788 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2012-08-27 08:15:33 +0400 message: Special MEM_TYPE_SPARE to denote reserved memory. * alloc.c (enum mem_type): New memory type. (refill_memory_reserve): Use new type for spare memory. This prevents live_cons_p and live_string_p from incorrect detection of uninitialized objects from spare memory as live. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-26 10:29:37 +0000 +++ src/ChangeLog 2012-08-27 04:15:33 +0000 @@ -1,3 +1,11 @@ +2012-08-27 Dmitry Antipov + + Special MEM_TYPE_SPARE to denote reserved memory. + * alloc.c (enum mem_type): New memory type. + (refill_memory_reserve): Use new type for spare memory. + This prevents live_cons_p and live_string_p from incorrect + detection of uninitialized objects from spare memory as live. + 2012-08-26 Paul Eggert Spelling fixes. === modified file 'src/alloc.c' --- src/alloc.c 2012-08-25 04:04:08 +0000 +++ src/alloc.c 2012-08-27 04:15:33 +0000 @@ -305,7 +305,9 @@ and runtime slowdown. Minor but pointless. */ MEM_TYPE_VECTORLIKE, /* Special type to denote vector blocks. */ - MEM_TYPE_VECTOR_BLOCK + MEM_TYPE_VECTOR_BLOCK, + /* Special type to denote reserved memory. */ + MEM_TYPE_SPARE }; static void *lisp_malloc (size_t, enum mem_type); @@ -3816,22 +3818,22 @@ spare_memory[0] = malloc (SPARE_MEMORY); if (spare_memory[1] == 0) spare_memory[1] = lisp_align_malloc (sizeof (struct cons_block), - MEM_TYPE_CONS); + MEM_TYPE_SPARE); if (spare_memory[2] == 0) spare_memory[2] = lisp_align_malloc (sizeof (struct cons_block), - MEM_TYPE_CONS); + MEM_TYPE_SPARE); if (spare_memory[3] == 0) spare_memory[3] = lisp_align_malloc (sizeof (struct cons_block), - MEM_TYPE_CONS); + MEM_TYPE_SPARE); if (spare_memory[4] == 0) spare_memory[4] = lisp_align_malloc (sizeof (struct cons_block), - MEM_TYPE_CONS); + MEM_TYPE_SPARE); if (spare_memory[5] == 0) spare_memory[5] = lisp_malloc (sizeof (struct string_block), - MEM_TYPE_STRING); + MEM_TYPE_SPARE); if (spare_memory[6] == 0) spare_memory[6] = lisp_malloc (sizeof (struct string_block), - MEM_TYPE_STRING); + MEM_TYPE_SPARE); if (spare_memory[0] && spare_memory[1] && spare_memory[5]) Vmemory_full = Qnil; #endif ------------------------------------------------------------ revno: 109787 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-08-26 21:42:18 +0800 message: Make special-display-* and display-buffer-reuse-frames obsolete. * lisp/window.el (special-display-regexps, special-display-frame-alist) (special-display-buffer-names, special-display-function) (display-buffer-reuse-frames): Mark as obsolete. * lisp/progmodes/compile.el: Don't use display-buffer-reuse-frames. * help.el (help-print-return-message): Don't treat display-buffer-reuse-frames specially. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-08-26 10:29:37 +0000 +++ etc/NEWS 2012-08-26 13:42:18 +0000 @@ -622,6 +622,16 @@ *** New display action alist `pop-up-frame-parameters', if non-nil, specifies frame parameters to give any newly-created frame. +*** The following variables are obsolete, as they can be replaced by +appropriate entries in the `display-buffer-alist' function introduced +in Emacs 24.1: + +**** `display-buffer-reuse-frames' +**** `special-display-regexps' +**** `special-display-frame-alist' +**** `special-display-buffer-names' +**** `special-display-function' + ** Completion *** New function `completion-table-with-quoting' to handle completion === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-26 09:16:48 +0000 +++ lisp/ChangeLog 2012-08-26 13:42:18 +0000 @@ -1,5 +1,16 @@ 2012-08-26 Chong Yidong + * window.el (special-display-regexps, special-display-frame-alist) + (special-display-buffer-names, special-display-function) + (display-buffer-reuse-frames): Mark as obsolete. + + * progmodes/compile.el: Don't use display-buffer-reuse-frames. + + * help.el (help-print-return-message): Don't treat + display-buffer-reuse-frames specially. + +2012-08-26 Chong Yidong + * progmodes/gdb-mi.el (gdb-display-buffer-other-frame-action): New variable, replacing gdb-frame-parameters. (gdb-frame-io-buffer, gdb-frame-breakpoints-buffer) === modified file 'lisp/help.el' --- lisp/help.el 2012-08-15 16:29:11 +0000 +++ lisp/help.el 2012-08-26 13:42:18 +0000 @@ -145,10 +145,6 @@ ;; Secondly, the buffer has not been displayed yet, ;; so we don't know whether its frame will be selected. nil) - (display-buffer-reuse-frames - (setq help-return-method (cons (selected-window) - 'quit-window)) - nil) ((not (one-window-p t)) (setq help-return-method (cons (selected-window) 'quit-window)) === modified file 'lisp/progmodes/compile.el' --- lisp/progmodes/compile.el 2012-08-15 16:29:11 +0000 +++ lisp/progmodes/compile.el 2012-08-26 13:42:18 +0000 @@ -2461,10 +2461,7 @@ ;; the error location if the two buffers are in two ;; different frames. So don't do it if it's not necessary. pre-existing - (let ((display-buffer-reuse-frames t) - (pop-up-windows t)) - ;; Pop up a window. - (display-buffer (marker-buffer msg))))) + (display-buffer (marker-buffer msg)))) (highlight-regexp (with-current-buffer (marker-buffer msg) ;; also do this while we change buffer (compilation-set-window w msg) === modified file 'lisp/window.el' --- lisp/window.el 2012-08-26 09:16:48 +0000 +++ lisp/window.el 2012-08-26 13:42:18 +0000 @@ -4460,8 +4460,7 @@ (repeat :tag "Arguments" (sexp))))) :group 'windows :group 'frames) - -;;;###autoload +(make-obsolete-variable 'special-display-buffer-names 'display-buffer-alist "24.3") (put 'special-display-buffer-names 'risky-local-variable t) (defcustom special-display-regexps nil @@ -4528,6 +4527,8 @@ (repeat :tag "Arguments" (sexp))))) :group 'windows :group 'frames) +(make-obsolete-variable 'special-display-regexps 'display-buffer-alist "24.3") +(put 'special-display-regexps 'risky-local-variable t) (defun special-display-p (buffer-name) "Return non-nil if a buffer named BUFFER-NAME gets a special frame. @@ -4569,6 +4570,7 @@ (symbol :tag "Parameter") (sexp :tag "Value"))) :group 'frames) +(make-obsolete-variable 'special-display-frame-alist 'display-buffer-alist "24.3") (defun special-display-popup-frame (buffer &optional args) "Pop up a frame displaying BUFFER and return its window. @@ -4635,6 +4637,7 @@ of the window used." :type 'function :group 'frames) +(make-obsolete-variable 'special-display-function 'display-buffer-alist "24.3") (defcustom same-window-buffer-names nil "List of names of buffers that should appear in the \"same\" window. @@ -4707,6 +4710,7 @@ :type 'boolean :version "21.1" :group 'windows) +(make-obsolete-variable 'display-buffer-reuse-frames 'display-buffer-alist "24.3") (defcustom pop-up-windows t "Non-nil means `display-buffer' should make a new window." ------------------------------------------------------------ revno: 109786 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-08-26 03:29:37 -0700 message: Spelling fixes. * Makefile.in (.PHONY): versioclean -> versionclean. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-08-26 09:16:48 +0000 +++ etc/NEWS 2012-08-26 10:29:37 +0000 @@ -23,7 +23,7 @@ * Installation Changes in Emacs 24.3 -** New configure option '--without-all' to disable additonal features. +** New configure option '--without-all' to disable additional features. This disables most of the features that are normally enabled by default. ** New configure option '--enable-link-time-optimization' to utilize === modified file 'lisp/calc/calccomp.el' --- lisp/calc/calccomp.el 2012-08-09 14:46:03 +0000 +++ lisp/calc/calccomp.el 2012-08-26 10:29:37 +0000 @@ -86,7 +86,7 @@ (setq sn (math-to-underscores sn))) sn))) -;;; Give multiplication precendence when composing to avoid +;;; Give multiplication precedence when composing to avoid ;;; writing a*(b c) instead of a b c (defun math-compose-expr (a prec &optional div) (let ((calc-multiplication-has-precedence t) === modified file 'lisp/woman.el' --- lisp/woman.el 2012-08-07 03:57:05 +0000 +++ lisp/woman.el 2012-08-26 10:29:37 +0000 @@ -2531,7 +2531,7 @@ (cond ;; ((looking-at "[no]") (setq c t)) ; accept n(roff) and o(dd page) ;; ((looking-at "[te]") (setq c nil)) ; reject t(roff) and e(ven page) - ;; Per groff ".if v" is recognised as false (it means -Tversatec). + ;; Per groff ".if v" is recognized as false (it means -Tversatec). ((looking-at "[ntoev]") (setq c (memq (following-char) woman-if-conditions-true))) ;; Unrecognized letter so reject: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-26 10:04:27 +0000 +++ src/ChangeLog 2012-08-26 10:29:37 +0000 @@ -1,5 +1,8 @@ 2012-08-26 Paul Eggert + Spelling fixes. + * Makefile.in (.PHONY): versioclean -> versionclean. + Remove unused external symbols. * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector): * window.c (Qwindow_valid_p, decode_valid_window): === modified file 'src/Makefile.in' --- src/Makefile.in 2012-08-25 04:04:08 +0000 +++ src/Makefile.in 2012-08-26 10:29:37 +0000 @@ -502,7 +502,7 @@ @ns_frag@ .PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean -.PHONY: versioclean extraclean frc +.PHONY: versionclean extraclean frc mostlyclean: rm -f temacs$(EXEEXT) core *.core \#* *.o libXMenu11.a liblw.a === modified file 'src/w32.c' --- src/w32.c 2012-08-18 02:49:24 +0000 +++ src/w32.c 2012-08-26 10:29:37 +0000 @@ -4098,7 +4098,7 @@ dir_access = sys_access (filename, D_OK); /* Since Windows distinguishes between symlinks to directories and - to files, we provide a kludgey feature: if FILENAME doesn't + to files, we provide a kludgy feature: if FILENAME doesn't exist, but ends in a slash, we create a symlink to directory. If FILENAME exists and is a directory, we always create a symlink to directory. */ @@ -4165,7 +4165,7 @@ whether the underlying volume actually supports symlinks, by testing the FILE_SUPPORTS_REPARSE_POINTS bit in volume's flags, and avoid the call to this function if it doesn't. That's because the - call to GetFileAttributes takes a non-negligible time, expecially + call to GetFileAttributes takes a non-negligible time, especially on non-local or removable filesystems. See stat_worker for an example of how to do that. */ static int === modified file 'src/xdisp.c' --- src/xdisp.c 2012-08-21 23:39:56 +0000 +++ src/xdisp.c 2012-08-26 10:29:37 +0000 @@ -2420,7 +2420,7 @@ static Lisp_Object safe_eval_handler (Lisp_Object arg, ptrdiff_t nargs, Lisp_Object *args) { - add_to_log ("Error during redisplay: %S signalled %S", + add_to_log ("Error during redisplay: %S signaled %S", Flist (nargs, args), arg); return Qnil; } ------------------------------------------------------------ revno: 109785 committer: Glenn Morris branch nick: trunk timestamp: Sun 2012-08-26 06:19:02 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/configure' --- autogen/configure 2012-08-25 10:17:28 +0000 +++ autogen/configure 2012-08-26 10:19:02 +0000 @@ -7027,6 +7027,55 @@ # Code from module warnings: +# It's helpful to have C macros available to GDB, so prefer -g3 to -g +# if -g3 works and the user does not specify CFLAGS. +# This test must follow gl_EARLY; otherwise AC_LINK_IFELSE complains. +if test "$ac_test_CFLAGS" != set; then + case $CFLAGS in + '-g') + emacs_g3_CFLAGS='-g3';; + '-g -O2') + emacs_g3_CFLAGS='-g3 -O2';; + *) + emacs_g3_CFLAGS='';; + esac + if test -n "$emacs_g3_CFLAGS"; then + emacs_save_CFLAGS=$CFLAGS + CFLAGS=$emacs_g3_CFLAGS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts $emacs_g3_CFLAGS" >&5 +$as_echo_n "checking whether $CC accepts $emacs_g3_CFLAGS... " >&6; } +if test "${emacs_cv_prog_cc_g3+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + emacs_cv_prog_cc_g3=yes +else + emacs_cv_prog_cc_g3=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_prog_cc_g3" >&5 +$as_echo "$emacs_cv_prog_cc_g3" >&6; } + if test $emacs_cv_prog_cc_g3 = yes; then + CFLAGS=$emacs_g3_CFLAGS + else + CFLAGS=$emacs_save_CFLAGS + fi + fi +fi + # Check whether --enable-gcc-warnings was given. if test "${enable_gcc_warnings+set}" = set; then : enableval=$enable_gcc_warnings; case $enableval in ------------------------------------------------------------ revno: 109784 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-08-26 03:04:27 -0700 message: Remove unused external symbols. * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector): * window.c (Qwindow_valid_p, decode_valid_window): Now static, not extern. * data.c (Qinterval): Remove; unused. (syms_of_data): Do not define 'interval'. * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons): * window.h (decode_valid_window): Remove decls. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-26 08:41:36 +0000 +++ src/ChangeLog 2012-08-26 10:04:27 +0000 @@ -1,5 +1,15 @@ 2012-08-26 Paul Eggert + Remove unused external symbols. + * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector): + * window.c (Qwindow_valid_p, decode_valid_window): + Now static, not extern. + * data.c (Qinterval): Remove; unused. + (syms_of_data): Do not define 'interval'. + * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons): + * window.h (decode_valid_window): + Remove decls. + * character.c, charset.c, chartab.c: Use bool for booleans. * character.c (lisp_string_width, string_count_byte8) (string_escape_byte8): === modified file 'src/data.c' --- src/data.c 2012-08-20 07:42:06 +0000 +++ src/data.c 2012-08-26 10:04:27 +0000 @@ -83,8 +83,8 @@ Lisp_Object Qfloatp; Lisp_Object Qnumberp, Qnumber_or_marker_p; -Lisp_Object Qinteger, Qinterval, Qfloat, Qvector; -Lisp_Object Qsymbol, Qstring, Qcons, Qmisc; +Lisp_Object Qinteger, Qsymbol; +static Lisp_Object Qcons, Qfloat, Qmisc, Qstring, Qvector; Lisp_Object Qwindow; static Lisp_Object Qoverlay, Qwindow_configuration; static Lisp_Object Qprocess, Qmarker; @@ -3090,8 +3090,6 @@ DEFSYM (Qchar_table, "char-table"); DEFSYM (Qbool_vector, "bool-vector"); DEFSYM (Qhash_table, "hash-table"); - /* Used by Fgarbage_collect. */ - DEFSYM (Qinterval, "interval"); DEFSYM (Qmisc, "misc"); DEFSYM (Qdefun, "defun"); === modified file 'src/lisp.h' --- src/lisp.h 2012-08-26 05:21:04 +0000 +++ src/lisp.h 2012-08-26 10:04:27 +0000 @@ -2573,8 +2573,7 @@ extern Lisp_Object Qfloatp; extern Lisp_Object Qnumberp, Qnumber_or_marker_p; -extern Lisp_Object Qinteger, Qinterval, Qsymbol, Qstring; -extern Lisp_Object Qmisc, Qvector, Qfloat, Qcons, Qbuffer; +extern Lisp_Object Qbuffer, Qinteger, Qsymbol; extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object; === modified file 'src/window.c' --- src/window.c 2012-08-21 09:27:07 +0000 +++ src/window.c 2012-08-26 10:04:27 +0000 @@ -54,7 +54,8 @@ #include "nsterm.h" #endif -Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_valid_p; +Lisp_Object Qwindowp, Qwindow_live_p; +static Lisp_Object Qwindow_valid_p; static Lisp_Object Qwindow_configuration_p, Qrecord_window_buffer; static Lisp_Object Qwindow_deletable_p, Qdelete_window, Qdisplay_buffer; static Lisp_Object Qreplace_buffer_in_windows, Qget_mru_window; @@ -268,7 +269,7 @@ return w; } -struct window * +static struct window * decode_valid_window (register Lisp_Object window) { struct window *w; === modified file 'src/window.h' --- src/window.h 2012-08-18 01:42:52 +0000 +++ src/window.h 2012-08-26 10:04:27 +0000 @@ -972,7 +972,6 @@ extern Lisp_Object Qwindowp, Qwindow_live_p; extern Lisp_Object Vwindow_list; -extern struct window *decode_valid_window (Lisp_Object); extern struct window *decode_live_window (Lisp_Object); extern int compare_window_configurations (Lisp_Object, Lisp_Object, int); extern void mark_window_cursors_off (struct window *); ------------------------------------------------------------ revno: 109783 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-08-26 02:26:45 -0700 message: * fns.c (Fstring_to_unibyte): Adjust to str_to_unibyte change. diff: === modified file 'src/fns.c' --- src/fns.c 2012-08-21 23:39:56 +0000 +++ src/fns.c 2012-08-26 09:26:45 +0000 @@ -1100,7 +1100,7 @@ { ptrdiff_t chars = SCHARS (string); unsigned char *str = xmalloc (chars); - ptrdiff_t converted = str_to_unibyte (SDATA (string), str, chars, 0); + ptrdiff_t converted = str_to_unibyte (SDATA (string), str, chars); if (converted < chars) error ("Can't convert the %"pD"dth character to unibyte", converted); ------------------------------------------------------------ revno: 109782 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-08-26 17:16:48 +0800 message: Clean up gdb-mi's usage of display-buffer. * progmodes/gdb-mi.el (gdb-display-buffer-other-frame-action): New variable, replacing gdb-frame-parameters. (gdb-frame-io-buffer, gdb-frame-breakpoints-buffer) (gdb-frame-threads-buffer, gdb-frame-memory-buffer) (gdb-frame-disassembly-buffer, gdb-frame-stack-buffer) (gdb-frame-locals-buffer, gdb-frame-registers-buffer): Use it. (def-gdb-frame-for-buffer): Macro deleted. It is easier to define the functions directly with gdb-display-buffer-other-frame-action. (gdb-display-breakpoints-buffer, gdb-display-threads-buffer) (gdb-display-memory-buffer, gdb-display-disassembly-buffer) (gdb-display-stack-buffer, gdb-display-locals-buffer) (gdb-display-registers-buffer): Define directly. (def-gdb-display-buffer): Macro deleted. (gdb-display-buffer): Remove second and third args, callers don't use them. Defer to the default display-buffer behavior, apart from making windows dedicated. (gdb-setup-windows): Don't call display-buffer unnecessarily. * window.el (display-buffer-pop-up-frame): Handle a pop-up-frame-parameters alist entry. (display-buffer): Document it. * progmodes/gud.el (gud-display-line): Just use display-buffer. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-08-26 03:57:55 +0000 +++ etc/NEWS 2012-08-26 09:16:48 +0000 @@ -619,6 +619,9 @@ *** 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. + ** Completion *** New function `completion-table-with-quoting' to handle completion === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-08-26 03:57:55 +0000 +++ lisp/ChangeLog 2012-08-26 09:16:48 +0000 @@ -1,5 +1,31 @@ 2012-08-26 Chong Yidong + * progmodes/gdb-mi.el (gdb-display-buffer-other-frame-action): New + variable, replacing gdb-frame-parameters. + (gdb-frame-io-buffer, gdb-frame-breakpoints-buffer) + (gdb-frame-threads-buffer, gdb-frame-memory-buffer) + (gdb-frame-disassembly-buffer, gdb-frame-stack-buffer) + (gdb-frame-locals-buffer, gdb-frame-registers-buffer): Use it. + (def-gdb-frame-for-buffer): Macro deleted. It is easier to define + the functions directly with gdb-display-buffer-other-frame-action. + (gdb-display-breakpoints-buffer, gdb-display-threads-buffer) + (gdb-display-memory-buffer, gdb-display-disassembly-buffer) + (gdb-display-stack-buffer, gdb-display-locals-buffer) + (gdb-display-registers-buffer): Define directly. + (def-gdb-display-buffer): Macro deleted. + (gdb-display-buffer): Remove second and third args, callers don't + use them. Defer to the default display-buffer behavior, apart + from making windows dedicated. + (gdb-setup-windows): Don't call display-buffer unnecessarily. + + * progmodes/gud.el (gud-display-line): Just use display-buffer. + + * window.el (display-buffer-pop-up-frame): Handle a + pop-up-frame-parameters alist entry. + (display-buffer): Document it. + +2012-08-26 Chong Yidong + * isearch.el (search-whitespace-regexp): Make string and nil values apply to both ordinary and regexp search. Allow a cons cell value to distinguish between the two. === modified file 'lisp/progmodes/gdb-mi.el' --- lisp/progmodes/gdb-mi.el 2012-08-14 18:48:39 +0000 +++ lisp/progmodes/gdb-mi.el 2012-08-26 09:16:48 +0000 @@ -1413,29 +1413,6 @@ (with-current-buffer ,buffer (apply ',expr args)))) -;; Used to define all gdb-frame-*-buffer functions except -;; `gdb-frame-io-buffer' -(defmacro def-gdb-frame-for-buffer (name buffer &optional doc) - "Define a function NAME which shows gdb BUFFER in a separate frame. - -DOC is an optional documentation string." - `(defun ,name (&optional thread) - ,(when doc doc) - (interactive) - (let ((special-display-regexps (append special-display-regexps '(".*"))) - (special-display-frame-alist gdb-frame-parameters)) - (display-buffer (gdb-get-buffer-create ,buffer thread))))) - -(defmacro def-gdb-display-buffer (name buffer &optional doc) - "Define a function NAME which shows gdb BUFFER. - -DOC is an optional documentation string." - `(defun ,name (&optional thread) - ,(when doc doc) - (interactive) - (gdb-display-buffer - (gdb-get-buffer-create ,buffer thread) t))) - ;; Used to display windows with thread-bound buffers (defmacro def-gdb-preempt-display-buffer (name buffer &optional doc split-horizontal) @@ -1511,8 +1488,7 @@ (defun gdb-display-io-buffer () "Display IO of debugged program in a separate window." (interactive) - (gdb-display-buffer - (gdb-get-buffer-create 'gdb-inferior-io) t)) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io))) (defun gdb-inferior-io--init-proc (proc) ;; Set up inferior I/O. Needs GDB 6.4 onwards. @@ -1540,19 +1516,24 @@ (comint-exec io-buffer "gdb-inferior" nil nil nil) (gdb-inferior-io--init-proc (get-buffer-process io-buffer)))))) -(defconst gdb-frame-parameters - '((height . 14) (width . 80) - (unsplittable . t) - (tool-bar-lines . nil) - (menu-bar-lines . nil) - (minibuffer . nil))) +(defvar gdb-display-buffer-other-frame-action + `((display-buffer-reuse-window display-buffer-pop-up-frame) + (reusable-frames . 0) + (inhibit-same-window . t) + (pop-up-frame-parameters (height . 14) + (width . 80) + (unsplittable . t) + (tool-bar-lines . nil) + (menu-bar-lines . nil) + (minibuffer . nil))) + "A `display-buffer' action for displaying GDB utility frames.") +(put 'gdb-display-buffer-other-frame-action 'risky-local-variable t) (defun gdb-frame-io-buffer () - "Display IO of debugged program in a new frame." + "Display IO of debugged program in another frame." (interactive) - (let ((special-display-regexps (append special-display-regexps '(".*"))) - (special-display-frame-alist gdb-frame-parameters)) - (display-buffer (gdb-get-buffer-create 'gdb-inferior-io)))) + (display-buffer (gdb-get-buffer-create 'gdb-inferior-io) + gdb-display-buffer-other-frame-action)) (defvar gdb-inferior-io-mode-map (let ((map (make-sparse-keymap))) @@ -1571,7 +1552,7 @@ (defun gdb-inferior-filter (proc string) (unless (string-equal string "") - (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io) t)) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io))) (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io) (comint-output-filter proc string))) @@ -2615,15 +2596,16 @@ (defun gdb-breakpoints-buffer-name () (concat "*breakpoints of " (gdb-get-target-string) "*")) -(def-gdb-display-buffer - gdb-display-breakpoints-buffer - 'gdb-breakpoints-buffer - "Display status of user-settable breakpoints.") +(defun gdb-display-breakpoints-buffer (&optional thread) + "Display GDB breakpoints." + (interactive) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-breakpoints-buffer thread))) -(def-gdb-frame-for-buffer - gdb-frame-breakpoints-buffer - 'gdb-breakpoints-buffer - "Display status of user-settable breakpoints in a new frame.") +(defun gdb-frame-breakpoints-buffer (&optional thread) + "Display GDB breakpoints in another frame." + (interactive) + (display-buffer (gdb-get-buffer-create 'gdb-breakpoints-buffer thread) + gdb-display-buffer-other-frame-action)) (defvar gdb-breakpoints-mode-map (let ((map (make-sparse-keymap)) @@ -2684,15 +2666,16 @@ (defun gdb-threads-buffer-name () (concat "*threads of " (gdb-get-target-string) "*")) -(def-gdb-display-buffer - gdb-display-threads-buffer - 'gdb-threads-buffer - "Display GDB threads.") +(defun gdb-display-threads-buffer (&optional thread) + "Display GDB threads." + (interactive) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-threads-buffer thread))) -(def-gdb-frame-for-buffer - gdb-frame-threads-buffer - 'gdb-threads-buffer - "Display GDB threads in a new frame.") +(defun gdb-frame-threads-buffer (&optional thread) + "Display GDB threads in another frame." + (interactive) + (display-buffer (gdb-get-buffer-create 'gdb-threads-buffer thread) + gdb-display-buffer-other-frame-action)) (def-gdb-trigger-and-handler gdb-invalidate-threads (gdb-current-context-command "-thread-info") @@ -2868,26 +2851,22 @@ (def-gdb-thread-buffer-simple-command gdb-frame-stack-for-thread gdb-frame-stack-buffer - "Display a new frame with stack buffer for the thread at -current line.") + "Display another frame with stack buffer for thread at current line.") (def-gdb-thread-buffer-simple-command gdb-frame-locals-for-thread gdb-frame-locals-buffer - "Display a new frame with locals buffer for the thread at -current line.") + "Display another frame with locals buffer for thread at current line.") (def-gdb-thread-buffer-simple-command gdb-frame-registers-for-thread gdb-frame-registers-buffer - "Display a new frame with registers buffer for the thread at -current line.") + "Display another frame with registers buffer for the thread at current line.") (def-gdb-thread-buffer-simple-command gdb-frame-disassembly-for-thread gdb-frame-disassembly-buffer - "Display a new frame with disassembly buffer for the thread at -current line.") + "Display another frame with disassembly buffer for the thread at current line.") (defmacro def-gdb-thread-buffer-gud-command (name gud-command &optional doc) "Define a NAME which will execute GUD-COMMAND with @@ -3290,21 +3269,16 @@ (defun gdb-memory-buffer-name () (concat "*memory of " (gdb-get-target-string) "*")) -(def-gdb-display-buffer - gdb-display-memory-buffer - 'gdb-memory-buffer - "Display memory contents.") +(defun gdb-display-memory-buffer (&optional thread) + "Display GDB memory contents." + (interactive) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-memory-buffer thread))) (defun gdb-frame-memory-buffer () - "Display memory contents in a new frame." + "Display memory contents in another frame." (interactive) - (let* ((special-display-regexps (append special-display-regexps '(".*"))) - (special-display-frame-alist - `((left-fringe . 0) - (right-fringe . 0) - (width . 83) - ,@gdb-frame-parameters))) - (display-buffer (gdb-get-buffer-create 'gdb-memory-buffer)))) + (display-buffer (gdb-get-buffer-create 'gdb-memory-buffer) + gdb-display-buffer-other-frame-action)) ;;; Disassembly view @@ -3313,19 +3287,20 @@ (gdb-current-context-buffer-name (concat "disassembly of " (gdb-get-target-string)))) -(def-gdb-display-buffer - gdb-display-disassembly-buffer - 'gdb-disassembly-buffer - "Display disassembly for current stack frame.") +(defun gdb-display-disassembly-buffer (&optional thread) + "Display GDB disassembly information." + (interactive) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-disassembly-buffer thread))) (def-gdb-preempt-display-buffer gdb-preemptively-display-disassembly-buffer 'gdb-disassembly-buffer) -(def-gdb-frame-for-buffer - gdb-frame-disassembly-buffer - 'gdb-disassembly-buffer - "Display disassembly in a new frame.") +(defun gdb-frame-disassembly-buffer (&optional thread) + "Display GDB disassembly information in another frame." + (interactive) + (display-buffer (gdb-get-buffer-create 'gdb-disassembly-buffer thread) + gdb-display-buffer-other-frame-action)) (def-gdb-auto-update-trigger gdb-invalidate-disassembly (let* ((frame (gdb-current-buffer-frame)) @@ -3560,19 +3535,20 @@ (gdb-current-context-buffer-name (concat "stack frames of " (gdb-get-target-string)))) -(def-gdb-display-buffer - gdb-display-stack-buffer - 'gdb-stack-buffer - "Display backtrace of current stack.") +(defun gdb-display-stack-buffer (&optional thread) + "Display GDB backtrace for current stack." + (interactive) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-stack-buffer thread))) (def-gdb-preempt-display-buffer gdb-preemptively-display-stack-buffer 'gdb-stack-buffer nil t) -(def-gdb-frame-for-buffer - gdb-frame-stack-buffer - 'gdb-stack-buffer - "Display backtrace of current stack in a new frame.") +(defun gdb-frame-stack-buffer (&optional thread) + "Display GDB backtrace for current stack in another frame." + (interactive) + (display-buffer (gdb-get-buffer-create 'gdb-stack-buffer thread) + gdb-display-buffer-other-frame-action)) (defvar gdb-frames-mode-map (let ((map (make-sparse-keymap))) @@ -3719,19 +3695,20 @@ (gdb-current-context-buffer-name (concat "locals of " (gdb-get-target-string)))) -(def-gdb-display-buffer - gdb-display-locals-buffer - 'gdb-locals-buffer - "Display local variables of current stack and their values.") +(defun gdb-display-locals-buffer (&optional thread) + "Display the local variables of current GDB stack." + (interactive) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-locals-buffer thread))) (def-gdb-preempt-display-buffer gdb-preemptively-display-locals-buffer 'gdb-locals-buffer nil t) -(def-gdb-frame-for-buffer - gdb-frame-locals-buffer - 'gdb-locals-buffer - "Display local variables of current stack and their values in a new frame.") +(defun gdb-frame-locals-buffer (&optional thread) + "Display the local variables of the current GDB stack in another frame." + (interactive) + (display-buffer (gdb-get-buffer-create 'gdb-locals-buffer thread) + gdb-display-buffer-other-frame-action)) ;; Registers buffer. @@ -3818,19 +3795,20 @@ (gdb-current-context-buffer-name (concat "registers of " (gdb-get-target-string)))) -(def-gdb-display-buffer - gdb-display-registers-buffer - 'gdb-registers-buffer - "Display integer register contents.") +(defun gdb-display-registers-buffer (&optional thread) + "Display GDB register contents." + (interactive) + (gdb-display-buffer (gdb-get-buffer-create 'gdb-registers-buffer thread))) (def-gdb-preempt-display-buffer gdb-preemptively-display-registers-buffer 'gdb-registers-buffer nil t) -(def-gdb-frame-for-buffer - gdb-frame-registers-buffer - 'gdb-registers-buffer - "Display integer register contents in a new frame.") +(defun gdb-frame-registers-buffer (&optional thread) + "Display GDB register contents in another frame." + (interactive) + (display-buffer (gdb-get-buffer-create 'gdb-registers-buffer thread) + gdb-display-buffer-other-frame-action)) ;; Needs GDB 6.4 onwards (used to fail with no stack). (defun gdb-get-changed-registers () @@ -3917,26 +3895,26 @@ (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name))) ;;;; Window management -(defun gdb-display-buffer (buf dedicated &optional frame) - "Show buffer BUF. - -If BUF is already displayed in some window, show it, deiconifying -the frame if necessary. Otherwise, find least recently used -window and show BUF there, if the window is not used for GDB -already, in which case that window is split first." - (let ((answer (get-buffer-window buf (or frame 0)))) - (if answer - (display-buffer buf nil (or frame 0)) ;Deiconify frame if necessary. - (let ((window (get-lru-window))) - (if (eq (buffer-local-value 'gud-minor-mode (window-buffer window)) - 'gdbmi) - (let ((largest (get-largest-window))) - (setq answer (split-window largest)) - (set-window-buffer answer buf) - (set-window-dedicated-p answer dedicated) - answer) - (set-window-buffer window buf) - window))))) +(defun gdb-display-buffer (buf) + "Show buffer BUF, and make that window dedicated." + (let ((window (display-buffer buf))) + (set-window-dedicated-p window t) + window)) + + ;; (let ((answer (get-buffer-window buf 0))) + ;; (if answer + ;; (display-buffer buf nil 0) ;Deiconify frame if necessary. + ;; (let ((window (get-lru-window))) + ;; (if (eq (buffer-local-value 'gud-minor-mode (window-buffer window)) + ;; 'gdbmi) + ;; (let ((largest (get-largest-window))) + ;; (setq answer (split-window largest)) + ;; (set-window-buffer answer buf) + ;; (set-window-dedicated-p answer t) + ;; answer) + ;; (set-window-buffer window buf) + ;; window))))) + (defun gdb-preempt-existing-or-display-buffer (buf &optional split-horizontal) "Find window displaying a buffer with the same @@ -3963,7 +3941,7 @@ (if dedicated-window (set-window-buffer (split-window dedicated-window nil split-horizontal) buf) - (gdb-display-buffer buf t)))))) + (gdb-display-buffer buf)))))) (error "Null buffer"))) ;;; Shared keymap initialization: @@ -4067,7 +4045,7 @@ 'all-threads) (defun gdb-frame-gdb-buffer () - "Display GUD buffer in a new frame." + "Display GUD buffer in another frame." (interactive) (display-buffer-other-frame gud-comint-buffer)) @@ -4089,13 +4067,12 @@ (defun gdb-setup-windows () "Layout the window pattern for `gdb-many-windows'." - (gdb-display-locals-buffer) - (gdb-display-stack-buffer) - (delete-other-windows) - (gdb-display-breakpoints-buffer) - (delete-other-windows) - ;; Don't dedicate. + (gdb-get-buffer-create 'gdb-locals-buffer) + (gdb-get-buffer-create 'gdb-stack-buffer) + (gdb-get-buffer-create 'gdb-breakpoints-buffer) + (set-window-dedicated-p (selected-window) nil) (switch-to-buffer gud-comint-buffer) + (delete-other-windows) (let ((win0 (selected-window)) (win1 (split-window nil ( / ( * (window-height) 3) 4))) (win2 (split-window nil ( / (window-height) 3))) === modified file 'lisp/progmodes/gud.el' --- lisp/progmodes/gud.el 2012-08-14 18:48:39 +0000 +++ lisp/progmodes/gud.el 2012-08-26 09:16:48 +0000 @@ -2685,7 +2685,6 @@ (declare-function global-hl-line-highlight "hl-line" ()) (declare-function hl-line-highlight "hl-line" ()) (declare-function gdb-display-source-buffer "gdb-mi" (buffer)) -(declare-function gdb-display-buffer "gdb-mi" (buf dedicated &optional size)) ;; Make sure the file named TRUE-FILE is in a buffer that appears on the screen ;; and that its line LINE is visible. @@ -2702,10 +2701,7 @@ (window (and buffer (or (get-buffer-window buffer) (if (eq gud-minor-mode 'gdbmi) - (or (if (get-buffer-window buffer 'visible) - (display-buffer buffer nil 'visible)) - (unless (gdb-display-source-buffer buffer) - (gdb-display-buffer buffer nil 'visible)))) + (display-buffer buffer nil 'visible)) (display-buffer buffer)))) (pos)) (if buffer === modified file 'lisp/window.el' --- lisp/window.el 2012-08-25 14:52:02 +0000 +++ lisp/window.el 2012-08-26 09:16:48 +0000 @@ -4369,12 +4369,11 @@ (function :tag "function")) :group 'windows) +;; Eventually, we want to turn this into a defvar; instead of +;; customizing this, the user should use a `pop-up-frame-parameters' +;; alist entry in `display-buffer-base-action'. (defcustom pop-up-frame-alist nil "Alist of parameters for automatically generated new frames. -You can set this in your init file; for example, - - (setq pop-up-frame-alist '((width . 80) (height . 20))) - If non-nil, the value you specify here is used by the default `pop-up-frame-function' for the creation of new frames. @@ -5108,6 +5107,10 @@ window that already displays the buffer. See `display-buffer-reuse-window'. + `pop-up-frame-parameters' -- Value specifies an alist of frame + parameters to give a new frame, if + one is created. + The ACTION argument to `display-buffer' can also have a non-nil and non-list value. This means to display the buffer in a window other than the selected one, even if it is already displayed in @@ -5250,9 +5253,15 @@ return the window used; otherwise return nil. If ALIST has a non-nil `inhibit-switch-frame' entry, avoid -raising the new frame." - (let ((fun pop-up-frame-function) - frame window) +raising the new frame. + +If ALIST has a non-nil `pop-up-frame-parameters' entry, the +corresponding value is an alist of frame parameters to give the +new frame." + (let* ((params (cdr (assq 'pop-up-frame-parameters alist))) + (pop-up-frame-alist (append params pop-up-frame-alist)) + (fun pop-up-frame-function) + frame window) (when (and fun (setq frame (funcall fun)) (setq window (frame-selected-window frame))) ------------------------------------------------------------ revno: 109781 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-08-26 01:41:36 -0700 message: * character.c, charset.c, chartab.c: Use bool for booleans. * character.c (lisp_string_width, string_count_byte8) (string_escape_byte8): * charset.c (charset_map_loaded, load_charset_map, read_hex): (load_charset_map_from_file, map_charset_chars) (Fdefine_charset_internal, define_charset_internal) (Fdeclare_equiv_charset, find_charsets_in_text) (Ffind_charset_region, char_charset, Fiso_charset): * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range) (sub_char_table_set, sub_char_table_set_range) (char_table_set_range, optimize_sub_char_table) (map_sub_char_table): Use bool for boolean. * character.c (str_to_unibyte): Omit last boolean argument; it was always 0. All callers changed. * character.h, charset.h: Adjust to match previous changes. * character.h (char_printable_p): Remove decl of nonexistent function. * charset.h (struct charset): Members code_linear_p, iso_chars_96, ascii_compatible_p, supplementary_p, compact_codes_p, unified_p are all boolean, so make them single-bit bitfields. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-26 05:21:04 +0000 +++ src/ChangeLog 2012-08-26 08:41:36 +0000 @@ -1,5 +1,26 @@ 2012-08-26 Paul Eggert + * character.c, charset.c, chartab.c: Use bool for booleans. + * character.c (lisp_string_width, string_count_byte8) + (string_escape_byte8): + * charset.c (charset_map_loaded, load_charset_map, read_hex): + (load_charset_map_from_file, map_charset_chars) + (Fdefine_charset_internal, define_charset_internal) + (Fdeclare_equiv_charset, find_charsets_in_text) + (Ffind_charset_region, char_charset, Fiso_charset): + * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range) + (sub_char_table_set, sub_char_table_set_range) + (char_table_set_range, optimize_sub_char_table) + (map_sub_char_table): + Use bool for boolean. + * character.c (str_to_unibyte): Omit last boolean argument; it was + always 0. All callers changed. + * character.h, charset.h: Adjust to match previous changes. + * character.h (char_printable_p): Remove decl of nonexistent function. + * charset.h (struct charset): Members code_linear_p, iso_chars_96, + ascii_compatible_p, supplementary_p, compact_codes_p, unified_p + are all boolean, so make them single-bit bitfields. + * lisp.h (ASET): Remove attempt to detect side effects. It was meant to be temporary and it often doesn't work, because when IDX has side effects the behavior of IDX==IDX === modified file 'src/character.c' --- src/character.c 2012-08-14 17:10:38 +0000 +++ src/character.c 2012-08-26 08:41:36 +0000 @@ -427,7 +427,7 @@ /* This set multibyte to 0 even if STRING is multibyte when it contains only ascii and eight-bit-graphic, but that's intentional. */ - int multibyte = len < SBYTES (string); + bool multibyte = len < SBYTES (string); unsigned char *str = SDATA (string); ptrdiff_t i = 0, i_byte = 0; ptrdiff_t width = 0; @@ -765,13 +765,10 @@ corresponding byte and store in DST. CHARS is the number of characters in SRC. The value is the number of bytes stored in DST. Usually, the value is the same as CHARS, but is less than it if SRC - contains a non-ASCII, non-eight-bit character. If ACCEPT_LATIN_1 - is nonzero, a Latin-1 character is accepted and converted to a byte - of that character code. - Note: Currently the arg ACCEPT_LATIN_1 is not used. */ + contains a non-ASCII, non-eight-bit character. */ ptrdiff_t -str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars, int accept_latin_1) +str_to_unibyte (const unsigned char *src, unsigned char *dst, ptrdiff_t chars) { ptrdiff_t i; @@ -781,8 +778,7 @@ if (CHAR_BYTE8_P (c)) c = CHAR_TO_BYTE8 (c); - else if (! ASCII_CHAR_P (c) - && (! accept_latin_1 || c >= 0x100)) + else if (! ASCII_CHAR_P (c)) return i; *dst++ = c; } @@ -793,7 +789,7 @@ static ptrdiff_t string_count_byte8 (Lisp_Object string) { - int multibyte = STRING_MULTIBYTE (string); + bool multibyte = STRING_MULTIBYTE (string); ptrdiff_t nbytes = SBYTES (string); unsigned char *p = SDATA (string); unsigned char *pend = p + nbytes; @@ -825,7 +821,7 @@ { ptrdiff_t nchars = SCHARS (string); ptrdiff_t nbytes = SBYTES (string); - int multibyte = STRING_MULTIBYTE (string); + bool multibyte = STRING_MULTIBYTE (string); ptrdiff_t byte8_count; const unsigned char *src, *src_end; unsigned char *dst; === modified file 'src/character.h' --- src/character.h 2012-08-02 07:31:34 +0000 +++ src/character.h 2012-08-26 08:41:36 +0000 @@ -676,7 +676,6 @@ const unsigned char **, int *); extern int translate_char (Lisp_Object, int c); -extern int char_printable_p (int c); extern void parse_str_as_multibyte (const unsigned char *, ptrdiff_t, ptrdiff_t *, ptrdiff_t *); extern ptrdiff_t count_size_as_multibyte (const unsigned char *, ptrdiff_t); @@ -685,7 +684,7 @@ extern ptrdiff_t str_to_multibyte (unsigned char *, ptrdiff_t, ptrdiff_t); extern ptrdiff_t str_as_unibyte (unsigned char *, ptrdiff_t); extern ptrdiff_t str_to_unibyte (const unsigned char *, unsigned char *, - ptrdiff_t, int); + ptrdiff_t); extern ptrdiff_t strwidth (const char *, ptrdiff_t); extern ptrdiff_t c_string_width (const unsigned char *, ptrdiff_t, int, ptrdiff_t *, ptrdiff_t *); === modified file 'src/charset.c' --- src/charset.c 2012-08-20 08:07:38 +0000 +++ src/charset.c 2012-08-26 08:41:36 +0000 @@ -215,7 +215,7 @@ /* Set to 1 to warn that a charset map is loaded and thus a buffer text and a string data may be relocated. */ -int charset_map_loaded; +bool charset_map_loaded; struct charset_map_entries { @@ -256,7 +256,7 @@ { Lisp_Object vec IF_LINT (= Qnil), table IF_LINT (= Qnil); unsigned max_code = CHARSET_MAX_CODE (charset); - int ascii_compatible_p = charset->ascii_compatible_p; + bool ascii_compatible_p = charset->ascii_compatible_p; int min_char, max_char, nonascii_min_char; int i; unsigned char *fast_map = charset->fast_map; @@ -423,7 +423,7 @@ paying attention to comment character '#'. */ static inline unsigned -read_hex (FILE *fp, int *eof, int *overflow) +read_hex (FILE *fp, bool *eof, bool *overflow) { int c; unsigned n; @@ -512,7 +512,7 @@ { unsigned from, to, c; int idx; - int eof = 0, overflow = 0; + bool eof = 0, overflow = 0; from = read_hex (fp, &eof, &overflow); if (eof) @@ -717,10 +717,8 @@ Lisp_Object arg, struct charset *charset, unsigned from, unsigned to) { Lisp_Object range; - int partial; - - partial = (from > CHARSET_MIN_CODE (charset) - || to < CHARSET_MAX_CODE (charset)); + bool partial = (from > CHARSET_MIN_CODE (charset) + || to < CHARSET_MAX_CODE (charset)); if (CHARSET_METHOD (charset) == CHARSET_METHOD_OFFSET) { @@ -855,7 +853,7 @@ struct charset charset; int id; int dimension; - int new_definition_p; + bool new_definition_p; int nchars; if (nargs != charset_arg_max) @@ -1250,7 +1248,7 @@ const char *code_space_chars, unsigned min_code, unsigned max_code, int iso_final, int iso_revision, int emacs_mule_id, - int ascii_compatible, int supplementary, + bool ascii_compatible, bool supplementary, int code_offset) { const unsigned char *code_space = (const unsigned char *) code_space_chars; @@ -1448,7 +1446,7 @@ (Lisp_Object dimension, Lisp_Object chars, Lisp_Object final_char, Lisp_Object charset) { int id; - int chars_flag; + bool chars_flag; CHECK_CHARSET_GET_ID (charset, id); check_iso_charset_parameter (dimension, chars, final_char); @@ -1499,7 +1497,9 @@ It may lookup a translation table TABLE if supplied. */ static void -find_charsets_in_text (const unsigned char *ptr, ptrdiff_t nchars, ptrdiff_t nbytes, Lisp_Object charsets, Lisp_Object table, int multibyte) +find_charsets_in_text (const unsigned char *ptr, ptrdiff_t nchars, + ptrdiff_t nbytes, Lisp_Object charsets, + Lisp_Object table, bool multibyte) { const unsigned char *pend = ptr + nbytes; @@ -1549,7 +1549,7 @@ ptrdiff_t from, from_byte, to, stop, stop_byte; int i; Lisp_Object val; - int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); + bool multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); validate_region (&beg, &end); from = XFASTINT (beg); @@ -1735,7 +1735,7 @@ /* Variable used temporarily by the macro ENCODE_CHAR. */ Lisp_Object charset_work; -/* Return a code-point of CHAR in CHARSET. If CHAR doesn't belong to +/* Return a code-point of C in CHARSET. If C doesn't belong to CHARSET, return CHARSET_INVALID_CODE (CHARSET). If STRICT is true, use CHARSET's strict_max_char instead of max_char. */ @@ -1978,7 +1978,7 @@ struct charset * char_charset (int c, Lisp_Object charset_list, unsigned int *code_return) { - int maybe_null = 0; + bool maybe_null = 0; if (NILP (charset_list)) charset_list = Vcharset_ordered_list; @@ -2106,7 +2106,7 @@ (Lisp_Object dimension, Lisp_Object chars, Lisp_Object final_char) { int id; - int chars_flag; + bool chars_flag; check_iso_charset_parameter (dimension, chars, final_char); chars_flag = XFASTINT (chars) == 96; === modified file 'src/charset.h' --- src/charset.h 2012-08-02 07:31:34 +0000 +++ src/charset.h 2012-08-26 08:41:36 +0000 @@ -173,12 +173,24 @@ check if a code-point is in a valid range. */ unsigned char *code_space_mask; - /* 1 if there's no gap in code-points. */ - int code_linear_p; - - /* If the charset is treated as 94-chars in ISO-2022, the value is 0. - If the charset is treated as 96-chars in ISO-2022, the value is 1. */ - int iso_chars_96; + /* True if there's no gap in code-points. */ + unsigned code_linear_p : 1; + + /* True if the charset is treated as 96 chars in ISO-2022 + as opposed to 94 chars. */ + unsigned iso_chars_96 : 1; + + /* True if the charset is compatible with ASCII. */ + unsigned ascii_compatible_p : 1; + + /* True if the charset is supplementary. */ + unsigned supplementary_p : 1; + + /* True if all the code points are representable by Lisp_Int. */ + unsigned compact_codes_p : 1; + + /* True if the charset is unified with Unicode. */ + unsigned unified_p : 1; /* ISO final byte of the charset: 48..127. It may be -1 if the charset doesn't conform to ISO-2022. */ @@ -192,15 +204,6 @@ version. Otherwise, -1. */ int emacs_mule_id; - /* Nonzero if the charset is compatible with ASCII. */ - int ascii_compatible_p; - - /* Nonzero if the charset is supplementary. */ - int supplementary_p; - - /* Nonzero if all the code points are representable by Lisp_Int. */ - int compact_codes_p; - /* The method for encoding/decoding characters of the charset. */ enum charset_method method; @@ -239,8 +242,6 @@ /* Offset value to calculate a character code from code-point, and visa versa. */ int code_offset; - - int unified_p; }; /* Hash table of charset symbols vs. the corresponding attribute @@ -456,7 +457,7 @@ /* Set to 1 when a charset map is loaded to warn that a buffer text and a string data may be relocated. */ -extern int charset_map_loaded; +extern bool charset_map_loaded; /* Set CHARSET to the charset highest priority of C, CODE to the @@ -474,10 +475,10 @@ macro ISO_CHARSET_TABLE (DIMENSION, CHARS, FINAL_CHAR). */ extern int iso_charset_table[ISO_MAX_DIMENSION][ISO_MAX_CHARS][ISO_MAX_FINAL]; -/* A charset of type iso2022 who has DIMENSION, CHARS, and FINAL +/* A charset of type iso2022 who has DIMENSION, CHARS_96, and FINAL (final character). */ #define ISO_CHARSET_TABLE(dimension, chars_96, final) \ - iso_charset_table[(dimension) - 1][(chars_96)][(final)] + iso_charset_table[(dimension) - 1][chars_96][final] /* Nonzero if the charset who has FAST_MAP may contain C. */ #define CHARSET_FAST_MAP_REF(c, fast_map) \ === modified file 'src/chartab.c' --- src/chartab.c 2012-08-18 23:53:43 +0000 +++ src/chartab.c 2012-08-26 08:41:36 +0000 @@ -200,7 +200,7 @@ } static Lisp_Object -sub_char_table_ref (Lisp_Object table, int c, int is_uniprop) +sub_char_table_ref (Lisp_Object table, int c, bool is_uniprop) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); int depth = XINT (tbl->depth); @@ -245,7 +245,7 @@ static Lisp_Object sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to, - Lisp_Object defalt, int is_uniprop) + Lisp_Object defalt, bool is_uniprop) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); int depth = XINT (tbl->depth); @@ -320,7 +320,7 @@ struct Lisp_Char_Table *tbl = XCHAR_TABLE (table); int chartab_idx = CHARTAB_IDX (c, 0, 0), idx; Lisp_Object val; - int is_uniprop = UNIPROP_TABLE_P (table); + bool is_uniprop = UNIPROP_TABLE_P (table); val = tbl->contents[chartab_idx]; if (*from < 0) @@ -382,7 +382,7 @@ static void -sub_char_table_set (Lisp_Object table, int c, Lisp_Object val, int is_uniprop) +sub_char_table_set (Lisp_Object table, int c, Lisp_Object val, bool is_uniprop) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); int depth = XINT ((tbl)->depth); @@ -438,7 +438,7 @@ static void sub_char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val, - int is_uniprop) + bool is_uniprop) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); int depth = XINT ((tbl)->depth); @@ -484,7 +484,7 @@ char_table_set (table, from, val); else { - int is_uniprop = UNIPROP_TABLE_P (table); + bool is_uniprop = UNIPROP_TABLE_P (table); int lim = CHARTAB_IDX (to, 0, 0); int i, c; @@ -683,7 +683,8 @@ struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); int depth = XINT (tbl->depth); Lisp_Object elt, this; - int i, optimizable; + int i; + bool optimizable; elt = XSUB_CHAR_TABLE (table)->contents[0]; if (SUB_CHAR_TABLE_P (elt)) @@ -762,7 +763,7 @@ int chars_in_block; int from = XINT (XCAR (range)), to = XINT (XCDR (range)); int i, c; - int is_uniprop = UNIPROP_TABLE_P (top); + bool is_uniprop = UNIPROP_TABLE_P (top); uniprop_decoder_t decoder = UNIPROP_GET_DECODER (top); if (SUB_CHAR_TABLE_P (table)) @@ -811,7 +812,7 @@ this = XCHAR_TABLE (top)->defalt; if (!EQ (val, this)) { - int different_value = 1; + bool different_value = 1; if (NILP (val)) { ------------------------------------------------------------ revno: 109780 committer: Paul Eggert branch nick: trunk timestamp: Sat 2012-08-25 22:21:04 -0700 message: * lisp.h (ASET): Remove attempt to detect side effects. It was meant to be temporary and it often doesn't work, because when IDX has side effects the behavior of IDX==IDX is undefined. See Stefan Monnier in . diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-08-26 03:30:56 +0000 +++ src/ChangeLog 2012-08-26 05:21:04 +0000 @@ -1,3 +1,11 @@ +2012-08-26 Paul Eggert + + * lisp.h (ASET): Remove attempt to detect side effects. + It was meant to be temporary and it often doesn't work, + because when IDX has side effects the behavior of IDX==IDX + is undefined. See Stefan Monnier in + . + 2012-08-26 Barry OReilly (tiny change) * lisp.h (functionp): New function (extracted from Ffunctionp). === modified file 'src/lisp.h' --- src/lisp.h 2012-08-26 03:30:56 +0000 +++ src/lisp.h 2012-08-26 05:21:04 +0000 @@ -606,10 +606,8 @@ #define AREF(ARRAY, IDX) XVECTOR ((ARRAY))->contents[IDX] #define ASIZE(ARRAY) XVECTOR ((ARRAY))->header.size -/* The IDX==IDX tries to detect when the macro argument is side-effecting. */ #define ASET(ARRAY, IDX, VAL) \ - (eassert ((IDX) == (IDX)), \ - eassert ((IDX) >= 0 && (IDX) < ASIZE (ARRAY)), \ + (eassert (0 <= (IDX) && (IDX) < ASIZE (ARRAY)), \ XVECTOR (ARRAY)->contents[IDX] = (VAL)) /* Convenience macros for dealing with Lisp strings. */