commit f712cdbe9e9bdca3d4c7c27e9ac59686ab4c7620 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Fri Aug 14 19:29:14 2020 -0700 Pacify Apple clang 11 __builtin_assume Problem reported by Mattias Engdegård in: https://lists.gnu.org/r/emacs-devel/2020-08/msg00300.html * src/lisp.h (bool_vector_bitref, bool_vector_set): Use eassert instead of eassume for bool_vector_size checks. diff --git a/src/lisp.h b/src/lisp.h index 2962babb4f..eaf1c6ce6d 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1809,7 +1809,8 @@ bool_vector_uchar_data (Lisp_Object a) INLINE bool bool_vector_bitref (Lisp_Object a, EMACS_INT i) { - eassume (0 <= i && i < bool_vector_size (a)); + eassume (0 <= i); + eassert (i < bool_vector_size (a)); return !! (bool_vector_uchar_data (a)[i / BOOL_VECTOR_BITS_PER_CHAR] & (1 << (i % BOOL_VECTOR_BITS_PER_CHAR))); } @@ -1825,11 +1826,11 @@ bool_vector_ref (Lisp_Object a, EMACS_INT i) INLINE void bool_vector_set (Lisp_Object a, EMACS_INT i, bool b) { - unsigned char *addr; - - eassume (0 <= i && i < bool_vector_size (a)); - addr = &bool_vector_uchar_data (a)[i / BOOL_VECTOR_BITS_PER_CHAR]; + eassume (0 <= i); + eassert (i < bool_vector_size (a)); + unsigned char *addr + = &bool_vector_uchar_data (a)[i / BOOL_VECTOR_BITS_PER_CHAR]; if (b) *addr |= 1 << (i % BOOL_VECTOR_BITS_PER_CHAR); else commit e365b9ab7b989c0587c0f2c0f05d35b4d67920dd Author: Amin Bandali Date: Fri Aug 14 21:54:48 2020 -0400 Add `message' to erc-match.el highlight types * lisp/erc/erc-match.el (erc-current-nick-highlight-type, erc-pal-highlight-type, erc-fool-highlight-type, erc-keyword-highlight-type, erc-dangerous-host-highlight-type): Add `message' type for highlighting the entire message but not the sender's nick. (erc-match-message): Check for the new `message' highlight type and propertize the message (not including the nick) accordingly. * etc/NEWS: Announce the addition of the `message' highlight type. diff --git a/etc/NEWS b/etc/NEWS index 8cd845a7b9..e51a3630b6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -726,6 +726,13 @@ Italic text is displayed in the new 'erc-italic-face'. This file contained ERC compatibility code for Emacs 21 and XEmacs which is no longer needed. +--- +*** erc-match.el now supports 'message' highlight type (not including the nick). +The 'erc-current-nick-highlight-type', 'erc-pal-highlight-type', +'erc-fool-highlight-type', 'erc-keyword-highlight-type', and +'erc-dangerous-host-highlight-type' variables now support a 'message' +type for highlighting the entire message but not the sender's nick. + ** Battery --- diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index 6e87a183fc..b3145674f2 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el @@ -94,7 +94,9 @@ The following values are allowed: `nick-or-keyword' - highlight the nick of the user who typed your nickname, or all instances of the current nickname if there was no sending user - `all' - highlight the entire message where current nickname occurs + `message' - highlight the entire message where current nickname occurs + `all' - highlight the entire message (including the nick) where + current nickname occurs Any other value disables highlighting of current nickname altogether." :group 'erc-match @@ -102,6 +104,7 @@ Any other value disables highlighting of current nickname altogether." (const nick) (const keyword) (const nick-or-keyword) + (const message) (const all))) (defcustom erc-pal-highlight-type 'nick @@ -110,14 +113,17 @@ See `erc-pals'. The following values are allowed: - nil - do not highlight the message at all - `nick' - highlight pal's nickname only - `all' - highlight the entire message from pal + nil - do not highlight the message at all + `nick' - highlight pal's nickname only + `message' - highlight the entire message from pal + `all' - highlight the entire message (including the nick) + from pal Any other value disables pal highlighting altogether." :group 'erc-match :type '(choice (const nil) (const nick) + (const message) (const all))) (defcustom erc-fool-highlight-type 'nick @@ -126,14 +132,17 @@ See `erc-fools'. The following values are allowed: - nil - do not highlight the message at all - `nick' - highlight fool's nickname only - `all' - highlight the entire message from fool + nil - do not highlight the message at all + `nick' - highlight fool's nickname only + `message' - highlight the entire message from fool + `all' - highlight the entire message (including the nick) + from fool Any other value disables fool highlighting altogether." :group 'erc-match :type '(choice (const nil) (const nick) + (const message) (const all))) (defcustom erc-keyword-highlight-type 'keyword @@ -143,12 +152,15 @@ See variable `erc-keywords'. The following values are allowed: `keyword' - highlight keyword only - `all' - highlight the entire message containing keyword + `message' - highlight the entire message containing keyword + `all' - highlight the entire message (including the nick) + containing keyword Any other value disables keyword highlighting altogether." :group 'erc-match :type '(choice (const nil) (const keyword) + (const message) (const all))) (defcustom erc-dangerous-host-highlight-type 'nick @@ -157,13 +169,16 @@ See `erc-dangerous-hosts'. The following values are allowed: - `nick' - highlight nick from dangerous-host only - `all' - highlight the entire message from dangerous-host + `nick' - highlight nick from dangerous-host only + `message' - highlight the entire message from dangerous-host + `all' - highlight the entire message (including the nick) + from dangerous-host Any other value disables dangerous-host highlighting altogether." :group 'erc-match :type '(choice (const nil) (const nick) + (const message) (const all))) @@ -449,19 +464,18 @@ Use this defun with `erc-insert-modify-hook'." (match-beginning 0))) (nick-end (when nick-beg (match-end 0))) - (message (buffer-substring - (if (and nick-end - (<= (+ 2 nick-end) (point-max))) - ;; Message starts 2 characters after the nick - ;; except for CTCP ACTION messages. Nick - ;; surrounded by angle brackets only in normal - ;; messages. - (+ nick-end - (if (eq ?> (char-after nick-end)) - 2 - 1)) - (point-min)) - (point-max)))) + (message-beg (if (and nick-end + (<= (+ 2 nick-end) (point-max))) + ;; Message starts 2 characters after the + ;; nick except for CTCP ACTION messages. + ;; Nick surrounded by angle brackets only in + ;; normal messages. + (+ nick-end + (if (eq ?> (char-after nick-end)) + 2 + 1)) + (point-min))) + (message (buffer-substring message-beg (point-max)))) (when (and vector (not (and erc-match-exclude-server-buffer (erc-server-buffer-p)))) @@ -498,7 +512,12 @@ Use this defun with `erc-insert-modify-hook'." (while (re-search-forward match-regex nil t) (erc-put-text-property (match-beginning 0) (match-end 0) 'font-lock-face match-face)))) - ;; Highlight the whole message + ;; Highlight the whole message (not including the nick) + ((eq match-htype 'message) + (erc-put-text-property + message-beg (point-max) + 'font-lock-face match-face (current-buffer))) + ;; Highlight the whole message (including the nick) ((eq match-htype 'all) (erc-put-text-property (point-min) (point-max) commit 4ecc2ba01db5029c42d3b7f1418a021cccf2dc67 Author: Paul Eggert Date: Fri Aug 14 14:33:21 2020 -0700 Fix bus error on Debian bullseye Problem reported by Lars Ingebrigtsen, and problem diagnosis and most of this patch by Pip Cet (Bug#42832). * src/pdumper.c (dump_bitsets_init): Rename from dump_bitset_init. All callers changed. Initialize two bitsets with a single malloc call. (struct pdumper_loaded_dump_private): New member last_mark_bits. (pdumper_find_object_type_impl): Return PDUMPER_NO_OBJECT if the last_mark_bits’ bit is clear. (pdumper_set_marked_impl): Assert that the last_mark_bits’ bit is set. (pdumper_clear_marks_impl): Save mark_bits into last_mark_bits before clearing mark_bits. Co-authored-by: Pip Cet diff --git a/src/pdumper.c b/src/pdumper.c index bc41afc7c5..2d1b19283c 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -4802,14 +4802,19 @@ struct dump_bitset }; static bool -dump_bitset_init (struct dump_bitset *bitset, size_t number_bits) +dump_bitsets_init (struct dump_bitset bitset[2], size_t number_bits) { - int xword_size = sizeof (bitset->bits[0]); + int xword_size = sizeof (bitset[0].bits[0]); int bits_per_word = xword_size * CHAR_BIT; ptrdiff_t words_needed = divide_round_up (number_bits, bits_per_word); - bitset->number_words = words_needed; - bitset->bits = calloc (words_needed, xword_size); - return bitset->bits != NULL; + dump_bitset_word *bits = calloc (words_needed, 2 * xword_size); + if (!bits) + return false; + bitset[0].bits = bits; + bitset[0].number_words = bitset[1].number_words = words_needed; + bitset[1].bits = memset (bits + words_needed, UCHAR_MAX, + words_needed * xword_size); + return true; } static dump_bitset_word * @@ -4870,7 +4875,7 @@ struct pdumper_loaded_dump_private /* Copy of the header we read from the dump. */ struct dump_header header; /* Mark bits for objects in the dump; used during GC. */ - struct dump_bitset mark_bits; + struct dump_bitset mark_bits, last_mark_bits; /* Time taken to load the dump. */ double load_time; /* Dump file name. */ @@ -4993,6 +4998,10 @@ pdumper_find_object_type_impl (const void *obj) dump_off offset = ptrdiff_t_to_dump_off ((uintptr_t) obj - dump_public.start); if (offset % DUMP_ALIGNMENT != 0) return PDUMPER_NO_OBJECT; + ptrdiff_t bitno = offset / DUMP_ALIGNMENT; + if (offset < dump_private.header.cold_start + && !dump_bitset_bit_set_p (&dump_private.last_mark_bits, bitno)) + return PDUMPER_NO_OBJECT; const struct dump_reloc *reloc = dump_find_relocation (&dump_private.header.object_starts, offset); return (reloc != NULL && dump_reloc_get_offset (*reloc) == offset) @@ -5021,12 +5030,16 @@ pdumper_set_marked_impl (const void *obj) eassert (offset < dump_private.header.cold_start); eassert (offset < dump_private.header.discardable_start); ptrdiff_t bitno = offset / DUMP_ALIGNMENT; + eassert (dump_bitset_bit_set_p (&dump_private.last_mark_bits, bitno)); dump_bitset_set_bit (&dump_private.mark_bits, bitno); } void pdumper_clear_marks_impl (void) { + dump_bitset_word *swap = dump_private.last_mark_bits.bits; + dump_private.last_mark_bits.bits = dump_private.mark_bits.bits; + dump_private.mark_bits.bits = swap; dump_bitset_clear (&dump_private.mark_bits); } @@ -5243,7 +5256,7 @@ pdumper_load (const char *dump_filename) int dump_page_size; dump_off adj_discardable_start; - struct dump_bitset mark_bits; + struct dump_bitset mark_bits[2]; size_t mark_bits_needed; struct dump_header header_buf = { 0 }; @@ -5357,7 +5370,7 @@ pdumper_load (const char *dump_filename) err = PDUMPER_LOAD_ERROR; mark_bits_needed = divide_round_up (header->discardable_start, DUMP_ALIGNMENT); - if (!dump_bitset_init (&mark_bits, mark_bits_needed)) + if (!dump_bitsets_init (mark_bits, mark_bits_needed)) goto out; /* Point of no return. */ @@ -5365,7 +5378,8 @@ pdumper_load (const char *dump_filename) dump_base = (uintptr_t) sections[DS_HOT].mapping; gflags.dumped_with_pdumper_ = true; dump_private.header = *header; - dump_private.mark_bits = mark_bits; + dump_private.mark_bits = mark_bits[0]; + dump_private.last_mark_bits = mark_bits[1]; dump_public.start = dump_base; dump_public.end = dump_public.start + dump_size; commit ca6c3bec0769d8ac7a49cdb8d2580add5485366e Author: Basil L. Contovounesios Date: Fri Aug 14 23:32:48 2020 +0100 ; Touch up last two changes to etc/NEWS diff --git a/etc/NEWS b/etc/NEWS index 53e60cdb5c..8cd845a7b9 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -786,15 +786,16 @@ digits. ** Miscellaneous --- -*** Two new commands for centering in 'doc-view-mode' -'c h' will now center the page horizonally, and 'c v' will center the -page vertically. +*** Two new commands for centering in 'doc-view-mode'. +The new commands 'doc-view-center-page-horizontally' (bound to 'c h') +and 'doc-view-center-page-vertically' (bound to 'c v') center the page +horizontally and vertically, respectively. --- -*** 'icomplete-show-matches-on-no-input' behavior change +*** Change in meaning of 'icomplete-show-matches-on-no-input'. Previously, choosing a different completion with commands like 'C-.' -and then hitting enter would choose the default completion. Doung -this will now choose the completion under point. +and then hitting RET would choose the default completion. Doing this +will now choose the completion under point instead. --- *** New user option 'term-scroll-snap-to-bottom'. commit 42c19b74854eb6406f2bd7f6fd6a9be584f300a3 Author: Dmitry Gutov Date: Fri Aug 14 23:33:03 2020 +0300 ; Change phrasing according to the rename diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 594fdcf3f9..9f550b4987 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1798,8 +1798,7 @@ buffers as candidates for completion. buffers that belong to the project, to keep your Emacs session smaller. The command @kbd{C-x p k} (@code{project-kill-buffers}) accomplishes that: it kills all the buffers that belong to the current -project, except if @code{project-kill-buffer-conditions} tells -otherwise. +project that satisfy any of @code{project-kill-buffer-conditions}. @node Switching Projects @subsection Switching Projects commit 8b36ebc95072c6a07d8dc4a74de231f740d7199b Author: Stefan Kangas Date: Fri Aug 14 19:29:24 2020 +0200 Remove XEmacs compat code from mwheel.el * lisp/mwheel.el (mwheel-event-button, mwheel-event-window): Remove XEmacs compat code. diff --git a/lisp/mwheel.el b/lisp/mwheel.el index 317f2cd8ed..8e2039ba9d 100644 --- a/lisp/mwheel.el +++ b/lisp/mwheel.el @@ -162,23 +162,18 @@ Also see `mouse-wheel-tilt-scroll'." :type 'boolean :version "26.1") -(eval-and-compile - (if (fboundp 'event-button) - (fset 'mwheel-event-button 'event-button) - (defun mwheel-event-button (event) - (let ((x (event-basic-type event))) - ;; Map mouse-wheel events to appropriate buttons - (if (eq 'mouse-wheel x) - (let ((amount (car (cdr (cdr (cdr event)))))) - (if (< amount 0) - mouse-wheel-up-event - mouse-wheel-down-event)) - x)))) - - (if (fboundp 'event-window) - (fset 'mwheel-event-window 'event-window) - (defun mwheel-event-window (event) - (posn-window (event-start event))))) +(defun mwheel-event-button (event) + (let ((x (event-basic-type event))) + ;; Map mouse-wheel events to appropriate buttons + (if (eq 'mouse-wheel x) + (let ((amount (car (cdr (cdr (cdr event)))))) + (if (< amount 0) + mouse-wheel-up-event + mouse-wheel-down-event)) + x))) + +(defun mwheel-event-window (event) + (posn-window (event-start event))) (defvar mwheel-inhibit-click-event-timer nil "Timer running while mouse wheel click event is inhibited.") commit 43091e6c5069797ba17d2c7429e0122d3a5337d9 Author: Noam Postavsky Date: Fri Aug 14 19:31:16 2020 +0200 Make configure say so if we have "--with-json" but no jansson support * configure.ac (OPTION_DEFAULT_IFAVAILABLE): New macro. Use it to define the --with-json option. Add with_json and HAVE_JSON to the 'MISSING' checks (bug#39953). diff --git a/configure.ac b/configure.ac index 7ce64f79ca..1b155bd39e 100644 --- a/configure.ac +++ b/configure.ac @@ -219,6 +219,21 @@ AC_DEFUN([OPTION_DEFAULT_OFF], [dnl m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=no])dnl ])dnl +dnl OPTION_DEFAULT_IFAVAILABLE(NAME, HELP-STRING) +dnl Create a new --with option that defaults to 'ifavailable'. +dnl NAME is the base name of the option. The shell variable with_NAME +dnl will be set to either the user's value (if the option is +dnl specified; 'yes' for a plain --with-NAME) or to 'ifavailable' (if the +dnl option is not specified). Note that the shell variable name is +dnl constructed as autoconf does, by replacing non-alphanumeric +dnl characters with "_". +dnl HELP-STRING is the help text for the option. +AC_DEFUN([OPTION_DEFAULT_IFAVAILABLE], [dnl + AC_ARG_WITH([$1],[AS_HELP_STRING([--with-$1],[$2])],[],[dnl + m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=ifavailable])dnl +])dnl + + dnl OPTION_DEFAULT_ON(NAME, HELP-STRING) dnl Create a new --with option that defaults to $with_features. dnl NAME is the base name of the option. The shell variable with_NAME @@ -438,7 +453,7 @@ OPTION_DEFAULT_ON([cairo],[don't compile with Cairo drawing]) OPTION_DEFAULT_ON([xml2],[don't compile with XML parsing support]) OPTION_DEFAULT_OFF([imagemagick],[compile with ImageMagick image support]) OPTION_DEFAULT_ON([native-image-api], [don't use native image APIs (GDI+ on Windows)]) -OPTION_DEFAULT_ON([json], [don't compile with native JSON support]) +OPTION_DEFAULT_IFAVAILABLE([json], [don't compile with native JSON support]) OPTION_DEFAULT_ON([xft],[don't use XFT for anti aliased fonts]) OPTION_DEFAULT_ON([harfbuzz],[don't use HarfBuzz for text shaping]) @@ -2926,7 +2941,7 @@ AC_SUBST(LIBSYSTEMD_CFLAGS) HAVE_JSON=no JSON_OBJ= -if test "${with_json}" = yes; then +if test "${with_json}" != no; then EMACS_CHECK_MODULES([JSON], [jansson >= 2.7], [HAVE_JSON=yes], [HAVE_JSON=no]) if test "${HAVE_JSON}" = yes; then @@ -3877,6 +3892,11 @@ case $with_gnutls,$HAVE_GNUTLS in *) MISSING="$MISSING gnutls" WITH_IFAVAILABLE="$WITH_IFAVAILABLE --with-gnutls=ifavailable";; esac +case $with_json,$HAVE_JSON in + no,* | ifavailable,* | *,yes) ;; + *) MISSING="$MISSING json" + WITH_IFAVAILABLE="$WITH_IFAVAILABLE --with-json=ifavailable";; +esac if test "X${MISSING}" != X; then AC_MSG_ERROR([The following required libraries were not found: $MISSING commit 8a56f6b5a271aef5acbbc3d2661aac9bf1c6c989 Author: Lars Ingebrigtsen Date: Fri Aug 14 19:03:52 2020 +0200 Mop up project-kill-buffers-ignores renaming * doc/emacs/maintaining.texi (Project Buffer Commands): Update project-kill-buffers-ignores that was renamed recently (bug#41868) (in 2ab66c9f9be923350f123fdea05b5b3ce8283d8a). diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 43ec2d4e9f..594fdcf3f9 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1793,12 +1793,12 @@ for a buffer to switch and considering only the current project's buffers as candidates for completion. @findex project-kill-buffers -@vindex project-kill-buffers-ignores +@vindex project-kill-buffer-conditions When you finish working on the project, you may wish to kill all the buffers that belong to the project, to keep your Emacs session smaller. The command @kbd{C-x p k} (@code{project-kill-buffers}) accomplishes that: it kills all the buffers that belong to the current -project, except if @code{project-kill-buffers-ignores} tells +project, except if @code{project-kill-buffer-conditions} tells otherwise. @node Switching Projects commit ce9e9881b32826cd278ca5a73f81bfc03f15a8d1 Author: Yuan Fu Date: Fri Aug 14 17:43:03 2020 +0200 Add two new commands for centering doc-view images * lisp/doc-view.el (doc-view-mode-map): Add binding for centering commands. (doc-view-center-page-horizontally, doc-view-center-page-vertically): New functions (bug#42272). diff --git a/etc/NEWS b/etc/NEWS index 91add027e4..53e60cdb5c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -785,6 +785,11 @@ digits. ** Miscellaneous +--- +*** Two new commands for centering in 'doc-view-mode' +'c h' will now center the page horizonally, and 'c v' will center the +page vertically. + --- *** 'icomplete-show-matches-on-no-input' behavior change Previously, choosing a different completion with commands like 'C-.' diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 3e2b244326..77c06a8eaf 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -435,6 +435,9 @@ Typically \"page-%s.png\".") (define-key map (kbd "c m") 'doc-view-set-slice-using-mouse) (define-key map (kbd "c b") 'doc-view-set-slice-from-bounding-box) (define-key map (kbd "c r") 'doc-view-reset-slice) + ;; Centering the image + (define-key map (kbd "c h") 'doc-view-center-page-horizontally) + (define-key map (kbd "c v") 'doc-view-center-page-vertically) ;; Searching (define-key map (kbd "C-s") 'doc-view-search) (define-key map (kbd "") 'doc-view-search) @@ -921,6 +924,32 @@ Resize the containing frame if needed." (when new-frame-params (modify-frame-parameters (selected-frame) new-frame-params)))) +(defun doc-view-center-page-horizontally () + "Center page horizontally when page is wider than window." + (interactive) + (let ((page-width (car (image-size (doc-view-current-image) 'pixel))) + (window-width (window-body-width nil 'pixel)) + ;; How much do we scroll in order to center the page? + (pixel-hscroll 0) + ;; How many pixels are there in a column? + (col-in-pixel (/ (window-body-width nil 'pixel) + (window-body-width nil)))) + (when (> page-width window-width) + (setq pixel-hscroll (/ (- page-width window-width) 2)) + (set-window-hscroll (selected-window) + (/ pixel-hscroll col-in-pixel))))) + +(defun doc-view-center-page-vertically () + "Center page vertically when page is wider than window." + (interactive) + (let ((page-height (cdr (image-size (doc-view-current-image) 'pixel))) + (window-height (window-body-height nil 'pixel)) + ;; How much do we scroll in order to center the page? + (pixel-scroll 0)) + (when (> page-height window-height) + (setq pixel-scroll (/ (- page-height window-height) 2)) + (set-window-vscroll (selected-window) pixel-scroll 'pixel)))) + (defun doc-view-reconvert-doc () "Reconvert the current document. Should be invoked when the cached images aren't up-to-date." commit f3d93eb401d7ed78f7c9e6492ce68142e51d5309 Author: Gregory Heytings Date: Fri Aug 14 17:32:23 2020 +0200 Fix visual fringe glitch in diff-mode * lisp/vc/diff-mode.el (diff--font-lock-prettify): Fix problems with visual gaps in the fringes when changing font size (bug#42300). Copyright-paperwork-exempt: yes diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index d194d6c0a0..bd5ac9b9a6 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -2518,7 +2518,7 @@ fixed, visit it in a buffer." '((?+ . (left-fringe diff-fringe-add diff-indicator-added)) (?- . (left-fringe diff-fringe-del diff-indicator-removed)) (?! . (left-fringe diff-fringe-rep diff-indicator-changed)) - (?\s . (left-fringe diff-fringe-nul)))))) + (?\s . (left-fringe diff-fringe-nul fringe)))))) (put-text-property (match-beginning 0) (match-end 0) 'display spec)))) ;; Mimicks the output of Magit's diff. ;; FIXME: This has only been tested with Git's diff output. commit 76514dcb6d55e2734a6e3357039124c80f05261f Author: Stefan Kangas Date: Fri Aug 14 16:47:57 2020 +0200 Comment to postpone deletion of c-subword-mode * lisp/progmodes/subword.el (c-subword-mode): Clarify that this obsolete function alias should not be removed just yet. There is a copy of this definition in cc-cmds.el, obsolete since 24.3, and it is better to delete both at the same time. diff --git a/lisp/progmodes/subword.el b/lisp/progmodes/subword.el index f9b069fd4e..0f2c9431f6 100644 --- a/lisp/progmodes/subword.el +++ b/lisp/progmodes/subword.el @@ -115,6 +115,8 @@ treat nomenclature boundaries as word boundaries." (when subword-mode (superword-mode -1)) (subword-setup-buffer)) +;; This is defined also in cc-cmds.el, but as obsolete since 24.3. +;; Let's keep this until the other one can also be removed. (define-obsolete-function-alias 'c-subword-mode 'subword-mode "23.2") ;;;###autoload commit 7a7847d7ad558afb8452ff346a0356c5fc837f6e Author: Stefan Monnier Date: Fri Aug 14 10:58:00 2020 -0400 * lisp/progmodes/perl-mode.el (perl--syntax-exp-intro-regexp): Bug#42168 * test/lisp/progmodes/cperl-mode-tests.el: Adjust for `perl-mode`. (cperl-test-ppss): Rename from `cperl-test-face` and change return value. (cperl-mode-test-bug-42168): Test the `syntax-ppss` state rather than the font-lock faces, so it works for both `perl-mode` and `cperl-mode`. diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index ff0b6a331b..127b24cb89 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -214,7 +214,9 @@ (defconst perl--syntax-exp-intro-regexp (concat "\\(?:\\(?:^\\|[^$@&%[:word:]]\\)" (regexp-opt perl--syntax-exp-intro-keywords) - "\\|[-?:.,;|&+*=!~({[]\\|\\(^\\)\\)[ \t\n]*"))) + "\\|[?:.,;|&*=!~({[]" + "\\|[^-+][-+]" ;Bug#42168: `+' is intro but `++' isn't! + "\\|\\(^\\)\\)[ \t\n]*"))) (defun perl-syntax-propertize-function (start end) (let ((case-fold-search nil)) diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index f39f1ba658..be8b42d99a 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -16,16 +16,17 @@ ;;; Code: -(defun cperl-test-face (text regexp) - "Returns the face of the first character matched by REGEXP in TEXT." +(defvar cperl-test-mode #'cperl-mode) + +(defun cperl-test-ppss (text regexp) + "Return the `syntax-ppss' of the first character matched by REGEXP in TEXT." (interactive) (with-temp-buffer - (insert text) - (cperl-mode) - (font-lock-ensure (point-min) (point-max)) - (goto-char (point-min)) - (re-search-forward regexp) - (get-text-property (match-beginning 0) 'face))) + (insert text) + (funcall cperl-test-mode) + (goto-char (point-min)) + (re-search-forward regexp) + (syntax-ppss))) (ert-deftest cperl-mode-test-bug-42168 () "Verify that '/' is a division after ++ or --, not a regexp. @@ -37,14 +38,14 @@ have a face property." ;; The next two Perl expressions have divisions. Perl "punctuation" ;; operators don't get a face. (let ((code "{ $a++ / $b }")) - (should (equal (cperl-test-face code "/" ) nil))) + (should (equal (nth 8 (cperl-test-ppss code "/")) nil))) (let ((code "{ $a-- / $b }")) - (should (equal (cperl-test-face code "/" ) nil))) + (should (equal (nth 8 (cperl-test-ppss code "/")) nil))) ;; The next two Perl expressions have regular expressions. The ;; delimiter of a RE is fontified with font-lock-constant-face. (let ((code "{ $a+ / $b } # /")) - (should (equal (cperl-test-face code "/" ) font-lock-constant-face))) + (should (equal (nth 8 (cperl-test-ppss code "/")) 7))) (let ((code "{ $a- / $b } # /")) - (should (equal (cperl-test-face code "/" ) font-lock-constant-face)))) + (should (equal (nth 8 (cperl-test-ppss code "/")) 7)))) ;;; cperl-mode-tests.el ends here commit 5c39f6f1165a33f5714eedd3a413f786dffbb5a2 Author: Mauro Aranda Date: Fri Aug 14 16:40:40 2020 +0200 Make sure we only act on edited widgets in Custom-save * lisp/cus-edit.el (Custom-save): Only act on edited widgets in the buffer. If we attempt to redraw all widgets, we confuse custom-variable-modified-p, or we end up drawing State buttons for all options, including the hidden ones (bug#42801). diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 5ec5799f80..23ceb3a857 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -801,16 +801,19 @@ has been executed, nil otherwise." If a setting was edited and set before, this saves it. If a setting was merely edited before, this sets it then saves it." (interactive) - (when (custom-command-apply - (lambda (child) - (when (memq (widget-get child :custom-state) - '(modified set changed rogue)) - (widget-apply child :custom-mark-to-save))) - "Save all settings in this buffer? " t) - ;; Save changes to buffer and redraw. - (custom-save-all) - (dolist (child custom-options) - (widget-apply child :custom-state-set-and-redraw)))) + (let (edited-widgets) + (when (custom-command-apply + (lambda (child) + (when (memq (widget-get child :custom-state) + '(modified set changed rogue)) + (push child edited-widgets) + (widget-apply child :custom-mark-to-save))) + "Save all settings in this buffer? " t) + ;; Save changes to buffer. + (custom-save-all) + ;; Redraw and recalculate the state when necessary. + (dolist (widget edited-widgets) + (widget-apply widget :custom-state-set-and-redraw))))) (defun custom-reset (_widget &optional event) "Select item from reset menu." commit 93136b980ade2bdd1053128ce103c7ac53a2ad0e Author: Jonas Bernoulli Date: Fri Aug 14 16:18:01 2020 +0200 Parse the whole buffer at once in compile.el * lisp/progmodes/compile.el (compilation-next-single-property-change): Parse whole buffer at once (bug#42806). Also remove the comment that mentioned that it is an option to do it in one go as we now actually start doing. As the existence of that comment suggested, there is not really a reason to process the buffer in small chunks. On the contrary, processing the output in arbitrary units can result in certain constructs not being recognized because they begin in one arbitrary chunk, while ending in another. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 3106c61585..a043bbcfa3 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -2417,12 +2417,9 @@ and runs `compilation-filter-hook'." &optional object limit) (let (parsed res) (while (progn - ;; We parse the buffer here "on-demand" by chunks of 500 chars. - ;; But we could also just parse the whole buffer. (compilation--ensure-parse (setq parsed (max compilation--parsed - (min (+ position 500) - (or limit (point-max)))))) + (or limit (point-max))))) (and (or (not (setq res (next-single-property-change position prop object limit))) (eq res limit)) commit 319463920ca8829dcdfa6c0c8c1c8ff15091f6f0 Author: Dmitry Gutov Date: Fri Aug 14 10:20:04 2020 +0300 Unbreak project-find-regexp in Emacs 26.3 (bug#42765) * lisp/progmodes/project.el: Depend on xref. Bump the version. * lisp/progmodes/xref.el: Remove 'project' from the list of dependencies. Depending on Emacs 26.3 already ensures that some version is available. Bump the version. (xref--process-file-region): Move from project.el with a rename. Update the sole caller. (xref-backend-references): Make compatible with old project.el. Update the docstring. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index b6161351f0..8afd5ce795 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1,8 +1,8 @@ ;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- ;; Copyright (C) 2015-2020 Free Software Foundation, Inc. -;; Version: 0.5.0 -;; Package-Requires: ((emacs "26.3")) +;; Version: 0.5.1 +;; Package-Requires: ((emacs "26.3") (xref "1.0.2")) ;; This is a GNU ELPA :core package. Avoid using functionality that ;; not compatible with the version of Emacs recorded above. @@ -731,24 +731,6 @@ pattern to search for." (user-error "No matches for: %s" regexp)) xrefs)) -(defun project--process-file-region (start end program - &optional buffer display - &rest args) - ;; FIXME: This branching shouldn't be necessary, but - ;; call-process-region *is* measurably faster, even for a program - ;; doing some actual work (for a period of time). Even though - ;; call-process-region also creates a temp file internally - ;; (http://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00211.html). - (if (not (file-remote-p default-directory)) - (apply #'call-process-region - start end program nil buffer display args) - (let ((infile (make-temp-file "ppfr"))) - (unwind-protect - (progn - (write-region start end infile nil 'silent) - (apply #'process-file program infile buffer display args)) - (delete-file infile))))) - (defun project--read-regexp () (let ((sym (thing-at-point 'symbol))) (read-regexp "Find regexp" (and sym (regexp-quote sym))))) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 3e3a37f6da..bbf899e701 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1,8 +1,8 @@ ;;; xref.el --- Cross-referencing commands -*-lexical-binding:t-*- ;; Copyright (C) 2014-2020 Free Software Foundation, Inc. -;; Version: 1.0.1 -;; Package-Requires: ((emacs "26.3") (project "0.1.1")) +;; Version: 1.0.2 +;; Package-Requires: ((emacs "26.3")) ;; This is a GNU ELPA :core package. Avoid functionality that is not ;; compatible with the version of Emacs recorded above. @@ -263,13 +263,16 @@ be found, return nil. The default implementation uses `semantic-symref-tool-alist' to find a search tool; by default, this uses \"find | grep\" in the -`project-current' roots." +current project's main and external roots." (mapcan (lambda (dir) (xref-references-in-directory identifier dir)) (let ((pr (project-current t))) (cons - (project-root pr) + (if (fboundp 'project-root) + (project-root pr) + (with-no-warnings + (project-roots pr))) (project-external-roots pr))))) (cl-defgeneric xref-backend-apropos (backend pattern) @@ -1281,13 +1284,13 @@ FILES must be a list of absolute file names." (insert (mapconcat #'identity files "\0")) (setq default-directory dir) (setq status - (project--process-file-region (point-min) - (point-max) - shell-file-name - output - nil - shell-command-switch - command))) + (xref--process-file-region (point-min) + (point-max) + shell-file-name + output + nil + shell-command-switch + command))) (goto-char (point-min)) (when (and (/= (point-min) (point-max)) (not (looking-at grep-re)) @@ -1302,6 +1305,24 @@ FILES must be a list of absolute file names." hits))) (xref--convert-hits (nreverse hits) regexp))) +(defun xref--process-file-region ( start end program + &optional buffer display + &rest args) + ;; FIXME: This branching shouldn't be necessary, but + ;; call-process-region *is* measurably faster, even for a program + ;; doing some actual work (for a period of time). Even though + ;; call-process-region also creates a temp file internally + ;; (http://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00211.html). + (if (not (file-remote-p default-directory)) + (apply #'call-process-region + start end program nil buffer display args) + (let ((infile (make-temp-file "ppfr"))) + (unwind-protect + (progn + (write-region start end infile nil 'silent) + (apply #'process-file program infile buffer display args)) + (delete-file infile))))) + (defun xref--rgrep-command (regexp files dir ignores) (require 'find-dired) ; for `find-name-arg' (defvar grep-find-template) commit c6267c0fe61531501cb6ab56bdebb500bdf73c29 Author: Ferdinand Pieper Date: Fri Aug 14 16:15:08 2020 +0200 Fix flow filling for flowing multiple flowed lines * lisp/mail/flow-fill.el (fill-flowed): Loop until all flowed lines are collected. * test/lisp/mail/flow-fill-tests.el (fill-flow-tests-fill-flowed-decode): Also test for multiple flowed lines (bug#42855). diff --git a/lisp/mail/flow-fill.el b/lisp/mail/flow-fill.el index af3b493a08..f4b5503119 100644 --- a/lisp/mail/flow-fill.el +++ b/lisp/mail/flow-fill.el @@ -131,31 +131,37 @@ lines." (goto-char (match-end 0)) (unless (looking-at " ") (insert " ")) - (end-of-line) - (when (and (not (eobp)) - (save-excursion - (forward-line 1) - (looking-at (format "\\(%s ?\\)[^>]" prefix)))) - ;; Delete the newline and the quote at the start of the - ;; next line. - (delete-region (point) (match-end 1)) - (ignore-errors + (while (and (eq (char-before (line-end-position)) ?\s) + (not (eobp)) + (save-excursion + (forward-line 1) + (looking-at (format "\\(%s ?\\)[^>]" prefix)))) + (end-of-line) + (when (and (not (eobp)) + (save-excursion + (forward-line 1) + (looking-at (format "\\(%s ?\\)[^>]" prefix)))) + ;; Delete the newline and the quote at the start of the + ;; next line. + (delete-region (point) (match-end 1)))) + (ignore-errors (let ((fill-prefix (concat prefix " ")) adaptive-fill-mode) (fill-region (line-beginning-position) (line-end-position) - 'left 'nosqueeze)))))) - (t + 'left 'nosqueeze))))) + (t ;; Delete the newline. (when (eq (following-char) ?\s) (delete-char 1)) ;; Hack: Don't do the flowing on the signature line. (when (and (not (looking-at "-- $")) (eq (char-before (line-end-position)) ?\s)) - (end-of-line) - (when delete-space - (delete-char -1)) - (delete-char 1) + (while (eq (char-before (line-end-position)) ?\s) + (end-of-line) + (when delete-space + (delete-char -1)) + (delete-char 1)) (ignore-errors (let ((fill-prefix "")) (fill-region (line-beginning-position) diff --git a/test/lisp/mail/flow-fill-tests.el b/test/lisp/mail/flow-fill-tests.el index 4d435aeda7..c2e4178b7d 100644 --- a/test/lisp/mail/flow-fill-tests.el +++ b/test/lisp/mail/flow-fill-tests.el @@ -35,7 +35,8 @@ ">>> unmuzzled ratsbane!\n" ">>>> Henceforth, the coding style is to be strictly \n" ">>>> enforced, including the use of only upper case.\n" - ">>>>> I've noticed a lack of adherence to the coding \n" + ">>>>> I've noticed a lack of adherence to \n" + ">>>>> the coding \n" ">>>>> styles, of late.\n" ">>>>>> Any complaints?\n")) (output commit 5d6a274c1fa1e1cb9c82a7b1bf4ff27a1f76fd66 Author: Stefan Monnier Date: Fri Aug 14 10:03:50 2020 -0400 * doc/lispref/searching.texi (Regexp Special): Tweak wording diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index c8a12bdd66..b6242c539b 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -342,7 +342,7 @@ this choice, the rest of the regexp matches successfully. long time, if they lead to ambiguous matching. For example, trying to match the regular expression @samp{\(x+y*\)*a} against the string @samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz} could -take hours before it ultimately fails. Emacs must try each way of +take hours before it ultimately fails. Emacs may try each way of grouping the @samp{x}s before concluding that none of them can work. In general, avoid expressions that can match the same string in multiple ways. commit 5680faad8fdf81cc14e7e7023b61854839931aae Author: Yuan Fu Date: Fri Aug 14 13:53:09 2020 +0200 Allow doc-view.el to rescale without imagemagick support * lisp/doc-view.el (doc-view-mode-p, doc-view-enlarge) (doc-view-scale-reset, doc-view-insert-image): Remove checks for imagemagick (bug#42272) -- Emacs can rescale images without imagemagick. diff --git a/lisp/doc-view.el b/lisp/doc-view.el index de342f1519..3e2b244326 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -740,8 +740,7 @@ It's a subdirectory of `doc-view-cache-directory'." Document types are symbols like `dvi', `ps', `pdf', or `odf' (any OpenDocument format)." (and (display-graphic-p) - (or (image-type-available-p 'imagemagick) - (image-type-available-p 'png)) + (image-type-available-p 'png) (cond ((eq type 'dvi) (and (doc-view-mode-p 'pdf) @@ -769,10 +768,7 @@ OpenDocument format)." (defun doc-view-enlarge (factor) "Enlarge the document by FACTOR." (interactive (list doc-view-shrink-factor)) - (if (and doc-view-scale-internally - (eq (plist-get (cdr (doc-view-current-image)) :type) - 'imagemagick)) - ;; ImageMagick supports on-the-fly-rescaling. + (if doc-view-scale-internally (let ((new (ceiling (* factor doc-view-image-width)))) (unless (equal new doc-view-image-width) (setq-local doc-view-image-width new) @@ -792,9 +788,7 @@ OpenDocument format)." (defun doc-view-scale-reset () "Reset the document size/zoom level to the initial one." (interactive) - (if (and doc-view-scale-internally - (eq (plist-get (cdr (doc-view-current-image)) :type) - 'imagemagick)) + (if doc-view-scale-internally (progn (kill-local-variable 'doc-view-image-width) (doc-view-insert-image @@ -1393,12 +1387,11 @@ ARGS is a list of image descriptors." ;; Only insert the image if the buffer is visible. (when (window-live-p (overlay-get ol 'window)) (let* ((image (if (and file (file-readable-p file)) - (if (not (and doc-view-scale-internally - (fboundp 'imagemagick-types))) + (if (not doc-view-scale-internally) (apply #'create-image file doc-view--image-type nil args) (unless (member :width args) (setq args `(,@args :width ,doc-view-image-width))) - (apply #'create-image file 'imagemagick nil args)))) + (apply #'create-image file doc-view--image-type nil args)))) (slice (doc-view-current-slice)) (img-width (and image (car (image-size image)))) (displayed-img-width (if (and image slice) commit 1b8d369c381b5a63e40529d0d95dfa75d94b8e09 Author: Lars Ingebrigtsen Date: Fri Aug 14 13:29:52 2020 +0200 Change icomplete-show-matches-on-no-input behavior * lisp/icomplete.el (icomplete-show-matches-on-no-input): Doc fix. (icomplete-completions): Set completion-content-when-empty. * lisp/minibuffer.el (completion-content-when-empty): New variable. (completion--complete-and-exit): Use it (bug#19032). Based on a patch by Matthew Leach . diff --git a/etc/NEWS b/etc/NEWS index 5dcaefeefe..91add027e4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -785,6 +785,12 @@ digits. ** Miscellaneous +--- +*** 'icomplete-show-matches-on-no-input' behavior change +Previously, choosing a different completion with commands like 'C-.' +and then hitting enter would choose the default completion. Doung +this will now choose the completion under point. + --- *** New user option 'term-scroll-snap-to-bottom'. By default, 'term' and 'ansi-term' will now recenter the buffer so diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 3747ae3d28..8a68df876c 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -75,7 +75,11 @@ everything preceding the ~/ is discarded so the interactive selection process starts again from the user's $HOME.") (defcustom icomplete-show-matches-on-no-input nil - "When non-nil, show completions when first prompting for input." + "When non-nil, show completions when first prompting for input. +This also means that if you traverse the list of completions with +commands like `C-.' and just hit `C-j' (enter) without typing any +characters, the match under point will be chosen instead of the +default." :type 'boolean :version "24.4") @@ -709,7 +713,10 @@ matches exist." (push comp prospects) (setq limit t)))) (setq prospects (nreverse prospects)) - ;; Decorate first of the prospects. + ;; Return the first match if the user hits enter. + (when icomplete-show-matches-on-no-input + (setq completion-content-when-empty (car prospects))) + ;; Decorate first of the prospects. (when prospects (let ((first (copy-sequence (pop prospects)))) (put-text-property 0 (length first) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 0d99f4687c..641a2e5315 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1119,6 +1119,7 @@ completion candidates than this number." (defvar-local completion-all-sorted-completions nil) (defvar-local completion--all-sorted-completions-location nil) (defvar completion-cycling nil) ;Function that takes down the cycling map. +(defvar completion-content-when-empty nil) (defvar completion-fail-discreetly nil "If non-nil, stay quiet when there is no match.") @@ -1503,8 +1504,13 @@ If `minibuffer-completion-confirm' is `confirm-after-completion', COMPLETION-FUNCTION is called if the current buffer's content does not appear to be a match." (cond - ;; Allow user to specify null string - ((= beg end) (funcall exit-function)) + ;; Allow user to specify null string. In the case that + ;; `completion-content-when-empty' is set, use that instead. + ((= beg end) + (when completion-content-when-empty + (completion--replace beg end completion-content-when-empty)) + (funcall exit-function)) + ((test-completion (buffer-substring beg end) minibuffer-completion-table minibuffer-completion-predicate) commit 744e97ce6d9fc5c3f8653e4840b00ef0cd14278f Author: Stefan Kangas Date: Fri Aug 14 13:03:42 2020 +0200 Remove Emacs 22 compat code from semantic * lisp/cedet/semantic/bovine/c.el (semantic-c-end-of-macro): Make into obsolete function alias for 'c-end-of-macro'. (semantic-lex-cpp-define, semantic-lex-c-macrobits): * lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-paren-or-list): Adjust callers. diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el index 358829a456..3649d1c2f1 100644 --- a/lisp/cedet/semantic/bovine/c.el +++ b/lisp/cedet/semantic/bovine/c.el @@ -46,27 +46,10 @@ (declare-function c-forward-conditional "cc-cmds") (declare-function ede-system-include-path "ede") -;;; Compatibility -;; (eval-when-compile (require 'cc-mode)) -(if (fboundp 'c-end-of-macro) - (eval-and-compile - (defalias 'semantic-c-end-of-macro 'c-end-of-macro)) - ;; From cc-mode 5.30 - (defun semantic-c-end-of-macro () - "Go to the end of a preprocessor directive. -More accurately, move point to the end of the closest following line -that doesn't end with a line continuation backslash. - -This function does not do any hidden buffer changes." - (while (progn - (end-of-line) - (when (and (eq (char-before) ?\\) - (not (eobp))) - (forward-char) - t)))) - ) +(define-obsolete-function-alias 'semantic-c-end-of-macro + #'c-end-of-macro "28.1") ;;; Code: (with-suppressed-warnings ((obsolete define-child-mode)) @@ -266,7 +249,7 @@ Return the defined symbol as a special spp lex token." (semantic-lex-analyzer #'semantic-cpp-lexer) (raw-stream (semantic-lex-spp-stream-for-macro (save-excursion - (semantic-c-end-of-macro) + (c-end-of-macro) ;; HACK - If there's a C comment after ;; the macro, do not parse it. (if (looking-back "/\\*.*" beginning-of-define) @@ -590,7 +573,7 @@ case, we must skip it since it is the ELSE part." (define-lex-regex-analyzer semantic-lex-c-macrobits "Ignore various forms of #if/#else/#endif conditionals." "^\\s-*#\\s-*\\(if\\(n?def\\)?\\|endif\\|elif\\|else\\)" - (semantic-c-end-of-macro) + (c-end-of-macro) (setq semantic-lex-end-point (point)) nil) diff --git a/lisp/cedet/semantic/lex-spp.el b/lisp/cedet/semantic/lex-spp.el index b8812de05b..e6e124eb81 100644 --- a/lisp/cedet/semantic/lex-spp.el +++ b/lisp/cedet/semantic/lex-spp.el @@ -70,7 +70,7 @@ (require 'semantic) (require 'semantic/lex) -(declare-function semantic-c-end-of-macro "semantic/bovine/c") +(declare-function c-end-of-macro "cc-engine") ;;; Code: (defvar semantic-lex-spp-macro-symbol-obarray nil @@ -946,7 +946,7 @@ by another macro." (save-excursion (let ((start (match-beginning 0)) (end (match-end 0)) - (peom (save-excursion (semantic-c-end-of-macro) (point)))) + (peom (save-excursion (c-end-of-macro) (point)))) (condition-case nil (progn ;; This will throw an error if no closing paren can be found. commit 4344a3cfb7a293ed17a684a2a11eb6b59b02cb2a Author: Stefan Kangas Date: Fri Aug 14 12:45:23 2020 +0200 Make Emacs 20 compat code in derived.el obsolete * lisp/emacs-lisp/derived.el (derived-mode-setup-function-name): Declare obsolete. This was for compatibility with Emacs 20 or older. diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el index 3eafad177d..6a11f1c394 100644 --- a/lisp/emacs-lisp/derived.el +++ b/lisp/emacs-lisp/derived.el @@ -364,6 +364,7 @@ which more-or-less shadow%s %s's corresponding table%s." (defsubst derived-mode-setup-function-name (mode) "Construct a setup-function name based on a MODE name." + (declare (obsolete nil "28.1")) (intern (concat (symbol-name mode) "-setup"))) commit 874ba85363e90a54f976af542e9b3f4c662e317e Author: Stefan Kangas Date: Sat May 16 14:16:24 2020 +0200 Remove many items obsolete since Emacs 23.1 Emacs 23.1 was five major releases and over a decade ago. This list can be reviewed before to the next release, but for now hopefully this motivates any needed external updates. Ref: https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg02198.html * lisp/abbrev.el (pre-abbrev-expand-hook): * lisp/bookmark.el (bookmark-read-annotation-text-func) (bookmark-jump-noselect): * lisp/buff-menu.el (buffer-menu-mode-hook): * lisp/cus-edit.el (custom-mode-hook, custom-mode): * lisp/dirtrack.el (dirtrack-debug-toggle, dirtrack-debug): * lisp/emacs-lisp/crm.el (crm-minibuffer-complete) (crm-minibuffer-completion-help) (crm-minibuffer-complete-and-exit): * lisp/emacs-lisp/easymenu.el (easy-menu-precalculate-equivalent-keybindings): * lisp/emacs-lisp/lisp-mode.el (lisp-mode-auto-fill): * lisp/epa.el (epa-display-verify-result): * lisp/epg.el (epg-passphrase-callback-function): * lisp/eshell/eshell.el (eshell-report-bug): * lisp/ffap.el (ffap-bug, ffap-submit-bug): * lisp/files.el (locate-file-completion): * lisp/hi-lock.el (hi-lock-face-history, hi-lock-regexp-history): * lisp/hilit-chg.el (highlight-changes-initial-state) (highlight-changes-active-string) (highlight-changes-passive-string, global-highlight-changes): * lisp/international/mule-cmds.el (nonascii-insert-offset) (nonascii-translation-table): * lisp/international/mule-diag.el (non-iso-charset-alist): * lisp/international/mule-util.el (detect-coding-with-priority): * lisp/international/mule.el (charset-id, charset-bytes) (charset-list, char-valid-p, generic-char-p) (char-coding-system-table, make-coding-system) (set-coding-priority) * lisp/mail/rmail.el (rmail-message-filter): * lisp/minibuffer.el (complete-in-turn, dynamic-completion-table) (completion-common-substring) (minibuffer-local-must-match-filename-map): * lisp/mouse.el (mouse-major-mode-menu, mouse-popup-menubar) (mouse-popup-menubar-stuff): * lisp/net/newst-treeview.el (newsticker-groups-filename): * lisp/obsolete/tpu-edt.el (tpu-have-ispell, GOLD-map): * lisp/password-cache.el (password-read-and-add): * lisp/shell.el (shell-dirtrack-toggle): * lisp/subr.el (forward-point, redisplay-end-trigger-functions) (process-filter-multibyte-p, set-process-filter-multibyte): * lisp/t-mouse.el (t-mouse-mode): * lisp/term/w32-win.el (w32-focus-frame, w32-select-font): * lisp/textmodes/ispell.el (ispell-aspell-supports-utf8): * lisp/textmodes/remember.el (remember-buffer): * lisp/tooltip.el (tooltip-hook): * lisp/url/url-util.el (url-generate-unique-filename): * lisp/url/url-vars.el (url-temporary-directory): * lisp/vc/vc-hooks.el (vc-workfile-version) (vc-default-working-revision): * lisp/vc/vc-mtn.el (vc-mtn-command): * lisp/vc/vc.el (vc-revert-buffer): * lisp/vcursor.el (vcursor-toggle-vcursor-map): Remove items, obsolete since Emacs 23.1. * lisp/abbrev.el (expand-abbrev): * lisp/epg.el (epg-context): Change 'epg-passphrase-callback-function' call to 'epa-' alternative. * lisp/eshell/em-rebind.el (eshell-cannot-leave-input-list): Don't refer to removed function 'forward-point'. * test/manual/etags/c-src/abbrev.c (Fexpand_abbrev): (syms_of_abbrev): Don't run removed hook 'pre-abbrev-expand-hook'. * lisp/international/mule.el (transform-make-coding-system-args): Declare obsolete. * lisp/progmodes/idlwave.el: Update reference to removed function 'char-valid-p'. * lisp/gnus/mml2015.el (epg-encrypt-string): * lisp/gnus/mml1991.el (epg-make-context): * lisp/gnus/mml-smime.el (autoload): Remove autoload of removed 'epg-passphrase-callback-function'. * lisp/minibuffer.el (completion-extra-properties): Remove support for `completion-common-substring'. * lisp/obsolete/tpu-edt.el (tpu-toggle-overwrite-mode) Remove support for removed `spell' package. * src/coding.c (syms_of_coding): * doc/misc/efaq.texi: * doc/emacs/frames.texi (Menu Mouse Clicks): * doc/misc/url.texi (Customization): Doc fixes. ; * etc/NEWS: List removed items. diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index acd7fb13ae..a512fd14c8 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -2605,6 +2605,7 @@ the function or facility is available, like this: (if (fboundp 'blink-cursor-mode) (blink-cursor-mode 0)) +@c FIXME: Find better example since `set-coding-priority' is removed. (if (boundp 'coding-category-utf-8) (set-coding-priority '(coding-category-utf-8))) @end example diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index b99d8ab145..b74887612b 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -366,9 +366,13 @@ instead of running the @code{mouse-save-then-kill} command, rebind @kbd{mouse-3} by adding the following line to your init file (@pxref{Init Rebinding}): -@c FIXME: `mouse-popup-menubar-stuff' is obsolete since 23.1. @smallexample -(global-set-key [mouse-3] 'mouse-popup-menubar-stuff) +(global-set-key [mouse-3] + '(menu-item "Menu Bar" ignore + :filter (lambda (_) + (if (zerop (or (frame-parameter nil 'menu-bar-lines) 0)) + (mouse-menu-bar-map) + (mouse-menu-major-mode-map))))) @end smallexample @node Mode Line Mouse diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index 82467048a0..62dcc0b753 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -4192,7 +4192,7 @@ You can get the old behavior by binding @kbd{SPC} to (define-key minibuffer-local-filename-completion-map (kbd "SPC") 'minibuffer-complete-word) -(define-key minibuffer-local-must-match-filename-map (kbd "SPC") +(define-key minibuffer-local-filename-must-match-map (kbd "SPC") 'minibuffer-complete-word) @end lisp diff --git a/doc/misc/url.texi b/doc/misc/url.texi index 8d9b102407..0304ff4b9f 100644 --- a/doc/misc/url.texi +++ b/doc/misc/url.texi @@ -1312,8 +1312,6 @@ repeated visits do not require repeated domain lookups. @end defopt @defopt url-max-password-attempts @end defopt -@defopt url-temporary-directory -@end defopt @defopt url-show-status @end defopt @defopt url-confirmation-func diff --git a/etc/NEWS b/etc/NEWS index 962389d521..5dcaefeefe 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -902,6 +902,40 @@ have now been removed. ** Some libraries obsolete since Emacs 23 have been removed: 'ledit.el', 'lmenu.el', 'lucid.el and 'old-whitespace.el'. +--- +** Some functions and variables obsolete since Emacs 23 have been removed: + +'GOLD-map', 'bookmark-jump-noselect', +'bookmark-read-annotation-text-func', 'buffer-menu-mode-hook', +'char-coding-system-table', 'char-valid-p', 'charset-bytes', +'charset-id', 'charset-list' (function), 'complete-in-turn', +'completion-common-substring', 'crm-minibuffer-complete', +'crm-minibuffer-complete-and-exit', 'crm-minibuffer-completion-help', +'custom-mode', 'custom-mode-hook', 'detect-coding-with-priority', +'dirtrack-debug' (function), 'dirtrack-debug-toggle', +'dynamic-completion-table', +'easy-menu-precalculate-equivalent-keybindings', +'epa-display-verify-result', 'epg-passphrase-callback-function', +'eshell-report-bug', 'ffap-bug', 'ffap-submit-bug', 'forward-point', +'generic-char-p', 'global-highlight-changes', 'hi-lock-face-history', +'hi-lock-regexp-history', 'highlight-changes-active-string', +'highlight-changes-initial-state', 'highlight-changes-passive-string', +'ispell-aspell-supports-utf8', 'lisp-mode-auto-fill', +'locate-file-completion', 'make-coding-system', +'minibuffer-local-must-match-filename-map', 'mouse-major-mode-menu', +'mouse-popup-menubar', 'mouse-popup-menubar-stuff', +'newsticker-groups-filename', 'non-iso-charset-alist', +'nonascii-insert-offset', 'nonascii-translation-table', +'password-read-and-add', 'pre-abbrev-expand-hook', +'process-filter-multibyte-p', 'remember-buffer' (function), +'rmail-message-filter', 'set-coding-priority', +'set-process-filter-multibyte', 'shell-dirtrack-toggle', +'t-mouse-mode', 'tooltip-hook', 'tpu-have-ispell', +'url-generate-unique-filename', 'url-temporary-directory', +'vc-arch-command', 'vc-default-working-revision' (variable), +'vc-mtn-command', 'vc-revert-buffer', 'vc-workfile-version', +'vcursor-toggle-vcursor-map', 'w32-focus-frame', 'w32-select-font'. + * Lisp Changes in Emacs 28.1 diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 2d61a96010..468b0d995b 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -517,14 +517,6 @@ It is nil if the abbrev has already been unexpanded.") ;; "Local (mode-specific) abbrev table of current buffer.") ;; (make-variable-buffer-local 'local-abbrev-table) -(defcustom pre-abbrev-expand-hook nil - "Function or functions to be called before abbrev expansion is done. -This is the first thing that `expand-abbrev' does, and so this may change -the current abbrev table before abbrev lookup happens." - :type 'hook - :group 'abbrev-mode) -(make-obsolete-variable 'pre-abbrev-expand-hook 'abbrev-expand-function "23.1") - (defun clear-abbrev-table (table) "Undefine all abbrevs in abbrev table TABLE, leaving it empty." (setq abbrevs-changed t) @@ -836,12 +828,10 @@ Takes no argument and should return the abbrev symbol if expansion took place.") (defun expand-abbrev () "Expand the abbrev before point, if there is an abbrev there. Effective when explicitly called even when `abbrev-mode' is nil. -Before doing anything else, runs `pre-abbrev-expand-hook'. Calls the value of `abbrev-expand-function' with no argument to do the work, and returns whatever it does. (That return value should be the abbrev symbol if expansion occurred, else nil.)" (interactive) - (run-hooks 'pre-abbrev-expand-hook) (funcall abbrev-expand-function)) (defun abbrev--default-expand () diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 36a361c3f4..8a3bcf8e59 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -923,8 +923,6 @@ annotations." "# Date: " (current-time-string) "\n")) -(define-obsolete-variable-alias 'bookmark-read-annotation-text-func - 'bookmark-edit-annotation-text-func "23.1") (defvar bookmark-edit-annotation-text-func 'bookmark-default-annotation-text "Function to return default text to use for a bookmark annotation. It takes one argument, the name of the bookmark, as a string.") @@ -1143,17 +1141,6 @@ DISPLAY-FUNC would be `switch-to-buffer-other-window'." (let ((pop-up-frames t)) (bookmark-jump-other-window bookmark))) -(defun bookmark-jump-noselect (bookmark) - "Return the location pointed to by BOOKMARK (see `bookmark-jump'). -The return value has the form (BUFFER . POINT). - -Note: this function is deprecated and is present for Emacs 22 -compatibility only." - (declare (obsolete bookmark-handle-bookmark "23.1")) - (save-excursion - (bookmark-handle-bookmark bookmark) - (cons (current-buffer) (point)))) - (defun bookmark-handle-bookmark (bookmark-name-or-record) "Call BOOKMARK-NAME-OR-RECORD's handler or `bookmark-default-handler' if it has none. This changes current buffer and point and returns nil, diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index aa5c47ca7f..d06ba28787 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el @@ -229,9 +229,6 @@ commands.") map) "Local keymap for `Buffer-menu-mode' buffers.") -(define-obsolete-variable-alias 'buffer-menu-mode-hook - 'Buffer-menu-mode-hook "23.1") - (define-derived-mode Buffer-menu-mode tabulated-list-mode "Buffer Menu" "Major mode for Buffer Menu buffers. The Buffer Menu is invoked by the commands \\[list-buffers], diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 16695967df..5ec5799f80 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -4868,8 +4868,6 @@ If several parents are listed, go to the first of them." (parent (downcase (widget-get button :tag)))) (customize-group parent))))) -(define-obsolete-variable-alias 'custom-mode-hook 'Custom-mode-hook "23.1") - (defcustom Custom-mode-hook nil "Hook called when entering Custom mode." :type 'hook @@ -4940,8 +4938,6 @@ if that value is non-nil." (put 'Custom-mode 'mode-class 'special) -(define-obsolete-function-alias 'custom-mode 'Custom-mode "23.1") - ;;; The End. (provide 'cus-edit) diff --git a/lisp/dirtrack.el b/lisp/dirtrack.el index 3a0bbd2c9c..ad0c18d1b3 100644 --- a/lisp/dirtrack.el +++ b/lisp/dirtrack.el @@ -196,9 +196,6 @@ directory." (remove-hook 'comint-preoutput-filter-functions 'dirtrack t))) -(define-obsolete-function-alias 'dirtrack-debug-toggle 'dirtrack-debug-mode - "23.1") -(define-obsolete-variable-alias 'dirtrack-debug 'dirtrack-debug-mode "23.1") (define-minor-mode dirtrack-debug-mode "Toggle Dirtrack debugging." nil nil nil diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el index 65483d0813..89d106ee48 100644 --- a/lisp/emacs-lisp/crm.el +++ b/lisp/emacs-lisp/crm.el @@ -270,12 +270,6 @@ with empty strings removed." (remove-hook 'choose-completion-string-functions 'crm--choose-completion-string))) -(define-obsolete-function-alias 'crm-minibuffer-complete 'crm-complete "23.1") -(define-obsolete-function-alias - 'crm-minibuffer-completion-help 'crm-completion-help "23.1") -(define-obsolete-function-alias - 'crm-minibuffer-complete-and-exit 'crm-complete-and-exit "23.1") - ;; testing and debugging ;; (defun crm-init-test-environ () ;; "Set up some variables for testing." diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index 6ba8b997f8..73dabef3fa 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el @@ -29,16 +29,6 @@ ;;; Code: -(defvar easy-menu-precalculate-equivalent-keybindings nil - "Determine when equivalent key bindings are computed for easy-menu menus. -It can take some time to calculate the equivalent key bindings that are shown -in a menu. If the variable is on, then this calculation gives a (maybe -noticeable) delay when a mode is first entered. If the variable is off, then -this delay will come when a menu is displayed the first time. If you never use -menus, turn this variable off, otherwise it is probably better to keep it on.") -(make-obsolete-variable - 'easy-menu-precalculate-equivalent-keybindings nil "23.1") - (defsubst easy-menu-intern (s) (if (stringp s) (intern s) s)) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 1311d94cb0..d0c28ec5dc 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -785,8 +785,6 @@ or to switch back to an existing one." nil))) (comment-indent-default))) -(define-obsolete-function-alias 'lisp-mode-auto-fill 'do-auto-fill "23.1") - (defcustom lisp-indent-offset nil "If non-nil, indent second line of expressions that many more columns." :group 'lisp diff --git a/lisp/epa.el b/lisp/epa.el index d190824293..5140d3f0a6 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -666,10 +666,6 @@ If SECRET is non-nil, list secret keys instead of public keys." (goto-char (point-min))) (display-buffer buffer))))) -(defun epa-display-verify-result (verify-result) - (declare (obsolete epa-display-info "23.1")) - (epa-display-info (epg-verify-result-to-string verify-result))) - (defun epa-passphrase-callback-function (context key-id handback) (if (eq key-id 'SYM) (read-passwd diff --git a/lisp/epg.el b/lisp/epg.el index 96af3ad4bc..920b85398f 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -190,6 +190,7 @@ (string nil :read-only t)) ;;;; Context Struct +(declare-function epa-passphrase-callback-function "epa.el") (cl-defstruct (epg-context (:constructor nil) @@ -215,7 +216,7 @@ cipher-algorithm digest-algorithm compress-algorithm - (passphrase-callback (list #'epg-passphrase-callback-function)) + (passphrase-callback (list #'epa-passphrase-callback-function)) progress-callback edit-callback signers @@ -1246,19 +1247,6 @@ callback data (if any)." ;;; Functions -(defun epg-passphrase-callback-function (context key-id _handback) - (declare (obsolete epa-passphrase-callback-function "23.1")) - (if (eq key-id 'SYM) - (read-passwd "Passphrase for symmetric encryption: " - (eq (epg-context-operation context) 'encrypt)) - (read-passwd - (if (eq key-id 'PIN) - "Passphrase for PIN: " - (let ((entry (assoc key-id epg-user-id-alist))) - (if entry - (format "Passphrase for %s %s: " key-id (cdr entry)) - (format "Passphrase for %s: " key-id))))))) - (defun epg--list-keys-1 (context name mode) (let ((args (append (if (epg-context-home-directory context) (list "--homedir" diff --git a/lisp/eshell/em-rebind.el b/lisp/eshell/em-rebind.el index bf5a4bf1af..7991c63177 100644 --- a/lisp/eshell/em-rebind.el +++ b/lisp/eshell/em-rebind.el @@ -114,7 +114,6 @@ This is default behavior of shells like bash." backward-list forward-page backward-page - forward-point forward-paragraph backward-paragraph backward-prefix-chars diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el index 5ffb159b57..6698ca45de 100644 --- a/lisp/eshell/eshell.el +++ b/lisp/eshell/eshell.el @@ -384,15 +384,6 @@ corresponding to a successful execution." (set status-var eshell-last-command-status)) (cadr result)))))) -;;;_* Reporting bugs -;; -;; If you do encounter a bug, on any system, please report -;; it -- in addition to any particular oddities in your configuration -;; -- so that the problem may be corrected for the benefit of others. - -;;;###autoload -(define-obsolete-function-alias 'eshell-report-bug 'report-emacs-bug "23.1") - ;;; Code: (defun eshell-unload-all-modules () diff --git a/lisp/ffap.el b/lisp/ffap.el index ceba9d2622..4a506207d5 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1824,12 +1824,6 @@ Only intended for interactive use." (defalias 'find-file-literally-at-point 'ffap-literally) - -;;; Bug Reporter: - -(define-obsolete-function-alias 'ffap-bug 'report-emacs-bug "23.1") -(define-obsolete-function-alias 'ffap-submit-bug 'report-emacs-bug "23.1") - ;;; Hooks for Gnus, VM, Rmail: ;; diff --git a/lisp/files.el b/lisp/files.el index 9270f334af..f92c3793b0 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -985,14 +985,6 @@ one or more of those symbols." (completion-table-with-context string-dir names string-file pred action))))) -(defun locate-file-completion (string path-and-suffixes action) - "Do completion for file names passed to `locate-file'. -PATH-AND-SUFFIXES is a pair of lists, (DIRECTORIES . SUFFIXES)." - (declare (obsolete locate-file-completion-table "23.1")) - (locate-file-completion-table (car path-and-suffixes) - (cdr path-and-suffixes) - string nil action)) - (defvar locate-dominating-stop-dir-regexp (purecopy "\\`\\(?:[\\/][\\/][^\\/]+[\\/]\\|/\\(?:net\\|afs\\|\\.\\.\\.\\)/\\)\\'") "Regexp of directory names that stop the search in `locate-dominating-file'. diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el index 4754f37a2d..acddb30033 100644 --- a/lisp/gnus/mml-smime.el +++ b/lisp/gnus/mml-smime.el @@ -329,7 +329,6 @@ Whether the passphrase is cached at all is controlled by (autoload 'epg-verify-string "epg") (autoload 'epg-sign-string "epg") (autoload 'epg-encrypt-string "epg") - (autoload 'epg-passphrase-callback-function "epg") (autoload 'epg-context-set-passphrase-callback "epg") (autoload 'epg-sub-key-fingerprint "epg") (autoload 'epg-configuration "epg-config") diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el index 8be1b84e52..88864ea357 100644 --- a/lisp/gnus/mml1991.el +++ b/lisp/gnus/mml1991.el @@ -242,7 +242,6 @@ Whether the passphrase is cached at all is controlled by (defvar epg-user-id-alist) (autoload 'epg-make-context "epg") -(autoload 'epg-passphrase-callback-function "epg") (autoload 'epa-select-keys "epa") (autoload 'epg-list-keys "epg") (autoload 'epg-context-set-armor "epg") diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el index d1d150ad2e..45c9bbfe90 100644 --- a/lisp/gnus/mml2015.el +++ b/lisp/gnus/mml2015.el @@ -712,7 +712,6 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (autoload 'epg-verify-string "epg") (autoload 'epg-sign-string "epg") (autoload 'epg-encrypt-string "epg") -(autoload 'epg-passphrase-callback-function "epg") (autoload 'epg-context-set-passphrase-callback "epg") (autoload 'epg-key-sub-key-list "epg") (autoload 'epg-sub-key-capability "epg") diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index 33ca40f8de..0ffe77d276 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -237,17 +237,11 @@ Instead, each hi-lock command will cycle through the faces in "Human-readable lighters for `hi-lock-interactive-patterns'.") (put 'hi-lock-interactive-lighters 'permanent-local t) -(define-obsolete-variable-alias 'hi-lock-face-history - 'hi-lock-face-defaults "23.1") (defvar hi-lock-face-defaults '("hi-yellow" "hi-pink" "hi-green" "hi-blue" "hi-salmon" "hi-aquamarine" "hi-black-b" "hi-blue-b" "hi-red-b" "hi-green-b" "hi-black-hb") "Default faces for hi-lock interactive functions.") -(define-obsolete-variable-alias 'hi-lock-regexp-history - 'regexp-history - "23.1") - (defvar hi-lock-file-patterns-prefix "Hi-lock" "String used to identify hi-lock patterns at the start of files.") diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el index 04a5ccd8d5..ae97bb008a 100644 --- a/lisp/hilit-chg.el +++ b/lisp/hilit-chg.el @@ -224,9 +224,6 @@ colors then use this, if you want fancier faces then set ;; When you invoke highlight-changes-mode, should highlight-changes-visible-mode ;; be on or off? -(define-obsolete-variable-alias 'highlight-changes-initial-state - 'highlight-changes-visibility-initial-state "23.1") - (defcustom highlight-changes-visibility-initial-state t "Controls whether changes are initially visible in Highlight Changes mode. @@ -236,13 +233,7 @@ When a buffer is in Highlight Changes mode the function :type 'boolean :group 'highlight-changes) -;; highlight-changes-global-initial-state has been removed - - - ;; These are the strings displayed in the mode-line for the minor mode: -(define-obsolete-variable-alias 'highlight-changes-active-string - 'highlight-changes-visible-string "23.1") (defcustom highlight-changes-visible-string " +Chg" "The string used when in Highlight Changes mode and changes are visible. @@ -252,9 +243,6 @@ a string with a leading space." (const :tag "None" nil)) :group 'highlight-changes) -(define-obsolete-variable-alias 'highlight-changes-passive-string - 'highlight-changes-invisible-string "23.1") - (defcustom highlight-changes-invisible-string " -Chg" "The string used when in Highlight Changes mode and changes are hidden. This should be set to nil if no indication is desired, or to @@ -957,10 +945,6 @@ changes are made, so \\[highlight-changes-next-change] and (define-globalized-minor-mode global-highlight-changes-mode highlight-changes-mode highlight-changes-mode-turn-on) -(define-obsolete-function-alias - 'global-highlight-changes - 'global-highlight-changes-mode "23.1") - (defun highlight-changes-mode-turn-on () "See if Highlight Changes mode should be turned on for this buffer. This is called when `global-highlight-changes-mode' is turned on." diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 7714a778fc..5fe931dd9b 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -2968,11 +2968,6 @@ on encoding." ;; Doc said "obsolete" in 23.1, this statement only added in 24.1. (make-obsolete 'unify-8859-on-decoding-mode "don't use it." "23.1") -(defvar nonascii-insert-offset 0) -(make-obsolete-variable 'nonascii-insert-offset "do not use it." "23.1") -(defvar nonascii-translation-table nil) -(make-obsolete-variable 'nonascii-translation-table "do not use it." "23.1") - (defvar ucs-names nil "Hash table of cached CHAR-NAME keys to CHAR-CODE values.") diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el index 80e78ef787..b13bde58ca 100644 --- a/lisp/international/mule-diag.el +++ b/lisp/international/mule-diag.el @@ -200,10 +200,6 @@ Character sets for defining other charsets, or for backward compatibility ;;; (charset-iso-graphic-plane charset) (charset-description charset))))) -(defvar non-iso-charset-alist nil - "Obsolete.") -(make-obsolete-variable 'non-iso-charset-alist "no longer relevant." "23.1") - ;; A variable to hold charset input history. (defvar charset-history nil) diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el index 5cc10b1315..660ac58e02 100644 --- a/lisp/international/mule-util.el +++ b/lisp/international/mule-util.el @@ -274,15 +274,6 @@ operations such as `find-coding-systems-region'." ;;;###autoload(put 'with-coding-priority 'lisp-indent-function 1) (put 'with-coding-priority 'edebug-form-spec t) -;;;###autoload -(defmacro detect-coding-with-priority (from to priority-list) - "Detect a coding system of the text between FROM and TO with PRIORITY-LIST. -PRIORITY-LIST is an alist of coding categories vs the corresponding -coding systems ordered by priority." - (declare (obsolete with-coding-priority "23.1")) - `(with-coding-priority (mapcar #'cdr ,priority-list) - (detect-coding-region ,from ,to))) - ;;;###autoload (defun detect-coding-with-language-environment (from to lang-env) "Detect a coding system for the text between FROM and TO with LANG-ENV. diff --git a/lisp/international/mule.el b/lisp/international/mule.el index df71205d51..092abc09b0 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -408,16 +408,6 @@ PLIST (property list) may contain any type of information a user ;; because that makes a bootstrapping problem ;; if you need to recompile all the Lisp files using interpreted code. -(defun charset-id (_charset) - "Always return 0. This is provided for backward compatibility." - (declare (obsolete nil "23.1")) - 0) - -(defmacro charset-bytes (_charset) - "Always return 0. This is provided for backward compatibility." - (declare (obsolete nil "23.1")) - 0) - (defun get-charset-property (charset propname) "Return the value of CHARSET's PROPNAME property. This is the last value stored with @@ -463,19 +453,8 @@ Return -1 if charset isn't an ISO 2022 one." "Return long name of CHARSET." (plist-get (charset-plist charset) :long-name)) -(defun charset-list () - "Return list of all charsets ever defined." - (declare (obsolete charset-list "23.1")) - charset-list) - ;;; CHARACTER -(define-obsolete-function-alias 'char-valid-p 'characterp "23.1") - -(defun generic-char-p (_char) - "Always return nil. This is provided for backward compatibility." - (declare (obsolete nil "23.1")) - nil) (defun make-char-internal (charset-id &optional code1 code2) (let ((charset (aref emacs-mule-charset-table charset-id))) @@ -1085,14 +1064,11 @@ formats (e.g. iso-latin-1-unix, koi8-r-dos)." (setq codings (cons alias codings)))))) codings)) -(defconst char-coding-system-table nil - "It exists just for backward compatibility, and the value is always nil.") -(make-obsolete-variable 'char-coding-system-table nil "23.1") - (defun transform-make-coding-system-args (name type &optional doc-string props) "For internal use only. Transform XEmacs style args for `make-coding-system' to Emacs style. Value is a list of transformed arguments." + (declare (obsolete nil "28.1")) (let ((mnemonic (string-to-char (or (plist-get props 'mnemonic) "?"))) (eol-type (plist-get props 'eol-type)) properties tmp) @@ -1170,106 +1146,6 @@ Value is a list of transformed arguments." (error "unsupported XEmacs style make-coding-style arguments: %S" `(,name ,type ,doc-string ,props)))))) -(defun make-coding-system (coding-system type mnemonic doc-string - &optional - flags - properties - eol-type) - "Define a new coding system CODING-SYSTEM (symbol). -This function is provided for backward compatibility." - (declare (obsolete define-coding-system "23.1")) - ;; For compatibility with XEmacs, we check the type of TYPE. If it - ;; is a symbol, perhaps, this function is called with XEmacs-style - ;; arguments. Here, try to transform that kind of arguments to - ;; Emacs style. - (if (symbolp type) - (let ((args (transform-make-coding-system-args coding-system type - mnemonic doc-string))) - (setq coding-system (car args) - type (nth 1 args) - mnemonic (nth 2 args) - doc-string (nth 3 args) - flags (nth 4 args) - properties (nth 5 args) - eol-type (nth 6 args)))) - - (setq type - (cond ((eq type 0) 'emacs-mule) - ((eq type 1) 'shift-jis) - ((eq type 2) 'iso2022) - ((eq type 3) 'big5) - ((eq type 4) 'ccl) - ((eq type 5) 'raw-text) - (t - (error "Invalid coding system type: %s" type)))) - - (setq properties - (let ((plist nil) key) - (dolist (elt properties) - (setq key (car elt)) - (cond ((eq key 'post-read-conversion) - (setq key :post-read-conversion)) - ((eq key 'pre-write-conversion) - (setq key :pre-write-conversion)) - ((eq key 'translation-table-for-decode) - (setq key :decode-translation-table)) - ((eq key 'translation-table-for-encode) - (setq key :encode-translation-table)) - ((eq key 'safe-charsets) - (setq key :charset-list)) - ((eq key 'mime-charset) - (setq key :mime-charset)) - ((eq key 'valid-codes) - (setq key :valids))) - (setq plist (plist-put plist key (cdr elt)))) - plist)) - (setq properties (plist-put properties :mnemonic mnemonic)) - (plist-put properties :coding-type type) - (cond ((eq eol-type 0) (setq eol-type 'unix)) - ((eq eol-type 1) (setq eol-type 'dos)) - ((eq eol-type 2) (setq eol-type 'mac)) - ((vectorp eol-type) (setq eol-type nil))) - (plist-put properties :eol-type eol-type) - - (cond - ((eq type 'iso2022) - (plist-put properties :flags - (list (and (or (consp (nth 0 flags)) - (consp (nth 1 flags)) - (consp (nth 2 flags)) - (consp (nth 3 flags))) 'designation) - (or (nth 4 flags) 'long-form) - (and (nth 5 flags) 'ascii-at-eol) - (and (nth 6 flags) 'ascii-at-cntl) - (and (nth 7 flags) '7-bit) - (and (nth 8 flags) 'locking-shift) - (and (nth 9 flags) 'single-shift) - (and (nth 10 flags) 'use-roman) - (and (nth 11 flags) 'use-oldjis) - (or (nth 12 flags) 'direction) - (and (nth 13 flags) 'init-at-bol) - (and (nth 14 flags) 'designate-at-bol) - (and (nth 15 flags) 'safe) - (and (nth 16 flags) 'latin-extra))) - (plist-put properties :designation - (let ((vec (make-vector 4 nil))) - (dotimes (i 4) - (let ((spec (nth i flags))) - (if (eq spec t) - (aset vec i '(94 96)) - (if (consp spec) - (progn - (if (memq t spec) - (setq spec (append (delq t spec) '(94 96)))) - (aset vec i spec)))))) - vec))) - - ((eq type 'ccl) - (plist-put properties :ccl-decoder (car flags)) - (plist-put properties :ccl-encoder (cdr flags)))) - - (apply 'define-coding-system coding-system doc-string properties)) - (defun merge-coding-systems (first second) "Fill in any unspecified aspects of coding system FIRST from SECOND. Return the resulting coding system." @@ -1616,15 +1492,6 @@ This setting is effective for the next communication only." (setq next-selection-coding-system coding-system)) -(defun set-coding-priority (arg) - "Set priority of coding categories according to ARG. -ARG is a list of coding categories ordered by priority. - -This function is provided for backward compatibility." - (declare (obsolete set-coding-system-priority "23.1")) - (apply 'set-coding-system-priority - (mapcar #'(lambda (x) (symbol-value x)) arg))) - ;;; X selections (defvar ctext-non-standard-encodings-alist diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 44cde7cb5a..312baffb90 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -521,25 +521,6 @@ still the current message in the Rmail buffer.") (defvar rmail-mmdf-delim2 "^\001\001\001\001\n" "Regexp marking the end of an mmdf message.") -;; FIXME Post-mbox, this is now unused. -;; In Emacs-22, this was called: -;; i) the very first time a message was shown. -;; ii) when toggling the headers to the normal state, every time. -;; It's not clear what it should do now, since there is nothing that -;; records when a message is shown for the first time (unseen is not -;; necessarily the same thing). -;; See https://lists.gnu.org/r/emacs-devel/2009-03/msg00013.html -(defcustom rmail-message-filter nil - "If non-nil, a filter function for new messages in RMAIL. -Called with region narrowed to the message, including headers, -before obeying `rmail-ignored-headers'." - :group 'rmail-headers - :type '(choice (const nil) function)) - -(make-obsolete-variable 'rmail-message-filter - "it is not used (try `rmail-show-message-hook')." - "23.1") - (defcustom rmail-automatic-folder-directives nil "List of directives specifying how to automatically file messages. Whenever Rmail shows a message in the folder that `rmail-file-name' diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index d2c3f9045e..0d99f4687c 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -685,13 +685,6 @@ for use at QPOS." completions) qboundary)))) -;; (defmacro complete-in-turn (a b) `(completion-table-in-turn ,a ,b)) -;; (defmacro dynamic-completion-table (fun) `(completion-table-dynamic ,fun)) -(define-obsolete-function-alias - 'complete-in-turn #'completion-table-in-turn "23.1") -(define-obsolete-function-alias - 'dynamic-completion-table #'completion-table-dynamic "23.1") - ;;; Minibuffer completion (defgroup minibuffer nil @@ -1770,9 +1763,6 @@ It also eliminates runs of equal strings." ;; Round up to a whole number of columns. (* colwidth (ceiling length colwidth)))))))))))) -(defvar completion-common-substring nil) -(make-obsolete-variable 'completion-common-substring nil "23.1") - (defvar completion-setup-hook nil "Normal hook run at the end of setting up a completion list buffer. When this hook is run, the current buffer is the one in which the @@ -1864,11 +1854,7 @@ It can find the completion buffer in `standard-output'." (insert "Possible completions are:\n") (completion--insert-strings completions)))) - ;; The hilit used to be applied via completion-setup-hook, so there - ;; may still be some code that uses completion-common-substring. - (with-no-warnings - (let ((completion-common-substring common-substring)) - (run-hooks 'completion-setup-hook))) + (run-hooks 'completion-setup-hook) nil) (defvar completion-extra-properties nil @@ -2374,8 +2360,6 @@ The completion method is determined by `completion-at-point-functions'." Gets combined either with `minibuffer-local-completion-map' or with `minibuffer-local-must-match-map'.") -(define-obsolete-variable-alias 'minibuffer-local-must-match-filename-map - 'minibuffer-local-filename-must-match-map "23.1") (defvar minibuffer-local-filename-must-match-map (make-sparse-keymap)) (make-obsolete-variable 'minibuffer-local-filename-must-match-map nil "24.1") diff --git a/lisp/mouse.el b/lisp/mouse.el index d369545f18..a06ca2a56c 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -274,34 +274,6 @@ not it is actually displayed." local-menu minor-mode-menus))) -(defun mouse-major-mode-menu (event &optional prefix) - "Pop up a mode-specific menu of mouse commands. -Default to the Edit menu if the major mode doesn't define a menu." - (declare (obsolete mouse-menu-major-mode-map "23.1")) - (interactive "@e\nP") - (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) - (popup-menu (mouse-menu-major-mode-map) event prefix)) - -(defun mouse-popup-menubar (event prefix) - "Pop up a menu equivalent to the menu bar for keyboard EVENT with PREFIX. -The contents are the items that would be in the menu bar whether or -not it is actually displayed." - (declare (obsolete mouse-menu-bar-map "23.1")) - (interactive "@e \nP") - (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) - (popup-menu (mouse-menu-bar-map) (unless (integerp event) event) prefix)) - -(defun mouse-popup-menubar-stuff (event prefix) - "Popup a menu like either `mouse-major-mode-menu' or `mouse-popup-menubar'. -Use the former if the menu bar is showing, otherwise the latter." - (declare (obsolete nil "23.1")) - (interactive "@e\nP") - (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) - (popup-menu - (if (zerop (or (frame-parameter nil 'menu-bar-lines) 0)) - (mouse-menu-bar-map) - (mouse-menu-major-mode-map)) - event prefix)) ;; Commands that operate on windows. diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el index 1bed61f3e7..ff8a447c7c 100644 --- a/lisp/net/newst-treeview.el +++ b/lisp/net/newst-treeview.el @@ -131,14 +131,6 @@ groupcontent := feedname | groupdefinition) Example: (\"Topmost group\" \"feed1\" (\"subgroup1\" \"feed 2\") \"feed3\")") -(defcustom newsticker-groups-filename - nil - "Name of the newsticker groups settings file." - :version "25.1" ; changed default value to nil - :type '(choice (const nil) string) - :group 'newsticker-treeview) -(make-obsolete-variable 'newsticker-groups-filename 'newsticker-dir "23.1") - ;; ====================================================================== ;;; internal variables ;; ====================================================================== @@ -1265,29 +1257,9 @@ Note: does not update the layout." (defun newsticker--treeview-load () "Load treeview settings." (let* ((coding-system-for-read 'utf-8) - (filename - (or (and newsticker-groups-filename - (not (string= - (expand-file-name newsticker-groups-filename) - (expand-file-name (concat newsticker-dir "/groups")))) - (file-exists-p newsticker-groups-filename) - (y-or-n-p - (format-message - (concat "Obsolete variable `newsticker-groups-filename' " - "points to existing file \"%s\".\n" - "Read it? ") - newsticker-groups-filename)) - newsticker-groups-filename) - (concat newsticker-dir "/groups"))) + (filename (concat newsticker-dir "/groups")) (buf (and (file-exists-p filename) (find-file-noselect filename)))) - (and newsticker-groups-filename - (file-exists-p newsticker-groups-filename) - (y-or-n-p (format-message - (concat "Delete the file \"%s\",\nto which the obsolete " - "variable `newsticker-groups-filename' points ? ") - newsticker-groups-filename)) - (delete-file newsticker-groups-filename)) (when buf (set-buffer buf) (goto-char (point-min)) diff --git a/lisp/obsolete/tpu-edt.el b/lisp/obsolete/tpu-edt.el index d71f79c87b..0de7aa096d 100644 --- a/lisp/obsolete/tpu-edt.el +++ b/lisp/obsolete/tpu-edt.el @@ -287,14 +287,6 @@ ;;; ;;; User Configurable Variables ;;; -(defcustom tpu-have-ispell t - "Non-nil means `tpu-spell-check' uses `ispell-region' for spell checking. -Otherwise, use `spell-region'." - :type 'boolean - :group 'tpu) -(make-obsolete-variable 'tpu-have-ispell "the `spell' package is obsolete." - "23.1") - (defcustom tpu-kill-buffers-silently nil "If non-nil, TPU-edt kills modified buffers without asking." :type 'boolean @@ -315,7 +307,6 @@ Otherwise, use `spell-region'." ;;; Global Keymaps ;;; -(define-obsolete-variable-alias 'GOLD-map 'tpu-gold-map "23.1") (defvar tpu-gold-map (let ((map (make-keymap))) ;; Previously we used escape sequences here. We now instead presume @@ -892,8 +883,7 @@ With argument, fill and justify." if no region is selected." (interactive) (let ((m (tpu-mark))) - (apply (if tpu-have-ispell 'ispell-region - 'spell-region) + (apply 'ispell-region (if m (if (> m (point)) (list (point) m) (list m (point))) diff --git a/lisp/password-cache.el b/lisp/password-cache.el index f5007579a8..2443f374a8 100644 --- a/lisp/password-cache.el +++ b/lisp/password-cache.el @@ -94,22 +94,6 @@ The variable `password-cache' control whether the cache is used." (or (password-read-from-cache key) (read-passwd prompt))) -(defun password-read-and-add (prompt &optional key) - "Read password, for use with KEY, from user, or from cache if wanted. -Then store the password in the cache. Uses `password-read' and -`password-cache-add'. Custom variables `password-cache' and -`password-cache-expiry' regulate cache behavior. - -Warning: the password is cached without checking that it is -correct. It is better to check the password before caching. If -you must use this function, take care to check passwords and -remove incorrect ones from the cache." - (declare (obsolete password-read "23.1")) - (let ((password (password-read prompt key))) - (when (and password key) - (password-cache-add key password)) - password)) - (defun password-cache-remove (key) "Remove password indexed by KEY from password cache. This is typically run by a timer setup from `password-cache-add', diff --git a/lisp/shell.el b/lisp/shell.el index f5e18bbc72..301a8cb083 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -990,9 +990,6 @@ this feature; see the function `dirtrack-mode'." (add-hook 'comint-input-filter-functions #'shell-directory-tracker nil t) (remove-hook 'comint-input-filter-functions #'shell-directory-tracker t))) -(define-obsolete-function-alias 'shell-dirtrack-toggle #'shell-dirtrack-mode - "23.1") - (defun shell-cd (dir) "Do normal `cd' to DIR, and set `list-buffers-directory'." (cd dir) diff --git a/lisp/subr.el b/lisp/subr.el index 6bd06a0b82..8eb4cf452d 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1583,11 +1583,6 @@ be a list of the form returned by `event-start' and `event-end'." (make-obsolete 'string-as-multibyte "use `decode-coding-string'." "26.1") (make-obsolete 'string-make-multibyte "use `decode-coding-string'." "26.1") -(defun forward-point (n) - "Return buffer position N characters after (before if N negative) point." - (declare (obsolete "use (+ (point) N) instead." "23.1")) - (+ (point) n)) - (defun log10 (x) "Return (log X 10), the log base 10 of X." (declare (obsolete log "24.4")) @@ -1612,8 +1607,6 @@ be a list of the form returned by `event-start' and `event-end'." (make-obsolete 'set-window-redisplay-end-trigger nil "23.1") (make-obsolete 'run-window-configuration-change-hook nil "27.1") -(make-obsolete 'process-filter-multibyte-p nil "23.1") -(make-obsolete 'set-process-filter-multibyte nil "23.1") (make-obsolete-variable 'command-debug-status "expect it to be removed in a future version." "25.2") diff --git a/lisp/t-mouse.el b/lisp/t-mouse.el index a1af53d8c4..4feab71401 100644 --- a/lisp/t-mouse.el +++ b/lisp/t-mouse.el @@ -62,8 +62,6 @@ (gpm-mouse-stop)) (set-terminal-parameter nil 'gpm-mouse-active nil)) -;;;###autoload -(define-obsolete-function-alias 't-mouse-mode 'gpm-mouse-mode "23.1") ;;;###autoload (define-minor-mode gpm-mouse-mode "Toggle mouse support in GNU/Linux consoles (GPM Mouse mode). diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index 5901e0295e..e866fdc36c 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el @@ -78,12 +78,8 @@ (require 'dnd) (require 'w32-vars) -;; Keep an obsolete alias for w32-focus-frame and w32-select-font in case -;; they are used by code outside Emacs. -(define-obsolete-function-alias 'w32-focus-frame 'x-focus-frame "23.1") (declare-function x-select-font "w32font.c" (&optional frame exclude-proportional)) -(define-obsolete-function-alias 'w32-select-font 'x-select-font "23.1") (defvar w32-color-map) ;; defined in w32fns.c (make-obsolete 'w32-default-color-map nil "24.1") diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 65f61644b6..ffcdb9bd16 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -621,15 +621,6 @@ For Aspell, non-nil also means to try to automatically find its dictionaries. Earlier Aspell versions do not consistently support charset encoding. Handling this would require some extra guessing in `ispell-aspell-find-dictionary'.") -(defvar ispell-aspell-supports-utf8 nil - "Non-nil if Aspell has consistent command line UTF-8 support. Obsolete. -ispell.el and flyspell.el will use for this purpose the more generic -variable `ispell-encoding8-command' for both Aspell and Hunspell. Is left -here just for backwards compatibility.") - -(make-obsolete-variable 'ispell-aspell-supports-utf8 - 'ispell-encoding8-command "23.1") - (defvar ispell-dicts-name2locale-equivs-alist '(("american" "en_US") ("brasileiro" "pt_BR") diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el index 279dbb4450..7bc7dc1762 100644 --- a/lisp/textmodes/remember.el +++ b/lisp/textmodes/remember.el @@ -487,9 +487,6 @@ Most useful for remembering things from other applications." (interactive) (remember-region (point-min) (point-max))) -;; Org needs this -(define-obsolete-function-alias 'remember-buffer 'remember-finalize "23.1") - (defun remember-destroy () "Destroy the current *Remember* buffer." (interactive) diff --git a/lisp/tooltip.el b/lisp/tooltip.el index f35f6b9a03..5f5a4788b2 100644 --- a/lisp/tooltip.el +++ b/lisp/tooltip.el @@ -167,8 +167,6 @@ This variable has effect only on GUI frames." ;;; Variables that are not customizable. -(define-obsolete-variable-alias 'tooltip-hook 'tooltip-functions "23.1") - (defvar tooltip-functions nil "Functions to call to display tooltips. Each function is called with one argument EVENT which is a copy diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index 6dd7a9c2aa..0a7e7e205e 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el @@ -569,31 +569,6 @@ Has a preference for looking backward when not directly on a symbol." (setq url nil)) url))) -(defun url-generate-unique-filename (&optional fmt) - "Generate a unique filename in `url-temporary-directory'." - (declare (obsolete make-temp-file "23.1")) - ;; This variable is obsolete, but so is this function. - (let ((tempdir (with-no-warnings url-temporary-directory))) - (if (not fmt) - (let ((base (format "url-tmp.%d" (user-real-uid))) - (fname "") - (x 0)) - (setq fname (format "%s%d" base x)) - (while (file-exists-p - (expand-file-name fname tempdir)) - (setq x (1+ x) - fname (concat base (int-to-string x)))) - (expand-file-name fname tempdir)) - (let ((base (concat "url" (int-to-string (user-real-uid)))) - (fname "") - (x 0)) - (setq fname (format fmt (concat base (int-to-string x)))) - (while (file-exists-p - (expand-file-name fname tempdir)) - (setq x (1+ x) - fname (format fmt (concat base (int-to-string x))))) - (expand-file-name fname tempdir))))) - (defun url-extract-mime-headers () "Set `url-current-mime-headers' in current buffer." (save-excursion diff --git a/lisp/url/url-vars.el b/lisp/url/url-vars.el index d9277cf6f4..e35823ab9a 100644 --- a/lisp/url/url-vars.el +++ b/lisp/url/url-vars.el @@ -312,13 +312,6 @@ Applies when a protected document is denied by the server." :type 'integer :group 'url) -(defcustom url-temporary-directory (or (getenv "TMPDIR") "/tmp") - "Where temporary files go." - :type 'directory - :group 'url-file) -(make-obsolete-variable 'url-temporary-directory - 'temporary-file-directory "23.1") - (defcustom url-show-status t "Whether to show a running total of bytes transferred. Can cause a large hit if using a remote X display over a slow link, or diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index ce72a49b95..f09ceddcb3 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -505,14 +505,6 @@ If FILE is not registered, this function always returns nil." (vc-call-backend backend 'working-revision file)))))) -;; Backward compatibility. -(define-obsolete-function-alias - 'vc-workfile-version 'vc-working-revision "23.1") -(defun vc-default-working-revision (backend file) - (message - "`working-revision' not found: using the old `workfile-version' instead") - (vc-call-backend backend 'workfile-version file)) - (defun vc-default-registered (backend file) "Check if FILE is registered in BACKEND using vc-BACKEND-master-templates." (let ((sym (vc-make-backend-sym backend 'master-templates))) diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el index 092d8b5396..3c26ffc0e5 100644 --- a/lisp/vc/vc-mtn.el +++ b/lisp/vc/vc-mtn.el @@ -60,7 +60,6 @@ switches." :version "25.1" :group 'vc-mtn) -(define-obsolete-variable-alias 'vc-mtn-command 'vc-mtn-program "23.1") (defcustom vc-mtn-program "mtn" "Name of the monotone executable." :type 'string diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 65775f8e46..5561292d8c 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2709,9 +2709,6 @@ to the working revision (except for keyword expansion)." (vc-revert-file file) (message "Reverting %s...done" (vc-delistify files))))) -;;;###autoload -(define-obsolete-function-alias 'vc-revert-buffer 'vc-revert "23.1") - ;;;###autoload (defun vc-pull (&optional arg) "Update the current fileset or branch. diff --git a/lisp/vcursor.el b/lisp/vcursor.el index fa0cbb74b0..3601abcd6e 100644 --- a/lisp/vcursor.el +++ b/lisp/vcursor.el @@ -1132,9 +1132,6 @@ line is treated like ordinary characters." (vcursor-copy (if (or (= count 0) arg) (1+ count) count))) ) -(define-obsolete-function-alias - 'vcursor-toggle-vcursor-map 'vcursor-use-vcursor-map "23.1") - (defun vcursor-post-command () (and vcursor-auto-disable (not vcursor-last-command) vcursor-overlay diff --git a/src/coding.c b/src/coding.c index 071124b4ef..1d79c703a3 100644 --- a/src/coding.c +++ b/src/coding.c @@ -11829,8 +11829,7 @@ Each element is one element list of coding system name. This variable is given to `completing-read' as COLLECTION argument. Do not alter the value of this variable manually. This variable should be -updated by the functions `make-coding-system' and -`define-coding-system-alias'. */); +updated by `define-coding-system-alias'. */); Vcoding_system_alist = Qnil; DEFVAR_LISP ("coding-category-list", Vcoding_category_list, diff --git a/test/manual/etags/c-src/abbrev.c b/test/manual/etags/c-src/abbrev.c index 03b9f0e65b..44563d6046 100644 --- a/test/manual/etags/c-src/abbrev.c +++ b/test/manual/etags/c-src/abbrev.c @@ -78,9 +78,6 @@ Lisp_Object Vlast_abbrev_text; int last_abbrev_point; -/* Hook to run before expanding any abbrev. */ - -Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook; DEFUN ("make-abbrev-table", Fmake_abbrev_table, Smake_abbrev_table, 0, 0, 0, "Create a new, empty abbrev table object.") @@ -232,9 +229,6 @@ Returns the abbrev symbol, if expansion took place.") value = Qnil; - if (!NILP (Vrun_hooks)) - call1 (Vrun_hooks, Qpre_abbrev_expand_hook); - wordstart = 0; if (!(BUFFERP (Vabbrev_start_location_buffer) && XBUFFER (Vabbrev_start_location_buffer) == current_buffer)) @@ -595,14 +589,6 @@ This causes `save-some-buffers' to offer to save the abbrevs."); "*Set non-nil means expand multi-word abbrevs all caps if abbrev was so."); abbrev_all_caps = 0; - DEFVAR_LISP ("pre-abbrev-expand-hook", &Vpre_abbrev_expand_hook, - "Function or functions to be called before abbrev expansion is done.\n\ -This is the first thing that `expand-abbrev' does, and so this may change\n\ -the current abbrev table before abbrev lookup happens."); - Vpre_abbrev_expand_hook = Qnil; - Qpre_abbrev_expand_hook = intern ("pre-abbrev-expand-hook"); - staticpro (&Qpre_abbrev_expand_hook); - defsubr (&Smake_abbrev_table); defsubr (&Sclear_abbrev_table); defsubr (&Sdefine_abbrev); commit 287ae275a6564a67aab43c3cbbbf0ff20c6161e3 Author: Lars Ingebrigtsen Date: Fri Aug 14 11:49:05 2020 +0200 Revert "Preserve the face foreground in Info-fontify-node" This reverts commit 1bed252ae9109493133a0cc3e9aad9e9a5ddde37. Juri Linkov says: This patch breaks Info fontification, please revert it. Here is what I said in the message sent later with another patch at https://debbugs.gnu.org/14645#14 Using the text property `face' instead of `font-lock-face' might break something, so a better patch below removes the text properties `face info-index-match' from the Info buffer diff --git a/lisp/info.el b/lisp/info.el index c8318a3967..78f88947c7 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -4971,8 +4971,9 @@ 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) - (add-face-text-property + (put-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 @@ -5001,9 +5002,7 @@ 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) - 'append)) + res))) 'info-xref-visited 'info-xref))) (when (and not-fontified-p (memq Info-hide-note-references '(t hide)) (not (Info-index-node))) commit 9c362e293c09d4d09a33f278f806106e8b4621c3 Author: Stefan Kangas Date: Fri Aug 14 11:37:48 2020 +0200 Add test for Bug#41761 * test/lisp/simple-tests.el (simple-test-count-words-bug-41761): New test. diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el index 4adcacb279..63e504bbe1 100644 --- a/test/lisp/simple-tests.el +++ b/test/lisp/simple-tests.el @@ -38,6 +38,13 @@ ,@body (with-no-warnings (simple-test--buffer-substrings)))) + +;;; `count-words' +(ert-deftest simple-test-count-words-bug-41761 () + (with-temp-buffer + (dotimes (i 10) (insert (propertize "test " 'field (cons nil nil)))) + (should (= (count-words (point-min) (point-max)) 10)))) + ;;; `transpose-sexps' (defmacro simple-test--transpositions (&rest body) commit c560ba3036d8382c29664a355179b63501786114 Author: Daniel Koning Date: Wed Jun 10 14:42:39 2020 -0500 Don't stop at field boundaries when counting words (Bug#41761) * lisp/simple.el (count-words): Ensure that `forward-word-strictly' moves point from one field to the next during the word-counting loop. Copyright-paperwork-exempt: yes diff --git a/lisp/simple.el b/lisp/simple.el index 6f72c3b81b..1cb93c5722 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1323,7 +1323,9 @@ If called from Lisp, return the number of words between START and END, without printing any message." (interactive (list nil nil)) (cond ((not (called-interactively-p 'any)) - (let ((words 0)) + (let ((words 0) + ;; Count across field boundaries. (Bug#41761) + (inhibit-field-text-motion t)) (save-excursion (save-restriction (narrow-to-region start end) commit f3ff51288fa0370a9ea33312b188565e4f2b595e Author: Harald Jörg Date: Fri Aug 14 10:01:30 2020 +0200 cperl-mode: Highlight '{$a++ / $b}' correctly * lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): Recognize {$a++ / $b} correctly as division. (Bug#42168) * test/lisp/progmodes/cperl-mode-tests.el: New file with test verifying the fix. diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 6122caf518..2d2713a36a 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -3979,6 +3979,9 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', (and (eq (preceding-char) ?.) (eq (char-after (- (point) 2)) ?.)) (bobp)) + ;; { $a++ / $b } doesn't start a regex, nor does $a-- + (not (and (memq (preceding-char) '(?+ ?-)) + (eq (preceding-char) (char-before (1- (point)))))) ;; m|blah| ? foo : bar; (not (and (eq c ?\?) diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el new file mode 100644 index 0000000000..f39f1ba658 --- /dev/null +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -0,0 +1,50 @@ +;;; cperl-mode-tests --- Test for cperl-mode -*- lexical-binding: t -*- + +;; Copyright (C) 2020 Free Software Foundation, Inc. + +;; Author: Harald Jörg +;; Maintainer: Harald Jörg +;; Keywords: internal +;; Homepage: https://github.com/HaraldJoerg/cperl-mode + +;;; Commentary: + +;; This is a collection of tests for the fontification of CPerl-mode. + +;; Run these tests interactively: +;; (ert-run-tests-interactively '(tag :fontification)) + +;;; Code: + +(defun cperl-test-face (text regexp) + "Returns the face of the first character matched by REGEXP in TEXT." + (interactive) + (with-temp-buffer + (insert text) + (cperl-mode) + (font-lock-ensure (point-min) (point-max)) + (goto-char (point-min)) + (re-search-forward regexp) + (get-text-property (match-beginning 0) 'face))) + +(ert-deftest cperl-mode-test-bug-42168 () + "Verify that '/' is a division after ++ or --, not a regexp. +Reported in https://github.com/jrockway/cperl-mode/issues/45. +If seen as regular expression, then the slash is displayed using +font-lock-constant-face. If seen as a division, then it doesn't +have a face property." + :tags '(:fontification) + ;; The next two Perl expressions have divisions. Perl "punctuation" + ;; operators don't get a face. + (let ((code "{ $a++ / $b }")) + (should (equal (cperl-test-face code "/" ) nil))) + (let ((code "{ $a-- / $b }")) + (should (equal (cperl-test-face code "/" ) nil))) + ;; The next two Perl expressions have regular expressions. The + ;; delimiter of a RE is fontified with font-lock-constant-face. + (let ((code "{ $a+ / $b } # /")) + (should (equal (cperl-test-face code "/" ) font-lock-constant-face))) + (let ((code "{ $a- / $b } # /")) + (should (equal (cperl-test-face code "/" ) font-lock-constant-face)))) + +;;; cperl-mode-tests.el ends here