unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* hidden (updated) Elisp to do the job
@ 2020-01-18 18:51 Emanuel Berg via Users list for the GNU Emacs text editor
  2020-01-18 20:01 ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 2+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2020-01-18 18:51 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: emacs-devel

Here is even more Elisp for your viewing
pleasure. Keep up the good job!

And... what... does the first function _do_,
really?!

(PS. Save for the esoteric/dual feature, the
 other time file - mentioned - is more
 interesting. And more spooky... :) DS.)

But now, check out the new stuff first hand:
  <https://dataswamp.org/~incal/emacs-init/time-my-insert.el>

Or read it right here:

PZ


;; this file: http://user.it.uu.se/~embe8573/emacs-init/time-my-insert.el
;;            https://dataswamp.org/~incal/emacs-init/time-my-insert.el


;; also see: http://user.it.uu.se/~embe8573/emacs-init/time-my.el
;;           https://dataswamp.org/~incal/emacs-init/time-my.el


;; see example file LAST in this file to get
;; the (point) immediately :)

;; eval this to go to the example:
;;   (progn (re-search-forward "example") (recenter 0))

(require 'subr-x)

(defun insert-shell-command (cmd)
  (interactive "s Command: ")
  (let ((pos (point))
        (end (point-max)) )
    (shell-command cmd 1)
    (goto-char (+ pos (- (point-max) end 1))) )
  (delete-char 1) )

(defun get-date ()
  (string-trim
   (shell-command-to-string "date +\"%Y-%m-%d\"") ))

(defun insert-date ()
  (interactive)
  (insert (get-date)) )
(defalias 'today #'insert-date)
;; (insert-date)

(defun insert-time ()
  (interactive)
  (insert-shell-command "date +\"%H:%M\"") )

(defun updated ()
  (save-excursion
    (let ((start (point)))
      (insert "  ")
      (insert-date)
      (insert "  ")
      (insert-time)
      (delete-char (- (point) start)) ))
  (save-buffer)
  )


;; example file:

;;
;;               list of things to study
;;    ---------------------------------------------
;;
;;
;;      the Emacs manual
;;
;;      tatoos on Kate Moss's body
;;
;;      more X-Men and Alita comics
;;
;;      big book on computer architecture (maybe)
;;
;;      my hygrometer
;;
;;
;;    .............................................
;;            (updated)  2020-01-18  19:22
;;

;;                     ^eval me!

(provide 'time-my-insert)

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: hidden (updated) Elisp to do the job
  2020-01-18 18:51 hidden (updated) Elisp to do the job Emanuel Berg via Users list for the GNU Emacs text editor
@ 2020-01-18 20:01 ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 2+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2020-01-18 20:01 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: emacs-devel

> [...]

Real world example - we are building
a bastu/sauna/banya! [1]
    
Credits so far!

Well - between us Emacs aficionados - I've
been doing 98% of the work to this day!
Which has been a lot :) Which is how I like it
:) But that file doesn't consider that, by
intent, to get to the people who don't do jack
:) It is all figured out B)

Anyway the `updated' function works great and
a real long-ear Lisper will immediately spot
it :)

Straight Secret Empire!


[1] https://dataswamp.org/~incal/moas/bastu/bems-active.txt

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-18 20:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-18 18:51 hidden (updated) Elisp to do the job Emanuel Berg via Users list for the GNU Emacs text editor
2020-01-18 20:01 ` Emanuel Berg via Users list for the GNU Emacs text editor

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