diff options
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 @@ | |||
| 1 | 2014-05-08 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * xt-mouse.el: Drop spurious/oddly shaped events (bug#17378). | ||
| 4 | (xterm-mouse--read-event-sequence-1000): Return nil if something | ||
| 5 | looks fishy. | ||
| 6 | (xterm-mouse-event): Propagate it. | ||
| 7 | (xterm-mouse-translate-1): Handle it. | ||
| 8 | |||
| 9 | 2014-05-08 Stephen Berman <stephen.berman@gmx.net> | ||
| 10 | |||
| 11 | * calendar/todo-mode.el (todo-insert-item--apply-args): When all | ||
| 12 | four slots of the parameter list are filled, make sure to pass it | ||
| 13 | to the argument list of todo-insert-item--basic. | ||
| 14 | |||
| 15 | 2014-05-08 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 16 | |||
| 17 | * emacs-lisp/package.el (package-compute-transaction): Topological sort. | ||
| 18 | Add optional `seen' argument to detect and break infinite loops. | ||
| 19 | |||
| 20 | 2014-05-08 Eli Zaretskii <eliz@gnu.org> | ||
| 21 | |||
| 22 | * emacs-lisp/find-gc.el (find-gc-unsafe, find-unsafe-funcs) | ||
| 23 | (trace-unsafe, trace-use-tree): Make parentheses style be | ||
| 24 | according to Emacs style. | ||
| 25 | |||
| 26 | 2014-05-08 Michael Albinus <michael.albinus@gmx.de> | ||
| 27 | |||
| 28 | * net/tramp-sh.el (tramp-remote-process-environment): | ||
| 29 | Remove HISTFILE and HISTSIZE; it's too late to set them here. | ||
| 30 | Add :version entry. | ||
| 31 | (tramp-open-shell): Do not let-bind `tramp-end-of-output'. | ||
| 32 | Add "HISTSIZE=/dev/null" to the shell's env arguments. Do not send | ||
| 33 | extra "PSx=..." commands. | ||
| 34 | (tramp-maybe-open-connection): Setenv HISTFILE to /dev/null. | ||
| 35 | (Bug#17295) | ||
| 36 | |||
| 37 | (tramp-uudecode): Replace the hard-coded temporary file name by a | ||
| 38 | format specifier. | ||
| 39 | (tramp-remote-coding-commands): Enhance docstring. | ||
| 40 | (tramp-find-inline-encoding): Replace "%t" by a temporary file | ||
| 41 | name. (Bug#17415) | ||
| 42 | |||
| 43 | 2014-05-08 Glenn Morris <rgm@gnu.org> | ||
| 44 | |||
| 45 | * emacs-lisp/find-gc.el (find-gc-source-directory): Give it a value. | ||
| 46 | (find-gc-source-files): Update some names. | ||
| 47 | (trace-call-tree): Simplify and update. | ||
| 48 | Avoid predictable temp-file names. (http://bugs.debian.org/747100) | ||
| 49 | |||
| 50 | 2014-05-08 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 51 | |||
| 52 | * minibuffer.el (completion--try-word-completion): Revert fix for | ||
| 53 | Bug#15980 (bug#17375). | ||
| 54 | |||
| 55 | * xt-mouse.el (xterm-mouse--read-event-sequence-1000): (bug#17378) | ||
| 56 | Always store button numbers in the same way in xterm-mouse-last; | ||
| 57 | Don't burp is xterm-mouse-last is not set as expected. | ||
| 58 | Never return negative indices. | ||
| 59 | |||
| 60 | 2014-05-08 Dmitry Gutov <dgutov@yandex.ru> | ||
| 61 | |||
| 62 | * progmodes/ruby-mode.el (ruby-syntax-propertize-function): | ||
| 63 | Backtrack one char if the global/char-literal var matcher hits | ||
| 64 | inside a string. The next char could be the beginning of an | ||
| 65 | expression expansion. | ||
| 66 | |||
| 67 | 2014-05-08 Glenn Morris <rgm@gnu.org> | ||
| 68 | |||
| 69 | * help-fns.el (describe-function-1): Test for an autoload before a | ||
| 70 | macro, since `macrop' works on autoloads. (Bug#17410) | ||
| 71 | |||
| 72 | 2014-05-08 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 73 | |||
| 74 | * electric.el (electric-indent-functions-without-reindent): Add yaml. | ||
| 75 | |||
| 76 | * minibuffer.el (completion-table-with-quoting) <completion--unquote>: | ||
| 77 | Make sure the new point we return is within the new string (bug#17239). | ||
| 78 | |||
| 1 | 2014-05-05 Daniel Colascione <dancol@dancol.org> | 79 | 2014-05-05 Daniel Colascione <dancol@dancol.org> |
| 2 | 80 | ||
| 3 | * progmodes/compile.el (compilation-error-regexp-alist-alist): | 81 | * progmodes/compile.el (compilation-error-regexp-alist-alist): |
| @@ -84,8 +162,8 @@ | |||
| 84 | (todo-edit-done-item--param-key-alist): New defconsts. | 162 | (todo-edit-done-item--param-key-alist): New defconsts. |
| 85 | (todo-edit-item--prompt): New variable. | 163 | (todo-edit-item--prompt): New variable. |
| 86 | (todo-edit-item--next-key): New function. | 164 | (todo-edit-item--next-key): New function. |
| 87 | (todo-key-bindings-t): Bind "e" to todo-edit-item. Remove | 165 | (todo-key-bindings-t): Bind "e" to todo-edit-item. |
| 88 | bindings of deleted commands. | 166 | Remove bindings of deleted commands. |
| 89 | 167 | ||
| 90 | 2014-05-04 Leo Liu <sdl.web@gmail.com> | 168 | 2014-05-04 Leo Liu <sdl.web@gmail.com> |
| 91 | 169 | ||
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'." | |||
| 5360 | (list (car (todo-insert-item--argsleft | 5360 | (list (car (todo-insert-item--argsleft |
| 5361 | (todo-insert-item--this-key) | 5361 | (todo-insert-item--this-key) |
| 5362 | todo-insert-item--argsleft))))) | 5362 | todo-insert-item--argsleft))))) |
| 5363 | (arglist (unless (= 4 (length args)) | 5363 | (arglist (if (= 4 (length args)) |
| 5364 | args | ||
| 5364 | (let ((v (make-vector 4 nil)) elt) | 5365 | (let ((v (make-vector 4 nil)) elt) |
| 5365 | (while args | 5366 | (while args |
| 5366 | (setq elt (pop args)) | 5367 | (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.") | |||
| 221 | (defvar electric-indent-functions-without-reindent | 221 | (defvar electric-indent-functions-without-reindent |
| 222 | '(indent-relative indent-to-left-margin indent-relative-maybe | 222 | '(indent-relative indent-to-left-margin indent-relative-maybe |
| 223 | py-indent-line coffee-indent-line org-indent-line yaml-indent-line | 223 | py-indent-line coffee-indent-line org-indent-line yaml-indent-line |
| 224 | haskell-indentation-indent-line haskell-indent-cycle haskell-simple-indent) | 224 | haskell-indentation-indent-line haskell-indent-cycle haskell-simple-indent |
| 225 | yaml-indent-line) | ||
| 225 | "List of indent functions that can't reindent. | 226 | "List of indent functions that can't reindent. |
| 226 | If `line-indent-function' is one of those, then `electric-indent-mode' will | 227 | If `line-indent-function' is one of those, then `electric-indent-mode' will |
| 227 | not try to reindent lines. It is normally better to make the major | 228 | 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 @@ | |||
| 23 | 23 | ||
| 24 | ;; Produce in find-gc-unsafe-list the set of all functions that may invoke GC. | 24 | ;; Produce in find-gc-unsafe-list the set of all functions that may invoke GC. |
| 25 | ;; This expects the Emacs sources to live in find-gc-source-directory. | 25 | ;; This expects the Emacs sources to live in find-gc-source-directory. |
| 26 | ;; It creates a temporary working directory /tmp/esrc. | ||
| 27 | 26 | ||
| 28 | ;;; Code: | 27 | ;;; Code: |
| 29 | 28 | ||
| 30 | (defvar find-gc-unsafe-list nil | 29 | (defvar find-gc-unsafe-list nil |
| 31 | "The list of unsafe functions is placed here by `find-gc-unsafe'.") | 30 | "The list of unsafe functions is placed here by `find-gc-unsafe'.") |
| 32 | 31 | ||
| 33 | (defvar find-gc-source-directory) | 32 | (defvar find-gc-source-directory |
| 33 | (file-name-as-directory (expand-file-name "src" source-directory)) | ||
| 34 | "Directory containing Emacs C sources.") | ||
| 34 | 35 | ||
| 35 | (defvar find-gc-subrs-callers nil | 36 | (defvar find-gc-subrs-callers nil |
| 36 | "Alist of users of subrs, from GC testing. | 37 | "Alist of users of subrs, from GC testing. |
| @@ -59,22 +60,21 @@ Each entry has the form (FUNCTION . FUNCTIONS-IT-CALLS).") | |||
| 59 | "indent.c" "search.c" "regex.c" "undo.c" | 60 | "indent.c" "search.c" "regex.c" "undo.c" |
| 60 | "alloc.c" "data.c" "doc.c" "editfns.c" | 61 | "alloc.c" "data.c" "doc.c" "editfns.c" |
| 61 | "callint.c" "eval.c" "fns.c" "print.c" "lread.c" | 62 | "callint.c" "eval.c" "fns.c" "print.c" "lread.c" |
| 62 | "abbrev.c" "syntax.c" "unexcoff.c" | 63 | "syntax.c" "unexcoff.c" |
| 63 | "bytecode.c" "process.c" "callproc.c" "doprnt.c" | 64 | "bytecode.c" "process.c" "callproc.c" "doprnt.c" |
| 64 | "x11term.c" "x11fns.c")) | 65 | "xterm.c" "xfns.c")) |
| 65 | 66 | ||
| 66 | 67 | ||
| 67 | (defun find-gc-unsafe () | 68 | (defun find-gc-unsafe () |
| 68 | "Return a list of unsafe functions--that is, which can call GC. | 69 | "Return a list of unsafe functions--that is, which can call GC. |
| 69 | Also store it in `find-gc-unsafe'." | 70 | Also store it in `find-gc-unsafe-list'." |
| 70 | (trace-call-tree nil) | 71 | (trace-call-tree nil) |
| 71 | (trace-use-tree) | 72 | (trace-use-tree) |
| 72 | (find-unsafe-funcs 'Fgarbage_collect) | 73 | (find-unsafe-funcs 'Fgarbage_collect) |
| 73 | (setq find-gc-unsafe-list | 74 | (setq find-gc-unsafe-list |
| 74 | (sort find-gc-unsafe-list | 75 | (sort find-gc-unsafe-list |
| 75 | (function (lambda (x y) | 76 | (function (lambda (x y) |
| 76 | (string-lessp (car x) (car y)))))) | 77 | (string-lessp (car x) (car y))))))) |
| 77 | ) | ||
| 78 | 78 | ||
| 79 | ;;; This does a depth-first search to find all functions that can | 79 | ;;; This does a depth-first search to find all functions that can |
| 80 | ;;; ultimately call the function "target". The result is an a-list | 80 | ;;; ultimately call the function "target". The result is an a-list |
| @@ -84,8 +84,7 @@ Also store it in `find-gc-unsafe'." | |||
| 84 | 84 | ||
| 85 | (defun find-unsafe-funcs (target) | 85 | (defun find-unsafe-funcs (target) |
| 86 | (setq find-gc-unsafe-list (list (list target))) | 86 | (setq find-gc-unsafe-list (list (list target))) |
| 87 | (trace-unsafe target) | 87 | (trace-unsafe target)) |
| 88 | ) | ||
| 89 | 88 | ||
| 90 | (defun trace-unsafe (func) | 89 | (defun trace-unsafe (func) |
| 91 | (let ((used (assq func find-gc-subrs-callers))) | 90 | (let ((used (assq func find-gc-subrs-callers))) |
| @@ -96,53 +95,43 @@ Also store it in `find-gc-unsafe'." | |||
| 96 | (memq (car used) find-gc-noreturn-list) | 95 | (memq (car used) find-gc-noreturn-list) |
| 97 | (progn | 96 | (progn |
| 98 | (push (cons (car used) func) find-gc-unsafe-list) | 97 | (push (cons (car used) func) find-gc-unsafe-list) |
| 99 | (trace-unsafe (car used)))))) | 98 | (trace-unsafe (car used))))))) |
| 100 | ) | ||
| 101 | 99 | ||
| 102 | 100 | ||
| 103 | 101 | ||
| 104 | 102 | ||
| 105 | (defun trace-call-tree (&optional already-setup) | 103 | (defun trace-call-tree (&optional ignored) |
| 106 | (message "Setting up directories...") | 104 | (message "Setting up directories...") |
| 107 | (or already-setup | 105 | (setq find-gc-subrs-called nil) |
| 108 | (progn | 106 | (let ((case-fold-search nil) |
| 109 | ;; Gee, wouldn't a built-in "system" function be handy here. | 107 | (default-directory find-gc-source-directory) |
| 110 | (call-process "csh" nil nil nil "-c" "rm -rf /tmp/esrc") | 108 | (files find-gc-source-files) |
| 111 | (call-process "csh" nil nil nil "-c" "mkdir /tmp/esrc") | 109 | name entry rtlfile) |
| 112 | (call-process "csh" nil nil nil "-c" | 110 | (dolist (file files) |
| 113 | (format "ln -s %s/*.[ch] /tmp/esrc" | 111 | (message "Compiling %s..." file) |
| 114 | find-gc-source-directory)))) | 112 | (call-process "gcc" nil nil nil "-I" "." "-I" "../lib" |
| 115 | (with-current-buffer (get-buffer-create "*Trace Call Tree*") | 113 | "-fdump-rtl-expand" "-o" null-device "-c" file) |
| 116 | (setq find-gc-subrs-called nil) | 114 | (setq rtlfile |
| 117 | (let ((case-fold-search nil) | 115 | (file-expand-wildcards (format "%s.*.expand" file) t)) |
| 118 | (files find-gc-source-files) | 116 | (if (/= 1 (length rtlfile)) |
| 119 | name entry) | 117 | (message "Error compiling `%s'?" file) |
| 120 | (while files | 118 | (with-temp-buffer |
| 121 | (message "Compiling %s..." (car files)) | 119 | (insert-file-contents (setq rtlfile (car rtlfile))) |
| 122 | (call-process "csh" nil nil nil "-c" | 120 | (delete-file rtlfile) |
| 123 | (format "gcc -dr -c /tmp/esrc/%s -o /dev/null" | 121 | (while (re-search-forward ";; Function \\|(call_insn " nil t) |
| 124 | (car files))) | 122 | (if (= (char-after (- (point) 3)) ?o) |
| 125 | (erase-buffer) | ||
| 126 | (insert-file-contents (concat "/tmp/esrc/" (car files) ".rtl")) | ||
| 127 | (while (re-search-forward ";; Function \\|(call_insn " nil t) | ||
| 128 | (if (= (char-after (- (point) 3)) ?o) | ||
| 129 | (progn | ||
| 130 | (looking-at "[a-zA-Z0-9_]+") | ||
| 131 | (setq name (intern (buffer-substring (match-beginning 0) | ||
| 132 | (match-end 0)))) | ||
| 133 | (message "%s : %s" (car files) name) | ||
| 134 | (setq entry (list name) | ||
| 135 | find-gc-subrs-called (cons entry find-gc-subrs-called))) | ||
| 136 | (if (looking-at ".*\n?.*\"\\([A-Za-z0-9_]+\\)\"") | ||
| 137 | (progn | 123 | (progn |
| 138 | (setq name (intern (buffer-substring (match-beginning 1) | 124 | (looking-at "[a-zA-Z0-9_]+") |
| 139 | (match-end 1)))) | 125 | (setq name (intern (match-string 0))) |
| 140 | (or (memq name (cdr entry)) | 126 | (message "%s : %s" (car files) name) |
| 141 | (setcdr entry (cons name (cdr entry)))))))) | 127 | (setq entry (list name) |
| 142 | (delete-file (concat "/tmp/esrc/" (car files) ".rtl")) | 128 | find-gc-subrs-called |
| 143 | (setq files (cdr files))))) | 129 | (cons entry find-gc-subrs-called))) |
| 144 | ) | 130 | (if (looking-at ".*\n?.*\"\\([A-Za-z0-9_]+\\)\"") |
| 145 | 131 | (progn | |
| 132 | (setq name (intern (match-string 1))) | ||
| 133 | (or (memq name (cdr entry)) | ||
| 134 | (setcdr entry (cons name (cdr entry))))))))))))) | ||
| 146 | 135 | ||
| 147 | (defun trace-use-tree () | 136 | (defun trace-use-tree () |
| 148 | (setq find-gc-subrs-callers (mapcar 'list (mapcar 'car find-gc-subrs-called))) | 137 | (setq find-gc-subrs-callers (mapcar 'list (mapcar 'car find-gc-subrs-called))) |
| @@ -153,8 +142,7 @@ Also store it in `find-gc-unsafe'." | |||
| 153 | (while (setq p2 (cdr p2)) | 142 | (while (setq p2 (cdr p2)) |
| 154 | (if (setq found (assq (car p2) find-gc-subrs-callers)) | 143 | (if (setq found (assq (car p2) find-gc-subrs-callers)) |
| 155 | (setcdr found (cons (car (car ptr)) (cdr found))))) | 144 | (setcdr found (cons (car (car ptr)) (cdr found))))) |
| 156 | (setq ptr (cdr ptr)))) | 145 | (setq ptr (cdr ptr))))) |
| 157 | ) | ||
| 158 | 146 | ||
| 159 | (provide 'find-gc) | 147 | (provide 'find-gc) |
| 160 | 148 | ||
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." | |||
| 868 | ;; Also check built-in packages. | 868 | ;; Also check built-in packages. |
| 869 | (package-built-in-p package min-version))) | 869 | (package-built-in-p package min-version))) |
| 870 | 870 | ||
| 871 | (defun package-compute-transaction (packages requirements) | 871 | (defun package-compute-transaction (packages requirements &optional seen) |
| 872 | "Return a list of packages to be installed, including PACKAGES. | 872 | "Return a list of packages to be installed, including PACKAGES. |
| 873 | PACKAGES should be a list of `package-desc'. | 873 | PACKAGES should be a list of `package-desc'. |
| 874 | 874 | ||
| @@ -880,7 +880,9 @@ version of that package. | |||
| 880 | This function recursively computes the requirements of the | 880 | This function recursively computes the requirements of the |
| 881 | packages in REQUIREMENTS, and returns a list of all the packages | 881 | packages in REQUIREMENTS, and returns a list of all the packages |
| 882 | that must be installed. Packages that are already installed are | 882 | that must be installed. Packages that are already installed are |
| 883 | not included in this list." | 883 | not included in this list. |
| 884 | |||
| 885 | SEEN is used internally to detect infinite recursion." | ||
| 884 | ;; FIXME: We really should use backtracking to explore the whole | 886 | ;; FIXME: We really should use backtracking to explore the whole |
| 885 | ;; search space (e.g. if foo require bar-1.3, and bar-1.4 requires toto-1.1 | 887 | ;; search space (e.g. if foo require bar-1.3, and bar-1.4 requires toto-1.1 |
| 886 | ;; whereas bar-1.3 requires toto-1.0 and the user has put a hold on toto-1.0: | 888 | ;; 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." | |||
| 893 | (dolist (pkg packages) | 895 | (dolist (pkg packages) |
| 894 | (if (eq next-pkg (package-desc-name pkg)) | 896 | (if (eq next-pkg (package-desc-name pkg)) |
| 895 | (setq already pkg))) | 897 | (setq already pkg))) |
| 896 | (cond | 898 | (when already |
| 897 | (already | ||
| 898 | (if (version-list-<= next-version (package-desc-version already)) | 899 | (if (version-list-<= next-version (package-desc-version already)) |
| 899 | ;; Move to front, so it gets installed early enough (bug#14082). | 900 | ;; `next-pkg' is already in `packages', but its position there |
| 900 | (setq packages (cons already (delq already packages))) | 901 | ;; means it might be installed too late: remove it from there, so |
| 902 | ;; we re-add it (along with its dependencies) at an earlier place | ||
| 903 | ;; below (bug#16994). | ||
| 904 | (if (memq already seen) ;Avoid inf-loop on dependency cycles. | ||
| 905 | (message "Dependency cycle going through %S" | ||
| 906 | (package-desc-full-name already)) | ||
| 907 | (setq packages (delq already packages)) | ||
| 908 | (setq already nil)) | ||
| 901 | (error "Need package `%s-%s', but only %s is being installed" | 909 | (error "Need package `%s-%s', but only %s is being installed" |
| 902 | next-pkg (package-version-join next-version) | 910 | next-pkg (package-version-join next-version) |
| 903 | (package-version-join (package-desc-version already))))) | 911 | (package-version-join (package-desc-version already))))) |
| 904 | 912 | (cond | |
| 913 | (already nil) | ||
| 905 | ((package-installed-p next-pkg next-version) nil) | 914 | ((package-installed-p next-pkg next-version) nil) |
| 906 | 915 | ||
| 907 | (t | 916 | (t |
| @@ -933,12 +942,13 @@ but version %s required" | |||
| 933 | (t (setq found pkg-desc))))) | 942 | (t (setq found pkg-desc))))) |
| 934 | (unless found | 943 | (unless found |
| 935 | (if problem | 944 | (if problem |
| 936 | (error problem) | 945 | (error "%s" problem) |
| 937 | (error "Package `%s-%s' is unavailable" | 946 | (error "Package `%s-%s' is unavailable" |
| 938 | next-pkg (package-version-join next-version)))) | 947 | next-pkg (package-version-join next-version)))) |
| 939 | (setq packages | 948 | (setq packages |
| 940 | (package-compute-transaction (cons found packages) | 949 | (package-compute-transaction (cons found packages) |
| 941 | (package-desc-reqs found)))))))) | 950 | (package-desc-reqs found) |
| 951 | (cons found seen)))))))) | ||
| 942 | packages) | 952 | packages) |
| 943 | 953 | ||
| 944 | (defun package-read-from-string (str) | 954 | (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 @@ | |||
| 1 | 2014-05-08 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * gnus-fun.el (gnus-grab-cam-face): | ||
| 4 | Do not use predictable temp-file name. (http://bugs.debian.org/747100) | ||
| 5 | |||
| 1 | 2014-05-04 Glenn Morris <rgm@gnu.org> | 6 | 2014-05-04 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * gnus-registry.el (gnus-registry-install-p): Doc fix. | 8 | * 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." | |||
| 301 | (interactive) | 301 | (interactive) |
| 302 | (shell-command "xawtv-remote snap ppm") | 302 | (shell-command "xawtv-remote snap ppm") |
| 303 | (let ((file nil) | 303 | (let ((file nil) |
| 304 | (tempfile (make-temp-file "gnus-face-" nil ".ppm")) | ||
| 304 | result) | 305 | result) |
| 305 | (while (null (setq file (directory-files "/tftpboot/sparky/tmp" | 306 | (while (null (setq file (directory-files "/tftpboot/sparky/tmp" |
| 306 | t "snap.*ppm"))) | 307 | t "snap.*ppm"))) |
| 307 | (sleep-for 1)) | 308 | (sleep-for 1)) |
| 308 | (setq file (car file)) | 309 | (setq file (car file)) |
| 309 | (shell-command | 310 | (shell-command |
| 310 | (format "pnmcut -left 110 -top 30 -width 144 -height 144 '%s' | pnmscale -width 48 -height 48 | ppmtopgm > /tmp/gnus.face.ppm" | 311 | (format "pnmcut -left 110 -top 30 -width 144 -height 144 '%s' | pnmscale -width 48 -height 48 | ppmtopgm >> %s" |
| 311 | file)) | 312 | file tempfile)) |
| 312 | (let ((gnus-convert-image-to-face-command | 313 | (let ((gnus-convert-image-to-face-command |
| 313 | (format "cat '%%s' | ppmquant %%d | ppmchange %s | pnmtopng" | 314 | (format "cat '%%s' | ppmquant %%d | ppmchange %s | pnmtopng" |
| 314 | (gnus-fun-ppm-change-string)))) | 315 | (gnus-fun-ppm-change-string)))) |
| 315 | (setq result (gnus-face-from-file "/tmp/gnus.face.ppm"))) | 316 | (setq result (gnus-face-from-file tempfile))) |
| 316 | (delete-file file) | 317 | (delete-file file) |
| 317 | ;;(delete-file "/tmp/gnus.face.ppm") | 318 | ;;(delete-file tempfile) ; FIXME why are we not deleting it?! |
| 318 | result)) | 319 | result)) |
| 319 | 320 | ||
| 320 | (defun gnus-fun-ppm-change-string () | 321 | (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." | |||
| 501 | ;; aliases before functions. | 501 | ;; aliases before functions. |
| 502 | (aliased | 502 | (aliased |
| 503 | (format "an alias for `%s'" real-def)) | 503 | (format "an alias for `%s'" real-def)) |
| 504 | ((autoloadp def) | ||
| 505 | (format "%s autoloaded %s" | ||
| 506 | (if (commandp def) "an interactive" "an") | ||
| 507 | (if (eq (nth 4 def) 'keymap) "keymap" | ||
| 508 | (if (nth 4 def) "Lisp macro" "Lisp function")))) | ||
| 504 | ((or (eq (car-safe def) 'macro) | 509 | ((or (eq (car-safe def) 'macro) |
| 505 | ;; For advised macros, def is a lambda | 510 | ;; For advised macros, def is a lambda |
| 506 | ;; expression or a byte-code-function-p, so we | 511 | ;; expression or a byte-code-function-p, so we |
| @@ -513,11 +518,6 @@ FILE is the file where FUNCTION was probably defined." | |||
| 513 | (concat beg "Lisp function")) | 518 | (concat beg "Lisp function")) |
| 514 | ((eq (car-safe def) 'closure) | 519 | ((eq (car-safe def) 'closure) |
| 515 | (concat beg "Lisp closure")) | 520 | (concat beg "Lisp closure")) |
| 516 | ((autoloadp def) | ||
| 517 | (format "%s autoloaded %s" | ||
| 518 | (if (commandp def) "an interactive" "an") | ||
| 519 | (if (eq (nth 4 def) 'keymap) "keymap" | ||
| 520 | (if (nth 4 def) "Lisp macro" "Lisp function")))) | ||
| 521 | ((keymapp def) | 521 | ((keymapp def) |
| 522 | (let ((is-full nil) | 522 | (let ((is-full nil) |
| 523 | (elts (cdr-safe def))) | 523 | (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." | |||
| 519 | completions)) | 519 | completions)) |
| 520 | 520 | ||
| 521 | ((eq action 'completion--unquote) | 521 | ((eq action 'completion--unquote) |
| 522 | (let ((ustring (funcall unquote string)) | 522 | ;; PRED is really a POINT in STRING. |
| 523 | (uprefix (funcall unquote (substring string 0 pred)))) | 523 | ;; We should return a new set (STRING TABLE POINT REQUOTE) |
| 524 | ;; We presume (more or less) that `concat' and `unquote' commute. | 524 | ;; where STRING is a new (unquoted) STRING to match against the new TABLE |
| 525 | (cl-assert (string-prefix-p uprefix ustring)) | 525 | ;; using a new POINT inside it, and REQUOTE is a requoting function which |
| 526 | (list ustring table (length uprefix) | 526 | ;; should reverse the unquoting, (i.e. it receives the completion result |
| 527 | ;; of using the new TABLE and should turn it into the corresponding | ||
| 528 | ;; quoted result). | ||
| 529 | (let* ((qpos pred) | ||
| 530 | (ustring (funcall unquote string)) | ||
| 531 | (uprefix (funcall unquote (substring string 0 qpos))) | ||
| 532 | ;; FIXME: we really should pass `qpos' to `unuote' and have that | ||
| 533 | ;; function give us the corresponding `uqpos'. But for now we | ||
| 534 | ;; presume (more or less) that `concat' and `unquote' commute. | ||
| 535 | (uqpos (if (string-prefix-p uprefix ustring) | ||
| 536 | ;; Yay!! They do seem to commute! | ||
| 537 | (length uprefix) | ||
| 538 | ;; They don't commute this time! :-( | ||
| 539 | ;; Maybe qpos is in some text that disappears in the | ||
| 540 | ;; ustring (bug#17239). Let's try a second chance guess. | ||
| 541 | (let ((usuffix (funcall unquote (substring string qpos)))) | ||
| 542 | (if (string-suffix-p usuffix ustring) | ||
| 543 | ;; Yay!! They still "commute" in a sense! | ||
| 544 | (- (length ustring) (length usuffix)) | ||
| 545 | ;; Still no luck! Let's just choose *some* position | ||
| 546 | ;; within ustring. | ||
| 547 | (/ (+ (min (length uprefix) (length ustring)) | ||
| 548 | (max (- (length ustring) (length usuffix)) 0)) | ||
| 549 | 2)))))) | ||
| 550 | (list ustring table uqpos | ||
| 527 | (lambda (unquoted-result op) | 551 | (lambda (unquoted-result op) |
| 528 | (pcase op | 552 | (pcase op |
| 529 | (1 ;;try | 553 | (1 ;;try |
| @@ -853,6 +877,7 @@ completing buffer and file names, respectively." | |||
| 853 | (setq string (pop new)) | 877 | (setq string (pop new)) |
| 854 | (setq table (pop new)) | 878 | (setq table (pop new)) |
| 855 | (setq point (pop new)) | 879 | (setq point (pop new)) |
| 880 | (cl-assert (<= point (length string))) | ||
| 856 | (pop new)))) | 881 | (pop new)))) |
| 857 | (result | 882 | (result |
| 858 | (completion--some (lambda (style) | 883 | (completion--some (lambda (style) |
| @@ -1365,19 +1390,18 @@ appear to be a match." | |||
| 1365 | ;; instead, but it was too blunt, leading to situations where SPC | 1390 | ;; instead, but it was too blunt, leading to situations where SPC |
| 1366 | ;; was the only insertable char at point but minibuffer-complete-word | 1391 | ;; was the only insertable char at point but minibuffer-complete-word |
| 1367 | ;; refused inserting it. | 1392 | ;; refused inserting it. |
| 1368 | (let* ((exts (mapcar (lambda (str) (propertize str 'completion-try-word t)) | 1393 | (let ((exts (mapcar (lambda (str) (propertize str 'completion-try-word t)) |
| 1369 | '(" " "-"))) | 1394 | '(" " "-"))) |
| 1370 | (before (substring string 0 point)) | 1395 | (before (substring string 0 point)) |
| 1371 | (after (substring string point)) | 1396 | (after (substring string point)) |
| 1372 | (comps | 1397 | tem) |
| 1373 | (delete nil | 1398 | ;; If both " " and "-" lead to completions, prefer " " so SPC behaves |
| 1374 | (mapcar (lambda (ext) | 1399 | ;; a bit more like a self-inserting key (bug#17375). |
| 1375 | (completion-try-completion | 1400 | (while (and exts (not (consp tem))) |
| 1376 | (concat before ext after) | 1401 | (setq tem (completion-try-completion |
| 1377 | table predicate (1+ point) md)) | 1402 | (concat before (pop exts) after) |
| 1378 | exts)))) | 1403 | table predicate (1+ point) md))) |
| 1379 | (when (and (null (cdr comps)) (consp (car comps))) | 1404 | (if (consp tem) (setq comp tem)))) |
| 1380 | (setq comp (car comps))))) | ||
| 1381 | 1405 | ||
| 1382 | ;; Completing a single word is actually more difficult than completing | 1406 | ;; Completing a single word is actually more difficult than completing |
| 1383 | ;; as much as possible, because we first have to find the "current | 1407 | ;; 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'." | |||
| 1340 | (kill-buffer nil))) | 1340 | (kill-buffer nil))) |
| 1341 | (if (and pid (zerop (signal-process pid 0))) ; Mosaic running | 1341 | (if (and pid (zerop (signal-process pid 0))) ; Mosaic running |
| 1342 | (save-excursion | 1342 | (save-excursion |
| 1343 | ;; This is a predictable temp-file name, which is bad, | ||
| 1344 | ;; but it is what Mosaic uses/used. | ||
| 1345 | ;; So it's not Emacs's problem. http://bugs.debian.org/747100 | ||
| 1343 | (find-file (format "/tmp/Mosaic.%d" pid)) | 1346 | (find-file (format "/tmp/Mosaic.%d" pid)) |
| 1344 | (erase-buffer) | 1347 | (erase-buffer) |
| 1345 | (insert (if (browse-url-maybe-new-window new-window) | 1348 | (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'." | |||
| 425 | 425 | ||
| 426 | ;;;###tramp-autoload | 426 | ;;;###tramp-autoload |
| 427 | (defcustom tramp-remote-process-environment | 427 | (defcustom tramp-remote-process-environment |
| 428 | `("HISTFILE=$HOME/.tramp_history" "HISTSIZE=1" "TMOUT=0" "LC_CTYPE=''" | 428 | `("TMOUT=0" "LC_CTYPE=''" |
| 429 | ,(format "TERM=%s" tramp-terminal-type) | 429 | ,(format "TERM=%s" tramp-terminal-type) |
| 430 | "EMACS=t" ;; Deprecated. | 430 | "EMACS=t" ;; Deprecated. |
| 431 | ,(format "INSIDE_EMACS='%s,tramp:%s'" emacs-version tramp-version) | 431 | ,(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. | |||
| 440 | Special handling is applied to the PATH environment, which should | 440 | Special handling is applied to the PATH environment, which should |
| 441 | not be set here. Instead, it should be set via `tramp-remote-path'." | 441 | not be set here. Instead, it should be set via `tramp-remote-path'." |
| 442 | :group 'tramp | 442 | :group 'tramp |
| 443 | :version "24.4" | ||
| 443 | :type '(repeat string)) | 444 | :type '(repeat string)) |
| 444 | 445 | ||
| 445 | (defcustom tramp-sh-extra-args '(("/bash\\'" . "-norc -noprofile")) | 446 | (defcustom tramp-sh-extra-args '(("/bash\\'" . "-norc -noprofile")) |
| @@ -491,9 +492,9 @@ This list is used for copying/renaming with out-of-band methods. | |||
| 491 | See `tramp-actions-before-shell' for more info.") | 492 | See `tramp-actions-before-shell' for more info.") |
| 492 | 493 | ||
| 493 | (defconst tramp-uudecode | 494 | (defconst tramp-uudecode |
| 494 | "(echo begin 600 /tmp/tramp.$$; tail +2) | uudecode | 495 | "(echo begin 600 %t; tail -n +2) | uudecode |
| 495 | cat /tmp/tramp.$$ | 496 | cat %t |
| 496 | rm -f /tmp/tramp.$$" | 497 | rm -f %t" |
| 497 | "Shell function to implement `uudecode' to standard output. | 498 | "Shell function to implement `uudecode' to standard output. |
| 498 | Many systems support `uudecode -o /dev/stdout' or `uudecode -o -' | 499 | Many systems support `uudecode -o /dev/stdout' or `uudecode -o -' |
| 499 | for this or `uudecode -p', but some systems don't, and for them | 500 | for this or `uudecode -p', but some systems don't, and for them |
| @@ -3726,8 +3727,7 @@ file exists and nonzero exit status otherwise." | |||
| 3726 | (with-tramp-progress-reporter | 3727 | (with-tramp-progress-reporter |
| 3727 | vec 5 (format "Opening remote shell `%s'" shell) | 3728 | vec 5 (format "Opening remote shell `%s'" shell) |
| 3728 | ;; Find arguments for this shell. | 3729 | ;; Find arguments for this shell. |
| 3729 | (let ((tramp-end-of-output tramp-initial-end-of-output) | 3730 | (let ((alist tramp-sh-extra-args) |
| 3730 | (alist tramp-sh-extra-args) | ||
| 3731 | item extra-args) | 3731 | item extra-args) |
| 3732 | (while (and alist (null extra-args)) | 3732 | (while (and alist (null extra-args)) |
| 3733 | (setq item (pop alist)) | 3733 | (setq item (pop alist)) |
| @@ -3735,18 +3735,12 @@ file exists and nonzero exit status otherwise." | |||
| 3735 | (setq extra-args (cdr item)))) | 3735 | (setq extra-args (cdr item)))) |
| 3736 | (tramp-send-command | 3736 | (tramp-send-command |
| 3737 | vec (format | 3737 | vec (format |
| 3738 | "exec env ENV='' PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s" | 3738 | "exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=%s PS2='' PS3='' %s %s" |
| 3739 | (tramp-shell-quote-argument tramp-end-of-output) | 3739 | (tramp-shell-quote-argument tramp-end-of-output) |
| 3740 | shell (or extra-args "")) | 3740 | shell (or extra-args "")) |
| 3741 | t)) | 3741 | t)) |
| 3742 | (tramp-set-connection-property | 3742 | (tramp-set-connection-property |
| 3743 | (tramp-get-connection-process vec) "remote-shell" shell) | 3743 | (tramp-get-connection-process vec) "remote-shell" shell))) |
| 3744 | ;; Setting prompts. | ||
| 3745 | (tramp-send-command | ||
| 3746 | vec (format "PS1=%s" (tramp-shell-quote-argument tramp-end-of-output)) t) | ||
| 3747 | (tramp-send-command vec "PS2=''" t) | ||
| 3748 | (tramp-send-command vec "PS3=''" t) | ||
| 3749 | (tramp-send-command vec "PROMPT_COMMAND=''" t))) | ||
| 3750 | 3744 | ||
| 3751 | (defun tramp-find-shell (vec) | 3745 | (defun tramp-find-shell (vec) |
| 3752 | "Opens a shell on the remote host which groks tilde expansion." | 3746 | "Opens a shell on the remote host which groks tilde expansion." |
| @@ -4045,7 +4039,7 @@ Each item is a list that looks like this: | |||
| 4045 | 4039 | ||
| 4046 | \(FORMAT ENCODING DECODING [TEST]\) | 4040 | \(FORMAT ENCODING DECODING [TEST]\) |
| 4047 | 4041 | ||
| 4048 | FORMAT is symbol describing the encoding/decoding format. It can be | 4042 | FORMAT is a symbol describing the encoding/decoding format. It can be |
| 4049 | `b64' for base64 encoding, `uu' for uu encoding, or `pack' for simple packing. | 4043 | `b64' for base64 encoding, `uu' for uu encoding, or `pack' for simple packing. |
| 4050 | 4044 | ||
| 4051 | ENCODING and DECODING can be strings, giving commands, or symbols, | 4045 | 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 | |||
| 4055 | specifier is not present, the input should be read from standard | 4049 | specifier is not present, the input should be read from standard |
| 4056 | input. | 4050 | input. |
| 4057 | 4051 | ||
| 4058 | If they are variables, this variable is a string containing a Perl | 4052 | If they are variables, this variable is a string containing a |
| 4059 | implementation for this functionality. This Perl program will be transferred | 4053 | Perl or Shell implementation for this functionality. This |
| 4060 | to the remote host, and it is available as shell function with the same name. | 4054 | program will be transferred to the remote host, and it is |
| 4055 | available as shell function with the same name. A \"%t\" format | ||
| 4056 | specifier in the variable value denotes a temporary file. | ||
| 4061 | 4057 | ||
| 4062 | The optional TEST command can be used for further tests, whether | 4058 | The optional TEST command can be used for further tests, whether |
| 4063 | ENCODING and DECODING are applicable.") | 4059 | ENCODING and DECODING are applicable.") |
| @@ -4136,10 +4132,25 @@ Goes through the list `tramp-local-coding-commands' and | |||
| 4136 | (throw 'wont-work-remote nil)) | 4132 | (throw 'wont-work-remote nil)) |
| 4137 | 4133 | ||
| 4138 | (when (not (stringp rem-dec)) | 4134 | (when (not (stringp rem-dec)) |
| 4139 | (let ((name (symbol-name rem-dec))) | 4135 | (let ((name (symbol-name rem-dec)) |
| 4136 | (value (symbol-value rem-dec)) | ||
| 4137 | tmpfile) | ||
| 4140 | (while (string-match (regexp-quote "-") name) | 4138 | (while (string-match (regexp-quote "-") name) |
| 4141 | (setq name (replace-match "_" nil t name))) | 4139 | (setq name (replace-match "_" nil t name))) |
| 4142 | (tramp-maybe-send-script vec (symbol-value rem-dec) name) | 4140 | (when (string-match "%t" value) |
| 4141 | (setq tmpfile | ||
| 4142 | (make-temp-name | ||
| 4143 | (expand-file-name | ||
| 4144 | tramp-temp-name-prefix | ||
| 4145 | (tramp-get-remote-tmpdir vec))) | ||
| 4146 | value | ||
| 4147 | (format-spec | ||
| 4148 | value | ||
| 4149 | (format-spec-make | ||
| 4150 | ?t | ||
| 4151 | (tramp-file-name-handler | ||
| 4152 | 'file-remote-p tmpfile 'localname))))) | ||
| 4153 | (tramp-maybe-send-script vec value name) | ||
| 4143 | (setq rem-dec name))) | 4154 | (setq rem-dec name))) |
| 4144 | (tramp-message | 4155 | (tramp-message |
| 4145 | vec 5 | 4156 | vec 5 |
| @@ -4456,6 +4467,7 @@ connection if a previous connection has died for some reason." | |||
| 4456 | (delete-process p)) | 4467 | (delete-process p)) |
| 4457 | (setenv "TERM" tramp-terminal-type) | 4468 | (setenv "TERM" tramp-terminal-type) |
| 4458 | (setenv "LC_ALL" "en_US.utf8") | 4469 | (setenv "LC_ALL" "en_US.utf8") |
| 4470 | (setenv "HISTFILE" "/dev/null") | ||
| 4459 | (setenv "PROMPT_COMMAND") | 4471 | (setenv "PROMPT_COMMAND") |
| 4460 | (setenv "PS1" tramp-initial-end-of-output) | 4472 | (setenv "PS1" tramp-initial-end-of-output) |
| 4461 | (let* ((target-alist (tramp-compute-multi-hops vec)) | 4473 | (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.") | |||
| 1804 | ;; $' $" $` .... are variables. | 1804 | ;; $' $" $` .... are variables. |
| 1805 | ;; ?' ?" ?` are character literals (one-char strings in 1.9+). | 1805 | ;; ?' ?" ?` are character literals (one-char strings in 1.9+). |
| 1806 | ("\\([?$]\\)[#\"'`]" | 1806 | ("\\([?$]\\)[#\"'`]" |
| 1807 | (1 (unless (save-excursion | 1807 | (1 (if (save-excursion |
| 1808 | ;; Not within a string. | 1808 | (nth 3 (syntax-ppss (match-beginning 0)))) |
| 1809 | (nth 3 (syntax-ppss (match-beginning 0)))) | 1809 | ;; Within a string, skip. |
| 1810 | (goto-char (match-end 1)) | ||
| 1810 | (string-to-syntax "\\")))) | 1811 | (string-to-syntax "\\")))) |
| 1811 | ;; Part of symbol when at the end of a method name. | 1812 | ;; Part of symbol when at the end of a method name. |
| 1812 | ("[!?]" | 1813 | ("[!?]" |
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)." | |||
| 63 | 63 | ||
| 64 | (defun xterm-mouse-translate-1 (&optional extension) | 64 | (defun xterm-mouse-translate-1 (&optional extension) |
| 65 | (save-excursion | 65 | (save-excursion |
| 66 | (save-window-excursion | 66 | (save-window-excursion ;FIXME: Why? |
| 67 | (deactivate-mark) | 67 | (deactivate-mark) ;FIXME: Why? |
| 68 | (let* ((xterm-mouse-last nil) | 68 | (let* ((xterm-mouse-last nil) |
| 69 | (down (xterm-mouse-event extension)) | 69 | (down (xterm-mouse-event extension)) |
| 70 | (down-command (nth 0 down)) | 70 | (down-command (nth 0 down)) |
| @@ -73,10 +73,10 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." | |||
| 73 | (down-binding (key-binding (if (symbolp down-where) | 73 | (down-binding (key-binding (if (symbolp down-where) |
| 74 | (vector down-where down-command) | 74 | (vector down-where down-command) |
| 75 | (vector down-command)))) | 75 | (vector down-command)))) |
| 76 | (is-click (string-match "^mouse" (symbol-name (car down))))) | 76 | (is-down (string-match "down" (symbol-name (car down))))) |
| 77 | 77 | ||
| 78 | ;; Retrieve the expected preface for the up-event. | 78 | ;; Retrieve the expected preface for the up-event. |
| 79 | (unless is-click | 79 | (unless is-down |
| 80 | (unless (cond ((null extension) | 80 | (unless (cond ((null extension) |
| 81 | (and (eq (read-event) ?\e) | 81 | (and (eq (read-event) ?\e) |
| 82 | (eq (read-event) ?\[) | 82 | (eq (read-event) ?\[) |
| @@ -88,14 +88,17 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." | |||
| 88 | (error "Unexpected escape sequence from XTerm"))) | 88 | (error "Unexpected escape sequence from XTerm"))) |
| 89 | 89 | ||
| 90 | ;; Process the up-event. | 90 | ;; Process the up-event. |
| 91 | (let* ((click (if is-click down (xterm-mouse-event extension))) | 91 | (let* ((click (if is-down (xterm-mouse-event extension) down)) |
| 92 | (click-data (nth 1 click)) | 92 | (click-data (nth 1 click)) |
| 93 | (click-where (nth 1 click-data))) | 93 | (click-where (nth 1 click-data))) |
| 94 | (if (memq down-binding '(nil ignore)) | 94 | (cond |
| 95 | (if (and (symbolp click-where) | 95 | ((null down) nil) |
| 96 | (consp click-where)) | 96 | ((memq down-binding '(nil ignore)) |
| 97 | (vector (list click-where click-data) click) | 97 | (if (and (symbolp click-where) |
| 98 | (vector click)) | 98 | (consp click-where)) |
| 99 | (vector (list click-where click-data) click) | ||
| 100 | (vector click))) | ||
| 101 | (t | ||
| 99 | (setq unread-command-events | 102 | (setq unread-command-events |
| 100 | (append (if (eq down-where click-where) | 103 | (append (if (eq down-where click-where) |
| 101 | (list click) | 104 | (list click) |
| @@ -114,7 +117,7 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." | |||
| 114 | (if (and (symbolp down-where) | 117 | (if (and (symbolp down-where) |
| 115 | (consp down-where)) | 118 | (consp down-where)) |
| 116 | (vector (list down-where down-data) down) | 119 | (vector (list down-where down-data) down) |
| 117 | (vector down)))))))) | 120 | (vector down))))))))) |
| 118 | 121 | ||
| 119 | ;; These two variables have been converted to terminal parameters. | 122 | ;; These two variables have been converted to terminal parameters. |
| 120 | ;; | 123 | ;; |
| @@ -153,7 +156,8 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." | |||
| 153 | ;; Normal terminal mouse click reporting: expect three bytes, of the | 156 | ;; Normal terminal mouse click reporting: expect three bytes, of the |
| 154 | ;; form <BUTTON+32> <X+32> <Y+32>. Return a list (EVENT-TYPE X Y). | 157 | ;; form <BUTTON+32> <X+32> <Y+32>. Return a list (EVENT-TYPE X Y). |
| 155 | (defun xterm-mouse--read-event-sequence-1000 () | 158 | (defun xterm-mouse--read-event-sequence-1000 () |
| 156 | (list (let ((code (- (read-event) 32))) | 159 | (let* ((code (- (read-event) 32)) |
| 160 | (type | ||
| 157 | (intern | 161 | (intern |
| 158 | ;; For buttons > 3, the release-event looks differently | 162 | ;; For buttons > 3, the release-event looks differently |
| 159 | ;; (see xc/programs/xterm/button.c, function EditorButton), | 163 | ;; (see xc/programs/xterm/button.c, function EditorButton), |
| @@ -161,21 +165,21 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." | |||
| 161 | (cond ((>= code 64) | 165 | (cond ((>= code 64) |
| 162 | (format "mouse-%d" (- code 60))) | 166 | (format "mouse-%d" (- code 60))) |
| 163 | ((memq code '(8 9 10)) | 167 | ((memq code '(8 9 10)) |
| 164 | (setq xterm-mouse-last code) | 168 | (setq xterm-mouse-last (- code 8)) |
| 165 | (format "M-down-mouse-%d" (- code 7))) | 169 | (format "M-down-mouse-%d" (- code 7))) |
| 166 | ((= code 11) | 170 | ((and (= code 11) xterm-mouse-last) |
| 167 | (format "M-mouse-%d" (- xterm-mouse-last 7))) | 171 | (format "M-mouse-%d" (1+ xterm-mouse-last))) |
| 168 | ((= code 3) | 172 | ((and (= code 3) xterm-mouse-last) |
| 169 | ;; For buttons > 5 xterm only reports a | 173 | ;; For buttons > 5 xterm only reports a button-release event. |
| 170 | ;; button-release event. Avoid error by mapping | 174 | ;; Drop them since they're not usable and can be spurious. |
| 171 | ;; them all to mouse-1. | 175 | (format "mouse-%d" (1+ xterm-mouse-last))) |
| 172 | (format "mouse-%d" (+ 1 (or xterm-mouse-last 0)))) | 176 | ((memq code '(0 1 2)) |
| 173 | (t | ||
| 174 | (setq xterm-mouse-last code) | 177 | (setq xterm-mouse-last code) |
| 175 | (format "down-mouse-%d" (+ 1 code)))))) | 178 | (format "down-mouse-%d" (+ 1 code)))))) |
| 176 | ;; x and y coordinates | 179 | (x (- (read-event) 33)) |
| 177 | (- (read-event) 33) | 180 | (y (- (read-event) 33))) |
| 178 | (- (read-event) 33))) | 181 | (and type (wholenump x) (wholenump y) |
| 182 | (list type x y)))) | ||
| 179 | 183 | ||
| 180 | ;; XTerm's 1006-mode terminal mouse click reporting has the form | 184 | ;; XTerm's 1006-mode terminal mouse click reporting has the form |
| 181 | ;; <BUTTON> ; <X> ; <Y> <M or m>, where the button and ordinates are | 185 | ;; <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." | |||
| 222 | ((eq extension 1006) | 226 | ((eq extension 1006) |
| 223 | (xterm-mouse--read-event-sequence-1006)) | 227 | (xterm-mouse--read-event-sequence-1006)) |
| 224 | (t | 228 | (t |
| 225 | (error "Unsupported XTerm mouse protocol")))) | 229 | (error "Unsupported XTerm mouse protocol"))))) |
| 226 | (type (nth 0 click)) | 230 | (when click |
| 227 | (x (nth 1 click)) | 231 | (let* ((type (nth 0 click)) |
| 228 | (y (nth 2 click)) | 232 | (x (nth 1 click)) |
| 229 | ;; Emulate timestamp information. This is accurate enough | 233 | (y (nth 2 click)) |
| 230 | ;; for default value of mouse-1-click-follows-link (450msec). | 234 | ;; Emulate timestamp information. This is accurate enough |
| 231 | (timestamp (xterm-mouse-truncate-wrap | 235 | ;; for default value of mouse-1-click-follows-link (450msec). |
| 232 | (* 1000 | 236 | (timestamp (xterm-mouse-truncate-wrap |
| 233 | (- (float-time) | 237 | (* 1000 |
| 234 | (or xt-mouse-epoch | 238 | (- (float-time) |
| 235 | (setq xt-mouse-epoch (float-time))))))) | 239 | (or xt-mouse-epoch |
| 236 | (w (window-at x y)) | 240 | (setq xt-mouse-epoch (float-time))))))) |
| 237 | (ltrb (window-edges w)) | 241 | (w (window-at x y)) |
| 238 | (left (nth 0 ltrb)) | 242 | (ltrb (window-edges w)) |
| 239 | (top (nth 1 ltrb))) | 243 | (left (nth 0 ltrb)) |
| 240 | (set-terminal-parameter nil 'xterm-mouse-x x) | 244 | (top (nth 1 ltrb))) |
| 241 | (set-terminal-parameter nil 'xterm-mouse-y y) | 245 | (set-terminal-parameter nil 'xterm-mouse-x x) |
| 242 | (setq | 246 | (set-terminal-parameter nil 'xterm-mouse-y y) |
| 243 | last-input-event | 247 | (setq |
| 244 | (list type | 248 | last-input-event |
| 245 | (let ((event (if w | 249 | (list type |
| 246 | (posn-at-x-y (- x left) (- y top) w t) | 250 | (let ((event (if w |
| 247 | (append (list nil 'menu-bar) | 251 | (posn-at-x-y (- x left) (- y top) w t) |
| 248 | (nthcdr 2 (posn-at-x-y x y)))))) | 252 | (append (list nil 'menu-bar) |
| 249 | (setcar (nthcdr 3 event) timestamp) | 253 | (nthcdr 2 (posn-at-x-y x y)))))) |
| 250 | event))))) | 254 | (setcar (nthcdr 3 event) timestamp) |
| 255 | event))))))) | ||
| 251 | 256 | ||
| 252 | ;;;###autoload | 257 | ;;;###autoload |
| 253 | (define-minor-mode xterm-mouse-mode | 258 | (define-minor-mode xterm-mouse-mode |