all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Vladimir Nikishkin <lockywolf@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 65905@debbugs.gnu.org
Subject: bug#65905: 30.0.50; Consider changing info buffer names to info<(org)> rather than info<3>
Date: Wed, 13 Sep 2023 22:04:31 +0800	[thread overview]
Message-ID: <87a5tq2mj5.fsf@laptop.lockywolf.net> (raw)
In-Reply-To: <83bke6nsam.fsf@gnu.org>


Eli Zaretskii <eliz@gnu.org> writes:

>> From: Vladimir Nikishkin <lockywolf@gmail.com>
>> Date: Wed, 13 Sep 2023 12:09:48 +0800
>> 
>> 
>> Dear Emacs Developers,
>> 
>> I would like to ask for a small usability improvement to Emacs. Could we
>> name info buffers as "info<(manual)>" (or, maybe, just
>> "info<org.info>"), not as "info<3>"? I do not always remember in which
>> order I open info manuals, and having a file name in the buffer name
>> should be nice an easily readable.
>
> Did you try using "C-h R"?  It will find the existing Info buffer
> without your need to remember any numbers.  Just type
>
>   C-h R org RET
>
> I have dozens of Info manuals in my Emacs sessions, and I always use
> "C-h R" to get to those whose numbers I don't remember (which is all
> but the 2 Emacs manuals).

But it's not the same thing, is it?
If I open some manual recently and then forget its name, how do I switch
back _to that manual which I have been reading in the past hour but
which name I do not remember_?

At the moment I have installed an advice:

#+begin_src
(advice-add 'info-display-manual :after
            (lambda (x)
              (rename-buffer (seq-concatenate 'string "info<" (file-name-nondirectory Info-current-file) ">"))))
#+end_src

I also have a hack to show buffer names in window titles, and seeing
there info<org> is nicer than info<3>.
(But that snippet is a little suboptimal, so I am a little hesitant to
show it.)

#+begin_src elisp
(defvar-local lockywolf/org-buffer-memoized-title nil)
(defun lockywolf/generate-frame-title ()
  "Generated frame title from all buffers."
  (interactive)
  (let* ((retval "")
         (nwin (let ((nwin  0))
                 (walk-window-tree
                  (lambda (x) (setf nwin (+ 1 nwin))))
                 nwin))
         (maxlen (if (= nwin 1) 999 11)))
    ;; (message "lwf:debug:nwin=%s" nwin)
    (walk-window-tree
     (lambda (x)
       ;; (message "mode=%s" major-mode)
       (defun truncate-title (title)
         (seq-subseq
          title
          0
          (min maxlen (seq-length title))))
       (setf retval
               (seq-concatenate
                'string
                retval
                "  "
                (let ((wb (window-buffer x)))
                  (with-current-buffer wb
                    (truncate-title
                     (if (not (equalp major-mode 'org-mode))
                         (buffer-name wb)
                       ;;;;; org-get-title is super slow
                       ;; (progn
                       ;;   (if (buffer-modified-p)
                       ;;       (setf lockywolf/org-buffer-memoized-title (org-get-title)))
                       ;;   (if  (equalp nil lockywolf/org-buffer-memoized-title)
                       ;;       (setf lockywolf/org-buffer-memoized-title (buffer-name wb)))
                       ;;   lockywolf/org-buffer-memoized-title)
                       (seq-concatenate 'string "TMP:" (buffer-name wb))
                       ))
                    ))))))
    (setf (frame-parameter nil 'name) retval)
    retval))
(setq-default frame-title-format '(:eval (lockywolf/generate-frame-title)))
#+end_src

-- 
Your sincerely,
Vladimir Nikishkin (MiEr, lockywolf)
(Laptop)





  reply	other threads:[~2023-09-13 14:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13  4:09 bug#65905: 30.0.50; Consider changing info buffer names to info<(org)> rather than info<3> Vladimir Nikishkin
2023-09-13 12:58 ` Eli Zaretskii
2023-09-13 14:04   ` Vladimir Nikishkin [this message]
2023-09-13 14:57     ` Eli Zaretskii
2023-09-13 15:07       ` Vladimir Nikishkin
2023-09-13 19:09         ` Eli Zaretskii
2023-09-14  1:13           ` Vladimir Nikishkin
2023-09-13 20:58       ` Kévin Le Gouguec
2023-09-14  2:11         ` Vladimir Nikishkin
2023-09-14  5:59         ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=87a5tq2mj5.fsf@laptop.lockywolf.net \
    --to=lockywolf@gmail.com \
    --cc=65905@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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.
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.