all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#19492: How to neatly call interactive commands interactively?
@ 2015-01-02 22:09 Reuben Thomas
  2019-08-02 20:24 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Reuben Thomas @ 2015-01-02 22:09 UTC (permalink / raw)
  To: 19492

[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

I wanted to combine a couple of modes for soft-wrapped text, so I wrote:

(defun soft-wrap-modes ()
  (interactive)
  "Turn on minor modes for soft wrap"
  (if (called-interactively-p) (call-interactively
'adaptive-wrap-prefix-mode) (adaptive-wrap-prefix-mode))
  (if (called-interactively-p) (call-interactively 'window-margin-mode)
(window-margin-mode)))

The idea is that soft-wrap-modes should toggle when used interactively,
just like the underlying mode commands. But this is not very nice. It could
be made a bit nicer using map, but is there no way to transparently pass
the interactivity of the current command down to the sub-commands? I
couldn't see a way to do this with the standard methods for testing whether
a command is called in interactive mode.

-- 
http://rrt.sc3d.org

[-- Attachment #2: Type: text/html, Size: 1068 bytes --]

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

end of thread, other threads:[~2019-08-03  2:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-02 22:09 bug#19492: How to neatly call interactive commands interactively? Reuben Thomas
2019-08-02 20:24 ` Lars Ingebrigtsen
2019-08-03  2:46   ` Noam Postavsky

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.