1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-08 15:35:02 +00:00
Commit Graph

128277 Commits

Author SHA1 Message Date
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
Paul Eggert
b4c9f9120d Fix quitting bug when buffers are frozen
Problem noted by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00721.html
This patch also fixes some other issues in that report.
* src/lisp.h (incr_rarely_quit): Remove.
All callers changed to use rarely_quit directly.
* src/search.c (freeze_buffer_relocation)
(thaw_buffer_relocation): New functions.
(looking_at_1, fast_looking_at, search_buffer):
Use them to fix bug when quitting when buffers are frozen.
* src/sysdep.c (emacs_intr_read): Rename from emacs_nointr_read.
All uses changed.
2017-02-01 15:23:19 -08:00
Paul Eggert
b01ac672be Revamp quitting and fix infloops
This fixes some infinite loops that cannot be quitted out of,
e.g., (defun foo () (nth most-positive-fixnum '#1=(1 . #1#)))
when byte-compiled and when run under X.  See:
http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00577.html
This also attempts to keep the performance improvements I recently
added, as much as possible under the constraint that the infloops
must be caught.  In some cases this fixes infloop bugs recently
introduced when I removed immediate_quit.
* src/alloc.c (Fmake_list):
Use rarely_quit, not maybe_quit, for speed in the usual case.
* src/bytecode.c (exec_byte_code):
* src/editfns.c (Fcompare_buffer_substrings):
* src/fns.c (Fnthcdr):
* src/syntax.c (scan_words, skip_chars, skip_syntaxes)
(Fbackward_prefix_chars):
Use rarely_quit so that users can C-g out of long loops.
* src/callproc.c (call_process_cleanup, call_process):
* src/fileio.c (read_non_regular, Finsert_file_contents):
* src/indent.c (compute_motion):
* src/syntax.c (scan_words, Fforward_comment):
Remove now-unnecessary maybe_quit calls.
* src/callproc.c (call_process):
* src/doc.c (get_doc_string, Fsnarf_documentation):
* src/fileio.c (Fcopy_file, read_non_regular, Finsert_file_contents):
* src/lread.c (safe_to_load_version):
* src/sysdep.c (system_process_attributes) [GNU_LINUX]:
Use emacs_read_quit instead of emacs_read in places where
C-g handling is safe.
* src/eval.c (maybe_quit): Move comment here from lisp.h.
* src/fileio.c (Fcopy_file, e_write):
Use emacs_write_quit instead of emacs_write_sig in places where
C-g handling is safe.
* src/filelock.c (create_lock_file): Use emacs_write, not
plain write, as emacs_write no longer has a problem.
(read_lock_data): Use emacs_read, not read, as emacs_read
no longer has a problem.
* src/fns.c (rarely_quit): Move to lisp.h and rename to
incr_rarely_quit.  All uses changed..
* src/fns.c (Fmemq, Fmemql, Fassq, Frassq, Fplist_put, Fplist_member):
* src/indent.c (compute_motion):
* src/syntax.c (find_defun_start, back_comment, forw_comment)
(Fforward_comment, scan_lists, scan_sexps_forward):
Use incr_rarely_quit so that users can C-g out of long loops.
* src/fns.c (Fnconc): Move incr_rarely_quit call to within
inner loop, so that it catches C-g there too.
* src/keyboard.c (tty_read_avail_input): Remove commented-out
and now-obsolete code dealing with interrupts.
* src/lisp.h (rarely_quit, incr_rarely_quit): New functions,
the latter moved here from fns.c and renamed from rarely_quit.
(emacs_read_quit, emacs_write_quit): New decls.
* src/search.c (find_newline, search_buffer, find_newline1):
Add maybe_quit to catch C-g.
* src/sysdep.c (get_child_status): Always invoke maybe_quit
if interruptible, so that the caller need not bother.
(emacs_nointr_read, emacs_read_quit, emacs_write_quit):
New functions.
(emacs_read): Rewrite in terms of emacs_nointr_read.
Do not handle C-g or signals; that is now for emacs_read_quit.
(emacs_full_write): Replace PROCESS_SIGNALS two-way arg
with INTERRUPTIBLE three-way arg.  All uses changed.
2017-02-01 15:23:19 -08:00
Paul Eggert
33be50037c Remove immediate_quit.
The old code that sets and clears immediate_quit was
ineffective except when Emacs is running in terminal mode, and
has problematic race conditions anyway, so remove it.  This
will introduce some hangs when Emacs runs in terminal mode,
and these hangs should be fixed in followup patches.
* src/keyboard.c (immediate_quit): Remove.  All uses removed.
2017-02-01 15:23:19 -08: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
Simen Heggestøyl
5060ea5018 Fix typo in a NEWS entry for CSS mode 2017-01-31 20:10:16 +01: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
Paul Eggert
a727a0303e * src/alloc.c, src/lisp.h: Fix minor glitches in recent changes. 2017-01-31 08:31:14 -08:00
Tino Calancha
52a1ce65d6 * test/lisp/vc/diff-mode-tests.el: Require diff-mode. 2017-02-01 01:20:46 +09:00
Dima Kogan
3506ec2b11 New test for diff-mode handling trailing --
test/lisp/vc/diff-mode-tests.el: New test file
2017-01-31 07:50:28 -08: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
Paul Eggert
1056be0b3c Add delq list arg check
* src/fns.c (Fdelq): Check that list is a proper list.
This is more compatible with what ‘delete’ does.
2017-01-30 13:33:01 -08: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
Eli Zaretskii
998e1976ac More fixes to prevent crashes on C-g
* src/fns.c (Fassq, Frassq, Fplist_put): Reset immediate_quit
before returning, to avoid crashes in quit.  (Bug#25566)
2017-01-30 19:26:02 +02:00
Eli Zaretskii
ab96c85097 Avoid crashes on C-g in TTY sessions
* src/keyboard.c (handle_interrupt): Don't quit if
waiting_for_input is set, as doing that is "unsafe": it will
abort.  (Bug#25566)
2017-01-30 19:08:57 +02:00
Vibhav Pant
9c4dfdd1af Fix hash tables not being purified correctly.
* src/alloc.c
(purecopy_hash_table) New function, makes a copy of the given hash
table in pure storage.
Add new struct `pinned_object' and `pinned_objects' linked list for
pinning objects.
(Fpurecopy) Allow purifying hash tables
(purecopy) Pin hash tables that are either weak or not declared with
`:purecopy t`, use purecopy_hash_table otherwise.
(marked_pinned_objects) New function, marks all objects in pinned_objects.
(garbage_collect_1) Use it. Mark all pinned objects before sweeping.
* src/lisp.h Add new field `pure' to struct `Lisp_Hash_Table'.
* src/fns.c: Add `purecopy' parameter to hash tables.
(Fmake_hash_table): Check for a `:purecopy PURECOPY' argument, pass it
to make_hash_table.
(make_hash_table): Add `pure' parameter, set h->pure to it.
(Fclrhash, Fremhash, Fputhash): Enforce that the table is impure with
CHECK_IMPURE.
* src/lread.c: (read1) Parse for `purecopy' parameter while reading
  hash tables.
* src/print.c: (print_object) add the `purecopy' parameter while
  printing hash tables.
* src/category.c, src/emacs-module.c, src/image.c, src/profiler.c,
  src/xterm.c: Use new (make_hash_table).
2017-01-30 12:03:23 +05:30
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
Juanma Barranquero
375c70fd9e test/*.el: Avoid byte-compiler warnings
* test/lisp/abbrev-tests.el (abbrev-table-p-test): Remove unused 'let*'.

* test/lisp/faces-tests.el (faces--test): New customization group.
(faces--test1, faces--test2): Use it.

* test/lisp/ffap-tests.el (ffap-tests-25243):
Call 'mark-whole-buffer' interactively.

* test/lisp/ibuffer-tests.el (ibuffer-filter-groups, ibuffer-filtering-alist)
(ibuffer-filtering-qualifiers, ibuffer-save-with-custom)
(ibuffer-saved-filter-groups, ibuffer-saved-filters): Defvar.
(ibuffer-format-qualifier, ibuffer-unary-operand): Declare.

* test/lisp/minibuffer-tests.el (completion-test1):
Mark unused lexical arguments.

* test/lisp/simple-tests.el (simple-test--dummy-buffer): Wrap result in
'with-no-warnings' to avoid them when the macro is invoked for effect.

* test/lisp/emacs-lisp/cl-seq-tests.el (cl-seq-count-test):
Mark unused lexical arguments.

* test/lisp/emacs-lisp/let-alist-tests.el (let-alist-surface-test):
Mark unused lexical arguments.
(let-alist-cons): Remove unused let binding.

* test/lisp/net/dbus-tests.el (dbus-debug): Defvar.
(dbus-get-unique-name): Declare.

* test/lisp/progmodes/python-tests.el (python-bob-infloop-avoid):
Call 'font-lock-fontify-buffer' interactively.

* test/lisp/textmodes/tildify-tests.el (tildify-space-undo-test--test):
Mark unused lexical argument.
2017-01-28 04:40:36 +01:00
Eli Zaretskii
3979d8f457 Restore a test that was removed by a recent commit
* src/fileio.c (Ffile_accessible_directory_p): Don't overwrite the
errno value unless it's necessary.  (Bug#25419)
2017-01-27 21:58:10 +02: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
Paul Eggert
412b8dac52 Slightly tune file-accessible-directory-p fix
* src/fileio.c (Ffile_accessible_directory_p):
Remove unnecessary test (Bug#25419).
2017-01-27 08:58:02 -08:00
Arash Esbati
21d661d5f7 Add \citetitle to biblatex cite format
* lisp/textmodes/reftex-vars.el (reftex-cite-format-builtin): Add
\citetitle[*] to `reftex-cite-format' and bind them to keys i/I
per user request
http://lists.gnu.org/archive/html/auctex/2017-01/msg00049.html.
2017-01-27 17:47:03 +01:00
Lars Ingebrigtsen
03c1080cd4 Fix charsets and encodings from non-file MIME parts
* lisp/gnus/mml.el (mml-generate-mime-1): Get the charsets and
encoding right for parts that do not originate from files.
2017-01-27 13:54:50 +01:00
Eli Zaretskii
90c7634674 Fix 'describe-variable' for longish variable values
* lisp/help-fns.el (describe-variable): Don't accidentally remove
the last character of a variable's value.  (Bug#25545)
2017-01-27 12:27:50 +02:00
Eli Zaretskii
d7ac7b15ca Ensure last line is at window bottom in shell buffers
* lisp/shell.el (shell-mode): Use setq-local.  Set
scroll-conservatively to 101 locally.  See the discussion at
http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00736.html
for the reasons.
2017-01-27 11:39:31 +02:00
Michael Hoffman
87027734e9 Support Bash Ctrl-Z indication of directory name in term.el
* term.el (term-emulate-terminal): Do not display ?\032 escape
codes even when 'handled-ansi-message' is non-nil.  (Bug#11919)

Copyright-paperwork-exempt: yes
2017-01-27 11:26:36 +02:00
Eli Zaretskii
525a6d2c4f Don't report zero errno for inaccessible directory
* src/fileio.c (Ffile_accessible_directory_p): Report EACCES when
a file handler reports a failure.  (Bug#25419)
2017-01-27 10:51:53 +02:00
Eli Zaretskii
e26166aae0 Fix filenotify-tests on MS-Windows
* test/lisp/filenotify-tests.el (file-notify-test04-file-validity)
(file-notify-test05-dir-validity)
(file-notify-test06-many-events)
(file-notify-test08-watched-file-in-watched-dir): Manually remove
the watch descriptor before calling file-notify--test-cleanup-p.
(Bug#25539)
2017-01-27 10:28:15 +02:00