diff options
author | Yuuki Harano <masm+github@masm11.me> | 2021-12-06 00:37:01 +0900 |
---|---|---|
committer | Yuuki Harano <masm+github@masm11.me> | 2021-12-06 00:37:01 +0900 |
commit | e5f74cecf132eb266abbaf7483bd793f45cc370f (patch) | |
tree | 5c58e97632e36aa3bf6e7133c4bcc1e57e33afce /lisp | |
parent | 6d7a1123b44ecc4b0f5f356df1eaea0b74e1e855 (diff) | |
parent | 622550f7187f5ec9261a0d30b5ee6f440069a1e0 (diff) | |
download | emacs-e5f74cecf132eb266abbaf7483bd793f45cc370f.tar.gz emacs-e5f74cecf132eb266abbaf7483bd793f45cc370f.tar.bz2 emacs-e5f74cecf132eb266abbaf7483bd793f45cc370f.zip |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/bookmark.el | 5 | ||||
-rw-r--r-- | lisp/calendar/time-date.el | 38 | ||||
-rw-r--r-- | lisp/emacs-lisp/edebug.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/eieio-core.el | 19 | ||||
-rw-r--r-- | lisp/emacs-lisp/package.el | 18 | ||||
-rw-r--r-- | lisp/frame.el | 11 | ||||
-rw-r--r-- | lisp/gnus/gnus-msg.el | 2 | ||||
-rw-r--r-- | lisp/gnus/gnus-search.el | 10 | ||||
-rw-r--r-- | lisp/gnus/nnselect.el | 4 | ||||
-rw-r--r-- | lisp/help.el | 3 | ||||
-rw-r--r-- | lisp/isearch.el | 12 | ||||
-rw-r--r-- | lisp/mwheel.el | 2 | ||||
-rw-r--r-- | lisp/net/newst-plainview.el | 6 | ||||
-rw-r--r-- | lisp/net/tramp-archive.el | 2 | ||||
-rw-r--r-- | lisp/net/tramp-gvfs.el | 10 | ||||
-rw-r--r-- | lisp/net/tramp-sh.el | 23 | ||||
-rw-r--r-- | lisp/net/tramp-smb.el | 14 | ||||
-rw-r--r-- | lisp/org/org-version.el | 2 | ||||
-rw-r--r-- | lisp/org/ox-latex.el | 2 | ||||
-rw-r--r-- | lisp/pixel-scroll.el | 101 | ||||
-rw-r--r-- | lisp/progmodes/gdb-mi.el | 2 | ||||
-rw-r--r-- | lisp/progmodes/gud.el | 8 | ||||
-rw-r--r-- | lisp/startup.el | 11 | ||||
-rw-r--r-- | lisp/textmodes/pixel-fill.el | 19 |
24 files changed, 205 insertions, 121 deletions
diff --git a/lisp/bookmark.el b/lisp/bookmark.el index a8fa9ae7749..f35cbc1a5ec 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -510,8 +510,9 @@ If DEFAULT is nil then return empty string for empty input." (defmacro bookmark-maybe-historicize-string (string) "Put STRING into the bookmark prompt history, if caller non-interactive. -We need this because sometimes bookmark functions are invoked from -menus, so `completing-read' never gets a chance to set `bookmark-history'." +We need this because sometimes bookmark functions are invoked +from other commands that pass in the bookmark name, so +`completing-read' never gets a chance to set `bookmark-history'." `(or (called-interactively-p 'interactive) (setq bookmark-history (cons ,string bookmark-history)))) diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index 8a6ee0f2702..37a16d3b98c 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -153,28 +153,22 @@ it is assumed that PICO was omitted and should be treated as zero." "Parse a string DATE that represents a date-time and return a time value. DATE should be in one of the forms recognized by `parse-time-string'. If DATE lacks timezone information, GMT is assumed." - ;; Pass the result of parsing through decoded-time-set-defaults - ;; because encode-time signals if HH:MM:SS are not filled in. - (encode-time - (decoded-time-set-defaults - (condition-case err - (let ((time (parse-time-string date))) - (prog1 time - ;; Cause an error if data `parse-time-string' returns is invalid. - (setq time (encode-time time)))) - (error - (let ((overflow-error '(error "Specified time is not representable"))) - (if (or (equal err overflow-error) - ;; timezone-make-date-arpa-standard misbehaves if - ;; not given at least HH:MM as part of the date. - (not (string-match ":" date))) - (signal (car err) (cdr err)) - (condition-case err - (parse-time-string (timezone-make-date-arpa-standard date)) - (error - (if (equal err overflow-error) - (signal (car err) (cdr err)) - (error "Invalid date: %s" date))))))))))) + (condition-case err + (let ((parsed (parse-time-string date))) + (when (decoded-time-year parsed) + (decoded-time-set-defaults parsed)) + (encode-time parsed)) + (error + (let ((overflow-error '(error "Specified time is not representable"))) + (if (equal err overflow-error) + (signal (car err) (cdr err)) + (condition-case err + (encode-time (parse-time-string + (timezone-make-date-arpa-standard date))) + (error + (if (equal err overflow-error) + (signal (car err) (cdr err)) + (error "Invalid date: %s" date))))))))) ;;;###autoload (defalias 'time-to-seconds 'float-time) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index a38c8bd5ca9..ac1cd22ac27 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -469,7 +469,7 @@ just FUNCTION is printed." (funcall orig-fun nil))) (defun edebug-eval-defun (edebug-it) - (declare (obsolete "use eval-defun or edebug--eval-defun instead" "28.1")) + (declare (obsolete "use `eval-defun' or `edebug--eval-defun' instead" "28.1")) (interactive "P") (if (advice-member-p #'edebug--eval-defun 'eval-defun) (eval-defun edebug-it) diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index 7c5babcf54c..ca47ec77f76 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el @@ -450,7 +450,7 @@ See `defclass' for more information." )) ;; Now that everything has been loaded up, all our lists are backwards! - ;; Fix that up now and then them into vectors. + ;; Fix that up now and turn them into vectors. (cl-callf (lambda (slots) (apply #'vector (nreverse slots))) (eieio--class-slots newc)) (cl-callf nreverse (eieio--class-initarg-tuples newc)) @@ -704,11 +704,15 @@ an error." nil ;; Trim off object IDX junk added in for the object index. (setq slot-idx (- slot-idx (eval-when-compile eieio--object-num-slots))) - (let ((st (cl--slot-descriptor-type (aref (eieio--class-slots class) - slot-idx)))) - (if (not (eieio--perform-slot-validation st value)) - (signal 'invalid-slot-type - (list (eieio--class-name class) slot st value)))))) + (let* ((sd (aref (eieio--class-slots class) + slot-idx)) + (st (cl--slot-descriptor-type sd))) + (cond + ((not (eieio--perform-slot-validation st value)) + (signal 'invalid-slot-type + (list (eieio--class-name class) slot st value))) + ((alist-get :read-only (cl--slot-descriptor-props sd)) + (signal 'eieio-read-only (list (eieio--class-name class) slot))))))) (defun eieio--validate-class-slot-value (class slot-idx value slot) "Make sure that for CLASS referencing SLOT-IDX, VALUE is valid. @@ -813,7 +817,7 @@ Fills in CLASS's SLOT with its default value." (defun eieio-oset (obj slot value) "Do the work for the macro `oset'. Fills in OBJ's SLOT with VALUE." - (cl-check-type obj eieio-object) + (cl-check-type obj (or eieio-object cl-structure-object)) (cl-check-type slot symbol) (let* ((class (eieio--object-class obj)) (c (eieio--slot-name-index class slot))) @@ -1063,6 +1067,7 @@ method invocation orders of the involved classes." ;; (define-error 'invalid-slot-name "Invalid slot name") (define-error 'invalid-slot-type "Invalid slot type") +(define-error 'eieio-read-only "Read-only slot") (define-error 'unbound-slot "Unbound slot") (define-error 'inconsistent-class-hierarchy "Inconsistent class hierarchy") diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 08dfe504d27..66bbd631a72 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1181,13 +1181,17 @@ The return result is a `package-desc'." info) (while files (with-temp-buffer - (insert-file-contents (pop files)) - ;; When we find the file with the data, - (when (setq info (ignore-errors (package-buffer-info))) - ;; stop looping, - (setq files nil) - ;; set the 'dir kind, - (setf (package-desc-kind info) 'dir)))) + (let ((file (pop files))) + ;; The file may be a link to a nonexistent file; e.g., a + ;; lock file. + (when (file-exists-p file) + (insert-file-contents file) + ;; When we find the file with the data, + (when (setq info (ignore-errors (package-buffer-info))) + ;; stop looping, + (setq files nil) + ;; set the 'dir kind, + (setf (package-desc-kind info) 'dir)))))) (unless info (error "No .el files with package headers in `%s'" default-directory)) ;; and return the info. diff --git a/lisp/frame.el b/lisp/frame.el index f790fa13ab9..00a60e56cee 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -808,12 +808,19 @@ 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, except when the initial frame is created from an Emacs +daemon.") (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, except when the initial frame is created from an Emacs +daemon.") (defvar after-setting-font-hook nil "Functions to run after a frame's font has been changed.") diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index bb265642bc6..c60faa13263 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -1748,7 +1748,7 @@ this is a reply." (concat "\"" str "\"") str))) (when groups - (insert " "))) + (insert ","))) (insert "\n"))))))) (defun gnus-mailing-list-followup-to () diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index bce5d57c521..c77de688e66 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -105,9 +105,13 @@ (gnus-add-shutdown #'gnus-search-shutdown 'gnus) -(define-error 'gnus-search-parse-error "Gnus search parsing error") +(define-error 'gnus-search-error "Gnus search error") -(define-error 'gnus-search-config-error "Gnus search configuration error") +(define-error 'gnus-search-parse-error "Gnus search parsing error" + 'gnus-search-error) + +(define-error 'gnus-search-config-error "Gnus search configuration error" + 'gnus-search-error) ;;; User Customizable Variables: @@ -1927,7 +1931,7 @@ Assume \"size\" key is equal to \"larger\"." (apply #'nnheader-message 4 "Search engine for %s improperly configured: %s" server (cdr err)) - (signal 'gnus-search-config-error err))))) + (signal (car err) (cdr err)))))) (alist-get 'search-group-spec specs)) ;; Some search engines do their own limiting, but some don't, so ;; do it again here. This is bad because, if the user is diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index ecec705b326..252e9f66838 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -779,6 +779,10 @@ Return an article list." (args (alist-get 'nnselect-args specs))) (condition-case-unless-debug err (funcall func args) + ;; Don't swallow gnus-search errors; the user should be made + ;; aware of them. + (gnus-search-error + (signal (car err) (cdr err))) (error (gnus-error 3 "nnselect-run: %s on %s gave error %s" func args err) [])))) diff --git a/lisp/help.el b/lisp/help.el index adb2bd87a94..eb0a7822272 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1353,7 +1353,8 @@ Return nil if the key sequence is too long." (defun help--describe-command (definition &optional translation) (cond ((symbolp definition) - (if (fboundp definition) + (if (and (fboundp definition) + help-buffer-under-preparation) (insert-text-button (symbol-name definition) 'type 'help-function 'help-args (list definition)) diff --git a/lisp/isearch.el b/lisp/isearch.el index fcb7d646c66..8815cb4f2d6 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2504,6 +2504,11 @@ If no input items have been entered yet, just beep." (if (null (cdr isearch-cmds)) (ding) (isearch-pop-state)) + ;; When going back to the hidden match, reopen it. + (when (and (eq search-invisible 'open) isearch-hide-immediately + isearch-other-end) + (isearch-range-invisible (min (point) isearch-other-end) + (max (point) isearch-other-end))) (isearch-update)) (defun isearch-del-char (&optional arg) @@ -3787,10 +3792,9 @@ Isearch, at least partially, as determined by `isearch-range-invisible'. If `search-invisible' is t, which allows Isearch matches inside invisible text, this function will always return non-nil, regardless of what `isearch-range-invisible' says." - (and (or (eq search-invisible t) - (not (isearch-range-invisible beg end))) - (not (text-property-not-all (min beg end) (max beg end) - 'inhibit-isearch nil)))) + (and (not (text-property-not-all beg end 'inhibit-isearch nil)) + (or (eq search-invisible t) + (not (isearch-range-invisible beg end))))) ;; General utilities diff --git a/lisp/mwheel.el b/lisp/mwheel.el index 3458fb6d848..fbe8daa77f8 100644 --- a/lisp/mwheel.el +++ b/lisp/mwheel.el @@ -255,7 +255,7 @@ Also see `mouse-wheel-tilt-scroll'." (if (featurep 'xinput2) 'wheel-left (unless (featurep 'x) - 'mouse-8)) + 'mouse-6)) "Alternative wheel left event to consider.") (defvar mouse-wheel-right-event diff --git a/lisp/net/newst-plainview.el b/lisp/net/newst-plainview.el index 420cf82e4d8..82977b000b6 100644 --- a/lisp/net/newst-plainview.el +++ b/lisp/net/newst-plainview.el @@ -589,7 +589,7 @@ calls `w3m-toggle-inline-image'. It works only if (defun newsticker-close-buffer () "Close the newsticker buffer." (interactive) - (newsticker--cache-update t) + (newsticker--cache-save) (bury-buffer)) (defun newsticker-next-new-item (&optional do-not-wrap-at-eob) @@ -748,7 +748,7 @@ Return new buffer position." (newsticker--cache-replace-age newsticker--cache feed 'new 'old) (newsticker--cache-replace-age newsticker--cache feed 'obsolete 'old) - (newsticker--cache-update) + (newsticker--cache-save) (newsticker--buffer-set-uptodate nil) (newsticker--ticker-text-setup) (newsticker-buffer-update) @@ -879,7 +879,7 @@ not get changed." (newsticker--cache-replace-age newsticker--cache 'any 'new 'old) (newsticker--buffer-set-uptodate nil) (newsticker--ticker-text-setup) - (newsticker--cache-update) + (newsticker--cache-save) (newsticker-buffer-update))) (defun newsticker-hide-extra () diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index efd38e6b4b7..b0f447a3aee 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -54,6 +54,7 @@ ;; * ".ar" - UNIX archiver formats ;; * ".cab", ".CAB" - Microsoft Windows cabinets ;; * ".cpio" - CPIO archives +;; * ".crate" - Cargo (Rust) packages ;; * ".deb" - Debian packages ;; * ".depot" - HP-UX SD depots ;; * ".exe" - Self extracting Microsoft Windows EXE files @@ -141,6 +142,7 @@ "ar" ;; UNIX archiver formats. "cab" "CAB" ;; Microsoft Windows cabinets. "cpio" ;; CPIO archives. + "crate" ;; Cargo (Rust) packages. Not in libarchive testsuite. "deb" ;; Debian packages. Not in libarchive testsuite. "depot" ;; HP-UX SD depot. Not in libarchive testsuite. "exe" ;; Self extracting Microsoft Windows EXE files. diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index ab71c9cd13f..22e31428a76 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1521,11 +1521,11 @@ If FILE-SYSTEM is non-nil, return file system attributes." (size (cdr (assoc "filesystem::size" attr))) (used (cdr (assoc "filesystem::used" attr))) (free (cdr (assoc "filesystem::free" attr)))) - (when (or size used free) - (list (string-to-number (or size "0")) - (string-to-number (or free "0")) - (- (string-to-number (or size "0")) - (string-to-number (or used "0")))))))) + (when (or size free) + (list (and size (string-to-number size)) + (and free (string-to-number free)) + (and size used + (- (string-to-number size) (string-to-number used)))))))) (defun tramp-gvfs-handle-make-directory (dir &optional parents) "Like `make-directory' for Tramp files." diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 780c3b39413..8d106591af3 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2678,17 +2678,15 @@ The method used must be an out-of-band method." (point-min) 'noerror) (replace-match (file-relative-name filename) t)) - ;; Try to insert the amount of free space. This is moved to - ;; `dired-insert-directory' in Emacs 29.1. - (unless (boundp 'dired-free-space) - (goto-char (point-min)) - ;; First find the line to put it on. - (when (re-search-forward "^\\([[:space:]]*total\\)" nil t) - (when-let ((available (get-free-disk-space "."))) - ;; Replace "total" with "total used", to avoid confusion. - (replace-match "\\1 used in directory") - (end-of-line) - (insert " available " available))))) + ;; Try to insert the amount of free space. + (goto-char (point-min)) + ;; First find the line to put it on. + (when (re-search-forward "^\\([[:space:]]*total\\)" nil t) + (when-let ((available (get-free-disk-space "."))) + ;; Replace "total" with "total used", to avoid confusion. + (replace-match "\\1 used in directory") + (end-of-line) + (insert " available " available)))) (prog1 (goto-char end-marker) (set-marker beg-marker nil) @@ -6024,5 +6022,8 @@ function cell is returned to be applied on a buffer." ;; be to stipulate, as a directory or connection-local variable, an ;; additional rc file on the remote machine that is sourced every ;; time Tramp connects. <https://emacs.stackexchange.com/questions/62306> +;; +;; * Support hostname canonicalization in ~/.ssh/config. +;; <https://stackoverflow.com/questions/70205232/> ;;; tramp-sh.el ends here diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 0a7d1efc8b8..24119539db0 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -1120,14 +1120,12 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (setcar x (concat (car x) "*")))))) entries)) - ;; Insert size information. This is moved to - ;; `dired-insert-directory' in Emacs 29.1. - (unless (boundp 'dired-free-space) - (when full-directory-p - (insert - (if avail - (format "total used in directory %s available %s\n" used avail) - (format "total %s\n" used))))) + ;; Insert size information. + (when full-directory-p + (insert + (if avail + (format "total used in directory %s available %s\n" used avail) + (format "total %s\n" used)))) ;; Print entries. (mapc diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index 212069e668f..de75519ec61 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -11,7 +11,7 @@ Inserted by installing Org mode or when a release is made." (defun org-git-version () "The Git version of Org mode. Inserted by installing Org or when a release is made." - (let ((org-git-version "release_9.5.1-11-g96d91b")) + (let ((org-git-version "release_9.5.1-15-gdb4805")) org-git-version)) (provide 'org-version) diff --git a/lisp/org/ox-latex.el b/lisp/org/ox-latex.el index 3e3967033a5..c45dc98a09d 100644 --- a/lisp/org/ox-latex.el +++ b/lisp/org/ox-latex.el @@ -3706,7 +3706,7 @@ Return PDF file's name." (let ((outfile (org-export-output-file-name ".tex" subtreep))) (org-export-to-file 'latex outfile async subtreep visible-only body-only ext-plist - (lambda (file) (org-latex-compile file))))) + #'org-latex-compile))) (defun org-latex-compile (texfile &optional snippet) "Compile a TeX file. diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index ce2aee6c452..77229844246 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -133,6 +133,14 @@ This is only effective if supported by your mouse or touchpad." :type 'float :version "29.1") +(defcustom pixel-scroll-precision-large-scroll-height 70 + "Pixels that must be scrolled before an animation is performed. +Nil means to not interpolate such scrolls." + :group 'mouse + :type '(choice (const :tag "Do not interpolate large scrolls" nil) + number) + :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, @@ -411,23 +419,23 @@ the height of the current window." (object (posn-object desired-pos)) (desired-start (posn-point desired-pos)) (desired-vscroll (cdr (posn-object-x-y desired-pos))) + (edges (window-edges nil t)) + (usable-height (- (nth 3 edges) + (nth 1 edges))) (next-pos (save-excursion (goto-char desired-start) (when (zerop (vertical-motion (1+ scroll-margin))) (signal 'end-of-buffer nil)) - (point)))) - (if (and (< (point) next-pos) - (let ((pos-visibility (pos-visible-in-window-p next-pos nil t))) - (and pos-visibility - (or (eq (length pos-visibility) 2) - (when-let* ((posn (posn-at-point next-pos)) - (edges (window-edges nil t)) - (usable-height (- (nth 3 edges) - (nth 1 edges)))) - (> (cdr (posn-object-width-height posn)) - usable-height)))))) - (goto-char next-pos)) - (if (or (consp object) (stringp object)) + (point))) + (end-pos (posn-at-x-y 0 (+ usable-height + (window-tab-line-height) + (window-header-line-height))))) + (if (or (overlayp object) + (stringp object) + (and (consp object) + (stringp (car object))) + (and (consp (posn-object end-pos)) + (> (cdr (posn-object-x-y end-pos)) 0))) ;; We are either on an overlay or a string, so set vscroll ;; directly. (set-window-vscroll nil (+ (window-vscroll nil t) @@ -441,7 +449,15 @@ the height of the current window." (beginning-of-visual-line) (point))) t)) - (set-window-vscroll nil desired-vscroll t)))) + (set-window-vscroll nil desired-vscroll t)) + (if (and (or (< (point) next-pos)) + (let ((pos-visibility (pos-visible-in-window-p next-pos nil t))) + (and pos-visibility + (or (eq (length pos-visibility) 2) + (when-let* ((posn (posn-at-point next-pos))) + (> (cdr (posn-object-width-height posn)) + usable-height)))))) + (goto-char next-pos)))) (defun pixel-scroll-precision-scroll-down (delta) "Scroll the current window down by DELTA pixels." @@ -510,6 +526,28 @@ the height of the current window." (set-window-vscroll nil desired-vscroll t)) (set-window-vscroll nil (abs delta) t))))))) +(defun pixel-scroll-precision-interpolate (delta) + "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 0.01) + (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 + (/ between-scroll total-time))))) + (pixel-scroll-precision-scroll-up + (ceiling (* delta + (/ between-scroll total-time))))) + (redisplay t))))) + (defun pixel-scroll-precision-scroll-up (delta) "Scroll the current window up by DELTA pixels." (let ((max-height (- (window-text-height nil t) @@ -535,17 +573,32 @@ wheel." (if (> (abs delta) (window-text-height window t)) (mwheel-scroll event nil) (with-selected-window window - (condition-case nil + (if (and pixel-scroll-precision-large-scroll-height + (> (abs delta) + pixel-scroll-precision-large-scroll-height) + (let* ((kin-state (pixel-scroll-kinetic-state)) + (ring (aref kin-state 0)) + (time (aref kin-state 1))) + (or (null time) + (> (- (float-time) time) 1.0) + (and (consp ring) + (ring-empty-p ring))))) (progn - (if (< delta 0) - (pixel-scroll-precision-scroll-down (- delta)) - (pixel-scroll-precision-scroll-up delta)) - (pixel-scroll-accumulate-velocity delta)) - ;; Do not ding at buffer limits. Show a message instead. - (beginning-of-buffer - (message (error-message-string '(beginning-of-buffer)))) - (end-of-buffer - (message (error-message-string '(end-of-buffer))))))))) + (let ((kin-state (pixel-scroll-kinetic-state))) + (aset kin-state 0 (make-ring 10)) + (aset kin-state 1 nil)) + (pixel-scroll-precision-interpolate delta)) + (condition-case nil + (progn + (if (< delta 0) + (pixel-scroll-precision-scroll-down (- delta)) + (pixel-scroll-precision-scroll-up delta)) + (pixel-scroll-accumulate-velocity delta)) + ;; Do not ding at buffer limits. Show a message instead. + (beginning-of-buffer + (message (error-message-string '(beginning-of-buffer)))) + (end-of-buffer + (message (error-message-string '(end-of-buffer)))))))))) (mwheel-scroll event nil)))) (defun pixel-scroll-kinetic-state () diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index cf1d62d3695..409ff940d96 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1266,7 +1266,7 @@ Used by Speedbar." :version "22.1") (define-key gud-minor-mode-map "\C-c\C-w" 'gud-watch) -(define-key global-map (vconcat gud-key-prefix "\C-w") 'gud-watch) +(keymap-set gud-global-map "C-w" 'gud-watch) (declare-function tooltip-identifier-from-point "tooltip" (point)) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 9b884c4ff80..d5bd2655174 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -90,8 +90,10 @@ pdb (Python), and jdb." "Prefix of all GUD commands valid in C buffers." :type 'key-sequence) -(global-set-key (vconcat gud-key-prefix "\C-l") #'gud-refresh) -;; (define-key ctl-x-map " " 'gud-break); backward compatibility hack +(defvar-keymap gud-global-map + "C-l" #'gud-refresh) + +(global-set-key gud-key-prefix gud-global-map) (defvar gud-marker-filter nil) (put 'gud-marker-filter 'permanent-local t) @@ -433,7 +435,7 @@ we're in the GUD buffer)." ;; Unused lexical warning if cmd does not use "arg". cmd)))) ,(if key `(local-set-key ,(concat "\C-c" key) #',func)) - ,(if key `(global-set-key (vconcat gud-key-prefix ,key) #',func)))) + ,(if key `(define-key gud-global-map ,key #',func)))) ;; Where gud-display-frame should put the debugging arrow; a cons of ;; (filename . line-number). This is set by the marker-filter, which scans diff --git a/lisp/startup.el b/lisp/startup.el index 5d2d830d3cd..ab40d02ee7a 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1636,9 +1636,10 @@ Each element in the list should be a list of strings or pairs `((:face (variable-pitch font-lock-comment-face) "This is " :link ("GNU Emacs" - ,(lambda (_button) (browse-url "https://www.gnu.org/software/emacs/")) + ,(lambda (_button) + (browse-url "https://www.gnu.org/software/emacs/")) "Browse https://www.gnu.org/software/emacs/") - ", one component of the " + ", a text editor and more.\nIt's a component of the " :link ,(lambda () (if (eq system-type 'gnu/linux) @@ -1651,7 +1652,11 @@ Each element in the list should be a list of strings or pairs " operating system.\n" :face (variable-pitch font-lock-builtin-face) "\n" - ,(lambda () (emacs-version)) + ,(lambda () + (with-temp-buffer + (insert (emacs-version)) + (fill-region (point-min) (point-max)) + (buffer-string))) "\n" :face (variable-pitch (:height 0.8)) ,(lambda () emacs-copyright) diff --git a/lisp/textmodes/pixel-fill.el b/lisp/textmodes/pixel-fill.el index f69696e1f56..0a0f0eb8b66 100644 --- a/lisp/textmodes/pixel-fill.el +++ b/lisp/textmodes/pixel-fill.el @@ -116,15 +116,13 @@ prefix on subsequent lines." (while (not (eolp)) ;; We have to do some folding. First find the first previous ;; point suitable for folding. - (if (or (not (pixel-fill-find-fill-point (line-beginning-position))) - (= (point) start)) - ;; We had unbreakable text (for this width), so just go to - ;; the first space and carry on. - (progn - (beginning-of-line) - (skip-chars-forward " ") - (search-forward " " (line-end-position) 'move))) - ;; Success; continue. + (when (or (not (pixel-fill-find-fill-point (line-beginning-position))) + (= (point) start)) + ;; We had unbreakable text (for this width), so just go to + ;; the first space and carry on. + (beginning-of-line) + (skip-chars-forward " ") + (search-forward " " (line-end-position) 'move)) (when (= (preceding-char) ?\s) (delete-char -1)) (unless (eobp) @@ -133,7 +131,8 @@ prefix on subsequent lines." (insert (propertize " " 'display (list 'space :align-to (list indentation)))))) (setq start (point)) - (pixel-fill--goto-pixel width)))) + (unless (eobp) + (pixel-fill--goto-pixel width))))) (define-inline pixel-fill--char-breakable-p (char) "Return non-nil if a line can be broken before and after CHAR." |