commit b0a960308bde2a32a3c0e2c6d7a53c01504ae5c2 (HEAD, refs/remotes/origin/master) Author: Po Lu Date: Wed Dec 8 15:52:21 2021 +0800 Fix last change * lisp/pixel-scroll.el (pixel-scroll-precision-interpolation-total-time) (pixel-scroll-precision-interpolation-factor): Fix declared versions. diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 6191c0530c..af21f365b3 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -145,13 +145,13 @@ Nil means to not interpolate such scrolls." "The total time in seconds to spend interpolating a large scroll." :group 'mouse :type 'float - :version 29.1) + :version "29.1") (defcustom pixel-scroll-precision-interpolation-factor 2.0 "A factor to apply to the distance of an interpolated scroll." :group 'mouse :type 'float - :version 29.1) + :version "29.1") (defun pixel-scroll-in-rush-p () "Return non-nil if next scroll should be non-smooth. commit bf79dad3f20345ddf095325ce22c0f2a3408d3ba Author: Po Lu Date: Wed Dec 8 13:40:12 2021 +0800 Make interpolated scrolling work better * lisp/pixel-scroll.el (pixel-scroll-precision-interpolate): Stop using `while-no-input'. diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 10736de2ae..6191c0530c 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -541,24 +541,23 @@ the height of the current window." "Interpolate a scroll of DELTA pixels. This results in the window being scrolled by DELTA pixels with an animation." - (while-no-input - (let ((percentage 0) - (total-time pixel-scroll-precision-interpolation-total-time) - (factor pixel-scroll-precision-interpolation-factor) - (time-elapsed 0.0) - (between-scroll 0.001)) - (while (< percentage 1) - (sit-for between-scroll) - (setq time-elapsed (+ time-elapsed between-scroll) - percentage (/ time-elapsed total-time)) - (if (< delta 0) - (pixel-scroll-precision-scroll-down - (ceiling (abs (* (* delta factor) - (/ between-scroll total-time))))) - (pixel-scroll-precision-scroll-up - (ceiling (* (* delta factor) - (/ between-scroll total-time))))) - (redisplay t))))) + (let ((percentage 0) + (total-time pixel-scroll-precision-interpolation-total-time) + (factor pixel-scroll-precision-interpolation-factor) + (time-elapsed 0.0) + (between-scroll 0.001)) + (while (< percentage 1) + (sit-for between-scroll) + (setq time-elapsed (+ time-elapsed between-scroll) + percentage (/ time-elapsed total-time)) + (if (< delta 0) + (pixel-scroll-precision-scroll-down + (ceiling (abs (* (* delta factor) + (/ between-scroll total-time))))) + (pixel-scroll-precision-scroll-up + (ceiling (* (* delta factor) + (/ between-scroll total-time))))) + (redisplay t)))) (defun pixel-scroll-precision-scroll-up (delta) "Scroll the current window up by DELTA pixels." commit c4dab6c179a78ae17d02becf66a098bd72a12233 Author: Po Lu Date: Wed Dec 8 13:02:16 2021 +0800 Allow customizing precision scroll interpolation * lisp/pixel-scroll.el (pixel-scroll-precision-interpolation-total-time) (pixel-scroll-precision-interpolation-factor): New user options. (pixel-scroll-precision-interpolate): Use these new options. (pixel-scroll-precision-mode): Set `make-cursor-line-fully-visible' to nil. diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 2e09f9af2d..10736de2ae 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -141,6 +141,18 @@ Nil means to not interpolate such scrolls." number) :version "29.1") +(defcustom pixel-scroll-precision-interpolation-total-time 0.01 + "The total time in seconds to spend interpolating a large scroll." + :group 'mouse + :type 'float + :version 29.1) + +(defcustom pixel-scroll-precision-interpolation-factor 2.0 + "A factor to apply to the distance of an interpolated scroll." + :group 'mouse + :type 'float + :version 29.1) + (defun pixel-scroll-in-rush-p () "Return non-nil if next scroll should be non-smooth. When scrolling request is delivered soon after the previous one, @@ -531,7 +543,8 @@ This results in the window being scrolled by DELTA pixels with an animation." (while-no-input (let ((percentage 0) - (total-time 0.01) + (total-time pixel-scroll-precision-interpolation-total-time) + (factor pixel-scroll-precision-interpolation-factor) (time-elapsed 0.0) (between-scroll 0.001)) (while (< percentage 1) @@ -540,10 +553,10 @@ animation." percentage (/ time-elapsed total-time)) (if (< delta 0) (pixel-scroll-precision-scroll-down - (ceiling (abs (* delta + (ceiling (abs (* (* delta factor) (/ between-scroll total-time))))) (pixel-scroll-precision-scroll-up - (ceiling (* delta + (ceiling (* (* delta factor) (/ between-scroll total-time))))) (redisplay t))))) @@ -691,6 +704,8 @@ precisely, according to the turning of the mouse wheel." :group 'mouse :keymap pixel-scroll-precision-mode-map (setq mwheel-coalesce-scroll-events + (not pixel-scroll-precision-mode) + make-cursor-line-fully-visible (not pixel-scroll-precision-mode))) (provide 'pixel-scroll) commit 5671709590e778cb3af83b2aa33bd112e1fd66fe Author: Po Lu Date: Wed Dec 8 10:04:31 2021 +0800 Send scroll stop events to xwidgets correctly * src/xterm.c (handle_one_xevent): Record stop events manually. * src/xwidget.h (xwidget_scroll): * src/xwidget.c (xwidget_scroll): New parameter `stop_p'. diff --git a/src/xterm.c b/src/xterm.c index 3f7b956034..ae0daa79f3 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9851,6 +9851,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XIValuatorState *states; double *values; bool found_valuator = false; + bool any_stop_p = false; /* A fake XMotionEvent for x_note_mouse_movement. */ XMotionEvent ev; @@ -10003,9 +10004,13 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (val->horizontal) xv_total_x += delta; else - xv_total_y += -delta; + xv_total_y += delta; found_valuator = true; + + if (delta == 0.0) + any_stop_p = true; + continue; } #endif @@ -10092,7 +10097,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (found_valuator) xwidget_scroll (xv, xev->event_x, xev->event_y, xv_total_x, xv_total_y, xev->mods.effective, - xev->time); + xev->time, any_stop_p); else xwidget_motion_notify (xv, xev->event_x, xev->event_y, xev->mods.effective, xev->time); diff --git a/src/xwidget.c b/src/xwidget.c index 9b9f364ce4..d8510ef928 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -1062,7 +1062,8 @@ xwidget_motion_notify (struct xwidget_view *view, void xwidget_scroll (struct xwidget_view *view, double x, double y, - double dx, double dy, uint state, Time time) + double dx, double dy, uint state, Time time, + bool stop_p) { GdkEvent *xg_event; GtkWidget *target; @@ -1097,9 +1098,7 @@ xwidget_scroll (struct xwidget_view *view, double x, double y, xg_event->scroll.delta_x = dx; xg_event->scroll.delta_y = dy; xg_event->scroll.device = find_suitable_pointer (view->frame); - - if (!(fabs (dx) > 0) || !(fabs (dy) > 0)) - xg_event->scroll.is_stop = TRUE; + xg_event->scroll.is_stop = stop_p; g_object_ref (xg_event->any.window); diff --git a/src/xwidget.h b/src/xwidget.h index f2d497c092..a03006fde9 100644 --- a/src/xwidget.h +++ b/src/xwidget.h @@ -199,7 +199,7 @@ extern void xwidget_motion_or_crossing (struct xwidget_view *, extern void xwidget_motion_notify (struct xwidget_view *, double, double, uint, Time); extern void xwidget_scroll (struct xwidget_view *, double, double, - double, double, uint, Time); + double, double, uint, Time, bool); #endif #endif #else commit 176c63287ffdf56634984494f6610102737f393e Author: Stefan Kangas Date: Wed Dec 8 01:55:50 2021 +0100 Convert etc-authors-mode-map to defvar-keymap * lisp/textmodes/etc-authors-mode.el (etc-authors-mode-map): Convert to defvar-keymap. diff --git a/lisp/textmodes/etc-authors-mode.el b/lisp/textmodes/etc-authors-mode.el index 8b5fefd3b7..a79a1ecf4b 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" commit 7d7f3d98dc0380d62ce1b1f5d051d25459134a9c Author: Lars Ingebrigtsen Date: Wed Dec 8 01:52:39 2021 +0100 Pacify svg_load_image compiler warning * src/image.c (svg_load_image): Fix compiler warning from gcc (Debian 11.2.0-10). diff --git a/src/image.c b/src/image.c index cd0f3f697f..49b14c4915 100644 --- a/src/image.c +++ b/src/image.c @@ -10456,7 +10456,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, commit 13556f32ba55e29601b10db273a95c3c9eae4651 Author: Stefan Kangas Date: Wed Dec 8 01:12:10 2021 +0100 ; * lisp/textmodes/texinfo.el: Remove stale comment. The referenced variable was removed two decades ago. diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el index 71db33bae3..dbf30dabe5 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 commit b9c43acdd6286bf51ab561aabe84e3dcd3a30eff Author: Lars Ingebrigtsen Date: Wed Dec 8 01:38:25 2021 +0100 Check decoding results in webp_load before using it * src/image.c (webp_load): Check whether we were able to decode the image before using it. diff --git a/src/image.c b/src/image.c index 65bf22b981..cd0f3f697f 100644 --- a/src/image.c +++ b/src/image.c @@ -9039,6 +9039,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))) { commit 10655ce02f97d474d1fc0c34af9975f36720cc3e Author: Stefan Kangas Date: Tue Dec 7 23:28:44 2021 +0100 image-dired: Navigate from image display buffer * lisp/image-dired.el (image-dired-mark-thumb-original-file) (image-dired-unmark-thumb-original-file) (image-dired-flag-thumb-original-file) (image-dired-toggle-mark-thumb-original-file) (image-dired-unmark-all-marks) (image-dired-display-next-thumbnail-original) (image-dired-display-previous-thumbnail-original): Make commands usable from image-dired-display-image-mode. (image-dired-display-image-mode-map): Bind above commands. (image-dired--with-thumbnail-buffer): New macro. diff --git a/etc/NEWS b/etc/NEWS index d5ed2ded8c..e8e0c910ef 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -552,6 +552,16 @@ user options that are no longer needed are now obsolete: 'image-dired-display-window-width-correction', '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 @@ -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). diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 33f28a3440..d75ccfece1 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'.") @@ -2129,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))) commit 5364c571988b2bfba05870450a66767f7c134ebd Author: Miha Rihtaršič Date: Tue Dec 7 21:16:23 2021 +0100 Improve yanking in the middle of comint process output * lisp/comint.el (comint--unmark-string-as-output): New function to remove unwanted properties from text yanked from comint buffers. (comint-mode): Use it as a 'filter-buffer-substring-function'. (comint-output-filter): Set 'insert-in-front-hooks' text property on process output such that text yanked by the user in the middle of process output is marked as process output (Bug#3735). (comint--mark-as-output): New function. (comint--mark-yanked-as-output): New function. diff --git a/lisp/comint.el b/lisp/comint.el index 544f0b8b82..5f99f560cf 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, commit beed398eb5e49680b731aeacd553d357759043c1 Author: Stefan Kangas Date: Tue Dec 7 19:46:21 2021 +0100 browse-url: Refactor code to find executable * lisp/net/browse-url.el (browse-url--find-executable): Extract from... (browse-url-firefox-program, browse-url-chrome-program) (browse-url-chromium-program): ...here. diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index e30c36ea4d..d317256f06 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -258,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) @@ -280,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") @@ -294,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") commit 9013e4ea194d0a41c9577cccef177e98dbe1268e Author: Stefan Kangas Date: Tue Dec 7 19:31:21 2021 +0100 browse-url: Remove support for Galeon * lisp/net/browse-url.el (browse-url-galeon-program) (browse-url-galeon-arguments) (browse-url-galeon-startup-arguments) (browse-url-galeon-new-window-is-tab, browse-url-galeon) (browse-url-galeon-sentinel): Delete, thus removing support for the long defunct Galeon web browser. * etc/NEWS: Announce its removal. diff --git a/etc/NEWS b/etc/NEWS index 4bfa1eed85..d5ed2ded8c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -686,10 +686,16 @@ will abbreviate the user's home directory, for example by abbreviating ** 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/lisp/net/browse-url.el b/lisp/net/browse-url.el index 990bc41d98..e30c36ea4d 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -307,26 +307,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) @@ -379,14 +359,6 @@ 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 @@ -1007,7 +979,6 @@ 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-chrome-program) 'browse-url-chrome) ((executable-find browse-url-webpositive-program) 'browse-url-webpositive) @@ -1162,56 +1133,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 commit 9168abd7f52a0bdc42fd09617a9e1cecb7aaee89 Author: Eli Zaretskii Date: Tue Dec 7 20:17:11 2021 +0200 * etc/tutorials/TUTORIAL.he: Add section about package management. diff --git a/etc/tutorials/TUTORIAL.he b/etc/tutorials/TUTORIAL.he index 465768aa87..fc4b769599 100644 --- a/etc/tutorials/TUTORIAL.he +++ b/etc/tutorials/TUTORIAL.he @@ -985,6 +985,17 @@ find-file. בנוסף, מדריך למשתמש מתאר עוד הרבה מאד תכונות של Emacs. +* התקנת חבילות הרחבה +-------------------- +קיימות לא מעט חבילות תוכנה עבור Emacs אשר מרחיבות את היכולות שלו. חבילות +הרחבה אלו נכתבו ע״י קהילת משתמשי Emacs והן מהוות אוסף עשיר של תכונות +התומכות בשפות תכנות נוספות, ערכות נושא נוספות, תוספים לשילוב יישומים +חיצוניים, ועוד ועוד. + +לצפיה ברשימת חבילות ההרחבה הזמינות, יש להקיש M-x list-packages. בתצוגה +שתיפתח בעקבות זאת תוכלו לעיין בתיאור של חבילות, לבחור חבילות להתקנה במחשב +שלכם, להסיר חבילות, ועוד. פרטים נוספים לגבי ניהול חבילות הרחבה ניתן למצוא +במדריך למשתמש. * לסיום ------- commit 8f7da3ecb5e9d03b776a7c6caeb5c76e9ef680dc Author: Eli Zaretskii Date: Tue Dec 7 19:57:14 2021 +0200 Improve before-make-frame-hook and after-make-frame-functions docs. * lisp/frame.el (before-make-frame-hook) (after-make-frame-functions): * doc/lispref/frames.texi (Creating Frames): Mention that these functions will be run for the initial frame only if added to the hook in early-init file. (Bug#38143) diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 923ff19997..00332fed0b 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/lisp/frame.el b/lisp/frame.el index 1319759e74..dc7c628e81 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.") commit 77a30e1e88daed4cb47fd567dcae25a260eb1ef2 Author: Stefan Kangas Date: Tue Dec 7 18:27:41 2021 +0100 browse-url: Remove support for Netscape * lisp/net/browse-url.el (browse-url-netscape-program) (browse-url-netscape-arguments) (browse-url-netscape-startup-arguments) (browse-url-netscape-new-window-is-tab) (browse-url-netscape-version, browse-url-netscape) (browse-url-netscape-sentinel, browse-url-netscape-reload) (browse-url-netscape-send): Delete, thus removing support for the long defunct Netscape web browser. * etc/NEWS: Announce its removal. diff --git a/etc/NEWS b/etc/NEWS index 3bdbdde551..4bfa1eed85 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -684,6 +684,12 @@ 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. + * New Modes and Packages in Emacs 29.1 diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index d39cc361e5..990bc41d98 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 - 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))) @@ -373,7 +346,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") @@ -420,15 +393,6 @@ 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 +489,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 @@ -1009,8 +965,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 @@ -1055,7 +1009,6 @@ instead of `browse-url-new-window-flag'." ((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) @@ -1089,82 +1042,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 - ;; . - (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. @@ -1418,7 +1295,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. commit 691470ec4ed7010c37e956e4f26b9fafb790bc17 Author: Glenn Morris Date: Tue Dec 7 08:58:45 2021 -0800 * doc/misc/eshell.texi (Built-ins): Fix xref. diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 4e5288ea6d..a87dd4308c 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 commit 1d0a60113fd155c77ef5ea4ea44fcba3504adcbf Author: Michael Albinus Date: Tue Dec 7 16:20:13 2021 +0100 Make a more robust check in Tramp using scripts * lisp/net/tramp-sh.el (tramp-find-inline-encoding): Check, whether scripts in `tramp-remote-coding-commands' are expandable. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index c2a0231247..72eb63d392 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 commit 6e50d86ca20f4057208a1a19f2a6c6c19ea3ad03 Author: Lele Gaifax Date: Tue Dec 7 07:42:04 2021 +0100 Add the new packages section to the Italian tutorial * etc/tutorials/TUTORIAL.it (INSTALLAZIONE DI ULTERIORI PACCHETTI): Translate from recently added INSTALLING PACKAGES section in the English version. (Bug#52345) (CONCLUSIONI): Reword paragraph, to better convey the original intent. diff --git a/etc/tutorials/TUTORIAL.it b/etc/tutorials/TUTORIAL.it index 68bf40332e..aa2fb4560a 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 commit c94b81bfc1877e4e7057c66cb73bd0942e9fd218 Author: Stefan Kangas Date: Tue Dec 7 14:34:29 2021 +0100 Remove some unnecessary references to Emacs 22 * lisp/cedet/semantic/fw.el: * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): * lisp/emulation/viper-util.el (viper-frame-value): * lisp/mail/rmail.el (rmail-delete-headers): * lisp/mh-e/mh-e.el (mh-inc-spool-list): Remove some unnecessary references to Emacs 22. diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el index 16e8ce8de9..3502cda500 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/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index b1afa6fe61..644d9f1a47 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 71043b189d..0af54b3743 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/mail/rmail.el b/lisp/mail/rmail.el index 9fbc9ba180..afcb7f39bf 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 4e1ca2897b..17faff0716 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 commit db56e32d1241a6573cb7b688362669abec28e648 Author: Stefan Kangas Date: Tue Dec 7 13:28:39 2021 +0100 * etc/tutorials/TUTORIAL: Say that there is usually a delete key. diff --git a/etc/tutorials/TUTORIAL b/etc/tutorials/TUTORIAL index cbb333470a..c5f2e684c4 100644 --- a/etc/tutorials/TUTORIAL +++ b/etc/tutorials/TUTORIAL @@ -304,8 +304,8 @@ position, type . 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 , but -that's not the one we refer to as . +There is usually another key on your keyboard labeled , but +that's not the one we refer to as in Emacs. >> Do this now--type a few characters, then delete them by typing a few times. Don't worry about this file commit 00e6aeacf2540b0dc621208577c1c725e3a533b2 Author: Stefan Kangas Date: Tue Dec 7 12:59:18 2021 +0100 image-dired: Fix behavior of slideshow command * lisp/image-dired.el (image-dired-slideshow-start): Fix behavior to match documentation. Minor simplification of docstring. diff --git a/etc/NEWS b/etc/NEWS index a8b7dc56ba..3bdbdde551 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -583,13 +583,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. diff --git a/lisp/image-dired.el b/lisp/image-dired.el index fe0c3b7c22..33f28a3440 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -1777,21 +1777,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 commit 8aa2aac5002873cfc44899dc570e843742ea7855 Author: Stefan Kangas Date: Tue Dec 7 12:31:21 2021 +0100 Remove obsolete values from image-mode-auto-resize * lisp/image-mode.el (image-auto-resize): Remove obsolete options fit-height and fit-width. (image-transform-resize): Document that fit-height and fit-width are obsolete. (image-auto-resize-max-scale-percent): Fix defcustom const :tag. diff --git a/lisp/image-mode.el b/lisp/image-mode.el index c2b145d1a2..6ff7859c83 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.") commit 092c03d2c30f8ca9d07da670d29ffd161fb24834 Author: Stefan Kangas Date: Tue Dec 7 12:03:45 2021 +0100 * lisp/view.el (view-mode-map): Convert to defvar-keymap. diff --git a/lisp/view.el b/lisp/view.el index 3476ced3f7..321bc5f566 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. commit 3939cb2a9ca33269d2d9f6cf1fa35637d9297830 Author: Stefan Kangas Date: Tue Dec 7 11:39:46 2021 +0100 Remove XEmacs compat code from strokes.el * lisp/strokes.el (strokes-mode): Remove XEmacs compat code; select-frame-hook does not exist in Emacs. diff --git a/lisp/strokes.el b/lisp/strokes.el index 91ddefd373..db0eb83a3e 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)...