unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9710: tiny extension to sort.el
@ 2011-10-09  7:12 dupayrat bertrand
  0 siblings, 0 replies; only message in thread
From: dupayrat bertrand @ 2011-10-09  7:12 UTC (permalink / raw)
  To: 9710


;;
;; 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)))))
;;

;;





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-10-09  7:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-09  7:12 bug#9710: tiny extension to sort.el dupayrat bertrand

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).