Function: smart-asm-include-file

smart-asm-include-file is a byte-compiled function defined in hmouse-tag.el.

Signature

(smart-asm-include-file)

Documentation

If point is on an include file line, try to display file.

Returns non-nil iff on an include file line, even if file is not found. Look for include file in smart-asm-include-path and add suffix ".ins" or
".inc" to filename if it lacks a suffix.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hmouse-tag.el
(defun smart-asm-include-file ()
  "If point is on an include file line, try to display file.
Returns non-nil iff on an include file line, even if file is not found.
Look for include file in `smart-asm-include-path' and add suffix \".ins\" or
\".inc\" to filename if it lacks a suffix."
  (let ((opoint (point)))
    ;; Some assemblers utilize the C preprocessor, so try that first.
    (cond ((smart-c-include-file))
	  ((progn (beginning-of-line)
		  (looking-at smart-asm-include-regexp))
	   (let ((file (buffer-substring-no-properties (match-beginning 2) (match-end 2)))
		 (path)
		 (dir-list smart-asm-include-path))
	     (goto-char opoint)
	     (setq dir-list (cons (file-name-directory (hypb:buffer-file-name))
				  dir-list))
	     (if (string-match "\\." file)
		 (setq file (regexp-quote file))
	       (setq file (concat (regexp-quote file) "\\.in[sc]$")))
	     (while dir-list
	       (setq dir-list
		     (if (setq path (car (directory-files
					  (car dir-list) t file)))
			 nil
		       (cdr dir-list))))
	     ;;
	     ;; If path exists, display file
	     ;;
	     (if path
		 (unless (and (file-readable-p path)
			      (progn
				(hpath:find path)
				(or (require 'asm-mode nil t)
				    (progn (message "(smart-asm-include-file):  asm-mode undefined")
					   nil))))
		   (beep)
		   (message "(smart-asm-include-file):  `%s' unreadable" path))
	       (beep)
	       (message "(smart-asm-include-file):  `%s' not found" file))
	     path))
	  ;; not on an include file line
	  (t (goto-char opoint)
	     nil))))