commit 5a9937beb6347b330ddbb942c9c6f7ce1abb67c9 (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Sat Apr 13 11:01:39 2019 +0300 Minor cleanup in 'x_set_frame_alpha' * src/xterm.c (x_set_frame_alpha): Remove redundant parts of testing of value of 'alpha'. Suggested by Konstantin Kharlamov . (Bug#35062) diff --git a/src/xterm.c b/src/xterm.c index 5aa3e3ff25..def6915d62 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -922,16 +922,17 @@ x_set_frame_alpha (struct frame *f) else alpha = f->alpha[1]; + if (alpha < 0.0) + return; + if (FLOATP (Vframe_alpha_lower_limit)) alpha_min = XFLOAT_DATA (Vframe_alpha_lower_limit); else if (FIXNUMP (Vframe_alpha_lower_limit)) alpha_min = (XFIXNUM (Vframe_alpha_lower_limit)) / 100.0; - if (alpha < 0.0) - return; - else if (alpha > 1.0) + if (alpha > 1.0) alpha = 1.0; - else if (0.0 <= alpha && alpha < alpha_min && alpha_min <= 1.0) + else if (alpha < alpha_min && alpha_min <= 1.0) alpha = alpha_min; opac = alpha * OPAQUE; commit d82d4fb9157dd86359e4489c8da100943754a4d0 Author: Eli Zaretskii Date: Sat Apr 13 10:42:14 2019 +0300 Improve documentation of JSONRPC * doc/lispref/text.texi (JSONRPC Overview) (Process-based JSONRPC connections) (JSONRPC JSON object format): Fix wording and markup. Add indexing. diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index e8de8177e3..500df1f8f0 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -5197,11 +5197,12 @@ the value if contains a valid JSON object; otherwise it signals the @node JSONRPC @section JSONRPC communication @cindex JSON remote procedure call protocol +@cindex JSONRPC The @code{jsonrpc} library implements the @acronym{JSONRPC} specification, version 2.0, as it is described in @uref{http://www.jsonrpc.org/}. As the name suggests, JSONRPC is a -generic @code{Remote Procedure Call} protocol designed around +generic @dfn{Remote Procedure Call} protocol designed around @acronym{JSON} objects, which you can convert to and from Lisp objects (@pxref{Parsing JSON}). @@ -5220,81 +5221,96 @@ transport agnostic in that the concepts can be used within the same process, over sockets, over http, or in many various message passing environments." +@findex jsonrpc-connection To model this agnosticism, the @code{jsonrpc} library uses objects of -a @code{jsonrpc-connection} class, which represent a connection the +a @code{jsonrpc-connection} class, which represent a connection to a remote JSON endpoint (for details on Emacs's object system, @pxref{Top,EIEIO,,eieio,EIEIO}). In modern object-oriented parlance, -this class is ``abstract'', i.e. the actual class of a useful -connection object used is always a subclass of it. Nevertheless, we -can define two distinct API's around the @code{jsonrpc-connection} -class: +this class is ``abstract'', i.e.@: the actual class of a useful +connection object is always a subclass of @code{jsonrpc-connection}. +Nevertheless, we can define two distinct APIs around the +@code{jsonrpc-connection} class: +@cindex JSONRPC application interfaces @enumerate @item A user interface for building JSONRPC applications +@findex :request-dispatcher +@findex :notification-dispatcher +@findex jsonrpc-notify +@findex jsonrpc-request +@findex jsonrpc-async-request In this scenario, the JSONRPC application selects a concrete subclass of @code{jsonrpc-connection}, and proceeds to create objects of that subclass using @code{make-instance}. To initiate a contact to the remote endpoint, the JSONRPC application passes this object to the -functions @code{jsonrpc-notify'}, @code{jsonrpc-request} and +functions @code{jsonrpc-notify}, @code{jsonrpc-request}, and/or @code{jsonrpc-async-request}. For handling remotely initiated contacts, which generally come in asynchronously, the instantiation should include @code{:request-dispatcher} and @code{:notification-dispatcher} initargs, which are both functions of 3 arguments: the connection object; a symbol naming the JSONRPC method -invoked remotely; and a JSONRPC "params" object. +invoked remotely; and a JSONRPC @code{params} object. +@findex jsonrpc-error The function passed as @code{:request-dispatcher} is responsible for handling the remote endpoint's requests, which expect a reply from the local endpoint (in this case, the program you're building). Inside -that function, you may either return locally (normally) or non-locally -(error). A local return value must be a Lisp object serializable as -JSON (@pxref{Parsing JSON}). This determines a success response, and -the object is forwarded to the server as the JSONRPC "result" object. -A non-local return, achieved by calling the function -@code{jsonrpc-error}, causes an error response to be sent to the -server. The details of the accompanying JSONRPC "error" are filled -out with whatever was passed to @code{jsonrpc-error}. A non-local -return triggered by an unexpected error of any other type also causes -an error response to be sent (unless you have set -@code{debug-on-error}, in which case this should land you in the -debugger, @pxref{Error Debugging}). +that function, you may either return locally (a normal return) or +non-locally (an error return). A local return value must be a Lisp +object that can be serialized as JSON (@pxref{Parsing JSON}). This +determines a success response, and the object is forwarded to the +server as the JSONRPC @code{result} object. A non-local return, +achieved by calling the function @code{jsonrpc-error}, causes an error +response to be sent to the server. The details of the accompanying +JSONRPC @code{error} are filled out with whatever was passed to +@code{jsonrpc-error}. A non-local return triggered by an unexpected +error of any other type also causes an error response to be sent +(unless you have set @code{debug-on-error}, in which case this calls +the Lisp debugger, @pxref{Error Debugging}). @item A inheritance interface for building JSONRPC transport implementations In this scenario, @code{jsonrpc-connection} is subclassed to implement a different underlying transport strategy (for details on how to -subclass, @pxref{Inheritance,Inheritance,,eieio}). Users of the +subclass, see @ref{Inheritance,Inheritance,,eieio}.). Users of the application-building interface can then instantiate objects of this concrete class (using the @code{make-instance} function) and connect to JSONRPC endpoints using that strategy. This API has mandatory and optional parts. +@findex jsonrpc-connection-send To allow its users to initiate JSONRPC contacts (notifications or -requests) or reply to endpoint requests, the method -@code{jsonrpc-connection-send} must be implemented for the subclass. +requests) or reply to endpoint requests, the subclass must have an +implementation of the @code{jsonrpc-connection-send} method. +@findex jsonrpc-connection-receive Likewise, for handling the three types of remote contacts (requests, -notifications and responses to local requests) the transport +notifications, and responses to local requests), the transport implementation must arrange for the function @code{jsonrpc-connection-receive} to be called after noticing a new JSONRPC message on the wire (whatever that "wire" may be). +@findex jsonrpc-shutdown +@findex jsonrpc-running-p Finally, and optionally, the @code{jsonrpc-connection} subclass should -implement @code{jsonrpc-shutdown} and @code{jsonrpc-running-p} if -these concepts apply to the transport. If they do, then any system -resources (e.g. processes, timers, etc..) used listen for messages on -the wire should be released in @code{jsonrpc-shutdown}, i.e. they -should only be needed while @code{jsonrpc-running-p} is non-nil. +implement the @code{jsonrpc-shutdown} and @code{jsonrpc-running-p} +methods if these concepts apply to the transport. If they do, then +any system resources (e.g.@: processes, timers, etc.) used to listen for +messages on the wire should be released in @code{jsonrpc-shutdown}, +i.e.@: they should only be needed while @code{jsonrpc-running-p} is +non-nil. @end enumerate @node Process-based JSONRPC connections @subsection Process-based JSONRPC connections +@cindex JSONRPC process-based connections -For convenience, the @code{jsonrpc} library comes built-in with a +@findex jsonrpc-process-connection +For convenience, the @code{jsonrpc} library comes with a built-in @code{jsonrpc-process-connection} transport implementation that can talk to local subprocesses (using the standard input and standard output); or TCP hosts (using sockets); or any other remote endpoint @@ -5309,6 +5325,7 @@ JSONRPC, see the @uref{https://microsoft.github.io/language-server-protocol/specification, Language Server Protocol}. +@cindex JSONRPC connection initargs Along with the mandatory @code{:request-dispatcher} and @code{:notification-dispatcher} initargs, users of the @code{jsonrpc-process-connection} class should pass the following @@ -5317,29 +5334,32 @@ initargs as keyword-value pairs to @code{make-instance}: @table @code @item :process Value must be a live process object or a function of no arguments -producing one such object. If passed a process object, that is -expected to contain an pre-established connection; otherwise, the +producing one such object. If passed a process object, the object is +expected to contain a pre-established connection; otherwise, the function is called immediately after the object is made. @item :on-shutdown Value must be a function of a single argument, the @code{jsonrpc-process-connection} object. The function is called after the underlying process object has been deleted (either -deliberately by @code{jsonrpc-shutdown} or unexpectedly, because of +deliberately by @code{jsonrpc-shutdown}, or unexpectedly, because of some external cause). @end table @node JSONRPC JSON object format -@subsection JSON object format +@subsection JSONRPC JSON object format +@cindex JSONRPC object format -JSON objects are exchanged as Lisp plists (@pxref{Parsing JSON}): -JSON-compatible plists are handed to the dispatcher functions and, -likewise, JSON-compatible plists should be given to -@code{jsonrpc-notify}, @code{jsonrpc-request} and +JSONRPC JSON objects are exchanged as Lisp plists (@pxref{Property +Lists}): JSON-compatible plists are handed to the dispatcher functions +and, likewise, JSON-compatible plists should be given to +@code{jsonrpc-notify}, @code{jsonrpc-request}, and @code{jsonrpc-async-request}. -To facilitate handling plists, this library make liberal use of -@code{cl-lib} library and suggests (but doesn't force) its clients to +@findex jsonrpc-lambda +To facilitate handling plists, this library makes liberal use of +@code{cl-lib} library (@pxref{Top,cl-lib,,cl,Common Lisp Extensions +for GNU Emacs Lisp}) and suggests (but doesn't force) its clients to do the same. A macro @code{jsonrpc-lambda} can be used to create a lambda for destructuring a JSON-object like in this example: @@ -5355,7 +5375,8 @@ lambda for destructuring a JSON-object like in this example: @end example @node JSONRPC deferred requests -@subsection Deferred requests +@subsection Deferred JSONRPC requests +@cindex JSONRPC deferred requests In many @acronym{RPC} situations, synchronization between the two communicating endpoints is a matter of correctly designing the RPC @@ -5367,6 +5388,7 @@ is still uncertainty about the state of the remote endpoint. Furthermore, acting on these events may only sometimes demand synchronization, depending on the event's specific nature. +@findex :deferred@r{, JSONRPC keyword} The @code{:deferred} keyword argument to @code{jsonrpc-request} and @code{jsonrpc-async-request} is designed to let the caller indicate that the specific request needs synchronization and its actual @@ -5377,9 +5399,10 @@ isn't sent immediately, @code{jsonrpc} will make renewed efforts to send it at certain key times during communication, such as when receiving or sending other messages to the endpoint. +@findex jsonrpc-connection-ready-p Before any attempt to send the request, the application-specific -conditions are checked. Since the @code{jsonrpc} library can't known -what these conditions are, the programmer may use the +conditions are checked. Since the @code{jsonrpc} library can't know +what these conditions are, the program can use the @code{jsonrpc-connection-ready-p} generic function (@pxref{Generic Functions}) to specify them. The default method for this function returns @code{t}, but you can add overriding methods that return commit 2475687d2f0ca6a605d091bb7acb723d0dace27b Author: Eli Zaretskii Date: Sat Apr 13 10:07:15 2019 +0300 Improve documentation changes of a recent commit * doc/lispref/text.texi (Parsing JSON): Improve wording of the documentation of 'json-parse-string' and 'json-parse-buffer'. * src/json.c (Fjson_parse_string, Fjson_parse_buffer): Doc fix. (Bug#34763) diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index b46ee64786..e8de8177e3 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -5156,8 +5156,11 @@ as in @code{json-parse-string}. @defun json-parse-string string &rest args This function parses the JSON value in @var{string}, which must be a -Lisp string. The argument @var{args} is a list of keyword/argument -pairs. The following keywords are accepted: +Lisp string. If @var{string} doesn't contain a valid JSON object, +this function signals the @code{json-parse-error} error. + +The argument @var{args} is a list of keyword/argument pairs. The +following keywords are accepted: @table @code @item :object-type @@ -5186,9 +5189,9 @@ keyword @code{false}. It defaults to the symbol @code{:false}. @defun json-parse-buffer &rest args This function reads the next JSON value from the current buffer, starting at point. It moves point to the position immediately after -the value if a value could be read and converted to Lisp; otherwise it -doesn't move point. The arguments @var{args} are interpreted as in -@code{json-parse-string}. +the value if contains a valid JSON object; otherwise it signals the +@code{json-parse-error} error and doesn't move point. The arguments +@var{args} are interpreted as in @code{json-parse-string}. @end defun @node JSONRPC diff --git a/src/json.c b/src/json.c index eb323b498c..74e0534065 100644 --- a/src/json.c +++ b/src/json.c @@ -948,23 +948,22 @@ json_to_lisp (json_t *json, struct json_configuration *conf) DEFUN ("json-parse-string", Fjson_parse_string, Sjson_parse_string, 1, MANY, NULL, doc: /* Parse the JSON STRING into a Lisp object. - This is essentially the reverse operation of `json-serialize', which -see. The returned object will be a vector, hashtable, alist, or +see. The returned object will be a vector, list, hashtable, alist, or plist. Its elements will be the JSON null value, the JSON false value, t, numbers, strings, or further vectors, hashtables, alists, or plists. If there are duplicate keys in an object, all but the last -one are ignored. If STRING doesn't contain a valid JSON object, an -error of type `json-parse-error' is signaled. The arguments ARGS are -a list of keyword/argument pairs: +one are ignored. If STRING doesn't contain a valid JSON object, this +function signals an error of type `json-parse-error'. + +The arguments ARGS are a list of keyword/argument pairs: The keyword argument `:object-type' specifies which Lisp type is used to represent objects; it can be `hash-table', `alist' or `plist'. It defaults to `hash-table'. The keyword argument `:array-type' specifies which Lisp type is used -to represent arrays; it can be `array' or `list'. It defaults to -`array'. +to represent arrays; it can be `array' (the default) or `list'. The keyword argument `:null-object' specifies which object to use to represent a JSON null value. It defaults to `:null'. @@ -1042,9 +1041,32 @@ json_read_buffer_callback (void *buffer, size_t buflen, void *data) DEFUN ("json-parse-buffer", Fjson_parse_buffer, Sjson_parse_buffer, 0, MANY, NULL, doc: /* Read JSON object from current buffer starting at point. -This is similar to `json-parse-string', which see. Move point after -the end of the object if parsing was successful. On error, point is -not moved. +Move point after the end of the object if parsing was successful. +On error, don't move point. + +The returned object will be a vector, list, hashtable, alist, or +plist. Its elements will be the JSON null value, the JSON false +value, t, numbers, strings, or further vectors, lists, hashtables, +alists, or plists. If there are duplicate keys in an object, all +but the last one are ignored. + +If the current buffer doesn't contain a valid JSON object, the +function signals an error of type `json-parse-error'. + +The arguments ARGS are a list of keyword/argument pairs: + +The keyword argument `:object-type' specifies which Lisp type is used +to represent objects; it can be `hash-table', `alist' or `plist'. It +defaults to `hash-table'. + +The keyword argument `:array-type' specifies which Lisp type is used +to represent arrays; it can be `array' (the default) or `list'. + +The keyword argument `:null-object' specifies which object to use +to represent a JSON null value. It defaults to `:null'. + +The keyword argument `:false-object' specifies which object to use to +represent a JSON false value. It defaults to `:false'. usage: (json-parse-buffer &rest args) */) (ptrdiff_t nargs, Lisp_Object *args) { commit 7ddd08bd3ebc48998062a7d29274cf080256a48f Author: Paul Eggert Date: Fri Apr 12 19:43:16 2019 -0700 Omit/rewrite useless regexp repetitions Problem reported by Mattias Engdegård in: https://lists.gnu.org/r/emacs-devel/2019-04/msg00527.html * lisp/align.el (align-rules-list): * lisp/cedet/srecode/srt-mode.el (srecode-font-lock-keywords): * lisp/emacs-lisp/copyright.el (copyright-regexp): * lisp/erc/erc-backend.el (JOIN): * lisp/erc/erc-goodies.el (erc-unmorse): * lisp/mail/mail-extr.el (mail-extr-telephone-extension-pattern): * lisp/net/tramp-adb.el (tramp-adb-prompt): * lisp/org/org-table.el (org-table-range-regexp): * lisp/progmodes/idlwave.el (idlwave-where): * lisp/progmodes/verilog-mode.el (verilog-declaration-re-2-no-macro) (verilog-declaration-re-2-macro, verilog-delete-auto-buffer) (verilog-auto-inst-port): * lisp/url/url-misc.el (url-data): Omit or rewrite useless repetitions that risk being very slow in the backtracking regexp engine in Emacs. diff --git a/lisp/align.el b/lisp/align.el index fd88d0eda4..443237b451 100644 --- a/lisp/align.el +++ b/lisp/align.el @@ -411,7 +411,7 @@ The possible settings for `align-region-separate' are: (c-variable-declaration (regexp . ,(concat "[*&0-9A-Za-z_]>?[&*]*\\(\\s-+[*&]*\\)" "[A-Za-z_][0-9A-Za-z:_]*\\s-*\\(\\()\\|" - "=[^=\n].*\\|(.*)\\|\\(\\[.*\\]\\)*\\)?" + "=[^=\n].*\\|(.*)\\|\\(\\[.*\\]\\)*\\)" "\\s-*[;,]\\|)\\s-*$\\)")) (group . 1) (modes . align-c++-modes) diff --git a/lisp/cedet/srecode/srt-mode.el b/lisp/cedet/srecode/srt-mode.el index 2ad7ffcdb8..6bf2d51ab4 100644 --- a/lisp/cedet/srecode/srt-mode.el +++ b/lisp/cedet/srecode/srt-mode.el @@ -64,7 +64,7 @@ (defvar srecode-font-lock-keywords '( ;; Template - ("^\\(template\\)\\s-+\\(\\w*\\)\\(\\( \\(:\\w+\\)\\|\\)+\\)$" + ("^\\(template\\)\\s-+\\(\\w*\\)\\(\\( \\(:\\w+\\)\\)*\\)$" (1 font-lock-keyword-face) (2 font-lock-function-name-face) (3 font-lock-builtin-face )) diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index 2726bbc1f3..be335838e3 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -52,7 +52,7 @@ This is useful for ChangeLogs." (defcustom copyright-regexp "\\(©\\|@copyright{}\\|[Cc]opyright\\s *:?\\s *\\(?:(C)\\)?\ \\|[Cc]opyright\\s *:?\\s *©\\)\ -\\s *\\(?:[^0-9\n]*\\s *\\)?\ +\\s *[^0-9\n]*\\s *\ \\([1-9]\\([-0-9, ';/*%#\n\t]\\|\\s<\\|\\s>\\)*[0-9]+\\)" "What your copyright notice looks like. The second \\( \\) construct must match the years." diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 2854cde19c..210830a2b4 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -1285,7 +1285,7 @@ add things to `%s' instead." (pcase-let ((`(,nick ,login ,host) (erc-parse-user (erc-response.sender parsed)))) ;; strip the stupid combined JOIN facility (IRC 2.9) - (if (string-match "^\\(.*\\)?\^g.*$" chnl) + (if (string-match "^\\(.*\\)\^g.*$" chnl) (setq chnl (match-string 1 chnl))) (save-excursion (let* ((str (cond diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index 117b6783b8..884c594b9e 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el @@ -548,7 +548,7 @@ channel that has weird people talking in morse to each other. See also `unmorse-region'." (goto-char (point-min)) - (when (re-search-forward "[.-]+\\([.-]*/? *\\)+[.-]+/?" nil t) + (when (re-search-forward "[.-]+[./ -]*[.-]/?" nil t) (save-restriction (narrow-to-region (match-beginning 0) (match-end 0)) ;; Turn " / " into " " diff --git a/lisp/mail/mail-extr.el b/lisp/mail/mail-extr.el index cb57d8ea01..a0b9688650 100644 --- a/lisp/mail/mail-extr.el +++ b/lisp/mail/mail-extr.el @@ -383,7 +383,7 @@ by translating things like \"foo!bar!baz@host\" into \"baz@bar.UUCP\"." ;; Matches telephone extensions. (defconst mail-extr-telephone-extension-pattern (purecopy - "\\(\\([Ee]xt\\|\\|[Tt]ph\\|[Tt]el\\|[Xx]\\).?\\)? *\\+?[0-9][- 0-9]+")) + "\\(\\([Ee]xt\\|[Tt]ph\\|[Tt]el\\|[Xx]\\).?\\)? *\\+?[0-9][- 0-9]+")) ;; Matches ham radio call signs. ;; Help from: Mat Maessen N2NJZ , Mark Feit diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index db9acbfc63..f3aa55f16f 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -53,7 +53,7 @@ It is used for TCP/IP devices." "When this method name is used, forward all calls to Android Debug Bridge.") (defcustom tramp-adb-prompt - "^\\(?:[[:digit:]]*|?\\)?\\(?:[[:alnum:]\e;[]*@?[[:alnum:]]*[^#\\$]*\\)?[#\\$][[:space:]]" + "^[[:digit:]]*|?\\(?:[[:alnum:]\e;[]*@?[[:alnum:]]*[^#\\$]*\\)?[#\\$][[:space:]]" "Regexp used as prompt in almquist shell." :type 'string :version "24.4" diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el index b6e864fc9c..147527da1d 100644 --- a/lisp/org/org-table.el +++ b/lisp/org/org-table.el @@ -484,8 +484,8 @@ Line numbers are counted from the beginning of the table. This variable is initialized with `org-table-analyze'.") (defconst org-table-range-regexp - "@\\([-+]?I*[-+]?[0-9]*\\)?\\(\\$[-+]?[0-9]+\\)?\\(\\.\\.@?\\([-+]?I*[-+]?[0-9]*\\)?\\(\\$[-+]?[0-9]+\\)?\\)?" - ;; 1 2 3 4 5 + "@\\([-+]?I*[-+]?[0-9]*\\)\\(\\$[-+]?[0-9]+\\)?\\(\\.\\.@?\\([-+]?I*[-+]?[0-9]*\\)\\(\\$[-+]?[0-9]+\\)?\\)?" + ;; 1 2 3 4 5 "Regular expression for matching ranges in formulas.") (defconst org-table-range-regexp2 diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index bded09d503..6f56ce052a 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -6454,10 +6454,10 @@ ARROW: Location of the arrow" ((string-match "\\`[ \t]*\\(pro\\|function\\)\\>" match-string) nil) - ((string-match "OBJ_NEW([ \t]*['\"]\\([a-zA-Z0-9$_]*\\)?\\'" + ((string-match "OBJ_NEW([ \t]*['\"][a-zA-Z0-9$_]*\\'" match-string) (setq cw 'class)) - ((string-match "\\ Date: Sat Apr 13 03:36:45 2019 +0300 Don't signal error from url debug functions * lisp/url/url-http.el (url-http-debug): Don't signal error. * lisp/url/url-util.el (url-debug): Same (bug#34763). diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index cf1952066a..662b6664b1 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -150,15 +150,6 @@ request.") ;; These routines will allow us to implement persistent HTTP ;; connections. (defsubst url-http-debug (&rest args) - (if (eq quit-flag t) - (let ((proc (get-buffer-process (current-buffer)))) - ;; The user hit C-g, honor it! Some things can get in an - ;; incredibly tight loop (chunked encoding) - (if proc - (progn - (set-process-sentinel proc nil) - (set-process-filter proc nil))) - (error "Transfer interrupted!"))) (apply 'url-debug 'http args)) (defun url-http-mark-connection-as-busy (host port proc) diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index 72ff4f171c..5b8350642f 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el @@ -61,8 +61,6 @@ If a list, it is a list of the types of messages to be logged." ;;;###autoload (defun url-debug (tag &rest args) - (if (eq quit-flag t) - (error "Interrupted!")) (if (or (eq url-debug t) (numberp url-debug) (and (listp url-debug) (memq tag url-debug))) commit b41c1ca10fab4ed94e59aea8ad5eae334c2452bd Author: Dmitry Gutov Date: Sat Apr 13 01:33:05 2019 +0300 Add :array-type option to json-parse-string * src/json.c (enum json_array_type): New type. (struct json_configuration): New field array_type. (json_parse_args): Rename the last argument. Handle the :array-type keyword argument (bug#32793). (Fjson_parse_string): Update the docstring accordingly. (json_to_lisp): Handle the case of :array-type being `list'. Add a call to 'rarely_quit' inside the loop. (syms_of_json): Define new symbols. (Fjson_serialize, Fjson_insert, Fjson_parse_string) (Fjson_parse_buffer): Update the config struct initializers. diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 1ef836b8f9..b46ee64786 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -5167,6 +5167,11 @@ key-value mappings of a JSON object. It can be either keys; @code{alist} to use alists with symbols as keys; or @code{plist} to use plists with keyword symbols as keys. +@item :array-type +The value decides which Lisp object to use for representing a JSON +array. It can be either @code{array}, the default, to use Lisp +arrays; or @code{list} to use lists. + @item :null-object The value decides which Lisp object to use to represent the JSON keyword @code{null}. It defaults to the symbol @code{:null}. diff --git a/src/json.c b/src/json.c index 5e1439f881..eb323b498c 100644 --- a/src/json.c +++ b/src/json.c @@ -337,8 +337,14 @@ enum json_object_type { json_object_plist }; +enum json_array_type { + json_array_array, + json_array_list +}; + struct json_configuration { enum json_object_type object_type; + enum json_array_type array_type; Lisp_Object null_object; Lisp_Object false_object; }; @@ -521,7 +527,7 @@ static void json_parse_args (ptrdiff_t nargs, Lisp_Object *args, struct json_configuration *conf, - bool configure_object_type) + bool parse_object_types) { if ((nargs % 2) != 0) wrong_type_argument (Qplistp, Flist (nargs, args)); @@ -531,7 +537,7 @@ json_parse_args (ptrdiff_t nargs, for (ptrdiff_t i = nargs; i > 0; i -= 2) { Lisp_Object key = args[i - 2]; Lisp_Object value = args[i - 1]; - if (configure_object_type && EQ (key, QCobject_type)) + if (parse_object_types && EQ (key, QCobject_type)) { if (EQ (value, Qhash_table)) conf->object_type = json_object_hashtable; @@ -542,12 +548,22 @@ json_parse_args (ptrdiff_t nargs, else wrong_choice (list3 (Qhash_table, Qalist, Qplist), value); } + else if (parse_object_types && EQ (key, QCarray_type)) + { + if (EQ (value, Qarray)) + conf->array_type = json_array_array; + else if (EQ (value, Qlist)) + conf->array_type = json_array_list; + else + wrong_choice (list2 (Qarray, Qlist), value); + } else if (EQ (key, QCnull_object)) conf->null_object = value; else if (EQ (key, QCfalse_object)) conf->false_object = value; - else if (configure_object_type) - wrong_choice (list3 (QCobject_type, + else if (parse_object_types) + wrong_choice (list4 (QCobject_type, + QCarray_type, QCnull_object, QCfalse_object), value); @@ -604,7 +620,8 @@ usage: (json-serialize OBJECT &rest ARGS) */) } #endif - struct json_configuration conf = {json_object_hashtable, QCnull, QCfalse}; + struct json_configuration conf = + {json_object_hashtable, json_array_array, QCnull, QCfalse}; json_parse_args (nargs - 1, args + 1, &conf, false); json_t *json = lisp_to_json_toplevel (args[0], &conf); @@ -701,7 +718,8 @@ usage: (json-insert OBJECT &rest ARGS) */) } #endif - struct json_configuration conf = {json_object_hashtable, QCnull, QCfalse}; + struct json_configuration conf = + {json_object_hashtable, json_array_array, QCnull, QCfalse}; json_parse_args (nargs - 1, args + 1, &conf, false); json_t *json = lisp_to_json (args[0], &conf); @@ -817,10 +835,35 @@ json_to_lisp (json_t *json, struct json_configuration *conf) size_t size = json_array_size (json); if (PTRDIFF_MAX < size) overflow_error (); - Lisp_Object result = make_vector (size, Qunbound); - for (ptrdiff_t i = 0; i < size; ++i) - ASET (result, i, - json_to_lisp (json_array_get (json, i), conf)); + Lisp_Object result; + switch (conf->array_type) + { + case json_array_array: + { + result = make_vector (size, Qunbound); + for (ptrdiff_t i = 0; i < size; ++i) + { + rarely_quit (i); + ASET (result, i, + json_to_lisp (json_array_get (json, i), conf)); + } + break; + } + case json_array_list: + { + result = Qnil; + for (ptrdiff_t i = size - 1; i >= 0; --i) + { + rarely_quit (i); + result = Fcons (json_to_lisp (json_array_get (json, i), conf), + result); + } + break; + } + default: + /* Can't get here. */ + emacs_abort (); + } --lisp_eval_depth; return result; } @@ -916,7 +959,12 @@ error of type `json-parse-error' is signaled. The arguments ARGS are a list of keyword/argument pairs: The keyword argument `:object-type' specifies which Lisp type is used -to represent objects; it can be `hash-table', `alist' or `plist'. +to represent objects; it can be `hash-table', `alist' or `plist'. It +defaults to `hash-table'. + +The keyword argument `:array-type' specifies which Lisp type is used +to represent arrays; it can be `array' or `list'. It defaults to +`array'. The keyword argument `:null-object' specifies which object to use to represent a JSON null value. It defaults to `:null'. @@ -946,7 +994,8 @@ usage: (json-parse-string STRING &rest ARGS) */) Lisp_Object string = args[0]; Lisp_Object encoded = json_encode (string); check_string_without_embedded_nuls (encoded); - struct json_configuration conf = {json_object_hashtable, QCnull, QCfalse}; + struct json_configuration conf = + {json_object_hashtable, json_array_array, QCnull, QCfalse}; json_parse_args (nargs - 1, args + 1, &conf, true); json_error_t error; @@ -1016,7 +1065,8 @@ usage: (json-parse-buffer &rest args) */) } #endif - struct json_configuration conf = {json_object_hashtable, QCnull, QCfalse}; + struct json_configuration conf = + {json_object_hashtable, json_array_array, QCnull, QCfalse}; json_parse_args (nargs, args, &conf, true); ptrdiff_t point = PT_BYTE; @@ -1095,10 +1145,12 @@ syms_of_json (void) Fput (Qjson_parse_string, Qside_effect_free, Qt); DEFSYM (QCobject_type, ":object-type"); + DEFSYM (QCarray_type, ":array-type"); DEFSYM (QCnull_object, ":null-object"); DEFSYM (QCfalse_object, ":false-object"); DEFSYM (Qalist, "alist"); DEFSYM (Qplist, "plist"); + DEFSYM (Qarray, "array"); defsubr (&Sjson_serialize); defsubr (&Sjson_insert); diff --git a/test/src/json-tests.el b/test/src/json-tests.el index 04f91f4abb..542eec11bf 100644 --- a/test/src/json-tests.el +++ b/test/src/json-tests.el @@ -117,6 +117,14 @@ (should (equal (json-parse-string input :object-type 'plist) '(:abc [9 :false] :def :null))))) +(ert-deftest json-parse-string/array () + (skip-unless (fboundp 'json-parse-string)) + (let ((input "[\"a\", 1, [\"b\", 2]]")) + (should (equal (json-parse-string input) + ["a" 1 ["b" 2]])) + (should (equal (json-parse-string input :array-type 'list) + '("a" 1 ("b" 2)))))) + (ert-deftest json-parse-string/string () (skip-unless (fboundp 'json-parse-string)) (should-error (json-parse-string "[\"formfeed\f\"]") :type 'json-parse-error) commit cc80eeb4a43d2079963de3d181002a6a6b56560d Author: Alan Mackenzie Date: Fri Apr 12 20:07:03 2019 +0000 Analyze C++ method with & or && ref-qualifier as defun, not brace list Also firm up detection of beginning of brace list in c-looking-at-or-maybe-in-bracelist. * lisp/progmodes/cc-engine.el (c-looking-at-or-maybe-in-bracelist): On detection of such a ref-qualifier, set braceassignp to nil. When this variable has a nil value, return nil as the value of the function. On encountering a } when scanning backwards, recognise this as the end of a previous construct and stop the scan. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 1a8c516490..fc8c377f27 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -10953,7 +10953,8 @@ comment at the start of cc-engine.el for more info." (eq (char-after) ?\()) (setq braceassignp 'c++-noassign in-paren 'in-paren)) - ((looking-at c-pre-id-bracelist-key)) + ((looking-at c-pre-id-bracelist-key) + (setq braceassignp nil)) ((looking-at c-return-key)) ((and (looking-at c-symbol-start) (not (looking-at c-keywords-regexp))) @@ -10995,6 +10996,8 @@ comment at the start of cc-engine.el for more info." (setq pos (point)) (cond + ((not braceassignp) + nil) ((and after-type-id-pos (goto-char after-type-id-pos) (setq res (c-back-over-member-initializers)) @@ -11069,14 +11072,20 @@ comment at the start of cc-engine.el for more info." )))) nil) (t t)))))) - (when (and (eq braceassignp 'dontknow) - (/= (c-backward-token-2 1 t lim) 0)) - (if (save-excursion - (and c-has-compound-literals - (eq (c-backward-token-2 1 nil lim) 0) - (eq (char-after) ?\())) - (setq braceassignp t) - (setq braceassignp nil)))) + (when (eq braceassignp 'dontknow) + (cond ((and + (not (eq (char-after) ?,)) + (save-excursion + (c-backward-syntactic-ws) + (eq (char-before) ?}))) + (setq braceassignp nil)) + ((/= (c-backward-token-2 1 t lim) 0) + (if (save-excursion + (and c-has-compound-literals + (eq (c-backward-token-2 1 nil lim) 0) + (eq (char-after) ?\())) + (setq braceassignp t) + (setq braceassignp nil)))))) (cond (braceassignp @@ -11108,9 +11117,14 @@ comment at the start of cc-engine.el for more info." (and (consp res) (eq (car res) after-type-id-pos)))))) (cons bufpos (or in-paren inexpr-brace-list))) - ((eq (char-after) ?\;) - ;; Brace lists can't contain a semicolon, so we're done. - ;; (setq containing-sexp nil) + ((or (eq (char-after) ?\;) + ;; Brace lists can't contain a semicolon, so we're done. + (save-excursion + (c-backward-syntactic-ws) + (eq (char-before) ?})) + ;; They also can't contain a bare }, which is probably the end + ;; of a function. + ) nil) ((and (setq macro-start (point)) (c-forward-to-cpp-define-body) commit 896e5802160c2797e689a7565599ebb1bd171295 Author: Stefan Monnier Date: Fri Apr 12 12:37:00 2019 -0400 * lisp/help-fns.el (help-fns-describe-variable-functions): New hook (help-fns--compiler-macro, help-fns--parent-mode, help-fns--obsolete) (help-fns--interactive-only): Indent output by 2 spaces. (help-fns--side-effects): New function extracted from describe-function-1. (help-fns-describe-function-functions): Use it. (help-fns--first-release, help-fns--mention-first-release): New functions. (help-fns-function-description-header): Keymaps and macros can't be interactive. (help-fns--ensure-empty-line): New function. (describe-function-1): Use it. (help-fns--var-safe-local, help-fns--var-risky) (help-fns--var-ignored-local, help-fns--var-file-local) (help-fns--var-watchpoints, help-fns--var-obsolete) (help-fns--var-alias, help-fns--var-bufferlocal): New functions, extacted from describe-variable. (describe-variable): Run help-fns-describe-variable-functions instead. diff --git a/etc/NEWS b/etc/NEWS index 9e3d993cab..021d7d0179 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -846,6 +846,9 @@ directories in the destination. ** Help +--- +*** Description of variables and functions give an estimated first release + --- *** Output format of 'C-h l' ('view-lossage') has changed. For convenience, 'view-lossage' now displays the last keystrokes @@ -1497,6 +1500,9 @@ performs (setq-local indent-line-function #'indent-relative). * Lisp Changes in Emacs 27.1 +** New 'help-fns-describe-variable-functions' hook. +Makes it possible to add metadata information to describe-variable. + ** i18n (internationalization) *** ngettext can be used now to return the right plural form diff --git a/etc/NEWS.1-17 b/etc/NEWS.1-17 index 758ef65ed9..1ce36fe99d 100644 --- a/etc/NEWS.1-17 +++ b/etc/NEWS.1-17 @@ -2339,9 +2339,9 @@ It's Beat CCA Week. ** Lisp macros now exist. For example, you can write - (defmacro cadr (arg) (list 'car (list 'cdr arg))) + (defmacro mycadr (arg) (list 'car (list 'cdr arg))) and then the expression - (cadr foo) + (mycadr foo) will expand into (car (cdr foo)) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 06b4ec8c20..50d69e70de 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -40,7 +40,21 @@ "List of functions to run in help buffer in `describe-function'. Those functions will be run after the header line and argument list was inserted, and before the documentation will be inserted. -The functions will receive the function name as argument.") +The functions will receive the function name as argument. +They can assume that a newline was output just before they were called, +and they should terminate any of their own output with a newline. +By convention they should indent their output by 2 spaces.") + +(defvar help-fns-describe-variable-functions nil + "List of functions to run in help buffer in `describe-variable'. +Those functions will be run after the header line and value was inserted, +and before the documentation will be inserted. +The functions will receive the variable name as argument. +They can assume that a newline was output just before they were called, +and they should terminate any of their own output with a newline. +By convention they should indent their output by 2 spaces. +Current buffer is the buffer in which we queried the variable, +and the output should go to `standard-output'.") ;; Functions @@ -412,7 +426,7 @@ suitable file is found, return nil." (defun help-fns--compiler-macro (function) (let ((handler (function-get function 'compiler-macro))) (when handler - (insert "\nThis function has a compiler macro") + (insert " This function has a compiler macro") (if (symbolp handler) (progn (insert (format-message " `%s'" handler)) @@ -486,7 +500,7 @@ suitable file is found, return nil." (get function 'derived-mode-parent)))) (when parent-mode - (insert (substitute-command-keys "\nParent mode: `")) + (insert (substitute-command-keys " Parent mode: `")) (let ((beg (point))) (insert (format "%s" parent-mode)) (make-text-button beg (point) @@ -500,15 +514,15 @@ suitable file is found, return nil." (get function 'byte-obsolete-info))) (use (car obsolete))) (when obsolete - (insert "\nThis " + (insert " This " (if (eq (car-safe (symbol-function function)) 'macro) "macro" "function") " is obsolete") (when (nth 2 obsolete) (insert (format " since %s" (nth 2 obsolete)))) - (insert (cond ((stringp use) (concat ";\n" use)) - (use (format-message ";\nuse `%s' instead." use)) + (insert (cond ((stringp use) (concat ";\n " use)) + (use (format-message ";\n use `%s' instead." use)) (t ".")) "\n")))) @@ -538,17 +552,65 @@ FILE is the file where FUNCTION was probably defined." (memq function byte-compile-interactive-only-functions))))) (when interactive-only - (insert "\nThis function is for interactive use only" + (insert " This function is for interactive use only" ;; Cf byte-compile-form. (cond ((stringp interactive-only) - (format ";\nin Lisp code %s" interactive-only)) + (format ";\n in Lisp code %s" interactive-only)) ((and (symbolp 'interactive-only) (not (eq interactive-only t))) - (format-message ";\nin Lisp code use `%s' instead." + (format-message ";\n in Lisp code use `%s' instead." interactive-only)) (t ".")) "\n"))))) +(add-hook 'help-fns-describe-function-functions #'help-fns--side-effects) +(defun help-fns--side-effects (function) + (when (and (symbolp function) + (or (function-get function 'pure) + (function-get function 'side-effect-free))) + (insert " This function does not change global state, " + "including the match data.\n"))) + +(defun help-fns--first-release (symbol) + "Return the likely first release that defined SYMBOL." + ;; Code below relies on the etc/NEWS* files. + ;; FIXME: Maybe we should also use the */ChangeLog* files when available. + ;; FIXME: Maybe we should also look for announcements of the addition + ;; of the *packages* in which the function is defined. + (let* ((name (symbol-name symbol)) + (re (concat "\\_<" (regexp-quote name) "\\_>")) + (news (directory-files data-directory t "\\`NEWS.[1-9]")) + (first nil)) + (with-temp-buffer + (dolist (f news) + (erase-buffer) + (insert-file-contents f) + (goto-char (point-min)) + (search-forward "\n*") + (while (re-search-forward re nil t) + (save-excursion + ;; Almost all entries are of the form "* ... in Emacs NN.MM." + ;; but there are also a few in the form "* Emacs NN.MM is a bug + ;; fix release ...". + (if (not (re-search-backward "^\\*.* Emacs \\([0-9.]+[0-9]\\)" + nil t)) + (message "Ref found in non-versioned section in %S" + (file-name-nondirectory f)) + (let ((version (match-string 1))) + (when (or (null first) (version< version first)) + (setq first version)))))))) + first)) + +(add-hook 'help-fns-describe-function-functions + #'help-fns--mention-first-release) +(add-hook 'help-fns-describe-variable-functions + #'help-fns--mention-first-release) +(defun help-fns--mention-first-release (object) + (let ((first (if (symbolp object) (help-fns--first-release object)))) + (when first + (princ (format " Probably introduced at or before Emacs version %s.\n" + first))))) + (defun help-fns-short-filename (filename) (let* ((abbrev (abbreviate-file-name filename)) (short abbrev)) @@ -611,9 +673,9 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." (memq (car-safe def) '(macro lambda closure))) (stringp file-name) (help-fns--autoloaded-p function file-name)) - (if (commandp def) - "an interactive autoloaded " - "an autoloaded ") + (concat + "an autoloaded " (if (commandp def) + "interactive ")) (if (commandp def) "an interactive " "a ")))) ;; Print what kind of function-like object FUNCTION is. @@ -627,14 +689,16 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." (aliased (format-message "an alias for `%s'" real-def)) ((subrp def) - (if (eq 'unevalled (cdr (subr-arity def))) - (concat beg "special form") - (concat beg "built-in function"))) + (concat beg (if (eq 'unevalled (cdr (subr-arity def))) + "special form" + "built-in function"))) ((autoloadp def) - (format "%s autoloaded %s" - (if (commandp def) "an interactive" "an") - (if (eq (nth 4 def) 'keymap) "keymap" - (if (nth 4 def) "Lisp macro" "Lisp function")))) + (format "an autoloaded %s" + (cond + ((commandp def) "interactive Lisp function") + ((eq (nth 4 def) 'keymap) "keymap") + ((nth 4 def) "Lisp macro") + (t "Lisp function")))) ((or (eq (car-safe def) 'macro) ;; For advised macros, def is a lambda ;; expression or a byte-code-function-p, so we @@ -685,6 +749,10 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." (help-xref-button 1 'help-function-def function file-name)))) (princ ".")))) +(defun help-fns--ensure-empty-line () + (unless (eolp) (insert "\n")) + (unless (eq ?\n (char-before (1- (point)))) (insert "\n"))) + ;;;###autoload (defun describe-function-1 (function) (let ((pt1 (with-current-buffer (help-buffer) (point)))) @@ -722,12 +790,10 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." real-function key-bindings-buffer) ;; E.g. an alias for a not yet defined function. ((invalid-function void-function) doc-raw)))) + (help-fns--ensure-empty-line) (run-hook-with-args 'help-fns-describe-function-functions function) - (insert "\n" (or doc "Not documented."))) - (when (or (function-get function 'pure) - (function-get function 'side-effect-free)) - (insert "\nThis function does not change global state, " - "including the match data.")) + (help-fns--ensure-empty-line) + (insert (or doc "Not documented."))) ;; Avoid asking the user annoying questions if she decides ;; to save the help buffer, when her locale's codeset ;; isn't UTF-8. @@ -830,7 +896,6 @@ it is displayed along with the global value." (message "You did not specify a variable") (save-excursion (let ((valvoid (not (with-current-buffer buffer (boundp variable)))) - (permanent-local (get variable 'permanent-local)) val val-start-pos locus) ;; Extract the value before setting up the output buffer, ;; in case `buffer' *is* the output buffer. @@ -846,26 +911,26 @@ it is displayed along with the global value." (prin1 variable) (setq file-name (find-lisp-object-file-name variable 'defvar)) - (if file-name - (progn - (princ (format-message - " is a variable defined in `%s'.\n" - (if (eq file-name 'C-source) - "C source code" - (file-name-nondirectory file-name)))) - (with-current-buffer standard-output - (save-excursion - (re-search-backward (substitute-command-keys - "`\\([^`']+\\)'") - nil t) - (help-xref-button 1 'help-variable-def - variable file-name))) - (if valvoid - (princ "It is void as a variable.") - (princ "Its "))) - (if valvoid - (princ " is void as a variable.") - (princ (substitute-command-keys "'s "))))) + (princ (if file-name + (progn + (princ (format-message + " is a variable defined in `%s'.\n" + (if (eq file-name 'C-source) + "C source code" + (file-name-nondirectory file-name)))) + (with-current-buffer standard-output + (save-excursion + (re-search-backward (substitute-command-keys + "`\\([^`']+\\)'") + nil t) + (help-xref-button 1 'help-variable-def + variable file-name))) + (if valvoid + "It is void as a variable." + "Its ")) + (if valvoid + " is void as a variable." + (substitute-command-keys "'s "))))) (unless valvoid (with-current-buffer standard-output (setq val-start-pos (point)) @@ -894,7 +959,7 @@ it is displayed along with the global value." (let* ((sv (get variable 'standard-value)) (origval (and (consp sv) (condition-case nil - (eval (car sv)) + (eval (car sv) t) (error :help-eval-error)))) from) (when (and (consp sv) @@ -969,132 +1034,17 @@ it is displayed along with the global value." (let* ((alias (condition-case nil (indirect-variable variable) (error variable))) - (obsolete (get variable 'byte-obsolete-variable)) - (watchpoints (get-variable-watchers variable)) - (use (car obsolete)) - (safe-var (get variable 'safe-local-variable)) (doc (or (documentation-property variable 'variable-documentation) (documentation-property - alias 'variable-documentation))) - (extra-line nil)) + alias 'variable-documentation)))) - ;; Mention if it's a local variable. - (cond - ((and (local-variable-if-set-p variable) - (or (not (local-variable-p variable)) - (with-temp-buffer - (local-variable-if-set-p variable)))) - (setq extra-line t) - (princ " Automatically becomes ") - (if permanent-local - (princ "permanently ")) - (princ "buffer-local when set.\n")) - ((not permanent-local)) - ((bufferp locus) - (setq extra-line t) - (princ - (substitute-command-keys - " This variable's buffer-local value is permanent.\n"))) - (t - (setq extra-line t) - (princ (substitute-command-keys - " This variable's value is permanent \ -if it is given a local binding.\n")))) - - ;; Mention if it's an alias. - (unless (eq alias variable) - (setq extra-line t) - (princ (format-message - " This variable is an alias for `%s'.\n" - alias))) - - (when obsolete - (setq extra-line t) - (princ " This variable is obsolete") - (if (nth 2 obsolete) - (princ (format " since %s" (nth 2 obsolete)))) - (princ (cond ((stringp use) (concat ";\n " use)) - (use (format-message ";\n use `%s' instead." - (car obsolete))) - (t "."))) - (terpri)) - - (when watchpoints - (setq extra-line t) - (princ " Calls these functions when changed: ") - (princ watchpoints) - (terpri)) - - (when (member (cons variable val) - (with-current-buffer buffer - file-local-variables-alist)) - (setq extra-line t) - (if (member (cons variable val) - (with-current-buffer buffer - dir-local-variables-alist)) - (let ((file (and (buffer-file-name buffer) - (not (file-remote-p - (buffer-file-name buffer))) - (dir-locals-find-file - (buffer-file-name buffer)))) - (is-directory nil)) - (princ (substitute-command-keys - " This variable's value is directory-local")) - (when (consp file) ; result from cache - ;; If the cache element has an mtime, we - ;; assume it came from a file. - (if (nth 2 file) - ;; (car file) is a directory. - (setq file (dir-locals--all-files (car file))) - ;; Otherwise, assume it was set directly. - (setq file (car file) - is-directory t))) - (if (null file) - (princ ".\n") - (princ ", set ") - (princ (substitute-command-keys - (cond - (is-directory "for the directory\n `") - ;; Many files matched. - ((and (consp file) (cdr file)) - (setq file (file-name-directory (car file))) - (format "by one of the\n %s files in the directory\n `" - dir-locals-file)) - (t (setq file (car file)) - "by the file\n `")))) - (with-current-buffer standard-output - (insert-text-button - file 'type 'help-dir-local-var-def - 'help-args (list variable file))) - (princ (substitute-command-keys "'.\n")))) - (princ (substitute-command-keys - " This variable's value is file-local.\n")))) - - (when (memq variable ignored-local-variables) - (setq extra-line t) - (princ " This variable is ignored as a file-local \ -variable.\n")) - - ;; Can be both risky and safe, eg auto-fill-function. - (when (risky-local-variable-p variable) - (setq extra-line t) - (princ " This variable may be risky if used as a \ -file-local variable.\n") - (when (assq variable safe-local-variable-values) - (princ (substitute-command-keys - " However, you have added it to \ -`safe-local-variable-values'.\n")))) - - (when safe-var - (setq extra-line t) - (princ " This variable is safe as a file local variable ") - (princ "if its value\n satisfies the predicate ") - (princ (if (byte-code-function-p safe-var) - "which is a byte-compiled expression.\n" - (format-message "`%s'.\n" safe-var)))) - - (if extra-line (terpri)) + (with-current-buffer buffer + (run-hook-with-args 'help-fns-describe-variable-functions + variable)) + + (with-current-buffer standard-output + (help-fns--ensure-empty-line)) (princ "Documentation:\n") (with-current-buffer standard-output (insert (or doc "Not documented as a variable.")))) @@ -1121,6 +1071,134 @@ file-local variable.\n") ;; Return the text we displayed. (buffer-string)))))))) +(add-hook 'help-fns-describe-variable-functions #'help-fns--var-safe-local) +(defun help-fns--var-safe-local (variable) + (let ((safe-var (get variable 'safe-local-variable))) + (when safe-var + (princ " This variable is safe as a file local variable ") + (princ "if its value\n satisfies the predicate ") + (princ (if (byte-code-function-p safe-var) + "which is a byte-compiled expression.\n" + (format-message "`%s'.\n" safe-var)))))) + +(add-hook 'help-fns-describe-variable-functions #'help-fns--var-risky) +(defun help-fns--var-risky (variable) + ;; Can be both risky and safe, eg auto-fill-function. + (when (risky-local-variable-p variable) + (princ " This variable may be risky if used as a \ +file-local variable.\n") + (when (assq variable safe-local-variable-values) + (princ (substitute-command-keys + " However, you have added it to \ +`safe-local-variable-values'.\n"))))) + +(add-hook 'help-fns-describe-variable-functions #'help-fns--var-ignored-local) +(defun help-fns--var-ignored-local (variable) + (when (memq variable ignored-local-variables) + (princ " This variable is ignored as a file-local \ +variable.\n"))) + +(add-hook 'help-fns-describe-variable-functions #'help-fns--var-file-local) +(defun help-fns--var-file-local (variable) + (when (boundp variable) + (let ((val (symbol-value variable))) + (when (member (cons variable val) + file-local-variables-alist) + (if (member (cons variable val) + dir-local-variables-alist) + (let ((file (and buffer-file-name + (not (file-remote-p buffer-file-name)) + (dir-locals-find-file buffer-file-name))) + (is-directory nil)) + (princ (substitute-command-keys + " This variable's value is directory-local")) + (when (consp file) ; result from cache + ;; If the cache element has an mtime, we + ;; assume it came from a file. + (if (nth 2 file) + ;; (car file) is a directory. + (setq file (dir-locals--all-files (car file))) + ;; Otherwise, assume it was set directly. + (setq file (car file) + is-directory t))) + (if (null file) + (princ ".\n") + (princ ", set ") + (princ (substitute-command-keys + (cond + (is-directory "for the directory\n `") + ;; Many files matched. + ((and (consp file) (cdr file)) + (setq file (file-name-directory (car file))) + (format "by one of the\n %s files in the directory\n `" + dir-locals-file)) + (t (setq file (car file)) + "by the file\n `")))) + (with-current-buffer standard-output + (insert-text-button + file 'type 'help-dir-local-var-def + 'help-args (list variable file))) + (princ (substitute-command-keys "'.\n")))) + (princ (substitute-command-keys + " This variable's value is file-local.\n"))))))) + +(add-hook 'help-fns-describe-variable-functions #'help-fns--var-watchpoints) +(defun help-fns--var-watchpoints (variable) + (let ((watchpoints (get-variable-watchers variable))) + (when watchpoints + (princ " Calls these functions when changed: ") + ;; FIXME: Turn function names into hyperlinks. + (princ watchpoints) + (terpri)))) + +(add-hook 'help-fns-describe-variable-functions #'help-fns--var-obsolete) +(defun help-fns--var-obsolete (variable) + (let* ((obsolete (get variable 'byte-obsolete-variable)) + (use (car obsolete))) + (when obsolete + (princ " This variable is obsolete") + (if (nth 2 obsolete) + (princ (format " since %s" (nth 2 obsolete)))) + (princ (cond ((stringp use) (concat ";\n " use)) + (use (format-message ";\n use `%s' instead." + (car obsolete))) + (t "."))) + (terpri)))) + +(add-hook 'help-fns-describe-variable-functions #'help-fns--var-alias) +(defun help-fns--var-alias (variable) + ;; Mention if it's an alias. + (let ((alias (condition-case nil + (indirect-variable variable) + (error variable)))) + (unless (eq alias variable) + (princ (format-message + " This variable is an alias for `%s'.\n" + alias))))) + +(add-hook 'help-fns-describe-variable-functions #'help-fns--var-bufferlocal) +(defun help-fns--var-bufferlocal (variable) + (let ((permanent-local (get variable 'permanent-local)) + (locus (variable-binding-locus variable))) + ;; Mention if it's a local variable. + (cond + ((and (local-variable-if-set-p variable) + (or (not (local-variable-p variable)) + (with-temp-buffer + (local-variable-if-set-p variable)))) + (princ " Automatically becomes ") + (if permanent-local + (princ "permanently ")) + (princ "buffer-local when set.\n")) + ((not permanent-local)) + ((bufferp locus) + (princ + (substitute-command-keys + " This variable's buffer-local value is permanent.\n"))) + (t + (princ (substitute-command-keys + " This variable's value is permanent \ +if it is given a local binding.\n")))))) (defvar help-xref-stack-item) commit 2bc2a3ecaf3d1992cbc8b14609c16ebd4498b155 Merge: a25f4d6ef5 fd1b34bfba Author: Glenn Morris Date: Fri Apr 12 07:51:35 2019 -0700 ; Merge from origin/emacs-26 The following commit was skipped: fd1b34b (origin/emacs-26) Bump Emacs version to 26.2 commit a25f4d6ef5f8c3724274f6d0bb91300bcbe076ae Merge: d4b90e598e 818a68b1ca Author: Glenn Morris Date: Fri Apr 12 07:51:35 2019 -0700 Merge from origin/emacs-26 818a68b * etc/HISTORY: Update for Emacs 26.2 release. e04aa5a ; ChangeLog.3 update 8297e97 * etc/AUTHORS: Update. 8582936 Improve documentation of 'read-command' dc81c05 ; * CONTRIBUTE: Mention where to ask for the copyright assign... b77723a Fix an outdated URL in a comment commit d4b90e598e77c90fadff9ce8bd7da31dd62225a4 Merge: fe6e5af4dd 71be83ef8b Author: Glenn Morris Date: Fri Apr 12 07:51:35 2019 -0700 ; Merge from origin/emacs-26 The following commits were skipped: 71be83e Backport: Fix comment-empty-lines docstring (bug#35152) 559f64a Backport: Update documentation for indent-relative functions commit fe6e5af4ddc47ed1babf7e592ec59d6cb6af235d Merge: 0c4c96d7dc cb5a340823 Author: Glenn Morris Date: Fri Apr 12 07:51:34 2019 -0700 Merge from origin/emacs-26 cb5a340 Update nxml-mode.texi: completion now gives xmlns="-!-" commit 0c4c96d7dc660ae8fa26c397bafff228996bcc51 Author: Basil L. Contovounesios Date: Tue Apr 9 17:05:27 2019 +0100 Move proper-list-p tests to fns-tests.el This follows the move of proper-list-p from lisp/subr.el to src/fns.c in 2018-07-24T15:58:46-07:00!eggert@cs.ucla.edu. * test/lisp/subr-tests.el (subr-tests--proper-list-p): Move from here... * test/src/fns-tests.el (test-proper-list-p): ...to here. diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 7465aac5ea..c458eef2f9 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el @@ -318,24 +318,6 @@ cf. Bug#25477." (should (eq (string-to-char (symbol-name (gensym))) ?g)) (should (eq (string-to-char (symbol-name (gensym "X"))) ?X))) -(ert-deftest subr-tests--proper-list-p () - "Test `proper-list-p' behavior." - (dotimes (length 4) - ;; Proper and dotted lists. - (let ((list (make-list length 0))) - (should (= (proper-list-p list) length)) - (should (not (proper-list-p (nconc list 0))))) - ;; Circular lists. - (dotimes (n (1+ length)) - (let ((circle (make-list (1+ length) 0))) - (should (not (proper-list-p (nconc circle (nthcdr n circle)))))))) - ;; Atoms. - (should (not (proper-list-p 0))) - (should (not (proper-list-p ""))) - (should (not (proper-list-p []))) - (should (not (proper-list-p (make-bool-vector 0 nil)))) - (should (not (proper-list-p (make-symbol "a"))))) - (ert-deftest subr-tests--assq-delete-all () "Test `assq-delete-all' behavior." (cl-flet ((new-list-fn diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index d6cc99e8e3..6ebab4287f 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el @@ -648,4 +648,22 @@ (should (equal (list (eq a b) n len) (list t n len)))))))) +(ert-deftest test-proper-list-p () + "Test `proper-list-p' behavior." + (dotimes (length 4) + ;; Proper and dotted lists. + (let ((list (make-list length 0))) + (should (= (proper-list-p list) length)) + (should (not (proper-list-p (nconc list 0))))) + ;; Circular lists. + (dotimes (n (1+ length)) + (let ((circle (make-list (1+ length) 0))) + (should (not (proper-list-p (nconc circle (nthcdr n circle)))))))) + ;; Atoms. + (should (not (proper-list-p 0))) + (should (not (proper-list-p ""))) + (should (not (proper-list-p []))) + (should (not (proper-list-p (make-bool-vector 0 nil)))) + (should (not (proper-list-p (make-symbol "a"))))) + (provide 'fns-tests) commit 9a54e70c184cd9f65f1141a1b1df87e9afb83d2f Author: Basil L. Contovounesios Date: Tue Apr 9 16:51:55 2019 +0100 Optimize byte-compilation of proper-list-p For discussion, see thread starting at: https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00316.html * lisp/emacs-lisp/byte-opt.el: Optimize proper-list-p as a predicate. * lisp/subr.el: Mark proper-list-p as pure, and side-effect and error free. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 33d4964763..44cca6136c 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -879,7 +879,8 @@ (put 'symbolp 'byte-optimizer 'byte-optimize-predicate) (put 'stringp 'byte-optimizer 'byte-optimize-predicate) (put 'string< 'byte-optimizer 'byte-optimize-predicate) -(put 'string-lessp 'byte-optimizer 'byte-optimize-predicate) +(put 'string-lessp 'byte-optimizer 'byte-optimize-predicate) +(put 'proper-list-p 'byte-optimizer 'byte-optimize-predicate) (put 'logand 'byte-optimizer 'byte-optimize-predicate) (put 'logior 'byte-optimizer 'byte-optimize-predicate) diff --git a/lisp/subr.el b/lisp/subr.el index bdf98979c4..bf3716bbd3 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -604,6 +604,11 @@ If N is omitted or nil, remove the last element." (if (> n 0) (setcdr (nthcdr (- (1- m) n) list) nil)) list)))) +;; The function's definition was moved to fns.c, +;; but it's easier to set properties here. +(put 'proper-list-p 'pure t) +(put 'proper-list-p 'side-effect-free 'error-free) + (defun delete-dups (list) "Destructively remove `equal' duplicates from LIST. Store the result in LIST and return it. LIST must be a proper list. commit 6dc4c722af4e5f9f189631638700cd1fb3cc2edb Author: Alex Murray Date: Thu Apr 4 16:49:48 2019 +1030 Pop to originating erc buffer when clicking desktop notification * lisp/erc/erc-desktop-notifications.el: Switch to lexical-binding. (erc-notifications-notify): Add a default action to the desktop notification which pops to the buffer from which the notification originated. (Bug#35141) Copyright-paperwork-exempt: yes diff --git a/lisp/erc/erc-desktop-notifications.el b/lisp/erc/erc-desktop-notifications.el index 56b93925ce..41b7420320 100644 --- a/lisp/erc/erc-desktop-notifications.el +++ b/lisp/erc/erc-desktop-notifications.el @@ -1,4 +1,4 @@ -;; erc-desktop-notifications.el -- Send notification on PRIVMSG or mentions +;; erc-desktop-notifications.el -- Send notification on PRIVMSG or mentions -*- lexical-binding:t -*- ;; Copyright (C) 2012-2019 Free Software Foundation, Inc. @@ -59,13 +59,19 @@ This will replace the last notification sent with this function." (dbus-ignore-errors (setq erc-notifications-last-notification - (notifications-notify :bus erc-notifications-bus - :title (xml-escape-string nick) - :body (xml-escape-string msg) - :replaces-id erc-notifications-last-notification - :app-icon erc-notifications-icon)))) - -(defun erc-notifications-PRIVMSG (proc parsed) + (let ((channel (current-buffer))) + (notifications-notify :bus erc-notifications-bus + :title (format "%s in %s" + (xml-escape-string nick) + channel) + :body (xml-escape-string msg) + :replaces-id erc-notifications-last-notification + :app-icon erc-notifications-icon + :actions '("default" "Switch to buffer") + :on-action (lambda (&rest _) + (pop-to-buffer channel))))))) + +(defun erc-notifications-PRIVMSG (_proc parsed) (let ((nick (car (erc-parse-user (erc-response.sender parsed)))) (target (car (erc-response.command-args parsed))) (msg (erc-response.contents parsed))) commit 2b82c829706808668ea2e8a63b6bc4351d93afc2 Author: Basil L. Contovounesios Date: Thu Apr 11 17:24:36 2019 +0100 Always set gnus-group property to a group name * lisp/gnus/gnus-group.el (gnus-group-prepare-flat-list-dead): Set gnus-group property to a group name, not active info. (bug#33653) Simplify surrounding logic. (gnus-group-prepare-flat, gnus-group-goto-group): Use accessor macros. (gnus-group-insert-group-line, gnus-group-new-mail) (gnus-group-mark-group): Write ?\s instead of ? . (gnus-group-group-name, gnus-group-list-active): Simplify. diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 144496bdd2..0956dc46d0 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -1320,7 +1320,7 @@ if it is a string, only list groups matching REGEXP." gnus-group-listed-groups) ;; List living groups, according to order in `gnus-group-list'. (dolist (g (cdr gnus-group-list)) - (setq info (nth 1 (gethash g gnus-newsrc-hashtb)) + (setq info (gnus-get-info g) group (gnus-info-group info) params (gnus-info-params info) unread (gnus-group-unread group)) @@ -1389,39 +1389,35 @@ if it is a string, only list groups matching REGEXP." ;; List zombies and killed lists somewhat faster, which was ;; suggested by Jack Vinson . It does ;; this by ignoring the group format specification altogether. - (let (group) - (if (> (length groups) gnus-group-listing-limit) - (while groups - (setq group (pop groups)) - (when (gnus-group-prepare-logic - group - (or (not regexp) - (and (stringp regexp) (string-match regexp group)) - (and (functionp regexp) (funcall regexp group)))) - (add-text-properties - (point) (prog1 (1+ (point)) - (insert " " mark " *: " - (gnus-group-decoded-name group) - "\n")) - (list 'gnus-group (gethash group gnus-active-hashtb) - 'gnus-unread t - 'gnus-level level)))) - (while groups - (setq group (pop groups)) + (if (nthcdr gnus-group-listing-limit groups) + (dolist (group groups) (when (gnus-group-prepare-logic group - (or (not regexp) - (and (stringp regexp) (string-match regexp group)) - (and (functionp regexp) (funcall regexp group)))) - (gnus-group-insert-group-line - group level nil - (let ((active (gnus-active group))) - (if active - (if (zerop (cdr active)) - 0 - (- (1+ (cdr active)) (car active))) - nil)) - (gnus-method-simplify (gnus-find-method-for-group group)))))))) + (cond ((not regexp)) + ((stringp regexp) (string-match-p regexp group)) + ((functionp regexp) (funcall regexp group)))) + (add-text-properties + (point) (prog1 (1+ (point)) + (insert " " mark " *: " + (gnus-group-decoded-name group) + "\n")) + (list 'gnus-group group + 'gnus-unread t + 'gnus-level level)))) + (dolist (group groups) + (when (gnus-group-prepare-logic + group + (cond ((not regexp)) + ((stringp regexp) (string-match-p regexp group)) + ((functionp regexp) (funcall regexp group)))) + (gnus-group-insert-group-line + group level nil + (let ((active (gnus-active group))) + (and active + (if (zerop (cdr active)) + 0 + (- (cdr active) (car active) -1)))) + (gnus-method-simplify (gnus-find-method-for-group group))))))) (defun gnus-group-update-group-line () "Update the current line in the group buffer." @@ -1527,7 +1523,7 @@ if it is a string, only list groups matching REGEXP." (int-to-string (max 0 (- gnus-tmp-number-total number))) "*")) (gnus-tmp-subscribed - (cond ((<= gnus-tmp-level gnus-level-subscribed) ? ) + (cond ((<= gnus-tmp-level gnus-level-subscribed) ?\s) ((<= gnus-tmp-level gnus-level-unsubscribed) ?U) ((= gnus-tmp-level gnus-level-zombie) ?Z) (t ?K))) @@ -1546,7 +1542,7 @@ if it is a string, only list groups matching REGEXP." (gnus-tmp-moderated (if (and gnus-moderated-hashtb (gethash gnus-tmp-group gnus-moderated-hashtb)) - ?m ? )) + ?m ?\s)) (gnus-tmp-moderated-string (if (eq gnus-tmp-moderated ?m) "(m)" "")) (gnus-tmp-group-icon (gnus-group-get-icon gnus-tmp-group)) @@ -1560,15 +1556,15 @@ if it is a string, only list groups matching REGEXP." (if (and (numberp number) (zerop number) (cdr (assq 'tick gnus-tmp-marked))) - ?* ? )) + ?* ?\s)) (gnus-tmp-summary-live (if (and (not gnus-group-is-exiting-p) (gnus-buffer-live-p (gnus-summary-buffer-name gnus-tmp-group))) - ?* ? )) + ?* ?\s)) (gnus-tmp-process-marked (if (member gnus-tmp-group gnus-group-marked) - gnus-process-mark ? )) + gnus-process-mark ?\s)) (buffer-read-only nil) beg end gnus-tmp-header) ; passed as parameter to user-funcs. @@ -1768,10 +1764,8 @@ already. If INFO-UNCHANGED is non-nil, dribble buffer is not updated." (defun gnus-group-group-name () "Get the name of the newsgroup on the current line." (let ((group (get-text-property (point-at-bol) 'gnus-group))) - (when group - (if (stringp group) - group - (symbol-name group))))) + (cond ((stringp group) group) + (group (symbol-name group))))) (defun gnus-group-group-level () "Get the level of the newsgroup on the current line." @@ -1791,7 +1785,7 @@ already. If INFO-UNCHANGED is non-nil, dribble buffer is not updated." (defun gnus-group-new-mail (group) (if (nnmail-new-mail-p (gnus-group-real-name group)) gnus-new-mail-mark - ? )) + ?\s)) (defun gnus-group-level (group) "Return the estimated level of GROUP." @@ -1881,7 +1875,7 @@ If FIRST-TOO, the current line is also eligible as a target." (if unmark (progn (setq gnus-group-marked (delete group gnus-group-marked)) - (insert-char ? 1 t)) + (insert-char ?\s 1 t)) (setq gnus-group-marked (cons group (delete group gnus-group-marked))) (insert-char gnus-process-mark 1 t))) @@ -2561,10 +2555,10 @@ If TEST-MARKED, the line must be marked." (when group (let ((start (point)) (active (and (or - ;; some kind of group may be only there. - (gethash group gnus-active-hashtb) - ;; all groups (but with exception) are there. - (gethash group gnus-newsrc-hashtb)) + ;; Some kind of group may be only there. + (gnus-active group) + ;; All groups (but with exception) are there. + (gnus-group-entry group)) group))) (beginning-of-line) (cond @@ -4013,15 +4007,9 @@ entail asking the server for the groups." (gnus-agent gnus-plugged)); If we're actually plugged, store the active file in the agent. (gnus-read-active-file))) ;; Find all groups and sort them. - (let ((groups - (sort - (hash-table-keys gnus-active-hashtb) - 'string<)) - (buffer-read-only nil) - group) + (let ((buffer-read-only nil)) (erase-buffer) - (while groups - (setq group (pop groups)) + (dolist (group (sort (hash-table-keys gnus-active-hashtb) #'string<)) (add-text-properties (point) (prog1 (1+ (point)) (insert " *: " commit fd1b34bfba8f3f6298df47c8e10b61530426f749 (tag: refs/tags/emacs-26.2) Author: Nicolas Petton Date: Thu Apr 11 21:59:46 2019 +0200 Bump Emacs version to 26.2 * README: * configure.ac: * msdos/sed2v2.inp: * nt/README.W32: Bump Emacs version to 26.2. diff --git a/README b/README index b115838b9f..38dcc637a3 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ Copyright (C) 2001-2019 Free Software Foundation, Inc. See the end of the file for license conditions. -This directory tree holds version 26.1.92 of GNU Emacs, the extensible, +This directory tree holds version 26.2 of GNU Emacs, the extensible, customizable, self-documenting real-time display editor. The file INSTALL in this directory says how to build and install GNU diff --git a/configure.ac b/configure.ac index 097c3bc68a..b712a43eea 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ dnl along with GNU Emacs. If not, see . AC_PREREQ(2.65) dnl Note this is parsed by (at least) make-dist and lisp/cedet/ede/emacs.el. -AC_INIT(GNU Emacs, 26.1.92, bug-gnu-emacs@gnu.org) +AC_INIT(GNU Emacs, 26.2, bug-gnu-emacs@gnu.org) dnl Set emacs_config_options to the options of 'configure', quoted for the shell, dnl and then quoted again for a C string. Separate options with spaces. diff --git a/msdos/sed2v2.inp b/msdos/sed2v2.inp index fdfec3059e..5141047a09 100644 --- a/msdos/sed2v2.inp +++ b/msdos/sed2v2.inp @@ -66,7 +66,7 @@ /^#undef PACKAGE_NAME/s/^.*$/#define PACKAGE_NAME ""/ /^#undef PACKAGE_STRING/s/^.*$/#define PACKAGE_STRING ""/ /^#undef PACKAGE_TARNAME/s/^.*$/#define PACKAGE_TARNAME ""/ -/^#undef PACKAGE_VERSION/s/^.*$/#define PACKAGE_VERSION "26.1.92"/ +/^#undef PACKAGE_VERSION/s/^.*$/#define PACKAGE_VERSION "26.2"/ /^#undef SYSTEM_TYPE/s/^.*$/#define SYSTEM_TYPE "ms-dos"/ /^#undef HAVE_DECL_GETENV/s/^.*$/#define HAVE_DECL_GETENV 1/ /^#undef SYS_SIGLIST_DECLARED/s/^.*$/#define SYS_SIGLIST_DECLARED 1/ diff --git a/nt/README.W32 b/nt/README.W32 index e22b5820d3..ce7b510e30 100644 --- a/nt/README.W32 +++ b/nt/README.W32 @@ -1,7 +1,7 @@ Copyright (C) 2001-2019 Free Software Foundation, Inc. See the end of the file for license conditions. - Emacs version 26.1.92 for MS-Windows + Emacs version 26.2 for MS-Windows This README file describes how to set up and run a precompiled distribution of the latest version of GNU Emacs for MS-Windows. You commit 818a68b1cab9eb27d552ba825470fda802dbebcd Author: Nicolas Petton Date: Thu Apr 11 21:59:28 2019 +0200 * etc/HISTORY: Update for Emacs 26.2 release. diff --git a/etc/HISTORY b/etc/HISTORY index b239904253..bf03692d3f 100644 --- a/etc/HISTORY +++ b/etc/HISTORY @@ -216,6 +216,8 @@ GNU Emacs 25.3 (2017-09-11) emacs-25.3 GNU Emacs 26.1 (2018-05-28) emacs-26.1 +GNU Emacs 26.2 (2019-04-12) emacs-26.2 + ---------------------------------------------------------------------- This file is part of GNU Emacs. commit e04aa5aff25855367b1ac3ee5b584e6864ebd776 Author: Nicolas Petton Date: Thu Apr 11 21:58:20 2019 +0200 ; ChangeLog.3 update diff --git a/ChangeLog.3 b/ChangeLog.3 index 53c1bcf614..e49a376264 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -1,3 +1,148 @@ +2019-04-11 Eli Zaretskii + + Improve documentation of 'read-command' + + * src/minibuf.c (Fread_command): Document the return value + when DEFAULT-VALUE is nil and the user enters nothing. + * doc/lispref/minibuf.texi (High-Level Completion): Document + the printed representation of a symbol whose name is empty. + (Bug#3522) + +2019-04-11 Eli Zaretskii + + Fix an outdated URL in a comment + + * src/emacs.c: Fix reference to Cocoa CoreFoundation Release + Notes. (Bug#35225) + +2019-04-11 Basil L. Contovounesios + + Backport: Fix comment-empty-lines docstring (bug#35152) + + * lisp/newcomment.el (comment-empty-lines): Consistently use US + commas in docstring. Fix indentation of and typo in custom :type. + + (cherry picked from commit 690c678fb6c1fb5b2f828f9bb90782bd0b01c399) + +2019-04-11 Alex Branham + + Backport: Update documentation for indent-relative functions + + * lisp/indent.el (indent-relative): Document what happens when there + is no previous nonblank line. + * doc/lispref/text.texi (Relative Indent): Document + indent-relative-first-indent-point instead of obsolete + indent-relative-maybe. Fix documentation of which argument from + 'indent-relative' is used. + + Bug#34858 + + (cherry picked from commit 10cd65878c741d2a22a1f2c36c54fcad4e516f72) + +2019-04-11 Noam Postavsky + + Update nxml-mode.texi: completion now gives xmlns="-!-" + + * doc/misc/nxml-mode.texi (Completion): As of 2016-01-16 "* lisp/nxml: + Use standard completion; it also works for company-mode", completing + an attribute when there is only one candidate inserts both quotes. + Update the example accordingly. + +2019-04-10 Eric Abrahamsen + + Note that choose-completion-string-functions funcs take four args + + * lisp/simple.el (choose-completion-string-functions): Functions in + this list actually need to accept four arguments, though the fourth + should be ignored. + +2019-04-10 Gemini Lasswell + + Address name conflicts in EIEIO documentation (bug#31660) + + * doc/misc/eieio.texi (Quick Start): Rename the class used in the + example from 'record' to 'person'. + (Building Classes): Advise user to check for name conflicts before + naming a class. Add a missing apostrophe. + (Making New Objects): Correct grammar. Rename the class used in the + example from 'record' to 'my-class'. + +2019-04-09 Mattias Engdegård + + Clarify the TESTFN argument to `alist-get' + + * lisp/subr.el (alist-get): + Rephrase the initial text to clarify the meaning of the TESTFN argument. + It's an equality predicate, not a look-up function (Bug#35206). + + (cherry picked from commit c81465580fe262f28ce47502c00f4afcbe3b8f8d) + +2019-04-08 Eli Zaretskii + + * src/editfns.c (Fnarrow_to_region): Doc fix. (Bug#35163) + +2019-04-06 Eli Zaretskii + + Fix doc strings of 'vc-version-diff' and 'vc-version-ediff' + + * lisp/vc/vc.el (vc-version-diff, vc-version-ediff): Describe + arguments in the doc strings. (Bug#35019) + +2019-04-06 Eli Zaretskii + + Improve documentation of set-window-start + + * doc/lispref/windows.texi (Window Start and End): + * src/window.c (Fset_window_start): Document that reliable + setting of a window start position requires to adjust point to + be visible. (Bug#34038) + +2019-04-06 Eli Zaretskii + + Improve documentation of window parameters + + * doc/lispref/windows.texi (Cyclic Window Ordering): Describe + the effect of the 'other-window' window parameter. + (Window Parameters): Improve the descriptions of window + parameters. Move the detailed description of the + 'quit-restore' window parameter from here... + (Quitting Windows): ...to here. (Bug#35063) + +2019-04-06 Eli Zaretskii + + Improve commentary in frame.el + + * lisp/frame.el: Improve commentary for display-* functions. + (Bug#35058) + +2019-04-06 Mauro Aranda + + Fix typo in a doc string + + * lisp/autorevert.el (global-auto-revert-mode): Fix a typo. + (Bug#35165) + +2019-03-20 Paul Eggert + + Say which regexp ranges should be avoided + + * doc/lispref/searching.texi (Regexp Special): Say that + regular expressions like "[a-m-z]" and "[[:alpha:]-~]" should + be avoided, for the same reason that regular expressions like + "+" and "*" should be avoided: POSIX says their behavior is + undefined, and they are confusing anyway. Also, explain + better what happens when the bound of a range is a raw 8-bit + byte; the old explanation appears to have been obsolete + anyway. Finally, say that ranges like "[\u00FF-\xFF]" that + mix non-ASCII characters and raw 8-bit bytes should be + avoided, since it’s not clear what they should mean. + +2019-03-20 Nicolas Petton + + * etc/AUTHORS: Update. + + * ; ChangeLog.3 update + 2019-03-20 Eli Zaretskii Improve indexing of the user manual @@ -64946,7 +65091,7 @@ This file records repository revisions from commit 9d56a21e6a696ad19ac65c4b405aeca44785884a (exclusive) to -commit 0f523deec1c1e9e2a5a3474f912aa2183d3fe33d (inclusive). +commit 85829363f728c410e33ffdc3839202977b2115cc (inclusive). See ChangeLog.1 for earlier changes. ;; Local Variables: commit 8297e97f1a31b03828dfd6773e77b18cc5265391 Author: Nicolas Petton Date: Thu Apr 11 21:57:49 2019 +0200 * etc/AUTHORS: Update. diff --git a/etc/AUTHORS b/etc/AUTHORS index 73c5245678..2f7e01575b 100644 --- a/etc/AUTHORS +++ b/etc/AUTHORS @@ -163,7 +163,7 @@ Alexandru Harsanyi: wrote soap-client.el soap-inspect.el and changed emacs3.py vc-hooks.el vc.el xml.el Alex Branham: changed bibtex.el dired-x.el dired.el em-rebind.el eww.el - imenu.el modes.texi programs.texi + imenu.el indent.el modes.texi programs.texi text.texi Alex Coventry: changed files.el @@ -442,8 +442,8 @@ Bartosz Duszel: changed allout.el bib-mode.el cc-cmds.el hexl.el icon.el Basil L. Contovounesios: changed simple.el message.el sequences.texi bibtex.el css-mode-tests.el css-mode.el customize.texi display.texi - gnus-art.el json-tests.el json.el lists.texi man.el modes.texi rcirc.el - shr-color.el text.texi url-handlers.el + gnus-art.el json-tests.el json.el lists.texi man.el modes.texi + newcomment.el rcirc.el shr-color.el text.texi url-handlers.el Bastian Beischer: changed include.el mru-bookmark.el refs.el semantic/complete.el senator.el @@ -1354,8 +1354,8 @@ Eli Zaretskii: wrote [bidirectional display in xdisp.c] tty-colors.el and changed xdisp.c msdos.c w32.c display.texi w32fns.c simple.el files.el fileio.c keyboard.c w32proc.c files.texi w32term.c text.texi - dispnew.c frames.texi emacs.c dispextern.h lisp.h process.c term.c - window.c and 1125 other files + dispnew.c emacs.c frames.texi dispextern.h lisp.h window.c process.c + term.c and 1125 other files Emanuele Giaquinta: changed configure.ac rxvt.el charset.c etags.c fontset.c frame.el gnus-faq.texi loadup.el lread.c sh-script.el @@ -1380,7 +1380,7 @@ Eric Abrahamsen: changed eieio-base.el registry.el nnimap.el gnus-registry.el files.el files.texi windows.texi eieio-test-persist.el eieio.el gnus-start.el gnus-sum.el gnus.texi nnir.el buffers.texi checkdoc.el files-tests.el gnus-bcklg.el gnus-group.el nnmairix.el - org.el org.texi and 3 other files + org.el org.texi and 4 other files Eric Bélanger: changed image.c @@ -1682,9 +1682,9 @@ Geert Kloosterman: changed which-func.el Gemini Lasswell: wrote edebug-tests.el kmacro-tests.el testcover-tests.el and changed edebug.el cl-macs.el cl-generic.el ert-x.el cl-print.el edebug-test-code.el edebug.texi eieio-compat.el generator.el subr.el - autorevert-tests.el cl-print-tests.el emacs-lisp/debug.el eval-tests.el - eval.c filenotify-tests.el generator-tests.el kmacro.el lread.c - map-tests.el map.el and 9 other files + autorevert-tests.el cl-print-tests.el eieio.texi emacs-lisp/debug.el + eval-tests.el eval.c filenotify-tests.el generator-tests.el kmacro.el + lread.c map-tests.el and 10 other files Geoff Gole: changed align.el ibuffer.el whitespace.el @@ -3258,6 +3258,8 @@ Matt Hodges: changed textmodes/table.el faces.el iswitchb.el simple.el edebug.texi eldoc.el em-hist.el em-pred.el fixit.texi icon.el ido.el locate.el paragraphs.el pcomplete.el repeat.el and 3 other files +Mattias Engdegård: changed subr.el + Matt Lundin: changed org-agenda.el org.el org-bibtex.el org-footnote.el ox-publish.el org-bbdb.el org-datetree.el org-gnus.el @@ -3270,7 +3272,7 @@ Matt Simmons: changed message.el Matt Swift: changed dired.el editfns.c lisp-mode.el mm-decode.el outline.el progmodes/compile.el rx.el simple.el startup.el -Mauro Aranda: changed files.texi os.texi +Mauro Aranda: changed autorevert.el files.texi os.texi Maxime Edouard Robert Froumentin: changed gnus-art.el mml.el @@ -3649,7 +3651,7 @@ Noam Postavsky: changed lisp-mode.el progmodes/python.el xdisp.c cl-macs.el lisp-mode-tests.el emacs-lisp/debug.el data.c simple.el term.el ert.el subr.el help-fns.el bytecomp.el cl-print.el elisp-mode.el eval.c ffap.el modes.texi search.c sh-script.el - cl-preloaded.el and 248 other files + cl-preloaded.el and 249 other files Nobuyoshi Nakada: co-wrote ruby-mode.el commit 85829363f728c410e33ffdc3839202977b2115cc Author: Eli Zaretskii Date: Thu Apr 11 17:00:44 2019 +0300 Improve documentation of 'read-command' * src/minibuf.c (Fread_command): Document the return value when DEFAULT-VALUE is nil and the user enters nothing. * doc/lispref/minibuf.texi (High-Level Completion): Document the printed representation of a symbol whose name is empty. (Bug#3522) diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 796be07ef1..3a2a9d82e9 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -1327,7 +1327,8 @@ is a string, @code{read-command} interns it before returning it. If it is a list, @code{read-command} interns the first element of this list. If @var{default} is @code{nil}, that means no default has been specified; then if the user enters null input, the return value is -@code{(intern "")}, that is, a symbol whose name is an empty string. +@code{(intern "")}, that is, a symbol whose name is an empty string, +and whose printed representation is @code{##} (@pxref{Symbol Type}). @example (read-command "Command name? ") diff --git a/src/minibuf.c b/src/minibuf.c index 6964f350ff..a33ddf40a1 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1054,7 +1054,8 @@ the current input method and the setting of`enable-multibyte-characters'. */) DEFUN ("read-command", Fread_command, Sread_command, 1, 2, 0, doc: /* Read the name of a command and return as a symbol. Prompt with PROMPT. By default, return DEFAULT-VALUE or its first element -if it is a list. */) +if it is a list. If DEFAULT-VALUE is omitted or nil, and the user enters +null input, return a symbol whose name is an empty string. */) (Lisp_Object prompt, Lisp_Object default_value) { Lisp_Object name, default_string; commit dc81c051ec9412238c5c3485cf075089205dfb35 Author: Eli Zaretskii Date: Thu Apr 11 16:37:02 2019 +0300 ; * CONTRIBUTE: Mention where to ask for the copyright assignment form. diff --git a/CONTRIBUTE b/CONTRIBUTE index efd4bf10ec..df7220a4ee 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -54,6 +54,12 @@ packages the patch's commit message and changes. To send just one such patch without additional remarks, you can use a command like 'git send-email --to=bug-gnu-emacs@gnu.org 0001-DESCRIPTION.patch'. +Once the cumulative amount of your submissions exceeds about 15 lines +of non-trivial changes, we will need you to assign to the FSF the +copyright for your contributions. Ask on emacs-devel@gnu.org, and we +will send you the necessary form together with the instructions to +fill and email it, in order to start this legal paperwork. + ** Issue tracker (a.k.a. "bug tracker") The Emacs issue tracker at https://debbugs.gnu.org lets you view bug commit b77723a5f371ce0aa4027c6d1c5c831eef94e01d Author: Eli Zaretskii Date: Thu Apr 11 16:25:06 2019 +0300 Fix an outdated URL in a comment * src/emacs.c: Fix reference to Cocoa CoreFoundation Release Notes. (Bug#35225) diff --git a/src/emacs.c b/src/emacs.c index ba57da7213..41a9327941 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -158,9 +158,14 @@ static uprintmax_t heap_bss_diff; /* To run as a background daemon under Cocoa or Windows, we must do a fork+exec, not a simple fork. - On Cocoa, CoreFoundation lib fails in forked process: + On Cocoa, CoreFoundation lib fails in forked process, see Mac OS X + Leopard Developer Release Notes for CoreFoundation Framework: + http://developer.apple.com/ReleaseNotes/ - CoreFoundation/CoreFoundation.html) + CoreFoundation/CoreFoundation.html + + Note: the above is no longer available on-line, but it can be found + via the "Wayback machine", https://web.archive.org. On Windows, a Cygwin fork child cannot access the USER subsystem. commit 71be83ef8b413922c69e614bcc1d434ec7db68f6 Author: Basil L. Contovounesios Date: Thu Apr 4 23:37:08 2019 +0100 Backport: Fix comment-empty-lines docstring (bug#35152) * lisp/newcomment.el (comment-empty-lines): Consistently use US commas in docstring. Fix indentation of and typo in custom :type. (cherry picked from commit 690c678fb6c1fb5b2f828f9bb90782bd0b01c399) diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 2c1ac9d8da..335cbdd336 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -319,11 +319,11 @@ behavior for explicit filling, you might as well use \\[newline-and-indent]." (defcustom comment-empty-lines nil "If nil, `comment-region' does not comment out empty lines. If t, it always comments out empty lines. -If `eol' it only comments out empty lines if comments are -terminated by the end of line (i.e. `comment-end' is empty)." +If `eol', it only comments out empty lines if comments are +terminated by the end of line (i.e., `comment-end' is empty)." :type '(choice (const :tag "Never" nil) - (const :tag "Always" t) - (const :tag "EOl-terminated" eol)) + (const :tag "Always" t) + (const :tag "EOL-terminated" eol)) :group 'comment) ;;;; commit 559f64a0b6b6f915d26ada8283b74ab6bbfbf3b2 Author: Alex Branham Date: Mon Mar 25 20:49:01 2019 -0500 Backport: Update documentation for indent-relative functions * lisp/indent.el (indent-relative): Document what happens when there is no previous nonblank line. * doc/lispref/text.texi (Relative Indent): Document indent-relative-first-indent-point instead of obsolete indent-relative-maybe. Fix documentation of which argument from 'indent-relative' is used. Bug#34858 (cherry picked from commit 10cd65878c741d2a22a1f2c36c54fcad4e516f72) diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index fb5f56e9dd..73312bb0ca 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -2570,11 +2570,11 @@ The quick brown fox jum @point{}ped. @end example @end deffn -@deffn Command indent-relative-maybe +@deffn Command indent-relative-first-indent-point @comment !!SourceFile indent.el This command indents the current line like the previous nonblank line, by calling @code{indent-relative} with @code{t} as the -@var{unindented-ok} argument. The return value is unpredictable. +@var{first-only} argument. The return value is unpredictable. If the previous nonblank line has no indent points beyond the current column, this command does nothing. diff --git a/lisp/indent.el b/lisp/indent.el index 7be5a5ab0f..8a0f837865 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -592,8 +592,9 @@ considered. If the previous nonblank line has no indent points beyond the column point starts at, then `tab-to-tab-stop' is done, if both -FIRST-ONLY and UNINDENTED-OK are nil, otherwise nothing is done -in this case. +FIRST-ONLY and UNINDENTED-OK are nil, otherwise nothing is done. +If there isn't a previous nonblank line and UNINDENTED-OK is nil, +call `tab-to-tab-stop'. See also `indent-relative-first-indent-point'." (interactive "P") commit cb5a34082342695676f2db11e1465bd28347e9de Author: Noam Postavsky Date: Wed Apr 10 19:29:38 2019 -0400 Update nxml-mode.texi: completion now gives xmlns="-!-" * doc/misc/nxml-mode.texi (Completion): As of 2016-01-16 "* lisp/nxml: Use standard completion; it also works for company-mode", completing an attribute when there is only one candidate inserts both quotes. Update the example accordingly. diff --git a/doc/misc/nxml-mode.texi b/doc/misc/nxml-mode.texi index edab900652..2b2c241a6e 100644 --- a/doc/misc/nxml-mode.texi +++ b/doc/misc/nxml-mode.texi @@ -250,7 +250,7 @@ xml:lang xmlns If you input @kbd{xmlns}, the result will be: @example -