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

This commit is contained in:
Yuuki Harano 2021-05-19 22:02:06 +09:00
commit e48372f8e5
196 changed files with 9245 additions and 7239 deletions

View file

@ -96,6 +96,8 @@ NTDIR=@NTDIR@
top_builddir = @top_builddir@
-include ${top_builddir}/src/verbose.mk
FIND_DELETE = @FIND_DELETE@
HAVE_NATIVE_COMP = @HAVE_NATIVE_COMP@
# ==================== Where To Install Things ====================
@ -850,12 +852,11 @@ endef
### target for GCC does not delete 'libgcc.a', because recompiling it
### is rarely necessary and takes a lot of time.
mostlyclean_dirs = src oldXMenu lwlib lib lib-src nt doc/emacs doc/misc \
doc/lispref doc/lispintro
doc/lispref doc/lispintro test
$(foreach dir,$(mostlyclean_dirs),$(eval $(call submake_template,$(dir),mostlyclean)))
mostlyclean: $(mostlyclean_dirs:=_mostlyclean)
[ ! -d test ] || $(MAKE) -C test $@
### 'clean'
### Delete all files from the current directory that are normally
@ -870,7 +871,6 @@ clean_dirs = $(mostlyclean_dirs) nextstep admin/charsets admin/unidata
$(foreach dir,$(clean_dirs),$(eval $(call submake_template,$(dir),clean)))
clean: $(clean_dirs:=_clean) clean-gsettings-schemas
[ ! -d test ] || $(MAKE) -C test $@
-rm -f ./*.tmp etc/*.tmp*
-rm -rf info-dir.*
-rm -rf native-lisp
@ -896,7 +896,6 @@ distclean_dirs = $(clean_dirs) leim lisp admin/grammars
$(foreach dir,$(distclean_dirs),$(eval $(call submake_template,$(dir),distclean)))
distclean: $(distclean_dirs:=_distclean)
[ ! -d test ] || $(MAKE) -C test $@
${top_distclean}
### 'bootstrap-clean'
@ -905,7 +904,6 @@ distclean: $(distclean_dirs:=_distclean)
$(foreach dir,$(distclean_dirs),$(eval $(call submake_template,$(dir),bootstrap-clean)))
bootstrap-clean: $(distclean_dirs:=_bootstrap-clean)
[ ! -d test ] || $(MAKE) -C test $@
[ ! -f config.log ] || mv -f config.log config.log~
rm -rf ${srcdir}/info
rm -f ${srcdir}/etc/refcards/emacsver.tex
@ -924,34 +922,25 @@ bootstrap-clean: $(distclean_dirs:=_bootstrap-clean)
### begin to build the program.
top_maintainer_clean=\
${top_distclean}; \
rm -fr autom4te.cache
rm -fr ${srcdir}/autom4te.cache
maintainer_clean_dirs = src leim lisp admin/charsets admin/grammars \
admin/unidata
$(foreach dir,$(distclean_dirs),$(eval $(call submake_template,$(dir),maintainer-clean)))
$(foreach dir,$(maintainer_clean_dirs),$(eval $(call submake_template,$(dir),maintainer-clean)))
maintainer-clean: bootstrap-clean $(maintainer_clean_dirs:=_maintainer-clean)
[ ! -d test ] || $(MAKE) -C test $@
maintainer-clean: $(distclean_dirs:=_maintainer-clean)
rm -rf ${srcdir}/info
rm -f ${srcdir}/etc/refcards/emacsver.tex
${top_maintainer_clean}
### This doesn't actually appear in the coding standards, but Karl
### says GCC supports it, and that's where the configuration part of
### the coding standards seem to come from. It's like distclean, but
### it deletes backup and autosave files too.
### Note that we abuse this in some subdirectories (eg leim),
### to delete some generated files that are slow to rebuild.
extraclean_dirs = ${NTDIR} lib-src src leim \
admin/charsets admin/grammars admin/unidata lisp lib lwlib
$(foreach dir,$(extraclean_dirs),$(eval $(call submake_template,$(dir),extraclean)))
extraclean: $(extraclean_dirs:=_extraclean)
${top_maintainer_clean}
-rm -f config-tmp-* aclocal.m4 configure
-rm -f ./*~ \#* etc/refcards/emacsver.tex doc/emacs/emacsver.texi
-rm -f info/*.info info/dir
-rmdir info 2>/dev/null
extraclean: maintainer-clean
-rm -f config-tmp-* ${srcdir}/aclocal.m4 ${srcdir}/configure \
${srcdir}/src/config.in
-[ "${srcdir}" = "." ] || \
find ${srcdir} '(' -name '*~' -o -name '#*' ')' ${FIND_DELETE}
-find . '(' -name '*~' -o -name '#*' ')' ${FIND_DELETE}
# The src subdir knows how to do the right thing
# even when the build directory and source dir are different.
@ -968,12 +957,7 @@ TAGS tags: lib lib-src # src
CHECK_TARGETS = check check-maybe check-expensive check-all
.PHONY: $(CHECK_TARGETS)
$(CHECK_TARGETS): all
ifeq ($(wildcard test),test)
$(MAKE) -C test $@
else
@echo "You do not seem to have the test/ directory."
@echo "Maybe you used a release tarfile that lacks tests."
endif
test/%:
$(MAKE) -C test $*

View file

@ -297,7 +297,7 @@ ${charsetdir}/%.map: ${GLIBC_CHARMAPS}/%.gz ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x/' GLIBC-1 ${compact} > $@
.PHONY: clean bootstrap-clean distclean maintainer-clean extraclean gen-clean
.PHONY: clean bootstrap-clean distclean maintainer-clean gen-clean
clean:
@ -312,4 +312,3 @@ gen-clean:
maintainer-clean: gen-clean distclean
extraclean: maintainer-clean

View file

@ -95,7 +95,7 @@ ${cedetdir}/srecode/srt-wy.el: ${srcdir}/srecode-template.wy ${grammar_wisent}
$(AM_V_GEN)[ ! -f "$@" ] || chmod +w "$@"
$(AM_V_at)${make_wisent} -o "$@" $<
.PHONY: distclean bootstrap-clean maintainer-clean extraclean gen-clean
.PHONY: distclean bootstrap-clean maintainer-clean gen-clean
distclean:
rm -f Makefile
@ -108,7 +108,6 @@ gen-clean:
maintainer-clean: gen-clean distclean
extraclean: maintainer-clean
# Makefile.in ends here

View file

@ -5,6 +5,12 @@ rolls around, add that year to every FSF (and AIST) copyright notice.
Do this by running the 'admin/update-copyright' script on a fresh repo
checkout. Inspect the results for plausibility, then commit them.
You should also run the etags test suite in test/manual/etags/. It
will most probably fail because the contents of the test files changes
due to copyright years update, so you need to move each ETAGS and
CTAGS file produced by the test runs into the corresponding
ETAGS.good* and CTAGS.good files, and then commit the new test files.
There's no need to worry about whether an individual file has changed
in a given year - it's sufficient that Emacs as a whole has changed.

View file

@ -85,7 +85,7 @@ ${unidir}/charscript.el: ${srcdir}/Blocks.txt ${blocks}
$(AM_V_GEN)$(AWK) -f ${blocks} < $< > $@
.PHONY: clean bootstrap-clean distclean maintainer-clean extraclean gen-clean
.PHONY: clean bootstrap-clean distclean maintainer-clean gen-clean
clean:
rm -f ${srcdir}/*.elc unidata.txt
@ -107,4 +107,3 @@ gen-clean:
maintainer-clean: gen-clean distclean
extraclean: maintainer-clean

View file

@ -112,7 +112,7 @@ just like digits. Case is ignored.
@cindex curly quotes, inserting
@cindex curved quotes, inserting
A few common Unicode characters can be inserted via a command
starting with @kbd{C-x 8}. For example, @kbd{C-x 8 [} inserts @t{}
starting with @w{@kbd{C-x 8}}. For example, @kbd{C-x 8 [} inserts @t{}
which is Unicode code-point U+2018 @sc{left single quotation mark},
sometimes called a left single ``curved quote'' or ``curly quote''.
Similarly, @w{@kbd{C-x 8 ]}}, @kbd{C-x 8 @{} and @kbd{C-x 8 @}} insert the
@ -895,4 +895,7 @@ Currently supported shorter key sequences are @kbd{C-x u u} instead of
v v} to resize the selected window interactively, @kbd{M-g n n p p} to
navigate @code{next-error} matches. Any other key exits transient mode
and then is executed normally. The user option @code{repeat-exit-key}
defines an additional key to exit this transient mode.
defines an additional key to exit this transient mode. Also it's
possible to break the repetition chain automatically after idle time
by customizing the user option @code{repeat-exit-timeout} to a number
of seconds.

View file

@ -1486,6 +1486,13 @@ Emacs Lisp code goes in a separate file whose name ends in
@file{foo.elc}. @xref{Byte Compilation,, Byte Compilation, elisp, the
Emacs Lisp Reference Manual}.
@cindex native compilation
Emacs Lisp code can also be compiled into @dfn{native code}: machine
code not unlike the one produced by a C or Fortran compiler. Native
code runs even faster than byte-code. Natively-compiled Emacs Lisp
code is stored in files whose names end in @samp{.eln}. @xref{Native
Compilation,, Byte Compilation, elisp, the Emacs Lisp Reference Manual}.
@findex load-file
To @dfn{load} an Emacs Lisp file, type @kbd{M-x load-file}. This
command reads a file name using the minibuffer, and executes the

View file

@ -862,21 +862,24 @@ Compress the specified files (@code{dired-do-compress}). If the file
appears to be a compressed file already, uncompress it instead. Each
marked file is compressed into its own archive; this uses the
@command{gzip} program if it is available, otherwise it uses
@command{compress}. On a directory name, this command produces a
compressed @file{.tar.gz} archive containing all of the directory's
files, by running the @command{tar} command with output piped to
@command{gzip}. To allow decompression of compressed directories,
typing @kbd{Z} on a @file{.tar.gz} or @file{.tgz} archive file unpacks
all the files in the archive into a directory whose name is the
archive name with the extension removed.
@command{compress}.
On a directory name, this command produces a compressed archive
depending on the @code{dired-compress-directory-default-suffix} user
option. The default is a @file{.tar.gz} archive containing all of the
directory's files, by running the @command{tar} command with output
piped to @command{gzip}. To allow decompression of compressed
directories, typing @kbd{Z} on a @file{.tar.gz} or @file{.tgz} archive
file unpacks all the files in the archive into a directory whose name
is the archive name with the extension removed.
@findex dired-do-compress-to
@kindex c @r{(Dired)}
@item c
Compress the specified files (@code{dired-do-compress-to}) into a
single archive anywhere on the file system. The compression algorithm
is determined by the extension of the archive, see
@code{dired-compress-files-alist}.
single archive anywhere on the file system. The default archive is
controlled by the @code{dired-compress-directory-default-suffix} user
option. Also see @code{dired-compress-files-alist}.
@findex epa-dired-do-decrypt
@kindex :d @r{(Dired)}

View file

@ -1649,10 +1649,10 @@ for details.
@cindex curved quotes, and terminal capabilities
@cindex @code{homoglyph} face
Emacs tries to determine if the curved quotes @samp{} and @samp{}
Emacs tries to determine if the curved quotes @t{} and @t{}
can be displayed on the current display. By default, if this seems to
be so, then Emacs will translate the @acronym{ASCII} quotes (@samp{`}
and @samp{'}), when they appear in messages and help texts, to these
be so, then Emacs will translate the @acronym{ASCII} quotes @w{(@samp{`}
and @samp{'})}, when they appear in messages and help texts, to these
curved quotes. You can influence or inhibit this translation by
customizing the user option @code{text-quoting-style} (@pxref{Keys in
Documentation,,, elisp, The Emacs Lisp Reference Manual}).
@ -1661,7 +1661,7 @@ Documentation,,, elisp, The Emacs Lisp Reference Manual}).
known to look just like @acronym{ASCII} characters, they are shown
with the @code{homoglyph} face. Curved quotes that are known not to
be displayable are shown as their @acronym{ASCII} approximations
@t{`}, @t{'}, and @t{"} with the @code{homoglyph} face.
@samp{`}, @samp{'}, and @samp{"} with the @code{homoglyph} face.
@node Cursor Display
@section Displaying the Cursor

View file

@ -99,6 +99,7 @@ Cover art by Etienne Suvasa; cover design by Matt Lee.
@end titlepage
@headings double
@summarycontents
@contents

View file

@ -289,8 +289,9 @@ way to move or copy text is to kill it and then yank it elsewhere.
@item C-y
Yank the last kill into the buffer, at point (@code{yank}).
@item M-y
Replace the text just yanked with an earlier batch of killed text
(@code{yank-pop}). @xref{Earlier Kills}.
Either replace the text just yanked with an earlier batch of killed
text (@code{yank-pop}), or allow to select from the list of
previously-killed batches of text. @xref{Earlier Kills}.
@item C-M-w
Cause the following command, if it is a kill command, to append to the
previous kill (@code{append-next-kill}). @xref{Appending Kills}.
@ -354,7 +355,7 @@ with @kbd{C-h v kill-ring}.
@kbd{C-y} to yank text that is no longer the most recent kill. This
is useful if you remember which kill ring entry you want. If you
don't, you can use the @kbd{M-y} (@code{yank-pop}) command to cycle
through the possibilities.
through the possibilities or to select one of the earlier kills.
@kindex M-y
@findex yank-pop
@ -363,26 +364,29 @@ that was yanked and replaces it with the text from an earlier kill.
So, to recover the text of the next-to-the-last kill, first use
@kbd{C-y} to yank the last kill, and then use @kbd{M-y} to replace it
with the previous kill. This works only after a @kbd{C-y}
or another @kbd{M-y}.
or another @kbd{M-y}. (If @kbd{M-y} is invoked after some other
command, it works differently, see below.)
You can understand @kbd{M-y} in terms of a last-yank pointer which
points at an entry in the kill ring. Each time you kill, the last-yank
pointer moves to the newly made entry at the front of the ring.
@kbd{C-y} yanks the entry which the last-yank pointer points to.
@kbd{M-y} moves the last-yank pointer to a different entry, and the
text in the buffer changes to match. Enough @kbd{M-y} commands can move
the pointer to any entry in the ring, so you can get any entry into the
buffer. Eventually the pointer reaches the end of the ring; the next
@kbd{M-y} loops back around to the first entry again.
You can understand this operation mode of @kbd{M-y} in terms of a
last-yank pointer which points at an entry in the kill ring. Each
time you kill, the last-yank pointer moves to the newly made entry at
the front of the ring. @kbd{C-y} yanks the entry which the last-yank
pointer points to. @kbd{M-y} moves the last-yank pointer to a
different entry, and the text in the buffer changes to match. Enough
@kbd{M-y} commands can move the pointer to any entry in the ring, so
you can get any entry into the buffer. Eventually the pointer reaches
the end of the ring; the next @kbd{M-y} loops back around to the first
entry again.
@kbd{M-y} moves the last-yank pointer around the ring, but it does
not change the order of the entries in the ring, which always runs from
the most recent kill at the front to the oldest one still remembered.
@kbd{M-y} can take a numeric argument, which tells it how many entries
to advance the last-yank pointer by. A negative argument moves the
pointer toward the front of the ring; from the front of the ring, it
moves around to the last entry and continues forward from there.
When used after @kbd{C-y} or @kbd{M-y}, @kbd{M-y} can take a numeric
argument, which tells it how many entries to advance the last-yank
pointer by. A negative argument moves the pointer toward the front of
the ring; from the front of the ring, it moves around to the last
entry and continues forward from there.
Once the text you are looking for is brought into the buffer, you can
stop doing @kbd{M-y} commands and it will stay there. It's just a copy
@ -394,14 +398,22 @@ pointer remains at the same place in the kill ring, so repeating
When you call @kbd{C-y} with a numeric argument, that also sets the
last-yank pointer to the entry that it yanks.
Alternatively, when the previous command was not a yank command,
@kbd{M-y} activates the minibuffer where you can browse previous kills
using the minibuffer history commands (@pxref{Minibuffer History}), or
you can use completion commands (@pxref{Completion}) on a list of
previously killed blocks of text from the kill ring. Exiting the
minibuffer will insert the selected text to the buffer. With a plain
prefix argument (@kbd{C-u M-y}), this command leaves the cursor in
front of the inserted text, and sets the mark at the end.
You can also invoke @kbd{M-y} after a command that is not a yank
command. In that case, @kbd{M-y} prompts you in the minibuffer for
one of the previous kills. You can use the minibuffer history
commands (@pxref{Minibuffer History}) to navigate or search through
the entries in the kill ring until you find the one you want to
reinsert. Or you can use completion commands (@pxref{Completion
Commands}) to complete on the list of entries in the kill ring or pop
up the @file{*Completions*} buffer with the candidate entries from
which you can choose. After selecting the kill-ring entry, you can
optionally edit it in the minibuffer. Finally, type @kbd{RET} to exit
the minibuffer and insert the selected text.
When invoked with a plain prefix argument (@kbd{C-u M-y}) after a
command that is not a yank command, @kbd{M-y} leaves the cursor in
front of the inserted text, and sets the mark at the end, like
@kbd{C-y} does.
@node Appending Kills
@subsection Appending Kills

View file

@ -2657,6 +2657,10 @@ generate a tag.
@item
In Ruby code, @code{def} or @code{class} or @code{module} at the
beginning of a line generate a tag. Constants also generate tags.
@item
In Rust code, tags anything defined with @code{fn}, @code{enum},
@code{struct} or @code{macro_rules!}.
@end itemize
You can also generate tags based on regexp matching (@pxref{Etags

View file

@ -2576,6 +2576,17 @@ Other Hexl commands let you insert strings (sequences) of binary
bytes, move by @code{short}s or @code{int}s, etc.; type @kbd{C-h a
hexl-@key{RET}} for details.
Hexl mode can also be used for editing text files. This could come
in handy if the text file includes unusual characters or uses unusual
encoding (@pxref{Coding Systems}). For this purpose, Hexl commands
that insert bytes can also insert @acronym{ASCII} and
non-@acronym{ASCII} characters, including multibyte characters. To
edit a text file with Hexl, visit the file as usual, and then type
@w{@kbd{M-x hexl-mode @key{RET}}} to switch to Hexl mode. You can now
insert text characters by typing them. However, inserting multibyte
characters requires special care, to avoid the danger of creating
invalid multibyte sequences: you should start typing such characters
when point is on the first byte of a multibyte sequence in the file.
@node Saving Emacs Sessions
@section Saving Emacs Sessions

View file

@ -416,12 +416,12 @@ just make some new commands available, while others have more
wide-ranging effects on the Emacs session. For such information,
consult the package's help buffer.
After a package is installed, it is automatically made available by
Emacs in all subsequent sessions. This happens at startup, before
processing the init file but after processing the early init file
(@pxref{Early Init File}). As an exception, Emacs does not make
packages available at startup if invoked with the @samp{-q} or
@samp{--no-init-file} options (@pxref{Initial Options}).
Installed packages are automatically made available by Emacs in all
subsequent sessions. This happens at startup, before processing the
init file but after processing the early init file (@pxref{Early Init
File}). As an exception, Emacs does not make packages available at
startup if invoked with the @samp{-q} or @samp{--no-init-file} options
(@pxref{Initial Options}).
@vindex package-enable-at-startup
To keep Emacs from automatically making packages available at
@ -430,6 +430,17 @@ startup, change the variable @code{package-enable-at-startup} to
is read before loading the regular init file. Currently this variable
cannot be set via Customize.
@findex package-quickstart-refresh
@vindex package-quickstart
If you have many packages installed, you can improve startup times
by setting the user option @code{package-quickstart} to @code{t}.
Setting this option will make Emacs precompute many things instead of
re-computing them on every Emacs startup. However, if you do this,
then you have to manually run the command
@code{package-quickstart-refresh} when the activations need to be
changed, such as when you change the value of
@code{package-load-list}.
@findex package-activate-all
If you have set @code{package-enable-at-startup} to @code{nil}, you
can still make packages available either during or after startup. To

View file

@ -301,13 +301,11 @@ from point to the @var{n}th occurrence of the specified character.
@findex isearch-yank-x-selection
Within incremental search, @kbd{C-y} (@code{isearch-yank-kill})
appends the current kill to the search string. @kbd{M-y}
(@code{isearch-yank-pop}), if called after @kbd{C-y}, replaces that
appended text with an earlier kill, similar to the usual @kbd{M-y}
(@code{yank-pop}) command. When @kbd{M-y} is called not after
@kbd{C-y}, then it activates the minibuffer where you can select
a previous kill to append to the search string (@pxref{Earlier
Kills}). Clicking @kbd{mouse-2} in the echo area appends the current
X selection (@pxref{Primary Selection}) to the search string
(@code{isearch-yank-pop}), if called after @kbd{C-y} during
incremental search, replaces that appended text with an earlier kill,
similar to the usual @kbd{M-y} (@code{yank-pop}) command. Clicking
@kbd{mouse-2} in the echo area appends the current X selection
(@pxref{Primary Selection}) to the search string
(@code{isearch-yank-x-selection}).
@kindex C-M-d @r{(Incremental search)}

View file

@ -421,13 +421,12 @@ beginning of a line.
@cindex curved quotes
@cindex guillemets
@findex electric-quote-mode
@c The funny quoting below is to make the printed version look
@c correct. FIXME.
One common way to quote is the typewriter convention, which quotes
using straight apostrophes @t{'like this'} or double-quotes @t{"like
using straight apostrophes @samp{'like this'} or double-quotes @samp{"like
this"}. Another common way is the curved quote convention, which uses
left and right single or double quotation marks `@t{like this}' or
``@t{like this}''@footnote{
left and right single or double quotation marks @t{like this} or
@t{like this}@footnote{
The curved single quote characters are U+2018 @sc{left single quotation
mark} and U+2019 @sc{right single quotation mark}; the curved double quotes
are U+201C @sc{left double quotation mark} and U+201D @sc{right double
@ -445,7 +444,7 @@ default quotes listed above, by customizing the variable
@code{electric-quote-chars}, a list of four characters, where the
items correspond to the left single quote, the right single quote, the
left double quote and the right double quote, respectively, whose
default value is @code{'(?@r{`} ?@r{'} ?@r{``} ?@r{''})}.
default value is @w{@code{'(@w{?} ? ?“ ?”)}}.
@vindex electric-quote-paragraph
@vindex electric-quote-comment
@ -461,7 +460,7 @@ variables.
@vindex electric-quote-replace-double
You can also set the option @code{electric-quote-replace-double} to
a non-@code{nil} value. Then, typing @t{"} insert an appropriate
a non-@code{nil} value. Then, typing @kbd{"} insert an appropriate
curved double quote depending on context: @t{“} at the beginning of
the buffer or after a line break, whitespace, opening parenthesis, or
quote character, and @t{”} otherwise.
@ -473,7 +472,7 @@ To toggle it globally, type
type @kbd{C-q `} or @kbd{C-q '} instead of @kbd{`} or @kbd{'}. To
insert a curved quote even when Electric Quote is disabled or
inactive, you can type @kbd{C-x 8 [} for @t{}, @kbd{C-x 8 ]} for
@t{}, @kbd{C-x 8 @{} for ``, and @kbd{C-x 8 @}} for ''.
@t{}, @kbd{C-x 8 @{} for @t{“}, and @kbd{C-x 8 @}} for @t{”}.
@xref{Inserting Text}. Note that the value of
@code{electric-quote-chars} does not affect these keybindings, they
are not keybindings of @code{electric-quote-mode} but bound in

View file

@ -481,6 +481,12 @@ all directory separators were changed to @samp{!} to prevent clashes.
(This will not work correctly if your filesystem truncates the
resulting name.)
If @var{uniquify} is one of the members of
@code{secure-hash-algorithms}, Emacs constructs the nondirectory part
of the auto-save file name by applying that @code{secure-hash} to the
buffer file name. This avoids any risk of excessively long file
names.
All the transforms in the list are tried, in the order they are listed.
When one transform applies, its result is final;
no further transforms are tried.

View file

@ -793,3 +793,248 @@ The @code{silly-loop} function is somewhat more complex:
17 return ; @r{Return value of the top of stack.}
@end group
@end example
@node Native Compilation
@chapter Compilation of Lisp to Native Code
@cindex native compilation
@cindex compilation to native code (Emacs Lisp)
@cindex native code
In addition to the byte-compilation, described in @ref{Byte
Compilation, the previous chapter}, Emacs can also optionally compile
Lisp function definitions into a true compiled code, known as
@dfn{native code}. This feature uses the @file{libgccjit} library,
which is part of the GCC distribution, and requires that Emacs be
built with support for using that library. It also requires to have
GCC and Binutils (the assembler and linker) available on your system
for you to be able to native-compile Lisp code.
@vindex native-compile@r{, a Lisp feature}
To determine whether the current Emacs process can produce and load
natively-compiled Lisp code, test whether the @code{native-compile}
feature is available (@pxref{Named Features}). Alternatively, call
@code{native-comp-available-p} (@pxref{Native-Compilation Functions}).
Unlike byte-compiled code, natively-compiled Lisp code is executed
directly by the machine's hardware, and therefore runs at full speed
that the host CPU can provide. The resulting speedup generally
depends on what the Lisp code does, but is usually 2.5 to 5 times
faster than the corresponding byte-compiled code.
Since native code is generally incompatible between different
systems, the natively-compiled code is @emph{not} transportable from
one machine to another, it can only be used on the same machine where
it was produced or on very similar ones (having the same CPU and
run-time libraries). The transportability of natively-compiled code
is the same as that of shared libraries (@file{.so} or @file{.dll}
files).
Libraries of natively-compiled code include crucial dependencies on
Emacs Lisp primitives (@pxref{What Is a Function}) and their calling
conventions, and thus Emacs usually won't load natively-compiled code
produced by earlier or later Emacs versions; native compilation of the
same Lisp code by a different Emacs version will usually produce a
natively-compiled library under a unique file name that only that
version of Emacs will be able to load. However, the use of unique
file names allows to have in the same directory several versions of
the same Lisp library natively-compiled by several different versions
of Emacs.
@vindex no-native-compile
A non-@code{nil} file-local variable binding of
@code{no-byte-compile} (@pxref{Byte Compilation}) also disables the
native compilation of that file. In addition, a similar variable
@code{no-native-compile} disables just the native compilation of the
file. If both @code{no-byte-compile} and @code{no-native-compile} are
specified, the former takes precedence.
@menu
* Native-Compilation Functions:: Functions to natively-compile Lisp.
* Native-Compilation Variables:: Variables controlling native compilation.
@end menu
@node Native-Compilation Functions
@section Native-Compilation Functions
@cindex native-compilation functions
Native-Compilation is implemented as a side effect of
byte-compilation (@pxref{Byte Compilation}). Thus, compiling Lisp
code natively always produces its byte code as well, and therefore all
the rules and caveats of preparing Lisp code for byte compilation
(@pxref{Compilation Functions}) are valid for native-compilation as
well.
You can natively-compile either a single function or macro
definition, or a whole file of Lisp code, with the
@code{native-compile} function. Natively-compiling a file will
produce both the corresponding @file{.elc} file with byte code and the
@file{.eln} file with native code.
@findex native-comp-limple-mode
@vindex native-comp-verbose
Native compilation might produce warning or error messages; these
are normally recorded in the buffer called
@file{*Native-compile-Log*}. In interactive sessions, it uses the
special LIMPLE mode (@code{native-comp-limple-mode}), which sets up
@code{font-lock} as appropriate for this log, and is otherwise the
same as Fundamental mode. Logging of messages resulting from
native-compilation can be controlled by the @code{native-comp-verbose}
variable (@pxref{Native-Compilation Variables}).
When Emacs is run non-interactively, messages produced by
native-compilation are reported by calling @code{message}
(@pxref{Displaying Messages}), and are usually displayed on the
standard error stream of the terminal from which Emacs was invoked.
@defun native-compile function-or-file &optional output
This function compiles @var{function-or-file} into native code. The
argument @var{function-or-file} can be a function symbol, a Lisp form,
or a name (a string) of the file which contains the Emacs Lisp source
code to compile. If the optional argument @var{output} is provided,
it must be a string specifying the name of the file to write the
compiled code into. Otherwise, if @var{function-or-file} is a
function or a Lisp form, this function returns the compiled object,
and if @var{function-or-file} is a file name, the function returns the
full absolute name of the file it created for the compiled code. The
output file is by default given the @file{.eln} extension.
This function runs the final phase of the native compilation, which
invokes GCC via @file{libgccjit}, in a separate subprocess, which
invokes the same Emacs executable as the process that called this
function.
@end defun
@defun batch-native-compile
This function runs native-compilation on files specified on the Emacs
command line in batch mode. It must be used only in a batch execution
of Emacs, as it kills Emacs upon completion of the compilation. If
one or more of the files fail to compile, the Emacs process will
attempt to compile all the other files, and will terminate with a
non-zero status code.
@end defun
Native compilation can be run entirely asynchronously, in a subprocess
of the main Emacs process. This leaves the main Emacs process free to
use while the compilation runs in the background. This is the method
used by Emacs to natively-compile any Lisp file or byte-compiled Lisp
file that is loaded into Emacs, when no natively-compiled file for it
is available.
@defun native-compile-async files &optional recursively load selector
This function compiles the named @var{files} asynchronously. The
argument @var{files} should be a single file name (a string) or a list
of one or more file and/or directory names. If directories are
present in the list, the optional argument @var{recursively} should be
non-@code{nil} to cause the compilation to recurse into those
directories. If @var{load} is non-@code{nil}, Emacs will load each
file that it succeeded to compile. The optional argument
@var{selector} allows control of which of @var{files} will be
compiled; it can have one of the following values:
@table @asis
@item @code{nil} or omitted
Select all the files and directories in @var{files}.
@item a regular expression string
Select the files and directories whose names match the regexp.
@item a function
A predicate function, which will be called with each file and
directory in @var{files}, and should return non-@code{nil} if the file
or the directory should be selected for compilation.
@end table
On systems with multiple CPU execution units, when @var{files} names
more than one file, this function will normally start several
compilation subprocesses in parallel, under the control of
@code{native-comp-async-jobs-number} (@pxref{Native-Compilation
Variables}).
@end defun
The following function allows Lisp programs to test whether
native-compilation is available at runtime.
@defun native-comp-available-p
This function returns non-@code{nil} if the running Emacs process has
the native-compilation support compiled into it. On systems that load
@file{libgccjit} dynamically, it also makes sure that library is
available and can be loaded. Lisp programs that need to know up front
whether native-compilation is available should use this predicate.
@end defun
@node Native-Compilation Variables
@section Native-Compilation Variables
@cindex native-compilation variables
This section documents the variables that control
native-compilation.
@defopt native-comp-speed
This variable specifies the optimization level for native compilation.
Its value should be a number between @minus{}1 and 3. Values between
0 and 3 specify the optimization levels equivalent to the
corresponding compiler @option{-O0}, @option{-O1}, etc.@: command-line
options of the compiler. The value @minus{}1 means disable
native-compilation; functions and files will be only byte-compiled.
The default value is 2.
@end defopt
@defopt native-comp-debug
This variable specifies the level of debugging information produced by
native-compilation. Its value should be a number between zero and 3,
with the following meaning:
@table @asis
@item 0
No debugging output. This is the default.
@item 1
Emit debugging symbols with the native code. This allows easier
debugging of the native code with debuggers such as @command{gdb}.
@item 2
Like 1, and in addition dump pseudo-C code.
@item 3
Like 2, and in addition dump the GCC intermediate passes and
@file{libgccjit} log file.
@end table
@end defopt
@defopt native-comp-verbose
This variable controls the verbosity of native-compilation by
suppressing some or all of the log messages emitted by it. If its
value is zero, the default, all of the log messages are suppressed.
Setting it to a value between 1 and 3 will allow logging of the
messages whose level is above the value. The values have the
following interpretations:
@table @asis
@item 0
No logging. This is the default.
@item 1
Log the final @acronym{LIMPLE} representation of the code.
@item 2
Log the @acronym{LAP}, the final @acronym{LIMPLE}, and some additional
pass info.
@item 3
Maximum verbosity: log everything.
@end table
@end defopt
@defopt native-comp-async-jobs-number
This variable determines the maximum number of native-compilation
subprocesses that will be started simultaneously. It should be a
non-negative number. The default value is zero, which means use half
the number of the CPU execution units, or 1 if the CPU has only one
execution unit.
@end defopt
@defopt native-comp-async-report-warnings-errors
If this variable's value is non-@code{nil}, warnings and errors from
asynchronous native-compilation subprocesses are reported in the main
Emacs session. The default is @code{t}.
@end defopt
@defopt native-comp-async-query-on-exit
If this variable's value is non-nil, Emacs will query upon exiting
whether to exit and kill any asynchronous native-compilation
subprocesses that are still running, thus preventing the corresponding
@file{.eln} files from being written. If the value is @code{nil}, the
default, Emacs will kill these subprocesses without querying.
@end defopt

View file

@ -197,6 +197,7 @@ To view this manual in other formats, click
* Loading:: Reading files of Lisp code into Lisp.
* Byte Compilation:: Compilation makes programs run faster.
* Native Compilation:: Compile Lisp into native machine code.
* Debugging:: Tools and tips for debugging Lisp programs.
* Read and Print:: Converting Lisp objects to text and back.
@ -646,6 +647,11 @@ Byte Compilation
* Byte-Code Objects:: The data type used for byte-compiled functions.
* Disassembly:: Disassembling byte-code; how to read byte-code.
Native Compilation
* Native-Compilation Functions:: Functions to natively-compile Lisp.
* Native-Compilation Variables:: Variables controlling native compilation.
Debugging Lisp Programs
* Debugger:: A debugger for the Emacs Lisp evaluator.

View file

@ -71,7 +71,11 @@ forms in it, and closes the file.
To find the file, @code{load} first looks for a file named
@file{@var{filename}.elc}, that is, for a file whose name is
@var{filename} with the extension @samp{.elc} appended. If such a
file exists, it is loaded. If there is no file by that name, then
file exists, and Emacs was compiled with native-compilation support
(@pxref{Native Compilation}), @code{load} attempts to find a
corresponding @samp{.eln} file, and if found, loads it instead of
@file{@var{filename}.elc}. Otherwise, it loads
@file{@var{filename}.elc}. If there is no file by that name, then
@code{load} looks for a file named @file{@var{filename}.el}. If that
file exists, it is loaded. If Emacs was compiled with support for
dynamic modules (@pxref{Dynamic Modules}), @code{load} next looks for
@ -109,6 +113,8 @@ explicit directory name.
If the option @code{load-prefer-newer} is non-@code{nil}, then when
searching suffixes, @code{load} selects whichever version of a file
(@samp{.elc}, @samp{.el}, etc.)@: has been modified most recently.
In this case, @code{load} doesn't load the @samp{.eln}
natively-compiled file even if it exists.
If @var{filename} is a relative file name, such as @file{foo} or
@file{baz/foo.bar}, @code{load} searches for the file using the variable
@ -153,7 +159,8 @@ during compilation. @xref{Compiling Macros}.
Messages like @samp{Loading foo...} and @samp{Loading foo...done} appear
in the echo area during loading unless @var{nomessage} is
non-@code{nil}.
non-@code{nil}. If a natively-compiled @samp{.eln} file is loaded,
the message says so.
@cindex load errors
Any unhandled errors while loading a file terminate loading. If the
@ -430,6 +437,28 @@ optional argument @code{stringp} is non-@code{nil}, it instead returns
the shadowed files as a string.
@end deffn
If Emacs was compiled with support for native compilation
(@pxref{Native Compilation}), then when a @samp{.elc} byte-compiled
file is found by searching @code{load-path}, Emacs will try to look
for a corresponding @samp{.eln} file holding the corresponding
natively-compiled code. The natively-compiled files are looked up in
the directories listed by the @code{native-comp-eln-load-path}.
@vindex comp-native-version-dir
@defvar native-comp-eln-load-path
This variable holds a list of directories where Emacs looks for
natively-compiled @samp{.eln} files. File names in the list that are
not absolute are interpreted as relative to @code{invocation-directory}
(@pxref{System Environment}). The last directory in the list is the
system directory, i.e.@: the directory with @samp{.eln} files
installed by the Emacs build and installation procedure. In each of
the directories in the list, Emacs looks for @samp{.eln} files in a
subdirectory whose name is constructed from the Emacs version and an
8-character hash that depends on the current native-compilation
@acronym{ABI}; the name of this subdirectory is stored in the variable
@code{comp-native-version-dir}.
@end defvar
@node Loading Non-ASCII
@section Loading Non-@acronym{ASCII} Characters
@cindex loading, and non-ASCII characters

View file

@ -251,6 +251,11 @@ matches in the target buffer are highlighted. Each parenthesized
sub-expression of the regexp is shown in a distinct face, which makes
it easier to verify even very complex regexps.
Note that by default Emacs search ignores case (@pxref{Searching and
Case}). To enable case-sensitive regexp search and match, bind
@code{case-fold-search} to @code{nil} around the code you want to be
case-sensitive.
@menu
* Syntax of Regexps:: Rules for writing regular expressions.
* Regexp Example:: Illustrates regular expression syntax.

View file

@ -1118,25 +1118,32 @@ one, it rotates the kill ring to place the yanked string at the front.
@end deffn
@deffn Command yank-pop &optional arg
This command replaces the just-yanked entry from the kill ring with a
different entry from the kill ring.
This works only immediately after a @code{yank} or another
@code{yank-pop}. At such a time, the region contains text that was just
inserted by yanking. @code{yank-pop} deletes that text and inserts in
its place a different piece of killed text. It does not add the deleted
text to the kill ring, since it is already in the kill ring somewhere.
It does however rotate the kill ring to place the newly yanked string at
the front.
When invoked immediately after a @code{yank} or another
@code{yank-pop}, this command replaces the just-yanked entry from the
kill ring with a different entry from the kill ring. When this
command is invoked like that, the region contains text that was just
inserted by another yank command. @code{yank-pop} deletes that text
and inserts in its place a different piece of killed text. It does
not add the deleted text to the kill ring, since it is already in the
kill ring somewhere. It does however rotate the kill ring to place
the newly yanked string at the front.
If @var{arg} is @code{nil}, then the replacement text is the previous
element of the kill ring. If @var{arg} is numeric, the replacement is
the @var{arg}th previous kill. If @var{arg} is negative, a more recent
kill is the replacement.
The sequence of kills in the kill ring wraps around, so that after the
oldest one comes the newest one, and before the newest one goes the
oldest.
The sequence of kills in the kill ring wraps around, so if
@code{yank-pop} is invoked repeatedly and reaches the oldest kill, the
one that comes after it is the newest one, and the one before the
newest one is the oldest one.
This command can also be invoked after a command that is not a yank
command. In that case, it prompts in the minibuffer for a kill-ring
entry, with completion, and uses the kill ring elements as the
minibuffer history (@pxref{Minibuffer History}). This allows the user
to interactively select one of the previous kills recorded in the kill
ring.
The return value is always @code{nil}.
@end deffn

View file

@ -1885,6 +1885,14 @@ any form of file-local variable. For examples of why you might want
to use this, @pxref{Auto Major Mode}.
@end defvar
@defvar permanently-enabled-local-variables
Some local variable settings will, by default, be heeded even if
@code{enable-local-variables} is @code{nil}. By default, this is only
the case for the @code{lexical-binding} local variable setting, but
this can be controlled by using this variable, which is a list of
symbols.
@end defvar
@defun hack-local-variables &optional handle-mode
This function parses, and binds or evaluates as appropriate, any local
variables specified by the contents of the current buffer. The variable

View file

@ -51,7 +51,7 @@ format understood by
\&. Both forms of the program understand
the syntax of C, Objective C, C++, Java, Fortran, Ada, Cobol, Erlang,
Forth, Go, HTML, LaTeX, Emacs Lisp/Common Lisp, Lua, Makefile, Pascal, Perl,
Ruby, PHP, PostScript, Python, Prolog, Scheme and
Ruby, Rust, PHP, PostScript, Python, Prolog, Scheme and
most assembler\-like syntaxes.
Both forms read the files specified on the command line, and write a tag
table (defaults: \fBTAGS\fP for \fBetags\fP, \fBtags\fP for

File diff suppressed because it is too large Load diff

View file

@ -67,7 +67,7 @@ modify this GNU manual.''
@contents
@node Top, EDE Project Concepts, (dir), (dir)
@node Top
@top EDE
@comment node-name, next, previous, up
@ -95,7 +95,7 @@ learn and adopt GNU ways of doing things.
* GNU Free Documentation License:: The license for this documentation.
@end menu
@node EDE Project Concepts, EDE Mode, Top, Top
@node EDE Project Concepts
@chapter @ede{} Project Concepts
@ede{} is a generic interface for managing projects. It specifies a
@ -130,7 +130,7 @@ of search to files in a single target, or to discover the location of
documentation or interface files. @ede{} can provide this
information.
@node EDE Mode, Quick Start, EDE Project Concepts, Top
@node EDE Mode
@chapter @ede{} Mode
@ede{} is implemented as a minor mode, which augments other modes such
@ -147,7 +147,7 @@ bar. This menu provides several menu items for high-level @ede{}
commands. These menu items, and their corresponding keybindings, are
independent of the type of project you are actually working on.
@node Quick Start, Creating a project, EDE Mode, Top
@node Quick Start
@chapter Quick Start
Once you have @ede{} enabled, you can create a project. This chapter
@ -443,7 +443,7 @@ C-c . R @key{RET} @key{RET}
If your program takes command line arguments, you can type them in
when it offers the command line you want to use to run your program.
@node Creating a project, Modifying your project, Quick Start, Top
@node Creating a project
@chapter Creating a project
To create a new project, first visit a file that you want to include
@ -488,7 +488,7 @@ the top-most project's makefile as a starting place for the build. How
the toplevel project handles subprojects in the build process is
dependent on that project's type.
@node Modifying your project, Building and Debugging, Creating a project, Top
@node Modifying your project
@chapter Modifying your project
In this chapter, we describe the generic features for manipulating
@ -504,7 +504,7 @@ detailed information about exactly what these features do.
* EDE Project Features::
@end menu
@node Add/Remove target, Add/Remove files, Modifying your project, Modifying your project
@node Add/Remove target
@section Add/Remove target
To create a new target, type @kbd{C-c . t} (@code{ede-new-target}) or
@ -520,7 +520,7 @@ To remove a target from the project, type @kbd{M-x ede-delete-target},
or use the @samp{Remove Target} menu item in the @samp{Project
Options} submenu.
@node Add/Remove files, Customize Features, Add/Remove target, Modifying your project
@node Add/Remove files
@section Add/Remove files
To add the current file to an existing target, type @kbd{C-c . a}
@ -541,7 +541,7 @@ not wish to add the file to any target, you can choose @samp{none}.
You can customize this behavior with the variable
@command{ede-auto-add-method}.
@node Customize Features, Project Local Variables, Add/Remove files, Modifying your project
@node Customize Features
@section Customize Features
A project, and its targets, are objects using the @samp{EIEIO} object
@ -561,7 +561,7 @@ object, you can edit the file by typing @kbd{C-c . e}
(@code{ede-edit-file-target}). You should ``rescan'' the project
afterwards (@pxref{Miscellaneous commands}).
@node Project Local Variables, EDE Project Features, Customize Features, Modifying your project
@node Project Local Variables
@section Project Local Variables
EDE projects can store and manager project local variables. The
@ -598,7 +598,7 @@ the format is an association list. For example:
(compile-command . "make -f MyCustomMakefile all")))
@end example
@node EDE Project Features, , Project Local Variables, Modifying your project
@node EDE Project Features
@section EDE Project Features
This section details user facing features of an @ede{} @samp{Make}
@ -618,7 +618,7 @@ additional details.
* Configurations::
@end menu
@node Changing Compilers and Flags, Configurations, EDE Project Features, EDE Project Features
@node Changing Compilers and Flags
@subsection Changing Compilers and Flags
Targets that build stuff need compilers. To change compilers, you
@ -638,7 +638,7 @@ see what commands are inserted. Once you have determined the variable
you need to modify, you can add a configuration for it.
@xref{Configurations}.
@node Configurations, , Changing Compilers and Flags, EDE Project Features
@node Configurations
@subsection Configurations
Configurations specify different ways to build a project. For
@ -658,7 +658,7 @@ block for ``configurations''. Add a new named configuration here.
To switch between different active configurations, modify the
``configuration default'' slot.
@node Building and Debugging, Miscellaneous commands, Modifying your project, Top
@node Building and Debugging
@chapter Building and Debugging
@ede{} provides the following ``project-aware'' compilation and
@ -677,7 +677,7 @@ Build a distribution file for your project.
These commands are also available from the @samp{Development} menu.
@node Miscellaneous commands, Extending EDE, Building and Debugging, Top
@node Miscellaneous commands
@chapter Miscellaneous commands
If you opt to go in and edit @ede{} project files directly---for
@ -716,7 +716,7 @@ To activate the speedbar in this mode, type @kbd{C-c . s}
* Simple projects:: Projects @ede{} doesn't manage.
@end menu
@node Make and Automake projects, Automake direct projects, Miscellaneous commands, Miscellaneous commands
@node Make and Automake projects
@section Make and Automake projects
A project of @samp{ede-project} type creates a file called
@ -728,7 +728,7 @@ in @samp{Makefile} mode, then this project will autogenerate a
routines will also import and maintain a configure.am script and a
host of other files required by Automake.
@node Automake direct projects, Simple projects, Make and Automake projects, Miscellaneous commands
@node Automake direct projects
@section Automake direct projects
The project type that reads @file{Makefile.am} directly is derived
@ -738,7 +738,7 @@ distributed independently. This mode eventually became @ede{}. The
not generate them automatically, or create new ones. As such, it is
useful as a browsing tool, or as maintenance in managing file lists.
@node Simple projects, , Automake direct projects, Miscellaneous commands
@node Simple projects
@section Simple Projects
There is a wide array of simple projects. In this case a simple
@ -756,7 +756,7 @@ belonging to a project, but doesn't provide many features of a typical
* Custom Locate:: Customizing how to locate files in a simple project
@end menu
@node ede-cpp-root, ede-emacs, Simple projects, Simple projects
@node ede-cpp-root
@subsection ede-cpp-root
The @code{ede-cpp-root} project type allows you to create a single
@ -897,7 +897,7 @@ of project.
@xref{ede-cpp-root-project}, for details about the class that defines
the @code{ede-cpp-root} project type.
@node ede-emacs, ede-linux, ede-cpp-root, Simple projects
@node ede-emacs
@subsection ede-emacs
The @code{ede-emacs} project automatically identifies an Emacs source
@ -906,7 +906,7 @@ tree, and enables EDE project mode for it.
It pre-populates the C Preprocessor symbol map for correct parsing,
and has an optimized include file identification function.
@node ede-linux, ede-generic-project, ede-emacs, Simple projects
@node ede-linux
@subsection ede-linux
The @code{ede-linux} project will automatically identify a Linux
@ -921,7 +921,7 @@ directory and its architecture, respectively. The default is to assume that
the build happens in the source directory and to auto-detect the
architecture; if the auto-detection fails, you will be asked.
@node ede-generic-project, Custom Locate, ede-linux, Simple projects
@node ede-generic-project
@subsection ede-generic-project
The @code{ede-generic-project} is a project system that makes it easy
@ -972,7 +972,7 @@ This example project will detect any directory with the file
Customization of the project will allow you to make build and debug
commands more precise.
@node Custom Locate, , ede-generic-project, Simple projects
@node Custom Locate
@subsection Custom Locate
The various simple project styles all have one major drawback, which
@ -1014,7 +1014,7 @@ simple example.
More on idutils and cscope is in the CEDET manual, and they each have
their own section.
@node Extending EDE, GNU Free Documentation License, Miscellaneous commands, Top
@node Extending EDE
@chapter Extending @ede{}
This chapter is intended for users who want to write new parts or fix
@ -1069,7 +1069,7 @@ examples.
* Compilers:: Details of compiler classes.
@end menu
@node Development Overview, Detecting a Project, Extending EDE, Extending EDE
@node Development Overview
@section Development Overview
@ede{} is made up of a series of classes implemented with @eieio{}.
@ -1161,7 +1161,7 @@ Here is a high-level UML diagram for the @ede{} system created with @cogre{}..
@end example
@node Detecting a Project, User interface methods, Development Overview, Extending EDE
@node Detecting a Project
@section Detecting a Project
Project detection happens with the list of @code{ede-project-autoload}
@ -1226,7 +1226,7 @@ to the global list of all projects. All subprojects are then created
and assembled into the project data structures.
@node User interface methods, Base project methods, Detecting a Project, Extending EDE
@node User interface methods
@section User interface methods
These methods are core behaviors associated with user commands.
@ -1258,7 +1258,7 @@ Make a distribution (tar archive) of the project.
Rescan a project file, changing the data in the existing objects.
@end table
@node Base project methods, Sourcecode objects, User interface methods, Extending EDE
@node Base project methods
@section Base project methods
These methods are important for querying base information from project
@ -1296,7 +1296,7 @@ stored in.
List all documentation a project or target is responsible for.
@end table
@node Sourcecode objects, Compiler and Linker objects, Base project methods, Extending EDE
@node Sourcecode objects
@section Sourcecode objects
@ede{} projects track source file / target associates via source code
@ -1342,7 +1342,7 @@ In this case, the garbage pattern is the same.
@xref{Sourcecode}.
@node Compiler and Linker objects, Project, Sourcecode objects, Extending EDE
@node Compiler and Linker objects
@section Compiler and Linker objects
In order for a target to create a @file{Makefile}, it must know how to
@ -1403,7 +1403,7 @@ See @file{ede-proj-obj.el} for examples of the combination.
@defindex sc
@defindex cm
@node Project, Targets, Compiler and Linker objects, Extending EDE
@node Project
@section Project
@menu
@ -1417,7 +1417,7 @@ See @file{ede-proj-obj.el} for examples of the combination.
* ede-step-project::
@end menu
@node ede-project-placeholder, ede-project, Project, Project
@node ede-project-placeholder
@subsection ede-project-placeholder
@pjindex ede-project-placeholder
@ -1503,7 +1503,7 @@ Make sure placeholder @var{THIS} is replaced with the real thing, and pass throu
Make sure placeholder @var{THIS} is replaced with the real thing, and pass through.
@end deffn
@node ede-project, ede-cpp-root-project, ede-project-placeholder, Project
@node ede-project
@subsection ede-project
@pjindex ede-project
@ -1789,7 +1789,7 @@ Retrieves the slot @code{menu} from an object of class @code{ede-project}
Commit change to local variables in @var{PROJ}.
@end deffn
@node ede-cpp-root-project, ede-simple-project, ede-project, Project
@node ede-cpp-root-project
@subsection ede-cpp-root-project
@pjindex ede-cpp-root-project
@ -1911,7 +1911,7 @@ Within this project @var{PROJ}, find the file @var{NAME}.
This knows details about or source tree.
@end deffn
@node ede-simple-project, ede-simple-base-project, ede-cpp-root-project, Project
@node ede-simple-project
@subsection ede-simple-project
@pjindex ede-simple-project
@ -1941,7 +1941,7 @@ No children
Commit any change to @var{PROJ} to its file.
@end deffn
@node ede-simple-base-project, ede-proj-project, ede-simple-project, Project
@node ede-simple-base-project
@subsection ede-simple-base-project
@pjindex ede-simple-base-project
@ -1971,7 +1971,7 @@ This one project could control a tree of subdirectories.
@table @asis
@end table
@node ede-proj-project, project-am-makefile, ede-simple-base-project, Project
@node ede-proj-project
@subsection ede-proj-project
@pjindex ede-proj-project
@ -2161,7 +2161,7 @@ Return a list of files that constitutes a distribution of @var{THIS} project.
Commit change to local variables in @var{PROJ}.
@end deffn
@node project-am-makefile, ede-step-project, ede-proj-project, Project
@node project-am-makefile
@subsection project-am-makefile
@pjindex project-am-makefile
@ -2203,7 +2203,7 @@ Despite the fact that this is a method, it depends on the current
buffer being in order to provide a smart default target type.
@end deffn
@node ede-step-project, , project-am-makefile, Project
@node ede-step-project
@subsection ede-step-project
@pjindex ede-step-project
@ -2328,7 +2328,7 @@ Return a list of files that constitutes a distribution of @var{THIS} project.
Commit change to local variables in @var{PROJ}.
@end deffn
@node Targets, Sourcecode, Project, Extending EDE
@node Targets
@section Targets
@menu
@ -2356,7 +2356,7 @@ Commit change to local variables in @var{PROJ}.
@end menu
@node ede-target, ede-proj-target, Targets, Targets
@node ede-target
@subsection ede-target
@tgindex ede-target
@ -2565,7 +2565,7 @@ Return the name of @var{THIS} target, suitable for make or debug style commands.
Retrieves the slot @code{menu} from an object of class @code{ede-target}
@end deffn
@node ede-proj-target, ede-proj-target-makefile, ede-target, Targets
@node ede-proj-target
@subsection ede-proj-target
@tgindex ede-proj-target
@ -2754,7 +2754,7 @@ sources variable.
@end deffn
@node ede-proj-target-makefile, semantic-ede-proj-target-grammar, ede-proj-target, Targets
@node ede-proj-target-makefile
@subsection ede-proj-target-makefile
@tgindex ede-proj-target-makefile
@ -2852,7 +2852,7 @@ Return a list of configuration variables from @var{THIS}.
Use @var{CONFIGURATION} as the current configuration to query.
@end deffn
@node semantic-ede-proj-target-grammar, ede-proj-target-makefile-objectcode, ede-proj-target-makefile, Targets
@node semantic-ede-proj-target-grammar
@subsection semantic-ede-proj-target-grammar
@tgindex semantic-ede-proj-target-grammar
@ -2906,7 +2906,7 @@ Argument @var{THIS} is the target that should insert stuff.
@end deffn
@node ede-proj-target-makefile-objectcode, ede-proj-target-makefile-archive, semantic-ede-proj-target-grammar, Targets
@node ede-proj-target-makefile-objectcode
@subsection ede-proj-target-makefile-objectcode
@tgindex ede-proj-target-makefile-objectcode
@ -2968,7 +2968,7 @@ Argument @var{THIS} is the target to get sources from.
@end deffn
@node ede-proj-target-makefile-archive, ede-proj-target-makefile-program, ede-proj-target-makefile-objectcode, Targets
@node ede-proj-target-makefile-archive
@subsection ede-proj-target-makefile-archive
@tgindex ede-proj-target-makefile-archive
@ -3011,7 +3011,7 @@ Makefile.am generator, so use it to add this important bin program.
@end deffn
@node ede-proj-target-makefile-program, ede-proj-target-makefile-shared-object, ede-proj-target-makefile-archive, Targets
@node ede-proj-target-makefile-program
@subsection ede-proj-target-makefile-program
@tgindex ede-proj-target-makefile-program
@ -3090,7 +3090,7 @@ Insert bin_PROGRAMS variables needed by target @var{THIS}.
@end deffn
@node ede-proj-target-makefile-shared-object, ede-proj-target-elisp, ede-proj-target-makefile-program, Targets
@node ede-proj-target-makefile-shared-object
@subsection ede-proj-target-makefile-shared-object
@tgindex ede-proj-target-makefile-shared-object
@ -3150,7 +3150,7 @@ Makefile.am generator, so use it to add this important bin program.
@end deffn
@node ede-proj-target-elisp, ede-proj-target-elisp-autoloads, ede-proj-target-makefile-shared-object, Targets
@node ede-proj-target-elisp
@subsection ede-proj-target-elisp
@tgindex ede-proj-target-elisp
@ -3226,7 +3226,7 @@ There are standards in Elisp files specifying how the version string
is found, such as a @code{-version} variable, or the standard header.
@end deffn
@node ede-proj-target-elisp-autoloads, ede-proj-target-makefile-miscelaneous, ede-proj-target-elisp, Targets
@node ede-proj-target-elisp-autoloads
@subsection ede-proj-target-elisp-autoloads
@tgindex ede-proj-target-elisp-autoloads
@ -3341,7 +3341,7 @@ sources variable.
@end deffn
@node ede-proj-target-makefile-miscelaneous, ede-proj-target-makefile-info, ede-proj-target-elisp-autoloads, Targets
@node ede-proj-target-makefile-miscelaneous
@subsection ede-proj-target-makefile-miscelaneous
@tgindex ede-proj-target-makefile-miscelaneous
@ -3397,7 +3397,7 @@ Return a list of files which @var{THIS} target depends on.
@end deffn
@node ede-proj-target-makefile-info, ede-proj-target-scheme, ede-proj-target-makefile-miscelaneous, Targets
@node ede-proj-target-makefile-info
@subsection ede-proj-target-makefile-info
@tgindex ede-proj-target-makefile-info
@ -3483,7 +3483,7 @@ Does the usual for Makefile mode, but splits source into two variables
when working in Automake mode.
@end deffn
@node ede-proj-target-scheme, project-am-target, ede-proj-target-makefile-info, Targets
@node ede-proj-target-scheme
@subsection ede-proj-target-scheme
@tgindex ede-proj-target-scheme
@ -3527,7 +3527,7 @@ Tweak the configure file (current buffer) to accommodate @var{THIS}.
@end deffn
@node project-am-target, project-am-objectcode, ede-proj-target-scheme, Targets
@node project-am-target
@subsection project-am-target
@tgindex project-am-target
@ -3565,7 +3565,7 @@ Run the current project in the debugger.
Edit the target associated w/ this file.
@end deffn
@node project-am-objectcode, project-am-program, project-am-target, Targets
@node project-am-objectcode
@subsection project-am-objectcode
@tgindex project-am-objectcode
@ -3610,7 +3610,7 @@ Default target to use when compiling an object code target.
There are no default header files.
@end deffn
@node project-am-program, project-am-header-noinst, project-am-objectcode, Targets
@node project-am-program
@subsection project-am-program
@tgindex project-am-program
@ -3648,7 +3648,7 @@ Additional LD args.
@end table
@end table
@node project-am-header-noinst, project-am-header-inst, project-am-program, Targets
@node project-am-header-noinst
@subsection project-am-header-noinst
@tgindex project-am-header-noinst
@ -3681,7 +3681,7 @@ No children
Return the default macro to 'edit' for this object.
@end deffn
@node project-am-header-inst, project-am-lisp, project-am-header-noinst, Targets
@node project-am-header-inst
@subsection project-am-header-inst
@tgindex project-am-header-inst
@ -3714,7 +3714,7 @@ No children
Return the default macro to 'edit' for this object.
@end deffn
@node project-am-lisp, project-am-texinfo, project-am-header-inst, Targets
@node project-am-lisp
@subsection project-am-lisp
@tgindex project-am-lisp
@ -3744,7 +3744,7 @@ No children
Return the default macro to 'edit' for this object.
@end deffn
@node project-am-texinfo, project-am-man, project-am-lisp, Targets
@node project-am-texinfo
@subsection project-am-texinfo
@tgindex project-am-texinfo
@ -3795,7 +3795,7 @@ Documentation is not for object @var{THIS}, but is provided by @var{THIS} for ot
files in the project.
@end deffn
@node project-am-man, , project-am-texinfo, Targets
@node project-am-man
@comment node-name, next, previous, up
@subsection project-am-man
@tgindex project-am-man
@ -3826,7 +3826,7 @@ No children
Return the default macro to 'edit' for this object type.
@end deffn
@node Sourcecode, Compilers, Targets, Extending EDE
@node Sourcecode
@section Sourcecode
The source code type is an object designed to associated files with
@ -3837,7 +3837,7 @@ targets.
@end menu
@node ede-sourcecode, , Sourcecode, Sourcecode
@node ede-sourcecode
@subsection ede-sourcecode
@scindex ede-sourcecode
@ -3934,7 +3934,7 @@ Return non-@code{nil} if @var{THIS} will take @var{FILENAME} as an auxiliary .
Return non-@code{nil} if @var{THIS} will take @var{FILENAME} as an auxiliary .
@end deffn
@node Compilers, , Sourcecode, Extending EDE
@node Compilers
@section Compilers
The compiler object is designed to associate source code with
@ -3950,7 +3950,7 @@ compile commands.
@end menu
@node ede-compilation-program, ede-compiler, Compilers, Compilers
@node ede-compilation-program
@subsection ede-compilation-program
@cmindex ede-compilation-program
@ -4061,7 +4061,7 @@ Tweak the configure file (current buffer) to accommodate @var{THIS}.
@end deffn
@node ede-compiler, ede-object-compiler, ede-compilation-program, Compilers
@node ede-compiler
@subsection ede-compiler
@cmindex ede-compiler
@ -4169,7 +4169,7 @@ Return a string based on @var{THIS} representing a make object variable.
@end deffn
@node ede-object-compiler, ede-linker, ede-compiler, Compilers
@node ede-object-compiler
@subsection ede-object-compiler
@cmindex ede-object-compiler
@ -4212,7 +4212,7 @@ A variable dedicated to dependency generation.
Insert variables needed by the compiler @var{THIS}.
@end deffn
@node ede-linker, , ede-object-compiler, Compilers
@node ede-linker
@subsection ede-linker
@cmindex ede-linker
@ -4274,7 +4274,7 @@ For example, C code uses .o on unix, and Emacs Lisp uses .elc.
@end table
@end table
@node GNU Free Documentation License, , Extending EDE, Top
@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi

View file

@ -42,7 +42,7 @@ modify this GNU manual.''
@contents
@node Top, Overview, (dir), (dir)
@node Top
@top EasyPG Assistant user's manual
EasyPG Assistant is an Emacs user interface to GNU Privacy Guard
@ -60,8 +60,8 @@ called EasyPG Library.
* Overview::
* Quick start::
* Commands::
* Caching Passphrases::
* GnuPG version compatibility::
* Caching Passphrases::
* Bug Reports::
* GNU Free Documentation License:: The license for this documentation.
* Key Index::
@ -69,7 +69,7 @@ called EasyPG Library.
* Variable Index::
@end menu
@node Overview, Quick start, Top, Top
@node Overview
@chapter Overview
EasyPG Assistant provides the following features.
@ -83,7 +83,7 @@ EasyPG Assistant provides the following features.
@item Automatic encryption/decryption of *.gpg files.
@end itemize
@node Quick start, Commands, Overview, Top
@node Quick start
@chapter Quick start
EasyPG Assistant commands are prefixed by @samp{epa-}. For example,
@ -94,13 +94,15 @@ EasyPG Assistant commands are prefixed by @samp{epa-}. For example,
@item To create a cleartext signature of the region, type @kbd{M-x epa-sign-region}
@item To encrypt a file, type @kbd{M-x epa-encrypt-file}
@item To query a key server for keys, type @kbd{M-x epa-search-keys}
@end itemize
EasyPG Assistant provides several cryptographic features which can be
integrated into other Emacs functionalities. For example, automatic
encryption/decryption of @file{*.gpg} files.
@node Commands, GnuPG version compatibility, Quick start, Top
@node Commands
@chapter Commands
This chapter introduces various commands for typical use cases.
@ -112,9 +114,10 @@ This chapter introduces various commands for typical use cases.
* Dired integration::
* Mail-mode integration::
* Encrypting/decrypting gpg files::
* Querying a key server::
@end menu
@node Key management, Cryptographic operations on regions, Commands, Commands
@node Key management
@section Key management
Probably the first step of using EasyPG Assistant is to browse your
keyring. @kbd{M-x epa-list-keys} is corresponding to @samp{gpg
@ -197,7 +200,7 @@ Delete selected keys. If @var{allow-secret} is non-@code{nil}, it
also delete the secret keys.
@end deffn
@node Cryptographic operations on regions, Cryptographic operations on files, Key management, Commands
@node Cryptographic operations on regions
@section Cryptographic operations on regions
@deffn Command epa-decrypt-region start end
@ -242,7 +245,7 @@ also ask you whether or not to sign the text before encryption and if
you answered yes, it will let you select the signing keys.
@end deffn
@node Cryptographic operations on files, Dired integration, Cryptographic operations on regions, Commands
@node Cryptographic operations on files
@section Cryptographic operations on files
@deffn Command epa-decrypt-file file &optional output
@ -263,7 +266,7 @@ select signing keys, and then a signature type.
Encrypt @var{file}. It will let you select recipients.
@end deffn
@node Dired integration, Mail-mode integration, Cryptographic operations on files, Commands
@node Dired integration
@section Dired integration
EasyPG Assistant extends Dired Mode for GNU Emacs to allow users to
@ -302,7 +305,7 @@ Encrypt marked files.
@end table
@node Mail-mode integration, Encrypting/decrypting gpg files, Dired integration, Commands
@node Mail-mode integration
@section Mail-mode integration
EasyPG Assistant provides a minor mode @code{epa-mail-mode} to help
@ -357,7 +360,7 @@ With prefix argument, asks you to select the recipients interactively,
whether to sign, and which key(s) to sign with.
@end table
@node Encrypting/decrypting gpg files, , Mail-mode integration, Commands
@node Encrypting/decrypting gpg files
@section Encrypting/decrypting gpg files
By default, every file whose name ends with @file{.gpg} will be
treated as encrypted. That is, when you open such a file, the
@ -440,7 +443,22 @@ If non-@code{nil}, disable auto-saving when opening an encrypted file.
The default value is @code{t}.
@end defvar
@node GnuPG version compatibility, Caching Passphrases, Commands, Top
@node Querying a key server
@section Querying a key server
The @code{epa-search-keys} command can be used to query a
@acronym{GPG} key server. Emacs will then pop up a buffer that lists
the matches, and you can then fetch (and add) keys to your personal
key ring.
In the key search buffer, you can use the @kbd{f} command to mark keys
for fetching, and then @kbd{x} to fetch the keys (and incorporate them
into your key ring).
The @code{epa-keyserver} variable says which server to query.
@node GnuPG version compatibility
@chapter GnuPG version compatibility
As of February 2016, there are three active branches of GnuPG: 2.1,
@ -472,7 +490,7 @@ specifically, with 2.0 (as of 2.0.29), there is no way to avoid the
graphical prompt.
@end itemize
@node Caching Passphrases, Bug Reports, GnuPG version compatibility, Top
@node Caching Passphrases
@chapter Caching Passphrases
Typing passphrases is a troublesome task if you frequently open and
@ -512,7 +530,7 @@ To set up elisp passphrase cache, set
@code{epa-file-cache-passphrase-for-symmetric-encryption}.
@xref{Encrypting/decrypting gpg files}.
@node Bug Reports, GNU Free Documentation License, Caching Passphrases, Top
@node Bug Reports
@chapter Bug Reports
Bugs and problems with EasyPG Assistant are actively worked on by the
@ -534,19 +552,19 @@ Before reporting the bug, you should set @code{epg-debug} in the
of the @file{ *epg-debug*} buffer. Note that the first letter of the
buffer name is a whitespace.
@node GNU Free Documentation License, Key Index, Bug Reports, Top
@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi
@node Key Index, Function Index, GNU Free Documentation License, Top
@node Key Index
@unnumbered Key Index
@printindex ky
@node Function Index, Variable Index, Key Index, Top
@node Function Index
@unnumbered Function Index
@printindex fn
@node Variable Index, , Function Index, Top
@node Variable Index
@unnumbered Variable Index
@printindex vr

View file

@ -557,7 +557,7 @@ and the second element is the file name of the client certificate
itself to use when connecting over TLS, or @code{t}, which means that
@code{auth-source} will be queried for the private key and the
certificate. Authenticating using a TLS client certificate is also
refered to as ``CertFP'' (Certificate Fingerprint) authentication by
referred to as ``CertFP'' (Certificate Fingerprint) authentication by
various IRC networks.
Examples of use:
@ -588,6 +588,9 @@ line like the following to your authinfo file
@example
machine chat.freenode.net key /home/bandali/my-cert.key cert /home/bandali/my-cert.crt
@end example
@xref{Help for users,,,auth, Emacs auth-source Library}, for more on the
@file{.authinfo}/@file{.netrc} backend of @code{auth-source}.
@end defun
@subheading Server

View file

@ -5230,7 +5230,16 @@ Newsgroups:full
@end example
to the end of her @file{overview.fmt} file, then you can use that just
as you would the extra headers from the mail groups.
as you would the extra headers from the mail groups. Otherwise, you
have to disable fetching headers with @samp{XOVER}:
@lisp
(setq nntp-nov-is-evil t
gnus-nov-is-evil t)
@end lisp
Be aware, though, that this will make entering an @acronym{NNTP} group
much, much slower, so this is not recommended.
@node Summary Buffer Mode Line

View file

@ -78,7 +78,7 @@ Public License.''
@html
<!--
@end html
@node Top, Preface, (dir), (dir)
@node Top
@top The MH-E Manual
@html
-->
@ -197,7 +197,7 @@ History of MH-E
-->
@end html
@node Preface, Conventions, Top, Top
@node Preface
@unnumbered Preface
@cindex Emacs
@ -272,7 +272,7 @@ Bill Wohler <@i{wohler at newt.com}>@*
8 February 1995@*
24 February 2006
@node Conventions, Getting Started, Preface, Top
@node Conventions
@chapter GNU Emacs Terms and Conventions
@cindex Emacs
@ -513,7 +513,7 @@ you enter something in the minibuffer, but then you change your mind,
type @kbd{C-g} and you'll be back where you started. If you want to
exit Emacs entirely, use @kbd{C-x C-c}.
@node Getting Started, Tour Through MH-E, Conventions, Top
@node Getting Started
@chapter Getting Started
@cindex MH-E, versions
@ -658,7 +658,7 @@ after these variables have been set. This hook can be used the change
the value of these variables if you need to run with different values
between MH and MH-E.
@node Tour Through MH-E, Using This Manual, Getting Started, Top
@node Tour Through MH-E
@chapter Tour Through MH-E
@cindex introduction
@ -684,7 +684,7 @@ get the big picture, and then you can read the manual as you wish.
* More About MH-E::
@end menu
@node Sending Mail Tour, Reading Mail Tour, Tour Through MH-E, Tour Through MH-E
@node Sending Mail Tour
@section Sending Mail
@cindex MH-Letter mode
@ -750,7 +750,7 @@ more complete help with the @kbd{C-h m} (@code{describe-mode})
command.}, but at this time we'll only use @kbd{C-c C-c} to send your
message. Type @kbd{C-c C-c} now. That's all there is to it!
@node Reading Mail Tour, Processing Mail Tour, Sending Mail Tour, Tour Through MH-E
@node Reading Mail Tour
@section Receiving Mail
@cindex @command{inc}
@ -823,7 +823,7 @@ This is a test message to get the wheels churning...
If you typed a long message, you can view subsequent pages with
@key{SPC} and previous pages with @key{DEL}.
@node Processing Mail Tour, Leaving MH-E, Reading Mail Tour, Tour Through MH-E
@node Processing Mail Tour
@section Processing Mail
@cindex processing mail
@ -949,7 +949,7 @@ available via the prefix characters, type the prefix character
followed by a @kbd{?}, for example, @kbd{F ?}. More complete help is
available with the @kbd{C-h m} (@code{describe-mode}) command.
@node Leaving MH-E, More About MH-E, Processing Mail Tour, Tour Through MH-E
@node Leaving MH-E
@section Leaving MH-E
@cindex Emacs, quitting
@ -988,7 +988,7 @@ already exists, so you can use @samp{folders -recurse -fast} in a
script to copy all of your messages into a single file, or using the
@samp{-file} argument, a file for each folder.
@node More About MH-E, , Leaving MH-E, Tour Through MH-E
@node More About MH-E
@section More About MH-E
These are the basic commands to get you going, but there are plenty
@ -1054,7 +1054,7 @@ Place messages in a file (@pxref{Files and Pipes}).
Remember that you can also use MH commands when you're not running
MH-E (and when you are!).
@node Using This Manual, Incorporating Mail, Tour Through MH-E, Top
@node Using This Manual
@chapter Using This Manual
This chapter begins the meat of the manual which goes into more detail
@ -1150,7 +1150,7 @@ your initials. (Unless, of course, your initials happen to be @emph{mh}!)
* Folder Selection::
@end menu
@node Options, Ranges, Using This Manual, Using This Manual
@node Options
@section Options
@cindex Emacs, customizing
@ -1210,7 +1210,7 @@ function. Try entering @kbd{M-x customize-group @key{RET} mh
the MH-E customization groups. Another way to view the MH-E
customization group is to use @kbd{M-x mh-customize @key{RET}}.
@node Ranges, Folder Selection, Options, Using This Manual
@node Ranges
@section Ranges
@c Sync with mh-folder-mode docstring.
@ -1279,7 +1279,7 @@ interpret input such as @samp{200} as @samp{last:200} if the
default). If you need to scan just the message 200, then use the range
@samp{200:1} or @samp{200-200}.
@node Folder Selection, , Ranges, Using This Manual
@node Folder Selection
@section Folder Selection
@cindex completion, folders
@ -1359,7 +1359,7 @@ folder name used is suggested. This is useful if you get mail from
various people for whom you have an alias, but file them all in the
same project folder.
@node Incorporating Mail, Reading Mail, Using This Manual, Top
@node Incorporating Mail
@chapter Incorporating Your Mail
@cindex @samp{Folder} menu
@ -1535,7 +1535,7 @@ the message numbers from outside of MH-E.
@end group
@end smalllisp
@node Reading Mail, Folders, Incorporating Mail, Top
@node Reading Mail
@chapter Reading Your Mail
@cindex @samp{+inbox}
@ -2003,7 +2003,7 @@ detail in the following sections.
* Miscellaneous Commands and Options::
@end menu
@node Viewing, Viewing Attachments, Reading Mail, Reading Mail
@node Viewing
@section Viewing Your Mail
@findex mh-header-display
@ -2276,7 +2276,7 @@ of @code{"@{show-%s@} %d"} yields a mode line of
-----@{show-+inbox@} 4 (MH-Show)--Bot--------------------------------
@end smallexample
@node Viewing Attachments, HTML, Viewing, Reading Mail
@node Viewing Attachments
@section Viewing Attachments
@cindex attachments
@ -2516,7 +2516,7 @@ Article Buttons} and
in the @cite{The Gnus Manual}.
@end ifnotinfo
@node HTML, Digests, Viewing Attachments, Reading Mail
@node HTML
@section HTML
@cindex HTML
@ -2670,7 +2670,7 @@ buffer, including HTML buffers.
(global-set-key [S-mouse-2] 'browse-url-at-mouse)
@end smalllisp
@node Digests, Reading PGP, HTML, Reading Mail
@node Digests
@section Digests
@cindex digests
@ -2714,7 +2714,7 @@ preceded with a @samp{>} so that your reply can't create the
@samp{To:} field yourself. This is described later (@pxref{Editing
Drafts}).
@node Reading PGP, Printing, Digests, Reading Mail
@node Reading PGP
@section Signed and Encrypted Messages
@cindex GPG
@ -2848,7 +2848,7 @@ See
@cite{The PGG Manual}}.
@end ifhtml
@node Printing, Files and Pipes, Reading PGP, Reading Mail
@node Printing
@section Printing Your Mail
@cindex printing
@ -2933,7 +2933,7 @@ If you do this, do not delete the message until it is printed or else
the output may be truncated. These options are not used by the
commands @kbd{P p} or @kbd{P f}.
@node Files and Pipes, Navigating, Printing, Reading Mail
@node Files and Pipes
@section Files and Pipes
@cindex files
@ -2993,7 +2993,7 @@ through @command{uuencode} or @command{shar}. For example, you can
extract the contents of the current buffer in your home directory by
typing @kbd{M-x mh-store-buffer @key{RET} ~ @key{RET}}.
@node Navigating, Miscellaneous Commands and Options, Files and Pipes, Reading Mail
@node Navigating
@section Navigating
@cindex moving between messages
@ -3094,7 +3094,7 @@ The hook @code{mh-delete-msg-hook} is called after you mark a message
for deletion. For example, a past maintainer of MH-E used this once
when he kept statistics on his mail usage.
@node Miscellaneous Commands and Options, , Navigating, Reading Mail
@node Miscellaneous Commands and Options
@section Miscellaneous Commands and Options
This section contains a few more miscellaneous commands and options.
@ -3207,7 +3207,7 @@ displayed or @code{mh-rmail} is run, and the MH-E window configuration
is shown. Otherwise, the MH-E window configuration is saved and the
original configuration is displayed.
@node Folders, Sending Mail, Reading Mail, Top
@node Folders
@chapter Organizing Your Mail with Folders
@cindex @samp{Folder} menu
@ -3842,7 +3842,7 @@ running dired on my mail directory (@kbd{M-x dired @key{RET} ~/Mail
@key{RET}}), moving my cursor to @samp{out} and using the command
@kbd{R} (@code{dired-do-rename}).
@node Sending Mail, Editing Drafts, Folders, Top
@node Sending Mail
@chapter Sending Mail
@cindex sending mail
@ -4002,7 +4002,7 @@ more detail in the following sections.
* Editing Again::
@end menu
@node Composing, Replying, Sending Mail, Sending Mail
@node Composing
@section Composing
@cindex @file{.emacs}
@ -4125,7 +4125,7 @@ is that you can write a function to write and send the message for
you. This function is passed three arguments: the contents of the
@samp{To:}, @samp{Subject:}, and @samp{Cc:} header fields.
@node Replying, Forwarding, Composing, Sending Mail
@node Replying
@section Replying to Mail
@cindex @command{mhl}
@ -4221,7 +4221,7 @@ buffer by turning off the option @code{mh-reply-show-message-flag}.
If you wish to customize the header or other parts of the reply draft,
please see @command{repl}(1) and @code{mh-format}(5).
@node Forwarding, Redistributing, Replying, Sending Mail
@node Forwarding
@section Forwarding Mail
@cindex @command{forw}
@ -4283,7 +4283,7 @@ and creates a subject header field of:
Subject: Greg DesBrisay: Re: 49er football
@end smallexample
@node Redistributing, Editing Again, Forwarding, Sending Mail
@node Redistributing
@section Redistributing Your Mail
@cindex @command{dist}
@ -4323,7 +4323,7 @@ a message that has been redistributed before, turn off this option.
The hook @code{mh-annotate-msg-hook} is run after annotating the
message and scan line (@pxref{Sending Mail}).
@node Editing Again, , Redistributing, Sending Mail
@node Editing Again
@section Editing Old Drafts and Bounced Messages
@cindex @file{draft}
@ -4359,7 +4359,7 @@ the message for editing by removing the @i{Mailer-Daemon} envelope and
unneeded header fields. Fix whatever addressing problem you had, and
send the message again with @kbd{C-c C-c}.
@node Editing Drafts, Aliases, Sending Mail, Top
@node Editing Drafts
@chapter Editing a Draft
@cindex @samp{Letter} menu
@ -4754,7 +4754,7 @@ detail in the following sections.
* Killing Draft::
@end menu
@node Editing Message, Inserting Letter, Editing Drafts, Editing Drafts
@node Editing Message
@section Editing the Message
@cindex @samp{Bcc} header field
@ -4929,7 +4929,7 @@ the first period in the paragraph above, the result would be this:
@end group
@end smallexample
@node Inserting Letter, Inserting Messages, Editing Message, Editing Drafts
@node Inserting Letter
@section Inserting Letter to Which You're Replying
@cindex inserting messages
@ -5055,7 +5055,7 @@ For example, if you use the hook function
@code{trivial-cite}} (which is NOT part of Emacs), set
@code{mh-yank-behavior} to @samp{Body and Header}.
@node Inserting Messages, Signature, Inserting Letter, Editing Drafts
@node Inserting Messages
@section Inserting Messages
@cindex inserting messages
@ -5081,7 +5081,7 @@ left intact, the message is not indented, and @samp{> } is not
inserted before each line. This command leaves the mark before the
letter and point after it.
@node Signature, Picture, Inserting Messages, Editing Drafts
@node Signature
@section Inserting Your Signature
@cindex signature
@ -5136,7 +5136,7 @@ function used to insert the signature with
The signature can also be inserted using Identities.
@xref{Identities}.
@node Picture, Adding Attachments, Signature, Editing Drafts
@node Picture
@section Inserting Your Picture
@cindex @file{.face}
@ -5186,7 +5186,7 @@ defined by this option doesn't exist.
@xref{Viewing}, to see how these header fields are displayed in MH-E.
@node Adding Attachments, Sending PGP, Picture, Editing Drafts
@node Adding Attachments
@section Adding Attachments
@cindex @command{mhbuild}
@ -5530,7 +5530,7 @@ prefix argument (as in @kbd{C-u C-c C-e}).
The hook @code{mh-mh-to-mime-hook} is called after the message has
been formatted by @kbd{C-c C-e}.
@node Sending PGP, Checking Recipients, Adding Attachments, Editing Drafts
@node Sending PGP
@section Signing and Encrypting Messages
@cindex signing messages
@ -5621,7 +5621,7 @@ all messages I encrypt are encrypted with my public key as well. If
you keep a copy of all of your outgoing mail with a @samp{Fcc:} header
field, this setting is vital so that you can read the mail you write!
@node Checking Recipients, Sending Message, Sending PGP, Editing Drafts
@node Checking Recipients
@section Checking Recipients
@cindex @file{*MH-E Recipients*}
@ -5640,7 +5640,7 @@ you can check the actual address(es) in the alias. A new buffer named
@uref{@value{MH-BOOK-HOME}/senove.html#WhaPro, What now?---and the
whatnow Program} in the MH book.}.
@node Sending Message, Killing Draft, Checking Recipients, Editing Drafts
@node Sending Message
@section Sending a Message
@cindex buffers, @file{*MH-E Mail Delivery*}
@ -5678,7 +5678,7 @@ in the MH book.} is installed under a different name, use
The hook @code{mh-annotate-msg-hook} is run after annotating the
message and scan line (@pxref{Sending Mail}).
@node Killing Draft, , Sending Message, Editing Drafts
@node Killing Draft
@section Killing the Draft
@cindex killing draft
@ -5692,7 +5692,7 @@ command @kbd{C-c C-q} (@code{mh-fully-kill-draft}) to kill the draft
buffer and delete the draft message. Use the command @kbd{C-x k}
(@code{kill-buffer}) if you don't want to delete the draft message.
@node Aliases, Identities, Editing Drafts, Top
@node Aliases
@chapter Aliases
@cindex aliases
@ -6019,7 +6019,7 @@ Syntax of Regular Expressions} in
@cite{The GNU Emacs Manual}).
@end ifhtml
@node Identities, Speedbar, Aliases, Top
@node Identities
@chapter Identities
@cindex identities
@ -6256,7 +6256,7 @@ example, @samp{:signature}), and the action @samp{'remove} or
@samp{'add}. If the action is @samp{'add}, an additional argument
containing the value for the field is given.
@node Speedbar, Menu Bar, Identities, Top
@node Speedbar
@chapter The Speedbar
@cindex folder navigation
@ -6354,7 +6354,7 @@ Selected folder face.
Selected folder face when folder contains unread messages.
@end vtable
@node Menu Bar, Tool Bar, Speedbar, Top
@node Menu Bar
@chapter The Menu Bar
@cindex @samp{Folder} menu
@ -6414,7 +6414,7 @@ manual in two ways: all of the menu items are listed alphabetically,
and you can also browse all of the items under the index entry
@samp{menu item}.
@node Tool Bar, Searching, Menu Bar, Top
@node Tool Bar
@chapter The Tool Bar
@cindex tool bar
@ -6498,7 +6498,7 @@ variable is set to anything other than @samp{Same As Default Tool Bar}
and the default tool bar is in a different location, then two tool
bars will be displayed: the MH-E tool bar and the default tool bar.
@node Searching, Threading, Tool Bar, Top
@node Searching
@chapter Searching Through Messages
@cindex @samp{Search} menu
@ -7037,7 +7037,7 @@ MH-Search buffer. Instead, you simply enter a regular expression in
the minibuffer. For help in constructing regular expressions, see your
man page for @command{grep}.
@node Threading, Limits, Searching, Top
@node Threading
@chapter Viewing Message Threads
@cindex threading
@ -7166,7 +7166,7 @@ ensure that the byte-compiled version appears first in the
installed MH-E yourself, please refer to the installation directions
in the file @file{README} in the distribution.}.
@node Limits, Sequences, Threading, Top
@node Limits
@chapter Limiting Display
@cindex limits
@ -7274,7 +7274,7 @@ command to limit the display to messages in a range (@pxref{Ranges}).
Each limit can be undone in turn with the @kbd{/ w} (@code{mh-widen})
command. Give this command a prefix argument to remove all limits.
@node Sequences, Junk, Limits, Top
@node Sequences
@chapter Using Sequences
@cindex @samp{Sequence} menu
@ -7528,7 +7528,7 @@ command dealing with sequences is @command{mark}@footnote{See the
section @uref{@value{MH-BOOK-HOME}/mmbwm.html, Make Message Bookmarks
with mark} in the MH book.}.
@node Junk, Miscellaneous, Sequences, Top
@node Junk
@chapter Dealing With Junk Mail
@cindex Marshall Rose
@ -7966,7 +7966,7 @@ spam/unreadable/.
spam/unreadable/.
@end smallexample
@node Miscellaneous, Scan Line Formats, Junk, Top
@node Miscellaneous
@chapter Miscellaneous Commands, Variables, and Buffers
This chapter covers the following command and the various MH-E
@ -8053,7 +8053,7 @@ it is hidden because the first character in the name is a space.
You'll generally not have any need for this buffer.
@end table
@node Scan Line Formats, Procmail, Miscellaneous, Top
@node Scan Line Formats
@appendix Scan Line Formats
@cindex scan line formats
@ -8521,7 +8521,7 @@ Finally, add the following to delete and refile messages.
This is just a bare minimum; it's best to adjust all of the regular
expressions to ensure that MH-E and highlighting perform well.
@node Procmail, Odds and Ends, Scan Line Formats, Top
@node Procmail
@appendix Reading Mailing Lists Effectively
@cindex @command{procmail}
@ -8680,7 +8680,7 @@ example above, you would tell Gnus about it the first time only with
@kbd{G m gnucash @key{RET} nnml @key{RET}}. In MH-E, this folder is
known as @samp{+gnucash}.
@node Odds and Ends, History, Procmail, Top
@node Odds and Ends
@appendix Odds and Ends
This appendix covers a few topics that don't fit elsewhere. Here I
@ -8694,7 +8694,7 @@ I also point out some additional sources of information.
* Getting MH-E::
@end menu
@node Bug Reports, Mailing Lists, Odds and Ends, Odds and Ends
@node Bug Reports
@appendixsec Bug Reports
@cindex bugs
@ -8708,7 +8708,7 @@ to do that it shouldn't be a restriction for you. Please include the
output of @kbd{M-x mh-version} (@pxref{Miscellaneous}) in any bug
report you send unless you're 110% positive we won't ask for it.
@node Mailing Lists, MH FAQ and Support, Bug Reports, Odds and Ends
@node Mailing Lists
@appendixsec MH-E Mailing Lists
@cindex SourceForge
@ -8721,7 +8721,7 @@ the archives at @uref{https://sourceforge.net/p/mh-e/mailman/,
SourceForge}. Do not report bugs on these lists; please submit them
via SourceForge (@pxref{Bug Reports}).
@node MH FAQ and Support, Getting MH-E, Mailing Lists, Odds and Ends
@node MH FAQ and Support
@appendixsec MH FAQ and Support
@cindex FAQ
@ -8740,7 +8740,7 @@ You can find FAQs on MH-E by searching for @i{labels:support} on the
Tickets} page on SourceForge. If you don't find the answer to your
question, file a ticket and your question will become a new FAQ!
@node Getting MH-E, , MH FAQ and Support, Odds and Ends
@node Getting MH-E
@appendixsec Getting MH-E
@cindex MH-E, obtaining
@ -8795,7 +8795,7 @@ also contains doc and contrib packages. The former is the latest
release of this manual, and the latter contains a few contributed
packages you might find useful.
@node History, GFDL, Odds and Ends, Top
@node History
@appendix History of MH-E
@cindex Bill Wohler
@ -8826,7 +8826,7 @@ lives today.
* From Bill Wohler::
@end menu
@node From Brian Reid, From Jim Larus, History, History
@node From Brian Reid
@appendixsec From Brian Reid
@cindex Brian Reid
@ -8858,7 +8858,7 @@ the ideas as well. Perhaps one day, MH-E will again resemble MHE
Brian Reid, June 1994
@node From Jim Larus, From Stephen Gildea, From Brian Reid, History
@node From Jim Larus
@appendixsec From Jim Larus
@cindex Jim Larus
@ -8904,7 +8904,7 @@ since then.
Jim Larus, June 1994
@node From Stephen Gildea, From Bill Wohler, From Jim Larus, History
@node From Stephen Gildea
@appendixsec From Stephen Gildea
@cindex Gildea, Stephen
@ -8946,7 +8946,7 @@ version 5 was released.
Stephen Gildea, June 1994
@node From Bill Wohler, , From Stephen Gildea, History
@node From Bill Wohler
@appendixsec From Bill Wohler
@cindex Wohler, Bill
@ -8993,27 +8993,27 @@ new features and several bug fixes.
Bill Wohler, August 2008
@node GFDL, GPL, History, Top
@node GFDL
@appendix GNU Free Documentation License
@include doclicense.texi
@node GPL, Key Index, GFDL, Top
@node GPL
@appendix GNU General Public License
@include gpl.texi
@node Key Index, Command Index, GPL, Top
@node Key Index
@unnumbered Key (Character) Index
@printindex ky
@node Command Index, Option Index, Key Index, Top
@node Command Index
@unnumbered Command Index
@printindex fn
@node Option Index, Concept Index, Command Index, Top
@node Option Index
@unnumbered Option (Variable) Index
@printindex vr
@node Concept Index, , Option Index, Top
@node Concept Index
@unnumbered Concept Index
@printindex cp

View file

@ -4609,7 +4609,7 @@ Footer to insert in BibTeX files generated by
@end defopt
@node Options - Index Support, Options - Viewing Cross-References, Options - Creating Citations, Options
@node Options - Index Support
@section Index Support
@cindex Options, Index support
@cindex Index support, options

View file

@ -122,7 +122,7 @@ Todo Display Features
@end detailmenu
@end menu
@node Overview, Todo Mode Entry Points, Top, Top
@node Overview
@chapter Overview
The Todo mode package provides facilities for making and maintaining
@ -146,7 +146,7 @@ most important differences, @ref{Legacy Todo Mode Files}.
* Todo Items as Diary Entries::
@end menu
@node Levels of Organization, Todo Items as Diary Entries, , Overview
@node Levels of Organization
@section Levels of Organization
In Todo mode each todo list is identified with a named category, so you
@ -184,7 +184,7 @@ associating various kinds of metadata with it, e.g., the category it
belongs to, its priority, whether it is to be included in the Emacs
diary, date and time stamps, whether it is done or still to do.
@node Todo Items as Diary Entries, , Levels of Organization, Overview
@node Todo Items as Diary Entries
@section Todo Items as Diary Entries
You can have todo items show up in the Emacs Fancy Diary display by
@ -213,7 +213,7 @@ from a Todo mode file, clicking or typing @key{RET} on this item will
switch to the buffer visiting that file and properly display the item's
category, with point on the item.
@node Todo Mode Entry Points, Key Binding Conventions, Overview, Top
@node Todo Mode Entry Points
@chapter Todo Mode Entry Points
To initialize your first todo file, invoke the command @code{todo-show}.
@ -275,7 +275,7 @@ that was displayed on quitting current for subsequent Todo mode commands
category in Todo mode, in which case the latter become current for Todo
mode commands).
@node Key Binding Conventions, Navigation, Todo Mode Entry Points, Top
@node Key Binding Conventions
@chapter Key Binding Conventions
For Todo mode commands to function properly, it is essential to maintain
@ -301,7 +301,7 @@ those beginning with @kbd{A} apply to archives (a special type of Todo
file; @ref{Todo Archive Mode}). Todo commands applying to items,
which constitute the majority, are bound to lower case key sequences.
@node Navigation, Editing, Key Binding Conventions, Top
@node Navigation
@chapter Navigation
The navigation commands are for making another todo file, category, or
@ -389,7 +389,7 @@ or higher than the current one.
Navigation to other types of Todo files is discussed in the relevant
sections below.
@node Editing, Todo Archives, Navigation, Top
@node Editing
@chapter Editing
Editing in Todo mode means making structural or textual changes at one
@ -412,7 +412,7 @@ Todo mode with @kbd{q}.
* Item Editing::
@end menu
@node File Editing, Category Editing, , Editing
@node File Editing
@section File Editing and Todo Edit Mode
There are four file-level editing commands:
@ -470,7 +470,7 @@ containing inconsistent information (see the cautionary note in
displays a warning to this effect.
@end table
@node Category Editing, Item Editing, File Editing, Editing
@node Category Editing
@section Category Editing
The following commands are available for editing specifically at the
@ -520,7 +520,7 @@ i.e., typing @kbd{C-u C g}, prompts for a file and confines merging to a
category in that file.
@end table
@node Item Editing, , Category Editing, Editing
@node Item Editing
@section Item Editing
Todo mode provides commands for adding new items as well as textually
@ -534,7 +534,7 @@ you a lot of flexibility to fine-tune these operations to your needs.
* Relocating and Removing Items::
@end menu
@node Inserting New Items, Editing Item Headers and Text, , Item Editing
@node Inserting New Items
@subsection Inserting New Items
To add a new todo item to a category, type @kbd{i}, which is bound to
@ -761,7 +761,7 @@ calendar after you have entered the item's text, and then you can
choose a date from the calendar.)
@node Editing Item Headers and Text, Relocating and Removing Items, Inserting New Items, Item Editing
@node Editing Item Headers and Text
@subsection Editing Item Headers and Text
To make changes to an existing item's content or header, type @kbd{e},
@ -945,7 +945,7 @@ really want to toggle the diary-inclusion and calendar-marking status
of all items in the category, you can do this by marking all the items
and then invoking @kbd{e y} or @kbd{e k}, @pxref{Marked Items}).
@node Relocating and Removing Items, , Editing Item Headers and Text, Item Editing
@node Relocating and Removing Items
@subsection Relocating and Removing Items
In addition to inserting a new todo item and changing the text or header
@ -960,7 +960,7 @@ removes it from the todo list but does not delete it.
* Done Items::
@end menu
@node Reprioritizing Items, Moving and Deleting Items, , Relocating and Removing Items
@node Reprioritizing Items
@subsubsection Reprioritizing Items
There are three ways to change a todo item's priority:
@ -986,7 +986,7 @@ highest priority without prompting. (Prefix arguments have no effect
with @kbd{r} or @kbd{l}.)
@end table
@node Moving and Deleting Items, Done Items, Reprioritizing Items, Relocating and Removing Items
@node Moving and Deleting Items
@subsubsection Moving and Deleting Items
You can move an item to another category, thereby recategorizing it:
@ -1032,7 +1032,7 @@ Todo command to undo a deletion. If you want to be able to use @key{SPC} for
confirmation, enable the option @code{todo-y-with-space}.
@end quotation
@node Done Items, , Moving and Deleting Items, Relocating and Removing Items
@node Done Items
@subsubsection Done Items
When the activity or thing that a todo item is about has been done, it
@ -1118,7 +1118,7 @@ item has a comment, you are asked whether to delete it from the restored
item.
@end table
@node Todo Archives, Marked Items, Editing, Top
@node Todo Archives
@chapter Todo Archives
When the done items section of a category itself starts to become
@ -1134,7 +1134,7 @@ the extension @samp{.toda} instead of @samp{.todo}.
* Todo Archive Mode::
@end menu
@node Creating and Visiting Archives, Todo Archive Mode, , Todo Archives
@node Creating and Visiting Archives
@section Creating and Visiting Archives
Todo mode provides the following command for archiving items:
@ -1207,7 +1207,7 @@ As with todo files, you can also visit a Todo archive by invoking a
standard Emacs file-visiting command; this displays the first (on the
initial invocation) or current category of the archive.
@node Todo Archive Mode, , Creating and Visiting Archives, Todo Archives
@node Todo Archive Mode
@section Todo Archive Mode
When you visit a Todo archive, the buffer is in Todo Archive mode. It
@ -1264,7 +1264,7 @@ The command @kbd{F k} (@pxref{File Editing}) is also available in Todo
Archive mode. It deletes the current archive file and prompts you
whether to delete the corresponding todo file.
@node Marked Items, Todo Categories Mode, Todo Archives, Top
@node Marked Items
@chapter Marked Items
For many item editing commands it can make sense and be convenient to
@ -1329,7 +1329,7 @@ todo or marked done items, so if both types of items are marked,
invoking these commands has no effect and informs you of your
erroneous attempt.
@node Todo Categories Mode, Searching for Items, Marked Items, Top
@node Todo Categories Mode
@chapter Todo Categories Mode
It can be helpful to have a compact overview of the categories in a
@ -1367,7 +1367,7 @@ to visit another todo file). To do this customize the option
* Reordering Categories::
@end menu
@node Table of Item Counts, Reordering Categories, , Todo Categories Mode
@node Table of Item Counts
@section Table of Item Counts
Above each column of the table is a labeled button you can press by
@ -1428,7 +1428,7 @@ Typing @kbd{q} exits Todo Categories mode, killing the buffer and returning
to the current category in the Todo mode or Todo Archive mode buffer
from which you had invoked @kbd{F c}.
@node Reordering Categories, , Table of Item Counts, Todo Categories Mode
@node Reordering Categories
@section Reordering Categories
Todo Categories mode provide commands with which you can change the
@ -1479,7 +1479,7 @@ have to renumber them again. This is one reason why you should
exercise caution when using @kbd{F e}.
@end quotation
@node Searching for Items, Todo Filtered Items Mode, Todo Categories Mode, Top
@node Searching for Items
@chapter Searching for Items
It can be useful to be able to locate and examine all todo items that
@ -1506,7 +1506,7 @@ search and remove the highlighting later.
These commands are also available in Todo Archive mode.
@node Todo Filtered Items Mode, Todo Display Features, Searching for Items, Top
@node Todo Filtered Items Mode
@chapter Todo Filtered Items Mode
A more powerful alternative to sequential searching is item filtering,
@ -1520,7 +1520,7 @@ category in a distinct mode, Todo Filtered Items mode.
* Files of Filtered Items::
@end menu
@node Filtering Items, Todo Filtered Items Mode Commands, , Todo Filtered Items Mode
@node Filtering Items
@section Filtering Items
Todo mode provides three ways to filter items: a general filter for
@ -1593,7 +1593,7 @@ this invocation, overriding both @code{todo-top-priorities-overrides} and
@code{todo-top-priorities}.
@end itemize
@node Todo Filtered Items Mode Commands, Files of Filtered Items, Filtering Items, Todo Filtered Items Mode
@node Todo Filtered Items Mode Commands
@section Todo Filtered Items Mode Commands
The output of the item filtering commands looks similar to a regular
@ -1650,7 +1650,7 @@ change the relative priorities of items from the same real category,
since that would make the filtered list inconsistent with the source
todo list.
@node Files of Filtered Items, , Todo Filtered Items Mode Commands, Todo Filtered Items Mode
@node Files of Filtered Items
@section Files of Filtered Items
Typing @kbd{s} in Todo Filtered Items mode saves the buffer of filtered
@ -1701,7 +1701,7 @@ displaying its first category, as usual.
The command @kbd{F k} (@pxref{File Editing}) is also available in Todo
Filtered Items mode. It deletes the current filtered items file.
@node Todo Display Features, Printing Todo Buffers, Todo Filtered Items Mode, Top
@node Todo Display Features
@chapter Todo Display Features
You can change the appearance of Todo mode buffers in a variety of ways.
@ -1712,7 +1712,7 @@ You can change the appearance of Todo mode buffers in a variety of ways.
* Other Display Commands and Options::
@end menu
@node Faces, Item Prefix, , Todo Display Features
@node Faces
@section Faces
Each of the Todo modes uses faces to distinguish various aspects of
@ -1737,7 +1737,7 @@ The @code{todo-faces} customization group contains a complete list of
Todo mode faces and brief descriptions of their use.
@node Item Prefix, Other Display Commands and Options, Faces, Todo Display Features
@node Item Prefix
@section Item Prefix
In the default display of (real or virtual) categories in Todo mode,
@ -1776,7 +1776,7 @@ displayed in a face (@code{todo-top-priority}) different from the face
of the prefix of non-top-priority items, so you see at a glance how
many items in the category are top priorities.
@node Other Display Commands and Options, , Item Prefix, Todo Display Features
@node Other Display Commands and Options
@section Other Display Commands and Options
There are two additional toggle commands that affect display in the
@ -1842,7 +1842,7 @@ Categories mode and Todo Filtered Items mode, beyond those mentioned
above in the sections on these modes; see the customization groups
@code{todo-categories} and @code{todo-filtered} for details.
@node Printing Todo Buffers, Legacy Todo Mode Files, Todo Display Features, Top
@node Printing Todo Buffers
@chapter Printing Todo Buffers
If you print a Todo buffer using one of the standard Emacs printing
@ -1865,7 +1865,7 @@ By default, Todo uses @code{ps-print-buffer-with-faces} to make the
printable version; you can change this by setting the option
@code{todo-print-function}.
@node Legacy Todo Mode Files, GNU Free Documentation License, Printing Todo Buffers, Top
@node Legacy Todo Mode Files
@chapter Legacy Todo Mode Files
Users of the original version of Todo mode will recognize from the
@ -1912,7 +1912,7 @@ it often). (A delicate part of the conversion concerns the customizable
format of item date/time headers in the old-style; see the documentation
string of @code{todo-legacy-date-time-regexp} for details.)
@node GNU Free Documentation License, , Legacy Todo Mode Files, Top
@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include doclicense.texi

View file

@ -2166,7 +2166,7 @@ commands for those hosts, the property @t{"posix"} should be set to
The default value of this property is @code{t} (not specified in
@code{tramp-methods}). If the remote host runs native MS Windows,
this propery has no effect.
this property has no effect.
@item @t{"mount-point"}
@ -4504,9 +4504,9 @@ Note how @samp{%r}, @samp{%h} and @samp{%p} must be encoded as
@samp{%%r}, @samp{%%h} and @samp{%%p}.
@vindex tramp-use-ssh-controlmaster-options
If the @file{~/.ssh/config} is configured appropriately for the above
behavior, then any changes to @command{ssh} can be suppressed with
this @code{nil} setting:
If the @file{~/.ssh/config} file is configured appropriately for the
above behavior, then any changes to @command{ssh} can be suppressed
with this @code{nil} setting:
@lisp
(customize-set-variable 'tramp-use-ssh-controlmaster-options nil)
@ -4518,6 +4518,10 @@ This should also be set to @code{nil} if you use the
@option{ProxyCommand} or @option{ProxyJump} options in your
@command{ssh} configuration.
On MS Windows, @code{tramp-use-ssh-controlmaster-options} is set to
@code{nil} by default, because the MS Windows and MSYS2
implementations of @command{OpenSSH} do not support this option properly.
@item
On multi-hop connections, @value{tramp} does not use @command{ssh}
@ -5336,6 +5340,7 @@ The verbosity levels are
@*@indent @w{ 8} connection properties
@*@indent @w{ 9} test commands
@*@indent @w{10} traces (huge)
@*@indent @w{11} call traces (maintainer only)
With @code{tramp-verbose} greater than or equal to 4, messages are
also written to a @value{tramp} debug buffer. Such debug buffers are
@ -5384,21 +5389,8 @@ The debug buffer is written as a file in your
this option with care, because it could decrease the performance of
@value{tramp} actions.
To enable stepping through @value{tramp} function call traces, they
have to be specifically enabled as shown in this code:
@lisp
@group
(require 'trace)
(dolist (elt (all-completions "tramp-" obarray 'functionp))
(trace-function-background (intern elt)))
(untrace-function 'tramp-read-passwd)
@end group
@end lisp
The buffer @file{*trace-output*} contains the output from the function
call traces. Disable @code{tramp-read-passwd} to stop password
strings from being written to @file{*trace-output*}.
If @code{tramp-verbose} is greater than or equal to 11, @value{tramp}
function call traces are written to the buffer @file{*trace-output*}.
@node GNU Free Documentation License

161
etc/NEWS
View file

@ -26,7 +26,10 @@ applies, and please also update docstrings as needed.
** Emacs now optionally supports native compilation of Lisp files.
To enable this, configure Emacs with the '--with-native-compilation' option.
This requires the libgccjit library to be installed and functional.
This requires the libgccjit library to be installed and functional,
and also requires GCC and Binutils to be available when Lisp code is
natively compiled. See the Info node "(elisp) Native Compilation" for
more details.
---
** Support for building with Motif has been removed.
@ -181,7 +184,7 @@ commands.
** Support for '(box . SIZE)' 'cursor-type'.
By default, 'box' cursor always has a filled box shape. But if you
specify 'cursor-type' to be '(box . SIZE)', the cursor becomes a hollow
box if the point is on an image larger than 'SIZE' pixels in any
box if the point is on an image larger than SIZE pixels in any
dimension.
+++
@ -277,7 +280,7 @@ commands. The new keystrokes are 'C-x x g' ('revert-buffer'),
input using the minibuffer.
---
** New user option 'bookmark-menu-confirm-deletion'
** New user option 'bookmark-menu-confirm-deletion'.
In Bookmark Menu mode, Emacs by default does not prompt for
confirmation when you type 'x' to execute the deletion of bookmarks
that have been marked for deletion. However, if this new option is
@ -296,7 +299,10 @@ prompt, and how you can tweak the file size threshold.
* Editing Changes in Emacs 28.1
+++
** A prefix arg now causes 'delete-other-frames' to only iconify frames
** A prefix arg now causes 'delete-other-frames' to only iconify frames.
+++
** The "Edit => Clear" menu item now obeys a rectangular region.
+++
** New command 'execute-extended-command-for-buffer'.
@ -328,12 +334,13 @@ forms, but this command has now been changed to work more like
'eval-defun', and reset the values as specified.
+++
** Standalone 'M-y' uses the minibuffer to complete previous kills.
When 'M-y' is typed not after a yank command, it activates the minibuffer
where you can browse previous kills using the minibuffer history or
completion. In Isearch, you can bind 'C-s M-y' to the command
'isearch-yank-pop' that uses the minibuffer with completion on
previous kills to read a string and append it to the search string.
** Standalone 'M-y' allows interactive selection from previous kills.
'M-y' can now be typed after a command that is not a yank command.
When invoked like that, it prompts in the minibuffer for one of the
previous kills, offering completion and minibuffer-history navigation
through previous kills recorded in the kill ring. A similar feature
in Isearch can be invoked if you bind 'C-s M-y' to the command
'isearch-yank-pop'.
---
** New user options 'copy-region-blink-delay' and 'delete-pair-blink-delay'.
@ -383,9 +390,10 @@ setting the variable 'auto-save-visited-mode' buffer-locally to nil.
description of the properties. Likewise 'button-describe' does the
same for a button.
** Obsolete commands are no longer hidden from command completion.
** Obsolete aliases are no longer hidden from command completion.
Completion of command names now considers obsolete aliases as
candidates. Invoking a command via an obsolete alias now mentions the
candidates, if they were marked obsolete in the current major version
of Emacs. Invoking a command via an obsolete alias now mentions the
obsolescence fact and shows the new name of the command.
+++
@ -520,7 +528,7 @@ indentation is done using SMIE or with the old ad-hoc code.
** Icomplete
+++
*** New minor mode Icomplete-Vertical mode.
*** New minor mode 'icomplete-vertical-mode'.
This mode is intended to be used with Icomplete or Fido, to display the
list of completions candidates vertically instead of horizontally.
@ -704,6 +712,18 @@ line, and allows truncating them (to preserve space on the mode line)
or showing them literally, either instead of, or in addition to,
displaying "by name" or "by date" sort order.
+++
*** New user option 'dired-compress-directory-default-suffix'.
This user option controls default suffix for compressing a directory.
If it's nil, ".tar.gz" will be used. Refer to
'dired-compress-files-alist' for a list of supported suffixes.
+++
*** New user option 'dired-compress-file-default-suffix'.
This user option controls the default suffix for compressing files.
If it's nil, ".gz" will be used. Refer to 'dired-compress-file-alist'
for a list of supported suffixes.
---
*** Broken and circular links are shown with the 'dired-broken-symlink' face.
@ -1141,7 +1161,6 @@ the variables 'bookmark-bmenu-use-header-line' and
If non-nil, setting a bookmark will colorize the current line with
'bookmark-face'.
** Edebug
*** Obsoletions
@ -1225,7 +1244,8 @@ command line under point (and any following output).
---
*** Environment variable 'INSIDE_EMACS' is now copied to subprocesses.
Its value equals the result of evaluating '(format "%s,eshell" emacs-version)'.
Its value contains the result of evaluating '(format "%s,eshell"
emacs-version)'. Other package names, like "tramp", could also be included.
---
*** Eshell no longer re-initializes its keymap every call.
@ -1339,16 +1359,16 @@ See the new user options 'package-name-column-width',
*** gdb-mi can now store and restore window configurations.
Use 'gdb-save-window-configuration' to save window configuration to a
file and 'gdb-load-window-configuration' to load from a file. These
commands can also be accessed through the menu bar under 'Gud --
GDB-Windows'. 'gdb-default-window-configuration-file', when non-nil,
commands can also be accessed through the menu bar under "Gud =>
GDB-Windows". 'gdb-default-window-configuration-file', when non-nil,
is loaded when GDB starts up.
+++
*** gdb-mi can now restore window configuration after quit.
Set 'gdb-restore-window-configuration-after-quit' to non-nil and Emacs
will remember the window configuration before GDB started and restore
it after GDB quits. A toggle button is also provided under 'Gud --
GDB-Windows'.
it after GDB quits. A toggle button is also provided under "Gud =>
GDB-Windows".
+++
*** gdb-mi now has a better logic for displaying source buffers.
@ -1619,7 +1639,7 @@ This feature relies on librsvg 2.48 or above being available.
Size image properties, for example ':height', ':max-height', etc., can
be given a cons of the form '(SIZE . em)', where SIZE is an integer or
float which is multiplied by the font size to calculate the image
size, and em is a symbol.
size, and 'em' is a symbol.
** EWW
@ -1726,8 +1746,8 @@ If chosen, file names in "*xref*" buffers will be displayed relative
to the 'project-root' of the current project, when available.
+++
*** The TAB key binding in *xref* buffers is obsolete.
Use 'C-u RET' instead. The TAB binding in *xref* buffers is still
*** The 'TAB' key binding in "*xref*" buffers is obsolete.
Use 'C-u RET' instead. The 'TAB' binding in "*xref*" buffers is still
supported, but we plan on removing it in a future version; at that
time, the command 'xref-quit-and-goto-xref' will no longer have a key
binding in 'xref--xref-buffer-mode-map'.
@ -1798,36 +1818,10 @@ activity overview sidebar for joined IRC channels is now part of ERC.
The 'erc-tls' function has been updated to allow specifying a TLS
client certificate for authentication, as an alternative to NickServ
password-based authentication. This is referred to as "CertFP" (short
for Certificate Fingerprint) by several IRC networks.
To use a certificate with 'erc-tls', specify the ':client-certificate'
optional parameter, whose value should be as described in the
documentation of 'open-network-stream': if non-nil, it should either
be a list where the first element is the file name of the private key
corresponding to a client certificate and the second element is the
file name of the client certificate itself to use when connecting over
TLS, or t, which means that 'auth-source' will be queried for the
private key and the certificate.
Examples of use:
(erc-tls :server "chat.freenode.net" :port 6697
:client-certificate
'("/home/bandali/my-cert.key"
"/home/bandali/my-cert.crt"))
(erc-tls :server "chat.freenode.net" :port 6697
:client-certificate
`(,(expand-file-name "~/cert-freenode.key")
,(expand-file-name "~/cert-freenode.crt")))
(erc-tls :server "chat.freenode.net" :port 6697
:client-certificate t)
In the case of ':client-certificate t', you will need to add a line
like the following to your authinfo file (e.g. "~/.authinfo.gpg"):
machine chat.freenode.net key /home/bandali/my-cert.key cert /home/bandali/my-cert.crt
for Certificate Fingerprint) by several IRC networks. See the Info
node "(erc) Connecting" in the ERC manual for more details and
examples on how to specify and use TLS client certificates with
'erc-tls'.
** Battery
@ -2391,10 +2385,19 @@ You can type 'C-x u u' instead of 'C-x u C-x u' to undo many changes,
'M-g n n p p' to navigate next-error matches. Any other key exits
transient mode and then is executed normally. 'repeat-exit-key'
defines an additional key to exit mode like 'isearch-exit' ('RET').
With 'repeat-keep-prefix' you can keep the prefix arg of the previous command.
For example, this can help to reverse the window navigation direction
with e.g. 'C-x o M-- o o'. Also it can help to set a new step with
e.g. 'C-x { C-5 { { {' will set the window resizing step to 5 columns.
The user option 'repeat-exit-timeout' specifies the number of
seconds of idle time to break the repetition chain automatically.
With 'repeat-keep-prefix' you can keep the prefix arg of the previous
command. For example, this can help to reverse the window navigation
direction with e.g. 'C-x o M-- o o'. Also it can help to set a new
step with e.g. 'C-x { C-5 { { {', which will set the window resizing
step to 5 columns.
+++
** EasyPG
GPG key servers can now be queried for keys with the
'M-x epa-search-keys' command. Keys can then be added to your
personal key ring.
* New Modes and Packages in Emacs 28.1
@ -2478,6 +2481,13 @@ This is to keep the same behavior as Eshell.
* Incompatible Lisp Changes in Emacs 28.1
+++
** The 'lexical-binding' local variable is always enabled.
Previously, if 'enable-local-variables' was nil, a 'lexical-binding'
local variable would not be heeded. This has now changed, and a file
with a 'lexical-binding' cookie is always heeded. To revert to the
old behavior, set 'permanently-enabled-local-variables' to nil.
+++
** 'completing-read-default' sets completion variables buffer-locally.
'minibuffer-completion-table' and related variables are now set buffer-locally
@ -2485,7 +2495,7 @@ in the minibuffer instead of being set via a global let-binding.
+++
** The use of positional arguments in 'define-minor-mode' is obsolete.
These were actually rendered obsolete in Emacs-21 but were never
These were actually rendered obsolete in Emacs 21 but were never
marked as such.
** 'facemenu-color-alist' is now obsolete, and is not used.
@ -2610,16 +2620,16 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el.
'icalendar--datetime-to-noneuropean-date', 'image-mode-maybe',
'imenu-example--name-and-position', 'ispell-aspell-supports-utf8',
'lisp-mode-auto-fill', 'locate-file-completion', 'make-coding-system',
'minibuffer-local-must-match-filename-map', 'mouse-choose-completion',
'mouse-major-mode-menu', 'mouse-popup-menubar',
'mouse-popup-menubar-stuff', 'newsticker-groups-filename',
'nnir-swish-e-index-file', 'nnmail-fix-eudora-headers',
'non-iso-charset-alist', 'nonascii-insert-offset',
'nonascii-translation-table', 'password-read-and-add',
'pre-abbrev-expand-hook', 'princ-list', 'print-help-return-message',
'process-filter-multibyte-p', 'read-file-name-predicate',
'remember-buffer', 'rmail-highlight-face', 'rmail-message-filter',
'semantic-after-idle-scheduler-reparse-hooks',
'menu-bar-files-menu', 'minibuffer-local-must-match-filename-map',
'mouse-choose-completion', 'mouse-major-mode-menu',
'mouse-popup-menubar', 'mouse-popup-menubar-stuff',
'newsticker-groups-filename', 'nnir-swish-e-index-file',
'nnmail-fix-eudora-headers', 'non-iso-charset-alist',
'nonascii-insert-offset', 'nonascii-translation-table',
'password-read-and-add', 'pre-abbrev-expand-hook', 'princ-list',
'print-help-return-message', 'process-filter-multibyte-p',
'read-file-name-predicate', 'remember-buffer', 'rmail-highlight-face',
'rmail-message-filter', 'semantic-after-idle-scheduler-reparse-hooks',
'semantic-after-toplevel-bovinate-hook',
'semantic-before-idle-scheduler-reparse-hooks',
'semantic-before-toplevel-bovination-hook',
@ -2673,8 +2683,8 @@ back in Emacs 23.1. The affected functions are: 'make-obsolete',
+++
** The '&define' keyword in an Edebug specification now disables backtracking.
The implementation was buggy, and multiple &define forms in an &or
form should be exceedingly rare. See the Info node 'Backtracking' in
The implementation was buggy, and multiple '&define' forms in an '&or'
form should be exceedingly rare. See the Info node "(elisp) Backtracking" in
the Emacs Lisp reference manual for background.
@ -3065,9 +3075,16 @@ The special events 'dbus-event' and 'file-notify' are now ignored in
+++
** 'condition-case' now allows for a success handler.
It is written as (:success BODY...) where BODY is executed whenever
the protected form terminates without error, with the specified
variable bound to the the value of the protected form.
It is written as '(:success BODY...)' where BODY is executed
whenever the protected form terminates without error, with the
specified variable bound to the the value of the protected form.
+++
** 'The 'uniquify' argument in 'auto-save-file-name-transforms' can be a symbol.
If this symbol is one of the members of 'secure-hash-algorithms',
Emacs constructs the nondirectory part of the auto-save file name by
applying that 'secure-hash' to the buffer file name. This avoids any
risk of excessively long file names.
* Changes in Emacs 28.1 on Non-Free Operating Systems

View file

@ -2701,7 +2701,7 @@ days there are in a month in a specific year), 'date-ordinal-to-time'
(that computes the date of an ordinal day), 'decoded-time-add' (for
doing computations on a decoded time structure), 'make-decoded-time'
(for making a decoded time structure with only the given keywords
filled out), and 'encoded-time-set-defaults' (which fills in nil
filled out), and 'decoded-time-set-defaults' (which fills in nil
elements as if it's midnight January 1st, 1970) have been added.
*** In the DST slot, 'encode-time' and 'parse-time-string' now return -1

View file

@ -1763,8 +1763,17 @@ apparently loses under Solaris, at least. [fx has mostly done this.]
(Obsolete, since gmalloc.c is nowadays only used on MS-DOS.)
** Rewrite make-docfile to be clean and maintainable
It might be better to replace it with Lisp, using the byte compiler.
It might be better to replace with Lisp the part of make-docfile that
produces the etc/DOC file by scanning *.el files, for example by
reusing the code in the byte compiler or in autoload.el that already
scans *.el files.
https://lists.gnu.org/r/emacs-devel/2012-06/msg00037.html
https://lists.gnu.org/r/emacs-devel/2021-05/msg00235.html
** Eliminate the etc/DOC file altogether
As an alternative to the previous item, we could try and eliminate the
DOC file altogether. See
https://lists.gnu.org/r/emacs-devel/2021-05/msg00237.html
** Add an inferior-comint-minor-mode
The purpose is to have a mode to capture the common set of operations

View file

@ -137,7 +137,7 @@ ${srcdir}/../lisp/language/pinyin.el: ${srcdir}/MISC-DIC/pinyin.map
$(AM_V_GEN)${RUN_EMACS} -l titdic-cnv -f pinyin-convert $< $@
.PHONY: bootstrap-clean distclean maintainer-clean extraclean gen-clean
.PHONY: bootstrap-clean distclean maintainer-clean gen-clean
## Perhaps this should run gen-clean.
bootstrap-clean:
@ -154,6 +154,4 @@ gen-clean:
rm -f ${TIT_MISC} ${leimdir}/leim-list.el
rm -rf ${leimdir}/ja-dic
extraclean: maintainer-clean
### Makefile.in ends here

View file

@ -315,7 +315,7 @@ $(DESTDIR)${archlibdir}: all
fi
.PHONY: install uninstall mostlyclean clean distclean maintainer-clean
.PHONY: bootstrap-clean extraclean check tags
.PHONY: bootstrap-clean check tags
install: $(DESTDIR)${archlibdir}
@echo
@ -343,6 +343,7 @@ mostlyclean:
rm -f core ./*.o ./*.res
clean: mostlyclean
-rm -f seccomp-filter.bpf seccomp-filter.pfc seccomp-filter-exec.bpf seccomp-filter-exec.pfc
rm -f ${EXE_FILES}
distclean: clean
@ -350,8 +351,6 @@ distclean: clean
bootstrap-clean maintainer-clean: distclean
extraclean: maintainer-clean
rm -f ./*~ \#*
## Test the contents of the directory.
check:

View file

@ -366,6 +366,7 @@ static void PS_functions (FILE *);
static void Prolog_functions (FILE *);
static void Python_functions (FILE *);
static void Ruby_functions (FILE *);
static void Rust_entries (FILE *);
static void Scheme_functions (FILE *);
static void TeX_commands (FILE *);
static void Texinfo_nodes (FILE *);
@ -752,6 +753,12 @@ a line generate a tag. Constants also generate a tag.";
static const char *Ruby_interpreters [] =
{ "ruby", NULL };
static const char *Rust_suffixes [] =
{ "rs", NULL };
static const char Rust_help [] =
"In Rust code, tags anything defined with 'fn', 'enum', \n\
'struct' or 'macro_rules!'.";
/* Can't do the `SCM' or `scm' prefix with a version number. */
static const char *Scheme_suffixes [] =
{ "oak", "sch", "scheme", "SCM", "scm", "SM", "sm", "ss", "t", NULL };
@ -836,6 +843,7 @@ static language lang_names [] =
NULL, Python_interpreters },
{ "ruby", Ruby_help, Ruby_functions, Ruby_suffixes,
Ruby_filenames, Ruby_interpreters },
{ "rust", Rust_help, Rust_entries, Rust_suffixes },
{ "scheme", Scheme_help, Scheme_functions, Scheme_suffixes },
{ "tex", TeX_help, TeX_commands, TeX_suffixes },
{ "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes },
@ -5019,6 +5027,49 @@ Ruby_functions (FILE *inf)
}
}
/*
* Rust support
* Look for:
* - fn: Function
* - struct: Structure
* - enum: Enumeration
* - macro_rules!: Macro
*/
static void
Rust_entries (FILE *inf)
{
char *cp, *name;
bool is_func = false;
LOOP_ON_INPUT_LINES(inf, lb, cp)
{
cp = skip_spaces(cp);
name = cp;
// Skip 'pub' keyworld
(void)LOOKING_AT (cp, "pub");
// Look for define
if ((is_func = LOOKING_AT (cp, "fn"))
|| LOOKING_AT (cp, "enum")
|| LOOKING_AT (cp, "struct")
|| (is_func = LOOKING_AT (cp, "macro_rules!")))
{
cp = skip_spaces (cp);
name = cp;
while (!notinname (*cp))
cp++;
make_tag (name, cp - name, is_func,
lb.buffer, cp - lb.buffer + 1,
lineno, linecharno);
is_func = false;
}
}
}
/*
* PHP support

View file

@ -113,8 +113,7 @@ distclean bootstrap-clean: mostlyclean
rm -fr $(DEPDIR)
maintainer-clean: distclean
rm -f TAGS gnulib.mk
extraclean: distclean
-rmdir malloc sys 2>/dev/null
-rmdir malloc sys 2>/dev/null || true
.PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean

View file

@ -202,7 +202,7 @@ $(lisp)/loaddefs.el: gen-lisp $(LOADDEFS)
# regeneration of all these files.
.PHONY: autoloads-force
autoloads-force:
rm loaddefs.el
rm -f $(lisp)/loaddefs.el
$(MAKE) autoloads
# This is required by the bootstrap-emacs target in ../src/Makefile, so
@ -467,7 +467,7 @@ $(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC) $(CAL_DIR)/diary-loaddefs.el
--eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \
-f batch-update-autoloads $(CAL_DIR)
.PHONY: bootstrap-clean distclean maintainer-clean extraclean
.PHONY: bootstrap-clean distclean maintainer-clean
bootstrap-clean:
find $(lisp) -name '*.elc' $(FIND_DELETE)
@ -479,12 +479,6 @@ distclean:
maintainer-clean: distclean bootstrap-clean
rm -f TAGS
extraclean: bootstrap-clean distclean
-for file in $(loaddefs); do rm -f $${file}~; done
-rm -f $(lisp)/loaddefs.el~
-find $(lisp) -name '*~' $(FIND_DELETE)
-find $(lisp) -name '#*' $(FIND_DELETE)
.PHONY: check-declare
check-declare:

View file

@ -104,9 +104,9 @@
;; The bug has since been fixed.
(dotimes (i 11)
(push (vector (format "hol-year-%d" i)
`(lambda ()
(interactive)
(holiday-list (+ displayed-year ,(- i 5))))
(lambda ()
(interactive)
(holiday-list (+ displayed-year (- i 5))))
:label `(format "For Year %d"
(+ displayed-year ,(- i 5))))
l))

View file

@ -525,6 +525,8 @@ changes in daylight saving time are not taken into account."
(defun decoded-time-set-defaults (time &optional default-zone)
"Set any nil values in `decoded-time' TIME to default values.
The default value is based on January 1st, 1970 at midnight.
This year is used to guarantee portability; see Info
node `(elisp) Time of Day'.
TIME is modified and returned."
(unless (decoded-time-second time)
@ -539,7 +541,7 @@ TIME is modified and returned."
(unless (decoded-time-month time)
(setf (decoded-time-month time) 1))
(unless (decoded-time-year time)
(setf (decoded-time-year time) 0))
(setf (decoded-time-year time) 1970))
;; When we don't have a time zone, default to DEFAULT-ZONE without
;; DST if DEFAULT-ZONE if given, and to unknown DST otherwise.

View file

@ -657,10 +657,12 @@ Theme files are named *-theme.el in `"))
(insert-file-contents fn)
(let ((sexp (let ((read-circle nil))
(condition-case nil
(read (current-buffer))
(end-of-file nil)))))
(and (eq (car-safe sexp) 'deftheme)
(setq doc (nth 2 sexp))))))))
(progn
(re-search-forward "^(deftheme")
(beginning-of-line)
(read (current-buffer)))
(error nil)))))
(setq doc (nth 2 sexp)))))))
(cond ((null doc)
"(no documentation available)")
((string-match ".*" doc)

View file

@ -207,7 +207,22 @@ set to nil, as the value is no longer rogue."
(put symbol 'custom-requests requests)
;; Do the actual initialization.
(unless custom-dont-initialize
(funcall initialize symbol default))
(funcall initialize symbol default)
;; If there is a value under saved-value that wasn't saved by the user,
;; reset it: we used that property to stash the value, but we don't need
;; it anymore.
;; This can happen given the following:
;; 1. The user loaded a theme that had a setting for an unbound
;; variable, so we stashed the theme setting under the saved-value
;; property in `custom-theme-recalc-variable'.
;; 2. Then, Emacs evaluated the defcustom for the option
;; (e.g., something required the file where the option is defined).
;; If we don't reset it and the user later sets this variable via
;; Customize, we might end up saving the theme setting in the custom-file.
;; See the test `custom-test-no-saved-value-after-customizing-option'.
(let ((theme (caar (get symbol 'theme-value))))
(when (and theme (not (eq theme 'user)) (get symbol 'saved-value))
(put symbol 'saved-value nil))))
(when buffer-local
(make-variable-buffer-local symbol)))
(run-hooks 'custom-define-hook)
@ -1516,7 +1531,15 @@ See `custom-enabled-themes' for a list of enabled themes."
(custom-push-theme prop symbol theme 'reset)
(cond
((eq prop 'theme-value)
(custom-theme-recalc-variable symbol))
(custom-theme-recalc-variable symbol)
;; We might have to reset the stashed value of the variable, if
;; no other theme is customizing it. Without this, loading a theme
;; that has a setting for an unbound user option and then disabling
;; it will leave this lingering setting for the option, and if then
;; Emacs evaluates the defcustom the saved-value might be used to
;; set the variable. (Bug#20766)
(unless (get symbol 'theme-value)
(put symbol 'saved-value nil)))
((eq prop 'theme-face)
;; If the face spec specified by this theme is in the
;; saved-face property, reset that property.
@ -1565,8 +1588,16 @@ This function returns nil if no custom theme specifies a value for VARIABLE."
(defun custom-theme-recalc-variable (variable)
"Set VARIABLE according to currently enabled custom themes."
(let ((valspec (custom-variable-theme-value variable)))
(if valspec
(put variable 'saved-value valspec)
;; We used to save VALSPEC under the saved-value property unconditionally,
;; but that is a recipe for trouble because we might end up saving session
;; customizations if the user loads a theme. (Bug#21355)
;; It's better to only use the saved-value property to stash the value only
;; if we really need to stash it (i.e., VARIABLE is void).
(condition-case nil
(default-toplevel-value variable) ; See if it doesn't fail.
(void-variable (when valspec
(put variable 'saved-value valspec))))
(unless valspec
(setq valspec (get variable 'standard-value)))
(if (and valspec
(or (get variable 'force-value)

View file

@ -84,9 +84,11 @@ information on adapting behavior of commands in Delete Selection mode."
(defvar delsel--replace-text-or-position nil)
;;;###autoload
(defun delete-active-region (&optional killp)
"Delete the active region.
If KILLP in not-nil, the active region is killed instead of deleted."
(interactive "P")
(cond
(killp
;; Don't allow `kill-region' to change the value of `this-command'.

View file

@ -1132,6 +1132,7 @@ present. A FMT of \"\" will suppress the messaging."
;; Solaris 10 version of tar (obsolete in 2024?).
;; Same thing on AIX 7.1 (obsolete 2023?) and 7.2 (obsolete 2022?).
("\\.tar\\.gz\\'" "" "gzip -dc %i | tar -xf -")
("\\.tar\\.xz\\'" "" "xz -dc %i | tar -xf -")
("\\.tgz\\'" "" "gzip -dc %i | tar -xf -")
("\\.gz\\'" "" "gunzip")
("\\.lz\\'" "" "lzip -d")
@ -1149,10 +1150,7 @@ present. A FMT of \"\" will suppress the messaging."
("\\.zst\\'" "" "unzstd --rm")
("\\.7z\\'" "" "7z x -aoa -o%o %i")
;; This item controls naming for compression.
("\\.tar\\'" ".tgz" nil)
;; This item controls the compression of directories. Its REGEXP
;; element should never match any valid file name.
("\000" ".tar.gz" "tar -cf - %i | gzip -c9 > %o"))
("\\.tar\\'" ".tgz" nil))
"Control changes in file name suffixes for compression and uncompression.
Each element specifies one transformation rule, and has the form:
(REGEXP NEW-SUFFIX PROGRAM)
@ -1168,6 +1166,34 @@ output file.
Otherwise, the rule is a compression rule, and compression is done with gzip.
ARGS are command switches passed to PROGRAM.")
(defcustom dired-compress-file-default-suffix nil
"Default suffix for compressing a single file.
If nil, \".gz\" will be used."
:type 'string
:group 'dired
:version "28.1")
(defvar dired-compress-file-alist
'(("\\.gz\\'" . "gzip -9f %i")
("\\.bz2\\'" . "bzip2 -9f %i")
("\\.xz\\'" . "xz -9f %i")
("\\.zst\\'" . "zstd -qf -19 --rm -o %o %i"))
"Controls the compression shell command for `dired-do-compress-to'.
Each element is (REGEXP . CMD), where REGEXP is the name of the
archive to which you want to compress, and CMD is the
corresponding command.
Within CMD, %i denotes the input file(s), and %o denotes the
output file. %i path(s) are relative, while %o is absolute.")
(defcustom dired-compress-directory-default-suffix nil
"Default suffix for compressing a directory.
If nil, \".tar.gz\" will be used."
:type 'string
:group 'dired
:version "28.1")
(defvar dired-compress-files-alist
'(("\\.tar\\.gz\\'" . "tar -cf - %i | gzip -c9 > %o")
("\\.tar\\.bz2\\'" . "tar -cf - %i | bzip2 -c9 > %o")
@ -1177,7 +1203,7 @@ ARGS are command switches passed to PROGRAM.")
("\\.tar\\.lzo\\'" . "tar -cf - %i | lzop -c9 > %o")
("\\.zip\\'" . "zip %o -r --filesync %i")
("\\.pax\\'" . "pax -wf %o %i"))
"Control the compression shell command for `dired-do-compress-to'.
"Controls the compression shell command for `dired-do-compress-to'.
Each element is (REGEXP . CMD), where REGEXP is the name of the
archive to which you want to compress, and CMD is the
@ -1275,37 +1301,62 @@ Return nil if no change in files."
;; Try gzip; if we don't have that, use compress.
(condition-case nil
(if (file-directory-p file)
(progn
(setq suffix (cdr (assoc "\000" dired-compress-file-suffixes)))
(when suffix
(let ((out-name (concat file (car suffix)))
(default-directory (file-name-directory file)))
(dired-shell-command
(replace-regexp-in-string
"%o" (shell-quote-argument out-name)
(let* ((suffix
(or dired-compress-directory-default-suffix
".tar.gz"))
(rule (cl-find-if
(lambda (x) (string-match-p (car x) suffix))
dired-compress-files-alist)))
(if rule
(let ((out-name (concat file suffix))
(default-directory (file-name-directory file)))
(dired-shell-command
(replace-regexp-in-string
"%o" (shell-quote-argument out-name)
(replace-regexp-in-string
"%i" (shell-quote-argument
(file-name-nondirectory file))
(cdr rule)
nil t)
nil t))
out-name)
(user-error
"No compression rule found for \
`dired-compress-directory-default-suffix' %s, see `dired-compress-files-alist' for\
the supported suffixes list."
dired-compress-directory-default-suffix)))
(let* ((suffix (or dired-compress-file-default-suffix ".gz"))
(out-name (concat file suffix))
(rule (cl-find-if
(lambda (x) (string-match-p (car x) suffix))
dired-compress-file-alist)))
(if (not rule)
(user-error "No compression rule found for suffix %s, \
see `dired-compress-file-alist' for the supported suffixes list."
dired-compress-file-default-suffix)
(and (file-exists-p file)
(or (not (file-exists-p out-name))
(y-or-n-p
(format
"File %s already exists. Really compress? "
out-name)))
(dired-shell-command
(replace-regexp-in-string
"%i" (shell-quote-argument (file-name-nondirectory file))
(cadr suffix)
nil t)
nil t))
out-name)))
(let ((out-name (concat file ".gz")))
(and (or (not (file-exists-p out-name))
(y-or-n-p
(format "File %s already exists. Really compress? "
out-name)))
(not
(dired-check-process (concat "Compressing " file)
"gzip" "-f" file))
(or (file-exists-p out-name)
(setq out-name (concat file ".z")))
;; Rename the compressed file to NEWNAME
;; if it hasn't got that name already.
(if (and newname (not (equal newname out-name)))
(progn
(rename-file out-name newname t)
newname)
out-name))))
"%o" (shell-quote-argument out-name)
(replace-regexp-in-string
"%i" (shell-quote-argument file)
(cdr rule)
nil t)
nil t))
(or (file-exists-p out-name)
(setq out-name (concat file ".z")))
;; Rename the compressed file to NEWNAME
;; if it hasn't got that name already.
(if (and newname (not (equal newname out-name)))
(progn
(rename-file out-name newname t)
newname)
out-name)))))
(file-error
(if (not (dired-check-process (concat "Compressing " file)
"compress" "-f" file))

View file

@ -3425,11 +3425,16 @@ confirmation. To disable the confirmation, see
(let ((buf-list (dired-buffers-for-dir (expand-file-name fn))))
(and buf-list
(or (and dired-clean-confirm-killing-deleted-buffers
(y-or-n-p (format
(ngettext "Kill Dired buffer of %s, too? "
"Kill Dired buffers of %s, too? "
(length buf-list))
(file-name-nondirectory fn))))
(y-or-n-p
(format
(ngettext "Kill Dired buffer of %s, too? "
"Kill Dired buffers of %s, too? "
(length buf-list))
(file-name-nondirectory
;; FN may end in a / if `dired-listing-switches'
;; contains -p, so we need to strip that
;; (bug#48301).
(directory-file-name fn)))))
(not dired-clean-confirm-killing-deleted-buffers))
(dolist (buf buf-list)
(kill-buffer buf))))))

View file

@ -951,12 +951,20 @@ Same format as `byte-optimize--lexvars', with shared structure and contents.")
"Whether EXPR is a constant symbol."
(and (macroexp-const-p expr) (symbolp (eval expr))))
(defun byte-optimize--fixnump (o)
"Return whether O is guaranteed to be a fixnum in all Emacsen.
See Info node `(elisp) Integer Basics'."
(and (fixnump o) (<= -536870912 o 536870911)))
(defun byte-optimize-equal (form)
;; Replace `equal' or `eql' with `eq' if at least one arg is a symbol.
;; Replace `equal' or `eql' with `eq' if at least one arg is a
;; symbol or fixnum.
(byte-optimize-binary-predicate
(if (= (length (cdr form)) 2)
(if (or (byte-optimize--constant-symbol-p (nth 1 form))
(byte-optimize--constant-symbol-p (nth 2 form)))
(byte-optimize--constant-symbol-p (nth 2 form))
(byte-optimize--fixnump (nth 1 form))
(byte-optimize--fixnump (nth 2 form)))
(cons 'eq (cdr form))
form)
;; Arity errors reported elsewhere.
@ -964,14 +972,19 @@ Same format as `byte-optimize--lexvars', with shared structure and contents.")
(defun byte-optimize-member (form)
;; Replace `member' or `memql' with `memq' if the first arg is a symbol,
;; or the second arg is a list of symbols.
;; or the second arg is a list of symbols. Same with fixnums.
(if (= (length (cdr form)) 2)
(if (or (byte-optimize--constant-symbol-p (nth 1 form))
(byte-optimize--fixnump (nth 1 form))
(let ((arg2 (nth 2 form)))
(and (macroexp-const-p arg2)
(let ((listval (eval arg2)))
(and (listp listval)
(not (memq nil (mapcar #'symbolp listval))))))))
(not (memq nil (mapcar
(lambda (o)
(or (symbolp o)
(byte-optimize--fixnump o)))
listval))))))))
(cons 'memq (cdr form))
form)
;; Arity errors reported elsewhere.
@ -979,11 +992,12 @@ Same format as `byte-optimize--lexvars', with shared structure and contents.")
(defun byte-optimize-assoc (form)
;; Replace 2-argument `assoc' with `assq', `rassoc' with `rassq',
;; if the first arg is a symbol.
;; if the first arg is a symbol or fixnum.
(cond
((/= (length form) 3)
form)
((byte-optimize--constant-symbol-p (nth 1 form))
((or (byte-optimize--constant-symbol-p (nth 1 form))
(byte-optimize--fixnump (nth 1 form)))
(cons (if (eq (car form) 'assoc) 'assq 'rassq)
(cdr form)))
(t (byte-optimize-constant-args form))))

View file

@ -1758,7 +1758,7 @@ It is too wide if it has any lines longer than the largest of
overriding-plist-environment)))))
(defmacro displaying-byte-compile-warnings (&rest body)
(declare (debug t))
(declare (debug (def-body)))
`(let* ((--displaying-byte-compile-warnings-fn (lambda () ,@body))
(warning-series-started
(and (markerp warning-series)
@ -2238,12 +2238,12 @@ With argument ARG, insert value in current buffer after the form."
(setq byte-compile-noruntime-functions nil)
(setq byte-compile-new-defuns nil)
(when byte-native-compiling
(defvar comp-speed)
(push `(comp-speed . ,comp-speed) byte-native-qualities)
(defvar comp-debug)
(push `(comp-debug . ,comp-debug) byte-native-qualities)
(defvar comp-native-driver-options)
(push `(comp-native-driver-options . ,comp-native-driver-options)
(defvar native-comp-speed)
(push `(native-comp-speed . ,native-comp-speed) byte-native-qualities)
(defvar native-comp-debug)
(push `(native-comp-debug . ,native-comp-debug) byte-native-qualities)
(defvar native-comp-driver-options)
(push `(native-comp-driver-options . ,native-comp-driver-options)
byte-native-qualities)
(defvar no-native-compile)
(push `(no-native-compile . ,no-native-compile)

View file

@ -1924,7 +1924,8 @@ from OBARRAY.
\(fn (VAR [OBARRAY [RESULT]]) BODY...)"
(declare (indent 1)
(debug ((symbolp &optional form form) cl-declarations body)))
(debug ((symbolp &optional form form) cl-declarations
def-body)))
;; Apparently this doesn't have an implicit block.
`(cl-block nil
(let (,(car spec))
@ -1964,7 +1965,7 @@ Each symbol in the first list is bound to the corresponding value in the
second list (or to nil if VALUES is shorter than SYMBOLS); then the
BODY forms are executed and their result is returned. This is much like
a `let' form, except that the list of symbols can be computed at run-time."
(declare (indent 2) (debug (form form body)))
(declare (indent 2) (debug (form form def-body)))
(let ((bodyfun (make-symbol "body"))
(binds (make-symbol "binds"))
(syms (make-symbol "syms"))

View file

@ -43,7 +43,7 @@
"Emacs Lisp native compiler."
:group 'lisp)
(defcustom comp-speed 2
(defcustom native-comp-speed 2
"Optimization level for native compilation, a number between -1 and 3.
-1 functions are kept in bytecode form and no native compilation is performed.
0 native compilation is performed with no optimizations.
@ -55,7 +55,7 @@
:safe #'integerp
:version "28.1")
(defcustom comp-debug (if (eq 'windows-nt system-type) 1 0)
(defcustom native-comp-debug (if (eq 'windows-nt system-type) 1 0)
"Debug level for native compilation, a number between 0 and 3.
This is intended for debugging the compiler itself.
0 no debug output.
@ -67,7 +67,7 @@ This is intended for debugging the compiler itself.
:safe #'natnump
:version "28.1")
(defcustom comp-verbose 0
(defcustom native-comp-verbose 0
"Compiler verbosity for native compilation, a number between 0 and 3.
This is intended for debugging the compiler itself.
0 no logging.
@ -78,19 +78,19 @@ This is intended for debugging the compiler itself.
:risky t
:version "28.1")
(defcustom comp-always-compile nil
(defcustom native-comp-always-compile nil
"Non-nil means unconditionally (re-)compile all files."
:type 'boolean
:version "28.1")
(defcustom comp-deferred-compilation-deny-list
(defcustom native-comp-deferred-compilation-deny-list
'()
"List of regexps to exclude matching files from deferred native compilation.
Files whose names match any regexp are excluded from native compilation."
:type '(repeat regexp)
:version "28.1")
(defcustom comp-bootstrap-deny-list
(defcustom native-comp-bootstrap-deny-list
'()
"List of regexps to exclude files from native compilation during bootstrap.
Files whose names match any regexp are excluded from native compilation
@ -98,7 +98,7 @@ during bootstrap."
:type '(repeat regexp)
:version "28.1")
(defcustom comp-never-optimize-functions
(defcustom native-comp-never-optimize-functions
'(;; The following two are mandatory for Emacs to be working
;; correctly (see comment in `advice--add-function'). DO NOT
;; REMOVE.
@ -107,7 +107,7 @@ during bootstrap."
:type '(repeat symbol)
:version "28.1")
(defcustom comp-async-jobs-number 0
(defcustom native-comp-async-jobs-number 0
"Default number of subprocesses used for async native compilation.
Value of zero means to use half the number of the CPU's execution units,
or one if there's just one execution unit."
@ -115,26 +115,26 @@ or one if there's just one execution unit."
:risky t
:version "28.1")
(defcustom comp-async-cu-done-functions nil
(defcustom native-comp-async-cu-done-functions nil
"List of functions to call after asynchronously compiling one compilation unit.
Called with one argument FILE, the filename used as input to
compilation."
:type 'hook
:version "28.1")
(defcustom comp-async-all-done-hook nil
(defcustom native-comp-async-all-done-hook nil
"Hook run after completing asynchronous compilation of all input files."
:type 'hook
:version "28.1")
(defcustom comp-async-env-modifier-form nil
(defcustom native-comp-async-env-modifier-form nil
"Form evaluated before compilation by each asynchronous compilation subprocess.
Used to modify the compiler environment."
:type 'sexp
:risky t
:version "28.1")
(defcustom comp-async-report-warnings-errors t
(defcustom native-comp-async-report-warnings-errors t
"Whether to report warnings and errors from asynchronous native compilation.
When native compilation happens asynchronously, it can produce
@ -148,11 +148,16 @@ As asynchronous native compilation always starts from a pristine
environment, it is more sensitive to such omissions, and might be
unable to compile such Lisp source files correctly.
Set this variable to nil if these warnings annoy you."
:type 'boolean
Set this variable to nil to suppress warnings altogether, or to
the symbol `silent' to log warnings but not pop up the *Warnings*
buffer."
:type '(choice
(const :tag "Do not report warnings" nil)
(const :tag "Report and display warnings" t)
(const :tag "Report but do not display warnings" 'silent))
:version "28.1")
(defcustom comp-async-query-on-exit nil
(defcustom native-comp-async-query-on-exit nil
"Whether to query the user about killing async compilations when exiting.
If this is non-nil, Emacs will ask for confirmation to exit and kill the
asynchronous native compilations if any are running. If nil, when you
@ -161,7 +166,7 @@ if `confirm-kill-processes' is non-nil."
:type 'boolean
:version "28.1")
(defcustom comp-native-driver-options nil
(defcustom native-comp-driver-options nil
"Options passed verbatim to the native compiler's back-end driver.
Note that not all options are meaningful; typically only the options
affecting the assembler and linker are likely to be useful.
@ -178,7 +183,7 @@ the .eln output directory."
:type 'boolean
:version "28.1")
(defcustom comp-warning-on-missing-source t
(defcustom native-comp-warning-on-missing-source t
"Emit a warning if a byte-code file being loaded has no corresponding source.
The source file is necessary for native code file look-up and deferred
compilation mechanism."
@ -662,7 +667,7 @@ Useful to hook into pass checkers.")
(defun comp-subr-trampoline-install (subr-name)
"Make SUBR-NAME effectively advice-able when called from native code."
(unless (or (null comp-enable-subr-trampolines)
(memq subr-name comp-never-optimize-functions)
(memq subr-name native-comp-never-optimize-functions)
(gethash subr-name comp-installed-trampolines-h))
(cl-assert (subr-primitive-p (symbol-function subr-name)))
(comp--install-trampoline
@ -743,11 +748,11 @@ Returns ELT."
"Lisp side of the compiler context."
(output nil :type string
:documentation "Target output file-name for the compilation.")
(speed comp-speed :type number
(speed native-comp-speed :type number
:documentation "Default speed for this compilation unit.")
(debug comp-debug :type number
(debug native-comp-debug :type number
:documentation "Default debug level for this compilation unit.")
(driver-options comp-native-driver-options :type list
(driver-options native-comp-driver-options :type list
:documentation "Options for the GCC driver.")
(top-level-forms () :type list
:documentation "List of spilled top level forms.")
@ -899,7 +904,7 @@ CFG is mutated by a pass.")
(has-non-local nil :type boolean
:documentation "t if non local jumps are present.")
(speed nil :type number
:documentation "Optimization level (see `comp-speed').")
:documentation "Optimization level (see `native-comp-speed').")
(pure nil :type boolean
:documentation "t if pure nil otherwise.")
(type nil :type (or null comp-mvar)
@ -1028,18 +1033,18 @@ Assume allocation class 'd-default as default."
(,(rx-to-string
`(seq "(" (group-n 1 (or ,@(mapcar #'symbol-name comp-limple-ops)))))
(1 font-lock-keyword-face)))
"Highlights used by `comp-limple-mode'.")
"Highlights used by `native-comp-limple-mode'.")
(define-derived-mode comp-limple-mode fundamental-mode "LIMPLE"
(define-derived-mode native-comp-limple-mode fundamental-mode "LIMPLE"
"Syntax-highlight LIMPLE IR."
(setf font-lock-defaults '(comp-limple-lock-keywords)))
(cl-defun comp-log (data &optional (level 1) quoted)
"Log DATA at LEVEL.
LEVEL is a number from 1-3, and defaults to 1; if it is less
than `comp-verbose', do nothing. If `noninteractive', log
than `native-comp-verbose', do nothing. If `noninteractive', log
with `message'. Otherwise, log with `comp-log-to-buffer'."
(when (>= comp-verbose level)
(when (>= native-comp-verbose level)
(if noninteractive
(cl-typecase data
(atom (message "%s" data))
@ -1059,8 +1064,8 @@ with `message'. Otherwise, log with `comp-log-to-buffer'."
(inhibit-read-only t)
at-end-p)
(with-current-buffer log-buffer
(unless (eq major-mode 'comp-limple-mode)
(comp-limple-mode))
(unless (eq major-mode 'native-comp-limple-mode)
(native-comp-limple-mode))
(when (= (point) (point-max))
(setf at-end-p t))
(save-excursion
@ -1091,7 +1096,7 @@ with `message'. Otherwise, log with `comp-log-to-buffer'."
(defun comp-log-func (func verbosity)
"Log function FUNC at VERBOSITY.
VERBOSITY is a number between 0 and 3."
(when (>= comp-verbose verbosity)
(when (>= native-comp-verbose verbosity)
(comp-log (format "\nFunction: %s\n" (comp-func-name func)) verbosity)
(cl-loop
for block-name being each hash-keys of (comp-func-blocks func)
@ -1333,12 +1338,12 @@ clashes."
(setf (comp-ctxt-output comp-ctxt) (comp-el-to-eln-filename
filename
(when byte-native-for-bootstrap
(car (last comp-eln-load-path))))))
(setf (comp-ctxt-speed comp-ctxt) (alist-get 'comp-speed
(car (last native-comp-eln-load-path))))))
(setf (comp-ctxt-speed comp-ctxt) (alist-get 'native-comp-speed
byte-native-qualities)
(comp-ctxt-debug comp-ctxt) (alist-get 'comp-debug
(comp-ctxt-debug comp-ctxt) (alist-get 'native-comp-debug
byte-native-qualities)
(comp-ctxt-driver-options comp-ctxt) (alist-get 'comp-native-driver-options
(comp-ctxt-driver-options comp-ctxt) (alist-get 'native-comp-driver-options
byte-native-qualities)
(comp-ctxt-top-level-forms comp-ctxt)
(cl-loop
@ -3250,14 +3255,14 @@ Return t if something was changed."
;; funcall trampoline gets optimized into normal indirect calls.
;; This makes effectively this calls equivalent to all the subrs that got
;; dedicated byte-code ops.
;; Triggered at comp-speed >= 2.
;; Triggered at native-comp-speed >= 2.
;; - Recursive calls gets optimized into direct calls.
;; Triggered at comp-speed >= 2.
;; Triggered at native-comp-speed >= 2.
;; - Intra compilation unit procedure calls gets optimized into direct calls.
;; This can be a big win and even allow gcc to inline but does not make
;; function in the compilation unit re-definable safely without recompiling
;; the full compilation unit.
;; For this reason this is triggered only at comp-speed == 3.
;; For this reason this is triggered only at native-comp-speed == 3.
(defun comp-func-in-unit (func)
"Given FUNC return the `comp-fun' definition in the current context.
@ -3275,7 +3280,7 @@ FUNCTION can be a function-name or byte compiled function."
(when (and callee
(or (symbolp callee)
(gethash callee (comp-ctxt-byte-func-to-func-h comp-ctxt)))
(not (memq callee comp-never-optimize-functions)))
(not (memq callee native-comp-never-optimize-functions)))
(let* ((f (if (symbolp callee)
(symbol-function callee)
(cl-assert (byte-code-function-p callee))
@ -3650,14 +3655,14 @@ Prepare every function for final compilation and drive the C back-end."
(print-circle t)
(print-escape-multibyte t)
(expr `((require 'comp)
(setf comp-verbose ,comp-verbose
(setf native-comp-verbose ,native-comp-verbose
comp-libgccjit-reproducer ,comp-libgccjit-reproducer
comp-ctxt ,comp-ctxt
comp-eln-load-path ',comp-eln-load-path
comp-native-driver-options
',comp-native-driver-options
native-comp-eln-load-path ',native-comp-eln-load-path
native-comp-driver-options
',native-comp-driver-options
load-path ',load-path)
,comp-async-env-modifier-form
,native-comp-async-env-modifier-form
(message "Compiling %s..." ',output)
(comp-final1)))
(temp-file (make-temp-file
@ -3703,12 +3708,12 @@ Prepare every function for final compilation and drive the C back-end."
(defun comp-eln-load-path-eff ()
"Return a list of effective eln load directories.
Account for `comp-eln-load-path' and `comp-native-version-dir'."
Account for `native-comp-eln-load-path' and `comp-native-version-dir'."
(mapcar (lambda (dir)
(expand-file-name comp-native-version-dir
(file-name-as-directory
(expand-file-name dir invocation-directory))))
comp-eln-load-path))
native-comp-eln-load-path))
(defun comp-trampoline-filename (subr-name)
"Given SUBR-NAME return the filename containing the trampoline."
@ -3756,7 +3761,7 @@ Return the trampoline if found or nil otherwise."
;; Use speed 0 to maximize compilation speed and not to
;; optimize away funcall calls!
(byte-optimize nil)
(comp-speed 1)
(native-comp-speed 1)
(lexical-binding t))
(comp--native-compile
form nil
@ -3772,14 +3777,14 @@ Return the trampoline if found or nil otherwise."
when (file-writable-p f)
do (cl-return f)
finally (error "Cannot find suitable directory for output in \
`comp-eln-load-path'")))))
`native-comp-eln-load-path'")))))
;; Some entry point support code.
;;;###autoload
(defun comp-clean-up-stale-eln (file)
"Given FILE remove all its *.eln files in `comp-eln-load-path'
"Given FILE remove all its *.eln files in `native-comp-eln-load-path'
sharing the original source filename (including FILE)."
(when (string-match (rx "-" (group-n 1 (1+ hex)) "-" (1+ hex) ".eln" eos)
file)
@ -3851,7 +3856,7 @@ processes from `comp-async-compilations'"
(defvar comp-num-cpus nil)
(defun comp-effective-async-max-jobs ()
"Compute the effective number of async jobs."
(if (zerop comp-async-jobs-number)
(if (zerop native-comp-async-jobs-number)
(or comp-num-cpus
(setf comp-num-cpus
;; FIXME: we already have a function to determine
@ -3867,26 +3872,30 @@ processes from `comp-async-compilations'"
(shell-command-to-string "sysctl -n hw.ncpu")))
(t 1))
2))))
comp-async-jobs-number))
native-comp-async-jobs-number))
(defvar comp-last-scanned-async-output nil)
(make-variable-buffer-local 'comp-last-scanned-async-output)
(defun comp-accept-and-process-async-output (process)
"Accept PROCESS output and check for diagnostic messages."
(if comp-async-report-warnings-errors
(with-current-buffer (process-buffer process)
(save-excursion
(accept-process-output process)
(goto-char (or comp-last-scanned-async-output (point-min)))
(while (re-search-forward "^.*?\\(?:Error\\|Warning\\): .*$"
nil t)
(display-warning 'comp (match-string 0)))
(setq comp-last-scanned-async-output (point-max))))
(if native-comp-async-report-warnings-errors
(let ((warning-suppress-types
(if (eq native-comp-async-report-warnings-errors 'silent)
(cons '(comp) warning-suppress-types)
warning-suppress-types)))
(with-current-buffer (process-buffer process)
(save-excursion
(accept-process-output process)
(goto-char (or comp-last-scanned-async-output (point-min)))
(while (re-search-forward "^.*?\\(?:Error\\|Warning\\): .*$"
nil t)
(display-warning 'comp (match-string 0)))
(setq comp-last-scanned-async-output (point-max)))))
(accept-process-output process)))
(defun comp-run-async-workers ()
"Start compiling files from `comp-files-queue' asynchronously.
When compilation is finished, run `comp-async-all-done-hook' and
When compilation is finished, run `native-comp-async-all-done-hook' and
display a message."
(if (or comp-files-queue
(> (comp-async-runnings) 0))
@ -3897,7 +3906,7 @@ display a message."
do (cl-assert (string-match-p comp-valid-source-re source-file) nil
"`comp-files-queue' should be \".el\" files: %s"
source-file)
when (or comp-always-compile
when (or native-comp-always-compile
load ; Always compile when the compilation is
; commanded for late load.
(file-newer-than-file-p
@ -3905,17 +3914,17 @@ display a message."
do (let* ((expr `((require 'comp)
,(when (boundp 'backtrace-line-length)
`(setf backtrace-line-length ,backtrace-line-length))
(setf comp-speed ,comp-speed
comp-debug ,comp-debug
comp-verbose ,comp-verbose
(setf native-comp-speed ,native-comp-speed
native-comp-debug ,native-comp-debug
native-comp-verbose ,native-comp-verbose
comp-libgccjit-reproducer ,comp-libgccjit-reproducer
comp-async-compilation t
comp-eln-load-path ',comp-eln-load-path
comp-native-driver-options
',comp-native-driver-options
native-comp-eln-load-path ',native-comp-eln-load-path
native-comp-driver-options
',native-comp-driver-options
load-path ',load-path
warning-fill-column most-positive-fixnum)
,comp-async-env-modifier-form
,native-comp-async-env-modifier-form
(message "Compiling %s..." ,source-file)
(comp--native-compile ,source-file ,(and load t))))
(source-file1 source-file) ;; Make the closure works :/
@ -3940,7 +3949,7 @@ display a message."
:sentinel
(lambda (process _event)
(run-hook-with-args
'comp-async-cu-done-functions
'native-comp-async-cu-done-functions
source-file)
(comp-accept-and-process-async-output process)
(ignore-errors (delete-file temp-file))
@ -3953,12 +3962,12 @@ display a message."
(native-elisp-load eln-file
(eq load1 'late))))
(comp-run-async-workers))
:noquery (not comp-async-query-on-exit))))
:noquery (not native-comp-async-query-on-exit))))
(puthash source-file process comp-async-compilations))
when (>= (comp-async-runnings) (comp-effective-async-max-jobs))
do (cl-return)))
;; No files left to compile and all processes finished.
(run-hooks 'comp-async-all-done-hook)
(run-hooks 'native-comp-async-all-done-hook)
(with-current-buffer (get-buffer-create comp-async-buffer-name)
(save-excursion
(goto-char (point-max))
@ -4044,11 +4053,11 @@ LOAD and SELECTOR work as described in `native--compile-async'."
(t (error "SELECTOR must be a function a regexp or nil")))
;; Also exclude files from deferred compilation if
;; any of the regexps in
;; `comp-deferred-compilation-deny-list' matches.
;; `native-comp-deferred-compilation-deny-list' matches.
(and (eq load 'late)
(cl-some (lambda (re)
(string-match-p re file))
comp-deferred-compilation-deny-list))))
native-comp-deferred-compilation-deny-list))))
(defun native--compile-async (files &optional recursively load selector)
"Compile FILES asynchronously.
@ -4066,7 +4075,7 @@ nil -- Select all files.
a string -- A regular expression selecting files with matching names.
a function -- A function selecting files with matching names.
The variable `comp-async-jobs-number' specifies the number
The variable `native-comp-async-jobs-number' specifies the number
of (commands) to run simultaneously.
LOAD can also be the symbol `late'. This is used internally if
@ -4123,10 +4132,10 @@ bytecode definition was not changed in the meantime)."
;;;###autoload
(defun comp-lookup-eln (filename)
"Given a Lisp source FILENAME return the corresponding .eln file if found.
Search happens in `comp-eln-load-path'."
Search happens in `native-comp-eln-load-path'."
(cl-loop
with eln-filename = (comp-el-to-eln-rel-filename filename)
for dir in comp-eln-load-path
for dir in native-comp-eln-load-path
for f = (expand-file-name eln-filename
(expand-file-name comp-native-version-dir
(expand-file-name
@ -4159,7 +4168,7 @@ Native compilation equivalent to `batch-byte-compile'."
(cl-loop for file in command-line-args-left
if (or (null byte-native-for-bootstrap)
(cl-notany (lambda (re) (string-match re file))
comp-bootstrap-deny-list))
native-comp-bootstrap-deny-list))
do (comp--native-compile file)
else
do (byte-compile-file file)))
@ -4169,7 +4178,7 @@ Native compilation equivalent to `batch-byte-compile'."
"Like `batch-native-compile', but used for bootstrap.
Generate .elc files in addition to the .eln files.
Force the produced .eln to be outputted in the eln system
directory (the last entry in `comp-eln-load-path').
directory (the last entry in `native-comp-eln-load-path').
If the environment variable 'NATIVE_DISABLED' is set, only byte
compile."
(comp-ensure-native-compiler)
@ -4200,7 +4209,7 @@ nil -- Select all files.
a string -- A regular expression selecting files with matching names.
a function -- A function selecting files with matching names.
The variable `comp-async-jobs-number' specifies the number
The variable `native-comp-async-jobs-number' specifies the number
of (commands) to run simultaneously."
;; Normalize: we only want to pass t or nil, never e.g. `late'.
(let ((load (not (not load))))

View file

@ -88,6 +88,7 @@ using, but only when you also use Edebug."
;; because the byte compiler binds them; as a result, if edebug
;; is first loaded for a require in a compilation, they will be left unbound.
;;;###autoload
(defcustom edebug-all-defs nil
"If non-nil, evaluating defining forms instruments for Edebug.
This applies to `eval-defun', `eval-region', `eval-buffer', and
@ -100,6 +101,7 @@ variable. You may wish to make it local to each buffer with
`emacs-lisp-mode-hook'."
:type 'boolean)
;;;###autoload
(defcustom edebug-all-forms nil
"Non-nil means evaluation of all forms will instrument for Edebug.
This doesn't apply to loading or evaluations in the minibuffer.

View file

@ -347,19 +347,20 @@ See `defclass' for more information."
(when eieio-backward-compatibility
(let ((csym (intern (concat (symbol-name cname) "-list-p"))))
(defalias csym
`(lambda (obj)
,(format
"Test OBJ to see if it a list of objects which are a child of type %s"
cname)
(when (listp obj)
(let ((ans t)) ;; nil is valid
;; Loop over all the elements of the input list, test
;; each to make sure it is a child of the desired object class.
(while (and obj ans)
(setq ans (and (eieio-object-p (car obj))
(object-of-class-p (car obj) ,cname)))
(setq obj (cdr obj)))
ans))))
(lambda (obj)
(:documentation
(format
"Test OBJ to see if it a list of objects which are a child of type %s"
cname))
(when (listp obj)
(let ((ans t)) ;; nil is valid
;; Loop over all the elements of the input list, test
;; each to make sure it is a child of the desired object class.
(while (and obj ans)
(setq ans (and (eieio-object-p (car obj))
(object-of-class-p (car obj) 'cname)))
(setq obj (cdr obj)))
ans))))
(make-obsolete csym (format
"use (cl-typep ... \\='(list-of %s)) instead"
cname)

View file

@ -538,7 +538,7 @@ documentation to potentially appear in the echo are is truncated."
(and truncatedp
(eq eldoc-echo-area-prefer-doc-buffer
'maybe)))
(get-buffer-window eldoc--doc-buffer)))
(get-buffer-window eldoc--doc-buffer 'visible)))
(defun eldoc-display-in-echo-area (docs _interactive)
"Display DOCS in echo area.

View file

@ -98,7 +98,7 @@ To be used in ERT tests. If BODY finishes successfully, the test
buffer is killed; if there is an error, the test buffer is kept
around on error for further inspection. Its name is derived from
the name of the test and the result of NAME-FORM."
(declare (debug ((":name" form) body))
(declare (debug ((":name" form) def-body))
(indent 1))
`(ert--call-with-test-buffer ,name-form (lambda () ,@body)))

View file

@ -135,7 +135,7 @@ The returned value will then be an Elisp expression that first evaluates
all the parts of PLACE that can be evaluated and then runs E.
\(fn (GETTER SETTER) PLACE &rest BODY)"
(declare (indent 2) (debug (sexp form body)))
(declare (indent 2) (debug (sexp form def-body)))
`(gv-get ,place (lambda ,vars ,@body)))
;; Different ways to declare a generalized variable.

View file

@ -682,10 +682,16 @@ font-lock keywords will not be case sensitive."
(defun lisp-outline-level ()
"Lisp mode `outline-level' function."
;; Expects outline-regexp is ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|("
;; and point is at the beginning of a matching line.
(let ((len (- (match-end 0) (match-beginning 0))))
(if (looking-at "(\\|;;;###autoload")
1000
len)))
(cond ((looking-at "(\\|;;;###autoload")
1000)
((looking-at ";;\\(;+\\) ")
(- (match-end 1) (match-beginning 1)))
;; Above should match everything but just in case.
(t
len))))
(defun lisp-current-defun-name ()
"Return the name of the defun at point, or nil."

View file

@ -324,13 +324,13 @@ is also interactive. There are 3 cases:
(subr-primitive-p (gv-deref ref)))
(let ((subr-name (intern (subr-name (gv-deref ref)))))
;; Requiring the native compiler to advice `macroexpand' cause a
;; circular dependency in eager macro expansion.
;; uniquify is advising `rename-buffer' while being loaded in
;; loadup.el. This would require the whole native compiler
;; machinery but we don't want to include it in the dump.
;; Because these two functions are already handled in
;; `comp-never-optimize-functions' we hack the problem this way
;; for now :/
;; circular dependency in eager macro expansion. uniquify is
;; advising `rename-buffer' while being loaded in loadup.el.
;; This would require the whole native compiler machinery but we
;; don't want to include it in the dump. Because these two
;; functions are already handled in
;; `native-comp-never-optimize-functions' we hack the problem
;; this way for now :/
(unless (memq subr-name '(macroexpand rename-buffer))
;; Must require explicitly as during bootstrap we have no
;; autoloads.
@ -503,7 +503,7 @@ arguments. Note if NAME is nil the advice is anonymous;
otherwise it is named `SYMBOL@NAME'.
\(fn SYMBOL (WHERE LAMBDA-LIST &optional NAME DEPTH) &rest BODY)"
(declare (indent 2) (doc-string 3) (debug (sexp sexp body)))
(declare (indent 2) (doc-string 3) (debug (sexp sexp def-body)))
(or (listp args) (signal 'wrong-type-argument (list 'listp args)))
(or (<= 2 (length args) 4)
(signal 'wrong-number-of-arguments (list 2 4 (length args))))

View file

@ -1305,7 +1305,10 @@ is non-nil, don't propagate connection errors (does not apply to
errors signaled by ERROR-FORM or by BODY).
\(fn URL &key ASYNC FILE ERROR-FORM NOERROR &rest BODY)"
(declare (indent defun) (debug t))
(declare (indent defun)
;; FIXME: This should be something like
;; `form def-body &rest form', but that doesn't work.
(debug (form &rest sexp)))
(while (keywordp (car body))
(setq body (cdr (cdr body))))
`(package--with-response-buffer-1 ,url (lambda () ,@body)
@ -2267,7 +2270,7 @@ Clean-up the corresponding .eln files if Emacs is native
compiled."
(when (featurep 'native-compile)
(cl-loop
for file in (directory-files-recursively dir ".el\\'")
for file in (directory-files-recursively dir "\\.el\\'")
do (comp-clean-up-stale-eln (comp-el-to-eln-filename file))))
(delete-directory dir t))

View file

@ -341,7 +341,12 @@ the regexp builder. It displays a buffer named \"*RE-Builder*\"
in another window, initially containing an empty regexp.
As you edit the regexp in the \"*RE-Builder*\" buffer, the
matching parts of the target buffer will be highlighted."
matching parts of the target buffer will be highlighted.
Case-sensitivity can be toggled with \\[reb-toggle-case]. The
regexp builder supports three different forms of input which can
be set with \\[reb-change-syntax]. More options and details are
provided in the Commentary section of this library."
(interactive)
(if (and (string= (buffer-name) reb-buffer)
(reb-mode-buffer-p))

View file

@ -27,36 +27,37 @@
;;;###autoload
(defun read-multiple-choice (prompt choices &optional help-string)
"Ask user a multiple choice question.
PROMPT should be a string that will be displayed as the prompt.
"Ask user to select an entry from CHOICES, promting with PROMPT.
This function allows to ask the user a multiple-choice question.
CHOICES is a list of (KEY NAME [DESCRIPTION]). KEY is a
character to be entered. NAME is a short name for the entry to
be displayed while prompting (if there's room, it might be
shortened). DESCRIPTION is an optional longer explanation for
the entry that will be displayed in a help buffer if the user
requests more help. This help description has a fixed format in
columns, but, for greater flexibility, instead of passing a
DESCRIPTION, the user can use the optional argument HELP-STRING.
This argument is a string that contains the text with the
complete description of all choices. `read-multiple-choice' will
display that description in a help buffer if the user requests
it.
CHOICES should be a list of the form (KEY NAME [DESCRIPTION]).
KEY is a character the user should type to select the entry.
NAME is a short name for the entry to be displayed while prompting
\(if there's no room, it might be shortened).
DESCRIPTION is an optional longer description of the entry; it will
be displayed in a help buffer if the user requests more help. This
help description has a fixed format in columns. For greater
flexibility, instead of passing a DESCRIPTION, the caller can pass
the optional argument HELP-STRING. This argument is a string that
should contain a more detailed description of all of the possible
choices. `read-multiple-choice' will display that description in a
help buffer if the user requests that.
This function translates user input into responses by consulting
the bindings in `query-replace-map'; see the documentation of
that variable for more information. In this case, the useful
bindings are `recenter', `scroll-up', `scroll-down', and `edit'.
If the user enters `recenter', `scroll-up', or `scroll-down'
responses, perform the requested window recentering or scrolling
and ask again. If the user enters `edit', start a recursive
edit. When the user exit the recursive edit, the multiple choice
prompt gains focus again.
that variable for more information. The relevant bindings for the
purposes of this function are `recenter', `scroll-up', `scroll-down',
and `edit'.
If the user types the `recenter', `scroll-up', or `scroll-down'
responses, the function performs the requested window recentering or
scrolling, and then asks the question again. If the user enters `edit',
the function starts a recursive edit. When the user exit the recursive
edit, the multiple-choice prompt gains focus again.
When `use-dialog-box' is t (the default), this function can pop
up a dialog window to collect the user input. That functionality
requires `display-popup-menus-p' to return t. Otherwise, a
text dialog will be used.
When `use-dialog-box' is t (the default), and the command using this
function was invoked via the mouse, this function pops up a GUI dialog
to collect the user input, but only if Emacs is capable of using GUI
dialogs. Otherwise, the function will always use text-mode dialogs.
The return value is the matching entry from the CHOICES list.
@ -146,7 +147,7 @@ Usage example:
(save-excursion
(message "%s"
(substitute-command-keys
"Recursive edit. Resume with \\[exit-recursive-edit]"))
"Recursive edit; type \\[exit-recursive-edit] to return to help screen"))
(recursive-edit))))
(t tchar)))
(when (eq tchar t)

View file

@ -1445,12 +1445,23 @@ following constructs:
(regexp (rx--to-expr (rx--pcase-transform (cons 'seq regexps))))
(nvars (length rx--pcase-vars)))
`(and (pred stringp)
,(if (zerop nvars)
;; No variables bound: a single predicate suffices.
`(pred (string-match ,regexp))
,(pcase nvars
(0
;; No variables bound: a single predicate suffices.
`(pred (string-match ,regexp)))
(1
;; Create a match value that on a successful regexp match
;; is the submatch value, 0 on failure. We can't use nil
;; for failure because it is a valid submatch value.
`(app (lambda (s)
(if (string-match ,regexp s)
(match-string 1 s)
0))
(and ,(car rx--pcase-vars) (pred (not numberp)))))
(_
;; Pack the submatches into a dotted list which is then
;; immediately destructured into individual variables again.
;; This is of course slightly inefficient when NVARS > 1.
;; This is of course slightly inefficient.
;; A dotted list is used to reduce the number of conses
;; to create and take apart.
`(app (lambda (s)
@ -1463,7 +1474,7 @@ following constructs:
(rx--reduce-right
#'cons
(mapcar (lambda (name) (list '\, name))
(reverse rx--pcase-vars)))))))))
(reverse rx--pcase-vars))))))))))
;; Obsolete internal symbol, used in old versions of the `flycheck' package.
(define-obsolete-function-alias 'rx-submatch-n 'rx-to-string "27.1")

View file

@ -625,7 +625,7 @@ There can be any number of :example/:result elements."
(length>
:eval (length> '(a b c) 1))
(length=
:eval (length> '(a b c) 3))
:eval (length= '(a b c) 3))
(safe-length
:eval (safe-length '(a b c))))

View file

@ -174,8 +174,8 @@ As a special case, interprets a SPEC of the form \(SYMBOL SOMETHING)
like \((SYMBOL SOMETHING)). This exists for backward compatibility
with an old syntax that accepted only one binding."
(declare (indent 2)
(debug ([&or (&rest [&or symbolp (symbolp form) (form)])
(symbolp form)]
(debug ([&or (symbolp form) ; must be first, Bug#48489
(&rest [&or symbolp (symbolp form) (form)])]
form body)))
(when (and (<= (length spec) 2)
(not (listp (car spec))))
@ -289,6 +289,18 @@ than this function."
(let ((result nil)
(result-length 0)
(index (if end (1- (length string)) 0)))
;; FIXME: This implementation, which uses encode-coding-char
;; to encode the string one character at a time, is in general
;; incorrect: coding-systems that produce prefix or suffix
;; bytes, such as ISO-2022-based or UTF-8/16 with BOM, will
;; produce those bytes for each character, instead of just
;; once for the entire string. encode-coding-char attempts to
;; remove those extra bytes at least in some situations, but
;; it cannot do that in all cases. And in any case, producing
;; what is supposed to be a UTF-16 or ISO-2022-CN encoded
;; string which lacks the BOM bytes at the beginning and the
;; charset designation sequences at the head and tail of the
;; result will definitely surprise the callers in some cases.
(while (let ((encoded (encode-coding-char
(aref string index) coding-system)))
(and (<= (+ (length encoded) result-length) length)

View file

@ -31,28 +31,40 @@
(defun text-property-search-forward (property &optional value predicate
not-current)
"Search for the next region of text whose PROPERTY matches VALUE.
If not found, return nil and don't move point.
If found, move point to the start of the region and return a
`prop-match' object describing the match. To access the details
of the match, use `prop-match-beginning' and `prop-match-end' for
the buffer positions that limit the region, and
`prop-match-value' for the value of PROPERTY in the region.
"Search for the next region of text where PREDICATE is true.
PREDICATE is used to decide whether a value of PROPERTY should be
considered as matching VALUE.
If PREDICATE is t, that means a value must `equal' VALUE to be
considered a match.
If PREDICATE is nil, a value will match if it is non-nil and
is NOT `equal' to VALUE.
If PREDICATE is a function, it will be called with two arguments:
VALUE and the value of PROPERTY. The function should return
non-nil if these two values are to be considered a match.
Two special values of PREDICATE can also be used:
If PREDICATE is t, that means a value must `equal' VALUE to be
considered a match.
If PREDICATE is nil (which is the default value), a value will
match if is not `equal' to VALUE. Furthermore, a nil PREDICATE
means that the match region is ended if the value changes. For
instance, this means that if you loop with
(while (setq prop (text-property-search-forward 'face))
...)
you will get all distinct regions with non-nil `face' values in
the buffer, and the `prop' object will have the details about the
match. See the manual for more details and examples about how
VALUE and PREDICATE interact.
If NOT-CURRENT is non-nil, the function will search for the first
region that doesn't include point and has a value of PROPERTY
that matches VALUE."
that matches VALUE.
If no matches can be found, return nil and don't move point.
If found, move point to the end of the region and return a
`prop-match' object describing the match. To access the details
of the match, use `prop-match-beginning' and `prop-match-end' for
the buffer positions that limit the region, and
`prop-match-value' for the value of PROPERTY in the region."
(interactive
(list
(let ((string (completing-read "Search for property: " obarray)))
@ -125,7 +137,7 @@ that matches VALUE."
"Search for the previous region of text whose PROPERTY matches VALUE.
Like `text-property-search-forward', which see, but searches backward,
and if a matching region is found, place point at its end."
and if a matching region is found, place point at the start of the region."
(interactive
(list
(let ((string (completing-read "Search for property: " obarray)))

View file

@ -52,7 +52,7 @@
(defmacro thunk-delay (&rest body)
"Delay the evaluation of BODY."
(declare (debug t))
(declare (debug (def-body)))
(cl-assert lexical-binding)
`(let (forced
(val (lambda () ,@body)))

337
lisp/epa-ks.el Normal file
View file

@ -0,0 +1,337 @@
;;; epa-ks.el --- EasyPG Key Server Client -*- lexical-binding: t -*-
;; Copyright (C) 2021 Free Software Foundation, Inc.
;; Author: Philip K. <philipk@posteo.net>
;; Keywords: PGP, GnuPG
;; 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:
;; Keyserver client in Emacs.
;;; Code:
(require 'cl-lib)
(require 'epa)
(require 'subr-x)
(require 'tabulated-list)
(require 'url)
(require 'url-http)
(defgroup epa-ks nil
"The EasyPG Assistant Keyserver client."
:version "28.1"
:group 'epa)
(defcustom epa-keyserver "pgp.mit.edu"
"Domain of keyserver.
This is used by `epa-ks-lookup-key', for looking up public keys."
:type '(choice :tag "Keyserver"
(const random)
(const "keyring.debian.org")
(const "keys.gnupg.net")
(const "keyserver.ubuntu.com")
(const "pgp.mit.edu")
(const "pool.sks-keyservers.net")
(const "zimmermann.mayfirst.org")
(string :tag "Custom keyserver"))
:version "28.1")
(cl-defstruct epa-ks-key
"Structure to hold key data."
id algo len created expires names flags)
(cl-defstruct epa-ks-name
"Structure to hold user associated with keys data."
uid created expires flags)
(defvar epa-ks-last-query nil
"List of arguments to pass to `epa-search-keys'.
This is used when reverting a buffer to restart search.")
(defvar epa-ks-search-mode-map
(let ((map (make-sparse-keymap)))
(suppress-keymap map)
(define-key map (kbd "f") #'epa-ks-mark-key-to-fetch)
(define-key map (kbd "i") #'epa-ks-inspect-key-to-fetch)
(define-key map (kbd "u") #'epa-ks-unmark-key-to-fetch)
(define-key map (kbd "x") #'epa-ks-do-key-to-fetch)
map))
(define-derived-mode epa-ks-search-mode tabulated-list-mode "Keyserver"
"Major mode for listing public key search results."
(buffer-disable-undo)
(setq tabulated-list-format [("ID" 8 t)
("Algo." 5 nil)
("Created" 10 t)
("Expires" 10 t)
("User" 0 t)]
tabulated-list-sort-key '("User" . nil)
tabulated-list-padding 2)
(add-hook 'tabulated-list-revert-hook
#'epa-ks--restart-search
nil t)
(tabulated-list-init-header))
(defun epa-ks-inspect-key-to-fetch ()
"Display full ID of key under point in the minibuffer."
(interactive)
(message "Full ID: %s" (epa-ks-key-id (car (tabulated-list-get-id)))))
(defun epa-ks-unmark-key-to-fetch ()
"Remove fetch mark for key under point.
If a region is active, unmark all keys in active region."
(interactive)
(epa-ks-mark-key-to-fetch ""))
(defun epa-ks-mark-key-to-fetch (tag)
"Add fetch-mark to key under point.
If a region is active, mark all keys in active region.
When all keys have been selected, use \\[epa-ks-do-key-to-fetch] to
actually import the keys.
When called interactively, `epa-ks-mark-key-to-fetch' will always
add a \"F\" tag. Non-interactivly the tag must be specified by
setting the TAG parameter."
(interactive (list "F"))
(if (region-active-p)
(save-mark-and-excursion
(save-restriction
(narrow-to-region (region-beginning) (1- (region-end)))
(goto-char (point-min))
(while (not (eobp))
(tabulated-list-put-tag tag t))))
(tabulated-list-put-tag tag t)))
(defun epa-ks-do-key-to-fetch ()
"Fetch all marked keys from keyserver and import them.
Keys are marked using `epa-ks-mark-key-to-fetch'."
(interactive)
(save-excursion
(let (keys)
(goto-char (point-min))
(while (not (eobp))
(when (looking-at-p (rx bol "F"))
(push (epa-ks-key-id (car (tabulated-list-get-id)))
keys))
(forward-line))
(when (yes-or-no-p (format "Proceed with fetching all %d key(s)? "
(length keys))))
(dolist (id keys)
(epa-ks--fetch-key id))))
(tabulated-list-clear-all-tags))
(defun epa-ks--fetch-key (id)
"Send request to import key with specified ID."
(url-retrieve
(format "https://%s/pks/lookup?%s"
epa-keyserver
(url-build-query-string
`(("search" ,(concat "0x" (url-hexify-string id)))
("options" "mr")
("op" "get"))))
(lambda (status)
(when (plist-get status :error)
(error "Request failed: %s"
(caddr (assq (caddr (plist-get status :error))
url-http-codes))))
(forward-paragraph)
(save-excursion
(goto-char (point-max))
(while (memq (char-before) '(?\s ?\t ?\n))
(forward-char -1))
(delete-region (point) (point-max)))
(let ((epa-popup-info-window nil))
(epa-import-armor-in-region (point) (point-max)))
(kill-buffer))))
(defun epa-ks--display-keys (buf keys)
"Prepare KEYS for `tabulated-list-mode', for buffer BUF.
KEYS is a list of `epa-ks-key' structures, as parsed by
`epa-ks-parse-result'."
(when (buffer-live-p buf)
(let (entries)
(dolist (key keys)
(dolist (name (epa-ks-key-names key))
(push (list (cons key name)
(vector
(substring (epa-ks-key-id key) -8)
(cdr (epa-ks-key-algo key))
(if (epa-ks-key-created key)
(format-time-string "%F" (epa-ks-key-created key))
"N/A")
(if (epa-ks-key-expires key)
(let* ((date (epa-ks-key-expires key))
(str (format-time-string "%F" date)))
(when (< 0 (time-to-seconds (time-since date)))
(setq str (propertize str 'face
'font-lock-warning-face)))
str)
(propertize "N/A" 'face 'shadow))
(decode-coding-string
(epa-ks-name-uid name)
(select-safe-coding-system (epa-ks-name-uid name)
nil 'utf-8))))
entries)))
(with-current-buffer buf
(setq tabulated-list-entries entries)
(tabulated-list-print t t))
(message "Press `f' to mark a key, `x' to fetch all marked keys."))))
(defun epa-ks--restart-search ()
(when epa-ks-last-query
(apply #'epa-search-keys epa-ks-last-query)))
;;;###autoload
(defun epa-search-keys (query exact)
"Ask a keyserver for all keys matching QUERY.
The keyserver to be used is specified by `epa-keyserver'.
If EXACT is non-nil (interactively, prefix argument), require
exact matches.
Note that the request may fail if the query is not specific
enough, since keyservers have strict timeout settings."
(interactive (list (read-string "Search for: ")
current-prefix-arg))
(when (string-empty-p query)
(user-error "No query"))
(let ((buf (get-buffer-create "*Key search*")))
(with-current-buffer buf
(let ((inhibit-read-only t))
(erase-buffer))
(epa-ks-search-mode))
(url-retrieve
(format "https://%s/pks/lookup?%s"
epa-keyserver
(url-build-query-string
(append `(("search" ,query)
("options" "mr")
("op" "index"))
(and exact '(("exact" "on"))))))
(lambda (status)
(when (plist-get status :error)
(when buf
(kill-buffer buf))
(error "Request failed: %s"
(caddr (assq (caddr (plist-get status :error))
url-http-codes))))
(goto-char (point-min))
(while (search-forward "\r\n" nil t)
(replace-match "\n" t t))
(goto-char (point-min))
(re-search-forward "\n\n")
(let (keys)
(save-match-data
(setq keys (epa-ks--parse-buffer))
(kill-buffer (current-buffer)))
(when buf
(epa-ks--display-keys buf keys) keys))))
(pop-to-buffer buf)
(setq epa-ks-last-query (list query exact)))
(message "Searching keys..."))
(defun epa-ks--parse-buffer ()
;; parse machine readable response according to
;; https://tools.ietf.org/html/draft-shaw-openpgp-hkp-00#section-5.2
(when (looking-at (rx bol "info:" (group (+ digit))
":" (* digit) eol))
(unless (string= (match-string 1) "1")
(error "Unsupported keyserver version")))
(forward-line 1)
(let (key keys)
(while (and (not (eobp))
(not (looking-at "[ \t]*\n")))
(cond
((looking-at (rx bol "pub:" (group (+ alnum))
":" (group (* digit))
":" (group (* digit))
":" (group (* digit))
":" (group (* digit))
":" (group (* (any ?r ?d ?e)))
eol))
(setq key
(make-epa-ks-key
:id (match-string 1)
:algo
(and (match-string 2)
(not (string-empty-p (match-string 2)))
(assoc (string-to-number (match-string 2))
epg-pubkey-algorithm-alist))
:len
(and (match-string 3)
(not (string-empty-p (match-string 3)))
(string-to-number (match-string 3)))
:created
(and (match-string 4)
(not (string-empty-p (match-string 4)))
(seconds-to-time
(string-to-number (match-string 4))))
:expires
(and (match-string 5)
(not (string-empty-p (match-string 5)))
(seconds-to-time
(string-to-number (match-string 5))))
:flags
(mapcar (lambda (flag)
(cdr (assq flag '((?r revoked)
(?d disabled)
(?e expired)))))
(match-string 6))))
(push key keys))
((looking-at (rx bol "uid:" (group (+ (not ":")))
":" (group (* digit))
":" (group (* digit))
":" (group (* (any ?r ?d ?e)))
eol))
(push (make-epa-ks-name
:uid (url-unhex-string (match-string 1) t)
:created
(and (match-string 2)
(not (string-empty-p (match-string 2)))
(decode-time (seconds-to-time
(string-to-number
(match-string 2)))))
:expires
(and (match-string 3)
(not (string-empty-p (match-string 3)))
(decode-time (seconds-to-time
(string-to-number
(match-string 3)))))
:flags
(mapcar (lambda (flag)
(cdr (assq flag '((?r revoked)
(?d disabled)
(?e expired)))))
(match-string 4)))
(epa-ks-key-names key)))
((looking-at-p (rx bol "uat:"))
;; user attribute fields are ignored
nil)
(t (error "Invalid server response")))
(forward-line))
keys))
;;; epa-ks.el ends here

View file

@ -108,8 +108,9 @@ use from your key ring."
(interactive
(save-excursion
(goto-char (point-min))
(if (search-forward mail-header-separator nil t)
(forward-line))
(rfc822-goto-eoh)
(unless (eobp)
(forward-line))
(setq epa-last-coding-system-specified
(or coding-system-for-write
(select-safe-coding-system (point) (point-max))))
@ -135,9 +136,7 @@ If no one is selected, default secret key is used. "
(goto-char (point-min))
(save-restriction
(narrow-to-region (point)
(if (search-forward mail-header-separator nil 0)
(match-beginning 0)
(point)))
(progn (rfc822-goto-eoh) (point)))
(setq recipients-string
(mapconcat #'identity
(nconc (mail-fetch-field "to" nil nil t)
@ -170,7 +169,7 @@ If no one is selected, default secret key is used. "
(apply #'nconc
(mapcar
(lambda (recipient)
(let ((tem (assoc recipient epa-mail-aliases)))
(let ((tem (assoc (downcase recipient) epa-mail-aliases)))
(if tem (copy-sequence (cdr tem))
(list recipient))))
real-recipients)))
@ -236,8 +235,9 @@ If no one is selected, symmetric encryption will be performed. "
default-recipients)))))
(goto-char (point-min))
(if (search-forward mail-header-separator nil t)
(forward-line))
(rfc822-goto-eoh)
(unless (eobp)
(forward-line))
(setq start (point))
(setq epa-last-coding-system-specified

View file

@ -2278,8 +2278,8 @@ Example usage:
(erc-tls :server \"chat.freenode.net\" :port 6697
:client-certificate
'(\"/data/bandali/my-cert.key\"
\"/data/bandali/my-cert.crt\"))"
'(\"/home/bandali/my-cert.key\"
\"/home/bandali/my-cert.crt\"))"
(interactive (let ((erc-default-port erc-default-port-tls))
(erc-select-read-args)))
(let ((erc-server-connect-function 'erc-open-tls-stream))

View file

@ -63,8 +63,7 @@ ordinary strings."
(defcustom eshell-pred-load-hook nil
"A list of functions to run when `eshell-pred' is loaded."
:version "24.1" ; removed eshell-pred-initialize
:type 'hook
:group 'eshell-pred)
:type 'hook)
(defcustom eshell-predicate-alist
'((?/ . (eshell-pred-file-type ?d)) ; directories
@ -108,8 +107,7 @@ ordinary strings."
The format of each entry is
(CHAR . PREDICATE-FUNC-SEXP)"
:type '(repeat (cons character sexp))
:group 'eshell-pred)
:type '(repeat (cons character sexp)))
(put 'eshell-predicate-alist 'risky-local-variable t)
@ -146,8 +144,7 @@ The format of each entry is
The format of each entry is
(CHAR ENTRYWISE-P MODIFIER-FUNC-SEXP)"
:type '(repeat (cons character sexp))
:group 'eshell-pred)
:type '(repeat (cons character sexp)))
(put 'eshell-modifier-alist 'risky-local-variable t)
@ -297,9 +294,9 @@ This function is specially for adding onto `eshell-parse-argument-hook'."
(append
eshell-current-modifiers
(list
`(lambda (lst)
(eshell-apply-modifiers
lst (quote ,preds) (quote ,mods)))))))))
(lambda (lst)
(eshell-apply-modifiers
lst preds mods))))))))
(goto-char (1+ end))
(eshell-finish-arg))))))
@ -324,7 +321,7 @@ resultant list of strings."
(if (looking-at "[^|':]")
(let ((func (read (current-buffer))))
(if (and func (functionp func))
(setq preds (eshell-add-pred-func func preds
(setq preds (eshell-add-pred-func (eval func t) preds
negate follow))
(error "Invalid function predicate `%s'"
(eshell-stringify func))))
@ -341,8 +338,7 @@ resultant list of strings."
(let ((func (read (current-buffer))))
(if (and func (functionp func))
(setq mods
(cons `(lambda (lst)
(mapcar (function ,func) lst))
(cons (lambda (lst) (mapcar func lst))
mods))
(error "Invalid function modifier `%s'"
(eshell-stringify func))))
@ -353,14 +349,14 @@ resultant list of strings."
(if (not mod)
(error "Unknown modifier character `%c'" (char-after))
(forward-char)
(setq mods (cons (eval (cdr mod)) mods)))))
(setq mods (cons (eval (cdr mod) t) mods)))))
(t
(let ((pred (assq char eshell-predicate-alist)))
(if (not pred)
(error "Unknown predicate character `%c'" char)
(forward-char)
(setq preds
(eshell-add-pred-func (eval (cdr pred)) preds
(eshell-add-pred-func (eval (cdr pred) t) preds
negate follow))))))))
(end-of-buffer
(error "Predicate or modifier ended prematurely")))
@ -369,11 +365,11 @@ resultant list of strings."
(defun eshell-add-pred-func (pred funcs negate follow)
"Add the predicate function PRED to FUNCS."
(if negate
(setq pred `(lambda (file)
(not (funcall ,pred file)))))
(setq pred (lambda (file)
(not (funcall pred file)))))
(if follow
(setq pred `(lambda (file)
(funcall ,pred (file-truename file)))))
(setq pred (lambda (file)
(funcall pred (file-truename file)))))
(cons pred funcs))
(defun eshell-pred-user-or-group (mod-char mod-type attr-index get-id-func)
@ -399,10 +395,10 @@ resultant list of strings."
(unless ugid
(error "Unknown %s name specified for modifier `%c'"
mod-type mod-char))
`(lambda (file)
(let ((attrs (file-attributes file)))
(if attrs
(= (nth ,attr-index attrs) ,ugid))))))
(lambda (file)
(let ((attrs (file-attributes file)))
(if attrs
(= (nth attr-index attrs) ugid))))))
(defun eshell-pred-file-time (mod-char mod-type attr-index)
"Return a predicate to test whether a file matches a certain time."
@ -445,13 +441,13 @@ resultant list of strings."
(error "Cannot stat file `%s'" file))
(setq when (nth attr-index attrs)))
(goto-char (1+ end)))
`(lambda (file)
(let ((attrs (file-attributes file)))
(if attrs
(,(cond ((eq qual ?-) #'time-less-p)
(let ((f (cond ((eq qual ?-) #'time-less-p)
((eq qual ?+) (lambda (a b) (time-less-p b a)))
(#'time-equal-p))
,when (nth ,attr-index attrs)))))))
(#'time-equal-p))))
(lambda (file)
(let ((attrs (file-attributes file)))
(if attrs
(funcall f when (nth attr-index attrs))))))))
(defun eshell-pred-file-type (type)
"Return a test which tests that the file is of a certain TYPE.
@ -462,20 +458,20 @@ that `ls -l' will show in the first column of its display."
(if (memq type '(?b ?c))
(forward-char)
(setq type ?%)))
`(lambda (file)
(let ((attrs (eshell-file-attributes (directory-file-name file))))
(if attrs
(memq (aref (file-attribute-modes attrs) 0)
,(if (eq type ?%)
'(?b ?c)
(list 'quote (list type))))))))
(let ((set (if (eq type ?%)
'(?b ?c)
(list type))))
(lambda (file)
(let ((attrs (eshell-file-attributes (directory-file-name file))))
(if attrs
(memq (aref (file-attribute-modes attrs) 0) set))))))
(defsubst eshell-pred-file-mode (mode)
"Return a test which tests that MODE pertains to the file."
`(lambda (file)
(let ((modes (file-modes file 'nofollow)))
(if modes
(not (zerop (logand ,mode modes)))))))
(lambda (file)
(let ((modes (file-modes file 'nofollow)))
(if modes
(not (zerop (logand mode modes)))))))
(defun eshell-pred-file-links ()
"Return a predicate to test whether a file has a given number of links."
@ -487,15 +483,15 @@ that `ls -l' will show in the first column of its display."
(error "Invalid file link count modifier `l'"))
(setq amount (string-to-number (match-string 0)))
(goto-char (match-end 0))
`(lambda (file)
(let ((attrs (eshell-file-attributes file)))
(if attrs
(,(if (eq qual ?-)
'<
(if (eq qual ?+)
'>
'=))
(file-attribute-link-number attrs) ,amount))))))
(let ((f (if (eq qual ?-)
#'<
(if (eq qual ?+)
#'>
#'=))))
(lambda (file)
(let ((attrs (eshell-file-attributes file)))
(if attrs
(funcall f (file-attribute-link-number attrs) amount)))))))
(defun eshell-pred-file-size ()
"Return a predicate to test whether a file is of a given size."
@ -517,15 +513,15 @@ that `ls -l' will show in the first column of its display."
(error "Invalid file size modifier `L'"))
(setq amount (* (string-to-number (match-string 0)) quantum))
(goto-char (match-end 0))
`(lambda (file)
(let ((attrs (eshell-file-attributes file)))
(if attrs
(,(if (eq qual ?-)
'<
(if (eq qual ?+)
'>
'=))
(file-attribute-size attrs) ,amount))))))
(let ((f (if (eq qual ?-)
#'<
(if (eq qual ?+)
#'>
#'=))))
(lambda (file)
(let ((attrs (eshell-file-attributes file)))
(if attrs
(funcall f (file-attribute-size attrs) amount)))))))
(defun eshell-pred-substitute (&optional repeat)
"Return a modifier function that will substitute matches."
@ -539,22 +535,22 @@ that `ls -l' will show in the first column of its display."
replace (buffer-substring-no-properties (point) end))
(goto-char (1+ end))
(if repeat
`(lambda (lst)
(mapcar
(lambda (str)
(let ((i 0))
(while (setq i (string-match ,match str i))
(setq str (replace-match ,replace t nil str))))
str)
lst))
`(lambda (lst)
(mapcar
(lambda (str)
(if (string-match ,match str)
(setq str (replace-match ,replace t nil str))
(error (concat str ": substitution failed")))
str)
lst)))))
(lambda (lst)
(mapcar
(lambda (str)
(let ((i 0))
(while (setq i (string-match match str i))
(setq str (replace-match replace t nil str))))
str)
lst))
(lambda (lst)
(mapcar
(lambda (str)
(if (string-match match str)
(setq str (replace-match replace t nil str))
(error (concat str ": substitution failed")))
str)
lst)))))
(defun eshell-include-members (&optional invert-p)
"Include only lisp members matching a regexp."
@ -564,12 +560,12 @@ that `ls -l' will show in the first column of its display."
(setq end (eshell-find-delimiter delim delim nil nil t)
regexp (buffer-substring-no-properties (point) end))
(goto-char (1+ end))
`(lambda (lst)
(eshell-winnow-list
lst nil '((lambda (elem)
,(if invert-p
`(not (string-match ,regexp elem))
`(string-match ,regexp elem))))))))
(let ((predicates
(list (if invert-p
(lambda (elem) (not (string-match regexp elem)))
(lambda (elem) (string-match regexp elem))))))
(lambda (lst)
(eshell-winnow-list lst nil predicates)))))
(defun eshell-join-members ()
"Return a modifier function that join matches."
@ -581,8 +577,8 @@ that `ls -l' will show in the first column of its display."
(setq end (eshell-find-delimiter delim delim nil nil t)
str (buffer-substring-no-properties (point) end))
(goto-char (1+ end)))
`(lambda (lst)
(mapconcat 'identity lst ,str))))
(lambda (lst)
(mapconcat #'identity lst str))))
(defun eshell-split-members ()
"Return a modifier function that splits members."
@ -593,10 +589,11 @@ that `ls -l' will show in the first column of its display."
(setq end (eshell-find-delimiter delim delim nil nil t)
sep (buffer-substring-no-properties (point) end))
(goto-char (1+ end)))
`(lambda (lst)
(mapcar
(lambda (str)
(split-string str ,sep)) lst))))
(lambda (lst)
(mapcar
(lambda (str)
(split-string str sep))
lst))))
(provide 'em-pred)

View file

@ -91,12 +91,11 @@
:prefix "facemenu-")
(defcustom facemenu-keybindings
(mapcar 'purecopy
'((default . "d")
(bold . "b")
(italic . "i")
(bold-italic . "l") ; {bold} intersect {italic} = {l}
(underline . "u")))
(bold-italic . "l") ; {bold} intersect {italic} = {l}
(underline . "u"))
"Alist of interesting faces and keybindings.
Each element is itself a list: the car is the name of the face,
the next element is the key to use as a keyboard equivalent of the menu item;
@ -147,7 +146,7 @@ it will remove any faces not explicitly in the list."
(defvar facemenu-face-menu
(let ((map (make-sparse-keymap "Face")))
(define-key map "o" (cons (purecopy "Other...") 'facemenu-set-face))
(define-key map "o" (cons "Other..." 'facemenu-set-face))
map)
"Menu keymap for faces.")
(defalias 'facemenu-face-menu facemenu-face-menu)
@ -155,7 +154,7 @@ it will remove any faces not explicitly in the list."
(defvar facemenu-foreground-menu
(let ((map (make-sparse-keymap "Foreground Color")))
(define-key map "o" (cons (purecopy "Other...") 'facemenu-set-foreground))
(define-key map "o" (cons "Other..." 'facemenu-set-foreground))
map)
"Menu keymap for foreground colors.")
(defalias 'facemenu-foreground-menu facemenu-foreground-menu)
@ -163,7 +162,7 @@ it will remove any faces not explicitly in the list."
(defvar facemenu-background-menu
(let ((map (make-sparse-keymap "Background Color")))
(define-key map "o" (cons (purecopy "Other...") 'facemenu-set-background))
(define-key map "o" (cons "Other..." 'facemenu-set-background))
map)
"Menu keymap for background colors.")
(defalias 'facemenu-background-menu facemenu-background-menu)
@ -186,27 +185,22 @@ return a string which is inserted. It may set `facemenu-end-add-face'."
(defvar facemenu-special-menu
(let ((map (make-sparse-keymap "Special")))
(define-key map [?s] (cons (purecopy "Remove Special")
'facemenu-remove-special))
(define-key map [?c] (cons (purecopy "Charset")
'facemenu-set-charset))
(define-key map [?t] (cons (purecopy "Intangible")
'facemenu-set-intangible))
(define-key map [?v] (cons (purecopy "Invisible")
'facemenu-set-invisible))
(define-key map [?r] (cons (purecopy "Read-Only")
'facemenu-set-read-only))
(define-key map [?s] (cons "Remove Special" 'facemenu-remove-special))
(define-key map [?c] (cons "Charset" 'facemenu-set-charset))
(define-key map [?t] (cons "Intangible" 'facemenu-set-intangible))
(define-key map [?v] (cons "Invisible" 'facemenu-set-invisible))
(define-key map [?r] (cons "Read-Only" 'facemenu-set-read-only))
map)
"Menu keymap for non-face text-properties.")
(defalias 'facemenu-special-menu facemenu-special-menu)
(defvar facemenu-justification-menu
(let ((map (make-sparse-keymap "Justification")))
(define-key map [?c] (cons (purecopy "Center") 'set-justification-center))
(define-key map [?b] (cons (purecopy "Full") 'set-justification-full))
(define-key map [?r] (cons (purecopy "Right") 'set-justification-right))
(define-key map [?l] (cons (purecopy "Left") 'set-justification-left))
(define-key map [?u] (cons (purecopy "Unfilled") 'set-justification-none))
(define-key map [?c] (cons "Center" 'set-justification-center))
(define-key map [?b] (cons "Full" 'set-justification-full))
(define-key map [?r] (cons "Right" 'set-justification-right))
(define-key map [?l] (cons "Left" 'set-justification-left))
(define-key map [?u] (cons "Unfilled" 'set-justification-none))
map)
"Submenu for text justification commands.")
(defalias 'facemenu-justification-menu facemenu-justification-menu)
@ -214,13 +208,13 @@ return a string which is inserted. It may set `facemenu-end-add-face'."
(defvar facemenu-indentation-menu
(let ((map (make-sparse-keymap "Indentation")))
(define-key map [decrease-right-margin]
(cons (purecopy "Indent Right Less") 'decrease-right-margin))
(cons "Indent Right Less" 'decrease-right-margin))
(define-key map [increase-right-margin]
(cons (purecopy "Indent Right More") 'increase-right-margin))
(cons "Indent Right More" 'increase-right-margin))
(define-key map [decrease-left-margin]
(cons (purecopy "Indent Less") 'decrease-left-margin))
(cons "Indent Less" 'decrease-left-margin))
(define-key map [increase-left-margin]
(cons (purecopy "Indent More") 'increase-left-margin))
(cons "Indent More" 'increase-left-margin))
map)
"Submenu for indentation commands.")
(defalias 'facemenu-indentation-menu facemenu-indentation-menu)
@ -230,36 +224,33 @@ return a string which is inserted. It may set `facemenu-end-add-face'."
"Facemenu top-level menu keymap.")
(setq facemenu-menu (make-sparse-keymap "Text Properties"))
(let ((map facemenu-menu))
(define-key map [dc] (cons (purecopy "Display Colors") 'list-colors-display))
(define-key map [df] (cons (purecopy "Display Faces") 'list-faces-display))
(define-key map [dp] (cons (purecopy "Describe Properties")
'describe-text-properties))
(define-key map [ra] (list 'menu-item (purecopy "Remove Text Properties")
(define-key map [dc] (cons "Display Colors" 'list-colors-display))
(define-key map [df] (cons "Display Faces" 'list-faces-display))
(define-key map [dp] (cons "Describe Properties" 'describe-text-properties))
(define-key map [ra] (list 'menu-item "Remove Text Properties"
'facemenu-remove-all
:enable 'mark-active))
(define-key map [rm] (list 'menu-item (purecopy "Remove Face Properties")
(define-key map [rm] (list 'menu-item "Remove Face Properties"
'facemenu-remove-face-props
:enable 'mark-active))
(define-key map [s1] (list (purecopy "--"))))
(define-key map [s1] (list "--")))
(let ((map facemenu-menu))
(define-key map [in] (cons (purecopy "Indentation")
'facemenu-indentation-menu))
(define-key map [ju] (cons (purecopy "Justification")
'facemenu-justification-menu))
(define-key map [s2] (list (purecopy "--")))
(define-key map [sp] (cons (purecopy "Special Properties")
'facemenu-special-menu))
(define-key map [bg] (cons (purecopy "Background Color")
'facemenu-background-menu))
(define-key map [fg] (cons (purecopy "Foreground Color")
'facemenu-foreground-menu))
(define-key map [fc] (cons (purecopy "Face")
'facemenu-face-menu)))
(define-key map [in] (cons "Indentation" 'facemenu-indentation-menu))
(define-key map [ju] (cons "Justification" 'facemenu-justification-menu))
(define-key map [s2] (list "--"))
(define-key map [sp] (cons "Special Properties" 'facemenu-special-menu))
(define-key map [bg] (cons "Background Color" 'facemenu-background-menu))
(define-key map [fg] (cons "Foreground Color" 'facemenu-foreground-menu))
(define-key map [fc] (cons "Face" 'facemenu-face-menu)))
(defalias 'facemenu-menu facemenu-menu)
(easy-menu-add-item
menu-bar-edit-menu nil
["Text Properties" facemenu-menu])
(defvar facemenu-keymap
(let ((map (make-sparse-keymap "Set face")))
(define-key map "o" (cons (purecopy "Other...") 'facemenu-set-face))
(define-key map "o" (cons "Other..." 'facemenu-set-face))
(define-key map "\M-o" 'font-lock-fontify-block)
map)
"Keymap for face-changing commands.
@ -819,11 +810,11 @@ This is called whenever you create a new face, and at other times."
symbol (intern name)))
(setq menu 'facemenu-face-menu)
(setq docstring
(purecopy (format "Select face `%s' for subsequent insertion.
(format "Select face `%s' for subsequent insertion.
If the mark is active and there is no prefix argument,
apply face `%s' to the region instead.
This command was defined by `facemenu-add-new-face'."
name name)))
name name))
(cond ((facemenu-iterate ; check if equivalent face is already in the menu
(lambda (m) (and (listp m)
(symbolp (car m))
@ -836,15 +827,15 @@ This command was defined by `facemenu-add-new-face'."
(key
(setq function (intern (concat "facemenu-set-" name)))
(fset function
`(lambda ()
,docstring
(interactive)
(facemenu-set-face
(quote ,symbol)
(if (and mark-active (not current-prefix-arg))
(region-beginning))
(if (and mark-active (not current-prefix-arg))
(region-end)))))
(lambda ()
(:documentation docstring)
(interactive)
(facemenu-set-face
symbol
(if (and mark-active (not current-prefix-arg))
(region-beginning))
(if (and mark-active (not current-prefix-arg))
(region-end)))))
(define-key 'facemenu-keymap key (cons name function))
(define-key menu key (cons name function)))
;; Faces with no keyboard equivalent. Figure out where to put it:

View file

@ -2119,7 +2119,23 @@ the X resource \"reverseVideo\" is present, handle that."
(x-handle-reverse-video frame parameters)
(frame-set-background-mode frame t)
(face-set-after-frame-default frame parameters)
(if (null visibility-spec)
;; Mark frame as 'was-invisible' when it was created as
;; invisible or iconified and PARAMETERS contains either a
;; width or height specification. This should be sufficient
;; to handle Bug#24526 (where a frame is initially iconified
;; to allow manipulating its size in a non-obtrusive way) and
;; avoid that a tiling window manager for GTK3 gets a resize
;; request it cannot handle (Bug#48268). The 'was-invisible'
;; flag is eventually processed in xterm.c after we receive a
;; MapNotify event; non-X builds ignore it.
(frame--set-was-invisible
frame
(and visibility-spec
(memq (cdr visibility-spec) '(nil icon))
(or (assq 'width parameters)
(assq 'height parameters))))
(if (null visibility-spec)
(make-frame-visible frame)
(modify-frame-parameters frame (list visibility-spec)))
(setq success t))

View file

@ -391,6 +391,10 @@ constructed by taking the directory part of the replaced file-name,
concatenated with the buffer file name with all directory separators
changed to `!' to prevent clashes. This will not work
correctly if your filesystem truncates the resulting name.
If UNIQUIFY is one of the members of `secure-hash-algorithms',
Emacs constructs the nondirectory part of the auto-save file name
by applying that `secure-hash' to the buffer file name. This
avoids any risk of excessively long file names.
All the transforms in the list are tried, in the order they are listed.
When one transform applies, its result is final;
@ -577,7 +581,9 @@ a -*- line.
The command \\[normal-mode], when used interactively,
always obeys file local variable specifications and the -*- line,
and ignores this variable."
and ignores this variable.
Also see the `permanently-enabled-local-variables' variable."
:risky t
:type '(choice (const :tag "Query Unsafe" t)
(const :tag "Safe Only" :safe)
@ -3198,13 +3204,8 @@ we don't actually set it to the same mode the buffer already has."
(or (set-auto-mode-0 mode keep-mode-if-same)
;; continuing would call minor modes again, toggling them off
(throw 'nop nil))))))
;; hack-local-variables checks local-enable-local-variables etc, but
;; we might as well be explicit here for the sake of clarity.
(and (not done)
enable-local-variables
local-enable-local-variables
try-locals
(setq mode (hack-local-variables t))
(setq mode (hack-local-variables t (not try-locals)))
(not (memq mode modes)) ; already tried and failed
(if (not (functionp mode))
(message "Ignoring unknown mode `%s'" mode)
@ -3503,6 +3504,10 @@ function is allowed to change the contents of this alist.
This hook is called only if there is at least one file-local
variable to set.")
(defvar permanently-enabled-local-variables '(lexical-binding)
"A list of local variables that are always enabled.
This overrides any `enable-local-variables' setting.")
(defun hack-local-variables-confirm (all-vars unsafe-vars risky-vars dir-name)
"Get confirmation before setting up local variable values.
ALL-VARS is the list of all variables to be set up.
@ -3716,25 +3721,26 @@ DIR-NAME is the name of the associated directory. Otherwise it is nil."
;; TODO? Warn once per file rather than once per session?
(defvar hack-local-variables--warned-lexical nil)
(defun hack-local-variables (&optional handle-mode)
(defun hack-local-variables (&optional handle-mode inhibit-locals)
"Parse and put into effect this buffer's local variables spec.
For buffers visiting files, also puts into effect directory-local
variables.
Uses `hack-local-variables-apply' to apply the variables.
If HANDLE-MODE is nil, we apply all the specified local
variables. If HANDLE-MODE is neither nil nor t, we do the same,
except that any settings of `mode' are ignored.
See `hack-local-variables--find-variables' for the meaning of
HANDLE-MODE.
If HANDLE-MODE is t, all we do is check whether a \"mode:\"
is specified, and return the corresponding mode symbol, or nil.
In this case, we try to ignore minor-modes, and return only a
major-mode.
If `enable-local-variables' or `local-enable-local-variables' is nil,
this function does nothing. If `inhibit-local-variables-regexps'
If `enable-local-variables' or `local-enable-local-variables' is
nil, or INHIBIT-LOCALS is non-nil, this function disregards all
normal local variables. If `inhibit-local-variables-regexps'
applies to the file in question, the file is not scanned for
local variables, but directory-local variables may still be applied."
local variables, but directory-local variables may still be
applied.
Variables present in `permanently-enabled-local-variables' will
still be evaluated, even if local variables are otherwise
inhibited."
;; We don't let inhibit-local-variables-p influence the value of
;; enable-local-variables, because then it would affect dir-local
;; variables. We don't want to search eg tar files for file local
@ -3742,9 +3748,18 @@ local variables, but directory-local variables may still be applied."
;; to them. The real meaning of inhibit-local-variables-p is "do
;; not scan this file for local variables".
(let ((enable-local-variables
(and local-enable-local-variables enable-local-variables))
result)
(unless (eq handle-mode t)
(and (not inhibit-locals)
local-enable-local-variables enable-local-variables)))
(if (eq handle-mode t)
;; We're looking just for the major mode setting.
(and enable-local-variables
(not (inhibit-local-variables-p))
;; If HANDLE-MODE is t, and the prop line specifies a
;; mode, then we're done, and have no need to scan further.
(or (hack-local-variables-prop-line t)
;; Look for the mode elsewhere in the buffer.
(hack-local-variables--find-variables t)))
;; Normal handling of local variables.
(setq file-local-variables-alist nil)
(when (and (file-remote-p default-directory)
(fboundp 'hack-connection-local-variables)
@ -3755,133 +3770,138 @@ local variables, but directory-local variables may still be applied."
(connection-local-criteria-for-default-directory))))
(with-demoted-errors "Directory-local variables error: %s"
;; Note this is a no-op if enable-local-variables is nil.
(hack-dir-local-variables)))
;; This entire function is basically a no-op if enable-local-variables
;; is nil. All it does is set file-local-variables-alist to nil.
(when enable-local-variables
;; This part used to ignore enable-local-variables when handle-mode
;; was t. That was inappropriate, eg consider the
;; (artificial) example of:
;; (setq local-enable-local-variables nil)
;; Open a file foo.txt that contains "mode: sh".
;; It correctly opens in text-mode.
;; M-x set-visited-file name foo.c, and it incorrectly stays in text-mode.
(unless (or (inhibit-local-variables-p)
;; If HANDLE-MODE is t, and the prop line specifies a
;; mode, then we're done, and have no need to scan further.
(and (setq result (hack-local-variables-prop-line
handle-mode))
(eq handle-mode t)))
;; Look for "Local variables:" line in last page.
(save-excursion
(goto-char (point-max))
(search-backward "\n\^L" (max (- (point-max) 3000) (point-min))
'move)
(when (let ((case-fold-search t))
(search-forward "Local Variables:" nil t))
(skip-chars-forward " \t")
;; suffix is what comes after "local variables:" in its line.
;; prefix is what comes before "local variables:" in its line.
(let ((suffix
(concat
(regexp-quote (buffer-substring (point)
(line-end-position)))
"$"))
(prefix
(concat "^" (regexp-quote
(buffer-substring (line-beginning-position)
(match-beginning 0))))))
(hack-dir-local-variables))
(let ((result (append (hack-local-variables--find-variables)
(hack-local-variables-prop-line))))
(if (and enable-local-variables
(not (inhibit-local-variables-p)))
(progn
;; Set the variables.
(hack-local-variables-filter result nil)
(hack-local-variables-apply))
;; Handle `lexical-binding' and other special local
;; variables.
(dolist (variable permanently-enabled-local-variables)
(when-let ((elem (assq variable result)))
(push elem file-local-variables-alist)))
(hack-local-variables-apply))))))
(forward-line 1)
(let ((startpos (point))
endpos
(thisbuf (current-buffer)))
(save-excursion
(unless (let ((case-fold-search t))
(re-search-forward
(concat prefix "[ \t]*End:[ \t]*" suffix)
nil t))
;; This used to be an error, but really all it means is
;; that this may simply not be a local-variables section,
;; so just ignore it.
(message "Local variables list is not properly terminated"))
(beginning-of-line)
(setq endpos (point)))
(defun hack-local-variables--find-variables (&optional handle-mode)
"Return all local variables in the ucrrent buffer.
If HANDLE-MODE is nil, we gather all the specified local
variables. If HANDLE-MODE is neither nil nor t, we do the same,
except that any settings of `mode' are ignored.
(with-temp-buffer
(insert-buffer-substring thisbuf startpos endpos)
(goto-char (point-min))
(subst-char-in-region (point) (point-max) ?\^m ?\n)
(while (not (eobp))
;; Discard the prefix.
(if (looking-at prefix)
(delete-region (point) (match-end 0))
(error "Local variables entry is missing the prefix"))
(end-of-line)
;; Discard the suffix.
(if (looking-back suffix (line-beginning-position))
(delete-region (match-beginning 0) (point))
(error "Local variables entry is missing the suffix"))
(forward-line 1))
(goto-char (point-min))
If HANDLE-MODE is t, all we do is check whether a \"mode:\"
is specified, and return the corresponding mode symbol, or nil.
In this case, we try to ignore minor-modes, and return only a
major-mode."
(let ((result nil))
;; Look for "Local variables:" line in last page.
(save-excursion
(goto-char (point-max))
(search-backward "\n\^L" (max (- (point-max) 3000) (point-min))
'move)
(when (let ((case-fold-search t))
(search-forward "Local Variables:" nil t))
(skip-chars-forward " \t")
;; suffix is what comes after "local variables:" in its line.
;; prefix is what comes before "local variables:" in its line.
(let ((suffix
(concat
(regexp-quote (buffer-substring (point)
(line-end-position)))
"$"))
(prefix
(concat "^" (regexp-quote
(buffer-substring (line-beginning-position)
(match-beginning 0))))))
(while (not (or (eobp)
(and (eq handle-mode t) result)))
;; Find the variable name;
(unless (looking-at hack-local-variable-regexp)
(error "Malformed local variable line: %S"
(buffer-substring-no-properties
(point) (line-end-position))))
(goto-char (match-end 1))
(let* ((str (match-string 1))
(var (intern str))
val val2)
(and (equal (downcase (symbol-name var)) "mode")
(setq var 'mode))
;; Read the variable value.
(skip-chars-forward "^:")
(forward-char 1)
;; As a defensive measure, we do not allow
;; circular data in the file-local data.
(let ((read-circle nil))
(setq val (read (current-buffer))))
(if (eq handle-mode t)
(and (eq var 'mode)
;; Specifying minor-modes via mode: is
;; deprecated, but try to reject them anyway.
(not (string-match
"-minor\\'"
(setq val2 (downcase (symbol-name val)))))
(setq result (intern (concat val2 "-mode"))))
(cond ((eq var 'coding))
((eq var 'lexical-binding)
(unless hack-local-variables--warned-lexical
(setq hack-local-variables--warned-lexical t)
(display-warning
'files
(format-message
"%s: `lexical-binding' at end of file unreliable"
(file-name-nondirectory
;; We are called from
;; 'with-temp-buffer', so we need
;; to use 'thisbuf's name in the
;; warning message.
(or (buffer-file-name thisbuf) ""))))))
((and (eq var 'mode) handle-mode))
(t
(ignore-errors
(push (cons (if (eq var 'eval)
'eval
(indirect-variable var))
val)
result))))))
(forward-line 1))))))))
;; Now we've read all the local variables.
;; If HANDLE-MODE is t, return whether the mode was specified.
(if (eq handle-mode t) result
;; Otherwise, set the variables.
(hack-local-variables-filter result nil)
(hack-local-variables-apply)))))
(forward-line 1)
(let ((startpos (point))
endpos
(thisbuf (current-buffer)))
(save-excursion
(unless (let ((case-fold-search t))
(re-search-forward
(concat prefix "[ \t]*End:[ \t]*" suffix)
nil t))
;; This used to be an error, but really all it means is
;; that this may simply not be a local-variables section,
;; so just ignore it.
(message "Local variables list is not properly terminated"))
(beginning-of-line)
(setq endpos (point)))
(with-temp-buffer
(insert-buffer-substring thisbuf startpos endpos)
(goto-char (point-min))
(subst-char-in-region (point) (point-max) ?\^m ?\n)
(while (not (eobp))
;; Discard the prefix.
(if (looking-at prefix)
(delete-region (point) (match-end 0))
(error "Local variables entry is missing the prefix"))
(end-of-line)
;; Discard the suffix.
(if (looking-back suffix (line-beginning-position))
(delete-region (match-beginning 0) (point))
(error "Local variables entry is missing the suffix"))
(forward-line 1))
(goto-char (point-min))
(while (not (or (eobp)
(and (eq handle-mode t) result)))
;; Find the variable name;
(unless (looking-at hack-local-variable-regexp)
(error "Malformed local variable line: %S"
(buffer-substring-no-properties
(point) (line-end-position))))
(goto-char (match-end 1))
(let* ((str (match-string 1))
(var (intern str))
val val2)
(and (equal (downcase (symbol-name var)) "mode")
(setq var 'mode))
;; Read the variable value.
(skip-chars-forward "^:")
(forward-char 1)
;; As a defensive measure, we do not allow
;; circular data in the file-local data.
(let ((read-circle nil))
(setq val (read (current-buffer))))
(if (eq handle-mode t)
(and (eq var 'mode)
;; Specifying minor-modes via mode: is
;; deprecated, but try to reject them anyway.
(not (string-match
"-minor\\'"
(setq val2 (downcase (symbol-name val)))))
(setq result (intern (concat val2 "-mode"))))
(cond ((eq var 'coding))
((eq var 'lexical-binding)
(unless hack-local-variables--warned-lexical
(setq hack-local-variables--warned-lexical t)
(display-warning
'files
(format-message
"%s: `lexical-binding' at end of file unreliable"
(file-name-nondirectory
;; We are called from
;; 'with-temp-buffer', so we need
;; to use 'thisbuf's name in the
;; warning message.
(or (buffer-file-name thisbuf) ""))))))
((and (eq var 'mode) handle-mode))
(t
(ignore-errors
(push (cons (if (eq var 'eval)
'eval
(indirect-variable var))
val)
result))))))
(forward-line 1)))))))
result))
(defun hack-local-variables-apply ()
"Apply the elements of `file-local-variables-alist'.
@ -6631,14 +6651,20 @@ See also `auto-save-file-name-p'."
uniq (car (cddr (car list)))))
(setq list (cdr list)))
(if result
(if uniq
(setq filename (concat
(file-name-directory result)
(subst-char-in-string
?/ ?!
(replace-regexp-in-string "!" "!!"
filename))))
(setq filename result)))
(setq filename
(cond
((memq uniq (secure-hash-algorithms))
(concat
(file-name-directory result)
(secure-hash uniq filename)))
(uniq
(concat
(file-name-directory result)
(subst-char-in-string
?/ ?!
(replace-regexp-in-string
"!" "!!" filename))))
(t result))))
(setq result
(if (and (eq system-type 'ms-dos)
(not (msdos-long-file-names)))
@ -7466,12 +7492,7 @@ only these files will be asked to be saved."
;; operations, which return a file name. See Bug#29579.
(defun file-name-non-special (operation &rest arguments)
(let (;; In general, we don't want any file name handler. For some
;; few cases, operations with two file name arguments which
;; might be bound to different file name handlers, we still
;; need this.
(saved-file-name-handler-alist file-name-handler-alist)
(inhibit-file-name-handlers
(let ((inhibit-file-name-handlers
(cons 'file-name-non-special
(and (eq inhibit-file-name-operation operation)
inhibit-file-name-handlers)))
@ -7557,69 +7578,73 @@ only these files will be asked to be saved."
(when (car pair)
(setcar pair (file-name-unquote (car pair) t))))
(setq file-arg-indices (cdr file-arg-indices))))
(pcase method
('identity (car arguments))
('add (file-name-quote (apply operation arguments) t))
('buffer-file-name
(let ((buffer-file-name (file-name-unquote buffer-file-name t)))
(apply operation arguments)))
('insert-file-contents
(let ((visit (nth 1 arguments)))
(unwind-protect
(apply operation arguments)
(when (and visit buffer-file-name)
(setq buffer-file-name (file-name-quote buffer-file-name t))))))
('unquote-then-quote
;; We can't use `cl-letf' with `(buffer-local-value)' here
;; because it wouldn't work during bootstrapping.
(let ((buffer (current-buffer)))
;; `unquote-then-quote' is used only for the
;; `verify-visited-file-modtime' action, which takes a buffer
;; as only optional argument.
(with-current-buffer (or (car arguments) buffer)
(let ((buffer-file-name (file-name-unquote buffer-file-name t)))
;; Make sure to hide the temporary buffer change from the
;; underlying operation.
(with-current-buffer buffer
(apply operation arguments))))))
('local-copy
(let* ((file-name-handler-alist saved-file-name-handler-alist)
(source (car arguments))
(target (car (cdr arguments)))
(prefix (expand-file-name
"file-name-non-special" temporary-file-directory))
tmpfile)
(cond
;; If source is remote, we must create a local copy.
((file-remote-p source)
(setq tmpfile (make-temp-name prefix))
(apply operation source tmpfile (cddr arguments))
(setq source tmpfile))
;; If source is quoted, and the unquoted source looks
;; remote, we must create a local copy.
((file-name-quoted-p source t)
(setq source (file-name-unquote source t))
(when (file-remote-p source)
;; In general, we don't want any file name handler, see Bug#47625,
;; Bug#48349. For some few cases, operations with two file name
;; arguments which might be bound to different file name handlers,
;; we still need this.
(let ((tramp-mode (and tramp-mode (eq method 'local-copy))))
(pcase method
('identity (car arguments))
('add (file-name-quote (apply operation arguments) t))
('buffer-file-name
(let ((buffer-file-name (file-name-unquote buffer-file-name t)))
(apply operation arguments)))
('insert-file-contents
(let ((visit (nth 1 arguments)))
(unwind-protect
(apply operation arguments)
(when (and visit buffer-file-name)
(setq buffer-file-name (file-name-quote buffer-file-name t))))))
('unquote-then-quote
;; We can't use `cl-letf' with `(buffer-local-value)' here
;; because it wouldn't work during bootstrapping.
(let ((buffer (current-buffer)))
;; `unquote-then-quote' is used only for the
;; `verify-visited-file-modtime' action, which takes a
;; buffer as only optional argument.
(with-current-buffer (or (car arguments) buffer)
(let ((buffer-file-name (file-name-unquote buffer-file-name t)))
;; Make sure to hide the temporary buffer change from
;; the underlying operation.
(with-current-buffer buffer
(apply operation arguments))))))
('local-copy
(let ((source (car arguments))
(target (car (cdr arguments)))
(prefix (expand-file-name
"file-name-non-special" temporary-file-directory))
tmpfile)
(cond
;; If source is remote, we must create a local copy.
((file-remote-p source)
(setq tmpfile (make-temp-name prefix))
(let (file-name-handler-alist)
(apply operation source tmpfile (cddr arguments)))
(setq source tmpfile))))
;; If target is quoted, and the unquoted target looks remote,
;; we must disable the file name handler.
(when (file-name-quoted-p target t)
(setq target (file-name-unquote target t))
(when (file-remote-p target)
(setq file-name-handler-alist nil)))
;; Do it.
(setcar arguments source)
(setcar (cdr arguments) target)
(apply operation arguments)
;; Cleanup.
(when (and tmpfile (file-exists-p tmpfile))
(if (file-directory-p tmpfile)
(delete-directory tmpfile 'recursive) (delete-file tmpfile)))))
(_
(apply operation arguments)))))
(apply operation source tmpfile (cddr arguments))
(setq source tmpfile))
;; If source is quoted, and the unquoted source looks
;; remote, we must create a local copy.
((file-name-quoted-p source t)
(setq source (file-name-unquote source t))
(when (file-remote-p source)
(setq tmpfile (make-temp-name prefix))
(let (file-name-handler-alist)
(apply operation source tmpfile (cddr arguments)))
(setq source tmpfile))))
;; If target is quoted, and the unquoted target looks
;; remote, we must disable the file name handler.
(when (file-name-quoted-p target t)
(setq target (file-name-unquote target t))
(when (file-remote-p target)
(setq file-name-handler-alist nil)))
;; Do it.
(setcar arguments source)
(setcar (cdr arguments) target)
(apply operation arguments)
;; Cleanup.
(when (and tmpfile (file-exists-p tmpfile))
(if (file-directory-p tmpfile)
(delete-directory tmpfile 'recursive) (delete-file tmpfile)))))
(_
(apply operation arguments))))))
(defsubst file-name-quoted-p (name &optional top)
"Whether NAME is quoted with prefix \"/:\".

View file

@ -225,8 +225,8 @@ it finishes, type \\[kill-find]."
(use-local-map map))
(setq-local dired-sort-inhibit t)
(setq-local revert-buffer-function
`(lambda (ignore-auto noconfirm)
(find-dired ,dir ,find-args)))
(lambda (_ignore-auto _noconfirm)
(find-dired dir find-args)))
;; Set subdir-alist so that Tree Dired will work:
(if (fboundp 'dired-simple-subdir-alist)
;; will work even with nested dired format (dired-nstd.el,v 1.15

View file

@ -1604,18 +1604,15 @@ START should be at the beginning of a line."
"If non-nil, Font Lock mode uses this instead of `comment-start-skip'.")
(defvar font-lock-comment-end-skip nil
"If non-nil, Font Lock mode uses this instead of `comment-end'.")
"If non-nil, Font Lock mode uses this instead of `comment-end-skip'.")
(defun font-lock-fontify-syntactically-region (start end &optional loudly)
"Put proper face on each string and comment between START and END.
START should be at the beginning of a line."
(syntax-propertize end) ; Apply any needed syntax-table properties.
(with-syntax-table (or syntax-ppss-table (syntax-table))
(let ((comment-end-regexp
(or font-lock-comment-end-skip
(regexp-quote
(replace-regexp-in-string "^ *" "" comment-end))))
;; Find the `start' state.
(when (and comment-start (not comment-end-skip)) (comment-normalize-vars))
(let (;; Find the `start' state.
(state (if (or syntax-ppss-table
(not font-lock--syntax-table-affects-ppss))
(syntax-ppss start)
@ -1648,7 +1645,9 @@ START should be at the beginning of a line."
comment-start-skip))
(put-text-property beg (match-end 0) 'face
font-lock-comment-delimiter-face)))
(if (looking-back comment-end-regexp (point-at-bol) t)
(if (looking-back (or font-lock-comment-end-skip
comment-end-skip)
(point-at-bol) t)
(put-text-property (match-beginning 0) (point) 'face
font-lock-comment-delimiter-face))))
(< (point) end))

View file

@ -1294,8 +1294,8 @@ elements are present."
;; First, some common methods.
(cl-defgeneric gnus-search-indexed-parse-output (engine server &optional groups)
"Parse the results of ENGINE's query against SERVER in GROUPS.
(cl-defgeneric gnus-search-indexed-parse-output (engine server query &optional groups)
"Parse the results of ENGINE's QUERY against SERVER in GROUPS.
Locally-indexed search engines return results as a list of
filenames, sometimes with additional information. Returns a list
of viable results, in the form of a list of [group article score]

View file

@ -34,6 +34,7 @@
(defmacro defvoo (var init &optional doc &rest map)
"The same as `defvar', only takes list of variables to MAP to."
(declare (indent 2)
(doc-string 3)
(debug (var init &optional doc &rest map)))
`(prog1
,(if doc
@ -44,6 +45,7 @@
(defmacro deffoo (func args &rest forms)
"The same as `defun', only register FUNC."
(declare (indent 2)
(doc-string 3)
(debug (&define name lambda-list def-body)))
`(prog1
(defun ,func ,args ,@forms)

View file

@ -777,7 +777,7 @@ If this variable is nil, or if the provided function returns nil,
Return an article list."
(let ((func (alist-get 'nnselect-function specs))
(args (alist-get 'nnselect-args specs)))
(condition-case err
(condition-case-unless-debug err
(funcall func args)
(error (gnus-error 3 "nnselect-run: %s on %s gave error %s" func args err)
[]))))

View file

@ -233,7 +233,7 @@ Do not call this in the scope of `with-help-window'."
(make-help-screen help-for-help
(purecopy "Type a help option: [abcCdefFgiIkKlLmnprstvw.] C-[cdefmnoptw] or ?")
(concat
"\(Type "
"(Type "
(help--key-description-fontified (kbd "<PageDown>"))
" or "
(help--key-description-fontified (kbd "<PageUp>"))

View file

@ -303,22 +303,30 @@ also supported.
There are several ways to change text in hexl mode:
ASCII characters (character between space (0x20) and tilde (0x7E)) are
bound to self-insert so you can simply type the character and it will
insert itself (actually overstrike) into the buffer.
Self-inserting characters are bound to `hexl-self-insert' so you
can simply type the character and it will insert itself (actually
overstrike) into the buffer. However, inserting non-ASCII characters
requires caution: the buffer's coding-system should correspond to
the encoding on disk, and multibyte characters should be inserted
with cursor on the first byte of a multibyte sequence whose length
is identical to the length of the multibyte sequence to be inserted,
otherwise this could produce invalid multibyte sequences. Non-ASCII
characters in ISO-2022 encodings should preferably inserted byte by
byte, to avoid problems caused by the designation sequences before
the actual characters.
\\[hexl-quoted-insert] followed by another keystroke allows you to insert the key even if
it isn't bound to self-insert. An octal number can be supplied in place
of another key to insert the octal number's ASCII representation.
\\[hexl-insert-hex-char] will insert a given hexadecimal value (if it is between 0 and 0xFF)
into the buffer at the current point.
\\[hexl-insert-hex-char] will insert a given hexadecimal value
into the buffer at the current address.
\\[hexl-insert-octal-char] will insert a given octal value (if it is between 0 and 0377)
into the buffer at the current point.
\\[hexl-insert-octal-char] will insert a given octal value
into the buffer at the current address.
\\[hexl-insert-decimal-char] will insert a given decimal value (if it is between 0 and 255)
into the buffer at the current point.
\\[hexl-insert-decimal-char] will insert a given decimal value
into the buffer at the current address..
\\[hexl-mode-exit] will exit `hexl-mode'.
@ -332,26 +340,16 @@ You can use \\[hexl-find-file] to visit a file in Hexl mode.
(unless (eq major-mode 'hexl-mode)
(let ((modified (buffer-modified-p))
(inhibit-read-only t)
(original-point (- (point) (point-min))))
(and (eobp) (not (bobp))
(setq original-point (1- original-point)))
(point-offset (bufferpos-to-filepos (point) 'exact)))
;; If `hexl-mode' is invoked with an argument the buffer is assumed to
;; be in hexl format.
(when (memq arg '(1 nil))
;; If the buffer's EOL type is -dos, we need to account for
;; extra CR characters added when hexlify-buffer writes the
;; buffer to a file.
;; FIXME: This doesn't take into account multibyte coding systems.
(when (eq (coding-system-eol-type buffer-file-coding-system) 1)
(setq original-point (+ (count-lines (point-min) (point))
original-point))
(or (bolp) (setq original-point (1- original-point))))
(hexlify-buffer)
(restore-buffer-modified-p modified))
(setq hexl-max-address
(+ (* (/ (1- (buffer-size)) (hexl-line-displen)) 16) 15))
(condition-case nil
(hexl-goto-address original-point)
(hexl-goto-address point-offset)
(error nil)))
(let ((max-address hexl-max-address))
@ -440,7 +438,8 @@ You can use \\[hexl-find-file] to visit a file in Hexl mode.
(defun hexl-find-file (filename)
"Edit file FILENAME as a binary file in hex dump format.
Switch to a buffer visiting file FILENAME, creating one if none exists,
and edit the file in `hexl-mode'."
and edit the file in `hexl-mode'. The buffer's coding-system will be
no-conversion, unlike if you visit it normally and then invoke `hexl-mode'."
(interactive
(list
(let ((completion-ignored-extensions nil))
@ -478,17 +477,11 @@ With arg, don't unhexlify buffer."
(if (or (eq arg 1) (not arg))
(let ((modified (buffer-modified-p))
(inhibit-read-only t)
(original-point (1+ (hexl-current-address))))
(point-offset (hexl-current-address)))
(dehexlify-buffer)
(remove-hook 'write-contents-functions #'hexl-save-buffer t)
(restore-buffer-modified-p modified)
(goto-char original-point)
;; Maybe adjust point for the removed CR characters.
(when (eq (coding-system-eol-type buffer-file-coding-system) 1)
(setq original-point (- original-point
(count-lines (point-min) (point))))
(or (bobp) (setq original-point (1+ original-point))))
(goto-char original-point)))
(goto-char (filepos-to-bufferpos point-offset 'exact))))
(remove-hook 'change-major-mode-hook #'hexl-maybe-dehexlify-buffer t)
(major-mode-restore))
@ -499,11 +492,11 @@ Ask the user for confirmation."
(if (y-or-n-p "Convert contents back to binary format? ")
(let ((modified (buffer-modified-p))
(inhibit-read-only t)
(original-point (1+ (hexl-current-address))))
(point-offset (hexl-current-address)))
(dehexlify-buffer)
(remove-hook 'write-contents-functions #'hexl-save-buffer t)
(restore-buffer-modified-p modified)
(goto-char original-point))))
(goto-char (filepos-to-bufferpos point-offset 'exact)))))
(defun hexl-current-address (&optional validate)
"Return current hexl-address."
@ -879,14 +872,27 @@ This discards the buffer's undo information."
"Insert a possibly multibyte character CH NUM times.
Non-ASCII characters are first encoded with `buffer-file-coding-system',
and their encoded form is inserted byte by byte."
and their encoded form is inserted byte by byte. Note that if the
hexl buffer was produced by `hexl-find-file', its coding-system
is no-conversion.
Inserting non-ASCII characters requires caution: the buffer's
coding-system should correspond to the encoding on disk, and
multibyte characters should be inserted with cursor on the first
byte of a multibyte sequence whose length is identical to the
length of the multibyte sequence to be inserted, otherwise this
could produce invalid multibyte sequences. Non-ASCII characters
in ISO-2022 encodings should preferably inserted byte by byte, to
avoid problems caused by the designation sequences before the
actual characters."
(let ((charset (char-charset ch))
(coding (if (or (null buffer-file-coding-system)
;; coding-system-type equals t means undecided.
(eq (coding-system-type buffer-file-coding-system) t))
(default-value 'buffer-file-coding-system)
buffer-file-coding-system)))
(cond ((and (> ch 0) (< ch 256))
(cond ((and (>= ch 0) (< ch 256)
(coding-system-get coding :ascii-compatible-p))
(hexl-insert-char ch num))
((eq charset 'unknown)
(error
@ -924,7 +930,19 @@ and their encoded form is inserted byte by byte."
Interactively, with a numeric argument, insert this character that many times.
Non-ASCII characters are first encoded with `buffer-file-coding-system',
and their encoded form is inserted byte by byte."
and their encoded form is inserted byte by byte. Note that if the
hexl buffer was produced by `hexl-find-file', its coding-system
is no-conversion.
Inserting non-ASCII characters requires caution: the buffer's
coding-system should correspond to the encoding on disk, and
multibyte characters should be inserted with cursor on the first
byte of a multibyte sequence whose length is identical to the
length of the multibyte sequence to be inserted, otherwise this
could produce invalid multibyte sequences. Non-ASCII characters
in ISO-2022 encodings should preferably inserted byte by byte, to
avoid problems caused by the designation sequences before the
actual characters."
(interactive "p")
(hexl-insert-multibyte-char last-command-event arg))
@ -964,7 +982,21 @@ CH must be a unibyte character whose value is between 0 and 255."
;; hex conversion
(defun hexl-insert-hex-char (arg)
"Insert a character given by its hexadecimal code ARG times at point."
"Insert a character given by its hexadecimal code ARG times at point.
Values above 0xFF are treated as multibyte characters, and first encoded
using `buffer-file-coding-system'. Note that if the hexl buffer was
produced by `hexl-find-file', its coding-system is no-conversion.
Inserting non-ASCII characters requires caution: the buffer's
coding-system should correspond to the encoding on disk, and
multibyte characters should be inserted with cursor on the first
byte of a multibyte sequence whose length is identical to the
length of the multibyte sequence to be inserted, otherwise this
could produce invalid multibyte sequences. Non-ASCII characters
in ISO-2022 encodings should preferably inserted byte by byte, to
avoid problems caused by the designation sequences before the
actual characters."
(interactive "p")
(let ((num (hexl-hex-string-to-integer (read-string "Hex number: "))))
(if (< num 0)
@ -997,7 +1029,21 @@ Embedded whitespace, dashes, and periods in the string are ignored."
(setq arg (- arg 1)))))
(defun hexl-insert-decimal-char (arg)
"Insert a character given by its decimal code ARG times at point."
"Insert a character given by its decimal code ARG times at point.
Values above 256 are treated as multibyte characters, and first encoded
using `buffer-file-coding-system'. Note that if the hexl buffer was
produced by `hexl-find-file', its coding-system is no-conversion.
Inserting non-ASCII characters requires caution: the buffer's
coding-system should correspond to the encoding on disk, and
multibyte characters should be inserted with cursor on the first
byte of a multibyte sequence whose length is identical to the
length of the multibyte sequence to be inserted, otherwise this
could produce invalid multibyte sequences. Non-ASCII characters
in ISO-2022 encodings should preferably inserted byte by byte, to
avoid problems caused by the designation sequences before the
actual characters."
(interactive "p")
(let ((num (string-to-number (read-string "Decimal Number: "))))
(if (< num 0)
@ -1005,7 +1051,21 @@ Embedded whitespace, dashes, and periods in the string are ignored."
(hexl-insert-multibyte-char num arg))))
(defun hexl-insert-octal-char (arg)
"Insert a character given by its octal code ARG times at point."
"Insert a character given by its octal code ARG times at point.
Values above \377 are treated as multibyte characters, and first encoded
using `buffer-file-coding-system'. Note that if the hexl buffer was
produced by `hexl-find-file', its coding-system is no-conversion.
Inserting non-ASCII characters requires caution: the buffer's
coding-system should correspond to the encoding on disk, and
multibyte characters should be inserted with cursor on the first
byte of a multibyte sequence whose length is identical to the
length of the multibyte sequence to be inserted, otherwise this
could produce invalid multibyte sequences. Non-ASCII characters
in ISO-2022 encodings should preferably inserted byte by byte, to
avoid problems caused by the designation sequences before the
actual characters."
(interactive "p")
(let ((num (hexl-octal-string-to-integer (read-string "Octal Number: "))))
(if (< num 0)

View file

@ -988,9 +988,7 @@ one window."
(let ((buf (ibuffer-current-buffer t)))
(bury-buffer (current-buffer))
(if noselect
(let ((curwin (selected-window)))
(pop-to-buffer buf)
(select-window curwin))
(display-buffer buf)
(switch-to-buffer-other-window buf))))
(defun ibuffer-visit-buffer-other-window-noselect ()

View file

@ -463,8 +463,8 @@ Non-nil arguments are in recursive calls."
((imenu--subalist-p item)
(imenu--create-keymap (car item) (cdr item) cmd))
(t
`(lambda () (interactive)
,(if cmd `(,cmd ',item) (list 'quote item)))))))
(lambda () (interactive)
(if cmd (funcall cmd item) item))))))
alist)))
(defun imenu--in-alist (str alist)

View file

@ -95,7 +95,7 @@ about local variables or possible weirdness in a major mode.
`lm-with-file' does a similar thing, but it sets
`emacs-lisp-mode' which is not wanted here."
(declare (debug t) (indent 1))
(declare (debug (form def-body)) (indent 1))
`(let* ((info-xref-with-file--filename ,filename)
(info-xref-with-file--body (lambda () ,@body))
(info-xref-with-file--existing

View file

@ -2148,8 +2148,10 @@ If DIRECTION is `backward', search in the reverse direction."
(goto-char (if isearch-forward (point-min) (point-max)))))
(defun Info-isearch-push-state ()
`(lambda (cmd)
(Info-isearch-pop-state cmd ',Info-current-file ',Info-current-node)))
(let ((file Info-current-file)
(node Info-current-node))
(lambda (cmd)
(Info-isearch-pop-state cmd file node))))
(defun Info-isearch-pop-state (_cmd file node)
(or (and (equal Info-current-file file)

View file

@ -2963,18 +2963,22 @@ STR should be a unibyte string."
str " "))
(defun encode-coding-char (char coding-system &optional charset)
"Encode CHAR by CODING-SYSTEM and return the resulting string.
"Encode CHAR by CODING-SYSTEM and return the resulting string of bytes.
If CODING-SYSTEM can't safely encode CHAR, return nil.
The 3rd optional argument CHARSET, if non-nil, is a charset preferred
on encoding."
(let* ((str1 (string char))
(str2 (string char char))
(found (find-coding-systems-string str1))
enc1 enc2 i1 i2)
(if (eq (car-safe found) 'undecided) ;Aka (not (multibyte-string-p str1))
;; `char' is ASCII.
(bom-p (coding-system-get coding-system :bom))
enc1 enc2 i0 i1 i2)
;; If CHAR is ASCII and CODING-SYSTEM doesn't prepend a BOM, just
;; encode CHAR.
(if (and (eq (car-safe found) 'undecided)
(null bom-p))
(encode-coding-string str1 coding-system)
(when (memq (coding-system-base coding-system) found)
(when (or (eq (car-safe found) 'undecided)
(memq (coding-system-base coding-system) found))
;; We must find the encoded string of CHAR. But, just encoding
;; CHAR will put extra control sequences (usually to designate
;; ASCII charset) at the tail if type of CODING is ISO 2022.
@ -2995,7 +2999,19 @@ on encoding."
;; Now (substring enc1 i1) and (substring enc2 i2) are the same,
;; and they are the extra control sequences at the tail to
;; exclude.
(substring enc2 0 i2)))))
;; We also need to exclude the leading 2 or 3 bytes if they
;; come from a BOM.
(setq i0
(if bom-p
(cond
((eq (coding-system-type coding-system) 'utf-8)
3)
((eq (coding-system-type coding-system) 'utf-16)
2)
(t 0))
0))
(substring enc2 i0 i2)))))
;; Backwards compatibility. These might be better with :init-value t,
;; but that breaks loadup.

View file

@ -2538,7 +2538,7 @@ If search string is empty, just beep."
"Read a string from the `kill-ring' and append it to the search string."
(interactive)
(with-isearch-suspended
(let ((string (read-from-kill-ring)))
(let ((string (read-from-kill-ring "Yank from kill-ring: ")))
(if (and isearch-case-fold-search
(eq 'not-yanks search-upper-case))
(setq string (downcase string)))
@ -3506,9 +3506,8 @@ Optional third argument, if t, means if fail just return nil (no error).
(when pos1
;; When using multiple buffers isearch, switch to the new buffer here,
;; because `save-excursion' above doesn't allow doing it inside funcall.
(if (and multi-isearch-next-buffer-current-function
(buffer-live-p multi-isearch-current-buffer))
(switch-to-buffer multi-isearch-current-buffer))
(when multi-isearch-next-buffer-current-function
(multi-isearch-switch-buffer))
(goto-char pos1)
pos1)))

View file

@ -7,7 +7,6 @@
;; Created: 16 Apr 2004
;; Version: 1.5
;; Keywords: lisp
;; X-URL: http://www.newartisans.com/johnw/emacs.html
;; This file is part of GNU Emacs.

View file

@ -167,53 +167,53 @@ macro to be executed before appending to it."
(defvar kmacro-keymap
(let ((map (make-sparse-keymap)))
;; Start, end, execute macros
(define-key map "s" 'kmacro-start-macro)
(define-key map "\C-s" 'kmacro-start-macro)
(define-key map "\C-k" 'kmacro-end-or-call-macro-repeat)
(define-key map "r" 'apply-macro-to-region-lines)
(define-key map "q" 'kbd-macro-query) ;; Like C-x q
(define-key map "Q" 'kdb-macro-redisplay)
(define-key map "s" #'kmacro-start-macro)
(define-key map "\C-s" #'kmacro-start-macro)
(define-key map "\C-k" #'kmacro-end-or-call-macro-repeat)
(define-key map "r" #'apply-macro-to-region-lines)
(define-key map "q" #'kbd-macro-query) ;; Like C-x q
(define-key map "Q" #'kdb-macro-redisplay)
;; macro ring
(define-key map "\C-n" 'kmacro-cycle-ring-next)
(define-key map "\C-p" 'kmacro-cycle-ring-previous)
(define-key map "\C-v" 'kmacro-view-macro-repeat)
(define-key map "\C-d" 'kmacro-delete-ring-head)
(define-key map "\C-t" 'kmacro-swap-ring)
(define-key map "\C-l" 'kmacro-call-ring-2nd-repeat)
(define-key map "\C-n" #'kmacro-cycle-ring-next)
(define-key map "\C-p" #'kmacro-cycle-ring-previous)
(define-key map "\C-v" #'kmacro-view-macro-repeat)
(define-key map "\C-d" #'kmacro-delete-ring-head)
(define-key map "\C-t" #'kmacro-swap-ring)
(define-key map "\C-l" #'kmacro-call-ring-2nd-repeat)
;; macro counter
(define-key map "\C-f" 'kmacro-set-format)
(define-key map "\C-c" 'kmacro-set-counter)
(define-key map "\C-i" 'kmacro-insert-counter)
(define-key map "\C-a" 'kmacro-add-counter)
(define-key map "\C-f" #'kmacro-set-format)
(define-key map "\C-c" #'kmacro-set-counter)
(define-key map "\C-i" #'kmacro-insert-counter)
(define-key map "\C-a" #'kmacro-add-counter)
;; macro editing
(define-key map "\C-e" 'kmacro-edit-macro-repeat)
(define-key map "\r" 'kmacro-edit-macro)
(define-key map "e" 'edit-kbd-macro)
(define-key map "l" 'kmacro-edit-lossage)
(define-key map " " 'kmacro-step-edit-macro)
(define-key map "\C-e" #'kmacro-edit-macro-repeat)
(define-key map "\r" #'kmacro-edit-macro)
(define-key map "e" #'edit-kbd-macro)
(define-key map "l" #'kmacro-edit-lossage)
(define-key map " " #'kmacro-step-edit-macro)
;; naming and binding
(define-key map "b" 'kmacro-bind-to-key)
(define-key map "n" 'kmacro-name-last-macro)
(define-key map "x" 'kmacro-to-register)
(define-key map "b" #'kmacro-bind-to-key)
(define-key map "n" #'kmacro-name-last-macro)
(define-key map "x" #'kmacro-to-register)
map)
"Keymap for keyboard macro commands.")
(defalias 'kmacro-keymap kmacro-keymap)
;;; Provide some binding for startup:
;;;###autoload (global-set-key "\C-x(" 'kmacro-start-macro)
;;;###autoload (global-set-key "\C-x)" 'kmacro-end-macro)
;;;###autoload (global-set-key "\C-xe" 'kmacro-end-and-call-macro)
;;;###autoload (global-set-key [f3] 'kmacro-start-macro-or-insert-counter)
;;;###autoload (global-set-key [f4] 'kmacro-end-or-call-macro)
;;;###autoload (global-set-key "\C-x\C-k" 'kmacro-keymap)
;;;###autoload (global-set-key "\C-x(" #'kmacro-start-macro)
;;;###autoload (global-set-key "\C-x)" #'kmacro-end-macro)
;;;###autoload (global-set-key "\C-xe" #'kmacro-end-and-call-macro)
;;;###autoload (global-set-key [f3] #'kmacro-start-macro-or-insert-counter)
;;;###autoload (global-set-key [f4] #'kmacro-end-or-call-macro)
;;;###autoload (global-set-key "\C-x\C-k" #'kmacro-keymap)
;;;###autoload (autoload 'kmacro-keymap "kmacro" "Keymap for keyboard macro commands." t 'keymap)
(if kmacro-call-mouse-event
(global-set-key (vector kmacro-call-mouse-event) 'kmacro-end-call-mouse))
(global-set-key (vector kmacro-call-mouse-event) #'kmacro-end-call-mouse))
;;; Called from keyboard-quit
@ -668,11 +668,13 @@ use \\[kmacro-name-last-macro]."
(set-transient-map
(let ((map (make-sparse-keymap)))
(define-key map (vector repeat-key)
`(lambda () (interactive)
(kmacro-call-macro ,(and kmacro-call-repeat-with-arg arg)
'repeating nil ,(if end-macro
last-kbd-macro
(or macro last-kbd-macro)))))
(let ((ra (and kmacro-call-repeat-with-arg arg))
(m (if end-macro
last-kbd-macro
(or macro last-kbd-macro))))
(lambda ()
(interactive)
(kmacro-call-macro ra 'repeating nil m))))
map)))))
@ -780,25 +782,32 @@ If kbd macro currently being defined end it before activating it."
;; executing the macro later on (but that's controversial...)
;;;###autoload
(defun kmacro-lambda-form (mac &optional counter format)
(defun kmacro-lambda-form (mac)
"Create lambda form for macro bound to symbol or key."
(if counter
(setq mac (list mac counter format)))
`(lambda (&optional arg)
"Keyboard macro."
(interactive "p")
(kmacro-exec-ring-item ',mac arg)))
;; FIXME: This should be a "funcallable struct"!
(lambda (&optional arg)
"Keyboard macro."
;; We put an "unused prompt" as a special marker so
;; `kmacro-extract-lambda' can see it's "one of us".
(interactive "pkmacro")
(if (eq arg 'kmacro--extract-lambda)
(cons 'kmacro--extract-lambda mac)
(kmacro-exec-ring-item mac arg))))
(defun kmacro-extract-lambda (mac)
"Extract kmacro from a kmacro lambda form."
(and (eq (car-safe mac) 'lambda)
(setq mac (assoc 'kmacro-exec-ring-item mac))
(setq mac (car-safe (cdr-safe (car-safe (cdr-safe mac)))))
(listp mac)
(= (length mac) 3)
(arrayp (car mac))
mac))
(let ((mac (cond
((eq (car-safe mac) 'lambda)
(let ((e (assoc 'kmacro-exec-ring-item mac)))
(car-safe (cdr-safe (car-safe (cdr-safe e))))))
((and (functionp mac)
(equal (interactive-form mac) '(interactive "pkmacro")))
(let ((r (funcall mac 'kmacro--extract-lambda)))
(and (eq (car-safe r) 'kmacro--extract-lambda) (cdr r)))))))
(and (consp mac)
(= (length mac) 3)
(arrayp (car mac))
mac)))
(defalias 'kmacro-p #'kmacro-extract-lambda
"Return non-nil if MAC is a kmacro keyboard macro.")

View file

@ -3357,6 +3357,11 @@ removing prefixes such as Re:, Fwd: and so on and mailing list
tags such as [tag]."
(let ((subject (or (rmail-get-header "Subject" msgnum) ""))
(regexp "\\`[ \t\n]*\\(\\(\\w\\{1,4\\}\u00a0*[:]\\|\\[[^]]+]\\)[ \t\n]+\\)*"))
;; Corporate mailing systems sometimes add `[External] :'; if that happened,
;; delete everything up thru there. Empirically, that deletion makes
;; the Subject match the other messages in the thread.
(if (string-match "[[]external][ \t\n]*:" subject)
(setq subject (substring subject (match-end 0))))
(setq subject (rfc2047-decode-string subject))
(setq subject (replace-regexp-in-string regexp "" subject))
(replace-regexp-in-string "[ \t\n]+" " " subject)))
@ -3762,32 +3767,61 @@ use \\[mail-yank-original] to yank the original message into it."
(rmail-apply-in-message
rmail-current-message
(lambda ()
(search-forward "\n\n" nil 'move)
(narrow-to-region (point-min) (point))
(setq from (mail-fetch-field "from")
reply-to (or (mail-fetch-field "mail-reply-to" nil t)
(mail-fetch-field "reply-to" nil t)
from)
subject (mail-fetch-field "subject")
date (mail-fetch-field "date")
message-id (mail-fetch-field "message-id")
references (mail-fetch-field "references" nil nil t)
;; Bug#512. It's inappropriate to reply to these addresses.
;;resent-reply-to (mail-fetch-field "resent-reply-to" nil t)
;;resent-cc (and (not just-sender)
;; (mail-fetch-field "resent-cc" nil t))
;;resent-to (or (mail-fetch-field "resent-to" nil t) "")
;;resent-subject (mail-fetch-field "resent-subject")
;;resent-date (mail-fetch-field "resent-date")
;;resent-message-id (mail-fetch-field "resent-message-id")
)
(unless just-sender
(if (mail-fetch-field "mail-followup-to" nil t)
;; If this header field is present, use it instead of the
;; To and Cc fields.
(setq to (mail-fetch-field "mail-followup-to" nil t))
(setq cc (or (mail-fetch-field "cc" nil t) "")
to (or (mail-fetch-field "to" nil t) ""))))))
(let ((end (point-max))
subheader)
;; Find the message's real header.
(search-forward "\n\n" nil 'move)
(narrow-to-region (point-min) (point))
(goto-char (point-min))
;; If this is an encrypted message, search for other header fields
;; inside the encrypted part, and use them instead of the real header.
;; First, find a From: field after a plausible section start.
(when (and (search-forward "\nContent-Type: multipart/encrypted;\n" nil t)
(save-restriction
(narrow-to-region (point-min) end)
(and (search-forward "\nFrom: " nil t)
(setq subheader (point)))))
;; We found one, so widen up to end of message and go there.
(narrow-to-region (point-min) end)
(goto-char subheader)
;; Find the start of the inner header.
(search-backward "\n--")
(forward-line 2)
;; Find the end of it.
(let ((subheader-start (point)))
(goto-char subheader)
(search-forward "\n\n" nil 'move)
(narrow-to-region subheader-start (point))))
(setq from (mail-fetch-field "from")
reply-to (or (mail-fetch-field "mail-reply-to" nil t)
(mail-fetch-field "reply-to" nil t)
from)
subject (mail-fetch-field "subject")
date (mail-fetch-field "date")
message-id (mail-fetch-field "message-id")
references (mail-fetch-field "references" nil nil t)
;; Bug#512. It's inappropriate to reply to these addresses.
;;resent-reply-to (mail-fetch-field "resent-reply-to" nil t)
;;resent-cc (and (not just-sender)
;; (mail-fetch-field "resent-cc" nil t))
;;resent-to (or (mail-fetch-field "resent-to" nil t) "")
;;resent-subject (mail-fetch-field "resent-subject")
;;resent-date (mail-fetch-field "resent-date")
;;resent-message-id (mail-fetch-field "resent-message-id")
)
(unless just-sender
(if (mail-fetch-field "mail-followup-to" nil t)
;; If this header field is present, use it instead of the
;; To and Cc fields.
(setq to (mail-fetch-field "mail-followup-to" nil t))
(setq cc (or (mail-fetch-field "cc" nil t) "")
to (or (mail-fetch-field "to" nil t) "")))))))
;; Merge the resent-to and resent-cc into the to and cc.
;; Bug#512. It's inappropriate to reply to these addresses.
;;(if (and resent-to (not (equal resent-to "")))
@ -4585,8 +4619,9 @@ Argument MIME is non-nil if this is a mime message."
;; change it in one of the calls to `epa-decrypt-region'.
(save-excursion
(let (decrypts (mime (rmail-mime-message-p))
mime-disabled)
(let (decrypts
(mime (and (eq major-mode 'rmail-mode) (rmail-mime-message-p)))
mime-disabled)
(goto-char (point-min))
;; Turn off mime processing.

View file

@ -755,7 +755,11 @@ the message being processed."
(forward-char -1)
(skip-chars-backward " \t")
(point))))))
len mch lo)
len mch lo newline)
;; If there are multiple lines in FROM,
;; discard up to the last newline in it.
(while (setq newline (string-match "\n" from))
(setq from (substring from (1+ newline))))
(if (or (null from)
(string-match
(or rmail-user-mail-address-regexp

View file

@ -726,14 +726,21 @@ Turning on Mail mode runs the normal hooks `text-mode-hook' and
;; Lines containing just >= 3 dashes, perhaps after whitespace,
;; are also sometimes used and should be separators.
(setq paragraph-separate
(concat (regexp-quote mail-header-separator)
(if (zerop (length mail-header-separator))
(concat
;; This is based on adaptive-fill-regexp (presumably
;; the idea is to allow navigation etc of cited paragraphs).
"$\\|\t*[-!|#%;>*·•‣⁃◦ ]+$"
"\t*[-!|#%;>*·•‣⁃◦ ]+$"
"\\|[ \t]*[-[:alnum:]]*>+[ \t]*$\\|[ \t]*$\\|"
"--\\( \\|-+\\)$\\|"
page-delimiter)))
page-delimiter)
(concat (regexp-quote mail-header-separator)
;; This is based on adaptive-fill-regexp (presumably
;; the idea is to allow navigation etc of cited paragraphs).
"$\\|\t*[-!|#%;>*·•‣⁃◦ ]+$"
"\\|[ \t]*[-[:alnum:]]*>+[ \t]*$\\|[ \t]*$\\|"
"--\\( \\|-+\\)$\\|"
page-delimiter))))
(defun mail-header-end ()
"Return the buffer location of the end of headers, as a number."
@ -763,10 +770,11 @@ Concretely: replace the first blank line in the header with the separator."
"Remove header separator to put the message in correct form for sendmail.
Leave point at the start of the delimiter line."
(goto-char (point-min))
(when (re-search-forward
(concat "^" (regexp-quote mail-header-separator) "\n")
nil t)
(replace-match "\n"))
(unless (zerop (length mail-header-separator))
(when (re-search-forward
(concat "^" (regexp-quote mail-header-separator) "\n")
nil t)
(replace-match "\n")))
(rfc822-goto-eoh))
(defun mail-mode-auto-fill ()
@ -888,8 +896,9 @@ the user from the mailer."
(concat "\\(?:[[:space:];,]\\|\\`\\)"
(regexp-opt mail-mailing-lists t)
"\\(?:[[:space:];,]\\|\\'\\)"))))
(mail-combine-fields "To")
(mail-combine-fields "Cc")
(unless noninteractive
(mail-combine-fields "To")
(mail-combine-fields "Cc"))
;; If there are mailing lists defined
(when ml
(save-excursion
@ -931,7 +940,9 @@ the user from the mailer."
(error "Message contains non-ASCII characters"))))
;; Complain about any invalid line.
(goto-char (point-min))
(re-search-forward (regexp-quote mail-header-separator) (point-max) t)
;; Search for mail-header-eeparator as whole line.
(re-search-forward (concat "^" (regexp-quote mail-header-separator) "$")
(point-max) t)
(let ((header-end (or (match-beginning 0) (point-max))))
(goto-char (point-min))
(while (< (point) header-end)
@ -962,7 +973,10 @@ the user from the mailer."
(defun mail-envelope-from ()
"Return the envelope mail address to use when sending mail.
This function uses `mail-envelope-from'."
This function uses the `mail-envelope-from' variable.
The buffer should be narrowed to the headers of the mail message
before this function is called."
(if (eq mail-envelope-from 'header)
(nth 1 (mail-extract-address-components
(mail-fetch-field "From")))

View file

@ -79,9 +79,6 @@
:help "Print current buffer with page headings"))
menu))
;; Only declared obsolete (and only made a proper alias) in 23.3.
(define-obsolete-variable-alias
'menu-bar-files-menu 'menu-bar-file-menu "22.1")
(defvar menu-bar-file-menu
(let ((menu (make-sparse-keymap "File")))
@ -459,9 +456,6 @@
(defvar menu-bar-edit-menu
(let ((menu (make-sparse-keymap "Edit")))
(bindings--define-key menu [props]
'(menu-item "Text Properties" facemenu-menu))
;; ns-win.el said: Add spell for platform consistency.
(if (featurep 'ns)
(bindings--define-key menu [spell]
@ -495,7 +489,7 @@
'(menu-item "Select All" mark-whole-buffer
:help "Mark the whole buffer for a subsequent cut/copy"))
(bindings--define-key menu [clear]
'(menu-item "Clear" delete-region
'(menu-item "Clear" delete-active-region
:enable (and mark-active
(not buffer-read-only))
:help
@ -2294,9 +2288,10 @@ It must accept a buffer as its only required argument.")
(setq i (1- i))
(aset buffers-vec i
(cons (car pair)
`(lambda ()
(interactive)
(funcall menu-bar-select-buffer-function ,(cdr pair))))))
(let ((buf (cdr pair)))
(lambda ()
(interactive)
(funcall menu-bar-select-buffer-function buf))))))
buffers-vec))
(defun menu-bar-update-buffers (&optional force)
@ -2351,8 +2346,8 @@ It must accept a buffer as its only required argument.")
(aset frames-vec i
(cons
(frame-parameter frame 'name)
`(lambda ()
(interactive) (menu-bar-select-frame ,frame))))
(lambda ()
(interactive) (menu-bar-select-frame frame))))
(setq i (1+ i)))
;; Put it after the normal buffers
(setq buffers-menu

View file

@ -2449,8 +2449,10 @@ The completion method is determined by `completion-at-point-functions'."
(define-key map "\C-g" 'abort-minibuffers)
(define-key map "\M-<" 'minibuffer-beginning-of-buffer)
(define-key map "\r" 'exit-minibuffer)
(define-key map "\n" 'exit-minibuffer))
;; Put RET last so that it is shown in doc strings in preference to
;; C-j, when using the \\[exit-minibuffer] notation.
(define-key map "\n" 'exit-minibuffer)
(define-key map "\r" 'exit-minibuffer))
(defvar minibuffer-local-completion-map
(let ((map (make-sparse-keymap)))

View file

@ -190,10 +190,10 @@ the initial buffer."
(if (or (null multi-isearch-pause)
(and multi-isearch-pause multi-isearch-current-buffer))
(progn
(switch-to-buffer
(setq multi-isearch-current-buffer
(funcall multi-isearch-next-buffer-current-function
(current-buffer) t)))
(setq multi-isearch-current-buffer
(funcall multi-isearch-next-buffer-current-function
(current-buffer) t))
(multi-isearch-switch-buffer)
(goto-char (if isearch-forward (point-min) (point-max))))
(setq multi-isearch-current-buffer (current-buffer))
(setq isearch-wrapped nil)))
@ -202,14 +202,25 @@ the initial buffer."
"Save a function restoring the state of multiple buffers search.
Save the current buffer to the additional state parameter in the
search status stack."
`(lambda (cmd)
(multi-isearch-pop-state cmd ,(current-buffer))))
(let ((buf (current-buffer)))
(lambda (cmd)
(multi-isearch-pop-state cmd buf))))
(defun multi-isearch-pop-state (_cmd buffer)
"Restore the multiple buffers search state in BUFFER.
Switch to the buffer restored from the search status stack."
(unless (equal buffer (current-buffer))
(switch-to-buffer (setq multi-isearch-current-buffer buffer))))
(unless (eq buffer (current-buffer))
(setq multi-isearch-current-buffer buffer)
(multi-isearch-switch-buffer)))
;;;###autoload
(defun multi-isearch-switch-buffer ()
"Switch to the next buffer in multi-buffer search."
(when (and (buffer-live-p multi-isearch-current-buffer)
(not (eq multi-isearch-current-buffer (current-buffer))))
(setq isearch-mode nil)
(switch-to-buffer multi-isearch-current-buffer)
(setq isearch-mode " M-Isearch")))
;;; Global multi-buffer search invocations

View file

@ -131,7 +131,10 @@ scrolling."
:version "28.1")
(defcustom mouse-wheel-progressive-speed t
"If non-nil, the faster the user moves the wheel, the faster the scrolling.
"If nil, scrolling speed is proportional to the wheel speed.
If non-nil, moving the wheel faster will make scrolling
progressively faster.
Note that this has no effect when `mouse-wheel-scroll-amount' specifies
a \"near full screen\" scroll or when the mouse wheel sends key instead
of button events."

View file

@ -1122,8 +1122,8 @@ used instead of `browse-url-new-window-flag'."
",new-window"))
")"))))))))
(set-process-sentinel process
`(lambda (process change)
(browse-url-netscape-sentinel process ,url)))))
(lambda (process _change)
(browse-url-netscape-sentinel process url)))))
(function-put 'browse-url-netscape 'browse-url-browser-kind 'external)
@ -1194,8 +1194,8 @@ used instead of `browse-url-new-window-flag'."
",new-window"))
")"))))))
(set-process-sentinel process
`(lambda (process change)
(browse-url-mozilla-sentinel process ,url)))))
(lambda (process _change)
(browse-url-mozilla-sentinel process url)))))
(function-put 'browse-url-mozilla 'browse-url-browser-kind 'external)
@ -1312,8 +1312,8 @@ used instead of `browse-url-new-window-flag'."
'("--existing"))
(list url)))))
(set-process-sentinel process
`(lambda (process change)
(browse-url-galeon-sentinel process ,url)))))
(lambda (process _change)
(browse-url-galeon-sentinel process url)))))
(function-put 'browse-url-galeon 'browse-url-browser-kind 'external)
@ -1360,8 +1360,8 @@ used instead of `browse-url-new-window-flag'."
'("--existing"))
(list url)))))
(set-process-sentinel process
`(lambda (process change)
(browse-url-epiphany-sentinel process ,url)))))
(lambda (process _change)
(browse-url-epiphany-sentinel process url)))))
(function-put 'browse-url-epiphany 'browse-url-browser-kind 'external)
@ -1724,8 +1724,8 @@ from `browse-url-elinks-wrapper'."
(elinks-ping-process (start-process "elinks-ping" nil
"elinks" "-remote" "ping()")))
(set-process-sentinel elinks-ping-process
`(lambda (process change)
(browse-url-elinks-sentinel process ,url))))))
(lambda (process _change)
(browse-url-elinks-sentinel process url))))))
(function-put 'browse-url-elinks 'browse-url-browser-kind 'external)

View file

@ -1108,12 +1108,12 @@ queries the server for the existing fields and displays a corresponding form."
proto-name)))
(if (not (fboundp command))
(fset command
`(lambda ()
(interactive)
(eudc-set-server ,server (quote ,protocol))
(message "Selected directory server is now %s (%s)"
,server
,proto-name))))
(lambda ()
(interactive)
(eudc-set-server server protocol)
(message "Selected directory server is now %s (%s)"
server
proto-name))))
(vector (format "%s (%s)" server proto-name)
command
:style 'radio

View file

@ -160,7 +160,6 @@
%l with the value of `imap-default-user'. The program should accept
IMAP commands on stdin and return responses to stdout. Each entry in
the list is tried until a successful connection is made."
:group 'imap
:type '(repeat string))
(defcustom imap-gssapi-program (list
@ -173,7 +172,6 @@ the list is tried until a successful connection is made."
%l with the value of `imap-default-user'. The program should accept
IMAP commands on stdin and return responses to stdout. Each entry in
the list is tried until a successful connection is made."
:group 'imap
:type '(repeat string))
(defcustom imap-shell-program '("ssh %s imapd"
@ -186,7 +184,6 @@ number on server, %g with `imap-shell-host', and %l with
`imap-default-user'. The program should read IMAP commands from stdin
and write IMAP response to stdout. Each entry in the list is tried
until a successful connection is made."
:group 'imap
:type '(repeat string))
(defcustom imap-process-connection-type nil
@ -198,7 +195,6 @@ system has no ptys or if all ptys are busy: then a pipe is used
in any case. The value takes effect when an IMAP server is
opened; changing it after that has no effect."
:version "22.1"
:group 'imap
:type 'boolean)
(defcustom imap-use-utf7 t
@ -206,7 +202,6 @@ opened; changing it after that has no effect."
Since the UTF7 decoding currently only decodes into ISO-8859-1
characters, you may disable this decoding if you need to access UTF7
encoded mailboxes which doesn't translate into ISO-8859-1."
:group 'imap
:type 'boolean)
(defcustom imap-log nil
@ -217,7 +212,6 @@ It is not written to disk, however. Do not enable this
variable unless you are comfortable with that.
See also `imap-debug'."
:group 'imap
:type 'boolean)
(defcustom imap-debug nil
@ -232,17 +226,14 @@ variable unless you are comfortable with that.
This variable only takes effect when loading the `imap' library.
See also `imap-log'."
:group 'imap
:type 'boolean)
(defcustom imap-shell-host "gateway"
"Hostname of rlogin proxy."
:group 'imap
:type 'string)
(defcustom imap-default-user (user-login-name)
"Default username to use."
:group 'imap
:type 'string)
(defcustom imap-read-timeout (if (memq system-type '(windows-nt cygwin))
@ -250,12 +241,10 @@ See also `imap-log'."
0.1)
"How long to wait between checking for the end of output.
Shorter values mean quicker response, but is more CPU intensive."
:type 'number
:group 'imap)
:type 'number)
(defcustom imap-store-password nil
"If non-nil, store session password without prompting."
:group 'imap
:type 'boolean)
;;; Various variables
@ -987,8 +976,8 @@ t if it successfully authenticates, nil otherwise."
"imap" buffer imap-server imap-port)
((error quit) nil)))
(when imap-process
(set-process-filter imap-process 'imap-arrival-filter)
(set-process-sentinel imap-process 'imap-sentinel)
(set-process-filter imap-process #'imap-arrival-filter)
(set-process-sentinel imap-process #'imap-sentinel)
(while (and (eq imap-state 'initial)
(memq (process-status imap-process) '(open run)))
(message "Waiting for response from %s..." imap-server)
@ -1012,7 +1001,7 @@ necessary. If nil, the buffer name is generated."
(with-current-buffer (get-buffer-create buffer)
(if (imap-opened buffer)
(imap-close buffer))
(mapc 'make-local-variable imap-local-variables)
(mapc #'make-local-variable imap-local-variables)
(set-buffer-multibyte nil)
(buffer-disable-undo)
(setq imap-server (or server imap-server))
@ -1034,7 +1023,7 @@ necessary. If nil, the buffer name is generated."
;; Stream changed?
(if (not (eq imap-default-stream stream))
(with-current-buffer (generate-new-buffer " *temp*")
(mapc 'make-local-variable imap-local-variables)
(mapc #'make-local-variable imap-local-variables)
(set-buffer-multibyte nil)
(buffer-disable-undo)
(setq imap-server (or server imap-server))
@ -1078,7 +1067,6 @@ necessary. If nil, the buffer name is generated."
"If non-nil, check if IMAP is open.
See the function `imap-ping-server'."
:version "23.1" ;; No Gnus
:group 'imap
:type 'boolean)
(defun imap-opened (&optional buffer)
@ -1346,16 +1334,16 @@ If BUFFER is nil the current buffer is assumed."
(when imap-current-mailbox
(if asynch
(imap-add-callback (imap-send-command "CLOSE")
`(lambda (tag status)
(message "IMAP mailbox `%s' closed... %s"
imap-current-mailbox status)
(when (eq ,imap-current-mailbox
imap-current-mailbox)
;; Don't wipe out data if another mailbox
;; was selected...
(setq imap-current-mailbox nil
imap-message-data nil
imap-state 'auth))))
(let ((cmb imap-current-mailbox))
(lambda (_tag status)
(message "IMAP mailbox `%s' closed... %s"
imap-current-mailbox status)
(when (eq cmb imap-current-mailbox)
;; Don't wipe out data if another mailbox
;; was selected...
(setq imap-current-mailbox nil
imap-message-data nil
imap-state 'auth)))))
(when (imap-ok-p (imap-send-command-wait "CLOSE"))
(setq imap-current-mailbox nil
imap-message-data nil
@ -1740,8 +1728,8 @@ See `imap-enable-exchange-bug-workaround'."
(prog1
(and (imap-fetch-safe '("*" . "*:*") "UID")
(list (imap-mailbox-get-1 'uidvalidity mailbox)
(apply 'max (imap-message-map
(lambda (uid _prop) uid) 'UID))))
(apply #'max (imap-message-map
(lambda (uid _prop) uid) 'UID))))
(if old-mailbox
(imap-mailbox-select old-mailbox (eq state 'examine))
(imap-mailbox-unselect)))))))
@ -1786,7 +1774,7 @@ first element. The rest of list contains the saved articles' UIDs."
(prog1
(and (imap-fetch-safe '("*" . "*:*") "UID")
(list (imap-mailbox-get-1 'uidvalidity mailbox)
(apply 'max (imap-message-map
(apply #'max (imap-message-map
(lambda (uid _prop) uid) 'UID))))
(if old-mailbox
(imap-mailbox-select old-mailbox (eq state 'examine))
@ -1820,7 +1808,7 @@ on failure."
(numberp (nth 9 body)))
(nth 9 body))
(t 0))
(apply '+ (mapcar 'imap-body-lines body)))
(apply #'+ (mapcar #'imap-body-lines body)))
0))
(defun imap-envelope-from (from)
@ -2424,7 +2412,7 @@ Return nil if no complete line has arrived."
(buffer-substring (point) (1- (re-search-forward "[] ]" nil t)))))
(if (eq (char-before) ? )
(prog1
(mapconcat 'identity (cons section (imap-parse-header-list)) " ")
(mapconcat #'identity (cons section (imap-parse-header-list)) " ")
(search-forward "]" nil t))
section)))

View file

@ -328,6 +328,7 @@ Currently there are `threads' and `flags'.")
;;;; Main interactive functions
;;;###autoload
(defun mairix-search (search threads)
"Call Mairix with SEARCH.
If THREADS is non-nil, also display whole threads of found
@ -342,6 +343,7 @@ messages. Results will be put into the default search file."
threads)
(mairix-show-folder mairix-search-file)))
;;;###autoload
(defun mairix-use-saved-search ()
"Use a saved search for querying Mairix."
(interactive)
@ -374,6 +376,7 @@ Overwrite existing entry? ")
(setcdr (assoc name mairix-saved-searches) mairix-last-search))))
(mairix-select-save))
;;;###autoload
(defun mairix-edit-saved-searches-customize ()
"Edit the list of saved searches in a customization buffer."
(interactive)
@ -386,6 +389,8 @@ in your .emacs by pressing `Save for Future Sessions'.\n"
(make-string 65 ?=) "\n")))
(autoload 'mail-strip-quoted-names "mail-utils")
;;;###autoload
(defun mairix-search-from-this-article (threads)
"Search messages from sender of the current article.
This is effectively a shortcut for calling `mairix-search' with
@ -402,6 +407,7 @@ threads."
threads)
(error "No function for obtaining mail header specified"))))
;;;###autoload
(defun mairix-search-thread-this-article ()
"Search thread for the current article.
This is effectively a shortcut for calling `mairix-search'
@ -423,12 +429,14 @@ with m:msgid of the current article and enabled threads."
(mairix-search
(format "m:%s" mid) t)))
;;;###autoload
(defun mairix-widget-search-based-on-article ()
"Create mairix query based on current article using widgets."
(interactive)
(mairix-widget-search
(mairix-widget-get-values)))
;;;###autoload
(defun mairix-edit-saved-searches ()
"Edit current mairix searches."
(interactive)
@ -441,6 +449,7 @@ with m:msgid of the current article and enabled threads."
(defvar mairix-widgets)
;;;###autoload
(defun mairix-widget-search (&optional mvalues)
"Create mairix query interactively using graphical widgets.
MVALUES may contain values from current article."
@ -470,6 +479,7 @@ MVALUES may contain values from current article."
(widget-setup)
(goto-char (point-min)))
;;;###autoload
(defun mairix-update-database ()
"Call mairix for updating the database for SERVERS.
Mairix will be called asynchronously unless
@ -521,8 +531,11 @@ The mail program is given by `mairix-mail-program'."
If FILE is nil, use default. If THREADS is non-nil, also return
whole threads. Function returns t if messages were found."
(let* ((commandsplit (split-string mairix-command))
(args (cons (car commandsplit)
`(nil ,(get-buffer-create mairix-output-buffer) nil)))
(args (cons
(car commandsplit)
(append
`(nil ,(get-buffer-create mairix-output-buffer) nil)
mairix-search-options)))
rval)
(with-current-buffer mairix-output-buffer
(erase-buffer))

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