Skip to content

Commit 921e167

Browse files
author
Yuuki Harano
committed
Merge branch 'master' of https://github.com/emacs-mirror/emacs into pgtk
2 parents 0336b84 + b9e99ab commit 921e167

File tree

15 files changed

+284
-171
lines changed

15 files changed

+284
-171
lines changed

doc/emacs/commands.texi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ are certain characters found on non-English keyboards
4242
@cindex C-
4343
@cindex META
4444
@cindex M-
45+
@cindex Alt key, serving as Meta
4546
Emacs also recognizes control characters that are entered using
4647
@dfn{modifier keys}. Two commonly-used modifier keys are
4748
@key{Control} (usually labeled @key{Ctrl}), and @key{Meta} (usually
@@ -64,6 +65,8 @@ next character; instead, press @key{ESC} and release it, then enter
6465
the next character. This feature is useful on certain text terminals
6566
where the @key{Meta} key does not function reliably.
6667

68+
Emacs supports 3 additional modifier keys, see @ref{Modifier Keys}.
69+
6770
@cindex keys stolen by window manager
6871
@cindex window manager, keys stolen by
6972
On graphical displays, the window manager might block some keyboard

doc/emacs/custom.texi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1919,6 +1919,12 @@ characters case-sensitive (even on non-graphical frames) when you
19191919
customize Emacs. For instance, you could make @kbd{M-a} and @kbd{M-A}
19201920
run different commands.
19211921

1922+
@cindex Alt, modifier key
1923+
@cindex Super, modifier key
1924+
@cindex Hyper, modifier key
1925+
@cindex s-
1926+
@cindex H-
1927+
@cindex A-
19221928
Although only the @key{Control} and @key{Meta} modifier keys are
19231929
commonly used, Emacs supports three other modifier keys. These are
19241930
called @key{Super}, @key{Hyper}, and @key{Alt}. Few terminals provide

etc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2588,6 +2588,10 @@ pointer is over. To change this behaviour, you can customize the user
25882588
option 'mouse-wheel-follow-mouse'. Note that this will also affect
25892589
scrolling.
25902590

2591+
---
2592+
** help-follow-symbol now signals 'user-error' if point (or the
2593+
position pointed to by the argument POS) is not in a symbol.
2594+
25912595

25922596
* Lisp Changes in Emacs 27.1
25932597

lisp/emacs-lisp/cl-macs.el

Lines changed: 37 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -889,15 +889,15 @@ This is compatible with Common Lisp, but note that `defun' and
889889
;;; The "cl-loop" macro.
890890

891891
(defvar cl--loop-args) (defvar cl--loop-accum-var) (defvar cl--loop-accum-vars)
892-
(defvar cl--loop-bindings) (defvar cl--loop-body)
892+
(defvar cl--loop-bindings) (defvar cl--loop-body) (defvar cl--loop-conditions)
893893
(defvar cl--loop-finally)
894894
(defvar cl--loop-finish-flag) ;Symbol set to nil to exit the loop?
895895
(defvar cl--loop-first-flag)
896896
(defvar cl--loop-initially) (defvar cl--loop-iterator-function)
897897
(defvar cl--loop-name)
898898
(defvar cl--loop-result) (defvar cl--loop-result-explicit)
899899
(defvar cl--loop-result-var) (defvar cl--loop-steps)
900-
(defvar cl--loop-symbol-macs) (defvar cl--loop-guard-cond)
900+
(defvar cl--loop-symbol-macs)
901901

902902
(defun cl--loop-set-iterator-function (kind iterator)
903903
(if cl--loop-iterator-function
@@ -966,7 +966,8 @@ For more details, see Info node `(cl)Loop Facility'.
966966
(cl--loop-accum-var nil) (cl--loop-accum-vars nil)
967967
(cl--loop-initially nil) (cl--loop-finally nil)
968968
(cl--loop-iterator-function nil) (cl--loop-first-flag nil)
969-
(cl--loop-symbol-macs nil) (cl--loop-guard-cond nil))
969+
(cl--loop-symbol-macs nil)
970+
(cl--loop-conditions nil))
970971
;; Here is more or less how those dynbind vars are used after looping
971972
;; over cl--parse-loop-clause:
972973
;;
@@ -1001,24 +1002,7 @@ For more details, see Info node `(cl)Loop Facility'.
10011002
(list (or cl--loop-result-explicit
10021003
cl--loop-result))))
10031004
(ands (cl--loop-build-ands (nreverse cl--loop-body)))
1004-
(while-body
1005-
(nconc
1006-
(cadr ands)
1007-
(if (or (not cl--loop-guard-cond) (not cl--loop-first-flag))
1008-
(nreverse cl--loop-steps)
1009-
;; Right after update the loop variable ensure that the loop
1010-
;; condition, i.e. (car ands), is still satisfied; otherwise,
1011-
;; set `cl--loop-first-flag' nil and skip the remaining
1012-
;; body forms (#Bug#29799).
1013-
;;
1014-
;; (last cl--loop-steps) updates the loop var
1015-
;; (car (butlast cl--loop-steps)) sets `cl--loop-first-flag' nil
1016-
;; (nreverse (cdr (butlast cl--loop-steps))) are the
1017-
;; remaining body forms.
1018-
(append (last cl--loop-steps)
1019-
`((and ,(car ands)
1020-
,@(nreverse (cdr (butlast cl--loop-steps)))))
1021-
`(,(car (butlast cl--loop-steps)))))))
1005+
(while-body (nconc (cadr ands) (nreverse cl--loop-steps)))
10221006
(body (append
10231007
(nreverse cl--loop-initially)
10241008
(list (if cl--loop-iterator-function
@@ -1051,6 +1035,12 @@ For more details, see Info node `(cl)Loop Facility'.
10511035
(list `(cl-symbol-macrolet ,cl--loop-symbol-macs ,@body))))
10521036
`(cl-block ,cl--loop-name ,@body)))))
10531037

1038+
(defmacro cl--push-clause-loop-body (clause)
1039+
"Apply CLAUSE to both `cl--loop-conditions' and `cl--loop-body'."
1040+
`(progn
1041+
(push ,clause cl--loop-conditions)
1042+
(push ,clause cl--loop-body)))
1043+
10541044
;; Below is a complete spec for cl-loop, in several parts that correspond
10551045
;; to the syntax given in CLtL2. The specs do more than specify where
10561046
;; the forms are; it also specifies, as much as Edebug allows, all the
@@ -1201,8 +1191,6 @@ For more details, see Info node `(cl)Loop Facility'.
12011191
;; (def-edebug-spec loop-d-type-spec
12021192
;; (&or (loop-d-type-spec . [&or nil loop-d-type-spec]) cl-type-spec))
12031193

1204-
1205-
12061194
(defun cl--parse-loop-clause () ; uses loop-*
12071195
(let ((word (pop cl--loop-args))
12081196
(hash-types '(hash-key hash-keys hash-value hash-values))
@@ -1281,11 +1269,11 @@ For more details, see Info node `(cl)Loop Facility'.
12811269
(if end-var (push (list end-var end) loop-for-bindings))
12821270
(if step-var (push (list step-var step)
12831271
loop-for-bindings))
1284-
(if end
1285-
(push (list
1286-
(if down (if excl '> '>=) (if excl '< '<=))
1287-
var (or end-var end))
1288-
cl--loop-body))
1272+
(when end
1273+
(cl--push-clause-loop-body
1274+
(list
1275+
(if down (if excl '> '>=) (if excl '< '<=))
1276+
var (or end-var end))))
12891277
(push (list var (list (if down '- '+) var
12901278
(or step-var step 1)))
12911279
loop-for-steps)))
@@ -1295,7 +1283,7 @@ For more details, see Info node `(cl)Loop Facility'.
12951283
(temp (if (and on (symbolp var))
12961284
var (make-symbol "--cl-var--"))))
12971285
(push (list temp (pop cl--loop-args)) loop-for-bindings)
1298-
(push `(consp ,temp) cl--loop-body)
1286+
(cl--push-clause-loop-body `(consp ,temp))
12991287
(if (eq word 'in-ref)
13001288
(push (list var `(car ,temp)) cl--loop-symbol-macs)
13011289
(or (eq temp var)
@@ -1318,24 +1306,19 @@ For more details, see Info node `(cl)Loop Facility'.
13181306
((eq word '=)
13191307
(let* ((start (pop cl--loop-args))
13201308
(then (if (eq (car cl--loop-args) 'then)
1321-
(cl--pop2 cl--loop-args) start)))
1309+
(cl--pop2 cl--loop-args) start))
1310+
(first-assign (or cl--loop-first-flag
1311+
(setq cl--loop-first-flag
1312+
(make-symbol "--cl-var--")))))
13221313
(push (list var nil) loop-for-bindings)
13231314
(if (or ands (eq (car cl--loop-args) 'and))
13241315
(progn
1325-
(push `(,var
1326-
(if ,(or cl--loop-first-flag
1327-
(setq cl--loop-first-flag
1328-
(make-symbol "--cl-var--")))
1329-
,start ,var))
1330-
loop-for-sets)
1331-
(push (list var then) loop-for-steps))
1332-
(push (list var
1333-
(if (eq start then) start
1334-
`(if ,(or cl--loop-first-flag
1335-
(setq cl--loop-first-flag
1336-
(make-symbol "--cl-var--")))
1337-
,start ,then)))
1338-
loop-for-sets))))
1316+
(push `(,var (if ,first-assign ,start ,var)) loop-for-sets)
1317+
(push `(,var (if ,(car (cl--loop-build-ands
1318+
(nreverse cl--loop-conditions)))
1319+
,then ,var))
1320+
loop-for-steps))
1321+
(push `(,var (if ,first-assign ,start ,then)) loop-for-sets))))
13391322

13401323
((memq word '(across across-ref))
13411324
(let ((temp-vec (make-symbol "--cl-vec--"))
@@ -1344,9 +1327,8 @@ For more details, see Info node `(cl)Loop Facility'.
13441327
(push (list temp-vec (pop cl--loop-args)) loop-for-bindings)
13451328
(push (list temp-len `(length ,temp-vec)) loop-for-bindings)
13461329
(push (list temp-idx -1) loop-for-bindings)
1347-
(push `(< (setq ,temp-idx (1+ ,temp-idx))
1348-
,temp-len)
1349-
cl--loop-body)
1330+
(cl--push-clause-loop-body
1331+
`(< (setq ,temp-idx (1+ ,temp-idx)) ,temp-len))
13501332
(if (eq word 'across-ref)
13511333
(push (list var `(aref ,temp-vec ,temp-idx))
13521334
cl--loop-symbol-macs)
@@ -1376,15 +1358,14 @@ For more details, see Info node `(cl)Loop Facility'.
13761358
loop-for-bindings)
13771359
(push (list var `(elt ,temp-seq ,temp-idx))
13781360
cl--loop-symbol-macs)
1379-
(push `(< ,temp-idx ,temp-len) cl--loop-body))
1361+
(cl--push-clause-loop-body `(< ,temp-idx ,temp-len)))
13801362
;; Evaluate seq length just if needed, that is, when seq is not a cons.
13811363
(push (list temp-len (or (consp seq) `(length ,temp-seq)))
13821364
loop-for-bindings)
13831365
(push (list var nil) loop-for-bindings)
1384-
(push `(and ,temp-seq
1385-
(or (consp ,temp-seq)
1386-
(< ,temp-idx ,temp-len)))
1387-
cl--loop-body)
1366+
(cl--push-clause-loop-body `(and ,temp-seq
1367+
(or (consp ,temp-seq)
1368+
(< ,temp-idx ,temp-len))))
13881369
(push (list var `(if (consp ,temp-seq)
13891370
(pop ,temp-seq)
13901371
(aref ,temp-seq ,temp-idx)))
@@ -1480,9 +1461,8 @@ For more details, see Info node `(cl)Loop Facility'.
14801461
(push (list var '(selected-frame))
14811462
loop-for-bindings)
14821463
(push (list temp nil) loop-for-bindings)
1483-
(push `(prog1 (not (eq ,var ,temp))
1484-
(or ,temp (setq ,temp ,var)))
1485-
cl--loop-body)
1464+
(cl--push-clause-loop-body `(prog1 (not (eq ,var ,temp))
1465+
(or ,temp (setq ,temp ,var))))
14861466
(push (list var `(next-frame ,var))
14871467
loop-for-steps)))
14881468

@@ -1503,9 +1483,8 @@ For more details, see Info node `(cl)Loop Facility'.
15031483
(push (list minip `(minibufferp (window-buffer ,var)))
15041484
loop-for-bindings)
15051485
(push (list temp nil) loop-for-bindings)
1506-
(push `(prog1 (not (eq ,var ,temp))
1507-
(or ,temp (setq ,temp ,var)))
1508-
cl--loop-body)
1486+
(cl--push-clause-loop-body `(prog1 (not (eq ,var ,temp))
1487+
(or ,temp (setq ,temp ,var))))
15091488
(push (list var `(next-window ,var ,minip))
15101489
loop-for-steps)))
15111490

@@ -1529,7 +1508,6 @@ For more details, see Info node `(cl)Loop Facility'.
15291508
t)
15301509
cl--loop-body))
15311510
(when loop-for-steps
1532-
(setq cl--loop-guard-cond t)
15331511
(push (cons (if ands 'cl-psetq 'setq)
15341512
(apply 'append (nreverse loop-for-steps)))
15351513
cl--loop-steps))))

lisp/emacs-lisp/edebug.el

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4571,6 +4571,21 @@ With prefix argument, make it a temporary breakpoint."
45714571
;; Continue standard unloading.
45724572
nil)
45734573

4574+
(defun edebug--unwrap*-symbol-function (symbol)
4575+
;; Try to unwrap SYMBOL's `symbol-function'. The result is suitable
4576+
;; to be fbound back to SYMBOL with `defalias'. When no unwrapping
4577+
;; could be done return nil.
4578+
(pcase (symbol-function symbol)
4579+
((or (and `(macro . ,f) (let was-macro t))
4580+
(and f (let was-macro nil)))
4581+
;; `defalias' takes care of advises so we must strip them
4582+
(let* ((orig-f (advice--cd*r f))
4583+
(unwrapped (edebug-unwrap* orig-f)))
4584+
(cond
4585+
((equal unwrapped orig-f) nil)
4586+
(was-macro `(macro . ,unwrapped))
4587+
(t unwrapped))))))
4588+
45744589
(defun edebug-remove-instrumentation (functions)
45754590
"Remove Edebug instrumentation from FUNCTIONS.
45764591
Interactively, the user is prompted for the function to remove
@@ -4582,10 +4597,10 @@ instrumentation for, defaulting to all functions."
45824597
(lambda (symbol)
45834598
(when (and (get symbol 'edebug)
45844599
(or (functionp symbol)
4585-
(macrop symbol)))
4586-
(let ((unwrapped (edebug-unwrap* (symbol-function symbol))))
4587-
(unless (equal unwrapped (symbol-function symbol))
4588-
(push symbol functions)))))
4600+
(macrop symbol))
4601+
(edebug--unwrap*-symbol-function
4602+
symbol))
4603+
(push symbol functions)))
45894604
obarray)
45904605
(unless functions
45914606
(error "Found no functions to remove instrumentation from"))
@@ -4599,8 +4614,9 @@ instrumentation for, defaulting to all functions."
45994614
functions)))))
46004615
;; Remove instrumentation.
46014616
(dolist (symbol functions)
4602-
(setf (symbol-function symbol)
4603-
(edebug-unwrap* (symbol-function symbol))))
4617+
(when-let ((unwrapped
4618+
(edebug--unwrap*-symbol-function symbol)))
4619+
(defalias symbol unwrapped)))
46044620
(message "Removed edebug instrumentation from %s"
46054621
(mapconcat #'symbol-name functions ", ")))
46064622

lisp/files.el

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7153,10 +7153,11 @@ normally equivalent short `-D' option is just passed on to
71537153
(goto-char beg)
71547154
;; First find the line to put it on.
71557155
(when (re-search-forward "^ *\\(total\\)" nil t)
7156+
;; Replace "total" with "total used in directory" to
7157+
;; avoid confusion.
7158+
(replace-match "total used in directory" nil nil nil 1)
71567159
(let ((available (get-free-disk-space ".")))
71577160
(when available
7158-
;; Replace "total" with "used", to avoid confusion.
7159-
(replace-match "total used in directory" nil nil nil 1)
71607161
(end-of-line)
71617162
(insert " available " available))))))))))
71627163

lisp/gnus/gnus-ml.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@
5858

5959
;;;###autoload
6060
(defun turn-on-gnus-mailing-list-mode ()
61-
(when (gnus-group-find-parameter gnus-newsgroup-name 'to-list)
61+
(when (or (gnus-group-find-parameter gnus-newsgroup-name 'to-list)
62+
(and gnus-mailing-list-groups
63+
(string-match gnus-mailing-list-groups gnus-newsgroup-name)))
6264
(gnus-mailing-list-mode 1)))
6365

6466
;;;###autoload
@@ -150,7 +152,7 @@ If FORCE is non-nil, replace the old ones."
150152
(with-current-buffer gnus-original-article-buffer
151153
(gnus-fetch-field "list-archive"))))
152154
(cond (list-archive
153-
(if (string-match "<\\(http:[^>]*\\)>" list-archive)
155+
(if (string-match "<\\(https?:[^>]*\\)>" list-archive)
154156
(browse-url (match-string 1 list-archive))
155157
(browse-url list-archive)))
156158
(t (gnus-message 1 "no list-archive in this group")))))

lisp/gnus/gnus-sum.el

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10419,17 +10419,13 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
1041910419

1042010420
(defun gnus-summary-copy-article (&optional n to-newsgroup select-method)
1042110421
"Copy the current article to some other group.
10422-
If TO-NEWSGROUP is string, do not prompt for a newsgroup to copy to.
10423-
When called interactively, if TO-NEWSGROUP is nil, use the value of
10424-
the variable `gnus-move-split-methods' for finding a default target
10425-
newsgroup.
10426-
If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but
10427-
re-spool using this method."
10422+
Arguments have the same meanings as in `gnus-summary-move-article'."
1042810423
(interactive "P")
1042910424
(gnus-summary-move-article n to-newsgroup select-method 'copy))
1043010425

1043110426
(defun gnus-summary-crosspost-article (&optional n)
10432-
"Crosspost the current article to some other group."
10427+
"Crosspost the current article to some other group.
10428+
Arguments have the same meanings as in `gnus-summary-move-article'."
1043310429
(interactive "P")
1043410430
(gnus-summary-move-article n nil nil 'crosspost))
1043510431

lisp/help-mode.el

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -749,10 +749,11 @@ Show all docs for that symbol as either a variable, function or face."
749749
(buffer-substring (point)
750750
(progn (skip-syntax-forward "w_")
751751
(point)))))))
752-
(when (or (boundp sym)
753-
(get sym 'variable-documentation)
754-
(fboundp sym) (facep sym))
755-
(help-do-xref pos #'describe-symbol (list sym)))))
752+
(if (or (boundp sym)
753+
(get sym 'variable-documentation)
754+
(fboundp sym) (facep sym))
755+
(help-do-xref pos #'describe-symbol (list sym))
756+
(user-error "No symbol here"))))
756757

757758
(defun help-mode-revert-buffer (_ignore-auto noconfirm)
758759
(when (or noconfirm (yes-or-no-p "Revert help buffer? "))

lisp/minibuffer.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3496,8 +3496,8 @@ that is non-nil."
34963496
;;; "flex" completion, also known as flx/fuzzy/scatter completion
34973497
;; Completes "foo" to "frodo" and "farfromsober"
34983498

3499-
(defcustom completion-flex-nospace nil
3500-
"Make flex style fail when a space is found in pattern."
3499+
(defcustom completion-flex-nospace t
3500+
"Non-nil if `flex' completion rejects spaces in search pattern."
35013501
:version "27.1"
35023502
:type 'boolean)
35033503

0 commit comments

Comments
 (0)