diff options
| author | Glenn Morris | 2020-01-24 07:50:22 -0800 |
|---|---|---|
| committer | Glenn Morris | 2020-01-24 07:50:22 -0800 |
| commit | 635e55e81240b40fe587e3e2e9fa97550a63203b (patch) | |
| tree | 1aaa94548ad7045a921a44dbfcddae43ef425410 | |
| parent | d9385acac25ace1b41f34f120805ef14ccb93bd9 (diff) | |
| parent | 92f080dda8892861be7c175dc57f71dee0909d82 (diff) | |
| download | emacs-635e55e81240b40fe587e3e2e9fa97550a63203b.tar.gz emacs-635e55e81240b40fe587e3e2e9fa97550a63203b.zip | |
Merge from origin/emacs-27
92f080dda8 Tab-bar related finishing touches.
224e8d1464 Make call_process call signal_after_change. This fixes bu...
d02f2a793e * lisp/simple.el: Minor fixes to commentary.
196c42b8bf Fix a few typos
4f2b967795 Fix doc strings for image-dired rotation commands
# Conflicts:
# etc/NEWS
| -rw-r--r-- | etc/NEWS.27 | 2 | ||||
| -rw-r--r-- | lisp/image-dired.el | 24 | ||||
| -rw-r--r-- | lisp/simple.el | 5 | ||||
| -rw-r--r-- | lisp/tab-bar.el | 17 | ||||
| -rw-r--r-- | lisp/tab-line.el | 2 | ||||
| -rw-r--r-- | src/callproc.c | 37 | ||||
| -rw-r--r-- | src/dispnew.c | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 4 |
8 files changed, 64 insertions, 29 deletions
diff --git a/etc/NEWS.27 b/etc/NEWS.27 index 9c74c84f456..792851e5af5 100644 --- a/etc/NEWS.27 +++ b/etc/NEWS.27 | |||
| @@ -38,7 +38,7 @@ HarfBuzz text shaping engine. It is on by default; use './configure | |||
| 38 | --without-harfbuzz' to build without it. The HarfBuzz text shaping is | 38 | --without-harfbuzz' to build without it. The HarfBuzz text shaping is |
| 39 | available via new font backend drivers 'xfthb' and 'ftcrhb' for Xft | 39 | available via new font backend drivers 'xfthb' and 'ftcrhb' for Xft |
| 40 | and Cairo drawings, respectively, and via the 'harfbuzz' backend on | 40 | and Cairo drawings, respectively, and via the 'harfbuzz' backend on |
| 41 | MS-Windows. The Harfbuzz text shaping is preferred to the previously | 41 | MS-Windows. The HarfBuzz text shaping is preferred to the previously |
| 42 | supported ones, so the font backends that use older shaping engines | 42 | supported ones, so the font backends that use older shaping engines |
| 43 | (FLT on GNU and Unix systems and Uniscribe on MS-Windows) are not | 43 | (FLT on GNU and Unix systems and Uniscribe on MS-Windows) are not |
| 44 | enabled by default; they can be enabled via the 'font-backend' frame | 44 | enabled by default; they can be enabled via the 'font-backend' frame |
diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 7774b82d514..768e941490d 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el | |||
| @@ -1980,20 +1980,12 @@ With prefix argument ARG, display image in its original size." | |||
| 1980 | (clear-image-cache thumb)))) | 1980 | (clear-image-cache thumb)))) |
| 1981 | 1981 | ||
| 1982 | (defun image-dired-rotate-thumbnail-left () | 1982 | (defun image-dired-rotate-thumbnail-left () |
| 1983 | "Rotate thumbnail left (counter clockwise) 90 degrees. | 1983 | "Rotate thumbnail left (counter clockwise) 90 degrees." |
| 1984 | The result of the rotation is displayed in the image display area | ||
| 1985 | and a confirmation is needed before the original image files is | ||
| 1986 | overwritten. This confirmation can be turned off using | ||
| 1987 | `image-dired-rotate-original-ask-before-overwrite'." | ||
| 1988 | (interactive) | 1984 | (interactive) |
| 1989 | (image-dired-rotate-thumbnail "270")) | 1985 | (image-dired-rotate-thumbnail "270")) |
| 1990 | 1986 | ||
| 1991 | (defun image-dired-rotate-thumbnail-right () | 1987 | (defun image-dired-rotate-thumbnail-right () |
| 1992 | "Rotate thumbnail counter right (clockwise) 90 degrees. | 1988 | "Rotate thumbnail counter right (clockwise) 90 degrees." |
| 1993 | The result of the rotation is displayed in the image display area | ||
| 1994 | and a confirmation is needed before the original image files is | ||
| 1995 | overwritten. This confirmation can be turned off using | ||
| 1996 | `image-dired-rotate-original-ask-before-overwrite'." | ||
| 1997 | (interactive) | 1989 | (interactive) |
| 1998 | (image-dired-rotate-thumbnail "90")) | 1990 | (image-dired-rotate-thumbnail "90")) |
| 1999 | 1991 | ||
| @@ -2035,12 +2027,20 @@ overwritten. This confirmation can be turned off using | |||
| 2035 | (image-dired-display-image file)))))) | 2027 | (image-dired-display-image file)))))) |
| 2036 | 2028 | ||
| 2037 | (defun image-dired-rotate-original-left () | 2029 | (defun image-dired-rotate-original-left () |
| 2038 | "Rotate original image left (counter clockwise) 90 degrees." | 2030 | "Rotate original image left (counter clockwise) 90 degrees. |
| 2031 | The result of the rotation is displayed in the image display area | ||
| 2032 | and a confirmation is needed before the original image files is | ||
| 2033 | overwritten. This confirmation can be turned off using | ||
| 2034 | `image-dired-rotate-original-ask-before-overwrite'." | ||
| 2039 | (interactive) | 2035 | (interactive) |
| 2040 | (image-dired-rotate-original "270")) | 2036 | (image-dired-rotate-original "270")) |
| 2041 | 2037 | ||
| 2042 | (defun image-dired-rotate-original-right () | 2038 | (defun image-dired-rotate-original-right () |
| 2043 | "Rotate original image right (clockwise) 90 degrees." | 2039 | "Rotate original image right (clockwise) 90 degrees. |
| 2040 | The result of the rotation is displayed in the image display area | ||
| 2041 | and a confirmation is needed before the original image files is | ||
| 2042 | overwritten. This confirmation can be turned off using | ||
| 2043 | `image-dired-rotate-original-ask-before-overwrite'." | ||
| 2044 | (interactive) | 2044 | (interactive) |
| 2045 | (image-dired-rotate-original "90")) | 2045 | (image-dired-rotate-original "90")) |
| 2046 | 2046 | ||
diff --git a/lisp/simple.el b/lisp/simple.el index 9bfd58f7d61..8be27745b1c 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -3507,10 +3507,9 @@ whose `car' is BUFFER." | |||
| 3507 | (let ((win (car (get-buffer-window-list buf))) | 3507 | (let ((win (car (get-buffer-window-list buf))) |
| 3508 | (pmax (with-current-buffer buf (point-max)))) | 3508 | (pmax (with-current-buffer buf (point-max)))) |
| 3509 | 3509 | ||
| 3510 | ;; The first time we run a command in a fresh created buffer | 3510 | ;; The first time we run a command in a freshly created buffer |
| 3511 | ;; we have not saved positions yet; advance to `point-max', so that | 3511 | ;; we have not saved positions yet; advance to `point-max', so that |
| 3512 | ;; succesive commands knows the position where the new comman start. | 3512 | ;; successive commands know where to start. |
| 3513 | ;; (unless (and pos (memq sym '(save-point beg-last-out))) | ||
| 3514 | (unless (and pos (memq sym '(save-point beg-last-out end-last-out))) | 3513 | (unless (and pos (memq sym '(save-point beg-last-out end-last-out))) |
| 3515 | (setq pos pmax)) | 3514 | (setq pos pmax)) |
| 3516 | ;; Set point in the window displaying buf, if any; otherwise | 3515 | ;; Set point in the window displaying buf, if any; otherwise |
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index f70fb6baeee..eccab268dc9 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el | |||
| @@ -360,19 +360,19 @@ to `tab-bar-tab-name-truncated'." | |||
| 360 | :group 'tab-bar | 360 | :group 'tab-bar |
| 361 | :version "27.1") | 361 | :version "27.1") |
| 362 | 362 | ||
| 363 | (defvar tab-bar-tab-name-truncated-ellipsis | 363 | (defvar tab-bar-tab-name-ellipsis |
| 364 | (if (char-displayable-p ?…) "…" "...")) | 364 | (if (char-displayable-p ?…) "…" "...")) |
| 365 | 365 | ||
| 366 | (defun tab-bar-tab-name-truncated () | 366 | (defun tab-bar-tab-name-truncated () |
| 367 | "Generate tab name from the buffer of the selected window. | 367 | "Generate tab name from the buffer of the selected window. |
| 368 | Truncate it to the length specified by `tab-bar-tab-name-truncated-max'. | 368 | Truncate it to the length specified by `tab-bar-tab-name-truncated-max'. |
| 369 | Append ellipsis `tab-bar-tab-name-truncated-ellipsis' in this case." | 369 | Append ellipsis `tab-bar-tab-name-ellipsis' in this case." |
| 370 | (let ((tab-name (buffer-name (window-buffer (minibuffer-selected-window))))) | 370 | (let ((tab-name (buffer-name (window-buffer (minibuffer-selected-window))))) |
| 371 | (if (< (length tab-name) tab-bar-tab-name-truncated-max) | 371 | (if (< (length tab-name) tab-bar-tab-name-truncated-max) |
| 372 | tab-name | 372 | tab-name |
| 373 | (propertize (truncate-string-to-width | 373 | (propertize (truncate-string-to-width |
| 374 | tab-name tab-bar-tab-name-truncated-max nil nil | 374 | tab-name tab-bar-tab-name-truncated-max nil nil |
| 375 | tab-bar-tab-name-truncated-ellipsis) | 375 | tab-bar-tab-name-ellipsis) |
| 376 | 'help-echo tab-name)))) | 376 | 'help-echo tab-name)))) |
| 377 | 377 | ||
| 378 | 378 | ||
| @@ -722,11 +722,14 @@ Interactively, ARG selects the ARGth different frame to move to." | |||
| 722 | If `leftmost', create as the first tab. | 722 | If `leftmost', create as the first tab. |
| 723 | If `left', create to the left from the current tab. | 723 | If `left', create to the left from the current tab. |
| 724 | If `right', create to the right from the current tab. | 724 | If `right', create to the right from the current tab. |
| 725 | If `rightmost', create as the last tab." | 725 | If `rightmost', create as the last tab. |
| 726 | If the value is a function, it should return a number as a position | ||
| 727 | on the tab bar specifying where to insert a new tab." | ||
| 726 | :type '(choice (const :tag "First tab" leftmost) | 728 | :type '(choice (const :tag "First tab" leftmost) |
| 727 | (const :tag "To the left" left) | 729 | (const :tag "To the left" left) |
| 728 | (const :tag "To the right" right) | 730 | (const :tag "To the right" right) |
| 729 | (const :tag "Last tab" rightmost)) | 731 | (const :tag "Last tab" rightmost) |
| 732 | (function :tag "Function")) | ||
| 730 | :group 'tab-bar | 733 | :group 'tab-bar |
| 731 | :version "27.1") | 734 | :version "27.1") |
| 732 | 735 | ||
| @@ -773,7 +776,9 @@ After the tab is created, the hooks in | |||
| 773 | ('leftmost 0) | 776 | ('leftmost 0) |
| 774 | ('rightmost (length tabs)) | 777 | ('rightmost (length tabs)) |
| 775 | ('left (1- (or from-index 1))) | 778 | ('left (1- (or from-index 1))) |
| 776 | ('right (1+ (or from-index 0))))))) | 779 | ('right (1+ (or from-index 0))) |
| 780 | ((pred functionp) | ||
| 781 | (funcall tab-bar-new-tab-to)))))) | ||
| 777 | (setq to-index (max 0 (min (or to-index 0) (length tabs)))) | 782 | (setq to-index (max 0 (min (or to-index 0) (length tabs)))) |
| 778 | (cl-pushnew to-tab (nthcdr to-index tabs)) | 783 | (cl-pushnew to-tab (nthcdr to-index tabs)) |
| 779 | 784 | ||
diff --git a/lisp/tab-line.el b/lisp/tab-line.el index ad4050fec59..149fe8289c4 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el | |||
| @@ -709,7 +709,7 @@ from the tab line." | |||
| 709 | (set-window-prev-buffers nil (assq-delete-all buffer (window-prev-buffers))) | 709 | (set-window-prev-buffers nil (assq-delete-all buffer (window-prev-buffers))) |
| 710 | (set-window-next-buffers nil (delq buffer (window-next-buffers))))) | 710 | (set-window-next-buffers nil (delq buffer (window-next-buffers))))) |
| 711 | ((functionp tab-line-close-tab-function) | 711 | ((functionp tab-line-close-tab-function) |
| 712 | (funcall tab-line-close-tab-function))) | 712 | (funcall tab-line-close-tab-function tab))) |
| 713 | (force-mode-line-update)))) | 713 | (force-mode-line-update)))) |
| 714 | 714 | ||
| 715 | 715 | ||
diff --git a/src/callproc.c b/src/callproc.c index 52b89504205..6bd4ae22f63 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -746,6 +746,8 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 746 | int carryover = 0; | 746 | int carryover = 0; |
| 747 | bool display_on_the_fly = display_p; | 747 | bool display_on_the_fly = display_p; |
| 748 | struct coding_system saved_coding = process_coding; | 748 | struct coding_system saved_coding = process_coding; |
| 749 | ptrdiff_t prepared_pos = 0; /* prepare_to_modify_buffer was last | ||
| 750 | called here. */ | ||
| 749 | 751 | ||
| 750 | while (1) | 752 | while (1) |
| 751 | { | 753 | { |
| @@ -773,6 +775,33 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 773 | if (display_on_the_fly) | 775 | if (display_on_the_fly) |
| 774 | break; | 776 | break; |
| 775 | } | 777 | } |
| 778 | /* CHANGE FUNCTIONS | ||
| 779 | For each iteration of the enclosing while (1) loop which | ||
| 780 | yields data (i.e. nread > 0), before- and | ||
| 781 | after-change-functions are each invoked exactly once. | ||
| 782 | This is done directly from the current function only, by | ||
| 783 | calling prepare_to_modify_buffer and signal_after_change. | ||
| 784 | It is not done here by directing another function such as | ||
| 785 | insert_1_both to call them. The call to | ||
| 786 | prepare_to_modify_buffer follows this comment, and there | ||
| 787 | is one call to signal_after_change in each of the | ||
| 788 | branches of the next `else if'. | ||
| 789 | |||
| 790 | Exceptionally, the insertion into the buffer is aborted | ||
| 791 | at the call to del_range_2 ~45 lines further down, this | ||
| 792 | function removing the newly inserted data. At this stage | ||
| 793 | prepare_to_modify_buffer has been called, but | ||
| 794 | signal_after_change hasn't. A continue statement | ||
| 795 | restarts the enclosing while (1) loop. A second, | ||
| 796 | unwanted, call to `prepare_to_modify_buffer' is inhibited | ||
| 797 | by the test perpared_pos < PT. The data are inserted | ||
| 798 | again, and this time signal_after_change gets called, | ||
| 799 | balancing the previous call to prepare_to_modify_buffer. */ | ||
| 800 | if ((prepared_pos < PT) && nread) | ||
| 801 | { | ||
| 802 | prepare_to_modify_buffer (PT, PT, NULL); | ||
| 803 | prepared_pos = PT; | ||
| 804 | } | ||
| 776 | 805 | ||
| 777 | /* Now NREAD is the total amount of data in the buffer. */ | 806 | /* Now NREAD is the total amount of data in the buffer. */ |
| 778 | 807 | ||
| @@ -780,15 +809,16 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 780 | ; | 809 | ; |
| 781 | else if (NILP (BVAR (current_buffer, enable_multibyte_characters)) | 810 | else if (NILP (BVAR (current_buffer, enable_multibyte_characters)) |
| 782 | && ! CODING_MAY_REQUIRE_DECODING (&process_coding)) | 811 | && ! CODING_MAY_REQUIRE_DECODING (&process_coding)) |
| 783 | insert_1_both (buf, nread, nread, 0, 1, 0); | 812 | { |
| 813 | insert_1_both (buf, nread, nread, 0, 0, 0); | ||
| 814 | signal_after_change (PT, 0, nread); | ||
| 815 | } | ||
| 784 | else | 816 | else |
| 785 | { /* We have to decode the input. */ | 817 | { /* We have to decode the input. */ |
| 786 | Lisp_Object curbuf; | 818 | Lisp_Object curbuf; |
| 787 | ptrdiff_t count1 = SPECPDL_INDEX (); | 819 | ptrdiff_t count1 = SPECPDL_INDEX (); |
| 788 | 820 | ||
| 789 | XSETBUFFER (curbuf, current_buffer); | 821 | XSETBUFFER (curbuf, current_buffer); |
| 790 | /* FIXME: Call signal_after_change! */ | ||
| 791 | prepare_to_modify_buffer (PT, PT, NULL); | ||
| 792 | /* We cannot allow after-change-functions be run | 822 | /* We cannot allow after-change-functions be run |
| 793 | during decoding, because that might modify the | 823 | during decoding, because that might modify the |
| 794 | buffer, while we rely on process_coding.produced to | 824 | buffer, while we rely on process_coding.produced to |
| @@ -824,6 +854,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, | |||
| 824 | 854 | ||
| 825 | TEMP_SET_PT_BOTH (PT + process_coding.produced_char, | 855 | TEMP_SET_PT_BOTH (PT + process_coding.produced_char, |
| 826 | PT_BYTE + process_coding.produced); | 856 | PT_BYTE + process_coding.produced); |
| 857 | signal_after_change (PT, 0, process_coding.produced_char); | ||
| 827 | carryover = process_coding.carryover_bytes; | 858 | carryover = process_coding.carryover_bytes; |
| 828 | if (carryover > 0) | 859 | if (carryover > 0) |
| 829 | memcpy (buf, process_coding.carryover, | 860 | memcpy (buf, process_coding.carryover, |
diff --git a/src/dispnew.c b/src/dispnew.c index d094ca61798..d79ae836c56 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -4361,7 +4361,7 @@ scrolling_window (struct window *w, int tab_line_p) | |||
| 4361 | 4361 | ||
| 4362 | /* Can't scroll the display of w32 GUI frames when position of point | 4362 | /* Can't scroll the display of w32 GUI frames when position of point |
| 4363 | is indicated by the system caret, because scrolling the display | 4363 | is indicated by the system caret, because scrolling the display |
| 4364 | will then "copy" the pixles used by the caret. */ | 4364 | will then "copy" the pixels used by the caret. */ |
| 4365 | #ifdef HAVE_NTGUI | 4365 | #ifdef HAVE_NTGUI |
| 4366 | if (w32_use_visible_system_caret) | 4366 | if (w32_use_visible_system_caret) |
| 4367 | return 0; | 4367 | return 0; |
diff --git a/src/xdisp.c b/src/xdisp.c index a5efbb39bed..68a504fb2d4 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -19193,7 +19193,7 @@ try_window_reusing_current_matrix (struct window *w) | |||
| 19193 | 19193 | ||
| 19194 | /* Can't scroll the display of w32 GUI frames when position of point | 19194 | /* Can't scroll the display of w32 GUI frames when position of point |
| 19195 | is indicated by the system caret, because scrolling the display | 19195 | is indicated by the system caret, because scrolling the display |
| 19196 | will then "copy" the pixles used by the caret. */ | 19196 | will then "copy" the pixels used by the caret. */ |
| 19197 | #ifdef HAVE_NTGUI | 19197 | #ifdef HAVE_NTGUI |
| 19198 | if (w32_use_visible_system_caret) | 19198 | if (w32_use_visible_system_caret) |
| 19199 | return false; | 19199 | return false; |
| @@ -20185,7 +20185,7 @@ try_window_id (struct window *w) | |||
| 20185 | 20185 | ||
| 20186 | /* Can't let scroll_run_hook below run on w32 GUI frames when | 20186 | /* Can't let scroll_run_hook below run on w32 GUI frames when |
| 20187 | position of point is indicated by the system caret, because | 20187 | position of point is indicated by the system caret, because |
| 20188 | scrolling the display will then "copy" the pixles used by the | 20188 | scrolling the display will then "copy" the pixels used by the |
| 20189 | caret. */ | 20189 | caret. */ |
| 20190 | #ifdef HAVE_NTGUI | 20190 | #ifdef HAVE_NTGUI |
| 20191 | if (FRAME_W32_P (f) && w32_use_visible_system_caret) | 20191 | if (FRAME_W32_P (f) && w32_use_visible_system_caret) |