diff options
| author | Joakim Verona | 2013-01-15 00:03:45 +0100 |
|---|---|---|
| committer | Joakim Verona | 2013-01-15 00:03:45 +0100 |
| commit | bc4f7ac4ec3ee942171b9fef6eec6b1a61cc5b8b (patch) | |
| tree | 481f44117938f166336393293fa73eaeff179406 | |
| parent | 132fdce3d2530db5a6edeaf4242257ff01ea4760 (diff) | |
| parent | 982c5d68ff9a798d777d25ccfda7ca6616fab1e2 (diff) | |
| download | emacs-bc4f7ac4ec3ee942171b9fef6eec6b1a61cc5b8b.tar.gz emacs-bc4f7ac4ec3ee942171b9fef6eec6b1a61cc5b8b.zip | |
auto upstream
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/calendar/calendar.el | 12 | ||||
| -rw-r--r-- | lisp/gnus/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/gnus/gnus-sum.el | 21 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 7 | ||||
| -rw-r--r-- | src/ChangeLog | 45 | ||||
| -rw-r--r-- | src/alloc.c | 59 | ||||
| -rw-r--r-- | src/dired.c | 2 | ||||
| -rw-r--r-- | src/editfns.c | 51 | ||||
| -rw-r--r-- | src/eval.c | 3 | ||||
| -rw-r--r-- | src/fileio.c | 2 | ||||
| -rw-r--r-- | src/font.c | 2 | ||||
| -rw-r--r-- | src/ftfont.c | 22 | ||||
| -rw-r--r-- | src/gtkutil.c | 3 | ||||
| -rw-r--r-- | src/keymap.c | 5 | ||||
| -rw-r--r-- | src/lisp.h | 48 | ||||
| -rw-r--r-- | src/lread.c | 2 | ||||
| -rw-r--r-- | src/nsmenu.m | 3 | ||||
| -rw-r--r-- | src/nsterm.h | 4 | ||||
| -rw-r--r-- | src/print.c | 73 | ||||
| -rw-r--r-- | src/xfns.c | 3 | ||||
| -rw-r--r-- | src/xmenu.c | 17 | ||||
| -rw-r--r-- | src/xselect.c | 2 | ||||
| -rw-r--r-- | test/ChangeLog | 5 | ||||
| -rw-r--r-- | test/automated/compile-tests.el | 4 |
25 files changed, 287 insertions, 127 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5c7e8c3e6a8..d4a81bffd9c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2013-01-14 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * calendar/calendar.el (calendar-redraw): Sync window-point and point. | ||
| 4 | (Bug#13420) | ||
| 5 | |||
| 6 | 2013-01-14 Glenn Morris <rgm@gnu.org> | ||
| 7 | |||
| 8 | * progmodes/compile.el (compilation-error-regexp-alist-alist): | ||
| 9 | Fix interpretation of gnu line.col1-col2 format. (Bug#13335) | ||
| 10 | |||
| 1 | 2013-01-13 Fabián Ezequiel Gallina <fgallina@cuca> | 11 | 2013-01-13 Fabián Ezequiel Gallina <fgallina@cuca> |
| 2 | 12 | ||
| 3 | * progmodes/python.el (python-nav-end-of-statement): Fix | 13 | * progmodes/python.el (python-nav-end-of-statement): Fix |
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 9b0eb3e9bff..74d3ce80338 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el | |||
| @@ -1562,11 +1562,13 @@ line." | |||
| 1562 | (defun calendar-redraw () | 1562 | (defun calendar-redraw () |
| 1563 | "Redraw the calendar display, if `calendar-buffer' is live." | 1563 | "Redraw the calendar display, if `calendar-buffer' is live." |
| 1564 | (interactive) | 1564 | (interactive) |
| 1565 | (if (get-buffer calendar-buffer) | 1565 | (when (get-buffer calendar-buffer) |
| 1566 | (with-current-buffer calendar-buffer | 1566 | (with-current-buffer calendar-buffer |
| 1567 | (let ((cursor-date (calendar-cursor-to-nearest-date))) | 1567 | (let ((cursor-date (calendar-cursor-to-nearest-date))) |
| 1568 | (calendar-generate-window displayed-month displayed-year) | 1568 | (calendar-generate-window displayed-month displayed-year) |
| 1569 | (calendar-cursor-to-visible-date cursor-date))))) | 1569 | (calendar-cursor-to-visible-date cursor-date)) |
| 1570 | (when (window-live-p (get-buffer-window)) | ||
| 1571 | (set-window-point (get-buffer-window) (point)))))) | ||
| 1570 | 1572 | ||
| 1571 | (defvar calendar-mode-map | 1573 | (defvar calendar-mode-map |
| 1572 | (let ((map (make-keymap))) | 1574 | (let ((map (make-keymap))) |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 1524f000450..2b09a1f456c 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-01-14 Julien Danjou <julien@danjou.info> | ||
| 2 | |||
| 3 | * gnus-sum.el (gnus-summary-from-or-to-or-newsgroups): Compare | ||
| 4 | addresses against addresses, not against the full From field. | ||
| 5 | |||
| 1 | 2013-01-13 Richard Stallman <rms@gnu.org> | 6 | 2013-01-13 Richard Stallman <rms@gnu.org> |
| 2 | 7 | ||
| 3 | * message.el (message-forward-make-body-mime): New args BEG, END | 8 | * message.el (message-forward-make-body-mime): New args BEG, END |
| @@ -7,10 +12,10 @@ | |||
| 7 | 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com> | 12 | 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com> |
| 8 | 13 | ||
| 9 | * gnus-start.el (gnus-check-new-newsgroups): Fix ambiguous doc string | 14 | * gnus-start.el (gnus-check-new-newsgroups): Fix ambiguous doc string |
| 10 | cross-reference(s). | 15 | cross-reference(s). |
| 11 | 16 | ||
| 12 | * gnus-sum.el (gnus-summary-newsgroup-prefix): Fix ambiguous doc string | 17 | * gnus-sum.el (gnus-summary-newsgroup-prefix): Fix ambiguous doc string |
| 13 | cross-reference(s). | 18 | cross-reference(s). |
| 14 | 19 | ||
| 15 | 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru> | 20 | 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru> |
| 16 | 21 | ||
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 14597f031e1..ea68a6a2fa5 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -3651,17 +3651,18 @@ buffer that was in action when the last article was fetched." | |||
| 3651 | (or (car (funcall gnus-extract-address-components from)) | 3651 | (or (car (funcall gnus-extract-address-components from)) |
| 3652 | from)) | 3652 | from)) |
| 3653 | 3653 | ||
| 3654 | (defun gnus-summary-from-or-to-or-newsgroups (header gnus-tmp-from) | 3654 | (defun gnus-summary-from-or-to-or-newsgroups (header from) |
| 3655 | (let ((mail-parse-charset gnus-newsgroup-charset) | 3655 | (let ((mail-parse-charset gnus-newsgroup-charset) |
| 3656 | (ignored-from-addresses (gnus-ignored-from-addresses)) | 3656 | (ignored-from-addresses (gnus-ignored-from-addresses)) |
| 3657 | ; Is it really necessary to do this next part for each summary line? | 3657 | ;; Is it really necessary to do this next part for each summary line? |
| 3658 | ; Luckily, doesn't seem to slow things down much. | 3658 | ;; Luckily, doesn't seem to slow things down much. |
| 3659 | (mail-parse-ignored-charsets | 3659 | (mail-parse-ignored-charsets |
| 3660 | (with-current-buffer gnus-summary-buffer | 3660 | (with-current-buffer gnus-summary-buffer |
| 3661 | gnus-newsgroup-ignored-charsets))) | 3661 | gnus-newsgroup-ignored-charsets)) |
| 3662 | (address (cadr (gnus-extract-address-components from)))) | ||
| 3662 | (or | 3663 | (or |
| 3663 | (and ignored-from-addresses | 3664 | (and ignored-from-addresses |
| 3664 | (string-match ignored-from-addresses gnus-tmp-from) | 3665 | (string-match ignored-from-addresses address) |
| 3665 | (let ((extra-headers (mail-header-extra header)) | 3666 | (let ((extra-headers (mail-header-extra header)) |
| 3666 | to | 3667 | to |
| 3667 | newsgroups) | 3668 | newsgroups) |
| @@ -3680,9 +3681,7 @@ buffer that was in action when the last article was fetched." | |||
| 3680 | gnus-newsgroup-name)) 'nntp) | 3681 | gnus-newsgroup-name)) 'nntp) |
| 3681 | (gnus-group-real-name gnus-newsgroup-name)))) | 3682 | (gnus-group-real-name gnus-newsgroup-name)))) |
| 3682 | (concat gnus-summary-newsgroup-prefix newsgroups))))) | 3683 | (concat gnus-summary-newsgroup-prefix newsgroups))))) |
| 3683 | (gnus-string-mark-left-to-right | 3684 | (gnus-string-mark-left-to-right (gnus-summary-extract-address-component from))))) |
| 3684 | (inline | ||
| 3685 | (gnus-summary-extract-address-component gnus-tmp-from)))))) | ||
| 3686 | 3685 | ||
| 3687 | (defun gnus-summary-insert-line (gnus-tmp-header | 3686 | (defun gnus-summary-insert-line (gnus-tmp-header |
| 3688 | gnus-tmp-level gnus-tmp-current | 3687 | gnus-tmp-level gnus-tmp-current |
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 4e1cd4a24e3..eb73b77bf52 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -134,6 +134,7 @@ and a string describing how the process finished.") | |||
| 134 | 134 | ||
| 135 | ;; If you make any changes to `compilation-error-regexp-alist-alist', | 135 | ;; If you make any changes to `compilation-error-regexp-alist-alist', |
| 136 | ;; be sure to run the ERT test in test/automated/compile-tests.el. | 136 | ;; be sure to run the ERT test in test/automated/compile-tests.el. |
| 137 | ;; emacs -batch -l compile-tests.el -f ert-run-tests-batch-and-exit | ||
| 137 | 138 | ||
| 138 | (defvar compilation-error-regexp-alist-alist | 139 | (defvar compilation-error-regexp-alist-alist |
| 139 | '((absoft | 140 | '((absoft |
| @@ -261,11 +262,11 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) | |||
| 261 | ;; The "in \\|from " exception was added to handle messages from Ruby. | 262 | ;; The "in \\|from " exception was added to handle messages from Ruby. |
| 262 | "^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\|[ \t]+\\(?:in \\|from \\)\\)?\ | 263 | "^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\|[ \t]+\\(?:in \\|from \\)\\)?\ |
| 263 | \\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\): ?\ | 264 | \\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\): ?\ |
| 264 | \\([0-9]+\\)\\(?:[.:]\\([0-9]+\\)\\)?\ | 265 | \\([0-9]+\\)\\(?:-\\(?4:[0-9]+\\)\\(?:\\.\\(?5:[0-9]+\\)\\)?\ |
| 265 | \\(?:-\\([0-9]+\\)?\\(?:\\.\\([0-9]+\\)\\)?\\)?:\ | 266 | \\|[.:]\\(?3:[0-9]+\\)\\(?:-\\(?:\\(?4:[0-9]+\\)\\.\\)?\\(?5:[0-9]+\\)\\)?\\)?:\ |
| 266 | \\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\ | 267 | \\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\ |
| 267 | *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\|[Nn]ote\\)\\|\ | 268 | *\\([Ii]nfo\\(?:\\>\\|rmationa?l?\\)\\|I:\\|instantiated from\\|[Nn]ote\\)\\|\ |
| 268 | *[Ee]rror\\|\[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)" | 269 | *[Ee]rror\\|[0-9]?\\(?:[^0-9\n]\\|$\\)\\|[0-9][0-9][0-9]\\)" |
| 269 | 1 (2 . 4) (3 . 5) (6 . 7)) | 270 | 1 (2 . 4) (3 . 5) (6 . 7)) |
| 270 | 271 | ||
| 271 | (lcc | 272 | (lcc |
diff --git a/src/ChangeLog b/src/ChangeLog index 9096b904171..80f5875ef16 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,48 @@ | |||
| 1 | 2013-01-14 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Avoid needless casts with XSAVE_POINTER. | ||
| 4 | * alloc.c (mark_object) [GC_MARK_STACK]: | ||
| 5 | * dired.c (directory_files_internal_unwind): | ||
| 6 | * fileio.c (do_auto_save_unwind): | ||
| 7 | * gtkutil.c (pop_down_dialog): | ||
| 8 | * keymap.c (map_keymap_char_table_item): | ||
| 9 | * lread.c (load_unwind): | ||
| 10 | * nsmenu.m (pop_down_menu): | ||
| 11 | * print.c (print_object) [GC_MARK_STACK]: | ||
| 12 | * xfns.c (clean_up_file_dialog): | ||
| 13 | * xmenu.c (cleanup_widget_value_tree): | ||
| 14 | Omit casts between XSAVE_POINTER and a pointer type. | ||
| 15 | |||
| 16 | 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 17 | |||
| 18 | Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE. | ||
| 19 | * eval.c (eval_sub): Protect `form' from being GCed before its | ||
| 20 | car and cdr becomes protected with the backtrace entry. | ||
| 21 | |||
| 22 | 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 23 | |||
| 24 | Make Lisp_Save_Value more versatile storage for up to four objects. | ||
| 25 | * lisp.h (toplevel): Enumeration to describe types of saved objects. | ||
| 26 | (struct Lisp_Save_Value): New layout. Adjust comments. | ||
| 27 | (XSAVE_POINTER): New macro. | ||
| 28 | (XSAVE_INTEGER): Likewise. | ||
| 29 | (allocate_misc): Add prototype. | ||
| 30 | (free_misc): Likewise. | ||
| 31 | * alloc.c (allocate_misc): Now global. | ||
| 32 | (free_misc): Likewise. Adjust comment. | ||
| 33 | (make_save_value): Use new Lisp_Save_Value layout. Adjust comment. | ||
| 34 | (free_save_value): Likewise. | ||
| 35 | (mark_object): Likewise. | ||
| 36 | * editfns.c (save_excursion_save): Pack everything within | ||
| 37 | Lisp_Save_Value and so avoid xmalloc. | ||
| 38 | (save_excursion_restore): Adjust to match new layout. Use free_misc | ||
| 39 | because we do not allocate extra memory any more. Add eassert. | ||
| 40 | * print.c (print_object): New code to print Lisp_Save_Value. Do not | ||
| 41 | rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments. | ||
| 42 | * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c, | ||
| 43 | * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c: | ||
| 44 | Use XSAVE_POINTER and XSAVE_INTEGER where appropriate. | ||
| 45 | |||
| 1 | 2013-01-13 Jan Djärv <jan.h.d@swipnet.se> | 46 | 2013-01-13 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 47 | ||
| 3 | * nsfont.m (LCD_SMOOTHING_MARGIN): New define. | 48 | * nsfont.m (LCD_SMOOTHING_MARGIN): New define. |
diff --git a/src/alloc.c b/src/alloc.c index b147aa20723..3f1ccc82a58 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -219,7 +219,6 @@ static void refill_memory_reserve (void); | |||
| 219 | #endif | 219 | #endif |
| 220 | static void compact_small_strings (void); | 220 | static void compact_small_strings (void); |
| 221 | static void free_large_strings (void); | 221 | static void free_large_strings (void); |
| 222 | static void free_misc (Lisp_Object); | ||
| 223 | extern Lisp_Object which_symbols (Lisp_Object, EMACS_INT) EXTERNALLY_VISIBLE; | 222 | extern Lisp_Object which_symbols (Lisp_Object, EMACS_INT) EXTERNALLY_VISIBLE; |
| 224 | 223 | ||
| 225 | /* When scanning the C stack for live Lisp objects, Emacs keeps track of | 224 | /* When scanning the C stack for live Lisp objects, Emacs keeps track of |
| @@ -3303,7 +3302,7 @@ static union Lisp_Misc *marker_free_list; | |||
| 3303 | 3302 | ||
| 3304 | /* Return a newly allocated Lisp_Misc object of specified TYPE. */ | 3303 | /* Return a newly allocated Lisp_Misc object of specified TYPE. */ |
| 3305 | 3304 | ||
| 3306 | static Lisp_Object | 3305 | Lisp_Object |
| 3307 | allocate_misc (enum Lisp_Misc_Type type) | 3306 | allocate_misc (enum Lisp_Misc_Type type) |
| 3308 | { | 3307 | { |
| 3309 | Lisp_Object val; | 3308 | Lisp_Object val; |
| @@ -3339,9 +3338,9 @@ allocate_misc (enum Lisp_Misc_Type type) | |||
| 3339 | return val; | 3338 | return val; |
| 3340 | } | 3339 | } |
| 3341 | 3340 | ||
| 3342 | /* Free a Lisp_Misc object */ | 3341 | /* Free a Lisp_Misc object. */ |
| 3343 | 3342 | ||
| 3344 | static void | 3343 | void |
| 3345 | free_misc (Lisp_Object misc) | 3344 | free_misc (Lisp_Object misc) |
| 3346 | { | 3345 | { |
| 3347 | XMISCTYPE (misc) = Lisp_Misc_Free; | 3346 | XMISCTYPE (misc) = Lisp_Misc_Free; |
| @@ -3351,9 +3350,10 @@ free_misc (Lisp_Object misc) | |||
| 3351 | total_free_markers++; | 3350 | total_free_markers++; |
| 3352 | } | 3351 | } |
| 3353 | 3352 | ||
| 3354 | /* Return a Lisp_Misc_Save_Value object containing POINTER and | 3353 | /* Return a Lisp_Save_Value object containing POINTER and INTEGER. |
| 3355 | INTEGER. This is used to package C values to call record_unwind_protect. | 3354 | Most code should use this to package C integers and pointers |
| 3356 | The unwind function can get the C values back using XSAVE_VALUE. */ | 3355 | to call record_unwind_protect. The unwind function can get the |
| 3356 | C values back using XSAVE_POINTER and XSAVE_INTEGER. */ | ||
| 3357 | 3357 | ||
| 3358 | Lisp_Object | 3358 | Lisp_Object |
| 3359 | make_save_value (void *pointer, ptrdiff_t integer) | 3359 | make_save_value (void *pointer, ptrdiff_t integer) |
| @@ -3363,22 +3363,22 @@ make_save_value (void *pointer, ptrdiff_t integer) | |||
| 3363 | 3363 | ||
| 3364 | val = allocate_misc (Lisp_Misc_Save_Value); | 3364 | val = allocate_misc (Lisp_Misc_Save_Value); |
| 3365 | p = XSAVE_VALUE (val); | 3365 | p = XSAVE_VALUE (val); |
| 3366 | p->pointer = pointer; | 3366 | p->type0 = SAVE_POINTER; |
| 3367 | p->integer = integer; | 3367 | p->data[0].pointer = pointer; |
| 3368 | p->dogc = 0; | 3368 | p->type1 = SAVE_INTEGER; |
| 3369 | p->data[1].integer = integer; | ||
| 3370 | p->type2 = p->type3 = SAVE_UNUSED; | ||
| 3371 | p->area = 0; | ||
| 3369 | return val; | 3372 | return val; |
| 3370 | } | 3373 | } |
| 3371 | 3374 | ||
| 3372 | /* Free a Lisp_Misc_Save_Value object. */ | 3375 | /* Free a Lisp_Save_Value object. Do not use this function |
| 3376 | if SAVE contains pointer other than returned by xmalloc. */ | ||
| 3373 | 3377 | ||
| 3374 | void | 3378 | void |
| 3375 | free_save_value (Lisp_Object save) | 3379 | free_save_value (Lisp_Object save) |
| 3376 | { | 3380 | { |
| 3377 | register struct Lisp_Save_Value *p = XSAVE_VALUE (save); | 3381 | xfree (XSAVE_POINTER (save)); |
| 3378 | |||
| 3379 | p->dogc = 0; | ||
| 3380 | xfree (p->pointer); | ||
| 3381 | p->pointer = NULL; | ||
| 3382 | free_misc (save); | 3382 | free_misc (save); |
| 3383 | } | 3383 | } |
| 3384 | 3384 | ||
| @@ -5935,20 +5935,33 @@ mark_object (Lisp_Object arg) | |||
| 5935 | 5935 | ||
| 5936 | case Lisp_Misc_Save_Value: | 5936 | case Lisp_Misc_Save_Value: |
| 5937 | XMISCANY (obj)->gcmarkbit = 1; | 5937 | XMISCANY (obj)->gcmarkbit = 1; |
| 5938 | #if GC_MARK_STACK | ||
| 5939 | { | 5938 | { |
| 5940 | register struct Lisp_Save_Value *ptr = XSAVE_VALUE (obj); | 5939 | register struct Lisp_Save_Value *ptr = XSAVE_VALUE (obj); |
| 5941 | /* If DOGC is set, POINTER is the address of a memory | 5940 | /* If `area' is nonzero, `data[0].pointer' is the address |
| 5942 | area containing INTEGER potential Lisp_Objects. */ | 5941 | of a memory area containing `data[1].integer' potential |
| 5943 | if (ptr->dogc) | 5942 | Lisp_Objects. */ |
| 5943 | #if GC_MARK_STACK | ||
| 5944 | if (ptr->area) | ||
| 5944 | { | 5945 | { |
| 5945 | Lisp_Object *p = (Lisp_Object *) ptr->pointer; | 5946 | Lisp_Object *p = ptr->data[0].pointer; |
| 5946 | ptrdiff_t nelt; | 5947 | ptrdiff_t nelt; |
| 5947 | for (nelt = ptr->integer; nelt > 0; nelt--, p++) | 5948 | for (nelt = ptr->data[1].integer; nelt > 0; nelt--, p++) |
| 5948 | mark_maybe_object (*p); | 5949 | mark_maybe_object (*p); |
| 5949 | } | 5950 | } |
| 5951 | else | ||
| 5952 | #endif /* GC_MARK_STACK */ | ||
| 5953 | { | ||
| 5954 | /* Find Lisp_Objects in `data[N]' slots and mark them. */ | ||
| 5955 | if (ptr->type0 == SAVE_OBJECT) | ||
| 5956 | mark_object (ptr->data[0].object); | ||
| 5957 | if (ptr->type1 == SAVE_OBJECT) | ||
| 5958 | mark_object (ptr->data[1].object); | ||
| 5959 | if (ptr->type2 == SAVE_OBJECT) | ||
| 5960 | mark_object (ptr->data[2].object); | ||
| 5961 | if (ptr->type3 == SAVE_OBJECT) | ||
| 5962 | mark_object (ptr->data[3].object); | ||
| 5963 | } | ||
| 5950 | } | 5964 | } |
| 5951 | #endif | ||
| 5952 | break; | 5965 | break; |
| 5953 | 5966 | ||
| 5954 | case Lisp_Misc_Overlay: | 5967 | case Lisp_Misc_Overlay: |
diff --git a/src/dired.c b/src/dired.c index b4dc702112e..8483721401a 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -78,7 +78,7 @@ directory_files_internal_w32_unwind (Lisp_Object arg) | |||
| 78 | static Lisp_Object | 78 | static Lisp_Object |
| 79 | directory_files_internal_unwind (Lisp_Object dh) | 79 | directory_files_internal_unwind (Lisp_Object dh) |
| 80 | { | 80 | { |
| 81 | DIR *d = (DIR *) XSAVE_VALUE (dh)->pointer; | 81 | DIR *d = XSAVE_POINTER (dh); |
| 82 | block_input (); | 82 | block_input (); |
| 83 | closedir (d); | 83 | closedir (d); |
| 84 | unblock_input (); | 84 | unblock_input (); |
diff --git a/src/editfns.c b/src/editfns.c index bf19acb42a8..feac17f64b8 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -833,20 +833,30 @@ This function does not move point. */) | |||
| 833 | Lisp_Object | 833 | Lisp_Object |
| 834 | save_excursion_save (void) | 834 | save_excursion_save (void) |
| 835 | { | 835 | { |
| 836 | Lisp_Object save, *data = xmalloc (word_size * 4); | 836 | Lisp_Object save = allocate_misc (Lisp_Misc_Save_Value); |
| 837 | register struct Lisp_Save_Value *v = XSAVE_VALUE (save); | ||
| 838 | |||
| 839 | /* Do not allocate extra space and pack everything in SAVE. */ | ||
| 840 | v->area = 0; | ||
| 841 | |||
| 842 | v->type0 = SAVE_OBJECT; | ||
| 843 | v->data[0].object = Fpoint_marker (); | ||
| 837 | 844 | ||
| 838 | data[0] = Fpoint_marker (); | ||
| 839 | /* Do not copy the mark if it points to nowhere. */ | 845 | /* Do not copy the mark if it points to nowhere. */ |
| 840 | data[1] = (XMARKER (BVAR (current_buffer, mark))->buffer | 846 | v->type1 = SAVE_OBJECT; |
| 841 | ? Fcopy_marker (BVAR (current_buffer, mark), Qnil) | 847 | v->data[1].object = (XMARKER (BVAR (current_buffer, mark))->buffer |
| 842 | : Qnil); | 848 | ? Fcopy_marker (BVAR (current_buffer, mark), Qnil) |
| 849 | : Qnil); | ||
| 850 | |||
| 843 | /* Selected window if current buffer is shown in it, nil otherwise. */ | 851 | /* Selected window if current buffer is shown in it, nil otherwise. */ |
| 844 | data[2] = ((XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer) | 852 | v->type2 = SAVE_OBJECT; |
| 845 | ? selected_window : Qnil); | 853 | v->data[2].object |
| 846 | data[3] = BVAR (current_buffer, mark_active); | 854 | = ((XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer) |
| 855 | ? selected_window : Qnil); | ||
| 856 | |||
| 857 | v->type3 = SAVE_OBJECT; | ||
| 858 | v->data[3].object = BVAR (current_buffer, mark_active); | ||
| 847 | 859 | ||
| 848 | save = make_save_value (data, 4); | ||
| 849 | XSAVE_VALUE (save)->dogc = 1; | ||
| 850 | return save; | 860 | return save; |
| 851 | } | 861 | } |
| 852 | 862 | ||
| @@ -855,10 +865,15 @@ save_excursion_save (void) | |||
| 855 | Lisp_Object | 865 | Lisp_Object |
| 856 | save_excursion_restore (Lisp_Object info) | 866 | save_excursion_restore (Lisp_Object info) |
| 857 | { | 867 | { |
| 858 | Lisp_Object tem, tem1, omark, nmark, *data = XSAVE_VALUE (info)->pointer; | 868 | Lisp_Object tem, tem1, omark, nmark; |
| 859 | struct gcpro gcpro1, gcpro2, gcpro3; | 869 | struct gcpro gcpro1, gcpro2, gcpro3; |
| 870 | register struct Lisp_Save_Value *v = XSAVE_VALUE (info); | ||
| 871 | |||
| 872 | /* Paranoid. */ | ||
| 873 | eassert (v->type0 == SAVE_OBJECT && v->type1 == SAVE_OBJECT | ||
| 874 | && v->type2 == SAVE_OBJECT && v->type3 == SAVE_OBJECT); | ||
| 860 | 875 | ||
| 861 | tem = Fmarker_buffer (data[0]); | 876 | tem = Fmarker_buffer (v->data[0].object); |
| 862 | /* If we're unwinding to top level, saved buffer may be deleted. This | 877 | /* If we're unwinding to top level, saved buffer may be deleted. This |
| 863 | means that all of its markers are unchained and so tem is nil. */ | 878 | means that all of its markers are unchained and so tem is nil. */ |
| 864 | if (NILP (tem)) | 879 | if (NILP (tem)) |
| @@ -870,12 +885,12 @@ save_excursion_restore (Lisp_Object info) | |||
| 870 | Fset_buffer (tem); | 885 | Fset_buffer (tem); |
| 871 | 886 | ||
| 872 | /* Point marker. */ | 887 | /* Point marker. */ |
| 873 | tem = data[0]; | 888 | tem = v->data[0].object; |
| 874 | Fgoto_char (tem); | 889 | Fgoto_char (tem); |
| 875 | unchain_marker (XMARKER (tem)); | 890 | unchain_marker (XMARKER (tem)); |
| 876 | 891 | ||
| 877 | /* Mark marker. */ | 892 | /* Mark marker. */ |
| 878 | tem = data[1]; | 893 | tem = v->data[1].object; |
| 879 | omark = Fmarker_position (BVAR (current_buffer, mark)); | 894 | omark = Fmarker_position (BVAR (current_buffer, mark)); |
| 880 | if (NILP (tem)) | 895 | if (NILP (tem)) |
| 881 | unchain_marker (XMARKER (BVAR (current_buffer, mark))); | 896 | unchain_marker (XMARKER (BVAR (current_buffer, mark))); |
| @@ -887,7 +902,7 @@ save_excursion_restore (Lisp_Object info) | |||
| 887 | } | 902 | } |
| 888 | 903 | ||
| 889 | /* Mark active. */ | 904 | /* Mark active. */ |
| 890 | tem = data[3]; | 905 | tem = v->data[3].object; |
| 891 | tem1 = BVAR (current_buffer, mark_active); | 906 | tem1 = BVAR (current_buffer, mark_active); |
| 892 | bset_mark_active (current_buffer, tem); | 907 | bset_mark_active (current_buffer, tem); |
| 893 | 908 | ||
| @@ -911,7 +926,7 @@ save_excursion_restore (Lisp_Object info) | |||
| 911 | /* If buffer was visible in a window, and a different window was | 926 | /* If buffer was visible in a window, and a different window was |
| 912 | selected, and the old selected window is still showing this | 927 | selected, and the old selected window is still showing this |
| 913 | buffer, restore point in that window. */ | 928 | buffer, restore point in that window. */ |
| 914 | tem = data[2]; | 929 | tem = v->data[2].object; |
| 915 | if (WINDOWP (tem) | 930 | if (WINDOWP (tem) |
| 916 | && !EQ (tem, selected_window) | 931 | && !EQ (tem, selected_window) |
| 917 | && (tem1 = XWINDOW (tem)->buffer, | 932 | && (tem1 = XWINDOW (tem)->buffer, |
| @@ -925,7 +940,7 @@ save_excursion_restore (Lisp_Object info) | |||
| 925 | 940 | ||
| 926 | out: | 941 | out: |
| 927 | 942 | ||
| 928 | free_save_value (info); | 943 | free_misc (info); |
| 929 | return Qnil; | 944 | return Qnil; |
| 930 | } | 945 | } |
| 931 | 946 | ||
| @@ -4258,7 +4273,7 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 4258 | memcpy (buf, initial_buffer, used); | 4273 | memcpy (buf, initial_buffer, used); |
| 4259 | } | 4274 | } |
| 4260 | else | 4275 | else |
| 4261 | XSAVE_VALUE (buf_save_value)->pointer = buf = xrealloc (buf, bufsize); | 4276 | XSAVE_POINTER (buf_save_value) = buf = xrealloc (buf, bufsize); |
| 4262 | 4277 | ||
| 4263 | p = buf + used; | 4278 | p = buf + used; |
| 4264 | } | 4279 | } |
diff --git a/src/eval.c b/src/eval.c index c49f8e85c2f..030bf14bcea 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -1931,7 +1931,10 @@ eval_sub (Lisp_Object form) | |||
| 1931 | return form; | 1931 | return form; |
| 1932 | 1932 | ||
| 1933 | QUIT; | 1933 | QUIT; |
| 1934 | |||
| 1935 | GCPRO1 (form); | ||
| 1934 | maybe_gc (); | 1936 | maybe_gc (); |
| 1937 | UNGCPRO; | ||
| 1935 | 1938 | ||
| 1936 | if (++lisp_eval_depth > max_lisp_eval_depth) | 1939 | if (++lisp_eval_depth > max_lisp_eval_depth) |
| 1937 | { | 1940 | { |
diff --git a/src/fileio.c b/src/fileio.c index 5e9b36ee44a..d468576d639 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -5507,7 +5507,7 @@ static Lisp_Object | |||
| 5507 | do_auto_save_unwind (Lisp_Object arg) /* used as unwind-protect function */ | 5507 | do_auto_save_unwind (Lisp_Object arg) /* used as unwind-protect function */ |
| 5508 | 5508 | ||
| 5509 | { | 5509 | { |
| 5510 | FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer; | 5510 | FILE *stream = XSAVE_POINTER (arg); |
| 5511 | auto_saving = 0; | 5511 | auto_saving = 0; |
| 5512 | if (stream != NULL) | 5512 | if (stream != NULL) |
| 5513 | { | 5513 | { |
diff --git a/src/font.c b/src/font.c index a3a41006f9b..c4153428147 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -1857,7 +1857,7 @@ otf_open (Lisp_Object file) | |||
| 1857 | OTF *otf; | 1857 | OTF *otf; |
| 1858 | 1858 | ||
| 1859 | if (! NILP (val)) | 1859 | if (! NILP (val)) |
| 1860 | otf = XSAVE_VALUE (XCDR (val))->pointer; | 1860 | otf = XSAVE_POINTER (XCDR (val)); |
| 1861 | else | 1861 | else |
| 1862 | { | 1862 | { |
| 1863 | otf = STRINGP (file) ? OTF_open (SSDATA (file)) : NULL; | 1863 | otf = STRINGP (file) ? OTF_open (SSDATA (file)) : NULL; |
diff --git a/src/ftfont.c b/src/ftfont.c index 1ada95d377c..1d7678bfe09 100644 --- a/src/ftfont.c +++ b/src/ftfont.c | |||
| @@ -393,16 +393,14 @@ ftfont_lookup_cache (Lisp_Object key, enum ftfont_cache_for cache_for) | |||
| 393 | cache_data = xmalloc (sizeof *cache_data); | 393 | cache_data = xmalloc (sizeof *cache_data); |
| 394 | cache_data->ft_face = NULL; | 394 | cache_data->ft_face = NULL; |
| 395 | cache_data->fc_charset = NULL; | 395 | cache_data->fc_charset = NULL; |
| 396 | val = make_save_value (NULL, 0); | 396 | val = make_save_value (cache_data, 0); |
| 397 | XSAVE_VALUE (val)->integer = 0; | ||
| 398 | XSAVE_VALUE (val)->pointer = cache_data; | ||
| 399 | cache = Fcons (Qnil, val); | 397 | cache = Fcons (Qnil, val); |
| 400 | Fputhash (key, cache, ft_face_cache); | 398 | Fputhash (key, cache, ft_face_cache); |
| 401 | } | 399 | } |
| 402 | else | 400 | else |
| 403 | { | 401 | { |
| 404 | val = XCDR (cache); | 402 | val = XCDR (cache); |
| 405 | cache_data = XSAVE_VALUE (val)->pointer; | 403 | cache_data = XSAVE_POINTER (val); |
| 406 | } | 404 | } |
| 407 | 405 | ||
| 408 | if (cache_for == FTFONT_CACHE_FOR_ENTITY) | 406 | if (cache_for == FTFONT_CACHE_FOR_ENTITY) |
| @@ -468,7 +466,7 @@ ftfont_get_fc_charset (Lisp_Object entity) | |||
| 468 | 466 | ||
| 469 | cache = ftfont_lookup_cache (entity, FTFONT_CACHE_FOR_CHARSET); | 467 | cache = ftfont_lookup_cache (entity, FTFONT_CACHE_FOR_CHARSET); |
| 470 | val = XCDR (cache); | 468 | val = XCDR (cache); |
| 471 | cache_data = XSAVE_VALUE (val)->pointer; | 469 | cache_data = XSAVE_POINTER (val); |
| 472 | return cache_data->fc_charset; | 470 | return cache_data->fc_charset; |
| 473 | } | 471 | } |
| 474 | 472 | ||
| @@ -1200,9 +1198,9 @@ ftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size) | |||
| 1200 | filename = XCAR (val); | 1198 | filename = XCAR (val); |
| 1201 | idx = XCDR (val); | 1199 | idx = XCDR (val); |
| 1202 | val = XCDR (cache); | 1200 | val = XCDR (cache); |
| 1203 | cache_data = XSAVE_VALUE (XCDR (cache))->pointer; | 1201 | cache_data = XSAVE_POINTER (XCDR (cache)); |
| 1204 | ft_face = cache_data->ft_face; | 1202 | ft_face = cache_data->ft_face; |
| 1205 | if (XSAVE_VALUE (val)->integer > 0) | 1203 | if (XSAVE_INTEGER (val) > 0) |
| 1206 | { | 1204 | { |
| 1207 | /* FT_Face in this cache is already used by the different size. */ | 1205 | /* FT_Face in this cache is already used by the different size. */ |
| 1208 | if (FT_New_Size (ft_face, &ft_size) != 0) | 1206 | if (FT_New_Size (ft_face, &ft_size) != 0) |
| @@ -1213,13 +1211,13 @@ ftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size) | |||
| 1213 | return Qnil; | 1211 | return Qnil; |
| 1214 | } | 1212 | } |
| 1215 | } | 1213 | } |
| 1216 | XSAVE_VALUE (val)->integer++; | 1214 | XSAVE_INTEGER (val)++; |
| 1217 | size = XINT (AREF (entity, FONT_SIZE_INDEX)); | 1215 | size = XINT (AREF (entity, FONT_SIZE_INDEX)); |
| 1218 | if (size == 0) | 1216 | if (size == 0) |
| 1219 | size = pixel_size; | 1217 | size = pixel_size; |
| 1220 | if (FT_Set_Pixel_Sizes (ft_face, size, size) != 0) | 1218 | if (FT_Set_Pixel_Sizes (ft_face, size, size) != 0) |
| 1221 | { | 1219 | { |
| 1222 | if (XSAVE_VALUE (val)->integer == 0) | 1220 | if (XSAVE_INTEGER (val) == 0) |
| 1223 | FT_Done_Face (ft_face); | 1221 | FT_Done_Face (ft_face); |
| 1224 | return Qnil; | 1222 | return Qnil; |
| 1225 | } | 1223 | } |
| @@ -1328,10 +1326,10 @@ ftfont_close (FRAME_PTR f, struct font *font) | |||
| 1328 | cache = ftfont_lookup_cache (val, FTFONT_CACHE_FOR_FACE); | 1326 | cache = ftfont_lookup_cache (val, FTFONT_CACHE_FOR_FACE); |
| 1329 | eassert (CONSP (cache)); | 1327 | eassert (CONSP (cache)); |
| 1330 | val = XCDR (cache); | 1328 | val = XCDR (cache); |
| 1331 | (XSAVE_VALUE (val)->integer)--; | 1329 | (XSAVE_INTEGER (val))--; |
| 1332 | if (XSAVE_VALUE (val)->integer == 0) | 1330 | if (XSAVE_INTEGER (val) == 0) |
| 1333 | { | 1331 | { |
| 1334 | struct ftfont_cache_data *cache_data = XSAVE_VALUE (val)->pointer; | 1332 | struct ftfont_cache_data *cache_data = XSAVE_POINTER (val); |
| 1335 | 1333 | ||
| 1336 | FT_Done_Face (cache_data->ft_face); | 1334 | FT_Done_Face (cache_data->ft_face); |
| 1337 | #ifdef HAVE_LIBOTF | 1335 | #ifdef HAVE_LIBOTF |
diff --git a/src/gtkutil.c b/src/gtkutil.c index af845f69e62..259e0e971fd 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -1650,8 +1650,7 @@ xg_dialog_response_cb (GtkDialog *w, | |||
| 1650 | static Lisp_Object | 1650 | static Lisp_Object |
| 1651 | pop_down_dialog (Lisp_Object arg) | 1651 | pop_down_dialog (Lisp_Object arg) |
| 1652 | { | 1652 | { |
| 1653 | struct Lisp_Save_Value *p = XSAVE_VALUE (arg); | 1653 | struct xg_dialog_data *dd = XSAVE_POINTER (arg); |
| 1654 | struct xg_dialog_data *dd = (struct xg_dialog_data *) p->pointer; | ||
| 1655 | 1654 | ||
| 1656 | block_input (); | 1655 | block_input (); |
| 1657 | if (dd->w) gtk_widget_destroy (dd->w); | 1656 | if (dd->w) gtk_widget_destroy (dd->w); |
diff --git a/src/keymap.c b/src/keymap.c index d1ddd55a358..82c9e980221 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -565,15 +565,14 @@ map_keymap_char_table_item (Lisp_Object args, Lisp_Object key, Lisp_Object val) | |||
| 565 | { | 565 | { |
| 566 | if (!NILP (val)) | 566 | if (!NILP (val)) |
| 567 | { | 567 | { |
| 568 | map_keymap_function_t fun | 568 | map_keymap_function_t fun = XSAVE_POINTER (XCAR (args)); |
| 569 | = (map_keymap_function_t) XSAVE_VALUE (XCAR (args))->pointer; | ||
| 570 | args = XCDR (args); | 569 | args = XCDR (args); |
| 571 | /* If the key is a range, make a copy since map_char_table modifies | 570 | /* If the key is a range, make a copy since map_char_table modifies |
| 572 | it in place. */ | 571 | it in place. */ |
| 573 | if (CONSP (key)) | 572 | if (CONSP (key)) |
| 574 | key = Fcons (XCAR (key), XCDR (key)); | 573 | key = Fcons (XCAR (key), XCDR (key)); |
| 575 | map_keymap_item (fun, XCDR (args), key, val, | 574 | map_keymap_item (fun, XCDR (args), key, val, |
| 576 | XSAVE_VALUE (XCAR (args))->pointer); | 575 | XSAVE_POINTER (XCAR (args))); |
| 577 | } | 576 | } |
| 578 | } | 577 | } |
| 579 | 578 | ||
diff --git a/src/lisp.h b/src/lisp.h index d4d34ac19ba..3ac2bda94c5 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -1383,20 +1383,48 @@ struct Lisp_Overlay | |||
| 1383 | Lisp_Object plist; | 1383 | Lisp_Object plist; |
| 1384 | }; | 1384 | }; |
| 1385 | 1385 | ||
| 1386 | /* Hold a C pointer for later use. | 1386 | /* Types of data which may be saved in a Lisp_Save_Value. */ |
| 1387 | This type of object is used in the arg to record_unwind_protect. */ | 1387 | |
| 1388 | enum | ||
| 1389 | { | ||
| 1390 | SAVE_UNUSED, | ||
| 1391 | SAVE_INTEGER, | ||
| 1392 | SAVE_POINTER, | ||
| 1393 | SAVE_OBJECT | ||
| 1394 | }; | ||
| 1395 | |||
| 1396 | /* Special object used to hold a different values for later use. */ | ||
| 1397 | |||
| 1388 | struct Lisp_Save_Value | 1398 | struct Lisp_Save_Value |
| 1389 | { | 1399 | { |
| 1390 | ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Save_Value */ | 1400 | ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Save_Value */ |
| 1391 | unsigned gcmarkbit : 1; | 1401 | unsigned gcmarkbit : 1; |
| 1392 | int spacer : 14; | 1402 | int spacer : 6; |
| 1393 | /* If DOGC is set, POINTER is the address of a memory | 1403 | /* If `area' is nonzero, `data[0].pointer' is the address of a memory area |
| 1394 | area containing INTEGER potential Lisp_Objects. */ | 1404 | containing `data[1].integer' potential Lisp_Objects. The rest of `data' |
| 1395 | unsigned int dogc : 1; | 1405 | fields are unused. */ |
| 1396 | void *pointer; | 1406 | unsigned area : 1; |
| 1397 | ptrdiff_t integer; | 1407 | /* If `area' is zero, `data[N]' may hold different objects which type is |
| 1408 | encoded in `typeN' fields as described by the anonymous enum above. | ||
| 1409 | E.g. if `type0' is SAVE_INTEGER, `data[0].integer' is in use. */ | ||
| 1410 | unsigned type0 : 2; | ||
| 1411 | unsigned type1 : 2; | ||
| 1412 | unsigned type2 : 2; | ||
| 1413 | unsigned type3 : 2; | ||
| 1414 | union { | ||
| 1415 | void *pointer; | ||
| 1416 | ptrdiff_t integer; | ||
| 1417 | Lisp_Object object; | ||
| 1418 | } data[4]; | ||
| 1398 | }; | 1419 | }; |
| 1399 | 1420 | ||
| 1421 | /* Compatibility macro to set and extract saved pointer. */ | ||
| 1422 | |||
| 1423 | #define XSAVE_POINTER(obj) XSAVE_VALUE (obj)->data[0].pointer | ||
| 1424 | |||
| 1425 | /* Likewise for the saved integer. */ | ||
| 1426 | |||
| 1427 | #define XSAVE_INTEGER(obj) XSAVE_VALUE (obj)->data[1].integer | ||
| 1400 | 1428 | ||
| 1401 | /* A miscellaneous object, when it's on the free list. */ | 1429 | /* A miscellaneous object, when it's on the free list. */ |
| 1402 | struct Lisp_Free | 1430 | struct Lisp_Free |
| @@ -2898,6 +2926,8 @@ extern void memory_warnings (void *, void (*warnfun) (const char *)); | |||
| 2898 | 2926 | ||
| 2899 | /* Defined in alloc.c. */ | 2927 | /* Defined in alloc.c. */ |
| 2900 | extern void check_pure_size (void); | 2928 | extern void check_pure_size (void); |
| 2929 | extern Lisp_Object allocate_misc (enum Lisp_Misc_Type); | ||
| 2930 | extern void free_misc (Lisp_Object); | ||
| 2901 | extern void allocate_string_data (struct Lisp_String *, EMACS_INT, EMACS_INT); | 2931 | extern void allocate_string_data (struct Lisp_String *, EMACS_INT, EMACS_INT); |
| 2902 | extern void malloc_warning (const char *); | 2932 | extern void malloc_warning (const char *); |
| 2903 | extern _Noreturn void memory_full (size_t); | 2933 | extern _Noreturn void memory_full (size_t); |
| @@ -3700,7 +3730,7 @@ extern void *record_xmalloc (size_t); | |||
| 3700 | Lisp_Object arg_; \ | 3730 | Lisp_Object arg_; \ |
| 3701 | buf = xmalloc ((nelt) * word_size); \ | 3731 | buf = xmalloc ((nelt) * word_size); \ |
| 3702 | arg_ = make_save_value (buf, nelt); \ | 3732 | arg_ = make_save_value (buf, nelt); \ |
| 3703 | XSAVE_VALUE (arg_)->dogc = 1; \ | 3733 | XSAVE_VALUE (arg_)->area = 1; \ |
| 3704 | sa_must_free = 1; \ | 3734 | sa_must_free = 1; \ |
| 3705 | record_unwind_protect (safe_alloca_unwind, arg_); \ | 3735 | record_unwind_protect (safe_alloca_unwind, arg_); \ |
| 3706 | } \ | 3736 | } \ |
diff --git a/src/lread.c b/src/lread.c index 2b96dc16359..ced690a77b0 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -1357,7 +1357,7 @@ Return t if the file exists and loads successfully. */) | |||
| 1357 | static Lisp_Object | 1357 | static Lisp_Object |
| 1358 | load_unwind (Lisp_Object arg) /* Used as unwind-protect function in load. */ | 1358 | load_unwind (Lisp_Object arg) /* Used as unwind-protect function in load. */ |
| 1359 | { | 1359 | { |
| 1360 | FILE *stream = (FILE *) XSAVE_VALUE (arg)->pointer; | 1360 | FILE *stream = XSAVE_POINTER (arg); |
| 1361 | if (stream != NULL) | 1361 | if (stream != NULL) |
| 1362 | { | 1362 | { |
| 1363 | block_input (); | 1363 | block_input (); |
diff --git a/src/nsmenu.m b/src/nsmenu.m index 39797d414f0..3e6fa54b047 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m | |||
| @@ -1347,8 +1347,7 @@ struct Popdown_data | |||
| 1347 | static Lisp_Object | 1347 | static Lisp_Object |
| 1348 | pop_down_menu (Lisp_Object arg) | 1348 | pop_down_menu (Lisp_Object arg) |
| 1349 | { | 1349 | { |
| 1350 | struct Lisp_Save_Value *p = XSAVE_VALUE (arg); | 1350 | struct Popdown_data *unwind_data = XSAVE_POINTER (arg); |
| 1351 | struct Popdown_data *unwind_data = (struct Popdown_data *) p->pointer; | ||
| 1352 | 1351 | ||
| 1353 | block_input (); | 1352 | block_input (); |
| 1354 | if (popup_activated_flag) | 1353 | if (popup_activated_flag) |
diff --git a/src/nsterm.h b/src/nsterm.h index e58b8493c94..7732e6d27cc 100644 --- a/src/nsterm.h +++ b/src/nsterm.h | |||
| @@ -675,9 +675,9 @@ struct x_output | |||
| 675 | #define FRAME_FONT(f) ((f)->output_data.ns->font) | 675 | #define FRAME_FONT(f) ((f)->output_data.ns->font) |
| 676 | 676 | ||
| 677 | #ifdef __OBJC__ | 677 | #ifdef __OBJC__ |
| 678 | #define XNS_SCROLL_BAR(vec) ((id) XSAVE_VALUE (vec)->pointer) | 678 | #define XNS_SCROLL_BAR(vec) ((id) XSAVE_POINTER (vec)) |
| 679 | #else | 679 | #else |
| 680 | #define XNS_SCROLL_BAR(vec) XSAVE_VALUE (vec)->pointer | 680 | #define XNS_SCROLL_BAR(vec) XSAVE_POINTER (vec) |
| 681 | #endif | 681 | #endif |
| 682 | 682 | ||
| 683 | /* Compute pixel size for vertical scroll bars */ | 683 | /* Compute pixel size for vertical scroll bars */ |
diff --git a/src/print.c b/src/print.c index b5e45438577..8420f8075a5 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -2036,8 +2036,9 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag | |||
| 2036 | PRINTCHAR ('>'); | 2036 | PRINTCHAR ('>'); |
| 2037 | break; | 2037 | break; |
| 2038 | 2038 | ||
| 2039 | /* Remaining cases shouldn't happen in normal usage, but let's print | 2039 | /* Remaining cases shouldn't happen in normal usage, but let's |
| 2040 | them anyway for the benefit of the debugger. */ | 2040 | print them anyway for the benefit of the debugger. */ |
| 2041 | |||
| 2041 | case Lisp_Misc_Free: | 2042 | case Lisp_Misc_Free: |
| 2042 | strout ("#<misc free cell>", -1, -1, printcharfun); | 2043 | strout ("#<misc free cell>", -1, -1, printcharfun); |
| 2043 | break; | 2044 | break; |
| @@ -2048,20 +2049,28 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag | |||
| 2048 | struct Lisp_Save_Value *v = XSAVE_VALUE (obj); | 2049 | struct Lisp_Save_Value *v = XSAVE_VALUE (obj); |
| 2049 | 2050 | ||
| 2050 | strout ("#<save-value ", -1, -1, printcharfun); | 2051 | strout ("#<save-value ", -1, -1, printcharfun); |
| 2051 | if (v->dogc) | 2052 | |
| 2053 | if (v->area) | ||
| 2052 | { | 2054 | { |
| 2053 | int lim = min (v->integer, 8); | 2055 | ptrdiff_t amount = v->data[1].integer; |
| 2054 | 2056 | ||
| 2055 | /* Try to print up to 8 objects we have saved. Although | 2057 | #if GC_MARK_STACK |
| 2056 | valid_lisp_object_p is slow, this shouldn't be a real | 2058 | |
| 2057 | bottleneck because such a saved values are quite rare. */ | 2059 | /* If GC_MARK_STACK, valid_lisp_object_p is quite reliable, |
| 2060 | and so we try to print up to 8 objects we have saved. | ||
| 2061 | Although valid_lisp_object_p is slow, this shouldn't be | ||
| 2062 | a real bottleneck because we do not use this code under | ||
| 2063 | normal circumstances. */ | ||
| 2058 | 2064 | ||
| 2059 | i = sprintf (buf, "with %"pD"d objects", v->integer); | 2065 | int limit = min (amount, 8); |
| 2066 | Lisp_Object *area = v->data[0].pointer; | ||
| 2067 | |||
| 2068 | i = sprintf (buf, "with %"pD"d objects", amount); | ||
| 2060 | strout (buf, i, i, printcharfun); | 2069 | strout (buf, i, i, printcharfun); |
| 2061 | 2070 | ||
| 2062 | for (i = 0; i < lim; i++) | 2071 | for (i = 0; i < limit; i++) |
| 2063 | { | 2072 | { |
| 2064 | Lisp_Object maybe = ((Lisp_Object *) v->pointer)[i]; | 2073 | Lisp_Object maybe = area[i]; |
| 2065 | 2074 | ||
| 2066 | if (valid_lisp_object_p (maybe) > 0) | 2075 | if (valid_lisp_object_p (maybe) > 0) |
| 2067 | { | 2076 | { |
| @@ -2071,13 +2080,49 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag | |||
| 2071 | else | 2080 | else |
| 2072 | strout (" <invalid>", -1, -1, printcharfun); | 2081 | strout (" <invalid>", -1, -1, printcharfun); |
| 2073 | } | 2082 | } |
| 2074 | if (i == lim && i < v->integer) | 2083 | if (i == limit && i < amount) |
| 2075 | strout (" ...", 4, 4, printcharfun); | 2084 | strout (" ...", 4, 4, printcharfun); |
| 2085 | |||
| 2086 | #else /* not GC_MARK_STACK */ | ||
| 2087 | |||
| 2088 | /* If !GC_MARK_STACK, we have no reliable way to find | ||
| 2089 | whether Lisp_Object pointers points to an initialized | ||
| 2090 | objects, and so we do not ever trying to print them. */ | ||
| 2091 | |||
| 2092 | i = sprintf (buf, "with %"pD"d objects", amount); | ||
| 2093 | strout (buf, i, i, printcharfun); | ||
| 2094 | |||
| 2095 | #endif /* GC_MARK_STACK */ | ||
| 2076 | } | 2096 | } |
| 2077 | else | 2097 | else |
| 2078 | { | 2098 | { |
| 2079 | i = sprintf (buf, "ptr=%p int=%"pD"d", v->pointer, v->integer); | 2099 | /* Print each `data[N]' slot according to its type. */ |
| 2080 | strout (buf, i, i, printcharfun); | 2100 | |
| 2101 | #define PRINTX(index) \ | ||
| 2102 | do { \ | ||
| 2103 | i = 0; \ | ||
| 2104 | if (v->type ## index == SAVE_UNUSED) \ | ||
| 2105 | i = sprintf (buf, "<unused>"); \ | ||
| 2106 | else if (v->type ## index == SAVE_INTEGER) \ | ||
| 2107 | i = sprintf (buf, "<integer %"pD"d>", v->data[index].integer); \ | ||
| 2108 | else if (v->type ## index == SAVE_POINTER) \ | ||
| 2109 | i = sprintf (buf, "<pointer %p>", v->data[index].pointer); \ | ||
| 2110 | else /* SAVE_OBJECT */ \ | ||
| 2111 | print_object (v->data[index].object, printcharfun, escapeflag); \ | ||
| 2112 | if (i) \ | ||
| 2113 | strout (buf, i, i, printcharfun); \ | ||
| 2114 | } while (0) | ||
| 2115 | |||
| 2116 | PRINTX (0); | ||
| 2117 | PRINTCHAR (' '); | ||
| 2118 | PRINTX (1); | ||
| 2119 | PRINTCHAR (' '); | ||
| 2120 | PRINTX (2); | ||
| 2121 | PRINTCHAR (' '); | ||
| 2122 | PRINTX (3); | ||
| 2123 | |||
| 2124 | #undef PRINTX | ||
| 2125 | |||
| 2081 | } | 2126 | } |
| 2082 | PRINTCHAR ('>'); | 2127 | PRINTCHAR ('>'); |
| 2083 | } | 2128 | } |
diff --git a/src/xfns.c b/src/xfns.c index 315d5093716..fe99d36f9f4 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -5292,8 +5292,7 @@ file_dialog_unmap_cb (Widget widget, XtPointer client_data, XtPointer call_data) | |||
| 5292 | static Lisp_Object | 5292 | static Lisp_Object |
| 5293 | clean_up_file_dialog (Lisp_Object arg) | 5293 | clean_up_file_dialog (Lisp_Object arg) |
| 5294 | { | 5294 | { |
| 5295 | struct Lisp_Save_Value *p = XSAVE_VALUE (arg); | 5295 | Widget dialog = XSAVE_POINTER (arg); |
| 5296 | Widget dialog = (Widget) p->pointer; | ||
| 5297 | 5296 | ||
| 5298 | /* Clean up. */ | 5297 | /* Clean up. */ |
| 5299 | block_input (); | 5298 | block_input (); |
diff --git a/src/xmenu.c b/src/xmenu.c index 3d76070c336..6d880993d19 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -1411,11 +1411,9 @@ popup_selection_callback (GtkWidget *widget, gpointer client_data) | |||
| 1411 | static Lisp_Object | 1411 | static Lisp_Object |
| 1412 | pop_down_menu (Lisp_Object arg) | 1412 | pop_down_menu (Lisp_Object arg) |
| 1413 | { | 1413 | { |
| 1414 | struct Lisp_Save_Value *p = XSAVE_VALUE (arg); | ||
| 1415 | |||
| 1416 | popup_activated_flag = 0; | 1414 | popup_activated_flag = 0; |
| 1417 | block_input (); | 1415 | block_input (); |
| 1418 | gtk_widget_destroy (GTK_WIDGET (p->pointer)); | 1416 | gtk_widget_destroy (GTK_WIDGET (XSAVE_POINTER (arg))); |
| 1419 | unblock_input (); | 1417 | unblock_input (); |
| 1420 | return Qnil; | 1418 | return Qnil; |
| 1421 | } | 1419 | } |
| @@ -1612,11 +1610,7 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, | |||
| 1612 | static Lisp_Object | 1610 | static Lisp_Object |
| 1613 | cleanup_widget_value_tree (Lisp_Object arg) | 1611 | cleanup_widget_value_tree (Lisp_Object arg) |
| 1614 | { | 1612 | { |
| 1615 | struct Lisp_Save_Value *p = XSAVE_VALUE (arg); | 1613 | free_menubar_widget_value_tree (XSAVE_POINTER (arg)); |
| 1616 | widget_value *wv = p->pointer; | ||
| 1617 | |||
| 1618 | free_menubar_widget_value_tree (wv); | ||
| 1619 | |||
| 1620 | return Qnil; | 1614 | return Qnil; |
| 1621 | } | 1615 | } |
| 1622 | 1616 | ||
| @@ -2242,11 +2236,8 @@ menu_help_callback (char const *help_string, int pane, int item) | |||
| 2242 | static Lisp_Object | 2236 | static Lisp_Object |
| 2243 | pop_down_menu (Lisp_Object arg) | 2237 | pop_down_menu (Lisp_Object arg) |
| 2244 | { | 2238 | { |
| 2245 | struct Lisp_Save_Value *p1 = XSAVE_VALUE (Fcar (arg)); | 2239 | FRAME_PTR f = XSAVE_POINTER (Fcar (arg)); |
| 2246 | struct Lisp_Save_Value *p2 = XSAVE_VALUE (Fcdr (arg)); | 2240 | XMenu *menu = XSAVE_POINTER (Fcdr (arg)); |
| 2247 | |||
| 2248 | FRAME_PTR f = p1->pointer; | ||
| 2249 | XMenu *menu = p2->pointer; | ||
| 2250 | 2241 | ||
| 2251 | block_input (); | 2242 | block_input (); |
| 2252 | #ifndef MSDOS | 2243 | #ifndef MSDOS |
diff --git a/src/xselect.c b/src/xselect.c index f43efab827b..9abfb2931f8 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -1120,7 +1120,7 @@ unexpect_property_change (struct prop_location *location) | |||
| 1120 | static Lisp_Object | 1120 | static Lisp_Object |
| 1121 | wait_for_property_change_unwind (Lisp_Object loc) | 1121 | wait_for_property_change_unwind (Lisp_Object loc) |
| 1122 | { | 1122 | { |
| 1123 | struct prop_location *location = XSAVE_VALUE (loc)->pointer; | 1123 | struct prop_location *location = XSAVE_POINTER (loc); |
| 1124 | 1124 | ||
| 1125 | unexpect_property_change (location); | 1125 | unexpect_property_change (location); |
| 1126 | if (location == property_change_reply_object) | 1126 | if (location == property_change_reply_object) |
diff --git a/test/ChangeLog b/test/ChangeLog index 7b058c1d2bd..472a6073884 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-01-14 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * automated/compile-tests.el (compile-tests--test-regexps-data): | ||
| 4 | Fix interpretation of gnu line.col1-col2 format. (Bug#13335) | ||
| 5 | |||
| 1 | 2013-01-10 Wolfgang Jenkner <wjenkner@inode.at> | 6 | 2013-01-10 Wolfgang Jenkner <wjenkner@inode.at> |
| 2 | 7 | ||
| 3 | * automated/man-tests.el: New file. | 8 | * automated/man-tests.el: New file. |
diff --git a/test/automated/compile-tests.el b/test/automated/compile-tests.el index f976efe72de..682867d1178 100644 --- a/test/automated/compile-tests.el +++ b/test/automated/compile-tests.el | |||
| @@ -176,8 +176,10 @@ | |||
| 176 | ("foo.c:8.23: note: message" 1 23 8 "foo.c") | 176 | ("foo.c:8.23: note: message" 1 23 8 "foo.c") |
| 177 | ("foo.c:8.23: info: message" 1 23 8 "foo.c") | 177 | ("foo.c:8.23: info: message" 1 23 8 "foo.c") |
| 178 | ("foo.c:8:23:information: message" 1 23 8 "foo.c") | 178 | ("foo.c:8:23:information: message" 1 23 8 "foo.c") |
| 179 | ("foo.c:8.23-45: Informational: message" 1 (23 . nil) (8 . 45) "foo.c") | 179 | ("foo.c:8.23-45: Informational: message" 1 (23 . 46) (8 . nil) "foo.c") |
| 180 | ("foo.c:8-23: message" 1 nil (8 . 23) "foo.c") | 180 | ("foo.c:8-23: message" 1 nil (8 . 23) "foo.c") |
| 181 | ;; The next one is not in the GNU standards AFAICS. | ||
| 182 | ;; Here we seem to interpret it as LINE1-LINE2.COL2. | ||
| 181 | ("foo.c:8-45.3: message" 1 (nil . 4) (8 . 45) "foo.c") | 183 | ("foo.c:8-45.3: message" 1 (nil . 4) (8 . 45) "foo.c") |
| 182 | ("foo.c:8.23-9.1: message" 1 (23 . 2) (8 . 9) "foo.c") | 184 | ("foo.c:8.23-9.1: message" 1 (23 . 2) (8 . 9) "foo.c") |
| 183 | ("jade:dbcommon.dsl:133:17:E: missing argument for function call" | 185 | ("jade:dbcommon.dsl:133:17:E: missing argument for function call" |