summaryrefslogtreecommitdiff
path: root/lisp/outline.el
Commit message (Collapse)AuthorAge
* Merge from origin/emacs-29Eli Zaretskii2024-02-17
|\ | | | | | | | | | | | | | | | | | | | | | | | | 45f9af61b8e Remove references to phst@google.com. 7256690a3ca * BUGS: Note how to report critical security issues. 1035669b38b Add cross-reference to ELisp manual Caveats 61a14507627 Improve directory prompt used by package-vc-checkout 0c7c8210cb6 Minor Tramp doc adaption df243f785d4 Merge branch 'emacs-29' of git.sv.gnu.org:/srv/git/emacs ... 17a395e04c6 ;; Fix typo in the Tramp documentation 614b244a7fa * Improve reproducibility of inferred values by native comp 9f9da26e0dc Handle typescript ts grammar breaking change for function... 717d8c4285f Don't quote 't' in doc strings
| * Don't quote 't' in doc stringsEli Zaretskii2024-02-10
| | | | | | | | | | * lisp/outline.el (outline-minor-mode-use-buttons): Doc fix. Patch by Arash Esbati <arash@gnu.org>. (Bug#69012)
* | Make outline.el ignore field properties in textJim Porter2024-02-12
| | | | | | | | | | | | | | * lisp/outline.el (outline-back-to-heading, outline-on-heading-p) (outline-next-visible-heading, outline-mark-subtree) (outline-hide-sublevels, outline--insert-button) (outline--fix-up-all-buttons): Inhibit field text motion (bug#68881).
* | Consider outline-heading-end-regexp in outline-font-lock-keywordsGabriel do Nascimento Ribeiro2024-01-11
|/ | | | | * lisp/outline.el (outline-font-lock-keywords): Add outline-heading-end-regexp to regexp (bug#66166).
* ; Add 2024 to copyright yearsPo Lu2024-01-02
|
* * doc/emacs/text.texi (Outline Minor Mode): Add a note about value 'insert'.Juri Linkov2023-09-13
| | | | | * lisp/outline.el (outline-minor-mode-use-buttons): Add a note and a comment about the value 'insert' (bug#65874).
* Improve outline-default-state docstringRobert Pluim2023-04-26
| | | | | * lisp/outline.el (outline-default-state): Explain which functions are available to affect heading visibility.
* * lisp/outline.el (outline--fix-buttons-after-change): Add save-match-data.Juri Linkov2023-03-22
| | | | | | It's important for a hook in after-change-functions not to change match-data. Otherwise it breaks functions that make changes in the buffer, such as for example, successive calls to delete-region in smerge-keep-n, etc.
* Use named keymaps for outline buttonsRobert Pluim2023-01-24
| | | | | | | | | | | https://lists.gnu.org/archive/html/emacs-devel/2023-01/msg00334.html * lisp/outline.el (outline-button-icon-map) (outline-overlay-button-map, outline-inserted-button-map): Keymaps refactored from outline--create-button-icons and outline--insert-button. (outline--create-button-icons, outline--insert-button): Move keymaps to separate variables.
* * etc/NEWS: Mention incompatible changes in 'outline-minor-mode-cycle-map'.Juri Linkov2023-01-11
| | | | | | | | | | * lisp/outline.el (outline-minor-mode-cycle--bind): Add docstring (bug#60426). (outline-minor-mode-cycle--bind): Default 'map' to 'outline-minor-mode-cycle-map'. (outline-minor-mode-cycle-map): Improve docstring. (outline-minor-mode): Move margin-cycling keys to 'outline-minor-mode-cycle-map'.
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-01
|
* Use the new keyword ':repeat' in repeatable keymaps.Juri Linkov2022-12-22
| | | | | | | | | | | | | | | | | | | | | | | * lisp/bindings.el (undo-repeat-map) (buffer-navigation-repeat-map, next-error-repeat-map) (page-navigation-repeat-map): * lisp/comint.el (comint-repeat-map): * lisp/dired.el (dired-jump-map): * lisp/outline.el (outline-navigation-repeat-map) (outline-editing-repeat-map): * lisp/shell.el (shell-repeat-map): * lisp/tab-bar.el (tab-bar-switch-repeat-map) (tab-bar-move-repeat-map): * lisp/window.el (other-window-repeat-map) (resize-window-repeat-map): * lisp/winner.el (winner-repeat-map): * lisp/eshell/em-prompt.el (eshell-prompt-repeat-map): * lisp/eshell/esh-mode.el (eshell-command-repeat-map): Add the keyword ':repeat' to 'defvar-keymap' instead of setting the symbol property 'repeat-map' explicitly. * lisp/keymap.el (defvar-keymap): Check for 'props' that is used in 'defvar-form'.
* * lisp/outline.el: Fix the value 'insert' of outline-minor-mode-use-buttons.Juri Linkov2022-12-12
| | | | | | | | | (outline--insert-button): Keep text properties around point on the inserted whitespace placeholder. * lisp/apropos.el (apropos-mode): * lisp/progmodes/xref.el (xref--xref-buffer-mode): Change outline-minor-mode-use-buttons from t to 'insert'.
* Fix the width of margins for icons in outline-minor-mode (bug#59719)Juri Linkov2022-12-02
| | | | | | | | | | | | | | * doc/lispref/display.texi (Icons): Add :width spec. * lisp/emacs-lisp/icons.el (icons--create): Handle :width as well. * lisp/outline.el (outline--margin-width, outline-margin-width): New variables. (outline-open-in-margins, outline-close-in-margins) (outline-close-rtl-in-margins): Don't inherit from parents. Use `:width font' instead of `:height 10'. (outline-minor-mode): Calculate the number of columns for margins to fit the icons.
* * lisp/outline.el: 'S-<down-mouse-1>' on buffer buttons cycles all outlines.Juri Linkov2022-11-23
| | | | | | | (outline--create-button-icons, outline--insert-button): Bind 'S-<mouse-1>' to 'outline-cycle-buffer' as it's already done for buttons on the margins. Ignore 'S-<down-mouse-1>'. Don't hard-code 'help-echo' since it should be customizable by the ':help-echo' keyword in 'define-icon'.
* ; Fix typos (misspelled symbols)Stefan Kangas2022-11-21
|
* * lisp/outline.el (outline-search-function): New variable (bug#53981).Juri Linkov2022-11-21
| | | | | | | | | | | | | | | | | | | | | | (outline-font-lock-keywords, outline-font-lock-face) (outline-minor-mode-highlight-buffer, outline-next-preface) (outline-next-heading, outline-previous-heading) (outline-back-to-heading, outline-on-heading-p, outline-demote) (outline-map-region, outline-next-visible-heading) (outline-hide-sublevels, outline-up-heading): Use outline-search-function when it's non-nil as an alternative to searching outline-regexp. (outline-search-level, outline-search-text-property): New functions. * lisp/apropos.el (apropos-mode): Set outline-search-function instead of unreliable outline-regexp. (apropos-print): Add text property outline-level. * lisp/emacs-lisp/shortdoc.el (shortdoc-display-group): Add text property outline-level on text separate from final newlines. (shortdoc-display-group): Add a narrow newline to not show text properties of the final line when the outline is hidden. (shortdoc--display-function): Add text property outline-level. (shortdoc-mode): Set buffer-local outline-search-function and outline-level.
* ; Fix typosStefan Kangas2022-11-18
|
* * lisp/outline.el (outline-minor-mode): Ensure margins are either 0 or 1.Juri Linkov2022-11-07
| | | | This check is necessary to make it idempotent to multiple calls.
* * lisp/outline.el: Pre-compute some frequent data for button icons (bug#57813)Juri Linkov2022-10-23
| | | | | | | | | | | | | | | | (outline--button-icons): New buffer-local variable. (outline-minor-mode): Set outline--button-icons. Unify overlay name 'outline-margin' with 'outline-button'. (outline--make-button-overlay, outline--make-margin-overlay) (outline--insert-open-button, outline--insert-close-button): Remove functions. (outline--create-button-icons, outline--insert-button): New functions with code refactored from old functions. Add more support for icon faces. (outline--fix-up-all-buttons): Use outline--insert-button. (outline--fix-buttons-after-change): Unify overlay name 'outline-margin' with 'outline-button'. * lisp/minibuffer.el (completions-group-separator): Change face attribute :strike-through to :underline.
* * lisp/outline.el: Use 'outline-cycle' on buttons for 'RET' like 'TAB' uses.Juri Linkov2022-10-22
| | | | | | | | (outline--make-button-overlay, outline--make-margin-overlay): Use overlay keymap where RET and mouse-2 are bound to outline-cycle. (outline--insert-open-button, outline--insert-close-button): Move overlay keymap to outline--make-button-overlay and replace bindings outline-hide-subtree/outline-show-subtree with outline-cycle.
* Unify outline-minor-mode-use-buttons with in-margins/insert values (bug#57813)Juri Linkov2022-10-22
| | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/text.texi (Outline Mode): Remove outline-minor-mode-use-margins. Document the values insert/in-margins of outline-minor-mode-use-buttons. * lisp/help.el (describe-bindings): Set outline-minor-mode-use-buttons to 'insert'. * lisp/textmodes/emacs-news-mode.el (emacs-news--mode-common): Set outline-minor-mode-use-buttons to 'in-margins'. * lisp/outline.el (outline-minor-mode-use-buttons): Change :type from 'buffer-predicate' to choice of const values nil/in-margins/t. (outline--use-buttons, outline-minor-mode-insert-buttons) (outline-minor-mode-use-margins, outline--use-margins): Remove variables. (outline-minor-mode-highlight-buffer): Change overlay name 'outline-overlay' to 'outline-highlight'. (outline-minor-mode): Simplify to handle possible values of 'outline-minor-mode-use-buttons' instead of using many variables. (outline--make-button-overlay): Use value 'insert' of 'outline-minor-mode-use-buttons'. (outline--insert-open-button, outline--insert-close-button) (outline--fix-up-all-buttons, outline--fix-buttons-after-change): Handle values of outline-minor-mode-use-buttons instead of using many variables.
* * lisp/outline.el (outline-minor-mode-insert-buttons): New defvar-local.Juri Linkov2022-10-18
| | | | | | | | | | | | | | | (outline--make-button-overlay, outline--insert-open-button) (outline--insert-close-button): Insert button when outline-minor-mode-insert-buttons is non-nil, otherwise put an overlay with before-string. (bug#57813) * lisp/help.el (describe-bindings): Set buffer-local outline-minor-mode-insert-buttons to t. * lisp/textmodes/emacs-news-mode.el (emacs-news--mode-common): Set buffer-local outline-minor-mode-use-margins to t. Don't set outline-regexp for leading spaces because now spaces are not added in the NEWS buffer.
* * lisp/outline.el: Use one character wide strings for margins (bug#57813)Juri Linkov2022-10-18
| | | | | | | (outline-open-in-margins, outline-close-in-margins) (outline-close-rtl-in-margins): Add 1-char emoji, symbol, text for margins that are 1-column wide. (outline-minor-mode): Force display of margins only for the selected buffer.
* * lisp/outline.el: Rearrange button/margin functions.Juri Linkov2022-10-13
| | | | | | (outline--make-button-overlay, outline--make-margin-overlay) (outline--insert-open-button, outline--insert-close-button) (outline--fix-up-all-buttons): Move to the section "Button/margin indicators".
* * lisp/outline.el (outline--fix-buttons-after-change): New function.Juri Linkov2022-10-13
| | | | | (outline-minor-mode): Use it. (outline--make-margin-overlay): Remove inhibit-read-only.
* Revert "keymap.el: Ease up support for non-`kbd` formats."Lars Ingebrigtsen2022-10-03
| | | | | | | | | This reverts commit 570a11052be6178954956a1c59c8ebcbdb77d38e. We do not want to support several keymap formats in `keymap-set' and friends -- the point is to have an interface with easy-to-understand semantics that give good feedback on valid/invalid key sequences.
* keymap.el: Ease up support for non-`kbd` formats.Stefan Monnier2022-10-02
| | | | | | | | | | | | | | While we want to standardize on the `kbd` syntax for user-facing code, the internal vector representation of key sequences is not going away, so let's not impose silly `key-description + key-parse` roundtrips. Also, provide some support for packages stuck with user configs defined to hold old-style key formats. * lisp/keymap.el (keymap-set): Allow vectors as `key`. (key-parse-old-format): New function, which stands out better than `key-description` when searching for uses of the old syntax. * list/outline.el (outline-minor-mode): Use it.
* * lisp/outline.el: More improvements for buttons/margins (bug#57813)Juri Linkov2022-09-21
| | | | | | | | | | (outline-minor-mode-use-margins): Don't use for modes derived from help-mode that are handled by 'outline-minor-mode-use-buttons'. (outline-open, outline-close, outline-close-rtl): Use image height proportional to font height of 0.8em. (outline-minor-mode): Remove overlays 'outline-button' and 'outline-margin', and move such overlay removal after the call of 'outline-show-all' that might trigger overlay addition.
* * lisp/outline.el: Bind margin mouse event to cycle outlines (bug#57813)Juri Linkov2022-09-20
| | | | | | | | | | | | | | | (outline-minor-mode): In mode keymap bind 'right/left-margin mouse-1' to outline-cycle, and 'right/left-margin S-mouse-1' to outline-cycle-buffer. (outline-hide-subtree, outline-show-subtree): Add save-excursion to keep point unmoved after mouse click. (outline-cycle): Add optional arg 'event' like in outline-hide-subtree and outline-show-subtree, and add save-excursion to keep point unmoved after mouse click. (outline--make-button-overlay, outline--make-margin-overlay): Put overlay property 'evaporate' to t. (outline--insert-open-button, outline--insert-close-button): Remove temporary attempts to bind margin-local mouse events.
* * lisp/outline.el (outline-open): Revert 'text' back to " open ".Juri Linkov2022-09-19
| | | | | | (outline-close): Revert 'text' back to " close ". (outline-close-rtl): Remove 'text' since it's inherited from the parent 'outline-close'.
* * lisp/outline.el (outline-minor-mode-use-margins): New user option.Juri Linkov2022-09-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (outline--use-margins, outline--use-buttons, outline--use-rtl): New buffer-local internal variables. (outline-open, outline-close): Move :ascent center to default of define-icon. Use ASCII-art for text. Fix docstring and help-echo. (outline-close-rtl, outline-open-in-margins) (outline-close-in-margins, outline-close-rtl-in-margins): New icon definitions. (outline-minor-mode-highlight-buffer): Remove outline--insert-open-button since initial outline--fix-up-all-buttons is added now to outline-minor-mode. (outline-minor-mode): Set buffer-local outline--use-buttons, outline--use-margins and outline--use-rtl. Show/hide margins for outline--use-margins. Add hook after-change-functions for editable buffers. Move outline--fix-up-all-buttons for both cases: font-lock and non-font-lock. (outline--use-buttons-p): Remove function. (outline--make-button-overlay): Use outline--use-rtl icon outline-close-rtl. (outline--make-margin-overlay): New function. (outline--insert-open-button, outline--insert-close-button): Add optional arg 'use-margins'. (outline--fix-up-all-buttons): Call outline--insert-close-button and outline--insert-open-button with arg outline--use-margins. (outline-cycle-buffer): Remove outline--fix-up-all-buttons that is already called from outline-flag-region. * lisp/emacs-lisp/icons.el (icons--create): Handle keywords :rotation and :ascent with the default value 'center (bug#57813). * doc/emacs/text.texi (Outline Mode): Mention outline-minor-mode-use-margins.
* Support imenu in emacs-news-modeStefan Kangas2022-09-19
| | | | | | | | * lisp/outline.el (outline-imenu-generic-expression): New variable broken out from... (outline-mode): ...here. * lisp/textmodes/emacs-news-mode.el (emacs-news--mode-common): Use above new variable to add imenu support.
* * lisp/outline.el: Optimize performance of S-TAB (bug#57813)Juri Linkov2022-09-16
| | | | | | | | (outline-hide-subtree): Don't call outline--insert-close-button, because it's handled by outline--fix-up-all-buttons called from outline-flag-region. (outline-show-subtree): Don't call outline--insert-open-button, same reason. (outline--fix-up-all-buttons): Check invisible outlines explicitly instead of using slow outline--cycle-state.
* Fix icon spec for outline iconsPo Lu2022-09-16
| | | | | | * lisp/outline.el (outline-open): (outline-close): Fix listing of multiple images. Reported by Lars Ingebrigtsen <larsi@gnus.org>.
* Add portable versions of the outline SVGsPo Lu2022-09-16
| | | | | | | | | * lisp/outline.el (outline-open): (outline-close): Add PBM images. * etc/images/outline-open.pbm: * etc/images/outline-close.pbm: New images used on systems without librsvg.
* Add outline open/close images (bug#57813)Juri Linkov2022-09-16
| | | | | | | | | | * etc/images/outline-open.svg: * etc/images/outline-close.svg: New files. * lisp/outline.el (outline-open, outline-close): Use images outline-open.svg and outline-close.svg. * lisp/emacs-lisp/icons.el (icons--create): Add :ascent 'center'.
* Fix outline image icon display (bug#57813)Juri Linkov2022-09-15
| | | | | | * lisp/outline.el (outline--make-button-overlay): Don't overwrite image display with string display when image exists. (outline--fix-up-all-buttons): Optimize.
* Prefer defvar-keymap for repeat-map in outline.elJuri Linkov2022-09-13
| | | | | * lisp/outline.el (outline-navigation-repeat-map) (outline-editing-repeat-map): Prefer defvar-keymap.
* Add prefix argument to outline-cycle-bufferAugusto Stoffel2022-09-08
| | | | | | * lisp/outline.el (outline-cycle-buffer): Add prefix argument to show headings up to a given level. Handle the case where the top heading level is not 1.
* Don't replace the first character with an arrow in outline-minor-modeJuri Linkov2022-09-04
| | | | | * lisp/outline.el (outline--make-button-overlay): Add the first character to the displayed outline button (bug#56820).
* Add a basic widget type for buffer predicatesLars Ingebrigtsen2022-09-04
| | | | | | * lisp/paren.el (show-paren-predicate): * lisp/outline.el (outline-minor-mode-use-buttons): Use it. * lisp/wid-edit.el (buffer-predicate): New widget type.
* Fix outline-minor-mode-mapLars Ingebrigtsen2022-09-01
| | | | | | * lisp/outline.el (outline-minor-mode): Avoid using easy-mmode-define-keymap, since it doesn't handle :inherit correctly (bug#57512).
* Fix 744ed0ceeed7472a160fea7154939cf641205577 from bug#57082 (bug#57176)Juri Linkov2022-08-30
| | | | | | | * lisp/outline.el (outline-minor-mode-highlight-buffer): Handle 'append'. (outline-minor-mode): Call outline--fix-up-all-buttons when font-lock is used. * lisp/textmodes/emacs-news-mode.el (emacs-news--mode-common): Fix regexp.
* Tweak outline symbol iconsLars Ingebrigtsen2022-08-13
| | | | | * lisp/outline.el (outline-close, outline-open): Use icons of the same size in Symbola.
* Default outline-minor-mode-use-buttons to only happen in *Help*Lars Ingebrigtsen2022-08-12
| | | | | | | | * lisp/outline.el (outline-minor-mode-use-buttons): Change the default to only use buttons in the *Help* buffer (for now), because it's too disruptive in other modes. This will probably be changed again to have some other mechanism to opt in in certain modes, but it's not clear what that mechanism should look like.
* Reverse the outline arrowsStephen Berman2022-08-12
| | | | | * lisp/outline.el (outline-open): Reverse the arrows to match arrows in Customize (bug#57082).
* Make outline buttons work in NEWSStephen Berman2022-08-09
| | | | | | | | | | | | * lisp/outline.el (outline-minor-mode-highlight-buffer): Fix button insertion. (outline-minor-mode): Ditto. (outline--insert-open-button): Don't mark buffer as modified when inserting buttons. (outline--insert-close-button): Ditto. * lisp/textmodes/emacs-news-mode.el (emacs-news--mode-common): Adjust outline regexp.
* Make the symbol icons in outline.el more logicalLars Ingebrigtsen2022-07-30
| | | | | * lisp/outline.el (outline-open, outline-close): Use symbols from the same series so that it's more likely that they match up (bug#56823).
* Fix outline-minor-mode-use-buttons defcustom typeLars Ingebrigtsen2022-07-30
| | | | * lisp/outline.el (outline-minor-mode-use-buttons): Fix wrong type.