diff options
| author | Michael Heerdegen | 2025-10-21 17:42:37 +0200 |
|---|---|---|
| committer | Juri Linkov | 2025-11-09 21:18:01 +0200 |
| commit | d2bc774ec9c7bcdd47d3f893a690ca5683ce9a08 (patch) | |
| tree | 6935cd23a4f0b5037c0e2fc20d97616175cd2369 | |
| parent | 41701df12a9a0a72b0f68dffdcd69c8ab8f40f7c (diff) | |
| download | emacs-d2bc774ec9c7bcdd47d3f893a690ca5683ce9a08.tar.gz emacs-d2bc774ec9c7bcdd47d3f893a690ca5683ce9a08.zip | |
; * lisp/progmodes/hideshow.el: Spelling fixes (bug#79585)
| -rw-r--r-- | lisp/progmodes/hideshow.el | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index c8b4e68f00f..77b3df54360 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el | |||
| @@ -293,11 +293,12 @@ line belongs. | |||
| 293 | 293 | ||
| 294 | If set to `after-cursor', hide the block after cursor position. | 294 | If set to `after-cursor', hide the block after cursor position. |
| 295 | 295 | ||
| 296 | This only have effect in `hs-hide-block' and `hs-toggle-hiding' | 296 | This only has effect in `hs-hide-block' and `hs-toggle-hiding' |
| 297 | commands." | 297 | commands." |
| 298 | :type '(choice | 298 | :type |
| 299 | (const :tag "Hide the block after cursor" after-bol) | 299 | '(choice |
| 300 | (const :tag "Hide the block after beginning of current line" after-cursor)) | 300 | (const :tag "Hide the block after cursor" after-cursor) |
| 301 | (const :tag "Hide the block after beginning of current line" after-bol)) | ||
| 301 | :version "31.1") | 302 | :version "31.1") |
| 302 | 303 | ||
| 303 | (defcustom hs-display-lines-hidden nil | 304 | (defcustom hs-display-lines-hidden nil |
| @@ -343,7 +344,7 @@ The possible values can be: | |||
| 343 | - `margin', display the indicators in the margin. | 344 | - `margin', display the indicators in the margin. |
| 344 | - nil, display the indicators at end-of-line. | 345 | - nil, display the indicators at end-of-line. |
| 345 | 346 | ||
| 346 | This only have effect if `hs-show-indicators' is non-nil." | 347 | This only has effect if `hs-show-indicators' is non-nil." |
| 347 | :type '(choice | 348 | :type '(choice |
| 348 | (const :tag "Fringes" fringe) | 349 | (const :tag "Fringes" fringe) |
| 349 | (const :tag "Margins" margin) | 350 | (const :tag "Margins" margin) |
| @@ -471,11 +472,11 @@ Use the command `hs-minor-mode' to toggle or set this variable.") | |||
| 471 | :doc "Keymap for hideshow minor mode." | 472 | :doc "Keymap for hideshow minor mode." |
| 472 | "S-<mouse-2>" #'hs-toggle-hiding | 473 | "S-<mouse-2>" #'hs-toggle-hiding |
| 473 | "C-c @" hs-prefix-map | 474 | "C-c @" hs-prefix-map |
| 474 | "<left-fringe> <mouse-1>" #'hs-indicator-mouse-toggle-hidding) | 475 | "<left-fringe> <mouse-1>" #'hs-indicator-mouse-toggle-hiding) |
| 475 | 476 | ||
| 476 | (defvar-keymap hs-indicators-map | 477 | (defvar-keymap hs-indicators-map |
| 477 | :doc "Keymap for hideshow indicators." | 478 | :doc "Keymap for hideshow indicators." |
| 478 | "<left-margin> <mouse-1>" #'hs-indicator-mouse-toggle-hidding | 479 | "<left-margin> <mouse-1>" #'hs-indicator-mouse-toggle-hiding |
| 479 | "<mouse-1>" #'hs-toggle-hiding) | 480 | "<mouse-1>" #'hs-toggle-hiding) |
| 480 | 481 | ||
| 481 | (easy-menu-define hs-minor-mode-menu hs-minor-mode-map | 482 | (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.") | |||
| 507 | :help "Show hidden comment blocks when isearch matches inside them" | 508 | :help "Show hidden comment blocks when isearch matches inside them" |
| 508 | :active t :style radio :selected (eq hs-isearch-open 'comment)] | 509 | :active t :style radio :selected (eq hs-isearch-open 'comment)] |
| 509 | ["Code and Comment blocks" (setq hs-isearch-open t) | 510 | ["Code and Comment blocks" (setq hs-isearch-open t) |
| 510 | :help "Show both hidden code and comment blocks when isearch matches inside them" | 511 | :help "\ |
| 512 | Show both hidden code and comment blocks when isearch matches inside them" | ||
| 511 | :active t :style radio :selected (eq hs-isearch-open t)] | 513 | :active t :style radio :selected (eq hs-isearch-open t)] |
| 512 | ["None" (setq hs-isearch-open nil) | 514 | ["None" (setq hs-isearch-open nil) |
| 513 | :help "Do not hidden code or comment blocks when isearch matches inside them" | 515 | :help "\ |
| 516 | Do not show hidden code or comment blocks when isearch matches inside them" | ||
| 514 | :active t :style radio :selected (eq hs-isearch-open nil)]))) | 517 | :active t :style radio :selected (eq hs-isearch-open nil)]))) |
| 515 | 518 | ||
| 516 | (defvar hs-hide-all-non-comment-function nil | 519 | (defvar hs-hide-all-non-comment-function nil |
| @@ -622,7 +625,7 @@ It should reposition point at next block start. | |||
| 622 | It is called with three arguments REGEXP, MAXP, and COMMENTS. | 625 | It is called with three arguments REGEXP, MAXP, and COMMENTS. |
| 623 | REGEXP is a regexp representing block start. When block start is | 626 | REGEXP is a regexp representing block start. When block start is |
| 624 | found, `match-data' should be set using REGEXP. MAXP is a buffer | 627 | found, `match-data' should be set using REGEXP. MAXP is a buffer |
| 625 | position that bounds the search. When COMMENTS is nil, comments | 628 | position that limits the search. When COMMENTS is nil, comments |
| 626 | should be skipped. When COMMENTS is not nil, REGEXP matches not | 629 | should be skipped. When COMMENTS is not nil, REGEXP matches not |
| 627 | only beginning of a block but also beginning of a comment. In | 630 | only beginning of a block but also beginning of a comment. In |
| 628 | this case, the function should find nearest block or comment. | 631 | this case, the function should find nearest block or comment. |
| @@ -726,7 +729,7 @@ to call with the newly initialized overlay." | |||
| 726 | 729 | ||
| 727 | (defun hs-block-positions () | 730 | (defun hs-block-positions () |
| 728 | "Return the current code block positions. | 731 | "Return the current code block positions. |
| 729 | This return a cons-cell with the current code block beginning and end | 732 | This returns a cons-cell with the current code block beginning and end |
| 730 | positions. This does nothing if there is not a code block at current | 733 | positions. This does nothing if there is not a code block at current |
| 731 | point." | 734 | point." |
| 732 | (save-match-data | 735 | (save-match-data |
| @@ -815,8 +818,8 @@ point." | |||
| 815 | (_ (save-excursion | 818 | (_ (save-excursion |
| 816 | (goto-char b-beg) | 819 | (goto-char b-beg) |
| 817 | (funcall hs-looking-at-block-start-predicate))) | 820 | (funcall hs-looking-at-block-start-predicate))) |
| 818 | ;; `catch' is used here if the search fail due | 821 | ;; `catch' is used here if the search fails due |
| 819 | ;; unbalanced parenthesis or any other unknown error | 822 | ;; unbalanced parentheses or any other unknown error |
| 820 | ;; caused in `hs-forward-sexp'. | 823 | ;; caused in `hs-forward-sexp'. |
| 821 | (b-end (catch 'hs-indicator-error | 824 | (b-end (catch 'hs-indicator-error |
| 822 | (save-excursion | 825 | (save-excursion |
| @@ -833,7 +836,7 @@ point." | |||
| 833 | `(jit-lock-bounds ,beg . ,end)) | 836 | `(jit-lock-bounds ,beg . ,end)) |
| 834 | 837 | ||
| 835 | (defun hs--refresh-indicators (from to) | 838 | (defun hs--refresh-indicators (from to) |
| 836 | "Update indicators appearance in FROM and TO." | 839 | "Update indicator appearance in FROM and TO." |
| 837 | (when (and hs-show-indicators hs-minor-mode) | 840 | (when (and hs-show-indicators hs-minor-mode) |
| 838 | (save-match-data | 841 | (save-match-data |
| 839 | (save-excursion | 842 | (save-excursion |
| @@ -945,7 +948,7 @@ a comment. | |||
| 945 | The block beginning is adjusted by `hs-adjust-block-beginning-function' | 948 | The block beginning is adjusted by `hs-adjust-block-beginning-function' |
| 946 | and then further adjusted to be at the end of the line. | 949 | and then further adjusted to be at the end of the line. |
| 947 | 950 | ||
| 948 | If hidding the block is successful, return non-nil. | 951 | If hiding the block is successful, return non-nil. |
| 949 | Otherwise, return nil." | 952 | Otherwise, return nil." |
| 950 | (if comment-reg | 953 | (if comment-reg |
| 951 | (hs-hide-comment-region (car comment-reg) (cadr comment-reg) end) | 954 | (hs-hide-comment-region (car comment-reg) (cadr comment-reg) end) |
| @@ -1247,8 +1250,8 @@ Upon completion, point is repositioned and the normal hook | |||
| 1247 | (line-end-position) nil)) | 1250 | (line-end-position) nil)) |
| 1248 | (goto-char (match-beginning 0))) | 1251 | (goto-char (match-beginning 0))) |
| 1249 | (funcall hs-looking-at-block-start-predicate)) | 1252 | (funcall hs-looking-at-block-start-predicate)) |
| 1250 | ;; If hidding the block fails (due the block is not hideable) | 1253 | ;; If hiding the block fails (due the block is not hideable) |
| 1251 | ;; Then just hide the parent block (if possible) | 1254 | ;; then just hide the parent block (if possible) |
| 1252 | (unless (save-excursion (hs-hide-block-at-point end)) | 1255 | (unless (save-excursion (hs-hide-block-at-point end)) |
| 1253 | (goto-char (1- (point))) | 1256 | (goto-char (1- (point))) |
| 1254 | (funcall hs-find-block-beginning-function) | 1257 | (funcall hs-find-block-beginning-function) |
| @@ -1320,10 +1323,11 @@ Argument E should be the event that triggered this action." | |||
| 1320 | (hs-show-block) | 1323 | (hs-show-block) |
| 1321 | (hs-hide-block)))) | 1324 | (hs-hide-block)))) |
| 1322 | 1325 | ||
| 1323 | (define-obsolete-function-alias 'hs-mouse-toggle-hiding #'hs-toggle-hiding "27.1") | 1326 | (define-obsolete-function-alias |
| 1327 | 'hs-mouse-toggle-hiding #'hs-toggle-hiding "27.1") | ||
| 1324 | 1328 | ||
| 1325 | (defun hs-indicator-mouse-toggle-hidding (event) | 1329 | (defun hs-indicator-mouse-toggle-hiding (event) |
| 1326 | "Toggle block hidding with indicators." | 1330 | "Toggle block hiding with indicators." |
| 1327 | (interactive "e") | 1331 | (interactive "e") |
| 1328 | (hs-life-goes-on | 1332 | (hs-life-goes-on |
| 1329 | (when hs-show-indicators | 1333 | (when hs-show-indicators |