[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dired: how to mark with other character but *
From: |
Emanuel Berg |
Subject: |
Re: Dired: how to mark with other character but * |
Date: |
Sun, 31 Jan 2021 10:34:25 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> Your function need not have any key defined, users could
> define on which key to put it.
Check out this solution/interface to another problem.
This function has a state, that can change, but it uses
properties so there is no global variable.
You use it by invoking it (I have it `C-c j'), if you want to
set a new column to which text should be aligned, you just
move there and do `C-u C-c j', this changes the state so the
next time it is invoked that column is the reference...
Pretty cool, if I may...
Did anyone else do that or do I get to name it?
Nah, probably many people did it...
But it is still cool! :)
(defun pad-to-col (&optional set-new-col)
(interactive "p")
(let*((plist (symbol-plist #'pad-to-col))
(prop 'pad-col)
(pad-col (or (plist-get plist prop) 0))
(beg-col (or (current-column) 4)) )
(if (and set-new-col (= 4 set-new-col))
(progn
(plist-put plist prop beg-col)
(message "pad col set: %s" beg-col) )
(let ((step (- pad-col beg-col)))
(when (> step 0)
(insert (make-string step ?\s))
(forward-line 1)
(forward-char beg-col) )))))
https://dataswamp.org/~incal/emacs-init/align-new.el
--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal
- Re: Dired: how to mark with other character but *, (continued)
Re: Dired: how to mark with other character but *, Eli Zaretskii, 2021/01/31
Re: Dired: how to mark with other character but *, Michael Heerdegen, 2021/01/31