diff --git a/admin/notes/bugtracker b/admin/notes/bugtracker index 7d5e85a3ae0..eed67f10dfd 100644 --- a/admin/notes/bugtracker +++ b/admin/notes/bugtracker @@ -618,6 +618,16 @@ mv /var/lib/mailman/spam/not-really-spam.msg /var/lib/mailman/not-spam/ Also check that the sender was not added to the auto-discard/reject list in the debbugs-submit Mailman interface. +If you don't have the actual mail, just the mailman moderation mail +version of it, you need to extract the original mail, and add the +following headers: + +1) The leading envelope From line. +2) Message-ID (get it from /var/log/mailman/vette). +3) X-Debbugs-Envelope-To: submit + +Then pipe it to receive as above. + ** Administrivia The debbugs-submit list should have the administrivia option off, diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 7e24de94fbe..dc0fa4c639d 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -2738,17 +2738,6 @@ This function converts the string or vector @var{key} to a list of individual events, which you can put in @code{unread-command-events}. @end defun -@ignore -@defvar unread-command-char -This variable holds a character to be read as command input. -A value of -1 means ``empty''. - -This variable is mostly obsolete now that you can use -@code{unread-command-events} instead; it exists only to support programs -written for Emacs versions 18 and earlier. -@end defvar -@end ignore - @defun input-pending-p @cindex waiting for command key input This function determines whether any command input is currently diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 20c74cf70b2..408e4665955 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,15 @@ +2012-09-12 Michael Albinus + + Sync with Tramp 2.2.6. + + * tramp.texi (Bug Reports): Cleanup caches before a test run. + + * trampver.texi: Update release number. + +2012-09-12 Paul Eggert + + * texinfo.tex: Merge from gnulib. + 2012-08-06 Aurélien Aptel * url.texi (Parsed URLs): Adjust to the code's use of defstruct diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index dc4bf6400c4..9a2439c815d 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2012-07-29.17} +\def\texinfoversion{2012-09-05.06} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -594,7 +594,7 @@ \def\:{\spacefactor=1000 } % @* forces a line break. -\def\*{\hfil\break\hbox{}\ignorespaces} +\def\*{\unskip\hfil\break\hbox{}\ignorespaces} % @/ allows a line break. \let\/=\allowbreak @@ -3269,6 +3269,20 @@ end \finishedtitlepagetrue } +% Settings used for typesetting titles: no hyphenation, no indentation, +% don't worry much about spacing, ragged right. This should be used +% inside a \vbox, and fonts need to be set appropriately first. Because +% it is always used for titles, nothing else, we call \rmisbold. \par +% should be specified before the end of the \vbox, since a vbox is a group. +% +\def\raggedtitlesettings{% + \rmisbold + \hyphenpenalty=10000 + \parindent=0pt + \tolerance=5000 + \ptexraggedright +} + % Macros to be used within @titlepage: \let\subtitlerm=\tenrm @@ -3276,7 +3290,7 @@ end \parseargdef\title{% \checkenv\titlepage - \leftline{\titlefonts\rmisbold #1} + \vbox{\titlefonts \raggedtitlesettings #1\par}% % print a rule at the page bottom also. \finishedtitlepagefalse \vskip4pt \hrule height 4pt width \hsize \vskip4pt @@ -5579,14 +5593,6 @@ end % Define @majorheading, @heading and @subheading -% NOTE on use of \vbox for chapter headings, section headings, and such: -% 1) We use \vbox rather than the earlier \line to permit -% overlong headings to fold. -% 2) \hyphenpenalty is set to 10000 because hyphenation in a -% heading is obnoxious; this forbids it. -% 3) Likewise, headings look best if no \parindent is used, and -% if justification is not attempted. Hence \raggedright. - \def\majorheading{% {\advance\chapheadingskip by 10pt \chapbreak }% \parsearg\chapheadingzzz @@ -5594,10 +5600,8 @@ end \def\chapheading{\chapbreak \parsearg\chapheadingzzz} \def\chapheadingzzz#1{% - {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\ptexraggedright - \rmisbold #1\hfill}}% - \bigskip \par\penalty 200\relax + \vbox{\chapfonts \raggedtitlesettings #1\par}% + \nobreak\bigskip \nobreak \suppressfirstparagraphindent } @@ -5756,8 +5760,7 @@ end % % Typeset the actual heading. \nobreak % Avoid page breaks at the interline glue. - \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright - \hangindent=\wd0 \centerparametersmaybe + \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title @@ -5779,18 +5782,18 @@ end \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} % \def\unnchfopen #1{% -\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\ptexraggedright - \rmisbold #1\hfill}}\bigskip \par\nobreak + \chapoddpage + \vbox{\chapfonts \raggedtitlesettings #1\par}% + \nobreak\bigskip\nobreak } \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } \def\centerchfopen #1{% -\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt - \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak + \chapoddpage + \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}% + \nobreak\bigskip \nobreak } \def\CHAPFopen{% \global\let\chapmacro=\chfopen diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 87ad2bc5009..530b8fdd6c2 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -2853,6 +2853,9 @@ If you can identify a minimal test case that reproduces the problem, include that with your bug report. This will make it much easier for the development team to analyze and correct the problem. +Sometimes, there might be also problems due to Tramp caches. Flush +all caches before running the test, @ref{Cleanup remote connections}. + Before reporting the bug, you should set the verbosity level to 6 (@pxref{Traces and Profiles, Traces}) in the @file{~/.emacs} file and repeat the bug. Then, include the contents of the @file{*tramp/foo*} diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi index 78bd9d0965f..d902ac0fb97 100644 --- a/doc/misc/trampver.texi +++ b/doc/misc/trampver.texi @@ -8,7 +8,7 @@ @c In the Tramp CVS, the version number is auto-frobbed from @c configure.ac, so you should edit that file and run @c "autoconf && ./configure" to change the version number. -@set trampver 2.2.6-pre +@set trampver 2.2.6 @c Other flags from configuration @set instprefix /usr/local diff --git a/etc/NEWS b/etc/NEWS index af4bcf11dbb..a7388c4e9fa 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -638,7 +638,7 @@ are deprecated and will be removed eventually. *** `facemenu-unlisted-faces' *** `rmail-decode-mime-charset' -*** `last-input-char' and `last-command-char' +*** `last-input-char', `last-command-char', `unread-command-char'. * Lisp changes in Emacs 24.3 @@ -675,7 +675,15 @@ The interpretation of the DECLS is determined by `defun-declarations-alist'. ** New error type and new function `user-error'. Doesn't trigger the debugger. -** New option `debugger-bury-or-kill'. +** Debugger +*** New option `debugger-bury-or-kill'. + +*** Set `debug-on-message' to enter the debugger when a certain +message is displayed in the echo area. This can be useful when trying +to work out which code is doing something. + +*** New var `inhibit-debugger', automatically set to prevent accidental +recursive invocations. +++ ** New utility function `buffer-narrowed-p'. @@ -1977,10 +1985,6 @@ instead of jumping all the way to the top-level. *** Set `debug-on-event' to enter the debugger on events like SIGUSR1. This can be useful when `inhibit-quit' is set. -*** Set `debug-on-message' to enter the debugger when a certain -message is displayed in the echo area. This can be useful when trying -to work out which code is doing something. - ** The new function `server-eval-at' allows evaluation of Lisp forms on named Emacs server instances. diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 35190fd2a8f..f5846657707 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,8 @@ +2012-09-11 Paul Eggert + + * pop.c (socket_connection) [HAVE_GETADDRINFO]: + Prefer assignment to memcpy when either will do. + 2012-08-31 Andreas Schwab * etags.c (consider_token): Always zero-terminate token buffer. diff --git a/lib-src/pop.c b/lib-src/pop.c index 74054e0e1b1..bfbcb8c9466 100644 --- a/lib-src/pop.c +++ b/lib-src/pop.c @@ -1083,7 +1083,7 @@ socket_connection (char *host, int flags) if (it->ai_addrlen == sizeof (addr)) { struct sockaddr_in *in_a = (struct sockaddr_in *) it->ai_addr; - memcpy (&addr.sin_addr, &in_a->sin_addr, sizeof (addr.sin_addr)); + addr.sin_addr = in_a->sin_addr; if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr))) break; } diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8de59875674..549b70a1de1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,75 @@ +2012-09-12 Stefan Monnier + + * emacs-lisp/debug.el (debugger-outer-unread-command-char, debug) + (debugger-env-macro): Remove support for unread-command-char. + + * subr.el (set-temporary-overlay-map): Minimize slightly the impact of + the temporary map re-appearing on emulation-mode-map-alists. + + * emacs-lisp/edebug.el (def-edebug-form-spec): Remove, it's been broken + since 22.1. + + * ehelp.el (with-electric-help): Accept functions in + electric-help-form-to-execute. + (electric-help-execute-extended, electric-help-ctrl-x-prefix): Use it. + And replace unread-command-char -> unread-command-events. + +2012-09-12 Michael Albinus + + Sync with Tramp 2.2.6. + + * net/tramp.el (tramp-accept-process-output): Don't use + JUST-THIS-ONE in the XEmacs case. + + * net/trampver.el: Update release number. + +2012-09-12 Martin Rudalics + + * emacs-lisp/debug.el (debugger-previous-window-height): + New variable. + (debug): When debugger-jumping-flag is non-nil try to restore + height of debugger window. (Bug#8789) + +2012-09-12 Stefan Monnier + + * emacs-lisp/edebug.el (edebug-enter): Don't mess with + overriding-local-map and pre/post-command-hook here. + (edebug-recursive-edit): Do it here instead (bug#12345). + (edebug-outside-unread-command-char): Remove all uses of + unread-command-char. + + * emacs-lisp/debug.el (debug): Don't bind debug-on-error since + inhibit-debugger is bound instead. + +2012-09-11 Bastien Guerry + + * subr.el (set-temporary-overlay-map): Add a docstring. + (bug#12346) + +2012-09-11 Bastien Guerry + + * minibuffer.el (completion-table-subvert): Fix docstring. + (bug#12347) + +2012-09-11 Bastien Guerry + + * help-fns.el (describe-variable): Fix typo. (bug#12346) + +2012-09-10 Michael R. Mauger + + * progmodes/sql.el: Version 3.1 + (sql-db2-escape-newlines): New variable. + (sql-escape-newlines-filter): Use it. + +2012-09-10 Juanma Barranquero + + * custom.el (custom-theme-load-confirm): Remove unneeded assignment. + +2012-09-10 Dan Nicolaescu + + * vc/diff-mode.el (diff-mode-menu): + Bind diff-remove-trailing-whitespace. + 2012-09-10 Stefan Monnier * emacs-lisp/lisp-mode.el (emacs-list-byte-code-comment-re): New var. diff --git a/lisp/ehelp.el b/lisp/ehelp.el index abb897f73f6..281148d9cf6 100644 --- a/lisp/ehelp.el +++ b/lisp/ehelp.el @@ -193,7 +193,9 @@ BUFFER is put back into its original major mode." (replace-buffer-in-windows buffer) ;; must do this outside of save-window-excursion (bury-buffer buffer)) - (eval electric-help-form-to-execute)))) + (if (functionp electric-help-form-to-execute) + (funcall electric-help-form-to-execute) + (eval electric-help-form-to-execute))))) (defun electric-help-command-loop () (catch 'exit @@ -349,14 +351,19 @@ will select it.)" ;; continues with execute-extended-command. (defun electric-help-execute-extended (_prefixarg) (interactive "p") - (setq electric-help-form-to-execute '(execute-extended-command nil)) + (setq electric-help-form-to-execute + (lambda () (execute-extended-command nil))) (electric-help-retain)) ;; This is to be buond to C-x in ehelp mode. Retains ehelp buffer and then ;; continues with ctrl-x prefix. (defun electric-help-ctrl-x-prefix (_prefixarg) (interactive "p") - (setq electric-help-form-to-execute '(progn (message nil) (setq unread-command-char ?\C-x))) + (setq electric-help-form-to-execute + (lambda () + (message nil) + (setq unread-command-events + (append unread-command-events '(?\C-x))))) (electric-help-retain)) diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 188c0800eb8..774b4d3d600 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -96,6 +96,9 @@ The value used here is passed to `quit-restore-window'." (defvar debugger-previous-window nil "This is the window last showing the debugger buffer.") +(defvar debugger-previous-window-height nil + "The last recorded height of `debugger-previous-window'.") + (defvar debugger-previous-backtrace nil "The contents of the previous backtrace (including text properties). This is to optimize `debugger-make-xrefs'.") @@ -107,10 +110,6 @@ This is to optimize `debugger-make-xrefs'.") (defvar debugger-outer-track-mouse) (defvar debugger-outer-last-command) (defvar debugger-outer-this-command) -;; unread-command-char is obsolete, -;; but we still save and restore it -;; in case some user program still tries to set it. -(defvar debugger-outer-unread-command-char) (defvar debugger-outer-unread-command-events) (defvar debugger-outer-unread-post-input-method-events) (defvar debugger-outer-last-input-event) @@ -162,8 +161,6 @@ first will be printed into the backtrace buffer." (unless noninteractive (message "Entering debugger...")) (let (debugger-value - (debug-on-error nil) - (debug-on-quit nil) (debugger-previous-state (if (get-buffer "*Backtrace*") (with-current-buffer (get-buffer "*Backtrace*") @@ -184,8 +181,6 @@ first will be printed into the backtrace buffer." (debugger-outer-track-mouse track-mouse) (debugger-outer-last-command last-command) (debugger-outer-this-command this-command) - (debugger-outer-unread-command-char - (with-no-warnings unread-command-char)) (debugger-outer-unread-command-events unread-command-events) (debugger-outer-unread-post-input-method-events unread-post-input-method-events) @@ -220,8 +215,6 @@ first will be printed into the backtrace buffer." (cursor-in-echo-area nil)) (unwind-protect (save-excursion - (with-no-warnings - (setq unread-command-char -1)) (when (eq (car debugger-args) 'debug) ;; Skip the frames for backtrace-debug, byte-code, ;; and implement-debug-on-entry. @@ -236,7 +229,17 @@ first will be printed into the backtrace buffer." . (,(when debugger-previous-window `(previous-window . ,debugger-previous-window))))) (setq debugger-window (selected-window)) - (setq debugger-previous-window debugger-window) + (if (eq debugger-previous-window debugger-window) + (when debugger-jumping-flag + ;; Try to restore previous height of debugger + ;; window. + (condition-case nil + (window-resize + debugger-window + (- debugger-previous-window-height + (window-total-size debugger-window))) + (error nil))) + (setq debugger-previous-window debugger-window)) (debugger-mode) (debugger-setup-buffer debugger-args) (when noninteractive @@ -264,6 +267,9 @@ first will be printed into the backtrace buffer." (recursive-edit)))) (when (and (window-live-p debugger-window) (eq (window-buffer debugger-window) debugger-buffer)) + ;; Record height of debugger window. + (setq debugger-previous-window-height + (window-total-size debugger-window)) ;; Unshow debugger-buffer. (quit-restore-window debugger-window debugger-bury-or-kill)) ;; Restore previous state of debugger-buffer in case we were @@ -288,8 +294,6 @@ first will be printed into the backtrace buffer." (setq track-mouse debugger-outer-track-mouse) (setq last-command debugger-outer-last-command) (setq this-command debugger-outer-this-command) - (with-no-warnings - (setq unread-command-char debugger-outer-unread-command-char)) (setq unread-command-events debugger-outer-unread-command-events) (setq unread-post-input-method-events debugger-outer-unread-post-input-method-events) @@ -591,16 +595,7 @@ Applies to the frame whose line point is on in the backtrace." (cursor-in-echo-area debugger-outer-cursor-in-echo-area)) (set-match-data debugger-outer-match-data) (prog1 - (let ((save-ucc (with-no-warnings unread-command-char))) - (unwind-protect - (progn - (with-no-warnings - (setq unread-command-char debugger-outer-unread-command-char)) - (prog1 (progn ,@body) - (with-no-warnings - (setq debugger-outer-unread-command-char unread-command-char)))) - (with-no-warnings - (setq unread-command-char save-ucc)))) + (progn ,@body) (setq debugger-outer-match-data (match-data)) (setq debugger-outer-load-read-function load-read-function) (setq debugger-outer-overriding-terminal-local-map diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 7fcd339d6d2..f147fba167d 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -235,11 +235,6 @@ If the result is non-nil, then break. Errors are ignored." ;;; Form spec utilities. -(defmacro def-edebug-form-spec (symbol spec-form) - "For compatibility with old version." - (def-edebug-spec symbol (eval spec-form))) -(make-obsolete 'def-edebug-form-spec 'def-edebug-spec "22.1") - (defun get-edebug-spec (symbol) ;; Get the spec of symbol resolving all indirection. (let ((edebug-form-spec nil) @@ -2248,47 +2243,14 @@ error is signaled again. (debug-on-quit edebug-on-quit) ;; Lexical bindings must be uncompiled for this to work. - (cl-lexical-debug t) - - (edebug-outside-overriding-local-map overriding-local-map) - (edebug-outside-overriding-terminal-local-map - overriding-terminal-local-map) - - ;; Save the outside value of executing macro. (here??) - (edebug-outside-executing-macro executing-kbd-macro) - (edebug-outside-pre-command-hook - (edebug-var-status 'pre-command-hook)) - (edebug-outside-post-command-hook - (edebug-var-status 'post-command-hook))) + (cl-lexical-debug t)) (unwind-protect - (let (;; Don't keep reading from an executing kbd macro - ;; within edebug unless edebug-continue-kbd-macro is - ;; non-nil. Again, local binding may not be best. - (executing-kbd-macro - (if edebug-continue-kbd-macro executing-kbd-macro)) - - ;; Don't get confused by the user's keymap changes. - (overriding-local-map nil) - (overriding-terminal-local-map nil) - - (signal-hook-function 'edebug-signal) - - ;; Disable command hooks. This is essential when - ;; a hook function is instrumented - to avoid infinite loop. - ;; This may be more than we need, however. - (pre-command-hook nil) - (post-command-hook nil)) + (let ((signal-hook-function 'edebug-signal)) (setq edebug-execution-mode (or edebug-next-execution-mode edebug-initial-mode edebug-execution-mode) edebug-next-execution-mode nil) - (edebug-enter edebug-function edebug-args edebug-body)) - ;; Reset global variables in case outside value was changed. - (setq executing-kbd-macro edebug-outside-executing-macro) - (edebug-restore-status - 'post-command-hook edebug-outside-post-command-hook) - (edebug-restore-status - 'pre-command-hook edebug-outside-pre-command-hook))) + (edebug-enter edebug-function edebug-args edebug-body)))) (let* ((edebug-data (get edebug-function 'edebug)) (edebug-def-mark (car edebug-data)) ; mark at def start @@ -2804,7 +2766,6 @@ MSG is printed after `::::} '." ;; in versions where the variable is *not* built-in. ;; Emacs 18 FIXME -(defvar edebug-outside-unread-command-char) ;; Emacs 19. (defvar edebug-outside-last-command-event) @@ -2814,15 +2775,6 @@ MSG is printed after `::::} '." (defvar edebug-outside-last-nonmenu-event) (defvar edebug-outside-track-mouse) -;; Disable byte compiler warnings about unread-command-char and -event -;; (maybe works with byte-compile-version 2.22 at least) -(defvar edebug-unread-command-char-warning) -(defvar edebug-unread-command-event-warning) -(eval-when-compile ; FIXME - (setq edebug-unread-command-char-warning - (get 'unread-command-char 'byte-obsolete-variable)) - (put 'unread-command-char 'byte-obsolete-variable nil)) - (defun edebug-recursive-edit () ;; Start up a recursive edit inside of edebug. ;; The current buffer is the edebug-buffer, which is put into edebug-mode. @@ -2844,14 +2796,24 @@ MSG is printed after `::::} '." (edebug-outside-map (current-local-map)) - (edebug-outside-standard-output standard-output) + (edebug-outside-overriding-local-map overriding-local-map) + (edebug-outside-overriding-terminal-local-map + overriding-terminal-local-map) + + ;; Save the outside value of executing macro. (here??) + (edebug-outside-executing-macro executing-kbd-macro) + (edebug-outside-pre-command-hook + (edebug-var-status 'pre-command-hook)) + (edebug-outside-post-command-hook + (edebug-var-status 'post-command-hook)) + + (edebug-outside-standard-output standard-output) (edebug-outside-standard-input standard-input) (edebug-outside-defining-kbd-macro defining-kbd-macro) (edebug-outside-last-command last-command) (edebug-outside-this-command this-command) - (edebug-outside-unread-command-char unread-command-char) ; FIXME (edebug-outside-current-prefix-arg current-prefix-arg) (edebug-outside-last-input-event last-input-event) @@ -2867,9 +2829,6 @@ MSG is printed after `::::} '." ;; We could set these to the values for previous edebug call. (last-command last-command) (this-command this-command) - - ;; Assume no edebug command sets unread-command-char. - (unread-command-char -1) (current-prefix-arg nil) ;; More for Emacs 19 @@ -2879,7 +2838,17 @@ MSG is printed after `::::} '." (last-nonmenu-event nil) (track-mouse nil) - ;; Bind again to outside values. + ;; Don't keep reading from an executing kbd macro + ;; within edebug unless edebug-continue-kbd-macro is + ;; non-nil. Again, local binding may not be best. + (executing-kbd-macro + (if edebug-continue-kbd-macro executing-kbd-macro)) + + ;; Don't get confused by the user's keymap changes. + (overriding-local-map nil) + (overriding-terminal-local-map nil) + + ;; Bind again to outside values. (debug-on-error edebug-outside-debug-on-error) (debug-on-quit edebug-outside-debug-on-quit) @@ -2887,6 +2856,12 @@ MSG is printed after `::::} '." (defining-kbd-macro (if edebug-continue-kbd-macro defining-kbd-macro)) + ;; Disable command hooks. This is essential when + ;; a hook function is instrumented - to avoid infinite loop. + ;; This may be more than we need, however. + (pre-command-hook nil) + (post-command-hook nil) + ;; others?? ) @@ -2933,7 +2908,6 @@ MSG is printed after `::::} '." last-command-event edebug-outside-last-command-event last-command edebug-outside-last-command this-command edebug-outside-this-command - unread-command-char edebug-outside-unread-command-char current-prefix-arg edebug-outside-current-prefix-arg last-input-event edebug-outside-last-input-event last-event-frame edebug-outside-last-event-frame @@ -2942,9 +2916,13 @@ MSG is printed after `::::} '." standard-output edebug-outside-standard-output standard-input edebug-outside-standard-input - defining-kbd-macro edebug-outside-defining-kbd-macro - )) - )) + defining-kbd-macro edebug-outside-defining-kbd-macro) + + (setq executing-kbd-macro edebug-outside-executing-macro) + (edebug-restore-status + 'post-command-hook edebug-outside-post-command-hook) + (edebug-restore-status + 'pre-command-hook edebug-outside-pre-command-hook)))) ;;; Display related functions @@ -3562,7 +3540,6 @@ Return the result of the last expression." (last-command-event edebug-outside-last-command-event) (last-command edebug-outside-last-command) (this-command edebug-outside-this-command) - (unread-command-char edebug-outside-unread-command-char) (unread-command-events edebug-outside-unread-command-events) (current-prefix-arg edebug-outside-current-prefix-arg) (last-input-event edebug-outside-last-input-event) @@ -3602,7 +3579,6 @@ Return the result of the last expression." edebug-outside-last-command-event last-command-event edebug-outside-last-command last-command edebug-outside-this-command this-command - edebug-outside-unread-command-char unread-command-char edebug-outside-unread-command-events unread-command-events edebug-outside-current-prefix-arg current-prefix-arg edebug-outside-last-input-event last-input-event @@ -4240,7 +4216,7 @@ It is removed when you hit any char." (let ((buffer-read-only nil)) (undo-boundary) (edebug-display-freq-count) - (setq unread-command-char (read-char)) + (setq unread-command-events (append unread-command-events (read-event))) ;; Yuck! This doesn't seem to work at all for me. (undo))) @@ -4357,13 +4333,6 @@ With prefix argument, make it a temporary breakpoint." ;; Extension for bytecomp to resolve undefined function references. ;; Requires new byte compiler. -;; Reenable byte compiler warnings about unread-command-char and -event. -;; Disabled before edebug-recursive-edit. -(eval-when-compile - (if edebug-unread-command-char-warning - (put 'unread-command-char 'byte-obsolete-variable - edebug-unread-command-char-warning))) - (eval-when-compile ;; The body of eval-when-compile seems to get evaluated with eval-defun. ;; We only want to evaluate when actually byte compiling. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 669ea58656d..27c53744d54 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -213,8 +213,8 @@ case sensitive instead." (defun completion-table-subvert (table s1 s2) "Return a completion table from TABLE with S1 replaced by S2. The result is a completion table which completes strings of the -form (concat S2 S) in the same way as TABLE completes strings of -the form (concat S1 S)." +form (concat S1 S) in the same way as TABLE completes strings of +the form (concat S2 S)." (lambda (string pred action) (let* ((str (if (eq t (compare-strings string 0 (length s1) s1 nil nil completion-ignore-case)) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index a17bbfa0d14..019ab1eef0f 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3293,7 +3293,9 @@ for process communication also." ;; Under Windows XP, accept-process-output doesn't return ;; sometimes. So we add an additional timeout. (with-timeout ((or timeout 1)) - (accept-process-output proc timeout timeout-msecs (and proc t)))) + (if (featurep 'xemacs) + (accept-process-output proc timeout timeout-msecs) + (accept-process-output proc timeout timeout-msecs (and proc t))))) (tramp-message proc 10 "\n%s" (buffer-string)))) (defun tramp-check-for-regexp (proc regexp) diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 499af730788..2d0a8e3d23d 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -31,7 +31,7 @@ ;; should be changed only there. ;;;###tramp-autoload -(defconst tramp-version "2.2.6-pre" +(defconst tramp-version "2.2.6" "This version of Tramp.") ;;;###tramp-autoload @@ -44,7 +44,7 @@ (= emacs-major-version 21) (>= emacs-minor-version 4))) "ok" - (format "Tramp 2.2.6-pre is not fit for %s" + (format "Tramp 2.2.6 is not fit for %s" (when (string-match "^.*$" (emacs-version)) (match-string 0 (emacs-version))))))) (unless (string-match "\\`ok\\'" x) (error "%s" x))) diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el index 1d29011762e..8ac54d6524e 100644 --- a/lisp/progmodes/ebrowse.el +++ b/lisp/progmodes/ebrowse.el @@ -4210,7 +4210,7 @@ NUMBER-OF-STATIC-VARIABLES:" ;; this will select the buffer from which the buffer menu was ;; invoked. But this buffer is not displayed in the buffer list if ;; it isn't a tree buffer. I therefore let the buffer menu command -;; loop read the command `p' via `unread-command-char'. This command +;; loop read the command `p' via `unread-command-events'. This command ;; has no effect since we are on the first line of the buffer. (defvar electric-buffer-menu-mode-hook nil) diff --git a/lisp/subr.el b/lisp/subr.el index be785ff8fba..aa1b10ce17d 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1250,11 +1250,6 @@ is converted into a string by expressing it in decimal." 'mode-line-inverse-video "use the appropriate faces instead." "21.1") -(make-obsolete-variable - 'unread-command-char - "use `unread-command-events' instead. That variable is a list of events -to reread, so it now uses nil to mean `no event', instead of -1." - "before 19.15") ;; Lisp manual only updated in 22.1. (define-obsolete-variable-alias 'executing-macro 'executing-kbd-macro @@ -3911,6 +3906,11 @@ The properties used on SYMBOL are `composefunc', `sendfunc', (put symbol 'hookvar (or hookvar 'mail-send-hook))) (defun set-temporary-overlay-map (map &optional keep-pred) + "Set MAP as a temporary overlay map. +When KEEP-PRED is `t', using a key from the temporary keymap +leaves this keymap activated. KEEP-PRED can also be a function, +which will have the same effect when it returns `t'. +When KEEP-PRED is nil, the temporary keymap is used only once." (let* ((clearfunsym (make-symbol "clear-temporary-overlay-map")) (overlaysym (make-symbol "t")) (alist (list (cons overlaysym map))) @@ -3923,6 +3923,7 @@ The properties used on SYMBOL are `composefunc', `sendfunc', (lookup-key ',map (this-command-keys-vector)))) (t `(funcall ',keep-pred))) + (set ',overlaysym nil) ;Just in case. (remove-hook 'pre-command-hook ',clearfunsym) (setq emulation-mode-map-alists (delq ',alist emulation-mode-map-alists)))))) diff --git a/src/ChangeLog b/src/ChangeLog index 548c80b3b85..8b47c52c23f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,125 @@ +2012-09-12 Stefan Monnier + + * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p) + (Fdiscard_input, quit_throw_to_read_char, init_keyboard) + (syms_of_keyboard): Remove support for unread-command-char. + +2012-09-12 Eli Zaretskii + + * w32proc.c (sys_kill): If PID is our process ID and the signal is + SIGABRT, call emacs_abort. Avoids silently exiting upon assertion + violation. (Bug#12426) + +2012-09-12 Paul Eggert + + * image.c (jpeg_memory_src): Don't assume string len fits in unsigned. + +2012-09-12 Stefan Monnier + + * eval.c: Add `inhibit-debugger'. + (Qinhibit_debugger): New symbol. + (call_debugger): Bind it instead of Qdebug_on_error. + (maybe_call_debugger): Test Vinhibit_debugger. + (syms_of_eval): Define inhibit-debugger. + * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message. + (syms_of_xdisp): Remove inhibit-debug-on-message. + +2012-09-11 Paul Eggert + + Avoid _setjmp/_longjmp problems with local nonvolatile variables. + If a nonvolatile local variable is written before a _longjmp to + the frame containing the variable, and is read after the _longjmp, + the value read is indeterminate. Some local variables of type + 'struct handler' and 'struct catchtag' are used in this way, so + mark each of their slots as volatile if the slot can be set before + _longjmp and read afterwards. + * lisp.h (struct handler): var and chosen_clause are now volatile. + (struct catchtag): val, next, and pdlcount are now volatile. + + * bidi.c (bidi_push_it, bidi_pop_it): + * fns.c (copy_hash_table): + * image.c (define_image_type): + * keyboard.c (kbd_buffer_store_event_hold): + * process.c (Fprocess_send_eof): + * xfaces.c (x_create_gc) [HAVE_NS]: + * xgselect.c (xg_select): + Prefer assignment to memcpy when either will do. + + * alloc.c (discard_killed_buffers): Tune and simplify a bit. + Use pointer-to-a-pointer to simplify and avoid a NILP check each + time an item is removed. No need to mark this function 'inline'; + the compiler knows better than we do. + +2012-09-11 Jan Djärv + + * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize. + (updateFrameSize:): Add delay parameter to updateFrameSize, send it + to change_frame_size (Bug#12388). + (windowDidResize:): Pass YES to updateFrameSize. + + * nsterm.h: Add delay parameter to updateFrameSize. + +2012-09-11 Dmitry Antipov + + Discard killed buffers from deleted window and frame objects. + This reduces an amount of references to killed buffers and + helps GC to reclaim them faster. + * alloc.c (discard_killed_buffers): New function. + (mark_object): Use it for deleted windows and frames. + (mark_object): If symbol's value is set up for a killed buffer + or deleted frame, restore it's global binding. + * data.c (swap_in_global_binding): Add GC notice. + (swap_in_symval_forwarding): Use convenient set_blv_where. + * window.c (wset_next_buffers, wset_prev_buffers): Move ... + * window.h: ... to here. + +2012-09-11 Dmitry Antipov + + Convenient macro to check whether the buffer is live. + * buffer.h (BUFFER_LIVE_P): New macro. + * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c: + * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it. + +2012-09-11 YAMAMOTO Mitsuharu + + * xdisp.c (right_overwritten, right_overwriting): Also handle gstring + composition cases (Bug#12364). + + * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left + overhang of succeeding glyphs overlapping box cursor. + + * w32term.c (x_draw_glyph_string): Likewise. + +2012-09-11 Paul Eggert + + Simplify, document, and port floating-point (Bug#12381). + The porting part of this patch fixes bugs on non-IEEE platforms + with frexp, ldexp, logb. + * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error): + Now static. + * floatfns.c: Simplify discussion of functions that Emacs doesn't + support, by removing commented-out code and briefly listing the + C89 functions excluded. The commented-out stuff was confusing + maintenance, e.g., we thought we needed cbrt but it was commented out. + (logb): Remove decl; no longer needed. + (isfinite): New macro, if not already supplied. + (isnan): Don't replace any existing macro. + (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp + are present on all C89 platforms. + (Ffrexp): Do not special-case zero, as frexp does the right thing + for that case. + (Flogb): Do not use logb, as it doesn't have the desired meaning + on hosts that use non-base-2 floating point. Instead, stick with + frexp, which is C89 anyway. Do not pass an infinity or a NaN to + frexp, to avoid getting an unspecified result. + + * xdisp.c (Qinhibit_debug_on_message): Now static. + +2012-09-10 Jan Djärv + + * nsterm.m (ns_update_begin): Set clip path to whole view by using + NSBezierPath (Bug#12131). + 2012-09-10 Chong Yidong * fns.c (Fdelq, Fdelete): Doc fix. diff --git a/src/alloc.c b/src/alloc.c index 7bbc0abcd9a..61cb7086c25 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -5865,6 +5865,28 @@ mark_buffer (struct buffer *buffer) mark_buffer (buffer->base_buffer); } +/* Remove killed buffers or items whose car is a killed buffer + from LIST and return changed LIST. Called during GC. */ + +static Lisp_Object +discard_killed_buffers (Lisp_Object list) +{ + Lisp_Object *prev = &list; + Lisp_Object tail; + + for (tail = list; CONSP (tail); tail = XCDR (tail)) + { + Lisp_Object tem = XCAR (tail); + if (CONSP (tem)) + tem = XCAR (tem); + if (BUFFERP (tem) && !BUFFER_LIVE_P (XBUFFER (tem))) + *prev = XCDR (tail); + else + prev = &XCDR_AS_LVALUE (tail); + } + return list; +} + /* Determine type of generic Lisp_Object and mark it accordingly. */ void @@ -6001,20 +6023,41 @@ mark_object (Lisp_Object arg) break; case PVEC_FRAME: - mark_vectorlike (ptr); - mark_face_cache (((struct frame *) ptr)->face_cache); + { + struct frame *f = (struct frame *) ptr; + + /* For live frames, killed buffers are filtered out by + store_frame_param. For dead frames, we do it here in + attempt to help GC to reclaim killed buffers faster. */ + if (!FRAME_LIVE_P (f)) + fset_buffer_list (f, discard_killed_buffers (f->buffer_list)); + + mark_vectorlike (ptr); + mark_face_cache (f->face_cache); + } break; case PVEC_WINDOW: { struct window *w = (struct window *) ptr; + bool leaf = NILP (w->hchild) && NILP (w->vchild); + + /* For live windows, Lisp code filters out killed buffers + from both buffer lists. For dead windows, we do it here + in attempt to help GC to reclaim killed buffers faster. */ + if (leaf && NILP (w->buffer)) + { + wset_prev_buffers + (w, discard_killed_buffers (w->prev_buffers)); + wset_next_buffers + (w, discard_killed_buffers (w->next_buffers)); + } mark_vectorlike (ptr); /* Mark glyphs for leaf windows. Marking window matrices is sufficient because frame matrices use the same glyph memory. */ - if (NILP (w->hchild) && NILP (w->vchild) - && w->current_matrix) + if (leaf && w->current_matrix) { mark_glyph_matrix (w->current_matrix); mark_glyph_matrix (w->desired_matrix); @@ -6081,10 +6124,14 @@ mark_object (Lisp_Object arg) case SYMBOL_LOCALIZED: { struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (ptr); - /* If the value is forwarded to a buffer or keyboard field, - these are marked when we see the corresponding object. - And if it's forwarded to a C variable, either it's not - a Lisp_Object var, or it's staticpro'd already. */ + Lisp_Object where = blv->where; + /* If the value is set up for a killed buffer or deleted + frame, restore it's global binding. If the value is + forwarded to a C variable, either it's not a Lisp_Object + var, or it's staticpro'd already. */ + if ((BUFFERP (where) && !BUFFER_LIVE_P (XBUFFER (where))) + || (FRAMEP (where) && !FRAME_LIVE_P (XFRAME (where)))) + swap_in_global_binding (ptr); mark_object (blv->where); mark_object (blv->valcell); mark_object (blv->defcell); diff --git a/src/bidi.c b/src/bidi.c index 73fec3533a4..4186a46e19e 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -612,7 +612,7 @@ bidi_push_it (struct bidi_it *bidi_it) /* Save the current iterator state in its entirety after the last used cache slot. */ bidi_cache_ensure_space (bidi_cache_idx); - memcpy (&bidi_cache[bidi_cache_idx++], bidi_it, sizeof (struct bidi_it)); + bidi_cache[bidi_cache_idx++] = *bidi_it; /* Push the current cache start onto the stack. */ eassert (bidi_cache_sp < IT_STACK_SIZE); @@ -636,7 +636,7 @@ bidi_pop_it (struct bidi_it *bidi_it) bidi_cache_idx = bidi_cache_start - 1; /* Restore the bidi iterator state saved in the cache. */ - memcpy (bidi_it, &bidi_cache[bidi_cache_idx], sizeof (struct bidi_it)); + *bidi_it = bidi_cache[bidi_cache_idx]; /* Pop the previous cache start from the stack. */ if (bidi_cache_sp <= 0) diff --git a/src/composite.h b/src/composite.h index 68f5b27ee42..9462b932c66 100644 --- a/src/composite.h +++ b/src/composite.h @@ -113,7 +113,7 @@ extern Lisp_Object composition_temp; && (end - start) == COMPOSITION_LENGTH (prop)) /* Return the Nth glyph of composition specified by CMP. CMP is a - pointer to `struct composition'. */ + pointer to `struct composition'. */ #define COMPOSITION_GLYPH(cmp, n) \ XINT (XVECTOR (XVECTOR (XHASH_TABLE (composition_hash_table) \ ->key_and_value) \ diff --git a/src/data.c b/src/data.c index 4678ac1208c..5d7f036b70d 100644 --- a/src/data.c +++ b/src/data.c @@ -948,8 +948,10 @@ store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newva } } -/* Set up SYMBOL to refer to its global binding. - This makes it safe to alter the status of other bindings. */ +/* Set up SYMBOL to refer to its global binding. This makes it safe + to alter the status of other bindings. BEWARE: this may be called + during the mark phase of GC, where we assume that Lisp_Object slots + of BLV are marked after this function has changed them. */ void swap_in_global_binding (struct Lisp_Symbol *symbol) @@ -1008,7 +1010,7 @@ swap_in_symval_forwarding (struct Lisp_Symbol *symbol, struct Lisp_Buffer_Local_ else { tem1 = assq_no_quit (var, BVAR (current_buffer, local_var_alist)); - XSETBUFFER (blv->where, current_buffer); + set_blv_where (blv, Fcurrent_buffer ()); } } if (!(blv->found = !NILP (tem1))) @@ -1162,7 +1164,7 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, the default binding is loaded, the loaded binding may be the wrong one. */ if (!EQ (blv->where, where) - /* Also unload a global binding (if the var is local_if_set). */ + /* Also unload a global binding (if the var is local_if_set). */ || (EQ (blv->valcell, blv->defcell))) { /* The currently loaded binding is not necessarily valid. diff --git a/src/eval.c b/src/eval.c index 4f0d6c69a51..8a8a507a1b6 100644 --- a/src/eval.c +++ b/src/eval.c @@ -69,7 +69,7 @@ Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp; Lisp_Object Qinhibit_quit; Lisp_Object Qand_rest; static Lisp_Object Qand_optional; -static Lisp_Object Qdebug_on_error; +static Lisp_Object Qinhibit_debugger; static Lisp_Object Qdeclare; Lisp_Object Qinternal_interpreter_environment, Qclosure; @@ -229,7 +229,7 @@ call_debugger (Lisp_Object arg) specbind (intern ("debugger-may-continue"), debug_while_redisplaying ? Qnil : Qt); specbind (Qinhibit_redisplay, Qnil); - specbind (Qdebug_on_error, Qnil); + specbind (Qinhibit_debugger, Qt); #if 0 /* Binding this prevents execution of Lisp code during redisplay, which necessarily leads to display problems. */ @@ -1725,6 +1725,7 @@ maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, Lisp_Object data) /* Don't try to run the debugger with interrupts blocked. The editing loop would return anyway. */ ! INPUT_BLOCKED_P + && NILP (Vinhibit_debugger) /* Does user want to enter debugger for this kind of error? */ && (EQ (sig, Qquit) ? debug_on_quit @@ -3467,7 +3468,7 @@ before making `inhibit-quit' nil. */); DEFSYM (Qinhibit_quit, "inhibit-quit"); DEFSYM (Qautoload, "autoload"); - DEFSYM (Qdebug_on_error, "debug-on-error"); + DEFSYM (Qinhibit_debugger, "inhibit-debugger"); DEFSYM (Qmacro, "macro"); DEFSYM (Qdeclare, "declare"); @@ -3482,6 +3483,12 @@ before making `inhibit-quit' nil. */); DEFSYM (Qclosure, "closure"); DEFSYM (Qdebug, "debug"); + DEFVAR_LISP ("inhibit-debugger", Vinhibit_debugger, + doc: /* Non-nil means never enter the debugger. +Normally set while the debugger is already active, to avoid recursive +invocations. */); + Vinhibit_debugger = Qnil; + DEFVAR_LISP ("debug-on-error", Vdebug_on_error, doc: /* Non-nil means enter debugger if an error is signaled. Does not apply to errors handled by `condition-case' or those @@ -3491,7 +3498,7 @@ if one of its condition symbols appears in the list. When you evaluate an expression interactively, this variable is temporarily non-nil if `eval-expression-debug-on-error' is non-nil. The command `toggle-debug-on-error' toggles this. -See also the variable `debug-on-quit'. */); +See also the variable `debug-on-quit' and `inhibit-debugger'. */); Vdebug_on_error = Qnil; DEFVAR_LISP ("debug-ignored-errors", Vdebug_ignored_errors, diff --git a/src/fns.c b/src/fns.c index 95450c5e911..91dc6639150 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3680,7 +3680,7 @@ copy_hash_table (struct Lisp_Hash_Table *h1) h2 = allocate_hash_table (); next = h2->header.next.vector; - memcpy (h2, h1, sizeof *h2); + *h2 = *h1; h2->header.next.vector = next; h2->key_and_value = Fcopy_sequence (h1->key_and_value); h2->hash = Fcopy_sequence (h1->hash); diff --git a/src/image.c b/src/image.c index 4ec6105d72d..cf01602050f 100644 --- a/src/image.c +++ b/src/image.c @@ -593,7 +593,7 @@ define_image_type (struct image_type *type, int loaded) /* Make a copy of TYPE to avoid a bus error in a dumped Emacs. The initialized data segment is read-only. */ struct image_type *p = xmalloc (sizeof *p); - memcpy (p, type, sizeof *p); + *p = *type; p->next = image_types; image_types = p; success = Qt; @@ -6181,7 +6181,7 @@ our_memory_skip_input_data (j_decompress_ptr cinfo, long int num_bytes) reading the image. */ static void -jpeg_memory_src (j_decompress_ptr cinfo, JOCTET *data, unsigned int len) +jpeg_memory_src (j_decompress_ptr cinfo, JOCTET *data, ptrdiff_t len) { struct jpeg_source_mgr *src; diff --git a/src/keyboard.c b/src/keyboard.c index 691a06d36cf..de48b53053b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2369,15 +2369,6 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, goto reread_first; } - if (unread_command_char != -1) - { - XSETINT (c, unread_command_char); - unread_command_char = -1; - - reread = 1; - goto reread_first; - } - if (CONSP (Vunread_command_events)) { int was_disabled = 0; @@ -2562,7 +2553,6 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, && !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event) /* Don't bring up a menu if we already have another event. */ && NILP (Vunread_command_events) - && unread_command_char < 0 && !detect_input_pending_run_timers (0)) { c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps); @@ -2698,8 +2688,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, && !EQ (XCAR (prev_event), Qmenu_bar) && !EQ (XCAR (prev_event), Qtool_bar) /* Don't bring up a menu if we already have another event. */ - && NILP (Vunread_command_events) - && unread_command_char < 0) + && NILP (Vunread_command_events)) { c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu); @@ -3605,7 +3594,7 @@ kbd_buffer_store_event_hold (register struct input_event *event, if (hold_quit) { - memcpy (hold_quit, event, sizeof (*event)); + *hold_quit = *event; return; } @@ -4143,7 +4132,7 @@ kbd_buffer_get_event (KBOARD **kbp, *used_mouse_menu = 1; #endif #ifdef HAVE_NS - /* certain system events are non-key events */ + /* Certain system events are non-key events. */ if (used_mouse_menu && event->kind == NS_NONKEY_EVENT) *used_mouse_menu = 1; @@ -4171,7 +4160,7 @@ kbd_buffer_get_event (KBOARD **kbp, so x remains nil. */ x = Qnil; - /* XXX Can f or mouse_position_hook be NULL here? */ + /* XXX Can f or mouse_position_hook be NULL here? */ if (f && FRAME_TERMINAL (f)->mouse_position_hook) (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, 0, &bar_window, &part, &x, &y, &t); @@ -10469,7 +10458,7 @@ clear_input_pending (void) int requeued_events_pending_p (void) { - return (!NILP (Vunread_command_events) || unread_command_char != -1); + return (!NILP (Vunread_command_events)); } @@ -10479,7 +10468,7 @@ Actually, the value is nil only if we can be sure that no input is available; if there is a doubt, the value is t. */) (void) { - if (!NILP (Vunread_command_events) || unread_command_char != -1 + if (!NILP (Vunread_command_events) || !NILP (Vunread_post_input_method_events) || !NILP (Vunread_input_method_events)) return (Qt); @@ -10667,7 +10656,6 @@ Also end any kbd macro being defined. */) update_mode_lines++; Vunread_command_events = Qnil; - unread_command_char = -1; discard_tty_input (); @@ -11007,7 +10995,6 @@ quit_throw_to_read_char (int from_signal) input_pending = 0; Vunread_command_events = Qnil; - unread_command_char = -1; #if 0 /* Currently, sit_for is called from read_char without turning off polling. And that can call set_waiting_for_input. @@ -11394,12 +11381,11 @@ delete_kboard (KBOARD *kb) void init_keyboard (void) { - /* This is correct before outermost invocation of the editor loop */ + /* This is correct before outermost invocation of the editor loop. */ command_loop_level = -1; immediate_quit = 0; quit_char = Ctl ('g'); Vunread_command_events = Qnil; - unread_command_char = -1; timer_idleness_start_time = invalid_emacs_time (); total_keys = 0; recent_keys_index = 0; @@ -11736,9 +11722,6 @@ as they will already have been added once as they were read for the first time. An element of the form (t . EVENT) forces EVENT to be added to that list. */); Vunread_command_events = Qnil; - DEFVAR_INT ("unread-command-char", unread_command_char, - doc: /* If not -1, an object to be read as next command input event. */); - DEFVAR_LISP ("unread-post-input-method-events", Vunread_post_input_method_events, doc: /* List of events to be processed as input by input methods. These events are processed before `unread-command-events' diff --git a/src/lisp.h b/src/lisp.h index 0163a9bcdbc..41fa274a562 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2006,7 +2006,10 @@ extern ptrdiff_t specpdl_size; #define SPECPDL_INDEX() (specpdl_ptr - specpdl) -/* Everything needed to describe an active condition case. */ +/* Everything needed to describe an active condition case. + + Members are volatile if their values need to survive _longjmp when + a 'struct handler' is a local variable. */ struct handler { /* The handler clauses and variable from the condition-case form. */ @@ -2017,10 +2020,12 @@ struct handler error: handle all conditions, and errors can run the debugger or display a backtrace. */ Lisp_Object handler; - Lisp_Object var; + + Lisp_Object volatile var; + /* Fsignal stores here the condition-case clause that applies, and Fcondition_case thus knows which clause to run. */ - Lisp_Object chosen_clause; + Lisp_Object volatile chosen_clause; /* Used to effect the longjump out to the handler. */ struct catchtag *tag; @@ -2046,19 +2051,21 @@ struct handler of the catch form. All the other members are concerned with restoring the interpreter - state. */ + state. + Members are volatile if their values need to survive _longjmp when + a 'struct catchtag' is a local variable. */ struct catchtag { Lisp_Object tag; - Lisp_Object val; - struct catchtag *next; + Lisp_Object volatile val; + struct catchtag *volatile next; struct gcpro *gcpro; jmp_buf jmp; struct backtrace *backlist; struct handler *handlerlist; EMACS_INT lisp_eval_depth; - ptrdiff_t pdlcount; + ptrdiff_t volatile pdlcount; int poll_suppress_count; int interrupt_input_blocked; struct byte_stack *byte_stack; diff --git a/src/nsterm.h b/src/nsterm.h index b1836692b2c..f3adab883a1 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -103,7 +103,7 @@ along with GNU Emacs. If not, see . */ - (void) setWindowClosing: (BOOL)closing; - (EmacsToolbar *) toolbar; - (void) deleteWorkingText; -- (void) updateFrameSize; +- (void) updateFrameSize: (BOOL) delay; #ifdef NS_IMPL_GNUSTEP /* Not declared, but useful. */ diff --git a/src/nsterm.m b/src/nsterm.m index 798c9758376..f9611fd1210 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -3727,7 +3727,7 @@ ns_judge_scroll_bars (struct frame *f) } if (removed) - [eview updateFrameSize]; + [eview updateFrameSize: NO]; } @@ -5362,7 +5362,7 @@ not_in_argv (NSString *arg) return NO; } -- (void) updateFrameSize +- (void) updateFrameSize: (BOOL) delay; { NSWindow *window = [self window]; NSRect wr = [window frame]; @@ -5400,7 +5400,7 @@ not_in_argv (NSString *arg) NSView *view = FRAME_NS_VIEW (emacsframe); FRAME_PIXEL_WIDTH (emacsframe) = neww; FRAME_PIXEL_HEIGHT (emacsframe) = newh; - change_frame_size (emacsframe, rows, cols, 0, 0, 1); + change_frame_size (emacsframe, rows, cols, 0, delay, 0); SET_FRAME_GARBAGED (emacsframe); cancel_mouse_face (emacsframe); [view setFrame: NSMakeRect (0, 0, neww, newh)]; @@ -5503,7 +5503,7 @@ not_in_argv (NSString *arg) x_set_window_size (emacsframe, 0, cols, rows); else { - [self updateFrameSize]; + [self updateFrameSize: YES]; } } #endif diff --git a/src/process.c b/src/process.c index 0ae68567d6b..f80b5e80c76 100644 --- a/src/process.c +++ b/src/process.c @@ -6367,9 +6367,8 @@ process has been transmitted to the serial port. */) if (!proc_encode_coding_system[new_outfd]) proc_encode_coding_system[new_outfd] = xmalloc (sizeof (struct coding_system)); - memcpy (proc_encode_coding_system[new_outfd], - proc_encode_coding_system[old_outfd], - sizeof (struct coding_system)); + *proc_encode_coding_system[new_outfd] + = *proc_encode_coding_system[old_outfd]; memset (proc_encode_coding_system[old_outfd], 0, sizeof (struct coding_system)); diff --git a/src/w32proc.c b/src/w32proc.c index b9239cbb99a..74427e76a4f 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -1429,6 +1429,9 @@ sys_kill (int pid, int sig) int need_to_free = 0; int rc = 0; + if (pid == getpid () && sig == SIGABRT) + emacs_abort (); + /* Only handle signals that will result in the process dying */ if (sig != SIGINT && sig != SIGKILL && sig != SIGQUIT && sig != SIGHUP) { diff --git a/src/window.c b/src/window.c index 87429b51448..cf296a707e3 100644 --- a/src/window.c +++ b/src/window.c @@ -177,11 +177,6 @@ wset_new_total (struct window *w, Lisp_Object val) w->new_total = val; } static inline void -wset_next_buffers (struct window *w, Lisp_Object val) -{ - w->next_buffers = val; -} -static inline void wset_normal_cols (struct window *w, Lisp_Object val) { w->normal_cols = val; @@ -202,11 +197,6 @@ wset_pointm (struct window *w, Lisp_Object val) w->pointm = val; } static inline void -wset_prev_buffers (struct window *w, Lisp_Object val) -{ - w->prev_buffers = val; -} -static inline void wset_right_fringe_width (struct window *w, Lisp_Object val) { w->right_fringe_width = val; diff --git a/src/window.h b/src/window.h index a70bc55bac5..62ae43a999d 100644 --- a/src/window.h +++ b/src/window.h @@ -414,7 +414,16 @@ wset_window_end_vpos (struct window *w, Lisp_Object val) { w->window_end_vpos = val; } - +WINDOW_INLINE void +wset_prev_buffers (struct window *w, Lisp_Object val) +{ + w->prev_buffers = val; +} +WINDOW_INLINE void +wset_next_buffers (struct window *w, Lisp_Object val) +{ + w->next_buffers = val; +} /* 1 if W is a minibuffer window. */ diff --git a/src/xdisp.c b/src/xdisp.c index df402cd106e..3536e04fe8d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -366,7 +366,6 @@ static Lisp_Object Qslice; Lisp_Object Qcenter; static Lisp_Object Qmargin, Qpointer; static Lisp_Object Qline_height; -Lisp_Object Qinhibit_debug_on_message; /* These setters are used only in this file, so they can be private. */ static inline void @@ -10644,8 +10643,6 @@ static void set_message (const char *s, Lisp_Object string, ptrdiff_t nbytes, int multibyte_p) { - ptrdiff_t count = SPECPDL_INDEX (); - message_enable_multibyte = ((s && multibyte_p) || (STRINGP (string) && STRING_MULTIBYTE (string))); @@ -10655,14 +10652,9 @@ set_message (const char *s, Lisp_Object string, message_buf_print = 0; help_echo_showing_p = 0; - if (NILP (Vinhibit_debug_on_message) && STRINGP (Vdebug_on_message) + if (STRINGP (Vdebug_on_message) && fast_string_match (Vdebug_on_message, string) >= 0) - { - specbind (Qinhibit_debug_on_message, Qt); - call_debugger (list2 (Qerror, string)); - } - - unbind_to (count, Qnil); + call_debugger (list2 (Qerror, string)); } @@ -12854,7 +12846,7 @@ overlay_arrow_at_row (struct it *it, struct glyph_row *row) return make_number (fringe_bitmap); } #endif - return make_number (-1); /* Use default arrow bitmap */ + return make_number (-1); /* Use default arrow bitmap. */ } return overlay_arrow_string_or_property (var); } @@ -29566,11 +29558,6 @@ Its value should be an ASCII acronym string, `hex-code', `empty-box', or DEFVAR_LISP ("debug-on-message", Vdebug_on_message, doc: /* If non-nil, debug if a message matching this regexp is displayed. */); Vdebug_on_message = Qnil; - - DEFVAR_LISP ("inhibit-debug-on-message", Vinhibit_debug_on_message, - doc: /* If non-nil, inhibit `debug-on-message' from entering the debugger. */); - Vinhibit_debug_on_message = Qnil; - DEFSYM(Qinhibit_debug_on_message, "inhibit-debug-on-message"); } diff --git a/src/xfaces.c b/src/xfaces.c index aee5158036f..c113c1a37b7 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -661,7 +661,7 @@ x_create_gc (struct frame *f, XGCValues *xgcv) { GC gc = xmalloc (sizeof *gc); - memcpy (gc, xgcv, sizeof (XGCValues)); + *gc = *xgcv; return gc; } diff --git a/src/xgselect.c b/src/xgselect.c index 0c00d815820..5f4c7edfb79 100644 --- a/src/xgselect.c +++ b/src/xgselect.c @@ -49,9 +49,9 @@ xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, && g_main_context_pending (context = g_main_context_default ()))) return pselect (fds_lim, rfds, wfds, efds, timeout, sigmask); - if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds)); + if (rfds) all_rfds = *rfds; else FD_ZERO (&all_rfds); - if (wfds) memcpy (&all_wfds, wfds, sizeof (all_rfds)); + if (wfds) all_wfds = *wfds; else FD_ZERO (&all_wfds); n_gfds = g_main_context_query (context, G_PRIORITY_LOW, &tmo_in_millisec,