diff options
| author | Joakim Verona | 2013-02-16 00:04:20 +0100 |
|---|---|---|
| committer | Joakim Verona | 2013-02-16 00:04:20 +0100 |
| commit | 613fda6799a504feff2d5a930ef7998125498d10 (patch) | |
| tree | 8c7bee1d673435d544d74477ecf20d657b7fa489 | |
| parent | 73b3f91cfcc9b42d2851ced24d7ba3d17e4c6d00 (diff) | |
| parent | f852f6d8c0db494ccb21b6020a5ebbeaa685a948 (diff) | |
| download | emacs-613fda6799a504feff2d5a930ef7998125498d10.tar.gz emacs-613fda6799a504feff2d5a930ef7998125498d10.zip | |
auto upstream
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rwxr-xr-x | autogen/configure | 6 | ||||
| -rw-r--r-- | configure.ac | 5 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/lispref/modes.texi | 5 | ||||
| -rw-r--r-- | lisp/ChangeLog | 52 | ||||
| -rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 58 | ||||
| -rw-r--r-- | lisp/icomplete.el | 4 | ||||
| -rw-r--r-- | lisp/ido.el | 2 | ||||
| -rw-r--r-- | lisp/iswitchb.el | 2 | ||||
| -rw-r--r-- | lisp/net/goto-addr.el | 23 | ||||
| -rw-r--r-- | lisp/play/fortune.el | 19 | ||||
| -rw-r--r-- | lisp/progmodes/python.el | 129 | ||||
| -rw-r--r-- | lisp/xml.el | 4 | ||||
| -rw-r--r-- | src/ChangeLog | 56 | ||||
| -rw-r--r-- | src/composite.c | 7 | ||||
| -rw-r--r-- | src/keyboard.c | 7 | ||||
| -rw-r--r-- | src/lisp.h | 8 | ||||
| -rw-r--r-- | src/print.c | 5 | ||||
| -rw-r--r-- | src/process.c | 6 | ||||
| -rw-r--r-- | src/search.c | 20 | ||||
| -rw-r--r-- | src/w32.c | 95 | ||||
| -rw-r--r-- | src/w32proc.c | 49 | ||||
| -rw-r--r-- | src/xdisp.c | 22 | ||||
| -rw-r--r-- | src/xfaces.c | 2 |
25 files changed, 414 insertions, 181 deletions
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-02-15 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Fix AIX port (Bug#13650). | ||
| 4 | * configure.ac (DATA_START, DATA_SEG_BITS): Set to 0x20000000 on AIX. | ||
| 5 | |||
| 1 | 2013-02-12 Eli Zaretskii <eliz@gnu.org> | 6 | 2013-02-12 Eli Zaretskii <eliz@gnu.org> |
| 2 | 7 | ||
| 3 | * lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/memrchr.$(O). | 8 | * lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/memrchr.$(O). |
diff --git a/autogen/configure b/autogen/configure index 8f58b87ab20..0ba98637fa4 100755 --- a/autogen/configure +++ b/autogen/configure | |||
| @@ -15815,6 +15815,12 @@ case $opsys in | |||
| 15815 | 15815 | ||
| 15816 | ;; | 15816 | ;; |
| 15817 | 15817 | ||
| 15818 | aix*) | ||
| 15819 | $as_echo "#define DATA_START 0x20000000" >>confdefs.h | ||
| 15820 | |||
| 15821 | $as_echo "#define DATA_SEG_BITS 0x20000000" >>confdefs.h | ||
| 15822 | |||
| 15823 | ;; | ||
| 15818 | hpux*) | 15824 | hpux*) |
| 15819 | $as_echo "#define DATA_START 0x40000000" >>confdefs.h | 15825 | $as_echo "#define DATA_START 0x40000000" >>confdefs.h |
| 15820 | 15826 | ||
diff --git a/configure.ac b/configure.ac index ce96ca042ca..146166fbe45 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -3811,6 +3811,11 @@ case $opsys in | |||
| 3811 | AC_DEFINE(DATA_START, [({ extern int data_start; (char *) &data_start; })]) | 3811 | AC_DEFINE(DATA_START, [({ extern int data_start; (char *) &data_start; })]) |
| 3812 | ;; | 3812 | ;; |
| 3813 | 3813 | ||
| 3814 | aix*) | ||
| 3815 | dnl This works with 32-bit executables; Emacs doesn't support 64-bit. | ||
| 3816 | AC_DEFINE(DATA_START, [0x20000000]) | ||
| 3817 | AC_DEFINE(DATA_SEG_BITS, [0x20000000]) | ||
| 3818 | ;; | ||
| 3814 | hpux*) | 3819 | hpux*) |
| 3815 | dnl The data segment on this machine always starts at address 0x40000000. | 3820 | dnl The data segment on this machine always starts at address 0x40000000. |
| 3816 | AC_DEFINE(DATA_START, [0x40000000]) | 3821 | AC_DEFINE(DATA_START, [0x40000000]) |
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index be1bdfcfa3d..d8a08ee5d3e 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2013-02-15 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * modes.texi (Basic Major Modes): 'z' no longer bound in special-mode. | ||
| 4 | |||
| 1 | 2013-02-13 Glenn Morris <rgm@gnu.org> | 5 | 2013-02-13 Glenn Morris <rgm@gnu.org> |
| 2 | 6 | ||
| 3 | * objects.texi (Char-Table Type): Add footnote about #^^. | 7 | * objects.texi (Char-Table Type): Add footnote about #^^. |
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 5f1eb8619ee..7d42d2591d6 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi | |||
| @@ -905,9 +905,8 @@ modes derived from Special mode are given a @code{mode-class} property | |||
| 905 | of @code{special} (@pxref{Major Mode Conventions}). | 905 | of @code{special} (@pxref{Major Mode Conventions}). |
| 906 | 906 | ||
| 907 | Special mode sets the buffer to read-only. Its keymap defines several | 907 | Special mode sets the buffer to read-only. Its keymap defines several |
| 908 | common bindings, including @kbd{q} for @code{quit-window}, @kbd{z} for | 908 | common bindings, including @kbd{q} for @code{quit-window} and @kbd{g} |
| 909 | @code{kill-this-buffer}, and @kbd{g} for @code{revert-buffer} | 909 | for @code{revert-buffer} (@pxref{Reverting}). |
| 910 | (@pxref{Reverting}). | ||
| 911 | 910 | ||
| 912 | An example of a major mode derived from Special mode is Buffer Menu | 911 | An example of a major mode derived from Special mode is Buffer Menu |
| 913 | mode, which is used by the @file{*Buffer List*} buffer. @xref{List | 912 | mode, which is used by the @file{*Buffer List*} buffer. @xref{List |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5a752fe0c3a..99704a0b532 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,55 @@ | |||
| 1 | 2013-02-15 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | * emacs-lisp/easy-mmode.el (define-globalized-minor-mode): When a | ||
| 4 | global minor mode has been enabled, call the minor mode function | ||
| 5 | for a new buffer once only, after the major mode hook, whilst | ||
| 6 | allowing that hook explicitly to disable the minor mode. | ||
| 7 | (MODE-disable-in-buffer): new (generated) function. | ||
| 8 | (disable-MODE): new (generated) buffer local variable. | ||
| 9 | |||
| 10 | 2013-02-15 Jambunathan K <kjambunathan@gmail.com> | ||
| 11 | |||
| 12 | * iswitchb.el (iswitchb-read-buffer): Bind `C-.' and `C-,' to | ||
| 13 | `iswitchb-next-match' and `iswitchb-prev-match' resply. | ||
| 14 | |||
| 15 | * ido.el (ido-init-completion-maps): Bind `C-.' and `C-,' to | ||
| 16 | `ido-next-match' and `ido-prev-match' resply. | ||
| 17 | |||
| 18 | * icomplete.el (icomplete-minibuffer-map): Unbind `C-s' and `C-r'. | ||
| 19 | Bind `C-.' and `C-,' to `icomplete-forward-completions' and | ||
| 20 | `icomplete-backward-completions' (Bug#13708). | ||
| 21 | |||
| 22 | 2013-02-15 Michael Albinus <michael.albinus@gmx.de> | ||
| 23 | |||
| 24 | * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix. | ||
| 25 | |||
| 26 | 2013-02-15 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 27 | |||
| 28 | * net/goto-addr.el (goto-address-fontify): Add start and end args. | ||
| 29 | (goto-address-fontify-region): Use them instead of narrowing, so | ||
| 30 | syntax-ppss has access to the whole buffer. | ||
| 31 | |||
| 32 | 2013-02-15 Fabián Ezequiel Gallina <fgallina@cuca> | ||
| 33 | |||
| 34 | * progmodes/python.el: Explain how to restore "cc-mode"-like | ||
| 35 | forward-sexp movement in header documentation (Bug#13642). | ||
| 36 | (python-nav--forward-sexp): Behave like emacs-lisp-mode in | ||
| 37 | comments and strings (GH bug 114). | ||
| 38 | |||
| 39 | 2013-02-15 Fabián Ezequiel Gallina <fgallina@cuca> | ||
| 40 | |||
| 41 | * progmodes/python.el (python-info-current-defun): Fix current | ||
| 42 | defun detection (Bug#13618). | ||
| 43 | |||
| 44 | 2013-02-15 Chong Yidong <cyd@gnu.org> | ||
| 45 | |||
| 46 | * xml.el (xml-parse-string): Fix typo in handling of bad character | ||
| 47 | references. | ||
| 48 | |||
| 49 | 2013-02-15 Glenn Morris <rgm@gnu.org> | ||
| 50 | |||
| 51 | * play/fortune.el (fortune-compile): Simplify and fix previous change. | ||
| 52 | |||
| 1 | 2013-02-14 Michael Albinus <michael.albinus@gmx.de> | 53 | 2013-02-14 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 54 | ||
| 3 | * net/tramp.el (tramp-debug-message): Add | 55 | * net/tramp.el (tramp-debug-message): Add |
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 9173d148c6a..2088e690228 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el | |||
| @@ -132,13 +132,14 @@ BODY contains code to execute each time the mode is enabled or disabled. | |||
| 132 | :require SYM Same as in `defcustom'. | 132 | :require SYM Same as in `defcustom'. |
| 133 | :variable PLACE The location to use instead of the variable MODE to store | 133 | :variable PLACE The location to use instead of the variable MODE to store |
| 134 | the state of the mode. This can be simply a different | 134 | the state of the mode. This can be simply a different |
| 135 | named variable, or more generally anything that can be used | 135 | named variable, or a generalized variable. |
| 136 | with the CL macro `setf'. PLACE can also be of the form | 136 | PLACE can also be of the form \(GET . SET), where GET is |
| 137 | \(GET . SET), where GET is an expression that returns the | 137 | an expression that returns the current state, and SET is |
| 138 | current state, and SET is a function that takes one argument, | 138 | a function that takes one argument, the new state, and |
| 139 | the new state, and sets it. If you specify a :variable, | 139 | sets it. If you specify a :variable, this function does |
| 140 | this function does not define a MODE variable (nor any of | 140 | not define a MODE variable (nor any of the terms used |
| 141 | the terms used in :variable). | 141 | in :variable). |
| 142 | |||
| 142 | :after-hook A single lisp form which is evaluated after the mode hooks | 143 | :after-hook A single lisp form which is evaluated after the mode hooks |
| 143 | have been run. It should not be quoted. | 144 | have been run. It should not be quoted. |
| 144 | 145 | ||
| @@ -340,9 +341,14 @@ If MODE's set-up depends on the major mode in effect when it was | |||
| 340 | enabled, then disabling and reenabling MODE should make MODE work | 341 | enabled, then disabling and reenabling MODE should make MODE work |
| 341 | correctly with the current major mode. This is important to | 342 | correctly with the current major mode. This is important to |
| 342 | prevent problems with derived modes, that is, major modes that | 343 | prevent problems with derived modes, that is, major modes that |
| 343 | call another major mode in their body." | 344 | call another major mode in their body. |
| 345 | |||
| 346 | When a major mode is initialized, MODE is actually turned on just | ||
| 347 | after running the major mode's hook. However, MODE is not turned | ||
| 348 | on if the hook has explicitly disabled it." | ||
| 344 | (declare (doc-string 2)) | 349 | (declare (doc-string 2)) |
| 345 | (let* ((global-mode-name (symbol-name global-mode)) | 350 | (let* ((global-mode-name (symbol-name global-mode)) |
| 351 | (mode-name (symbol-name mode)) | ||
| 346 | (pretty-name (easy-mmode-pretty-mode-name mode)) | 352 | (pretty-name (easy-mmode-pretty-mode-name mode)) |
| 347 | (pretty-global-name (easy-mmode-pretty-mode-name global-mode)) | 353 | (pretty-global-name (easy-mmode-pretty-mode-name global-mode)) |
| 348 | (group nil) | 354 | (group nil) |
| @@ -353,6 +359,10 @@ call another major mode in their body." | |||
| 353 | (MODE-check-buffers | 359 | (MODE-check-buffers |
| 354 | (intern (concat global-mode-name "-check-buffers"))) | 360 | (intern (concat global-mode-name "-check-buffers"))) |
| 355 | (MODE-cmhh (intern (concat global-mode-name "-cmhh"))) | 361 | (MODE-cmhh (intern (concat global-mode-name "-cmhh"))) |
| 362 | (MODE-disable-in-buffer | ||
| 363 | (intern (concat global-mode-name "-disable-in-buffer"))) | ||
| 364 | (minor-MODE-hook (intern (concat mode-name "-hook"))) | ||
| 365 | (disable-MODE (intern (concat "disable-" mode-name))) | ||
| 356 | (MODE-major-mode (intern (concat (symbol-name mode) "-major-mode"))) | 366 | (MODE-major-mode (intern (concat (symbol-name mode) "-major-mode"))) |
| 357 | keyw) | 367 | keyw) |
| 358 | 368 | ||
| @@ -396,8 +406,6 @@ See `%s' for more information on %s." | |||
| 396 | (progn | 406 | (progn |
| 397 | (add-hook 'after-change-major-mode-hook | 407 | (add-hook 'after-change-major-mode-hook |
| 398 | ',MODE-enable-in-buffers) | 408 | ',MODE-enable-in-buffers) |
| 399 | (add-hook 'change-major-mode-after-body-hook | ||
| 400 | ',MODE-enable-in-buffers) | ||
| 401 | (add-hook 'find-file-hook ',MODE-check-buffers) | 409 | (add-hook 'find-file-hook ',MODE-check-buffers) |
| 402 | (add-hook 'change-major-mode-hook ',MODE-cmhh)) | 410 | (add-hook 'change-major-mode-hook ',MODE-cmhh)) |
| 403 | (remove-hook 'after-change-major-mode-hook ',MODE-enable-in-buffers) | 411 | (remove-hook 'after-change-major-mode-hook ',MODE-enable-in-buffers) |
| @@ -415,6 +423,10 @@ See `%s' for more information on %s." | |||
| 415 | ;; up-to-here. | 423 | ;; up-to-here. |
| 416 | :autoload-end | 424 | :autoload-end |
| 417 | 425 | ||
| 426 | ;; A function which checks whether MODE has been disabled in the major | ||
| 427 | ;; mode hook which has just been run. | ||
| 428 | (add-hook ',minor-MODE-hook ',MODE-disable-in-buffer) | ||
| 429 | |||
| 418 | ;; List of buffers left to process. | 430 | ;; List of buffers left to process. |
| 419 | (defvar ,MODE-buffers nil) | 431 | (defvar ,MODE-buffers nil) |
| 420 | 432 | ||
| @@ -423,14 +435,15 @@ See `%s' for more information on %s." | |||
| 423 | (dolist (buf ,MODE-buffers) | 435 | (dolist (buf ,MODE-buffers) |
| 424 | (when (buffer-live-p buf) | 436 | (when (buffer-live-p buf) |
| 425 | (with-current-buffer buf | 437 | (with-current-buffer buf |
| 426 | (unless (eq ,MODE-major-mode major-mode) | 438 | (if ,disable-MODE |
| 427 | (if ,mode | 439 | (if ,mode (,mode -1)) |
| 428 | (progn | 440 | (unless (eq ,MODE-major-mode major-mode) |
| 429 | (,mode -1) | 441 | (if ,mode |
| 430 | (,turn-on) | 442 | (progn |
| 431 | (setq ,MODE-major-mode major-mode)) | 443 | (,mode -1) |
| 432 | (,turn-on) | 444 | (,turn-on)) |
| 433 | (setq ,MODE-major-mode major-mode))))))) | 445 | (,turn-on)))) |
| 446 | (setq ,MODE-major-mode major-mode))))) | ||
| 434 | (put ',MODE-enable-in-buffers 'definition-name ',global-mode) | 447 | (put ',MODE-enable-in-buffers 'definition-name ',global-mode) |
| 435 | 448 | ||
| 436 | (defun ,MODE-check-buffers () | 449 | (defun ,MODE-check-buffers () |
| @@ -443,7 +456,14 @@ See `%s' for more information on %s." | |||
| 443 | (defun ,MODE-cmhh () | 456 | (defun ,MODE-cmhh () |
| 444 | (add-to-list ',MODE-buffers (current-buffer)) | 457 | (add-to-list ',MODE-buffers (current-buffer)) |
| 445 | (add-hook 'post-command-hook ',MODE-check-buffers)) | 458 | (add-hook 'post-command-hook ',MODE-check-buffers)) |
| 446 | (put ',MODE-cmhh 'definition-name ',global-mode)))) | 459 | (put ',MODE-cmhh 'definition-name ',global-mode) |
| 460 | ;; disable-MODE is set in MODE-disable-in-buffer and cleared by | ||
| 461 | ;; kill-all-local-variables. | ||
| 462 | (defvar-local ,disable-MODE nil) | ||
| 463 | (defun ,MODE-disable-in-buffer () | ||
| 464 | (unless ,mode | ||
| 465 | (setq ,disable-MODE t))) | ||
| 466 | (put ',MODE-disable-in-buffer 'definition-name ',global-mode)))) | ||
| 447 | 467 | ||
| 448 | ;;; | 468 | ;;; |
| 449 | ;;; easy-mmode-defmap | 469 | ;;; easy-mmode-defmap |
diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 1f9b4a3afe6..73049df097d 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el | |||
| @@ -168,8 +168,8 @@ except those on this list.") | |||
| 168 | (let ((map (make-sparse-keymap))) | 168 | (let ((map (make-sparse-keymap))) |
| 169 | (define-key map [?\M-\t] 'minibuffer-force-complete) | 169 | (define-key map [?\M-\t] 'minibuffer-force-complete) |
| 170 | (define-key map [?\C-j] 'minibuffer-force-complete-and-exit) | 170 | (define-key map [?\C-j] 'minibuffer-force-complete-and-exit) |
| 171 | (define-key map [?\C-s] 'icomplete-forward-completions) | 171 | (define-key map [?\C-.] 'icomplete-forward-completions) |
| 172 | (define-key map [?\C-r] 'icomplete-backward-completions) | 172 | (define-key map [?\C-,] 'icomplete-backward-completions) |
| 173 | map)) | 173 | map)) |
| 174 | 174 | ||
| 175 | (defun icomplete-forward-completions () | 175 | (defun icomplete-forward-completions () |
diff --git a/lisp/ido.el b/lisp/ido.el index 008561aa268..066d8276af5 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -1585,6 +1585,8 @@ This function also adds a hook to the minibuffer." | |||
| 1585 | (define-key map "\C-p" 'ido-toggle-prefix) | 1585 | (define-key map "\C-p" 'ido-toggle-prefix) |
| 1586 | (define-key map "\C-r" 'ido-prev-match) | 1586 | (define-key map "\C-r" 'ido-prev-match) |
| 1587 | (define-key map "\C-s" 'ido-next-match) | 1587 | (define-key map "\C-s" 'ido-next-match) |
| 1588 | (define-key map [?\C-.] 'ido-next-match) | ||
| 1589 | (define-key map [?\C-,] 'ido-prev-match) | ||
| 1588 | (define-key map "\C-t" 'ido-toggle-regexp) | 1590 | (define-key map "\C-t" 'ido-toggle-regexp) |
| 1589 | (define-key map "\C-z" 'ido-undo-merge-work-directory) | 1591 | (define-key map "\C-z" 'ido-undo-merge-work-directory) |
| 1590 | (define-key map [(control ?\s)] 'ido-restrict-to-matches) | 1592 | (define-key map [(control ?\s)] 'ido-restrict-to-matches) |
diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el index 93d589c7706..68749f1b012 100644 --- a/lisp/iswitchb.el +++ b/lisp/iswitchb.el | |||
| @@ -471,6 +471,8 @@ interfere with other minibuffer usage.") | |||
| 471 | (define-key map "?" 'iswitchb-completion-help) | 471 | (define-key map "?" 'iswitchb-completion-help) |
| 472 | (define-key map "\C-s" 'iswitchb-next-match) | 472 | (define-key map "\C-s" 'iswitchb-next-match) |
| 473 | (define-key map "\C-r" 'iswitchb-prev-match) | 473 | (define-key map "\C-r" 'iswitchb-prev-match) |
| 474 | (define-key map [?\C-.] 'iswitchb-next-match) | ||
| 475 | (define-key map [?\C-,] 'iswitchb-prev-match) | ||
| 474 | (define-key map "\t" 'iswitchb-complete) | 476 | (define-key map "\t" 'iswitchb-complete) |
| 475 | (define-key map "\C-j" 'iswitchb-select-buffer-text) | 477 | (define-key map "\C-j" 'iswitchb-select-buffer-text) |
| 476 | (define-key map "\C-t" 'iswitchb-toggle-regexp) | 478 | (define-key map "\C-t" 'iswitchb-toggle-regexp) |
diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el index 1005285917e..59e4da16619 100644 --- a/lisp/net/goto-addr.el +++ b/lisp/net/goto-addr.el | |||
| @@ -156,18 +156,19 @@ A value of t means there is no limit--fontify regardless of the size." | |||
| 156 | 156 | ||
| 157 | (defvar goto-address-prog-mode) | 157 | (defvar goto-address-prog-mode) |
| 158 | 158 | ||
| 159 | (defun goto-address-fontify () | 159 | (defun goto-address-fontify (&optional start end) |
| 160 | "Fontify the URLs and e-mail addresses in the current buffer. | 160 | "Fontify the URLs and e-mail addresses in the current buffer. |
| 161 | This function implements `goto-address-highlight-p' | 161 | This function implements `goto-address-highlight-p' |
| 162 | and `goto-address-fontify-p'." | 162 | and `goto-address-fontify-p'." |
| 163 | ;; Clean up from any previous go. | 163 | ;; Clean up from any previous go. |
| 164 | (goto-address-unfontify (point-min) (point-max)) | 164 | (goto-address-unfontify (or start (point-min)) (or end (point-max))) |
| 165 | (save-excursion | 165 | (save-excursion |
| 166 | (let ((inhibit-point-motion-hooks t)) | 166 | (let ((inhibit-point-motion-hooks t)) |
| 167 | (goto-char (point-min)) | 167 | (goto-char (or start (point-min))) |
| 168 | (when (or (eq t goto-address-fontify-maximum-size) | 168 | (when (or (eq t goto-address-fontify-maximum-size) |
| 169 | (< (- (point-max) (point)) goto-address-fontify-maximum-size)) | 169 | (< (- (or end (point-max)) (point)) |
| 170 | (while (re-search-forward goto-address-url-regexp nil t) | 170 | goto-address-fontify-maximum-size)) |
| 171 | (while (re-search-forward goto-address-url-regexp end t) | ||
| 171 | (let* ((s (match-beginning 0)) | 172 | (let* ((s (match-beginning 0)) |
| 172 | (e (match-end 0)) | 173 | (e (match-end 0)) |
| 173 | this-overlay) | 174 | this-overlay) |
| @@ -187,8 +188,8 @@ and `goto-address-fontify-p'." | |||
| 187 | (overlay-put this-overlay | 188 | (overlay-put this-overlay |
| 188 | 'keymap goto-address-highlight-keymap) | 189 | 'keymap goto-address-highlight-keymap) |
| 189 | (overlay-put this-overlay 'goto-address t)))) | 190 | (overlay-put this-overlay 'goto-address t)))) |
| 190 | (goto-char (point-min)) | 191 | (goto-char (or start (point-min))) |
| 191 | (while (re-search-forward goto-address-mail-regexp nil t) | 192 | (while (re-search-forward goto-address-mail-regexp end t) |
| 192 | (let* ((s (match-beginning 0)) | 193 | (let* ((s (match-beginning 0)) |
| 193 | (e (match-end 0)) | 194 | (e (match-end 0)) |
| 194 | this-overlay) | 195 | this-overlay) |
| @@ -212,11 +213,9 @@ and `goto-address-fontify-p'." | |||
| 212 | (defun goto-address-fontify-region (start end) | 213 | (defun goto-address-fontify-region (start end) |
| 213 | "Fontify URLs and e-mail addresses in the given region." | 214 | "Fontify URLs and e-mail addresses in the given region." |
| 214 | (save-excursion | 215 | (save-excursion |
| 215 | (save-restriction | 216 | (let ((beg-line (progn (goto-char start) (line-beginning-position))) |
| 216 | (let ((beg-line (progn (goto-char start) (line-beginning-position))) | 217 | (end-line (progn (goto-char end) (line-end-position)))) |
| 217 | (end-line (progn (goto-char end) (line-end-position)))) | 218 | (goto-address-fontify beg-line end-line)))) |
| 218 | (narrow-to-region beg-line end-line) | ||
| 219 | (goto-address-fontify))))) | ||
| 220 | 219 | ||
| 221 | ;; code to find and goto addresses; much of this has been blatantly | 220 | ;; code to find and goto addresses; much of this has been blatantly |
| 222 | ;; snarfed from browse-url.el | 221 | ;; snarfed from browse-url.el |
diff --git a/lisp/play/fortune.el b/lisp/play/fortune.el index 0920012b280..cb58c0d0af0 100644 --- a/lisp/play/fortune.el +++ b/lisp/play/fortune.el | |||
| @@ -244,17 +244,14 @@ the value of `fortune-file'. This currently cannot handle directories." | |||
| 244 | (let* ((fortune-file (expand-file-name (substitute-in-file-name file))) | 244 | (let* ((fortune-file (expand-file-name (substitute-in-file-name file))) |
| 245 | (fortune-dat (expand-file-name | 245 | (fortune-dat (expand-file-name |
| 246 | (substitute-in-file-name | 246 | (substitute-in-file-name |
| 247 | (concat fortune-file fortune-database-extension)))) | 247 | (concat fortune-file fortune-database-extension))))) |
| 248 | (fortune-dat-exist (file-exists-p fortune-dat))) | 248 | (cond ((file-exists-p fortune-file) |
| 249 | (cond ((file-exists-p fortune-file) | 249 | (cond ((file-newer-than-file-p fortune-file fortune-dat) |
| 250 | (if (or (not fortune-dat-exist) | 250 | (message "Compiling new fortune database %s" fortune-dat) |
| 251 | (and fortune-dat-exist | 251 | (shell-command |
| 252 | (file-newer-than-file-p fortune-file fortune-dat))) | 252 | (concat fortune-strfile fortune-strfile-options |
| 253 | (message "Compiling new fortune database %s" fortune-dat) | 253 | " " fortune-file fortune-quiet-strfile-options))))) |
| 254 | (shell-command | 254 | (t (error "Can't compile fortune file %s" fortune-file))))) |
| 255 | (concat fortune-strfile fortune-strfile-options | ||
| 256 | " " fortune-file fortune-quiet-strfile-options)))) | ||
| 257 | (t (error "Can't compile fortune file %s" fortune-file))))) | ||
| 258 | 255 | ||
| 259 | 256 | ||
| 260 | ;;; ************** | 257 | ;;; ************** |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 35c5ba19e33..eadb06fa61e 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -54,8 +54,13 @@ | |||
| 54 | ;; `python-nav-beginning-of-statement', `python-nav-end-of-statement', | 54 | ;; `python-nav-beginning-of-statement', `python-nav-end-of-statement', |
| 55 | ;; `python-nav-beginning-of-block' and `python-nav-end-of-block' are | 55 | ;; `python-nav-beginning-of-block' and `python-nav-end-of-block' are |
| 56 | ;; included but no bound to any key. At last but not least the | 56 | ;; included but no bound to any key. At last but not least the |
| 57 | ;; specialized `python-nav-forward-sexp' allows easy | 57 | ;; specialized `python-nav-forward-sexp' allows easy navigation |
| 58 | ;; navigation between code blocks. | 58 | ;; between code blocks. If you prefer `cc-mode'-like `forward-sexp' |
| 59 | ;; movement, setting `forward-sexp-function' to nil is enough, You can | ||
| 60 | ;; do that using the `python-mode-hook': | ||
| 61 | |||
| 62 | ;; (add-hook 'python-mode-hook | ||
| 63 | ;; (lambda () (setq forward-sexp-function nil))) | ||
| 59 | 64 | ||
| 60 | ;; Shell interaction: is provided and allows you to execute easily any | 65 | ;; Shell interaction: is provided and allows you to execute easily any |
| 61 | ;; block of code of your current buffer in an inferior Python process. | 66 | ;; block of code of your current buffer in an inferior Python process. |
| @@ -1349,13 +1354,10 @@ backwards." | |||
| 1349 | 're-search-backward)) | 1354 | 're-search-backward)) |
| 1350 | (context-type (python-syntax-context-type))) | 1355 | (context-type (python-syntax-context-type))) |
| 1351 | (cond | 1356 | (cond |
| 1352 | ((eq context-type 'string) | 1357 | ((memq context-type '(string comment)) |
| 1353 | ;; Inside of a string, get out of it. | 1358 | ;; Inside of a string, get out of it. |
| 1354 | (while (and (funcall re-search-fn "[\"']" nil t) | 1359 | (let ((forward-sexp-function)) |
| 1355 | (python-syntax-context 'string)))) | 1360 | (forward-sexp dir))) |
| 1356 | ((eq context-type 'comment) | ||
| 1357 | ;; Inside of a comment, just move forward. | ||
| 1358 | (python-util-forward-comment dir)) | ||
| 1359 | ((or (eq context-type 'paren) | 1361 | ((or (eq context-type 'paren) |
| 1360 | (and forward-p (looking-at (python-rx open-paren))) | 1362 | (and forward-p (looking-at (python-rx open-paren))) |
| 1361 | (and (not forward-p) | 1363 | (and (not forward-p) |
| @@ -1378,16 +1380,16 @@ backwards." | |||
| 1378 | (save-excursion | 1380 | (save-excursion |
| 1379 | (python-nav-lisp-forward-sexp-safe dir) | 1381 | (python-nav-lisp-forward-sexp-safe dir) |
| 1380 | (point))) | 1382 | (point))) |
| 1381 | (next-sexp-context | 1383 | (next-sexp-context |
| 1382 | (save-excursion | 1384 | (save-excursion |
| 1383 | (goto-char next-sexp-pos) | 1385 | (goto-char next-sexp-pos) |
| 1384 | (cond | 1386 | (cond |
| 1385 | ((python-info-beginning-of-block-p) 'block-start) | 1387 | ((python-info-beginning-of-block-p) 'block-start) |
| 1386 | ((python-info-end-of-block-p) 'block-end) | 1388 | ((python-info-end-of-block-p) 'block-end) |
| 1387 | ((python-info-beginning-of-statement-p) 'statement-start) | 1389 | ((python-info-beginning-of-statement-p) 'statement-start) |
| 1388 | ((python-info-end-of-statement-p) 'statement-end) | 1390 | ((python-info-end-of-statement-p) 'statement-end) |
| 1389 | ((python-info-statement-starts-block-p) 'starts-block) | 1391 | ((python-info-statement-starts-block-p) 'starts-block) |
| 1390 | ((python-info-statement-ends-block-p) 'ends-block))))) | 1392 | ((python-info-statement-ends-block-p) 'ends-block))))) |
| 1391 | (if forward-p | 1393 | (if forward-p |
| 1392 | (cond ((and (not (eobp)) | 1394 | (cond ((and (not (eobp)) |
| 1393 | (python-info-current-line-empty-p)) | 1395 | (python-info-current-line-empty-p)) |
| @@ -1411,8 +1413,8 @@ backwards." | |||
| 1411 | (t (goto-char next-sexp-pos))) | 1413 | (t (goto-char next-sexp-pos))) |
| 1412 | (cond ((and (not (bobp)) | 1414 | (cond ((and (not (bobp)) |
| 1413 | (python-info-current-line-empty-p)) | 1415 | (python-info-current-line-empty-p)) |
| 1414 | (python-util-forward-comment dir) | 1416 | (python-util-forward-comment dir) |
| 1415 | (python-nav--forward-sexp dir)) | 1417 | (python-nav--forward-sexp dir)) |
| 1416 | ((eq context 'block-end) | 1418 | ((eq context 'block-end) |
| 1417 | (python-nav-beginning-of-block)) | 1419 | (python-nav-beginning-of-block)) |
| 1418 | ((eq context 'statement-end) | 1420 | ((eq context 'statement-end) |
| @@ -2946,40 +2948,61 @@ Optional argument INCLUDE-TYPE indicates to include the type of the defun. | |||
| 2946 | This function is compatible to be used as | 2948 | This function is compatible to be used as |
| 2947 | `add-log-current-defun-function' since it returns nil if point is | 2949 | `add-log-current-defun-function' since it returns nil if point is |
| 2948 | not inside a defun." | 2950 | not inside a defun." |
| 2949 | (save-restriction | 2951 | (save-restriction |
| 2950 | (widen) | 2952 | (widen) |
| 2951 | (save-excursion | 2953 | (save-excursion |
| 2952 | (end-of-line 1) | 2954 | (end-of-line 1) |
| 2953 | (let ((names) | 2955 | (let ((names) |
| 2954 | (starting-indentation | 2956 | (starting-indentation (current-indentation)) |
| 2955 | (save-excursion | 2957 | (starting-pos (point)) |
| 2956 | (and | 2958 | (first-run t) |
| 2957 | (python-nav-beginning-of-defun 1) | 2959 | (last-indent) |
| 2958 | ;; This extra number is just for checking code | 2960 | (type)) |
| 2959 | ;; against indentation to work well on first run. | 2961 | (catch 'exit |
| 2960 | (+ (current-indentation) 4)))) | 2962 | (while (python-nav-beginning-of-defun 1) |
| 2961 | (starting-point (point))) | 2963 | (when (and |
| 2962 | ;; Check point is inside a defun. | 2964 | (or (not last-indent) |
| 2963 | (when (and starting-indentation | 2965 | (< (current-indentation) last-indent)) |
| 2964 | (< starting-point | 2966 | (or |
| 2967 | (and first-run | ||
| 2965 | (save-excursion | 2968 | (save-excursion |
| 2966 | (python-nav-end-of-defun) | 2969 | ;; If this is the first run, we may add |
| 2967 | (point)))) | 2970 | ;; the current defun at point. |
| 2968 | (catch 'exit | 2971 | (setq first-run nil) |
| 2969 | (while (python-nav-beginning-of-defun 1) | 2972 | (goto-char starting-pos) |
| 2970 | (when (< (current-indentation) starting-indentation) | 2973 | (python-nav-beginning-of-statement) |
| 2971 | (setq starting-indentation (current-indentation)) | 2974 | (beginning-of-line 1) |
| 2972 | (setq names | 2975 | (looking-at-p |
| 2973 | (cons | 2976 | python-nav-beginning-of-defun-regexp))) |
| 2974 | (if (not include-type) | 2977 | (< starting-pos |
| 2975 | (match-string-no-properties 1) | 2978 | (save-excursion |
| 2976 | (mapconcat 'identity | 2979 | (let ((min-indent |
| 2977 | (split-string | 2980 | (+ (current-indentation) |
| 2978 | (match-string-no-properties 0)) " ")) | 2981 | python-indent-offset))) |
| 2979 | names))) | 2982 | (if (< starting-indentation min-indent) |
| 2980 | (and (= (current-indentation) 0) (throw 'exit t))))) | 2983 | ;; If the starting indentation is not |
| 2981 | (and names | 2984 | ;; within the min defun indent make the |
| 2982 | (mapconcat (lambda (string) string) names ".")))))) | 2985 | ;; check fail. |
| 2986 | starting-pos | ||
| 2987 | ;; Else go to the end of defun and add | ||
| 2988 | ;; up the current indentation to the | ||
| 2989 | ;; ending position. | ||
| 2990 | (python-nav-end-of-defun) | ||
| 2991 | (+ (point) | ||
| 2992 | (if (>= (current-indentation) min-indent) | ||
| 2993 | (1+ (current-indentation)) | ||
| 2994 | 0)))))))) | ||
| 2995 | (setq last-indent (current-indentation)) | ||
| 2996 | (if (or (not include-type) type) | ||
| 2997 | (setq names (cons (match-string-no-properties 1) names)) | ||
| 2998 | (let ((match (split-string (match-string-no-properties 0)))) | ||
| 2999 | (setq type (car match)) | ||
| 3000 | (setq names (cons (cadr match) names))))) | ||
| 3001 | ;; Stop searching ASAP. | ||
| 3002 | (and (= (current-indentation) 0) (throw 'exit t)))) | ||
| 3003 | (and names | ||
| 3004 | (concat (and type (format "%s " type)) | ||
| 3005 | (mapconcat 'identity names "."))))))) | ||
| 2983 | 3006 | ||
| 2984 | (defun python-info-current-symbol (&optional replace-self) | 3007 | (defun python-info-current-symbol (&optional replace-self) |
| 2985 | "Return current symbol using dotty syntax. | 3008 | "Return current symbol using dotty syntax. |
diff --git a/lisp/xml.el b/lisp/xml.el index 2232746f02a..a3d34670bfb 100644 --- a/lisp/xml.el +++ b/lisp/xml.el | |||
| @@ -611,7 +611,7 @@ references." | |||
| 611 | xml-validating-parser | 611 | xml-validating-parser |
| 612 | (error "XML: (Validity) Invalid character reference `%s'" | 612 | (error "XML: (Validity) Invalid character reference `%s'" |
| 613 | (match-string 0))) | 613 | (match-string 0))) |
| 614 | (replace-match (or (string val) xml-undefined-entity) t t)) | 614 | (replace-match (if val (string val) xml-undefined-entity) t t)) |
| 615 | ;; For an entity reference, search again from the start of | 615 | ;; For an entity reference, search again from the start of |
| 616 | ;; the replaced text, since the replacement can contain | 616 | ;; the replaced text, since the replacement can contain |
| 617 | ;; entity or character references, or markup. | 617 | ;; entity or character references, or markup. |
| @@ -620,7 +620,7 @@ references." | |||
| 620 | (and (null val) | 620 | (and (null val) |
| 621 | xml-validating-parser | 621 | xml-validating-parser |
| 622 | (error "XML: (Validity) Undefined entity `%s'" ref)) | 622 | (error "XML: (Validity) Undefined entity `%s'" ref)) |
| 623 | (replace-match (cdr val) t t) | 623 | (replace-match (or (cdr val) xml-undefined-entity) t t) |
| 624 | (goto-char (match-beginning 0))) | 624 | (goto-char (match-beginning 0))) |
| 625 | ;; Check for XML bombs. | 625 | ;; Check for XML bombs. |
| 626 | (and xml-entity-expansion-limit | 626 | (and xml-entity-expansion-limit |
diff --git a/src/ChangeLog b/src/ChangeLog index 8b1c429e406..6ff25edac50 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,59 @@ | |||
| 1 | 2013-02-15 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl. | ||
| 4 | |||
| 5 | 2013-02-15 Eli Zaretskii <eliz@gnu.org> | ||
| 6 | |||
| 7 | * keyboard.c (read_char): Fix calculation of auto-save time out | ||
| 8 | when auto-save-timeout is less than 4. (Bug#13720) | ||
| 9 | |||
| 10 | * w32proc.c (new_child): Free up to 2 slots of dead processes at a | ||
| 11 | time. Improve diagnostics in DebPrint. (Bug#13546) | ||
| 12 | |||
| 13 | * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname) | ||
| 14 | (sys_gethostbyname, sys_getservbyname, sys_getpeername) | ||
| 15 | (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname) | ||
| 16 | (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure, | ||
| 17 | make sure errno is set to an appropriate value. (Bug#13546) | ||
| 18 | (socket_to_fd): Add assertion against indexing fd_info[] with a | ||
| 19 | value that is out of bounds. | ||
| 20 | (sys_accept): If fd is negative, do not set up the child_process | ||
| 21 | structure for reading. | ||
| 22 | |||
| 23 | 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 24 | |||
| 25 | * composite.c (fill_gstring_header): Remove useless prototype. | ||
| 26 | Break long line. | ||
| 27 | * lisp.h (message_dolog, compile_pattern): Adjust prototype. | ||
| 28 | * print.c (PRINTDECLARE, print_object): | ||
| 29 | * search.c (compile_pattern, fast_looking_at, search_buffer): | ||
| 30 | (simple_search, boyer_moore, Freplace_match): | ||
| 31 | * xdisp.c (c_string_pos, number_of_chars, message_dolog): | ||
| 32 | (get_overlay_arrow_glyph_row, display_mode_element): | ||
| 33 | (decode_mode_spec_coding, message3): | ||
| 34 | * xfaces.c (face_at_string_position): Use bool for booleans. | ||
| 35 | Adjust comments. | ||
| 36 | |||
| 37 | 2013-02-15 Paul Eggert <eggert@cs.ucla.edu> | ||
| 38 | |||
| 39 | Fix AIX port (Bug#13650). | ||
| 40 | * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]: | ||
| 41 | Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set, | ||
| 42 | was #undeffed earlier, so it cannot be used as a macro here. | ||
| 43 | Use the constant and not the macro. | ||
| 44 | |||
| 45 | 2013-02-15 Eli Zaretskii <eliz@gnu.org> | ||
| 46 | |||
| 47 | * w32proc.c (new_child): If no vacant slots are found in | ||
| 48 | child_procs[], make another pass looking for slots whose process | ||
| 49 | has exited or died. (Bug#13546) | ||
| 50 | |||
| 51 | * w32.c (sys_pipe): When failing due to file descriptors above | ||
| 52 | MAXDESC, set errno to EMFILE. | ||
| 53 | (_sys_read_ahead): Update cp->status when failing to read serial | ||
| 54 | communications input, so that the status doesn't stay at | ||
| 55 | STATUS_READ_IN_PROGRESS. (Bug#13546) | ||
| 56 | |||
| 1 | 2013-02-14 Jan Djärv <jan.h.d@swipnet.se> | 57 | 2013-02-14 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 58 | ||
| 3 | * gtkutil.c (tb_size_cb): New function. | 59 | * gtkutil.c (tb_size_cb): New function. |
diff --git a/src/composite.c b/src/composite.c index 9bbd4550c7b..2da98cfc36c 100644 --- a/src/composite.c +++ b/src/composite.c | |||
| @@ -698,10 +698,6 @@ composition_gstring_from_id (ptrdiff_t id) | |||
| 698 | return HASH_VALUE (h, id); | 698 | return HASH_VALUE (h, id); |
| 699 | } | 699 | } |
| 700 | 700 | ||
| 701 | static Lisp_Object fill_gstring_header (Lisp_Object, Lisp_Object, | ||
| 702 | Lisp_Object, Lisp_Object, | ||
| 703 | Lisp_Object); | ||
| 704 | |||
| 705 | bool | 701 | bool |
| 706 | composition_gstring_p (Lisp_Object gstring) | 702 | composition_gstring_p (Lisp_Object gstring) |
| 707 | { | 703 | { |
| @@ -791,7 +787,8 @@ static Lisp_Object gstring_work; | |||
| 791 | static Lisp_Object gstring_work_headers; | 787 | static Lisp_Object gstring_work_headers; |
| 792 | 788 | ||
| 793 | static Lisp_Object | 789 | static Lisp_Object |
| 794 | fill_gstring_header (Lisp_Object header, Lisp_Object start, Lisp_Object end, Lisp_Object font_object, Lisp_Object string) | 790 | fill_gstring_header (Lisp_Object header, Lisp_Object start, Lisp_Object end, |
| 791 | Lisp_Object font_object, Lisp_Object string) | ||
| 795 | { | 792 | { |
| 796 | ptrdiff_t from, to, from_byte; | 793 | ptrdiff_t from, to, from_byte; |
| 797 | ptrdiff_t len, i; | 794 | ptrdiff_t len, i; |
diff --git a/src/keyboard.c b/src/keyboard.c index 5cd7e8473d2..0d60dc8929d 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -2660,9 +2660,10 @@ read_char (int commandflag, Lisp_Object map, | |||
| 2660 | && XINT (Vauto_save_timeout) > 0) | 2660 | && XINT (Vauto_save_timeout) > 0) |
| 2661 | { | 2661 | { |
| 2662 | Lisp_Object tem0; | 2662 | Lisp_Object tem0; |
| 2663 | EMACS_INT timeout = (delay_level | 2663 | EMACS_INT timeout = XFASTINT (Vauto_save_timeout); |
| 2664 | * min (XFASTINT (Vauto_save_timeout) / 4, | 2664 | |
| 2665 | MOST_POSITIVE_FIXNUM / delay_level)); | 2665 | timeout = min (timeout, MOST_POSITIVE_FIXNUM / delay_level * 4); |
| 2666 | timeout = delay_level * timeout / 4; | ||
| 2666 | save_getcjmp (save_jump); | 2667 | save_getcjmp (save_jump); |
| 2667 | restore_getcjmp (local_getcjmp); | 2668 | restore_getcjmp (local_getcjmp); |
| 2668 | tem0 = sit_for (make_number (timeout), 1, 1); | 2669 | tem0 = sit_for (make_number (timeout), 1, 1); |
diff --git a/src/lisp.h b/src/lisp.h index 154f1ec5e5f..c023d5b4892 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -510,13 +510,9 @@ static EMACS_INT const VALMASK | |||
| 510 | (XIL ((EMACS_INT) ((EMACS_UINT) (type) << VALBITS) \ | 510 | (XIL ((EMACS_INT) ((EMACS_UINT) (type) << VALBITS) \ |
| 511 | + ((intptr_t) (ptr) & VALMASK))) | 511 | + ((intptr_t) (ptr) & VALMASK))) |
| 512 | 512 | ||
| 513 | #if DATA_SEG_BITS | ||
| 514 | /* DATA_SEG_BITS forces extra bits to be or'd in with any pointers | 513 | /* DATA_SEG_BITS forces extra bits to be or'd in with any pointers |
| 515 | which were stored in a Lisp_Object. */ | 514 | which were stored in a Lisp_Object. */ |
| 516 | #define XPNTR(a) ((uintptr_t) ((XLI (a) & VALMASK)) | DATA_SEG_BITS)) | 515 | #define XPNTR(a) ((uintptr_t) ((XLI (a) & VALMASK)) | DATA_SEG_BITS)) |
| 517 | #else | ||
| 518 | #define XPNTR(a) ((uintptr_t) (XLI (a) & VALMASK)) | ||
| 519 | #endif | ||
| 520 | 516 | ||
| 521 | #endif /* not USE_LSB_TAG */ | 517 | #endif /* not USE_LSB_TAG */ |
| 522 | 518 | ||
| @@ -2962,7 +2958,7 @@ extern void message1 (const char *); | |||
| 2962 | extern void message1_nolog (const char *); | 2958 | extern void message1_nolog (const char *); |
| 2963 | extern void message3 (Lisp_Object); | 2959 | extern void message3 (Lisp_Object); |
| 2964 | extern void message3_nolog (Lisp_Object); | 2960 | extern void message3_nolog (Lisp_Object); |
| 2965 | extern void message_dolog (const char *, ptrdiff_t, int, int); | 2961 | extern void message_dolog (const char *, ptrdiff_t, bool, bool); |
| 2966 | extern void message_with_string (const char *, Lisp_Object, int); | 2962 | extern void message_with_string (const char *, Lisp_Object, int); |
| 2967 | extern void message_log_maybe_newline (void); | 2963 | extern void message_log_maybe_newline (void); |
| 2968 | extern void update_echo_area (void); | 2964 | extern void update_echo_area (void); |
| @@ -3344,7 +3340,7 @@ extern void record_unwind_save_match_data (void); | |||
| 3344 | struct re_registers; | 3340 | struct re_registers; |
| 3345 | extern struct re_pattern_buffer *compile_pattern (Lisp_Object, | 3341 | extern struct re_pattern_buffer *compile_pattern (Lisp_Object, |
| 3346 | struct re_registers *, | 3342 | struct re_registers *, |
| 3347 | Lisp_Object, int, int); | 3343 | Lisp_Object, int, bool); |
| 3348 | extern ptrdiff_t fast_string_match (Lisp_Object, Lisp_Object); | 3344 | extern ptrdiff_t fast_string_match (Lisp_Object, Lisp_Object); |
| 3349 | extern ptrdiff_t fast_c_string_match_ignore_case (Lisp_Object, const char *, | 3345 | extern ptrdiff_t fast_c_string_match_ignore_case (Lisp_Object, const char *, |
| 3350 | ptrdiff_t); | 3346 | ptrdiff_t); |
diff --git a/src/print.c b/src/print.c index f5f8450545d..9a84903e306 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -104,7 +104,8 @@ int print_output_debug_flag EXTERNALLY_VISIBLE = 1; | |||
| 104 | ptrdiff_t old_point_byte = -1, start_point_byte = -1; \ | 104 | ptrdiff_t old_point_byte = -1, start_point_byte = -1; \ |
| 105 | ptrdiff_t specpdl_count = SPECPDL_INDEX (); \ | 105 | ptrdiff_t specpdl_count = SPECPDL_INDEX (); \ |
| 106 | int free_print_buffer = 0; \ | 106 | int free_print_buffer = 0; \ |
| 107 | int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); \ | 107 | bool multibyte \ |
| 108 | = !NILP (BVAR (current_buffer, enable_multibyte_characters)); \ | ||
| 108 | Lisp_Object original | 109 | Lisp_Object original |
| 109 | 110 | ||
| 110 | #define PRINTPREPARE \ | 111 | #define PRINTPREPARE \ |
| @@ -1398,7 +1399,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag | |||
| 1398 | /* 1 means we must ensure that the next character we output | 1399 | /* 1 means we must ensure that the next character we output |
| 1399 | cannot be taken as part of a hex character escape. */ | 1400 | cannot be taken as part of a hex character escape. */ |
| 1400 | int need_nonhex = 0; | 1401 | int need_nonhex = 0; |
| 1401 | int multibyte = STRING_MULTIBYTE (obj); | 1402 | bool multibyte = STRING_MULTIBYTE (obj); |
| 1402 | 1403 | ||
| 1403 | GCPRO1 (obj); | 1404 | GCPRO1 (obj); |
| 1404 | 1405 | ||
diff --git a/src/process.c b/src/process.c index f210065b98e..9d6e8c097a1 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -180,10 +180,6 @@ static Lisp_Object Qlast_nonmenu_event; | |||
| 180 | #define SERIALCONN_P(p) (EQ (XPROCESS (p)->type, Qserial)) | 180 | #define SERIALCONN_P(p) (EQ (XPROCESS (p)->type, Qserial)) |
| 181 | #define SERIALCONN1_P(p) (EQ (p->type, Qserial)) | 181 | #define SERIALCONN1_P(p) (EQ (p->type, Qserial)) |
| 182 | 182 | ||
| 183 | #ifndef HAVE_H_ERRNO | ||
| 184 | extern int h_errno; | ||
| 185 | #endif | ||
| 186 | |||
| 187 | /* Number of events of change of status of a process. */ | 183 | /* Number of events of change of status of a process. */ |
| 188 | static EMACS_INT process_tick; | 184 | static EMACS_INT process_tick; |
| 189 | /* Number of events for which the user or sentinel has been notified. */ | 185 | /* Number of events for which the user or sentinel has been notified. */ |
| @@ -5567,7 +5563,7 @@ Output from processes can arrive in between bunches. */) | |||
| 5567 | if (XINT (start) < GPT && XINT (end) > GPT) | 5563 | if (XINT (start) < GPT && XINT (end) > GPT) |
| 5568 | move_gap_both (XINT (start), start_byte); | 5564 | move_gap_both (XINT (start), start_byte); |
| 5569 | 5565 | ||
| 5570 | send_process (proc, (char *) BYTE_POS_ADDR (start_byte), | 5566 | send_process (proc, (char *) BYTE_POS_ADDR (start_byte), |
| 5571 | end_byte - start_byte, Fcurrent_buffer ()); | 5567 | end_byte - start_byte, Fcurrent_buffer ()); |
| 5572 | 5568 | ||
| 5573 | return Qnil; | 5569 | return Qnil; |
diff --git a/src/search.c b/src/search.c index c25d2441018..d4508004bf6 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -209,7 +209,8 @@ clear_regexp_cache (void) | |||
| 209 | for this pattern. 0 means backtrack only enough to get a valid match. */ | 209 | for this pattern. 0 means backtrack only enough to get a valid match. */ |
| 210 | 210 | ||
| 211 | struct re_pattern_buffer * | 211 | struct re_pattern_buffer * |
| 212 | compile_pattern (Lisp_Object pattern, struct re_registers *regp, Lisp_Object translate, int posix, int multibyte) | 212 | compile_pattern (Lisp_Object pattern, struct re_registers *regp, |
| 213 | Lisp_Object translate, int posix, bool multibyte) | ||
| 213 | { | 214 | { |
| 214 | struct regexp_cache *cp, **cpp; | 215 | struct regexp_cache *cp, **cpp; |
| 215 | 216 | ||
| @@ -534,9 +535,10 @@ fast_string_match_ignore_case (Lisp_Object regexp, Lisp_Object string) | |||
| 534 | data. */ | 535 | data. */ |
| 535 | 536 | ||
| 536 | ptrdiff_t | 537 | ptrdiff_t |
| 537 | fast_looking_at (Lisp_Object regexp, ptrdiff_t pos, ptrdiff_t pos_byte, ptrdiff_t limit, ptrdiff_t limit_byte, Lisp_Object string) | 538 | fast_looking_at (Lisp_Object regexp, ptrdiff_t pos, ptrdiff_t pos_byte, |
| 539 | ptrdiff_t limit, ptrdiff_t limit_byte, Lisp_Object string) | ||
| 538 | { | 540 | { |
| 539 | int multibyte; | 541 | bool multibyte; |
| 540 | struct re_pattern_buffer *buf; | 542 | struct re_pattern_buffer *buf; |
| 541 | unsigned char *p1, *p2; | 543 | unsigned char *p1, *p2; |
| 542 | ptrdiff_t s1, s2; | 544 | ptrdiff_t s1, s2; |
| @@ -1248,7 +1250,7 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, | |||
| 1248 | ptrdiff_t raw_pattern_size; | 1250 | ptrdiff_t raw_pattern_size; |
| 1249 | ptrdiff_t raw_pattern_size_byte; | 1251 | ptrdiff_t raw_pattern_size_byte; |
| 1250 | unsigned char *patbuf; | 1252 | unsigned char *patbuf; |
| 1251 | int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); | 1253 | bool multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); |
| 1252 | unsigned char *base_pat; | 1254 | unsigned char *base_pat; |
| 1253 | /* Set to positive if we find a non-ASCII char that need | 1255 | /* Set to positive if we find a non-ASCII char that need |
| 1254 | translation. Otherwise set to zero later. */ | 1256 | translation. Otherwise set to zero later. */ |
| @@ -1461,8 +1463,8 @@ simple_search (EMACS_INT n, unsigned char *pat, | |||
| 1461 | ptrdiff_t pos, ptrdiff_t pos_byte, | 1463 | ptrdiff_t pos, ptrdiff_t pos_byte, |
| 1462 | ptrdiff_t lim, ptrdiff_t lim_byte) | 1464 | ptrdiff_t lim, ptrdiff_t lim_byte) |
| 1463 | { | 1465 | { |
| 1464 | int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); | 1466 | bool multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); |
| 1465 | int forward = n > 0; | 1467 | bool forward = n > 0; |
| 1466 | /* Number of buffer bytes matched. Note that this may be different | 1468 | /* Number of buffer bytes matched. Note that this may be different |
| 1467 | from len_byte in a multibyte buffer. */ | 1469 | from len_byte in a multibyte buffer. */ |
| 1468 | ptrdiff_t match_byte = PTRDIFF_MIN; | 1470 | ptrdiff_t match_byte = PTRDIFF_MIN; |
| @@ -1681,7 +1683,7 @@ boyer_moore (EMACS_INT n, unsigned char *base_pat, | |||
| 1681 | register ptrdiff_t i; | 1683 | register ptrdiff_t i; |
| 1682 | register int j; | 1684 | register int j; |
| 1683 | unsigned char *pat, *pat_end; | 1685 | unsigned char *pat, *pat_end; |
| 1684 | int multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); | 1686 | bool multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters)); |
| 1685 | 1687 | ||
| 1686 | unsigned char simple_translate[0400]; | 1688 | unsigned char simple_translate[0400]; |
| 1687 | /* These are set to the preceding bytes of a byte to be translated | 1689 | /* These are set to the preceding bytes of a byte to be translated |
| @@ -2507,8 +2509,8 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2507 | ptrdiff_t length = SBYTES (newtext); | 2509 | ptrdiff_t length = SBYTES (newtext); |
| 2508 | unsigned char *substed; | 2510 | unsigned char *substed; |
| 2509 | ptrdiff_t substed_alloc_size, substed_len; | 2511 | ptrdiff_t substed_alloc_size, substed_len; |
| 2510 | int buf_multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); | 2512 | bool buf_multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); |
| 2511 | int str_multibyte = STRING_MULTIBYTE (newtext); | 2513 | bool str_multibyte = STRING_MULTIBYTE (newtext); |
| 2512 | int really_changed = 0; | 2514 | int really_changed = 0; |
| 2513 | 2515 | ||
| 2514 | substed_alloc_size = ((STRING_BYTES_BOUND - 100) / 2 < length | 2516 | substed_alloc_size = ((STRING_BYTES_BOUND - 100) / 2 < length |
| @@ -6232,7 +6232,7 @@ sys_socket (int af, int type, int protocol) | |||
| 6232 | 6232 | ||
| 6233 | if (winsock_lib == NULL) | 6233 | if (winsock_lib == NULL) |
| 6234 | { | 6234 | { |
| 6235 | h_errno = ENETDOWN; | 6235 | errno = h_errno = ENETDOWN; |
| 6236 | return INVALID_SOCKET; | 6236 | return INVALID_SOCKET; |
| 6237 | } | 6237 | } |
| 6238 | 6238 | ||
| @@ -6242,7 +6242,13 @@ sys_socket (int af, int type, int protocol) | |||
| 6242 | s = pfn_socket (af, type, protocol); | 6242 | s = pfn_socket (af, type, protocol); |
| 6243 | 6243 | ||
| 6244 | if (s != INVALID_SOCKET) | 6244 | if (s != INVALID_SOCKET) |
| 6245 | return socket_to_fd (s); | 6245 | { |
| 6246 | int retval = socket_to_fd (s); | ||
| 6247 | |||
| 6248 | if (retval == -1) | ||
| 6249 | errno = h_errno; | ||
| 6250 | return retval; | ||
| 6251 | } | ||
| 6246 | 6252 | ||
| 6247 | set_errno (); | 6253 | set_errno (); |
| 6248 | return -1; | 6254 | return -1; |
| @@ -6309,6 +6315,7 @@ socket_to_fd (SOCKET s) | |||
| 6309 | } | 6315 | } |
| 6310 | } | 6316 | } |
| 6311 | } | 6317 | } |
| 6318 | eassert (fd < MAXDESC); | ||
| 6312 | fd_info[fd].hnd = (HANDLE) s; | 6319 | fd_info[fd].hnd = (HANDLE) s; |
| 6313 | 6320 | ||
| 6314 | /* set our own internal flags */ | 6321 | /* set our own internal flags */ |
| @@ -6347,7 +6354,7 @@ sys_bind (int s, const struct sockaddr * addr, int namelen) | |||
| 6347 | { | 6354 | { |
| 6348 | if (winsock_lib == NULL) | 6355 | if (winsock_lib == NULL) |
| 6349 | { | 6356 | { |
| 6350 | h_errno = ENOTSOCK; | 6357 | errno = h_errno = ENOTSOCK; |
| 6351 | return SOCKET_ERROR; | 6358 | return SOCKET_ERROR; |
| 6352 | } | 6359 | } |
| 6353 | 6360 | ||
| @@ -6359,7 +6366,7 @@ sys_bind (int s, const struct sockaddr * addr, int namelen) | |||
| 6359 | set_errno (); | 6366 | set_errno (); |
| 6360 | return rc; | 6367 | return rc; |
| 6361 | } | 6368 | } |
| 6362 | h_errno = ENOTSOCK; | 6369 | errno = h_errno = ENOTSOCK; |
| 6363 | return SOCKET_ERROR; | 6370 | return SOCKET_ERROR; |
| 6364 | } | 6371 | } |
| 6365 | 6372 | ||
| @@ -6368,7 +6375,7 @@ sys_connect (int s, const struct sockaddr * name, int namelen) | |||
| 6368 | { | 6375 | { |
| 6369 | if (winsock_lib == NULL) | 6376 | if (winsock_lib == NULL) |
| 6370 | { | 6377 | { |
| 6371 | h_errno = ENOTSOCK; | 6378 | errno = h_errno = ENOTSOCK; |
| 6372 | return SOCKET_ERROR; | 6379 | return SOCKET_ERROR; |
| 6373 | } | 6380 | } |
| 6374 | 6381 | ||
| @@ -6380,7 +6387,7 @@ sys_connect (int s, const struct sockaddr * name, int namelen) | |||
| 6380 | set_errno (); | 6387 | set_errno (); |
| 6381 | return rc; | 6388 | return rc; |
| 6382 | } | 6389 | } |
| 6383 | h_errno = ENOTSOCK; | 6390 | errno = h_errno = ENOTSOCK; |
| 6384 | return SOCKET_ERROR; | 6391 | return SOCKET_ERROR; |
| 6385 | } | 6392 | } |
| 6386 | 6393 | ||
| @@ -6414,7 +6421,7 @@ sys_gethostname (char * name, int namelen) | |||
| 6414 | if (namelen > MAX_COMPUTERNAME_LENGTH) | 6421 | if (namelen > MAX_COMPUTERNAME_LENGTH) |
| 6415 | return !GetComputerName (name, (DWORD *)&namelen); | 6422 | return !GetComputerName (name, (DWORD *)&namelen); |
| 6416 | 6423 | ||
| 6417 | h_errno = EFAULT; | 6424 | errno = h_errno = EFAULT; |
| 6418 | return SOCKET_ERROR; | 6425 | return SOCKET_ERROR; |
| 6419 | } | 6426 | } |
| 6420 | 6427 | ||
| @@ -6425,7 +6432,7 @@ sys_gethostbyname (const char * name) | |||
| 6425 | 6432 | ||
| 6426 | if (winsock_lib == NULL) | 6433 | if (winsock_lib == NULL) |
| 6427 | { | 6434 | { |
| 6428 | h_errno = ENETDOWN; | 6435 | errno = h_errno = ENETDOWN; |
| 6429 | return NULL; | 6436 | return NULL; |
| 6430 | } | 6437 | } |
| 6431 | 6438 | ||
| @@ -6443,7 +6450,7 @@ sys_getservbyname (const char * name, const char * proto) | |||
| 6443 | 6450 | ||
| 6444 | if (winsock_lib == NULL) | 6451 | if (winsock_lib == NULL) |
| 6445 | { | 6452 | { |
| 6446 | h_errno = ENETDOWN; | 6453 | errno = h_errno = ENETDOWN; |
| 6447 | return NULL; | 6454 | return NULL; |
| 6448 | } | 6455 | } |
| 6449 | 6456 | ||
| @@ -6459,7 +6466,7 @@ sys_getpeername (int s, struct sockaddr *addr, int * namelen) | |||
| 6459 | { | 6466 | { |
| 6460 | if (winsock_lib == NULL) | 6467 | if (winsock_lib == NULL) |
| 6461 | { | 6468 | { |
| 6462 | h_errno = ENETDOWN; | 6469 | errno = h_errno = ENETDOWN; |
| 6463 | return SOCKET_ERROR; | 6470 | return SOCKET_ERROR; |
| 6464 | } | 6471 | } |
| 6465 | 6472 | ||
| @@ -6471,7 +6478,7 @@ sys_getpeername (int s, struct sockaddr *addr, int * namelen) | |||
| 6471 | set_errno (); | 6478 | set_errno (); |
| 6472 | return rc; | 6479 | return rc; |
| 6473 | } | 6480 | } |
| 6474 | h_errno = ENOTSOCK; | 6481 | errno = h_errno = ENOTSOCK; |
| 6475 | return SOCKET_ERROR; | 6482 | return SOCKET_ERROR; |
| 6476 | } | 6483 | } |
| 6477 | 6484 | ||
| @@ -6480,7 +6487,7 @@ sys_shutdown (int s, int how) | |||
| 6480 | { | 6487 | { |
| 6481 | if (winsock_lib == NULL) | 6488 | if (winsock_lib == NULL) |
| 6482 | { | 6489 | { |
| 6483 | h_errno = ENETDOWN; | 6490 | errno = h_errno = ENETDOWN; |
| 6484 | return SOCKET_ERROR; | 6491 | return SOCKET_ERROR; |
| 6485 | } | 6492 | } |
| 6486 | 6493 | ||
| @@ -6492,7 +6499,7 @@ sys_shutdown (int s, int how) | |||
| 6492 | set_errno (); | 6499 | set_errno (); |
| 6493 | return rc; | 6500 | return rc; |
| 6494 | } | 6501 | } |
| 6495 | h_errno = ENOTSOCK; | 6502 | errno = h_errno = ENOTSOCK; |
| 6496 | return SOCKET_ERROR; | 6503 | return SOCKET_ERROR; |
| 6497 | } | 6504 | } |
| 6498 | 6505 | ||
| @@ -6501,7 +6508,7 @@ sys_setsockopt (int s, int level, int optname, const void * optval, int optlen) | |||
| 6501 | { | 6508 | { |
| 6502 | if (winsock_lib == NULL) | 6509 | if (winsock_lib == NULL) |
| 6503 | { | 6510 | { |
| 6504 | h_errno = ENETDOWN; | 6511 | errno = h_errno = ENETDOWN; |
| 6505 | return SOCKET_ERROR; | 6512 | return SOCKET_ERROR; |
| 6506 | } | 6513 | } |
| 6507 | 6514 | ||
| @@ -6514,7 +6521,7 @@ sys_setsockopt (int s, int level, int optname, const void * optval, int optlen) | |||
| 6514 | set_errno (); | 6521 | set_errno (); |
| 6515 | return rc; | 6522 | return rc; |
| 6516 | } | 6523 | } |
| 6517 | h_errno = ENOTSOCK; | 6524 | errno = h_errno = ENOTSOCK; |
| 6518 | return SOCKET_ERROR; | 6525 | return SOCKET_ERROR; |
| 6519 | } | 6526 | } |
| 6520 | 6527 | ||
| @@ -6523,7 +6530,7 @@ sys_listen (int s, int backlog) | |||
| 6523 | { | 6530 | { |
| 6524 | if (winsock_lib == NULL) | 6531 | if (winsock_lib == NULL) |
| 6525 | { | 6532 | { |
| 6526 | h_errno = ENETDOWN; | 6533 | errno = h_errno = ENETDOWN; |
| 6527 | return SOCKET_ERROR; | 6534 | return SOCKET_ERROR; |
| 6528 | } | 6535 | } |
| 6529 | 6536 | ||
| @@ -6537,7 +6544,7 @@ sys_listen (int s, int backlog) | |||
| 6537 | fd_info[s].flags |= FILE_LISTEN; | 6544 | fd_info[s].flags |= FILE_LISTEN; |
| 6538 | return rc; | 6545 | return rc; |
| 6539 | } | 6546 | } |
| 6540 | h_errno = ENOTSOCK; | 6547 | errno = h_errno = ENOTSOCK; |
| 6541 | return SOCKET_ERROR; | 6548 | return SOCKET_ERROR; |
| 6542 | } | 6549 | } |
| 6543 | 6550 | ||
| @@ -6546,7 +6553,7 @@ sys_getsockname (int s, struct sockaddr * name, int * namelen) | |||
| 6546 | { | 6553 | { |
| 6547 | if (winsock_lib == NULL) | 6554 | if (winsock_lib == NULL) |
| 6548 | { | 6555 | { |
| 6549 | h_errno = ENETDOWN; | 6556 | errno = h_errno = ENETDOWN; |
| 6550 | return SOCKET_ERROR; | 6557 | return SOCKET_ERROR; |
| 6551 | } | 6558 | } |
| 6552 | 6559 | ||
| @@ -6558,7 +6565,7 @@ sys_getsockname (int s, struct sockaddr * name, int * namelen) | |||
| 6558 | set_errno (); | 6565 | set_errno (); |
| 6559 | return rc; | 6566 | return rc; |
| 6560 | } | 6567 | } |
| 6561 | h_errno = ENOTSOCK; | 6568 | errno = h_errno = ENOTSOCK; |
| 6562 | return SOCKET_ERROR; | 6569 | return SOCKET_ERROR; |
| 6563 | } | 6570 | } |
| 6564 | 6571 | ||
| @@ -6567,7 +6574,7 @@ sys_accept (int s, struct sockaddr * addr, int * addrlen) | |||
| 6567 | { | 6574 | { |
| 6568 | if (winsock_lib == NULL) | 6575 | if (winsock_lib == NULL) |
| 6569 | { | 6576 | { |
| 6570 | h_errno = ENETDOWN; | 6577 | errno = h_errno = ENETDOWN; |
| 6571 | return -1; | 6578 | return -1; |
| 6572 | } | 6579 | } |
| 6573 | 6580 | ||
| @@ -6579,13 +6586,20 @@ sys_accept (int s, struct sockaddr * addr, int * addrlen) | |||
| 6579 | if (t == INVALID_SOCKET) | 6586 | if (t == INVALID_SOCKET) |
| 6580 | set_errno (); | 6587 | set_errno (); |
| 6581 | else | 6588 | else |
| 6582 | fd = socket_to_fd (t); | 6589 | { |
| 6590 | fd = socket_to_fd (t); | ||
| 6591 | if (fd < 0) | ||
| 6592 | errno = h_errno; /* socket_to_fd sets h_errno */ | ||
| 6593 | } | ||
| 6583 | 6594 | ||
| 6584 | fd_info[s].cp->status = STATUS_READ_ACKNOWLEDGED; | 6595 | if (fd >= 0) |
| 6585 | ResetEvent (fd_info[s].cp->char_avail); | 6596 | { |
| 6597 | fd_info[s].cp->status = STATUS_READ_ACKNOWLEDGED; | ||
| 6598 | ResetEvent (fd_info[s].cp->char_avail); | ||
| 6599 | } | ||
| 6586 | return fd; | 6600 | return fd; |
| 6587 | } | 6601 | } |
| 6588 | h_errno = ENOTSOCK; | 6602 | errno = h_errno = ENOTSOCK; |
| 6589 | return -1; | 6603 | return -1; |
| 6590 | } | 6604 | } |
| 6591 | 6605 | ||
| @@ -6595,7 +6609,7 @@ sys_recvfrom (int s, char * buf, int len, int flags, | |||
| 6595 | { | 6609 | { |
| 6596 | if (winsock_lib == NULL) | 6610 | if (winsock_lib == NULL) |
| 6597 | { | 6611 | { |
| 6598 | h_errno = ENETDOWN; | 6612 | errno = h_errno = ENETDOWN; |
| 6599 | return SOCKET_ERROR; | 6613 | return SOCKET_ERROR; |
| 6600 | } | 6614 | } |
| 6601 | 6615 | ||
| @@ -6607,7 +6621,7 @@ sys_recvfrom (int s, char * buf, int len, int flags, | |||
| 6607 | set_errno (); | 6621 | set_errno (); |
| 6608 | return rc; | 6622 | return rc; |
| 6609 | } | 6623 | } |
| 6610 | h_errno = ENOTSOCK; | 6624 | errno = h_errno = ENOTSOCK; |
| 6611 | return SOCKET_ERROR; | 6625 | return SOCKET_ERROR; |
| 6612 | } | 6626 | } |
| 6613 | 6627 | ||
| @@ -6617,7 +6631,7 @@ sys_sendto (int s, const char * buf, int len, int flags, | |||
| 6617 | { | 6631 | { |
| 6618 | if (winsock_lib == NULL) | 6632 | if (winsock_lib == NULL) |
| 6619 | { | 6633 | { |
| 6620 | h_errno = ENETDOWN; | 6634 | errno = h_errno = ENETDOWN; |
| 6621 | return SOCKET_ERROR; | 6635 | return SOCKET_ERROR; |
| 6622 | } | 6636 | } |
| 6623 | 6637 | ||
| @@ -6629,7 +6643,7 @@ sys_sendto (int s, const char * buf, int len, int flags, | |||
| 6629 | set_errno (); | 6643 | set_errno (); |
| 6630 | return rc; | 6644 | return rc; |
| 6631 | } | 6645 | } |
| 6632 | h_errno = ENOTSOCK; | 6646 | errno = h_errno = ENOTSOCK; |
| 6633 | return SOCKET_ERROR; | 6647 | return SOCKET_ERROR; |
| 6634 | } | 6648 | } |
| 6635 | 6649 | ||
| @@ -6640,7 +6654,7 @@ fcntl (int s, int cmd, int options) | |||
| 6640 | { | 6654 | { |
| 6641 | if (winsock_lib == NULL) | 6655 | if (winsock_lib == NULL) |
| 6642 | { | 6656 | { |
| 6643 | h_errno = ENETDOWN; | 6657 | errno = h_errno = ENETDOWN; |
| 6644 | return -1; | 6658 | return -1; |
| 6645 | } | 6659 | } |
| 6646 | 6660 | ||
| @@ -6663,7 +6677,7 @@ fcntl (int s, int cmd, int options) | |||
| 6663 | return SOCKET_ERROR; | 6677 | return SOCKET_ERROR; |
| 6664 | } | 6678 | } |
| 6665 | } | 6679 | } |
| 6666 | h_errno = ENOTSOCK; | 6680 | errno = h_errno = ENOTSOCK; |
| 6667 | return SOCKET_ERROR; | 6681 | return SOCKET_ERROR; |
| 6668 | } | 6682 | } |
| 6669 | 6683 | ||
| @@ -6800,6 +6814,7 @@ sys_pipe (int * phandles) | |||
| 6800 | { | 6814 | { |
| 6801 | _close (phandles[0]); | 6815 | _close (phandles[0]); |
| 6802 | _close (phandles[1]); | 6816 | _close (phandles[1]); |
| 6817 | errno = EMFILE; | ||
| 6803 | rc = -1; | 6818 | rc = -1; |
| 6804 | } | 6819 | } |
| 6805 | else | 6820 | else |
| @@ -6873,19 +6888,31 @@ _sys_read_ahead (int fd) | |||
| 6873 | 6888 | ||
| 6874 | /* Configure timeouts for blocking read. */ | 6889 | /* Configure timeouts for blocking read. */ |
| 6875 | if (!GetCommTimeouts (hnd, &ct)) | 6890 | if (!GetCommTimeouts (hnd, &ct)) |
| 6876 | return STATUS_READ_ERROR; | 6891 | { |
| 6892 | cp->status = STATUS_READ_ERROR; | ||
| 6893 | return STATUS_READ_ERROR; | ||
| 6894 | } | ||
| 6877 | ct.ReadIntervalTimeout = 0; | 6895 | ct.ReadIntervalTimeout = 0; |
| 6878 | ct.ReadTotalTimeoutMultiplier = 0; | 6896 | ct.ReadTotalTimeoutMultiplier = 0; |
| 6879 | ct.ReadTotalTimeoutConstant = 0; | 6897 | ct.ReadTotalTimeoutConstant = 0; |
| 6880 | if (!SetCommTimeouts (hnd, &ct)) | 6898 | if (!SetCommTimeouts (hnd, &ct)) |
| 6881 | return STATUS_READ_ERROR; | 6899 | { |
| 6900 | cp->status = STATUS_READ_ERROR; | ||
| 6901 | return STATUS_READ_ERROR; | ||
| 6902 | } | ||
| 6882 | 6903 | ||
| 6883 | if (!ReadFile (hnd, &cp->chr, sizeof (char), (DWORD*) &rc, ovl)) | 6904 | if (!ReadFile (hnd, &cp->chr, sizeof (char), (DWORD*) &rc, ovl)) |
| 6884 | { | 6905 | { |
| 6885 | if (GetLastError () != ERROR_IO_PENDING) | 6906 | if (GetLastError () != ERROR_IO_PENDING) |
| 6886 | return STATUS_READ_ERROR; | 6907 | { |
| 6908 | cp->status = STATUS_READ_ERROR; | ||
| 6909 | return STATUS_READ_ERROR; | ||
| 6910 | } | ||
| 6887 | if (!GetOverlappedResult (hnd, ovl, (DWORD*) &rc, TRUE)) | 6911 | if (!GetOverlappedResult (hnd, ovl, (DWORD*) &rc, TRUE)) |
| 6888 | return STATUS_READ_ERROR; | 6912 | { |
| 6913 | cp->status = STATUS_READ_ERROR; | ||
| 6914 | return STATUS_READ_ERROR; | ||
| 6915 | } | ||
| 6889 | } | 6916 | } |
| 6890 | } | 6917 | } |
| 6891 | else if (fd_info[fd].flags & FILE_SOCKET) | 6918 | else if (fd_info[fd].flags & FILE_SOCKET) |
diff --git a/src/w32proc.c b/src/w32proc.c index 8bf57602927..3f3e97c77a0 100644 --- a/src/w32proc.c +++ b/src/w32proc.c | |||
| @@ -803,6 +803,48 @@ new_child (void) | |||
| 803 | if (!CHILD_ACTIVE (cp) && cp->procinfo.hProcess == NULL) | 803 | if (!CHILD_ACTIVE (cp) && cp->procinfo.hProcess == NULL) |
| 804 | goto Initialize; | 804 | goto Initialize; |
| 805 | if (child_proc_count == MAX_CHILDREN) | 805 | if (child_proc_count == MAX_CHILDREN) |
| 806 | { | ||
| 807 | int i = 0; | ||
| 808 | child_process *dead_cp = NULL; | ||
| 809 | |||
| 810 | DebPrint (("new_child: No vacant slots, looking for dead processes\n")); | ||
| 811 | for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--) | ||
| 812 | if (!CHILD_ACTIVE (cp) && cp->procinfo.hProcess) | ||
| 813 | { | ||
| 814 | DWORD status = 0; | ||
| 815 | |||
| 816 | if (!GetExitCodeProcess (cp->procinfo.hProcess, &status)) | ||
| 817 | { | ||
| 818 | DebPrint (("new_child.GetExitCodeProcess: error %lu for PID %lu\n", | ||
| 819 | GetLastError (), cp->procinfo.dwProcessId)); | ||
| 820 | status = STILL_ACTIVE; | ||
| 821 | } | ||
| 822 | if (status != STILL_ACTIVE | ||
| 823 | || WaitForSingleObject (cp->procinfo.hProcess, 0) == WAIT_OBJECT_0) | ||
| 824 | { | ||
| 825 | DebPrint (("new_child: Freeing slot of dead process %d, fd %d\n", | ||
| 826 | cp->procinfo.dwProcessId, cp->fd)); | ||
| 827 | CloseHandle (cp->procinfo.hProcess); | ||
| 828 | cp->procinfo.hProcess = NULL; | ||
| 829 | CloseHandle (cp->procinfo.hThread); | ||
| 830 | cp->procinfo.hThread = NULL; | ||
| 831 | /* Free up to 2 dead slots at a time, so that if we | ||
| 832 | have a lot of them, they will eventually all be | ||
| 833 | freed when the tornado ends. */ | ||
| 834 | if (i == 0) | ||
| 835 | dead_cp = cp; | ||
| 836 | else | ||
| 837 | break; | ||
| 838 | i++; | ||
| 839 | } | ||
| 840 | } | ||
| 841 | if (dead_cp) | ||
| 842 | { | ||
| 843 | cp = dead_cp; | ||
| 844 | goto Initialize; | ||
| 845 | } | ||
| 846 | } | ||
| 847 | if (child_proc_count == MAX_CHILDREN) | ||
| 806 | return NULL; | 848 | return NULL; |
| 807 | cp = &child_procs[child_proc_count++]; | 849 | cp = &child_procs[child_proc_count++]; |
| 808 | 850 | ||
| @@ -979,8 +1021,9 @@ reader_thread (void *arg) | |||
| 979 | read-ahead has completed, whether successfully or not. */ | 1021 | read-ahead has completed, whether successfully or not. */ |
| 980 | if (!SetEvent (cp->char_avail)) | 1022 | if (!SetEvent (cp->char_avail)) |
| 981 | { | 1023 | { |
| 982 | DebPrint (("reader_thread.SetEvent failed with %lu for fd %ld\n", | 1024 | DebPrint (("reader_thread.SetEvent(0x%x) failed with %lu for fd %ld (PID %d)\n", |
| 983 | GetLastError (), cp->fd)); | 1025 | (DWORD_PTR)cp->char_avail, GetLastError (), |
| 1026 | cp->fd, cp->pid)); | ||
| 984 | return 1; | 1027 | return 1; |
| 985 | } | 1028 | } |
| 986 | 1029 | ||
| @@ -2008,7 +2051,7 @@ count_children: | |||
| 2008 | /* Some child_procs might be sockets; ignore them. Also some | 2051 | /* Some child_procs might be sockets; ignore them. Also some |
| 2009 | children may have died already, but we haven't finished reading | 2052 | children may have died already, but we haven't finished reading |
| 2010 | the process output; ignore them too. */ | 2053 | the process output; ignore them too. */ |
| 2011 | if (CHILD_ACTIVE (cp) && cp->procinfo.hProcess | 2054 | if ((CHILD_ACTIVE (cp) && cp->procinfo.hProcess) |
| 2012 | && (cp->fd < 0 | 2055 | && (cp->fd < 0 |
| 2013 | || (fd_info[cp->fd].flags & FILE_SEND_SIGCHLD) == 0 | 2056 | || (fd_info[cp->fd].flags & FILE_SEND_SIGCHLD) == 0 |
| 2014 | || (fd_info[cp->fd].flags & FILE_AT_EOF) != 0) | 2057 | || (fd_info[cp->fd].flags & FILE_AT_EOF) != 0) |
diff --git a/src/xdisp.c b/src/xdisp.c index df0d55566e8..9da8679382e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -915,8 +915,8 @@ static int forward_to_next_line_start (struct it *, int *, struct bidi_it *); | |||
| 915 | static struct text_pos string_pos_nchars_ahead (struct text_pos, | 915 | static struct text_pos string_pos_nchars_ahead (struct text_pos, |
| 916 | Lisp_Object, ptrdiff_t); | 916 | Lisp_Object, ptrdiff_t); |
| 917 | static struct text_pos string_pos (ptrdiff_t, Lisp_Object); | 917 | static struct text_pos string_pos (ptrdiff_t, Lisp_Object); |
| 918 | static struct text_pos c_string_pos (ptrdiff_t, const char *, int); | 918 | static struct text_pos c_string_pos (ptrdiff_t, const char *, bool); |
| 919 | static ptrdiff_t number_of_chars (const char *, int); | 919 | static ptrdiff_t number_of_chars (const char *, bool); |
| 920 | static void compute_stop_pos (struct it *); | 920 | static void compute_stop_pos (struct it *); |
| 921 | static void compute_string_pos (struct text_pos *, struct text_pos, | 921 | static void compute_string_pos (struct text_pos *, struct text_pos, |
| 922 | Lisp_Object); | 922 | Lisp_Object); |
| @@ -1655,7 +1655,7 @@ string_pos (ptrdiff_t charpos, Lisp_Object string) | |||
| 1655 | means recognize multibyte characters. */ | 1655 | means recognize multibyte characters. */ |
| 1656 | 1656 | ||
| 1657 | static struct text_pos | 1657 | static struct text_pos |
| 1658 | c_string_pos (ptrdiff_t charpos, const char *s, int multibyte_p) | 1658 | c_string_pos (ptrdiff_t charpos, const char *s, bool multibyte_p) |
| 1659 | { | 1659 | { |
| 1660 | struct text_pos pos; | 1660 | struct text_pos pos; |
| 1661 | 1661 | ||
| @@ -1686,7 +1686,7 @@ c_string_pos (ptrdiff_t charpos, const char *s, int multibyte_p) | |||
| 1686 | non-zero means recognize multibyte characters. */ | 1686 | non-zero means recognize multibyte characters. */ |
| 1687 | 1687 | ||
| 1688 | static ptrdiff_t | 1688 | static ptrdiff_t |
| 1689 | number_of_chars (const char *s, int multibyte_p) | 1689 | number_of_chars (const char *s, bool multibyte_p) |
| 1690 | { | 1690 | { |
| 1691 | ptrdiff_t nchars; | 1691 | ptrdiff_t nchars; |
| 1692 | 1692 | ||
| @@ -9411,8 +9411,8 @@ message_log_maybe_newline (void) | |||
| 9411 | 9411 | ||
| 9412 | 9412 | ||
| 9413 | /* Add a string M of length NBYTES to the message log, optionally | 9413 | /* Add a string M of length NBYTES to the message log, optionally |
| 9414 | terminated with a newline when NLFLAG is non-zero. MULTIBYTE, if | 9414 | terminated with a newline when NLFLAG is true. MULTIBYTE, if |
| 9415 | nonzero, means interpret the contents of M as multibyte. This | 9415 | true, means interpret the contents of M as multibyte. This |
| 9416 | function calls low-level routines in order to bypass text property | 9416 | function calls low-level routines in order to bypass text property |
| 9417 | hooks, etc. which might not be safe to run. | 9417 | hooks, etc. which might not be safe to run. |
| 9418 | 9418 | ||
| @@ -9420,7 +9420,7 @@ message_log_maybe_newline (void) | |||
| 9420 | so the buffer M must NOT point to a Lisp string. */ | 9420 | so the buffer M must NOT point to a Lisp string. */ |
| 9421 | 9421 | ||
| 9422 | void | 9422 | void |
| 9423 | message_dolog (const char *m, ptrdiff_t nbytes, int nlflag, int multibyte) | 9423 | message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte) |
| 9424 | { | 9424 | { |
| 9425 | const unsigned char *msg = (const unsigned char *) m; | 9425 | const unsigned char *msg = (const unsigned char *) m; |
| 9426 | 9426 | ||
| @@ -9645,7 +9645,7 @@ message3 (Lisp_Object m) | |||
| 9645 | if (STRINGP (m)) | 9645 | if (STRINGP (m)) |
| 9646 | { | 9646 | { |
| 9647 | ptrdiff_t nbytes = SBYTES (m); | 9647 | ptrdiff_t nbytes = SBYTES (m); |
| 9648 | int multibyte = STRING_MULTIBYTE (m); | 9648 | bool multibyte = STRING_MULTIBYTE (m); |
| 9649 | USE_SAFE_ALLOCA; | 9649 | USE_SAFE_ALLOCA; |
| 9650 | char *buffer = SAFE_ALLOCA (nbytes); | 9650 | char *buffer = SAFE_ALLOCA (nbytes); |
| 9651 | memcpy (buffer, SDATA (m), nbytes); | 9651 | memcpy (buffer, SDATA (m), nbytes); |
| @@ -18169,7 +18169,7 @@ get_overlay_arrow_glyph_row (struct window *w, Lisp_Object overlay_arrow_string) | |||
| 18169 | const unsigned char *arrow_end = arrow_string + arrow_len; | 18169 | const unsigned char *arrow_end = arrow_string + arrow_len; |
| 18170 | const unsigned char *p; | 18170 | const unsigned char *p; |
| 18171 | struct it it; | 18171 | struct it it; |
| 18172 | int multibyte_p; | 18172 | bool multibyte_p; |
| 18173 | int n_glyphs_before; | 18173 | int n_glyphs_before; |
| 18174 | 18174 | ||
| 18175 | set_buffer_temp (buffer); | 18175 | set_buffer_temp (buffer); |
| @@ -20600,7 +20600,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision, | |||
| 20600 | risky); | 20600 | risky); |
| 20601 | else if (c != 0) | 20601 | else if (c != 0) |
| 20602 | { | 20602 | { |
| 20603 | int multibyte; | 20603 | bool multibyte; |
| 20604 | ptrdiff_t bytepos, charpos; | 20604 | ptrdiff_t bytepos, charpos; |
| 20605 | const char *spec; | 20605 | const char *spec; |
| 20606 | Lisp_Object string; | 20606 | Lisp_Object string; |
| @@ -21205,7 +21205,7 @@ static char * | |||
| 21205 | decode_mode_spec_coding (Lisp_Object coding_system, register char *buf, int eol_flag) | 21205 | decode_mode_spec_coding (Lisp_Object coding_system, register char *buf, int eol_flag) |
| 21206 | { | 21206 | { |
| 21207 | Lisp_Object val; | 21207 | Lisp_Object val; |
| 21208 | int multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); | 21208 | bool multibyte = !NILP (BVAR (current_buffer, enable_multibyte_characters)); |
| 21209 | const unsigned char *eol_str; | 21209 | const unsigned char *eol_str; |
| 21210 | int eol_str_len; | 21210 | int eol_str_len; |
| 21211 | /* The EOL conversion we are using. */ | 21211 | /* The EOL conversion we are using. */ |
diff --git a/src/xfaces.c b/src/xfaces.c index 33a221fdd52..71709446c1d 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -6152,7 +6152,7 @@ face_at_string_position (struct window *w, Lisp_Object string, | |||
| 6152 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 6152 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 6153 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; | 6153 | Lisp_Object attrs[LFACE_VECTOR_SIZE]; |
| 6154 | struct face *base_face; | 6154 | struct face *base_face; |
| 6155 | int multibyte_p = STRING_MULTIBYTE (string); | 6155 | bool multibyte_p = STRING_MULTIBYTE (string); |
| 6156 | Lisp_Object prop_name = mouse_p ? Qmouse_face : Qface; | 6156 | Lisp_Object prop_name = mouse_p ? Qmouse_face : Qface; |
| 6157 | 6157 | ||
| 6158 | /* Get the value of the face property at the current position within | 6158 | /* Get the value of the face property at the current position within |