Now on revision 111503. ------------------------------------------------------------ revno: 111503 committer: Stefan Monnier branch nick: trunk timestamp: Sat 2013-01-12 20:23:48 -0500 message: * lisp/jit-lock.el (jit-lock-debug-mode): New minor mode. (jit-lock--debug-fontifying): New var. (jit-lock--debug-fontify): New function. * lisp/subr.el (condition-case-unless-debug): Don't prevent catching the error, just let the debbugger run. * lisp/emacs-lisp/timer.el (timer-event-handler): Don't prevent debugging timer code and don't drop errors silently. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-01-10 02:45:31 +0000 +++ etc/NEWS 2013-01-13 01:23:48 +0000 @@ -66,6 +66,8 @@ * Changes in Specialized Modes and Packages in Emacs 24.4 +** jit-lock-debug-mode lets you use the debuggers on code run via jit-lock. + ** completing-read-multiple's separator can now be a regexp. The default separator is changed to allow surrounding spaces around the comma. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-12 19:24:27 +0000 +++ lisp/ChangeLog 2013-01-13 01:23:48 +0000 @@ -1,3 +1,13 @@ +2013-01-13 Stefan Monnier + + * jit-lock.el (jit-lock-debug-mode): New minor mode. + (jit-lock--debug-fontifying): New var. + (jit-lock--debug-fontify): New function. + * subr.el (condition-case-unless-debug): Don't prevent catching the + error, just let the debbugger run. + * emacs-lisp/timer.el (timer-event-handler): Don't prevent debugging + timer code and don't drop errors silently. + 2013-01-12 Michael Albinus * autorevert.el (auto-revert-notify-watch-descriptor): Give it === modified file 'lisp/emacs-lisp/timer.el' --- lisp/emacs-lisp/timer.el 2013-01-01 09:11:05 +0000 +++ lisp/emacs-lisp/timer.el 2013-01-13 01:23:48 +0000 @@ -307,13 +307,13 @@ ;; Run handler. ;; We do this after rescheduling so that the handler function ;; can cancel its own timer successfully with cancel-timer. - (condition-case nil + (condition-case-unless-debug err ;; Timer functions should not change the current buffer. ;; If they do, all kinds of nasty surprises can happen, ;; and it can be hellish to track down their source. (save-current-buffer (apply (timer--function timer) (timer--args timer))) - (error nil)) + (error (message "Error in timer: %S" err))) (if retrigger (setf (timer--triggered timer) nil))) (error "Bogus timer event")))) === modified file 'lisp/jit-lock.el' --- lisp/jit-lock.el 2013-01-01 09:11:05 +0000 +++ lisp/jit-lock.el 2013-01-13 01:23:48 +0000 @@ -257,6 +257,47 @@ (remove-hook 'after-change-functions 'jit-lock-after-change t) (remove-hook 'fontification-functions 'jit-lock-function)))) +(define-minor-mode jit-lock-debug-mode + "Minor mode to help debug code run from jit-lock. +When this minor mode is enabled, jit-lock runs as little code as possible +during redisplay and moves the rest to a timer, where things +like `debug-on-error' and Edebug can be used." + :global t + (when jit-lock-defer-timer + (cancel-timer jit-lock-defer-timer) + (setq jit-lock-defer-timer nil)) + (when jit-lock-debug-mode + (setq jit-lock-defer-timer + (run-with-idle-timer 0 t #'jit-lock--debug-fontify)))) + +(defvar jit-lock--debug-fontifying nil) + +(defun jit-lock--debug-fontify () + "Fontify what was deferred for debugging." + (when (and (not jit-lock--debug-fontifying) + jit-lock-defer-buffers (not memory-full)) + (let ((jit-lock--debug-fontifying t) + (inhibit-debugger nil)) ;FIXME: Not sufficient! + ;; Mark the deferred regions back to `fontified = nil' + (dolist (buffer jit-lock-defer-buffers) + (when (buffer-live-p buffer) + (with-current-buffer buffer + ;; (message "Jit-Debug %s" (buffer-name)) + (with-buffer-prepared-for-jit-lock + (let ((pos (point-min))) + (while + (progn + (when (eq (get-text-property pos 'fontified) 'defer) + (let ((beg pos) + (end (setq pos (next-single-property-change + pos 'fontified + nil (point-max))))) + (put-text-property beg end 'fontified nil) + (jit-lock-fontify-now beg end))) + (setq pos (next-single-property-change + pos 'fontified))))))))) + (setq jit-lock-defer-buffers nil)))) + (defun jit-lock-register (fun &optional contextual) "Register FUN as a fontification function to be called in this buffer. FUN will be called with two arguments START and END indicating the region @@ -504,7 +545,8 @@ pos (setq pos (next-single-property-change pos 'fontified nil (point-max))) 'fontified nil)) - (setq pos (next-single-property-change pos 'fontified))))))))) + (setq pos (next-single-property-change + pos 'fontified))))))))) (setq jit-lock-defer-buffers nil) ;; Force fontification of the visible parts. (let ((jit-lock-defer-timer nil)) === modified file 'lisp/subr.el' --- lisp/subr.el 2013-01-04 03:42:11 +0000 +++ lisp/subr.el 2013-01-13 01:23:48 +0000 @@ -3367,16 +3367,17 @@ (progn ,@body))))))) (defmacro condition-case-unless-debug (var bodyform &rest handlers) - "Like `condition-case' except that it does not catch anything when debugging. -More specifically if `debug-on-error' is set, then it does not catch any signal." + "Like `condition-case' except that it does not prevent debugging. +More specifically if `debug-on-error' is set then the debugger will be invoked +even if this catches the signal." (declare (debug condition-case) (indent 2)) - (let ((bodysym (make-symbol "body"))) - `(let ((,bodysym (lambda () ,bodyform))) - (if debug-on-error - (funcall ,bodysym) - (condition-case ,var - (funcall ,bodysym) - ,@handlers))))) + `(condition-case ,var + ,bodyform + ,@(mapcar (lambda (handler) + `((debug ,@(if (listp (car handler)) (car handler) + (list (car handler)))) + ,@(cdr handler))) + handlers))) (define-obsolete-function-alias 'condition-case-no-debug 'condition-case-unless-debug "24.1") ------------------------------------------------------------ revno: 111502 committer: Glenn Morris branch nick: trunk timestamp: Sat 2013-01-12 16:51:49 -0800 message: Remove <>, since makes contents invisible on http://ftp.gnu.org diff: === modified file 'admin/nt/README-ftp-server' --- admin/nt/README-ftp-server 2013-01-01 09:11:05 +0000 +++ admin/nt/README-ftp-server 2013-01-13 00:51:49 +0000 @@ -288,4 +288,4 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see . +along with GNU Emacs. If not, see http://www.gnu.org/licenses/. ------------------------------------------------------------ revno: 111501 committer: Michael Albinus branch nick: trunk timestamp: Sat 2013-01-12 20:24:27 +0100 message: * autorevert.el (auto-revert-notify-handler): Use `file-equal-p'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-12 13:30:00 +0000 +++ lisp/ChangeLog 2013-01-12 19:24:27 +0000 @@ -2,6 +2,7 @@ * autorevert.el (auto-revert-notify-watch-descriptor): Give it `permanent-local' property. + (auto-revert-notify-handler): Use `file-equal-p'. 2013-01-12 Eli Zaretskii === modified file 'lisp/autorevert.el' --- lisp/autorevert.el 2013-01-12 13:30:00 +0000 +++ lisp/autorevert.el 2013-01-12 19:24:27 +0000 @@ -531,17 +531,14 @@ (when (featurep 'inotify) (cl-assert (memq 'modify action))) (when (featurep 'w32notify) (cl-assert (eq 'modified action))) (cl-assert (bufferp buffer)) - (when (stringp file) - (cl-assert (string-equal - ;; w32notify returns the basename of the file - ;; without its leading directories; inotify - ;; returns its full absolute file name. - (file-name-nondirectory (directory-file-name file)) - (file-name-nondirectory (directory-file-name - (buffer-file-name buffer)))))) - - ;; Mark buffer modified. (with-current-buffer buffer + (when (and (stringp file) (stringp buffer-file-name)) + ;; w32notify returns the basename of the file without its + ;; leading directories; inotify returns its full absolute + ;; file name. + (cl-assert (file-equal-p file buffer-file-name))) + + ;; Mark buffer modified. (setq auto-revert-notify-modified-p t)))))) (defun auto-revert-active-p () ------------------------------------------------------------ revno: 111500 committer: Michael Albinus branch nick: trunk timestamp: Sat 2013-01-12 14:30:00 +0100 message: * autorevert.el (auto-revert-notify-watch-descriptor): Give it `permanent-local' property. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-12 11:25:39 +0000 +++ lisp/ChangeLog 2013-01-12 13:30:00 +0000 @@ -1,3 +1,8 @@ +2013-01-12 Michael Albinus + + * autorevert.el (auto-revert-notify-watch-descriptor): Give it + `permanent-local' property. + 2013-01-12 Eli Zaretskii * autorevert.el (auto-revert-notify-handler): Fix filtering of === modified file 'lisp/autorevert.el' --- lisp/autorevert.el 2013-01-12 11:25:39 +0000 +++ lisp/autorevert.el 2013-01-12 13:30:00 +0000 @@ -311,7 +311,7 @@ (defvar auto-revert-notify-watch-descriptor nil "The file watch descriptor active for the current buffer.") -(make-variable-buffer-local 'auto-revert-notify-watch-descriptor) +(put 'auto-revert-notify-watch-descriptor 'permanent-local t) (defvar auto-revert-notify-modified-p nil "Non-nil when file has been modified on the file system. ------------------------------------------------------------ revno: 111499 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2013-01-12 13:25:39 +0200 message: Fix filtering of file notification events in autorevert.el. lisp/autorevert.el (auto-revert-notify-handler): Fix filtering of file notification by ACTION. For filtering by file name, compare only the non-directory part of the file name. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-01-12 04:17:08 +0000 +++ lisp/ChangeLog 2013-01-12 11:25:39 +0000 @@ -1,3 +1,9 @@ +2013-01-12 Eli Zaretskii + + * autorevert.el (auto-revert-notify-handler): Fix filtering of + file notification by ACTION. For filtering by file name, compare + only the non-directory part of the file name. + 2013-01-12 Stefan Monnier * autorevert.el: Use cl-lib instead of cl. === modified file 'lisp/autorevert.el' --- lisp/autorevert.el 2013-01-12 04:17:08 +0000 +++ lisp/autorevert.el 2013-01-12 11:25:39 +0000 @@ -528,13 +528,17 @@ ;; Check, that event is meant for us. ;; TODO: Filter events which stop watching, like `move' or `removed'. (cl-assert descriptor) - (when (featurep 'inotify) (cl-assert (memq 'modify descriptor))) - (when (featurep 'w32notify) (cl-assert (eq 'modified descriptor))) + (when (featurep 'inotify) (cl-assert (memq 'modify action))) + (when (featurep 'w32notify) (cl-assert (eq 'modified action))) (cl-assert (bufferp buffer)) (when (stringp file) (cl-assert (string-equal - (directory-file-name file) - (directory-file-name (buffer-file-name buffer))))) + ;; w32notify returns the basename of the file + ;; without its leading directories; inotify + ;; returns its full absolute file name. + (file-name-nondirectory (directory-file-name file)) + (file-name-nondirectory (directory-file-name + (buffer-file-name buffer)))))) ;; Mark buffer modified. (with-current-buffer buffer ------------------------------------------------------------ revno: 111498 committer: Glenn Morris branch nick: trunk timestamp: Sat 2013-01-12 06:17:37 -0500 message: Auto-commit of generated files. diff: === modified file 'autogen/config.in' --- autogen/config.in 2013-01-04 19:22:37 +0000 +++ autogen/config.in 2013-01-12 11:17:37 +0000 @@ -160,10 +160,6 @@ /* Mark a secondary stack, like the register stack on the ia64. */ #undef GC_MARK_SECONDARY_STACK -/* Define to GC_USE_GCPROS_AS_BEFORE if conservative garbage collection is not - known to work. */ -#undef GC_MARK_STACK - /* Define if setjmp is known to save all registers relevant for conservative garbage collection in the jmp_buf. */ #undef GC_SETJMP_WORKS === modified file 'autogen/configure' --- autogen/configure 2013-01-03 11:18:24 +0000 +++ autogen/configure 2013-01-12 11:17:37 +0000 @@ -15707,14 +15707,7 @@ - - case $opsys in - aix4-2 | hpux* | unixware) - $as_echo "#define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE" >>confdefs.h - - ;; - gnu-linux | gnu-kfreebsd ) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15739,9 +15732,6 @@ if ac_fn_c_try_cpp "$LINENO"; then : $as_echo "#define GC_SETJMP_WORKS 1" >>confdefs.h -else - $as_echo "#define GC_MARK_STACK GC_USE_GCPROS_AS_BEFORE" >>confdefs.h - fi rm -f conftest.err conftest.$ac_ext ;; ------------------------------------------------------------ revno: 111497 committer: Paul Eggert branch nick: trunk timestamp: Fri 2013-01-11 22:15:12 -0800 message: * indent.c (Fvertical_motion): Remove now-incorrect GCPROs for old_charpos and old_bytepos. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-01-12 01:15:06 +0000 +++ src/ChangeLog 2013-01-12 06:15:12 +0000 @@ -1,3 +1,8 @@ +2013-01-12 Dmitry Antipov + + * indent.c (Fvertical_motion): Remove now-incorrect GCPROs + for old_charpos and old_bytepos. + 2013-01-12 Paul Eggert Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415). === modified file 'src/indent.c' --- src/indent.c 2013-01-02 16:13:04 +0000 +++ src/indent.c 2013-01-12 06:15:12 +0000 @@ -1970,7 +1970,7 @@ struct window *w; Lisp_Object old_buffer; EMACS_INT old_charpos IF_LINT (= 0), old_bytepos IF_LINT (= 0); - struct gcpro gcpro1, gcpro2, gcpro3; + struct gcpro gcpro1; Lisp_Object lcols = Qnil; double cols IF_LINT (= 0); void *itdata = NULL; @@ -1987,7 +1987,7 @@ w = decode_live_window (window); old_buffer = Qnil; - GCPRO3 (old_buffer, old_charpos, old_bytepos); + GCPRO1 (old_buffer); if (XBUFFER (w->buffer) != current_buffer) { /* Set the window's buffer temporarily to the current buffer. */