diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 06d9526044b..7cf7b2ff96f 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -1759,10 +1759,11 @@ If non-@code{nil}, @code{hs-hide-all}, @code{hs-cycle} and @code{hs-hide-level} hide comments too. @item hs-hide-block-behavior -This variable controls how @code{hs-hide-block} and -@code{hs-toggle-hiding} should hide a block. The possible values can be -'after-bol', hide the innermost block to which the current line belongs; -or 'after-cursor', hide the block after cursor position. +This variable controls how @code{hs-hide-block}, @code{hs-cycle}, +@code{hs-hide-level}, and @code{hs-toggle-hiding} should hide a block. +The possible values can be 'after-bol', hide the innermost block to +which the current line belongs; or 'after-cursor', hide the block after +cursor position. @item hs-display-lines-hidden If non-@code{nil}, display the number of hidden lines next to the diff --git a/etc/NEWS b/etc/NEWS index b18b42af37c..e0d8404ed87 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1351,11 +1351,13 @@ to customize the indicators appearance only if 'hs-indicator-type' is set to 'margin' or nil. +++ -*** New user option 'hs-hide-block-behavior'. -This user option controls how 'hs-hide-block' and 'hs-toggle-hiding' -should hide a block. If set to 'after-bol', hide the innermost block to -which the current line belongs. If set to 'after-cursor', hide the block -after cursor position. By default this is set to 'after-bol'. +*** The hiding behavior of some hideshow commands has changed. +'hs-hide-block', 'hs-hide-level', 'hs-cycle' and 'hs-toggle-hiding' now +hide the innermost block to which the current line belongs instead of +the block after cursor position. + +To restore the old behavior set the new user option +'hs-hide-block-behavior' to 'after-cursor'. +++ *** New user option 'hs-cycle-filter' for visibility-cycling with 'TAB'. diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index d7b76d0e30c..993ff1cd6f5 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -330,6 +330,7 @@ If non-nil, `hs-hide-all', `hs-cycle' and `hs-hide-level' will hide comments too." :type 'boolean) +;; This is only intended for backward compatibility (bug#80455) (defcustom hs-hide-block-behavior 'after-bol "How hideshow should hide a block. If set to `after-bol', hide the innermost block to which the current @@ -337,8 +338,8 @@ line belongs. If set to `after-cursor', hide the block after cursor position. -This only has effect in `hs-hide-block' and `hs-toggle-hiding' -commands." +This only has effect in `hs-hide-block', `hs-cycle', `hs-hide-level' and +`hs-toggle-hiding' commands." :type '(choice (const :tag "Hide the block after cursor" after-cursor) @@ -939,8 +940,7 @@ Intended to be used in commands." t) ((and (or (hs-hideable-block-p) - (and (forward-line 0) - (funcall hs-find-block-beginning-function) + (and (funcall hs-find-block-beginning-function) (hs-hideable-block-p)))) t))))