From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Emanuel Berg via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help,gmane.emacs.devel Subject: hidden (updated) Elisp to do the job Date: Sat, 18 Jan 2020 19:51:39 +0100 Message-ID: <86wo9oion8.fsf@zoho.eu> Reply-To: Emanuel Berg Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="110104"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: emacs-devel@gnu.org To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:/l4v4JShCag1OdcJdESOuA1ey5M= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 18 19:52:07 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1istCZ-000SaW-0B for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 18 Jan 2020 19:52:07 +0100 Original-Received: from localhost ([::1]:43676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1istCY-0004OG-1o for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 18 Jan 2020 13:52:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46212) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1istCF-0004O3-7Z for help-gnu-emacs@gnu.org; Sat, 18 Jan 2020 13:51:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1istCD-0001ec-Li for help-gnu-emacs@gnu.org; Sat, 18 Jan 2020 13:51:47 -0500 Original-Received: from ciao.gmane.io ([159.69.161.202]:43740) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1istCD-0001e6-F3 for help-gnu-emacs@gnu.org; Sat, 18 Jan 2020 13:51:45 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1istCB-000SD1-ES for help-gnu-emacs@gnu.org; Sat, 18 Jan 2020 19:51:43 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Followup-To: gmane.emacs.help Mail-Copies-To: never X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 159.69.161.202 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:122249 gmane.emacs.devel:244352 Archived-At: 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: 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