Glenn Morris [Fri, 20 Oct 2017 23:18:23 +0000 (19:18 -0400)]
Tweak Fdocumentation's error for an undefined function
* src/doc.c (Fdocumentation): Restore the pre-25 behavior
of signalling a void-function error for an undefined function.
This seems cleaner than Emacs 25's "invalid-function: nil" error,
which was (probably) an unintended consequence of changes to
Findirect_function.
Eli Zaretskii [Fri, 20 Oct 2017 09:36:12 +0000 (12:36 +0300)]
Make :align-to account for display-line-numbers
These changes also update the various bundled packages to use
new feature, and better support customizations of the line-number
face.
* src/xdisp.c (calc_pixel_width_or_height): Improve commentary.
Make :align-to count from the end of the line-number display when
the offset or the width form reference that of the text area.
(Bug#28855)
* src/indent.c (Fline_number_display_width): Implement support for
the PIXELWISE argument being 'columns'. Update the doc string.
(syms_of_indent): New symbol 'columns'.
* lisp/ruler-mode.el (ruler-mode-window-col, ruler-mode-ruler):
Call line-number-display-width with last argument 'columns'.
* lisp/proced.el (proced-header-line): Call
line-number-display-width with 2nd arg 'columns', which also fixes
a problem when display-line-numbers is nil.
* lisp/emacs-lisp/tabulated-list.el
(tabulated-list-line-number-width): Call line-number-display-width
with 2nd arg 'columns.
(tabulated-list-entry-lnum-width): Remove unneeded defvar.
(tabulated-list-print, tabulated-list-print-entry): No need to
account for the value of tabulated-list-entry-lnum-width.
(tabulated-list--current-lnum-width): New defvar.
(tabulated-list-watch-line-number-width): New function.
(tabulated-list-mode): Bind tabulated-list--current-lnum-width
locally, and set up tabulated-list-watch-line-number-width as
pre-redisplay-functions hook.
* doc/lispref/display.texi (Size of Displayed Text): Document the
'columns' value of the PIXELWISE argument.
(Pixel Specification): Update and improve the documentation of the
supported forms.
João Távora [Thu, 19 Oct 2017 11:33:20 +0000 (12:33 +0100)]
Augment Flymake API for third-party extensions
See
https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00619.html
* doc/misc/flymake.texi (Flymake error types): Rewrite
example.
(Flymake utility functions): Augment with new API.
* lisp/progmodes/flymake.el (flymake-diagnostics): New function.
(flymake--diag-accessor): New helper macro.
(flymake-diagnostic-buffer, flymake-diagnostic-text)
(flymake-diagnostic-beg, flymake-diagnostic-end)
(flymake-diagnostic-backend): Accessors for diagnostic objects.
(flymake--overlays): Use flymake-diagnostic property.
(flymake--highlight-line): Simplify. Only set
flymake-diagnostic property.
(flymake--handle-report, flymake-goto-next-error): Use
flymake-diagnostic property.
(flymake-show-diagnostic): Use diagnostic object.
(flymake--diagnostics-buffer-entries): Use
flymake-diagnostics.
João Távora [Thu, 19 Oct 2017 23:50:34 +0000 (00:50 +0100)]
Flymake backends must check proc obsoleteness in source buffer
Flymake backends that rely on sentinels running asynchronously and
checking buffer-local variables that hold running processes should
check for obsoleteness in the correct buffers, otherwise a (harmless)
warning might be triggered.
* doc/misc/flymake.texi (An annotated example backend):
Check buffer-local proc in the current buffer.
* lisp/progmodes/elisp-mode.el (elisp-flymake-byte-compile):
Check buffer-local proc in the current buffer.
Eli Zaretskii [Wed, 18 Oct 2017 17:21:25 +0000 (20:21 +0300)]
Fix the MSDOS build.
* msdos/sed1v2.inp (GETADDRINFO_A_LIBS, LIBLCMS2, XDBE_LIBS)
(XDBE_FLAGS, HYBRID_MALLOC, LIBSYSTEMD_CFLAGS)
(LIBSYSTEMD_LIBS): Edit to empty.
(LIBRESOLV, DEPFLAGS, MKDEPDIR, YMF_PASS_LDFLAGS)
(PRE_EDIT_LDFLAGS, POST_EDIT_LDFLAGS): Remove editing.
Remove editing of lines that are no longer present in
src/Makefile.in.
* msdos/sed2v2.inp (NEED_MKTIME_INTERNAL)
(NEED_MKTIME_WORKING): Define to 1.
(HAVE_STRUCT_DIRENT_D_TYPE): Define to 1 for
DJGPP >= 2.05.
(HAVE_STRUCT_ATTRIBUTE_ALIGNED): Define to 1.
Define PACKAGE_VERSION, not VERSION.
(FLEXIBLE_ARRAY_MEMBER): Define to empty.
(HAVE_DECL_*_UNLOCKED): Define to 0.
(HAVE___BUILTIN_FRAME_ADDRESS): Define to 1.
(PENDING_*): Don't define, as Gnulib no longer supports that.
Instead, define _IOERR as it is in libc/file.h.
* msdos/sed3v2.inp: Use $(CURDIR) instead of $(shell cd) to
determine the current directory.
(UPDATE_MANIFEST, UTILITIES): Don't edit.
* msdos/sedlisp.inp (FIND_DELETE): Edit to "-delete".
* msdos/sedlibmk.inp (AUTO_DEPEND): Define to yes.
(HYBRID_MALLOC): Edit to empty.
(am__cd): Don't edit.
(../config.status): Replaces $(top_builddir)/config.status.
Define OMIT_GNULIB_MODULE_foo = true for modules not built for
MS-DOS. Convert GL_GENERATE_xxx_H_TRUE and
GL_GENERATE_xxx_H_FALSE into values of GL_GENERATE_xxx_H.
* msdos/mainmake.v2 (src): Use 'compile-one-process', and make
the command line shorter to fit into 126-char limit of
command.com.
* config.bat: Generate src/deps/*.d files. Rename more files
like djtar on plain DOS would.
Don't rename src/dir.h: it is long gone. Edit
lib/gnulib.mk.in using the same scripts as for
lib/Makefile.in.
* msdos/depfiles.bat: Create *.d files, not *.Po.
* src/thread.c (Fmake_thread) [!THREADS_ENABLED]: Improve the
error message.
* src/thread.h [MSDOS]: Include <signal.h>.
* src/sysselect.h (select) [MSDOS]: Undefine, to avoid
compilation errors.
* src/sysdep.c (block_interrupt_signal, restore_signal_mask):
Expose to MSDOS build.
* src/process.c (update_processes_for_thread_death)
[!subprocess]: No-op implementation.
[HAVE_SETRLIMIT]: Move inclusion of sys/resource.h and
declaration of nofile_limit outside "#ifdef subprocesses", as
it's needed for MSDOS.
* src/msdos.c (faccessat): Declare fullname[].
* src/msdos.h (ENOTSUP): Define to be identical to ENOSYS.
Include termhooks.h.
* src/conf_post.h [WINDOWSNT]: Include ms-w32.h only on
WINDOWSNT, not DOS_NT.
* admin/admin.el (set-version): Set version on PACKAGE_VERSION.
Paul Eggert [Wed, 18 Oct 2017 01:25:18 +0000 (18:25 -0700)]
Improve format-time-string doc
* doc/lispref/os.texi (Time Parsing): Fix some errors in the
documentation for format-time-string. Document ^, #, %s, and %z
with colons. Say that unrecognized sequences are output as-is.
* src/editfns.c (Fformat_time_string): %S can stand for 60.
Also mention unrecognized sequences.
Add a do-nothing implementation for vc-rcs to suppress the message which
the default function adds to the vc-dir buffer (Bug#28570).
* lisp/vc/vc-rcs.el (vc-rcs-dir-extra-headers): New function.
Paul Eggert [Tue, 17 Oct 2017 06:44:32 +0000 (23:44 -0700)]
Work around ImageMagick bug 825
This should fix several bugs reported recently against Emacs
(Bug#28518, Bug#28626, Bug#28632, Bug#28633, Bug#28770).
* src/image.c (imagemagick_load_image):
Do not call MagickWandTerminus.
Paul Eggert [Mon, 16 Oct 2017 22:54:06 +0000 (15:54 -0700)]
Do not reject https://gnu.org in commit messages
* build-aux/git-hooks/commit-msg: Do not reject commit messages
containing http: or ftp: URLs to gnu.org or fsf.org. Instead,
rewrite the messages to use https: URLs.
Gemini Lasswell [Mon, 16 Oct 2017 18:09:29 +0000 (11:09 -0700)]
Fix Edebug spec for cl-defun (bug#24255)
* lisp/emacs-lisp/cl-macs.el: Modify the Edebug spec for
`cl-lambda-list' to support destructuring argument lists.
(cl-defun, cl-defmacro): Fix spelling errors in docstrings.
* lisp/textmodes/rst.el: Remove alternate version of Edebug
specs for `cl-lambda-list' and `cl-type-spec'.
Eli Zaretskii [Mon, 16 Oct 2017 15:51:32 +0000 (18:51 +0300)]
Fix 'line-number-display-width' in hscrolled windows
* src/indent.c (line_number_display_width): Make sure a line
number is generated even when the first line of the window is
completely hscrolled out of view. (Bug#28854)
Andy Moreton [Mon, 16 Oct 2017 08:23:32 +0000 (01:23 -0700)]
Don't reject PBM header whitespace unnecessarily
* lisp/image.el (image-type-header-regexps):
Allow two or more CRs or LFs in initial whitespace sequences. See:
http://netpbm.sourceforge.net/doc/pbm.html
Paul Eggert [Mon, 16 Oct 2017 08:14:58 +0000 (01:14 -0700)]
Fix regression in display of PPM images
Problem reported by Roland Winkler (Bug#28824#35).
Based on a patch proposed by Andy Moreton (Bug#28824#38).
* src/image.c (pbm_scan_index): New function.
(pbm_load): Use it to decode raw data correctly when its top bit
is set.
Noam Postavsky [Sun, 15 Oct 2017 15:38:21 +0000 (11:38 -0400)]
Fix ert-test finding by symbol (Bug#28849)
In 2017-07-28 "* lisp/subr.el (define-symbol-prop): New function", the
symbol used for ert tests in load-history was changed from
`ert-deftest' to `ert--test', but a couple of other places were not
updated accordingly.
* lisp/emacs-lisp/ert.el (ert-find-test-other-window): Pass
`ert--test' as the TYPE to `find-function-do-it'.
(top-level): Use `ert--test' as the key to the
`find-function-regexp-alist' entry.
K. Handa [Sun, 15 Oct 2017 14:15:47 +0000 (23:15 +0900)]
Improve customization of arabic-shaper-ZWNJ-handling.
Make the effect of customizing arabic-shaper-ZWNJ-handling appear
immediately.
* lisp/language/misc-lang.el (arabic-shaper-ZWNJ-handling): Add :set
value.
* src/composite.c (Fclear_composition_cache): New function.
(syms_of_composite): Defsubr it.
Eli Zaretskii [Sat, 14 Oct 2017 08:13:47 +0000 (11:13 +0300)]
Make sure thread stack is properly aligned on MS-Windows
* src/systhread.c: Include w32term.h instead of windows.h.
(w32_beginthread_wrapper): Add ALIGN_STACK attribute, to ensure
the thread's stack is correctly aligned.
* src/w32term.h (ALIGN_STACK): Update commentary.
Paul Eggert [Sat, 14 Oct 2017 07:55:25 +0000 (00:55 -0700)]
Do not under-align pseudovectors
Problem reported by Fabrice Popineau in:
https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00357.html
Also see diagnosis by Eli Zaretskii in:
https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00476.html
* src/alloc.c (vector_alignment):
Now a multiple of alignof (max_align_t).
Simen Heggestøyl [Fri, 13 Oct 2017 19:48:12 +0000 (21:48 +0200)]
Fix indentation bug in multi-line CSS selectors
* lisp/textmodes/css-mode.el (css--colon-inside-selector-p): Fix
indentation of multi-line CSS selectors that include both a
pseudo-class and parenthesis.
* test/manual/indent/css-mode.css: Add test for the above change.
Andreas Schwab [Fri, 13 Oct 2017 09:47:29 +0000 (11:47 +0200)]
gnutls_mac_get_nonce_size has been added in gnutls 3.3
* src/gnutls.c (HAVE_GNUTLS_MAC_GET_NONCE_SIZE)
[GNUTLS_VERSION_NUMBER >= 0x030300]: Define.
(gnutls_mac_get_nonce_size): Depend on
HAVE_GNUTLS_MAC_GET_NONCE_SIZE.
(Fgnutls_macs): Use 0 for :mac-algorithm-noncesize if
!HAVE_GNUTLS_MAC_GET_NONCE_SIZE.
Paul Eggert [Thu, 12 Oct 2017 20:08:53 +0000 (13:08 -0700)]
Let rename-file rename dirs across filesystems
Problem diagnosed by Andreas Schwab (Bug#28792#65).
This fixes a bug that I introduced in
2017-09-10T22:39:24@eggert@cs.ucla.edu
"Fix race with rename-file etc. with dir NEWNAME".
* src/fileio.c (Frename_file): Copy a source directory across
file system boundaries even if its name does not end in slash.
João Távora [Thu, 12 Oct 2017 11:11:26 +0000 (12:11 +0100)]
Simplify Flymake user documentation
Fix some confusing parts of Flymake user documentation, like a
repeated listing of situations leading to a syntax check.
Documentation is now divided into three chapters only: "Using
Flymake", "Extending Flymake", and a chapter for the legacy backend.
Obsolete mention of "errors" and "lines" is replaced by
"diagnostics/problems" and "regions" where appropriate.
* doc/misc/flymake.texi (Overview of Flymake): Delete chapter.
(Using Flymake): Merge with chapter "Overview of Flymake".
(Installing Flymake): Delete chapter.
(Flymake mode, Running the syntax check)
(Navigating to error lines): Delete sections.
(Syntax check statuses): Review and augment with x-references.
(Backend exceptions): Mention shortcut in menu.
* lisp/progmodes/flymake.el (flymake-menu): Tweak minor mode
menu to not speak of "errors".
(flymake-goto-next-error, flymake-goto-prev-error): Fix
wording.
Noam Postavsky [Thu, 12 Oct 2017 00:23:40 +0000 (20:23 -0400)]
Don't use (format "%s" ...) for string copying (Bug#28774)
As of 2017-10-04 'Speed up (format "%s" STRING) and the like', (format
"%s" STRING) no longer produces a new string.
* lisp/ido.el (ido-completions): Use `copy-sequence' to make a new
string, so that we can add text properties to (copies of) symbol
names.
João Távora [Sun, 8 Oct 2017 23:12:48 +0000 (00:12 +0100)]
Tweak the Flymake diagnostics buffer again
* lisp/progmodes/flymake.el
(flymake-diagnostics-buffer-mode-map): Don't bind [mouse-1].
(flymake-show-diagnostic): Rename from
flymake-show-diagnostic-at-point. Really use another window.
(flymake-goto-diagnostic): Rename from
flymake-goto-diagnostic-at-point.
(flymake--diagnostics-buffer-entries): Use a button just for
the message bit.
Mark Oteiza [Sun, 8 Oct 2017 21:42:31 +0000 (22:42 +0100)]
Simplify Flymake diagnostics buffer UX
Don't create text-buttons unnecessarily, just bind RET and SPC in the
diagnostics buffer to a command that figures out which diagnostic it
was invoked on.
* lisp/progmodes/flymake.el
(flymake--diagnostics-buffer-mode-keymap): Renamed from
flymake--diagnostics-buffer-button-keymap.
(flymake-show-diagnostic-at-point): Don't take a button.
(flymake-goto-diagnostic-at-point): Don't pass button to
flymake-show-diagnostic-at-point.
(flymake--diagnostics-buffer-entries): Simplify.
Eli Zaretskii [Tue, 10 Oct 2017 14:08:51 +0000 (17:08 +0300)]
Improve the Flymake manual
* doc/misc/flymake.texi: Add a 'coding' cookie. Add a
@syncodeindex directive for @vindex. Use 2 spaces between
sentences. Lower-case @cindex entries.
(Overview of Flymake): Fix use of @itemize and @pxref. Fix
punctuation and markup.
(Backend exceptions): Use @emph instead of @dfn. Add more
indexing.
(Customizable variables, Extending Flymake): Improve wording.
(Flymake error types): Fix usage of @itemize. Improve wording.
(Backend functions): Fix punctuation. Fix markup. Add a
cross-reference to ELisp manual.
(Flymake utility functions): Add a cross-reference to ELisp manual.
(An annotated example backend): Fix punctuation and typos.
(Flymake mode, Running the syntax check)
(Navigating to error lines, Backend exceptions)
(Customizable variables, Flymake error types, Backend functions)
(Flymake utility functions, Proc customization variables)
(Locating a master file, Locating the buildfile)
(Starting the syntax check process, Parsing the output)
(Interaction with other modes): Fix indexing. Add index entries
for functions, variables, and concepts.
João Távora [Tue, 10 Oct 2017 11:47:46 +0000 (12:47 +0100)]
Fix two Flymake bugs
* lisp/progmodes/flymake.el (define-fringe-bitmap): Protect
against --without-x.
(flymake--mode-line-format): Ensure mode-line's mouse-4 and mouse-5 work
in their own windows.
João Távora [Tue, 10 Oct 2017 01:14:46 +0000 (02:14 +0100)]
Add full documentation on new Flymake API
Also, as a minor addition to this API, set flymake-text
on the diagnostic overlay. This enables a good example in
the section "Customization Flymake annotations".
* doc/misc/flymake.texi (Overview of Flymake)
(Syntax check statuses): Rework.
(Backend exceptions): Rename from "Troubleshooting"
(Customizable variables): Add flymake-start-on-flymake-mode. Rework.
(Extending Flymake): Write chapter.
(Customizing Flymake annotations, Flymake backends)
(Flymake utility functions, An annotated example backend):
New sections and subsections
* lisp/progmodes/flymake.el (flymake-diagnostic-functions)
(flymake-diagnostic-types-alist): Rework docstring.
(flymake--highlight-line): Set and use flymake-text property in overlay.
(flymake-goto-next-error, flymake-goto-prev-error): Fix funny quotes.
Paul Eggert [Mon, 9 Oct 2017 17:30:40 +0000 (10:30 -0700)]
Fix unlikely overflows with wd length
* src/sysdep.c (get_current_dir_name_or_unreachable):
Avoid integer overflow if working directory name is absurdly long.
When allocating memory for getcwd, do not exceed MAXPATHLEN.
Ken Olum [Mon, 9 Oct 2017 13:54:00 +0000 (16:54 +0300)]
Fix problems when editing raw undecoded message (Bug#28671)
* lisp/mail/rmailedit.el (rmail-cease-edit): If rmail-old-mime-state
is set, meaning that we are editing the raw message, do not
encode it again. Delete old body after, not before, inserting
new, to avoid moving marker at beginning of next message.
Eli Zaretskii [Mon, 9 Oct 2017 13:39:25 +0000 (16:39 +0300)]
Improve doc string and prompt of 'grep-read-files'
* lisp/progmodes/grep.el (grep-read-files): Clarify in the doc
string and in the prompt that shell wildcards can be used.
Suggested by Allen Li <vianchielfaura@gmail.com>. (Bug#28615)
Eli Zaretskii [Mon, 9 Oct 2017 12:28:16 +0000 (15:28 +0300)]
Avoid assertion violations when line numbers are displayed
* src/xdisp.c (redisplay_window): Clear the window's desired glyph
matrix before calling try_window with the same starting point.
This avoids assertion violations when switching from a buffer
without line numbers to a buffer with line numbers. (Bug28710)
João Távora [Mon, 9 Oct 2017 10:12:57 +0000 (11:12 +0100)]
Be lazy when starting Flymake checks
Don't start the check immediately if the buffer is not being
displayed. Wait until it is, using window-configuration-change-hook.
This enables the user to batch-enable flymake-mode on many buffers and
not have that operation exhaust system resources for checking each
one. Likewise, an editing or save operation in a currently
non-displayed buffer does not immediately start a check.
* lisp/progmodes/flymake.el (flymake-start-on-flymake-mode):
Rename from flymake-start-syntax-check-on-find-file.
(flymake-start-syntax-check-on-find-file): Obsolete alias for
flymake-start-on-flymake-mode.
(flymake-start): Redesign. Affect the global post-command-hook
and local window-configuraiton-change-hook.
(flymake--schedule-timer-maybe)
(flymake-after-change-function, flymake-after-save-hook): Pass
t to flymake-start.