Now on revision 108670. ------------------------------------------------------------ revno: 108670 committer: Paul Eggert branch nick: trunk timestamp: Wed 2012-06-20 14:20:06 -0700 message: * fileio.c (Fdefault_file_modes): Block input while fiddling with umask. Otherwise, the umask might be mistakenly 0 while handling input signals. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-06-19 18:57:39 +0000 +++ src/ChangeLog 2012-06-20 21:20:06 +0000 @@ -1,3 +1,8 @@ +2012-06-20 Paul Eggert + + * fileio.c (Fdefault_file_modes): Block input while fiddling with umask. + Otherwise, the umask might be mistakenly 0 while handling input signals. + 2012-06-19 Stefan Monnier * minibuf.c (Fread_string): Bind minibuffer-completion-table. === modified file 'src/fileio.c' --- src/fileio.c 2012-06-16 12:24:15 +0000 +++ src/fileio.c 2012-06-20 21:20:06 +0000 @@ -3014,8 +3014,10 @@ int realmask; Lisp_Object value; + BLOCK_INPUT; realmask = umask (0); umask (realmask); + UNBLOCK_INPUT; XSETINT (value, (~ realmask) & 0777); return value; ------------------------------------------------------------ revno: 108669 committer: Chong Yidong branch nick: trunk timestamp: Wed 2012-06-20 12:21:57 -0400 message: term.el (term-send-raw-meta): Make C-M- keys work (Bug#8172). -------------- This lime and the following will be ignored -------------- modified: lisp/ChangeLog lisp/term.el diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-20 15:51:34 +0000 +++ lisp/ChangeLog 2012-06-20 16:21:57 +0000 @@ -1,3 +1,7 @@ +2012-06-20 Chong Yidong + + * term.el (term-send-raw-meta): Make C-M- keys work (Bug#8172). + 2012-06-20 David Röthlisberger (tiny change) * ido.el (ido-switch-buffer, ido-find-file): Fix up doc of C-j === modified file 'lisp/term.el' --- lisp/term.el 2012-06-20 09:21:06 +0000 +++ lisp/term.el 2012-06-20 16:21:57 +0000 @@ -1174,21 +1174,21 @@ (defun term-send-raw-meta () (interactive) (let ((char last-input-event)) - (when (symbolp last-input-event) + (when (symbolp char) ;; Convert `return' to C-m, etc. (let ((tmp (get char 'event-symbol-elements))) - (when tmp - (setq char (car tmp))) - (when (symbolp char) - (setq tmp (get char 'ascii-character)) - (when tmp - (setq char tmp))))) - (setq char (event-basic-type char)) - (term-send-raw-string (if (and (numberp char) - (> char 127) - (< char 256)) - (make-string 1 char) - (format "\e%c" char))))) + (if tmp (setq char (car tmp))) + (and (symbolp char) + (setq tmp (get char 'ascii-character)) + (setq char tmp)))) + (when (numberp char) + (let ((base (event-basic-type char)) + (mods (delq 'meta (event-modifiers char)))) + (if (memq 'control mods) + (setq mods (delq 'shift mods))) + (term-send-raw-string + (format "\e%c" + (event-convert-list (append mods (list base))))))))) (defun term-mouse-paste (click) "Insert the primary selection at the position clicked on." ------------------------------------------------------------ revno: 108668 fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11201 author: David Röthlisberger committer: Stefan Monnier branch nick: trunk timestamp: Wed 2012-06-20 11:51:34 -0400 message: * lisp/ido.el (ido-switch-buffer, ido-find-file): Fix up doc of C-j. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-20 09:21:06 +0000 +++ lisp/ChangeLog 2012-06-20 15:51:34 +0000 @@ -1,17 +1,22 @@ +2012-06-20 David Röthlisberger (tiny change) + + * ido.el (ido-switch-buffer, ido-find-file): Fix up doc of C-j + (bug#11201). + 2012-06-20 Chong Yidong * term.el (term-window-width): Handle the case of a missing right fringe (Bug#8837). (term-check-size): Use window-text-height (Bug#5445). - (term-mode): Use define-derived-mode. Minor cleanups. Set - font-lock-defaults (Bug#7692). + (term-mode): Use define-derived-mode. Minor cleanups. + Set font-lock-defaults (Bug#7692). (term-move-columns, term-insert-char, term-emulate-terminal) (term-erase-in-line, term-insert-spaces): Use font-lock-face. 2012-06-20 Michael Albinus - * net/ange-ftp.el (ange-ftp-get-passwd): Bind - `enable-recursive-minibuffers'. + * net/ange-ftp.el (ange-ftp-get-passwd): + Bind `enable-recursive-minibuffers'. (ange-ftp-get-process): Throw if `non-essential' is non-nil. 2012-06-19 David Röthlisberger (tiny change) === modified file 'lisp/ido.el' --- lisp/ido.el 2012-06-19 18:17:14 +0000 +++ lisp/ido.el 2012-06-20 15:51:34 +0000 @@ -4046,8 +4046,7 @@ RET Select the buffer at the front of the list of matches. If the list is empty, possibly prompt to create new buffer. -\\[ido-select-text] Select the current prompt as the buffer. -If no buffer is found, prompt for a new one. +\\[ido-select-text] Use the current input string verbatim. \\[ido-next-match] Put the first element at the end of the list. \\[ido-prev-match] Put the last element at the start of the list. @@ -4133,8 +4132,7 @@ RET Select the file at the front of the list of matches. If the list is empty, possibly prompt to create new file. -\\[ido-select-text] Select the current prompt as the buffer or file. -If no buffer or file is found, prompt for a new one. +\\[ido-select-text] Use the current input string verbatim. \\[ido-next-match] Put the first element at the end of the list. \\[ido-prev-match] Put the last element at the start of the list. ------------------------------------------------------------ revno: 108667 fixes bug(s): http://debbugs.gnu.org/7692 committer: Chong Yidong branch nick: trunk timestamp: Wed 2012-06-20 17:21:06 +0800 message: Change term.el to use font-lock. * term.el (term-mode): Set font-lock-defaults. (term-move-columns, term-insert-char, term-emulate-terminal) (term-erase-in-line, term-insert-spaces): Use font-lock-face. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-20 08:34:21 +0000 +++ lisp/ChangeLog 2012-06-20 09:21:06 +0000 @@ -3,7 +3,10 @@ * term.el (term-window-width): Handle the case of a missing right fringe (Bug#8837). (term-check-size): Use window-text-height (Bug#5445). - (term-mode): Use define-derived-mode. Minor cleanups. + (term-mode): Use define-derived-mode. Minor cleanups. Set + font-lock-defaults (Bug#7692). + (term-move-columns, term-insert-char, term-emulate-terminal) + (term-erase-in-line, term-insert-spaces): Use font-lock-face. 2012-06-20 Michael Albinus === modified file 'lisp/term.el' --- lisp/term.el 2012-06-20 08:34:21 +0000 +++ lisp/term.el 2012-06-20 09:21:06 +0000 @@ -1100,7 +1100,9 @@ (set (make-local-variable 'term-pending-frame) nil) ;; Cua-mode's keybindings interfere with the term keybindings, disable it. (set (make-local-variable 'cua-mode) nil) - (run-mode-hooks 'term-mode-hook) + + (set (make-local-variable 'font-lock-defaults) '(nil t)) + (when (featurep 'xemacs) (set-buffer-menubar (append current-menubar (list term-terminal-menu)))) @@ -2583,13 +2585,13 @@ ;; from the last character on the line, set the face for the chars ;; to default. (when (> (point) point-at-eol) - (put-text-property point-at-eol (point) 'face 'default)))) + (put-text-property point-at-eol (point) 'font-lock-face 'default)))) ;; Insert COUNT copies of CHAR in the default face. (defun term-insert-char (char count) (let ((old-point (point))) (insert-char char count) - (put-text-property old-point (point) 'face 'default))) + (put-text-property old-point (point) 'font-lock-face 'default))) (defun term-current-row () (cond (term-current-row) @@ -2813,7 +2815,7 @@ (setq term-current-column nil) (put-text-property old-point (point) - 'face term-current-face) + 'font-lock-face term-current-face) ;; If the last char was written in last column, ;; back up one column, but remember we did so. ;; Thus we emulate xterm/vt100-style line-wrapping. @@ -3713,7 +3715,7 @@ (when wrapped (insert ? )) (insert ?\n) - (put-text-property saved-point (point) 'face 'default) + (put-text-property saved-point (point) 'font-lock-face 'default) (goto-char saved-point)))) (defun term-erase-in-display (kind) @@ -3761,7 +3763,7 @@ ;; from the last character on the line, set the face for the chars ;; to default. (when (>= (point) pnt-at-eol) - (put-text-property pnt-at-eol (point) 'face 'default)) + (put-text-property pnt-at-eol (point) 'font-lock-face 'default)) (when (> save-eol (point)) (delete-region (point) save-eol)) (goto-char save-point) ------------------------------------------------------------ revno: 108666 fixes bug(s): http://debbugs.gnu.org/8837 committer: Chong Yidong branch nick: trunk timestamp: Wed 2012-06-20 16:34:21 +0800 message: Fixes to window size calculations in term.el. * term.el (term-window-width): Handle the case of a missing right fringe. (term-check-size): Use window-text-height. (term-mode): Use define-derived-mode. Minor cleanups. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-20 06:51:53 +0000 +++ lisp/ChangeLog 2012-06-20 08:34:21 +0000 @@ -1,3 +1,10 @@ +2012-06-20 Chong Yidong + + * term.el (term-window-width): Handle the case of a missing right + fringe (Bug#8837). + (term-check-size): Use window-text-height (Bug#5445). + (term-mode): Use define-derived-mode. Minor cleanups. + 2012-06-20 Michael Albinus * net/ange-ftp.el (ange-ftp-get-passwd): Bind === modified file 'lisp/term.el' --- lisp/term.el 2012-06-17 08:26:13 +0000 +++ lisp/term.el 2012-06-20 08:34:21 +0000 @@ -919,11 +919,12 @@ (defvar overflow-newline-into-fringe) (defun term-window-width () - (if (featurep 'xemacs) - (1- (window-width)) - (if (and window-system overflow-newline-into-fringe) - (window-width) - (1- (window-width))))) + (if (and (not (featurep 'xemacs)) + (display-graphic-p) + overflow-newline-into-fringe + (/= (frame-parameter nil 'right-fringe) 0)) + (window-width) + (1- (window-width)))) (put 'term-mode 'mode-class 'special) @@ -963,7 +964,7 @@ (setq term-ansi-face-already-done t) (setq term-ansi-current-bg-color 0)) -(defun term-mode () +(define-derived-mode term-mode fundamental-mode "Term" "Major mode for interacting with an inferior interpreter. The interpreter name is same as buffer name, sans the asterisks. @@ -1007,56 +1008,38 @@ \\{term-mode-map} Entry to this mode runs the hooks on `term-mode-hook'." - (interactive) - ;; Do not remove this. All major modes must do this. - (kill-all-local-variables) - (setq major-mode 'term-mode) - (setq mode-name "Term") - (use-local-map term-mode-map) ;; we do not want indent to sneak in any tabs (setq indent-tabs-mode nil) (setq buffer-display-table term-display-table) - (make-local-variable 'term-home-marker) - (setq term-home-marker (copy-marker 0)) + (set (make-local-variable 'term-home-marker) (copy-marker 0)) + (set (make-local-variable 'term-height) (1- (window-height))) + (set (make-local-variable 'term-width) (term-window-width)) + (set (make-local-variable 'term-last-input-start) (make-marker)) + (set (make-local-variable 'term-last-input-end) (make-marker)) + (set (make-local-variable 'term-last-input-match) "") + (set (make-local-variable 'term-command-hook) + (symbol-function 'term-command-hook)) + + ;; These local variables are set to their local values: (make-local-variable 'term-saved-home-marker) - (make-local-variable 'term-height) - (make-local-variable 'term-width) - (setq term-width (term-window-width)) - (setq term-height (1- (window-height))) (make-local-variable 'term-terminal-parameter) (make-local-variable 'term-saved-cursor) - (make-local-variable 'term-last-input-start) - (setq term-last-input-start (make-marker)) - (make-local-variable 'term-last-input-end) - (setq term-last-input-end (make-marker)) - (make-local-variable 'term-last-input-match) - (setq term-last-input-match "") - (make-local-variable 'term-prompt-regexp) ; Don't set; default - (make-local-variable 'term-input-ring-size) ; ...to global val. + (make-local-variable 'term-prompt-regexp) + (make-local-variable 'term-input-ring-size) (make-local-variable 'term-input-ring) (make-local-variable 'term-input-ring-file-name) - (or (and (boundp 'term-input-ring) term-input-ring) - (setq term-input-ring (make-ring term-input-ring-size))) (make-local-variable 'term-input-ring-index) - (or (and (boundp 'term-input-ring-index) term-input-ring-index) - (setq term-input-ring-index nil)) - - (make-local-variable 'term-command-hook) - (setq term-command-hook (symbol-function 'term-command-hook)) + (unless term-input-ring + (setq term-input-ring (make-ring term-input-ring-size))) ;; I'm not sure these saves are necessary but, since I ;; haven't tested the whole thing on a net connected machine with ;; a properly configured ange-ftp, I've decided to be conservative ;; and put them in. -mm - (make-local-variable 'term-ansi-at-host) - (setq term-ansi-at-host (system-name)) - - (make-local-variable 'term-ansi-at-dir) - (setq term-ansi-at-dir default-directory) - - (make-local-variable 'term-ansi-at-message) - (setq term-ansi-at-message nil) + (set (make-local-variable 'term-ansi-at-host) (system-name)) + (set (make-local-variable 'term-ansi-at-dir) default-directory) + (set (make-local-variable 'term-ansi-at-message) nil) ;; For user tracking purposes -mm (make-local-variable 'ange-ftp-default-user) @@ -1089,8 +1072,7 @@ (make-local-variable 'term-current-row) (make-local-variable 'term-log-buffer) (make-local-variable 'term-scroll-start) - (make-local-variable 'term-scroll-end) - (setq term-scroll-end term-height) + (set (make-local-variable 'term-scroll-end) term-height) (make-local-variable 'term-scroll-with-delete) (make-local-variable 'term-pager-count) (make-local-variable 'term-pager-old-local-map) @@ -1112,12 +1094,10 @@ (make-local-variable 'term-ptyp) (make-local-variable 'term-exec-hook) (make-local-variable 'term-vertical-motion) - (make-local-variable 'term-pending-delete-marker) - (setq term-pending-delete-marker (make-marker)) + (set (make-local-variable 'term-pending-delete-marker) (make-marker)) (make-local-variable 'term-current-face) (term-ansi-reset) - (make-local-variable 'term-pending-frame) - (setq term-pending-frame nil) + (set (make-local-variable 'term-pending-frame) nil) ;; Cua-mode's keybindings interfere with the term keybindings, disable it. (set (make-local-variable 'cua-mode) nil) (run-mode-hooks 'term-mode-hook) @@ -1165,9 +1145,9 @@ found)) (defun term-check-size (process) - (when (or (/= term-height (1- (window-height))) + (when (or (/= term-height (window-text-height)) (/= term-width (term-window-width))) - (term-reset-size (1- (window-height)) (term-window-width)) + (term-reset-size (window-text-height) (term-window-width)) (set-process-window-size process term-height term-width))) (defun term-send-raw-string (chars) ------------------------------------------------------------ revno: 108665 committer: Michael Albinus branch nick: trunk timestamp: Wed 2012-06-20 08:51:53 +0200 message: * net/ange-ftp.el (ange-ftp-get-passwd): Bind `enable-recursive-minibuffers'. (ange-ftp-get-process): Throw if `non-essential' is non-nil. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-19 18:17:14 +0000 +++ lisp/ChangeLog 2012-06-20 06:51:53 +0000 @@ -1,3 +1,9 @@ +2012-06-20 Michael Albinus + + * net/ange-ftp.el (ange-ftp-get-passwd): Bind + `enable-recursive-minibuffers'. + (ange-ftp-get-process): Throw if `non-essential' is non-nil. + 2012-06-19 David Röthlisberger (tiny change) * ido.el (ido-find-file): Mention C-d binding in docstring (bug#11244). === modified file 'lisp/net/ange-ftp.el' --- lisp/net/ange-ftp.el 2012-06-17 18:54:39 +0000 +++ lisp/net/ange-ftp.el 2012-06-20 06:51:53 +0000 @@ -1230,7 +1230,8 @@ ;; see if same user has logged in to other hosts; if so then prompt ;; with the password that was used there. (t - (let* ((other (ange-ftp-get-host-with-passwd user)) + (let* ((enable-recursive-minibuffers t) + (other (ange-ftp-get-host-with-passwd user)) (passwd (if other ;; found another machine with the same user. @@ -2131,6 +2132,11 @@ (proc (get-process name))) (if (and proc (memq (process-status proc) '(run open))) proc + ;; If `non-essential' is non-nil, don't reopen a new connection. It + ;; will be catched in Tramp. + (when non-essential + (throw 'non-essential 'non-essential)) + ;; Must delete dead process so that new process can reuse the name. (if proc (delete-process proc)) (let ((pass (ange-ftp-quote-string