Skip to content

Commit 635e55e

Browse files
committed
Merge from origin/emacs-27
92f080d Tab-bar related finishing touches. 224e8d1 Make call_process call signal_after_change. This fixes bu... d02f2a7 * lisp/simple.el: Minor fixes to commentary. 196c42b Fix a few typos 4f2b967 Fix doc strings for image-dired rotation commands # Conflicts: # etc/NEWS
2 parents d9385ac + 92f080d commit 635e55e

File tree

8 files changed

+64
-29
lines changed

8 files changed

+64
-29
lines changed

etc/NEWS.27

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ HarfBuzz text shaping engine. It is on by default; use './configure
3838
--without-harfbuzz' to build without it. The HarfBuzz text shaping is
3939
available via new font backend drivers 'xfthb' and 'ftcrhb' for Xft
4040
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
4242
supported ones, so the font backends that use older shaping engines
4343
(FLT on GNU and Unix systems and Uniscribe on MS-Windows) are not
4444
enabled by default; they can be enabled via the 'font-backend' frame

lisp/image-dired.el

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,20 +1980,12 @@ With prefix argument ARG, display image in its original size."
19801980
(clear-image-cache thumb))))
19811981

19821982
(defun image-dired-rotate-thumbnail-left ()
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'."
1983+
"Rotate thumbnail left (counter clockwise) 90 degrees."
19881984
(interactive)
19891985
(image-dired-rotate-thumbnail "270"))
19901986

19911987
(defun image-dired-rotate-thumbnail-right ()
1992-
"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'."
1988+
"Rotate thumbnail counter right (clockwise) 90 degrees."
19971989
(interactive)
19981990
(image-dired-rotate-thumbnail "90"))
19991991

@@ -2035,12 +2027,20 @@ overwritten. This confirmation can be turned off using
20352027
(image-dired-display-image file))))))
20362028

20372029
(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'."
20392035
(interactive)
20402036
(image-dired-rotate-original "270"))
20412037

20422038
(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'."
20442044
(interactive)
20452045
(image-dired-rotate-original "90"))
20462046

lisp/simple.el

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3507,10 +3507,9 @@ whose `car' is BUFFER."
35073507
(let ((win (car (get-buffer-window-list buf)))
35083508
(pmax (with-current-buffer buf (point-max))))
35093509

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
35113511
;; we have not saved positions yet; advance to `point-max', so that
3512-
;; succesive commands knows the position where the new comman start.
3513-
;; (unless (and pos (memq sym '(save-point beg-last-out)))
3512+
;; successive commands know where to start.
35143513
(unless (and pos (memq sym '(save-point beg-last-out end-last-out)))
35153514
(setq pos pmax))
35163515
;; Set point in the window displaying buf, if any; otherwise

lisp/tab-bar.el

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,19 +360,19 @@ to `tab-bar-tab-name-truncated'."
360360
:group 'tab-bar
361361
:version "27.1")
362362

363-
(defvar tab-bar-tab-name-truncated-ellipsis
363+
(defvar tab-bar-tab-name-ellipsis
364364
(if (char-displayable-p ?…) "" "..."))
365365

366366
(defun tab-bar-tab-name-truncated ()
367367
"Generate tab name from the buffer of the selected window.
368368
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."
370370
(let ((tab-name (buffer-name (window-buffer (minibuffer-selected-window)))))
371371
(if (< (length tab-name) tab-bar-tab-name-truncated-max)
372372
tab-name
373373
(propertize (truncate-string-to-width
374374
tab-name tab-bar-tab-name-truncated-max nil nil
375-
tab-bar-tab-name-truncated-ellipsis)
375+
tab-bar-tab-name-ellipsis)
376376
'help-echo tab-name))))
377377

378378

@@ -722,11 +722,14 @@ Interactively, ARG selects the ARGth different frame to move to."
722722
If `leftmost', create as the first tab.
723723
If `left', create to the left from the current tab.
724724
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."
726728
:type '(choice (const :tag "First tab" leftmost)
727729
(const :tag "To the left" left)
728730
(const :tag "To the right" right)
729-
(const :tag "Last tab" rightmost))
731+
(const :tag "Last tab" rightmost)
732+
(function :tag "Function"))
730733
:group 'tab-bar
731734
:version "27.1")
732735

@@ -773,7 +776,9 @@ After the tab is created, the hooks in
773776
('leftmost 0)
774777
('rightmost (length tabs))
775778
('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))))))
777782
(setq to-index (max 0 (min (or to-index 0) (length tabs))))
778783
(cl-pushnew to-tab (nthcdr to-index tabs))
779784

lisp/tab-line.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ from the tab line."
709709
(set-window-prev-buffers nil (assq-delete-all buffer (window-prev-buffers)))
710710
(set-window-next-buffers nil (delq buffer (window-next-buffers)))))
711711
((functionp tab-line-close-tab-function)
712-
(funcall tab-line-close-tab-function)))
712+
(funcall tab-line-close-tab-function tab)))
713713
(force-mode-line-update))))
714714

715715

src/callproc.c

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,8 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
746746
int carryover = 0;
747747
bool display_on_the_fly = display_p;
748748
struct coding_system saved_coding = process_coding;
749+
ptrdiff_t prepared_pos = 0; /* prepare_to_modify_buffer was last
750+
called here. */
749751

750752
while (1)
751753
{
@@ -773,22 +775,50 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
773775
if (display_on_the_fly)
774776
break;
775777
}
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+
}
776805

777806
/* Now NREAD is the total amount of data in the buffer. */
778807

779808
if (!nread)
780809
;
781810
else if (NILP (BVAR (current_buffer, enable_multibyte_characters))
782811
&& ! 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+
}
784816
else
785817
{ /* We have to decode the input. */
786818
Lisp_Object curbuf;
787819
ptrdiff_t count1 = SPECPDL_INDEX ();
788820

789821
XSETBUFFER (curbuf, current_buffer);
790-
/* FIXME: Call signal_after_change! */
791-
prepare_to_modify_buffer (PT, PT, NULL);
792822
/* We cannot allow after-change-functions be run
793823
during decoding, because that might modify the
794824
buffer, while we rely on process_coding.produced to
@@ -824,6 +854,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
824854

825855
TEMP_SET_PT_BOTH (PT + process_coding.produced_char,
826856
PT_BYTE + process_coding.produced);
857+
signal_after_change (PT, 0, process_coding.produced_char);
827858
carryover = process_coding.carryover_bytes;
828859
if (carryover > 0)
829860
memcpy (buf, process_coding.carryover,

src/dispnew.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4361,7 +4361,7 @@ scrolling_window (struct window *w, int tab_line_p)
43614361

43624362
/* Can't scroll the display of w32 GUI frames when position of point
43634363
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. */
43654365
#ifdef HAVE_NTGUI
43664366
if (w32_use_visible_system_caret)
43674367
return 0;

src/xdisp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19193,7 +19193,7 @@ try_window_reusing_current_matrix (struct window *w)
1919319193

1919419194
/* Can't scroll the display of w32 GUI frames when position of point
1919519195
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. */
1919719197
#ifdef HAVE_NTGUI
1919819198
if (w32_use_visible_system_caret)
1919919199
return false;
@@ -20185,7 +20185,7 @@ try_window_id (struct window *w)
2018520185

2018620186
/* Can't let scroll_run_hook below run on w32 GUI frames when
2018720187
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
2018920189
caret. */
2019020190
#ifdef HAVE_NTGUI
2019120191
if (FRAME_W32_P (f) && w32_use_visible_system_caret)

0 commit comments

Comments
 (0)