all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Making Menu Bar with an About Buffer
@ 2022-10-16 21:36 Heime via Users list for the GNU Emacs text editor
  2022-10-20 21:09 ` Jean Louis
  0 siblings, 1 reply; 5+ messages in thread
From: Heime via Users list for the GNU Emacs text editor @ 2022-10-16 21:36 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

Have seen that Emacs has "About Emacs" and "About Gnu". I would like to do the same with a new "Menu Bar"
called "Gundit" where there is "About Gundit" which prints about Gundit in a dedicated buffer.

How can this be done?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Making Menu Bar with an About Buffer
  2022-10-16 21:36 Making Menu Bar with an About Buffer Heime via Users list for the GNU Emacs text editor
@ 2022-10-20 21:09 ` Jean Louis
  2022-10-21  3:05   ` Emanuel Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Jean Louis @ 2022-10-20 21:09 UTC (permalink / raw)
  To: Heime; +Cc: help-gnu-emacs@gnu.org

* Heime via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> [2022-10-17 00:38]:
> Have seen that Emacs has "About Emacs" and "About Gnu". I would like to do the same with a new "Menu Bar"
> called "Gundit" where there is "About Gundit" which prints about Gundit in a dedicated buffer.
> 
> How can this be done?

You define function and add it to menu.

My function below uses about: hyperlinks, it decides what to display.

I have defined "about:" hyperlink in `browse-url-handlers' to be:

   '(("gemini:" . elpher-go)
     ("gopher:" . elpher-handler-go)
     ("about:" . hyperscope-about)
     ("hyperscope:" . hyperscope-go)
     ("e2dk://" . amule-handler)))


Then this function is showing About, it has Hyperlinks underline where
it says about:

(defun hyperscope-about (&rest what)
  (interactive)
  (let* ((what (if (eql 'cons (type-of what))
		   (car what)
		 what))
	 (what (if (null what) "about:hyperscope" what)))
    (cond ((string= what "about:hyperscope") (hyperscope-text-view "
	 ===================================================
	 Hyperscope - Dynamic Knowledge Repository for Emacs
	 ===================================================
                           about:emacs
                           about:emacs-fancy
                           about:hyperscope
"))
	  ((string= what "about:emacs") (about-emacs))
	  ((string= what "about:emacs-fancy") (fancy-about-screen))
	  (t (hyperscope-text-view "Maybe you wish to read about:hyperscope")))))


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Making Menu Bar with an About Buffer
  2022-10-20 21:09 ` Jean Louis
@ 2022-10-21  3:05   ` Emanuel Berg
  2022-10-22 14:05     ` Dr Rainer Woitok
  0 siblings, 1 reply; 5+ messages in thread
From: Emanuel Berg @ 2022-10-21  3:05 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

>     (cond ((string= what "about:hyperscope") (hyperscope-text-view "
> 	 ===================================================
> 	 Hyperscope - Dynamic Knowledge Repository for Emacs
> 	 ===================================================
>                            about:emacs
>                            about:emacs-fancy
>                            about:hyperscope
> "))

What, it looks like that in the source?

That could be automated with variables and not hardcoded ...

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Making Menu Bar with an About Buffer
  2022-10-21  3:05   ` Emanuel Berg
@ 2022-10-22 14:05     ` Dr Rainer Woitok
  2022-10-24  2:54       ` Emanuel Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Dr Rainer Woitok @ 2022-10-22 14:05 UTC (permalink / raw)
  To: Emanuel Berg; +Cc: help-gnu-emacs

Emanuel,

On Friday, 2022-10-21 05:05:56 +0200, you wrote:

> Jean Louis wrote:
> 
> >     (cond ((string= what "about:hyperscope") (hyperscope-text-view "
> > 	 ===================================================
> > 	 Hyperscope - Dynamic Knowledge Repository for Emacs
> > 	 ===================================================
> >                            about:emacs
> >                            about:emacs-fancy
> >                            about:hyperscope
> > "))
> 
> What, it looks like that in the source?
> 
> That could be automated with variables and not hardcoded ...

Don't you think its better to use electrons ONCE when this string is de-
signed rather than EVERYTIME when someone is looking at it?

Sincerely,
  Rainer



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Making Menu Bar with an About Buffer
  2022-10-22 14:05     ` Dr Rainer Woitok
@ 2022-10-24  2:54       ` Emanuel Berg
  0 siblings, 0 replies; 5+ messages in thread
From: Emanuel Berg @ 2022-10-24  2:54 UTC (permalink / raw)
  To: help-gnu-emacs

Dr Rainer Woitok wrote:

>>>    (cond ((string= what "about:hyperscope") (hyperscope-text-view "
>>> 	 ===================================================
>>> 	 Hyperscope - Dynamic Knowledge Repository for Emacs
>>> 	 ===================================================
>>>                            about:emacs
>>>                            about:emacs-fancy
>>>                            about:hyperscope
>>> "))
>> 
>> What, it looks like that in the source?
>> 
>> That could be automated with variables and not hardcoded ...
>
> Don't you think its better to use electrons ONCE when this
> string is de- signed rather than EVERYTIME when someone is
> looking at it?

Nope, because that also means instead of doing it once and
forever getting it right everytime someone does it we will
have the same (poor) situation ...

And, if you are concerned for the electrons, a program can
store the result in a variable once just as well as any human
can storing it in hard-coded code (actually better, because
then checks can be made the input makes sense).

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-24  2:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-16 21:36 Making Menu Bar with an About Buffer Heime via Users list for the GNU Emacs text editor
2022-10-20 21:09 ` Jean Louis
2022-10-21  3:05   ` Emanuel Berg
2022-10-22 14:05     ` Dr Rainer Woitok
2022-10-24  2:54       ` Emanuel Berg

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.