1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-04 08:47:11 +00:00
Commit Graph

68297 Commits

Author SHA1 Message Date
Simen Heggestøyl
5e222f6737 * lisp/textmodes/css-mode.el: Require subr-x at compile time 2017-02-05 22:23:57 +01:00
Tom Tromey
148100d983 typo fix
(css--colon-inside-selector-p): Fix typo in docstring.
2017-02-04 13:22:39 -07:00
Tom Tromey
394fc3fd03 Set comment-multi-line in js-mode
Bug#6806:
* lisp/progmodes/js.el (js-mode): Set comment-multi-line to t.
* test/lisp/progmodes/js-tests.el (js-mode-auto-fill): New test.
2017-02-04 13:00:59 -07:00
Simen Heggestøyl
f6ff7bb1fc Fix indentation of multiline CSS property values
* lisp/textmodes/css-mode.el (css-smie-grammar): Give colons belonging
to properties higher precedence.
(css--colon-inside-selector-p, css--colon-inside-funcall): New
functions for helping SMIE during tokenization.
(css-smie--forward-token, css-smie--backward-token): Distinguish
colons belonging to properties from other colons.

* test/manual/indent/css-mode.css: Add tests for the changes above.

* test/manual/indent/scss-mode.scss: Ditto.
2017-02-04 20:19:54 +01:00
Gemini Lasswell
ef3d8d6f72 New macro 'ert-with-message-capture'
* lisp/emacs-lisp/ert-x.el (ert-with-message-capture): New macro.
(Bug#25158)

* test/lisp/autorevert-tests.el (auto-revert--wait-for-revert)
(auto-revert-test00-auto-revert-mode)
(auto-revert-test01-auto-revert-several-files)
(auto-revert-test02-auto-revert-deleted-file)
(auto-revert-test03-auto-revert-tail-mode)
(auto-revert-test04-auto-revert-mode-dired):
* test/lisp/filenotify-tests.el (file-notify-test03-autorevert): Use
ert-with-message-capture.
2017-02-04 13:36:43 +02:00
Gemini Lasswell
8ba27b7ce2 Avoid invalid read syntax errors due to 'ert-with-test-buffer'
* lisp/emacs-lisp/ert-x.el (ert-with-test-buffer): Fix the
'declare' form.  (Bug#24722)
2017-02-04 13:18:29 +02:00
Eli Zaretskii
a46a61904d Fix a syntax error when evaluating pcase.el under Edebug
* lisp/emacs-lisp/pcase.el (pcase-MACRO): Replace def-edebug-spec
with an explicit 'put' form.  Suggested by Gemini Lasswell
<gazally@runbox.com>.  (Bug#24717)
2017-02-04 13:12:14 +02:00
Eli Zaretskii
cc84a405f3 ; * lisp/files.el (save-some-buffers-default-predicate): Add :version. 2017-02-04 12:59:41 +02:00
Gemini Lasswell
78f841d6db Change edebug-max-depth from defconst to defcustom
* lisp/emacs-lisp/edebug.el (edebug-max-depth): Add defcustom.
(Bug#24713)

* etc/NEWS: Mention edebug-max-depth.

* doc/lispref/edebug.texi (Checking Whether to Stop): Mention
edebug-max-depth and index it.  Add cross-references for
max-lisp-eval-depth and max-specpdl-size.

Co-authored-by: Eli Zaretskii <eliz@gnu.org>
2017-02-04 12:56:19 +02:00
Eli Zaretskii
c71b718be8 Support options with embedded whitespace in 'dired-listing-switches'
* lisp/dired.el (dired-listing-switches): Document how to quote
options with embedded whitespace.

* lisp/files.el (insert-directory): Use split-string-and-unquote
to support dired-listing-switches that specify command-line
options with embedded spaces.  (Bug#25485)
2017-02-04 12:02:55 +02:00
Richard Stallman
6db5582479 New defcustom 'save-some-buffers-default-predicate'
* lisp/files.el (save-some-buffers-default-predicate): New defcustom.
(save-some-buffers): Use it when PRED is nil or omitted.
2017-02-04 11:16:55 +02:00
Mark Oteiza
be10c00d3d Rename to if-let* and when-let*
Make the existing if-let and when-let aliases.
* lisp/emacs-lisp/subr-x.el (if-let*, when-let*): New macros.  Rewrite
docstrings, incorporating that from let* and the existing if-let.
(if-let, when-let, and-let*): Alias them.
2017-02-03 21:42:42 -05:00
Noam Postavsky
ce88155d83 ; Merge: fixes and updates to scroll margin (Bug#5718)
- add new option `maximum-sroll-margin'
- refactor and fix scroll margin calculation
2017-02-02 21:35:51 -05:00
Noam Postavsky
e27a91cddc Make limit on scroll-margin variable
* src/xdisp.c (maximum-scroll-margin): New variable.
* lisp/cus-start.el: Make it customizable.
* etc/NEWS: Mention it.
* doc/emacs/display.texi (Auto Scrolling):
* doc/lispref/windows.texi (Textual Scrolling): Document it.
* src/window.c (window_scroll_pixel_based): Use it instead of hardcoding
division by 4 (Bug #5718).
2017-02-02 21:20:29 -05:00
Dmitry Gutov
604724e49d (xref-collect-matches): Use '-E' together with '-e'
* lisp/progmodes/xref.el (xref-collect-matches): Use '-E'
together with '-e', as suggested by Noam Postavsky
(http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00780.html).
2017-02-03 03:12:05 +02:00
Stefan Monnier
f5372d411d * lisp/doc-view.el (doc-view-mode): Don't require a final newline
(doc-view-revert-buffer): Silence overflow warnings.
2017-02-02 10:57:37 -05:00
Tino Calancha
a362b56b51 Check if there are hunks before kill or refine a hunk
* lisp/vc/diff-mode.el (diff--some-hunks-p): New predicate.
(diff-hunk-kill, diff-file-kill, diff-refine-hunk): Use it (Bug#25571).
2017-02-02 22:27:33 +09:00
Tino Calancha
01d87bf846 Ignore error after kill last file or hunk
* lisp/vc/diff-mode.el (diff-hunk-kill): Go to beginning of hunk before kill.
Ignore error after kill last hunk (Bug#25570).
(diff-file-kill): Idem.
2017-02-02 22:27:18 +09:00
Tino Calancha
e280b94dcd Show current line highlighted in *Occur* buffer
* lisp/replace.el (list-matching-lines-current-line-face)
(list-matching-lines-jump-to-current-line): New user options.
(occur--orig-line, occur--orig-line-str): New variables.
(occur, occur-engine): Use them.
(occur--final-pos): New variable.
(occur-1): Use it.
(occur-engine): Idem.
Show the current line with 'list-matching-lines-current-line-face'.
Set point on the first matching line after the current one.
* etc/NEWS: Add entry for the new option.
2017-02-02 19:13:27 +09:00
Tino Calancha
8e871aef10 Allow occur command to operate on the region
See discussion in:
https://lists.gnu.org/archive/html/emacs-devel/2016-12/msg01084.html
* lisp/replace.el (occur--region-start, occur--region-end)
(occur--matches-threshold): New variables.
(occur-engine): Use them.
(occur): Idem.
Add optional arg REGION; if non-nil occur applies in that region.
* doc/lispintro/emacs-lisp-intro.texi (Keybindings): Update manual
* doc/emacs/search.texi (Other Repeating Search): Idem.
; etc/NEWS: Add entry for the new feature.
2017-02-02 19:13:05 +09:00
Mark Oteiza
141b085674 Treat list-buffers-directory as a string
Another step in the long history of list-buffers-directory.  A thread
branch discussing the meaning/use of the variable starts here
https://lists.gnu.org/archive/html/emacs-devel/2009-09/msg00684.html
Also see (info "(elisp) Buffer File Name").
* lisp/buff-menu.el: Relocate special case code into info.el.  Nix
Info-* defvars.
(Buffer-menu--pretty-file-name): Remove special case.  Use
bound-and-true-p.
(Buffer-menu-info-node-description): Remove.
* lisp/ibuffer.el (ibuffer-buffer-file-name): Treat
list-buffers-directory as a string.
* lisp/info.el (Info-node-description): New function.
(Info-select-node): Use it.
2017-02-01 22:57:23 -05:00
Mark Oteiza
70d36dda26 Turn on lexical-binding in parse-time.el
* lisp/calendar/parse-time.el: Turn on lexical-binding.
(parse-time-iso8601-regexp, parse-iso8601-time-string): Remove unused
bindings.
2017-02-01 21:01:45 -05:00
Mark Oteiza
910e63de89 Prevent creating thumbnails of all gif frames
With the previous defaults, doing image-dired on a directory with an
animated foo.gif would cause creation of foo.thumb-N.gif for each of
N frames in foo.gif.  By default image-dired looks for foo.thumb.gif, so
there additionally is no usable thumbnail after all the needless effort.
image-dired never handled animation, regardless.
* lisp/image-dired.el: Mention limitation.
(image-dired-cmd-create-thumbnail-options):
(image-dired-cmd-create-temp-image-options):
(image-dired-cmd-create-standard-thumbnail-options): Append [0] to
filename to indicate only converting the 0th frame.
(image-dired-display-image-mode): Don't show a cursor.
2017-02-01 20:51:00 -05:00
Alan Mackenzie
94ad13b93c Allow C++ nested brace-list-entries to be better indented.
This fixes bug #24431.  The key change of this bug fix is correctly analyzing
nested brace lists when the opening element stands on the same line as both
its introductory brace and an enclosing parameter list parenthesis.

* list/progmodes/cc-align.el (c-lineup-under-anchor): New line-up function.

* list/progmodes/cc-engine.el (c-looking-at-or-maybe-in-bracelist): Accept the
presence of exactly an identifier between an open parenthesis and an open
brace as evidence of the brace starting a brace list.
(c-looking-at-statement-block): New function, extracted from
c-looking-at-inexpr-block.  Enhance it to analyze inner blocks recursively
when needed.
(c-looking-at-inexpr-block): Extract new function (see above) and call it.
(c-add-stmt-syntax): Enhance, with new &optional parameter, to supply the
prime syntactic symbol with a fixed anchor point.  When this is used, restrict
all added syntactic symbols to those having an anchor point on the same line.
Add, in addition to the current additional symbols, c-brace-list-entry when
needed; use c-looking-at-statement-block to determine the latter.
(c-guess-basic-syntax, CASE 9D): Use c-add-stmt-syntax rather than just
c-add-syntax, to assemble the syntactic context of a 'brace-list-entry, thus
getting, possibly, several accompanying syntactic entries.

* lisp/progmodes/cc-styles.el (c-style-alist, "gnu" style): New entry for
'brace-list-intro, namely c-lineup-arglist-intro-after-paren.

* lisp/progmodes/cc-vars.el (c-offsets-alist): Change the factory default
offset for 'brace-list-entry from 0 to c-lineup-under-anchor.

* doc/misc/cc-mode.texi (Syntactic Symbols): Amend the definition of
brace-list-intro.
(Brace List Symbols): Amend the example to show the new analysis of brace
lists when the first element comes on the same line as the opening brace.
(Misc Line-Up): Document the new line-up function c-lineup-under-anchor.
2017-02-01 20:20:09 +00:00
Lars Ingebrigtsen
5d61ef0de9 Revert "DOn't use string-as-unibyte in Gnus"
This reverts commit d1c9310090.

Not all the cases where we had string-as-unibyte were characters,
so this needs to be considered more thoroughly before being redone.
2017-02-01 13:49:11 +01:00
Michael Albinus
d805757618 Fix a subtle problem in Tramp with timers
* lisp/net/tramp.el (tramp-accept-process-output): Change argument
list.  Make it work when called inside a timer.  See
<http://lists.gnu.org/archive/html/tramp-devel/2017-01/msg00010.html>.
2017-02-01 10:06:37 +01:00
Mark Oteiza
12da2a5bea ; Bump let-alist
* lisp/emacs-lisp/let-alist.el: Bump micro version (bug#24641).
2017-01-31 19:47:53 -05:00
Ted Zlatanov
5af51bd445
read-multiple-choice: explain dialog popups more
* lisp/emacs-lisp/subr-x.el (read-multiple-choice): Explain
when a graphical popup is used and how it can be avoided.
2017-01-31 14:18:51 -05:00
Ted Zlatanov
52515f1133
auth-source-user-and-password: add forgotten user parameter
* lisp/auth-source.el (auth-source-user-and-password): Use
          accidentally unused "user" parameter.
          Reported by Oscar Najera <najera.oscar@gmail.com>.
2017-01-31 14:13:10 -05:00
Lars Ingebrigtsen
d1c9310090 DOn't use string-as-unibyte in Gnus
* lisp/gnus/nnmail.el (nnmail-parse-active): Don't use
string-as-unibyte.
(nnmail-insert-xref): Ditto.

* lisp/gnus/canlock.el (canlock-make-cancel-key): Ditto.

* lisp/gnus/gnus-art.el (gnus-article-browse-html-parts): Ditto.

* lisp/gnus/gnus-srvr.el (gnus-browse-foreign-server): Ditto.
(gnus-browse-foreign-server): Ditto.
(gnus-browse-foreign-server): Ditto.

* lisp/gnus/gnus-start.el
(gnus-update-active-hashtb-from-killed): Ditto.
(gnus-read-newsrc-el-file): Ditto.

* lisp/gnus/mml.el (mml-generate-mime-1): Ditto.

* lisp/gnus/nnir.el (nnir-get-active): Ditto.
(nnir-get-active): Ditto.
2017-01-31 17:52:51 +01:00
Juri Linkov
18a3fccd89 Allow C-s C-w to yank ' to the search ring in the Gnus article buffer
* lisp/gnus/gnus-art.el (gnus-article-mode-syntax-table): Make
M-. in article buffers work for `foo' strings, and still allow
C-s C-w to yank ' to the search ring (bug#22248).
2017-01-31 17:36:59 +01:00
Dima Kogan
189df8262e Handle patch terminators produced by git and bzr patch export
Patch by Juri Linkov posted in the #9597 bug report

* lisp/vc/diff-mode.el (diff-sanity-check-hunk): Find and ignore
terminator (Bug #9597, #5302)
2017-01-31 07:50:26 -08:00
Dima Kogan
fbf74c158e Revert two accidental commits
This reverts commit f3c77d11af.
This reverts commit 3c941b9000.
2017-01-31 07:49:37 -08:00
Dima Kogan
f3c77d11af stash 2017-01-30 21:04:11 -08:00
Dima Kogan
3c941b9000 comint-get-old-input-default: behavior follows docstring
lisp/comint.el (comint-get-old-input-default): Modify behavior to follow
docstring: if `comint-use-prompt-regexp' is nil, then return the CURRENT LINE,
if point is on an output field.
2017-01-30 21:04:11 -08:00
Tom Tromey
68e8f4bb4a css-mode documentation lookup feature
* etc/NEWS: Mention new feature.
* lisp/textmodes/css-mode.el (css-mode-map): New defvar.
(css--mdn-lookup-history): New defvar.
(css-lookup-url-format): New defcustom.
(css--mdn-property-regexp, css--mdn-completion-list): New defconsts.
(css--mdn-after-render, css--mdn-find-symbol, css-lookup-symbol): New
defuns.
* test/lisp/textmodes/css-mode-tests.el (css-mdn-symbol-guessing): New
test.
2017-01-30 15:53:10 -07:00
Glenn Morris
77888c8850 edt-mapper: just loading a library should not run code
* lisp/emulation/edt-mapper.el (edt-mapper): New function,
containing code previously at top-level.
* lisp/emulation/edt.el (edt-load-keys): After loading edt-mapper,
run edt-mapper function.
2017-01-30 17:22:32 -05:00
Glenn Morris
5cebfc4495 mh-compat.el: remove duplicate definition
* lisp/mh-e/mh-compat.el (mh-make-obsolete-variable):
Remove duplicate definition.
2017-01-30 16:59:37 -05:00
Stefan Monnier
499780daef * lisp/indent.el (indent-region-line-by-line): New function.
Extracted from indent-region.
(indent-region, indent-region-function): Use it.
2017-01-30 13:06:07 -05:00
Stefan Monnier
f74d496478 * lisp/subr.el (string-make-unibyte, string-make-multibyte): Obsolete. 2017-01-30 13:02:18 -05:00
Dmitry Gutov
8ba236e772 Escape dash in xref rgrep regexp
* lisp/progmodes/xref.el (xref-collect-matches): Escape dash
in REGEXP if it's the first character.
2017-01-29 23:01:42 +02:00
Dmitry Gutov
52feecd3c7 Say JavaScript, not Javascript
* lisp/progmodes/js.el (js-mode-map, js-syntax-propertize)
(js-js-error, js-eval, js-set-js-context)
(js--get-js-context):
Refer to the language consistently as JavaScript.
2017-01-29 23:01:42 +02:00
Juanma Barranquero
2f90bbb5fe lisp/*.el: Fix some warnings
* lisp/battery.el (dbus-get-property):
* lisp/dired-aux.el (format-spec): Declare function.

* lisp/net/zeroconf.el (zeroconf-list-service-names)
(zeroconf-list-service-types, zeroconf-list-services):
Mark unused lexical arg.

* lisp/progmodes/hideshow.el (hs-hide-block-at-point):
* lisp/progmodes/sql.el (sql-end-of-statement):
Pass LIMIT to 'looking-back'.
2017-01-29 19:34:35 +01:00
Noam Postavsky
9bf94639b8 Don't warn about obsolete defgenerics when defining them
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric): The declaration code
should run after the definition code (Bug#25556).
2017-01-29 11:16:06 -05:00
Tino Calancha
0073223c23 Fix Bug#25524
* lisp/vc/diff-mode.el (diff-beginning-of-hunk):
Return position at the beginning off the hunk.
(diff-file-junk-re): Add SVN keywords.
2017-01-29 18:49:10 +09:00
Stephen Berman
d12e1ddf42 hl-line.el: Don't try to operate on a killed buffer
* lisp/hl-line.el (hl-line-maybe-unhighlight): Examine only
live buffers (bug#25522).
2017-01-28 20:49:19 +01:00
Mark Oteiza
c7bbddf0ea Use access-file in EWW to check before downloading a file
* lisp/net/eww.el (eww-download): Check accessibility of
eww-download-directory to prevent starting a download that will fail
to write.
* src/fileio.c (Faccess_file): Clarify the use of string argument in
the docstring.
2017-01-28 12:06:41 -05:00
Yuri D'Elia
f83363d30e Subject: Check Bcc after the Messag hook has run
* lisp/gnus/message.el (message-send): If the hook modifies
the message (mml tags or headers), we should check bcc on the
final message, not on the original.
2017-01-28 15:21:28 +01:00
Mark Oteiza
2d07895151 Fix a couple eww customization types
* lisp/new/eww.el (eww-download-directory, eww-bookmarks-directory):
Change customization type to "directory".
2017-01-27 13:19:38 -05:00
Philipp Stephani
107a0c4caa Don't require a shell when loading htmlfontify
* lisp/htmlfontify.el (hfy-which-etags): Don't call a shell for
detecting the etags version (Bug#25468).
* test/lisp/htmlfontify-tests.el (htmlfontify-bug25468): Add unit
test.
2017-01-27 18:37:58 +01:00