help-gnu-emacs
[Top][All Lists]
Advanced

[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:26:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Jean Louis wrote:

> 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 uses
properties so there is no global variable.

You use it by invoking it (I have i

(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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]