1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

; * lisp/progmodes/hideshow.el: Spelling fixes (bug#79585)

This commit is contained in:
Michael Heerdegen 2025-10-21 17:42:37 +02:00 committed by Juri Linkov
parent 41701df12a
commit d2bc774ec9

View file

@ -293,11 +293,12 @@ line belongs.
If set to `after-cursor', hide the block after cursor position. If set to `after-cursor', hide the block after cursor position.
This only have effect in `hs-hide-block' and `hs-toggle-hiding' This only has effect in `hs-hide-block' and `hs-toggle-hiding'
commands." commands."
:type '(choice :type
(const :tag "Hide the block after cursor" after-bol) '(choice
(const :tag "Hide the block after beginning of current line" after-cursor)) (const :tag "Hide the block after cursor" after-cursor)
(const :tag "Hide the block after beginning of current line" after-bol))
:version "31.1") :version "31.1")
(defcustom hs-display-lines-hidden nil (defcustom hs-display-lines-hidden nil
@ -343,7 +344,7 @@ The possible values can be:
- `margin', display the indicators in the margin. - `margin', display the indicators in the margin.
- nil, display the indicators at end-of-line. - nil, display the indicators at end-of-line.
This only have effect if `hs-show-indicators' is non-nil." This only has effect if `hs-show-indicators' is non-nil."
:type '(choice :type '(choice
(const :tag "Fringes" fringe) (const :tag "Fringes" fringe)
(const :tag "Margins" margin) (const :tag "Margins" margin)
@ -471,11 +472,11 @@ Use the command `hs-minor-mode' to toggle or set this variable.")
:doc "Keymap for hideshow minor mode." :doc "Keymap for hideshow minor mode."
"S-<mouse-2>" #'hs-toggle-hiding "S-<mouse-2>" #'hs-toggle-hiding
"C-c @" hs-prefix-map "C-c @" hs-prefix-map
"<left-fringe> <mouse-1>" #'hs-indicator-mouse-toggle-hidding) "<left-fringe> <mouse-1>" #'hs-indicator-mouse-toggle-hiding)
(defvar-keymap hs-indicators-map (defvar-keymap hs-indicators-map
:doc "Keymap for hideshow indicators." :doc "Keymap for hideshow indicators."
"<left-margin> <mouse-1>" #'hs-indicator-mouse-toggle-hidding "<left-margin> <mouse-1>" #'hs-indicator-mouse-toggle-hiding
"<mouse-1>" #'hs-toggle-hiding) "<mouse-1>" #'hs-toggle-hiding)
(easy-menu-define hs-minor-mode-menu hs-minor-mode-map (easy-menu-define hs-minor-mode-menu hs-minor-mode-map
@ -507,10 +508,12 @@ Use the command `hs-minor-mode' to toggle or set this variable.")
:help "Show hidden comment blocks when isearch matches inside them" :help "Show hidden comment blocks when isearch matches inside them"
:active t :style radio :selected (eq hs-isearch-open 'comment)] :active t :style radio :selected (eq hs-isearch-open 'comment)]
["Code and Comment blocks" (setq hs-isearch-open t) ["Code and Comment blocks" (setq hs-isearch-open t)
:help "Show both hidden code and comment blocks when isearch matches inside them" :help "\
Show both hidden code and comment blocks when isearch matches inside them"
:active t :style radio :selected (eq hs-isearch-open t)] :active t :style radio :selected (eq hs-isearch-open t)]
["None" (setq hs-isearch-open nil) ["None" (setq hs-isearch-open nil)
:help "Do not hidden code or comment blocks when isearch matches inside them" :help "\
Do not show hidden code or comment blocks when isearch matches inside them"
:active t :style radio :selected (eq hs-isearch-open nil)]))) :active t :style radio :selected (eq hs-isearch-open nil)])))
(defvar hs-hide-all-non-comment-function nil (defvar hs-hide-all-non-comment-function nil
@ -622,7 +625,7 @@ It should reposition point at next block start.
It is called with three arguments REGEXP, MAXP, and COMMENTS. It is called with three arguments REGEXP, MAXP, and COMMENTS.
REGEXP is a regexp representing block start. When block start is REGEXP is a regexp representing block start. When block start is
found, `match-data' should be set using REGEXP. MAXP is a buffer found, `match-data' should be set using REGEXP. MAXP is a buffer
position that bounds the search. When COMMENTS is nil, comments position that limits the search. When COMMENTS is nil, comments
should be skipped. When COMMENTS is not nil, REGEXP matches not should be skipped. When COMMENTS is not nil, REGEXP matches not
only beginning of a block but also beginning of a comment. In only beginning of a block but also beginning of a comment. In
this case, the function should find nearest block or comment. this case, the function should find nearest block or comment.
@ -726,7 +729,7 @@ to call with the newly initialized overlay."
(defun hs-block-positions () (defun hs-block-positions ()
"Return the current code block positions. "Return the current code block positions.
This return a cons-cell with the current code block beginning and end This returns a cons-cell with the current code block beginning and end
positions. This does nothing if there is not a code block at current positions. This does nothing if there is not a code block at current
point." point."
(save-match-data (save-match-data
@ -815,8 +818,8 @@ point."
(_ (save-excursion (_ (save-excursion
(goto-char b-beg) (goto-char b-beg)
(funcall hs-looking-at-block-start-predicate))) (funcall hs-looking-at-block-start-predicate)))
;; `catch' is used here if the search fail due ;; `catch' is used here if the search fails due
;; unbalanced parenthesis or any other unknown error ;; unbalanced parentheses or any other unknown error
;; caused in `hs-forward-sexp'. ;; caused in `hs-forward-sexp'.
(b-end (catch 'hs-indicator-error (b-end (catch 'hs-indicator-error
(save-excursion (save-excursion
@ -833,7 +836,7 @@ point."
`(jit-lock-bounds ,beg . ,end)) `(jit-lock-bounds ,beg . ,end))
(defun hs--refresh-indicators (from to) (defun hs--refresh-indicators (from to)
"Update indicators appearance in FROM and TO." "Update indicator appearance in FROM and TO."
(when (and hs-show-indicators hs-minor-mode) (when (and hs-show-indicators hs-minor-mode)
(save-match-data (save-match-data
(save-excursion (save-excursion
@ -945,7 +948,7 @@ a comment.
The block beginning is adjusted by `hs-adjust-block-beginning-function' The block beginning is adjusted by `hs-adjust-block-beginning-function'
and then further adjusted to be at the end of the line. and then further adjusted to be at the end of the line.
If hidding the block is successful, return non-nil. If hiding the block is successful, return non-nil.
Otherwise, return nil." Otherwise, return nil."
(if comment-reg (if comment-reg
(hs-hide-comment-region (car comment-reg) (cadr comment-reg) end) (hs-hide-comment-region (car comment-reg) (cadr comment-reg) end)
@ -1247,8 +1250,8 @@ Upon completion, point is repositioned and the normal hook
(line-end-position) nil)) (line-end-position) nil))
(goto-char (match-beginning 0))) (goto-char (match-beginning 0)))
(funcall hs-looking-at-block-start-predicate)) (funcall hs-looking-at-block-start-predicate))
;; If hidding the block fails (due the block is not hideable) ;; If hiding the block fails (due the block is not hideable)
;; Then just hide the parent block (if possible) ;; then just hide the parent block (if possible)
(unless (save-excursion (hs-hide-block-at-point end)) (unless (save-excursion (hs-hide-block-at-point end))
(goto-char (1- (point))) (goto-char (1- (point)))
(funcall hs-find-block-beginning-function) (funcall hs-find-block-beginning-function)
@ -1320,10 +1323,11 @@ Argument E should be the event that triggered this action."
(hs-show-block) (hs-show-block)
(hs-hide-block)))) (hs-hide-block))))
(define-obsolete-function-alias 'hs-mouse-toggle-hiding #'hs-toggle-hiding "27.1") (define-obsolete-function-alias
'hs-mouse-toggle-hiding #'hs-toggle-hiding "27.1")
(defun hs-indicator-mouse-toggle-hidding (event) (defun hs-indicator-mouse-toggle-hiding (event)
"Toggle block hidding with indicators." "Toggle block hiding with indicators."
(interactive "e") (interactive "e")
(hs-life-goes-on (hs-life-goes-on
(when hs-show-indicators (when hs-show-indicators