commit 96e53675eaee9f4fcfa966aab643b94608299118 (HEAD, refs/remotes/origin/master) Author: Philipp Stephani Date: Sun Mar 29 10:22:35 2020 +0200 ; * doc/lispref/internals.texi (Module Misc): Fix version diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 0c24dac777..d70c3543f2 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -2024,7 +2024,7 @@ ways. @anchor{open_channel} @deftypefun int open_channel (emacs_env *@var{env}, emacs_value @var{pipe_process}) -This function, which is available since Emacs 27, opens a channel to +This function, which is available since Emacs 28, opens a channel to an existing pipe process. @var{pipe_process} must refer to an existing pipe process created by @code{make-pipe-process}. @ref{Pipe Processes}. If successful, the return value will be a new file commit 52fab66c277cd8d83fad0bd6bda8234e102bdc02 Author: Juri Linkov Date: Sun Mar 29 02:08:05 2020 +0200 * lisp/vc/vc-dir.el (vc-dir-root): New command (bug#12492, bug#34949). * lisp/vc/vc-hooks.el (vc-menu-map): Change menu command from 'vc-dir' to 'vc-dir-root'. diff --git a/etc/NEWS b/etc/NEWS index 870d39f7ee..4b477e5def 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -111,6 +111,10 @@ details of marking the file at the end of the region. *** State changing VC operations are supported in 'dired-mode' on files (but still not on directories). +** Change Logs and VC + +*** New command 'vc-dir-root' uses the root directory without asking. + ** Gnus --- diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 38b4937e85..b760e17067 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -1286,6 +1286,16 @@ state of item at point, if any." (setq model (vc-checkout-model vc-dir-backend only-files-list)))) (list vc-dir-backend files only-files-list state model))) +;;;###autoload +(defun vc-dir-root () + "Run `vc-dir' in the repository root directory without prompt. +If the default directory of the current buffer is +not under version control, prompt for a directory." + (interactive) + (let ((root-dir (vc-root-dir))) + (if root-dir (vc-dir root-dir) + (call-interactively 'vc-dir)))) + ;;;###autoload (defun vc-dir (dir &optional backend) "Show the VC status for \"interesting\" files in and below DIR. @@ -1309,7 +1319,7 @@ These are the commands available for use in the file status buffer: ;; When you hit C-x v d in a visited VC file, ;; the *vc-dir* buffer visits the directory under its truename; ;; therefore it makes sense to always do that. - ;; Otherwise if you do C-x v d -> C-x C-f -> C-c v d + ;; Otherwise if you do C-x v d -> C-x C-f -> C-x v d ;; you may get a new *vc-dir* buffer, different from the original (file-truename (read-directory-name "VC status for directory: " (vc-root-dir) nil t diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index 345a28d3f1..2ca9d3e620 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -972,9 +972,9 @@ In the latter case, VC mode is deactivated for this buffer." (bindings--define-key map [vc-ignore] '(menu-item "Ignore File..." vc-ignore :help "Ignore a file under current version control system")) - (bindings--define-key map [vc-dir] - '(menu-item "VC Dir" vc-dir - :help "Show the VC status of files in a directory")) + (bindings--define-key map [vc-dir-root] + '(menu-item "VC Dir" vc-dir-root + :help "Show the VC status of the repository")) map)) (defalias 'vc-menu-map vc-menu-map) commit d1b8179f55da75fce313118502ba65444ee1dc98 Author: Juri Linkov Date: Sun Mar 29 01:41:29 2020 +0200 Switch to literal mode with message when regexp is too big in char-fold search * lisp/char-fold.el (char-fold-to-regexp): Don't use regexp-quote when the length of regexp reaches 5000. (Bug#40216) * lisp/isearch.el (isearch-search): On big regexp in char-fold mode gracefully fall back to literal mode, try to search again and display momentary-message about switching to literal mode. (isearch--momentary-message): Add optional arg SECONDS. diff --git a/lisp/char-fold.el b/lisp/char-fold.el index f8a303956e..5a3c20c783 100644 --- a/lisp/char-fold.el +++ b/lisp/char-fold.el @@ -370,11 +370,7 @@ from which to start." (setq i (1+ i))) (when (> spaces 0) (push (char-fold--make-space-string spaces) out)) - (let ((regexp (apply #'concat (nreverse out)))) - ;; Limited by `MAX_BUF_SIZE' in `regex-emacs.c'. - (if (> (length regexp) 5000) - (regexp-quote string) - regexp)))) + (apply #'concat (nreverse out)))) ;;; Commands provided for completeness. diff --git a/lisp/isearch.el b/lisp/isearch.el index ddf9190dc6..7625ec12b5 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2011,15 +2011,16 @@ Turning on character-folding turns off regexp mode.") (defvar isearch-message-properties minibuffer-prompt-properties "Text properties that are added to the isearch prompt.") -(defun isearch--momentary-message (string) - "Print STRING at the end of the isearch prompt for 1 second." +(defun isearch--momentary-message (string &optional seconds) + "Print STRING at the end of the isearch prompt for 1 second. +The optional argument SECONDS overrides the number of seconds." (let ((message-log-max nil)) (message "%s%s%s" (isearch-message-prefix nil isearch-nonincremental) isearch-message (apply #'propertize (format " [%s]" string) isearch-message-properties))) - (sit-for 1)) + (sit-for (or seconds 1))) (isearch-define-mode-toggle lax-whitespace " " nil "In ordinary search, toggles the value of the variable @@ -3443,7 +3444,10 @@ Optional third argument, if t, means if fail just return nil (no error). (string-match "\\`Regular expression too big" isearch-error)) (cond (isearch-regexp-function - (setq isearch-error "Too many words")) + (setq isearch-error nil) + (setq isearch-regexp-function nil) + (isearch-search-and-update) + (isearch--momentary-message "Too many words; switched to literal mode" 2)) ((and isearch-lax-whitespace search-whitespace-regexp) (setq isearch-error "Too many spaces for whitespace matching")))))) commit 4f41188a6e1eb0ce832bd74907642f30ada344d9 Author: Paul Eggert Date: Sat Mar 28 13:58:44 2020 -0700 Stop using newly-deprecated dosname Gnulib module Code is supposed to use the filename module now. * admin/merge-gnulib (GNULIB_MODULES): Replace dosname with filename. * lib/dosname.h: Remove this forwarding stub. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lib-src/emacsclient.c, src/fileio.c: Include filename.h instead of dosname.h. diff --git a/admin/merge-gnulib b/admin/merge-gnulib index 768e5051f0..99469e47aa 100755 --- a/admin/merge-gnulib +++ b/admin/merge-gnulib @@ -31,10 +31,10 @@ GNULIB_MODULES=' careadlinkat close-stream copy-file-range count-leading-zeros count-one-bits count-trailing-zeros crypto/md5-buffer crypto/sha1-buffer crypto/sha256-buffer crypto/sha512-buffer - d-type diffseq dosname double-slash-root dtoastr dtotimespec dup2 + d-type diffseq double-slash-root dtoastr dtotimespec dup2 environ execinfo explicit_bzero faccessat fchmodat fcntl fcntl-h fdopendir - filemode filevercmp flexmember fpieee fstatat fsusage fsync futimens + filemode filename filevercmp flexmember fpieee fstatat fsusage fsync futimens getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog ieee754-h ignore-value intprops largefile lstat manywarnings memmem-simple mempcpy memrchr minmax mkostemp mktime nstrftime diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 204064f187..380be95222 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -80,7 +80,7 @@ char *w32_getenv (const char *); #include #include -#include +#include #include #include #include diff --git a/lib/dosname.h b/lib/dosname.h deleted file mode 100644 index 490e0c5a7d..0000000000 --- a/lib/dosname.h +++ /dev/null @@ -1,18 +0,0 @@ -/* File names on MS-DOS/Windows systems. - - Copyright (C) 2000-2001, 2004-2006, 2009-2020 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -#include "filename.h" diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index 256bda7752..0c7c2fb2b6 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -86,7 +86,6 @@ # crypto/sha512-buffer \ # d-type \ # diffseq \ -# dosname \ # double-slash-root \ # dtoastr \ # dtotimespec \ @@ -100,6 +99,7 @@ # fcntl-h \ # fdopendir \ # filemode \ +# filename \ # filevercmp \ # flexmember \ # fpieee \ @@ -1452,15 +1452,6 @@ EXTRA_libgnu_a_SOURCES += dirfd.c endif ## end gnulib module dirfd -## begin gnulib module dosname -ifeq (,$(OMIT_GNULIB_MODULE_dosname)) - - -EXTRA_DIST += dosname.h - -endif -## end gnulib module dosname - ## begin gnulib module dtoastr ifeq (,$(OMIT_GNULIB_MODULE_dtoastr)) diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index f92222dd77..d5faa9a195 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -69,7 +69,6 @@ AC_DEFUN([gl_EARLY], # Code from module diffseq: # Code from module dirent: # Code from module dirfd: - # Code from module dosname: # Code from module double-slash-root: # Code from module dtoastr: # Code from module dtotimespec: @@ -962,7 +961,6 @@ AC_DEFUN([gl_FILE_LIST], [ lib/diffseq.h lib/dirent.in.h lib/dirfd.c - lib/dosname.h lib/dtoastr.c lib/dtotimespec.c lib/dup2.c diff --git a/src/fileio.c b/src/fileio.c index ffe79559a3..978a373d39 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -96,7 +96,7 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include +#include #include #include #include commit a775dca449ca8da2e2619ea608a3849f70fa951e Author: Paul Eggert Date: Sat Mar 28 13:50:02 2020 -0700 Update from Gnulib This incorporates: 2020-03-28 Use module 'filename' instead of module 'dosname' 2020-03-28 dosname: Redirect to 'filename' * lib/at-func.c, lib/canonicalize-lgpl.c, lib/dosname.h: Copy from Gnulib. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lib/filename.h: New file, copied from Gnulib. diff --git a/lib/at-func.c b/lib/at-func.c index 4a1c909d38..90022e0578 100644 --- a/lib/at-func.c +++ b/lib/at-func.c @@ -16,7 +16,7 @@ /* written by Jim Meyering */ -#include "dosname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */ +#include "filename.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */ #ifdef GNULIB_SUPPORT_ONLY_AT_FDCWD # include diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c index 7d3c710f10..9f99098839 100644 --- a/lib/canonicalize-lgpl.c +++ b/lib/canonicalize-lgpl.c @@ -51,7 +51,7 @@ # define __realpath realpath # include "pathmax.h" # include "malloca.h" -# include "dosname.h" +# include "filename.h" # if HAVE_GETCWD # if IN_RELOCWRAPPER /* When building the relocatable program wrapper, use the system's getcwd diff --git a/lib/dosname.h b/lib/dosname.h index 5782960094..490e0c5a7d 100644 --- a/lib/dosname.h +++ b/lib/dosname.h @@ -13,40 +13,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . + along with this program. If not, see . */ - From Paul Eggert and Jim Meyering. */ - -#ifndef _DOSNAME_H -#define _DOSNAME_H - -#if (defined _WIN32 || defined __CYGWIN__ \ - || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__) - /* This internal macro assumes ASCII, but all hosts that support drive - letters use ASCII. */ -# define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a' \ - <= 'z' - 'a') -# define FILE_SYSTEM_PREFIX_LEN(Filename) \ - (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0) -# ifndef __CYGWIN__ -# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1 -# endif -# define ISSLASH(C) ((C) == '/' || (C) == '\\') -#else -# define FILE_SYSTEM_PREFIX_LEN(Filename) 0 -# define ISSLASH(C) ((C) == '/') -#endif - -#ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE -# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0 -#endif - -#if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE -# define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)]) -# else -# define IS_ABSOLUTE_FILE_NAME(F) \ - (ISSLASH ((F)[0]) || FILE_SYSTEM_PREFIX_LEN (F) != 0) -#endif -#define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F)) - -#endif /* DOSNAME_H_ */ +#include "filename.h" diff --git a/lib/filename.h b/lib/filename.h new file mode 100644 index 0000000000..4598fb1d63 --- /dev/null +++ b/lib/filename.h @@ -0,0 +1,110 @@ +/* Basic filename support macros. + Copyright (C) 2001-2004, 2007-2020 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* From Paul Eggert and Jim Meyering. */ + +#ifndef _FILENAME_H +#define _FILENAME_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Filename support. + ISSLASH(C) tests whether C is a directory separator + character. + HAS_DEVICE(Filename) tests whether Filename contains a device + specification. + FILE_SYSTEM_PREFIX_LEN(Filename) length of the device specification + at the beginning of Filename, + index of the part consisting of + alternating components and slashes. + FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE + 1 when a non-empty device specification + can be followed by an empty or relative + part, + 0 when a non-empty device specification + must be followed by a slash, + 0 when device specification don't exist. + IS_ABSOLUTE_FILE_NAME(Filename) + tests whether Filename is independent of + any notion of "current directory". + IS_RELATIVE_FILE_NAME(Filename) + tests whether Filename may be concatenated + to a directory filename. + Note: On native Windows, OS/2, DOS, "c:" is neither an absolute nor a + relative file name! + IS_FILE_NAME_WITH_DIR(Filename) tests whether Filename contains a device + or directory specification. + */ +#if defined _WIN32 || defined __CYGWIN__ \ + || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__ + /* Native Windows, Cygwin, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') + /* Internal macro: Tests whether a character is a drive letter. */ +# define _IS_DRIVE_LETTER(C) \ + (((C) >= 'A' && (C) <= 'Z') || ((C) >= 'a' && (C) <= 'z')) + /* Help the compiler optimizing it. This assumes ASCII. */ +# undef _IS_DRIVE_LETTER +# define _IS_DRIVE_LETTER(C) \ + (((unsigned int) (C) | ('a' - 'A')) - 'a' <= 'z' - 'a') +# define HAS_DEVICE(Filename) \ + (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':') +# define FILE_SYSTEM_PREFIX_LEN(Filename) (HAS_DEVICE (Filename) ? 2 : 0) +# ifdef __CYGWIN__ +# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0 +# else + /* On native Windows, OS/2, DOS, the system has the notion of a + "current directory" on each drive. */ +# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1 +# endif +# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE +# define IS_ABSOLUTE_FILE_NAME(Filename) \ + ISSLASH ((Filename)[FILE_SYSTEM_PREFIX_LEN (Filename)]) +# else +# define IS_ABSOLUTE_FILE_NAME(Filename) \ + (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename)) +# endif +# define IS_RELATIVE_FILE_NAME(Filename) \ + (! (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename))) +# define IS_FILE_NAME_WITH_DIR(Filename) \ + (strchr ((Filename), '/') != NULL || strchr ((Filename), '\\') != NULL \ + || HAS_DEVICE (Filename)) +#else + /* Unix */ +# define ISSLASH(C) ((C) == '/') +# define HAS_DEVICE(Filename) ((void) (Filename), 0) +# define FILE_SYSTEM_PREFIX_LEN(Filename) ((void) (Filename), 0) +# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0 +# define IS_ABSOLUTE_FILE_NAME(Filename) ISSLASH ((Filename)[0]) +# define IS_RELATIVE_FILE_NAME(Filename) (! ISSLASH ((Filename)[0])) +# define IS_FILE_NAME_WITH_DIR(Filename) (strchr ((Filename), '/') != NULL) +#endif + +/* Deprecated macros. For backward compatibility with old users of the + 'filename' module. */ +#define IS_ABSOLUTE_PATH IS_ABSOLUTE_FILE_NAME +#define IS_PATH_WITH_DIR IS_FILE_NAME_WITH_DIR + + +#ifdef __cplusplus +} +#endif + +#endif /* _FILENAME_H */ diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index e90d2e3904..256bda7752 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -1672,6 +1672,15 @@ EXTRA_DIST += filemode.h endif ## end gnulib module filemode +## begin gnulib module filename +ifeq (,$(OMIT_GNULIB_MODULE_filename)) + + +EXTRA_DIST += filename.h + +endif +## end gnulib module filename + ## begin gnulib module filevercmp ifeq (,$(OMIT_GNULIB_MODULE_filevercmp)) diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 3228aa42b5..f92222dd77 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -87,6 +87,7 @@ AC_DEFUN([gl_EARLY], # Code from module fcntl-h: # Code from module fdopendir: # Code from module filemode: + # Code from module filename: # Code from module filevercmp: # Code from module flexmember: # Code from module fpending: @@ -977,6 +978,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/fdopendir.c lib/filemode.c lib/filemode.h + lib/filename.h lib/filevercmp.c lib/filevercmp.h lib/flexmember.h commit dceba13ce57ed0cb726e89566197f77359a38d91 Author: Stefan Monnier Date: Sat Mar 28 10:16:58 2020 -0400 * lisp/jit-lock.el (jit-lock-mode): Pass `local` to add-hook The old code used local=nil knowing that add-hook would affect the local part only anyway. Remove this hideous assumption. Remove redundant `:group` args while we're at it. diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el index d73cd74da0..9cdb108be0 100644 --- a/lisp/jit-lock.el +++ b/lisp/jit-lock.el @@ -48,8 +48,7 @@ Preserves the `buffer-modified-p' state of the current buffer." "Jit-lock fontifies chunks of at most this many characters at a time. This variable controls both display-time and stealth fontification." - :type 'integer - :group 'jit-lock) + :type 'integer) (defcustom jit-lock-stealth-time nil @@ -59,8 +58,7 @@ If nil, stealth fontification is never performed. The value of this variable is used when JIT Lock mode is turned on." :type '(choice (const :tag "never" nil) - (number :tag "seconds" :value 16)) - :group 'jit-lock) + (number :tag "seconds" :value 16))) (defcustom jit-lock-stealth-nice 0.5 @@ -72,8 +70,7 @@ To reduce machine load during stealth fontification, at the cost of stealth taking longer to fontify, you could increase the value of this variable. See also `jit-lock-stealth-load'." :type '(choice (const :tag "never" nil) - (number :tag "seconds")) - :group 'jit-lock) + (number :tag "seconds"))) (defcustom jit-lock-stealth-load @@ -89,14 +86,12 @@ See also `jit-lock-stealth-nice'." :type (if (condition-case nil (load-average) (error)) '(choice (const :tag "never" nil) (integer :tag "load")) - '(const :format "%t: unsupported\n" nil)) - :group 'jit-lock) + '(const :format "%t: unsupported\n" nil))) (defcustom jit-lock-stealth-verbose nil "If non-nil, means stealth fontification should show status messages." - :type 'boolean - :group 'jit-lock) + :type 'boolean) (defvaralias 'jit-lock-defer-contextually 'jit-lock-contextually) @@ -115,13 +110,11 @@ buffer mode's syntax table, i.e., only if `font-lock-keywords-only' is nil. The value of this variable is used when JIT Lock mode is turned on." :type '(choice (const :tag "never" nil) (const :tag "always" t) - (other :tag "syntax-driven" syntax-driven)) - :group 'jit-lock) + (other :tag "syntax-driven" syntax-driven))) (defcustom jit-lock-context-time 0.5 "Idle time after which text is contextually refontified, if applicable." - :type '(number :tag "seconds") - :group 'jit-lock) + :type '(number :tag "seconds")) (defcustom jit-lock-antiblink-grace 2 "Delay after which to refontify unterminated strings and comments. @@ -134,14 +127,12 @@ and comments, the delay helps avoid unpleasant \"blinking\", between string/comment and non-string/non-comment fontification." :type '(choice (const :tag "never" nil) (number :tag "seconds")) - :group 'jit-lock :version "27.1") (defcustom jit-lock-defer-time nil ;; 0.25 "Idle time after which deferred fontification should take place. If nil, fontification is not deferred. If 0, then fontification is only deferred while there is input pending." - :group 'jit-lock :type '(choice (const :tag "never" nil) (number :tag "seconds"))) @@ -262,7 +253,7 @@ If you need to debug code run from jit-lock, see `jit-lock-debug-mode'." ;; Setup our hooks. (add-hook 'after-change-functions 'jit-lock-after-change nil t) - (add-hook 'fontification-functions 'jit-lock-function)) + (add-hook 'fontification-functions 'jit-lock-function nil t)) ;; Turn Just-in-time Lock mode off. (t @@ -294,7 +285,7 @@ If you need to debug code run from jit-lock, see `jit-lock-debug-mode'." When this minor mode is enabled, jit-lock runs as little code as possible during redisplay and moves the rest to a timer, where things like `debug-on-error' and Edebug can be used." - :global t :group 'jit-lock + :global t (when jit-lock-defer-timer (cancel-timer jit-lock-defer-timer) (setq jit-lock-defer-timer nil)) @@ -438,8 +429,8 @@ Defaults to the whole buffer. END can be out of bounds." (quit (put-text-property start next 'fontified nil) (signal (car err) (cdr err)))))) - ;; In case we fontified more than requested, take advantage of the - ;; good news. + ;; In case we fontified more than requested, take + ;; advantage of the good news. (when (or (< tight-beg start) (> tight-end next)) (put-text-property tight-beg tight-end 'fontified t)) commit a7e3516571e72e58bb4b5d19eca5feca41135f57 Author: Stefan Monnier Date: Sat Mar 28 09:41:15 2020 -0400 * lisp/progmodes/ebrowse.el (ebrowse-tags-loop-call): Rename Used to be called `ebrowse-tags-loop-form` and passed to `eval`. Now it's passed to `apply` instead, which is better for karma. (ebrowse-tags-loop-continue, ebrowse-tags-search) (ebrowse-tags-query-replace, ebrowse-tags-search-member-use): Adjust accordingly. (ebrowse-electric-position-mode-map): Move init into declaration. (ebrowse-electric-position-mode): Derive from special. diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el index c02703fc59..1c9e805f03 100644 --- a/lisp/progmodes/ebrowse.el +++ b/lisp/progmodes/ebrowse.el @@ -3543,9 +3543,9 @@ completion." ;;; Tags query replace & search -(defvar ebrowse-tags-loop-form () - "Form for `ebrowse-loop-continue'. -Evaluated for each file in the tree. If it returns nil, proceed +(defvar ebrowse-tags-loop-call '(ignore) + "Function call for `ebrowse-loop-continue'. +Passed to `apply' for each file in the tree. If it returns nil, proceed with the next file.") (defvar ebrowse-tags-next-file-list () @@ -3612,7 +3612,7 @@ TREE-BUFFER if indirectly specifies which files to loop over." (when first-time (ebrowse-tags-next-file first-time tree-buffer) (goto-char (point-min))) - (while (not (eval ebrowse-tags-loop-form)) + (while (not (apply ebrowse-tags-loop-call)) (ebrowse-tags-next-file) (message "Scanning file `%s'..." buffer-file-name) (goto-char (point-min)))) @@ -3625,9 +3625,9 @@ If marked classes exist, process marked classes, only. If regular expression is nil, repeat last search." (interactive "sTree search (regexp): ") (if (and (string= regexp "") - (eq (car ebrowse-tags-loop-form) 're-search-forward)) + (eq (car ebrowse-tags-loop-call) #'re-search-forward)) (ebrowse-tags-loop-continue) - (setq ebrowse-tags-loop-form (list 're-search-forward regexp nil t)) + (setq ebrowse-tags-loop-call `(re-search-forward ,regexp nil t)) (ebrowse-tags-loop-continue 'first-time))) @@ -3637,10 +3637,11 @@ If regular expression is nil, repeat last search." With prefix arg, process files of marked classes only." (interactive "sTree query replace (regexp): \nsTree query replace %s by: ") - (setq ebrowse-tags-loop-form - (list 'and (list 'save-excursion - (list 're-search-forward from nil t)) - (list 'not (list 'perform-replace from to t t nil)))) + (setq ebrowse-tags-loop-call + (list (lambda () + (and (save-excursion + (re-search-forward from nil t)) + (not (perform-replace from to t t nil)))))) (ebrowse-tags-loop-continue 'first-time)) @@ -3665,7 +3666,7 @@ looks like a function call to the member." (cl-values-list (ebrowse-tags-read-name header "Find calls of: ")))) ;; Set tags loop form to search for member and begin loop. (setq regexp (concat "\\<" name "[ \t]*(") - ebrowse-tags-loop-form (list 're-search-forward regexp nil t)) + ebrowse-tags-loop-call `(re-search-forward ,regexp nil t)) (ebrowse-tags-loop-continue 'first-time tree-buffer)))) @@ -3767,18 +3768,10 @@ Prefix arg ARG says how much." ;;; Electric position list -(defvar ebrowse-electric-position-mode-map () - "Keymap used in electric position stack window.") - - -(defvar ebrowse-electric-position-mode-hook nil - "If non-nil, its value is called by `ebrowse-electric-position-mode'.") - - -(unless ebrowse-electric-position-mode-map +(defvar ebrowse-electric-position-mode-map (let ((map (make-keymap)) (submap (make-keymap))) - (setq ebrowse-electric-position-mode-map map) + ;; FIXME: Yuck! (fillarray (car (cdr map)) 'ebrowse-electric-position-undefined) (fillarray (car (cdr submap)) 'ebrowse-electric-position-undefined) (define-key map "\e" submap) @@ -3801,14 +3794,19 @@ Prefix arg ARG says how much." (define-key map "\e\C-v" 'scroll-other-window) (define-key map "\e>" 'end-of-buffer) (define-key map "\e<" 'beginning-of-buffer) - (define-key map "\e>" 'end-of-buffer))) + (define-key map "\e>" 'end-of-buffer) + map) + "Keymap used in electric position stack window.") + + +(defvar ebrowse-electric-position-mode-hook nil + "If non-nil, its value is called by `ebrowse-electric-position-mode'.") -(put 'ebrowse-electric-position-mode 'mode-class 'special) (put 'ebrowse-electric-position-undefined 'suppress-keymap t) (define-derived-mode ebrowse-electric-position-mode - fundamental-mode "Electric Position Menu" + special-mode "Electric Position Menu" "Mode for electric position buffers. Runs the hook `ebrowse-electric-position-mode-hook'." (setq mode-line-buffer-identification "Electric Position Menu") commit dfeb87d8e54ee5f2ce3e16d34a812131bb2f6e4d Author: Mattias EngdegÄrd Date: Thu Mar 26 10:58:30 2020 +0100 Turn compilation-error-case-fold-search into a defvar See bug#40119, and the discussion at https://lists.gnu.org/archive/html/emacs-devel/2020-03/msg00653.html * lisp/progmodes/compile.el (compilation-error-case-fold-search): Turn into a defvar. * etc/NEWS: Update. diff --git a/etc/NEWS b/etc/NEWS index 49b7fcd8c2..870d39f7ee 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -218,8 +218,10 @@ Defaults to 'libravatar', with 'unicornify' and 'gravatar' as options. ** Compilation mode *** Regexp matching of messages is now case-sensitive by default. -The user option 'compilation-error-case-fold-search' can be set -for case-insensitive matching of messages. +The variable 'compilation-error-case-fold-search' can be set for +case-insensitive matching of messages when the old behaviour is +required, but the recommended solution is to use a correctly matching +regexp instead. * New Modes and Packages in Emacs 28.1 diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index f4532b7edb..e5878b28f9 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -646,13 +646,15 @@ matched file names, and weeding out false positives." :link `(file-link :tag "example file" ,(expand-file-name "compilation.txt" data-directory))) -(defcustom compilation-error-case-fold-search nil +(defvar compilation-error-case-fold-search nil "If non-nil, use case-insensitive matching of compilation errors by the regexps of `compilation-error-regexp-alist' and `compilation-error-regexp-alist-alist'. -If nil, matching is case-sensitive." - :type 'boolean - :version "28.1") +If nil, matching is case-sensitive. + +This variable should only be set for backward compatibility as a temporary +measure. The proper solution is to use a regexp that matches the +messages without case-folding.") ;;;###autoload(put 'compilation-directory 'safe-local-variable 'stringp) (defvar compilation-directory nil commit e6c6486ee0b4e50c61c062f475bbe473cfd397f9 Author: Michael Albinus Date: Sat Mar 28 12:59:03 2020 +0100 Tramp cache fixes * lisp/net/tramp-adb.el (tramp-adb-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-write-region): Flush the cache after the file has been written. diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index bfeaebac2c..4512179eb1 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -629,9 +629,6 @@ But handle the case, if the \"test\" command is not available." (format "File %s exists; overwrite anyway? " filename))))) (tramp-error v 'file-already-exists filename)) - ;; We must also flush the cache of the directory, because - ;; `file-attributes' reads the values from there. - (tramp-flush-file-properties v localname) (let* ((curbuf (current-buffer)) (tmpfile (tramp-compat-make-temp-file filename))) (when (and append (file-exists-p filename)) @@ -648,6 +645,10 @@ But handle the case, if the \"test\" command is not available." (tramp-error v 'file-error "Cannot write: `%s'" filename)) (delete-file tmpfile))) + ;; We must also flush the cache of the directory, because + ;; `file-attributes' reads the values from there. + (tramp-flush-file-properties v localname) + (unless (equal curbuf (current-buffer)) (tramp-error v 'file-error diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index effac333da..100ddfaa68 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -1557,9 +1557,6 @@ errors for shares like \"C$/\", which are common in Microsoft Windows." (format "File %s exists; overwrite anyway? " filename))))) (tramp-error v 'file-already-exists filename)) - ;; We must also flush the cache of the directory, because - ;; `file-attributes' reads the values from there. - (tramp-flush-file-properties v localname) (let ((curbuf (current-buffer)) (tmpfile (tramp-compat-make-temp-file filename))) (when (and append (file-exists-p filename)) @@ -1579,6 +1576,10 @@ errors for shares like \"C$/\", which are common in Microsoft Windows." (tramp-error v 'file-error "Cannot write `%s'" filename)) (delete-file tmpfile))) + ;; We must also flush the cache of the directory, because + ;; `file-attributes' reads the values from there. + (tramp-flush-file-properties v localname) + (unless (equal curbuf (current-buffer)) (tramp-error v 'file-error