Eli Zaretskii [Sun, 3 May 2020 13:53:53 +0000 (16:53 +0300)]
Improve accuracy of apropos commands that search doc strings
It is conceptually wrong for apropos commands that search doc
strings to look for matches of several words only on the same
line, because division of doc strings between lines is
ephemeral.
* lisp/apropos.el (apropos-parse-pattern): Accept an optional
argument MULTILINE-P, and if that is non-nil, produce regexps that
match words in the list even if they are separated by line
boundaries.
(apropos-value, apropos-local-value, apropos-documentation): Use
the new optional argument in apropos commands that search
multiline text, such as doc strings.
* src/search.c (Fposix_looking_at, Fposix_string_match)
(Fposix_search_backward, Fposix_search_forward): Make sure Posix
appears in the doc strings near REGEXP, for better matches.
Michael Albinus [Sun, 3 May 2020 11:59:08 +0000 (13:59 +0200)]
Improve Tramp debug messages
* lisp/net/tramp-cache.el (tramp-get-file-property)
(tramp-get-connection-property): Improve debug messages.
Suggested by Marc Herbert <marc.herbert@gmail.com>.
Stefan Kangas [Sat, 2 May 2020 20:41:20 +0000 (22:41 +0200)]
Improve Info-mode doc and menu
* lisp/info.el (Info-mode-menu): Re-arrange to be more logical, move
items into submenus, add 'Info-directory' and separators.
(Info-mode): Add 'end-of-buffer' to doc string. (Bug#39042)
Michael Albinus [Sat, 2 May 2020 10:48:55 +0000 (12:48 +0200)]
;; Revert recent change in tramp-cache.el
* lisp/net/tramp-cache.el (tramp-dump-connection-properties):
Remove compatibility code dumping the persistency file. Use
`emacs-lisp-mode' for backward compatibility.
Eli Zaretskii [Sat, 2 May 2020 08:45:05 +0000 (11:45 +0300)]
Fix 'count-screen-lines' when lines are truncated
* lisp/window.el (count-screen-lines): Fix the return value when
lines are truncated in the window, and the end of the region is
invisible due to this truncation. (Bug#40849)
João Távora [Fri, 1 May 2020 12:24:56 +0000 (13:24 +0100)]
Consolidate lisp/jsonrpc.el logging in single events buffer
For inferior processes having useful stderr, it is no longer
cumbersome to switch between different buffers to correlate error
messages with transport-level JSONRPC messages.
The existing stderr and stdout buffers can still be found hidden away
from the normal buffer list.
An original idea of Tobias Rittweiler <trittweiler@gmail.com>.
* lisp/jsonrpc.el (initialize-instance jsonrpc-process-connection):
Setup after-change functions stderr buffer. Hide stderr and stdout
buffers.
(jsonrpc--log-event): Don't output extra newline. Tweak log format.
(Version): Bump to 1.0.10
* lisp/bookmark.el (bookmark-insert-file-format-version-stamp)
(save-place-alist-to-file): Delimit file-local variables on the -*-
line with semicolons.
* lisp/files.el (auto-mode-alist): Use shy regexp group.
Alan Mackenzie [Fri, 1 May 2020 12:23:15 +0000 (12:23 +0000)]
Protect non-selected face spec components in custimize-face. Fixes bug #40866
* lisp/cus-edit.el (custom-face-save): If the current face widget is only
displaying part of the face spec, temporarily set it to "display" the whole
spec around the call to custom-face-mark-to-save.
João Távora [Sat, 18 Apr 2020 01:46:04 +0000 (02:46 +0100)]
Add lisp-data-mode for editing non-code Lisp data
Fixes: bug#40573
The new mode can be used stand-alone or inherited from by modes
intended to edit programs. The existing emacs-lisp-mode and lisp-mode
are examples.
Thanks to Juri Linkov and Basil L. Contovounesios for researching some
data files in Emacs that can be automatically set to use the new mode.
* lisp/files.el (auto-mode-alist): Add entry for ".dir-locals" and
".dir-locals-2"
* lisp/emacs-lisp/lisp-mode.el: (lisp-data-mode): New major mode.
(lisp-mode): Inherit from lisp-data-mode. Set special lisp-mode
stuff here.
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Inherit from
lisp-data-mode.
* lisp/bookmark.el (bookmark-insert-file-format-version-stamp):
Use lisp-data-mode.
* lisp/saveplace.el (save-place-alist-to-file): Use
lisp-data-mode.
* lisp/net/eww.el (eww-write-bookmarks): Use lisp-data-mode.
* lisp/net/nsm.el (nsm-write-settings): Use lisp-data-mode.
* lisp/net/tramp-cache.el (tramp-dump-connection-properties): Use
lisp-data-mode.
* etc/NEWS: Mention lisp-data-mode.
* doc/lispref/modes.texi (Example Major Modes): Update example.
* lisp/calculator.el (calculator-string-to-number): Convert decimal
numbers input to float, fixing a regression introduced in f248292ede.
Reported by Aitor Soroa.
Stephen Gildea [Wed, 29 Apr 2020 14:36:07 +0000 (07:36 -0700)]
Test iso8601-parse-zone vs format-time-string %z
* test/lisp/calendar/iso8601-tests.el
(iso8601-format-time-string-zone-round-trip): New unit test that
format-time-string %z and iso8601-parse-zone are inverses.
(test-iso8601-format-time-string-zone-round-trip): New helper function.
Juri Linkov [Tue, 28 Apr 2020 23:49:44 +0000 (02:49 +0300)]
* lisp/isearch.el: Fix lazy-highlighting and lazy-counting of hidden matches
* lisp/isearch.el (isearch-lazy-highlight-search): Let-bind
search-invisible to t when search-invisible is 'open' or when both
isearch-lazy-count and search-invisible are non-nil. (Bug#40808)
Eli Zaretskii [Tue, 28 Apr 2020 08:57:16 +0000 (11:57 +0300)]
Avoid crashes on TTY frames with over-long compositions
* src/term.c (encode_terminal_code): Each character from an
automatic composition is a multibyte character, so its multibyte
representation can take up to MAX_MULTIBYTE_LENGTH bytes.
Account for that when allocating storage for characters to be
encoded. (Bug#40913)
Paul Eggert [Mon, 27 Apr 2020 22:46:37 +0000 (15:46 -0700)]
Improve multibyte_length performance
* src/character.h (multibyte_length):
Merge tests so that there are fewer conditional branches.
This improved CPU speed of ‘make compile-always’
by about 1.5% on my platform.
Paul Eggert [Sun, 26 Apr 2020 22:18:49 +0000 (15:18 -0700)]
Improve string_char_and_length speed
This tweak improved the CPU time performance of
‘make compile-always’ by about 1.7% on my platform.
* src/character.c (string_char): Remove; no longer used.
* src/character.h (string_char_and_length): Redo so that it
needn’t call string_char. This helps the caller, which can now
become a leaf function.
Michael Albinus [Sun, 26 Apr 2020 09:39:40 +0000 (11:39 +0200)]
Make shell-command tests fit for tcsh.
* test/lisp/simple-tests.el (with-shell-command-dont-erase-buffer):
Fix debug spec. Format command to run also under tcsh.
(simple-tests-shell-command-39067)
(simple-tests-shell-command-dont-erase-buffer): Quote newline in string.
Paul Eggert [Sat, 25 Apr 2020 23:17:25 +0000 (16:17 -0700)]
Inline a couple of functions that were macros
This reclaims a bit of performance when compiling with gcc -Og.
These functions were macros until I changed them in
2020-04-17T14:57:25Z!eggert@cs.ucla.edu.
* src/casefiddle.c (make_char_unibyte):
* src/ccl.c (GET_TRANSLATION_TABLE): Now inline.
45a64c97c7 (origin/emacs-27) Clarify semantics of trace-function CONT... 821760fdc4 Don't let a code literal get modified in mml parsing (Bug#... 74a92be16d * lisp/simple.el (kill-ring-save): Doc fix. (Bug#40797) 3d0e859692 Minor doc clarification regarding fringe bitmaps 4d86c7f822 Fix documentation of fringe bitmaps a76af88dd8 Tweak mutability doc a bit more f7e488d206 Calc: fix autoload errors (bug#40800) 369761b36d ; * src/xdisp.c: Improve the introductory commentary. a92ca1f177 Improve indexing of ELisp manual 5a25d17760 * lisp/image-mode.el (image-transform-resize): Remove FIXM... 37ebec3a95 Improve the default value of 'doc-view-ghostscript-program'. ba6104d1e8 Change doc-view-mode-map prefix key 's' to 'c'. 400ff5cd19 Improve wording about constants d2836fe71b Improve the default value of 'doc-view-ghostscript-program'. fc55f65305 Minor improvements in documentation of the last change a64da75961 Add image-auto-resize defcustoms to image-mode.el 692ad40539 Improve the documentation of tab-bar and tab-line
Eli Zaretskii [Sat, 25 Apr 2020 13:37:46 +0000 (16:37 +0300)]
Fix GDI+ image loading by file name
Without a call to image_find_image, we can get a file name that
is relative to data-directory/images/, or a file name that
starts with "~/", in which case w32_load_image would fail.
* src/image.c (native_image_load): Call image_find_image_file to
resolve and encode the image file name.
* src/w32image.c (w32_load_image): No need to encode the file
name, as it's already encoded by native_image_load.
* lisp/calc/calc-ext.el (calc-init-extensions):
Remove calc-kbd-report key binding and autoload; it was removed in 2005.
calc-keypad-x-{left,right,middle}-click were renamed to
calc-keypad-{left,right,middle}-click in 2001; fix the autoloads.
calc-twos-complement-mode is a variable, not a function; remove the
autoload.
* lisp/calc/calc-prog.el: Remove commented-out calc-kbd-report.
Alan Mackenzie [Fri, 24 Apr 2020 15:51:43 +0000 (15:51 +0000)]
Fix bug #40766, an error in edebug spec handling
Also remove some debris.
* lisp/emacs-lisp/edebug.el (edebug-spec): Move the entry for edebug-spec-list
to before that for vector in the &or form. This assures that in a dotted list
of vectors, that list gets handled correctly by edebug-spec-list rather than
wrongly by (vector ...).
(def-edebug-spec &key): Remove, since it is ill formed and superfluous.
Improve the default value of 'doc-view-ghostscript-program'.
* lisp/doc-view.el (doc-view-ghostscript-program): Use plain command
name instead of qualified name returned by executable-find (as
suggested by Stefan Monnier). (Bug#36357)
Eli Zaretskii [Thu, 23 Apr 2020 15:40:42 +0000 (18:40 +0300)]
Fix display of composed text with :box face attribute
* src/xdisp.c (get_next_display_element): For a composition on a
display or overlay string, set the end_of_box_run_p flag if the
string ends at the last character included in the composition.
(fill_gstring_glyph_string): Fix the way the width of a gstring
glyph string is calculated: use the values calculated in
gui_produce_glyphs, since the latter adjusts the width due to the
face's ':box' attribute.
* src/xterm.c (x_draw_glyph_string_box):
* src/w32term.c (w32_draw_glyph_string_box):
* src/nsterm.m (ns_dumpglyphs_box_or_relief): Support automatic
compositions, which have the right_box_line_p flag set on the last
glyph produced from the composition. (Bug#40687)
* src/w32term.c (w32_compute_glyph_string_overhangs): Update to be
consistent with xterm.c in its support of automatic composition
glyph strings.
* src/dispextern.h (enum glyph_type): More accurate commentary.
* src/.gdbinit (pgx): Display slice.img members only for image
glyphs.
Paul Eggert [Thu, 23 Apr 2020 02:00:08 +0000 (19:00 -0700)]
text-char-description minor cleanup
* src/keymap.c (push_text_char_description): Omit useless code.
(Ftext_char_description): Minor code cleanup, inspired by
seeing an incorrect comment about MAX_MULTIBYTE_LENGTH’s value.
Paul Eggert [Thu, 23 Apr 2020 01:58:45 +0000 (18:58 -0700)]
Tweak multibyte parsing loops
* src/character.c (parse_str_as_multibyte, str_as_multibyte):
Let the fast loop run a little longer, fixing what appears
to be an off-by-1 performance nit.
Paul Eggert [Wed, 22 Apr 2020 17:42:09 +0000 (10:42 -0700)]
Improve wording about constants
Thanks to Štěpán Němec and Drew Adams for reviews of recent changes.
* doc/lispref/eval.texi (Quoting): Give an example.
* doc/lispref/lists.texi (Association Lists): Simplify example code.
* doc/lispref/objects.texi (Lisp Data Types)
(Constants and Mutability): Clarify wording.
* lisp/net/tramp-smb.el (tramp-smb-conf): Fix docstring.
(tramp-smb-options): New defcustom.
(tramp-smb-handle-copy-directory, tramp-smb-handle-file-acl)
(tramp-smb-handle-set-file-acl, tramp-smb-maybe-open-connection):
Use it.