Merge branch 'emacs-26' into scratch/org-mode-merge
This commit is contained in:
commit
d4b2bbdc73
114 changed files with 3758 additions and 2259 deletions
|
@ -4808,7 +4808,7 @@
|
|||
Link from (emacs)Exiting to (lisp)Killing Emacs
|
||||
|
||||
* 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)
|
||||
|
||||
|
@ -7845,7 +7845,7 @@
|
|||
|
||||
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.
|
||||
|
||||
|
|
|
@ -12949,7 +12949,7 @@
|
|||
Link from (emacs)Exiting to (lisp)Killing Emacs
|
||||
|
||||
* 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>
|
||||
|
||||
|
@ -13159,7 +13159,7 @@
|
|||
Move the diff command to "Operate" in ibuffer
|
||||
|
||||
* 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).
|
||||
|
||||
2016-04-27 Lars Ingebrigtsen <larsi@gnus.org>
|
||||
|
@ -16589,7 +16589,7 @@
|
|||
really changed.
|
||||
(save_window_save): Set the pixel_height_before_size_change and
|
||||
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
|
||||
run_window_size_change_functions.
|
||||
(Vwindow_size_change_functions): Move definition to window.c.
|
||||
|
@ -16842,7 +16842,7 @@
|
|||
5d17ae7 Improve file-notify-test08-watched-file-in-watched-dir
|
||||
1cb1268 Fix todo-mode item date editing bugs
|
||||
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
|
||||
2a75f64 New filenotify test for bug#22736
|
||||
c9bccf7 Report critical battery errors
|
||||
|
|
38
build-aux/config.guess
vendored
38
build-aux/config.guess
vendored
|
@ -2,7 +2,7 @@
|
|||
# Attempt to guess a canonical system name.
|
||||
# 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
|
||||
# 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.
|
||||
#
|
||||
# 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
|
||||
# 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.
|
||||
#
|
||||
# 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>.
|
||||
|
||||
|
@ -318,15 +318,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||
exitcode=$?
|
||||
trap '' 0
|
||||
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:*)
|
||||
echo m68k-unknown-sysv4
|
||||
exit ;;
|
||||
|
@ -858,10 +849,6 @@ EOF
|
|||
*:MSYS*:*)
|
||||
echo ${UNAME_MACHINE}-pc-msys
|
||||
exit ;;
|
||||
i*:windows32*:*)
|
||||
# uname -m includes "-pc" on this system.
|
||||
echo ${UNAME_MACHINE}-mingw32
|
||||
exit ;;
|
||||
i*:PW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit ;;
|
||||
|
@ -877,27 +864,12 @@ EOF
|
|||
echo ia64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
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*:*)
|
||||
echo ${UNAME_MACHINE}-pc-uwin
|
||||
exit ;;
|
||||
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
|
||||
echo x86_64-unknown-cygwin
|
||||
exit ;;
|
||||
p*:CYGWIN*:*)
|
||||
echo powerpcle-unknown-cygwin
|
||||
exit ;;
|
||||
prep*:SunOS:5.*:*)
|
||||
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
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*
|
||||
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
|
||||
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
|
||||
information you think might be pertinent to config-patches@gnu.org to
|
||||
|
|
20
build-aux/config.sub
vendored
20
build-aux/config.sub
vendored
|
@ -2,7 +2,7 @@
|
|||
# Configuration validation subroutine script.
|
||||
# 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
|
||||
# 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.
|
||||
#
|
||||
# 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
|
||||
# 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.
|
||||
|
||||
# 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
|
||||
# and recognize all the CPU types, system types and aliases
|
||||
|
@ -229,9 +229,6 @@ case $os in
|
|||
-ptx*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
|
||||
;;
|
||||
-windowsnt*)
|
||||
os=`echo $os | sed -e 's/windowsnt/winnt/'`
|
||||
;;
|
||||
-psos*)
|
||||
os=-psos
|
||||
;;
|
||||
|
@ -1259,6 +1256,9 @@ case $basic_machine in
|
|||
basic_machine=hppa1.1-winbond
|
||||
os=-proelf
|
||||
;;
|
||||
x64)
|
||||
basic_machine=x86_64-pc
|
||||
;;
|
||||
xbox)
|
||||
basic_machine=i686-pc
|
||||
os=-mingw32
|
||||
|
@ -1366,8 +1366,8 @@ esac
|
|||
if [ x"$os" != x"" ]
|
||||
then
|
||||
case $os in
|
||||
# First match some system type aliases
|
||||
# that might get confused with valid system types.
|
||||
# First match some system type aliases that might get confused
|
||||
# with valid system types.
|
||||
# -solaris* is a basic system type, with this one exception.
|
||||
-auroraux)
|
||||
os=-auroraux
|
||||
|
@ -1387,9 +1387,9 @@ case $os in
|
|||
-gnu/linux*)
|
||||
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.
|
||||
# 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.
|
||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
|
||||
|
|
|
@ -33,7 +33,7 @@ use POSIX qw(strftime);
|
|||
|
||||
(my $ME = $0) =~ s|.*/||;
|
||||
|
||||
# use File::Coda; # http://meyering.net/code/Coda/
|
||||
# use File::Coda; # https://meyering.net/code/Coda/
|
||||
END {
|
||||
defined fileno STDOUT or return;
|
||||
close STDOUT and return;
|
||||
|
|
|
@ -2077,15 +2077,15 @@ if test "${HAVE_W32}" = "yes"; then
|
|||
AC_SUBST(comma_space_version)
|
||||
AC_CONFIG_FILES([nt/emacs.rc nt/emacsclient.rc])
|
||||
if test "${opsys}" = "cygwin"; then
|
||||
W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
|
||||
W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool"
|
||||
W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lusp10 -lgdi32"
|
||||
W32_LIBS="$W32_LIBS -lole32 -lcomdlg32 -lcomctl32 -lwinspool"
|
||||
# Tell the linker that emacs.res is an object (which we compile from
|
||||
# the rc file), not a linker script.
|
||||
W32_RES_LINK="-Wl,emacs.res"
|
||||
else
|
||||
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 -lmpr -lwinspool -lole32 -lcomctl32 -lusp10"
|
||||
W32_LIBS="$W32_LIBS -lwinmm -lusp10 -lgdi32 -lcomdlg32"
|
||||
W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lcomctl32"
|
||||
W32_RES_LINK="\$(EMACSRES)"
|
||||
CLIENTRES="emacsclient.res"
|
||||
CLIENTW="emacsclientw\$(EXEEXT)"
|
||||
|
|
|
@ -94,7 +94,7 @@ happen. The variables @code{'attempt-stack-overflow-recovery} and
|
|||
@code{attempt-orderly-shutdown-on-fatal-signal} are therefore removed.
|
||||
|
||||
@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
|
||||
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
|
||||
|
|
|
@ -92,7 +92,7 @@ arguments.)
|
|||
@itemx --visit=@var{file}
|
||||
@cindex visiting files, command-line argument
|
||||
@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,
|
||||
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}
|
||||
@opindex +@var{linenum}
|
||||
Visit @var{file} using @code{find-file}, then go to line number
|
||||
@var{linenum} in it.
|
||||
Visit the specified @var{file}, then go to line number @var{linenum}
|
||||
in it.
|
||||
|
||||
@item +@var{linenum}:@var{columnnum} @var{file}
|
||||
Visit @var{file} using @code{find-file}, then go to line number
|
||||
@var{linenum} and put point at column number @var{columnnum}.
|
||||
Visit the specified @var{file}, then go to line number @var{linenum}
|
||||
and put point at column number @var{columnnum}.
|
||||
|
||||
@item -l @var{file}
|
||||
@opindex -l
|
||||
|
|
|
@ -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
|
||||
numbers are relative, as with @code{relative} value above. This is
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
The line numbers are displayed in a special face @code{line-number}.
|
||||
The current line number is displayed in a different face,
|
||||
|
|
|
@ -1089,12 +1089,15 @@ is not cleared by changing major modes.
|
|||
|
||||
@defopt buffer-offer-save
|
||||
This variable, if non-@code{nil} in a particular buffer, tells
|
||||
@code{save-buffers-kill-emacs} and @code{save-some-buffers} (if the
|
||||
second optional argument to that function is @code{t}) to offer to
|
||||
save that buffer, just as they offer to save file-visiting buffers.
|
||||
@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}.
|
||||
@code{save-buffers-kill-emacs} to offer to save that buffer, just as
|
||||
it offers to save file-visiting buffers. If @code{save-some-buffers}
|
||||
is called with the second optional argument set to @code{t}, it will
|
||||
also offer to save the buffer. Lastly, if this variable is set to the
|
||||
symbol @code{always}, both @code{save-buffers-kill-emacs} and
|
||||
@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
|
||||
|
||||
@defvar buffer-save-without-query
|
||||
|
|
|
@ -332,7 +332,9 @@ in the list @code{find-file-hook}.
|
|||
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
|
||||
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
|
||||
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}
|
||||
This command saves some modified file-visiting buffers. Normally it
|
||||
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
|
||||
the user.
|
||||
non-@code{nil}, it saves all the file-visiting buffers without
|
||||
querying the user.
|
||||
|
||||
@vindex save-some-buffers-default-predicate
|
||||
The optional @var{pred} argument provides a predicate that controls
|
||||
|
|
|
@ -112,37 +112,39 @@ window of another Emacs frame. @xref{Child Frames}.
|
|||
* Display Feature Testing:: Determining the features of a terminal.
|
||||
@end menu
|
||||
|
||||
|
||||
@node Creating Frames
|
||||
@section Creating Frames
|
||||
@cindex frame creation
|
||||
|
||||
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
|
||||
buffer.
|
||||
|
||||
The @var{alist} argument is an alist that specifies frame parameters
|
||||
for the new frame. @xref{Frame Parameters}. If you specify the
|
||||
@code{terminal} parameter in @var{alist}, the new frame is created on
|
||||
that terminal. Otherwise, if you specify the @code{window-system}
|
||||
frame parameter in @var{alist}, that determines whether the frame
|
||||
should be displayed on a text terminal or a graphical terminal.
|
||||
@xref{Window Systems}. If neither is specified, the new frame is
|
||||
created in the same terminal as the selected frame.
|
||||
The @var{parameters} argument is an alist that specifies frame
|
||||
parameters for the new frame. @xref{Frame Parameters}. If you specify
|
||||
the @code{terminal} parameter in @var{parameters}, the new frame is
|
||||
created on that terminal. Otherwise, if you specify the
|
||||
@code{window-system} frame parameter in @var{parameters}, that
|
||||
determines whether the frame should be displayed on a text terminal or a
|
||||
graphical terminal. @xref{Window Systems}. If neither is specified,
|
||||
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
|
||||
the alist @code{default-frame-alist} (@pxref{Initial Parameters});
|
||||
Any parameters not mentioned in @var{parameters} default to the values
|
||||
in the alist @code{default-frame-alist} (@pxref{Initial Parameters});
|
||||
parameters not specified there default from the X resources or its
|
||||
equivalent on your operating system (@pxref{X Resources,, X Resources,
|
||||
emacs, The GNU Emacs Manual}). After the frame is created, Emacs
|
||||
applies any parameters listed in @code{frame-inherited-parameters}
|
||||
(see below) and not present in the argument, taking the values from
|
||||
the frame that was selected when @code{make-frame} was called.
|
||||
emacs, The GNU Emacs Manual}). After the frame is created, this
|
||||
function applies any parameters specified in
|
||||
@code{frame-inherited-parameters} (see below) it has no assigned yet,
|
||||
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
|
||||
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
|
||||
displaying the frame on the monitor that contains the largest part of
|
||||
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
|
||||
|
||||
@defvar after-make-frame-functions
|
||||
An abnormal hook run by @code{make-frame} after it creates the frame.
|
||||
Each function in @code{after-make-frame-functions} receives one argument, the
|
||||
frame just created.
|
||||
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 frame just created.
|
||||
@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
|
||||
This variable specifies the list of frame parameters that a newly
|
||||
created frame inherits from the currently selected frame. For each
|
||||
parameter (a symbol) that is an element in the list and is not present
|
||||
in the argument to @code{make-frame}, the function sets the value of
|
||||
that parameter in the created frame to its value in the selected
|
||||
frame.
|
||||
parameter (a symbol) that is an element in this list and has not been
|
||||
assigned earlier when processing @code{make-frame}, the function sets
|
||||
the value of that parameter in the created frame to its value in the
|
||||
selected frame.
|
||||
@end defvar
|
||||
|
||||
|
||||
@node Multiple Terminals
|
||||
@section Multiple Terminals
|
||||
@cindex multiple terminals
|
||||
|
|
|
@ -1885,8 +1885,8 @@ one of these functions; the arrival of the specified time will not
|
|||
cause anything special to happen.
|
||||
@end defun
|
||||
|
||||
@findex timer-list
|
||||
The @code{timer-list} command lists all the currently active timers.
|
||||
@findex list-timers
|
||||
The @code{list-timers} command lists all the currently active timers.
|
||||
There's only one command available in the buffer displayed: @kbd{c}
|
||||
(@code{timer-list-cancel}) that will cancel the timer on the line
|
||||
under point.
|
||||
|
|
|
@ -824,8 +824,9 @@ to the produced string representations of the argument @var{objects}.
|
|||
@end defun
|
||||
|
||||
@defun format-message string &rest objects
|
||||
@cindex curved quotes
|
||||
@cindex curly quotes
|
||||
@cindex curved quotes, in formatted messages
|
||||
@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
|
||||
grave accents (@t{`}) and apostrophes (@t{'}) in @var{string} as per the
|
||||
value of @code{text-quoting-style}.
|
||||
|
|
|
@ -54,6 +54,8 @@ the character after point.
|
|||
* Registers:: How registers are implemented. Accessing the text or
|
||||
position stored in a register.
|
||||
* 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.
|
||||
* Base 64:: Conversion to or from base 64 encoding.
|
||||
* 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.
|
||||
@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
|
||||
@section Dealing With Compressed Data
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
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
|
||||
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.
|
||||
convenient if some words come before the package's name prefix. For
|
||||
example, it is our convention to have commands that list objects named
|
||||
as @samp{list-@var{something}}, e.g., a package called @samp{frob}
|
||||
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
|
||||
primitives that are not primitives in Emacs Lisp---such as
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
% Load plain if necessary, i.e., if running under initex.
|
||||
\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,
|
||||
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||
|
@ -21,7 +21,7 @@
|
|||
% General Public License for more details.
|
||||
%
|
||||
% 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
|
||||
% 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
|
||||
% reports; you can get the latest version from:
|
||||
% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
|
||||
% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
|
||||
% http://www.gnu.org/software/texinfo/ (the Texinfo home page)
|
||||
% https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
|
||||
% https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
|
||||
% https://www.gnu.org/software/texinfo/ (the Texinfo home page)
|
||||
% The texinfo.tex in any given distribution could well be out
|
||||
% 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
|
||||
% 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]:}
|
||||
|
@ -9446,7 +9446,7 @@
|
|||
\newif\ifwarnednoepsf
|
||||
\newhelp\noepsfhelp{epsf.tex must be installed for images to
|
||||
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{%
|
||||
\ifx\epsfbox\thisisundefined
|
||||
|
|
|
@ -3043,6 +3043,14 @@ Disable version control to avoid delays:
|
|||
@end group
|
||||
@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,
|
||||
default being 3. Increase trace levels temporarily when hunting for
|
||||
bugs.
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
@c In the Tramp GIT, the version number is auto-frobbed from
|
||||
@c configure.ac, so you should edit that file and run
|
||||
@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
|
||||
@set instprefix /usr/local
|
||||
|
|
36
etc/NEWS
36
etc/NEWS
|
@ -117,6 +117,11 @@ The effect is similar to that of "toolBar" resource on the tool bar.
|
|||
|
||||
* 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.
|
||||
|
||||
+++
|
||||
|
@ -144,8 +149,7 @@ init file:
|
|||
'save-buffer' process. Previously, saving a buffer that was not
|
||||
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
|
||||
nil). A non-nil buffer-local value for this variable is sufficient
|
||||
for 'save-some-buffers' to consider the buffer for saving.
|
||||
nil).
|
||||
|
||||
---
|
||||
** 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.
|
||||
|
||||
+++
|
||||
** 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.
|
||||
|
||||
+++
|
||||
|
@ -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
|
||||
line.
|
||||
|
||||
---
|
||||
** New command 'replace-buffer-contents'.
|
||||
This command replaces the contents of the accessible portion of the
|
||||
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
|
||||
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
|
||||
|
||||
---
|
||||
|
@ -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
|
||||
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
|
||||
|
||||
|
@ -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.
|
||||
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
|
||||
|
||||
|
@ -1876,6 +1898,12 @@ of frame decorations on macOS 10.9+.
|
|||
---
|
||||
** '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.
|
||||
|
|
|
@ -7068,14 +7068,16 @@ etags_mktmp (void)
|
|||
errno = temp_errno;
|
||||
templt = NULL;
|
||||
}
|
||||
|
||||
#if defined (DOS_NT)
|
||||
/* The file name will be used in shell redirection, so it needs to have
|
||||
DOS-style backslashes, or else the Windows shell will barf. */
|
||||
char *p;
|
||||
for (p = templt; *p; p++)
|
||||
if (*p == '/')
|
||||
*p = '\\';
|
||||
else
|
||||
{
|
||||
/* The file name will be used in shell redirection, so it needs to have
|
||||
DOS-style backslashes, or else the Windows shell will barf. */
|
||||
char *p;
|
||||
for (p = templt; *p; p++)
|
||||
if (*p == '/')
|
||||
*p = '\\';
|
||||
}
|
||||
#endif
|
||||
|
||||
return templt;
|
||||
|
|
|
@ -29,7 +29,7 @@ struct allocator
|
|||
/* Do not use GCC attributes such as __attribute__ ((malloc)) with
|
||||
the function types pointed at by these members, because these
|
||||
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
|
||||
should return NULL, though not necessarily set errno. When given
|
||||
|
|
|
@ -70,7 +70,8 @@ _GL_INLINE_HEADER_BEGIN
|
|||
COUNT_LEADING_ZEROS_INLINE int
|
||||
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] = {
|
||||
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
|
||||
|
|
|
@ -68,7 +68,8 @@ _GL_INLINE_HEADER_BEGIN
|
|||
COUNT_TRAILING_ZEROS_INLINE int
|
||||
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] = {
|
||||
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
|
||||
|
|
|
@ -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:
|
||||
http://bugs.winehq.org/show_bug.cgi?id=21289 */
|
||||
https://bugs.winehq.org/show_bug.cgi?id=21289 */
|
||||
if (desired_fd < 0)
|
||||
{
|
||||
errno = EBADF;
|
||||
|
|
|
@ -79,7 +79,7 @@ order (unsigned char c)
|
|||
specification can be found in the Debian Policy Manual in the
|
||||
section on the 'Version' control field. This version of the code
|
||||
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
|
||||
verrevcmp (const char *s1, size_t s1_len, const char *s2, size_t s2_len)
|
||||
{
|
||||
|
|
|
@ -111,7 +111,7 @@ stat_func (char const *name, struct stat *st)
|
|||
# endif
|
||||
|
||||
/* 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").
|
||||
Failing that, simulate it via save_cwd/fchdir/(stat|lstat)/restore_cwd.
|
||||
If either the save_cwd or the restore_cwd fails (relatively unlikely),
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
cross-compilers like MinGW.
|
||||
|
||||
This is derived from sqlite3 sources.
|
||||
http://www.sqlite.org/cvstrac/rlog?f=sqlite/src/os_win.c
|
||||
http://www.sqlite.org/copyright.html
|
||||
https://www.sqlite.org/src/finfo?name=src/os_win.c
|
||||
https://www.sqlite.org/copyright.html
|
||||
|
||||
Written by Richard W.M. Jones <rjones.at.redhat.com>
|
||||
|
||||
|
|
|
@ -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:
|
||||
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
|
||||
<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;
|
||||
char format[sizeof "%-+ 0*.*Lg"];
|
||||
|
|
|
@ -96,7 +96,7 @@ enum
|
|||
DIG digits. For why the "+ 1" is needed, see "Binary to Decimal
|
||||
Conversion" in David Goldberg's paper "What Every Computer
|
||||
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) \
|
||||
(INT_BITS_STRLEN_BOUND ((dig) * _GL_FLOAT_DIG_BITS_BOUND) + 1)
|
||||
|
||||
|
|
|
@ -558,6 +558,7 @@ LIBGPM = @LIBGPM@
|
|||
LIBHESIOD = @LIBHESIOD@
|
||||
LIBINTL = @LIBINTL@
|
||||
LIBJPEG = @LIBJPEG@
|
||||
LIBLCMS2 = @LIBLCMS2@
|
||||
LIBMODULES = @LIBMODULES@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBOTF_CFLAGS = @LIBOTF_CFLAGS@
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#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
|
||||
<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))
|
||||
|
||||
/* 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.
|
||||
See above for restrictions. Avoid && and || as they tickle
|
||||
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) \
|
||||
((b) < 0 \
|
||||
? ((a) < 0 \
|
||||
|
@ -443,7 +443,7 @@
|
|||
implementation-defined result or signal for values outside T's
|
||||
range. However, code that works around this theoretical problem
|
||||
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
|
||||
theoretical problem. */
|
||||
|
||||
|
|
|
@ -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
|
||||
standard headers of problematic Apple configurations, as Libc at
|
||||
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. */
|
||||
#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
|
||||
&& (defined __i386__ || defined __x86_64__))
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
|
||||
|
||||
# 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; \
|
||||
struct { unsigned char *_base; int _size; } _bf; \
|
||||
void *cookie; \
|
||||
|
@ -49,7 +49,7 @@
|
|||
fpos_t _offset; \
|
||||
/* More fields, not relevant here. */ \
|
||||
} *) 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 _flags pub._flags
|
||||
# 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 */
|
||||
/* 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 __sbuf _ub; /* ungetc buffer */
|
||||
|
@ -81,7 +81,7 @@
|
|||
#ifdef __TANDEM /* NonStop Kernel */
|
||||
# ifndef _IOERR
|
||||
/* 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 _IOREAD 0x80
|
||||
# define _IOWRT 0x4
|
||||
|
@ -132,7 +132,7 @@ struct _gl_real_FILE
|
|||
# define fp_ ((struct _gl_real_FILE *) fp)
|
||||
|
||||
/* 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 _IOWRT 0x2
|
||||
# define _IORW 0x4
|
||||
|
|
|
@ -152,7 +152,7 @@
|
|||
/* When also using extern inline, suppress the use of static inline in
|
||||
standard headers of problematic Apple configurations, as Libc at
|
||||
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. */
|
||||
#if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
|
||||
&& 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));
|
||||
|
||||
/* 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.
|
||||
This affects only function declaration attributes under certain
|
||||
versions of gcc and clang, and is not needed for C++. */
|
||||
|
|
|
@ -379,7 +379,7 @@ _GL_WARN_ON_USE (dup2, "dup2 is unportable - "
|
|||
Close NEWFD first if it is open.
|
||||
Return newfd if successful, otherwise -1 and errno set.
|
||||
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 !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# 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].
|
||||
Return 0 upon success, or -1 with errno set upon failure.
|
||||
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 !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define pipe2 rpl_pipe2
|
||||
|
|
|
@ -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
|
||||
of files in NFS file systems in some cases. We have no
|
||||
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,
|
||||
compile with -DHAVE_BUGGY_NFS_TIME_STAMPS; this is reported to
|
||||
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);
|
||||
# ifdef __linux__
|
||||
/* Work around a kernel bug:
|
||||
http://bugzilla.redhat.com/442352
|
||||
http://bugzilla.redhat.com/449910
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=442352
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=449910
|
||||
It appears that utimensat can mistakenly return 280 rather
|
||||
than -1 upon ENOSYS failure.
|
||||
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);
|
||||
# ifdef __linux__
|
||||
/* Work around a kernel bug:
|
||||
http://bugzilla.redhat.com/442352
|
||||
http://bugzilla.redhat.com/449910
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=442352
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=449910
|
||||
It appears that utimensat can mistakenly return 280 rather
|
||||
than -1 upon ENOSYS failure.
|
||||
FIXME: remove in 2010 or whenever the offending kernels
|
||||
|
|
|
@ -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
|
||||
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."
|
||||
(set-buffer (generate-new-buffer cal-tex-buffer))
|
||||
(save-match-data
|
||||
|
|
|
@ -286,27 +286,60 @@ BUFFER defaults to current buffer. Does not modify BUFFER."
|
|||
|
||||
|
||||
(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
|
||||
Lisp, and concatenate them separated by newlines into one string.
|
||||
Capture messages issued by Lisp code and concatenate them
|
||||
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
|
||||
code under test from the behavior of the *Messages* buffer."
|
||||
(declare (debug (symbolp body))
|
||||
(indent 1))
|
||||
(let ((g-advice (gensym)))
|
||||
(let ((g-message-advice (gensym))
|
||||
(g-print-advice (gensym))
|
||||
(g-collector (gensym)))
|
||||
`(let* ((,var "")
|
||||
(,g-advice (lambda (func &rest args)
|
||||
(if (or (null args) (equal (car args) ""))
|
||||
(apply func args)
|
||||
(let ((msg (apply #'format-message args)))
|
||||
(setq ,var (concat ,var msg "\n"))
|
||||
(funcall func "%s" msg))))))
|
||||
(advice-add 'message :around ,g-advice)
|
||||
(,g-collector (lambda (msg) (setq ,var (concat ,var msg))))
|
||||
(,g-message-advice (ert--make-message-advice ,g-collector))
|
||||
(,g-print-advice (ert--make-print-advice ,g-collector)))
|
||||
(advice-add 'message :around ,g-message-advice)
|
||||
(advice-add 'prin1 :around ,g-print-advice)
|
||||
(advice-add 'princ :around ,g-print-advice)
|
||||
(advice-add 'print :around ,g-print-advice)
|
||||
(unwind-protect
|
||||
(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)
|
||||
|
|
|
@ -742,9 +742,8 @@ run. ARGS are the arguments to `debugger'."
|
|||
;; backtrace ready for printing is important for batch
|
||||
;; use.
|
||||
;;
|
||||
;; Grab the frames starting from `signal', frames below
|
||||
;; that are all from the debugger.
|
||||
(backtrace (backtrace-frames 'signal))
|
||||
;; Grab the frames above the debugger.
|
||||
(backtrace (cdr (backtrace-frames debugger)))
|
||||
(infos (reverse ert--infos)))
|
||||
(setf (ert--test-execution-info-result info)
|
||||
(cl-ecase type
|
||||
|
|
|
@ -1956,7 +1956,7 @@ E.g. provided via a file-local call to `smie-config-local'.")
|
|||
(defvar smie-config--modefuns nil)
|
||||
|
||||
(defun smie-config--setter (var value)
|
||||
(setq-default var value)
|
||||
(set-default var value)
|
||||
(let ((old-modefuns smie-config--modefuns))
|
||||
(setq smie-config--modefuns nil)
|
||||
(pcase-dolist (`(,mode . ,rules) value)
|
||||
|
@ -1982,7 +1982,7 @@ value with which to replace it."
|
|||
;; FIXME improve value-type.
|
||||
:type '(choice (const nil)
|
||||
(alist :key-type symbol))
|
||||
:initialize 'custom-initialize-default
|
||||
:initialize 'custom-initialize-set
|
||||
:set #'smie-config--setter)
|
||||
|
||||
(defun smie-config-local (rules)
|
||||
|
|
|
@ -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.
|
||||
|
||||
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
|
||||
nil; i.e. SYMBOL can be omitted if only the test result is of
|
||||
interest."
|
||||
|
|
|
@ -381,10 +381,26 @@ This function should move the cursor back to some syntactically safe
|
|||
point (where the PPSS is equivalent to nil).")
|
||||
(make-obsolete-variable 'syntax-begin-function nil "25.1")
|
||||
|
||||
(defvar-local syntax-ppss-cache nil
|
||||
"List of (POS . PPSS) pairs, in decreasing POS order.")
|
||||
(defvar-local syntax-ppss-last nil
|
||||
"Cache of (LAST-POS . LAST-PPSS).")
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Several caches.
|
||||
;;
|
||||
;; 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)
|
||||
(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.
|
||||
(setq syntax-propertize--done (min beg syntax-propertize--done))
|
||||
;; Flush invalid cache entries.
|
||||
(while (and syntax-ppss-cache (> (caar syntax-ppss-cache) beg))
|
||||
(setq syntax-ppss-cache (cdr syntax-ppss-cache)))
|
||||
;; Throw away `last' value if made invalid.
|
||||
(when (< beg (or (car syntax-ppss-last) 0))
|
||||
;; If syntax-begin-function jumped to BEG, then the old state at BEG can
|
||||
;; depend on the text after BEG (which is presumably changed). So if
|
||||
;; BEG=(car (nth 10 syntax-ppss-last)) don't reuse that data because the
|
||||
;; assumed nil state at BEG may not be valid any more.
|
||||
(if (<= beg (or (syntax-ppss-toplevel-pos (cdr syntax-ppss-last))
|
||||
(nth 3 syntax-ppss-last)
|
||||
0))
|
||||
(setq syntax-ppss-last nil)
|
||||
(setcar syntax-ppss-last nil)))
|
||||
;; Unregister if there's no cache left. Sadly this doesn't work
|
||||
;; because `before-change-functions' is temporarily bound to nil here.
|
||||
;; (unless syntax-ppss-cache
|
||||
;; (remove-hook 'before-change-functions 'syntax-ppss-flush-cache t))
|
||||
)
|
||||
(dolist (cell (list syntax-ppss-wide syntax-ppss-narrow))
|
||||
(pcase cell
|
||||
(`(,last . ,cache)
|
||||
(while (and cache (> (caar cache) beg))
|
||||
(setq cache (cdr cache)))
|
||||
;; Throw away `last' value if made invalid.
|
||||
(when (< beg (or (car last) 0))
|
||||
;; If syntax-begin-function jumped to BEG, then the old state at BEG can
|
||||
;; depend on the text after BEG (which is presumably changed). So if
|
||||
;; BEG=(car (nth 10 syntax-ppss-last)) don't reuse that data because the
|
||||
;; assumed nil state at BEG may not be valid any more.
|
||||
(if (<= beg (or (syntax-ppss-toplevel-pos (cdr last))
|
||||
(nth 3 last)
|
||||
0))
|
||||
(setq last nil)
|
||||
(setcar last nil)))
|
||||
;; 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
|
||||
[(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
|
||||
"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)
|
||||
"Parse-Partial-Sexp State at POS, defaulting to point.
|
||||
The returned value is the same as that of `parse-partial-sexp'
|
||||
|
@ -439,10 +471,13 @@ running the hook."
|
|||
(syntax-propertize pos)
|
||||
;;
|
||||
(with-syntax-table (or syntax-ppss-table (syntax-table))
|
||||
(let ((old-ppss (cdr syntax-ppss-last))
|
||||
(old-pos (car syntax-ppss-last))
|
||||
(ppss nil)
|
||||
(pt-min (point-min)))
|
||||
(let* ((cell (syntax-ppss--data))
|
||||
(ppss-last (car cell))
|
||||
(ppss-cache (cdr cell))
|
||||
(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))
|
||||
;; Use the OLD-POS if usable and close. Don't update the `last' cache.
|
||||
(condition-case nil
|
||||
|
@ -475,7 +510,7 @@ running the hook."
|
|||
;; The OLD-* data can't be used. Consult the cache.
|
||||
(t
|
||||
(let ((cache-pred nil)
|
||||
(cache syntax-ppss-cache)
|
||||
(cache ppss-cache)
|
||||
(pt-min (point-min))
|
||||
;; I differentiate between PT-MIN and PT-BEST because
|
||||
;; 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)))
|
||||
|
||||
;; 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
|
||||
'syntax-ppss-flush-cache t t))
|
||||
|
||||
|
@ -541,7 +576,7 @@ running the hook."
|
|||
pt-min (setq pt-min (/ (+ pt-min pos) 2))
|
||||
nil nil 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.
|
||||
(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)
|
||||
(push pair (cdr cache-pred))
|
||||
(setcar cache-pred pair))
|
||||
(if (or (null syntax-ppss-cache)
|
||||
(> (- (caar syntax-ppss-cache) pos)
|
||||
(if (or (null ppss-cache)
|
||||
(> (- (caar ppss-cache) pos)
|
||||
syntax-ppss-max-span))
|
||||
(push pair syntax-ppss-cache)
|
||||
(setcar syntax-ppss-cache pair)))))))))
|
||||
(push pair ppss-cache)
|
||||
(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)
|
||||
(args-out-of-range
|
||||
;; If the buffer is more narrowed than when we built the cache,
|
||||
|
@ -582,7 +619,7 @@ running the hook."
|
|||
(defun syntax-ppss-debug ()
|
||||
(let ((pt 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))
|
||||
(setq pt (car x)))
|
||||
min-diffs))
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
;;; Code:
|
||||
|
||||
;;;###autoload
|
||||
(defun timer-list (&optional _ignore-auto _nonconfirm)
|
||||
(defun list-timers (&optional _ignore-auto _nonconfirm)
|
||||
"List all timers in a buffer."
|
||||
(interactive)
|
||||
(pop-to-buffer-same-window (get-buffer-create "*timer-list*"))
|
||||
|
@ -67,7 +67,7 @@
|
|||
(goto-char (point-min)))
|
||||
;; This command can be destructive if they don't know what they are
|
||||
;; 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
|
||||
(let ((map (make-sparse-keymap)))
|
||||
|
@ -84,7 +84,7 @@
|
|||
(setq bidi-paragraph-direction 'left-to-right)
|
||||
(setq truncate-lines t)
|
||||
(buffer-disable-undo)
|
||||
(setq-local revert-buffer-function 'timer-list)
|
||||
(setq-local revert-buffer-function #'list-timers)
|
||||
(setq buffer-read-only t)
|
||||
(setq header-line-format
|
||||
(format "%4s %10s %8s %s"
|
||||
|
|
|
@ -142,7 +142,7 @@ function `string-to-number'."
|
|||
(defmacro eshell-condition-case (tag form &rest handlers)
|
||||
"If `eshell-handle-errors' is non-nil, this is `condition-case'.
|
||||
Otherwise, evaluates FORM with no error handling."
|
||||
(declare (indent 2))
|
||||
(declare (indent 2) (debug (sexp form &rest form)))
|
||||
(if eshell-handle-errors
|
||||
`(condition-case-unless-debug ,tag
|
||||
,form
|
||||
|
|
|
@ -150,8 +150,13 @@ Called with an absolute file name as argument, it returns t to enable backup.")
|
|||
(defcustom buffer-offer-save nil
|
||||
"Non-nil in a buffer means always offer to save buffer on exit.
|
||||
Do so even if the buffer is not visiting a file.
|
||||
Automatically local in all buffers."
|
||||
:type 'boolean
|
||||
Automatically local in all buffers.
|
||||
|
||||
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)
|
||||
(make-variable-buffer-local 'buffer-offer-save)
|
||||
(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))
|
||||
(or
|
||||
(buffer-file-name buffer)
|
||||
(and pred
|
||||
(progn
|
||||
(set-buffer buffer)
|
||||
(and buffer-offer-save (> (buffer-size) 0))))
|
||||
(buffer-local-value
|
||||
'write-contents-functions buffer))
|
||||
(with-current-buffer buffer
|
||||
(or (eq buffer-offer-save 'always)
|
||||
(and pred buffer-offer-save (> (buffer-size) 0)))))
|
||||
(or (not (functionp pred))
|
||||
(with-current-buffer buffer (funcall pred)))
|
||||
(if arg
|
||||
|
@ -5336,7 +5338,7 @@ instance of such commands."
|
|||
"Make directory DIR if it is not already a directory. Return nil."
|
||||
(condition-case err
|
||||
(make-directory-internal dir)
|
||||
(file-already-exists
|
||||
(error
|
||||
(unless (file-directory-p dir)
|
||||
(signal (car err) (cdr err))))))
|
||||
|
||||
|
@ -5372,7 +5374,7 @@ raised."
|
|||
(while (progn
|
||||
(setq parent (directory-file-name
|
||||
(file-name-directory dir)))
|
||||
(condition-case err
|
||||
(condition-case ()
|
||||
(files--ensure-directory dir)
|
||||
(file-missing
|
||||
;; 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;
|
||||
;; that is where we will copy the files of DIRECTORY.
|
||||
(make-directory newname parents))
|
||||
;; If NEWNAME is a directory name and COPY-CONTENTS
|
||||
;; is nil, copy into NEWNAME/[DIRECTORY-BASENAME].
|
||||
((not copy-contents)
|
||||
(setq newname (concat newname
|
||||
(file-name-nondirectory directory)))
|
||||
(and (file-exists-p newname)
|
||||
(not (file-directory-p newname))
|
||||
(error "Cannot overwrite non-directory %s with a directory"
|
||||
newname))
|
||||
(make-directory newname t)))
|
||||
;; NEWNAME is a directory name. If COPY-CONTENTS is non-nil,
|
||||
;; create NEWNAME if it is not already a directory;
|
||||
;; otherwise, create NEWNAME/[DIRECTORY-BASENAME].
|
||||
((if copy-contents
|
||||
(or parents (not (file-directory-p newname)))
|
||||
(setq newname (concat newname
|
||||
(file-name-nondirectory directory))))
|
||||
(make-directory (directory-file-name newname) parents)))
|
||||
|
||||
;; Copy recursively.
|
||||
(dolist (file
|
||||
|
@ -5565,7 +5565,7 @@ into NEWNAME instead."
|
|||
(filetype (car (file-attributes file))))
|
||||
(cond
|
||||
((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
|
||||
(make-symbolic-link filetype target t))
|
||||
((copy-file file target t keep-time)))))
|
||||
|
|
|
@ -604,11 +604,12 @@ new frame."
|
|||
(select-frame (make-frame))))
|
||||
|
||||
(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
|
||||
"Functions to run after a frame is created.
|
||||
The functions are run with one arg, the newly created frame.")
|
||||
"Functions to run after `make-frame' created a new frame.
|
||||
The functions are run with one argument, the newly created
|
||||
frame.")
|
||||
|
||||
(defvar after-setting-font-hook nil
|
||||
"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")
|
||||
|
||||
(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)
|
||||
|
||||
|
@ -632,9 +633,6 @@ form (NAME . VALUE), for example:
|
|||
(width . NUMBER) The frame should be NUMBER characters in width.
|
||||
(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 . nil) The frame should have no 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',
|
||||
but not present in PARAMETERS, is applied.
|
||||
|
||||
Before creating the frame (via `frame-creation-function-alist'),
|
||||
this function runs the hook `before-make-frame-hook'. After
|
||||
creating the frame, it runs the hook `after-make-frame-functions'
|
||||
with one arg, the newly created frame.
|
||||
Before creating the frame (via `frame-creation-function'), this
|
||||
function runs the hook `before-make-frame-hook'. After creating
|
||||
the frame, it runs the hook `after-make-frame-functions' with one
|
||||
argument, the newly created frame.
|
||||
|
||||
If a display parameter is supplied and a window-system is not,
|
||||
guess the window-system from the display.
|
||||
|
|
|
@ -447,7 +447,7 @@ DO NOT MODIFY. See `frameset-filter-alist' for a full description.")
|
|||
(buffer-predicate . :never)
|
||||
(buried-buffer-list . :never)
|
||||
(delete-before . :never)
|
||||
(font . frameset-filter-shelve-param)
|
||||
(font . frameset-filter-font-param)
|
||||
(foreground-color . frameset-filter-sanitize-color)
|
||||
(fullscreen . frameset-filter-shelve-param)
|
||||
(GUI:font . frameset-filter-unshelve-param)
|
||||
|
@ -631,6 +631,17 @@ see `frameset-filter-alist'."
|
|||
(setcdr found val)
|
||||
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)
|
||||
"Remove CURRENT when saving an iconified frame.
|
||||
This is used for positional parameters `left' and `top', which are
|
||||
|
|
|
@ -991,7 +991,6 @@ are replaced:
|
|||
%F The first name if present, e.g.: \"John\", else fall
|
||||
back to the mail address.
|
||||
%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'
|
||||
which is called using the date from the article your replying to, but
|
||||
|
|
|
@ -1916,6 +1916,34 @@ CLICK position, kill the secondary selection."
|
|||
(> (length str) 0)
|
||||
(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
|
||||
"Number of buffers in one pane (submenu) of the buffer menu.
|
||||
|
|
|
@ -232,6 +232,7 @@ non-Windows systems."
|
|||
;; 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, ...).
|
||||
(setq amt (* amt (event-click-count event))))
|
||||
(when (numberp amt) (setq amt (* amt (event-line-count event))))
|
||||
(unwind-protect
|
||||
(let ((button (mwheel-event-button event)))
|
||||
(cond ((eq button mouse-wheel-down-event)
|
||||
|
|
|
@ -164,10 +164,14 @@ is consulted."
|
|||
(non-viewer . t)
|
||||
(type . "application/zip")
|
||||
("copiousoutput"))
|
||||
("pdf"
|
||||
(viewer . pdf-view-mode)
|
||||
(type . "application/pdf")
|
||||
(test . window-system))
|
||||
("pdf"
|
||||
(viewer . doc-view-mode)
|
||||
(type . "application/pdf")
|
||||
(test . (eq window-system 'x)))
|
||||
(test . window-system))
|
||||
("pdf"
|
||||
(viewer . "gv -safer %s")
|
||||
(type . "application/pdf")
|
||||
|
|
|
@ -740,7 +740,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
|
|||
|
||||
;; Remote newname.
|
||||
(when (and (file-directory-p newname)
|
||||
(directory-name-p newname))
|
||||
(tramp-compat-directory-name-p newname))
|
||||
(setq newname
|
||||
(expand-file-name
|
||||
(file-name-nondirectory filename) newname)))
|
||||
|
|
|
@ -23,8 +23,9 @@
|
|||
|
||||
;;; Commentary:
|
||||
|
||||
;; Tramp's main Emacs version for development is Emacs 26. This
|
||||
;; package provides compatibility functions for Emacs 24 and Emacs 25.
|
||||
;; Tramp's main Emacs version for development is Emacs 27. This
|
||||
;; package provides compatibility functions for Emacs 24, Emacs 25 and
|
||||
;; Emacs 26.
|
||||
|
||||
;;; Code:
|
||||
|
||||
|
@ -104,6 +105,10 @@ Add the extension of F, if existing."
|
|||
'tramp-error vec-or-proc
|
||||
(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.
|
||||
|
||||
(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."
|
||||
(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.
|
||||
(unless (fboundp 'format-message)
|
||||
(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.
|
||||
(defconst tramp-file-missing
|
||||
(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)
|
||||
(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)
|
||||
|
||||
;;; TODO:
|
||||
|
|
|
@ -613,7 +613,7 @@ use Cwd \"realpath\";
|
|||
|
||||
sub myrealpath {
|
||||
my ($file) = @_;
|
||||
return realpath($file) if -e $file;
|
||||
return realpath($file) if (-e $file || -l $file);
|
||||
}
|
||||
|
||||
sub recursive {
|
||||
|
@ -1139,12 +1139,7 @@ component is used as the target of the symlink."
|
|||
(tramp-shell-quote-argument localname)))
|
||||
(with-current-buffer (tramp-get-connection-buffer v)
|
||||
(goto-char (point-min))
|
||||
(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)))
|
||||
(setq result (buffer-substring (point-min) (point-at-eol)))))
|
||||
|
||||
;; Use Perl implementation.
|
||||
((and (tramp-get-remote-perl v)
|
||||
|
@ -1198,16 +1193,6 @@ component is used as the target of the symlink."
|
|||
(setq numchase (1+ numchase))
|
||||
(when (file-name-absolute-p symlink-target)
|
||||
(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
|
||||
(append
|
||||
(split-string symlink-target "/" 'omit) steps)))
|
||||
|
@ -1226,6 +1211,13 @@ component is used as the target of the symlink."
|
|||
"/"))
|
||||
(when (string= "" 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
|
||||
;; for security reasons.
|
||||
(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.
|
||||
(progn
|
||||
(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))
|
||||
(setq dirname (directory-file-name (expand-file-name dirname))
|
||||
newname (directory-file-name (expand-file-name newname)))
|
||||
|
|
|
@ -415,7 +415,7 @@ pass to the OPERATION."
|
|||
(with-tramp-progress-reporter
|
||||
v 0 (format "Copying %s to %s" dirname 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))
|
||||
(cond
|
||||
;; We must use a local temporary directory.
|
||||
|
@ -535,7 +535,7 @@ pass to the OPERATION."
|
|||
;; Reset the transfer process properties.
|
||||
(tramp-set-connection-property v "process-name" 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.
|
||||
(when keep-date
|
||||
|
@ -586,7 +586,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
|
|||
|
||||
;; Remote newname.
|
||||
(when (and (file-directory-p newname)
|
||||
(directory-name-p newname))
|
||||
(tramp-compat-directory-name-p newname))
|
||||
(setq 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.
|
||||
Either the shares are listed, or the `dir' command is executed.
|
||||
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
|
||||
(setq localname (or localname "/"))
|
||||
(with-tramp-file-property v localname "file-entries"
|
||||
|
|
|
@ -3169,7 +3169,7 @@ User is always nil."
|
|||
|
||||
(defun tramp-handle-file-truename (filename)
|
||||
"Like `file-truename' for Tramp files."
|
||||
(let ((result filename)
|
||||
(let ((result (expand-file-name filename))
|
||||
(numchase 0)
|
||||
;; Don't make the following value larger than
|
||||
;; necessary. People expect an error message in a
|
||||
|
@ -3180,7 +3180,7 @@ User is always nil."
|
|||
symlink-target)
|
||||
(format
|
||||
"%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"
|
||||
(while (and (setq symlink-target (file-symlink-p result))
|
||||
(< numchase numchase-limit))
|
||||
|
@ -3850,7 +3850,7 @@ Erase echoed commands if exists."
|
|||
(min (+ (point-min) tramp-echo-mark-marker-length)
|
||||
(point-max))))))
|
||||
;; 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
|
||||
;; directory listings with some thousand files. Therefore, we
|
||||
;; look from the end.
|
||||
|
@ -4547,16 +4547,23 @@ Only works for Bourne-like shells."
|
|||
(t process)))
|
||||
pid)
|
||||
;; If it's a Tramp process, send the INT signal remotely.
|
||||
(when (and (processp proc) (process-live-p proc)
|
||||
(setq pid (process-get proc 'remote-pid)))
|
||||
(tramp-message proc 5 "Interrupt process %s with pid %s" proc pid)
|
||||
;; This is for tramp-sh.el. Other backends do not support this (yet).
|
||||
(tramp-compat-funcall
|
||||
'tramp-send-command
|
||||
(tramp-get-connection-property proc "vector" nil)
|
||||
(format "kill -2 %d" pid))
|
||||
;; Report success.
|
||||
proc)))
|
||||
(when (and (processp proc) (setq pid (process-get proc 'remote-pid)))
|
||||
(if (not (process-live-p proc))
|
||||
(tramp-error proc 'error "Process %s is not active" proc)
|
||||
(tramp-message proc 5 "Interrupt process %s with pid %s" proc pid)
|
||||
;; This is for tramp-sh.el. Other backends do not support this (yet).
|
||||
(tramp-compat-funcall
|
||||
'tramp-send-command
|
||||
(tramp-get-connection-property proc "vector" nil)
|
||||
(format "kill -2 %d" pid))
|
||||
;; 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.
|
||||
(when (boundp 'interrupt-process-functions)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
;; Maintainer: Michael Albinus <michael.albinus@gmx.de>
|
||||
;; Keywords: comm, processes
|
||||
;; Package: tramp
|
||||
;; Version: 2.3.3-pre
|
||||
;; Version: 2.3.3.26.1
|
||||
|
||||
;; This file is part of GNU Emacs.
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
|||
;; should be changed only there.
|
||||
|
||||
;;;###tramp-autoload
|
||||
(defconst tramp-version "2.3.3-pre"
|
||||
(defconst tramp-version "2.3.3.26.1"
|
||||
"This version of Tramp.")
|
||||
|
||||
;;;###tramp-autoload
|
||||
|
@ -55,7 +55,7 @@
|
|||
;; Check for Emacs version.
|
||||
(let ((x (if (>= emacs-major-version 24)
|
||||
"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))
|
||||
(match-string 0 (emacs-version)))))))
|
||||
(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.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.2" . "25.3")))
|
||||
("2.2.13.25.2" . "25.3")
|
||||
("2.3.3.26.1" . "26.1")))
|
||||
|
||||
(add-hook 'tramp-unload-hook
|
||||
(lambda ()
|
||||
|
|
|
@ -5015,10 +5015,10 @@
|
|||
* ox-latex.el (org-latex-listings): Update docstring.
|
||||
|
||||
* 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
|
||||
back-end definiton.
|
||||
back-end definition.
|
||||
|
||||
* ox-html.el (org-html--format-toc-headline): Make use of
|
||||
anonymous back-ends.
|
||||
|
|
|
@ -84,11 +84,11 @@
|
|||
. 'bat-label-face)
|
||||
("\\_<\\(defined\\|set\\)\\_>[ \t]*\\(\\(\\sw\\|\\s_\\)+\\)"
|
||||
(2 font-lock-variable-name-face))
|
||||
("%\\(\\(\\sw\\|\\s_\\)+\\)%"
|
||||
("%\\([^%~ \n]+\\)%?"
|
||||
(1 font-lock-variable-name-face))
|
||||
("!\\(\\(\\sw\\|\\s_\\)+\\)!" ; delayed-expansion !variable!
|
||||
("!\\([^!%~ \n]+\\)!?" ; delayed-expansion !variable!
|
||||
(1 font-lock-variable-name-face))
|
||||
("%%\\(?:~[adfnpstxz]*\\(?:\\$\\(\\(?:\\sw\\|\\s_\\)+\\):\\)?\\)?\\([]!#$&-:?-[_-{}~]\\)"
|
||||
("%%\\(?:~[adfnpstxz]*\\(?:\\$\\(\\(?:\\sw\\|\\s_\\|_\\)+\\):\\)?\\)?\\([]!#$&-:?-[_-{}~]\\)"
|
||||
(1 font-lock-variable-name-face nil t) ; PATH expansion
|
||||
(2 font-lock-variable-name-face)) ; iteration variable or positional parameter
|
||||
("[ =][-/]+\\(\\w+\\)"
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -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
|
@ -4271,8 +4271,10 @@ See `python-check-command' for the default."
|
|||
import inspect
|
||||
try:
|
||||
str_type = basestring
|
||||
argspec_function = inspect.getargspec
|
||||
except NameError:
|
||||
str_type = str
|
||||
argspec_function = inspect.getfullargspec
|
||||
if isinstance(obj, str_type):
|
||||
obj = eval(obj, globals())
|
||||
doc = inspect.getdoc(obj)
|
||||
|
@ -4285,9 +4287,7 @@ See `python-check-command' for the default."
|
|||
target = obj
|
||||
objtype = 'def'
|
||||
if target:
|
||||
args = inspect.formatargspec(
|
||||
*inspect.getargspec(target)
|
||||
)
|
||||
args = inspect.formatargspec(*argspec_function(target))
|
||||
name = obj.__name__
|
||||
doc = '{objtype} {name}{args}'.format(
|
||||
objtype=objtype, name=name, args=args
|
||||
|
|
|
@ -593,11 +593,7 @@ sign. See `sh-feature'."
|
|||
(sexp :format "Evaluate: %v"))))
|
||||
:group 'sh-script)
|
||||
|
||||
|
||||
(defcustom sh-indentation 4
|
||||
"The width for further indentation in Shell-Script mode."
|
||||
:type 'integer
|
||||
:group 'sh-script)
|
||||
(define-obsolete-variable-alias 'sh-indentation 'sh-basic-offset "26.1")
|
||||
(put 'sh-indentation 'safe-local-variable 'integerp)
|
||||
|
||||
(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-filter-function 'sh-quoted-p)
|
||||
(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-newline-indent-rigidly t)
|
||||
(setq-local defun-prompt-regexp
|
||||
|
@ -2012,7 +2008,7 @@ May return nil if the line should not be treated as continued."
|
|||
(forward-line -1)
|
||||
(if (sh-smie--looking-back-at-continuation-p)
|
||||
(current-indentation)
|
||||
(+ (current-indentation) sh-indentation))))
|
||||
(+ (current-indentation) sh-basic-offset))))
|
||||
(t
|
||||
;; Just make sure a line-continuation is indented deeper.
|
||||
(save-excursion
|
||||
|
@ -2033,13 +2029,13 @@ May return nil if the line should not be treated as continued."
|
|||
;; check the line before that one.
|
||||
(> ci indent))
|
||||
(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)))))
|
||||
indent))))))
|
||||
|
||||
(defun sh-smie-sh-rules (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)
|
||||
(sh-var-value 'sh-indent-for-case-label)))
|
||||
(`(:before . ,(or `"(" `"{" `"[" "while" "if" "for" "case"))
|
||||
|
@ -2248,8 +2244,8 @@ Point should be before the newline."
|
|||
|
||||
(defun sh-smie-rc-rules (kind token)
|
||||
(pcase (cons kind token)
|
||||
(`(:elem . basic) sh-indentation)
|
||||
;; (`(:after . "case") (or sh-indentation smie-indent-basic))
|
||||
(`(:elem . basic) sh-basic-offset)
|
||||
;; (`(:after . "case") (or sh-basic-offset smie-indent-basic))
|
||||
(`(:after . ";")
|
||||
(if (smie-rule-parent-p "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 ()
|
||||
"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."
|
||||
(interactive)
|
||||
(let ((previous (save-excursion
|
||||
|
@ -2514,9 +2510,9 @@ Lines containing only comments are considered empty."
|
|||
(delete-region (point)
|
||||
(progn (beginning-of-line) (point)))
|
||||
(if (eolp)
|
||||
(max previous (* (1+ (/ current sh-indentation))
|
||||
sh-indentation))
|
||||
(* (1+ (/ current sh-indentation)) sh-indentation))))))
|
||||
(max previous (* (1+ (/ current sh-basic-offset))
|
||||
sh-basic-offset))
|
||||
(* (1+ (/ current sh-basic-offset)) sh-basic-offset))))))
|
||||
(if (< (current-column) (current-indentation))
|
||||
(skip-chars-forward " \t"))))
|
||||
|
||||
|
@ -3594,6 +3590,10 @@ so that `occur-next' and `occur-prev' will work."
|
|||
(defun sh-learn-buffer-indent (&optional arg)
|
||||
"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
|
||||
values of a variable, and the final value of all variables learned.
|
||||
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
|
||||
function completes. The function is abnormal because it is called
|
||||
with an alist of variables learned. This feature may be changed or
|
||||
removed in the future.
|
||||
with an alist of variables learned.
|
||||
|
||||
This command can often take a long time to run."
|
||||
(interactive "P")
|
||||
|
@ -3809,7 +3808,6 @@ This command can often take a long time to run."
|
|||
" has" "s have")
|
||||
(if (zerop num-diffs)
|
||||
"." ":"))))))
|
||||
;; Are abnormal hooks considered bad form?
|
||||
(run-hook-with-args 'sh-learned-buffer-hook learned-var-list)
|
||||
(and (called-interactively-p 'any)
|
||||
(or sh-popup-occur-buffer (> num-diffs 0))
|
||||
|
|
|
@ -928,12 +928,14 @@ IGNORES is a list of glob patterns."
|
|||
files
|
||||
(expand-file-name dir)
|
||||
ignores))
|
||||
(def default-directory)
|
||||
(buf (get-buffer-create " *xref-grep*"))
|
||||
(`(,grep-re ,file-group ,line-group . ,_) (car grep-regexp-alist))
|
||||
(status nil)
|
||||
(hits nil))
|
||||
(with-current-buffer buf
|
||||
(erase-buffer)
|
||||
(setq default-directory def)
|
||||
(setq status
|
||||
(call-process-shell-command command nil t))
|
||||
(goto-char (point-min))
|
||||
|
|
|
@ -39,11 +39,11 @@
|
|||
|
||||
(defcustom shell-command-dont-erase-buffer nil
|
||||
"If non-nil, output buffer is not erased between shell commands.
|
||||
Also, a non-nil value set the point in the output buffer
|
||||
once the command complete.
|
||||
The value `beg-last-out' set point at the beginning of the output,
|
||||
`end-last-out' set point at the end of the buffer, `save-point'
|
||||
restore the buffer position before the command."
|
||||
Also, a non-nil value sets the point in the output buffer
|
||||
once the command completes.
|
||||
The value `beg-last-out' sets point at the beginning of the output,
|
||||
`end-last-out' sets point at the end of the buffer, `save-point'
|
||||
restores the buffer position before the command."
|
||||
:type '(choice
|
||||
(const :tag "Erase buffer" nil)
|
||||
(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")
|
||||
|
||||
(defvar shell-command-saved-pos nil
|
||||
"Point position in the output buffer after command complete.
|
||||
It is an alist (BUFFER . POS), where BUFFER is the output
|
||||
buffer, and POS is the point position in BUFFER once the command finish.
|
||||
"Point position in the output buffer after command completes.
|
||||
It is an alist of (BUFFER . POS), where BUFFER is the output
|
||||
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.")
|
||||
|
||||
(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
|
||||
;; *before* other functions on that hook.
|
||||
(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'.
|
||||
(if use-hard-newlines
|
||||
(set-hard-newline-properties
|
||||
|
@ -456,25 +452,22 @@ A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'."
|
|||
;; starts a page.
|
||||
(or was-page-start
|
||||
(move-to-left-margin nil t)))))
|
||||
(unwind-protect
|
||||
(if (not interactive)
|
||||
;; FIXME: For non-interactive uses, many calls actually
|
||||
;; just want (insert "\n"), so maybe we should do just
|
||||
;; that, so as to avoid the risk of filling or running
|
||||
;; abbrevs unexpectedly.
|
||||
(let ((post-self-insert-hook (list postproc)))
|
||||
(self-insert-command arg))
|
||||
(unwind-protect
|
||||
(progn
|
||||
(add-hook 'post-self-insert-hook postproc nil t)
|
||||
(self-insert-command arg))
|
||||
;; We first used let-binding to protect the hook, but that
|
||||
;; was naive since add-hook affects the symbol-default
|
||||
;; value of the variable, whereas the let-binding might
|
||||
;; only protect the buffer-local value.
|
||||
(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))))))
|
||||
(if (not interactive)
|
||||
;; FIXME: For non-interactive uses, many calls actually
|
||||
;; just want (insert "\n"), so maybe we should do just
|
||||
;; that, so as to avoid the risk of filling or running
|
||||
;; abbrevs unexpectedly.
|
||||
(let ((post-self-insert-hook (list postproc)))
|
||||
(self-insert-command arg))
|
||||
(unwind-protect
|
||||
(progn
|
||||
(add-hook 'post-self-insert-hook postproc nil t)
|
||||
(self-insert-command arg))
|
||||
;; We first used let-binding to protect the hook, but that
|
||||
;; was naive since add-hook affects the symbol-default
|
||||
;; value of the variable, whereas the let-binding might
|
||||
;; only protect the buffer-local value.
|
||||
(remove-hook 'post-self-insert-hook postproc t))))
|
||||
nil)
|
||||
|
||||
(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
|
||||
is undefined. If METHOD is nil, then return the content as a string.
|
||||
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
|
||||
as a string, after filtering it with `filter-buffer-substring', which
|
||||
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)))
|
||||
|
||||
(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))
|
||||
|
||||
(defun region-noncontiguous-p ()
|
||||
|
|
|
@ -289,7 +289,7 @@ The name is made by appending `gensym-counter' to PREFIX.
|
|||
PREFIX is a string, and defaults to \"g\"."
|
||||
(let ((num (prog1 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)
|
||||
"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.
|
||||
The return value is a positive integer."
|
||||
(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.
|
||||
|
||||
|
|
|
@ -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])
|
||||
|
||||
|
||||
;;;; 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.
|
||||
|
||||
;; Functions for color panel + drag
|
||||
|
|
|
@ -1578,7 +1578,7 @@ to look up will be substituted there."
|
|||
(goto-char (point-min))
|
||||
(let ((window (get-buffer-window (current-buffer) 'visible)))
|
||||
(when window
|
||||
(when (re-search-forward "^Summary" nil 'move)
|
||||
(when (re-search-forward "^\\(Summary\\|Syntax\\)" nil 'move)
|
||||
(beginning-of-line)
|
||||
(set-window-start window (point))))))
|
||||
|
||||
|
|
|
@ -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-dictionary-alist)
|
||||
(error "No data for dictionary \"%s\" in `ispell-local-dictionary-alist' or `ispell-dictionary-alist'"
|
||||
ispell-current-dictionary))))
|
||||
(decode-coding-string (nth n slot) (ispell-get-coding-system) t)))
|
||||
ispell-current-dictionary)))
|
||||
(str (nth n slot)))
|
||||
(if (stringp str)
|
||||
(decode-coding-string str (ispell-get-coding-system) t))))
|
||||
|
||||
(defun ispell-get-casechars ()
|
||||
(ispell-get-decoded-string 1))
|
||||
|
|
|
@ -583,6 +583,7 @@ directory for only the accessible portion of the buffer."
|
|||
(with-output-to-temp-buffer pages-directory-buffer
|
||||
(with-current-buffer standard-output
|
||||
(pages-directory-mode)
|
||||
(setq buffer-read-only nil)
|
||||
(insert
|
||||
"==== Pages Directory: use `C-c C-c' to go to page under cursor. ====" ?\n)
|
||||
(setq pages-buffer pages-target-buffer)
|
||||
|
@ -631,6 +632,7 @@ directory for only the accessible portion of the buffer."
|
|||
)))))
|
||||
|
||||
(set-buffer standard-output)
|
||||
(setq buffer-read-only t)
|
||||
;; Put positions in increasing order to go with buffer.
|
||||
(setq pages-pos-list (nreverse pages-pos-list))
|
||||
(if (called-interactively-p 'interactive)
|
||||
|
|
|
@ -608,10 +608,16 @@ considered file(s)."
|
|||
(log-view-diff-common beg end t)))
|
||||
|
||||
(defun log-view-diff-common (beg end &optional whole-changeset)
|
||||
(let ((to (log-view-current-tag beg))
|
||||
(fr (log-view-current-tag end)))
|
||||
(when (string-equal fr to)
|
||||
;; TO and FR are the same, look at the previous revision.
|
||||
(let* ((to (log-view-current-tag beg))
|
||||
(fr-entry (log-view-current-entry end))
|
||||
(fr (cadr fr-entry)))
|
||||
;; 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)))
|
||||
(vc-diff-internal
|
||||
t (list log-view-vc-backend
|
||||
|
|
|
@ -725,7 +725,7 @@ this keeps \"UUU\"."
|
|||
(let ((i 3))
|
||||
(while (or (not (match-end i))
|
||||
(< (point) (match-beginning i))
|
||||
(>= (point) (match-end i)))
|
||||
(> (point) (match-end i)))
|
||||
(cl-decf i))
|
||||
i))
|
||||
|
||||
|
|
|
@ -1035,6 +1035,7 @@ If LIMIT is non-nil, show no more than this many entries."
|
|||
|
||||
(defun vc-git-log-outgoing (buffer remote-location)
|
||||
(interactive)
|
||||
(vc-setup-buffer buffer)
|
||||
(vc-git-command
|
||||
buffer 'async nil
|
||||
"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)
|
||||
(interactive)
|
||||
(vc-setup-buffer buffer)
|
||||
(vc-git-command nil 0 nil "fetch")
|
||||
(vc-git-command
|
||||
buffer 'async nil
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
|
||||
(defun xdg-thumb-uri (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"
|
||||
(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)
|
||||
(error "Expected group name! Instead saw: %s"
|
||||
(buffer-substring (point) (point-at-eol))))
|
||||
(unless (equal (match-string 1) "Desktop Entry")
|
||||
(error "Wrong first group: %s" (match-string 1)))
|
||||
(when group
|
||||
(while (and (re-search-forward xdg-desktop-group-regexp nil t)
|
||||
(not (equal (match-string 1) group)))))
|
||||
|
|
|
@ -44,12 +44,12 @@ AC_DEFUN([gl_FUNC_ALLOCA],
|
|||
AC_DEFUN([gl_PREREQ_ALLOCA], [:])
|
||||
|
||||
# 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], [] ,[
|
||||
|
||||
# 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
|
||||
# -----------------
|
||||
|
|
|
@ -11,7 +11,7 @@ AC_DEFUN([gl_EXTERN_INLINE],
|
|||
[/* 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
|
||||
<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
|
||||
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:
|
||||
|
||||
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
|
||||
http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log
|
||||
|
||||
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
|
||||
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. */
|
||||
#if (((defined __APPLE__ && defined __MACH__) \
|
||||
|| defined __DragonFly__ || defined __FreeBSD__) \
|
||||
|
|
|
@ -20,7 +20,7 @@ AC_DEFUN([gl_FUNC_FSTATAT],
|
|||
HAVE_FSTATAT=0
|
||||
else
|
||||
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],
|
||||
[gl_cv_func_fstatat_zero_flag],
|
||||
[AC_RUN_IFELSE(
|
||||
|
|
|
@ -228,13 +228,13 @@ m4_ifndef([AS_VAR_IF],
|
|||
# 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 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
|
||||
# <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:
|
||||
# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options
|
||||
# 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_DEFUN([gl_PROG_CC_C99],
|
||||
[
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# manywarnings.m4 serial 12
|
||||
# manywarnings.m4 serial 13
|
||||
dnl Copyright (C) 2008-2017 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
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
|
||||
# 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
|
||||
# and AC_COMPUTE_INT requires it to fit in a long:
|
||||
# Would prefer "min (PTRDIFF_MAX, SIZE_MAX)", but it must be a literal.
|
||||
# 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_COMPUTE_INT([gl_alloc_max],
|
||||
[(LONG_MAX < PTRDIFF_MAX ? LONG_MAX : PTRDIFF_MAX) < (size_t) -1
|
||||
? (LONG_MAX < PTRDIFF_MAX ? LONG_MAX : PTRDIFF_MAX)
|
||||
: (size_t) -1],
|
||||
[LONG_MAX < (PTRDIFF_MAX < (size_t) -1 ? PTRDIFF_MAX : (size_t) -1)
|
||||
? -1
|
||||
: PTRDIFF_MAX < (size_t) -1 ? (long) PTRDIFF_MAX : (long) (size_t) -1],
|
||||
[[#include <limits.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
]],
|
||||
[gl_alloc_max=2147483647])
|
||||
case $gl_alloc_max in
|
||||
-1) gl_alloc_max=9223372036854775807;;
|
||||
esac
|
||||
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 -Warray-bounds=2"
|
||||
|
|
|
@ -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 The resulting compiler passes the test case here, and that's
|
||||
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 with extended modes being tried first.
|
||||
[[-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,
|
||||
# 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],
|
||||
[AC_REQUIRE([AC_PROG_CC])],
|
||||
[$0 is obsolete; use AC_PROG_CC]
|
||||
|
|
|
@ -40,7 +40,7 @@ AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
|
|||
m4_version_prereq([2.70], [], [
|
||||
|
||||
# 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])
|
||||
AC_DEFUN([AC_HEADER_MAJOR],
|
||||
|
|
|
@ -27,7 +27,7 @@ AC_DEFUN([AC_C_VARARRAYS],
|
|||
[[/* Test for VLA support. This test is partly inspired
|
||||
from examples in the C standard. Use at least two VLA
|
||||
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__
|
||||
syntax error;
|
||||
|
|
|
@ -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
|
||||
## empty.
|
||||
W32_OBJ=@W32_OBJ@
|
||||
## -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32 lusp10 -lcomctl32
|
||||
## -lkernel32 -luser32 -lusp10 -lgdi32 -lole32 -lcomdlg32 -lcomctl32
|
||||
## --lwinspool if HAVE_W32, else empty.
|
||||
W32_LIBS=@W32_LIBS@
|
||||
|
||||
|
|
|
@ -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.
|
||||
`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 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++)
|
||||
{
|
||||
visargs[1] = make_string (tem + 1, strcspn (tem + 1, "\n"));
|
||||
if (strchr (SSDATA (visargs[1]), '%'))
|
||||
callint_message = Fformat_message (i - 1, visargs + 1);
|
||||
else
|
||||
callint_message = visargs[1];
|
||||
callint_message = styled_format (i - 1, visargs + 1, true, false);
|
||||
|
||||
switch (*tem)
|
||||
{
|
||||
|
|
12
src/data.c
12
src/data.c
|
@ -3010,16 +3010,16 @@ static Lisp_Object
|
|||
minmax_driver (ptrdiff_t nargs, Lisp_Object *args,
|
||||
enum Arith_Comparison comparison)
|
||||
{
|
||||
eassume (0 < nargs);
|
||||
Lisp_Object accum = args[0]; /* pacify GCC */
|
||||
for (ptrdiff_t argnum = 0; argnum < nargs; argnum++)
|
||||
Lisp_Object accum = args[0];
|
||||
CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (accum);
|
||||
for (ptrdiff_t argnum = 1; argnum < nargs; argnum++)
|
||||
{
|
||||
Lisp_Object val = args[argnum];
|
||||
CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (val);
|
||||
if (argnum == 0 || !NILP (arithcompare (val, accum, comparison)))
|
||||
if (!NILP (arithcompare (val, accum, comparison)))
|
||||
accum = val;
|
||||
else if (FLOATP (accum) && isnan (XFLOAT_DATA (accum)))
|
||||
return accum;
|
||||
else if (FLOATP (val) && isnan (XFLOAT_DATA (val)))
|
||||
return val;
|
||||
}
|
||||
return accum;
|
||||
}
|
||||
|
|
|
@ -237,7 +237,8 @@ static char *
|
|||
XD_OBJECT_TO_STRING (Lisp_Object object)
|
||||
{
|
||||
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) \
|
||||
|
|
|
@ -74,7 +74,6 @@ static Lisp_Object format_time_string (char const *, ptrdiff_t, struct timespec,
|
|||
static long int tm_gmtoff (struct tm *);
|
||||
static int tm_diff (struct tm *, struct tm *);
|
||||
static void update_buffer_properties (ptrdiff_t, ptrdiff_t);
|
||||
static Lisp_Object styled_format (ptrdiff_t, Lisp_Object *, bool);
|
||||
|
||||
#ifndef HAVE_TM_GMTOFF
|
||||
# define HAVE_TM_GMTOFF false
|
||||
|
@ -187,7 +186,8 @@ tzlookup (Lisp_Object zone, bool settz)
|
|||
if (sec != 0)
|
||||
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);
|
||||
zone_string = tzbuf;
|
||||
}
|
||||
|
@ -3958,7 +3958,7 @@ usage: (message FORMAT-STRING &rest ARGS) */)
|
|||
}
|
||||
else
|
||||
{
|
||||
Lisp_Object val = Fformat_message (nargs, args);
|
||||
Lisp_Object val = styled_format (nargs, args, true, false);
|
||||
message3 (val);
|
||||
return val;
|
||||
}
|
||||
|
@ -3984,7 +3984,7 @@ usage: (message-box FORMAT-STRING &rest ARGS) */)
|
|||
}
|
||||
else
|
||||
{
|
||||
Lisp_Object val = Fformat_message (nargs, args);
|
||||
Lisp_Object val = styled_format (nargs, args, true, false);
|
||||
Lisp_Object pane, menu;
|
||||
|
||||
pane = list1 (Fcons (build_string ("OK"), Qt));
|
||||
|
@ -4140,7 +4140,7 @@ produced text.
|
|||
usage: (format STRING &rest OBJECTS) */)
|
||||
(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,
|
||||
|
@ -4156,13 +4156,16 @@ and right quote replacement characters are specified by
|
|||
usage: (format-message STRING &rest OBJECTS) */)
|
||||
(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
|
||||
styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
|
||||
Lisp_Object
|
||||
styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message,
|
||||
bool new_result)
|
||||
{
|
||||
ptrdiff_t n; /* The number of the next arg to substitute. */
|
||||
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. */
|
||||
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. */
|
||||
bool_bf intervals : 1;
|
||||
} *info;
|
||||
|
@ -4341,7 +4347,10 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
|
|||
memset (&discarded[format0 - format_start], 1,
|
||||
format - format0 - (conversion == '%'));
|
||||
if (conversion == '%')
|
||||
goto copy_char;
|
||||
{
|
||||
new_result = true;
|
||||
goto copy_char;
|
||||
}
|
||||
|
||||
++n;
|
||||
if (! (n < nargs))
|
||||
|
@ -4351,6 +4360,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
|
|||
if (nspec < ispec)
|
||||
{
|
||||
spec->argument = args[n];
|
||||
spec->new_string = false;
|
||||
spec->intervals = false;
|
||||
nspec = ispec;
|
||||
}
|
||||
|
@ -4368,6 +4378,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
|
|||
{
|
||||
Lisp_Object noescape = conversion == 'S' ? Qnil : Qt;
|
||||
spec->argument = arg = Fprin1_to_string (arg, noescape);
|
||||
spec->new_string = true;
|
||||
if (STRING_MULTIBYTE (arg) && ! multibyte)
|
||||
{
|
||||
multibyte = true;
|
||||
|
@ -4386,6 +4397,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
|
|||
goto retry;
|
||||
}
|
||||
spec->argument = arg = Fchar_to_string (arg);
|
||||
spec->new_string = true;
|
||||
}
|
||||
|
||||
if (!EQ (arg, args[n]))
|
||||
|
@ -4408,6 +4420,11 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
|
|||
|
||||
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) */
|
||||
|
||||
ptrdiff_t prec = -1;
|
||||
|
@ -4486,6 +4503,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
|
|||
if (string_intervals (arg))
|
||||
spec->intervals = arg_intervals = true;
|
||||
|
||||
new_result = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -4753,6 +4771,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
|
|||
}
|
||||
spec->end = nchars;
|
||||
|
||||
new_result = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -4771,9 +4790,13 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
|
|||
}
|
||||
convsrc = format_char == '`' ? uLSQM : uRSQM;
|
||||
convbytes = 3;
|
||||
new_result = true;
|
||||
}
|
||||
else if (format_char == '`' && quoting_style == STRAIGHT_QUOTING_STYLE)
|
||||
convsrc = "'";
|
||||
{
|
||||
convsrc = "'";
|
||||
new_result = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* 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);
|
||||
convbytes = CHAR_STRING (c, 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)
|
||||
emacs_abort ();
|
||||
|
||||
if (! new_result)
|
||||
return args[0];
|
||||
|
||||
if (maybe_combine_byte)
|
||||
nchars = multibyte_chars_in_text ((unsigned char *) buf, p - buf);
|
||||
Lisp_Object val = make_specified_string (buf, nchars, p - buf, multibyte);
|
||||
|
|
|
@ -252,7 +252,7 @@ Initialization options:\n\
|
|||
"\
|
||||
Action options:\n\
|
||||
\n\
|
||||
FILE visit FILE using find-file\n\
|
||||
FILE visit FILE\n\
|
||||
+LINE go to line LINE 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\
|
||||
|
@ -260,13 +260,13 @@ FILE visit FILE using find-file\n\
|
|||
--execute EXPR evaluate Emacs Lisp expression EXPR\n\
|
||||
",
|
||||
"\
|
||||
--file FILE visit FILE using find-file\n\
|
||||
--find-file FILE visit FILE using find-file\n\
|
||||
--file FILE visit FILE\n\
|
||||
--find-file FILE visit FILE\n\
|
||||
--funcall, -f FUNC call Emacs Lisp function FUNC with no arguments\n\
|
||||
--insert FILE insert contents of FILE into current buffer\n\
|
||||
--kill exit without asking for confirmation\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\
|
||||
",
|
||||
"\
|
||||
|
|
|
@ -1428,7 +1428,7 @@ push_handler (Lisp_Object tag_ch_val, enum handlertype handlertype)
|
|||
struct handler *
|
||||
push_handler_nosignal (Lisp_Object tag_ch_val, enum handlertype handlertype)
|
||||
{
|
||||
struct handler *c = handlerlist->nextfree;
|
||||
struct handler *CACHEABLE c = handlerlist->nextfree;
|
||||
if (!c)
|
||||
{
|
||||
c = malloc (sizeof *c);
|
||||
|
|
|
@ -1217,7 +1217,10 @@ xg_create_frame_widgets (struct frame *f)
|
|||
with regular X drawing primitives, so from a GTK/GDK point of
|
||||
view, the widget is totally blank. When an expose comes, this
|
||||
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_window_set_wmclass (GTK_WINDOW (wtop),
|
||||
|
|
|
@ -5925,7 +5925,10 @@ make_lispy_event (struct input_event *event)
|
|||
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));
|
||||
else
|
||||
return list2 (head, position);
|
||||
|
|
111
src/lcms.c
111
src/lcms.c
|
@ -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
|
||||
0 to 100, and the a* and b* channels range from -128 to 128.
|
||||
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 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));
|
||||
}
|
||||
|
||||
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 */
|
||||
|
||||
static bool
|
||||
|
@ -160,11 +180,62 @@ parse_xyz_list (Lisp_Object xyz_list, cmsCIEXYZ *color)
|
|||
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.
|
||||
Each color is a list of XYZ coordinates, with Y scaled about unity.
|
||||
Optional argument is the XYZ white point, which defaults to illuminant D65. */)
|
||||
(Lisp_Object color1, Lisp_Object color2, Lisp_Object whitepoint)
|
||||
Each color is a list of XYZ tristimulus values, with Y scaled about unity.
|
||||
Optional argument WHITEPOINT is the XYZ white point, which defaults to
|
||||
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;
|
||||
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)))
|
||||
signal_error ("Invalid color", color2);
|
||||
if (NILP (whitepoint))
|
||||
parse_xyz_list (Vlcms_d65_xyz, &xyzw);
|
||||
xyzw = illuminant_d65;
|
||||
else if (!(CONSP (whitepoint) && parse_xyz_list (whitepoint, &xyzw)))
|
||||
signal_error ("Invalid white point", whitepoint);
|
||||
|
||||
vc.whitePoint.X = xyzw.X;
|
||||
vc.whitePoint.Y = xyzw.Y;
|
||||
vc.whitePoint.Z = xyzw.Z;
|
||||
vc.Yb = 20;
|
||||
vc.La = 100;
|
||||
vc.surround = AVG_SURROUND;
|
||||
vc.D_value = 1.0;
|
||||
if (NILP (view))
|
||||
default_viewing_conditions (&xyzw, &vc);
|
||||
else if (!(CONSP (view) && parse_viewing_conditions (view, &xyzw, &vc)))
|
||||
signal_error ("Invalid view conditions", view);
|
||||
|
||||
h1 = 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))));
|
||||
Jp1 = 1.7 * jch1.J / (1.0 + (0.007 * jch1.J));
|
||||
Jp2 = 1.7 * jch2.J / (1.0 + (0.007 * jch2.J));
|
||||
ap1 = Mp1 * cos (jch1.h);
|
||||
ap2 = Mp2 * cos (jch2.h);
|
||||
bp1 = Mp1 * sin (jch1.h);
|
||||
bp2 = Mp2 * sin (jch2.h);
|
||||
ap1 = Mp1 * cos (deg2rad (jch1.h));
|
||||
ap2 = Mp2 * cos (deg2rad (jch2.h));
|
||||
bp1 = Mp1 * sin (deg2rad (jch1.h));
|
||||
bp2 = Mp2 * sin (deg2rad (jch2.h));
|
||||
|
||||
return make_float (sqrt ((Jp2 - Jp1) * (Jp2 - Jp1) +
|
||||
(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,
|
||||
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)
|
||||
{
|
||||
cmsFloat64Number tempK;
|
||||
|
@ -291,12 +358,6 @@ DEFUN ("lcms2-available-p", Flcms2_available_p, Slcms2_available_p, 0, 0, 0,
|
|||
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_cam02_ucs);
|
||||
defsubr (&Slcms2_available_p);
|
||||
|
|
|
@ -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_both (ptrdiff_t, ptrdiff_t, ptrdiff_t,
|
||||
ptrdiff_t, bool);
|
||||
extern Lisp_Object styled_format (ptrdiff_t, Lisp_Object *, bool, bool);
|
||||
extern void init_editfns (bool);
|
||||
extern void syms_of_editfns (void);
|
||||
|
||||
|
|
173
src/nsterm.m
173
src/nsterm.m
|
@ -1820,8 +1820,8 @@ -(void)remove
|
|||
|
||||
if (pixelwise)
|
||||
{
|
||||
pixelwidth = width;
|
||||
pixelheight = height;
|
||||
pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width);
|
||||
pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -6498,24 +6498,139 @@ - (void)mouseDown: (NSEvent *)theEvent
|
|||
|
||||
if ([theEvent type] == NSEventTypeScrollWheel)
|
||||
{
|
||||
CGFloat delta = [theEvent deltaY];
|
||||
/* Mac notebooks send wheel events w/delta =0 when trackpad scrolling */
|
||||
if (delta == 0)
|
||||
#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
|
||||
if ([theEvent respondsToSelector:@selector(hasPreciseScrollingDeltas)])
|
||||
{
|
||||
delta = [theEvent deltaX];
|
||||
if (delta == 0)
|
||||
#endif
|
||||
/* 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");
|
||||
return;
|
||||
static int totalDeltaX, totalDeltaY;
|
||||
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
|
||||
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->modifiers = EV_MODIFIERS (theEvent) |
|
||||
((delta > 0) ? up_modifier : down_modifier);
|
||||
emacs_event->code = 0;
|
||||
emacs_event->modifiers = EV_MODIFIERS (theEvent) |
|
||||
((delta > 0) ? up_modifier : down_modifier);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -6524,9 +6639,11 @@ - (void)mouseDown: (NSEvent *)theEvent
|
|||
emacs_event->modifiers = EV_MODIFIERS (theEvent)
|
||||
| EV_UDMODIFIERS (theEvent);
|
||||
}
|
||||
|
||||
XSETINT (emacs_event->x, lrint (p.x));
|
||||
XSETINT (emacs_event->y, lrint (p.y));
|
||||
EV_TRAILER (theEvent);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
@ -6707,9 +6824,10 @@ - (void) updateFrameSize: (BOOL) delay
|
|||
|
||||
if (wait_for_tool_bar)
|
||||
{
|
||||
/* The toolbar height is always 0 in fullscreen, so don't wait
|
||||
for it to become available. */
|
||||
/* The toolbar height is always 0 in fullscreen and undecorated
|
||||
frames, so don't wait for it to become available. */
|
||||
if (FRAME_TOOLBAR_HEIGHT (emacsframe) == 0
|
||||
&& FRAME_UNDECORATED (emacsframe) == false
|
||||
&& ! [self isFullscreen])
|
||||
{
|
||||
NSTRACE_MSG ("Waiting for toolbar");
|
||||
|
@ -7090,9 +7208,9 @@ - (instancetype) initFrameFromEmacs: (struct frame *)f
|
|||
|
||||
win = [[EmacsWindow alloc]
|
||||
initWithContentRect: r
|
||||
styleMask: (FRAME_UNDECORATED (f)
|
||||
? FRAME_UNDECORATED_FLAGS
|
||||
: FRAME_DECORATED_FLAGS
|
||||
styleMask: ((FRAME_UNDECORATED (f)
|
||||
? FRAME_UNDECORATED_FLAGS
|
||||
: FRAME_DECORATED_FLAGS)
|
||||
#ifdef NS_IMPL_COCOA
|
||||
| NSWindowStyleMaskResizable
|
||||
| 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. */);
|
||||
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 */
|
||||
DEFVAR_LISP ("x-toolkit-scroll-bars", Vx_toolkit_scroll_bars,
|
||||
doc: /* Which toolkit scroll bars Emacs uses, if any.
|
||||
|
|
12
src/term.c
12
src/term.c
|
@ -155,12 +155,16 @@ tty_ring_bell (struct frame *f)
|
|||
static void
|
||||
tty_send_additional_strings (struct terminal *terminal, Lisp_Object sym)
|
||||
{
|
||||
Lisp_Object lisp_terminal;
|
||||
Lisp_Object extra_codes;
|
||||
/* Use only accessors like CDR_SAFE and assq_no_quit to avoid any
|
||||
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;
|
||||
|
||||
XSETTERMINAL (lisp_terminal, terminal);
|
||||
for (extra_codes = Fterminal_parameter (lisp_terminal, sym);
|
||||
for (Lisp_Object extra_codes
|
||||
= CDR_SAFE (assq_no_quit (sym, terminal->param_alist));
|
||||
CONSP (extra_codes);
|
||||
extra_codes = XCDR (extra_codes))
|
||||
{
|
||||
|
|
|
@ -116,7 +116,9 @@ enum event_kind
|
|||
.frame_or_window gives the frame
|
||||
the wheel event occurred 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
|
||||
horizontal wheel that is present on some
|
||||
mice. See WHEEL_EVENT. */
|
||||
|
|
|
@ -6252,7 +6252,8 @@ w32fullscreen_hook (struct frame *f)
|
|||
|
||||
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));
|
||||
}
|
||||
else if (FRAME_PREV_FSMODE (f) == FULLSCREEN_HEIGHT
|
||||
|
@ -6278,7 +6279,8 @@ w32fullscreen_hook (struct frame *f)
|
|||
|
||||
w32_fullscreen_rect (hwnd, f->want_fullscreen,
|
||||
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,
|
||||
rect.right - rect.left, rect.bottom - rect.top,
|
||||
SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
|
||||
|
|
|
@ -10194,7 +10194,7 @@ vadd_to_log (char const *format, va_list ap)
|
|||
for (ptrdiff_t i = 1; i <= nargs; i++)
|
||||
args[i] = va_arg (ap, Lisp_Object);
|
||||
Lisp_Object msg = Qnil;
|
||||
msg = Fformat_message (nargs, args);
|
||||
msg = styled_format (nargs, args, true, false);
|
||||
|
||||
ptrdiff_t len = SBYTES (msg) + 1;
|
||||
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) */)
|
||||
(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);
|
||||
return Qnil;
|
||||
}
|
||||
|
@ -22395,8 +22395,8 @@ Value is the new character position of point. */)
|
|||
row += dir;
|
||||
else
|
||||
row -= dir;
|
||||
if (row < MATRIX_FIRST_TEXT_ROW (w->current_matrix)
|
||||
|| row > MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w))
|
||||
if (!(MATRIX_FIRST_TEXT_ROW (w->current_matrix) <= row
|
||||
&& row < MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w)))
|
||||
goto simulate_display;
|
||||
|
||||
if (dir > 0)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue