aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Corallo2020-04-03 11:15:55 +0100
committerAndrea Corallo2020-04-03 11:15:55 +0100
commit3cc0438629843e7dbd3bda8bbcf6578b2e7f6200 (patch)
tree8ce51634d61a8ebb617454d98ac6047f81da1211
parent63af801ed34c8dc59fb13c9e058c49203a1ae55d (diff)
parentf28166dc9a56111606be8ac50ad38179a66ea636 (diff)
downloademacs-3cc0438629843e7dbd3bda8bbcf6578b2e7f6200.tar.gz
emacs-3cc0438629843e7dbd3bda8bbcf6578b2e7f6200.zip
Merge remote-tracking branch 'savannah/master' into HEAD
-rw-r--r--configure.ac16
-rw-r--r--doc/lispref/display.texi21
-rw-r--r--doc/lispref/windows.texi10
-rw-r--r--doc/misc/tramp.texi8
-rw-r--r--etc/NEWS17
-rw-r--r--etc/compilation.txt14
-rw-r--r--lisp/calc/calc-macs.el5
-rw-r--r--lisp/calc/calc.el1
-rw-r--r--lisp/cedet/ede.el4
-rw-r--r--lisp/cus-face.el16
-rw-r--r--lisp/desktop.el2
-rw-r--r--lisp/dired-aux.el62
-rw-r--r--lisp/dired.el74
-rw-r--r--lisp/eshell/em-dirs.el5
-rw-r--r--lisp/eshell/esh-var.el23
-rw-r--r--lisp/fileloop.el28
-rw-r--r--lisp/files.el30
-rw-r--r--lisp/image/image-converter.el4
-rw-r--r--lisp/ldefs-boot.el92
-rw-r--r--lisp/minibuffer.el126
-rw-r--r--lisp/net/trampver.el2
-rw-r--r--lisp/progmodes/compile.el26
-rw-r--r--lisp/url/url-cookie.el2
-rw-r--r--lisp/vc/vc-dir.el45
-rw-r--r--lisp/vc/vc.el40
-rw-r--r--lisp/window.el16
-rw-r--r--src/alloc.c106
-rw-r--r--src/buffer.c66
-rw-r--r--src/buffer.h12
-rw-r--r--src/decompress.c6
-rw-r--r--src/dispextern.h17
-rw-r--r--src/nsfont.m7
-rw-r--r--src/nsterm.m56
-rw-r--r--src/pdumper.c4
-rw-r--r--src/w32term.c59
-rw-r--r--src/xdisp.c123
-rw-r--r--src/xfaces.c39
-rw-r--r--src/xterm.c115
-rw-r--r--test/lisp/calc/calc-tests.el11
-rw-r--r--test/lisp/eshell/eshell-tests.el7
-rw-r--r--test/lisp/net/tramp-tests.el6
-rw-r--r--test/lisp/progmodes/compile-tests.el7
42 files changed, 754 insertions, 576 deletions
diff --git a/configure.ac b/configure.ac
index e8f46010910..49b972a9b84 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1247,18 +1247,12 @@ emacs_cv_ln_s_fileonly='cp -p'
1247dnl On MinGW, ensure we will call the MSYS /bin/ln.exe, not some 1247dnl On MinGW, ensure we will call the MSYS /bin/ln.exe, not some
1248dnl random program in the current directory. 1248dnl random program in the current directory.
1249if (echo >conf$$.file) 2>/dev/null; then 1249if (echo >conf$$.file) 2>/dev/null; then
1250 if ln -s conf$$.file conf$$ 2>/dev/null; then 1250 if test "$opsys" = "mingw32"; then
1251 if test "$opsys" = "mingw32"; then 1251 emacs_cv_ln_s_fileonly=/bin/ln
1252 emacs_cv_ln_s_fileonly='/bin/ln -s' 1252 elif ln -s conf$$.file conf$$ 2>/dev/null; then
1253 else 1253 emacs_cv_ln_s_fileonly='ln -s'
1254 emacs_cv_ln_s_fileonly='ln -s'
1255 fi
1256 elif ln conf$$.file conf$$ 2>/dev/null; then 1254 elif ln conf$$.file conf$$ 2>/dev/null; then
1257 if test "$opsys" = "mingw32"; then 1255 emacs_cv_ln_s_fileonly=ln
1258 emacs_cv_ln_s_fileonly=/bin/ln
1259 else
1260 emacs_cv_ln_s_fileonly=ln
1261 fi
1262 fi 1256 fi
1263fi 1257fi
1264 1258
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 2b25d6023cd..132a3c85354 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -1318,12 +1318,6 @@ the buffer specified by @var{buffer-or-name} current for running
1318@var{body}. 1318@var{body}.
1319@end defmac 1319@end defmac
1320 1320
1321@defmac with-displayed-buffer-window buffer-or-name action quit-function &rest body
1322This macro is like @code{with-current-buffer-window} but unlike that
1323displays the buffer specified by @var{buffer-or-name} @emph{before}
1324running @var{body}.
1325@end defmac
1326
1327A window showing a temporary buffer can be fitted to the size of that 1321A window showing a temporary buffer can be fitted to the size of that
1328buffer using the following mode: 1322buffer using the following mode:
1329 1323
@@ -2450,12 +2444,15 @@ Draw a box with lines of width 1, in the foreground color.
2450@item @var{color} 2444@item @var{color}
2451Draw a box with lines of width 1, in color @var{color}. 2445Draw a box with lines of width 1, in color @var{color}.
2452 2446
2453@item @code{(:line-width @var{width} :color @var{color} :style @var{style})} 2447@item @code{(:line-width (@var{vwidth} . @var{hwidth}) :color @var{color} :style @var{style})}
2454This way you can explicitly specify all aspects of the box. The value 2448This way you can explicitly specify all aspects of the box. The values
2455@var{width} specifies the width of the lines to draw; it defaults to 2449@var{vwidth} and @var{hwidth} specifies respectively the width of the
24561. A negative width @minus{}@var{n} means to draw a line of width @var{n} 2450vertical and horizontal lines to draw; they default to (1 . 1).
2457whose top and bottom parts occupy the space of the underlying text, 2451A negative horizontal or vertical width @minus{}@var{n} means to draw a line
2458thus avoiding any increase in the character height. 2452of width @var{n} that occupies the space of the underlying text, thus
2453avoiding any increase in the character height or width. For simplification
2454the width could be specified with only a single number @var{n} instead
2455of a list, such case is equivalent to @code{((abs @var{n}) . @var{n})}.
2459 2456
2460The value @var{color} specifies the color to draw with. The default is 2457The value @var{color} specifies the color to draw with. The default is
2461the foreground color of the face for simple boxes, and the background 2458the foreground color of the face for simple boxes, and the background
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index d0791d40196..af2f3acd467 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -3048,6 +3048,16 @@ since there is no guarantee that an arbitrary caller of
3048@code{display-buffer} will be able to handle the case that no window 3048@code{display-buffer} will be able to handle the case that no window
3049will display the buffer. @code{display-buffer-no-window} is the only 3049will display the buffer. @code{display-buffer-no-window} is the only
3050action function that cares about this entry. 3050action function that cares about this entry.
3051
3052@vindex body-function@r{, a buffer display action alist entry}
3053@item body-function
3054The value must be a function taking one argument (a displayed window).
3055This function can be used to fill the displayed window's body with
3056some contents that might depend on dimensions of the displayed window.
3057It is called @emph{after} the buffer is displayed, and @emph{before}
3058the entries @code{window-height}, @code{window-width} and
3059@code{preserve-size} are applied that could resize the window to fit
3060it to the inserted contents.
3051@end table 3061@end table
3052 3062
3053By convention, the entries @code{window-height}, @code{window-width} 3063By convention, the entries @code{window-height}, @code{window-width}
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 61cf373024f..75d2fd11bb4 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -3776,6 +3776,14 @@ It is even possible to access file archives in file archives, as
3776@end group 3776@end group
3777@end lisp 3777@end lisp
3778 3778
3779@vindex tramp-archive-enabled
3780In order to disable file archives, you could add the following form to
3781your init file:
3782
3783@lisp
3784(customize-set-variable 'tramp-archive-enabled nil)
3785@end lisp
3786
3779 3787
3780@node Bug Reports 3788@node Bug Reports
3781@chapter Reporting Bugs and Problems 3789@chapter Reporting Bugs and Problems
diff --git a/etc/NEWS b/etc/NEWS
index 4b477e5def6..7e578f89dba 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -108,13 +108,16 @@ Mark mode, then Dired commands operate only on files in the active
108region. The values 'file' and 'line' of this user option define the 108region. The values 'file' and 'line' of this user option define the
109details of marking the file at the end of the region. 109details of marking the file at the end of the region.
110 110
111*** State changing VC operations are supported in 'dired-mode' on files 111*** State changing VC operations are supported in Dired on files and
112(but still not on directories). 112directories with the help of new command 'dired-vc-next-action'.
113 113
114** Change Logs and VC 114** Change Logs and VC
115 115
116*** New command 'vc-dir-root' uses the root directory without asking. 116*** New command 'vc-dir-root' uses the root directory without asking.
117 117
118*** New commands 'vc-dir-mark-registered-files' (bound to '* r') and
119'vc-dir-mark-unregistered-files'.
120
118** Gnus 121** Gnus
119 122
120--- 123---
@@ -161,6 +164,12 @@ functions accessible to the user through the existing single function hook
161Modes should use the new hook instead of this user option to register 164Modes should use the new hook instead of this user option to register
162their backends. 165their backends.
163 166
167** Eshell
168
169---
170*** Environment variable INSIDE_EMACS is now copied to subprocesses.
171Its value equals the result of evaluating '(format "%s,eshell" emacs-version)'.
172
164** Tramp 173** Tramp
165 174
166+++ 175+++
@@ -266,6 +275,10 @@ It was used to allow loading Lisp libraries compiled by XEmacs, a
266modified version of Emacs which is no longer actively maintained. 275modified version of Emacs which is no longer actively maintained.
267This is no longer supported, and setting this variable has no effect. 276This is no longer supported, and setting this variable has no effect.
268 277
278+++
279** The macro 'with-displayed-buffer-window' is now obsolete.
280Use macro 'with-current-buffer-window' with action alist entry 'body-function'.
281
269 282
270* Lisp Changes in Emacs 28.1 283* Lisp Changes in Emacs 28.1
271 284
diff --git a/etc/compilation.txt b/etc/compilation.txt
index ebce6a14d06..8f7e2906787 100644
--- a/etc/compilation.txt
+++ b/etc/compilation.txt
@@ -237,6 +237,20 @@ Register 6 contains wrong type
237==1332== by 0x8008621: main (vtest.c:180) 237==1332== by 0x8008621: main (vtest.c:180)
238 238
239 239
240* javac Java compiler
241
242symbol: javac
243
244Should also work when compiling Java with Gradle. We use the position
245of "^" in the third line as column number because no explicit value is
246present.
247
248Test.java:5: error: ';' expected
249 foo foo
250 ^
2511 error
252
253
240* IBM jikes 254* IBM jikes
241 255
242symbols: jikes-file jikes-line 256symbols: jikes-file jikes-line
diff --git a/lisp/calc/calc-macs.el b/lisp/calc/calc-macs.el
index e73d108e6d9..257d369b87a 100644
--- a/lisp/calc/calc-macs.el
+++ b/lisp/calc/calc-macs.el
@@ -161,8 +161,9 @@
161 hms date mod var)))) 161 hms date mod var))))
162 162
163(defsubst Math-num-integerp (a) 163(defsubst Math-num-integerp (a)
164 (or (not (consp a)) 164 (or (integerp a)
165 (and (eq (car a) 'float) 165 (and (consp a)
166 (eq (car a) 'float)
166 (>= (nth 2 a) 0)))) 167 (>= (nth 2 a) 0))))
167 168
168(defsubst Math-equal-int (a b) 169(defsubst Math-equal-int (a b)
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 4b2a938a5f1..4e4fb671730 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -2927,6 +2927,7 @@ the United States."
2927 2927
2928 2928
2929 2929
2930(defvar math-comp-selected)
2930(defvar calc-selection-cache-entry) 2931(defvar calc-selection-cache-entry)
2931;;; Format the number A as a string. [X N; X Z] [Public] 2932;;; Format the number A as a string. [X N; X Z] [Public]
2932(defun math-format-stack-value (entry) 2933(defun math-format-stack-value (entry)
diff --git a/lisp/cedet/ede.el b/lisp/cedet/ede.el
index c2036878288..8c336117c92 100644
--- a/lisp/cedet/ede.el
+++ b/lisp/cedet/ede.el
@@ -470,7 +470,7 @@ To be used in hook functions."
470 ;; Emacs 21 has no buffer file name for directory edits. 470 ;; Emacs 21 has no buffer file name for directory edits.
471 ;; so we need to add these hacks in. 471 ;; so we need to add these hacks in.
472 (eq major-mode 'dired-mode) 472 (eq major-mode 'dired-mode)
473 (eq major-mode 'vc-dired-mode)) 473 (eq major-mode 'vc-dir-mode))
474 (ede-minor-mode 1))) 474 (ede-minor-mode 1)))
475 475
476(define-minor-mode ede-minor-mode 476(define-minor-mode ede-minor-mode
@@ -481,7 +481,7 @@ controlled project, then this mode is activated automatically
481provided `global-ede-mode' is enabled." 481provided `global-ede-mode' is enabled."
482 :group 'ede 482 :group 'ede
483 (cond ((or (eq major-mode 'dired-mode) 483 (cond ((or (eq major-mode 'dired-mode)
484 (eq major-mode 'vc-dired-mode)) 484 (eq major-mode 'vc-dir-mode))
485 (ede-dired-minor-mode (if ede-minor-mode 1 -1))) 485 (ede-dired-minor-mode (if ede-minor-mode 1 -1)))
486 (ede-minor-mode 486 (ede-minor-mode
487 (if (not ede-constructing) 487 (if (not ede-constructing)
diff --git a/lisp/cus-face.el b/lisp/cus-face.el
index ed4cf046fcf..cc766aa4509 100644
--- a/lisp/cus-face.el
+++ b/lisp/cus-face.el
@@ -166,9 +166,11 @@
166 :help-echo "Control box around text." 166 :help-echo "Control box around text."
167 (const :tag "Off" nil) 167 (const :tag "Off" nil)
168 (list :tag "Box" 168 (list :tag "Box"
169 :value (:line-width 2 :color "grey75" :style released-button) 169 :value (:line-width (2 . 2) :color "grey75" :style released-button)
170 (const :format "" :value :line-width) 170 (const :format "" :value :line-width)
171 (integer :tag "Width") 171 (cons :tag "Width" :extra-offset 2
172 (integer :tag "Vertical")
173 (integer :tag "Horizontal"))
172 (const :format "" :value :color) 174 (const :format "" :value :color)
173 (choice :tag "Color" (const :tag "*" nil) color) 175 (choice :tag "Color" (const :tag "*" nil) color)
174 (const :format "" :value :style) 176 (const :format "" :value :style)
@@ -181,15 +183,19 @@
181 (and real-value 183 (and real-value
182 (let ((lwidth 184 (let ((lwidth
183 (or (and (consp real-value) 185 (or (and (consp real-value)
184 (plist-get real-value :line-width)) 186 (if (listp (cdr real-value))
187 (plist-get real-value :line-width)
188 real-value))
185 (and (integerp real-value) real-value) 189 (and (integerp real-value) real-value)
186 1)) 190 '(1 . 1)))
187 (color 191 (color
188 (or (and (consp real-value) (plist-get real-value :color)) 192 (or (and (consp real-value) (plist-get real-value :color))
189 (and (stringp real-value) real-value) 193 (and (stringp real-value) real-value)
190 nil)) 194 nil))
191 (style 195 (style
192 (and (consp real-value) (plist-get real-value :style)))) 196 (and (consp real-value) (plist-get real-value :style))))
197 (if (integerp lwidth)
198 (setq lwidth (cons (abs lwidth) lwidth)))
193 (list :line-width lwidth :color color :style style)))) 199 (list :line-width lwidth :color color :style style))))
194 ;; filter to make customized-value suitable for storing 200 ;; filter to make customized-value suitable for storing
195 (lambda (cus-value) 201 (lambda (cus-value)
diff --git a/lisp/desktop.el b/lisp/desktop.el
index de601a4de8c..9d117c6f0d6 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -534,7 +534,7 @@ can guess how to load the mode's definition.")
534 '((defining-kbd-macro nil) 534 '((defining-kbd-macro nil)
535 (isearch-mode nil) 535 (isearch-mode nil)
536 (vc-mode nil) 536 (vc-mode nil)
537 (vc-dired-mode nil) 537 (vc-dir-mode nil)
538 (erc-track-minor-mode nil) 538 (erc-track-minor-mode nil)
539 (savehist-mode nil)) 539 (savehist-mode nil))
540 "Table mapping minor mode variables to minor mode functions. 540 "Table mapping minor mode variables to minor mode functions.
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 6f50a3da6ca..60a352d78e0 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -3050,6 +3050,68 @@ instead."
3050 (backward-delete-char 1)) 3050 (backward-delete-char 1))
3051 (message "%s" (buffer-string))))) 3051 (message "%s" (buffer-string)))))
3052 3052
3053
3054;;; Version control from dired
3055
3056(declare-function vc-dir-unmark-all-files "vc-dir")
3057(declare-function vc-dir-mark-files "vc-dir")
3058
3059;;;###autoload
3060(defun dired-vc-next-action (verbose)
3061 "Do the next version control operation on marked files/directories.
3062When only files are marked then call `vc-next-action' with the
3063same value of the VERBOSE argument.
3064When also directories are marked then call `vc-dir' and mark
3065the same files/directories in the VC-Dir buffer that were marked
3066in the Dired buffer."
3067 (interactive "P")
3068 (let* ((marked-files
3069 (dired-get-marked-files nil nil nil nil t))
3070 (mark-files
3071 (when (cl-some #'file-directory-p marked-files)
3072 ;; Fix deficiency of Dired by adding slash to dirs
3073 (mapcar (lambda (file)
3074 (if (file-directory-p file)
3075 (file-name-as-directory file)
3076 file))
3077 marked-files))))
3078 (if mark-files
3079 (let ((transient-hook (make-symbol "vc-dir-mark-files")))
3080 (fset transient-hook
3081 (lambda ()
3082 (remove-hook 'vc-dir-refresh-hook transient-hook t)
3083 (vc-dir-unmark-all-files t)
3084 (vc-dir-mark-files mark-files)))
3085 (vc-dir-root)
3086 (add-hook 'vc-dir-refresh-hook transient-hook nil t))
3087 (vc-next-action verbose))))
3088
3089(declare-function vc-compatible-state "vc")
3090
3091(defun dired-vc-deduce-fileset (&optional state-model-only-files not-state-changing)
3092 (let ((backend (vc-responsible-backend default-directory))
3093 (files (dired-get-marked-files nil nil nil nil t))
3094 only-files-list
3095 state
3096 model)
3097 (when (and (not not-state-changing) (cl-some #'file-directory-p files))
3098 (user-error "State changing VC operations on directories supported only in `vc-dir'"))
3099
3100 (when state-model-only-files
3101 (setq only-files-list (mapcar (lambda (file) (cons file (vc-state file))) files))
3102 (setq state (cdar only-files-list))
3103 ;; Check that all files are in a consistent state, since we use that
3104 ;; state to decide which operation to perform.
3105 (dolist (crt (cdr only-files-list))
3106 (unless (vc-compatible-state (cdr crt) state)
3107 (error "When applying VC operations to multiple files, the files are required\nto be in similar VC states.\n%s in state %s clashes with %s in state %s"
3108 (car crt) (cdr crt) (caar only-files-list) state)))
3109 (setq only-files-list (mapcar 'car only-files-list))
3110 (when (and state (not (eq state 'unregistered)))
3111 (setq model (vc-checkout-model backend only-files-list))))
3112 (list backend files only-files-list state model)))
3113
3114
3053(provide 'dired-aux) 3115(provide 'dired-aux)
3054 3116
3055;; Local Variables: 3117;; Local Variables:
diff --git a/lisp/dired.el b/lisp/dired.el
index 41bbf9f56a2..62e232b79fd 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1208,15 +1208,11 @@ wildcards, erases the buffer, and builds the subdir-alist anew
1208 1208
1209 ;; default-directory and dired-actual-switches must be buffer-local 1209 ;; default-directory and dired-actual-switches must be buffer-local
1210 ;; and initialized by now. 1210 ;; and initialized by now.
1211 (let (dirname 1211 (let ((dirname
1212 ;; This makes read-in much faster. 1212 (expand-file-name
1213 ;; In particular, it prevents the font lock hook from running 1213 (if (consp dired-directory)
1214 ;; until the directory is all read in. 1214 (car dired-directory)
1215 (inhibit-modification-hooks t)) 1215 dired-directory))))
1216 (if (consp dired-directory)
1217 (setq dirname (car dired-directory))
1218 (setq dirname dired-directory))
1219 (setq dirname (expand-file-name dirname))
1220 (save-excursion 1216 (save-excursion
1221 ;; This hook which may want to modify dired-actual-switches 1217 ;; This hook which may want to modify dired-actual-switches
1222 ;; based on dired-directory, e.g. with ange-ftp to a SysV host 1218 ;; based on dired-directory, e.g. with ange-ftp to a SysV host
@@ -1226,17 +1222,25 @@ wildcards, erases the buffer, and builds the subdir-alist anew
1226 (setq buffer-undo-list nil)) 1222 (setq buffer-undo-list nil))
1227 (setq-local file-name-coding-system 1223 (setq-local file-name-coding-system
1228 (or coding-system-for-read file-name-coding-system)) 1224 (or coding-system-for-read file-name-coding-system))
1229 (let ((inhibit-read-only t) 1225 (widen)
1230 ;; Don't make undo entries for readin. 1226 ;; We used to bind `inhibit-modification-hooks' to try and speed up
1231 (buffer-undo-list t)) 1227 ;; execution, in particular, to prevent the font-lock hook from running
1232 (widen) 1228 ;; until the directory is all read in.
1233 (erase-buffer) 1229 ;; It's not clear why font-lock would be a significant issue
1234 (dired-readin-insert)) 1230 ;; here, but I used `combine-change-calls' which should provide the
1235 (goto-char (point-min)) 1231 ;; same performance advantages without the problem of breaking
1236 ;; Must first make alist buffer local and set it to nil because 1232 ;; users of after/before-change-functions.
1237 ;; dired-build-subdir-alist will call dired-clear-alist first 1233 (combine-change-calls (point-min) (point-max)
1238 (setq-local dired-subdir-alist nil) 1234 (let ((inhibit-read-only t)
1239 (dired-build-subdir-alist) 1235 ;; Don't make undo entries for readin.
1236 (buffer-undo-list t))
1237 (erase-buffer)
1238 (dired-readin-insert))
1239 (goto-char (point-min))
1240 ;; Must first make alist buffer local and set it to nil because
1241 ;; dired-build-subdir-alist will call dired-clear-alist first
1242 (setq-local dired-subdir-alist nil)
1243 (dired-build-subdir-alist))
1240 (let ((attributes (file-attributes dirname))) 1244 (let ((attributes (file-attributes dirname)))
1241 (if (eq (car attributes) t) 1245 (if (eq (car attributes) t)
1242 (set-visited-file-modtime (file-attribute-modification-time 1246 (set-visited-file-modtime (file-attribute-modification-time
@@ -1870,6 +1874,7 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
1870 (define-key map "\177" 'dired-unmark-backward) 1874 (define-key map "\177" 'dired-unmark-backward)
1871 (define-key map [remap undo] 'dired-undo) 1875 (define-key map [remap undo] 'dired-undo)
1872 (define-key map [remap advertised-undo] 'dired-undo) 1876 (define-key map [remap advertised-undo] 'dired-undo)
1877 (define-key map [remap vc-next-action] 'dired-vc-next-action)
1873 ;; thumbnail manipulation (image-dired) 1878 ;; thumbnail manipulation (image-dired)
1874 (define-key map "\C-td" 'image-dired-display-thumbs) 1879 (define-key map "\C-td" 'image-dired-display-thumbs)
1875 (define-key map "\C-tt" 'image-dired-tag-files) 1880 (define-key map "\C-tt" 'image-dired-tag-files)
@@ -3520,26 +3525,27 @@ argument or confirmation)."
3520 ;; Mark *Marked Files* window as softly-dedicated, to prevent 3525 ;; Mark *Marked Files* window as softly-dedicated, to prevent
3521 ;; other buffers e.g. *Completions* from reusing it (bug#17554). 3526 ;; other buffers e.g. *Completions* from reusing it (bug#17554).
3522 (display-buffer-mark-dedicated 'soft)) 3527 (display-buffer-mark-dedicated 'soft))
3523 (with-displayed-buffer-window 3528 (with-current-buffer-window
3524 buffer 3529 buffer
3525 (cons 'display-buffer-below-selected 3530 `(display-buffer-below-selected
3526 '((window-height . fit-window-to-buffer) 3531 (window-height . fit-window-to-buffer)
3527 (preserve-size . (nil . t)))) 3532 (preserve-size . (nil . t))
3533 (body-function
3534 . ,#'(lambda (_window)
3535 ;; Handle (t FILE) just like (FILE), here. That value is
3536 ;; used (only in some cases), to mean just one file that was
3537 ;; marked, rather than the current line file.
3538 (dired-format-columns-of-files
3539 (if (eq (car files) t) (cdr files) files))
3540 (remove-text-properties (point-min) (point-max)
3541 '(mouse-face nil help-echo nil))
3542 (setq tab-line-exclude nil))))
3528 #'(lambda (window _value) 3543 #'(lambda (window _value)
3529 (with-selected-window window 3544 (with-selected-window window
3530 (unwind-protect 3545 (unwind-protect
3531 (apply function args) 3546 (apply function args)
3532 (when (window-live-p window) 3547 (when (window-live-p window)
3533 (quit-restore-window window 'kill))))) 3548 (quit-restore-window window 'kill)))))))))
3534 ;; Handle (t FILE) just like (FILE), here. That value is
3535 ;; used (only in some cases), to mean just one file that was
3536 ;; marked, rather than the current line file.
3537 (with-current-buffer buffer
3538 (dired-format-columns-of-files
3539 (if (eq (car files) t) (cdr files) files))
3540 (remove-text-properties (point-min) (point-max)
3541 '(mouse-face nil help-echo nil))
3542 (setq tab-line-exclude nil))))))
3543 3549
3544(defun dired-format-columns-of-files (files) 3550(defun dired-format-columns-of-files (files)
3545 (let ((beg (point))) 3551 (let ((beg (point)))
diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el
index 1949e5dc8fc..51df6fa1d52 100644
--- a/lisp/eshell/em-dirs.el
+++ b/lisp/eshell/em-dirs.el
@@ -168,6 +168,9 @@ Thus, this does not include the current directory.")
168(defvar eshell-last-dir-ring nil 168(defvar eshell-last-dir-ring nil
169 "The last directory that Eshell was in.") 169 "The last directory that Eshell was in.")
170 170
171(defconst eshell-inside-emacs (format "%s,eshell" emacs-version)
172 "Value for the `INSIDE_EMACS' environment variable.")
173
171;;; Functions: 174;;; Functions:
172 175
173(defun eshell-dirs-initialize () ;Called from `eshell-mode' via intern-soft! 176(defun eshell-dirs-initialize () ;Called from `eshell-mode' via intern-soft!
@@ -191,6 +194,8 @@ Thus, this does not include the current directory.")
191 (unless (ring-empty-p eshell-last-dir-ring) 194 (unless (ring-empty-p eshell-last-dir-ring)
192 (expand-file-name 195 (expand-file-name
193 (ring-ref eshell-last-dir-ring 0)))) 196 (ring-ref eshell-last-dir-ring 0))))
197 t)
198 ("INSIDE_EMACS" eshell-inside-emacs
194 t)))) 199 t))))
195 200
196 (when eshell-cd-on-directory 201 (when eshell-cd-on-directory
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index 327a1def469..3093abd8304 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -179,10 +179,9 @@ if they are quoted with a backslash."
179 (eshell-apply-indices eshell-command-arguments 179 (eshell-apply-indices eshell-command-arguments
180 indices))))) 180 indices)))))
181 "This list provides aliasing for variable references. 181 "This list provides aliasing for variable references.
182It is very similar in concept to what `eshell-user-aliases-list' does 182Each member defines the name of a variable, and a Lisp value used to
183for commands. Each member of this defines the name of a command, 183compute the string value that will be returned when the variable is
184and the Lisp value to return for that variable if it is accessed 184accessed via the syntax `$NAME'.
185via the syntax `$NAME'.
186 185
187If the value is a function, that function will be called with two 186If the value is a function, that function will be called with two
188arguments: the list of the indices that was used in the reference, and 187arguments: the list of the indices that was used in the reference, and
@@ -190,7 +189,21 @@ whether the user is requesting the length of the ultimate element.
190For example, a reference of `$NAME[10][20]' would result in the 189For example, a reference of `$NAME[10][20]' would result in the
191function for alias `NAME' being called (assuming it were aliased to a 190function for alias `NAME' being called (assuming it were aliased to a
192function), and the arguments passed to this function would be the list 191function), and the arguments passed to this function would be the list
193'(10 20)', and nil." 192'(10 20)', and nil.
193
194If the value is a string, the value for the variable with that name in
195the current environment will be returned. If no variable with that
196name exists in the environment, but if a symbol with that same name
197exists and has a value bound to it, then that value will be used. You
198can prioritize symbol values over environment values by setting
199`eshell-prefer-lisp-variables' to t.
200
201If the value is a symbol, the value bound to that symbol will be used.
202
203If the value has any other type, `error' will be signaled.
204
205Additionally, each member may specify if it should be copied to the
206environment of created subprocesses."
194 :type '(repeat (list string sexp 207 :type '(repeat (list string sexp
195 (choice (const :tag "Copy to environment" t) 208 (choice (const :tag "Copy to environment" t)
196 (const :tag "Use only in Eshell" nil))))) 209 (const :tag "Use only in Eshell" nil)))))
diff --git a/lisp/fileloop.el b/lisp/fileloop.el
index 543963feafe..8f4911638e9 100644
--- a/lisp/fileloop.el
+++ b/lisp/fileloop.el
@@ -200,18 +200,22 @@ the default setting of `case-fold-search'.
200DELIMITED if non-nil means replace only word-delimited matches." 200DELIMITED if non-nil means replace only word-delimited matches."
201 ;; FIXME: Not sure how the delimited-flag interacts with the regexp-flag in 201 ;; FIXME: Not sure how the delimited-flag interacts with the regexp-flag in
202 ;; `perform-replace', so I just try to mimic the old code. 202 ;; `perform-replace', so I just try to mimic the old code.
203 (fileloop-initialize 203 (let ((mstart (make-hash-table :test 'eq)))
204 files 204 (fileloop-initialize
205 (lambda () 205 files
206 (let ((case-fold-search 206 (lambda ()
207 (if (memql case-fold '(nil t)) case-fold case-fold-search))) 207 (let ((case-fold-search
208 (if (re-search-forward from nil t) 208 (if (memql case-fold '(nil t)) case-fold case-fold-search)))
209 ;; When we find a match, move back 209 (when (re-search-forward from nil t)
210 ;; to the beginning of it so perform-replace 210 ;; When we find a match, save its beginning for
211 ;; will see it. 211 ;; `perform-replace' (we used to just set point, but this
212 (goto-char (match-beginning 0))))) 212 ;; is unreliable in the face of
213 (lambda () 213 ;; `switch-to-buffer-preserve-window-point').
214 (perform-replace from to t t delimited nil multi-query-replace-map)))) 214 (puthash (current-buffer) (match-beginning 0) mstart))))
215 (lambda ()
216 (perform-replace from to t t delimited nil multi-query-replace-map
217 (gethash (current-buffer) mstart (point-min))
218 (point-max))))))
215 219
216(provide 'fileloop) 220(provide 'fileloop)
217;;; fileloop.el ends here 221;;; fileloop.el ends here
diff --git a/lisp/files.el b/lisp/files.el
index 8ce0187f5b7..55a0958f540 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -819,23 +819,25 @@ The path separator is colon in GNU and GNU-like systems."
819(defun directory-files-recursively (dir regexp 819(defun directory-files-recursively (dir regexp
820 &optional include-directories predicate 820 &optional include-directories predicate
821 follow-symlinks) 821 follow-symlinks)
822 "Return list of all files under DIR that have file names matching REGEXP. 822 "Return list of all files under directory DIR whose names match REGEXP.
823This function works recursively. Files are returned in \"depth 823This function works recursively. Files are returned in \"depth
824first\" order, and files from each directory are sorted in 824first\" order, and files from each directory are sorted in
825alphabetical order. Each file name appears in the returned list 825alphabetical order. Each file name appears in the returned list
826in its absolute form. 826in its absolute form.
827 827
828Optional argument INCLUDE-DIRECTORIES non-nil means also include 828By default, the returned list excludes directories, but if
829in the output directories whose names match REGEXP. 829optional argument INCLUDE-DIRECTORIES is non-nil, they are
830included.
830 831
831PREDICATE can be either nil (which means that all subdirectories 832PREDICATE can be either nil (which means that all subdirectories
832are descended into), t (which means that subdirectories that 833of DIR are descended into), t (which means that subdirectories that
833can't be read are ignored), or a function (which is called with 834can't be read are ignored), or a function (which is called with
834the name of the subdirectory and should return non-nil if the 835the name of each subdirectory, and should return non-nil if the
835subdirectory is to be descended into). 836subdirectory is to be descended into).
836 837
837If FOLLOW-SYMLINKS, symbolic links that point to directories are 838If FOLLOW-SYMLINKS is non-nil, symbolic links that point to
838followed. Note that this can lead to infinite recursion." 839directories are followed. Note that this can lead to infinite
840recursion."
839 (let* ((result nil) 841 (let* ((result nil)
840 (files nil) 842 (files nil)
841 (dir (directory-file-name dir)) 843 (dir (directory-file-name dir))
@@ -7253,10 +7255,15 @@ if any returns nil. If `confirm-kill-emacs' is non-nil, calls it."
7253 (setq active t)) 7255 (setq active t))
7254 (setq processes (cdr processes))) 7256 (setq processes (cdr processes)))
7255 (or (not active) 7257 (or (not active)
7256 (with-displayed-buffer-window 7258 (with-current-buffer-window
7257 (get-buffer-create "*Process List*") 7259 (get-buffer-create "*Process List*")
7258 '(display-buffer--maybe-at-bottom 7260 `(display-buffer--maybe-at-bottom
7259 (dedicated . t)) 7261 (dedicated . t)
7262 (window-height . fit-window-to-buffer)
7263 (preserve-size . (nil . t))
7264 (body-function
7265 . ,#'(lambda (_window)
7266 (list-processes t))))
7260 #'(lambda (window _value) 7267 #'(lambda (window _value)
7261 (with-selected-window window 7268 (with-selected-window window
7262 (unwind-protect 7269 (unwind-protect
@@ -7264,8 +7271,7 @@ if any returns nil. If `confirm-kill-emacs' is non-nil, calls it."
7264 (setq confirm nil) 7271 (setq confirm nil)
7265 (yes-or-no-p "Active processes exist; kill them and exit anyway? ")) 7272 (yes-or-no-p "Active processes exist; kill them and exit anyway? "))
7266 (when (window-live-p window) 7273 (when (window-live-p window)
7267 (quit-restore-window window 'kill))))) 7274 (quit-restore-window window 'kill)))))))))
7268 (list-processes t)))))
7269 ;; Query the user for other things, perhaps. 7275 ;; Query the user for other things, perhaps.
7270 (run-hook-with-args-until-failure 'kill-emacs-query-functions) 7276 (run-hook-with-args-until-failure 'kill-emacs-query-functions)
7271 (or (null confirm) 7277 (or (null confirm)
diff --git a/lisp/image/image-converter.el b/lisp/image/image-converter.el
index ae3d9598920..b694052f5b9 100644
--- a/lisp/image/image-converter.el
+++ b/lisp/image/image-converter.el
@@ -57,6 +57,10 @@ is a string, it should be a MIME format string like
57 ;; Find an installed image converter. 57 ;; Find an installed image converter.
58 (unless image-converter 58 (unless image-converter
59 (image-converter--find-converter)) 59 (image-converter--find-converter))
60 ;; When image-converter was customized
61 (if (and image-converter (not image-converter-regexp))
62 (when-let ((formats (image-converter--probe image-converter)))
63 (setq image-converter-regexp (concat "\\." (regexp-opt formats) "\\'"))))
60 (and image-converter 64 (and image-converter
61 (or (and (not data-p) 65 (or (and (not data-p)
62 (string-match image-converter-regexp source)) 66 (string-match image-converter-regexp source))
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index 8776e9ba703..10dc78d6288 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -4480,7 +4480,6 @@ Returns non-nil if any false statements are found.
4480;;;### (autoloads nil "checkdoc" "emacs-lisp/checkdoc.el" (0 0 0 4480;;;### (autoloads nil "checkdoc" "emacs-lisp/checkdoc.el" (0 0 0
4481;;;;;; 0)) 4481;;;;;; 0))
4482;;; Generated autoloads from emacs-lisp/checkdoc.el 4482;;; Generated autoloads from emacs-lisp/checkdoc.el
4483(push (purecopy '(checkdoc 0 6 2)) package--builtin-versions)
4484(put 'checkdoc-force-docstrings-flag 'safe-local-variable #'booleanp) 4483(put 'checkdoc-force-docstrings-flag 'safe-local-variable #'booleanp)
4485(put 'checkdoc-force-history-flag 'safe-local-variable #'booleanp) 4484(put 'checkdoc-force-history-flag 'safe-local-variable #'booleanp)
4486(put 'checkdoc-permit-comma-termination-flag 'safe-local-variable #'booleanp) 4485(put 'checkdoc-permit-comma-termination-flag 'safe-local-variable #'booleanp)
@@ -5492,7 +5491,9 @@ doesn't have enough contents to decide, this is identical to
5492See also `conf-space-mode', `conf-colon-mode', `conf-javaprop-mode', 5491See also `conf-space-mode', `conf-colon-mode', `conf-javaprop-mode',
5493`conf-ppd-mode' and `conf-xdefaults-mode'. 5492`conf-ppd-mode' and `conf-xdefaults-mode'.
5494 5493
5495\\{conf-mode-map}" t nil) 5494\\{conf-mode-map}
5495
5496\(fn)" t nil)
5496 5497
5497(autoload 'conf-unix-mode "conf-mode" "\ 5498(autoload 'conf-unix-mode "conf-mode" "\
5498Conf Mode starter for Unix style Conf files. 5499Conf Mode starter for Unix style Conf files.
@@ -6469,7 +6470,6 @@ Mode used for cvs status output.
6469 6470
6470;;;### (autoloads nil "cwarn" "progmodes/cwarn.el" (0 0 0 0)) 6471;;;### (autoloads nil "cwarn" "progmodes/cwarn.el" (0 0 0 0))
6471;;; Generated autoloads from progmodes/cwarn.el 6472;;; Generated autoloads from progmodes/cwarn.el
6472(push (purecopy '(cwarn 1 3 1)) package--builtin-versions)
6473 6473
6474(autoload 'cwarn-mode "cwarn" "\ 6474(autoload 'cwarn-mode "cwarn" "\
6475Minor mode that highlights suspicious C and C++ constructions. 6475Minor mode that highlights suspicious C and C++ constructions.
@@ -14250,6 +14250,10 @@ DELAY is a string, giving the length of the time. Possible values are:
14250* hh:mm for a specific time. Use 24h format. If it is later than this 14250* hh:mm for a specific time. Use 24h format. If it is later than this
14251 time, then the deadline is tomorrow, else today. 14251 time, then the deadline is tomorrow, else today.
14252 14252
14253The value of `message-draft-headers' determines which headers are
14254generated when the article is delayed. Remaining headers are
14255generated when the article is sent.
14256
14253\(fn DELAY)" t nil) 14257\(fn DELAY)" t nil)
14254 14258
14255(autoload 'gnus-delay-send-queue "gnus-delay" "\ 14259(autoload 'gnus-delay-send-queue "gnus-delay" "\
@@ -15727,6 +15731,21 @@ keymap value.
15727 15731
15728\(fn KEYMAP)" t nil) 15732\(fn KEYMAP)" t nil)
15729 15733
15734(autoload 'describe-mode "help-fns" "\
15735Display documentation of current major mode and minor modes.
15736A brief summary of the minor modes comes first, followed by the
15737major mode description. This is followed by detailed
15738descriptions of the minor modes, each on a separate page.
15739
15740For this to work correctly for a minor mode, the mode's indicator
15741variable (listed in `minor-mode-alist') must also be a function
15742whose documentation describes the minor mode.
15743
15744If called from Lisp with a non-nil BUFFER argument, display
15745documentation for the major and minor modes of that buffer.
15746
15747\(fn &optional BUFFER)" t nil)
15748
15730(autoload 'doc-file-to-man "help-fns" "\ 15749(autoload 'doc-file-to-man "help-fns" "\
15731Produce an nroff buffer containing the doc-strings from the DOC file. 15750Produce an nroff buffer containing the doc-strings from the DOC file.
15732 15751
@@ -16403,7 +16422,6 @@ See `highlight-changes-mode' for more information on Highlight-Changes mode.
16403 16422
16404;;;### (autoloads nil "hippie-exp" "hippie-exp.el" (0 0 0 0)) 16423;;;### (autoloads nil "hippie-exp" "hippie-exp.el" (0 0 0 0))
16405;;; Generated autoloads from hippie-exp.el 16424;;; Generated autoloads from hippie-exp.el
16406(push (purecopy '(hippie-exp 1 6)) package--builtin-versions)
16407 16425
16408(defvar hippie-expand-try-functions-list '(try-complete-file-name-partially try-complete-file-name try-expand-all-abbrevs try-expand-list try-expand-line try-expand-dabbrev try-expand-dabbrev-all-buffers try-expand-dabbrev-from-kill try-complete-lisp-symbol-partially try-complete-lisp-symbol) "\ 16426(defvar hippie-expand-try-functions-list '(try-complete-file-name-partially try-complete-file-name try-expand-all-abbrevs try-expand-list try-expand-line try-expand-dabbrev try-expand-dabbrev-all-buffers try-expand-dabbrev-from-kill try-complete-lisp-symbol-partially try-complete-lisp-symbol) "\
16409The list of expansion functions tried in order by `hippie-expand'. 16427The list of expansion functions tried in order by `hippie-expand'.
@@ -16825,7 +16843,6 @@ If optional arg OTHER-WINDOW is non-nil, then use another window.
16825;;;### (autoloads nil "icalendar" "calendar/icalendar.el" (0 0 0 16843;;;### (autoloads nil "icalendar" "calendar/icalendar.el" (0 0 0
16826;;;;;; 0)) 16844;;;;;; 0))
16827;;; Generated autoloads from calendar/icalendar.el 16845;;; Generated autoloads from calendar/icalendar.el
16828(push (purecopy '(icalendar 0 19)) package--builtin-versions)
16829 16846
16830(autoload 'icalendar-export-file "icalendar" "\ 16847(autoload 'icalendar-export-file "icalendar" "\
16831Export diary file to iCalendar format. 16848Export diary file to iCalendar format.
@@ -19518,7 +19535,6 @@ generations (this defaults to 1).
19518 19535
19519;;;### (autoloads nil "linum" "linum.el" (0 0 0 0)) 19536;;;### (autoloads nil "linum" "linum.el" (0 0 0 0))
19520;;; Generated autoloads from linum.el 19537;;; Generated autoloads from linum.el
19521(push (purecopy '(linum 0 9 24)) package--builtin-versions)
19522 19538
19523(autoload 'linum-mode "linum" "\ 19539(autoload 'linum-mode "linum" "\
19524Toggle display of line numbers in the left margin (Linum mode). 19540Toggle display of line numbers in the left margin (Linum mode).
@@ -20424,7 +20440,6 @@ Default bookmark handler for Man buffers.
20424 20440
20425;;;### (autoloads nil "master" "master.el" (0 0 0 0)) 20441;;;### (autoloads nil "master" "master.el" (0 0 0 0))
20426;;; Generated autoloads from master.el 20442;;; Generated autoloads from master.el
20427(push (purecopy '(master 1 0 2)) package--builtin-versions)
20428 20443
20429(autoload 'master-mode "master" "\ 20444(autoload 'master-mode "master" "\
20430Toggle Master mode. 20445Toggle Master mode.
@@ -24582,7 +24597,7 @@ Mark the installed package as selected by adding it to
24582 24597
24583When called from Lisp and optional argument DONT-SELECT is 24598When called from Lisp and optional argument DONT-SELECT is
24584non-nil, install the package but do not add it to 24599non-nil, install the package but do not add it to
24585`package-select-packages'. 24600`package-selected-packages'.
24586 24601
24587If PKG is a `package-desc' and it is already installed, don't try 24602If PKG is a `package-desc' and it is already installed, don't try
24588to install it but still mark it as selected. 24603to install it but still mark it as selected.
@@ -26151,14 +26166,16 @@ recognized." t nil)
26151(autoload 'project-search "project" "\ 26166(autoload 'project-search "project" "\
26152Search for REGEXP in all the files of the project. 26167Search for REGEXP in all the files of the project.
26153Stops when a match is found. 26168Stops when a match is found.
26154To continue searching for next match, use command \\[fileloop-continue]. 26169To continue searching for the next match, use the
26170command \\[fileloop-continue].
26155 26171
26156\(fn REGEXP)" t nil) 26172\(fn REGEXP)" t nil)
26157 26173
26158(autoload 'project-query-replace-regexp "project" "\ 26174(autoload 'project-query-replace-regexp "project" "\
26159Search for REGEXP in all the files of the project. 26175Query-replace REGEXP in all the files of the project.
26160Stops when a match is found. 26176Stops when a match is found and prompts for whether to replace it.
26161To continue searching for next match, use command \\[fileloop-continue]. 26177If you exit the query-replace, you can later continue the query-replace
26178loop using the command \\[fileloop-continue].
26162 26179
26163\(fn FROM TO)" t nil) 26180\(fn FROM TO)" t nil)
26164 26181
@@ -27476,7 +27493,6 @@ This means the number of non-shy regexp grouping constructs
27476 27493
27477;;;### (autoloads nil "remember" "textmodes/remember.el" (0 0 0 0)) 27494;;;### (autoloads nil "remember" "textmodes/remember.el" (0 0 0 0))
27478;;; Generated autoloads from textmodes/remember.el 27495;;; Generated autoloads from textmodes/remember.el
27479(push (purecopy '(remember 2 0)) package--builtin-versions)
27480 27496
27481(autoload 'remember "remember" "\ 27497(autoload 'remember "remember" "\
27482Remember an arbitrary piece of data. 27498Remember an arbitrary piece of data.
@@ -27528,7 +27544,6 @@ to turn the *scratch* buffer into your notes buffer.
27528 27544
27529;;;### (autoloads nil "repeat" "repeat.el" (0 0 0 0)) 27545;;;### (autoloads nil "repeat" "repeat.el" (0 0 0 0))
27530;;; Generated autoloads from repeat.el 27546;;; Generated autoloads from repeat.el
27531(push (purecopy '(repeat 0 51)) package--builtin-versions)
27532 27547
27533(autoload 'repeat "repeat" "\ 27548(autoload 'repeat "repeat" "\
27534Repeat most recently executed command. 27549Repeat most recently executed command.
@@ -28403,7 +28418,6 @@ Major mode for editing Ruby code.
28403 28418
28404;;;### (autoloads nil "ruler-mode" "ruler-mode.el" (0 0 0 0)) 28419;;;### (autoloads nil "ruler-mode" "ruler-mode.el" (0 0 0 0))
28405;;; Generated autoloads from ruler-mode.el 28420;;; Generated autoloads from ruler-mode.el
28406(push (purecopy '(ruler-mode 1 6)) package--builtin-versions)
28407 28421
28408(defvar ruler-mode nil "\ 28422(defvar ruler-mode nil "\
28409Non-nil if Ruler mode is enabled. 28423Non-nil if Ruler mode is enabled.
@@ -30585,7 +30599,9 @@ enable the mode if ARG is omitted or nil, and toggle it if ARG is
30585 30599
30586(autoload 'smerge-start-session "smerge-mode" "\ 30600(autoload 'smerge-start-session "smerge-mode" "\
30587Turn on `smerge-mode' and move point to first conflict marker. 30601Turn on `smerge-mode' and move point to first conflict marker.
30588If no conflict maker is found, turn off `smerge-mode'." t nil) 30602If no conflict maker is found, turn off `smerge-mode'.
30603
30604\(fn &optional INTERACTIVELY)" t nil)
30589 30605
30590(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "smerge-mode" '("smerge-"))) 30606(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "smerge-mode" '("smerge-")))
30591 30607
@@ -32669,16 +32685,17 @@ WHERE is provided the cell and table at that location is reported.
32669(autoload 'table-generate-source "table" "\ 32685(autoload 'table-generate-source "table" "\
32670Generate source of the current table in the specified language. 32686Generate source of the current table in the specified language.
32671LANGUAGE is a symbol that specifies the language to describe the 32687LANGUAGE is a symbol that specifies the language to describe the
32672structure of the table. It must be either `html', `latex' or `cals'. 32688structure of the table. It must be either `html', `latex', `cals',
32673The resulted source text is inserted into DEST-BUFFER and the buffer 32689`wiki', or `mediawiki'.
32674object is returned. When DEST-BUFFER is omitted or nil the default 32690The function inserts the resulting source text into DEST-BUFFER, and
32675buffer specified in `table-dest-buffer-name' is used. In this case 32691returns the buffer object. When DEST-BUFFER is omitted or nil, the
32676the content of the default buffer is erased prior to the generation. 32692function uses the default buffer specified in `table-dest-buffer-name'.
32677When DEST-BUFFER is non-nil it is expected to be either a destination 32693In this case, the function erases the default buffer prior to the
32678buffer or a name of the destination buffer. In this case the 32694source generation.
32679generated result is inserted at the current point in the destination 32695When DEST-BUFFER is non-nil, it should be either a destination
32680buffer and the previously existing contents in the buffer are 32696buffer or a name of the destination buffer. In that case, the
32681untouched. 32697function inserts the generated result at point in the destination
32698buffer, and leaves the previous contents of the buffer untouched.
32682 32699
32683References used for this implementation: 32700References used for this implementation:
32684 32701
@@ -33239,7 +33256,7 @@ Should show the queue(s) that \\[tex-print] puts jobs on.")
33239 33256
33240(custom-autoload 'tex-show-queue-command "tex-mode" t) 33257(custom-autoload 'tex-show-queue-command "tex-mode" t)
33241 33258
33242(defvar tex-default-mode 'latex-mode "\ 33259(defvar tex-default-mode #'latex-mode "\
33243Mode to enter for a new file that might be either TeX or LaTeX. 33260Mode to enter for a new file that might be either TeX or LaTeX.
33244This variable is used when it can't be determined whether the file 33261This variable is used when it can't be determined whether the file
33245is plain TeX or LaTeX or what because the file contains no commands. 33262is plain TeX or LaTeX or what because the file contains no commands.
@@ -33259,11 +33276,14 @@ String inserted by typing \\[tex-insert-quote] to close a quotation.")
33259 33276
33260(autoload 'tex-mode "tex-mode" "\ 33277(autoload 'tex-mode "tex-mode" "\
33261Major mode for editing files of input for TeX, LaTeX, or SliTeX. 33278Major mode for editing files of input for TeX, LaTeX, or SliTeX.
33279This is the shared parent mode of several submodes.
33262Tries to determine (by looking at the beginning of the file) whether 33280Tries to determine (by looking at the beginning of the file) whether
33263this file is for plain TeX, LaTeX, or SliTeX and calls `plain-tex-mode', 33281this file is for plain TeX, LaTeX, or SliTeX and calls `plain-tex-mode',
33264`latex-mode', or `slitex-mode', respectively. If it cannot be determined, 33282`latex-mode', or `slitex-mode', accordingly. If it cannot be determined,
33265such as if there are no commands in the file, the value of `tex-default-mode' 33283such as if there are no commands in the file, the value of `tex-default-mode'
33266says which mode to use." t nil) 33284says which mode to use.
33285
33286\(fn)" t nil)
33267 33287
33268(defalias 'TeX-mode 'tex-mode) 33288(defalias 'TeX-mode 'tex-mode)
33269 33289
@@ -36093,7 +36113,7 @@ with its diffs (if the underlying VCS supports that).
36093\(fn &optional LIMIT REVISION)" t nil) 36113\(fn &optional LIMIT REVISION)" t nil)
36094 36114
36095(autoload 'vc-print-branch-log "vc" "\ 36115(autoload 'vc-print-branch-log "vc" "\
36096Show the change log for BRANCH in a window. 36116Show the change log for BRANCH root in a window.
36097 36117
36098\(fn BRANCH)" t nil) 36118\(fn BRANCH)" t nil)
36099 36119
@@ -36317,6 +36337,11 @@ Name of the format file in a .bzr directory.")
36317;;;### (autoloads nil "vc-dir" "vc/vc-dir.el" (0 0 0 0)) 36337;;;### (autoloads nil "vc-dir" "vc/vc-dir.el" (0 0 0 0))
36318;;; Generated autoloads from vc/vc-dir.el 36338;;; Generated autoloads from vc/vc-dir.el
36319 36339
36340(autoload 'vc-dir-root "vc-dir" "\
36341Run `vc-dir' in the repository root directory without prompt.
36342If the default directory of the current buffer is
36343not under version control, prompt for a directory." t nil)
36344
36320(autoload 'vc-dir "vc-dir" "\ 36345(autoload 'vc-dir "vc-dir" "\
36321Show the VC status for \"interesting\" files in and below DIR. 36346Show the VC status for \"interesting\" files in and below DIR.
36322This allows you to mark files and perform VC operations on them. 36347This allows you to mark files and perform VC operations on them.
@@ -37745,7 +37770,6 @@ this is equivalent to `display-warning', using
37745 37770
37746;;;### (autoloads nil "wdired" "wdired.el" (0 0 0 0)) 37771;;;### (autoloads nil "wdired" "wdired.el" (0 0 0 0))
37747;;; Generated autoloads from wdired.el 37772;;; Generated autoloads from wdired.el
37748(push (purecopy '(wdired 2 0)) package--builtin-versions)
37749 37773
37750(autoload 'wdired-change-to-wdired-mode "wdired" "\ 37774(autoload 'wdired-change-to-wdired-mode "wdired" "\
37751Put a Dired buffer in Writable Dired (WDired) mode. 37775Put a Dired buffer in Writable Dired (WDired) mode.
@@ -38344,6 +38368,11 @@ Display the next buffer in the same window.
38344 38368
38345\(fn &optional ARG)" t nil) 38369\(fn &optional ARG)" t nil)
38346 38370
38371(autoload 'windmove-display-new-frame "windmove" "\
38372Display the next buffer in a new frame.
38373
38374\(fn &optional ARG)" t nil)
38375
38347(autoload 'windmove-display-new-tab "windmove" "\ 38376(autoload 'windmove-display-new-tab "windmove" "\
38348Display the next buffer in a new tab. 38377Display the next buffer in a new tab.
38349 38378
@@ -38456,7 +38485,6 @@ you can press `C-c <right>' (calling `winner-redo').
38456 38485
38457;;;### (autoloads nil "woman" "woman.el" (0 0 0 0)) 38486;;;### (autoloads nil "woman" "woman.el" (0 0 0 0))
38458;;; Generated autoloads from woman.el 38487;;; Generated autoloads from woman.el
38459(push (purecopy '(woman 0 551)) package--builtin-versions)
38460 38488
38461(defvar woman-locale nil "\ 38489(defvar woman-locale nil "\
38462String specifying a manual page locale, or nil. 38490String specifying a manual page locale, or nil.
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 7f5b597542a..3c8202c7eb9 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1968,12 +1968,13 @@ variables.")
1968 (plist-get completion-extra-properties 1968 (plist-get completion-extra-properties
1969 :annotation-function) 1969 :annotation-function)
1970 completion-annotate-function)) 1970 completion-annotate-function))
1971 (mainbuf (current-buffer))
1971 ;; If the *Completions* buffer is shown in a new 1972 ;; If the *Completions* buffer is shown in a new
1972 ;; window, mark it as softly-dedicated, so bury-buffer in 1973 ;; window, mark it as softly-dedicated, so bury-buffer in
1973 ;; minibuffer-hide-completions will know whether to 1974 ;; minibuffer-hide-completions will know whether to
1974 ;; delete the window or not. 1975 ;; delete the window or not.
1975 (display-buffer-mark-dedicated 'soft)) 1976 (display-buffer-mark-dedicated 'soft))
1976 (with-displayed-buffer-window 1977 (with-current-buffer-window
1977 "*Completions*" 1978 "*Completions*"
1978 ;; This is a copy of `display-buffer-fallback-action' 1979 ;; This is a copy of `display-buffer-fallback-action'
1979 ;; where `display-buffer-use-some-window' is replaced 1980 ;; where `display-buffer-use-some-window' is replaced
@@ -1987,66 +1988,69 @@ variables.")
1987 ,(if (eq (selected-window) (minibuffer-window)) 1988 ,(if (eq (selected-window) (minibuffer-window))
1988 'display-buffer-at-bottom 1989 'display-buffer-at-bottom
1989 'display-buffer-below-selected)) 1990 'display-buffer-below-selected))
1990 ,(if temp-buffer-resize-mode 1991 ,(if temp-buffer-resize-mode
1991 '(window-height . resize-temp-buffer-window) 1992 '(window-height . resize-temp-buffer-window)
1992 '(window-height . fit-window-to-buffer)) 1993 '(window-height . fit-window-to-buffer))
1993 ,(when temp-buffer-resize-mode 1994 ,(when temp-buffer-resize-mode
1994 '(preserve-size . (nil . t)))) 1995 '(preserve-size . (nil . t)))
1995 nil 1996 (body-function
1996 ;; Remove the base-size tail because `sort' requires a properly 1997 . ,#'(lambda (_window)
1997 ;; nil-terminated list. 1998 (with-current-buffer mainbuf
1998 (when last (setcdr last nil)) 1999 ;; Remove the base-size tail because `sort' requires a properly
1999 (setq completions 2000 ;; nil-terminated list.
2000 ;; FIXME: This function is for the output of all-completions, 2001 (when last (setcdr last nil))
2001 ;; not completion-all-completions. Often it's the same, but 2002 (setq completions
2002 ;; not always. 2003 ;; FIXME: This function is for the output of all-completions,
2003 (let ((sort-fun (completion-metadata-get 2004 ;; not completion-all-completions. Often it's the same, but
2004 all-md 'display-sort-function))) 2005 ;; not always.
2005 (if sort-fun 2006 (let ((sort-fun (completion-metadata-get
2006 (funcall sort-fun completions) 2007 all-md 'display-sort-function)))
2007 (sort completions 'string-lessp)))) 2008 (if sort-fun
2008 (when afun 2009 (funcall sort-fun completions)
2009 (setq completions 2010 (sort completions 'string-lessp))))
2010 (mapcar (lambda (s) 2011 (when afun
2011 (let ((ann (funcall afun s))) 2012 (setq completions
2012 (if ann (list s ann) s))) 2013 (mapcar (lambda (s)
2013 completions))) 2014 (let ((ann (funcall afun s)))
2014 2015 (if ann (list s ann) s)))
2015 (with-current-buffer standard-output 2016 completions)))
2016 (set (make-local-variable 'completion-base-position) 2017
2017 (list (+ start base-size) 2018 (with-current-buffer standard-output
2018 ;; FIXME: We should pay attention to completion 2019 (set (make-local-variable 'completion-base-position)
2019 ;; boundaries here, but currently 2020 (list (+ start base-size)
2020 ;; completion-all-completions does not give us the 2021 ;; FIXME: We should pay attention to completion
2021 ;; necessary information. 2022 ;; boundaries here, but currently
2022 end)) 2023 ;; completion-all-completions does not give us the
2023 (set (make-local-variable 'completion-list-insert-choice-function) 2024 ;; necessary information.
2024 (let ((ctable minibuffer-completion-table) 2025 end))
2025 (cpred minibuffer-completion-predicate) 2026 (set (make-local-variable 'completion-list-insert-choice-function)
2026 (cprops completion-extra-properties)) 2027 (let ((ctable minibuffer-completion-table)
2027 (lambda (start end choice) 2028 (cpred minibuffer-completion-predicate)
2028 (unless (or (zerop (length prefix)) 2029 (cprops completion-extra-properties))
2029 (equal prefix 2030 (lambda (start end choice)
2030 (buffer-substring-no-properties 2031 (unless (or (zerop (length prefix))
2031 (max (point-min) 2032 (equal prefix
2032 (- start (length prefix))) 2033 (buffer-substring-no-properties
2033 start))) 2034 (max (point-min)
2034 (message "*Completions* out of date")) 2035 (- start (length prefix)))
2035 ;; FIXME: Use `md' to do quoting&terminator here. 2036 start)))
2036 (completion--replace start end choice) 2037 (message "*Completions* out of date"))
2037 (let* ((minibuffer-completion-table ctable) 2038 ;; FIXME: Use `md' to do quoting&terminator here.
2038 (minibuffer-completion-predicate cpred) 2039 (completion--replace start end choice)
2039 (completion-extra-properties cprops) 2040 (let* ((minibuffer-completion-table ctable)
2040 (result (concat prefix choice)) 2041 (minibuffer-completion-predicate cpred)
2041 (bounds (completion-boundaries 2042 (completion-extra-properties cprops)
2042 result ctable cpred ""))) 2043 (result (concat prefix choice))
2043 ;; If the completion introduces a new field, then 2044 (bounds (completion-boundaries
2044 ;; completion is not finished. 2045 result ctable cpred "")))
2045 (completion--done result 2046 ;; If the completion introduces a new field, then
2046 (if (eq (car bounds) (length result)) 2047 ;; completion is not finished.
2047 'exact 'finished))))))) 2048 (completion--done result
2048 2049 (if (eq (car bounds) (length result))
2049 (display-completion-list completions)))) 2050 'exact 'finished)))))))
2051
2052 (display-completion-list completions)))))
2053 nil)))
2050 nil)) 2054 nil))
2051 2055
2052(defun minibuffer-hide-completions () 2056(defun minibuffer-hide-completions ()
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index 0a92e0d3202..8d21133b3b1 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -48,6 +48,7 @@
48 ;; Suppress message from `emacs-repository-get-branch'. We must 48 ;; Suppress message from `emacs-repository-get-branch'. We must
49 ;; also handle out-of-tree builds. 49 ;; also handle out-of-tree builds.
50 (let ((inhibit-message t) 50 (let ((inhibit-message t)
51 (debug-on-error nil)
51 (dir (or (locate-dominating-file (locate-library "tramp") ".git") 52 (dir (or (locate-dominating-file (locate-library "tramp") ".git")
52 source-directory))) 53 source-directory)))
53 ;; `emacs-repository-get-branch' has been introduced with Emacs 27.1. 54 ;; `emacs-repository-get-branch' has been introduced with Emacs 27.1.
@@ -61,6 +62,7 @@
61 ;; Suppress message from `emacs-repository-get-version'. We must 62 ;; Suppress message from `emacs-repository-get-version'. We must
62 ;; also handle out-of-tree builds. 63 ;; also handle out-of-tree builds.
63 (let ((inhibit-message t) 64 (let ((inhibit-message t)
65 (debug-on-error nil)
64 (dir (or (locate-dominating-file (locate-library "tramp") ".git") 66 (dir (or (locate-dominating-file (locate-library "tramp") ".git")
65 source-directory))) 67 source-directory)))
66 (and (stringp dir) (file-directory-p dir) 68 (and (stringp dir) (file-directory-p dir)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index e5878b28f96..a76a3c44a35 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -265,6 +265,20 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
265 (java 265 (java
266 "^\\(?:[ \t]+at \\|==[0-9]+== +\\(?:at\\|b\\(y\\)\\)\\).+(\\([^()\n]+\\):\\([0-9]+\\))$" 2 3 nil (1)) 266 "^\\(?:[ \t]+at \\|==[0-9]+== +\\(?:at\\|b\\(y\\)\\)\\).+(\\([^()\n]+\\):\\([0-9]+\\))$" 2 3 nil (1))
267 267
268 (javac
269 ,(concat
270 ;; line1
271 "^\\(\\(?:[A-Za-z]:\\)?[^:\n]+\\):" ;file
272 "\\([0-9]+\\): " ;line
273 "\\(warning: \\)?.*\n" ;type (optional) and message
274 ;; line2: source line containing error
275 ".*\n"
276 ;; line3: single "^" under error position in line2
277 " *\\^$")
278 1 2
279 ,(lambda () (1- (current-column)))
280 (3))
281
268 (jikes-file 282 (jikes-file
269 "^\\(?:Found\\|Issued\\) .* compiling \"\\(.+\\)\":$" 1 nil nil 0) 283 "^\\(?:Found\\|Issued\\) .* compiling \"\\(.+\\)\":$" 1 nil nil 0)
270 284
@@ -1466,9 +1480,15 @@ to `compilation-error-regexp-alist' if RULES is nil."
1466 nil) ;; Not anchored or anchored but already allows empty spaces. 1480 nil) ;; Not anchored or anchored but already allows empty spaces.
1467 (t (setq pat (concat "^\\(?: \\)?" (substring pat 1))))) 1481 (t (setq pat (concat "^\\(?: \\)?" (substring pat 1)))))
1468 1482
1469 (if (consp file) (setq fmt (cdr file) file (car file))) 1483 (if (and (consp file) (not (functionp file)))
1470 (if (consp line) (setq end-line (cdr line) line (car line))) 1484 (setq fmt (cdr file)
1471 (if (consp col) (setq end-col (cdr col) col (car col))) 1485 file (car file)))
1486 (if (and (consp line) (not (functionp line)))
1487 (setq end-line (cdr line)
1488 line (car line)))
1489 (if (and (consp col) (not (functionp col)))
1490 (setq end-col (cdr col)
1491 col (car col)))
1472 1492
1473 (unless (or (null (nth 5 item)) (integerp (nth 5 item))) 1493 (unless (or (null (nth 5 item)) (integerp (nth 5 item)))
1474 (error "HYPERLINK should be an integer: %s" (nth 5 item))) 1494 (error "HYPERLINK should be an integer: %s" (nth 5 item)))
diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el
index 7ab9a2f1779..bee3a6b85e4 100644
--- a/lisp/url/url-cookie.el
+++ b/lisp/url/url-cookie.el
@@ -319,7 +319,7 @@ i.e. 1970-1-1) are loaded as expiring one year from now instead."
319 (pop untrusted))) 319 (pop untrusted)))
320 (and trusted untrusted 320 (and trusted untrusted
321 ;; Choose the more specific match. 321 ;; Choose the more specific match.
322 (set (if (> trusted untrusted) 'untrusted 'trusted) nil)) 322 (if (> trusted untrusted) (setq untrusted nil) (setq trusted nil)))
323 (cond 323 (cond
324 (untrusted 324 (untrusted
325 ;; The site was explicitly marked as untrusted by the user. 325 ;; The site was explicitly marked as untrusted by the user.
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index b760e170676..0c9e656add4 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -147,6 +147,12 @@ See `run-hooks'."
147 '(menu-item "Unmark Previous " vc-dir-unmark-file-up 147 '(menu-item "Unmark Previous " vc-dir-unmark-file-up
148 :help "Move to the previous line and unmark the file")) 148 :help "Move to the previous line and unmark the file"))
149 149
150 (define-key map [mark-unregistered]
151 '(menu-item "Mark Unregistered" vc-dir-mark-unregistered-files
152 :help "Mark all files in the unregistered state"))
153 (define-key map [mark-registered]
154 '(menu-item "Mark Registered" vc-dir-mark-registered-files
155 :help "Mark all files in the state edited, added or removed"))
150 (define-key map [mark-all] 156 (define-key map [mark-all]
151 '(menu-item "Mark All" vc-dir-mark-all-files 157 '(menu-item "Mark All" vc-dir-mark-all-files
152 :help "Mark all files that are in the same state as the current file\ 158 :help "Mark all files that are in the same state as the current file\
@@ -310,6 +316,10 @@ See `run-hooks'."
310 (define-key branch-map "l" 'vc-print-branch-log) 316 (define-key branch-map "l" 'vc-print-branch-log)
311 (define-key branch-map "s" 'vc-retrieve-tag)) 317 (define-key branch-map "s" 'vc-retrieve-tag))
312 318
319 (let ((mark-map (make-sparse-keymap)))
320 (define-key map "*" mark-map)
321 (define-key mark-map "r" 'vc-dir-mark-registered-files))
322
313 ;; Hook up the menu. 323 ;; Hook up the menu.
314 (define-key map [menu-bar vc-dir-mode] 324 (define-key map [menu-bar vc-dir-mode]
315 `(menu-item 325 `(menu-item
@@ -696,6 +706,38 @@ share the same state."
696 (vc-dir-mark-file crt))) 706 (vc-dir-mark-file crt)))
697 (setq crt (ewoc-next vc-ewoc crt)))))))) 707 (setq crt (ewoc-next vc-ewoc crt))))))))
698 708
709(defun vc-dir-mark-files (mark-files)
710 "Mark files specified by file names in the argument MARK-FILES.
711MARK-FILES should be a list of absolute filenames."
712 (ewoc-map
713 (lambda (filearg)
714 (when (member (expand-file-name (vc-dir-fileinfo->name filearg))
715 mark-files)
716 (setf (vc-dir-fileinfo->marked filearg) t)
717 t))
718 vc-ewoc))
719
720(defun vc-dir-mark-state-files (states)
721 "Mark files that are in the state specified by the list in STATES."
722 (unless (listp states)
723 (setq states (list states)))
724 (ewoc-map
725 (lambda (filearg)
726 (when (memq (vc-dir-fileinfo->state filearg) states)
727 (setf (vc-dir-fileinfo->marked filearg) t)
728 t))
729 vc-ewoc))
730
731(defun vc-dir-mark-registered-files ()
732 "Mark files that are in one of registered state: edited, added or removed."
733 (interactive)
734 (vc-dir-mark-state-files '(edited added removed)))
735
736(defun vc-dir-mark-unregistered-files ()
737 "Mark files that are in unregistered state."
738 (interactive)
739 (vc-dir-mark-state-files 'unregistered))
740
699(defun vc-dir-unmark-file () 741(defun vc-dir-unmark-file ()
700 ;; Unmark the current file and move to the next line. 742 ;; Unmark the current file and move to the next line.
701 (let* ((crt (ewoc-locate vc-ewoc)) 743 (let* ((crt (ewoc-locate vc-ewoc))
@@ -1193,7 +1235,8 @@ Throw an error if another update process is in progress."
1193 (if remaining 1235 (if remaining
1194 (vc-dir-refresh-files 1236 (vc-dir-refresh-files
1195 (mapcar 'vc-dir-fileinfo->name remaining)) 1237 (mapcar 'vc-dir-fileinfo->name remaining))
1196 (setq mode-line-process nil)))))))))))) 1238 (setq mode-line-process nil)
1239 (run-hooks 'vc-dir-refresh-hook))))))))))))
1197 1240
1198(defun vc-dir-show-fileentry (file) 1241(defun vc-dir-show-fileentry (file)
1199 "Insert an entry for a specific file into the current *VC-dir* listing. 1242 "Insert an entry for a specific file into the current *VC-dir* listing.
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 607fb37807c..d4323d59eb3 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1006,12 +1006,18 @@ Within directories, only files already under version control are noticed."
1006 1006
1007(declare-function vc-dir-current-file "vc-dir" ()) 1007(declare-function vc-dir-current-file "vc-dir" ())
1008(declare-function vc-dir-deduce-fileset "vc-dir" (&optional state-model-only-files)) 1008(declare-function vc-dir-deduce-fileset "vc-dir" (&optional state-model-only-files))
1009(declare-function dired-vc-deduce-fileset "dired-aux" (&optional state-model-only-files not-state-changing))
1009 1010
1010(defun vc-deduce-fileset (&optional observer allow-unregistered 1011(defun vc-deduce-fileset (&optional not-state-changing
1012 allow-unregistered
1011 state-model-only-files) 1013 state-model-only-files)
1012 "Deduce a set of files and a backend to which to apply an operation. 1014 "Deduce a set of files and a backend to which to apply an operation.
1013Return (BACKEND FILESET FILESET-ONLY-FILES STATE CHECKOUT-MODEL). 1015Return (BACKEND FILESET FILESET-ONLY-FILES STATE CHECKOUT-MODEL).
1014 1016
1017NOT-STATE-CHANGING if non-nil, means that the operation
1018requesting the fileset doesn't intend to change VC state,
1019such as printing the log or showing the diff.
1020
1015If we're in VC-dir mode, FILESET is the list of marked files, 1021If we're in VC-dir mode, FILESET is the list of marked files,
1016or the directory if no files are marked. 1022or the directory if no files are marked.
1017Otherwise, if in a buffer visiting a version-controlled file, 1023Otherwise, if in a buffer visiting a version-controlled file,
@@ -1025,14 +1031,12 @@ the FILESET-ONLY-FILES STATE and MODEL info. Otherwise, that
1025part may be skipped. 1031part may be skipped.
1026 1032
1027BEWARE: this function may change the current buffer." 1033BEWARE: this function may change the current buffer."
1028 ;; FIXME: OBSERVER is unused. The name is not intuitive and is not
1029 ;; documented. It's set to t when called from diff and print-log.
1030 (let (backend) 1034 (let (backend)
1031 (cond 1035 (cond
1032 ((derived-mode-p 'vc-dir-mode) 1036 ((derived-mode-p 'vc-dir-mode)
1033 (vc-dir-deduce-fileset state-model-only-files)) 1037 (vc-dir-deduce-fileset state-model-only-files))
1034 ((derived-mode-p 'dired-mode) 1038 ((derived-mode-p 'dired-mode)
1035 (vc-dired-deduce-fileset state-model-only-files observer)) 1039 (dired-vc-deduce-fileset state-model-only-files not-state-changing))
1036 ((setq backend (vc-backend buffer-file-name)) 1040 ((setq backend (vc-backend buffer-file-name))
1037 (if state-model-only-files 1041 (if state-model-only-files
1038 (list backend (list buffer-file-name) 1042 (list backend (list buffer-file-name)
@@ -1048,7 +1052,7 @@ BEWARE: this function may change the current buffer."
1048 (derived-mode-p 'dired-mode))))) 1052 (derived-mode-p 'dired-mode)))))
1049 (progn ;FIXME: Why not `with-current-buffer'? --Stef. 1053 (progn ;FIXME: Why not `with-current-buffer'? --Stef.
1050 (set-buffer vc-parent-buffer) 1054 (set-buffer vc-parent-buffer)
1051 (vc-deduce-fileset observer allow-unregistered state-model-only-files))) 1055 (vc-deduce-fileset not-state-changing allow-unregistered state-model-only-files)))
1052 ((and (derived-mode-p 'log-view-mode) 1056 ((and (derived-mode-p 'log-view-mode)
1053 (setq backend (vc-responsible-backend default-directory))) 1057 (setq backend (vc-responsible-backend default-directory)))
1054 (list backend nil)) 1058 (list backend nil))
@@ -1065,32 +1069,6 @@ BEWARE: this function may change the current buffer."
1065 (list buffer-file-name)))) 1069 (list buffer-file-name))))
1066 (t (error "File is not under version control"))))) 1070 (t (error "File is not under version control")))))
1067 1071
1068(declare-function dired-get-marked-files "dired"
1069 (&optional localp arg filter distinguish-one-marked error))
1070
1071(defun vc-dired-deduce-fileset (&optional state-model-only-files observer)
1072 (let ((backend (vc-responsible-backend default-directory))
1073 (files (dired-get-marked-files nil nil nil nil t))
1074 only-files-list
1075 state
1076 model)
1077 (when (and (not observer) (cl-some #'file-directory-p files))
1078 (error "State changing VC operations on directories not supported in `dired-mode'"))
1079
1080 (when state-model-only-files
1081 (setq only-files-list (mapcar (lambda (file) (cons file (vc-state file))) files))
1082 (setq state (cdar only-files-list))
1083 ;; Check that all files are in a consistent state, since we use that
1084 ;; state to decide which operation to perform.
1085 (dolist (crt (cdr only-files-list))
1086 (unless (vc-compatible-state (cdr crt) state)
1087 (error "When applying VC operations to multiple files, the files are required\nto be in similar VC states.\n%s in state %s clashes with %s in state %s"
1088 (car crt) (cdr crt) (caar only-files-list) state)))
1089 (setq only-files-list (mapcar 'car only-files-list))
1090 (when (and state (not (eq state 'unregistered)))
1091 (setq model (vc-checkout-model backend only-files-list))))
1092 (list backend files only-files-list state model)))
1093
1094(defun vc-ensure-vc-buffer () 1072(defun vc-ensure-vc-buffer ()
1095 "Make sure that the current buffer visits a version-controlled file." 1073 "Make sure that the current buffer visits a version-controlled file."
1096 (cond 1074 (cond
diff --git a/lisp/window.el b/lisp/window.el
index b54f1633f5e..8512a0e2f97 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -226,7 +226,9 @@ BODY."
226 "Show a buffer BUFFER-OR-NAME and evaluate BODY in that buffer. 226 "Show a buffer BUFFER-OR-NAME and evaluate BODY in that buffer.
227This construct is like `with-current-buffer-window' but unlike that, 227This construct is like `with-current-buffer-window' but unlike that,
228displays the buffer specified by BUFFER-OR-NAME before running BODY." 228displays the buffer specified by BUFFER-OR-NAME before running BODY."
229 (declare (debug t) (indent 3)) 229 (declare (debug t) (indent 3)
230 (obsolete "use `with-current-buffer-window' with action alist entry `body-function'."
231 "28.1"))
230 (let ((buffer (make-symbol "buffer")) 232 (let ((buffer (make-symbol "buffer"))
231 (window (make-symbol "window")) 233 (window (make-symbol "window"))
232 (value (make-symbol "value"))) 234 (value (make-symbol "value")))
@@ -7070,6 +7072,12 @@ Return WINDOW if BUFFER and WINDOW are live."
7070 (set-window-dedicated-p window display-buffer-mark-dedicated)))) 7072 (set-window-dedicated-p window display-buffer-mark-dedicated))))
7071 (when (memq type '(window frame tab)) 7073 (when (memq type '(window frame tab))
7072 (set-window-prev-buffers window nil)) 7074 (set-window-prev-buffers window nil))
7075
7076 (when (functionp (cdr (assq 'body-function alist)))
7077 (let ((inhibit-read-only t)
7078 (inhibit-modification-hooks t))
7079 (funcall (cdr (assq 'body-function alist)) window)))
7080
7073 (let ((quit-restore (window-parameter window 'quit-restore)) 7081 (let ((quit-restore (window-parameter window 'quit-restore))
7074 (height (cdr (assq 'window-height alist))) 7082 (height (cdr (assq 'window-height alist)))
7075 (width (cdr (assq 'window-width alist))) 7083 (width (cdr (assq 'window-width alist)))
@@ -7397,6 +7405,12 @@ Action alist entries are:
7397 parameters to give the chosen window. 7405 parameters to give the chosen window.
7398 `allow-no-window' -- A non-nil value means that `display-buffer' 7406 `allow-no-window' -- A non-nil value means that `display-buffer'
7399 may not display the buffer and return nil immediately. 7407 may not display the buffer and return nil immediately.
7408 `body-function' -- A function called with one argument - the
7409 displayed window. It is called after the buffer is
7410 displayed, and before `window-height', `window-width'
7411 and `preserve-size' are applied. The function is supposed
7412 to fill the window body with some contents that might depend
7413 on dimensions of the displayed window.
7400 7414
7401The entries `window-height', `window-width' and `preserve-size' 7415The entries `window-height', `window-width' and `preserve-size'
7402are applied only when the window used for displaying the buffer 7416are applied only when the window used for displaying the buffer
diff --git a/src/alloc.c b/src/alloc.c
index db0646c81e3..147e018095b 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -432,7 +432,6 @@ inline static void set_interval_marked (INTERVAL i);
432enum mem_type 432enum mem_type
433{ 433{
434 MEM_TYPE_NON_LISP, 434 MEM_TYPE_NON_LISP,
435 MEM_TYPE_BUFFER,
436 MEM_TYPE_CONS, 435 MEM_TYPE_CONS,
437 MEM_TYPE_STRING, 436 MEM_TYPE_STRING,
438 MEM_TYPE_SYMBOL, 437 MEM_TYPE_SYMBOL,
@@ -3339,12 +3338,10 @@ allocate_pseudovector (int memlen, int lisplen,
3339struct buffer * 3338struct buffer *
3340allocate_buffer (void) 3339allocate_buffer (void)
3341{ 3340{
3342 struct buffer *b = lisp_malloc (sizeof *b, false, MEM_TYPE_BUFFER); 3341 struct buffer *b
3343 3342 = ALLOCATE_PSEUDOVECTOR (struct buffer, cursor_in_non_selected_windows_,
3343 PVEC_BUFFER);
3344 BUFFER_PVEC_INIT (b); 3344 BUFFER_PVEC_INIT (b);
3345 /* Put B on the chain of all buffers including killed ones. */
3346 b->next = all_buffers;
3347 all_buffers = b;
3348 /* Note that the rest fields of B are not initialized. */ 3345 /* Note that the rest fields of B are not initialized. */
3349 return b; 3346 return b;
3350} 3347}
@@ -4604,40 +4601,6 @@ live_vector_p (struct mem_node *m, void *p)
4604 return !NILP (live_vector_holding (m, p)); 4601 return !NILP (live_vector_holding (m, p));
4605} 4602}
4606 4603
4607/* If P is a pointer into a valid buffer object, return the buffer.
4608 Otherwise, return nil. M is a pointer to the mem_block for P.
4609 If IGNORE_KILLED is non-zero, treat killed buffers as invalid. */
4610
4611static Lisp_Object
4612live_buffer_holding (struct mem_node *m, void *p, bool ignore_killed)
4613{
4614 /* P must point into the block, and the buffer must not
4615 have been killed unless ALL-BUFFERS is true. */
4616 if (m->type == MEM_TYPE_BUFFER)
4617 {
4618 struct buffer *b = m->start;
4619 char *cb = m->start;
4620 char *cp = p;
4621 ptrdiff_t offset = cp - cb;
4622 if (0 <= offset && offset < sizeof *b
4623 && !(ignore_killed && NILP (b->name_)))
4624 {
4625 Lisp_Object obj;
4626 XSETBUFFER (obj, b);
4627 return obj;
4628 }
4629 }
4630 return Qnil;
4631}
4632
4633/* If P is a pointer into a live (valid and not killed) buffer object,
4634 return non-zero. */
4635static bool
4636live_buffer_p (struct mem_node *m, void *p)
4637{
4638 return !NILP (live_buffer_holding (m, p, true));
4639}
4640
4641/* Mark OBJ if we can prove it's a Lisp_Object. */ 4604/* Mark OBJ if we can prove it's a Lisp_Object. */
4642 4605
4643static void 4606static void
@@ -4692,8 +4655,7 @@ mark_maybe_object (Lisp_Object obj)
4692 break; 4655 break;
4693 4656
4694 case Lisp_Vectorlike: 4657 case Lisp_Vectorlike:
4695 mark_p = (EQ (obj, live_vector_holding (m, po)) 4658 mark_p = (EQ (obj, live_vector_holding (m, po)));
4696 || EQ (obj, live_buffer_holding (m, po, false)));
4697 break; 4659 break;
4698 4660
4699 default: 4661 default:
@@ -4762,10 +4724,6 @@ mark_maybe_pointer (void *p)
4762 /* Nothing to do; not a pointer to Lisp memory. */ 4724 /* Nothing to do; not a pointer to Lisp memory. */
4763 break; 4725 break;
4764 4726
4765 case MEM_TYPE_BUFFER:
4766 obj = live_buffer_holding (m, p, false);
4767 break;
4768
4769 case MEM_TYPE_CONS: 4727 case MEM_TYPE_CONS:
4770 obj = live_cons_holding (m, p); 4728 obj = live_cons_holding (m, p);
4771 break; 4729 break;
@@ -5165,9 +5123,6 @@ valid_lisp_object_p (Lisp_Object obj)
5165 case MEM_TYPE_SPARE: 5123 case MEM_TYPE_SPARE:
5166 return 0; 5124 return 0;
5167 5125
5168 case MEM_TYPE_BUFFER:
5169 return live_buffer_p (m, p) ? 1 : 2;
5170
5171 case MEM_TYPE_CONS: 5126 case MEM_TYPE_CONS:
5172 return live_cons_p (m, p); 5127 return live_cons_p (m, p);
5173 5128
@@ -5984,7 +5939,7 @@ maybe_garbage_collect (void)
5984void 5939void
5985garbage_collect (void) 5940garbage_collect (void)
5986{ 5941{
5987 struct buffer *nextb; 5942 Lisp_Object tail, buffer;
5988 char stack_top_variable; 5943 char stack_top_variable;
5989 bool message_p; 5944 bool message_p;
5990 ptrdiff_t count = SPECPDL_INDEX (); 5945 ptrdiff_t count = SPECPDL_INDEX ();
@@ -6000,8 +5955,8 @@ garbage_collect (void)
6000 5955
6001 /* Don't keep undo information around forever. 5956 /* Don't keep undo information around forever.
6002 Do this early on, so it is no problem if the user quits. */ 5957 Do this early on, so it is no problem if the user quits. */
6003 FOR_EACH_BUFFER (nextb) 5958 FOR_EACH_LIVE_BUFFER (tail, buffer)
6004 compact_buffer (nextb); 5959 compact_buffer (XBUFFER (buffer));
6005 5960
6006 byte_ct tot_before = (profiler_memory_running 5961 byte_ct tot_before = (profiler_memory_running
6007 ? total_bytes_of_live_objects () 5962 ? total_bytes_of_live_objects ()
@@ -6091,8 +6046,9 @@ garbage_collect (void)
6091 6046
6092 compact_font_caches (); 6047 compact_font_caches ();
6093 6048
6094 FOR_EACH_BUFFER (nextb) 6049 FOR_EACH_LIVE_BUFFER (tail, buffer)
6095 { 6050 {
6051 struct buffer *nextb = XBUFFER (buffer);
6096 if (!EQ (BVAR (nextb, undo_list), Qt)) 6052 if (!EQ (BVAR (nextb, undo_list), Qt))
6097 bset_undo_list (nextb, compact_undo_list (BVAR (nextb, undo_list))); 6053 bset_undo_list (nextb, compact_undo_list (BVAR (nextb, undo_list)));
6098 /* Now that we have stripped the elements that need not be 6054 /* Now that we have stripped the elements that need not be
@@ -6357,7 +6313,12 @@ mark_buffer (struct buffer *buffer)
6357 6313
6358 /* For now, we just don't mark the undo_list. It's done later in 6314 /* For now, we just don't mark the undo_list. It's done later in
6359 a special way just before the sweep phase, and after stripping 6315 a special way just before the sweep phase, and after stripping
6360 some of its elements that are not needed any more. */ 6316 some of its elements that are not needed any more.
6317 Note: this later processing is only done for live buffers, so
6318 for dead buffers, the undo_list should be nil (set by Fkill_buffer),
6319 but just to be on the safe side, we mark it here. */
6320 if (!BUFFER_LIVE_P (buffer))
6321 mark_object (BVAR (buffer, undo_list));
6361 6322
6362 mark_overlay (buffer->overlays_before); 6323 mark_overlay (buffer->overlays_before);
6363 mark_overlay (buffer->overlays_after); 6324 mark_overlay (buffer->overlays_after);
@@ -6621,23 +6582,12 @@ mark_object (Lisp_Object arg)
6621 = PSEUDOVECTOR_TYPE (ptr); 6582 = PSEUDOVECTOR_TYPE (ptr);
6622 6583
6623 if (pvectype != PVEC_SUBR && 6584 if (pvectype != PVEC_SUBR &&
6624 pvectype != PVEC_BUFFER &&
6625 !main_thread_p (po)) 6585 !main_thread_p (po))
6626 CHECK_LIVE (live_vector_p); 6586 CHECK_LIVE (live_vector_p);
6627 6587
6628 switch (pvectype) 6588 switch (pvectype)
6629 { 6589 {
6630 case PVEC_BUFFER: 6590 case PVEC_BUFFER:
6631#if GC_CHECK_MARKED_OBJECTS
6632 {
6633 struct buffer *b;
6634 FOR_EACH_BUFFER (b)
6635 if (b == po)
6636 break;
6637 if (b == NULL)
6638 emacs_abort ();
6639 }
6640#endif /* GC_CHECK_MARKED_OBJECTS */
6641 mark_buffer ((struct buffer *) ptr); 6591 mark_buffer ((struct buffer *) ptr);
6642 break; 6592 break;
6643 6593
@@ -7126,25 +7076,17 @@ NO_INLINE /* For better stack traces */
7126static void 7076static void
7127sweep_buffers (void) 7077sweep_buffers (void)
7128{ 7078{
7129 struct buffer *buffer, **bprev = &all_buffers; 7079 Lisp_Object tail, buf;
7130 7080
7131 gcstat.total_buffers = 0; 7081 gcstat.total_buffers = 0;
7132 for (buffer = all_buffers; buffer; buffer = *bprev) 7082 FOR_EACH_LIVE_BUFFER (tail, buf)
7133 if (!vectorlike_marked_p (&buffer->header)) 7083 {
7134 { 7084 struct buffer *buffer = XBUFFER (buf);
7135 *bprev = buffer->next; 7085 /* Do not use buffer_(set|get)_intervals here. */
7136 lisp_free (buffer); 7086 buffer->text->intervals = balance_intervals (buffer->text->intervals);
7137 } 7087 unchain_dead_markers (buffer);
7138 else 7088 gcstat.total_buffers++;
7139 { 7089 }
7140 if (!pdumper_object_p (buffer))
7141 XUNMARK_VECTOR (buffer);
7142 /* Do not use buffer_(set|get)_intervals here. */
7143 buffer->text->intervals = balance_intervals (buffer->text->intervals);
7144 unchain_dead_markers (buffer);
7145 gcstat.total_buffers++;
7146 bprev = &buffer->next;
7147 }
7148} 7090}
7149 7091
7150/* Sweep: find all structures not marked, and free them. */ 7092/* Sweep: find all structures not marked, and free them. */
diff --git a/src/buffer.c b/src/buffer.c
index 70598a7a22a..d8842a6d770 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -51,11 +51,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
51#include "w32heap.h" /* for mmap_* */ 51#include "w32heap.h" /* for mmap_* */
52#endif 52#endif
53 53
54/* First buffer in chain of all buffers (in reverse order of creation).
55 Threaded through ->header.next.buffer. */
56
57struct buffer *all_buffers;
58
59/* This structure holds the default values of the buffer-local variables 54/* This structure holds the default values of the buffer-local variables
60 defined with DEFVAR_PER_BUFFER, that have special slots in each buffer. 55 defined with DEFVAR_PER_BUFFER, that have special slots in each buffer.
61 The default value occupies the same slot in this structure 56 The default value occupies the same slot in this structure
@@ -1786,15 +1781,11 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1786 ask questions or their hooks get errors. */ 1781 ask questions or their hooks get errors. */
1787 if (!b->base_buffer && b->indirections > 0) 1782 if (!b->base_buffer && b->indirections > 0)
1788 { 1783 {
1789 struct buffer *other; 1784 Lisp_Object tail, other;
1790 1785
1791 FOR_EACH_BUFFER (other) 1786 FOR_EACH_LIVE_BUFFER (tail, other)
1792 if (other->base_buffer == b) 1787 if (XBUFFER (other)->base_buffer == b)
1793 { 1788 Fkill_buffer (other);
1794 Lisp_Object buf;
1795 XSETBUFFER (buf, other);
1796 Fkill_buffer (buf);
1797 }
1798 1789
1799 /* Exit if we now have killed the base buffer (Bug#11665). */ 1790 /* Exit if we now have killed the base buffer (Bug#11665). */
1800 if (!BUFFER_LIVE_P (b)) 1791 if (!BUFFER_LIVE_P (b))
@@ -1849,6 +1840,9 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1849 1840
1850 tem = Vinhibit_quit; 1841 tem = Vinhibit_quit;
1851 Vinhibit_quit = Qt; 1842 Vinhibit_quit = Qt;
1843 /* Once the buffer is removed from Vbuffer_alist, its undo_list field is
1844 not traced by the GC in the same way. So set it to nil early. */
1845 bset_undo_list (b, Qnil);
1852 /* Remove the buffer from the list of all buffers. */ 1846 /* Remove the buffer from the list of all buffers. */
1853 Vbuffer_alist = Fdelq (Frassq (buffer, Vbuffer_alist), Vbuffer_alist); 1847 Vbuffer_alist = Fdelq (Frassq (buffer, Vbuffer_alist), Vbuffer_alist);
1854 /* If replace_buffer_in_windows didn't do its job fix that now. */ 1848 /* If replace_buffer_in_windows didn't do its job fix that now. */
@@ -1963,7 +1957,6 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1963 } 1957 }
1964 bset_width_table (b, Qnil); 1958 bset_width_table (b, Qnil);
1965 unblock_input (); 1959 unblock_input ();
1966 bset_undo_list (b, Qnil);
1967 1960
1968 /* Run buffer-list-update-hook. */ 1961 /* Run buffer-list-update-hook. */
1969 if (!NILP (Vrun_hooks) && !b->inhibit_buffer_hooks) 1962 if (!NILP (Vrun_hooks) && !b->inhibit_buffer_hooks)
@@ -2351,10 +2344,10 @@ results, see Info node `(elisp)Swapping Text'. */)
2351 error ("Cannot swap indirect buffers's text"); 2344 error ("Cannot swap indirect buffers's text");
2352 2345
2353 { /* This is probably harder to make work. */ 2346 { /* This is probably harder to make work. */
2354 struct buffer *other; 2347 Lisp_Object tail, other;
2355 FOR_EACH_BUFFER (other) 2348 FOR_EACH_LIVE_BUFFER (tail, other)
2356 if (other->base_buffer == other_buffer 2349 if (XBUFFER (other)->base_buffer == other_buffer
2357 || other->base_buffer == current_buffer) 2350 || XBUFFER (other)->base_buffer == current_buffer)
2358 error ("One of the buffers to swap has indirect buffers"); 2351 error ("One of the buffers to swap has indirect buffers");
2359 } 2352 }
2360 2353
@@ -2502,7 +2495,7 @@ current buffer is cleared. */)
2502 (Lisp_Object flag) 2495 (Lisp_Object flag)
2503{ 2496{
2504 struct Lisp_Marker *tail, *markers; 2497 struct Lisp_Marker *tail, *markers;
2505 struct buffer *other; 2498 Lisp_Object btail, other;
2506 ptrdiff_t begv, zv; 2499 ptrdiff_t begv, zv;
2507 bool narrowed = (BEG != BEGV || Z != ZV); 2500 bool narrowed = (BEG != BEGV || Z != ZV);
2508 bool modified_p = !NILP (Fbuffer_modified_p (Qnil)); 2501 bool modified_p = !NILP (Fbuffer_modified_p (Qnil));
@@ -2755,13 +2748,16 @@ current buffer is cleared. */)
2755 2748
2756 /* Copy this buffer's new multibyte status 2749 /* Copy this buffer's new multibyte status
2757 into all of its indirect buffers. */ 2750 into all of its indirect buffers. */
2758 FOR_EACH_BUFFER (other) 2751 FOR_EACH_LIVE_BUFFER (btail, other)
2759 if (other->base_buffer == current_buffer && BUFFER_LIVE_P (other)) 2752 {
2760 { 2753 struct buffer *o = XBUFFER (other);
2761 BVAR (other, enable_multibyte_characters) 2754 if (o->base_buffer == current_buffer && BUFFER_LIVE_P (o))
2762 = BVAR (current_buffer, enable_multibyte_characters); 2755 {
2763 other->prevent_redisplay_optimizations_p = 1; 2756 BVAR (o, enable_multibyte_characters)
2764 } 2757 = BVAR (current_buffer, enable_multibyte_characters);
2758 o->prevent_redisplay_optimizations_p = true;
2759 }
2760 }
2765 2761
2766 /* Restore the modifiedness of the buffer. */ 2762 /* Restore the modifiedness of the buffer. */
2767 if (!modified_p && !NILP (Fbuffer_modified_p (Qnil))) 2763 if (!modified_p && !NILP (Fbuffer_modified_p (Qnil)))
@@ -5327,8 +5323,6 @@ init_buffer_once (void)
5327 Vbuffer_alist = Qnil; 5323 Vbuffer_alist = Qnil;
5328 current_buffer = 0; 5324 current_buffer = 0;
5329 pdumper_remember_lv_ptr_raw (&current_buffer, Lisp_Vectorlike); 5325 pdumper_remember_lv_ptr_raw (&current_buffer, Lisp_Vectorlike);
5330 all_buffers = 0;
5331 pdumper_remember_lv_ptr_raw (&all_buffers, Lisp_Vectorlike);
5332 5326
5333 QSFundamental = build_pure_c_string ("Fundamental"); 5327 QSFundamental = build_pure_c_string ("Fundamental");
5334 5328
@@ -5359,7 +5353,7 @@ init_buffer (void)
5359#ifdef USE_MMAP_FOR_BUFFERS 5353#ifdef USE_MMAP_FOR_BUFFERS
5360 if (dumped_with_unexec_p ()) 5354 if (dumped_with_unexec_p ())
5361 { 5355 {
5362 struct buffer *b; 5356 Lisp_Object tail, buffer;
5363 5357
5364#ifndef WINDOWSNT 5358#ifndef WINDOWSNT
5365 /* These must be reset in the dumped Emacs, to avoid stale 5359 /* These must be reset in the dumped Emacs, to avoid stale
@@ -5381,23 +5375,13 @@ init_buffer (void)
5381 " *code-conversion-work*". They are created by 5375 " *code-conversion-work*". They are created by
5382 init_buffer_once and init_window_once (which are not called 5376 init_buffer_once and init_window_once (which are not called
5383 in the dumped Emacs), and by the first call to coding.c routines. */ 5377 in the dumped Emacs), and by the first call to coding.c routines. */
5384 FOR_EACH_BUFFER (b) 5378 FOR_EACH_LIVE_BUFFER (tail, buffer)
5385 { 5379 {
5380 struct buffer *b = XBUFFER (buffer);
5386 b->text->beg = NULL; 5381 b->text->beg = NULL;
5387 enlarge_buffer_text (b, 0); 5382 enlarge_buffer_text (b, 0);
5388 } 5383 }
5389 } 5384 }
5390 else
5391 {
5392 struct buffer *b;
5393
5394 /* Only buffers with allocated buffer text should be present at
5395 this point in temacs. */
5396 FOR_EACH_BUFFER (b)
5397 {
5398 eassert (b->text->beg != NULL);
5399 }
5400 }
5401#endif /* USE_MMAP_FOR_BUFFERS */ 5385#endif /* USE_MMAP_FOR_BUFFERS */
5402 5386
5403 AUTO_STRING (scratch, "*scratch*"); 5387 AUTO_STRING (scratch, "*scratch*");
diff --git a/src/buffer.h b/src/buffer.h
index 31f497ea40a..abb1294d038 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -570,9 +570,6 @@ struct buffer
570 In an indirect buffer, this is the own_text field of another buffer. */ 570 In an indirect buffer, this is the own_text field of another buffer. */
571 struct buffer_text *text; 571 struct buffer_text *text;
572 572
573 /* Next buffer, in chain of all buffers, including killed ones. */
574 struct buffer *next;
575
576 /* Char position of point in buffer. */ 573 /* Char position of point in buffer. */
577 ptrdiff_t pt; 574 ptrdiff_t pt;
578 575
@@ -1104,15 +1101,6 @@ BUFFER_CHECK_INDIRECTION (struct buffer *b)
1104 } 1101 }
1105} 1102}
1106 1103
1107/* Chain of all buffers, including killed ones. */
1108
1109extern struct buffer *all_buffers;
1110
1111/* Used to iterate over the chain above. */
1112
1113#define FOR_EACH_BUFFER(b) \
1114 for ((b) = all_buffers; (b); (b) = (b)->next)
1115
1116/* This structure holds the default values of the buffer-local variables 1104/* This structure holds the default values of the buffer-local variables
1117 that have special slots in each buffer. 1105 that have special slots in each buffer.
1118 The default value occupies the same slot in this structure 1106 The default value occupies the same slot in this structure
diff --git a/src/decompress.c b/src/decompress.c
index 5d246387e76..8e8f2443111 100644
--- a/src/decompress.c
+++ b/src/decompress.c
@@ -87,7 +87,7 @@ unwind_decompress (void *ddata)
87 0); 87 0);
88 update_compositions (data->start, data->start, CHECK_HEAD); 88 update_compositions (data->start, data->start, CHECK_HEAD);
89 /* "Balance" the before-change-functions call, which would 89 /* "Balance" the before-change-functions call, which would
90 otherwise be left "hanging". */ 90 otherwise be left "hanging". */
91 signal_after_change (data->orig, data->start - data->orig, 91 signal_after_change (data->orig, data->start - data->orig,
92 data->start - data->orig); 92 data->start - data->orig);
93 } 93 }
@@ -159,7 +159,7 @@ This function can be called only in unibyte buffers. */)
159 istart = XFIXNUM (start); 159 istart = XFIXNUM (start);
160 iend = XFIXNUM (end); 160 iend = XFIXNUM (end);
161 161
162 /* Do the following before manipulating the gap. */ 162 /* Do the following before manipulating the gap. */
163 modify_text (istart, iend); 163 modify_text (istart, iend);
164 164
165 move_gap_both (iend, iend); 165 move_gap_both (iend, iend);
@@ -224,7 +224,7 @@ This function can be called only in unibyte buffers. */)
224 unwind_data.start = 0; 224 unwind_data.start = 0;
225 225
226 /* Delete the compressed data. */ 226 /* Delete the compressed data. */
227 del_range_2 (istart, istart, /* byte and char offsets are the same. */ 227 del_range_2 (istart, istart, /* byte and char offsets are the same */
228 iend, iend, 0); 228 iend, iend, 0);
229 229
230 signal_after_change (istart, iend - istart, unwind_data.nbytes); 230 signal_after_change (istart, iend - istart, unwind_data.nbytes);
diff --git a/src/dispextern.h b/src/dispextern.h
index 08380f1f17f..555946f84cb 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1693,12 +1693,17 @@ struct face
1693 int fontset; 1693 int fontset;
1694 1694
1695 /* Non-zero means characters in this face have a box of that 1695 /* Non-zero means characters in this face have a box of that
1696 thickness around them. If this value is negative, its absolute 1696 thickness around them. Vertical (left and right) and horizontal
1697 value indicates the thickness, and the horizontal (top and 1697 (top and bottom) borders size can be set separatedly using an
1698 bottom) borders of box are drawn inside of the character glyphs' 1698 associated list of two ints in the form
1699 area. The vertical (left and right) borders of the box are drawn 1699 (vertical_size . horizontal_size). In case one of the value is
1700 in the same way as when this value is positive. */ 1700 negative, its absolute value indicates the thickness, and the
1701 int box_line_width; 1701 borders of box are drawn inside of the character glyphs' area
1702 potentially over the glyph itself but the glyph drawing size is
1703 not increase. If a (signed) int N is use instead of a list, it
1704 is the same as setting ( abs(N) . N ) values. */
1705 int box_vertical_line_width;
1706 int box_horizontal_line_width;
1702 1707
1703 /* Type of box drawn. A value of FACE_NO_BOX means no box is drawn 1708 /* Type of box drawn. A value of FACE_NO_BOX means no box is drawn
1704 around text in this face. A value of FACE_SIMPLE_BOX means a box 1709 around text in this face. A value of FACE_SIMPLE_BOX means a box
diff --git a/src/nsfont.m b/src/nsfont.m
index 9bec3691786..e41a698a2ff 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -1043,7 +1043,7 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
1043 1043
1044 r.origin.x = s->x; 1044 r.origin.x = s->x;
1045 if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p) 1045 if (s->face->box != FACE_NO_BOX && s->first_glyph->left_box_line_p)
1046 r.origin.x += abs (s->face->box_line_width); 1046 r.origin.x += max (s->face->box_vertical_line_width, 0);
1047 1047
1048 r.origin.y = s->y; 1048 r.origin.y = s->y;
1049 r.size.height = FONT_HEIGHT (font); 1049 r.size.height = FONT_HEIGHT (font);
@@ -1105,7 +1105,7 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
1105 { 1105 {
1106 NSRect br = r; 1106 NSRect br = r;
1107 int fibw = FRAME_INTERNAL_BORDER_WIDTH (s->f); 1107 int fibw = FRAME_INTERNAL_BORDER_WIDTH (s->f);
1108 int mbox_line_width = max (s->face->box_line_width, 0); 1108 int mbox_line_width = max (s->face->box_vertical_line_width, 0);
1109 1109
1110 if (s->row->full_width_p) 1110 if (s->row->full_width_p)
1111 { 1111 {
@@ -1129,9 +1129,10 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
1129 } 1129 }
1130 else 1130 else
1131 { 1131 {
1132 int correction = abs (s->face->box_line_width)+1; 1132 int correction = abs (s->face->box_horizontal_line_width)+1;
1133 br.origin.y += correction; 1133 br.origin.y += correction;
1134 br.size.height -= 2*correction; 1134 br.size.height -= 2*correction;
1135 correction = abs (s->face->box_vertical_line_width)+1;
1135 br.origin.x += correction; 1136 br.origin.x += correction;
1136 br.size.width -= 2*correction; 1137 br.size.width -= 2*correction;
1137 } 1138 }
diff --git a/src/nsterm.m b/src/nsterm.m
index 04fc0512234..3ce223307ba 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3639,8 +3639,8 @@ ns_draw_text_decoration (struct glyph_string *s, struct face *face,
3639} 3639}
3640 3640
3641static void 3641static void
3642ns_draw_box (NSRect r, CGFloat thickness, NSColor *col, 3642ns_draw_box (NSRect r, CGFloat hthickness, CGFloat vthickness,
3643 char left_p, char right_p) 3643 NSColor *col, char left_p, char right_p)
3644/* -------------------------------------------------------------------------- 3644/* --------------------------------------------------------------------------
3645 Draw an unfilled rect inside r, optionally leaving left and/or right open. 3645 Draw an unfilled rect inside r, optionally leaving left and/or right open.
3646 Note we can't just use an NSDrawRect command, because of the possibility 3646 Note we can't just use an NSDrawRect command, because of the possibility
@@ -3651,28 +3651,28 @@ ns_draw_box (NSRect r, CGFloat thickness, NSColor *col,
3651 [col set]; 3651 [col set];
3652 3652
3653 /* top, bottom */ 3653 /* top, bottom */
3654 s.size.height = thickness; 3654 s.size.height = hthickness;
3655 NSRectFill (s); 3655 NSRectFill (s);
3656 s.origin.y += r.size.height - thickness; 3656 s.origin.y += r.size.height - hthickness;
3657 NSRectFill (s); 3657 NSRectFill (s);
3658 3658
3659 s.size.height = r.size.height; 3659 s.size.height = r.size.height;
3660 s.origin.y = r.origin.y; 3660 s.origin.y = r.origin.y;
3661 3661
3662 /* left, right (optional) */ 3662 /* left, right (optional) */
3663 s.size.width = thickness; 3663 s.size.width = vthickness;
3664 if (left_p) 3664 if (left_p)
3665 NSRectFill (s); 3665 NSRectFill (s);
3666 if (right_p) 3666 if (right_p)
3667 { 3667 {
3668 s.origin.x += r.size.width - thickness; 3668 s.origin.x += r.size.width - vthickness;
3669 NSRectFill (s); 3669 NSRectFill (s);
3670 } 3670 }
3671} 3671}
3672 3672
3673 3673
3674static void 3674static void
3675ns_draw_relief (NSRect r, int thickness, char raised_p, 3675ns_draw_relief (NSRect r, int hthickness, int vthickness, char raised_p,
3676 char top_p, char bottom_p, char left_p, char right_p, 3676 char top_p, char bottom_p, char left_p, char right_p,
3677 struct glyph_string *s) 3677 struct glyph_string *s)
3678/* -------------------------------------------------------------------------- 3678/* --------------------------------------------------------------------------
@@ -3722,27 +3722,27 @@ ns_draw_relief (NSRect r, int thickness, char raised_p,
3722 /* TODO: mitering. Using NSBezierPath doesn't work because of color switch. */ 3722 /* TODO: mitering. Using NSBezierPath doesn't work because of color switch. */
3723 3723
3724 /* top */ 3724 /* top */
3725 sr.size.height = thickness; 3725 sr.size.height = hthickness;
3726 if (top_p) NSRectFill (sr); 3726 if (top_p) NSRectFill (sr);
3727 3727
3728 /* left */ 3728 /* left */
3729 sr.size.height = r.size.height; 3729 sr.size.height = r.size.height;
3730 sr.size.width = thickness; 3730 sr.size.width = vthickness;
3731 if (left_p) NSRectFill (sr); 3731 if (left_p) NSRectFill (sr);
3732 3732
3733 [(raised_p ? darkCol : lightCol) set]; 3733 [(raised_p ? darkCol : lightCol) set];
3734 3734
3735 /* bottom */ 3735 /* bottom */
3736 sr.size.width = r.size.width; 3736 sr.size.width = r.size.width;
3737 sr.size.height = thickness; 3737 sr.size.height = hthickness;
3738 sr.origin.y += r.size.height - thickness; 3738 sr.origin.y += r.size.height - hthickness;
3739 if (bottom_p) NSRectFill (sr); 3739 if (bottom_p) NSRectFill (sr);
3740 3740
3741 /* right */ 3741 /* right */
3742 sr.size.height = r.size.height; 3742 sr.size.height = r.size.height;
3743 sr.origin.y = r.origin.y; 3743 sr.origin.y = r.origin.y;
3744 sr.size.width = thickness; 3744 sr.size.width = vthickness;
3745 sr.origin.x += r.size.width - thickness; 3745 sr.origin.x += r.size.width - vthickness;
3746 if (right_p) NSRectFill (sr); 3746 if (right_p) NSRectFill (sr);
3747} 3747}
3748 3748
@@ -3758,7 +3758,7 @@ ns_dumpglyphs_box_or_relief (struct glyph_string *s)
3758 char left_p, right_p; 3758 char left_p, right_p;
3759 struct glyph *last_glyph; 3759 struct glyph *last_glyph;
3760 NSRect r; 3760 NSRect r;
3761 int thickness; 3761 int hthickness, vthickness;
3762 struct face *face; 3762 struct face *face;
3763 3763
3764 if (s->hl == DRAW_MOUSE_FACE) 3764 if (s->hl == DRAW_MOUSE_FACE)
@@ -3771,7 +3771,8 @@ ns_dumpglyphs_box_or_relief (struct glyph_string *s)
3771 else 3771 else
3772 face = s->face; 3772 face = s->face;
3773 3773
3774 thickness = face->box_line_width; 3774 vthickness = face->box_vertical_line_width;
3775 hthickness = face->box_horizontal_line_width;
3775 3776
3776 NSTRACE ("ns_dumpglyphs_box_or_relief"); 3777 NSTRACE ("ns_dumpglyphs_box_or_relief");
3777 3778
@@ -3796,14 +3797,15 @@ ns_dumpglyphs_box_or_relief (struct glyph_string *s)
3796 /* TODO: Sometimes box_color is 0 and this seems wrong; should investigate. */ 3797 /* TODO: Sometimes box_color is 0 and this seems wrong; should investigate. */
3797 if (s->face->box == FACE_SIMPLE_BOX && s->face->box_color) 3798 if (s->face->box == FACE_SIMPLE_BOX && s->face->box_color)
3798 { 3799 {
3799 ns_draw_box (r, abs (thickness), 3800 ns_draw_box (r, abs (hthickness), abs (vthickness),
3800 ns_lookup_indexed_color (face->box_color, s->f), 3801 ns_lookup_indexed_color (face->box_color, s->f),
3801 left_p, right_p); 3802 left_p, right_p);
3802 } 3803 }
3803 else 3804 else
3804 { 3805 {
3805 ns_draw_relief (r, abs (thickness), s->face->box == FACE_RAISED_BOX, 3806 ns_draw_relief (r, abs (hthickness), abs (vthickness),
3806 1, 1, left_p, right_p, s); 3807 s->face->box == FACE_RAISED_BOX,
3808 1, 1, left_p, right_p, s);
3807 } 3809 }
3808} 3810}
3809 3811
@@ -3819,7 +3821,7 @@ ns_maybe_dumpglyphs_background (struct glyph_string *s, char force_p)
3819 3821
3820 if (!s->background_filled_p/* || s->hl == DRAW_MOUSE_FACE*/) 3822 if (!s->background_filled_p/* || s->hl == DRAW_MOUSE_FACE*/)
3821 { 3823 {
3822 int box_line_width = max (s->face->box_line_width, 0); 3824 int box_line_width = max (s->face->box_horizontal_line_width, 0);
3823 if (FONT_HEIGHT (s->font) < s->height - 2 * box_line_width 3825 if (FONT_HEIGHT (s->font) < s->height - 2 * box_line_width
3824 /* When xdisp.c ignores FONT_HEIGHT, we cannot trust font 3826 /* When xdisp.c ignores FONT_HEIGHT, we cannot trust font
3825 dimensions, since the actual glyphs might be much 3827 dimensions, since the actual glyphs might be much
@@ -3870,7 +3872,7 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r)
3870 -------------------------------------------------------------------------- */ 3872 -------------------------------------------------------------------------- */
3871{ 3873{
3872 EmacsImage *img = s->img->pixmap; 3874 EmacsImage *img = s->img->pixmap;
3873 int box_line_vwidth = max (s->face->box_line_width, 0); 3875 int box_line_vwidth = max (s->face->box_horizontal_line_width, 0);
3874 int x = s->x, y = s->ybase - image_ascent (s->img, s->face, &s->slice); 3876 int x = s->x, y = s->ybase - image_ascent (s->img, s->face, &s->slice);
3875 int bg_x, bg_y, bg_height; 3877 int bg_x, bg_y, bg_height;
3876 int th; 3878 int th;
@@ -3883,7 +3885,7 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r)
3883 3885
3884 if (s->face->box != FACE_NO_BOX 3886 if (s->face->box != FACE_NO_BOX
3885 && s->first_glyph->left_box_line_p && s->slice.x == 0) 3887 && s->first_glyph->left_box_line_p && s->slice.x == 0)
3886 x += abs (s->face->box_line_width); 3888 x += max (s->face->box_vertical_line_width, 0);
3887 3889
3888 bg_x = x; 3890 bg_x = x;
3889 bg_y = s->slice.y == 0 ? s->y : s->y + box_line_vwidth; 3891 bg_y = s->slice.y == 0 ? s->y : s->y + box_line_vwidth;
@@ -4003,7 +4005,7 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r)
4003 r.origin.y = y - th; 4005 r.origin.y = y - th;
4004 r.size.width = s->slice.width + 2*th-1; 4006 r.size.width = s->slice.width + 2*th-1;
4005 r.size.height = s->slice.height + 2*th-1; 4007 r.size.height = s->slice.height + 2*th-1;
4006 ns_draw_relief (r, th, raised_p, 4008 ns_draw_relief (r, th, th, raised_p,
4007 s->slice.y == 0, 4009 s->slice.y == 0,
4008 s->slice.y + s->slice.height == s->img->height, 4010 s->slice.y + s->slice.height == s->img->height,
4009 s->slice.x == 0, 4011 s->slice.x == 0,
@@ -4017,7 +4019,7 @@ ns_dumpglyphs_image (struct glyph_string *s, NSRect r)
4017 { 4019 {
4018 int thickness = abs (s->img->relief); 4020 int thickness = abs (s->img->relief);
4019 if (thickness == 0) thickness = 1; 4021 if (thickness == 0) thickness = 1;
4020 ns_draw_box (br, thickness, FRAME_CURSOR_COLOR (s->f), 1, 1); 4022 ns_draw_box (br, thickness, thickness, FRAME_CURSOR_COLOR (s->f), 1, 1);
4021 } 4023 }
4022} 4024}
4023 4025
@@ -4100,7 +4102,7 @@ ns_draw_glyph_string_foreground (struct glyph_string *s)
4100 of S to the right of that box line. */ 4102 of S to the right of that box line. */
4101 if (s->face && s->face->box != FACE_NO_BOX 4103 if (s->face && s->face->box != FACE_NO_BOX
4102 && s->first_glyph->left_box_line_p) 4104 && s->first_glyph->left_box_line_p)
4103 x = s->x + eabs (s->face->box_line_width); 4105 x = s->x + max (s->face->box_vertical_line_width, 0);
4104 else 4106 else
4105 x = s->x; 4107 x = s->x;
4106 4108
@@ -4126,7 +4128,7 @@ ns_draw_composite_glyph_string_foreground (struct glyph_string *s)
4126 of S to the right of that box line. */ 4128 of S to the right of that box line. */
4127 if (s->face && s->face->box != FACE_NO_BOX 4129 if (s->face && s->face->box != FACE_NO_BOX
4128 && s->first_glyph->left_box_line_p) 4130 && s->first_glyph->left_box_line_p)
4129 x = s->x + eabs (s->face->box_line_width); 4131 x = s->x + max (s->face->box_vertical_line_width, 0);
4130 else 4132 else
4131 x = s->x; 4133 x = s->x;
4132 4134
@@ -4142,7 +4144,7 @@ ns_draw_composite_glyph_string_foreground (struct glyph_string *s)
4142 if (s->cmp_from == 0) 4144 if (s->cmp_from == 0)
4143 { 4145 {
4144 NSRect r = NSMakeRect (s->x, s->y, s->width-1, s->height -1); 4146 NSRect r = NSMakeRect (s->x, s->y, s->width-1, s->height -1);
4145 ns_draw_box (r, 1, FRAME_CURSOR_COLOR (s->f), 1, 1); 4147 ns_draw_box (r, 1, 1, FRAME_CURSOR_COLOR (s->f), 1, 1);
4146 } 4148 }
4147 } 4149 }
4148 else if (! s->first_glyph->u.cmp.automatic) 4150 else if (! s->first_glyph->u.cmp.automatic)
diff --git a/src/pdumper.c b/src/pdumper.c
index 55f95fd0e75..03c31681cd5 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -2786,7 +2786,7 @@ dump_hash_table (struct dump_context *ctx,
2786static dump_off 2786static dump_off
2787dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer) 2787dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer)
2788{ 2788{
2789#if CHECK_STRUCTS && !defined HASH_buffer_375A10F5E5 2789#if CHECK_STRUCTS && !defined HASH_buffer_5DC36DBD42
2790# error "buffer changed. See CHECK_STRUCTS comment in config.h." 2790# error "buffer changed. See CHECK_STRUCTS comment in config.h."
2791#endif 2791#endif
2792 struct buffer munged_buffer = *in_buffer; 2792 struct buffer munged_buffer = *in_buffer;
@@ -2862,8 +2862,6 @@ dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer)
2862 ctx->obj_offset + dump_offsetof (struct buffer, text), 2862 ctx->obj_offset + dump_offsetof (struct buffer, text),
2863 base_offset + dump_offsetof (struct buffer, own_text)); 2863 base_offset + dump_offsetof (struct buffer, own_text));
2864 2864
2865 dump_field_lv_rawptr (ctx, out, buffer, &buffer->next,
2866 Lisp_Vectorlike, WEIGHT_NORMAL);
2867 DUMP_FIELD_COPY (out, buffer, pt); 2865 DUMP_FIELD_COPY (out, buffer, pt);
2868 DUMP_FIELD_COPY (out, buffer, pt_byte); 2866 DUMP_FIELD_COPY (out, buffer, pt_byte);
2869 DUMP_FIELD_COPY (out, buffer, begv); 2867 DUMP_FIELD_COPY (out, buffer, begv);
diff --git a/src/w32term.c b/src/w32term.c
index 76cf6bd6964..5fa77d58e10 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -888,10 +888,10 @@ static void w32_draw_image_foreground_1 (struct glyph_string *, HBITMAP);
888static void w32_clear_glyph_string_rect (struct glyph_string *, int, 888static void w32_clear_glyph_string_rect (struct glyph_string *, int,
889 int, int, int); 889 int, int, int);
890static void w32_draw_relief_rect (struct frame *, int, int, int, int, 890static void w32_draw_relief_rect (struct frame *, int, int, int, int,
891 int, int, int, int, int, int, 891 int, int, int, int, int, int, int,
892 RECT *); 892 RECT *);
893static void w32_draw_box_rect (struct glyph_string *, int, int, int, int, 893static void w32_draw_box_rect (struct glyph_string *, int, int, int, int,
894 int, bool, bool, RECT *); 894 int, int, bool, bool, RECT *);
895 895
896 896
897/* Set S->gc to a suitable GC for drawing glyph string S in cursor 897/* Set S->gc to a suitable GC for drawing glyph string S in cursor
@@ -1160,7 +1160,7 @@ w32_draw_glyph_string_background (struct glyph_string *s, bool force_p)
1160 shouldn't be drawn in the first place. */ 1160 shouldn't be drawn in the first place. */
1161 if (!s->background_filled_p) 1161 if (!s->background_filled_p)
1162 { 1162 {
1163 int box_line_width = max (s->face->box_line_width, 0); 1163 int box_line_width = max (s->face->box_horizontal_line_width, 0);
1164 1164
1165#if 0 /* TODO: stipple */ 1165#if 0 /* TODO: stipple */
1166 if (s->stippled_p) 1166 if (s->stippled_p)
@@ -1206,7 +1206,7 @@ w32_draw_glyph_string_foreground (struct glyph_string *s)
1206 of S to the right of that box line. */ 1206 of S to the right of that box line. */
1207 if (s->face->box != FACE_NO_BOX 1207 if (s->face->box != FACE_NO_BOX
1208 && s->first_glyph->left_box_line_p) 1208 && s->first_glyph->left_box_line_p)
1209 x = s->x + eabs (s->face->box_line_width); 1209 x = s->x + max (s->face->box_vertical_line_width, 0);
1210 else 1210 else
1211 x = s->x; 1211 x = s->x;
1212 1212
@@ -1264,7 +1264,7 @@ w32_draw_composite_glyph_string_foreground (struct glyph_string *s)
1264 of S to the right of that box line. */ 1264 of S to the right of that box line. */
1265 if (s->face && s->face->box != FACE_NO_BOX 1265 if (s->face && s->face->box != FACE_NO_BOX
1266 && s->first_glyph->left_box_line_p) 1266 && s->first_glyph->left_box_line_p)
1267 x = s->x + eabs (s->face->box_line_width); 1267 x = s->x + max (s->face->box_vertical_line_width, 0);
1268 else 1268 else
1269 x = s->x; 1269 x = s->x;
1270 1270
@@ -1361,7 +1361,7 @@ w32_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
1361 of S to the right of that box line. */ 1361 of S to the right of that box line. */
1362 if (s->face->box != FACE_NO_BOX 1362 if (s->face->box != FACE_NO_BOX
1363 && s->first_glyph->left_box_line_p) 1363 && s->first_glyph->left_box_line_p)
1364 x = s->x + eabs (s->face->box_line_width); 1364 x = s->x + max (s->face->box_vertical_line_width, 0);
1365 else 1365 else
1366 x = s->x; 1366 x = s->x;
1367 1367
@@ -1617,7 +1617,7 @@ w32_setup_relief_colors (struct glyph_string *s)
1617static void 1617static void
1618w32_draw_relief_rect (struct frame *f, 1618w32_draw_relief_rect (struct frame *f,
1619 int left_x, int top_y, int right_x, int bottom_y, 1619 int left_x, int top_y, int right_x, int bottom_y,
1620 int width, int raised_p, 1620 int hwidth, int vwidth, int raised_p,
1621 int top_p, int bot_p, int left_p, int right_p, 1621 int top_p, int bot_p, int left_p, int right_p,
1622 RECT *clip_rect) 1622 RECT *clip_rect)
1623{ 1623{
@@ -1634,14 +1634,14 @@ w32_draw_relief_rect (struct frame *f,
1634 1634
1635 /* Top. */ 1635 /* Top. */
1636 if (top_p) 1636 if (top_p)
1637 for (i = 0; i < width; ++i) 1637 for (i = 0; i < hwidth; ++i)
1638 w32_fill_area (f, hdc, gc.foreground, 1638 w32_fill_area (f, hdc, gc.foreground,
1639 left_x + i * left_p, top_y + i, 1639 left_x + i * left_p, top_y + i,
1640 right_x - left_x - i * (left_p + right_p ) + 1, 1); 1640 right_x - left_x - i * (left_p + right_p ) + 1, 1);
1641 1641
1642 /* Left. */ 1642 /* Left. */
1643 if (left_p) 1643 if (left_p)
1644 for (i = 0; i < width; ++i) 1644 for (i = 0; i < vwidth; ++i)
1645 w32_fill_area (f, hdc, gc.foreground, 1645 w32_fill_area (f, hdc, gc.foreground,
1646 left_x + i, top_y + (i + 1) * top_p, 1, 1646 left_x + i, top_y + (i + 1) * top_p, 1,
1647 bottom_y - top_y - (i + 1) * (bot_p + top_p) + 1); 1647 bottom_y - top_y - (i + 1) * (bot_p + top_p) + 1);
@@ -1653,14 +1653,14 @@ w32_draw_relief_rect (struct frame *f,
1653 1653
1654 /* Bottom. */ 1654 /* Bottom. */
1655 if (bot_p) 1655 if (bot_p)
1656 for (i = 0; i < width; ++i) 1656 for (i = 0; i < hwidth; ++i)
1657 w32_fill_area (f, hdc, gc.foreground, 1657 w32_fill_area (f, hdc, gc.foreground,
1658 left_x + i * left_p, bottom_y - i, 1658 left_x + i * left_p, bottom_y - i,
1659 right_x - left_x - i * (left_p + right_p) + 1, 1); 1659 right_x - left_x - i * (left_p + right_p) + 1, 1);
1660 1660
1661 /* Right. */ 1661 /* Right. */
1662 if (right_p) 1662 if (right_p)
1663 for (i = 0; i < width; ++i) 1663 for (i = 0; i < vwidth; ++i)
1664 w32_fill_area (f, hdc, gc.foreground, 1664 w32_fill_area (f, hdc, gc.foreground,
1665 right_x - i, top_y + (i + 1) * top_p, 1, 1665 right_x - i, top_y + (i + 1) * top_p, 1,
1666 bottom_y - top_y - (i + 1) * (bot_p + top_p) + 1); 1666 bottom_y - top_y - (i + 1) * (bot_p + top_p) + 1);
@@ -1680,31 +1680,31 @@ w32_draw_relief_rect (struct frame *f,
1680 1680
1681static void 1681static void
1682w32_draw_box_rect (struct glyph_string *s, 1682w32_draw_box_rect (struct glyph_string *s,
1683 int left_x, int top_y, int right_x, int bottom_y, int width, 1683 int left_x, int top_y, int right_x, int bottom_y, int hwidth,
1684 bool left_p, bool right_p, RECT *clip_rect) 1684 int vwidth, bool left_p, bool right_p, RECT *clip_rect)
1685{ 1685{
1686 w32_set_clip_rectangle (s->hdc, clip_rect); 1686 w32_set_clip_rectangle (s->hdc, clip_rect);
1687 1687
1688 /* Top. */ 1688 /* Top. */
1689 w32_fill_area (s->f, s->hdc, s->face->box_color, 1689 w32_fill_area (s->f, s->hdc, s->face->box_color,
1690 left_x, top_y, right_x - left_x + 1, width); 1690 left_x, top_y, right_x - left_x + 1, hwidth);
1691 1691
1692 /* Left. */ 1692 /* Left. */
1693 if (left_p) 1693 if (left_p)
1694 { 1694 {
1695 w32_fill_area (s->f, s->hdc, s->face->box_color, 1695 w32_fill_area (s->f, s->hdc, s->face->box_color,
1696 left_x, top_y, width, bottom_y - top_y + 1); 1696 left_x, top_y, vwidth, bottom_y - top_y + 1);
1697 } 1697 }
1698 1698
1699 /* Bottom. */ 1699 /* Bottom. */
1700 w32_fill_area (s->f, s->hdc, s->face->box_color, 1700 w32_fill_area (s->f, s->hdc, s->face->box_color,
1701 left_x, bottom_y - width + 1, right_x - left_x + 1, width); 1701 left_x, bottom_y - hwidth + 1, right_x - left_x + 1, hwidth);
1702 1702
1703 /* Right. */ 1703 /* Right. */
1704 if (right_p) 1704 if (right_p)
1705 { 1705 {
1706 w32_fill_area (s->f, s->hdc, s->face->box_color, 1706 w32_fill_area (s->f, s->hdc, s->face->box_color,
1707 right_x - width + 1, top_y, width, bottom_y - top_y + 1); 1707 right_x - vwidth + 1, top_y, vwidth, bottom_y - top_y + 1);
1708 } 1708 }
1709 1709
1710 w32_set_clip_rectangle (s->hdc, NULL); 1710 w32_set_clip_rectangle (s->hdc, NULL);
@@ -1716,7 +1716,7 @@ w32_draw_box_rect (struct glyph_string *s,
1716static void 1716static void
1717w32_draw_glyph_string_box (struct glyph_string *s) 1717w32_draw_glyph_string_box (struct glyph_string *s)
1718{ 1718{
1719 int width, left_x, right_x, top_y, bottom_y, last_x; 1719 int hwidth, vwidth, left_x, right_x, top_y, bottom_y, last_x;
1720 bool left_p, right_p, raised_p; 1720 bool left_p, right_p, raised_p;
1721 struct glyph *last_glyph; 1721 struct glyph *last_glyph;
1722 RECT clip_rect; 1722 RECT clip_rect;
@@ -1730,7 +1730,8 @@ w32_draw_glyph_string_box (struct glyph_string *s)
1730 ? s->first_glyph 1730 ? s->first_glyph
1731 : s->first_glyph + s->nchars - 1); 1731 : s->first_glyph + s->nchars - 1);
1732 1732
1733 width = eabs (s->face->box_line_width); 1733 vwidth = eabs (s->face->box_vertical_line_width);
1734 hwidth = eabs (s->face->box_horizontal_line_width);
1734 raised_p = s->face->box == FACE_RAISED_BOX; 1735 raised_p = s->face->box == FACE_RAISED_BOX;
1735 left_x = s->x; 1736 left_x = s->x;
1736 right_x = ((s->row->full_width_p && s->extends_to_end_of_line_p 1737 right_x = ((s->row->full_width_p && s->extends_to_end_of_line_p
@@ -1751,13 +1752,13 @@ w32_draw_glyph_string_box (struct glyph_string *s)
1751 get_glyph_string_clip_rect (s, &clip_rect); 1752 get_glyph_string_clip_rect (s, &clip_rect);
1752 1753
1753 if (s->face->box == FACE_SIMPLE_BOX) 1754 if (s->face->box == FACE_SIMPLE_BOX)
1754 w32_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width, 1755 w32_draw_box_rect (s, left_x, top_y, right_x, bottom_y, hwidth,
1755 left_p, right_p, &clip_rect); 1756 vwidth, left_p, right_p, &clip_rect);
1756 else 1757 else
1757 { 1758 {
1758 w32_setup_relief_colors (s); 1759 w32_setup_relief_colors (s);
1759 w32_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, 1760 w32_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, hwidth,
1760 width, raised_p, 1, 1, left_p, right_p, &clip_rect); 1761 vwidth, raised_p, 1, 1, left_p, right_p, &clip_rect);
1761 } 1762 }
1762} 1763}
1763 1764
@@ -1795,7 +1796,7 @@ w32_draw_image_foreground (struct glyph_string *s)
1795 if (s->face->box != FACE_NO_BOX 1796 if (s->face->box != FACE_NO_BOX
1796 && s->first_glyph->left_box_line_p 1797 && s->first_glyph->left_box_line_p
1797 && s->slice.x == 0) 1798 && s->slice.x == 0)
1798 x += eabs (s->face->box_line_width); 1799 x += max (s->face->box_vertical_line_width, 0);
1799 1800
1800 /* If there is a margin around the image, adjust x- and y-position 1801 /* If there is a margin around the image, adjust x- and y-position
1801 by that margin. */ 1802 by that margin. */
@@ -1982,7 +1983,7 @@ w32_draw_image_relief (struct glyph_string *s)
1982 if (s->face->box != FACE_NO_BOX 1983 if (s->face->box != FACE_NO_BOX
1983 && s->first_glyph->left_box_line_p 1984 && s->first_glyph->left_box_line_p
1984 && s->slice.x == 0) 1985 && s->slice.x == 0)
1985 x += eabs (s->face->box_line_width); 1986 x += max (s->face->box_vertical_line_width, 0);
1986 1987
1987 /* If there is a margin around the image, adjust x- and y-position 1988 /* If there is a margin around the image, adjust x- and y-position
1988 by that margin. */ 1989 by that margin. */
@@ -2034,7 +2035,7 @@ w32_draw_image_relief (struct glyph_string *s)
2034 2035
2035 w32_setup_relief_colors (s); 2036 w32_setup_relief_colors (s);
2036 get_glyph_string_clip_rect (s, &r); 2037 get_glyph_string_clip_rect (s, &r);
2037 w32_draw_relief_rect (s->f, x, y, x1, y1, thick, raised_p, 2038 w32_draw_relief_rect (s->f, x, y, x1, y1, thick, thick, raised_p,
2038 top_p, bot_p, left_p, right_p, &r); 2039 top_p, bot_p, left_p, right_p, &r);
2039} 2040}
2040 2041
@@ -2054,7 +2055,7 @@ w32_draw_image_foreground_1 (struct glyph_string *s, HBITMAP pixmap)
2054 if (s->face->box != FACE_NO_BOX 2055 if (s->face->box != FACE_NO_BOX
2055 && s->first_glyph->left_box_line_p 2056 && s->first_glyph->left_box_line_p
2056 && s->slice.x == 0) 2057 && s->slice.x == 0)
2057 x += eabs (s->face->box_line_width); 2058 x += max (s->face->box_vertical_line_width, 0);
2058 2059
2059 /* If there is a margin around the image, adjust x- and y-position 2060 /* If there is a margin around the image, adjust x- and y-position
2060 by that margin. */ 2061 by that margin. */
@@ -2167,8 +2168,8 @@ static void
2167w32_draw_image_glyph_string (struct glyph_string *s) 2168w32_draw_image_glyph_string (struct glyph_string *s)
2168{ 2169{
2169 int x, y; 2170 int x, y;
2170 int box_line_hwidth = eabs (s->face->box_line_width); 2171 int box_line_hwidth = max (s->face->box_vertical_line_width, 0);
2171 int box_line_vwidth = max (s->face->box_line_width, 0); 2172 int box_line_vwidth = max (s->face->box_horizontal_line_width, 0);
2172 int height, width; 2173 int height, width;
2173 HBITMAP pixmap = 0; 2174 HBITMAP pixmap = 0;
2174 2175
diff --git a/src/xdisp.c b/src/xdisp.c
index 61c798c59e8..cbdef7ad118 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2061,8 +2061,8 @@ estimate_mode_line_height (struct frame *f, enum face_id face_id)
2061 { 2061 {
2062 if (face->font) 2062 if (face->font)
2063 height = normal_char_height (face->font, -1); 2063 height = normal_char_height (face->font, -1);
2064 if (face->box_line_width > 0) 2064 if (face->box_horizontal_line_width > 0)
2065 height += 2 * face->box_line_width; 2065 height += 2 * face->box_horizontal_line_width;
2066 } 2066 }
2067 } 2067 }
2068 2068
@@ -28900,18 +28900,21 @@ produce_image_glyph (struct it *it)
28900 28900
28901 if (face->box != FACE_NO_BOX) 28901 if (face->box != FACE_NO_BOX)
28902 { 28902 {
28903 if (face->box_line_width > 0) 28903 if (face->box_horizontal_line_width > 0)
28904 { 28904 {
28905 if (slice.y == 0) 28905 if (slice.y == 0)
28906 it->ascent += face->box_line_width; 28906 it->ascent += face->box_horizontal_line_width;
28907 if (slice.y + slice.height == img->height) 28907 if (slice.y + slice.height == img->height)
28908 it->descent += face->box_line_width; 28908 it->descent += face->box_horizontal_line_width;
28909 } 28909 }
28910 28910
28911 if (it->start_of_box_run_p && slice.x == 0) 28911 if (face->box_vertical_line_width > 0)
28912 it->pixel_width += eabs (face->box_line_width); 28912 {
28913 if (it->end_of_box_run_p && slice.x + slice.width == img->width) 28913 if (it->start_of_box_run_p && slice.x == 0)
28914 it->pixel_width += eabs (face->box_line_width); 28914 it->pixel_width += face->box_vertical_line_width;
28915 if (it->end_of_box_run_p && slice.x + slice.width == img->width)
28916 it->pixel_width += face->box_vertical_line_width;
28917 }
28915 } 28918 }
28916 28919
28917 take_vertical_position_into_account (it); 28920 take_vertical_position_into_account (it);
@@ -29009,15 +29012,18 @@ produce_xwidget_glyph (struct it *it)
29009 29012
29010 if (face->box != FACE_NO_BOX) 29013 if (face->box != FACE_NO_BOX)
29011 { 29014 {
29012 if (face->box_line_width > 0) 29015 if (face->box_horizontal_line_width > 0)
29013 { 29016 {
29014 it->ascent += face->box_line_width; 29017 it->ascent += face->box_horizontal_line_width;
29015 it->descent += face->box_line_width; 29018 it->descent += face->box_horizontal_line_width;
29016 } 29019 }
29017 29020
29018 if (it->start_of_box_run_p) 29021 if (face->box_vertical_line_width > 0)
29019 it->pixel_width += eabs (face->box_line_width); 29022 {
29020 it->pixel_width += eabs (face->box_line_width); 29023 if (it->start_of_box_run_p)
29024 it->pixel_width += face->box_vertical_line_width;
29025 it->pixel_width += face->box_vertical_line_width;
29026 }
29021 } 29027 }
29022 29028
29023 take_vertical_position_into_account (it); 29029 take_vertical_position_into_account (it);
@@ -29780,6 +29786,31 @@ produce_glyphless_glyph (struct it *it, bool for_no_font, Lisp_Object acronym)
29780} 29786}
29781 29787
29782 29788
29789/* If face has a box, add the box thickness to the character
29790 height. If character has a box line to the left and/or
29791 right, add the box line width to the character's width. */
29792#define IT_APPLY_FACE_BOX(it, face) \
29793 do { \
29794 if (face->box != FACE_NO_BOX) \
29795 { \
29796 int thick = face->box_horizontal_line_width; \
29797 if (thick > 0) \
29798 { \
29799 it->ascent += thick; \
29800 it->descent += thick; \
29801 } \
29802 \
29803 thick = face->box_vertical_line_width; \
29804 if (thick > 0) \
29805 { \
29806 if (it->start_of_box_run_p) \
29807 it->pixel_width += thick; \
29808 if (it->end_of_box_run_p) \
29809 it->pixel_width += thick; \
29810 } \
29811 } \
29812 } while (false)
29813
29783/* RIF: 29814/* RIF:
29784 Produce glyphs/get display metrics for the display element IT is 29815 Produce glyphs/get display metrics for the display element IT is
29785 loaded with. See the description of struct it in dispextern.h 29816 loaded with. See the description of struct it in dispextern.h
@@ -29895,26 +29926,7 @@ gui_produce_glyphs (struct it *it)
29895 if (stretched_p) 29926 if (stretched_p)
29896 it->pixel_width *= XFLOATINT (it->space_width); 29927 it->pixel_width *= XFLOATINT (it->space_width);
29897 29928
29898 /* If face has a box, add the box thickness to the character 29929 IT_APPLY_FACE_BOX(it, face);
29899 height. If character has a box line to the left and/or
29900 right, add the box line width to the character's width. */
29901 if (face->box != FACE_NO_BOX)
29902 {
29903 int thick = face->box_line_width;
29904
29905 if (thick > 0)
29906 {
29907 it->ascent += thick;
29908 it->descent += thick;
29909 }
29910 else
29911 thick = -thick;
29912
29913 if (it->start_of_box_run_p)
29914 it->pixel_width += thick;
29915 if (it->end_of_box_run_p)
29916 it->pixel_width += thick;
29917 }
29918 29930
29919 /* If face has an overline, add the height of the overline 29931 /* If face has an overline, add the height of the overline
29920 (1 pixel) and a 1 pixel margin to the character height. */ 29932 (1 pixel) and a 1 pixel margin to the character height. */
@@ -30029,10 +30041,10 @@ gui_produce_glyphs (struct it *it)
30029 30041
30030 if ((it->max_ascent > 0 || it->max_descent > 0) 30042 if ((it->max_ascent > 0 || it->max_descent > 0)
30031 && face->box != FACE_NO_BOX 30043 && face->box != FACE_NO_BOX
30032 && face->box_line_width > 0) 30044 && face->box_horizontal_line_width > 0)
30033 { 30045 {
30034 it->ascent += face->box_line_width; 30046 it->ascent += face->box_horizontal_line_width;
30035 it->descent += face->box_line_width; 30047 it->descent += face->box_horizontal_line_width;
30036 } 30048 }
30037 if (!NILP (height) 30049 if (!NILP (height)
30038 && XFIXNUM (height) > it->ascent + it->descent) 30050 && XFIXNUM (height) > it->ascent + it->descent)
@@ -30439,23 +30451,7 @@ gui_produce_glyphs (struct it *it)
30439 it->pixel_width = cmp->pixel_width; 30451 it->pixel_width = cmp->pixel_width;
30440 it->ascent = it->phys_ascent = cmp->ascent; 30452 it->ascent = it->phys_ascent = cmp->ascent;
30441 it->descent = it->phys_descent = cmp->descent; 30453 it->descent = it->phys_descent = cmp->descent;
30442 if (face->box != FACE_NO_BOX) 30454 IT_APPLY_FACE_BOX(it, face);
30443 {
30444 int thick = face->box_line_width;
30445
30446 if (thick > 0)
30447 {
30448 it->ascent += thick;
30449 it->descent += thick;
30450 }
30451 else
30452 thick = - thick;
30453
30454 if (it->start_of_box_run_p)
30455 it->pixel_width += thick;
30456 if (it->end_of_box_run_p)
30457 it->pixel_width += thick;
30458 }
30459 30455
30460 /* If face has an overline, add the height of the overline 30456 /* If face has an overline, add the height of the overline
30461 (1 pixel) and a 1 pixel margin to the character height. */ 30457 (1 pixel) and a 1 pixel margin to the character height. */
@@ -30489,23 +30485,8 @@ gui_produce_glyphs (struct it *it)
30489 it->glyph_row->contains_overlapping_glyphs_p = true; 30485 it->glyph_row->contains_overlapping_glyphs_p = true;
30490 it->ascent = it->phys_ascent = metrics.ascent; 30486 it->ascent = it->phys_ascent = metrics.ascent;
30491 it->descent = it->phys_descent = metrics.descent; 30487 it->descent = it->phys_descent = metrics.descent;
30492 if (face->box != FACE_NO_BOX) 30488 IT_APPLY_FACE_BOX(it, face);
30493 {
30494 int thick = face->box_line_width;
30495 30489
30496 if (thick > 0)
30497 {
30498 it->ascent += thick;
30499 it->descent += thick;
30500 }
30501 else
30502 thick = - thick;
30503
30504 if (it->start_of_box_run_p)
30505 it->pixel_width += thick;
30506 if (it->end_of_box_run_p)
30507 it->pixel_width += thick;
30508 }
30509 /* If face has an overline, add the height of the overline 30490 /* If face has an overline, add the height of the overline
30510 (1 pixel) and a 1 pixel margin to the character height. */ 30491 (1 pixel) and a 1 pixel margin to the character height. */
30511 if (face->overline_p) 30492 if (face->overline_p)
diff --git a/src/xfaces.c b/src/xfaces.c
index 91a7a8533e8..bab142ade0f 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -3128,6 +3128,8 @@ FRAME 0 means change the face on all frames, and change the default
3128 valid_p = XFIXNUM (value) != 0; 3128 valid_p = XFIXNUM (value) != 0;
3129 else if (STRINGP (value)) 3129 else if (STRINGP (value))
3130 valid_p = SCHARS (value) > 0; 3130 valid_p = SCHARS (value) > 0;
3131 else if (CONSP (value) && FIXNUMP (XCAR (value)) && FIXNUMP (XCDR (value)))
3132 valid_p = true;
3131 else if (CONSP (value)) 3133 else if (CONSP (value))
3132 { 3134 {
3133 Lisp_Object tem; 3135 Lisp_Object tem;
@@ -3146,7 +3148,9 @@ FRAME 0 means change the face on all frames, and change the default
3146 3148
3147 if (EQ (k, QCline_width)) 3149 if (EQ (k, QCline_width))
3148 { 3150 {
3149 if (!FIXNUMP (v) || XFIXNUM (v) == 0) 3151 if ((!CONSP(v) || !FIXNUMP (XCAR (v)) || XFIXNUM (XCAR (v)) == 0
3152 || !FIXNUMP (XCDR (v)) || XFIXNUM (XCDR (v)) == 0)
3153 && (!FIXNUMP (v) || XFIXNUM (v) == 0))
3150 break; 3154 break;
3151 } 3155 }
3152 else if (EQ (k, QCcolor)) 3156 else if (EQ (k, QCcolor))
@@ -5815,7 +5819,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]
5815 face->box_color = load_color (f, face, attrs[LFACE_BOX_INDEX], 5819 face->box_color = load_color (f, face, attrs[LFACE_BOX_INDEX],
5816 LFACE_BOX_INDEX); 5820 LFACE_BOX_INDEX);
5817 face->box = FACE_SIMPLE_BOX; 5821 face->box = FACE_SIMPLE_BOX;
5818 face->box_line_width = 1; 5822 face->box_vertical_line_width = face->box_horizontal_line_width = 1;
5819 } 5823 }
5820 else if (FIXNUMP (box)) 5824 else if (FIXNUMP (box))
5821 { 5825 {
@@ -5823,9 +5827,19 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]
5823 face. */ 5827 face. */
5824 eassert (XFIXNUM (box) != 0); 5828 eassert (XFIXNUM (box) != 0);
5825 face->box = FACE_SIMPLE_BOX; 5829 face->box = FACE_SIMPLE_BOX;
5826 face->box_line_width = XFIXNUM (box); 5830 face->box_vertical_line_width = eabs(XFIXNUM (box));
5831 face->box_horizontal_line_width = XFIXNUM (box);
5832 face->box_color = face->foreground;
5833 face->box_color_defaulted_p = true;
5834 }
5835 else if (CONSP (box) && FIXNUMP (XCAR (box)) && FIXNUMP (XCDR (box)))
5836 {
5837 /* `(VWIDTH . HWIDTH)'. */
5838 face->box = FACE_SIMPLE_BOX;
5827 face->box_color = face->foreground; 5839 face->box_color = face->foreground;
5828 face->box_color_defaulted_p = true; 5840 face->box_color_defaulted_p = true;
5841 face->box_vertical_line_width = XFIXNUM (XCAR (box));
5842 face->box_horizontal_line_width = XFIXNUM (XCDR (box));
5829 } 5843 }
5830 else if (CONSP (box)) 5844 else if (CONSP (box))
5831 { 5845 {
@@ -5834,7 +5848,7 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]
5834 face->box = FACE_SIMPLE_BOX; 5848 face->box = FACE_SIMPLE_BOX;
5835 face->box_color = face->foreground; 5849 face->box_color = face->foreground;
5836 face->box_color_defaulted_p = true; 5850 face->box_color_defaulted_p = true;
5837 face->box_line_width = 1; 5851 face->box_vertical_line_width = face->box_horizontal_line_width = 1;
5838 5852
5839 while (CONSP (box)) 5853 while (CONSP (box))
5840 { 5854 {
@@ -5850,8 +5864,14 @@ realize_gui_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]
5850 5864
5851 if (EQ (keyword, QCline_width)) 5865 if (EQ (keyword, QCline_width))
5852 { 5866 {
5853 if (FIXNUMP (value) && XFIXNUM (value) != 0) 5867 if (CONSP (value) && FIXNUMP (XCAR (value)) && FIXNUMP (XCDR (value))) {
5854 face->box_line_width = XFIXNUM (value); 5868 face->box_vertical_line_width = XFIXNUM (XCAR (value));
5869 face->box_horizontal_line_width = XFIXNUM (XCDR (value));
5870 }
5871 else if (FIXNUMP (value) && XFIXNUM (value) != 0) {
5872 face->box_vertical_line_width = eabs (XFIXNUM (value));
5873 face->box_horizontal_line_width = XFIXNUM (value);
5874 }
5855 } 5875 }
5856 else if (EQ (keyword, QCcolor)) 5876 else if (EQ (keyword, QCcolor))
5857 { 5877 {
@@ -6953,10 +6973,13 @@ could define a face `my-mode-default', and then in the mode setup
6953function, do: 6973function, do:
6954 6974
6955 (set (make-local-variable \\='face-remapping-alist) 6975 (set (make-local-variable \\='face-remapping-alist)
6956 \\='((default my-mode-default)))). 6976 (copy-tree \\='((default my-mode-default)))).
6957 6977
6958You probably want to use the face-remap package included in Emacs 6978You probably want to use the face-remap package included in Emacs
6959instead of manipulating face-remapping-alist directly. 6979instead of manipulating face-remapping-alist directly. Note that many
6980of the functions in that package modify the list destructively, so make
6981sure you set it to a fresh value (for instance, use `copy-tree' as in
6982the example above) before modifying.
6960 6983
6961Because Emacs normally only redraws screen areas when the underlying 6984Because Emacs normally only redraws screen areas when the underlying
6962buffer contents change, you may need to call `redraw-display' after 6985buffer contents change, you may need to call `redraw-display' after
diff --git a/src/xterm.c b/src/xterm.c
index d7d992c91b2..fc68c77048f 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1754,7 +1754,7 @@ x_draw_glyph_string_background (struct glyph_string *s, bool force_p)
1754 shouldn't be drawn in the first place. */ 1754 shouldn't be drawn in the first place. */
1755 if (!s->background_filled_p) 1755 if (!s->background_filled_p)
1756 { 1756 {
1757 int box_line_width = max (s->face->box_line_width, 0); 1757 int box_line_width = max (s->face->box_horizontal_line_width, 0);
1758 1758
1759 if (s->stippled_p) 1759 if (s->stippled_p)
1760 { 1760 {
@@ -1799,7 +1799,7 @@ x_draw_glyph_string_foreground (struct glyph_string *s)
1799 of S to the right of that box line. */ 1799 of S to the right of that box line. */
1800 if (s->face->box != FACE_NO_BOX 1800 if (s->face->box != FACE_NO_BOX
1801 && s->first_glyph->left_box_line_p) 1801 && s->first_glyph->left_box_line_p)
1802 x = s->x + eabs (s->face->box_line_width); 1802 x = s->x + max (s->face->box_vertical_line_width, 0);
1803 else 1803 else
1804 x = s->x; 1804 x = s->x;
1805 1805
@@ -1849,7 +1849,7 @@ x_draw_glyph_string_foreground (struct glyph_string *s)
1849 if (!(s->for_overlaps 1849 if (!(s->for_overlaps
1850 || (s->background_filled_p && s->hl != DRAW_CURSOR))) 1850 || (s->background_filled_p && s->hl != DRAW_CURSOR)))
1851 { 1851 {
1852 int box_line_width = max (s->face->box_line_width, 0); 1852 int box_line_width = max (s->face->box_horizontal_line_width, 0);
1853 1853
1854 if (s->stippled_p) 1854 if (s->stippled_p)
1855 { 1855 {
@@ -1893,7 +1893,7 @@ x_draw_composite_glyph_string_foreground (struct glyph_string *s)
1893 of S to the right of that box line. */ 1893 of S to the right of that box line. */
1894 if (s->face && s->face->box != FACE_NO_BOX 1894 if (s->face && s->face->box != FACE_NO_BOX
1895 && s->first_glyph->left_box_line_p) 1895 && s->first_glyph->left_box_line_p)
1896 x = s->x + eabs (s->face->box_line_width); 1896 x = s->x + max (s->face->box_vertical_line_width, 0);
1897 else 1897 else
1898 x = s->x; 1898 x = s->x;
1899 1899
@@ -2004,7 +2004,7 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
2004 of S to the right of that box line. */ 2004 of S to the right of that box line. */
2005 if (s->face && s->face->box != FACE_NO_BOX 2005 if (s->face && s->face->box != FACE_NO_BOX
2006 && s->first_glyph->left_box_line_p) 2006 && s->first_glyph->left_box_line_p)
2007 x = s->x + eabs (s->face->box_line_width); 2007 x = s->x + max (s->face->box_vertical_line_width, 0);
2008 else 2008 else
2009 x = s->x; 2009 x = s->x;
2010 2010
@@ -2769,7 +2769,7 @@ x_setup_relief_colors (struct glyph_string *s)
2769static void 2769static void
2770x_draw_relief_rect (struct frame *f, 2770x_draw_relief_rect (struct frame *f,
2771 int left_x, int top_y, int right_x, int bottom_y, 2771 int left_x, int top_y, int right_x, int bottom_y,
2772 int width, bool raised_p, bool top_p, bool bot_p, 2772 int hwidth, int vwidth, bool raised_p, bool top_p, bool bot_p,
2773 bool left_p, bool right_p, 2773 bool left_p, bool right_p,
2774 XRectangle *clip_rect) 2774 XRectangle *clip_rect)
2775{ 2775{
@@ -2794,7 +2794,7 @@ x_draw_relief_rect (struct frame *f,
2794 if (left_p) 2794 if (left_p)
2795 { 2795 {
2796 x_fill_rectangle (f, top_left_gc, left_x, top_y, 2796 x_fill_rectangle (f, top_left_gc, left_x, top_y,
2797 width, bottom_y + 1 - top_y); 2797 vwidth, bottom_y + 1 - top_y);
2798 if (top_p) 2798 if (top_p)
2799 corners |= 1 << CORNER_TOP_LEFT; 2799 corners |= 1 << CORNER_TOP_LEFT;
2800 if (bot_p) 2800 if (bot_p)
@@ -2802,8 +2802,8 @@ x_draw_relief_rect (struct frame *f,
2802 } 2802 }
2803 if (right_p) 2803 if (right_p)
2804 { 2804 {
2805 x_fill_rectangle (f, bottom_right_gc, right_x + 1 - width, top_y, 2805 x_fill_rectangle (f, bottom_right_gc, right_x + 1 - vwidth, top_y,
2806 width, bottom_y + 1 - top_y); 2806 vwidth, bottom_y + 1 - top_y);
2807 if (top_p) 2807 if (top_p)
2808 corners |= 1 << CORNER_TOP_RIGHT; 2808 corners |= 1 << CORNER_TOP_RIGHT;
2809 if (bot_p) 2809 if (bot_p)
@@ -2813,25 +2813,25 @@ x_draw_relief_rect (struct frame *f,
2813 { 2813 {
2814 if (!right_p) 2814 if (!right_p)
2815 x_fill_rectangle (f, top_left_gc, left_x, top_y, 2815 x_fill_rectangle (f, top_left_gc, left_x, top_y,
2816 right_x + 1 - left_x, width); 2816 right_x + 1 - left_x, hwidth);
2817 else 2817 else
2818 x_fill_trapezoid_for_relief (f, top_left_gc, left_x, top_y, 2818 x_fill_trapezoid_for_relief (f, top_left_gc, left_x, top_y,
2819 right_x + 1 - left_x, width, 1); 2819 right_x + 1 - left_x, hwidth, 1);
2820 } 2820 }
2821 if (bot_p) 2821 if (bot_p)
2822 { 2822 {
2823 if (!left_p) 2823 if (!left_p)
2824 x_fill_rectangle (f, bottom_right_gc, left_x, bottom_y + 1 - width, 2824 x_fill_rectangle (f, bottom_right_gc, left_x, bottom_y + 1 - hwidth,
2825 right_x + 1 - left_x, width); 2825 right_x + 1 - left_x, hwidth);
2826 else 2826 else
2827 x_fill_trapezoid_for_relief (f, bottom_right_gc, 2827 x_fill_trapezoid_for_relief (f, bottom_right_gc,
2828 left_x, bottom_y + 1 - width, 2828 left_x, bottom_y + 1 - hwidth,
2829 right_x + 1 - left_x, width, 0); 2829 right_x + 1 - left_x, hwidth, 0);
2830 } 2830 }
2831 if (left_p && width != 1) 2831 if (left_p && vwidth > 1)
2832 x_fill_rectangle (f, bottom_right_gc, left_x, top_y, 2832 x_fill_rectangle (f, bottom_right_gc, left_x, top_y,
2833 1, bottom_y + 1 - top_y); 2833 1, bottom_y + 1 - top_y);
2834 if (top_p && width != 1) 2834 if (top_p && hwidth > 1)
2835 x_fill_rectangle (f, bottom_right_gc, left_x, top_y, 2835 x_fill_rectangle (f, bottom_right_gc, left_x, top_y,
2836 right_x + 1 - left_x, 1); 2836 right_x + 1 - left_x, 1);
2837 if (corners) 2837 if (corners)
@@ -2865,12 +2865,12 @@ x_draw_relief_rect (struct frame *f,
2865 /* Top. */ 2865 /* Top. */
2866 if (top_p) 2866 if (top_p)
2867 { 2867 {
2868 if (width == 1) 2868 if (hwidth == 1)
2869 XDrawLine (dpy, drawable, gc, 2869 XDrawLine (dpy, drawable, gc,
2870 left_x + left_p, top_y, 2870 left_x + left_p, top_y,
2871 right_x + !right_p, top_y); 2871 right_x + !right_p, top_y);
2872 2872
2873 for (i = 1; i < width; ++i) 2873 for (i = 1; i < hwidth; ++i)
2874 XDrawLine (dpy, drawable, gc, 2874 XDrawLine (dpy, drawable, gc,
2875 left_x + i * left_p, top_y + i, 2875 left_x + i * left_p, top_y + i,
2876 right_x + 1 - i * right_p, top_y + i); 2876 right_x + 1 - i * right_p, top_y + i);
@@ -2879,13 +2879,10 @@ x_draw_relief_rect (struct frame *f,
2879 /* Left. */ 2879 /* Left. */
2880 if (left_p) 2880 if (left_p)
2881 { 2881 {
2882 if (width == 1) 2882 if (vwidth == 1)
2883 XDrawLine (dpy, drawable, gc, left_x, top_y + 1, left_x, bottom_y); 2883 XDrawLine (dpy, drawable, gc, left_x, top_y + 1, left_x, bottom_y);
2884 2884
2885 x_clear_area(f, left_x, top_y, 1, 1); 2885 for (i = 1; i < vwidth; ++i)
2886 x_clear_area(f, left_x, bottom_y, 1, 1);
2887
2888 for (i = (width > 1 ? 1 : 0); i < width; ++i)
2889 XDrawLine (dpy, drawable, gc, 2886 XDrawLine (dpy, drawable, gc,
2890 left_x + i, top_y + (i + 1) * top_p, 2887 left_x + i, top_y + (i + 1) * top_p,
2891 left_x + i, bottom_y + 1 - (i + 1) * bot_p); 2888 left_x + i, bottom_y + 1 - (i + 1) * bot_p);
@@ -2898,26 +2895,25 @@ x_draw_relief_rect (struct frame *f,
2898 gc = f->output_data.x->white_relief.gc; 2895 gc = f->output_data.x->white_relief.gc;
2899 XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted); 2896 XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted);
2900 2897
2901 if (width > 1) 2898 /* Outermost top line. */
2902 { 2899 if (top_p && hwidth > 1)
2903 /* Outermost top line. */ 2900 XDrawLine (dpy, drawable, gc,
2904 if (top_p) 2901 left_x + left_p, top_y,
2905 XDrawLine (dpy, drawable, gc, 2902 right_x + !right_p, top_y);
2906 left_x + left_p, top_y,
2907 right_x + !right_p, top_y);
2908 2903
2909 /* Outermost left line. */ 2904 /* Outermost left line. */
2910 if (left_p) 2905 if (left_p && vwidth > 1)
2911 XDrawLine (dpy, drawable, gc, left_x, top_y + 1, left_x, bottom_y); 2906 XDrawLine (dpy, drawable, gc, left_x, top_y + 1, left_x, bottom_y);
2912 }
2913 2907
2914 /* Bottom. */ 2908 /* Bottom. */
2915 if (bot_p) 2909 if (bot_p)
2916 { 2910 {
2917 XDrawLine (dpy, drawable, gc, 2911 if (hwidth >= 1)
2918 left_x + left_p, bottom_y, 2912 XDrawLine (dpy, drawable, gc,
2919 right_x + !right_p, bottom_y); 2913 left_x + left_p, bottom_y,
2920 for (i = 1; i < width; ++i) 2914 right_x + !right_p, bottom_y);
2915
2916 for (i = 1; i < hwidth; ++i)
2921 XDrawLine (dpy, drawable, gc, 2917 XDrawLine (dpy, drawable, gc,
2922 left_x + i * left_p, bottom_y - i, 2918 left_x + i * left_p, bottom_y - i,
2923 right_x + 1 - i * right_p, bottom_y - i); 2919 right_x + 1 - i * right_p, bottom_y - i);
@@ -2926,9 +2922,7 @@ x_draw_relief_rect (struct frame *f,
2926 /* Right. */ 2922 /* Right. */
2927 if (right_p) 2923 if (right_p)
2928 { 2924 {
2929 x_clear_area(f, right_x, top_y, 1, 1); 2925 for (i = 0; i < vwidth; ++i)
2930 x_clear_area(f, right_x, bottom_y, 1, 1);
2931 for (i = 0; i < width; ++i)
2932 XDrawLine (dpy, drawable, gc, 2926 XDrawLine (dpy, drawable, gc,
2933 right_x - i, top_y + (i + 1) * top_p, 2927 right_x - i, top_y + (i + 1) * top_p,
2934 right_x - i, bottom_y + 1 - (i + 1) * bot_p); 2928 right_x - i, bottom_y + 1 - (i + 1) * bot_p);
@@ -2949,8 +2943,8 @@ x_draw_relief_rect (struct frame *f,
2949 2943
2950static void 2944static void
2951x_draw_box_rect (struct glyph_string *s, 2945x_draw_box_rect (struct glyph_string *s,
2952 int left_x, int top_y, int right_x, int bottom_y, int width, 2946 int left_x, int top_y, int right_x, int bottom_y, int hwidth,
2953 bool left_p, bool right_p, XRectangle *clip_rect) 2947 int vwidth, bool left_p, bool right_p, XRectangle *clip_rect)
2954{ 2948{
2955 Display *display = FRAME_X_DISPLAY (s->f); 2949 Display *display = FRAME_X_DISPLAY (s->f);
2956 XGCValues xgcv; 2950 XGCValues xgcv;
@@ -2961,21 +2955,21 @@ x_draw_box_rect (struct glyph_string *s,
2961 2955
2962 /* Top. */ 2956 /* Top. */
2963 x_fill_rectangle (s->f, s->gc, 2957 x_fill_rectangle (s->f, s->gc,
2964 left_x, top_y, right_x - left_x + 1, width); 2958 left_x, top_y, right_x - left_x + 1, hwidth);
2965 2959
2966 /* Left. */ 2960 /* Left. */
2967 if (left_p) 2961 if (left_p)
2968 x_fill_rectangle (s->f, s->gc, 2962 x_fill_rectangle (s->f, s->gc,
2969 left_x, top_y, width, bottom_y - top_y + 1); 2963 left_x, top_y, vwidth, bottom_y - top_y + 1);
2970 2964
2971 /* Bottom. */ 2965 /* Bottom. */
2972 x_fill_rectangle (s->f, s->gc, 2966 x_fill_rectangle (s->f, s->gc,
2973 left_x, bottom_y - width + 1, right_x - left_x + 1, width); 2967 left_x, bottom_y - hwidth + 1, right_x - left_x + 1, hwidth);
2974 2968
2975 /* Right. */ 2969 /* Right. */
2976 if (right_p) 2970 if (right_p)
2977 x_fill_rectangle (s->f, s->gc, 2971 x_fill_rectangle (s->f, s->gc,
2978 right_x - width + 1, top_y, width, bottom_y - top_y + 1); 2972 right_x - vwidth + 1, top_y, vwidth, bottom_y - top_y + 1);
2979 2973
2980 XSetForeground (display, s->gc, xgcv.foreground); 2974 XSetForeground (display, s->gc, xgcv.foreground);
2981 x_reset_clip_rectangles (s->f, s->gc); 2975 x_reset_clip_rectangles (s->f, s->gc);
@@ -2987,7 +2981,7 @@ x_draw_box_rect (struct glyph_string *s,
2987static void 2981static void
2988x_draw_glyph_string_box (struct glyph_string *s) 2982x_draw_glyph_string_box (struct glyph_string *s)
2989{ 2983{
2990 int width, left_x, right_x, top_y, bottom_y, last_x; 2984 int hwidth, vwidth, left_x, right_x, top_y, bottom_y, last_x;
2991 bool raised_p, left_p, right_p; 2985 bool raised_p, left_p, right_p;
2992 struct glyph *last_glyph; 2986 struct glyph *last_glyph;
2993 XRectangle clip_rect; 2987 XRectangle clip_rect;
@@ -3001,7 +2995,8 @@ x_draw_glyph_string_box (struct glyph_string *s)
3001 ? s->first_glyph 2995 ? s->first_glyph
3002 : s->first_glyph + s->nchars - 1); 2996 : s->first_glyph + s->nchars - 1);
3003 2997
3004 width = eabs (s->face->box_line_width); 2998 vwidth = eabs (s->face->box_vertical_line_width);
2999 hwidth = eabs (s->face->box_horizontal_line_width);
3005 raised_p = s->face->box == FACE_RAISED_BOX; 3000 raised_p = s->face->box == FACE_RAISED_BOX;
3006 left_x = s->x; 3001 left_x = s->x;
3007 right_x = (s->row->full_width_p && s->extends_to_end_of_line_p 3002 right_x = (s->row->full_width_p && s->extends_to_end_of_line_p
@@ -3022,13 +3017,13 @@ x_draw_glyph_string_box (struct glyph_string *s)
3022 get_glyph_string_clip_rect (s, &clip_rect); 3017 get_glyph_string_clip_rect (s, &clip_rect);
3023 3018
3024 if (s->face->box == FACE_SIMPLE_BOX) 3019 if (s->face->box == FACE_SIMPLE_BOX)
3025 x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width, 3020 x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, hwidth,
3026 left_p, right_p, &clip_rect); 3021 vwidth, left_p, right_p, &clip_rect);
3027 else 3022 else
3028 { 3023 {
3029 x_setup_relief_colors (s); 3024 x_setup_relief_colors (s);
3030 x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, 3025 x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, hwidth,
3031 width, raised_p, true, true, left_p, right_p, 3026 vwidth, raised_p, true, true, left_p, right_p,
3032 &clip_rect); 3027 &clip_rect);
3033 } 3028 }
3034} 3029}
@@ -3086,7 +3081,7 @@ x_draw_image_foreground (struct glyph_string *s)
3086 if (s->face->box != FACE_NO_BOX 3081 if (s->face->box != FACE_NO_BOX
3087 && s->first_glyph->left_box_line_p 3082 && s->first_glyph->left_box_line_p
3088 && s->slice.x == 0) 3083 && s->slice.x == 0)
3089 x += eabs (s->face->box_line_width); 3084 x += max (s->face->box_vertical_line_width, 0);
3090 3085
3091 /* If there is a margin around the image, adjust x- and y-position 3086 /* If there is a margin around the image, adjust x- and y-position
3092 by that margin. */ 3087 by that margin. */
@@ -3205,7 +3200,7 @@ x_draw_image_relief (struct glyph_string *s)
3205 if (s->face->box != FACE_NO_BOX 3200 if (s->face->box != FACE_NO_BOX
3206 && s->first_glyph->left_box_line_p 3201 && s->first_glyph->left_box_line_p
3207 && s->slice.x == 0) 3202 && s->slice.x == 0)
3208 x += eabs (s->face->box_line_width); 3203 x += max (s->face->box_vertical_line_width, 0);
3209 3204
3210 /* If there is a margin around the image, adjust x- and y-position 3205 /* If there is a margin around the image, adjust x- and y-position
3211 by that margin. */ 3206 by that margin. */
@@ -3273,7 +3268,7 @@ x_draw_image_relief (struct glyph_string *s)
3273 3268
3274 x_setup_relief_colors (s); 3269 x_setup_relief_colors (s);
3275 get_glyph_string_clip_rect (s, &r); 3270 get_glyph_string_clip_rect (s, &r);
3276 x_draw_relief_rect (s->f, x, y, x1, y1, thick, raised_p, 3271 x_draw_relief_rect (s->f, x, y, x1, y1, thick, thick, raised_p,
3277 top_p, bot_p, left_p, right_p, &r); 3272 top_p, bot_p, left_p, right_p, &r);
3278} 3273}
3279 3274
@@ -3292,7 +3287,7 @@ x_draw_image_foreground_1 (struct glyph_string *s, Pixmap pixmap)
3292 if (s->face->box != FACE_NO_BOX 3287 if (s->face->box != FACE_NO_BOX
3293 && s->first_glyph->left_box_line_p 3288 && s->first_glyph->left_box_line_p
3294 && s->slice.x == 0) 3289 && s->slice.x == 0)
3295 x += eabs (s->face->box_line_width); 3290 x += max (s->face->box_vertical_line_width, 0);
3296 3291
3297 /* If there is a margin around the image, adjust x- and y-position 3292 /* If there is a margin around the image, adjust x- and y-position
3298 by that margin. */ 3293 by that margin. */
@@ -3394,8 +3389,8 @@ x_draw_glyph_string_bg_rect (struct glyph_string *s, int x, int y, int w, int h)
3394static void 3389static void
3395x_draw_image_glyph_string (struct glyph_string *s) 3390x_draw_image_glyph_string (struct glyph_string *s)
3396{ 3391{
3397 int box_line_hwidth = eabs (s->face->box_line_width); 3392 int box_line_hwidth = max (s->face->box_vertical_line_width, 0);
3398 int box_line_vwidth = max (s->face->box_line_width, 0); 3393 int box_line_vwidth = max (s->face->box_horizontal_line_width, 0);
3399 int height; 3394 int height;
3400#ifndef USE_CAIRO 3395#ifndef USE_CAIRO
3401 Display *display = FRAME_X_DISPLAY (s->f); 3396 Display *display = FRAME_X_DISPLAY (s->f);
diff --git a/test/lisp/calc/calc-tests.el b/test/lisp/calc/calc-tests.el
index 784b404898a..6db5426ff6d 100644
--- a/test/lisp/calc/calc-tests.el
+++ b/test/lisp/calc/calc-tests.el
@@ -334,6 +334,17 @@ An existing calc stack is reused, otherwise a new one is created."
334 (should (equal tos '(- (* 2 (var x var-x)) 4))) 334 (should (equal tos '(- (* 2 (var x var-x)) 4)))
335 (should (equal trail "pdiv 2 * x - 4\nprem 8 * x + 1\n")))))) 335 (should (equal trail "pdiv 2 * x - 4\nprem 8 * x + 1\n"))))))
336 336
337(ert-deftest calc-Math-integerp ()
338 (should (Math-integerp -7))
339 (should (Math-integerp (ash 1 65)))
340 (should-not (Math-integerp '(float 1 0)))
341 (should-not (Math-integerp nil))
342
343 (should (Math-num-integerp -7))
344 (should (Math-num-integerp (ash 1 65)))
345 (should (Math-num-integerp '(float 1 0)))
346 (should-not (Math-num-integerp nil)))
347
337(provide 'calc-tests) 348(provide 'calc-tests)
338;;; calc-tests.el ends here 349;;; calc-tests.el ends here
339 350
diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el
index 026818ab067..ce8d728833d 100644
--- a/test/lisp/eshell/eshell-tests.el
+++ b/test/lisp/eshell/eshell-tests.el
@@ -169,6 +169,13 @@ e.g. \"{(+ 1 2)} 3\" => 3"
169 (eshell-command-result-p "+ 1 2; + $_ 4" 169 (eshell-command-result-p "+ 1 2; + $_ 4"
170 "3\n6\n"))) 170 "3\n6\n")))
171 171
172(ert-deftest eshell-test/inside-emacs-var ()
173 "Test presence of \"INSIDE_EMACS\" in subprocesses"
174 (with-temp-eshell
175 (eshell-command-result-p "env"
176 (format "INSIDE_EMACS=%s,eshell"
177 emacs-version))))
178
172(ert-deftest eshell-test/escape-nonspecial () 179(ert-deftest eshell-test/escape-nonspecial ()
173 "Test that \"\\c\" and \"c\" are equivalent when \"c\" is not a 180 "Test that \"\\c\" and \"c\" are equivalent when \"c\" is not a
174special character." 181special character."
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index e6c6b28c58a..77222197802 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -4252,6 +4252,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4252 4252
4253(ert-deftest tramp-test29-start-file-process () 4253(ert-deftest tramp-test29-start-file-process ()
4254 "Check `start-file-process'." 4254 "Check `start-file-process'."
4255 :expected-result (if (getenv "EMACS_HYDRA_CI") :failed :passed)
4255 :tags '(:expensive-test) 4256 :tags '(:expensive-test)
4256 (skip-unless (tramp--test-enabled)) 4257 (skip-unless (tramp--test-enabled))
4257 (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p))) 4258 (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
@@ -4325,12 +4326,14 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4325 4326
4326(ert-deftest tramp-test30-make-process () 4327(ert-deftest tramp-test30-make-process ()
4327 "Check `make-process'." 4328 "Check `make-process'."
4329 :expected-result (if (getenv "EMACS_HYDRA_CI") :failed :passed)
4328 :tags '(:expensive-test) 4330 :tags '(:expensive-test)
4329 (skip-unless (tramp--test-enabled)) 4331 (skip-unless (tramp--test-enabled))
4330 (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p))) 4332 (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
4331 ;; `make-process' supports file name handlers since Emacs 27. 4333 ;; `make-process' supports file name handlers since Emacs 27.
4332 (skip-unless (tramp--test-emacs27-p)) 4334 (skip-unless (tramp--test-emacs27-p))
4333 4335
4336 (tramp--test-instrument-test-case 10
4334 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil))) 4337 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
4335 (let ((default-directory tramp-test-temporary-file-directory) 4338 (let ((default-directory tramp-test-temporary-file-directory)
4336 (tmp-name1 (tramp--test-make-temp-name nil quoted)) 4339 (tmp-name1 (tramp--test-make-temp-name nil quoted))
@@ -4491,7 +4494,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4491 4494
4492 ;; Cleanup. 4495 ;; Cleanup.
4493 (ignore-errors (delete-process proc)) 4496 (ignore-errors (delete-process proc))
4494 (ignore-errors (delete-file tmpfile))))))) 4497 (ignore-errors (delete-file tmpfile))))))))
4495 4498
4496(ert-deftest tramp-test31-interrupt-process () 4499(ert-deftest tramp-test31-interrupt-process ()
4497 "Check `interrupt-process'." 4500 "Check `interrupt-process'."
@@ -4741,6 +4744,7 @@ INPUT, if non-nil, is a string sent to the process."
4741;; This test is inspired by Bug#23952. 4744;; This test is inspired by Bug#23952.
4742(ert-deftest tramp-test33-environment-variables () 4745(ert-deftest tramp-test33-environment-variables ()
4743 "Check that remote processes set / unset environment variables properly." 4746 "Check that remote processes set / unset environment variables properly."
4747 :expected-result (if (getenv "EMACS_HYDRA_CI") :failed :passed)
4744 :tags '(:expensive-test) 4748 :tags '(:expensive-test)
4745 (skip-unless (tramp--test-enabled)) 4749 (skip-unless (tramp--test-enabled))
4746 (skip-unless (tramp--test-sh-p)) 4750 (skip-unless (tramp--test-sh-p))
diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el
index 75962566f14..cd736497e66 100644
--- a/test/lisp/progmodes/compile-tests.el
+++ b/test/lisp/progmodes/compile-tests.el
@@ -176,6 +176,9 @@
176 13 nil 217 "../src/Lib/System.cpp") 176 13 nil 217 "../src/Lib/System.cpp")
177 ("==1332== by 0x8008621: main (vtest.c:180)" 177 ("==1332== by 0x8008621: main (vtest.c:180)"
178 13 nil 180 "vtest.c") 178 13 nil 180 "vtest.c")
179 ;; javac
180 ("/src/Test.java:5: ';' expected\n foo foo\n ^\n" 1 15 5 "/src/Test.java" 2)
181 ("e:\\src\\Test.java:7: warning: ';' expected\n foo foo\n ^\n" 1 10 7 "e:\\src\\Test.java" 1)
179 ;; jikes-file jikes-line 182 ;; jikes-file jikes-line
180 ("Found 2 semantic errors compiling \"../javax/swing/BorderFactory.java\":" 183 ("Found 2 semantic errors compiling \"../javax/swing/BorderFactory.java\":"
181 1 nil nil "../javax/swing/BorderFactory.java") 184 1 nil nil "../javax/swing/BorderFactory.java")
@@ -431,8 +434,8 @@ The test data is in `compile-tests--test-regexps-data'."
431 (compilation-num-warnings-found 0) 434 (compilation-num-warnings-found 0)
432 (compilation-num-infos-found 0)) 435 (compilation-num-infos-found 0))
433 (mapc #'compile--test-error-line compile-tests--test-regexps-data) 436 (mapc #'compile--test-error-line compile-tests--test-regexps-data)
434 (should (eq compilation-num-errors-found 93)) 437 (should (eq compilation-num-errors-found 94))
435 (should (eq compilation-num-warnings-found 36)) 438 (should (eq compilation-num-warnings-found 37))
436 (should (eq compilation-num-infos-found 26))))) 439 (should (eq compilation-num-infos-found 26)))))
437 440
438(ert-deftest compile-test-grep-regexps () 441(ert-deftest compile-test-grep-regexps ()