diff --git a/admin/git-bisect-start b/admin/git-bisect-start index f4ffb8f33b6..9de4d547323 100755 --- a/admin/git-bisect-start +++ b/admin/git-bisect-start @@ -82,7 +82,7 @@ done # SKIP-BRANCH 58cc931e92ece70c3e64131ee12a799d65409100 ## The list below is the exhaustive list of all commits between Dec 1 -## 2016 and Jun 8 2023 on which building Emacs with the default +## 2016 and Jul 8 2023 on which building Emacs with the default ## options, on a GNU/Linux computer and with GCC, fails. It is ## possible (though unlikely) that building Emacs with non-default ## options, with other compilers, or on other platforms, would succeed @@ -1735,3 +1735,25 @@ $REAL_GIT bisect skip $(cat $0 | grep '^# SKIP-SINGLE ' | sed 's/^# SKIP-SINGLE # SKIP-SINGLE 348e4504c6d5588443809ec28da3c3c693368e16 # SKIP-SINGLE 970f94a2dd8bc4be4d71f1075421093ca6f87d28 # SKIP-SINGLE 6b2c8dc9050c5c0514fa404733ce1d4a37d00e39 +# SKIP-SINGLE 6c3e65a75f582ca007a7fbcc4b866680e3b0e626 +# SKIP-SINGLE 8e8667246a4c06c8362515cbd6bead889babb748 +# SKIP-SINGLE bb4b511c4c63762bfd3b96623323a882cc57ecb6 +# SKIP-SINGLE 567258ab4309a7406cd4087d28cd0e820b17e157 +# SKIP-SINGLE 5fa9458511a17ff79a822e5cf8cc00f7bfb89364 +# SKIP-SINGLE 6d55d93379fa531f81327be6e506610474846758 +# SKIP-SINGLE eedb7111185569e426726fe15242f8ba08f89b31 +# SKIP-SINGLE 4c2cc21354a500b0fc48994b7b60648ef5f00a2d +# SKIP-SINGLE d7168e8575794b7af4e7e2bde51ca0663bbc2eac +# SKIP-SINGLE aad13e61dbf949ca6dea1ff492baca82f40a5738 +# SKIP-SINGLE 184106be2678f18ae90ccd35d69c2ccd61198b0a +# SKIP-SINGLE dfba4347c71d70b8357979ff0fb4bb070b0ed60c +# SKIP-SINGLE a19beb4ad43fe8225d384fc64e2406b7d24621a5 +# SKIP-SINGLE 77c2f05d773271cb59ebfd994b06a4075cacbfa8 +# SKIP-SINGLE ff5caf68c936ec90825efc4fd878d13703fb0400 +# SKIP-SINGLE 1c499c18afd6a709272fe60a540a27093e589fff +# SKIP-SINGLE 5b7e999e24f6cd446961ac441f69af021528623b +# SKIP-SINGLE 9c2cbfa49db96eae95bb40c5fc3ce7f09781a97d +# SKIP-SINGLE 375dac936fcca902874ecfd1c57b713581641725 +# SKIP-SINGLE 0a35c991c19a6dd0a707f2baa868f8989242c3ab +# SKIP-SINGLE e2ee646b162b87e832c8032b9d90577bd21f21f8 +# SKIP-SINGLE 35d2fe176cb438d55552cacbdf25c3692c054d51 diff --git a/configure.ac b/configure.ac index 5e5c6a88323..8d54ea0de16 100644 --- a/configure.ac +++ b/configure.ac @@ -6045,7 +6045,11 @@ fail; ;; netbsd) - if test "x$LIBS_TERMCAP" != "x-lterminfo"; then + # NetBSD versions prior to 6.0 lack native terminfo, but have a + # tputs() built on top of termcap in these libraries. Use native + # termcap instead in this case. NetBSD >= 6.0 has native terminfo + # implementation in -lterminfo. + if test "x$LIBS_TERMCAP" = "x-ltermcap" -o "x$LIBS_TERMCAP" = "x-lcurses"; then TERMINFO=no LIBS_TERMCAP="-ltermcap" fi diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index d8221f51425..d2d51e344dd 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1368,9 +1368,11 @@ can include remote directories as well (@pxref{Remote Files}). way Emacs processes local variables. Its default value is @code{t}, which specifies the behavior described above. If it is @code{nil}, Emacs simply ignores all file local variables. @code{:safe} means use -only the safe values and ignore the rest. Any other value says to -query you about each file that has local variables, without trying to -determine whether the values are known to be safe. +only the safe values and ignore the rest. @code{:all} instructs Emacs +to set all file local variables regardless of whether their value is +safe or not (we advise not to use this permanently). Any other value +says to query you about each file that has local variables, without +trying to determine whether the values are known to be safe. @vindex enable-local-eval @vindex safe-local-eval-forms diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 953de2e4786..40746e03ecc 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -396,8 +396,8 @@ The Speedbar can also use it (@pxref{Speedbar}). @cindex current function name in mode line Which Function mode is a global minor mode (@pxref{Minor Modes}) -which displays the current function name in the mode line, updating it -as you move around in a buffer. +which displays the current function name in the mode line or header +line, updating it as you move around in a buffer. @findex which-function-mode @vindex which-func-modes @@ -410,6 +410,12 @@ changing the value of the variable @code{which-func-modes} from @code{t} (which means to support all available major modes) to a list of major mode names. +@vindex which-func-display + By default, Which Function mode displays the current function name +using the mode line. Customize @code{which-func-display} to +@code{header}, @code{mode}, or @code{mode-and-header} to use the +header line, mode line, or both, respectively. + @node Program Indent @section Indentation for Programs @cindex indentation for programs diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index c2c2de80a7f..98cf81be107 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi @@ -1203,7 +1203,8 @@ saved bounds. In that case it is equivalent to @cindex labeled narrowing @cindex labeled restriction -When the optional argument @var{label}, a symbol, is present, the +When the optional argument @var{label}, which is evaluated to get the +label to use and must yield a non-@code{nil} value, is present, the narrowing is @dfn{labeled}. A labeled narrowing differs from a non-labeled one in several ways: diff --git a/doc/misc/auth.texi b/doc/misc/auth.texi index 03484950e01..7b4e8fcfb39 100644 --- a/doc/misc/auth.texi +++ b/doc/misc/auth.texi @@ -675,43 +675,12 @@ before @file{~/.authinfo}, the auth-source library will try to read the GnuPG encrypted @file{.gpg} file first, before the unencrypted file. -There is an option @code{auto-encryption-mode} to automatically -decrypt @file{*.gpg} files. It is enabled by default. - -If you want your GnuPG passwords to be cached, set up @code{gpg-agent} -or EasyPG Assistant -(@pxref{Caching Passphrases, , Caching Passphrases, epa}). - -To quick start, here are some questions: - -@itemize -@item -Do you use GnuPG version 2 instead of GnuPG version 1? -@item -Do you use symmetric encryption rather than public key encryption? -@item -Do you want to use gpg-agent? -@end itemize - -Here are configurations depending on your answers: - -@multitable {111} {222} {333} {configuration configuration configuration} -@item @b{1} @tab @b{2} @tab @b{3} @tab Configuration -@item Yes @tab Yes @tab Yes @tab Set up gpg-agent. -@item Yes @tab Yes @tab No @tab You can't, without gpg-agent. -@item Yes @tab No @tab Yes @tab Set up gpg-agent. -@item Yes @tab No @tab No @tab You can't, without gpg-agent. -@item No @tab Yes @tab Yes @tab Set up elisp passphrase cache. -@item No @tab Yes @tab No @tab Set up elisp passphrase cache. -@item No @tab No @tab Yes @tab Set up gpg-agent. -@item No @tab No @tab No @tab You can't, without gpg-agent. -@end multitable - -To set up gpg-agent, follow the instruction in GnuPG manual -(@pxref{Invoking GPG-AGENT, , Invoking GPG-AGENT, gnupg}). - -To set up elisp passphrase cache, set -@code{epa-file-cache-passphrase-for-symmetric-encryption}. +The EasyPG Assistant, which comes bundled with Emacs, handles +decryption of encrypted files automatically, see @ref{Top, , Top, epa, +EasyPG Assistant User's Manual}. It is an Emacs user interface to +@acronym{GnuPG, GNU Privacy Guard}, see @ref{Top, , Top, gnupg, Using +the GNU Privacy Guard}. To get started with these quickly, see +@ref{Quick start, , Quick Start, epa, EasyPG Assistant User's Manual}. @node GNU Free Documentation License @appendix GNU Free Documentation License diff --git a/doc/misc/epa.texi b/doc/misc/epa.texi index 6f63a3d7ba0..917fd588593 100644 --- a/doc/misc/epa.texi +++ b/doc/misc/epa.texi @@ -43,7 +43,10 @@ modify this GNU manual.'' @contents @node Top -@top EasyPG Assistant user's manual +@top EasyPG Assistant User's Manual +@cindex easypg assistant +@cindex gnu privacy guard +@cindex gnupg EasyPG Assistant is an Emacs user interface to GNU Privacy Guard (GnuPG, @pxref{Top, , Top, gnupg, Using the GNU Privacy Guard}). @@ -56,14 +59,22 @@ called EasyPG Library. @insertcopying @end ifnottex +@c Unfortunately the node names of this manual are not very consistent +@c w.r.t. their case. However, case is significant in node names, so +@c we probably better should not change these to not break any +@c external references. Things are more relaxed for structure titles, +@c so we consistently updated them to title-case. + @menu * Overview:: * Quick start:: * Commands:: * GnuPG version compatibility:: +* GnuPG Pinentry:: * Caching Passphrases:: * Bug Reports:: * GNU Free Documentation License:: The license for this documentation. +* Concept Index:: * Key Index:: * Function Index:: * Variable Index:: @@ -71,8 +82,10 @@ called EasyPG Library. @node Overview @chapter Overview +@cindex features of easypg assistant -EasyPG Assistant provides the following features. +EasyPG Assistant is an Emacs frontend application to @acronym{GnuPG, +GNU Privacy Guard} that provides the following features: @itemize @bullet @item Key management. @@ -84,7 +97,24 @@ EasyPG Assistant provides the following features. @end itemize @node Quick start -@chapter Quick start +@chapter Quick Start +@cindex introduction to easypg assistant +@cindex gnupg documentation +@cindex documentation on gnupg +@cindex configuration of gnupg +@cindex introduction to gnupg + +You can use EasyPG Assistant without any Emacs or GnuPG configuration +whatsoever, for example to encrypt and decrypt files automatically +with symmetric encryption, see @ref{Encrypting/decrypting gpg files}. +However, to use the full set of EasyPG Assistant's functions you +should have at least some minimum GnuPG configuration in place. + +John Michael Ashley's GNU Privacy Handbook, available online as part +of @uref{https://gnupg.org/documentation/guides.html, the GnuPG user +guides}, provides an introduction to GnuPG use and configuration. In +contrast to that, the GnuPG manual (@pxref{Top, , Top, gnupg, Using +the GNU Privacy Guard}) is more of a reference manual. EasyPG Assistant commands are prefixed by @samp{epa-}. For example, @@ -118,7 +148,11 @@ This chapter introduces various commands for typical use cases. @end menu @node Key management -@section Key management +@section Key Management +@cindex key management + +@cindex key ring, browsing +@cindex browse key ring Probably the first step of using EasyPG Assistant is to browse your keyring. @kbd{M-x epa-list-keys} is corresponding to @samp{gpg --list-keys} from the command line. @@ -157,6 +191,7 @@ about the key you selected. Fingerprint: 9003 D76B 73B7 4A8A E588 10AF 4447 461B 2A9B EA2D @end example +@cindex private key ring, browsing @noindent To browse your private keyring, use @kbd{M-x epa-list-secret-keys}. @@ -172,12 +207,14 @@ to select keys, type @kbd{o}, and then supply the filename. Below are other commands related to key management. Some of them take a file as input/output, and others take the current region. +@cindex insert keys @deffn Command epa-insert-keys keys Insert selected @var{keys} after the point. It will let you select keys before insertion. By default, it will encode keys in the OpenPGP armor format. @end deffn +@cindex import keys @deffn Command epa-import-keys file Import keys from @var{file} to your keyring. @end deffn @@ -195,14 +232,18 @@ Import keys in the OpenPGP armor format in the current region between applies @code{epa-import-keys-region} to each of them. @end deffn +@cindex delete keys @deffn Command epa-delete-keys allow-secret Delete selected keys. If @var{allow-secret} is non-@code{nil}, it also delete the secret keys. @end deffn @node Cryptographic operations on regions -@section Cryptographic operations on regions +@section Cryptographic Operations on Regions +@cindex cryptographic operations on regions +@cindex region operations, cryptographic +@cindex decrypt region @deffn Command epa-decrypt-region start end Decrypt the current region between @var{start} and @var{end}. It replaces the region with the decrypted text. @@ -216,6 +257,7 @@ and applies @code{epa-decrypt-region} to each of them. That is, this command does not alter the original text around armors. @end deffn +@cindex verify region @deffn Command epa-verify-region start end Verify the current region between @var{start} and @var{end}. It sends the verification result to the minibuffer or a popup window. It @@ -231,6 +273,7 @@ searches OpenPGP cleartext blocks in the region and applies not alter the original text around OpenPGP cleartext blocks. @end deffn +@cindex sign region @deffn Command epa-sign-region start end signers type Sign the current region between @var{start} and @var{end}. By default, it creates a cleartext signature. If a prefix argument is @@ -238,6 +281,7 @@ given, it will let you select signing keys, and then a signature type. @end deffn +@cindex encrypt region @deffn Command epa-encrypt-region start end recipients sign signers Encrypt the current region between @var{start} and @var{end}. It will let you select recipients. If a prefix argument is given, it will @@ -246,28 +290,37 @@ you answered yes, it will let you select the signing keys. @end deffn @node Cryptographic operations on files -@section Cryptographic operations on files +@section Cryptographic Operations on Files +@cindex cryptographic operations on files +@cindex file operations, cryptographic +@cindex decrypt file @deffn Command epa-decrypt-file file &optional output Decrypt @var{file}. If you do not specify the name @var{output} to use for the decrypted file, this function prompts for the value to use. @end deffn +@cindex verify file @deffn Command epa-verify-file file Verify @var{file}. @end deffn +@cindex sign file @deffn Command epa-sign-file file signers type Sign @var{file}. If a prefix argument is given, it will let you select signing keys, and then a signature type. @end deffn +@cindex encrypt file @deffn Command epa-encrypt-file file recipients Encrypt @var{file}. It will let you select recipients. @end deffn @node Dired integration -@section Dired integration +@section Dired Integration +@cindex dired integration +@cindex directory operations +@cindex multiple file operations EasyPG Assistant extends Dired Mode for GNU Emacs to allow users to easily do cryptographic operations on files. For example, @@ -306,7 +359,9 @@ Encrypt marked files. @end table @node Mail-mode integration -@section Mail-mode integration +@section Mail-Mode Integration +@cindex mail-mode integration +@cindex sending signed/encrypted mails EasyPG Assistant provides a minor mode @code{epa-mail-mode} to help user compose inline OpenPGP messages. Inline OpenPGP is a traditional @@ -361,13 +416,56 @@ whether to sign, and which key(s) to sign with. @end table @node Encrypting/decrypting gpg files -@section Encrypting/decrypting gpg files +@section Encrypting and Decrypting gpg Files +@cindex encrypting gpg files +@cindex decrypting gpg files +@cindex gpg files, encrypting and decrypting +@cindex automatic file encryption and decryption + By default, every file whose name ends with @file{.gpg} will be treated as encrypted. That is, when you open such a file, the decrypted text is inserted in the buffer rather than encrypted one. Similarly, when you save the buffer to a @file{foo.gpg} file, encrypted data is written. +When you save a buffer to an encrypted file for the first time, EasyPG +Assistant presents you a list of keys in a buffer @file{*Keys*} where +you can select recipients for encryption. @xref{Key management}, for +a description of the format of that buffer. You can streamline this +recipient selection step by customizing variables +@code{epa-file-encrypt-to} and @code{epa-file-select-keys} described +further below in this section. + +@cindex symmetric encryption, passphrase entry for +If you do not select any recipient during this step, EasyPG Assistant +uses symmetric encryption. As a consequence, you have to enter the +passphrase twice for every buffer save and every so often for file +reads, since the GnuPG Agent caches your passphrase for file reads at +least for some time, but not for buffer saves. @xref{Caching +Passphrases}, for more information. + +@cindex public key encryption, passphrase entry for +If you have created your own keypair@footnote{For encryption and +decryption of files you do not intend to share, you do not have to use +an email address as recipient during creation of the keypair. You can +also use some free-form string that gives information on the use of +the keypair, like @code{backup} or @code{account database}.}, you can +select that as recipient, and EasyPG Assistant will use public key +encryption for that file. Since GnuPG performs encryption with your +public key, it does not prompt for a passphrase for the buffer save, +but it will prompt for your passphrase for file reads every now and +then, depending on the GnuPG Agent cache configuration. + +@cindex tempory files created by easypg assistant +To encrypt and decrypt files as described above EasyPG Assistant under +certain circumstances uses intermediate tempory files that contain the +plain-text contents of the files it processes. EasyPG Assistant +creates them below the directory returned by function +@code{temporary-file-directory} (@pxref{Unique File Names, , +Generating Unique File Names, elisp, GNU Emacs Lisp Reference +Manual}). If you want to be sure not to leave any plain-text traces, +use an encrypted file systems at least for that directory. + The file name pattern for encrypted files can be controlled by @code{epa-file-name-regexp}. @@ -404,11 +502,11 @@ You can also change the default behavior with the variable Control whether or not to pop up the key selection dialog. @end defvar -For frequently visited files, it might be a good idea to tell Emacs -which encryption method should be used through @xref{File Variables, , -, emacs, the Emacs Manual}. Use the @code{epa-file-encrypt-to} local -variable for this. @vindex epa-file-encrypt-to +For frequently visited files, it might be a good idea to tell Emacs +which encryption method should be used through file variables +(@pxref{File Variables, , Local Variables in Files, emacs, The Emacs +Editor}). Use the @code{epa-file-encrypt-to} local variable for this. For example, if you want an Elisp file to be encrypted with a public key associated with an email address @samp{ueno@@unixuser.org}, @@ -436,6 +534,11 @@ behavior are below. @defvar epa-file-cache-passphrase-for-symmetric-encryption If non-@code{nil}, cache passphrase for symmetric encryption. The default value is @code{nil}. + +For security reasons, this option is turned off by default and not +recommended to be used. Instead, consider using the GnuPG Agent, which +in many cases can do the same job, and does it in a safer way. +@xref{Caching Passphrases}, for more information. @end defvar @defvar epa-file-inhibit-auto-save @@ -444,7 +547,9 @@ The default value is @code{t}. @end defvar @node Querying a key server -@section Querying a key server +@section Querying a Key Server +@cindex query key server +@cindex key server, querying 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 @@ -457,14 +562,23 @@ into your key ring). The @code{epa-keyserver} variable says which server to query. - @node GnuPG version compatibility -@chapter GnuPG version compatibility +@chapter GnuPG Version Compatibility +@cindex gnupg version compatibility +@cindex version compatibility with gnupg +@cindex compatibility with gnupg -As of February 2016, there are three active branches of GnuPG: 2.1, -2.0, and 1.4. All those branches should work flawlessly with Emacs -with basic use-cases. They have, however, some incompatible -characteristics, which might be visible when used from Emacs. +As of June 2023, there are three active branches of GnuPG: 2.4, 2.2, +and 1.4. GnuPG versions 2.4.1 and later suffer from +@uref{https://dev.gnupg.org/T6481, GnuPG bug T6481} and are hardly +usable with Emacs. There is a patch for that bug available at least +for GnuPG version 2.4.1, which your operating system or distribution +might provide already. GnuPG 1.4 is considered a legacy version. + +Besides that, all of those branches mentioned above should work +flawlessly with Emacs with basic use-cases. They have, however, some +incompatible characteristics, which might be visible when used from +Emacs. @itemize @item @@ -473,58 +587,127 @@ means, a key created with GnuPG 2.1 is not visible with 1.4. @item GnuPG 2.1 uses a fixed address for the Unix domain socket used to -communicate with gpg-agent. The @code{GPG_AGENT_INFO} environment -variable, which is used by GnuPG 2.0 and 1.4, is ignored. That means, -if your system has both GnuPG 2.1 and 1.4, the gpg command from GnuPG -1.4 is not able to use gpg-agent provided by 2.1 (at least out of box). +communicate with @command{gpg-agent}. The @code{GPG_AGENT_INFO} +environment variable, which is used by GnuPG 2.0 and 1.4, is ignored. +That means, if your system has both GnuPG 2.1 and 1.4, the gpg command +from GnuPG 1.4 is not able to use @command{gpg-agent} provided by 2.1 +(at least out of box). @item GnuPG 2.1 (2.1.5 or later) has a mechanism to direct the Pinentry -password prompt to the Emacs minibuffer@footnote{To enable this -feature, add @samp{allow-emacs-pinentry} to -@file{~/.gnupg/gpg-agent.conf} and let gpg-agent reload the -configuration, with: @samp{gpgconf --reload gpg-agent}}, which would -be useful when you use Emacs remotely or from a text-only terminal. -That feature is not available in other versions, and more -specifically, with 2.0 (as of 2.0.29), there is no way to avoid the -graphical prompt. +password prompt to the Emacs minibuffer. @xref{GnuPG Pinentry}. @end itemize +@node GnuPG Pinentry +@chapter GnuPG Pinentry +@cindex gnupg pinentry +@cindex pinentry provided by gnupg + +An important component of the GnuPG suite is the Pinentry, which +allows for secure entry of passphrases requested by GnuPG. GnuPG +delivers various different programs as Pinentry, ranging from bland +TTY-only @command{pinentry-tty} to fancy graphical dialogs for various +desktop environments, like @command{pinentry-gnome3}. Your operating +system usually determines which of these is used by default. + +Note that the selection of a concrete Pinentry program determines only +@emph{how} GnuPG queries for passphrases and not @emph{how often}. +For the latter question see @ref{Caching Passphrases}. + +@cindex pinentry, emacs as +With some configuration Emacs can also play the role of a Pinentry. +The most natural choice, available with GnuPG 2.1.5 and later, is to +use Emacs itself as Pinentry for requests that are triggered by Emacs. +For example, if you open a file whose name ends with @file{.gpg} using +automatic decryption, you most likely also want to enter the +passphrase for that request in Emacs. + +@cindex loopback pinentry +This so called @dfn{loopback Pinentry} has the added benefit that it +works also when you use Emacs remotely or from a text-only terminal. +To enable it: + +@enumerate +@item +@vindex allow-loopback-pinentry +Ensure that option @code{allow-loopback-pinentry} is configured for +@command{gpg-agent}, which should be the default. @xref{Agent +Options, , Option Summary, gnupg, Using the GNU Privacy Guard}. + +@item +@vindex epg-pinentry-mode +Customize variable @code{epg-pinentry-mode} to @code{loopback} in +Emacs. +@end enumerate + +There are other options available to use Emacs as Pinentry, you might +come across a Pinentry called @command{pinentry-emacs} or +@command{gpg-agent} option @code{allow-emacs-pinentry}. However, +these are considered insecure or semi-obsolete and might not be +supported by your operating system or distribution. For example, +Debian GNU/Linux supports only the loopback Pinentry described above. + +@ignore +In case somebody requests these: + +Use Emacs for all GnuPG requests: + +Make @command{pinentry-emacs} the default Pinentry by means of your +operating system. Install package @file{pinentry.el} from GNU ELPA +and execute @kbd{M-x pinentry-start} to start the Emacs Pinentry +service. @emph{All} GnuPG passphrase requests should then result in a +minibuffer prompt in the running Emacs. If Emacs or the Emacs +Pinentry service are not running, passphrase requests fail. + +Use Emacs for all GnuPG requests with other Pinentry as fallback: + +Ensure the other Pinentry supports Emacs; @command{pinentry-curses} +does, for example. Configure @command{gpg-agent} option +@code{allow-emacs-pinentry}. Set environment variable +@code{INSIDE_EMACS} for the calling process. Install package +@file{pinentry.el}. Now if Emacs is running and @kbd{M-x +pinentry-start} has been executed, all GnuPG passphrase requests +should result in a minibuffer prompt in the running Emacs. If Emacs +or the Emacs Pinentry service are not running, GnuPG uses the other +Pinentry instead. +@end ignore + @node Caching Passphrases @chapter Caching Passphrases +@cindex caching passphrases +@cindex entering passphrases +@cindex passphrases, entering and caching Typing passphrases is a troublesome task if you frequently open and close the same file. GnuPG and EasyPG Assistant provide mechanisms to remember your passphrases for a limited time. Using these, you only -need to re-enter the passphrase occasionally. -However, the configuration is a bit -confusing since it depends on your GnuPG installation@xref{GnuPG -version compatibility}, encryption method (symmetric or public key), -and whether or not you want to use gpg-agent. Here are some -questions: +need to re-enter the passphrase occasionally. However, the +configuration is a bit confusing since it depends on your GnuPG +installation (@pxref{GnuPG version compatibility}), encryption method +(symmetric or public key), and whether or not you want to use +GnuPG Agent. As an additional constraint, use of the GnuPG Agent is +mandatory for GnuPG 2.0 and later. Here are some questions: @enumerate -@item Do you use GnuPG version 2.1 or 2.0 instead of GnuPG version 1.4? +@item Do you use GnuPG version 2.0 or later instead of GnuPG version 1.4? @item Do you use symmetric encryption rather than public key encryption? -@item Do you want to use gpg-agent? +@item Do you want to use GnuPG Agent? @end enumerate Here are configurations depending on your answers: @multitable {111} {222} {333} {configuration configuration configuration} @item @b{1} @tab @b{2} @tab @b{3} @tab Configuration -@item Yes @tab Yes @tab Yes @tab Set up gpg-agent. -@item Yes @tab Yes @tab No @tab You can't, without gpg-agent. -@item Yes @tab No @tab Yes @tab Set up gpg-agent. -@item Yes @tab No @tab No @tab You can't, without gpg-agent. -@item No @tab Yes @tab Yes @tab Set up elisp passphrase cache. -@item No @tab Yes @tab No @tab Set up elisp passphrase cache. -@item No @tab No @tab Yes @tab Set up gpg-agent. -@item No @tab No @tab No @tab You can't, without gpg-agent. +@item Yes @tab Yes @tab Must @tab Set up GnuPG Agent. +@item Yes @tab No @tab Must @tab Set up GnuPG Agent. +@item No @tab Yes @tab Yes @tab Set up elisp passphrase cache. +@item No @tab Yes @tab No @tab Set up elisp passphrase cache. +@item No @tab No @tab Yes @tab Set up GnuPG Agent. +@item No @tab No @tab No @tab You can't, without GnuPG Agent. @end multitable -To set up gpg-agent, follow the instruction in GnuPG manual. -@pxref{Invoking GPG-AGENT, , Invoking GPG-AGENT, gnupg}. +To set up GnuPG Agent, follow the instruction in @ref{Invoking +GPG-AGENT, , , gnupg, Using the GNU Privacy Guard}. To set up elisp passphrase cache, set @code{epa-file-cache-passphrase-for-symmetric-encryption}. @@ -532,11 +715,13 @@ To set up elisp passphrase cache, set @node Bug Reports @chapter Bug Reports +@cindex bug reports +@cindex reporting bugs Bugs and problems with EasyPG Assistant are actively worked on by the Emacs development team. Feature requests and suggestions are also -more than welcome. Use @kbd{M-x report-emacs-bug}, @pxref{Bugs, , -Bugs, emacs, Reporting Bugs}. +more than welcome. Use @kbd{M-x report-emacs-bug}, see @ref{Bugs, , +Reporting Bugs, emacs, The Emacs Editor}. When submitting a bug report, please try to describe in excruciating detail the steps required to reproduce the problem. Also try to @@ -556,6 +741,10 @@ buffer name is a whitespace. @appendix GNU Free Documentation License @include doclicense.texi +@node Concept Index +@unnumbered Concept Index +@printindex cp + @node Key Index @unnumbered Key Index @printindex ky diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index 9b9268ae4ea..099bf3e9809 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -1092,8 +1092,6 @@ the alias. This lets you selectively use an alias's arguments, so @kbd{alias mcd 'mkdir $1 && cd $1'} would cause @kbd{mcd foo} to create and switch to a directory called @samp{foo}. -@end table - @node Remote Access @section Remote Access @cmindex remote access diff --git a/doc/misc/modus-themes.org b/doc/misc/modus-themes.org index 7809bd03918..ae760624b6f 100644 --- a/doc/misc/modus-themes.org +++ b/doc/misc/modus-themes.org @@ -1,23 +1,23 @@ -#+title: Modus themes for GNU Emacs -#+author: Protesilaos Stavrou -#+email: info@protesilaos.com -#+language: en -#+options: ':t toc:nil author:t email:t num:t -#+startup: content -#+macro: stable-version 4.2.0 -#+macro: release-date 2023-05-30 -#+macro: development-version 4.3.0-dev -#+macro: file @@texinfo:@file{@@$1@@texinfo:}@@ -#+macro: space @@texinfo:@: @@ -#+macro: kbd @@texinfo:@kbd{@@$1@@texinfo:}@@ -#+texinfo_filename: modus-themes.info -#+texinfo_dir_category: Emacs misc features -#+texinfo_dir_title: Modus Themes: (modus-themes) -#+texinfo_dir_desc: Elegant, highly legible and customizable themes -#+texinfo_header: @set MAINTAINERSITE @uref{https://protesilaos.com,maintainer webpage} -#+texinfo_header: @set MAINTAINER Protesilaos Stavrou -#+texinfo_header: @set MAINTAINEREMAIL @email{info@protesilaos.com} -#+texinfo_header: @set MAINTAINERCONTACT @uref{mailto:info@protesilaos.com,contact the maintainer} +#+title: Modus themes for GNU Emacs +#+author: Protesilaos Stavrou +#+email: info@protesilaos.com +#+language: en +#+options: ':t toc:nil author:t email:t num:t +#+startup: content +#+macro: stable-version 4.2.0 +#+macro: release-date 2023-05-30 +#+macro: development-version 4.3.0-dev +#+macro: file @@texinfo:@file{@@$1@@texinfo:}@@ +#+macro: space @@texinfo:@: @@ +#+macro: kbd @@texinfo:@kbd{@@$1@@texinfo:}@@ +#+texinfo_filename: modus-themes.info +#+texinfo_dir_category: Emacs misc features +#+texinfo_dir_title: Modus Themes: (modus-themes) +#+texinfo_dir_desc: Elegant, highly legible and customizable themes +#+texinfo_header: @set MAINTAINERSITE @uref{https://protesilaos.com,maintainer webpage} +#+texinfo_header: @set MAINTAINER Protesilaos Stavrou +#+texinfo_header: @set MAINTAINEREMAIL @email{info@protesilaos.com} +#+texinfo_header: @set MAINTAINERCONTACT @uref{mailto:info@protesilaos.com,contact the maintainer} #+texinfo: @insertcopying diff --git a/doc/misc/widget.texi b/doc/misc/widget.texi index 4ac57a95a43..13b37ab5b54 100644 --- a/doc/misc/widget.texi +++ b/doc/misc/widget.texi @@ -1600,9 +1600,7 @@ when the widget is created, and on any value set later with @item :value-to-external Function to convert the value to the external format. The function takes two arguments, a widget and an internal value, and returns the -external value. The function is called on the present @code{:value} -when the widget is created, and on any value set later with -@code{widget-value-set}. +external value. @vindex create@r{ keyword} @item :create diff --git a/etc/NEWS b/etc/NEWS index 9f09bb0245d..d4d9fd37210 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -286,6 +286,13 @@ docstring, or a comment, or (re)indents the surrounding defun if point is not in a comment or a string. It is by default bound to 'M-q' in 'prog-mode' and all its descendants. ++++ +*** Which Function Mode can now display function names on the header line. +The new user option 'which-func-display' allows choosing where the +function name is displayed. The default is 'mode' to display in the +mode line. 'header' will display in the header line; +'mode-and-header' displays in both the header line and mode line. + ** Tramp +++ diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 4e021f738b6..a4aa79c171e 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -888,7 +888,7 @@ The option `delete-pair-blink-delay' can disable blinking." "Raise N sexps one level higher up the tree. This function removes the sexp enclosing the form which follows -point, and then re-inserts N sexps that originally followe point, +point, and then re-inserts N sexps that originally followed point, thus raising those N sexps one level up. Interactively, N is the numeric prefix argument, and defaults to 1. diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el index dc04bf50c24..7cbeb48f5be 100644 --- a/lisp/net/nsm.el +++ b/lisp/net/nsm.el @@ -1030,10 +1030,14 @@ protocol." " Hostname:" (nsm-certificate-part (plist-get cert :subject) "CN" t) "\n") (when (and (plist-get cert :public-key-algorithm) - (plist-get cert :signature-algorithm)) + (plist-get cert :signature-algorithm) + (or (plist-get cert :public-key-id-sha256) + (plist-get cert :public-key-id))) (insert " Public key:" (plist-get cert :public-key-algorithm) - ", signature: " (plist-get cert :signature-algorithm) "\n")) + ", signature: " (plist-get cert :signature-algorithm) "\n" + " Public key ID:" (or (plist-get cert :public-key-id-sha256) + (plist-get cert :public-key-id)) "\n")) (when (and (plist-get status :key-exchange) (plist-get status :cipher) (plist-get status :mac) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index be6178ff707..c759a520e9c 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1955,11 +1955,10 @@ version, the function does nothing." "Return contents of BUFFER. If BUFFER is not a buffer or a buffer name, return the contents of `current-buffer'." - (or (let ((buf (or buffer (current-buffer)))) - (when (bufferp buf) - (with-current-buffer (or buffer (current-buffer)) - (substring-no-properties (buffer-string))))) - "")) + (with-current-buffer + (if (or (bufferp buffer) (and (stringp buffer) (get-buffer buffer))) + buffer (current-buffer)) + (substring-no-properties (buffer-string)))) (defun tramp-debug-buffer-name (vec) "A name for the debug buffer for VEC." diff --git a/lisp/paren.el b/lisp/paren.el index 4c91fd29490..6296d7e67fa 100644 --- a/lisp/paren.el +++ b/lisp/paren.el @@ -506,7 +506,18 @@ It is the default value of `show-paren-data-function'." (when (and show-paren-context-when-offscreen (not (eql show-paren--last-pos (point))) (< there-beg here-beg) - (not (pos-visible-in-window-p openparen))) + ;; Either OPENPAREN position is fully visible... + (not (or (pos-visible-in-window-p openparen) + (let ((dfh4 (* 0.25 (default-font-height))) + (part + (pos-visible-in-window-p openparen + nil t))) + ;; ...or partially visible, and the + ;; invisible part is less than 1/4th + ;; of the default font height + (and (>= (length part) 4) + (< (nth 2 part) dfh4) + (< (nth 3 part) dfh4)))))) (let ((context (blink-paren-open-paren-line-string openparen)) (message-log-max nil)) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 199be3318a1..a1091de43e9 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -987,7 +987,7 @@ detailed description of this mode. "\C-u" "Continue to current line or address.") (gud-def gud-go (progn - (when arg + (when (and current-prefix-arg arg) (gud-call (concat "-exec-arguments " (read-string "Arguments to exec-run: ")))) (gud-call diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 4291ab03ca6..a23339a2180 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -6451,9 +6451,9 @@ from sys import argv, exit, stdin try: from isort import find_imports_in_stream, find_imports_in_paths except ModuleNotFoundError: - exit(1) -except ImportError: exit(2) +except ImportError: + exit(3) query, files, result = argv[1] or None, argv[2:], {} @@ -6484,6 +6484,17 @@ for key in sorted(result): (project-files proj)) (list default-directory))) +(defun python--list-imports-check-status (status) + (unless (eq 0 status) + (let* ((details + (cond + ((eq 2 status) " (maybe isort is missing?)") + ((eq 3 status) " (maybe isort version is older than 5.7.0?)") + (t ""))) + (msg + (concat "%s exited with status %s" details))) + (error msg python-interpreter status)))) + (defun python--list-imports (name source) "List all Python imports matching NAME in SOURCE. If NAME is nil, list all imports. SOURCE can be a buffer or a @@ -6507,13 +6518,7 @@ recursively." (or name "") (mapcar #'file-local-name source))))) lines) - (cond - ((eq 1 status) - (error "%s exited with status %s (maybe isort is missing?)" - python-interpreter status)) - ((eq 2 status) - (error "%s exited with status %s (maybe isort version is <5.7.0?)" - python-interpreter status))) + (python--list-imports-check-status status) (goto-char (point-min)) (while (not (eobp)) (push (buffer-substring-no-properties (point) (pos-eol)) @@ -6556,13 +6561,9 @@ Return non-nil if the buffer was actually modified." nil (list temp nil) nil "-m" "isort" "-" args)) (tick (buffer-chars-modified-tick))) - (cond - ((eq 1 status) + (unless (eq 0 status) (error "%s exited with status %s (maybe isort is missing?)" python-interpreter status)) - ((eq 2 status) - (error "%s exited with status %s (maybe isort version is <5.7.0?)" - python-interpreter status))) (replace-buffer-contents temp) (not (eq tick (buffer-chars-modified-tick))))))))) diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index c6667c075f6..89d62ab3a61 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -4200,7 +4200,7 @@ must tell Emacs. Here's how to do that in your init file: (put 'sql-interactive-mode 'mode-class 'special) (put 'sql-interactive-mode 'custom-mode-group 'SQL) -;; FIXME: Why not use `define-derived-mode'? + (define-derived-mode sql-interactive-mode comint-mode "SQLi[?]" "Major mode to use a SQL interpreter interactively. diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 09937a60988..09d0250515f 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el @@ -86,6 +86,17 @@ long time to send the information, you can use this option to delay activation of Which Function until Imenu is used for the first time." :type '(repeat (symbol :tag "Major mode"))) +(defcustom which-func-display 'mode + "Where to display the function name. + +If `mode', display in the mode line. If `header', display in the +header line. If `mode-and-header', display in both." + :type '(choice (const :tag "Display in mode line" mode) + (const :tag "Display in header line" header) + (const :tag "Display in both header and mode line" + mode-and-header)) + :version "30.1") + (defcustom which-func-maxout 500000 "Don't automatically compute the Imenu menu if buffer is this big or bigger. Zero means compute the Imenu menu regardless of size. @@ -184,17 +195,35 @@ and you want to simplify them for the mode line ;;;###autoload (put 'which-func-current 'risky-local-variable t) (defvar-local which-func-mode nil - "Non-nil means display current function name in mode line. + "Non-nil means display current function name in mode or header line. This makes a difference only if variable `which-function-mode' is non-nil.") +(defvar-local which-func--use-header-line nil + "If non-nil, display the function name in the header line.") + +(defvar-local which-func--use-mode-line nil + "If non-nil, display the function name in the mode line.") + (add-hook 'after-change-major-mode-hook #'which-func-ff-hook t) (defun which-func-try-to-enable () (unless (or (not which-function-mode) (local-variable-p 'which-func-mode)) (setq which-func-mode (or (eq which-func-modes t) - (member major-mode which-func-modes))))) + (member major-mode which-func-modes))) + (setq which-func--use-mode-line + (member which-func-display '(mode mode-and-header))) + (setq which-func--use-header-line + (member which-func-display '(header mode-and-header))) + (when (and which-func-mode which-func--use-header-line) + (add-to-list 'header-line-format '("" which-func-format " "))))) + +(defun which-func--disable () + (when (and which-func-mode which-func--use-header-line) + (setq header-line-format + (delete '("" which-func-format " ") header-line-format))) + (setq which-func-mode nil)) (defun which-func-ff-hook () "`after-change-major-mode-hook' for Which Function mode. @@ -210,10 +239,10 @@ It creates the Imenu index for the buffer, if necessary." (setq imenu--index-alist (save-excursion (funcall imenu-create-index-function)))) (imenu-unavailable - (setq which-func-mode nil)) + (which-func--disable)) (error (message "which-func-ff-hook error: %S" err) - (setq which-func-mode nil)))) + (which-func--disable)))) (defun which-func-update () "Update the Which-Function mode display in the current window." @@ -231,7 +260,7 @@ It creates the Imenu index for the buffer, if necessary." (puthash window current which-func-table) (force-mode-line-update))) (error - (setq which-func-mode nil) + (which-func--disable) (error "Error in which-func-update: %S" info)))))) (defvar which-func-update-timer nil) @@ -241,7 +270,8 @@ It creates the Imenu index for the buffer, if necessary." (add-to-list 'mode-line-misc-info '(which-function-mode ;Only display if mode is enabled. (which-func-mode ;Only display if buffer supports it. - ("" which-func-format " "))))) + (which-func--use-mode-line + ("" which-func-format " ")))))) ;; This is the name people would normally expect. ;;;###autoload diff --git a/lisp/simple.el b/lisp/simple.el index 905df12c30c..e21976c30ee 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5652,8 +5652,14 @@ argument should still be a \"useful\" string for such uses." (if (fboundp 'menu-bar-update-yank-menu) (menu-bar-update-yank-menu string (and replace (car kill-ring))))) (when save-interprogram-paste-before-kill - (let ((interprogram-paste (and interprogram-paste-function - (funcall interprogram-paste-function)))) + (let ((interprogram-paste + (and interprogram-paste-function + ;; On X, the selection owner might be slow, so the user might + ;; interrupt this. If they interrupt it, we want to continue + ;; so we become selection owner, so this doesn't stay slow. + (if (eq (window-system) 'x) + (ignore-error quit (funcall interprogram-paste-function)) + (funcall interprogram-paste-function))))) (when interprogram-paste (setq interprogram-paste (if (listp interprogram-paste) diff --git a/lisp/subr.el b/lisp/subr.el index 2d52ecf201f..04f89f77d17 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4099,11 +4099,11 @@ See also `locate-user-emacs-file'.") The current restrictions, if any, are restored upon return. -When the optional :label LABEL argument is present, in which -LABEL is a symbol, inside BODY, `narrow-to-region' and `widen' -can be used only within the START and END limits. To gain access -to other portions of the buffer, use `without-restriction' with the -same LABEL argument. +When the optional LABEL argument, which is evaluated to get the +label to use and must yield a non-nil value, is present, inside +BODY, `narrow-to-region' and `widen' can be used only within the +START and END limits. To gain access to other portions of the +buffer, use `without-restriction' with the same LABEL argument. \(fn START END [:label LABEL] BODY)" (declare (indent 2) (debug t)) @@ -4115,8 +4115,9 @@ same LABEL argument. (defun internal--with-restriction (start end body &optional label) "Helper function for `with-restriction', which see." (save-restriction - (narrow-to-region start end) - (if label (internal--label-restriction label)) + (if label + (internal--labeled-narrow-to-region start end label) + (narrow-to-region start end)) (funcall body))) (defmacro without-restriction (&rest rest) @@ -4124,9 +4125,8 @@ same LABEL argument. The current restrictions, if any, are restored upon return. -When the optional :label LABEL argument is present, the -restrictions set by `with-restriction' with the same LABEL argument -are lifted. +When the optional LABEL argument is present, the restrictions set +by `with-restriction' with the same LABEL argument are lifted. \(fn [:label LABEL] BODY)" (declare (indent 0) (debug t)) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index b4f5ebf5cd0..d80cdc34775 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -66,7 +66,7 @@ When 2, attribute indentation looks like this: " :version "25.1" :type 'integer - :safe 'integerp) + :safe #'integerp) (defcustom sgml-xml-mode nil "When non-nil, tag insertion functions will be XML-compliant. @@ -81,7 +81,7 @@ a DOCTYPE or an XML declaration." (defcustom sgml-transformation-function 'identity "Default value for `skeleton-transformation-function' in SGML mode." :type 'function - :initialize 'custom-initialize-default + :initialize #'custom-initialize-default :set (lambda (sym val) (set-default sym val) (mapc (lambda (buff) @@ -120,40 +120,40 @@ This takes effect when first loading the `sgml-mode' library.") (defvar sgml-mode-map (let ((map (make-keymap))) ;`sparse' doesn't allow binding to charsets. - (define-key map "\C-c\C-i" 'sgml-tags-invisible) - (define-key map "/" 'sgml-slash) - (define-key map "\C-c\C-n" 'sgml-name-char) - (define-key map "\C-c\C-t" 'sgml-tag) - (define-key map "\C-c\C-a" 'sgml-attributes) - (define-key map "\C-c\C-b" 'sgml-skip-tag-backward) - (define-key map [?\C-c left] 'sgml-skip-tag-backward) - (define-key map "\C-c\C-f" 'sgml-skip-tag-forward) - (define-key map [?\C-c right] 'sgml-skip-tag-forward) - (define-key map "\C-c\C-d" 'sgml-delete-tag) - (define-key map "\C-c\^?" 'sgml-delete-tag) - (define-key map "\C-c?" 'sgml-tag-help) - (define-key map "\C-c]" 'sgml-close-tag) - (define-key map "\C-c/" 'sgml-close-tag) + (define-key map "\C-c\C-i" #'sgml-tags-invisible) + (define-key map "/" #'sgml-slash) + (define-key map "\C-c\C-n" #'sgml-name-char) + (define-key map "\C-c\C-t" #'sgml-tag) + (define-key map "\C-c\C-a" #'sgml-attributes) + (define-key map "\C-c\C-b" #'sgml-skip-tag-backward) + (define-key map [?\C-c left] #'sgml-skip-tag-backward) + (define-key map "\C-c\C-f" #'sgml-skip-tag-forward) + (define-key map [?\C-c right] #'sgml-skip-tag-forward) + (define-key map "\C-c\C-d" #'sgml-delete-tag) + (define-key map "\C-c\^?" #'sgml-delete-tag) + (define-key map "\C-c?" #'sgml-tag-help) + (define-key map "\C-c]" #'sgml-close-tag) + (define-key map "\C-c/" #'sgml-close-tag) ;; Redundant keybindings, for consistency with TeX mode. - (define-key map "\C-c\C-o" 'sgml-tag) - (define-key map "\C-c\C-e" 'sgml-close-tag) + (define-key map "\C-c\C-o" #'sgml-tag) + (define-key map "\C-c\C-e" #'sgml-close-tag) - (define-key map "\C-c8" 'sgml-name-8bit-mode) - (define-key map "\C-c\C-v" 'sgml-validate) + (define-key map "\C-c8" #'sgml-name-8bit-mode) + (define-key map "\C-c\C-v" #'sgml-validate) (when sgml-quick-keys - (define-key map "&" 'sgml-name-char) - (define-key map "<" 'sgml-tag) - (define-key map " " 'sgml-auto-attributes) - (define-key map ">" 'sgml-maybe-end-tag) + (define-key map "&" #'sgml-name-char) + (define-key map "<" #'sgml-tag) + (define-key map " " #'sgml-auto-attributes) + (define-key map ">" #'sgml-maybe-end-tag) (when (memq ?\" sgml-specials) - (define-key map "\"" 'sgml-name-self)) + (define-key map "\"" #'sgml-name-self)) (when (memq ?' sgml-specials) - (define-key map "'" 'sgml-name-self))) + (define-key map "'" #'sgml-name-self))) (let ((c 127) (map (nth 1 map))) (while (< (setq c (1+ c)) 256) - (aset map c 'sgml-maybe-name-self))) + (aset map c #'sgml-maybe-name-self))) map) "Keymap for SGML mode. See also `sgml-specials'.") @@ -312,28 +312,28 @@ Any terminating `>' or `/' is not matched.") ;; internal (defconst sgml-font-lock-keywords-1 - `((,(concat "<\\([!?]" sgml-name-re "\\)") 1 font-lock-keyword-face) + `((,(concat "<\\([!?]" sgml-name-re "\\)") 1 'font-lock-keyword-face) ;; We could use the simpler "\\(" sgml-namespace-re ":\\)?" instead, ;; but it would cause a bit more backtracking in the re-matcher. (,(concat "]*\\)?>\\([^<]+\\)") '(3 (cdr (assoc-string (match-string 1) sgml-tag-face-alist t)) prepend)))))) @@ -346,8 +346,8 @@ Any terminating `>' or `/' is not matched.") (defun sgml-font-lock-syntactic-face (state) "`font-lock-syntactic-face-function' for `sgml-mode'." ;; Don't use string face outside of tags. - (cond ((and (nth 9 state) (nth 3 state)) font-lock-string-face) - ((nth 4 state) font-lock-comment-face))) + (cond ((and (nth 9 state) (nth 3 state)) 'font-lock-string-face) + ((nth 4 state) 'font-lock-comment-face))) (defvar-local sgml--syntax-propertize-ppss nil) @@ -511,7 +511,7 @@ an optional alist of possible values." (looking-at "\\s-*<\\?xml") (when (re-search-forward (eval-when-compile - (mapconcat 'identity + (mapconcat #'identity '("")) (reverse tag-face) "")) - (mapconcat (lambda (f) (concat "<" f ">")) tag-face "")) + (mapconcat (lambda (f) (concat "")) (reverse tag-face))) + (mapconcat (lambda (f) (concat "<" f ">")) tag-face)) ((and (consp face) (consp (car face)) (null (cdr face)) @@ -593,7 +593,8 @@ Do \\[describe-key] on the following bindings to discover what they do. (setq-local tildify-space-string (if (equal (decode-coding-string (encode-coding-string " " buffer-file-coding-system) - buffer-file-coding-system) " ") + buffer-file-coding-system) + " ") " " " ")) ;; FIXME: Use the fact that we're parsing the document already ;; rather than using regex-based filtering. @@ -616,12 +617,12 @@ Do \\[describe-key] on the following bindings to discover what they do. \[ \t]*")) (setq-local paragraph-separate (concat paragraph-start "$")) (setq-local adaptive-fill-regexp "[ \t]*") - (add-hook 'fill-nobreak-predicate 'sgml-fill-nobreak nil t) - (setq-local indent-line-function 'sgml-indent-line) + (add-hook 'fill-nobreak-predicate #'sgml-fill-nobreak nil t) + (setq-local indent-line-function #'sgml-indent-line) (setq-local comment-start "") - (setq-local comment-indent-function 'sgml-comment-indent) - (setq-local comment-line-break-function 'sgml-comment-indent-new-line) + (setq-local comment-indent-function #'sgml-comment-indent) + (setq-local comment-line-break-function #'sgml-comment-indent-new-line) (setq-local skeleton-further-elements '((completion-ignore-case t))) (setq-local skeleton-end-newline nil) (setq-local skeleton-end-hook @@ -637,7 +638,7 @@ Do \\[describe-key] on the following bindings to discover what they do. . sgml-font-lock-syntactic-face))) (setq-local syntax-propertize-function #'sgml-syntax-propertize) (setq-local syntax-ppss-table sgml-tag-syntax-table) - (setq-local facemenu-add-face-function 'sgml-mode-facemenu-add-face-function) + (setq-local facemenu-add-face-function #'sgml-mode-facemenu-add-face-function) (when (sgml-xml-guess) (setq-local sgml-xml-mode t)) (unless sgml-xml-mode @@ -997,9 +998,7 @@ Return non-nil if we skipped over matched tags." (point)))) (or (not endp) (eq (char-after cl-end) ?>))) (when clones - (message "sgml-electric-tag-pair-before-change-function: deleting old OLs") - (mapc 'delete-overlay clones)) - (message "sgml-electric-tag-pair-before-change-function: new clone") + (mapc #'delete-overlay clones)) (text-clone-create cl-start cl-end 'spread "[[:alnum:]-_.:]+") (setq sgml-electric-tag-pair-overlays (append (get-char-property (point) 'text-clones) @@ -1021,13 +1020,13 @@ an opening markup tag automatically updates the closing tag." (if sgml-electric-tag-pair-mode (progn (add-hook 'before-change-functions - 'sgml-electric-tag-pair-before-change-function + #'sgml-electric-tag-pair-before-change-function nil t) (unless sgml-electric-tag-pair-timer (setq sgml-electric-tag-pair-timer - (run-with-idle-timer 5 'repeat 'sgml-electric-tag-pair-flush-overlays)))) + (run-with-idle-timer 5 'repeat #'sgml-electric-tag-pair-flush-overlays)))) (remove-hook 'before-change-functions - 'sgml-electric-tag-pair-before-change-function + #'sgml-electric-tag-pair-before-change-function t) ;; We leave the timer running for other buffers. )) @@ -1781,8 +1780,8 @@ Currently just returns (EMPTY-TAGS UNCLOSED-TAGS)." (push (match-string-no-properties 1) empty)) ((string= (match-string 2) "O") (push (match-string-no-properties 1) unclosed)))) - (setq empty (sort (mapcar 'downcase empty) 'string<)) - (setq unclosed (sort (mapcar 'downcase unclosed) 'string<)) + (setq empty (sort (mapcar #'downcase empty) #'string<)) + (setq unclosed (sort (mapcar #'downcase unclosed) #'string<)) (list empty unclosed))) ;;; HTML mode @@ -1801,41 +1800,41 @@ This takes effect when first loading the library.") (defvar html-mode-map (let ((map (make-sparse-keymap))) (set-keymap-parent map sgml-mode-map) - (define-key map "\C-c6" 'html-headline-6) - (define-key map "\C-c5" 'html-headline-5) - (define-key map "\C-c4" 'html-headline-4) - (define-key map "\C-c3" 'html-headline-3) - (define-key map "\C-c2" 'html-headline-2) - (define-key map "\C-c1" 'html-headline-1) - (define-key map "\C-c\r" 'html-paragraph) - (define-key map "\C-c\n" 'html-line) - (define-key map "\C-c\C-c-" 'html-horizontal-rule) - (define-key map "\C-c\C-co" 'html-ordered-list) - (define-key map "\C-c\C-cu" 'html-unordered-list) - (define-key map "\C-c\C-cr" 'html-radio-buttons) - (define-key map "\C-c\C-cc" 'html-checkboxes) - (define-key map "\C-c\C-cl" 'html-list-item) - (define-key map "\C-c\C-ch" 'html-href-anchor) - (define-key map "\C-c\C-cf" 'html-href-anchor-file) - (define-key map "\C-c\C-cn" 'html-name-anchor) - (define-key map "\C-c\C-c#" 'html-id-anchor) - (define-key map "\C-c\C-ci" 'html-image) + (define-key map "\C-c6" #'html-headline-6) + (define-key map "\C-c5" #'html-headline-5) + (define-key map "\C-c4" #'html-headline-4) + (define-key map "\C-c3" #'html-headline-3) + (define-key map "\C-c2" #'html-headline-2) + (define-key map "\C-c1" #'html-headline-1) + (define-key map "\C-c\r" #'html-paragraph) + (define-key map "\C-c\n" #'html-line) + (define-key map "\C-c\C-c-" #'html-horizontal-rule) + (define-key map "\C-c\C-co" #'html-ordered-list) + (define-key map "\C-c\C-cu" #'html-unordered-list) + (define-key map "\C-c\C-cr" #'html-radio-buttons) + (define-key map "\C-c\C-cc" #'html-checkboxes) + (define-key map "\C-c\C-cl" #'html-list-item) + (define-key map "\C-c\C-ch" #'html-href-anchor) + (define-key map "\C-c\C-cf" #'html-href-anchor-file) + (define-key map "\C-c\C-cn" #'html-name-anchor) + (define-key map "\C-c\C-c#" #'html-id-anchor) + (define-key map "\C-c\C-ci" #'html-image) (when html-quick-keys - (define-key map "\C-c-" 'html-horizontal-rule) - (define-key map "\C-cd" 'html-div) - (define-key map "\C-co" 'html-ordered-list) - (define-key map "\C-cu" 'html-unordered-list) - (define-key map "\C-cr" 'html-radio-buttons) - (define-key map "\C-cc" 'html-checkboxes) - (define-key map "\C-cl" 'html-list-item) - (define-key map "\C-ch" 'html-href-anchor) - (define-key map "\C-cf" 'html-href-anchor-file) - (define-key map "\C-cn" 'html-name-anchor) - (define-key map "\C-c#" 'html-id-anchor) - (define-key map "\C-ci" 'html-image) - (define-key map "\C-cs" 'html-span)) - (define-key map "\C-c\C-s" 'html-autoview-mode) - (define-key map "\C-c\C-v" 'browse-url-of-buffer) + (define-key map "\C-c-" #'html-horizontal-rule) + (define-key map "\C-cd" #'html-div) + (define-key map "\C-co" #'html-ordered-list) + (define-key map "\C-cu" #'html-unordered-list) + (define-key map "\C-cr" #'html-radio-buttons) + (define-key map "\C-cc" #'html-checkboxes) + (define-key map "\C-cl" #'html-list-item) + (define-key map "\C-ch" #'html-href-anchor) + (define-key map "\C-cf" #'html-href-anchor-file) + (define-key map "\C-cn" #'html-name-anchor) + (define-key map "\C-c#" #'html-id-anchor) + (define-key map "\C-ci" #'html-image) + (define-key map "\C-cs" #'html-span)) + (define-key map "\C-c\C-s" #'html-autoview-mode) + (define-key map "\C-c\C-v" #'browse-url-of-buffer) (define-key map "\M-o" 'facemenu-keymap) map) "Keymap for commands for use in HTML mode.") @@ -2405,7 +2404,7 @@ To work around that, do: (lambda () (char-before (match-end 0)))) (setq-local add-log-current-defun-function #'html-current-defun-name) (setq-local sentence-end-base "[.?!][]\"'”)}]*\\(<[^>]*>\\)*") - (add-hook 'completion-at-point-functions 'html-mode--complete-at-point nil t) + (add-hook 'completion-at-point-functions #'html-mode--complete-at-point nil t) (when (fboundp 'libxml-parse-html-region) (defvar css-class-list-function) @@ -2413,7 +2412,7 @@ To work around that, do: (defvar css-id-list-function) (setq-local css-id-list-function #'html-current-buffer-ids)) - (setq imenu-create-index-function 'html-imenu-index) + (setq imenu-create-index-function #'html-imenu-index) (yank-media-handler 'text/html #'html-mode--html-yank-handler) (yank-media-handler "image/.*" #'html-mode--image-yank-handler) diff --git a/src/comp.c b/src/comp.c index 3c63cad18c7..1bde4ae5821 100644 --- a/src/comp.c +++ b/src/comp.c @@ -502,9 +502,11 @@ load_gccjit_if_necessary (bool mandatory) #define THIRD(x) \ XCAR (XCDR (XCDR (x))) +#if 0 /* unused for now */ /* Like call0 but stringify and intern. */ #define CALL0I(fun) \ CALLN (Ffuncall, intern_c_string (STR (fun))) +#endif /* Like call1 but stringify and intern. */ #define CALL1I(fun, arg) \ diff --git a/src/editfns.c b/src/editfns.c index 8164316aabe..a3e4ca12028 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2690,11 +2690,12 @@ DEFUN ("delete-and-extract-region", Fdelete_and_extract_region, records the restriction bounds that were current when the first labeled restriction was entered (which may be a narrowing that was set by the user and is visible on display). This alist is used - internally by narrow-to-region, widen, internal--label-restriction, - internal--unlabel-restriction and save-restriction. For efficiency - reasons, an alist is used instead of a buffer-local variable: - otherwise reset_outermost_restrictions, which is called during each - redisplay cycle, would have to loop through all live buffers. */ + internally by narrow-to-region, internal--labeled-narrow-to-region, + widen, internal--unlabel-restriction and save-restriction. For + efficiency reasons, an alist is used instead of a buffer-local + variable: otherwise reset_outermost_restrictions, which is called + during each redisplay cycle, would have to loop through all live + buffers. */ static Lisp_Object labeled_restrictions; /* Add BUF with its list of labeled RESTRICTIONS in the @@ -2876,8 +2877,7 @@ void labeled_narrow_to_region (Lisp_Object begv, Lisp_Object zv, Lisp_Object label) { - Fnarrow_to_region (begv, zv); - Finternal__label_restriction (label); + Finternal__labeled_narrow_to_region (begv, zv, label); record_unwind_protect (restore_point_unwind, Fpoint_marker ()); record_unwind_protect (unwind_labeled_narrow_to_region, label); } @@ -2893,7 +2893,6 @@ To gain access to other portions of the buffer, use `without-restriction' with the same label. */) (void) { - Fset (Qoutermost_restriction, Qnil); Lisp_Object buf = Fcurrent_buffer (); Lisp_Object label = labeled_restrictions_peek_label (buf); @@ -2975,13 +2974,6 @@ argument. To gain access to other portions of the buffer, use if (e > zv_charpos) e = zv_charpos; } - /* Record the accessible range of the buffer when narrow-to-region - is called, that is, before applying the narrowing. That - information is used only by internal--label-restriction. */ - Fset (Qoutermost_restriction, list3 (Qoutermost_restriction, - Fpoint_min_marker (), - Fpoint_max_marker ())); - if (BEGV != s || ZV != e) current_buffer->clip_changed = 1; @@ -2997,20 +2989,18 @@ argument. To gain access to other portions of the buffer, use return Qnil; } -DEFUN ("internal--label-restriction", Finternal__label_restriction, - Sinternal__label_restriction, 1, 1, 0, - doc: /* Label the current restriction with LABEL. +DEFUN ("internal--labeled-narrow-to-region", Finternal__labeled_narrow_to_region, + Sinternal__labeled_narrow_to_region, 3, 3, 0, + doc: /* Restrict editing in this buffer to START-END, and label the restriction with LABEL. This is an internal function used by `with-restriction'. */) - (Lisp_Object label) + (Lisp_Object start, Lisp_Object end, Lisp_Object label) { Lisp_Object buf = Fcurrent_buffer (); - Lisp_Object outermost_restriction - = buffer_local_value (Qoutermost_restriction, buf); - /* If internal--label-restriction is ever called without being - preceded by narrow-to-region, do nothing. */ - if (NILP (outermost_restriction)) - return Qnil; + Lisp_Object outermost_restriction = list3 (Qoutermost_restriction, + Fpoint_min_marker (), + Fpoint_max_marker ()); + Fnarrow_to_region (start, end); if (NILP (labeled_restrictions_peek_label (buf))) labeled_restrictions_push (buf, outermost_restriction); labeled_restrictions_push (buf, list3 (label, @@ -4873,10 +4863,6 @@ This variable is experimental; email 32252@debbugs.gnu.org if you need it to be non-nil. */); binary_as_unsigned = false; - DEFVAR_LISP ("outermost-restriction", Voutermost_restriction, - doc: /* Outermost narrowing bounds, if any. Internal use only. */); - Voutermost_restriction = Qnil; - Fmake_variable_buffer_local (Qoutermost_restriction); DEFSYM (Qoutermost_restriction, "outermost-restriction"); Funintern (Qoutermost_restriction, Qnil); @@ -4971,7 +4957,7 @@ it to be non-nil. */); defsubr (&Sdelete_and_extract_region); defsubr (&Swiden); defsubr (&Snarrow_to_region); - defsubr (&Sinternal__label_restriction); + defsubr (&Sinternal__labeled_narrow_to_region); defsubr (&Sinternal__unlabel_restriction); defsubr (&Ssave_restriction); defsubr (&Stranspose_regions); diff --git a/src/gnutls.c b/src/gnutls.c index 8f0e2d01703..e3f1093d977 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -51,6 +51,10 @@ along with GNU Emacs. If not, see . */ # define HAVE_GNUTLS_ETM_STATUS # endif +# if GNUTLS_VERSION_NUMBER >= 0x030401 +# define HAVE_GNUTLS_KEYID_USE_SHA256 +# endif + # if GNUTLS_VERSION_NUMBER < 0x030600 # define HAVE_GNUTLS_COMPRESSION_GET # endif @@ -1278,6 +1282,23 @@ emacs_gnutls_certificate_details (gnutls_x509_crt_t cert) xfree (buf); } +#ifdef HAVE_GNUTLS_KEYID_USE_SHA256 + /* Public key ID, SHA-256 version. */ + buf_size = 0; + err = gnutls_x509_crt_get_key_id (cert, GNUTLS_KEYID_USE_SHA256, NULL, &buf_size); + check_memory_full (err); + if (err == GNUTLS_E_SHORT_MEMORY_BUFFER) + { + void *buf = xmalloc (buf_size); + err = gnutls_x509_crt_get_key_id (cert, GNUTLS_KEYID_USE_SHA256, buf, &buf_size); + check_memory_full (err); + if (err >= GNUTLS_E_SUCCESS) + res = nconc2 (res, list2 (intern (":public-key-id-sha256"), + gnutls_hex_string (buf, buf_size, "sha256:"))); + xfree (buf); + } +#endif + /* Certificate fingerprint. */ buf_size = 0; err = gnutls_x509_crt_get_fingerprint (cert, GNUTLS_DIG_SHA1, diff --git a/src/lisp.h b/src/lisp.h index 9a4cdec2815..4be0002e9fc 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -337,7 +337,14 @@ typedef EMACS_INT Lisp_Word; see these functions for commentary. */ /* Convert among the various Lisp-related types: I for EMACS_INT, L - for Lisp_Object, P for void *. */ + for Lisp_Object, P for void *. + + These use the following mnemonics: + + XLI: Lisp_Object to Integer; + XIL: Integer to Lisp_Object; + XLP: Lisp_Object to Pointer. */ + #if !CHECK_LISP_OBJECT_TYPE # if LISP_WORDS_ARE_POINTERS # define lisp_h_XLI(o) ((EMACS_INT) (o)) @@ -2590,20 +2597,14 @@ struct Lisp_Marker ptrdiff_t bytepos; } GCALIGNED_STRUCT; -/* START and END are markers in the overlay's buffer, and - PLIST is the overlay's property list. */ struct Lisp_Overlay /* An overlay's real data content is: - plist - - buffer (really there are two buffer pointers, one per marker, - and both points to the same buffer) - - insertion type of both ends (per-marker fields) - - start & start byte (of start marker) - - end & end byte (of end marker) - - next (singly linked list of overlays) - - next fields of start and end markers (singly linked list of markers). - I.e. 9words plus 2 bits, 3words of which are for external linked lists. -*/ + - buffer + - itree node + - start buffer position (field of the itree node) + - end buffer position (field of the itree node) + - insertion types of both ends (fields of the itree node). */ { union vectorlike_header header; Lisp_Object plist;