Now on revision 109240. ------------------------------------------------------------ revno: 109240 fixes bug(s): http://debbugs.gnu.org/12036 committer: Paul Eggert branch nick: trunk timestamp: Fri 2012-07-27 13:50:02 -0700 message: Adjust GDB to reflect pvec_type changes. * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the 2012-07-04 changes to pseudovector representation. Problem reported by Eli Zaretskii in . diff: === modified file 'src/.gdbinit' --- src/.gdbinit 2012-07-27 06:18:36 +0000 +++ src/.gdbinit 2012-07-27 20:50:02 +0000 @@ -653,7 +653,11 @@ define xvectype xgetptr $ set $size = ((struct Lisp_Vector *) $ptr)->header.size - output ($size & PSEUDOVECTOR_FLAG) ? (enum pvec_type) ($size & PVEC_TYPE_MASK) : $size & ~ARRAY_MARK_FLAG + if ($size & PSEUDOVECTOR_FLAG) + output (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_SIZE_BITS) + else + output $size & ~ARRAY_MARK_FLAG + end echo \n end document xvectype @@ -992,7 +996,7 @@ if $type == Lisp_Vectorlike set $size = ((struct Lisp_Vector *) $ptr)->header.size if ($size & PSEUDOVECTOR_FLAG) - set $vec = (enum pvec_type) ($size & PVEC_TYPE_MASK) + set $vec = (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_SIZE_BITS) if $vec == PVEC_NORMAL_VECTOR xvector end @@ -1127,7 +1131,11 @@ if $type == Lisp_Vectorlike xgetptr (*$bt->function) set $size = ((struct Lisp_Vector *) $ptr)->header.size - output ($size & PSEUDOVECTOR_FLAG) ? (enum pvec_type) ($size & PVEC_TYPE_MASK) : $size & ~ARRAY_MARK_FLAG + if ($size & PSEUDOVECTOR_FLAG) + output (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_SIZE_BITS) + else + output $size & ~ARRAY_MARK_FLAG + end else printf "Lisp type %d", $type end === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-27 11:10:21 +0000 +++ src/ChangeLog 2012-07-27 20:50:02 +0000 @@ -1,3 +1,10 @@ +2012-07-27 Paul Eggert + + Adjust GDB to reflect pvec_type changes (Bug#12036). + * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the + 2012-07-04 changes to pseudovector representation. Problem + reported by Eli Zaretskii in . + 2012-07-27 Michael Albinus * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session ------------------------------------------------------------ revno: 109239 committer: Tassilo Horn branch nick: trunk timestamp: Fri 2012-07-27 19:58:58 +0200 message: Minor fix to my previous changes. diff: === modified file 'lisp/textmodes/reftex.el' --- lisp/textmodes/reftex.el 2012-07-27 07:59:50 +0000 +++ lisp/textmodes/reftex.el 2012-07-27 17:58:58 +0000 @@ -1320,7 +1320,7 @@ "\\)\\([[{][^]}]*[]}]\\)*[[{]\\(%s\\)[]}]")) (find-label-re-format (concat "\\(" - "\\[[^]]*label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?[^[]*\\]" + "label[[:space:]]*=[[:space:]]*" "\\|" (mapconcat 'regexp-quote (append '("\\label") macros-with-labels) "\\|") ------------------------------------------------------------ revno: 109238 committer: Fabián Ezequiel Gallina branch nick: trunk timestamp: Fri 2012-07-27 13:42:19 -0300 message: Consistent completion in inferior python with emacs -nw. * progmodes/python.el (inferior-python-mode): replace "" binding in inferior-python-mode-map with "\t". (python-shell-completion-complete-at-point) (python-completion-complete-at-point): Remove interactive spec. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-27 15:05:13 +0000 +++ lisp/ChangeLog 2012-07-27 16:42:19 +0000 @@ -1,3 +1,11 @@ +2012-07-27 Fabián Ezequiel Gallina + + Consistent completion in inferior python with emacs -nw. + * progmodes/python.el (inferior-python-mode): replace "" + binding in inferior-python-mode-map with "\t". + (python-shell-completion-complete-at-point) + (python-completion-complete-at-point): Remove interactive spec. + 2012-07-27 Jay Belanger * calc/calccomp.el (math-compose-expr): Undo previous change. === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-07-27 12:38:19 +0000 +++ lisp/progmodes/python.el 2012-07-27 16:42:19 +0000 @@ -1545,7 +1545,7 @@ 'python-shell-completion-complete-at-point nil 'local) (add-to-list (make-local-variable 'comint-dynamic-complete-functions) 'python-shell-completion-complete-at-point) - (define-key inferior-python-mode-map (kbd "") + (define-key inferior-python-mode-map "\t" 'python-shell-completion-complete-or-indent) (when python-shell-enable-font-lock (set (make-local-variable 'font-lock-defaults) @@ -1948,7 +1948,6 @@ (defun python-shell-completion-complete-at-point () "Perform completion at point in inferior Python process." - (interactive) (and comint-last-prompt-overlay (> (point-marker) (overlay-end comint-last-prompt-overlay)) (python-shell-completion--do-completion-at-point @@ -2063,7 +2062,6 @@ For this to work the best as possible you should call `python-shell-send-buffer' from time to time so context in inferior python process is updated properly." - (interactive) (let ((process (python-shell-get-process))) (if (not process) (error "Completion needs an inferior Python process running") ------------------------------------------------------------ revno: 109237 committer: Jay Belanger branch nick: trunk timestamp: Fri 2012-07-27 10:05:13 -0500 message: calccomp.el (math-compose-expr): Undo previous change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-27 12:38:19 +0000 +++ lisp/ChangeLog 2012-07-27 15:05:13 +0000 @@ -1,3 +1,7 @@ +2012-07-27 Jay Belanger + + * calc/calccomp.el (math-compose-expr): Undo previous change. + 2012-07-27 Fabián Ezequiel Gallina * progmodes/python.el (python-mode-map): Added keybinding for === modified file 'lisp/calc/calccomp.el' --- lisp/calc/calccomp.el 2012-07-27 03:48:40 +0000 +++ lisp/calc/calccomp.el 2012-07-27 15:05:13 +0000 @@ -87,8 +87,7 @@ sn))) (defun math-compose-expr (a prec) - (let ((calc-multiplication-has-precedence nil) - (math-compose-level (1+ math-compose-level)) + (let ((math-compose-level (1+ math-compose-level)) (math-expr-opers (math-expr-ops)) spfn) (cond ------------------------------------------------------------ revno: 109236 committer: Fabián Ezequiel Gallina branch nick: trunk timestamp: Fri 2012-07-27 09:38:19 -0300 message: * lisp/progmodes/python.el (python-mode-map): Added keybinding for run-python. (python-shell-make-comint): Fix pop-to-buffer call. (run-python): Autoload. New arg SHOW. (python-shell-get-or-create-process): Do not pop python process buffer. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-27 11:10:53 +0000 +++ lisp/ChangeLog 2012-07-27 12:38:19 +0000 @@ -1,3 +1,12 @@ +2012-07-27 Fabián Ezequiel Gallina + + * progmodes/python.el (python-mode-map): Added keybinding for + run-python. + (python-shell-make-comint): Fix pop-to-buffer call. + (run-python): Autoload. New arg SHOW. + (python-shell-get-or-create-process): Do not pop python process + buffer. + 2012-07-27 Michael Albinus * notifications.el (notifications-on-action-signal) === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-07-19 00:55:55 +0000 +++ lisp/progmodes/python.el 2012-07-27 12:38:19 +0000 @@ -250,6 +250,7 @@ (define-key map "\C-c\C-tt" 'python-skeleton-try) (define-key map "\C-c\C-tw" 'python-skeleton-while) ;; Shell interaction + (define-key map "\C-c\C-p" 'run-python) (define-key map "\C-c\C-s" 'python-shell-send-string) (define-key map "\C-c\C-r" 'python-shell-send-region) (define-key map "\C-\M-x" 'python-shell-send-defun) @@ -1571,30 +1572,33 @@ (with-current-buffer buffer (inferior-python-mode) (python-util-clone-local-variables current-buffer)))) - (when pop - (pop-to-buffer proc-buffer-name)) + (and pop (pop-to-buffer proc-buffer-name t)) proc-buffer-name))) -(defun run-python (dedicated cmd) +;;;###autoload +(defun run-python (cmd &optional dedicated show) "Run an inferior Python process. Input and output via buffer named after `python-shell-buffer-name'. If there is a process already running in that buffer, just switch to it. -With argument, allows you to define DEDICATED, so a dedicated -process for the current buffer is open, and define CMD so you can -edit the command used to call the interpreter (default is value -of `python-shell-interpreter' and arguments defined in -`python-shell-interpreter-args'). Runs the hook -`inferior-python-mode-hook' (after the `comint-mode-hook' is -run). -\(Type \\[describe-mode] in the process buffer for a list of commands.)" + +With argument, allows you to define CMD so you can edit the +command used to call the interpreter and define DEDICATED, so a +dedicated process for the current buffer is open. When numeric +prefix arg is other than 0 or 4 do not SHOW. + +Runs the hook `inferior-python-mode-hook' (after the +`comint-mode-hook' is run). \(Type \\[describe-mode] in the +process buffer for a list of commands.)" (interactive (if current-prefix-arg (list + (read-string "Run Python: " (python-shell-parse-command)) (y-or-n-p "Make dedicated process? ") - (read-string "Run Python: " (python-shell-parse-command))) - (list nil (python-shell-parse-command)))) - (python-shell-make-comint cmd (python-shell-get-process-name dedicated)) + (= (prefix-numeric-value current-prefix-arg) 4)) + (list (python-shell-parse-command) nil t))) + (python-shell-make-comint + cmd (python-shell-get-process-name dedicated) show) dedicated) (defun run-python-internal () @@ -1611,7 +1615,6 @@ `inferior-python-mode-hook' (after the `comint-mode-hook' is run). \(Type \\[describe-mode] in the process buffer for a list of commands.)" - (interactive) (set-process-query-on-exit-flag (get-buffer-process (python-shell-make-comint @@ -1638,7 +1641,7 @@ (global-proc-buffer-name (format "*%s*" global-proc-name)) (dedicated-running (comint-check-proc dedicated-proc-buffer-name)) (global-running (comint-check-proc global-proc-buffer-name)) - (current-prefix-arg 4)) + (current-prefix-arg 16)) (when (and (not dedicated-running) (not global-running)) (if (call-interactively 'run-python) (setq dedicated-running t) ------------------------------------------------------------ revno: 109235 committer: Michael Albinus +2012-07-27 Michael Albinus * notifications.el (notifications-on-action-signal) (notifications-on-closed-signal): Use also the bus address for the map. ------------------------------------------------------------ revno: 109233 committer: Michael Albinus +2012-07-27 Michael Albinus * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session bus address. ------------------------------------------------------------ revno: 109232 committer: Michael Albinus + + * notifications.el (notifications-on-action-signal) + (notifications-on-closed-signal): Use also the bus address for the map. + (notifications-notify, notifications-close-notification) + (notifications-get-capabilities): Add optional argument BUS. + 2012-07-27 Tassilo Horn * textmodes/reftex-vars.el (reftex-label-alist-builtin): Add === modified file 'lisp/notifications.el' --- lisp/notifications.el 2012-07-11 23:13:41 +0000 +++ lisp/notifications.el 2012-07-27 10:56:03 +0000 @@ -93,8 +93,9 @@ (defun notifications-on-action-signal (id action) "Dispatch signals to callback functions from `notifications-on-action-map'." - (let* ((unique-name (dbus-event-service-name last-input-event)) - (entry (assoc (cons unique-name id) notifications-on-action-map))) + (let* ((bus (dbus-event-bus-name last-input-event)) + (unique-name (dbus-event-service-name last-input-event)) + (entry (assoc (list bus unique-name id) notifications-on-action-map))) (when entry (funcall (cadr entry) id action) (when (and (not (setq notifications-on-action-map @@ -107,8 +108,9 @@ "Dispatch signals to callback functions from `notifications-on-closed-map'." ;; notification-daemon prior 0.4.0 does not send a reason. So we ;; make it optional, and assume `undefined' as default. - (let* ((unique-name (dbus-event-service-name last-input-event)) - (entry (assoc (cons unique-name id) notifications-on-close-map)) + (let* ((bus (dbus-event-bus-name last-input-event)) + (unique-name (dbus-event-service-name last-input-event)) + (entry (assoc (list bus unique-name id) notifications-on-close-map)) (reason (or reason 4))) (when entry (funcall (cadr entry) @@ -123,6 +125,7 @@ "Send notification via D-Bus using the Freedesktop notification protocol. Various PARAMS can be set: + :bus The D-Bus bus, if different from `:session'. :title The notification title. :body The notification body text. :app-name The name of the application sending the notification. @@ -196,7 +199,8 @@ used to manipulate the notification item with `notifications-close-notification' or the `:replaces-id' argument of another `notifications-notify' call." - (let ((title (plist-get params :title)) + (let ((bus (or (plist-get params :bus) :session)) + (title (plist-get params :title)) (body (plist-get params :body)) (app-name (plist-get params :app-name)) (replaces-id (plist-get params :replaces-id)) @@ -272,9 +276,9 @@ (when y (add-to-list 'hints `(:dict-entry "y" (:variant :int32 ,y)) t)) - ;; Call Notify method + ;; Call Notify method. (setq id - (dbus-call-method :session + (dbus-call-method bus notifications-service notifications-path notifications-interface @@ -302,14 +306,14 @@ ;; restarted. (let ((on-action (plist-get params :on-action)) (on-close (plist-get params :on-close)) - (unique-name (dbus-get-name-owner :session notifications-service))) + (unique-name (dbus-get-name-owner bus notifications-service))) (when on-action (add-to-list 'notifications-on-action-map - (list (cons unique-name id) on-action)) + (list (list bus unique-name id) on-action)) (unless notifications-on-action-object (setq notifications-on-action-object (dbus-register-signal - :session + bus nil notifications-path notifications-interface @@ -318,11 +322,11 @@ (when on-close (add-to-list 'notifications-on-close-map - (list (cons unique-name id) on-close)) + (list (list bus unique-name id) on-close)) (unless notifications-on-close-object (setq notifications-on-close-object (dbus-register-signal - :session + bus nil notifications-path notifications-interface @@ -332,9 +336,10 @@ ;; Return notification id id)) -(defun notifications-close-notification (id) - "Close a notification with identifier ID." - (dbus-call-method :session +(defun notifications-close-notification (id &optional bus) + "Close a notification with identifier ID. +BUS can be a string denoting a D-Bus connection, the default is `:session'." + (dbus-call-method (or bus :session) notifications-service notifications-path notifications-interface @@ -343,8 +348,9 @@ (defvar dbus-debug) ; used in the macroexpansion of dbus-ignore-errors -(defun notifications-get-capabilities () +(defun notifications-get-capabilities (&optional bus) "Return the capabilities of the notification server, a list of strings. +BUS can be a string denoting a D-Bus connection, the default is `:session'. The following capabilities can be expected: :actions The server will provide the specified actions @@ -367,7 +373,7 @@ (dbus-ignore-errors (mapcar (lambda (x) (intern (concat ":" x))) - (dbus-call-method :session + (dbus-call-method (or bus :session) notifications-service notifications-path notifications-interface ------------------------------------------------------------ revno: 109231 committer: Michael Albinus + + * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session + bus address. + (xd_close_bus, Fdbus_init_bus): Handle reference counter properly. + 2012-07-27 Eli Zaretskii * alloc.c (listn): Fix the order the arguments are consed onto the === modified file 'src/dbusbind.c' --- src/dbusbind.c 2012-07-10 08:43:46 +0000 +++ src/dbusbind.c 2012-07-27 10:46:58 +0000 @@ -261,6 +261,7 @@ #define XD_DBUS_VALIDATE_BUS_ADDRESS(bus) \ do { \ + char const *session_bus_address = getenv ("DBUS_SESSION_BUS_ADDRESS"); \ if (STRINGP (bus)) \ { \ DBusAddressEntry **entries; \ @@ -272,6 +273,10 @@ /* Cleanup. */ \ dbus_error_free (&derror); \ dbus_address_entries_free (entries); \ + /* Canonicalize session bus address. */ \ + if (session_bus_address != NULL \ + && Fstring_equal (bus, build_string (session_bus_address))) \ + bus = QCdbus_session_bus; \ } \ \ else \ @@ -280,8 +285,7 @@ if (!(EQ (bus, QCdbus_system_bus) || EQ (bus, QCdbus_session_bus))) \ XD_SIGNAL2 (build_string ("Wrong bus name"), bus); \ /* We do not want to have an autolaunch for the session bus. */ \ - if (EQ (bus, QCdbus_session_bus) \ - && getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL) \ + if (EQ (bus, QCdbus_session_bus) && session_bus_address == NULL) \ XD_SIGNAL2 (build_string ("No connection to bus"), bus); \ } \ } while (0) @@ -1071,19 +1075,19 @@ /* Retrieve bus address. */ connection = xd_get_connection_address (bus); - /* Close connection, if there isn't another shared application. */ if (xd_get_connection_references (connection) == 1) { + /* Close connection, if there isn't another shared application. */ XD_DEBUG_MESSAGE ("Close connection to bus %s", XD_OBJECT_TO_STRING (bus)); dbus_connection_close (connection); + + xd_registered_buses = Fdelete (val, xd_registered_buses); } - /* Decrement reference count. */ - dbus_connection_unref (connection); - - /* Remove bus from list of registered buses. */ - xd_registered_buses = Fdelete (val, xd_registered_buses); + else + /* Decrement reference count. */ + dbus_connection_unref (connection); /* Return. */ return; @@ -1124,65 +1128,76 @@ /* Close bus if it is already open. */ xd_close_bus (bus); - /* Initialize. */ - dbus_error_init (&derror); - - /* Open the connection. */ - if (STRINGP (bus)) - if (NILP (private)) - connection = dbus_connection_open (SSDATA (bus), &derror); - else - connection = dbus_connection_open_private (SSDATA (bus), &derror); - - else - if (NILP (private)) - connection = dbus_bus_get (EQ (bus, QCdbus_system_bus) - ? DBUS_BUS_SYSTEM : DBUS_BUS_SESSION, - &derror); - else - connection = dbus_bus_get_private (EQ (bus, QCdbus_system_bus) - ? DBUS_BUS_SYSTEM : DBUS_BUS_SESSION, - &derror); - - if (dbus_error_is_set (&derror)) - XD_ERROR (derror); - - if (connection == NULL) - XD_SIGNAL2 (build_string ("No connection to bus"), bus); - - /* If it is not the system or session bus, we must register - ourselves. Otherwise, we have called dbus_bus_get, which has - configured us to exit if the connection closes - we undo this - setting. */ - if (STRINGP (bus)) - dbus_bus_register (connection, &derror); - else - dbus_connection_set_exit_on_disconnect (connection, FALSE); - - if (dbus_error_is_set (&derror)) - XD_ERROR (derror); - - /* Add the watch functions. We pass also the bus as data, in order - to distinguish between the buses in xd_remove_watch. */ - if (!dbus_connection_set_watch_functions (connection, - xd_add_watch, - xd_remove_watch, - xd_toggle_watch, - SYMBOLP (bus) - ? (void *) XSYMBOL (bus) - : (void *) XSTRING (bus), - NULL)) - XD_SIGNAL1 (build_string ("Cannot add watch functions")); - - /* Add bus to list of registered buses. */ - XSETFASTINT (val, (intptr_t) connection); - xd_registered_buses = Fcons (Fcons (bus, val), xd_registered_buses); - - /* We do not want to abort. */ - putenv ((char *) "DBUS_FATAL_WARNINGS=0"); - - /* Cleanup. */ - dbus_error_free (&derror); + /* Check, whether we are still connected. */ + val = Fassoc (bus, xd_registered_buses); + if (!NILP (val)) + { + connection = xd_get_connection_address (bus); + dbus_connection_ref (connection); + } + + else + { + /* Initialize. */ + dbus_error_init (&derror); + + /* Open the connection. */ + if (STRINGP (bus)) + if (NILP (private)) + connection = dbus_connection_open (SSDATA (bus), &derror); + else + connection = dbus_connection_open_private (SSDATA (bus), &derror); + + else + if (NILP (private)) + connection = dbus_bus_get (EQ (bus, QCdbus_system_bus) + ? DBUS_BUS_SYSTEM : DBUS_BUS_SESSION, + &derror); + else + connection = dbus_bus_get_private (EQ (bus, QCdbus_system_bus) + ? DBUS_BUS_SYSTEM : DBUS_BUS_SESSION, + &derror); + + if (dbus_error_is_set (&derror)) + XD_ERROR (derror); + + if (connection == NULL) + XD_SIGNAL2 (build_string ("No connection to bus"), bus); + + /* If it is not the system or session bus, we must register + ourselves. Otherwise, we have called dbus_bus_get, which has + configured us to exit if the connection closes - we undo this + setting. */ + if (STRINGP (bus)) + dbus_bus_register (connection, &derror); + else + dbus_connection_set_exit_on_disconnect (connection, FALSE); + + if (dbus_error_is_set (&derror)) + XD_ERROR (derror); + + /* Add the watch functions. We pass also the bus as data, in + order to distinguish between the buses in xd_remove_watch. */ + if (!dbus_connection_set_watch_functions (connection, + xd_add_watch, + xd_remove_watch, + xd_toggle_watch, + SYMBOLP (bus) + ? (void *) XSYMBOL (bus) + : (void *) XSTRING (bus), + NULL)) + XD_SIGNAL1 (build_string ("Cannot add watch functions")); + + /* Add bus to list of registered buses. */ + XSETFASTINT (val, (intptr_t) connection); + xd_registered_buses = Fcons (Fcons (bus, val), xd_registered_buses); + + /* We do not want to abort. */ + putenv ((char *) "DBUS_FATAL_WARNINGS=0"); + + /* Cleanup. */ + dbus_error_free (&derror); + } /* Return reference counter. */ refcount = xd_get_connection_references (connection); ------------------------------------------------------------ revno: 109230 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2012-07-27 13:29:26 +0300 message: Fix listn introduced in revision 109223. src/alloc.c (listn): Fix the order the arguments are consed onto the list. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-27 09:24:34 +0000 +++ src/ChangeLog 2012-07-27 10:29:26 +0000 @@ -1,5 +1,8 @@ 2012-07-27 Eli Zaretskii + * alloc.c (listn): Fix the order the arguments are consed onto the + list. + * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for enumeration constants, as PURE and HEAP are too general, and clash with other headers and sources, such as gmalloc.c and the === modified file 'src/alloc.c' --- src/alloc.c 2012-07-27 09:24:34 +0000 +++ src/alloc.c 2012-07-27 10:29:26 +0000 @@ -2832,7 +2832,7 @@ objp[i] = va_arg (ap, Lisp_Object); va_end (ap); - for (i = 0, val = Qnil; i < count; i++) + for (val = Qnil, i = count - 1; i >= 0; i--) { if (type == CONSTYPE_PURE) val = pure_cons (objp[i], val); ------------------------------------------------------------ revno: 109229 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2012-07-27 12:24:34 +0300 message: Fix failure to compile on Windows due to revision 109223. src/lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for enumeration constants, as PURE and HEAP are too general, and clash with other headers and sources, such as gmalloc.c and the MS-Windows system headers. All users changed. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-27 07:51:52 +0000 +++ src/ChangeLog 2012-07-27 09:24:34 +0000 @@ -1,3 +1,10 @@ +2012-07-27 Eli Zaretskii + + * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for + enumeration constants, as PURE and HEAP are too general, and clash + with other headers and sources, such as gmalloc.c and the + MS-Windows system headers. All users changed. + 2012-07-27 Dmitry Antipov Revert last save_excursion_save and save_excursion_restore changes. === modified file 'src/alloc.c' --- src/alloc.c 2012-07-27 07:51:52 +0000 +++ src/alloc.c 2012-07-27 09:24:34 +0000 @@ -2813,7 +2813,7 @@ /* Make a list of COUNT Lisp_Objects, where ARG is the first one. Allocate conses from pure space if TYPE - is PURE, or allocate as usual if type is HEAP. */ + is CONSTYPE_PURE, or allocate as usual if type is CONSTYPE_HEAP. */ Lisp_Object listn (enum constype type, ptrdiff_t count, Lisp_Object arg, ...) @@ -2834,9 +2834,9 @@ for (i = 0, val = Qnil; i < count; i++) { - if (type == PURE) + if (type == CONSTYPE_PURE) val = pure_cons (objp[i], val); - else if (type == HEAP) + else if (type == CONSTYPE_HEAP) val = Fcons (objp[i], val); else abort (); @@ -6676,7 +6676,7 @@ (but the contents of a buffer's text do not count here). */) (void) { - return listn (HEAP, 8, + return listn (CONSTYPE_HEAP, 8, bounded_number (cons_cells_consed), bounded_number (floats_consed), bounded_number (vector_cells_consed), @@ -6865,7 +6865,7 @@ /* We build this in advance because if we wait until we need it, we might not be able to allocate the memory to hold it. */ Vmemory_signal_data - = listn (PURE, 2, Qerror, + = listn (CONSTYPE_PURE, 2, Qerror, build_pure_c_string ("Memory exhausted--use M-x save-some-buffers then exit and restart Emacs")); DEFVAR_LISP ("memory-full", Vmemory_full, === modified file 'src/buffer.c' --- src/buffer.c 2012-07-27 06:04:35 +0000 +++ src/buffer.c 2012-07-27 09:24:34 +0000 @@ -5212,7 +5212,7 @@ DEFSYM (Qkill_buffer_query_functions, "kill-buffer-query-functions"); Fput (Qprotected_field, Qerror_conditions, - listn (PURE, 2, Qprotected_field, Qerror)); + listn (CONSTYPE_PURE, 2, Qprotected_field, Qerror)); Fput (Qprotected_field, Qerror_message, build_pure_c_string ("Attempt to modify a protected field")); === modified file 'src/callint.c' --- src/callint.c 2012-07-27 06:04:35 +0000 +++ src/callint.c 2012-07-27 09:24:34 +0000 @@ -888,7 +888,7 @@ callint_message = Qnil; staticpro (&callint_message); - preserved_fns = listn (PURE, 4, + preserved_fns = listn (CONSTYPE_PURE, 4, intern_c_string ("region-beginning"), intern_c_string ("region-end"), intern_c_string ("point"), === modified file 'src/charset.c' --- src/charset.c 2012-07-27 06:04:35 +0000 +++ src/charset.c 2012-07-27 09:24:34 +0000 @@ -1283,7 +1283,7 @@ args[charset_arg_unify_map] = Qnil; args[charset_arg_plist] = - listn (HEAP, 14, + listn (CONSTYPE_HEAP, 14, intern_c_string (":name"), args[charset_arg_name], intern_c_string (":dimension"), === modified file 'src/coding.c' --- src/coding.c 2012-07-27 06:04:35 +0000 +++ src/coding.c 2012-07-27 09:24:34 +0000 @@ -10411,7 +10411,7 @@ DEFSYM (Qcoding_system_error, "coding-system-error"); Fput (Qcoding_system_error, Qerror_conditions, - listn (PURE, 2, Qcoding_system_error, Qerror)); + listn (CONSTYPE_PURE, 2, Qcoding_system_error, Qerror)); Fput (Qcoding_system_error, Qerror_message, build_pure_c_string ("Invalid coding system")); === modified file 'src/keymap.c' --- src/keymap.c 2012-07-27 06:04:35 +0000 +++ src/keymap.c 2012-07-27 09:24:34 +0000 @@ -3702,7 +3702,7 @@ Fset (intern_c_string ("ctl-x-map"), control_x_map); Ffset (intern_c_string ("Control-X-prefix"), control_x_map); - exclude_keys = listn (PURE, 5, + exclude_keys = listn (CONSTYPE_PURE, 5, pure_cons (build_pure_c_string ("DEL"), build_pure_c_string ("\\d")), pure_cons (build_pure_c_string ("TAB"), build_pure_c_string ("\\t")), pure_cons (build_pure_c_string ("RET"), build_pure_c_string ("\\r")), @@ -3760,7 +3760,7 @@ where_is_preferred_modifier = 0; staticpro (&Vmouse_events); - Vmouse_events = listn (PURE, 9, + Vmouse_events = listn (CONSTYPE_PURE, 9, intern_c_string ("menu-bar"), intern_c_string ("tool-bar"), intern_c_string ("header-line"), === modified file 'src/lisp.h' --- src/lisp.h 2012-07-27 07:51:52 +0000 +++ src/lisp.h 2012-07-27 09:24:34 +0000 @@ -2643,7 +2643,7 @@ extern Lisp_Object list4 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); extern Lisp_Object list5 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object); -enum constype {HEAP, PURE}; +enum constype {CONSTYPE_HEAP, CONSTYPE_PURE}; extern Lisp_Object listn (enum constype, ptrdiff_t, Lisp_Object, ...); extern _Noreturn void string_overflow (void); extern Lisp_Object make_string (const char *, ptrdiff_t); === modified file 'src/search.c' --- src/search.c 2012-07-27 06:04:35 +0000 +++ src/search.c 2012-07-27 09:24:34 +0000 @@ -3054,12 +3054,12 @@ DEFSYM (Qinvalid_regexp, "invalid-regexp"); Fput (Qsearch_failed, Qerror_conditions, - listn (PURE, 2, Qsearch_failed, Qerror)); + listn (CONSTYPE_PURE, 2, Qsearch_failed, Qerror)); Fput (Qsearch_failed, Qerror_message, build_pure_c_string ("Search failed")); Fput (Qinvalid_regexp, Qerror_conditions, - listn (PURE, 2, Qinvalid_regexp, Qerror)); + listn (CONSTYPE_PURE, 2, Qinvalid_regexp, Qerror)); Fput (Qinvalid_regexp, Qerror_message, build_pure_c_string ("Invalid regexp")); === modified file 'src/syntax.c' --- src/syntax.c 2012-07-27 06:04:35 +0000 +++ src/syntax.c 2012-07-27 09:24:34 +0000 @@ -3473,7 +3473,7 @@ DEFSYM (Qscan_error, "scan-error"); Fput (Qscan_error, Qerror_conditions, - listn (PURE, 2, Qscan_error, Qerror)); + listn (CONSTYPE_PURE, 2, Qscan_error, Qerror)); Fput (Qscan_error, Qerror_message, build_pure_c_string ("Scan error")); === modified file 'src/w32.c' --- src/w32.c 2012-07-27 07:36:33 +0000 +++ src/w32.c 2012-07-27 09:24:34 +0000 @@ -1722,8 +1722,8 @@ dwType = REG_EXPAND_SZ; dont_free = 1; if (!strcmp (env_vars[i].name, "HOME") && !appdata) - Vdelayed_warnings_list - = Fcons (listn (HEAP, 2, + Vdelayed_warnings_list + = Fcons (listn (CONSTYPE_HEAP, 2, intern ("initialization"), build_string ("Setting HOME to C:\\ by default is deprecated")), Vdelayed_warnings_list); === modified file 'src/w32fns.c' --- src/w32fns.c 2012-07-27 07:36:33 +0000 +++ src/w32fns.c 2012-07-27 09:24:34 +0000 @@ -6544,7 +6544,7 @@ remain = build_string (buffer); } - status = listn (HEAP, 8, + status = listn (CONSTYPE_HEAP, 8, Fcons (make_number ('L'), line_status), Fcons (make_number ('B'), battery_status), Fcons (make_number ('b'), battery_status_symbol), @@ -6794,7 +6794,7 @@ Fput (Qundefined_color, Qerror_conditions, - listn (PURE, 2, Qundefined_color, Qerror)); + listn (CONSTYPE_PURE, 2, Qundefined_color, Qerror)); Fput (Qundefined_color, Qerror_message, build_pure_c_string ("Undefined color")); === modified file 'src/xdisp.c' --- src/xdisp.c 2012-07-27 06:04:35 +0000 +++ src/xdisp.c 2012-07-27 09:24:34 +0000 @@ -28932,10 +28932,10 @@ \(see `modify-frame-parameters'). */); Vicon_title_format = Vframe_title_format - = listn (PURE, 3, + = listn (CONSTYPE_PURE, 3, intern_c_string ("multiple-frames"), build_pure_c_string ("%b"), - listn (PURE, 4, + listn (CONSTYPE_PURE, 4, empty_unibyte_string, intern_c_string ("invocation-name"), build_pure_c_string ("@"), === modified file 'src/xfns.c' --- src/xfns.c 2012-07-27 06:04:35 +0000 +++ src/xfns.c 2012-07-27 09:24:34 +0000 @@ -5822,7 +5822,7 @@ /* This is the end of symbol initialization. */ Fput (Qundefined_color, Qerror_conditions, - listn (PURE, 2, Qundefined_color, Qerror)); + listn (CONSTYPE_PURE, 2, Qundefined_color, Qerror)); Fput (Qundefined_color, Qerror_message, build_pure_c_string ("Undefined color")); ------------------------------------------------------------ revno: 109228 committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2012-07-27 08:01:44 +0000 message: message.el: Make header fill function work properly diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-07-25 22:10:37 +0000 +++ lisp/gnus/ChangeLog 2012-07-27 08:01:44 +0000 @@ -1,3 +1,9 @@ +2012-07-27 Katsumi Yamaoka + + * message.el (message-kill-address): Don't kill last newline. + (message-skip-to-next-address): Don't move to the next header. + (message-fill-field-address): Work properly. + 2012-07-25 Julien Danjou * gnus-art.el (gnus-kill-sticky-article-buffers): Reintroduce. === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2012-07-24 22:17:17 +0000 +++ lisp/gnus/message.el 2012-07-27 08:01:44 +0000 @@ -2603,7 +2603,7 @@ (interactive) (let ((start (point))) (message-skip-to-next-address) - (kill-region start (point)))) + (kill-region start (if (bolp) (1- (point)) (point))))) (autoload 'Info-goto-node "info") @@ -6099,7 +6099,7 @@ (while (and (not (= (point) end)) (or (not (eq char ?,)) quoted)) - (skip-chars-forward "^,\"" (point-max)) + (skip-chars-forward "^,\"" end) (when (eq (setq char (following-char)) ?\") (setq quoted (not quoted))) (unless (= (point) end) @@ -6136,17 +6136,22 @@ (point-max)))) (defun message-fill-field-address () - (while (not (eobp)) - (message-skip-to-next-address) - (let (last) - (if (and (> (current-column) 78) - last) - (progn - (save-excursion - (goto-char last) - (insert "\n\t")) - (setq last (1+ (point)))) - (setq last (1+ (point))))))) + (let (end last) + (while (not end) + (message-skip-to-next-address) + (cond ((bolp) + (end-of-line 0) + (setq end 1)) + ((eobp) + (setq end 0))) + (when (and (> (current-column) 78) + last) + (save-excursion + (goto-char last) + (delete-char (- (skip-chars-backward " \t"))) + (insert "\n\t"))) + (setq last (point))) + (forward-line end))) (defun message-fill-field-general () (let ((begin (point)) ------------------------------------------------------------ revno: 109227 committer: Tassilo Horn branch nick: trunk timestamp: Fri 2012-07-27 09:59:50 +0200 message: * textmodes/reftex-vars.el (reftex-label-alist-builtin): Add support for the lstlisting and minted environments, and for the ctable macro. * textmodes/reftex.el (reftex-compile-variables): Also recognize labels written in keyvals syntax. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-27 03:48:40 +0000 +++ lisp/ChangeLog 2012-07-27 07:59:50 +0000 @@ -1,3 +1,11 @@ +2012-07-27 Tassilo Horn + + * textmodes/reftex-vars.el (reftex-label-alist-builtin): Add + support for the lstlisting and minted environments, and for the + ctable macro. + * textmodes/reftex.el (reftex-compile-variables): Also recognize + labels written in keyvals syntax. + 2012-07-27 Jay Belanger * calc/calccomp.el (math-compose-expr): Use parentheses when === modified file 'lisp/textmodes/reftex-vars.el' --- lisp/textmodes/reftex-vars.el 2012-04-09 13:05:48 +0000 +++ lisp/textmodes/reftex-vars.el 2012-07-27 07:59:50 +0000 @@ -122,7 +122,14 @@ ;;("\\label{*}" nil nil nil nil) )) - ) + (ctable "The ctable package" + (("\\ctable[]{}{}{}" ?t "tab:" "\\ref{%s}" 1 ("table" "Tabelle")))) + + (listings "The listings package" + (("lstlisting" ?l "lst:" "~\\ref{%s}" nil (regexp "[Ll]isting")))) + + (minted "The minted package" + (("minted" ?l "lst:" "~\\ref{%s}" nil (regexp "[Ll]isting"))))) "The default label environment descriptions. Lower-case symbols correspond to a style file of the same name in the LaTeX distribution. Mixed-case symbols are convenience aliases.") === modified file 'lisp/textmodes/reftex.el' --- lisp/textmodes/reftex.el 2012-01-19 07:21:25 +0000 +++ lisp/textmodes/reftex.el 2012-07-27 07:59:50 +0000 @@ -1284,7 +1284,15 @@ ; (wbol "\\(\\`\\|[\n\r]\\)[ \t]*") (wbol "\\(^\\)[ \t]*") ; Need to keep the empty group because ;;; because match number are hard coded - (label-re "\\\\label{\\([^}]*\\)}") + (label-re (concat "\\(?:" + ;; Normal \label{...} + "\\\\label{\\([^}]*\\)}" + "\\|" + ;; keyvals [..., label = {foo}, ...] + ;; forms used by ctable, listings, + ;; minted, ... + "\\[[^]]*label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?[^[]*\\]" + "\\)")) (include-re (concat wbol "\\\\\\(" (mapconcat 'identity @@ -1312,6 +1320,8 @@ "\\)\\([[{][^]}]*[]}]\\)*[[{]\\(%s\\)[]}]")) (find-label-re-format (concat "\\(" + "\\[[^]]*label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?[^[]*\\]" + "\\|" (mapconcat 'regexp-quote (append '("\\label") macros-with-labels) "\\|") "\\)\\([[{][^]}]*[]}]\\)*[[{]\\(%s\\)[]}]")) ------------------------------------------------------------ revno: 109226 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2012-07-27 11:51:52 +0400 message: Revert last save_excursion_save and save_excursion_restore changes. * alloc.c, editfns.c, marker.c, lisp.h: Revert. Lots of crashes reported by Chong Yidong . diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-27 07:36:33 +0000 +++ src/ChangeLog 2012-07-27 07:51:52 +0000 @@ -1,9 +1,15 @@ 2012-07-27 Dmitry Antipov + Revert last save_excursion_save and save_excursion_restore changes. + * alloc.c, editfns.c, marker.c, lisp.h: Revert. + Lots of crashes reported by Chong Yidong . + +2012-07-27 Dmitry Antipov + Fix recently-introduced typos in Windows port. Reported by Martin Rudalics . * w32.c (init_environment): Replace comma with semicolon. - * w32fns.c (syms_of_w32fns): Likewise. + * w32fns.c (syms_of_w32fns): Add missing parenthesis. 2012-07-27 Paul Eggert === modified file 'src/alloc.c' --- src/alloc.c 2012-07-27 06:18:36 +0000 +++ src/alloc.c 2012-07-27 07:51:52 +0000 @@ -3685,10 +3685,17 @@ doc: /* Return a newly allocated marker which does not point at any place. */) (void) { - register Lisp_Object marker = allocate_misc (Lisp_Misc_Marker); + register Lisp_Object val; + register struct Lisp_Marker *p; - init_marker (XMARKER (marker), NULL, 0, 0, 0); - return marker; + val = allocate_misc (Lisp_Misc_Marker); + p = XMARKER (val); + p->buffer = 0; + p->bytepos = 0; + p->charpos = 0; + p->next = NULL; + p->insertion_type = 0; + return val; } /* Return a newly allocated marker which points into BUF @@ -3697,23 +3704,24 @@ Lisp_Object build_marker (struct buffer *buf, ptrdiff_t charpos, ptrdiff_t bytepos) { - register Lisp_Object marker = allocate_misc (Lisp_Misc_Marker); - - /* Use Fmake_marker to create marker points to nowhere. */ - eassert (buf != NULL); + Lisp_Object obj; + struct Lisp_Marker *m; /* No dead buffers here. */ eassert (!NILP (BVAR (buf, name))); - /* In a single-byte buffer, two positions must be equal. - Otherwise, every character is at least one byte. */ - if (BUF_Z (buf) == BUF_Z_BYTE (buf)) - eassert (charpos == bytepos); - else - eassert (charpos <= bytepos); + /* Every character is at least one byte. */ + eassert (charpos <= bytepos); - init_marker (XMARKER (marker), buf, charpos, bytepos, 0); - return marker; + obj = allocate_misc (Lisp_Misc_Marker); + m = XMARKER (obj); + m->buffer = buf; + m->charpos = charpos; + m->bytepos = bytepos; + m->insertion_type = 0; + m->next = BUF_MARKERS (buf); + BUF_MARKERS (buf) = m; + return obj; } /* Put MARKER back on the free list after using it temporarily. */ @@ -6081,19 +6089,6 @@ case PVEC_SUBR: break; - case PVEC_EXCURSION: - { - struct Lisp_Excursion *e = (struct Lisp_Excursion *) ptr; - /* No Lisp_Objects but two special pointers to mark here. */ - eassert (e->buffer != NULL); - eassert (e->window != NULL); - if (!VECTOR_MARKED_P (e->buffer)) - mark_buffer (e->buffer); - if (!VECTOR_MARKED_P (e->window)) - mark_vectorlike ((struct Lisp_Vector *) e->window); - } - break; - case PVEC_FREE: abort (); === modified file 'src/editfns.c' --- src/editfns.c 2012-07-27 02:47:07 +0000 +++ src/editfns.c 2012-07-27 07:51:52 +0000 @@ -821,104 +821,104 @@ Qnil, Qt, Qnil); } -/* Record buffer state before entering Fsave_excursion. */ - + Lisp_Object save_excursion_save (void) { - Lisp_Object excursion; - struct buffer *b = current_buffer; - struct window *w = XWINDOW (selected_window); - struct Lisp_Excursion *ex = xmalloc (sizeof *ex); - struct Lisp_Marker *m = XMARKER (BVAR (b, mark)); - - ex->size = 0; - ex->buffer = b; - ex->window = w; - ex->visible = (XBUFFER (w->buffer) == b); - ex->active = !NILP (BVAR (b, mark_active)); - - /* We do not initialize type and gcmarkbit since this marker - is never referenced via Lisp_Object and invisible for GC. */ - init_marker (&ex->point, b, PT, PT_BYTE, 0); - - /* Likewise. Note that charpos and bytepos may be zero. */ - init_marker (&ex->mark, m->buffer, m->charpos, - m->bytepos, m->insertion_type); - - /* Make it a pseudovector and return excursion object. */ - XSETTYPED_PVECTYPE (ex, size, PVEC_EXCURSION); - XSETEXCURSION (excursion, ex); - return excursion; + int visible = (XBUFFER (XWINDOW (selected_window)->buffer) + == current_buffer); + + return Fcons (Fpoint_marker (), + Fcons (Fcopy_marker (BVAR (current_buffer, mark), Qnil), + Fcons (visible ? Qt : Qnil, + Fcons (BVAR (current_buffer, mark_active), + selected_window)))); } -/* Restore buffer state before leaving Fsave_excursion. */ - Lisp_Object -save_excursion_restore (Lisp_Object obj) +save_excursion_restore (Lisp_Object info) { - struct Lisp_Excursion *ex = XEXCURSION (obj); - struct buffer *b = ex->buffer; - - eassert (b != NULL); - eassert (ex->window != NULL); - - /* Restore buffer state only if the buffer is live. - Otherwise, just cancel an excursion state. */ - - if (!NILP (BVAR (b, name))) - { - int active; - struct Lisp_Marker *m; - ptrdiff_t oldpos, newpos; - - /* Restore current buffer. */ - set_buffer_internal (b); - - /* Restore buffer position. */ - SET_PT_BOTH (clip_to_bounds (BEGV, ex->point.charpos, ZV), - clip_to_bounds (BEGV_BYTE, ex->point.bytepos, ZV_BYTE)); - unchain_marker (&ex->point); - - /* Restore mark if it was non-zero. */ - m = XMARKER (BVAR (b, mark)); - oldpos = m->charpos; - if (BEGV <= ex->mark.charpos) - attach_marker (m, b, ex->mark.charpos, ex->mark.bytepos); - newpos = ex->mark.charpos; - unchain_marker (&ex->mark); - - /* If mark and region was active, restore them. */ - active = !NILP (BVAR (b, mark_active)); - BVAR (b, mark_active) = ex->active ? Qt : Qnil; - - /* If mark is active now, and either was not active - or was at a different place, run the activate hook. */ - if (ex->active && oldpos != newpos) - { - obj = intern ("activate-mark-hook"); - Frun_hooks (1, &obj); - } - /* If mark has ceased to be active, run deactivate hook. */ - else if (active) - { - obj = intern ("deactivate-mark-hook"); - Frun_hooks (1, &obj); - } - - /* If buffer was visible in a window, and a different window - was selected, and the old selected window is still showing - this buffer, restore point in that window. */ - if (ex->visible) - { - struct window *w = ex->window; - - if (w != XWINDOW (selected_window) && XBUFFER (w->buffer) == b) - attach_marker (XMARKER (w->pointm), b, PT, PT_BYTE); - } - } - - xfree (ex); + Lisp_Object tem, tem1, omark, nmark; + struct gcpro gcpro1, gcpro2, gcpro3; + int visible_p; + + tem = Fmarker_buffer (XCAR (info)); + /* If buffer being returned to is now deleted, avoid error */ + /* Otherwise could get error here while unwinding to top level + and crash */ + /* In that case, Fmarker_buffer returns nil now. */ + if (NILP (tem)) + return Qnil; + + omark = nmark = Qnil; + GCPRO3 (info, omark, nmark); + + Fset_buffer (tem); + + /* Point marker. */ + tem = XCAR (info); + Fgoto_char (tem); + unchain_marker (XMARKER (tem)); + + /* Mark marker. */ + info = XCDR (info); + tem = XCAR (info); + omark = Fmarker_position (BVAR (current_buffer, mark)); + Fset_marker (BVAR (current_buffer, mark), tem, Fcurrent_buffer ()); + nmark = Fmarker_position (tem); + unchain_marker (XMARKER (tem)); + + /* visible */ + info = XCDR (info); + visible_p = !NILP (XCAR (info)); + +#if 0 /* We used to make the current buffer visible in the selected window + if that was true previously. That avoids some anomalies. + But it creates others, and it wasn't documented, and it is simpler + and cleaner never to alter the window/buffer connections. */ + tem1 = Fcar (tem); + if (!NILP (tem1) + && current_buffer != XBUFFER (XWINDOW (selected_window)->buffer)) + Fswitch_to_buffer (Fcurrent_buffer (), Qnil); +#endif /* 0 */ + + /* Mark active */ + info = XCDR (info); + tem = XCAR (info); + tem1 = BVAR (current_buffer, mark_active); + BVAR (current_buffer, mark_active) = tem; + + /* If mark is active now, and either was not active + or was at a different place, run the activate hook. */ + if (! NILP (tem)) + { + if (! EQ (omark, nmark)) + { + tem = intern ("activate-mark-hook"); + Frun_hooks (1, &tem); + } + } + /* If mark has ceased to be active, run deactivate hook. */ + else if (! NILP (tem1)) + { + tem = intern ("deactivate-mark-hook"); + Frun_hooks (1, &tem); + } + + /* If buffer was visible in a window, and a different window was + selected, and the old selected window is still showing this + buffer, restore point in that window. */ + tem = XCDR (info); + if (visible_p + && !EQ (tem, selected_window) + && (tem1 = XWINDOW (tem)->buffer, + (/* Window is live... */ + BUFFERP (tem1) + /* ...and it shows the current buffer. */ + && XBUFFER (tem1) == current_buffer))) + Fset_window_point (tem, make_number (PT)); + + UNGCPRO; return Qnil; } === modified file 'src/lisp.h' --- src/lisp.h 2012-07-27 06:18:36 +0000 +++ src/lisp.h 2012-07-27 07:51:52 +0000 @@ -375,7 +375,6 @@ PVEC_TERMINAL, PVEC_WINDOW_CONFIGURATION, PVEC_SUBR, - PVEC_EXCURSION, PVEC_OTHER, /* These last 4 are special because we OR them in fns.c:internal_equal, so they have to use a disjoint bit pattern: @@ -545,8 +544,6 @@ (struct terminal *) XUNTAG (a, Lisp_Vectorlike)) #define XSUBR(a) (eassert (SUBRP (a)), \ (struct Lisp_Subr *) XUNTAG (a, Lisp_Vectorlike)) -#define XEXCURSION(a) (eassert (EXCURSIONP (a)), \ - (struct Lisp_Excursion *) XUNTAG (a, Lisp_Vectorlike)) #define XBUFFER(a) (eassert (BUFFERP (a)), \ (struct buffer *) XUNTAG (a, Lisp_Vectorlike)) #define XCHAR_TABLE(a) (eassert (CHAR_TABLE_P (a)), \ @@ -599,12 +596,9 @@ #define XSETPROCESS(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_PROCESS)) #define XSETWINDOW(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_WINDOW)) #define XSETTERMINAL(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_TERMINAL)) -/* These are special because both Lisp_Subr and Lisp_Excursion lacks - struct vectorlike_header. */ +/* XSETSUBR is special since Lisp_Subr lacks struct vectorlike_header. */ #define XSETSUBR(a, b) \ XSETTYPED_PSEUDOVECTOR (a, b, XSUBR (a)->size, PVEC_SUBR) -#define XSETEXCURSION(a, b) \ - XSETTYPED_PSEUDOVECTOR (a, b, XEXCURSION (a)->size, PVEC_EXCURSION) #define XSETCOMPILED(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_COMPILED)) #define XSETBUFFER(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_BUFFER)) #define XSETCHAR_TABLE(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_CHAR_TABLE)) @@ -1521,33 +1515,6 @@ #define XFLOAT_INIT(f,n) (XFLOAT (f)->u.data = (n)) #endif -/* This structure is used to record buffer state for Fsave_excursion. - It's mostly treated as Lisp_Vector but allocated and freed explicitly - with xmalloc and xfree, so there is no vectorlike_header here. */ - -struct Lisp_Excursion -{ - ptrdiff_t size; - - /* Saved value of XWINDOW (selected_window). */ - struct window *window; - - /* Buffer where this excursion is in effect. */ - struct buffer *buffer; - - /* Non-zero if the window above has displayed the buffer. */ - unsigned visible : 1; - - /* Non-zero if this buffer has the mark active. */ - unsigned active : 1; - - /* Saved point. */ - struct Lisp_Marker point; - - /* Saved mark. May point to nowhere. */ - struct Lisp_Marker mark; -}; - /* A character, declared with the following typedef, is a member of some character set associated with the current buffer. */ #ifndef _UCHAR_T /* Protect against something in ctab.h on AIX. */ @@ -1730,10 +1697,8 @@ #define PROCESSP(x) PSEUDOVECTORP (x, PVEC_PROCESS) #define WINDOWP(x) PSEUDOVECTORP (x, PVEC_WINDOW) #define TERMINALP(x) PSEUDOVECTORP (x, PVEC_TERMINAL) -/* These are special because both Lisp_Subr and Lisp_Excursion lacks - struct vectorlike_header. */ +/* SUBRP is special since Lisp_Subr lacks struct vectorlike_header. */ #define SUBRP(x) TYPED_PSEUDOVECTORP (x, Lisp_Subr, PVEC_SUBR) -#define EXCURSIONP(x) TYPED_PSEUDOVECTORP (x, Lisp_Excursion, PVEC_EXCURSION) #define COMPILEDP(x) PSEUDOVECTORP (x, PVEC_COMPILED) #define BUFFERP(x) PSEUDOVECTORP (x, PVEC_BUFFER) #define CHAR_TABLE_P(x) PSEUDOVECTORP (x, PVEC_CHAR_TABLE) @@ -2949,15 +2914,11 @@ extern ptrdiff_t charpos_to_bytepos (ptrdiff_t); extern ptrdiff_t buf_charpos_to_bytepos (struct buffer *, ptrdiff_t); extern ptrdiff_t buf_bytepos_to_charpos (struct buffer *, ptrdiff_t); -extern void unchain_marker (struct Lisp_Marker *); +extern void unchain_marker (struct Lisp_Marker *marker); extern Lisp_Object set_marker_restricted (Lisp_Object, Lisp_Object, Lisp_Object); extern Lisp_Object set_marker_both (Lisp_Object, Lisp_Object, ptrdiff_t, ptrdiff_t); extern Lisp_Object set_marker_restricted_both (Lisp_Object, Lisp_Object, - ptrdiff_t, ptrdiff_t); -extern void init_marker (struct Lisp_Marker *, struct buffer *, - ptrdiff_t, ptrdiff_t, int); -extern void attach_marker (struct Lisp_Marker *, struct buffer *, - ptrdiff_t, ptrdiff_t); + ptrdiff_t, ptrdiff_t); extern Lisp_Object build_marker (struct buffer *, ptrdiff_t, ptrdiff_t); extern void syms_of_marker (void); === modified file 'src/marker.c' --- src/marker.c 2012-07-27 02:47:07 +0000 +++ src/marker.c 2012-07-27 07:51:52 +0000 @@ -425,28 +425,9 @@ return Qnil; } -/* Initialize just allocated Lisp_Marker. */ - -void -init_marker (struct Lisp_Marker *m, struct buffer *b, - ptrdiff_t charpos, ptrdiff_t bytepos, int type) -{ - m->buffer = b; - m->charpos = charpos; - m->bytepos = bytepos; - m->insertion_type = type; - if (b) - { - m->next = BUF_MARKERS (b); - BUF_MARKERS (b) = m; - } - else - m->next = NULL; -} - /* Change M so it points to B at CHARPOS and BYTEPOS. */ -void +static inline void attach_marker (struct Lisp_Marker *m, struct buffer *b, ptrdiff_t charpos, ptrdiff_t bytepos) { ------------------------------------------------------------ revno: 109225 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2012-07-27 11:36:33 +0400 message: Fix recently-introduced typos in Windows port. Reported by Martin Rudalics . * w32.c (init_environment): Replace comma with semicolon. * w32fns.c (syms_of_w32fns): Likewise. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-27 06:18:36 +0000 +++ src/ChangeLog 2012-07-27 07:36:33 +0000 @@ -1,3 +1,10 @@ +2012-07-27 Dmitry Antipov + + Fix recently-introduced typos in Windows port. + Reported by Martin Rudalics . + * w32.c (init_environment): Replace comma with semicolon. + * w32fns.c (syms_of_w32fns): Likewise. + 2012-07-27 Paul Eggert Improve GDB symbol export (Bug#12036). === modified file 'src/w32.c' --- src/w32.c 2012-07-27 06:04:35 +0000 +++ src/w32.c 2012-07-27 07:36:33 +0000 @@ -1724,9 +1724,9 @@ if (!strcmp (env_vars[i].name, "HOME") && !appdata) Vdelayed_warnings_list = Fcons (listn (HEAP, 2, - intern ("initialization"); + intern ("initialization"), build_string ("Setting HOME to C:\\ by default is deprecated")), - Vdelayed_warnings_list); + Vdelayed_warnings_list); } if (lpval) === modified file 'src/w32fns.c' --- src/w32fns.c 2012-07-27 06:04:35 +0000 +++ src/w32fns.c 2012-07-27 07:36:33 +0000 @@ -6794,7 +6794,7 @@ Fput (Qundefined_color, Qerror_conditions, - listn (PURE, 2, Qundefined_color, Qerror); + listn (PURE, 2, Qundefined_color, Qerror)); Fput (Qundefined_color, Qerror_message, build_pure_c_string ("Undefined color")); ------------------------------------------------------------ revno: 109224 fixes bug(s): http://debbugs.gnu.org/12036 committer: Paul Eggert branch nick: trunk timestamp: Thu 2012-07-26 23:18:36 -0700 message: Improve GDB symbol export. * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different arms of an 'if', not using conditional expressions; otherwise GDB complains about the types in the unevaluated arm when the argument is an integer literal. (xgetint): Simplify expression. * alloc.c (gdb_make_enums_visible): New constant. This ports to GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli Zaretskii in . * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer needed now that we have gdb_make_enums_visible. (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits) (enum enum_USE_LSB_TAG): New enum types, packaging up enums that need to be exported to GDB. diff: === modified file 'src/.gdbinit' --- src/.gdbinit 2012-07-26 08:12:03 +0000 +++ src/.gdbinit 2012-07-27 06:18:36 +0000 @@ -46,17 +46,29 @@ # Use $bugfix so that the value isn't a constant. # Using a constant runs into GDB bugs sometimes. define xgetptr - set $bugfix = CHECK_LISP_OBJECT_TYPE ? $arg0.i : $arg0 + if (CHECK_LISP_OBJECT_TYPE) + set $bugfix = $arg0.i + else + set $bugfix = $arg0 + end set $ptr = ($bugfix & VALMASK) | DATA_SEG_BITS end define xgetint - set $bugfix = CHECK_LISP_OBJECT_TYPE ? $arg0.i : $arg0 - set $int = USE_LSB_TAG ? $bugfix >> INTTYPEBITS : $bugfix << INTTYPEBITS >> INTTYPEBITS + if (CHECK_LISP_OBJECT_TYPE) + set $bugfix = $arg0.i + else + set $bugfix = $arg0 + end + set $int = $bugfix << (USE_LSB_TAG ? 0 : INTTYPEBITS) >> INTTYPEBITS end define xgettype - set $bugfix = CHECK_LISP_OBJECT_TYPE ? $arg0.i : $arg0 + if (CHECK_LISP_OBJECT_TYPE) + set $bugfix = $arg0.i + else + set $bugfix = $arg0 + end set $type = (enum Lisp_Type) (USE_LSB_TAG ? $bugfix & (1 << GCTYPEBITS) - 1 : $bugfix >> VALBITS) end === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-27 06:04:35 +0000 +++ src/ChangeLog 2012-07-27 06:18:36 +0000 @@ -1,3 +1,20 @@ +2012-07-27 Paul Eggert + + Improve GDB symbol export (Bug#12036). + * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different + arms of an 'if', not using conditional expressions; otherwise GDB + complains about the types in the unevaluated arm when the argument + is an integer literal. + (xgetint): Simplify expression. + * alloc.c (gdb_make_enums_visible): New constant. This ports to + GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli + Zaretskii in . + * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer + needed now that we have gdb_make_enums_visible. + (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits) + (enum enum_USE_LSB_TAG): + New enum types, packaging up enums that need to be exported to GDB. + 2012-07-27 Dmitry Antipov Utility function to make a list from specified amount of objects. === modified file 'src/alloc.c' --- src/alloc.c 2012-07-27 06:04:35 +0000 +++ src/alloc.c 2012-07-27 06:18:36 +0000 @@ -6910,12 +6910,25 @@ #endif } -/* Make some symbols visible to GDB. These cannot be done as enums, like - GCTYPEBITS or USE_LSB_TAG, since values might not be in 'int' range. - Each symbol X has a corresponding X_VAL symbol, verified to have - the correct value. - - This is last, so that the #undef lines don't mess up later code. */ +/* Make some symbols visible to GDB. This section is last, so that + the #undef lines don't mess up later code. */ + +/* When compiled with GCC, GDB might say "No enum type named + pvec_type" if we don't have at least one symbol with that type, and + then xbacktrace could fail. Similarly for the other enums and + their values. */ +union +{ + enum CHECK_LISP_OBJECT_TYPE CHECK_LISP_OBJECT_TYPE; + enum enum_USE_LSB_TAG enum_USE_LSB_TAG; + enum Lisp_Bits Lisp_Bits; + enum More_Lisp_Bits More_Lisp_Bits; + enum pvec_type pvec_type; +} const EXTERNALLY_VISIBLE gdb_make_enums_visible = {0}; + +/* These symbols cannot be done as enums, since values might not be + in 'int' range. Each symbol X has a corresponding X_VAL symbol, + verified to have the correct value. */ #define ARRAY_MARK_FLAG_VAL PTRDIFF_MIN #define PSEUDOVECTOR_FLAG_VAL (PTRDIFF_MAX - PTRDIFF_MAX / 2) === modified file 'src/lisp.h' --- src/lisp.h 2012-07-27 06:04:35 +0000 +++ src/lisp.h 2012-07-27 06:18:36 +0000 @@ -64,12 +64,6 @@ # endif #endif -/* If an enum type is not used, the enum symbols are not put into the - executable so the debugger cannot see them on many systems, e.g., - GCC 4.7.1 + GDB 7.4.1 + GNU/Linux. Work around this problem by - explicitly using the names in the integer constant expression EXPR. */ -#define PUBLISH_TO_GDB(expr) extern int (*gdb_dummy (int))[(expr) || 1] - /* Number of bits in some machine integer types. */ enum { @@ -161,14 +155,23 @@ variable VAR of type TYPE with the added requirement that it be TYPEBITS-aligned. */ -/* Number of bits in a Lisp_Object tag. This can be used in #if, - and for GDB's sake also as a regular symbol. */ -enum { GCTYPEBITS = 3 }; -PUBLISH_TO_GDB (GCTYPEBITS); +enum Lisp_Bits + { + /* Number of bits in a Lisp_Object tag. This can be used in #if, + and for GDB's sake also as a regular symbol. */ + GCTYPEBITS = #define GCTYPEBITS 3 - -/* Number of bits in a Lisp_Object value, not counting the tag. */ -enum { VALBITS = BITS_PER_EMACS_INT - GCTYPEBITS }; + GCTYPEBITS, + + /* Number of bits in a Lisp_Object value, not counting the tag. */ + VALBITS = BITS_PER_EMACS_INT - GCTYPEBITS, + + /* Number of bits in a Lisp fixnum tag. */ + INTTYPEBITS = GCTYPEBITS - 1, + + /* Number of bits in a Lisp fixnum value, not counting the tag. */ + FIXNUM_BITS = VALBITS + 1 + }; /* The maximum value that can be stored in a EMACS_INT, assuming all bits other than the type bits contribute to a nonnegative signed value. @@ -211,16 +214,12 @@ # endif # endif #endif -/* USE_LSB_TAG can be used in #if; default it to 0 and make it visible - to GDB. */ #ifdef USE_LSB_TAG # undef USE_LSB_TAG -enum { USE_LSB_TAG = 1 }; -PUBLISH_TO_GDB (USE_LSB_TAG); +enum enum_USE_LSB_TAG { USE_LSB_TAG = 1 }; # define USE_LSB_TAG 1 #else -enum { USE_LSB_TAG = 0 }; -PUBLISH_TO_GDB (USE_LSB_TAG); +enum enum_USE_LSB_TAG { USE_LSB_TAG = 0 }; # define USE_LSB_TAG 0 #endif @@ -239,8 +238,6 @@ /* Lisp integers use 2 tags, to give them one extra bit, thus extending their range from, e.g., -2^28..2^28-1 to -2^29..2^29-1. */ -enum { INTTYPEBITS = GCTYPEBITS - 1 }; -enum { FIXNUM_BITS = VALBITS + 1 }; #define INTMASK (EMACS_INT_MAX >> (INTTYPEBITS - 1)) #define LISP_INT_TAG Lisp_Int0 #define case_Lisp_Int case Lisp_Int0: case Lisp_Int1 @@ -335,9 +332,9 @@ } #define LISP_INITIALLY_ZERO {0} + #undef CHECK_LISP_OBJECT_TYPE -enum { CHECK_LISP_OBJECT_TYPE = 1 }; - +enum CHECK_LISP_OBJECT_TYPE { CHECK_LISP_OBJECT_TYPE = 1 }; #else /* CHECK_LISP_OBJECT_TYPE */ /* If a struct type is not wanted, define Lisp_Object as just a number. */ @@ -347,9 +344,8 @@ #define XIL(i) (i) #define LISP_MAKE_RVALUE(o) (0+(o)) #define LISP_INITIALLY_ZERO 0 -enum { CHECK_LISP_OBJECT_TYPE = 0 }; +enum CHECK_LISP_OBJECT_TYPE { CHECK_LISP_OBJECT_TYPE = 0 }; #endif /* CHECK_LISP_OBJECT_TYPE */ -PUBLISH_TO_GDB (CHECK_LISP_OBJECT_TYPE); /* In the size word of a vector, this bit means the vector has been marked. */ @@ -390,35 +386,32 @@ PVEC_SUB_CHAR_TABLE = 0x30, PVEC_FONT = 0x40 }; -PUBLISH_TO_GDB ((enum pvec_type) 0); /* This also publishes PVEC_*. */ - -/* For convenience, we also store the number of elements in these bits. - Note that this size is not necessarily the memory-footprint size, but - only the number of Lisp_Object fields (that need to be traced by the GC). - The distinction is used e.g. by Lisp_Process which places extra - non-Lisp_Object fields at the end of the structure. */ -enum + +/* DATA_SEG_BITS forces extra bits to be or'd in with any pointers + which were stored in a Lisp_Object. */ +#ifndef DATA_SEG_BITS +# define DATA_SEG_BITS 0 +#endif +enum { gdb_DATA_SEG_BITS = DATA_SEG_BITS }; +#undef DATA_SEG_BITS + +enum More_Lisp_Bits { + DATA_SEG_BITS = gdb_DATA_SEG_BITS, + + /* For convenience, we also store the number of elements in these bits. + Note that this size is not necessarily the memory-footprint size, but + only the number of Lisp_Object fields (that need to be traced by GC). + The distinction is used, e.g., by Lisp_Process, which places extra + non-Lisp_Object fields at the end of the structure. */ PSEUDOVECTOR_SIZE_BITS = 16, PSEUDOVECTOR_SIZE_MASK = (1 << PSEUDOVECTOR_SIZE_BITS) - 1, - PVEC_TYPE_MASK = 0x0fff << PSEUDOVECTOR_SIZE_BITS + PVEC_TYPE_MASK = 0x0fff << PSEUDOVECTOR_SIZE_BITS, + + /* Number of bits to put in each character in the internal representation + of bool vectors. This should not vary across implementations. */ + BOOL_VECTOR_BITS_PER_CHAR = 8 }; - -/* Number of bits to put in each character in the internal representation - of bool vectors. This should not vary across implementations. */ -enum { BOOL_VECTOR_BITS_PER_CHAR = 8 }; - -/* DATA_SEG_BITS forces extra bits to be or'd in with any pointers - which were stored in a Lisp_Object. It is not needed in #if, so - for GDB's sake change it from a macro to a regular symbol. */ -#ifdef DATA_SEG_BITS -enum { gdb_DATA_SEG_BITS = DATA_SEG_BITS }; -# undef DATA_SEG_BITS -enum { DATA_SEG_BITS = gdb_DATA_SEG_BITS }; -#else -enum { DATA_SEG_BITS = 0 }; -#endif -PUBLISH_TO_GDB (DATA_SEG_BITS); /* These macros extract various sorts of values from a Lisp_Object. For example, if tem is a Lisp_Object whose type is Lisp_Cons,