* Feature Request: Ability to Tweak "/l" in mode-name
@ 2023-02-08 3:57 T.V Raman
2023-02-08 12:04 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: T.V Raman @ 2023-02-08 3:57 UTC (permalink / raw)
To: emacs-devel
At present the "/l" vs "/d" for lexical vs dynamic scoping is
hard-wired in the definition of emacs-lisp-mode; Could we make this
configurable?
(define-derived-mode emacs-lisp-mode lisp-data-mode
`("ELisp"
(lexical-binding (:propertize "/l"
help-echo "Using lexical-binding mode")
(:propertize "/d"
help-echo "Using old dynamic scoping mode\n\
mouse-1: Enable lexical-binding mode"
face warning
mouse-face mode-line-highlight
local-map ,elisp--dynlex-modeline-map)))
"Major mode for editing Lisp code to run in Emacs.
Commands:
Delete converts tabs to spaces as it moves back.
Blank lines separate paragraphs. Semicolons start comments.
When editing Lisp data (as opposed to code), `lisp-data-mode' can
be used instead.
\\{emacs-lisp-mode-map}"
:group 'lisp
(defvar project-vc-external-roots-function)
(setcar font-lock-defaults
'(lisp-el-font-lock-keywords
lisp-el-font-lock-keywords-1
lisp-el-font-lock-keywords-2))
(setf (nth 2 font-lock-defaults) nil)
(add-hook 'after-load-functions #'elisp--font-lock-flush-elisp-buffers)
(if (boundp 'electric-pair-text-pairs)
(setq-local electric-pair-text-pairs
(append '((?\` . ?\') (?\‘ . ?\’))
electric-pair-text-pairs))
(add-hook 'electric-pair-mode-hook #'emacs-lisp-set-electric-text-pairs))
(add-hook 'eldoc-documentation-functions
#'elisp-eldoc-funcall nil t)
(add-hook 'eldoc-documentation-functions
#'elisp-eldoc-var-docstring nil t)
(add-hook 'xref-backend-functions #'elisp--xref-backend nil t)
(setq-local project-vc-external-roots-function #'elisp-load-path-roots)
(setq-local syntax-propertize-function #'elisp-mode-syntax-propertize)
(add-hook 'completion-at-point-functions
#'elisp-completion-at-point nil 'local)
(add-hook 'flymake-diagnostic-functions #'elisp-flymake-checkdoc nil t)
(add-hook 'flymake-diagnostic-functions
#'elisp-flymake-byte-compile nil t)
(add-hook 'context-menu-functions #'elisp-context-menu 10 t))
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1 🦮
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1 🦮
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Feature Request: Ability to Tweak "/l" in mode-name
2023-02-08 3:57 Feature Request: Ability to Tweak "/l" in mode-name T.V Raman
@ 2023-02-08 12:04 ` Eli Zaretskii
2023-02-08 12:30 ` Basil L. Contovounesios
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2023-02-08 12:04 UTC (permalink / raw)
To: T.V Raman; +Cc: emacs-devel
> From: "T.V Raman" <raman@google.com>
> Date: Tue, 7 Feb 2023 19:57:21 -0800
>
> At present the "/l" vs "/d" for lexical vs dynamic scoping is
> hard-wired in the definition of emacs-lisp-mode; Could we make this
> configurable?
Do we offer customization of the mode lighter in any other modes?
You can always customize any part of the mode line directly, by
changing mode-line-format or its portions, so I'm unsure why we would
need yet another knob, and in this specific case in particular.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Feature Request: Ability to Tweak "/l" in mode-name
2023-02-08 12:04 ` Eli Zaretskii
@ 2023-02-08 12:30 ` Basil L. Contovounesios
2023-02-08 15:17 ` T.V Raman
2023-02-08 15:22 ` T.V Raman
0 siblings, 2 replies; 7+ messages in thread
From: Basil L. Contovounesios @ 2023-02-08 12:30 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: T.V Raman, emacs-devel
Eli Zaretskii [2023-02-08 14:04 +0200] wrote:
>> From: "T.V Raman" <raman@google.com>
>> Date: Tue, 7 Feb 2023 19:57:21 -0800
>>
>> At present the "/l" vs "/d" for lexical vs dynamic scoping is
>> hard-wired in the definition of emacs-lisp-mode; Could we make this
>> configurable?
>
> Do we offer customization of the mode lighter in any other modes?
Some modes expose the mode lighter as a user option,
e.g. flymake-mode-line-lighter. I suspect fewer do so in emacs.git than
in the wider ecosystem.
> You can always customize any part of the mode line directly, by
> changing mode-line-format or its portions, so I'm unsure why we would
> need yet another knob, and in this specific case in particular.
FWIW I use delight from GNU ELPA for this purpose, e.g.:
(delight
'((emacs-lisp-mode "(ε)" :major)
(lisp-interaction-mode "(ι)" :major)))
--
Basil
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Feature Request: Ability to Tweak "/l" in mode-name
2023-02-08 12:30 ` Basil L. Contovounesios
@ 2023-02-08 15:17 ` T.V Raman
2023-02-08 15:22 ` T.V Raman
1 sibling, 0 replies; 7+ messages in thread
From: T.V Raman @ 2023-02-08 15:17 UTC (permalink / raw)
To: contovob; +Cc: eliz, raman, emacs-devel
Your solution works for me, though at some nit-level, Emacs
hard-wiring the "/l" and "/d" is likely going to make it harder to
internationalize -- but that is the least of my or emacs' problems:-)
Basil L. Contovounesios writes:
> Eli Zaretskii [2023-02-08 14:04 +0200] wrote:
>
> >> From: "T.V Raman" <raman@google.com>
> >> Date: Tue, 7 Feb 2023 19:57:21 -0800
> >>
> >> At present the "/l" vs "/d" for lexical vs dynamic scoping is
> >> hard-wired in the definition of emacs-lisp-mode; Could we make this
> >> configurable?
> >
> > Do we offer customization of the mode lighter in any other modes?
>
> Some modes expose the mode lighter as a user option,
> e.g. flymake-mode-line-lighter. I suspect fewer do so in emacs.git than
> in the wider ecosystem.
>
> > You can always customize any part of the mode line directly, by
> > changing mode-line-format or its portions, so I'm unsure why we would
> > need yet another knob, and in this specific case in particular.
>
> FWIW I use delight from GNU ELPA for this purpose, e.g.:
>
> (delight
> '((emacs-lisp-mode "(ε)" :major)
> (lisp-interaction-mode "(ι)" :major)))
>
> --
> Basil
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1 🦮
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1 🦮
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Feature Request: Ability to Tweak "/l" in mode-name
2023-02-08 12:30 ` Basil L. Contovounesios
2023-02-08 15:17 ` T.V Raman
@ 2023-02-08 15:22 ` T.V Raman
2023-02-09 11:17 ` Basil L. Contovounesios
1 sibling, 1 reply; 7+ messages in thread
From: T.V Raman @ 2023-02-08 15:22 UTC (permalink / raw)
To: contovob; +Cc: eliz, raman, emacs-devel
Actually looking closer at this, it doesn't quite solve my problem, in
that it wont then let me know if it's using lexical or dynamic
scoping.
Basil L. Contovounesios writes:
> Eli Zaretskii [2023-02-08 14:04 +0200] wrote:
>
> >> From: "T.V Raman" <raman@google.com>
> >> Date: Tue, 7 Feb 2023 19:57:21 -0800
> >>
> >> At present the "/l" vs "/d" for lexical vs dynamic scoping is
> >> hard-wired in the definition of emacs-lisp-mode; Could we make this
> >> configurable?
> >
> > Do we offer customization of the mode lighter in any other modes?
>
> Some modes expose the mode lighter as a user option,
> e.g. flymake-mode-line-lighter. I suspect fewer do so in emacs.git than
> in the wider ecosystem.
>
> > You can always customize any part of the mode line directly, by
> > changing mode-line-format or its portions, so I'm unsure why we would
> > need yet another knob, and in this specific case in particular.
>
> FWIW I use delight from GNU ELPA for this purpose, e.g.:
>
> (delight
> '((emacs-lisp-mode "(ε)" :major)
> (lisp-interaction-mode "(ι)" :major)))
>
> --
> Basil
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1 🦮
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1 🦮
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Feature Request: Ability to Tweak "/l" in mode-name
2023-02-08 15:22 ` T.V Raman
@ 2023-02-09 11:17 ` Basil L. Contovounesios
2023-02-09 15:22 ` T.V Raman
0 siblings, 1 reply; 7+ messages in thread
From: Basil L. Contovounesios @ 2023-02-09 11:17 UTC (permalink / raw)
To: T.V Raman; +Cc: eliz, emacs-devel
T.V Raman [2023-02-08 07:22 -0800] wrote:
> Actually looking closer at this, it doesn't quite solve my problem, in
> that it wont then let me know if it's using lexical or dynamic
> scoping.
You can reproduce similar logic as that of emacs-lisp-mode's lighter
using Delight. My example was just an excerpt from my configuration,
where I intentionally omit the lexical-binding information.
--
Basil
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Feature Request: Ability to Tweak "/l" in mode-name
2023-02-09 11:17 ` Basil L. Contovounesios
@ 2023-02-09 15:22 ` T.V Raman
0 siblings, 0 replies; 7+ messages in thread
From: T.V Raman @ 2023-02-09 15:22 UTC (permalink / raw)
To: contovob; +Cc: raman, eliz, emacs-devel
OK.
I made my life easier by setting major-mode as I wished in
emacs-lisp-mode-hook
Basil L. Contovounesios writes:
> T.V Raman [2023-02-08 07:22 -0800] wrote:
>
> > Actually looking closer at this, it doesn't quite solve my problem, in
> > that it wont then let me know if it's using lexical or dynamic
> > scoping.
>
> You can reproduce similar logic as that of emacs-lisp-mode's lighter
> using Delight. My example was just an excerpt from my configuration,
> where I intentionally omit the lexical-binding information.
>
> --
> Basil
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1 🦮
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
♉ Id: kg:/m/0285kf1 🦮
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-02-09 15:22 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-08 3:57 Feature Request: Ability to Tweak "/l" in mode-name T.V Raman
2023-02-08 12:04 ` Eli Zaretskii
2023-02-08 12:30 ` Basil L. Contovounesios
2023-02-08 15:17 ` T.V Raman
2023-02-08 15:22 ` T.V Raman
2023-02-09 11:17 ` Basil L. Contovounesios
2023-02-09 15:22 ` T.V Raman
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).