Paul Eggert [Mon, 12 Nov 2018 06:18:47 +0000 (22:18 -0800)]
Fix dumping on GNU/Linux ppc64le
Problem reported by Thomas Fitzsimmons (Bug#33174).
* src/emacs.c (main): Adjust to sysdep.c changes.
* src/sysdep.c (exec_personality): New static var.
(disable_address_randomization): Remove, replacing with ...
(maybe_disable_address_randomization): ... this new function.
Do not set or use an environment variable; use a command-line
argument instead, and set the new static var. Migrate the emacs.c
personality-change code to here, where it belongs.
(emacs_exec_file): Simplify by using new static var.
Paul Eggert [Sun, 11 Nov 2018 17:58:29 +0000 (09:58 -0800)]
Pacify gcc -Wunused-macros in older GnuTLS
I ran into this problem on Ubuntu 18.04.1 LTS.
* src/gnutls.c (HAVE_GNUTLS_CIPHER_GET_IV_SIZE)
(HAVE_GNUTLS_CIPHER_GET_TAG_SIZE, HAVE_GNUTLS_DIGEST_LIST):
New macros. This uses the same style as the other
macros that depend on GnuTLS version, as opposed to trying
to do things a bit more cleverly.
(gnutls_cipher_get_iv_size, gnutls_cipher_get_tag_size)
(gnutls_digest_list, gnutls_digest_get_name):
Define these macros only if they will be used.
Eli Zaretskii [Sat, 10 Nov 2018 20:14:42 +0000 (22:14 +0200)]
Make 'move-file-to-trash' behave according to the documentation
* lisp/files.el (move-file-to-trash): Behave like the doc
string says: check whether 'system-move-file-to-trash' is
defined before testing that 'trash-directory' is non-nil.
(Bug#33335)
Paul Eggert [Sat, 10 Nov 2018 17:00:43 +0000 (09:00 -0800)]
Dissociate controlling tty better on Darwin
* src/process.c (dissociate_controlling_tty): New function.
(create_process): Use it to dissociate controlling tty if setsid
fails, which happens on Darwin after a vfork (Bug#33154).
Do this on all platforms, not just on Darwin, as a similar
problem is plausible elsewhere.
* src/callproc.c (call_process): Use the new function here, too,
for consistency and to avoid duplicate code.
* lisp/net/tramp.el (tramp-get-local-gid):
Use `group-name' if available.
(tramp-debug-message):
* lisp/net/tramp-cmds.el (tramp-bug): Report also
`tramp-repository-branch' and `tramp-repository-version'.
* lisp/net/trampver.el (tramp-repository-branch)
(tramp-repository-version): New defconst.
(tramp-repository-get-version): Remove.
Allen Li [Thu, 25 Oct 2018 02:44:01 +0000 (20:44 -0600)]
Add 'ring-resize' function
* lisp/emacs-lisp/ring.el (ring-resize): New function. (Bug#32849)
* doc/lispref/sequences.texi (Rings): Document new function 'ring-resize'.
* etc/NEWS: Document new function 'ring-resize'.
* test/lisp/emacs-lisp/ring-tests.el (ring-test-ring-resize): New tests.
Eli Zaretskii [Sat, 10 Nov 2018 09:16:17 +0000 (11:16 +0200)]
Fix last change
* src/editfns.c (Fgroup_name): Fix the doc string. Move
closer to the "group" functions.
* src/w32.c (getgrgid): Return NULL if GID is not the group ID
of the user of this Emacs session
* test/src/editfns-tests.el (test-group-name): Rename from
'group-name'. Add tests for non-Posix hosts. Test error when
the argument to group-name is invalid.
* lisp/bookmark.el (bookmark-jump-other-frame): New function.
Bind in bookmark-map.
(bookmark-bmenu-other-frame): New function.
Bind in bookmark-bmenu-mode-map.
Juri Linkov [Wed, 7 Nov 2018 22:52:50 +0000 (00:52 +0200)]
Support VC single file operations from Dired (bug#32596).
* lisp/vc/vc.el (vc-ensure-vc-buffer): Use dired-get-filename for dired-mode.
Move error-checking outside of the last branch of cond.
(vc-dired-deduce-fileset): Remove unused error signaling.
* lisp/vc/log-view.el (log-view-find-revision)
(log-view-annotate-version): Add condition to signal an error
when log-view-vc-fileset contains a directory.
Use user-error instead of error.
* lisp/dired.el (dired-get-file-for-visit):
* lisp/locate.el (locate-do-setup):
Use user-error instead of error.
Juri Linkov [Wed, 7 Nov 2018 22:27:58 +0000 (00:27 +0200)]
* lisp/files-x.el (modify-dir-local-variable): Use assoc-delete-all
instead of assq-delete-all for cases when mode is a subdirectory name.
(dir-locals-to-string): Call pp-to-string and string-trim-right
on values. (Bug#32817)
Juri Linkov [Mon, 5 Nov 2018 21:11:30 +0000 (23:11 +0200)]
Support lazy-highlight-buffer in Info (bug#29321, bug#29360).
* lisp/isearch.el (isearch-lazy-highlight-point-min)
(isearch-lazy-highlight-point-max): New variables.
(isearch-lazy-highlight-new-loop): When lazy-highlight-buffer is
non-nil, compare (point-min) with isearch-lazy-highlight-point-min,
and (point-max) with isearch-lazy-highlight-point-max, for buffers
like Info where narrowing changes the values point-min and point-max.
Glenn Morris [Sun, 4 Nov 2018 17:37:03 +0000 (09:37 -0800)]
Merge from origin/emacs-26
bd1d617 Avoid race in rcirc process filter (bug#33145) 88ef31a Avoid file-name errors when viewing PDF from Gnus c939042 Avoid crashes with remapped default face in Org mode 97660fa Doc fix for checkdoc-continue 96f055b Fix a typo in autoload.el
Michael Albinus [Sun, 4 Nov 2018 11:51:39 +0000 (12:51 +0100)]
Fix Bug#33194
* lisp/autorevert.el (auto-revert-notify-add-watch):
Handle buffers with same descriptor properly.
(auto-revert-notify-handler): Handle all buffers with same
descriptor. (Bug#33194)
Martin Rudalics [Sun, 4 Nov 2018 08:15:13 +0000 (09:15 +0100)]
Rewrite documentation of buffer display
* doc/emacs/windows.texi (Window Choice): Rewrite, replacing
references to older buffer display options with references to
and examples of buffer display actions.
(Temporary Displays): Rewrite display of *Completions*
example.
* doc/lispref/elisp.texi (Top): New Windows section
'Displaying Buffers'.
* doc/lispref/frames.texi (Child Frames): Adjust cross
reference.
* doc/lispref/windows.texi (Windows): New section 'Displaying
Buffers'. Move sections 'Choosing Window', 'Display Action
Functions' and 'Choosing Window Options' there and adjust
namings. Preferably write 'Buffer Display Action' instead of
'Display Action'. More consistently use @w{} to make key
binding specifications unsplittable.
(Displaying Buffers): New section.
(Choosing Window): Make it a subsection of 'Displaying
Buffers'. More explicitly describe how 'display-buffer'
compiles its list of action functions and the action alist.
(Buffer Display Action Functions): Rename from 'Display Action
Functions', make it a subsection of 'Displaying Buffers' and
rewrite it. Elide more detailed descriptions of action alist
entries; these are now in the new section 'Buffer Display
Action Functions'. Remove example.
(Buffer Display Action Alists): New subsection of 'Displaying
Buffers' giving a comprehensive description of recognized
action alist entries with appropriate indexing. Contents were
partially moved here from the old 'Display Action Functions'
section.
(Choosing Window Options): Make it a subsection of 'Displaying
Buffers'. Add examples of how to rewrite old buffer display
options with the help of buffer display actions.
(Precedence of Action Functions): New subsection of
'Displaying Buffers' explaining the execution order of action
functions with the help of a detailed example.
(The Zen of Buffer Display): New subsection of 'Displaying
Buffers' supplying guidelines on how to write and use buffer
display actions with examples.
(Side Windows, Displaying Buffers in Side Windows)
(Frame Layouts with Side Windows, Atomic Windows): Update
references to the 'Displaying Buffers' subsections.
Paul Eggert [Sat, 3 Nov 2018 20:11:26 +0000 (13:11 -0700)]
Improve time error reporting
* src/timefns.c (emacs_mktime_z): Remove; no longer needed.
(time_error): New function, replacing invalid_time.
All callers changed.
(decode_float_time, decode_ticks_hz, decode_time_components):
Return an error number instead of merely a boolean.
All callers changed.
(decode_lisp_time): Signal an error based on the error number,
instead of merely returning a boolean to the caller.
All callers changed.
(format_time_string, Fdecode_time, Fencode_time)
(Fcurrent_time_string):
Do not assume that a failure of a system time function
must be due to time overflow.
(Fencode_time): Don't report an error merely because mktime
returned ((time_t) -1), as that may be a valid time_t value.
Use a simpler error check. See:
https://www.sourceware.org/ml/libc-alpha/2018-11/msg00062.html
Eli Zaretskii [Sat, 3 Nov 2018 13:11:33 +0000 (15:11 +0200)]
Improve documentation of destructuring-binding macros
* lisp/emacs-lisp/pcase.el (pcase-dolist, pcase-let)
(pcase-let*): Improve the doc strings.
* doc/lispref/sequences.texi (Sequence Functions): Improve
wording and rename arguments of seq-let to be more
descriptive. Add a cross-reference to "Destructuring with
pcase Patterns".
* doc/lispref/control.texi (Pattern-Matching Conditional):
Improve wording and the menu.
(pcase Macro): Incorporate patch suggested by Paul Eggert
<eggert@cs.ucla.edu>. Reformat text.
(Destructuring with pcase Patterns): Rename from
"Destructuring patterns", and improve wording and indexing.
Eli Zaretskii [Sat, 3 Nov 2018 10:39:59 +0000 (12:39 +0200)]
Allow the fringe face to be remapped locally in a buffer
* src/fringe.c (draw_window_fringes): Switch to window's
buffer to get the local value of face-remapping-alist, if
necessary. (Bug#33244)
* src/xfaces.c (syms_of_xfaces) <Qface_remapping_alist>: New
DEFSYM.
David Edmondson [Sun, 28 Oct 2018 03:11:21 +0000 (03:11 +0000)]
Add URL truncation support to rcirc (bug#33043)
Suggested by David Edmondson <dme@dme.org>.
* lisp/net/rcirc.el (rcirc-url-max-length): New user option
controlling extent of URL truncation, defaulting to none.
(rcirc-markup-urls): Use it.
* etc/NEWS: Announce it.
'minor-mode-menu-from-indicator' now display full minor mode.
When there is no menu for a mode, display the mode name after the
indicator instead of just the indicator (which is sometime cryptic).
Ex:
before : SP
now : SP - Smartparens Mode
* etc/NEWS: Add en entry for this new feature.
* lisp/mouse.el (minor-mode-menu-from-indicator): Append the mode name
after the indicator when there is no menu defined by the mode.
* lisp/net/rcirc.el (rcirc-filter): Clear rcirc-process-output
before processing its constituent lines. Otherwise, if rcirc-filter
runs again before the last rcirc-process-server-response is
finished, the contents of rcirc-process-output could be duplicated.
Eric Abrahamsen [Tue, 23 Oct 2018 02:51:37 +0000 (10:51 +0800)]
Allow use of Gnus search groups as notmuch path: search term
* lisp/gnus/nnir.el (nnir-notmuch-filter-group-names-function): New
option governing whether and how to use Gnus' search groups as path:
search terms to notmuch.
(nnir-run-notmuch): Check and possibly use above variable.
(Bug#33122)
Daniel Pittman [Tue, 23 Oct 2018 15:24:04 +0000 (11:24 -0400)]
Fix interaction between vc-hg find-file-hook and vc state caching
Bad assumptions in the `vc-hg-find-file-hook' prevented it from
working. This correctly them. (Bug#33129).
2018-10-23 Daniel Pittman <slippycheeze@google.com>
* lisp/vc/vc-hg.el (vc-hg-find-file-hook): This function made two
assumptions about conflicted files that were not accurate,
preventing conflicts in files ever being detected.
The first was that the `vc-state' was cache by the time this was
invoked, which it is not - at least when visiting the file, or
using `vc-refresh-state'.
The second was that a file with the ".orig" extension would be
present, next to the file being visited. This is the default
behavior of Mercurial, but can be overridden by the user.
Since the VC mode-line code will shortly calculate the state for
display, the optimization of testing for the ".orig" file only
delayed this work by a few moments.
Jordan Wilson [Wed, 10 Oct 2018 10:45:57 +0000 (11:45 +0100)]
Avoid file-name errors when viewing PDF from Gnus
* lisp/doc-view.el (doc-view-mode): Run the output file name
through 'convert-standard-filename', to avoid problems with
characters that are not allowed in file names on some
systems. (Bug#32989)
Eli Zaretskii [Fri, 2 Nov 2018 10:07:47 +0000 (12:07 +0200)]
Avoid crashes with remapped default face in Org mode
* src/xfaces.c (face_at_buffer_position): Look up BASE_FACE_ID
anew if it is not in the frame's face cache. This avoids
crashes when Org mode sets up for a new major mode in embedded
code fragment, and the default face is remapped. (Bug#33222)
Michael Albinus [Wed, 31 Oct 2018 19:04:04 +0000 (20:04 +0100)]
Remote file name completion is also performed by auth-sources search
* doc/misc/tramp.texi (File name completion): User and host name
completion is also performed by auth-sources search.
* etc/NEWS: Document remote file name completion using auth-sources.
* lisp/net/tramp.el (tramp-completion-use-auth-sources):
New user option.
(tramp-parse-auth-sources): New defun.
(tramp-get-completion-function): Call it.
Gemini Lasswell [Wed, 31 Oct 2018 04:15:51 +0000 (21:15 -0700)]
Add regression test for Bug#33014
Backport from master.
* test/src/eval-tests.el:
(eval-tests-byte-code-being-evaluated-is-protected-from-gc): New test.
(eval-tests-33014-var): New variable.
(eval-tests-33014-func, eval-tests-33014-redefine): New functions.
Paul Eggert [Wed, 31 Oct 2018 04:14:10 +0000 (21:14 -0700)]
Refer to bytecode constant vectors (Bug#33014)
Backport from master.
* src/bytecode.c (exec_byte_code): Save VECTOR into stack slot
so that it survives GC. The stack slot was otherwise unused,
so this doesn’t cost us memory, only a store insn.
Paul Eggert [Wed, 31 Oct 2018 03:57:46 +0000 (20:57 -0700)]
Improve fix for Bug#33014
Although the previously-applied fix worked for its platform,
it doesn’t suffice in general.
* src/bytecode.c (exec_byte_code): Save VECTOR into stack slot
so that it survives GC. The stack slot was otherwise unused,
so this doesn’t cost us memory, only a store insn.
* src/eval.c (Ffuncall): Do not make FUN volatile, reverting
2018-10-14T19:12:04Z!gazally@runbox.com. Adding ‘volatile’
does not suffice, since storage for a volatile local can be
reclaimed after its last access (e.g., by tail recursion
elimination), which would make VECTOR invisible to GC.
Alan Mackenzie [Tue, 30 Oct 2018 11:43:13 +0000 (11:43 +0000)]
Fix C++ Mode dynamic error with string delimiters.
Fixes bug #33163
* lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings):
Use the correct variable `end' in place of the wrong `c-new-END'.
(c-after-change-re-mark-unbalanced-strings): Correct a logic error whilst
skipping over comments.
Gemini Lasswell [Sun, 14 Oct 2018 19:12:04 +0000 (12:12 -0700)]
Keep a stack reference to bytecode objects being executed (Bug#33014)
* src/eval.c (Ffuncall): Make local variable 'fun' volatile.
* test/src/eval-tests.el
(eval-tests-byte-code-being-evaluated-is-protected-from-gc):
Add regression test for Bug#33014.
(eval-tests-33014-var): New variable.
(eval-tests-33014-func, eval-tests-33014-redefine): New functions.
Add index entries for more isearch commands/bindings (Bug#32990)
* doc/emacs/search.texi (Basic Isearch): Index isearch-exit,
isearch-abort, isearch-cancel, isearch-repeat-forward,
isearch-repeat-backward and their bindings.
(Repeat Isearch): Index isearch-ring-advance,
isearch-ring-retreat and isearch-edit-string.
(Special Isearch): Index isearch-quote-char,
isearch-char-by-name and their bindings. Index
isearch-query-replace and isearch-query-replace-regexp, and
the latter's binding. Explain what
isearch-query-replace-regexp does. Index isearch-complete.
(Word Search): Index isearch-toggle-word.
Juri Linkov [Sat, 27 Oct 2018 20:27:54 +0000 (23:27 +0300)]
* lisp/isearch.el (lazy-highlight-buffer): New defcustom. (Bug#29360)
(lazy-highlight-buffer-max-at-a-time): New defcustom.
(isearch-lazy-highlight-buffer): New defvar.
(isearch-lazy-highlight-new-loop): Don't check changes in window
boundaries when lazy-highlight-buffer is non-nil.
Move code that extends start/end to match whole string at point
here from isearch-lazy-highlight-search.
(isearch-lazy-highlight-search): Add args string and bound
like in other search functions. Move calculation of bound
to isearch-lazy-highlight-update.
(isearch-lazy-highlight-match): New function with code extracted from
isearch-lazy-highlight-update to be called also from
isearch-lazy-highlight-buffer-update.
(isearch-lazy-highlight-update): Reuse the values returned from
window-group-start and window-group-end. At the end schedule the
timer to call isearch-lazy-highlight-buffer-update when
isearch-lazy-highlight-buffer is non-nil.
(isearch-lazy-highlight-buffer-update): New function.
Eli Zaretskii [Sat, 27 Oct 2018 10:18:33 +0000 (13:18 +0300)]
Improve documentation of 'process-connection-type'
* doc/lispref/processes.texi (Asynchronous Processes): Clarify
better when it is advisable to use pipes for communicating
with subprocesses. (Bug#33050)
Unify prompt for gnupg passphrase between GNU/Linux and MS-Windows.
* lisp/epg.el (epg--start): Use 'raw-text' for coding system instead
of 'binary', in order to avoid spurious carriage return on Microsoft
Windows and MS-DOS when prompting for a password. (Bug#33040)
Daniel Pittman [Wed, 5 Sep 2018 13:44:58 +0000 (09:44 -0400)]
Add support in emacsclient for EMACS_SOCKET_NAME
If the '--socket-name' argument is unspecified, the environment
variable 'EMACS_SOCKET_NAME' is now consulted with the same
semantics. This mirrors the behavior of the '--server-file' argument,
and allows for easier configuration of emacsclient when the socket is
in a location other than 'TMPDIR' or '/tmp'.
* emacsclient.c (set_socket): Add support for the
EMACS_SOCKET_NAME environment variable. (Bug#33095)