* lisp/calc/calc-forms.el (math-to-hms, math-from-hms):
Ignore value of 'calc-angle-mode' when 'math-simplifying-units'
is non-nil (Bug#23889).
* lisp/calc/calc-math.el (math-to-radians, math-from-radians)
(math-from-radians-2, math-to-radians-2): Idem.
* dired.el (dired-always-read-filesystem): Add new option.
(dired-mark-files-containing-regexp): Use it (Bug#22694).
* doc/emacs/dired.texi: Mention it in the manual.
* test/lisp/dired-tests.el (dired-test-bug22694): Add test.
;* etc/NEWS: Add entry for this change.
Michael Albinus [Sun, 10 Jul 2016 15:03:48 +0000 (17:03 +0200)]
Add a note how to use `tramp-own-remote-path'
* doc/misc/tramp.texi (Inline methods, External methods)
(Remote shell setup, Android shell setup)
(Frequently Asked Questions, Frequently Asked Questions):
Use @command and @samp consequently.
(Remote programs): The remote shell must support the -l
argument, in order to use `tramp-own-remote-path'. (Bug#23914)
Mark Oteiza [Sat, 9 Jul 2016 01:10:32 +0000 (21:10 -0400)]
Derive secrets-mode from special-mode
* lisp/net/secrets.el: Remove top-level secrets-mode hack.
(secrets-mode-map): New variable. Add key bindings to n and p for
navigating lines.
(secrets-mode): Derive from special-mode. Remove keymap code and
initialization code. Do not record undo information. Make
secrets-show-collections the local revert-buffer-function.
(secrets-show-collections): Change signature to satisfy revert-buffer.
Michael Albinus [Fri, 8 Jul 2016 20:44:11 +0000 (22:44 +0200)]
Detect remote uid and gid in tramp-gvfs.el
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name)
(tramp-gvfs-handler-mounted-unmounted)
(tramp-gvfs-connection-mounted-p):
Make "default-location" a connection property.
(tramp-gvfs-get-remote-uid, tramp-gvfs-get-remote-gid): New defuns.
(tramp-gvfs-maybe-open-connection): Use them.
Eli Zaretskii [Fri, 8 Jul 2016 19:34:34 +0000 (22:34 +0300)]
Yet another fix for copying properties by 'format'
* src/textprop.c (extend_property_ranges): Accept an additional
argument OLD_END, and only extend the end of a property range if
its original end is at OLD_END; all the other ranges are left
intact. (Bug#23897)
* src/editfns.c (styled_format): Pass the original length of the
string to 'extend_property_ranges'.
* src/intervals.h (extend_property_ranges): Adjust prototype.
* test/src/editfns-tests.el (format-properties): Add tests for
bug#23897.
Stephen Berman [Fri, 8 Jul 2016 15:36:55 +0000 (17:36 +0200)]
Allow selecting region with mouse to move point to beginning
* etc/NEWS: Mention new user option
`mouse-select-region-move-to-beginning'.
* doc/emacs/frames.texi (Mouse Commands): Add cross-reference
to the following.
(Word and Line Mouse): Describe how double-clicking mouse-1 to
activate region and `mouse-select-region-move-to-beginning'
affect point.
* lisp/mouse.el (mouse-select-region-move-to-beginning): New defcustom.
(mouse-set-point): Use it. (Bug#23478)
* ibuf-ext.el (ibuffer-copy-buffername-as-kill): New command.
* lisp/ibuffer (ibuffer-mode-map): Bound it to 'B'.
;* etc/NEWS: Add entry for this new feature.
* lisp/ibuffer.el (ibuffer-change-marks): New command.
(ibuffer-mode-map): Bind it to '* c'.
(ibuffer-mode-groups-popup): Update menus.
(ibuffer-mode): Update mode doc.
; * etc/NEWS: Add entry for this new feature.
Alan Third [Thu, 7 Jul 2016 19:42:11 +0000 (20:42 +0100)]
Fix some deprecated functions
* src/nsterm.m (firstRectForCharacterRange): In OS X >10.6 replace
convertBaseToScreen with convertRectToScreen.
* src/nsmenu.m (ns_update_menubar): Remove attachedMenu, deprecated in
OS X 10.2, and always seems to return nil.
Michael Albinus [Thu, 7 Jul 2016 16:50:24 +0000 (18:50 +0200)]
Fix an error in Tramp for rsync
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band):
Make it work for "rsync".
(tramp-make-copy-program-file-name): Apply `directory-file-name'.
* lisp/ibuf-ext.el (ibuffer-locked-buffer-p): New defun.
(ibuffer-mark-by-locked): New command.
(ibuffer-mode-map): Bind it to '% L'; update menus.
(ibuffer-mode): Update mode doc.
;* etc/NEWS: Add NEWS entry for these changes and previous two commits.
* lisp/ibuffer.el (ibuffer-mode-map): 'ibuffer-mark-by-content-regexp'
just bound to '% g'.
As suggested in:
http://lists.gnu.org/archive/html/emacs-devel/2016-07/msg00165.html
Mark Oteiza [Thu, 7 Jul 2016 03:16:32 +0000 (23:16 -0400)]
Replace eldoc-documentation-function with a hook
* lisp/emacs-lisp/eldoc.el (eldoc-documentation-functions): New hook.
(eldoc-documentation-function): Make into obsolete alias.
(eldoc-echo-area-use-multiline-p, eldoc-highlight-function-argument):
(eldoc-argument-case, global-eldoc-mode): Update docstrings.
(eldoc-print-current-symbol-info): Use run-hook-with-args-until-success
on eldoc-documentation-functions.
(eldoc-supported-p): New function.
(eldoc-mode, global-eldoc-mode, eldoc-schedule-timer): Use eldoc-supported-p.
* etc/NEWS: Mention eldoc-documentation-functions.
* doc/lispref/modes.texi: Update reference.
* lisp/textmodes/css-mode.el (css--complete-property-value): Make
"initial" and "unset" completion candidates for all CSS properties,
just like "inherit".
* test/lisp/textmodes/css-mode-tests.el
(css-test-complete-property-value): Update test to reflect the above
change.
Paul Eggert [Wed, 6 Jul 2016 14:10:13 +0000 (16:10 +0200)]
Simplify rfc1345.el a bit
* lisp/leim/quail/rfc1345.el: Omit commented-out codes for ASCII
that would no longer parse. Replace control characters with
escapes in character constants. Omit unnecessary \ after ?.
This does not change behavior.
Eli Zaretskii [Tue, 5 Jul 2016 16:33:01 +0000 (19:33 +0300)]
Fix redisplay with window-start on continuation lines
* src/xdisp.c (pos_visible_p): Return false if the window starts
after CHARPOS.
(compute_window_start_on_continuation_line): Don't return
window-start position that is after point in the buffer, as the
callers don't expect this to happen, and will generally display an
empty window with the cursor in its middle. (Bug#23871)
Simplify ‘delete-trailing-whitespace’ by not treating \n as whitespace
* lisp/simple.el (delete-trailing-whitespace): Set newline’s character
syntax to non-whitespace so that ‘\s-’ regular expression does not match
it.
This simplifies the loop slightly since a simple ‘\s-+$’ can be used and
as a consequence ‘line-beginning-position’ function does not need to be
called any longer.
Furthermore, when newline has whitespace syntax, ‘\s-$’ regular
expression ends up matching empty lins since ‘\s-’ matches newline
characetr of proceeding line. This leads to needless loop iterations.
Since previous change to ‘delete-trailing-whitespace’ already introduced
‘with-syntax-table’, take advantage of it and also overwrite newline’s
character syntax.
Make ‘delete-trailing-whitespace’ delete spaces after form feed
* lisp/simple.el (delete-trailing-whitespace): Treat form fead as
a non-whitespace character (regradless of whether it’s character syntax
is whitespace) and delete any whitespace following it instead of leaving
lines with form feeds completely unchanged. I.e. a line like "\f " will
now became "\f".
* configure.ac [USE_X_TOOLKIT]: Define X_TOOLKIT_EDITRES if
_XEditResCheckMessages is declared in X11/Xmu/Editres.h and may be
linked with -lXmu. This should work with any non-ancient Xmu library.
* xfns.c (toplevel): Remove old cruft.
(x_window) [USE_X_TOOLKIT]: Use X_TOOLKIT_EDITRES.
* xterm.c (toplevel): Remove old cruft.
(handle_one_xevent): Use X_TOOLKIT_EDITRES.
* xterm.h (toplevel): Include X11/Xmu/Editres.h if X_TOOLKIT_EDITRES.
Michael Albinus [Mon, 4 Jul 2016 13:36:30 +0000 (15:36 +0200)]
Add Google Drive support to Tramp
* doc/misc/tramp.texi: Add `gdrive' method.
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.3.1-pre".
* etc/NEWS: Add Tramp connection method "gdrive".
* lisp/net/tramp-gvfs.el (tramp-gvfs-methods) <gdrive>: Add.
(tramp-default-user-alist, tramp-default-host-alist): Add rule
for "gdrive".
(tramp-gvfs-file-attributes): Add "name", remove "standard::icon".
(tramp-gvfs-file-attributes-with-gvfs-ls-regexp): Simplify regexp.
(tramp-gvfs-get-directory-attributes): Improve loop. Use
"standard::display-name" as file name, if available.
(tramp-gvfs-handle-file-name-all-completions): Simplify.
(tramp-gvfs-url-file-name, tramp-gvfs-handler-mounted-unmounted)
(tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec):
Map between "gdrive" and "google-drive".
* lisp/net/tramp.el (tramp-call-process): Do not signal error.
* test/lisp/net/tramp-tests.el (tramp--instrument-test-case):
Do not enable `tramp-message-show-message'.
(tramp-test13-make-directory, tramp-test14-delete-directory):
Do not specify error type.
Paul Eggert [Sun, 3 Jul 2016 22:46:57 +0000 (00:46 +0200)]
Re-fix open-network-stream responsiveness
Problem reported by Christer Ekholm (Bug#23864).
* src/process.c (wait_reading_process_output): Further fix for
typo introduced in 2015-07-06T02:19:13Z!eggert@cs.ucla.edu when
wait == INFINITY and got_output_end_time is invalid. See:
http://bugs.gnu.org/23864#20
Alan Mackenzie [Sun, 3 Jul 2016 18:13:51 +0000 (18:13 +0000)]
Remove redundant forms from CC Mode for faster fontification
* lisp/progmodes/cc-fonts.el (c-font-lock-declarations): Remove four arms of
the "main" cond form in the function, which have been redundant since the
extraction of c-font-lock-cut-off-declarators from the function on
2016-06-15/16.
Alan Mackenzie [Sun, 3 Jul 2016 13:11:28 +0000 (13:11 +0000)]
Speed up CC Mode fontification with less accurate functions extending region
* lisp/progmodes/cc-fonts.el (c-font-lock-cut-off-declarators)
(c-font-lock-enclosing-decls)
* lisp/progmodes/cc-mode.el (c-fl-decl-start): Replace invocations of
c-beginning-of-decl-1 with less accurate invocations of
c-syntactic-skip-backwards to speed up fontification.
* lisp/ibuffer.el (ibuffer-unmark-all-marks): New command (Bug#23680).
(ibuffer-mouse-popup-menu): Use it.
(ibuffer-mode): Update mode doc.
(ibuffer-mode-map): Bind 'ibuffer-unmark-all-marks' to 'U'.
Rebind 'ibuffer-do-replace-regexp' to 'r'.
; * etc/NEWS: Add entry for this change.
Paul Eggert [Sun, 3 Jul 2016 08:49:21 +0000 (10:49 +0200)]
Fix open-network-stream responsiveness
Problem reported by Constantin Kulikov (Bug#23684).
* src/process.c (wait_reading_process_output):
Fix typo introduced in 2015-07-06T02:19:13Z!eggert@cs.ucla.edu
when wait == INFINITY and got_output_end_time is invalid.
In this case the code should break, not continue.
* lisp/ibuf-ext.el (ibuffer-mark-by-content-regexp): New command.
(ibuffer-never-search-content-name): New option.
(ibuffer-never-search-content-mode): Idem.
(ibuffer-mark-by-content-regexp): Use them (Bug#23734).
* lisp/ibuffer.el (ibuffer-mode-map): Bind new command to '% c' and '% g'.
(ibuffer-mode): Update mode documentation.
; * etc/NEWS: Add NEWS entry for these changes.
Eli Zaretskii [Sat, 2 Jul 2016 13:56:36 +0000 (16:56 +0300)]
Fix cursor positioning on TTY frames after stretch glyph
* src/term.c (append_glyph, append_composite_glyph)
(append_glyphless_glyph): Set the avoid_cursor_p and multibyte_p
members of the produced 'struct glyph'. Fixes cursor positioning
on the first character after a stretch glyph produced from
line-prefix, wrap-prefix, etc. on TTY frames.
Eli Zaretskii [Sat, 2 Jul 2016 12:39:26 +0000 (15:39 +0300)]
Fix vertical-movement in buffers with wrap-prefix
* src/indent.c (Fvertical_motion): Zero the current_y coordinate
whenever we zero the vpos vertical position of the iterator.
* src/xdisp.c (move_it_in_display_line_to): Handle line-prefix and
wrap-prefix regardless of whether the current Y coordinate is
inside the window dimensions. (Bug#23879)
Eli Zaretskii [Sat, 2 Jul 2016 09:39:47 +0000 (12:39 +0300)]
Rename FACE_OPT_FROM_ID to FACE_FROM_ID_OR_NULL
* src/dispextern.h (FACE_FROM_ID_OR_NULL): Renamed from
FACE_OPT_FROM_ID; all callers changed.
* src/xdisp.c (extend_face_to_end_of_line): Call FACE_FROM_ID, not
FACE_FROM_ID_OR_NULL, as the resulting face is immediately
dereferenced.
(fill_gstring_glyph_string): Call FACE_FROM_ID, not
FACE_FROM_ID_OR_NULL, as the resulting face will be dereferenced
when the glyph string is drawn.
(BUILD_COMPOSITE_GLYPH_STRING): Call FACE_FROM_ID, not
FACE_FROM_ID_OR_NULL, as the resulting face will be dereferenced
in fill_composite_glyph_string.
(calc_line_height_property): Call FACE_FROM_ID_OR_NULL rather that
FACE_FROM_ID, since the function and its caller can cope with that
situation. Conflate 3 tests of missing face or font into just
one.
* src/xfaces.c (Fx_list_fonts, Fface_font, lookup_face): Call
FACE_FROM_ID_OR_NULL rather that FACE_FROM_ID, since these
functions can cope with that situation.
(lookup_derived_face): Don't call FACE_FROM_ID if the result will
not be used.
* src/w32console.c (w32_face_attributes): Remove redundant 'eassert'.
Alan Mackenzie [Thu, 30 Jun 2016 12:58:30 +0000 (12:58 +0000)]
CC Mode: truncate the semi-nonlit cache when applying syntax-table to a quote
This applies to applying or removing syntax-table text properties in raw
strings which affect the stringiness of a piece of text. This fixes the
bug
reported in
http://lists.gnu.org/archive/html/emacs-devel/2016-06/msg00695.html.
* lisp/progmodes/cc-engine.el (c-truncate-semi-nonlit-pos-cache): new
defsubst.
(c-invalidate-state-cache-1): Call new function in place of inline
manipulation.
(c-depropertize-raw-string, c-propertize-raw-string-opener): truncate the
semi-nonlit cache when pertinent syntax-table text properties get applied to
the text.
Alan Mackenzie [Wed, 29 Jun 2016 20:17:39 +0000 (20:17 +0000)]
Fix C-M-a in a C function finding the start of a macro preceding it.
Also amend some pertinent documentation. This fixes bug #23818.
* lisp/progmodes/cc-engine.el (c-beginning-of-decl-1): Also check for a
virtual semicolon at a place where we check for other types of statement ends.
* lisp/progmodes/cc-vars.el (c-macro-nacmes-with-semicolon): Remove from the
doc string the bit saying that the variable is a prototype and liable to
change.
* doc/misc/cc-mode.texi (Macros with ;): Enhance, stating that configuring
macros with semicolon can prevent C-M-a missing the beginning of defun.
Tino Calancha [Wed, 29 Jun 2016 02:47:16 +0000 (11:47 +0900)]
Dired recognize dirs when file size in human units
* lisp/dired.el (dired-re-inode-size): Update 'dired-re-inode-size'
to match when Dired displays the allocated file size column
in human readable units (Bug#22255).
Alan Third [Wed, 4 May 2016 21:22:09 +0000 (22:22 +0100)]
Enable dividers in NS (bug#22973)
src/nsfns.m: Add colour settings functions to ns_frame_park_handlers.
src/nsterm.m (ns_draw_window_divider): ns_focus has to go before the
attempt to set the colour.
src/nsterm.m (ns_draw_vertical_window_border): This had the same bug as
above, although I didn't see any errors.
Eli Zaretskii [Mon, 27 Jun 2016 15:27:58 +0000 (18:27 +0300)]
Fix 'move-to-window-line' when EOB is on last screen line
* src/window.c (displayed_window_lines): Fix an off-by-one error
when the bottom of the last display line is exactly at window's
last pixel. Remove kludgey fix for TTY frames that is no longer
needed. (Bug#15760)
(Fmove_to_window_line): Doc fix.
* doc/lispref/positions.texi (Screen Lines): Clarify and make more
accurate the documentation of 'move-to-window-line'.
Alan Mackenzie [Mon, 27 Jun 2016 11:34:02 +0000 (11:34 +0000)]
Amend a cache so that typing into C++ raw strings has no undue delay.
Also amend the code so that low-level searches to the end of literals are done
only when these positions get used.
* lisp/progmodes/cc-engine.el (c-crosses-statement-barrier-p): Use the new
c-literal-start instead of c-literal-limit.
(c-state-semi-nonlit-pos-cache): Change the structure of this cache, such that
it stores details of the literal at a point, rather than merely points outside
of literals.
(c-state-semi-pp-to-literal, c-state-full-pp-to-literal)
(c-cache-to-parse-ps-state, c-parse-ps-state-to-cache, c-ps-state-cache-pos)
(c-parse-ps-state-below, c-literal-start): New functions.
(c-state-semi-safe-place): Removed.
(c-in-literal): Use c-state-semi-pp-to-literal, so as not to scan to its end.
(c-literal-limits, c-determine-limit-get-base): consequential amendments.
(c-find-decl-spots, c-before-change-check-<>-operators, c-raw-string-pos)
(c-guess-basic-syntax (CASE 2)): Avoid needless scans to end of literals.
* lisp/progmodes/cc-fonts.el (c-font-lock-doc-comments): Avoid needless scans
to end of literals.
* lisp/progmodes/cc-mode.el (c-fl-decl-start): Avoid needless scans to end of
literals.
* lisp/progmodes/cc-cmds.el (c-beginning-of-defun, c-end-of-defun)
(c-defun-name, c-declaration-limits): Avoid needless scans to end of literals.
Paul Eggert [Sun, 26 Jun 2016 21:27:21 +0000 (23:27 +0200)]
Try other addresses when connecting to multihomed
Problem reported by Juliusz Chroboczek (Bug#17976)
and by Artur Malabarba (Bug#23620).
Patch from a suggestion by Andreas Schwab in:
http://bugs.gnu.org/17976#39
This patch is for non-MS-Windows platforms.
I don't know the situation on MS-Windows.
* src/process.c (connecting_status):
New function, for (connect . ADDRINFOS).
(connect_network_socket, check_for_dns, wait_for_socket_fds)
(wait_while_connecting, wait_reading_process_output, status_notify):
Use it.
(decode_status, Fmake_network_process):
Support (connect . ADDRINFOS) status.
(connect_network_socket) [!WINDOWSNT]:
If the connection failed and there are other addresses to try, do not
signal an error; instead, loop around to try the next address.
(wait_reading_process_output): Advance to the next address
if there are multiple addresses and the first remaining address
failed.
* src/process.h (struct Lisp_Process.status): Adjust comment
to describe (connect . ADDRINFOS).
Paul Eggert [Sun, 26 Jun 2016 20:21:49 +0000 (22:21 +0200)]
Fix GNUC_PREREQ for GCC 2.8.1 etc.
Problem reported by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2016-06/msg00608.html
* src/conf_post.h (GNUC_PREREQ): Port to GCC versions like GCC
2.8.1 (1998), which come before GCC 3.0 and which have nonzero
patchlevel numbers.
Eli Zaretskii [Sun, 26 Jun 2016 16:51:22 +0000 (19:51 +0300)]
Don't set 'bidi-paragraph-direction' in 'ansi-term'
* lisp/term.el (ansi-term): Remove unnecessary setting of
'bidi-paragraph-direction'. The underlying problem is solved in
bidi.c by changing the regexps that define the paragraph beginning
and end. (Bug#20611)
Paul Eggert [Sun, 26 Jun 2016 10:44:39 +0000 (12:44 +0200)]
Fix GNUC_PREREQ off-by-1 typo
Problem reported by Martin Rudalics in:
http://lists.gnu.org/archive/html/emacs-devel/2016-06/msg00587.html
* src/conf_post.h (GNUC_PREREQ) [__GNUC_PATCHLEVEL__]:
Fix < vs <= typo.
Michael Albinus [Sun, 26 Jun 2016 10:30:21 +0000 (12:30 +0200)]
Fix some oddities in Tramp's rsync and smb methods
* lisp/net/tramp-sh.el (tramp-methods) <rsync>: Add "-p" and
"-s" arguments.
(tramp-do-copy-or-rename-file-out-of-band):
Call `file-name-directory' also for remote NEWNAME.
* test/lisp/net/tramp-tests.el (tramp-test15-copy-directory):
Do not skip for tramp-smb.el. Test als COPY-CONTENTS case.
(tramp-test24-file-name-completion): Improve check for
hostname completion.
(tramp--test-rsync-p): New defun.
(tramp-test31-special-characters)
(tramp-test31-special-characters-with-stat)
(tramp-test31-special-characters-with-perl)
(tramp-test31-special-characters-with-ls, tramp-test32-utf8)
(tramp-test32-utf8-with-stat, tramp-test32-utf8-with-perl)
(tramp-test32-utf8-with-ls): Skip for "rsync".
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory):
Check also for CIFS capabilities.