Now on revision 109934. ------------------------------------------------------------ revno: 109934 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2012-09-07 16:14:55 -0400 message: * lisp/emacs-lisp/byte-run.el (defun): Tweak message. Simplify code. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-07 14:53:15 +0000 +++ lisp/ChangeLog 2012-09-07 20:14:55 +0000 @@ -1,7 +1,11 @@ +2012-09-07 Stefan Monnier + + * emacs-lisp/byte-run.el (defun): Tweak message. Simplify code. + 2012-09-07 Matt McClure (tiny change) - * progmodes/python.el (python-shell-send-string): When - default-directory is remote, create temp file on remote + * progmodes/python.el (python-shell-send-string): + When default-directory is remote, create temp file on remote filesystem. (python-shell-send-file): When file is remote, pass local view of file paths to remote Python interpreter. (Bug#12340) @@ -15,8 +19,8 @@ * subr.el (read-char-choice): Allow quitting via ESC ESC. - * userlock.el (ask-user-about-supersession-threat): Use - read-char-choice (Bug#12093). + * userlock.el (ask-user-about-supersession-threat): + Use read-char-choice (Bug#12093). 2012-09-07 Chong Yidong === modified file 'lisp/emacs-lisp/byte-run.el' --- lisp/emacs-lisp/byte-run.el 2012-08-15 16:29:11 +0000 +++ lisp/emacs-lisp/byte-run.el 2012-09-07 20:14:55 +0000 @@ -185,11 +185,10 @@ ((and (featurep 'cl) (memq (car x) ;C.f. cl-do-proclaim. '(special inline notinline optimize warn))) - (if (null (stringp docstring)) - (push (list 'declare x) body) - (setcdr body (cons (list 'declare x) (cdr body)))) + (push (list 'declare x) + (if (stringp docstring) (cdr body) body)) nil) - (t (message "Warning: Unknown defun property %S in %S" + (t (message "Warning: Unknown defun property `%S' in %S" (car x) name))))) decls)) (def (list 'defalias ------------------------------------------------------------ revno: 109933 author: Matt McClure committer: Michael Albinus (tiny change) + + * progmodes/python.el (python-shell-send-string): When + default-directory is remote, create temp file on remote + filesystem. + (python-shell-send-file): When file is remote, pass local view of + file paths to remote Python interpreter. (Bug#12340) + 2012-09-07 Chong Yidong * window.el (switch-to-buffer): Doc fix (Bug#12181). === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-08-15 16:29:11 +0000 +++ lisp/progmodes/python.el 2012-09-07 14:53:15 +0000 @@ -1824,7 +1824,11 @@ (lines (split-string string "\n" t))) (and msg (message "Sent: %s..." (nth 0 lines))) (if (> (length lines) 1) - (let* ((temp-file-name (make-temp-file "py")) + (let* ((temporary-file-directory + (if (file-remote-p default-directory) + (concat (file-remote-p default-directory) "/tmp") + temporary-file-directory)) + (temp-file-name (make-temp-file "py")) (file-name (or (buffer-file-name) temp-file-name))) (with-temp-file temp-file-name (insert string) @@ -1931,8 +1935,14 @@ (interactive "fFile to send: ") (let* ((process (or process (python-shell-get-or-create-process))) (temp-file-name (when temp-file-name - (expand-file-name temp-file-name))) - (file-name (or (expand-file-name file-name) temp-file-name))) + (expand-file-name + (or (file-remote-p temp-file-name 'localname) + temp-file-name)))) + (file-name (or (when file-name + (expand-file-name + (or (file-remote-p file-name 'localname) + file-name))) + temp-file-name))) (when (not file-name) (error "If FILE-NAME is nil then TEMP-FILE-NAME must be non-nil")) (python-shell-send-string ------------------------------------------------------------ revno: 109932 fixes bug: http://debbugs.gnu.org/12323 committer: Chong Yidong branch nick: trunk timestamp: Fri 2012-09-07 22:45:28 +0800 message: * src/textprop.c (Fget_text_property): Minor doc fix. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-07 14:15:59 +0000 +++ src/ChangeLog 2012-09-07 14:45:28 +0000 @@ -1,5 +1,7 @@ 2012-09-07 Chong Yidong + * textprop.c (Fget_text_property): Minor doc fix (Bug#12323). + * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713). 2012-09-07 Paul Eggert === modified file 'src/textprop.c' --- src/textprop.c 2012-08-28 06:20:08 +0000 +++ src/textprop.c 2012-09-07 14:45:28 +0000 @@ -556,7 +556,8 @@ DEFUN ("get-text-property", Fget_text_property, Sget_text_property, 2, 3, 0, doc: /* Return the value of POSITION's property PROP, in OBJECT. -OBJECT is optional and defaults to the current buffer. +OBJECT should be a buffer or a string; if omitted or nil, it defaults +to the current buffer. If POSITION is at the end of OBJECT, the value is nil. */) (Lisp_Object position, Lisp_Object prop, Lisp_Object object) { ------------------------------------------------------------ revno: 109931 fixes bug: http://debbugs.gnu.org/10713 committer: Chong Yidong branch nick: trunk timestamp: Fri 2012-09-07 22:15:59 +0800 message: Fix doc of local-variable-if-set-p. * doc/lispref/variables.texi (Creating Buffer-Local): Fix description of local-variable-if-set-p. * src/data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713). diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-09-07 13:53:21 +0000 +++ doc/lispref/ChangeLog 2012-09-07 14:15:59 +0000 @@ -1,5 +1,8 @@ 2012-09-07 Chong Yidong + * variables.texi (Creating Buffer-Local): Fix description of + local-variable-if-set-p (Bug#10713). + * eval.texi (Intro Eval): Add index entry for sexp (Bug#12233). * windows.texi (Display Action Functions) === modified file 'doc/lispref/variables.texi' --- doc/lispref/variables.texi 2012-08-07 03:31:53 +0000 +++ doc/lispref/variables.texi 2012-09-07 14:15:59 +0000 @@ -1302,9 +1302,10 @@ @end defun @defun local-variable-if-set-p variable &optional buffer -This returns @code{t} if @var{variable} will become buffer-local in -buffer @var{buffer} (which defaults to the current buffer) if it is -set there. +This returns @code{t} if @var{variable} either has a buffer-local +value in buffer @var{buffer}, or is automatically buffer-local. +Otherwise, it returns @code{nil}. If omitted or @code{nil}, +@var{buffer} defaults to the current buffer. @end defun @defun buffer-local-value variable buffer === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-07 08:55:03 +0000 +++ src/ChangeLog 2012-09-07 14:15:59 +0000 @@ -1,3 +1,7 @@ +2012-09-07 Chong Yidong + + * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713). + 2012-09-07 Paul Eggert More signal-handler cleanup (Bug#12327). === modified file 'src/data.c' --- src/data.c 2012-09-07 01:27:44 +0000 +++ src/data.c 2012-09-07 14:15:59 +0000 @@ -1882,12 +1882,12 @@ DEFUN ("local-variable-if-set-p", Flocal_variable_if_set_p, Slocal_variable_if_set_p, 1, 2, 0, - doc: /* Non-nil if VARIABLE will be local in buffer BUFFER when set there. -More precisely, this means that setting the variable \(with `set' or`setq'), -while it does not have a `let'-style binding that was made in BUFFER, -will produce a buffer local binding. See Info node -`(elisp)Creating Buffer-Local'. -BUFFER defaults to the current buffer. */) + doc: /* Non-nil if VARIABLE is local in buffer BUFFER when set there. +BUFFER defaults to the current buffer. + +More precisely, return non-nil if either VARIABLE already has a local +value in BUFFER, or if VARIABLE is automatically buffer-local (see +`make-variable-buffer-local'). */) (register Lisp_Object variable, Lisp_Object buffer) { struct Lisp_Symbol *sym; ------------------------------------------------------------ revno: 109930 fixes bug: http://debbugs.gnu.org/12181 committer: Chong Yidong branch nick: trunk timestamp: Fri 2012-09-07 21:53:21 +0800 message: Minor doc fix for switch-to-buffer. * doc/lispref/windows.texi (Display Action Functions) (Choosing Window Options): Remove obsolete variable display-buffer-reuse-frames. (Switching Buffers): Minor doc tweak for switch-to-buffer. * lisp/window.el (switch-to-buffer): Doc fix. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-09-07 10:36:39 +0000 +++ doc/lispref/ChangeLog 2012-09-07 13:53:21 +0000 @@ -5,6 +5,7 @@ * windows.texi (Display Action Functions) (Choosing Window Options): Remove obsolete variable display-buffer-reuse-frames. + (Switching Buffers): Minor doc tweak for switch-to-buffer. * positions.texi (Narrowing): Document buffer-narrowed-p. === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2012-09-07 10:27:11 +0000 +++ doc/lispref/windows.texi 2012-09-07 13:53:21 +0000 @@ -1492,12 +1492,10 @@ @code{set-buffer}. @xref{Current Buffer}. @deffn Command switch-to-buffer buffer-or-name &optional norecord force-same-window -This function displays @var{buffer-or-name} in the selected window, -and makes it the current buffer. (In contrast, @code{set-buffer} -makes the buffer current but does not display it; @pxref{Current -Buffer}). It is often used interactively (as the binding of @kbd{C-x -b}), as well as in Lisp programs. The return value is the buffer -switched to. +This command attempts to display @var{buffer-or-name} in the selected +window, and makes it the current buffer. It is often used +interactively (as the binding of @kbd{C-x b}), as well as in Lisp +programs. The return value is the buffer switched to. If @var{buffer-or-name} is @code{nil}, it defaults to the buffer returned by @code{other-buffer} (@pxref{The Buffer List}). If @@ -1506,17 +1504,18 @@ buffer's major mode is determined by the variable @code{major-mode} (@pxref{Major Modes}). -Normally the specified buffer is put at the front of the buffer +Normally, the specified buffer is put at the front of the buffer list---both the global buffer list and the selected frame's buffer list (@pxref{The Buffer List}). However, this is not done if the optional argument @var{norecord} is non-@code{nil}. -If this function is unable to display the buffer in the selected -window---usually because the selected window is a minibuffer window or -is strongly dedicated to its buffer (@pxref{Dedicated Windows})---then -it normally tries to display the buffer in some other window, in the -manner of @code{pop-to-buffer} (see below). However, if the optional -argument @var{force-same-window} is non-@code{nil}, it signals an error +Sometimes, @code{switch-to-buffer} may be unable to display the buffer +in the selected window. This happens if the selected window is a +minibuffer window, or if the selected window is strongly dedicated to +its buffer (@pxref{Dedicated Windows}). In that case, the command +normally tries to display the buffer in some other window, by invoking +@code{pop-to-buffer} (see below). However, if the optional argument +@var{force-same-window} is non-@code{nil}, it signals an error instead. @end deffn === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-07 10:53:29 +0000 +++ lisp/ChangeLog 2012-09-07 13:53:21 +0000 @@ -1,5 +1,7 @@ 2012-09-07 Chong Yidong + * window.el (switch-to-buffer): Doc fix (Bug#12181). + * files.el (after-find-file): Don't fail on a read-only buffer if require-final-newline is `visit' or `visit-save' (Bug#11156). === modified file 'lisp/window.el' --- lisp/window.el 2012-09-05 09:22:20 +0000 +++ lisp/window.el 2012-09-07 13:53:21 +0000 @@ -5642,26 +5642,28 @@ (defun switch-to-buffer (buffer-or-name &optional norecord force-same-window) "Switch to buffer BUFFER-OR-NAME in the selected window. -If called interactively, prompt for the buffer name using the +If the selected window cannot display the specified +buffer (e.g. if it is a minibuffer window or strongly dedicated +to another buffer), call `pop-to-buffer' to select the buffer in +another window. + +If called interactively, read the buffer name using the minibuffer. The variable `confirm-nonexistent-file-or-buffer' determines whether to request confirmation before creating a new buffer. -BUFFER-OR-NAME may be a buffer, a string (a buffer name), or -nil. If BUFFER-OR-NAME is a string that does not identify an -existing buffer, create a buffer with that name. If -BUFFER-OR-NAME is nil, switch to the buffer returned by -`other-buffer'. - -Optional argument NORECORD non-nil means do not put the buffer -specified by BUFFER-OR-NAME at the front of the buffer list and -do not make the window displaying it the most recently selected -one. - -If FORCE-SAME-WINDOW is non-nil, BUFFER-OR-NAME must be displayed -in the selected window; signal an error if that is -impossible (e.g. if the selected window is minibuffer-only). If -nil, BUFFER-OR-NAME may be displayed in another window. +BUFFER-OR-NAME may be a buffer, a string (a buffer name), or nil. +If BUFFER-OR-NAME is a string that does not identify an existing +buffer, create a buffer with that name. If BUFFER-OR-NAME is +nil, switch to the buffer returned by `other-buffer'. + +If optional argument NORECORD is non-nil, do not put the buffer +at the front of the buffer list, and do not make the window +displaying it the most recently selected one. + +If optional argument FORCE-SAME-WINDOW is non-nil, the buffer +must be displayed in the selected window; if that is impossible, +signal an error rather than calling `pop-to-buffer'. Return the buffer switched to." (interactive ------------------------------------------------------------ revno: 109929 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2012-09-07 14:15:08 +0200 message: nt/config.nt: Sync with autogen/config.in. (NO_ABORT, SIGNAL_H_AHB): Remove. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-09-07 08:20:07 +0000 +++ nt/ChangeLog 2012-09-07 12:15:08 +0000 @@ -1,3 +1,8 @@ +2012-09-07 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + (NO_ABORT, SIGNAL_H_AHB): Remove. + 2012-09-07 Eli Zaretskii * inc/ms-w32.h (struct sigaction): Declare sa_handler __cdecl. === modified file 'nt/config.nt' --- nt/config.nt 2012-09-05 00:17:57 +0000 +++ nt/config.nt 2012-09-07 12:15:08 +0000 @@ -162,7 +162,7 @@ #define FIRST_PTY_LETTER 'a' /* Define if the float library doesn't handle errors by either setting errno, - or signaling SIGFPE/SIGILL. */ + or signaling SIGFPE. */ #undef FLOAT_CHECK_DOMAIN /* Enable compile-time and run-time bounds-checking, and some warnings, @@ -1189,9 +1189,6 @@ `NO'. */ #undef NARROWPROTO -/* Do not define abort in emacs.c. */ -#undef NO_ABORT - /* Define if XEditRes should not be used. */ #undef NO_EDITRES @@ -1313,9 +1310,6 @@ /* Make process_send_signal work by "typing" a signal character on the pty. */ #undef SIGNALS_VIA_CHARACTERS -/* Define if AH_BOTTOM should include signal.h. */ -#undef SIGNAL_H_AHB - /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'sig_atomic_t'. */ #undef SIG_ATOMIC_T_SUFFIX ------------------------------------------------------------ revno: 109928 fixes bug: http://debbugs.gnu.org/11156 committer: Chong Yidong branch nick: trunk timestamp: Fri 2012-09-07 18:53:29 +0800 message: Fix handling of require-final-newline in after-find-file. * files.el (after-find-file): Don't fail on a read-only buffer if require-final-newline is `visit' or `visit-save'. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-07 10:19:58 +0000 +++ lisp/ChangeLog 2012-09-07 10:53:29 +0000 @@ -1,5 +1,8 @@ 2012-09-07 Chong Yidong + * files.el (after-find-file): Don't fail on a read-only buffer if + require-final-newline is `visit' or `visit-save' (Bug#11156). + * subr.el (read-char-choice): Allow quitting via ESC ESC. * userlock.el (ask-user-about-supersession-threat): Use === modified file 'lisp/files.el' --- lisp/files.el 2012-09-03 08:54:25 +0000 +++ lisp/files.el 2012-09-07 10:53:29 +0000 @@ -2145,7 +2145,7 @@ (not buffer-read-only) (save-excursion (goto-char (point-max)) - (insert "\n"))) + (ignore-errors (insert "\n")))) (when (and buffer-read-only view-read-only (not (eq (get major-mode 'mode-class) 'special))) ------------------------------------------------------------ revno: 109927 fixes bug: http://debbugs.gnu.org/12233 committer: Chong Yidong branch nick: trunk timestamp: Fri 2012-09-07 18:36:39 +0800 message: * doc/lispref/eval.texi (Intro Eval): Add index entry for sexp. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-09-07 10:27:11 +0000 +++ doc/lispref/ChangeLog 2012-09-07 10:36:39 +0000 @@ -1,5 +1,7 @@ 2012-09-07 Chong Yidong + * eval.texi (Intro Eval): Add index entry for sexp (Bug#12233). + * windows.texi (Display Action Functions) (Choosing Window Options): Remove obsolete variable display-buffer-reuse-frames. === modified file 'doc/lispref/eval.texi' --- doc/lispref/eval.texi 2012-05-27 01:34:14 +0000 +++ doc/lispref/eval.texi 2012-09-07 10:36:39 +0000 @@ -40,6 +40,7 @@ @cindex form @cindex expression @cindex S-expression +@cindex sexp A Lisp object that is intended for evaluation is called a @dfn{form} or @dfn{expression}@footnote{It is sometimes also referred to as an @dfn{S-expression} or @dfn{sexp}, but we generally do not use this ------------------------------------------------------------ revno: 109926 committer: Chong Yidong branch nick: trunk timestamp: Fri 2012-09-07 18:27:11 +0800 message: Remove obsolete display-buffer-reuse-frames from manuals. * doc/emacs/windows.texi (Window Choice): Don't mention obsolete display-buffer-reuse-frames. * doc/lispref/windows.texi (Display Action Functions) (Choosing Window Options): Remove obsolete variable display-buffer-reuse-frames. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2012-09-04 18:29:04 +0000 +++ doc/emacs/ChangeLog 2012-09-07 10:27:11 +0000 @@ -1,3 +1,8 @@ +2012-09-07 Chong Yidong + + * windows.texi (Window Choice): Don't mention obsolete + display-buffer-reuse-frames. + 2012-09-04 Paul Eggert Give more-useful info on a fatal error (Bug#12328). === modified file 'doc/emacs/windows.texi' --- doc/emacs/windows.texi 2012-05-27 01:25:06 +0000 +++ doc/emacs/windows.texi 2012-09-07 10:27:11 +0000 @@ -378,12 +378,10 @@ expression to the list @code{same-window-regexps}. By default, these variables are @code{nil}, so this step is skipped. -@vindex display-buffer-reuse-frames @item Otherwise, if the buffer is already displayed in an existing window, ``reuse'' that window. Normally, only windows on the selected frame are considered, but windows on other frames are also reusable if you -change @code{display-buffer-reuse-frames} to @code{t}, or if you change @code{pop-up-frames} (see below) to @code{t}. @item === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-09-07 08:58:31 +0000 +++ doc/lispref/ChangeLog 2012-09-07 10:27:11 +0000 @@ -1,5 +1,9 @@ 2012-09-07 Chong Yidong + * windows.texi (Display Action Functions) + (Choosing Window Options): Remove obsolete variable + display-buffer-reuse-frames. + * positions.texi (Narrowing): Document buffer-narrowed-p. * markers.texi (Moving Markers): Add xref to Point (Bug#7151). === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2012-09-02 04:47:28 +0000 +++ doc/lispref/windows.texi 2012-09-07 10:27:11 +0000 @@ -1728,8 +1728,7 @@ @end itemize If @var{alist} contains no @code{reusable-frames} entry, this function -normally searches just the selected frame; however, if either the -variable @code{display-buffer-reuse-frames} or the variable +normally searches just the selected frame; however, if the variable @code{pop-up-frames} is non-@code{nil}, it searches all frames on the current terminal. @xref{Choosing Window Options}. @@ -1769,14 +1768,6 @@ (@pxref{Choosing Window}) can be modified by a variety of user options. -@defopt display-buffer-reuse-frames -If the value of this variable is non-@code{nil}, @code{display-buffer} -may search all frames on the current terminal when looking for a -window already displaying the specified buffer. The default is -@code{nil}. This variable is consulted by the action function -@code{display-buffer-reuse-window} (@pxref{Display Action Functions}). -@end defopt - @defopt pop-up-windows If the value of this variable is non-@code{nil}, @code{display-buffer} is allowed to split an existing window to make a new window for === modified file 'etc/NEWS' --- etc/NEWS 2012-09-07 08:58:31 +0000 +++ etc/NEWS 2012-09-07 10:27:11 +0000 @@ -671,7 +671,7 @@ *** The following variables are obsolete, as they can be replaced by appropriate entries in the `display-buffer-alist' function introduced in Emacs 24.1: - ++++ **** `display-buffer-reuse-frames' **** `special-display-regexps' **** `special-display-frame-alist' ------------------------------------------------------------ revno: 109925 fixes bug: http://debbugs.gnu.org/12093 committer: Chong Yidong branch nick: trunk timestamp: Fri 2012-09-07 18:19:58 +0800 message: Let ESC ESC quit in read-char-choice, and use it in userlock.el. * lisp/subr.el (read-char-choice): Allow quitting via ESC ESC. * lisp/userlock.el (ask-user-about-supersession-threat): Use read-char-choice. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-07 08:58:31 +0000 +++ lisp/ChangeLog 2012-09-07 10:19:58 +0000 @@ -1,5 +1,12 @@ 2012-09-07 Chong Yidong + * subr.el (read-char-choice): Allow quitting via ESC ESC. + + * userlock.el (ask-user-about-supersession-threat): Use + read-char-choice (Bug#12093). + +2012-09-07 Chong Yidong + * subr.el (buffer-narrowed-p): New function. * ses.el (ses-widen): === modified file 'lisp/subr.el' --- lisp/subr.el 2012-09-07 08:58:31 +0000 +++ lisp/subr.el 2012-09-07 10:19:58 +0000 @@ -2237,7 +2237,8 @@ (error "Called `read-char-choice' without valid char choices")) (let (char done show-help (helpbuf " *Char Help*")) (let ((cursor-in-echo-area t) - (executing-kbd-macro executing-kbd-macro)) + (executing-kbd-macro executing-kbd-macro) + (esc-flag nil)) (save-window-excursion ; in case we call help-form-show (while (not done) (unless (get-text-property 0 'face prompt) @@ -2261,8 +2262,12 @@ ;; there are no more events in the macro. Attempt to ;; get an event interactively. (setq executing-kbd-macro nil)) - ((and (not inhibit-keyboard-quit) (eq char ?\C-g)) - (keyboard-quit)))))) + ((not inhibit-keyboard-quit) + (cond + ((and (null esc-flag) (eq char ?\e)) + (setq esc-flag t)) + ((memq char '(?\C-g ?\e)) + (keyboard-quit)))))))) ;; Display the question with the answer. But without cursor-in-echo-area. (message "%s%s" prompt (char-to-string char)) char)) === modified file 'lisp/userlock.el' --- lisp/userlock.el 2012-07-18 11:44:13 +0000 +++ lisp/userlock.el 2012-09-07 10:19:58 +0000 @@ -108,37 +108,27 @@ The buffer in question is current when this function is called." (discard-input) (save-window-excursion - (let (answer) + (let ((prompt + (format "%s changed on disk; \ +really edit the buffer? (y, n, r or C-h) " + (file-name-nondirectory fn))) + (choices '(?y ?n ?r ?? ?\C-h)) + answer) (while (null answer) - (message "%s changed on disk; really edit the buffer? (y, n, r or C-h) " - (file-name-nondirectory fn)) - (let ((tem (downcase (let ((cursor-in-echo-area t)) - (read-char-exclusive))))) - (setq answer - (if (= tem help-char) - 'help - (cdr (assoc tem '((?n . yield) - (?\C-g . yield) - (?y . proceed) - (?r . revert) - (?? . help)))))) - (cond ((null answer) - (beep) - (message "Please type y, n or r; or ? for help") - (sit-for 3)) - ((eq answer 'help) - (ask-user-about-supersession-help) - (setq answer nil)) - ((eq answer 'revert) - (revert-buffer nil (not (buffer-modified-p))) - ; ask confirmation if buffer modified - (signal 'file-supersession - (list "File reverted" fn))) - ((eq answer 'yield) - (signal 'file-supersession - (list "File changed on disk" fn)))))) + (setq answer (read-char-choice prompt choices)) + (cond ((memq answer '(?? ?\C-h)) + (ask-user-about-supersession-help) + (setq answer nil)) + ((eq answer ?r) + ;; Ask for confirmation if buffer modified + (revert-buffer nil (not (buffer-modified-p))) + (signal 'file-supersession + (list "File reverted" fn))) + ((eq answer ?n) + (signal 'file-supersession + (list "File changed on disk" fn))))) (message - "File on disk now will become a backup file if you save these changes.") + "File on disk now will become a backup file if you save these changes.") (setq buffer-backed-up nil)))) (defun ask-user-about-supersession-help () ------------------------------------------------------------ revno: 109924 committer: Glenn Morris branch nick: trunk timestamp: Fri 2012-09-07 06:17:37 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/config.in' --- autogen/config.in 2012-09-05 10:17:38 +0000 +++ autogen/config.in 2012-09-07 10:17:37 +0000 @@ -158,7 +158,7 @@ #undef FIRST_PTY_LETTER /* Define if the float library doesn't handle errors by either setting errno, - or signaling SIGFPE/SIGILL. */ + or signaling SIGFPE. */ #undef FLOAT_CHECK_DOMAIN /* Enable compile-time and run-time bounds-checking, and some warnings, @@ -1300,9 +1300,6 @@ /* Make process_send_signal work by "typing" a signal character on the pty. */ #undef SIGNALS_VIA_CHARACTERS -/* Define if AH_BOTTOM should include signal.h. */ -#undef SIGNAL_H_AHB - /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'sig_atomic_t'. */ #undef SIG_ATOMIC_T_SUFFIX === modified file 'autogen/configure' --- autogen/configure 2012-09-05 10:17:38 +0000 +++ autogen/configure 2012-09-07 10:17:37 +0000 @@ -15039,7 +15039,7 @@ cygwin ) $as_echo "#define PTY_ITERATION int i; for (i = 0; i < 1; i++)" >>confdefs.h - $as_echo "#define PTY_OPEN do { int dummy; SIGMASKTYPE mask; mask = sigblock (sigmask (SIGCHLD)); if (-1 == openpty (&fd, &dummy, pty_name, 0, 0)) fd = -1; sigsetmask (mask); if (fd >= 0) emacs_close (dummy); } while (0)" >>confdefs.h + $as_echo "#define PTY_OPEN do { int dummy; sigset_t blocked, procmask; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, &procmask); if (-1 == openpty (&fd, &dummy, pty_name, 0, 0)) fd = -1; pthread_sigmask (SIG_SETMASK, &procmask, 0); if (fd >= 0) emacs_close (dummy); } while (0)" >>confdefs.h $as_echo "#define PTY_NAME_SPRINTF /**/" >>confdefs.h @@ -15072,7 +15072,7 @@ $as_echo "#define PTY_ITERATION int i; for (i = 0; i < 1; i++)" >>confdefs.h - $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptyname; sigblock (sigmask (SIGCHLD)); if (grantpt (fd) == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname(fd))) { sigunblock (sigmask (SIGCHLD)); close (fd); return -1; } snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); sigunblock (sigmask (SIGCHLD)); }" >>confdefs.h + $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptyname = 0; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); if (grantpt (fd) != -1 && unlockpt (fd) != -1) ptyname = ptsname(fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (!ptyname) { close (fd); return -1; } snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); }" >>confdefs.h if test "x$ac_cv_func_posix_openpt" = xyes; then $as_echo "#define PTY_OPEN fd = posix_openpt (O_RDWR | O_NOCTTY)" >>confdefs.h @@ -15117,12 +15117,12 @@ ;; sol2* ) - $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; sigblock (sigmask (SIGCLD)); if (grantpt (fd) == -1) { emacs_close (fd); return -1; } sigunblock (sigmask (SIGCLD)); if (unlockpt (fd) == -1) { emacs_close (fd); return -1; } if (!(ptyname = ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); }" >>confdefs.h + $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); }" >>confdefs.h ;; unixware ) - $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; sigblock(sigmask(SIGCLD)); if (grantpt(fd) == -1) fatal(\"could not grant slave pty\"); sigunblock(sigmask(SIGCLD)); if (unlockpt(fd) == -1) fatal(\"could not unlock slave pty\"); if (!(ptyname = ptsname(fd))) fatal (\"could not enable slave pty\"); snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); }" >>confdefs.h + $as_echo "#define PTY_TTY_NAME_SPRINTF { char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1) fatal(\"could not grant slave pty\"); if (unlockpt(fd) == -1) fatal(\"could not unlock slave pty\"); if (!(ptyname = ptsname(fd))) fatal (\"could not enable slave pty\"); snprintf (pty_name, sizeof pty_name, \"%s\", ptyname); }" >>confdefs.h ;; esac @@ -15528,12 +15528,6 @@ $as_echo "#define XOS_NEEDS_TIME_H 1" >>confdefs.h ;; - - netbsd | openbsd ) - -$as_echo "#define SIGNAL_H_AHB 1" >>confdefs.h - - ;; esac ------------------------------------------------------------ revno: 109923 committer: Chong Yidong branch nick: trunk timestamp: Fri 2012-09-07 16:58:31 +0800 message: Add a utility function buffer-narrowed-p, and use it. * lisp/subr.el (buffer-narrowed-p): New function. * lisp/ses.el (ses-widen): * lisp/simple.el (count-words--buffer-message): * lisp/net/browse-url.el (browse-url-of-buffer): Use it * lisp/simple.el (count-words-region): Don't signal an error if there is a non-nil prefix arg and the mark is not set. * doc/lispref/positions.texi (Narrowing): Document buffer-narrowed-p. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-09-07 04:51:26 +0000 +++ doc/lispref/ChangeLog 2012-09-07 08:58:31 +0000 @@ -1,5 +1,7 @@ 2012-09-07 Chong Yidong + * positions.texi (Narrowing): Document buffer-narrowed-p. + * markers.texi (Moving Markers): Add xref to Point (Bug#7151). * syntax.texi (Low-Level Parsing): Add xref to Parser State === modified file 'doc/lispref/positions.texi' --- doc/lispref/positions.texi 2012-09-02 04:47:28 +0000 +++ doc/lispref/positions.texi 2012-09-07 08:58:31 +0000 @@ -874,18 +874,18 @@ remains addressable is called the @dfn{accessible portion} of the buffer. - Narrowing is specified with two buffer positions which become the -beginning and end of the accessible portion. For most editing commands -and most Emacs primitives, these positions replace the values of the -beginning and end of the buffer. While narrowing is in effect, no text -outside the accessible portion is displayed, and point cannot move -outside the accessible portion. - - Values such as positions or line numbers, which usually count from the -beginning of the buffer, do so despite narrowing, but the functions -which use them refuse to operate on text that is inaccessible. - - The commands for saving buffers are unaffected by narrowing; they save + Narrowing is specified with two buffer positions, which become the +beginning and end of the accessible portion. For most editing +commands and primitives, these positions replace the values of the +beginning and end of the buffer. While narrowing is in effect, no +text outside the accessible portion is displayed, and point cannot +move outside the accessible portion. Note that narrowing does not +alter actual buffer positions (@pxref{Point}); it only determines +which positions are considered the accessible portion of the buffer. +Most functions refuse to operate on text that is outside the +accessible portion. + + Commands for saving buffers are unaffected by narrowing; they save the entire buffer regardless of any narrowing. If you need to display in a single buffer several very different @@ -924,6 +924,11 @@ @end example @end deffn +@defun buffer-narrowed-p +This function returns non-@code{nil} if the buffer is narrowed, and +@code{nil} otherwise. +@end defun + @defspec save-restriction body@dots{} This special form saves the current bounds of the accessible portion, evaluates the @var{body} forms, and finally restores the saved bounds, === modified file 'etc/NEWS' --- etc/NEWS 2012-09-06 09:29:32 +0000 +++ etc/NEWS 2012-09-07 08:58:31 +0000 @@ -645,6 +645,9 @@ ** New error type and new function `user-error'. Doesn't trigger the debugger. ++++ +** New utility function `buffer-narrowed-p'. + ** Window changes *** The functions get-lru-window, get-mru-window and get-largest-window === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-07 08:36:25 +0000 +++ lisp/ChangeLog 2012-09-07 08:58:31 +0000 @@ -1,6 +1,13 @@ 2012-09-07 Chong Yidong - * simple.el (count-words--buffer-message): Fix narrowing check. + * subr.el (buffer-narrowed-p): New function. + + * ses.el (ses-widen): + * simple.el (count-words--buffer-message): + * net/browse-url.el (browse-url-of-buffer): Use it + + * simple.el (count-words-region): Don't signal an error if there + is a non-nil prefix arg and the mark is not set. * help.el (describe-key-briefly): Allow the message to be seen when invoked from the minibuffer (Bug#7014). === modified file 'lisp/emacs-lisp/cl-loaddefs.el' --- lisp/emacs-lisp/cl-loaddefs.el 2012-09-04 17:40:25 +0000 +++ lisp/emacs-lisp/cl-loaddefs.el 2012-09-07 08:58:31 +0000 @@ -260,7 +260,7 @@ ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) -;;;;;; "cl-macs" "cl-macs.el" "e09b4be5072a8b52d40af6e073876e76") +;;;;;; "cl-macs" "cl-macs.el" "9f9bae5b8ccaf325bd59ba9be2b27c44") ;;; Generated autoloads from cl-macs.el (autoload 'cl--compiler-macro-list* "cl-macs" "\ === modified file 'lisp/net/browse-url.el' --- lisp/net/browse-url.el 2012-07-11 23:13:41 +0000 +++ lisp/net/browse-url.el 2012-09-07 08:58:31 +0000 @@ -743,7 +743,7 @@ (and buffer (set-buffer buffer)) (let ((file-name ;; Ignore real name if restricted - (and (= (- (point-max) (point-min)) (buffer-size)) + (and (not (buffer-narrowed-p)) (or buffer-file-name (and (boundp 'dired-directory) dired-directory))))) (or file-name === modified file 'lisp/ses.el' --- lisp/ses.el 2012-07-22 21:14:12 +0000 +++ lisp/ses.el 2012-09-07 08:58:31 +0000 @@ -1270,11 +1270,9 @@ ;; The data area ;;---------------------------------------------------------------------------- -(defun ses-narrowed-p () (/= (- (point-max) (point-min)) (buffer-size))) - (defun ses-widen () "Turn off narrowing, to be reenabled at end of command loop." - (if (ses-narrowed-p) + (if (buffer-narrowed-p) (setq ses--deferred-narrow t)) (widen)) === modified file 'lisp/simple.el' --- lisp/simple.el 2012-09-07 08:36:25 +0000 +++ lisp/simple.el 2012-09-07 08:58:31 +0000 @@ -974,7 +974,9 @@ If called from Lisp, return the number of words between positions START and END." - (interactive "r\nP") + (interactive (if current-prefix-arg + (list nil nil current-prefix-arg) + (list (region-beginning) (region-end) nil))) (cond ((not (called-interactively-p 'any)) (count-words start end)) (arg @@ -1008,9 +1010,7 @@ (defun count-words--buffer-message () (count-words--message - (if (= (- (point-max) (point-min)) (buffer-size)) - "Buffer" - "Narrowed part of buffer") + (if (buffer-narrowed-p) "Narrowed part of buffer" "Buffer") (point-min) (point-max))) (defun count-words--message (str start end) === modified file 'lisp/subr.el' --- lisp/subr.el 2012-08-18 05:11:38 +0000 +++ lisp/subr.el 2012-09-07 08:58:31 +0000 @@ -2647,6 +2647,10 @@ ;;;; Misc. useful functions. +(defsubst buffer-narrowed-p () + "Return non-nil if the current buffer is narrowed." + (/= (- (point-max) (point-min)) (buffer-size))) + (defun find-tag-default () "Determine default tag to search for, based on text at point. If there is no plausible default, return nil." ------------------------------------------------------------ revno: 109922 committer: Paul Eggert branch nick: trunk timestamp: Fri 2012-09-07 01:55:03 -0700 message: * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls. Problem introduced when merging patches. Noted by Eli Zaretskii in . diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-07 08:46:44 +0000 +++ src/ChangeLog 2012-09-07 08:55:03 +0000 @@ -1,6 +1,9 @@ 2012-09-07 Paul Eggert More signal-handler cleanup (Bug#12327). + * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls. + Problem introduced when merging patches. Noted by Eli Zaretskii in + . * floatfns.c: Comment fix. * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER. SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right, === modified file 'src/emacs.c' --- src/emacs.c 2012-09-07 01:27:44 +0000 +++ src/emacs.c 2012-09-07 08:55:03 +0000 @@ -1144,9 +1144,9 @@ /* Don't catch these signals in batch mode if dumping. On some machines, this sets static data that would make signal fail to work right when the dumped Emacs is run. */ - signal (SIGQUIT, deliver_fatal_signal); - signal (SIGILL, deliver_fatal_signal); - signal (SIGTRAP, deliver_fatal_signal); + sigaction (SIGQUIT, &fatal_error_action, 0); + sigaction (SIGILL, &fatal_error_action, 0); + sigaction (SIGTRAP, &fatal_error_action, 0); #ifdef SIGUSR1 add_user_signal (SIGUSR1, "sigusr1"); #endif ------------------------------------------------------------ revno: 109921 committer: Paul Eggert branch nick: trunk timestamp: Fri 2012-09-07 01:46:44 -0700 message: More signal-handler cleanup. * configure.ac (FLOAT_CHECK_DOMAIN): Comment fix (Bug#12327). * src/floatfns.c: Comment fix. * src/lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER. SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right, and anyway the declaration is harmless even if SIGDANGER is not defined. * src/syssignal.h (SIGIO): Also #undef if (! defined FIONREAD || defined BROKEN_FIONREAD). systty.h formerly did this, but other source files not surprisingly expected syssignal.h to define, or not define, SIGIO, and it's cleaner to do it that way, for consistency. Include , for FIONREAD. * src/systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job. This eliminates a problem whereby other files mysteriously had to include "syssignal.h" before including "systty.h" if they wanted to use "#ifdef SIGIO". diff: === modified file 'ChangeLog' --- ChangeLog 2012-09-07 01:27:44 +0000 +++ ChangeLog 2012-09-07 08:46:44 +0000 @@ -1,3 +1,8 @@ +2012-09-07 Paul Eggert + + More signal-handler cleanup (Bug#12327). + * configure.ac (FLOAT_CHECK_DOMAIN): Comment fix (Bug#12327). + 2012-09-06 Paul Eggert Signal-handler cleanup (Bug#12327). === modified file 'configure.ac' --- configure.ac 2012-09-07 01:27:44 +0000 +++ configure.ac 2012-09-07 08:46:44 +0000 @@ -3212,7 +3212,7 @@ someone else has modified in his/her Emacs.]) AH_TEMPLATE(FLOAT_CHECK_DOMAIN, [Define if the float library doesn't - handle errors by either setting errno, or signaling SIGFPE/SIGILL.]) + handle errors by either setting errno, or signaling SIGFPE.]) AH_TEMPLATE(HAVE_INVERSE_HYPERBOLIC, [Define if you have the functions acosh, asinh, and atanh.]) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-07 08:20:07 +0000 +++ src/ChangeLog 2012-09-07 08:46:44 +0000 @@ -1,3 +1,20 @@ +2012-09-07 Paul Eggert + + More signal-handler cleanup (Bug#12327). + * floatfns.c: Comment fix. + * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER. + SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right, + and anyway the declaration is harmless even if SIGDANGER is not defined. + * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD || + defined BROKEN_FIONREAD). systty.h formerly did this, but other + source files not surprisingly expected syssignal.h to define, or + not define, SIGIO, and it's cleaner to do it that way, for consistency. + Include , for FIONREAD. + * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job. + This eliminates a problem whereby other files mysteriously had + to include "syssignal.h" before including "systty.h" if they + wanted to use "#ifdef SIGIO". + 2012-09-07 Eli Zaretskii * w32proc.c (sigaction): New function, emulates Posix 'sigaction'. === modified file 'src/floatfns.c' --- src/floatfns.c 2012-09-07 01:27:44 +0000 +++ src/floatfns.c 2012-09-07 08:46:44 +0000 @@ -38,7 +38,7 @@ This has no effect if HAVE_MATHERR is defined. Define FLOAT_CHECK_DOMAIN if the float library doesn't handle errors by - either setting errno, or signaling SIGFPE/SIGILL. Otherwise, domain and + either setting errno, or signaling SIGFPE. Otherwise, domain and range checking will happen before calling the float routines. This has no effect if HAVE_MATHERR is defined (since matherr will be called when a domain error occurs.) === modified file 'src/lisp.h' --- src/lisp.h 2012-09-05 21:33:53 +0000 +++ src/lisp.h 2012-09-07 08:46:44 +0000 @@ -3221,9 +3221,7 @@ extern Lisp_Object command_loop_1 (void); extern Lisp_Object recursive_edit_1 (void); extern void record_auto_save (void); -#ifdef SIGDANGER extern void force_auto_save_soon (void); -#endif extern void init_keyboard (void); extern void syms_of_keyboard (void); extern void keys_of_keyboard (void); === modified file 'src/syssignal.h' --- src/syssignal.h 2012-09-07 06:47:30 +0000 +++ src/syssignal.h 2012-09-07 08:46:44 +0000 @@ -38,9 +38,12 @@ _Noreturn void croak (char *); #endif -#if defined (SIGIO) && defined (BROKEN_SIGIO) +/* Interrupt input is not used if there is no FIONREAD. */ +#include +#if defined BROKEN_SIGIO || ! defined FIONREAD || defined BROKEN_FIONREAD # undef SIGIO #endif + /* These are only used by AIX */ #if defined (SIGPOLL) && defined (BROKEN_SIGPOLL) #undef SIGPOLL === modified file 'src/systty.h' --- src/systty.h 2012-08-08 15:53:52 +0000 +++ src/systty.h 2012-09-07 08:46:44 +0000 @@ -47,11 +47,6 @@ #undef ASYNC #endif -/* Interrupt input is not used if there is no FIONREAD. */ -#ifndef FIONREAD -#undef SIGIO -#endif - /* Try to establish the correct character to disable terminal functions in a system-independent manner. Note that USG (at least) define ------------------------------------------------------------ revno: 109920 committer: Chong Yidong branch nick: trunk timestamp: Fri 2012-09-07 16:36:25 +0800 message: * lisp/simple.el (count-words--buffer-message): Fix narrowing check. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-07 05:06:05 +0000 +++ lisp/ChangeLog 2012-09-07 08:36:25 +0000 @@ -1,5 +1,7 @@ 2012-09-07 Chong Yidong + * simple.el (count-words--buffer-message): Fix narrowing check. + * help.el (describe-key-briefly): Allow the message to be seen when invoked from the minibuffer (Bug#7014). === modified file 'lisp/simple.el' --- lisp/simple.el 2012-09-02 00:56:03 +0000 +++ lisp/simple.el 2012-09-07 08:36:25 +0000 @@ -1008,7 +1008,7 @@ (defun count-words--buffer-message () (count-words--message - (if (= (point-max) (1+ (buffer-size))) + (if (= (- (point-max) (point-min)) (buffer-size)) "Buffer" "Narrowed part of buffer") (point-min) (point-max))) ------------------------------------------------------------ revno: 109919 fixes bug: http://debbugs.gnu.org/12327 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2012-09-07 11:20:07 +0300 message: MS-Windows followup for revision 109909, signal-handler cleanup. src/w32proc.c (sigaction): New function, emulates Posix 'sigaction'. src/w32.c (sigemptyset): Empty the set. (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions. nt/inc/ms-w32.h (struct sigaction): Declare sa_handler __cdecl. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-09-05 00:17:57 +0000 +++ nt/ChangeLog 2012-09-07 08:20:07 +0000 @@ -1,3 +1,7 @@ +2012-09-07 Eli Zaretskii + + * inc/ms-w32.h (struct sigaction): Declare sa_handler __cdecl. + 2012-09-05 Juanma Barranquero * config.nt: Sync with autogen/config.in. === modified file 'nt/inc/ms-w32.h' --- nt/inc/ms-w32.h 2012-09-04 17:34:54 +0000 +++ nt/inc/ms-w32.h 2012-09-07 08:20:07 +0000 @@ -127,7 +127,7 @@ struct sigaction { int sa_flags; - void (*sa_handler)(int); + void (_CALLBACK_ *sa_handler)(int); sigset_t sa_mask; }; #define SIG_BLOCK 1 === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-07 07:24:08 +0000 +++ src/ChangeLog 2012-09-07 08:20:07 +0000 @@ -1,5 +1,10 @@ 2012-09-07 Eli Zaretskii + * w32proc.c (sigaction): New function, emulates Posix 'sigaction'. + + * w32.c (sigemptyset): Empty the set. + (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions. + * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT. 2012-09-07 Dmitry Antipov === modified file 'src/w32.c' --- src/w32.c 2012-09-04 17:34:54 +0000 +++ src/w32.c 2012-09-07 08:20:07 +0000 @@ -1530,34 +1530,10 @@ } /* Routines that are no-ops on NT but are defined to get Emacs to compile. */ - -int -sigsetmask (int signal_mask) -{ - return 0; -} - -int -sigmask (int sig) -{ - return 0; -} - -int -sigblock (int sig) -{ - return 0; -} - -int -sigunblock (int sig) -{ - return 0; -} - int sigemptyset (sigset_t *set) { + *set = 0; return 0; } === modified file 'src/w32proc.c' --- src/w32proc.c 2012-09-04 17:34:54 +0000 +++ src/w32proc.c 2012-09-07 08:20:07 +0000 @@ -103,6 +103,29 @@ return old; } +/* Emulate sigaction. */ +int +sigaction (int sig, const struct sigaction *act, struct sigaction *oact) +{ + signal_handler old; + + if (sig != SIGCHLD) + { + errno = EINVAL; + return -1; + } + old = sig_handlers[sig]; + if (act) + sig_handlers[sig] = act->sa_handler; + if (oact) + { + oact->sa_handler = old; + oact->sa_flags = 0; + oact->sa_mask = empty_mask; + } + return 0; +} + /* Defined in which conflicts with the local copy */ #define _P_NOWAIT 1 ------------------------------------------------------------ revno: 109918 fixes bug: http://debbugs.gnu.org/12327 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2012-09-07 10:24:08 +0300 message: Fix compilation failure under ENABLE_CHECKING. src/alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-07 07:05:56 +0000 +++ src/ChangeLog 2012-09-07 07:24:08 +0000 @@ -1,3 +1,7 @@ +2012-09-07 Eli Zaretskii + + * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT. + 2012-09-07 Dmitry Antipov * alloc.c (mark_buffer): Revert unsafe marking optimization. === modified file 'src/alloc.c' --- src/alloc.c 2012-09-07 07:05:56 +0000 +++ src/alloc.c 2012-09-07 07:24:08 +0000 @@ -26,6 +26,10 @@ #include /* For CHAR_BIT. */ #include +#ifdef ENABLE_CHECKING +#include /* For SIGABRT. */ +#endif + #ifdef HAVE_PTHREAD #include #endif ------------------------------------------------------------ revno: 109917 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2012-09-07 11:05:56 +0400 message: * alloc.c (mark_buffer): Revert unsafe marking optimization. (mark_object): Likewise for frame objects. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-07 06:47:30 +0000 +++ src/ChangeLog 2012-09-07 07:05:56 +0000 @@ -1,3 +1,8 @@ +2012-09-07 Dmitry Antipov + + * alloc.c (mark_buffer): Revert unsafe marking optimization. + (mark_object): Likewise for frame objects. + 2012-09-07 Paul Eggert * syssignal.h (handle_on_main_thread): Always declare, === modified file 'src/alloc.c' --- src/alloc.c 2012-09-07 01:27:44 +0000 +++ src/alloc.c 2012-09-07 07:05:56 +0000 @@ -5842,29 +5842,23 @@ static void mark_buffer (struct buffer *buffer) { - if (NILP (BVAR (buffer, name))) - /* If the buffer is killed, mark just the buffer itself. */ - VECTOR_MARK (buffer); - else - { - /* This is handled much like other pseudovectors... */ - mark_vectorlike ((struct Lisp_Vector *) buffer); - - /* ...but there are some buffer-specific things. */ - - MARK_INTERVAL_TREE (buffer_intervals (buffer)); - - /* For now, we just don't mark the undo_list. It's done later in - a special way just before the sweep phase, and after stripping - some of its elements that are not needed any more. */ - - mark_overlay (buffer->overlays_before); - mark_overlay (buffer->overlays_after); - - /* If this is an indirect buffer, mark its base buffer. */ - if (buffer->base_buffer && !VECTOR_MARKED_P (buffer->base_buffer)) - mark_buffer (buffer->base_buffer); - } + /* This is handled much like other pseudovectors... */ + mark_vectorlike ((struct Lisp_Vector *) buffer); + + /* ...but there are some buffer-specific things. */ + + MARK_INTERVAL_TREE (buffer_intervals (buffer)); + + /* For now, we just don't mark the undo_list. It's done later in + a special way just before the sweep phase, and after stripping + some of its elements that are not needed any more. */ + + mark_overlay (buffer->overlays_before); + mark_overlay (buffer->overlays_after); + + /* If this is an indirect buffer, mark its base buffer. */ + if (buffer->base_buffer && !VECTOR_MARKED_P (buffer->base_buffer)) + mark_buffer (buffer->base_buffer); } /* Determine type of generic Lisp_Object and mark it accordingly. */ @@ -6003,26 +5997,14 @@ break; case PVEC_FRAME: - { - struct frame *f = (struct frame *) ptr; - - if (FRAME_LIVE_P (f)) - { - mark_vectorlike (ptr); - mark_face_cache (f->face_cache); - } - else - /* If the frame is deleted, mark just the frame itself. */ - VECTOR_MARK (ptr); - } + mark_vectorlike (ptr); + mark_face_cache (((struct frame *) ptr)->face_cache); break; case PVEC_WINDOW: { struct window *w = (struct window *) ptr; - - /* Even if the window is deleted, we can't mark just the window - itself because set-window-configuration can resurrect it. */ + mark_vectorlike (ptr); /* Mark glyphs for leaf windows. Marking window matrices is sufficient because frame matrices ------------------------------------------------------------ revno: 109916 committer: Paul Eggert branch nick: trunk timestamp: Thu 2012-09-06 23:47:30 -0700 message: * syssignal.h (handle_on_main_thread): Always declare, even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined. This ports to platforms without HAVE_PTHREAD. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-07 01:27:44 +0000 +++ src/ChangeLog 2012-09-07 06:47:30 +0000 @@ -1,3 +1,9 @@ +2012-09-07 Paul Eggert + + * syssignal.h (handle_on_main_thread): Always declare, + even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined. + This ports to platforms without HAVE_PTHREAD. + 2012-09-06 Paul Eggert Signal-handler cleanup (Bug#12327). === modified file 'src/syssignal.h' --- src/syssignal.h 2012-09-07 01:27:44 +0000 +++ src/syssignal.h 2012-09-07 06:47:30 +0000 @@ -84,5 +84,6 @@ #ifdef FORWARD_SIGNAL_TO_MAIN_THREAD extern pthread_t main_thread; +#endif + void handle_on_main_thread (int, signal_handler_t); -#endif