Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk

This commit is contained in:
Yuuki Harano 2021-12-04 16:06:16 +09:00
commit d44d6ae016
41 changed files with 465 additions and 354 deletions

View file

@ -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")

View file

@ -5500,6 +5500,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

View file

@ -1707,7 +1707,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.
@ -1723,10 +1722,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

View file

@ -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

View file

@ -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::
@ -898,9 +899,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}.
@ -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?
@ -1052,8 +1097,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 +1197,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 +1271,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 +1331,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 +1430,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 +1455,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 +1475,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

View file

@ -285,7 +285,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.

View file

@ -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

View file

@ -72,13 +72,29 @@ This is run at the end of the Emacs startup process, and it meant to
be used to reinitialize structures that would normally be done at load
time.
* 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
'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'.
@ -97,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
@ -522,6 +529,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
+++
@ -757,6 +770,12 @@ 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 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

View file

@ -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:

View file

@ -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)

View file

@ -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.

View file

@ -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."

View file

@ -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)
(natnum . natnump)
(number . numberp)
(null . null)
(real . numberp)

View file

@ -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
(when (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,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 ((memq reb-re-syntax '(sregex 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.

View file

@ -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)

View file

@ -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.

View file

@ -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.

View file

@ -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)))))

View file

@ -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))))

View file

@ -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.")
@ -621,8 +630,9 @@ call."
;;;###autoload
(defun image-mode ()
"Major mode for image files.
You can use \\<image-mode-map>\\[image-toggle-display] or \\<image-mode-map>\\[image-toggle-hex-display]
to toggle between display as an image and display as text or hex.
You can use \\<image-mode-map>\\[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}"
@ -694,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
@ -717,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
@ -767,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.
@ -787,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.

View file

@ -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))

View file

@ -86,33 +86,46 @@
("\"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" . [])
("*-" . [?­])
("-" . [?­])
("*." . [])
("." . [])
(".." . [])
(".z" . [])
("//" . [])
("/A" . [])
("/L" . [])
("/E" . [])
("/O" . [])
("/a" . [])
("/l" . [])
("/e" . [])
("/o" . [])
("1/2" . [])
@ -294,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))))

View file

@ -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.")

View file

@ -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)))

View file

@ -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)

View file

@ -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)

View file

@ -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."

View file

@ -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)

View file

@ -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

View file

@ -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 ()

View file

@ -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

View file

@ -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))))

View file

@ -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."
@ -437,11 +434,28 @@ 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-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)
(frame-char-height))))
(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)))
@ -486,10 +500,25 @@ 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)))))))
(defun pixel-scroll-precision-scroll-up (delta)
"Scroll the current window up by DELTA pixels."
(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)))
(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.
@ -500,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))

View file

@ -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)

View file

@ -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;

View file

@ -31,6 +31,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include <setjmp.h>
#include <math.h>
#include <stdint.h>
#include <c-ctype.h>
#include <flexmember.h>
@ -2138,14 +2139,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;
}
@ -2166,84 +2169,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;
@ -10211,6 +10207,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 *,
@ -10274,6 +10274,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);
@ -10317,6 +10320,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
@ -10352,6 +10358,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
@ -10589,50 +10599,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;
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
/* 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);
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 = svg_css_length_to_pixels (iwidth, dpi, img->face_font_size)
* 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;
}
else if (has_viewbox)
{
viewbox_width = viewbox.width;
viewbox_height = viewbox.height;
viewbox_width = gviewbox_width;
viewbox_height = gviewbox_height;
}
else
{
/* 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. */
@ -10645,8 +10676,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))
{

View file

@ -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,

View file

@ -2854,7 +2854,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;

View file

@ -28817,21 +28817,6 @@ normal_char_height (struct font *font, int c)
return ascent + descent;
}
/* Return the "standard" pixel width of a character from FACE's font,
if the font is fixed-pitch, zero otherwise. */
static int
get_normal_width (struct face *face)
{
struct font *ascii_font = face->ascii_face->font;
/* Heuristics: fixed-pitch fonts have the value of MAX-WIDTH not
much larger than AVERAGE-WIDTH. */
bool fixed_pitch =
ascii_font->average_width == ascii_font->space_width
&& ascii_font->average_width != 0
&& ascii_font->max_width < 3 * ascii_font->average_width;
return fixed_pitch ? ascii_font->space_width : 0;
}
/* EXPORT for RIF:
Set *LEFT and *RIGHT to the left and right overhang of GLYPH on
frame F. Overhangs of glyphs other than type CHAR_GLYPH are
@ -30929,17 +30914,6 @@ gui_produce_glyphs (struct it *it)
it->phys_ascent = pcm->ascent + boff;
it->phys_descent = pcm->descent - boff;
it->pixel_width = pcm->width;
if (align_columns_display)
{
int unit_width = get_normal_width (face);
if (unit_width > 0)
{
int ncolumns =
(it->pixel_width - 1 + unit_width) / unit_width;
it->pixel_width = ncolumns * unit_width;
}
}
/* Don't use font-global values for ascent and descent
if they result in an exceedingly large line height. */
if (it->override_ascent < 0)
@ -31517,17 +31491,6 @@ gui_produce_glyphs (struct it *it)
it->glyph_row->contains_overlapping_glyphs_p = true;
it->pixel_width = cmp->pixel_width;
if (align_columns_display)
{
int unit_width = get_normal_width (face);
if (unit_width > 0)
{
int ncolumns =
(it->pixel_width - 1 + unit_width) / unit_width;
it->pixel_width = ncolumns * unit_width;
}
}
it->ascent = it->phys_ascent = cmp->ascent;
it->descent = it->phys_descent = cmp->descent;
IT_APPLY_FACE_BOX(it, face);
@ -31573,17 +31536,6 @@ gui_produce_glyphs (struct it *it)
it->glyph_row->contains_overlapping_glyphs_p = true;
it->ascent = it->phys_ascent = metrics.ascent;
it->descent = it->phys_descent = metrics.descent;
if (align_columns_display)
{
int unit_width = get_normal_width (face);
if (unit_width > 0)
{
int ncolumns =
(it->pixel_width - 1 + unit_width) / unit_width;
it->pixel_width = ncolumns * unit_width;
}
}
}
IT_APPLY_FACE_BOX(it, face);
@ -35660,15 +35612,6 @@ variable are ignored and the default 0.25 is used instead. */);
Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI). */);
Vdisplay_pixels_per_inch = make_float (72.0);
DEFVAR_BOOL ("align-columns-display", align_columns_display,
doc: /* Whether to align columns on GUI frames.
If this is non-nil characters displayed on GUI frames will be
aligned to produce straight columns. This is achieved by
enlarging the pixel width of characters to an integral
multiple of pixels taken by ASCII characters of the same face.
This affects only fixed-pitch fonts. */);
align_columns_display = false;
#ifdef GLYPH_DEBUG
DEFVAR_INT ("debug-end-pos", debug_end_pos, doc: /* Don't ask. */);
#endif

View file

@ -1102,6 +1102,9 @@ xwidget_scroll (struct xwidget_view *view, double x, double y,
xg_event->scroll.delta_y = dy;
xg_event->scroll.device = find_suitable_pointer (view->frame);
if (!(fabs (dx) > 0) || !(fabs (dy) > 0))
xg_event->scroll.is_stop = TRUE;
g_object_ref (xg_event->any.window);
gtk_main_do_event (xg_event);

View file

@ -60,5 +60,15 @@
(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))
(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