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

6127 Commits

Author SHA1 Message Date
Eric Abrahamsen
9b980e2691 Allow write-contents-functions to short-circuit buffer save
Bug#28412

* lisp/files.el (basic-save-buffer): Re-arrange function so that
  write-contents-functions are run earlier. If they return non-nil,
  consider the buffer saved without requiring the buffer to be
  visiting a file.
  (save-some-buffers): This function should consider any buffer with a
  buffer-local value for write-contents-functions eligible for
  saving.
* test/lisp/files-tests.el (files-test-no-file-write-contents): New
  test.
* doc/lispref/files.texi (Saving Buffers): Mention in docs.
* etc/NEWS: And in NEWS.
2017-09-12 16:06:12 -07:00
Paul Eggert
7aa49c2952 Tweak Gnus doc re gnus-copy-file
* doc/misc/gnus.texi (Saving Articles):
Document behavior with directory name targets (Bug#27986).
Problem reported by Katsumi Yamaoka in:
http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00216.html
2017-09-12 12:18:07 -07:00
Eli Zaretskii
b215b3a2f3 Fix minor typos in the Emacs manual
* doc/emacs/text.texi (Org Organizer):
* doc/emacs/ack.texi (Acknowledgments): Fix spelling of Org nodes.
2017-09-12 19:28:41 +03:00
Mark Oteiza
35c893ddaf Move gensym to core Elisp
* doc/lispref/symbols.texi (Creating Symbols): Mention gensym right
after make-symbol.
* etc/NEWS: Mention.
* lisp/emacs-lisp/cl-macs.el (cl--gensym-counter): Alias to
gensym-counter.
(cl-gensym): Alias to gensym.
* lisp/emacs-lisp/cl.el: Remove gensym from list of aliases.
* lisp/emacs-lisp/edebug.el (edebug-make-enter-wrapper):
* lisp/emacs-lisp/ert-x.el (ert-with-message-capture):
(ert--expand-should-1, ert--expand-should):
(ert--should-error-handle-error):
* lisp/emacs-lisp/generator.el (cps--gensym):
* lisp/emacs-lisp/gv.el (setf):
* lisp/emacs-lisp/inline.el (inline--do-letlisteval):
* lisp/emacs-lisp/pcase.el (pcase--make-docstring, pcase-dolist):
(pcase--funcall, pcase--u1): Use gensym.
* lisp/subr.el (gensym-counter): New variable.
(gensym): New function, assimilated from cl-lib.
2017-09-12 11:08:00 -04:00
Eli Zaretskii
4c57eda5cf Update documentation of 'max-lisp-eval-depth'
* doc/lispref/eval.texi (Eval): Update the documented default
value of 'max-lisp-eval-depth'.
2017-09-11 19:48:56 +03:00
Eli Zaretskii
e33234ab9f Improve documentation of etags-related features
* doc/emacs/maintaining.texi (Looking Up Identifiers): Document
'xref-prompt-for-identifier'.  (Bug#28403)
(Etags Regexps): Document \D back references in etags regexps.
2017-09-11 19:40:43 +03:00
Paul Eggert
e22794867d Make copy-directory act like copy-file etc.
Do the special dance with the destination only if it is a
directory name, for consistency with copy-file etc. (Bug#27986).
* doc/emacs/files.texi (Copying and Naming):
* doc/lispref/files.texi (Create/Delete Dirs):
* etc/NEWS: Document this.
* lisp/files.el (copy-directory): Treat NEWNAME as special
only if it is a directory name.
2017-09-10 22:31:23 -07:00
Paul Eggert
01c885f21f Fix race with rename-file etc. with dir NEWNAME
This changes the behavior of rename-file etc. slightly.
The old behavior mostly disagreed with the documentation, and had
a race condition bug that could allow attackers to modify victims'
write-protected directories (Bug#27986).
* doc/lispref/files.texi (Changing Files): Document that in
rename-file etc., NEWFILE is special if it is a directory name.
* etc/NEWS: Document the change in behavior.
* src/fileio.c (directory_like): Remove.  All uses removed.
(expand_cp_target): Test only whether NEWNAME is a directory name,
not whether it is currently a directory.  This avoids a race.
(Fcopy_file, Frename_file, Fadd_name_to_file, Fmake_symbolic_link):
Document behavior if NEWNAME is a directory name.
(Frename_file): Simplify now that the destdir behavior occurs
only when NEWNAME is a directory name.
* test/lisp/net/tramp-tests.el (tramp-test11-copy-file)
(tramp-test12-rename-file, tramp--test-check-files):
Adjust tests to match new behavior.
2017-09-10 15:46:51 -07:00
Paul Eggert
cdef84fb68 Spelling fixes
* lisp/progmodes/cc-langs.el:
(c-ambiguous-overloadable-or-identifier-prefixes): Rename from
c-ambiguous-overloadable-or-identifier-prefices.  Caller changed.
2017-09-10 09:24:37 -07:00
Paul Eggert
b079ee72ac Merge from gnulib
This incorporates:
2017-09-08 stddef: Avoid conflict with system-defined max_align_t
2017-08-24 warnings: fix compilation with old autoconf
2017-08-23 glob: merge from glibc with Zanella glob changes
2017-08-17 random: Fix test compilation failure on Cygwin 1.5.25
* doc/misc/texinfo.tex, lib/flexmember.h, lib/stddef.in.h:
* lib/stdlib.in.h, m4/manywarnings.m4, m4/stdlib_h.m4:
* m4/warnings.m4:
Copy from Gnulib.
* lib/gnulib.mk.in: Regenerate.
2017-09-10 08:40:43 -07:00
Paul Eggert
743b95cc63 Be more consistent about "directory name" in manual
This clarifies the documentation, partly in response to the
discussion in Bug#27986.
2017-09-09 13:41:20 -07:00
Michael Albinus
af11532bb5 Clarification in tramp-texi
* doc/misc/tramp.texi (Connection caching): Two connections are
regarded as different now when they differ in the port number only.
2017-09-09 12:31:54 +02:00
Paul Eggert
53830c6336 Remove obsolete vc-mistrust-permissions doc
* doc/emacs/vc1-xtra.texi (RCS and SCCS): Remove documentation
for vc-mistrust-permissions, which no longer exists.
2017-09-07 16:34:52 -07:00
Eli Zaretskii
1436ce83d3 Fix a minor markup problem in ELisp manual
* doc/lispref/functions.texi (Mapping Functions): Fix the order of
@example and @group.  For the details, see
http://lists.gnu.org/archive/html/bug-texinfo/2017-09/msg00007.html.
2017-09-06 21:00:29 +03:00
Michael Albinus
8d251607e0 Doc precisment about remote link targets
* doc/lispref/files.texi (Truenames): Explain handling of
targets of `file-truename' and `make-symbolic-link', which
look like a remote file name.

* etc/NEWS: Precise examples for symlinks which look like
remote file names.  MUSTBENEW of `write-region' is not
propagated to file name handlers.
2017-09-05 15:32:03 +02:00
John Wiegley
c09116e640
Remove an opinionated section on "What Eshell is not"
I don't find this information to accurately reflect possible use cases
for Eshell; plus, it doesn't offer much in the way of information,
just opinion.
2017-09-05 14:24:25 +01:00
Michael Albinus
8a65d7a731 Work on Tramp's (symbolic) links
* doc/misc/tramp.texi (Traces and Profiles): Mention the
backtrace when tramp-verbose is greater than or equal to 10.

* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
Use `tramp-handle-add-name-to-file'.

* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Use
`tramp-handle-add-name-to-file' and `tramp-handle-file-truename'.

* lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link): Improve.

* lisp/net/tramp-smb.el (tramp-smb-errors):
Add "NT_STATUS_CONNECTION_DISCONNECTED" and
"NT_STATUS_OBJECT_PATH_SYNTAX_BAD".
(tramp-smb-file-name-handler-alist): Use `tramp-handle-file-truename'.
(tramp-smb-do-file-attributes-with-stat): Return non-nil only
if one of the attributes is non-nil.
(tramp-smb-handle-file-local-copy): Use `file-truename'.
(tramp-smb-handle-file-truename): Move to tramp.el.
(tramp-smb-handle-insert-directory): Show symlinks.
(tramp-smb-handle-make-symbolic-link): Improve.
(tramp-smb-read-file-entry): Handle extended file modes in Samba.

* lisp/net/tramp.el (tramp-handle-add-name-to-file)
(tramp-handle-file-truename): New defuns.

* test/lisp/net/tramp-tests.el (tramp-test21-file-links): Extend test.
(tramp--test-check-files): Make check for "smb".
2017-09-04 13:10:52 +02:00
Eli Zaretskii
c89f3ff3dc Rewrite Antinews for Emacs 26
* doc/lispref/anti.texi (Antinews): Rewrite for Emacs 26.
* doc/lispref/elisp.texi (Top): Update the top-level menu's
Antinews entry.
* doc/emacs/anti.texi (Antinews): Rewrite for Emacs 26.
* doc/emacs/emacs.texi (Top): Update the top-level menu's Antinews
entry.

* etc/NEWS: Rearrange some entries in a more reasonable order.
2017-09-02 12:37:51 +03:00
Reuben Thomas
98f01a13a3 Add support for arguments in emacsclient's ALTERNATE_EDITOR (Bug #25082)
* lib-src/emacsclient.c (fail): Parse ALTERNATE_EDITOR, or
corresponding command-line argument, into quote- or space-separated
tokens.  If a token starts with a quote, then it naturally is expected
to end with a quote; escaping is not supported. This is enough to cope
with the typical case of requiring the initial path to be quoted,
common on Windows where it may contain spaces.
* etc/NEWS: Document.
* doc/emacs/misc.texi: Likewise.
* doc/man/emacsclient.1: Tweak to remove the implication that only an
editor can be specified (the manual already mentions a “command”).
Fix a small error where “EDITOR” is referred to rather than
“ALTERNATE_EDITOR”.
* test/lib-src/emacsclient-tests.el: Add tests.
2017-08-30 21:59:38 +01:00
Eli Zaretskii
b3400d82d4 Sync NEWS with the documentation
* etc/NEWS: Mark entries according to documentation.

* doc/lispref/functions.texi (Mapping Functions): Document 'mapcan'.
2017-08-30 19:23:59 +03:00
Eli Zaretskii
1454ad6f06 Document '--module-assertions'
* doc/emacs/cmdargs.texi (Initial Options): Document the
'--module-assertions' command-line option.
* doc/lispref/loading.texi (Dynamic Modules): Add a
cross-reference to the description of '--module-assertions'.

* etc/NEWS: Update the NEWS entry for --module-assertions.
2017-08-29 19:39:15 +03:00
Eli Zaretskii
573ccb9803 Minor improvement in documentation of display-line-numbers
* doc/emacs/display.texi (Display Custom): Document the
display-line-numbers-mode and related options.
2017-08-29 19:13:19 +03:00
Rasmus
3ad8ca429b Update Org to v9.0.10
Please see etc/ORG-NEWS for major changes. Note, this is a bugfix
release.
2017-08-29 10:13:31 +02:00
Paul Eggert
e8001d4c27 Do not munge contents of local symbolic links
This lets Emacs deal with arbitrary local symlinks without
mishandling their contents (Bug#28156).  For example,
(progn (shell-command "ln -fs '~' 'x'") (rename-file "x" "/tmp/x"))
now consistently creates a symbolic link from '/tmp/x' to '~'.
Formerly, it did that only if the working directory was on the
same filesystem as /tmp; otherwise, it expanded the '~' to
the user's home directory.
* lisp/dired.el (dired-get-filename): Use files--name-absolute-system-p
instead of rolling our own code.
* lisp/files.el (files--name-absolute-system-p): New function.
(file-truename, file-chase-links): Use it to avoid mishandling
symlink contents that begin with ~.
(copy-directory, move-file-to-trash):
Use concat rather than expand-file-name, to avoid mishandling
symlink contents that begin with ~.
* src/fileio.c (Fmake_symbolic_link): Do not expand leading "~" in the
target unless interactive.  Strip leading "/:" if interactive.
(emacs_readlinkat): Do not prepend "/:" to the link target if
it starts with "/" and contains ":" before NUL.
* test/src/fileio-tests.el (try-link): Rename from try-char,
and accept a string instead of a char.  All uses changed.
(fileio-tests--symlink-failure): Also test leading ~, and "/:",
to test the new behavior.
2017-08-26 18:36:38 -07:00
Paul Eggert
0becd64d63 Improve doc for file-name-absolute-p. 2017-08-26 13:45:25 -07:00
Paul Eggert
05f9ffd53c Improve expand-file-name doc
* doc/lispref/files.texi (Relative File Names, Directory Names)
(File Name Expansion):
* doc/lispref/minibuf.texi (Reading File Names):
Document expand-file-name behavior with ~ more clearly
and accurately.
* doc/misc/org.texi (Batch execution): Simplify example
script so that it does not need expand-file-name and thus
will not mishandle file names with leading ~.
2017-08-25 21:14:06 -07:00
Noam Postavsky
a7ed4ec095 ; * doc/lispref/files.texi (File Attributes): Add missing word. 2017-08-25 22:47:51 -04:00
Paul Eggert
2b7e009257 Fix file-attributes race on GNU hosts
* doc/lispref/files.texi (File Attributes):
Document file-attributes atomicity.
* etc/NEWS: Document the fix.
* src/dired.c (file_attributes): New args DIRNAME and FILENAME,
for diagnostics.  All callers changed.  On platforms like
GNU/Linux that support O_PATH, fix a race condition in
file-attributes and similar functions, so that these functions do
not return nonsense if a directory entry is replaced while getting
its attributes.  On non-GNU platforms, do a better (though not
perfect) job of detecting the race, and return nil if detected.
2017-08-25 13:19:45 -07:00
Michael Albinus
0332a0ef2b Minor improvements for tramp-interrupt-process, documentation
* doc/lispref/processes.texi (Signals to Processes):
* etc/NEWS: Document interrupt-process-functions.

* lisp/net/tramp.el (tramp-interrupt-process): Test also for
`process-live-p'.

* src/process.c (Vinterrupt_process_functions): Fix docstring.

* test/lisp/net/tramp-tests.el (tramp-test28-interrupt-process):
Extend test.
2017-08-24 15:53:56 +02:00
Alan Third
7baa50eca2 Add ability to change macOS WM theme (bug#27973)
* src/frame.c (make_frame, frame_parms, syms_of_frame)
[NS_IMPL_COCOA]: Add ns-appearance and ns-transparent-titlebar
options.
* src/frame.h (ns_appearance_type) [NS_IMPL_COCOA]: Add enum to
represent NSAppearance options.
(struct frame) [NS_IMPL_COCOA]: Add ns_appearance and
ns_transparent_titlebar frame parameters.
* src/nsfns.m (ns_frame_parm_handlers) [NS_IMPL_COCOA]: Add
ns_set_appearance and ns_set_transparent_titlebar handlers.
(Sx_create_frame): Handle ns-appearance and ns-transparent-titlebar
frame parameters.
(Qdark): Add new symbol for use with ns-appearance.
* src/nsterm.h (ns_set_appearance, ns_set_transparent_titlebar)
[NS_IMPL_COCOA]: Add prototypes.
* src/nsterm.m (ns_set_appearance, ns_set_transparent_titlebar)
[NS_IMPL_COCOA]: New functions.
(initFrameFromEmacs) [NS_IMPL_COCOA]: Handle ns-appearance and
ns-transparent-titlebar frame parameters.
* doc/lispref/frames.texi (Window Management Parameters): Document
ns-apperance and ns-transparent-titlebar.
2017-08-23 19:57:00 +01:00
Mark Oteiza
807b67faa4 ; Fix typo in lispref
* doc/lispref/variables.texi (Using Lexical Binding): Append an s.
2017-08-20 22:31:25 -04:00
Reuben Thomas
cf74c27ba1 Document Enchant support
* doc/emacs/fixit.texi: Mention Enchant.
* doc/misc/efaq.texi: Likewise.
* etc/NEWS: Add an item on Enchant support.
2017-08-20 13:58:09 +01:00
Paul Eggert
83f0d60e49 Don’t adjust CRLF in file names
* doc/misc/gnus.texi (Non-ASCII Group Names):
* etc/NEWS:
* test/lisp/net/tramp-tests.el (tramp--test-utf8):
Use utf-8-unix, not utf-8, for default-file-name-coding-system, so
that CRLF in file names is left alone.
* lisp/international/mule-cmds.el (set-default-coding-systems):
Do not alter CRLF in file name coding systems.
(prefer-coding-system): Ignore differences in CRLF processing when
checking whether we used the user-specified file name coding system.
* test/src/fileio-tests.el: New file.
2017-08-19 17:17:09 -07:00
Martin Rudalics
3baf2d840f Fix one more issue reported by Alex (Bug#27999)
* doc/lispref/windows.texi (Preserving Window Sizes)
(Window Parameters): Use the term `window-preserved-size'
instead of `preserved-size' (Bug#27999).
2017-08-19 11:23:10 +02:00
Martin Rudalics
8a9905e2f7 Fix two side window problems noted by Alex (Bug#27999)
* lisp/window.el (display-buffer-in-side-window): Fix doc-string
typo.
(delete-other-windows): Rename the `no-delete-other-window'
parameter to `no-delete-other-windows' (see the discussion in
Bug#27999 for the rationale of this change).
* doc/lispref/windows.texi (Deleting Windows)
(Frame Layouts with Side Windows, Window Parameters): Rename
`no-delete-other-window' to `no-delete-other-windows'.
2017-08-19 10:55:04 +02:00
Paul Eggert
e58b3ef78b Clarify behavior of symlinks and directories
* doc/lispref/files.texi (Saving Buffers): Document how functions
like rename-file work with symlinks and directories.  This patch
attempts to document the current behavior better, in preparation
for possibly changing it.  See Bug#27986.
2017-08-19 00:49:39 -07:00
Ted Zlatanov
94f3f13d6d
Fix and document make-temp-file optional text parameter
* lisp/files.el (make-temp-file): Fix initial TEXT parameter.
(files--make-magic-temp-file): Support optional TEXT parameter.
* etc/NEWS: Document it.
* doc/lispref/files.texi: Document it.
* test/lisp/auth-source-tests.el: Minor reformat.
2017-08-18 21:59:39 -04:00
Eli Zaretskii
bc5fba7aae ; Minor copyedits in manuals.
* doc/lispref/variables.texi (Lexical Binding): The future is here.

* doc/emacs/files.texi (Copying and Naming): Use @w{..} around
constructs that could be split between lines, but shouldn't.
2017-08-18 09:33:11 +03:00
Glenn Morris
7ab95461f7 * doc/emacs/files.texi (Copying and Naming): Avoid confusing texi2pdf. 2017-08-17 21:49:27 -04:00
Michael Albinus
3b8446439b * doc/emacs/files.texi (Copying and Naming): Mention
restrictions to add-name-to-file and make-symbolic-link on
remote systems.
2017-08-16 12:11:37 +02:00
Paul Eggert
5c3d0ce3e0 New manual section "Copying and Naming"
* doc/emacs/files.texi (Copying and Naming):
New section, split off from Misc File Ops and containing the
operations that copy, name or rename files.  This fixes some
confusion caused by the incorrect phrase "The same rule applies
to all the remaining commands in this section" in the old manual.
This change does not affect the confusion about directories (see
Bug#27986 for ongoing discussion).
2017-08-15 10:16:33 -07:00
Paul Eggert
5bdc97d55d Be consistent in spelling 'ok-if-already-exists'. 2017-08-13 11:55:12 -07:00
Paul Eggert
9eb30cb036 Document internal-use naming conventions
* doc/lispref/functions.texi (Function Names):
* doc/lispref/variables.texi (Tips for Defining):
Document naming conventions for internal-use functions and vars.
See Bug#28023#59.
2017-08-12 10:55:40 -07:00
Alexander Gramiak
84288cf421 Add new face 'header-line-highlight'
* lisp/faces.el: Define the face.
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-init-header):
* lisp/info.el (Info-fontify-node): Use the new face.
* doc/emacs/display.texi (Standard Faces):
* etc/NEWS: Document the new face.  (Bug#28033)
2017-08-12 10:12:36 +03:00
Paul Eggert
7d1115e0c7 Document make-temp-name magic limitations
* doc/lispref/files.texi (Unique File Names):
* src/fileio.c (Fmake_temp_name): Document that make-temp-name
does not guarantee uniqueness on magic file names.
2017-08-08 09:50:15 -07:00
Tom Tromey
846870e508 Show number of errors in compilation-mode mode-line
Bug#25354
* lisp/progmodes/compile.el (compilation-num-errors-found): Provide
default value.
(compilation-num-warnings-found, compilation-num-infos-found): New
defvars.
(compilation-mode-line-errors): New defconst.
(compilation-face): Remove.
(compilation-type, compilation--note-type): New functions.
(compilation-parse-errors): Call compilation--note-type.
(compilation-start): Include compilation-mode-line-errors in
mode-line-process.
(compilation-setup): Initialize compilation-num-* variables to 0.
(compilation-handle-exit): Include compilation-mode-line-errors in
mode-line-process.
* doc/emacs/building.texi (Compilation): Document new feature.
2017-08-07 21:48:33 -06:00
Reuben Thomas
85512e7521 Allow async command output buffer to be shown only on output
* lisp/simple.el (async-shell-command-display-buffer): Add
defcustom.
(shell-command): Use the new defcustom to determine whether to show
the buffer immediately, or add a process filter that shows it only
when there is some output.
* etc/NEWS: Document the new variable.
* doc/emacs/misc.texi: Likewise.

Thanks to Juri Linkov and Eli Zaretskii for advice and guidance.
2017-08-07 21:57:22 +01:00
Tino Calancha
cbea38e5c4 dired-do-delete: Allow to delete dirs recursively without prompts
* lisp/dired.el (dired-delete-file): Accept 2 additional answers:
'all', to delete all directories recursively and no prompt anymore.
'quit', to cancel directory deletions (Bug#27940).
Show help message when user inputs 'help'.
(dired-do-flagged-delete): Bind locally dired-recursive-deletes
so that we can overwrite its global value.
Wrapp the loop within a catch '--delete-cancel to catch when
the user abort the directtry deletion.
* doc/emacs/dired.texi (Dired Deletion): Update manual.
* etc/NEWS (Changes in Specialized Modes and Packages in Emacs 26.1):
Announce this change.
2017-08-06 13:46:51 +09:00
Paul Eggert
2d2c12fc5f Default to --with-mailutils if it is installed
* configure.ac (with_mailutils): Default to 'yes' if GNU Mailutils
is installed.  See:
http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00054.html
2017-08-02 19:15:45 -07:00
Tino Calancha
6f6639d6ed Dired: Handle posix wildcards in directory part
Allow Dired to handle calls like
\(dired \"~/foo/*/*.el\"), that is, with wildcards within
the directory part of the file argument (Bug#27631).
* lisp/files.el (insert-directory-wildcard-in-dir-p): New predicate.
(insert-directory-clean): New defun extracted from insert-directory.
(insert-directory)
* lisp/dired.el (dired-internal-noselect)
(dired-insert-directory): Use the new predicate; when it's true,
handle the directory wildcards with a shell call.
* lisp/eshell/em-ls.el (eshell-ls-use-in-dired): Add/remove both advices.
(eshell-ls-unload-hook): New defun.  Use it in
eshell-ls-unload-hook instead of an anonymous function.
(eshell-ls--dired)
* lisp/ls-lisp.el (ls-lisp--dired):
Advice dired to handle wildcards in the directory part with both
eshell-ls and ls-lisp.
* etc/NEWS: Announce it.
* doc/emacs/dired.texi (Dired Enter): Update manual.
* test/lisp/dired-tests.el (dired-test-bug27631): Add test.
2017-07-30 11:11:04 +09:00