From ff330530123a9e3f6fbb2d0fe52564e4e3d78369 Mon Sep 17 00:00:00 2001 From: Simen Heggestøyl Date: Fri, 13 Oct 2017 21:48:12 +0200 Subject: Fix indentation bug in multi-line CSS selectors * lisp/textmodes/css-mode.el (css--colon-inside-selector-p): Fix indentation of multi-line CSS selectors that include both a pseudo-class and parenthesis. * test/manual/indent/css-mode.css: Add test for the above change. --- lisp/textmodes/css-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 9022ab7c3fb..39885c10860 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -1149,7 +1149,7 @@ This function is intended to be good enough to help SMIE during tokenization, but should not be regarded as a reliable function for determining whether point is within a selector." (save-excursion - (re-search-forward "[{};)]" nil t) + (re-search-forward "[{};]" nil t) (eq (char-before) ?\{))) (defun css--colon-inside-funcall () -- cgit v1.2.3 From 864734d112249bac120764f1564e008231ebb6e8 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 14 Oct 2017 19:18:37 -0700 Subject: ; Prefer https: to http: in GNU URLs --- ChangeLog.3 | 144 +++++++++++++++++------------------ lisp/emacs-lisp/rmc.el | 2 +- lisp/progmodes/flymake-proc.el | 2 +- lisp/progmodes/flymake.el | 2 +- test/lisp/progmodes/flymake-tests.el | 2 +- 5 files changed, 76 insertions(+), 76 deletions(-) (limited to 'lisp') diff --git a/ChangeLog.3 b/ChangeLog.3 index a49477a7207..811b6dbad76 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -425,7 +425,7 @@ Fix bug in recent styled_format change Problem reported by Kaushal Modi in: - http://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00141.html + https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00141.html * src/editfns.c (styled_format): Fix bug where USE_SAFE_ALLOCA was not always followed by SAFE_FREE. This bug was introduced in my patch 2017-09-26T23:31:57Z!eggert@cs.ucla.edu entitled "Avoid some @@ -2074,7 +2074,7 @@ * doc/emacs/maintaining.texi (VC Change Log): Mention the new binding. * doc/emacs/vc1-xtra.texi (Version Headers): Remove the association of 'C-x v h' with `vc-insert-headers'. - (http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00957.html) + (https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00957.html) 2017-09-30 Allen Li (tiny change) @@ -2648,7 +2648,7 @@ * doc/emacs/cmdargs.texi (Action Arguments): Don't mention 'find-file', as the implementation has changed. Reported by Everton J. Carpes in - http://lists.gnu.org/archive/html/help-gnu-emacs/2017-09/msg00146.html. + https://lists.gnu.org/archive/html/help-gnu-emacs/2017-09/msg00146.html. 2017-09-19 Eli Zaretskii @@ -2843,7 +2843,7 @@ * src/eval.c (push_handler_nosignal): Use CACHEABLE to work around GCC compilation warning. Suggested by Paul Eggert - in http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00492.html. + in https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00492.html. 2017-09-17 Michael Albinus @@ -3162,7 +3162,7 @@ * src/lisp.h (pI) [__MINGW32__]: Provide definition that will hopefully DTRT with both MinGW64 and mingw.org's MinGW. See - http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00171.html + https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00171.html for the details. * src/conf_post.h (PRINTF_ARCHETYPE) [MINGW_W64]: Separate definition specific to MinGW64. @@ -3198,7 +3198,7 @@ Port renameat_noreplace to openSUSE 12.3 Problem reported by M. Nomiya in: - http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00363.html + https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00363.html * src/sysdep.c (renameat_noreplace): Call renameat2 only if CYGWIN. @@ -3402,7 +3402,7 @@ * doc/misc/gnus.texi (Saving Articles): Document behavior with directory name targets (Bug#27986). Problem reported by Katsumi Yamaoka in: - http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00216.html + https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00216.html 2017-09-12 Mark Oteiza @@ -3774,7 +3774,7 @@ * configure.ac (srcdir) [mingw32]: Downcase the drive letter, to avoid warnings from find-file-noselect when making autoloads. For the details, see - http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00049.html. + https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00049.html. 2017-09-10 Mark Oteiza @@ -4006,7 +4006,7 @@ bit-shifting, to avoid compiler warnings. (w32font_text_extents): Tell GCC NGLYPHS is non-negative, to avoid a warning. For details of the warning, see - http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00093.html. + https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00093.html. * src/term.c (keys) [WINDOWSNT]: Don't define, as it is not used in that build. * src/sound.c (sound_perror): Ifdef away on WINDOWSNT, as this @@ -4093,7 +4093,7 @@ autogen.sh: omit bogus chatter if no .git Problem reported by Angelo Graziosi in: - http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00045.html + https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00045.html * autogen.sh (git_config): Do not execut 'git' if $do_git fails. 2017-09-07 Glenn Morris @@ -4112,7 +4112,7 @@ * doc/lispref/functions.texi (Mapping Functions): Fix the order of @example and @group. For the details, see - http://lists.gnu.org/archive/html/bug-texinfo/2017-09/msg00007.html. + https://lists.gnu.org/archive/html/bug-texinfo/2017-09/msg00007.html. 2017-09-06 Mark Oteiza @@ -4240,7 +4240,7 @@ Revert recent float→double Motif change Problem reported by Martin Rudalics in: - http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00014.html + https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00014.html * src/xterm.c (xm_scroll_callback, xaw_jump_callback) (x_set_toolkit_scroll_bar_thumb) (x_set_toolkit_horizontal_scroll_bar_thumb): @@ -5390,7 +5390,7 @@ * src/w32term.c (x_get_scale_factor): * src/xterm.c (x_get_scale_factor): Don't let the scale factors become less than 1. Reported by Yuri D'Elia in - http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00459.html. + https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00459.html. 2017-08-21 Sam Steingold @@ -5940,7 +5940,7 @@ Apparently Gitlab doesn’t create .git/hooks, like regular Git does. Problem reported by Ted Zlatanov in: - http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00380.html + https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00380.html * autogen.sh (git_sample_hook_src): New function. Use it to work even if .git/hooks or its samples do not exist. @@ -6209,7 +6209,7 @@ Default autogen.sh to 'all' This addresses a problem noted by RMS in: - http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00052.html + https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00052.html * autogen.sh (do_git): Set to true if this script is invoked with no arguments and there is a .git subdirectory. @@ -6689,7 +6689,7 @@ Fix some crashes on self-modifying Elisp code Prompted by a problem report by Alex in: - http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00143.html + https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00143.html * src/eval.c (For, Fprogn, Fsetq, FletX, eval_sub): Compute XCDR (x) near XCAR (x); although this doesn't fix any bugs, it is likely to run a bit faster with typical hardware caches. @@ -6976,7 +6976,7 @@ Port recent rename changes to RHEL 7 + NFS Problem reported by Ted Zlatanov in: - http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00082.html + https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00082.html * src/fileio.c (Frename_file): On RHEL 7 + NFS, renameat2 can fail with errno == EINVAL when it is not supported. So treat that case like errno == ENOSYS. Also, when ok_if_already_exists is neither @@ -7009,7 +7009,7 @@ * configure.ac (with_mailutils): Default to 'yes' if GNU Mailutils is installed. See: - http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00054.html + https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00054.html 2017-08-02 Paul Eggert @@ -8075,7 +8075,7 @@ bury-buffer to exit todo-mode. This restores the desired behavior of not immediately returning to the exited todo-mode buffer on quitting another buffer, which a dired bug fix had changed (see - http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00739.html). + https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00739.html). 2017-07-19 Tino Calancha @@ -8146,8 +8146,8 @@ Port gnutls.c to older (buggier?) GnuTLS Problem reported for GnuTLS 3.2.1 by Glenn Morris in: - http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00716.html - http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00742.html + https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00716.html + https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00742.html Although I don't see how this bug can occur with vanilla GnuTLS 3.2.1, perhaps hydra was using a modified GnuTLS. * src/gnutls.c (Fgnutls_ciphers): Don't assume GNUTLS_CIPHER_NULL @@ -8663,8 +8663,8 @@ * lisp/faces.el (line-number): Don't use a fixed-pitch font, by popular demand. For relevant discussions, see - http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00433.html - http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00445.html + https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00433.html + https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00445.html 2017-07-14 Paul Eggert @@ -10603,7 +10603,7 @@ Adjust lm-verify to accept current notices Problem reported by Mike Kupfer in: - http://lists.gnu.org/archive/html/emacs-devel/2017-06/msg00512.html + https://lists.gnu.org/archive/html/emacs-devel/2017-06/msg00512.html * lisp/emacs-lisp/lisp-mnt.el (lm-crack-copyright): Do not require later lines in a copyright notice to have more indentation than earlier lines. @@ -12009,7 +12009,7 @@ (gdb-send): Don't increment gdb-control-level if the command matches gdb-python-guile-commands-regexp and has non-empty arguments. Reported by David Boles in - http://lists.gnu.org/archive/html/emacs-devel/2017-06/msg00009.html. + https://lists.gnu.org/archive/html/emacs-devel/2017-06/msg00009.html. 2017-06-10 Eli Zaretskii @@ -12707,7 +12707,7 @@ * src/doprnt.c (doprnt): Format "%%" correctly. Problem reported by Philipp Stephani in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00901.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00901.html 2017-06-01 Paul Eggert @@ -12806,7 +12806,7 @@ * lisp/emacs-lisp/eldoc.el (eldoc--supported-p): New function. (turn-on-eldoc-mode, eldoc-mode): Use it. - (http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00865.html) + (https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00865.html) 2017-05-30 Glenn Morris @@ -13638,7 +13638,7 @@ * lisp/net/tls.el (tls-program, tls-checktrust): Remove s_client. Ref http://bugs.debian.org/766397 - http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00803.html + https://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00803.html (cherry picked from commit 6e45de6bacc508db11b15b2c8ba86aad8c0570df) @@ -14070,7 +14070,7 @@ * src/emacs-module.c (module_reset_handlerlist): Check handlerlist. Suggested by Philipp Stephani in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00521.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00521.html 2017-05-20 Paul Eggert @@ -14078,7 +14078,7 @@ * configure.ac (WERROR_CFLAGS): Omit -Wmissing-braces for Clang, to shut off a false alarm. Problem reportd by Philipp Stephani in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00521.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00521.html 2017-05-20 Noam Postavsky @@ -14150,7 +14150,7 @@ * etc/PROBLEMS: Describe problems with Microsoft Intellipoint and mouse-2 events. For the details, see - http://lists.gnu.org/archive/html/help-emacs-windows/2017-05/msg00009.html. + https://lists.gnu.org/archive/html/help-emacs-windows/2017-05/msg00009.html. 2017-05-19 Nick Helm (tiny change) @@ -14245,7 +14245,7 @@ Attempt to work around macOS vfork bug Problem reported by YAMAMOTO Mitsuharu in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00342.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00342.html This is related to the fix for Bug#26397. * src/callproc.c (call_process_cleanup, call_process) [!MSDOS]: Report internal error if wait_for_termination fails. @@ -14269,7 +14269,7 @@ Don’t compile the (DARWIN_OS_CASE_SENSITIVE_FIXME == 2) code unless DARWIN_OS_CASE_SENSITIVE_FIXME is 2. Problem reported by Philipp Stephani in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00495.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00495.html 2017-05-19 Paul Eggert @@ -14277,7 +14277,7 @@ * configure.ac (WERROR_CFLAGS): Omit -Wdouble-promotion if clang. Problem reported by Philipp Stephani in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00495.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00495.html 2017-05-19 Paul Eggert @@ -14362,7 +14362,7 @@ Avoid undefined behavior in struct sockaddr Problem noted by Philipp Stephani in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00391.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00391.html * src/conf_post.h (ATTRIBUTE_MAY_ALIAS, DECLARE_POINTER_ALIAS): New macros. * src/process.c (conv_sockaddr_to_lisp, conv_lisp_to_sockaddr) @@ -14387,7 +14387,7 @@ Work around AddressSanitizer bug with vfork Problem reported by Jim Meyering in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00246.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00246.html * src/conf_post.h (vfork) [ADDRESS_SANITIZER]: Define to fork. Unfortunately with the AddressSanitizer in Fedora 25 x86-64, the vforked child messes up the parent’s shadow memory. This is too @@ -14452,7 +14452,7 @@ multiple calls and struct literals in the last case of a switch. The old code ran afoul of GCC bug 80659, which caused an internal compiler error. Problem reported by Jim Meyering in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00182.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00182.html https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80659 2017-05-16 Paul Eggert @@ -14563,9 +14563,9 @@ * src/process.c (connect_network_socket): Use struct sockaddr_storage, not struct sockaddr_in, to store info about a socket address. Problem reported by Philipp Stephani in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00314.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00314.html This fix is based on a patch by Philipp in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00357.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00357.html 2017-05-14 Gemini Lasswell @@ -15156,7 +15156,7 @@ Compare unqualified type to Lisp_Object, to do the right thing when the expression has type ‘Lisp_Object const’. Problem reported by Eli Zaretskii in: - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00138.html + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00138.html 2017-05-06 Paul Eggert @@ -15295,7 +15295,7 @@ * lisp/emacs-lisp/cl-generic.el (cl-defmethod): Denote the edebug spec part for qualifiers as [&rest atom], per - http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00053.html. + https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00053.html. 2017-05-05 Mike Kupfer @@ -16077,7 +16077,7 @@ * lisp/net/tls.el (tls-program, tls-checktrust): Remove s_client. Ref http://bugs.debian.org/766397 - http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00803.html + https://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00803.html 2017-04-25 Glenn Morris @@ -16706,7 +16706,7 @@ * src/lisp.h (STRING_SET_CHARS): Add an assertion and commentary to prevent incorrect usage. For details, see this discussion: - http://lists.gnu.org/archive/html/emacs-devel/2017-04/msg00412.html. + https://lists.gnu.org/archive/html/emacs-devel/2017-04/msg00412.html. 2017-04-16 Eli Zaretskii @@ -18130,7 +18130,7 @@ * lisp/emacs-lisp/package.el (package-archives): Default to https for elpa.gnu.org if gnutls is available. Ref: - http://lists.gnu.org/archive/html/emacs-devel/2015-05/msg00130.html + https://lists.gnu.org/archive/html/emacs-devel/2015-05/msg00130.html 2017-04-04 Paul Eggert @@ -18369,7 +18369,7 @@ Fix bugs in simplified test dependencies Problem reported by Glenn Morris in: - http://lists.gnu.org/archive/html/emacs-devel/2017-04/msg00017.html + https://lists.gnu.org/archive/html/emacs-devel/2017-04/msg00017.html * test/Makefile.in (LOGFILES, TESTS): Omit leading "./". (TESTS): Omit unnecessary patsubst. (test_template): Redo dependency heuristic, hopefully @@ -18778,7 +18778,7 @@ Fix redisplay glitches due to recent change in redisplay_internal * src/xdisp.c (redisplay_internal): A better fix for bug#26097. - See http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00695.html + See https://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00695.html for the problems caused by the original fix. 2017-03-26 Michael Albinus @@ -18938,7 +18938,7 @@ Don’t require chown/chgrp for game installation Problem reported by Joseph Mingrone in: - http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00622.html + https://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00622.html * lib-src/Makefile.in (exp_archlibdir): Don’t fail if chown or chgrp fails with update-game-score and the game directory. Instead, expect the installer to fix this up afterwards. @@ -19072,7 +19072,7 @@ Don’t remove dependency files when configuring Problem reported by Tom Tromey in: - http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00533.html + https://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00533.html * configure.ac: Don’t remove */*.o and */deps/* when --enable-autodepend is in effect. @@ -19081,7 +19081,7 @@ Make --without-pop the default. Suggested by Angelo Graziosi in: - http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00431.html + https://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00431.html * configure.ac: Change the default from --with-pop to --without-pop. Adjust diagnostics to match. @@ -19118,7 +19118,7 @@ org-src fontify buffers" the hooks were enabled also for modifications to the original org buffer. This causes fontification errors when combined with certain packages, as reported in - http://lists.gnu.org/archive/html/emacs-orgmode/2017-03/msg00420.html. + https://lists.gnu.org/archive/html/emacs-orgmode/2017-03/msg00420.html. * lisp/org/org-src.el (org-src-font-lock-fontify-block): Reduce scope of inhibit-modification-hooks let-binding. @@ -19175,7 +19175,7 @@ Fix problem with out-of-date dependencies Problem reported by Robert Marshall in: - http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00501.html + https://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00501.html Although this problem has been with us for a while, the recent change from Automake to GNU Make exposed it again. * configure.ac (AUTO_DEPEND): When autodepending, clean out any @@ -19405,7 +19405,7 @@ Port out-of-source builds to windows-nt Problem reported by Angelo Graziosi in: - http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00431.html + https://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00431.html * lib/Makefile.in: Prepend $(srcdir) to ../nt/gnulib-cfg.mk, to handle out-of-source builds if windows-nt. @@ -20082,7 +20082,7 @@ overlay, protect against that overlay's end point being outside of the narrowed region. Reported by Filipe Silva in - http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00176.html. + https://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00176.html. 2017-03-10 Glenn Morris @@ -20221,7 +20221,7 @@ min and max should not return markers Problem reported by Glenn Morris in: - http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00147.html + https://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00147.html * src/data.c (minmax_driver): Convert any marker result to an integer, since some callers assume this. * test/src/data-tests.el (data-tests-max, data-tests-min): @@ -22803,9 +22803,9 @@ Make FOR_EACH_TAIL more like other FOR_EACH macros See comments by Stefan Monnier in: - http://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00181.html + https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00181.html and by Eli Zaretskii in: - http://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00207.html + https://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00207.html * src/fns.c (internal_equal): Do not bypass check for depth overflow when tail-recursing via a dotted list tail or an overlay plist, to avoid a rare infloop. @@ -23174,7 +23174,7 @@ * lisp/progmodes/xref.el (xref-collect-matches): Use '-E' together with '-e', as suggested by Noam Postavsky - (http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00780.html). + (https://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00780.html). 2017-02-03 Paul Eggert @@ -23301,7 +23301,7 @@ Fix quitting bug when buffers are frozen Problem noted by Eli Zaretskii in: - http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00721.html + https://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00721.html This patch also fixes some other issues in that report. * src/lisp.h (incr_rarely_quit): Remove. All callers changed to use rarely_quit directly. @@ -23319,7 +23319,7 @@ This fixes some infinite loops that cannot be quitted out of, e.g., (defun foo () (nth most-positive-fixnum '#1=(1 . #1#))) when byte-compiled and when run under X. See: - http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00577.html + https://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00577.html This also attempts to keep the performance improvements I recently added, as much as possible under the constraint that the infloops must be caught. In some cases this fixes infloop bugs recently @@ -23448,7 +23448,7 @@ * lisp/net/tramp.el (tramp-accept-process-output): Change argument list. Make it work when called inside a timer. See - . + . 2017-01-31 Eli Zaretskii @@ -23835,7 +23835,7 @@ * lisp/textmodes/reftex-vars.el (reftex-cite-format-builtin): Add \citetitle[*] to `reftex-cite-format' and bind them to keys i/I per user request - http://lists.gnu.org/archive/html/auctex/2017-01/msg00049.html. + https://lists.gnu.org/archive/html/auctex/2017-01/msg00049.html. 2017-01-27 Lars Ingebrigtsen @@ -23872,7 +23872,7 @@ * lisp/shell.el (shell-mode): Use setq-local. Set scroll-conservatively to 101 locally. See the discussion at - http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00736.html + https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00736.html for the reasons. 2017-01-27 Michael Hoffman (tiny change) @@ -24534,7 +24534,7 @@ * lisp/simple.el (region-bounds): New function. (region-noncontiguous-p): Use it. - http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00044.html + https://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00044.html 2017-01-21 Alan Mackenzie @@ -25369,7 +25369,7 @@ * lisp/textmodes/ispell.el (ispell-begin-skip-region-regexp): Protect against 'ispell-skip-region-alist' being nil. Reported by Ernest Adrogué , see - http://lists.gnu.org/archive/html/help-gnu-emacs/2017-01/msg00007.html. + https://lists.gnu.org/archive/html/help-gnu-emacs/2017-01/msg00007.html. 2017-01-06 Philipp Stephani @@ -25662,7 +25662,7 @@ Remove mistakenly-added files Problem reported by Glenn Morris in: - http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00008.html + https://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00008.html * lisp/gnus/gnus-ems.el, lisp/gnus/gnus-sync.el: * lisp/gnus/messcompat.el, lisp/nxml/nxml-glyph.el: * lisp/nxml/nxml-uchnm.el, lisp/obsolete/awk-mode.el: @@ -25982,7 +25982,7 @@ This avoids the confusion of using two different phrases "main thread" and "primary thread" internally to mean the same thing. See: - http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg01142.html + https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg01142.html * src/thread.c (main_thread): Rename from primary_thread, since the new name no longer clashes with main_thread_id and Emacs internals normally call this the "main thread". @@ -26175,7 +26175,7 @@ Simplify prog1 implementation Inspired by a suggestion from Chris Gregory in: - http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00965.html + https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00965.html On my platform, this generates exactly the same machine insns. * src/eval.c (prog_ignore): Rename from unwind_body, since it’s more general than that. All callers changed. @@ -26326,7 +26326,7 @@ This fixes a regression introduced in - http://git.savannah.gnu.org/gitweb/?p=emacs.git;a=commit;h=2c8a7e50d24daf19ea7d86f1cfeaa98a41c56085 + https://git.savannah.gnu.org/gitweb/?p=emacs.git;a=commit;h=2c8a7e50d24daf19ea7d86f1cfeaa98a41c56085 This bug was filed in @@ -26585,7 +26585,7 @@ therefore don't need to be inserted into the red-black tree, so mem_find will never find them. Reported by Daniel Colascione in - http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00817.html. + https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00817.html. 2016-12-21 Stefan Monnier @@ -26618,7 +26618,7 @@ Port dumping better to WSL Problem reported by Angelo Graziosi in: - http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00822.html + https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00822.html * src/sysdep.c (disable_address_randomization): Detect buggy platforms where 'personality' always returns 0. @@ -26967,7 +26967,7 @@ needs to be, which then causes copy_executable_and_dump_data to write beyond the requested size of the file mapping, thus relying on the OS roundup to page boundary to save us from ourselves. See - http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00642.html + https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00642.html for the details. * lib/stdio-impl.h: Revert the workaround fix of not including @@ -27501,7 +27501,7 @@ Use C99 syntax for font drivers Problem reported by Daniel Colascione in: - http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00515.html + https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00515.html * src/ftcrfont.c (ftcrfont_driver): * src/ftfont.c (ftfont_driver): * src/ftxfont.c (ftxfont_driver): diff --git a/lisp/emacs-lisp/rmc.el b/lisp/emacs-lisp/rmc.el index 57bc6d9b591..0be6971992c 100644 --- a/lisp/emacs-lisp/rmc.el +++ b/lisp/emacs-lisp/rmc.el @@ -17,7 +17,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . +;; along with GNU Emacs. If not, see . ;;; Commentary: diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el index ab60855b217..a9caef4fc8e 100644 --- a/lisp/progmodes/flymake-proc.el +++ b/lisp/progmodes/flymake-proc.el @@ -20,7 +20,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . +;; along with GNU Emacs. If not, see . ;;; Commentary: ;; diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 8c9c4b211a2..5d5f9bb75d8 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -20,7 +20,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . +;; along with GNU Emacs. If not, see . ;;; Commentary: ;; diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el index 0b29b6a9715..9f570adcc41 100644 --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el @@ -37,7 +37,7 @@ ;; ;; (defun flymake-tests--wait-for-backends () - ;; Weirdness here... http://debbugs.gnu.org/17647#25 + ;; Weirdness here... https://debbugs.gnu.org/17647#25 ;; ... meaning `sleep-for', and even ;; `accept-process-output', won't suffice as ways to get ;; process filters and sentinels to run, though they do work -- cgit v1.2.3 From a7f154688d2de911c995be9b640cee36bec66673 Mon Sep 17 00:00:00 2001 From: "Charles A. Roelli" Date: Sun, 15 Oct 2017 12:40:34 +0200 Subject: Improve customization type of 'mouse-drag-and-drop-region' * lisp/mouse.el (mouse-drag-and-drop-region): Provide a more precise customization type. --- lisp/mouse.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mouse.el b/lisp/mouse.el index 169d2632f4f..5eeee1ec52c 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -2349,7 +2349,15 @@ choose a font." If the value is a modifier, such as `control' or `shift' or `meta', then if that modifier key is pressed when dropping the region, region text is copied instead of being cut." - :type 'symbol + :type `(choice + (const :tag "Disable dragging the region" nil) + ,@(mapcar + (lambda (modifier) + `(const :tag ,(format "Enable, but copy with the %s modifier" + modifier) + modifier)) + '(alt super hyper shift control meta)) + (other :tag "Enable dragging the region" t)) :version "26.1" :group 'mouse) -- cgit v1.2.3 From f95cd5cd7006d2801948b75f7a270ea66d5579bf Mon Sep 17 00:00:00 2001 From: "K. Handa" Date: Sun, 15 Oct 2017 23:15:47 +0900 Subject: Improve customization of arabic-shaper-ZWNJ-handling. Make the effect of customizing arabic-shaper-ZWNJ-handling appear immediately. * lisp/language/misc-lang.el (arabic-shaper-ZWNJ-handling): Add :set value. * src/composite.c (Fclear_composition_cache): New function. (syms_of_composite): Defsubr it. --- lisp/language/misc-lang.el | 5 ++++- src/composite.c | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el index a63c3a21091..cbb581fd19f 100644 --- a/lisp/language/misc-lang.el +++ b/lisp/language/misc-lang.el @@ -95,7 +95,10 @@ Customizing the value takes effect when you start Emacs next time." :type '(choice (const :tag "default" nil) (const :tag "as space" as-space) - (const :tag "absorb" absorb))) + (const :tag "absorb" absorb)) + :set (lambda (sym val) + (set-default sym val) + (clear-composition-cache))) ;; Record error in arabic-change-gstring. (defvar arabic-shape-log nil) diff --git a/src/composite.c b/src/composite.c index c01e2e3b95c..1a348ddf234 100644 --- a/src/composite.c +++ b/src/composite.c @@ -686,6 +686,20 @@ composition_gstring_from_id (ptrdiff_t id) return HASH_VALUE (h, id); } +DEFUN ("clear-composition-cache", Fclear_composition_cache, + Sclear_composition_cache, 0, 0, 0, + doc: /* Internal use only. +Clear composition cache. */) + (void) +{ + Lisp_Object args[] = {QCtest, Qequal, QCsize, make_number (311)}; + gstring_hash_table = CALLMANY (Fmake_hash_table, args); + /* Fixme: We call Fclear_face_cache to force complete re-building of + display glyphs. But, it may be better to call this function from + Fclear_face_cache instead. */ + Fclear_face_cache (Qt); +} + bool composition_gstring_p (Lisp_Object gstring) { @@ -1982,4 +1996,5 @@ See also the documentation of `auto-composition-mode'. */); defsubr (&Scompose_string_internal); defsubr (&Sfind_composition_internal); defsubr (&Scomposition_get_gstring); + defsubr (&Sclear_composition_cache); } -- cgit v1.2.3 From 8eb3c01dbd2ed0bd54a18ab0a13cfc262b21b45e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 15 Oct 2017 19:36:58 +0300 Subject: * lisp/dired-aux.el (dired-create-directory): Doc fix. --- lisp/dired-aux.el | 1 + 1 file changed, 1 insertion(+) (limited to 'lisp') diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 7e2252fcf1b..03639f6b507 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1965,6 +1965,7 @@ Optional arg HOW-TO determines how to treat the target. ;;;###autoload (defun dired-create-directory (directory) "Create a directory called DIRECTORY. +Parent directories of DIRECTORY are created as needed. If DIRECTORY already exists, signal an error." (interactive (list (read-file-name "Create directory: " (dired-current-directory)))) -- cgit v1.2.3 From 616b4c59561c63b986634d666c45a73e95fac392 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Fri, 1 Sep 2017 09:38:55 -0400 Subject: Let select-frame-by-name choose any frame when called from lisp (Bug#25521) * lisp/frame.el (select-frame-by-name): Choose from the whole list of frames in the non-interactive part, if not found on the current display. --- etc/NEWS | 4 ++++ lisp/frame.el | 16 ++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'lisp') diff --git a/etc/NEWS b/etc/NEWS index 2b2aa7c0f0f..d995a3dded0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1862,6 +1862,10 @@ window's body. For details see the section "(elisp) Mouse Window Auto-selection" in the ELisp manual. +--- +*** 'select-frame-by-name' now may return a frame on another display +if it does not find a suitable one on the current display. + --- ** 'tcl-auto-fill-mode' is now declared obsolete. Its functionality can be replicated simply by setting 'comment-auto-fill-only-comments'. diff --git a/lisp/frame.el b/lisp/frame.el index f8aa5c6e523..b6c066462b0 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -892,7 +892,8 @@ Calls `suspend-emacs' if invoked from the controlling tty device, (defvar frame-name-history nil) (defun select-frame-by-name (name) - "Select the frame on the current terminal whose name is NAME and raise it. + "Select the frame whose name is NAME and raise it. +Frames on the current terminal are checked first. If there is no frame by that name, signal an error." (interactive (let* ((frame-names-alist (make-frame-names-alist)) @@ -903,11 +904,14 @@ If there is no frame by that name, signal an error." (if (= (length input) 0) (list default) (list input)))) - (let* ((frame-names-alist (make-frame-names-alist)) - (frame (cdr (assoc name frame-names-alist)))) - (if frame - (select-frame-set-input-focus frame) - (error "There is no frame named `%s'" name)))) + (select-frame-set-input-focus + ;; Prefer frames on the current display. + (or (cdr (assoc name (make-frame-names-alist))) + (catch 'done + (dolist (frame (frame-list)) + (when (equal (frame-parameter frame 'name) name) + (throw 'done frame)))) + (error "There is no frame named `%s'" name)))) ;;;; Background mode. -- cgit v1.2.3 From 5980de3727a0e80b5d70849bd2dd7054318c25d8 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 12 Oct 2017 23:25:13 -0400 Subject: Disable python native completion on w32 (Bug#28580) * lisp/progmodes/python.el (python-shell-completion-native-disabled-interpreters): For windows-nt systems, put an empty string to match interpreters. --- lisp/progmodes/python.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f79d9a47d31..895117b9ee3 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3304,8 +3304,9 @@ the full statement in the case of imports." (defcustom python-shell-completion-native-disabled-interpreters ;; PyPy's readline cannot handle some escape sequences yet. Native ;; completion was found to be non-functional for IPython (see - ;; Bug#25067). - (list "pypy" "ipython") + ;; Bug#25067). Native completion doesn't work on w32 (Bug#28580). + (if (eq system-type 'windows-nt) '("") + '("pypy" "ipython")) "List of disabled interpreters. When a match is found, native completion is disabled." :version "25.1" -- cgit v1.2.3 From 51615a808236058ac732a5eaba239874d56fdd10 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 12 Oct 2017 22:59:53 -0400 Subject: Don't remember old debugger window (Bug#17882) * lisp/emacs-lisp/debug.el (debug): Unset debugger-previous-window when `debugger-will-be-back' is nil. --- lisp/emacs-lisp/debug.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 0247179a843..6c754615b00 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -253,7 +253,9 @@ first will be printed into the backtrace buffer." ;; Unshow debugger-buffer. (quit-restore-window debugger-window debugger-bury-or-kill) ;; Restore current buffer (Bug#12502). - (set-buffer debugger-old-buffer)))) + (set-buffer debugger-old-buffer))) + ;; Forget debugger window, it won't be back (Bug#17882). + (setq debugger-previous-window nil)) ;; Restore previous state of debugger-buffer in case we were ;; in a recursive invocation of the debugger, otherwise just ;; erase the buffer and put it into fundamental mode. -- cgit v1.2.3 From de60992053a6ce21afe218e37bb377e7a5713522 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 15 Oct 2017 11:38:21 -0400 Subject: Fix ert-test finding by symbol (Bug#28849) In 2017-07-28 "* lisp/subr.el (define-symbol-prop): New function", the symbol used for ert tests in load-history was changed from `ert-deftest' to `ert--test', but a couple of other places were not updated accordingly. * lisp/emacs-lisp/ert.el (ert-find-test-other-window): Pass `ert--test' as the TYPE to `find-function-do-it'. (top-level): Use `ert--test' as the key to the `find-function-regexp-alist' entry. --- lisp/emacs-lisp/ert.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 83acbacb883..3a3979e81f0 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -1625,7 +1625,7 @@ default (if any)." (defun ert-find-test-other-window (test-name) "Find, in another window, the definition of TEST-NAME." (interactive (list (ert-read-test-name-at-point "Find test definition: "))) - (find-function-do-it test-name 'ert-deftest 'switch-to-buffer-other-window)) + (find-function-do-it test-name 'ert--test 'switch-to-buffer-other-window)) (defun ert-delete-test (test-name) "Make the test TEST-NAME unbound. @@ -2594,7 +2594,7 @@ To be used in the ERT results buffer." ;;; Actions on load/unload. -(add-to-list 'find-function-regexp-alist '(ert-deftest . ert--find-test-regexp)) +(add-to-list 'find-function-regexp-alist '(ert--test . ert--find-test-regexp)) (add-to-list 'minor-mode-alist '(ert--current-run-stats (:eval (ert--tests-running-mode-line-indicator)))) -- cgit v1.2.3 From 1ca9ae706975289aaa84cc196f7aa3ebc446713d Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Sun, 15 Oct 2017 20:21:35 -0700 Subject: Require subr-x when compiling nnimap.el * lisp/gnus/nnimap.el (require): For the when-let* macro. --- lisp/gnus/nnimap.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 6e2a735233a..297e2923ee6 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -27,7 +27,8 @@ ;;; Code: (eval-when-compile - (require 'cl)) + (require 'cl) + (require 'subr-x)) (require 'nnheader) (require 'gnus-util) -- cgit v1.2.3 From 613db8d35c3d080fd059dfc8cf668520bf6950d2 Mon Sep 17 00:00:00 2001 From: Andy Moreton Date: Mon, 16 Oct 2017 01:23:32 -0700 Subject: Don't reject PBM header whitespace unnecessarily * lisp/image.el (image-type-header-regexps): Allow two or more CRs or LFs in initial whitespace sequences. See: http://netpbm.sourceforge.net/doc/pbm.html --- lisp/image.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/image.el b/lisp/image.el index 1d0776180b2..32df508bc8d 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -34,8 +34,8 @@ (defconst image-type-header-regexps `(("\\`/[\t\n\r ]*\\*.*XPM.\\*/" . xpm) ("\\`P[1-6]\\(?:\ -\\(?:\\(?:#[^\r\n]*[\r\n]\\)?[[:space:]]\\)+\ -\\(?:\\(?:#[^\r\n]*[\r\n]\\)?[0-9]\\)+\ +\\(?:\\(?:#[^\r\n]*[\r\n]\\)*[[:space:]]\\)+\ +\\(?:\\(?:#[^\r\n]*[\r\n]\\)*[0-9]\\)+\ \\)\\{2\\}" . pbm) ("\\`GIF8[79]a" . gif) ("\\`\x89PNG\r\n\x1a\n" . png) -- cgit v1.2.3 From 16e85456e70174f1d97fc5a7cd8a199b8f0e7e70 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 16 Oct 2017 11:35:02 +0200 Subject: Fix error in tramp-smb-handle-insert-directory * lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory): Insert size information only when FULL-DIRECTORY-P is non-nil. --- lisp/net/tramp-smb.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lisp') diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 620c93828da..f35c10b58ab 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -1073,10 +1073,11 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." entries)) ;; Insert size information. - (insert - (if avail - (format "total used in directory %s available %s\n" used avail) - (format "total %s\n" used))) + (when full-directory-p + (insert + (if avail + (format "total used in directory %s available %s\n" used avail) + (format "total %s\n" used)))) ;; Print entries. (mapc -- cgit v1.2.3 From c63b344c3d5f6278a189a16099ee6310fad9fbd7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 16 Oct 2017 19:25:01 +0300 Subject: Fix range-error in image-dired.el * lisp/image-dired.el (image-dired-create-thumb-1): Avoid overflowing an Emacs integer on 32-bit hosts. (Bug#28809) --- lisp/image-dired.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/image-dired.el b/lisp/image-dired.el index f48f1a1b874..30ecc2befc7 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -748,7 +748,10 @@ Increase at own risk.") 'image-dired-cmd-create-thumbnail-program) (let* ((width (int-to-string (image-dired-thumb-size 'width))) (height (int-to-string (image-dired-thumb-size 'height))) - (modif-time (floor (float-time (nth 5 (file-attributes original-file))))) + (modif-time + (format "%.0f" + (ffloor (float-time + (nth 5 (file-attributes original-file)))))) (thumbnail-nq8-file (replace-regexp-in-string ".png\\'" "-nq8.png" thumbnail-file)) (spec -- cgit v1.2.3 From db68cefe72e5c68fa81796028a52de1b8e6480aa Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 16 Oct 2017 19:36:06 +0300 Subject: Fix errors in kmacro.el post-command-hook * lisp/kmacro.el (kmacro-step-edit-active): Initialize to nil to avoid 'void-variable' errors. (Bug#28818) * test/lisp/kmacro-tests.el (kmacro-tests-step-edit-cleans-up-hook): Now succeeds. (Bug#18708) --- lisp/kmacro.el | 2 +- test/lisp/kmacro-tests.el | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 582a58eda1c..4abc571db44 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el @@ -937,7 +937,7 @@ without repeating the prefix." ;;; Single-step editing of keyboard macros -(defvar kmacro-step-edit-active) ;; step-editing active +(defvar kmacro-step-edit-active nil) ;; step-editing active (defvar kmacro-step-edit-new-macro) ;; storage for new macro (defvar kmacro-step-edit-inserting) ;; inserting into macro (defvar kmacro-step-edit-appending) ;; append to end of macro diff --git a/test/lisp/kmacro-tests.el b/test/lisp/kmacro-tests.el index 9f3eeafe486..690d5029231 100644 --- a/test/lisp/kmacro-tests.el +++ b/test/lisp/kmacro-tests.el @@ -818,7 +818,6 @@ This is a regression for item 7 in Bug#24991." (kmacro-tests-deftest kmacro-tests-step-edit-cleans-up-hook () "Step-editing properly cleans up `post-command-hook.' (Bug #18708)" - (:expected-result :failed) (let (post-command-hook) (setq-local post-command-hook '(t)) (kmacro-tests-run-step-edit "x" -- cgit v1.2.3 From fb4200a87555c2e69cc66eea1ae9a55e8be3bbf3 Mon Sep 17 00:00:00 2001 From: Gemini Lasswell Date: Mon, 16 Oct 2017 11:09:29 -0700 Subject: Fix Edebug spec for cl-defun (bug#24255) * lisp/emacs-lisp/cl-macs.el: Modify the Edebug spec for `cl-lambda-list' to support destructuring argument lists. (cl-defun, cl-defmacro): Fix spelling errors in docstrings. * lisp/textmodes/rst.el: Remove alternate version of Edebug specs for `cl-lambda-list' and `cl-type-spec'. --- lisp/emacs-lisp/cl-macs.el | 32 +++++++++++++++++++++++--------- lisp/textmodes/rst.el | 16 ---------------- 2 files changed, 23 insertions(+), 25 deletions(-) (limited to 'lisp') diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 40eda1e0d65..e313af24975 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -193,20 +193,34 @@ The name is made by appending a number to PREFIX, default \"T\"." (&or lambda-doc cl-declarations)) (def-edebug-spec cl-lambda-list - (([&rest arg] + (([&rest cl-lambda-arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] - [&optional ["&rest" arg]] + [&optional ["&rest" cl-lambda-arg]] [&optional ["&key" [cl-&key-arg &rest cl-&key-arg] &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or (symbolp &optional def-form) symbolp]] - ))) + . [&or arg nil]))) (def-edebug-spec cl-&optional-arg - (&or (arg &optional def-form arg) arg)) + (&or (cl-lambda-arg &optional def-form arg) arg)) (def-edebug-spec cl-&key-arg - (&or ([&or (symbolp arg) arg] &optional def-form arg) arg)) + (&or ([&or (symbolp cl-lambda-arg) arg] &optional def-form arg) arg)) + +(def-edebug-spec cl-lambda-arg + (&or arg cl-lambda-list1)) + +(def-edebug-spec cl-lambda-list1 + (([&optional ["&whole" arg]] ;; only allowed at lower levels + [&rest cl-lambda-arg] + [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] + [&optional ["&rest" cl-lambda-arg]] + [&optional ["&key" cl-&key-arg &rest cl-&key-arg + &optional "&allow-other-keys"]] + [&optional ["&aux" &rest + &or (symbolp &optional def-form) symbolp]] + . [&or arg nil]))) (def-edebug-spec cl-type-spec sexp) @@ -336,8 +350,8 @@ The full form of a Common Lisp function argument list is [&key (([KEYWORD] VAR) [INITFORM [SVAR]])... [&allow-other-keys]] [&aux (VAR [INITFORM])...]) -VAR maybe be replaced recursively with an argument list for -destructing, `&whole' is supported within these sublists. If +VAR may be replaced recursively with an argument list for +destructuring, `&whole' is supported within these sublists. If SVAR, INITFORM, and KEYWORD are all omitted, then `(VAR)' may be written simply `VAR'. See the Info node `(cl)Argument Lists' for more details. @@ -430,8 +444,8 @@ The full form of a Common Lisp macro argument list is [&aux (VAR [INITFORM])...] [&environment VAR]) -VAR maybe be replaced recursively with an argument list for -destructing, `&whole' is supported within these sublists. If +VAR may be replaced recursively with an argument list for +destructuring, `&whole' is supported within these sublists. If SVAR, INITFORM, and KEYWORD are all omitted, then `(VAR)' may be written simply `VAR'. See the Info node `(cl)Argument Lists' for more details. diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 146d9b95f1a..315059e1107 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -109,22 +109,6 @@ (def-edebug-spec push (&or [form symbolp] [form gv-place])) -;; Correct wrong declaration. This still doesn't support dotted destructuring -;; though. -(def-edebug-spec cl-lambda-list - (([&rest cl-macro-arg] - [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] - [&optional ["&rest" arg]] - [&optional ["&key" [cl-&key-arg &rest cl-&key-arg] - &optional "&allow-other-keys"]] - [&optional ["&aux" &rest - &or (symbolp &optional def-form) symbolp]] - ))) - -;; Add missing declaration. -(def-edebug-spec cl-type-spec sexp) ;; This is not exactly correct but good - ;; enough. - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Support for `testcover' -- cgit v1.2.3 From 20cc68e871b8903a603aa4a89d2bc648d010781a Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 15 Oct 2017 17:09:09 -0400 Subject: Document rectangle-preview option more (Bug#27974) * lisp/rect.el (string-rectangle): * etc/NEWS.25: Mention `rectangle-preview'. --- etc/NEWS.25 | 2 ++ lisp/rect.el | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'lisp') diff --git a/etc/NEWS.25 b/etc/NEWS.25 index 5201a300e01..aac60c46887 100644 --- a/etc/NEWS.25 +++ b/etc/NEWS.25 @@ -712,7 +712,9 @@ CLOS class and slot documentation. *** Rectangle Mark mode can have corners past EOL or in the middle of a TAB. *** 'C-x C-x' in 'rectangle-mark-mode' now cycles through the four corners. + *** 'string-rectangle' provides on-the-fly preview of the result. +Customize 'rectangle-preview' to nil for the old behavior. ** New font-lock functions 'font-lock-ensure' and 'font-lock-flush'. These should be used in preference to 'font-lock-fontify-buffer' when diff --git a/lisp/rect.el b/lisp/rect.el index 12e62b6a990..a62ed95b715 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -450,6 +450,10 @@ With a prefix (or a FILL) argument, also fill too short lines." "Replace rectangle contents with STRING on each line. The length of STRING need not be the same as the rectangle width. +When called interactively and option `rectangle-preview' is +non-nil, display the result as the user enters the string into +the minibuffer. + Called from a program, takes three args; START, END and STRING." (interactive (progn -- cgit v1.2.3 From 2c3e6f1ddc90335249f1a7f56f5f7b377c873fb7 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Tue, 17 Oct 2017 16:20:08 +0900 Subject: Dont update primary selection with winner-undo * lisp/winner.el (winner-set): Dont update primary selection when select-enable-primary is non-nil (Bug#28631). Co-authored-by: Noam Postavsky --- lisp/winner.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'lisp') diff --git a/lisp/winner.el b/lisp/winner.el index 61ea4d40e7b..6bc27484a79 100644 --- a/lisp/winner.el +++ b/lisp/winner.el @@ -304,12 +304,15 @@ You may want to include buffer names such as *Help*, *Apropos*, (push win xwins))) ; delete this window ;; Restore marks - (save-current-buffer - (cl-loop for buf in buffers - for entry = (cadr (assq buf winner-point-alist)) - do (progn (set-buffer buf) - (set-mark (car entry)) - (setf (winner-active-region) (cdr entry))))) + ;; `winner-undo' shouldn't update the selection (Bug#28631) when + ;; select-enable-primary is non-nil. + (unless select-enable-primary + (save-current-buffer + (cl-loop for buf in buffers + for entry = (cadr (assq buf winner-point-alist)) + do (progn (set-buffer buf) + (set-mark (car entry)) + (setf (winner-active-region) (cdr entry)))))) ;; Delete windows, whose buffers are dead or boring. ;; Return t if this is still a possible configuration. (or (null xwins) -- cgit v1.2.3 From 5b6e59cfdb6acd7b8c02a7ce66bb9f4815876863 Mon Sep 17 00:00:00 2001 From: "İ. Göktuğ Kayaalp" Date: Tue, 10 Oct 2017 01:43:30 +0300 Subject: Implement vc-default-dir-extra-headers for vc-rcs Add a do-nothing implementation for vc-rcs to suppress the message which the default function adds to the vc-dir buffer (Bug#28570). * lisp/vc/vc-rcs.el (vc-rcs-dir-extra-headers): New function. --- lisp/vc/vc-rcs.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lisp') diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el index db1addbecd2..84ab10b14fe 100644 --- a/lisp/vc/vc-rcs.el +++ b/lisp/vc/vc-rcs.el @@ -177,6 +177,8 @@ For a description of possible values, see `vc-check-master-templates'." (push (list frel state) result)))) (funcall update-function result))) +(defun vc-rcs-dir-extra-headers (&rest _ignore)) + (defun vc-rcs-working-revision (file) "RCS-specific version of `vc-working-revision'." (or (and vc-consult-headers -- cgit v1.2.3 From b970a4a52a1c04afce4916ca2bf337e2b36d26c4 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 18 Oct 2017 10:04:40 +0200 Subject: Fix handling of `border-width' in `frameset--restore-frame' (Bug#28873) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/frameset.el (frameset--restore-frame): Don't process `border-width' parameter via ‘modify-frame-parameters’ (Bug#28873). --- lisp/frameset.el | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lisp') diff --git a/lisp/frameset.el b/lisp/frameset.el index bda21a8b8d7..d826f7fcdce 100644 --- a/lisp/frameset.el +++ b/lisp/frameset.el @@ -1035,6 +1035,12 @@ Internal use only." (frameset--initial-params filtered-cfg)))) (puthash frame :created frameset--action-map)) + ;; Remove `border-width' from the list of parameters. If it has not + ;; been assigned via `make-frame-on-display', any attempt to assign + ;; it now via `modify-frame-parameters' may result in an error on X + ;; (Bug#28873). + (setq filtered-cfg (assq-delete-all 'border-width filtered-cfg)) + ;; Try to assign parent-frame right here - it will improve things ;; for minibuffer-less child frames. (let* ((frame-id (frame-parameter frame 'frameset--parent-frame)) -- cgit v1.2.3 From b8433b0954b26d4620a3154be025fb8a49a73954 Mon Sep 17 00:00:00 2001 From: Bastian Beischer Date: Thu, 19 Oct 2017 02:44:46 +0300 Subject: Use pop-to-buffer-same-window instead of switch-to-buffer * lisp/cedet/semantic/decorate/include.el (semantic-decoration-include-visit): Use pop-to-buffer-same-window instead of switch-to-buffer (bug#28645). * lisp/cedet/semantic/analyze/refs.el (semantic-analyze-proto-impl-toggle): Same. * lisp/cedet/semantic/senator.el (senator-go-to-up-reference): Same. * lisp/cedet/semantic/mru-bookmark.el (semantic-mrub-visit): Same. * lisp/cedet/semantic/complete.el (semantic-complete-jump): Same. Copyright-paperwork-exempt: yes --- lisp/cedet/semantic/analyze/refs.el | 2 +- lisp/cedet/semantic/complete.el | 2 +- lisp/cedet/semantic/decorate/include.el | 2 +- lisp/cedet/semantic/mru-bookmark.el | 2 +- lisp/cedet/semantic/senator.el | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'lisp') diff --git a/lisp/cedet/semantic/analyze/refs.el b/lisp/cedet/semantic/analyze/refs.el index 55fcd830433..a58479f5054 100644 --- a/lisp/cedet/semantic/analyze/refs.el +++ b/lisp/cedet/semantic/analyze/refs.el @@ -348,7 +348,7 @@ Only works for tags in the global namespace." (push-mark) (semantic-go-to-tag target) - (switch-to-buffer (current-buffer)) + (pop-to-buffer-same-windown (current-buffer)) (semantic-momentary-highlight-tag target)) ) diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el index ff8e61e54dc..325ca1f4414 100644 --- a/lisp/cedet/semantic/complete.el +++ b/lisp/cedet/semantic/complete.el @@ -2120,7 +2120,7 @@ completion works." (when (semantic-tag-p tag) (push-mark) (semantic-go-to-tag tag) - (switch-to-buffer (current-buffer)) + (pop-to-buffer-same-window (current-buffer)) (semantic-momentary-highlight-tag tag) (message "%S: %s " (semantic-tag-class tag) diff --git a/lisp/cedet/semantic/decorate/include.el b/lisp/cedet/semantic/decorate/include.el index 6876e5f3a46..9f1825d4208 100644 --- a/lisp/cedet/semantic/decorate/include.el +++ b/lisp/cedet/semantic/decorate/include.el @@ -467,7 +467,7 @@ its contents. (error "Could not location include %s" (semantic-tag-name tag))) ((get-file-buffer file) - (switch-to-buffer (get-file-buffer file))) + (pop-to-buffer-same-window (get-file-buffer file))) ((stringp file) (find-file file)) )))) diff --git a/lisp/cedet/semantic/mru-bookmark.el b/lisp/cedet/semantic/mru-bookmark.el index 5fa58e08ea6..24863de01b1 100644 --- a/lisp/cedet/semantic/mru-bookmark.el +++ b/lisp/cedet/semantic/mru-bookmark.el @@ -113,7 +113,7 @@ Uses `semantic-go-to-tag' and highlighting." (forward-char o)) (error nil)) ;; make it visible - (switch-to-buffer (current-buffer)) + (pop-to-buffer-same-window (current-buffer)) (semantic-momentary-highlight-tag tag) )) diff --git a/lisp/cedet/semantic/senator.el b/lisp/cedet/semantic/senator.el index e86658628b5..70e04475ab2 100644 --- a/lisp/cedet/semantic/senator.el +++ b/lisp/cedet/semantic/senator.el @@ -530,11 +530,11 @@ Some tags such as includes have other reference features." ;; A tag ((semantic-tag-p result) (semantic-go-to-tag result) - (switch-to-buffer (current-buffer)) + (pop-to-buffer-same-window (current-buffer)) (semantic-momentary-highlight-tag result)) ;; Buffers ((bufferp result) - (switch-to-buffer result) + (pop-to-buffer-same-window result) (pulse-momentary-highlight-one-line (point))) ;; Files ((and (stringp result) (file-exists-p result)) -- cgit v1.2.3 From 6f1dea5c74057707bf367f863a8be5750bbb6094 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 18 Oct 2017 18:43:00 -0700 Subject: Spelling fixes * lisp/cedet/semantic/analyze/refs.el: (semantic-analyze-proto-impl-toggle): Fix recently-introduced misspelling of pop-to-buffer-same-window. --- ChangeLog.3 | 6 +++--- doc/misc/flymake.texi | 4 ++-- lib-src/ChangeLog.1 | 2 +- lisp/cedet/semantic/analyze/refs.el | 2 +- msdos/sedlibmk.inp | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lisp') diff --git a/ChangeLog.3 b/ChangeLog.3 index 811b6dbad76..2d7f3bbf3a2 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -926,7 +926,7 @@ constrained to call REPORT-FN exactly once. It may do so any number of times, cumulatively reporting diagnostics. Flymake keeps track of outdated REPORT-FN instances and disconsiders obsolete reports. - Backends should avoid reporting obsolete data by cancelling any + Backends should avoid reporting obsolete data by canceling any ongoing processing at every renewed call to the backend function. Consolidated flymake.el internal data structures to require less @@ -18314,7 +18314,7 @@ Throw a `search-failed' derived error in Info search - The original fix for Bug#6106 switched from signalling `search-failed' + The original fix for Bug#6106 switched from signaling `search-failed' to `user-error'. However, this breaks incremental searching over multiple nodes because the isearch code doesn't expect a `user-error'. @@ -28599,7 +28599,7 @@ http://trac.common-lisp.net/bordeaux-threads/wiki/ApiDocumentation ... but not identically. In particular I chose not to implement - interrupt-thread or destroy-thread, but instead a thread-signalling + interrupt-thread or destroy-thread, but instead a thread-signaling approach. I'm still undecided about *default-special-bindings* (which I did not diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index 05d879d8f4b..99ab1271ac9 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi @@ -560,7 +560,7 @@ Binding,,, elisp, The Emacs Lisp Reference Manual}) to be active. (defun ruby-flymake (report-fn &rest _args) ;; Not having a ruby interpreter is a serious problem which should cause - ;; the backend to disable itself, so an @code{error} is signalled. + ;; the backend to disable itself, so an @code{error} is signaled. ;; (unless (executable-find "ruby") (error "Cannot find a suitable ruby")) @@ -625,7 +625,7 @@ Binding,,, elisp, The Emacs Lisp Reference Manual}) to be active. msg) into diags finally (funcall report-fn diags))) - (flymake-log :warning "Cancelling obsolete check %s" + (flymake-log :warning "Canceling obsolete check %s" proc)) ;; Cleanup the temporary buffer used to hold the ;; check's output. diff --git a/lib-src/ChangeLog.1 b/lib-src/ChangeLog.1 index 4b5422e712c..5a370035d70 100644 --- a/lib-src/ChangeLog.1 +++ b/lib-src/ChangeLog.1 @@ -5643,7 +5643,7 @@ 1998-04-06 Andreas Schwab Silence -Wimplicit: - * movemail.c: Move cancelations up. Include if + * movemail.c: Move cancellations up. Include if available. * fakemail.c (_XOPEN_SOURCE): Define for declaration of cuserid. (parse_header): Explicitly declare return type. diff --git a/lisp/cedet/semantic/analyze/refs.el b/lisp/cedet/semantic/analyze/refs.el index a58479f5054..6ebf130d305 100644 --- a/lisp/cedet/semantic/analyze/refs.el +++ b/lisp/cedet/semantic/analyze/refs.el @@ -348,7 +348,7 @@ Only works for tags in the global namespace." (push-mark) (semantic-go-to-tag target) - (pop-to-buffer-same-windown (current-buffer)) + (pop-to-buffer-same-window (current-buffer)) (semantic-momentary-highlight-tag target)) ) diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp index 30776b46d7e..27072e25a6c 100644 --- a/msdos/sedlibmk.inp +++ b/msdos/sedlibmk.inp @@ -45,7 +45,7 @@ # ifneq (,$(GL_GENERATE_xxxx_H)) # Depending on whether DJGPP uses the corresponding header, these # should be edited either to 1 (thus exposing the recipe) or -# to notyhing, which makes Make bypass the recipe away. Example: +# to nothing, which makes Make bypass the recipe away. Example: # # s/^@GL_GENERATE_STDBOOL_H@/1/ # s/^@GL_GENERATE_STDINT_H@// -- cgit v1.2.3 From 25f83fa7c527f318b6e53c8a9ae32bdc629b32c2 Mon Sep 17 00:00:00 2001 From: Bastian Beischer Date: Thu, 19 Oct 2017 13:03:11 +0300 Subject: ; Indentation fixes --- lisp/cedet/semantic/decorate/include.el | 2 +- lisp/cedet/semantic/senator.el | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp') diff --git a/lisp/cedet/semantic/decorate/include.el b/lisp/cedet/semantic/decorate/include.el index 9f1825d4208..975ba343469 100644 --- a/lisp/cedet/semantic/decorate/include.el +++ b/lisp/cedet/semantic/decorate/include.el @@ -467,7 +467,7 @@ its contents. (error "Could not location include %s" (semantic-tag-name tag))) ((get-file-buffer file) - (pop-to-buffer-same-window (get-file-buffer file))) + (pop-to-buffer-same-window (get-file-buffer file))) ((stringp file) (find-file file)) )))) diff --git a/lisp/cedet/semantic/senator.el b/lisp/cedet/semantic/senator.el index 70e04475ab2..ea796dd19f9 100644 --- a/lisp/cedet/semantic/senator.el +++ b/lisp/cedet/semantic/senator.el @@ -530,11 +530,11 @@ Some tags such as includes have other reference features." ;; A tag ((semantic-tag-p result) (semantic-go-to-tag result) - (pop-to-buffer-same-window (current-buffer)) + (pop-to-buffer-same-window (current-buffer)) (semantic-momentary-highlight-tag result)) ;; Buffers ((bufferp result) - (pop-to-buffer-same-window result) + (pop-to-buffer-same-window result) (pulse-momentary-highlight-one-line (point))) ;; Files ((and (stringp result) (file-exists-p result)) -- cgit v1.2.3 From 234b1e3864b8b940f72f3727fe7087cf7e90b43d Mon Sep 17 00:00:00 2001 From: João Távora Date: Fri, 20 Oct 2017 00:50:34 +0100 Subject: Flymake backends must check proc obsoleteness in source buffer Flymake backends that rely on sentinels running asynchronously and checking buffer-local variables that hold running processes should check for obsoleteness in the correct buffers, otherwise a (harmless) warning might be triggered. * doc/misc/flymake.texi (An annotated example backend): Check buffer-local proc in the current buffer. * lisp/progmodes/elisp-mode.el (elisp-flymake-byte-compile): Check buffer-local proc in the current buffer. --- doc/misc/flymake.texi | 2 +- lisp/progmodes/elisp-mode.el | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index 99ab1271ac9..2aabaf06b73 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi @@ -600,7 +600,7 @@ Binding,,, elisp, The Emacs Lisp Reference Manual}) to be active. ;; `ruby--flymake-proc', which indicates that ;; `proc' is not an obsolete process. ;; - (if (eq proc ruby--flymake-proc) + (if (with-current-buffer source (eq proc ruby--flymake-proc)) (with-current-buffer (process-buffer proc) (goto-char (point-min)) ;; Parse the output buffer for diagnostic's diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 99a4841e318..41415943a58 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -1693,7 +1693,8 @@ current buffer state and calls REPORT-FN when done." (when (eq (process-status proc) 'exit) (unwind-protect (cond - ((not (eq proc elisp-flymake--byte-compile-process)) + ((not (eq proc (with-current-buffer source-buffer + elisp-flymake--byte-compile-process))) (flymake-log :warning "byte-compile process %s obsolete" proc)) ((zerop (process-exit-status proc)) (elisp-flymake--byte-compile-done report-fn -- cgit v1.2.3 From ddd547fada112c603dae7a204fa0b141429f1927 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 19 Oct 2017 20:05:48 -0400 Subject: Improve treatment of Fortran's "class default" * lisp/progmodes/f90.el (f90-start-block-re, f90-no-block-limit): Handle "class default". (Bug#28786) * test/automated/f90.el (f90-test-bug25039): Add "class default". --- lisp/progmodes/f90.el | 12 +++++++++--- test/lisp/progmodes/f90-tests.el | 14 +++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) (limited to 'lisp') diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index 6421ba60dce..72156288eba 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -909,6 +909,8 @@ Can be overridden by the value of `font-lock-maximum-decoration'.") [ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)" "Regexp matching the definition of a derived type.") +;; Maybe this should include "class default", but the constant is no +;; longer used. (defconst f90-typeis-re "\\_<\\(class\\|type\\)[ \t]*is[ \t]*(" "Regexp matching a CLASS/TYPE IS statement.") @@ -955,10 +957,14 @@ Used in the F90 entry in `hs-special-modes-alist'.") ;; Avoid F2003 "type is" in "select type", ;; and also variables of derived type "type (foo)". ;; "type, foo" must be a block (?). + ;; And a partial effort to avoid "class default". "\\(?:type\\|class\\)[ \t,]\\(" - "[^i(!\n\"& \t]\\|" ; not-i( + "[^id(!\n\"& \t]\\|" ; not-id( "i[^s!\n\"& \t]\\|" ; i not-s - "is\\(?:\\sw\\|\\s_\\)\\)\\|" + "d[^e!\n\"& \t]\\|" ; d not-e + "de[^f!\n\"& \t]\\|" ; de not-f + "def[^a!\n\"& \t]\\|" ; def not-a + "\\(?:is\\|default\\)\\(?:\\sw\\|\\s_\\)\\)\\|" ;; "abstract interface" is F2003; "submodule" is F2008. "program\\|\\(?:abstract[ \t]*\\)?interface\\|\\(?:sub\\)?module\\|" ;; "enum", but not "enumerator". @@ -1454,7 +1460,7 @@ if all else fails." (not (or (looking-at "end") (looking-at "\\(do\\|if\\|else\\(if\\|where\\)?\ \\|select[ \t]*\\(case\\|type\\)\\|case\\|where\\|forall\\|\ -\\(?:class\\|type\\)[ \t]*is\\|\ +\\(?:class\\|type\\)[ \t]*is\\|class[ \t]*default\\|\ block\\|critical\\|enum\\|associate\\)\\_>") (looking-at "\\(program\\|\\(?:sub\\)?module\\|\ \\(?:abstract[ \t]*\\)?interface\\|block[ \t]*data\\)\\_>") diff --git a/test/lisp/progmodes/f90-tests.el b/test/lisp/progmodes/f90-tests.el index 0c03a190ca2..2a9100adff6 100644 --- a/test/lisp/progmodes/f90-tests.el +++ b/test/lisp/progmodes/f90-tests.el @@ -256,21 +256,25 @@ end program prog") (should (= 5 (current-indentation))))) (ert-deftest f90-test-bug25039 () - "Test for https://debbugs.gnu.org/25039 ." + "Test for https://debbugs.gnu.org/25039 and 28786." (with-temp-buffer (f90-mode) (insert "program prog select type (a) -class is (c1) -x = 1 type is (t1) x = 2 +class is (c1) +x = 1 +class default +x=3 end select end program prog") (f90-indent-subprogram) (forward-line -3) - (should (= 2 (current-indentation))) ; type is + (should (= 2 (current-indentation))) ; class default + (forward-line -2) + (should (= 2 (current-indentation))) ; class is (forward-line -2) - (should (= 2 (current-indentation))))) ; class is + (should (= 2 (current-indentation))))) ; type is ;;; f90-tests.el ends here -- cgit v1.2.3 From 831eafc8ae201881e6449e2ab5d15d594573650b Mon Sep 17 00:00:00 2001 From: João Távora Date: Thu, 19 Oct 2017 12:33:20 +0100 Subject: Augment Flymake API for third-party extensions See https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00619.html * doc/misc/flymake.texi (Flymake error types): Rewrite example. (Flymake utility functions): Augment with new API. * lisp/progmodes/flymake.el (flymake-diagnostics): New function. (flymake--diag-accessor): New helper macro. (flymake-diagnostic-buffer, flymake-diagnostic-text) (flymake-diagnostic-beg, flymake-diagnostic-end) (flymake-diagnostic-backend): Accessors for diagnostic objects. (flymake--overlays): Use flymake-diagnostic property. (flymake--highlight-line): Simplify. Only set flymake-diagnostic property. (flymake--handle-report, flymake-goto-next-error): Use flymake-diagnostic property. (flymake-show-diagnostic): Use diagnostic object. (flymake--diagnostics-buffer-entries): Use flymake-diagnostics. --- doc/misc/flymake.texi | 69 +++++++++++++++++++++++++++++++---------------- lisp/progmodes/flymake.el | 56 +++++++++++++++++++++++++------------- 2 files changed, 83 insertions(+), 42 deletions(-) (limited to 'lisp') diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index 2aabaf06b73..b0a56492bcd 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi @@ -361,34 +361,38 @@ priority but without an overlay face. (flymake-category . flymake-note)))) @end example -@vindex flymake-text +@vindex flymake-diagnostics +@vindex flymake-diagnostic-backend +@vindex flymake-diagnostic-buffer +@vindex flymake-diagnostic-text +@vindex flymake-diagnostic-beg +@vindex flymake-diagnostic-end As you might have guessed, Flymake's annotations are implemented as overlays (@pxref{Overlays,,, elisp, The Emacs Lisp Reference Manual}). Along with the properties that you specify for the specific type of -diagnostic, Flymake adds the property @code{flymake-text} to these -overlays, and sets it to the message string that the backend used to -describe the diagnostic. +diagnostic, Flymake adds the property @code{flymake-diagnostic} to +these overlays, and sets it to the object that the backend created +with @code{flymake-make-diagnostic}. -Since overlays also support arbitrary keymaps, you can use this -property @code{flymake-text} to create interactive annotations, such -as in the following example of binding a @kbd{mouse-3} event (middle -mouse button click) to an Internet search for the text of a -@code{:warning} or @code{:error}. +Since overlays also support arbitrary keymaps, you can use this along +with the functions @code{flymake-diagnostics} and +@code{flymake-diagnostic-text} (@pxref{Flymake utility functions}) to +create interactive annotations, such as in the following example of +binding a @code{mouse-3} event (middle mouse button click) to an +Internet search for the text of a @code{:warning} or @code{:error}. @example (defun my-search-for-message (event) (interactive "e") - (let ((ovs (overlays-at (posn-point (event-start event)))) - ov) - ;; loop until flymake overlay we clicked on is recovered - (while (not (overlay-get (setq ov (pop ovs)) 'flymake-text))) - (when ov - (eww-browse-url - (concat "https://duckduckgo.com/?q=" - (replace-regexp-in-string " " - "+" - (overlay-get ov 'flymake-text))) - t)))) + (let* ((diags (flymake-diagnostics (posn-point (event-start event)))) + (topmost-diag (car diags))) + (eww-browse-url + (concat + "https://duckduckgo.com/?q=" + (replace-regexp-in-string " " + "+" + (flymake-diagnostic-text topmost-diag))) + t))) (dolist (type '(:warning :error)) (let ((a (assoc type flymake-diagnostic-types-alist))) @@ -513,6 +517,24 @@ Make a Flymake diagnostic for @var{buffer}'s region from @var{beg} to of the problem detected in this region. @end deffn +@cindex access diagnostic object +These objects' properties can be accessed with the functions +@code{flymake-diagnostic-backend}, @code{flymake-diagnostic-buffer}, +@code{flymake-diagnostic-text}, @code{flymake-diagnostic-beg}, +@code{flymake-diagnostic-end} and @code{flymake-diagnostic-type}. + +Additionally, the function @code{flymake-diagnostics} will collect +such objects in the region you specify. + +@cindex collect diagnostic objects +@deffn Function flymake-diagnostics beg end +Get a list of Flymake diagnostics in the region determined by +@var{beg} and @var{end}. If neither @var{beg} or @var{end} is +supplied, use the whole buffer, otherwise if @var{beg} is +non-@code{nil} and @var{end} is @code{nil}, consider only diagnostics +at @var{beg}. +@end deffn + @cindex buffer position from line and column number It is often the case with external syntax tools that a diagnostic's position is reported in terms of a line number, and sometimes a column @@ -520,9 +542,10 @@ number. To convert this information into a buffer position, backends can use the following function: @deffn Function flymake-diag-region buffer line &optional col -Compute @var{buffer}'s region (@var{beg} . @var{end}) corresponding to -@var{line} and @var{col}. If @var{col} is nil, return a region just -for @var{line}. Return nil if the region is invalid. +Compute @var{buffer}'s region (@var{beg} . @var{end}) corresponding +to @var{line} and @var{col}. If @var{col} is @code{nil}, return a +region just for @var{line}. Return @code{nil} if the region is +invalid. @end deffn @cindex add a log message diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 5d5f9bb75d8..9c546fd9667 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -228,6 +228,29 @@ TYPE is a key to `flymake-diagnostic-types-alist' and TEXT is a description of the problem detected in this region." (flymake--diag-make :buffer buffer :beg beg :end end :type type :text text)) +;;;###autoload +(defun flymake-diagnostics (&optional beg end) + "Get Flymake diagnostics in region determined by BEG and END. + +If neither BEG or END is supplied, use the whole buffer, +otherwise if BEG is non-nil and END is nil, consider only +diagnostics at BEG." + (mapcar (lambda (ov) (overlay-get ov 'flymake-diagnostic)) + (flymake--overlays :beg beg :end end))) + +(defmacro flymake--diag-accessor (public internal thing) + "Make PUBLIC an alias for INTERNAL, add doc using THING." + `(defsubst ,public (diag) + ,(format "Get Flymake diagnostic DIAG's %s." (symbol-name thing)) + (,internal diag))) + +(flymake--diag-accessor flymake-diagnostic-buffer flymake--diag-buffer buffer) +(flymake--diag-accessor flymake-diagnostic-text flymake--diag-text text) +(flymake--diag-accessor flymake-diagnostic-type flymake--diag-type type) +(flymake--diag-accessor flymake-diagnostic-beg flymake--diag-beg beg) +(flymake--diag-accessor flymake-diagnostic-end flymake--diag-end end) +(flymake--diag-accessor flymake-diagnostic-backend flymake--diag-backend backend) + (cl-defun flymake--overlays (&key beg end filter compare key) "Get flymake-related overlays. If BEG is non-nil and END is nil, consider only `overlays-at' @@ -238,7 +261,7 @@ verify FILTER, a function, and sort them by COMPARE (using KEY)." (widen) (let ((ovs (cl-remove-if-not (lambda (ov) - (and (overlay-get ov 'flymake) + (and (overlay-get ov 'flymake-diagnostic) (or (not filter) (funcall filter ov)))) (if (and beg (null end)) @@ -498,18 +521,15 @@ associated `flymake-category' return DEFAULT." (default-maybe 'help-echo (lambda (_window _ov pos) (mapconcat - (lambda (ov) - (overlay-get ov 'flymake-text)) - (flymake--overlays :beg pos) + #'flymake--diag-text + (flymake-diagnostics pos) "\n"))) (default-maybe 'severity (warning-numeric-level :error)) (default-maybe 'priority (+ 100 (overlay-get ov 'severity)))) ;; Some properties can't be overridden. ;; (overlay-put ov 'evaporate t) - (overlay-put ov 'flymake t) - (overlay-put ov 'flymake-text (flymake--diag-text diagnostic)) - (overlay-put ov 'flymake--diagnostic diagnostic))) + (overlay-put ov 'flymake-diagnostic diagnostic))) ;; Nothing in Flymake uses this at all any more, so this is just for ;; third-party compatibility. @@ -600,7 +620,7 @@ not expected." (lambda (ov) (eq backend (flymake--diag-backend - (overlay-get ov 'flymake--diagnostic)))))) + (overlay-get ov 'flymake-diagnostic)))))) (mapc (lambda (diag) (flymake--highlight-line diag) (setf (flymake--diag-backend diag) backend)) @@ -899,7 +919,7 @@ applied." (lambda (ov) (let ((diag (overlay-get ov - 'flymake--diagnostic))) + 'flymake-diagnostic))) (and diag (or (not filter) (memq (flymake--diag-type diag) @@ -1089,13 +1109,13 @@ applied." (interactive (list (point) t)) (let* ((id (or (tabulated-list-get-id pos) (user-error "Nothing at point"))) - (overlay (plist-get id :overlay))) - (with-current-buffer (overlay-buffer overlay) + (diag (plist-get id :diagnostic))) + (with-current-buffer (flymake--diag-buffer diag) (with-selected-window (display-buffer (current-buffer) other-window) - (goto-char (overlay-start overlay)) - (pulse-momentary-highlight-region (overlay-start overlay) - (overlay-end overlay) + (goto-char (flymake--diag-beg diag)) + (pulse-momentary-highlight-region (flymake--diag-beg diag) + (flymake--diag-end diag) 'highlight)) (current-buffer)))) @@ -1108,18 +1128,16 @@ POS can be a buffer position or a button" (defun flymake--diagnostics-buffer-entries () (with-current-buffer flymake--diagnostics-buffer-source - (cl-loop for ov in (flymake--overlays) - for diag = (overlay-get ov - 'flymake--diagnostic) + (cl-loop for diag in (flymake-diagnostics) for (line . col) = (save-excursion - (goto-char (overlay-start ov)) + (goto-char (flymake--diag-beg diag)) (cons (line-number-at-pos) (- (point) (line-beginning-position)))) for type = (flymake--diag-type diag) collect - (list (list :overlay ov + (list (list :diagnostic diag :line line :severity (flymake--lookup-type-property type -- cgit v1.2.3 From fd3d8610b27e26107ba15070aba0d488152f8f4d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 20 Oct 2017 12:36:12 +0300 Subject: Make :align-to account for display-line-numbers These changes also update the various bundled packages to use new feature, and better support customizations of the line-number face. * src/xdisp.c (calc_pixel_width_or_height): Improve commentary. Make :align-to count from the end of the line-number display when the offset or the width form reference that of the text area. (Bug#28855) * src/indent.c (Fline_number_display_width): Implement support for the PIXELWISE argument being 'columns'. Update the doc string. (syms_of_indent): New symbol 'columns'. * lisp/ruler-mode.el (ruler-mode-window-col, ruler-mode-ruler): Call line-number-display-width with last argument 'columns'. * lisp/proced.el (proced-header-line): Call line-number-display-width with 2nd arg 'columns', which also fixes a problem when display-line-numbers is nil. * lisp/emacs-lisp/tabulated-list.el (tabulated-list-line-number-width): Call line-number-display-width with 2nd arg 'columns. (tabulated-list-entry-lnum-width): Remove unneeded defvar. (tabulated-list-print, tabulated-list-print-entry): No need to account for the value of tabulated-list-entry-lnum-width. (tabulated-list--current-lnum-width): New defvar. (tabulated-list-watch-line-number-width): New function. (tabulated-list-mode): Bind tabulated-list--current-lnum-width locally, and set up tabulated-list-watch-line-number-width as pre-redisplay-functions hook. * doc/lispref/display.texi (Size of Displayed Text): Document the 'columns' value of the PIXELWISE argument. (Pixel Specification): Update and improve the documentation of the supported forms. --- doc/lispref/display.texi | 49 +++++++++++++++++++++++++------------ lisp/emacs-lisp/tabulated-list.el | 25 +++++++++++++------ lisp/proced.el | 3 ++- lisp/ruler-mode.el | 16 +++++++++--- src/indent.c | 23 ++++++++++++++---- src/xdisp.c | 51 +++++++++++++++++++++++++++++++++++---- 6 files changed, 129 insertions(+), 38 deletions(-) (limited to 'lisp') diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index fbdd810247d..17126ce72b9 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -2050,14 +2050,17 @@ calculations. @defun line-number-display-width &optional pixelwise This function returns the width used for displaying the line numbers -in the selected window. Optional argument @var{pixelwise}, if -non-@code{nil}, means return the value in pixels; otherwise the value -is returned in column units of the font defined for the +in the selected window. If the optional argument @var{pixelwise} is +the symbol @code{columns}, the return value is a float number of the +frame's canonical columns; if @var{pixelwise} is @code{t} or any other +non-@code{nil} value, the value is an integer and is measured in +pixels. If @var{pixelwise} is omitted or @code{nil}, the value is the +integer number of columns of the font defined for the @code{line-number} face, and doesn't include the 2 columns used to pad -the numbers. If line numbers are not displayed in the selected -window, the value is zero. Use @code{with-selected-window} -(@pxref{Selecting Windows}) if you need this information about another -window. +the numbers on display. If line numbers are not displayed in the +selected window, the value is zero regardless of the value of +@var{pixelwise}. Use @code{with-selected-window} (@pxref{Selecting +Windows}) if you need this information about another window. @end defun @@ -4636,7 +4639,7 @@ as an absolute number of pixels. @smallexample @group - @var{expr} ::= @var{num} | (@var{num}) | @var{unit} | @var{elem} | @var{pos} | @var{image} | @var{form} + @var{expr} ::= @var{num} | (@var{num}) | @var{unit} | @var{elem} | @var{pos} | @var{image} | @var{xwidget} | @var{form} @var{num} ::= @var{integer} | @var{float} | @var{symbol} @var{unit} ::= in | mm | cm | width | height @end group @@ -4652,22 +4655,34 @@ as an absolute number of pixels. The form @var{num} specifies a fraction of the default frame font height or width. The form @code{(@var{num})} specifies an absolute number of pixels. If @var{num} is a symbol, @var{symbol}, its -buffer-local variable binding is used. +buffer-local variable binding is used; that binding can be either a +number or a cons cell of the forms shown above (including yet another +cons cell whose @code{car} is a symbol that has a buffer-local +binding). The @code{in}, @code{mm}, and @code{cm} units specify the number of pixels per inch, millimeter, and centimeter, respectively. The @code{width} and @code{height} units correspond to the default width -and height of the current face. An image specification @code{image} -corresponds to the width or height of the image. +and height of the current face. An image specification of the form +@w{@code{(image . @var{props})}} (@pxref{Image Descriptors}) +corresponds to the width or height of the specified image. Similarly, +an xwidget specification of the form @w{@code{(xwidget . @var{props})}} +stands for the width or height of the specified xwidget. +@xref{Xwidgets}. The elements @code{left-fringe}, @code{right-fringe}, @code{left-margin}, @code{right-margin}, @code{scroll-bar}, and -@code{text} specify to the width of the corresponding area of the -window. +@code{text} specify the width of the corresponding area of the window. +When the window displays line numbers (@pxref{Size of Displayed +Text}), the width of the @code{text} area is decreased by the screen +space taken by the line-number display. The @code{left}, @code{center}, and @code{right} positions can be used with @code{:align-to} to specify a position relative to the left -edge, center, or right edge of the text area. +edge, center, or right edge of the text area. When the window +displays line numbers, the @code{left} and the @code{center} positions +are offset to account for the screen space taken by the line-number +display. Any of the above window elements (except @code{text}) can also be used with @code{:align-to} to specify that the position is relative to @@ -4683,13 +4698,15 @@ the left-margin, use If no specific base offset is set for alignment, it is always relative to the left edge of the text area. For example, @samp{:align-to 0} in a -header-line aligns with the first text column in the text area. +header-line aligns with the first text column in the text area. When +the window displays line numbers, the text is considered to start where +the space used for line-number display ends. A value of the form @code{(@var{num} . @var{expr})} stands for the product of the values of @var{num} and @var{expr}. For example, @code{(2 . in)} specifies a width of 2 inches, while @code{(0.5 . @var{image})} specifies half the width (or height) of the specified -image. +@var{image} (which should be given by its image spec). The form @code{(+ @var{expr} ...)} adds up the value of the expressions. The form @code{(- @var{expr} ...)} negates or subtracts diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index d1d7c0a8042..73ddadfb805 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -193,10 +193,10 @@ Populated by `tabulated-list-init-header'.") ;; is displayed. (if (not display-line-numbers) 0 - (let ((cbuf-window (get-buffer-window (current-buffer)))) + (let ((cbuf-window (get-buffer-window (current-buffer) t))) (if (window-live-p cbuf-window) (with-selected-window cbuf-window - (+ (line-number-display-width) 2)) + (line-number-display-width 'columns)) 4)))) (defun tabulated-list-init-header () @@ -329,8 +329,6 @@ Check the current row, the previous one and the next row." (string-width (if (stringp nt) nt (car nt))))) tabulated-list--near-rows))) -(defvar tabulated-list-entry-lnum-width nil) - (defun tabulated-list-print (&optional remember-pos update) "Populate the current Tabulated List mode buffer. This sorts the `tabulated-list-entries' list if sorting is @@ -373,7 +371,6 @@ changing `tabulated-list-sort-key'." (unless tabulated-list-use-header-line (tabulated-list-print-fake-header))) ;; Finally, print the resulting list. - (setq tabulated-list-entry-lnum-width (tabulated-list-line-number-width)) (while entries (let* ((elt (car entries)) (tabulated-list--near-rows @@ -428,9 +425,8 @@ of column descriptors." (x (max tabulated-list-padding 0)) (ncols (length tabulated-list-format)) (inhibit-read-only t)) - (setq x (+ x tabulated-list-entry-lnum-width)) (if (> tabulated-list-padding 0) - (insert (make-string (- x tabulated-list-entry-lnum-width) ?\s))) + (insert (make-string x ?\s))) (let ((tabulated-list--near-rows ; Bind it if not bound yet (Bug#25506). (or (bound-and-true-p tabulated-list--near-rows) (list (or (tabulated-list-get-entry (point-at-bol 0)) @@ -601,6 +597,14 @@ With a numeric prefix argument N, sort the Nth column." (tabulated-list-init-header) (tabulated-list-print t))) +(defvar tabulated-list--current-lnum-width nil) +(defun tabulated-list-watch-line-number-width (_window) + (if display-line-numbers + (let ((lnum-width (tabulated-list-line-number-width))) + (when (not (= tabulated-list--current-lnum-width lnum-width)) + (setq-local tabulated-list--current-lnum-width lnum-width) + (tabulated-list-revert))))) + ;;; The mode definition: (define-derived-mode tabulated-list-mode special-mode "Tabulated" @@ -645,7 +649,12 @@ as the ewoc pretty-printer." ;; column of the first entry happens to begin with a R2L letter. (setq bidi-paragraph-direction 'left-to-right) ;; This is for if/when they turn on display-line-numbers - (add-hook 'display-line-numbers-mode-hook #'tabulated-list-revert nil t)) + (add-hook 'display-line-numbers-mode-hook #'tabulated-list-revert nil t) + ;; This is for if/when they customize the line-number face or when + ;; the line-number width needs to change due to scrolling. + (setq-local tabulated-list--current-lnum-width 0) + (add-hook 'pre-redisplay-functions + #'tabulated-list-watch-line-number-width nil t)) (put 'tabulated-list-mode 'mode-class 'special) diff --git a/lisp/proced.el b/lisp/proced.el index c9e851b7e05..aec54b59211 100644 --- a/lisp/proced.el +++ b/lisp/proced.el @@ -604,7 +604,8 @@ Important: the match ends just after the marker.") "Return header line for Proced buffer." (list (propertize " " 'display - (list 'space :align-to (+ 2 (line-number-display-width)))) + (list 'space :align-to + (line-number-display-width 'columns))) (if (<= (window-hscroll) (length proced-header-line)) (replace-regexp-in-string ;; preserve text properties "\\(%\\)" "\\1\\1" diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el index 7a23f4d03c0..3d27858d0fe 100644 --- a/lisp/ruler-mode.el +++ b/lisp/ruler-mode.el @@ -307,7 +307,12 @@ or remove a tab stop. \\[ruler-mode-toggle-show-tab-stops] or N is a column number relative to selected frame. If required, account for screen estate taken by `display-line-numbers'." (if display-line-numbers - (setq n (- n (line-number-display-width) 2))) + ;; FIXME: ruler-mode relies on N being an integer, so if the + ;; 'line-number' face is customized to use a font that is larger + ;; or smaller than that of the default face, the alignment might + ;; be off by up to half a column, unless the font width is an + ;; integral multiple or divisor of the default face's font. + (setq n (- n (round (line-number-display-width 'columns))))) (- n (or (car (window-margins)) 0) (fringe-columns 'left) @@ -668,7 +673,12 @@ Optional argument PROPS specifies other text properties to apply." (let* ((w (ruler-mode-text-scaled-window-width)) (m (window-margins)) (f (window-fringes)) - (i (if display-line-numbers (+ (line-number-display-width) 2) 0)) + (i (if display-line-numbers + ;; FIXME: ruler-mode relies on I being an integer, so + ;; the column numbers might be slightly off if the + ;; line-number face is customized. + (round (line-number-display-width 'columns)) + 0)) (j (ruler-mode-text-scaled-window-hscroll)) ;; Setup the scrollbar, fringes, and margins areas. (lf (ruler-mode-space @@ -708,7 +718,7 @@ Optional argument PROPS specifies other text properties to apply." ;; line-number display be blank, not filled with ;; ruler-mode-basic-graduation-char. (if display-line-numbers - (let* ((lndw (+ (line-number-display-width) 2)) + (let* ((lndw (round (line-number-display-width 'columns))) (s (make-string lndw ?\s))) (concat s (make-string (- w lndw) ruler-mode-basic-graduation-char))) diff --git a/src/indent.c b/src/indent.c index a3e9b5b0b9a..192eec72efe 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1991,15 +1991,26 @@ line_number_display_width (struct window *w, int *width, int *pixel_width) DEFUN ("line-number-display-width", Fline_number_display_width, Sline_number_display_width, 0, 1, 0, doc: /* Return the width used for displaying line numbers in the selected window. -If optional argument PIXELWISE is non-nil, return the width in pixels, -otherwise return the width in columns of the face used to display -line numbers, `line-number'. Note that in the latter case, the value -doesn't include the 2 columns used for padding the numbers. */) +If optional argument PIXELWISE is the symbol `columns', return the width +in units of the frame's canonical character width. In this case, the +value is a float. +If optional argument PIXELWISE is t or any other non-nil value, return +the width as an integer number of pixels. +Otherwise return the value as an integer number of columns of the face +used to display line numbers, `line-number'. Note that in the latter +case, the value doesn't include the 2 columns used for padding the +numbers on display. */) (Lisp_Object pixelwise) { int width, pixel_width; + struct window *w = XWINDOW (selected_window); line_number_display_width (XWINDOW (selected_window), &width, &pixel_width); - if (!NILP (pixelwise)) + if (EQ (pixelwise, Qcolumns)) + { + struct frame *f = XFRAME (w->frame); + return make_float ((double) pixel_width / FRAME_COLUMN_WIDTH (f)); + } + else if (!NILP (pixelwise)) return make_number (pixel_width); return make_number (width); } @@ -2361,6 +2372,8 @@ syms_of_indent (void) doc: /* Indentation can insert tabs if this is non-nil. */); indent_tabs_mode = 1; + DEFSYM (Qcolumns, "columns"); + defsubr (&Scurrent_indentation); defsubr (&Sindent_to); defsubr (&Scurrent_column); diff --git a/src/xdisp.c b/src/xdisp.c index 6d9acecb424..dc23959aadb 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -25123,7 +25123,20 @@ else if the text is replaced by an ellipsis. */) '(space :width (+ left-fringe left-margin (- (1)))) '(space :width (+ left-fringe left-margin (-1))) -*/ + If ALIGN_TO is NULL, returns the result in *RES. If ALIGN_TO is + non-NULL, the value of *ALIGN_TO is a window-relative pixel + coordinate, and *RES is the additional pixel width from that point + till the end of the stretch glyph. + + WIDTH_P non-zero means take the width dimension or X coordinate of + the object specified by PROP, WIDTH_P zero means take the height + dimension or the Y coordinate. (Therefore, if ALIGN_TO is + non-NULL, WIDTH_P should be non-zero.) + + FONT is the font of the face of the surrounding text. + + The return value is non-zero if width or height were successfully + calculated, i.e. if PROP is a valid spec. */ static bool calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, @@ -25145,6 +25158,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, { char *unit = SSDATA (SYMBOL_NAME (prop)); + /* The UNIT expression, e.g. as part of (NUM . UNIT). */ if (unit[0] == 'i' && unit[1] == 'n') pixels = 1.0; else if (unit[0] == 'm' && unit[1] == 'm') @@ -25165,10 +25179,12 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, } #ifdef HAVE_WINDOW_SYSTEM + /* 'height': the height of FONT. */ if (EQ (prop, Qheight)) return OK_PIXELS (font ? normal_char_height (font, -1) : FRAME_LINE_HEIGHT (it->f)); + /* 'width': the width of FONT. */ if (EQ (prop, Qwidth)) return OK_PIXELS (font ? FONT_WIDTH (font) @@ -25178,33 +25194,48 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, return OK_PIXELS (1); #endif + /* 'text': the width or height of the text area. */ if (EQ (prop, Qtext)) return OK_PIXELS (width_p - ? window_box_width (it->w, TEXT_AREA) + ? (window_box_width (it->w, TEXT_AREA) + - it->lnum_pixel_width) : WINDOW_BOX_HEIGHT_NO_MODE_LINE (it->w)); + /* ':align_to'. First time we compute the value, window + elements are interpreted as the position of the element's + left edge. */ if (align_to && *align_to < 0) { *res = 0; + /* 'left': left edge of the text area. */ if (EQ (prop, Qleft)) - return OK_ALIGN_TO (window_box_left_offset (it->w, TEXT_AREA)); + return OK_ALIGN_TO (window_box_left_offset (it->w, TEXT_AREA) + + it->lnum_pixel_width); + /* 'right': right edge of the text area. */ if (EQ (prop, Qright)) return OK_ALIGN_TO (window_box_right_offset (it->w, TEXT_AREA)); + /* 'center': the center of the text area. */ if (EQ (prop, Qcenter)) return OK_ALIGN_TO (window_box_left_offset (it->w, TEXT_AREA) + + it->lnum_pixel_width + window_box_width (it->w, TEXT_AREA) / 2); + /* 'left-fringe': left edge of the left fringe. */ if (EQ (prop, Qleft_fringe)) return OK_ALIGN_TO (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (it->w) ? WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (it->w) : window_box_right_offset (it->w, LEFT_MARGIN_AREA)); + /* 'right-fringe': left edge of the right fringe. */ if (EQ (prop, Qright_fringe)) return OK_ALIGN_TO (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (it->w) ? window_box_right_offset (it->w, RIGHT_MARGIN_AREA) : window_box_right_offset (it->w, TEXT_AREA)); + /* 'left-margin': left edge of the left display margin. */ if (EQ (prop, Qleft_margin)) return OK_ALIGN_TO (window_box_left_offset (it->w, LEFT_MARGIN_AREA)); + /* 'right-margin': left edge of the right display margin. */ if (EQ (prop, Qright_margin)) return OK_ALIGN_TO (window_box_left_offset (it->w, RIGHT_MARGIN_AREA)); + /* 'scroll-bar': left edge of the vertical scroll bar. */ if (EQ (prop, Qscroll_bar)) return OK_ALIGN_TO (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (it->w) ? 0 @@ -25215,6 +25246,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, } else { + /* Otherwise, the elements stand for their width. */ if (EQ (prop, Qleft_fringe)) return OK_PIXELS (WINDOW_LEFT_FRINGE_WIDTH (it->w)); if (EQ (prop, Qright_fringe)) @@ -25237,6 +25269,8 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, int base_unit = (width_p ? FRAME_COLUMN_WIDTH (it->f) : FRAME_LINE_HEIGHT (it->f)); + if (width_p && align_to && *align_to < 0) + return OK_PIXELS (XFLOATINT (prop) * base_unit + it->lnum_pixel_width); return OK_PIXELS (XFLOATINT (prop) * base_unit); } @@ -25248,6 +25282,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, if (SYMBOLP (car)) { #ifdef HAVE_WINDOW_SYSTEM + /* '(image PROPS...)': width or height of the specified image. */ if (FRAME_WINDOW_P (it->f) && valid_image_p (prop)) { @@ -25256,12 +25291,15 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, return OK_PIXELS (width_p ? img->width : img->height); } + /* '(xwidget PROPS...)': dimensions of the specified xwidget. */ if (FRAME_WINDOW_P (it->f) && valid_xwidget_spec_p (prop)) { /* TODO: Don't return dummy size. */ return OK_PIXELS (100); } #endif + /* '(+ EXPR...)' or '(- EXPR...)' add or subtract + recursively calculated values. */ if (EQ (car, Qplus) || EQ (car, Qminus)) { bool first = true; @@ -25289,15 +25327,18 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, car = Qnil; } + /* '(NUM)': absolute number of pixels. */ if (NUMBERP (car)) { double fact; + int offset = + width_p && align_to && *align_to < 0 ? it->lnum_pixel_width : 0; pixels = XFLOATINT (car); if (NILP (cdr)) - return OK_PIXELS (pixels); + return OK_PIXELS (pixels + offset); if (calc_pixel_width_or_height (&fact, it, cdr, font, width_p, align_to)) - return OK_PIXELS (pixels * fact); + return OK_PIXELS (pixels * fact + offset); return false; } -- cgit v1.2.3 From b500e06f4d05dc094b79f8f2c063e070a5a3306e Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 20 Oct 2017 12:46:54 +0200 Subject: Fix Bug#28896 * lisp/net/tramp-adb.el (tramp-adb-handle-rename-file): * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file): Handle FILENAME being a directory. (Bug#28896) * test/lisp/net/tramp-tests.el (tramp-test11-copy-file) (tramp-test12-rename-file): Test also FILENAME being a directory. --- lisp/net/tramp-adb.el | 69 ++++---- lisp/net/tramp-gvfs.el | 7 +- lisp/net/tramp-sh.el | 174 ++++++++++---------- test/lisp/net/tramp-tests.el | 382 +++++++++++++++++++++---------------------- 4 files changed, 322 insertions(+), 310 deletions(-) (limited to 'lisp') diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index e75efcf483f..bf21db2e8d8 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -802,38 +802,43 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." (setq filename (expand-file-name filename) newname (expand-file-name newname)) - (let ((t1 (tramp-tramp-file-p filename)) - (t2 (tramp-tramp-file-p newname))) - (with-parsed-tramp-file-name (if t1 filename newname) nil - (with-tramp-progress-reporter - v 0 (format "Renaming %s to %s" filename newname) - - (if (and t1 t2 - (tramp-equal-remote filename newname) - (not (file-directory-p filename))) - (let ((l1 (file-remote-p filename 'localname)) - (l2 (file-remote-p newname 'localname))) - (when (and (not ok-if-already-exists) - (file-exists-p newname)) - (tramp-error v 'file-already-exists newname)) - ;; We must also flush the cache of the directory, because - ;; `file-attributes' reads the values from there. - (tramp-flush-file-property v (file-name-directory l1)) - (tramp-flush-file-property v l1) - (tramp-flush-file-property v (file-name-directory l2)) - (tramp-flush-file-property v l2) - ;; Short track. - (tramp-adb-barf-unless-okay - v (format - "mv -f %s %s" - (tramp-shell-quote-argument l1) - (tramp-shell-quote-argument l2)) - "Error renaming %s to %s" filename newname)) - - ;; Rename by copy. - (copy-file - filename newname ok-if-already-exists 'keep-time 'preserve-uid-gid) - (delete-file filename)))))) + (if (file-directory-p filename) + (progn + (copy-directory filename newname t t) + (delete-directory filename 'recursive)) + + (let ((t1 (tramp-tramp-file-p filename)) + (t2 (tramp-tramp-file-p newname))) + (with-parsed-tramp-file-name (if t1 filename newname) nil + (with-tramp-progress-reporter + v 0 (format "Renaming %s to %s" filename newname) + + (if (and t1 t2 + (tramp-equal-remote filename newname) + (not (file-directory-p filename))) + (let ((l1 (file-remote-p filename 'localname)) + (l2 (file-remote-p newname 'localname))) + (when (and (not ok-if-already-exists) + (file-exists-p newname)) + (tramp-error v 'file-already-exists newname)) + ;; We must also flush the cache of the directory, because + ;; `file-attributes' reads the values from there. + (tramp-flush-file-property v (file-name-directory l1)) + (tramp-flush-file-property v l1) + (tramp-flush-file-property v (file-name-directory l2)) + (tramp-flush-file-property v l2) + ;; Short track. + (tramp-adb-barf-unless-okay + v (format + "mv -f %s %s" + (tramp-shell-quote-argument l1) + (tramp-shell-quote-argument l2)) + "Error renaming %s to %s" filename newname)) + + ;; Rename by copy. + (copy-file + filename newname ok-if-already-exists 'keep-time 'preserve-uid-gid) + (delete-file filename))))))) (defun tramp-adb-handle-process-file (program &optional infile destination display &rest args) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 2b29a1b55f5..51d24cbc1b0 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -675,6 +675,11 @@ file names." (unless (memq op '(copy rename)) (error "Unknown operation `%s', must be `copy' or `rename'" op)) + (if (file-directory-p filename) + (progn + (copy-directory filename newname keep-date t) + (when (eq op 'rename) (delete-directory filename 'recursive))) + (let ((t1 (tramp-tramp-file-p filename)) (t2 (tramp-tramp-file-p newname)) (equal-remote (tramp-equal-remote filename newname)) @@ -738,7 +743,7 @@ file names." (when t2 (with-parsed-tramp-file-name newname nil (tramp-flush-file-property v (file-name-directory localname)) - (tramp-flush-file-property v localname))))))) + (tramp-flush-file-property v localname)))))))) (defun tramp-gvfs-handle-copy-file (filename newname &optional ok-if-already-exists keep-date diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index bdb7a132408..52a6b8fac0b 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2039,96 +2039,102 @@ of `copy' and `rename'. FILENAME and NEWNAME must be absolute file names." (unless (memq op '(copy rename)) (error "Unknown operation `%s', must be `copy' or `rename'" op)) - (let ((t1 (tramp-tramp-file-p filename)) - (t2 (tramp-tramp-file-p newname)) - (length (tramp-compat-file-attribute-size - (file-attributes (file-truename filename)))) - (attributes (and preserve-extended-attributes - (apply 'file-extended-attributes (list filename))))) - (with-parsed-tramp-file-name (if t1 filename newname) nil - (when (and (not ok-if-already-exists) (file-exists-p newname)) - (tramp-error v 'file-already-exists newname)) - - (with-tramp-progress-reporter - v 0 (format "%s %s to %s" - (if (eq op 'copy) "Copying" "Renaming") - filename newname) + (if (file-directory-p filename) + (progn + (copy-directory filename newname keep-date t) + (when (eq op 'rename) (delete-directory filename 'recursive))) - (cond - ;; Both are Tramp files. - ((and t1 t2) - (with-parsed-tramp-file-name filename v1 - (with-parsed-tramp-file-name newname v2 - (cond - ;; Shortcut: if method, host, user are the same for - ;; both files, we invoke `cp' or `mv' on the remote - ;; host directly. - ((tramp-equal-remote filename newname) - (tramp-do-copy-or-rename-file-directly - op filename newname - ok-if-already-exists keep-date preserve-uid-gid)) - - ;; Try out-of-band operation. - ((and - (tramp-method-out-of-band-p v1 length) - (tramp-method-out-of-band-p v2 length)) - (tramp-do-copy-or-rename-file-out-of-band - op filename newname keep-date)) - - ;; No shortcut was possible. So we copy the file - ;; first. If the operation was `rename', we go back - ;; and delete the original file (if the copy was - ;; successful). The approach is simple-minded: we - ;; create a new buffer, insert the contents of the - ;; source file into it, then write out the buffer to - ;; the target file. The advantage is that it doesn't - ;; matter which file name handlers are used for the - ;; source and target file. - (t - (tramp-do-copy-or-rename-file-via-buffer - op filename newname keep-date)))))) - - ;; One file is a Tramp file, the other one is local. - ((or t1 t2) - (cond - ;; Fast track on local machine. - ((tramp-local-host-p v) - (tramp-do-copy-or-rename-file-directly - op filename newname - ok-if-already-exists keep-date preserve-uid-gid)) + (let ((t1 (tramp-tramp-file-p filename)) + (t2 (tramp-tramp-file-p newname)) + (length (tramp-compat-file-attribute-size + (file-attributes (file-truename filename)))) + (attributes (and preserve-extended-attributes + (apply 'file-extended-attributes (list filename))))) - ;; If the Tramp file has an out-of-band method, the - ;; corresponding copy-program can be invoked. - ((tramp-method-out-of-band-p v length) - (tramp-do-copy-or-rename-file-out-of-band - op filename newname keep-date)) + (with-parsed-tramp-file-name (if t1 filename newname) nil + (when (and (not ok-if-already-exists) (file-exists-p newname)) + (tramp-error v 'file-already-exists newname)) - ;; Use the inline method via a Tramp buffer. - (t (tramp-do-copy-or-rename-file-via-buffer - op filename newname keep-date)))) + (with-tramp-progress-reporter + v 0 (format "%s %s to %s" + (if (eq op 'copy) "Copying" "Renaming") + filename newname) - (t - ;; One of them must be a Tramp file. - (error "Tramp implementation says this cannot happen"))) + (cond + ;; Both are Tramp files. + ((and t1 t2) + (with-parsed-tramp-file-name filename v1 + (with-parsed-tramp-file-name newname v2 + (cond + ;; Shortcut: if method, host, user are the same for + ;; both files, we invoke `cp' or `mv' on the remote + ;; host directly. + ((tramp-equal-remote filename newname) + (tramp-do-copy-or-rename-file-directly + op filename newname + ok-if-already-exists keep-date preserve-uid-gid)) + + ;; Try out-of-band operation. + ((and + (tramp-method-out-of-band-p v1 length) + (tramp-method-out-of-band-p v2 length)) + (tramp-do-copy-or-rename-file-out-of-band + op filename newname keep-date)) + + ;; No shortcut was possible. So we copy the file + ;; first. If the operation was `rename', we go back + ;; and delete the original file (if the copy was + ;; successful). The approach is simple-minded: we + ;; create a new buffer, insert the contents of the + ;; source file into it, then write out the buffer to + ;; the target file. The advantage is that it doesn't + ;; matter which file name handlers are used for the + ;; source and target file. + (t + (tramp-do-copy-or-rename-file-via-buffer + op filename newname keep-date)))))) + + ;; One file is a Tramp file, the other one is local. + ((or t1 t2) + (cond + ;; Fast track on local machine. + ((tramp-local-host-p v) + (tramp-do-copy-or-rename-file-directly + op filename newname + ok-if-already-exists keep-date preserve-uid-gid)) + + ;; If the Tramp file has an out-of-band method, the + ;; corresponding copy-program can be invoked. + ((tramp-method-out-of-band-p v length) + (tramp-do-copy-or-rename-file-out-of-band + op filename newname keep-date)) + + ;; Use the inline method via a Tramp buffer. + (t (tramp-do-copy-or-rename-file-via-buffer + op filename newname keep-date)))) - ;; Handle `preserve-extended-attributes'. We ignore possible - ;; errors, because ACL strings could be incompatible. - (when attributes - (ignore-errors - (apply 'set-file-extended-attributes (list newname attributes)))) - - ;; In case of `rename', we must flush the cache of the source file. - (when (and t1 (eq op 'rename)) - (with-parsed-tramp-file-name filename v1 - (tramp-flush-file-property v1 (file-name-directory v1-localname)) - (tramp-flush-file-property v1 v1-localname))) - - ;; When newname did exist, we have wrong cached values. - (when t2 - (with-parsed-tramp-file-name newname v2 - (tramp-flush-file-property v2 (file-name-directory v2-localname)) - (tramp-flush-file-property v2 v2-localname))))))) + (t + ;; One of them must be a Tramp file. + (error "Tramp implementation says this cannot happen"))) + + ;; Handle `preserve-extended-attributes'. We ignore possible + ;; errors, because ACL strings could be incompatible. + (when attributes + (ignore-errors + (apply 'set-file-extended-attributes (list newname attributes)))) + + ;; In case of `rename', we must flush the cache of the source file. + (when (and t1 (eq op 'rename)) + (with-parsed-tramp-file-name filename v1 + (tramp-flush-file-property v1 (file-name-directory v1-localname)) + (tramp-flush-file-property v1 v1-localname))) + + ;; When newname did exist, we have wrong cached values. + (when t2 + (with-parsed-tramp-file-name newname v2 + (tramp-flush-file-property v2 (file-name-directory v2-localname)) + (tramp-flush-file-property v2 v2-localname)))))))) (defun tramp-do-copy-or-rename-file-via-buffer (op filename newname keep-date) "Use an Emacs buffer to copy or rename a file. diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index c88abbfcb26..e92d1b6203c 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -1883,96 +1883,98 @@ This checks also `file-name-as-directory', `file-name-directory', (let (quoted) (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) (tmp-name2 (tramp--test-make-temp-name nil quoted)) - (tmp-name3 (tramp--test-make-temp-name nil quoted)) - (tmp-name4 (tramp--test-make-temp-name 'local quoted)) - (tmp-name5 (tramp--test-make-temp-name 'local quoted))) - - ;; Copy on remote side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name1) - (copy-file tmp-name1 tmp-name2) - (should (file-exists-p tmp-name2)) - (with-temp-buffer - (insert-file-contents tmp-name2) - (should (string-equal (buffer-string) "foo"))) - (should-error - (copy-file tmp-name1 tmp-name2) - :type 'file-already-exists) - (copy-file tmp-name1 tmp-name2 'ok) - (make-directory tmp-name3) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (copy-file tmp-name1 tmp-name3) - :type 'file-already-exists)) - (copy-file tmp-name1 (file-name-as-directory tmp-name3)) - (should - (file-exists-p - (expand-file-name (file-name-nondirectory tmp-name1) tmp-name3)))) - - ;; Cleanup. - (ignore-errors (delete-file tmp-name1)) - (ignore-errors (delete-file tmp-name2)) - (ignore-errors (delete-directory tmp-name3 'recursive))) - - ;; Copy from remote side to local side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name1) - (copy-file tmp-name1 tmp-name4) - (should (file-exists-p tmp-name4)) - (with-temp-buffer - (insert-file-contents tmp-name4) - (should (string-equal (buffer-string) "foo"))) - (should-error - (copy-file tmp-name1 tmp-name4) - :type 'file-already-exists) - (copy-file tmp-name1 tmp-name4 'ok) - (make-directory tmp-name5) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (copy-file tmp-name1 tmp-name5) - :type 'file-already-exists)) - (copy-file tmp-name1 (file-name-as-directory tmp-name5)) - (should - (file-exists-p - (expand-file-name (file-name-nondirectory tmp-name1) tmp-name5)))) - - ;; Cleanup. - (ignore-errors (delete-file tmp-name1)) - (ignore-errors (delete-file tmp-name4)) - (ignore-errors (delete-directory tmp-name5 'recursive))) - - ;; Copy from local side to remote side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name4 nil 'nomessage) - (copy-file tmp-name4 tmp-name1) - (should (file-exists-p tmp-name1)) - (with-temp-buffer - (insert-file-contents tmp-name1) - (should (string-equal (buffer-string) "foo"))) - (should-error - (copy-file tmp-name4 tmp-name1) - :type 'file-already-exists) - (copy-file tmp-name4 tmp-name1 'ok) - (make-directory tmp-name3) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (copy-file tmp-name4 tmp-name3) - :type 'file-already-exists)) - (copy-file tmp-name4 (file-name-as-directory tmp-name3)) - (should - (file-exists-p - (expand-file-name (file-name-nondirectory tmp-name4) tmp-name3)))) + (tmp-name3 (tramp--test-make-temp-name 'local quoted))) + (dolist (source-target + `(;; Copy on remote side. + (,tmp-name1 . ,tmp-name2) + ;; Copy from remote side to local side. + (,tmp-name1 . ,tmp-name3) + ;; Copy from local side to remote side. + (,tmp-name3 . ,tmp-name1))) + (let ((source (car source-target)) + (target (cdr source-target))) + + ;; Copy simple file. + (unwind-protect + (progn + (write-region "foo" nil source) + (should (file-exists-p source)) + (copy-file source target) + (should (file-exists-p target)) + (with-temp-buffer + (insert-file-contents target) + (should (string-equal (buffer-string) "foo"))) + (should-error + (copy-file source target) + :type 'file-already-exists) + (copy-file source target 'ok)) + + ;; Cleanup. + (ignore-errors (delete-file source)) + (ignore-errors (delete-file target))) + + ;; Copy file to directory. + (unwind-protect + (progn + (write-region "foo" nil source) + (should (file-exists-p source)) + (make-directory target) + (should (file-directory-p target)) + ;; This has been changed in Emacs 26.1. + (when (tramp--test-emacs26-p) + (should-error + (copy-file source target) + :type 'file-already-exists)) + (copy-file source (file-name-as-directory target)) + (should + (file-exists-p + (expand-file-name (file-name-nondirectory source) target)))) + + ;; Cleanup. + (ignore-errors (delete-file source)) + (ignore-errors (delete-directory target 'recursive))) + + ;; Copy directory to existing directory. + (unwind-protect + (progn + (make-directory source) + (should (file-directory-p source)) + (write-region "foo" nil (expand-file-name "foo" source)) + (should (file-exists-p (expand-file-name "foo" source))) + (make-directory target) + (should (file-directory-p target)) + ;; Directory `target' exists already, so we must use + ;; `file-name-as-directory'. + (copy-file source (file-name-as-directory target)) + (should + (file-exists-p + (expand-file-name + (concat (file-name-nondirectory source) "/foo") target)))) + + ;; Cleanup. + (ignore-errors (delete-directory source 'recursive)) + (ignore-errors (delete-directory target 'recursive))) + + ;; Copy directory/file to non-existing directory. + (unwind-protect + (progn + (make-directory source) + (should (file-directory-p source)) + (write-region "foo" nil (expand-file-name "foo" source)) + (should (file-exists-p (expand-file-name "foo" source))) + (make-directory target) + (should (file-directory-p target)) + (copy-file + source + (expand-file-name (file-name-nondirectory source) target)) + (should + (file-exists-p + (expand-file-name + (concat (file-name-nondirectory source) "/foo") target)))) - ;; Cleanup. - (ignore-errors (delete-file tmp-name1)) - (ignore-errors (delete-file tmp-name4)) - (ignore-errors (delete-directory tmp-name3 'recursive)))))) + ;; Cleanup. + (ignore-errors (delete-directory source 'recursive)) + (ignore-errors (delete-directory target 'recursive)))))))) (ert-deftest tramp-test12-rename-file () "Check `rename-file'." @@ -1983,111 +1985,105 @@ This checks also `file-name-as-directory', `file-name-directory', (let (quoted) (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) (tmp-name2 (tramp--test-make-temp-name nil quoted)) - (tmp-name3 (tramp--test-make-temp-name nil quoted)) - (tmp-name4 (tramp--test-make-temp-name 'local quoted)) - (tmp-name5 (tramp--test-make-temp-name 'local quoted))) - - ;; Rename on remote side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name1) - (rename-file tmp-name1 tmp-name2) - (should-not (file-exists-p tmp-name1)) - (should (file-exists-p tmp-name2)) - (with-temp-buffer - (insert-file-contents tmp-name2) - (should (string-equal (buffer-string) "foo"))) - (write-region "foo" nil tmp-name1) - (should-error - (rename-file tmp-name1 tmp-name2) - :type 'file-already-exists) - (rename-file tmp-name1 tmp-name2 'ok) - (should-not (file-exists-p tmp-name1)) - (write-region "foo" nil tmp-name1) - (make-directory tmp-name3) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (rename-file tmp-name1 tmp-name3) - :type 'file-already-exists)) - (rename-file tmp-name1 (file-name-as-directory tmp-name3)) - (should-not (file-exists-p tmp-name1)) - (should - (file-exists-p - (expand-file-name (file-name-nondirectory tmp-name1) tmp-name3)))) - - ;; Cleanup. - (ignore-errors (delete-file tmp-name1)) - (ignore-errors (delete-file tmp-name2)) - (ignore-errors (delete-directory tmp-name3 'recursive))) - - ;; Rename from remote side to local side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name1) - (rename-file tmp-name1 tmp-name4) - (should-not (file-exists-p tmp-name1)) - (should (file-exists-p tmp-name4)) - (with-temp-buffer - (insert-file-contents tmp-name4) - (should (string-equal (buffer-string) "foo"))) - (write-region "foo" nil tmp-name1) - (should-error - (rename-file tmp-name1 tmp-name4) - :type 'file-already-exists) - (rename-file tmp-name1 tmp-name4 'ok) - (should-not (file-exists-p tmp-name1)) - (write-region "foo" nil tmp-name1) - (make-directory tmp-name5) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (rename-file tmp-name1 tmp-name5) - :type 'file-already-exists)) - (rename-file tmp-name1 (file-name-as-directory tmp-name5)) - (should-not (file-exists-p tmp-name1)) - (should - (file-exists-p - (expand-file-name (file-name-nondirectory tmp-name1) tmp-name5)))) - - ;; Cleanup. - (ignore-errors (delete-file tmp-name1)) - (ignore-errors (delete-file tmp-name4)) - (ignore-errors (delete-directory tmp-name5 'recursive))) - - ;; Rename from local side to remote side. - (unwind-protect - (progn - (write-region "foo" nil tmp-name4 nil 'nomessage) - (rename-file tmp-name4 tmp-name1) - (should-not (file-exists-p tmp-name4)) - (should (file-exists-p tmp-name1)) - (with-temp-buffer - (insert-file-contents tmp-name1) - (should (string-equal (buffer-string) "foo"))) - (write-region "foo" nil tmp-name4 nil 'nomessage) - (should-error - (rename-file tmp-name4 tmp-name1) - :type 'file-already-exists) - (rename-file tmp-name4 tmp-name1 'ok) - (should-not (file-exists-p tmp-name4)) - (write-region "foo" nil tmp-name4 nil 'nomessage) - (make-directory tmp-name3) - ;; This has been changed in Emacs 26.1. - (when (tramp--test-emacs26-p) - (should-error - (rename-file tmp-name4 tmp-name3) - :type 'file-already-exists)) - (rename-file tmp-name4 (file-name-as-directory tmp-name3)) - (should-not (file-exists-p tmp-name4)) - (should - (file-exists-p - (expand-file-name (file-name-nondirectory tmp-name4) tmp-name3)))) + (tmp-name3 (tramp--test-make-temp-name 'local quoted))) + (dolist (source-target + `(;; Rename on remote side. + (,tmp-name1 . ,tmp-name2) + ;; Rename from remote side to local side. + (,tmp-name1 . ,tmp-name3) + ;; Rename from local side to remote side. + (,tmp-name3 . ,tmp-name1))) + (let ((source (car source-target)) + (target (cdr source-target))) + + ;; Rename simple file. + (unwind-protect + (progn + (write-region "foo" nil source) + (should (file-exists-p source)) + (rename-file source target) + (should-not (file-exists-p source)) + (should (file-exists-p target)) + (with-temp-buffer + (insert-file-contents target) + (should (string-equal (buffer-string) "foo"))) + (write-region "foo" nil source) + (should (file-exists-p source)) + (should-error + (rename-file source target) + :type 'file-already-exists) + (rename-file source target 'ok) + (should-not (file-exists-p source))) + + ;; Cleanup. + (ignore-errors (delete-file source)) + (ignore-errors (delete-file target))) + + ;; Rename file to directory. + (unwind-protect + (progn + (write-region "foo" nil source) + (should (file-exists-p source)) + (make-directory target) + (should (file-directory-p target)) + ;; This has been changed in Emacs 26.1. + (when (tramp--test-emacs26-p) + (should-error + (rename-file source target) + :type 'file-already-exists)) + (rename-file source (file-name-as-directory target)) + (should-not (file-exists-p source)) + (should + (file-exists-p + (expand-file-name (file-name-nondirectory source) target)))) + + ;; Cleanup. + (ignore-errors (delete-file source)) + (ignore-errors (delete-directory target 'recursive))) + + ;; Rename directory to existing directory. + (unwind-protect + (progn + (make-directory source) + (should (file-directory-p source)) + (write-region "foo" nil (expand-file-name "foo" source)) + (should (file-exists-p (expand-file-name "foo" source))) + (make-directory target) + (should (file-directory-p target)) + ;; Directory `target' exists already, so we must use + ;; `file-name-as-directory'. + (rename-file source (file-name-as-directory target)) + (should-not (file-exists-p source)) + (should + (file-exists-p + (expand-file-name + (concat (file-name-nondirectory source) "/foo") target)))) + + ;; Cleanup. + (ignore-errors (delete-directory source 'recursive)) + (ignore-errors (delete-directory target 'recursive))) + + ;; Rename directory/file to non-existing directory. + (unwind-protect + (progn + (make-directory source) + (should (file-directory-p source)) + (write-region "foo" nil (expand-file-name "foo" source)) + (should (file-exists-p (expand-file-name "foo" source))) + (make-directory target) + (should (file-directory-p target)) + (rename-file + source + (expand-file-name (file-name-nondirectory source) target)) + (should-not (file-exists-p source)) + (should + (file-exists-p + (expand-file-name + (concat (file-name-nondirectory source) "/foo") target)))) - ;; Cleanup. - (ignore-errors (delete-file tmp-name1)) - (ignore-errors (delete-file tmp-name4)) - (ignore-errors (delete-directory tmp-name3 'recursive)))))) + ;; Cleanup. + (ignore-errors (delete-directory source 'recursive)) + (ignore-errors (delete-directory target 'recursive)))))))) (ert-deftest tramp-test13-make-directory () "Check `make-directory'. -- cgit v1.2.3 From 11bd8aa24b347f75e674528dd1a94b0a4037105e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 20 Oct 2017 13:07:30 -0400 Subject: Fix flymake's loading of subr-x * lisp/progmodes/flymake.el, test/lisp/progmodes/flymake-tests.el: No need to load subr-x at run-time. --- lisp/progmodes/flymake.el | 3 ++- test/lisp/progmodes/flymake-tests.el | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 9c546fd9667..3c588f02fa6 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -48,7 +48,8 @@ (require 'thingatpt) ; end-of-thing (require 'warnings) ; warning-numeric-level, display-warning (require 'compile) ; for some faces -(require 'subr-x) ; when-let*, if-let*, hash-table-keys, hash-table-values +;; when-let*, if-let*, hash-table-keys, hash-table-values: +(eval-when-compile (require 'subr-x)) (defgroup flymake nil "Universal on-the-fly syntax checker." diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el index eddd964ad14..cfa810053ca 100644 --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el @@ -24,7 +24,7 @@ ;;; Code: (require 'ert) (require 'flymake) -(require 'subr-x) ; string-trim +(eval-when-compile (require 'subr-x)) ; string-trim (defvar flymake-tests-data-directory (expand-file-name "lisp/progmodes/flymake-resources" -- cgit v1.2.3