aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2016-08-22 14:38:49 -0700
committerPaul Eggert2016-08-22 14:38:49 -0700
commit590dab5a68f4283d53ce79d4633fe1503131baea (patch)
tree2e2452d22d54826cb84e2c5dc976abbb2ed40322
parentcaa2770d1d79f9c8013d6dddcd9e86d05230b26d (diff)
parent8c2946e29b38fa3e0dff6b4d402ba0fda0e03c9b (diff)
downloademacs-590dab5a68f4283d53ce79d4633fe1503131baea.tar.gz
emacs-590dab5a68f4283d53ce79d4633fe1503131baea.zip
Merge from origin/emacs-25
8c2946e In NEWS describe new handling of window margins (Bug#24193) 0cee66c Facultatively ignore margins when splitting and resizing wind... 8d68147 Document CATEGORY arg to modify-category-entry 8342e74 Document char-script-table's effect on word motion e9ff485 Further fix for 'url-http-create-request' and multibyte strings 0695235 Fix docstring of eval-expression 98b01dd Clarify when 'cursor' property is in effect 75f1882 Convert the remaining strings to unibyte before concatenating d2db5dd Fix bug with handling the bidi cache ccd0e92 * doc/lispref/text.texi (Change Hooks): Minor copyedits. f785ff4 Clarify documentation of before/after-change-functions 3c9cb57 Document use of vectors in keymaps # Conflicts: # src/xdisp.c
-rw-r--r--doc/lispref/keymaps.texi17
-rw-r--r--doc/lispref/positions.texi17
-rw-r--r--doc/lispref/text.texi57
-rw-r--r--doc/lispref/windows.texi21
-rw-r--r--etc/NEWS8
-rw-r--r--lisp/simple.el12
-rw-r--r--lisp/url/url-http.el14
-rw-r--r--lisp/window.el25
-rw-r--r--src/category.c2
9 files changed, 125 insertions, 48 deletions
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi
index 35d9d0c9654..29f2c422cb2 100644
--- a/doc/lispref/keymaps.texi
+++ b/doc/lispref/keymaps.texi
@@ -194,10 +194,19 @@ explicitly bound to @code{nil} (see below).
194@item @var{char-table} 194@item @var{char-table}
195If an element of a keymap is a char-table, it counts as holding 195If an element of a keymap is a char-table, it counts as holding
196bindings for all character events with no modifier bits 196bindings for all character events with no modifier bits
197(@pxref{modifier bits}): element @var{n} is the binding for the 197(@pxref{modifier bits}): the element whose index is @var{c} is the
198character with code @var{n}. This is a compact way to record lots of 198binding for the character @var{c}. This is a compact way to record
199bindings. A keymap with such a char-table is called a @dfn{full 199lots of bindings. A keymap with such a char-table is called a
200keymap}. Other keymaps are called @dfn{sparse keymaps}. 200@dfn{full keymap}. Other keymaps are called @dfn{sparse keymaps}.
201
202@item @var{vector}
203This kind of element is similar to a char-table: the element whose
204index is @var{c} is the binding for the character @var{c}. Since the
205range of characters that can be bound this way is limited by the
206vector size, and vector creation allocates space for all character
207codes from 0 up, this format should not be used except for creating
208menu keymaps (@pxref{Menu Keymaps}), where the bindings themselves
209don't matter.
201 210
202@item @var{string} 211@item @var{string}
203@cindex keymap prompt string 212@cindex keymap prompt string
diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi
index 796a06615ae..a56ab5ef307 100644
--- a/doc/lispref/positions.texi
+++ b/doc/lispref/positions.texi
@@ -192,8 +192,9 @@ in the opposite direction.
192@subsection Motion by Words 192@subsection Motion by Words
193 193
194 The functions for parsing words described below use the syntax table 194 The functions for parsing words described below use the syntax table
195to decide whether a given character is part of a word. @xref{Syntax 195and @code{char-script-table} to decide whether a given character is
196Tables}. 196part of a word. @xref{Syntax Tables}, and see @ref{Character
197Properties}.
197 198
198@deffn Command forward-word &optional count 199@deffn Command forward-word &optional count
199This function moves point forward @var{count} words (or backward if 200This function moves point forward @var{count} words (or backward if
@@ -207,11 +208,13 @@ and then continue moving until the word ends. By default, characters
207that begin and end words, known as @dfn{word boundaries}, are defined 208that begin and end words, known as @dfn{word boundaries}, are defined
208by the current buffer's syntax table (@pxref{Syntax Class Table}), but 209by the current buffer's syntax table (@pxref{Syntax Class Table}), but
209modes can override that by setting up a suitable 210modes can override that by setting up a suitable
210@code{find-word-boundary-function-table}, described below. In any 211@code{find-word-boundary-function-table}, described below. Characters
211case, this function cannot move point past the boundary of the 212that belong to different scripts (as defined by
212accessible portion of the buffer, or across a field boundary 213@code{char-syntax-table}), also define a word boundary
213(@pxref{Fields}). The most common case of a field boundary is the end 214(@pxref{Character Properties}). In any case, this function cannot
214of the prompt in the minibuffer. 215move point past the boundary of the accessible portion of the buffer,
216or across a field boundary (@pxref{Fields}). The most common case of
217a field boundary is the end of the prompt in the minibuffer.
215 218
216If it is possible to move @var{count} words, without being stopped 219If it is possible to move @var{count} words, without being stopped
217prematurely by the buffer boundary or a field boundary, the value is 220prematurely by the buffer boundary or a field boundary, the value is
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 4dc943f868b..213eec9d3c8 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -3439,12 +3439,14 @@ the beginning of the @code{display} property or at
3439 3439
3440@cindex cursor position for @code{display} properties and overlays 3440@cindex cursor position for @code{display} properties and overlays
3441When the buffer has many overlay strings (e.g., @pxref{Overlay 3441When the buffer has many overlay strings (e.g., @pxref{Overlay
3442Properties, before-string}) or @code{display} properties that are 3442Properties, before-string}) that conceal some of the buffer text or
3443strings, it is a good idea to use the @code{cursor} property on these 3443@code{display} properties that are strings, it is a good idea to use
3444strings to cue the Emacs display about the places where to put the 3444the @code{cursor} property on these strings to cue the Emacs display
3445cursor while traversing these strings. This directly communicates to 3445about the places where to put the cursor while traversing these
3446the display engine where the Lisp program wants to put the cursor, or 3446strings. This directly communicates to the display engine where the
3447where the user would expect the cursor. 3447Lisp program wants to put the cursor, or where the user would expect
3448the cursor, when point is located on some buffer position that is
3449``covered'' by the display or overlay string.
3448 3450
3449@item pointer 3451@item pointer
3450@kindex pointer @r{(text property)} 3452@kindex pointer @r{(text property)}
@@ -4770,10 +4772,10 @@ group you start for any given buffer should be the last one finished.
4770@cindex change hooks 4772@cindex change hooks
4771@cindex hooks for text changes 4773@cindex hooks for text changes
4772 4774
4773 These hook variables let you arrange to take notice of all changes in 4775 These hook variables let you arrange to take notice of changes in
4774all buffers (or in a particular buffer, if you make them buffer-local). 4776buffers (or in a particular buffer, if you make them buffer-local).
4775See also @ref{Special Properties}, for how to detect changes to specific 4777See also @ref{Special Properties}, for how to detect changes to
4776parts of the text. 4778specific parts of the text.
4777 4779
4778 The functions you use in these hooks should save and restore the match 4780 The functions you use in these hooks should save and restore the match
4779data if they do anything that uses regular expressions; otherwise, they 4781data if they do anything that uses regular expressions; otherwise, they
@@ -4781,18 +4783,20 @@ will interfere in bizarre ways with the editing operations that call
4781them. 4783them.
4782 4784
4783@defvar before-change-functions 4785@defvar before-change-functions
4784This variable holds a list of functions to call before any buffer 4786This variable holds a list of functions to call when Emacs is about to
4785modification. Each function gets two arguments, the beginning and end 4787modify a buffer. Each function gets two arguments, the beginning and
4786of the region that is about to change, represented as integers. The 4788end of the region that is about to change, represented as integers.
4787buffer that is about to change is always the current buffer. 4789The buffer that is about to change is always the current buffer when
4790the function is called.
4788@end defvar 4791@end defvar
4789 4792
4790@defvar after-change-functions 4793@defvar after-change-functions
4791This variable holds a list of functions to call after any buffer 4794This variable holds a list of functions to call after Emacs modifies a
4792modification. Each function receives three arguments: the beginning 4795buffer. Each function receives three arguments: the beginning and end
4793and end of the region just changed, and the length of the text that 4796of the region just changed, and the length of the text that existed
4794existed before the change. All three arguments are integers. The 4797before the change. All three arguments are integers. The buffer that
4795buffer that has been changed is always the current buffer. 4798has been changed is always the current buffer when the function is
4799called.
4796 4800
4797The length of the old text is the difference between the buffer 4801The length of the old text is the difference between the buffer
4798positions before and after that text as it was before the change. As 4802positions before and after that text as it was before the change. As
@@ -4800,8 +4804,19 @@ for the changed text, its length is simply the difference between the
4800first two arguments. 4804first two arguments.
4801@end defvar 4805@end defvar
4802 4806
4803 Output of messages into the @file{*Messages*} buffer does not 4807 Output of messages into the @file{*Messages*} buffer does not call
4804call these functions. 4808these functions, and neither do certain internal buffer changes, such
4809as changes in buffers created by Emacs internally for certain jobs,
4810that should not be visible to Lisp programs.
4811
4812 Do @emph{not} expect the before-change hooks and the after-change
4813hooks be called in balanced pairs around each buffer change. Also
4814don't expect the before-change hooks to be called for every chunk of
4815text Emacs is about to delete. These hooks are provided on the
4816assumption that Lisp programs will use either before- or the
4817after-change hooks, but not both, and the boundaries of the region
4818where the changes happen might include more than just the actual
4819changed text, or even lump together several changes done piecemeal.
4805 4820
4806@defmac combine-after-change-calls body@dots{} 4821@defmac combine-after-change-calls body@dots{}
4807The macro executes @var{body} normally, but arranges to call the 4822The macro executes @var{body} normally, but arranges to call the
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 7a5d1bbf166..b2b57642434 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -4386,6 +4386,27 @@ window when it deletes the window passed to it as argument.
4386The fourth element is the buffer whose display caused the creation of 4386The fourth element is the buffer whose display caused the creation of
4387this parameter. @code{quit-restore-window} deletes the specified window 4387this parameter. @code{quit-restore-window} deletes the specified window
4388only if it still shows that buffer. 4388only if it still shows that buffer.
4389
4390@item @code{min-margins}
4391The value of this parameter is a cons cell whose @sc{car} and @sc{cdr},
4392if non-@code{nil}, specify the minimum values (in columns) for the left
4393and right margin of this window. When present, Emacs will use these
4394values instead of the actual margin widths for determining whether a
4395window can be split or shrunk horizontally.
4396
4397Emacs never auto-adjusts the margins of any window after splitting or
4398resizing it. It is sole responsibility of the application that has set
4399this parameter to adjust the margins of this window as well as those of
4400any new window that inherits this window's margins due to a split.
4401Both, @code{window-configuration-change-hook} and
4402@code{window-size-change-functions} (@pxref{Window Hooks}), should be
4403employed for this purpose.
4404
4405This parameter was introduced in Emacs version 25.1 to support
4406applications that use large margins to center buffer text within a
4407window and should be used, with due care, exclusively by those
4408applications. It might be replaced by an improved solution in future
4409versions of Emacs.
4389@end table 4410@end table
4390 4411
4391There are additional parameters @code{window-atom} and @code{window-side}; 4412There are additional parameters @code{window-atom} and @code{window-side};
diff --git a/etc/NEWS b/etc/NEWS
index 0c561ccc511..1c3c036fbbe 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2215,6 +2215,14 @@ frames.
2215'window-divider-default-places', 'window-divider-default-bottom-width' 2215'window-divider-default-places', 'window-divider-default-bottom-width'
2216and 'window-divider-default-right-width'. 2216and 'window-divider-default-right-width'.
2217 2217
2218*** When a window is shrunk horizontally its margins are no more removed
2219automatically. Rather, Emacs refuses to split or resize windows when
2220this would cause margins to no more fit into the width reserved for the
2221corresponding window. An application can override this behavior for a
2222particular window by setting that window's 'min-margins' parameter. As
2223a consequence, the application becomes fully responsible for trimming
2224the margin sizes of that window and any window inheriting these margins.
2225
2218*** The window displaying the '*Completions*' buffer with minibuffer 2226*** The window displaying the '*Completions*' buffer with minibuffer
2219completion candidates is now shown at the bottom of the selected 2227completion candidates is now shown at the bottom of the selected
2220frame. The size of that window is always as large as required to 2228frame. The size of that window is always as large as required to
diff --git a/lisp/simple.el b/lisp/simple.el
index f77c9f88557..51b24bb3ffb 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1479,16 +1479,16 @@ result of expression evaluation."
1479 "Evaluate EXP and print value in the echo area. 1479 "Evaluate EXP and print value in the echo area.
1480When called interactively, read an Emacs Lisp expression and evaluate it. 1480When called interactively, read an Emacs Lisp expression and evaluate it.
1481Value is also consed on to front of the variable `values'. 1481Value is also consed on to front of the variable `values'.
1482Optional argument INSERT-VALUE non-nil (interactively, with prefix 1482If the resulting value is an integer, it will be printed in
1483argument) means insert the result into the current buffer instead of 1483several additional formats (octal, hexadecimal, and character).
1484printing it in the echo area. 1484Optional argument INSERT-VALUE non-nil (interactively, with
1485prefix argument) means insert the result into the current buffer
1486instead of printing it in the echo area.
1485 1487
1486Normally, this function truncates long output according to the value 1488Normally, this function truncates long output according to the value
1487of the variables `eval-expression-print-length' and 1489of the variables `eval-expression-print-length' and
1488`eval-expression-print-level'. With a prefix argument of zero, 1490`eval-expression-print-level'. With a prefix argument of zero,
1489however, there is no such truncation. Such a prefix argument 1491however, there is no such truncation.
1490also causes integers to be printed in several additional formats
1491\(octal, hexadecimal, and character).
1492 1492
1493Runs the hook `eval-expression-minibuffer-setup-hook' on entering the 1493Runs the hook `eval-expression-minibuffer-setup-hook' on entering the
1494minibuffer. 1494minibuffer.
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index ef7b77969e6..f62ec57f53e 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -267,7 +267,7 @@ The string is based on `url-privacy-level' and `url-user-agent'."
267 'url-http-proxy-basic-auth-storage)) 267 'url-http-proxy-basic-auth-storage))
268 (url-get-authentication url-http-proxy nil 'any nil)))) 268 (url-get-authentication url-http-proxy nil 'any nil))))
269 (real-fname (url-filename url-http-target-url)) 269 (real-fname (url-filename url-http-target-url))
270 (host (url-host url-http-target-url)) 270 (host (url-http--encode-string (url-host url-http-target-url)))
271 (auth (if (cdr-safe (assoc "Authorization" url-http-extra-headers)) 271 (auth (if (cdr-safe (assoc "Authorization" url-http-extra-headers))
272 nil 272 nil
273 (url-get-authentication (or 273 (url-get-authentication (or
@@ -310,7 +310,8 @@ The string is based on `url-privacy-level' and `url-user-agent'."
310 (concat 310 (concat
311 ;; The request 311 ;; The request
312 (or url-http-method "GET") " " 312 (or url-http-method "GET") " "
313 (if using-proxy (url-recreate-url url-http-target-url) real-fname) 313 (url-http--encode-string
314 (if using-proxy (url-recreate-url url-http-target-url) real-fname))
314 " HTTP/" url-http-version "\r\n" 315 " HTTP/" url-http-version "\r\n"
315 ;; Version of MIME we speak 316 ;; Version of MIME we speak
316 "MIME-Version: 1.0\r\n" 317 "MIME-Version: 1.0\r\n"
@@ -347,7 +348,9 @@ The string is based on `url-privacy-level' and `url-user-agent'."
347 "Accept-encoding: " url-mime-encoding-string "\r\n")) 348 "Accept-encoding: " url-mime-encoding-string "\r\n"))
348 (if url-mime-charset-string 349 (if url-mime-charset-string
349 (concat 350 (concat
350 "Accept-charset: " url-mime-charset-string "\r\n")) 351 "Accept-charset: "
352 (url-http--encode-string url-mime-charset-string)
353 "\r\n"))
351 ;; Languages we understand 354 ;; Languages we understand
352 (if url-mime-language-string 355 (if url-mime-language-string
353 (concat 356 (concat
@@ -393,6 +396,11 @@ The string is based on `url-privacy-level' and `url-user-agent'."
393 (url-http-debug "Request is: \n%s" request) 396 (url-http-debug "Request is: \n%s" request)
394 request)) 397 request))
395 398
399(defun url-http--encode-string (s)
400 (if (multibyte-string-p s)
401 (encode-coding-string s 'us-ascii)
402 s))
403
396;; Parsing routines 404;; Parsing routines
397(defun url-http-clean-headers () 405(defun url-http-clean-headers ()
398 "Remove trailing \r from header lines. 406 "Remove trailing \r from header lines.
diff --git a/lisp/window.el b/lisp/window.el
index 4699e2c5e56..cfa10ea1b0f 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1381,10 +1381,21 @@ return the minimum pixel-size of WINDOW."
1381 (let* ((char-size (frame-char-size window t)) 1381 (let* ((char-size (frame-char-size window t))
1382 (fringes (window-fringes window)) 1382 (fringes (window-fringes window))
1383 (margins (window-margins window)) 1383 (margins (window-margins window))
1384 ;; Let the 'min-margins' parameter override the actual
1385 ;; widths of the margins. We allow any number to
1386 ;; replace the values specified by `window-margins'.
1387 ;; See bug#24193 for the rationale of this parameter.
1388 (min-margins (window-parameter window 'min-margins))
1389 (left-min-margin (and min-margins
1390 (numberp (car min-margins))
1391 (car min-margins)))
1392 (right-min-margin (and min-margins
1393 (numberp (cdr min-margins))
1394 (cdr min-margins)))
1384 (pixel-width 1395 (pixel-width
1385 (+ (window-safe-min-size window t t) 1396 (+ (window-safe-min-size window t t)
1386 (* (or (car margins) 0) char-size) 1397 (* (or left-min-margin (car margins) 0) char-size)
1387 (* (or (cdr margins) 0) char-size) 1398 (* (or right-min-margin(cdr margins) 0) char-size)
1388 (car fringes) (cadr fringes) 1399 (car fringes) (cadr fringes)
1389 (window-scroll-bar-width window) 1400 (window-scroll-bar-width window)
1390 (window-right-divider-width window)))) 1401 (window-right-divider-width window))))
@@ -4771,7 +4782,7 @@ frame. The selected window is not changed by this function."
4771 (window-sizable-p 4782 (window-sizable-p
4772 parent (- (+ new-pixel-size divider-width)) horizontal 4783 parent (- (+ new-pixel-size divider-width)) horizontal
4773 (setq ignore 'preserved) t)) 4784 (setq ignore 'preserved) t))
4774 (error "Window %s too small for splitting (1)" parent))) 4785 (error "Window %s too small for splitting" parent)))
4775 ((and (> (+ new-pixel-size divider-width 4786 ((and (> (+ new-pixel-size divider-width
4776 (window-min-size window horizontal nil t)) 4787 (window-min-size window horizontal nil t))
4777 old-pixel-size) 4788 old-pixel-size)
@@ -4780,7 +4791,7 @@ frame. The selected window is not changed by this function."
4780 window horizontal (setq ignore 'preserved) t)) 4791 window horizontal (setq ignore 'preserved) t))
4781 old-pixel-size)) 4792 old-pixel-size))
4782 ;; SIZE unspecified, no resizing. 4793 ;; SIZE unspecified, no resizing.
4783 (error "Window %s too small for splitting (2)" window)))) 4794 (error "Window %s too small for splitting" window))))
4784 ((and (>= pixel-size 0) 4795 ((and (>= pixel-size 0)
4785 (or (>= pixel-size old-pixel-size) 4796 (or (>= pixel-size old-pixel-size)
4786 (< new-pixel-size 4797 (< new-pixel-size
@@ -4788,7 +4799,7 @@ frame. The selected window is not changed by this function."
4788 ;; SIZE specified as new size of old window. If the new size 4799 ;; SIZE specified as new size of old window. If the new size
4789 ;; is larger than the old size or the size of the new window 4800 ;; is larger than the old size or the size of the new window
4790 ;; would be less than the safe minimum, signal an error. 4801 ;; would be less than the safe minimum, signal an error.
4791 (error "Window %s too small for splitting (3)" window)) 4802 (error "Window %s too small for splitting" window))
4792 (resize 4803 (resize
4793 ;; SIZE specified, resizing. 4804 ;; SIZE specified, resizing.
4794 (unless (or (window-sizable-p 4805 (unless (or (window-sizable-p
@@ -4798,13 +4809,13 @@ frame. The selected window is not changed by this function."
4798 parent (- (+ new-pixel-size divider-width)) horizontal 4809 parent (- (+ new-pixel-size divider-width)) horizontal
4799 (setq ignore 'preserved) t)) 4810 (setq ignore 'preserved) t))
4800 ;; If we cannot resize the parent give up. 4811 ;; If we cannot resize the parent give up.
4801 (error "Window %s too small for splitting (4)" parent))) 4812 (error "Window %s too small for splitting" parent)))
4802 ((or (< new-pixel-size 4813 ((or (< new-pixel-size
4803 (window-safe-min-pixel-size window horizontal)) 4814 (window-safe-min-pixel-size window horizontal))
4804 (< (- old-pixel-size new-pixel-size) 4815 (< (- old-pixel-size new-pixel-size)
4805 (window-safe-min-pixel-size window horizontal))) 4816 (window-safe-min-pixel-size window horizontal)))
4806 ;; SIZE specification violates minimum size restrictions. 4817 ;; SIZE specification violates minimum size restrictions.
4807 (error "Window %s too small for splitting (5)" window))) 4818 (error "Window %s too small for splitting" window)))
4808 4819
4809 (window--resize-reset frame horizontal) 4820 (window--resize-reset frame horizontal)
4810 4821
diff --git a/src/category.c b/src/category.c
index 4397f662ba9..83157974080 100644
--- a/src/category.c
+++ b/src/category.c
@@ -336,6 +336,8 @@ The category is changed only for table TABLE, which defaults to
336the current buffer's category table. 336the current buffer's category table.
337CHARACTER can be either a single character or a cons representing the 337CHARACTER can be either a single character or a cons representing the
338lower and upper ends of an inclusive character range to modify. 338lower and upper ends of an inclusive character range to modify.
339CATEGORY must be a category name (a character between ` ' and `~').
340Use `describe-categories' to see existing category names.
339If optional fourth argument RESET is non-nil, 341If optional fourth argument RESET is non-nil,
340then delete CATEGORY from the category set instead of adding it. */) 342then delete CATEGORY from the category set instead of adding it. */)
341 (Lisp_Object character, Lisp_Object category, Lisp_Object table, Lisp_Object reset) 343 (Lisp_Object character, Lisp_Object category, Lisp_Object table, Lisp_Object reset)