emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/hyperbole 7b083c7 3/3: hvar.el - add lexical binding up


From: ELPA Syncer
Subject: [elpa] externals/hyperbole 7b083c7 3/3: hvar.el - add lexical binding updates; del. old monkey-mode support
Date: Sun, 16 May 2021 16:57:11 -0400 (EDT)

branch: externals/hyperbole
commit 7b083c7882753a37c2aad793dc260081a7994481
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>

    hvar.el - add lexical binding updates; del. old monkey-mode support
---
 ChangeLog | 23 ++++++++++++++++-------
 hact.el   |  4 +++-
 hargs.el  | 12 ------------
 hvar.el   | 55 ++++++++++++++++++++++++++++++++++++-------------------
 4 files changed, 55 insertions(+), 39 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 46f03e3..d471885 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2021-05-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+* hvar.el: Add lexical binding updates.
+
+2021-05-16  Bob Weiner  <rsw@gnu.org>
+
+* hact.el (actype:act): Add error handler when actype is null
+    rather than checking for an action.
+
+* hargs.el (monkey-filename, hargs:at-p):
+  hibtypes.el (rfc): Remove ancient dired-like monkey-mode support.
+
 2021-05-16  Mats Lidell  <matsl@gnu.org>
 
 * Makefile (version): Do version number check in a portable way.
@@ -139,7 +151,7 @@
 * hpath.el (br-quit, br-in-browser, br-to-view-window): Add external
     dependencies.
 
-* kotl/kotl-mode.el (kotl-mode): Use write-file-functions
+* kotl/kotl-mode.el (kotl-mode): Use write-file-functions.
 
 2021-05-11  Mats Lidell  <matsl@gnu.org>
 
@@ -157,7 +169,7 @@
 
 * hui-mouse.el (tar-mode): Add require.
 
-* hpath.el (tramp): Require tramp
+* hpath.el (tramp): Require tramp.
 
 * hibtypes.el: (markdown-footnote-goto-text)
     (markdown-footnote-marker-positions, markdown-footnote-return)
@@ -172,12 +184,9 @@
     (debbugs-gnu-show-reports, debbugs-gnu-current-query):  Add external
     dependencies.
 
-* hbdata.el (hgnus): Require hgnus
-
-* hargs.el (monkey-filename): Add external dependency to public
-    declarations
+* hbdata.el (hgnus): Require hgnus.
 
-* hactypes.el (bookmark): Require bookmark
+* hactypes.el (bookmark): Require bookmark.
 
 2021-05-11  Bob Weiner  <rsw@gnu.org>
 
diff --git a/hact.el b/hact.el
index 3fe9211..3f957f1 100644
--- a/hact.el
+++ b/hact.el
@@ -392,10 +392,12 @@ If value is nil, however, t is returned instead, to 
ensure that implicit button
 types register the performance of the action.  ACTYPE may be a symbol or symbol
 name for either an action type or a function.  Runs `action-act-hook' before
 performing ACTION."
+  (when (null actype)
+    (error "(actype:act): No action type specified"))
   (let ((prefix-arg current-prefix-arg)
        (action (actype:action actype)))
     (if (null action)
-       (error "(actype:act): Null action for: `%s'" actype)
+       (error "(actype:act): Null action for action type: `%s'" actype)
       ;; Next 2 lines are needed so that relative paths are expanded
       ;; properly.  But in rare cases, this can improperly expand simple
       ;; string arguments like "tags" as a pathname, when it is not
diff --git a/hargs.el b/hargs.el
index dc4e8a1..65a2499 100644
--- a/hargs.el
+++ b/hargs.el
@@ -40,11 +40,6 @@
 (add-hook 'minibuffer-exit-hook  #'hargs:unset-string-to-complete)
 
 ;;; ************************************************************************
-;;; Public declarations
-;;; ************************************************************************
-(declare-function monkey-filename "ext:monkey")
-
-;;; ************************************************************************
 ;;; Private functions
 ;;; ************************************************************************
 
@@ -338,9 +333,6 @@ Handles all of the interactive argument types that 
`hargs:iform-read' does."
         (cond ((derived-mode-p 'dired-mode)
                (let ((file (dired-get-filename nil t)))
                  (and file (hpath:absolute-to file))))
-              ((eq major-mode 'monkey-mode)
-               (let ((file (monkey-filename t)))
-                 (and file (hpath:absolute-to file))))
               ;; Delimited file name.
               ((hpath:at-p 'file))
               ;; Unquoted remote file name.
@@ -355,10 +347,6 @@ Handles all of the interactive argument types that 
`hargs:iform-read' does."
                (let ((dir (dired-get-filename nil t)))
                  (and dir (setq dir (hpath:absolute-to dir))
                       (file-directory-p dir) dir)))
-              ((eq major-mode 'monkey-mode)
-               (let ((dir (monkey-filename t)))
-                 (and dir (setq dir (hpath:absolute-to dir))
-                      (file-directory-p dir) dir)))
               ;; Delimited directory name.
               ((hpath:at-p 'directory))
               ;; Unquoted remote directory name.
diff --git a/hvar.el b/hvar.el
index dd104b2..a930d00 100644
--- a/hvar.el
+++ b/hvar.el
@@ -1,10 +1,10 @@
-;;; hvar.el --- Variable manipulation routines for GNU Hyperbole
+;;; hvar.el --- Variable manipulation routines for GNU Hyperbole  -*- 
lexical-binding: t; -*-
 ;;
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:     1-Oct-91 at 14:00:24
 ;;
-;; Copyright (C) 1991-2016  Free Software Foundation, Inc.
+;; Copyright (C) 1991-2021  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
 ;;
 ;; This file is part of GNU Hyperbole.
@@ -19,6 +19,19 @@
 (require 'set)
 
 ;;; ************************************************************************
+;;; Forward declarations
+;;; ************************************************************************
+
+(defvar inhibit-hyperbole-messaging) ; ; Defined in `hsettings' required below
+
+;;; ************************************************************************
+;;; Private variables
+;;; ************************************************************************
+
+(defvar var::append-list nil
+  "List of (VAR-SYMBOL . APPENDED-LIST) elements saved from this Emacs 
session.")
+
+;;; ************************************************************************
 ;;; Public functions
 ;;; ************************************************************************
 
@@ -27,15 +40,15 @@
   "Add to HOOK (a symbol ending with -hook) HOOK-FUNCTION and then call 
HOOK-FUNCTION in every buffer with the matching major mode based on HOOK's 
name."
   (add-hook hook hook-function)
   (let* ((hook-name (symbol-name hook))
-            (mode (when (string-match "-hooks?\\'" hook-name)
-                        (intern (substring hook-name 0 (match-beginning 0))))))
+        (mode (when (string-match "-hooks?\\'" hook-name)
+                (intern (substring hook-name 0 (match-beginning 0))))))
     (when mode (var:run-hook-in-matching-buffers mode hook-function))))
 
 (defun var:append-all ()
   "Add back all hook values previously added by var:append in this Emacs 
session.
 The ones that were removed by var:remove-all at some point."
   (mapc (lambda (elt) (var:append (car elt) (cdr elt)))
-           var::append-list)
+       var::append-list)
   var::append-list)
 
 ;;;###autoload
@@ -51,15 +64,15 @@ Do nothing when `inhibit-hyperbole-messaging' is non-nil."
   (unless inhibit-hyperbole-messaging
     (let ((val) result)
       (setq result
-               (if (and (boundp var-symbol)
-                            (setq val (symbol-value var-symbol))
-                            (or (when (symbolp val)
-                                      (setq val (cons val nil)))
-                                    (listp val)))
-                       (progn (when (eq (car val) 'lambda)
-                                    (setq val (list val)))
-                              (set var-symbol (set:union val list-to-add)))
-                 (set var-symbol list-to-add)))
+           (if (and (boundp var-symbol)
+                    (setq val (symbol-value var-symbol))
+                    (or (when (symbolp val)
+                          (setq val (cons val nil)))
+                        (listp val)))
+               (progn (when (functionp val)
+                        (setq val (list val)))
+                      (set var-symbol (set:union val list-to-add)))
+             (set var-symbol list-to-add)))
       (add-to-list 'var::append-list (cons var-symbol result))
       (symbol-value var-symbol))))
 
@@ -73,7 +86,7 @@ Use to remove from hook variables."
   (when (eq (car list-to-remove) 'lambda)
     (setq list-to-remove (list list-to-remove)))
   (mapc (lambda (func) (remove-hook var-symbol func))
-           list-to-remove)
+       list-to-remove)
   (setq var::append-list (delete (cons var-symbol list-to-remove) 
var::append-list))
   (symbol-value var-symbol))
 
@@ -81,16 +94,16 @@ Use to remove from hook variables."
   "Remove all hook values added by var:append in this Emacs session from their 
associated hook variables.
 Keeps a copy of these values for future re-use."
   (mapc (lambda (elt) (var:remove (car elt) (cdr elt)))
-           var::append-list)
+       var::append-list)
   var::append-list)
 
 (defun var:run-hook-in-matching-buffers (mode hook-function)
   "For a given major MODE (a symbol) call HOOK-FUNCTION in all existing 
buffers with that major mode.
 This is used after a hook is changed to affect buffers that existed before the 
change was made."
   (mapc (lambda (buf) (with-current-buffer buf (funcall hook-function)))
-           (delq nil (mapcar (lambda (buf) (when (eq (buffer-local-value 
'major-mode buf) mode)
-                                                             buf))
-                                     (buffer-list)))))
+       (delq nil (mapcar (lambda (buf) (when (eq (buffer-local-value 
'major-mode buf) mode)
+                                         buf))
+                         (buffer-list)))))
 
 ;;; ************************************************************************
 ;;; Private variables
@@ -102,4 +115,8 @@ This is used after a hook is changed to affect buffers that 
existed before the c
 (provide 'hvar)
 
 
+;; `hsettings' and `hvar' have a cyclic dependency; require this after 
providing 'hvar
+;; to avoid an infinite loop.
+(require 'hsettings)
+
 ;;; hvar.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]