unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Heime <heimeborgia@protonmail.com>
Cc: Dr Rainer Woitok <rainer.woitok@gmail.com>, help-gnu-emacs@gnu.org
Subject: Re: [External] : Make new buffer from menu
Date: Sun, 4 Dec 2022 15:39:06 +0300	[thread overview]
Message-ID: <Y4yU6rJx6IF7NwV4@protected.localdomain> (raw)
In-Reply-To: <Enb1yCnfH7oHiJQZVdjaqpCkw9WuLspv21jI7Sy_qAydLdDLx9i5-RCucQoFrxQxwbUJFb34hiKjqRnhphw81ECiHspBAtSqFV2Xyk-sCKk=@protonmail.com>

* Heime <heimeborgia@protonmail.com> [2022-12-04 15:34]:
> So tell me about this.  Can I make a new untitled buffer that I can later 
> save if I want to, from the File Menu, in the Menu Bar ?

I have sent my functions to you, that is exactly what I do every
day. I press F5 for that.

Install RCD Utilities and use this:

;;; RCD TEMPORARY BUFFERS

(defvar rcd-temp-buffer-name "RCD TEMPORARY BUFFER")
(defvar rcd-temp-buffer-modes '(("adoc-mode" . "adoc")
				("emacs-lisp-mode" . "el")
				("lisp-mode" . ".lisp")
				("markdown-mode" . ".md")
				("org-mode" . "org")
				("sql-mode" . "sql")
				("fundamental-mode" . "txt")
				("html-mode" . "html")))

(defun rcd-temp-buffer (&optional prefix name mode)
  "Generate new temporary buffer."
  (interactive "p")
  (let* ((file-name (concat rcd-temp-file-directory 
			    (format-time-string "%Y-%m-%d-%H:%M:%S-")
			    rcd-temp-buffer-name
			    ".txt"))
	 (buffer (or name (concat "*" rcd-temp-buffer-name "*"))))
    (switch-to-buffer (generate-new-buffer buffer))
    (setq buffer-file-name file-name)
    (if current-prefix-arg
	(let ((mode (rcd-choose (map-keys rcd-temp-buffer-modes) "Major mode: ")))
	  (funcall (intern mode)))
      (funcall (intern (or mode "fundamental-mode"))))
    buffer-file-name))

(global-set-key (kbd "<f5>") #'rcd-temp-buffer)


-- 
Jean

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

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



  reply	other threads:[~2022-12-04 12:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-03  3:58 Make new buffer from menu Heime
2022-12-03 17:20 ` [External] : " Drew Adams
2022-12-03 18:43   ` Heime
2022-12-03 19:15     ` tomas
2022-12-03 20:27       ` Heime
2022-12-04  6:20         ` tomas
2022-12-04  6:48         ` Eli Zaretskii
2022-12-04  7:20           ` Heime
2022-12-04 14:20             ` Jean Louis
2022-12-04 17:12             ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-12-04 12:13         ` Jean Louis
2022-12-04 11:55     ` Dr Rainer Woitok
2022-12-04 12:32       ` Heime
2022-12-04 12:39         ` Jean Louis [this message]
2022-12-04 12:36     ` Jean Louis
2022-12-04 12:03 ` Jean Louis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y4yU6rJx6IF7NwV4@protected.localdomain \
    --to=bugs@gnu.support \
    --cc=heimeborgia@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=rainer.woitok@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).