GNU bug report logs - #47690
28.0.50; repeat-mode: Introduce a defmacro for chaining commands ???

Previous Next

Package: emacs;

Reported by: Ramesh Nedunchezian <rameshnedunchezian <at> outlook.com>

Date: Sat, 10 Apr 2021 12:30:02 UTC

Severity: normal

Found in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47690 in the body.
You can then email your comments to 47690 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#47690; Package emacs. (Sat, 10 Apr 2021 12:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ramesh Nedunchezian <rameshnedunchezian <at> outlook.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 10 Apr 2021 12:30:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ramesh Nedunchezian <rameshnedunchezian <at> outlook.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; repeat-mode: Introduce a defmacro for chaining commands ???
Date: Sat, 10 Apr 2021 17:58:58 +0530
Think of this email not as a bug, but as a note ... So, feel free to
close it after digesting the contents.

Context:

   When I look at the documentation of many of the MELPA packages,
   they have long long long lines i.e., one line per-paragraph.  It
   always bothers me when I run across such files.  I always hated
   reaching out to menu to fix the wrap.  Now that there is
   `repeat-mode', I can mindlessly keep pressing a key--F12 in the
   present case--to cycle through various wraps until I land in the
   one that is agreeable.

;; Pressing F12 repeatedly is equivalent to cycling through the
;; following 3 radio buttons
;;
;; 1. Wrap at Window Edge
;; 2. Truncate Long Lines
;; 3. Word Wrap (Visual Line Mode)
;;
;; in Menu->Options->Line Wrapping in this Buffer.
;;
;; This is implemented through the all new `repeat-mode' feature.
;;
;; Much like how `C-l' (= `recenter-top-bottom') cycles the cursor
;; though different positions, pressing F12 will take the buffer
;; through different wrap settings.
;;
;; This is what I see in *Messages* buffer when I press F12
;; repeatedly.
;;
;; Visual-Line mode enabled
;; Visual-Line mode enabled [Repeat with <f12>]
;; Truncate long lines enabled
;; Truncate long lines enabled [Repeat with <f12>]
;; Truncate long lines disabled
;; Truncate long lines disabled [Repeat with <f12>]
;; Visual-Line mode enabled
;; Visual-Line mode enabled [Repeat with <f12>]

;; Note: Instead of wrapping at window edge, a better idea would be to
;; use `visual-fill-mode'.  See
;; https://elpa.gnu.org/packages/visual-fill.html.

;; It may be a good idea (?) to provide a macro, say, `chaincmds',
;; which can generate the below code when invoked with
;;
;; (chain-cmds (kbd "<f12>")
;; 		'(menu-bar--visual-line-mode-enable
;; 		  menu-bar--toggle-truncate-long-lines 
;; 		  menu-bar--wrap-long-lines-window-edge))

(define-key global-map (kbd "<f12>") 'menu-bar--visual-line-mode-enable)
(let ((key [f12]))
  (defvar menu-bar--visual-line-mode-enable--repeat-map
    (let ((map (make-sparse-keymap))) map))
  (define-key menu-bar--visual-line-mode-enable--repeat-map key 'menu-bar--toggle-truncate-long-lines)

  (put 'menu-bar--visual-line-mode-enable 'repeat-map 'menu-bar--visual-line-mode-enable--repeat-map)
  

  (defvar menu-bar--toggle-truncate-long-lines--repeat-map
    (let ((map (make-sparse-keymap))) map))
  (define-key menu-bar--toggle-truncate-long-lines--repeat-map key 'menu-bar--wrap-long-lines-window-edge)

  (put 'menu-bar--toggle-truncate-long-lines 'repeat-map 'menu-bar--toggle-truncate-long-lines--repeat-map)

  (defvar menu-bar--wrap-long-lines-window-edge--repeat-map
    (let ((map (make-sparse-keymap))) map))
  (define-key menu-bar--wrap-long-lines-window-edge--repeat-map key 'menu-bar--visual-line-mode-enable)

  (put 'menu-bar--wrap-long-lines-window-edge 'repeat-map 'menu-bar--wrap-long-lines-window-edge--repeat-map))


--------------------------------


In GNU Emacs 28.0.50 (build 5, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2021-04-10 built on debian
Repository revision: 0db2126d7176b0bd1b13d4b0d1cd958c8cf55714
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12010000
System Description: Debian GNU/Linux bullseye/sid

Configured using:
 'configure -with-imagemagick --with-json --with-xwidgets'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2
M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM XWIDGETS GTK3 ZLIB




Reply sent to Juri Linkov <juri <at> linkov.net>:
You have taken responsibility. (Mon, 12 Apr 2021 16:15:02 GMT) Full text and rfc822 format available.

Notification sent to Ramesh Nedunchezian <rameshnedunchezian <at> outlook.com>:
bug acknowledged by developer. (Mon, 12 Apr 2021 16:15:02 GMT) Full text and rfc822 format available.

Message #10 received at 47690-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Ramesh Nedunchezian <rameshnedunchezian <at> outlook.com>
Cc: 47690-done <at> debbugs.gnu.org
Subject: Re: bug#47690: 28.0.50; repeat-mode: Introduce a defmacro for
 chaining commands ???
Date: Mon, 12 Apr 2021 19:13:45 +0300
> Think of this email not as a bug, but as a note ... So, feel free to
> close it after digesting the contents.

Thanks, your notes will be saved for posterity, although I see
nothing actionable here, repeat-mode is not like a hydra package.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 11 May 2021 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 351 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.