all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: moasenwood--- via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Dired: how to mark with other character but *
Date: Sun, 31 Jan 2021 10:34:25 +0100	[thread overview]
Message-ID: <87k0rtjvq6.fsf@zoho.eu> (raw)
In-Reply-To: 87r1m1jw2z.fsf@zoho.eu

> 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




  reply	other threads:[~2021-01-31  9:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-31  6:18 Dired: how to mark with other character but * Jean Louis
2021-01-31  6:23 ` Jean Louis
2021-01-31  6:43   ` moasenwood--- via Users list for the GNU Emacs text editor
2021-01-31  7:29     ` Jean Louis
2021-01-31  6:53 ` Marcin Borkowski
2021-01-31  7:23   ` moasenwood--- via Users list for the GNU Emacs text editor
2021-01-31  7:36     ` Jean Louis
2021-01-31  7:46       ` moasenwood--- via Users list for the GNU Emacs text editor
2021-02-01 16:35     ` [External] : " Drew Adams
2021-02-01 17:09       ` Drew Adams
2021-02-01 17:24         ` Drew Adams
2021-02-02  4:15           ` moasenwood--- via Users list for the GNU Emacs text editor
2021-02-05 20:59             ` Drew Adams
2021-02-05 21:02               ` Stefan Monnier
2021-02-05 21:10                 ` Drew Adams
2021-02-01 23:47         ` Drew Adams
2021-02-02  4:14         ` moasenwood--- via Users list for the GNU Emacs text editor
2021-01-31  7:34   ` Jean Louis
2021-01-31  8:20     ` Marcin Borkowski
2021-01-31  9:09       ` Jean Louis
2021-01-31  9:26         ` moasenwood--- via Users list for the GNU Emacs text editor
2021-01-31  9:34           ` moasenwood--- via Users list for the GNU Emacs text editor [this message]
2021-01-31 14:47 ` Eli Zaretskii
2021-02-01  2:25   ` Jean Louis
2021-01-31 21:30 ` Michael Heerdegen
2021-01-31 21:37   ` moasenwood--- via Users list for the GNU Emacs text editor

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=87k0rtjvq6.fsf@zoho.eu \
    --to=help-gnu-emacs@gnu.org \
    --cc=moasenwood@zoho.eu \
    /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.