# HG changeset patch # User Stefan Monnier # Date 1284730230 -7200 # Node ID 22d1a86dc0dada8da1a6c9cc43fb79821d267641 # Parent 9718a33c16dc70888a670763da9a5c69bb0f2b44 * lisp/subr.el (y-or-n-p): Add the "(y or n)" that was lost somehow. diff -r 9718a33c16dc -r 22d1a86dc0da lisp/ChangeLog --- a/lisp/ChangeLog Fri Sep 17 14:30:04 2010 +0200 +++ b/lisp/ChangeLog Fri Sep 17 15:30:30 2010 +0200 @@ -1,3 +1,7 @@ +2010-09-17 Stefan Monnier + + * subr.el (y-or-n-p): Add the "(y or n)" that was lost somehow. + 2010-09-17 Stephen Berman * dframe.el (dframe-reposition-frame-emacs): Use tool-bar-pixel-width @@ -11,8 +15,7 @@ 2010-09-16 Chong Yidong - * mail/sendmail.el: Add "*unsent mail*" to - same-window-buffer-names. + * mail/sendmail.el: Add "*unsent mail*" to same-window-buffer-names. * term/x-win.el (x-cut-buffer-or-selection-value): Define as obsolete alias for x-selection-value. @@ -34,19 +37,19 @@ * net/tramp-gvfs.el (top): * net/tramp-cache.el (top): Use `tramp-compat-font-lock-add-keywords'. - * net/tramp.el (tramp-progress-reporter-update): Use - `tramp-compat-funcall'. + * net/tramp.el (tramp-progress-reporter-update): + Use `tramp-compat-funcall'. * net/tramp.el (tramp-process-actions): * net/tramp-gvfs.el (tramp-handle-vc-registered): * net/tramp-sh.el (tramp-gvfs-handler-askquestion) - (tramp-get-remote-stat, tramp-get-remote-readlink): Use - `tramp-compat-with-temp-message'. + (tramp-get-remote-stat, tramp-get-remote-readlink): + Use `tramp-compat-with-temp-message'. * net/tramp-sh.el (top): Require 'cl. (tramp-handle-start-file-process): Use `tramp-compat-process-get'. - (tramp-open-connection-setup-interactive-shell): Use - `tramp-compat-process-put'. + (tramp-open-connection-setup-interactive-shell): + Use `tramp-compat-process-put'. 2010-09-15 Alan Mackenzie @@ -269,7 +272,7 @@ (tramp-dissect-file-name): Don't check anymore for multi-hop methods. (tramp-debug-outline-regexp): Add a docstring. - (tramp-debug-outline-level): Renamed from `tramp-outline-level'. + (tramp-debug-outline-level): Rename from `tramp-outline-level'. (tramp-get-debug-buffer): Use it. * net/tramp-cache.el (top): Set tramp-autoload cookie for @@ -289,9 +292,9 @@ * net/tramp-sh.el: New file, derived from tramp.el. (top): Initialize `tramp-methods', `tramp-default-method-alist', `tramp-default-user-alist', `tramp-foreign-file-name-handler-alist'. - Remove "scp1_old", "scp2_old", "ssh1_old", "ssh2_old". Use - `ignore-errors' where appropriate. - (tramp-sh-file-name-handler-alist): Renamed from + Remove "scp1_old", "scp2_old", "ssh1_old", "ssh2_old". + Use `ignore-errors' where appropriate. + (tramp-sh-file-name-handler-alist): Rename from `tramp-file-name-handler-alist'. (tramp-send-command-and-check): Return t or nil. Remove all `zerop' checks, where called. @@ -317,7 +320,7 @@ 2010-09-12 Stefan Monnier - * subr.el (y-or-n-p): New function, moved from src/fns.c. Use read-key. + * subr.el (y-or-n-p): New function, moved from src/fns.c; use read-key. 2010-09-12 Leo @@ -358,12 +361,10 @@ (sql-comint-mysql): Handle "sql-port" as a numeric. (sql-port-history): Delete unused variable. (sql-get-login): Default "sql-port" to a number. - (sql-product-alist): Correct Postgres prompt and terminator - regexp. + (sql-product-alist): Correct Postgres prompt and terminator regexp. (sql-sqlite-program): Dynamically detect presence of "sqlite" or "sqlite3" executables. - (sql-sqlite-login-params): Add "*.sqlite[23]?" database name - pattern. + (sql-sqlite-login-params): Add "*.sqlite[23]?" database name pattern. (sql-buffer-live-p): New function. (sql-mode-menu, sql-send-string): Use it. (sql-mode-oracle-font-lock-keywords): Improve SQL*Plus REMARK @@ -373,7 +374,7 @@ 2010-09-10 Lars Magne Ingebrigtsen - * net/netrc.el (netrc-credentials): New conveniency function. + * net/netrc.el (netrc-credentials): New convenience function. 2010-09-10 Stefan Monnier diff -r 9718a33c16dc -r 22d1a86dc0da lisp/subr.el --- a/lisp/subr.el Fri Sep 17 14:30:04 2010 +0200 +++ b/lisp/subr.el Fri Sep 17 15:30:30 2010 +0200 @@ -3376,19 +3376,26 @@ ;; ¡Beware! when I tried to edebug this code, Emacs got into a weird state ;; where all the keys were unbound (i.e. it somehow got triggered ;; within read-key, apparently). I had to kill it. - (let ((answer 'none) - (xprompt prompt)) + (let ((answer 'recenter)) (if (and (display-popup-menus-p) (listp last-nonmenu-event) use-dialog-box) (setq answer (x-popup-dialog t `(,prompt ("yes" . act) ("No" . skip)))) + (setq prompt (concat prompt + (if (eq ?\s (aref prompt (1- (length prompt)))) + "" " ") + "(y or n) ")) (while (let* ((key (let ((cursor-in-echo-area t)) (when minibuffer-auto-raise (raise-frame (window-frame (minibuffer-window)))) - (read-key (propertize xprompt 'face 'minibuffer-prompt))))) + (read-key (propertize (if (eq answer 'recenter) + prompt + (concat "Please answer y or n. " + prompt)) + 'face 'minibuffer-prompt))))) (setq answer (lookup-key query-replace-map (vector key) t)) (cond ((memq answer '(skip act)) nil)