Merge branch 'emacs-26' into scratch/org-mode-merge

This commit is contained in:
Rasmus 2017-09-29 10:41:51 +02:00
commit d4b2bbdc73
114 changed files with 3758 additions and 2259 deletions

View file

@ -4808,7 +4808,7 @@
Link from (emacs)Exiting to (lisp)Killing Emacs Link from (emacs)Exiting to (lisp)Killing Emacs
* doc/emacs/entering.texi (Exiting): Link to the lispref * doc/emacs/entering.texi (Exiting): Link to the lispref
manual for further customisations (bug#15445). manual for further customizations (bug#15445).
(cherry picked from commit bc5f27aa099cdde02ca66e71501b89300685ab28) (cherry picked from commit bc5f27aa099cdde02ca66e71501b89300685ab28)
@ -7845,7 +7845,7 @@
2016-02-20 Lars Ingebrigtsen <larsi@gnus.org> 2016-02-20 Lars Ingebrigtsen <larsi@gnus.org>
Allow customising the article mode cursor behavior Allow customizing the article mode cursor behavior
* doc/misc/gnus.texi (HTML): Mention gnus-article-show-cursor. * doc/misc/gnus.texi (HTML): Mention gnus-article-show-cursor.

View file

@ -12949,7 +12949,7 @@
Link from (emacs)Exiting to (lisp)Killing Emacs Link from (emacs)Exiting to (lisp)Killing Emacs
* doc/emacs/entering.texi (Exiting): Link to the lispref * doc/emacs/entering.texi (Exiting): Link to the lispref
manual for further customisations (bug#15445). manual for further customizations (bug#15445).
2016-04-29 Lars Ingebrigtsen <larsi@gnus.org> 2016-04-29 Lars Ingebrigtsen <larsi@gnus.org>
@ -13159,7 +13159,7 @@
Move the diff command to "Operate" in ibuffer Move the diff command to "Operate" in ibuffer
* lisp/ibuffer.el (ibuffer-mode-operate-map): Move the diff * lisp/ibuffer.el (ibuffer-mode-operate-map): Move the diff
command to the "Operate" menu, and remove the customisation command to the "Operate" menu, and remove the customization
entry to make the "View" menu more logical (bug#1150). entry to make the "View" menu more logical (bug#1150).
2016-04-27 Lars Ingebrigtsen <larsi@gnus.org> 2016-04-27 Lars Ingebrigtsen <larsi@gnus.org>
@ -16589,7 +16589,7 @@
really changed. really changed.
(save_window_save): Set the pixel_height_before_size_change and (save_window_save): Set the pixel_height_before_size_change and
pixel_width_before_size_change fields. pixel_width_before_size_change fields.
(Vwindow_size_change_functions): Move here definiton from xdisp.c. (Vwindow_size_change_functions): Move here definition from xdisp.c.
* src/xdisp.c (prepare_menu_bars, redisplay_internal): Call * src/xdisp.c (prepare_menu_bars, redisplay_internal): Call
run_window_size_change_functions. run_window_size_change_functions.
(Vwindow_size_change_functions): Move definition to window.c. (Vwindow_size_change_functions): Move definition to window.c.
@ -16842,7 +16842,7 @@
5d17ae7 Improve file-notify-test08-watched-file-in-watched-dir 5d17ae7 Improve file-notify-test08-watched-file-in-watched-dir
1cb1268 Fix todo-mode item date editing bugs 1cb1268 Fix todo-mode item date editing bugs
1e996cf Fix "[:upper:]" for non-ASCII characters 1e996cf Fix "[:upper:]" for non-ASCII characters
896f993 Allow customising the article mode cursor behavior 896f993 Allow customizing the article mode cursor behavior
24c1c1d Use pop-to-buffer-same-window in woman.el 24c1c1d Use pop-to-buffer-same-window in woman.el
2a75f64 New filenotify test for bug#22736 2a75f64 New filenotify test for bug#22736
c9bccf7 Report critical battery errors c9bccf7 Report critical battery errors

View file

@ -2,7 +2,7 @@
# Attempt to guess a canonical system name. # Attempt to guess a canonical system name.
# Copyright 1992-2017 Free Software Foundation, Inc. # Copyright 1992-2017 Free Software Foundation, Inc.
timestamp='2017-08-08' timestamp='2017-09-16'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@ timestamp='2017-08-08'
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>. # along with this program; if not, see <https://www.gnu.org/licenses/>.
# #
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
@ -27,7 +27,7 @@ timestamp='2017-08-08'
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
# #
# You can get the latest version of this script from: # You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
# #
# Please send patches to <config-patches@gnu.org>. # Please send patches to <config-patches@gnu.org>.
@ -318,15 +318,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exitcode=$? exitcode=$?
trap '' 0 trap '' 0
exit $exitcode ;; exit $exitcode ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
exit ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit ;;
Amiga*:UNIX_System_V:4.0:*) Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4 echo m68k-unknown-sysv4
exit ;; exit ;;
@ -858,10 +849,6 @@ EOF
*:MSYS*:*) *:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys echo ${UNAME_MACHINE}-pc-msys
exit ;; exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*) i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32 echo ${UNAME_MACHINE}-pc-pw32
exit ;; exit ;;
@ -877,27 +864,12 @@ EOF
echo ia64-unknown-interix${UNAME_RELEASE} echo ia64-unknown-interix${UNAME_RELEASE}
exit ;; exit ;;
esac ;; esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
8664:Windows_NT:*)
echo x86_64-pc-mks
exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i586-pc-interix
exit ;;
i*:UWIN*:*) i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin echo ${UNAME_MACHINE}-pc-uwin
exit ;; exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin echo x86_64-unknown-cygwin
exit ;; exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit ;;
prep*:SunOS:5.*:*) prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;; exit ;;
@ -1435,9 +1407,9 @@ This script (version $timestamp), has failed to recognize the
operating system you are using. If your script is old, overwrite *all* operating system you are using. If your script is old, overwrite *all*
copies of config.guess and config.sub with the latest versions from: copies of config.guess and config.sub with the latest versions from:
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
and and
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
If $0 has already been updated, send the following data and any If $0 has already been updated, send the following data and any
information you think might be pertinent to config-patches@gnu.org to information you think might be pertinent to config-patches@gnu.org to

20
build-aux/config.sub vendored
View file

@ -2,7 +2,7 @@
# Configuration validation subroutine script. # Configuration validation subroutine script.
# Copyright 1992-2017 Free Software Foundation, Inc. # Copyright 1992-2017 Free Software Foundation, Inc.
timestamp='2017-04-02' timestamp='2017-09-16'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@ timestamp='2017-04-02'
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>. # along with this program; if not, see <https://www.gnu.org/licenses/>.
# #
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
@ -33,7 +33,7 @@ timestamp='2017-04-02'
# Otherwise, we print the canonical config type on stdout and succeed. # Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from: # You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
# This file is supposed to be the same for all GNU packages # This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases # and recognize all the CPU types, system types and aliases
@ -229,9 +229,6 @@ case $os in
-ptx*) -ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;; ;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
-psos*) -psos*)
os=-psos os=-psos
;; ;;
@ -1259,6 +1256,9 @@ case $basic_machine in
basic_machine=hppa1.1-winbond basic_machine=hppa1.1-winbond
os=-proelf os=-proelf
;; ;;
x64)
basic_machine=x86_64-pc
;;
xbox) xbox)
basic_machine=i686-pc basic_machine=i686-pc
os=-mingw32 os=-mingw32
@ -1366,8 +1366,8 @@ esac
if [ x"$os" != x"" ] if [ x"$os" != x"" ]
then then
case $os in case $os in
# First match some system type aliases # First match some system type aliases that might get confused
# that might get confused with valid system types. # with valid system types.
# -solaris* is a basic system type, with this one exception. # -solaris* is a basic system type, with this one exception.
-auroraux) -auroraux)
os=-auroraux os=-auroraux
@ -1387,9 +1387,9 @@ case $os in
-gnu/linux*) -gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;; ;;
# First accept the basic system types. # Now accept the basic system types.
# The portable systems comes first. # The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number. # Each alternative MUST end in a * to match a version number.
# -sysv* is not here because it comes later, after sysvr4. # -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\

View file

@ -33,7 +33,7 @@ use POSIX qw(strftime);
(my $ME = $0) =~ s|.*/||; (my $ME = $0) =~ s|.*/||;
# use File::Coda; # http://meyering.net/code/Coda/ # use File::Coda; # https://meyering.net/code/Coda/
END { END {
defined fileno STDOUT or return; defined fileno STDOUT or return;
close STDOUT and return; close STDOUT and return;

View file

@ -2077,15 +2077,15 @@ if test "${HAVE_W32}" = "yes"; then
AC_SUBST(comma_space_version) AC_SUBST(comma_space_version)
AC_CONFIG_FILES([nt/emacs.rc nt/emacsclient.rc]) AC_CONFIG_FILES([nt/emacs.rc nt/emacsclient.rc])
if test "${opsys}" = "cygwin"; then if test "${opsys}" = "cygwin"; then
W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32" W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lusp10 -lgdi32"
W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool" W32_LIBS="$W32_LIBS -lole32 -lcomdlg32 -lcomctl32 -lwinspool"
# Tell the linker that emacs.res is an object (which we compile from # Tell the linker that emacs.res is an object (which we compile from
# the rc file), not a linker script. # the rc file), not a linker script.
W32_RES_LINK="-Wl,emacs.res" W32_RES_LINK="-Wl,emacs.res"
else else
W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o" W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o"
W32_LIBS="$W32_LIBS -lwinmm -lgdi32 -lcomdlg32" W32_LIBS="$W32_LIBS -lwinmm -lusp10 -lgdi32 -lcomdlg32"
W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lcomctl32 -lusp10" W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lcomctl32"
W32_RES_LINK="\$(EMACSRES)" W32_RES_LINK="\$(EMACSRES)"
CLIENTRES="emacsclient.res" CLIENTRES="emacsclient.res"
CLIENTW="emacsclientw\$(EXEEXT)" CLIENTW="emacsclientw\$(EXEEXT)"

View file

@ -94,7 +94,7 @@ happen. The variables @code{'attempt-stack-overflow-recovery} and
@code{attempt-orderly-shutdown-on-fatal-signal} are therefore removed. @code{attempt-orderly-shutdown-on-fatal-signal} are therefore removed.
@item @item
The @code{timer-list} command was removed, as we decided timers are The @code{list-timers} command was removed, as we decided timers are
not user-level feature, and therefore users should not be allowed to not user-level feature, and therefore users should not be allowed to
mess with them. Ask an Emacs Lisp guru near you for help if you have mess with them. Ask an Emacs Lisp guru near you for help if you have
a runaway timer in your session. (Of course, as you move back in a runaway timer in your session. (Of course, as you move back in

View file

@ -92,7 +92,7 @@ arguments.)
@itemx --visit=@var{file} @itemx --visit=@var{file}
@cindex visiting files, command-line argument @cindex visiting files, command-line argument
@vindex inhibit-startup-buffer-menu @vindex inhibit-startup-buffer-menu
Visit @var{file} using @code{find-file}. @xref{Visiting}. Visit the specified @var{file}. @xref{Visiting}.
When Emacs starts up, it displays the startup buffer in one window, When Emacs starts up, it displays the startup buffer in one window,
and the buffer visiting @var{file} in another window and the buffer visiting @var{file} in another window
@ -111,12 +111,12 @@ Buffer Menu for this, change the variable
@item +@var{linenum} @var{file} @item +@var{linenum} @var{file}
@opindex +@var{linenum} @opindex +@var{linenum}
Visit @var{file} using @code{find-file}, then go to line number Visit the specified @var{file}, then go to line number @var{linenum}
@var{linenum} in it. in it.
@item +@var{linenum}:@var{columnnum} @var{file} @item +@var{linenum}:@var{columnnum} @var{file}
Visit @var{file} using @code{find-file}, then go to line number Visit the specified @var{file}, then go to line number @var{linenum}
@var{linenum} and put point at column number @var{columnnum}. and put point at column number @var{columnnum}.
@item -l @var{file} @item -l @var{file}
@opindex -l @opindex -l

View file

@ -1745,7 +1745,7 @@ invisible parts of text), and lines which wrap to consume more than
one screen line will be numbered that many times. The displayed one screen line will be numbered that many times. The displayed
numbers are relative, as with @code{relative} value above. This is numbers are relative, as with @code{relative} value above. This is
handy in modes that fold text, such as Outline mode (@pxref{Outline handy in modes that fold text, such as Outline mode (@pxref{Outline
Mode}), and need to move by exact number of screen lines. Mode}), and when you need to move by exact number of screen lines.
@item anything else @item anything else
Any other non-@code{nil} value is treated as @code{t}. Any other non-@code{nil} value is treated as @code{t}.
@ -1756,7 +1756,7 @@ Any other non-@code{nil} value is treated as @code{t}.
@vindex display-line-numbers-type @vindex display-line-numbers-type
A convenient way of turning on display of line numbers is @w{@kbd{M-x A convenient way of turning on display of line numbers is @w{@kbd{M-x
display-line-numbers-mode @key{RET}}}. This mode has a globalized display-line-numbers-mode @key{RET}}}. This mode has a globalized
variant, @code{global-display-line0numbers-mode}. The user option variant, @code{global-display-line-numbers-mode}. The user option
@code{display-line-numbers-type} controls which sub-mode of @code{display-line-numbers-type} controls which sub-mode of
line-number display, described above, will these modes activate. line-number display, described above, will these modes activate.
@ -1778,6 +1778,17 @@ the variable @code{display-line-numbers-widen} to a non-@code{nil}
value, line numbers will disregard any narrowing and will start at the value, line numbers will disregard any narrowing and will start at the
first character of the buffer. first character of the buffer.
@vindex display-line-numbers-width-start
@vindex display-line-numbers-grow-only
@vindex display-line-numbers-width
In selective display mode (@pxref{Selective Display}), and other modes
that hide many lines from display (such as Outline and Org modes), you
may wish to customize the variables
@code{display-line-numbers-width-start} and
@code{display-line-numbers-grow-only}, or set
@code{display-line-numbers-width} to a large enough value, to avoid
occasional miscalculations of space reserved for the line numbers.
@cindex line-number face @cindex line-number face
The line numbers are displayed in a special face @code{line-number}. The line numbers are displayed in a special face @code{line-number}.
The current line number is displayed in a different face, The current line number is displayed in a different face,

View file

@ -1089,12 +1089,15 @@ is not cleared by changing major modes.
@defopt buffer-offer-save @defopt buffer-offer-save
This variable, if non-@code{nil} in a particular buffer, tells This variable, if non-@code{nil} in a particular buffer, tells
@code{save-buffers-kill-emacs} and @code{save-some-buffers} (if the @code{save-buffers-kill-emacs} to offer to save that buffer, just as
second optional argument to that function is @code{t}) to offer to it offers to save file-visiting buffers. If @code{save-some-buffers}
save that buffer, just as they offer to save file-visiting buffers. is called with the second optional argument set to @code{t}, it will
@xref{Definition of save-some-buffers}. The variable also offer to save the buffer. Lastly, if this variable is set to the
@code{buffer-offer-save} automatically becomes buffer-local when set symbol @code{always}, both @code{save-buffers-kill-emacs} and
for any reason. @xref{Buffer-Local Variables}. @code{save-some-buffers} will always offer to save. @xref{Definition
of save-some-buffers}. The variable @code{buffer-offer-save}
automatically becomes buffer-local when set for any reason.
@xref{Buffer-Local Variables}.
@end defopt @end defopt
@defvar buffer-save-without-query @defvar buffer-save-without-query

View file

@ -332,7 +332,9 @@ in the list @code{find-file-hook}.
that is visiting that file---that is, the contents of the file are that is visiting that file---that is, the contents of the file are
copied into the buffer and the copy is what you edit. Changes to the copied into the buffer and the copy is what you edit. Changes to the
buffer do not change the file until you @dfn{save} the buffer, which buffer do not change the file until you @dfn{save} the buffer, which
means copying the contents of the buffer into the file. means copying the contents of the buffer into the file. Buffers which
are not visiting a file can still be ``saved'', in a sense, using
functions in the buffer-local @code{write-contents-functions} hook.
@deffn Command save-buffer &optional backup-option @deffn Command save-buffer &optional backup-option
This function saves the contents of the current buffer in its visited This function saves the contents of the current buffer in its visited
@ -365,8 +367,8 @@ With an argument of 0, unconditionally do @emph{not} make any backup file.
@anchor{Definition of save-some-buffers} @anchor{Definition of save-some-buffers}
This command saves some modified file-visiting buffers. Normally it This command saves some modified file-visiting buffers. Normally it
asks the user about each buffer. But if @var{save-silently-p} is asks the user about each buffer. But if @var{save-silently-p} is
non-@code{nil}, it saves all the file-visiting buffers without querying non-@code{nil}, it saves all the file-visiting buffers without
the user. querying the user.
@vindex save-some-buffers-default-predicate @vindex save-some-buffers-default-predicate
The optional @var{pred} argument provides a predicate that controls The optional @var{pred} argument provides a predicate that controls

View file

@ -112,37 +112,39 @@ window of another Emacs frame. @xref{Child Frames}.
* Display Feature Testing:: Determining the features of a terminal. * Display Feature Testing:: Determining the features of a terminal.
@end menu @end menu
@node Creating Frames @node Creating Frames
@section Creating Frames @section Creating Frames
@cindex frame creation @cindex frame creation
To create a new frame, call the function @code{make-frame}. To create a new frame, call the function @code{make-frame}.
@deffn Command make-frame &optional alist @deffn Command make-frame &optional parameters
This function creates and returns a new frame, displaying the current This function creates and returns a new frame, displaying the current
buffer. buffer.
The @var{alist} argument is an alist that specifies frame parameters The @var{parameters} argument is an alist that specifies frame
for the new frame. @xref{Frame Parameters}. If you specify the parameters for the new frame. @xref{Frame Parameters}. If you specify
@code{terminal} parameter in @var{alist}, the new frame is created on the @code{terminal} parameter in @var{parameters}, the new frame is
that terminal. Otherwise, if you specify the @code{window-system} created on that terminal. Otherwise, if you specify the
frame parameter in @var{alist}, that determines whether the frame @code{window-system} frame parameter in @var{parameters}, that
should be displayed on a text terminal or a graphical terminal. determines whether the frame should be displayed on a text terminal or a
@xref{Window Systems}. If neither is specified, the new frame is graphical terminal. @xref{Window Systems}. If neither is specified,
created in the same terminal as the selected frame. the new frame is created in the same terminal as the selected frame.
Any parameters not mentioned in @var{alist} default to the values in Any parameters not mentioned in @var{parameters} default to the values
the alist @code{default-frame-alist} (@pxref{Initial Parameters}); in the alist @code{default-frame-alist} (@pxref{Initial Parameters});
parameters not specified there default from the X resources or its parameters not specified there default from the X resources or its
equivalent on your operating system (@pxref{X Resources,, X Resources, equivalent on your operating system (@pxref{X Resources,, X Resources,
emacs, The GNU Emacs Manual}). After the frame is created, Emacs emacs, The GNU Emacs Manual}). After the frame is created, this
applies any parameters listed in @code{frame-inherited-parameters} function applies any parameters specified in
(see below) and not present in the argument, taking the values from @code{frame-inherited-parameters} (see below) it has no assigned yet,
the frame that was selected when @code{make-frame} was called. taking the values from the frame that was selected when
@code{make-frame} was called.
Note that on multi-monitor displays (@pxref{Multiple Terminals}), the Note that on multi-monitor displays (@pxref{Multiple Terminals}), the
window manager might position the frame differently than specified by window manager might position the frame differently than specified by
the positional parameters in @var{alist} (@pxref{Position the positional parameters in @var{parameters} (@pxref{Position
Parameters}). For example, some window managers have a policy of Parameters}). For example, some window managers have a policy of
displaying the frame on the monitor that contains the largest part of displaying the frame on the monitor that contains the largest part of
the window (a.k.a.@: the @dfn{dominating} monitor). the window (a.k.a.@: the @dfn{dominating} monitor).
@ -158,20 +160,28 @@ A normal hook run by @code{make-frame} before it creates the frame.
@end defvar @end defvar
@defvar after-make-frame-functions @defvar after-make-frame-functions
An abnormal hook run by @code{make-frame} after it creates the frame. An abnormal hook run by @code{make-frame} after it created the frame.
Each function in @code{after-make-frame-functions} receives one argument, the Each function in @code{after-make-frame-functions} receives one
frame just created. argument, the frame just created.
@end defvar @end defvar
Note that any functions added to these hooks by your initial file are
usually not run for the initial frame, since Emacs reads the initial
file only after creating that frame. However, if the initial frame is
specified to use a separate minibuffer frame (@pxref{Minibuffers and
Frames}), the functions will be run for both, the minibuffer-less and
the minibuffer frame.
@defvar frame-inherited-parameters @defvar frame-inherited-parameters
This variable specifies the list of frame parameters that a newly This variable specifies the list of frame parameters that a newly
created frame inherits from the currently selected frame. For each created frame inherits from the currently selected frame. For each
parameter (a symbol) that is an element in the list and is not present parameter (a symbol) that is an element in this list and has not been
in the argument to @code{make-frame}, the function sets the value of assigned earlier when processing @code{make-frame}, the function sets
that parameter in the created frame to its value in the selected the value of that parameter in the created frame to its value in the
frame. selected frame.
@end defvar @end defvar
@node Multiple Terminals @node Multiple Terminals
@section Multiple Terminals @section Multiple Terminals
@cindex multiple terminals @cindex multiple terminals

View file

@ -1885,8 +1885,8 @@ one of these functions; the arrival of the specified time will not
cause anything special to happen. cause anything special to happen.
@end defun @end defun
@findex timer-list @findex list-timers
The @code{timer-list} command lists all the currently active timers. The @code{list-timers} command lists all the currently active timers.
There's only one command available in the buffer displayed: @kbd{c} There's only one command available in the buffer displayed: @kbd{c}
(@code{timer-list-cancel}) that will cancel the timer on the line (@code{timer-list-cancel}) that will cancel the timer on the line
under point. under point.

View file

@ -824,8 +824,9 @@ to the produced string representations of the argument @var{objects}.
@end defun @end defun
@defun format-message string &rest objects @defun format-message string &rest objects
@cindex curved quotes @cindex curved quotes, in formatted messages
@cindex curly quotes @cindex curly quotes, in formatted messages
@cindex @code{text-quoting-style}, and formatting messages
This function acts like @code{format}, except it also converts any This function acts like @code{format}, except it also converts any
grave accents (@t{`}) and apostrophes (@t{'}) in @var{string} as per the grave accents (@t{`}) and apostrophes (@t{'}) in @var{string} as per the
value of @code{text-quoting-style}. value of @code{text-quoting-style}.

View file

@ -54,6 +54,8 @@ the character after point.
* Registers:: How registers are implemented. Accessing the text or * Registers:: How registers are implemented. Accessing the text or
position stored in a register. position stored in a register.
* Transposition:: Swapping two portions of a buffer. * Transposition:: Swapping two portions of a buffer.
* Replacing:: Replacing the text of one buffer with the text
of another buffer.
* Decompression:: Dealing with compressed data. * Decompression:: Dealing with compressed data.
* Base 64:: Conversion to or from base 64 encoding. * Base 64:: Conversion to or from base 64 encoding.
* Checksum/Hash:: Computing cryptographic hashes. * Checksum/Hash:: Computing cryptographic hashes.
@ -4328,6 +4330,28 @@ is non-@code{nil}, @code{transpose-regions} does not do this---it leaves
all markers unrelocated. all markers unrelocated.
@end defun @end defun
@node Replacing
@section Replacing Buffer Text
You can use the following function to replace the text of one buffer
with the text of another buffer:
@deffn Command replace-buffer-contents source
This function replaces the accessible portion of the current buffer
with the accessible portion of the buffer @var{source}. @var{source}
may either be a buffer object or the name of a buffer. When
@code{replace-buffer-contents} succeeds, the text of the accessible
portion of the current buffer will be equal to the text of the
accessible portion of the @var{source} buffer. This function attempts
to keep point, markers, text properties, and overlays in the current
buffer intact. One potential case where this behavior is useful is
external code formatting programs: they typically write the
reformatted text into a temporary buffer or file, and using
@code{delete-region} and @code{insert-buffer-substring} would destroy
these properties. However, the latter combination is typically
faster. @xref{Deletion}, and @ref{Insertion}.
@end deffn
@node Decompression @node Decompression
@section Dealing With Compressed Data @section Dealing With Compressed Data

View file

@ -68,10 +68,13 @@ costs.}. Use two hyphens to separate prefix and name if the symbol is
not meant to be used by other packages. not meant to be used by other packages.
Occasionally, for a command name intended for users to use, it is more Occasionally, for a command name intended for users to use, it is more
convenient if some words come before the package's name prefix. And convenient if some words come before the package's name prefix. For
constructs that define functions, variables, etc., work better if they example, it is our convention to have commands that list objects named
start with @samp{defun} or @samp{defvar}, so put the name prefix later as @samp{list-@var{something}}, e.g., a package called @samp{frob}
on in the name. could have a command @samp{list-frobs}, when its other global symbols
begin with @samp{frob-}. Also, constructs that define functions,
variables, etc., work better if they start with @samp{defun} or
@samp{defvar}, so put the name prefix later on in the name.
This recommendation applies even to names for traditional Lisp This recommendation applies even to names for traditional Lisp
primitives that are not primitives in Emacs Lisp---such as primitives that are not primitives in Emacs Lisp---such as

View file

@ -3,7 +3,7 @@
% Load plain if necessary, i.e., if running under initex. % Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
% %
\def\texinfoversion{2017-08-23.19} \def\texinfoversion{2017-09-16.10}
% %
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@ -21,7 +21,7 @@
% General Public License for more details. % General Public License for more details.
% %
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>. % along with this program. If not, see <https://www.gnu.org/licenses/>.
% %
% As a special exception, when this file is read by TeX when processing % As a special exception, when this file is read by TeX when processing
% a Texinfo source document, you may use the result without % a Texinfo source document, you may use the result without
@ -30,9 +30,9 @@
% %
% Please try the latest version of texinfo.tex before submitting bug % Please try the latest version of texinfo.tex before submitting bug
% reports; you can get the latest version from: % reports; you can get the latest version from:
% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or % https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or % https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
% http://www.gnu.org/software/texinfo/ (the Texinfo home page) % https://www.gnu.org/software/texinfo/ (the Texinfo home page)
% The texinfo.tex in any given distribution could well be out % The texinfo.tex in any given distribution could well be out
% of date, so if that's what you're using, please check. % of date, so if that's what you're using, please check.
% %
@ -56,7 +56,7 @@
% extent. You can get the existing language-specific files from the % extent. You can get the existing language-specific files from the
% full Texinfo distribution. % full Texinfo distribution.
% %
% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. % The GNU Texinfo home page is https://www.gnu.org/software/texinfo.
\message{Loading texinfo [version \texinfoversion]:} \message{Loading texinfo [version \texinfoversion]:}
@ -9446,7 +9446,7 @@
\newif\ifwarnednoepsf \newif\ifwarnednoepsf
\newhelp\noepsfhelp{epsf.tex must be installed for images to \newhelp\noepsfhelp{epsf.tex must be installed for images to
work. It is also included in the Texinfo distribution, or you can get work. It is also included in the Texinfo distribution, or you can get
it from ftp://tug.org/tex/epsf.tex.} it from https://ctan.org/texarchive/macros/texinfo/texinfo/doc/epsf.tex.}
% %
\def\image#1{% \def\image#1{%
\ifx\epsfbox\thisisundefined \ifx\epsfbox\thisisundefined

View file

@ -3043,6 +3043,14 @@ Disable version control to avoid delays:
@end group @end group
@end lisp @end lisp
If this is too radical, because you want to use version control
remotely, trim @code{vc-handled-backends} to just those you care
about, for example:
@lisp
(setq vc-handled-backends '(SVN Git))
@end lisp
Disable excessive traces. Set @code{tramp-verbose} to 3 or lower, Disable excessive traces. Set @code{tramp-verbose} to 3 or lower,
default being 3. Increase trace levels temporarily when hunting for default being 3. Increase trace levels temporarily when hunting for
bugs. bugs.

View file

@ -8,7 +8,7 @@
@c In the Tramp GIT, the version number is auto-frobbed from @c In the Tramp GIT, the version number is auto-frobbed from
@c configure.ac, so you should edit that file and run @c configure.ac, so you should edit that file and run
@c "autoconf && ./configure" to change the version number. @c "autoconf && ./configure" to change the version number.
@set trampver 2.3.3-pre @set trampver 2.3.3.26.1
@c Other flags from configuration @c Other flags from configuration
@set instprefix /usr/local @set instprefix /usr/local

View file

@ -117,6 +117,11 @@ The effect is similar to that of "toolBar" resource on the tool bar.
* Changes in Emacs 26.1 * Changes in Emacs 26.1
+++
** Option 'buffer-offer-save' can be set to new value, 'always'. When
set to 'always', the command `save-some-buffers' will always offer
this buffer for saving.
** Security vulnerability related to Enriched Text mode is removed. ** Security vulnerability related to Enriched Text mode is removed.
+++ +++
@ -144,8 +149,7 @@ init file:
'save-buffer' process. Previously, saving a buffer that was not 'save-buffer' process. Previously, saving a buffer that was not
visiting a file would always prompt for a file name. Now it only does visiting a file would always prompt for a file name. Now it only does
so if 'write-contents-functions' is nil (or all its functions return so if 'write-contents-functions' is nil (or all its functions return
nil). A non-nil buffer-local value for this variable is sufficient nil).
for 'save-some-buffers' to consider the buffer for saving.
--- ---
** New variable 'executable-prefix-env' for inserting magic signatures. ** New variable 'executable-prefix-env' for inserting magic signatures.
@ -367,7 +371,7 @@ see the node "Connection Local Variables" in the ELisp manual.
puny.el library, so that one can visit Web sites with non-ASCII URLs. puny.el library, so that one can visit Web sites with non-ASCII URLs.
+++ +++
** The new 'timer-list' command lists all active timers in a buffer, ** The new 'list-timers' command lists all active timers in a buffer,
where you can cancel them with the 'c' command. where you can cancel them with the 'c' command.
+++ +++
@ -578,7 +582,6 @@ Negative prefix arg flips the direction of selection. Also,
defun are selected unless they are separated from the defun by a blank defun are selected unless they are separated from the defun by a blank
line. line.
---
** New command 'replace-buffer-contents'. ** New command 'replace-buffer-contents'.
This command replaces the contents of the accessible portion of the This command replaces the contents of the accessible portion of the
current buffer with the contents of the accessible portion of a current buffer with the contents of the accessible portion of a
@ -701,6 +704,12 @@ method is an NNTP select method.
*** A new command for sorting articles by readedness marks has been *** A new command for sorting articles by readedness marks has been
added: 'C-c C-s C-m C-m'. added: 'C-c C-s C-m C-m'.
+++
*** In message-citation-line-format the %Z format is now the time zone name
instead of the numeric form. The %z format continues to be the
numeric form. The new behavior is compatible with format-time-string.
** Ibuffer ** Ibuffer
--- ---
@ -1344,6 +1353,12 @@ non-nil, but the code returned the list in the increasing order of
priority instead. Now the code does what the documentation says it priority instead. Now the code does what the documentation says it
should do. should do.
---
** 'eldoc-message' only accepts one argument now. Programs that
called it with multiple arguments before should pass them through
'format' first. Even that is discouraged: for ElDoc support, you
should set 'eldoc-documentation-function' instead of calling
'eldoc-message' directly.
* Lisp Changes in Emacs 26.1 * Lisp Changes in Emacs 26.1
@ -1813,6 +1828,13 @@ can be replicated simply by setting 'comment-auto-fill-only-comments'.
** New pcase pattern 'rx' to match against a rx-style regular expression. ** New pcase pattern 'rx' to match against a rx-style regular expression.
For details, see the doc string of 'rx--pcase-macroexpander'. For details, see the doc string of 'rx--pcase-macroexpander'.
---
** New functions to set region from secondary selection and vice versa.
The new functions 'secondary-selection-to-region' and
'secondary-selection-from-region' let you set the beginning and the
end of the region from those of the secondary selection and vise
versa.
* Changes in Emacs 26.1 on Non-Free Operating Systems * Changes in Emacs 26.1 on Non-Free Operating Systems
@ -1876,6 +1898,12 @@ of frame decorations on macOS 10.9+.
--- ---
** 'process-attributes' on Darwin systems now returns more information. ** 'process-attributes' on Darwin systems now returns more information.
---
** Mousewheel and trackpad scrolling on macOS 10.7+ now behaves more
like the macOS default. The new variables 'ns-mwheel-line-height',
'ns-use-mwheel-acceleration' and 'ns-use-mwheel-momentum' can be used
to customize the behavior.
---------------------------------------------------------------------- ----------------------------------------------------------------------
This file is part of GNU Emacs. This file is part of GNU Emacs.

View file

@ -7068,14 +7068,16 @@ etags_mktmp (void)
errno = temp_errno; errno = temp_errno;
templt = NULL; templt = NULL;
} }
#if defined (DOS_NT) #if defined (DOS_NT)
/* The file name will be used in shell redirection, so it needs to have else
DOS-style backslashes, or else the Windows shell will barf. */ {
char *p; /* The file name will be used in shell redirection, so it needs to have
for (p = templt; *p; p++) DOS-style backslashes, or else the Windows shell will barf. */
if (*p == '/') char *p;
*p = '\\'; for (p = templt; *p; p++)
if (*p == '/')
*p = '\\';
}
#endif #endif
return templt; return templt;

View file

@ -29,7 +29,7 @@ struct allocator
/* Do not use GCC attributes such as __attribute__ ((malloc)) with /* Do not use GCC attributes such as __attribute__ ((malloc)) with
the function types pointed at by these members, because these the function types pointed at by these members, because these
attributes do not work with pointers to functions. See attributes do not work with pointers to functions. See
<http://lists.gnu.org/archive/html/bug-gnulib/2011-04/msg00007.html>. */ <https://lists.gnu.org/archive/html/bug-gnulib/2011-04/msg00007.html>. */
/* Call ALLOCATE to allocate memory, like 'malloc'. On failure ALLOCATE /* Call ALLOCATE to allocate memory, like 'malloc'. On failure ALLOCATE
should return NULL, though not necessarily set errno. When given should return NULL, though not necessarily set errno. When given

View file

@ -70,7 +70,8 @@ _GL_INLINE_HEADER_BEGIN
COUNT_LEADING_ZEROS_INLINE int COUNT_LEADING_ZEROS_INLINE int
count_leading_zeros_32 (unsigned int x) count_leading_zeros_32 (unsigned int x)
{ {
/* http://graphics.stanford.edu/~seander/bithacks.html */ /* <https://github.com/gibsjose/BitHacks>
<http://www.fit.vutbr.cz/~ibarina/pub/bithacks.pdf> */
static const char de_Bruijn_lookup[32] = { static const char de_Bruijn_lookup[32] = {
31, 22, 30, 21, 18, 10, 29, 2, 20, 17, 15, 13, 9, 6, 28, 1, 31, 22, 30, 21, 18, 10, 29, 2, 20, 17, 15, 13, 9, 6, 28, 1,
23, 19, 11, 3, 16, 14, 7, 24, 12, 4, 8, 25, 5, 26, 27, 0 23, 19, 11, 3, 16, 14, 7, 24, 12, 4, 8, 25, 5, 26, 27, 0

View file

@ -68,7 +68,8 @@ _GL_INLINE_HEADER_BEGIN
COUNT_TRAILING_ZEROS_INLINE int COUNT_TRAILING_ZEROS_INLINE int
count_trailing_zeros_32 (unsigned int x) count_trailing_zeros_32 (unsigned int x)
{ {
/* http://graphics.stanford.edu/~seander/bithacks.html */ /* <https://github.com/gibsjose/BitHacks>
<http://www.fit.vutbr.cz/~ibarina/pub/bithacks.pdf> */
static const char de_Bruijn_lookup[32] = { static const char de_Bruijn_lookup[32] = {
0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8,
31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9

View file

@ -88,7 +88,7 @@ ms_windows_dup2 (int fd, int desired_fd)
} }
/* Wine 1.0.1 return 0 when desired_fd is negative but not -1: /* Wine 1.0.1 return 0 when desired_fd is negative but not -1:
http://bugs.winehq.org/show_bug.cgi?id=21289 */ https://bugs.winehq.org/show_bug.cgi?id=21289 */
if (desired_fd < 0) if (desired_fd < 0)
{ {
errno = EBADF; errno = EBADF;

View file

@ -79,7 +79,7 @@ order (unsigned char c)
specification can be found in the Debian Policy Manual in the specification can be found in the Debian Policy Manual in the
section on the 'Version' control field. This version of the code section on the 'Version' control field. This version of the code
implements that from s5.6.12 of Debian Policy v3.8.0.1 implements that from s5.6.12 of Debian Policy v3.8.0.1
http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version */ https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version */
static int _GL_ATTRIBUTE_PURE static int _GL_ATTRIBUTE_PURE
verrevcmp (const char *s1, size_t s1_len, const char *s2, size_t s2_len) verrevcmp (const char *s1, size_t s1_len, const char *s2, size_t s2_len)
{ {

View file

@ -111,7 +111,7 @@ stat_func (char const *name, struct stat *st)
# endif # endif
/* Replacement for Solaris' function by the same name. /* Replacement for Solaris' function by the same name.
<http://www.google.com/search?q=fstatat+site:docs.sun.com> <https://www.google.com/search?q=fstatat+site:docs.oracle.com>
First, try to simulate it via l?stat ("/proc/self/fd/FD/FILE"). First, try to simulate it via l?stat ("/proc/self/fd/FD/FILE").
Failing that, simulate it via save_cwd/fchdir/(stat|lstat)/restore_cwd. Failing that, simulate it via save_cwd/fchdir/(stat|lstat)/restore_cwd.
If either the save_cwd or the restore_cwd fails (relatively unlikely), If either the save_cwd or the restore_cwd fails (relatively unlikely),

View file

@ -2,8 +2,8 @@
cross-compilers like MinGW. cross-compilers like MinGW.
This is derived from sqlite3 sources. This is derived from sqlite3 sources.
http://www.sqlite.org/cvstrac/rlog?f=sqlite/src/os_win.c https://www.sqlite.org/src/finfo?name=src/os_win.c
http://www.sqlite.org/copyright.html https://www.sqlite.org/copyright.html
Written by Richard W.M. Jones <rjones.at.redhat.com> Written by Richard W.M. Jones <rjones.at.redhat.com>

View file

@ -108,7 +108,7 @@ FTOASTR (char *buf, size_t bufsize, int flags, int width, FLOAT x)
Andrysco M, Jhala R, Lerner S. Printing floating-point numbers: Andrysco M, Jhala R, Lerner S. Printing floating-point numbers:
a faster, always correct method. ACM SIGPLAN notices - POPL '16. a faster, always correct method. ACM SIGPLAN notices - POPL '16.
2016;51(1):555-67 <http://dx.doi.org/10.1145/2914770.2837654>; draft at 2016;51(1):555-67 <http://dx.doi.org/10.1145/2914770.2837654>; draft at
<http://cseweb.ucsd.edu/~lerner/papers/fp-printing-popl16.pdf>. */ <https://cseweb.ucsd.edu/~lerner/papers/fp-printing-popl16.pdf>. */
PROMOTED_FLOAT promoted_x = x; PROMOTED_FLOAT promoted_x = x;
char format[sizeof "%-+ 0*.*Lg"]; char format[sizeof "%-+ 0*.*Lg"];

View file

@ -96,7 +96,7 @@ enum
DIG digits. For why the "+ 1" is needed, see "Binary to Decimal DIG digits. For why the "+ 1" is needed, see "Binary to Decimal
Conversion" in David Goldberg's paper "What Every Computer Conversion" in David Goldberg's paper "What Every Computer
Scientist Should Know About Floating-Point Arithmetic" Scientist Should Know About Floating-Point Arithmetic"
<http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html>. */ <https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html>. */
# define _GL_FLOAT_PREC_BOUND(dig) \ # define _GL_FLOAT_PREC_BOUND(dig) \
(INT_BITS_STRLEN_BOUND ((dig) * _GL_FLOAT_DIG_BITS_BOUND) + 1) (INT_BITS_STRLEN_BOUND ((dig) * _GL_FLOAT_DIG_BITS_BOUND) + 1)

View file

@ -558,6 +558,7 @@ LIBGPM = @LIBGPM@
LIBHESIOD = @LIBHESIOD@ LIBHESIOD = @LIBHESIOD@
LIBINTL = @LIBINTL@ LIBINTL = @LIBINTL@
LIBJPEG = @LIBJPEG@ LIBJPEG = @LIBJPEG@
LIBLCMS2 = @LIBLCMS2@
LIBMODULES = @LIBMODULES@ LIBMODULES = @LIBMODULES@
LIBOBJS = @LIBOBJS@ LIBOBJS = @LIBOBJS@
LIBOTF_CFLAGS = @LIBOTF_CFLAGS@ LIBOTF_CFLAGS = @LIBOTF_CFLAGS@

View file

@ -26,7 +26,7 @@
#define _GL_INT_CONVERT(e, v) (0 * (e) + (v)) #define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see /* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
<http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00406.html>. */ <https://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00406.html>. */
#define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v)) #define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v))
/* The extra casts in the following macros work around compiler bugs, /* The extra casts in the following macros work around compiler bugs,
@ -179,7 +179,7 @@
/* Return 1 if A * B would overflow in [MIN,MAX] arithmetic. /* Return 1 if A * B would overflow in [MIN,MAX] arithmetic.
See above for restrictions. Avoid && and || as they tickle See above for restrictions. Avoid && and || as they tickle
bugs in Sun C 5.11 2010/08/13 and other compilers; see bugs in Sun C 5.11 2010/08/13 and other compilers; see
<http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00401.html>. */ <https://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00401.html>. */
#define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max) \ #define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max) \
((b) < 0 \ ((b) < 0 \
? ((a) < 0 \ ? ((a) < 0 \
@ -443,7 +443,7 @@
implementation-defined result or signal for values outside T's implementation-defined result or signal for values outside T's
range. However, code that works around this theoretical problem range. However, code that works around this theoretical problem
runs afoul of a compiler bug in Oracle Studio 12.3 x86. See: runs afoul of a compiler bug in Oracle Studio 12.3 x86. See:
http://lists.gnu.org/archive/html/bug-gnulib/2017-04/msg00049.html https://lists.gnu.org/archive/html/bug-gnulib/2017-04/msg00049.html
As the compiler bug is real, don't try to work around the As the compiler bug is real, don't try to work around the
theoretical problem. */ theoretical problem. */

View file

@ -200,7 +200,7 @@ typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
/* When also using extern inline, suppress the use of static inline in /* When also using extern inline, suppress the use of static inline in
standard headers of problematic Apple configurations, as Libc at standard headers of problematic Apple configurations, as Libc at
least through Libc-825.26 (2013-04-09) mishandles it; see, e.g., least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
<http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>. <https://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
Perhaps Apple will fix this some day. */ Perhaps Apple will fix this some day. */
#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \ #if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
&& (defined __i386__ || defined __x86_64__)) && (defined __i386__ || defined __x86_64__))

View file

@ -32,7 +32,7 @@
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
# if defined __DragonFly__ /* DragonFly */ # if defined __DragonFly__ /* DragonFly */
/* See <http://www.dragonflybsd.org/cvsweb/src/lib/libc/stdio/priv_stdio.h?rev=HEAD&content-type=text/x-cvsweb-markup>. */ /* See <https://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/lib/libc/stdio/priv_stdio.h>. */
# define fp_ ((struct { struct __FILE_public pub; \ # define fp_ ((struct { struct __FILE_public pub; \
struct { unsigned char *_base; int _size; } _bf; \ struct { unsigned char *_base; int _size; } _bf; \
void *cookie; \ void *cookie; \
@ -49,7 +49,7 @@
fpos_t _offset; \ fpos_t _offset; \
/* More fields, not relevant here. */ \ /* More fields, not relevant here. */ \
} *) fp) } *) fp)
/* See <http://www.dragonflybsd.org/cvsweb/src/include/stdio.h?rev=HEAD&content-type=text/x-cvsweb-markup>. */ /* See <https://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/include/stdio.h>. */
# define _p pub._p # define _p pub._p
# define _flags pub._flags # define _flags pub._flags
# define _r pub._r # define _r pub._r
@ -60,7 +60,7 @@
# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __minix || defined __ANDROID__ /* NetBSD >= 1.5ZA, OpenBSD, Minix 3, Android */ # if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __minix || defined __ANDROID__ /* NetBSD >= 1.5ZA, OpenBSD, Minix 3, Android */
/* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> /* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
and <http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> */ and <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> */
struct __sfileext struct __sfileext
{ {
struct __sbuf _ub; /* ungetc buffer */ struct __sbuf _ub; /* ungetc buffer */
@ -81,7 +81,7 @@
#ifdef __TANDEM /* NonStop Kernel */ #ifdef __TANDEM /* NonStop Kernel */
# ifndef _IOERR # ifndef _IOERR
/* These values were determined by the program 'stdioext-flags' at /* These values were determined by the program 'stdioext-flags' at
<http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00165.html>. */ <https://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00165.html>. */
# define _IOERR 0x40 # define _IOERR 0x40
# define _IOREAD 0x80 # define _IOREAD 0x80
# define _IOWRT 0x4 # define _IOWRT 0x4
@ -132,7 +132,7 @@ struct _gl_real_FILE
# define fp_ ((struct _gl_real_FILE *) fp) # define fp_ ((struct _gl_real_FILE *) fp)
/* These values were determined by a program similar to the one at /* These values were determined by a program similar to the one at
<http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00165.html>. */ <https://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00165.html>. */
# define _IOREAD 0x1 # define _IOREAD 0x1
# define _IOWRT 0x2 # define _IOWRT 0x2
# define _IORW 0x4 # define _IORW 0x4

View file

@ -152,7 +152,7 @@
/* When also using extern inline, suppress the use of static inline in /* When also using extern inline, suppress the use of static inline in
standard headers of problematic Apple configurations, as Libc at standard headers of problematic Apple configurations, as Libc at
least through Libc-825.26 (2013-04-09) mishandles it; see, e.g., least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
<http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>. <https://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
Perhaps Apple will fix this some day. */ Perhaps Apple will fix this some day. */
#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \ #if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
&& defined __GNUC__ && defined __STDC__) && defined __GNUC__ && defined __STDC__)
@ -610,7 +610,7 @@ _GL_CXXALIAS_SYS (fwrite, size_t,
(const void *ptr, size_t s, size_t n, FILE *stream)); (const void *ptr, size_t s, size_t n, FILE *stream));
/* Work around bug 11959 when fortifying glibc 2.4 through 2.15 /* Work around bug 11959 when fortifying glibc 2.4 through 2.15
<http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>, <https://sourceware.org/bugzilla/show_bug.cgi?id=11959>,
which sometimes causes an unwanted diagnostic for fwrite calls. which sometimes causes an unwanted diagnostic for fwrite calls.
This affects only function declaration attributes under certain This affects only function declaration attributes under certain
versions of gcc and clang, and is not needed for C++. */ versions of gcc and clang, and is not needed for C++. */

View file

@ -379,7 +379,7 @@ _GL_WARN_ON_USE (dup2, "dup2 is unportable - "
Close NEWFD first if it is open. Close NEWFD first if it is open.
Return newfd if successful, otherwise -1 and errno set. Return newfd if successful, otherwise -1 and errno set.
See the Linux man page at See the Linux man page at
<http://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */ <https://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>. */
# if @HAVE_DUP3@ # if @HAVE_DUP3@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define dup3 rpl_dup3 # define dup3 rpl_dup3
@ -1149,7 +1149,7 @@ _GL_WARN_ON_USE (pipe, "pipe is unportable - "
Store the read-end as fd[0] and the write-end as fd[1]. Store the read-end as fd[0] and the write-end as fd[1].
Return 0 upon success, or -1 with errno set upon failure. Return 0 upon success, or -1 with errno set upon failure.
See also the Linux man page at See also the Linux man page at
<http://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */ <https://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>. */
# if @HAVE_PIPE2@ # if @HAVE_PIPE2@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define pipe2 rpl_pipe2 # define pipe2 rpl_pipe2

View file

@ -196,7 +196,7 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2])
/* Some Linux-based NFS clients are buggy, and mishandle timestamps /* Some Linux-based NFS clients are buggy, and mishandle timestamps
of files in NFS file systems in some cases. We have no of files in NFS file systems in some cases. We have no
configure-time test for this, but please see configure-time test for this, but please see
<http://bugs.gentoo.org/show_bug.cgi?id=132673> for references to <https://bugs.gentoo.org/show_bug.cgi?id=132673> for references to
some of the problems with Linux 2.6.16. If this affects you, some of the problems with Linux 2.6.16. If this affects you,
compile with -DHAVE_BUGGY_NFS_TIME_STAMPS; this is reported to compile with -DHAVE_BUGGY_NFS_TIME_STAMPS; this is reported to
help in some cases, albeit at a cost in performance. But you help in some cases, albeit at a cost in performance. But you
@ -250,8 +250,8 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2])
result = utimensat (AT_FDCWD, file, ts, 0); result = utimensat (AT_FDCWD, file, ts, 0);
# ifdef __linux__ # ifdef __linux__
/* Work around a kernel bug: /* Work around a kernel bug:
http://bugzilla.redhat.com/442352 https://bugzilla.redhat.com/show_bug.cgi?id=442352
http://bugzilla.redhat.com/449910 https://bugzilla.redhat.com/show_bug.cgi?id=449910
It appears that utimensat can mistakenly return 280 rather It appears that utimensat can mistakenly return 280 rather
than -1 upon ENOSYS failure. than -1 upon ENOSYS failure.
FIXME: remove in 2010 or whenever the offending kernels FIXME: remove in 2010 or whenever the offending kernels
@ -566,8 +566,8 @@ lutimens (char const *file, struct timespec const timespec[2])
result = utimensat (AT_FDCWD, file, ts, AT_SYMLINK_NOFOLLOW); result = utimensat (AT_FDCWD, file, ts, AT_SYMLINK_NOFOLLOW);
# ifdef __linux__ # ifdef __linux__
/* Work around a kernel bug: /* Work around a kernel bug:
http://bugzilla.redhat.com/442352 https://bugzilla.redhat.com/show_bug.cgi?id=442352
http://bugzilla.redhat.com/449910 https://bugzilla.redhat.com/show_bug.cgi?id=449910
It appears that utimensat can mistakenly return 280 rather It appears that utimensat can mistakenly return 280 rather
than -1 upon ENOSYS failure. than -1 upon ENOSYS failure.
FIXME: remove in 2010 or whenever the offending kernels FIXME: remove in 2010 or whenever the offending kernels

View file

@ -266,7 +266,7 @@ specified in ARGS. When ARGS is omitted, by default the option
\"12pt,a4paper\" is passed. When ARGS has any other value, then \"12pt,a4paper\" is passed. When ARGS has any other value, then
no option is passed to the class. no option is passed to the class.
Insert the \"\\usepacakge{geometry}\" directive when ARGS Insert the \"\\usepackage{geometry}\" directive when ARGS
contains the \"landscape\" string." contains the \"landscape\" string."
(set-buffer (generate-new-buffer cal-tex-buffer)) (set-buffer (generate-new-buffer cal-tex-buffer))
(save-match-data (save-match-data

View file

@ -286,27 +286,60 @@ BUFFER defaults to current buffer. Does not modify BUFFER."
(defmacro ert-with-message-capture (var &rest body) (defmacro ert-with-message-capture (var &rest body)
"Execute BODY while collecting anything written with `message' in VAR. "Execute BODY while collecting messages in VAR.
Capture all messages produced by `message' when it is called from Capture messages issued by Lisp code and concatenate them
Lisp, and concatenate them separated by newlines into one string. separated by newlines into one string. This includes messages
written by `message' as well as objects printed by `print',
`prin1' and `princ' to the echo area. Messages issued from C
code using the above mentioned functions will not be captured.
This is useful for separating the issuance of messages by the This is useful for separating the issuance of messages by the
code under test from the behavior of the *Messages* buffer." code under test from the behavior of the *Messages* buffer."
(declare (debug (symbolp body)) (declare (debug (symbolp body))
(indent 1)) (indent 1))
(let ((g-advice (gensym))) (let ((g-message-advice (gensym))
(g-print-advice (gensym))
(g-collector (gensym)))
`(let* ((,var "") `(let* ((,var "")
(,g-advice (lambda (func &rest args) (,g-collector (lambda (msg) (setq ,var (concat ,var msg))))
(if (or (null args) (equal (car args) "")) (,g-message-advice (ert--make-message-advice ,g-collector))
(apply func args) (,g-print-advice (ert--make-print-advice ,g-collector)))
(let ((msg (apply #'format-message args))) (advice-add 'message :around ,g-message-advice)
(setq ,var (concat ,var msg "\n")) (advice-add 'prin1 :around ,g-print-advice)
(funcall func "%s" msg)))))) (advice-add 'princ :around ,g-print-advice)
(advice-add 'message :around ,g-advice) (advice-add 'print :around ,g-print-advice)
(unwind-protect (unwind-protect
(progn ,@body) (progn ,@body)
(advice-remove 'message ,g-advice))))) (advice-remove 'print ,g-print-advice)
(advice-remove 'princ ,g-print-advice)
(advice-remove 'prin1 ,g-print-advice)
(advice-remove 'message ,g-message-advice)))))
(defun ert--make-message-advice (collector)
"Create around advice for `message' for `ert-collect-messages'.
COLLECTOR will be called with the message before it is passed
to the real `message'."
(lambda (func &rest args)
(if (or (null args) (equal (car args) ""))
(apply func args)
(let ((msg (apply #'format-message args)))
(funcall collector (concat msg "\n"))
(funcall func "%s" msg)))))
(defun ert--make-print-advice (collector)
"Create around advice for print functions for `ert-collect-messages'.
The created advice function will just call the original function
unless the output is going to the echo area (when PRINTCHARFUN is
t or PRINTCHARFUN is nil and `standard-output' is t). If the
output is destined for the echo area, the advice function will
convert it to a string and pass it to COLLECTOR first."
(lambda (func object &optional printcharfun)
(if (not (eq t (or printcharfun standard-output)))
(funcall func object printcharfun)
(funcall collector (with-output-to-string
(funcall func object)))
(funcall func object printcharfun))))
(provide 'ert-x) (provide 'ert-x)

View file

@ -742,9 +742,8 @@ run. ARGS are the arguments to `debugger'."
;; backtrace ready for printing is important for batch ;; backtrace ready for printing is important for batch
;; use. ;; use.
;; ;;
;; Grab the frames starting from `signal', frames below ;; Grab the frames above the debugger.
;; that are all from the debugger. (backtrace (cdr (backtrace-frames debugger)))
(backtrace (backtrace-frames 'signal))
(infos (reverse ert--infos))) (infos (reverse ert--infos)))
(setf (ert--test-execution-info-result info) (setf (ert--test-execution-info-result info)
(cl-ecase type (cl-ecase type

View file

@ -1956,7 +1956,7 @@ E.g. provided via a file-local call to `smie-config-local'.")
(defvar smie-config--modefuns nil) (defvar smie-config--modefuns nil)
(defun smie-config--setter (var value) (defun smie-config--setter (var value)
(setq-default var value) (set-default var value)
(let ((old-modefuns smie-config--modefuns)) (let ((old-modefuns smie-config--modefuns))
(setq smie-config--modefuns nil) (setq smie-config--modefuns nil)
(pcase-dolist (`(,mode . ,rules) value) (pcase-dolist (`(,mode . ,rules) value)
@ -1982,7 +1982,7 @@ value with which to replace it."
;; FIXME improve value-type. ;; FIXME improve value-type.
:type '(choice (const nil) :type '(choice (const nil)
(alist :key-type symbol)) (alist :key-type symbol))
:initialize 'custom-initialize-default :initialize 'custom-initialize-set
:set #'smie-config--setter) :set #'smie-config--setter)
(defun smie-config-local (rules) (defun smie-config-local (rules)

View file

@ -128,7 +128,7 @@ binding value is nil. If all are non-nil, the value of THEN is
returned, or the last form in ELSE is returned. returned, or the last form in ELSE is returned.
Each element of VARLIST is a list (SYMBOL VALUEFORM) which binds Each element of VARLIST is a list (SYMBOL VALUEFORM) which binds
SYMBOL to the value of VALUEFORM). An element can additionally SYMBOL to the value of VALUEFORM. An element can additionally
be of the form (VALUEFORM), which is evaluated and checked for be of the form (VALUEFORM), which is evaluated and checked for
nil; i.e. SYMBOL can be omitted if only the test result is of nil; i.e. SYMBOL can be omitted if only the test result is of
interest." interest."

View file

@ -381,10 +381,26 @@ This function should move the cursor back to some syntactically safe
point (where the PPSS is equivalent to nil).") point (where the PPSS is equivalent to nil).")
(make-obsolete-variable 'syntax-begin-function nil "25.1") (make-obsolete-variable 'syntax-begin-function nil "25.1")
(defvar-local syntax-ppss-cache nil ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
"List of (POS . PPSS) pairs, in decreasing POS order.") ;; Several caches.
(defvar-local syntax-ppss-last nil ;;
"Cache of (LAST-POS . LAST-PPSS).") ;; Because `syntax-ppss' is equivalent to (parse-partial-sexp
;; (POINT-MIN) x), we need either to empty the cache when we narrow
;; the buffer, which is suboptimal, or we need to use several caches.
;; We use two of them, one for widened buffer, and one for narrowing.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar-local syntax-ppss-wide nil
"Cons of two elements (LAST . CACHE).
Where LAST is a pair (LAST-POS . LAST-PPS) caching the last invocation
and CACHE is a list of (POS . PPSS) pairs, in decreasing POS order.
These are valid when the buffer has no restriction.")
(defvar-local syntax-ppss-narrow nil
"Same as `syntax-ppss-wide' but for a narrowed buffer.")
(defvar-local syntax-ppss-narrow-start nil
"Start position of the narrowing for `syntax-ppss-narrow'.")
(defalias 'syntax-ppss-after-change-function 'syntax-ppss-flush-cache) (defalias 'syntax-ppss-after-change-function 'syntax-ppss-flush-cache)
(defun syntax-ppss-flush-cache (beg &rest ignored) (defun syntax-ppss-flush-cache (beg &rest ignored)
@ -392,24 +408,29 @@ point (where the PPSS is equivalent to nil).")
;; Set syntax-propertize to refontify anything past beg. ;; Set syntax-propertize to refontify anything past beg.
(setq syntax-propertize--done (min beg syntax-propertize--done)) (setq syntax-propertize--done (min beg syntax-propertize--done))
;; Flush invalid cache entries. ;; Flush invalid cache entries.
(while (and syntax-ppss-cache (> (caar syntax-ppss-cache) beg)) (dolist (cell (list syntax-ppss-wide syntax-ppss-narrow))
(setq syntax-ppss-cache (cdr syntax-ppss-cache))) (pcase cell
;; Throw away `last' value if made invalid. (`(,last . ,cache)
(when (< beg (or (car syntax-ppss-last) 0)) (while (and cache (> (caar cache) beg))
;; If syntax-begin-function jumped to BEG, then the old state at BEG can (setq cache (cdr cache)))
;; depend on the text after BEG (which is presumably changed). So if ;; Throw away `last' value if made invalid.
;; BEG=(car (nth 10 syntax-ppss-last)) don't reuse that data because the (when (< beg (or (car last) 0))
;; assumed nil state at BEG may not be valid any more. ;; If syntax-begin-function jumped to BEG, then the old state at BEG can
(if (<= beg (or (syntax-ppss-toplevel-pos (cdr syntax-ppss-last)) ;; depend on the text after BEG (which is presumably changed). So if
(nth 3 syntax-ppss-last) ;; BEG=(car (nth 10 syntax-ppss-last)) don't reuse that data because the
0)) ;; assumed nil state at BEG may not be valid any more.
(setq syntax-ppss-last nil) (if (<= beg (or (syntax-ppss-toplevel-pos (cdr last))
(setcar syntax-ppss-last nil))) (nth 3 last)
;; Unregister if there's no cache left. Sadly this doesn't work 0))
;; because `before-change-functions' is temporarily bound to nil here. (setq last nil)
;; (unless syntax-ppss-cache (setcar last nil)))
;; (remove-hook 'before-change-functions 'syntax-ppss-flush-cache t)) ;; Unregister if there's no cache left. Sadly this doesn't work
) ;; because `before-change-functions' is temporarily bound to nil here.
;; (unless cache
;; (remove-hook 'before-change-functions 'syntax-ppss-flush-cache t))
(setcar cell last)
(setcdr cell cache)))
))
(defvar syntax-ppss-stats (defvar syntax-ppss-stats
[(0 . 0.0) (0 . 0.0) (0 . 0.0) (0 . 0.0) (0 . 0.0) (1 . 2500.0)]) [(0 . 0.0) (0 . 0.0) (0 . 0.0) (0 . 0.0) (0 . 0.0) (1 . 2500.0)])
@ -423,6 +444,17 @@ point (where the PPSS is equivalent to nil).")
(defvar-local syntax-ppss-table nil (defvar-local syntax-ppss-table nil
"Syntax-table to use during `syntax-ppss', if any.") "Syntax-table to use during `syntax-ppss', if any.")
(defun syntax-ppss--data ()
(if (eq (point-min) 1)
(progn
(unless syntax-ppss-wide
(setq syntax-ppss-wide (cons nil nil)))
syntax-ppss-wide)
(unless (eq syntax-ppss-narrow-start (point-min))
(setq syntax-ppss-narrow-start (point-min))
(setq syntax-ppss-narrow (cons nil nil)))
syntax-ppss-narrow))
(defun syntax-ppss (&optional pos) (defun syntax-ppss (&optional pos)
"Parse-Partial-Sexp State at POS, defaulting to point. "Parse-Partial-Sexp State at POS, defaulting to point.
The returned value is the same as that of `parse-partial-sexp' The returned value is the same as that of `parse-partial-sexp'
@ -439,10 +471,13 @@ running the hook."
(syntax-propertize pos) (syntax-propertize pos)
;; ;;
(with-syntax-table (or syntax-ppss-table (syntax-table)) (with-syntax-table (or syntax-ppss-table (syntax-table))
(let ((old-ppss (cdr syntax-ppss-last)) (let* ((cell (syntax-ppss--data))
(old-pos (car syntax-ppss-last)) (ppss-last (car cell))
(ppss nil) (ppss-cache (cdr cell))
(pt-min (point-min))) (old-ppss (cdr ppss-last))
(old-pos (car ppss-last))
(ppss nil)
(pt-min (point-min)))
(if (and old-pos (> old-pos pos)) (setq old-pos nil)) (if (and old-pos (> old-pos pos)) (setq old-pos nil))
;; Use the OLD-POS if usable and close. Don't update the `last' cache. ;; Use the OLD-POS if usable and close. Don't update the `last' cache.
(condition-case nil (condition-case nil
@ -475,7 +510,7 @@ running the hook."
;; The OLD-* data can't be used. Consult the cache. ;; The OLD-* data can't be used. Consult the cache.
(t (t
(let ((cache-pred nil) (let ((cache-pred nil)
(cache syntax-ppss-cache) (cache ppss-cache)
(pt-min (point-min)) (pt-min (point-min))
;; I differentiate between PT-MIN and PT-BEST because ;; I differentiate between PT-MIN and PT-BEST because
;; I feel like it might be important to ensure that the ;; I feel like it might be important to ensure that the
@ -491,7 +526,7 @@ running the hook."
(if cache (setq pt-min (caar cache) ppss (cdar cache))) (if cache (setq pt-min (caar cache) ppss (cdar cache)))
;; Setup the before-change function if necessary. ;; Setup the before-change function if necessary.
(unless (or syntax-ppss-cache syntax-ppss-last) (unless (or ppss-cache ppss-last)
(add-hook 'before-change-functions (add-hook 'before-change-functions
'syntax-ppss-flush-cache t t)) 'syntax-ppss-flush-cache t t))
@ -541,7 +576,7 @@ running the hook."
pt-min (setq pt-min (/ (+ pt-min pos) 2)) pt-min (setq pt-min (/ (+ pt-min pos) 2))
nil nil ppss)) nil nil ppss))
(push (cons pt-min ppss) (push (cons pt-min ppss)
(if cache-pred (cdr cache-pred) syntax-ppss-cache))) (if cache-pred (cdr cache-pred) ppss-cache)))
;; Compute the actual return value. ;; Compute the actual return value.
(setq ppss (parse-partial-sexp pt-min pos nil nil ppss)) (setq ppss (parse-partial-sexp pt-min pos nil nil ppss))
@ -562,13 +597,15 @@ running the hook."
(if (> (- (caar cache-pred) pos) syntax-ppss-max-span) (if (> (- (caar cache-pred) pos) syntax-ppss-max-span)
(push pair (cdr cache-pred)) (push pair (cdr cache-pred))
(setcar cache-pred pair)) (setcar cache-pred pair))
(if (or (null syntax-ppss-cache) (if (or (null ppss-cache)
(> (- (caar syntax-ppss-cache) pos) (> (- (caar ppss-cache) pos)
syntax-ppss-max-span)) syntax-ppss-max-span))
(push pair syntax-ppss-cache) (push pair ppss-cache)
(setcar syntax-ppss-cache pair))))))))) (setcar ppss-cache pair)))))))))
(setq syntax-ppss-last (cons pos ppss)) (setq ppss-last (cons pos ppss))
(setcar cell ppss-last)
(setcdr cell ppss-cache)
ppss) ppss)
(args-out-of-range (args-out-of-range
;; If the buffer is more narrowed than when we built the cache, ;; If the buffer is more narrowed than when we built the cache,
@ -582,7 +619,7 @@ running the hook."
(defun syntax-ppss-debug () (defun syntax-ppss-debug ()
(let ((pt nil) (let ((pt nil)
(min-diffs nil)) (min-diffs nil))
(dolist (x (append syntax-ppss-cache (list (cons (point-min) nil)))) (dolist (x (append (cdr (syntax-ppss--data)) (list (cons (point-min) nil))))
(when pt (push (- pt (car x)) min-diffs)) (when pt (push (- pt (car x)) min-diffs))
(setq pt (car x))) (setq pt (car x)))
min-diffs)) min-diffs))

View file

@ -25,7 +25,7 @@
;;; Code: ;;; Code:
;;;###autoload ;;;###autoload
(defun timer-list (&optional _ignore-auto _nonconfirm) (defun list-timers (&optional _ignore-auto _nonconfirm)
"List all timers in a buffer." "List all timers in a buffer."
(interactive) (interactive)
(pop-to-buffer-same-window (get-buffer-create "*timer-list*")) (pop-to-buffer-same-window (get-buffer-create "*timer-list*"))
@ -67,7 +67,7 @@
(goto-char (point-min))) (goto-char (point-min)))
;; This command can be destructive if they don't know what they are ;; This command can be destructive if they don't know what they are
;; doing. Kids, don't try this at home! ;; doing. Kids, don't try this at home!
;;;###autoload (put 'timer-list 'disabled "Beware: manually canceling timers can ruin your Emacs session.") ;;;###autoload (put 'list-timers 'disabled "Beware: manually canceling timers can ruin your Emacs session.")
(defvar timer-list-mode-map (defvar timer-list-mode-map
(let ((map (make-sparse-keymap))) (let ((map (make-sparse-keymap)))
@ -84,7 +84,7 @@
(setq bidi-paragraph-direction 'left-to-right) (setq bidi-paragraph-direction 'left-to-right)
(setq truncate-lines t) (setq truncate-lines t)
(buffer-disable-undo) (buffer-disable-undo)
(setq-local revert-buffer-function 'timer-list) (setq-local revert-buffer-function #'list-timers)
(setq buffer-read-only t) (setq buffer-read-only t)
(setq header-line-format (setq header-line-format
(format "%4s %10s %8s %s" (format "%4s %10s %8s %s"

View file

@ -142,7 +142,7 @@ function `string-to-number'."
(defmacro eshell-condition-case (tag form &rest handlers) (defmacro eshell-condition-case (tag form &rest handlers)
"If `eshell-handle-errors' is non-nil, this is `condition-case'. "If `eshell-handle-errors' is non-nil, this is `condition-case'.
Otherwise, evaluates FORM with no error handling." Otherwise, evaluates FORM with no error handling."
(declare (indent 2)) (declare (indent 2) (debug (sexp form &rest form)))
(if eshell-handle-errors (if eshell-handle-errors
`(condition-case-unless-debug ,tag `(condition-case-unless-debug ,tag
,form ,form

View file

@ -150,8 +150,13 @@ Called with an absolute file name as argument, it returns t to enable backup.")
(defcustom buffer-offer-save nil (defcustom buffer-offer-save nil
"Non-nil in a buffer means always offer to save buffer on exit. "Non-nil in a buffer means always offer to save buffer on exit.
Do so even if the buffer is not visiting a file. Do so even if the buffer is not visiting a file.
Automatically local in all buffers." Automatically local in all buffers.
:type 'boolean
Set to the symbol `always' to offer to save buffer whenever
`save-some-buffers' is called."
:type '(choice (const :tag "Never" nil)
(const :tag "On Emacs exit" t)
(const :tag "Whenever save-some-buffers is called" always))
:group 'backup) :group 'backup)
(make-variable-buffer-local 'buffer-offer-save) (make-variable-buffer-local 'buffer-offer-save)
(put 'buffer-offer-save 'permanent-local t) (put 'buffer-offer-save 'permanent-local t)
@ -5190,12 +5195,9 @@ change the additional actions you can take on files."
(not (buffer-base-buffer buffer)) (not (buffer-base-buffer buffer))
(or (or
(buffer-file-name buffer) (buffer-file-name buffer)
(and pred (with-current-buffer buffer
(progn (or (eq buffer-offer-save 'always)
(set-buffer buffer) (and pred buffer-offer-save (> (buffer-size) 0)))))
(and buffer-offer-save (> (buffer-size) 0))))
(buffer-local-value
'write-contents-functions buffer))
(or (not (functionp pred)) (or (not (functionp pred))
(with-current-buffer buffer (funcall pred))) (with-current-buffer buffer (funcall pred)))
(if arg (if arg
@ -5336,7 +5338,7 @@ instance of such commands."
"Make directory DIR if it is not already a directory. Return nil." "Make directory DIR if it is not already a directory. Return nil."
(condition-case err (condition-case err
(make-directory-internal dir) (make-directory-internal dir)
(file-already-exists (error
(unless (file-directory-p dir) (unless (file-directory-p dir)
(signal (car err) (cdr err)))))) (signal (car err) (cdr err))))))
@ -5372,7 +5374,7 @@ raised."
(while (progn (while (progn
(setq parent (directory-file-name (setq parent (directory-file-name
(file-name-directory dir))) (file-name-directory dir)))
(condition-case err (condition-case ()
(files--ensure-directory dir) (files--ensure-directory dir)
(file-missing (file-missing
;; Do not loop if root does not exist (Bug#2309). ;; Do not loop if root does not exist (Bug#2309).
@ -5544,16 +5546,14 @@ into NEWNAME instead."
;; If NEWNAME is not a directory name, create it; ;; If NEWNAME is not a directory name, create it;
;; that is where we will copy the files of DIRECTORY. ;; that is where we will copy the files of DIRECTORY.
(make-directory newname parents)) (make-directory newname parents))
;; If NEWNAME is a directory name and COPY-CONTENTS ;; NEWNAME is a directory name. If COPY-CONTENTS is non-nil,
;; is nil, copy into NEWNAME/[DIRECTORY-BASENAME]. ;; create NEWNAME if it is not already a directory;
((not copy-contents) ;; otherwise, create NEWNAME/[DIRECTORY-BASENAME].
(setq newname (concat newname ((if copy-contents
(file-name-nondirectory directory))) (or parents (not (file-directory-p newname)))
(and (file-exists-p newname) (setq newname (concat newname
(not (file-directory-p newname)) (file-name-nondirectory directory))))
(error "Cannot overwrite non-directory %s with a directory" (make-directory (directory-file-name newname) parents)))
newname))
(make-directory newname t)))
;; Copy recursively. ;; Copy recursively.
(dolist (file (dolist (file
@ -5565,7 +5565,7 @@ into NEWNAME instead."
(filetype (car (file-attributes file)))) (filetype (car (file-attributes file))))
(cond (cond
((eq filetype t) ; Directory but not a symlink. ((eq filetype t) ; Directory but not a symlink.
(copy-directory file newname keep-time parents)) (copy-directory file target keep-time parents t))
((stringp filetype) ; Symbolic link ((stringp filetype) ; Symbolic link
(make-symbolic-link filetype target t)) (make-symbolic-link filetype target t))
((copy-file file target t keep-time))))) ((copy-file file target t keep-time)))))

View file

@ -604,11 +604,12 @@ new frame."
(select-frame (make-frame)))) (select-frame (make-frame))))
(defvar before-make-frame-hook nil (defvar before-make-frame-hook nil
"Functions to run before a frame is created.") "Functions to run before `make-frame' creates a new frame.")
(defvar after-make-frame-functions nil (defvar after-make-frame-functions nil
"Functions to run after a frame is created. "Functions to run after `make-frame' created a new frame.
The functions are run with one arg, the newly created frame.") The functions are run with one argument, the newly created
frame.")
(defvar after-setting-font-hook nil (defvar after-setting-font-hook nil
"Functions to run after a frame's font has been changed.") "Functions to run after a frame's font has been changed.")
@ -617,7 +618,7 @@ The functions are run with one arg, the newly created frame.")
(define-obsolete-function-alias 'new-frame 'make-frame "22.1") (define-obsolete-function-alias 'new-frame 'make-frame "22.1")
(defvar frame-inherited-parameters '() (defvar frame-inherited-parameters '()
"Parameters `make-frame' copies from the `selected-frame' to the new frame.") "Parameters `make-frame' copies from the selected to the new frame.")
(defvar x-display-name) (defvar x-display-name)
@ -632,9 +633,6 @@ form (NAME . VALUE), for example:
(width . NUMBER) The frame should be NUMBER characters in width. (width . NUMBER) The frame should be NUMBER characters in width.
(height . NUMBER) The frame should be NUMBER text lines high. (height . NUMBER) The frame should be NUMBER text lines high.
You cannot specify either `width' or `height', you must specify
neither or both.
(minibuffer . t) The frame should have a minibuffer. (minibuffer . t) The frame should have a minibuffer.
(minibuffer . nil) The frame should have no minibuffer. (minibuffer . nil) The frame should have no minibuffer.
(minibuffer . only) The frame should contain only a minibuffer. (minibuffer . only) The frame should contain only a minibuffer.
@ -650,10 +648,10 @@ neither or both.
In addition, any parameter specified in `default-frame-alist', In addition, any parameter specified in `default-frame-alist',
but not present in PARAMETERS, is applied. but not present in PARAMETERS, is applied.
Before creating the frame (via `frame-creation-function-alist'), Before creating the frame (via `frame-creation-function'), this
this function runs the hook `before-make-frame-hook'. After function runs the hook `before-make-frame-hook'. After creating
creating the frame, it runs the hook `after-make-frame-functions' the frame, it runs the hook `after-make-frame-functions' with one
with one arg, the newly created frame. argument, the newly created frame.
If a display parameter is supplied and a window-system is not, If a display parameter is supplied and a window-system is not,
guess the window-system from the display. guess the window-system from the display.

View file

@ -447,7 +447,7 @@ DO NOT MODIFY. See `frameset-filter-alist' for a full description.")
(buffer-predicate . :never) (buffer-predicate . :never)
(buried-buffer-list . :never) (buried-buffer-list . :never)
(delete-before . :never) (delete-before . :never)
(font . frameset-filter-shelve-param) (font . frameset-filter-font-param)
(foreground-color . frameset-filter-sanitize-color) (foreground-color . frameset-filter-sanitize-color)
(fullscreen . frameset-filter-shelve-param) (fullscreen . frameset-filter-shelve-param)
(GUI:font . frameset-filter-unshelve-param) (GUI:font . frameset-filter-unshelve-param)
@ -631,6 +631,17 @@ see `frameset-filter-alist'."
(setcdr found val) (setcdr found val)
nil)))) nil))))
(defun frameset-filter-font-param (current filtered parameters saving
&optional prefix)
"When switching from a tty frame to a GUI frame, remove the FONT param.
When switching from a GUI frame to a tty frame, behave
as `frameset-filter-shelve-param' does."
(or saving
(if (frameset-switch-to-gui-p parameters)
(frameset-filter-shelve-param current filtered parameters saving
prefix))))
(defun frameset-filter-iconified (_current _filtered parameters saving) (defun frameset-filter-iconified (_current _filtered parameters saving)
"Remove CURRENT when saving an iconified frame. "Remove CURRENT when saving an iconified frame.
This is used for positional parameters `left' and `top', which are This is used for positional parameters `left' and `top', which are

View file

@ -991,7 +991,6 @@ are replaced:
%F The first name if present, e.g.: \"John\", else fall %F The first name if present, e.g.: \"John\", else fall
back to the mail address. back to the mail address.
%L The last name if present, e.g.: \"Doe\". %L The last name if present, e.g.: \"Doe\".
%Z, %z The time zone in the numeric form, e.g.:\"+0000\".
All other format specifiers are passed to `format-time-string' All other format specifiers are passed to `format-time-string'
which is called using the date from the article your replying to, but which is called using the date from the article your replying to, but

View file

@ -1916,6 +1916,34 @@ CLICK position, kill the secondary selection."
(> (length str) 0) (> (length str) 0)
(gui-set-selection 'SECONDARY str)))) (gui-set-selection 'SECONDARY str))))
(defun secondary-selection-exist-p ()
"Return non-nil if the secondary selection exists in the current buffer."
(memq mouse-secondary-overlay (overlays-in (point-min) (point-max))))
(defun secondary-selection-to-region ()
"Set beginning and end of the region to those of the secondary selection.
This puts mark and point at the beginning and the end of the
secondary selection, respectively. This works when the secondary
selection exists and the region does not exist in current buffer;
the secondary selection will be deleted afterward.
If the region is active, or the secondary selection doesn't exist,
this function does nothing."
(when (and (not (region-active-p))
(secondary-selection-exist-p))
(let ((beg (overlay-start mouse-secondary-overlay))
(end (overlay-end mouse-secondary-overlay)))
(push-mark beg t t)
(goto-char end))
;; Delete the secondary selection on current buffer.
(delete-overlay mouse-secondary-overlay)))
(defun secondary-selection-from-region ()
"Set beginning and end of the secondary selection to those of the region.
When there is no region, this function does nothing."
(when (region-active-p) ; Create the secondary selection from the region.
(delete-overlay mouse-secondary-overlay) ; Delete the secondary selection even on a different buffer.
(move-overlay mouse-secondary-overlay (region-beginning) (region-end))))
(defcustom mouse-buffer-menu-maxlen 20 (defcustom mouse-buffer-menu-maxlen 20
"Number of buffers in one pane (submenu) of the buffer menu. "Number of buffers in one pane (submenu) of the buffer menu.

View file

@ -232,6 +232,7 @@ non-Windows systems."
;; When the double-mouse-N comes in, a mouse-N has been executed already, ;; When the double-mouse-N comes in, a mouse-N has been executed already,
;; So by adding things up we get a squaring up (1, 3, 6, 10, 15, ...). ;; So by adding things up we get a squaring up (1, 3, 6, 10, 15, ...).
(setq amt (* amt (event-click-count event)))) (setq amt (* amt (event-click-count event))))
(when (numberp amt) (setq amt (* amt (event-line-count event))))
(unwind-protect (unwind-protect
(let ((button (mwheel-event-button event))) (let ((button (mwheel-event-button event)))
(cond ((eq button mouse-wheel-down-event) (cond ((eq button mouse-wheel-down-event)

View file

@ -164,10 +164,14 @@ is consulted."
(non-viewer . t) (non-viewer . t)
(type . "application/zip") (type . "application/zip")
("copiousoutput")) ("copiousoutput"))
("pdf"
(viewer . pdf-view-mode)
(type . "application/pdf")
(test . window-system))
("pdf" ("pdf"
(viewer . doc-view-mode) (viewer . doc-view-mode)
(type . "application/pdf") (type . "application/pdf")
(test . (eq window-system 'x))) (test . window-system))
("pdf" ("pdf"
(viewer . "gv -safer %s") (viewer . "gv -safer %s")
(type . "application/pdf") (type . "application/pdf")

View file

@ -740,7 +740,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
;; Remote newname. ;; Remote newname.
(when (and (file-directory-p newname) (when (and (file-directory-p newname)
(directory-name-p newname)) (tramp-compat-directory-name-p newname))
(setq newname (setq newname
(expand-file-name (expand-file-name
(file-name-nondirectory filename) newname))) (file-name-nondirectory filename) newname)))

View file

@ -23,8 +23,9 @@
;;; Commentary: ;;; Commentary:
;; Tramp's main Emacs version for development is Emacs 26. This ;; Tramp's main Emacs version for development is Emacs 27. This
;; package provides compatibility functions for Emacs 24 and Emacs 25. ;; package provides compatibility functions for Emacs 24, Emacs 25 and
;; Emacs 26.
;;; Code: ;;; Code:
@ -104,6 +105,10 @@ Add the extension of F, if existing."
'tramp-error vec-or-proc 'tramp-error vec-or-proc
(if (fboundp 'user-error) 'user-error 'error) format args)) (if (fboundp 'user-error) 'user-error 'error) format args))
;; `default-toplevel-value' has been declared in Emacs 24.4.
(unless (fboundp 'default-toplevel-value)
(defalias 'default-toplevel-value 'symbol-value))
;; `file-attribute-*' are introduced in Emacs 25.1. ;; `file-attribute-*' are introduced in Emacs 25.1.
(if (fboundp 'file-attribute-type) (if (fboundp 'file-attribute-type)
@ -163,14 +168,23 @@ This is a floating point number if the size is too large for an integer."
This is a string of ten letters or dashes as in ls -l." This is a string of ten letters or dashes as in ls -l."
(nth 8 attributes))) (nth 8 attributes)))
;; `default-toplevel-value' has been declared in Emacs 24.4.
(unless (fboundp 'default-toplevel-value)
(defalias 'default-toplevel-value 'symbol-value))
;; `format-message' is new in Emacs 25.1. ;; `format-message' is new in Emacs 25.1.
(unless (fboundp 'format-message) (unless (fboundp 'format-message)
(defalias 'format-message 'format)) (defalias 'format-message 'format))
;; `directory-name-p' is new in Emacs 25.1.
(if (fboundp 'directory-name-p)
(defalias 'tramp-compat-directory-name-p 'directory-name-p)
(defsubst tramp-compat-directory-name-p (name)
"Return non-nil if NAME ends with a directory separator character."
(let ((len (length name))
(lastc ?.))
(if (> len 0)
(setq lastc (aref name (1- len))))
(or (= lastc ?/)
(and (memq system-type '(windows-nt ms-dos))
(= lastc ?\\))))))
;; `file-missing' is introduced in Emacs 26.1. ;; `file-missing' is introduced in Emacs 26.1.
(defconst tramp-file-missing (defconst tramp-file-missing
(if (get 'file-missing 'error-conditions) 'file-missing 'file-error) (if (get 'file-missing 'error-conditions) 'file-missing 'file-error)
@ -221,13 +235,6 @@ If NAME is a remote file name, the local part of NAME is unquoted."
((eq tramp-syntax 'sep) 'separate) ((eq tramp-syntax 'sep) 'separate)
(t tramp-syntax))) (t tramp-syntax)))
;; Older Emacsen keep incompatible autoloaded values of `tramp-syntax'.
(eval-after-load 'tramp
'(unless
(memq tramp-syntax (tramp-compat-funcall (quote tramp-syntax-values)))
(tramp-compat-funcall
(quote tramp-change-syntax) (tramp-compat-tramp-syntax))))
(provide 'tramp-compat) (provide 'tramp-compat)
;;; TODO: ;;; TODO:

View file

@ -613,7 +613,7 @@ use Cwd \"realpath\";
sub myrealpath { sub myrealpath {
my ($file) = @_; my ($file) = @_;
return realpath($file) if -e $file; return realpath($file) if (-e $file || -l $file);
} }
sub recursive { sub recursive {
@ -1139,12 +1139,7 @@ component is used as the target of the symlink."
(tramp-shell-quote-argument localname))) (tramp-shell-quote-argument localname)))
(with-current-buffer (tramp-get-connection-buffer v) (with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min)) (goto-char (point-min))
(setq result (buffer-substring (point-min) (point-at-eol)))) (setq result (buffer-substring (point-min) (point-at-eol)))))
(when (and (file-symlink-p filename)
(string-equal result localname))
(tramp-error
v 'file-error
"Apparent cycle of symbolic links for %s" filename)))
;; Use Perl implementation. ;; Use Perl implementation.
((and (tramp-get-remote-perl v) ((and (tramp-get-remote-perl v)
@ -1198,16 +1193,6 @@ component is used as the target of the symlink."
(setq numchase (1+ numchase)) (setq numchase (1+ numchase))
(when (file-name-absolute-p symlink-target) (when (file-name-absolute-p symlink-target)
(setq result nil)) (setq result nil))
;; If the symlink was absolute, we'll get a
;; string like "/user@host:/some/target";
;; extract the "/some/target" part from it.
(when (tramp-tramp-file-p symlink-target)
(unless (tramp-equal-remote filename symlink-target)
(tramp-error
v 'file-error
"Symlink target `%s' on wrong host"
symlink-target))
(setq symlink-target localname))
(setq steps (setq steps
(append (append
(split-string symlink-target "/" 'omit) steps))) (split-string symlink-target "/" 'omit) steps)))
@ -1226,6 +1211,13 @@ component is used as the target of the symlink."
"/")) "/"))
(when (string= "" result) (when (string= "" result)
(setq result "/"))))) (setq result "/")))))
;; Detect cycle.
(when (and (file-symlink-p filename)
(string-equal result localname))
(tramp-error
v 'file-error
"Apparent cycle of symbolic links for %s" filename))
;; If the resulting localname looks remote, we must quote it ;; If the resulting localname looks remote, we must quote it
;; for security reasons. ;; for security reasons.
(when (or quoted (file-remote-p result)) (when (or quoted (file-remote-p result))
@ -1985,7 +1977,7 @@ tramp-sh-handle-file-name-all-completions: internal error accessing `%s': `%s'"
;; scp or rsync DTRT. ;; scp or rsync DTRT.
(progn (progn
(when (and (file-directory-p newname) (when (and (file-directory-p newname)
(not (directory-name-p newname))) (not (tramp-compat-directory-name-p newname)))
(tramp-error v 'file-already-exists newname)) (tramp-error v 'file-already-exists newname))
(setq dirname (directory-file-name (expand-file-name dirname)) (setq dirname (directory-file-name (expand-file-name dirname))
newname (directory-file-name (expand-file-name newname))) newname (directory-file-name (expand-file-name newname)))

View file

@ -415,7 +415,7 @@ pass to the OPERATION."
(with-tramp-progress-reporter (with-tramp-progress-reporter
v 0 (format "Copying %s to %s" dirname newname) v 0 (format "Copying %s to %s" dirname newname)
(when (and (file-directory-p newname) (when (and (file-directory-p newname)
(not (directory-name-p newname))) (not (tramp-compat-directory-name-p newname)))
(tramp-error v 'file-already-exists newname)) (tramp-error v 'file-already-exists newname))
(cond (cond
;; We must use a local temporary directory. ;; We must use a local temporary directory.
@ -535,7 +535,7 @@ pass to the OPERATION."
;; Reset the transfer process properties. ;; Reset the transfer process properties.
(tramp-set-connection-property v "process-name" nil) (tramp-set-connection-property v "process-name" nil)
(tramp-set-connection-property v "process-buffer" nil) (tramp-set-connection-property v "process-buffer" nil)
(when t1 (delete-directory tmpdir 'recurse)))) (when t1 (delete-directory tmpdir 'recursive))))
;; Handle KEEP-DATE argument. ;; Handle KEEP-DATE argument.
(when keep-date (when keep-date
@ -586,7 +586,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
;; Remote newname. ;; Remote newname.
(when (and (file-directory-p newname) (when (and (file-directory-p newname)
(directory-name-p newname)) (tramp-compat-directory-name-p newname))
(setq newname (setq newname
(expand-file-name (file-name-nondirectory filename) newname))) (expand-file-name (file-name-nondirectory filename) newname)))
@ -1583,6 +1583,10 @@ If VEC has no cifs capabilities, exchange \"/\" by \"\\\\\"."
"Read entries which match DIRECTORY. "Read entries which match DIRECTORY.
Either the shares are listed, or the `dir' command is executed. Either the shares are listed, or the `dir' command is executed.
Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME YEAR)." Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME YEAR)."
;; If CIFS capabilities are enabled, symlinks are not listed
;; by `dir'. This is a consequence of
;; <https://www.samba.org/samba/news/symlink_attack.html>. See also
;; <https://bugzilla.samba.org/show_bug.cgi?id=5116>.
(with-parsed-tramp-file-name (file-name-as-directory directory) nil (with-parsed-tramp-file-name (file-name-as-directory directory) nil
(setq localname (or localname "/")) (setq localname (or localname "/"))
(with-tramp-file-property v localname "file-entries" (with-tramp-file-property v localname "file-entries"

View file

@ -3169,7 +3169,7 @@ User is always nil."
(defun tramp-handle-file-truename (filename) (defun tramp-handle-file-truename (filename)
"Like `file-truename' for Tramp files." "Like `file-truename' for Tramp files."
(let ((result filename) (let ((result (expand-file-name filename))
(numchase 0) (numchase 0)
;; Don't make the following value larger than ;; Don't make the following value larger than
;; necessary. People expect an error message in a ;; necessary. People expect an error message in a
@ -3180,7 +3180,7 @@ User is always nil."
symlink-target) symlink-target)
(format (format
"%s%s" "%s%s"
(with-parsed-tramp-file-name (expand-file-name result) v1 (with-parsed-tramp-file-name result v1
(with-tramp-file-property v1 v1-localname "file-truename" (with-tramp-file-property v1 v1-localname "file-truename"
(while (and (setq symlink-target (file-symlink-p result)) (while (and (setq symlink-target (file-symlink-p result))
(< numchase numchase-limit)) (< numchase numchase-limit))
@ -3850,7 +3850,7 @@ Erase echoed commands if exists."
(min (+ (point-min) tramp-echo-mark-marker-length) (min (+ (point-min) tramp-echo-mark-marker-length)
(point-max)))))) (point-max))))))
;; No echo to be handled, now we can look for the regexp. ;; No echo to be handled, now we can look for the regexp.
;; Sometimes, lines are much to long, and we run into a "Stack ;; Sometimes, lines are much too long, and we run into a "Stack
;; overflow in regexp matcher". For example, //DIRED// lines of ;; overflow in regexp matcher". For example, //DIRED// lines of
;; directory listings with some thousand files. Therefore, we ;; directory listings with some thousand files. Therefore, we
;; look from the end. ;; look from the end.
@ -4547,16 +4547,23 @@ Only works for Bourne-like shells."
(t process))) (t process)))
pid) pid)
;; If it's a Tramp process, send the INT signal remotely. ;; If it's a Tramp process, send the INT signal remotely.
(when (and (processp proc) (process-live-p proc) (when (and (processp proc) (setq pid (process-get proc 'remote-pid)))
(setq pid (process-get proc 'remote-pid))) (if (not (process-live-p proc))
(tramp-message proc 5 "Interrupt process %s with pid %s" proc pid) (tramp-error proc 'error "Process %s is not active" proc)
;; This is for tramp-sh.el. Other backends do not support this (yet). (tramp-message proc 5 "Interrupt process %s with pid %s" proc pid)
(tramp-compat-funcall ;; This is for tramp-sh.el. Other backends do not support this (yet).
'tramp-send-command (tramp-compat-funcall
(tramp-get-connection-property proc "vector" nil) 'tramp-send-command
(format "kill -2 %d" pid)) (tramp-get-connection-property proc "vector" nil)
;; Report success. (format "kill -2 %d" pid))
proc))) ;; Wait, until the process has disappeared.
(with-timeout
(1 (tramp-error proc 'error "Process %s did not interrupt" proc))
(while (process-live-p proc)
;; We cannot run `tramp-accept-process-output', it blocks timers.
(accept-process-output proc 0.1)))
;; Report success.
proc))))
;; `interrupt-process-functions' exists since Emacs 26.1. ;; `interrupt-process-functions' exists since Emacs 26.1.
(when (boundp 'interrupt-process-functions) (when (boundp 'interrupt-process-functions)

View file

@ -7,7 +7,7 @@
;; Maintainer: Michael Albinus <michael.albinus@gmx.de> ;; Maintainer: Michael Albinus <michael.albinus@gmx.de>
;; Keywords: comm, processes ;; Keywords: comm, processes
;; Package: tramp ;; Package: tramp
;; Version: 2.3.3-pre ;; Version: 2.3.3.26.1
;; This file is part of GNU Emacs. ;; This file is part of GNU Emacs.
@ -33,7 +33,7 @@
;; should be changed only there. ;; should be changed only there.
;;;###tramp-autoload ;;;###tramp-autoload
(defconst tramp-version "2.3.3-pre" (defconst tramp-version "2.3.3.26.1"
"This version of Tramp.") "This version of Tramp.")
;;;###tramp-autoload ;;;###tramp-autoload
@ -55,7 +55,7 @@
;; Check for Emacs version. ;; Check for Emacs version.
(let ((x (if (>= emacs-major-version 24) (let ((x (if (>= emacs-major-version 24)
"ok" "ok"
(format "Tramp 2.3.3-pre is not fit for %s" (format "Tramp 2.3.3.26.1 is not fit for %s"
(when (string-match "^.*$" (emacs-version)) (when (string-match "^.*$" (emacs-version))
(match-string 0 (emacs-version))))))) (match-string 0 (emacs-version)))))))
(unless (string-match "\\`ok\\'" x) (error "%s" x))) (unless (string-match "\\`ok\\'" x) (error "%s" x)))
@ -69,7 +69,8 @@
("2.2.3-24.1" . "24.1") ("2.2.3-24.1" . "24.2") ("2.2.6-24.3" . "24.3") ("2.2.3-24.1" . "24.1") ("2.2.3-24.1" . "24.2") ("2.2.6-24.3" . "24.3")
("2.2.9-24.4" . "24.4") ("2.2.11-24.5" . "24.5") ("2.2.9-24.4" . "24.4") ("2.2.11-24.5" . "24.5")
("2.2.13.25.1" . "25.1") ("2.2.13.25.2" . "25.2") ("2.2.13.25.1" . "25.1") ("2.2.13.25.2" . "25.2")
("2.2.13.25.2" . "25.3"))) ("2.2.13.25.2" . "25.3")
("2.3.3.26.1" . "26.1")))
(add-hook 'tramp-unload-hook (add-hook 'tramp-unload-hook
(lambda () (lambda ()

View file

@ -5015,10 +5015,10 @@
* ox-latex.el (org-latex-listings): Update docstring. * ox-latex.el (org-latex-listings): Update docstring.
* org-pcomplete.el (pcomplete/org-mode/file-option/options): * org-pcomplete.el (pcomplete/org-mode/file-option/options):
Apply changes to export back-end definiton. Apply changes to export back-end definition.
* org.el (org-get-export-keywords): Apply changes to export * org.el (org-get-export-keywords): Apply changes to export
back-end definiton. back-end definition.
* ox-html.el (org-html--format-toc-headline): Make use of * ox-html.el (org-html--format-toc-headline): Make use of
anonymous back-ends. anonymous back-ends.

View file

@ -84,11 +84,11 @@
. 'bat-label-face) . 'bat-label-face)
("\\_<\\(defined\\|set\\)\\_>[ \t]*\\(\\(\\sw\\|\\s_\\)+\\)" ("\\_<\\(defined\\|set\\)\\_>[ \t]*\\(\\(\\sw\\|\\s_\\)+\\)"
(2 font-lock-variable-name-face)) (2 font-lock-variable-name-face))
("%\\(\\(\\sw\\|\\s_\\)+\\)%" ("%\\([^%~ \n]+\\)%?"
(1 font-lock-variable-name-face)) (1 font-lock-variable-name-face))
("!\\(\\(\\sw\\|\\s_\\)+\\)!" ; delayed-expansion !variable! ("!\\([^!%~ \n]+\\)!?" ; delayed-expansion !variable!
(1 font-lock-variable-name-face)) (1 font-lock-variable-name-face))
("%%\\(?:~[adfnpstxz]*\\(?:\\$\\(\\(?:\\sw\\|\\s_\\)+\\):\\)?\\)?\\([]!#$&-:?-[_-{}~]\\)" ("%%\\(?:~[adfnpstxz]*\\(?:\\$\\(\\(?:\\sw\\|\\s_\\|_\\)+\\):\\)?\\)?\\([]!#$&-:?-[_-{}~]\\)"
(1 font-lock-variable-name-face nil t) ; PATH expansion (1 font-lock-variable-name-face nil t) ; PATH expansion
(2 font-lock-variable-name-face)) ; iteration variable or positional parameter (2 font-lock-variable-name-face)) ; iteration variable or positional parameter
("[ =][-/]+\\(\\w+\\)" ("[ =][-/]+\\(\\w+\\)"

File diff suppressed because it is too large Load diff

View file

@ -1,634 +0,0 @@
;;; flymake-ui.el --- A universal on-the-fly syntax checker -*- lexical-binding: t; -*-
;; Copyright (C) 2003-2017 Free Software Foundation, Inc.
;; Author: Pavel Kobyakov <pk_at_work@yahoo.com>
;; Maintainer: Leo Liu <sdl.web@gmail.com>
;; Version: 0.3
;; Keywords: c languages tools
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; Flymake is a minor Emacs mode performing on-the-fly syntax checks.xo
;;
;; This file contains the UI for displaying and interacting with the
;; results of such checks, as well as entry points for backends to
;; hook on to. Backends are sources of diagnostic info.
;;
;;; Code:
(eval-when-compile (require 'cl-lib))
(defgroup flymake nil
"Universal on-the-fly syntax checker."
:version "23.1"
:link '(custom-manual "(flymake) Top")
:group 'tools)
(defcustom flymake-error-bitmap '(exclamation-mark error)
"Bitmap (a symbol) used in the fringe for indicating errors.
The value may also be a list of two elements where the second
element specifies the face for the bitmap. For possible bitmap
symbols, see `fringe-bitmaps'. See also `flymake-warning-bitmap'.
The option `flymake-fringe-indicator-position' controls how and where
this is used."
:group 'flymake
:version "24.3"
:type '(choice (symbol :tag "Bitmap")
(list :tag "Bitmap and face"
(symbol :tag "Bitmap")
(face :tag "Face"))))
(defcustom flymake-warning-bitmap 'question-mark
"Bitmap (a symbol) used in the fringe for indicating warnings.
The value may also be a list of two elements where the second
element specifies the face for the bitmap. For possible bitmap
symbols, see `fringe-bitmaps'. See also `flymake-error-bitmap'.
The option `flymake-fringe-indicator-position' controls how and where
this is used."
:group 'flymake
:version "24.3"
:type '(choice (symbol :tag "Bitmap")
(list :tag "Bitmap and face"
(symbol :tag "Bitmap")
(face :tag "Face"))))
(defcustom flymake-fringe-indicator-position 'left-fringe
"The position to put flymake fringe indicator.
The value can be nil (do not use indicators), `left-fringe' or `right-fringe'.
See `flymake-error-bitmap' and `flymake-warning-bitmap'."
:group 'flymake
:version "24.3"
:type '(choice (const left-fringe)
(const right-fringe)
(const :tag "No fringe indicators" nil)))
(defcustom flymake-start-syntax-check-on-newline t
"Start syntax check if newline char was added/removed from the buffer."
:group 'flymake
:type 'boolean)
(defcustom flymake-no-changes-timeout 0.5
"Time to wait after last change before starting compilation."
:group 'flymake
:type 'number)
(defcustom flymake-gui-warnings-enabled t
"Enables/disables GUI warnings."
:group 'flymake
:type 'boolean)
(make-obsolete-variable 'flymake-gui-warnings-enabled
"it no longer has any effect." "26.1")
(defcustom flymake-start-syntax-check-on-find-file t
"Start syntax check on find file."
:group 'flymake
:type 'boolean)
(defcustom flymake-log-level -1
"Logging level, only messages with level lower or equal will be logged.
-1 = NONE, 0 = ERROR, 1 = WARNING, 2 = INFO, 3 = DEBUG"
:group 'flymake
:type 'integer)
(defcustom flymake-backends '()
"Ordered list of backends providing syntax check information for a buffer.
Value is an alist of conses (PREDICATE . CHECKER). Both PREDICATE
and CHECKER are functions called with a single argument, the
buffer in which `flymake-mode' was enabled. PREDICATE is expected
to (quickly) return t or nil if the buffer can be syntax checked
by CHECKER, which in can performs more morose operations,
possibly asynchronously."
:group 'flymake
:type 'alist)
(defvar-local flymake-timer nil
"Timer for starting syntax check.")
(defvar-local flymake-last-change-time nil
"Time of last buffer change.")
(defvar-local flymake-check-start-time nil
"Time at which syntax check was started.")
(defvar-local flymake-check-was-interrupted nil
"Non-nil if syntax check was killed by `flymake-compile'.")
(defvar-local flymake-err-info nil
"Sorted list of line numbers and lists of err info in the form (file, err-text).")
(defvar-local flymake-new-err-info nil
"Same as `flymake-err-info', effective when a syntax check is in progress.")
(defun flymake-log (level text &rest args)
"Log a message at level LEVEL.
If LEVEL is higher than `flymake-log-level', the message is
ignored. Otherwise, it is printed using `message'.
TEXT is a format control string, and the remaining arguments ARGS
are the string substitutions (see the function `format')."
(if (<= level flymake-log-level)
(let* ((msg (apply #'format-message text args)))
(message "%s" msg))))
(defun flymake-ins-after (list pos val)
"Insert VAL into LIST after position POS.
POS counts from zero."
(let ((tmp (copy-sequence list)))
(setcdr (nthcdr pos tmp) (cons val (nthcdr (1+ pos) tmp)))
tmp))
(defun flymake-set-at (list pos val)
"Set VAL at position POS in LIST.
POS counts from zero."
(let ((tmp (copy-sequence list)))
(setcar (nthcdr pos tmp) val)
tmp))
(defun flymake-er-make-er (line-no line-err-info-list)
(list line-no line-err-info-list))
(defun flymake-er-get-line (err-info)
(nth 0 err-info))
(defun flymake-er-get-line-err-info-list (err-info)
(nth 1 err-info))
(cl-defstruct (flymake-ler
(:constructor nil)
(:constructor flymake-ler-make-ler (file line type text &optional full-file)))
file line type text full-file)
(defun flymake-ler-set-file (line-err-info file)
(flymake-ler-make-ler file
(flymake-ler-line line-err-info)
(flymake-ler-type line-err-info)
(flymake-ler-text line-err-info)
(flymake-ler-full-file line-err-info)))
(defun flymake-ler-set-full-file (line-err-info full-file)
(flymake-ler-make-ler (flymake-ler-file line-err-info)
(flymake-ler-line line-err-info)
(flymake-ler-type line-err-info)
(flymake-ler-text line-err-info)
full-file))
(defun flymake-ler-set-line (line-err-info line)
(flymake-ler-make-ler (flymake-ler-file line-err-info)
line
(flymake-ler-type line-err-info)
(flymake-ler-text line-err-info)
(flymake-ler-full-file line-err-info)))
(defun flymake-get-line-err-count (line-err-info-list type)
"Return number of errors of specified TYPE.
Value of TYPE is either \"e\" or \"w\"."
(let* ((idx 0)
(count (length line-err-info-list))
(err-count 0))
(while (< idx count)
(when (equal type (flymake-ler-type (nth idx line-err-info-list)))
(setq err-count (1+ err-count)))
(setq idx (1+ idx)))
err-count))
(defun flymake-get-err-count (err-info-list type)
"Return number of errors of specified TYPE for ERR-INFO-LIST."
(let* ((idx 0)
(count (length err-info-list))
(err-count 0))
(while (< idx count)
(setq err-count (+ err-count (flymake-get-line-err-count (nth 1 (nth idx err-info-list)) type)))
(setq idx (1+ idx)))
err-count))
(defun flymake-highlight-err-lines (err-info-list)
"Highlight error lines in BUFFER using info from ERR-INFO-LIST."
(save-excursion
(dolist (err err-info-list)
(flymake-highlight-line (car err) (nth 1 err)))))
(defun flymake-overlay-p (ov)
"Determine whether overlay OV was created by flymake."
(and (overlayp ov) (overlay-get ov 'flymake-overlay)))
(defun flymake-make-overlay (beg end tooltip-text face bitmap)
"Allocate a flymake overlay in range BEG and END."
(when (not (flymake-region-has-flymake-overlays beg end))
(let ((ov (make-overlay beg end nil t))
(fringe (and flymake-fringe-indicator-position
(propertize "!" 'display
(cons flymake-fringe-indicator-position
(if (listp bitmap)
bitmap
(list bitmap)))))))
(overlay-put ov 'face face)
(overlay-put ov 'help-echo tooltip-text)
(overlay-put ov 'flymake-overlay t)
(overlay-put ov 'priority 100)
(overlay-put ov 'evaporate t)
(overlay-put ov 'before-string fringe)
;;+(flymake-log 3 "created overlay %s" ov)
ov)
(flymake-log 3 "created an overlay at (%d-%d)" beg end)))
(defun flymake-delete-own-overlays ()
"Delete all flymake overlays in BUFFER."
(dolist (ol (overlays-in (point-min) (point-max)))
(when (flymake-overlay-p ol)
(delete-overlay ol)
;;+(flymake-log 3 "deleted overlay %s" ol)
)))
(defun flymake-region-has-flymake-overlays (beg end)
"Check if region specified by BEG and END has overlay.
Return t if it has at least one flymake overlay, nil if no overlay."
(let ((ov (overlays-in beg end))
(has-flymake-overlays nil))
(while (consp ov)
(when (flymake-overlay-p (car ov))
(setq has-flymake-overlays t))
(setq ov (cdr ov)))
has-flymake-overlays))
(defface flymake-errline
'((((supports :underline (:style wave)))
:underline (:style wave :color "Red1"))
(t
:inherit error))
"Face used for marking error lines."
:version "24.4"
:group 'flymake)
(defface flymake-warnline
'((((supports :underline (:style wave)))
:underline (:style wave :color "DarkOrange"))
(t
:inherit warning))
"Face used for marking warning lines."
:version "24.4"
:group 'flymake)
(defun flymake-highlight-line (line-no line-err-info-list)
"Highlight line LINE-NO in current buffer.
Perhaps use text from LINE-ERR-INFO-LIST to enhance highlighting."
(goto-char (point-min))
(forward-line (1- line-no))
(pcase-let* ((beg (progn (back-to-indentation) (point)))
(end (progn
(end-of-line)
(skip-chars-backward " \t\f\t\n" beg)
(if (eq (point) beg)
(line-beginning-position 2)
(point))))
(tooltip-text (mapconcat #'flymake-ler-text line-err-info-list "\n"))
(`(,face ,bitmap)
(if (> (flymake-get-line-err-count line-err-info-list "e") 0)
(list 'flymake-errline flymake-error-bitmap)
(list 'flymake-warnline flymake-warning-bitmap))))
(flymake-make-overlay beg end tooltip-text face bitmap)))
(defun flymake-find-err-info (err-info-list line-no)
"Find (line-err-info-list pos) for specified LINE-NO."
(if err-info-list
(let* ((line-err-info-list nil)
(pos 0)
(count (length err-info-list)))
(while (and (< pos count) (< (car (nth pos err-info-list)) line-no))
(setq pos (1+ pos)))
(when (and (< pos count) (equal (car (nth pos err-info-list)) line-no))
(setq line-err-info-list (flymake-er-get-line-err-info-list (nth pos err-info-list))))
(list line-err-info-list pos))
'(nil 0)))
(defun flymake-line-err-info-is-less-or-equal (line-one line-two)
(or (string< (flymake-ler-type line-one) (flymake-ler-type line-two))
(and (string= (flymake-ler-type line-one) (flymake-ler-type line-two))
(not (flymake-ler-file line-one)) (flymake-ler-file line-two))
(and (string= (flymake-ler-type line-one) (flymake-ler-type line-two))
(or (and (flymake-ler-file line-one) (flymake-ler-file line-two))
(and (not (flymake-ler-file line-one)) (not (flymake-ler-file line-two)))))))
(defun flymake-add-line-err-info (line-err-info-list line-err-info)
"Update LINE-ERR-INFO-LIST with the error LINE-ERR-INFO.
For the format of LINE-ERR-INFO, see `flymake-ler-make-ler'.
The new element is inserted in the proper position, according to
the predicate `flymake-line-err-info-is-less-or-equal'.
The updated value of LINE-ERR-INFO-LIST is returned."
(if (not line-err-info-list)
(list line-err-info)
(let* ((count (length line-err-info-list))
(idx 0))
(while (and (< idx count) (flymake-line-err-info-is-less-or-equal (nth idx line-err-info-list) line-err-info))
(setq idx (1+ idx)))
(cond ((equal 0 idx) (setq line-err-info-list (cons line-err-info line-err-info-list)))
(t (setq line-err-info-list (flymake-ins-after line-err-info-list (1- idx) line-err-info))))
line-err-info-list)))
(defun flymake-add-err-info (err-info-list line-err-info)
"Update ERR-INFO-LIST with the error LINE-ERR-INFO, preserving sort order.
Returns the updated value of ERR-INFO-LIST.
For the format of ERR-INFO-LIST, see `flymake-err-info'.
For the format of LINE-ERR-INFO, see `flymake-ler-make-ler'."
(let* ((line-no (if (flymake-ler-file line-err-info) 1 (flymake-ler-line line-err-info)))
(info-and-pos (flymake-find-err-info err-info-list line-no))
(exists (car info-and-pos))
(pos (nth 1 info-and-pos))
(line-err-info-list nil)
(err-info nil))
(if exists
(setq line-err-info-list (flymake-er-get-line-err-info-list (car (nthcdr pos err-info-list)))))
(setq line-err-info-list (flymake-add-line-err-info line-err-info-list line-err-info))
(setq err-info (flymake-er-make-er line-no line-err-info-list))
(cond (exists (setq err-info-list (flymake-set-at err-info-list pos err-info)))
((equal 0 pos) (setq err-info-list (cons err-info err-info-list)))
(t (setq err-info-list (flymake-ins-after err-info-list (1- pos) err-info))))
err-info-list))
(defvar-local flymake-is-running nil
"If t, flymake syntax check process is running for the current buffer.")
(defun flymake-on-timer-event (buffer)
"Start a syntax check for buffer BUFFER if necessary."
(when (buffer-live-p buffer)
(with-current-buffer buffer
(when (and (not flymake-is-running)
flymake-last-change-time
(> (- (float-time) flymake-last-change-time)
flymake-no-changes-timeout))
(setq flymake-last-change-time nil)
(flymake-log 3 "starting syntax check as more than 1 second passed since last change")
(flymake--start-syntax-check)))))
(define-obsolete-function-alias 'flymake-display-err-menu-for-current-line
'flymake-popup-current-error-menu "24.4")
(defun flymake-popup-current-error-menu (&optional event)
"Pop up a menu with errors/warnings for current line."
(interactive (list last-nonmenu-event))
(let* ((line-no (line-number-at-pos))
(errors (or (car (flymake-find-err-info flymake-err-info line-no))
(user-error "No errors for current line")))
(menu (mapcar (lambda (x)
(if (flymake-ler-file x)
(cons (format "%s - %s(%d)"
(flymake-ler-text x)
(flymake-ler-file x)
(flymake-ler-line x))
x)
(list (flymake-ler-text x))))
errors))
(event (if (mouse-event-p event)
event
(list 'mouse-1 (posn-at-point))))
(title (format "Line %d: %d error(s), %d warning(s)"
line-no
(flymake-get-line-err-count errors "e")
(flymake-get-line-err-count errors "w")))
(choice (x-popup-menu event (list title (cons "" menu)))))
(flymake-log 3 "choice=%s" choice)
(when choice
(flymake-goto-file-and-line (flymake-ler-full-file choice)
(flymake-ler-line choice)))))
(defun flymake-goto-file-and-line (file line)
"Try to get buffer for FILE and goto line LINE in it."
(if (not (file-exists-p file))
(flymake-log 1 "File %s does not exist" file)
(find-file file)
(goto-char (point-min))
(forward-line (1- line))))
;; flymake minor mode declarations
(defvar-local flymake-mode-line nil)
(defvar-local flymake-mode-line-e-w nil)
(defvar-local flymake-mode-line-status nil)
(defun flymake-report-status (e-w &optional status)
"Show status in mode line."
(when e-w
(setq flymake-mode-line-e-w e-w))
(when status
(setq flymake-mode-line-status status))
(let* ((mode-line " Flymake"))
(when (> (length flymake-mode-line-e-w) 0)
(setq mode-line (concat mode-line ":" flymake-mode-line-e-w)))
(setq mode-line (concat mode-line flymake-mode-line-status))
(setq flymake-mode-line mode-line)
(force-mode-line-update)))
;; Nothing in flymake uses this at all any more, so this is just for
;; third-party compatibility.
(define-obsolete-function-alias 'flymake-display-warning 'message-box "26.1")
(defun flymake-report-fatal-status (status warning)
"Display a warning and switch flymake mode off."
;; This first message was always shown by default, and flymake-log
;; does nothing by default, hence the use of message.
;; Another option is display-warning.
(if (< flymake-log-level 0)
(message "Flymake: %s. Flymake will be switched OFF" warning))
(flymake-mode 0)
(flymake-log 0 "switched OFF Flymake mode for buffer %s due to fatal status %s, warning %s"
(buffer-name) status warning))
(defvar-local flymake--backend nil
"The currently active backend selected by `flymake-mode'")
(defun flymake--can-syntax-check-buffer (buffer)
(let ((all flymake-backends)
(candidate))
(catch 'done
(while (setq candidate (pop all))
(when (with-current-buffer buffer (funcall (car candidate)))
(throw 'done (cdr candidate)))))))
(defun flymake--start-syntax-check ()
(funcall flymake--backend))
;;;###autoload
(define-minor-mode flymake-mode nil
:group 'flymake :lighter flymake-mode-line
(cond
;; Turning the mode ON.
(flymake-mode
(let* ((backend (flymake--can-syntax-check-buffer (current-buffer))))
(cond
((not backend)
(flymake-log 2 "flymake cannot check syntax in buffer %s" (buffer-name)))
(t
(setq flymake--backend backend)
(add-hook 'after-change-functions 'flymake-after-change-function nil t)
(add-hook 'after-save-hook 'flymake-after-save-hook nil t)
(add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook nil t)
;;+(add-hook 'find-file-hook 'flymake-find-file-hook)
(flymake-report-status "" "")
(setq flymake-timer
(run-at-time nil 1 'flymake-on-timer-event (current-buffer)))
(when (and flymake-start-syntax-check-on-find-file
;; Since we write temp files in current dir, there's no point
;; trying if the directory is read-only (bug#8954).
(file-writable-p (file-name-directory buffer-file-name)))
(with-demoted-errors
(flymake--start-syntax-check)))))
)
)
;; Turning the mode OFF.
(t
(setq flymake--backend nil)
(remove-hook 'after-change-functions 'flymake-after-change-function t)
(remove-hook 'after-save-hook 'flymake-after-save-hook t)
(remove-hook 'kill-buffer-hook 'flymake-kill-buffer-hook t)
;;+(remove-hook 'find-file-hook (function flymake-find-file-hook) t)
(flymake-delete-own-overlays)
(when flymake-timer
(cancel-timer flymake-timer)
(setq flymake-timer nil))
(setq flymake-is-running nil))))
;; disabling flymake-mode is safe, enabling - not necessarily so
(put 'flymake-mode 'safe-local-variable 'null)
;;;###autoload
(defun flymake-mode-on ()
"Turn flymake mode on."
(flymake-mode 1)
(flymake-log 1 "flymake mode turned ON for buffer %s" (buffer-name)))
;;;###autoload
(defun flymake-mode-off ()
"Turn flymake mode off."
(flymake-mode 0)
(flymake-log 1 "flymake mode turned OFF for buffer %s" (buffer-name)))
(defun flymake-after-change-function (start stop _len)
"Start syntax check for current buffer if it isn't already running."
;;+(flymake-log 0 "setting change time to %s" (float-time))
(let((new-text (buffer-substring start stop)))
(when (and flymake-start-syntax-check-on-newline (equal new-text "\n"))
(flymake-log 3 "starting syntax check as new-line has been seen")
(flymake--start-syntax-check))
(setq flymake-last-change-time (float-time))))
(defun flymake-after-save-hook ()
(if (local-variable-p 'flymake-mode (current-buffer)) ; (???) other way to determine whether flymake is active in buffer being saved?
(progn
(flymake-log 3 "starting syntax check as buffer was saved")
(flymake--start-syntax-check)))) ; no more mode 3. cannot start check if mode 3 (to temp copies) is active - (???)
(defun flymake-kill-buffer-hook ()
(when flymake-timer
(cancel-timer flymake-timer)
(setq flymake-timer nil)))
;;;###autoload
(defun flymake-find-file-hook ()
;;+(when flymake-start-syntax-check-on-find-file
;;+ (flymake-log 3 "starting syntax check on file open")
;;+ (flymake--start-syntax-check)
;;+)
(when (and (not (local-variable-p 'flymake-mode (current-buffer)))
(flymake--can-syntax-check-buffer (current-buffer)))
(flymake-mode)
(flymake-log 3 "automatically turned ON flymake mode")))
(defun flymake-get-first-err-line-no (err-info-list)
"Return first line with error."
(when err-info-list
(flymake-er-get-line (car err-info-list))))
(defun flymake-get-last-err-line-no (err-info-list)
"Return last line with error."
(when err-info-list
(flymake-er-get-line (nth (1- (length err-info-list)) err-info-list))))
(defun flymake-get-next-err-line-no (err-info-list line-no)
"Return next line with error."
(when err-info-list
(let* ((count (length err-info-list))
(idx 0))
(while (and (< idx count) (>= line-no (flymake-er-get-line (nth idx err-info-list))))
(setq idx (1+ idx)))
(if (< idx count)
(flymake-er-get-line (nth idx err-info-list))))))
(defun flymake-get-prev-err-line-no (err-info-list line-no)
"Return previous line with error."
(when err-info-list
(let* ((count (length err-info-list)))
(while (and (> count 0) (<= line-no (flymake-er-get-line (nth (1- count) err-info-list))))
(setq count (1- count)))
(if (> count 0)
(flymake-er-get-line (nth (1- count) err-info-list))))))
(defun flymake-skip-whitespace ()
"Move forward until non-whitespace is reached."
(while (looking-at "[ \t]")
(forward-char)))
(defun flymake-goto-line (line-no)
"Go to line LINE-NO, then skip whitespace."
(goto-char (point-min))
(forward-line (1- line-no))
(flymake-skip-whitespace))
(defun flymake-goto-next-error ()
"Go to next error in err ring."
(interactive)
(let ((line-no (flymake-get-next-err-line-no flymake-err-info (line-number-at-pos))))
(when (not line-no)
(setq line-no (flymake-get-first-err-line-no flymake-err-info))
(flymake-log 1 "passed end of file"))
(if line-no
(flymake-goto-line line-no)
(flymake-log 1 "no errors in current buffer"))))
(defun flymake-goto-prev-error ()
"Go to previous error in err ring."
(interactive)
(let ((line-no (flymake-get-prev-err-line-no flymake-err-info (line-number-at-pos))))
(when (not line-no)
(setq line-no (flymake-get-last-err-line-no flymake-err-info))
(flymake-log 1 "passed beginning of file"))
(if line-no
(flymake-goto-line line-no)
(flymake-log 1 "no errors in current buffer"))))
(defun flymake-patch-err-text (string)
(if (string-match "^[\n\t :0-9]*\\(.*\\)$" string)
(match-string 1 string)
string))
(provide 'flymake-ui)
;;; flymake-ui.el ends here

File diff suppressed because it is too large Load diff

View file

@ -4271,8 +4271,10 @@ See `python-check-command' for the default."
import inspect import inspect
try: try:
str_type = basestring str_type = basestring
argspec_function = inspect.getargspec
except NameError: except NameError:
str_type = str str_type = str
argspec_function = inspect.getfullargspec
if isinstance(obj, str_type): if isinstance(obj, str_type):
obj = eval(obj, globals()) obj = eval(obj, globals())
doc = inspect.getdoc(obj) doc = inspect.getdoc(obj)
@ -4285,9 +4287,7 @@ See `python-check-command' for the default."
target = obj target = obj
objtype = 'def' objtype = 'def'
if target: if target:
args = inspect.formatargspec( args = inspect.formatargspec(*argspec_function(target))
*inspect.getargspec(target)
)
name = obj.__name__ name = obj.__name__
doc = '{objtype} {name}{args}'.format( doc = '{objtype} {name}{args}'.format(
objtype=objtype, name=name, args=args objtype=objtype, name=name, args=args

View file

@ -593,11 +593,7 @@ sign. See `sh-feature'."
(sexp :format "Evaluate: %v")))) (sexp :format "Evaluate: %v"))))
:group 'sh-script) :group 'sh-script)
(define-obsolete-variable-alias 'sh-indentation 'sh-basic-offset "26.1")
(defcustom sh-indentation 4
"The width for further indentation in Shell-Script mode."
:type 'integer
:group 'sh-script)
(put 'sh-indentation 'safe-local-variable 'integerp) (put 'sh-indentation 'safe-local-variable 'integerp)
(defcustom sh-remember-variable-min 3 (defcustom sh-remember-variable-min 3
@ -1617,7 +1613,7 @@ with your script for an edit-interpret-debug cycle."
(setq-local skeleton-pair-alist '((?` _ ?`))) (setq-local skeleton-pair-alist '((?` _ ?`)))
(setq-local skeleton-pair-filter-function 'sh-quoted-p) (setq-local skeleton-pair-filter-function 'sh-quoted-p)
(setq-local skeleton-further-elements (setq-local skeleton-further-elements
'((< '(- (min sh-indentation (current-column)))))) '((< '(- (min sh-basic-offset (current-column))))))
(setq-local skeleton-filter-function 'sh-feature) (setq-local skeleton-filter-function 'sh-feature)
(setq-local skeleton-newline-indent-rigidly t) (setq-local skeleton-newline-indent-rigidly t)
(setq-local defun-prompt-regexp (setq-local defun-prompt-regexp
@ -2012,7 +2008,7 @@ May return nil if the line should not be treated as continued."
(forward-line -1) (forward-line -1)
(if (sh-smie--looking-back-at-continuation-p) (if (sh-smie--looking-back-at-continuation-p)
(current-indentation) (current-indentation)
(+ (current-indentation) sh-indentation)))) (+ (current-indentation) sh-basic-offset))))
(t (t
;; Just make sure a line-continuation is indented deeper. ;; Just make sure a line-continuation is indented deeper.
(save-excursion (save-excursion
@ -2033,13 +2029,13 @@ May return nil if the line should not be treated as continued."
;; check the line before that one. ;; check the line before that one.
(> ci indent)) (> ci indent))
(t ;Previous line is the beginning of the continued line. (t ;Previous line is the beginning of the continued line.
(setq indent (min (+ ci sh-indentation) max)) (setq indent (min (+ ci sh-basic-offset) max))
nil))))) nil)))))
indent)))))) indent))))))
(defun sh-smie-sh-rules (kind token) (defun sh-smie-sh-rules (kind token)
(pcase (cons kind token) (pcase (cons kind token)
(`(:elem . basic) sh-indentation) (`(:elem . basic) sh-basic-offset)
(`(:after . "case-)") (- (sh-var-value 'sh-indent-for-case-alt) (`(:after . "case-)") (- (sh-var-value 'sh-indent-for-case-alt)
(sh-var-value 'sh-indent-for-case-label))) (sh-var-value 'sh-indent-for-case-label)))
(`(:before . ,(or `"(" `"{" `"[" "while" "if" "for" "case")) (`(:before . ,(or `"(" `"{" `"[" "while" "if" "for" "case"))
@ -2248,8 +2244,8 @@ Point should be before the newline."
(defun sh-smie-rc-rules (kind token) (defun sh-smie-rc-rules (kind token)
(pcase (cons kind token) (pcase (cons kind token)
(`(:elem . basic) sh-indentation) (`(:elem . basic) sh-basic-offset)
;; (`(:after . "case") (or sh-indentation smie-indent-basic)) ;; (`(:after . "case") (or sh-basic-offset smie-indent-basic))
(`(:after . ";") (`(:after . ";")
(if (smie-rule-parent-p "case") (if (smie-rule-parent-p "case")
(smie-rule-parent (sh-var-value 'sh-indent-after-case)))) (smie-rule-parent (sh-var-value 'sh-indent-after-case))))
@ -2490,7 +2486,7 @@ the value thus obtained, and the result is used instead."
(defun sh-basic-indent-line () (defun sh-basic-indent-line ()
"Indent a line for Sh mode (shell script mode). "Indent a line for Sh mode (shell script mode).
Indent as far as preceding non-empty line, then by steps of `sh-indentation'. Indent as far as preceding non-empty line, then by steps of `sh-basic-offset'.
Lines containing only comments are considered empty." Lines containing only comments are considered empty."
(interactive) (interactive)
(let ((previous (save-excursion (let ((previous (save-excursion
@ -2514,9 +2510,9 @@ Lines containing only comments are considered empty."
(delete-region (point) (delete-region (point)
(progn (beginning-of-line) (point))) (progn (beginning-of-line) (point)))
(if (eolp) (if (eolp)
(max previous (* (1+ (/ current sh-indentation)) (max previous (* (1+ (/ current sh-basic-offset))
sh-indentation)) sh-basic-offset))
(* (1+ (/ current sh-indentation)) sh-indentation)))))) (* (1+ (/ current sh-basic-offset)) sh-basic-offset))))))
(if (< (current-column) (current-indentation)) (if (< (current-column) (current-indentation))
(skip-chars-forward " \t")))) (skip-chars-forward " \t"))))
@ -3594,6 +3590,10 @@ so that `occur-next' and `occur-prev' will work."
(defun sh-learn-buffer-indent (&optional arg) (defun sh-learn-buffer-indent (&optional arg)
"Learn how to indent the buffer the way it currently is. "Learn how to indent the buffer the way it currently is.
If `sh-use-smie' is non-nil, call `smie-config-guess'.
Otherwise, run the sh-script specific indent learning command, as
decribed below.
Output in buffer \"*indent*\" shows any lines which have conflicting Output in buffer \"*indent*\" shows any lines which have conflicting
values of a variable, and the final value of all variables learned. values of a variable, and the final value of all variables learned.
When called interactively, pop to this buffer automatically if When called interactively, pop to this buffer automatically if
@ -3610,8 +3610,7 @@ to the value of variable `sh-learn-basic-offset'.
Abnormal hook `sh-learned-buffer-hook' if non-nil is called when the Abnormal hook `sh-learned-buffer-hook' if non-nil is called when the
function completes. The function is abnormal because it is called function completes. The function is abnormal because it is called
with an alist of variables learned. This feature may be changed or with an alist of variables learned.
removed in the future.
This command can often take a long time to run." This command can often take a long time to run."
(interactive "P") (interactive "P")
@ -3809,7 +3808,6 @@ This command can often take a long time to run."
" has" "s have") " has" "s have")
(if (zerop num-diffs) (if (zerop num-diffs)
"." ":")))))) "." ":"))))))
;; Are abnormal hooks considered bad form?
(run-hook-with-args 'sh-learned-buffer-hook learned-var-list) (run-hook-with-args 'sh-learned-buffer-hook learned-var-list)
(and (called-interactively-p 'any) (and (called-interactively-p 'any)
(or sh-popup-occur-buffer (> num-diffs 0)) (or sh-popup-occur-buffer (> num-diffs 0))

View file

@ -928,12 +928,14 @@ IGNORES is a list of glob patterns."
files files
(expand-file-name dir) (expand-file-name dir)
ignores)) ignores))
(def default-directory)
(buf (get-buffer-create " *xref-grep*")) (buf (get-buffer-create " *xref-grep*"))
(`(,grep-re ,file-group ,line-group . ,_) (car grep-regexp-alist)) (`(,grep-re ,file-group ,line-group . ,_) (car grep-regexp-alist))
(status nil) (status nil)
(hits nil)) (hits nil))
(with-current-buffer buf (with-current-buffer buf
(erase-buffer) (erase-buffer)
(setq default-directory def)
(setq status (setq status
(call-process-shell-command command nil t)) (call-process-shell-command command nil t))
(goto-char (point-min)) (goto-char (point-min))

View file

@ -39,11 +39,11 @@
(defcustom shell-command-dont-erase-buffer nil (defcustom shell-command-dont-erase-buffer nil
"If non-nil, output buffer is not erased between shell commands. "If non-nil, output buffer is not erased between shell commands.
Also, a non-nil value set the point in the output buffer Also, a non-nil value sets the point in the output buffer
once the command complete. once the command completes.
The value `beg-last-out' set point at the beginning of the output, The value `beg-last-out' sets point at the beginning of the output,
`end-last-out' set point at the end of the buffer, `save-point' `end-last-out' sets point at the end of the buffer, `save-point'
restore the buffer position before the command." restores the buffer position before the command."
:type '(choice :type '(choice
(const :tag "Erase buffer" nil) (const :tag "Erase buffer" nil)
(const :tag "Set point to beginning of last output" beg-last-out) (const :tag "Set point to beginning of last output" beg-last-out)
@ -53,9 +53,9 @@ restore the buffer position before the command."
:version "26.1") :version "26.1")
(defvar shell-command-saved-pos nil (defvar shell-command-saved-pos nil
"Point position in the output buffer after command complete. "Point position in the output buffer after command completes.
It is an alist (BUFFER . POS), where BUFFER is the output It is an alist of (BUFFER . POS), where BUFFER is the output
buffer, and POS is the point position in BUFFER once the command finish. buffer, and POS is the point position in BUFFER once the command finishes.
This variable is used when `shell-command-dont-erase-buffer' is non-nil.") This variable is used when `shell-command-dont-erase-buffer' is non-nil.")
(defcustom idle-update-delay 0.5 (defcustom idle-update-delay 0.5
@ -434,10 +434,6 @@ A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'."
;; Do the rest in post-self-insert-hook, because we want to do it ;; Do the rest in post-self-insert-hook, because we want to do it
;; *before* other functions on that hook. ;; *before* other functions on that hook.
(lambda () (lambda ()
;; We are not going to insert any newlines if arg is
;; non-positive.
(or (and (numberp arg) (<= arg 0))
(cl-assert (eq ?\n (char-before))))
;; Mark the newline(s) `hard'. ;; Mark the newline(s) `hard'.
(if use-hard-newlines (if use-hard-newlines
(set-hard-newline-properties (set-hard-newline-properties
@ -456,25 +452,22 @@ A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'."
;; starts a page. ;; starts a page.
(or was-page-start (or was-page-start
(move-to-left-margin nil t))))) (move-to-left-margin nil t)))))
(unwind-protect (if (not interactive)
(if (not interactive) ;; FIXME: For non-interactive uses, many calls actually
;; FIXME: For non-interactive uses, many calls actually ;; just want (insert "\n"), so maybe we should do just
;; just want (insert "\n"), so maybe we should do just ;; that, so as to avoid the risk of filling or running
;; that, so as to avoid the risk of filling or running ;; abbrevs unexpectedly.
;; abbrevs unexpectedly. (let ((post-self-insert-hook (list postproc)))
(let ((post-self-insert-hook (list postproc))) (self-insert-command arg))
(self-insert-command arg)) (unwind-protect
(unwind-protect (progn
(progn (add-hook 'post-self-insert-hook postproc nil t)
(add-hook 'post-self-insert-hook postproc nil t) (self-insert-command arg))
(self-insert-command arg)) ;; We first used let-binding to protect the hook, but that
;; We first used let-binding to protect the hook, but that ;; was naive since add-hook affects the symbol-default
;; was naive since add-hook affects the symbol-default ;; value of the variable, whereas the let-binding might
;; value of the variable, whereas the let-binding might ;; only protect the buffer-local value.
;; only protect the buffer-local value. (remove-hook 'post-self-insert-hook postproc t))))
(remove-hook 'post-self-insert-hook postproc t)))
(cl-assert (not (member postproc post-self-insert-hook)))
(cl-assert (not (member postproc (default-value 'post-self-insert-hook))))))
nil) nil)
(defun set-hard-newline-properties (from to) (defun set-hard-newline-properties (from to)
@ -1010,7 +1003,7 @@ Called with one argument METHOD.
If METHOD is `delete-only', then delete the region; the return value If METHOD is `delete-only', then delete the region; the return value
is undefined. If METHOD is nil, then return the content as a string. is undefined. If METHOD is nil, then return the content as a string.
If METHOD is `bounds', then return the boundaries of the region If METHOD is `bounds', then return the boundaries of the region
as a list of the form (START . END). as a list of pairs of (START . END) positions.
If METHOD is anything else, delete the region and return its content If METHOD is anything else, delete the region and return its content
as a string, after filtering it with `filter-buffer-substring', which as a string, after filtering it with `filter-buffer-substring', which
is called with METHOD as its 3rd argument.") is called with METHOD as its 3rd argument.")
@ -5480,7 +5473,7 @@ also checks the value of `use-empty-active-region'."
(progn (cl-assert (mark)) t))) (progn (cl-assert (mark)) t)))
(defun region-bounds () (defun region-bounds ()
"Return the boundaries of the region as a list of (START . END) positions." "Return the boundaries of the region as a list of pairs of (START . END) positions."
(funcall region-extract-function 'bounds)) (funcall region-extract-function 'bounds))
(defun region-noncontiguous-p () (defun region-noncontiguous-p ()

View file

@ -289,7 +289,7 @@ The name is made by appending `gensym-counter' to PREFIX.
PREFIX is a string, and defaults to \"g\"." PREFIX is a string, and defaults to \"g\"."
(let ((num (prog1 gensym-counter (let ((num (prog1 gensym-counter
(setq gensym-counter (1+ gensym-counter))))) (setq gensym-counter (1+ gensym-counter)))))
(make-symbol (format "%s%d" prefix num)))) (make-symbol (format "%s%d" (or prefix "g") num))))
(defun ignore (&rest _ignore) (defun ignore (&rest _ignore)
"Do nothing and return nil. "Do nothing and return nil.
@ -1270,6 +1270,11 @@ See `event-start' for a description of the value returned."
"Return the multi-click count of EVENT, a click or drag event. "Return the multi-click count of EVENT, a click or drag event.
The return value is a positive integer." The return value is a positive integer."
(if (and (consp event) (integerp (nth 2 event))) (nth 2 event) 1)) (if (and (consp event) (integerp (nth 2 event))) (nth 2 event) 1))
(defsubst event-line-count (event)
"Return the line count of EVENT, a mousewheel event.
The return value is a positive integer."
(if (and (consp event) (integerp (nth 3 event))) (nth 3 event) 1))
;;;; Extracting fields of the positions in an event. ;;;; Extracting fields of the positions in an event.

View file

@ -736,6 +736,25 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
(global-unset-key [horizontal-scroll-bar drag-mouse-1]) (global-unset-key [horizontal-scroll-bar drag-mouse-1])
;;;; macOS-like defaults for trackpad and mouse wheel scrolling on
;;;; macOS 10.7+.
;; FIXME: This doesn't look right. Is there a better way to do this
;; that keeps customize happy?
(let ((appkit-version (progn
(string-match "^appkit-\\([^\s-]*\\)" ns-version-string)
(string-to-number (match-string 1 ns-version-string)))))
;; Appkit 1138 ~= macOS 10.7.
(when (and (featurep 'cocoa) (>= appkit-version 1138))
(setq mouse-wheel-scroll-amount '(1 ((shift) . 5) ((control))))
(put 'mouse-wheel-scroll-amount 'customized-value
(list (custom-quote (symbol-value 'mouse-wheel-scroll-amount))))
(setq mouse-wheel-progressive-speed nil)
(put 'mouse-wheel-progressive-speed 'customized-value
(list (custom-quote (symbol-value 'mouse-wheel-progressive-speed))))))
;;;; Color support. ;;;; Color support.
;; Functions for color panel + drag ;; Functions for color panel + drag

View file

@ -1578,7 +1578,7 @@ to look up will be substituted there."
(goto-char (point-min)) (goto-char (point-min))
(let ((window (get-buffer-window (current-buffer) 'visible))) (let ((window (get-buffer-window (current-buffer) 'visible)))
(when window (when window
(when (re-search-forward "^Summary" nil 'move) (when (re-search-forward "^\\(Summary\\|Syntax\\)" nil 'move)
(beginning-of-line) (beginning-of-line)
(set-window-start window (point)))))) (set-window-start window (point))))))

View file

@ -1492,8 +1492,10 @@ This is passed to the Ispell process using the `-p' switch.")
(assoc ispell-current-dictionary ispell-local-dictionary-alist) (assoc ispell-current-dictionary ispell-local-dictionary-alist)
(assoc ispell-current-dictionary ispell-dictionary-alist) (assoc ispell-current-dictionary ispell-dictionary-alist)
(error "No data for dictionary \"%s\" in `ispell-local-dictionary-alist' or `ispell-dictionary-alist'" (error "No data for dictionary \"%s\" in `ispell-local-dictionary-alist' or `ispell-dictionary-alist'"
ispell-current-dictionary)))) ispell-current-dictionary)))
(decode-coding-string (nth n slot) (ispell-get-coding-system) t))) (str (nth n slot)))
(if (stringp str)
(decode-coding-string str (ispell-get-coding-system) t))))
(defun ispell-get-casechars () (defun ispell-get-casechars ()
(ispell-get-decoded-string 1)) (ispell-get-decoded-string 1))

View file

@ -583,6 +583,7 @@ directory for only the accessible portion of the buffer."
(with-output-to-temp-buffer pages-directory-buffer (with-output-to-temp-buffer pages-directory-buffer
(with-current-buffer standard-output (with-current-buffer standard-output
(pages-directory-mode) (pages-directory-mode)
(setq buffer-read-only nil)
(insert (insert
"==== Pages Directory: use `C-c C-c' to go to page under cursor. ====" ?\n) "==== Pages Directory: use `C-c C-c' to go to page under cursor. ====" ?\n)
(setq pages-buffer pages-target-buffer) (setq pages-buffer pages-target-buffer)
@ -631,6 +632,7 @@ directory for only the accessible portion of the buffer."
))))) )))))
(set-buffer standard-output) (set-buffer standard-output)
(setq buffer-read-only t)
;; Put positions in increasing order to go with buffer. ;; Put positions in increasing order to go with buffer.
(setq pages-pos-list (nreverse pages-pos-list)) (setq pages-pos-list (nreverse pages-pos-list))
(if (called-interactively-p 'interactive) (if (called-interactively-p 'interactive)

View file

@ -608,10 +608,16 @@ considered file(s)."
(log-view-diff-common beg end t))) (log-view-diff-common beg end t)))
(defun log-view-diff-common (beg end &optional whole-changeset) (defun log-view-diff-common (beg end &optional whole-changeset)
(let ((to (log-view-current-tag beg)) (let* ((to (log-view-current-tag beg))
(fr (log-view-current-tag end))) (fr-entry (log-view-current-entry end))
(when (string-equal fr to) (fr (cadr fr-entry)))
;; TO and FR are the same, look at the previous revision. ;; When TO and FR are the same, or when point is on a line after
;; the last entry, look at the previous revision.
(when (or (string-equal fr to)
(>= (point)
(save-excursion
(goto-char (car fr-entry))
(forward-line))))
(setq fr (vc-call-backend log-view-vc-backend 'previous-revision nil fr))) (setq fr (vc-call-backend log-view-vc-backend 'previous-revision nil fr)))
(vc-diff-internal (vc-diff-internal
t (list log-view-vc-backend t (list log-view-vc-backend

View file

@ -725,7 +725,7 @@ this keeps \"UUU\"."
(let ((i 3)) (let ((i 3))
(while (or (not (match-end i)) (while (or (not (match-end i))
(< (point) (match-beginning i)) (< (point) (match-beginning i))
(>= (point) (match-end i))) (> (point) (match-end i)))
(cl-decf i)) (cl-decf i))
i)) i))

View file

@ -1035,6 +1035,7 @@ If LIMIT is non-nil, show no more than this many entries."
(defun vc-git-log-outgoing (buffer remote-location) (defun vc-git-log-outgoing (buffer remote-location)
(interactive) (interactive)
(vc-setup-buffer buffer)
(vc-git-command (vc-git-command
buffer 'async nil buffer 'async nil
"log" "log"
@ -1048,6 +1049,7 @@ If LIMIT is non-nil, show no more than this many entries."
(defun vc-git-log-incoming (buffer remote-location) (defun vc-git-log-incoming (buffer remote-location)
(interactive) (interactive)
(vc-setup-buffer buffer)
(vc-git-command nil 0 nil "fetch") (vc-git-command nil 0 nil "fetch")
(vc-git-command (vc-git-command
buffer 'async nil buffer 'async nil

View file

@ -84,7 +84,7 @@
(defun xdg-thumb-uri (filename) (defun xdg-thumb-uri (filename)
"Return the canonical URI for FILENAME. "Return the canonical URI for FILENAME.
If FILENAME has absolute path /foo/bar.jpg, its canonical URI is If FILENAME has absolute file name /foo/bar.jpg, its canonical URI is
file:///foo/bar.jpg" file:///foo/bar.jpg"
(concat "file://" (expand-file-name filename))) (concat "file://" (expand-file-name filename)))
@ -197,8 +197,6 @@ Optional argument GROUP defaults to the string \"Desktop Entry\"."
(unless (looking-at xdg-desktop-group-regexp) (unless (looking-at xdg-desktop-group-regexp)
(error "Expected group name! Instead saw: %s" (error "Expected group name! Instead saw: %s"
(buffer-substring (point) (point-at-eol)))) (buffer-substring (point) (point-at-eol))))
(unless (equal (match-string 1) "Desktop Entry")
(error "Wrong first group: %s" (match-string 1)))
(when group (when group
(while (and (re-search-forward xdg-desktop-group-regexp nil t) (while (and (re-search-forward xdg-desktop-group-regexp nil t)
(not (equal (match-string 1) group))))) (not (equal (match-string 1) group)))))

View file

@ -44,12 +44,12 @@ AC_DEFUN([gl_FUNC_ALLOCA],
AC_DEFUN([gl_PREREQ_ALLOCA], [:]) AC_DEFUN([gl_PREREQ_ALLOCA], [:])
# This works around a bug in autoconf <= 2.68. # This works around a bug in autoconf <= 2.68.
# See <http://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00277.html>. # See <https://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00277.html>.
m4_version_prereq([2.69], [] ,[ m4_version_prereq([2.69], [] ,[
# This is taken from the following Autoconf patch: # This is taken from the following Autoconf patch:
# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497 # https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=6cd9f12520b0d6f76d3230d7565feba1ecf29497
# _AC_LIBOBJ_ALLOCA # _AC_LIBOBJ_ALLOCA
# ----------------- # -----------------

View file

@ -11,7 +11,7 @@ AC_DEFUN([gl_EXTERN_INLINE],
[/* Please see the Gnulib manual for how to use these macros. [/* Please see the Gnulib manual for how to use these macros.
Suppress extern inline with HP-UX cc, as it appears to be broken; see Suppress extern inline with HP-UX cc, as it appears to be broken; see
<http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>. <https://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
Suppress extern inline with Sun C in standards-conformance mode, as it Suppress extern inline with Sun C in standards-conformance mode, as it
mishandles inline functions that call each other. E.g., for 'inline void f mishandles inline functions that call each other. E.g., for 'inline void f
@ -28,16 +28,16 @@ AC_DEFUN([gl_EXTERN_INLINE],
from calling static functions. This bug is known to occur on: from calling static functions. This bug is known to occur on:
OS X 10.8 and earlier; see: OS X 10.8 and earlier; see:
http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html https://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html
DragonFly; see DragonFly; see
http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log
FreeBSD; see: FreeBSD; see:
http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html https://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html
OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
for clang but remains for g++; see <http://trac.macports.org/ticket/41033>. for clang but remains for g++; see <https://trac.macports.org/ticket/41033>.
Assume DragonFly and FreeBSD will be similar. */ Assume DragonFly and FreeBSD will be similar. */
#if (((defined __APPLE__ && defined __MACH__) \ #if (((defined __APPLE__ && defined __MACH__) \
|| defined __DragonFly__ || defined __FreeBSD__) \ || defined __DragonFly__ || defined __FreeBSD__) \

View file

@ -20,7 +20,7 @@ AC_DEFUN([gl_FUNC_FSTATAT],
HAVE_FSTATAT=0 HAVE_FSTATAT=0
else else
dnl Test for an AIX 7.1 bug; see dnl Test for an AIX 7.1 bug; see
dnl <http://lists.gnu.org/archive/html/bug-tar/2011-09/msg00015.html>. dnl <https://lists.gnu.org/archive/html/bug-tar/2011-09/msg00015.html>.
AC_CACHE_CHECK([whether fstatat (..., 0) works], AC_CACHE_CHECK([whether fstatat (..., 0) works],
[gl_cv_func_fstatat_zero_flag], [gl_cv_func_fstatat_zero_flag],
[AC_RUN_IFELSE( [AC_RUN_IFELSE(

View file

@ -228,13 +228,13 @@ m4_ifndef([AS_VAR_IF],
# This is like AC_PROG_CC_C99, except that # This is like AC_PROG_CC_C99, except that
# - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60, # - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60,
# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC # - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC
# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00367.html>, # <https://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00367.html>,
# but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99 # but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99
# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00441.html>. # <https://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00441.html>.
# Remaining problems: # Remaining problems:
# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options # - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options
# to CC twice # to CC twice
# <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00431.html>. # <https://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00431.html>.
# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard. # - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard.
AC_DEFUN([gl_PROG_CC_C99], AC_DEFUN([gl_PROG_CC_C99],
[ [

View file

@ -1,4 +1,4 @@
# manywarnings.m4 serial 12 # manywarnings.m4 serial 13
dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -267,18 +267,23 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
# gcc --help=warnings outputs an unusual form for these options; list # gcc --help=warnings outputs an unusual form for these options; list
# them here so that the above 'comm' command doesn't report a false match. # them here so that the above 'comm' command doesn't report a false match.
# Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal # Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal.
# and AC_COMPUTE_INT requires it to fit in a long: # Also, AC_COMPUTE_INT requires it to fit in a long; it is 2**63 on
# the only platforms where it does not fit in a long, so make that
# a special case.
AC_MSG_CHECKING([max safe object size]) AC_MSG_CHECKING([max safe object size])
AC_COMPUTE_INT([gl_alloc_max], AC_COMPUTE_INT([gl_alloc_max],
[(LONG_MAX < PTRDIFF_MAX ? LONG_MAX : PTRDIFF_MAX) < (size_t) -1 [LONG_MAX < (PTRDIFF_MAX < (size_t) -1 ? PTRDIFF_MAX : (size_t) -1)
? (LONG_MAX < PTRDIFF_MAX ? LONG_MAX : PTRDIFF_MAX) ? -1
: (size_t) -1], : PTRDIFF_MAX < (size_t) -1 ? (long) PTRDIFF_MAX : (long) (size_t) -1],
[[#include <limits.h> [[#include <limits.h>
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
]], ]],
[gl_alloc_max=2147483647]) [gl_alloc_max=2147483647])
case $gl_alloc_max in
-1) gl_alloc_max=9223372036854775807;;
esac
AC_MSG_RESULT([$gl_alloc_max]) AC_MSG_RESULT([$gl_alloc_max])
gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$gl_alloc_max" gl_manywarn_set="$gl_manywarn_set -Walloc-size-larger-than=$gl_alloc_max"
gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2" gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2"

View file

@ -369,7 +369,7 @@ dnl just the module. Instead, define the (private) symbol
dnl _STDC_C99, which suppresses a bogus failure in <stdbool.h>. dnl _STDC_C99, which suppresses a bogus failure in <stdbool.h>.
dnl The resulting compiler passes the test case here, and that's dnl The resulting compiler passes the test case here, and that's
dnl good enough. For more, please see the thread starting at: dnl good enough. For more, please see the thread starting at:
dnl http://lists.gnu.org/archive/html/autoconf/2010-12/msg00059.html dnl https://lists.gnu.org/archive/html/autoconf/2010-12/msg00059.html
dnl Tru64 -c99 dnl Tru64 -c99
dnl with extended modes being tried first. dnl with extended modes being tried first.
[[-std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99]], [$1], [$2])[]dnl [[-std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc1x -qlanglvl=extc99]], [$1], [$2])[]dnl
@ -458,7 +458,7 @@ dnl preferably extc11.
# -------------- # --------------
# Do not use AU_ALIAS here and in AC_PROG_CC_C99 and AC_PROG_CC_STDC, # Do not use AU_ALIAS here and in AC_PROG_CC_C99 and AC_PROG_CC_STDC,
# as that'd be incompatible with how Automake redefines AC_PROG_CC. See # as that'd be incompatible with how Automake redefines AC_PROG_CC. See
# <http://lists.gnu.org/archive/html/autoconf/2012-10/msg00048.html>. # <https://lists.gnu.org/archive/html/autoconf/2012-10/msg00048.html>.
AU_DEFUN([AC_PROG_CC_C89], AU_DEFUN([AC_PROG_CC_C89],
[AC_REQUIRE([AC_PROG_CC])], [AC_REQUIRE([AC_PROG_CC])],
[$0 is obsolete; use AC_PROG_CC] [$0 is obsolete; use AC_PROG_CC]

View file

@ -40,7 +40,7 @@ AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
m4_version_prereq([2.70], [], [ m4_version_prereq([2.70], [], [
# This is taken from the following Autoconf patch: # This is taken from the following Autoconf patch:
# https://git.sv.gnu.org/cgit/autoconf.git/commit/?id=e17a30e98 # http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=e17a30e987d7ee695fb4294a82d987ec3dc9b974
m4_undefine([AC_HEADER_MAJOR]) m4_undefine([AC_HEADER_MAJOR])
AC_DEFUN([AC_HEADER_MAJOR], AC_DEFUN([AC_HEADER_MAJOR],

View file

@ -27,7 +27,7 @@ AC_DEFUN([AC_C_VARARRAYS],
[[/* Test for VLA support. This test is partly inspired [[/* Test for VLA support. This test is partly inspired
from examples in the C standard. Use at least two VLA from examples in the C standard. Use at least two VLA
functions to detect the GCC 3.4.3 bug described in: functions to detect the GCC 3.4.3 bug described in:
http://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html https://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html
*/ */
#ifdef __STDC_NO_VLA__ #ifdef __STDC_NO_VLA__
syntax error; syntax error;

View file

@ -280,7 +280,7 @@ GNU_OBJC_CFLAGS=$(patsubst -specs=%-hardened-cc1,,@GNU_OBJC_CFLAGS@)
## w32xfns.o w32select.o image.o w32uniscribe.o if HAVE_W32, else ## w32xfns.o w32select.o image.o w32uniscribe.o if HAVE_W32, else
## empty. ## empty.
W32_OBJ=@W32_OBJ@ W32_OBJ=@W32_OBJ@
## -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32 lusp10 -lcomctl32 ## -lkernel32 -luser32 -lusp10 -lgdi32 -lole32 -lcomdlg32 -lcomctl32
## --lwinspool if HAVE_W32, else empty. ## --lwinspool if HAVE_W32, else empty.
W32_LIBS=@W32_LIBS@ W32_LIBS=@W32_LIBS@

View file

@ -272,7 +272,7 @@ invoke it. If KEYS is omitted or nil, the return value of
{ {
/* `args' will contain the array of arguments to pass to the function. /* `args' will contain the array of arguments to pass to the function.
`visargs' will contain the same list but in a nicer form, so that if we `visargs' will contain the same list but in a nicer form, so that if we
pass it to `Fformat_message' it will be understandable to a human. */ pass it to styled_format it will be understandable to a human. */
Lisp_Object *args, *visargs; Lisp_Object *args, *visargs;
Lisp_Object specs; Lisp_Object specs;
Lisp_Object filter_specs; Lisp_Object filter_specs;
@ -502,10 +502,7 @@ invoke it. If KEYS is omitted or nil, the return value of
for (i = 2; *tem; i++) for (i = 2; *tem; i++)
{ {
visargs[1] = make_string (tem + 1, strcspn (tem + 1, "\n")); visargs[1] = make_string (tem + 1, strcspn (tem + 1, "\n"));
if (strchr (SSDATA (visargs[1]), '%')) callint_message = styled_format (i - 1, visargs + 1, true, false);
callint_message = Fformat_message (i - 1, visargs + 1);
else
callint_message = visargs[1];
switch (*tem) switch (*tem)
{ {

View file

@ -3010,16 +3010,16 @@ static Lisp_Object
minmax_driver (ptrdiff_t nargs, Lisp_Object *args, minmax_driver (ptrdiff_t nargs, Lisp_Object *args,
enum Arith_Comparison comparison) enum Arith_Comparison comparison)
{ {
eassume (0 < nargs); Lisp_Object accum = args[0];
Lisp_Object accum = args[0]; /* pacify GCC */ CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (accum);
for (ptrdiff_t argnum = 0; argnum < nargs; argnum++) for (ptrdiff_t argnum = 1; argnum < nargs; argnum++)
{ {
Lisp_Object val = args[argnum]; Lisp_Object val = args[argnum];
CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (val); CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (val);
if (argnum == 0 || !NILP (arithcompare (val, accum, comparison))) if (!NILP (arithcompare (val, accum, comparison)))
accum = val; accum = val;
else if (FLOATP (accum) && isnan (XFLOAT_DATA (accum))) else if (FLOATP (val) && isnan (XFLOAT_DATA (val)))
return accum; return val;
} }
return accum; return accum;
} }

View file

@ -237,7 +237,8 @@ static char *
XD_OBJECT_TO_STRING (Lisp_Object object) XD_OBJECT_TO_STRING (Lisp_Object object)
{ {
AUTO_STRING (format, "%s"); AUTO_STRING (format, "%s");
return SSDATA (CALLN (Fformat, format, object)); Lisp_Object args[] = { format, object };
return SSDATA (styled_format (ARRAYELTS (args), args, false, false));
} }
#define XD_DBUS_VALIDATE_BUS_ADDRESS(bus) \ #define XD_DBUS_VALIDATE_BUS_ADDRESS(bus) \

View file

@ -74,7 +74,6 @@ static Lisp_Object format_time_string (char const *, ptrdiff_t, struct timespec,
static long int tm_gmtoff (struct tm *); static long int tm_gmtoff (struct tm *);
static int tm_diff (struct tm *, struct tm *); static int tm_diff (struct tm *, struct tm *);
static void update_buffer_properties (ptrdiff_t, ptrdiff_t); static void update_buffer_properties (ptrdiff_t, ptrdiff_t);
static Lisp_Object styled_format (ptrdiff_t, Lisp_Object *, bool);
#ifndef HAVE_TM_GMTOFF #ifndef HAVE_TM_GMTOFF
# define HAVE_TM_GMTOFF false # define HAVE_TM_GMTOFF false
@ -187,7 +186,8 @@ tzlookup (Lisp_Object zone, bool settz)
if (sec != 0) if (sec != 0)
prec += 2, numzone = 100 * numzone + sec; prec += 2, numzone = 100 * numzone + sec;
} }
sprintf (tzbuf, tzbuf_format, prec, numzone, sprintf (tzbuf, tzbuf_format, prec,
XINT (zone) < 0 ? -numzone : numzone,
&"-"[XINT (zone) < 0], hour, min, sec); &"-"[XINT (zone) < 0], hour, min, sec);
zone_string = tzbuf; zone_string = tzbuf;
} }
@ -3958,7 +3958,7 @@ usage: (message FORMAT-STRING &rest ARGS) */)
} }
else else
{ {
Lisp_Object val = Fformat_message (nargs, args); Lisp_Object val = styled_format (nargs, args, true, false);
message3 (val); message3 (val);
return val; return val;
} }
@ -3984,7 +3984,7 @@ usage: (message-box FORMAT-STRING &rest ARGS) */)
} }
else else
{ {
Lisp_Object val = Fformat_message (nargs, args); Lisp_Object val = styled_format (nargs, args, true, false);
Lisp_Object pane, menu; Lisp_Object pane, menu;
pane = list1 (Fcons (build_string ("OK"), Qt)); pane = list1 (Fcons (build_string ("OK"), Qt));
@ -4140,7 +4140,7 @@ produced text.
usage: (format STRING &rest OBJECTS) */) usage: (format STRING &rest OBJECTS) */)
(ptrdiff_t nargs, Lisp_Object *args) (ptrdiff_t nargs, Lisp_Object *args)
{ {
return styled_format (nargs, args, false); return styled_format (nargs, args, false, true);
} }
DEFUN ("format-message", Fformat_message, Sformat_message, 1, MANY, 0, DEFUN ("format-message", Fformat_message, Sformat_message, 1, MANY, 0,
@ -4156,13 +4156,16 @@ and right quote replacement characters are specified by
usage: (format-message STRING &rest OBJECTS) */) usage: (format-message STRING &rest OBJECTS) */)
(ptrdiff_t nargs, Lisp_Object *args) (ptrdiff_t nargs, Lisp_Object *args)
{ {
return styled_format (nargs, args, true); return styled_format (nargs, args, true, true);
} }
/* Implement format-message if MESSAGE is true, format otherwise. */ /* Implement format-message if MESSAGE is true, format otherwise.
If NEW_RESULT, the result is a new string; otherwise, the result
may be one of the arguments. */
static Lisp_Object Lisp_Object
styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message,
bool new_result)
{ {
ptrdiff_t n; /* The number of the next arg to substitute. */ ptrdiff_t n; /* The number of the next arg to substitute. */
char initial_buffer[4000]; char initial_buffer[4000];
@ -4192,6 +4195,9 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
/* The start and end bytepos in the output string. */ /* The start and end bytepos in the output string. */
ptrdiff_t start, end; ptrdiff_t start, end;
/* Whether the argument is a newly created string. */
bool_bf new_string : 1;
/* Whether the argument is a string with intervals. */ /* Whether the argument is a string with intervals. */
bool_bf intervals : 1; bool_bf intervals : 1;
} *info; } *info;
@ -4341,7 +4347,10 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
memset (&discarded[format0 - format_start], 1, memset (&discarded[format0 - format_start], 1,
format - format0 - (conversion == '%')); format - format0 - (conversion == '%'));
if (conversion == '%') if (conversion == '%')
goto copy_char; {
new_result = true;
goto copy_char;
}
++n; ++n;
if (! (n < nargs)) if (! (n < nargs))
@ -4351,6 +4360,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
if (nspec < ispec) if (nspec < ispec)
{ {
spec->argument = args[n]; spec->argument = args[n];
spec->new_string = false;
spec->intervals = false; spec->intervals = false;
nspec = ispec; nspec = ispec;
} }
@ -4368,6 +4378,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
{ {
Lisp_Object noescape = conversion == 'S' ? Qnil : Qt; Lisp_Object noescape = conversion == 'S' ? Qnil : Qt;
spec->argument = arg = Fprin1_to_string (arg, noescape); spec->argument = arg = Fprin1_to_string (arg, noescape);
spec->new_string = true;
if (STRING_MULTIBYTE (arg) && ! multibyte) if (STRING_MULTIBYTE (arg) && ! multibyte)
{ {
multibyte = true; multibyte = true;
@ -4386,6 +4397,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
goto retry; goto retry;
} }
spec->argument = arg = Fchar_to_string (arg); spec->argument = arg = Fchar_to_string (arg);
spec->new_string = true;
} }
if (!EQ (arg, args[n])) if (!EQ (arg, args[n]))
@ -4408,6 +4420,11 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
if (conversion == 's') if (conversion == 's')
{ {
if (format == end && format - format_start == 2
&& (!new_result || spec->new_string)
&& ! string_intervals (args[0]))
return arg;
/* handle case (precision[n] >= 0) */ /* handle case (precision[n] >= 0) */
ptrdiff_t prec = -1; ptrdiff_t prec = -1;
@ -4486,6 +4503,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
if (string_intervals (arg)) if (string_intervals (arg))
spec->intervals = arg_intervals = true; spec->intervals = arg_intervals = true;
new_result = true;
continue; continue;
} }
} }
@ -4753,6 +4771,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
} }
spec->end = nchars; spec->end = nchars;
new_result = true;
continue; continue;
} }
} }
@ -4771,9 +4790,13 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
} }
convsrc = format_char == '`' ? uLSQM : uRSQM; convsrc = format_char == '`' ? uLSQM : uRSQM;
convbytes = 3; convbytes = 3;
new_result = true;
} }
else if (format_char == '`' && quoting_style == STRAIGHT_QUOTING_STYLE) else if (format_char == '`' && quoting_style == STRAIGHT_QUOTING_STYLE)
convsrc = "'"; {
convsrc = "'";
new_result = true;
}
else else
{ {
/* Copy a single character from format to buf. */ /* Copy a single character from format to buf. */
@ -4797,6 +4820,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
int c = BYTE8_TO_CHAR (format_char); int c = BYTE8_TO_CHAR (format_char);
convbytes = CHAR_STRING (c, str); convbytes = CHAR_STRING (c, str);
convsrc = (char *) str; convsrc = (char *) str;
new_result = true;
} }
} }
@ -4843,6 +4867,9 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
if (bufsize < p - buf) if (bufsize < p - buf)
emacs_abort (); emacs_abort ();
if (! new_result)
return args[0];
if (maybe_combine_byte) if (maybe_combine_byte)
nchars = multibyte_chars_in_text ((unsigned char *) buf, p - buf); nchars = multibyte_chars_in_text ((unsigned char *) buf, p - buf);
Lisp_Object val = make_specified_string (buf, nchars, p - buf, multibyte); Lisp_Object val = make_specified_string (buf, nchars, p - buf, multibyte);

View file

@ -252,7 +252,7 @@ Initialization options:\n\
"\ "\
Action options:\n\ Action options:\n\
\n\ \n\
FILE visit FILE using find-file\n\ FILE visit FILE\n\
+LINE go to line LINE in next FILE\n\ +LINE go to line LINE in next FILE\n\
+LINE:COLUMN go to line LINE, column COLUMN, in next FILE\n\ +LINE:COLUMN go to line LINE, column COLUMN, in next FILE\n\
--directory, -L DIR prepend DIR to load-path (with :DIR, append DIR)\n\ --directory, -L DIR prepend DIR to load-path (with :DIR, append DIR)\n\
@ -260,13 +260,13 @@ FILE visit FILE using find-file\n\
--execute EXPR evaluate Emacs Lisp expression EXPR\n\ --execute EXPR evaluate Emacs Lisp expression EXPR\n\
", ",
"\ "\
--file FILE visit FILE using find-file\n\ --file FILE visit FILE\n\
--find-file FILE visit FILE using find-file\n\ --find-file FILE visit FILE\n\
--funcall, -f FUNC call Emacs Lisp function FUNC with no arguments\n\ --funcall, -f FUNC call Emacs Lisp function FUNC with no arguments\n\
--insert FILE insert contents of FILE into current buffer\n\ --insert FILE insert contents of FILE into current buffer\n\
--kill exit without asking for confirmation\n\ --kill exit without asking for confirmation\n\
--load, -l FILE load Emacs Lisp FILE using the load function\n\ --load, -l FILE load Emacs Lisp FILE using the load function\n\
--visit FILE visit FILE using find-file\n\ --visit FILE visit FILE\n\
\n\ \n\
", ",
"\ "\

View file

@ -1428,7 +1428,7 @@ push_handler (Lisp_Object tag_ch_val, enum handlertype handlertype)
struct handler * struct handler *
push_handler_nosignal (Lisp_Object tag_ch_val, enum handlertype handlertype) push_handler_nosignal (Lisp_Object tag_ch_val, enum handlertype handlertype)
{ {
struct handler *c = handlerlist->nextfree; struct handler *CACHEABLE c = handlerlist->nextfree;
if (!c) if (!c)
{ {
c = malloc (sizeof *c); c = malloc (sizeof *c);

View file

@ -1217,7 +1217,10 @@ xg_create_frame_widgets (struct frame *f)
with regular X drawing primitives, so from a GTK/GDK point of with regular X drawing primitives, so from a GTK/GDK point of
view, the widget is totally blank. When an expose comes, this view, the widget is totally blank. When an expose comes, this
will make the widget blank, and then Emacs redraws it. This flickers will make the widget blank, and then Emacs redraws it. This flickers
a lot, so we turn off double buffering. */ a lot, so we turn off double buffering.
FIXME: gtk_widget_set_double_buffered is deprecated and might stop
working in the future. We need to migrate away from combining
X and GTK+ drawing to a pure GTK+ build. */
gtk_widget_set_double_buffered (wfixed, FALSE); gtk_widget_set_double_buffered (wfixed, FALSE);
gtk_window_set_wmclass (GTK_WINDOW (wtop), gtk_window_set_wmclass (GTK_WINDOW (wtop),

View file

@ -5925,7 +5925,10 @@ make_lispy_event (struct input_event *event)
ASIZE (wheel_syms)); ASIZE (wheel_syms));
} }
if (event->modifiers & (double_modifier | triple_modifier)) if (NUMBERP (event->arg))
return list4 (head, position, make_number (double_click_count),
event->arg);
else if (event->modifiers & (double_modifier | triple_modifier))
return list3 (head, position, make_number (double_click_count)); return list3 (head, position, make_number (double_click_count));
else else
return list2 (head, position); return list2 (head, position);

View file

@ -102,7 +102,7 @@ DEFUN ("lcms-cie-de2000", Flcms_cie_de2000, Slcms_cie_de2000, 2, 5, 0,
Each color is a list of L*a*b* coordinates, where the L* channel ranges from Each color is a list of L*a*b* coordinates, where the L* channel ranges from
0 to 100, and the a* and b* channels range from -128 to 128. 0 to 100, and the a* and b* channels range from -128 to 128.
Optional arguments KL, KC, KH are weighting parameters for lightness, Optional arguments KL, KC, KH are weighting parameters for lightness,
chroma, and hue, respectively. The parameters each default to 1. */) chroma, and hue, respectively. The parameters each default to 1. */)
(Lisp_Object color1, Lisp_Object color2, (Lisp_Object color1, Lisp_Object color2,
Lisp_Object kL, Lisp_Object kC, Lisp_Object kH) Lisp_Object kL, Lisp_Object kC, Lisp_Object kH)
{ {
@ -139,6 +139,26 @@ chroma, and hue, respectively. The parameters each default to 1. */)
return make_float (cmsCIE2000DeltaE (&Lab1, &Lab2, Kl, Kc, Kh)); return make_float (cmsCIE2000DeltaE (&Lab1, &Lab2, Kl, Kc, Kh));
} }
static double
deg2rad (double degrees)
{
return M_PI * degrees / 180.0;
}
static cmsCIEXYZ illuminant_d65 = { .X = 95.0455, .Y = 100.0, .Z = 108.8753 };
static void
default_viewing_conditions (const cmsCIEXYZ *wp, cmsViewingConditions *vc)
{
vc->whitePoint.X = wp->X;
vc->whitePoint.Y = wp->Y;
vc->whitePoint.Z = wp->Z;
vc->Yb = 20;
vc->La = 100;
vc->surround = AVG_SURROUND;
vc->D_value = 1.0;
}
/* FIXME: code duplication */ /* FIXME: code duplication */
static bool static bool
@ -160,11 +180,62 @@ parse_xyz_list (Lisp_Object xyz_list, cmsCIEXYZ *color)
return true; return true;
} }
DEFUN ("lcms-cam02-ucs", Flcms_cam02_ucs, Slcms_cam02_ucs, 2, 3, 0, static bool
parse_viewing_conditions (Lisp_Object view, const cmsCIEXYZ *wp,
cmsViewingConditions *vc)
{
#define PARSE_VIEW_CONDITION_FLOAT(field) \
if (CONSP (view) && NUMBERP (XCAR (view))) \
{ \
vc->field = XFLOATINT (XCAR (view)); \
view = XCDR (view); \
} \
else \
return false;
#define PARSE_VIEW_CONDITION_INT(field) \
if (CONSP (view) && NATNUMP (XCAR (view))) \
{ \
CHECK_RANGED_INTEGER (XCAR (view), 1, 4); \
vc->field = XINT (XCAR (view)); \
view = XCDR (view); \
} \
else \
return false;
PARSE_VIEW_CONDITION_FLOAT (Yb);
PARSE_VIEW_CONDITION_FLOAT (La);
PARSE_VIEW_CONDITION_INT (surround);
PARSE_VIEW_CONDITION_FLOAT (D_value);
if (! NILP (view))
return false;
vc->whitePoint.X = wp->X;
vc->whitePoint.Y = wp->Y;
vc->whitePoint.Z = wp->Z;
return true;
}
/* References:
Li, Luo et al. "The CRI-CAM02UCS colour rendering index." COLOR research
and application, 37 No.3, 2012.
Luo et al. "Uniform colour spaces based on CIECAM02 colour appearance
model." COLOR research and application, 31 No.4, 2006. */
DEFUN ("lcms-cam02-ucs", Flcms_cam02_ucs, Slcms_cam02_ucs, 2, 4, 0,
doc: /* Compute CAM02-UCS metric distance between COLOR1 and COLOR2. doc: /* Compute CAM02-UCS metric distance between COLOR1 and COLOR2.
Each color is a list of XYZ coordinates, with Y scaled about unity. Each color is a list of XYZ tristimulus values, with Y scaled about unity.
Optional argument is the XYZ white point, which defaults to illuminant D65. */) Optional argument WHITEPOINT is the XYZ white point, which defaults to
(Lisp_Object color1, Lisp_Object color2, Lisp_Object whitepoint) illuminant D65.
Optional argument VIEW is a list containing the viewing conditions, and
is of the form (YB LA SURROUND DVALUE) where SURROUND corresponds to
1 AVG_SURROUND
2 DIM_SURROUND
3 DARK_SURROUND
4 CUTSHEET_SURROUND
The default viewing conditions are (20 100 1 1). */)
(Lisp_Object color1, Lisp_Object color2, Lisp_Object whitepoint,
Lisp_Object view)
{ {
cmsViewingConditions vc; cmsViewingConditions vc;
cmsJCh jch1, jch2; cmsJCh jch1, jch2;
@ -188,17 +259,13 @@ Optional argument is the XYZ white point, which defaults to illuminant D65. */)
if (!(CONSP (color2) && parse_xyz_list (color2, &xyz2))) if (!(CONSP (color2) && parse_xyz_list (color2, &xyz2)))
signal_error ("Invalid color", color2); signal_error ("Invalid color", color2);
if (NILP (whitepoint)) if (NILP (whitepoint))
parse_xyz_list (Vlcms_d65_xyz, &xyzw); xyzw = illuminant_d65;
else if (!(CONSP (whitepoint) && parse_xyz_list (whitepoint, &xyzw))) else if (!(CONSP (whitepoint) && parse_xyz_list (whitepoint, &xyzw)))
signal_error ("Invalid white point", whitepoint); signal_error ("Invalid white point", whitepoint);
if (NILP (view))
vc.whitePoint.X = xyzw.X; default_viewing_conditions (&xyzw, &vc);
vc.whitePoint.Y = xyzw.Y; else if (!(CONSP (view) && parse_viewing_conditions (view, &xyzw, &vc)))
vc.whitePoint.Z = xyzw.Z; signal_error ("Invalid view conditions", view);
vc.Yb = 20;
vc.La = 100;
vc.surround = AVG_SURROUND;
vc.D_value = 1.0;
h1 = cmsCIECAM02Init (0, &vc); h1 = cmsCIECAM02Init (0, &vc);
h2 = cmsCIECAM02Init (0, &vc); h2 = cmsCIECAM02Init (0, &vc);
@ -227,10 +294,10 @@ Optional argument is the XYZ white point, which defaults to illuminant D65. */)
Mp2 = 43.86 * log (1.0 + 0.0228 * (jch2.C * sqrt (sqrt (FL)))); Mp2 = 43.86 * log (1.0 + 0.0228 * (jch2.C * sqrt (sqrt (FL))));
Jp1 = 1.7 * jch1.J / (1.0 + (0.007 * jch1.J)); Jp1 = 1.7 * jch1.J / (1.0 + (0.007 * jch1.J));
Jp2 = 1.7 * jch2.J / (1.0 + (0.007 * jch2.J)); Jp2 = 1.7 * jch2.J / (1.0 + (0.007 * jch2.J));
ap1 = Mp1 * cos (jch1.h); ap1 = Mp1 * cos (deg2rad (jch1.h));
ap2 = Mp2 * cos (jch2.h); ap2 = Mp2 * cos (deg2rad (jch2.h));
bp1 = Mp1 * sin (jch1.h); bp1 = Mp1 * sin (deg2rad (jch1.h));
bp2 = Mp2 * sin (jch2.h); bp2 = Mp2 * sin (deg2rad (jch2.h));
return make_float (sqrt ((Jp2 - Jp1) * (Jp2 - Jp1) + return make_float (sqrt ((Jp2 - Jp1) * (Jp2 - Jp1) +
(ap2 - ap1) * (ap2 - ap1) + (ap2 - ap1) * (ap2 - ap1) +
@ -239,7 +306,7 @@ Optional argument is the XYZ white point, which defaults to illuminant D65. */)
DEFUN ("lcms-temp->white-point", Flcms_temp_to_white_point, Slcms_temp_to_white_point, 1, 1, 0, DEFUN ("lcms-temp->white-point", Flcms_temp_to_white_point, Slcms_temp_to_white_point, 1, 1, 0,
doc: /* Return XYZ black body chromaticity from TEMPERATURE given in K. doc: /* Return XYZ black body chromaticity from TEMPERATURE given in K.
Valid range of TEMPERATURE is from 4000K to 25000K. */) Valid range of TEMPERATURE is from 4000K to 25000K. */)
(Lisp_Object temperature) (Lisp_Object temperature)
{ {
cmsFloat64Number tempK; cmsFloat64Number tempK;
@ -291,12 +358,6 @@ DEFUN ("lcms2-available-p", Flcms2_available_p, Slcms2_available_p, 0, 0, 0,
void void
syms_of_lcms2 (void) syms_of_lcms2 (void)
{ {
DEFVAR_LISP ("lcms-d65-xyz", Vlcms_d65_xyz,
doc: /* D65 illuminant as a CIE XYZ triple. */);
Vlcms_d65_xyz = list3 (make_float (0.950455),
make_float (1.0),
make_float (1.088753));
defsubr (&Slcms_cie_de2000); defsubr (&Slcms_cie_de2000);
defsubr (&Slcms_cam02_ucs); defsubr (&Slcms_cam02_ucs);
defsubr (&Slcms2_available_p); defsubr (&Slcms2_available_p);

View file

@ -3969,6 +3969,7 @@ extern _Noreturn void time_overflow (void);
extern Lisp_Object make_buffer_string (ptrdiff_t, ptrdiff_t, bool); extern Lisp_Object make_buffer_string (ptrdiff_t, ptrdiff_t, bool);
extern Lisp_Object make_buffer_string_both (ptrdiff_t, ptrdiff_t, ptrdiff_t, extern Lisp_Object make_buffer_string_both (ptrdiff_t, ptrdiff_t, ptrdiff_t,
ptrdiff_t, bool); ptrdiff_t, bool);
extern Lisp_Object styled_format (ptrdiff_t, Lisp_Object *, bool, bool);
extern void init_editfns (bool); extern void init_editfns (bool);
extern void syms_of_editfns (void); extern void syms_of_editfns (void);

View file

@ -1820,8 +1820,8 @@ -(void)remove
if (pixelwise) if (pixelwise)
{ {
pixelwidth = width; pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width);
pixelheight = height; pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height);
} }
else else
{ {
@ -6498,24 +6498,139 @@ - (void)mouseDown: (NSEvent *)theEvent
if ([theEvent type] == NSEventTypeScrollWheel) if ([theEvent type] == NSEventTypeScrollWheel)
{ {
CGFloat delta = [theEvent deltaY]; #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
/* Mac notebooks send wheel events w/delta =0 when trackpad scrolling */ #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
if (delta == 0) if ([theEvent respondsToSelector:@selector(hasPreciseScrollingDeltas)])
{ {
delta = [theEvent deltaX]; #endif
if (delta == 0) /* If the input device is a touchpad or similar, use precise
* scrolling deltas. These are measured in pixels, so we
* have to add them up until they exceed one line height,
* then we can send a scroll wheel event.
*
* If the device only has coarse scrolling deltas, like a
* real mousewheel, the deltas represent a ratio of whole
* lines, so round up the number of lines. This means we
* always send one scroll event per click, but can still
* scroll more than one line if the OS tells us to.
*/
bool horizontal;
int lines = 0;
int scrollUp = NO;
/* FIXME: At the top or bottom of the buffer we should
* ignore momentum-phase events. */
if (! ns_use_mwheel_momentum
&& [theEvent momentumPhase] != NSEventPhaseNone)
return;
if ([theEvent hasPreciseScrollingDeltas])
{ {
NSTRACE_MSG ("deltaIsZero"); static int totalDeltaX, totalDeltaY;
return; int lineHeight;
if (NUMBERP (ns_mwheel_line_height))
lineHeight = XINT (ns_mwheel_line_height);
else
{
/* FIXME: Use actual line height instead of the default. */
lineHeight = default_line_pixel_height
(XWINDOW (FRAME_SELECTED_WINDOW (emacsframe)));
}
if ([theEvent phase] == NSEventPhaseBegan)
{
totalDeltaX = 0;
totalDeltaY = 0;
}
totalDeltaX += [theEvent scrollingDeltaX];
totalDeltaY += [theEvent scrollingDeltaY];
/* Calculate the number of lines, if any, to scroll, and
* reset the total delta for the direction we're NOT
* scrolling so that small movements don't add up. */
if (abs (totalDeltaX) > abs (totalDeltaY)
&& abs (totalDeltaX) > lineHeight)
{
horizontal = YES;
scrollUp = totalDeltaX > 0;
lines = abs (totalDeltaX / lineHeight);
totalDeltaX = totalDeltaX % lineHeight;
totalDeltaY = 0;
}
else if (abs (totalDeltaY) >= abs (totalDeltaX)
&& abs (totalDeltaY) > lineHeight)
{
horizontal = NO;
scrollUp = totalDeltaY > 0;
lines = abs (totalDeltaY / lineHeight);
totalDeltaY = totalDeltaY % lineHeight;
totalDeltaX = 0;
}
if (lines > 1 && ! ns_use_mwheel_acceleration)
lines = 1;
} }
emacs_event->kind = HORIZ_WHEEL_EVENT; else
{
CGFloat delta;
if ([theEvent scrollingDeltaY] == 0)
{
horizontal = YES;
delta = [theEvent scrollingDeltaX];
}
else
{
horizontal = NO;
delta = [theEvent scrollingDeltaY];
}
lines = (ns_use_mwheel_acceleration)
? ceil (fabs (delta)) : 1;
scrollUp = delta > 0;
}
if (lines == 0)
return;
emacs_event->kind = horizontal ? HORIZ_WHEEL_EVENT : WHEEL_EVENT;
emacs_event->arg = (make_number (lines));
emacs_event->code = 0;
emacs_event->modifiers = EV_MODIFIERS (theEvent) |
(scrollUp ? up_modifier : down_modifier);
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
} }
else else
emacs_event->kind = WHEEL_EVENT; #endif
#endif /* defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 */
#if defined (NS_IMPL_GNUSTEP) || MAC_OS_X_VERSION_MIN_REQUIRED < 1070
{
CGFloat delta = [theEvent deltaY];
/* Mac notebooks send wheel events w/delta =0 when trackpad scrolling */
if (delta == 0)
{
delta = [theEvent deltaX];
if (delta == 0)
{
NSTRACE_MSG ("deltaIsZero");
return;
}
emacs_event->kind = HORIZ_WHEEL_EVENT;
}
else
emacs_event->kind = WHEEL_EVENT;
emacs_event->code = 0; emacs_event->code = 0;
emacs_event->modifiers = EV_MODIFIERS (theEvent) | emacs_event->modifiers = EV_MODIFIERS (theEvent) |
((delta > 0) ? up_modifier : down_modifier); ((delta > 0) ? up_modifier : down_modifier);
}
#endif
} }
else else
{ {
@ -6524,9 +6639,11 @@ - (void)mouseDown: (NSEvent *)theEvent
emacs_event->modifiers = EV_MODIFIERS (theEvent) emacs_event->modifiers = EV_MODIFIERS (theEvent)
| EV_UDMODIFIERS (theEvent); | EV_UDMODIFIERS (theEvent);
} }
XSETINT (emacs_event->x, lrint (p.x)); XSETINT (emacs_event->x, lrint (p.x));
XSETINT (emacs_event->y, lrint (p.y)); XSETINT (emacs_event->y, lrint (p.y));
EV_TRAILER (theEvent); EV_TRAILER (theEvent);
return;
} }
@ -6707,9 +6824,10 @@ - (void) updateFrameSize: (BOOL) delay
if (wait_for_tool_bar) if (wait_for_tool_bar)
{ {
/* The toolbar height is always 0 in fullscreen, so don't wait /* The toolbar height is always 0 in fullscreen and undecorated
for it to become available. */ frames, so don't wait for it to become available. */
if (FRAME_TOOLBAR_HEIGHT (emacsframe) == 0 if (FRAME_TOOLBAR_HEIGHT (emacsframe) == 0
&& FRAME_UNDECORATED (emacsframe) == false
&& ! [self isFullscreen]) && ! [self isFullscreen])
{ {
NSTRACE_MSG ("Waiting for toolbar"); NSTRACE_MSG ("Waiting for toolbar");
@ -7090,9 +7208,9 @@ - (instancetype) initFrameFromEmacs: (struct frame *)f
win = [[EmacsWindow alloc] win = [[EmacsWindow alloc]
initWithContentRect: r initWithContentRect: r
styleMask: (FRAME_UNDECORATED (f) styleMask: ((FRAME_UNDECORATED (f)
? FRAME_UNDECORATED_FLAGS ? FRAME_UNDECORATED_FLAGS
: FRAME_DECORATED_FLAGS : FRAME_DECORATED_FLAGS)
#ifdef NS_IMPL_COCOA #ifdef NS_IMPL_COCOA
| NSWindowStyleMaskResizable | NSWindowStyleMaskResizable
| NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskMiniaturizable
@ -9166,6 +9284,23 @@ Nil means use fullscreen the old (< 10.7) way. The old way works better with
This variable is ignored on Mac OS X < 10.7 and GNUstep. */); This variable is ignored on Mac OS X < 10.7 and GNUstep. */);
ns_use_srgb_colorspace = YES; ns_use_srgb_colorspace = YES;
DEFVAR_BOOL ("ns-use-mwheel-acceleration",
ns_use_mwheel_acceleration,
doc: /*Non-nil means use macOS's standard mouse wheel acceleration.
This variable is ignored on macOS < 10.7 and GNUstep. Default is t. */);
ns_use_mwheel_acceleration = YES;
DEFVAR_LISP ("ns-mwheel-line-height", ns_mwheel_line_height,
doc: /*The number of pixels touchpad scrolling considers one line.
Nil or a non-number means use the default frame line height.
This variable is ignored on macOS < 10.7 and GNUstep. Default is nil. */);
ns_mwheel_line_height = Qnil;
DEFVAR_BOOL ("ns-use-mwheel-momentum", ns_use_mwheel_momentum,
doc: /*Non-nil means mouse wheel scrolling uses momentum.
This variable is ignored on macOS < 10.7 and GNUstep. Default is t. */);
ns_use_mwheel_momentum = YES;
/* TODO: move to common code */ /* TODO: move to common code */
DEFVAR_LISP ("x-toolkit-scroll-bars", Vx_toolkit_scroll_bars, DEFVAR_LISP ("x-toolkit-scroll-bars", Vx_toolkit_scroll_bars,
doc: /* Which toolkit scroll bars Emacs uses, if any. doc: /* Which toolkit scroll bars Emacs uses, if any.

View file

@ -155,12 +155,16 @@ tty_ring_bell (struct frame *f)
static void static void
tty_send_additional_strings (struct terminal *terminal, Lisp_Object sym) tty_send_additional_strings (struct terminal *terminal, Lisp_Object sym)
{ {
Lisp_Object lisp_terminal; /* Use only accessors like CDR_SAFE and assq_no_quit to avoid any
Lisp_Object extra_codes; form of quitting or signaling an error, since this function can
run as part of the "emergency escape" procedure invoked in the
middle of GC, where quitting means crashing (Bug#17406). */
if (! terminal->name)
return;
struct tty_display_info *tty = terminal->display_info.tty; struct tty_display_info *tty = terminal->display_info.tty;
XSETTERMINAL (lisp_terminal, terminal); for (Lisp_Object extra_codes
for (extra_codes = Fterminal_parameter (lisp_terminal, sym); = CDR_SAFE (assq_no_quit (sym, terminal->param_alist));
CONSP (extra_codes); CONSP (extra_codes);
extra_codes = XCDR (extra_codes)) extra_codes = XCDR (extra_codes))
{ {

View file

@ -116,7 +116,9 @@ enum event_kind
.frame_or_window gives the frame .frame_or_window gives the frame
the wheel event occurred in. the wheel event occurred in.
.timestamp gives a timestamp (in .timestamp gives a timestamp (in
milliseconds) for the event. */ milliseconds) for the event.
.arg may contain the number of
lines to scroll. */
HORIZ_WHEEL_EVENT, /* A wheel event generated by a second HORIZ_WHEEL_EVENT, /* A wheel event generated by a second
horizontal wheel that is present on some horizontal wheel that is present on some
mice. See WHEEL_EVENT. */ mice. See WHEEL_EVENT. */

View file

@ -6252,7 +6252,8 @@ w32fullscreen_hook (struct frame *f)
if (FRAME_PREV_FSMODE (f) == FULLSCREEN_BOTH) if (FRAME_PREV_FSMODE (f) == FULLSCREEN_BOTH)
{ {
SetWindowLong (hwnd, GWL_STYLE, dwStyle | WS_OVERLAPPEDWINDOW); if (!FRAME_UNDECORATED (f))
SetWindowLong (hwnd, GWL_STYLE, dwStyle | WS_OVERLAPPEDWINDOW);
SetWindowPlacement (hwnd, &FRAME_NORMAL_PLACEMENT (f)); SetWindowPlacement (hwnd, &FRAME_NORMAL_PLACEMENT (f));
} }
else if (FRAME_PREV_FSMODE (f) == FULLSCREEN_HEIGHT else if (FRAME_PREV_FSMODE (f) == FULLSCREEN_HEIGHT
@ -6278,7 +6279,8 @@ w32fullscreen_hook (struct frame *f)
w32_fullscreen_rect (hwnd, f->want_fullscreen, w32_fullscreen_rect (hwnd, f->want_fullscreen,
FRAME_NORMAL_PLACEMENT (f).rcNormalPosition, &rect); FRAME_NORMAL_PLACEMENT (f).rcNormalPosition, &rect);
SetWindowLong (hwnd, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW); if (!FRAME_UNDECORATED (f))
SetWindowLong (hwnd, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW);
SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top, SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top, rect.right - rect.left, rect.bottom - rect.top,
SWP_NOOWNERZORDER | SWP_FRAMECHANGED); SWP_NOOWNERZORDER | SWP_FRAMECHANGED);

View file

@ -10194,7 +10194,7 @@ vadd_to_log (char const *format, va_list ap)
for (ptrdiff_t i = 1; i <= nargs; i++) for (ptrdiff_t i = 1; i <= nargs; i++)
args[i] = va_arg (ap, Lisp_Object); args[i] = va_arg (ap, Lisp_Object);
Lisp_Object msg = Qnil; Lisp_Object msg = Qnil;
msg = Fformat_message (nargs, args); msg = styled_format (nargs, args, true, false);
ptrdiff_t len = SBYTES (msg) + 1; ptrdiff_t len = SBYTES (msg) + 1;
USE_SAFE_ALLOCA; USE_SAFE_ALLOCA;
@ -19525,7 +19525,7 @@ DEFUN ("trace-to-stderr", Ftrace_to_stderr, Strace_to_stderr, 1, MANY, "",
usage: (trace-to-stderr STRING &rest OBJECTS) */) usage: (trace-to-stderr STRING &rest OBJECTS) */)
(ptrdiff_t nargs, Lisp_Object *args) (ptrdiff_t nargs, Lisp_Object *args)
{ {
Lisp_Object s = Fformat (nargs, args); Lisp_Object s = styled_format (nargs, args, false, false);
fwrite (SDATA (s), 1, SBYTES (s), stderr); fwrite (SDATA (s), 1, SBYTES (s), stderr);
return Qnil; return Qnil;
} }
@ -22395,8 +22395,8 @@ Value is the new character position of point. */)
row += dir; row += dir;
else else
row -= dir; row -= dir;
if (row < MATRIX_FIRST_TEXT_ROW (w->current_matrix) if (!(MATRIX_FIRST_TEXT_ROW (w->current_matrix) <= row
|| row > MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w)) && row < MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w)))
goto simulate_display; goto simulate_display;
if (dir > 0) if (dir > 0)

Some files were not shown because too many files have changed in this diff Show more