commit 32cb84974faac7cecdd82e154f7cae9ac0ee8320 (HEAD, refs/remotes/origin/master) Author: Stefan Kangas Date: Wed Aug 12 19:32:52 2020 +0200 Make erc-compat.el obsolete * lisp/erc/erc-compat.el: Move from here... * lisp/obsolete/erc-compat.el: ...to here. * lisp/erc/erc-backend.el: * lisp/erc/erc-pcomplete.el: * lisp/erc/erc-stamp.el: * lisp/erc/erc-track.el: * lisp/erc/erc.el: Don't require 'erc-compat'. * lisp/erc/erc-backend.el (erc-decode-string-from-target): * lisp/erc/erc-dcc.el (pcomplete/erc-mode/DCC): * lisp/erc/erc-fill.el (erc-fill-mode): * lisp/erc/erc-goodies.el (erc-controls-interpret): * lisp/erc/erc-log.el (erc-log-setup-logging): * lisp/erc/erc-notify.el (erc-notify-QUIT): * lisp/erc/erc.el (erc-startup-file-list, define-erc-module) (erc-canonicalize-server-name, erc-cmd-SV, erc-banlist-update) (erc-group-list, erc-seconds-to-string): Adjust callers. * lisp/erc/erc.el: Require cl-lib and format-spec. * etc/NEWS: Add entry announcing erc-compat.el being marked as obsolete. diff --git a/etc/NEWS b/etc/NEWS index d0be28740e..962389d521 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -721,6 +721,11 @@ Allowed inputs are seconds or ISO8601-like periods like "1h" or "4h30m". *** ERC now recognizes C-] for italic text. Italic text is displayed in the new 'erc-italic-face'. +--- +*** The erc-compat.el library is now marked obsolete. +This file contained ERC compatibility code for Emacs 21 and XEmacs +which is no longer needed. + ** Battery --- diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 4f3d85ba3c..1cf0bb4921 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -98,7 +98,6 @@ ;;; Code: -(require 'erc-compat) (eval-when-compile (require 'cl-lib)) ;; There's a fairly strong mutual dependency between erc.el and erc-backend.el. ;; Luckily, erc.el does not need erc-backend.el for macroexpansion whereas the @@ -782,7 +781,7 @@ value of `erc-server-coding-system'." (pop precedence)) (when precedence (setq coding (car precedence))))) - (erc-decode-coding-string str coding))) + (decode-coding-string str coding t))) ;; proposed name, not used by anything yet (defun erc-send-line (text display-fn) diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index bf98eb818f..477f148197 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -419,7 +419,7 @@ where FOO is one of CLOSE, GET, SEND, LIST, CHAT, etc." (pcomplete-here (pcase (intern (downcase (pcomplete-arg 1))) ('chat (mapcar (lambda (elt) (plist-get elt :nick)) - (erc-remove-if-not + (cl-remove-if-not #'(lambda (elt) (eq (plist-get elt :type) 'CHAT)) erc-dcc-list))) @@ -427,7 +427,7 @@ where FOO is one of CLOSE, GET, SEND, LIST, CHAT, etc." (mapcar (lambda (elt) (symbol-name (plist-get elt :type))) erc-dcc-list))) ('get (mapcar #'erc-dcc-nick - (erc-remove-if-not + (cl-remove-if-not #'(lambda (elt) (eq (plist-get elt :type) 'GET)) erc-dcc-list))) @@ -435,7 +435,7 @@ where FOO is one of CLOSE, GET, SEND, LIST, CHAT, etc." (pcomplete-here (pcase (intern (downcase (pcomplete-arg 2))) ('get (mapcar (lambda (elt) (plist-get elt :file)) - (erc-remove-if-not + (cl-remove-if-not #'(lambda (elt) (and (eq (plist-get elt :type) 'GET) (erc-nick-equal-p (erc-extract-nick @@ -443,7 +443,7 @@ where FOO is one of CLOSE, GET, SEND, LIST, CHAT, etc." (pcomplete-arg 1)))) erc-dcc-list))) ('close (mapcar #'erc-dcc-nick - (erc-remove-if-not + (cl-remove-if-not #'(lambda (elt) (eq (plist-get elt :type) (intern (upcase (pcomplete-arg 1))))) diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el index 39a8be5e0c..d09caf7aa1 100644 --- a/lisp/erc/erc-fill.el +++ b/lisp/erc/erc-fill.el @@ -38,7 +38,7 @@ :group 'erc) ;;;###autoload(autoload 'erc-fill-mode "erc-fill" nil t) -(erc-define-minor-mode erc-fill-mode +(define-minor-mode erc-fill-mode "Toggle ERC fill mode. With a prefix argument ARG, enable ERC fill mode if ARG is positive, and disable it otherwise. If called from Lisp, enable diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el index ff7a77f126..a475f0a177 100644 --- a/lisp/erc/erc-goodies.el +++ b/lisp/erc/erc-goodies.el @@ -399,8 +399,7 @@ See `erc-interpret-controls-p' and `erc-interpret-mirc-color' for options." (start (match-beginning 0)) (end (+ (match-beginning 0) (length (match-string 5 s))))) - (setq s (erc-replace-match-subexpression-in-string - "" s control 1 start)) + (setq s (replace-match "" nil nil s 1)) (cond ((and erc-interpret-mirc-color (or fg-color bg-color)) (setq fg fg-color) (setq bg bg-color)) diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index e2c066da9b..2166123e67 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -267,7 +267,7 @@ The current buffer is given by BUFFER." (with-current-buffer buffer (auto-save-mode -1) (setq buffer-file-name nil) - (erc-set-write-file-functions '(erc-save-buffer-in-logs)) + (set (make-local-variable 'write-file-functions) '(erc-save-buffer-in-logs)) (when erc-log-insert-log-on-open (ignore-errors (save-excursion diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el index 1b092c8a6a..144a981f83 100644 --- a/lisp/erc/erc-notify.el +++ b/lisp/erc/erc-notify.el @@ -181,7 +181,7 @@ nick from `erc-last-ison' to prevent any further notifications." (let ((nick (erc-extract-nick (erc-response.sender parsed)))) (when (and (erc-member-ignore-case nick erc-notify-list) (erc-member-ignore-case nick erc-last-ison)) - (setq erc-last-ison (erc-delete-if + (setq erc-last-ison (cl-delete-if (let ((nick-down (erc-downcase nick))) (lambda (el) (string= nick-down (erc-downcase el)))) diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el index 7643fa85b9..f8b7e13be0 100644 --- a/lisp/erc/erc-pcomplete.el +++ b/lisp/erc/erc-pcomplete.el @@ -41,7 +41,6 @@ (require 'pcomplete) (require 'erc) -(require 'erc-compat) (require 'time-date) (defgroup erc-pcomplete nil diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index cbab2f9da2..08970f2d70 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -35,7 +35,6 @@ ;;; Code: (require 'erc) -(require 'erc-compat) (defgroup erc-stamp nil "For long conversation on IRC it is sometimes quite diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index 41d8fc1a98..820b6d9359 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -36,7 +36,6 @@ (eval-when-compile (require 'cl-lib)) (require 'erc) -(require 'erc-compat) (require 'erc-match) ;;; Code: diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 41d7516fbb..b4800053da 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -57,12 +57,12 @@ (load "erc-loaddefs" nil t) -(eval-when-compile (require 'cl-lib)) +(require 'cl-lib) (require 'font-lock) +(require 'format-spec) (require 'pp) (require 'thingatpt) (require 'auth-source) -(require 'erc-compat) (require 'time-date) (require 'iso8601) (eval-when-compile (require 'subr-x)) @@ -877,8 +877,8 @@ See `erc-server-flood-margin' for other flood-related parameters.") ;; Script parameters (defcustom erc-startup-file-list - (list (concat erc-user-emacs-directory ".ercrc.el") - (concat erc-user-emacs-directory ".ercrc") + (list (concat user-emacs-directory ".ercrc.el") + (concat user-emacs-directory ".ercrc") "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc") "List of files to try for a startup script. The first existent and readable one will get executed. @@ -1306,7 +1306,7 @@ Example: (enable (intern (format "erc-%s-enable" (downcase sn)))) (disable (intern (format "erc-%s-disable" (downcase sn))))) `(progn - (erc-define-minor-mode + (define-minor-mode ,mode ,(format "Toggle ERC %S mode. With a prefix argument ARG, enable %s if ARG is positive, @@ -2688,7 +2688,7 @@ displayed hostnames." otherwise `erc-server-announced-name'. SERVER is matched against `erc-common-server-suffixes'." (when server - (or (cdar (erc-remove-if-not + (or (cdar (cl-remove-if-not (lambda (net) (string-match (car net) server)) erc-common-server-suffixes)) erc-server-announced-name))) @@ -3725,8 +3725,9 @@ the message given by REASON." x-toolkit-scroll-bars))) "") (if (featurep 'multi-tty) ", multi-tty" "")) - (if erc-emacs-build-time - (concat " of " erc-emacs-build-time) + (if emacs-build-time + (concat " of " (format-time-string + "%Y-%m-%d" emacs-build-time)) ""))) t) @@ -4573,7 +4574,7 @@ See also: `erc-echo-notice-in-user-buffers', ((string-match "^-" mode) ;; Remove the unbanned masks from the ban list (setq erc-channel-banlist - (erc-delete-if + (cl-delete-if #'(lambda (y) (member (upcase (cdr y)) (mapcar #'upcase @@ -4594,7 +4595,7 @@ See also: `erc-echo-notice-in-user-buffers', "Group LIST into sublists of length N." (cond ((null list) nil) ((null (nthcdr n list)) (list list)) - (t (cons (erc-subseq list 0 n) (erc-group-list (nthcdr n list) n))))) + (t (cons (cl-subseq list 0 n) (erc-group-list (nthcdr n list) n))))) ;;; MOTD numreplies @@ -6183,8 +6184,7 @@ non-nil value is found. output (apply #'format format-args)) ;; Change all "1 units" to "1 unit". (while (string-match "\\([^0-9]\\|^\\)1 \\S-+\\(s\\)" output) - (setq output (erc-replace-match-subexpression-in-string - "" output (match-string 2 output) 2 (match-beginning 2)))) + (setq output (replace-match "" nil nil output 2))) output)) diff --git a/lisp/erc/erc-compat.el b/lisp/obsolete/erc-compat.el similarity index 99% rename from lisp/erc/erc-compat.el rename to lisp/obsolete/erc-compat.el index d71221b267..7ef30d822f 100644 --- a/lisp/erc/erc-compat.el +++ b/lisp/obsolete/erc-compat.el @@ -5,6 +5,7 @@ ;; Author: Alex Schroeder ;; Maintainer: Amin Bandali ;; URL: https://www.emacswiki.org/emacs/ERC +;; Obsolete-since: 28.1 ;; This file is part of GNU Emacs. commit 48c7caf3aca85f9878ae05bff9a0dca43b8f540b Author: Paul Eggert Date: Thu Aug 13 15:49:43 2020 -0700 Update from Gnulib This incorporates: 2020-08-13 sys_random: Work around an uClibc bug * lib/sys_random.in.h, m4/getrandom.m4, m4/sys_random_h.m4: Copy from Gnulib. diff --git a/lib/sys_random.in.h b/lib/sys_random.in.h index f14ac1f572..a82d716de2 100644 --- a/lib/sys_random.in.h +++ b/lib/sys_random.in.h @@ -23,6 +23,10 @@ #if @HAVE_SYS_RANDOM_H@ +/* On uClibc, assumes prior inclusion of . */ +# if defined __UCLIBC__ +# include +# endif /* On Mac OS X 10.5, assumes prior inclusion of . On Max OS X 10.13, assumes prior inclusion of a file that includes , such as or . */ diff --git a/m4/getrandom.m4 b/m4/getrandom.m4 index 424c2fad3e..d6da71a2c8 100644 --- a/m4/getrandom.m4 +++ b/m4/getrandom.m4 @@ -1,4 +1,4 @@ -# getrandom.m4 serial 7 +# getrandom.m4 serial 8 dnl Copyright 2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -18,7 +18,8 @@ AC_DEFUN([gl_FUNC_GETRANDOM], [gl_cv_func_getrandom_ok], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( - [[/* Additional includes are needed before on Mac OS X. */ + [[/* Additional includes are needed before on uClibc + and Mac OS X. */ #include #include #include diff --git a/m4/sys_random_h.m4 b/m4/sys_random_h.m4 index a964b15784..8c5d53703b 100644 --- a/m4/sys_random_h.m4 +++ b/m4/sys_random_h.m4 @@ -1,4 +1,4 @@ -# sys_random_h.m4 serial 4 +# sys_random_h.m4 serial 5 dnl Copyright (C) 2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -25,7 +25,8 @@ AC_DEFUN([gl_HEADER_SYS_RANDOM], dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ #if HAVE_SYS_RANDOM_H -/* Additional includes are needed before on Mac OS X. */ +/* Additional includes are needed before on uClibc + and Mac OS X. */ # include # include # include commit 727ffbaaf44b001f6b4be49f33dfb784675bada3 Author: Stefan Kangas Date: Thu Aug 13 22:02:18 2020 +0200 Add tests for cl-{incf,decf} * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-test-incf) (cl-lib-test-decf): New tests. diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el b/test/lisp/emacs-lisp/cl-lib-tests.el index 57b9d23efb..40dd7e4eeb 100644 --- a/test/lisp/emacs-lisp/cl-lib-tests.el +++ b/test/lisp/emacs-lisp/cl-lib-tests.el @@ -242,6 +242,22 @@ (should (= (cl-the integer (cl-incf side-effect)) 1)) (should (= side-effect 1)))) +(ert-deftest cl-lib-test-incf () + (let ((var 0)) + (should (= (cl-incf var) 1)) + (should (= var 1))) + (let ((alist)) + (should (= (cl-incf (alist-get 'a alist 0)) 1)) + (should (= (alist-get 'a alist 0) 1)))) + +(ert-deftest cl-lib-test-decf () + (let ((var 1)) + (should (= (cl-decf var) 0)) + (should (= var 0))) + (let ((alist)) + (should (= (cl-decf (alist-get 'a alist 0)) -1)) + (should (= (alist-get 'a alist 0) -1)))) + (ert-deftest cl-lib-test-plusp () (should-not (cl-plusp -1.0e+INF)) (should-not (cl-plusp -1.5e2)) commit 1591b8ab9a0516a5e9b7a2dd66daddf479b75762 Author: Basil L. Contovounesios Date: Thu Aug 13 17:28:21 2020 +0100 ; Touch up last term.el-related changes diff --git a/etc/NEWS b/etc/NEWS index 111cecf92b..d0be28740e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -781,10 +781,10 @@ digits. ** Miscellaneous --- -*** New variable 'term-scroll-snap-to-bottom' -term will, by default, recenter the buffer so that the prompt on the -final line in the window. Setting this new variable to nil inhibits -this behavior. +*** New user option 'term-scroll-snap-to-bottom'. +By default, 'term' and 'ansi-term' will now recenter the buffer so +that the prompt is on the final line in the window. Setting this new +user option to nil inhibits this behavior. *** The new library hierarchy.el has been added. It's a library to create, query, navigate and display hierarchy diff --git a/lisp/term.el b/lisp/term.el index 6f899fcb5c..149405fa41 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -506,6 +506,7 @@ This variable is buffer-local." If non-nil, when the prompt is visible within the window, then scroll so that the prompt is on the bottom on any input or output." + :version "28.1" :type 'boolean) (defcustom term-scroll-show-maximum-output nil commit 2129d6b9dcc7248ef7f0c17b1367a853b2257bfa Author: Alan Third Date: Thu Aug 13 19:00:41 2020 +0100 Fix slow down when moving between monitors (bug#42834) * src/nsterm.m ([EmacsView windowDidChangeBackingProperties:]): Recreate the buffer every time. diff --git a/src/nsterm.m b/src/nsterm.m index 9f5916d78e..c1d133a00e 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -8424,25 +8424,17 @@ - (void)focusOnDrawingBuffer - (void)windowDidChangeBackingProperties:(NSNotification *)notification - /* Update the drawing buffer when the backing scale factor changes. */ + /* Update the drawing buffer when the backing properties change. */ { NSTRACE ("EmacsView windowDidChangeBackingProperties:]"); if (! [self wantsUpdateLayer]) return; - CGFloat old = [[[notification userInfo] - objectForKey:@"NSBackingPropertyOldScaleFactorKey"] - doubleValue]; - CGFloat new = [[self window] backingScaleFactor]; - - if (old != new) - { - NSRect frame = [self frame]; - [self createDrawingBuffer]; - ns_clear_frame (emacsframe); - expose_frame (emacsframe, 0, 0, NSWidth (frame), NSHeight (frame)); - } + NSRect frame = [self frame]; + [self createDrawingBuffer]; + ns_clear_frame (emacsframe); + expose_frame (emacsframe, 0, 0, NSWidth (frame), NSHeight (frame)); } #endif /* NS_DRAW_TO_BUFFER */ commit 975acf5737248eb25900363e01d828a9c1cada64 Author: Tobias Zawada Date: Thu Aug 13 18:42:28 2020 +0200 Handle nil load-path element in read-library-name * lisp/emacs-lisp/find-func.el (read-library-name): Fix handling of nil 'load-path' element. (Bug#41998) Copyright-paperwork-exempt: yes diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index e35db56550..56b3e32a3e 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -292,12 +292,13 @@ if non-nil)." (find-library-suffixes) "\\|")) (table (cl-loop for dir in (or find-function-source-path load-path) - when (file-readable-p dir) + for dir-or-default = (or dir default-directory) + when (file-readable-p dir-or-default) append (mapcar (lambda (file) (replace-regexp-in-string suffix-regexp "" file)) - (directory-files dir nil + (directory-files dir-or-default nil suffix-regexp)))) (def (if (eq (function-called-at-point) 'require) ;; `function-called-at-point' may return 'require commit 3e00a78a32cc50a0e4a587cfafb8850e52331dd7 Author: Glenn Morris Date: Thu Aug 13 16:38:02 2020 +0100 Update a paragraphs test * test/lisp/textmodes/paragraphs-tests.el (paragraphs-tests-mark-paragraph): Update for recent change. diff --git a/test/lisp/textmodes/paragraphs-tests.el b/test/lisp/textmodes/paragraphs-tests.el index fc839fe7d9..0b264e7e18 100644 --- a/test/lisp/textmodes/paragraphs-tests.el +++ b/test/lisp/textmodes/paragraphs-tests.el @@ -50,8 +50,8 @@ (goto-char (point-min)) (mark-paragraph) (should mark-active) - (should (equal (mark) 7))) - (should-error (mark-paragraph 0))) + (should (equal (mark) 7)))) +;;; (should-error (mark-paragraph 0))) (ert-deftest paragraphs-tests-kill-paragraph () (with-temp-buffer commit 0170883c719e2135e509aea49d6d92934b492e31 Author: Glenn Morris Date: Thu Aug 13 16:36:09 2020 +0100 Update a compile test * test/lisp/progmodes/compile-tests.el (compile-test-error-regexps): Update info/warning count for recent compile.el change. diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el index cd736497e6..d566e7dd86 100644 --- a/test/lisp/progmodes/compile-tests.el +++ b/test/lisp/progmodes/compile-tests.el @@ -435,8 +435,8 @@ The test data is in `compile-tests--test-regexps-data'." (compilation-num-infos-found 0)) (mapc #'compile--test-error-line compile-tests--test-regexps-data) (should (eq compilation-num-errors-found 94)) - (should (eq compilation-num-warnings-found 37)) - (should (eq compilation-num-infos-found 26))))) + (should (eq compilation-num-warnings-found 35)) + (should (eq compilation-num-infos-found 28))))) (ert-deftest compile-test-grep-regexps () "Test the `grep-regexp-alist' regexps. commit 87811b4fe18ea9884da96c225d63ffcb9a7016d4 Merge: 7b63844bca 69568674b3 Author: Glenn Morris Date: Thu Aug 13 07:51:03 2020 -0700 Merge from origin/emacs-27 69568674b3 (origin/emacs-27) Improve documentation of function argume... 1c0bc1ccd8 Improve documentation of special events commit 7b63844bca87e20be8b456b16b2e3577241743a4 Merge: a1f9e7beea c9a739408d Author: Glenn Morris Date: Thu Aug 13 07:51:03 2020 -0700 ; Merge from origin/emacs-27 The following commits were skipped: c9a739408d Fix face merging at EOL when inherited face specifies :extend f946e48bf5 Fix face extension past EOL in overlay strings commit a1f9e7beea337b5b7c5accb7780101f5e0cdd357 Merge: 4431e6edd5 63f614d76c Author: Glenn Morris Date: Thu Aug 13 07:51:03 2020 -0700 Merge from origin/emacs-27 63f614d76c Fix comint-redirect-results-list regexp usage (Bug#42662) commit 4431e6edd5e82bd661456130368c35710a0f8cf2 Merge: b9bc86e068 6dada01015 Author: Glenn Morris Date: Thu Aug 13 07:51:03 2020 -0700 ; Merge from origin/emacs-27 The following commit was skipped: 6dada01015 ; Bump Emacs version to 27.1.50 commit b9bc86e068407ba67bac7503b2beae1bfa17b3bc Merge: 1bed252ae9 86d8d76aa3 Author: Glenn Morris Date: Thu Aug 13 07:51:02 2020 -0700 Merge from origin/emacs-27 86d8d76aa3 (tag: emacs-27.1-rc2, tag: emacs-27.1) ; lisp/ldefs-boot.e... a6634197da * etc/HISTORY: Update the Emacs 27.1 release date. a68b3f761a ; Update ChangeLog.3 7cc85e7b51 ; Update etc/AUTHORS 1ca4da054b ; * etc/NEWS: fix some quoting 5578febcd4 ; * lisp/so-long.el: Documentation fa20e443c8 lisp/so-long.el: Improve support for major mode hooks # Conflicts: # etc/AUTHORS # etc/NEWS commit 69568674b3bb5b5f65f2c1342aded205a00f696a Author: Eli Zaretskii Date: Thu Aug 13 17:08:37 2020 +0300 Improve documentation of function argument lists * doc/lispref/functions.texi (Lambda Components) (Defining Functions): Add a cross-reference to "Argument List". (Argument List): Improve the section name. (Bug#42750) diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index bc8ec0ef1b..2898cb4d2b 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -267,7 +267,8 @@ reason functions are defined to start with @code{lambda} is so that other lists, intended for other uses, will not accidentally be valid as functions. - The second element is a list of symbols---the argument variable names. + The second element is a list of symbols---the argument variable +names (@pxref{Argument List}). This is called the @dfn{lambda list}. When a Lisp function is called, the argument values are matched up against the variables in the lambda list, which are given local bindings with the values provided. @@ -342,7 +343,7 @@ stored as symbol function definitions to produce named functions (@pxref{Function Names}). @node Argument List -@subsection Other Features of Argument Lists +@subsection Features of Argument Lists @kindex wrong-number-of-arguments @cindex argument binding @cindex binding arguments @@ -583,8 +584,8 @@ a function. @defmac defun name args [doc] [declare] [interactive] body@dots{} @code{defun} is the usual way to define new Lisp functions. It defines the symbol @var{name} as a function with argument list -@var{args} and body forms given by @var{body}. Neither @var{name} nor -@var{args} should be quoted. +@var{args} (@pxref{Argument List}) and body forms given by @var{body}. +Neither @var{name} nor @var{args} should be quoted. @var{doc}, if present, should be a string specifying the function's documentation string (@pxref{Function Documentation}). @var{declare}, commit 1c0bc1ccd85615bcc26409ee047513e9e26f108e Author: Eli Zaretskii Date: Thu Aug 13 16:53:14 2020 +0300 Improve documentation of special events * doc/lispref/commands.texi (Misc Events): Explain how to bind special events to commands. diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index d25f009361..25f657404f 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -1845,6 +1845,13 @@ is, after a prefix key---then Emacs reorders the events so that this event comes either before or after the multi-event key sequence, not within it. + Some of these special events, such as @code{delete-frame}, invoke +Emacs commands by default; others are not bound. If you want to +arrange for a special event to invoke a command, you can do that via +@code{special-event-map}. The command you bind to a function key in +that map can then examine the full event which invoked it in +@code{last-input-event}. @xref{Special Events}. + @node Event Examples @subsection Event Examples commit c9a739408d286b52782c9005dcac97304c13d273 Author: Eli Zaretskii Date: Tue Aug 11 17:39:35 2020 +0300 Fix face merging at EOL when inherited face specifies :extend * src/xfaces.c (merge_face_ref): Handle correctly faces that inherit from another, and in addition specify :extend. (Bug#42552) (cherry picked from commit 39c90f8dfabe158ad7ac9243aa9b9dedb9409e19) diff --git a/src/xfaces.c b/src/xfaces.c index 12eb7de66e..66d6c34030 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -2394,6 +2394,7 @@ merge_face_ref (struct window *w, { bool ok = true; /* Succeed without an error? */ Lisp_Object filtered_face_ref; + bool attr_filter_passed = false; filtered_face_ref = face_ref; do @@ -2490,6 +2491,7 @@ merge_face_ref (struct window *w, || UNSPECIFIEDP (scratch_attrs[attr_filter])) return true; } + attr_filter_passed = true; } while (CONSP (face_ref) && CONSP (XCDR (face_ref))) { @@ -2653,9 +2655,21 @@ merge_face_ref (struct window *w, { /* This is not really very useful; it's just like a normal face reference. */ - if (! merge_face_ref (w, f, value, to, - err_msgs, named_merge_points, - attr_filter)) + if (attr_filter_passed) + { + /* We already know that this face was tested + against attr_filter and was found applicable, + so don't pass attr_filter to merge_face_ref. + This is for when a face is specified like + (:inherit FACE :extend t), but the parent + FACE itself doesn't specify :extend. */ + if (! merge_face_ref (w, f, value, to, + err_msgs, named_merge_points, 0)) + err = true; + } + else if (! merge_face_ref (w, f, value, to, + err_msgs, named_merge_points, + attr_filter)) err = true; } else if (EQ (keyword, QCextend)) commit f946e48bf5bfe051e77eee4c3c19633cbbb6e8c2 Author: Eli Zaretskii Date: Thu Jul 30 16:56:36 2020 +0300 Fix face extension past EOL in overlay strings * src/xdisp.c (face_at_pos): Pass ATTR_FILTER to face_for_overlay_string. * src/xfaces.c (face_for_overlay_string): Accept an additional argument ATTR_INDEX and pass it to merge_face_ref for merging the face at POS. This ensures a face from buffer text will not be merged unless it specifies the :extend attribute. (Bug#42552) * src/dispextern.h (face_for_overlay_string): Adjust prototype. (cherry picked from commit 35564bea4d73bc266743216599d01d644aed6fd8) diff --git a/src/dispextern.h b/src/dispextern.h index 724aad4227..6b72e68d31 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3559,7 +3559,7 @@ void recompute_basic_faces (struct frame *); int face_at_buffer_position (struct window *, ptrdiff_t, ptrdiff_t *, ptrdiff_t, bool, int, enum lface_attribute_index); int face_for_overlay_string (struct window *, ptrdiff_t, ptrdiff_t *, ptrdiff_t, - bool, Lisp_Object); + bool, Lisp_Object, enum lface_attribute_index); int face_at_string_position (struct window *, Lisp_Object, ptrdiff_t, ptrdiff_t, ptrdiff_t *, enum face_id, bool, enum lface_attribute_index); diff --git a/src/xdisp.c b/src/xdisp.c index a819f0aca3..37fe380078 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -4322,7 +4322,7 @@ face_at_pos (const struct it *it, enum lface_attribute_index attr_filter) (IT_CHARPOS (*it) + TEXT_PROP_DISTANCE_LIMIT), false, - from_overlay); + from_overlay, attr_filter); } else { diff --git a/src/xfaces.c b/src/xfaces.c index 711ec48bbd..12eb7de66e 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -6330,7 +6330,8 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos, int face_for_overlay_string (struct window *w, ptrdiff_t pos, ptrdiff_t *endptr, ptrdiff_t limit, - bool mouse, Lisp_Object overlay) + bool mouse, Lisp_Object overlay, + enum lface_attribute_index attr_filter) { struct frame *f = XFRAME (w->frame); Lisp_Object attrs[LFACE_VECTOR_SIZE]; @@ -6369,7 +6370,7 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos, /* Merge in attributes specified via text properties. */ if (!NILP (prop)) - merge_face_ref (w, f, prop, attrs, true, NULL, 0); + merge_face_ref (w, f, prop, attrs, true, NULL, attr_filter); *endptr = endpos; commit 1bed252ae9109493133a0cc3e9aad9e9a5ddde37 Author: Juri Linkov Date: Thu Aug 13 13:32:10 2020 +0200 Preserve the face foreground in Info-fontify-node * lisp/info.el (Info-fontify-node): Preserve the face foreground. Previously `Info-index' added the `info-index-match' face to the strings of the found index entries. Later `Info-virtual-index-find-node' inserts strings to the Info buffer. And finally `Info-fontify-node' puts the `font-lock-face' property with `info-xref' on links. The `face info-index-match' takes precedence over `font-lock-face info-xref' (bug#14645). diff --git a/lisp/info.el b/lisp/info.el index 78f88947c7..c8318a3967 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -4971,9 +4971,8 @@ first line or header line, and for breadcrumb links.") "mouse-2: go to this node") 'mouse-face 'highlight))) (when (or not-fontified-p fontify-visited-p) - (put-text-property + (add-face-text-property (match-beginning 1) (match-end 1) - 'font-lock-face ;; Display visited menu items in a different face (if (and Info-fontify-visited-nodes (save-match-data @@ -5002,7 +5001,9 @@ first line or header line, and for breadcrumb links.") (caar hl)))) (setq res (car hl) hl nil) (setq hl (cdr hl)))) - res))) 'info-xref-visited 'info-xref))) + res))) + 'info-xref-visited 'info-xref) + 'append)) (when (and not-fontified-p (memq Info-hide-note-references '(t hide)) (not (Info-index-node))) commit c84d3c1638a140b3ca16e8285328a903e16aa27e Author: Ryan Crum Date: Thu Aug 13 13:02:17 2020 +0200 Add a new variable to not recenter term on all input * lisp/term.el (term-scroll-snap-to-bottom): New variable (bug#15744). * lisp/term.el (term-emulate-terminal): Use it. diff --git a/etc/NEWS b/etc/NEWS index 2be9743a45..111cecf92b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -780,6 +780,12 @@ digits. ** Miscellaneous +--- +*** New variable 'term-scroll-snap-to-bottom' +term will, by default, recenter the buffer so that the prompt on the +final line in the window. Setting this new variable to nil inhibits +this behavior. + *** The new library hierarchy.el has been added. It's a library to create, query, navigate and display hierarchy structures. diff --git a/lisp/term.el b/lisp/term.el index b990c83cfc..6f899fcb5c 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -501,6 +501,13 @@ This variable is buffer-local." :type 'boolean :group 'term) +(defcustom term-scroll-snap-to-bottom t + "Control whether to keep the prompt at the bottom of the window. +If non-nil, when the prompt is visible within the window, then +scroll so that the prompt is on the bottom on any input or +output." + :type 'boolean) + (defcustom term-scroll-show-maximum-output nil "Controls how interpreter output causes window to scroll. If non-nil, then show the maximum output when the window is scrolled. @@ -3108,15 +3115,19 @@ See `term-prompt-regexp'." (or (eq scroll 'this) (not save-point))) (and (eq scroll 'others) (not (eq selected win)))) - (goto-char term-home-marker) - (recenter 0) + (when term-scroll-snap-to-bottom + (goto-char term-home-marker) + (recenter 0)) (goto-char (process-mark proc)) (if (not (pos-visible-in-window-p (point) win)) (recenter -1))) ;; Optionally scroll so that the text ;; ends at the bottom of the window. (when (and term-scroll-show-maximum-output - (>= (point) (process-mark proc))) + (>= (point) (process-mark proc)) + (or term-scroll-snap-to-bottom + (not (pos-visible-in-window-p + (point-max) win)))) (save-excursion (goto-char (point-max)) (recenter -1))))) commit 53720a9bdedaf75eebf199897740561a4040b5c4 Author: Dima Kogan Date: Thu Aug 13 12:20:53 2020 +0200 gcc-include compilation lines are now INFO, instead of WARNING * lisp/progmodes/compile.el (compilation-error-regexp-alist-alist): Prior to this patch the line that contains "from a.h:1:0," was seen as INFO and the line that contains "from a.c:1:" was seen as a WARNING. This patch makes them both INFO (bug#17826). diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 0b9f417845..3106c61585 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -316,8 +316,8 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) (gcc-include "^\\(?:In file included \\| \\|\t\\)from \ \\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\):\ -\\([0-9]+\\)\\(?::\\([0-9]+\\)\\)?\\(?:\\(:\\)\\|\\(,\\|$\\)\\)?" - 1 2 3 (4 . 5)) +\\([0-9]+\\)\\(?::\\([0-9]+\\)\\)?\\(?:\\([:,]\\|$\\)\\)?" + 1 2 3 (nil . 4)) (ruby-Test::Unit "^ [[ ]?\\([^ (].*\\):\\([1-9][0-9]*\\)\\(\\]\\)?:in " 1 2) commit e9eafd22681b8e95d8d642def0512d9290564206 Author: Lars Ingebrigtsen Date: Thu Aug 13 12:01:01 2020 +0200 Ensure that server-socket-dir doesn't have "//" in the path * lisp/server.el (server-socket-dir): Use expand-file-name to avoid "//" in the path name (if either XDG_RUNTIME_DIR or TMPDIR ends in a slash) (bug#18658). diff --git a/lisp/server.el b/lisp/server.el index 1861218147..9934e1c1be 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -274,10 +274,11 @@ the \"-f\" switch otherwise." (if internal--daemon-sockname (file-name-directory internal--daemon-sockname) (and (featurep 'make-network-process '(:family local)) - (let ((xdg_runtime_dir (getenv "XDG_RUNTIME_DIR"))) - (if xdg_runtime_dir - (format "%s/emacs" xdg_runtime_dir) - (format "%s/emacs%d" (or (getenv "TMPDIR") "/tmp") (user-uid)))))) + (let ((runtime-dir (getenv "XDG_RUNTIME_DIR"))) + (if runtime-dir + (expand-file-name "emacs" runtime-dir) + (expand-file-name (format "emacs%d" (user-uid)) + (or (getenv "TMPDIR") "/tmp")))))) "The directory in which to place the server socket. If local sockets are not supported, this is nil.") commit eb090f65ceb0ae8a90829e911694348583135ba5 Author: H. Dieter Wilhelm Date: Thu Aug 13 11:51:17 2020 +0200 Handle negative prefix arguments to mark-paragraph correctly * textmodes/paragraph.el (mark-paragraph): Handle negative arguments correctly (bug#18847). This makes `M- M-h M-h' do the correct thing with expanding the region (like other marking commands) backwards. Also fix problem at the end of the buffer, where the numbers of paragraphs left in the buffer is less than ARG, then paragraphs would also be marked *before* the current paragraph. Also clarify the doc string. diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index e22e3f4899..b097529142 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el @@ -371,33 +371,50 @@ See `forward-paragraph' for more information." (defun mark-paragraph (&optional arg allow-extend) "Put point at beginning of this paragraph, mark at end. -The paragraph marked is the one that contains point or follows point. +The paragraph marked is the one that contains point or follows +point. -With argument ARG, puts mark at end of a following paragraph, so that -the number of paragraphs marked equals ARG. +With argument ARG, puts mark at the end of this or a following +paragraph, so that the number of paragraphs marked equals ARG. -If ARG is negative, point is put at end of this paragraph, mark is put -at beginning of this or a previous paragraph. +If ARG is negative, point is put at the end of this paragraph, +mark is put at the beginning of this or a previous paragraph. Interactively (or if ALLOW-EXTEND is non-nil), if this command is -repeated or (in Transient Mark mode) if the mark is active, -it marks the next ARG paragraphs after the ones already marked." - (interactive "p\np") - (unless arg (setq arg 1)) - (when (zerop arg) - (error "Cannot mark zero paragraphs")) - (cond ((and allow-extend - (or (and (eq last-command this-command) (mark t)) - (and transient-mark-mode mark-active))) - (set-mark - (save-excursion - (goto-char (mark)) - (forward-paragraph arg) - (point)))) - (t - (forward-paragraph arg) - (push-mark nil t t) - (backward-paragraph arg)))) +repeated or (in Transient Mark mode) if the mark is active, it +marks the next ARG paragraphs after the region already marked. +This also means when activating the mark immediately before using +this command, the current paragraph is only marked from point." + (interactive "P\np") + (let ((numeric-arg (prefix-numeric-value arg))) + (cond ((zerop numeric-arg)) + ((and allow-extend + (or (and (eq last-command this-command) mark-active) + (region-active-p))) + (if arg + (setq arg numeric-arg) + (if (< (mark) (point)) + (setq arg -1) + (setq arg 1))) + (set-mark + (save-excursion + (goto-char (mark)) + (forward-paragraph arg) + (point)))) + ;; don't activate the mark when at eob + ((and (eobp) (> numeric-arg 0))) + (t + (unless (save-excursion + (forward-line 0) + (looking-at paragraph-start)) + (backward-paragraph (cond ((> numeric-arg 0) 1) + ((< numeric-arg 0) -1) + (t 0)))) + (push-mark + (save-excursion + (forward-paragraph numeric-arg) + (point)) + t t))))) (defun kill-paragraph (arg) "Kill forward to end of paragraph. commit 838a1a313caf9695a518c69b553abc1389b22495 Author: Jonas Bernoulli Date: Sun Aug 9 23:02:34 2020 +0200 Update section heading conventions for libraries * doc/lispref/tips.texi (Comment Tips): Update information on section headings to reflect common usage. Previously the tips stated that if the code is split up into multiple sections, then that should be done by splitting up the ";;; Code:" section into multiple sub-sections. However about half the libraries in Emacs instead use multiple top-level sections. We update the tips (aka conventions) to allow this common usage, but because it is awkward if there is a section named "Code", which contains only some of the code instead of all of it, we now recommend that that section should be empty in this case. We cannot just give up on the "Code:" section/heading because that is an old convention that is followed be nearly every library and because it is likely that there are some utilities out there that depend on its presence. This was discussed in https://lists.gnu.org/archive/html/emacs-devel/2020-07/msg00444.html https://lists.gnu.org/archive/html/emacs-devel/2020-08/msg00001.html diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index 5b09b2ccea..6292054d30 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi @@ -918,29 +918,56 @@ values. It is much better to convert such comments to documentation strings, though. @item ;;; -Comments that start with three semicolons, @samp{;;;}, should start at -the left margin. We use them -for comments which should be considered a -heading by Outline minor mode. By default, comments starting with -at least three semicolons (followed by a single space and a -non-whitespace character) are considered headings, comments starting -with two or fewer are not. Historically, triple-semicolon comments have -also been used for commenting out lines within a function, but this use -is discouraged. - -When commenting out entire functions, use two semicolons. - -@item ;;;; -Comments that start with four (or more) semicolons, @samp{;;;;}, -should be aligned to the left margin and are used for headings of -major sections of a program. For example: + +Comments that start with three (or more) semicolons, @samp{;;;}, +should start at the left margin. We use them for comments that should +be considered a heading by Outline minor mode. By default, comments +starting with at least three semicolons (followed by a single space +and a non-whitespace character) are considered section headings, +comments starting with two or fewer are not. + +(Historically, triple-semicolon comments have also been used for +commenting out lines within a function, but this use is discouraged in +favor of using just two semicolons. This also applies when commenting +out entire functions; when doing that use two semicolons as well.) + +Three semicolons are used for top-level sections, four for +sub-sections, five for sub-sub-sections and so on. + +Typically libraries have at least four top-level sections. For +example when the bodies of all of these sections are hidden: @smallexample -;;;; The kill ring +@group +;;; backquote.el --- implement the ` Lisp construct... +;;; Commentary:... +;;; Code:... +;;; backquote.el ends here +@end group @end smallexample -If you wish to have sub-headings under these heading, use more -semicolons to nest these sub-headings. +(In a sense the last line is not a section heading as it must +never be followed by any text; after all it marks the end of the +file.) + +For longer libraries it is advisable to split the code into multiple +sections. This can be done by splitting the @samp{Code:} section into +multiple sub-sections. Even though that was the only recommended +approach for a long time, many people have chosen to use multiple +top-level code sections instead. You may chose either style. + +Using multiple top-level code sections has the advanatage that it +avoids introducing an additional nesting level but it also means that +the section named @samp{Code} does not contain all the code, which is +awkward. To avoid that, you should put no code at all inside that +section; that way it can be considered a seperator instead of a +section heading. + +Finally, we recommend that you don't end headings with a colon or any +other punctuation for that matter. For historic reasons the +@samp{Code:} and @samp{Commentary:} headings end with a colon, but we +recommend that you don't do the same for other headings anyway. + @end table @noindent commit 7cb029d4d32b0f43c37e6129420db8ea8ed5e900 Author: Jonas Bernoulli Date: Mon Jul 27 22:48:08 2020 +0200 ; * lisp/emacs-lisp/autoload.el: Begin summary line with three semicolons. diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index c263aa0907..2eef451200 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -1,4 +1,4 @@ -;; autoload.el --- maintain autoloads in loaddefs.el -*- lexical-binding: t -*- +;;; autoload.el --- maintain autoloads in loaddefs.el -*- lexical-binding: t -*- ;; Copyright (C) 1991-1997, 2001-2020 Free Software Foundation, Inc. commit 2d93342a2715c657a8ef621594a90720bc6964e7 Author: Jonas Bernoulli Date: Wed Jul 15 18:40:36 2020 +0200 * lisp/font-lock.el: No longer use headings as end of section markers. Each section ends right before the following section begins and IMO that means that it is unnecessary to mark the end of sections. For users of `outline-minor-mode' the old end-of-section markers were a distraction. They made it much harder to parse the overview outline state because each section heading was followed by a end-of-section marker that was formatted as a section heading. Because of this I wanted to remove the end-of-section markers. But as Eli pointed out these sections are long and not everyone uses `outline-minor-mode'. So instead of removing them, I am turning the end-of-section markers into regular comments (beginning with just two semicolons) instead of section headings (beginning with tree semicolons). That way users of `outline-minor-mode' won't be distracted by them and others can still benefit from the markers as before. diff --git a/lisp/font-lock.el b/lisp/font-lock.el index cf88100ab5..c633877e64 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -986,7 +986,7 @@ The value of this variable is used when Font Lock mode is turned on." ((bound-and-true-p lazy-lock-mode) (lazy-lock-after-unfontify-buffer)))) -;;; End of Font Lock Support mode. +;; End of Font Lock Support mode. ;;; Fontification functions. @@ -1393,7 +1393,7 @@ delimit the region to fontify." (font-lock-fontify-region (point) (mark))) ((error quit) (message "Fontifying block...%s" error-data))))))) -;;; End of Fontification functions. +;; End of Fontification functions. ;;; Additional text property functions. @@ -1485,7 +1485,7 @@ Optional argument OBJECT is the string or buffer containing the text." (put-text-property start next prop new object)))))) (setq start (text-property-not-all next end prop nil object))))) -;;; End of Additional text property functions. +;; End of Additional text property functions. ;;; Syntactic regexp fontification functions. @@ -1591,7 +1591,7 @@ START should be at the beginning of a line." (setq highlights (cdr highlights)))) (setq keywords (cdr keywords))))) -;;; End of Syntactic regexp fontification functions. +;; End of Syntactic regexp fontification functions. ;;; Syntactic fontification functions. @@ -1650,7 +1650,7 @@ START should be at the beginning of a line." (setq state (parse-partial-sexp (point) end nil nil state 'syntax-table)))))) -;;; End of Syntactic fontification functions. +;; End of Syntactic fontification functions. ;;; Keyword regexp fontification functions. @@ -1784,9 +1784,9 @@ LOUDLY, if non-nil, allows progress-meter bar." (setq keywords (cdr keywords))) (set-marker pos nil))) -;;; End of Keyword regexp fontification functions. +;; End of Keyword regexp fontification functions. -;; Various functions. +;;; Various functions. (defun font-lock-compile-keywords (keywords &optional syntactic-keywords) "Compile KEYWORDS into the form (t KEYWORDS COMPILED...) @@ -2102,7 +2102,7 @@ Sets various variables using `font-lock-defaults' and "Font Lock mode face used to highlight grouping constructs in Lisp regexps." :group 'font-lock-faces) -;;; End of Color etc. support. +;; End of Color etc. support. ;;; Menu support. @@ -2204,7 +2204,7 @@ Sets various variables using `font-lock-defaults' and ;; ;; Deactivate less/more fontification entries. ;; (setq font-lock-fontify-level nil)) -;;; End of Menu support. +;; End of Menu support. ;;; Various regexp information shared by several modes. ;; ;; Information specific to a single mode should go in its load library. commit b88e5b4e6dc498be1ddc061df23f9b6cda811cb7 Author: Jonas Bernoulli Date: Wed Jun 17 02:59:41 2020 +0200 * lisp/font-lock.el: Split the Commentary into subsections. The "Commentary" was already split into multiple sections, but these sections where on the same level as "Commentary" itself, which is less convenient for users of `outline-minor-mode'. diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 5cda4a693d..cf88100ab5 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -51,7 +51,7 @@ ;; also the variable `font-lock-maximum-size'. Support modes for Font Lock ;; mode can be used to speed up Font Lock mode. See `font-lock-support-mode'. -;;; How Font Lock mode fontifies: +;;;; How Font Lock mode fontifies: ;; When Font Lock mode is turned on in a buffer, it (a) fontifies the entire ;; buffer and (b) installs one of its fontification functions on one of the @@ -96,7 +96,7 @@ ;; some syntactic parsers for common languages and a son-of-font-lock.el could ;; use them rather then relying so heavily on the keyword (regexp) pass. -;;; How Font Lock mode supports modes or is supported by modes: +;;;; How Font Lock mode supports modes or is supported by modes: ;; Modes that support Font Lock mode do so by defining one or more variables ;; whose values specify the fontification. Font Lock mode knows of these @@ -112,7 +112,7 @@ ;; Font Lock mode fontification behavior can be modified in a number of ways. ;; See the below comments and the comments distributed throughout this file. -;;; Constructing patterns: +;;;; Constructing patterns: ;; See the documentation for the variable `font-lock-keywords'. ;; @@ -120,7 +120,7 @@ ;; `font-lock-syntactic-keywords' can be generated via the function ;; `regexp-opt'. -;;; Adding patterns for modes that already support Font Lock: +;;;; Adding patterns for modes that already support Font Lock: ;; Though Font Lock highlighting patterns already exist for many modes, it's ;; likely there's something that you want fontified that currently isn't, even @@ -135,7 +135,7 @@ ;; other variables. For example, additional C types can be specified via the ;; variable `c-font-lock-extra-types'. -;;; Adding patterns for modes that do not support Font Lock: +;;;; Adding patterns for modes that do not support Font Lock: ;; Not all modes support Font Lock mode. If you (as a user of the mode) add ;; patterns for a new mode, you must define in your ~/.emacs a variable or @@ -155,7 +155,7 @@ ;; (set (make-local-variable 'font-lock-defaults) ;; '(foo-font-lock-keywords t)))) -;;; Adding Font Lock support for modes: +;;;; Adding Font Lock support for modes: ;; Of course, it would be better that the mode already supports Font Lock mode. ;; The package author would do something similar to above. The mode must commit 54097328c55bbae67922e27a28b6845b4798e522 Author: Jonas Bernoulli Date: Wed Jun 17 03:00:12 2020 +0200 * lisp/net/imap.el: Use proper outline headings This library already used section headings but it used just two instead of three semicolons, making them indistinguishable from plain comments. One heading is new. diff --git a/lisp/net/imap.el b/lisp/net/imap.el index a492dc8c79..22b5908400 100644 --- a/lisp/net/imap.el +++ b/lisp/net/imap.el @@ -134,6 +134,7 @@ ;; ;;; Code: +;;; Dependencies (eval-when-compile (require 'cl-lib)) (require 'utf7) @@ -145,7 +146,7 @@ (declare-function digest-md5-digest-uri "ext:digest-md5") (declare-function digest-md5-challenge "ext:digest-md5") -;; User variables. +;;; User variables (defgroup imap nil "Low-level IMAP issues." @@ -257,7 +258,7 @@ Shorter values mean quicker response, but is more CPU intensive." :group 'imap :type 'boolean) -;; Various variables. +;;; Various variables (defvar imap-fetch-data-hook nil "Hooks called after receiving each FETCH response.") @@ -316,7 +317,9 @@ the value of this variable will be bound to a certain value to which an application program that uses this module specifies on a per-server basis.") -;; Internal constants. Change these and die. +;;; Internal constants + +;; Change these and die. (defconst imap-default-port 143) (defconst imap-default-ssl-port 993) @@ -348,7 +351,7 @@ basis.") (defconst imap-log-buffer "*imap-log*") (defconst imap-debug-buffer "*imap-debug*") -;; Internal variables. +;;; Internal variables (defvar imap-stream nil) (defvar imap-auth nil) @@ -437,7 +440,7 @@ This variable is set to t automatically per server if the canonical form fails.") -;; Utility functions: +;;; Utility functions (defun imap-remassoc (key alist) "Delete by side effect any elements of ALIST whose car is `equal' to KEY. @@ -489,7 +492,8 @@ sure of changing the value of `foo'." (nth 3 (car imap-failed-tags)))) -;; Server functions; stream stuff: +;;; Server functions +;;;; Stream functions (defun imap-log (string-or-buffer) (when imap-log @@ -747,7 +751,7 @@ sure of changing the value of `foo'." (message "imap: Connecting with STARTTLS...%s" (if done "done" "failed")) done)) -;; Server functions; authenticator stuff: +;;;; Authenticator functions (defun imap-interactive-login (buffer loginfunc) "Login to server in BUFFER. @@ -871,7 +875,7 @@ t if it successfully authenticates, nil otherwise." (concat "LOGIN anonymous \"" (concat (user-login-name) "@" (system-name)) "\""))))) -;;; Compiler directives. +;;; Compiler directives (defvar imap-sasl-client) (defvar imap-sasl-step) @@ -969,7 +973,7 @@ t if it successfully authenticates, nil otherwise." (imap-send-command-1 "") (imap-ok-p (imap-wait-for-tag tag))))))) -;; Server functions: +;;; Server functions (defun imap-open-1 (buffer) (with-current-buffer buffer @@ -1228,7 +1232,7 @@ If BUFFER is nil, the current buffer is assumed." (imap-send-command-wait "LOGOUT" buffer))) -;; Mailbox functions: +;;; Mailbox functions (defun imap-mailbox-put (propname value &optional mailbox buffer) (with-current-buffer (or buffer (current-buffer)) @@ -1520,7 +1524,7 @@ or `unseen'. The IMAP command tag is returned." identifier)))))) -;; Message functions: +;;; Message functions (defun imap-current-message (&optional buffer) (with-current-buffer (or buffer (current-buffer)) @@ -1832,7 +1836,7 @@ on failure." (if (aref from 0) ">")))) -;; Internal functions. +;;; Internal functions (defun imap-add-callback (tag func) (setq imap-callbacks (append (list (cons tag func)) imap-callbacks))) @@ -1969,7 +1973,7 @@ Return nil if no complete line has arrived." (delete-region (point-min) (point-max))))))))) -;; Imap parser. +;;; Imap parser (defsubst imap-forward () (or (eobp) (forward-char))) @@ -2850,6 +2854,8 @@ Return nil if no complete line has arrived." (imap-forward) (nreverse body))))) +;;; Debug + (when imap-debug ; (untrace-all) (require 'trace) (buffer-disable-undo (get-buffer-create imap-debug-buffer)) commit e118b797730bc0d139382f2ab60d23a36308f5c2 Author: Jonas Bernoulli Date: Fri May 8 21:24:20 2020 +0200 * lisp/obsolete/longlines.el: Use proper outline headings. This library already used section headings but it used just two instead of three semicolons, making them indistinguishable from plain comments. One heading is new. diff --git a/lisp/obsolete/longlines.el b/lisp/obsolete/longlines.el index 2fba49f402..cbe453aa6b 100644 --- a/lisp/obsolete/longlines.el +++ b/lisp/obsolete/longlines.el @@ -37,6 +37,7 @@ ;; Special thanks to Rod Smith for many useful bug reports. ;;; Code: +;;; Options (defgroup longlines nil "Automatic wrapping of long lines when loading files." @@ -76,7 +77,7 @@ This is used when `longlines-show-hard-newlines' is on." :group 'longlines :type 'string) -;; Internal variables +;;; Internal variables (defvar longlines-wrap-beg nil) (defvar longlines-wrap-end nil) @@ -90,7 +91,7 @@ This is used when `longlines-show-hard-newlines' is on." (make-variable-buffer-local 'longlines-showing) (make-variable-buffer-local 'longlines-decoded) -;; Mode +;;; Mode (defvar message-indent-citation-function) @@ -210,7 +211,7 @@ This function exists to be called by `change-major-mode-hook' when the major mode changes." (longlines-mode 0)) -;; Showing the effect of hard newlines in the buffer +;;; Showing the effect of hard newlines in the buffer (defun longlines-show-hard-newlines (&optional arg) "Make hard newlines visible by adding a face. @@ -252,7 +253,7 @@ With optional argument ARG, make the hard newlines invisible again." (setq pos (text-property-not-all (1+ pos) (point-max) 'hard nil))) (restore-buffer-modified-p mod))) -;; Wrapping the paragraphs. +;;; Wrapping the paragraphs (defun longlines-wrap-region (beg end) "Wrap each successive line, starting with the line before BEG. @@ -402,7 +403,7 @@ Hard newlines are left intact." (setq pos (string-match "\n" str (1+ pos)))) str)) -;; Auto wrap +;;; Auto wrap (defun longlines-auto-wrap (&optional arg) "Toggle automatic line wrapping. @@ -457,7 +458,7 @@ This is called by `window-configuration-change-hook'." (setq fill-column (- (window-width) dw)) (longlines-wrap-region (point-min) (point-max))))) -;; Isearch +;;; Isearch (defun longlines-search-function () (cond @@ -477,7 +478,7 @@ This is called by `window-configuration-change-hook'." (let ((search-spaces-regexp " *[ \n]")) (re-search-forward string bound noerror count))) -;; Loading and saving +;;; Loading and saving (defun longlines-before-revert-hook () (add-hook 'after-revert-hook 'longlines-after-revert-hook nil t) @@ -492,7 +493,7 @@ This is called by `window-configuration-change-hook'." (list 'longlines "Automatically wrap long lines." nil nil 'longlines-encode-region t nil)) -;; Unloading +;;; Unloading (defun longlines-unload-function () "Unload the longlines library." commit cb58a3c5526c0818ae4ddb1f9e4fa41ce5c64688 Author: Jonas Bernoulli Date: Mon Apr 20 23:32:19 2020 +0200 * test/src/emacs-module-tests.el: Use proper outline headings. This library already used section headings but it used just two instead of three semicolons, making them indistinguishable from plain comments. diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el index 51b2ca0cd5..0fd8e1db49 100644 --- a/test/src/emacs-module-tests.el +++ b/test/src/emacs-module-tests.el @@ -24,6 +24,7 @@ ;; module in test/data/emacs-module. ;;; Code: +;;; Prelude (require 'cl-lib) (require 'ert) @@ -48,9 +49,7 @@ (cl-defmethod emacs-module-tests--generic ((_ user-ptr)) 'user-ptr) -;; -;; Basic tests. -;; +;;; Basic tests (ert-deftest mod-test-sum-test () (should (= (mod-test-sum 1 2) 3)) @@ -103,9 +102,7 @@ changes." ">" eos) (prin1-to-string func))))) -;; -;; Non-local exists (throw, signal). -;; +;;; Non-local exists (throw, signal) (ert-deftest mod-test-non-local-exit-signal-test () (should-error (mod-test-signal)) @@ -142,9 +139,7 @@ changes." (should (equal (mod-test-non-local-exit-funcall (lambda () (throw 'tag 32))) '(throw tag 32)))) -;; -;; String tests. -;; +;;; String tests (defun multiply-string (s n) "Return N copies of S concatenated together." @@ -168,9 +163,7 @@ changes." (ert-deftest mod-test-string-a-to-b-test () (should (string= (mod-test-string-a-to-b "aaa") "bbb"))) -;; -;; User-pointer tests. -;; +;;; User-pointer tests (ert-deftest mod-test-userptr-fun-test () (let* ((n 42) @@ -184,9 +177,7 @@ changes." ;; TODO: try to test finalizer -;; -;; Vector tests. -;; +;;; Vector tests (ert-deftest mod-test-vector-test () (dolist (s '(2 10 100 1000)) commit 9d267db8fa25bbbb8d360d133402aece918624af Author: Jonas Bernoulli Date: Mon Apr 20 23:30:07 2020 +0200 * lisp/mail/smtpmail.el: Use outline headings. diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index f5c9432879..666395e0b9 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -53,6 +53,7 @@ ;; See http://www.ietf.org/rfc/rfc2554.txt ;;; Code: +;;; Dependencies (require 'sendmail) (require 'auth-source) @@ -61,12 +62,12 @@ (autoload 'message-make-message-id "message") (autoload 'rfc2104-hash "rfc2104") -;;; +;;; Options + (defgroup smtpmail nil "SMTP protocol for sending mail." :group 'mail) - (defcustom smtpmail-default-smtp-server nil "Specify default SMTP server. This only has effect if you specify it before loading the smtpmail library." @@ -172,8 +173,7 @@ mean \"try again\"." :type 'integer :version "27.1") -;; End of customizable variables. - +;;; Variables (defvar smtpmail-address-buffer) (defvar smtpmail-recipient-address-list) @@ -192,6 +192,8 @@ for `smtpmail-try-auth-method'.") (defvar smtpmail-mail-address nil "Value to use for envelope-from address for mail from ambient buffer.") +;;; Functions + ;;;###autoload (defun smtpmail-send-it () (let ((errbuf (if mail-interactive commit d59c018a20514eb371b65ab325b81933b4f9d4a8 Author: Jonas Bernoulli Date: Wed Jun 17 02:59:48 2020 +0200 ; * lisp/whitespace.el: Capitalize "Code" section heading. diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 42c4b61daf..8a1bb8ade8 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -262,7 +262,7 @@ ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; code: +;;; Code: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; commit aaa69dc92308b99cc5ded78389a4669ae10f46dd Author: Jonas Bernoulli Date: Mon Apr 20 23:29:29 2020 +0200 * lisp/progmodes/compile.el: Remove unnecessary comments. These comments are unnecessary because the doc-strings that follow already cover the same ground, while being more concise. These comments were also prefixed with too many semicolons, causing them to be treated as outline headings. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index a76a3c44a3..0b9f417845 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -2373,12 +2373,10 @@ and runs `compilation-filter-hook'." (set-marker min nil) (set-marker max nil)))))) -;;; test if a buffer is a compilation buffer, assuming we're in the buffer (defsubst compilation-buffer-internal-p () "Test if inside a compilation buffer." (local-variable-p 'compilation-locs)) -;;; test if a buffer is a compilation buffer, using compilation-buffer-internal-p (defsubst compilation-buffer-p (buffer) "Test if BUFFER is a compilation buffer." (with-current-buffer buffer commit 0bc9e7b8f5658c3f4f2d881de3aed158c6f49021 Author: Jonas Bernoulli Date: Mon Apr 20 23:30:41 2020 +0200 Merge two conditions and fix indentation The motivation behind this change is that the indentation of some lines was outright wrong. If we address that issue, then we might as well also address the issue that some code is needlessly nested an additional level. That we can fix by merging the conditions. By doing these two changes in on commit we have to change the fewest lines. Even though we are moving to using just spaces for indentation of the modified lines, other lines in the same function are left alone and continue to us tabs+spaces for indentation. That is not "wrong", but just the style we are slowly migrating away from when touching lines for other reasons. Discussed in bug#42397. * lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message): Merge two conditions and fix indentation. diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 19b3bd78ae..4825b5c5e6 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -289,13 +289,13 @@ Otherwise work like `message'." (or (window-in-direction 'above (minibuffer-window)) (minibuffer-selected-window) (get-largest-window))) - (when mode-line-format - (unless (and (listp mode-line-format) - (assq 'eldoc-mode-line-string mode-line-format)) + (when (and mode-line-format + (not (and (listp mode-line-format) + (assq 'eldoc-mode-line-string mode-line-format)))) (setq mode-line-format (list "" '(eldoc-mode-line-string (" " eldoc-mode-line-string " ")) - mode-line-format)))) + mode-line-format))) (setq eldoc-mode-line-string (when (stringp format-string) (apply #'format-message format-string args))) commit c5b9d2a4b46c6da7d5c88a8c51be5294b2d5edc9 Author: Jonas Bernoulli Date: Tue Feb 18 16:42:20 2020 +0100 Split EasyPG libraries into outline sections * lisp/epa-dired.el: lisp/epa-file.el: lisp/epa-hook.el: lisp/epa-mail.el: lisp/epa.el: lisp/epg-config.el: lisp/epg.el: Split into outline sections. * lisp/epg.el (epg-error): Move definition. diff --git a/lisp/epa-dired.el b/lisp/epa-dired.el index 9269ea9707..4ff1ba3394 100644 --- a/lisp/epa-dired.el +++ b/lisp/epa-dired.el @@ -1,4 +1,5 @@ ;;; epa-dired.el --- the EasyPG Assistant, dired extension -*- lexical-binding: t -*- + ;; Copyright (C) 2006-2020 Free Software Foundation, Inc. ;; Author: Daiki Ueno diff --git a/lisp/epa-file.el b/lisp/epa-file.el index bbd9279a9a..3b0cc84e5f 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el @@ -1,4 +1,5 @@ ;;; epa-file.el --- the EasyPG Assistant, transparent file encryption -*- lexical-binding: t -*- + ;; Copyright (C) 2006-2020 Free Software Foundation, Inc. ;; Author: Daiki Ueno @@ -21,10 +22,13 @@ ;; along with GNU Emacs. If not, see . ;;; Code: +;;; Dependencies (require 'epa) (require 'epa-hook) +;;; Options + (defcustom epa-file-cache-passphrase-for-symmetric-encryption nil "If non-nil, cache passphrase for symmetric encryption. @@ -49,6 +53,8 @@ encryption is used." (const :tag "Don't ask" silent)) :group 'epa-file) +;;; Other + (defvar epa-file-passphrase-alist nil) (defun epa-file-passphrase-callback-function (context key-id file) @@ -72,6 +78,8 @@ encryption is used." passphrase)))) (epa-passphrase-callback-function context key-id file))) +;;; File Handler + (defvar epa-inhibit nil "Non-nil means don't try to decrypt .gpg files when operating on them.") @@ -311,6 +319,8 @@ If no one is selected, symmetric encryption will be performed. " (message "Wrote %s" buffer-file-name)))) (put 'write-region 'epa-file 'epa-file-write-region) +;;; Commands + (defun epa-file-select-keys () "Select recipients for encryption." (interactive) diff --git a/lisp/epa-hook.el b/lisp/epa-hook.el index a86f23eb68..6f12f8a6bf 100644 --- a/lisp/epa-hook.el +++ b/lisp/epa-hook.el @@ -1,4 +1,5 @@ ;;; epa-hook.el --- preloaded code to enable epa-file.el -*- lexical-binding: t -*- + ;; Copyright (C) 2006-2020 Free Software Foundation, Inc. ;; Author: Daiki Ueno diff --git a/lisp/epa-mail.el b/lisp/epa-mail.el index 63475256ca..6e6c0a498d 100644 --- a/lisp/epa-mail.el +++ b/lisp/epa-mail.el @@ -1,4 +1,5 @@ ;;; epa-mail.el --- the EasyPG Assistant, minor-mode for mail composer -*- lexical-binding: t -*- + ;; Copyright (C) 2006-2020 Free Software Foundation, Inc. ;; Author: Daiki Ueno @@ -21,10 +22,13 @@ ;; along with GNU Emacs. If not, see . ;;; Code: +;;; Dependencies (require 'epa) (require 'mail-utils) +;;; Local Mode + (defvar epa-mail-mode-map (let ((keymap (make-sparse-keymap))) (define-key keymap "\C-c\C-ed" 'epa-mail-decrypt) @@ -50,6 +54,8 @@ "A minor-mode for composing encrypted/clearsigned mails." nil " epa-mail" epa-mail-mode-map) +;;; Utilities + (defun epa-mail--find-usable-key (keys usage) "Find a usable key from KEYS for USAGE. USAGE would be `sign' or `encrypt'." @@ -64,6 +70,8 @@ USAGE would be `sign' or `encrypt'." (setq pointer (cdr pointer)))) (setq keys (cdr keys))))) +;;; Commands + ;;;###autoload (defun epa-mail-decrypt () "Decrypt OpenPGP armors in the current buffer. @@ -241,6 +249,8 @@ The buffer is expected to contain a mail message." (interactive) (epa-import-armor-in-region (point-min) (point-max))) +;;; Global Mode + ;;;###autoload (define-minor-mode epa-global-mail-mode "Minor mode to hook EasyPG into Mail mode." diff --git a/lisp/epa.el b/lisp/epa.el index a2c5fb4673..d190824293 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -21,6 +21,7 @@ ;; along with GNU Emacs. If not, see . ;;; Code: +;;; Dependencies (require 'epg) (require 'font-lock) @@ -30,6 +31,8 @@ (require 'wid-edit)) (require 'derived) +;;; Options + (defgroup epa nil "The EasyPG Assistant" :version "23.1" @@ -73,6 +76,8 @@ The command `epa-mail-encrypt' uses this." :group 'epa :version "24.4") +;;; Faces + (defgroup epa-faces nil "Faces for epa-mode." :version "23.1" @@ -146,6 +151,8 @@ The command `epa-mail-encrypt' uses this." :type '(repeat (cons symbol face)) :group 'epa-faces) +;;; Variables + (defvar epa-font-lock-keywords '(("^\\*" (0 'epa-mark)) @@ -252,6 +259,8 @@ You should bind this variable with `let', but do not set it globally.") (defvar epa-exit-buffer-function #'quit-window) +;;; Key Widget + (define-widget 'epa-key 'push-button "Button for representing an epg-key object." :format "%[%v%]" @@ -293,6 +302,8 @@ You should bind this variable with `let', but do not set it globally.") (epg-sub-key-id (car (epg-key-sub-key-list (widget-get widget :value)))))) +;;; Modes + (define-derived-mode epa-key-list-mode special-mode "EPA Keys" "Major mode for `epa-list-keys'." (buffer-disable-undo) @@ -316,6 +327,9 @@ You should bind this variable with `let', but do not set it globally.") (setq truncate-lines t buffer-read-only t)) +;;; Commands +;;;; Marking + (defun epa-mark-key (&optional arg) "Mark a key on the current line. If ARG is non-nil, unmark the key." @@ -338,11 +352,15 @@ If ARG is non-nil, mark the key." (interactive "P") (epa-mark-key (not arg))) +;;;; Quitting + (defun epa-exit-buffer () "Exit the current buffer using `epa-exit-buffer-function'." (interactive) (funcall epa-exit-buffer-function)) +;;;; Listing and Selecting + (defun epa--insert-keys (keys) (save-excursion (save-restriction @@ -505,6 +523,8 @@ If SECRET is non-nil, list secret keys instead of public keys." (let ((keys (epg-list-keys context names secret))) (epa--select-keys prompt keys))) +;;;; Key Details + (defun epa-show-key () "Show a key on the current line." (interactive) @@ -591,6 +611,8 @@ If SECRET is non-nil, list secret keys instead of public keys." (goto-char (point-min)) (pop-to-buffer (current-buffer)))) +;;;; Encryption and Signatures + (defun epa-display-info (info) (if epa-popup-info-window (save-selected-window @@ -1182,6 +1204,8 @@ If no one is selected, symmetric encryption will be performed. ") 'start-open t 'end-open t))))) +;;;; Key Management + ;;;###autoload (defun epa-delete-keys (keys &optional allow-secret) "Delete selected KEYS." diff --git a/lisp/epg-config.el b/lisp/epg-config.el index 1c42924652..9f0c7e4c50 100644 --- a/lisp/epg-config.el +++ b/lisp/epg-config.el @@ -22,6 +22,7 @@ ;; along with GNU Emacs. If not, see . ;;; Code: +;;; Prelude (eval-when-compile (require 'cl-lib)) @@ -34,6 +35,8 @@ (define-obsolete-variable-alias 'epg-bug-report-address 'report-emacs-bug-address "27.1") +;;; Options + (defgroup epg () "Interface to the GNU Privacy Guard (GnuPG)." :tag "EasyPG" @@ -106,6 +109,8 @@ through the minibuffer, instead of external Pinentry program." Note that the buffer name starts with a space." :type 'boolean) +;;; Constants + (defconst epg-gpg-minimum-version "1.4.3") (defconst epg-gpg2-minimum-version "2.1.6") @@ -133,6 +138,8 @@ The first element of each entry is protocol symbol, which is either `OpenPGP' or `CMS'. The second element is a function which constructs a configuration object (actually a plist).") +;;; "Configuration" + (defvar epg--configurations nil) ;;;###autoload diff --git a/lisp/epg.el b/lisp/epg.el index df79988c48..96af3ad4bc 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -1,4 +1,5 @@ ;;; epg.el --- the EasyPG Library -*- lexical-binding: t -*- + ;; Copyright (C) 1999-2000, 2002-2020 Free Software Foundation, Inc. ;; Author: Daiki Ueno @@ -21,10 +22,15 @@ ;; along with GNU Emacs. If not, see . ;;; Code: +;;; Prelude (require 'epg-config) (eval-when-compile (require 'cl-lib)) +(define-error 'epg-error "GPG error") + +;;; Variables + (defvar epg-user-id nil "GnuPG ID of your default identity.") @@ -41,6 +47,8 @@ (defvar epg-agent-file nil) (defvar epg-agent-mtime nil) +;;; Enums + ;; from gnupg/common/openpgpdefs.h (defconst epg-cipher-algorithm-alist '((0 . "NONE") @@ -169,7 +177,8 @@ (defvar epg-prompt-alist nil) -(define-error 'epg-error "GPG error") +;;; Structs +;;;; Data Struct (cl-defstruct (epg-data (:constructor nil) @@ -180,6 +189,8 @@ (file nil :read-only t) (string nil :read-only t)) +;;;; Context Struct + (cl-defstruct (epg-context (:constructor nil) (:constructor epg-context--make @@ -218,6 +229,8 @@ (error-output "") error-buffer) +;;;; Context Methods + ;; This is not an alias, just so we can mark it as autoloaded. ;;;###autoload (defun epg-make-context (&optional protocol armor textmode include-certs @@ -281,6 +294,8 @@ callback data (if any)." (declare (obsolete setf "25.1")) (setf (epg-context-signers context) signers)) +;;;; Other Structs + (cl-defstruct (epg-signature (:constructor nil) (:constructor epg-make-signature @@ -385,6 +400,8 @@ callback data (if any)." secret-unchanged not-imported imports) +;;; Functions + (defun epg-context-result-for (context name) "Return the result of CONTEXT associated with NAME." (cdr (assq name (epg-context-result context)))) @@ -850,6 +867,8 @@ callback data (if any)." (format "Untrusted key %s %s. Use anyway? " key-id user-id)) "Use untrusted key anyway? "))) +;;; Status Functions + (defun epg--status-GET_BOOL (context string) (let (inhibit-quit) (condition-case nil @@ -1225,6 +1244,8 @@ callback data (if any)." (epg-context-result-for context 'import-status))) (epg-context-set-result-for context 'import-status nil))) +;;; Functions + (defun epg-passphrase-callback-function (context key-id _handback) (declare (obsolete epa-passphrase-callback-function "23.1")) (if (eq key-id 'SYM) @@ -1294,6 +1315,8 @@ callback data (if any)." (if (aref line 6) (epg--time-from-seconds (aref line 6))))) +;;; Public Functions + (defun epg-list-keys (context &optional name mode) "Return a list of epg-key objects matched with NAME. If MODE is nil or `public', only public keyring should be searched. @@ -2023,6 +2046,8 @@ If you are unsure, use synchronous version of this function (epg-errors-to-string errors)))))) (epg-reset context))) +;;; Decode Functions + (defun epg--decode-percent-escape (string) (setq string (encode-coding-string string 'raw-text)) (let ((index 0)) commit 562bbd0a367b8d4239215c70f8548fed5ab47bac Author: Jonas Bernoulli Date: Wed Jun 17 22:22:53 2020 +0200 ; * lisp/epg.el (epg-no-data-reason-alist): Fix typo in message. diff --git a/lisp/epg.el b/lisp/epg.el index e53aa8caaa..df79988c48 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -123,7 +123,7 @@ (defconst epg-no-data-reason-alist '((1 . "No armored data") - (2 . "Expected a packet but did not found one") + (2 . "Expected a packet but did not find one") (3 . "Invalid packet found, this may indicate a non OpenPGP message") (4 . "Signature expected but not found"))) commit 7ba75919ab0fc683afc304d67cf0d1bbe6d300e8 Author: Jonas Bernoulli Date: Wed Jul 15 19:07:03 2020 +0200 ; * lisp/epg.el (epg-signature-to-string): Tiny refactor. `concat' treats arguments that are nil as if they were empty strings. We therefore do not have to write (if TEST THEN "") and can just use (and TEST THEN). diff --git a/lisp/epg.el b/lisp/epg.el index 65decf3cf5..e53aa8caaa 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -412,24 +412,20 @@ callback data (if any)." (revoked-key "Signature made by revoked key ") (no-pubkey "No public key for ")) key-id - (if user-id - (concat " " - (if (stringp user-id) - (epg--decode-percent-escape-as-utf-8 user-id) - (epg-decode-dn user-id))) - "") - (if (epg-signature-validity signature) - (format " (trust %s)" (epg-signature-validity signature)) - "") - (if (epg-signature-creation-time signature) - (format-time-string " created at %Y-%m-%dT%T%z" - (epg-signature-creation-time signature)) - "") - (if pubkey-algorithm - (concat " using " - (or (cdr (assq pubkey-algorithm epg-pubkey-algorithm-alist)) - (format "(unknown algorithm %d)" pubkey-algorithm))) - "")))) + (and user-id + (concat " " + (if (stringp user-id) + (epg--decode-percent-escape-as-utf-8 user-id) + (epg-decode-dn user-id)))) + (and (epg-signature-validity signature) + (format " (trust %s)" (epg-signature-validity signature))) + (and (epg-signature-creation-time signature) + (format-time-string " created at %Y-%m-%dT%T%z" + (epg-signature-creation-time signature))) + (and pubkey-algorithm + (concat " using " + (or (cdr (assq pubkey-algorithm epg-pubkey-algorithm-alist)) + (format "(unknown algorithm %d)" pubkey-algorithm))))))) (defun epg-verify-result-to-string (verify-result) "Convert VERIFY-RESULT to a human readable string." commit 944608851c81e279287051c2a243faee7b59f3be Author: Jonas Bernoulli Date: Wed Jul 15 19:05:30 2020 +0200 ; * lisp/epg.el (epg-signature-to-string): Use cl-case. In this case we can greatly increase readability by using `cl-case' instead of `cond'. diff --git a/lisp/epg.el b/lisp/epg.el index 5b90bc290a..65decf3cf5 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -404,18 +404,13 @@ callback data (if any)." (pubkey-algorithm (epg-signature-pubkey-algorithm signature)) (key-id (epg-signature-key-id signature))) (concat - (cond ((eq (epg-signature-status signature) 'good) - "Good signature from ") - ((eq (epg-signature-status signature) 'bad) - "Bad signature from ") - ((eq (epg-signature-status signature) 'expired) - "Expired signature from ") - ((eq (epg-signature-status signature) 'expired-key) - "Signature made by expired key ") - ((eq (epg-signature-status signature) 'revoked-key) - "Signature made by revoked key ") - ((eq (epg-signature-status signature) 'no-pubkey) - "No public key for ")) + (cl-case (epg-signature-status signature) + (good "Good signature from ") + (bad "Bad signature from ") + (expired "Expired signature from ") + (expired-key "Signature made by expired key ") + (revoked-key "Signature made by revoked key ") + (no-pubkey "No public key for ")) key-id (if user-id (concat " " commit 63f614d76c115d1d4af447ce90177cf0183b5757 Author: Phil Sainty Date: Thu Aug 13 01:16:16 2020 +1200 Fix comint-redirect-results-list regexp usage (Bug#42662) * lisp/comint.el (comint-redirect-results-list-from-process): Don't treat the literal string argument COMMAND as a regexp. diff --git a/lisp/comint.el b/lisp/comint.el index bf376a0b81..3e76c5d02b 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -3835,7 +3835,7 @@ REGEXP-GROUP is the regular expression group in REGEXP to use." (set-buffer output-buffer) (goto-char (point-min)) ;; Skip past the command, if it was echoed - (and (looking-at command) + (and (looking-at (regexp-quote command)) (forward-line)) (while (and (not (eobp)) (re-search-forward regexp nil t)) commit 6dada01015c10c016892802fbb2632a6235eebdd Author: Eli Zaretskii Date: Tue Aug 11 21:24:16 2020 +0300 ; Bump Emacs version to 27.1.50 * configure.ac: * README: * nt/README.W32: * msdos/sed2v2.inp: * etc/NEWS: Bump Emacs version to 27.1.50. diff --git a/README b/README index 5482f719c3..279a66b3af 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ Copyright (C) 2001-2020 Free Software Foundation, Inc. See the end of the file for license conditions. -This directory tree holds version 27.1 of GNU Emacs, the extensible, +This directory tree holds version 27.1.50 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 40bc610f9b..ff159726aa 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, 27.1, bug-gnu-emacs@gnu.org, , https://www.gnu.org/software/emacs/) +AC_INIT(GNU Emacs, 27.1.50, bug-gnu-emacs@gnu.org, , https://www.gnu.org/software/emacs/) 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/etc/NEWS b/etc/NEWS index d0a24c23f3..ffa1ba4a89 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -21,6 +21,35 @@ Temporary note: When you add a new item, use the appropriate mark if you are sure it applies, and please also update docstrings as needed. + +* Installation Changes in Emacs 27.2 + + +* Startup Changes in Emacs 27.2 + + +* Changes in Emacs 27.2 + +This is a bug-fix release with no new features. + + +* Editing Changes in Emacs 27.2 + + +* Changes in Specialized Modes and Packages in Emacs 27.2 + + +* New Modes and Packages in Emacs 27.2 + + +* Incompatible Lisp Changes in Emacs 27.2 + + +* Lisp Changes in Emacs 27.2 + + +* Changes in Emacs 27.2 on Non-Free Operating Systems + * Installation Changes in Emacs 27.1 diff --git a/msdos/sed2v2.inp b/msdos/sed2v2.inp index c1ec9ff0ca..8191dd15cc 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 "27.1"/ +/^#undef PACKAGE_VERSION/s/^.*$/#define PACKAGE_VERSION "27.1.50"/ /^#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 8f2e277eca..3c44c583af 100644 --- a/nt/README.W32 +++ b/nt/README.W32 @@ -1,7 +1,7 @@ Copyright (C) 2001-2020 Free Software Foundation, Inc. See the end of the file for license conditions. - Emacs version 27.1 for MS-Windows + Emacs version 27.1.50 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 86d8d76aa36037184db0b2897c434cdaab1a9ae8 (tag: refs/tags/emacs-27.1-rc2, tag: refs/tags/emacs-27.1) Author: Nicolas Petton Date: Tue Aug 4 22:05:24 2020 +0200 ; lisp/ldefs-boot.el: Update. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 18935f80aa..c755bdfde3 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -30768,7 +30768,7 @@ values), despite potential performance issues, type \\[so-long-revert]. Use \\[so-long-commentary] for more information. -Use \\[so-long-customize] to configure the behavior. +Use \\[so-long-customize] to configure the behaviour. \(fn)" t nil) @@ -30805,7 +30805,7 @@ or call the function `global-so-long-mode'.") (custom-autoload 'global-so-long-mode "so-long" nil) (autoload 'global-so-long-mode "so-long" "\ -Toggle automated performance mitigation for files with long lines. +Toggle automated performance mitigations for files with long lines. If called interactively, enable Global So-Long mode if ARG is positive, and disable it if ARG is zero or negative. If called from @@ -30824,7 +30824,7 @@ When such files are detected by `so-long-predicate', we invoke the selected Use \\[so-long-commentary] for more information. -Use \\[so-long-customize] to configure the behavior. +Use \\[so-long-customize] to configure the behaviour. \(fn &optional ARG)" t nil) commit a6634197dac0ce0863e5d017bccc3af32764288a Author: Nicolas Petton Date: Tue Aug 4 21:41:07 2020 +0200 * etc/HISTORY: Update the Emacs 27.1 release date. diff --git a/etc/HISTORY b/etc/HISTORY index f0fd7d6f21..a6b9f57814 100644 --- a/etc/HISTORY +++ b/etc/HISTORY @@ -220,7 +220,7 @@ GNU Emacs 26.2 (2019-04-12) emacs-26.2 GNU Emacs 26.3 (2019-08-28) emacs-26.3 -GNU Emacs 27.1 (2020-08-06) emacs-27.1 +GNU Emacs 27.1 (2020-08-10) emacs-27.1 ---------------------------------------------------------------------- commit a68b3f761aa299e9449785476ba9a9777d38ae22 Author: Nicolas Petton Date: Tue Aug 4 21:32:27 2020 +0200 ; Update ChangeLog.3 diff --git a/ChangeLog.3 b/ChangeLog.3 index c8dd40b5eb..6418f9c8a2 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -1,3 +1,99 @@ +2020-08-03 Phil Sainty + + lisp/so-long.el: Improve support for major mode hooks + + * lisp/so-long.el (so-long-remember-all, so-long-disable-minor-modes) + (so-long-override-variables): Store and use the `so-long-minor-modes' + and `so-long-variable-overrides' values seen by the original major + mode, so that buffer-local changes made in the major mode hook will be + respected. + + Add documentation of this and other major mode hook usage. + +2020-08-02 Grégory Mounié (tiny change) + + Avoid segfaults if XIM is set but not xim_styles + + Emacs segfaults at the X11 initialization if XIM is set + and xim_styles is NULL. This patch avoids the crash. + * src/xfns.c: Check also if FRAME_X_XIM_STYLES(f) is NULL. + (Bug#42676) (Bug#42673) (Bug#42677) + +2020-07-31 Philipp Stephani + + Backport: Make checking for liveness of global values more precise. + + We can't just use a hash lookup because a global and a local reference + might refer to the same Lisp object. + + * src/emacs-module.c (module_free_global_ref): More precise check for + global liveness. + + (cherry picked from commit 9f01ce6327af886f26399924a9aadf16cdd4fd9f) + +2020-07-31 Philipp Stephani + + Backport: Fix subtle bug when checking liveness of module values. + + We can't simply look up the Lisp object in the global reference table + because an invalid local and a valid global reference might refer to + the same object. Instead, we have to test the address of the global + reference against the stored references. + + * src/emacs-module.c (module_global_reference_p): New helper function. + (value_to_lisp): Use it. + + (cherry picked from commit 6355a3ec62f43c9b99d483982ff851d32dd78891) + +2020-07-31 Philipp Stephani + + Backport: Fix memory leak for global module objects (Bug#42482). + + Instead of storing the global values in a global 'emacs_value_storage' + object, store them as hash values alongside the reference counts. + That way the garbage collector takes care of cleaning them up. + + * src/emacs-module.c (global_storage): Remove. + (struct module_global_reference): New pseudovector type. + (XMODULE_GLOBAL_REFERENCE): New helper function. + (module_make_global_ref, module_free_global_ref): Use + 'module_global_reference' struct for global reference values. + (value_to_lisp, module_handle_nonlocal_exit): Adapt to deletion of + 'global_storage'. + + (cherry picked from commit 5c5eb9790898e4ab10bcbbdb6871947ed3018569) + +2020-07-30 Nicolas Petton + + * admin/authors.el (authors-aliases): Remove a faulty regexp. + +2020-07-29 Stefan Kangas + + * doc/lispref/symbols.texi (Definitions): Fix typo. + +2020-07-28 Nicolas Petton + + * etc/HISTORY: Add Emacs 27.1 release date. + +2020-07-28 Nicolas Petton + + Bump Emacs version to 27.1 + + * README: + * configure.ac: + * msdos/sed2v2.inp: + * nt/README.W32: Bump Emacs version. + +2020-07-28 Nicolas Petton + + * etc/AUTHORS: Update. + +2020-07-28 Nicolas Petton + + Update authors.el + + * admin/authors.el (authors-aliases): Add author aliases. + 2020-07-28 Nicolas Petton * etc/NEWS: Remove temporary markup. @@ -142382,7 +142478,7 @@ This file records repository revisions from commit 9d56a21e6a696ad19ac65c4b405aeca44785884a (exclusive) to -commit 56f958807c0b8ea8f45e3c088157ca144a1b1fac (inclusive). +commit 1ca4da054be7eb340c511d817f3ec89c8b819db7 (inclusive). See ChangeLog.2 for earlier changes. ;; Local Variables: commit 7cc85e7b5120a5a5effad12087b5af02f69b94ed Author: Nicolas Petton Date: Tue Aug 4 21:32:04 2020 +0200 ; Update etc/AUTHORS diff --git a/etc/AUTHORS b/etc/AUTHORS index 848d9e07f9..c2b5d9ddd2 100644 --- a/etc/AUTHORS +++ b/etc/AUTHORS @@ -766,7 +766,7 @@ and co-wrote longlines.el tango-dark-theme.el tango-theme.el and changed simple.el display.texi xdisp.c files.el frames.texi cus-edit.el files.texi custom.el subr.el text.texi faces.el keyboard.c startup.el package.el misc.texi emacs.texi modes.texi mouse.el - custom.texi image.c window.el and 934 other files + custom.texi image.c window.el and 933 other files Chris Chase: co-wrote idlw-shell.el idlwave.el @@ -1447,7 +1447,7 @@ Eli Zaretskii: wrote [bidirectional display in xdisp.c] and changed xdisp.c msdos.c w32.c display.texi w32fns.c simple.el files.el fileio.c keyboard.c w32term.c emacs.c w32proc.c files.texi text.texi dispnew.c frames.texi lisp.h dispextern.h window.c process.c - term.c and 1192 other files + term.c and 1191 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 @@ -1532,7 +1532,7 @@ and changed c.srt ede.texi info.el rmail.el speedbspec.el cedet.el ede-autoconf.srt ede-make.srt eieio.texi gud.el sb-dir-minus.xpm sb-dir-plus.xpm sb-dir.xpm sb-mail.xpm sb-pg-minus.xpm sb-pg-plus.xpm sb-pg.xpm sb-tag-gt.xpm sb-tag-minus.xpm sb-tag-plus.xpm - and 51 other files + and 50 other files Eric Schulte: wrote ob-asymptote.el ob-awk.el ob-calc.el ob-comint.el ob-coq.el ob-css.el ob-ditaa.el ob-dot.el ob-emacs-lisp.el ob-eval.el @@ -1859,7 +1859,7 @@ and changed configure.ac Makefile.in src/Makefile.in calendar.el diary-lib.el lisp/Makefile.in files.el make-dist rmail.el progmodes/f90.el bytecomp.el simple.el authors.el admin.el startup.el emacs.texi misc/Makefile.in display.texi lib-src/Makefile.in ack.texi - subr.el and 1761 other files + subr.el and 1760 other files Glynn Clements: wrote gamegrid.el snake.el tetris.el @@ -1901,7 +1901,7 @@ Gregor Schmid: changed intervals.c intervals.h tcl-mode.el textprop.c Gregory Chernov: changed nnslashdot.el -Grégory Mounié: changed display.texi hi-lock.el man.el +Grégory Mounié: changed display.texi hi-lock.el man.el xfns.c Gregory Neil Shapiro: changed mailabbrev.el @@ -1991,7 +1991,7 @@ Hideki Iwamoto: changed etags.c Hiroshi Fujishima: changed efaq.texi gnus-score.el mail-source.el spam-stat.el -Hiroshi Nakano: changed unexelf.c ralloc.c +Hiroshi Nakano: changed ralloc.c unexelf.c Hiroshi Oota: changed coding.c @@ -2189,7 +2189,7 @@ James Wright: changed em-unix.el Jamie Zawinski: wrote mailabbrev.el tar-mode.el and co-wrote byte-opt.el byte-run.el bytecomp.el disass.el font-lock.el -and changed mail-extr.el subr.el bytecode.c +and changed bytecode.c mail-extr.el subr.el Jan Beich: changed configure.ac mml-smime.el @@ -2646,7 +2646,7 @@ and changed xterm.c xfns.c keyboard.c screen.c dispnew.c xdisp.c window.c process.c alloc.c buffer.h files.el screen.el insdel.c emacs.c and 106 other files -Joseph M. Kelsey: changed skeleton.el fileio.c +Joseph M. Kelsey: changed fileio.c skeleton.el Josh Elsasser: changed configure.ac @@ -2720,7 +2720,7 @@ Juri Linkov: wrote files-x.el misearch.el replace-tests.el tab-bar.el and changed isearch.el info.el simple.el replace.el dired.el dired-aux.el progmodes/grep.el image-mode.el progmodes/compile.el startup.el subr.el diff-mode.el files.el menu-bar.el faces.el display.texi bindings.el - desktop.el comint.el minibuffer.el search.texi and 420 other files + desktop.el comint.el minibuffer.el search.texi and 419 other files Jussi Lahdenniemi: changed w32fns.c ms-w32.h msdos.texi w32.c w32.h w32console.c w32heap.c w32inevt.c w32term.h @@ -2744,7 +2744,7 @@ and co-wrote longlines.el tramp-sh.el tramp.el and changed message.el gnus-agent.el gnus-sum.el files.el nnmail.el tramp.texi nntp.el gnus.el simple.el ange-ftp.el dired.el paragraphs.el bindings.el files.texi gnus-art.el gnus-group.el man.el INSTALL - Makefile.in crisp.el fileio.c and 45 other files + Makefile.in crisp.el fileio.c and 44 other files Kailash C. Chowksey: changed HELLO ind-util.el kannada.el knd-util.el lisp/Makefile.in loadup.el @@ -3148,7 +3148,7 @@ Luc Teirlinck: wrote help-at-pt.el and changed files.el autorevert.el cus-edit.el subr.el simple.el frames.texi startup.el display.texi files.texi dired.el comint.el modes.texi custom.texi emacs.texi fns.c frame.el ielm.el minibuf.texi - variables.texi buffers.texi commands.texi and 212 other files + variables.texi buffers.texi commands.texi and 211 other files Ludovic Courtès: wrote nnregistry.el and changed configure.ac gnus.texi loadup.el @@ -3573,7 +3573,7 @@ Michael Olson: changed erc.el erc-backend.el Makefile erc-track.el erc-log.el erc-stamp.el erc-autoaway.el erc-dcc.el erc-goodies.el erc-list.el erc-compat.el erc-identd.el erc.texi ERC-NEWS erc-bbdb.el erc-match.el erc-notify.el erc-ibuffer.el erc-services.el remember.el - erc-button.el and 55 other files + erc-button.el and 54 other files Michael Orlitzky: changed tex-mode.el @@ -3830,7 +3830,7 @@ Nicolas Petton: wrote map-tests.el map.el seq-tests.el seq.el thunk-tests.el thunk.el url-handlers-test.el and co-wrote auth-source-pass.el auth-source-tests.el subr-tests.el and changed README configure.ac sed2v2.inp authors.el sequences.texi - README.W32 emacs.png emacs23.png HISTORY arc-mode.el cl-extra.el + README.W32 emacs.png HISTORY emacs23.png arc-mode.el cl-extra.el emacs.svg manoj-dark-theme.el Emacs.icns Makefile.in auth-source.el emacs.ico fns.c make-tarball.txt obarray-tests.el obarray.el and 37 other files @@ -3992,7 +3992,7 @@ and co-wrote cal-dst.el and changed lisp.h configure.ac alloc.c process.c fileio.c editfns.c xdisp.c sysdep.c image.c keyboard.c emacs.c data.c fns.c lread.c xterm.c eval.c callproc.c Makefile.in frame.c buffer.c gnulib-comp.m4 - and 1824 other files + and 1822 other files Paul Fisher: changed fns.c @@ -4425,7 +4425,7 @@ and changed process.c ftfont.c gtkutil.c processes.texi vc-git.el configure.ac font.c network-stream.el nsm.el process-tests.el xfns.c custom.texi dispextern.h files.texi ftcrfont.c gnus-icalendar.el gnutls.el gtkutil.h network-stream-tests.el nsterm.m text.texi - and 93 other files + and 92 other files Robert Thorpe: changed cus-start.el indent.el @@ -4447,8 +4447,8 @@ Rodrigo Real: changed pt-br-refcard.tex Roger Breitenstein: changed smtpmail.el -Roland B. Roberts: changed gnus-group.el gnus-sum.el buffer.h callproc.c - dired.c files.el process.c sort.el sysdep.c systty.h +Roland B. Roberts: changed buffer.h callproc.c dired.c files.el + gnus-group.el gnus-sum.el process.c sort.el sysdep.c systty.h Roland Kaufmann: changed ox.el @@ -4712,7 +4712,7 @@ Shun-ichi Goto: changed url-http.el Shyam Karanatt: changed image-mode.el -Sidney Markowitz: changed nsmenu.m doctor.el +Sidney Markowitz: changed doctor.el nsmenu.m Sigbjorn Finne: changed gnus-srvr.el @@ -4785,7 +4785,7 @@ Stefan Kangas: wrote bookmark-tests.el delim-col-tests.el morse-tests.el and changed bookmark.el package.el efaq.texi package.texi ibuffer.el mwheel.el cperl-mode.el fns.c gud.el simple.el subr.el autoinsert.el comint-tests.el control.texi cus-edit.el delim-col.el dired-aux.el - dired-x.el em-term.el ert.texi flow-fill.el and 152 other files + dired-x.el em-term.el ert.texi flow-fill.el and 153 other files Stefan Merten: co-wrote rst.el @@ -4835,7 +4835,7 @@ and changed wdired.el todo-mode.texi diary-lib.el wdired-tests.el dired-tests.el doc-view.el files.el minibuffer.el dired.el frames.texi hl-line.el info.el menu-bar.el mouse.el otodo-mode.el subr.el .gitattributes TUTORIAL allout.el artist.el compile.texi - and 45 other files + and 44 other files Stephen C. Gilardi: changed configure.ac @@ -5007,7 +5007,7 @@ Teodor Zlatanov: wrote auth-source.el gnus-registry.el gnus-tests.el and changed spam.el gnus.el nnimap.el gnus.texi gnutls.c gnus-sum.el auth.texi cfengine.el gnus-sync.el gnus-util.el gnus-start.el netrc.el gnutls.h message.el spam-stat.el encrypt.el mail-source.el nnir.el - nnmail.el auth-source-tests.el configure.ac and 120 other files + nnmail.el auth-source-tests.el configure.ac and 119 other files Terje Rosten: changed xfns.c version.el xterm.c xterm.h @@ -5208,7 +5208,7 @@ and co-wrote package.el tcl.el and changed data.c lisp.h js.el buffer.c data-tests.el alloc.c css-mode.el js-tests.el mhtml-mode.el process.c window.c editfns.c fns.c keyboard.c keymap.c lread.c makefile.el xfns.c bytecode.c cmds.c - configure.ac and 208 other files + configure.ac and 206 other files Tom Willemse: changed elec-pair.el package.el perl-mode.el prog-mode.el progmodes/python.el simple.el @@ -5474,9 +5474,9 @@ and changed configure.ac gmalloc.c gnus-agent.el image-mode.el man.el Wolfgang Lux: changed nsterm.m keyboard.c Wolfgang Rupprecht: wrote float-sup.el floatfns.c sup-mouse.el -and changed process.c config.in configure.ac net-utils.el nntp.el alloc.c - callint.c data.c fns.c lisp-mode.el lisp.h loadup.el lread.c print.c - sort.el +and changed process.c alloc.c callint.c config.in configure.ac data.c + fns.c lisp-mode.el lisp.h loadup.el lread.c net-utils.el nntp.el + print.c sort.el Wolfgang Scherer: changed vc-cvs.el vc-dir.el vc-svn.el vc.el pcvs.el commit 1ca4da054be7eb340c511d817f3ec89c8b819db7 Author: Robert Pluim Date: Tue Aug 4 16:34:38 2020 +0200 ; * etc/NEWS: fix some quoting diff --git a/etc/NEWS b/etc/NEWS index a056f5c1e8..d0a24c23f3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -595,7 +595,7 @@ the node "(emacs) Directory Variables" of the user manual. ** Network connections using 'local' can now use IPv6. 'make-network-process' now uses the correct loopback address when -asked to use ':host 'local' and ':family 'ipv6'. +asked to use ":host 'local" and ":family 'ipv6". ** The new function 'replace-region-contents' replaces the current region using a given replacement-function in a non-destructive manner commit 5578febcd4710920ed8d864395e60282e2127afe Author: Phil Sainty Date: Tue Aug 4 04:29:56 2020 +1200 ; * lisp/so-long.el: Documentation diff --git a/lisp/so-long.el b/lisp/so-long.el index d4f7140f2e..c800c7a143 100644 --- a/lisp/so-long.el +++ b/lisp/so-long.el @@ -255,8 +255,7 @@ ;; `so-long-mode', completely bypassing the automated decision process. ;; Refer to M-: (info "(emacs) Specifying File Variables") RET ;; -;; If so-long itself is causing problems, it can be inhibited by setting the -;; `so-long-enabled' variable to nil, or by disabling the global mode with +;; If so-long itself causes problems, disable the automated behaviour with ;; M-- M-x global-so-long-mode, or M-: (global-so-long-mode 0) ;; * Example configuration @@ -413,7 +412,6 @@ ;; - Added mode-line indicator, user option `so-long-mode-line-label', ;; and faces `so-long-mode-line-active', `so-long-mode-line-inactive'. ;; - New help commands `so-long-commentary' and `so-long-customize'. -;; - Renamed `so-long-mode-enabled' to `so-long-enabled'. ;; - Refactored the default hook values using variable overrides ;; (and returning all the hooks to nil default values). ;; - Performance improvements for `so-long-detected-long-line-p'. @@ -453,9 +451,14 @@ (declare-function longlines-mode "longlines") (defvar longlines-mode) (defvar so-long-enabled nil - "Set to nil to prevent `so-long' from being triggered automatically. - -Has no effect if `global-so-long-mode' is not enabled.") + ;; This was initially a renaming of the old `so-long-mode-enabled' and + ;; documented as "Set to nil to prevent `so-long' from being triggered + ;; automatically."; however `so-long--ensure-enabled' may forcibly re-enable + ;; it contrary to the user's expectations, so for the present this should be + ;; considered internal-use only (with `global-so-long-mode' the interface + ;; for enabling or disabling the automated behaviour). FIXME: Establish a + ;; way to support the original use-case, or rename to `so-long--enabled'. + "Internal use. Non-nil when any so-long functionality has been used.") (defvar-local so-long--active nil ; internal use "Non-nil when `so-long' mitigations are in effect.") @@ -1920,7 +1923,7 @@ If it appears in `%s', you should remove it." ; LocalWords: defadvice nadvice whitespace ie bos eos eobp origmode un Un setq ; LocalWords: docstring auf Wiedersehen longlines alist autoload Refactored Inc ; LocalWords: MERCHANTABILITY RET REGEXP VAR ELPA WS mitigations EmacsWiki eval -; LocalWords: rx filename filenames js defun bidi bpa prog +; LocalWords: rx filename filenames js defun bidi bpa prog FIXME ;; So long, farewell, auf Wiedersehen, goodbye ;; You have to go, this code is minified commit fa20e443c865db8f2975e1b572654f235e2be91d Author: Phil Sainty Date: Sun Dec 8 23:28:06 2019 +1300 lisp/so-long.el: Improve support for major mode hooks * lisp/so-long.el (so-long-remember-all, so-long-disable-minor-modes) (so-long-override-variables): Store and use the `so-long-minor-modes' and `so-long-variable-overrides' values seen by the original major mode, so that buffer-local changes made in the major mode hook will be respected. Add documentation of this and other major mode hook usage. diff --git a/lisp/so-long.el b/lisp/so-long.el index 1332ae1263..d4f7140f2e 100644 --- a/lisp/so-long.el +++ b/lisp/so-long.el @@ -282,6 +282,43 @@ ;; '((show-trailing-whitespace . nil) ;; (truncate-lines . nil)))) +;; * Mode-specific configuration +;; ----------------------------- +;; The `so-long-predicate' function is called in the context of the buffer's +;; original major mode, and therefore major mode hooks can be used to control +;; the criteria for calling `so-long' in any given mode (plus its derivatives) +;; by setting buffer-local values for the variables in question. This includes +;; `so-long-predicate' itself, as well as any variables used by the predicate +;; when determining the result. By default this means `so-long-max-lines', +;; `so-long-skip-leading-comments', and `so-long-threshold'. E.g.: +;; +;; (add-hook 'js-mode-hook 'my-js-mode-hook) +;; +;; (defun my-js-mode-hook () +;; "Custom `js-mode' behaviours." +;; (setq-local so-long-max-lines 100) +;; (setq-local so-long-threshold 1000)) +;; +;; `so-long-variable-overrides' and `so-long-minor-modes' may also be given +;; buffer-local values in order to apply different settings to different types +;; of file. For example, the Bidirectional Parentheses Algorithm does not apply +;; to `<' and `>' characters by default, and therefore one might prefer to not +;; set `bidi-inhibit-bpa' in XML files, on the basis that XML files with long +;; lines are less likely to trigger BPA-related performance problems: +;; +;; (add-hook 'nxml-mode-hook 'my-nxml-mode-hook) +;; +;; (defun my-nxml-mode-hook () +;; "Custom `nxml-mode' behaviours." +;; (require 'so-long) +;; (setq-local so-long-variable-overrides +;; (remove '(bidi-inhibit-bpa . t) so-long-variable-overrides))) +;; +;; Finally, note that setting `so-long-target-modes' to nil buffer-locally in +;; a major mode hook would prevent that mode from ever being targeted. With +;; `prog-mode' being targeted by default, specific derivatives of `prog-mode' +;; could therefore be un-targeted if desired. + ;; * Other ways of using so-long ;; ----------------------------- ;; It may prove useful to automatically invoke major mode `so-long-mode' for @@ -886,9 +923,15 @@ buffer-local." Stores the existing value for each entry in `so-long-variable-overrides'. Stores the name of each enabled mode from the list `so-long-minor-modes'. +The lists themselves are also remembered, so that major mode hooks can +provide buffer-local modifications which are still accessible after changing +to `so-long-mode'. + If RESET is non-nil, remove any existing values before storing the new ones." (when reset (setq so-long-original-values nil)) + (so-long-remember 'so-long-variable-overrides) + (so-long-remember 'so-long-minor-modes) (dolist (ovar so-long-variable-overrides) (so-long-remember (car ovar))) (dolist (mode so-long-minor-modes) @@ -1286,7 +1329,7 @@ Calls `so-long-disable-minor-modes' and `so-long-override-variables'." (defun so-long-disable-minor-modes () "Disable any active minor modes listed in `so-long-minor-modes'." - (dolist (mode so-long-minor-modes) + (dolist (mode (so-long-original 'so-long-minor-modes)) (when (and (boundp mode) mode) (funcall mode 0)))) @@ -1302,7 +1345,7 @@ The modes are enabled in accordance with what was remembered in `so-long'." (defun so-long-override-variables () "Set the buffer-local values defined by `so-long-variable-overrides'." - (dolist (ovar so-long-variable-overrides) + (dolist (ovar (so-long-original 'so-long-variable-overrides)) (set (make-local-variable (car ovar)) (cdr ovar)))) (defun so-long-restore-variables () @@ -1877,7 +1920,7 @@ If it appears in `%s', you should remove it." ; LocalWords: defadvice nadvice whitespace ie bos eos eobp origmode un Un setq ; LocalWords: docstring auf Wiedersehen longlines alist autoload Refactored Inc ; LocalWords: MERCHANTABILITY RET REGEXP VAR ELPA WS mitigations EmacsWiki eval -; LocalWords: rx filename filenames bidi bpa +; LocalWords: rx filename filenames js defun bidi bpa prog ;; So long, farewell, auf Wiedersehen, goodbye ;; You have to go, this code is minified