commit 142e827bc409ddb2692fcbd3d921db6ffdd651ac (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Sat Dec 4 09:07:12 2021 +0200 Fix dependencies for files in the 'nt' subdirectory * Makefile.in ($(NTDIR)): If non-empty, depend on 'lib'. That's because some files in nt/ include generated Gnulib headers. diff --git a/Makefile.in b/Makefile.in index 4b40d8741d..e6c337385a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -427,6 +427,10 @@ epaths-force-ns-self-contained: epaths-force -e 's;${ns_appdir}/;;') && \ ${srcdir}/build-aux/move-if-change epaths.h.$$$$ src/epaths.h +ifneq ($(NTDIR),) +$(NTDIR): lib +endif + lib-src src: $(NTDIR) lib src: lib-src commit fba17b0747ac8227c9e600b4398c3cc4295725e7 Author: Po Lu Date: Sat Dec 4 14:01:59 2021 +0800 Make precision pixel scrolling work in an hscrolled window * lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down-page) (pixel-scroll-precision-scroll-up-page): Use beginning of visual line as window start if hscrolled. (pixel-scroll-precision): Don't delegate to mwheel-scroll if window is hscrolled. diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 207d34811a..ce2aee6c45 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -434,7 +434,13 @@ the height of the current window." delta) t) (unless (eq (window-start) desired-start) - (set-window-start nil desired-start t)) + (set-window-start nil (if (zerop (window-hscroll)) + desired-start + (save-excursion + (goto-char desired-start) + (beginning-of-visual-line) + (point))) + t)) (set-window-vscroll nil desired-vscroll t)))) (defun pixel-scroll-precision-scroll-down (delta) @@ -494,7 +500,13 @@ the height of the current window." (desired-start (posn-point desired-pos)) (desired-vscroll (cdr (posn-object-x-y desired-pos)))) (progn - (set-window-start nil desired-start t) + (set-window-start nil (if (zerop (window-hscroll)) + desired-start + (save-excursion + (goto-char desired-start) + (beginning-of-visual-line) + (point))) + t) (set-window-vscroll nil desired-vscroll t)) (set-window-vscroll nil (abs delta) t))))))) @@ -517,8 +529,7 @@ scroll the display according to the user's turning the mouse wheel." (interactive "e") (let ((window (mwheel-event-window event))) - (if (and (nth 4 event) - (zerop (window-hscroll window))) + (if (and (nth 4 event)) (let ((delta (round (cdr (nth 4 event))))) (unless (zerop delta) (if (> (abs delta) (window-text-height window t)) commit d82cfbc0e92d4249d428509dffccff215cfccaae Merge: 3b514421eb 745a732ae4 Author: Stefan Kangas Date: Sat Dec 4 06:30:32 2021 +0100 Merge from origin/emacs-28 745a732ae4 ; Further author fixes in authors.el bef17bca21 * src/dosfns.c (Fint86): Doc fix; don't use obsolete names. bc55dc04af * doc/misc/erc.texi (Keystroke Summary): Fix doc for TAB. ef4d216eb3 Remove reference to variable obsolete since 24.1 7282e492d5 * doc/misc/efaq.texi (New in Emacs 28): New node. eafcccd38f ; FAQ: Normalize references to the NEWS.NN file c006c490eb ; * doc/misc/efaq.texi (Latest version of Emacs): Update v... 9fbc4fa0e7 Add Tramp version integrated in Emacs 28.1 commit 3b514421ebf6df9a4cb82d0dc8ce58e7931f09bd Merge: ab828569ab 1dfcac6e10 Author: Stefan Kangas Date: Sat Dec 4 06:30:32 2021 +0100 ; Merge from origin/emacs-28 The following commit was skipped: 1dfcac6e10 Update Tramp version (don't merge with master) commit ab828569ab134bca88381dc2f51b40bfff444a5c Merge: 284cc2491d 5d6f828799 Author: Stefan Kangas Date: Sat Dec 4 06:30:32 2021 +0100 Merge from origin/emacs-28 5d6f828799 Unbreak build after 9c222b9c1a7f91497a37567b4d7de3a511fff069. commit 284cc2491d0997e0b6559a2cdefbfed707a259d6 Author: Stefan Monnier Date: Sat Dec 4 00:02:01 2021 -0500 * lisp/minibuffer.el: Don't return a boundary outside its arg * lisp/minibuffer.el (completion-table-subvert): Fix out of string start boundary for the odd case where `string` is shorter than `s1`. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index c2a6b01fc8..0a5fb72774 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -283,7 +283,7 @@ the form (concat S2 S)." ((eq (car-safe action) 'boundaries) (let ((beg (or (and (eq (car-safe res) 'boundaries) (cadr res)) 0))) `(boundaries - ,(max (length s1) + ,(max (min (length string) (length s1)) (+ beg (- (length s1) (length s2)))) . ,(and (eq (car-safe res) 'boundaries) (cddr res))))) ((stringp res) commit 644dd2f05059401116caf6c6e3574a2ac763e667 Author: Lars Ingebrigtsen Date: Sat Dec 4 05:39:25 2021 +0100 Make the error message in epa-display-error more helpful * lisp/epa.el (epa-display-error): Output a more helpful error message when reading a keyring file (bug#12923). diff --git a/lisp/epa.el b/lisp/epa.el index e4b89e984d..93c85bfd37 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -607,7 +607,11 @@ If SECRET is non-nil, list secret keys instead of public keys." (_ "Error while executing \"%s\":\n\n")) (epg-context-program context)) "\n\n" - (epg-context-error-output context))) + (epg-context-error-output context) + (if (string-search "Unexpected error" + (epg-context-error-output context)) + "\n(File possibly not an encrypted file, but is perhaps a key ring file?)\n" + ""))) (epa-info-mode) (goto-char (point-min))) (display-buffer buffer))))) commit 55ff91e822b3ffaf43ef2330aba33f2ba85ea12a Author: Lars Ingebrigtsen Date: Sat Dec 4 05:24:54 2021 +0100 Fix keymap-lookup implementation * lisp/keymap.el (keymap-lookup): Make this actually work for looking up keys. diff --git a/lisp/keymap.el b/lisp/keymap.el index 07e43c37b3..48f087c528 100644 --- a/lisp/keymap.el +++ b/lisp/keymap.el @@ -407,10 +407,10 @@ be a number or marker, in which case the keymap properties at the specified buffer position instead of point are used." (declare (compiler-macro (lambda (form) (keymap--compile-check key) form))) (keymap--check key) - (when (and keymap (not position)) + (when (and keymap position) (error "Can't pass in both keymap and position")) (if keymap - (let ((value (lookup-key (key-parse key) keymap accept-default))) + (let ((value (lookup-key keymap (key-parse key) accept-default))) (when (and (not no-remap) (symbolp value)) (or (command-remapping value) value))) commit 6042417664e7771b030449e6938e1c149100b3b4 Author: Lars Ingebrigtsen Date: Sat Dec 4 05:07:41 2021 +0100 Fix highlighting of "Exit*" phrases in f90-mode * lisp/progmodes/f90.el (f90-font-lock-keywords-2): Don't highlight phrases that start with "Exit" as an exit statement (bug#14442). diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index acc0d96ea5..eb6da20ff7 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -647,7 +647,7 @@ do\\([ \t]*while\\)?\\|select[ \t]*\\(?:case\\|type\\)\\|where\\|\ forall\\|block\\|critical\\)\\)\\_>" (2 font-lock-constant-face nil t) (3 font-lock-keyword-face)) ;; Implicit declaration. - '("\\_<\\(implicit\\)[ \t]*\\(real\\|integer\\|c\\(haracter\\|omplex\\)\ + '("\\_<\\(implicit\\)[ \t]+\\(real\\|integer\\|c\\(haracter\\|omplex\\)\ \\|enumerator\\|procedure\\|\ logical\\|double[ \t]*precision\\|type[ \t]*(\\(?:\\sw\\|\\s_\\)+)\\|none\\)[ \t]*" (1 font-lock-keyword-face) (2 font-lock-type-face)) @@ -657,8 +657,10 @@ logical\\|double[ \t]*precision\\|type[ \t]*(\\(?:\\sw\\|\\s_\\)+)\\|none\\)[ \t '("\\(&\\)[ \t]*\\(!\\|$\\)" (1 font-lock-keyword-face)) "\\_<\\(then\\|continue\\|format\\|include\\|\\(?:error[ \t]+\\)?stop\\|\ return\\)\\_>" - '("\\_<\\(exit\\|cycle\\)[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)?\\_>" + '("\\_<\\(exit\\|cycle\\)[ \t]+\\(\\(?:\\sw\\|\\s_\\)+\\)?\\_>" (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)) + '("\\_<\\(exit\\|cycle\\)\\_>" + (1 font-lock-keyword-face)) '("\\_<\\(case\\)[ \t]*\\(default\\|(\\)" . 1) ;; F2003 "class default". '("\\_<\\(class\\)[ \t]*default" . 1) commit b060c3844fb8ad5a134d160a844c5bf898024d15 Author: Lars Ingebrigtsen Date: Sat Dec 4 04:06:27 2021 +0100 Make `mouse-1' restart the cua-rect rectangle * lisp/emulation/cua-rect.el (cua-mouse-set-rectangle-mark): Restart the rectangle on mouse-1 (bug#51557). diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index 65ae2f192f..7df45e705d 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -486,10 +486,8 @@ Activates the region if needed. Only lasts until the region is deactivated." (cua--deactivate t)) (setq cua--last-rectangle nil) (mouse-set-point event) - ;; FIX ME -- need to calculate virtual column. - (cua-set-rectangle-mark) - (setq cua--buffer-and-point-before-command nil) - (setq cua--mouse-last-pos nil)) + (activate-mark) + (cua-rectangle-mark-mode)) (defun cua-mouse-save-then-kill-rectangle (event arg) "Expand rectangle to mouse click position and copy rectangle. commit be1359884f68a3c8f8041be5579e6c5268d42d9a Author: Po Lu Date: Sat Dec 4 09:43:44 2021 +0800 Make last change work for deltas that are multiples of max-height * lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down-page) (pixel-scroll-precision-scroll-up-page): Use `max-height' that is slightly less than the text height of the window. diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 740aaf93c7..207d34811a 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -439,7 +439,8 @@ the height of the current window." (defun pixel-scroll-precision-scroll-down (delta) "Scroll the current window down by DELTA pixels." - (let ((max-height (window-text-height nil t))) + (let ((max-height (- (window-text-height nil t) + (frame-char-height)))) (while (> delta max-height) (pixel-scroll-precision-scroll-down-page max-height) (setq delta (- delta max-height))) @@ -499,7 +500,8 @@ the height of the current window." (defun pixel-scroll-precision-scroll-up (delta) "Scroll the current window up by DELTA pixels." - (let ((max-height (window-text-height nil t))) + (let ((max-height (- (window-text-height nil t) + (frame-char-height)))) (while (> delta max-height) (pixel-scroll-precision-scroll-up-page max-height) (setq delta (- delta max-height))) commit 1450fa16ed9ae41993ff32db51f380e3c99c908e Author: Po Lu Date: Sat Dec 4 09:09:28 2021 +0800 Make it work to pixel scroll by deltas larger than the window * lisp/pixel-scroll.el (pixel-scroll-precision-scroll-down-page): (pixel-scroll-precision-scroll-up-page): New functions. (pixel-scroll-precision-scroll-up) (pixel-scroll-precision-scroll-down): Make it safe to scroll by deltas larger than the current window. diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 1c2d95613e..740aaf93c7 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -401,10 +401,7 @@ Otherwise, redisplay will reset the window's vscroll." (set-window-start nil (pixel-point-at-unseen-line) t) (set-window-vscroll nil vscroll t)) -;; FIXME: This doesn't work when DELTA is larger than the height -;; of the current window, and someone should probably fix that -;; at some point. -(defun pixel-scroll-precision-scroll-down (delta) +(defun pixel-scroll-precision-scroll-down-page (delta) "Scroll the current window down by DELTA pixels. Note that this function doesn't work if DELTA is larger than the height of the current window." @@ -440,8 +437,18 @@ the height of the current window." (set-window-start nil desired-start t)) (set-window-vscroll nil desired-vscroll t)))) -(defun pixel-scroll-precision-scroll-up (delta) - "Scroll the current window up by DELTA pixels." +(defun pixel-scroll-precision-scroll-down (delta) + "Scroll the current window down by DELTA pixels." + (let ((max-height (window-text-height nil t))) + (while (> delta max-height) + (pixel-scroll-precision-scroll-down-page max-height) + (setq delta (- delta max-height))) + (pixel-scroll-precision-scroll-down-page delta))) + +(defun pixel-scroll-precision-scroll-up-page (delta) + "Scroll the current window up by DELTA pixels. +Note that this function doesn't work if DELTA is larger than +the height of the current window." (let* ((edges (window-edges nil t nil t)) (max-y (- (nth 3 edges) (nth 1 edges))) @@ -490,6 +497,14 @@ the height of the current window." (set-window-vscroll nil desired-vscroll t)) (set-window-vscroll nil (abs delta) t))))))) +(defun pixel-scroll-precision-scroll-up (delta) + "Scroll the current window up by DELTA pixels." + (let ((max-height (window-text-height nil t))) + (while (> delta max-height) + (pixel-scroll-precision-scroll-up-page max-height) + (setq delta (- delta max-height))) + (pixel-scroll-precision-scroll-up-page delta))) + ;; FIXME: This doesn't _always_ work when there's an image above the ;; current line that is taller than the window, and scrolling can ;; sometimes be jumpy in that case. commit 745a732ae40e88695a4415cafcc3666fc5d3a902 (refs/remotes/origin/emacs-28) Author: Stefan Kangas Date: Sat Dec 4 01:11:01 2021 +0100 ; Further author fixes in authors.el * admin/authors.el (authors-aliases): Add some missing entries. * etc/AUTHORS: Update accordingly. diff --git a/admin/authors.el b/admin/authors.el index a2020f3d32..9d72d8b6f4 100644 --- a/admin/authors.el +++ b/admin/authors.el @@ -99,6 +99,7 @@ files.") ("Gerd Möllmann" "Gerd Moellmann") ("Hallvard B. Furuseth" "Hallvard B Furuseth" "Hallvard Furuseth") ("Hrvoje Nikšić" "Hrvoje Niksic") + ("Ian Dunn" "^Ian D\\>") ;; lisp/org/ChangeLog.1 2010-11-11. (nil "immerrr") (nil "aaa bbb") @@ -106,11 +107,16 @@ files.") (nil "jakanakaevangeli") ("J. Alexander Branham" "Alex Branham") ("Jaeyoun Chung" "Jae-youn Chung" "Jae-you Chung" "Chung Jae-youn") - ("Jan Djärv" "Jan D." "Jan Djarv") + ("Jan Djärv" "Jan D\\>" "Jan Djarv") + ("João Távora" "João Tãvora") ("Jay K. Adams" "Jay Adams") + ("J.D. Smith" "Jd Smith") ("Jérôme Marant" "Jérôme Marant" "Jerome Marant") + ("Jens Lechtenbörger" "Jens Lechtenboerger") ("Jens-Ulrik Holger Petersen" "Jens-Ulrik Petersen") + ("Jérémie Courrèges-Anglas" "Jeremie Courreges-Anglas") ("Jeremy Bertram Maitin-Shepard" "Jeremy Maitin-Shepard") + ("Jérémy Compostella" "Jeremy Compostella") ("Jimmy Aguilar Mena" "Ergus") ("Johan Bockgård" "Johan Bockgard") ("John F. Carr" "John F Carr") @@ -155,7 +161,7 @@ files.") ("Michael I. Bushnell" "Michael I Bushnell" "Michael I. Bushnell, p/BSG") ("Michael R. Cook" "Michael Cook") ("Michael Sperber" "Mike Sperber" "Michael Sperber \\[Mr. Preprocessor\\]") - ("Michalis V" "mvar") + ("Michalis V" "^mvar") ("Mikio Nakajima" "Nakajima Mikio") ("Nelson Jose dos Santos Ferreira" "Nelson Ferreira") ("Noorul Islam" "Noorul Islam K M") diff --git a/etc/AUTHORS b/etc/AUTHORS index 9625976120..3e70cc6d35 100644 --- a/etc/AUTHORS +++ b/etc/AUTHORS @@ -2189,9 +2189,7 @@ Hugh Daschbach: changed dbus-tests.el dbus.el org.gnu.Emacs.TestDBus.xml Hynek Schlawack: changed gnus-art.el gnus-sum.el -Ian D: changed doc-view.el image-mode.el - -Ian Dunn: changed eww.el vc-hg.el +Ian Dunn: changed eww.el doc-view.el image-mode.el vc-hg.el Ian Eure: changed sql.el url-util.el @@ -2473,11 +2471,10 @@ Jay McCarthy: changed org-colview.el Jay Sachs: changed gnus-score.el gnus-win.el -Jd Smith: co-wrote idlw-help.el idlw-shell.el idlwave.el - -J.D. Smith: changed idlwave.el idlw-shell.el idlw-help.el idlw-rinfo.el - idlw-toolbar.el comint.el idlwave.texi vc.el bibtex.el files.texi - hideshow.el idlw-complete-structtag.el misc.texi mouse.el +J.D. Smith: co-wrote idlw-help.el idlw-shell.el idlwave.el +and changed idlw-rinfo.el idlw-toolbar.el comint.el idlwave.texi vc.el + bibtex.el files.texi hideshow.el idlw-complete-structtag.el misc.texi + mouse.el Jean-Christophe Helary: changed emacs-lisp-intro.texi ns-win.el package-tests.el package.el strings.texi subr-x.el ucs-normalize.el @@ -2530,10 +2527,9 @@ Jens Krinke: changed smime.el Jens Lautenbacher: changed gnus.el -Jens Lechtenboerger: changed mml-sec.el gnus-util.el message.texi - mml-smime.el mml1991.el mml2015.el message.el package.el package.texi - Jens Lechtenbörger: wrote gnus-util-tests.el mml-sec-tests.el +and changed mml-sec.el gnus-util.el message.texi mml-smime.el mml1991.el + mml2015.el message.el package.el package.texi Jens Petersen: wrote find-func.el and changed mule-cmds.el pcmpl-rpm.el @@ -2547,17 +2543,13 @@ Jens Uwe Schmidt: changed edebug.el Jeramey Crawford: changed amdx86-64.h configure.ac -Jeremie Courreges-Anglas: changed kqueue.c - -Jérémie Courrèges-Anglas: changed org.texi ox-latex.el +Jérémie Courrèges-Anglas: changed kqueue.c org.texi ox-latex.el Jeremy Bertram Maitin-Shepard: changed erc.el erc-backend.el erc-button.el erc-track.el mml.el -Jeremy Compostella: changed mml.el - -Jérémy Compostella: changed tramp-sh.el battery.el keyboard.c windmove.el - window.el xdisp.c +Jérémy Compostella: changed tramp-sh.el mml.el battery.el keyboard.c + windmove.el window.el xdisp.c Jeremy Moore: changed hideif.el @@ -2661,8 +2653,6 @@ and changed flymake.el icomplete.el minibuffer.el flymake-proc.el progmodes/python.el text.texi xref.el json-tests.el project.el tex-mode.el buffers.texi cfengine.el and 55 other files -João Tãvora: changed jsonrpc.el - Jochen Hein: changed gnus-art.el Jochen Küpper: changed gnus.texi calc-units.el commit bef17bca2155775b691ae35b58cc35d19fa2b9f6 Author: Stefan Kangas Date: Sat Dec 4 01:00:04 2021 +0100 * src/dosfns.c (Fint86): Doc fix; don't use obsolete names. diff --git a/src/dosfns.c b/src/dosfns.c index 10023c8c7f..17e896cf2e 100644 --- a/src/dosfns.c +++ b/src/dosfns.c @@ -58,8 +58,8 @@ DEFUN ("int86", Fint86, Sint86, 2, 2, 0, Return the updated REGISTER vector. INTERRUPT should be an integer in the range 0 to 255. -REGISTERS should be a vector produced by `make-register' and -`set-register-value'. */) +REGISTERS should be a vector produced by `dos-make-register' and +`dos-set-register-value'. */) (Lisp_Object interrupt, Lisp_Object registers) { register int i; commit bc55dc04af79d624ba6f78bf000482cf7c6d513c Author: Stefan Kangas Date: Fri Dec 3 22:57:48 2021 +0100 * doc/misc/erc.texi (Keystroke Summary): Fix doc for TAB. diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index 10ced678e1..48dc1b609a 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -283,7 +283,7 @@ Go to beginning of line or end of prompt. @item @key{RET} (@code{erc-send-current-line}) Send the current line -@item @key{TAB} (@code{erc-complete-word}) +@item @key{TAB} (@code{completion-at-point} or @code{erc-button-next}) If at prompt, complete the current word. Otherwise, move to the next link or button. commit 352c737dcef4171f71980b432cc86df6511d8643 Author: Lars Ingebrigtsen Date: Fri Dec 3 22:21:41 2021 +0100 Ensure that MAIN_FIRST have finished compilation before doing the rest * lisp/Makefile.in (main-first): Ensure that we're done with the main bits before starting on the rest. (GREP_OPTIONS): Depend on main-first. (MAIN_FIRST): Compile cconv.el before c-by.el (bug#8764). diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 4380a3bdb6..353c9e652c 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -98,7 +98,7 @@ COMPILE_FIRST += $(lisp)/emacs-lisp/autoload.elc # Files to compile early in compile-main. Works around bug#25556. MAIN_FIRST = ./emacs-lisp/eieio.el ./emacs-lisp/eieio-base.el \ - ./cedet/semantic/db.el + ./cedet/semantic/db.el ./emacs-lisp/cconv.el # Prevent any settings in the user environment causing problems. unexport EMACSDATA EMACSDOC EMACSPATH @@ -338,10 +338,10 @@ endif # Compile all the Elisp files that need it. Beware: it approximates # 'no-byte-compile', so watch out for false-positives! -compile-main: gen-lisp compile-clean +compile-main: gen-lisp compile-clean main-first @(cd $(lisp) && \ els=`echo "${SUBDIRS_REL} " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \ - for el in ${MAIN_FIRST} $$els; do \ + for el in $$els; do \ test -f $$el || continue; \ test ! -f $${el}c && \ GREP_OPTIONS= grep '^;.*[^a-zA-Z]no-byte-compile: *t' $$el > /dev/null && \ @@ -354,6 +354,18 @@ compile-main: gen-lisp compile-clean TARGETS="$$chunk"; \ done +# Compile some important files first. +main-first: + @(cd $(lisp) && \ + for el in ${MAIN_FIRST}; do \ + echo "$${el}c"; \ + done | xargs $(XARGS_LIMIT) echo) | \ + while read chunk; do \ + $(MAKE) compile-targets \ + NATIVE_DISABLED=$(NATIVE_SKIP_NONDUMP) \ + TARGETS="$$chunk"; \ + done + .PHONY: compile-clean # Erase left-over .elc files that do not have a corresponding .el file. compile-clean: commit 1e2bc1bbf47782df7f9b8051f33904432c55e6e4 Author: Paul Eggert Date: Fri Dec 3 13:05:31 2021 -0800 Port to Tiny C on x86-64 This allows Emacs to build on Ubuntu 21.10 x86-64 with ‘./configure --without-modules CC=tcc’. * configure.ac (GC_SETJMP_WORKS): Accept __x86_64__ as an alias for __amd64__. * src/lisp.h (alignas): Provide a no-op substitute. diff --git a/configure.ac b/configure.ac index c36dffde84..0c23b60805 100644 --- a/configure.ac +++ b/configure.ac @@ -5426,6 +5426,7 @@ case $opsys in #if defined __i386__ || defined __sparc__ || defined __mc68000__ \ || defined __alpha__ || defined __mips__ || defined __s390__ \ || defined __arm__ || defined __powerpc__ || defined __amd64__ \ + || defined __x86_64__ \ || defined __ia64__ || defined __sh__ /* ok */ #else diff --git a/src/lisp.h b/src/lisp.h index 242156bbcb..d44ab55453 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -259,6 +259,11 @@ DEFINE_GDB_SYMBOL_BEGIN (EMACS_INT, VALMASK) # define VALMASK (USE_LSB_TAG ? - (1 << GCTYPEBITS) : VAL_MAX) DEFINE_GDB_SYMBOL_END (VALMASK) +/* Ignore 'alignas' on compilers lacking it. */ +#if !defined alignas && !defined __alignas_is_defined +# define alignas(a) +#endif + /* Minimum alignment requirement for Lisp objects, imposed by the internal representation of tagged pointers. It is 2**GCTYPEBITS if USE_LSB_TAG, 1 otherwise. It must be a literal integer constant, commit 397a6a73d7885c0aa4eb7396eeb6aaaec8b0202b Author: Eli Zaretskii Date: Fri Dec 3 21:55:10 2021 +0200 Revert "emacs-lisp-mode: Use error face for "/d" indicator" This reverts commit ddc875d9f75bdd1d5dda6a721489f43317b0f8b5. I disagree with the need to make it more prominent than the warning face. The warning face is prominent enough. We never decided to annoy people like that. diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 167f8a1b18..7da93a351a 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -283,7 +283,7 @@ Comments in the form will be lost." (:propertize "/d" help-echo "Using old dynamic scoping mode\n\ mouse-1: Enable lexical-binding mode" - face error + face warning mouse-face mode-line-highlight local-map ,elisp--dynlex-modeline-map))) "Major mode for editing Lisp code to run in Emacs. commit c8b72ad0eaf63cfe73542b6014e76a2111df6820 Author: Eli Zaretskii Date: Fri Dec 3 21:52:49 2021 +0200 Add more dired-x tests * test/lisp/dired-x-tests.el (dired-x--string-to-number): Add more tests with various thousands separators. diff --git a/test/lisp/dired-x-tests.el b/test/lisp/dired-x-tests.el index c6ac7c602e..69c88c060a 100644 --- a/test/lisp/dired-x-tests.el +++ b/test/lisp/dired-x-tests.el @@ -65,7 +65,10 @@ (should (= (dired-x--string-to-number "2400") 2400)) (should (= (dired-x--string-to-number "123.4M") 129394278.4)) (should (= (dired-x--string-to-number "123.40000M") 129394278.4)) - (should (= (dired-x--string-to-number "4.134") 4134))) + (should (= (dired-x--string-to-number "4.134") 4134)) + (should (= (dired-x--string-to-number "4,134") 4134)) + (should (= (dired-x--string-to-number "4 134") 4134)) + (should (= (dired-x--string-to-number "41,52,134") 4152134))) (provide 'dired-x-tests) ;;; dired-x-tests.el ends here commit 7558e830970b4c111e2854f0c6674889b029998e Author: Eli Zaretskii Date: Fri Dec 3 21:44:26 2021 +0200 ; * etc/NEWS: Move incompatible changes into a separate section. diff --git a/etc/NEWS b/etc/NEWS index 624fe4de97..81fc26b147 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -73,12 +73,24 @@ be used to reinitialize structures that would normally be done at load time. -* Changes in Emacs 29.1 +* Incompatible changes in Emacs 29.1 --- ** 'C-x 8 .' has been moved to 'C-x 8 . .'. This is to open up the 'C-x 8 .' map to bind further characters there. +--- +** The mode line now uses a proportional font by default. +To get the old monospaced mode line back, customize the +'mode-line-active' and 'mode-line-inactive' faces not to inherit from +the 'variable-pitch' face, or add this to your "~/.emacs": + + (set-face-attribute 'mode-line-active nil :inherit 'mode-line) + (set-face-attribute 'mode-line-inactive nil :inherit 'mode-line) + + +* Changes in Emacs 29.1 + --- ** 'write-file' will now copy some file mode bits. If the current buffer is visiting a file that is executable, the @@ -101,15 +113,6 @@ mixed. This inherits from the 'mode-line' face, but is the face actually used on the mode lines (along with 'mode-line-inactive'). ---- -** The mode line now uses a proportional font by default. -To get the old monospaced mode line back, customize the -'mode-line-active' and 'mode-line-inactive' faces not to inherit from -the 'variable-pitch' face, or add this to your "~/.emacs": - - (set-face-attribute 'mode-line-active nil :inherit 'mode-line) - (set-face-attribute 'mode-line-inactive nil :inherit 'mode-line) - +++ ** New function 'buffer-text-pixel-size'. This is similar to 'window-text-pixel-size', but can be used when the commit ef4d216eb326478563e3cf931aeeb2dbc3566f12 Author: Stefan Kangas Date: Fri Dec 3 20:41:38 2021 +0100 Remove reference to variable obsolete since 24.1 * doc/emacs/custom.texi (Minibuffer Maps, Minibuffer Maps): Remove reference to variable 'minibuffer-local-filename-must-match-map', obsolete since 24.1. diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 60e2d0aa87..a3d8a779b8 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1700,7 +1700,6 @@ circumstances. @vindex minibuffer-local-completion-map @vindex minibuffer-local-must-match-map @vindex minibuffer-local-filename-completion-map -@vindex minibuffer-local-filename-must-match-map The minibuffer has its own set of local keymaps; they contain various completion and exit commands. @@ -1716,10 +1715,9 @@ just like @key{RET}. @code{minibuffer-local-must-match-map} is for strict completion and for cautious completion. @item -@code{minibuffer-local-filename-completion-map} and -@code{minibuffer-local-filename-must-match-map} are like the two -previous ones, but they are specifically for file name completion. -They do not bind @key{SPC}. +@code{minibuffer-local-filename-completion-map} is like the two +previous ones, but specifically for file name completion. +It does not bind @key{SPC}. @end itemize By default, @key{TAB}, @key{SPC} and @key{?} do completion in commit c082dbbc215f7a76b45573f39d926a2ace354258 Author: Stefan Kangas Date: Fri Dec 3 19:53:46 2021 +0100 Remove some more items obsolete since Emacs 23 * lisp/emacs-lisp/shadow.el (find-emacs-lisp-shadows): * lisp/net/newst-backend.el (newsticker-cache-filename) (newsticker--cache-save-version1, newsticker--cache-update) (newsticker--cache-read-version1): * lisp/obsolete/vc-arch.el (vc-arch-command): Remove items obsolete since Emacs 23. diff --git a/etc/NEWS b/etc/NEWS index 4ed3350c0e..624fe4de97 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -767,8 +767,11 @@ Use 'exif-parse-file' and 'exif-field' instead. ** 'insert-directory' alternatives should not change the free disk space line. This change is now applied in 'dired-insert-directory'. -** Some functions obsolete since Emacs 23 have been removed: -'unify-8859-on-encoding-mode', 'unify-8859-on-decoding-mode'. +** Some functions and variables obsolete since Emacs 23 have been removed: +'find-emacs-lisp-shadows', 'newsticker--cache-read-version1', +'newsticker--cache-save-version1', 'newsticker--cache-update', +'newsticker-cache-filename', 'unify-8859-on-decoding-mode', +'unify-8859-on-encoding-mode', 'vc-arch-command'. * Lisp Changes in Emacs 29.1 diff --git a/lisp/emacs-lisp/shadow.el b/lisp/emacs-lisp/shadow.el index e2a24e9949..1fbe946a7f 100644 --- a/lisp/emacs-lisp/shadow.el +++ b/lisp/emacs-lisp/shadow.el @@ -151,9 +151,6 @@ See the documentation for `list-load-path-shadows' for further information." ;; Return the list of shadowings. shadows)) -(define-obsolete-function-alias 'find-emacs-lisp-shadows - 'load-path-shadows-find "23.3") - ;; Return true if neither file exists, or if both exist and have identical ;; contents. (defun load-path-shadows-same-file-or-nonexistent (f1 f2) diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el index 27ea713d0e..efbff79d68 100644 --- a/lisp/net/newst-backend.el +++ b/lisp/net/newst-backend.el @@ -402,13 +402,6 @@ headline after it has been retrieved for the first time." "Miscellaneous newsticker settings." :group 'newsticker) -(defcustom newsticker-cache-filename - "~/.newsticker-cache" - "Name of the newsticker cache file." - :type 'string - :group 'newsticker-miscellaneous) -(make-obsolete-variable 'newsticker-cache-filename 'newsticker-dir "23.1") - (defcustom newsticker-dir (locate-user-emacs-file "newsticker/" ".newsticker/") "Directory where newsticker saves data." @@ -2115,28 +2108,6 @@ well." (throw 'result t))))) (< (or (newsticker--pos item1) 0) (or (newsticker--pos item2) 0)))) -(defun newsticker--cache-save-version1 () - "Update and save newsticker cache file." - (interactive) - (newsticker--cache-update t)) - -(defun newsticker--cache-update (&optional save) - "Update newsticker cache file. -If optional argument SAVE is not nil the cache file is saved to disk." - (save-excursion - (unless (file-directory-p newsticker-dir) - (make-directory newsticker-dir t)) - (let ((coding-system-for-write 'utf-8) - (buf (find-file-noselect newsticker-cache-filename))) - (when buf - (set-buffer buf) - (setq buffer-undo-list t) - (erase-buffer) - (insert ";; -*- coding: utf-8 -*-\n") - (insert (prin1-to-string newsticker--cache)) - (when save - (save-buffer)))))) - (defun newsticker--cache-get-feed (feed) "Return the cached data for the feed FEED. FEED is a symbol!" @@ -2163,30 +2134,11 @@ FEED is a symbol!" (insert ";; -*- coding: utf-8 -*-\n") (insert (prin1-to-string (cdr feed))))))) -(defun newsticker--cache-read-version1 () - "Read version1 cache data." - (let ((coding-system-for-read 'utf-8)) - (when (file-exists-p newsticker-cache-filename) - (with-temp-buffer - (insert-file-contents newsticker-cache-filename) - (goto-char (point-min)) - (condition-case nil - (setq newsticker--cache (read (current-buffer))) - (error - (message "Error while reading newsticker cache file!") - (setq newsticker--cache nil))))))) - (defun newsticker--cache-read () "Read cache data." (setq newsticker--cache nil) - (if (file-exists-p newsticker-cache-filename) - (progn - (when (y-or-n-p "Old newsticker cache file exists. Read it? ") - (newsticker--cache-read-version1)) - (when (y-or-n-p "Delete old newsticker cache file? ") - (delete-file newsticker-cache-filename))) - (dolist (f (append newsticker-url-list-defaults newsticker-url-list)) - (newsticker--cache-read-feed (car f))))) + (dolist (f (append newsticker-url-list-defaults newsticker-url-list)) + (newsticker--cache-read-feed (car f)))) (defun newsticker--cache-read-feed (feed-name) "Read cache data for feed named FEED-NAME." diff --git a/lisp/obsolete/vc-arch.el b/lisp/obsolete/vc-arch.el index fbbd2d4ecf..1dffd36f0e 100644 --- a/lisp/obsolete/vc-arch.el +++ b/lisp/obsolete/vc-arch.el @@ -83,8 +83,6 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." (repeat :tag "Argument List" :value ("") string)) :version "23.1") -(define-obsolete-variable-alias 'vc-arch-command 'vc-arch-program "23.1") - (defcustom vc-arch-program (let ((candidates '("tla" "baz"))) (while (and candidates (not (executable-find (car candidates)))) commit 76bbb7e648d46cfdc73675eb6e5f52e146f4c368 Author: Stefan Kangas Date: Fri Dec 3 19:25:59 2021 +0100 Remove two functions obsolete since Emacs 23 * lisp/international/mule-cmds.el (unify-8859-on-encoding-mode) (unify-8859-on-decoding-mode): Remove functions obsolete since Emacs 23. * lisp/nxml/xsd-regexp.el: Doc fix. diff --git a/etc/NEWS b/etc/NEWS index 8dadd3d268..4ed3350c0e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -767,6 +767,9 @@ Use 'exif-parse-file' and 'exif-field' instead. ** 'insert-directory' alternatives should not change the free disk space line. This change is now applied in 'dired-insert-directory'. +** Some functions obsolete since Emacs 23 have been removed: +'unify-8859-on-encoding-mode', 'unify-8859-on-decoding-mode'. + * Lisp Changes in Emacs 29.1 diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 9f3f2a2084..b84d9e0823 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -3077,22 +3077,6 @@ on encoding." 0)) (substring enc2 i0 i2))))) -;; Backwards compatibility. These might be better with :init-value t, -;; but that breaks loadup. -(define-minor-mode unify-8859-on-encoding-mode - "Exists only for backwards compatibility." - :group 'mule - :global t) -;; Doc said "obsolete" in 23.1, this statement only added in 24.1. -(make-obsolete 'unify-8859-on-encoding-mode "don't use it." "23.1") - -(define-minor-mode unify-8859-on-decoding-mode - "Exists only for backwards compatibility." - :group 'mule - :global t) -;; Doc said "obsolete" in 23.1, this statement only added in 24.1. -(make-obsolete 'unify-8859-on-decoding-mode "don't use it." "23.1") - (defvar ucs-names nil "Hash table of cached CHAR-NAME keys to CHAR-CODE values.") diff --git a/lisp/nxml/xsd-regexp.el b/lisp/nxml/xsd-regexp.el index f07ca6657e..3c29803ab9 100644 --- a/lisp/nxml/xsd-regexp.el +++ b/lisp/nxml/xsd-regexp.el @@ -52,9 +52,6 @@ ;; or a character translatable to such a character (i.e a character ;; for which `encode-char' will return non-nil). ;; -;; Using unify-8859-on-decoding-mode is probably a good idea here -;; (and generally with XML and other Unicode-oriented formats). -;; ;; Unfortunately, this means that this package is currently useless ;; for CJK characters, since there's no mule-unicode charset for the ;; CJK ranges of Unicode. We should devise a workaround for this commit 5586eb463fb3c11298f6e1a0b4fd1e86b9a1dd65 Author: Paul Eggert Date: Fri Dec 3 09:47:22 2021 -0800 Prefer rsvg_handle_get_intrinsic_size_in_pixels Use rsvg_handle_get_intrinsic_size_in_pixels if available, as this is simpler and better than what we were doing. From a comment by by Alan Third (Bug#44655#56). * src/image.c (init_svg_functions): Arrange for the new function. (svg_load_image): Prefer the results of rsvg_handle_get_intrinsic_size_in_pixels if available. diff --git a/src/image.c b/src/image.c index 14e9944db2..c08ee92287 100644 --- a/src/image.c +++ b/src/image.c @@ -10066,6 +10066,10 @@ DEF_DLL_FN (gboolean, rsvg_handle_close, (RsvgHandle *, GError **)); DEF_DLL_FN (void, rsvg_handle_set_dpi_x_y, (RsvgHandle * handle, double dpi_x, double dpi_y)); +# if LIBRSVG_CHECK_VERSION (2, 52, 1) +DEF_DLL_FN (void, rsvg_handle_get_intrinsic_size_in_pixels, + (RsvgHandle *, gdouble *, gdouble *)); +# endif # if LIBRSVG_CHECK_VERSION (2, 46, 0) DEF_DLL_FN (void, rsvg_handle_get_intrinsic_dimensions, (RsvgHandle *, gboolean *, RsvgLength *, gboolean *, @@ -10129,6 +10133,9 @@ init_svg_functions (void) LOAD_DLL_FN (library, rsvg_handle_close); #endif LOAD_DLL_FN (library, rsvg_handle_set_dpi_x_y); +#if LIBRSVG_CHECK_VERSION (2, 52, 1) + LOAD_DLL_FN (library, rsvg_handle_get_intrinsic_size_in_pixels); +#endif #if LIBRSVG_CHECK_VERSION (2, 46, 0) LOAD_DLL_FN (library, rsvg_handle_get_intrinsic_dimensions); LOAD_DLL_FN (library, rsvg_handle_get_geometry_for_layer); @@ -10172,6 +10179,9 @@ init_svg_functions (void) # undef g_clear_error # undef g_object_unref # undef g_type_init +# if LIBRSVG_CHECK_VERSION (2, 52, 1) +# undef rsvg_handle_get_intrinsic_size_in_pixels +# endif # if LIBRSVG_CHECK_VERSION (2, 46, 0) # undef rsvg_handle_get_intrinsic_dimensions # undef rsvg_handle_get_geometry_for_layer @@ -10207,6 +10217,10 @@ init_svg_functions (void) # if ! GLIB_CHECK_VERSION (2, 36, 0) # define g_type_init fn_g_type_init # endif +# if LIBRSVG_CHECK_VERSION (2, 52, 1) +# define rsvg_handle_get_intrinsic_size_in_pixels \ + fn_rsvg_handle_get_intrinsic_size_in_pixels +# endif # if LIBRSVG_CHECK_VERSION (2, 46, 0) # define rsvg_handle_get_intrinsic_dimensions \ fn_rsvg_handle_get_intrinsic_dimensions @@ -10444,51 +10458,71 @@ svg_load_image (struct frame *f, struct image *img, char *contents, /* Get the image dimensions. */ #if LIBRSVG_CHECK_VERSION (2, 46, 0) - RsvgRectangle zero_rect, viewbox, out_logical_rect; - - /* Try the intrinsic dimensions first. */ - gboolean has_width, has_height, has_viewbox; - RsvgLength iwidth, iheight; - double dpi = FRAME_DISPLAY_INFO (f)->resx; - - rsvg_handle_get_intrinsic_dimensions (rsvg_handle, - &has_width, &iwidth, - &has_height, &iheight, - &has_viewbox, &viewbox); + gdouble gviewbox_width, gviewbox_height; + gboolean has_viewbox = FALSE; +# if LIBRSVG_CHECK_VERSION (2, 52, 1) + has_viewbox = rsvg_handle_get_intrinsic_size_in_pixels (rsvg_handle, + &gviewbox_width, + &gviewbox_height); +# endif - if (has_width && has_height) + if (has_viewbox) { - /* Success! We can use these values directly. */ - viewbox_width = svg_css_length_to_pixels (iwidth, dpi, img->face_font_size); - viewbox_height = svg_css_length_to_pixels (iheight, dpi, img->face_font_size); - } - else if (has_width && has_viewbox) - { - viewbox_width = svg_css_length_to_pixels (iwidth, dpi, img->face_font_size); - viewbox_height = viewbox_width * viewbox.height / viewbox.width; - } - else if (has_height && has_viewbox) - { - viewbox_height = svg_css_length_to_pixels (iheight, dpi, img->face_font_size); - viewbox_width = viewbox_height * viewbox.width / viewbox.height; - } - else if (has_viewbox) - { - viewbox_width = viewbox.width; - viewbox_height = viewbox.height; + viewbox_width = gviewbox_width; + viewbox_height = gviewbox_height; } else - viewbox_width = viewbox_height = 0; - - if (! (0 < viewbox_width && 0 < viewbox_height)) { - /* We haven't found a usable set of sizes, so try working out - the visible area. */ - rsvg_handle_get_geometry_for_layer (rsvg_handle, NULL, - &zero_rect, &viewbox, - &out_logical_rect, NULL); - viewbox_width = viewbox.x + viewbox.width; - viewbox_height = viewbox.y + viewbox.height; + RsvgRectangle zero_rect, viewbox, out_logical_rect; + + /* Try the intrinsic dimensions first. */ + gboolean has_width, has_height; + RsvgLength iwidth, iheight; + double dpi = FRAME_DISPLAY_INFO (f)->resx; + + rsvg_handle_get_intrinsic_dimensions (rsvg_handle, + &has_width, &iwidth, + &has_height, &iheight, + &has_viewbox, &viewbox); + + if (has_width && has_height) + { + /* Success! We can use these values directly. */ + viewbox_width = svg_css_length_to_pixels (iwidth, dpi, + img->face_font_size); + viewbox_height = svg_css_length_to_pixels (iheight, dpi, + img->face_font_size); + } + else if (has_width && has_viewbox) + { + viewbox_width = svg_css_length_to_pixels (iwidth, dpi, + img->face_font_size); + viewbox_height = viewbox_width * viewbox.height / viewbox.width; + } + else if (has_height && has_viewbox) + { + viewbox_height = svg_css_length_to_pixels (iheight, dpi, + img->face_font_size); + viewbox_width = viewbox_height * viewbox.width / viewbox.height; + } + else if (has_viewbox) + { + viewbox_width = viewbox.width; + viewbox_height = viewbox.height; + } + else + viewbox_width = viewbox_height = 0; + + if (! (0 < viewbox_width && 0 < viewbox_height)) + { + /* We haven't found a usable set of sizes, so try working out + the visible area. */ + rsvg_handle_get_geometry_for_layer (rsvg_handle, NULL, + &zero_rect, &viewbox, + &out_logical_rect, NULL); + viewbox_width = viewbox.x + viewbox.width; + viewbox_height = viewbox.y + viewbox.height; + } } #else /* In librsvg before 2.46.0, guess the viewbox from the image dimensions. */ commit bcb4651c412dc8b37f1e9978681a958b7e919277 Author: Paul Eggert Date: Fri Dec 3 09:47:22 2021 -0800 Improve overflow checking in svg_load_image * src/image.c: Include math.h, for lrint. (scale_image_size, compute_image_size): Use ‘double’, not ‘int’ for image size args, since librsvg uses ‘double’ for pixel counts. (scale_image_size): Use ceil instead of rounding, to avoid discarding fractional SVG pixels. Divisor and multiplier are now double instead of int, for better portability to librsvg functions with fractional pixel sizes. (image_get_dimension, compute_image_size, svg_load_image): Be more careful about ignoring, rejecting or clipping scale factors or sizes that are out of integer range. (compute_image_size): Don’t bother to calculate :max-width if :width is specified, and likewise for :max-height and :height. diff --git a/src/image.c b/src/image.c index 1db2b78ad5..14e9944db2 100644 --- a/src/image.c +++ b/src/image.c @@ -31,6 +31,7 @@ along with GNU Emacs. If not, see . */ #include +#include #include #include #include @@ -2016,14 +2017,16 @@ postprocess_image (struct frame *f, struct image *img) safely rounded and clipped to int range. */ static int -scale_image_size (int size, size_t divisor, size_t multiplier) +scale_image_size (int size, double divisor, double multiplier) { if (divisor != 0) { - double s = size; - double scaled = s * multiplier / divisor + 0.5; + double scaled = size * multiplier / divisor; if (scaled < INT_MAX) - return scaled; + { + /* Use ceil, as rounding can discard fractional SVG pixels. */ + return ceil (scaled); + } } return INT_MAX; } @@ -2044,84 +2047,77 @@ image_get_dimension (struct image *img, Lisp_Object symbol) if (FIXNATP (value)) return min (XFIXNAT (value), INT_MAX); if (CONSP (value) && NUMBERP (CAR (value)) && EQ (Qem, CDR (value))) - return min (img->face_font_size * XFLOATINT (CAR (value)), INT_MAX); + return scale_image_size (img->face_font_size, 1, XFLOATINT (CAR (value))); return -1; } /* Compute the desired size of an image with native size WIDTH x HEIGHT. - Use SPEC to deduce the size. Store the desired size into + Use IMG to deduce the size. Store the desired size into *D_WIDTH x *D_HEIGHT. Store -1 x -1 if the native size is OK. */ static void -compute_image_size (size_t width, size_t height, +compute_image_size (double width, double height, struct image *img, int *d_width, int *d_height) { - Lisp_Object value; - int int_value; - int desired_width = -1, desired_height = -1, max_width = -1, max_height = -1; double scale = 1; - - value = image_spec_value (img->spec, QCscale, NULL); + Lisp_Object value = image_spec_value (img->spec, QCscale, NULL); if (NUMBERP (value)) - scale = XFLOATINT (value); - - int_value = image_get_dimension (img, QCmax_width); - if (int_value >= 0) - max_width = int_value; - - int_value = image_get_dimension (img, QCmax_height); - if (int_value >= 0) - max_height = int_value; + { + double dval = XFLOATINT (value); + if (0 <= dval) + scale = dval; + } /* If width and/or height is set in the display spec assume we want to scale to those values. If either h or w is unspecified, the unspecified should be calculated from the specified to preserve aspect ratio. */ - int_value = image_get_dimension (img, QCwidth); - if (int_value >= 0) + int desired_width = image_get_dimension (img, QCwidth), max_width; + if (desired_width < 0) + max_width = image_get_dimension (img, QCmax_width); + else { - desired_width = int_value * scale; + desired_width = scale_image_size (desired_width, 1, scale); /* :width overrides :max-width. */ max_width = -1; } - int_value = image_get_dimension (img, QCheight); - if (int_value >= 0) + int desired_height = image_get_dimension (img, QCheight), max_height; + if (desired_height < 0) + max_height = image_get_dimension (img, QCmax_height); + else { - desired_height = int_value * scale; + desired_height = scale_image_size (desired_height, 1, scale); /* :height overrides :max-height. */ max_height = -1; } /* If we have both width/height set explicitly, we skip past all the aspect ratio-preserving computations below. */ - if (desired_width != -1 && desired_height != -1) + if (0 <= desired_width && 0 <= desired_height) goto out; - width = width * scale; - height = height * scale; - - if (desired_width != -1) + if (0 <= desired_width) /* Width known, calculate height. */ desired_height = scale_image_size (desired_width, width, height); - else if (desired_height != -1) + else if (0 <= desired_height) /* Height known, calculate width. */ desired_width = scale_image_size (desired_height, height, width); else { - desired_width = width; - desired_height = height; + desired_width = scale_image_size (width, 1, scale); + desired_height = scale_image_size (height, 1, scale); } - if (max_width != -1 && desired_width > max_width) + if (0 <= max_width && max_width < desired_width) { /* The image is wider than :max-width. */ desired_width = max_width; desired_height = scale_image_size (desired_width, width, height); } - if (max_height != -1 && desired_height > max_height) + if (0 <= max_height && max_height < desired_height) { /* The image is higher than :max-height. */ desired_height = max_height; @@ -10484,7 +10480,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents, else viewbox_width = viewbox_height = 0; - if (viewbox_width == 0 || viewbox_height == 0) + if (! (0 < viewbox_width && 0 < viewbox_height)) { /* We haven't found a usable set of sizes, so try working out the visible area. */ @@ -10505,8 +10501,8 @@ svg_load_image (struct frame *f, struct image *img, char *contents, compute_image_size (viewbox_width, viewbox_height, img, &width, &height); - width *= FRAME_SCALE_FACTOR (f); - height *= FRAME_SCALE_FACTOR (f); + width = scale_image_size (width, 1, FRAME_SCALE_FACTOR (f)); + height = scale_image_size (height, 1, FRAME_SCALE_FACTOR (f)); if (! check_image_size (f, width, height)) { commit 02386da9389104ca4d4dde875a3fdac36eb10555 Author: Paul Eggert Date: Fri Dec 3 09:47:22 2021 -0800 Simplify svg_load_image * src/image.c (svg_load_image): Simplify slightly. diff --git a/src/image.c b/src/image.c index f13304912c..1db2b78ad5 100644 --- a/src/image.c +++ b/src/image.c @@ -10469,14 +10469,12 @@ svg_load_image (struct frame *f, struct image *img, char *contents, else if (has_width && has_viewbox) { viewbox_width = svg_css_length_to_pixels (iwidth, dpi, img->face_font_size); - viewbox_height = svg_css_length_to_pixels (iwidth, dpi, img->face_font_size) - * viewbox.height / viewbox.width; + viewbox_height = viewbox_width * viewbox.height / viewbox.width; } else if (has_height && has_viewbox) { viewbox_height = svg_css_length_to_pixels (iheight, dpi, img->face_font_size); - viewbox_width = svg_css_length_to_pixels (iheight, dpi, img->face_font_size) - * viewbox.width / viewbox.height; + viewbox_width = viewbox_height * viewbox.width / viewbox.height; } else if (has_viewbox) { commit 19ac237c9eeedebbf6bfb23e16d5f9f463e2d80a Author: Paul Eggert Date: Fri Dec 3 09:47:22 2021 -0800 More-robust svg_load_image fallback Suggested by Alan Third (Bug#44655#56). * src/image.c (svg_load_image): Fall back on rsvg_handle_get_geometry_for_layer if the rsvg_handle_get_intrinsic_dimensions computations yielded unusable viewbox width and height, instead of falling back only if rsvg_handle_get_intrinsic_dimensions did not report image width and height, or did not report a viewbox. diff --git a/src/image.c b/src/image.c index f2597f529d..f13304912c 100644 --- a/src/image.c +++ b/src/image.c @@ -10484,6 +10484,9 @@ svg_load_image (struct frame *f, struct image *img, char *contents, viewbox_height = viewbox.height; } else + viewbox_width = viewbox_height = 0; + + if (viewbox_width == 0 || viewbox_height == 0) { /* We haven't found a usable set of sizes, so try working out the visible area. */ commit c9186b1b0bfb7662a2765aac5dd1afd4309fdfec Author: Eric Abrahamsen Date: Fri Dec 3 09:19:31 2021 -0800 Use gnus-message instead of plain message in gnus-search bug#51778 * lisp/gnus/gnus-search.el: All messaging should be done via `gnus-message'. diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 3157358804..bce5d57c52 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1018,7 +1018,7 @@ Responsible for handling and, or, and parenthetical expressions.") (single-search (gnus-search-single-p query)) (grouplist (or groups (gnus-search-get-active srv))) q-string artlist group) - (message "Opening server %s" server) + (gnus-message 7 "Opening server %s" server) (gnus-open-server srv) ;; We should only be doing this once, in ;; `nnimap-open-connection', but it's too frustrating to try to @@ -1062,7 +1062,7 @@ Responsible for handling and, or, and parenthetical expressions.") (when (nnimap-change-group (gnus-group-short-name group) server) (with-current-buffer (nnimap-buffer) - (message "Searching %s..." group) + (gnus-message 7 "Searching %s..." group) (let ((result (gnus-search-imap-search-command engine q-string))) (when (car result) @@ -1075,7 +1075,7 @@ Responsible for handling and, or, and parenthetical expressions.") (vector group artn 100)))) (cdr (assoc "SEARCH" (cdr result)))) artlist)))) - (message "Searching %s...done" group)))) + (gnus-message 7 "Searching %s...done" group)))) (nreverse artlist)))) (cl-defmethod gnus-search-imap-search-command ((engine gnus-search-imap) @@ -1330,8 +1330,8 @@ Returns a list of [group article score] vectors." (erase-buffer) (if groups - (message "Doing %s query on %s..." program groups) - (message "Doing %s query..." program)) + (gnus-message 7 "Doing %s query on %s..." program groups) + (gnus-message 7 "Doing %s query..." program)) (setq proc (apply #'start-process (format "search-%s" server) buffer program cp-list)) (while (process-live-p proc) @@ -1837,8 +1837,8 @@ Assume \"size\" key is equal to \"larger\"." (mapcar (lambda (x) (let ((group x) artlist) - (message "Searching %s using find-grep..." - (or group server)) + (gnus-message 7 "Searching %s using find-grep..." + (or group server)) (save-window-excursion (set-buffer buffer) (if (> gnus-verbose 6) @@ -1893,8 +1893,8 @@ Assume \"size\" key is equal to \"larger\"." (vector (gnus-group-full-name group server) art 0) artlist)) (forward-line 1))) - (message "Searching %s using find-grep...done" - (or group server)) + (gnus-message 7 "Searching %s using find-grep...done" + (or group server)) artlist))) grouplist)))) commit d0997eefea7399d196ef7827aa3bbf91f225e162 Author: Tor Kringeland Date: Fri Dec 3 18:09:07 2021 +0100 Add a docstring to `iso-transl-set-language' * lisp/international/iso-transl.el: Document `iso-transl-set-language' (bug#52261). Copyright-paperwork-exempt: yes diff --git a/lisp/international/iso-transl.el b/lisp/international/iso-transl.el index 2d12d01d35..aea1217917 100644 --- a/lisp/international/iso-transl.el +++ b/lisp/international/iso-transl.el @@ -307,6 +307,14 @@ sequence VECTOR. (VECTOR is normally one character long.)") (setq alist (cdr alist)))) (defun iso-transl-set-language (lang) + "Set shorter key bindings for some characters relevant for LANG. +This affects the `C-x 8' prefix. + +Note that only a few languages are supported, and for more +rigorous support it is recommended to use an input method +instead. Also note that many of these characters can be input +with the regular `C-x 8' map without having to specify a language +here." (interactive (list (let ((completion-ignore-case t)) (completing-read "Set which language? " iso-transl-language-alist nil t)))) commit d003f70c6faf3c45fea2b5e58f052dccb7f12f4a Author: Lars Ingebrigtsen Date: Fri Dec 3 17:43:02 2021 +0100 Move 'C-x 8 .' to 'C-x 8 . .' * lisp/international/iso-transl.el (iso-transl-char-map): Move 'C-x 8 .' to 'C-x 8 . .' and add ż. diff --git a/etc/NEWS b/etc/NEWS index 9c64f7dbc8..8dadd3d268 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -75,6 +75,10 @@ time. * Changes in Emacs 29.1 +--- +** 'C-x 8 .' has been moved to 'C-x 8 . .'. +This is to open up the 'C-x 8 .' map to bind further characters there. + --- ** 'write-file' will now copy some file mode bits. If the current buffer is visiting a file that is executable, the diff --git a/lisp/international/iso-transl.el b/lisp/international/iso-transl.el index c59a25efd3..2d12d01d35 100644 --- a/lisp/international/iso-transl.el +++ b/lisp/international/iso-transl.el @@ -117,7 +117,8 @@ ("*-" . [?­]) ("-" . [?­]) ("*." . [?·]) - ("." . [?·]) + (".." . [?·]) + (".z" . [?ż]) ("//" . [?÷]) ("/A" . [?Å]) ("/L" . [?Ł]) commit b56f2737c64c52700f6b0f11e31d24a5ebf0eb3b Author: Tor Kringeland Date: Fri Dec 3 17:40:14 2021 +0100 Add support for some Polish characters with `C-x 8' * lisp/international/iso-transl.el: Add support for some Polish characters (bug#52173). Copyright-paperwork-exempt: yes diff --git a/lisp/international/iso-transl.el b/lisp/international/iso-transl.el index 2c7da2b7cd..c59a25efd3 100644 --- a/lisp/international/iso-transl.el +++ b/lisp/international/iso-transl.el @@ -86,23 +86,33 @@ ("\"y" . [?ÿ]) ("''" . [?´]) ("'A" . [?Á]) + ("'C" . [?Ć]) ("'E" . [?É]) ("'I" . [?Í]) + ("'N" . [?Ń]) ("'O" . [?Ó]) + ("'S" . [?Ś]) ("'U" . [?Ú]) ("'Y" . [?Ý]) + ("'Z" . [?Ź]) ("'a" . [?á]) + ("'c" . [?ć]) ("'e" . [?é]) ("'i" . [?í]) + ("'n" . [?ń]) ("'o" . [?ó]) + ("'s" . [?ś]) ("'u" . [?ú]) ("'y" . [?ý]) + ("'z" . [?ź]) ("*$" . [?¤]) ("$" . [?¤]) ("*+" . [?±]) ("+" . [?±]) (",," . [?¸]) + (",A" . [?Ą]) (",C" . [?Ç]) + (",a" . [?ą]) (",c" . [?ç]) ("*-" . [?­]) ("-" . [?­]) @@ -110,9 +120,11 @@ ("." . [?·]) ("//" . [?÷]) ("/A" . [?Å]) + ("/L" . [?Ł]) ("/E" . [?Æ]) ("/O" . [?Ø]) ("/a" . [?å]) + ("/l" . [?ł]) ("/e" . [?æ]) ("/o" . [?ø]) ("1/2" . [?½]) commit 32a8b3bc22bfc0aeca9943699e7a43b68915122b Author: Katsumi Yamaoka Date: Fri Dec 3 17:28:48 2021 +0100 Fix regression introduced by the previous date-to-time change * lisp/calendar/time-date.el (date-to-time): The function needs to test if `parse-time-string' returns a valid data as the old version did it with the help of `encode-time' (bug#52209). diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index 6407138953..8a6ee0f270 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -158,7 +158,10 @@ If DATE lacks timezone information, GMT is assumed." (encode-time (decoded-time-set-defaults (condition-case err - (parse-time-string date) + (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) commit 85e56d97b717915509cb81c53238fbd06f390b92 Author: Lars Ingebrigtsen Date: Fri Dec 3 17:22:54 2021 +0100 Clarify the run-at-time documentation about "integral multiple" * lisp/emacs-lisp/timer.el (run-at-time): * doc/lispref/os.texi (Timers): Explain what "integral multiple" really means. diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index fb0f25fa3d..e420644cd8 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -2183,7 +2183,13 @@ In most cases, @var{repeat} has no effect on when @emph{first} call takes place---@var{time} alone specifies that. There is one exception: if @var{time} is @code{t}, then the timer runs whenever the time is a multiple of @var{repeat} seconds after the epoch. This is useful for -functions like @code{display-time}. +functions like @code{display-time}. For instance, the following will +make @var{function} run at every ``whole'' minute (e.g., +@samp{11:03:00}, @samp{11:04:00}, etc): + +@example +(run-at-time t 60 @var{function}) +@end example If Emacs didn't get any CPU time when the timer would have run (for example if the system was busy running another process or if the diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index 1ef4931b7b..2ac2c99245 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -351,19 +351,27 @@ This function is called, by name, directly by the C code." Repeat the action every REPEAT seconds, if REPEAT is non-nil. REPEAT may be an integer or floating point number. TIME should be one of: + - a string giving today's time like \"11:23pm\" (the acceptable formats are HHMM, H:MM, HH:MM, HHam, HHAM, HHpm, HHPM, HH:MMam, HH:MMAM, HH:MMpm, or HH:MMPM; a period `.' can be used instead of a colon `:' to separate the hour and minute parts); + - a string giving a relative time like \"90\" or \"2 hours 35 minutes\" (the acceptable forms are a number of seconds without units or some combination of values using units in `timer-duration-words'); + - nil, meaning now; + - a number of seconds from now; + - a value from `encode-time'; -- or t (with non-nil REPEAT) meaning the next integral - multiple of REPEAT. + +- or t (with non-nil REPEAT) meaning the next integral multiple + of REPEAT. This is handy when you want the function to run at + a certain \"round\" number. For instance, (run-at-time t 60 ...) + will run at 11:04:00, 11:05:00, etc. The action is to call FUNCTION with arguments ARGS. commit 4a303c4dcac590c65c5a4826682c68a4023085b1 Author: Jim Porter Date: Fri Dec 3 17:10:10 2021 +0100 Remove separators at the beginning and end of the context menu * lisp/mouse.el (context-menu-map): Remove beginning/end seperators (bug#52237). diff --git a/lisp/mouse.el b/lisp/mouse.el index ec43aecdd0..b5ca80a446 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -327,12 +327,21 @@ the function `context-menu-filter-function'." (setq menu (funcall fun menu click)) nil))) - ;; Remove duplicate separators - (let ((l menu)) - (while (consp l) - (if (and (equal (cdr-safe (car l)) menu-bar-separator) - (equal (cdr-safe (cadr l)) menu-bar-separator)) + ;; Remove duplicate separators as well as ones at the beginning or + ;; end of the menu. + (let ((l menu) saw-first-item) + (while (consp (cdr l)) + ;; If the next item is a separator, remove it if 1) we haven't + ;; seen any other items yet, or 2) it's followed by either + ;; another separator or the end of the list. + (if (and (equal (cdr-safe (cadr l)) menu-bar-separator) + (or (not saw-first-item) + (null (caddr l)) + (equal (cdr-safe (caddr l)) menu-bar-separator))) (setcdr l (cddr l)) + ;; The "first item" is any cons cell; this excludes the + ;; `keymap' symbol and the menu name. + (when (consp (cadr l)) (setq saw-first-item t)) (setq l (cdr l))))) (when (functionp context-menu-filter-function) commit 52b2ffd83b95c2bd974f23f71860a5ea123e3b02 Author: Lars Ingebrigtsen Date: Fri Dec 3 17:01:30 2021 +0100 Improve how dired-mark-sexp interprets file sizes in non-C locales * lisp/dired-x.el (dired-x--string-to-number): Try to understand localised numbers (with "." separators or the like) (bug#23373). diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 855e58e16c..38d8a954a8 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -1265,13 +1265,21 @@ sure that a trailing letter in STR is one of BKkMGTPEZY." (let* ((val (string-to-number str)) (u (unless (zerop val) (aref str (1- (length str)))))) - (when (and u (> u ?9)) - (when (= u ?k) - (setq u ?K)) - (let ((units '(?B ?K ?M ?G ?T ?P ?E ?Z ?Y))) - (while (and units (/= (pop units) u)) - (setq val (* 1024.0 val))))) - val)) + ;; If we don't have a unit at the end, but we have some + ;; non-numeric strings in the string, then the string may be + ;; something like "4.134" or "4,134" meant to represent 4134 + ;; (seen in some locales). + (if (and u + (<= ?0 u ?9) + (string-match-p "[^0-9]" str)) + (string-to-number (replace-regexp-in-string "[^0-9]+" "" str)) + (when (and u (> u ?9)) + (when (= u ?k) + (setq u ?K)) + (let ((units '(?B ?K ?M ?G ?T ?P ?E ?Z ?Y))) + (while (and units (/= (pop units) u)) + (setq val (* 1024.0 val))))) + val))) (defun dired-mark-sexp (predicate &optional unflag-p) "Mark files for which PREDICATE returns non-nil. diff --git a/test/lisp/dired-x-tests.el b/test/lisp/dired-x-tests.el index fe4b9711d4..c6ac7c602e 100644 --- a/test/lisp/dired-x-tests.el +++ b/test/lisp/dired-x-tests.el @@ -60,5 +60,12 @@ (should (equal (dired-guess-default '("/tmp/foo.png" "/tmp/foo.txt")) nil)))) +(ert-deftest dired-x--string-to-number () + (should (= (dired-x--string-to-number "2.4K") 2457.6)) + (should (= (dired-x--string-to-number "2400") 2400)) + (should (= (dired-x--string-to-number "123.4M") 129394278.4)) + (should (= (dired-x--string-to-number "123.40000M") 129394278.4)) + (should (= (dired-x--string-to-number "4.134") 4134))) + (provide 'dired-x-tests) ;;; dired-x-tests.el ends here commit 20124d78e7b5a063a37eeecce06f4d42f0cf08ed Author: Stefan Kangas Date: Fri Dec 3 17:18:33 2021 +0100 ; Minor cleanup in re-builder after my last commit * lisp/emacs-lisp/re-builder.el (reb-lisp-mode, reb-cook-regexp): Very minor cleanup (by popular demand). diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index 8a87b5be27..9be6ac649f 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -274,8 +274,8 @@ Except for Lisp syntax this is the same as `reb-regexp'.") emacs-lisp-mode "RE Builder Lisp" "Major mode for interactively building symbolic Regular Expressions." ;; Pull in packages as needed - (cond ((eq reb-re-syntax 'rx) ; rx-to-string is autoloaded - (require 'rx))) ; require rx anyway + (when (eq reb-re-syntax 'rx) ; rx-to-string is autoloaded + (require 'rx)) ; require rx anyway (reb-mode-common)) (defvar reb-subexp-mode-map @@ -606,9 +606,9 @@ optional fourth argument FORCE is non-nil." (defun reb-cook-regexp (re) "Return RE after processing it according to `reb-re-syntax'." - (cond ((eq reb-re-syntax 'rx) - (rx-to-string (eval (car (read-from-string re))))) - (t re))) + (if (eq reb-re-syntax 'rx) + (rx-to-string (eval (car (read-from-string re)))) + re)) (defun reb-update-regexp () "Update the regexp for the target buffer. commit ddc875d9f75bdd1d5dda6a721489f43317b0f8b5 Author: Stefan Kangas Date: Fri Dec 3 16:55:27 2021 +0100 emacs-lisp-mode: Use error face for "/d" indicator * lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Use 'error' face for the dynamic scoping ("/d") indicator in the mode line to make it stand out more. diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 7da93a351a..167f8a1b18 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -283,7 +283,7 @@ Comments in the form will be lost." (:propertize "/d" help-echo "Using old dynamic scoping mode\n\ mouse-1: Enable lexical-binding mode" - face warning + face error mouse-face mode-line-highlight local-map ,elisp--dynlex-modeline-map))) "Major mode for editing Lisp code to run in Emacs. commit 430622796b7ed22492b6df509a56b5fc174e118b Author: Stefan Kangas Date: Fri Dec 3 16:42:24 2021 +0100 Don't support obsolete sregex syntax in re-builder * lisp/emacs-lisp/re-builder.el (reb-lisp-mode) (reb-lisp-syntax-p, reb-change-syntax, reb-cook-regexp): Remove final remaining references to the long obsolete sregex syntax. diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index 5516b2a81f..8a87b5be27 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -274,8 +274,8 @@ Except for Lisp syntax this is the same as `reb-regexp'.") emacs-lisp-mode "RE Builder Lisp" "Major mode for interactively building symbolic Regular Expressions." ;; Pull in packages as needed - (cond ((memq reb-re-syntax '(sregex rx)) ; rx-to-string is autoloaded - (require 'rx))) ; require rx anyway + (cond ((eq reb-re-syntax 'rx) ; rx-to-string is autoloaded + (require 'rx))) ; require rx anyway (reb-mode-common)) (defvar reb-subexp-mode-map @@ -307,8 +307,8 @@ Except for Lisp syntax this is the same as `reb-regexp'.") (eq 'color (frame-parameter nil 'display-type))) (defsubst reb-lisp-syntax-p () - "Return non-nil if RE Builder uses a Lisp syntax." - (memq reb-re-syntax '(sregex rx))) + "Return non-nil if RE Builder uses `rx' syntax." + (eq reb-re-syntax 'rx)) (defmacro reb-target-binding (symbol) "Return binding for SYMBOL in the RE Builder target buffer." @@ -483,11 +483,11 @@ Optional argument SYNTAX must be specified if called non-interactively." (list (intern (completing-read (format-prompt "Select syntax" reb-re-syntax) - '(read string sregex rx) + '(read string rx) nil t nil nil (symbol-name reb-re-syntax) 'reb-change-syntax-hist)))) - (if (memq syntax '(read string sregex rx)) + (if (memq syntax '(read string rx)) (let ((buffer (get-buffer reb-buffer))) (setq reb-re-syntax syntax) (when buffer @@ -606,7 +606,7 @@ optional fourth argument FORCE is non-nil." (defun reb-cook-regexp (re) "Return RE after processing it according to `reb-re-syntax'." - (cond ((memq reb-re-syntax '(sregex rx)) + (cond ((eq reb-re-syntax 'rx) (rx-to-string (eval (car (read-from-string re))))) (t re))) commit 7282e492d5c3ed8c856d92a121d143f6a70db244 Author: Stefan Kangas Date: Fri Dec 3 16:25:17 2021 +0100 * doc/misc/efaq.texi (New in Emacs 28): New node. diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index e7ce7c1c95..40d8e9e066 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -849,6 +849,7 @@ in the Emacs development repository (@pxref{Latest version of Emacs}). @menu * Origin of the term Emacs:: * Latest version of Emacs:: +* New in Emacs 28:: * New in Emacs 27:: * New in Emacs 26:: * New in Emacs 25:: @@ -919,6 +920,50 @@ Emacs, type @kbd{C-h C-n} (@kbd{M-x view-emacs-news}). You can give this command a prefix argument to read about which features were new in older versions. +@node New in Emacs 28 +@section What is different about Emacs 28? +@cindex Differences between Emacs 27 and Emacs 28 +@cindex Emacs 28, new features in + +Emacs 28 has too many new features and changes to list all of them +here. We list below a small selection; consult the Emacs @file{NEWS} +file (@kbd{C-h n}) for the full list of changes in Emacs 28. + +@itemize +@cindex native compilation of Lisp files +@item +Emacs now optionally supports native compilation of Lisp files. This +can improves performance significantly in some cases. To enable this, +configure Emacs with the '--with-native-compilation' option. + +@item +The new NonGNU ELPA archive is enabled by default alongside GNU ELPA. +Thus, packages on NonGNU ELPA will appear by default in the list shown +by the @code{list-packages} command. + +@item +The Cairo graphics library is now used by default if present. + +@item +The new themes @samp{modus-vivendi} and @samp{modus-operandi} have +been added. They are designed to conform with the highest standard +for color-contrast accessibility (WCAG AAA). + +@item +On capable systems, Emacs now correctly displays Emoji and Emoji +sequences by default, provided that a suitable font is available. + +@item +New system for displaying documentation for groups of functions +(@kbd{M-x shortdoc-display-group RET}). + +@item +Among the many internal changes in this release, we would like to +highlight that all files in the tree now use @code{lexical-binding}. + +@end itemize + + @node New in Emacs 27 @section What is different about Emacs 27? @cindex Differences between Emacs 26 and Emacs 27 @@ -973,8 +1018,8 @@ Built-in support for tabs (tab bar and tab line). Support for resizing and rotating of images without ImageMagick. @end itemize -Consult the Emacs @file{NEWS} file (@kbd{C-h n}) for the full list of -changes in Emacs 27. +Consult the Emacs @file{NEWS.27} file for the full list of changes in +Emacs 27. @node New in Emacs 26 @section What is different about Emacs 26? commit eafcccd38f12603f36c686e32f61c56f847f0bb8 Author: Stefan Kangas Date: Fri Dec 3 15:57:56 2021 +0100 ; FAQ: Normalize references to the NEWS.NN file * doc/misc/efaq.texi (New in Emacs 26, New in Emacs 25) (New in Emacs 24, New in Emacs 23, New in Emacs 22) (New in Emacs 21, New in Emacs 20): Normalize the format for referring to the NEWS.NN file. diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index 44f9c15540..e7ce7c1c95 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -1052,8 +1052,8 @@ Emacs 26.2 comes with data files imported from the latest Unicode Standard version 11.0.0. @end itemize -Consult the Emacs @file{NEWS} file (@kbd{C-h n}) for the full list of -changes in Emacs 26. +Consult the Emacs @file{NEWS.26} file for the full list of changes in +Emacs 26. @node New in Emacs 25 @section What is different about Emacs 25? @@ -1152,8 +1152,8 @@ provide toolkit scroll bars, namely Gtk+, Lucid, Motif and Windows. @end itemize -Consult the Emacs @file{NEWS} file (@kbd{C-h n}) for the full list of -changes in Emacs 25. +Consult the Emacs @file{NEWS.25} file for the full list of changes in +Emacs 25. @node New in Emacs 24 @section What is different about Emacs 24? @@ -1226,7 +1226,8 @@ Much more flexibility in the handling of windows and buffer display. @end itemize -As always, consult the @file{NEWS} file for more information. +Consult the Emacs @file{NEWS.24} file for the full list of changes in +Emacs 24. @node New in Emacs 23 @@ -1285,6 +1286,9 @@ new Visual Line mode for line-motion; improved completion; a new mode mode (for editing XML documents) is included; VC has been updated for newer version control systems; etc. +Consult the Emacs @file{NEWS.23} file for the full list of changes in +Emacs 23. + @node New in Emacs 22 @section What is different about Emacs 22? @@ -1381,6 +1385,9 @@ In addition, Emacs 22 now includes the Emacs Lisp Reference Manual (@pxref{Emacs Lisp documentation}) and the Emacs Lisp Intro. @end itemize +Consult the Emacs @file{NEWS.22} file for the full list of changes in +Emacs 22. + @node New in Emacs 21 @section What is different about Emacs 21? @@ -1403,6 +1410,9 @@ In addition, Emacs 21 supports faces on text-only terminals. This means that you can now have colors when you run Emacs on a GNU/Linux console and on @code{xterm} with @kbd{emacs -nw}. +Consult the Emacs @file{NEWS.21} file for the full list of changes in +Emacs 21. + @node New in Emacs 20 @section What is different about Emacs 20? @@ -1420,6 +1430,10 @@ several languages in the same document; the ``Customize'' facility for modifying variables without having to use Lisp; and automatic conversion of files from Macintosh, Microsoft, and Unix platforms. +Consult the Emacs @file{NEWS.20} file for the full list of changes in +Emacs 20. + + @node What was XEmacs? @section What was XEmacs? @cindex XEmacs commit c006c490eb583d6204ddb75678c76780746d8405 Author: Stefan Kangas Date: Fri Dec 3 15:52:02 2021 +0100 ; * doc/misc/efaq.texi (Latest version of Emacs): Update version. diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index cdb6f9b584..44f9c15540 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -898,9 +898,9 @@ conventions}). @cindex Repository, Emacs Emacs @value{EMACSVER} is the current version as of this writing. A version -number with two components (e.g., @samp{24.5}) indicates a released +number with two components (e.g., @samp{28.1}) indicates a released version; three components indicate a development -version (e.g., @samp{28.0.50} is what will eventually become @samp{28.1}). +version (e.g., @samp{29.0.50} is what will eventually become @samp{29.1}). Emacs is under active development, hosted at @uref{https://savannah.gnu.org/projects/emacs/, Savannah}. commit 8090ef48c9049049a70c7b895699b2b16c19e678 Author: Lars Ingebrigtsen Date: Fri Dec 3 16:28:29 2021 +0100 Fix typo in NEWS about 'write-file' diff --git a/etc/NEWS b/etc/NEWS index c55b74f1e1..9c64f7dbc8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -78,7 +78,7 @@ time. --- ** 'write-file' will now copy some file mode bits. If the current buffer is visiting a file that is executable, the -'C-c C-w' command will now make the new file executable, too. +'C-x C-w' command will now make the new file executable, too. +++ ** New user option 'process-error-pause-time'. commit 2bd1b1ace8281c92d74e9eb14dc39210517949fa Author: Michael Albinus Date: Fri Dec 3 15:50:09 2021 +0100 Fix dired--insert-disk-space * lisp/dired.el (dired--insert-disk-space): Handle case `get-free-disk-space' returns nil. diff --git a/lisp/dired.el b/lisp/dired.el index d03c79df40..d0e547ba0b 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1650,7 +1650,7 @@ see `dired-use-ls-dired' for more details.") ;; Replace "total" with "total used in directory" to ;; avoid confusion. (replace-match "total used in directory" nil nil nil 1)) - (when-let ((available (get-free-disk-space file))) + (if-let ((available (get-free-disk-space file))) (cond ((eq dired-free-space 'separate) (end-of-line) @@ -1672,7 +1672,8 @@ see `dired-use-ls-dired' for more details.") (forward-line 1) (point)) (t - beg)))))) + beg)) + beg)))) (defun dired-insert-set-properties (beg end) "Add various text properties to the lines in the region, from BEG to END." commit 756c2099bf4af5bd1df3a348aa3743a38905ce10 Author: Stefan Kangas Date: Fri Dec 3 15:19:26 2021 +0100 * lisp/image.el (image): Add :prefix and :link. diff --git a/lisp/image.el b/lisp/image.el index edbf6c54df..87fab80aad 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -27,6 +27,8 @@ (defgroup image () "Image support." + :prefix "image-" + :link '(info-link "(emacs) Image Mode") :group 'multimedia) (declare-function image-flush "image.c" (spec &optional frame)) commit 8fda6770afcd0d340cd5dc3d34697e454a7a3809 Author: Stefan Kangas Date: Fri Dec 3 15:13:32 2021 +0100 image-mode: Advertize viewing as text less eagerly * lisp/image-mode.el (image-text-based-formats): New defcustom. (image-mode--setup-mode): Don't show message to show image as text unless it is a text based image format. Don't mention key binding for editing as hex. (Bug#51961) (image-mode-as-text): Don't mention key binding for editing as hex. (image-mode-as-hex): Minor cleanup. diff --git a/etc/NEWS b/etc/NEWS index 227409db25..c55b74f1e1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -522,6 +522,12 @@ This works like 'image-transform-fit-to-window'. The new 'fit-window' option will never scale an image more than this much (in percent). It is nil by default, which means no limit. +--- +*** New user option 'image-text-based-formats'. +This controls whether or not to show a message when opening certain +image formats saying how to edit it as text. The default is to show +this message for SVG and XPM. + ** Image-Dired +++ diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 4ee02c0675..c2b145d1a2 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -457,6 +457,15 @@ call." ;;; Image Mode setup +(defcustom image-text-based-formats '(svg xpm) + "List of image formats that use a plain text format. +For such formats, display a message that explains how to edit the +image as text, when opening such images in `image-mode'." + :type '(choice (const :tag "Disable completely" nil) + (repeat :tag "List of formats" sexp)) + :version "29.1" + :group 'image) + (defvar-local image-type nil "The image type for the current Image mode buffer.") @@ -695,12 +704,10 @@ Key bindings: (run-mode-hooks 'image-mode-hook) (let ((image (image-get-display-property)) - (msg1 (substitute-command-keys - "Type \\[image-toggle-display] or \\[image-toggle-hex-display] to view the image as ")) - animated) + msg animated) (cond ((null image) - (message "%s" (concat msg1 "an image."))) + (setq msg "an image")) ((setq animated (image-multi-frame-p image)) (setq image-multi-frame t mode-line-process @@ -718,10 +725,13 @@ Key bindings: keymap (down-mouse-1 . image-next-frame) (down-mouse-3 . image-previous-frame))))))) - (message "%s" - (concat msg1 "text. This image has multiple frames."))) + (setq msg "text. This image has multiple frames")) (t - (message "%s" (concat msg1 "text or hex.")))))) + (setq msg "text"))) + (when (memq (plist-get (cdr image) :type) image-text-based-formats) + (message (substitute-command-keys + "Type \\[image-toggle-display] to view the image as %s") + msg)))) ;;;###autoload (define-minor-mode image-minor-mode @@ -768,11 +778,11 @@ on these modes." (image-mode-to-text) ;; Turn on hexl-mode (hexl-mode) - (message "%s" (concat - (substitute-command-keys - "Type \\[image-toggle-hex-display] or \\[image-toggle-display] to view the image as ") - (if (image-get-display-property) - "hex" "an image or text") "."))) + (message (substitute-command-keys + "Type \\[image-toggle-hex-display] or \ +\\[image-toggle-display] to view the image as %s") + (if (image-get-display-property) + "hex" "an image or text"))) (defun image-mode-as-text () "Set a non-image mode as major mode in combination with image minor mode. @@ -788,11 +798,10 @@ See commands `image-mode' and `image-minor-mode' for more information on these modes." (interactive) (image-mode-to-text) - (message "%s" (concat - (substitute-command-keys - "Type \\[image-toggle-display] or \\[image-toggle-hex-display] to view the image as ") - (if (image-get-display-property) - "text" "an image or hex") "."))) + (message (substitute-command-keys + "Type \\[image-toggle-display] to view the image as %s") + (if (image-get-display-property) + "text" "an image"))) (defun image-toggle-display-text () "Show the image file as text. commit 9db76af76c2e98d983544aaf52a9fe23bba1fa15 Author: Stefan Kangas Date: Fri Dec 3 14:34:19 2021 +0100 ; * lisp/image-mode.el (image-mode): Minor doc fix. diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 624c852cb8..4ee02c0675 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -621,8 +621,9 @@ call." ;;;###autoload (defun image-mode () "Major mode for image files. -You can use \\\\[image-toggle-display] or \\\\[image-toggle-hex-display] -to toggle between display as an image and display as text or hex. +You can use \\\\[image-toggle-display] or \ +\\[image-toggle-hex-display] to toggle between display +as an image and display as text or hex. Key bindings: \\{image-mode-map}" commit e3a10c8cd90330736432f95858f1a85a65e8afbf Author: Stefan Monnier Date: Fri Dec 3 09:07:37 2021 -0500 * lisp/emacs-lisp/cl-macs.el (natnum): Fix typo diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 0da759a0f1..f78fdcf008 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -3365,7 +3365,7 @@ Of course, we really can't know that for sure, so it's just a heuristic." (integer . integerp) (keyword . keywordp) (list . listp) - (natum . natnump) + (natnum . natnump) (number . numberp) (null . null) (real . numberp) commit 5869bf55b2326f517394d8911de1837b61a15e58 Author: Stefan Monnier Date: Fri Dec 3 08:56:52 2021 -0500 * lisp/emacs-lisp/cl-macs.el (natnum): Define it as a type diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 9c9a778f04..0da759a0f1 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -3365,6 +3365,7 @@ Of course, we really can't know that for sure, so it's just a heuristic." (integer . integerp) (keyword . keywordp) (list . listp) + (natum . natnump) (number . numberp) (null . null) (real . numberp) commit d3eb3918d4989408ae8b71d39c24924f2f2343c7 Merge: 7609924011 1431fce67f Author: Michael Albinus Date: Fri Dec 3 14:24:49 2021 +0100 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs commit 76099240119d0137f25b356d64e2c1b70201973e Author: Michael Albinus Date: Fri Dec 3 14:24:43 2021 +0100 Adapt directory summary line handling in Tramp * lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory): * lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory): Do not add or modify summary line when `dired-free-space' is bound. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index b83569f3de..780c3b3941 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2678,15 +2678,17 @@ 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. - (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. 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))))) (prog1 (goto-char end-marker) (set-marker beg-marker nil) diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 24119539db..0a7d1efc8b 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -1120,12 +1120,14 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (setcar x (concat (car x) "*")))))) entries)) - ;; 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)))) + ;; 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))))) ;; Print entries. (mapc commit 9fbc4fa0e73f41a851da70b6249f3cc891bab9a1 Author: Michael Albinus Date: Fri Dec 3 13:51:19 2021 +0100 Add Tramp version integrated in Emacs 28.1 * lisp/net/trampver.el (customize-package-emacs-version-alist): Add Tramp version integrated in Emacs 28.1. diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index e2a80f5c69..680bcf0931 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -101,7 +101,8 @@ ("2.2.13.25.2" . "25.3") ("2.3.3" . "26.1") ("2.3.3.26.1" . "26.1") ("2.3.5.26.2" . "26.2") ("2.3.5.26.3" . "26.3") - ("2.4.3.27.1" . "27.1") ("2.4.5.27.2" . "27.2"))) + ("2.4.3.27.1" . "27.1") ("2.4.5.27.2" . "27.2") + ("2.5.2.28.1" . "28.1"))) (add-hook 'tramp-unload-hook (lambda () commit 1dfcac6e10a7d0f72f10943ad4bededd35502506 Author: Michael Albinus Date: Fri Dec 3 13:43:46 2021 +0100 Update Tramp version (don't merge with master) * doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.5.2.28.1". diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi index b11ee39f88..e9fbacc792 100644 --- a/doc/misc/trampver.texi +++ b/doc/misc/trampver.texi @@ -8,7 +8,7 @@ @c In the Tramp GIT, the version numbers are auto-frobbed from @c tramp.el, and the bug report address is auto-frobbed from @c configure.ac. -@set trampver 2.5.2-pre +@set trampver 2.5.2.28.1 @set trampurl https://www.gnu.org/software/tramp/ @set tramp-bug-report-address tramp-devel@@gnu.org @set emacsver 25.1 diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 8baf0780c2..e2a80f5c69 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -7,7 +7,7 @@ ;; Maintainer: Michael Albinus ;; Keywords: comm, processes ;; Package: tramp -;; Version: 2.5.2-pre +;; Version: 2.5.2.28.1 ;; Package-Requires: ((emacs "25.1")) ;; Package-Type: multi ;; URL: https://www.gnu.org/software/tramp/ @@ -40,7 +40,7 @@ ;; ./configure" to change them. ;;;###tramp-autoload -(defconst tramp-version "2.5.2-pre" +(defconst tramp-version "2.5.2.28.1" "This version of Tramp.") ;;;###tramp-autoload @@ -76,7 +76,7 @@ ;; Check for Emacs version. (let ((x (if (not (string-lessp emacs-version "25.1")) "ok" - (format "Tramp 2.5.2-pre is not fit for %s" + (format "Tramp 2.5.2.28.1 is not fit for %s" (replace-regexp-in-string "\n" "" (emacs-version)))))) (unless (string-equal "ok" x) (error "%s" x))) commit 5d6f82879979ee02a848bcb31b9f24a8853550e8 Author: Philipp Stephani Date: Fri Dec 3 09:40:15 2021 +0100 Unbreak build after 9c222b9c1a7f91497a37567b4d7de3a511fff069. * src/pdumper.c (dump_subr): Fix Lisp_Subr hash value. diff --git a/src/pdumper.c b/src/pdumper.c index a655759903..98c760162e 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2853,7 +2853,7 @@ dump_bool_vector (struct dump_context *ctx, const struct Lisp_Vector *v) static dump_off dump_subr (struct dump_context *ctx, const struct Lisp_Subr *subr) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_Subr_AA236F7759) +#if CHECK_STRUCTS && !defined (HASH_Lisp_Subr_F09D8E8E19) # error "Lisp_Subr changed. See CHECK_STRUCTS comment in config.h." #endif struct Lisp_Subr out;