]> code.delx.au - gnu-emacs/blobdiff - lisp/term.el
* progmodes/octave.el (inferior-octave-completion-table)
[gnu-emacs] / lisp / term.el
index 31889a78273ef4fbf0fd038cf9947ff338915736..d9ba848e8be18f9a5f0fa6a01b5d4374a6a14386 100644 (file)
@@ -1252,15 +1252,14 @@ without any interpretation."
     (setq this-command 'yank)
     (mouse-set-point click)
     (term-send-raw-string
-     (or (cond  ; From `mouse-yank-primary':
-         ((eq system-type 'windows-nt)
-          (or (x-get-selection 'PRIMARY)
-              (x-get-selection-value)))
-         ((fboundp 'x-get-selection-value)
-          (or (x-get-selection-value)
-              (x-get-selection 'PRIMARY)))
-         (t
-          (x-get-selection 'PRIMARY)))
+     ;; From `mouse-yank-primary':
+     (or (if (fboundp 'x-get-selection-value)
+             (if (eq system-type 'windows-nt)
+                 (or (x-get-selection 'PRIMARY)
+                     (x-get-selection-value))
+               (or (x-get-selection-value)
+                   (x-get-selection 'PRIMARY)))
+          (x-get-selection 'PRIMARY))
         (error "No selection is available")))))
 
 (defun term-paste ()
@@ -2937,8 +2936,10 @@ See `term-prompt-regexp'."
                          (let ((end (string-match "\r?$" str i)))
                            (if end
                                (funcall term-command-hook
-                                        (prog1 (substring str (1+ i) end)
-                                          (setq i (match-end 0))))
+                                        (decode-coding-string
+                                         (prog1 (substring str (1+ i) end)
+                                           (setq i (match-end 0)))
+                                         locale-coding-system))
                              (setq term-terminal-parameter (substring str i))
                              (setq term-terminal-state 4)
                              (setq i str-length))))