1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00
Commit Graph

74800 Commits

Author SHA1 Message Date
Robert Cochran
97f24412e7 Add hooks for after tab open, before close, and to prevent closing
* lisp/tab-bar.el (tab-bar-tab-post-open-functions,
tab-bar-tab-prevent-close-functions, tab-bar-tab-pre-close-functions):
New defcustoms
(tab-bar-new-tab-to, tab-bar-close-tab): Use new defcustoms
2019-12-08 00:23:29 +02:00
Jackson Ray Hamilton
8e1c553260
Ignore comments and strings when matching JSX
* lisp/progmodes/js.el (js-jsx--matching-close-tag-pos): Ignore
comments and strings.
* test/manual/indent/jsx-comment-string.jsx: New test.
2019-12-07 13:18:00 -08:00
Jackson Ray Hamilton
c299c9b6fb
; * lisp/progmodes/js.el: Fix typo 2019-12-07 13:18:00 -08:00
Jackson Ray Hamilton
3d21ba374f
; * lisp/progmodes/js.el: Remove unnecessary concat 2019-12-07 13:18:00 -08:00
Alan Mackenzie
68d4a14fd4 CC Mode: Allow most functions on post-self-insert-hook to be called
This contrasts with the previous state where no such functions got called.
This fixes bug #38406.

* lisp/progmodes/cc-cmds.el (c--unsafe-post-self-insert-hook-functions): New
variable.
(c--call-post-self-insert-hook-more-safely-1): New function.
(c--call-post-self-insert-hook-more-safely): New macro.
(c-electric-pound, c-electric-brace, c-electric-slash, c-electric-star)
(c-electric-semi&comma, c-electric-colon, c-electric-lt-gt, c-electric-paren):
Invoke c--call-post-self-insert-hook-more-safely (which calls most of the hook
post-self-insert-hook) at the end of each of the commands.
2019-12-07 18:55:19 +00:00
Michael Albinus
959bbf3003 Add unload code to tramp-integration.el
* lisp/net/tramp-integration.el (info-lookup->mode-cache)
(info-lookup->topic-cache, info-lookup-alist): Declare.
(ido, ivy, info-look): Adapt `tramp-integration-unload-hook'.
2019-12-07 13:40:04 +01:00
Eli Zaretskii
c574d27464 Fix documentation of '-position' server command
* lisp/server.el (server-process-filter): Fix the description
of "-position" command to match the reality.  (Bug#38443)
2019-12-07 11:50:14 +02:00
Andrii Kolomoiets
89a4488f89 Ensure buffer is alive in python-pdbtrack-unset-tracked-buffer
* lisp/progmodes/python.el (python-pdbtrack-unset-tracked-buffer):
Check if buffer `python-pdbtrack-tracked-buffer' is alive.
(Bug#38413)
2019-12-07 11:40:57 +02:00
Eli Zaretskii
937031a555 Remove duplicate macros from ses.el
* lisp/ses.el (1value, noreturn): Macros deleted, as we
nowadays have them in subr.el.  (Bug#38514)
2019-12-07 09:27:24 +02:00
Michael Albinus
99ad65eda4 Configure info-look.el to recognize Tramp symbols
* lisp/net/tramp-integration.el (info-lookup->cache)
(info-lookup->mode-value, info-lookup->other-modes)
(info-lookup->topic-value, info-lookup-maybe-add-help)
(info-lookup-cache): Declare.
(info-look): Configure info-look.el to recognize Tramp symbols.
2019-12-06 19:28:01 +01:00
Eli Zaretskii
30eac47981 Clarify documentation of functions that use the default face
* lisp/simple.el (default-font-height, default-font-width)
(default-line-height): Say in the doc strings that the default
face these functions use is for the currently selected frame.

* doc/lispref/display.texi (Attribute Functions)
(Low-Level Font): Document more clearly the dependence of the
results of 'face-font', 'default-font-width', and
'default-font-height' on the frame's definition of the default
face.
2019-12-06 17:43:26 +02:00
Thierry Volpiatto
48373e7540
Merge branch 'completion-first-difference_face' 2019-12-06 08:01:26 +01:00
Thierry Volpiatto
4095a006fd
Fix setting completions* faces in
`completion-pcm--hilit-commonality` so that these faces doesn't
override possible already existing faces in other UIs.

* lisp/minibuffer.el (completion-pcm--hilit-commonality): Use
`add-face-text-property` instead of `put-text-property`.
2019-12-06 07:22:57 +01:00
Paul Eggert
4c93307715 2019-12-05 regexp lint fixes
* lisp/org/org-agenda.el (org-agenda-filter):
Fix unescaped literal ‘+’ in regexp.  Reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-12/msg00215.html
* lisp/org/org.el (org-clone-subtree-with-time-shift):
Fix a regexp typo that mishandled strings like ‘\1d’,
reported by the same emaikl.
* lisp/progmodes/verilog-mode.el (verilog-inject-inst):
Omit unnecessary ‘?’ in regexp.  Reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-12/msg00217.html
2019-12-05 19:32:12 -08:00
Eli Zaretskii
21790e5473 Minor copyedits of 'jit-lock-antiblink-grace's docs
* lisp/jit-lock.el (jit-lock-antiblink-grace):
* etc/NEWS (value): Reword the NEWS entry and the doc string.
2019-12-05 17:43:06 +02:00
Federico Tedin
3586fef263 Make HIST arg of read-from-minibuffer work with buffer-local vars
* lisp/simple.el (minibuffer-history-values): New function, should be
used to access the minibuffer input history variable when the
minibuffer might be active.  If the variable is buffer-local, the
previous buffer's value will be used.
(goto-history-element): Use the new function to access the minibuffer
history.
(minibuffer-history-isearch-wrap): Use the new function to access the
minibuffer history.
* src/minibuf.c (read_minibuf): Switch to previous buffer temporarily
before updating history list (Bug#38317).
(read-from-minibuffer): Extend documentation to mention that the
result of using the command will be added to the history list by
default.
* doc/lispref/minibuf.texi (Minibuffer History): Mention the
possibility of using a buffer-local variable as history.
* etc/NEWS: Announce changes.
2019-12-05 10:30:28 +01:00
Paul Eggert
ab612302b4 Fix regex repetition of repetitions
Problems reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-12/msg00066.html
* lisp/gnus/gnus-util.el (gnus-emacs-version):
* lisp/mail/rfc2368.el (rfc2368-mailto-regexp):
* lisp/net/tramp-sh.el (tramp-sh-inotifywait-process-filter):
* lisp/obsolete/terminal.el (te-parse-program-and-args):
* lisp/org/org-table.el (org-table-wrap-region):
* lisp/progmodes/verilog-mode.el (verilog-inject-inst):
Avoid repetition-of-repetition in regexp.
2019-12-04 16:54:24 -08:00
Juri Linkov
bd95d66ae9 * lisp/tab-line.el: Cache the tab-line-format template.
(tab-line-format): Cache the result of tab-line-format-template in window.
(tab-line-format-template): New function that returns the value to cache.
2019-12-05 01:08:24 +02:00
Juri Linkov
f336ae77cc * lisp/windmove.el (windmove-display-new-tab): New command.
(windmove-display-default-keybindings): Bind it to '?t'.
(windmove-display-in-direction): Call tab-bar-new-tab when 'dir' is 'new-tab'.
2019-12-05 01:03:45 +02:00
Juri Linkov
1e4c6f8333 * lisp/tab-bar.el (tab-bar-get-buffer-tab): Move code closer to its use. 2019-12-05 01:00:53 +02:00
Juri Linkov
67815c6bf2 * lisp/tab-bar.el (switch-to-buffer-other-tab): Use display-buffer-in-tab.
(tab-bar--tab): Use float-time instead of integer.
This improves correct detection of recent tabs switched within 1 sec.
(tab-bar--current-tab, tab-bar--current-tab-index)
(tab-bar--tab-index, tab-bar--tab-index-by-name)
(tab-bar--tab-index-recent): Add optional arg FRAME.
(tab-bar-move-tab-to-frame): Add with-selected-frame for tab-bar-close-tab.
(tab-bar--reusable-frames): New function.
(tab-bar-get-buffer-tab): Add index to the found tab.
(display-buffer-in-tab): Use `tab-name' entry instead of `name'.
Add `reusable-frames' entry.  (bug#38354)
2019-12-05 00:56:54 +02:00
João Távora
5b45c269cd New jit-lock-antiblink-grace feature
* lisp/jit-lock.el (jit-lock-antiblink-grace): New defcustom.
(jit-lock--antiblink-line-beginning-position)
(jit-lock--antiblink-string-or-comment): New variables
(jit-lock--antiblink-post-command): New helper.
(jit-lock-mode): Tweak post-command-hook and
jit-lock-context-timer.

* etc/NEWS: Mention jit-lock-antiblink-grace
2019-12-04 23:38:06 +01:00
Juanma Barranquero
9ef873629b * lisp/doc-view.el (doc-view-doc-type): Doc fix. 2019-12-04 15:15:20 +01:00
Mattias Engdegård
f5672b24a8 Don't use the return value of 'push'
Although 'push' returns the modified list, it isn't actually
documented to do so, so don't rely on it.

* lisp/emacs-lisp/rx.el (rx--translate-any): Add progn.
2019-12-04 11:37:26 +01:00
Juanma Barranquero
8fb773cc91 Silence warnings in Org 9.3
* lisp/org/ob-eshell.el (eshell-send-input): Declare.
(eshell-last-output-start, eshell-last-output-end)
(eshell-last-input-end): Defvar.

* lisp/org/org-keys.el (cl-lib): Require.
(org-CUA-compatible): Move up defvaralias.
2019-12-04 07:05:14 +01:00
Glenn Morris
94c5eeb1fd ; Fix copyright years and license notices for recent org files 2019-12-03 17:19:14 -08:00
Juri Linkov
8f2267c87b * lisp/tab-bar.el (tab-bar-move-tab-to-frame): New command (bug#38354)
(tab-bar-tabs, tab-bar--tab): Add optional arg FRAME.
(tab-bar-get-buffer-tab): Funcall tab-bar-tabs-function with arg FRAME
instead of using with-selected-frame.
2019-12-04 01:33:36 +02:00
Stefan Monnier
54f9acd7c9 * lisp/gnus/message.el (message-sendmail-envelope-from): Fix typo
Reported by David Edmondson <dme@dme.org>.
2019-12-03 18:10:37 -05:00
Bastien
165f738382 Update Org to 9.3 2019-12-03 23:27:04 +01:00
Stefan Monnier
821de96843 (message-sendmail-envelope-from): Obey mail-envelope-from even if set later
* lisp/gnus/message.el (message-sendmail-envelope-from): Change default.
(message--sendmail-envelope-from): New function.
(message-sendmail-envelope-from): Use it.
* lisp/mail/emacsbug.el (report-emacs-bug): Use it.
2019-12-03 15:38:48 -05:00
Stefan Monnier
8bea7e9ab4 * lisp/minibuffer.el (completion-pcm--optimize-pattern): New function
This fixes bug#38458 where a final `point` in the pattern prevented
the expected normal behavior of point moving after the completion
of the final implicit `any`.

(completion-pcm--find-all-completions)
(completion-substring--all-completions): Use it.
(completion-basic--pattern): Don't both removing "" any more.
(completion-basic-try-completion): Use it as well as
`completion-basic--pattern`.
2019-12-03 09:45:48 -05:00
Mattias Engdegård
a6b598518c Avoid duplicated character classes in rx
For example, (any digit digit) should produce "[[:digit:]]",
not "[[:digit:][:digit:]]".

* lisp/emacs-lisp/rx.el (rx--translate-any): Deduplicate character classes.
* test/lisp/emacs-lisp/rx-tests.el (rx-any): Add test case.
2019-12-03 15:17:37 +01:00
Juri Linkov
9a911b4af5 New functions window-state-buffers and tab-bar-get-buffer-tab (bug#38354)
* lisp/window.el (window-state-buffers): New function.
* lisp/tab-bar.el (tab-bar-get-buffer-tab): New function.

* lisp/emacs-lisp/seq.el (seq-some): Add autoload cookie.

* lisp/desktop.el (desktop-buffers-not-to-save-function): New variable.
(desktop-save-buffer-p): Use it.
2019-12-03 01:40:12 +02:00
Juanma Barranquero
91762e49e1 Don't save/restore font-backend in framesets (bug#38442)
* lisp/frameset.el (frameset-persistent-filter-alist):
Add :never filter for `font-backend'.
2019-12-02 19:19:13 +01:00
Juanma Barranquero
9c0ac88199 ibuf-ext.el: Fix previous change
* lisp/ibuf-ext.el (ibuffer-generate-filter-groups): Use
`cl-destructuring-bind' instead of `cl-multiple-value-bind', as we
don't want to assume how multiple-values are implemented, and we
know a list is being returned anyway.  Suggested by Stefan Monnier.
2019-12-02 01:38:31 +01:00
Dmitry Gutov
3dd7de625f * lisp/vc/diff-mode.el (diff-context): Set 'extend t' (bug#37774). 2019-12-02 01:33:41 +02:00
Mattias Engdegård
9f2145f42d Temporary enable transient-mark-mode for rectangle selection
* lisp/mouse.el (mouse-drag-region-rectangle):
Enable transient-mark-mode during selection (bug#38431).
2019-12-01 18:32:43 +01:00
Glenn Morris
8b5c5a9a9b ; Auto-commit of loaddefs files. 2019-12-01 06:27:14 -08:00
Michael Albinus
ec65b9adbe Suppress superfluous messages in tramp-tests
* test/lisp/net/tramp-tests.el (tramp-test10-write-region)
(tramp-test10-write-region-file-precious-flag)
(tramp-test34-connection-local-variables)
(tramp-test36-vc-registered): Let-bind `inhibit-message'.
2019-12-01 12:25:15 +01:00
Juanma Barranquero
eb452dfe95 ibuffer-mark-by-content-regexp: don't depend on `cl-some'
* lisp/ibuf-ext.el (ibuffer-mark-by-content-regexp): Use `cl-dolist'
instead of `cl-some' to avoid a run-time dependency on cl-lib that
triggers an unreported bug similar to bug#38430.
2019-12-01 10:41:49 +01:00
Juanma Barranquero
f22501185e ibuffer-do-isearch: don't depend on `cl-values-list' (bug#38430)
* lisp/ibuf-ext.el (ibuffer-generate-filter-groups): Don't call
`cl-values-list'.  Our implementation of that function just
checks that its argument is a list, and then returns it.  In
this specific case, the argument is guaranteed to be a list.
2019-12-01 10:13:06 +01:00
Mattias Engdegård
293eb32598 Improved mouse rectangle selection robustness (bug#38013)
Make the rectangular selection work better with
display-line-numbers-mode and side-by-side windows.
Also make the mouse track the text cursor in a consistent way.

* lisp/mouse.el (mouse--rectangle-track-cursor): Added constant.
(mouse-drag-region-rectangle): Take the line-number width into
account, and use window-relative columns.  Track either the cursor or
rectangle corner with more care.
2019-11-30 22:43:00 +01:00
Juri Linkov
dfbbbf319e * lisp/tab-line.el (tab-line-auto-hscroll): Don't let-bind buffer-local values
Use setq to set buffer-local values of truncate-lines and buffer-undo-list.
This will prevent leaking of let-bound values to buffer-local values
of the minibuffer.
2019-11-30 23:42:37 +02:00
Juri Linkov
df89d6d6dc * lisp/gnus/gnus-win.el (gnus-configure-frame): Check for window-live-p.
* doc/misc/gnus.texi (Tabbed Interface): New node.  (bug#37998)
2019-11-30 23:36:52 +02:00
Juri Linkov
54c792ece6 * lisp/subr.el: Add discard-input to more functions.
* lisp/subr.el (read-char-from-minibuffer-insert-other)
(y-or-n-p-insert-other): Use discard-input in case of user mistake.
(do-after-load-evaluation): Add discard-input before calling 'message',
so in case of the active minibuffer, calling minibuffer-message will allow
sit-for to wait the complete timeout, because discard-input will discard
all initial events that prevent sit-for from waiting during startup.
https://lists.gnu.org/archive/html/emacs-devel/2019-11/msg00581.html
2019-11-30 23:33:41 +02:00
Alan Mackenzie
757e66afdc CC Mode. Fix fontification bug with unterminated quotes on adjacent lines
In particular, with these unterminated quotes on each of two adjacent lines,
the following text was spuriously fontified with string face.

* lisp/progmodes/cc-defs.el
(c-search-backward-char-property-with-value-on-char): New macro.

* lisp/progmodes/cc-mode.el (c-clear-string-fences): Check whether there is an
unmatched quote at a lower buffer position which should match the current
quote, rather than wrongly assuming the latter is unmatched and marking it
with a punctuation syntax.
(c-font-lock-fontify-region): Ensure all pertinent parts of the buffer have
string fence properties applied before performing any syntactic operations on
it; in particular, this applies to a quote at an earlier buffer position which
"matches" one inside the region about to be fontified.
2019-11-30 21:26:00 +00:00
Juri Linkov
3c278b4999 * lisp/image.el: Support image scaling with mouse in other buffer.
* lisp/image.el (image-increase-size, image-decrease-size):
Add optional arg position.
(image-mouse-increase-size, image-mouse-decrease-size):
Use '(point-marker)' for arg position.
(image--get-image): Use get-char-property from position if non-nil,
and its buffer.
(image--get-imagemagick-and-warn, image--change-size):
Add optional arg position.
2019-11-30 23:21:00 +02:00
Juri Linkov
d64ea182fb Use run-with-idle-timer instead of debounce for responsive image scaling.
* lisp/emacs-lisp/timer.el (debounce, debounce-reduce): Revert macro addition.
https://lists.gnu.org/archive/html/emacs-devel/2019-11/msg01133.html

* lisp/image.el (image-increase-size, image-decrease-size):
Use run-with-idle-timer.
(image--change-size): Rename back from image--change-size-function.

* lisp/image-mode.el (image-mode--setup-mode): Remove hooks
window-size-change-functions and window-selection-change-functions (bug#32672)
(image-fit-to-window): Rename from image--window-change-function.
(image--window-state-change): Rename from image--window-change.
Use run-with-idle-timer.
2019-11-30 23:16:03 +02:00
Juanma Barranquero
9ac78ef56c Fix compilation warning in vc-hg.el
* lisp/vc/vc-hg.el (vc-read-revision): Declare.
2019-11-30 13:41:30 +01:00
Andrii Kolomoiets
561840b553 vc-hg: prompt for branch to merge
* lisp/vc/vc-hg.el (vc-hg-merge-branch): Prompt for revision to merge.
(vc-hg-revision-table): Use branches, tags and bookmarks as competion
candidates.

* etc/NEWS: Mention changes of vc-hg.el

* doc/emacs/maintaining.texi (Switching Branches): Mention 'hg update'
command.
(Merging): Mention 'hg merge' command.

This fixes bug#22860
2019-11-30 14:00:16 +02:00