unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: dupayrat bertrand <bertrand.dupayrat@wanadoo.fr>
To: 9710@debbugs.gnu.org
Subject: bug#9710: tiny extension to sort.el
Date: Sun, 9 Oct 2011 09:12:24 +0200 (CEST)	[thread overview]
Message-ID: <30745713.35594.1318144344742.JavaMail.www@wwinf1k19> (raw)


;;
;; the snippet : "indirect value" how-to :
;; (defconst to-nil nil) <-- C-x e ;;i don't found such a canonic thing in emacs . 
;; 
;; (progn (setq var "testv" testv "hit") (eval(read var))) <-- C-x e
;; (progn (setq var "to-nil" testv "any-value") (eval(read var))) <-- C-X e
;;
;; _application_ : add an option reverse to sort-fields-1 this behind the scene .
;;
(defconst to-nil nil "to-nil := nil : invariant")
(defvar reverse-sort-field-var-name nil "see sort-fields-1") ;; add it to custom default value to-nil

(defun sort-fields-1 (field beg end startkeyfun endkeyfun) "sort-field-1 with direct/reverse feature"
(let ((tbl (syntax-table)))
(if (zerop field) (setq field 1))
(unwind-protect
(save-excursion
(save-restriction
(narrow-to-region beg end)
(goto-char (point-min))
(set-syntax-table sort-fields-syntax-table)
(sort-subr (eval (read reverse-sort-field-var-name)) ; the backward compatible (tiny) extension.
; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! and not "nil"
'forward-line 'end-of-line
startkeyfun endkeyfun)))
(set-syntax-table tbl)))))
;;

;;





                 reply	other threads:[~2011-10-09  7:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=30745713.35594.1318144344742.JavaMail.www@wwinf1k19 \
    --to=bertrand.dupayrat@wanadoo.fr \
    --cc=9710@debbugs.gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).