Skip to content

Emacs Help Mode#2240

Open
VisenDev wants to merge 14 commits into
lem-project:mainfrom
VisenDev:describe
Open

Emacs Help Mode#2240
VisenDev wants to merge 14 commits into
lem-project:mainfrom
VisenDev:describe

Conversation

@VisenDev

Copy link
Copy Markdown
Contributor

Initial work to address #2231

I'm not sure if the only way to do this is to overwrite and restore the ctrl-h binding in the global-map or if using a minor mode keymap will help me here. I'd appreciate any advice on whats the best way to replace just a single keybinding prefix like this

@VisenDev VisenDev marked this pull request as ready for review June 22, 2026 02:07
@code-contractor-app

code-contractor-app Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor
⚠️ Violations Found (1):

[ERROR] functional_style_rule
  AI check failed: "functional_style_rule"
  ❌ Reason:
    Added code introduces dynamic global state via `defvar` to pass state
    between enable/disable operations, which this rule discourages outside
    well-documented exceptions.


ℹ️ 1 violation(s) dismissed


💬 Feedback

Reply to a violation comment with:

  • /dismiss <reason> - Report false positive or not applicable
📚 About Code Contractor

Declarative Code Standards That Learn and Improve

Define domain-specific validation rules in YAML.
Your contracts document team knowledge and evolve into more accurate AI enforcement.

Want this for your repo?
Install Code Contractor

@code-contractor-app code-contractor-app Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Contractor validation failed ❌ — see the sticky comment for full results.

Comment thread extensions/emacs-help-mode/main.lisp Outdated
Comment thread extensions/emacs-help-mode/main.lisp Outdated
Comment thread src/commands/help.lisp
Comment thread extensions/emacs-help-mode/main.lisp Outdated
Comment thread extensions/emacs-help-mode/main.lisp Outdated
(:use #:cl #:lem))
(in-package #:lem-emacs-help-mode)

(defvar *previous-ctrl-h-suffix* nil)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Contractor: functional_style_rule

Contract: contract

AI check failed: "functional_style_rule"

Reason:
Added code introduces dynamic global state via defvar to pass state between enable/disable operations, which this rule discourages outside well-documented exceptions.


💬 Reply /dismiss <reason> to dismiss this violation.

Comment thread src/commands/help.lisp
@VisenDev

VisenDev commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

@vindarel Could you give me some assistance on how to globally rebind C-h, currently I am just replacing the binding in the global map, but would adding a minor mode keymap accomplish the same thing?

EDIT: I just decided to try using minor-mode-keymap and see if that did what I wanted, and it seemed to do so.

Comment thread src/commands/help.lisp
:list-modes)
:list-modes
:describe-all-modes
:*describe-output-type-override*)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really necessary (for end users) to export this variable? You can access it with ::.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do mean Lem users can use it (to have help text in buffers rather than popups for instance), I'd push for a better name.

Also, what about giving prefix arguments to the interactive commands, to change the output type?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant for it to be customizable for lem users yes. If you have any better name suggestions I would be happy to hear them, I had a lot of trouble naming this variable.

As to prefix arguments, I'm not sure what would be involved for that, do you mean prefix arguments like how you can do C-u M-x foo in emacs to give extra arguments for the command?

Comment thread src/commands/help.lisp Outdated
Comment thread src/commands/help.lisp Outdated
Comment thread src/commands/help.lisp Outdated
Comment thread src/commands/help.lisp Outdated
Comment thread src/commands/help.lisp Outdated
Comment thread src/commands/help.lisp Outdated
Comment thread src/key.lisp Outdated
Comment thread src/commands/help.lisp Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants