diff options
| author | Glenn Morris <rgm@gnu.org> | 2014-05-07 20:41:21 -0700 |
|---|---|---|
| committer | Glenn Morris <rgm@gnu.org> | 2014-05-07 20:41:21 -0700 |
| commit | fb3f83f5fd9e80347c8b8e36f6eaefbb912fe57b (patch) | |
| tree | f106c360c3aef01bcacdc77b66b7c5b20261502e /lisp | |
| parent | 1ba38c429fa6ce17568771ef51c8e53b1a72bb94 (diff) | |
| parent | 606695a67801acfd1792110e4ea3228b50b0117d (diff) | |
| download | emacs-fb3f83f5fd9e80347c8b8e36f6eaefbb912fe57b.tar.gz | |
Merge from emacs-24; up to 2014-05-08T03:34:20Z!rgm@gnu.org
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 82 | ||||
| -rw-r--r-- | lisp/calendar/todo-mode.el | 3 | ||||
| -rw-r--r-- | lisp/electric.el | 3 | ||||
| -rw-r--r-- | lisp/emacs-lisp/find-gc.el | 92 | ||||
| -rw-r--r-- | lisp/emacs-lisp/package.el | 28 | ||||
| -rw-r--r-- | lisp/gnus/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/gnus/gnus-fun.el | 9 | ||||
| -rw-r--r-- | lisp/help-fns.el | 10 | ||||
| -rw-r--r-- | lisp/minibuffer.el | 60 | ||||
| -rw-r--r-- | lisp/net/browse-url.el | 3 | ||||
| -rw-r--r-- | lisp/net/tramp-sh.el | 52 | ||||
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 7 | ||||
| -rw-r--r-- | lisp/xt-mouse.el | 105 |
13 files changed, 294 insertions, 165 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bdf4e46e9d1..4111e3dfcda 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,81 @@ +2014-05-08 Stefan Monnier <monnier@iro.umontreal.ca> + + * xt-mouse.el: Drop spurious/oddly shaped events (bug#17378). + (xterm-mouse--read-event-sequence-1000): Return nil if something + looks fishy. + (xterm-mouse-event): Propagate it. + (xterm-mouse-translate-1): Handle it. + +2014-05-08 Stephen Berman <stephen.berman@gmx.net> + + * calendar/todo-mode.el (todo-insert-item--apply-args): When all + four slots of the parameter list are filled, make sure to pass it + to the argument list of todo-insert-item--basic. + +2014-05-08 Stefan Monnier <monnier@iro.umontreal.ca> + + * emacs-lisp/package.el (package-compute-transaction): Topological sort. + Add optional `seen' argument to detect and break infinite loops. + +2014-05-08 Eli Zaretskii <eliz@gnu.org> + + * emacs-lisp/find-gc.el (find-gc-unsafe, find-unsafe-funcs) + (trace-unsafe, trace-use-tree): Make parentheses style be + according to Emacs style. + +2014-05-08 Michael Albinus <michael.albinus@gmx.de> + + * net/tramp-sh.el (tramp-remote-process-environment): + Remove HISTFILE and HISTSIZE; it's too late to set them here. + Add :version entry. + (tramp-open-shell): Do not let-bind `tramp-end-of-output'. + Add "HISTSIZE=/dev/null" to the shell's env arguments. Do not send + extra "PSx=..." commands. + (tramp-maybe-open-connection): Setenv HISTFILE to /dev/null. + (Bug#17295) + + (tramp-uudecode): Replace the hard-coded temporary file name by a + format specifier. + (tramp-remote-coding-commands): Enhance docstring. + (tramp-find-inline-encoding): Replace "%t" by a temporary file + name. (Bug#17415) + +2014-05-08 Glenn Morris <rgm@gnu.org> + + * emacs-lisp/find-gc.el (find-gc-source-directory): Give it a value. + (find-gc-source-files): Update some names. + (trace-call-tree): Simplify and update. + Avoid predictable temp-file names. (http://bugs.debian.org/747100) + +2014-05-08 Stefan Monnier <monnier@iro.umontreal.ca> + + * minibuffer.el (completion--try-word-completion): Revert fix for + Bug#15980 (bug#17375). + + * xt-mouse.el (xterm-mouse--read-event-sequence-1000): (bug#17378) + Always store button numbers in the same way in xterm-mouse-last; + Don't burp is xterm-mouse-last is not set as expected. + Never return negative indices. + +2014-05-08 Dmitry Gutov <dgutov@yandex.ru> + + * progmodes/ruby-mode.el (ruby-syntax-propertize-function): + Backtrack one char if the global/char-literal var matcher hits + inside a string. The next char could be the beginning of an + expression expansion. + +2014-05-08 Glenn Morris <rgm@gnu.org> + + * help-fns.el (describe-function-1): Test for an autoload before a + macro, since `macrop' works on autoloads. (Bug#17410) + +2014-05-08 Stefan Monnier <monnier@iro.umontreal.ca> + + * electric.el (electric-indent-functions-without-reindent): Add yaml. + + * minibuffer.el (completion-table-with-quoting) <completion--unquote>: + Make sure the new point we return is within the new string (bug#17239). + 2014-05-05 Daniel Colascione <dancol@dancol.org> * progmodes/compile.el (compilation-error-regexp-alist-alist): @@ -84,8 +162,8 @@ (todo-edit-done-item--param-key-alist): New defconsts. (todo-edit-item--prompt): New variable. (todo-edit-item--next-key): New function. - (todo-key-bindings-t): Bind "e" to todo-edit-item. Remove - bindings of deleted commands. + (todo-key-bindings-t): Bind "e" to todo-edit-item. + Remove bindings of deleted commands. 2014-05-04 Leo Liu <sdl.web@gmail.com> diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index ddc3a4843c9..4f4aefa6317 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el @@ -5360,7 +5360,8 @@ occupied by `nil'." (list (car (todo-insert-item--argsleft (todo-insert-item--this-key) todo-insert-item--argsleft))))) - (arglist (unless (= 4 (length args)) + (arglist (if (= 4 (length args)) + args (let ((v (make-vector 4 nil)) elt) (while args (setq elt (pop args)) diff --git a/lisp/electric.el b/lisp/electric.el index 52b0595f7d9..e8ceaa6406c 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -221,7 +221,8 @@ Python does not lend itself to fully automatic indentation.") (defvar electric-indent-functions-without-reindent '(indent-relative indent-to-left-margin indent-relative-maybe py-indent-line coffee-indent-line org-indent-line yaml-indent-line - haskell-indentation-indent-line haskell-indent-cycle haskell-simple-indent) + haskell-indentation-indent-line haskell-indent-cycle haskell-simple-indent + yaml-indent-line) "List of indent functions that can't reindent. If `line-indent-function' is one of those, then `electric-indent-mode' will not try to reindent lines. It is normally better to make the major diff --git a/lisp/emacs-lisp/find-gc.el b/lisp/emacs-lisp/find-gc.el index ff9062150db..83eb26e86d7 100644 --- a/lisp/emacs-lisp/find-gc.el +++ b/lisp/emacs-lisp/find-gc.el @@ -23,14 +23,15 @@ ;; Produce in find-gc-unsafe-list the set of all functions that may invoke GC. ;; This expects the Emacs sources to live in find-gc-source-directory. -;; It creates a temporary working directory /tmp/esrc. ;;; Code: (defvar find-gc-unsafe-list nil "The list of unsafe functions is placed here by `find-gc-unsafe'.") -(defvar find-gc-source-directory) +(defvar find-gc-source-directory + (file-name-as-directory (expand-file-name "src" source-directory)) + "Directory containing Emacs C sources.") (defvar find-gc-subrs-callers nil "Alist of users of subrs, from GC testing. @@ -59,22 +60,21 @@ Each entry has the form (FUNCTION . FUNCTIONS-IT-CALLS).") "indent.c" "search.c" "regex.c" "undo.c" "alloc.c" "data.c" "doc.c" "editfns.c" "callint.c" "eval.c" "fns.c" "print.c" "lread.c" - "abbrev.c" "syntax.c" "unexcoff.c" + "syntax.c" "unexcoff.c" "bytecode.c" "process.c" "callproc.c" "doprnt.c" - "x11term.c" "x11fns.c")) + "xterm.c" "xfns.c")) (defun find-gc-unsafe () "Return a list of unsafe functions--that is, which can call GC. -Also store it in `find-gc-unsafe'." +Also store it in `find-gc-unsafe-list'." (trace-call-tree nil) (trace-use-tree) (find-unsafe-funcs 'Fgarbage_collect) (setq find-gc-unsafe-list (sort find-gc-unsafe-list (function (lambda (x y) - (string-lessp (car x) (car y)))))) -) + (string-lessp (car x) (car y))))))) ;;; This does a depth-first search to find all functions that can ;;; ultimately call the function "target". The result is an a-list @@ -84,8 +84,7 @@ Also store it in `find-gc-unsafe'." (defun find-unsafe-funcs (target) (setq find-gc-unsafe-list (list (list target))) - (trace-unsafe target) -) + (trace-unsafe target)) (defun trace-unsafe (func) (let ((used (assq func find-gc-subrs-callers))) @@ -96,53 +95,43 @@ Also store it in `find-gc-unsafe'." (memq (car used) find-gc-noreturn-list) (progn (push (cons (car used) func) find-gc-unsafe-list) - (trace-unsafe (car used)))))) -) + (trace-unsafe (car used))))))) -(defun trace-call-tree (&optional already-setup) +(defun trace-call-tree (&optional ignored) (message "Setting up directories...") - (or already-setup - (progn - ;; Gee, wouldn't a built-in "system" function be handy here. - (call-process "csh" nil nil nil "-c" "rm -rf /tmp/esrc") - (call-process "csh" nil nil nil "-c" "mkdir /tmp/esrc") - (call-process "csh" nil nil nil "-c" - (format "ln -s %s/*.[ch] /tmp/esrc" - find-gc-source-directory)))) - (with-current-buffer (get-buffer-create "*Trace Call Tree*") - (setq find-gc-subrs-called nil) - (let ((case-fold-search nil) - (files find-gc-source-files) - name entry) - (while files - (message "Compiling %s..." (car files)) - (call-process "csh" nil nil nil "-c" - (format "gcc -dr -c /tmp/esrc/%s -o /dev/null" - (car files))) - (erase-buffer) - (insert-file-contents (concat "/tmp/esrc/" (car files) ".rtl")) - (while (re-search-forward ";; Function \\|(call_insn " nil t) - (if (= (char-after (- (point) 3)) ?o) - (progn - (looking-at "[a-zA-Z0-9_]+") - (setq name (intern (buffer-substring (match-beginning 0) - (match-end 0)))) - (message "%s : %s" (car files) name) - (setq entry (list name) - find-gc-subrs-called (cons entry find-gc-subrs-called))) - (if (looking-at ".*\n?.*\"\\([A-Za-z0-9_]+\\)\"") + (setq find-gc-subrs-called nil) + (let ((case-fold-search nil) + (default-directory find-gc-source-directory) + (files find-gc-source-files) + name entry rtlfile) + (dolist (file files) + (message "Compiling %s..." file) + (call-process "gcc" nil nil nil "-I" "." "-I" "../lib" + "-fdump-rtl-expand" "-o" null-device "-c" file) + (setq rtlfile + (file-expand-wildcards (format "%s.*.expand" file) t)) + (if (/= 1 (length rtlfile)) + (message "Error compiling `%s'?" file) + (with-temp-buffer + (insert-file-contents (setq rtlfile (car rtlfile))) + (delete-file rtlfile) + (while (re-search-forward ";; Function \\|(call_insn " nil t) + (if (= (char-after (- (point) 3)) ?o) (progn - (setq name (intern (buffer-substring (match-beginning 1) - (match-end 1)))) - (or (memq name (cdr entry)) - (setcdr entry (cons name (cdr entry)))))))) - (delete-file (concat "/tmp/esrc/" (car files) ".rtl")) - (setq files (cdr files))))) -) - + (looking-at "[a-zA-Z0-9_]+") + (setq name (intern (match-string 0))) + (message "%s : %s" (car files) name) + (setq entry (list name) + find-gc-subrs-called + (cons entry find-gc-subrs-called))) + (if (looking-at ".*\n?.*\"\\([A-Za-z0-9_]+\\)\"") + (progn + (setq name (intern (match-string 1))) + (or (memq name (cdr entry)) + (setcdr entry (cons name (cdr entry))))))))))))) (defun trace-use-tree () (setq find-gc-subrs-callers (mapcar 'list (mapcar 'car find-gc-subrs-called))) @@ -153,8 +142,7 @@ Also store it in `find-gc-unsafe'." (while (setq p2 (cdr p2)) (if (setq found (assq (car p2) find-gc-subrs-callers)) (setcdr found (cons (car (car ptr)) (cdr found))))) - (setq ptr (cdr ptr)))) -) + (setq ptr (cdr ptr))))) (provide 'find-gc) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 7be0354992f..c194e1352ac 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -868,7 +868,7 @@ MIN-VERSION should be a version list." ;; Also check built-in packages. (package-built-in-p package min-version))) -(defun package-compute-transaction (packages requirements) +(defun package-compute-transaction (packages requirements &optional seen) "Return a list of packages to be installed, including PACKAGES. PACKAGES should be a list of `package-desc'. @@ -880,7 +880,9 @@ version of that package. This function recursively computes the requirements of the packages in REQUIREMENTS, and returns a list of all the packages that must be installed. Packages that are already installed are -not included in this list." +not included in this list. + +SEEN is used internally to detect infinite recursion." ;; FIXME: We really should use backtracking to explore the whole ;; search space (e.g. if foo require bar-1.3, and bar-1.4 requires toto-1.1 ;; whereas bar-1.3 requires toto-1.0 and the user has put a hold on toto-1.0: @@ -893,15 +895,22 @@ not included in this list." (dolist (pkg packages) (if (eq next-pkg (package-desc-name pkg)) (setq already pkg))) - (cond - (already + (when already (if (version-list-<= next-version (package-desc-version already)) - ;; Move to front, so it gets installed early enough (bug#14082). - (setq packages (cons already (delq already packages))) + ;; `next-pkg' is already in `packages', but its position there + ;; means it might be installed too late: remove it from there, so + ;; we re-add it (along with its dependencies) at an earlier place + ;; below (bug#16994). + (if (memq already seen) ;Avoid inf-loop on dependency cycles. + (message "Dependency cycle going through %S" + (package-desc-full-name already)) + (setq packages (delq already packages)) + (setq already nil)) (error "Need package `%s-%s', but only %s is being installed" next-pkg (package-version-join next-version) (package-version-join (package-desc-version already))))) - + (cond + (already nil) ((package-installed-p next-pkg next-version) nil) (t @@ -933,12 +942,13 @@ but version %s required" (t (setq found pkg-desc))))) (unless found (if problem - (error problem) + (error "%s" problem) (error "Package `%s-%s' is unavailable" next-pkg (package-version-join next-version)))) (setq packages (package-compute-transaction (cons found packages) - (package-desc-reqs found)))))))) + (package-desc-reqs found) + (cons found seen)))))))) packages) (defun package-read-from-string (str) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 759a49a91f7..8cc7397794f 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2014-05-08 Glenn Morris <rgm@gnu.org> + + * gnus-fun.el (gnus-grab-cam-face): + Do not use predictable temp-file name. (http://bugs.debian.org/747100) + 2014-05-04 Glenn Morris <rgm@gnu.org> * gnus-registry.el (gnus-registry-install-p): Doc fix. diff --git a/lisp/gnus/gnus-fun.el b/lisp/gnus/gnus-fun.el index d6b4fba6246..e0d1578f49a 100644 --- a/lisp/gnus/gnus-fun.el +++ b/lisp/gnus/gnus-fun.el @@ -301,20 +301,21 @@ colors of the displayed X-Faces." (interactive) (shell-command "xawtv-remote snap ppm") (let ((file nil) + (tempfile (make-temp-file "gnus-face-" nil ".ppm")) result) (while (null (setq file (directory-files "/tftpboot/sparky/tmp" t "snap.*ppm"))) (sleep-for 1)) (setq file (car file)) (shell-command - (format "pnmcut -left 110 -top 30 -width 144 -height 144 '%s' | pnmscale -width 48 -height 48 | ppmtopgm > /tmp/gnus.face.ppm" - file)) + (format "pnmcut -left 110 -top 30 -width 144 -height 144 '%s' | pnmscale -width 48 -height 48 | ppmtopgm >> %s" + file tempfile)) (let ((gnus-convert-image-to-face-command (format "cat '%%s' | ppmquant %%d | ppmchange %s | pnmtopng" (gnus-fun-ppm-change-string)))) - (setq result (gnus-face-from-file "/tmp/gnus.face.ppm"))) + (setq result (gnus-face-from-file tempfile))) (delete-file file) - ;;(delete-file "/tmp/gnus.face.ppm") + ;;(delete-file tempfile) ; FIXME why are we not deleting it?! result)) (defun gnus-fun-ppm-change-string () diff --git a/lisp/help-fns.el b/lisp/help-fns.el index da4a230468c..25ee1d3149f 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -501,6 +501,11 @@ FILE is the file where FUNCTION was probably defined." ;; aliases before functions. (aliased (format "an alias for `%s'" real-def)) + ((autoloadp def) + (format "%s autoloaded %s" + (if (commandp def) "an interactive" "an") + (if (eq (nth 4 def) 'keymap) "keymap" + (if (nth 4 def) "Lisp macro" "Lisp function")))) ((or (eq (car-safe def) 'macro) ;; For advised macros, def is a lambda ;; expression or a byte-code-function-p, so we @@ -513,11 +518,6 @@ FILE is the file where FUNCTION was probably defined." (concat beg "Lisp function")) ((eq (car-safe def) 'closure) (concat beg "Lisp closure")) - ((autoloadp def) - (format "%s autoloaded %s" - (if (commandp def) "an interactive" "an") - (if (eq (nth 4 def) 'keymap) "keymap" - (if (nth 4 def) "Lisp macro" "Lisp function")))) ((keymapp def) (let ((is-full nil) (elts (cdr-safe def))) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index cec0eb21b38..7245911de4b 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -519,11 +519,35 @@ for use at QPOS." completions)) ((eq action 'completion--unquote) - (let ((ustring (funcall unquote string)) - (uprefix (funcall unquote (substring string 0 pred)))) - ;; We presume (more or less) that `concat' and `unquote' commute. - (cl-assert (string-prefix-p uprefix ustring)) - (list ustring table (length uprefix) + ;; PRED is really a POINT in STRING. + ;; We should return a new set (STRING TABLE POINT REQUOTE) + ;; where STRING is a new (unquoted) STRING to match against the new TABLE + ;; using a new POINT inside it, and REQUOTE is a requoting function which + ;; should reverse the unquoting, (i.e. it receives the completion result + ;; of using the new TABLE and should turn it into the corresponding + ;; quoted result). + (let* ((qpos pred) + (ustring (funcall unquote string)) + (uprefix (funcall unquote (substring string 0 qpos))) + ;; FIXME: we really should pass `qpos' to `unuote' and have that + ;; function give us the corresponding `uqpos'. But for now we + ;; presume (more or less) that `concat' and `unquote' commute. + (uqpos (if (string-prefix-p uprefix ustring) + ;; Yay!! They do seem to commute! + (length uprefix) + ;; They don't commute this time! :-( + ;; Maybe qpos is in some text that disappears in the + ;; ustring (bug#17239). Let's try a second chance guess. + (let ((usuffix (funcall unquote (substring string qpos)))) + (if (string-suffix-p usuffix ustring) + ;; Yay!! They still "commute" in a sense! + (- (length ustring) (length usuffix)) + ;; Still no luck! Let's just choose *some* position + ;; within ustring. + (/ (+ (min (length uprefix) (length ustring)) + (max (- (length ustring) (length usuffix)) 0)) + 2)))))) + (list ustring table uqpos (lambda (unquoted-result op) (pcase op (1 ;;try @@ -853,6 +877,7 @@ completing buffer and file names, respectively." (setq string (pop new)) (setq table (pop new)) (setq point (pop new)) + (cl-assert (<= point (length string))) (pop new)))) (result (completion--some (lambda (style) @@ -1365,19 +1390,18 @@ appear to be a match." ;; instead, but it was too blunt, leading to situations where SPC ;; was the only insertable char at point but minibuffer-complete-word ;; refused inserting it. - (let* ((exts (mapcar (lambda (str) (propertize str 'completion-try-word t)) - '(" " "-"))) - (before (substring string 0 point)) - (after (substring string point)) - (comps - (delete nil - (mapcar (lambda (ext) - (completion-try-completion - (concat before ext after) - table predicate (1+ point) md)) - exts)))) - (when (and (null (cdr comps)) (consp (car comps))) - (setq comp (car comps))))) + (let ((exts (mapcar (lambda (str) (propertize str 'completion-try-word t)) + '(" " "-"))) + (before (substring string 0 point)) + (after (substring string point)) + tem) + ;; If both " " and "-" lead to completions, prefer " " so SPC behaves + ;; a bit more like a self-inserting key (bug#17375). + (while (and exts (not (consp tem))) + (setq tem (completion-try-completion + (concat before (pop exts) after) + table predicate (1+ point) md))) + (if (consp tem) (setq comp tem)))) ;; Completing a single word is actually more difficult than completing ;; as much as possible, because we first have to find the "current diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 893bfa487e3..4364490f431 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -1340,6 +1340,9 @@ used instead of `browse-url-new-window-flag'." (kill-buffer nil))) (if (and pid (zerop (signal-process pid 0))) ; Mosaic running (save-excursion + ;; This is a predictable temp-file name, which is bad, + ;; but it is what Mosaic uses/used. + ;; So it's not Emacs's problem. http://bugs.debian.org/747100 (find-file (format "/tmp/Mosaic.%d" pid)) (erase-buffer) (insert (if (browse-url-maybe-new-window new-window) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 9c86c8c48bd..900e1c812ae 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -425,7 +425,7 @@ as given in your `~/.profile'." ;;;###tramp-autoload (defcustom tramp-remote-process-environment - `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "TMOUT=0" "LC_CTYPE=''" + `("TMOUT=0" "LC_CTYPE=''" ,(format "TERM=%s" tramp-terminal-type) "EMACS=t" ;; Deprecated. ,(format "INSIDE_EMACS='%s,tramp:%s'" emacs-version tramp-version) @@ -440,6 +440,7 @@ which might have been set in the init files like ~/.profile. Special handling is applied to the PATH environment, which should not be set here. Instead, it should be set via `tramp-remote-path'." :group 'tramp + :version "24.4" :type '(repeat string)) (defcustom tramp-sh-extra-args '(("/bash\\'" . "-norc -noprofile")) @@ -491,9 +492,9 @@ This list is used for copying/renaming with out-of-band methods. See `tramp-actions-before-shell' for more info.") (defconst tramp-uudecode - "(echo begin 600 /tmp/tramp.$$; tail +2) | uudecode -cat /tmp/tramp.$$ -rm -f /tmp/tramp.$$" + "(echo begin 600 %t; tail -n +2) | uudecode +cat %t +rm -f %t" "Shell function to implement `uudecode' to standard output. Many systems support `uudecode -o /dev/stdout' or `uudecode -o -' for this or `uudecode -p', but some systems don't, and for them @@ -3726,8 +3727,7 @@ file exists and nonzero exit status otherwise." (with-tramp-progress-reporter vec 5 (format "Opening remote shell `%s'" shell) ;; Find arguments for this shell. - (let ((tramp-end-of-output tramp-initial-end-of-output) - (alist tramp-sh-extra-args) + (let ((alist tramp-sh-extra-args) item extra-args) (while (and alist (null extra-args)) (setq item (pop alist)) @@ -3735,18 +3735,12 @@ file exists and nonzero exit status otherwise." (setq extra-args (cdr item)))) (tramp-send-command vec (format - "exec env ENV='' PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s" + "exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s" (tramp-shell-quote-argument tramp-end-of-output) shell (or extra-args "")) t)) (tramp-set-connection-property - (tramp-get-connection-process vec) "remote-shell" shell) - ;; Setting prompts. - (tramp-send-command - vec (format "PS1=%s" (tramp-shell-quote-argument tramp-end-of-output)) t) - (tramp-send-command vec "PS2=''" t) - (tramp-send-command vec "PS3=''" t) - (tramp-send-command vec "PROMPT_COMMAND=''" t))) + (tramp-get-connection-process vec) "remote-shell" shell))) (defun tramp-find-shell (vec) "Opens a shell on the remote host which groks tilde expansion." @@ -4045,7 +4039,7 @@ Each item is a list that looks like this: \(FORMAT ENCODING DECODING [TEST]\) -FORMAT is symbol describing the encoding/decoding format. It can be +FORMAT is a symbol describing the encoding/decoding format. It can be `b64' for base64 encoding, `uu' for uu encoding, or `pack' for simple packing. ENCODING and DECODING can be strings, giving commands, or symbols, @@ -4055,9 +4049,11 @@ filename will be put into the command line at that spot. If the specifier is not present, the input should be read from standard input. -If they are variables, this variable is a string containing a Perl -implementation for this functionality. This Perl program will be transferred -to the remote host, and it is available as shell function with the same name. +If they are variables, this variable is a string containing a +Perl or Shell implementation for this functionality. This +program will be transferred to the remote host, and it is +available as shell function with the same name. A \"%t\" format +specifier in the variable value denotes a temporary file. The optional TEST command can be used for further tests, whether ENCODING and DECODING are applicable.") @@ -4136,10 +4132,25 @@ Goes through the list `tramp-local-coding-commands' and (throw 'wont-work-remote nil)) (when (not (stringp rem-dec)) - (let ((name (symbol-name rem-dec))) + (let ((name (symbol-name rem-dec)) + (value (symbol-value rem-dec)) + tmpfile) (while (string-match (regexp-quote "-") name) (setq name (replace-match "_" nil t name))) - (tramp-maybe-send-script vec (symbol-value rem-dec) name) + (when (string-match "%t" value) + (setq tmpfile + (make-temp-name + (expand-file-name + tramp-temp-name-prefix + (tramp-get-remote-tmpdir vec))) + value + (format-spec + value + (format-spec-make + ?t + (tramp-file-name-handler + 'file-remote-p tmpfile 'localname))))) + (tramp-maybe-send-script vec value name) (setq rem-dec name))) (tramp-message vec 5 @@ -4456,6 +4467,7 @@ connection if a previous connection has died for some reason." (delete-process p)) (setenv "TERM" tramp-terminal-type) (setenv "LC_ALL" "en_US.utf8") + (setenv "HISTFILE" "/dev/null") (setenv "PROMPT_COMMAND") (setenv "PS1" tramp-initial-end-of-output) (let* ((target-alist (tramp-compute-multi-hops vec)) diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 912736707ef..74edf7a680f 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1804,9 +1804,10 @@ It will be properly highlighted even when the call omits parens.") ;; $' $" $` .... are variables. ;; ?' ?" ?` are character literals (one-char strings in 1.9+). ("\\([?$]\\)[#\"'`]" - (1 (unless (save-excursion - ;; Not within a string. - (nth 3 (syntax-ppss (match-beginning 0)))) + (1 (if (save-excursion + (nth 3 (syntax-ppss (match-beginning 0)))) + ;; Within a string, skip. + (goto-char (match-end 1)) (string-to-syntax "\\")))) ;; Part of symbol when at the end of a method name. ("[!?]" diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index b03b2c95394..fc515974036 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -63,8 +63,8 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." (defun xterm-mouse-translate-1 (&optional extension) (save-excursion - (save-window-excursion - (deactivate-mark) + (save-window-excursion ;FIXME: Why? + (deactivate-mark) ;FIXME: Why? (let* ((xterm-mouse-last nil) (down (xterm-mouse-event extension)) (down-command (nth 0 down)) @@ -73,10 +73,10 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." (down-binding (key-binding (if (symbolp down-where) (vector down-where down-command) (vector down-command)))) - (is-click (string-match "^mouse" (symbol-name (car down))))) + (is-down (string-match "down" (symbol-name (car down))))) ;; Retrieve the expected preface for the up-event. - (unless is-click + (unless is-down (unless (cond ((null extension) (and (eq (read-event) ?\e) (eq (read-event) ?\[) @@ -88,14 +88,17 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." (error "Unexpected escape sequence from XTerm"))) ;; Process the up-event. - (let* ((click (if is-click down (xterm-mouse-event extension))) + (let* ((click (if is-down (xterm-mouse-event extension) down)) (click-data (nth 1 click)) (click-where (nth 1 click-data))) - (if (memq down-binding '(nil ignore)) - (if (and (symbolp click-where) - (consp click-where)) - (vector (list click-where click-data) click) - (vector click)) + (cond + ((null down) nil) + ((memq down-binding '(nil ignore)) + (if (and (symbolp click-where) + (consp click-where)) + (vector (list click-where click-data) click) + (vector click))) + (t (setq unread-command-events (append (if (eq down-where click-where) (list click) @@ -114,7 +117,7 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." (if (and (symbolp down-where) (consp down-where)) (vector (list down-where down-data) down) - (vector down)))))))) + (vector down))))))))) ;; These two variables have been converted to terminal parameters. ;; @@ -153,7 +156,8 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." ;; Normal terminal mouse click reporting: expect three bytes, of the ;; form <BUTTON+32> <X+32> <Y+32>. Return a list (EVENT-TYPE X Y). (defun xterm-mouse--read-event-sequence-1000 () - (list (let ((code (- (read-event) 32))) + (let* ((code (- (read-event) 32)) + (type (intern ;; For buttons > 3, the release-event looks differently ;; (see xc/programs/xterm/button.c, function EditorButton), @@ -161,21 +165,21 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." (cond ((>= code 64) (format "mouse-%d" (- code 60))) ((memq code '(8 9 10)) - (setq xterm-mouse-last code) + (setq xterm-mouse-last (- code 8)) (format "M-down-mouse-%d" (- code 7))) - ((= code 11) - (format "M-mouse-%d" (- xterm-mouse-last 7))) - ((= code 3) - ;; For buttons > 5 xterm only reports a - ;; button-release event. Avoid error by mapping - ;; them all to mouse-1. - (format "mouse-%d" (+ 1 (or xterm-mouse-last 0)))) - (t + ((and (= code 11) xterm-mouse-last) + (format "M-mouse-%d" (1+ xterm-mouse-last))) + ((and (= code 3) xterm-mouse-last) + ;; For buttons > 5 xterm only reports a button-release event. + ;; Drop them since they're not usable and can be spurious. + (format "mouse-%d" (1+ xterm-mouse-last))) + ((memq code '(0 1 2)) (setq xterm-mouse-last code) (format "down-mouse-%d" (+ 1 code)))))) - ;; x and y coordinates - (- (read-event) 33) - (- (read-event) 33))) + (x (- (read-event) 33)) + (y (- (read-event) 33))) + (and type (wholenump x) (wholenump y) + (list type x y)))) ;; XTerm's 1006-mode terminal mouse click reporting has the form ;; <BUTTON> ; <X> ; <Y> <M or m>, where the button and ordinates are @@ -222,32 +226,33 @@ which is the \"1006\" extension implemented in Xterm >= 277." ((eq extension 1006) (xterm-mouse--read-event-sequence-1006)) (t - (error "Unsupported XTerm mouse protocol")))) - (type (nth 0 click)) - (x (nth 1 click)) - (y (nth 2 click)) - ;; Emulate timestamp information. This is accurate enough - ;; for default value of mouse-1-click-follows-link (450msec). - (timestamp (xterm-mouse-truncate-wrap - (* 1000 - (- (float-time) - (or xt-mouse-epoch - (setq xt-mouse-epoch (float-time))))))) - (w (window-at x y)) - (ltrb (window-edges w)) - (left (nth 0 ltrb)) - (top (nth 1 ltrb))) - (set-terminal-parameter nil 'xterm-mouse-x x) - (set-terminal-parameter nil 'xterm-mouse-y y) - (setq - last-input-event - (list type - (let ((event (if w - (posn-at-x-y (- x left) (- y top) w t) - (append (list nil 'menu-bar) - (nthcdr 2 (posn-at-x-y x y)))))) - (setcar (nthcdr 3 event) timestamp) - event))))) + (error "Unsupported XTerm mouse protocol"))))) + (when click + (let* ((type (nth 0 click)) + (x (nth 1 click)) + (y (nth 2 click)) + ;; Emulate timestamp information. This is accurate enough + ;; for default value of mouse-1-click-follows-link (450msec). + (timestamp (xterm-mouse-truncate-wrap + (* 1000 + (- (float-time) + (or xt-mouse-epoch + (setq xt-mouse-epoch (float-time))))))) + (w (window-at x y)) + (ltrb (window-edges w)) + (left (nth 0 ltrb)) + (top (nth 1 ltrb))) + (set-terminal-parameter nil 'xterm-mouse-x x) + (set-terminal-parameter nil 'xterm-mouse-y y) + (setq + last-input-event + (list type + (let ((event (if w + (posn-at-x-y (- x left) (- y top) w t) + (append (list nil 'menu-bar) + (nthcdr 2 (posn-at-x-y x y)))))) + (setcar (nthcdr 3 event) timestamp) + event))))))) ;;;###autoload (define-minor-mode xterm-mouse-mode |
