aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorPaul Eggert2016-04-18 14:05:31 -0700
committerPaul Eggert2016-04-18 14:05:31 -0700
commit0808f2a1a331fbcb2e6ab57894502b0a34311869 (patch)
tree72386004f3d60a5fdbaf1176edeb38ba4083677e /lisp
parent3aa73b04e81ebc396892b14e5e9fa78a13ff85d1 (diff)
parentac00a92e3df7111c0eb2c6456ae7df5850bfd8fa (diff)
downloademacs-0808f2a1a331fbcb2e6ab57894502b0a34311869.tar.gz
emacs-0808f2a1a331fbcb2e6ab57894502b0a34311869.zip
Merge from origin/emacs-25
ac00a92 Make sh-electric-here-document-mode accessible in sh-mode-hoo... 3287f48 ; Add entry to MAINTAINERS b85981f * configure.ac (HAVE_MODULES): Exclude gnu-kfreebsd from prev... 0f33284 Make use of rectangle-preview custom variable. aa0d83a Make use of rectangle-preview face. 33bef6e Use 'grep-find-program' in check-declare.el a8560e5 Improve "C-h S" for cl-lib symbols 52e798b Fix minor issues with removing left or right fringes d6ffd64 Speed up redisplay in ansi-term mode 4ab671c Simplify 8-bit character handling by terminal for 'raw-text' f3653ec * configure.ac (HAVE_MODULES): Treat gnu like gnu-linux. (Bu... ab849b7 Fix w32 memory-management problem when extending buffer text
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/check-declare.el2
-rw-r--r--lisp/info-look.el4
-rw-r--r--lisp/international/mule.el65
-rw-r--r--lisp/progmodes/sh-script.el7
-rw-r--r--lisp/rect.el77
-rw-r--r--lisp/term.el12
-rw-r--r--lisp/window.el14
-rw-r--r--lisp/xt-mouse.el5
8 files changed, 100 insertions, 86 deletions
diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el
index b6fa0546088..b8a00b3fb4e 100644
--- a/lisp/emacs-lisp/check-declare.el
+++ b/lisp/emacs-lisp/check-declare.el
@@ -339,7 +339,7 @@ Returns non-nil if any false statements are found."
339 errlist files) 339 errlist files)
340 (message "%s" m) 340 (message "%s" m)
341 (message "%s" m2) 341 (message "%s" m2)
342 (setq files (process-lines find-program root 342 (setq files (process-lines grep-find-program root
343 "-name" "*.el" 343 "-name" "*.el"
344 "-exec" grep-program 344 "-exec" grep-program
345 "-l" "^[ \t]*(declare-function" "{}" ";")) 345 "-l" "^[ \t]*(declare-function" "{}" ";"))
diff --git a/lisp/info-look.el b/lisp/info-look.el
index 70d2756dfc7..899f41e850d 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -912,7 +912,9 @@ Return nil if there is nothing appropriate in the buffer near point."
912 ;; for things that should go to Function: etc, and those latter 912 ;; for things that should go to Function: etc, and those latter
913 ;; are much more important. Perhaps this could change if some 913 ;; are much more important. Perhaps this could change if some
914 ;; sort of fallback match scheme existed. 914 ;; sort of fallback match scheme existed.
915 ("(elisp)Index" nil "^ -+ .*: " "\\( \\|$\\)"))) 915 ("(elisp)Index" nil "^ -+ .*: " "\\( \\|$\\)")
916 ("(cl)Function Index" nil "^ -+ .*: " "\\( \\|$\\)")
917 ("(cl)Variable Index" nil "^ -+ .*: " "\\( \\|$\\)")))
916 918
917;; docstrings talk about elisp, so have apropos-mode follow emacs-lisp-mode 919;; docstrings talk about elisp, so have apropos-mode follow emacs-lisp-mode
918(info-lookup-maybe-add-help 920(info-lookup-maybe-add-help
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 60a90ae15a4..21ab7e176d7 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -1445,42 +1445,35 @@ graphical terminals."
1445 (let ((coding-type (coding-system-type coding-system)) 1445 (let ((coding-type (coding-system-type coding-system))
1446 (saved-meta-mode 1446 (saved-meta-mode
1447 (terminal-parameter terminal 'keyboard-coding-saved-meta-mode))) 1447 (terminal-parameter terminal 'keyboard-coding-saved-meta-mode)))
1448 (if (not (eq coding-type 'raw-text)) 1448 (let (accept-8-bit)
1449 (let (accept-8-bit) 1449 (if (not (or (coding-system-get coding-system :suitable-for-keyboard)
1450 (if (not (or (coding-system-get coding-system :suitable-for-keyboard) 1450 (coding-system-get coding-system :ascii-compatible-p)))
1451 (coding-system-get coding-system :ascii-compatible-p))) 1451 (error "Unsuitable coding system for keyboard: %s" coding-system))
1452 (error "Unsuitable coding system for keyboard: %s" coding-system)) 1452 (cond ((memq coding-type '(raw-text charset utf-8 shift-jis big5 ccl))
1453 (cond ((memq coding-type '(charset utf-8 shift-jis big5 ccl)) 1453 (setq accept-8-bit t))
1454 (setq accept-8-bit t)) 1454 ((eq coding-type 'iso-2022)
1455 ((eq coding-type 'iso-2022) 1455 (let ((flags (coding-system-get coding-system :flags)))
1456 (let ((flags (coding-system-get coding-system :flags))) 1456 (or (memq '7-bit flags)
1457 (or (memq '7-bit flags) 1457 (setq accept-8-bit t))))
1458 (setq accept-8-bit t)))) 1458 (t
1459 (t 1459 (error "Unsupported coding system for keyboard: %s"
1460 (error "Unsupported coding system for keyboard: %s" 1460 coding-system)))
1461 coding-system))) 1461 (if accept-8-bit
1462 (if accept-8-bit 1462 (progn
1463 (progn 1463 (or saved-meta-mode
1464 (or saved-meta-mode 1464 (set-terminal-parameter terminal
1465 (set-terminal-parameter terminal 1465 'keyboard-coding-saved-meta-mode
1466 'keyboard-coding-saved-meta-mode 1466 (cons (nth 2 (current-input-mode))
1467 (cons (nth 2 (current-input-mode)) 1467 nil)))
1468 nil))) 1468 (set-input-meta-mode 8 terminal))
1469 (set-input-meta-mode 8 terminal)) 1469 (when saved-meta-mode
1470 (when saved-meta-mode 1470 (set-input-meta-mode (car saved-meta-mode) terminal)
1471 (set-input-meta-mode (car saved-meta-mode) terminal) 1471 (set-terminal-parameter terminal
1472 (set-terminal-parameter terminal 1472 'keyboard-coding-saved-meta-mode
1473 'keyboard-coding-saved-meta-mode 1473 nil)))
1474 nil))) 1474 ;; Avoid end-of-line conversion.
1475 ;; Avoid end-of-line conversion. 1475 (setq coding-system
1476 (setq coding-system 1476 (coding-system-change-eol-conversion coding-system 'unix))))
1477 (coding-system-change-eol-conversion coding-system 'unix)))
1478
1479 (when saved-meta-mode
1480 (set-input-meta-mode (car saved-meta-mode) terminal)
1481 (set-terminal-parameter terminal
1482 'keyboard-coding-saved-meta-mode
1483 nil))))
1484 (set-keyboard-coding-system-internal coding-system terminal) 1477 (set-keyboard-coding-system-internal coding-system terminal)
1485 (setq keyboard-coding-system coding-system)) 1478 (setq keyboard-coding-system coding-system))
1486 1479
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 2b61bc2e752..4fe47f026b6 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1225,9 +1225,10 @@ and command `sh-reset-indent-vars-to-global-values'."
1225 :type 'hook 1225 :type 'hook
1226 :group 'sh-script) 1226 :group 'sh-script)
1227 1227
1228(defcustom sh-mode-hook nil 1228(defcustom sh-mode-hook '(sh-electric-here-document-mode)
1229 "Hook run by `sh-mode'." 1229 "Hook run by `sh-mode'."
1230 :type 'hook 1230 :type 'hook
1231 :options '(sh-electric-here-document-mode)
1231 :group 'sh-script) 1232 :group 'sh-script)
1232 1233
1233(defcustom sh-learn-basic-offset nil 1234(defcustom sh-learn-basic-offset nil
@@ -1616,7 +1617,8 @@ buffer indents as it currently is indented.
1616\\[sh-execute-region] Have optional header and region be executed in a subshell. 1617\\[sh-execute-region] Have optional header and region be executed in a subshell.
1617 1618
1618`sh-electric-here-document-mode' controls whether insertion of two 1619`sh-electric-here-document-mode' controls whether insertion of two
1619unquoted < insert a here document. 1620unquoted < insert a here document. You can control this behavior by
1621modifying `sh-mode-hook'.
1620 1622
1621If you generally program a shell different from your login shell you can 1623If you generally program a shell different from your login shell you can
1622set `sh-shell-file' accordingly. If your shell's file name doesn't correctly 1624set `sh-shell-file' accordingly. If your shell's file name doesn't correctly
@@ -1653,7 +1655,6 @@ with your script for an edit-interpret-debug cycle."
1653 (setq-local syntax-propertize-function #'sh-syntax-propertize-function) 1655 (setq-local syntax-propertize-function #'sh-syntax-propertize-function)
1654 (add-hook 'syntax-propertize-extend-region-functions 1656 (add-hook 'syntax-propertize-extend-region-functions
1655 #'syntax-propertize-multiline 'append 'local) 1657 #'syntax-propertize-multiline 'append 'local)
1656 (sh-electric-here-document-mode 1)
1657 (setq-local skeleton-pair-alist '((?` _ ?`))) 1658 (setq-local skeleton-pair-alist '((?` _ ?`)))
1658 (setq-local skeleton-pair-filter-function 'sh-quoted-p) 1659 (setq-local skeleton-pair-filter-function 'sh-quoted-p)
1659 (setq-local skeleton-further-elements 1660 (setq-local skeleton-further-elements
diff --git a/lisp/rect.el b/lisp/rect.el
index 685213a0635..6056b14734d 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -408,40 +408,41 @@ With a prefix (or a FILL) argument, also fill too short lines."
408 :type 'boolean) 408 :type 'boolean)
409 409
410(defun rectangle--string-preview () 410(defun rectangle--string-preview ()
411 (let ((str (minibuffer-contents))) 411 (when rectangle-preview
412 (when (equal str "") 412 (let ((str (minibuffer-contents)))
413 (setq str (or (car-safe minibuffer-default) 413 (when (equal str "")
414 (if (stringp minibuffer-default) minibuffer-default)))) 414 (setq str (or (car-safe minibuffer-default)
415 (when str (setq str (propertize str 'face 'region))) 415 (if (stringp minibuffer-default) minibuffer-default))))
416 (with-selected-window rectangle--string-preview-window 416 (when str (setq str (propertize str 'face 'rectangle-preview)))
417 (unless (or (null rectangle--string-preview-state) 417 (with-selected-window rectangle--string-preview-window
418 (equal str (car rectangle--string-preview-state))) 418 (unless (or (null rectangle--string-preview-state)
419 (rectangle--string-flush-preview) 419 (equal str (car rectangle--string-preview-state)))
420 (apply-on-rectangle 420 (rectangle--string-flush-preview)
421 (lambda (startcol endcol) 421 (apply-on-rectangle
422 (let* ((sc (move-to-column startcol)) 422 (lambda (startcol endcol)
423 (start (if (<= sc startcol) (point) 423 (let* ((sc (move-to-column startcol))
424 (forward-char -1) 424 (start (if (<= sc startcol) (point)
425 (setq sc (current-column)) 425 (forward-char -1)
426 (point))) 426 (setq sc (current-column))
427 (ec (move-to-column endcol)) 427 (point)))
428 (end (point)) 428 (ec (move-to-column endcol))
429 (ol (make-overlay start end))) 429 (end (point))
430 (push ol (nthcdr 3 rectangle--string-preview-state)) 430 (ol (make-overlay start end)))
431 ;; FIXME: The extra spacing doesn't interact correctly with 431 (push ol (nthcdr 3 rectangle--string-preview-state))
432 ;; the extra spacing added by the rectangular-region-highlight. 432 ;; FIXME: The extra spacing doesn't interact correctly with
433 (when (< sc startcol) 433 ;; the extra spacing added by the rectangular-region-highlight.
434 (overlay-put ol 'before-string (rectangle--space-to startcol))) 434 (when (< sc startcol)
435 (let ((as (when (< endcol ec) 435 (overlay-put ol 'before-string (rectangle--space-to startcol)))
436 ;; (rectangle--space-to ec) 436 (let ((as (when (< endcol ec)
437 (spaces-string (- ec endcol)) 437 ;; (rectangle--space-to ec)
438 ))) 438 (spaces-string (- ec endcol))
439 (if (= start end) 439 )))
440 (overlay-put ol 'after-string (if as (concat str as) str)) 440 (if (= start end)
441 (overlay-put ol 'display str) 441 (overlay-put ol 'after-string (if as (concat str as) str))
442 (if as (overlay-put ol 'after-string as)))))) 442 (overlay-put ol 'display str)
443 (nth 1 rectangle--string-preview-state) 443 (if as (overlay-put ol 'after-string as))))))
444 (nth 2 rectangle--string-preview-state)))))) 444 (nth 1 rectangle--string-preview-state)
445 (nth 2 rectangle--string-preview-state)))))))
445 446
446;; FIXME: Should this be turned into inhibit-region-highlight and made to apply 447;; FIXME: Should this be turned into inhibit-region-highlight and made to apply
447;; to non-rectangular regions as well? 448;; to non-rectangular regions as well?
@@ -782,7 +783,7 @@ Ignores `line-move-visual'."
782 (if (not old) 783 (if (not old)
783 (let ((ol (make-overlay left right))) 784 (let ((ol (make-overlay left right)))
784 (overlay-put ol 'window window) 785 (overlay-put ol 'window window)
785 (overlay-put ol 'face 'region) 786 (overlay-put ol 'face 'rectangle-preview)
786 ol) 787 ol)
787 (let ((ol (pop old))) 788 (let ((ol (pop old)))
788 (move-overlay ol left right (current-buffer)) 789 (move-overlay ol left right (current-buffer))
@@ -814,7 +815,7 @@ Ignores `line-move-visual'."
814 (overlay-put ol 'after-string nil))) 815 (overlay-put ol 'after-string nil)))
815 ((< mright rightcol) ;`rightcol' is past EOL. 816 ((< mright rightcol) ;`rightcol' is past EOL.
816 (let ((str (rectangle--space-to rightcol))) 817 (let ((str (rectangle--space-to rightcol)))
817 (put-text-property 0 (length str) 'face 'region str) 818 (put-text-property 0 (length str) 'face 'rectangle-preview str)
818 ;; If cursor happens to be here, draw it at the right place. 819 ;; If cursor happens to be here, draw it at the right place.
819 (rectangle--place-cursor leftcol left str) 820 (rectangle--place-cursor leftcol left str)
820 (overlay-put ol 'after-string str))) 821 (overlay-put ol 'after-string str)))
@@ -826,7 +827,7 @@ Ignores `line-move-visual'."
826 (overlay-put ol 'after-string nil) 827 (overlay-put ol 'after-string nil)
827 (goto-char right) 828 (goto-char right)
828 (let ((str (rectangle--space-to rightcol))) 829 (let ((str (rectangle--space-to rightcol)))
829 (put-text-property 0 (length str) 'face 'region str) 830 (put-text-property 0 (length str) 'face 'rectangle-preview str)
830 (when (= left right) 831 (when (= left right)
831 (rectangle--place-cursor leftcol left str)) 832 (rectangle--place-cursor leftcol left str))
832 (overlay-put ol 'after-string str)))) 833 (overlay-put ol 'after-string str))))
@@ -836,7 +837,7 @@ Ignores `line-move-visual'."
836 ;; Make zero-width rectangles visible! 837 ;; Make zero-width rectangles visible!
837 (overlay-put ol 'after-string 838 (overlay-put ol 'after-string
838 (concat (propertize " " 839 (concat (propertize " "
839 'face '(region (:height 0.2))) 840 'face '(rectangle-preview (:height 0.2)))
840 (overlay-get ol 'after-string)))) 841 (overlay-get ol 'after-string))))
841 (push ol nrol))) 842 (push ol nrol)))
842 start end)) 843 start end))
diff --git a/lisp/term.el b/lisp/term.el
index ecaca505683..3520a3938e3 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -4159,7 +4159,17 @@ the process. Any more args are arguments to PROGRAM."
4159 ;; .emacs ... 4159 ;; .emacs ...
4160 (term-set-escape-char ?\C-x)) 4160 (term-set-escape-char ?\C-x))
4161 4161
4162 (switch-to-buffer term-ansi-buffer-name)) 4162 (switch-to-buffer term-ansi-buffer-name)
4163 ;; For some reason, without the below setting, ansi-term behaves
4164 ;; sluggishly, not clear why, since the buffer is typically very
4165 ;; small.
4166 ;;
4167 ;; There's a larger problem here with supporting bidirectional text:
4168 ;; the application that writes to the terminal could have its own
4169 ;; ideas about displaying bidirectional text, and might not want us
4170 ;; reordering the text or deciding on base paragraph direction. One
4171 ;; such application is Emacs in TTY mode... FIXME.
4172 (setq bidi-paragraph-direction 'left-to-right))
4163 4173
4164 4174
4165;;; Serial terminals 4175;;; Serial terminals
diff --git a/lisp/window.el b/lisp/window.el
index 1d41d821dc4..e086efb594d 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1889,9 +1889,19 @@ the font."
1889 (ncols (/ window-width font-width))) 1889 (ncols (/ window-width font-width)))
1890 (if (and (display-graphic-p) 1890 (if (and (display-graphic-p)
1891 overflow-newline-into-fringe 1891 overflow-newline-into-fringe
1892 (/= (frame-parameter nil 'left-fringe) 0) 1892 (not
1893 (/= (frame-parameter nil 'right-fringe) 0)) 1893 (or (eq left-fringe-width 0)
1894 (and (null left-fringe-width)
1895 (= (frame-parameter nil 'left-fringe) 0))))
1896 (not
1897 (or (eq right-fringe-width 0)
1898 (and (null right-fringe-width)
1899 (= (frame-parameter nil 'right-fringe) 0)))))
1894 ncols 1900 ncols
1901 ;; FIXME: This should remove 1 more column when there are no
1902 ;; fringes, lines are truncated, and the window is hscrolled,
1903 ;; but EOL is not in the view, because then there are 2
1904 ;; truncation glyphs, not one.
1895 (1- ncols))))) 1905 (1- ncols)))))
1896 1906
1897(defun window-current-scroll-bars (&optional window) 1907(defun window-current-scroll-bars (&optional window)
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index e52095789ba..a2b64019f97 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -155,10 +155,7 @@ single byte."
155 (set-keyboard-coding-system 155 (set-keyboard-coding-system
156 (if (terminal-parameter nil 'xterm-mouse-utf-8) 156 (if (terminal-parameter nil 'xterm-mouse-utf-8)
157 'utf-8-unix 157 'utf-8-unix
158 ;; Use Latin-1 instead of no-conversion to avoid flicker 158 'no-conversion))
159 ;; due to `set-keyboard-coding-system' changing the meta
160 ;; mode.
161 'latin-1))
162 ;; Wait only a little; we assume that the entire escape sequence 159 ;; Wait only a little; we assume that the entire escape sequence
163 ;; has already been sent when this function is called. 160 ;; has already been sent when this function is called.
164 (read-char nil nil 0.1)) 161 (read-char nil nil 0.1))