[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/pgtk bdeb189: Merge remote-tracking branch 'origin/master' into
From: |
Po Lu |
Subject: |
feature/pgtk bdeb189: Merge remote-tracking branch 'origin/master' into feature/pgtk |
Date: |
Tue, 7 Dec 2021 20:03:41 -0500 (EST) |
branch: feature/pgtk
commit bdeb189cf202f9661f783aebd4852b401858958b
Merge: d9b3f66 176c632
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Merge remote-tracking branch 'origin/master' into feature/pgtk
---
doc/lispref/frames.texi | 4 +-
doc/misc/eshell.texi | 2 +-
etc/NEWS | 35 +++++-
etc/tutorials/TUTORIAL | 4 +-
etc/tutorials/TUTORIAL.he | 11 ++
etc/tutorials/TUTORIAL.it | 19 +++-
lisp/cedet/semantic/fw.el | 2 -
lisp/comint.el | 54 +++++++--
lisp/emacs-lisp/bytecomp.el | 3 +-
lisp/emulation/viper-util.el | 3 -
lisp/frame.el | 8 +-
lisp/image-dired.el | 108 ++++++++++--------
lisp/image-mode.el | 10 +-
lisp/mail/rmail.el | 8 +-
lisp/mh-e/mh-e.el | 2 +-
lisp/mouse.el | 17 +--
lisp/net/browse-url.el | 227 ++-----------------------------------
lisp/net/tramp-sh.el | 4 +
lisp/progmodes/prog-mode.el | 4 +-
lisp/strokes.el | 15 ++-
lisp/textmodes/etc-authors-mode.el | 10 +-
lisp/textmodes/texinfo.el | 1 -
lisp/vc/vc-git.el | 3 +-
lisp/view.el | 124 ++++++++++----------
lisp/xwidget.el | 6 +
src/image.c | 8 +-
26 files changed, 301 insertions(+), 391 deletions(-)
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index 1dfd0d4..712c842 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -171,7 +171,9 @@ usually not run for the initial frame, since Emacs reads
the initial
file only after creating that frame. However, if the initial frame is
specified to use a separate minibuffer frame (@pxref{Minibuffers and
Frames}), the functions will be run for both, the minibuffer-less and
-the minibuffer frame.
+the minibuffer frame. Alternatively, you can add functions to these
+hooks in your ``early init file'' (@pxref{Init File}), in which case
+they will be in effect for the initial frame as well.
@defvar frame-inherited-parameters
This variable specifies the list of frame parameters that a newly
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi
index 4e5288e..a87dd43 100644
--- a/doc/misc/eshell.texi
+++ b/doc/misc/eshell.texi
@@ -632,7 +632,7 @@ disabled by default.
@item setq
@cmindex setq
Set variable values, using the function @code{setq} like a command.
-@xref{Setting variables,,, elisp, GNU Emacs Lisp Reference Manual}.
+@xref{Setting Variables,,, elisp, GNU Emacs Lisp Reference Manual}.
@item source
@cmindex source
diff --git a/etc/NEWS b/etc/NEWS
index a8b7dc5..e8e0c91 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -553,6 +553,16 @@ user options that are no longer needed are now obsolete:
'image-dired-temp-image-file'.
---
+*** Navigation and marking commands now work in image display buffer.
+The following new bindings have been added:
+
+ n / SPC image-dired-display-previous-thumbnail-original
+ p / DEL image-dired-display-next-thumbnail-original
+ m image-dired-mark-thumb-original-file
+ d image-dired-flag-thumb-original-file
+ u image-dired-unmark-thumb-original-file
+
+---
*** Reduce dependency on external "exiftool" command.
The 'image-dired-copy-with-exif-file-name' no longer requires an
external "exiftool" command to be available. The user options
@@ -562,7 +572,7 @@ external "exiftool" command to be available. The user
options
---
*** New command for the thumbnail buffer.
The new command 'image-dired-unmark-all-marks' has been added. It is
-bound to 'U' in the thumbnail buffer.
+bound to 'U' in the thumbnail and display buffer.
---
*** Support Thumbnail Managing Standard v0.9.0 (Dec 2020).
@@ -583,13 +593,16 @@ used for images that are flagged for deletion in the
Dired buffer
associated with Image-Dired.
---
-*** The 'image-dired-slideshow-start' command has been revamped.
+*** 'image-dired-slideshow-start' is now bound to 'S'.
+It is bound in both the thumbnail and display buffer.
+
+---
+*** The 'image-dired-slideshow-start' command no longer prompts.
It no longer inconveniently prompts for a number of images and a
delay: it runs indefinitely, but stops automatically on any command.
You can set the delay with a prefix argument, or a negative prefix
-argument to prompt anyways. Customize the user option
-'image-dired-slideshow-delay' to change the default, which is 5
-seconds. It is bound to 'S' in the thumbnail and display buffer.
+argument to prompt for a delay. Customize the user option
+'image-dired-slideshow-delay' to change the default from 5 seconds.
---
*** Support for bookmark.el.
@@ -681,6 +694,18 @@ When calling 'abbreviate-file-name' on a Tramp filename,
the result
will abbreviate the user's home directory, for example by abbreviating
"/ssh:user@host:/home/user" to "/ssh:user@host:~".
+** Browse URL
+
+---
+*** Support for the Netscape web browser has been removed.
+This support has been obsolete since Emacs 25.1. The final version of
+the Netscape web browser was released in February, 2008.
+
+---
+*** Support for the Galeon web browser has been removed.
+This support has been obsolete since Emacs 25.1. The final version of
+the Galeon web browser was released in September, 2008.
+
* New Modes and Packages in Emacs 29.1
diff --git a/etc/tutorials/TUTORIAL b/etc/tutorials/TUTORIAL
index cbb3334..c5f2e68 100644
--- a/etc/tutorials/TUTORIAL
+++ b/etc/tutorials/TUTORIAL
@@ -304,8 +304,8 @@ position, type <DEL>. This is the key on the keyboard
usually labeled
"Backspace"--the same one you normally use, outside Emacs, to delete
the last character typed.
-There may also be another key on your keyboard labeled <Delete>, but
-that's not the one we refer to as <DEL>.
+There is usually another key on your keyboard labeled <Delete>, but
+that's not the one we refer to as <DEL> in Emacs.
>> Do this now--type a few characters, then delete them by
typing <DEL> a few times. Don't worry about this file
diff --git a/etc/tutorials/TUTORIAL.he b/etc/tutorials/TUTORIAL.he
index 465768a..fc4b769 100644
--- a/etc/tutorials/TUTORIAL.he
+++ b/etc/tutorials/TUTORIAL.he
@@ -985,6 +985,17 @@ find-file.
בנוסף, מדריך למשתמש מתאר עוד הרבה מאד תכונות של Emacs.
+* התקנת חבילות הרחבה
+--------------------
+קיימות לא מעט חבילות תוכנה עבור Emacs אשר מרחיבות את היכולות שלו. חבילות
+הרחבה אלו נכתבו ע״י קהילת משתמשי Emacs והן מהוות אוסף עשיר של תכונות
+התומכות בשפות תכנות נוספות, ערכות נושא נוספות, תוספים לשילוב יישומים
+חיצוניים, ועוד ועוד.
+
+לצפיה ברשימת חבילות ההרחבה הזמינות, יש להקיש M-x list-packages. בתצוגה
+שתיפתח בעקבות זאת תוכלו לעיין בתיאור של חבילות, לבחור חבילות להתקנה במחשב
+שלכם, להסיר חבילות, ועוד. פרטים נוספים לגבי ניהול חבילות הרחבה ניתן למצוא
+במדריך למשתמש.
* לסיום
-------
diff --git a/etc/tutorials/TUTORIAL.it b/etc/tutorials/TUTORIAL.it
index 68bf403..aa2fb45 100644
--- a/etc/tutorials/TUTORIAL.it
+++ b/etc/tutorials/TUTORIAL.it
@@ -1178,14 +1178,27 @@ quei file. Dired è descritta nel manuale Emacs nel
nodo chiamato
Il manuale descrive molte altre funzionalità di Emacs.
+* INSTALLAZIONE DI ULTERIORI PACCHETTI
+
+Ci sono tantissimi pacchetti che estendono le funzionalità di Emacs,
+scritti dalla comunità. Questi pacchetti includono il supporto a
+nuovi linguaggi, aggiungono temi addizionali, rendono possibile
+interoperare con applicazioni esterne e molto, molto altro.
+
+Per vedere una lista di tutti i pacchetti disponibili, inserisci
+M-x list-packages. Nell'elenco che viene mostrato, puoi installare o
+disinstallare pacchetti, o leggerne la descrizione. Consulta il
+manuale per ulteriori informazioni sulla gestione dei pacchetti.
+
+
* CONCLUSIONI
-------------
Per chiudere una sessione di Emacs si usa C-x C-c.
-Questo documento è stato creato per essere utile a tutti i nuovi
-utenti, se qualcosa per te è stato poco chiaro non dare la colpa a te
-stesso: lamentati!
+Questo documento è pensato per essere comprensibile a tutti i nuovi
+utenti, quindi se hai trovato qualcosa di poco chiaro, non dare la
+colpa a te stesso: lamentati!
* COPIA
diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el
index 16e8ce8..3502cda 100644
--- a/lisp/cedet/semantic/fw.el
+++ b/lisp/cedet/semantic/fw.el
@@ -66,8 +66,6 @@
(defalias 'semantic-mode-line-update #'force-mode-line-update)
-;; Since Emacs 22 major mode functions should use `run-mode-hooks' to
-;; run major mode hooks.
(define-obsolete-function-alias 'semantic-run-mode-hooks #'run-mode-hooks
"28.1")
;; Fancy compat usage now handled in cedet-compat
diff --git a/lisp/comint.el b/lisp/comint.el
index 544f0b8..5f99f56 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -730,6 +730,8 @@ Entry to this mode runs the hooks on `comint-mode-hook'."
(or (file-remote-p default-directory) ""))
(setq-local comint-accum-marker (make-marker))
(setq-local font-lock-defaults '(nil t))
+ (add-function :filter-return (local 'filter-buffer-substring-function)
+ #'comint--unmark-string-as-output)
(add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
(add-hook 'isearch-mode-hook 'comint-history-isearch-setup nil t)
(add-hook 'completion-at-point-functions 'comint-completion-at-point nil t)
@@ -1815,7 +1817,8 @@ Ignore duplicates if `comint-input-ignoredups' is
non-nil."
(ring-insert comint-input-ring cmd)))
(defconst comint--prompt-rear-nonsticky
- '(field inhibit-line-move-field-capture read-only font-lock-face)
+ '( field inhibit-line-move-field-capture read-only font-lock-face
+ insert-in-front-hooks)
"Text properties we set on the prompt and don't want to leak past it.")
(defun comint-send-input (&optional no-newline artificial)
@@ -2152,14 +2155,7 @@ Make backspaces delete the previous character."
(goto-char (process-mark process)) ; In case a filter moved it.
(unless comint-use-prompt-regexp
- (with-silent-modifications
- (add-text-properties comint-last-output-start (point)
- `(rear-nonsticky
- ,comint--prompt-rear-nonsticky
- front-sticky
- (field inhibit-line-move-field-capture)
- field output
- inhibit-line-move-field-capture t))))
+ (comint--mark-as-output comint-last-output-start (point)))
;; Highlight the prompt, where we define `prompt' to mean
;; the most recent output that doesn't end with a newline.
@@ -2191,6 +2187,46 @@ Make backspaces delete the previous character."
,comint--prompt-rear-nonsticky)))
(goto-char saved-point)))))))
+(defun comint--mark-as-output (beg end)
+ (with-silent-modifications
+ (add-text-properties
+ beg end
+ `(rear-nonsticky
+ ,comint--prompt-rear-nonsticky
+ front-sticky
+ (field inhibit-line-move-field-capture)
+ field output
+ inhibit-line-move-field-capture t
+ ;; Text inserted by a user in the middle of process output
+ ;; should be marked as output. This is needed for commands
+ ;; such as `yank' or `just-one-space' which don't use
+ ;; `insert-and-inherit' and thus bypass default text property
+ ;; inheritance.
+ insert-in-front-hooks
+ (,#'comint--mark-as-output ,#'comint--mark-yanked-as-output)))))
+
+(defun comint--mark-yanked-as-output (beg end)
+ ;; `yank' removes the field text property from the text it inserts
+ ;; due to `yank-excluded-properties', so arrange for this text
+ ;; property to be reapplied in the `after-change-functions'.
+ (let (fun)
+ (setq
+ fun
+ (lambda (beg1 end1 _len1)
+ (remove-hook 'after-change-functions fun t)
+ (when (and (= beg beg1)
+ (= end end1))
+ (comint--mark-as-output beg1 end1))))
+ (add-hook 'after-change-functions fun nil t)))
+
+(defun comint--unmark-string-as-output (string)
+ (remove-list-of-text-properties
+ 0 (length string)
+ '( rear-nonsticky front-sticky field
+ inhibit-line-move-field-capture insert-in-front-hooks)
+ string)
+ string)
+
(defun comint-preinput-scroll-to-bottom ()
"Go to the end of buffer in all windows showing it.
Movement occurs if point in the selected window is not after the process mark,
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index b1afa6f..644d9f1 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2230,8 +2230,7 @@ With argument ARG, insert value in current buffer after
the form."
(byte-compile-depth 0)
(byte-compile-maxdepth 0)
(byte-compile-output nil)
- ;; This allows us to get the positions of symbols read; it's
- ;; new in Emacs 22.1.
+ ;; This allows us to get the positions of symbols read.
(read-with-symbol-positions inbuffer)
(read-symbol-positions-list nil)
;; #### This is bound in b-c-close-variables.
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index 71043b1..0af54b3 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -79,9 +79,6 @@
(defmacro viper-frame-value (variable)
"Return the value of VARIABLE local to the current frame, if there is one.
Otherwise return the normal value."
- ;; Frame-local variables are obsolete from Emacs 22.2 onwards,
- ;; so we do it by hand instead.
- ;; Buffer-local values take precedence over frame-local ones.
`(if (local-variable-p ',variable)
,variable
;; Distinguish between no frame parameter and a frame parameter
diff --git a/lisp/frame.el b/lisp/frame.el
index f790fa1..1392904 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -808,12 +808,16 @@ also select the new frame."
new-frame))
(defvar before-make-frame-hook nil
- "Functions to run before `make-frame' creates a new frame.")
+ "Functions to run before `make-frame' creates a new frame.
+Note that these functions are usually not run for the initial
+frame, unless you add them to the hook in your early-init file.")
(defvar after-make-frame-functions nil
"Functions to run after `make-frame' created a new frame.
The functions are run with one argument, the newly created
-frame.")
+frame.
+Note that these functions are usually not run for the initial
+frame, unless you add them to the hook in your early-init file.")
(defvar after-setting-font-hook nil
"Functions to run after a frame's font has been changed.")
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index fe0c3b7..d75ccfe 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -1445,11 +1445,20 @@ for. The default is to look for `dired-marker-char'."
"In Dired, return t if file on current line is flagged for deletion."
(image-dired-dired-file-marked-p dired-del-marker))
+(defmacro image-dired--with-thumbnail-buffer (&rest body)
+ (declare (indent defun) (debug t))
+ `(if-let ((buf (get-buffer image-dired-thumbnail-buffer)))
+ (with-current-buffer buf
+ (if-let ((win (get-buffer-window buf)))
+ (with-selected-window win
+ ,@body)
+ ,@body))
+ (user-error "No such buffer: %s" image-dired-thumbnail-buffer)))
+
(defmacro image-dired--on-file-in-dired-buffer (&rest body)
"Run BODY with point on file at point in Dired buffer.
Should be called from commands in `image-dired-thumbnail-mode'."
- (declare (indent defun)
- (debug 1))
+ (declare (indent defun) (debug t))
`(let ((file-name (image-dired-original-file-name))
(dired-buf (image-dired-associated-dired-buffer)))
(if (not (and dired-buf file-name))
@@ -1461,40 +1470,45 @@ Should be called from commands in
`image-dired-thumbnail-mode'."
(defun image-dired-mark-thumb-original-file ()
"Mark original image file in associated Dired buffer."
- (interactive nil image-dired-thumbnail-mode)
- (image-dired--on-file-in-dired-buffer
- (dired-mark 1))
- (image-dired-forward-image))
+ (interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
+ (image-dired--with-thumbnail-buffer
+ (image-dired--on-file-in-dired-buffer
+ (dired-mark 1))
+ (image-dired-forward-image)))
(defun image-dired-unmark-thumb-original-file ()
"Unmark original image file in associated Dired buffer."
- (interactive nil image-dired-thumbnail-mode)
- (image-dired--on-file-in-dired-buffer
- (dired-unmark 1))
- (image-dired-forward-image))
+ (interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
+ (image-dired--with-thumbnail-buffer
+ (image-dired--on-file-in-dired-buffer
+ (dired-unmark 1))
+ (image-dired-forward-image)))
(defun image-dired-flag-thumb-original-file ()
"Flag original image file for deletion in associated Dired buffer."
- (interactive nil image-dired-thumbnail-mode)
- (image-dired--on-file-in-dired-buffer
- (dired-flag-file-deletion 1))
- (image-dired-forward-image))
+ (interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
+ (image-dired--with-thumbnail-buffer
+ (image-dired--on-file-in-dired-buffer
+ (dired-flag-file-deletion 1))
+ (image-dired-forward-image)))
(defun image-dired-toggle-mark-thumb-original-file ()
"Toggle mark on original image file in associated Dired buffer."
- (interactive nil image-dired-thumbnail-mode)
- (image-dired--on-file-in-dired-buffer
- (if (image-dired-dired-file-marked-p)
- (dired-unmark 1)
- (dired-mark 1))))
+ (interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
+ (image-dired--with-thumbnail-buffer
+ (image-dired--on-file-in-dired-buffer
+ (if (image-dired-dired-file-marked-p)
+ (dired-unmark 1)
+ (dired-mark 1)))))
(defun image-dired-unmark-all-marks ()
"Remove all marks from all files in associated Dired buffer.
Also update the marks in the thumbnail buffer."
- (interactive nil image-dired-thumbnail-mode)
- (with-current-buffer (image-dired-associated-dired-buffer)
- (dired-unmark-all-marks))
- (image-dired-thumb-update-marks))
+ (interactive nil image-dired-thumbnail-mode image-dired-display-image-mode)
+ (image-dired--with-thumbnail-buffer
+ (with-current-buffer (image-dired-associated-dired-buffer)
+ (dired-unmark-all-marks))
+ (image-dired-thumb-update-marks)))
(defun image-dired-jump-original-dired-buffer ()
"Jump to the Dired buffer associated with the current image file.
@@ -1638,16 +1652,16 @@ You probably want to use this together with
(defvar image-dired-display-image-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "S" #'image-dired-slideshow-start)
+ (define-key map (kbd "SPC") #'image-dired-display-next-thumbnail-original)
+ (define-key map (kbd "DEL")
#'image-dired-display-previous-thumbnail-original)
+ (define-key map "n" #'image-dired-display-next-thumbnail-original)
+ (define-key map "p" #'image-dired-display-previous-thumbnail-original)
+ (define-key map "m" #'image-dired-mark-thumb-original-file)
+ (define-key map "d" #'image-dired-flag-thumb-original-file)
+ (define-key map "u" #'image-dired-unmark-thumb-original-file)
+ (define-key map "U" #'image-dired-unmark-all-marks)
;; Disable keybindings from `image-mode-map' that doesn't make sense here.
(define-key map "o" nil) ; image-save
- (define-key map "n" nil) ; image-next-file
- (define-key map "p" nil) ; image-previous-file
- ;; FIXME: Should be replaced with image-dired commands.
- (define-key map (kbd "DEL") nil) ; image-next-file
- (define-key map (kbd "SPC") nil) ; image-next-file
- ;; FIXME: Should be replaced with image-dired commands.
- (define-key map "m" nil) ; image-mode-mark-file
- (define-key map "u" nil) ; image-mode-unmark-file
map)
"Keymap for `image-dired-display-image-mode'.")
@@ -1777,21 +1791,22 @@ This is used by `image-dired-slideshow-start'."
(image-dired-slideshow-stop)))
(defun image-dired-slideshow-start (&optional arg)
- "Start a slideshow.
-Wait `image-dired-slideshow-delay' seconds before showing the
-next image.
+ "Start a slideshow, waiting `image-dired-slideshow-delay' between images.
With prefix argument ARG, wait that many seconds before going to
the next image.
With a negative prefix argument, prompt user for the delay."
(interactive "P" image-dired-thumbnail-mode image-dired-display-image-mode)
- (let ((delay (if (> arg 0)
- arg
- (string-to-number
- (read-string
- (let ((delay (number-to-string
image-dired-slideshow-delay)))
- (format-prompt "Delay, in seconds. Decimals are accepted"
delay) delay))))))
+ (let ((delay (if (not arg)
+ image-dired-slideshow-delay
+ (if (> arg 0)
+ arg
+ (string-to-number
+ (let ((delay (number-to-string
image-dired-slideshow-delay)))
+ (read-string
+ (format-prompt "Delay, in seconds. Decimals are
accepted" delay))
+ delay))))))
(setq image-dired--slideshow-timer
(run-with-timer
0 delay
@@ -2128,16 +2143,17 @@ function. The result is a couple of new files in
;;; Thumbnail mode (cont.)
(defun image-dired-display-next-thumbnail-original (&optional arg)
- "In thumbnail buffer, move to next thumbnail and display the image.
+ "Move to the next image in the thumbnail buffer and display it.
With prefix ARG, move that many thumbnails."
- (interactive "p" image-dired-thumbnail-mode)
- (image-dired-forward-image arg t)
- (image-dired-display-thumbnail-original-image))
+ (interactive "p" image-dired-thumbnail-mode image-dired-display-image-mode)
+ (image-dired--with-thumbnail-buffer
+ (image-dired-forward-image arg t)
+ (image-dired-display-thumbnail-original-image)))
(defun image-dired-display-previous-thumbnail-original (arg)
- "In thumbnail buffer, move to previous thumbnail and display image.
+ "Move to the previous image in the thumbnail buffer and display it.
With prefix ARG, move that many thumbnails."
- (interactive "p" image-dired-thumbnail-mode)
+ (interactive "p" image-dired-thumbnail-mode image-dired-display-image-mode)
(image-dired-display-next-thumbnail-original (- arg)))
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index c2b145d..6ff7859 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -60,15 +60,11 @@ Its value should be one of the following:
- nil, meaning no resizing.
- t, meaning to scale the image down to fit in the window.
- `fit-window', meaning to fit the image to the window.
- - `fit-height', meaning to fit the image to the window height.
- - `fit-width', meaning to fit the image to the window width.
- A number, which is a scale factor (the default size is 1).
Resizing will always preserve the aspect ratio of the image."
:type '(choice (const :tag "No resizing" nil)
(const :tag "Fit to window" fit-window)
- (const :tag "Fit to window height" fit-height)
- (const :tag "Fit to window width" fit-width)
(other :tag "Scale down to fit window" t)
(number :tag "Scale factor" 1))
:version "29.1"
@@ -78,7 +74,7 @@ Resizing will always preserve the aspect ratio of the image."
"Max size (in percent) to scale up to when `image-auto-resize' is
`fit-window'.
Can be either a number larger than 100, or nil, which means no
max size."
- :type '(choice (const nil "No max")
+ :type '(choice (const :tag "No max" nil)
natnum)
:version "29.1"
:group 'image)
@@ -100,9 +96,11 @@ Its value should be one of the following:
- nil, meaning no resizing.
- t, meaning to scale the image down to fit in the window.
- `fit-window', meaning to fit the image to the window.
+ - A number, which is a scale factor (the default size is 1).
+
+There is also support for these values, obsolete since Emacs 29.1:
- `fit-height', meaning to fit the image to the window height.
- `fit-width', meaning to fit the image to the window width.
- - A number, which is a scale factor (the default size is 1).
Resizing will always preserve the aspect ratio of the image.")
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 9fbc9ba..afcb7f3 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -4125,10 +4125,8 @@ typically for purposes of moderating a list."
"A regexp that matches the separator before the text of a failed message.")
(defvar mail-mime-unsent-header "^Content-Type: message/rfc822 *$"
- "A regexp that matches the header of a MIME body part with a failed message.")
+ "A regexp that matches the header of a MIME body part with a failed
message.")
-;; This is a cut-down version of rmail-clear-headers from Emacs 22.
-;; It doesn't have the same functionality, hence the name change.
(defun rmail-delete-headers (regexp)
"Delete any mail headers matching REGEXP.
The message should be narrowed to just the headers."
@@ -4136,10 +4134,6 @@ The message should be narrowed to just the headers."
(goto-char (point-min))
(while (re-search-forward regexp nil t)
(beginning-of-line)
- ;; This code from Emacs 22 doesn't seem right, since r-n-h is
- ;; just for display.
-;;; (if (looking-at rmail-nonignored-headers)
-;;; (forward-line 1)
(delete-region (point)
(save-excursion
(if (re-search-forward "\n[^ \t]" nil t)
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 4e1ca28..17faff0 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -1607,7 +1607,7 @@ on the \"INS\" button. Enter a \"Spool File\" of
\"~/mail/mh-e\", a
\"Folder\" of \"mh-e\", and a \"Key Binding\" of \"m\".
You can use \"xbuffy\" to automate the incorporation of this mail
-using the Emacs 22 command \"emacsclient\" as follows:
+using \"emacsclient\" as follows:
box ~/mail/mh-e
title mh-e
diff --git a/lisp/mouse.el b/lisp/mouse.el
index af1eca1..459cce4 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -489,14 +489,15 @@ Some context functions add menu items below the
separator."
`(menu-item "All"
,(lambda (e) (interactive "e") (mark-thing-at-mouse e
'buffer))
:help "Mark the whole buffer for a subsequent cut/copy"))
- (when (let* ((pos (posn-point (event-end click)))
- (char (when pos (char-after pos))))
- (or (and char (eq (char-syntax char) ?\"))
- (nth 3 (save-excursion (syntax-ppss pos)))))
- (define-key-after submenu [mark-string]
- `(menu-item "String"
- ,(lambda (e) (interactive "e") (mark-thing-at-mouse e
'string))
- :help "Mark the string at click for a subsequent
cut/copy")))
+ (with-current-buffer (window-buffer (posn-window (event-end click)))
+ (when (let* ((pos (posn-point (event-end click)))
+ (char (when pos (char-after pos))))
+ (or (and char (eq (char-syntax char) ?\"))
+ (nth 3 (save-excursion (syntax-ppss pos)))))
+ (define-key-after submenu [mark-string]
+ `(menu-item "String"
+ ,(lambda (e) (interactive "e") (mark-thing-at-mouse e
'string))
+ :help "Mark the string at click for a subsequent
cut/copy"))))
(define-key-after submenu [mark-line]
`(menu-item "Line"
,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'line))
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 645c28f..40b584f 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -240,33 +240,6 @@ be used instead."
:version "27.1"
:type 'regexp)
-(defcustom browse-url-netscape-program "netscape"
- ;; Info about netscape-remote from Karl Berry.
- "The name by which to invoke Netscape.
-
-The free program `netscape-remote' from
-<URL:http://home.netscape.com/newsref/std/remote.c> is said to start
-up very much quicker than `netscape'. Reported to compile on a GNU
-system, given vroot.h from the same directory, with cc flags
- -DSTANDALONE -L/usr/X11R6/lib -lXmu -lX11."
- :type 'string)
-
-(make-obsolete-variable 'browse-url-netscape-program nil "25.1")
-
-(defcustom browse-url-netscape-arguments nil
- "A list of strings to pass to Netscape as arguments."
- :type '(repeat (string :tag "Argument")))
-
-(make-obsolete-variable 'browse-url-netscape-arguments nil "25.1")
-
-(defcustom browse-url-netscape-startup-arguments browse-url-netscape-arguments
- "A list of strings to pass to Netscape when it starts up.
-Defaults to the value of `browse-url-netscape-arguments' at the time
-`browse-url' is loaded."
- :type '(repeat (string :tag "Argument")))
-
-(make-obsolete-variable 'browse-url-netscape-startup-arguments nil "25.1")
-
(defcustom browse-url-browser-display nil
"The X display for running the browser, if not same as Emacs's."
:type '(choice string (const :tag "Default" nil)))
@@ -285,11 +258,13 @@ Defaults to the value of `browse-url-mozilla-arguments'
at the time
`browse-url' is loaded."
:type '(repeat (string :tag "Argument")))
+(defun browse-url--find-executable (candidates default)
+ (while (and candidates (not (executable-find (car candidates))))
+ (setq candidates (cdr candidates)))
+ (or (car candidates) default))
+
(defcustom browse-url-firefox-program
- (let ((candidates '("icecat" "iceweasel" "firefox")))
- (while (and candidates (not (executable-find (car candidates))))
- (setq candidates (cdr candidates)))
- (or (car candidates) "firefox"))
+ (browse-url--find-executable '("icecat" "iceweasel") "firefox")
"The name by which to invoke Firefox or a variant of it."
:type 'string)
@@ -307,10 +282,8 @@ Defaults to the value of `browse-url-firefox-arguments' at
the time
"it no longer has any effect." "24.5")
(defcustom browse-url-chrome-program
- (let ((candidates '("google-chrome-stable" "google-chrome")))
- (while (and candidates (not (executable-find (car candidates))))
- (setq candidates (cdr candidates)))
- (or (car candidates) "chromium"))
+ (browse-url--find-executable '("google-chrome-stable" "google-chrome")
+ "chromium")
"The name by which to invoke the Chrome browser."
:type 'string
:version "25.1")
@@ -321,10 +294,7 @@ Defaults to the value of `browse-url-firefox-arguments' at
the time
:version "25.1")
(defcustom browse-url-chromium-program
- (let ((candidates '("chromium" "chromium-browser")))
- (while (and candidates (not (executable-find (car candidates))))
- (setq candidates (cdr candidates)))
- (or (car candidates) "chromium"))
+ (browse-url--find-executable '("chromium" "chromium-browser") "chromium")
"The name by which to invoke Chromium."
:type 'string
:version "24.1")
@@ -334,26 +304,6 @@ Defaults to the value of `browse-url-firefox-arguments' at
the time
:type '(repeat (string :tag "Argument"))
:version "24.1")
-(defcustom browse-url-galeon-program "galeon"
- "The name by which to invoke Galeon."
- :type 'string)
-
-(make-obsolete-variable 'browse-url-galeon-program nil "25.1")
-
-(defcustom browse-url-galeon-arguments nil
- "A list of strings to pass to Galeon as arguments."
- :type '(repeat (string :tag "Argument")))
-
-(make-obsolete-variable 'browse-url-galeon-arguments nil "25.1")
-
-(defcustom browse-url-galeon-startup-arguments browse-url-galeon-arguments
- "A list of strings to pass to Galeon when it starts up.
-Defaults to the value of `browse-url-galeon-arguments' at the time
-`browse-url' is loaded."
- :type '(repeat (string :tag "Argument")))
-
-(make-obsolete-variable 'browse-url-galeon-startup-arguments nil "25.1")
-
(defcustom browse-url-epiphany-program "epiphany"
"The name by which to invoke Epiphany."
:type 'string)
@@ -373,7 +323,7 @@ Defaults to the value of `browse-url-epiphany-arguments' at
the time
:type 'string
:version "29.1")
-;; GNOME means of invoking either Mozilla or Netscape.
+;; GNOME means of invoking Mozilla.
(defvar browse-url-gnome-moz-program "gnome-moz-remote")
(make-obsolete-variable 'browse-url-gnome-moz-program nil "25.1")
@@ -406,29 +356,12 @@ If non-nil, then open the URL in a new buffer rather than
a new window if
(make-obsolete-variable 'browse-url-conkeror-new-window-is-buffer nil "28.1")
-(defcustom browse-url-galeon-new-window-is-tab nil
- "Whether to open up new windows in a tab or a new window.
-If non-nil, then open the URL in a new tab rather than a new window if
-`browse-url-galeon' is asked to open it in a new window."
- :type 'boolean)
-
-(make-obsolete-variable 'browse-url-galeon-new-window-is-tab nil "25.1")
-
(defcustom browse-url-epiphany-new-window-is-tab nil
"Whether to open up new windows in a tab or a new window.
If non-nil, then open the URL in a new tab rather than a new window if
`browse-url-epiphany' is asked to open it in a new window."
:type 'boolean)
-(defcustom browse-url-netscape-new-window-is-tab nil
- "Whether to open up new windows in a tab or a new window.
-If non-nil, then open the URL in a new tab rather than a new
-window if `browse-url-netscape' is asked to open it in a new
-window."
- :type 'boolean)
-
-(make-obsolete-variable 'browse-url-netscape-new-window-is-tab nil "25.1")
-
(defcustom browse-url-new-window-flag nil
"Non-nil means always open a new browser window with appropriate browsers.
Passing an interactive argument to \\[browse-url], or specific browser
@@ -525,14 +458,6 @@ You might want to set this to somewhere with restricted
read permissions
for privacy's sake."
:type 'string)
-(defcustom browse-url-netscape-version 3
- "The version of Netscape you are using.
-This affects how URL reloading is done; the mechanism changed
-incompatibly at version 4."
- :type 'number)
-
-(make-obsolete-variable 'browse-url-netscape-version nil "25.1")
-
(defcustom browse-url-text-browser "lynx"
"The name of the text browser to invoke."
:type 'string
@@ -1018,8 +943,6 @@ The optional NEW-WINDOW argument is not used."
(function-put 'browse-url-default-macosx-browser 'browse-url-browser-kind
'external)
-;; --- Netscape ---
-
(defun browse-url-process-environment ()
"Set DISPLAY in the environment to the X display the browser will use.
This is either the value of variable `browse-url-browser-display' if
@@ -1062,9 +985,7 @@ instead of `browse-url-new-window-flag'."
((executable-find browse-url-mozilla-program) 'browse-url-mozilla)
((executable-find browse-url-firefox-program) 'browse-url-firefox)
((executable-find browse-url-chromium-program) 'browse-url-chromium)
-;;; ((executable-find browse-url-galeon-program) 'browse-url-galeon)
((executable-find browse-url-kde-program) 'browse-url-kde)
-;;; ((executable-find browse-url-netscape-program) 'browse-url-netscape)
((executable-find browse-url-chrome-program) 'browse-url-chrome)
((executable-find browse-url-webpositive-program) 'browse-url-webpositive)
((executable-find browse-url-xterm-program) 'browse-url-text-xterm)
@@ -1099,82 +1020,6 @@ The optional argument IGNORED is not used."
(function-put 'browse-url-xdg-open 'browse-url-browser-kind 'external)
;;;###autoload
-(defun browse-url-netscape (url &optional new-window)
- "Ask the Netscape WWW browser to load URL.
-Default to the URL around or before point. The strings in variable
-`browse-url-netscape-arguments' are also passed to Netscape.
-
-When called interactively, if variable `browse-url-new-window-flag' is
-non-nil, load the document in a new Netscape window, otherwise use a
-random existing one. A non-nil interactive prefix argument reverses
-the effect of `browse-url-new-window-flag'.
-
-If `browse-url-netscape-new-window-is-tab' is non-nil, then
-whenever a document would otherwise be loaded in a new window, it
-is loaded in a new tab in an existing window instead.
-
-When called non-interactively, optional second argument NEW-WINDOW is
-used instead of `browse-url-new-window-flag'."
- (declare (obsolete nil "25.1"))
- (interactive (browse-url-interactive-arg "URL: "))
- (setq url (browse-url-encode-url url))
- (let* ((process-environment (browse-url-process-environment))
- (process
- (apply #'start-process
- (concat "netscape " url) nil
- browse-url-netscape-program
- (append
- browse-url-netscape-arguments
- (if (eq window-system 'w32)
- (list url)
- (append
- (if new-window '("-noraise"))
- (list "-remote"
- (concat "openURL(" url
- (if (browse-url-maybe-new-window
- new-window)
- (if browse-url-netscape-new-window-is-tab
- ",new-tab"
- ",new-window"))
- ")"))))))))
- (set-process-sentinel process
- (lambda (process _change)
- (browse-url-netscape-sentinel process url)))))
-
-(function-put 'browse-url-netscape 'browse-url-browser-kind 'external)
-
-(defun browse-url-netscape-sentinel (process url)
- "Handle a change to the process communicating with Netscape."
- (declare (obsolete nil "25.1"))
- (or (eq (process-exit-status process) 0)
- (let* ((process-environment (browse-url-process-environment)))
- ;; Netscape not running - start it
- (message "Starting %s..." browse-url-netscape-program)
- (apply #'start-process (concat "netscape" url) nil
- browse-url-netscape-program
- (append browse-url-netscape-startup-arguments (list url))))))
-
-(defun browse-url-netscape-reload ()
- "Ask Netscape to reload its current document.
-How depends on `browse-url-netscape-version'."
- (declare (obsolete nil "25.1"))
- (interactive)
- ;; Backwards incompatibility reported by
- ;; <peter.kruse@psychologie.uni-regensburg.de>.
- (browse-url-netscape-send (if (>= browse-url-netscape-version 4)
- "xfeDoCommand(reload)"
- "reload")))
-
-(defun browse-url-netscape-send (command)
- "Send a remote control command to Netscape."
- (declare (obsolete nil "25.1"))
- (let* ((process-environment (browse-url-process-environment)))
- (apply #'start-process "netscape" nil
- browse-url-netscape-program
- (append browse-url-netscape-arguments
- (list "-remote" command)))))
-
-;;;###autoload
(defun browse-url-mozilla (url &optional new-window)
"Ask the Mozilla WWW browser to load URL.
Default to the URL around or before point. The strings in variable
@@ -1294,56 +1139,6 @@ The optional argument NEW-WINDOW is not used."
(function-put 'browse-url-chrome 'browse-url-browser-kind 'external)
-;;;###autoload
-(defun browse-url-galeon (url &optional new-window)
- "Ask the Galeon WWW browser to load URL.
-Default to the URL around or before point. The strings in variable
-`browse-url-galeon-arguments' are also passed to Galeon.
-
-When called interactively, if variable `browse-url-new-window-flag' is
-non-nil, load the document in a new Galeon window, otherwise use a
-random existing one. A non-nil interactive prefix argument reverses
-the effect of `browse-url-new-window-flag'.
-
-If `browse-url-galeon-new-window-is-tab' is non-nil, then whenever a
-document would otherwise be loaded in a new window, it is loaded in a
-new tab in an existing window instead.
-
-When called non-interactively, optional second argument NEW-WINDOW is
-used instead of `browse-url-new-window-flag'."
- (declare (obsolete nil "25.1"))
- (interactive (browse-url-interactive-arg "URL: "))
- (setq url (browse-url-encode-url url))
- (let* ((process-environment (browse-url-process-environment))
- (process (apply #'start-process
- (concat "galeon " url)
- nil
- browse-url-galeon-program
- (append
- browse-url-galeon-arguments
- (if (browse-url-maybe-new-window new-window)
- (if browse-url-galeon-new-window-is-tab
- '("--new-tab")
- '("--new-window" "--noraise"))
- '("--existing"))
- (list url)))))
- (set-process-sentinel process
- (lambda (process _change)
- (browse-url-galeon-sentinel process url)))))
-
-(function-put 'browse-url-galeon 'browse-url-browser-kind 'external)
-
-(defun browse-url-galeon-sentinel (process url)
- "Handle a change to the process communicating with Galeon."
- (declare (obsolete nil "25.1"))
- (or (eq (process-exit-status process) 0)
- (let* ((process-environment (browse-url-process-environment)))
- ;; Galeon is not running - start it
- (message "Starting %s..." browse-url-galeon-program)
- (apply #'start-process (concat "galeon " url) nil
- browse-url-galeon-program
- (append browse-url-galeon-startup-arguments (list url))))))
-
(defun browse-url-epiphany (url &optional new-window)
"Ask the Epiphany WWW browser to load URL.
Default to the URL around or before point. The strings in variable
@@ -1427,7 +1222,7 @@ currently selected window instead."
;;;###autoload
(defun browse-url-gnome-moz (url &optional new-window)
- "Ask Mozilla/Netscape to load URL via the GNOME program `gnome-moz-remote'.
+ "Ask Mozilla to load URL via the GNOME program `gnome-moz-remote'.
Default to the URL around or before point. The strings in variable
`browse-url-gnome-moz-arguments' are also passed.
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index c2a0231..72eb63d 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4597,6 +4597,8 @@ Goes through the list `tramp-local-coding-commands' and
(value (symbol-value rem-enc)))
(while (string-match "-" name)
(setq name (replace-match "_" nil t name)))
+ (unless (tramp-expand-script vec value)
+ (throw 'wont-work-remote nil))
(tramp-maybe-send-script vec value name)
(setq rem-enc name)))
(tramp-message
@@ -4614,6 +4616,8 @@ Goes through the list `tramp-local-coding-commands' and
(value (symbol-value rem-dec)))
(while (string-match "-" name)
(setq name (replace-match "_" nil t name)))
+ (unless (tramp-expand-script vec value)
+ (throw 'wont-work-remote nil))
(tramp-maybe-send-script vec value name)
(setq rem-dec name)))
(tramp-message
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el
index 30b6edf..496b081 100644
--- a/lisp/progmodes/prog-mode.el
+++ b/lisp/progmodes/prog-mode.el
@@ -93,7 +93,9 @@
'mark-whole-buffer)
;; Include text-mode select menu only in strings and comments.
- (when (nth 8 (save-excursion (syntax-ppss (posn-point (event-end click)))))
+ (when (nth 8 (save-excursion
+ (with-current-buffer (window-buffer (posn-window (event-end
click)))
+ (syntax-ppss (posn-point (event-end click))))))
(text-mode-context-menu menu click))
menu)
diff --git a/lisp/strokes.el b/lisp/strokes.el
index 91ddefd..db0eb83 100644
--- a/lisp/strokes.el
+++ b/lisp/strokes.el
@@ -1395,14 +1395,19 @@ Encode/decode your strokes with
\\[strokes-encode-buffer],
(strokes-load-user-strokes))
(add-hook 'kill-emacs-query-functions
#'strokes-prompt-user-save-strokes)
- (add-hook 'select-frame-hook
- #'strokes-update-window-configuration)
+ ;; FIXME: Should this be something like `focus-in-hook'?
+ ;; That variable is obsolete, but `select-frame-hook' has
+ ;; never existed in Emacs.
+ ;;(add-hook 'select-frame-hook
+ ;; #'strokes-update-window-configuration)
(strokes-update-window-configuration))
(t ; turn off strokes
(if (get-buffer strokes-buffer-name)
- (kill-buffer (get-buffer strokes-buffer-name)))
- (remove-hook 'select-frame-hook
- #'strokes-update-window-configuration))))
+ (kill-buffer (get-buffer strokes-buffer-name)))
+ ;; FIXME: Same as above.
+ ;;(remove-hook 'select-frame-hook
+ ;; #'strokes-update-window-configuration)
+ )))
;;;; strokes-xpm stuff (later may be separate)...
diff --git a/lisp/textmodes/etc-authors-mode.el
b/lisp/textmodes/etc-authors-mode.el
index 8b5fefd..a79a1ec 100644
--- a/lisp/textmodes/etc-authors-mode.el
+++ b/lisp/textmodes/etc-authors-mode.el
@@ -115,12 +115,10 @@ With a prefix arg ARG, move point that many authors
backward."
(interactive "p" etc-authors-mode)
(etc-authors-next-author (- arg)))
-(defvar etc-authors-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "n" #'etc-authors-next-author)
- (define-key map "p" #'etc-authors-prev-author)
- map)
- "Keymap for `etc-authors-mode'.")
+(defvar-keymap etc-authors-mode-map
+ :doc "Keymap for `etc-authors-mode'."
+ "n" #'etc-authors-next-author
+ "p" #'etc-authors-prev-author)
;;;###autoload
(define-derived-mode etc-authors-mode special-mode "Authors View"
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el
index 71db33b..dbf30da 100644
--- a/lisp/textmodes/texinfo.el
+++ b/lisp/textmodes/texinfo.el
@@ -4,7 +4,6 @@
;; Foundation, Inc.
;; Author: Robert J. Chassell
-;; Date: [See date below for texinfo-version]
;; Maintainer: emacs-devel@gnu.org
;; Keywords: maint, tex, docs
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 3ceed36..5c6a39a 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1874,7 +1874,8 @@ Returns nil if not possible."
(defvar-keymap vc-dir-git-mode-map
"z c" #'vc-git-stash
- "z s" #'vc-git-stash-snapshot)
+ "z s" #'vc-git-stash-snapshot
+ "z p" #'vc-git-stash-pop)
(define-minor-mode vc-dir-git-mode
"A minor mode for git-specific commands in `vc-dir-mode' buffers.
diff --git a/lisp/view.el b/lisp/view.el
index 3476ced..321bc5f 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -36,8 +36,8 @@
;;; Suggested key bindings:
;;
-;; (define-key ctl-x-4-map "v" #'view-file-other-window) ; ^x4v
-;; (define-key ctl-x-5-map "v" #'view-file-other-frame) ; ^x5v
+;; (keymap-set ctl-x-4-map "v" #'view-file-other-window) ; C-x 4 v
+;; (keymap-set ctl-x-5-map "v" #'view-file-other-frame) ; C-x 5 v
;;
;; You could also bind `view-file', `view-buffer', `view-buffer-other-window'
and
;; `view-buffer-other-frame' to keys.
@@ -142,68 +142,68 @@ that use View mode automatically.")
(defvar-local view-overlay nil
"Overlay used to display where a search operation found its match.
This is local in each buffer, once it is used.")
+
-;; Define keymap inside defvar to make it easier to load changes.
;; Some redundant "less"-like key bindings below have been commented out.
-(defvar view-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map "C" #'View-kill-and-leave)
- (define-key map "c" #'View-leave)
- (define-key map "Q" #'View-quit-all)
- (define-key map "E" #'View-exit-and-edit)
- ;; (define-key map "v" #'View-exit)
- (define-key map "e" #'View-exit)
- (define-key map "q" #'View-quit)
- ;; (define-key map "N" #'View-search-last-regexp-backward)
- (define-key map "p" #'View-search-last-regexp-backward)
- (define-key map "n" #'View-search-last-regexp-forward)
- ;; (define-key map "?" #'View-search-regexp-backward) ; Less does this.
- (define-key map "\\" #'View-search-regexp-backward)
- (define-key map "/" #'View-search-regexp-forward)
- (define-key map "r" #'isearch-backward)
- (define-key map "s" #'isearch-forward)
- (define-key map "m" #'point-to-register)
- (define-key map "'" #'register-to-point)
- (define-key map "x" #'exchange-point-and-mark)
- (define-key map "@" #'View-back-to-mark)
- (define-key map "." #'set-mark-command)
- (define-key map "%" #'View-goto-percent)
- ;; (define-key map "G" #'View-goto-line-last)
- (define-key map "g" #'View-goto-line)
- (define-key map "=" #'what-line)
- (define-key map "F" #'View-revert-buffer-scroll-page-forward)
- ;; (define-key map "k" #'View-scroll-line-backward)
- (define-key map "y" #'View-scroll-line-backward)
- ;; (define-key map "j" #'View-scroll-line-forward)
- (define-key map "\n" #'View-scroll-line-forward)
- (define-key map "\r" #'View-scroll-line-forward)
- (define-key map "u" #'View-scroll-half-page-backward)
- (define-key map "d" #'View-scroll-half-page-forward)
- (define-key map "z" #'View-scroll-page-forward-set-page-size)
- (define-key map "w" #'View-scroll-page-backward-set-page-size)
- ;; (define-key map "b" #'View-scroll-page-backward)
- (define-key map "\C-?" #'View-scroll-page-backward)
- ;; (define-key map "f" #'View-scroll-page-forward)
- (define-key map " " #'View-scroll-page-forward)
- (define-key map [?\S-\ ] #'View-scroll-page-backward)
- (define-key map "o" #'View-scroll-to-buffer-end)
- (define-key map ">" #'end-of-buffer)
- (define-key map "<" #'beginning-of-buffer)
- (define-key map "-" #'negative-argument)
- (define-key map "9" #'digit-argument)
- (define-key map "8" #'digit-argument)
- (define-key map "7" #'digit-argument)
- (define-key map "6" #'digit-argument)
- (define-key map "5" #'digit-argument)
- (define-key map "4" #'digit-argument)
- (define-key map "3" #'digit-argument)
- (define-key map "2" #'digit-argument)
- (define-key map "1" #'digit-argument)
- (define-key map "0" #'digit-argument)
- (define-key map "H" #'describe-mode)
- (define-key map "?" #'describe-mode) ; Maybe do as less instead? See
above.
- (define-key map "h" #'describe-mode)
- map))
+(defvar-keymap view-mode-map
+ :doc "Keymap for ‘view-mode’."
+ "C" #'View-kill-and-leave
+ "c" #'View-leave
+ "Q" #'View-quit-all
+ "E" #'View-exit-and-edit
+ ;; "v" #'View-exit
+ "e" #'View-exit
+ "q" #'View-quit
+ ;; "N" #'View-search-last-regexp-backward
+ "p" #'View-search-last-regexp-backward
+ "n" #'View-search-last-regexp-forward
+ ;; "?" #'View-search-regexp-backward ; Less does this.
+ "\\" #'View-search-regexp-backward
+ "/" #'View-search-regexp-forward
+ "r" #'isearch-backward
+ "s" #'isearch-forward
+ "m" #'point-to-register
+ "'" #'register-to-point
+ "x" #'exchange-point-and-mark
+ "@" #'View-back-to-mark
+ "." #'set-mark-command
+ "%" #'View-goto-percent
+ ;; "G" #'View-goto-line-last
+ "g" #'View-goto-line
+ "=" #'what-line
+ "F" #'View-revert-buffer-scroll-page-forward
+ ;; "k" #'View-scroll-line-backward
+ "y" #'View-scroll-line-backward
+ ;; "j" #'View-scroll-line-forward
+ "C-j" #'View-scroll-line-forward
+ "RET" #'View-scroll-line-forward
+ "u" #'View-scroll-half-page-backward
+ "d" #'View-scroll-half-page-forward
+ "z" #'View-scroll-page-forward-set-page-size
+ "w" #'View-scroll-page-backward-set-page-size
+ ;; "b" #'View-scroll-page-backward
+ "DEL" #'View-scroll-page-backward
+ ;; "f" #'View-scroll-page-forward
+ "SPC" #'View-scroll-page-forward
+ "S-SPC" #'View-scroll-page-backward
+ "o" #'View-scroll-to-buffer-end
+ ">" #'end-of-buffer
+ "<" #'beginning-of-buffer
+ "-" #'negative-argument
+ "9" #'digit-argument
+ "8" #'digit-argument
+ "7" #'digit-argument
+ "6" #'digit-argument
+ "5" #'digit-argument
+ "4" #'digit-argument
+ "3" #'digit-argument
+ "2" #'digit-argument
+ "1" #'digit-argument
+ "0" #'digit-argument
+ "H" #'describe-mode
+ "?" #'describe-mode ; Maybe do as less instead? See above.
+ "h" #'describe-mode)
+
;;; Commands that enter or exit view mode.
diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index cf4396f..ce9839e 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -409,6 +409,11 @@ If N is omitted or nil, scroll backwards by one char."
(with-current-buffer (xwidget-buffer xwidget)
(force-mode-line-update)))
+(defun xwidget-webkit-buffer-kill ()
+ "Clean up an xwidget-webkit buffer before it is killed."
+ (when (timerp xwidget-webkit--progress-update-timer)
+ (cancel-timer xwidget-webkit--progress-update-timer)))
+
(defun xwidget-webkit-callback (xwidget xwidget-event-type)
"Callback for xwidgets.
XWIDGET instance, XWIDGET-EVENT-TYPE depends on the originating xwidget."
@@ -479,6 +484,7 @@ If non-nil, plugins are enabled. Otherwise, disabled."
(define-derived-mode xwidget-webkit-mode special-mode "xwidget-webkit"
"Xwidget webkit view mode."
(setq buffer-read-only t)
+ (add-hook 'kill-buffer-hook #'xwidget-webkit-buffer-kill)
(setq-local tool-bar-map xwidget-webkit-tool-bar-map)
(setq-local bookmark-make-record-function
#'xwidget-webkit-bookmark-make-record)
diff --git a/src/image.c b/src/image.c
index 2c33a8e..55f5f55 100644
--- a/src/image.c
+++ b/src/image.c
@@ -9170,6 +9170,12 @@ webp_load (struct frame *f, struct image *img)
/* Linear [r0, g0, b0, r1, g1, b1, ...] order. */
decoded = WebPDecodeRGB (contents, size, &width, &height);
+ if (!decoded)
+ {
+ image_error ("Error when interpreting WebP image data");
+ goto webp_error1;
+ }
+
if (!(width <= INT_MAX && height <= INT_MAX
&& check_image_size (f, width, height)))
{
@@ -10591,7 +10597,7 @@ svg_load_image (struct frame *f, struct image *img,
char *contents,
/* Get the image dimensions. */
#if LIBRSVG_CHECK_VERSION (2, 46, 0)
- gdouble gviewbox_width, gviewbox_height;
+ gdouble gviewbox_width = 0, gviewbox_height = 0;
gboolean has_viewbox = FALSE;
# if LIBRSVG_CHECK_VERSION (2, 52, 1)
has_viewbox = rsvg_handle_get_intrinsic_size_in_pixels (rsvg_handle,