diff options
| author | Paul Eggert | 2011-04-26 10:50:51 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-26 10:50:51 -0700 |
| commit | b5f869a7d838121b17493ad66958309c0d6031e5 (patch) | |
| tree | 6b84bb3fe253d717db02f0b82f65d13e0069cefd | |
| parent | 847ab9d19cefe485965a8b6f8b154e065a79b867 (diff) | |
| parent | bd0d2ee23380c98e8d41645b0d45574c83c7a393 (diff) | |
| download | emacs-b5f869a7d838121b17493ad66958309c0d6031e5.tar.gz emacs-b5f869a7d838121b17493ad66958309c0d6031e5.zip | |
Merge from mainline.
| -rw-r--r-- | etc/ChangeLog | 5 | ||||
| -rw-r--r-- | etc/DEBUG | 5 | ||||
| -rw-r--r-- | lib-src/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/ChangeLog | 15 | ||||
| -rw-r--r-- | lisp/cus-start.el | 5 | ||||
| -rw-r--r-- | lisp/erc/ChangeLog | 15 | ||||
| -rw-r--r-- | lisp/erc/erc-button.el | 35 | ||||
| -rw-r--r-- | lisp/erc/erc-dcc.el | 5 | ||||
| -rw-r--r-- | lisp/erc/erc-pcomplete.el | 10 | ||||
| -rw-r--r-- | lisp/erc/erc.el | 14 | ||||
| -rw-r--r-- | lisp/subr.el | 70 | ||||
| -rw-r--r-- | nt/ChangeLog | 5 | ||||
| -rw-r--r-- | nt/cmdproxy.c | 112 | ||||
| -rw-r--r-- | src/ChangeLog | 27 | ||||
| -rw-r--r-- | src/eval.c | 2 | ||||
| -rw-r--r-- | src/gnutls.c | 6 | ||||
| -rw-r--r-- | src/keyboard.c | 36 | ||||
| -rw-r--r-- | src/lisp.h | 2 |
18 files changed, 285 insertions, 86 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog index 24f44b9d0e8..48324a6be90 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-04-26 Daniel Colascione <dan.colascione@gmail.com> | ||
| 2 | |||
| 3 | * DEBUG: Document debug-on-event default behavior and utility for | ||
| 4 | debugging. | ||
| 5 | |||
| 1 | 2011-04-22 Noah Friedman <friedman@splode.com> | 6 | 2011-04-22 Noah Friedman <friedman@splode.com> |
| 2 | 7 | ||
| 3 | * emacs-buffer.gdb: Add trailing underscores to appropriate member | 8 | * emacs-buffer.gdb: Add trailing underscores to appropriate member |
| @@ -405,6 +405,11 @@ stepping, you will see where the loop starts and ends. Also, examine | |||
| 405 | the data being used in the loop and try to determine why the loop does | 405 | the data being used in the loop and try to determine why the loop does |
| 406 | not exit when it should. | 406 | not exit when it should. |
| 407 | 407 | ||
| 408 | You can also trying sending Emacs SIGUSR2, which, if `debug-on-event' | ||
| 409 | has its default value, will cause Emacs to attempt to break it out of | ||
| 410 | its current loop and into the Lisp debugger. This feature is useful | ||
| 411 | when a C-level debugger is not conveniently available. | ||
| 412 | |||
| 408 | ** If certain operations in Emacs are slower than they used to be, here | 413 | ** If certain operations in Emacs are slower than they used to be, here |
| 409 | is some advice for how to find out why. | 414 | is some advice for how to find out why. |
| 410 | 415 | ||
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index cd6c8d2b955..c4a2df5bdbf 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com> | 1 | 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com> |
| 2 | 2 | ||
| 3 | * makefile.w32-in (obj): Added gnutls.o. | 3 | * makefile.w32-in (obj): Add gnutls.o. |
| 4 | 4 | ||
| 5 | 2011-04-16 Paul Eggert <eggert@cs.ucla.edu> | 5 | 2011-04-16 Paul Eggert <eggert@cs.ucla.edu> |
| 6 | 6 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 35f663ee3e5..3aae7e5b678 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2011-04-26 Daniel Colascione <dan.colascione@gmail.com> | ||
| 2 | |||
| 3 | * cus-start.el (all): Define customization for debug-on-event. | ||
| 4 | |||
| 5 | 2011-04-26 Daniel Colascione <dan.colascione@gmail.com> | ||
| 6 | |||
| 7 | * subr.el (shell-quote-argument): Escape correctly under Windows. | ||
| 8 | |||
| 1 | 2011-04-25 Stefan Monnier <monnier@iro.umontreal.ca> | 9 | 2011-04-25 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 10 | ||
| 3 | * emulation/cua-base.el (cua-selection-mode): Make it toggle again. | 11 | * emulation/cua-base.el (cua-selection-mode): Make it toggle again. |
| @@ -50,6 +58,7 @@ | |||
| 50 | * net/network-stream.el (network-stream-open-starttls): Give host | 58 | * net/network-stream.el (network-stream-open-starttls): Give host |
| 51 | parameter to `gnutls-negotiate'. | 59 | parameter to `gnutls-negotiate'. |
| 52 | (gnutls-negotiate): Adjust `gnutls-negotiate' declaration. | 60 | (gnutls-negotiate): Adjust `gnutls-negotiate' declaration. |
| 61 | * subr.el (shell-quote-argument): Escape correctly under Windows. | ||
| 53 | 62 | ||
| 54 | 2011-04-24 Daniel Colascione <dan.colascione@gmail.com> | 63 | 2011-04-24 Daniel Colascione <dan.colascione@gmail.com> |
| 55 | 64 | ||
| @@ -540,7 +549,7 @@ | |||
| 540 | * delim-col.el (delimit-columns-max): Move defvar before first use. | 549 | * delim-col.el (delimit-columns-max): Move defvar before first use. |
| 541 | 550 | ||
| 542 | * descr-text.el (describe-char-categories): Don't quote `lambda'. | 551 | * descr-text.el (describe-char-categories): Don't quote `lambda'. |
| 543 | (describe-char): Don't quote `lambda'. Mark unused parameter. | 552 | (describe-char): Don't quote `lambda'. Mark unused parameter. |
| 544 | 553 | ||
| 545 | * desktop.el (desktop-save-buffer-p): Mark unused parameter. | 554 | * desktop.el (desktop-save-buffer-p): Mark unused parameter. |
| 546 | (auto-insert): Declare. | 555 | (auto-insert): Declare. |
| @@ -608,7 +617,7 @@ | |||
| 608 | (modify-file-local-variable-prop-line): Remove unused variable `val'. | 617 | (modify-file-local-variable-prop-line): Remove unused variable `val'. |
| 609 | 618 | ||
| 610 | * find-lisp.el (find-lisp-find-dired-internal): Remove unused | 619 | * find-lisp.el (find-lisp-find-dired-internal): Remove unused |
| 611 | variable `buf'. Mark unused parameter. | 620 | variable `buf'. Mark unused parameter. |
| 612 | (find-lisp-insert-directory): Mark unused parameter. | 621 | (find-lisp-insert-directory): Mark unused parameter. |
| 613 | 622 | ||
| 614 | * format.el (format-decode-run-method): Mark unused parameter; doc fix. | 623 | * format.el (format-decode-run-method): Mark unused parameter; doc fix. |
| @@ -810,7 +819,7 @@ | |||
| 810 | (widget-color-action): Remove unused variables `value' and `start'. | 819 | (widget-color-action): Remove unused variables `value' and `start'. |
| 811 | 820 | ||
| 812 | * windmove.el (windmove-wrap-loc-for-movement): Remove unused | 821 | * windmove.el (windmove-wrap-loc-for-movement): Remove unused |
| 813 | variable `dir'. Doc fix. | 822 | variable `dir'. Doc fix. |
| 814 | (windmove-find-other-window): Don't pass it. | 823 | (windmove-find-other-window): Don't pass it. |
| 815 | 824 | ||
| 816 | * window.el (count-windows): Mark unused parameter. | 825 | * window.el (count-windows): Mark unused parameter. |
diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 1188d37150a..6113a4321c5 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el | |||
| @@ -259,6 +259,11 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of | |||
| 259 | (suggest-key-bindings keyboard (choice (const :tag "off" nil) | 259 | (suggest-key-bindings keyboard (choice (const :tag "off" nil) |
| 260 | (integer :tag "time" 2) | 260 | (integer :tag "time" 2) |
| 261 | (other :tag "on"))) | 261 | (other :tag "on"))) |
| 262 | (debug-on-event debug | ||
| 263 | (choice (const :tag "None" nil) | ||
| 264 | (const :tag "When sent SIGUSR1" sigusr1) | ||
| 265 | (const :tag "When sent SIGUSR2" sigusr2)) | ||
| 266 | "24.1") | ||
| 262 | 267 | ||
| 263 | ;; This is not good news because it will use the wrong | 268 | ;; This is not good news because it will use the wrong |
| 264 | ;; version-specific directories when you upgrade. We need | 269 | ;; version-specific directories when you upgrade. We need |
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 6ff50756f1b..b5b36693dd2 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | 2011-04-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * erc.el (erc-mode-map): Use completion-at-point. | ||
| 4 | (erc-mode): Tell completion-at-point to obey erc-complete-functions. | ||
| 5 | (erc-complete-word-at-point): New function. | ||
| 6 | (erc-complete-word): Make it obsolete. | ||
| 7 | * erc-pcomplete.el (erc-pcompletions-at-point): New function. | ||
| 8 | (pcomplete): Use it. | ||
| 9 | * erc-dcc.el (erc-dcc-chat-mode-map): Use completion-at-point. | ||
| 10 | (erc-dcc-chat-mode): Tell completion-at-point to obey | ||
| 11 | erc-complete-functions. | ||
| 12 | * erc-button.el (erc-button-next-function): New function extracted from | ||
| 13 | erc-button-next. | ||
| 14 | (button, erc-button-next): Use it. | ||
| 15 | |||
| 1 | 2011-03-07 Chong Yidong <cyd@stupidchicken.com> | 16 | 2011-03-07 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 17 | ||
| 3 | * Version 23.3 released. | 18 | * Version 23.3 released. |
diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index 0b11c3bee2d..3a897347dea 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el | |||
| @@ -53,11 +53,11 @@ | |||
| 53 | "This mode buttonizes all messages according to `erc-button-alist'." | 53 | "This mode buttonizes all messages according to `erc-button-alist'." |
| 54 | ((add-hook 'erc-insert-modify-hook 'erc-button-add-buttons 'append) | 54 | ((add-hook 'erc-insert-modify-hook 'erc-button-add-buttons 'append) |
| 55 | (add-hook 'erc-send-modify-hook 'erc-button-add-buttons 'append) | 55 | (add-hook 'erc-send-modify-hook 'erc-button-add-buttons 'append) |
| 56 | (add-hook 'erc-complete-functions 'erc-button-next) | 56 | (add-hook 'erc-complete-functions 'erc-button-next-function) |
| 57 | (add-hook 'erc-mode-hook 'erc-button-setup)) | 57 | (add-hook 'erc-mode-hook 'erc-button-setup)) |
| 58 | ((remove-hook 'erc-insert-modify-hook 'erc-button-add-buttons) | 58 | ((remove-hook 'erc-insert-modify-hook 'erc-button-add-buttons) |
| 59 | (remove-hook 'erc-send-modify-hook 'erc-button-add-buttons) | 59 | (remove-hook 'erc-send-modify-hook 'erc-button-add-buttons) |
| 60 | (remove-hook 'erc-complete-functions 'erc-button-next) | 60 | (remove-hook 'erc-complete-functions 'erc-button-next-function) |
| 61 | (remove-hook 'erc-mode-hook 'erc-button-setup) | 61 | (remove-hook 'erc-mode-hook 'erc-button-setup) |
| 62 | (when (featurep 'xemacs) | 62 | (when (featurep 'xemacs) |
| 63 | (dolist (buffer (erc-buffer-list)) | 63 | (dolist (buffer (erc-buffer-list)) |
| @@ -427,21 +427,28 @@ call it with the value of the `erc-data' text property." | |||
| 427 | (error "Function %S is not bound" fun)) | 427 | (error "Function %S is not bound" fun)) |
| 428 | (apply fun data))) | 428 | (apply fun data))) |
| 429 | 429 | ||
| 430 | (defun erc-button-next-function () | ||
| 431 | "Pseudo completion function that actually jumps to the next button. | ||
| 432 | For use on `completion-at-point-functions'." | ||
| 433 | (let ((here (point))) | ||
| 434 | (when (< here (erc-beg-of-input-line)) | ||
| 435 | (lambda () | ||
| 436 | (while (and (get-text-property here 'erc-callback) | ||
| 437 | (not (= here (point-max)))) | ||
| 438 | (setq here (1+ here))) | ||
| 439 | (while (and (not (get-text-property here 'erc-callback)) | ||
| 440 | (not (= here (point-max)))) | ||
| 441 | (setq here (1+ here))) | ||
| 442 | (if (< here (point-max)) | ||
| 443 | (goto-char here) | ||
| 444 | (error "No next button")) | ||
| 445 | t)))) | ||
| 446 | |||
| 430 | (defun erc-button-next () | 447 | (defun erc-button-next () |
| 431 | "Go to the next button in this buffer." | 448 | "Go to the next button in this buffer." |
| 432 | (interactive) | 449 | (interactive) |
| 433 | (let ((here (point))) | 450 | (let ((f (erc-button-next-function))) |
| 434 | (when (< here (erc-beg-of-input-line)) | 451 | (if f (funcall f)))) |
| 435 | (while (and (get-text-property here 'erc-callback) | ||
| 436 | (not (= here (point-max)))) | ||
| 437 | (setq here (1+ here))) | ||
| 438 | (while (and (not (get-text-property here 'erc-callback)) | ||
| 439 | (not (= here (point-max)))) | ||
| 440 | (setq here (1+ here))) | ||
| 441 | (if (< here (point-max)) | ||
| 442 | (goto-char here) | ||
| 443 | (error "No next button")) | ||
| 444 | t))) | ||
| 445 | 452 | ||
| 446 | (defun erc-button-previous () | 453 | (defun erc-button-previous () |
| 447 | "Go to the previous button in this buffer." | 454 | "Go to the previous button in this buffer." |
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index 88f0fe605f8..19e1801e03c 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el | |||
| @@ -1094,7 +1094,7 @@ Possible values are: ask, auto, ignore." | |||
| 1094 | (defvar erc-dcc-chat-mode-map | 1094 | (defvar erc-dcc-chat-mode-map |
| 1095 | (let ((map (make-sparse-keymap))) | 1095 | (let ((map (make-sparse-keymap))) |
| 1096 | (define-key map (kbd "RET") 'erc-send-current-line) | 1096 | (define-key map (kbd "RET") 'erc-send-current-line) |
| 1097 | (define-key map "\t" 'erc-complete-word) | 1097 | (define-key map "\t" 'completion-at-point) |
| 1098 | map) | 1098 | map) |
| 1099 | "Keymap for `erc-dcc-mode'.") | 1099 | "Keymap for `erc-dcc-mode'.") |
| 1100 | 1100 | ||
| @@ -1102,7 +1102,8 @@ Possible values are: ask, auto, ignore." | |||
| 1102 | "Major mode for wasting time via DCC chat." | 1102 | "Major mode for wasting time via DCC chat." |
| 1103 | (setq mode-line-process '(":%s") | 1103 | (setq mode-line-process '(":%s") |
| 1104 | erc-send-input-line-function 'erc-dcc-chat-send-input-line | 1104 | erc-send-input-line-function 'erc-dcc-chat-send-input-line |
| 1105 | erc-default-recipients '(dcc))) | 1105 | erc-default-recipients '(dcc)) |
| 1106 | (add-hook 'completion-at-point-functions 'erc-complete-word-at-point nil t)) | ||
| 1106 | 1107 | ||
| 1107 | (defun erc-dcc-chat-send-input-line (recipient line &optional force) | 1108 | (defun erc-dcc-chat-send-input-line (recipient line &optional force) |
| 1108 | "Send LINE to the remote end. | 1109 | "Send LINE to the remote end. |
diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el index 355770c5dcc..48c260c19fc 100644 --- a/lisp/erc/erc-pcomplete.el +++ b/lisp/erc/erc-pcomplete.el | |||
| @@ -64,10 +64,16 @@ the most recent speakers are listed first." | |||
| 64 | (define-erc-module pcomplete Completion | 64 | (define-erc-module pcomplete Completion |
| 65 | "In ERC Completion mode, the TAB key does completion whenever possible." | 65 | "In ERC Completion mode, the TAB key does completion whenever possible." |
| 66 | ((add-hook 'erc-mode-hook 'pcomplete-erc-setup) | 66 | ((add-hook 'erc-mode-hook 'pcomplete-erc-setup) |
| 67 | (add-hook 'erc-complete-functions 'erc-pcomplete) | 67 | (add-hook 'erc-complete-functions 'erc-pcompletions-at-point) |
| 68 | (erc-buffer-list #'pcomplete-erc-setup)) | 68 | (erc-buffer-list #'pcomplete-erc-setup)) |
| 69 | ((remove-hook 'erc-mode-hook 'pcomplete-erc-setup) | 69 | ((remove-hook 'erc-mode-hook 'pcomplete-erc-setup) |
| 70 | (remove-hook 'erc-complete-functions 'erc-pcomplete))) | 70 | (remove-hook 'erc-complete-functions 'erc-pcompletions-at-point))) |
| 71 | |||
| 72 | (defun erc-pcompletions-at-point () | ||
| 73 | "ERC completion data from pcomplete. | ||
| 74 | for use on `completion-at-point-function'." | ||
| 75 | (when (> (point) (erc-beg-of-input-line)) | ||
| 76 | (pcomplete-completions-at-point))) | ||
| 71 | 77 | ||
| 72 | (defun erc-pcomplete () | 78 | (defun erc-pcomplete () |
| 73 | "Complete the nick before point." | 79 | "Complete the nick before point." |
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 110ee8d1c3f..e2228a43303 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el | |||
| @@ -1110,7 +1110,7 @@ which the local user typed." | |||
| 1110 | (define-key map "\C-c\C-u" 'erc-kill-input) | 1110 | (define-key map "\C-c\C-u" 'erc-kill-input) |
| 1111 | (define-key map "\C-c\C-x" 'erc-quit-server) | 1111 | (define-key map "\C-c\C-x" 'erc-quit-server) |
| 1112 | (define-key map "\M-\t" 'ispell-complete-word) | 1112 | (define-key map "\M-\t" 'ispell-complete-word) |
| 1113 | (define-key map "\t" 'erc-complete-word) | 1113 | (define-key map "\t" 'completion-at-point) |
| 1114 | 1114 | ||
| 1115 | ;; Suppress `font-lock-fontify-block' key binding since it | 1115 | ;; Suppress `font-lock-fontify-block' key binding since it |
| 1116 | ;; destroys face properties. | 1116 | ;; destroys face properties. |
| @@ -1447,7 +1447,8 @@ Defaults to the server buffer." | |||
| 1447 | (set (make-local-variable 'paragraph-separate) | 1447 | (set (make-local-variable 'paragraph-separate) |
| 1448 | (concat "\C-l\\|\\(^" (regexp-quote (erc-prompt)) "\\)")) | 1448 | (concat "\C-l\\|\\(^" (regexp-quote (erc-prompt)) "\\)")) |
| 1449 | (set (make-local-variable 'paragraph-start) | 1449 | (set (make-local-variable 'paragraph-start) |
| 1450 | (concat "\\(" (regexp-quote (erc-prompt)) "\\)"))) | 1450 | (concat "\\(" (regexp-quote (erc-prompt)) "\\)")) |
| 1451 | (add-hook 'completion-at-point-functions 'erc-complete-word-at-point nil t)) | ||
| 1451 | 1452 | ||
| 1452 | ;; activation | 1453 | ;; activation |
| 1453 | 1454 | ||
| @@ -3803,13 +3804,10 @@ This places `point' just after the prompt, or at the beginning of the line." | |||
| 3803 | (setq erc-input-ring-index nil)) | 3804 | (setq erc-input-ring-index nil)) |
| 3804 | (kill-line))) | 3805 | (kill-line))) |
| 3805 | 3806 | ||
| 3806 | (defun erc-complete-word () | 3807 | (defun erc-complete-word-at-point () |
| 3807 | "Complete the word before point. | 3808 | (run-hook-with-args-until-success 'erc-complete-functions)) |
| 3808 | 3809 | ||
| 3809 | This function uses `erc-complete-functions'." | 3810 | (define-obsolete-function-alias 'erc-complete-word 'completion-at-point "24.1") |
| 3810 | (interactive) | ||
| 3811 | (unless (run-hook-with-args-until-success 'erc-complete-functions) | ||
| 3812 | (beep))) | ||
| 3813 | 3811 | ||
| 3814 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 3812 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 3815 | ;; | 3813 | ;; |
diff --git a/lisp/subr.el b/lisp/subr.el index cb1fdb7f608..2b6a5404060 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -2505,27 +2505,63 @@ Note: :data and :device are currently not supported on Windows." | |||
| 2505 | 2505 | ||
| 2506 | (defun shell-quote-argument (argument) | 2506 | (defun shell-quote-argument (argument) |
| 2507 | "Quote ARGUMENT for passing as argument to an inferior shell." | 2507 | "Quote ARGUMENT for passing as argument to an inferior shell." |
| 2508 | (if (or (eq system-type 'ms-dos) | 2508 | (cond |
| 2509 | (and (eq system-type 'windows-nt) (w32-shell-dos-semantics))) | 2509 | ((eq system-type 'ms-dos) |
| 2510 | ;; Quote using double quotes, but escape any existing quotes in | 2510 | ;; Quote using double quotes, but escape any existing quotes in |
| 2511 | ;; the argument with backslashes. | 2511 | ;; the argument with backslashes. |
| 2512 | (let ((result "") | 2512 | (let ((result "") |
| 2513 | (start 0) | 2513 | (start 0) |
| 2514 | end) | 2514 | end) |
| 2515 | (if (or (null (string-match "[^\"]" argument)) | 2515 | (if (or (null (string-match "[^\"]" argument)) |
| 2516 | (< (match-end 0) (length argument))) | 2516 | (< (match-end 0) (length argument))) |
| 2517 | (while (string-match "[\"]" argument start) | 2517 | (while (string-match "[\"]" argument start) |
| 2518 | (setq end (match-beginning 0) | 2518 | (setq end (match-beginning 0) |
| 2519 | result (concat result (substring argument start end) | 2519 | result (concat result (substring argument start end) |
| 2520 | "\\" (substring argument end (1+ end))) | 2520 | "\\" (substring argument end (1+ end))) |
| 2521 | start (1+ end)))) | 2521 | start (1+ end)))) |
| 2522 | (concat "\"" result (substring argument start) "\"")) | 2522 | (concat "\"" result (substring argument start) "\""))) |
| 2523 | |||
| 2524 | ((and (eq system-type 'windows-nt) (w32-shell-dos-semantics)) | ||
| 2525 | |||
| 2526 | ;; First, quote argument so that CommandLineToArgvW will | ||
| 2527 | ;; understand it. See | ||
| 2528 | ;; http://msdn.microsoft.com/en-us/library/17w5ykft%28v=vs.85%29.aspx | ||
| 2529 | ;; After we perform that level of quoting, escape shell | ||
| 2530 | ;; metacharacters so that cmd won't mangle our argument. If the | ||
| 2531 | ;; argument contains no double quote characters, we can just | ||
| 2532 | ;; surround it with double quotes. Otherwise, we need to prefix | ||
| 2533 | ;; each shell metacharacter with a caret. | ||
| 2534 | |||
| 2535 | (setq argument | ||
| 2536 | ;; escape backslashes at end of string | ||
| 2537 | (replace-regexp-in-string | ||
| 2538 | "\\(\\\\*\\)$" | ||
| 2539 | "\\1\\1" | ||
| 2540 | ;; escape backslashes and quotes in string body | ||
| 2541 | (replace-regexp-in-string | ||
| 2542 | "\\(\\\\*\\)\"" | ||
| 2543 | "\\1\\1\\\\\"" | ||
| 2544 | argument))) | ||
| 2545 | |||
| 2546 | (if (string-match "\"" argument) | ||
| 2547 | (concat | ||
| 2548 | "^\"" | ||
| 2549 | (replace-regexp-in-string | ||
| 2550 | "\\([%!()\"<>&|^]\\)" | ||
| 2551 | "^\\1" | ||
| 2552 | argument) | ||
| 2553 | "^\"") | ||
| 2554 | (concat "\"" argument "\""))) | ||
| 2555 | |||
| 2556 | (t | ||
| 2523 | (if (equal argument "") | 2557 | (if (equal argument "") |
| 2524 | "''" | 2558 | "''" |
| 2525 | ;; Quote everything except POSIX filename characters. | 2559 | ;; Quote everything except POSIX filename characters. |
| 2526 | ;; This should be safe enough even for really weird shells. | 2560 | ;; This should be safe enough even for really weird shells. |
| 2527 | (replace-regexp-in-string "\n" "'\n'" | 2561 | (replace-regexp-in-string |
| 2528 | (replace-regexp-in-string "[^-0-9a-zA-Z_./\n]" "\\\\\\&" argument))))) | 2562 | "\n" "'\n'" |
| 2563 | (replace-regexp-in-string "[^-0-9a-zA-Z_./\n]" "\\\\\\&" argument)))) | ||
| 2564 | )) | ||
| 2529 | 2565 | ||
| 2530 | (defun string-or-null-p (object) | 2566 | (defun string-or-null-p (object) |
| 2531 | "Return t if OBJECT is a string or nil. | 2567 | "Return t if OBJECT is a string or nil. |
diff --git a/nt/ChangeLog b/nt/ChangeLog index 255c2fd479d..2d6f8b61e19 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-04-26 Daniel Colascione <dan.colascione@gmail.com> | ||
| 2 | |||
| 3 | * cmdproxy.c (try_dequote_cmdline): New function. | ||
| 4 | (main): Use it. | ||
| 5 | |||
| 1 | 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com> | 6 | 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com> |
| 2 | 7 | ||
| 3 | * configure.bat: New options --without-gnutls and --lib, new build | 8 | * configure.bat: New options --without-gnutls and --lib, new build |
diff --git a/nt/cmdproxy.c b/nt/cmdproxy.c index b9572570c5f..fe128fd17c4 100644 --- a/nt/cmdproxy.c +++ b/nt/cmdproxy.c | |||
| @@ -309,6 +309,74 @@ make_absolute (const char *prog) | |||
| 309 | return NULL; | 309 | return NULL; |
| 310 | } | 310 | } |
| 311 | 311 | ||
| 312 | /* Try to decode the given command line the way cmd would do it. On | ||
| 313 | success, return 1 with cmdline dequoted. Otherwise, when we've | ||
| 314 | found constructs only cmd can properly interpret, return 0 and | ||
| 315 | leave cmdline unchanged. */ | ||
| 316 | int | ||
| 317 | try_dequote_cmdline (char* cmdline) | ||
| 318 | { | ||
| 319 | /* Dequoting can only subtract characters, so the length of the | ||
| 320 | original command line is a bound on the amount of scratch space | ||
| 321 | we need. This length, in turn, is bounded by the 32k | ||
| 322 | CreateProces limit. */ | ||
| 323 | char * old_pos = cmdline; | ||
| 324 | char * new_cmdline = alloca (strlen(cmdline)); | ||
| 325 | char * new_pos = new_cmdline; | ||
| 326 | char c; | ||
| 327 | |||
| 328 | enum { | ||
| 329 | NORMAL, | ||
| 330 | AFTER_CARET, | ||
| 331 | INSIDE_QUOTE | ||
| 332 | } state = NORMAL; | ||
| 333 | |||
| 334 | while ((c = *old_pos++)) | ||
| 335 | { | ||
| 336 | switch (state) | ||
| 337 | { | ||
| 338 | case NORMAL: | ||
| 339 | switch(c) | ||
| 340 | { | ||
| 341 | case '"': | ||
| 342 | *new_pos++ = c; | ||
| 343 | state = INSIDE_QUOTE; | ||
| 344 | break; | ||
| 345 | case '^': | ||
| 346 | state = AFTER_CARET; | ||
| 347 | break; | ||
| 348 | case '<': case '>': | ||
| 349 | case '&': case '|': | ||
| 350 | case '(': case ')': | ||
| 351 | case '%': case '!': | ||
| 352 | /* We saw an unquoted shell metacharacter and we don't | ||
| 353 | understand it. Bail out. */ | ||
| 354 | return 0; | ||
| 355 | default: | ||
| 356 | *new_pos++ = c; | ||
| 357 | break; | ||
| 358 | } | ||
| 359 | break; | ||
| 360 | case AFTER_CARET: | ||
| 361 | *new_pos++ = c; | ||
| 362 | state = NORMAL; | ||
| 363 | break; | ||
| 364 | case INSIDE_QUOTE: | ||
| 365 | *new_pos++ = c; | ||
| 366 | if (c == '"') | ||
| 367 | state = NORMAL; | ||
| 368 | |||
| 369 | break; | ||
| 370 | } | ||
| 371 | } | ||
| 372 | |||
| 373 | /* We were able to dequote the entire string. Copy our scratch | ||
| 374 | buffer on top of the original buffer and return success. */ | ||
| 375 | memcpy (cmdline, new_cmdline, new_pos - new_cmdline); | ||
| 376 | cmdline[new_pos - new_cmdline] = '\0'; | ||
| 377 | return 1; | ||
| 378 | } | ||
| 379 | |||
| 312 | /*****************************************************************/ | 380 | /*****************************************************************/ |
| 313 | 381 | ||
| 314 | #if 0 | 382 | #if 0 |
| @@ -574,30 +642,26 @@ main (int argc, char ** argv) | |||
| 574 | execute the command directly ourself. */ | 642 | execute the command directly ourself. */ |
| 575 | if (cmdline) | 643 | if (cmdline) |
| 576 | { | 644 | { |
| 577 | /* If no redirection or piping, and if program can be found, then | 645 | const char *args; |
| 578 | run program directly. Otherwise invoke a real shell. */ | 646 | |
| 579 | 647 | /* The program name is the first token of cmdline. Since | |
| 580 | static char copout_chars[] = "|<>&"; | 648 | filenames cannot legally contain embedded quotes, the value |
| 581 | 649 | of escape_char doesn't matter. */ | |
| 582 | if (strpbrk (cmdline, copout_chars) == NULL) | 650 | args = cmdline; |
| 583 | { | 651 | if (!get_next_token (path, &args)) |
| 584 | const char *args; | 652 | fail ("error: no program name specified.\n"); |
| 585 | 653 | ||
| 586 | /* The program name is the first token of cmdline. Since | 654 | canon_filename (path); |
| 587 | filenames cannot legally contain embedded quotes, the value | 655 | progname = make_absolute (path); |
| 588 | of escape_char doesn't matter. */ | 656 | |
| 589 | args = cmdline; | 657 | /* If we found the program and the rest of the command line does |
| 590 | if (!get_next_token (path, &args)) | 658 | not contain unquoted shell metacharacters, run the program |
| 591 | fail ("error: no program name specified.\n"); | 659 | directly (if not found it might be an internal shell command, |
| 592 | 660 | so don't fail). */ | |
| 593 | canon_filename (path); | 661 | if (progname != NULL && try_dequote_cmdline (cmdline)) |
| 594 | progname = make_absolute (path); | 662 | need_shell = FALSE; |
| 595 | 663 | else | |
| 596 | /* If we found the program, run it directly (if not found it | 664 | progname = NULL; |
| 597 | might be an internal shell command, so don't fail). */ | ||
| 598 | if (progname != NULL) | ||
| 599 | need_shell = FALSE; | ||
| 600 | } | ||
| 601 | } | 665 | } |
| 602 | 666 | ||
| 603 | pass_to_shell: | 667 | pass_to_shell: |
diff --git a/src/ChangeLog b/src/ChangeLog index 912a0ae8674..c6bb161ec84 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,11 +1,6 @@ | |||
| 1 | 2011-04-26 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-04-26 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | * gnutls.c (emacs_gnutls_handshake): Don't return a garbage value. | 3 | * gnutls.c (emacs_gnutls_handle_error): Remove unused local. |
| 4 | Expect the caller to check whether GNUTLS_STAGE_HANDSHAKE_CANDO <= | ||
| 5 | proc->gnutls_initstage, if the check is needed. The check isn't | ||
| 6 | needed for one caller, Fgnutls_boot. (Bug#8556) | ||
| 7 | (emacs_gnutls_read): Do that check. This is the other caller. | ||
| 8 | (emacs_gnutls_handle_error): Remove unused local. | ||
| 9 | (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *. | 4 | (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *. |
| 10 | Remove unused local. | 5 | Remove unused local. |
| 11 | (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0. | 6 | (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0. |
| @@ -192,6 +187,24 @@ | |||
| 192 | alignof(EMACS_INT) < sizeof (EMACS_INT). | 187 | alignof(EMACS_INT) < sizeof (EMACS_INT). |
| 193 | (check_sblock, check_string_bytes, check_string_free_list): Protoize. | 188 | (check_sblock, check_string_bytes, check_string_free_list): Protoize. |
| 194 | 189 | ||
| 190 | 2011-04-26 Juanma Barranquero <lekktu@gmail.com> | ||
| 191 | |||
| 192 | * keyboard.c (QCrtl): Rename from Qrtl. All uses changed. | ||
| 193 | |||
| 194 | 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 195 | |||
| 196 | * gnutls.c (emacs_gnutls_handshake): Return an error if we're not | ||
| 197 | supposed to be handshaking. (Bug#8556) | ||
| 198 | Reported by Paul Eggert <eggert@cs.ucla.edu>. | ||
| 199 | |||
| 200 | 2011-04-26 Daniel Colascione <dan.colascione@gmail.com> | ||
| 201 | |||
| 202 | * lisp.h (Qdebug): List symbol. | ||
| 203 | * eval.c (Qdebug): Restore global linkage. | ||
| 204 | * keyboard.c (debug-on-event): New variable. | ||
| 205 | (handle_user_signal): Break into debugger when debug-on-event | ||
| 206 | matches the current signal symbol. | ||
| 207 | |||
| 195 | 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu> | 208 | 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu> |
| 196 | 209 | ||
| 197 | * alloc.c (check_sblock, check_string_bytes) | 210 | * alloc.c (check_sblock, check_string_bytes) |
| @@ -2710,7 +2723,7 @@ | |||
| 2710 | Call gdk_x11_window_lookup_for_display. | 2723 | Call gdk_x11_window_lookup_for_display. |
| 2711 | (xg_set_widget_bg): New function. | 2724 | (xg_set_widget_bg): New function. |
| 2712 | (delete_cb): New function. | 2725 | (delete_cb): New function. |
| 2713 | (xg_create_frame_widgets): connect delete-event to delete_cb. | 2726 | (xg_create_frame_widgets): Connect delete-event to delete_cb. |
| 2714 | Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3 | 2727 | Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3 |
| 2715 | (xg_set_background_color): Call xg_set_widget_bg. | 2728 | (xg_set_background_color): Call xg_set_widget_bg. |
| 2716 | (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask. | 2729 | (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask. |
diff --git a/src/eval.c b/src/eval.c index d1f327021e6..8716ad78468 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -88,7 +88,7 @@ static Lisp_Object Qdebug_on_error; | |||
| 88 | static Lisp_Object Qdeclare; | 88 | static Lisp_Object Qdeclare; |
| 89 | Lisp_Object Qinternal_interpreter_environment, Qclosure; | 89 | Lisp_Object Qinternal_interpreter_environment, Qclosure; |
| 90 | 90 | ||
| 91 | static Lisp_Object Qdebug; | 91 | Lisp_Object Qdebug; |
| 92 | 92 | ||
| 93 | /* This holds either the symbol `run-hooks' or nil. | 93 | /* This holds either the symbol `run-hooks' or nil. |
| 94 | It is nil at an early stage of startup, and when Emacs | 94 | It is nil at an early stage of startup, and when Emacs |
diff --git a/src/gnutls.c b/src/gnutls.c index 1abccbbfbee..16a459bd62f 100644 --- a/src/gnutls.c +++ b/src/gnutls.c | |||
| @@ -73,6 +73,9 @@ emacs_gnutls_handshake (struct Lisp_Process *proc) | |||
| 73 | gnutls_session_t state = proc->gnutls_state; | 73 | gnutls_session_t state = proc->gnutls_state; |
| 74 | int ret; | 74 | int ret; |
| 75 | 75 | ||
| 76 | if (proc->gnutls_initstage < GNUTLS_STAGE_HANDSHAKE_CANDO) | ||
| 77 | return -1; | ||
| 78 | |||
| 76 | if (proc->gnutls_initstage < GNUTLS_STAGE_TRANSPORT_POINTERS_SET) | 79 | if (proc->gnutls_initstage < GNUTLS_STAGE_TRANSPORT_POINTERS_SET) |
| 77 | { | 80 | { |
| 78 | #ifdef WINDOWSNT | 81 | #ifdef WINDOWSNT |
| @@ -176,8 +179,7 @@ emacs_gnutls_read (int fildes, struct Lisp_Process *proc, char *buf, | |||
| 176 | 179 | ||
| 177 | if (proc->gnutls_initstage != GNUTLS_STAGE_READY) | 180 | if (proc->gnutls_initstage != GNUTLS_STAGE_READY) |
| 178 | { | 181 | { |
| 179 | if (GNUTLS_STAGE_HANDSHAKE_CANDO <= proc->gnutls_initstage) | 182 | emacs_gnutls_handshake (proc); |
| 180 | emacs_gnutls_handshake (proc); | ||
| 181 | return -1; | 183 | return -1; |
| 182 | } | 184 | } |
| 183 | rtnval = gnutls_read (state, buf, nbyte); | 185 | rtnval = gnutls_read (state, buf, nbyte); |
diff --git a/src/keyboard.c b/src/keyboard.c index 86b1afc86ab..6236c42e976 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -7228,12 +7228,29 @@ handle_user_signal (int sig) | |||
| 7228 | { | 7228 | { |
| 7229 | int old_errno = errno; | 7229 | int old_errno = errno; |
| 7230 | struct user_signal_info *p; | 7230 | struct user_signal_info *p; |
| 7231 | const char* special_event_name = NULL; | ||
| 7231 | 7232 | ||
| 7232 | SIGNAL_THREAD_CHECK (sig); | 7233 | SIGNAL_THREAD_CHECK (sig); |
| 7233 | 7234 | ||
| 7235 | if (SYMBOLP (Vdebug_on_event)) | ||
| 7236 | special_event_name = SDATA (SYMBOL_NAME (Vdebug_on_event)); | ||
| 7237 | |||
| 7234 | for (p = user_signals; p; p = p->next) | 7238 | for (p = user_signals; p; p = p->next) |
| 7235 | if (p->sig == sig) | 7239 | if (p->sig == sig) |
| 7236 | { | 7240 | { |
| 7241 | if (special_event_name && | ||
| 7242 | strcmp (special_event_name, p->name) == 0) | ||
| 7243 | { | ||
| 7244 | /* Enter the debugger in many ways. */ | ||
| 7245 | debug_on_next_call = 1; | ||
| 7246 | debug_on_quit = 1; | ||
| 7247 | Vquit_flag = Qt; | ||
| 7248 | Vinhibit_quit = Qnil; | ||
| 7249 | |||
| 7250 | /* Eat the event. */ | ||
| 7251 | break; | ||
| 7252 | } | ||
| 7253 | |||
| 7237 | p->npending++; | 7254 | p->npending++; |
| 7238 | #ifdef SIGIO | 7255 | #ifdef SIGIO |
| 7239 | if (interrupt_input) | 7256 | if (interrupt_input) |
| @@ -7906,7 +7923,7 @@ static int ntool_bar_items; | |||
| 7906 | /* The symbols `:image' and `:rtl'. */ | 7923 | /* The symbols `:image' and `:rtl'. */ |
| 7907 | 7924 | ||
| 7908 | static Lisp_Object QCimage; | 7925 | static Lisp_Object QCimage; |
| 7909 | static Lisp_Object Qrtl; | 7926 | static Lisp_Object QCrtl; |
| 7910 | 7927 | ||
| 7911 | /* Function prototypes. */ | 7928 | /* Function prototypes. */ |
| 7912 | 7929 | ||
| @@ -8223,7 +8240,7 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item) | |||
| 8223 | /* Value is either a single image specification or a vector | 8240 | /* Value is either a single image specification or a vector |
| 8224 | of 4 such specifications for the different button states. */ | 8241 | of 4 such specifications for the different button states. */ |
| 8225 | PROP (TOOL_BAR_ITEM_IMAGES) = value; | 8242 | PROP (TOOL_BAR_ITEM_IMAGES) = value; |
| 8226 | else if (EQ (ikey, Qrtl)) | 8243 | else if (EQ (ikey, QCrtl)) |
| 8227 | /* ':rtl STRING' */ | 8244 | /* ':rtl STRING' */ |
| 8228 | PROP (TOOL_BAR_ITEM_RTL_IMAGE) = value; | 8245 | PROP (TOOL_BAR_ITEM_RTL_IMAGE) = value; |
| 8229 | } | 8246 | } |
| @@ -11458,7 +11475,7 @@ syms_of_keyboard (void) | |||
| 11458 | /* Tool-bars. */ | 11475 | /* Tool-bars. */ |
| 11459 | DEFSYM (QCimage, ":image"); | 11476 | DEFSYM (QCimage, ":image"); |
| 11460 | DEFSYM (Qhelp_echo, "help-echo"); | 11477 | DEFSYM (Qhelp_echo, "help-echo"); |
| 11461 | DEFSYM (Qrtl, ":rtl"); | 11478 | DEFSYM (QCrtl, ":rtl"); |
| 11462 | 11479 | ||
| 11463 | staticpro (&item_properties); | 11480 | staticpro (&item_properties); |
| 11464 | item_properties = Qnil; | 11481 | item_properties = Qnil; |
| @@ -12165,6 +12182,17 @@ text in the region before modifying the buffer. The next | |||
| 12165 | `deactivate-mark' call uses this to set the window selection. */); | 12182 | `deactivate-mark' call uses this to set the window selection. */); |
| 12166 | Vsaved_region_selection = Qnil; | 12183 | Vsaved_region_selection = Qnil; |
| 12167 | 12184 | ||
| 12185 | DEFVAR_LISP ("debug-on-event", | ||
| 12186 | Vdebug_on_event, | ||
| 12187 | doc: /* Enter debugger on this event. When Emacs | ||
| 12188 | receives the special event specifed by this variable, it will try to | ||
| 12189 | break into the debugger as soon as possible instead of processing the | ||
| 12190 | event normally through `special-event-map'. | ||
| 12191 | |||
| 12192 | Currently, the only supported values for this | ||
| 12193 | variable are `sigusr1' and `sigusr2'. */); | ||
| 12194 | Vdebug_on_event = intern_c_string ("sigusr2"); | ||
| 12195 | |||
| 12168 | /* Create the initial keyboard. */ | 12196 | /* Create the initial keyboard. */ |
| 12169 | initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); | 12197 | initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); |
| 12170 | init_kboard (initial_kboard); | 12198 | init_kboard (initial_kboard); |
diff --git a/src/lisp.h b/src/lisp.h index 4b7973939ef..65b783f7b46 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2818,7 +2818,7 @@ extern void syms_of_lread (void); | |||
| 2818 | 2818 | ||
| 2819 | /* Defined in eval.c. */ | 2819 | /* Defined in eval.c. */ |
| 2820 | extern Lisp_Object Qautoload, Qexit, Qinteractive, Qcommandp, Qdefun, Qmacro; | 2820 | extern Lisp_Object Qautoload, Qexit, Qinteractive, Qcommandp, Qdefun, Qmacro; |
| 2821 | extern Lisp_Object Qinhibit_quit, Qclosure; | 2821 | extern Lisp_Object Qinhibit_quit, Qclosure, Qdebug; |
| 2822 | extern Lisp_Object Qand_rest; | 2822 | extern Lisp_Object Qand_rest; |
| 2823 | extern Lisp_Object Vautoload_queue; | 2823 | extern Lisp_Object Vautoload_queue; |
| 2824 | extern Lisp_Object Vsignaling_function; | 2824 | extern Lisp_Object Vsignaling_function; |