aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorDaniel Colascione2014-04-07 13:54:16 -0700
committerDaniel Colascione2014-04-07 13:54:16 -0700
commit7e31acf6b81fdce7258077645bc239767c484841 (patch)
tree1f0d7b063a19b54982550797df063e0a9f87eaed /lisp
parent608a4502b9fa8f5681368657fba5d5fd0fa46817 (diff)
parente3b838807bf9fbbbec9826de6c1e4efdf72acb78 (diff)
downloademacs-7e31acf6b81fdce7258077645bc239767c484841.tar.gz
emacs-7e31acf6b81fdce7258077645bc239767c484841.zip
Merge from emacs-24; up to 2014-04-01T20:18:12Z!eggert@cs.ucla.edu
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog151
-rw-r--r--lisp/autorevert.el2
-rw-r--r--lisp/doc-view.el23
-rw-r--r--lisp/elec-pair.el72
-rw-r--r--lisp/faces.el63
-rw-r--r--lisp/files.el104
-rw-r--r--lisp/help.el2
-rw-r--r--lisp/international/characters.el7
-rw-r--r--lisp/leim/quail/ipa.el2
-rw-r--r--lisp/mpc.el14
-rw-r--r--lisp/progmodes/perl-mode.el19
-rw-r--r--lisp/progmodes/python.el5
-rw-r--r--lisp/shell.el7
13 files changed, 331 insertions, 140 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 87f3c74c9fc..e4df943c1bf 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,128 @@
12014-04-07 João Távora <joaotavora@gmail.com>
2
3 * elec-pair.el:
4 (electric-pair--syntax-ppss): When inside comments parse from
5 comment beginning.
6 (electric-pair--balance-info): Fix typo in comment.
7 (electric-pair--in-unterminated-string-p): Delete.
8 (electric-pair--unbalanced-strings-p): New function.
9 (electric-pair-string-bound-function): New var.
10 (electric-pair-inhibit-if-helps-balance): Decide quote pairing
11 according to `electric-pair--in-unterminated-string-p'
12
132014-04-07 João Távora <joaotavora@gmail.com>
14
15 * elec-pair.el (electric-pair-inhibit-if-helps-balance): Inhibit
16 quote pairing if point-max is inside an unterminated string.
17 (electric-pair--looking-at-unterminated-string-p):
18 Delete.
19 (electric-pair--in-unterminated-string-p): New function.
20
212014-04-07 Glenn Morris <rgm@gnu.org>
22
23 * shell.el (shell-directory-tracker):
24 Go back to just ignoring failures. (Bug#17159)
25
262014-04-06 João Távora <joaotavora@gmail.com>
27
28 Fix `electric-pair-delete-adjacent-pairs' in modes binding
29 backspace. (bug#16981)
30 * elec-pair.el (electric-pair-backward-delete-char): Delete.
31 (electric-pair-backward-delete-char-untabify): Delete.
32 (electric-pair-mode-map): Bind backspace to a menu item filtering
33 a new `electric-pair-delete-pair' command.
34 (electric-pair-delete-pair): New command.
35
362014-04-06 João Távora <joaotavora@gmail.com>
37
38 * progmodes/python.el (python-electric-pair-string-delimiter): Fix
39 triple-quoting electricity. (Bug#17192)
40
412014-04-06 João Távora <joaotavora@gmail.com>
42
43 * elec-pair.el (electric-pair-post-self-insert-function): Don't
44 skip whitespace when `electric-pair-text-pairs' and
45 `electric-pair-pairs' were used. syntax to
46 electric-pair--skip-whitespace. (Bug#17183)
47
482014-04-06 Eli Zaretskii <eliz@gnu.org>
49
50 * leim/quail/ipa.el (ipa-x-sampa): Fix the character produced for
51 "<F>". (Bug#17199)
52
532014-04-06 Stefan Monnier <monnier@iro.umontreal.ca>
54
55 * mpc.el (mpc--status-timer-run): Disable timer if not displayed.
56 (mpc--status-idle-timer-run): Use mpc--status-timer-run.
57
582014-04-05 Glenn Morris <rgm@gnu.org>
59
60 * help.el (view-lossage): Doc tweak.
61
622014-04-05 Matthias Dahl <ml_emacs-lists@binary-island.eu>
63
64 * faces.el (face-spec-recalc): Call make-face-x-resource-internal
65 only when inhibit-x-resources is nil, and do that earlier in the
66 function. Doc fix. (Bug#16694)
67 (face-spec-choose): Accept additional optional argument, whose
68 value is returned if no matching attributes are found.
69 (face-spec-recalc): Use the new optional argument when calling
70 face-spec-choose. (Bug#16378)
71 (make-face-x-resource-internal): Do nothing when
72 inhibit-x-resources is non-nil. Don't touch the default face if
73 reversed video is given--as was done in previous versions of Emacs.
74 (face-set-after-frame-default): Don't call
75 make-face-x-resource-internal here. (Bug#16434)
76
772014-04-04 Tassilo Horn <tsdh@gnu.org>
78
79 * doc-view.el (doc-view-bookmark-jump):
80 Use `bookmark-after-jump-hook' to jump to the right page after the
81 buffer is shown in a window. (bug#16090)
82
832014-04-04 Eli Zaretskii <eliz@gnu.org>
84
85 * international/characters.el (mirroring): Fix last change:
86 instead of loading uni-mirrored.el explicitly, do that implicitly
87 by creating the 'mirroring' uniprop table. This avoids announcing
88 the loading of uni-mirrored.el.
89
902014-04-04 Glenn Morris <rgm@gnu.org>
91
92 * files.el (buffer-stale--default-function)
93 (buffer-stale-function, revert-buffer--default):
94 * autorevert.el (auto-revert-buffers): Doc tweaks.
95
962014-04-03 Eli Zaretskii <eliz@gnu.org>
97
98 * international/characters.el: Preload uni-mirrored.el. (Bug#17169)
99
1002014-04-03 Glenn Morris <rgm@gnu.org>
101
102 * files.el (make-backup-file-name-function)
103 (make-backup-file-name, make-backup-file-name--default-function)
104 (make-backup-file-name-1, find-backup-file-name)
105 (revert-buffer-function, revert-buffer-insert-file-contents-function)
106 (buffer-stale--default-function, buffer-stale-function)
107 (before-revert-hook, after-revert-hook, revert-buffer-in-progress-p)
108 (revert-buffer, revert-buffer--default)
109 (revert-buffer-insert-file-contents--default-function):
110 Doc fixes related to defaults no longer being nil.
111 (make-backup-file-name-function): Bump :version.
112 Restore nil as a valid but deprecated custom type.
113
1142014-04-03 Stefan Monnier <monnier@iro.umontreal.ca>
115
116 * progmodes/perl-mode.el (perl-syntax-propertize-function): Handle $'
117 used as a variable (bug#17174).
118
1192014-04-02 Stefan Monnier <monnier@iro.umontreal.ca>
120
121 * progmodes/perl-mode.el (perl-indent-new-calculate):
122 Handle forward-sexp failure (bug#16985).
123 (perl-syntax-propertize-function): Add "foreach" and "for" statement
124 modifiers introducing expressions (bug#17116).
125
12014-04-06 Stefan Monnier <monnier@iro.umontreal.ca> 1262014-04-06 Stefan Monnier <monnier@iro.umontreal.ca>
2 127
3 * dired-aux.el (dired-file-set-difference): Use lexical-scoping. 128 * dired-aux.el (dired-file-set-difference): Use lexical-scoping.
@@ -488,6 +613,19 @@
488 (tty-color-approximate, tty-color-by-index, tty-color-values) 613 (tty-color-approximate, tty-color-by-index, tty-color-values)
489 (tty-color-desc): Remove superfluous backslashes. 614 (tty-color-desc): Remove superfluous backslashes.
490 615
6162014-03-20 Stefan Monnier <monnier@iro.umontreal.ca>
617
618 * electric.el (electric-newline-and-maybe-indent): New command.
619 Bind it globally to C-j.
620 (electric-indent-mode): Don't mess with the global map any more.
621 Don't drop the post-self-insert-hook is some buffer is still using it
622 (bug#16770).
623
624 * bindings.el (global-map): Remove C-j binding.
625
626 * emacs-lisp/nadvice.el (advice--make-docstring): Try harder to find
627 the docstring of functions advised before dumping (bug#16993).
628
4912014-03-21 Glenn Morris <rgm@gnu.org> 6292014-03-21 Glenn Morris <rgm@gnu.org>
492 630
493 * cus-start.el (history-length): Bump :version. 631 * cus-start.el (history-length): Bump :version.
@@ -516,18 +654,6 @@
516 654
517 * skeleton.el (skeleton-autowrap): Mark as obsolete. Doc fix. 655 * skeleton.el (skeleton-autowrap): Mark as obsolete. Doc fix.
518 656
5192014-03-20 Stefan Monnier <monnier@iro.umontreal.ca>
520
521 * electric.el (electric-newline-and-maybe-indent): New command.
522 Bind it globally to C-j.
523 (electric-indent-mode): Don't mess with the global map any more.
524 Don't drop the post-self-insert-hook is some buffer is still using it
525 (bug#16770).
526 * bindings.el (global-map): Remove C-j binding.
527
528 * emacs-lisp/nadvice.el (advice--make-docstring): Try harder to find
529 the docstring of functions advised before dumping (bug#16993).
530
5312014-03-19 Stefan-W. Hahn <stefan.hahn@s-hahn.de> (tiny change) 6572014-03-19 Stefan-W. Hahn <stefan.hahn@s-hahn.de> (tiny change)
532 658
533 * ps-print.el (ps-generate-postscript-with-faces): 659 * ps-print.el (ps-generate-postscript-with-faces):
@@ -2154,7 +2280,6 @@
2154 * net/shr.el (shr-tag-img): Prefer the title over the alt text 2280 * net/shr.el (shr-tag-img): Prefer the title over the alt text
2155 (bug#16537). 2281 (bug#16537).
2156 2282
2157>>>>>>> MERGE-SOURCE
21582014-01-24 Juanma Barranquero <lekktu@gmail.com> 22832014-01-24 Juanma Barranquero <lekktu@gmail.com>
2159 2284
2160 * net/eww.el (eww-download-callback): 2285 * net/eww.el (eww-download-callback):
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index a08bf7fee6a..f1074e22e51 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -672,7 +672,7 @@ Should `auto-revert-mode' be active in some buffers, those buffers
672are checked. 672are checked.
673 673
674Non-file buffers that have a custom `revert-buffer-function' and 674Non-file buffers that have a custom `revert-buffer-function' and
675a `buffer-stale-function' are reverted either when Auto-Revert 675`buffer-stale-function' are reverted either when Auto-Revert
676Mode is active in that buffer, or when the variable 676Mode is active in that buffer, or when the variable
677`global-auto-revert-non-file-buffers' is non-nil and Global 677`global-auto-revert-non-file-buffers' is non-nil and Global
678Auto-Revert Mode is active. 678Auto-Revert Mode is active.
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 6706865e598..09d5925b3e2 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -1862,20 +1862,23 @@ See the command `doc-view-mode' for more information on this mode."
1862 `((page . ,(doc-view-current-page)) 1862 `((page . ,(doc-view-current-page))
1863 (handler . doc-view-bookmark-jump)))) 1863 (handler . doc-view-bookmark-jump))))
1864 1864
1865
1866;;;###autoload 1865;;;###autoload
1867(defun doc-view-bookmark-jump (bmk) 1866(defun doc-view-bookmark-jump (bmk)
1868 ;; This implements the `handler' function interface for record type 1867 ;; This implements the `handler' function interface for record type
1869 ;; returned by `doc-view-bookmark-make-record', which see. 1868 ;; returned by `doc-view-bookmark-make-record', which see.
1870 (prog1 (bookmark-default-handler bmk) 1869 (let ((page (bookmark-prop-get bmk 'page))
1871 (let ((page (bookmark-prop-get bmk 'page))) 1870 (show-fn-sym (make-symbol "doc-view-bookmark-after-jump-hook")))
1872 (when (not (eq major-mode 'doc-view-mode)) 1871 (fset show-fn-sym
1873 (doc-view-toggle-display)) 1872 (lambda ()
1874 (with-selected-window 1873 (remove-hook 'bookmark-after-jump-hook show-fn-sym)
1875 (or (get-buffer-window (current-buffer) 0) 1874 (when (not (eq major-mode 'doc-view-mode))
1876 (selected-window)) 1875 (doc-view-toggle-display))
1877 (doc-view-goto-page page))))) 1876 (with-selected-window
1878 1877 (or (get-buffer-window (current-buffer) 0)
1878 (selected-window))
1879 (doc-view-goto-page page))))
1880 (add-hook 'bookmark-after-jump-hook show-fn-sym)
1881 (bookmark-default-handler bmk)))
1879 1882
1880(provide 'doc-view) 1883(provide 'doc-view)
1881 1884
diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el
index 73eabdf51c8..c16c1141800 100644
--- a/lisp/elec-pair.el
+++ b/lisp/elec-pair.el
@@ -166,36 +166,6 @@ return value is considered instead."
166quotes or comments. If lookup fails here, `electric-pair-text-pairs' will 166quotes or comments. If lookup fails here, `electric-pair-text-pairs' will
167be considered.") 167be considered.")
168 168
169(defun electric-pair-backward-delete-char (n &optional killflag untabify)
170 "Delete characters backward, and maybe also two adjacent paired delimiters.
171
172Remaining behavior is given by `backward-delete-char' or, if UNTABIFY is
173non-nil, `backward-delete-char-untabify'."
174 (interactive "*p\nP")
175 (let* ((prev (char-before))
176 (next (char-after))
177 (syntax-info (and prev
178 (electric-pair-syntax-info prev)))
179 (syntax (car syntax-info))
180 (pair (cadr syntax-info)))
181 (when (and next pair
182 (if (functionp electric-pair-delete-adjacent-pairs)
183 (funcall electric-pair-delete-adjacent-pairs)
184 electric-pair-delete-adjacent-pairs)
185 (memq syntax '(?\( ?\" ?\$))
186 (eq pair next))
187 (delete-char 1 killflag))
188 (if untabify
189 (backward-delete-char-untabify n killflag)
190 (backward-delete-char n killflag))))
191
192(defun electric-pair-backward-delete-char-untabify (n &optional killflag)
193 "Delete characters backward, and maybe also two adjacent paired delimiters.
194
195Remaining behavior is given by `backward-delete-char-untabify'."
196 (interactive "*p\nP")
197 (electric-pair-backward-delete-char n killflag t))
198
199(defun electric-pair-conservative-inhibit (char) 169(defun electric-pair-conservative-inhibit (char)
200 (or 170 (or
201 ;; I find it more often preferable not to pair when the 171 ;; I find it more often preferable not to pair when the
@@ -503,10 +473,12 @@ happened."
503 (funcall electric-pair-skip-self last-command-event) 473 (funcall electric-pair-skip-self last-command-event)
504 electric-pair-skip-self)) 474 electric-pair-skip-self))
505 (save-excursion 475 (save-excursion
506 (when (setq skip-whitespace-info 476 (when (and (not (and unconditional
507 (if (functionp electric-pair-skip-whitespace) 477 (eq syntax ?\")))
508 (funcall electric-pair-skip-whitespace) 478 (setq skip-whitespace-info
509 electric-pair-skip-whitespace)) 479 (if (functionp electric-pair-skip-whitespace)
480 (funcall electric-pair-skip-whitespace)
481 electric-pair-skip-whitespace)))
510 (electric-pair--skip-whitespace)) 482 (electric-pair--skip-whitespace))
511 (eq (char-after) last-command-event)))) 483 (eq (char-after) last-command-event))))
512 ;; This is too late: rather than insert&delete we'd want to only 484 ;; This is too late: rather than insert&delete we'd want to only
@@ -546,14 +518,34 @@ happened."
546 (memq (car (electric-pair-syntax-info last-command-event)) 518 (memq (car (electric-pair-syntax-info last-command-event))
547 '(?\( ?\) ?\" ?\$)))) 519 '(?\( ?\) ?\" ?\$))))
548 520
521(defun electric-pair-delete-pair (arg &optional killp)
522 "When between adjacent paired delimiters, delete both of them.
523ARG and KILLP are passed directly to
524`backward-delete-char-untabify', which see."
525 (interactive "*p\nP")
526 (delete-char 1)
527 (backward-delete-char-untabify arg killp))
528
549(defvar electric-pair-mode-map 529(defvar electric-pair-mode-map
550 (let ((map (make-sparse-keymap))) 530 (let ((map (make-sparse-keymap)))
551 (define-key map [remap backward-delete-char-untabify] 531 (define-key map "\177"
552 'electric-pair-backward-delete-char-untabify) 532 `(menu-item
553 (define-key map [remap backward-delete-char] 533 "" electric-pair-delete-pair
554 'electric-pair-backward-delete-char) 534 :filter
555 (define-key map [remap delete-backward-char] 535 ,(lambda (cmd)
556 'electric-pair-backward-delete-char) 536 (let* ((prev (char-before))
537 (next (char-after))
538 (syntax-info (and prev
539 (electric-pair-syntax-info prev)))
540 (syntax (car syntax-info))
541 (pair (cadr syntax-info)))
542 (and next pair
543 (memq syntax '(?\( ?\" ?\$))
544 (eq pair next)
545 (if (functionp electric-pair-delete-adjacent-pairs)
546 (funcall electric-pair-delete-adjacent-pairs)
547 electric-pair-delete-adjacent-pairs)
548 cmd)))))
557 map) 549 map)
558 "Keymap used by `electric-pair-mode'.") 550 "Keymap used by `electric-pair-mode'.")
559 551
diff --git a/lisp/faces.el b/lisp/faces.el
index 49b59281576..b2f353d089e 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -354,11 +354,16 @@ specifies an invalid attribute."
354 354
355(defun make-face-x-resource-internal (face &optional frame) 355(defun make-face-x-resource-internal (face &optional frame)
356 "Fill frame-local FACE on FRAME from X resources. 356 "Fill frame-local FACE on FRAME from X resources.
357FRAME nil or not specified means do it for all frames." 357FRAME nil or not specified means do it for all frames.
358 (if (null frame) 358
359 (dolist (frame (frame-list)) 359If `inhibit-x-resources' is non-nil, this function does nothing."
360 (set-face-attributes-from-resources face frame)) 360 (unless inhibit-x-resources
361 (set-face-attributes-from-resources face frame))) 361 (dolist (frame (if (null frame) (frame-list) (list frame)))
362 ;; `x-create-frame' already took care of correctly handling
363 ;; the reverse video case-- do _not_ touch the default face
364 (unless (and (eq face 'default)
365 (frame-parameter frame 'reverse))
366 (set-face-attributes-from-resources face frame)))))
362 367
363 368
364 369
@@ -1532,13 +1537,15 @@ If FRAME is nil, the current FRAME is used."
1532 match)) 1537 match))
1533 1538
1534 1539
1535(defun face-spec-choose (spec &optional frame) 1540(defun face-spec-choose (spec &optional frame no-match-retval)
1536 "Choose the proper attributes for FRAME, out of SPEC. 1541 "Return the proper attributes for FRAME, out of SPEC.
1537If SPEC is nil, return nil." 1542
1543If no match is found or SPEC is nil, return nil, unless NO-MATCH-RETVAL
1544is given, in which case return its value instead."
1538 (unless frame 1545 (unless frame
1539 (setq frame (selected-frame))) 1546 (setq frame (selected-frame)))
1540 (let ((tail spec) 1547 (let ((tail spec)
1541 result defaults) 1548 result defaults match-found)
1542 (while tail 1549 (while tail
1543 (let* ((entry (pop tail)) 1550 (let* ((entry (pop tail))
1544 (display (car entry)) 1551 (display (car entry))
@@ -1558,9 +1565,18 @@ If SPEC is nil, return nil."
1558 (setq defaults thisval) 1565 (setq defaults thisval)
1559 ;; Otherwise, if it matches, use it. 1566 ;; Otherwise, if it matches, use it.
1560 (when (face-spec-set-match-display display frame) 1567 (when (face-spec-set-match-display display frame)
1561 (setq result thisval) 1568 (setq result thisval
1562 (setq tail nil))))) 1569 tail nil
1563 (if defaults (append result defaults) result))) 1570 match-found t)))))
1571 ;; If defaults have been found, it's safe to just append those to the result
1572 ;; list (which at this point will be either nil or contain actual specs) and
1573 ;; return it to the caller. Since there will most definitely be something to
1574 ;; return in this case, there's no need to know/check if a match was found.
1575 (if defaults
1576 (append result defaults)
1577 (if match-found
1578 result
1579 no-match-retval))))
1564 1580
1565 1581
1566(defun face-spec-reset-face (face &optional frame) 1582(defun face-spec-reset-face (face &optional frame)
@@ -1639,19 +1655,27 @@ function for its other effects."
1639 1655
1640(defun face-spec-recalc (face frame) 1656(defun face-spec-recalc (face frame)
1641 "Reset the face attributes of FACE on FRAME according to its specs. 1657 "Reset the face attributes of FACE on FRAME according to its specs.
1642This applies the defface/custom spec first, then the custom theme specs, 1658After the reset, the specs are applied from the following sources in this order:
1643then the override spec." 1659 X resources (if applicable)
1660 |
1661 (theme and user customization)
1662 or, if nonexistent or does not match the current frame,
1663 (defface default spec)
1664 |
1665 defface override spec"
1644 (while (get face 'face-alias) 1666 (while (get face 'face-alias)
1645 (setq face (get face 'face-alias))) 1667 (setq face (get face 'face-alias)))
1646 (face-spec-reset-face face frame) 1668 (face-spec-reset-face face frame)
1669 (make-face-x-resource-internal face frame)
1647 ;; If FACE is customized or themed, set the custom spec from 1670 ;; If FACE is customized or themed, set the custom spec from
1648 ;; `theme-face' records. 1671 ;; `theme-face' records.
1649 (let ((theme-faces (get face 'theme-face)) 1672 (let ((theme-faces (get face 'theme-face))
1673 (no-match-found 0)
1650 spec theme-face-applied) 1674 spec theme-face-applied)
1651 (if theme-faces 1675 (if theme-faces
1652 (dolist (elt (reverse theme-faces)) 1676 (dolist (elt (reverse theme-faces))
1653 (setq spec (face-spec-choose (cadr elt) frame)) 1677 (setq spec (face-spec-choose (cadr elt) frame no-match-found))
1654 (when spec 1678 (unless (eq spec no-match-found)
1655 (face-spec-set-2 face frame spec) 1679 (face-spec-set-2 face frame spec)
1656 (setq theme-face-applied t)))) 1680 (setq theme-face-applied t))))
1657 ;; If there was a spec applicable to FRAME, that overrides the 1681 ;; If there was a spec applicable to FRAME, that overrides the
@@ -1661,8 +1685,7 @@ then the override spec."
1661 (setq spec (face-spec-choose (face-default-spec face) frame)) 1685 (setq spec (face-spec-choose (face-default-spec face) frame))
1662 (face-spec-set-2 face frame spec)) 1686 (face-spec-set-2 face frame spec))
1663 (setq spec (face-spec-choose (get face 'face-override-spec) frame)) 1687 (setq spec (face-spec-choose (get face 'face-override-spec) frame))
1664 (face-spec-set-2 face frame spec)) 1688 (face-spec-set-2 face frame spec)))
1665 (make-face-x-resource-internal face frame))
1666 1689
1667(defun face-spec-set-2 (face frame spec) 1690(defun face-spec-set-2 (face frame spec)
1668 "Set the face attributes of FACE on FRAME according to SPEC." 1691 "Set the face attributes of FACE on FRAME according to SPEC."
@@ -2046,10 +2069,6 @@ frame parameters in PARAMETERS."
2046 (progn 2069 (progn
2047 ;; Initialize faces from face spec and custom theme. 2070 ;; Initialize faces from face spec and custom theme.
2048 (face-spec-recalc face frame) 2071 (face-spec-recalc face frame)
2049 ;; X resources for the default face are applied during
2050 ;; `x-create-frame'.
2051 (and (not (eq face 'default)) window-system-p
2052 (make-face-x-resource-internal face frame))
2053 ;; Apply attributes specified by face-new-frame-defaults 2072 ;; Apply attributes specified by face-new-frame-defaults
2054 (internal-merge-in-global-face face frame)) 2073 (internal-merge-in-global-face face frame))
2055 ;; Don't let invalid specs prevent frame creation. 2074 ;; Don't let invalid specs prevent frame creation.
diff --git a/lisp/files.el b/lisp/files.el
index 5883c8c348e..34c66bbd1d6 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4207,15 +4207,22 @@ FILENAME defaults to `buffer-file-name'."
4207 4207
4208(defcustom make-backup-file-name-function 4208(defcustom make-backup-file-name-function
4209 #'make-backup-file-name--default-function 4209 #'make-backup-file-name--default-function
4210 "A function to use instead of the default `make-backup-file-name'. 4210 "A function that `make-backup-file-name' uses to create backup file names.
4211The function receives a single argument, the original file name.
4211 4212
4212This could be buffer-local to do something special for specific 4213If you change this, you may need to change `backup-file-name-p' and
4213files. If you define it, you may need to change `backup-file-name-p' 4214`file-name-sans-versions' too.
4214and `file-name-sans-versions' too. 4215
4216You could make this buffer-local to do something special for specific files.
4217
4218For historical reasons, a value of nil means to use the default function.
4219This should not be relied upon.
4215 4220
4216See also `backup-directory-alist'." 4221See also `backup-directory-alist'."
4222 :version "24.4" ; nil -> make-backup-file-name--default-function
4217 :group 'backup 4223 :group 'backup
4218 :type '(function :tag "Your function")) 4224 :type '(choice (const :tag "Deprecated way to get the default function" nil)
4225 (function :tag "Function")))
4219 4226
4220(defcustom backup-directory-alist nil 4227(defcustom backup-directory-alist nil
4221 "Alist of filename patterns and backup directory names. 4228 "Alist of filename patterns and backup directory names.
@@ -4272,20 +4279,17 @@ Checks for files in `temporary-file-directory',
4272 4279
4273(defun make-backup-file-name (file) 4280(defun make-backup-file-name (file)
4274 "Create the non-numeric backup file name for FILE. 4281 "Create the non-numeric backup file name for FILE.
4275Normally this will just be the file's name with `~' appended. 4282This calls the function that `make-backup-file-name-function' specifies,
4276Customization hooks are provided as follows. 4283with a single argument FILE."
4277
4278The value of `make-backup-file-name-function' should be a function which
4279will be called with FILE as its argument; the resulting name is used.
4280
4281By default, a match for FILE is sought in `backup-directory-alist'; see
4282the documentation of that variable. If the directory for the backup
4283doesn't exist, it is created."
4284 (funcall (or make-backup-file-name-function 4284 (funcall (or make-backup-file-name-function
4285 #'make-backup-file-name--default-function) 4285 #'make-backup-file-name--default-function)
4286 file)) 4286 file))
4287 4287
4288(defun make-backup-file-name--default-function (file) 4288(defun make-backup-file-name--default-function (file)
4289 "Default function for `make-backup-file-name'.
4290Normally this just returns FILE's name with `~' appended.
4291It searches for a match for FILE in `backup-directory-alist'.
4292If the directory for the backup doesn't exist, it is created."
4289 (if (and (eq system-type 'ms-dos) 4293 (if (and (eq system-type 'ms-dos)
4290 (not (msdos-long-file-names))) 4294 (not (msdos-long-file-names)))
4291 (let ((fn (file-name-nondirectory file))) 4295 (let ((fn (file-name-nondirectory file)))
@@ -4297,7 +4301,8 @@ doesn't exist, it is created."
4297 (concat (make-backup-file-name-1 file) "~"))) 4301 (concat (make-backup-file-name-1 file) "~")))
4298 4302
4299(defun make-backup-file-name-1 (file) 4303(defun make-backup-file-name-1 (file)
4300 "Subroutine of `make-backup-file-name' and `find-backup-file-name'." 4304 "Subroutine of `make-backup-file-name--default-function'.
4305The function `find-backup-file-name' also uses this."
4301 (let ((alist backup-directory-alist) 4306 (let ((alist backup-directory-alist)
4302 elt backup-directory abs-backup-directory) 4307 elt backup-directory abs-backup-directory)
4303 (while alist 4308 (while alist
@@ -4374,8 +4379,8 @@ the index in the name where the version number begins."
4374Value is a list whose car is the name for the backup file 4379Value is a list whose car is the name for the backup file
4375and whose cdr is a list of old versions to consider deleting now. 4380and whose cdr is a list of old versions to consider deleting now.
4376If the value is nil, don't make a backup. 4381If the value is nil, don't make a backup.
4377Uses `backup-directory-alist' in the same way as does 4382Uses `backup-directory-alist' in the same way as
4378`make-backup-file-name'." 4383`make-backup-file-name--default-function' does."
4379 (let ((handler (find-file-name-handler fn 'find-backup-file-name))) 4384 (let ((handler (find-file-name-handler fn 'find-backup-file-name)))
4380 ;; Run a handler for this function so that ange-ftp can refuse to do it. 4385 ;; Run a handler for this function so that ange-ftp can refuse to do it.
4381 (if handler 4386 (if handler
@@ -5312,28 +5317,41 @@ comparison."
5312 5317
5313(put 'revert-buffer-function 'permanent-local t) 5318(put 'revert-buffer-function 'permanent-local t)
5314(defvar revert-buffer-function #'revert-buffer--default 5319(defvar revert-buffer-function #'revert-buffer--default
5315 "Function to use to revert this buffer, or nil to do the default. 5320 "Function to use to revert this buffer.
5316The function receives two arguments IGNORE-AUTO and NOCONFIRM, 5321The function receives two arguments IGNORE-AUTO and NOCONFIRM,
5317which are the arguments that `revert-buffer' received. 5322which are the arguments that `revert-buffer' received.
5318It also has access to the `preserve-modes' argument of `revert-buffer' 5323It also has access to the `preserve-modes' argument of `revert-buffer'
5319via the `revert-buffer-preserve-modes' dynamic variable.") 5324via the `revert-buffer-preserve-modes' dynamic variable.
5325
5326For historical reasons, a value of nil means to use the default function.
5327This should not be relied upon.")
5320 5328
5321(put 'revert-buffer-insert-file-contents-function 'permanent-local t) 5329(put 'revert-buffer-insert-file-contents-function 'permanent-local t)
5322(defvar revert-buffer-insert-file-contents-function 5330(defvar revert-buffer-insert-file-contents-function
5323 #'revert-buffer-insert-file-contents--default-function 5331 #'revert-buffer-insert-file-contents--default-function
5324 "Function to use to insert contents when reverting this buffer. 5332 "Function to use to insert contents when reverting this buffer.
5325Gets two args, first the nominal file name to use, 5333The function receives two arguments: the first the nominal file name to use;
5326and second, t if reading the auto-save file. 5334the second is t if reading the auto-save file.
5335
5336The function is responsible for updating (or preserving) point.
5327 5337
5328The function you specify is responsible for updating (or preserving) point.") 5338For historical reasons, a value of nil means to use the default function.
5339This should not be relied upon.")
5329 5340
5330(defun buffer-stale--default-function (&optional _noconfirm) 5341(defun buffer-stale--default-function (&optional _noconfirm)
5342 "Default function to use for `buffer-stale-function'.
5343This function ignores its argument.
5344This returns non-nil if the current buffer is visiting a readable file
5345whose modification time does not match that of the buffer.
5346
5347This function only handles buffers that are visiting files.
5348Non-file buffers need a custom function"
5331 (and buffer-file-name 5349 (and buffer-file-name
5332 (file-readable-p buffer-file-name) 5350 (file-readable-p buffer-file-name)
5333 (not (verify-visited-file-modtime (current-buffer))))) 5351 (not (verify-visited-file-modtime (current-buffer)))))
5334 5352
5335(defvar buffer-stale-function #'buffer-stale--default-function 5353(defvar buffer-stale-function #'buffer-stale--default-function
5336 "Function to check whether a non-file buffer needs reverting. 5354 "Function to check whether a buffer needs reverting.
5337This should be a function with one optional argument NOCONFIRM. 5355This should be a function with one optional argument NOCONFIRM.
5338Auto Revert Mode passes t for NOCONFIRM. The function should return 5356Auto Revert Mode passes t for NOCONFIRM. The function should return
5339non-nil if the buffer should be reverted. A return value of 5357non-nil if the buffer should be reverted. A return value of
@@ -5346,13 +5364,16 @@ non-nil if the buffer is going to be reverted without asking the
5346user. In such situations, one has to be careful with potentially 5364user. In such situations, one has to be careful with potentially
5347time consuming operations. 5365time consuming operations.
5348 5366
5367For historical reasons, a value of nil means to use the default function.
5368This should not be relied upon.
5369
5349For more information on how this variable is used by Auto Revert mode, 5370For more information on how this variable is used by Auto Revert mode,
5350see Info node `(emacs)Supporting additional buffers'.") 5371see Info node `(emacs)Supporting additional buffers'.")
5351 5372
5352(defvar before-revert-hook nil 5373(defvar before-revert-hook nil
5353 "Normal hook for `revert-buffer' to run before reverting. 5374 "Normal hook for `revert-buffer' to run before reverting.
5354If `revert-buffer-function' is used to override the normal revert 5375The function `revert-buffer--default' runs this.
5355mechanism, this hook is not used.") 5376A customized `revert-buffer-function' need not run this hook.")
5356 5377
5357(defvar after-revert-hook nil 5378(defvar after-revert-hook nil
5358 "Normal hook for `revert-buffer' to run after reverting. 5379 "Normal hook for `revert-buffer' to run after reverting.
@@ -5360,12 +5381,11 @@ Note that the hook value that it runs is the value that was in effect
5360before reverting; that makes a difference if you have buffer-local 5381before reverting; that makes a difference if you have buffer-local
5361hook functions. 5382hook functions.
5362 5383
5363If `revert-buffer-function' is used to override the normal revert 5384The function `revert-buffer--default' runs this.
5364mechanism, this hook is not used.") 5385A customized `revert-buffer-function' need not run this hook.")
5365 5386
5366(defvar revert-buffer-in-progress-p nil 5387(defvar revert-buffer-in-progress-p nil
5367 "Non-nil if a `revert-buffer' operation is in progress, nil otherwise. 5388 "Non-nil if a `revert-buffer' operation is in progress, nil otherwise.")
5368This is true even if a `revert-buffer-function' is being used.")
5369 5389
5370(defvar revert-buffer-internal-hook) 5390(defvar revert-buffer-internal-hook)
5371 5391
@@ -5402,12 +5422,10 @@ the files modes. Normally we reinitialize them using `normal-mode'.
5402 5422
5403This function binds `revert-buffer-in-progress-p' non-nil while it operates. 5423This function binds `revert-buffer-in-progress-p' non-nil while it operates.
5404 5424
5405If the value of `revert-buffer-function' is non-nil, it is called to 5425This function calls the function that `revert-buffer-function' specifies
5406do all the work for this command. Otherwise, the hooks 5426to do the work, with arguments IGNORE-AUTO and NOCONFIRM.
5407`before-revert-hook' and `after-revert-hook' are run at the beginning 5427The default function runs the hooks `before-revert-hook' and
5408and the end, and if `revert-buffer-insert-file-contents-function' is 5428`after-revert-hook'."
5409non-nil, it is called instead of rereading visited file contents."
5410
5411 ;; I admit it's odd to reverse the sense of the prefix argument, but 5429 ;; I admit it's odd to reverse the sense of the prefix argument, but
5412 ;; there is a lot of code out there which assumes that the first 5430 ;; there is a lot of code out there which assumes that the first
5413 ;; argument should be t to avoid consulting the auto-save file, and 5431 ;; argument should be t to avoid consulting the auto-save file, and
@@ -5419,7 +5437,19 @@ non-nil, it is called instead of rereading visited file contents."
5419 (revert-buffer-preserve-modes preserve-modes)) 5437 (revert-buffer-preserve-modes preserve-modes))
5420 (funcall (or revert-buffer-function #'revert-buffer--default) 5438 (funcall (or revert-buffer-function #'revert-buffer--default)
5421 ignore-auto noconfirm))) 5439 ignore-auto noconfirm)))
5440
5422(defun revert-buffer--default (ignore-auto noconfirm) 5441(defun revert-buffer--default (ignore-auto noconfirm)
5442 "Default function for `revert-buffer'.
5443The arguments IGNORE-AUTO and NOCONFIRM are as described for `revert-buffer'.
5444Runs the hooks `before-revert-hook' and `after-revert-hook' at the
5445start and end.
5446
5447Calls `revert-buffer-insert-file-contents-function' to reread the
5448contents of the visited file, with two arguments: the first is the file
5449name, the second is non-nil if reading an auto-save file.
5450
5451This function only handles buffers that are visiting files.
5452Non-file buffers need a custom function."
5423 (with-current-buffer (or (buffer-base-buffer (current-buffer)) 5453 (with-current-buffer (or (buffer-base-buffer (current-buffer))
5424 (current-buffer)) 5454 (current-buffer))
5425 (let* ((auto-save-p (and (not ignore-auto) 5455 (let* ((auto-save-p (and (not ignore-auto)
@@ -5473,6 +5503,10 @@ non-nil, it is called instead of rereading visited file contents."
5473 t))))) 5503 t)))))
5474 5504
5475(defun revert-buffer-insert-file-contents--default-function (file-name auto-save-p) 5505(defun revert-buffer-insert-file-contents--default-function (file-name auto-save-p)
5506 "Default function for `revert-buffer-insert-file-contents-function'.
5507The function `revert-buffer--default' calls this.
5508FILE-NAME is the name of the file. AUTO-SAVE-P is non-nil if this is
5509an auto-save file."
5476 (cond 5510 (cond
5477 ((not (file-exists-p file-name)) 5511 ((not (file-exists-p file-name))
5478 (error (if buffer-file-number 5512 (error (if buffer-file-number
diff --git a/lisp/help.el b/lisp/help.el
index 4434ce27bdb..76c27de8da6 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -446,7 +446,7 @@ is specified by the variable `message-log-max'."
446(defun view-lossage () 446(defun view-lossage ()
447 "Display last 300 input keystrokes. 447 "Display last 300 input keystrokes.
448 448
449To record all your input on a file, use `open-dribble-file'." 449To record all your input, use `open-dribble-file'."
450 (interactive) 450 (interactive)
451 (help-setup-xref (list #'view-lossage) 451 (help-setup-xref (list #'view-lossage)
452 (called-interactively-p 'interactive)) 452 (called-interactively-p 'interactive))
diff --git a/lisp/international/characters.el b/lisp/international/characters.el
index 2b656375ca2..54ab362df04 100644
--- a/lisp/international/characters.el
+++ b/lisp/international/characters.el
@@ -495,6 +495,13 @@ with L, LRE, or LRO Unicode bidi character type.")
495 (modify-category-entry key ?L)))) 495 (modify-category-entry key ?L))))
496 table))) 496 table)))
497 497
498;; Load uni-mirrored.el if available, so that it gets dumped into
499;; Emacs. This allows to start Emacs with force-load-messages in
500;; ~/.emacs, and avoid infinite recursion in bidi_initialize, which
501;; needs to load uni-mirrored.el in order to display the "Loading"
502;; messages.
503(unicode-property-table-internal 'mirroring)
504
498;; Latin 505;; Latin
499 506
500(modify-category-entry '(#x80 . #x024F) ?l) 507(modify-category-entry '(#x80 . #x024F) ?l)
diff --git a/lisp/leim/quail/ipa.el b/lisp/leim/quail/ipa.el
index 322f34ad33e..e0e1c9f0c56 100644
--- a/lisp/leim/quail/ipa.el
+++ b/lisp/leim/quail/ipa.el
@@ -475,7 +475,7 @@ displays them, incorrectly, as separate from the modified glyphs.")
475 ("_d" "̪") ;; Dental U+032A 475 ("_d" "̪") ;; Dental U+032A
476 ("_e" "Ì´") ;; Velarized or pharyngeal U+0334 476 ("_e" "Ì´") ;; Velarized or pharyngeal U+0334
477 477
478 ("<F>" "â†") ;; Global fall; SOUTH EAST ARROW; may be a bit smaller than 478 ("<F>" "↘") ;; Global fall; SOUTH EAST ARROW; may be a bit smaller than
479 ;; intended. 479 ;; intended.
480 ("_F" "Ì‚") ;; Falling tone U+0302 480 ("_F" "Ì‚") ;; Falling tone U+0302
481 ("_G" "Ë ") ;; Velarized U+02E0 481 ("_G" "Ë ") ;; Velarized U+02E0
diff --git a/lisp/mpc.el b/lisp/mpc.el
index 921b5fc8b89..d89231e81b9 100644
--- a/lisp/mpc.el
+++ b/lisp/mpc.el
@@ -491,9 +491,13 @@ to call FUN for any change whatsoever.")
491 (cancel-timer mpc--status-timer) 491 (cancel-timer mpc--status-timer)
492 (setq mpc--status-timer nil))) 492 (setq mpc--status-timer nil)))
493(defun mpc--status-timer-run () 493(defun mpc--status-timer-run ()
494 (with-demoted-errors "MPC: %s" 494 (with-demoted-errors "MPC: %S"
495 (when (process-get (mpc-proc) 'ready) 495 (when (process-get (mpc-proc) 'ready)
496 (with-local-quit (mpc-status-refresh))))) 496 (let* ((buf (mpc-proc-buffer (mpc-proc) 'status))
497 (win (get-buffer-window buf t)))
498 (if (not win)
499 (mpc--status-timer-stop)
500 (with-local-quit (mpc-status-refresh)))))))
497 501
498(defvar mpc--status-idle-timer nil) 502(defvar mpc--status-idle-timer nil)
499(defun mpc--status-idle-timer-start () 503(defun mpc--status-idle-timer-start ()
@@ -518,10 +522,8 @@ to call FUN for any change whatsoever.")
518 ;; client starts playback, we may get a chance to notice it. 522 ;; client starts playback, we may get a chance to notice it.
519 (run-with-idle-timer 10 t 'mpc--status-idle-timer-run)))) 523 (run-with-idle-timer 10 t 'mpc--status-idle-timer-run))))
520(defun mpc--status-idle-timer-run () 524(defun mpc--status-idle-timer-run ()
521 (when (process-get (mpc-proc) 'ready) 525 (mpc--status-timer-start)
522 (with-demoted-errors "MPC: %s" 526 (mpc--status-timer-run))
523 (with-local-quit (mpc-status-refresh))))
524 (mpc--status-timer-start))
525 527
526(defun mpc--status-timers-refresh () 528(defun mpc--status-timers-refresh ()
527 "Start/stop the timers according to whether a song is playing." 529 "Start/stop the timers according to whether a song is playing."
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index d09fb59371a..3486c0a1983 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -250,7 +250,11 @@
250 ;; Catch ${ so that ${var} doesn't screw up indentation. 250 ;; Catch ${ so that ${var} doesn't screw up indentation.
251 ;; This also catches $' to handle 'foo$', although it should really 251 ;; This also catches $' to handle 'foo$', although it should really
252 ;; check that it occurs inside a '..' string. 252 ;; check that it occurs inside a '..' string.
253 ("\\(\\$\\)[{']" (1 ". p")) 253 ("\\(\\$\\)[{']" (1 (unless (and (eq ?\' (char-after (match-end 1)))
254 (save-excursion
255 (not (nth 3 (syntax-ppss
256 (match-beginning 0))))))
257 (string-to-syntax ". p"))))
254 ;; Handle funny names like $DB'stop. 258 ;; Handle funny names like $DB'stop.
255 ("\\$ ?{?^?[_[:alpha:]][_[:alnum:]]*\\('\\)[_[:alpha:]]" (1 "_")) 259 ("\\$ ?{?^?[_[:alpha:]][_[:alnum:]]*\\('\\)[_[:alpha:]]" (1 "_"))
256 ;; format statements 260 ;; format statements
@@ -276,7 +280,7 @@
276 ;; perl-font-lock-special-syntactic-constructs. 280 ;; perl-font-lock-special-syntactic-constructs.
277 ((concat "\\(?:\\(?:^\\|[^$@&%[:word:]]\\)" 281 ((concat "\\(?:\\(?:^\\|[^$@&%[:word:]]\\)"
278 (regexp-opt '("split" "if" "unless" "until" "while" "split" 282 (regexp-opt '("split" "if" "unless" "until" "while" "split"
279 "grep" "map" "not" "or" "and")) 283 "grep" "map" "not" "or" "and" "for" "foreach"))
280 "\\|[?:.,;=!~({[]\\|\\(^\\)\\)[ \t\n]*\\(/\\)") 284 "\\|[?:.,;=!~({[]\\|\\(^\\)\\)[ \t\n]*\\(/\\)")
281 (2 (ignore 285 (2 (ignore
282 (if (and (match-end 1) ; / at BOL. 286 (if (and (match-end 1) ; / at BOL.
@@ -854,11 +858,12 @@ changed by, or (parse-state) if line starts in a quoted string."
854 (and (= (char-syntax (following-char)) ?\)) 858 (and (= (char-syntax (following-char)) ?\))
855 (save-excursion 859 (save-excursion
856 (forward-char 1) 860 (forward-char 1)
857 (forward-sexp -1) 861 (when (condition-case nil (progn (forward-sexp -1) t)
858 (perl-indent-new-calculate 862 (scan-error nil))
859 ;; Recalculate the parsing-start, since we may have jumped 863 (perl-indent-new-calculate
860 ;; dangerously close (typically in the case of nested functions). 864 ;; Recalculate the parsing-start, since we may have jumped
861 'virtual nil (save-excursion (perl-beginning-of-function))))) 865 ;; dangerously close (typically in the case of nested functions).
866 'virtual nil (save-excursion (perl-beginning-of-function))))))
862 (and (and (= (following-char) ?{) 867 (and (and (= (following-char) ?{)
863 (save-excursion (forward-char) (perl-hanging-paren-p))) 868 (save-excursion (forward-char) (perl-hanging-paren-p)))
864 (+ (or default (perl-calculate-indent parse-start)) 869 (+ (or default (perl-calculate-indent parse-start))
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index b0102c55ffd..240cf8aff8c 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -3651,8 +3651,9 @@ returned as is."
3651 (let ((count 0)) 3651 (let ((count 0))
3652 (while (eq (char-before (- (point) count)) last-command-event) 3652 (while (eq (char-before (- (point) count)) last-command-event)
3653 (cl-incf count)) 3653 (cl-incf count))
3654 (= count 3))) 3654 (= count 3))
3655 (save-excursion (insert (make-string 3 last-command-event))))) 3655 (eq (char-after) last-command-event))
3656 (save-excursion (insert (make-string 2 last-command-event)))))
3656 3657
3657(defvar electric-indent-inhibit) 3658(defvar electric-indent-inhibit)
3658 3659
diff --git a/lisp/shell.el b/lisp/shell.el
index c5c1275f19f..9dc9a013f8b 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -792,8 +792,11 @@ and `shell-pushd-dunique' control the behavior of the relevant command.
792Environment variables are expanded, see function `substitute-in-file-name'." 792Environment variables are expanded, see function `substitute-in-file-name'."
793 (if shell-dirtrackp 793 (if shell-dirtrackp
794 ;; We fail gracefully if we think the command will fail in the shell. 794 ;; We fail gracefully if we think the command will fail in the shell.
795 (with-demoted-errors "Couldn't cd: %s" 795;;; (with-demoted-errors "Directory tracker failure: %s"
796 (let ((start (progn (string-match 796 ;; This fails so often that it seems better to just ignore errors (?).
797 ;; Eg even: foo=/tmp; cd $foo is beyond us (bug#17159).
798 (ignore-errors
799 (let ((start (progn (string-match
797 (concat "^" shell-command-separator-regexp) 800 (concat "^" shell-command-separator-regexp)
798 str) ; skip whitespace 801 str) ; skip whitespace
799 (match-end 0))) 802 (match-end 0)))