+2013-07-06 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * subr.el (read-quoted-char): Use read-key.
+ (sit-for): Let read-event decode tty input (bug#14782).
+
2013-07-05 Stephen Berman <stephen.berman@gmx.net>
* calendar/todo-mode.el: Add handling of file deletion, both by
- mode command and externally. Fix various related bugs. Clarify
- Commentary and improve some documentation strings and code.
+ mode command and externally. Fix various related bugs.
+ Clarify Commentary and improve some documentation strings and code.
(todo-delete-file): New command.
(todo-check-file): New function.
(todo-show): Handle external deletion of the file we're trying to
(todo-find-archive): Check whether there are any archives.
Replace unnecessary setq by let-binding.
(todo-archive-done-item): Use find-file-noselect to get the
- archive buffer whether or not the archive already exists. Remove
- superfluous code. Use file size instead of buffer-file-name to
+ archive buffer whether or not the archive already exists.
+ Remove superfluous code. Use file size instead of buffer-file-name to
check if the archive is new; if it is, update list of archives.
(todo-default-todo-file): Allow nil to be a valid value for when
there are no todo files.
2013-07-05 Michael Albinus <michael.albinus@gmx.de>
- * net/tramp-sh.el (tramp-sh-handle-file-notify-add-watch): Support
- both "gvfs-monitor-dir" and "inotifywait".
- (tramp-sh-file-inotifywait-process-filter): Renamed from
+ * net/tramp-sh.el (tramp-sh-handle-file-notify-add-watch):
+ Support both "gvfs-monitor-dir" and "inotifywait".
+ (tramp-sh-file-inotifywait-process-filter): Rename from
`tramp-sh-file-notify-process-filter'.
(tramp-sh-file-gvfs-monitor-dir-process-filter)
(tramp-get-remote-gvfs-monitor-dir): New defuns.
* subr.el (file-notify-handle-event): Move function to filenotify.el.
- * net/tramp.el (tramp-file-name-for-operation): Handle
- `file-notify-add-watch' and `file-notify-rm-watch'.
+ * net/tramp.el (tramp-file-name-for-operation):
+ Handle `file-notify-add-watch' and `file-notify-rm-watch'.
* net/tramp-sh.el (tramp-sh-file-name-handler-alist): Add handler
for `file-notify-add-watch' and `file-notify-rm-watch'.
or the octal character code.
RET terminates the character code and is discarded;
any other non-digit terminates the character code and is then used as input."))
- (setq char (read-event (and prompt (format "%s-" prompt)) t))
+ (setq translated (read-key (and prompt (format "%s-" prompt))))
(if inhibit-quit (setq quit-flag nil)))
- ;; Translate TAB key into control-I ASCII character, and so on.
- ;; Note: `read-char' does it using the `ascii-character' property.
- ;; We should try and use read-key instead.
- (let ((translation (lookup-key local-function-key-map (vector char))))
- (setq translated (if (arrayp translation)
- (aref translation 0)
- char)))
(if (integerp translated)
(setq translated (char-resolve-modifiers translated)))
(cond ((null translated))
((not (integerp translated))
- (setq unread-command-events (list char)
+ (setq unread-command-events
+ (listify-key-sequence (this-single-command-raw-keys))
done t))
((/= (logand translated ?\M-\^@) 0)
;; Turn a meta-character into a character with the 0200 bit set.
((and (not first) (eq translated ?\C-m))
(setq done t))
((not first)
- (setq unread-command-events (list char)
+ (setq unread-command-events
+ (listify-key-sequence (this-single-command-raw-keys))
done t))
(t (setq code translated
done t)))
where the optional arg MILLISECONDS specifies an additional wait period,
in milliseconds; this was useful when Emacs was built without
floating point support."
+ (declare (advertised-calling-convention (seconds &optional nodisp) "22.1"))
(if (numberp nodisp)
(setq seconds (+ seconds (* 1e-3 nodisp))
nodisp obsolete)
(or nodisp (redisplay)))
(t
(or nodisp (redisplay))
- (let ((read (read-event nil nil seconds)))
+ ;; FIXME: we should not read-event here at all, because it's much too
+ ;; difficult to reliably "undo" a read-event by pushing it onto
+ ;; unread-command-events.
+ (let ((read (read-event nil t seconds)))
(or (null read)
(progn
;; If last command was a prefix arg, e.g. C-u, push this event onto
(setq read (cons t read)))
(push read unread-command-events)
nil))))))
-(set-advertised-calling-convention 'sit-for '(seconds &optional nodisp) "22.1")
(defun y-or-n-p (prompt)
"Ask user a \"y or n\" question. Return t if answer is \"y\".
(recenter (/ (window-height) 2))))
(message (or message "Type %s to continue editing.")
(single-key-description exit-char))
- (let ((event (read-event)))
+ (let ((event (read-key)))
;; `exit-char' can be an event, or an event description list.
(or (eq event exit-char)
(eq event (event-convert-list exit-char))
- (setq unread-command-events (list event)))))
+ (setq unread-command-events
+ (append (this-single-command-raw-keys))))))
(delete-overlay ol))))
\f