1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-23 14:10:28 -08:00
Commit graph

8728 commits

Author SHA1 Message Date
Lars Ingebrigtsen
6b5a7136ca Fix double (recursive) load of fortran.el
* lisp/progmodes/fortran.el (fortran-menu): Move menu creation to
the end to avoid a recursive load (bug#43116).
2021-06-12 14:44:54 +02:00
Harald Jörg
87bd14ca8b ; perl-mode.el: Allow newline between quote-likes and delimiter
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function):
Allow newline between a quote-like operator and its delimiter
(Bug#22355).

* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-22355):
Test case for the fix.

* test/lisp/progmodes/cperl-mode-resources/cperl-bug-22355.pl:
Test resource for a quote-like with newline before the delimiter.
2021-06-11 13:55:08 +02:00
Harald Jörg
dd9385b404 ; perl-mode.el: Detect quote-like operator immediately after =>
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function):
Detect a quotelike operator immediately after a fat comma "=>"
(Bug#25098)

* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-25098):
Test case for the bug with code from the bug report.

* test/lisp/progmodes/cperl-mode-resources/cperl-bug-25098.pl:
Resource file for the test.
2021-06-09 23:04:09 +02:00
Harald Jörg
90f54aad5e ; perl-mode.el: Detect regexes immediately after "|&"
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function):
Add "|&" to the list of characters after which a slash starts a
regular expression (Bug#23992).

* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-ppss):
Correct the docstring.
(cperl-test-bug-23992): New test for Bug#23992.
(cperl-test-bug-42168): Adapt inline comments to the current code.

* test/lisp/progmodes/cperl-mode-resources/cperl-bug-23992.pl:
Resource file with example code from the bug report.
2021-06-08 23:23:25 +02:00
Dmitry Gutov
722064022c Fix rgrep abbreviation
* lisp/progmodes/grep.el (grep-mode-font-lock-keywords):
Update for the last change in grep-find-template (bug#48471).
2021-06-07 15:03:21 +03:00
Dmitry Gutov
45bdc37c81 Support old BSD find and "root dir symlink" better
* lisp/progmodes/grep.el (grep-compute-defaults):
Add '-H' to grep-find-template (bug#48471).

* lisp/cedet/semantic/symref/grep.el (semantic-symref-perform-search):
Pass the root directory name without the trailing slash.

* lisp/progmodes/xref.el (xref-matches-in-directory): Ditto.

* test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-abs)
(xref--xref-file-name-display-is-relative-to-project-root):
Make tests more strict again.
2021-06-07 04:52:30 +03:00
Eli Zaretskii
fc37483617 Fix a problem with restarting 'tags-search'
* lisp/progmodes/etags.el (tags-search, tags-query-replace): Link
to 'fileloop-continue' instead of 'tags-loop-continue', for
continuing TAGS-based search/replace commands.

* lisp/fileloop.el (fileloop-continue): Reset
'switch-to-buffer-preserve-window-point' to nil when switching to
another buffer, so as to make sure a new search always restarts
from point-min in each buffer it searches.  (Bug#48628)
2021-06-06 15:29:18 +03:00
Lars Ingebrigtsen
4bcc83c124 Fix up previous hideif change to avoid a compilation warning
* lisp/progmodes/hideif.el
(hide-ifdef-expand-reinclusion-protection): Move to avoid a
compilation warning.
2021-06-03 10:39:39 +02:00
Luke Lee
9a66aff504 * lisp/progmodes/hideif.el: Fix initial version for new variables
(hide-ifdef-verbose, hide-ifdef-evalulate-enter-hook)
(hide-ifdef-evalulate-leave-hook): Fix initial version to 28.1.
(hide-ifdef-expand-reinclusion-protection): Obsolete since 28.1,
rename to `hide-ifdef-expand-reinclusion-guard' instead.
2021-06-03 16:04:16 +08:00
Luke Lee
87e7390aae * lisp/progmodes/hideif.el: update for new C++ standards and extensions
Matching gcc/clang behavior on stringification including keeping the same
number of white spaces.  C++11, C++14, C++17 and GCC literals extension are
supported.  Preprocessing time floating point operation supported but limited
to Emacs internal representation which is C data type "double".  Also support
some frequently used keywords like __LINE__, __TIME__, __DATE__ and so on.

(hif-clear-all-ifdef-defined, hif-show-all, hif-after-revert-function)
(hide-ifdef-define, hide-ifdefs, show-ifdefs): interactive behavior changes,
mainly to allow operation within the marked region.
(hif-eval, hif-__LINE__, hif-__FILE__, hif-__COUNTER__, hif-__cplusplus)
(hif-__DATE__, hif-__TIME__, hif-__STDC__, hif-__STDC_VERSION__)
(hif-__STDC_HOST__, hif-__FILE__, hif-full-match, hif-is-number, hif-is-float)
(hif-delete-char-in-string, hif-string-to-decfloat, hif-string-to-hexfloat)
(hif-strtok, hif-is-white, hif-backward-comment, hif-split-signed-token)
(hif-keep-single, hif-display-macro): new functions.
(hide-ifdef-verbose, hide-ifdef-evalulate-enter-hook)
(hide-ifdef-evalulate-leave-hook, hide-ifdef-evaluator, hif-predefine-alist)
(hif-numtype-suffix-regexp, hif-bin-regexp, hif-hex-regexp, hif-oct-regexp)
(hif-dec-regexp, hif-decfloat-regexp, hif-hexfloat-regexp)
(hif-unicode-prefix-regexp, hif-verbose-define-count): new constants or
variables.
(hif-macroref-regexp, hif-token-alist, hif-token-regexp)
(hif-string-literal-regexp): modified constants for faster regexp processing.
(hide-ifdef-expand-reinclusion-guard): renamed from
`hide-ifdef-expand-reinclusion-protection' to match commonly used term.
(hif-lookup, hif-defined, hif-string-to-number, hif-tokenize, hif-nextoken)
(hif-if-valid-identifier-p, hif-define-operator, hif-expand-token-list)
(hif-parse-exp, hif-math, hif-factor, hif-get-argument-list, hif-stringify)
(hif-token-concat, hif-mathify, hif-comma, hif-token-stringification)
(hif-token-concatenation, hif-macro-supply-arguments, hif-evaluate-macro)
(hif-find-define, hif-add-new-defines, hide-ifdef-guts, hif-undefine-symbol)
(hide-ifdef-set-define-alist, hide-ifdef-use-define-alist): modified functions
for new internal data representation, mainly for stringification and white
space preservation.  Also better error handling to report source line number
and more informative error messages.
2021-06-02 20:29:00 +08:00
Lars Ingebrigtsen
b0d01982e2 Tweak octave continuation indentation
* lisp/progmodes/octave.el (octave-smie-rules): Further tweak
continuation indentation (bug#17955).
2021-05-30 06:25:47 +02:00
Lars Ingebrigtsen
0eb0fe987b Add lambda to the pretty Ruby symbols list
* lisp/progmodes/ruby-mode.el (ruby--prettify-symbols-alist): Add
lambda (bug#48681).
2021-05-29 08:09:34 +02:00
William Denton
90cd4d6cae Add pretty symbols to ruby-mode
* lisp/progmodes/ruby-mode.el (ruby--prettify-symbols-alist): Add
pretty symbols (bug#48681).
(ruby-mode): Use them.
2021-05-29 08:08:35 +02:00
Lars Ingebrigtsen
30c09a1674 Improve Octave indentation after continuation lines
* lisp/progmodes/octave.el (octave-smie-rules): Indent
continuation lines better (bug#17955).
2021-05-29 07:04:34 +02:00
Ingo Lohmar
a29a03c3bc * lisp/progmodes/sql.el: Turn `sql-*-statement-starters' to defvars.
These variables hold information on the SQL standard and
product-specific additions and should not be user-customizable.
2021-05-27 22:54:40 +02:00
Deneb Meketa
7f11dea662 Fix filling of overlong first lines in Python doc strings
* lisp/progmodes/python.el (python-fill-string): Fill overlong
first lines correctly (bug#20860).

Copyright-paperwork-exempt: yes
2021-05-27 01:21:59 +02:00
Lars Ingebrigtsen
b75db97f31 Make hs-set-up-overlay into user option
* lisp/progmodes/hideshow.el (hs-set-up-overlay): Make into
defcustom (bug#48513).
2021-05-25 22:31:00 +02:00
Lars Ingebrigtsen
0d91c2ddae Fix font and indentation of call-with-port in scheme-mode
* lisp/progmodes/scheme.el (scheme-font-lock-keywords-2): Add
call-with-port (bug#48544).
(call-with-port): Indent correctly.
2021-05-25 22:22:28 +02:00
Gregory Heytings
0b48e2d258 Fix infloop in Modula-2 mode
* lisp/progmodes/modula2.el (m2-smie-refine-colon): Stop looping
when point does not move with forward-sexp (Bug#48011).
2021-05-25 06:18:29 +02:00
Glenn Morris
19c14be04f Tweak c-mode bug reporting address
* lisp/progmodes/cc-mode.el (c-mode-help-address):
Switch to bug-gnu-emacs.  This is an alias for the previous
submit@debbugs address, except that if no Package header can be found,
as often seems to happen for cc-mode reports, debbugs will assign
the report to the "emacs" package rather than to "debbugs.gnu.org".
2021-05-23 16:03:34 -07:00
Philipp Stephani
2e55201b80 Fix find invocation for macOS (Bug#48471).
* lisp/progmodes/project.el (project--files-in-directory): Instead of
appending a slash (which doesn't work well with macOS find), remove
trailing slash and pass -H instead.
2021-05-23 13:03:49 +02:00
Tassilo Horn
62e2dce3a9 Document bug-reference setup for 3rd-party packages
* doc/emacs/maintaining.texi (Bug Reference): Add section explaining
adding support for third-party packages.
* lisp/progmodes/bug-reference.el (bug-reference-maybe-setup-from-vc)
(bug-reference-maybe-setup-from-mail)
(bug-reference-maybe-setup-from-irc): Rename from
bug-reference--maybe-setup-from-*, i.e., un-privatize them because
they are advertised in the docs now.
2021-05-22 19:06:57 +02:00
Tassilo Horn
a3de48687e Add documentation about bug-reference auto-setup.
* doc/emacs/maintaining.texi (Bug Reference): Add documentation about
the automatic setup.
* lisp/progmodes/bug-reference.el
(bug-reference-setup-from-irc-alist): Remove doubling in docstring.
2021-05-21 23:15:46 +02:00
Daniel Mendler
443d9efc95 (completing-read): Add group-function to the completion metadata
A completion table can specify a `group-function` in its metadata.
The group function takes two arguments, a completion candidate and a
transform argument.  The group function is used to group the
candidates after sorting and to enhance the completion UI with group
titles.

If the transform argument is nil, the function must return the title
of the group to which the completion candidate belongs.  The function
may also return nil if the candidate does not belong to a group.

If the transform argument is non-nil, the function must return the
transformed candidate.  For example, the transformation allows to
remove a redundant part of the candidate, which is then displayed in
the title.

The grouping functionality is guarded by the customizable variable
`completions-group` and turned off by default for the *Completions*
buffer.

The specific form of the `group-function` has been chosen in order to
allow allocation-free grouping.  This is important for completion UIs,
which continously update the displayed set of candidates (Icomplete,
Vertico, Ivy, etc.).  Only when the transform argument is non-nil the
candidate transformation is performed, which may involve a string
allocation as done in the function `xref--completing-read-group`.

The function `xref-show-definitions-completing-read` makes use of the
`group-function`, by moving the file name prefix to the title.  If
grouping is enabled, the *Completions* are displayed as
"linenum:summary" instead of "file:linenum:summary".  This way the
*Completions* buffer resembles the *Occur* buffer.

* doc/lispref/minibuf.texi: Add documentation.

* lisp/minibuffer.el (completion-metadata): Describe the
`group-function` in the docstring.
(completions-group): Add guard variable, off by default.
(completions-group-format): Add variable defining the format string
for the group titles.
(completions-group-title): Add face used by `completions-group-format`
for the group titles.
(completions-group-separator): Add face used by
`completions-group-format` for the group separator lines.
(minibuffer--group-by): New grouping function.
(minibuffer-completion-help): Use it.
(display-completion-list): Add optional GROUP-FUN argument.
(completion--insert-strings): Add optional GROUP-FUN argument.  Insert
group titles if `completions-format` is `one-column`.  Transform each
candidate with the GROUP-FUN.  Attach the untransformed candidate to
the property `completion--string`.

* lisp/simple.el (choose-completion): Retrieve the untransformed
completion candidate from the property `completion--string`.

* lisp/progmodes/xref.el:
(xref--completing-read-group): New grouping function.
(xref-show-definitions-completing-read): Use it.
2021-05-20 20:50:23 +03:00
Ingo Lohmar
dac694b8bb * lisp/progmodes/sql.el: `sql-postgres-statement-starters' defcustom
Recognize common table expression as statement start in Postgres.
2021-05-19 15:07:52 +02:00
Stefan Monnier
1276ba75eb * lisp/progmodes/js.el (js--make-framework-matcher): Use a closure 2021-05-18 20:30:08 -04:00
Stefan Monnier
942cbc4dea * lisp/progmodes/gud.el (gud-tooltip-tips): Use proper closures
Also prefer #' to quote function names.

(jdb): Fix $ => \'.
2021-05-18 20:21:51 -04:00
Dmitry Gutov
d83db639d3 Visually truncate excessively long lines in Xref
* lisp/progmodes/xref.el (xref-truncation-width): New option.
(xref--apply-truncation): New function.
(xref--insert-xrefs): Use it (bug#46859).
2021-05-18 03:36:40 +03:00
Ingo Lohmar
5a82d4ce5a prepend newline in sqli buffer
(sql-remove-continuation-prompt, sql-send-string): Move newline
insertion.

Previously, the preoutput filter `sql-remove-continuation-prompt'
inserted a leading newline in the interactive SQL buffer if it decided
that is has to remove continuation prompts and that it had found all
it was looking for.

1) This filter function was a doubtful place to do that (arguably, its
   name does not suggest any action like this).
2) The behavior worked inconsistently, eg, when sending a single-line
   "SELECT" statement, because it only ran when the filter function
   needed to remove any prompts (for example, not when sending a
   region without newlines).

   This can lead to misaligned table headers, which explains why
   emacswiki and stackoverflow both present several fixes to this
   behavior.
2021-05-16 16:32:10 +02:00
Tassilo Horn
b6d02dc376 Add bug-reference-mode-force-auto-setup
* lisp/progmodes/bug-reference.el
(bug-reference-try-setup-from-rmail): Match the Rmail mbox filename
against GROUP-REGEXP in bug-reference-setup-from-mail-alist.
(bug-reference-mode-force-auto-setup): New function which forces
auto-setup even if bug-reference-bug-regexp and
bug-reference-url-format are already set.
2021-05-16 16:19:57 +02:00
Tassilo Horn
1b8f013d17 Bug reference auto-setup for Rmail
* lisp/progmodes/bug-reference.el
(bug-reference-try-setup-from-rmail): New function setting up
`bug-reference-mode' from the current Rmail message.
2021-05-16 09:21:48 +02:00
Tassilo Horn
de61b0b25f Refactor bug-reference setup functions into a defvar
* lisp/progmodes/bug-reference.el
(bug-reference-auto-setup-functions): New defvar so that other
packages can add their own auto-setup functions to it.
* lisp/progmodes/bug-reference.el (bug-reference--run-auto-setup): Use
the new variable instead of hard-coding the 4 functions we've had
already.
2021-05-15 21:19:55 +02:00
Dmitry Gutov
efea3a02f5 Add :company-kind support to sh-mode completion
* lisp/progmodes/sh-script.el (sh--completion-keywords):
New variable.
(sh--cmd-completion-table): Extracted from here.
(sh-completion-at-point-function): Add :company-kind.
2021-05-15 03:44:16 +03:00
Lars Ingebrigtsen
1b0dc15a0a Tweak indentation of #foo in js-mode
* lisp/progmodes/js.el (js--proper-indentation): Indent #define
(etc) to column 0, but otherwise indent #foo normally (bug#47488).
2021-05-12 16:17:55 +02:00
Jim Porter
d2034296a9 Abbreviate rgrep command on MS Windows (bug#48302)
* lisp/progmodes/grep.el (grep-mode-font-lock-keywords):
Adapt regexp to match MS Windows-style shell-quoting.

* test/lisp/progmodes/grep-tests.el: New file.
2021-05-12 10:47:07 +02:00
Stefan Monnier
fa9f61e0f6 * lisp/font-lock.el: Fix font-lock-comment-end-skip fallback (bug#34088)
(font-lock-fontify-syntactically-region): Use `comment-end-skip` as
fallback for `font-lock-comment-end-skip`, as is done for
`font-lock-comment-start-skip` (and as the name suggests).

* lisp/progmodes/opascal.el (opascal-mode): Revert last change,
made unnecessary.
2021-05-11 13:19:50 -04:00
Andrea Corallo
63df3372be Rename comp-deferred-compilation
* lisp/progmodes/elisp-mode.el
	(emacs-lisp-native-compile-and-load): Rename
	comp-deferred-compilation -> native-comp-deferred-compilation.
	* src/comp.c (maybe_defer_native_compilation, syms_of_comp):
	Likewise.
2021-05-11 18:31:45 +02:00
Lars Ingebrigtsen
17a950cc80 Fix comment end delimiter fontification in OPascal mode
* lisp/progmodes/opascal.el (opascal-mode): Fontify the ending
brace with `font-lock-comment-delimiter-face' correctly (bug#34088).
2021-05-11 15:52:33 +02:00
Lars Ingebrigtsen
6b7e93e444 Fix indentation of lines starting with # in js-mode
* lisp/progmodes/js.el (js--proper-indentation): # is not like in
C -- it doesn't have to appear on the beginning of the line
(bug#47488).
2021-05-09 11:44:33 +02:00
Jim Porter
704755a568 Shell-quote the directory when finding a project's files
* lisp/progmodes/project.el (project--files-in-directory):
Shell-quote the directory (bug48247).
2021-05-06 20:44:50 +03:00
Dmitry Gutov
8616e4f747 project--buffer-list: Tighten the check
* lisp/progmodes/project.el (project--buffer-list): Tighten the
check to speed up in the presence of multiple Tramp sessions, too.
(https://lists.gnu.org/archive/html/emacs-devel/2021-05/msg00152.html)
2021-05-06 20:43:02 +03:00
Harald Jörg
9e0fc5321b cperl-mode: Eliminate bad interpretation of ?foo?
* lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): Delete
?? from the allowed bare regexp delimiters.
(cperl-short-docs): Delete ?...? from the documentation.

* test/lisp/progmodes/cperl-mode-tests.el (cperl-bug-47598):
Add tests for good, bad, and ambiguous use of ? as regex
delimiter (bug#47598).
2021-05-06 12:33:40 +02:00
Matt Beshara
14c9245e82 Remove unnecessary call to message in js.el
* lisp/progmodes/js.el (js--end-of-defun-nested): Remove debugging
message left over (bug#48234).
2021-05-05 14:49:33 +02:00
Basil L. Contovounesios
3783e7fb4d Remove unused lexical variables in cc-defs.el
* lisp/progmodes/cc-defs.el (c-sc-scan-lists-no-category+1+1)
(c-sc-scan-lists-no-category+1-1, c-sc-scan-lists-no-category-1+1)
(c-sc-scan-lists-no-category-1-1): Remove unused lexical variable
'here' to pacify byte-compilation warnings in cc-engine.el.
2021-05-04 21:00:05 +01:00
Philip K
3c4619edeb project--buffer-list: Avoid Tramp buffers when possible
* project.el (project--buffer-list): Add file-remote-p check.
2021-05-04 00:36:00 +03:00
Steve Purcell
81fc95bf22 ruby-mode.el: puts and printf do not require args
* lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): puts and
printf can be called without arguments, so the font locking of
"bare" calls to either is incorrect.  The fix is to font-lock them
as for other kernel methods which accepts zero or more arguments
(bug#48180).
2021-05-03 09:41:44 +02:00
Alan Mackenzie
84a2a4715b * lisp/progmodes/cc-defs (c-save-buffer-state): Amend debug spec, t to let*
This should solve part of bug #48100.
2021-05-02 15:25:14 +00:00
Jim Porter
019c70e731 Fix GUD overlay arrows in gdb-mi when debugging over Tramp
* lisp/progmodes/gdb-mi.el (gdb-frame-handler): Use local part of
file name when setting `gud-last-frame'.
2021-05-01 12:09:36 +02:00
Dmitry Gutov
1054525ae3 * lisp/progmodes/project.el: Also bump version. 2021-04-29 05:02:13 +03:00
Dmitry Gutov
a3c77dda95 * lisp/progmodes/xref.el: Bump version. 2021-04-29 05:02:13 +03:00