Stefan Kangas [Tue, 30 Mar 2021 16:56:02 +0000 (18:56 +0200)]
Use lexical-binding in echistory.el
* lisp/echistory.el: Use lexical-binding.
(electric-history-map): Quote function symbols as such.
(Electric-history-undefined): Use command substitutions.
Dmitry Gutov [Tue, 30 Mar 2021 00:42:11 +0000 (03:42 +0300)]
Provide information to show icons with Elisp completions
* lisp/progmodes/elisp-mode.el (elisp--company-kind): New function.
(elisp-completion-at-point): Use it. And a couple of anonymous
:company-kind functions too.
Stefan Monnier [Mon, 29 Mar 2021 22:35:01 +0000 (18:35 -0400)]
lisp/progmodes/verilog-mode.el: Prepare for lexical-binding.
* lisp/progmodes/verilog-mode.el: Activate lexical-binding.
Insert newlines to avoid some situations where arguments were easy
to misunderstand.
(verilog-set-compile-command): Strength-reduce `eval` to `symbol-value`.
(verilog-error-regexp-add-emacs): Replace `mapcar` => `mapc` since
the result is not used.
(verilog-surelint-off): Remove always-nil var `dir`.
(verilog-do-indent): Minor simplification of the code.
(verilog-pred): Delete var. It was always nil.
(verilog-flag): Delete var; pass the corresponding data via
explicit arguments instead.
(verilog-keyword-completion): Use `dolist`.
(verilog-completion-response): Rename to `verilog--complete-with-action`.
Change calling convention to match that of `complete-with-action`.
Use `complete-with-action` instead when available.
Adjust all callers.
(verilog-completion, verilog-comp-defun): Change arg names so they
don't collide with dynamically scoped vars, and let-bind `verilog-str`
explicitly instead. Use `with-current-buffer`.
(verilog-batch-execute-func): Use `with-current-buffer`.
(verilog-complete-word): Don't convert the completion list into
a completion alist, since lists work just as well.
(verilog-showscopes): Use `with-current-buffer`.
(verilog-symbol-detick, verilog-symbol-detick-text)
(verilog-signals-matching-enum): Strength-reduce `eval` to `symbol-value`.
(verilog--insert-indent): Rename from `verilog--insert-indent`.
Add `indent-pt` argument.
(verilog-insert-indent): New macro wrapper to provide the old
calling convention.
(verilog-auto-assign-modport, verilog-auto-inout-modport):
Remove always-nil var `direction-re`.
(verilog--auto-inst-first): Rename from `verilog-auto-inst-first`.
Add `indent-pt` argument.
(verilog-auto-inst-port): Adjust call accordingly.
Stefan Monnier [Mon, 29 Mar 2021 20:46:41 +0000 (16:46 -0400)]
* lisp/completion.el: Activate lexical-binding
Remove redundant `:group` arguments.
(list-all-completions-1): Merge into `list-all-completions` and
then delete.
(list-all-completions-by-hash-bucket-1): Use `push`. Merge into
`list-all-completions-by-hash-bucket` and then delete.
(completions-list-return-value): Delete variable, not used any more.
(woman-mode, woman2-roff-buffer): Use `cl-letf`.
(woman-request): Move declaration before first use.
(woman0-macro): Rename arg to not shadow the dynamically scoped var.
(woman-set-arg): Strength-reduce `eval` to `symbol-value`.
Stefan Monnier [Mon, 29 Mar 2021 19:29:26 +0000 (15:29 -0400)]
* lisp/allout*.el: Use lexical-binding
* lisp/allout.el: Activate lexical-binding.
(allout-setup-menubar): Delete "complex no-op" function.
(allout-mode): Delete call to it.
(allout-hotspot-key-handler): Delete XEmacs-only code.
(allout-copy-exposed-to-buffer): Remove always-nil var `start-list`.
* lisp/allout-widgets.el: Activate lexical-binding.
(allout-item-icon-keymap): Use `ignore`.
(allout-widgets-exposure-change-processor): Use `cl-callf` instead of
relying on dynamic binding to apply some code to two different variables.
Alan Mackenzie [Mon, 29 Mar 2021 15:32:40 +0000 (15:32 +0000)]
Fix an infinite loop in C++ Mode redisplay. This was bug #47191.
* lisp/progmodes/cc-defs.el (c-forward-syntactic-ws, c-backward-syntactic-ws):
When point is on the wrong side of a supplied search limit, leave point
unmoved rather than setting it to that limit.
* lisp/progmodes/cc-engine.el (c-forward-name): After scanning a template
argument list (which is not itself subject to a search limit) recalculate the
search limit starting from the end point, since these argument lists can
legitimately be long. At each of the scanning loops, check point hasn't gone
past the limit.
Glenn Morris [Mon, 29 Mar 2021 15:26:25 +0000 (08:26 -0700)]
Merge from origin/emacs-27
bcc4cc3362 Doc fixes for 'face-foreground' and 'face-background'. bf6442fafd ; * admin/make-tarball.txt: Minor addition to the Web page... 38b127d32e * admin/admin.el (set-version): Handle malformed NEWS markup. 0d7e2a993e admin.el fix for bug#47394 fdec444758 ; * etc/NEWS: Fix typo. 1e6ca2765f ; * admin/make-tarball.txt: Another minor addition.
Michael Albinus [Mon, 29 Mar 2021 11:52:01 +0000 (13:52 +0200)]
Some Tramp doc clarifications
* doc/misc/tramp.texi (Remote shell setup): Explain meaning of
`tramp-sh-extra-args' for bash.
(Frequently Asked Questions): New item about unloading / reloading Tramp.
Eli Zaretskii [Sun, 28 Mar 2021 12:29:41 +0000 (15:29 +0300)]
Avoid errors in pulse.el for some face customizations
* lisp/cedet/pulse.el (pulse-momentary-highlight-overlay): Make
sure 'face-background' always returns a color name. Suggested by
Ingo Lohmar <ingo.lohmar@posteo.net> in bug#47437.
Stefan Monnier [Sat, 27 Mar 2021 14:54:10 +0000 (10:54 -0400)]
* lisp/wdired.el: Fix minor regressions and simplify a bit
Use `wdired--current-column` more consistently to avoid mayhem when it
doesn't return the same result as `current-column`.
(wdired-get-filename): Fix the unprocessed case.
(wdired-finish-edit): Don't force processing all the lines.
(wdired--col-perm): Remove, redundant with `wdired--perm-beg`.
(wdired-change-to-wdired-mode): Don't error in empty directory.
(wdired--set-permission-bounds): Set `wdired--perm-beg` when we can't
find permissions. Move `wdired--perm-beg` 1 char further (like
`wdired--col-perm`). Use `wdired--current-column`.
(wdired--point-at-perms-p): Fix when `wdired--perm-beg` is nil.
(wdired--self-insert): Lookup the keymap to know command to call.
(wdired--before-change-fn): Just use `point` instead of `beg`.
Use `with-silent-modifications` here rather than in each of the
`wdired--preprocess-*` functions.
(wdired--preprocess-files): Presume we're at BOL and within
`with-silent-modifications`. Fix application of `read-only`.
(wdired-abort-changes): Don't use `with-silent-modifications` since
we're really modifying the buffer.
(wdired--preprocess-symlinks): Presume we're at BOL and within
`with-silent-modifications`.
(wdired--preprocess-perms): Presume we're at BOL and within
`with-silent-modifications`.
(wdired-set-bit): Add `char` argument. Use `wdired--current-column`.
Copy previous text properties rather than duplicating the code of
`wdired--preprocess-perms`.
(wdired-toggle-bit): Delegate to `wdired-set-bit`.
Arthur Miller [Sat, 27 Mar 2021 07:29:44 +0000 (08:29 +0100)]
* lisp/wdired.el: Apply text properties lazily
Entering wdired was taking time proportional to the size of the directory,
making it inconvenient to quickly enter wdired just to rename one or two
files in a large directory.
(wdired-mode-map): Rebind `self-insert-command`.
(wdired--perm-beg, wdired--perm-end): New vars.
(wdired--col-perm, wdired--old-content, wdired--old-point)
(wdired--old-marks): Rename vars, using "--" rather than "-".
All users updated.
(wdired--before-change-fn): New function.
(wdired-change-to-wdired-mode): Use it `before-change-functions`
instead of eagerly putting the various text properties here.
(wdired--set-permission-bounds, wdired--current-column)
(wdired--point-at-perms-p, wdired--line-preprocessed-p):
New auxiliary functions.
(wdired--self-insert): New command.
(wdired--preprocess-files, wdired--preprocess-symlinks)
(wdired--preprocess-perms): Add "--" to the name. Make it operate only
on the current line. Use `with-silent-modifications`.
(wdired-abort-changes): Use `with-silent-modifications`.
Michael Albinus [Sat, 27 Mar 2021 10:43:15 +0000 (11:43 +0100)]
Keep *.log files on emba
* test/infra/gitlab-ci.yml (.test-template): New template.
(test-fast-inotify, test-lisp-inotify, test-lisp-net-inotify)
(test-filenotify-gio, test-gnustep, test-all-inotify): Use it.
Eli Zaretskii [Sat, 27 Mar 2021 10:24:58 +0000 (13:24 +0300)]
Fix lisp/files-tests on MS-Windows
* test/lisp/files-tests.el (files-colon-path)
(files-tests-bug-21454): Adapt to MS-DOS/Windows, where
parse-colon-path needs and absolute file name with a drive letter.
(files-tests-file-name-non-special-get-file-buffer): Forcefully
delete the file's buffer if it happens to exist.
Matt Armstrong [Fri, 19 Feb 2021 23:39:15 +0000 (15:39 -0800)]
File unlock errors now issue warnings (Bug#46397)
The primary idea is to allow `kill-buffer' and `kill-emacs' to
complete even if Emacs has trouble unlocking the buffer's file.
* lisp/userlock.el (userlock--handle-unlock-error): New function, call
`display-error'.
* src/filelock.c (unlock_file_body): New function, do what
'unlock_file' used to.
(unlock_file_handle_error): New function, call
`userlock--handle-unlock-error' with the captured error.
(unlock_file): Handle `file-error' conditions by calling the handler
defined above.
* test/src/filelock-tests.el (filelock-tests-kill-buffer-spoiled):
(filelock-tests-unlock-spoiled): Modify to test new behavior.
Michael Albinus [Fri, 26 Mar 2021 18:30:05 +0000 (19:30 +0100)]
Improve remote file notifications
* lisp/net/tramp-sh.el (tramp-get-remote-gio-file-monitor): Remove it.
(tramp-sh-handle-file-notify-add-watch): Do not call it.
(tramp-sh-gio-monitor-process-filter): Read monitor name.
* test/lisp/filenotify-tests.el (file-notify--test-read-event)
(file-notify--test-timeout): Change timings.
(file-notify--test-monitor): Read remote monitor name more reliably.
(file-notify-test02-rm-watch): Retrieve remote monitor name in time.
(file-notify--test-event-actions): New defun.
(file-notify--test-with-actions-explainer): Use it.
(file-notify--test-with-actions-check): Use it. Dump traces in
case of debug.
(file-notify--test-with-actions): Don't stop while debugging.
(file-notify-test03-events, file-notify-test04-autorevert)
(file-notify-test05-file-validity)
(file-notify-test07-many-events, file-notify-test08-backup)
(file-notify-test09-watched-file-in-watched-dir): Adapt tests.
Address some --without-x byte-compilation warnings
These came to light in the contexts of bug#29713 and bug#47234.
* lisp/emulation/edt-mapper.el (edt-xserver):
* lisp/emulation/edt.el (edt-xserver):
* lisp/gnus/gnus-util.el (gnus-rescale-image):
* lisp/gnus/nnimap.el (nnimap-map-port):
* lisp/term/w32-win.el:
* lisp/image.el (image--get-imagemagick-and-warn):
* lisp/frame.el (frame-notice-user-settings): Declare functions that
are known to be present at runtime in GUI builds.
(make-frame-on-display): Signal more informative error when called
interactively in a non-GUI build (bug#29713).
* lisp/international/mule-diag.el (describe-font):
* lisp/org/org-macs.el (org--string-from-props): Pacify warnings
about unknown functions in non-GUI bilds.
* lisp/mh-e/mh-mime.el (mh-small-image-p): Avoid eliminating fboundp
check in non-GUI builds, to pacify unused lexical variable warning.
* lisp/net/newst-plainview.el (newsticker--plainview-tool-bar-map):
* lisp/net/newst-treeview.el (newsticker-treeview-tool-bar-map):
Declare tool-bar-map as a special variable in non-GUI builds.
Stefan Monnier [Fri, 26 Mar 2021 15:45:31 +0000 (11:45 -0400)]
* lisp/obsolete/tpu-extras.el: Avoid defadvice
(tpu--respect-bottom-scroll-margin): New function, extracted from
`newline`s defadvice.
(newline, newline-and-indent, do-auto-fill): Delete defadvice.
(tpu-set-scroll-margins): Use advice-add instead of
`ad-enable-advice`+`ad-activate`.
Use an explicit arg instead of `called-interactively-p`.
Spencer Baugh [Wed, 24 Mar 2021 03:11:51 +0000 (23:11 -0400)]
Add a test for let-binding unwinding
Bindings in other buffers are not un-set when we unwind a let-binding
which set the default value. There doesn't seem to be an existing
test which covers this, so here's one.
* test/src/data-tests.el (data-tests--let-buffer-local-no-unwind-other-buffers):
Add test for let-binding unwinding behavior
Stefan Monnier [Thu, 25 Mar 2021 15:57:58 +0000 (11:57 -0400)]
* lisp/htmlfontify.el: Fix misuses of `nconc`
(hfy-face-to-style-i): `this` is not known to be fresh.
(hfy--size-to-int): Rename from `hfy--size-to-int` and return just the
integer without wrapping it in a list.
(hfy-flatten-style): Avoid O(n²) problems. Use `float`.