summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-10-10 11:00:35 +0200
committerAndrea Corallo <akrl@sdf.org>2020-10-10 11:00:35 +0200
commitf7e7ff4fb16bf8fc8e7662f21cd9843e9eb648e8 (patch)
tree8757f25ff7948b6b045bd60f5adf6ebf91ed75ee /lisp
parent138990bbda7ab228e3fde44710426c474b2c1086 (diff)
parent5824c209ba17b97978519ea62478c57010311e88 (diff)
downloademacs-f7e7ff4fb16bf8fc8e7662f21cd9843e9eb648e8.tar.gz
emacs-f7e7ff4fb16bf8fc8e7662f21cd9843e9eb648e8.tar.bz2
emacs-f7e7ff4fb16bf8fc8e7662f21cd9843e9eb648e8.zip
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog.124
-rw-r--r--lisp/ChangeLog.174
-rw-r--r--lisp/calc/calc-bin.el2
-rw-r--r--lisp/cedet/semantic.el10
-rw-r--r--lisp/comint.el3
-rw-r--r--lisp/cus-edit.el289
-rw-r--r--lisp/doc-view.el30
-rw-r--r--lisp/emacs-lisp/bytecomp.el2
-rw-r--r--lisp/frame.el7
-rw-r--r--lisp/gnus/gnus-agent.el1
-rw-r--r--lisp/gnus/gnus-art.el5
-rw-r--r--lisp/gnus/gnus-async.el6
-rw-r--r--lisp/gnus/gnus-sum.el4
-rw-r--r--lisp/gnus/message.el3
-rw-r--r--lisp/ibuffer.el2
-rw-r--r--lisp/info.el6
-rw-r--r--lisp/international/ja-dic-cnv.el6
-rw-r--r--lisp/international/mule-util.el21
-rw-r--r--lisp/international/mule.el6
-rw-r--r--lisp/isearch.el63
-rw-r--r--lisp/leim/quail/latin-post.el35
-rw-r--r--lisp/mouse.el2
-rw-r--r--lisp/net/dbus.el12
-rw-r--r--lisp/progmodes/cc-engine.el71
-rw-r--r--lisp/progmodes/cc-langs.el18
-rw-r--r--lisp/progmodes/grep.el13
-rw-r--r--lisp/progmodes/project.el3
-rw-r--r--lisp/replace.el3
-rw-r--r--lisp/subr.el13
-rw-r--r--lisp/tab-bar.el10
-rw-r--r--lisp/tab-line.el3
-rw-r--r--lisp/textmodes/artist.el22
-rw-r--r--lisp/tmm.el24
-rw-r--r--lisp/vc/vc-git.el4
-rw-r--r--lisp/vc/vc.el38
35 files changed, 486 insertions, 259 deletions
diff --git a/lisp/ChangeLog.12 b/lisp/ChangeLog.12
index a9d0067598e..40aa8c4dc83 100644
--- a/lisp/ChangeLog.12
+++ b/lisp/ChangeLog.12
@@ -16274,7 +16274,7 @@
(c-guess-basic-syntax): Adapt case 5B for the new
`c-just-after-func-arglist-p'. Merge cases 5B.1 and 5B.3.
- Remove cases 5D.1 and 5D.2 since they aren't trigged anymore (case 5B.1
+ Remove cases 5D.1 and 5D.2 since they aren't triggered anymore (case 5B.1
covers all cases now).
* progmodes/cc-defs.el (c-point): Add `bosws' and `eosws'.
@@ -32889,7 +32889,7 @@
2005-01-14 Nick Roberts <nickrob@snap.net.nz>
- * xt-mouse.el (xterm-mouse-event): Compute window co-ordinates
+ * xt-mouse.el (xterm-mouse-event): Compute window coordinates
more carefully.
2005-01-13 Stefan Monnier <monnier@iro.umontreal.ca>
diff --git a/lisp/ChangeLog.17 b/lisp/ChangeLog.17
index 1869f4e4c4a..8039e3f28a3 100644
--- a/lisp/ChangeLog.17
+++ b/lisp/ChangeLog.17
@@ -6540,8 +6540,8 @@
(newsticker--image-get): New arguments FILENAME and DIRECTORY.
Use `url-retrieve' if `newsticker-retrieval-method' is 'intern.
(newsticker--image-download-by-wget): New. Use process properties
- for storing informations.
- (newsticker--image-sentinel): Read informations from process properties.
+ for storing information.
+ (newsticker--image-sentinel): Read information from process properties.
(newsticker--image-save)
(newsticker--image-remove)
(newsticker--image-download-by-url)
diff --git a/lisp/calc/calc-bin.el b/lisp/calc/calc-bin.el
index 33fd1af6ffb..aa10d55e52c 100644
--- a/lisp/calc/calc-bin.el
+++ b/lisp/calc/calc-bin.el
@@ -403,7 +403,7 @@
(setq a (math-clip a w)))
(let ((two-to-sizem1 (math-power-of-2 (1- w)))
(sh (calcFunc-lsh a n w)))
- (cond ((Math-natnum-lessp a two-to-sizem1)
+ (cond ((zerop (logand a two-to-sizem1))
sh)
((Math-lessp n (- 1 w))
(math-add (math-mul two-to-sizem1 2) -1))
diff --git a/lisp/cedet/semantic.el b/lisp/cedet/semantic.el
index 71321e12da3..94bb7fa8bef 100644
--- a/lisp/cedet/semantic.el
+++ b/lisp/cedet/semantic.el
@@ -195,13 +195,13 @@ during a flush when the cache is given a new value of nil.")
(make-variable-buffer-local 'semantic-parse-tree-state)
(defmacro semantic-parse-tree-unparseable ()
- "Indicate that the current buffer is unparseable.
+ "Indicate that the current buffer is unparsable.
It is also true that the parse tree will need either updating or
a rebuild. This state will be changed when the user edits the buffer."
'(setq semantic-parse-tree-state 'unparseable))
(defmacro semantic-parse-tree-unparseable-p ()
- "Return non-nil if the current buffer has been marked unparseable."
+ "Return non-nil if the current buffer has been marked unparsable."
'(eq semantic-parse-tree-state 'unparseable))
(defmacro semantic-parse-tree-set-needs-update ()
@@ -539,14 +539,14 @@ If the buffer cache is out of date, attempt an incremental reparse.
If the buffer has not been parsed before, or if the incremental reparse
fails, then parse the entire buffer.
If a lexical error had been previously discovered and the buffer
-was marked unparseable, then do nothing, and return the cache."
+was marked unparsable, then do nothing, and return the cache."
(and
;; Is this a semantic enabled buffer?
(semantic-active-p)
;; Application hooks say the buffer is safe for parsing
(run-hook-with-args-until-failure
'semantic--before-fetch-tags-hook)
- ;; If the buffer was previously marked unparseable,
+ ;; If the buffer was previously marked unparsable,
;; then don't waste our time.
(not (semantic-parse-tree-unparseable-p))
;; The parse tree actually needs to be refreshed
@@ -617,7 +617,7 @@ Does nothing if the current buffer doesn't need reparsing."
;; do them here, then all the bovination hooks are not run, and
;; we save lots of time.
(cond
- ;; If the buffer was previously marked unparseable,
+ ;; If the buffer was previously marked unparsable,
;; then don't waste our time.
((semantic-parse-tree-unparseable-p)
nil)
diff --git a/lisp/comint.el b/lisp/comint.el
index 611947605fb..944e1ae8c06 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -362,6 +362,7 @@ This variable is buffer-local."
;; Some implementations of passwd use "Password (again)" as the 2nd prompt.
;; Something called "perforce" uses "Enter password:".
;; OpenVPN prints a prompt like: "Enter Auth Password:".
+;; OpenBSD doas prints "doas (user@host) password:".
;; See ert test `comint-test-password-regexp'.
(defcustom comint-password-prompt-regexp
(concat
@@ -370,7 +371,7 @@ This variable is buffer-local."
'("Enter" "enter" "Enter same" "enter same" "Enter the" "enter the"
"Enter Auth" "enter auth" "Old" "old" "New" "new" "'s" "login"
"Kerberos" "CVS" "UNIX" " SMB" "LDAP" "PEM" "SUDO"
- "[sudo]" "Repeat" "Bad" "Retype")
+ "[sudo]" "doas" "Repeat" "Bad" "Retype")
t)
;; Allow for user name to precede password equivalent (Bug#31075).
" +.*\\)"
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index a62b623c44f..9c5d89f89ff 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -487,6 +487,14 @@ Return a list suitable for use in `interactive'."
(if (symbolp v) v nil)
(intern val)))))
+(defvar custom-actioned-widget nil
+ "Widget for which to show the menu of available actions.
+
+When showing a menu for a custom-variable, custom-face or custom-group widget,
+the respective custom-*-action functions bind this variable to that widget, and
+the respective custom-*-menu menus use the binding in their :enable and
+:selected forms.")
+
(defun custom-menu-filter (menu widget)
"Convert MENU to the form used by `widget-choose'.
MENU should be in the same format as `custom-variable-menu'.
@@ -2851,53 +2859,81 @@ otherwise."
(defun custom-variable-standard-value (widget)
(get (widget-value widget) 'standard-value))
-(defvar custom-variable-menu
- `(("Set for Current Session" custom-variable-set
- (lambda (widget)
- (eq (widget-get widget :custom-state) 'modified)))
- ;; Note that in all the backquoted code in this file, we test
- ;; init-file-user rather than user-init-file. This is in case
- ;; cus-edit is loaded by something in site-start.el, because
- ;; user-init-file is not set at that stage.
- ;; https://lists.gnu.org/r/emacs-devel/2007-10/msg00310.html
- ,@(when (or custom-file init-file-user)
- '(("Save for Future Sessions" custom-variable-save
- (lambda (widget)
- (memq (widget-get widget :custom-state)
- '(modified set changed rogue))))))
- ("Undo Edits" custom-redraw
- (lambda (widget)
- (and (default-boundp (widget-value widget))
- (memq (widget-get widget :custom-state) '(modified changed)))))
- ("Revert This Session's Customization" custom-variable-reset-saved
- (lambda (widget)
- (memq (widget-get widget :custom-state)
- '(modified set changed rogue))))
- ,@(when (or custom-file init-file-user)
- '(("Erase Customization" custom-variable-reset-standard
- (lambda (widget)
- (and (get (widget-value widget) 'standard-value)
- (memq (widget-get widget :custom-state)
- '(modified set changed saved rogue)))))))
- ("Set to Backup Value" custom-variable-reset-backup
- (lambda (widget)
- (get (widget-value widget) 'backup-value)))
- ("---" ignore ignore)
- ("Add Comment" custom-comment-show custom-comment-invisible-p)
- ("---" ignore ignore)
- ("Show Current Value" custom-variable-edit
- (lambda (widget)
- (eq (widget-get widget :custom-form) 'lisp)))
- ("Show Saved Lisp Expression" custom-variable-edit-lisp
- (lambda (widget)
- (eq (widget-get widget :custom-form) 'edit))))
- "Alist of actions for the `custom-variable' widget.
+(defvar custom-variable-menu nil
+ "If non-nil, an alist of actions for the `custom-variable' widget.
+
+This variable is kept for backward compatibility reasons, please use
+`custom-variable-extended-menu' instead.
+
Each entry has the form (NAME ACTION FILTER) where NAME is the name of
the menu entry, ACTION is the function to call on the widget when the
menu is selected, and FILTER is a predicate which takes a `custom-variable'
widget as an argument, and returns non-nil if ACTION is valid on that
widget. If FILTER is nil, ACTION is always valid.")
+(defvar custom-variable-extended-menu
+ ;; No need to give the keymap a prompt, `widget-choose' takes care of it.
+ (let ((map (make-sparse-keymap)))
+ (define-key-after map [custom-variable-set]
+ '(menu-item "Set for Current Session" custom-variable-set
+ :enable (eq (widget-get custom-actioned-widget :custom-state)
+ 'modified)))
+ ;; Conditionally add items that depend on having loaded the custom-file,
+ ;; rather than giving it a :visible form, because we used to conditionally
+ ;; add this item when using simplified menus.
+ ;; Note that we test init-file-user rather than user-init-file. This is
+ ;; in case cus-edit is loaded by something in site-start.el, because
+ ;; user-init-file is not set at that stage.
+ ;; https://lists.gnu.org/r/emacs-devel/2007-10/msg00310.html
+ (when (or custom-file init-file-user)
+ (define-key-after map [custom-variable-save]
+ '(menu-item "Save for Future Sessions" custom-variable-save
+ :enable (memq
+ (widget-get custom-actioned-widget :custom-state)
+ '(modified set changed rogue)))))
+ (define-key-after map [custom-redraw]
+ '(menu-item "Undo Edits" custom-redraw
+ :enable (memq
+ (widget-get custom-actioned-widget :custom-state)
+ '(modified changed))))
+ (define-key-after map [custom-variable-reset-saved]
+ '(menu-item "Revert This Session's Customization"
+ custom-variable-reset-saved
+ :enable (memq
+ (widget-get custom-actioned-widget :custom-state)
+ '(modified set changed rogue))))
+ (when (or custom-file init-file-user)
+ (define-key-after map [custom-variable-reset-standard]
+ '(menu-item "Erase Customization" custom-variable-reset-standard
+ :enable (memq
+ (widget-get custom-actioned-widget :custom-state)
+ '(modified set changed saved rogue)))))
+ (define-key-after map [custom-variable-reset-backup]
+ '(menu-item "Set to Backup Value" custom-variable-reset-backup
+ :enable (get
+ (widget-value custom-actioned-widget)
+ 'backup-value)))
+ (define-key-after map [sep0]
+ '(menu-item "---"))
+ (define-key-after map [custom-comment-show]
+ '(menu-item "Add Comment" custom-comment-show
+ :enable (custom-comment-invisible-p custom-actioned-widget)))
+ (define-key-after map [sep1]
+ '(menu-item "---"))
+ (define-key-after map [custom-variable-edit]
+ '(menu-item "Show Current Value" custom-variable-edit
+ :button (:radio . (eq (widget-get custom-actioned-widget
+ :custom-form)
+ 'edit))))
+ (define-key-after map [custom-variable-edit-lisp]
+ '(menu-item "Show Saved Lisp Expression" custom-variable-edit-lisp
+ :button (:radio . (eq (widget-get custom-actioned-widget
+ :custom-form)
+ 'lisp))))
+ map)
+ "A menu for `custom-variable' widgets.
+Used in `custom-variable-action' to show a menu to the user.")
+
(defun custom-variable-action (widget &optional event)
"Show the menu for `custom-variable' WIDGET.
Optional EVENT is the location for the menu."
@@ -2907,12 +2943,17 @@ Optional EVENT is the location for the menu."
(custom-variable-state-set widget))
(custom-redraw-magic widget)
(let* ((completion-ignore-case t)
+ (custom-actioned-widget widget)
(answer (widget-choose (concat "Operation on "
- (custom-unlispify-tag-name
- (widget-get widget :value)))
- (custom-menu-filter custom-variable-menu
- widget)
- event)))
+ (custom-unlispify-tag-name
+ (widget-get widget :value)))
+ ;; Get rid of checks like this one if we ever
+ ;; remove the simplified menus.
+ (if custom-variable-menu
+ (custom-menu-filter custom-variable-menu
+ widget)
+ custom-variable-extended-menu)
+ event)))
(if answer
(funcall answer widget)))))
@@ -3676,39 +3717,66 @@ the present value is saved to its :shown-value property instead."
(widget-put widget :children children)
(custom-face-state-set widget))))))
-(defvar custom-face-menu
- `(("Set for Current Session" custom-face-set)
- ,@(when (or custom-file init-file-user)
- '(("Save for Future Sessions" custom-face-save)))
- ("Undo Edits" custom-redraw
- (lambda (widget)
- (memq (widget-get widget :custom-state) '(modified changed))))
- ("Revert This Session's Customization" custom-face-reset-saved
- (lambda (widget)
- (memq (widget-get widget :custom-state) '(modified set changed))))
- ,@(when (or custom-file init-file-user)
- '(("Erase Customization" custom-face-reset-standard
- (lambda (widget)
- (get (widget-value widget) 'face-defface-spec)))))
- ("---" ignore ignore)
- ("Add Comment" custom-comment-show custom-comment-invisible-p)
- ("---" ignore ignore)
- ("For Current Display" custom-face-edit-selected
- (lambda (widget)
- (not (eq (widget-get widget :custom-form) 'selected))))
- ("For All Kinds of Displays" custom-face-edit-all
- (lambda (widget)
- (not (eq (widget-get widget :custom-form) 'all))))
- ("Show Lisp Expression" custom-face-edit-lisp
- (lambda (widget)
- (not (eq (widget-get widget :custom-form) 'lisp)))))
- "Alist of actions for the `custom-face' widget.
+(defvar custom-face-menu nil
+ "If non-nil, an alist of actions for the `custom-face' widget.
+
+This variable is kept for backward compatibility reasons, please use
+`custom-face-extended-menu' instead.
+
Each entry has the form (NAME ACTION FILTER) where NAME is the name of
the menu entry, ACTION is the function to call on the widget when the
menu is selected, and FILTER is a predicate which takes a `custom-face'
widget as an argument, and returns non-nil if ACTION is valid on that
widget. If FILTER is nil, ACTION is always valid.")
+(defvar custom-face-extended-menu
+ (let ((map (make-sparse-keymap)))
+ (define-key-after map [custom-face-set]
+ '(menu-item "Set for Current Session" custom-face-set))
+ (when (or custom-file init-file-user)
+ (define-key-after map [custom-face-save]
+ '(menu-item "Save for Future Sessions" custom-face-save)))
+ (define-key-after map [custom-redraw]
+ '(menu-item "Undo Edits" custom-redraw
+ :enable (memq
+ (widget-get custom-actioned-widget :custom-state)
+ '(modified changed))))
+ (define-key-after map [custom-face-reset-saved]
+ '(menu-item "Revert This Session's Customization" custom-face-reset-saved
+ :enable (memq
+ (widget-get custom-actioned-widget :custom-state)
+ '(modified set changed))))
+ (when (or custom-file init-file-user)
+ (define-key-after map [custom-face-reset-standard]
+ '(menu-item "Erase Customization" custom-face-reset-standard
+ :enable (get (widget-value custom-actioned-widget)
+ 'face-defface-spec))))
+ (define-key-after map [sep0]
+ '(menu-item "---"))
+ (define-key-after map [custom-comment-show]
+ '(menu-item "Add Comment" custom-comment-show
+ :enable (custom-comment-invisible-p custom-actioned-widget)))
+ (define-key-after map [sep1]
+ '(menu-item "---"))
+ (define-key-after map [custom-face-edit-selected]
+ '(menu-item "For Current Display" custom-face-edit-selected
+ :button (:radio . (eq (widget-get custom-actioned-widget
+ :custom-form)
+ 'selected))))
+ (define-key-after map [custom-face-edit-all]
+ '(menu-item "For All Kinds of Displays" custom-face-edit-all
+ :button (:radio . (eq (widget-get custom-actioned-widget
+ :custom-form)
+ 'all))))
+ (define-key-after map [custom-face-edit-lisp]
+ '(menu-item "Show Lisp Expression" custom-face-edit-lisp
+ :button (:radio . (eq (widget-get custom-actioned-widget
+ :custom-form)
+ 'lisp))))
+ map)
+ "A menu for `custom-face' widgets.
+Used in `custom-face-action' to show a menu to the user.")
+
(defun custom-face-edit-selected (widget)
"Edit selected attributes of the value of WIDGET."
(widget-put widget :custom-state 'unknown)
@@ -3775,12 +3843,15 @@ Optional EVENT is the location for the menu."
(if (eq (widget-get widget :custom-state) 'hidden)
(custom-toggle-hide widget)
(let* ((completion-ignore-case t)
+ (custom-actioned-widget widget)
(symbol (widget-get widget :value))
(answer (widget-choose (concat "Operation on "
(custom-unlispify-tag-name symbol))
- (custom-menu-filter custom-face-menu
- widget)
- event)))
+ (if custom-face-menu
+ (custom-menu-filter custom-face-menu
+ widget)
+ custom-face-extended-menu)
+ event)))
(if answer
(funcall answer widget)))))
@@ -4310,43 +4381,65 @@ This works for both graphical and text displays."
(insert "\n")
(custom-group--draw-horizontal-line)))))
-(defvar custom-group-menu
- `(("Set for Current Session" custom-group-set
- (lambda (widget)
- (eq (widget-get widget :custom-state) 'modified)))
- ,@(when (or custom-file init-file-user)
- '(("Save for Future Sessions" custom-group-save
- (lambda (widget)
- (memq (widget-get widget :custom-state) '(modified set))))))
- ("Undo Edits" custom-group-reset-current
- (lambda (widget)
- (memq (widget-get widget :custom-state) '(modified))))
- ("Revert This Session's Customizations" custom-group-reset-saved
- (lambda (widget)
- (memq (widget-get widget :custom-state) '(modified set))))
- ,@(when (or custom-file init-file-user)
- '(("Erase Customization" custom-group-reset-standard
- (lambda (widget)
- (memq (widget-get widget :custom-state) '(modified set saved)))))))
- "Alist of actions for the `custom-group' widget.
+(defvar custom-group-menu nil
+ "If non-nil, an alist of actions for the `custom-group' widget.
+
+This variable is kept for backward compatibility reasons, please use
+`custom-group-extended-menu' instead.
+
Each entry has the form (NAME ACTION FILTER) where NAME is the name of
the menu entry, ACTION is the function to call on the widget when the
menu is selected, and FILTER is a predicate which takes a `custom-group'
widget as an argument, and returns non-nil if ACTION is valid on that
widget. If FILTER is nil, ACTION is always valid.")
+(defvar custom-group-extended-menu
+ (let ((map (make-sparse-keymap)))
+ (define-key-after map [custom-group-set]
+ '(menu-item "Set for Current Session" custom-group-set
+ :enable (eq (widget-get custom-actioned-widget :custom-state)
+ 'modified)))
+ (when (or custom-file init-file-user)
+ (define-key-after map [custom-group-save]
+ '(menu-item "Save for Future Sessions" custom-group-save
+ :enable (memq
+ (widget-get custom-actioned-widget :custom-state)
+ '(modified set)))))
+ (define-key-after map [custom-group-reset-current]
+ '(menu-item "Undo Edits" custom-group-reset-current
+ :enable (eq (widget-get custom-actioned-widget :custom-state)
+ 'modified)))
+ (define-key-after map [custom-group-reset-saved]
+ '(menu-item "Revert This Session's Customizations"
+ custom-group-reset-saved
+ :enable (memq
+ (widget-get custom-actioned-widget :custom-state)
+ '(modified set))))
+ (when (or custom-file init-file-user)
+ (define-key-after map [custom-group-reset-standard]
+ '(menu-item "Erase Customization" custom-group-reset-standard
+ :enable (memq
+ (widget-get custom-actioned-widget :custom-state)
+ '(modified set saved)))))
+ map)
+ "A menu for `custom-group' widgets.
+Used in `custom-group-action' to show a menu to the user.")
+
(defun custom-group-action (widget &optional event)
"Show the menu for `custom-group' WIDGET.
Optional EVENT is the location for the menu."
(if (eq (widget-get widget :custom-state) 'hidden)
(custom-toggle-hide widget)
(let* ((completion-ignore-case t)
+ (custom-actioned-widget widget)
(answer (widget-choose (concat "Operation on "
(custom-unlispify-tag-name
(widget-get widget :value)))
- (custom-menu-filter custom-group-menu
- widget)
- event)))
+ (if custom-group-menu
+ (custom-menu-filter custom-group-menu
+ widget)
+ custom-group-extended-menu)
+ event)))
(if answer
(funcall answer widget)))))
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 8aaf38aab21..02d89650b8b 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -910,17 +910,27 @@ Resize the containing frame if needed."
(width-diff (- img-width win-width))
(height-diff (- img-height win-height))
(new-frame-params
+ ;; If we can't resize the window, try and resize the frame.
+ ;; We used to compare the `window-width/height` and the
+ ;; `frame-width/height` instead of catching the errors, but
+ ;; it's too fiddly (e.g. in the presence of the miniwindow,
+ ;; the height the frame should be equal to the height of the
+ ;; root window +1).
(append
- (if (= (window-width) (frame-width))
- `((width . (text-pixels
- . ,(+ (frame-text-width) width-diff))))
- (enlarge-window (/ width-diff (frame-char-width)) 'horiz)
- nil)
- (if (= (window-height) (frame-height))
- `((height . (text-pixels
- . ,(+ (frame-text-height) height-diff))))
- (enlarge-window (/ height-diff (frame-char-height)) nil)
- nil))))
+ (condition-case nil
+ (progn
+ (enlarge-window (/ width-diff (frame-char-width)) 'horiz)
+ nil)
+ (error
+ `((width . (text-pixels
+ . ,(+ (frame-text-width) width-diff))))))
+ (condition-case nil
+ (progn
+ (enlarge-window (/ height-diff (frame-char-height)) nil)
+ nil)
+ (error
+ `((height . (text-pixels
+ . ,(+ (frame-text-height) height-diff)))))))))
(when new-frame-params
(modify-frame-parameters (selected-frame) new-frame-params))))
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index b1e27a4dbda..13205011ebf 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -284,7 +284,7 @@ The information is logged to `byte-compile-log-buffer'."
;; This needs to be autoloaded because it needs to be available to
;; Emacs before the byte compiler is loaded, otherwise Emacs will not
;; know that this variable is marked as safe until it is too late.
-;; (See https://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00261.html )
+;; (See https://lists.gnu.org/r/emacs-devel/2018-01/msg00261.html )
;;;###autoload(put 'byte-compile-error-on-warn 'safe-local-variable 'booleanp)
(defconst byte-compile-warning-types
diff --git a/lisp/frame.el b/lisp/frame.el
index 7751ae1303f..29ac862ccd4 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -1244,13 +1244,10 @@ face specs for the new background mode."
;; during startup with -rv on the command
;; line for the initial frame, because frames
;; are not recorded in the pdump file.
- (assq face (frame-face-alist))
+ (assq face (frame-face-alist frame))
(face-spec-match-p face
(face-user-default-spec face)
- ;; FIXME: why selected-frame and
- ;; not the frame that is the
- ;; argument to this function?
- (selected-frame))))
+ frame)))
(push face locally-modified-faces)))
;; Now change to the new frame parameters
(modify-frame-parameters frame params)
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index f748996acc8..6a7e81b3e91 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -3812,7 +3812,6 @@ has been fetched."
t))))
(defun gnus-agent-store-article (article group)
- (declare (obsolete nil "28.1"))
(let* ((gnus-command-method (gnus-find-method-for-group group))
(file (gnus-agent-article-name (number-to-string article) group))
(file-name-coding-system nnmail-pathname-coding-system)
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index b1147924ffa..2d9d5ece01a 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -7092,7 +7092,10 @@ If given a prefix, show the hidden text instead."
gnus-summary-buffer)
(when gnus-keep-backlog
(gnus-backlog-enter-article
- group article (current-buffer))))
+ group article (current-buffer)))
+ (when (and gnus-agent
+ (gnus-agent-group-covered-p group))
+ (gnus-agent-store-article article group)))
(setq result 'article))
(methods
(setq gnus-override-method (pop methods)))
diff --git a/lisp/gnus/gnus-async.el b/lisp/gnus/gnus-async.el
index 9bcb6c33a64..e3e81c8bbce 100644
--- a/lisp/gnus/gnus-async.el
+++ b/lisp/gnus/gnus-async.el
@@ -225,6 +225,12 @@ that was fetched."
(save-excursion
(save-restriction
(narrow-to-region mark (point-max))
+ ;; Put the articles into the agent, if they aren't already.
+ (when (and gnus-agent
+ (gnus-agent-group-covered-p group))
+ (save-restriction
+ (narrow-to-region mark (point-max))
+ (gnus-agent-store-article article group)))
;; Prefetch images for the groups that want that.
(when (fboundp 'gnus-html-prefetch-images)
(gnus-html-prefetch-images summary))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index b3ed5cb6647..561f199531e 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -6240,8 +6240,8 @@ If WHERE is `summary', the summary mode line format will be used."
;; We might have to chop a bit of the string off...
(when (> (length mode-string) max-len)
(setq mode-string
- (concat (truncate-string-to-width mode-string (- max-len 3))
- "...")))))
+ (truncate-string-to-width
+ mode-string (- max-len 3) nil nil t)))))
;; Update the mode line.
(setq mode-line-buffer-identification
(gnus-mode-line-buffer-identification (list mode-string)))
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 77856aeddec..a906e56aac6 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -1106,7 +1106,8 @@ point and mark around the citation text as modified."
If nil, don't insert a signature.
If t, insert `message-signature-file'.
If a function or form, insert its result.
-See `mail-signature' for the recommended format of a signature."
+See `mail-signature' for the recommended format of a signature.
+Also see `message-signature-insert-empty-line'."
:version "23.2"
:type '(choice string
(const :tag "None" nil)
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index c9a748830c1..8ff3b56c5e6 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -1597,7 +1597,7 @@ If point is on a group name, this function operates on that group."
(defun ibuffer-compile-make-substring-form (strvar maxvar from-end-p)
(if from-end-p
;; FIXME: not sure if this case is correct (Bug#24972)
- `(truncate-string-to-width str strlen (- strlen ,maxvar) nil ?\s)
+ `(truncate-string-to-width str strlen (- strlen ,maxvar) ?\s)
`(truncate-string-to-width ,strvar ,maxvar nil ?\s)))
(defun ibuffer-compile-make-format-form (strvar widthform alignment)
diff --git a/lisp/info.el b/lisp/info.el
index 20633fd0598..6dffb3993c4 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -638,14 +638,14 @@ Do the right thing if the file has been compressed or zipped."
(insert-file-contents-literally fullname visit)
(let ((inhibit-read-only t)
(coding-system-for-write 'no-conversion)
- (inhibit-nul-byte-detection t) ; Index nodes include null bytes
+ (inhibit-null-byte-detection t) ; Index nodes include null bytes
(default-directory (or (file-name-directory fullname)
default-directory)))
(or (consp decoder)
(setq decoder (list decoder)))
(apply #'call-process-region (point-min) (point-max)
(car decoder) t t nil (cdr decoder))))
- (let ((inhibit-nul-byte-detection t)) ; Index nodes include null bytes
+ (let ((inhibit-null-byte-detection t)) ; Index nodes include null bytes
(insert-file-contents fullname visit)))
;; Clear the caches of modified Info files.
@@ -1375,7 +1375,7 @@ is non-nil)."
;; Index nodes include null bytes. DIR
;; files should not have indices, but who
;; knows...
- (let ((inhibit-nul-byte-detection t))
+ (let ((inhibit-null-byte-detection t))
(insert-file-contents file)
(setq Info-dir-file-name file)
(push (current-buffer) buffers)
diff --git a/lisp/international/ja-dic-cnv.el b/lisp/international/ja-dic-cnv.el
index f5e70ce7021..5f645b6e8e4 100644
--- a/lisp/international/ja-dic-cnv.el
+++ b/lisp/international/ja-dic-cnv.el
@@ -329,12 +329,12 @@ Optional argument DIRNAME if specified is the directory name under which
the generated Emacs Lisp is saved.
The name of generated file is specified by the variable `ja-dic-filename'."
(interactive "FSKK dictionary file: ")
- (let* ((coding-system-for-read 'euc-japan)
- (skkbuf (get-buffer-create " *skkdic-unannotated*"))
+ (let* ((skkbuf (get-buffer-create " *skkdic-unannotated*"))
(buf (get-buffer-create "*skkdic-work*")))
;; Set skkbuf to an unannotated copy of the dictionary.
(with-current-buffer skkbuf
- (insert-file-contents (expand-file-name filename))
+ (let ((coding-system-for-read 'euc-japan))
+ (insert-file-contents (expand-file-name filename)))
(re-search-forward "^[^;]")
(while (re-search-forward ";[^\n/]*/" nil t)
(replace-match "/")))
diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el
index 660ac58e022..8f316332249 100644
--- a/lisp/international/mule-util.el
+++ b/lisp/international/mule-util.el
@@ -44,9 +44,22 @@
(setq i (1+ i)))))
string)
-(defvar truncate-string-ellipsis "..." ;"…"
+(defvar truncate-string-ellipsis nil
"String to use to indicate truncation.
-Serves as default value of ELLIPSIS argument to `truncate-string-to-width'.")
+Serves as default value of ELLIPSIS argument to `truncate-string-to-width'
+returned by the function `truncate-string-ellipsis'.")
+
+(defun truncate-string-ellipsis ()
+ "Return the string used to indicate truncation.
+Use the value of the variable `truncate-string-ellipsis' when it's non-nil.
+Otherwise, return the Unicode character U+2026 \"HORIZONTAL ELLIPSIS\"
+when it's displayable on the selected frame, or `...'. This function
+needs to be called on every use of `truncate-string-to-width' to
+decide whether the selected frame can display that Unicode character."
+ (cond
+ (truncate-string-ellipsis)
+ ((char-displayable-p ?…) "…")
+ ("...")))
;;;###autoload
(defun truncate-string-to-width (str end-column
@@ -73,7 +86,7 @@ If ELLIPSIS is non-nil, it should be a string which will replace the
end of STR (including any padding) if it extends beyond END-COLUMN,
unless the display width of STR is equal to or less than the display
width of ELLIPSIS. If it is non-nil and not a string, then ELLIPSIS
-defaults to `truncate-string-ellipsis'.
+defaults to `truncate-string-ellipsis', or to three dots when it's nil.
If ELLIPSIS-TEXT-PROPERTY is non-nil, a too-long string will not
be truncated, but instead the elided parts will be covered by a
@@ -81,7 +94,7 @@ be truncated, but instead the elided parts will be covered by a
(or start-column
(setq start-column 0))
(when (and ellipsis (not (stringp ellipsis)))
- (setq ellipsis truncate-string-ellipsis))
+ (setq ellipsis (truncate-string-ellipsis)))
(let ((str-len (length str))
(str-width (string-width str))
(ellipsis-width (if ellipsis (string-width ellipsis) 0))
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 3edea7e7717..607287f59cd 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -856,10 +856,10 @@ VALUE is a CCL program name defined by `define-ccl-program'. The
CCL program reads a character sequence and writes a byte sequence
as an encoding result.
-`:inhibit-nul-byte-detection'
+`:inhibit-null-byte-detection'
VALUE non-nil means Emacs ignore null bytes on code detection.
-See the variable `inhibit-nul-byte-detection'. This attribute
+See the variable `inhibit-null-byte-detection'. This attribute
is meaningful only when `:coding-type' is `undecided'.
`:inhibit-iso-escape-detection'
@@ -904,7 +904,7 @@ non-ASCII files. This attribute is meaningful only when
:ccl-encoder
:valids))
((eq coding-type 'undecided)
- '(:inhibit-nul-byte-detection
+ '(:inhibit-null-byte-detection
:inhibit-iso-escape-detection
:prefer-utf-8))))))
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 781a8c5a93a..f39de79303d 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -271,8 +271,12 @@ are `word-search-regexp' \(`\\[isearch-toggle-word]'), `isearch-symbol-regexp'
(defcustom search-highlight-submatches t
"Whether to highlight regexp subexpressions of the current regexp match.
-The faces used to do the highlights are named `isearch-group-odd' and
-`isearch-group-even'."
+The faces used to do the highlights are named `isearch-group-1',
+`isearch-group-2', etc. (By default, only these 2 are defined.)
+When there are more matches than faces, then faces are reused from the
+beginning, in a cyclical manner, so the `isearch-group-1' face is
+isreused for the third match. If you want to use more distinctive colors,
+you can define more of these faces using the same numbering scheme."
:type 'boolean
:version "28.1")
@@ -887,7 +891,7 @@ variable by the command `isearch-toggle-lax-whitespace'.")
"Stack of search status elements.
Each element is an `isearch--state' struct where the slots are
[STRING MESSAGE POINT SUCCESS FORWARD OTHER-END WORD/REGEXP-FUNCTION
- ERROR WRAPPED BARRIER CASE-FOLD-SEARCH POP-FUN]")
+ ERROR WRAPPED BARRIER CASE-FOLD-SEARCH POP-FUN MATCH-DATA]")
(defvar isearch-string "") ; The current search string.
(defvar isearch-message "") ; text-char-description version of isearch-string
@@ -903,6 +907,7 @@ Each element is an `isearch--state' struct where the slots are
"Recorded minimum/maximal point for the current search.")
(defvar isearch-just-started nil)
(defvar isearch-start-hscroll 0) ; hscroll when starting the search.
+(defvar isearch-match-data nil) ; match-data of regexp-based search
;; case-fold-search while searching.
;; either nil, t, or 'yes. 'yes means the same as t except that mixed
@@ -1221,6 +1226,7 @@ used to set the value of `isearch-regexp-function'."
isearch-small-window nil
isearch-just-started t
isearch-start-hscroll (window-hscroll)
+ isearch-match-data nil
isearch-opoint (point)
search-ring-yank-pointer nil
@@ -1349,8 +1355,8 @@ The last thing is to trigger a new round of lazy highlighting."
(set-window-hscroll (selected-window) current-scroll))))
(if isearch-other-end
(if (< isearch-other-end (point)) ; isearch-forward?
- (isearch-highlight isearch-other-end (point))
- (isearch-highlight (point) isearch-other-end))
+ (isearch-highlight isearch-other-end (point) isearch-match-data)
+ (isearch-highlight (point) isearch-other-end isearch-match-data))
(isearch-dehighlight))))
(setq ;; quit-flag nil not for isearch-mode
isearch-adjusted nil
@@ -1508,7 +1514,8 @@ REGEXP if non-nil says use the regexp search ring."
(barrier isearch-barrier)
(case-fold-search isearch-case-fold-search)
(pop-fun (if isearch-push-state-function
- (funcall isearch-push-state-function))))))
+ (funcall isearch-push-state-function)))
+ (match-data isearch-match-data))))
(string nil :read-only t)
(message nil :read-only t)
(point nil :read-only t)
@@ -1520,7 +1527,8 @@ REGEXP if non-nil says use the regexp search ring."
(wrapped nil :read-only t)
(barrier nil :read-only t)
(case-fold-search nil :read-only t)
- (pop-fun nil :read-only t))
+ (pop-fun nil :read-only t)
+ (match-data nil :read-only t))
(defun isearch--set-state (cmd)
(setq isearch-string (isearch--state-string cmd)
@@ -1532,7 +1540,8 @@ REGEXP if non-nil says use the regexp search ring."
isearch-error (isearch--state-error cmd)
isearch-wrapped (isearch--state-wrapped cmd)
isearch-barrier (isearch--state-barrier cmd)
- isearch-case-fold-search (isearch--state-case-fold-search cmd))
+ isearch-case-fold-search (isearch--state-case-fold-search cmd)
+ isearch-match-data (isearch--state-match-data cmd))
(if (functionp (isearch--state-pop-fun cmd))
(funcall (isearch--state-pop-fun cmd) cmd))
(goto-char (isearch--state-point cmd)))
@@ -1624,6 +1633,7 @@ You can update the global isearch variables by setting new values to
(isearch-adjusted isearch-adjusted)
(isearch-yank-flag isearch-yank-flag)
(isearch-error isearch-error)
+ (isearch-match-data isearch-match-data)
(multi-isearch-file-list-new multi-isearch-file-list)
(multi-isearch-buffer-list-new multi-isearch-buffer-list)
@@ -3432,6 +3442,7 @@ Optional third argument, if t, means if fail just return nil (no error).
(match-beginning 0) (match-end 0)))
(setq retry nil)))
(setq isearch-just-started nil)
+ (setq isearch-match-data (match-data t))
(if isearch-success
(setq isearch-other-end
(if isearch-forward (match-beginning 0) (match-end 0)))))
@@ -3663,27 +3674,27 @@ since they have special meaning in a regexp."
(defvar isearch-overlay nil)
(defvar isearch-submatches-overlays nil)
-(defface isearch-group-odd
+(defface isearch-group-1
'((((class color) (min-colors 88) (background light))
- (:background "#ff00ff" :foreground "lightskyblue1"))
+ (:background "#f000f0" :foreground "lightskyblue1"))
(((class color) (min-colors 88) (background dark))
- (:background "palevioletred3" :foreground "brown4"))
+ (:background "palevioletred1" :foreground "brown4"))
(t (:inherit isearch)))
"Face for highlighting Isearch the odd group matches."
:group 'isearch
:version "28.1")
-(defface isearch-group-even
+(defface isearch-group-2
'((((class color) (min-colors 88) (background light))
- (:background "#800080" :foreground "lightskyblue1"))
+ (:background "#a000a0" :foreground "lightskyblue1"))
(((class color) (min-colors 88) (background dark))
- (:background "#905070" :foreground "brown4"))
+ (:background "palevioletred3" :foreground "brown4"))
(t (:inherit isearch)))
"Face for highlighting Isearch the even group matches."
:group 'isearch
:version "28.1")
-(defun isearch-highlight (beg end)
+(defun isearch-highlight (beg end &optional match-data)
(if search-highlight
(if isearch-overlay
;; Overlay already exists, just move it.
@@ -3693,18 +3704,24 @@ since they have special meaning in a regexp."
;; 1001 is higher than lazy's 1000 and ediff's 100+
(overlay-put isearch-overlay 'priority 1001)
(overlay-put isearch-overlay 'face isearch-face)))
+
(when (and search-highlight-submatches
isearch-regexp)
(mapc 'delete-overlay isearch-submatches-overlays)
(setq isearch-submatches-overlays nil)
- (dotimes (i (/ (length (match-data)) 2))
- (unless (zerop i)
- (let ((ov (make-overlay (match-beginning i) (match-end i))))
- (overlay-put ov 'face (if (zerop (mod i 2))
- 'isearch-group-even
- 'isearch-group-odd))
- (overlay-put ov 'priority 1002)
- (push ov isearch-submatches-overlays))))))
+ (let ((submatch-data (cddr (butlast match-data)))
+ (group 0)
+ ov face)
+ (while submatch-data
+ (setq group (1+ group))
+ (setq ov (make-overlay (pop submatch-data) (pop submatch-data))
+ face (intern-soft (format "isearch-group-%d" group)))
+ ;; Recycle faces from beginning.
+ (unless (facep face)
+ (setq group 1 face 'isearch-group-1))
+ (overlay-put ov 'face face)
+ (overlay-put ov 'priority 1002)
+ (push ov isearch-submatches-overlays)))))
(defun isearch-dehighlight ()
(when isearch-overlay
diff --git a/lisp/leim/quail/latin-post.el b/lisp/leim/quail/latin-post.el
index a033739efba..1d6aeddc060 100644
--- a/lisp/leim/quail/latin-post.el
+++ b/lisp/leim/quail/latin-post.el
@@ -937,7 +937,7 @@ Doubling the postfix separates the letter and postfix: e.g. a\\='\\=' -> a\\='
(quail-define-package
"danish-postfix" "Latin-1" "DA<" t
- "Danish input method (rule: AE -> Æ, OE -> Ø, AA -> Å, E\\=' -> É)
+ "Danish input method (rule: AE -> Æ, OE -> Ø, AA -> Å, E\\=' -> É, E= -> €)
Doubling the postfix separates the letter and postfix: e.g. aee -> ae
"
@@ -951,6 +951,7 @@ Doubling the postfix separates the letter and postfix: e.g. aee -> ae
("AA" ?Å)
("aa" ?å)
("E'" ?É)
+ ("E=" ?€)
("e'" ?é)
("AEE" ["AE"])
@@ -960,6 +961,7 @@ Doubling the postfix separates the letter and postfix: e.g. aee -> ae
("AAA" ["AA"])
("aaa" ["aa"])
("E''" ["E'"])
+ ("E==" ["E="])
("e''" ["e'"])
)
@@ -1034,6 +1036,7 @@ AE -> Ä
AEE -> AE
OE -> Ö
OEE -> OE
+E= -> €
"
nil t nil nil nil nil nil nil nil nil t)
@@ -1042,11 +1045,13 @@ OEE -> OE
("ae" ?ä)
("OE" ?Ö)
("oe" ?ö)
+ ("E=" ?€)
("AEE" ["AE"])
("aee" ["ae"])
("OEE" ["OE"])
("oee" ["oe"])
+ ("E==" ["E="])
)
(quail-define-package
@@ -1061,6 +1066,8 @@ Par exemple: a\\=` -> à e\\=' -> é.
En doublant la frappe des diacritiques, ils s'isoleront de la lettre.
Par exemple: e\\='\\=' -> e\\='
+€ est produit par E=.
+
Œ est produit par O/."
nil t nil nil nil nil nil nil nil nil t)
@@ -1073,6 +1080,7 @@ Par exemple: e\\='\\=' -> e\\='
("E'" ?É)
("E^" ?Ê)
("E\"" ?Ë)
+ ("E=" ?€)
("e`" ?è)
("e'" ?é)
("e^" ?ê)
@@ -1104,6 +1112,7 @@ Par exemple: e\\='\\=' -> e\\='
("E''" ["E'"])
("E^^" ["E^"])
("E\"\"" ["E\""])
+ ("E==" ["E="])
("e``" ["e`"])
("e''" ["e'"])
("e^^" ["e^"])
@@ -1140,6 +1149,7 @@ ue -> ü (not after a/e/q)
uee -> ue
sz -> ß
szz -> sz
+E= -> €
"
nil t nil nil nil nil nil nil nil nil t)
@@ -1152,6 +1162,7 @@ szz -> sz
("ue" ?ü)
("sz" ?ß)
("SZ" ?ẞ)
+ ("E=" ?€)
("AEE" ["AE"])
("aee" ["ae"])
@@ -1168,6 +1179,7 @@ szz -> sz
("Aue" ["Aue"])
("que" ["que"])
("Que" ["Que"])
+ ("E==" ["E="])
)
(quail-define-package
@@ -1184,6 +1196,7 @@ AE -> Æ
OE -> Ö
D/ -> Ð (eth)
T/ -> Þ (thorn)
+E= -> €
Doubling the postfix separates the letter and postfix: e.g. a\\='\\=' -> a\\='
" nil t nil nil nil nil nil nil nil nil t)
@@ -1238,7 +1251,7 @@ Doubling the postfix separates the letter and postfix: e.g. a\\='\\=' -> a\\='
a\\=` -> à A\\=` -> À e\\=' -> é << -> «
e\\=` -> è E\\=` -> È E\\=' -> É >> -> »
-i\\=` -> ì I\\=` -> Ì o_ -> º
+i\\=` -> ì I\\=` -> Ì E= -> € o_ -> º
o\\=` -> ò O\\=` -> Ò a_ -> ª
u\\=` -> ù U\\=` -> Ù
@@ -1252,6 +1265,7 @@ Doubling the postfix separates the letter and postfix: e.g. a\\=`\\=` -> a\\=`
("a`" ?à)
("E`" ?È)
("E'" ?É)
+ ("E=" ?€)
("e`" ?è)
("e'" ?é)
("I`" ?Ì)
@@ -1269,6 +1283,7 @@ Doubling the postfix separates the letter and postfix: e.g. a\\=`\\=` -> a\\=`
("a``" ["a`"])
("E``" ["E`"])
("E''" ["E'"])
+ ("E==" ["E="])
("e``" ["e`"])
("e''" ["e'"])
("I``" ["I`"])
@@ -1285,7 +1300,8 @@ Doubling the postfix separates the letter and postfix: e.g. a\\=`\\=` -> a\\=`
(quail-define-package
"norwegian-postfix" "Latin-1" "NO<" t
- "Norwegian (Norsk) input method (rule: AE->Æ OE->Ø AA->Å E\\='->É)
+ "Norwegian (Norsk) input method (rule: AE->Æ OE->Ø AA->Å E\\='->É
+ E= -> €)
Doubling the postfix separates the letter and postfix: e.g. aee -> ae
"
@@ -1299,6 +1315,7 @@ Doubling the postfix separates the letter and postfix: e.g. aee -> ae
("AA" ?Å)
("aa" ?å)
("E'" ?É)
+ ("E=" ?€)
("e'" ?é)
("AEE" ["AE"])
@@ -1308,6 +1325,7 @@ Doubling the postfix separates the letter and postfix: e.g. aee -> ae
("AAA" ["AA"])
("aaa" ["aa"])
("E''" ["E'"])
+ ("E==" ["E="])
("e''" ["e'"])
)
@@ -1322,6 +1340,7 @@ aa -> å
a\" -> ä
o\" -> ö
e\\=' -> é
+E= -> €
Doubling the postfix separates the letter and postfix:
aee -> ae o\"\" -> o\" etc.
@@ -1339,6 +1358,7 @@ aee -> ae o\"\" -> o\" etc.
("O\"" ?Ö)
("o\"" ?ö)
("E'" ?É)
+ ("E=" ?€)
("e'" ?é)
("AEE" ["AE"])
@@ -1352,6 +1372,7 @@ aee -> ae o\"\" -> o\" etc.
("O\"\"" ["O\""])
("o\"\"" ["o\""])
("E''" ["E'"])
+ ("E==" ["E="])
("e''" ["e'"])
)
@@ -1361,6 +1382,7 @@ aee -> ae o\"\" -> o\" etc.
A\\=' -> Á
E\\=' -> É
+E= -> €
I\\=' -> Í
O\\=' -> Ó
U\\=' -> Ú
@@ -1376,6 +1398,7 @@ a\\='\\=' -> a\\=' n~~ -> n~, etc.
("A'" ?Á)
("a'" ?á)
("E'" ?É)
+ ("E=" ?€)
("e'" ?é)
("I'" ?Í)
("i'" ?í)
@@ -1393,6 +1416,7 @@ a\\='\\=' -> a\\=' n~~ -> n~, etc.
("A''" ["A'"])
("a''" ["a'"])
("E''" ["E'"])
+ ("E==" ["E="])
("e''" ["e'"])
("I''" ["I'"])
("i''" ["i'"])
@@ -1410,7 +1434,8 @@ a\\='\\=' -> a\\=' n~~ -> n~, etc.
(quail-define-package
"swedish-postfix" "Latin-1" "SV<" t
- "Swedish (Svenska) input method (rule: AA -> Å AE -> Ä OE -> Ö E\\=' -> É)
+ "Swedish (Svenska) input method
+(rule: AA -> Å AE -> Ä OE -> Ö E\\=' -> É E= -> €)
Doubling the postfix separates the letter and postfix: e.g. aee -> ae
" nil t nil nil nil nil nil nil nil nil t)
@@ -1423,6 +1448,7 @@ Doubling the postfix separates the letter and postfix: e.g. aee -> ae
("OE" ?Ö)
("oe" ?ö)
("E'" ?É)
+ ("E=" ?€)
("e'" ?é)
("AAA" ["AA"])
@@ -1432,6 +1458,7 @@ Doubling the postfix separates the letter and postfix: e.g. aee -> ae
("OEE" ["OE"])
("oee" ["oe"])
("E''" ["E'"])
+ ("E==" ["E="])
("e''" ["e'"])
)
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 9e7eee61e57..9d4492f1bde 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -2622,7 +2622,7 @@ is copied instead of being cut."
;; this for all windows on all visible frames. In addition we save
;; also the cursor type for the window's buffer so we can restore it
;; in case we modified it.
- ;; https://lists.gnu.org/archive/html/emacs-devel/2017-12/msg00090.html
+ ;; https://lists.gnu.org/r/emacs-devel/2017-12/msg00090.html
(walk-window-tree
(lambda (window)
(setq states
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index 48712a9c3d8..77ba5266dcb 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -912,8 +912,9 @@ discovering the still incomplete interface."
(defun dbus-unregister-object (object)
"Unregister OBJECT from D-Bus.
OBJECT must be the result of a preceding `dbus-register-method',
-`dbus-register-property' or `dbus-register-signal' call. It
-returns t if OBJECT has been unregistered, nil otherwise.
+`dbus-register-signal', `dbus-register-property' or
+`dbus-register-monitor' call. The function returns t if OBJECT
+has been unregistered, nil otherwise.
When OBJECT identifies the last method or property, which is
registered for the respective service, Emacs releases its
@@ -951,7 +952,10 @@ association to the service from D-Bus."
(when (eq type :signal)
(dbus-call-method
bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus
- "RemoveMatch" (nth 4 elt)))))
+ "RemoveMatch" (nth 4 elt)))
+ ;; Delete monitor connection by reestablishing private bus.
+ (when (eq type :monitor)
+ (dbus-init-bus bus 'private))))
;; Check, whether there is still a registered function or property
;; for the given service. If not, unregister the service from the
@@ -2037,7 +2041,7 @@ either a method name, a signal name, or an error name."
(when dbus-debug (message "%s" dbus-registered-objects-table))
;; Return the object.
- (list key key1)))
+ (list key (list nil nil handler))))
(defconst dbus-monitor-method-call
(propertize "method-call" 'face 'font-lock-function-name-face)
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 4e336c0a064..1649f507363 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -8426,6 +8426,7 @@ comment at the start of cc-engine.el for more info."
;; o - 'found if it's a type that matches one in `c-found-types';
;; o - 'maybe if it's an identifier that might be a type;
;; o - 'decltype if it's a decltype(variable) declaration; - or
+ ;; o - 'no-id if "auto" precluded parsing a type identifier.
;; o - nil if it can't be a type (the point isn't moved then).
;;
;; The point is assumed to be at the beginning of a token.
@@ -8450,9 +8451,12 @@ comment at the start of cc-engine.el for more info."
;; prefix of a type.
(when c-opt-type-modifier-prefix-key ; e.g. "const" "volatile", but NOT "typedef"
(while (looking-at c-opt-type-modifier-prefix-key)
+ (when (looking-at c-no-type-key)
+ (setq res 'no-id))
(goto-char (match-end 1))
(c-forward-syntactic-ws)
- (setq res 'prefix)))
+ (or (eq res 'no-id)
+ (setq res 'prefix))))
(cond
((looking-at c-typeof-key) ; e.g. C++'s "decltype".
@@ -8503,28 +8507,30 @@ comment at the start of cc-engine.el for more info."
(setq res t))
(unless res (goto-char start))) ; invalid syntax
- ((progn
- (setq pos nil)
- (if (looking-at c-identifier-start)
- (save-excursion
- (setq id-start (point)
- name-res (c-forward-name))
- (when name-res
- (setq id-end (point)
- id-range c-last-identifier-range))))
- (and (cond ((looking-at c-primitive-type-key)
- (setq res t))
- ((c-with-syntax-table c-identifier-syntax-table
- (looking-at c-known-type-key))
- (setq res 'known)))
- (or (not id-end)
- (>= (save-excursion
- (save-match-data
- (goto-char (match-end 1))
- (c-forward-syntactic-ws)
- (setq pos (point))))
- id-end)
- (setq res nil))))
+ ((and
+ (not (eq res 'no-id))
+ (progn
+ (setq pos nil)
+ (if (looking-at c-identifier-start)
+ (save-excursion
+ (setq id-start (point)
+ name-res (c-forward-name))
+ (when name-res
+ (setq id-end (point)
+ id-range c-last-identifier-range))))
+ (and (cond ((looking-at c-primitive-type-key)
+ (setq res t))
+ ((c-with-syntax-table c-identifier-syntax-table
+ (looking-at c-known-type-key))
+ (setq res 'known)))
+ (or (not id-end)
+ (>= (save-excursion
+ (save-match-data
+ (goto-char (match-end 1))
+ (c-forward-syntactic-ws)
+ (setq pos (point))))
+ id-end)
+ (setq res nil)))))
;; Looking at a primitive or known type identifier. We've
;; checked for a name first so that we don't go here if the
;; known type match only is a prefix of another name.
@@ -8599,7 +8605,7 @@ comment at the start of cc-engine.el for more info."
(goto-char start)
(setq res nil)))))
- (when res
+ (when (not (memq res '(nil no-id)))
;; Skip trailing type modifiers. If any are found we know it's
;; a type.
(when c-opt-type-modifier-key
@@ -9452,12 +9458,11 @@ This function might do hidden buffer changes."
(when (setq found-type (c-forward-type t)) ; brace-block-too
;; Found a known or possible type or a prefix of a known type.
- (when (and (c-major-mode-is 'c++-mode) ; C++11 style "auto"?
- (eq prev-kwd-sym (c-keyword-sym "auto"))
- (looking-at "[=(]")) ; FIXME!!! proper regexp.
- (setq new-style-auto t)
- (setq found-type nil)
- (goto-char start)) ; position of foo in "auto foo"
+ (when (and (eq found-type 'no-id)
+ (save-excursion
+ (and (c-forward-name) ; over the identifier
+ (looking-at "[=(]")))) ; FIXME!!! proper regexp.
+ (setq new-style-auto t)) ; position of foo in "auto foo"
(when at-type
;; Got two identifiers with nothing but whitespace
@@ -9540,7 +9545,7 @@ This function might do hidden buffer changes."
;; over all specifiers and type identifiers. The reason
;; to do this for a known type prefix is to make things
;; like "unsigned INT16" work.
- (and found-type (not (eq found-type t))))))
+ (and found-type (not (memq found-type '(t no-id)))))))
(cond
((eq at-type t)
@@ -9560,6 +9565,10 @@ This function might do hidden buffer changes."
;; followed by another type.
(setq at-type t))
+ ((eq at-type 'no-id)
+ ;; For an auto type, we assume we definitely have a type construct.
+ (setq at-type t))
+
((not at-type)
;; Got no type but set things up to continue anyway to handle
;; the various cases when a declaration doesn't start with a
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index eee8e304273..7e36e1f2e3c 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -2122,7 +2122,9 @@ fontified with the keyword face and not the type face."
t nil
c '("const" "restrict" "volatile")
c++ '("const" "noexcept" "volatile")
- objc '("const" "volatile"))
+ objc '("const" "volatile")
+ t (append (c-lang-const c-no-type-kwds)
+ (c-lang-const c-type-modifier-prefix-kwds)))
(c-lang-defconst c-opt-type-modifier-prefix-key
;; Adorned regexp matching `c-type-modifier-prefix-kwds', or nil in
@@ -2349,6 +2351,16 @@ will be handled."
t (c-make-keywords-re t (c-lang-const c-using-kwds)))
(c-lang-defvar c-using-key (c-lang-const c-using-key))
+(c-lang-defconst c-no-type-kwds
+ "Keywords which remove the need to specify a type in declarations"
+ t nil
+ c++ '("auto"))
+
+(c-lang-defconst c-no-type-key
+ ;; Regexp matching an entry from `c-no-type-kwds'
+ t (c-make-keywords-re t (c-lang-const c-no-type-kwds)))
+(c-lang-defvar c-no-type-key (c-lang-const c-no-type-key))
+
(c-lang-defconst c-typeless-decl-kwds
"Keywords introducing declarations where the (first) identifier
\(declarator) follows directly after the keyword, without any type.
@@ -2362,7 +2374,6 @@ will be handled."
;; {...}").
t (append (c-lang-const c-class-decl-kwds)
(c-lang-const c-brace-list-decl-kwds))
- c++ (append (c-lang-const c-typeless-decl-kwds) '("auto")) ; C++11.
;; Note: "manages" for CORBA CIDL clashes with its presence on
;; `c-type-list-kwds' for IDL.
idl (append (c-lang-const c-typeless-decl-kwds)
@@ -2397,7 +2408,8 @@ If any of these also are on `c-type-list-kwds', `c-ref-list-kwds',
`c-<>-type-kwds', or `c-<>-arglist-kwds' then the associated clauses
will be handled."
t nil
- (c c++) '("auto" "extern" "inline" "register" "static")
+ (c c++) '("extern" "inline" "register" "static")
+ c (append '("auto") (c-lang-const c-modifier-kwds))
c++ (append '("constexpr" "explicit" "friend" "mutable" "template"
"thread_local" "virtual")
;; "using" is now handled specially (2020-09-14).
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 279eb4d54b1..f028a4279d1 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -703,10 +703,10 @@ The value depends on `grep-command', `grep-template',
(let ((grep-options
(concat (if grep-use-null-device "-n" "-nH")
(if grep-use-null-filename-separator " --null")
- (if (grep-probe grep-program
- `(nil nil nil "-e" "foo" ,null-device)
- nil 1)
- " -e"))))
+ (when (grep-probe grep-program
+ `(nil nil nil "-e" "foo" ,null-device)
+ nil 1)
+ " -e"))))
(unless grep-command
(setq grep-command
(format "%s %s %s " grep-program
@@ -1121,6 +1121,11 @@ command before it's run."
grep-find-ignored-files
" --exclude=")))))
(when command
+ (when (grep-probe grep-program
+ `(nil nil nil "--directories=skip" "foo"
+ ,null-device)
+ nil 1)
+ (setq command (concat command " --directories=skip")))
(if confirm
(setq command
(read-from-minibuffer "Confirm: "
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 8c550b57682..40a804b00ec 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -66,6 +66,9 @@
;; `project-combine-directories' and `project-subtract-directories',
;; mainly for use in the abovementioned generics' implementations.
;;
+;; `project-known-project-roots' and `project-remember-project' to
+;; interact with the "known projects" list.
+;;
;; Commands:
;;
;; `project-prefix-map' contains the full list of commands defined in
diff --git a/lisp/replace.el b/lisp/replace.el
index 2d17ec9097c..e363924501f 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1576,7 +1576,8 @@ is not modified."
(concat
"Next buffer to search "
(cond
- ((eq read-buffer-function #'ido-read-buffer)
+ ((or (eq read-buffer-function #'ido-read-buffer)
+ (bound-and-true-p ido-everywhere))
(substitute-command-keys
"(\\<ido-completion-map>\\[ido-select-text] to end): "))
((bound-and-true-p fido-mode)
diff --git a/lisp/subr.el b/lisp/subr.el
index b1e382b80ee..bd8dd07b30e 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -837,10 +837,11 @@ Elements of ALIST that are not conses are ignored."
If KEY is not found in ALIST, return DEFAULT.
Equality with KEY is tested by TESTFN, defaulting to `eq'.
-You can use `alist-get' in PLACE expressions. This will modify
-an existing association (more precisely, the first one if
-multiple exist), or add a new element to the beginning of ALIST,
-destructively modifying the list stored in ALIST.
+You can use `alist-get' in \"place expressions\"; i.e., as a
+generalized variable. Doing this will modify an existing
+association (more precisely, the first one if multiple exist), or
+add a new element to the beginning of ALIST, destructively
+modifying the list stored in ALIST.
Example:
@@ -1627,8 +1628,8 @@ be a list of the form returned by `event-start' and `event-end'."
(make-obsolete-variable 'x-gtk-use-window-move nil "26.1")
(defvaralias 'messages-buffer-max-lines 'message-log-max)
-(define-obsolete-variable-alias 'inhibit-null-byte-detection
- 'inhibit-nul-byte-detection "27.1")
+(define-obsolete-variable-alias 'inhibit-nul-byte-detection
+ 'inhibit-null-byte-detection "28.1")
(make-obsolete-variable 'load-dangerous-libraries
"no longer used." "27.1")
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 9c6b9cbc048..26049552242 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -363,22 +363,18 @@ to `tab-bar-tab-name-truncated'."
:group 'tab-bar
:version "27.1")
-(defvar tab-bar-tab-name-ellipsis nil)
+(defvar tab-bar-tab-name-ellipsis t)
(defun tab-bar-tab-name-truncated ()
"Generate tab name from the buffer of the selected window.
Truncate it to the length specified by `tab-bar-tab-name-truncated-max'.
Append ellipsis `tab-bar-tab-name-ellipsis' in this case."
- (let ((tab-name (buffer-name (window-buffer (minibuffer-selected-window))))
- (ellipsis (cond
- (tab-bar-tab-name-ellipsis)
- ((char-displayable-p ?…) "…")
- ("..."))))
+ (let ((tab-name (buffer-name (window-buffer (minibuffer-selected-window)))))
(if (< (length tab-name) tab-bar-tab-name-truncated-max)
tab-name
(propertize (truncate-string-to-width
tab-name tab-bar-tab-name-truncated-max nil nil
- ellipsis)
+ tab-bar-tab-name-ellipsis)
'help-echo tab-name))))
diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 8da554a3267..46bf89f14eb 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -240,8 +240,7 @@ to `tab-line-tab-name-truncated-buffer'."
:group 'tab-line
:version "27.1")
-(defvar tab-line-tab-name-ellipsis
- (if (char-displayable-p ?…) "…" "..."))
+(defvar tab-line-tab-name-ellipsis t)
(defun tab-line-tab-name-truncated-buffer (buffer &optional _buffers)
"Generate tab name from BUFFER.
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index 80682883c85..7196692001e 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -4943,6 +4943,12 @@ If optional argument STATE is positive, turn borders on."
(cons (+ window-x window-start-x)
(+ window-y window-start-y))))
+(defun artist--adjust-x (x)
+ "Adjust the X position wrt. `display-line-numbers-mode'."
+ (let ((adjust (line-number-display-width)))
+ (if (= adjust 0)
+ x
+ (- x adjust 2))))
(defun artist-mouse-draw-continously (ev)
"Generic function for shapes that require 1 point as input.
@@ -4964,7 +4970,7 @@ The event, EV, is the mouse event."
(ev-start (event-start ev))
(initial-win (posn-window ev-start))
(ev-start-pos (artist-coord-win-to-buf (posn-col-row ev-start)))
- (x1 (car ev-start-pos))
+ (x1 (artist--adjust-x (car ev-start-pos)))
(y1 (cdr ev-start-pos))
(shape)
(timer))
@@ -4981,7 +4987,7 @@ The event, EV, is the mouse event."
(member 'down (event-modifiers ev)))
(setq ev-start-pos (artist-coord-win-to-buf
(posn-col-row (event-start ev))))
- (setq x1 (car ev-start-pos))
+ (setq x1 (artist--adjust-x (car ev-start-pos)))
(setq y1 (cdr ev-start-pos))
;; Cancel previous timer
@@ -5061,7 +5067,7 @@ The event, EV, is the mouse event."
(ev-start (event-start ev))
(initial-win (posn-window ev-start))
(ev-start-pos (artist-coord-win-to-buf (posn-col-row ev-start)))
- (x1-last (car ev-start-pos))
+ (x1-last (artist--adjust-x (car ev-start-pos)))
(y1-last (cdr ev-start-pos))
(x2 x1-last)
(y2 y1-last)
@@ -5153,7 +5159,7 @@ The event, EV, is the mouse event."
;;
(setq ev-start-pos (artist-coord-win-to-buf
(posn-col-row (event-start ev))))
- (setq x2 (car ev-start-pos))
+ (setq x2 (artist--adjust-x (car ev-start-pos)))
(setq y2 (cdr ev-start-pos))
;; Draw the new shape (if not rubber-banding, place both marks)
@@ -5180,7 +5186,7 @@ The event, EV, is the mouse event."
;; set x2 and y2
(setq ev-start-pos (artist-coord-win-to-buf
(posn-col-row (event-start ev))))
- (setq x2 (car ev-start-pos))
+ (setq x2 (artist--adjust-x (car ev-start-pos)))
(setq y2 (cdr ev-start-pos))
;; First undraw last shape
@@ -5265,7 +5271,7 @@ Operation is done once. The event, EV, is the mouse event."
(arrow-set-fn (artist-go-get-arrow-set-fn-from-symbol op))
(ev-start (event-start ev))
(ev-start-pos (artist-coord-win-to-buf (posn-col-row ev-start)))
- (x1 (car ev-start-pos))
+ (x1 (artist--adjust-x (car ev-start-pos)))
(y1 (cdr ev-start-pos)))
(select-window (posn-window ev-start))
(artist-funcall init-fn x1 y1)
@@ -5299,7 +5305,7 @@ The event, EV, is the mouse event."
(ev-start (event-start ev))
(initial-win (posn-window ev-start))
(ev-start-pos (artist-coord-win-to-buf (posn-col-row ev-start)))
- (x1 (car ev-start-pos))
+ (x1 (artist--adjust-x (car ev-start-pos)))
(y1 (cdr ev-start-pos))
(x2)
(y2)
@@ -5313,7 +5319,7 @@ The event, EV, is the mouse event."
(member 'down (event-modifiers ev)))
(setq ev-start-pos (artist-coord-win-to-buf
(posn-col-row (event-start ev))))
- (setq x2 (car ev-start-pos))
+ (setq x2 (artist--adjust-x (car ev-start-pos)))
(setq y2 (cdr ev-start-pos))
(if (not (eq initial-win (posn-window (event-start ev))))
diff --git a/lisp/tmm.el b/lisp/tmm.el
index e9f3f5b038f..0e83f427f5f 100644
--- a/lisp/tmm.el
+++ b/lisp/tmm.el
@@ -50,14 +50,19 @@ The ordering of the return value respects `menu-bar-final-items'."
(menu-end '()))
(map-keymap
(lambda (key binding)
- (push (cons key binding)
- ;; If KEY is the name of an item that we want to put last,
- ;; move it to the end.
- (if (memq key menu-bar-final-items)
- menu-end
- menu-bar)))
+ (let ((pos (seq-position menu-bar-final-items key))
+ (menu-item (cons key binding)))
+ (if pos
+ ;; If KEY is the name of an item that we want to put
+ ;; last, store it separately with explicit ordering for
+ ;; sorting.
+ (push (cons pos menu-item) menu-end)
+ (push menu-item menu-bar))))
(tmm-get-keybind [menu-bar]))
- `(keymap ,@(nreverse menu-bar) ,@(nreverse menu-end))))
+ `(keymap ,@(nreverse menu-bar)
+ ,@(mapcar #'cdr (sort menu-end
+ (lambda (a b)
+ (< (car a) (car b))))))))
;;;###autoload (define-key global-map "\M-`" 'tmm-menubar)
;;;###autoload (define-key global-map [menu-bar mouse-1] 'tmm-menubar-mouse)
@@ -96,7 +101,10 @@ to invoke `tmm-menubar' instead, customize the variable
(or (null visible)
(eval visible)))))))
(setq column (+ column (length name) 1)))))
- menu-bar))))
+ menu-bar)
+ ;; Check the last menu item.
+ (when (> column x-position)
+ (setq menu-bar-item prev-key)))))
(tmm-prompt menu-bar nil menu-bar-item)))
;;;###autoload
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 6ff6951dbc9..b1880c0f7b0 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1795,9 +1795,9 @@ The difference to vc-do-command is that this function always invokes
(defun vc-git--call (buffer command &rest args)
;; We don't need to care the arguments. If there is a file name, it
;; is always a relative one. This works also for remote
- ;; directories. We enable `inhibit-nul-byte-detection', otherwise
+ ;; directories. We enable `inhibit-null-byte-detection', otherwise
;; Tramp's eol conversion might be confused.
- (let ((inhibit-nul-byte-detection t)
+ (let ((inhibit-null-byte-detection t)
(coding-system-for-read
(or coding-system-for-read vc-git-log-output-coding-system))
(coding-system-for-write
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 3852a64550a..46c44fa54b7 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1038,7 +1038,9 @@ If the current buffer is in `vc-dir' or Dired mode, FILESET is the
list of marked files, or the current directory if no files are
marked.
Otherwise, if the current buffer is visiting a version-controlled
-file, FILESET is a single-file list containing that file's name.
+file or is an indirect buffer whose base buffer visits a
+version-controlled file, FILESET is a single-file list containing
+that file's name.
Otherwise, if ALLOW-UNREGISTERED is non-nil and the visited file
is unregistered, FILESET is a single-file list containing the
name of the visited file.
@@ -1052,6 +1054,14 @@ possible values of STATE are explained in `vc-state', and MODEL in
the returned list.
BEWARE: this function may change the current buffer."
+ (with-current-buffer (or (buffer-base-buffer) (current-buffer))
+ (vc-deduce-fileset-1 not-state-changing
+ allow-unregistered
+ state-model-only-files)))
+
+(defun vc-deduce-fileset-1 (not-state-changing
+ allow-unregistered
+ state-model-only-files)
(let (backend)
(cond
((derived-mode-p 'vc-dir-mode)
@@ -1073,7 +1083,7 @@ BEWARE: this function may change the current buffer."
(derived-mode-p 'dired-mode)))))
(progn ;FIXME: Why not `with-current-buffer'? --Stef.
(set-buffer vc-parent-buffer)
- (vc-deduce-fileset not-state-changing allow-unregistered state-model-only-files)))
+ (vc-deduce-fileset-1 not-state-changing allow-unregistered state-model-only-files)))
((and (not buffer-file-name)
(setq backend (vc-responsible-backend default-directory)))
(list backend nil))
@@ -1883,6 +1893,10 @@ state of each file in the fileset."
t (list backend (list rootdir)) rev1 rev2
(called-interactively-p 'interactive)))))
+(defun vc-maybe-buffer-sync (not-urgent)
+ (with-current-buffer (or (buffer-base-buffer) (current-buffer))
+ (when buffer-file-name (vc-buffer-sync not-urgent))))
+
;;;###autoload
(defun vc-diff (&optional historic not-urgent)
"Display diffs between file revisions.
@@ -1895,6 +1909,7 @@ saving the buffer."
(interactive (list current-prefix-arg t))
(if historic
(call-interactively 'vc-version-diff)
+ (vc-maybe-buffer-sync not-urgent)
(let ((fileset (vc-deduce-fileset t)))
(vc-buffer-sync-fileset fileset not-urgent)
(vc-diff-internal t fileset nil nil
@@ -1981,7 +1996,7 @@ saving the buffer."
(interactive (list current-prefix-arg t))
(if historic
(call-interactively 'vc-version-ediff)
- (when buffer-file-name (vc-buffer-sync not-urgent))
+ (vc-maybe-buffer-sync not-urgent)
(vc-version-ediff (cadr (vc-deduce-fileset t)) nil nil)))
;;;###autoload
@@ -1998,7 +2013,7 @@ saving the buffer."
(if historic
;; We want the diff for the VC root dir.
(call-interactively 'vc-root-version-diff)
- (when buffer-file-name (vc-buffer-sync not-urgent))
+ (vc-maybe-buffer-sync not-urgent)
(let ((backend (vc-deduce-backend))
(default-directory default-directory)
rootdir working-revision)
@@ -2038,17 +2053,18 @@ Return nil if the root directory cannot be identified."
If the current file is named `F', the revision is named `F.~REV~'.
If `F.~REV~' already exists, use it instead of checking it out again."
(interactive
- (save-current-buffer
+ (with-current-buffer (or (buffer-base-buffer) (current-buffer))
(vc-ensure-vc-buffer)
(list
(vc-read-revision "Revision to visit (default is working revision): "
(list buffer-file-name)))))
- (vc-ensure-vc-buffer)
- (let* ((file buffer-file-name)
- (revision (if (string-equal rev "")
- (vc-working-revision file)
- rev)))
- (switch-to-buffer-other-window (vc-find-revision file revision))))
+ (with-current-buffer (or (buffer-base-buffer) (current-buffer))
+ (vc-ensure-vc-buffer)
+ (let* ((file buffer-file-name)
+ (revision (if (string-equal rev "")
+ (vc-working-revision file)
+ rev)))
+ (switch-to-buffer-other-window (vc-find-revision file revision)))))
(defun vc-find-revision (file revision &optional backend)
"Read REVISION of FILE into a buffer and return the buffer.