Torsten Hilbrich [Mon, 14 Dec 2020 08:48:26 +0000 (09:48 +0100)]
Use when where else case returns nil
* lisp/net/dictionary-connection.el (dictionary-connection-status,
dictionary-connection-close): Instead of returning nil in the else case
of the if just use when.
Use defsubst instead of defmacro here. It was suggested by Stefan
Kangas to replace the defmacro here and, looking at the lispref,
defsubst seems to be a suitable replacement providing the same
benefit of inlining functionality as the defmacro.
Torsten Hilbrich [Thu, 19 Nov 2020 20:40:45 +0000 (21:40 +0100)]
Removed useless check for popup-menu
* lisp/net/dictionary.el (dictionary-popup-matching-words): No need to
check for popup-menu, the code is part of Emacs now and the function
should always be there
Torsten Hilbrich [Thu, 19 Nov 2020 07:25:42 +0000 (08:25 +0100)]
Move placement of dictionary-tooltip-mouse-event
* lisp/net/dictionary.el (dictionary-tooltip-mouse-event): Place
variable before dictionary-display-tooltip to avoid warning about use of
free variable when compiling dictionary-display-tooltip
Torsten Hilbrich [Thu, 19 Nov 2020 07:23:07 +0000 (08:23 +0100)]
Support nil value for dictionary-server
* net/lisp/dictionary.el (dictionary-server): Support choice to select
the dictionary server to use
* net/lisp/dictionary.el (dictionary-check-connection): Support nil
value for dictionary-server
This nil value is the new default value of that variable. When
opening a new connection and dictionary-server is nil the code
behaves the following way:
- it will first try to connect to a dictd server running on localhost
- if that fails, it queries the user if the alternative
server (dict.org) should be consulted
- if the user agrees, the connection is made to dict.org
This allows the default value of dictionary-server not to connect
a remote server by default. The user is always able to select a
different server by customizing the variable dictionary-search.
Torsten Hilbrich [Sat, 10 Oct 2020 05:04:27 +0000 (07:04 +0200)]
Fix dictionary tooltip mode
* lisp/net/dicionary.el (dictionary-tooltip-mode): Add mouse movement
binding and use tooltip-functions instead of tooltip-hook
There were some changes in Emacs since testing it the last time. I had
to add keybinding for mouse movement and enable track-mouse to get the
mode working again.
* net/lisp/dictionary.el (dictionary-display-dictionary-line): Allow
getting more details on a dictionary by clicking the "(Details)" link.
I had the functionality to query the dictionary information but no
mechanism to invoke it. So just add a button after the short description
of the dictionary to get more information.
* net/lisp/dictionary-link.el: Removed now obsolete file
* net/lisp/dictionary.el: Use insert-button and make-button
* net/lisp/dictionary.el (dictionary-mode-map): Now defined using defvar
I had to add a conversion function as parameter for the button 'action
as I need to be able to pass nil data to my function. This is not
possible with the regular button 'action function and the 'button-data
value.
The functionality of searching a link in all dictionaries has been
removed for now. It might appear again once I have an idea how to
implement it.
* lisp/net/dictionary.el (dictionary-coding-systems-for-dictionaries):
Don't check for coding-system-list before using it. It check no longer
be necessary.
* lisp/net/link.el: Renamed to connection-link.el, also prefixing all
functions with "dictionary-" prefix
* lisp/net/dictionary.el: Adapt to renamed functions
* lisp/net/connection.el: Renamed to dictionary-connection.el, also
prefixing all functions with "dictionary-" prefix
* lisp/net/dictionary.el: Adapt to renamed functions
Eli Zaretskii [Wed, 7 Oct 2020 08:35:59 +0000 (11:35 +0300)]
Fix last change in frame.el.
* lisp/frame.el (frame-set-background-mode): Fix last change: yet
another place where FRAME was not taken into account, using the
selected frame instead. (Bug#43837)
Update documentation on this-command-keys to reflect new behavior
* doc/lispref/commands.texi (Command Loop Info):
`this-command-keys' does not include the C-u any more, so remove
that from the description and the example
(bug#22107).
* src/keyboard.c (Fthis_single_command_keys): Don't say that
`this-command-keys' returns the C-u prefix (bug#22111).
Make artist-mode work when display-line-numbers-mode is on
* lisp/textmodes/artist.el (artist--adjust-x): New function.
(artist-mouse-draw-continously, artist-mouse-draw-poly)
(artist-mouse-draw-1point, artist-mouse-draw-2points): Use it to
take `display-line-numbers-mode' widths into account.
Mauro Aranda [Wed, 7 Oct 2020 02:35:52 +0000 (04:35 +0200)]
Make the State button in Custom use extended menus
* lisp/cus-edit.el (custom-actioned-widget): New variable.
Dynamically hold the widget for which to show the menu.
(custom-variable-extended-menu, custom-face-extended-menu)
(custom-group-extended-menu): Keymap menus for the State menu. Use
custom-actioned-widget for the :enable and :selected forms. Make
related items radio buttons. (Bug#4787)
(custom-variable-menu, custom-face-menu, custom-group-menu): Keep for
backward compatibility, but default to nil, so we prefer the keymap
menus instead.
(custom-variable-action, custom-face-action, custom-group-action):
Pass the keymap menu to widget-choose when the simplified menus
are nil.
Juri Linkov [Tue, 6 Oct 2020 20:14:26 +0000 (23:14 +0300)]
Add match-data to isearch state and repeat faces to highlight group matches
* lisp/isearch.el (isearch-match-data): New variable.
(isearch-mode): Set isearch-match-data to nil.
(isearch-update): Call isearch-highlight with isearch-match-data.
(isearch--state): Add isearch-match-data.
(isearch--set-state): Restore isearch-match-data.
(with-isearch-suspended): Preserve isearch-match-data.
(isearch-search): Set isearch-match-data to integers.
(isearch-group-1): Rename from isearch-group-odd and adjust colors.
(isearch-group-2): Rename from isearch-group-even and adjust colors.
(isearch-highlight): Add optional arg 'match-data'.
Rewrite search-highlight-submatches part to recycle faces.
* doc/emacs/search.texi (Search Customizations): Amend the
documentation for isearch-group faces.
* lisp/international/mule-util.el (truncate-string-ellipsis):
Use Unicode hex escapes instead of named escapes here, because \N{...}
is not available during bootstrapping. (Bug#41250)
Harald Jörg [Tue, 6 Oct 2020 01:39:55 +0000 (03:39 +0200)]
cperl-mode: Fix a test to ensure cperl-mode is active
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-mode-test-indent-exp): Make sure that cperl-mode is active
for testing 'cperl-indent-exp', also skip this test under
perl-mode.
* test/lisp/progmodes/cperl-mode-resources/cperl-indent-exp.pl:
Eliminate dependency on unrelated customizable variables (bug#10483).
* doc/lispref/display.texi (Size of Displayed Text): Improve
wording and accuracy of the documentation of
'truncate-string-to-width'. Document the function
'truncate-string-ellipsis'.
* etc/NEWS: Improve the wording of the entry for
'truncate-string-to-width'.
Stefan Monnier [Mon, 5 Oct 2020 02:50:38 +0000 (22:50 -0400)]
* src/xdisp.c (syms_of_xdisp): New var `redisplay_skip_initial_frame`.
This makes it possible to run most of the redisplay code (tho not the
actual drawing since there's nowhere to draw) even when there's no
real frame at hand, as is the case in batch mode.
This makes `xdisp-tests--minibuffer-resizing` work even in batch.
(redisplay_internal): Obey it.
(init_xdisp): Set `echo_area_window` even in noninteractive mode.
* src/dispnew.c (update_frame): Skip the initial frame.
* src/frame.c (make_frame): Use 80x25 as the default initial size.
* test/src/xdisp-tests.el (xdisp-tests--minibuffer-resizing):
Use the new var and fix use of `executing-kbd-macro`.
Juri Linkov [Sun, 4 Oct 2020 19:41:36 +0000 (22:41 +0300)]
Use '…' for ellipsis in truncate-string-to-width by default (bug#41250)
* lisp/international/mule-util.el (truncate-string-ellipsis):
Change the default value to nil.
(truncate-string-ellipsis): New function.
(truncate-string-to-width): Use the value returned from the
function 'truncate-string-ellipsis'.
* lisp/tab-bar.el (tab-bar-tab-name-truncated):
* lisp/tab-line.el (tab-line-tab-name-ellipsis):
Take advantage of the improvement of the ellipsis default value
in truncate-string-to-width and truncate-string-ellipsis.
* doc/lispref/display.texi (Size of Displayed Text):
Improve description of truncate-string-ellipsis.
Eli Zaretskii [Sat, 3 Oct 2020 17:49:18 +0000 (20:49 +0300)]
Avoid segfaults in lookup_image when faces were freed
* src/image.c (lookup_image): Make sure the frame's face cache
exists and has at least the basic faces. If FACE_ID is not a
basic face, and is no longer cached, fall back on the 'default'
face. (Bug#43700)
* etc/NEWS: Document the feature (bug#4787).
* lisp/wid-edit.el (widget--simplify-menu): New function, to convert
extended menus into simplified menus when using the menu to prompt
through the minibuffer.
(widget-choose): Accept a keymap menu. When not using x-popup-menu,
simplify the menu with widget--simplify-menu. Document the changes in
the docstring.
Alan Mackenzie [Fri, 2 Oct 2020 21:21:06 +0000 (21:21 +0000)]
Enhance syntax-tests.el to test comments in parse-partial-sexp
This now tests the interface between parse-partial-sexp and the low level
comment function in syntax.c
* test/src/syntax-tests.el (syntax-comments-midpoint): New function.
(syntax-pps-comments): New macro.
(top level): Two new syntax-br-comments tests and five new syntax-pps-comments
tests.
* test/data/syntax-comments.txt (top level): Amend some test fragments and add
some more.
Calc: fix formatting and parsing Unix time (bug#43759)
The number of days from epoch to Jan 1, 1970 that was used in parsing
and formatting Unix time was incorrect. The previous fix
(in e368697ce36) was incomplete.
Reported by Vincent Belaïche.
* lisp/calc/calc-forms.el (math-unix-epoch): New constant.
(math-format-date-part, math-parse-standard-date, calcFunc-unixtime):
Use math-unix-epoch instead of a constant that is sometimes wrong.
* test/lisp/calc/calc-tests.el (calc-unix-date): New test.
Alan Mackenzie [Fri, 2 Oct 2020 17:25:02 +0000 (17:25 +0000)]
Enhance syntax-tests.el to test comments in scan-lists
This now tests the interface between scan_lists and the comment functions.
* test/src/syntax-tests.el (syntax-br-comments): New macro.
({-in, ;-in, /*-in): Set parse-sexp-ignore-comments to t.
(top level): Add 15 tests for comments inside brace lists.
* test/data/syntax-comments.txt (top level): Amend some test fragments.
Glenn Morris [Fri, 2 Oct 2020 16:33:53 +0000 (09:33 -0700)]
Merge from origin/emacs-27
2af6b3147d Clarification in Tramp manual 8fbaca7d41 Check Emacs version used for Tramp compilation 90e5549f02 Don't signal an error when saving files on WdebDAV volumes 6f73cc3579 ; * lisp/net/eww.el (eww-search-words): Doc fix. ce0842a165 * lisp/hi-lock.el (hi-lock-find-patterns): Autoload it. (...
* lisp/ebuff-menu.el (electric-buffer-list): Ensure that point is
restored, which isn't always the case if
global-display-line-numbers-mode (bug#43755). This enables
selecting buffers again.
Stefan Monnier [Fri, 2 Oct 2020 10:34:37 +0000 (10:34 +0000)]
CC Mode: Convert the handling of c-special-indent-hook to standard usage
* lisp/progmodes/cc-styles.el (c-set-style): Use kill-local-variable rather
than copying the hook's global value to the local binding.
(c-make-styles-buffer-local): Remove redundant make-variable-buffer-local.
Robert Pluim [Fri, 2 Oct 2020 08:47:06 +0000 (10:47 +0200)]
Don't error if no GPG signing key configured
* lisp/gnus/mml-sec.el (mml-secure-epg-sign): Partially revert
"Make mml-secure-epg-sign bug out if we can't find an identity".
It causes signing to fail for people who have not set up
mml-secure-{smime,openpgp}-sign-with-sender, which is a regression
from Emacs-26 (Bug#40118). In such a situation gpg will use its
default key.
Do not merge to master. On master Emacs will query the user.
The calculation of business days was broken in 2012 (probably 310e60d9454fe2 or thereabouts) when the date representation changed
epoch so that Jan 1, 1 AD became day number 1 instead of 0. Repair
this, along with an unrelated bug that prevented arbitrary holiday
weekdays from working.
Reported by Aaron Zeng.
* lisp/calc/calc-forms.el (math-to-business-day)
(math-from-business-day): Correct calculation of weekdays using Calc's
current (Rata Die) chronology. Modify loop condition to cope with odd
sets of holiday weekdays.
* test/lisp/calc/calc-tests.el (calc-business-days): New test.
* lisp/ebuff-menu.el (electric-buffer-list): Ensure that point is
restored, which isn't always the case if
global-display-line-numbers-mode (bug#43755). This enables
selecting buffers again.
* lisp/progmodes/python.el (python-shell-send-statement): Don't
send a cookie, because that leads to the naked expression not
being evaled (bug#43450).
(python-shell-send-region): Allow not sending a cookie.
(python-shell-buffer-substring): Ditto.
Stop using a dynamically bound 'generated-autoload-file' variable
* doc/lispref/loading.texi (Autoload): Document change of name
(bug#39823).
* lisp/emacs-lisp/autoload.el (autoload-find-generated-file): Pass
the file name in.
(autoload-generated-file): Ditto.
(autoload-file-load-name): Ditto.
(generate-file-autoloads): Ditto.
(autoload--setup-output): Ditto.
(autoload-generate-file-autoloads): Ditto, and alter doc string to
reflect when `generated-autoload-file' is heeded.
(update-file-autoloads): Pass outfile in to functions.
(autoload-find-destination): Ditto.
(update-directory-autoloads): Make into an obsolete shim around
`make-directory-autoloads'.
(make-directory-autoloads): Renamed from
`update-directory-autoloads' with new semantics.
(batch-update-autoloads): Adjust caller.
Tino Calancha [Thu, 1 Oct 2020 21:33:56 +0000 (23:33 +0200)]
Fix wdired-do-perm-changes when over Tramp
* lisp/wdired.el (wdired-do-perm-changes) Use set-file-modes
instead of external program (bug#39284). This fixes the problem
of passing the wrong argument to the external chmod.
Juri Linkov [Thu, 1 Oct 2020 19:17:40 +0000 (22:17 +0300)]
Use new faces isearch-group-odd and isearch-group-even (bug#43702)
* lisp/isearch.el (isearch-group-odd, isearch-group-even): New faces
instead of isearch-group-1 .. isearch-group-9.
(isearch-highlight): Use new faces.
* lisp/progmodes/sql.el (sql-add-product): Re-correct argument
spec. Previous change was due to my mistake; I have
resolved back to the prior behavior (Bug#39960).
* test/lisp/progmodes/sql-tests.el (sql-test-add-product): Added
test to insure I don't make the same mistake again.