Magit-Popup User Manual

Similar documents
ag.el Documentation Release 0.45 Wilfred Hughes

A guided tour of hydra.el

Smartparens Documentation

entity tomove over backward forward character C-b C-f word M-b M-f line C-p C-n go to line beginning (or end) C-a C-e sentence M-a M-e paragraph M- M-

Smarty Mode A GNU XEmacs mode for editing Smarty templates. Vincent DEBOUT

Phil Sung. Special thanks to Piaw Na and Arthur Gleckler

Vanilla Lisp Shell (VLS)

Editing and Running Standard ML under GNU Emacs

Getting Started With XEmacs

Editing and Running Standard ML under GNU Emacs

Common Git Commands. Git Crash Course. Teon Banek April 7, Teon Banek (TakeLab) Common Git Commands TakeLab 1 / 18

Using nu/tpu on UNIX Last revised: 1/28/00

Task-Oriented Solutions to Over 175 Common Problems. Covers. Eclipse 3.0. Eclipse CookbookTM. Steve Holzner

GNU Info. for version 4.2, 23 March Brian J. Fox

Introduction to the Emacs Editor

Introduction to GNU Emacs

A beginner s guide to (GNU) Emacs 24

ESA: A CLIM Library for Writing Emacs-Style Applications

Emacs manual:

AUTOTEXT MASTER 1 PROGRAM HELP GILLMEISTER SOFTWARE.

Using the Zoo Workstations

Roxen Content Provider

Stand-alone GNU Info. for version 6.5, 21 May Brian J. Fox and Texinfo maintainers

Modern Programming Languages. Lecture LISP Programming Language An Introduction

Working in Teams CS 520 Theory and Practice of Software Engineering Fall 2018

Skip the first SKIP1 bytes of FILE1 and the first SKIP2 bytes of FILE2. l verbose Output byte numbers and values of all differing bytes.

Programmer s Style Guide

7.1 INTRODUCTION 7.2 STARTING Emacs 7.3 Emacs SCREEN Menu Bar Text Mode Menu Mode Line Echo Line

Using the aregcmd Commands

Chapter 1 Getting Started

SCHEME AND CALCULATOR 5b

Creating Word Outlines from Compendium on a Mac

AStyle C/C++ Source Code Formatter Plugin

News in RSA-RTE 10.1 updated for sprint Mattias Mohlin, November 2017

Eli System Administration Guide

Mastering Linux by Paul S. Wang Appendix: The emacs Editor

GNU Emacs REDUCE IDE. Francis J. Wright (

IC Documentation. Release 0.1. IC team

Software Manual for Windows Z/EVES Version 2.3

Textadept Quick Reference

Introduction Variables Helper commands Control Flow Constructs Basic Plumbing. Bash Scripting. Alessandro Barenghi

An Explicit Continuation Evaluator for Scheme

step is to see how C++ implements type polymorphism, and this Exploration starts you on that journey.

Basics of Using Lisp! Gunnar Gotshalks! BLU-1

! Emacs Howto Tutorial!

CS 520: VCS and Git. Intermediate Topics Ben Kushigian

XREPL: extended REPL

9.2 Linux Essentials Exam Objectives

Source Control: Subversion

git commit --amend git rebase <base> git reflog git checkout -b Create and check out a new branch named <branch>. Drop the -b

Python RPM Porting Guide Release 0.1

luacheck Documentation

6.001 Notes: Section 15.1

News in RSA-RTE 10.1 updated for sprint Mattias Mohlin, January 2018

Annotation Hammer Venkat Subramaniam (Also published at

Source Control: Subversion

LP/LispLite: Trivial Lisp Org Mode Conversion

ACT-R Environment Manual

Textadept Quick Reference

File Structure and URLs Introduction (1 of 5) Introduction

my $reply = $term->get_reply( prompt => 'What is your favourite colour?', choices => [qw blue red green ], default => blue, );

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

withenv Documentation

A Brief Haskell and GHC Refresher

Persistent Data Structures and Managed References

6.184 Lecture 4. Interpretation. Tweaked by Ben Vandiver Compiled by Mike Phillips Original material by Eric Grimson

Copyright. Trademarks Attachmate Corporation. All rights reserved. USA Patents Pending. WRQ ReflectionVisual Basic User Guide

The Rock branching strategy is based on the Git Branching Model documented by Vincent Driessen.

$bool = $obj->mk_aliases( # create an alias to an existing alias_name => 'method'); # method name

SEWCAT USER MANUAL V APRIL 14, 2017 S & S COMPUTING Oak Ridge, TN 37830

1. Installing R4E 1. 1) Provision Software Sites 2. 2) Install Version Control System Features 3. 3) Install R4E feature 4. 4) Install Versions

Ledger Mode. Emacs Support For Version 3.0 of Ledger. Craig Earls

2 Initialize a git repository on your machine, add a README file, commit and push

Nano-Lisp The Tutorial Handbook

Friday, 11 April 14. Advanced methods for creating decorators Graham Dumpleton PyCon US - April 2014

Dataflow Editor User Guide

Python Project Documentation

SciGraphica. Tutorial Manual - Tutorials 1and 2 Version 0.8.0

Libgdb. Version 0.3 Oct Thomas Lord

6.037 Lecture 4. Interpretation. What is an interpreter? Why do we need an interpreter? Stages of an interpreter. Role of each part of the interpreter

Recitation: Cache Lab & C

Textadept Quick Reference. Mitchell

The Spectacle Handbook. Boudhayan Gupta Boudhayan Gupta

Identity, State and Values

PREPARING FOR PRELIM 1

INF4820: Algorithms for Artificial Intelligence and Natural Language Processing. Common Lisp Fundamentals

CitectSCADA Batch Tutorial

C311 Lab #3 Representation Independence: Representation Independent Interpreters

Getting Started with Emacs

13 Working with PID/PID2 blocks In this chapter

Pragmatic Guide to Git

Lists. Michael P. Fourman. February 2, 2010

Instantiation of Template class

contribution-guide.org Release

Functional Languages. CSE 307 Principles of Programming Languages Stony Brook University

Introduction, Instructions and Conventions

CS 220: Introduction to Parallel Computing. Input/Output. Lecture 7

The Turing Environment

doubles Documentation

Tutorial 5 Advanced Queries and Enhancing Table Design

Transcription:

Magit-Popup User Manual for version 2.12.2 (v2.12.2-6-gbd04ebd+1) Jonas Bernoulli

Copyright (C) 2015-2018 Jonas Bernoulli <jonas@bernoul.li> You can redistribute this document and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This document is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABIL- ITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

i Table of Contents 1 Introduction..................................... 1 2 Usage............................................. 3 2.1 Customizing Existing Popups................................... 4 2.2 Other Options.................................................. 6 3 Defining Prefix and Suffix Commands......... 8 3.1 Defining Prefix Commands..................................... 8 3.2 Defining Suffix Commands..................................... 11

1 1 Introduction Taking inspiration from regular prefix commands and prefix arguments, this library implements a similar abstraction; a new kind of prefix command that is associated with a specific set of infix arguments and suffix commands. Invoking such a prefix command displays a popup buffer which lists the associated infix arguments and suffix commands. In that buffer each argument is prefixed with the key sequence that can be used to toggle it or change its value. Likewise each suffix command is prefixed with the key used to invoke it. Such a popup buffer might look like this:,----------------------------------------- Switches -l Show graph (--graph) -d Show refnames (--decorate) Options =m Search messages (--grep="popup") =p Search patches (-G) Action l Show log for current branch o Show log for another branch ----------------------------------------- The user could then for example type -l to toggle the --graph switch (when it is on then it is shown in green, otherwise in gray), or =m to change the value of the option --grep. Once all arguments are as desired one invokes a suffix command, which causes the popup buffer to disappear. The suffix command should then retrieve the infix arguments in its interactive form like this is done for prefix arguments. While such "prefix-infix-suffix" combos were inspired by regular prefix commands and prefix arguments, they are also quite different. This should illustrate the most basic differences: A regular prefix command /- command1 prefix --- command2 \- command3 Prefix arguments /- command1 C-u... --- command2 \- well any command A Prefix-Infix-Suffix combo /- argument1 -\ /- suffix1 prefix----- argument2 --+-- suffix2 ^ \- argument3 -/ -------- (refresh buffer)

2 This library was written as a replacement for magit-key-mode, which was used in Magit releases before 2.1.0. It is used to implement all "popups" in the current Magit release but a future release will switch to yet another implementation. This library does not depend on any other Magit libraries and it is distributed as a separate package, which makes it possible to use it in packages that are not related to Magit. But keep in mind that it will be deprecated eventually.

3 2 Usage Every popup buffers created with a prefix command contains a section named "Actions" listing the available suffix commands. Most buffers also contain a "Switches" and/or an "Options" section which list the two types of infix arguments separately. Switches are arguments that can be toggled on or off. When a switch is active then it is shown in color, when it is off then it is shown in gray (of course the details depend on the color theme in use). Options are arguments that have a value. When an option has a value then that is shown after the option itself. Because for some options the empty string is a valid value, options are additionally colorized like switches to indicate whether they are active or not. The events bound to suffix commands are always single alphabetic characters. The bindings for arguments are always two events long. For switches the first key is always -, for options it is always =. The second key is always an alphabetic character. By default popup buffers also feature a section listing commands common to all popups. To avoid conflicts with suffix commands, the bindings of these common commands are not alphabetic characters. This section is shown by default so that documentation-resistant users get a chance to notice them. magit-popup-show-common-commands [User Option] This option controls whether the section that lists the commands that are common to all popups is initially shown. By default this is not the case, but note that you can temporarily show this section using C-t, which therefore is the only common command you actually have to memorize. C-t C-g (magit-popup-toggle-show-common-commands) Show or hide the section listing the commands shared by all popups. (magit-popup-quit) Quit popup buffer without invoking a suffix command. Without further action, setting arguments only affects the next suffix command. Invoking the same prefix command again resets the arguments to their default value, but the defaults can be changed directly from the popup buffer itself. For a prefix command named NAME-popup the default values are stored as the value of the custom option named NAME-arguments. While this option can be customized using the Custom interface, it is better to do so directly from the popup buffer. C-c C-c C-x C-s (magit-popup-set-default-arguments) This sets the default value for the arguments for the current popup. Then the popup buffer is closed without invoking a suffix command; unless a prefix argument is used in which case the popup remains open. (magit-popup-save-default-arguments) This sets the default value for the arguments for the current popup and saves it for future Emacs sessions. Then the popup buffer is closed without invoking an action; unless a prefix argument is used in which case the popup remains open.

Chapter 2: Usage 4 It is also possible to add additional arguments and commands to an existing popup, but that cannot be done directly from the popup (or the Custom interface). See Section 2.1 [Customizing Existing Popups], page 4. Documentation about a popup s arguments and commands can be shown directly from the popup. C-h i (magit-popup-info) Show this manual.? (magit-popup-help) This command reads a key sequence and then shows the documentation of the argument or command that sequence is bound to. In other words type the same keys that you would use to invoke the argument or command, but prefix the sequence with?. For suffix commands this shows the doc-string. For arguments this command can only show something for popups that have an associated man-page. If the man-page is set, then this command displays it in a separate buffer and puts point on the entry about the argument in question. The buffer which is used to display the documentation is selected. Simply press q to leave that buffer and restore the old window configuration. While it isn t very useful, it is possible to move around in a popup buffer using C-p and C-n, and to invoke the argument or command at point using RET. But it is much more efficient to use the dedicated key bindings instead, so these commands are not listed in popup buffers along with the other common commands. 2.1 Customizing Existing Popups It is possible to define additional infix arguments and suffix commands to an existing popup using the following functions. You can find some examples which use the below commands at https://github.com/ magit/magit/wiki/additional-proposed-infix-arguments-and-suffix-commands. magit-define-popup-switch popup key desc switch &optional enable at prepend In POPUP, define KEY as SWITCH. [Function] POPUP is a popup command defined using magit-define-popup. SWITCH is a string representing an argument that takes no value. KEY is a character representing the second event in the sequence of keystrokes used to toggle the argument. (The first event, the prefix, is shared among all switches, defaults to -, and can be changed in magit-popup-mode-keymap). DESC is a string describing the purpose of the argument, it is displayed in the popup. If optional ENABLE is non-nil then the switch is on by default. SWITCH is inserted after all other switches already defined for POPUP, unless optional PREPEND is non-nil, in which case it is placed first. If optional AT is non-nil then it should be the KEY of another switch already defined for POPUP, the argument is then placed before or after AT, depending on PREPEND.

Chapter 2: Usage 5 magit-define-popup-option popup key desc option &optional reader value at prepend In POPUP, define KEY as OPTION. [Function] POPUP is a popup command defined using magit-define-popup. OPTION is a string representing an argument that takes a value. KEY is a character representing the second event in the sequence of keystrokes used to set the argument s value. (The first event, the prefix, is shared among all options, defaults to =, and can be changed in magit-popup-mode-keymap). DESC is a string describing the purpose of the argument, it is displayed in the popup. If optional VALUE is non-nil then the option is on by default, and VALUE is its default value. READER is used to read a value from the user when the option is invoked and does not currently have a value. It should take one argument and use it as the prompt. If this is nil, then read-from-minibuffer is used. OPTION is inserted after all other options already defined for POPUP, unless optional PREPEND is non-nil, in which case it is placed first. If optional AT is non-nil then it should be the KEY of another option already defined for POPUP, the argument is then placed before or after AT, depending on PREPEND. magit-define-popup-action popup key desc command &optional at prepend In POPUP, define KEY as COMMAND. [Function] POPUP is a popup command defined using magit-define-popup. COMMAND can be any command but should usually consume the popup arguments in its interactive form. KEY is a character representing the event used invoke the action, i.e. to interactively call the COMMAND. DESC is a string describing the purpose of the action, it is displayed in the popup. COMMAND is inserted after all other commands already defined for POPUP, unless optional PREPEND is non-nil, in which case it is placed first. If optional AT is nonnil then it should be the KEY of another command already defined for POPUP, the command is then placed before or after AT, depending on PREPEND. magit-define-popup-sequence-action popup key desc command [Function] &optional at prepend Like magit-define-popup-action, but modifies the value of the :sequence-actions property instead of :actions. magit-define-popup-variable popup key desc command formatter &optional at prepend In POPUP, define KEY as COMMAND. [Function] POPUP is a popup command defined using magit-define-popup. COMMAND is a command which calls magit-popup-set-variable. FORMATTER is a function which calls magit-popup-format-variable. These two functions have to be called with the same arguments. KEY is a character representing the event used interactively call the COMMAND.

Chapter 2: Usage 6 DESC is the variable or a representation thereof. It s not actually used for anything. COMMAND is inserted after all other commands already defined for POPUP, unless optional PREPEND is non-nil, in which case it is placed first. If optional AT is nonnil then it should be the KEY of another command already defined for POPUP, the command is then placed before or after AT, depending on PREPEND." magit-change-popup-key popup type from to [Function] In POPUP, bind TO to what FROM was bound to. TYPE is one of :action, :sequence-action, :switch, or :option. Bind TO and unbind FROM, both are characters. magit-remove-popup-key popup type key [Function] In POPUP, remove KEY s binding of TYPE. POPUP is a popup command defined using magit-define-popup. TYPE is one of :action, :sequence-action, :switch, or :option. KEY is the character which is to be unbound. It is also possible to change other aspects of a popup by setting a property using plist-put. See Section 3.1 [Defining Prefix Commands], page 8, for valid properties. The most likely change Magit users might want to make is: (plist-put magit-show-refs-popup :use-prefix nil) 2.2 Other Options magit-popup-use-prefix-argument [User Option] This option controls the effect that the use of a prefix argument before entering a popup has. default With a prefix argument directly invoke the popup s default action (an Emacs command), instead of bringing up the popup. popup With a prefix argument bring up the popup, otherwise directly invoke the popup s default action. nil Ignore prefix arguments. This option can be overridden for individual popups. magit-show-refs-popup for example defaults to invoking the default action directly. It only shows the popup buffer when a prefix argument is used. See Section 2.1 [Customizing Existing Popups], page 4. magit-popup-manpage-package The Emacs package used to display man-pages, one of man or woman. [User Option] magit-popup-display-buffer-action [User Option] The option controls how the window used to display a popup buffer is created. Popup buffers are displayed using display-buffer with the value of this option as ACTION argument. You can also set this to nil and instead add an entry to display-bufferalist.

7 To emphasize the default action by making it bold use this: (button-type-put magit-popup-action-button format " %k %D")

8 3 Defining Prefix and Suffix Commands If you write an extension for Magit then you should use this library now and later when transient is released port to that. If you are considering using this library to define popups for packages not related to Magit, then keep in mind that it will be superseded eventually. Once transient has been released I will only fix bugs in magit-popup but not implement any new features. Also consider using hydra instead. To some extend magit-popup and hydra are similar but have a different focus. The main purpose of magit-popup is to pass infix arguments to suffix commands. If all you need is a command dispatcher then you are better of using hydra. Of course hydra may also be a better fit not only because of the features it lacks, but also because of the features it provides, which are in turn missing from magit-popup. Here is an example of how one defines a prefix command along with its infix arguments, and then also one of its suffix commands. ;;;###autoload (autoload magit-tag-popup "magit" nil t) (magit-define-popup magit-tag-popup "Show popup buffer featuring tagging commands." magit-commands :man-page "git-tag" :switches ((?a "Annotate" "--annotate") (?s "Sign" "--sign") (?f "Force" "--force")) :actions ((?t "Create" magit-tag) (?k "Delete" magit-tag-delete) (?p "Prune" magit-tag-prune)) :default-action magit-tag) ;;;###autoload (defun magit-tag (name rev &optional args) "Create a new tag with the given NAME at REV." (interactive (list (magit-read-tag "Tag name") (magit-read-branch-or-commit "Place tag on") (magit-tag-arguments))) (magit-run-git-with-editor "tag" args name rev)) 3.1 Defining Prefix Commands Prefix commands and their infix arguments are defined using the macro magit-definepopup. The key bindings and descriptions of suffix commands are also defined using that macro, but the actual interactive commands have to be defined separately using plain defun. magit-define-popup name doc [group [mode [option]]] :keyword [Macro] value... This macro defines a popup named NAME. The NAME should begin with the package prefix and by convention end with -popup, it is used as the name of the command which shows the popup and for an internal variable (whose value is used to store

Chapter 3: Defining Prefix and Suffix Commands 9 information about the popup and should not be accessed directly). DOC is the docstring of the popup command. This macro also defines an option and a function both named SHORTNAME-arguments, where SHORTNAME is NAME with the trailing -popup removed. The name of this option and this function can be overwritten using the optional argument OPTION, but that is rarely advisable. As a special case if OPTION is specified but nil, then this option and this function are not defined at all, which is useful for popups that are used as simple dispatchers that offer no arguments. The option SHORTNAME-arguments holds the value for the popup arguments. It can be customized from within the popup or using the Custom interface. It can also have a buffer local value in any non-popup buffer. The local value for the buffer from which the popup command was invoked, can be set from within the popup buffer. The function SHORTNAME-arguments returns the currently effective value of the variable by the same name. See below for more information. Optional argument GROUP specifies the Custom group into which the option is placed. If omitted then the option is placed into some group the same way it is done when directly using defcustom and omitting the group, except when NAME begins with "magit-", in which case the group magit-git-arguments is used. The optional argument MODE specifies the mode used by the popup buffer. If it is omitted or nil then magit-popup-mode is used. The remaining arguments should have the form [KEYWORD VALUE]... The following keywords are meaningful (and by convention are usually specified in that order): :actions The actions which can be invoked from the popup. VALUE is a list whose members have the form (KEY DESC COMMAND), see magit-define-popupaction for details. Actions are regular Emacs commands, which usually have an interactive form setup to consume the values of the popup :switches and :options when invoked from the corresponding popup, else when invoked as the default action or directly without using the popup, the default value of the variable SHORTNAME-arguments. This is usually done by calling the function SHORTNAME-arguments. Members of VALUE may also be strings and functions, assuming the first member is a string or function. In that case the members are split into sections and these special elements are used as headings. If such an element is a function then it is called with no arguments and must return either a string, which is used as the heading, or nil, in which case the section is not inserted. Members of VALUE may also be nil. This should only be used together with :max-action-columns and allows having gaps in the action grit, which can help arranging actions sensibly. :default-action The default action of the popup which is used directly instead of displaying the popup buffer, when the popup is invoked with a prefix argument. Also see

Chapter 3: Defining Prefix and Suffix Commands 10 magit-popup-use-prefix-argument and :use-prefix, which can be used to inverse the meaning of the prefix argument. :use-prefix Controls when to display the popup buffer and when to invoke the default action (if any) directly. This overrides the global default set using magit-popup-useprefix-argument. The value, if specified, should be one of default or prefix, or a function that is called with no arguments and returns one of these symbols. :max-action-columns The maximum number of actions to display on a single line, a number or a function that return a number and takes the name of the section currently being inserted as argument. If there isn t enough room to display as many columns as specified here, then fewer are used. :switches The popup arguments which can be toggled on and off. VALUE is a list whose members have the form (KEY DESC SWITCH), see magit-define-popup-switch for details. Members of VALUE may also be strings and functions, assuming the first member is a string or function. In that case the members are split into sections and these special elements are used as headings. If such an element is a function then it is called with no arguments and must return either a string, which is used as the heading, or nil, in which case the section is not inserted. :options The popup arguments which take a value, as in " opt~optval". VALUE is a list whose members have the form (KEY DESC OPTION READER), see magit-define-popup-option for details. Members of VALUE may also be strings and functions, assuming the first member is a string or function. In that case the members are split into sections and these special elements are used as headings. If such an element is a function then it is called with no arguments and must return either a string, which is used as the heading, or nil, in which case the section is not inserted. :default-arguments The default arguments, a list of switches (which are then enabled by default) and options with there default values, as in "--OPT=OPTVAL". :variables Git variables which can be set from the popup. VALUE is a list whose members have the form (KEY DESC COMMAND FORMATTER), see magit-define-popupvariable for details. Members of VALUE may also be strings and functions, assuming the first member is a string or function. In that case the members are split into sections and these special elements are used as headings. If such an element is a function then it is called with no arguments and must return either a string, which is used as the heading, or nil, in which case the section is not inserted. Members of VALUE may also be actions as described above for :actions. VALUE may also be a function that returns a list as describe above.

Chapter 3: Defining Prefix and Suffix Commands 11 :sequence-predicate When this function returns non-nil, then the popup uses :sequence-actions instead of :actions, and does not show the :switches and :options. :sequence-actions The actions which can be invoked from the popup, when :sequence-predicate returns non-nil. :setup-function When this function is specified, then it is used instead of magit-popup-defaultsetup. :refresh-function When this function is specified, then it is used instead of calling magit-popupinsert-section three times with symbols magit-popup-switch-button, magit-popup-option-button, and finally magit-popup-action-button as argument. :man-page The name of the manpage to be displayed when the user requests help for an argument. 3.2 Defining Suffix Commands Commands intended to be invoked from a particular popup should determine the currently effective arguments by calling the function SHORTNAME-arguments inside their interactive form. This function is created by the magit-define-popup macro. For a popup named prefix-foo-popup the name of this function is prefix-foo-arguments. When the command was invoked as an action in the respective popup, then this function returns the arguments that were set in the popup. Otherwise when the command was invoked as the default of the popup (by calling the popup command with a prefix argument), or without using the popup command at all, then this function returns the buffer-local or global value of the variable SHORTNAME-arguments. Internally arguments are handled as a list of strings. This might not be appropriate for the intended use inside commands, or it might be necessary to manipulate that list somehow, i.e. to split " ARG=VAL" into " ARG""VAL". This should be done by advising or redefining the function SHORTNAME-arguments. Internally SHORNAME-arguments used following variables and function. Except when redefining the former, you should not use these directly. magit-current-popup The popup from which this editing command was invoked. [Variable] magit-current-popup-args [Variable] The value of the popup arguments for this editing command. If the current command was invoked from a popup, then this is a list of strings of all the set switches and options. This includes arguments which are set by default not only those explicitly set during this invocation. When the value is nil, then that can be because no argument is set, or because the current command wasn t invoked from a popup at all.

Chapter 3: Defining Prefix and Suffix Commands 12 magit-current-popup-args &rest args [Function] This function returns the value of the popup arguments for this editing command. The value is the same as that of the variable by the same name, except that FILTER is applied. FILTER is a list of regexps; only arguments that match one of them are returned. The first element of FILTER may also be :not in which case only arguments that don t match any of the regexps are returned, or :only which doesn t change the behavior.