Now on revision 112588. ------------------------------------------------------------ revno: 112588 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14387 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2013-05-14 22:00:07 -0400 message: * lisp/emacs-lisp/cl-extra.el (cl-getf): Return the proper value in the setter. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-15 00:52:07 +0000 +++ lisp/ChangeLog 2013-05-15 02:00:07 +0000 @@ -1,5 +1,8 @@ 2013-05-15 Stefan Monnier + * emacs-lisp/cl-extra.el (cl-getf): Return the proper value in + the setter (bug#14387). + * progmodes/f90.el (f90-blocks-re): Include the terminating \> in the surrounding group (bug#14402). === modified file 'lisp/emacs-lisp/cl-extra.el' --- lisp/emacs-lisp/cl-extra.el 2013-01-02 16:13:04 +0000 +++ lisp/emacs-lisp/cl-extra.el 2013-05-15 02:00:07 +0000 @@ -597,8 +597,11 @@ (macroexp-let2 nil d def (funcall do `(cl-getf ,getter ,k ,d) (lambda (v) - (funcall setter - `(cl--set-getf ,getter ,k ,v)))))))))) + (macroexp-let2 nil val v + `(progn + ,(funcall setter + `(cl--set-getf ,getter ,k ,val)) + ,val)))))))))) (setplist '--cl-getf-symbol-- plist) (or (get '--cl-getf-symbol-- tag) ;; Originally we called cl-get here, === modified file 'lisp/emacs-lisp/cl-loaddefs.el' --- lisp/emacs-lisp/cl-loaddefs.el 2013-05-10 10:21:19 +0000 +++ lisp/emacs-lisp/cl-loaddefs.el 2013-05-15 02:00:07 +0000 @@ -11,7 +11,7 @@ ;;;;;; cl--map-overlays cl--map-intervals cl--map-keymap-recursively ;;;;;; cl-notevery cl-notany cl-every cl-some cl-mapcon cl-mapcan ;;;;;; cl-mapl cl-mapc cl-maplist cl-map cl--mapcar-many cl-equalp -;;;;;; cl-coerce) "cl-extra" "cl-extra.el" "c5730f2a706cb1efc5fec0a790d3ca72") +;;;;;; cl-coerce) "cl-extra" "cl-extra.el" "011111887a1f353218e59e14d0b09c68") ;;; Generated autoloads from cl-extra.el (autoload 'cl-coerce "cl-extra" "\ ------------------------------------------------------------ revno: 112587 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14402 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2013-05-14 20:52:07 -0400 message: * lisp/progmodes/f90.el (f90-blocks-re): Include the terminating \> in the surrounding group. * src/regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-14 23:38:14 +0000 +++ lisp/ChangeLog 2013-05-15 00:52:07 +0000 @@ -1,3 +1,8 @@ +2013-05-15 Stefan Monnier + + * progmodes/f90.el (f90-blocks-re): Include the terminating \> in the + surrounding group (bug#14402). + 2013-05-14 Juri Linkov * subr.el (find-tag-default-as-regexp): Return nil if `tag' is nil. @@ -10,8 +15,8 @@ 2013-05-14 Jean-Philippe Gravel - * progmodes/gdb-mi.el (gdb-running, gdb-starting): Remove - signals for which replies are never received. + * progmodes/gdb-mi.el (gdb-running, gdb-starting): + Remove signals for which replies are never received. 2013-05-14 Jean-Philippe Gravel @@ -120,8 +125,8 @@ * progmodes/octave.el (octave-indent-comment): Improve. (octave-eldoc-message-style, octave-eldoc-cache): New variables. - (octave-eldoc-function-signatures, octave-eldoc-function): New - functions. + (octave-eldoc-function-signatures, octave-eldoc-function): + New functions. (octave-mode, inferior-octave-mode): Add eldoc support. 2013-05-11 Richard Stallman @@ -166,8 +171,8 @@ 2013-05-10 Leo Liu - * progmodes/octave.el (inferior-octave-completion-table): No - longer a function and all uses changed. Use cache to speed up + * progmodes/octave.el (inferior-octave-completion-table): + No longer a function and all uses changed. Use cache to speed up completion due to bug#11906. (octave-beginning-of-defun): Re-write to be more general. @@ -357,7 +362,7 @@ * progmodes/octave.el (octave-syntax-propertize-function): Change \'s syntax to escape when inside double-quoted strings. (Bug#14332) (octave-font-lock-keywords): Use octave-operator-regexp. - (octave-completion-at-point): Renamed from + (octave-completion-at-point): Rename from octave-completion-at-point-function. (inferior-octave-directory-tracker): Robustify. (octave-text-functions): Remove and fix its uses. No such things === modified file 'lisp/progmodes/f90.el' --- lisp/progmodes/f90.el 2013-05-14 19:29:35 +0000 +++ lisp/progmodes/f90.el 2013-05-15 00:52:07 +0000 @@ -249,8 +249,8 @@ "Qualification of END statements according to the matching block start. For example, change the END that closes an IF block to END IF. If the block has a label, add it as well (unless `f90-smart-end-names' -says not to). Allowed values are 'blink, 'no-blink, and nil. If nil, -nothing is done. The other two settings have the same effect, but 'blink +says not to). Allowed values are `blink', `no-blink', and nil. If nil, +nothing is done. The other two settings have the same effect, but `blink' additionally blinks the cursor to the start of the block." :type '(choice (const blink) (const no-blink) (const nil)) :safe (lambda (value) (memq value '(blink no-blink nil))) @@ -842,14 +842,14 @@ ;; Regexps for finding program structures. (defconst f90-blocks-re - (concat "\\(block[ \t]*data\\|" + (concat "\\(\\(?:block[ \t]*data\\|" (regexp-opt '("do" "if" "interface" "function" "module" "program" "select" "subroutine" "type" "where" "forall" ;; F2003. "enum" "associate" ;; F2008. "submodule" "block" "critical")) - "\\)\\_>") + "\\)\\_>\\)") "Regexp potentially indicating a \"block\" of F90 code.") (defconst f90-program-block-re @@ -1138,8 +1138,8 @@ Automatic insertion of \& at beginning of continuation lines (default t). `f90-smart-end' From an END statement, check and fill the end using matching block start. - Allowed values are 'blink, 'no-blink, and nil, which determine - whether to blink the matching beginning (default 'blink). + Allowed values are `blink', `no-blink', and nil, which determine + whether to blink the matching beginning (default `blink'). `f90-auto-keyword-case' Automatic change of case of keywords (default nil). The possibilities are `downcase-word', `upcase-word', `capitalize-word'. === modified file 'src/ChangeLog' --- src/ChangeLog 2013-05-14 14:09:43 +0000 +++ src/ChangeLog 2013-05-15 00:52:07 +0000 @@ -1,8 +1,12 @@ +2013-05-15 Stefan Monnier + + * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart. + 2013-05-14 Eli Zaretskii * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT - unless we know that the window w is a leaf window. Another - attempt at solving bug#14062. + unless we know that the window w is a leaf window. + Another attempt at solving bug#14062. 2013-05-14 Jan Djärv === modified file 'src/regex.c' --- src/regex.c 2013-05-06 04:31:16 +0000 +++ src/regex.c 2013-05-15 00:52:07 +0000 @@ -2622,7 +2622,7 @@ goto normal_char; handle_plus: case '*': - /* If there is no previous pattern... */ + /* If there is no previous pattern... */ if (!laststart) { if (syntax & RE_CONTEXT_INVALID_OPS) @@ -2730,7 +2730,7 @@ } } else /* not greedy */ - { /* I wish the greedy and non-greedy cases could be merged. */ + { /* I wish the greedy and non-greedy cases could be merged. */ GET_BUFFER_SPACE (7); /* We might use less. */ if (many_times_ok) @@ -3034,7 +3034,7 @@ /* Allocate space for COUNT + RANGE_TABLE. Needs two bytes for flags, two for COUNT, and three bytes for - each character. */ + each character. */ GET_BUFFER_SPACE (4 + used * 3); /* Indicate the existence of range table. */ @@ -3461,6 +3461,7 @@ /* There is no way to specify the before_dot and after_dot operators. rms says this is ok. --karl */ case '=': + laststart = b; BUF_PUSH (at_dot); break; @@ -3509,12 +3510,14 @@ case '<': if (syntax & RE_NO_GNU_OPS) goto normal_char; + laststart = b; BUF_PUSH (wordbeg); break; case '>': if (syntax & RE_NO_GNU_OPS) goto normal_char; + laststart = b; BUF_PUSH (wordend); break; ------------------------------------------------------------ revno: 112586 fixes bug: http://debbugs.gnu.org/14390 committer: Juri Linkov branch nick: trunk timestamp: Wed 2013-05-15 02:38:14 +0300 message: * lisp/subr.el (find-tag-default-as-regexp): Return nil if `tag' is nil. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-14 19:29:35 +0000 +++ lisp/ChangeLog 2013-05-14 23:38:14 +0000 @@ -1,3 +1,8 @@ +2013-05-14 Juri Linkov + + * subr.el (find-tag-default-as-regexp): Return nil if `tag' is nil. + (Bug#14390) + 2013-05-14 Glenn Morris * progmodes/f90.el (f90-imenu-generic-expression): === modified file 'lisp/subr.el' --- lisp/subr.el 2013-05-14 16:01:16 +0000 +++ lisp/subr.el 2013-05-14 23:38:14 +0000 @@ -2738,7 +2738,7 @@ (get major-mode 'find-tag-default-function) 'find-tag-default)) (tag (funcall tagf))) - (cond ((not tag)) + (cond ((null tag) nil) ((eq tagf 'find-tag-default) (format "\\_<%s\\_>" (regexp-quote tag))) (t (regexp-quote tag))))) ------------------------------------------------------------ revno: 112585 committer: Glenn Morris branch nick: trunk timestamp: Tue 2013-05-14 15:29:35 -0400 message: * f90.el (f90-imenu-generic-expression): Fix typo in 2013-05-08 change. (Bug#14402) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-14 18:34:13 +0000 +++ lisp/ChangeLog 2013-05-14 19:29:35 +0000 @@ -1,3 +1,8 @@ +2013-05-14 Glenn Morris + + * progmodes/f90.el (f90-imenu-generic-expression): + Fix typo in 2013-05-08 change. (Bug#14402) + 2013-05-14 Jean-Philippe Gravel * progmodes/gdb-mi.el (gdb-running, gdb-starting): Remove === modified file 'lisp/progmodes/f90.el' --- lisp/progmodes/f90.el 2013-05-08 16:27:53 +0000 +++ lisp/progmodes/f90.el 2013-05-14 19:29:35 +0000 @@ -981,7 +981,7 @@ ("Submodules" "^[ \t0-9]*submodule[ \t]*([^)\n]+)[ \t]*\ \\(\\(?:\\sw\\|\\s_\\)+\\)[ \t]*\\(!\\|$\\)" 1) ("Modules" "^[ \t0-9]*module[ \t]+\\(\\(?:\\sw\\|\\s_\\)+\\)[ \t]*\\(!\\|$\\)" 1) - '("Types" f90-imenu-type-matcher 1) + ("Types" f90-imenu-type-matcher 1) ;; Does not handle: "type[, stuff] :: foo". ;;(format "^[ \t0-9]*type[ \t]+\\(\\(%s\\|i%s\\|is\\(?:\\sw\\|\\s_\\)\\)\\(?:\\sw\\|\\s_\\)*\\)" ;; not-ib not-s) ------------------------------------------------------------ revno: 112584 committer: Jean-Philippe Gravel branch nick: trunk timestamp: Tue 2013-05-14 14:34:13 -0400 message: * progmodes/gdb-mi.el (gdb-running, gdb-starting): Remove signals for which replies are never received. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-14 18:13:31 +0000 +++ lisp/ChangeLog 2013-05-14 18:34:13 +0000 @@ -1,5 +1,10 @@ 2013-05-14 Jean-Philippe Gravel + * progmodes/gdb-mi.el (gdb-running, gdb-starting): Remove + signals for which replies are never received. + +2013-05-14 Jean-Philippe Gravel + * progmodes/gdb-mi.el: Fix non-responsive gud commands (bug#13845) (gdb-handler-alist, gdb-handler-number): Remove variables. (gdb-handler-list): New variable. === modified file 'lisp/progmodes/gdb-mi.el' --- lisp/progmodes/gdb-mi.el 2013-05-14 18:13:31 +0000 +++ lisp/progmodes/gdb-mi.el 2013-05-14 18:34:13 +0000 @@ -2376,8 +2376,7 @@ (propertize gdb-inferior-status 'face font-lock-type-face)) (when (not gdb-non-stop) (setq gud-running t)) - (setq gdb-active-process t) - (gdb-emit-signal gdb-buf-publisher 'update-threads)) + (setq gdb-active-process t)) (defun gdb-starting (_output-field _result) ;; CLI commands don't emit ^running at the moment so use gdb-running too. @@ -2385,11 +2384,7 @@ (gdb-force-mode-line-update (propertize gdb-inferior-status 'face font-lock-type-face)) (setq gdb-active-process t) - (setq gud-running t) - ;; GDB doesn't seem to respond to -thread-info before first stop or - ;; thread exit (even in non-stop mode), so this is useless. - ;; Behavior may change in the future. - (gdb-emit-signal gdb-buf-publisher 'update-threads)) + (setq gud-running t)) ;; -break-insert -t didn't give a reason before gdb 6.9 ------------------------------------------------------------ revno: 112583 fixes bug: http://debbugs.gnu.org/13845 committer: Jean-Philippe Gravel branch nick: trunk timestamp: Tue 2013-05-14 14:13:31 -0400 message: * progmodes/gdb-mi.el: Fix non-responsive gud commands (bug#13845) (gdb-handler-alist, gdb-handler-number): Remove variables. (gdb-handler-list): New variable. (gdb-add-handler, gdb-delete-handler, gdb-get-handler-function) (gdb-pending-handler-p, gdb-handle-reply) (gdb-remove-all-pending-triggers): New functions. (gdb-discard-unordered-replies): New defcustom. (gdb-handler): New defstruct. (gdb-wait-for-pending): Fix invalid backquote. Use gdb-handler-list. instead of gdb-pending-triggers. Update docstring. (gdb-init-1): Remove dead variables. Initialize gdb-handler-list. (gdb-speedbar-update, gdb-speedbar-timer-fn, gdb-var-update) (gdb-var-update-handler, def-gdb-auto-update-trigger) (def-gdb-auto-update-handler, gdb-get-changed-registers) (gdb-changed-registers-handler, gdb-get-main-selected-frame) (gdb-frame-handler): Pending triggers are now automatically managed. (def-gdb-trigger-and-handler, def-gdb-auto-update-handler): Remove argument. (gdb-input): Automatically handles pending triggers. Update docstring. (gdb-resync): Replace gdb-pending-triggers by gdb-handler-list. (gdb-thread-exited, gdb-thread-selected, gdb-register-names-handler): Update comments. (gdb-done-or-error): Now use gdb-handle-reply. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-12 13:38:42 +0000 +++ lisp/ChangeLog 2013-05-14 18:13:31 +0000 @@ -1,5 +1,31 @@ 2013-05-14 Jean-Philippe Gravel + * progmodes/gdb-mi.el: Fix non-responsive gud commands (bug#13845) + (gdb-handler-alist, gdb-handler-number): Remove variables. + (gdb-handler-list): New variable. + (gdb-add-handler, gdb-delete-handler, gdb-get-handler-function) + (gdb-pending-handler-p, gdb-handle-reply) + (gdb-remove-all-pending-triggers): New functions. + (gdb-discard-unordered-replies): New defcustom. + (gdb-handler): New defstruct. + (gdb-wait-for-pending): Fix invalid backquote. Use gdb-handler-list. + instead of gdb-pending-triggers. Update docstring. + (gdb-init-1): Remove dead variables. Initialize gdb-handler-list. + (gdb-speedbar-update, gdb-speedbar-timer-fn, gdb-var-update) + (gdb-var-update-handler, def-gdb-auto-update-trigger) + (def-gdb-auto-update-handler, gdb-get-changed-registers) + (gdb-changed-registers-handler, gdb-get-main-selected-frame) + (gdb-frame-handler): Pending triggers are now automatically managed. + (def-gdb-trigger-and-handler, def-gdb-auto-update-handler): + Remove argument. + (gdb-input): Automatically handles pending triggers. Update docstring. + (gdb-resync): Replace gdb-pending-triggers by gdb-handler-list. + (gdb-thread-exited, gdb-thread-selected, gdb-register-names-handler): + Update comments. + (gdb-done-or-error): Now use gdb-handle-reply. + +2013-05-14 Jean-Philippe Gravel + * progmodes/gdb-mi.el (gdb-input): Include token numbers in gdb-debug-log. === modified file 'lisp/progmodes/gdb-mi.el' --- lisp/progmodes/gdb-mi.el 2013-05-12 13:38:42 +0000 +++ lisp/progmodes/gdb-mi.el 2013-05-14 18:13:31 +0000 @@ -91,7 +91,7 @@ (require 'gud) (require 'json) (require 'bindat) -(eval-when-compile (require 'cl-lib)) +(require 'cl-lib) (declare-function speedbar-change-initial-expansion-list "speedbar" (new-default)) @@ -206,8 +206,8 @@ (defvar gdb-last-command nil) (defvar gdb-prompt-name nil) (defvar gdb-token-number 0) -(defvar gdb-handler-alist '()) -(defvar gdb-handler-number nil) +(defvar gdb-handler-list '() + "List of gdb-handler keeping track of all pending GDB commands.") (defvar gdb-source-file-list nil "List of source files for the current executable.") (defvar gdb-first-done-or-error t) @@ -242,33 +242,114 @@ disposition of output generated by commands that gdb mode sends to gdb on its own behalf.") -;; Pending triggers prevent congestion: Emacs won't send two similar -;; consecutive requests. - -(defvar gdb-pending-triggers '() - "A list of trigger functions which have not yet been handled. - -Elements are either function names or pairs (buffer . function)") - -(defmacro gdb-add-pending (item) - `(push ,item gdb-pending-triggers)) -(defmacro gdb-pending-p (item) - `(member ,item gdb-pending-triggers)) -(defmacro gdb-delete-pending (item) - `(setq gdb-pending-triggers - (delete ,item gdb-pending-triggers))) +(defcustom gdb-discard-unordered-replies t + "Non-nil means discard any out-of-order GDB replies. +This protects against lost GDB replies, assuming that GDB always +replies in the same order as Emacs sends commands. When receiving a +reply with a given token-number, assume any pending messages with a +lower token-number are out-of-order." + :type 'boolean + :group 'gud + :version "24.4") + +(cl-defstruct gdb-handler + "Data required to handle the reply of a command sent to GDB." + ;; Prefix of the command sent to GDB. The GDB reply for this command + ;; will be prefixed with this same TOKEN-NUMBER + (token-number nil :read-only t) + ;; Callback to invoke when the reply is received from GDB + (function nil :read-only t) + ;; PENDING-TRIGGER is used to prevent congestion: Emacs won't send + ;; two requests with the same PENDING-TRIGGER until a reply is received + ;; for the first one." + (pending-trigger nil)) + +(defun gdb-add-handler (token-number handler-function &optional pending-trigger) + "Insert a new GDB command handler in `gdb-handler-list'. +Handlers are used to keep track of the commands sent to GDB +and to handle the replies received. +Upon reception of a reply prefixed with TOKEN-NUMBER, +invoke the callback HANDLER-FUNCTION. +If PENDING-TRIGGER is specified, no new GDB commands will be +sent with this same PENDING-TRIGGER until a reply is received +for this handler." + + (push (make-gdb-handler :token-number token-number + :function handler-function + :pending-trigger pending-trigger) + gdb-handler-list)) + +(defun gdb-delete-handler (token-number) + "Remove the handler TOKEN-NUMBER from `gdb-handler-list'. +Additionally, if `gdb-discard-unordered-replies' is non-nil, +discard all handlers having a token number less than TOKEN-NUMBER." + (if gdb-discard-unordered-replies + + (setq gdb-handler-list + (cl-delete-if + (lambda (handler) + "Discard any HANDLER with a token number `<=' than TOKEN-NUMBER." + (when (< (gdb-handler-token-number handler) token-number) + (message (format + "WARNING! Discarding GDB handler with token #%d\n" + (gdb-handler-token-number handler)))) + (<= (gdb-handler-token-number handler) token-number)) + gdb-handler-list)) + + (setq gdb-handler-list + (cl-delete-if + (lambda (handler) + "Discard any HANDLER with a token number `eq' to TOKEN-NUMBER." + (eq (gdb-handler-token-number handler) token-number)) + gdb-handler-list)))) + +(defun gdb-get-handler-function (token-number) + "Return the function callback registered with the handler TOKEN-NUMBER." + (gdb-handler-function + (cl-find-if (lambda (handler) (eq (gdb-handler-token-number handler) + token-number)) + gdb-handler-list))) + + +(defun gdb-pending-handler-p (pending-trigger) + "Return non-nil if a command handler is pending with trigger PENDING-TRIGGER." + (cl-find-if (lambda (handler) (eq (gdb-handler-pending-trigger handler) + pending-trigger)) + gdb-handler-list)) + + +(defun gdb-handle-reply (token-number) + "Handle the GDB reply TOKEN-NUMBER. +This invokes the handler registered with this token number +in `gdb-handler-list' and clears all pending handlers invalidated +by the reception of this reply." + (let ((handler-function (gdb-get-handler-function token-number))) + (when handler-function + (funcall handler-function) + (gdb-delete-handler token-number)))) + +(defun gdb-remove-all-pending-triggers () + "Remove all pending triggers from gdb-handler-list. +The handlers are left in gdb-handler-list so that replies received +from GDB could still be handled. However, removing the pending triggers +allows Emacs to send new commands even if replies of previous commands +were not yet received." + (dolist (handler gdb-handler-list) + (setf (gdb-handler-pending-trigger handler) nil))) (defmacro gdb-wait-for-pending (&rest body) - "Wait until `gdb-pending-triggers' is empty and evaluate FORM. + "Wait for all pending GDB commands to finish and evaluate BODY. -This function checks `gdb-pending-triggers' value every -`gdb-wait-for-pending' seconds." - (run-with-timer - 0.5 nil - `(lambda () - (if (not gdb-pending-triggers) - (progn ,@body) - (gdb-wait-for-pending ,@body))))) +This function checks every 0.5 seconds if there are any pending +triggers in `gdb-handler-list'." + `(run-with-timer + 0.5 nil + '(lambda () + (if (not (gdb-find-if (lambda (handler) + (gdb-handler-pending-trigger handler)) + gdb-handler-list)) + (progn ,@body) + (gdb-wait-for-pending ,@body))))) ;; Publish-subscribe @@ -820,14 +901,12 @@ gdb-frame-number nil gdb-thread-number nil gdb-var-list nil - gdb-pending-triggers nil gdb-output-sink 'user gdb-location-alist nil gdb-source-file-list nil gdb-last-command nil gdb-token-number 0 - gdb-handler-alist '() - gdb-handler-number nil + gdb-handler-list '() gdb-prompt-name nil gdb-first-done-or-error t gdb-buffer-fringe-width (car (window-fringes)) @@ -1107,17 +1186,15 @@ (message-box "No symbol \"%s\" in current context." expr)))) (defun gdb-speedbar-update () - (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame) - (not (gdb-pending-p 'gdb-speedbar-timer))) + (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) ;; Dummy command to update speedbar even when idle. - (gdb-input "-environment-pwd" 'gdb-speedbar-timer-fn) - ;; Keep gdb-pending-triggers non-nil till end. - (gdb-add-pending 'gdb-speedbar-timer))) + (gdb-input "-environment-pwd" + 'gdb-speedbar-timer-fn + 'gdb-speedbar-update))) (defun gdb-speedbar-timer-fn () (if gdb-speedbar-auto-raise (raise-frame speedbar-frame)) - (gdb-delete-pending 'gdb-speedbar-timer) (speedbar-timer-fn)) (defun gdb-var-evaluate-expression-handler (varnum changed) @@ -1207,9 +1284,9 @@ ; Uses "-var-update --all-values". Needs GDB 6.4 onwards. (defun gdb-var-update () - (if (not (gdb-pending-p 'gdb-var-update)) - (gdb-input "-var-update --all-values *" 'gdb-var-update-handler)) - (gdb-add-pending 'gdb-var-update)) + (gdb-input "-var-update --all-values *" + 'gdb-var-update-handler + 'gdb-var-update)) (defun gdb-var-update-handler () (let ((changelist (bindat-get-field (gdb-json-partial-output) 'changelist))) @@ -1272,8 +1349,6 @@ (push var1 var-list)) (setq var1 (pop temp-var-list))) (setq gdb-var-list (nreverse var-list)))))))) - (setq gdb-pending-triggers - (delq 'gdb-var-update gdb-pending-triggers)) (gdb-speedbar-update)) (defun gdb-speedbar-expand-node (text token indent) @@ -1727,19 +1802,25 @@ (setq string (replace-regexp-in-string "\n" "\\n" string t t)) (concat "\"" string "\"")) -(defun gdb-input (command handler-function) +(defun gdb-input (command handler-function &optional trigger-name) "Send COMMAND to GDB via the MI interface. Run the function HANDLER-FUNCTION, with no arguments, once the command is -complete." - (setq gdb-token-number (1+ gdb-token-number)) - (setq command (concat (number-to-string gdb-token-number) command)) - - (if gdb-enable-debug (push (list 'send-item command handler-function) - gdb-debug-log)) - (push (cons gdb-token-number handler-function) gdb-handler-alist) - (if gdbmi-debug-mode (message "gdb-input: %s" command)) - (process-send-string (get-buffer-process gud-comint-buffer) - (concat command "\n"))) +complete. Do not send COMMAND to GDB if TRIGGER-NAME is non-nil and +Emacs is still waiting for a reply from another command previously +sent with the same TRIGGER-NAME." + (when (or (not trigger-name) + (not (gdb-pending-handler-p trigger-name))) + (setq gdb-token-number (1+ gdb-token-number)) + (setq command (concat (number-to-string gdb-token-number) command)) + + (if gdb-enable-debug (push (list 'send-item command handler-function) + gdb-debug-log)) + + (gdb-add-handler gdb-token-number handler-function trigger-name) + + (if gdbmi-debug-mode (message "gdb-input: %s" command)) + (process-send-string (get-buffer-process gud-comint-buffer) + (concat command "\n")))) ;; NOFRAME is used for gud execution control commands (defun gdb-current-context-command (command) @@ -1775,7 +1856,7 @@ (defun gdb-resync() (setq gud-running nil) (setq gdb-output-sink 'user) - (setq gdb-pending-triggers nil)) + (gdb-remove-all-pending-triggers)) (defun gdb-update (&optional no-proc) "Update buffers showing status of debug session. @@ -2256,9 +2337,9 @@ (if (string= gdb-thread-number thread-id) (gdb-setq-thread-number nil)) ;; When we continue current thread and it quickly exits, - ;; gdb-pending-triggers left after gdb-running disallow us to - ;; properly call -thread-info without --thread option. Thus we - ;; need to use gdb-wait-for-pending. + ;; the pending triggers in gdb-handler-list left after gdb-running + ;; disallow us to properly call -thread-info without --thread option. + ;; Thus we need to use gdb-wait-for-pending. (gdb-wait-for-pending (gdb-emit-signal gdb-buf-publisher 'update-threads)))) @@ -2273,9 +2354,10 @@ ;; by `=thread-selected` notification. `^done` causes `gdb-update` ;; as usually. Things happen to fast and second call (from ;; gdb-thread-selected handler) gets cut off by our beloved - ;; gdb-pending-triggers. - ;; Solution is `gdb-wait-for-pending` macro: it guarantees that its - ;; body will get executed when `gdb-pending-triggers` is empty. + ;; pending triggers. + ;; Solution is `gdb-wait-for-pending' macro: it guarantees that its + ;; body will get executed when `gdb-handler-list' if free of + ;; pending triggers. (gdb-wait-for-pending (gdb-update)))) @@ -2439,10 +2521,7 @@ (when (and token-number is-complete) (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer) - (funcall - (cdr (assoc (string-to-number token-number) gdb-handler-alist)))) - (setq gdb-handler-alist - (assq-delete-all token-number gdb-handler-alist))) + (gdb-handle-reply (string-to-number token-number)))) (when is-complete (gdb-clear-partial-output)))) @@ -2660,27 +2739,23 @@ (when (or (not ,signal-list) (memq signal ,signal-list)) - (when (not (gdb-pending-p - (cons (current-buffer) ',trigger-name))) - (gdb-input ,gdb-command - (gdb-bind-function-to-buffer ',handler-name (current-buffer))) - (gdb-add-pending (cons (current-buffer) ',trigger-name)))))) + (gdb-input ,gdb-command + (gdb-bind-function-to-buffer ',handler-name (current-buffer)) + (cons (current-buffer) ',trigger-name))))) ;; Used by disassembly buffer only, the rest use ;; def-gdb-trigger-and-handler -(defmacro def-gdb-auto-update-handler (handler-name trigger-name custom-defun +(defmacro def-gdb-auto-update-handler (handler-name custom-defun &optional nopreserve) - "Define a handler HANDLER-NAME for TRIGGER-NAME with CUSTOM-DEFUN. + "Define a handler HANDLER-NAME calling CUSTOM-DEFUN. Handlers are normally called from the buffers they put output in. -Delete ((current-buffer) . TRIGGER-NAME) from -`gdb-pending-triggers', erase current buffer and evaluate -CUSTOM-DEFUN. Then `gdb-update-buffer-name' is called. +Erase current buffer and evaluate CUSTOM-DEFUN. +Then call `gdb-update-buffer-name'. If NOPRESERVE is non-nil, window point is not restored after CUSTOM-DEFUN." `(defun ,handler-name () - (gdb-delete-pending (cons (current-buffer) ',trigger-name)) (let* ((inhibit-read-only t) ,@(unless nopreserve '((window (get-buffer-window (current-buffer) 0)) @@ -2708,7 +2783,7 @@ ,gdb-command ,handler-name ,signal-list) (def-gdb-auto-update-handler ,handler-name - ,trigger-name ,custom-defun))) + ,custom-defun))) @@ -3625,7 +3700,6 @@ (def-gdb-auto-update-handler gdb-disassembly-handler - gdb-invalidate-disassembly gdb-disassembly-handler-custom t) @@ -4117,21 +4191,19 @@ ;; Needs GDB 6.4 onwards (used to fail with no stack). (defun gdb-get-changed-registers () - (when (and (gdb-get-buffer 'gdb-registers-buffer) - (not (gdb-pending-p 'gdb-get-changed-registers))) + (when (gdb-get-buffer 'gdb-registers-buffer) (gdb-input "-data-list-changed-registers" - 'gdb-changed-registers-handler) - (gdb-add-pending 'gdb-get-changed-registers))) + 'gdb-changed-registers-handler + 'gdb-get-changed-registers))) (defun gdb-changed-registers-handler () - (gdb-delete-pending 'gdb-get-changed-registers) (setq gdb-changed-registers nil) (dolist (register-number (bindat-get-field (gdb-json-partial-output) 'changed-registers)) (push register-number gdb-changed-registers))) (defun gdb-register-names-handler () - ;; Don't use gdb-pending-triggers because this handler is called + ;; Don't use pending triggers because this handler is called ;; only once (in gdb-init-1) (setq gdb-register-names nil) (dolist (register-name @@ -4155,16 +4227,13 @@ (defun gdb-get-main-selected-frame () "Trigger for `gdb-frame-handler' which uses main current thread. Called from `gdb-update'." - (if (not (gdb-pending-p 'gdb-get-main-selected-frame)) - (progn - (gdb-input (gdb-current-context-command "-stack-info-frame") - 'gdb-frame-handler) - (gdb-add-pending 'gdb-get-main-selected-frame)))) + (gdb-input (gdb-current-context-command "-stack-info-frame") + 'gdb-frame-handler + 'gdb-get-main-selected-frame)) (defun gdb-frame-handler () "Set `gdb-selected-frame' and `gdb-selected-file' to show overlay arrow in source buffer." - (gdb-delete-pending 'gdb-get-main-selected-frame) (let ((frame (bindat-get-field (gdb-json-partial-output) 'frame))) (when frame (setq gdb-selected-frame (bindat-get-field frame 'func)) ------------------------------------------------------------ revno: 112582 committer: Jean-Philippe Gravel branch nick: trunk timestamp: Sun 2013-05-12 09:38:42 -0400 message: * progmodes/gdb-mi.el (gdb-input): Include token numbers in gdb-debug-log. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-14 16:01:16 +0000 +++ lisp/ChangeLog 2013-05-12 13:38:42 +0000 @@ -1,3 +1,8 @@ +2013-05-14 Jean-Philippe Gravel + + * progmodes/gdb-mi.el (gdb-input): Include token numbers in + gdb-debug-log. + 2013-05-14 Glenn Morris * subr.el (user-emacs-directory-warning): New option. === modified file 'lisp/progmodes/gdb-mi.el' --- lisp/progmodes/gdb-mi.el 2013-04-20 16:24:04 +0000 +++ lisp/progmodes/gdb-mi.el 2013-05-12 13:38:42 +0000 @@ -1731,10 +1731,11 @@ "Send COMMAND to GDB via the MI interface. Run the function HANDLER-FUNCTION, with no arguments, once the command is complete." + (setq gdb-token-number (1+ gdb-token-number)) + (setq command (concat (number-to-string gdb-token-number) command)) + (if gdb-enable-debug (push (list 'send-item command handler-function) gdb-debug-log)) - (setq gdb-token-number (1+ gdb-token-number)) - (setq command (concat (number-to-string gdb-token-number) command)) (push (cons gdb-token-number handler-function) gdb-handler-alist) (if gdbmi-debug-mode (message "gdb-input: %s" command)) (process-send-string (get-buffer-process gud-comint-buffer) ------------------------------------------------------------ revno: 112581 fixes bug: http://debbugs.gnu.org/13930 committer: Glenn Morris branch nick: trunk timestamp: Tue 2013-05-14 09:01:16 -0700 message: * subr.el (user-emacs-directory-warning): New option. (locate-user-emacs-file): Handle non-accessible .emacs.d. Not in NEWS, because you only need to know about this if you encounter it in the wild. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-14 10:11:56 +0000 +++ lisp/ChangeLog 2013-05-14 16:01:16 +0000 @@ -1,3 +1,8 @@ +2013-05-14 Glenn Morris + + * subr.el (user-emacs-directory-warning): New option. + (locate-user-emacs-file): Handle non-accessible .emacs.d. (Bug#13930) + 2013-05-14 Leo Liu * progmodes/octave.el (octave-font-lock-keywords): Fix error === modified file 'lisp/subr.el' --- lisp/subr.el 2013-04-27 21:12:17 +0000 +++ lisp/subr.el 2013-05-14 16:01:16 +0000 @@ -2643,6 +2643,13 @@ Note that this should end with a directory separator. See also `locate-user-emacs-file'.") +(custom-declare-variable-early 'user-emacs-directory-warning t + "Non-nil means warn if cannot access `user-emacs-directory'. +Set this to nil at your own risk..." + :type 'boolean + :group 'initialization + :version "24.4") + (defun locate-user-emacs-file (new-name &optional old-name) "Return an absolute per-user Emacs-specific file name. If NEW-NAME exists in `user-emacs-directory', return it. @@ -2658,17 +2665,33 @@ (file-readable-p at-home)) at-home ;; Make sure `user-emacs-directory' exists, - ;; unless we're in batch mode or dumping Emacs + ;; unless we're in batch mode or dumping Emacs. (or noninteractive purify-flag - (file-accessible-directory-p - (directory-file-name user-emacs-directory)) - (let ((umask (default-file-modes))) - (unwind-protect - (progn - (set-default-file-modes ?\700) - (make-directory user-emacs-directory)) - (set-default-file-modes umask)))) + (let (errtype) + (if (file-directory-p user-emacs-directory) + (or (file-accessible-directory-p user-emacs-directory) + (setq errtype "access")) + (let ((umask (default-file-modes))) + (unwind-protect + (progn + (set-default-file-modes ?\700) + (condition-case nil + (make-directory user-emacs-directory) + (error (setq errtype "create")))) + (set-default-file-modes umask)))) + (when (and errtype + user-emacs-directory-warning + (not (get 'user-emacs-directory-warning 'this-session))) + ;; Only warn once per Emacs session. + (put 'user-emacs-directory-warning 'this-session t) + (display-warning 'initialization + (format "\ +Unable to %s `user-emacs-directory' (%s). +Any data that would normally be written there may be lost! +If you never want to see this message again, +customize the variable `user-emacs-directory-warning'." + errtype user-emacs-directory))))) bestname)))) ;;;; Misc. useful functions. ------------------------------------------------------------ revno: 112580 fixes bug: http://debbugs.gnu.org/14062 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2013-05-14 17:09:43 +0300 message: Another attempt to solve bug #14062 with assertion violations on MS-Windows. src/w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT unless we know that the window w is a leaf window. Another attempt at solving bug#14062. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-05-14 09:34:16 +0000 +++ src/ChangeLog 2013-05-14 14:09:43 +0000 @@ -1,3 +1,9 @@ +2013-05-14 Eli Zaretskii + + * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT + unless we know that the window w is a leaf window. Another + attempt at solving bug#14062. + 2013-05-14 Jan Djärv * nsfont.m (ns_spec_to_descriptor): Retain and autorelease === modified file 'src/w32fns.c' --- src/w32fns.c 2013-05-04 10:19:13 +0000 +++ src/w32fns.c 2013-05-14 14:09:43 +0000 @@ -3183,8 +3183,9 @@ form.ptCurrentPos.y = w32_system_caret_y; form.rcArea.left = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, 0); - form.rcArea.top = (WINDOW_TOP_EDGE_Y (w) - + WINDOW_HEADER_LINE_HEIGHT (w)); + form.rcArea.top = WINDOW_TOP_EDGE_Y (w); + if (BUFFERP (w->contents)) + form.rcArea.top += WINDOW_HEADER_LINE_HEIGHT (w); form.rcArea.right = (WINDOW_BOX_RIGHT_EDGE_X (w) - WINDOW_RIGHT_MARGIN_WIDTH (w) - WINDOW_RIGHT_FRINGE_WIDTH (w)); ------------------------------------------------------------ revno: 112579 committer: Leo Liu branch nick: trunk timestamp: Tue 2013-05-14 18:11:56 +0800 message: * progmodes/octave.el (octave-font-lock-texinfo-comment): Fix invalid search bound error: wrong side of point. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-14 05:19:29 +0000 +++ lisp/ChangeLog 2013-05-14 10:11:56 +0000 @@ -3,6 +3,8 @@ * progmodes/octave.el (octave-font-lock-keywords): Fix error during redisplay. (octave-goto-function-definition, octave-find-definition): Minor tweaks. + (octave-font-lock-texinfo-comment): Fix invalid search bound + error: wrong side of point. 2013-05-14 Glenn Morris === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-05-14 05:19:29 +0000 +++ lisp/progmodes/octave.el 2013-05-14 10:11:56 +0000 @@ -1067,7 +1067,8 @@ (font-lock-add-keywords nil `((,(lambda (limit) - (while (and (search-forward "-*- texinfo -*-" limit t) + (while (and (< (point) limit) + (search-forward "-*- texinfo -*-" limit t) (octave-in-comment-p)) (let ((beg (nth 8 (syntax-ppss))) (end (progn ------------------------------------------------------------ revno: 112578 fixes bug: http://debbugs.gnu.org/14375 committer: Jan Djärv branch nick: trunk timestamp: Tue 2013-05-14 11:34:16 +0200 message: * nsfont.m (ns_spec_to_descriptor): Retain and autorelease fdesc. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-05-12 19:17:04 +0000 +++ src/ChangeLog 2013-05-14 09:34:16 +0000 @@ -1,3 +1,8 @@ +2013-05-14 Jan Djärv + + * nsfont.m (ns_spec_to_descriptor): Retain and autorelease + fdesc (Bug#14375). + 2013-05-12 Paul Eggert * image.c (gif_load): Check that subimages fit (Bug#14345). === modified file 'src/nsfont.m' --- src/nsfont.m 2013-01-24 05:56:31 +0000 +++ src/nsfont.m 2013-05-14 09:34:16 +0000 @@ -151,10 +151,13 @@ if ([tdict count] > 0) [fdAttrs setObject: tdict forKey: NSFontTraitsAttribute]; - fdesc = [NSFontDescriptor fontDescriptorWithFontAttributes: fdAttrs]; + fdesc = [[[NSFontDescriptor fontDescriptorWithFontAttributes: fdAttrs] + retain] autorelease]; + if (family != nil) { - fdesc = [fdesc fontDescriptorWithFamily: family]; + NSFontDescriptor *fdesc2 = [fdesc fontDescriptorWithFamily: family]; + fdesc = [[fdesc2 retain] autorelease]; } [fdAttrs release]; ------------------------------------------------------------ revno: 112577 fixes bug: http://debbugs.gnu.org/14137 author: Yann Hodique committer: Glenn Morris branch nick: trunk timestamp: Tue 2013-05-14 00:35:21 -0700 message: * lisp/emacs-lisp/tabulated-list.el: Set a version number. * lisp/emacs-lisp/package.el: Explicitly depend on a tabulated-list version. diff: === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2013-05-11 02:27:28 +0000 +++ lisp/emacs-lisp/package.el 2013-05-14 07:35:21 +0000 @@ -6,6 +6,7 @@ ;; Created: 10 Mar 2007 ;; Version: 1.0.1 ;; Keywords: tools +;; Package-Requires: ((tabulated-list "1.0")) ;; This file is part of GNU Emacs. === modified file 'lisp/emacs-lisp/tabulated-list.el' --- lisp/emacs-lisp/tabulated-list.el 2013-04-26 14:47:07 +0000 +++ lisp/emacs-lisp/tabulated-list.el 2013-05-14 07:35:21 +0000 @@ -4,6 +4,7 @@ ;; Author: Chong Yidong ;; Keywords: extensions, lisp +;; Version: 1.0 ;; This file is part of GNU Emacs. ------------------------------------------------------------ revno: 112576 committer: Leo Liu branch nick: trunk timestamp: Tue 2013-05-14 13:19:29 +0800 message: * progmodes/octave.el (octave-font-lock-keywords): Fix error during redisplay. (octave-goto-function-definition, octave-find-definition): Minor tweaks. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-05-14 02:42:17 +0000 +++ lisp/ChangeLog 2013-05-14 05:19:29 +0000 @@ -1,3 +1,9 @@ +2013-05-14 Leo Liu + + * progmodes/octave.el (octave-font-lock-keywords): Fix error + during redisplay. + (octave-goto-function-definition, octave-find-definition): Minor tweaks. + 2013-05-14 Glenn Morris * progmodes/flymake.el (flymake-xml-program): New option. === modified file 'lisp/progmodes/octave.el' --- lisp/progmodes/octave.el 2013-05-13 07:24:22 +0000 +++ lisp/progmodes/octave.el 2013-05-14 05:19:29 +0000 @@ -459,13 +459,14 @@ (let ((beg (match-beginning 0)) (end (match-end 0))) (unless (octave-in-string-or-comment-p) - (unwind-protect + (condition-case nil (progn (goto-char beg) (backward-up-list) (when (memq (char-after) '(?\( ?\[ ?\{)) - (put-text-property beg end 'face nil))) - (goto-char end))))) + (put-text-property beg end 'face nil)) + (goto-char end)) + (error (goto-char end)))))) nil)) ;; Fontify all operators. (cons octave-operator-regexp 'font-lock-builtin-face) @@ -929,9 +930,9 @@ (defun octave-goto-function-definition () "Go to the first function definition." - (when (save-excursion - (goto-char (point-min)) - (re-search-forward octave-function-header-regexp nil t)) + (goto-char (point-min)) + (if (not (re-search-forward octave-function-header-regexp nil t)) + (forward-comment (point-max)) (goto-char (match-beginning 3)) (match-string 3))) @@ -1681,9 +1682,10 @@ (user-error "%s" (or line (format "`%s' not found" fn))) (require 'etags) (ring-insert find-tag-marker-ring (point-marker)) - (find-file (funcall octave-find-definition-filename-function file)) - (or (octave-goto-function-definition) - (forward-comment (point-max)))))) + (setq file (funcall octave-find-definition-filename-function file)) + (when file + (find-file file) + (octave-goto-function-definition))))) (provide 'octave)