Now on revision 108798. ------------------------------------------------------------ revno: 108798 [merge] committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-06-28 23:28:37 -0700 message: Merge from emacs-24; up to r108062 diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2012-06-27 03:24:29 +0000 +++ doc/emacs/ChangeLog 2012-06-29 06:28:37 +0000 @@ -1,3 +1,11 @@ +2012-06-29 Glenn Morris + + * fixit.texi (Undo): Grammar fixes. (Bug#11779) + +2012-06-29 Michael Witten (tiny change) + + * fixit.texi (Undo): Fix typo. (Bug#11775) + 2012-06-27 Glenn Morris * ack.texi (Acknowledgments): Tiny update. === modified file 'doc/emacs/fixit.texi' --- doc/emacs/fixit.texi 2012-05-27 01:25:06 +0000 +++ doc/emacs/fixit.texi 2012-06-29 06:28:37 +0000 @@ -35,7 +35,7 @@ The @dfn{undo} command reverses recent changes in the buffer's text. Each buffer records changes individually, and the undo command always applies to the current buffer. You can undo all the changes in a -buffer for as far as back its records go. Usually, each editing +buffer for as far back as the buffer's records go. Usually, each editing command makes a separate entry in the undo records, but some commands such as @code{query-replace} divide their changes into multiple entries for flexibility in undoing. Consecutive character insertion @@ -109,9 +109,9 @@ @vindex undo-strong-limit @vindex undo-outer-limit @cindex undo limit - When the undo records for a buffer becomes too large, Emacs discards -the oldest undo records from time to time (during @dfn{garbage -collection}). You can specify how much undo records to keep by + When the undo information for a buffer becomes too large, Emacs discards +the oldest records from time to time (during @dfn{garbage +collection}). You can specify how much undo information to keep by setting the variables @code{undo-limit}, @code{undo-strong-limit}, and @code{undo-outer-limit}. Their values are expressed in bytes. === modified file 'etc/PROBLEMS' --- etc/PROBLEMS 2012-06-04 17:17:48 +0000 +++ etc/PROBLEMS 2012-06-29 06:28:37 +0000 @@ -255,6 +255,36 @@ If you need Emacs to be able to recover from closing displays, compile it with the Lucid toolkit instead of GTK. +** Emacs crashes when you try to view a file with complex characters. +For example, the etc/HELLO file (as shown by C-h h). +The message "symbol lookup error: /usr/bin/emacs: undefined symbol: OTF_open" +is shown in the terminal from which you launched Emacs. +This problem only happens when you use a graphical display (ie not +with -nw) and compiled Emacs with the "libotf" library for complex +text handling. + +This problem occurs because unfortunately there are two libraries +called "libotf". One is the library for handling OpenType fonts, +http://www.m17n.org/libotf/, which is the one that Emacs expects. +The other is a library for Open Trace Format, and is used by some +versions of the MPI message passing interface for parallel +programming. + +For example, on RHEL6 GNU/Linux, the OpenMPI rpm provides a version +of "libotf.so" in /usr/lib/openmpi/lib. This directory is not +normally in the ld search path, but if you want to use OpenMPI, +you must issue the command "module load openmpi". This adds +/usr/lib/openmpi/lib to LD_LIBRARY_PATH. If you then start Emacs from +the same shell, you will encounter this crash. +Ref: + +There is no good solution to this problem if you need to use both +OpenMPI and Emacs with libotf support. The best you can do is use a +wrapper shell script (or function) "emacs" that removes the offending +element from LD_LIBRARY_PATH before starting emacs proper. +Or you could recompile Emacs with an -Wl,-rpath option that +gives the location of the correct libotf. + * General runtime problems ** Lisp problems === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-28 23:04:27 +0000 +++ lisp/ChangeLog 2012-06-29 06:28:37 +0000 @@ -1,3 +1,32 @@ +2012-06-29 Andreas Schwab + + * calendar/cal-dst.el (calendar-current-time-zone): + Return calendar-current-time-zone-cache if non-nil. + +2012-06-29 Masatake YAMATO + + * progmodes/which-func.el (which-func-format): + Add mouse-face. (Bug#11698) + +2012-06-29 Leo Liu + + * textmodes/enriched.el (enriched-next-annotation): Use eq (Bug#11528). + +2012-06-29 Stefan Monnier + + * minibuffer.el (minibuffer-confirm-exit-commands): + Add completion-at-point (bug#11725). + +2012-06-29 Glenn Morris + + * progmodes/f90.el (f90-font-lock-keywords-2): + Add some preprocessor elements. (Bug#10499) + +2012-06-29 Stefan Monnier + + * progmodes/cperl-mode.el (cperl-update-syntaxification): + Use syntax-propertize (bug#11739). + 2012-06-28 Juanma Barranquero * emacs-lisp/cl-lib.el (cl-pushnew): Don't capture X (bug#11811). === modified file 'lisp/calendar/cal-dst.el' --- lisp/calendar/cal-dst.el 2012-01-19 07:21:25 +0000 +++ lisp/calendar/cal-dst.el 2012-06-28 12:13:38 +0000 @@ -347,8 +347,8 @@ Some operating systems cannot provide all this information to Emacs; in this case, `calendar-current-time-zone' returns a list containing nil for the data it can't find." - (unless calendar-current-time-zone-cache - (setq calendar-current-time-zone-cache (calendar-dst-find-data)))) + (or calendar-current-time-zone-cache + (setq calendar-current-time-zone-cache (calendar-dst-find-data)))) ;; Following options should be set based on conditions when the code === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2012-06-23 03:48:18 +0000 +++ lisp/minibuffer.el 2012-06-29 06:28:37 +0000 @@ -1136,7 +1136,8 @@ (completion--cache-all-sorted-completions (cdr all))))))) (defvar minibuffer-confirm-exit-commands - '(minibuffer-complete minibuffer-complete-word PC-complete PC-complete-word) + '(completion-at-point minibuffer-complete + minibuffer-complete-word PC-complete PC-complete-word) "A list of commands which cause an immediately following `minibuffer-complete-and-exit' to ask for extra confirmation.") === modified file 'lisp/progmodes/cperl-mode.el' --- lisp/progmodes/cperl-mode.el 2012-06-26 16:23:01 +0000 +++ lisp/progmodes/cperl-mode.el 2012-06-29 06:28:37 +0000 @@ -8950,14 +8950,15 @@ (setq cperl-syntax-done-to (min cperl-syntax-done-to beg)))) (defun cperl-update-syntaxification (from to) - (if (and cperl-use-syntax-table-text-property - cperl-syntaxify-by-font-lock - (or (null cperl-syntax-done-to) - (< cperl-syntax-done-to to))) - (progn - (save-excursion - (goto-char from) - (cperl-fontify-syntaxically to))))) + (cond + ((not cperl-use-syntax-table-text-property) nil) + ((fboundp 'syntax-propertize) (syntax-propertize to)) + ((and cperl-syntaxify-by-font-lock + (or (null cperl-syntax-done-to) + (< cperl-syntax-done-to to))) + (save-excursion + (goto-char from) + (cperl-fontify-syntaxically to))))) (defvar cperl-version (let ((v "Revision: 6.2")) === modified file 'lisp/progmodes/f90.el' --- lisp/progmodes/f90.el 2012-05-05 02:50:20 +0000 +++ lisp/progmodes/f90.el 2012-06-29 06:28:37 +0000 @@ -233,6 +233,7 @@ :safe 'stringp :group 'f90-indent) +;; Should we add ^# to this? That's not really a comment. (defcustom f90-directive-comment-re "!hpf\\$" "Regexp of comment-like directive like \"!HPF\\\\$\", not to be indented." :type 'regexp @@ -627,7 +628,14 @@ '("\\<\\(do\\|go[ \t]*to\\)\\>[ \t]*\\([0-9]+\\)" (1 font-lock-keyword-face) (2 font-lock-constant-face)) ;; Line numbers (lines whose first character after number is letter). - '("^[ \t]*\\([0-9]+\\)[ \t]*[a-z]+" (1 font-lock-constant-face t)))) + '("^[ \t]*\\([0-9]+\\)[ \t]*[a-z]+" (1 font-lock-constant-face t)) + ;; Override eg for "#include". + '("^#[ \t]*\\w+" (0 font-lock-preprocessor-face t) + ("\\" nil nil (0 font-lock-preprocessor-face))) + '("^#" ("\\(&&\\|||\\)" nil nil (0 font-lock-constant-face t))) + '("^#[ \t]*define[ \t]+\\(\\w+\\)(" (1 font-lock-function-name-face)) + '("^#[ \t]*define[ \t]+\\(\\w+\\)" (1 font-lock-variable-name-face)) + '("^#[ \t]*include[ \t]+\\(<.+>\\)" (1 font-lock-string-face)))) "Highlights declarations, do-loops and other constructs.") (defvar f90-font-lock-keywords-3 === modified file 'lisp/progmodes/which-func.el' --- lisp/progmodes/which-func.el 2012-06-03 11:10:44 +0000 +++ lisp/progmodes/which-func.el 2012-06-29 06:28:37 +0000 @@ -144,12 +144,13 @@ (:propertize which-func-current local-map ,which-func-keymap face which-func - ;;mouse-face highlight ; currently not evaluated :-( + mouse-face mode-line-highlight help-echo "mouse-1: go to beginning\n\ mouse-2: toggle rest visibility\n\ mouse-3: go to end") "]") "Format for displaying the function in the mode line." + :version "24.2" ; added mouse-face :group 'which-func :type 'sexp) ;;;###autoload (put 'which-func-format 'risky-local-variable t) === modified file 'lisp/textmodes/enriched.el' --- lisp/textmodes/enriched.el 2012-02-08 02:12:24 +0000 +++ lisp/textmodes/enriched.el 2012-06-23 13:33:44 +0000 @@ -437,7 +437,7 @@ (progn (goto-char (match-beginning 0)) (not (looking-at enriched-annotation-regexp)))) (forward-char 1) - (if (= ?< (char-after (point))) + (if (eq ?< (char-after (point))) (delete-char 1) ;; A single < that does not start an annotation is an error, ;; which we note and then ignore. === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-29 02:19:32 +0000 +++ src/ChangeLog 2012-06-29 06:28:37 +0000 @@ -1,3 +1,12 @@ +2012-06-29 Andreas Schwab + + * gnutls.c (emacs_gnutls_handshake): + Add QUIT to make the loop interruptible. + +2012-06-29 Glenn Morris + + * charset.c (init_charset): Make lack of etc/charsets fatal. + 2012-06-29 Dmitry Antipov * editfns.c (region_limit): Fix type mismatch. === modified file 'src/charset.c' --- src/charset.c 2012-05-31 06:06:42 +0000 +++ src/charset.c 2012-06-29 06:28:37 +0000 @@ -2296,11 +2296,15 @@ tempdir = Fexpand_file_name (build_string ("charsets"), Vdata_directory); if (access (SSDATA (tempdir), 0) < 0) { - dir_warning ("Error: charsets directory (%s) does not exist.\n\ + /* This used to be non-fatal (dir_warning), but it should not + happen, and if it does sooner or later it will cause some + obscure problem (eg bug#6401), so better abort. */ + fprintf (stderr, "Error: charsets directory not found:\n\ +%s\n\ Emacs will not function correctly without the character map files.\n\ Please check your installation!\n", - tempdir); - /* TODO should this be a fatal error? (Bug#909) */ + SDATA (tempdir)); + exit (1); } Vcharset_map_path = Fcons (tempdir, Qnil); === modified file 'src/gnutls.c' --- src/gnutls.c 2012-05-25 18:19:24 +0000 +++ src/gnutls.c 2012-06-29 06:28:37 +0000 @@ -322,6 +322,7 @@ { ret = fn_gnutls_handshake (state); emacs_gnutls_handle_error (state, ret); + QUIT; } while (ret < 0 && fn_gnutls_error_is_fatal (ret) == 0); ------------------------------------------------------------ revno: 108797 committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2012-06-29 04:15:43 +0000 message: lisp/gnus/tests/: Remove diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-06-27 14:40:22 +0000 +++ lisp/gnus/ChangeLog 2012-06-29 04:15:43 +0000 @@ -1,3 +1,7 @@ +2012-06-29 Katsumi Yamaoka + + * tests/gnustest-nntp.el, tests/gnustest-registry.el, tests/: Remove. + 2012-06-27 Stefan Monnier * shr.el (shr-render-buffer): New command. === removed directory 'lisp/gnus/tests' === removed file 'lisp/gnus/tests/gnustest-nntp.el' --- lisp/gnus/tests/gnustest-nntp.el 2012-06-27 00:47:19 +0000 +++ lisp/gnus/tests/gnustest-nntp.el 1970-01-01 00:00:00 +0000 @@ -1,99 +0,0 @@ -;;; gnustest-nntp.el --- Simple NNTP testing for Gnus -;; Copyright (C) 2011-2012 Free Software Foundation, Inc. - -;; Author: David Engster - -;; This file is not part of GNU Emacs. - -;; GNU Emacs is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. - -;;; Commentary: - -;; This test will -;; -;; - Fire up Gnus -;; - Connect to Gmane -;; - Subscribe to gmane.discuss -;; - Get its active info -;; - Get one specific article by message-id and check its subject -;; - Quit Gnus - -;;; Code: - -(require 'ert) -(require 'net-utils) - -(defvar gnustest-nntp-server "news.gmane.org" - "NNTP server used for testing.") - -(defun gnustest-ping-host (host) - "Ping HOST once and return non-nil if successful." - (let* ((ping-program-options '("-c" "1")) - (buf (ping host)) - proc) - (sleep-for 0.5) - (with-current-buffer buf - (accept-process-output (get-buffer-process (current-buffer)) 2) - (goto-char (point-min)) - (prog1 - (re-search-forward ",[ ]*1.*?received,[ ]*0" nil t) - (when (setq proc (get-buffer-process (current-buffer))) - (set-process-query-on-exit-flag proc nil)) - (kill-buffer))))) - -(setq gnus-home-directory (concat temporary-file-directory (make-temp-name "gnus-test-"))) -(message "***** Using %s as temporary Gnus home." gnus-home-directory) -(mkdir gnus-home-directory) -(setq-default gnus-init-file nil) - -(require 'gnus-load) - -(setq gnus-select-method `(nntp ,gnustest-nntp-server)) - - -(if (null (gnustest-ping-host gnustest-nntp-server)) - (message "***** Skipping tests: Gmane doesn't seem to be available.") - ;; Server seems to be available, so start Gnus. - (message "***** Firing up Gnus; connecting to Gmane.") - (gnus) - - (ert-deftest gnustest-nntp-run-simple-test () - "Test Gnus with gmane.discuss." - (set-buffer gnus-group-buffer) - (gnus-group-jump-to-group "gmane.discuss") - (gnus-group-get-new-news-this-group 1) - (gnus-active "gmane.discuss") - (message "***** Reading active from gmane.discuss.") - (should (> (car (gnus-active "gmane.discuss")) 0)) - (should (> (cdr (gnus-active "gmane.discuss")) 10000)) - (gnus-group-unsubscribe-current-group) - (gnus-group-set-current-level 1 1) - (gnus-group-select-group 5) - (message "***** Getting article with certain MID and check subject.") - (set-buffer gnus-summary-buffer) - (gnus-summary-refer-article "m3mxr8pa1t.fsf@quimbies.gnus.org") - (should (string= (gnus-summary-article-subject) "Re: gwene idea: strip from from subject if present")) - (gnus-summary-exit) - (message "***** Quitting Gnus.") - (set-buffer gnus-group-buffer) - (gnus-group-save-newsrc) - (gnus-group-exit)) -) - -;; Local Variables: -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: === removed file 'lisp/gnus/tests/gnustest-registry.el' --- lisp/gnus/tests/gnustest-registry.el 2012-06-27 00:47:19 +0000 +++ lisp/gnus/tests/gnustest-registry.el 1970-01-01 00:00:00 +0000 @@ -1,221 +0,0 @@ -;;; gnustest-registry.el --- Registry and Gnus registry testing for Gnus -;; Copyright (C) 2011-2012 Free Software Foundation, Inc. - -;; Author: Ted Zlatanov - -;; This file is not part of GNU Emacs. - -;; GNU Emacs is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. - -;;; Commentary: - -;;; Code: - -(eval-when-compile - (when (null (ignore-errors (require 'ert))) - (defmacro* ert-deftest (name () &body docstring-keys-and-body)))) - -(ignore-errors - (require 'ert)) - -(require 'registry) -(require 'gnus-registry) - -(ert-deftest gnustest-registry-instantiation-test () - (should (registry-db "Testing"))) - -(ert-deftest gnustest-registry-match-test () - (let ((entry '((hello "goodbye" "bye") (blank)))) - - (message "Testing :regex matching") - (should (registry--match :regex entry '((hello "nye" "bye")))) - (should (registry--match :regex entry '((hello "good")))) - (should-not (registry--match :regex entry '((hello "nye")))) - (should-not (registry--match :regex entry '((hello)))) - - (message "Testing :member matching") - (should (registry--match :member entry '((hello "bye")))) - (should (registry--match :member entry '((hello "goodbye")))) - (should-not (registry--match :member entry '((hello "good")))) - (should-not (registry--match :member entry '((hello "nye")))) - (should-not (registry--match :member entry '((hello))))) - (message "Done with matching testing.")) - -(defun gnustest-registry-make-testable-db (n &optional name file) - (let* ((db (registry-db - (or name "Testing") - :file (or file "unused") - :max-hard n - :max-soft 0 ; keep nothing not precious - :precious '(extra more-extra) - :tracked '(sender subject groups)))) - (dotimes (i n) - (registry-insert db i `((sender "me") - (subject "about you") - (more-extra) ; empty data key should be pruned - ;; first 5 entries will NOT have this extra data - ,@(when (< 5 i) (list (list 'extra "more data"))) - (groups ,(number-to-string i))))) - db)) - -(ert-deftest gnustest-registry-usage-test () - (let* ((n 100) - (db (gnustest-registry-make-testable-db n))) - (message "size %d" n) - (should (= n (registry-size db))) - (message "max-hard test") - (should-error (registry-insert db "new" '())) - (message "Individual lookup") - (should (= 58 (caadr (registry-lookup db '(1 58 99))))) - (message "Grouped individual lookup") - (should (= 3 (length (registry-lookup db '(1 58 99))))) - (when (boundp 'lexical-binding) - (message "Individual lookup (breaks before lexbind)") - (should (= 58 - (caadr (registry-lookup-breaks-before-lexbind db '(1 58 99))))) - (message "Grouped individual lookup (breaks before lexbind)") - (should (= 3 - (length (registry-lookup-breaks-before-lexbind db - '(1 58 99)))))) - (message "Search") - (should (= n (length (registry-search db :all t)))) - (should (= n (length (registry-search db :member '((sender "me")))))) - (message "Secondary index search") - (should (= n (length (registry-lookup-secondary-value db 'sender "me")))) - (should (equal '(74) (registry-lookup-secondary-value db 'groups "74"))) - (message "Delete") - (should (registry-delete db '(1) t)) - (decf n) - (message "Search after delete") - (should (= n (length (registry-search db :all t)))) - (message "Secondary search after delete") - (should (= n (length (registry-lookup-secondary-value db 'sender "me")))) - ;; (message "Pruning") - ;; (let* ((tokeep (registry-search db :member '((extra "more data")))) - ;; (count (- n (length tokeep))) - ;; (pruned (registry-prune db)) - ;; (prune-count (length pruned))) - ;; (message "Expecting to prune %d entries and pruned %d" - ;; count prune-count) - ;; (should (and (= count 5) - ;; (= count prune-count)))) - (message "Done with usage testing."))) - -(ert-deftest gnustest-registry-persistence-test () - (let* ((n 100) - (tempfile (make-temp-file "registry-persistence-")) - (name "persistence tester") - (db (gnustest-registry-make-testable-db n name tempfile)) - size back) - (message "Saving to %s" tempfile) - (eieio-persistent-save db) - (setq size (nth 7 (file-attributes tempfile))) - (message "Saved to %s: size %d" tempfile size) - (should (< 0 size)) - (with-temp-buffer - (insert-file-contents-literally tempfile) - (should (looking-at (concat ";; Object " - name - "\n;; EIEIO PERSISTENT OBJECT")))) - (message "Reading object back") - (setq back (eieio-persistent-read tempfile)) - (should back) - (message "Read object back: %d keys, expected %d==%d" - (registry-size back) n (registry-size db)) - (should (= (registry-size back) n)) - (should (= (registry-size back) (registry-size db))) - (delete-file tempfile)) - (message "Done with persistence testing.")) - -(ert-deftest gnustest-gnus-registry-misc-test () - (should-error (gnus-registry-extract-addresses '("" ""))) - - (should (equal '("Ted Zlatanov " - "noname " - "noname " - "noname ") - (gnus-registry-extract-addresses - (concat "Ted Zlatanov , " - "ed , " ; "ed" is not a valid name here - "cyd@stupidchicken.com, " - "tzz@lifelogs.com"))))) - -(ert-deftest gnustest-gnus-registry-usage-test () - (let* ((n 100) - (tempfile (make-temp-file "gnus-registry-persist")) - (db (gnus-registry-make-db tempfile)) - (gnus-registry-db db) - back size) - (message "Adding %d keys to the test Gnus registry" n) - (dotimes (i n) - (let ((id (number-to-string i))) - (gnus-registry-handle-action id - (if (>= 50 i) "fromgroup" nil) - "togroup" - (when (>= 70 i) - (format "subject %d" (mod i 10))) - (when (>= 80 i) - (format "sender %d" (mod i 10)))))) - (message "Testing Gnus registry size is %d" n) - (should (= n (registry-size db))) - (message "Looking up individual keys (registry-lookup)") - (should (equal (loop for e - in (mapcar 'cadr - (registry-lookup db '("20" "83" "72"))) - collect (assq 'subject e) - collect (assq 'sender e) - collect (assq 'group e)) - '((subject "subject 0") (sender "sender 0") (group "togroup") - (subject) (sender) (group "togroup") - (subject) (sender "sender 2") (group "togroup")))) - - (message "Looking up individual keys (gnus-registry-id-key)") - (should (equal (gnus-registry-get-id-key "34" 'group) '("togroup"))) - (should (equal (gnus-registry-get-id-key "34" 'subject) '("subject 4"))) - (message "Trying to insert a duplicate key") - (should-error (gnus-registry-insert db "55" '())) - (message "Looking up individual keys (gnus-registry-get-or-make-entry)") - (should (gnus-registry-get-or-make-entry "22")) - (message "Saving the Gnus registry to %s" tempfile) - (should (gnus-registry-save tempfile db)) - (setq size (nth 7 (file-attributes tempfile))) - (message "Saving the Gnus registry to %s: size %d" tempfile size) - (should (< 0 size)) - (with-temp-buffer - (insert-file-contents-literally tempfile) - (should (looking-at (concat ";; Object " - "Gnus Registry" - "\n;; EIEIO PERSISTENT OBJECT")))) - (message "Reading Gnus registry back") - (setq back (eieio-persistent-read tempfile)) - (should back) - (message "Read Gnus registry back: %d keys, expected %d==%d" - (registry-size back) n (registry-size db)) - (should (= (registry-size back) n)) - (should (= (registry-size back) (registry-size db))) - (delete-file tempfile) - (message "Pruning Gnus registry to 0 by setting :max-soft") - (oset db :max-soft 0) - (registry-prune db) - (should (= (registry-size db) 0))) - (message "Done with Gnus registry usage testing.")) - -(provide 'gnustest-registry) - -;; Local Variables: -;; no-byte-compile: t -;; no-update-autoloads: t -;; End: ------------------------------------------------------------ revno: 108796 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2012-06-29 06:19:32 +0400 message: * editfns.c (region_limit): Fix type mismatch. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-29 01:35:32 +0000 +++ src/ChangeLog 2012-06-29 02:19:32 +0000 @@ -1,5 +1,9 @@ 2012-06-29 Dmitry Antipov + * editfns.c (region_limit): Fix type mismatch. + +2012-06-29 Dmitry Antipov + * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be undefined. Convert from xassert to eassert. * nsmenu.m: Convert from xassert to eassert. === modified file 'src/editfns.c' --- src/editfns.c 2012-06-28 19:09:41 +0000 +++ src/editfns.c 2012-06-29 02:19:32 +0000 @@ -287,7 +287,7 @@ else { /* Clip to the current narrowing (bug#11770). */ ptrdiff_t mark = XFASTINT (m); - return make_number (mark < BEGV ? BEGV : mark > ZV ? ZV : m); + return make_number (mark < BEGV ? BEGV : mark > ZV ? ZV : mark); } } ------------------------------------------------------------ revno: 108795 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2012-06-29 05:35:32 +0400 message: * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be undefined. Convert from xassert to eassert. * nsmenu.m: Convert from xassert to eassert. * nsterm.m: Likewise. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-28 19:09:41 +0000 +++ src/ChangeLog 2012-06-29 01:35:32 +0000 @@ -1,3 +1,10 @@ +2012-06-29 Dmitry Antipov + + * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be + undefined. Convert from xassert to eassert. + * nsmenu.m: Convert from xassert to eassert. + * nsterm.m: Likewise. + 2012-06-28 Stefan Monnier * editfns.c (region_limit): Clip to narrowing (bug#11770). === modified file 'src/nsfns.m' --- src/nsfns.m 2012-06-16 12:24:15 +0000 +++ src/nsfns.m 2012-06-29 01:35:32 +0000 @@ -101,7 +101,7 @@ static Lisp_Object as_script, *as_result; static int as_status; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG static ptrdiff_t image_cache_refcount; #endif @@ -1058,16 +1058,16 @@ /* If frame is ``official'', nothing to do. */ if (NILP (Fmemq (frame, Vframe_list))) { -#if GLYPH_DEBUG && XASSERTS +#if defined GLYPH_DEBUG && defined ENABLE_CHECKING struct ns_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); #endif x_free_frame_resources (f); free_glyphs (f); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG /* Check that reference counts are indeed correct. */ - xassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount); + eassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount); #endif return Qt; } @@ -1294,7 +1294,7 @@ x_default_parameter (f, parms, Qright_fringe, Qnil, "rightFringe", "RightFringe", RES_TYPE_NUMBER); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG image_cache_refcount = FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; #endif === modified file 'src/nsmenu.m' --- src/nsmenu.m 2012-06-16 12:24:15 +0000 +++ src/nsmenu.m 2012-06-29 01:35:32 +0000 @@ -1057,7 +1057,7 @@ { /* NS toolbar auto-computes disabled and selected images */ idx = TOOL_BAR_IMAGE_ENABLED_SELECTED; - xassert (ASIZE (image) >= idx); + eassert (ASIZE (image) >= idx); image = AREF (image, idx); } else === modified file 'src/nsterm.m' --- src/nsterm.m 2012-06-22 21:17:42 +0000 +++ src/nsterm.m 2012-06-29 01:35:32 +0000 @@ -2108,7 +2108,7 @@ NSTRACE (ns_after_update_window_line); /* begin copy from other terms */ - xassert (w); + eassert (w); if (!desired_row->mode_line_p && !w->pseudo_window_p) desired_row->redraw_fringe_bitmaps_p = 1; ------------------------------------------------------------ revno: 108794 fixes bug(s): http://debbugs.gnu.org/11811 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2012-06-29 01:04:27 +0200 message: lisp/emacs-lisp/cl-lib.el (cl-pushnew): Don't capture X (bug#11811). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-28 10:40:24 +0000 +++ lisp/ChangeLog 2012-06-28 23:04:27 +0000 @@ -1,3 +1,7 @@ +2012-06-28 Juanma Barranquero + + * emacs-lisp/cl-lib.el (cl-pushnew): Don't capture X (bug#11811). + 2012-06-28 Julien Danjou * term.el (term-handle-colors-array): Use a set of new faces to === modified file 'lisp/emacs-lisp/cl-lib.el' --- lisp/emacs-lisp/cl-lib.el 2012-06-22 21:24:54 +0000 +++ lisp/emacs-lisp/cl-lib.el 2012-06-28 23:04:27 +0000 @@ -151,15 +151,16 @@ [keywordp form]))) (if (symbolp place) (if (null keys) - `(let ((x ,x)) - (if (memql x ,place) - ;; This symbol may later on expand to actual code which then - ;; trigger warnings like "value unused" since cl-pushnew's return - ;; value is rarely used. It should not matter that other - ;; warnings may be silenced, since `place' is used earlier and - ;; should have triggered them already. - (with-no-warnings ,place) - (setq ,place (cons x ,place)))) + (let ((var (make-symbol "--cl-x--"))) + `(let ((,var ,x)) + (if (memql ,var ,place) + ;; This symbol may later on expand to actual code which then + ;; trigger warnings like "value unused" since cl-pushnew's return + ;; value is rarely used. It should not matter that other + ;; warnings may be silenced, since `place' is used earlier and + ;; should have triggered them already. + (with-no-warnings ,place) + (setq ,place (cons ,var ,place))))) (list 'setq place (cl-list* 'cl-adjoin x place keys))) (cl-list* 'cl-callf2 'cl-adjoin x place keys))) ------------------------------------------------------------ revno: 108793 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11770 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2012-06-28 15:09:41 -0400 message: * src/editfns.c (region_limit): Clip to narrowing. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-28 15:50:11 +0000 +++ src/ChangeLog 2012-06-28 19:09:41 +0000 @@ -1,3 +1,7 @@ +2012-06-28 Stefan Monnier + + * editfns.c (region_limit): Clip to narrowing (bug#11770). + 2012-06-28 Paul Eggert Avoid integer overflow on scroll-left and scroll-right. === modified file 'src/alloc.c' --- src/alloc.c 2012-06-28 07:50:27 +0000 +++ src/alloc.c 2012-06-28 19:09:41 +0000 @@ -5384,7 +5384,8 @@ turned off in that buffer. Calling truncate_undo_list on Qt tends to return NULL, which effectively turns undo back on. So don't call truncate_undo_list if undo_list is Qt. */ - if (! NILP (nextb->BUFFER_INTERNAL_FIELD (name)) && ! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt)) + if (! NILP (nextb->BUFFER_INTERNAL_FIELD (name)) + && ! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt)) truncate_undo_list (nextb); /* Shrink buffer gaps, but skip indirect and dead buffers. */ === modified file 'src/editfns.c' --- src/editfns.c 2012-06-22 21:17:42 +0000 +++ src/editfns.c 2012-06-28 19:09:41 +0000 @@ -283,8 +283,12 @@ error ("The mark is not set now, so there is no region"); if ((PT < XFASTINT (m)) == (beginningp != 0)) - m = make_number (PT); - return m; + return make_number (PT); + else + { /* Clip to the current narrowing (bug#11770). */ + ptrdiff_t mark = XFASTINT (m); + return make_number (mark < BEGV ? BEGV : mark > ZV ? ZV : m); + } } DEFUN ("region-beginning", Fregion_beginning, Sregion_beginning, 0, 0, 0, === modified file 'src/keyboard.c' --- src/keyboard.c 2012-06-28 07:50:27 +0000 +++ src/keyboard.c 2012-06-28 19:09:41 +0000 @@ -3854,7 +3854,7 @@ EMACS_TIME duration; EMACS_GET_TIME (duration); if (EMACS_TIME_GE (duration, *end_time)) - return Qnil; /* finished waiting */ + return Qnil; /* Finished waiting. */ else { EMACS_SUB_TIME (duration, *end_time, duration); @@ -7309,8 +7309,8 @@ for (p = user_signals; p; p = p->next) if (p->sig == sig) { - if (special_event_name && - strcmp (special_event_name, p->name) == 0) + if (special_event_name + && strcmp (special_event_name, p->name) == 0) { /* Enter the debugger in many ways. */ debug_on_next_call = 1; === modified file 'src/w32fns.c' --- src/w32fns.c 2012-06-28 07:50:50 +0000 +++ src/w32fns.c 2012-06-28 19:09:41 +0000 @@ -2509,19 +2509,19 @@ woken up if blocked in sys_select, but we do NOT want to post the quit_char message itself (because it will usually be as if the user had typed quit_char twice). Instead, we post a dummy - message that has no particular effect. */ + message that has no particular effect. */ { int c = wParam; if (isalpha (c) && wmsg.dwModifiers == ctrl_modifier) c = make_ctrl_char (c) & 0377; if (c == quit_char - || (wmsg.dwModifiers == 0 && - w32_quit_key && wParam == w32_quit_key)) + || (wmsg.dwModifiers == 0 + && w32_quit_key && wParam == w32_quit_key)) { Vquit_flag = Qt; /* The choice of message is somewhat arbitrary, as long as - the main thread handler just ignores it. */ + the main thread handler just ignores it. */ msg = WM_NULL; /* Interrupt any blocking system calls. */ ------------------------------------------------------------ revno: 108792 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2012-06-28 20:34:05 +0400 message: * configure.in: Fix previous change. Remove --enable-asserts. (CPPFLAGS): Remove conditional -DXASSERTS=1. Add --enable-link-time-optimization. * INSTALL: Mention this. diff: === modified file 'ChangeLog' --- ChangeLog 2012-06-28 07:50:50 +0000 +++ ChangeLog 2012-06-28 16:34:05 +0000 @@ -1,5 +1,12 @@ 2012-06-28 Dmitry Antipov + * configure.in: Fix previous change. Remove --enable-asserts. + (CPPFLAGS): Remove conditional -DXASSERTS=1. + Add --enable-link-time-optimization. + * INSTALL: Mention this. + +2012-06-28 Dmitry Antipov + * configure.in: Add glyphs category to --enable-checking option. (GLYPH_DEBUG): Define if glyphs debugging is enabled. === modified file 'INSTALL' --- INSTALL 2012-06-27 07:47:56 +0000 +++ INSTALL 2012-06-28 16:34:05 +0000 @@ -323,6 +323,13 @@ there should be no warnings; on older and on non-GNU systems the generated warnings may still be useful. +Use --enable-link-time-optimization to enable link-time optimizer, which +is available in GNU compiler since version 4.5.0. If your compiler is not +GNU or older than version 4.5.0, this option does nothing. If `configure' +can determine number of online CPUS on your system, final link-time +optimization and code generation is executed in parallel using one job +per each available online CPU. + The `--prefix=PREFIXDIR' option specifies where the installation process should put emacs and its data files. This defaults to `/usr/local'. - Emacs (and the other utilities users run) go in PREFIXDIR/bin === modified file 'configure.in' --- configure.in 2012-06-28 07:50:50 +0000 +++ configure.in 2012-06-28 16:34:05 +0000 @@ -230,11 +230,6 @@ EN_NS_SELF_CONTAINED=$enableval, EN_NS_SELF_CONTAINED=yes) -AC_ARG_ENABLE(asserts, -[AS_HELP_STRING([--enable-asserts], [compile code with asserts enabled])], - USE_XASSERTS=$enableval, - USE_XASSERTS=no) - AC_ARG_ENABLE(locallisppath, [AS_HELP_STRING([--enable-locallisppath=PATH], [directories Emacs should search for lisp files specific @@ -265,21 +260,21 @@ ac_gc_check_string_free_list= ; ac_xmalloc_overrun= ; ac_gc_check_cons_list= ; - ac_check_glyphs= ;; + ac_glyphs_debug= ;; all) ac_enable_checking=1 ; ac_gc_check_stringbytes=1 ; ac_gc_check_string_overrun=1 ; ac_gc_check_string_free_list=1 ; ac_xmalloc_overrun=1 ; ac_gc_check_cons_list=1 ; - ac_check_glyphs=1 ;; + ac_glyphs_debug=1 ;; # these enable particular checks stringbytes) ac_gc_check_stringbytes=1 ;; stringoverrun) ac_gc_check_string_overrun=1 ;; stringfreelist) ac_gc_check_string_free_list=1 ;; xmallocoverrun) ac_xmalloc_overrun=1 ;; conslist) ac_gc_check_cons_list=1 ;; - glyphs) ac_check_glyphs=1 ;; + glyphs) ac_glyphs_debug=1 ;; *) AC_MSG_ERROR(unknown check category $check) ;; esac done @@ -311,7 +306,7 @@ AC_DEFINE(GC_CHECK_CONS_LIST, 1, [Define this to check for errors in cons list.]) fi -if test x$ac_check_glyphs != x ; then +if test x$ac_glyphs_debug != x ; then AC_DEFINE(GLYPH_DEBUG, 1, [Define this to enable glyphs debugging code.]) fi @@ -588,6 +583,32 @@ [gl_gcc_warnings=no] ) +AC_ARG_ENABLE(link-time-optimization, +[AS_HELP_STRING([--enable-link-time-optimization], + [build emacs with link-time optimization. + This is supported only for GCC since 4.5.0.])], +if test "${enableval}" != "no"; then + AC_MSG_CHECKING([whether link-time optimization is supported]) + ac_lto_supported=no + if test x$GCC = xyes; then + CPUS=`getconf _NPROCESSORS_ONLN 2>/dev/null` + if test x$CPUS != x; then + LTO="-flto=$CPUS" + else + LTO="-flto" + fi + old_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $LTO" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [ac_lto_supported=yes], [ac_lto_supported=no]) + CFLAGS="$old_CFLAGS" + fi + AC_MSG_RESULT([$ac_lto_supported]) + if test "$ac_lto_supported" = "yes"; then + CFLAGS="$CFLAGS $LTO" + fi +fi) + # gl_GCC_VERSION_IFELSE([major], [minor], [run-if-found], [run-if-not-found]) # ------------------------------------------------ # If $CPP is gcc-MAJOR.MINOR or newer, then run RUN-IF-FOUND. @@ -3657,11 +3678,6 @@ echo " Environment variable EMACSDOC set to: $EMACSDOC" fi -if test $USE_XASSERTS = yes; then - echo " Compiling with asserts turned on." - CPPFLAGS="$CPPFLAGS -DXASSERTS=1" -fi - echo if test "$HAVE_NS" = "yes"; then ------------------------------------------------------------ revno: 108791 committer: Paul Eggert branch nick: trunk timestamp: Thu 2012-06-28 08:50:11 -0700 message: Avoid integer overflow on scroll-left and scroll-right. * window.c (HSCROLL_MAX): New macro. (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer overflow when requested scroll falls outside ptrdiff_t range. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-28 12:29:37 +0000 +++ src/ChangeLog 2012-06-28 15:50:11 +0000 @@ -1,3 +1,10 @@ +2012-06-28 Paul Eggert + + Avoid integer overflow on scroll-left and scroll-right. + * window.c (HSCROLL_MAX): New macro. + (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer + overflow when requested scroll falls outside ptrdiff_t range. + 2012-06-28 Dmitry Antipov * window.h (struct window): Change type of 'hscroll', === modified file 'src/window.c' --- src/window.c 2012-06-28 12:29:37 +0000 +++ src/window.c 2012-06-28 15:50:11 +0000 @@ -3244,7 +3244,7 @@ o = XWINDOW (window); p = allocate_window (); - memcpy ((char *) p + sizeof (struct vectorlike_header), + memcpy ((char *) p + sizeof (struct vectorlike_header), (char *) o + sizeof (struct vectorlike_header), sizeof (Lisp_Object) * VECSIZE (struct window)); XSETWINDOW (parent, p); @@ -4857,6 +4857,9 @@ return Qnil; } +/* Scrolling amount must fit in both ptrdiff_t and Emacs fixnum. */ +#define HSCROLL_MAX min (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM) + DEFUN ("scroll-left", Fscroll_left, Sscroll_left, 0, 2, "^P\np", doc: /* Scroll selected window display ARG columns left. Default for ARG is window width minus 2. @@ -4871,13 +4874,12 @@ Lisp_Object result; ptrdiff_t hscroll; struct window *w = XWINDOW (selected_window); - - if (NILP (arg)) - XSETFASTINT (arg, window_body_cols (w) - 2); - else - arg = Fprefix_numeric_value (arg); - - hscroll = w->hscroll + XINT (arg); + EMACS_INT requested_arg = (NILP (arg) + ? window_body_cols (w) - 2 + : XINT (Fprefix_numeric_value (arg))); + ptrdiff_t clipped_arg = + clip_to_bounds (- w->hscroll, requested_arg, HSCROLL_MAX - w->hscroll); + hscroll = w->hscroll + clipped_arg; result = Fset_window_hscroll (selected_window, make_number (hscroll)); if (!NILP (set_minimum)) @@ -4900,13 +4902,12 @@ Lisp_Object result; ptrdiff_t hscroll; struct window *w = XWINDOW (selected_window); - - if (NILP (arg)) - XSETFASTINT (arg, window_body_cols (w) - 2); - else - arg = Fprefix_numeric_value (arg); - - hscroll = w->hscroll - XINT (arg); + EMACS_INT requested_arg = (NILP (arg) + ? window_body_cols (w) - 2 + : XINT (Fprefix_numeric_value (arg))); + ptrdiff_t clipped_arg = + clip_to_bounds (w->hscroll - HSCROLL_MAX, requested_arg, w->hscroll); + hscroll = w->hscroll - clipped_arg; result = Fset_window_hscroll (selected_window, make_number (hscroll)); if (!NILP (set_minimum)) ------------------------------------------------------------ revno: 108790 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2012-06-28 16:29:37 +0400 message: * window.h (struct window): Change type of 'hscroll', 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t, 'last_modified' and 'last_overlay_modified' to EMACS_INT. Adjust users accordingly. * xdisp.c (try_cursor_movement): Replace type check with eassert. * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll' from EMACS_INT to ptrdiff_t. (make_window): Omit redundant initialization. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-28 11:37:27 +0000 +++ src/ChangeLog 2012-06-28 12:29:37 +0000 @@ -1,3 +1,14 @@ +2012-06-28 Dmitry Antipov + + * window.h (struct window): Change type of 'hscroll', + 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t, + 'last_modified' and 'last_overlay_modified' to EMACS_INT. + Adjust users accordingly. + * xdisp.c (try_cursor_movement): Replace type check with eassert. + * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll' + from EMACS_INT to ptrdiff_t. + (make_window): Omit redundant initialization. + 2012-06-28 Juanma Barranquero * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies. === modified file 'src/frame.c' --- src/frame.c 2012-06-28 11:11:48 +0000 +++ src/frame.c 2012-06-28 12:29:37 +0000 @@ -131,7 +131,7 @@ { struct window *w = XWINDOW (window); - XSETFASTINT (w->last_modified, 0); + w->last_modified = 0; XSETFASTINT (w->top_line, XFASTINT (w->top_line) + n); XSETFASTINT (w->total_lines, XFASTINT (w->total_lines) - n); === modified file 'src/indent.c' --- src/indent.c 2012-06-16 12:24:15 +0000 +++ src/indent.c 2012-06-28 12:29:37 +0000 @@ -1817,7 +1817,7 @@ struct position * vmotion (register ptrdiff_t from, register EMACS_INT vtarget, struct window *w) { - ptrdiff_t hscroll = XINT (w->hscroll); + ptrdiff_t hscroll = w->hscroll; struct position pos; /* vpos is cumulative vertical position, changed as from is changed */ register EMACS_INT vpos = 0; === modified file 'src/minibuf.c' --- src/minibuf.c 2012-06-19 17:05:41 +0000 +++ src/minibuf.c 2012-06-28 12:29:37 +0000 @@ -622,7 +622,7 @@ /* Display this minibuffer in the proper window. */ Fset_window_buffer (minibuf_window, Fcurrent_buffer (), Qnil); Fselect_window (minibuf_window, Qnil); - XSETFASTINT (XWINDOW (minibuf_window)->hscroll, 0); + XWINDOW (minibuf_window)->hscroll = 0; Fmake_local_variable (Qprint_escape_newlines); print_escape_newlines = 1; @@ -888,8 +888,8 @@ /* Make sure minibuffer window is erased, not ignored. */ windows_or_buffers_changed++; - XSETFASTINT (XWINDOW (window)->last_modified, 0); - XSETFASTINT (XWINDOW (window)->last_overlay_modified, 0); + XWINDOW (window)->last_modified = 0; + XWINDOW (window)->last_overlay_modified = 0; /* In case the previous minibuffer displayed in this miniwindow is dead, we may keep displaying this buffer (tho it's inactive), so reset it, === modified file 'src/window.c' --- src/window.c 2012-06-28 11:11:48 +0000 +++ src/window.c 2012-06-28 12:29:37 +0000 @@ -667,7 +667,7 @@ WINDOW must be a live window and defaults to the selected one. */) (Lisp_Object window) { - return decode_window (window)->hscroll; + return make_number (decode_window (window)->hscroll); } DEFUN ("set-window-hscroll", Fset_window_hscroll, Sset_window_hscroll, 2, 2, 0, @@ -686,10 +686,10 @@ hscroll = clip_to_bounds (0, XINT (ncol), PTRDIFF_MAX); /* Prevent redisplay shortcuts when changing the hscroll. */ - if (XINT (w->hscroll) != hscroll) + if (w->hscroll != hscroll) XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; - w->hscroll = make_number (hscroll); + w->hscroll = hscroll; return ncol; } @@ -1313,8 +1313,8 @@ if (! NILP (update) && ! (! NILP (w->window_end_valid) - && XFASTINT (w->last_modified) >= BUF_MODIFF (b) - && XFASTINT (w->last_overlay_modified) >= BUF_OVERLAY_MODIFF (b)) + && w->last_modified >= BUF_MODIFF (b) + && w->last_overlay_modified >= BUF_OVERLAY_MODIFF (b)) && !noninteractive) { struct text_pos startp; @@ -1397,8 +1397,8 @@ if (NILP (noforce)) w->force_start = 1; w->update_mode_line = 1; - XSETFASTINT (w->last_modified, 0); - XSETFASTINT (w->last_overlay_modified, 0); + w->last_modified = 0; + w->last_overlay_modified = 0; if (!EQ (window, selected_window)) windows_or_buffers_changed++; @@ -1510,8 +1510,8 @@ if (NILP (w->window_end_valid) || current_buffer->clip_changed || current_buffer->prevent_redisplay_optimizations_p - || XFASTINT (w->last_modified) < BUF_MODIFF (b) - || XFASTINT (w->last_overlay_modified) < BUF_OVERLAY_MODIFF (b)) + || w->last_modified < BUF_MODIFF (b) + || w->last_overlay_modified < BUF_OVERLAY_MODIFF (b)) return Qnil; if (NILP (line)) @@ -3002,7 +3002,7 @@ Resetting hscroll and vscroll here is problematic for things like image-mode and doc-view-mode since it resets the image's position whenever we resize the frame. */ - w->hscroll = w->min_hscroll = make_number (0); + w->hscroll = w->min_hscroll = 0; w->vscroll = 0; set_marker_both (w->pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b)); set_marker_restricted (w->start, @@ -3010,8 +3010,8 @@ buffer); w->start_at_line_beg = 0; w->force_start = 0; - XSETFASTINT (w->last_modified, 0); - XSETFASTINT (w->last_overlay_modified, 0); + w->last_modified = 0; + w->last_overlay_modified = 0; } /* Maybe we could move this into the `if' but it's not obviously safe and I doubt it's worth the trouble. */ @@ -3196,8 +3196,8 @@ Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window))); Vminibuf_scroll_window = window; w = XWINDOW (window); - XSETFASTINT (w->hscroll, 0); - XSETFASTINT (w->min_hscroll, 0); + w->hscroll = 0; + w->min_hscroll = 0; set_marker_restricted_both (w->start, buf, BEG, BEG); set_marker_restricted_both (w->pointm, buf, BEG, BEG); @@ -3286,9 +3286,6 @@ XSETFASTINT (w->new_normal, 0); w->start = Fmake_marker (); w->pointm = Fmake_marker (); - XSETFASTINT (w->hscroll, 0); - XSETFASTINT (w->min_hscroll, 0); - XSETFASTINT (w->last_point, 0); w->vertical_scroll_bar_type = Qt; XSETFASTINT (w->window_end_pos, 0); XSETFASTINT (w->window_end_vpos, 0); @@ -3488,8 +3485,8 @@ } /* Clear out some redisplay caches. */ - XSETFASTINT (w->last_modified, 0); - XSETFASTINT (w->last_overlay_modified, 0); + w->last_modified = 0; + w->last_overlay_modified = 0; } @@ -4021,8 +4018,8 @@ /* Grow the mini-window. */ XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines)); XSETFASTINT (w->total_lines, XFASTINT (w->total_lines) - XINT (value)); - XSETFASTINT (w->last_modified, 0); - XSETFASTINT (w->last_overlay_modified, 0); + w->last_modified = 0; + w->last_overlay_modified = 0; adjust_glyphs (f); UNBLOCK_INPUT; @@ -4057,8 +4054,8 @@ XSETFASTINT (w->top_line, XFASTINT (r->top_line) + XFASTINT (r->total_lines)); XSETFASTINT (w->total_lines, 1); - XSETFASTINT (w->last_modified, 0); - XSETFASTINT (w->last_overlay_modified, 0); + w->last_modified = 0; + w->last_overlay_modified = 0; adjust_glyphs (f); UNBLOCK_INPUT; @@ -4285,8 +4282,8 @@ w->buffer); w->start_at_line_beg = 1; w->update_mode_line = 1; - XSETFASTINT (w->last_modified, 0); - XSETFASTINT (w->last_overlay_modified, 0); + w->last_modified = 0; + w->last_overlay_modified = 0; /* Set force_start so that redisplay_window will run the window-scroll-functions. */ w->force_start = 1; @@ -4431,8 +4428,8 @@ bytepos = XMARKER (w->start)->bytepos; w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n'); w->update_mode_line = 1; - XSETFASTINT (w->last_modified, 0); - XSETFASTINT (w->last_overlay_modified, 0); + w->last_modified = 0; + w->last_overlay_modified = 0; /* Set force_start so that redisplay_window will run the window-scroll-functions. */ w->force_start = 1; @@ -4585,10 +4582,10 @@ struct position posit = *compute_motion (startpos, 0, 0, 0, PT, ht, 0, - -1, XINT (w->hscroll), + -1, w->hscroll, 0, w); window_scroll_preserve_vpos = posit.vpos; - window_scroll_preserve_hpos = posit.hpos + XINT (w->hscroll); + window_scroll_preserve_hpos = posit.hpos + w->hscroll; } original_pos = Fcons (make_number (window_scroll_preserve_hpos), @@ -4630,8 +4627,8 @@ set_marker_restricted_both (w->start, w->buffer, pos, pos_byte); w->start_at_line_beg = !NILP (bolp); w->update_mode_line = 1; - XSETFASTINT (w->last_modified, 0); - XSETFASTINT (w->last_overlay_modified, 0); + w->last_modified = 0; + w->last_overlay_modified = 0; /* Set force_start so that redisplay_window will run the window-scroll-functions. */ w->force_start = 1; @@ -4872,7 +4869,7 @@ (register Lisp_Object arg, Lisp_Object set_minimum) { Lisp_Object result; - EMACS_INT hscroll; + ptrdiff_t hscroll; struct window *w = XWINDOW (selected_window); if (NILP (arg)) @@ -4880,7 +4877,7 @@ else arg = Fprefix_numeric_value (arg); - hscroll = XINT (w->hscroll) + XINT (arg); + hscroll = w->hscroll + XINT (arg); result = Fset_window_hscroll (selected_window, make_number (hscroll)); if (!NILP (set_minimum)) @@ -4901,7 +4898,7 @@ (register Lisp_Object arg, Lisp_Object set_minimum) { Lisp_Object result; - EMACS_INT hscroll; + ptrdiff_t hscroll; struct window *w = XWINDOW (selected_window); if (NILP (arg)) @@ -4909,7 +4906,7 @@ else arg = Fprefix_numeric_value (arg); - hscroll = XINT (w->hscroll) - XINT (arg); + hscroll = w->hscroll - XINT (arg); result = Fset_window_hscroll (selected_window, make_number (hscroll)); if (!NILP (set_minimum)) @@ -5537,8 +5534,8 @@ w->total_lines = p->total_lines; w->normal_cols = p->normal_cols; w->normal_lines = p->normal_lines; - w->hscroll = p->hscroll; - w->min_hscroll = p->min_hscroll; + w->hscroll = XFASTINT (p->hscroll); + w->min_hscroll = XFASTINT (p->min_hscroll); w->display_table = p->display_table; w->left_margin_cols = p->left_margin_cols; w->right_margin_cols = p->right_margin_cols; @@ -5571,8 +5568,8 @@ } } - XSETFASTINT (w->last_modified, 0); - XSETFASTINT (w->last_overlay_modified, 0); + w->last_modified = 0; + w->last_overlay_modified = 0; /* Reinstall the saved buffer and pointers into it. */ if (NILP (p->buffer)) @@ -5811,7 +5808,7 @@ if (!row->enabled_p) return NULL; - if (XINT (w->hscroll)) + if (w->hscroll) { /* When the window is hscrolled, cursor hpos can legitimately be out of bounds, but we draw the cursor at the corresponding @@ -5853,8 +5850,8 @@ p->total_lines = w->total_lines; p->normal_cols = w->normal_cols; p->normal_lines = w->normal_lines; - p->hscroll = w->hscroll; - p->min_hscroll = w->min_hscroll; + XSETFASTINT (p->hscroll, w->hscroll); + XSETFASTINT (p->min_hscroll, w->min_hscroll); p->display_table = w->display_table; p->left_margin_cols = w->left_margin_cols; p->right_margin_cols = w->right_margin_cols; === modified file 'src/window.h' --- src/window.h 2012-06-28 11:11:48 +0000 +++ src/window.h 2012-06-28 12:29:37 +0000 @@ -141,24 +141,10 @@ each one can have its own value of point. */ Lisp_Object pointm; - /* Number of columns display within the window is scrolled to the left. */ - Lisp_Object hscroll; - /* Minimum hscroll for automatic hscrolling. This is the value - the user has set, by set-window-hscroll for example. */ - Lisp_Object min_hscroll; - /* No permanent meaning; used by save-window-excursion's bookkeeping. */ Lisp_Object temslot; - /* text.modified of displayed buffer as of last time display - completed. */ - Lisp_Object last_modified; - /* BUF_OVERLAY_MODIFIED of displayed buffer as of last complete update. */ - Lisp_Object last_overlay_modified; - /* Value of point at that time. */ - Lisp_Object last_point; - /* This window's vertical scroll bar. This field is only for use by the window-system-dependent code which implements the scroll bars; it can store anything it likes here. If this @@ -254,6 +240,25 @@ /* Unique number of window assigned when it was created. */ int sequence_number; + /* Number of columns display within the window is scrolled to the left. */ + ptrdiff_t hscroll; + + /* Minimum hscroll for automatic hscrolling. This is the value + the user has set, by set-window-hscroll for example. */ + ptrdiff_t min_hscroll; + + /* Displayed buffer's text modification events counter as of last time + display completed. */ + EMACS_INT last_modified; + + /* Displayed buffer's overlays modification events counter as of last + complete update. */ + EMACS_INT last_overlay_modified; + + /* Value of point at that time. Since this is a position in a buffer, + it should be positive. */ + ptrdiff_t last_point; + /* Scaling factor for the glyph_matrix size calculation in this window. Used if window contains many small images or uses proportional fonts, as the normal may yield a matrix which is too small. */ === modified file 'src/xdisp.c' --- src/xdisp.c 2012-06-28 07:50:50 +0000 +++ src/xdisp.c 2012-06-28 12:29:37 +0000 @@ -1562,8 +1562,8 @@ current_header_line_height = current_mode_line_height = -1; - if (visible_p && XFASTINT (w->hscroll) > 0) - *x -= XFASTINT (w->hscroll) * WINDOW_FRAME_COLUMN_WIDTH (w); + if (visible_p && w->hscroll > 0) + *x -= w->hscroll * WINDOW_FRAME_COLUMN_WIDTH (w); #if 0 /* Debugging code. */ @@ -2697,7 +2697,7 @@ /* Are lines in the display truncated? */ if (base_face_id != DEFAULT_FACE_ID - || XINT (it->w->hscroll) + || it->w->hscroll || (! WINDOW_FULL_WIDTH_P (it->w) && ((!NILP (Vtruncate_partial_width_windows) && !INTEGERP (Vtruncate_partial_width_windows)) @@ -2760,7 +2760,7 @@ else { it->first_visible_x - = XFASTINT (it->w->hscroll) * FRAME_COLUMN_WIDTH (it->f); + = it->w->hscroll * FRAME_COLUMN_WIDTH (it->f); it->last_visible_x = (it->first_visible_x + window_box_width (w, TEXT_AREA)); @@ -12309,7 +12309,7 @@ inside the left margin and the window is already hscrolled. */ && ((!row_r2l_p - && ((XFASTINT (w->hscroll) + && ((w->hscroll && w->cursor.x <= h_margin) || (cursor_row->enabled_p && cursor_row->truncated_on_right_p @@ -12327,7 +12327,7 @@ are actually truncated on the left. */ && cursor_row->truncated_on_right_p && w->cursor.x <= h_margin) - || (XFASTINT (w->hscroll) + || (w->hscroll && (w->cursor.x >= text_area_width - h_margin)))))) { struct it it; @@ -12388,15 +12388,15 @@ hscroll = max (0, it.current_x - wanted_x) / FRAME_COLUMN_WIDTH (it.f); } - hscroll = max (hscroll, XFASTINT (w->min_hscroll)); + hscroll = max (hscroll, w->min_hscroll); /* Don't prevent redisplay optimizations if hscroll hasn't changed, as it will unnecessarily slow down redisplay. */ - if (XFASTINT (w->hscroll) != hscroll) + if (w->hscroll != hscroll) { XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; - w->hscroll = make_number (hscroll); + w->hscroll = hscroll; hscrolled_p = 1; } } @@ -12508,8 +12508,8 @@ int unchanged_p = 1; /* If text or overlays have changed, see where. */ - if (XFASTINT (w->last_modified) < MODIFF - || XFASTINT (w->last_overlay_modified) < OVERLAY_MODIFF) + if (w->last_modified < MODIFF + || w->last_overlay_modified < OVERLAY_MODIFF) { /* Gap in the line? */ if (GPT < start || Z - GPT < end) @@ -12788,9 +12788,9 @@ pt = marker_position (w->pointm); if ((w->current_matrix->buffer != XBUFFER (w->buffer) - || pt != XINT (w->last_point)) + || pt != w->last_point) && check_point_in_composition (w->current_matrix->buffer, - XINT (w->last_point), + w->last_point, XBUFFER (w->buffer), pt)) b->clip_changed = 1; } @@ -13012,9 +13012,9 @@ if (!NILP (w->column_number_displayed) /* This alternative quickly identifies a common case where no change is needed. */ - && !(PT == XFASTINT (w->last_point) - && XFASTINT (w->last_modified) >= MODIFF - && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF) + && !(PT == w->last_point + && w->last_modified >= MODIFF + && w->last_overlay_modified >= OVERLAY_MODIFF) && (XFASTINT (w->column_number_displayed) != current_column ())) w->update_mode_line = 1; @@ -13077,8 +13077,8 @@ } else if (EQ (selected_window, minibuf_window) && (current_buffer->clip_changed - || XFASTINT (w->last_modified) < MODIFF - || XFASTINT (w->last_overlay_modified) < OVERLAY_MODIFF) + || w->last_modified < MODIFF + || w->last_overlay_modified < OVERLAY_MODIFF) && resize_mini_window (w, 0)) { /* Resized active mini-window to fit the size of what it is @@ -13143,8 +13143,8 @@ || FETCH_BYTE (BYTEPOS (tlbufpos)) == '\n')) /* Former continuation line has disappeared by becoming empty. */ goto cancel; - else if (XFASTINT (w->last_modified) < MODIFF - || XFASTINT (w->last_overlay_modified) < OVERLAY_MODIFF + else if (w->last_modified < MODIFF + || w->last_overlay_modified < OVERLAY_MODIFF || MINI_WINDOW_P (w)) { /* We have to handle the case of continuation around a @@ -13248,7 +13248,7 @@ goto cancel; } else if (/* Cursor position hasn't changed. */ - PT == XFASTINT (w->last_point) + PT == w->last_point /* Make sure the cursor was last displayed in this window. Otherwise we have to reposition it. */ && 0 <= w->cursor.vpos @@ -13664,10 +13664,8 @@ { struct buffer *b = XBUFFER (w->buffer); - w->last_modified - = make_number (accurate_p ? BUF_MODIFF (b) : 0); - w->last_overlay_modified - = make_number (accurate_p ? BUF_OVERLAY_MODIFF (b) : 0); + w->last_modified = accurate_p ? BUF_MODIFF(b) : 0; + w->last_overlay_modified = accurate_p ? BUF_OVERLAY_MODIFF(b) : 0; w->last_had_star = BUF_MODIFF (b) > BUF_SAVE_MODIFF (b); @@ -13689,9 +13687,9 @@ w->last_cursor_off_p = w->cursor_off_p; if (w == XWINDOW (selected_window)) - w->last_point = make_number (BUF_PT (b)); + w->last_point = BUF_PT (b); else - w->last_point = make_number (XMARKER (w->pointm)->charpos); + w->last_point = XMARKER (w->pointm)->charpos; } } @@ -14932,6 +14930,11 @@ return rc; #endif + /* Previously, there was a check for Lisp integer in the + if-statement below. Now, this field is converted to + ptrdiff_t, thus zero means invalid position in a buffer. */ + eassert (w->last_point > 0); + /* Handle case where text has not changed, only point, and it has not moved off the frame. */ if (/* Point may be in this window. */ @@ -14952,8 +14955,6 @@ && !NILP (BVAR (current_buffer, mark_active))) && NILP (w->region_showing) && NILP (Vshow_trailing_whitespace) - /* Right after splitting windows, last_point may be nil. */ - && INTEGERP (w->last_point) /* This code is not used for mini-buffer for the sake of the case of redisplaying to replace an echo area message; since in that case the mini-buffer contents per se are usually @@ -15011,7 +15012,7 @@ int scroll_p = 0, must_scroll = 0; int last_y = window_text_bottom_y (w) - this_scroll_margin; - if (PT > XFASTINT (w->last_point)) + if (PT > w->last_point) { /* Point has moved forward. */ while (MATRIX_ROW_END_CHARPOS (row) < PT @@ -15046,7 +15047,7 @@ && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))) scroll_p = 1; } - else if (PT < XFASTINT (w->last_point)) + else if (PT < w->last_point) { /* Cursor has to be moved backward. Note that PT >= CHARPOS (startp) because of the outer if-statement. */ @@ -15392,8 +15393,8 @@ = (!NILP (w->window_end_valid) && !current_buffer->clip_changed && !current_buffer->prevent_redisplay_optimizations_p - && XFASTINT (w->last_modified) >= MODIFF - && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF); + && w->last_modified >= MODIFF + && w->last_overlay_modified >= OVERLAY_MODIFF); /* Run the window-bottom-change-functions if it is possible that the text on the screen has changed @@ -15415,8 +15416,8 @@ buffer_unchanged_p = (!NILP (w->window_end_valid) && !current_buffer->clip_changed - && XFASTINT (w->last_modified) >= MODIFF - && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF); + && w->last_modified >= MODIFF + && w->last_overlay_modified >= OVERLAY_MODIFF); /* When windows_or_buffers_changed is non-zero, we can't rely on the window end being valid, so set it to nil there. */ @@ -15441,9 +15442,9 @@ if (!NILP (w->column_number_displayed) /* This alternative quickly identifies a common case where no change is needed. */ - && !(PT == XFASTINT (w->last_point) - && XFASTINT (w->last_modified) >= MODIFF - && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF) + && !(PT == w->last_point + && w->last_modified >= MODIFF + && w->last_overlay_modified >= OVERLAY_MODIFF) && (XFASTINT (w->column_number_displayed) != current_column ())) update_mode_line = 1; @@ -15559,8 +15560,8 @@ startp = run_window_scroll_functions (window, startp); } - w->last_modified = make_number (0); - w->last_overlay_modified = make_number (0); + w->last_modified = 0; + w->last_overlay_modified = 0; if (CHARPOS (startp) < BEGV) SET_TEXT_POS (startp, BEGV, BEGV_BYTE); else if (CHARPOS (startp) > ZV) @@ -15685,8 +15686,8 @@ && (CHARPOS (startp) < ZV /* Avoid starting at end of buffer. */ || CHARPOS (startp) == BEGV - || (XFASTINT (w->last_modified) >= MODIFF - && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF))) + || (w->last_modified >= MODIFF + && w->last_overlay_modified >= OVERLAY_MODIFF))) { int d1, d2, d3, d4, d5, d6; @@ -15773,8 +15774,8 @@ try_to_scroll: - w->last_modified = make_number (0); - w->last_overlay_modified = make_number (0); + w->last_modified = 0; + w->last_overlay_modified = 0; /* Redisplay the mode line. Select the buffer properly for that. */ if (!update_mode_line) @@ -17133,11 +17134,11 @@ GIVE_UP (5); /* Another way to prevent redisplay optimizations. */ - if (XFASTINT (w->last_modified) == 0) + if (w->last_modified == 0) GIVE_UP (6); /* Verify that window is not hscrolled. */ - if (XFASTINT (w->hscroll) != 0) + if (w->hscroll != 0) GIVE_UP (7); /* Verify that display wasn't paused. */ @@ -27410,8 +27411,8 @@ b = XBUFFER (w->buffer); if (part == ON_TEXT && EQ (w->window_end_valid, w->buffer) - && XFASTINT (w->last_modified) == BUF_MODIFF (b) - && XFASTINT (w->last_overlay_modified) == BUF_OVERLAY_MODIFF (b)) + && w->last_modified == BUF_MODIFF (b) + && w->last_overlay_modified == BUF_OVERLAY_MODIFF (b)) { int hpos, vpos, dx, dy, area = LAST_AREA; ptrdiff_t pos; ------------------------------------------------------------ revno: 108789 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2012-06-28 13:37:27 +0200 message: src/makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-28 11:11:48 +0000 +++ src/ChangeLog 2012-06-28 11:37:27 +0000 @@ -1,3 +1,7 @@ +2012-06-28 Juanma Barranquero + + * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies. + 2012-06-28 Dmitry Antipov * window.h (struct window): Change type of 'use_time' and === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2012-06-26 01:05:39 +0000 +++ src/makefile.w32-in 2012-06-28 11:37:27 +0000 @@ -1268,7 +1268,6 @@ $(SRC)/category.h \ $(SRC)/regex.h \ $(SRC)/syntax.h \ - $(NT_INC)/unistd.h \ $(BUFFER_H) \ $(CHARACTER_H) \ $(CONFIG_H) \ ------------------------------------------------------------ revno: 108788 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2012-06-28 15:11:48 +0400 message: * window.h (struct window): Change type of 'use_time' and 'sequence_number' from Lisp_Object to int. * frame.c (make_frame): Adjust users accordingly. * print.c (print_object): Likewise. * window.c (select_window, Fwindow_use_time, make_parent_window) (make_window): Likewise. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-28 07:50:50 +0000 +++ src/ChangeLog 2012-06-28 11:11:48 +0000 @@ -1,5 +1,14 @@ 2012-06-28 Dmitry Antipov + * window.h (struct window): Change type of 'use_time' and + 'sequence_number' from Lisp_Object to int. + * frame.c (make_frame): Adjust users accordingly. + * print.c (print_object): Likewise. + * window.c (select_window, Fwindow_use_time, make_parent_window) + (make_window): Likewise. + +2012-06-28 Dmitry Antipov + * dispextern.h (GLYPH_DEBUG): Now defined in config.h if enabled with --enable-checking=[all,glyphs] configure option. Fix GLYPH_DEBUG usage assuming that it may be undefined, === modified file 'src/frame.c' --- src/frame.c 2012-06-26 14:41:01 +0000 +++ src/frame.c 2012-06-28 11:11:48 +0000 @@ -356,8 +356,7 @@ f->selected_window = root_window; /* Make sure this window seems more recently used than a newly-created, never-selected window. */ - ++window_select_count; - XSETFASTINT (XWINDOW (f->selected_window)->use_time, window_select_count); + XWINDOW (f->selected_window)->use_time = ++window_select_count; return f; } === modified file 'src/print.c' --- src/print.c 2012-06-26 02:33:51 +0000 +++ src/print.c 2012-06-28 11:11:48 +0000 @@ -1774,8 +1774,7 @@ { int len; strout ("#sequence_number)); + len = sprintf (buf, "%d", XWINDOW (obj)->sequence_number); strout (buf, len, len, printcharfun); if (!NILP (XWINDOW (obj)->buffer)) { === modified file 'src/window.c' --- src/window.c 2012-06-28 07:50:27 +0000 +++ src/window.c 2012-06-28 11:11:48 +0000 @@ -331,8 +331,7 @@ if (NILP (norecord)) { - ++window_select_count; - XSETFASTINT (w->use_time, window_select_count); + w->use_time = ++window_select_count; record_buffer (w->buffer); } @@ -499,7 +498,7 @@ selected one. */) (Lisp_Object window) { - return decode_window (window)->use_time; + return make_number (decode_window (window)->use_time); } DEFUN ("window-total-height", Fwindow_total_height, Swindow_total_height, 0, 1, 0, @@ -3250,8 +3249,7 @@ sizeof (Lisp_Object) * VECSIZE (struct window)); XSETWINDOW (parent, p); - ++sequence_number; - XSETFASTINT (p->sequence_number, sequence_number); + p->sequence_number = ++sequence_number; replace_window (window, parent, 1); @@ -3290,9 +3288,6 @@ w->pointm = Fmake_marker (); XSETFASTINT (w->hscroll, 0); XSETFASTINT (w->min_hscroll, 0); - XSETFASTINT (w->use_time, 0); - ++sequence_number; - XSETFASTINT (w->sequence_number, sequence_number); XSETFASTINT (w->last_point, 0); w->vertical_scroll_bar_type = Qt; XSETFASTINT (w->window_end_pos, 0); @@ -3303,6 +3298,7 @@ w->nrows_scale_factor = w->ncols_scale_factor = 1; w->phys_cursor_type = -1; w->phys_cursor_width = -1; + w->sequence_number = ++sequence_number; /* Reset window_list. */ Vwindow_list = Qnil; === modified file 'src/window.h' --- src/window.h 2012-06-01 03:41:03 +0000 +++ src/window.h 2012-06-28 11:11:48 +0000 @@ -147,12 +147,6 @@ the user has set, by set-window-hscroll for example. */ Lisp_Object min_hscroll; - /* Number saying how recently window was selected. */ - Lisp_Object use_time; - - /* Unique number of window assigned when it was created. */ - Lisp_Object sequence_number; - /* No permanent meaning; used by save-window-excursion's bookkeeping. */ Lisp_Object temslot; @@ -254,6 +248,12 @@ struct glyph_matrix *current_matrix; struct glyph_matrix *desired_matrix; + /* Number saying how recently window was selected. */ + int use_time; + + /* Unique number of window assigned when it was created. */ + int sequence_number; + /* Scaling factor for the glyph_matrix size calculation in this window. Used if window contains many small images or uses proportional fonts, as the normal may yield a matrix which is too small. */ ------------------------------------------------------------ revno: 108787 committer: Julien Danjou branch nick: trunk timestamp: Thu 2012-06-28 12:40:24 +0200 message: term: rework color cutomizing * term.el (term-handle-colors-array): Use a set of new faces to color the terminal. Also uses :inverse-video property. (term-default-fg-color): Set to nil by default, deprecate in favor of `term-face'. (term-default-bg-color): Set to nil by default, deprecate in favor of `term-face'. (term-current-face): Use `term-face' by default. (term-bold-attribute): Variable deleted. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-06-27 05:47:14 +0000 +++ etc/NEWS 2012-06-28 10:40:24 +0000 @@ -160,6 +160,15 @@ * Changes in Specialized Modes and Packages in Emacs 24.2 +** Term changes + +The variables `term-default-fg-color' and `term-default-bg-color' are +now deprecated in favor of the `term-face' face, that you can +customize. Also, it is now possible to cutomize how are displayed the +ANSI terminal colors and styles by cutomizing the corresponding +`term-color-', `term-color-underline' and `term-color-bold' +faces. + ** CL's main entry is now (require 'cl-lib). `cl-lib' is like the old `cl' except that it uses the namespace cleanly, i.e. all its definitions have the "cl-" prefix. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-28 07:21:41 +0000 +++ lisp/ChangeLog 2012-06-28 10:40:24 +0000 @@ -1,3 +1,14 @@ +2012-06-28 Julien Danjou + + * term.el (term-handle-colors-array): Use a set of new faces to + color the terminal. Also uses :inverse-video property. + (term-default-fg-color): Set to nil by default, deprecate in favor + of `term-face'. + (term-default-bg-color): Set to nil by default, deprecate in favor + of `term-face'. + (term-current-face): Use `term-face' by default. + (term-bold-attribute): Variable deleted. + 2012-06-28 Glenn Morris * simple.el (completion-list-mode-finish): === modified file 'lisp/term.el' --- lisp/term.el 2012-06-20 16:21:57 +0000 +++ lisp/term.el 2012-06-28 10:40:24 +0000 @@ -108,11 +108,6 @@ ;; ;; Blink, is not supported. Currently it's mapped as bold. ;; -;; Important caveat: -;; ----------------- -;; if you want custom colors in term.el redefine term-default-fg-color -;; and term-default-bg-color BEFORE loading it. -;; ;; ---------------------------------------- ;; ;; If you'd like to check out my complete configuration, you can download @@ -459,7 +454,7 @@ "A queue of strings whose echo we want suppressed.") (defvar term-terminal-parameter) (defvar term-terminal-previous-parameter) -(defvar term-current-face 'default) +(defvar term-current-face 'term-face) (defvar term-scroll-start 0 "Top-most line (inclusive) of scrolling region.") (defvar term-scroll-end) ; Number of line (zero-based) after scrolling region. (defvar term-pager-count nil @@ -795,28 +790,87 @@ (defvar term-terminal-previous-parameter-3 -1) (defvar term-terminal-previous-parameter-4 -1) -;;; faces -mm - -(defcustom term-default-fg-color - ;; FIXME: This depends on the current frame, so depending on when - ;; it's loaded, the result may be different. - (face-foreground term-current-face) - "Default color for foreground in `term'." - :group 'term - :type 'string) - -(defcustom term-default-bg-color - ;; FIXME: This depends on the current frame, so depending on when - ;; it's loaded, the result may be different. - (face-background term-current-face) - "Default color for background in `term'." - :group 'term - :type 'string) - -;; Use the same colors that xterm uses, see `xterm-standard-colors'. +;;; Faces (defvar ansi-term-color-vector - [unspecified "black" "red3" "green3" "yellow3" "blue2" - "magenta3" "cyan3" "white"]) + [term-face + term-color-black + term-color-red + term-color-green + term-color-yellow + term-color-blue + term-color-magenta + term-color-cyan + term-color-white]) + +(defcustom term-default-fg-color nil + "If non-nil, default color for foreground in Term mode. +This is deprecated in favor of customizing the `term-face' face." + :group 'term + :type 'string) + +(defcustom term-default-bg-color nil + "If non-nil, default color for foreground in Term mode. +This is deprecated in favor of customizing the `term-face' face." + :group 'term + :type 'string) + +(defface term-face + `((t + :foreground ,term-default-fg-color + :background ,term-default-bg-color + :inherit default)) + "Default face to use in Term mode." + :group 'term) + +(defface term-bold + '((t :bold t)) + "Default face to use for bold text." + :group 'term) + +(defface term-underline + '((t :underline t)) + "Default face to use for underlined text." + :group 'term) + +(defface term-color-black + '((t :foreground "black" :background "black")) + "Face used to render black color code." + :group 'term) + +(defface term-color-red + '((t :foreground "red3" :background "red3")) + "Face used to render red color code." + :group 'term) + +(defface term-color-green + '((t :foreground "green3" :background "green3")) + "Face used to render green color code." + :group 'term) + +(defface term-color-yellow + '((t :foreground "yellow3" :background "yellow3")) + "Face used to render yellow color code." + :group 'term) + +(defface term-color-blue + '((t :foreground "blue2" :background "blue2")) + "Face used to render blue color code." + :group 'term) + +(defface term-color-magenta + '((t :foreground "magenta3" :background "magenta3")) + "Face used to render magenta color code." + :group 'term) + +(defface term-color-cyan + '((t :foreground "cyan3" :background "cyan3")) + "Face used to render cyan color code." + :group 'term) + +(defface term-color-white + '((t :foreground "white" :background "white")) + "Face used to render white color code." + :group 'term) ;; Inspiration came from comint.el -mm (defcustom term-buffer-maximum-size 2048 @@ -951,11 +1005,7 @@ dt)) (defun term-ansi-reset () - (setq term-current-face (nconc - (if term-default-bg-color - (list :background term-default-bg-color)) - (if term-default-fg-color - (list :foreground term-default-fg-color)))) + (setq term-current-face 'term-face) (setq term-ansi-current-underline nil) (setq term-ansi-current-bold nil) (setq term-ansi-current-reverse nil) @@ -3088,10 +3138,6 @@ ;; New function to deal with ansi colorized output, as you can see you can ;; have any bold/underline/fg/bg/reverse combination. -mm -(defvar term-bold-attribute '(:weight bold) - "Attribute to use for the bold terminal attribute. -Set it to nil to disable bold.") - (defun term-handle-colors-array (parameter) (cond @@ -3153,46 +3199,32 @@ ;; term-ansi-current-color ;; term-ansi-current-bg-color) - (unless term-ansi-face-already-done (if term-ansi-current-invisible (let ((color (if term-ansi-current-reverse - (if (= term-ansi-current-color 0) - term-default-fg-color - (elt ansi-term-color-vector term-ansi-current-color)) - (if (= term-ansi-current-bg-color 0) - term-default-bg-color - (elt ansi-term-color-vector term-ansi-current-bg-color))))) + (face-foreground + (elt ansi-term-color-vector term-ansi-current-color)) + (face-background + (elt ansi-term-color-vector term-ansi-current-bg-color))))) (setq term-current-face (list :background color :foreground color)) ) ;; No need to bother with anything else if it's invisible. - (setq term-current-face - (if term-ansi-current-reverse - (if (= term-ansi-current-color 0) - (list :background term-default-fg-color - :foreground term-default-bg-color) - (list :background - (elt ansi-term-color-vector term-ansi-current-color) - :foreground - (elt ansi-term-color-vector term-ansi-current-bg-color))) - - (if (= term-ansi-current-color 0) - (list :foreground term-default-fg-color - :background term-default-bg-color) - (list :foreground - (elt ansi-term-color-vector term-ansi-current-color) - :background - (elt ansi-term-color-vector term-ansi-current-bg-color))))) + (list :foreground + (face-foreground (elt ansi-term-color-vector term-ansi-current-color)) + :background + (face-background (elt ansi-term-color-vector term-ansi-current-bg-color)) + :inverse-video term-ansi-current-reverse)) (when term-ansi-current-bold (setq term-current-face - (append term-bold-attribute term-current-face))) + (list* term-current-face :inherit 'term-bold))) + (when term-ansi-current-underline (setq term-current-face - (list* :underline t term-current-face))))) + (list* term-current-face :inherit 'term-underline))))) ;; (message "Debug %S" term-current-face) ;; FIXME: shouldn't we set term-ansi-face-already-done to t here? --Stef ------------------------------------------------------------ revno: 108786 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-06-28 06:17:30 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/config.in' --- autogen/config.in 2012-06-26 10:17:31 +0000 +++ autogen/config.in 2012-06-28 10:17:30 +0000 @@ -78,7 +78,8 @@ /* Define to the options passed to configure. */ #undef EMACS_CONFIG_OPTIONS -/* Enable expensive run-time checking of data types? */ +/* Define to 1 if expensive run-time data type and consistency checks are + enabled. */ #undef ENABLE_CHECKING /* Define to 1 if futimesat mishandles a NULL file name. */ @@ -108,6 +109,9 @@ declaration of the second argument to gettimeofday. */ #undef GETTIMEOFDAY_TIMEZONE +/* Define this to enable glyphs debugging code. */ +#undef GLYPH_DEBUG + /* Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module fscanf shall be considered present. */ #undef GNULIB_FSCANF === modified file 'autogen/configure' --- autogen/configure 2012-06-26 10:17:31 +0000 +++ autogen/configure 2012-06-28 10:17:30 +0000 @@ -2019,7 +2019,7 @@ enable expensive run-time checks. With LIST, enable only specific categories of checks. Categories are: all,yes,no. Flags are: stringbytes, stringoverrun, - stringfreelist, xmallocoverrun, conslist + stringfreelist, xmallocoverrun, conslist, glyphs --enable-check-lisp-object-type enable compile time checks for the Lisp_Object data type. This is useful for development for catching @@ -4243,19 +4243,22 @@ ac_gc_check_string_overrun= ; ac_gc_check_string_free_list= ; ac_xmalloc_overrun= ; - ac_gc_check_cons_list= ;; + ac_gc_check_cons_list= ; + ac_check_glyphs= ;; all) ac_enable_checking=1 ; ac_gc_check_stringbytes=1 ; ac_gc_check_string_overrun=1 ; ac_gc_check_string_free_list=1 ; ac_xmalloc_overrun=1 ; - ac_gc_check_cons_list=1 ;; + ac_gc_check_cons_list=1 ; + ac_check_glyphs=1 ;; # these enable particular checks stringbytes) ac_gc_check_stringbytes=1 ;; stringoverrun) ac_gc_check_string_overrun=1 ;; stringfreelist) ac_gc_check_string_free_list=1 ;; xmallocoverrun) ac_xmalloc_overrun=1 ;; conslist) ac_gc_check_cons_list=1 ;; + glyphs) ac_check_glyphs=1 ;; *) as_fn_error "unknown check category $check" "$LINENO" 5 ;; esac done @@ -4291,6 +4294,11 @@ $as_echo "#define GC_CHECK_CONS_LIST 1" >>confdefs.h fi +if test x$ac_check_glyphs != x ; then + +$as_echo "#define GLYPH_DEBUG 1" >>confdefs.h + +fi # Check whether --enable-check-lisp-object-type was given. if test "${enable_check_lisp_object_type+set}" = set; then : @@ -7779,7 +7787,9 @@ fi -# Extract the first word of "paxctl", so it can be a program name with args. + +if test $opsys = gnu-linux; then + # Extract the first word of "paxctl", so it can be a program name with args. set dummy paxctl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } @@ -7819,7 +7829,7 @@ fi - +fi ## Need makeinfo >= 4.7 (?) to build the manuals. # Extract the first word of "makeinfo", so it can be a program name with args. @@ -9292,140 +9302,146 @@ fi - if test -z "$gl_replace_getopt"; then + if test -z "$gl_replace_getopt"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5 $as_echo_n "checking whether getopt is POSIX compatible... " >&6; } if test "${gl_cv_func_getopt_posix+set}" = set; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -int *p = &optreset; return optreset; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gl_optind_min=1 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -return !getopt_clip; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_optind_min=1 -else - gl_optind_min=0 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - gl_save_CPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -DOPTIND_MIN=$gl_optind_min" - if test "$cross_compiling" = yes; then : - case "$host_os" in - mingw*) gl_cv_func_getopt_posix="guessing no";; - darwin* | aix*) gl_cv_func_getopt_posix="guessing no";; - *) gl_cv_func_getopt_posix="guessing yes";; - esac - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include - -int -main () -{ - { - static char program[] = "program"; - static char a[] = "-a"; - static char foo[] = "foo"; - static char bar[] = "bar"; - char *argv[] = { program, a, foo, bar, NULL }; - int c; - - optind = OPTIND_MIN; - opterr = 0; - - c = getopt (4, argv, "ab"); - if (!(c == 'a')) - return 1; - c = getopt (4, argv, "ab"); - if (!(c == -1)) - return 2; - if (!(optind == 2)) - return 3; - } - /* Some internal state exists at this point. */ - { - static char program[] = "program"; - static char donald[] = "donald"; - static char p[] = "-p"; - static char billy[] = "billy"; - static char duck[] = "duck"; - static char a[] = "-a"; - static char bar[] = "bar"; - char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; - int c; - - optind = OPTIND_MIN; - opterr = 0; - - c = getopt (7, argv, "+abp:q:"); - if (!(c == -1)) - return 4; - if (!(strcmp (argv[0], "program") == 0)) - return 5; - if (!(strcmp (argv[1], "donald") == 0)) - return 6; - if (!(strcmp (argv[2], "-p") == 0)) - return 7; - if (!(strcmp (argv[3], "billy") == 0)) - return 8; - if (!(strcmp (argv[4], "duck") == 0)) - return 9; - if (!(strcmp (argv[5], "-a") == 0)) - return 10; - if (!(strcmp (argv[6], "bar") == 0)) - return 11; - if (!(optind == 1)) - return 12; - } - /* Detect Mac OS X 10.5, AIX 7.1 bug. */ - { - static char program[] = "program"; - static char ab[] = "-ab"; - char *argv[3] = { program, ab, NULL }; - optind = OPTIND_MIN; - opterr = 0; - if (getopt (2, argv, "ab:") != 'a') - return 13; - if (getopt (2, argv, "ab:") != '?') - return 14; - if (optopt != 'b') - return 15; - if (optind != 2) - return 16; - } - + if test $cross_compiling = no; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char a[] = "-a"; + static char foo[] = "foo"; + static char bar[] = "bar"; + char *argv[] = { program, a, foo, bar, NULL }; + int c; + + c = getopt (4, argv, "ab"); + if (!(c == 'a')) + return 1; + c = getopt (4, argv, "ab"); + if (!(c == -1)) + return 2; + if (!(optind == 2)) + return 3; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_getopt_posix=maybe +else + gl_cv_func_getopt_posix=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + if test $gl_cv_func_getopt_posix = maybe; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char donald[] = "donald"; + static char p[] = "-p"; + static char billy[] = "billy"; + static char duck[] = "duck"; + static char a[] = "-a"; + static char bar[] = "bar"; + char *argv[] = { program, donald, p, billy, duck, a, bar, NULL }; + int c; + + c = getopt (7, argv, "+abp:q:"); + if (!(c == -1)) + return 4; + if (!(strcmp (argv[0], "program") == 0)) + return 5; + if (!(strcmp (argv[1], "donald") == 0)) + return 6; + if (!(strcmp (argv[2], "-p") == 0)) + return 7; + if (!(strcmp (argv[3], "billy") == 0)) + return 8; + if (!(strcmp (argv[4], "duck") == 0)) + return 9; + if (!(strcmp (argv[5], "-a") == 0)) + return 10; + if (!(strcmp (argv[6], "bar") == 0)) + return 11; + if (!(optind == 1)) + return 12; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_getopt_posix=maybe +else + gl_cv_func_getopt_posix=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + if test $gl_cv_func_getopt_posix = maybe; then + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + static char program[] = "program"; + static char ab[] = "-ab"; + char *argv[3] = { program, ab, NULL }; + if (getopt (2, argv, "ab:") != 'a') + return 13; + if (getopt (2, argv, "ab:") != '?') + return 14; + if (optopt != 'b') + return 15; + if (optind != 2) + return 16; return 0; } @@ -9439,7 +9455,13 @@ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - CPPFLAGS=$gl_save_CPPFLAGS + fi + else + case "$host_os" in + darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";; + *) gl_cv_func_getopt_posix="guessing yes";; + esac + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_posix" >&5 @@ -9470,11 +9492,7 @@ POSIXLY_CORRECT=1 export POSIXLY_CORRECT if test "$cross_compiling" = yes; then : - case $host_os:$ac_cv_have_decl_optreset in - *-gnu*:* | mingw*:*) gl_cv_func_getopt_gnu=no;; - *:yes) gl_cv_func_getopt_gnu=no;; - *) gl_cv_func_getopt_gnu=yes;; - esac + gl_cv_func_getopt_gnu="guessing no" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9693,7 +9711,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5 $as_echo "$gl_cv_func_getopt_gnu" >&6; } - if test "$gl_cv_func_getopt_gnu" = "no"; then + if test "$gl_cv_func_getopt_gnu" != yes; then gl_replace_getopt=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt_long function" >&5 ------------------------------------------------------------ revno: 108785 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2012-06-28 11:06:11 +0200 message: nt/nmake.defs,gmake.defs (CHECKING_FLAGS): Remove XASSERTS. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-06-24 18:31:31 +0000 +++ nt/ChangeLog 2012-06-28 09:06:11 +0000 @@ -1,3 +1,8 @@ +2012-06-28 Juanma Barranquero + + * nmake.defs (CHECKING_CFLAGS): + * gmake.defs (CHECKING_CFLAGS): Remove XASSERTS. + 2012-06-24 Eli Zaretskii * config.nt (_Noreturn): Don't reference __SUNPRO_C. === modified file 'nt/gmake.defs' --- nt/gmake.defs 2012-05-29 16:15:12 +0000 +++ nt/gmake.defs 2012-06-28 09:06:11 +0000 @@ -205,7 +205,7 @@ endif ifdef ENABLECHECKS -CHECKING_CFLAGS = -DENABLE_CHECKING -DXASSERTS -fno-crossjumping +CHECKING_CFLAGS = -DENABLE_CHECKING -fno-crossjumping else CHECKING_CFLAGS = endif === modified file 'nt/nmake.defs' --- nt/nmake.defs 2012-05-29 16:15:12 +0000 +++ nt/nmake.defs 2012-06-28 09:06:11 +0000 @@ -146,7 +146,7 @@ !endif !ifdef ENABLECHECKS -CHECKING_CFLAGS = -DENABLE_CHECKING -DXASSERTS +CHECKING_CFLAGS = -DENABLE_CHECKING !else CHECKING_CFLAGS = !endif ------------------------------------------------------------ revno: 108784 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2012-06-28 11:50:50 +0400 message: * configure.in: Add glyphs category to --enable-checking option. (GLYPH_DEBUG): Define if glyphs debugging is enabled. * src/dispextern.h (GLYPH_DEBUG): Now defined in config.h if enabled with --enable-checking=[all,glyphs] configure option. Fix GLYPH_DEBUG usage assuming that it may be undefined, adjust comments accordingly. * src/dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be undefined, adjust comments accordingly. * src/image.c: Likewise. * src/scroll.c: Likewise. * src/w32fns.c: Likewise. * src/w32term.c: Likewise. * src/xdisp.c: Likewise. * src/xfaces.c: Likewise. * src/xfns.c: Likewise. * src/xterm.c: Likewise. diff: === modified file 'ChangeLog' --- ChangeLog 2012-06-28 07:50:27 +0000 +++ ChangeLog 2012-06-28 07:50:50 +0000 @@ -1,5 +1,10 @@ 2012-06-28 Dmitry Antipov + * configure.in: Add glyphs category to --enable-checking option. + (GLYPH_DEBUG): Define if glyphs debugging is enabled. + +2012-06-28 Dmitry Antipov + * configure.in (ENABLE_CHECKING): Update comment. 2012-06-28 Paul Eggert === modified file 'configure.in' --- configure.in 2012-06-28 07:50:27 +0000 +++ configure.in 2012-06-28 07:50:50 +0000 @@ -251,7 +251,7 @@ enable only specific categories of checks. Categories are: all,yes,no. Flags are: stringbytes, stringoverrun, stringfreelist, - xmallocoverrun, conslist])], + xmallocoverrun, conslist, glyphs])], [ac_checking_flags="${enableval}"],[]) IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS," for check in $ac_checking_flags @@ -264,19 +264,22 @@ ac_gc_check_string_overrun= ; ac_gc_check_string_free_list= ; ac_xmalloc_overrun= ; - ac_gc_check_cons_list= ;; + ac_gc_check_cons_list= ; + ac_check_glyphs= ;; all) ac_enable_checking=1 ; ac_gc_check_stringbytes=1 ; ac_gc_check_string_overrun=1 ; ac_gc_check_string_free_list=1 ; ac_xmalloc_overrun=1 ; - ac_gc_check_cons_list=1 ;; + ac_gc_check_cons_list=1 ; + ac_check_glyphs=1 ;; # these enable particular checks stringbytes) ac_gc_check_stringbytes=1 ;; stringoverrun) ac_gc_check_string_overrun=1 ;; stringfreelist) ac_gc_check_string_free_list=1 ;; xmallocoverrun) ac_xmalloc_overrun=1 ;; conslist) ac_gc_check_cons_list=1 ;; + glyphs) ac_check_glyphs=1 ;; *) AC_MSG_ERROR(unknown check category $check) ;; esac done @@ -308,6 +311,10 @@ AC_DEFINE(GC_CHECK_CONS_LIST, 1, [Define this to check for errors in cons list.]) fi +if test x$ac_check_glyphs != x ; then + AC_DEFINE(GLYPH_DEBUG, 1, +[Define this to enable glyphs debugging code.]) +fi AC_ARG_ENABLE(check-lisp-object-type, [AS_HELP_STRING([--enable-check-lisp-object-type], === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-28 07:50:27 +0000 +++ src/ChangeLog 2012-06-28 07:50:50 +0000 @@ -1,5 +1,22 @@ 2012-06-28 Dmitry Antipov + * dispextern.h (GLYPH_DEBUG): Now defined in config.h if + enabled with --enable-checking=[all,glyphs] configure option. + Fix GLYPH_DEBUG usage assuming that it may be undefined, + adjust comments accordingly. + * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be + undefined, adjust comments accordingly. + * image.c: Likewise. + * scroll.c: Likewise. + * w32fns.c: Likewise. + * w32term.c: Likewise. + * xdisp.c: Likewise. + * xfaces.c: Likewise. + * xfns.c: Likewise. + * xterm.c: Likewise. + +2012-06-28 Dmitry Antipov + Generalize run-time debugging checks. * dispextern.h (XASSERTS): Remove. * fontset.c (xassert): Remove. === modified file 'src/dispextern.h' --- src/dispextern.h 2012-06-28 07:50:27 +0000 +++ src/dispextern.h 2012-06-28 07:50:50 +0000 @@ -121,26 +121,21 @@ Debugging ***********************************************************************/ -/* If GLYPH_DEBUG is non-zero, additional checks are activated. Turn - it off by defining the macro GLYPH_DEBUG to zero. */ - -#ifndef GLYPH_DEBUG -#define GLYPH_DEBUG 0 -#endif - -/* Macros to include code only if GLYPH_DEBUG != 0. */ - -#if GLYPH_DEBUG +/* If GLYPH_DEBUG is defined, additional checks are activated. */ + +/* Macros to include code only if GLYPH_DEBUG is defined. */ + +#ifdef GLYPH_DEBUG #define IF_DEBUG(X) X #else #define IF_DEBUG(X) (void) 0 #endif /* Macro for displaying traces of redisplay. If Emacs was compiled - with GLYPH_DEBUG != 0, the variable trace_redisplay_p can be set to + with GLYPH_DEBUG defined, the variable trace_redisplay_p can be set to a non-zero value in debugging sessions to activate traces. */ -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG extern int trace_redisplay_p EXTERNALLY_VISIBLE; #include @@ -151,11 +146,11 @@ else \ (void) 0 -#else /* GLYPH_DEBUG == 0 */ +#else /* not GLYPH_DEBUG */ #define TRACE(X) (void) 0 -#endif /* GLYPH_DEBUG == 0 */ +#endif /* GLYPH_DEBUG */ @@ -653,7 +648,7 @@ line. */ unsigned header_line_p : 1; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG /* A string identifying the method used to display the matrix. */ char method[512]; #endif @@ -671,7 +666,7 @@ /* Check that glyph pointers stored in glyph rows of MATRIX are okay. This aborts if any pointer is found twice. */ -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG void check_matrix_pointer_lossage (struct glyph_matrix *); #define CHECK_MATRIX(MATRIX) check_matrix_pointer_lossage ((MATRIX)) #else @@ -950,10 +945,10 @@ /* Get a pointer to row number ROW in matrix MATRIX. If GLYPH_DEBUG - is defined to a non-zero value, the function matrix_row checks that - we don't try to access rows that are out of bounds. */ + is defined, the function matrix_row checks that we don't try to + access rows that are out of bounds. */ -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG struct glyph_row *matrix_row (struct glyph_matrix *, int); #define MATRIX_ROW(MATRIX, ROW) matrix_row ((MATRIX), (ROW)) #else @@ -3067,7 +3062,7 @@ #ifdef HAVE_WINDOW_SYSTEM -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG extern void dump_glyph_string (struct glyph_string *) EXTERNALLY_VISIBLE; #endif === modified file 'src/dispnew.c' --- src/dispnew.c 2012-06-28 07:50:27 +0000 +++ src/dispnew.c 2012-06-28 07:50:50 +0000 @@ -123,7 +123,7 @@ static int scrolling_window (struct window *, int); static int update_window_line (struct window *, int, int *); static void mirror_make_current (struct window *, int); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG static void check_matrix_pointers (struct glyph_matrix *, struct glyph_matrix *); #endif @@ -211,7 +211,7 @@ /* Convert vpos and hpos from frame to window and vice versa. This may only be used for terminal frames. */ -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG static int window_to_frame_vpos (struct window *, int); static int window_to_frame_hpos (struct window *, int); @@ -311,12 +311,12 @@ } -#else /* GLYPH_DEBUG == 0 */ +#else /* not GLYPH_DEBUG */ #define WINDOW_TO_FRAME_VPOS(W, VPOS) ((VPOS) + WINDOW_TOP_EDGE_LINE (W)) #define WINDOW_TO_FRAME_HPOS(W, HPOS) ((HPOS) + WINDOW_LEFT_EDGE_COL (W)) -#endif /* GLYPH_DEBUG == 0 */ +#endif /* GLYPH_DEBUG */ #if (defined PROFILING \ @@ -419,14 +419,14 @@ return n; } -#ifdef ENABLE_CHECKING -/* Return non-zero if ROW's hash value is correct, zero if not. */ +/* Return non-zero if ROW's hash value is correct, zero if not. + Optimized away if ENABLE_CHECKING is not defined. */ + static int verify_row_hash (struct glyph_row *row) { return row->hash == row_hash (row); } -#endif /* Adjust glyph matrix MATRIX on window W or on a frame to changed window sizes. @@ -1136,7 +1136,7 @@ is non-zero if the glyph memory of WINDOW_ROW is part of the glyph memory of FRAME_ROW. */ -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG static int glyph_row_slice_p (struct glyph_row *window_row, struct glyph_row *frame_row) @@ -1451,7 +1451,7 @@ Debug Code ***********************************************************************/ -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG /* Flush standard output. This is sometimes useful to call from the debugger. @@ -1576,7 +1576,7 @@ #endif /* 0 */ -#endif /* GLYPH_DEBUG != 0 */ +#endif /* GLYPH_DEBUG */ @@ -2599,7 +2599,7 @@ SET_CHAR_GLYPH_FROM_GLYPH (*border, right_border_glyph); } -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG /* Window row window_y must be a slice of frame row frame_y. */ eassert (glyph_row_slice_p (window_row, frame_row)); @@ -3026,7 +3026,7 @@ } -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG /* Check that window and frame matrices agree about their understanding where glyphs of the rows are to find. For each @@ -3082,7 +3082,7 @@ } } -#endif /* GLYPH_DEBUG != 0 */ +#endif /* GLYPH_DEBUG */ @@ -3090,7 +3090,7 @@ VPOS and HPOS translations **********************************************************************/ -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG /* Translate vertical position VPOS which is relative to window W to a vertical position relative to W's frame. */ @@ -3302,7 +3302,7 @@ } /* Check window matrices for lost pointers. */ -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG check_window_matrix_pointers (root_window); add_frame_display_history (f, paused_p); #endif @@ -3529,7 +3529,7 @@ int preempt_count = baud_rate / 2400 + 1; #endif struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG /* Check that W's frame doesn't have glyph matrices. */ eassert (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w)))); #endif @@ -3681,7 +3681,7 @@ #endif } -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG /* Remember the redisplay method used to display the matrix. */ strcpy (w->current_matrix->method, w->desired_matrix->method); #endif @@ -3699,7 +3699,7 @@ else paused_p = 1; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG /* check_current_matrix_flags (w); */ add_window_display_history (w, w->current_matrix->method, paused_p); #endif @@ -6476,7 +6476,7 @@ defsubr (&Sinternal_show_cursor_p); defsubr (&Slast_nonminibuf_frame); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG defsubr (&Sdump_redisplay_history); #endif === modified file 'src/fontset.c' --- src/fontset.c 2012-06-28 07:50:27 +0000 +++ src/fontset.c 2012-06-28 07:50:50 +0000 @@ -197,9 +197,8 @@ Lisp_Object); static void set_fontset_font (Lisp_Object, Lisp_Object); -#ifdef ENABLE_CHECKING - -/* Return 1 if ID is a valid fontset id, else return 0. */ +/* Return 1 if ID is a valid fontset id, else return 0. + Optimized away if ENABLE_CHECKING is not defined. */ static int fontset_id_valid_p (int id) @@ -207,8 +206,6 @@ return (id >= 0 && id < ASIZE (Vfontset_table) - 1); } -#endif - /********** MACROS AND FUNCTIONS TO HANDLE FONTSET **********/ === modified file 'src/image.c' --- src/image.c 2012-06-28 07:50:27 +0000 +++ src/image.c 2012-06-28 07:50:50 +0000 @@ -8686,7 +8686,7 @@ Tests ***********************************************************************/ -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG DEFUN ("imagep", Fimagep, Simagep, 1, 1, 0, doc: /* Value is non-nil if SPEC is a valid image specification. */) @@ -8708,7 +8708,7 @@ return make_number (id); } -#endif /* GLYPH_DEBUG != 0 */ +#endif /* GLYPH_DEBUG */ /*********************************************************************** @@ -8922,7 +8922,7 @@ defsubr (&Simage_mask_p); defsubr (&Simage_metadata); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG defsubr (&Simagep); defsubr (&Slookup_image); #endif === modified file 'src/scroll.c' --- src/scroll.c 2012-06-28 07:50:27 +0000 +++ src/scroll.c 2012-06-28 07:50:50 +0000 @@ -264,7 +264,7 @@ for (k = 0; k < window_size; ++k) copy_from[k] = -1; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG # define CHECK_BOUNDS \ do \ { \ @@ -322,7 +322,7 @@ copy_from[i] = j; retained_p[j] = 1; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG CHECK_BOUNDS; #endif } @@ -374,7 +374,7 @@ mirrored_line_dance (current_matrix, unchanged_at_top, window_size, copy_from, retained_p); - /* Some sanity checks if GLYPH_DEBUG != 0. */ + /* Some sanity checks if GLYPH_DEBUG is defined. */ CHECK_MATRIX (current_matrix); if (terminal_window_p) === modified file 'src/w32fns.c' --- src/w32fns.c 2012-06-28 07:50:27 +0000 +++ src/w32fns.c 2012-06-28 07:50:50 +0000 @@ -183,7 +183,7 @@ #define MENU_FREE_DELAY 1000 static unsigned menu_free_timer = 0; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG static int image_cache_refcount, dpyinfo_refcount; #endif @@ -3996,14 +3996,14 @@ /* If frame is ``official'', nothing to do. */ if (NILP (Fmemq (frame, Vframe_list))) { -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); #endif x_free_frame_resources (f); free_glyphs (f); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG /* Check that reference counts are indeed correct. */ eassert (dpyinfo->reference_count == dpyinfo_refcount); eassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount); @@ -4160,7 +4160,7 @@ /* With FRAME_X_DISPLAY_INFO set up, this unwind-protect is safe. */ record_unwind_protect (unwind_create_frame, frame); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG image_cache_refcount = FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; dpyinfo_refcount = dpyinfo->reference_count; @@ -5237,7 +5237,7 @@ FRAME_FONTSET (f) = -1; f->icon_name = Qnil; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG image_cache_refcount = FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; dpyinfo_refcount = dpyinfo->reference_count; === modified file 'src/w32term.c' --- src/w32term.c 2012-06-28 07:50:27 +0000 +++ src/w32term.c 2012-06-28 07:50:50 +0000 @@ -231,7 +231,7 @@ static void my_set_foreground_window (HWND); static void my_destroy_window (struct frame *, HWND); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG static void x_check_font (struct frame *, struct font *); #endif @@ -6024,7 +6024,7 @@ Fonts ***********************************************************************/ -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG /* Check that FONT is valid on frame F. It is if it can be found in F's font table. */ @@ -6037,7 +6037,7 @@ eassert (font->driver->check (f, font) == 0); } -#endif /* GLYPH_DEBUG != 0 */ +#endif /* GLYPH_DEBUG */ === modified file 'src/xdisp.c' --- src/xdisp.c 2012-06-28 07:50:27 +0000 +++ src/xdisp.c 2012-06-28 07:50:50 +0000 @@ -627,10 +627,10 @@ CACHE = NULL; \ } while (0) -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG /* Non-zero means print traces of redisplay if compiled with - GLYPH_DEBUG != 0. */ + GLYPH_DEBUG defined. */ int trace_redisplay_p; @@ -2495,7 +2495,7 @@ #endif /* not 0 */ -#if GLYPH_DEBUG && defined ENABLE_CHECKING +#if defined GLYPH_DEBUG && defined ENABLE_CHECKING /* Check that the window end of window W is what we expect it to be---the last row in the current matrix displaying text. */ @@ -2521,7 +2521,7 @@ #define CHECK_WINDOW_END(W) (void) 0 -#endif +#endif /* GLYPH_DEBUG and ENABLE_CHECKING */ @@ -12435,7 +12435,7 @@ to a non-zero value. This is sometimes handy to have in a debugger session. */ -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG /* First and last unchanged row for try_window_id. */ @@ -13235,7 +13235,7 @@ /* Update hint: No need to try to scroll in update_window. */ w->desired_matrix->no_scrolling_p = 1; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG *w->desired_matrix->method = 0; debug_method_add (w, "optimization 1"); #endif @@ -13303,7 +13303,7 @@ eassert (this_line_vpos == it.vpos); eassert (this_line_y == it.current_y); set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG *w->desired_matrix->method = 0; debug_method_add (w, "optimization 3"); #endif @@ -14575,7 +14575,7 @@ /* We will never try scrolling more than this number of lines. */ int scroll_limit = SCROLL_LIMIT; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG debug_method_add (w, "try_scrolling"); #endif @@ -14927,7 +14927,7 @@ struct frame *f = XFRAME (w->frame); int rc = CURSOR_MOVEMENT_CANNOT_BE_USED; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG if (inhibit_try_cursor_movement) return rc; #endif @@ -14974,7 +14974,7 @@ int this_scroll_margin, top_scroll_margin; struct glyph_row *row = NULL; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG debug_method_add (w, "cursor movement"); #endif @@ -15332,7 +15332,7 @@ /* W must be a leaf window here. */ eassert (!NILP (w->buffer)); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG *w->desired_matrix->method = 0; #endif @@ -15624,7 +15624,7 @@ } } -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG debug_method_add (w, "forced window start"); #endif goto done; @@ -15656,7 +15656,7 @@ && !(CHARPOS (startp) <= BEGV || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n')) { -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG debug_method_add (w, "recenter 1"); #endif goto recenter; @@ -15667,7 +15667,7 @@ not work. It is 0 if unsuccessful for some other reason. */ else if ((tem = try_window_id (w)) != 0) { -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG debug_method_add (w, "try_window_id %d", tem); #endif @@ -15724,7 +15724,7 @@ goto force_start; } -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG debug_method_add (w, "same window start"); #endif @@ -15819,7 +15819,7 @@ recenter: -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG debug_method_add (w, "recenter"); #endif @@ -16307,7 +16307,7 @@ struct glyph_row *start_row; int start_vpos, min_y, max_y; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG if (inhibit_try_window_reusing) return 0; #endif @@ -16529,7 +16529,7 @@ /* Update hint: don't try scrolling again in update_window. */ w->desired_matrix->no_scrolling_p = 1; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG debug_method_add (w, "try_window_reusing_current_matrix 1"); #endif return 1; @@ -16719,7 +16719,7 @@ w->window_end_valid = Qnil; w->desired_matrix->no_scrolling_p = 1; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG debug_method_add (w, "try_window_reusing_current_matrix 2"); #endif return 1; @@ -17087,7 +17087,7 @@ struct text_pos start; ptrdiff_t first_changed_charpos, last_changed_charpos; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG if (inhibit_try_window_id) return 0; #endif @@ -17421,7 +17421,7 @@ GIVE_UP (19); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG /* Either there is no unchanged row at the end, or the one we have now displays text. This is a necessary condition for the window @@ -17435,7 +17435,7 @@ : -1); debug_first_unchanged_at_end_vpos = first_unchanged_at_end_vpos; -#endif /* GLYPH_DEBUG != 0 */ +#endif /* GLYPH_DEBUG */ /* Display new lines. Set last_text_row to the last new line @@ -17805,7 +17805,7 @@ More debugging support ***********************************************************************/ -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG void dump_glyph_row (struct glyph_row *, int, int) EXTERNALLY_VISIBLE; void dump_glyph_matrix (struct glyph_matrix *, int) EXTERNALLY_VISIBLE; @@ -22223,7 +22223,7 @@ #ifdef HAVE_WINDOW_SYSTEM -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG void dump_glyph_string (struct glyph_string *s) @@ -28408,7 +28408,7 @@ message_dolog_marker3 = Fmake_marker (); staticpro (&message_dolog_marker3); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG defsubr (&Sdump_frame_glyph_matrix); defsubr (&Sdump_glyph_matrix); defsubr (&Sdump_glyph_row); @@ -28620,7 +28620,7 @@ Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI). */); Vdisplay_pixels_per_inch = make_float (72.0); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG DEFVAR_INT ("debug-end-pos", debug_end_pos, doc: /* Don't ask. */); #endif @@ -28937,7 +28937,7 @@ doc: /* Non-nil means don't free realized faces. Internal use only. */); inhibit_free_realized_faces = 0; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG DEFVAR_BOOL ("inhibit-try-window-id", inhibit_try_window_id, doc: /* Inhibit try_window_id display optimization. */); inhibit_try_window_id = 0; === modified file 'src/xfaces.c' --- src/xfaces.c 2012-06-28 07:50:27 +0000 +++ src/xfaces.c 2012-06-28 07:50:50 +0000 @@ -441,7 +441,7 @@ /* The total number of colors currently allocated. */ -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG static int ncolors_allocated; static int npixmaps_allocated; static int ngcs; @@ -1010,7 +1010,7 @@ } else { -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG ++npixmaps_allocated; #endif if (w_ptr) @@ -1375,7 +1375,7 @@ abort (); } } -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG else ++ncolors_allocated; #endif @@ -1855,7 +1855,6 @@ #define LFACE_INHERIT(LFACE) AREF ((LFACE), LFACE_INHERIT_INDEX) #define LFACE_FONTSET(LFACE) AREF ((LFACE), LFACE_FONTSET_INDEX) -#ifdef ENABLE_CHECKING /* Non-zero if LFACE is a Lisp face. A Lisp face is a vector of size LFACE_VECTOR_SIZE which has the symbol `face' in slot 0. */ @@ -1863,10 +1862,9 @@ (VECTORP (LFACE) \ && ASIZE (LFACE) == LFACE_VECTOR_SIZE \ && EQ (AREF (LFACE, 0), Qface)) -#endif - - -#if GLYPH_DEBUG + + +#ifdef GLYPH_DEBUG /* Check consistency of Lisp face attribute vector ATTRS. */ @@ -1953,12 +1951,12 @@ } } -#else /* GLYPH_DEBUG == 0 */ +#else /* not GLYPH_DEBUG */ #define check_lface_attrs(attrs) (void) 0 #define check_lface(lface) (void) 0 -#endif /* GLYPH_DEBUG == 0 */ +#endif /* GLYPH_DEBUG */ @@ -4461,7 +4459,7 @@ break; face->id = i; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG /* Check that FACE got a unique id. */ { int j, n; @@ -4547,7 +4545,7 @@ if (face == NULL) face = realize_face (cache, attr, -1); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG eassert (face == FACE_FROM_ID (f, face->id)); #endif /* GLYPH_DEBUG */ @@ -6450,7 +6448,7 @@ Tests ***********************************************************************/ -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG /* Print the contents of the realized face FACE to stderr. */ @@ -6525,7 +6523,7 @@ return Qnil; } -#endif /* GLYPH_DEBUG != 0 */ +#endif /* GLYPH_DEBUG */ @@ -6649,7 +6647,7 @@ defsubr (&Sinternal_set_alternative_font_family_alist); defsubr (&Sinternal_set_alternative_font_registry_alist); defsubr (&Sface_attributes_as_vector); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG defsubr (&Sdump_face); defsubr (&Sshow_face_resources); #endif /* GLYPH_DEBUG */ === modified file 'src/xfns.c' --- src/xfns.c 2012-06-28 07:50:27 +0000 +++ src/xfns.c 2012-06-28 07:50:50 +0000 @@ -136,7 +136,7 @@ static Lisp_Object Qcompound_text, Qcancel_timer; Lisp_Object Qfont_param; -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG static ptrdiff_t image_cache_refcount; static int dpyinfo_refcount; #endif @@ -2914,14 +2914,14 @@ /* If frame is ``official'', nothing to do. */ if (NILP (Fmemq (frame, Vframe_list))) { -#if GLYPH_DEBUG && defined ENABLE_CHECKING +#if defined GLYPH_DEBUG && defined ENABLE_CHECKING struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); #endif x_free_frame_resources (f); free_glyphs (f); -#if GLYPH_DEBUG +#if defined GLYPH_DEBUG && defined ENABLE_CHECKING /* Check that reference counts are indeed correct. */ eassert (dpyinfo->reference_count == dpyinfo_refcount); eassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount); @@ -3296,7 +3296,7 @@ "scrollBarBackground", "ScrollBarBackground", 0); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG image_cache_refcount = FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; dpyinfo_refcount = dpyinfo->reference_count; @@ -4730,7 +4730,7 @@ x_default_parameter (f, parms, Qborder_color, build_string ("black"), "borderColor", "BorderColor", RES_TYPE_STRING); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG image_cache_refcount = FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; dpyinfo_refcount = dpyinfo->reference_count; === modified file 'src/xterm.c' --- src/xterm.c 2012-06-28 07:50:27 +0000 +++ src/xterm.c 2012-06-28 07:50:50 +0000 @@ -931,7 +931,7 @@ int, int, int, XRectangle *); static void x_scroll_bar_clear (struct frame *); -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG static void x_check_font (struct frame *, struct font *); #endif @@ -9801,7 +9801,7 @@ Fonts ***********************************************************************/ -#if GLYPH_DEBUG +#ifdef GLYPH_DEBUG /* Check that FONT is valid on frame F. It is if it can be found in F's font table. */ @@ -9814,7 +9814,7 @@ eassert (font->driver->check (f, font) == 0); } -#endif /* GLYPH_DEBUG != 0 */ +#endif /* GLYPH_DEBUG */ /*********************************************************************** ------------------------------------------------------------ revno: 108783 committer: Dmitry Antipov branch nick: trunk timestamp: Thu 2012-06-28 11:50:27 +0400 message: Generalize run-time debugging checks. * configure.in (ENABLE_CHECKING): Update comment. * src/dispextern.h (XASSERTS): Remove. * src/fontset.c (xassert): Remove. Convert from xassert to eassert. * src/alloc.c: Convert from xassert to eassert. * src/bidi.c: Likewise. * src/dispnew.c: Likewise. * src/fns.c: Likewise. * src/fringe.c: Likewise. * src/ftfont.c: Likewise. * src/gtkutil.c: Likewise. * src/image.c: Likewise. * src/keyboard.c: Likewise. * src/menu.c: Likewise. * src/process.c: Likewise. * src/scroll.c: Likewise. * src/sound.c: Likewise. * src/term.c: Likewise. * src/w32console.c: Likewise. * src/w32fns.c: Likewise. * src/w32term.c: Likewise. * src/window.c: Likewise. * src/xdisp.c: Likewise. * src/xfaces.c: Likewise. * src/xfns.c: Likewise. * src/xselect.c: Likewise. * src/xterm.c: Likewise. diff: === modified file 'ChangeLog' --- ChangeLog 2012-06-28 05:29:58 +0000 +++ ChangeLog 2012-06-28 07:50:27 +0000 @@ -1,3 +1,7 @@ +2012-06-28 Dmitry Antipov + + * configure.in (ENABLE_CHECKING): Update comment. + 2012-06-28 Paul Eggert * configure.in: Don't check for sys/select.h, sys/time.h, utime.h. === modified file 'configure.in' --- configure.in 2012-06-28 05:29:58 +0000 +++ configure.in 2012-06-28 07:50:27 +0000 @@ -284,7 +284,7 @@ if test x$ac_enable_checking != x ; then AC_DEFINE(ENABLE_CHECKING, 1, -[Enable expensive run-time checking of data types?]) +[Define to 1 if expensive run-time data type and consistency checks are enabled.]) fi if test x$ac_gc_check_stringbytes != x ; then AC_DEFINE(GC_CHECK_STRING_BYTES, 1, === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-27 21:15:13 +0000 +++ src/ChangeLog 2012-06-28 07:50:27 +0000 @@ -1,3 +1,33 @@ +2012-06-28 Dmitry Antipov + + Generalize run-time debugging checks. + * dispextern.h (XASSERTS): Remove. + * fontset.c (xassert): Remove. + Convert from xassert to eassert. + * alloc.c: Convert from xassert to eassert. + * bidi.c: Likewise. + * dispnew.c: Likewise. + * fns.c: Likewise. + * fringe.c: Likewise. + * ftfont.c: Likewise. + * gtkutil.c: Likewise. + * image.c: Likewise. + * keyboard.c: Likewise. + * menu.c: Likewise. + * process.c: Likewise. + * scroll.c: Likewise. + * sound.c: Likewise. + * term.c: Likewise. + * w32console.c: Likewise. + * w32fns.c: Likewise. + * w32term.c: Likewise. + * window.c: Likewise. + * xdisp.c: Likewise. + * xfaces.c: Likewise. + * xfns.c: Likewise. + * xselect.c: Likewise. + * xterm.c: Likewise. + 2012-06-27 Stefan Monnier * fns.c (maybe_resize_hash_table): Output message when growing the === modified file 'src/alloc.c' --- src/alloc.c 2012-06-27 15:46:48 +0000 +++ src/alloc.c 2012-06-28 07:50:27 +0000 @@ -787,7 +787,7 @@ void * xnmalloc (ptrdiff_t nitems, ptrdiff_t item_size) { - xassert (0 <= nitems && 0 < item_size); + eassert (0 <= nitems && 0 < item_size); if (min (PTRDIFF_MAX, SIZE_MAX) / item_size < nitems) memory_full (SIZE_MAX); return xmalloc (nitems * item_size); @@ -800,7 +800,7 @@ void * xnrealloc (void *pa, ptrdiff_t nitems, ptrdiff_t item_size) { - xassert (0 <= nitems && 0 < item_size); + eassert (0 <= nitems && 0 < item_size); if (min (PTRDIFF_MAX, SIZE_MAX) / item_size < nitems) memory_full (SIZE_MAX); return xrealloc (pa, nitems * item_size); @@ -850,7 +850,7 @@ ptrdiff_t nitems_incr_max = n_max - n; ptrdiff_t incr = max (nitems_incr_min, min (incr_estimate, nitems_incr_max)); - xassert (0 < item_size && 0 < nitems_incr_min && 0 <= n && -1 <= nitems_max); + eassert (0 < item_size && 0 < nitems_incr_min && 0 <= n && -1 <= nitems_max); if (! pa) *nitems = 0; if (nitems_incr_max < incr) @@ -2220,7 +2220,7 @@ for (b = oldest_sblock; b; b = b->next) { end = b->next_free; - xassert ((char *) end <= (char *) b + SBLOCK_SIZE); + eassert ((char *) end <= (char *) b + SBLOCK_SIZE); for (from = &b->first_data; from < end; from = from_end) { @@ -2271,7 +2271,7 @@ /* Copy, and update the string's `data' pointer. */ if (from != to) { - xassert (tb != b || to < from); + eassert (tb != b || to < from); memmove (to, from, nbytes + GC_STRING_EXTRA); to->string->data = SDATA_DATA (to); } === modified file 'src/bidi.c' --- src/bidi.c 2012-06-16 12:24:15 +0000 +++ src/bidi.c 2012-06-28 07:50:27 +0000 @@ -149,7 +149,7 @@ static inline void bidi_check_type (bidi_type_t type) { - xassert (UNKNOWN_BT <= type && type <= NEUTRAL_ON); + eassert (UNKNOWN_BT <= type && type <= NEUTRAL_ON); } /* Given a bidi TYPE of a character, return its category. */ @@ -263,7 +263,7 @@ int level, bidi_dir_t override) { bidi_it->stack_idx++; - xassert (bidi_it->stack_idx < BIDI_MAXLEVEL); + eassert (bidi_it->stack_idx < BIDI_MAXLEVEL); bidi_it->level_stack[bidi_it->stack_idx].level = level; bidi_it->level_stack[bidi_it->stack_idx].override = override; } @@ -458,7 +458,7 @@ ptrdiff_t i = dir ? bidi_cache_last_idx : bidi_cache_idx - 1; int incr = before ? 1 : 0; - xassert (!dir || bidi_cache_last_idx >= 0); + eassert (!dir || bidi_cache_last_idx >= 0); if (!dir) dir = -1; @@ -616,7 +616,7 @@ memcpy (&bidi_cache[bidi_cache_idx++], bidi_it, sizeof (struct bidi_it)); /* Push the current cache start onto the stack. */ - xassert (bidi_cache_sp < IT_STACK_SIZE); + eassert (bidi_cache_sp < IT_STACK_SIZE); bidi_cache_start_stack[bidi_cache_sp++] = bidi_cache_start; /* Start a new level of cache, and make it empty. */ @@ -1958,7 +1958,7 @@ case STRONG_AL: /* Actually, STRONG_AL cannot happen here, because bidi_resolve_weak converts it to STRONG_R, per W3. */ - xassert (type != STRONG_AL); + eassert (type != STRONG_AL); next_type = type; break; case WEAK_EN: === modified file 'src/dispextern.h' --- src/dispextern.h 2012-06-25 14:07:04 +0000 +++ src/dispextern.h 2012-06-28 07:50:27 +0000 @@ -128,13 +128,6 @@ #define GLYPH_DEBUG 0 #endif -/* If XASSERTS is non-zero, additional consistency checks are activated. - Turn it off by defining the macro XASSERTS to zero. */ - -#ifndef XASSERTS -#define XASSERTS 0 -#endif - /* Macros to include code only if GLYPH_DEBUG != 0. */ #if GLYPH_DEBUG @@ -143,12 +136,6 @@ #define IF_DEBUG(X) (void) 0 #endif -#if XASSERTS -#define xassert(X) do {if (!(X)) abort ();} while (0) -#else -#define xassert(X) (void) 0 -#endif - /* Macro for displaying traces of redisplay. If Emacs was compiled with GLYPH_DEBUG != 0, the variable trace_redisplay_p can be set to a non-zero value in debugging sessions to activate traces. */ === modified file 'src/dispnew.c' --- src/dispnew.c 2012-06-24 04:11:19 +0000 +++ src/dispnew.c 2012-06-28 07:50:27 +0000 @@ -419,9 +419,9 @@ return n; } -#if XASSERTS +#ifdef ENABLE_CHECKING /* Return non-zero if ROW's hash value is correct, zero if not. */ -int +static int verify_row_hash (struct glyph_row *row) { return row->hash == row_hash (row); @@ -480,7 +480,7 @@ { left = margin_glyphs_to_reserve (w, dim.width, w->left_margin_cols); right = margin_glyphs_to_reserve (w, dim.width, w->right_margin_cols); - xassert (left >= 0 && right >= 0); + eassert (left >= 0 && right >= 0); marginal_areas_changed_p = (left != matrix->left_margin_glyphs || right != matrix->right_margin_glyphs); @@ -513,7 +513,7 @@ each row into the glyph pool. */ if (matrix->pool) { - xassert (matrix->pool->glyphs); + eassert (matrix->pool->glyphs); if (w) { @@ -602,14 +602,14 @@ } } - xassert (left >= 0 && right >= 0); + eassert (left >= 0 && right >= 0); matrix->left_margin_glyphs = left; matrix->right_margin_glyphs = right; } /* Number of rows to be used by MATRIX. */ matrix->nrows = dim.height; - xassert (matrix->nrows >= 0); + eassert (matrix->nrows >= 0); if (w) { @@ -751,9 +751,9 @@ ptrdiff_t delta, ptrdiff_t delta_bytes) { /* Check that START and END are reasonable values. */ - xassert (start >= 0 && start <= matrix->nrows); - xassert (end >= 0 && end <= matrix->nrows); - xassert (start <= end); + eassert (start >= 0 && start <= matrix->nrows); + eassert (end >= 0 && end <= matrix->nrows); + eassert (start <= end); for (; start < end; ++start) increment_row_positions (matrix->rows + start, delta, delta_bytes); @@ -767,9 +767,9 @@ void enable_glyph_matrix_rows (struct glyph_matrix *matrix, int start, int end, int enabled_p) { - xassert (start <= end); - xassert (start >= 0 && start < matrix->nrows); - xassert (end >= 0 && end <= matrix->nrows); + eassert (start <= end); + eassert (start >= 0 && start < matrix->nrows); + eassert (end >= 0 && end <= matrix->nrows); for (; start < end; ++start) matrix->rows[start].enabled_p = enabled_p != 0; @@ -806,9 +806,9 @@ { int min_y, max_y; - xassert (start <= end); - xassert (start >= 0 && start < matrix->nrows); - xassert (end >= 0 && end <= matrix->nrows); + eassert (start <= end); + eassert (start >= 0 && start < matrix->nrows); + eassert (end >= 0 && end <= matrix->nrows); min_y = WINDOW_HEADER_LINE_HEIGHT (w); max_y = WINDOW_BOX_HEIGHT_NO_MODE_LINE (w); @@ -852,7 +852,7 @@ clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix); /* Clear current window matrices. */ - xassert (WINDOWP (FRAME_ROOT_WINDOW (f))); + eassert (WINDOWP (FRAME_ROOT_WINDOW (f))); clear_window_matrices (XWINDOW (FRAME_ROOT_WINDOW (f)), 0); } @@ -872,7 +872,7 @@ clear_glyph_matrix (XWINDOW (f->tool_bar_window)->desired_matrix); /* Do it for window matrices. */ - xassert (WINDOWP (FRAME_ROOT_WINDOW (f))); + eassert (WINDOWP (FRAME_ROOT_WINDOW (f))); clear_window_matrices (XWINDOW (FRAME_ROOT_WINDOW (f)), 1); } @@ -887,12 +887,12 @@ { if (!NILP (w->hchild)) { - xassert (WINDOWP (w->hchild)); + eassert (WINDOWP (w->hchild)); clear_window_matrices (XWINDOW (w->hchild), desired_p); } else if (!NILP (w->vchild)) { - xassert (WINDOWP (w->vchild)); + eassert (WINDOWP (w->vchild)); clear_window_matrices (XWINDOW (w->vchild), desired_p); } else @@ -1163,7 +1163,7 @@ { int i; - xassert (row >= 0 && row < frame_matrix->nrows); + eassert (row >= 0 && row < frame_matrix->nrows); for (i = 0; i < window_matrix->nrows; ++i) if (glyph_row_slice_p (window_matrix->rows + i, @@ -1291,8 +1291,8 @@ static inline int row_equal_p (struct glyph_row *a, struct glyph_row *b, int mouse_face_p) { - xassert (verify_row_hash (a)); - xassert (verify_row_hash (b)); + eassert (verify_row_hash (a)); + eassert (verify_row_hash (b)); if (a == b) return 1; @@ -1394,7 +1394,7 @@ { /* More freed than allocated? */ --glyph_pool_count; - xassert (glyph_pool_count >= 0); + eassert (glyph_pool_count >= 0); xfree (pool->glyphs); xfree (pool); @@ -1480,7 +1480,7 @@ for (i = 0; i < matrix->nrows; ++i) for (j = 0; j < matrix->nrows; ++j) - xassert (i == j + eassert (i == j || (matrix->rows[i].glyphs[TEXT_AREA] != matrix->rows[j].glyphs[TEXT_AREA])); } @@ -1491,8 +1491,8 @@ struct glyph_row * matrix_row (struct glyph_matrix *matrix, int row) { - xassert (matrix && matrix->rows); - xassert (row >= 0 && row < matrix->nrows); + eassert (matrix && matrix->rows); + eassert (row >= 0 && row < matrix->nrows); /* That's really too slow for normal testing because this function is called almost everywhere. Although---it's still astonishingly @@ -1539,9 +1539,9 @@ last_text_row = row; /* Check that character and byte positions are in sync. */ - xassert (MATRIX_ROW_START_BYTEPOS (row) + eassert (MATRIX_ROW_START_BYTEPOS (row) == CHAR_TO_BYTE (MATRIX_ROW_START_CHARPOS (row))); - xassert (BYTEPOS (row->start.pos) + eassert (BYTEPOS (row->start.pos) == CHAR_TO_BYTE (CHARPOS (row->start.pos))); /* CHAR_TO_BYTE aborts when invoked for a position > Z. We can @@ -1549,9 +1549,9 @@ displaying something like `[Sole completion]' at its end. */ if (MATRIX_ROW_END_CHARPOS (row) < BUF_ZV (current_buffer)) { - xassert (MATRIX_ROW_END_BYTEPOS (row) + eassert (MATRIX_ROW_END_BYTEPOS (row) == CHAR_TO_BYTE (MATRIX_ROW_END_CHARPOS (row))); - xassert (BYTEPOS (row->end.pos) + eassert (BYTEPOS (row->end.pos) == CHAR_TO_BYTE (CHARPOS (row->end.pos))); } @@ -1559,18 +1559,18 @@ of next row. */ if (next->enabled_p && MATRIX_ROW_DISPLAYS_TEXT_P (next)) { - xassert (MATRIX_ROW_END_CHARPOS (row) + eassert (MATRIX_ROW_END_CHARPOS (row) == MATRIX_ROW_START_CHARPOS (next)); - xassert (MATRIX_ROW_END_BYTEPOS (row) + eassert (MATRIX_ROW_END_BYTEPOS (row) == MATRIX_ROW_START_BYTEPOS (next)); - xassert (CHARPOS (row->end.pos) == CHARPOS (next->start.pos)); - xassert (BYTEPOS (row->end.pos) == BYTEPOS (next->start.pos)); + eassert (CHARPOS (row->end.pos) == CHARPOS (next->start.pos)); + eassert (BYTEPOS (row->end.pos) == BYTEPOS (next->start.pos)); } row = next; } - xassert (w->current_matrix->nrows == w->desired_matrix->nrows); - xassert (w->desired_matrix->rows != NULL); + eassert (w->current_matrix->nrows == w->desired_matrix->nrows); + eassert (w->desired_matrix->rows != NULL); set_buffer_temp (saved); } @@ -1997,15 +1997,15 @@ struct glyph_matrix *m = w->current_matrix; struct glyph_matrix *fm = f->current_matrix; - xassert (m->matrix_h == WINDOW_TOTAL_LINES (w)); - xassert (m->matrix_w == WINDOW_TOTAL_COLS (w)); + eassert (m->matrix_h == WINDOW_TOTAL_LINES (w)); + eassert (m->matrix_w == WINDOW_TOTAL_COLS (w)); for (i = 0; i < m->matrix_h; ++i) { struct glyph_row *r = m->rows + i; struct glyph_row *fr = fm->rows + i + WINDOW_TOP_EDGE_LINE (w); - xassert (r->glyphs[TEXT_AREA] >= fr->glyphs[TEXT_AREA] + eassert (r->glyphs[TEXT_AREA] >= fr->glyphs[TEXT_AREA] && r->glyphs[LAST_AREA] <= fr->glyphs[LAST_AREA]); r->enabled_p = fr->enabled_p; @@ -2140,7 +2140,7 @@ /* Size of frame matrices must equal size of frame. Note that we are called for X frames with window widths NOT equal to the frame width (from CHANGE_FRAME_SIZE_1). */ - xassert (matrix_dim.width == FRAME_COLS (f) + eassert (matrix_dim.width == FRAME_COLS (f) && matrix_dim.height == FRAME_LINES (f)); /* Pointers to glyph memory in glyph rows are exchanged during @@ -2184,7 +2184,7 @@ static void adjust_frame_glyphs_for_window_redisplay (struct frame *f) { - xassert (FRAME_WINDOW_P (f) && FRAME_LIVE_P (f)); + eassert (FRAME_WINDOW_P (f) && FRAME_LIVE_P (f)); /* Allocate/reallocate window matrices. */ allocate_matrices_for_window_redisplay (XWINDOW (FRAME_ROOT_WINDOW (f))); @@ -2469,7 +2469,7 @@ int i; /* F must have a frame matrix when this function is called. */ - xassert (!FRAME_WINDOW_P (f)); + eassert (!FRAME_WINDOW_P (f)); /* Clear all rows in the frame matrix covered by window matrices. Menu bar lines are not covered by windows. */ @@ -2585,7 +2585,7 @@ } else { - xassert (window_row->enabled_p); + eassert (window_row->enabled_p); /* Only when a desired row has been displayed, we want the corresponding frame row to be updated. */ @@ -2602,7 +2602,7 @@ #if GLYPH_DEBUG /* Window row window_y must be a slice of frame row frame_y. */ - xassert (glyph_row_slice_p (window_row, frame_row)); + eassert (glyph_row_slice_p (window_row, frame_row)); /* If rows are in sync, we don't have to copy glyphs because frame and window share glyphs. */ @@ -2829,8 +2829,8 @@ { int enabled_before_p = new_rows[i].enabled_p; - xassert (i + unchanged_at_top < matrix->nrows); - xassert (unchanged_at_top + copy_from[i] < matrix->nrows); + eassert (i + unchanged_at_top < matrix->nrows); + eassert (unchanged_at_top + copy_from[i] < matrix->nrows); new_rows[i] = old_rows[copy_from[i]]; new_rows[i].enabled_p = enabled_before_p; @@ -2857,8 +2857,8 @@ int left, right, x, width; /* Preconditions: W must be a leaf window on a tty frame. */ - xassert (NILP (w->hchild) && NILP (w->vchild)); - xassert (!FRAME_WINDOW_P (f)); + eassert (NILP (w->hchild) && NILP (w->vchild)); + eassert (!FRAME_WINDOW_P (f)); left = margin_glyphs_to_reserve (w, 1, w->left_margin_cols); right = margin_glyphs_to_reserve (w, 1, w->right_margin_cols); @@ -3098,10 +3098,10 @@ static int window_to_frame_vpos (struct window *w, int vpos) { - xassert (!FRAME_WINDOW_P (XFRAME (w->frame))); - xassert (vpos >= 0 && vpos <= w->desired_matrix->nrows); + eassert (!FRAME_WINDOW_P (XFRAME (w->frame))); + eassert (vpos >= 0 && vpos <= w->desired_matrix->nrows); vpos += WINDOW_TOP_EDGE_LINE (w); - xassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (w->frame))); + eassert (vpos >= 0 && vpos <= FRAME_LINES (XFRAME (w->frame))); return vpos; } @@ -3112,7 +3112,7 @@ static int window_to_frame_hpos (struct window *w, int hpos) { - xassert (!FRAME_WINDOW_P (XFRAME (w->frame))); + eassert (!FRAME_WINDOW_P (XFRAME (w->frame))); hpos += WINDOW_LEFT_EDGE_COL (w); return hpos; } @@ -3531,7 +3531,7 @@ struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); #if GLYPH_DEBUG /* Check that W's frame doesn't have glyph matrices. */ - xassert (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w)))); + eassert (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w)))); #endif /* Check pending input the first time so that we can quickly return. */ @@ -3930,7 +3930,7 @@ has to be cleared, if and only if we did a write_glyphs above. This is made sure by setting desired_stop_pos appropriately above. */ - xassert (i < desired_row->used[TEXT_AREA] + eassert (i < desired_row->used[TEXT_AREA] || ((desired_row->used[TEXT_AREA] == current_row->used[TEXT_AREA]) && MATRIX_ROW_EXTENDS_FACE_P (current_row))); @@ -4000,7 +4000,7 @@ if (desired_row->mode_line_p || desired_row->visible_height > 0) { - xassert (desired_row->enabled_p); + eassert (desired_row->enabled_p); /* Update display of the left margin area, if there is one. */ if (!desired_row->full_width_p @@ -4058,7 +4058,7 @@ int cx, cy, vpos, hpos; /* Not intended for frame matrix updates. */ - xassert (FRAME_WINDOW_P (f)); + eassert (FRAME_WINDOW_P (f)); if (cursor_in_echo_area && !NILP (echo_area_buffer[0]) @@ -4218,7 +4218,7 @@ ptrdiff_t i = row->hash % row_table_size; entry = row_table[i]; - xassert (entry || verify_row_hash (row)); + eassert (entry || verify_row_hash (row)); while (entry && !row_equal_p (entry->row, row, 1)) entry = entry->next; @@ -4432,7 +4432,7 @@ for (i = first_new; i < last_new; ++i) { - xassert (MATRIX_ROW_ENABLED_P (desired_matrix, i)); + eassert (MATRIX_ROW_ENABLED_P (desired_matrix, i)); entry = add_row_entry (MATRIX_ROW (desired_matrix, i)); ++entry->new_uses; entry->new_line_number = i; @@ -4612,7 +4612,7 @@ row. But thanks to the truncation code in the preceding for-loop, we no longer have such an overlap, and thus the assigned row should always be enabled. */ - xassert (to->enabled_p); + eassert (to->enabled_p); from->enabled_p = 0; to->overlapped_p = to_overlapped_p; } @@ -4650,7 +4650,7 @@ int pause_p; int preempt_count = baud_rate / 2400 + 1; - xassert (current_matrix && desired_matrix); + eassert (current_matrix && desired_matrix); if (baud_rate != FRAME_COST_BAUD_RATE (f)) calculate_costs (f); === modified file 'src/fns.c' --- src/fns.c 2012-06-27 21:15:13 +0000 +++ src/fns.c 2012-06-28 07:50:27 +0000 @@ -3434,8 +3434,8 @@ ptrdiff_t C_language_max = min (PTRDIFF_MAX, SIZE_MAX) / sizeof *v->contents; ptrdiff_t n_max = (0 <= nitems_max && nitems_max < C_language_max ? nitems_max : C_language_max); - xassert (VECTORP (vec)); - xassert (0 < incr_min && -1 <= nitems_max); + eassert (VECTORP (vec)); + eassert (0 < incr_min && -1 <= nitems_max); old_size = ASIZE (vec); incr_max = n_max - old_size; incr = max (incr_min, min (old_size >> 1, incr_max)); @@ -3514,7 +3514,7 @@ hashfn_eq (struct Lisp_Hash_Table *h, Lisp_Object key) { EMACS_UINT hash = XUINT (key) ^ XTYPE (key); - xassert ((hash & ~INTMASK) == 0); + eassert ((hash & ~INTMASK) == 0); return hash; } @@ -3531,7 +3531,7 @@ hash = sxhash (key, 0); else hash = XUINT (key) ^ XTYPE (key); - xassert ((hash & ~INTMASK) == 0); + eassert ((hash & ~INTMASK) == 0); return hash; } @@ -3544,7 +3544,7 @@ hashfn_equal (struct Lisp_Hash_Table *h, Lisp_Object key) { EMACS_UINT hash = sxhash (key, 0); - xassert ((hash & ~INTMASK) == 0); + eassert ((hash & ~INTMASK) == 0); return hash; } @@ -3605,11 +3605,11 @@ double index_float; /* Preconditions. */ - xassert (SYMBOLP (test)); - xassert (INTEGERP (size) && XINT (size) >= 0); - xassert ((INTEGERP (rehash_size) && XINT (rehash_size) > 0) + eassert (SYMBOLP (test)); + eassert (INTEGERP (size) && XINT (size) >= 0); + eassert ((INTEGERP (rehash_size) && XINT (rehash_size) > 0) || (FLOATP (rehash_size) && 1 < XFLOAT_DATA (rehash_size))); - xassert (FLOATP (rehash_threshold) + eassert (FLOATP (rehash_threshold) && 0 < XFLOAT_DATA (rehash_threshold) && XFLOAT_DATA (rehash_threshold) <= 1.0); @@ -3667,8 +3667,8 @@ h->next_free = make_number (0); XSET_HASH_TABLE (table, h); - xassert (HASH_TABLE_P (table)); - xassert (XHASH_TABLE (table) == h); + eassert (HASH_TABLE_P (table)); + eassert (XHASH_TABLE (table) == h); /* Maybe add this hash table to the list of all weak hash tables. */ if (NILP (h->weak)) @@ -3843,7 +3843,7 @@ { ptrdiff_t start_of_bucket, i; - xassert ((hash & ~INTMASK) == 0); + eassert ((hash & ~INTMASK) == 0); /* Increment count after resizing because resizing may fail. */ maybe_resize_hash_table (h); @@ -3902,7 +3902,7 @@ HASH_NEXT (h, i) = h->next_free; h->next_free = make_number (i); h->count--; - xassert (h->count >= 0); + eassert (h->count >= 0); break; } else === modified file 'src/fontset.c' --- src/fontset.c 2012-06-16 12:24:15 +0000 +++ src/fontset.c 2012-06-28 07:50:27 +0000 @@ -24,8 +24,6 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ -/* #define FONTSET_DEBUG */ - #include #include #include @@ -55,13 +53,6 @@ #include "font.h" -#undef xassert -#ifdef FONTSET_DEBUG -#define xassert(X) do {if (!(X)) abort ();} while (0) -#else /* not FONTSET_DEBUG */ -#define xassert(X) (void) 0 -#endif /* not FONTSET_DEBUG */ - /* FONTSET A fontset is a collection of font related information to give @@ -206,7 +197,7 @@ Lisp_Object); static void set_fontset_font (Lisp_Object, Lisp_Object); -#ifdef FONTSET_DEBUG +#ifdef ENABLE_CHECKING /* Return 1 if ID is a valid fontset id, else return 0. */ @@ -459,7 +450,7 @@ Lisp_Object base_fontset; int from = 0, to = MAX_CHAR, i; - xassert (! BASE_FONTSET_P (fontset)); + eassert (! BASE_FONTSET_P (fontset)); if (c >= 0) font_group = CHAR_TABLE_REF (fontset, c); else @@ -848,7 +839,7 @@ if (0) for (tail = FONTSET_OBJLIST (fontset); CONSP (tail); tail = XCDR (tail)) { - xassert (FONT_OBJECT_P (XCAR (tail))); + eassert (FONT_OBJECT_P (XCAR (tail))); font_close_object (f, XCAR (tail)); } #endif @@ -865,8 +856,8 @@ fontset = FONTSET_FROM_ID (face->fontset); if (NILP (fontset)) return; - xassert (! BASE_FONTSET_P (fontset)); - xassert (f == XFRAME (FONTSET_FRAME (fontset))); + eassert (! BASE_FONTSET_P (fontset)); + eassert (f == XFRAME (FONTSET_FRAME (fontset))); free_realized_fontset (f, fontset); ASET (Vfontset_table, face->fontset, Qnil); if (face->fontset < next_fontset_id) @@ -876,8 +867,8 @@ int id = XINT (FONTSET_ID (FONTSET_DEFAULT (fontset))); fontset = AREF (Vfontset_table, id); - xassert (!NILP (fontset) && ! BASE_FONTSET_P (fontset)); - xassert (f == XFRAME (FONTSET_FRAME (fontset))); + eassert (!NILP (fontset) && ! BASE_FONTSET_P (fontset)); + eassert (f == XFRAME (FONTSET_FRAME (fontset))); free_realized_fontset (f, fontset); ASET (Vfontset_table, id, Qnil); if (id < next_fontset_id) @@ -924,9 +915,9 @@ if (ASCII_CHAR_P (c) || face->fontset < 0) return face->ascii_face->id; - xassert (fontset_id_valid_p (face->fontset)); + eassert (fontset_id_valid_p (face->fontset)); fontset = FONTSET_FROM_ID (face->fontset); - xassert (!BASE_FONTSET_P (fontset)); + eassert (!BASE_FONTSET_P (fontset)); if (pos < 0) { @@ -973,7 +964,7 @@ FONTSET_NOFONT_FACE (fontset) = make_number (face_id); } } - xassert (face_id >= 0); + eassert (face_id >= 0); return face_id; } @@ -992,9 +983,9 @@ return font_object; } - xassert (fontset_id_valid_p (face->fontset)); + eassert (fontset_id_valid_p (face->fontset)); fontset = FONTSET_FROM_ID (face->fontset); - xassert (!BASE_FONTSET_P (fontset)); + eassert (!BASE_FONTSET_P (fontset)); if (pos < 0) { id = -1; @@ -2104,7 +2095,7 @@ } -#ifdef FONTSET_DEBUG +#ifdef ENABLE_CHECKING Lisp_Object dump_fontset (Lisp_Object) EXTERNALLY_VISIBLE; @@ -2154,7 +2145,7 @@ val = Fcons (dump_fontset (AREF (Vfontset_table, i)), val); return (Fnreverse (val)); } -#endif /* FONTSET_DEBUG */ +#endif /* ENABLE_CHECKING */ void syms_of_fontset (void) @@ -2245,7 +2236,7 @@ defsubr (&Sfontset_info); defsubr (&Sfontset_font); defsubr (&Sfontset_list); -#ifdef FONTSET_DEBUG +#ifdef ENABLE_CHECKING defsubr (&Sfontset_list_all); #endif } === modified file 'src/fringe.c' --- src/fringe.c 2012-06-16 12:24:15 +0000 +++ src/fringe.c 2012-06-28 07:50:27 +0000 @@ -849,7 +849,7 @@ void draw_row_fringe_bitmaps (struct window *w, struct glyph_row *row) { - xassert (interrupt_input_blocked); + eassert (interrupt_input_blocked); /* If row is completely invisible, because of vscrolling, we don't have to draw anything. */ === modified file 'src/ftfont.c' --- src/ftfont.c 2012-06-13 00:26:40 +0000 +++ src/ftfont.c 2012-06-28 07:50:27 +0000 @@ -372,7 +372,7 @@ { entity = key; val = assq_no_quit (QCfont_entity, AREF (entity, FONT_EXTRA_INDEX)); - xassert (CONSP (val)); + eassert (CONSP (val)); key = XCDR (val); } else @@ -1325,7 +1325,7 @@ val = Fcons (font->props[FONT_FILE_INDEX], make_number (ftfont_info->index)); cache = ftfont_lookup_cache (val, FTFONT_CACHE_FOR_FACE); - xassert (CONSP (cache)); + eassert (CONSP (cache)); val = XCDR (cache); (XSAVE_VALUE (val)->integer)--; if (XSAVE_VALUE (val)->integer == 0) === modified file 'src/gtkutil.c' --- src/gtkutil.c 2012-06-25 07:54:45 +0000 +++ src/gtkutil.c 2012-06-28 07:50:27 +0000 @@ -4555,7 +4555,7 @@ ? TOOL_BAR_IMAGE_DISABLED_SELECTED : TOOL_BAR_IMAGE_DISABLED_DESELECTED); - xassert (ASIZE (image) >= idx); + eassert (ASIZE (image) >= idx); image = AREF (image, idx); } else === modified file 'src/image.c' --- src/image.c 2012-06-26 05:00:30 +0000 +++ src/image.c 2012-06-28 07:50:27 +0000 @@ -522,7 +522,7 @@ } } - xassert (interrupt_input_blocked); + eassert (interrupt_input_blocked); gc = XCreateGC (FRAME_X_DISPLAY (f), mask, 0, NULL); XPutImage (FRAME_X_DISPLAY (f), mask, gc, mask_img, 0, 0, 0, 0, width, height); @@ -874,7 +874,7 @@ { Lisp_Object tail; - xassert (valid_image_p (spec)); + eassert (valid_image_p (spec)); for (tail = XCDR (spec); CONSP (tail) && CONSP (XCDR (tail)); @@ -986,11 +986,11 @@ struct image *img = (struct image *) xmalloc (sizeof *img); Lisp_Object file = image_spec_value (spec, QCfile, NULL); - xassert (valid_image_p (spec)); + eassert (valid_image_p (spec)); memset (img, 0, sizeof *img); img->dependencies = NILP (file) ? Qnil : list1 (file); img->type = lookup_image_type (image_spec_value (spec, QCtype, NULL)); - xassert (img->type != NULL); + eassert (img->type != NULL); img->spec = spec; img->lisp_data = Qnil; img->ascent = DEFAULT_IMAGE_ASCENT; @@ -1349,7 +1349,7 @@ XColor color; unsigned long result; - xassert (STRINGP (color_name)); + eassert (STRINGP (color_name)); if (x_defined_color (f, SSDATA (color_name), &color, 1) && img->ncolors < min (min (PTRDIFF_MAX, SIZE_MAX) / sizeof *img->colors, @@ -1461,7 +1461,7 @@ ptrdiff_t i; /* Cache should not be referenced by any frame when freed. */ - xassert (c->refcount == 0); + eassert (c->refcount == 0); for (i = 0; i < c->used; ++i) free_image (f, c->images[i]); @@ -1708,8 +1708,8 @@ /* F must be a window-system frame, and SPEC must be a valid image specification. */ - xassert (FRAME_WINDOW_P (f)); - xassert (valid_image_p (spec)); + eassert (FRAME_WINDOW_P (f)); + eassert (valid_image_p (spec)); /* Look up SPEC in the hash table of the image cache. */ hash = sxhash (spec, 0); @@ -1947,7 +1947,7 @@ Window window = FRAME_X_WINDOW (f); Screen *screen = FRAME_X_SCREEN (f); - xassert (interrupt_input_blocked); + eassert (interrupt_input_blocked); if (depth <= 0) depth = DefaultDepthOfScreen (screen); @@ -2085,7 +2085,7 @@ static void x_destroy_x_image (XImagePtr ximg) { - xassert (interrupt_input_blocked); + eassert (interrupt_input_blocked); if (ximg) { #ifdef HAVE_X_WINDOWS @@ -2114,7 +2114,7 @@ #ifdef HAVE_X_WINDOWS GC gc; - xassert (interrupt_input_blocked); + eassert (interrupt_input_blocked); gc = XCreateGC (FRAME_X_DISPLAY (f), pixmap, 0, NULL); XPutImage (FRAME_X_DISPLAY (f), pixmap, gc, ximg, 0, 0, 0, 0, width, height); XFreeGC (FRAME_X_DISPLAY (f), gc); @@ -2129,7 +2129,7 @@ #endif /* HAVE_NTGUI */ #ifdef HAVE_NS - xassert (ximg == pixmap); + eassert (ximg == pixmap); ns_retain_object (ximg); #endif } @@ -2319,7 +2319,7 @@ if (!parse_image_spec (object, kw, XBM_LAST, Qxbm)) return 0; - xassert (EQ (kw[XBM_TYPE].value, Qxbm)); + eassert (EQ (kw[XBM_TYPE].value, Qxbm)); if (kw[XBM_FILE].count) { @@ -2780,7 +2780,7 @@ int non_default_colors = 0; Lisp_Object value; - xassert (img->width > 0 && img->height > 0); + eassert (img->width > 0 && img->height > 0); /* Get foreground and background colors, maybe allocate colors. */ value = image_spec_value (img->spec, QCforeground, NULL); @@ -2840,7 +2840,7 @@ int success_p = 0; Lisp_Object file_name; - xassert (xbm_image_p (img->spec)); + eassert (xbm_image_p (img->spec)); /* If IMG->spec specifies a file name, create a non-file spec from it. */ file_name = image_spec_value (img->spec, QCfile, NULL); @@ -2886,14 +2886,14 @@ memcpy (fmt, xbm_format, sizeof fmt); parsed_p = parse_image_spec (img->spec, fmt, XBM_LAST, Qxbm); (void) parsed_p; - xassert (parsed_p); + eassert (parsed_p); /* Get specified width, and height. */ if (!in_memory_file_p) { img->width = XFASTINT (fmt[XBM_WIDTH].value); img->height = XFASTINT (fmt[XBM_HEIGHT].value); - xassert (img->width > 0 && img->height > 0); + eassert (img->width > 0 && img->height > 0); if (!check_image_size (f, img->width, img->height)) { image_error ("Invalid image size (see `max-image-size')", @@ -3580,7 +3580,7 @@ img->width = attrs.width; img->height = attrs.height; - xassert (img->width > 0 && img->height > 0); + eassert (img->width > 0 && img->height > 0); /* The call to XpmFreeAttributes below frees attrs.alloc_pixels. */ #ifdef HAVE_NTGUI @@ -5551,7 +5551,7 @@ static _Noreturn void my_png_error (png_struct *png_ptr, const char *msg) { - xassert (png_ptr != NULL); + eassert (png_ptr != NULL); /* Avoid compiler warning about deprecated direct access to png_ptr's fields in libpng versions 1.4.x. */ image_error ("PNG error: %s", build_string (msg), Qnil); @@ -5562,7 +5562,7 @@ static void my_png_warning (png_struct *png_ptr, const char *msg) { - xassert (png_ptr != NULL); + eassert (png_ptr != NULL); image_error ("PNG warning: %s", build_string (msg), Qnil); } @@ -5832,7 +5832,7 @@ images with alpha channel, i.e. RGBA. If conversions above were sufficient we should only have 3 or 4 channels here. */ channels = fn_png_get_channels (png_ptr, info_ptr); - xassert (channels == 3 || channels == 4); + eassert (channels == 3 || channels == 4); /* Number of bytes needed for one row of the image. */ row_bytes = fn_png_get_rowbytes (png_ptr, info_ptr); @@ -8540,7 +8540,7 @@ img->height = in_height; /* Create the pixmap. */ - xassert (img->pixmap == NO_PIXMAP); + eassert (img->pixmap == NO_PIXMAP); if (x_check_image_size (0, img->width, img->height)) { @@ -8611,7 +8611,7 @@ /* Kill the GS process. We should have found PIXMAP in the image cache and its image should contain a process object. */ img = c->images[i]; - xassert (PROCESSP (img->lisp_data)); + eassert (PROCESSP (img->lisp_data)); Fkill_process (img->lisp_data, Qnil); img->lisp_data = Qnil; === modified file 'src/keyboard.c' --- src/keyboard.c 2012-06-25 10:28:47 +0000 +++ src/keyboard.c 2012-06-28 07:50:27 +0000 @@ -1752,7 +1752,7 @@ && (beg < PT /* && end > PT <- It's always the case. */ || (beg <= PT && STRINGP (val) && SCHARS (val) == 0))) { - xassert (end > PT); + eassert (end > PT); SET_PT (PT < last_pt ? (STRINGP (val) && SCHARS (val) == 0 ? max (beg - 1, BEGV) @@ -1834,7 +1834,7 @@ #if 0 /* This assertion isn't correct, because SET_PT may end up setting the point to something other than its argument, due to point-motion hooks, intangibility, etc. */ - xassert (PT == beg || PT == end); + eassert (PT == beg || PT == end); #endif /* Pretend the area doesn't exist if the buffer is not === modified file 'src/menu.c' --- src/menu.c 2012-06-25 10:28:47 +0000 +++ src/menu.c 2012-06-28 07:50:27 +0000 @@ -129,7 +129,7 @@ menu_items = Qnil; menu_items_allocated = 0; } - xassert (NILP (menu_items_inuse)); + eassert (NILP (menu_items_inuse)); } #ifdef HAVE_NS === modified file 'src/process.c' --- src/process.c 2012-06-26 14:41:01 +0000 +++ src/process.c 2012-06-28 07:50:27 +0000 @@ -353,7 +353,7 @@ void add_read_fd (int fd, fd_callback func, void *data) { - xassert (fd < MAXDESC); + eassert (fd < MAXDESC); add_keyboard_wait_descriptor (fd); fd_callback_info[fd].func = func; @@ -366,7 +366,7 @@ void delete_read_fd (int fd) { - xassert (fd < MAXDESC); + eassert (fd < MAXDESC); delete_keyboard_wait_descriptor (fd); fd_callback_info[fd].condition &= ~FOR_READ; @@ -383,7 +383,7 @@ void add_write_fd (int fd, fd_callback func, void *data) { - xassert (fd < MAXDESC); + eassert (fd < MAXDESC); FD_SET (fd, &write_mask); if (fd > max_input_desc) max_input_desc = fd; @@ -400,7 +400,7 @@ { int lim = max_input_desc; - xassert (fd < MAXDESC); + eassert (fd < MAXDESC); FD_CLR (fd, &write_mask); fd_callback_info[fd].condition &= ~FOR_WRITE; if (fd_callback_info[fd].condition == 0) === modified file 'src/scroll.c' --- src/scroll.c 2012-02-10 18:58:48 +0000 +++ src/scroll.c 2012-06-28 07:50:27 +0000 @@ -270,7 +270,7 @@ { \ int ck; \ for (ck = 0; ck < window_size; ++ck) \ - xassert (copy_from[ck] == -1 \ + eassert (copy_from[ck] == -1 \ || (copy_from[ck] >= 0 && copy_from[ck] < window_size)); \ } \ while (0); @@ -317,8 +317,8 @@ { /* Best thing done here is no insert or delete, i.e. a write. */ --i, --j; - xassert (i >= 0 && i < window_size); - xassert (j >= 0 && j < window_size); + eassert (i >= 0 && i < window_size); + eassert (j >= 0 && j < window_size); copy_from[i] = j; retained_p[j] = 1; @@ -368,7 +368,7 @@ } for (k = 0; k < window_size; ++k) - xassert (copy_from[k] >= 0 && copy_from[k] < window_size); + eassert (copy_from[k] >= 0 && copy_from[k] < window_size); /* Perform the row swizzling. */ mirrored_line_dance (current_matrix, unchanged_at_top, window_size, @@ -728,7 +728,7 @@ place they belong. */ int n_to_write = p->writecount; write_follows_p = 1; - xassert (n_to_write > 0); + eassert (n_to_write > 0); if (i > j) { === modified file 'src/sound.c' --- src/sound.c 2012-06-24 17:39:14 +0000 +++ src/sound.c 2012-06-28 07:50:27 +0000 @@ -733,7 +733,7 @@ { int val; - xassert (sd->fd >= 0); + eassert (sd->fd >= 0); /* On GNU/Linux, it seems that the device driver doesn't like to be interrupted by a signal. Block the ones we know to cause @@ -962,7 +962,7 @@ struct alsa_params *p = (struct alsa_params *) sd->data; snd_pcm_uframes_t buffer_size; - xassert (p->handle != 0); + eassert (p->handle != 0); err = snd_pcm_hw_params_malloc (&p->hwparams); if (err < 0) === modified file 'src/term.c' --- src/term.c 2012-06-26 05:40:33 +0000 +++ src/term.c 2012-06-28 07:50:27 +0000 @@ -1459,7 +1459,7 @@ struct glyph *glyph, *end; int i; - xassert (it->glyph_row); + eassert (it->glyph_row); glyph = (it->glyph_row->glyphs[it->area] + it->glyph_row->used[it->area]); end = it->glyph_row->glyphs[1 + it->area]; @@ -1546,7 +1546,7 @@ /* If a hook is installed, let it do the work. */ /* Nothing but characters are supported on terminal frames. */ - xassert (it->what == IT_CHARACTER + eassert (it->what == IT_CHARACTER || it->what == IT_COMPOSITION || it->what == IT_STRETCH || it->what == IT_GLYPHLESS); @@ -1633,7 +1633,7 @@ { Lisp_Object acronym = lookup_glyphless_char_display (-1, it); - xassert (it->what == IT_GLYPHLESS); + eassert (it->what == IT_GLYPHLESS); produce_glyphless_glyph (it, 1, acronym); } } @@ -1657,7 +1657,7 @@ { struct glyph *glyph; - xassert (it->glyph_row); + eassert (it->glyph_row); glyph = it->glyph_row->glyphs[it->area] + it->glyph_row->used[it->area]; if (glyph < it->glyph_row->glyphs[1 + it->area]) { @@ -1749,7 +1749,7 @@ struct glyph *glyph, *end; int i; - xassert (it->glyph_row); + eassert (it->glyph_row); glyph = it->glyph_row->glyphs[it->area] + it->glyph_row->used[it->area]; end = it->glyph_row->glyphs[1 + it->area]; @@ -1871,7 +1871,7 @@ } else { - xassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEX_CODE); + eassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEX_CODE); len = (it->c < 0x10000 ? sprintf (buf, "\\u%04X", it->c) : it->c <= MAX_UNICODE_CHAR ? sprintf (buf, "\\U%06X", it->c) : sprintf (buf, "\\x%06X", it->c)); @@ -2067,7 +2067,7 @@ struct face *face = FACE_FROM_ID (f, face_id); struct tty_display_info *tty = FRAME_TTY (f); - xassert (face != NULL); + eassert (face != NULL); if (tty->TS_exit_attribute_mode) { === modified file 'src/w32console.c' --- src/w32console.c 2012-05-26 09:31:59 +0000 +++ src/w32console.c 2012-06-28 07:50:27 +0000 @@ -616,7 +616,7 @@ WORD char_attr; struct face *face = FACE_FROM_ID (f, face_id); - xassert (face != NULL); + eassert (face != NULL); char_attr = char_attr_normal; === modified file 'src/w32fns.c' --- src/w32fns.c 2012-06-16 12:24:15 +0000 +++ src/w32fns.c 2012-06-28 07:50:27 +0000 @@ -4005,8 +4005,8 @@ #if GLYPH_DEBUG /* Check that reference counts are indeed correct. */ - xassert (dpyinfo->reference_count == dpyinfo_refcount); - xassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount); + eassert (dpyinfo->reference_count == dpyinfo_refcount); + eassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount); #endif return Qt; } === modified file 'src/w32term.c' --- src/w32term.c 2012-06-23 12:39:23 +0000 +++ src/w32term.c 2012-06-28 07:50:27 +0000 @@ -742,7 +742,7 @@ struct frame *f; int width, height; - xassert (w); + eassert (w); if (!desired_row->mode_line_p && !w->pseudo_window_p) desired_row->redraw_fringe_bitmaps_p = 1; @@ -1086,7 +1086,7 @@ s->gc = FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc; } - xassert (s->gc != 0); + eassert (s->gc != 0); } @@ -1143,7 +1143,7 @@ } /* GC must have been set. */ - xassert (s->gc != 0); + eassert (s->gc != 0); } @@ -1560,7 +1560,7 @@ delta /= 256; /* Change RGB values by specified FACTOR. Avoid overflow! */ - xassert (factor >= 0); + eassert (factor >= 0); new = PALETTERGB (min (0xff, factor * GetRValue (*color)), min (0xff, factor * GetGValue (*color)), min (0xff, factor * GetBValue (*color))); @@ -2237,7 +2237,7 @@ static void x_draw_stretch_glyph_string (struct glyph_string *s) { - xassert (s->first_glyph->type == STRETCH_GLYPH); + eassert (s->first_glyph->type == STRETCH_GLYPH); if (s->hl == DRAW_CURSOR && !x_stretch_cursor_p) @@ -6032,9 +6032,9 @@ static void x_check_font (struct frame *f, struct font *font) { - xassert (font != NULL && ! NILP (font->props[FONT_TYPE_INDEX])); + eassert (font != NULL && ! NILP (font->props[FONT_TYPE_INDEX])); if (font->driver->check) - xassert (font->driver->check (f, font) == 0); + eassert (font->driver->check (f, font) == 0); } #endif /* GLYPH_DEBUG != 0 */ === modified file 'src/window.c' --- src/window.c 2012-06-26 14:41:01 +0000 +++ src/window.c 2012-06-28 07:50:27 +0000 @@ -2035,7 +2035,7 @@ candidate_p = 1; else if (NILP (all_frames)) { - xassert (WINDOWP (owindow)); + eassert (WINDOWP (owindow)); candidate_p = EQ (w->frame, XWINDOW (owindow)->frame); } else if (EQ (all_frames, Qvisible)) @@ -4010,8 +4010,8 @@ struct window *r; Lisp_Object root, value; - xassert (MINI_WINDOW_P (w)); - xassert (delta >= 0); + eassert (MINI_WINDOW_P (w)); + eassert (delta >= 0); root = FRAME_ROOT_WINDOW (f); r = XWINDOW (root); @@ -4043,7 +4043,7 @@ Lisp_Object root, value; EMACS_INT size; - xassert (MINI_WINDOW_P (w)); + eassert (MINI_WINDOW_P (w)); size = XINT (w->total_lines); if (size > 1) @@ -4721,7 +4721,7 @@ { ptrdiff_t count = SPECPDL_INDEX (); - xassert (eabs (direction) == 1); + eassert (eabs (direction) == 1); /* If selected window's buffer isn't current, make it current for the moment. But don't screw up if window_scroll gets an error. */ @@ -5686,7 +5686,7 @@ if (NILP (leaf_windows[i]->buffer)) { /* Assert it's not reused as a combination. */ - xassert (NILP (leaf_windows[i]->hchild) + eassert (NILP (leaf_windows[i]->hchild) && NILP (leaf_windows[i]->vchild)); free_window_matrices (leaf_windows[i]); } === modified file 'src/xdisp.c' --- src/xdisp.c 2012-06-26 02:33:51 +0000 +++ src/xdisp.c 2012-06-28 07:50:27 +0000 @@ -1025,7 +1025,7 @@ struct frame *f = XFRAME (w->frame); int height = WINDOW_TOTAL_HEIGHT (w); - xassert (height >= 0); + eassert (height >= 0); /* Note: the code below that determines the mode-line/header-line height is essentially the same as that contained in the macro @@ -1511,7 +1511,7 @@ --g; top_x -= g->pixel_width; } - xassert (g < it3.glyph_row->glyphs[TEXT_AREA] + eassert (g < it3.glyph_row->glyphs[TEXT_AREA] + it3.glyph_row->used[TEXT_AREA]); } } @@ -1606,7 +1606,7 @@ static struct text_pos string_pos_nchars_ahead (struct text_pos pos, Lisp_Object string, ptrdiff_t nchars) { - xassert (STRINGP (string) && nchars >= 0); + eassert (STRINGP (string) && nchars >= 0); if (STRING_MULTIBYTE (string)) { @@ -1635,8 +1635,8 @@ string_pos (ptrdiff_t charpos, Lisp_Object string) { struct text_pos pos; - xassert (STRINGP (string)); - xassert (charpos >= 0); + eassert (STRINGP (string)); + eassert (charpos >= 0); SET_TEXT_POS (pos, charpos, string_char_to_byte (string, charpos)); return pos; } @@ -1651,8 +1651,8 @@ { struct text_pos pos; - xassert (s != NULL); - xassert (charpos >= 0); + eassert (s != NULL); + eassert (charpos >= 0); if (multibyte_p) { @@ -1708,8 +1708,8 @@ static void compute_string_pos (struct text_pos *newpos, struct text_pos pos, Lisp_Object string) { - xassert (STRINGP (string)); - xassert (CHARPOS (*newpos) >= CHARPOS (pos)); + eassert (STRINGP (string)); + eassert (CHARPOS (*newpos) >= CHARPOS (pos)); if (STRING_MULTIBYTE (string)) *newpos = string_pos_nchars_ahead (pos, string, @@ -2467,23 +2467,23 @@ { if (it->method == GET_FROM_STRING) { - xassert (STRINGP (it->string)); - xassert (IT_STRING_CHARPOS (*it) >= 0); + eassert (STRINGP (it->string)); + eassert (IT_STRING_CHARPOS (*it) >= 0); } else { - xassert (IT_STRING_CHARPOS (*it) < 0); + eassert (IT_STRING_CHARPOS (*it) < 0); if (it->method == GET_FROM_BUFFER) { /* Check that character and byte positions agree. */ - xassert (IT_CHARPOS (*it) == BYTE_TO_CHAR (IT_BYTEPOS (*it))); + eassert (IT_CHARPOS (*it) == BYTE_TO_CHAR (IT_BYTEPOS (*it))); } } if (it->dpvec) - xassert (it->current.dpvec_index >= 0); + eassert (it->current.dpvec_index >= 0); else - xassert (it->current.dpvec_index < 0); + eassert (it->current.dpvec_index < 0); } #define CHECK_IT(IT) check_it ((IT)) @@ -2495,7 +2495,7 @@ #endif /* not 0 */ -#if GLYPH_DEBUG && XASSERTS +#if GLYPH_DEBUG && defined ENABLE_CHECKING /* Check that the window end of window W is what we expect it to be---the last row in the current matrix displaying text. */ @@ -2507,7 +2507,7 @@ && !NILP (w->window_end_valid)) { struct glyph_row *row; - xassert ((row = MATRIX_ROW (w->current_matrix, + eassert ((row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)), !row->enabled_p || MATRIX_ROW_DISPLAYS_TEXT_P (row) @@ -2557,8 +2557,8 @@ enum face_id remapped_base_face_id = base_face_id; /* Some precondition checks. */ - xassert (w != NULL && it != NULL); - xassert (charpos < 0 || (charpos >= BUF_BEG (current_buffer) + eassert (w != NULL && it != NULL); + eassert (charpos < 0 || (charpos >= BUF_BEG (current_buffer) && charpos <= ZV)); /* If face attributes have been changed since the last redisplay, @@ -2719,14 +2719,14 @@ if (it->line_wrap == TRUNCATE) { /* We will need the truncation glyph. */ - xassert (it->glyph_row == NULL); + eassert (it->glyph_row == NULL); produce_special_glyphs (it, IT_TRUNCATION); it->truncation_pixel_width = it->pixel_width; } else { /* We will need the continuation glyph. */ - xassert (it->glyph_row == NULL); + eassert (it->glyph_row == NULL); produce_special_glyphs (it, IT_CONTINUATION); it->continuation_pixel_width = it->pixel_width; } @@ -3056,7 +3056,7 @@ relative_index = (it->current.overlay_string_index % OVERLAY_STRING_CHUNK_SIZE); it->string = it->overlay_strings[relative_index]; - xassert (STRINGP (it->string)); + eassert (STRINGP (it->string)); it->current.string_pos = pos->string_pos; it->method = GET_FROM_STRING; } @@ -3067,7 +3067,7 @@ string. This can only be a string from a `display' property. IT should already be filled with that string. */ it->current.string_pos = pos->string_pos; - xassert (STRINGP (it->string)); + eassert (STRINGP (it->string)); } /* Restore position in display vector translations, control @@ -3076,7 +3076,7 @@ { if (it->dpvec == NULL) get_next_display_element (it); - xassert (it->dpvec && it->current.dpvec_index == 0); + eassert (it->dpvec && it->current.dpvec_index == 0); it->current.dpvec_index = pos->dpvec_index; } @@ -3342,7 +3342,7 @@ stoppos, it->string); } - xassert (STRINGP (it->string) + eassert (STRINGP (it->string) || (it->stop_charpos >= BEGV && it->stop_charpos >= IT_CHARPOS (*it))); } @@ -3558,7 +3558,7 @@ val = Vfontification_functions; specbind (Qfontification_functions, Qnil); - xassert (it->end_charpos == ZV); + eassert (it->end_charpos == ZV); if (!CONSP (val) || EQ (XCAR (val), Qlambda)) safe_call1 (val, pos); @@ -3790,7 +3790,7 @@ { int face_id = it->base_face_id, i; - xassert (STRINGP (it->string)); + eassert (STRINGP (it->string)); for (i = it->sp - 1; i >= 0; --i) if (NILP (it->stack[i].string)) @@ -3813,7 +3813,7 @@ struct it it_copy; void *it_copy_data = NULL; - xassert (it->s == NULL); + eassert (it->s == NULL); if (STRINGP (it->string)) { @@ -3879,7 +3879,7 @@ charpos = it_copy.bidi_it.charpos; } } - xassert (0 <= charpos && charpos <= SCHARS (it->string)); + eassert (0 <= charpos && charpos <= SCHARS (it->string)); if (it->current.overlay_string_index >= 0) bufpos = IT_CHARPOS (*it); @@ -3979,7 +3979,7 @@ it_copy.bidi_it.charpos, it_copy.bidi_it.bytepos); } } - xassert (BEGV <= CHARPOS (pos) && CHARPOS (pos) <= ZV); + eassert (BEGV <= CHARPOS (pos) && CHARPOS (pos) <= ZV); /* Determine face for CHARSET_ASCII, or unibyte. */ face_id = face_at_buffer_position (it->w, @@ -5237,7 +5237,7 @@ it->ellipsis_p = (it->stack[it->sp - 1].display_ellipsis_p != 0); pop_it (it); - xassert (it->sp > 0 + eassert (it->sp > 0 || (NILP (it->string) && it->method == GET_FROM_BUFFER && it->stop_charpos >= BEGV @@ -5418,7 +5418,7 @@ for (ov = current_buffer->overlays_before; ov; ov = ov->next) { XSETMISC (overlay, ov); - xassert (OVERLAYP (overlay)); + eassert (OVERLAYP (overlay)); start = OVERLAY_POSITION (OVERLAY_START (overlay)); end = OVERLAY_POSITION (OVERLAY_END (overlay)); @@ -5458,7 +5458,7 @@ for (ov = current_buffer->overlays_after; ov; ov = ov->next) { XSETMISC (overlay, ov); - xassert (OVERLAYP (overlay)); + eassert (OVERLAYP (overlay)); start = OVERLAY_POSITION (OVERLAY_START (overlay)); end = OVERLAY_POSITION (OVERLAY_END (overlay)); @@ -5546,11 +5546,11 @@ strings. */ if (compute_stop_p) compute_stop_pos (it); - xassert (it->face_id >= 0); + eassert (it->face_id >= 0); /* Save IT's settings. They are restored after all overlay strings have been processed. */ - xassert (!compute_stop_p || it->sp == 0); + eassert (!compute_stop_p || it->sp == 0); /* When called from handle_stop, there might be an empty display string loaded. In that case, don't bother saving it. But @@ -5570,7 +5570,7 @@ it->string = it->overlay_strings[0]; it->from_overlay = Qnil; it->stop_charpos = 0; - xassert (STRINGP (it->string)); + eassert (STRINGP (it->string)); it->end_charpos = SCHARS (it->string); it->prev_stop = 0; it->base_level_stop = 0; @@ -5636,14 +5636,14 @@ { struct iterator_stack_entry *p; - xassert (it->sp < IT_STACK_SIZE); + eassert (it->sp < IT_STACK_SIZE); p = it->stack + it->sp; p->stop_charpos = it->stop_charpos; p->prev_stop = it->prev_stop; p->base_level_stop = it->base_level_stop; p->cmp_it = it->cmp_it; - xassert (it->face_id >= 0); + eassert (it->face_id >= 0); p->face_id = it->face_id; p->string = it->string; p->method = it->method; @@ -5690,7 +5690,7 @@ ptrdiff_t eob = (buffer_p ? ZV : it->end_charpos); ptrdiff_t bob = (buffer_p ? BEGV : 0); - xassert (eob >= CHARPOS (it->position) && CHARPOS (it->position) >= bob); + eassert (eob >= CHARPOS (it->position) && CHARPOS (it->position) >= bob); /* Maybe initialize paragraph direction. If we are at the beginning of a new paragraph, next_element_from_buffer may not have a @@ -5729,7 +5729,7 @@ struct iterator_stack_entry *p; int from_display_prop = it->from_disp_prop_p; - xassert (it->sp > 0); + eassert (it->sp > 0); --it->sp; p = it->stack + it->sp; it->stop_charpos = p->stop_charpos; @@ -5799,7 +5799,7 @@ && (it->method == GET_FROM_BUFFER || it->method == GET_FROM_STRING)) iterate_out_of_display_property (it); - xassert ((BUFFERP (it->object) + eassert ((BUFFERP (it->object) && IT_CHARPOS (*it) == it->bidi_it.charpos && IT_BYTEPOS (*it) == it->bidi_it.bytepos) || (STRINGP (it->object) @@ -5896,7 +5896,7 @@ ptrdiff_t limit = find_next_newline_no_quit (start, 1); Lisp_Object pos; - xassert (!STRINGP (it->string)); + eassert (!STRINGP (it->string)); /* If there isn't any `display' property in sight, and no overlays, we can just use the position of the newline in @@ -6035,8 +6035,8 @@ it->continuation_lines_width = 0; - xassert (IT_CHARPOS (*it) >= BEGV); - xassert (IT_CHARPOS (*it) == BEGV + eassert (IT_CHARPOS (*it) >= BEGV); + eassert (IT_CHARPOS (*it) == BEGV || FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n'); CHECK_IT (it); } @@ -6078,7 +6078,7 @@ && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it), it->selective)) { - xassert (IT_BYTEPOS (*it) == BEGV + eassert (IT_BYTEPOS (*it) == BEGV || FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n'); newline_found_p = forward_to_next_line_start (it, &skipped_p, &bidi_it_prev); @@ -6192,10 +6192,10 @@ reseat_1 (struct it *it, struct text_pos pos, int set_stop_p) { /* Don't call this function when scanning a C string. */ - xassert (it->s == NULL); + eassert (it->s == NULL); /* POS must be a reasonable value. */ - xassert (CHARPOS (pos) >= BEGV && CHARPOS (pos) <= ZV); + eassert (CHARPOS (pos) >= BEGV && CHARPOS (pos) <= ZV); it->current.pos = it->position = pos; it->end_charpos = ZV; @@ -6268,7 +6268,7 @@ memset (&it->current, 0, sizeof it->current); it->current.overlay_string_index = -1; it->current.dpvec_index = -1; - xassert (charpos >= 0); + eassert (charpos >= 0); /* If STRING is specified, use its multibyteness, otherwise use the setting of MULTIBYTE, if specified. */ @@ -6285,7 +6285,7 @@ if (s == NULL) { - xassert (STRINGP (string)); + eassert (STRINGP (string)); it->string = string; it->s = NULL; it->end_charpos = it->string_nchars = SCHARS (string); @@ -6528,7 +6528,7 @@ if (! it->multibyte_p && ! ASCII_CHAR_P (c)) { - xassert (SINGLE_BYTE_CHAR_P (c)); + eassert (SINGLE_BYTE_CHAR_P (c)); if (unibyte_display_via_language_environment) { c = DECODE_CHAR (unibyte, c); @@ -6981,7 +6981,7 @@ } else { - xassert (it->len != 0); + eassert (it->len != 0); if (!it->bidi_p) { @@ -7009,7 +7009,7 @@ IT_BYTEPOS (*it), stop, Qnil); } } - xassert (IT_BYTEPOS (*it) == CHAR_TO_BYTE (IT_CHARPOS (*it))); + eassert (IT_BYTEPOS (*it) == CHAR_TO_BYTE (IT_CHARPOS (*it))); } break; @@ -7081,7 +7081,7 @@ case GET_FROM_STRING: /* Current display element is a character from a Lisp string. */ - xassert (it->s == NULL && STRINGP (it->string)); + eassert (it->s == NULL && STRINGP (it->string)); /* Don't advance past string end. These conditions are true when set_iterator_to_next is called at the end of get_next_display_element, in which case the Lisp string is @@ -7230,7 +7230,7 @@ /* The position etc with which we have to proceed are on the stack. The position may be at the end of a string, if the `display' property takes up the whole string. */ - xassert (it->sp > 0); + eassert (it->sp > 0); pop_it (it); if (it->method == GET_FROM_STRING) goto consider_string_end; @@ -7241,7 +7241,7 @@ abort (); } - xassert (it->method != GET_FROM_STRING + eassert (it->method != GET_FROM_STRING || (STRINGP (it->string) && IT_STRING_CHARPOS (*it) >= 0)); } @@ -7261,7 +7261,7 @@ Lisp_Object gc; /* Precondition. */ - xassert (it->dpvec && it->current.dpvec_index >= 0); + eassert (it->dpvec && it->current.dpvec_index >= 0); it->face_id = it->saved_face_id; @@ -7379,7 +7379,7 @@ if (STRINGP (it->string)) { - xassert (!it->s); + eassert (!it->s); stop = SCHARS (it->string); if (stop > it->end_charpos) stop = it->end_charpos; @@ -7409,9 +7409,9 @@ { struct text_pos position; - xassert (STRINGP (it->string)); - xassert (!it->bidi_p || EQ (it->string, it->bidi_it.string.lstring)); - xassert (IT_STRING_CHARPOS (*it) >= 0); + eassert (STRINGP (it->string)); + eassert (!it->bidi_p || EQ (it->string, it->bidi_it.string.lstring)); + eassert (IT_STRING_CHARPOS (*it) >= 0); position = it->current.string_pos; /* With bidi reordering, the character to display might not be the @@ -7575,8 +7575,8 @@ { int success_p = 1; - xassert (it->s); - xassert (!it->bidi_p || it->s == it->bidi_it.string.s); + eassert (it->s); + eassert (!it->bidi_p || it->s == it->bidi_it.string.s); it->what = IT_CHARACTER; BYTEPOS (it->position) = CHARPOS (it->position) = 0; it->object = Qnil; @@ -7681,8 +7681,8 @@ ptrdiff_t save_stop_pos = it->stop_charpos; ptrdiff_t save_end_pos = it->end_charpos; - xassert (NILP (it->string) && !it->s); - xassert (it->bidi_p); + eassert (NILP (it->string) && !it->s); + eassert (it->bidi_p); it->bidi_p = 0; do { @@ -7727,7 +7727,7 @@ ptrdiff_t next_stop; /* Scan in strict logical order. */ - xassert (it->bidi_p); + eassert (it->bidi_p); it->bidi_p = 0; do { @@ -7766,9 +7766,9 @@ { int success_p = 1; - xassert (IT_CHARPOS (*it) >= BEGV); - xassert (NILP (it->string) && !it->s); - xassert (!it->bidi_p + eassert (IT_CHARPOS (*it) >= BEGV); + eassert (NILP (it->string) && !it->s); + eassert (!it->bidi_p || (EQ (it->bidi_it.string.lstring, Qnil) && it->bidi_it.string.s == NULL)); @@ -7927,7 +7927,7 @@ } /* Value is zero if end of buffer reached. */ - xassert (!success_p || it->what != IT_CHARACTER || it->len > 0); + eassert (!success_p || it->what != IT_CHARACTER || it->len > 0); return success_p; } @@ -7941,7 +7941,7 @@ /* IT->glyph_row should be non-null, i.e. we should be actually displaying something, or otherwise we should not run the hook. */ - xassert (it->glyph_row); + eassert (it->glyph_row); /* Set up hook arguments. */ args[0] = Qredisplay_end_trigger_functions; @@ -8434,7 +8434,7 @@ necessary here because of lines consisting of a line end, only. The line end will not produce any glyphs and we would never get MOVE_X_REACHED. */ - xassert (it->nglyphs == 0); + eassert (it->nglyphs == 0); result = MOVE_X_REACHED; break; } @@ -8884,7 +8884,7 @@ ptrdiff_t start_pos; move_further_back: - xassert (dy >= 0); + eassert (dy >= 0); start_pos = IT_CHARPOS (*it); @@ -8927,11 +8927,11 @@ || (it2.method == GET_FROM_STRING && IT_CHARPOS (it2) == start_pos && SREF (it2.string, IT_STRING_BYTEPOS (it2) - 1) == '\n'))); - xassert (IT_CHARPOS (*it) >= BEGV); + eassert (IT_CHARPOS (*it) >= BEGV); SAVE_IT (it3, it2, it3data); move_it_to (&it2, start_pos, -1, -1, -1, MOVE_TO_POS); - xassert (IT_CHARPOS (*it) >= BEGV); + eassert (IT_CHARPOS (*it) >= BEGV); /* H is the actual vertical distance from the position in *IT and the starting position. */ h = it2.current_y - it->current_y; @@ -9942,13 +9942,13 @@ if (clear_buffer_p && Z > BEG) del_range (BEG, Z); - xassert (BEGV >= BEG); - xassert (ZV <= Z && ZV >= BEGV); + eassert (BEGV >= BEG); + eassert (ZV <= Z && ZV >= BEGV); rc = fn (a1, a2, a3, a4); - xassert (BEGV >= BEG); - xassert (ZV <= Z && ZV >= BEGV); + eassert (BEGV >= BEG); + eassert (ZV <= Z && ZV >= BEGV); unbind_to (count, Qnil); return rc; @@ -9990,7 +9990,7 @@ ASET (vector, i, Qnil); } - xassert (i == ASIZE (vector)); + eassert (i == ASIZE (vector)); return vector; } @@ -10229,7 +10229,7 @@ struct frame *f = XFRAME (w->frame); int window_height_changed_p = 0; - xassert (MINI_WINDOW_P (w)); + eassert (MINI_WINDOW_P (w)); /* By default, start display at the beginning. */ set_marker_both (w->start, w->buffer, @@ -10420,7 +10420,7 @@ { Lisp_Object msg; - xassert (CONSP (Vmessage_stack)); + eassert (CONSP (Vmessage_stack)); msg = XCAR (Vmessage_stack); if (STRINGP (msg)) message3_nolog (msg, SBYTES (msg), STRING_MULTIBYTE (msg)); @@ -10443,7 +10443,7 @@ static void pop_message (void) { - xassert (CONSP (Vmessage_stack)); + eassert (CONSP (Vmessage_stack)); Vmessage_stack = XCDR (Vmessage_stack); } @@ -11522,7 +11522,7 @@ ? TOOL_BAR_IMAGE_DISABLED_SELECTED : TOOL_BAR_IMAGE_DISABLED_DESELECTED); - xassert (ASIZE (image) >= idx); + eassert (ASIZE (image) >= idx); image = AREF (image, idx); } else @@ -12808,7 +12808,7 @@ Lisp_Object old = selected_frame; struct Lisp_Symbol *sym; - xassert (FRAMEP (frame) && FRAME_LIVE_P (XFRAME (frame))); + eassert (FRAMEP (frame) && FRAME_LIVE_P (XFRAME (frame))); selected_frame = frame; @@ -13300,8 +13300,8 @@ && (row = MATRIX_ROW (w->current_matrix, this_line_vpos), row->enabled_p)) { - xassert (this_line_vpos == it.vpos); - xassert (this_line_y == it.current_y); + eassert (this_line_vpos == it.vpos); + eassert (this_line_y == it.current_y); set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0); #if GLYPH_DEBUG *w->desired_matrix->method = 0; @@ -13869,7 +13869,7 @@ /* Don't even try doing anything if called for a mode-line or header-line row, since the rest of the code isn't prepared to deal with such calamities. */ - xassert (!row->mode_line_p); + eassert (!row->mode_line_p); if (row->mode_line_p) return 0; @@ -15017,7 +15017,7 @@ while (MATRIX_ROW_END_CHARPOS (row) < PT && MATRIX_ROW_BOTTOM_Y (row) < last_y) { - xassert (row->enabled_p); + eassert (row->enabled_p); ++row; } @@ -15060,7 +15060,7 @@ && (row->y > top_scroll_margin || CHARPOS (startp) == BEGV)) { - xassert (row->enabled_p); + eassert (row->enabled_p); --row; } @@ -15130,7 +15130,7 @@ rc = CURSOR_MOVEMENT_MUST_SCROLL; break; } - xassert (row->enabled_p); + eassert (row->enabled_p); } } if (must_scroll) @@ -15331,7 +15331,7 @@ opoint = lpoint; /* W must be a leaf window here. */ - xassert (!NILP (w->buffer)); + eassert (!NILP (w->buffer)); #if GLYPH_DEBUG *w->desired_matrix->method = 0; #endif @@ -15911,7 +15911,7 @@ } move_it_vertically_backward (&it, centering_position); - xassert (IT_CHARPOS (it) >= BEGV); + eassert (IT_CHARPOS (it) >= BEGV); /* The function move_it_vertically_backward may move over more than the specified y-distance. If it->w is small, e.g. a @@ -16260,14 +16260,14 @@ window_end_vpos to its row number. */ if (last_text_row) { - xassert (MATRIX_ROW_DISPLAYS_TEXT_P (last_text_row)); + eassert (MATRIX_ROW_DISPLAYS_TEXT_P (last_text_row)); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); w->window_end_pos = make_number (Z - MATRIX_ROW_END_CHARPOS (last_text_row)); w->window_end_vpos = make_number (MATRIX_ROW_VPOS (last_text_row, w->desired_matrix)); - xassert (MATRIX_ROW (w->desired_matrix, XFASTINT (w->window_end_vpos)) + eassert (MATRIX_ROW (w->desired_matrix, XFASTINT (w->window_end_vpos)) ->displays_text_p); } else @@ -16576,7 +16576,7 @@ } /* Start displaying at the start of first_row_to_display. */ - xassert (first_row_to_display->y < yb); + eassert (first_row_to_display->y < yb); init_to_row_start (&it, w, first_row_to_display); nrows_scrolled = (MATRIX_ROW_VPOS (first_reusable_row, w->current_matrix) @@ -16648,7 +16648,7 @@ } /* Scroll the current matrix. */ - xassert (nrows_scrolled > 0); + eassert (nrows_scrolled > 0); rotate_matrix (w->current_matrix, start_vpos, MATRIX_ROW_VPOS (bottom_row, w->current_matrix), @@ -16760,7 +16760,7 @@ row = start ? start : MATRIX_FIRST_TEXT_ROW (matrix); while (MATRIX_ROW_DISPLAYS_TEXT_P (row)) { - xassert (row->enabled_p); + eassert (row->enabled_p); row_found = row; if (MATRIX_ROW_BOTTOM_Y (row) >= it->last_visible_y) break; @@ -16922,9 +16922,9 @@ /* Preconditions: W must be a leaf window and full-width. Its frame must have a frame matrix. */ - xassert (NILP (w->hchild) && NILP (w->vchild)); - xassert (WINDOW_FULL_WIDTH_P (w)); - xassert (!FRAME_WINDOW_P (f)); + eassert (NILP (w->hchild) && NILP (w->vchild)); + eassert (WINDOW_FULL_WIDTH_P (w)); + eassert (!FRAME_WINDOW_P (f)); /* If W is a full-width window, glyph pointers in W's current matrix have, by definition, to be the same as glyph pointers in the @@ -17361,7 +17361,7 @@ it.glyph_row = MATRIX_ROW (desired_matrix, it.vpos); it.current_y = MATRIX_ROW_BOTTOM_Y (last_unchanged_at_beg_row); - xassert (it.hpos == 0 && it.current_x == 0); + eassert (it.hpos == 0 && it.current_x == 0); } else { @@ -17391,7 +17391,7 @@ stop_pos = 0; if (first_unchanged_at_end_row) { - xassert (last_unchanged_at_beg_row == NULL + eassert (last_unchanged_at_beg_row == NULL || first_unchanged_at_end_row >= last_unchanged_at_beg_row); /* If this is a continuation line, move forward to the next one @@ -17414,7 +17414,7 @@ + delta); first_unchanged_at_end_vpos = MATRIX_ROW_VPOS (first_unchanged_at_end_row, current_matrix); - xassert (stop_pos >= Z - END_UNCHANGED); + eassert (stop_pos >= Z - END_UNCHANGED); } } else if (last_unchanged_at_beg_row == NULL) @@ -17426,7 +17426,7 @@ /* Either there is no unchanged row at the end, or the one we have now displays text. This is a necessary condition for the window end pos calculation at the end of this function. */ - xassert (first_unchanged_at_end_row == NULL + eassert (first_unchanged_at_end_row == NULL || MATRIX_ROW_DISPLAYS_TEXT_P (first_unchanged_at_end_row)); debug_last_unchanged_at_beg_vpos @@ -17671,7 +17671,7 @@ struct glyph_row *last_row = MATRIX_ROW (current_matrix, last_vpos); /* If last_row is the window end line, it should display text. */ - xassert (last_row->displays_text_p); + eassert (last_row->displays_text_p); /* If window end line was partially visible before, begin displaying at that line. Otherwise begin displaying with the @@ -17718,16 +17718,16 @@ matrix. Set row to the last row displaying text in current matrix starting at first_unchanged_at_end_row, after scrolling. */ - xassert (first_unchanged_at_end_row->displays_text_p); + eassert (first_unchanged_at_end_row->displays_text_p); row = find_last_row_displaying_text (w->current_matrix, &it, first_unchanged_at_end_row); - xassert (row && MATRIX_ROW_DISPLAYS_TEXT_P (row)); + eassert (row && MATRIX_ROW_DISPLAYS_TEXT_P (row)); w->window_end_pos = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); w->window_end_vpos = make_number (MATRIX_ROW_VPOS (row, w->current_matrix)); - xassert (w->window_end_bytepos >= 0); + eassert (w->window_end_bytepos >= 0); IF_DEBUG (debug_method_add (w, "A")); } else if (last_text_row_at_end) @@ -17738,7 +17738,7 @@ = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row_at_end); w->window_end_vpos = make_number (MATRIX_ROW_VPOS (last_text_row_at_end, desired_matrix)); - xassert (w->window_end_bytepos >= 0); + eassert (w->window_end_bytepos >= 0); IF_DEBUG (debug_method_add (w, "B")); } else if (last_text_row) @@ -17752,7 +17752,7 @@ = Z_BYTE - MATRIX_ROW_END_BYTEPOS (last_text_row); w->window_end_vpos = make_number (MATRIX_ROW_VPOS (last_text_row, desired_matrix)); - xassert (w->window_end_bytepos >= 0); + eassert (w->window_end_bytepos >= 0); } else if (first_unchanged_at_end_row == NULL && last_text_row == NULL @@ -17778,11 +17778,11 @@ row = current_row; } - xassert (row != NULL); + eassert (row != NULL); w->window_end_vpos = make_number (vpos + 1); w->window_end_pos = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); w->window_end_bytepos = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); - xassert (w->window_end_bytepos >= 0); + eassert (w->window_end_bytepos >= 0); IF_DEBUG (debug_method_add (w, "C")); } else @@ -18196,7 +18196,7 @@ struct it truncate_it; struct glyph *from, *end, *to, *toend; - xassert (!FRAME_WINDOW_P (it->f)); + eassert (!FRAME_WINDOW_P (it->f)); /* Get the truncation glyphs. */ truncate_it = *it; @@ -18329,8 +18329,8 @@ for (i = 0; i < row->used[TEXT_AREA]; ++i) row->pixel_width += row->glyphs[TEXT_AREA][i].pixel_width; - xassert (row->pixel_width >= 0); - xassert (row->ascent >= 0 && row->height > 0); + eassert (row->pixel_width >= 0); + eassert (row->ascent >= 0 && row->height > 0); row->overlapping_p = (MATRIX_ROW_OVERLAPS_SUCC_P (row) || MATRIX_ROW_OVERLAPS_PRED_P (row)); @@ -18803,7 +18803,7 @@ struct text_pos pos = STRINGP (it->string) ? it->current.string_pos : it->current.pos; - xassert (it->method == GET_FROM_BUFFER + eassert (it->method == GET_FROM_BUFFER || it->method == GET_FROM_DISPLAY_VECTOR || it->method == GET_FROM_STRING); @@ -18930,10 +18930,10 @@ { struct glyph *glyph, *end; - xassert (it->glyph_row); - xassert (it->glyph_row->reversed_p); - xassert (it->area == TEXT_AREA); - xassert (n <= it->glyph_row->used[TEXT_AREA]); + eassert (it->glyph_row); + eassert (it->glyph_row->reversed_p); + eassert (it->area == TEXT_AREA); + eassert (n <= it->glyph_row->used[TEXT_AREA]); if (n > it->glyph_row->used[TEXT_AREA]) n = it->glyph_row->used[TEXT_AREA]; @@ -19122,7 +19122,7 @@ ptrdiff_t min_bpos IF_LINT (= 0), max_bpos IF_LINT (= 0); /* We always start displaying at hpos zero even if hscrolled. */ - xassert (it->hpos == 0 && it->current_x == 0); + eassert (it->hpos == 0 && it->current_x == 0); if (MATRIX_ROW_VPOS (row, it->w->desired_matrix) >= it->w->desired_matrix->nrows) @@ -19541,7 +19541,7 @@ move_it_in_display_line at the start of this function, unless the text display area of the window is empty. */ - xassert (it->first_visible_x <= it->last_visible_x); + eassert (it->first_visible_x <= it->last_visible_x); } } /* Even if this display element produced no glyphs at all, @@ -19733,7 +19733,7 @@ } else { - xassert (INTEGERP (overlay_arrow_string)); + eassert (INTEGERP (overlay_arrow_string)); row->overlay_arrow_bitmap = XINT (overlay_arrow_string); } overlay_arrow_seen = 1; @@ -19936,7 +19936,7 @@ #endif /* HAVE_NS */ #ifdef USE_X_TOOLKIT - xassert (!FRAME_WINDOW_P (f)); + eassert (!FRAME_WINDOW_P (f)); init_iterator (&it, w, -1, -1, f->desired_matrix->rows, MENU_FACE_ID); it.first_visible_x = 0; it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f); @@ -19946,7 +19946,7 @@ /* Menu bar lines are displayed in the desired matrix of the dummy window menu_bar_window. */ struct window *menu_w; - xassert (WINDOWP (f->menu_bar_window)); + eassert (WINDOWP (f->menu_bar_window)); menu_w = XWINDOW (f->menu_bar_window); init_iterator (&it, menu_w, -1, -1, menu_w->desired_matrix->rows, MENU_FACE_ID); @@ -22042,7 +22042,7 @@ if (NILP (prop)) return OK_PIXELS (0); - xassert (FRAME_LIVE_P (it->f)); + eassert (FRAME_LIVE_P (it->f)); if (SYMBOLP (prop)) { @@ -22369,7 +22369,7 @@ if (display_p) #endif { - xassert (face != NULL); + eassert (face != NULL); PREPARE_FACE_FOR_DISPLAY (f, face); } @@ -22387,7 +22387,7 @@ { struct face *face; - xassert (glyph->type == CHAR_GLYPH); + eassert (glyph->type == CHAR_GLYPH); face = FACE_FROM_ID (f, glyph->face_id); if (two_byte_p) @@ -22409,7 +22409,7 @@ } /* Make sure X resources of the face are allocated. */ - xassert (face != NULL); + eassert (face != NULL); PREPARE_FACE_FOR_DISPLAY (f, face); return face; } @@ -22455,7 +22455,7 @@ glyph that requires the different face, add it to S. */ struct face *face; - xassert (s); + eassert (s); s->for_overlaps = overlaps; s->face = NULL; @@ -22565,7 +22565,7 @@ struct glyph *glyph, *last; int voffset; - xassert (s->first_glyph->type == GLYPHLESS_GLYPH); + eassert (s->first_glyph->type == GLYPHLESS_GLYPH); s->for_overlaps = overlaps; glyph = s->row->glyphs[s->area] + start; last = s->row->glyphs[s->area] + end; @@ -22606,9 +22606,9 @@ int voffset; int glyph_not_available_p; - xassert (s->f == XFRAME (s->w->frame)); - xassert (s->nchars == 0); - xassert (start >= 0 && end > start); + eassert (s->f == XFRAME (s->w->frame)); + eassert (s->nchars == 0); + eassert (start >= 0 && end > start); s->for_overlaps = overlaps; glyph = s->row->glyphs[s->area] + start; @@ -22631,7 +22631,7 @@ &two_byte_p); s->two_byte_p = two_byte_p; ++s->nchars; - xassert (s->nchars <= end - start); + eassert (s->nchars <= end - start); s->width += glyph->pixel_width; if (glyph++->padding_p != s->padding_p) break; @@ -22652,7 +22652,7 @@ /* Adjust base line for subscript/superscript text. */ s->ybase += voffset; - xassert (s->face && s->face->gc); + eassert (s->face && s->face->gc); return glyph - s->row->glyphs[s->area]; } @@ -22662,9 +22662,9 @@ static void fill_image_glyph_string (struct glyph_string *s) { - xassert (s->first_glyph->type == IMAGE_GLYPH); + eassert (s->first_glyph->type == IMAGE_GLYPH); s->img = IMAGE_FROM_ID (s->f, s->first_glyph->u.img_id); - xassert (s->img); + eassert (s->img); s->slice = s->first_glyph->slice.img; s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); s->font = s->face->font; @@ -22688,7 +22688,7 @@ struct glyph *glyph, *last; int voffset, face_id; - xassert (s->first_glyph->type == STRETCH_GLYPH); + eassert (s->first_glyph->type == STRETCH_GLYPH); glyph = s->row->glyphs[s->area] + start; last = s->row->glyphs[s->area] + end; @@ -22712,7 +22712,7 @@ /* The case that face->gc == 0 is handled when drawing the glyph string by calling PREPARE_FACE_FOR_DISPLAY. */ - xassert (s->face); + eassert (s->face); return glyph - s->row->glyphs[s->area]; } @@ -23458,8 +23458,8 @@ struct glyph *glyph; enum glyph_row_area area = it->area; - xassert (it->glyph_row); - xassert (it->char_to_display != '\n' && it->char_to_display != '\t'); + eassert (it->glyph_row); + eassert (it->char_to_display != '\n' && it->char_to_display != '\t'); glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; if (glyph < it->glyph_row->glyphs[area + 1]) @@ -23532,7 +23532,7 @@ struct glyph *glyph; enum glyph_row_area area = it->area; - xassert (it->glyph_row); + eassert (it->glyph_row); glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; if (glyph < it->glyph_row->glyphs[area + 1]) @@ -23624,10 +23624,10 @@ int glyph_ascent, crop; struct glyph_slice slice; - xassert (it->what == IT_IMAGE); + eassert (it->what == IT_IMAGE); face = FACE_FROM_ID (it->f, it->face_id); - xassert (face); + eassert (face); /* Make sure X resources of the face is loaded. */ PREPARE_FACE_FOR_DISPLAY (it->f, face); @@ -23642,7 +23642,7 @@ } img = IMAGE_FROM_ID (it->f, it->image_id); - xassert (img); + eassert (img); /* Make sure X resources of the image is loaded. */ prepare_image_for_display (it->f, img); @@ -23783,7 +23783,7 @@ struct glyph *glyph; enum glyph_row_area area = it->area; - xassert (ascent >= 0 && ascent <= height); + eassert (ascent >= 0 && ascent <= height); glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area]; if (glyph < it->glyph_row->glyphs[area + 1]) @@ -23893,7 +23893,7 @@ #endif /* List should start with `space'. */ - xassert (CONSP (it->object) && EQ (XCAR (it->object), Qspace)); + eassert (CONSP (it->object) && EQ (XCAR (it->object), Qspace)); plist = XCDR (it->object); /* Compute the width of the stretch. */ @@ -24272,7 +24272,7 @@ } else { - xassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEX_CODE); + eassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEX_CODE); sprintf (buf, "%0*X", it->c < 0x10000 ? 4 : 6, it->c); str = buf; } @@ -24374,7 +24374,7 @@ Vglyphless_char_display. */ Lisp_Object acronym = lookup_glyphless_char_display (-1, it); - xassert (it->what == IT_GLYPHLESS); + eassert (it->what == IT_GLYPHLESS); produce_glyphless_glyph (it, 1, STRINGP (acronym) ? acronym : Qnil); goto done; } @@ -24999,7 +24999,7 @@ done: /* Accumulate dimensions. Note: can't assume that it->descent > 0 because this isn't true for images with `:ascent 100'. */ - xassert (it->ascent >= 0 && it->descent >= 0); + eassert (it->ascent >= 0 && it->descent >= 0); if (it->area == TEXT_AREA) it->current_x += it->pixel_width; @@ -25028,7 +25028,7 @@ { int x, hpos, chpos = updated_window->phys_cursor.hpos; - xassert (updated_window && updated_row); + eassert (updated_window && updated_row); /* When the window is hscrolled, cursor hpos can legitimately be out of bounds, but we draw the cursor at the corresponding window margin in that case. */ @@ -25077,7 +25077,7 @@ int frame_x, frame_y; ptrdiff_t hpos; - xassert (updated_window && updated_row); + eassert (updated_window && updated_row); BLOCK_INPUT; w = updated_window; f = XFRAME (WINDOW_FRAME (w)); @@ -25132,7 +25132,7 @@ int max_x, min_y, max_y; int from_x, from_y, to_y; - xassert (updated_window && updated_row); + eassert (updated_window && updated_row); f = XFRAME (w->frame); if (updated_row->full_width_p) @@ -25757,7 +25757,7 @@ || (0 <= hpos && hpos < glyph_row->used[TEXT_AREA])) glyph = glyph_row->glyphs[TEXT_AREA] + hpos; - xassert (interrupt_input_blocked); + eassert (interrupt_input_blocked); /* Set new_cursor_type to the cursor we want to be displayed. */ new_cursor_type = get_window_cursor_type (w, glyph, @@ -26304,9 +26304,9 @@ ptrdiff_t ignore, pos; int x; - xassert (NILP (disp_string) || STRINGP (disp_string)); - xassert (NILP (before_string) || STRINGP (before_string)); - xassert (NILP (after_string) || STRINGP (after_string)); + eassert (NILP (disp_string) || STRINGP (disp_string)); + eassert (NILP (before_string) || STRINGP (before_string)); + eassert (NILP (after_string) || STRINGP (after_string)); /* Find the rows corresponding to START_CHARPOS and END_CHARPOS. */ rows_from_pos_range (w, start_charpos, end_charpos, disp_string, &r1, &r2); @@ -27922,7 +27922,7 @@ static int expose_line (struct window *w, struct glyph_row *row, XRectangle *r) { - xassert (row->enabled_p); + eassert (row->enabled_p); if (row->mode_line_p || w->pseudo_window_p) draw_glyphs (w, 0, row, TEXT_AREA, @@ -27962,7 +27962,7 @@ for (row = first_overlapping_row; row <= last_overlapping_row; ++row) if (row->overlapping_p) { - xassert (row->enabled_p && !row->mode_line_p); + eassert (row->enabled_p && !row->mode_line_p); row->clip = r; if (row->used[LEFT_MARGIN_AREA]) === modified file 'src/xfaces.c' --- src/xfaces.c 2012-06-25 14:07:04 +0000 +++ src/xfaces.c 2012-06-28 07:50:27 +0000 @@ -539,7 +539,7 @@ void register_color (unsigned long pixel) { - xassert (pixel < 256); + eassert (pixel < 256); ++color_count[pixel]; } @@ -549,7 +549,7 @@ void unregister_color (unsigned long pixel) { - xassert (pixel < 256); + eassert (pixel < 256); if (color_count[pixel] > 0) --color_count[pixel]; else @@ -663,7 +663,7 @@ x_free_gc (struct frame *f, GC gc) { eassert (interrupt_input_blocked); - IF_DEBUG (xassert (--ngcs >= 0)); + IF_DEBUG (eassert (--ngcs >= 0)); XFreeGC (FRAME_X_DISPLAY (f), gc); } @@ -689,7 +689,7 @@ static inline void x_free_gc (struct frame *f, GC gc) { - IF_DEBUG (xassert (--ngcs >= 0)); + IF_DEBUG (eassert (--ngcs >= 0)); xfree (gc); } @@ -1325,8 +1325,8 @@ { XColor color; - xassert (STRINGP (name)); - xassert (target_index == LFACE_FOREGROUND_INDEX + eassert (STRINGP (name)); + eassert (target_index == LFACE_FOREGROUND_INDEX || target_index == LFACE_BACKGROUND_INDEX || target_index == LFACE_UNDERLINE_INDEX || target_index == LFACE_OVERLINE_INDEX @@ -1855,7 +1855,7 @@ #define LFACE_INHERIT(LFACE) AREF ((LFACE), LFACE_INHERIT_INDEX) #define LFACE_FONTSET(LFACE) AREF ((LFACE), LFACE_FONTSET_INDEX) -#if XASSERTS +#ifdef ENABLE_CHECKING /* Non-zero if LFACE is a Lisp face. A Lisp face is a vector of size LFACE_VECTOR_SIZE which has the symbol `face' in slot 0. */ @@ -1873,68 +1873,68 @@ static void check_lface_attrs (Lisp_Object *attrs) { - xassert (UNSPECIFIEDP (attrs[LFACE_FAMILY_INDEX]) + eassert (UNSPECIFIEDP (attrs[LFACE_FAMILY_INDEX]) || IGNORE_DEFFACE_P (attrs[LFACE_FAMILY_INDEX]) || STRINGP (attrs[LFACE_FAMILY_INDEX])); - xassert (UNSPECIFIEDP (attrs[LFACE_FOUNDRY_INDEX]) + eassert (UNSPECIFIEDP (attrs[LFACE_FOUNDRY_INDEX]) || IGNORE_DEFFACE_P (attrs[LFACE_FOUNDRY_INDEX]) || STRINGP (attrs[LFACE_FOUNDRY_INDEX])); - xassert (UNSPECIFIEDP (attrs[LFACE_SWIDTH_INDEX]) + eassert (UNSPECIFIEDP (attrs[LFACE_SWIDTH_INDEX]) || IGNORE_DEFFACE_P (attrs[LFACE_SWIDTH_INDEX]) || SYMBOLP (attrs[LFACE_SWIDTH_INDEX])); - xassert (UNSPECIFIEDP (attrs[LFACE_HEIGHT_INDEX]) + eassert (UNSPECIFIEDP (attrs[LFACE_HEIGHT_INDEX]) || IGNORE_DEFFACE_P (attrs[LFACE_HEIGHT_INDEX]) || INTEGERP (attrs[LFACE_HEIGHT_INDEX]) || FLOATP (attrs[LFACE_HEIGHT_INDEX]) || FUNCTIONP (attrs[LFACE_HEIGHT_INDEX])); - xassert (UNSPECIFIEDP (attrs[LFACE_WEIGHT_INDEX]) + eassert (UNSPECIFIEDP (attrs[LFACE_WEIGHT_INDEX]) || IGNORE_DEFFACE_P (attrs[LFACE_WEIGHT_INDEX]) || SYMBOLP (attrs[LFACE_WEIGHT_INDEX])); - xassert (UNSPECIFIEDP (attrs[LFACE_SLANT_INDEX]) + eassert (UNSPECIFIEDP (attrs[LFACE_SLANT_INDEX]) || IGNORE_DEFFACE_P (attrs[LFACE_SLANT_INDEX]) || SYMBOLP (attrs[LFACE_SLANT_INDEX])); - xassert (UNSPECIFIEDP (attrs[LFACE_UNDERLINE_INDEX]) + eassert (UNSPECIFIEDP (attrs[LFACE_UNDERLINE_INDEX]) || IGNORE_DEFFACE_P (attrs[LFACE_UNDERLINE_INDEX]) || SYMBOLP (attrs[LFACE_UNDERLINE_INDEX]) || STRINGP (attrs[LFACE_UNDERLINE_INDEX]) || CONSP (attrs[LFACE_UNDERLINE_INDEX])); - xassert (UNSPECIFIEDP (attrs[LFACE_OVERLINE_INDEX]) + eassert (UNSPECIFIEDP (attrs[LFACE_OVERLINE_INDEX]) || IGNORE_DEFFACE_P (attrs[LFACE_OVERLINE_INDEX]) || SYMBOLP (attrs[LFACE_OVERLINE_INDEX]) || STRINGP (attrs[LFACE_OVERLINE_INDEX])); - xassert (UNSPECIFIEDP (attrs[LFACE_STRIKE_THROUGH_INDEX]) + eassert (UNSPECIFIEDP (attrs[LFACE_STRIKE_THROUGH_INDEX]) || IGNORE_DEFFACE_P (attrs[LFACE_STRIKE_THROUGH_INDEX]) || SYMBOLP (attrs[LFACE_STRIKE_THROUGH_INDEX]) || STRINGP (attrs[LFACE_STRIKE_THROUGH_INDEX])); - xassert (UNSPECIFIEDP (attrs[LFACE_BOX_INDEX]) + eassert (UNSPECIFIEDP (attrs[LFACE_BOX_INDEX]) || IGNORE_DEFFACE_P (attrs[LFACE_BOX_INDEX]) || SYMBOLP (attrs[LFACE_BOX_INDEX]) || STRINGP (attrs[LFACE_BOX_INDEX]) || INTEGERP (attrs[LFACE_BOX_INDEX]) || CONSP (attrs[LFACE_BOX_INDEX])); - xassert (UNSPECIFIEDP (attrs[LFACE_INVERSE_INDEX]) + eassert (UNSPECIFIEDP (attrs[LFACE_INVERSE_INDEX]) || IGNORE_DEFFACE_P (attrs[LFACE_INVERSE_INDEX]) || SYMBOLP (attrs[LFACE_INVERSE_INDEX])); - xassert (UNSPECIFIEDP (attrs[LFACE_FOREGROUND_INDEX]) + eassert (UNSPECIFIEDP (attrs[LFACE_FOREGROUND_INDEX]) || IGNORE_DEFFACE_P (attrs[LFACE_FOREGROUND_INDEX]) || STRINGP (attrs[LFACE_FOREGROUND_INDEX])); - xassert (UNSPECIFIEDP (attrs[LFACE_BACKGROUND_INDEX]) + eassert (UNSPECIFIEDP (attrs[LFACE_BACKGROUND_INDEX]) || IGNORE_DEFFACE_P (attrs[LFACE_BACKGROUND_INDEX]) || STRINGP (attrs[LFACE_BACKGROUND_INDEX])); - xassert (UNSPECIFIEDP (attrs[LFACE_INHERIT_INDEX]) + eassert (UNSPECIFIEDP (attrs[LFACE_INHERIT_INDEX]) || IGNORE_DEFFACE_P (attrs[LFACE_INHERIT_INDEX]) || NILP (attrs[LFACE_INHERIT_INDEX]) || SYMBOLP (attrs[LFACE_INHERIT_INDEX]) || CONSP (attrs[LFACE_INHERIT_INDEX])); #ifdef HAVE_WINDOW_SYSTEM - xassert (UNSPECIFIEDP (attrs[LFACE_STIPPLE_INDEX]) + eassert (UNSPECIFIEDP (attrs[LFACE_STIPPLE_INDEX]) || IGNORE_DEFFACE_P (attrs[LFACE_STIPPLE_INDEX]) || SYMBOLP (attrs[LFACE_STIPPLE_INDEX]) || !NILP (Fbitmap_spec_p (attrs[LFACE_STIPPLE_INDEX]))); - xassert (UNSPECIFIEDP (attrs[LFACE_FONT_INDEX]) + eassert (UNSPECIFIEDP (attrs[LFACE_FONT_INDEX]) || IGNORE_DEFFACE_P (attrs[LFACE_FONT_INDEX]) || FONTP (attrs[LFACE_FONT_INDEX])); - xassert (UNSPECIFIEDP (attrs[LFACE_FONTSET_INDEX]) + eassert (UNSPECIFIEDP (attrs[LFACE_FONTSET_INDEX]) || STRINGP (attrs[LFACE_FONTSET_INDEX]) || NILP (attrs[LFACE_FONTSET_INDEX])); #endif @@ -1948,7 +1948,7 @@ { if (!NILP (lface)) { - xassert (LFACEP (lface)); + eassert (LFACEP (lface)); check_lface_attrs (XVECTOR (lface)->contents); } } @@ -2225,7 +2225,7 @@ { int pt = PIXEL_TO_POINT (font->pixel_size * 10, f->resy); - xassert (pt > 0); + eassert (pt > 0); LFACE_HEIGHT (lface) = make_number (pt); } @@ -2731,7 +2731,7 @@ ++windows_or_buffers_changed; } - xassert (LFACEP (lface)); + eassert (LFACEP (lface)); check_lface (lface); return lface; } @@ -3515,7 +3515,7 @@ { Lisp_Object result = make_number (0); - xassert (STRINGP (value)); + eassert (STRINGP (value)); if (xstrcasecmp (SSDATA (value), "on") == 0 || xstrcasecmp (SSDATA (value), "true") == 0) @@ -4088,7 +4088,7 @@ { const unsigned char *s; unsigned hash = 0; - xassert (STRINGP (string)); + eassert (STRINGP (string)); for (s = SDATA (string); *s; ++s) hash = (hash << 1) ^ tolower (*s); return hash; @@ -4119,7 +4119,7 @@ static inline int lface_same_font_attributes_p (Lisp_Object *lface1, Lisp_Object *lface2) { - xassert (lface_fully_specified_p (lface1) + eassert (lface_fully_specified_p (lface1) && lface_fully_specified_p (lface2)); return (xstrcasecmp (SSDATA (lface1[LFACE_FAMILY_INDEX]), SSDATA (lface2[LFACE_FAMILY_INDEX])) == 0 @@ -4200,7 +4200,7 @@ prepare_face_for_display (struct frame *f, struct face *face) { #ifdef HAVE_WINDOW_SYSTEM - xassert (FRAME_WINDOW_P (f)); + eassert (FRAME_WINDOW_P (f)); if (face->gc == 0) { @@ -4472,7 +4472,7 @@ if (face1->id == i) ++n; - xassert (n == 1); + eassert (n == 1); } #endif /* GLYPH_DEBUG */ @@ -4523,7 +4523,7 @@ int i; struct face *face; - xassert (cache != NULL); + eassert (cache != NULL); check_lface_attrs (attr); /* Look up ATTR in the face cache. */ @@ -4548,7 +4548,7 @@ face = realize_face (cache, attr, -1); #if GLYPH_DEBUG - xassert (face == FACE_FROM_ID (f, face->id)); + eassert (face == FACE_FROM_ID (f, face->id)); #endif /* GLYPH_DEBUG */ return face->id; @@ -4569,7 +4569,7 @@ int i; struct face *face; - xassert (cache != NULL); + eassert (cache != NULL); base_face = base_face->ascii_face; hash = lface_hash (base_face->lface); i = hash % FACE_CACHE_BUCKETS_SIZE; @@ -5470,7 +5470,7 @@ LFACE_STIPPLE (lface) = Qnil; /* Realize the face; it must be fully-specified now. */ - xassert (lface_fully_specified_p (XVECTOR (lface)->contents)); + eassert (lface_fully_specified_p (XVECTOR (lface)->contents)); check_lface (lface); memcpy (attrs, XVECTOR (lface)->contents, sizeof attrs); face = realize_face (c, attrs, DEFAULT_FACE_ID); @@ -5511,7 +5511,7 @@ /* The default face must exist and be fully specified. */ get_lface_attributes_no_remap (f, Qdefault, attrs, 1); check_lface_attrs (attrs); - xassert (lface_fully_specified_p (attrs)); + eassert (lface_fully_specified_p (attrs)); /* If SYMBOL isn't know as a face, create it. */ if (NILP (lface)) @@ -5541,7 +5541,7 @@ struct face *face; /* LFACE must be fully specified. */ - xassert (cache != NULL); + eassert (cache != NULL); check_lface_attrs (attrs); if (former_face_id >= 0 && cache->used > former_face_id) @@ -5621,7 +5621,7 @@ struct frame *f; Lisp_Object stipple, underline, overline, strike_through, box; - xassert (FRAME_WINDOW_P (cache->f)); + eassert (FRAME_WINDOW_P (cache->f)); /* Allocate a new realized face. */ face = make_realized_face (attrs); @@ -5699,7 +5699,7 @@ { /* Simple box of specified line width in foreground color of the face. */ - xassert (XINT (box) != 0); + eassert (XINT (box) != 0); face->box = FACE_SIMPLE_BOX; face->box_line_width = XINT (box); face->box_color = face->foreground; @@ -5880,7 +5880,7 @@ foreground_p ? FACE_TTY_DEFAULT_BG_COLOR : FACE_TTY_DEFAULT_FG_COLOR; #endif - xassert (idx == LFACE_FOREGROUND_INDEX || idx == LFACE_BACKGROUND_INDEX); + eassert (idx == LFACE_FOREGROUND_INDEX || idx == LFACE_BACKGROUND_INDEX); XSETFRAME (frame, f); color = face->lface[idx]; @@ -5948,7 +5948,7 @@ struct frame *f = cache->f; /* Frame must be a termcap frame. */ - xassert (FRAME_TERMCAP_P (cache->f) || FRAME_MSDOS_P (cache->f)); + eassert (FRAME_TERMCAP_P (cache->f) || FRAME_MSDOS_P (cache->f)); /* Allocate a new realized face. */ face = make_realized_face (attrs); @@ -6079,7 +6079,7 @@ /* W must display the current buffer. We could write this function to use the frame and buffer of W, but right now it doesn't. */ - /* xassert (XBUFFER (w->buffer) == current_buffer); */ + /* eassert (XBUFFER (w->buffer) == current_buffer); */ XSETFRAME (frame, f); XSETFASTINT (position, pos); @@ -6189,7 +6189,7 @@ /* W must display the current buffer. We could write this function to use the frame and buffer of W, but right now it doesn't. */ - /* xassert (XBUFFER (w->buffer) == current_buffer); */ + /* eassert (XBUFFER (w->buffer) == current_buffer); */ XSETFRAME (frame, f); XSETFASTINT (position, pos); @@ -6293,7 +6293,7 @@ *endptr = -1; base_face = FACE_FROM_ID (f, base_face_id); - xassert (base_face); + eassert (base_face); /* Optimize the default case that there is no face property and we are not in the region. */ === modified file 'src/xfns.c' --- src/xfns.c 2012-06-26 02:33:51 +0000 +++ src/xfns.c 2012-06-28 07:50:27 +0000 @@ -2914,7 +2914,7 @@ /* If frame is ``official'', nothing to do. */ if (NILP (Fmemq (frame, Vframe_list))) { -#if GLYPH_DEBUG && XASSERTS +#if GLYPH_DEBUG && defined ENABLE_CHECKING struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); #endif @@ -2923,8 +2923,8 @@ #if GLYPH_DEBUG /* Check that reference counts are indeed correct. */ - xassert (dpyinfo->reference_count == dpyinfo_refcount); - xassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount); + eassert (dpyinfo->reference_count == dpyinfo_refcount); + eassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount); #endif return Qt; } === modified file 'src/xselect.c' --- src/xselect.c 2012-06-22 21:17:42 +0000 +++ src/xselect.c 2012-06-28 07:50:27 +0000 @@ -1359,7 +1359,7 @@ break; bytes_per_item = *actual_format_ret >> 3; - xassert (*actual_size_ret <= buffer_size / bytes_per_item); + eassert (*actual_size_ret <= buffer_size / bytes_per_item); /* The man page for XGetWindowProperty says: "If the returned format is 32, the returned data is represented === modified file 'src/xterm.c' --- src/xterm.c 2012-06-26 05:00:30 +0000 +++ src/xterm.c 2012-06-28 07:50:27 +0000 @@ -715,7 +715,7 @@ struct frame *f; int width, height; - xassert (w); + eassert (w); if (!desired_row->mode_line_p && !w->pseudo_window_p) desired_row->redraw_fringe_bitmaps_p = 1; @@ -1033,7 +1033,7 @@ s->gc = FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc; } - xassert (s->gc != 0); + eassert (s->gc != 0); } @@ -1090,7 +1090,7 @@ } /* GC must have been set. */ - xassert (s->gc != 0); + eassert (s->gc != 0); } @@ -1691,8 +1691,8 @@ for (i = 0; i < ncolors; ++i) { unsigned long pixel = colors[i].pixel; - xassert (pixel < dpyinfo->ncolor_cells); - xassert (dpyinfo->color_cells[pixel].pixel == pixel); + eassert (pixel < dpyinfo->ncolor_cells); + eassert (dpyinfo->color_cells[pixel].pixel == pixel); colors[i] = dpyinfo->color_cells[pixel]; } } @@ -1850,7 +1850,7 @@ x_query_color (f, &color); /* Change RGB values by specified FACTOR. Avoid overflow! */ - xassert (factor >= 0); + eassert (factor >= 0); new.red = min (0xffff, factor * color.red); new.green = min (0xffff, factor * color.green); new.blue = min (0xffff, factor * color.blue); @@ -2562,7 +2562,7 @@ static void x_draw_stretch_glyph_string (struct glyph_string *s) { - xassert (s->first_glyph->type == STRETCH_GLYPH); + eassert (s->first_glyph->type == STRETCH_GLYPH); if (s->hl == DRAW_CURSOR && !x_stretch_cursor_p) @@ -3026,7 +3026,7 @@ void x_clear_area (Display *dpy, Window window, int x, int y, int width, int height, int exposures) { - xassert (width > 0 && height > 0); + eassert (width > 0 && height > 0); XClearArea (dpy, window, x, y, width, height, exposures); } @@ -9809,9 +9809,9 @@ static void x_check_font (struct frame *f, struct font *font) { - xassert (font != NULL && ! NILP (font->props[FONT_TYPE_INDEX])); + eassert (font != NULL && ! NILP (font->props[FONT_TYPE_INDEX])); if (font->driver->check) - xassert (font->driver->check (f, font) == 0); + eassert (font->driver->check (f, font) == 0); } #endif /* GLYPH_DEBUG != 0 */ ------------------------------------------------------------ revno: 108782 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-06-28 00:21:41 -0700 message: * simple.el (completion-list-mode-finish): Don't use toggle-read-only. Since completion-list-mode has a special mode-class, it wasn't doing anything extra anyway. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-28 03:31:27 +0000 +++ lisp/ChangeLog 2012-06-28 07:21:41 +0000 @@ -1,3 +1,9 @@ +2012-06-28 Glenn Morris + + * simple.el (completion-list-mode-finish): + Don't use toggle-read-only. (Since completion-list-mode has + a special mode-class, it wasn't doing anything extra anyway.) + 2012-06-28 Stefan Monnier Make inlining of other-mode interpreted functions work (bug#11799). === modified file 'lisp/simple.el' --- lisp/simple.el 2012-06-22 13:42:38 +0000 +++ lisp/simple.el 2012-06-28 07:21:41 +0000 @@ -6347,7 +6347,7 @@ "Finish setup of the completions buffer. Called from `temp-buffer-show-hook'." (when (eq major-mode 'completion-list-mode) - (toggle-read-only 1))) + (setq buffer-read-only t))) (add-hook 'temp-buffer-show-hook 'completion-list-mode-finish) ------------------------------------------------------------ revno: 108781 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-06-28 00:05:15 -0700 message: TODO updates; add wishlist section diff: === modified file 'etc/TODO' --- etc/TODO 2012-06-05 18:47:12 +0000 +++ etc/TODO 2012-06-28 07:05:15 +0000 @@ -1211,6 +1211,8 @@ this.] ** Rewrite make-docfile to be clean and maintainable. + It might be better to replace it with Lisp, using the byte compiler. + http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00037.html ** Add an inferior-comint-minor-mode to capture the common set of operations offered by major modes that offer an associated inferior @@ -1230,6 +1232,15 @@ button classes inherit from it. Set the default face of the "link" button class to the standard "link" face. +* Wishlist items: + +** Maybe replace etags.c with a Lisp implementation. +http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00354.html + +** Maybe replace lib-src/rcs2log with a Lisp implementation. +It wouldn't have to be a complete replacement, just enough +for vc-rcs-update-changelog. + * Other known bugs: ** `make-frame' forgets unhandled parameters, at least for X11 frames. ------------------------------------------------------------ revno: 108780 committer: Glenn Morris branch nick: trunk timestamp: Wed 2012-06-27 23:58:39 -0700 message: * emacs.py, emacs2.py, emacs3.py: Remove files. AFAICS, the new python.el does not use these files. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2012-06-24 17:07:26 +0000 +++ etc/ChangeLog 2012-06-28 06:58:39 +0000 @@ -1,3 +1,7 @@ +2012-06-28 Glenn Morris + + * emacs.py, emacs2.py, emacs3.py: Remove files, no longer used. + 2012-06-24 Lawrence Mitchell * NEWS: Move and improve the defun/defalias changes (bug#11686). === removed file 'etc/emacs.py' --- etc/emacs.py 2011-01-15 23:16:57 +0000 +++ etc/emacs.py 1970-01-01 00:00:00 +0000 @@ -1,10 +0,0 @@ -"""Wrapper for version-specific implementations of python.el helper -functions """ - -import sys - -if sys.version_info[0] == 3: - from emacs3 import * -else: - from emacs2 import * - === removed file 'etc/emacs2.py' --- etc/emacs2.py 2012-01-19 07:21:25 +0000 +++ etc/emacs2.py 1970-01-01 00:00:00 +0000 @@ -1,236 +0,0 @@ -"""Definitions used by commands sent to inferior Python in python.el.""" - -# Copyright (C) 2004-2012 Free Software Foundation, Inc. -# Author: Dave Love - -# This file is part of GNU Emacs. - -# GNU Emacs is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# GNU Emacs is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with GNU Emacs. If not, see . - -import os, sys, traceback, inspect, __main__ - -try: - set -except: - from sets import Set as set - -__all__ = ["eexecfile", "eargs", "complete", "ehelp", "eimport", "modpath"] - -def format_exception (filename, should_remove_self): - type, value, tb = sys.exc_info () - sys.last_type = type - sys.last_value = value - sys.last_traceback = tb - if type is SyntaxError: - try: # parse the error message - msg, (dummy_filename, lineno, offset, line) = value - except: - pass # Not the format we expect; leave it alone - else: - # Stuff in the right filename - value = SyntaxError(msg, (filename, lineno, offset, line)) - sys.last_value = value - res = traceback.format_exception_only (type, value) - # There are some compilation errors which do not provide traceback so we - # should not massage it. - if should_remove_self: - tblist = traceback.extract_tb (tb) - del tblist[:1] - res = traceback.format_list (tblist) - if res: - res.insert(0, "Traceback (most recent call last):\n") - res[len(res):] = traceback.format_exception_only (type, value) - # traceback.print_exception(type, value, tb) - for line in res: print line, - -def eexecfile (file): - """Execute FILE and then remove it. - Execute the file within the __main__ namespace. - If we get an exception, print a traceback with the top frame - (ourselves) excluded.""" - # We cannot use real execfile since it has a bug where the file stays - # locked forever (under w32) if SyntaxError occurs. - # --- code based on code.py and PyShell.py. - try: - try: - source = open (file, "r").read() - code = compile (source, file, "exec") - # Other exceptions (shouldn't be any...) will (correctly) fall - # through to "final". - except (OverflowError, SyntaxError, ValueError): - # FIXME: When can compile() raise anything else than - # SyntaxError ???? - format_exception (file, False) - return - try: - exec code in __main__.__dict__ - except: - format_exception (file, True) - finally: - os.remove (file) - -def eargs (name, imports): - "Get arglist of NAME for Eldoc &c." - try: - if imports: exec imports - parts = name.split ('.') - if len (parts) > 1: - exec 'import ' + parts[0] # might fail - func = eval (name) - if inspect.isbuiltin (func) or type(func) is type: - doc = func.__doc__ - if doc.find (' ->') != -1: - print '_emacs_out', doc.split (' ->')[0] - else: - print '_emacs_out', doc.split ('\n')[0] - return - if inspect.ismethod (func): - func = func.im_func - if not inspect.isfunction (func): - print '_emacs_out ' - return - (args, varargs, varkw, defaults) = inspect.getargspec (func) - # No space between name and arglist for consistency with builtins. - print '_emacs_out', \ - func.__name__ + inspect.formatargspec (args, varargs, varkw, - defaults) - except: - print "_emacs_out " - -def all_names (object): - """Return (an approximation to) a list of all possible attribute - names reachable via the attributes of OBJECT, i.e. roughly the - leaves of the dictionary tree under it.""" - - def do_object (object, names): - if inspect.ismodule (object): - do_module (object, names) - elif inspect.isclass (object): - do_class (object, names) - # Might have an object without its class in scope. - elif hasattr (object, '__class__'): - names.add ('__class__') - do_class (object.__class__, names) - # Probably not a good idea to try to enumerate arbitrary - # dictionaries... - return names - - def do_module (module, names): - if hasattr (module, '__all__'): # limited export list - names.update(module.__all__) - for i in module.__all__: - do_object (getattr (module, i), names) - else: # use all names - names.update(dir (module)) - for i in dir (module): - do_object (getattr (module, i), names) - return names - - def do_class (object, names): - ns = dir (object) - names.update(ns) - if hasattr (object, '__bases__'): # superclasses - for i in object.__bases__: do_object (i, names) - return names - - return do_object (object, set([])) - -def complete (name, imports): - """Complete TEXT in NAMESPACE and print a Lisp list of completions. - Exec IMPORTS first.""" - import __main__, keyword - - def class_members(object): - names = dir (object) - if hasattr (object, '__bases__'): - for super in object.__bases__: - names = class_members (super) - return names - - names = set([]) - base = None - try: - dict = __main__.__dict__.copy() - if imports: exec imports in dict - l = len (name) - if not "." in name: - for src in [dir (__builtins__), keyword.kwlist, dict.keys()]: - for elt in src: - if elt[:l] == name: names.add(elt) - else: - base = name[:name.rfind ('.')] - name = name[name.rfind('.')+1:] - try: - object = eval (base, dict) - names = set(dir (object)) - if hasattr (object, '__class__'): - names.add('__class__') - names.update(class_members (object)) - except: names = all_names (dict) - except: - print sys.exc_info() - names = [] - - l = len(name) - print '_emacs_out (', - for n in names: - if name == n[:l]: - if base: print '"%s.%s"' % (base, n), - else: print '"%s"' % n, - print ')' - -def ehelp (name, imports): - """Get help on string NAME. - First try to eval name for, e.g. user definitions where we need - the object. Otherwise try the string form.""" - locls = {} - if imports: - try: exec imports in locls - except: pass - try: help (eval (name, globals(), locls)) - except: help (name) - -def eimport (mod, dir): - """Import module MOD with directory DIR at the head of the search path. - NB doesn't load from DIR if MOD shadows a system module.""" - from __main__ import __dict__ - - path0 = sys.path[0] - sys.path[0] = dir - try: - try: - if __dict__.has_key(mod) and inspect.ismodule (__dict__[mod]): - reload (__dict__[mod]) - else: - __dict__[mod] = __import__ (mod) - except: - (type, value, tb) = sys.exc_info () - print "Traceback (most recent call last):" - traceback.print_exception (type, value, tb.tb_next) - finally: - sys.path[0] = path0 - -def modpath (module): - """Return the source file for the given MODULE (or None). -Assumes that MODULE.py and MODULE.pyc are in the same directory.""" - try: - path = __import__ (module).__file__ - if path[-4:] == '.pyc' and os.path.exists (path[0:-1]): - path = path[:-1] - print "_emacs_out", path - except: - print "_emacs_out ()" - -# print '_emacs_ok' # ready for input and can call continuation - === removed file 'etc/emacs3.py' --- etc/emacs3.py 2012-01-19 07:21:25 +0000 +++ etc/emacs3.py 1970-01-01 00:00:00 +0000 @@ -1,234 +0,0 @@ -# Copyright (C) 2004-2012 Free Software Foundation, Inc. -# Author: Dave Love - -# This file is part of GNU Emacs. - -# GNU Emacs is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# GNU Emacs is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with GNU Emacs. If not, see . - -import os, sys, traceback, inspect, imp, __main__ - -try: - set -except: - from sets import Set as set - -__all__ = ["eexecfile", "eargs", "complete", "ehelp", "eimport", "modpath"] - -def format_exception (filename, should_remove_self): - type, value, tb = sys.exc_info () - sys.last_type = type - sys.last_value = value - sys.last_traceback = tb - if type is SyntaxError: - try: # parse the error message - msg, (dummy_filename, lineno, offset, line) = value - except: - pass # Not the format we expect; leave it alone - else: - # Stuff in the right filename - value = SyntaxError(msg, (filename, lineno, offset, line)) - sys.last_value = value - res = traceback.format_exception_only (type, value) - # There are some compilation errors which do not provide traceback so we - # should not massage it. - if should_remove_self: - tblist = traceback.extract_tb (tb) - del tblist[:1] - res = traceback.format_list (tblist) - if res: - res.insert(0, "Traceback (most recent call last):\n") - res[len(res):] = traceback.format_exception_only (type, value) - # traceback.print_exception(type, value, tb) - for line in res: print(line, end=' ') - -def eexecfile (file): - """Execute FILE and then remove it. - Execute the file within the __main__ namespace. - If we get an exception, print a traceback with the top frame - (ourselves) excluded.""" - # We cannot use real execfile since it has a bug where the file stays - # locked forever (under w32) if SyntaxError occurs. - # --- code based on code.py and PyShell.py. - try: - try: - source = open (file, "r").read() - code = compile (source, file, "exec") - # Other exceptions (shouldn't be any...) will (correctly) fall - # through to "final". - except (OverflowError, SyntaxError, ValueError): - # FIXME: When can compile() raise anything else than - # SyntaxError ???? - format_exception (file, False) - return - try: - exec(code, __main__.__dict__) - except: - format_exception (file, True) - finally: - os.remove (file) - -def eargs (name, imports): - "Get arglist of NAME for Eldoc &c." - try: - if imports: exec(imports) - parts = name.split ('.') - if len (parts) > 1: - exec('import ' + parts[0]) # might fail - func = eval (name) - if inspect.isbuiltin (func) or type(func) is type: - doc = func.__doc__ - if doc.find (' ->') != -1: - print('_emacs_out', doc.split (' ->')[0]) - else: - print('_emacs_out', doc.split ('\n')[0]) - return - if inspect.ismethod (func): - func = func.im_func - if not inspect.isfunction (func): - print('_emacs_out ') - return - (args, varargs, varkw, defaults) = inspect.getargspec (func) - # No space between name and arglist for consistency with builtins. - print('_emacs_out', \ - func.__name__ + inspect.formatargspec (args, varargs, varkw, - defaults)) - except: - print("_emacs_out ") - -def all_names (object): - """Return (an approximation to) a list of all possible attribute - names reachable via the attributes of OBJECT, i.e. roughly the - leaves of the dictionary tree under it.""" - - def do_object (object, names): - if inspect.ismodule (object): - do_module (object, names) - elif inspect.isclass (object): - do_class (object, names) - # Might have an object without its class in scope. - elif hasattr (object, '__class__'): - names.add ('__class__') - do_class (object.__class__, names) - # Probably not a good idea to try to enumerate arbitrary - # dictionaries... - return names - - def do_module (module, names): - if hasattr (module, '__all__'): # limited export list - names.update(module.__all__) - for i in module.__all__: - do_object (getattr (module, i), names) - else: # use all names - names.update(dir (module)) - for i in dir (module): - do_object (getattr (module, i), names) - return names - - def do_class (object, names): - ns = dir (object) - names.update(ns) - if hasattr (object, '__bases__'): # superclasses - for i in object.__bases__: do_object (i, names) - return names - - return do_object (object, set([])) - -def complete (name, imports): - """Complete TEXT in NAMESPACE and print a Lisp list of completions. - Exec IMPORTS first.""" - import __main__, keyword - - def class_members(object): - names = dir (object) - if hasattr (object, '__bases__'): - for super in object.__bases__: - names = class_members (super) - return names - - names = set([]) - base = None - try: - dict = __main__.__dict__.copy() - if imports: exec(imports, dict) - l = len (name) - if not "." in name: - for src in [dir (__builtins__), keyword.kwlist, list(dict.keys())]: - for elt in src: - if elt[:l] == name: names.add(elt) - else: - base = name[:name.rfind ('.')] - name = name[name.rfind('.')+1:] - try: - object = eval (base, dict) - names = set(dir (object)) - if hasattr (object, '__class__'): - names.add('__class__') - names.update(class_members (object)) - except: names = all_names (dict) - except: - print(sys.exc_info()) - names = [] - - l = len(name) - print('_emacs_out (', end=' ') - for n in names: - if name == n[:l]: - if base: print('"%s.%s"' % (base, n), end=' ') - else: print('"%s"' % n, end=' ') - print(')') - -def ehelp (name, imports): - """Get help on string NAME. - First try to eval name for, e.g. user definitions where we need - the object. Otherwise try the string form.""" - locls = {} - if imports: - try: exec(imports, locls) - except: pass - try: help (eval (name, globals(), locls)) - except: help (name) - -def eimport (mod, dir): - """Import module MOD with directory DIR at the head of the search path. - NB doesn't load from DIR if MOD shadows a system module.""" - from __main__ import __dict__ - - path0 = sys.path[0] - sys.path[0] = dir - try: - try: - if mod in __dict__ and inspect.ismodule (__dict__[mod]): - imp.reload (__dict__[mod]) - else: - __dict__[mod] = __import__ (mod) - except: - (type, value, tb) = sys.exc_info () - print("Traceback (most recent call last):") - traceback.print_exception (type, value, tb.tb_next) - finally: - sys.path[0] = path0 - -def modpath (module): - """Return the source file for the given MODULE (or None). -Assumes that MODULE.py and MODULE.pyc are in the same directory.""" - try: - path = __import__ (module).__file__ - if path[-4:] == '.pyc' and os.path.exists (path[0:-1]): - path = path[:-1] - print("_emacs_out", path) - except: - print("_emacs_out ()") - -# print '_emacs_ok' # ready for input and can call continuation - ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.