Merge from origin/emacs-25
3f481ad
Rename xref-query-replace to xref-query-replace-in-results62f4ed4
Update cl-defgeneric and cl-defmethod docstrings2111e0e
Comment out next-error-function integration in xref4e11ad3
Correct a use of "which" in intro.texia1865bc
Distinguish the two meanings of Java's keyword "default". Fixes bug #22358.76045f7
Don't operate on menu bar of nonexistent framec32f3bc
Unbreak the GNUstep build.
This commit is contained in:
commit
1a9cec16fe
11 changed files with 75 additions and 48 deletions
|
@ -797,8 +797,8 @@ Perform @code{query-replace-regexp} on each of the specified files,
|
|||
replacing matches for @var{regexp} with the string
|
||||
@var{to} (@code{dired-do-find-regexp-and-replace}).
|
||||
|
||||
This command is a variant of @code{xref-query-replace}. It presents
|
||||
an @file{*xref*} buffer that lists all the matches of @var{regexp},
|
||||
This command is a variant of @code{xref-query-replace-in-results}. It
|
||||
presents an @file{*xref*} buffer that lists all the matches of @var{regexp},
|
||||
and you can use the special commands in that buffer (@pxref{Xref
|
||||
Commands}). In particular, if you exit the query replace loop, you
|
||||
can use @kbd{r} in that buffer to replace more matches.
|
||||
|
|
|
@ -1875,11 +1875,11 @@ Move to the previous reference and display it in the other window
|
|||
@findex xref-show-location-at-point
|
||||
Display the reference on the current line in the other window
|
||||
(@code{xref-show-location-at-point}).
|
||||
@findex xref-query-replace
|
||||
@findex xref-query-replace-in-results
|
||||
@item r @var{pattern} @key{RET} @var{replacement} @key{RET}
|
||||
Perform interactive query-replace on references that match
|
||||
@var{pattern} (@code{xref-query-replace}), replacing the match with
|
||||
@var{replacement}. @xref{Identifier Search}.
|
||||
@var{pattern} (@code{xref-query-replace-in-results}), replacing
|
||||
the match with @var{replacement}. @xref{Identifier Search}.
|
||||
@findex xref-quit
|
||||
@item q
|
||||
Quit the window showing the @file{*xref*} buffer (@code{xref-quit}).
|
||||
|
@ -1901,7 +1901,7 @@ them.
|
|||
@table @kbd
|
||||
@item M-?
|
||||
Find all the references for the identifier at point.
|
||||
@item M-x xref-query-replace @key{RET} @var{regexp} @key{RET} @var{replacement} @key{RET}
|
||||
@item M-x xref-query-replace-in-results @key{RET} @var{regexp} @key{RET} @var{replacement} @key{RET}
|
||||
Interactively replace @var{regexp} with @var{replacement} in the names
|
||||
of all the identifiers shown in the @file{*xref*} buffer.
|
||||
@item M-x tags-search @key{RET} @var{regexp} @key{RET}
|
||||
|
@ -1923,8 +1923,8 @@ identifier, showing the file name and the line where the identifier is
|
|||
referenced. The XREF mode commands are available in this buffer, see
|
||||
@ref{Xref Commands}.
|
||||
|
||||
@findex xref-query-replace
|
||||
@kbd{M-x xref-query-replace} reads a regexp to match identifier
|
||||
@findex xref-query-replace-in-results
|
||||
@kbd{M-x xref-query-replace-in-results} reads a regexp to match identifier
|
||||
names and a replacement string, just like ordinary @kbd{M-x
|
||||
query-replace-regexp}. It then performs the specified replacement in
|
||||
the names of the matching identifiers in all the places in all the
|
||||
|
|
|
@ -191,7 +191,7 @@ in Lisp programs also.
|
|||
In contexts where a truth value is expected, any non-@code{nil} value
|
||||
is considered to be @var{true}. However, @code{t} is the preferred way
|
||||
to represent the truth value @var{true}. When you need to choose a
|
||||
value which represents @var{true}, and there is no other basis for
|
||||
value that represents @var{true}, and there is no other basis for
|
||||
choosing, use @code{t}. The symbol @code{t} always has the value
|
||||
@code{t}.
|
||||
|
||||
|
|
4
etc/NEWS
4
etc/NEWS
|
@ -1230,8 +1230,8 @@ viewing HTML files and the like.
|
|||
|
||||
*** New user interface for the `A' and `Q' commands.
|
||||
These keys, now bound to `dired-do-find-regexp' and
|
||||
`dired-do-find-regexp-and-replace', work similarly to
|
||||
`xref-find-apropos' and `xref-query-replace': they present the matches
|
||||
`dired-do-find-regexp-and-replace', work similarly to `xref-find-apropos'
|
||||
and `xref-query-replace-in-results': they present the matches
|
||||
in the `*xref*' buffer and let you move through the matches. No need
|
||||
to use `tags-loop-continue' to resume the search or replace loop. The
|
||||
previous commands, `dired-do-search' and
|
||||
|
|
|
@ -2714,7 +2714,7 @@ with the command \\[tags-loop-continue]."
|
|||
'(dired-get-marked-files nil nil 'dired-nondirectory-p)))
|
||||
|
||||
(declare-function xref--show-xrefs "xref")
|
||||
(declare-function xref-query-replace "xref")
|
||||
(declare-function xref-query-replace-in-results "xref")
|
||||
|
||||
;;;###autoload
|
||||
(defun dired-do-find-regexp (regexp)
|
||||
|
@ -2746,7 +2746,7 @@ with the command \\[tags-loop-continue]."
|
|||
"Query replace regexp in marked files" t t)))
|
||||
(list (nth 0 common) (nth 1 common))))
|
||||
(with-current-buffer (dired-do-find-regexp from)
|
||||
(xref-query-replace from to)))
|
||||
(xref-query-replace-in-results from to)))
|
||||
|
||||
(defun dired-nondirectory-p (file)
|
||||
(not (file-directory-p file)))
|
||||
|
|
|
@ -83,8 +83,6 @@
|
|||
;; - A generic "filter" generalizer (e.g. could be used to cleanly add methods
|
||||
;; to cl-generic-combine-methods with a specializer that says it applies only
|
||||
;; when some particular qualifier is used).
|
||||
;; - A way to dispatch on the context (e.g. the major-mode, some global
|
||||
;; variable, you name it).
|
||||
|
||||
;;; Code:
|
||||
|
||||
|
@ -195,9 +193,9 @@ OPTIONS-AND-METHODS currently understands:
|
|||
- (declare DECLARATIONS)
|
||||
- (:argument-precedence-order &rest ARGS)
|
||||
- (:method [QUALIFIERS...] ARGS &rest BODY)
|
||||
BODY, if present, is used as the body of a default method.
|
||||
DEFAULT-BODY, if present, is used as the body of a default method.
|
||||
|
||||
\(fn NAME ARGS [DOC-STRING] [OPTIONS-AND-METHODS...] &rest BODY)"
|
||||
\(fn NAME ARGS [DOC-STRING] [OPTIONS-AND-METHODS...] &rest DEFAULT-BODY)"
|
||||
(declare (indent 2) (doc-string 3))
|
||||
(let* ((doc (if (stringp (car-safe options-and-methods))
|
||||
(pop options-and-methods)))
|
||||
|
@ -360,10 +358,10 @@ the specializer used will be the one returned by BODY."
|
|||
(defmacro cl-defmethod (name args &rest body)
|
||||
"Define a new method for generic function NAME.
|
||||
I.e. it defines the implementation of NAME to use for invocations where the
|
||||
value of the dispatch argument matches the specified TYPE.
|
||||
The dispatch argument has to be one of the mandatory arguments, and
|
||||
all methods of NAME have to use the same argument for dispatch.
|
||||
The dispatch argument and TYPE are specified in ARGS where the corresponding
|
||||
values of the dispatch arguments match the specified TYPEs.
|
||||
The dispatch arguments have to be among the mandatory arguments, and
|
||||
all methods of NAME have to use the same set of arguments for dispatch.
|
||||
Each dispatch argument and TYPE are specified in ARGS where the corresponding
|
||||
formal argument appears as (VAR TYPE) rather than just VAR.
|
||||
|
||||
The optional second argument QUALIFIER is a specifier that
|
||||
|
@ -373,8 +371,14 @@ modifies how the method is combined with other methods, including:
|
|||
:around - Method will be called around everything else
|
||||
The absence of QUALIFIER means this is a \"primary\" method.
|
||||
|
||||
Other than a type, TYPE can also be of the form `(eql VAL)' in
|
||||
which case this method will be invoked when the argument is `eql' to VAL.
|
||||
TYPE can be one of the basic types (see the full list and their
|
||||
hierarchy in `cl--generic-typeof-types'), CL struct type, or an
|
||||
EIEIO class.
|
||||
|
||||
Other than that, TYPE can also be of the form `(eql VAL)' in
|
||||
which case this method will be invoked when the argument is `eql'
|
||||
to VAL, or `(head VAL)', in which case the argument is required
|
||||
to be a cons with VAL as its head.
|
||||
|
||||
\(fn NAME [QUALIFIER] ARGS &rest [DOCSTRING] BODY)"
|
||||
(declare (doc-string 3) (indent 2)
|
||||
|
|
|
@ -10066,7 +10066,19 @@ comment at the start of cc-engine.el for more info."
|
|||
paren-state)))
|
||||
|
||||
;; CASE 14: A case or default label
|
||||
((looking-at c-label-kwds-regexp)
|
||||
((save-excursion
|
||||
(and (looking-at c-label-kwds-regexp)
|
||||
(or (c-major-mode-is 'idl-mode)
|
||||
(and
|
||||
containing-sexp
|
||||
(goto-char containing-sexp)
|
||||
(eq (char-after) ?{)
|
||||
(progn (c-backward-syntactic-ws) t)
|
||||
(eq (char-before) ?\))
|
||||
(c-go-list-backward)
|
||||
(progn (c-backward-syntactic-ws) t)
|
||||
(c-simple-skip-symbol-backward)
|
||||
(looking-at c-block-stmt-2-key)))))
|
||||
(if containing-sexp
|
||||
(progn
|
||||
(goto-char containing-sexp)
|
||||
|
@ -10082,6 +10094,7 @@ comment at the start of cc-engine.el for more info."
|
|||
((save-excursion
|
||||
(back-to-indentation)
|
||||
(and (not (looking-at c-syntactic-ws-start))
|
||||
(not (looking-at c-label-kwds-regexp))
|
||||
(c-forward-label)))
|
||||
(cond (containing-decl-open
|
||||
(setq placeholder (c-add-class-syntax 'inclass
|
||||
|
|
|
@ -1972,8 +1972,8 @@ will be handled."
|
|||
;; In CORBA CIDL:
|
||||
"bindsTo" "delegatesTo" "implements" "proxy" "storedOn")
|
||||
;; Note: "const" is not used in Java, but it's still a reserved keyword.
|
||||
java '("abstract" "const" "final" "native" "private" "protected" "public"
|
||||
"static" "strictfp" "synchronized" "transient" "volatile")
|
||||
java '("abstract" "const" "default" "final" "native" "private" "protected"
|
||||
"public" "static" "strictfp" "synchronized" "transient" "volatile")
|
||||
pike '("final" "inline" "local" "nomask" "optional" "private" "protected"
|
||||
"public" "static" "variant"))
|
||||
|
||||
|
|
|
@ -502,7 +502,7 @@ WINDOW controls how the buffer is displayed:
|
|||
(xref-quit)
|
||||
(xref--pop-to-location xref window)))
|
||||
|
||||
(defun xref-query-replace (from to)
|
||||
(defun xref-query-replace-in-results (from to)
|
||||
"Perform interactive replacement of FROM with TO in all displayed xrefs.
|
||||
|
||||
This command interactively replaces FROM with TO in the names of the
|
||||
|
@ -589,7 +589,7 @@ references displayed in the current *xref* buffer."
|
|||
(define-key map [remap quit-window] #'xref-quit)
|
||||
(define-key map (kbd "n") #'xref-next-line)
|
||||
(define-key map (kbd "p") #'xref-prev-line)
|
||||
(define-key map (kbd "r") #'xref-query-replace)
|
||||
(define-key map (kbd "r") #'xref-query-replace-in-results)
|
||||
(define-key map (kbd "RET") #'xref-goto-xref)
|
||||
(define-key map (kbd "C-o") #'xref-show-location-at-point)
|
||||
;; suggested by Johan Claesson "to further reduce finger movement":
|
||||
|
@ -600,8 +600,10 @@ references displayed in the current *xref* buffer."
|
|||
(define-derived-mode xref--xref-buffer-mode special-mode "XREF"
|
||||
"Mode for displaying cross-references."
|
||||
(setq buffer-read-only t)
|
||||
(setq next-error-function #'xref--next-error-function)
|
||||
(setq next-error-last-buffer (current-buffer)))
|
||||
;; FIXME: http://debbugs.gnu.org/20489
|
||||
;; (setq next-error-function #'xref--next-error-function)
|
||||
;; (setq next-error-last-buffer (current-buffer))
|
||||
)
|
||||
|
||||
(defun xref--next-error-function (n reset?)
|
||||
(when reset?
|
||||
|
|
23
src/nsterm.m
23
src/nsterm.m
|
@ -1161,11 +1161,24 @@ @implementation EmacsBell
|
|||
|
||||
- (id)init;
|
||||
{
|
||||
NSTRACE ("[EmacsBell init]");
|
||||
if ((self = [super init]))
|
||||
{
|
||||
nestCount = 0;
|
||||
isAttached = false;
|
||||
#ifdef NS_IMPL_GNUSTEP
|
||||
// GNUstep doesn't provide named images. This was reported in
|
||||
// 2011, see https://savannah.gnu.org/bugs/?33396
|
||||
//
|
||||
// As a drop in replacment, a semi tranparent gray square is used.
|
||||
self.image = [[NSImage alloc] initWithSize:NSMakeSize(32, 32)];
|
||||
[self.image lockFocus];
|
||||
[[NSColor colorForEmacsRed:0.5 green:0.5 blue:0.5 alpha:0.5] set];
|
||||
NSRectFill(NSMakeRect(0, 0, 32, 32));
|
||||
[self.image unlockFocus];
|
||||
#else
|
||||
self.image = [NSImage imageNamed:NSImageNameCaution];
|
||||
#endif
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -1572,7 +1585,6 @@ static void hide_bell ()
|
|||
NSRect wr = [window frame];
|
||||
int tb = FRAME_EXTERNAL_TOOL_BAR (f);
|
||||
int pixelwidth, pixelheight;
|
||||
int rows, cols;
|
||||
int orig_height = wr.size.height;
|
||||
|
||||
NSTRACE ("x_set_window_size");
|
||||
|
@ -1590,15 +1602,11 @@ static void hide_bell ()
|
|||
{
|
||||
pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width);
|
||||
pixelheight = FRAME_TEXT_TO_PIXEL_HEIGHT (f, height);
|
||||
cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth);
|
||||
rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelheight);
|
||||
}
|
||||
else
|
||||
{
|
||||
pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width);
|
||||
pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height);
|
||||
cols = width;
|
||||
rows = height;
|
||||
}
|
||||
|
||||
/* If we have a toolbar, take its height into account. */
|
||||
|
@ -2631,13 +2639,13 @@ static void hide_bell ()
|
|||
[img setXBMColor: bm_color];
|
||||
}
|
||||
|
||||
#ifdef NS_IMPL_COCOA
|
||||
// Note: For periodic images, the full image height is "h + hd".
|
||||
// By using the height h, a suitable part of the image is used.
|
||||
NSRect fromRect = NSMakeRect(0, 0, p->wd, p->h);
|
||||
|
||||
NSTRACE_RECT ("fromRect", fromRect);
|
||||
|
||||
#ifdef NS_IMPL_COCOA
|
||||
[img drawInRect: r
|
||||
fromRect: fromRect
|
||||
operation: NSCompositeSourceOver
|
||||
|
@ -6357,7 +6365,6 @@ - (void) updateFrameSize: (BOOL) delay;
|
|||
if (oldr != rows || oldc != cols || neww != oldw || newh != oldh)
|
||||
{
|
||||
NSView *view = FRAME_NS_VIEW (emacsframe);
|
||||
NSWindow *win = [view window];
|
||||
|
||||
change_frame_size (emacsframe,
|
||||
FRAME_PIXEL_TO_TEXT_WIDTH (emacsframe, neww),
|
||||
|
@ -7778,8 +7785,6 @@ - (void)performZoom:(id)sender
|
|||
|
||||
- (void)zoom:(id)sender
|
||||
{
|
||||
struct frame * f = SELECTED_FRAME ();
|
||||
|
||||
NSTRACE ("[EmacsWindow zoom:]");
|
||||
|
||||
ns_update_auto_hide_menu_bar();
|
||||
|
|
21
src/xfns.c
21
src/xfns.c
|
@ -6084,16 +6084,19 @@ Value is t if tooltip was open, nil otherwise. */)
|
|||
items is unmapped. Redisplay the menu manually... */
|
||||
{
|
||||
Widget w;
|
||||
struct frame *f = SELECTED_FRAME ();
|
||||
w = f->output_data.x->menubar_widget;
|
||||
struct frame *f = SELECTED_FRAME ();
|
||||
if (FRAME_X_P (f) && FRAME_LIVE_P (f))
|
||||
{
|
||||
w = f->output_data.x->menubar_widget;
|
||||
|
||||
if (!DoesSaveUnders (FRAME_DISPLAY_INFO (f)->screen)
|
||||
&& w != NULL)
|
||||
{
|
||||
block_input ();
|
||||
xlwmenu_redisplay (w);
|
||||
unblock_input ();
|
||||
}
|
||||
if (!DoesSaveUnders (FRAME_DISPLAY_INFO (f)->screen)
|
||||
&& w != NULL)
|
||||
{
|
||||
block_input ();
|
||||
xlwmenu_redisplay (w);
|
||||
unblock_input ();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* USE_LUCID */
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue