diff options
| author | Glenn Morris | 2017-11-20 13:08:35 -0500 |
|---|---|---|
| committer | Glenn Morris | 2017-11-20 13:08:35 -0500 |
| commit | 33bfbfee7ef04392b0c30ca2ab5074a14c4ddad7 (patch) | |
| tree | 1f9432682a7bff627f7208bcd8cc594bf7b5d60a | |
| parent | 7cf41d8088284c2fe8b1807d07fc082a270e6a78 (diff) | |
| parent | 6e6bf60eab1e921605064e3d39ea080639f8e0f6 (diff) | |
| download | emacs-33bfbfee7ef04392b0c30ca2ab5074a14c4ddad7.tar.gz emacs-33bfbfee7ef04392b0c30ca2ab5074a14c4ddad7.zip | |
Merge from origin/emacs-26
6e6bf60 Don't let delete_frame select a tooltip frame (Bug#27647)
e9dd580 Filter obtrusive events in help-read-key-sequence.
90075e8 Fix symlink flag in tramp-gvfs-handle-file-attributes
c355529 Fix bug in tramp-handle-file-truename
4c21d04 Fix a typo in doc string of electric-indent-functions-without...
319c2de Avoid assertion violations in echo_area_display
63c7733 ; * lisp/ido.el (ido-find-alternate-file): Doc fix. (Bug#29278)
cbd319a Fix case-folding in Occur
29520b0 Fix quick-calc in C mode with hex values
3e80124 Improve documentation of dired-next/prev-marked-file
90add18 Prevent aborts in line-move-visual
648c128 More fixes in src/.gdbinit
104f3e5 Document how to enter whitespace when using grep-read-files
| -rw-r--r-- | lisp/calc/calc-aent.el | 4 | ||||
| -rw-r--r-- | lisp/dired.el | 19 | ||||
| -rw-r--r-- | lisp/electric.el | 2 | ||||
| -rw-r--r-- | lisp/help.el | 16 | ||||
| -rw-r--r-- | lisp/ido.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp-gvfs.el | 2 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 3 | ||||
| -rw-r--r-- | lisp/progmodes/grep.el | 12 | ||||
| -rw-r--r-- | lisp/progmodes/project.el | 6 | ||||
| -rw-r--r-- | lisp/replace.el | 346 | ||||
| -rw-r--r-- | lisp/vc/vc-git.el | 4 | ||||
| -rw-r--r-- | src/.gdbinit | 18 | ||||
| -rw-r--r-- | src/frame.c | 5 | ||||
| -rw-r--r-- | src/indent.c | 17 | ||||
| -rw-r--r-- | src/xdisp.c | 3 | ||||
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 11 |
16 files changed, 263 insertions, 207 deletions
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index f70a6d0eb07..997ac3d583f 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el | |||
| @@ -728,7 +728,9 @@ in Calc algebraic input.") | |||
| 728 | math-exp-str (1- math-exp-pos)) | 728 | math-exp-str (1- math-exp-pos)) |
| 729 | (1- math-exp-pos)))))) | 729 | (1- math-exp-pos)))))) |
| 730 | (or (and (memq calc-language calc-lang-c-type-hex) | 730 | (or (and (memq calc-language calc-lang-c-type-hex) |
| 731 | (string-match "0[xX][0-9a-fA-F]+" math-exp-str math-exp-pos)) | 731 | (eq (string-match "0[xX][0-9a-fA-F]+" math-exp-str |
| 732 | math-exp-pos) | ||
| 733 | math-exp-pos)) | ||
| 732 | (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\(0*\\([2-9]\\|1[0-4]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-dA-D.]+[eE][-+_]?[0-9]+\\|0*\\([2-9]\\|[0-2][0-9]\\|3[0-6]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-zA-Zα-ωΑ-Ω:.]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?" | 734 | (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\(0*\\([2-9]\\|1[0-4]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-dA-D.]+[eE][-+_]?[0-9]+\\|0*\\([2-9]\\|[0-2][0-9]\\|3[0-6]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-zA-Zα-ωΑ-Ω:.]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?" |
| 733 | math-exp-str math-exp-pos)) | 735 | math-exp-str math-exp-pos)) |
| 734 | (setq math-exp-token 'number | 736 | (setq math-exp-token 'number |
diff --git a/lisp/dired.el b/lisp/dired.el index 0abb521cc5b..ba762277ae7 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -3365,9 +3365,14 @@ argument or confirmation)." | |||
| 3365 | (save-excursion (not (dired-move-to-filename)))) | 3365 | (save-excursion (not (dired-move-to-filename)))) |
| 3366 | 3366 | ||
| 3367 | (defun dired-next-marked-file (arg &optional wrap opoint) | 3367 | (defun dired-next-marked-file (arg &optional wrap opoint) |
| 3368 | "Move to the next marked file. | 3368 | "Move to the ARGth next marked file. |
| 3369 | If WRAP is non-nil, wrap around to the beginning of the buffer if | 3369 | ARG is the numeric prefix argument and defaults to 1. |
| 3370 | we reach the end." | 3370 | If WRAP is non-nil, which happens interactively, wrap around |
| 3371 | to the beginning of the buffer and search from there, if no | ||
| 3372 | marked file is found after this line. | ||
| 3373 | Optional argument OPOINT specifies the buffer position to | ||
| 3374 | return to if no ARGth marked file is found; it defaults to | ||
| 3375 | the position where this command was invoked." | ||
| 3371 | (interactive "p\np") | 3376 | (interactive "p\np") |
| 3372 | (or opoint (setq opoint (point)));; return to where interactively started | 3377 | (or opoint (setq opoint (point)));; return to where interactively started |
| 3373 | (if (if (> arg 0) | 3378 | (if (if (> arg 0) |
| @@ -3384,9 +3389,11 @@ we reach the end." | |||
| 3384 | (dired-next-marked-file arg nil opoint)))) | 3389 | (dired-next-marked-file arg nil opoint)))) |
| 3385 | 3390 | ||
| 3386 | (defun dired-prev-marked-file (arg &optional wrap) | 3391 | (defun dired-prev-marked-file (arg &optional wrap) |
| 3387 | "Move to the previous marked file. | 3392 | "Move to the ARGth previous marked file. |
| 3388 | If WRAP is non-nil, wrap around to the end of the buffer if we | 3393 | ARG is the numeric prefix argument and defaults to 1. |
| 3389 | reach the beginning of the buffer." | 3394 | If WRAP is non-nil, which happens interactively, wrap around |
| 3395 | to the end of the buffer and search backwards from there, if | ||
| 3396 | no ARGth marked file is found before this line." | ||
| 3390 | (interactive "p\np") | 3397 | (interactive "p\np") |
| 3391 | (dired-next-marked-file (- arg) wrap)) | 3398 | (dired-next-marked-file (- arg) wrap)) |
| 3392 | 3399 | ||
diff --git a/lisp/electric.el b/lisp/electric.el index 5f4304462dd..cee35621397 100644 --- a/lisp/electric.el +++ b/lisp/electric.el | |||
| @@ -227,7 +227,7 @@ Python does not lend itself to fully automatic indentation.") | |||
| 227 | haskell-indentation-indent-line haskell-indent-cycle haskell-simple-indent | 227 | haskell-indentation-indent-line haskell-indent-cycle haskell-simple-indent |
| 228 | yaml-indent-line) | 228 | yaml-indent-line) |
| 229 | "List of indent functions that can't reindent. | 229 | "List of indent functions that can't reindent. |
| 230 | If `line-indent-function' is one of those, then `electric-indent-mode' will | 230 | If `indent-line-function' is one of those, then `electric-indent-mode' will |
| 231 | not try to reindent lines. It is normally better to make the major | 231 | not try to reindent lines. It is normally better to make the major |
| 232 | mode set `electric-indent-inhibit', but this can be used as a workaround.") | 232 | mode set `electric-indent-inhibit', but this can be used as a workaround.") |
| 233 | 233 | ||
diff --git a/lisp/help.el b/lisp/help.el index fbb9fc8cbe6..212e3679dad 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -728,11 +728,17 @@ with `mouse-movement' events." | |||
| 728 | Describe the following key, mouse click, or menu item: ")) | 728 | Describe the following key, mouse click, or menu item: ")) |
| 729 | ((and (pred vectorp) (let `(,key0 . ,_) (aref key 0)) | 729 | ((and (pred vectorp) (let `(,key0 . ,_) (aref key 0)) |
| 730 | (guard (symbolp key0)) (let keyname (symbol-name key0))) | 730 | (guard (symbolp key0)) (let keyname (symbol-name key0))) |
| 731 | (if no-mouse-movement | 731 | (or |
| 732 | (string-match "mouse-movement" keyname) | 732 | (and no-mouse-movement |
| 733 | (and (string-match "\\(mouse\\|down\\|click\\|drag\\)" | 733 | (string-match "mouse-movement" keyname)) |
| 734 | keyname) | 734 | (and (string-match "\\(mouse\\|down\\|click\\|drag\\)" |
| 735 | (not (sit-for (/ double-click-time 1000.0) t))))))) | 735 | keyname) |
| 736 | (progn | ||
| 737 | ;; Discard events (e.g. <help-echo>) which might | ||
| 738 | ;; spuriously trigger the `sit-for'. | ||
| 739 | (sleep-for 0.01) | ||
| 740 | (while (read-event nil nil 0.01)) | ||
| 741 | (not (sit-for (/ double-click-time 1000.0) t)))))))) | ||
| 736 | (list | 742 | (list |
| 737 | key | 743 | key |
| 738 | ;; If KEY is a down-event, read and include the | 744 | ;; If KEY is a down-event, read and include the |
diff --git a/lisp/ido.el b/lisp/ido.el index 4f1e36ba914..96a362f7608 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -4302,7 +4302,7 @@ For details of keybindings, see `ido-find-file'." | |||
| 4302 | 4302 | ||
| 4303 | ;;;###autoload | 4303 | ;;;###autoload |
| 4304 | (defun ido-find-alternate-file () | 4304 | (defun ido-find-alternate-file () |
| 4305 | "Switch to another file and show it in another window. | 4305 | "Find another file, select its buffer, kill previous buffer. |
| 4306 | The file name is selected interactively by typing a substring. | 4306 | The file name is selected interactively by typing a substring. |
| 4307 | For details of keybindings, see `ido-find-file'." | 4307 | For details of keybindings, see `ido-find-file'." |
| 4308 | (interactive) | 4308 | (interactive) |
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 709ea4670a8..424e77b0eba 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -992,7 +992,7 @@ If FILE-SYSTEM is non-nil, return file system attributes." | |||
| 992 | (tramp-file-mode-from-int (string-to-number n)) | 992 | (tramp-file-mode-from-int (string-to-number n)) |
| 993 | (format | 993 | (format |
| 994 | "%s%s%s%s------" | 994 | "%s%s%s%s------" |
| 995 | (if dirp "d" "-") | 995 | (if dirp "d" (if res-symlink-target "l" "-")) |
| 996 | (if (equal (cdr (assoc "access::can-read" attributes)) | 996 | (if (equal (cdr (assoc "access::can-read" attributes)) |
| 997 | "FALSE") | 997 | "FALSE") |
| 998 | "-" "r") | 998 | "-" "r") |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 15868bd2e8f..82905a5b964 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -3207,7 +3207,8 @@ User is always nil." | |||
| 3207 | (if (file-remote-p symlink-target) | 3207 | (if (file-remote-p symlink-target) |
| 3208 | (let (file-name-handler-alist) | 3208 | (let (file-name-handler-alist) |
| 3209 | (tramp-compat-file-name-quote symlink-target)) | 3209 | (tramp-compat-file-name-quote symlink-target)) |
| 3210 | symlink-target) | 3210 | (expand-file-name |
| 3211 | symlink-target (file-name-directory v2-localname))) | ||
| 3211 | v2-localname))))) | 3212 | v2-localname))))) |
| 3212 | (when (>= numchase numchase-limit) | 3213 | (when (>= numchase numchase-limit) |
| 3213 | (tramp-error | 3214 | (tramp-error |
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index d0404fdeaf4..c2d80223541 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el | |||
| @@ -904,7 +904,9 @@ substitution string. Note dynamic scoping of variables.") | |||
| 904 | 904 | ||
| 905 | (defun grep-read-files (regexp) | 905 | (defun grep-read-files (regexp) |
| 906 | "Read a file-name pattern arg for interactive grep. | 906 | "Read a file-name pattern arg for interactive grep. |
| 907 | The pattern can include shell wildcards." | 907 | The pattern can include shell wildcards. As whitespace triggers |
| 908 | completion when entering a pattern, including it requires | ||
| 909 | quoting, e.g. `\\[quoted-insert]<space>'." | ||
| 908 | (let* ((bn (or (buffer-file-name) | 910 | (let* ((bn (or (buffer-file-name) |
| 909 | (replace-regexp-in-string "<[0-9]+>\\'" "" (buffer-name)))) | 911 | (replace-regexp-in-string "<[0-9]+>\\'" "" (buffer-name)))) |
| 910 | (fn (and bn | 912 | (fn (and bn |
| @@ -954,7 +956,9 @@ The pattern can include shell wildcards." | |||
| 954 | "Run grep, searching for REGEXP in FILES in directory DIR. | 956 | "Run grep, searching for REGEXP in FILES in directory DIR. |
| 955 | The search is limited to file names matching shell pattern FILES. | 957 | The search is limited to file names matching shell pattern FILES. |
| 956 | FILES may use abbreviations defined in `grep-files-aliases', e.g. | 958 | FILES may use abbreviations defined in `grep-files-aliases', e.g. |
| 957 | entering `ch' is equivalent to `*.[ch]'. | 959 | entering `ch' is equivalent to `*.[ch]'. As whitespace triggers |
| 960 | completion when entering a pattern, including it requires | ||
| 961 | quoting, e.g. `\\[quoted-insert]<space>'. | ||
| 958 | 962 | ||
| 959 | With \\[universal-argument] prefix, you can edit the constructed shell command line | 963 | With \\[universal-argument] prefix, you can edit the constructed shell command line |
| 960 | before it is executed. | 964 | before it is executed. |
| @@ -1032,7 +1036,9 @@ This command shares argument histories with \\[rgrep] and \\[grep]." | |||
| 1032 | "Recursively grep for REGEXP in FILES in directory tree rooted at DIR. | 1036 | "Recursively grep for REGEXP in FILES in directory tree rooted at DIR. |
| 1033 | The search is limited to file names matching shell pattern FILES. | 1037 | The search is limited to file names matching shell pattern FILES. |
| 1034 | FILES may use abbreviations defined in `grep-files-aliases', e.g. | 1038 | FILES may use abbreviations defined in `grep-files-aliases', e.g. |
| 1035 | entering `ch' is equivalent to `*.[ch]'. | 1039 | entering `ch' is equivalent to `*.[ch]'. As whitespace triggers |
| 1040 | completion when entering a pattern, including it requires | ||
| 1041 | quoting, e.g. `\\[quoted-insert]<space>'. | ||
| 1036 | 1042 | ||
| 1037 | With \\[universal-argument] prefix, you can edit the constructed shell command line | 1043 | With \\[universal-argument] prefix, you can edit the constructed shell command line |
| 1038 | before it is executed. | 1044 | before it is executed. |
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 9dc0da4ad5c..93a945edaa4 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el | |||
| @@ -307,7 +307,11 @@ DIRS must contain directory names." | |||
| 307 | (defun project-find-regexp (regexp) | 307 | (defun project-find-regexp (regexp) |
| 308 | "Find all matches for REGEXP in the current project's roots. | 308 | "Find all matches for REGEXP in the current project's roots. |
| 309 | With \\[universal-argument] prefix, you can specify the directory | 309 | With \\[universal-argument] prefix, you can specify the directory |
| 310 | to search in, and the file name pattern to search for." | 310 | to search in, and the file name pattern to search for. The |
| 311 | pattern may use abbreviations defined in `grep-files-aliases', | ||
| 312 | e.g. entering `ch' is equivalent to `*.[ch]'. As whitespace | ||
| 313 | triggers completion when entering a pattern, including it | ||
| 314 | requires quoting, e.g. `\\[quoted-insert]<space>'." | ||
| 311 | (interactive (list (project--read-regexp))) | 315 | (interactive (list (project--read-regexp))) |
| 312 | (let* ((pr (project-current t)) | 316 | (let* ((pr (project-current t)) |
| 313 | (dirs (if current-prefix-arg | 317 | (dirs (if current-prefix-arg |
diff --git a/lisp/replace.el b/lisp/replace.el index cdaeb9240ad..80e584517ce 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -1643,175 +1643,185 @@ See also `multi-occur'." | |||
| 1643 | (inhibit-field-text-motion t) | 1643 | (inhibit-field-text-motion t) |
| 1644 | (headerpt (with-current-buffer out-buf (point)))) | 1644 | (headerpt (with-current-buffer out-buf (point)))) |
| 1645 | (with-current-buffer buf | 1645 | (with-current-buffer buf |
| 1646 | (or coding | 1646 | ;; The following binding is for when case-fold-search |
| 1647 | ;; Set CODING only if the current buffer locally | 1647 | ;; has a local binding in the original buffer, in which |
| 1648 | ;; binds buffer-file-coding-system. | 1648 | ;; case we cannot bind it globally and let that have |
| 1649 | (not (local-variable-p 'buffer-file-coding-system)) | 1649 | ;; effect in every buffer we search. |
| 1650 | (setq coding buffer-file-coding-system)) | 1650 | (let ((case-fold-search case-fold)) |
| 1651 | (save-excursion | 1651 | (or coding |
| 1652 | (goto-char (point-min)) ;; begin searching in the buffer | 1652 | ;; Set CODING only if the current buffer locally |
| 1653 | (while (not (eobp)) | 1653 | ;; binds buffer-file-coding-system. |
| 1654 | (setq origpt (point)) | 1654 | (not (local-variable-p 'buffer-file-coding-system)) |
| 1655 | (when (setq endpt (re-search-forward regexp nil t)) | 1655 | (setq coding buffer-file-coding-system)) |
| 1656 | (setq lines (1+ lines)) ;; increment matching lines count | 1656 | (save-excursion |
| 1657 | (setq matchbeg (match-beginning 0)) | 1657 | (goto-char (point-min)) ;; begin searching in the buffer |
| 1658 | ;; Get beginning of first match line and end of the last. | 1658 | (while (not (eobp)) |
| 1659 | (save-excursion | 1659 | (setq origpt (point)) |
| 1660 | (goto-char matchbeg) | 1660 | (when (setq endpt (re-search-forward regexp nil t)) |
| 1661 | (setq begpt (line-beginning-position)) | 1661 | (setq lines (1+ lines)) ;; increment matching lines count |
| 1662 | (goto-char endpt) | 1662 | (setq matchbeg (match-beginning 0)) |
| 1663 | (setq endpt (line-end-position))) | 1663 | ;; Get beginning of first match line and end of the last. |
| 1664 | ;; Sum line numbers up to the first match line. | 1664 | (save-excursion |
| 1665 | (setq curr-line (+ curr-line (count-lines origpt begpt))) | 1665 | (goto-char matchbeg) |
| 1666 | (setq marker (make-marker)) | 1666 | (setq begpt (line-beginning-position)) |
| 1667 | (set-marker marker matchbeg) | 1667 | (goto-char endpt) |
| 1668 | (setq curstring (occur-engine-line begpt endpt keep-props)) | 1668 | (setq endpt (line-end-position))) |
| 1669 | ;; Highlight the matches | 1669 | ;; Sum line numbers up to the first match line. |
| 1670 | (let ((len (length curstring)) | 1670 | (setq curr-line (+ curr-line (count-lines origpt begpt))) |
| 1671 | (start 0)) | 1671 | (setq marker (make-marker)) |
| 1672 | ;; Count empty lines that don't use next loop (Bug#22062). | 1672 | (set-marker marker matchbeg) |
| 1673 | (when (zerop len) | 1673 | (setq curstring (occur-engine-line begpt endpt keep-props)) |
| 1674 | (setq matches (1+ matches))) | 1674 | ;; Highlight the matches |
| 1675 | (while (and (< start len) | 1675 | (let ((len (length curstring)) |
| 1676 | (string-match regexp curstring start)) | 1676 | (start 0)) |
| 1677 | (setq matches (1+ matches)) | 1677 | ;; Count empty lines that don't use next loop (Bug#22062). |
| 1678 | (add-text-properties | 1678 | (when (zerop len) |
| 1679 | (match-beginning 0) (match-end 0) | 1679 | (setq matches (1+ matches))) |
| 1680 | '(occur-match t) curstring) | 1680 | (while (and (< start len) |
| 1681 | (when match-face | 1681 | (string-match regexp curstring start)) |
| 1682 | ;; Add `match-face' to faces copied from the buffer. | 1682 | (setq matches (1+ matches)) |
| 1683 | (add-face-text-property | 1683 | (add-text-properties |
| 1684 | (match-beginning 0) (match-end 0) | 1684 | (match-beginning 0) (match-end 0) |
| 1685 | match-face nil curstring)) | 1685 | '(occur-match t) curstring) |
| 1686 | ;; Avoid infloop (Bug#7593). | 1686 | (when match-face |
| 1687 | (let ((end (match-end 0))) | 1687 | ;; Add `match-face' to faces copied from the buffer. |
| 1688 | (setq start (if (= start end) (1+ start) end))))) | 1688 | (add-face-text-property |
| 1689 | ;; Generate the string to insert for this match | 1689 | (match-beginning 0) (match-end 0) |
| 1690 | (let* ((match-prefix | 1690 | match-face nil curstring)) |
| 1691 | ;; Using 7 digits aligns tabs properly. | 1691 | ;; Avoid infloop (Bug#7593). |
| 1692 | (apply #'propertize (format "%7d:" curr-line) | 1692 | (let ((end (match-end 0))) |
| 1693 | (append | 1693 | (setq start (if (= start end) (1+ start) end))))) |
| 1694 | (when prefix-face | 1694 | ;; Generate the string to insert for this match |
| 1695 | `(font-lock-face ,prefix-face)) | 1695 | (let* ((match-prefix |
| 1696 | `(occur-prefix t mouse-face (highlight) | 1696 | ;; Using 7 digits aligns tabs properly. |
| 1697 | ;; Allow insertion of text at | 1697 | (apply #'propertize (format "%7d:" curr-line) |
| 1698 | ;; the end of the prefix (for | 1698 | (append |
| 1699 | ;; Occur Edit mode). | 1699 | (when prefix-face |
| 1700 | front-sticky t rear-nonsticky t | 1700 | `(font-lock-face ,prefix-face)) |
| 1701 | occur-target ,marker follow-link t | 1701 | `(occur-prefix t mouse-face (highlight) |
| 1702 | help-echo "mouse-2: go to this occurrence")))) | 1702 | ;; Allow insertion of text |
| 1703 | (match-str | 1703 | ;; at the end of the prefix |
| 1704 | ;; We don't put `mouse-face' on the newline, | 1704 | ;; (for Occur Edit mode). |
| 1705 | ;; because that loses. And don't put it | 1705 | front-sticky t |
| 1706 | ;; on context lines to reduce flicker. | 1706 | rear-nonsticky t |
| 1707 | (propertize curstring 'mouse-face (list 'highlight) | 1707 | occur-target ,marker |
| 1708 | 'occur-target marker | 1708 | follow-link t |
| 1709 | 'follow-link t | 1709 | help-echo "mouse-2: go to this occurrence")))) |
| 1710 | 'help-echo | 1710 | (match-str |
| 1711 | "mouse-2: go to this occurrence")) | 1711 | ;; We don't put `mouse-face' on the newline, |
| 1712 | (out-line | 1712 | ;; because that loses. And don't put it |
| 1713 | (concat | 1713 | ;; on context lines to reduce flicker. |
| 1714 | match-prefix | 1714 | (propertize curstring 'mouse-face (list 'highlight) |
| 1715 | ;; Add non-numeric prefix to all non-first lines | 1715 | 'occur-target marker |
| 1716 | ;; of multi-line matches. | 1716 | 'follow-link t |
| 1717 | (replace-regexp-in-string | 1717 | 'help-echo |
| 1718 | "\n" | 1718 | "mouse-2: go to this occurrence")) |
| 1719 | (if prefix-face | 1719 | (out-line |
| 1720 | (propertize "\n :" 'font-lock-face prefix-face) | 1720 | (concat |
| 1721 | "\n :") | 1721 | match-prefix |
| 1722 | match-str) | 1722 | ;; Add non-numeric prefix to all non-first lines |
| 1723 | ;; Add marker at eol, but no mouse props. | 1723 | ;; of multi-line matches. |
| 1724 | (propertize "\n" 'occur-target marker))) | 1724 | (replace-regexp-in-string |
| 1725 | (data | 1725 | "\n" |
| 1726 | (if (= nlines 0) | 1726 | (if prefix-face |
| 1727 | ;; The simple display style | 1727 | (propertize |
| 1728 | out-line | 1728 | "\n :" 'font-lock-face prefix-face) |
| 1729 | ;; The complex multi-line display style. | 1729 | "\n :") |
| 1730 | (setq ret (occur-context-lines | 1730 | match-str) |
| 1731 | out-line nlines keep-props begpt endpt | 1731 | ;; Add marker at eol, but no mouse props. |
| 1732 | curr-line prev-line prev-after-lines | 1732 | (propertize "\n" 'occur-target marker))) |
| 1733 | prefix-face)) | 1733 | (data |
| 1734 | ;; Set first elem of the returned list to `data', | 1734 | (if (= nlines 0) |
| 1735 | ;; and the second elem to `prev-after-lines'. | 1735 | ;; The simple display style |
| 1736 | (setq prev-after-lines (nth 1 ret)) | 1736 | out-line |
| 1737 | (nth 0 ret)))) | 1737 | ;; The complex multi-line display style. |
| 1738 | ;; Actually insert the match display data | 1738 | (setq ret (occur-context-lines |
| 1739 | (with-current-buffer out-buf | 1739 | out-line nlines keep-props begpt |
| 1740 | (when (and list-matching-lines-jump-to-current-line | 1740 | endpt curr-line prev-line |
| 1741 | (not multi-occur-p) | 1741 | prev-after-lines prefix-face)) |
| 1742 | (not orig-line-shown-p) | 1742 | ;; Set first elem of the returned list to `data', |
| 1743 | (>= curr-line orig-line)) | 1743 | ;; and the second elem to `prev-after-lines'. |
| 1744 | (insert | 1744 | (setq prev-after-lines (nth 1 ret)) |
| 1745 | (concat | 1745 | (nth 0 ret)))) |
| 1746 | (propertize | 1746 | ;; Actually insert the match display data |
| 1747 | (format "%7d:%s" orig-line orig-line-str) | 1747 | (with-current-buffer out-buf |
| 1748 | 'face list-matching-lines-current-line-face | 1748 | (when (and list-matching-lines-jump-to-current-line |
| 1749 | 'mouse-face 'mode-line-highlight | 1749 | (not multi-occur-p) |
| 1750 | 'help-echo "Current line") "\n")) | 1750 | (not orig-line-shown-p) |
| 1751 | (setq orig-line-shown-p t finalpt (point))) | 1751 | (>= curr-line orig-line)) |
| 1752 | (insert data))) | 1752 | (insert |
| 1753 | (goto-char endpt)) | 1753 | (concat |
| 1754 | (if endpt | 1754 | (propertize |
| 1755 | (progn | 1755 | (format "%7d:%s" orig-line orig-line-str) |
| 1756 | ;; Sum line numbers between first and last match lines. | 1756 | 'face list-matching-lines-current-line-face |
| 1757 | (setq curr-line (+ curr-line (count-lines begpt endpt) | 1757 | 'mouse-face 'mode-line-highlight |
| 1758 | ;; Add 1 for empty last match line since | 1758 | 'help-echo "Current line") "\n")) |
| 1759 | ;; count-lines returns 1 line less. | 1759 | (setq orig-line-shown-p t finalpt (point))) |
| 1760 | (if (and (bolp) (eolp)) 1 0))) | 1760 | (insert data))) |
| 1761 | ;; On to the next match... | 1761 | (goto-char endpt)) |
| 1762 | (forward-line 1)) | 1762 | (if endpt |
| 1763 | (goto-char (point-max))) | 1763 | (progn |
| 1764 | (setq prev-line (1- curr-line))) | 1764 | ;; Sum line numbers between first and last match lines. |
| 1765 | ;; Insert original line if haven't done yet. | 1765 | (setq curr-line (+ curr-line (count-lines begpt endpt) |
| 1766 | (when (and list-matching-lines-jump-to-current-line | 1766 | ;; Add 1 for empty last match line |
| 1767 | (not multi-occur-p) | 1767 | ;; since count-lines returns one |
| 1768 | (not orig-line-shown-p)) | 1768 | ;; line less. |
| 1769 | (with-current-buffer out-buf | 1769 | (if (and (bolp) (eolp)) 1 0))) |
| 1770 | (insert | 1770 | ;; On to the next match... |
| 1771 | (concat | 1771 | (forward-line 1)) |
| 1772 | (propertize | 1772 | (goto-char (point-max))) |
| 1773 | (format "%7d:%s" orig-line orig-line-str) | 1773 | (setq prev-line (1- curr-line))) |
| 1774 | 'face list-matching-lines-current-line-face | 1774 | ;; Insert original line if haven't done yet. |
| 1775 | 'mouse-face 'mode-line-highlight | 1775 | (when (and list-matching-lines-jump-to-current-line |
| 1776 | 'help-echo "Current line") "\n")))) | 1776 | (not multi-occur-p) |
| 1777 | ;; Flush remaining context after-lines. | 1777 | (not orig-line-shown-p)) |
| 1778 | (when prev-after-lines | 1778 | (with-current-buffer out-buf |
| 1779 | (with-current-buffer out-buf | 1779 | (insert |
| 1780 | (insert (apply #'concat (occur-engine-add-prefix | 1780 | (concat |
| 1781 | prev-after-lines prefix-face))))))) | 1781 | (propertize |
| 1782 | (when (not (zerop lines)) ;; is the count zero? | 1782 | (format "%7d:%s" orig-line orig-line-str) |
| 1783 | (setq global-lines (+ global-lines lines) | 1783 | 'face list-matching-lines-current-line-face |
| 1784 | global-matches (+ global-matches matches)) | 1784 | 'mouse-face 'mode-line-highlight |
| 1785 | (with-current-buffer out-buf | 1785 | 'help-echo "Current line") "\n")))) |
| 1786 | (goto-char headerpt) | 1786 | ;; Flush remaining context after-lines. |
| 1787 | (let ((beg (point)) | 1787 | (when prev-after-lines |
| 1788 | end) | 1788 | (with-current-buffer out-buf |
| 1789 | (insert (propertize | 1789 | (insert (apply #'concat (occur-engine-add-prefix |
| 1790 | (format "%d match%s%s%s in buffer: %s%s\n" | 1790 | prev-after-lines prefix-face))))))) |
| 1791 | matches (if (= matches 1) "" "es") | 1791 | (when (not (zerop lines)) ;; is the count zero? |
| 1792 | ;; Don't display the same number of lines | 1792 | (setq global-lines (+ global-lines lines) |
| 1793 | ;; and matches in case of 1 match per line. | 1793 | global-matches (+ global-matches matches)) |
| 1794 | (if (= lines matches) | 1794 | (with-current-buffer out-buf |
| 1795 | "" (format " in %d line%s" | 1795 | (goto-char headerpt) |
| 1796 | lines (if (= lines 1) "" "s"))) | 1796 | (let ((beg (point)) |
| 1797 | ;; Don't display regexp for multi-buffer. | 1797 | end) |
| 1798 | (if (> (length buffers) 1) | 1798 | (insert (propertize |
| 1799 | "" (occur-regexp-descr regexp)) | 1799 | (format "%d match%s%s%s in buffer: %s%s\n" |
| 1800 | (buffer-name buf) | 1800 | matches (if (= matches 1) "" "es") |
| 1801 | (if in-region-p | 1801 | ;; Don't display the same number of lines |
| 1802 | (format " within region: %d-%d" | 1802 | ;; and matches in case of 1 match per line. |
| 1803 | occur--region-start | 1803 | (if (= lines matches) |
| 1804 | occur--region-end) | 1804 | "" (format " in %d line%s" |
| 1805 | "")) | 1805 | lines |
| 1806 | 'read-only t)) | 1806 | (if (= lines 1) "" "s"))) |
| 1807 | (setq end (point)) | 1807 | ;; Don't display regexp for multi-buffer. |
| 1808 | (add-text-properties beg end `(occur-title ,buf)) | 1808 | (if (> (length buffers) 1) |
| 1809 | (when title-face | 1809 | "" (occur-regexp-descr regexp)) |
| 1810 | (add-face-text-property beg end title-face)) | 1810 | (buffer-name buf) |
| 1811 | (goto-char (if finalpt | 1811 | (if in-region-p |
| 1812 | (setq occur--final-pos | 1812 | (format " within region: %d-%d" |
| 1813 | (cl-incf finalpt (- end beg))) | 1813 | occur--region-start |
| 1814 | (point-min))))))))) | 1814 | occur--region-end) |
| 1815 | "")) | ||
| 1816 | 'read-only t)) | ||
| 1817 | (setq end (point)) | ||
| 1818 | (add-text-properties beg end `(occur-title ,buf)) | ||
| 1819 | (when title-face | ||
| 1820 | (add-face-text-property beg end title-face)) | ||
| 1821 | (goto-char (if finalpt | ||
| 1822 | (setq occur--final-pos | ||
| 1823 | (cl-incf finalpt (- end beg))) | ||
| 1824 | (point-min)))))))))) | ||
| 1815 | ;; Display total match count and regexp for multi-buffer. | 1825 | ;; Display total match count and regexp for multi-buffer. |
| 1816 | (when (and (not (zerop global-lines)) (> (length buffers) 1)) | 1826 | (when (and (not (zerop global-lines)) (> (length buffers) 1)) |
| 1817 | (goto-char (point-min)) | 1827 | (goto-char (point-min)) |
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index f95e67f4f56..dff0fd1365c 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el | |||
| @@ -1408,7 +1408,9 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"." | |||
| 1408 | "Run git grep, searching for REGEXP in FILES in directory DIR. | 1408 | "Run git grep, searching for REGEXP in FILES in directory DIR. |
| 1409 | The search is limited to file names matching shell pattern FILES. | 1409 | The search is limited to file names matching shell pattern FILES. |
| 1410 | FILES may use abbreviations defined in `grep-files-aliases', e.g. | 1410 | FILES may use abbreviations defined in `grep-files-aliases', e.g. |
| 1411 | entering `ch' is equivalent to `*.[ch]'. | 1411 | entering `ch' is equivalent to `*.[ch]'. As whitespace triggers |
| 1412 | completion when entering a pattern, including it requires | ||
| 1413 | quoting, e.g. `\\[quoted-insert]<space>'. | ||
| 1412 | 1414 | ||
| 1413 | With \\[universal-argument] prefix, you can edit the constructed shell command line | 1415 | With \\[universal-argument] prefix, you can edit the constructed shell command line |
| 1414 | before it is executed. | 1416 | before it is executed. |
diff --git a/src/.gdbinit b/src/.gdbinit index 48bb5dfadb8..e22d03ea476 100644 --- a/src/.gdbinit +++ b/src/.gdbinit | |||
| @@ -352,7 +352,7 @@ end | |||
| 352 | 352 | ||
| 353 | define pcursorx | 353 | define pcursorx |
| 354 | set $cp = $arg0 | 354 | set $cp = $arg0 |
| 355 | printf "y=%d x=%d vpos=%d hpos=%d", $cp->y, $cp->x, $cp->vpos, $cp->hpos | 355 | printf "y=%d x=%d vpos=%d hpos=%d", $cp.y, $cp.x, $cp.vpos, $cp.hpos |
| 356 | end | 356 | end |
| 357 | document pcursorx | 357 | document pcursorx |
| 358 | Pretty print a window cursor. | 358 | Pretty print a window cursor. |
| @@ -369,11 +369,11 @@ end | |||
| 369 | 369 | ||
| 370 | define pwinx | 370 | define pwinx |
| 371 | set $w = $arg0 | 371 | set $w = $arg0 |
| 372 | if ($w->mini_p != Qnil) | 372 | if ($w->mini != 0) |
| 373 | printf "Mini " | 373 | printf "Mini " |
| 374 | end | 374 | end |
| 375 | printf "Window %d ", $int | 375 | printf "Window %d ", $w->sequence_number |
| 376 | xgetptr $w->buffer | 376 | xgetptr $w->contents |
| 377 | set $tem = (struct buffer *) $ptr | 377 | set $tem = (struct buffer *) $ptr |
| 378 | xgetptr $tem->name_ | 378 | xgetptr $tem->name_ |
| 379 | printf "%s", ((struct Lisp_String *) $ptr)->u.s.data | 379 | printf "%s", ((struct Lisp_String *) $ptr)->u.s.data |
| @@ -381,16 +381,14 @@ define pwinx | |||
| 381 | xgetptr $w->start | 381 | xgetptr $w->start |
| 382 | set $tem = (struct Lisp_Marker *) $ptr | 382 | set $tem = (struct Lisp_Marker *) $ptr |
| 383 | printf "start=%d end:", $tem->charpos | 383 | printf "start=%d end:", $tem->charpos |
| 384 | if ($w->window_end_valid != Qnil) | 384 | if ($w->window_end_valid != 0) |
| 385 | xgetint $w->window_end_pos | 385 | printf "pos=%d", $w->window_end_pos |
| 386 | printf "pos=%d", $int | 386 | printf " vpos=%d", $w->window_end_vpos |
| 387 | xgetint $w->window_end_vpos | ||
| 388 | printf " vpos=%d", $int | ||
| 389 | else | 387 | else |
| 390 | printf "invalid" | 388 | printf "invalid" |
| 391 | end | 389 | end |
| 392 | printf " vscroll=%d", $w->vscroll | 390 | printf " vscroll=%d", $w->vscroll |
| 393 | if ($w->force_start != Qnil) | 391 | if ($w->force_start != 0) |
| 394 | printf " FORCE_START" | 392 | printf " FORCE_START" |
| 395 | end | 393 | end |
| 396 | if ($w->must_be_updated_p) | 394 | if ($w->must_be_updated_p) |
diff --git a/src/frame.c b/src/frame.c index 2b32751c0d3..aacb27ec790 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -1920,6 +1920,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force) | |||
| 1920 | See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15025. */ | 1920 | See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15025. */ |
| 1921 | FOR_EACH_FRAME (tail, frame1) | 1921 | FOR_EACH_FRAME (tail, frame1) |
| 1922 | if (!EQ (frame, frame1) | 1922 | if (!EQ (frame, frame1) |
| 1923 | && NILP (Fframe_parameter (frame1, Qtooltip)) | ||
| 1923 | && (FRAME_TERMINAL (XFRAME (frame)) | 1924 | && (FRAME_TERMINAL (XFRAME (frame)) |
| 1924 | == FRAME_TERMINAL (XFRAME (frame1))) | 1925 | == FRAME_TERMINAL (XFRAME (frame1))) |
| 1925 | && FRAME_VISIBLE_P (XFRAME (frame1))) | 1926 | && FRAME_VISIBLE_P (XFRAME (frame1))) |
| @@ -1930,7 +1931,9 @@ delete_frame (Lisp_Object frame, Lisp_Object force) | |||
| 1930 | { | 1931 | { |
| 1931 | FOR_EACH_FRAME (tail, frame1) | 1932 | FOR_EACH_FRAME (tail, frame1) |
| 1932 | { | 1933 | { |
| 1933 | if (! EQ (frame, frame1) && FRAME_LIVE_P (XFRAME (frame1))) | 1934 | if (!EQ (frame, frame1) |
| 1935 | && FRAME_LIVE_P (XFRAME (frame1)) | ||
| 1936 | && NILP (Fframe_parameter (frame1, Qtooltip))) | ||
| 1934 | { | 1937 | { |
| 1935 | /* Do not change a text terminal's top-frame. */ | 1938 | /* Do not change a text terminal's top-frame. */ |
| 1936 | struct frame *f1 = XFRAME (frame1); | 1939 | struct frame *f1 = XFRAME (frame1); |
diff --git a/src/indent.c b/src/indent.c index 192eec72efe..5f931a511e4 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -1959,21 +1959,26 @@ line_number_display_width (struct window *w, int *width, int *pixel_width) | |||
| 1959 | else | 1959 | else |
| 1960 | { | 1960 | { |
| 1961 | struct it it; | 1961 | struct it it; |
| 1962 | struct text_pos wstart; | 1962 | struct text_pos startpos; |
| 1963 | bool saved_restriction = false; | 1963 | bool saved_restriction = false; |
| 1964 | ptrdiff_t count = SPECPDL_INDEX (); | 1964 | ptrdiff_t count = SPECPDL_INDEX (); |
| 1965 | SET_TEXT_POS_FROM_MARKER (wstart, w->start); | 1965 | SET_TEXT_POS_FROM_MARKER (startpos, w->start); |
| 1966 | void *itdata = bidi_shelve_cache (); | 1966 | void *itdata = bidi_shelve_cache (); |
| 1967 | /* We must start from window's start point, but it could be | 1967 | /* We want to start from window's start point, but it could be |
| 1968 | outside the accessible region. */ | 1968 | outside the accessible region, in which case we widen the |
| 1969 | if (wstart.charpos < BEGV || wstart.charpos > ZV) | 1969 | buffer temporarily. It could even be beyond the buffer's end |
| 1970 | (Org mode's display of source code snippets is known to cause | ||
| 1971 | that), in which case we just punt and start from point instead. */ | ||
| 1972 | if (startpos.charpos > Z) | ||
| 1973 | SET_TEXT_POS (startpos, PT, PT_BYTE); | ||
| 1974 | if (startpos.charpos < BEGV || startpos.charpos > ZV) | ||
| 1970 | { | 1975 | { |
| 1971 | record_unwind_protect (save_restriction_restore, | 1976 | record_unwind_protect (save_restriction_restore, |
| 1972 | save_restriction_save ()); | 1977 | save_restriction_save ()); |
| 1973 | Fwiden (); | 1978 | Fwiden (); |
| 1974 | saved_restriction = true; | 1979 | saved_restriction = true; |
| 1975 | } | 1980 | } |
| 1976 | start_display (&it, w, wstart); | 1981 | start_display (&it, w, startpos); |
| 1977 | /* The call to move_it_by_lines below will not generate a line | 1982 | /* The call to move_it_by_lines below will not generate a line |
| 1978 | number if the first line shown in the window is hscrolled | 1983 | number if the first line shown in the window is hscrolled |
| 1979 | such that all of its display elements are out of view. So we | 1984 | such that all of its display elements are out of view. So we |
diff --git a/src/xdisp.c b/src/xdisp.c index f1c6b9ff699..016e7044caf 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -11510,6 +11510,9 @@ echo_area_display (bool update_frame_p) | |||
| 11510 | struct frame *sf = SELECTED_FRAME (); | 11510 | struct frame *sf = SELECTED_FRAME (); |
| 11511 | 11511 | ||
| 11512 | mini_window = FRAME_MINIBUF_WINDOW (sf); | 11512 | mini_window = FRAME_MINIBUF_WINDOW (sf); |
| 11513 | if (NILP (mini_window)) | ||
| 11514 | return; | ||
| 11515 | |||
| 11513 | w = XWINDOW (mini_window); | 11516 | w = XWINDOW (mini_window); |
| 11514 | f = XFRAME (WINDOW_FRAME (w)); | 11517 | f = XFRAME (WINDOW_FRAME (w)); |
| 11515 | 11518 | ||
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index a5bce172c94..bfc62049ccd 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -2671,7 +2671,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 2671 | (should-error | 2671 | (should-error |
| 2672 | (make-symbolic-link tmp-name1 tmp-name2) | 2672 | (make-symbolic-link tmp-name1 tmp-name2) |
| 2673 | :type 'file-already-exists) | 2673 | :type 'file-already-exists) |
| 2674 | ;; number means interactive case. | 2674 | ;; A number means interactive case. |
| 2675 | (cl-letf (((symbol-function 'yes-or-no-p) 'ignore)) | 2675 | (cl-letf (((symbol-function 'yes-or-no-p) 'ignore)) |
| 2676 | (should-error | 2676 | (should-error |
| 2677 | (make-symbolic-link tmp-name1 tmp-name2 0) | 2677 | (make-symbolic-link tmp-name1 tmp-name2 0) |
| @@ -2783,6 +2783,15 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 2783 | (should | 2783 | (should |
| 2784 | (string-equal (file-truename tmp-name1) (file-truename tmp-name2))) | 2784 | (string-equal (file-truename tmp-name1) (file-truename tmp-name2))) |
| 2785 | (should (file-equal-p tmp-name1 tmp-name2)) | 2785 | (should (file-equal-p tmp-name1 tmp-name2)) |
| 2786 | ;; Check relative symlink file name. | ||
| 2787 | (delete-file tmp-name2) | ||
| 2788 | (let ((default-directory tramp-test-temporary-file-directory)) | ||
| 2789 | (make-symbolic-link (file-name-nondirectory tmp-name1) tmp-name2)) | ||
| 2790 | (should (file-symlink-p tmp-name2)) | ||
| 2791 | (should-not (string-equal tmp-name2 (file-truename tmp-name2))) | ||
| 2792 | (should | ||
| 2793 | (string-equal (file-truename tmp-name1) (file-truename tmp-name2))) | ||
| 2794 | (should (file-equal-p tmp-name1 tmp-name2)) | ||
| 2786 | ;; Symbolic links could look like a remote file name. | 2795 | ;; Symbolic links could look like a remote file name. |
| 2787 | ;; They must be quoted then. | 2796 | ;; They must be quoted then. |
| 2788 | (delete-file tmp-name2) | 2797 | (delete-file tmp-name2) |