Commit graph

77133 commits

Author SHA1 Message Date
Lars Ingebrigtsen
d23e483cfb Tweak how shortdocs are displayed
* lisp/emacs-lisp/shortdoc.el (shortdoc-example): Removed.
(shortdoc-section): Remove colors.
(shortdoc-separator): New face.
(shortdoc-display-group, shortdoc--display-function): Don't use
background colours, because that makes things harder to read.
Separate with a horizontal line instead.
2020-10-26 19:15:36 +01:00
Mattias Engdegård
27910f4e96 Revert "Don't consider play-sound-file to be a 'safe' function (bug#44018)"
This reverts commit cdb3c9d662.
2020-10-26 17:10:06 +01:00
Mattias Engdegård
cdb3c9d662 Don't consider play-sound-file to be a 'safe' function (bug#44018)
While there are currently no known security holes in play-sound-file,
the attack surface is considerable and historically audio file
processing has had more than its share of security problems; the
benefit to risk ratio is low.

* lisp/emacs-lisp/unsafep.el: Don't mark play-sound-file as safe.
2020-10-26 12:40:51 +01:00
Stefan Kangas
a98bb620c4 Add section "Replacing Match" to the regexp shortdoc group
* lisp/emacs-lisp/shortdoc.el (regexp): New section "Replacing Match".
2020-10-25 19:18:27 +01:00
Stefan Kangas
158d2a1f50 Remove some Emacs 19 compat code and references
* lisp/progmodes/sql.el:
* lisp/mh-e/mh-show.el (mh-display-msg): Remove Emacs 19 compat code.
* lisp/emacs-lisp/edebug.el (edebug-mark-marker): Make into
obsolete alias for mark-marker.
(edebug--display-1, edebug-bounce-point)
(edebug-outside-excursion): Adjust callers.
* lisp/net/snmp-mode.el:
* lisp/forms.el: Remove references to Emacs 19.
(forms-use-text-properties): Doc fix.
2020-10-25 18:27:19 +01:00
Eli Zaretskii
8164f3e1ab Improve support for shaping Egyptian Hieroglyphs
* src/composite.c (composition_gstring_lookup_cache): Renamed from
gstring_lookup_cache and made external.  All callers changed.
* src/composite.h (composition_gstring_lookup_cache): Add
prototype.
* src/font.c (Ffont_shape_gstring): Call
composition_gstring_lookup_cache and return the cached composition
if it is already in the cache.

* lisp/language/misc-lang.el (egyptian-shape-grouping): New
function.
(composition-function-table): Use egyptian-shape-grouping in
setting up compositions for Egyptian Hieroglyphs.  Fix the
composition setup for horizontal and vertical joiners.
2020-10-25 18:05:37 +02:00
Lars Ingebrigtsen
35df337979 Fix syntax error in message-add-openpgp-header
* lisp/gnus/message.el (message-add-openpgp-header): Remove
redundant (and syntactically wrong) check.
2020-10-25 15:16:05 +01:00
Lars Ingebrigtsen
b0a7a19d5d Fix problem when replacing the final char in checkdoc
* lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-ask-replace):
Ensure that the end-of-doc-string marker is really at the end,
even if we replace the final " char in the string (bug#44201).
2020-10-25 14:34:47 +01:00
Stefan Kangas
10ea719abc Add shortdoc group for alist
* lisp/emacs-lisp/shortdoc.el (alist): New shortdoc group.
2020-10-25 01:40:52 +02:00
Stefan Kangas
b6a41c76a5 Add shortdoc group for hash-table
* lisp/emacs-lisp/shortdoc.el (hash-table): New shortdoc group.
2020-10-25 00:53:17 +02:00
Mauro Aranda
c3835bd380 Warn about a bad default value in restricted-sexp widget
* lisp/wid-edit.el (restricted-sexp widget): New :value-to-external
function.  If value is not in the internal format, then we might be
dealing with a bad default value for the widget, so display a warning
about that (bug#25152).
2020-10-24 21:40:42 +02:00
Stefan Kangas
dd16e46bb9 ; Prefer https to http in more URLs
These were all tested and confirmed working.
2020-10-24 20:23:27 +02:00
João Távora
10e7c76ee3 Rework semantics of eldoc-echo-are-use-multiline-p
Per bug#43543.  Now uses logical lines, not visual lines.

* lisp/emacs-lisp/eldoc.el (eldoc-echo-area-use-multiline-p): Rework
semantics.
(eldoc--echo-area-substring): New helper.
(eldoc--echo-area-prefer-doc-buffer-p): New helper.
(eldoc-display-in-echo-area): Rework using new helpers.
2020-10-24 18:02:28 +01:00
João Távora
77c3928425 Rename ElDoc user option controlling display of truncation notice
The new name makes it consistent with other variables controlling the
display of ElDoc documentation in the echo area.

Per bug#43543.

* etc/NEWS (Eldoc): Rename eldoc-display-truncation-message to
eldoc-echo-area-display-truncation-message.

* lisp/emacs-lisp/eldoc.el
(eldoc-echo-area-display-truncation-message): Rename from
eldoc-display-truncation-message.
(eldoc-display-in-echo-area): Use new variable name.
2020-10-24 18:02:28 +01:00
João Távora
5daa6a6a03 Rework eldoc-echo-area-prefer-doc-buffer (bug#42532)
* lisp/emacs-lisp/eldoc.el:
(eldoc-echo-area-prefer-doc-buffer): Rename from
eldoc-echo-area-prefer-doc-buffer
(eldoc-display-in-echo-area): Rework to honour
eldoc-echo-area-prefer-doc-buffer.
2020-10-24 18:02:28 +01:00
João Távora
4c543a724f Introduce eldoc-display-functions
See bug#43609.

* lisp/emacs-lisp/eldoc.el (eldoc--request-state): Add comment.
(eldoc--last-request-state): No longer buffer-local.
(eldoc--request-docs-p): Delete.
(eldoc-display-functions): New user variable.
(eldoc--doc-buffer-docs): New variable.
(eldoc-display-message-p): Rework.
(eldoc--format-doc-buffer): Rework from eldoc--handle-docs.
(eldoc-display-in-echo-area, eldoc-display-in-buffer): New
user-visible function.
(eldoc--invoke-strategy): Take INTERACTIVE arg.
Invoke eldoc-display-in-buffer
(eldoc-print-current-symbol-info): Simplify.
(Version): Bump to 1.11.0

* etc/NEWS: Mention eldoc-display-functions.
2020-10-24 18:02:28 +01:00
Basil L. Contovounesios
8c2382d309 ; Fix last change 2020-10-24 15:50:16 +01:00
Stefan Kangas
97267d2bf1 Re-introduce variable for world clock timer
* lisp/time.el (world-clock--timer): New variable.
(world-clock): Save timer to above variable when it is started.
(world-clock-cancel-timer): Delete timer saved in variable instead of
searching for the function name.
2020-10-24 15:49:20 +02:00
Stefan Kangas
6f92674ce8 Use lexical-binding in several language support libraries
* lisp/language/burmese.el:
* lisp/language/cham.el:
* lisp/language/czech.el:
* lisp/language/georgian.el:
* lisp/language/greek.el:
* lisp/language/khmer.el:
* lisp/language/romanian.el:
* lisp/language/sinhala.el:
* lisp/language/slovak.el:
* lisp/language/tai-viet.el:
* lisp/language/vietnamese.el: Use lexical-binding.
2020-10-24 15:34:52 +02:00
Michael Albinus
95553309ef Accept nil COMMAND in tramp-sh-handle-make-process (Bug#44151)
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Accept nil
COMMAND.  (Bug#44151)

* test/lisp/net/tramp-tests.el (tramp-test29-start-file-process):
Extend test.
2020-10-24 14:36:34 +02:00
Stefan Kangas
6dfcb4d4dc Revert "Use lexical-binding in bindat.el"
This reverts commit a497b8e4a4.

This conversion to lexical-binding broke the eval specification,
documented in the ELisp manual.  We will probably want to add tests
for that before we can confidently convert this to lexical-binding.
Problem reported by Mattias Engdegård <mattiase@acm.org>.
2020-10-24 14:26:46 +02:00
Stefan Kangas
f378d65e5e Use lexical-binding in most term libraries
* lisp/term/AT386.el:
* lisp/term/internal.el:
* lisp/term/iris-ansi.el:
* lisp/term/lk201.el:
* lisp/term/news.el:
* lisp/term/rxvt.el:
* lisp/term/sun.el:
* lisp/term/tvi970.el:
* lisp/term/wyse50.el: Use lexical-binding.
2020-10-24 14:18:47 +02:00
Stefan Kangas
9f1dd2a7d5 Use lexical-binding in copyright.el and add tests
* lisp/emacs-lisp/copyright.el: Use lexical-binding.  Remove
redundant :group args.
* test/lisp/emacs-lisp/copyright-tests.el: New file.
2020-10-24 13:35:49 +02:00
Jared Finder
2c487c47c8 Fix a bug where the wrong menu would be triggered by mouse
For layouts such as the following, clicking the "l" in Tools with the
right window focused would trigger the File menu, not the Tools menu.
This is because the event would have window coordinate (1 . 0).
Similarly, clicking the "p" in Help would trigger the Edit menu.

Example Emacs frame:
+--------------------------------------------------------+
|File Edit Options Buffers Tools Help                    |
|;; This buffer is for text$|;; This buffer is for text $|
|;; To create a file, visit$|;; To create a file, visit $|
|                           |                            |
|                           |                            |
|-UUU:----F1  *scratch*     |-UUU:----F1  *scratch*      |
|                                                        |
+--------------------------------------------------------+
* lisp/menu-bar.el (menu-bar-open-mouse): Reject clicks not on
the menu bar.
*lisp/xt-mouse.el (xterm-mouse-event): Pass the current frame to
'posn-at-x-y', to make the effect consistent with other mouse-handling
features.
2020-10-24 13:26:56 +03:00
Jared Finder
92d37029a7 Enable TTY menus with xterm-mouse-mode
* lisp/tmm.el: No need to bind 'tmm-menubar-mouse' to mouse clicks
on the menu bar.
* lisp/menu-bar.el (global-map): Bind 'menu-bar-open-mouse' to
mouse click on menu bar.  This is needed in xt-mouse.

* etc/NEWS: Announce TTY menu support in xterm-mouse-mode.
2020-10-24 13:22:55 +03:00
Jared Finder
0695c9e859 Make TTY menus work with xterm-mouse-mode
* src/term.c (mouse_get_xy): Call 'mouse_position' passing it the
value of 'tty-menu-calls-mouse-position-function' as the
argument.
(syms_of_term) <tty-menu-calls-mouse-position-function>: New
DEFVAR_BOOL.
* src/frame.c (mouse_position): New function, with most of the
code from Fmouse_position, but call 'mouse-position-function' only
if called with non-zero argument.
(Fmouse_position): Call 'mouse_position' to do the job.

* lisp/xt-mouse.el (xterm-mouse-translate-1): Respect
'track-mouse'.
(xterm-mouse-mode): Set 'tty-menu-calls-mouse-position-function'
when setting 'mouse-position-function'.
(xterm-mouse-tracking-enable-sequence): Use SET_ANY_EVENT_MOUSE
(0x1003) so that mouse movement can be reported even if no buttons
are pressed.  Doc fix.
* lisp/menu-bar.el (menu-bar-define-mouse-key): New function.
(tty-menu-navigation-map): Call it.

* doc/lispref/frames.texi (Mouse Position): Document
'tty-menu-calls-mouse-position-function'.

* etc/NEWS: Announce 'tty-menu-calls-mouse-position-function'.
2020-10-24 13:14:27 +03:00
Jared Finder
9d230684ff Adding mouse controls to menu-bar.el.
* lisp/isearch.el (tmm-menubar-keymap): Remove declare-function.
* lisp/menu-bar.el (menu-bar-open-mouse, menu-bar-keymap)
(menu-bar-current-active-maps, menu-bar-item-at-x): New functions.
*lisp.tmm.el (tmm-menubar-keymap, tmm-get-keybind): Functions
deleted.
(tmm-menubar): Call 'menu-bar-item-at-x'.
2020-10-24 12:33:52 +03:00
Michael Albinus
46f5d2867c Fix error in tramp-sh-handle-make-process
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Don't use heredoc
script whent the argument contains a string.
2020-10-23 16:31:56 +02:00
Eli Zaretskii
d21cdb6c05 Set up composition-function-table for Egyptian
* lisp/language/misc-lang.el (composition-function-table): Set up
for Egyptian Hieroglyphs.
2020-10-23 17:23:23 +03:00
Olivier Certner
944c470835 ERC: Fix ERC's IBuffer format "crash" on killed server buffer
* lisp/erc/erc-ibuffer.el (erc-server-name): Fix a crash when
displaying (or updating) an IBuffer buffer using ERC's first IBuffer
format.  This happens when one ERC buffer has its associated server
buffer killed, e.g., voluntarily or automatically after server
disconnection when `erc-kill-server-buffer-on-quit' is set to t.  The
culprit is the "Server" column, which returns nil in this case.
Display "(closed)" instead (bug#44156).
Copyright-paperwork-exempt: yes
2020-10-23 14:54:31 +02:00
Ruthra Kumar
ead957a2c3 Add support for squashfs files in archive mode
* lisp/arc-mode.el (archive-squashfs-extract): New variable
(bug#43827).
(archive-find-type): Identify squashfs.
(archive-squashfs-summarize, archive-squashfs-extract-by-stdout):
New functions to parse/extract squashfs.

* lisp/files.el (auto-mode-alist): Add squashfs.
2020-10-23 14:54:31 +02:00
Mattias Engdegård
c57a60ee95 Use lexical binding in ffap.el
* lisp/ffap.el (ffap-search-backward-file-end): Remove binding for
variable shadowing an optional (and never used) argument.
(ffap--gopher-var-on-line): Remove unused variable.
2020-10-23 11:15:19 +02:00
Stefan Kangas
dc8bffba5a * lisp/emacs-lisp/pcase.el: Add "extensions" to keyword header. 2020-10-23 05:26:40 +02:00
Stefan Kangas
558065531b Merge branch 'scratch/substitute-command-keys' 2020-10-23 00:33:23 +02:00
Andreas Schwab
b572308fbf eww: don't add keymap to <a> without href
* lisp/net/eww.el (eww-tag-a): Only add keymap if the href
attribute is present.  (Bug#44147)
2020-10-22 20:13:24 +02:00
Mattias Engdegård
30dba74e77 ; * lisp/progmodes/fortran.el: Call 'eval' with lexical binding. 2020-10-22 18:31:31 +02:00
Mattias Engdegård
a090e5fe08 Remove useless uses of bindat-get-field
* lisp/progmodes/gdb-mi.el (gdb-var-list-children-handler)
(gdb-edit-register-value): bindat-get-field with a single argument is
identity; remove.
2020-10-22 18:29:06 +02:00
Stefan Kangas
997ebf91dd Use lexical-binding in time-date.el and expand tests
* lisp/calendar/time-date.el: Use lexical-binding.
* test/lisp/calendar/time-date-tests.el
(test-obsolete-with-decoded-time-value)
(test-obsolete-encode-time-value, test-format-seconds)
(test-days-to-time, test-seconds-to-string): New tests.
(test-days-in-month, test-time-since, test-time-decoded-period):
Expand test with a few more values.
2020-10-22 17:33:29 +02:00
Mauro Aranda
8dffe61a9c Make State button interaction less confusing
* lisp/cus-edit.el (custom-variable-current-value): New function.
(custom-variable-backup-value): Use it.
(custom-variable-set, custom-variable-mark-to-reset-standard): Check
that old value is different than the new one.  If it is, make a
backup.  This way, we avoid offering the Set to Backup Value
unnecesarily.
(custom-variable-reset-saved): Reset the variable-comment property for
the variable, to help custom-variable-state be more correct.  Also
check if we should backup old value.
(custom-variable-state): If a variable was set to the standard value,
say its state is standard rather than set, which is more correct.
Getting the right variable state is important for menu options to be
enabled/disabled, and for displaying the right message to the user
(bug#12864).
2020-10-22 16:55:19 +02:00
Robert Pluim
d5fdb1b1f6 ; fix docstring typo in last commit 2020-10-22 16:49:50 +02:00
Lars Ingebrigtsen
5d152ed737 Use HTTP instead of Tramp for the ffap rfc path (and also fix it)
* lisp/ffap.el (ffap-rfc-path): Use an URL instead of an FTP tramp
file, since that's more widely supported (bug#41663).
2020-10-22 15:36:59 +02:00
Lars Ingebrigtsen
45c1be62a1 Comment JSX lines using JSX syntax
* lisp/progmodes/js.el (js-jsx--comment-region): New function
(bug#41696).
(js-jsx-mode): Use it.
2020-10-22 15:22:05 +02:00
Mauro Aranda
5215067c4e Pretty print restricted sexp values too
* lisp/wid-edit.el (restricted-sexp widget): Use
widget-sexp-value-to-internal to pretty print the widget's value, when
it is a valid one (bug#7524).
2020-10-22 14:30:24 +02:00
Mauro Aranda
c009a0a6f7 Allow moving members of editable-list widget, via delete+insert
* etc/NEWS (Widget): Announce the feature (bug#6419).
* lisp/wid-edit.el (widget-editable-list-delete-at): Save into a new
widget property, :last-deleted, the WIDGET to be deleted.  Add
docstring.
(widget-editable-list-insert-before): If there is a recently deleted
child for the editable list, insert that one, instead of a new default
widget.  Add docstring.
(insert-button widget): Make :help-echo a function to avoid the
help-echo string become too long.
(delete-button widget): Tweak the :help-echo string, to document this
behavior.

* test/lisp/wid-edit-tests.el (widget-test-moving-editable-list-item):
Test the feature.
2020-10-22 13:52:42 +02:00
Mattias Engdegård
701ed2e4ed Use lexical binding in fortran.el
* lisp/progmodes/fortran.el: Use lexical binding.
(fortran-make-syntax-propertize-function): Hoist use of lexical
variable to outside the 'eval' call.
2020-10-22 12:18:16 +02:00
Mattias Engdegård
3479390c4c * lisp/progmodes/cpp.el: Use lexical binding. 2020-10-22 11:46:09 +02:00
Štěpán Němec
8dc8ab6b42 unload-feature: Correct doc string to match info manual and reality
'unload-feature' doesn't try to "undo any additions the library has
made" to hooks, it tries to remove functions defined by the library
from hooks, no matter how they got there.

* lisp/loadhist.el (unload-feature): Correct the doc string.
* doc/lispref/loading.texi (Unloading): Clarify, fix typo.
2020-10-21 18:51:12 +02:00
Štěpán Němec
5c266a71c1 unload-feature: Handle local hooks (bug#5293)
Buffer-local hooks were introduced in

1994-09-30T20:47:13+00:00!rms@gnu.org
0e4d378b32 (add-hook): Initialize default value and local value.

but 'unload-feature' has not been updated to handle them.

* lisp/loadhist.el (unload-feature): Handle local hooks (bug#5293).
2020-10-21 18:51:12 +02:00
Štěpán Němec
0e9e36747f unload-feature: Improve logic (don't repeat computation)
* lisp/loadhist.el (unload-feature): Don't do the same computation twice.
2020-10-21 18:51:12 +02:00
Mattias Engdegård
4bd8add2e3 Convert artist.el to lexical binding
* lisp/textmodes/artist.el (artist-system, (artist-flood-fill):
Remove binding of the obsolete variables binary-process-input,
binary-process-output and input-queue.
(artist-down-mouse-1): Fix mistyped 'echo-keystrokes'; bind it to 0.
(artist-fill-rect, artist-fill-square, artist-pen-set-arrow-points)
(artist-spray-clear-circle, artist-spray-set-radius)
(artist-draw-ellipse-with-0-height, artist-fill-ellipse)
(artist-ff-is-topmost-line, artist-ff-is-bottommost-line)
(artist-set-arrow-points-for-2points, artist-key-undraw-continously)
(artist-key-undraw-poly, artist-key-undraw-1point)
(artist-key-undraw-2points, artist-key-do-continously-1point)
(artist-key-set-point-1point, artist-shift-has-changed)
(artist-mouse-draw-continously, artist-mouse-draw-1point)
(artist-submit-bug-report): Suppress warnings about unused parameters
which are there for function signature commonality.  Remove unused
variables.
2020-10-21 18:23:43 +02:00