GNU Emacs package: rcd-utilities.el

GNU Emacs package: rcd-utilities.el

The GNU Emacs package rcd-utilities.el contains basic Emacs Lisp utilities used by other packages that we are publishing here @ GNU.Support

Simply save the below embedded code, then install it with:

{M-x package-install-file RET rcd-utilities.el RET}

The embedded code follows:

;;; rcd-utilities.el --- RCD utilities for GNU Emacs Lisp

;; Copyright (C) 2016-2020 Jean Louis

;; Author: Jean Louis <bugs@gnu.support>
;; Version: 1.0
;; Package-Requires:
;; Keywords: extensions
;; URL: https://gnu.support/gnu-emacs/packages/rcd-utilities-el.html

;; This file is not part of GNU Emacs.

;; This program is free software: you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation, either version 3 of the
;; License, or (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;; These are the RCD utilities for GNU Emacs Lisp used in other RCD
;; packages.
;;
;; RCD is acronym for Reach, Connect, Deliver, my personal
;; principle and formula for Wealth.

;;; Change Log:

;;; Code:

(setq lexical-binding t)

(require 'cl-lib)

(defun list-has (needle haystack)
  "Returns elements of haystack that contain needle, case insensitive"
  (let ((nlist))
    (dolist (element haystack (reverse nlist))
      (when (string-match needle element)
    (cl-pushnew element nlist)))))

(defun list-has-elements (needles haystack)
  "Returns elements of haystack that contain needle, case insensitive"
  (if needles
      (let* ((needle (pop needles))
         (haystack (list-has needle haystack)))
    (list-has-elements needles haystack))
    haystack))

(defun pop-buffer-highlight-elements (query list buffer)
  "Pops buffer, inserts lines from a list and highlights queried elements"
  (pop-to-buffer buffer)
    (local-set-key "q" 'quit-window)
    (dolist (line list)
      (insert line)
      (insert "\n"))
    (dolist (phrase query)
      (highlight-phrase phrase)))

(provide 'rcd-utilities)

;;; rcd-utilities.el ends here

or download the file from: https://gnu.support/files/emacs/packages/rcd-utilities.el

and install it with:

{M-x package-install-file RET rcd-utilities.el RET}

This file rcd-utilities.el is updated throughout the time with new functions.

Leave Your Comment or Contact GNU.Support

Contact GNU.Support now. There is a simple rule at GNU.Support: if we can help you, we do, whenever and wherever necessary, and it's the way we've been doing business since 2002, and the only way we know


Full name:


E-mail:


Message: